• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /* Amalgamated source file */
2 
3 /*
4  * This is where we define internal portability macros used across upb.
5  *
6  * All of these macros are undef'd in undef.inc to avoid leaking them to users.
7  *
8  * The correct usage is:
9  *
10  *   #include "upb/foobar.h"
11  *   #include "upb/baz.h"
12  *
13  *   // MUST be last included header.
14  *   #include "upb/port/def.inc"
15  *
16  *   // Code for this file.
17  *   // <...>
18  *
19  *   // Can be omitted for .c files, required for .h.
20  *   #include "upb/port/undef.inc"
21  *
22  * This file is private and must not be included by users!
23  */
24 
25 #if !((defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L) || \
26       (defined(__cplusplus) && __cplusplus >= 201402L) ||           \
27       (defined(_MSC_VER) && _MSC_VER >= 1900))
28 #error upb requires C99 or C++14 or MSVC >= 2015.
29 #endif
30 
31 // Portable check for GCC minimum version:
32 // https://gcc.gnu.org/onlinedocs/cpp/Common-Predefined-Macros.html
33 #if defined(__GNUC__) && defined(__GNUC_MINOR__) && defined(__GNUC_PATCHLEVEL__)
34 #define UPB_GNUC_MIN(x, y) \
35   (__GNUC__ > (x) || __GNUC__ == (x) && __GNUC_MINOR__ >= (y))
36 #else
37 #define UPB_GNUC_MIN(x, y) 0
38 #endif
39 
40 #include <assert.h>
41 #include <setjmp.h>
42 #include <stdbool.h>
43 #include <stdint.h>
44 #include <stdio.h>
45 #include <stdlib.h>
46 
47 #ifndef UINTPTR_MAX
48 Error, UINTPTR_MAX is undefined
49 #endif
50 
51 #if UINTPTR_MAX == 0xffffffff
52 #define UPB_SIZE(size32, size64) size32
53 #else
54 #define UPB_SIZE(size32, size64) size64
55 #endif
56 
57 /* If we always read/write as a consistent type to each address, this shouldn't
58  * violate aliasing.
59  */
60 #define UPB_PTR_AT(msg, ofs, type) ((type*)((char*)(msg) + (ofs)))
61 
62 #define UPB_MAPTYPE_STRING 0
63 
64 // UPB_EXPORT: always generate a public symbol.
65 #if defined(__GNUC__) || defined(__clang__)
66 #define UPB_EXPORT __attribute__((visibility("default"))) __attribute__((used))
67 #else
68 #define UPB_EXPORT
69 #endif
70 
71 // UPB_INLINE: inline if possible, emit standalone code if required.
72 #ifdef __cplusplus
73 #define UPB_INLINE inline
74 #elif defined (__GNUC__) || defined(__clang__)
75 #define UPB_INLINE static __inline__
76 #else
77 #define UPB_INLINE static
78 #endif
79 
80 #ifdef UPB_BUILD_API
81 #define UPB_API UPB_EXPORT
82 #define UPB_API_INLINE UPB_EXPORT
83 #else
84 #define UPB_API
85 #define UPB_API_INLINE UPB_INLINE
86 #endif
87 
88 #ifdef EXPORT_UPBC
89 #define UPBC_API UPB_EXPORT
90 #else
91 #define UPBC_API
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 #ifdef __clang__
99 #define UPB_ALIGN_OF(type) _Alignof(type)
100 #else
101 #define UPB_ALIGN_OF(type) offsetof (struct { char c; type member; }, member)
102 #endif
103 
104 #ifdef _MSC_VER
105 // Some versions of our Windows compiler don't support the C11 syntax.
106 #define UPB_ALIGN_AS(x) __declspec(align(x))
107 #else
108 #define UPB_ALIGN_AS(x) _Alignas(x)
109 #endif
110 
111 // Hints to the compiler about likely/unlikely branches.
112 #if defined (__GNUC__) || defined(__clang__)
113 #define UPB_LIKELY(x) __builtin_expect((bool)(x), 1)
114 #define UPB_UNLIKELY(x) __builtin_expect((bool)(x), 0)
115 #else
116 #define UPB_LIKELY(x) (x)
117 #define UPB_UNLIKELY(x) (x)
118 #endif
119 
120 // Macros for function attributes on compilers that support them.
121 #ifdef __GNUC__
122 #define UPB_FORCEINLINE __inline__ __attribute__((always_inline)) static
123 #define UPB_NOINLINE __attribute__((noinline))
124 #define UPB_NORETURN __attribute__((__noreturn__))
125 #define UPB_PRINTF(str, first_vararg) __attribute__((format (printf, str, first_vararg)))
126 #elif defined(_MSC_VER)
127 #define UPB_NOINLINE
128 #define UPB_FORCEINLINE static
129 #define UPB_NORETURN __declspec(noreturn)
130 #define UPB_PRINTF(str, first_vararg)
131 #else  /* !defined(__GNUC__) */
132 #define UPB_FORCEINLINE static
133 #define UPB_NOINLINE
134 #define UPB_NORETURN
135 #define UPB_PRINTF(str, first_vararg)
136 #endif
137 
138 #define UPB_MAX(x, y) ((x) > (y) ? (x) : (y))
139 #define UPB_MIN(x, y) ((x) < (y) ? (x) : (y))
140 
141 #define UPB_UNUSED(var) (void)var
142 
143 // UPB_ASSUME(): in release mode, we tell the compiler to assume this is true.
144 #ifdef NDEBUG
145 #ifdef __GNUC__
146 #define UPB_ASSUME(expr) if (!(expr)) __builtin_unreachable()
147 #elif defined _MSC_VER
148 #define UPB_ASSUME(expr) if (!(expr)) __assume(0)
149 #else
150 #define UPB_ASSUME(expr) do {} while (false && (expr))
151 #endif
152 #else
153 #define UPB_ASSUME(expr) assert(expr)
154 #endif
155 
156 /* UPB_ASSERT(): in release mode, we use the expression without letting it be
157  * evaluated.  This prevents "unused variable" warnings. */
158 #ifdef NDEBUG
159 #define UPB_ASSERT(expr) do {} while (false && (expr))
160 #else
161 #define UPB_ASSERT(expr) assert(expr)
162 #endif
163 
164 #if defined(__GNUC__) || defined(__clang__)
165 #define UPB_UNREACHABLE() do { assert(0); __builtin_unreachable(); } while(0)
166 #elif defined(_MSC_VER)
167 #define UPB_UNREACHABLE() \
168   do {                    \
169     assert(0);            \
170     __assume(0);          \
171   } while (0)
172 #else
173 #define UPB_UNREACHABLE() do { assert(0); } while(0)
174 #endif
175 
176 /* UPB_SETJMP() / UPB_LONGJMP(): avoid setting/restoring signal mask. */
177 #ifdef __APPLE__
178 #define UPB_SETJMP(buf) _setjmp(buf)
179 #define UPB_LONGJMP(buf, val) _longjmp(buf, val)
180 #elif defined(WASM_WAMR)
181 #define UPB_SETJMP(buf) 0
182 #define UPB_LONGJMP(buf, val) abort()
183 #else
184 #define UPB_SETJMP(buf) setjmp(buf)
185 #define UPB_LONGJMP(buf, val) longjmp(buf, val)
186 #endif
187 
188 #ifdef __GNUC__
189 #define UPB_USE_C11_ATOMICS
190 #define UPB_ATOMIC(T) _Atomic(T)
191 #else
192 #define UPB_ATOMIC(T) T
193 #endif
194 
195 /* UPB_PTRADD(ptr, ofs): add pointer while avoiding "NULL + 0" UB */
196 #define UPB_PTRADD(ptr, ofs) ((ofs) ? (ptr) + (ofs) : (ptr))
197 
198 #define UPB_PRIVATE(x) x##_dont_copy_me__upb_internal_use_only
199 
200 #ifdef UPB_ALLOW_PRIVATE_ACCESS__FOR_BITS_ONLY
201 #define UPB_ONLYBITS(x) x
202 #else
203 #define UPB_ONLYBITS(x) UPB_PRIVATE(x)
204 #endif
205 
206 /* Configure whether fasttable is switched on or not. *************************/
207 
208 #ifdef __has_attribute
209 #define UPB_HAS_ATTRIBUTE(x) __has_attribute(x)
210 #else
211 #define UPB_HAS_ATTRIBUTE(x) 0
212 #endif
213 
214 #if UPB_HAS_ATTRIBUTE(musttail)
215 #define UPB_MUSTTAIL __attribute__((musttail))
216 #else
217 #define UPB_MUSTTAIL
218 #endif
219 
220 #undef UPB_HAS_ATTRIBUTE
221 
222 /* This check is not fully robust: it does not require that we have "musttail"
223  * support available. We need tail calls to avoid consuming arbitrary amounts
224  * of stack space.
225  *
226  * GCC/Clang can mostly be trusted to generate tail calls as long as
227  * optimization is enabled, but, debug builds will not generate tail calls
228  * unless "musttail" is available.
229  *
230  * We should probably either:
231  *   1. require that the compiler supports musttail.
232  *   2. add some fallback code for when musttail isn't available (ie. return
233  *      instead of tail calling). This is safe and portable, but this comes at
234  *      a CPU cost.
235  */
236 #if (defined(__x86_64__) || defined(__aarch64__)) && defined(__GNUC__)
237 #define UPB_FASTTABLE_SUPPORTED 1
238 #else
239 #define UPB_FASTTABLE_SUPPORTED 0
240 #endif
241 
242 /* define UPB_ENABLE_FASTTABLE to force fast table support.
243  * This is useful when we want to ensure we are really getting fasttable,
244  * for example for testing or benchmarking. */
245 #if defined(UPB_ENABLE_FASTTABLE)
246 #if !UPB_FASTTABLE_SUPPORTED
247 #error fasttable is x86-64/ARM64 only and requires GCC or Clang.
248 #endif
249 #define UPB_FASTTABLE 1
250 /* Define UPB_TRY_ENABLE_FASTTABLE to use fasttable if possible.
251  * This is useful for releasing code that might be used on multiple platforms,
252  * for example the PHP or Ruby C extensions. */
253 #elif defined(UPB_TRY_ENABLE_FASTTABLE)
254 #define UPB_FASTTABLE UPB_FASTTABLE_SUPPORTED
255 #else
256 #define UPB_FASTTABLE 0
257 #endif
258 
259 /* UPB_FASTTABLE_INIT() allows protos compiled for fasttable to gracefully
260  * degrade to non-fasttable if the runtime or platform do not support it. */
261 #if !UPB_FASTTABLE
262 #define UPB_FASTTABLE_INIT(...)
263 #define UPB_FASTTABLE_MASK(mask) -1
264 #else
265 #define UPB_FASTTABLE_INIT(...) __VA_ARGS__
266 #define UPB_FASTTABLE_MASK(mask) mask
267 #endif
268 
269 #undef UPB_FASTTABLE_SUPPORTED
270 
271 /* ASAN poisoning (for arena).
272  * If using UPB from an interpreted language like Ruby, a build of the
273  * interpreter compiled with ASAN enabled must be used in order to get sane and
274  * expected behavior.
275  */
276 
277 /* Due to preprocessor limitations, the conditional logic for setting
278  * UPN_CLANG_ASAN below cannot be consolidated into a portable one-liner.
279  * See https://gcc.gnu.org/onlinedocs/cpp/_005f_005fhas_005fattribute.html.
280  */
281 #if defined(__has_feature)
282 #if __has_feature(address_sanitizer)
283 #define UPB_CLANG_ASAN 1
284 #else
285 #define UPB_CLANG_ASAN 0
286 #endif
287 #else
288 #define UPB_CLANG_ASAN 0
289 #endif
290 
291 #if defined(__SANITIZE_ADDRESS__) || UPB_CLANG_ASAN
292 #define UPB_ASAN 1
293 #define UPB_ASAN_GUARD_SIZE 32
294 #ifdef __cplusplus
295     extern "C" {
296 #endif
297 void __asan_poison_memory_region(void const volatile *addr, size_t size);
298 void __asan_unpoison_memory_region(void const volatile *addr, size_t size);
299 #ifdef __cplusplus
300 }  /* extern "C" */
301 #endif
302 #define UPB_POISON_MEMORY_REGION(addr, size) \
303   __asan_poison_memory_region((addr), (size))
304 #define UPB_UNPOISON_MEMORY_REGION(addr, size) \
305   __asan_unpoison_memory_region((addr), (size))
306 #else
307 #define UPB_ASAN 0
308 #define UPB_ASAN_GUARD_SIZE 0
309 #define UPB_POISON_MEMORY_REGION(addr, size) \
310   ((void)(addr), (void)(size))
311 #define UPB_UNPOISON_MEMORY_REGION(addr, size) \
312   ((void)(addr), (void)(size))
313 #endif
314 
315 /* Disable proto2 arena behavior (TEMPORARY) **********************************/
316 
317 #ifdef UPB_DISABLE_CLOSED_ENUM_CHECKING
318 #define UPB_TREAT_CLOSED_ENUMS_LIKE_OPEN 1
319 #else
320 #define UPB_TREAT_CLOSED_ENUMS_LIKE_OPEN 0
321 #endif
322 
323 #if defined(__cplusplus)
324 #if defined(__clang__) || UPB_GNUC_MIN(6, 0)
325 // https://gcc.gnu.org/gcc-6/changes.html
326 #if __cplusplus >= 201402L
327 #define UPB_DEPRECATED [[deprecated]]
328 #else
329 #define UPB_DEPRECATED __attribute__((deprecated))
330 #endif
331 #else
332 #define UPB_DEPRECATED
333 #endif
334 #else
335 #define UPB_DEPRECATED
336 #endif
337 
338 #if defined(UPB_IS_GOOGLE3) && \
339     (!defined(UPB_BOOTSTRAP_STAGE) || UPB_BOOTSTRAP_STAGE != 0)
340 #define UPB_DESC(sym) proto2_##sym
341 #define UPB_DESC_MINITABLE(sym) &proto2__##sym##_msg_init
342 #elif defined(UPB_BOOTSTRAP_STAGE) && UPB_BOOTSTRAP_STAGE == 0
343 #define UPB_DESC(sym) google_protobuf_##sym
344 #define UPB_DESC_MINITABLE(sym) google__protobuf__##sym##_msg_init()
345 #else
346 #define UPB_DESC(sym) google_protobuf_##sym
347 #define UPB_DESC_MINITABLE(sym) &google__protobuf__##sym##_msg_init
348 #endif
349 
350 #undef UPB_IS_GOOGLE3
351 
352 // Linker arrays combine elements from multiple translation units into a single
353 // array that can be iterated over at runtime.
354 //
355 // It is an alternative to pre-main "registration" functions.
356 //
357 // Usage:
358 //
359 //   // In N translation units.
360 //   UPB_LINKARR_APPEND(foo_array) static int elems[3] = {1, 2, 3};
361 //
362 //   // At runtime:
363 //   UPB_LINKARR_DECLARE(foo_array, int);
364 //
365 //   void f() {
366 //     const int* start = UPB_LINKARR_START(foo_array);
367 //     const int* stop = UPB_LINKARR_STOP(foo_array);
368 //     for (const int* p = start; p < stop; p++) {
369 //       // Windows can introduce zero padding, so we have to skip zeroes.
370 //       if (*p != 0) {
371 //         vec.push_back(*p);
372 //       }
373 //     }
374 //   }
375 
376 #if defined(__ELF__) || defined(__wasm__)
377 
378 #define UPB_LINKARR_APPEND(name) \
379   __attribute__((retain, used, section("linkarr_" #name)))
380 #define UPB_LINKARR_DECLARE(name, type)     \
381   extern type const __start_linkarr_##name; \
382   extern type const __stop_linkarr_##name;  \
383   UPB_LINKARR_APPEND(name) type UPB_linkarr_internal_empty_##name[1]
384 #define UPB_LINKARR_START(name) (&__start_linkarr_##name)
385 #define UPB_LINKARR_STOP(name) (&__stop_linkarr_##name)
386 
387 #elif defined(__MACH__)
388 
389 /* As described in: https://stackoverflow.com/a/22366882 */
390 #define UPB_LINKARR_APPEND(name) \
391   __attribute__((retain, used, section("__DATA,__la_" #name)))
392 #define UPB_LINKARR_DECLARE(name, type)           \
393   extern type const __start_linkarr_##name __asm( \
394       "section$start$__DATA$__la_" #name);        \
395   extern type const __stop_linkarr_##name __asm(  \
396       "section$end$__DATA$"                       \
397       "__la_" #name);                             \
398   UPB_LINKARR_APPEND(name) type UPB_linkarr_internal_empty_##name[1]
399 #define UPB_LINKARR_START(name) (&__start_linkarr_##name)
400 #define UPB_LINKARR_STOP(name) (&__stop_linkarr_##name)
401 
402 #elif defined(_MSC_VER) && defined(__clang__)
403 
404 /* See:
405  *   https://devblogs.microsoft.com/oldnewthing/20181107-00/?p=100155
406  *   https://devblogs.microsoft.com/oldnewthing/20181108-00/?p=100165
407  *   https://devblogs.microsoft.com/oldnewthing/20181109-00/?p=100175 */
408 
409 // Usage of __attribute__ here probably means this is Clang-specific, and would
410 // not work on MSVC.
411 #define UPB_LINKARR_APPEND(name) \
412   __declspec(allocate("la_" #name "$j")) __attribute__((retain, used))
413 #define UPB_LINKARR_DECLARE(name, type)                               \
414   __declspec(allocate("la_" #name "$a")) type __start_linkarr_##name; \
415   __declspec(allocate("la_" #name "$z")) type __stop_linkarr_##name;  \
416   UPB_LINKARR_APPEND(name) type UPB_linkarr_internal_empty_##name[1] = {0}
417 #define UPB_LINKARR_START(name) (&__start_linkarr_##name)
418 #define UPB_LINKARR_STOP(name) (&__stop_linkarr_##name)
419 
420 #else
421 
422 // Linker arrays are not supported on this platform.  Make appends a no-op but
423 // don't define the other macros.
424 #define UPB_LINKARR_APPEND(name)
425 
426 #endif
427 
428 // Future versions of upb will include breaking changes to some APIs.
429 // This macro can be set to enable these API changes ahead of time, so that
430 // user code can be updated before upgrading versions of protobuf.
431 #ifdef UPB_FUTURE_BREAKING_CHANGES
432 
433 // Properly enforce closed enums in python.
434 // Owner: mkruskal@
435 #define UPB_FUTURE_PYTHON_CLOSED_ENUM_ENFORCEMENT 1
436 
437 #endif
438 
439 #ifndef UPB_BASE_STATUS_H_
440 #define UPB_BASE_STATUS_H_
441 
442 #include <stdarg.h>
443 
444 // Must be last.
445 
446 #define _kUpb_Status_MaxMessage 511
447 
448 typedef struct {
449   bool ok;
450   char msg[_kUpb_Status_MaxMessage];  // Error message; NULL-terminated.
451 } upb_Status;
452 
453 #ifdef __cplusplus
454 extern "C" {
455 #endif
456 
457 UPB_API const char* upb_Status_ErrorMessage(const upb_Status* status);
458 UPB_API bool upb_Status_IsOk(const upb_Status* status);
459 
460 // These are no-op if |status| is NULL.
461 UPB_API void upb_Status_Clear(upb_Status* status);
462 void upb_Status_SetErrorMessage(upb_Status* status, const char* msg);
463 void upb_Status_SetErrorFormat(upb_Status* status, const char* fmt, ...)
464     UPB_PRINTF(2, 3);
465 void upb_Status_VSetErrorFormat(upb_Status* status, const char* fmt,
466                                 va_list args) UPB_PRINTF(2, 0);
467 void upb_Status_VAppendErrorFormat(upb_Status* status, const char* fmt,
468                                    va_list args) UPB_PRINTF(2, 0);
469 
470 #ifdef __cplusplus
471 } /* extern "C" */
472 #endif
473 
474 
475 #endif /* UPB_BASE_STATUS_H_ */
476 
477 #ifndef UPB_WIRE_EPS_COPY_INPUT_STREAM_H_
478 #define UPB_WIRE_EPS_COPY_INPUT_STREAM_H_
479 
480 #include <string.h>
481 
482 
483 /* upb_Arena is a specific allocator implementation that uses arena allocation.
484  * The user provides an allocator that will be used to allocate the underlying
485  * arena blocks.  Arenas by nature do not require the individual allocations
486  * to be freed.  However the Arena does allow users to register cleanup
487  * functions that will run when the arena is destroyed.
488  *
489  * A upb_Arena is *not* thread-safe.
490  *
491  * You could write a thread-safe arena allocator that satisfies the
492  * upb_alloc interface, but it would not be as efficient for the
493  * single-threaded case. */
494 
495 #ifndef UPB_MEM_ARENA_H_
496 #define UPB_MEM_ARENA_H_
497 
498 #include <stddef.h>
499 #include <stdint.h>
500 
501 
502 #ifndef UPB_MEM_ALLOC_H_
503 #define UPB_MEM_ALLOC_H_
504 
505 // Must be last.
506 
507 #ifdef __cplusplus
508 extern "C" {
509 #endif
510 
511 typedef struct upb_alloc upb_alloc;
512 
513 /* A combined `malloc()`/`free()` function.
514  * If `size` is 0 then the function acts like `free()`, otherwise it acts like
515  * `realloc()`.  Only `oldsize` bytes from a previous allocation are
516  * preserved. */
517 typedef void* upb_alloc_func(upb_alloc* alloc, void* ptr, size_t oldsize,
518                              size_t size);
519 
520 /* A upb_alloc is a possibly-stateful allocator object.
521  *
522  * It could either be an arena allocator (which doesn't require individual
523  * `free()` calls) or a regular `malloc()` (which does).  The client must
524  * therefore free memory unless it knows that the allocator is an arena
525  * allocator. */
526 struct upb_alloc {
527   upb_alloc_func* func;
528 };
529 
upb_malloc(upb_alloc * alloc,size_t size)530 UPB_INLINE void* upb_malloc(upb_alloc* alloc, size_t size) {
531   UPB_ASSERT(alloc);
532   return alloc->func(alloc, NULL, 0, size);
533 }
534 
upb_realloc(upb_alloc * alloc,void * ptr,size_t oldsize,size_t size)535 UPB_INLINE void* upb_realloc(upb_alloc* alloc, void* ptr, size_t oldsize,
536                              size_t size) {
537   UPB_ASSERT(alloc);
538   return alloc->func(alloc, ptr, oldsize, size);
539 }
540 
upb_free(upb_alloc * alloc,void * ptr)541 UPB_INLINE void upb_free(upb_alloc* alloc, void* ptr) {
542   UPB_ASSERT(alloc);
543   alloc->func(alloc, ptr, 0, 0);
544 }
545 
546 // The global allocator used by upb. Uses the standard malloc()/free().
547 
548 extern upb_alloc upb_alloc_global;
549 
550 /* Functions that hard-code the global malloc.
551  *
552  * We still get benefit because we can put custom logic into our global
553  * allocator, like injecting out-of-memory faults in debug/testing builds. */
554 
upb_gmalloc(size_t size)555 UPB_INLINE void* upb_gmalloc(size_t size) {
556   return upb_malloc(&upb_alloc_global, size);
557 }
558 
upb_grealloc(void * ptr,size_t oldsize,size_t size)559 UPB_INLINE void* upb_grealloc(void* ptr, size_t oldsize, size_t size) {
560   return upb_realloc(&upb_alloc_global, ptr, oldsize, size);
561 }
562 
upb_gfree(void * ptr)563 UPB_INLINE void upb_gfree(void* ptr) { upb_free(&upb_alloc_global, ptr); }
564 
565 #ifdef __cplusplus
566 } /* extern "C" */
567 #endif
568 
569 
570 #endif /* UPB_MEM_ALLOC_H_ */
571 
572 #ifndef UPB_MEM_INTERNAL_ARENA_H_
573 #define UPB_MEM_INTERNAL_ARENA_H_
574 
575 #include <stddef.h>
576 #include <stdint.h>
577 #include <string.h>
578 
579 // Must be last.
580 
581 // This is QUITE an ugly hack, which specifies the number of pointers needed
582 // to equal (or exceed) the storage required for one upb_Arena.
583 //
584 // We need this because the decoder inlines a upb_Arena for performance but
585 // the full struct is not visible outside of arena.c. Yes, I know, it's awful.
586 #define UPB_ARENA_SIZE_HACK 7
587 
588 // LINT.IfChange(upb_Arena)
589 
590 struct upb_Arena {
591   char* UPB_ONLYBITS(ptr);
592   char* UPB_ONLYBITS(end);
593 };
594 
595 // LINT.ThenChange(//depot/google3/third_party/upb/bits/typescript/arena.ts:upb_Arena)
596 
597 #ifdef __cplusplus
598 extern "C" {
599 #endif
600 
601 void UPB_PRIVATE(_upb_Arena_SwapIn)(struct upb_Arena* des,
602                                     const struct upb_Arena* src);
603 void UPB_PRIVATE(_upb_Arena_SwapOut)(struct upb_Arena* des,
604                                      const struct upb_Arena* src);
605 
606 // Returns whether |ptr| was allocated directly by |a| (so care must be used
607 // with fused arenas).
608 UPB_API bool UPB_ONLYBITS(_upb_Arena_Contains)(const struct upb_Arena* a,
609                                                void* ptr);
610 
UPB_PRIVATE(_upb_ArenaHas)611 UPB_INLINE size_t UPB_PRIVATE(_upb_ArenaHas)(const struct upb_Arena* a) {
612   return (size_t)(a->UPB_ONLYBITS(end) - a->UPB_ONLYBITS(ptr));
613 }
614 
upb_Arena_Malloc(struct upb_Arena * a,size_t size)615 UPB_API_INLINE void* upb_Arena_Malloc(struct upb_Arena* a, size_t size) {
616   void* UPB_PRIVATE(_upb_Arena_SlowMalloc)(struct upb_Arena * a, size_t size);
617 
618   size = UPB_ALIGN_MALLOC(size);
619   const size_t span = size + UPB_ASAN_GUARD_SIZE;
620   if (UPB_UNLIKELY(UPB_PRIVATE(_upb_ArenaHas)(a) < span)) {
621     return UPB_PRIVATE(_upb_Arena_SlowMalloc)(a, span);
622   }
623 
624   // We have enough space to do a fast malloc.
625   void* ret = a->UPB_ONLYBITS(ptr);
626   UPB_ASSERT(UPB_ALIGN_MALLOC((uintptr_t)ret) == (uintptr_t)ret);
627   UPB_ASSERT(UPB_ALIGN_MALLOC(size) == size);
628   UPB_UNPOISON_MEMORY_REGION(ret, size);
629 
630   a->UPB_ONLYBITS(ptr) += span;
631 
632   return ret;
633 }
634 
upb_Arena_Realloc(struct upb_Arena * a,void * ptr,size_t oldsize,size_t size)635 UPB_API_INLINE void* upb_Arena_Realloc(struct upb_Arena* a, void* ptr,
636                                        size_t oldsize, size_t size) {
637   oldsize = UPB_ALIGN_MALLOC(oldsize);
638   size = UPB_ALIGN_MALLOC(size);
639   bool is_most_recent_alloc =
640       (uintptr_t)ptr + oldsize == (uintptr_t)a->UPB_ONLYBITS(ptr);
641 
642   if (is_most_recent_alloc) {
643     ptrdiff_t diff = size - oldsize;
644     if ((ptrdiff_t)UPB_PRIVATE(_upb_ArenaHas)(a) >= diff) {
645       a->UPB_ONLYBITS(ptr) += diff;
646       return ptr;
647     }
648   } else if (size <= oldsize) {
649     return ptr;
650   }
651 
652   void* ret = upb_Arena_Malloc(a, size);
653 
654   if (ret && oldsize > 0) {
655     memcpy(ret, ptr, UPB_MIN(oldsize, size));
656   }
657 
658   return ret;
659 }
660 
upb_Arena_ShrinkLast(struct upb_Arena * a,void * ptr,size_t oldsize,size_t size)661 UPB_API_INLINE void upb_Arena_ShrinkLast(struct upb_Arena* a, void* ptr,
662                                          size_t oldsize, size_t size) {
663   oldsize = UPB_ALIGN_MALLOC(oldsize);
664   size = UPB_ALIGN_MALLOC(size);
665   // Must be the last alloc.
666   UPB_ASSERT((char*)ptr + oldsize ==
667              a->UPB_ONLYBITS(ptr) - UPB_ASAN_GUARD_SIZE);
668   UPB_ASSERT(size <= oldsize);
669   a->UPB_ONLYBITS(ptr) = (char*)ptr + size;
670 }
671 
672 #ifdef __cplusplus
673 } /* extern "C" */
674 #endif
675 
676 
677 #endif /* UPB_MEM_INTERNAL_ARENA_H_ */
678 
679 // Must be last.
680 
681 typedef struct upb_Arena upb_Arena;
682 
683 #ifdef __cplusplus
684 extern "C" {
685 #endif
686 
687 // Creates an arena from the given initial block (if any -- n may be 0).
688 // Additional blocks will be allocated from |alloc|.  If |alloc| is NULL, this
689 // is a fixed-size arena and cannot grow.
690 UPB_API upb_Arena* upb_Arena_Init(void* mem, size_t n, upb_alloc* alloc);
691 
692 UPB_API void upb_Arena_Free(upb_Arena* a);
693 UPB_API bool upb_Arena_Fuse(upb_Arena* a, upb_Arena* b);
694 
695 bool upb_Arena_IncRefFor(upb_Arena* a, const void* owner);
696 void upb_Arena_DecRefFor(upb_Arena* a, const void* owner);
697 
698 size_t upb_Arena_SpaceAllocated(upb_Arena* a, size_t* fused_count);
699 uint32_t upb_Arena_DebugRefCount(upb_Arena* a);
700 
upb_Arena_New(void)701 UPB_API_INLINE upb_Arena* upb_Arena_New(void) {
702   return upb_Arena_Init(NULL, 0, &upb_alloc_global);
703 }
704 
705 UPB_API_INLINE void* upb_Arena_Malloc(struct upb_Arena* a, size_t size);
706 
707 UPB_API_INLINE void* upb_Arena_Realloc(upb_Arena* a, void* ptr, size_t oldsize,
708                                        size_t size);
709 
710 // Sets the maximum block size for all arenas. This is a global configuration
711 // setting that will affect all existing and future arenas. If
712 // upb_Arena_Malloc() is called with a size larger than this, we will exceed
713 // this size and allocate a larger block.
714 //
715 // This API is meant for experimentation only. It will likely be removed in
716 // the future.
717 void upb_Arena_SetMaxBlockSize(size_t max);
718 
719 // Shrinks the last alloc from arena.
720 // REQUIRES: (ptr, oldsize) was the last malloc/realloc from this arena.
721 // We could also add a upb_Arena_TryShrinkLast() which is simply a no-op if
722 // this was not the last alloc.
723 UPB_API_INLINE void upb_Arena_ShrinkLast(upb_Arena* a, void* ptr,
724                                          size_t oldsize, size_t size);
725 
726 #ifdef UPB_TRACING_ENABLED
727 void upb_Arena_SetTraceHandler(void (*initArenaTraceHandler)(const upb_Arena*,
728                                                              size_t size),
729                                void (*fuseArenaTraceHandler)(const upb_Arena*,
730                                                              const upb_Arena*),
731                                void (*freeArenaTraceHandler)(const upb_Arena*));
732 #endif
733 
734 #ifdef __cplusplus
735 } /* extern "C" */
736 #endif
737 
738 
739 #endif /* UPB_MEM_ARENA_H_ */
740 
741 // Must be last.
742 
743 #ifdef __cplusplus
744 extern "C" {
745 #endif
746 
747 // The maximum number of bytes a single protobuf field can take up in the
748 // wire format.  We only want to do one bounds check per field, so the input
749 // stream guarantees that after upb_EpsCopyInputStream_IsDone() is called,
750 // the decoder can read this many bytes without performing another bounds
751 // check.  The stream will copy into a patch buffer as necessary to guarantee
752 // this invariant.
753 #define kUpb_EpsCopyInputStream_SlopBytes 16
754 
755 enum {
756   kUpb_EpsCopyInputStream_NoAliasing = 0,
757   kUpb_EpsCopyInputStream_OnPatch = 1,
758   kUpb_EpsCopyInputStream_NoDelta = 2
759 };
760 
761 typedef struct {
762   const char* end;        // Can read up to SlopBytes bytes beyond this.
763   const char* limit_ptr;  // For bounds checks, = end + UPB_MIN(limit, 0)
764   uintptr_t aliasing;
765   int limit;   // Submessage limit relative to end
766   bool error;  // To distinguish between EOF and error.
767   char patch[kUpb_EpsCopyInputStream_SlopBytes * 2];
768 } upb_EpsCopyInputStream;
769 
770 // Returns true if the stream is in the error state. A stream enters the error
771 // state when the user reads past a limit (caught in IsDone()) or the
772 // ZeroCopyInputStream returns an error.
upb_EpsCopyInputStream_IsError(upb_EpsCopyInputStream * e)773 UPB_INLINE bool upb_EpsCopyInputStream_IsError(upb_EpsCopyInputStream* e) {
774   return e->error;
775 }
776 
777 typedef const char* upb_EpsCopyInputStream_BufferFlipCallback(
778     upb_EpsCopyInputStream* e, const char* old_end, const char* new_start);
779 
780 typedef const char* upb_EpsCopyInputStream_IsDoneFallbackFunc(
781     upb_EpsCopyInputStream* e, const char* ptr, int overrun);
782 
783 // Initializes a upb_EpsCopyInputStream using the contents of the buffer
784 // [*ptr, size].  Updates `*ptr` as necessary to guarantee that at least
785 // kUpb_EpsCopyInputStream_SlopBytes are available to read.
upb_EpsCopyInputStream_Init(upb_EpsCopyInputStream * e,const char ** ptr,size_t size,bool enable_aliasing)786 UPB_INLINE void upb_EpsCopyInputStream_Init(upb_EpsCopyInputStream* e,
787                                             const char** ptr, size_t size,
788                                             bool enable_aliasing) {
789   if (size <= kUpb_EpsCopyInputStream_SlopBytes) {
790     memset(&e->patch, 0, 32);
791     if (size) memcpy(&e->patch, *ptr, size);
792     e->aliasing = enable_aliasing ? (uintptr_t)*ptr - (uintptr_t)e->patch
793                                   : kUpb_EpsCopyInputStream_NoAliasing;
794     *ptr = e->patch;
795     e->end = *ptr + size;
796     e->limit = 0;
797   } else {
798     e->end = *ptr + size - kUpb_EpsCopyInputStream_SlopBytes;
799     e->limit = kUpb_EpsCopyInputStream_SlopBytes;
800     e->aliasing = enable_aliasing ? kUpb_EpsCopyInputStream_NoDelta
801                                   : kUpb_EpsCopyInputStream_NoAliasing;
802   }
803   e->limit_ptr = e->end;
804   e->error = false;
805 }
806 
807 typedef enum {
808   // The current stream position is at a limit.
809   kUpb_IsDoneStatus_Done,
810 
811   // The current stream position is not at a limit.
812   kUpb_IsDoneStatus_NotDone,
813 
814   // The current stream position is not at a limit, and the stream needs to
815   // be flipped to a new buffer before more data can be read.
816   kUpb_IsDoneStatus_NeedFallback,
817 } upb_IsDoneStatus;
818 
819 // Returns the status of the current stream position.  This is a low-level
820 // function, it is simpler to call upb_EpsCopyInputStream_IsDone() if possible.
upb_EpsCopyInputStream_IsDoneStatus(upb_EpsCopyInputStream * e,const char * ptr,int * overrun)821 UPB_INLINE upb_IsDoneStatus upb_EpsCopyInputStream_IsDoneStatus(
822     upb_EpsCopyInputStream* e, const char* ptr, int* overrun) {
823   *overrun = ptr - e->end;
824   if (UPB_LIKELY(ptr < e->limit_ptr)) {
825     return kUpb_IsDoneStatus_NotDone;
826   } else if (UPB_LIKELY(*overrun == e->limit)) {
827     return kUpb_IsDoneStatus_Done;
828   } else {
829     return kUpb_IsDoneStatus_NeedFallback;
830   }
831 }
832 
833 // Returns true if the stream has hit a limit, either the current delimited
834 // limit or the overall end-of-stream. As a side effect, this function may flip
835 // the pointer to a new buffer if there are less than
836 // kUpb_EpsCopyInputStream_SlopBytes of data to be read in the current buffer.
837 //
838 // Postcondition: if the function returns false, there are at least
839 // kUpb_EpsCopyInputStream_SlopBytes of data available to read at *ptr.
upb_EpsCopyInputStream_IsDoneWithCallback(upb_EpsCopyInputStream * e,const char ** ptr,upb_EpsCopyInputStream_IsDoneFallbackFunc * func)840 UPB_INLINE bool upb_EpsCopyInputStream_IsDoneWithCallback(
841     upb_EpsCopyInputStream* e, const char** ptr,
842     upb_EpsCopyInputStream_IsDoneFallbackFunc* func) {
843   int overrun;
844   switch (upb_EpsCopyInputStream_IsDoneStatus(e, *ptr, &overrun)) {
845     case kUpb_IsDoneStatus_Done:
846       return true;
847     case kUpb_IsDoneStatus_NotDone:
848       return false;
849     case kUpb_IsDoneStatus_NeedFallback:
850       *ptr = func(e, *ptr, overrun);
851       return *ptr == NULL;
852   }
853   UPB_UNREACHABLE();
854 }
855 
856 const char* _upb_EpsCopyInputStream_IsDoneFallbackNoCallback(
857     upb_EpsCopyInputStream* e, const char* ptr, int overrun);
858 
859 // A simpler version of IsDoneWithCallback() that does not support a buffer flip
860 // callback. Useful in cases where we do not need to insert custom logic at
861 // every buffer flip.
862 //
863 // If this returns true, the user must call upb_EpsCopyInputStream_IsError()
864 // to distinguish between EOF and error.
upb_EpsCopyInputStream_IsDone(upb_EpsCopyInputStream * e,const char ** ptr)865 UPB_INLINE bool upb_EpsCopyInputStream_IsDone(upb_EpsCopyInputStream* e,
866                                               const char** ptr) {
867   return upb_EpsCopyInputStream_IsDoneWithCallback(
868       e, ptr, _upb_EpsCopyInputStream_IsDoneFallbackNoCallback);
869 }
870 
871 // Returns the total number of bytes that are safe to read from the current
872 // buffer without reading uninitialized or unallocated memory.
873 //
874 // Note that this check does not respect any semantic limits on the stream,
875 // either limits from PushLimit() or the overall stream end, so some of these
876 // bytes may have unpredictable, nonsense values in them. The guarantee is only
877 // that the bytes are valid to read from the perspective of the C language
878 // (ie. you can read without triggering UBSAN or ASAN).
upb_EpsCopyInputStream_BytesAvailable(upb_EpsCopyInputStream * e,const char * ptr)879 UPB_INLINE size_t upb_EpsCopyInputStream_BytesAvailable(
880     upb_EpsCopyInputStream* e, const char* ptr) {
881   return (e->end - ptr) + kUpb_EpsCopyInputStream_SlopBytes;
882 }
883 
884 // Returns true if the given delimited field size is valid (it does not extend
885 // beyond any previously-pushed limits).  `ptr` should point to the beginning
886 // of the field data, after the delimited size.
887 //
888 // Note that this does *not* guarantee that all of the data for this field is in
889 // the current buffer.
upb_EpsCopyInputStream_CheckSize(const upb_EpsCopyInputStream * e,const char * ptr,int size)890 UPB_INLINE bool upb_EpsCopyInputStream_CheckSize(
891     const upb_EpsCopyInputStream* e, const char* ptr, int size) {
892   UPB_ASSERT(size >= 0);
893   return ptr - e->end + size <= e->limit;
894 }
895 
_upb_EpsCopyInputStream_CheckSizeAvailable(upb_EpsCopyInputStream * e,const char * ptr,int size,bool submessage)896 UPB_INLINE bool _upb_EpsCopyInputStream_CheckSizeAvailable(
897     upb_EpsCopyInputStream* e, const char* ptr, int size, bool submessage) {
898   // This is one extra branch compared to the more normal:
899   //   return (size_t)(end - ptr) < size;
900   // However it is one less computation if we are just about to use "ptr + len":
901   //   https://godbolt.org/z/35YGPz
902   // In microbenchmarks this shows a small improvement.
903   uintptr_t uptr = (uintptr_t)ptr;
904   uintptr_t uend = (uintptr_t)e->limit_ptr;
905   uintptr_t res = uptr + (size_t)size;
906   if (!submessage) uend += kUpb_EpsCopyInputStream_SlopBytes;
907   // NOTE: this check depends on having a linear address space.  This is not
908   // technically guaranteed by uintptr_t.
909   bool ret = res >= uptr && res <= uend;
910   if (size < 0) UPB_ASSERT(!ret);
911   return ret;
912 }
913 
914 // Returns true if the given delimited field size is valid (it does not extend
915 // beyond any previously-pushed limited) *and* all of the data for this field is
916 // available to be read in the current buffer.
917 //
918 // If the size is negative, this function will always return false. This
919 // property can be useful in some cases.
upb_EpsCopyInputStream_CheckDataSizeAvailable(upb_EpsCopyInputStream * e,const char * ptr,int size)920 UPB_INLINE bool upb_EpsCopyInputStream_CheckDataSizeAvailable(
921     upb_EpsCopyInputStream* e, const char* ptr, int size) {
922   return _upb_EpsCopyInputStream_CheckSizeAvailable(e, ptr, size, false);
923 }
924 
925 // Returns true if the given sub-message size is valid (it does not extend
926 // beyond any previously-pushed limited) *and* all of the data for this
927 // sub-message is available to be parsed in the current buffer.
928 //
929 // This implies that all fields from the sub-message can be parsed from the
930 // current buffer while maintaining the invariant that we always have at least
931 // kUpb_EpsCopyInputStream_SlopBytes of data available past the beginning of
932 // any individual field start.
933 //
934 // If the size is negative, this function will always return false. This
935 // property can be useful in some cases.
upb_EpsCopyInputStream_CheckSubMessageSizeAvailable(upb_EpsCopyInputStream * e,const char * ptr,int size)936 UPB_INLINE bool upb_EpsCopyInputStream_CheckSubMessageSizeAvailable(
937     upb_EpsCopyInputStream* e, const char* ptr, int size) {
938   return _upb_EpsCopyInputStream_CheckSizeAvailable(e, ptr, size, true);
939 }
940 
941 // Returns true if aliasing_enabled=true was passed to
942 // upb_EpsCopyInputStream_Init() when this stream was initialized.
upb_EpsCopyInputStream_AliasingEnabled(upb_EpsCopyInputStream * e)943 UPB_INLINE bool upb_EpsCopyInputStream_AliasingEnabled(
944     upb_EpsCopyInputStream* e) {
945   return e->aliasing != kUpb_EpsCopyInputStream_NoAliasing;
946 }
947 
948 // Returns true if aliasing_enabled=true was passed to
949 // upb_EpsCopyInputStream_Init() when this stream was initialized *and* we can
950 // alias into the region [ptr, size] in an input buffer.
upb_EpsCopyInputStream_AliasingAvailable(upb_EpsCopyInputStream * e,const char * ptr,size_t size)951 UPB_INLINE bool upb_EpsCopyInputStream_AliasingAvailable(
952     upb_EpsCopyInputStream* e, const char* ptr, size_t size) {
953   // When EpsCopyInputStream supports streaming, this will need to become a
954   // runtime check.
955   return upb_EpsCopyInputStream_CheckDataSizeAvailable(e, ptr, size) &&
956          e->aliasing >= kUpb_EpsCopyInputStream_NoDelta;
957 }
958 
959 // Returns a pointer into an input buffer that corresponds to the parsing
960 // pointer `ptr`.  The returned pointer may be the same as `ptr`, but also may
961 // be different if we are currently parsing out of the patch buffer.
962 //
963 // REQUIRES: Aliasing must be available for the given pointer. If the input is a
964 // flat buffer and aliasing is enabled, then aliasing will always be available.
upb_EpsCopyInputStream_GetAliasedPtr(upb_EpsCopyInputStream * e,const char * ptr)965 UPB_INLINE const char* upb_EpsCopyInputStream_GetAliasedPtr(
966     upb_EpsCopyInputStream* e, const char* ptr) {
967   UPB_ASSUME(upb_EpsCopyInputStream_AliasingAvailable(e, ptr, 0));
968   uintptr_t delta =
969       e->aliasing == kUpb_EpsCopyInputStream_NoDelta ? 0 : e->aliasing;
970   return (const char*)((uintptr_t)ptr + delta);
971 }
972 
973 // Reads string data from the input, aliasing into the input buffer instead of
974 // copying. The parsing pointer is passed in `*ptr`, and will be updated if
975 // necessary to point to the actual input buffer. Returns the new parsing
976 // pointer, which will be advanced past the string data.
977 //
978 // REQUIRES: Aliasing must be available for this data region (test with
979 // upb_EpsCopyInputStream_AliasingAvailable().
upb_EpsCopyInputStream_ReadStringAliased(upb_EpsCopyInputStream * e,const char ** ptr,size_t size)980 UPB_INLINE const char* upb_EpsCopyInputStream_ReadStringAliased(
981     upb_EpsCopyInputStream* e, const char** ptr, size_t size) {
982   UPB_ASSUME(upb_EpsCopyInputStream_AliasingAvailable(e, *ptr, size));
983   const char* ret = *ptr + size;
984   *ptr = upb_EpsCopyInputStream_GetAliasedPtr(e, *ptr);
985   UPB_ASSUME(ret != NULL);
986   return ret;
987 }
988 
989 // Skips `size` bytes of data from the input and returns a pointer past the end.
990 // Returns NULL on end of stream or error.
upb_EpsCopyInputStream_Skip(upb_EpsCopyInputStream * e,const char * ptr,int size)991 UPB_INLINE const char* upb_EpsCopyInputStream_Skip(upb_EpsCopyInputStream* e,
992                                                    const char* ptr, int size) {
993   if (!upb_EpsCopyInputStream_CheckDataSizeAvailable(e, ptr, size)) return NULL;
994   return ptr + size;
995 }
996 
997 // Copies `size` bytes of data from the input `ptr` into the buffer `to`, and
998 // returns a pointer past the end. Returns NULL on end of stream or error.
upb_EpsCopyInputStream_Copy(upb_EpsCopyInputStream * e,const char * ptr,void * to,int size)999 UPB_INLINE const char* upb_EpsCopyInputStream_Copy(upb_EpsCopyInputStream* e,
1000                                                    const char* ptr, void* to,
1001                                                    int size) {
1002   if (!upb_EpsCopyInputStream_CheckDataSizeAvailable(e, ptr, size)) return NULL;
1003   memcpy(to, ptr, size);
1004   return ptr + size;
1005 }
1006 
1007 // Reads string data from the stream and advances the pointer accordingly.
1008 // If aliasing was enabled when the stream was initialized, then the returned
1009 // pointer will point into the input buffer if possible, otherwise new data
1010 // will be allocated from arena and copied into. We may be forced to copy even
1011 // if aliasing was enabled if the input data spans input buffers.
1012 //
1013 // Returns NULL if memory allocation failed, or we reached a premature EOF.
upb_EpsCopyInputStream_ReadString(upb_EpsCopyInputStream * e,const char ** ptr,size_t size,upb_Arena * arena)1014 UPB_INLINE const char* upb_EpsCopyInputStream_ReadString(
1015     upb_EpsCopyInputStream* e, const char** ptr, size_t size,
1016     upb_Arena* arena) {
1017   if (upb_EpsCopyInputStream_AliasingAvailable(e, *ptr, size)) {
1018     return upb_EpsCopyInputStream_ReadStringAliased(e, ptr, size);
1019   } else {
1020     // We need to allocate and copy.
1021     if (!upb_EpsCopyInputStream_CheckDataSizeAvailable(e, *ptr, size)) {
1022       return NULL;
1023     }
1024     UPB_ASSERT(arena);
1025     char* data = (char*)upb_Arena_Malloc(arena, size);
1026     if (!data) return NULL;
1027     const char* ret = upb_EpsCopyInputStream_Copy(e, *ptr, data, size);
1028     *ptr = data;
1029     return ret;
1030   }
1031 }
1032 
_upb_EpsCopyInputStream_CheckLimit(upb_EpsCopyInputStream * e)1033 UPB_INLINE void _upb_EpsCopyInputStream_CheckLimit(upb_EpsCopyInputStream* e) {
1034   UPB_ASSERT(e->limit_ptr == e->end + UPB_MIN(0, e->limit));
1035 }
1036 
1037 // Pushes a limit onto the stack of limits for the current stream.  The limit
1038 // will extend for `size` bytes beyond the position in `ptr`.  Future calls to
1039 // upb_EpsCopyInputStream_IsDone() will return `true` when the stream position
1040 // reaches this limit.
1041 //
1042 // Returns a delta that the caller must store and supply to PopLimit() below.
upb_EpsCopyInputStream_PushLimit(upb_EpsCopyInputStream * e,const char * ptr,int size)1043 UPB_INLINE int upb_EpsCopyInputStream_PushLimit(upb_EpsCopyInputStream* e,
1044                                                 const char* ptr, int size) {
1045   int limit = size + (int)(ptr - e->end);
1046   int delta = e->limit - limit;
1047   _upb_EpsCopyInputStream_CheckLimit(e);
1048   UPB_ASSERT(limit <= e->limit);
1049   e->limit = limit;
1050   e->limit_ptr = e->end + UPB_MIN(0, limit);
1051   _upb_EpsCopyInputStream_CheckLimit(e);
1052   return delta;
1053 }
1054 
1055 // Pops the last limit that was pushed on this stream.  This may only be called
1056 // once IsDone() returns true.  The user must pass the delta that was returned
1057 // from PushLimit().
upb_EpsCopyInputStream_PopLimit(upb_EpsCopyInputStream * e,const char * ptr,int saved_delta)1058 UPB_INLINE void upb_EpsCopyInputStream_PopLimit(upb_EpsCopyInputStream* e,
1059                                                 const char* ptr,
1060                                                 int saved_delta) {
1061   UPB_ASSERT(ptr - e->end == e->limit);
1062   _upb_EpsCopyInputStream_CheckLimit(e);
1063   e->limit += saved_delta;
1064   e->limit_ptr = e->end + UPB_MIN(0, e->limit);
1065   _upb_EpsCopyInputStream_CheckLimit(e);
1066 }
1067 
_upb_EpsCopyInputStream_IsDoneFallbackInline(upb_EpsCopyInputStream * e,const char * ptr,int overrun,upb_EpsCopyInputStream_BufferFlipCallback * callback)1068 UPB_INLINE const char* _upb_EpsCopyInputStream_IsDoneFallbackInline(
1069     upb_EpsCopyInputStream* e, const char* ptr, int overrun,
1070     upb_EpsCopyInputStream_BufferFlipCallback* callback) {
1071   if (overrun < e->limit) {
1072     // Need to copy remaining data into patch buffer.
1073     UPB_ASSERT(overrun < kUpb_EpsCopyInputStream_SlopBytes);
1074     const char* old_end = ptr;
1075     const char* new_start = &e->patch[0] + overrun;
1076     memset(e->patch + kUpb_EpsCopyInputStream_SlopBytes, 0,
1077            kUpb_EpsCopyInputStream_SlopBytes);
1078     memcpy(e->patch, e->end, kUpb_EpsCopyInputStream_SlopBytes);
1079     ptr = new_start;
1080     e->end = &e->patch[kUpb_EpsCopyInputStream_SlopBytes];
1081     e->limit -= kUpb_EpsCopyInputStream_SlopBytes;
1082     e->limit_ptr = e->end + e->limit;
1083     UPB_ASSERT(ptr < e->limit_ptr);
1084     if (e->aliasing != kUpb_EpsCopyInputStream_NoAliasing) {
1085       e->aliasing = (uintptr_t)old_end - (uintptr_t)new_start;
1086     }
1087     return callback(e, old_end, new_start);
1088   } else {
1089     UPB_ASSERT(overrun > e->limit);
1090     e->error = true;
1091     return callback(e, NULL, NULL);
1092   }
1093 }
1094 
1095 typedef const char* upb_EpsCopyInputStream_ParseDelimitedFunc(
1096     upb_EpsCopyInputStream* e, const char* ptr, void* ctx);
1097 
1098 // Tries to perform a fast-path handling of the given delimited message data.
1099 // If the sub-message beginning at `*ptr` and extending for `len` is short and
1100 // fits within this buffer, calls `func` with `ctx` as a parameter, where the
1101 // pushing and popping of limits is handled automatically and with lower cost
1102 // than the normal PushLimit()/PopLimit() sequence.
upb_EpsCopyInputStream_TryParseDelimitedFast(upb_EpsCopyInputStream * e,const char ** ptr,int len,upb_EpsCopyInputStream_ParseDelimitedFunc * func,void * ctx)1103 UPB_FORCEINLINE bool upb_EpsCopyInputStream_TryParseDelimitedFast(
1104     upb_EpsCopyInputStream* e, const char** ptr, int len,
1105     upb_EpsCopyInputStream_ParseDelimitedFunc* func, void* ctx) {
1106   if (!upb_EpsCopyInputStream_CheckSubMessageSizeAvailable(e, *ptr, len)) {
1107     return false;
1108   }
1109 
1110   // Fast case: Sub-message is <128 bytes and fits in the current buffer.
1111   // This means we can preserve limit/limit_ptr verbatim.
1112   const char* saved_limit_ptr = e->limit_ptr;
1113   int saved_limit = e->limit;
1114   e->limit_ptr = *ptr + len;
1115   e->limit = e->limit_ptr - e->end;
1116   UPB_ASSERT(e->limit_ptr == e->end + UPB_MIN(0, e->limit));
1117   *ptr = func(e, *ptr, ctx);
1118   e->limit_ptr = saved_limit_ptr;
1119   e->limit = saved_limit;
1120   UPB_ASSERT(e->limit_ptr == e->end + UPB_MIN(0, e->limit));
1121   return true;
1122 }
1123 
1124 #ifdef __cplusplus
1125 } /* extern "C" */
1126 #endif
1127 
1128 
1129 #endif  // UPB_WIRE_EPS_COPY_INPUT_STREAM_H_
1130 
1131 #ifndef UPB_JSON_DECODE_H_
1132 #define UPB_JSON_DECODE_H_
1133 
1134 #include <stddef.h>
1135 
1136 
1137 // Public APIs for message operations that do not depend on the schema.
1138 //
1139 // MiniTable-based accessors live in accessors.h.
1140 
1141 #ifndef UPB_MESSAGE_MESSAGE_H_
1142 #define UPB_MESSAGE_MESSAGE_H_
1143 
1144 #include <stddef.h>
1145 
1146 
1147 /*
1148 ** Our memory representation for parsing tables and messages themselves.
1149 ** Functions in this file are used by generated code and possibly reflection.
1150 **
1151 ** The definitions in this file are internal to upb.
1152 **/
1153 
1154 #ifndef UPB_MESSAGE_INTERNAL_MESSAGE_H_
1155 #define UPB_MESSAGE_INTERNAL_MESSAGE_H_
1156 
1157 #include <stdlib.h>
1158 #include <string.h>
1159 
1160 
1161 #ifndef UPB_MESSAGE_INTERNAL_EXTENSION_H_
1162 #define UPB_MESSAGE_INTERNAL_EXTENSION_H_
1163 
1164 #include <stddef.h>
1165 
1166 
1167 // Users should include array.h or map.h instead.
1168 // IWYU pragma: private, include "upb/message/array.h"
1169 
1170 #ifndef UPB_MESSAGE_VALUE_H_
1171 #define UPB_MESSAGE_VALUE_H_
1172 
1173 #include <stdint.h>
1174 #include <string.h>
1175 
1176 #ifndef UPB_BASE_STRING_VIEW_H_
1177 #define UPB_BASE_STRING_VIEW_H_
1178 
1179 #include <string.h>
1180 
1181 // Must be last.
1182 
1183 #define UPB_STRINGVIEW_INIT(ptr, len) \
1184   { ptr, len }
1185 
1186 #define UPB_STRINGVIEW_FORMAT "%.*s"
1187 #define UPB_STRINGVIEW_ARGS(view) (int)(view).size, (view).data
1188 
1189 // LINT.IfChange(struct_definition)
1190 typedef struct {
1191   const char* data;
1192   size_t size;
1193 } upb_StringView;
1194 
1195 #ifdef __cplusplus
1196 extern "C" {
1197 #endif
1198 
upb_StringView_FromDataAndSize(const char * data,size_t size)1199 UPB_API_INLINE upb_StringView upb_StringView_FromDataAndSize(const char* data,
1200                                                              size_t size) {
1201   upb_StringView ret;
1202   ret.data = data;
1203   ret.size = size;
1204   return ret;
1205 }
1206 
upb_StringView_FromString(const char * data)1207 UPB_INLINE upb_StringView upb_StringView_FromString(const char* data) {
1208   return upb_StringView_FromDataAndSize(data, strlen(data));
1209 }
1210 
upb_StringView_IsEqual(upb_StringView a,upb_StringView b)1211 UPB_INLINE bool upb_StringView_IsEqual(upb_StringView a, upb_StringView b) {
1212   return (a.size == b.size) && (!a.size || !memcmp(a.data, b.data, a.size));
1213 }
1214 
1215 // LINT.ThenChange(
1216 //  GoogleInternalName1,
1217 //  //depot/google3/third_party/upb/bits/golang/accessor.go:map_go_string,
1218 //  //depot/google3/third_party/upb/bits/typescript/string_view.ts
1219 // )
1220 
1221 #ifdef __cplusplus
1222 } /* extern "C" */
1223 #endif
1224 
1225 
1226 #endif /* UPB_BASE_STRING_VIEW_H_ */
1227 
1228 // Must be last.
1229 
1230 #ifdef __cplusplus
1231 extern "C" {
1232 #endif
1233 
1234 typedef union {
1235   bool bool_val;
1236   float float_val;
1237   double double_val;
1238   int32_t int32_val;
1239   int64_t int64_val;
1240   uint32_t uint32_val;
1241   uint64_t uint64_val;
1242   const struct upb_Array* array_val;
1243   const struct upb_Map* map_val;
1244   const struct upb_Message* msg_val;
1245   upb_StringView str_val;
1246 
1247   // EXPERIMENTAL: A tagged upb_Message*.  Users must use this instead of
1248   // msg_val if unlinked sub-messages may possibly be in use.  See the
1249   // documentation in kUpb_DecodeOption_ExperimentalAllowUnlinked for more
1250   // information.
1251   uintptr_t tagged_msg_val;  // upb_TaggedMessagePtr
1252 } upb_MessageValue;
1253 
upb_MessageValue_Zero(void)1254 UPB_API_INLINE upb_MessageValue upb_MessageValue_Zero(void) {
1255   upb_MessageValue zero;
1256   memset(&zero, 0, sizeof(zero));
1257   return zero;
1258 }
1259 
1260 typedef union {
1261   struct upb_Array* array;
1262   struct upb_Map* map;
1263   struct upb_Message* msg;
1264 } upb_MutableMessageValue;
1265 
upb_MutableMessageValue_Zero(void)1266 UPB_API_INLINE upb_MutableMessageValue upb_MutableMessageValue_Zero(void) {
1267   upb_MutableMessageValue zero;
1268   memset(&zero, 0, sizeof(zero));
1269   return zero;
1270 }
1271 
1272 #ifdef __cplusplus
1273 } /* extern "C" */
1274 #endif
1275 
1276 
1277 #endif /* UPB_MESSAGE_VALUE_H_ */
1278 
1279 #ifndef UPB_MINI_TABLE_EXTENSION_H_
1280 #define UPB_MINI_TABLE_EXTENSION_H_
1281 
1282 #include <stdint.h>
1283 
1284 
1285 #ifndef UPB_BASE_DESCRIPTOR_CONSTANTS_H_
1286 #define UPB_BASE_DESCRIPTOR_CONSTANTS_H_
1287 
1288 // Must be last.
1289 
1290 // The types a field can have. Note that this list is not identical to the
1291 // types defined in descriptor.proto, which gives INT32 and SINT32 separate
1292 // types (we distinguish the two with the "integer encoding" enum below).
1293 // This enum is an internal convenience only and has no meaning outside of upb.
1294 typedef enum {
1295   kUpb_CType_Bool = 1,
1296   kUpb_CType_Float = 2,
1297   kUpb_CType_Int32 = 3,
1298   kUpb_CType_UInt32 = 4,
1299   kUpb_CType_Enum = 5,  // Enum values are int32. TODO: rename
1300   kUpb_CType_Message = 6,
1301   kUpb_CType_Double = 7,
1302   kUpb_CType_Int64 = 8,
1303   kUpb_CType_UInt64 = 9,
1304   kUpb_CType_String = 10,
1305   kUpb_CType_Bytes = 11
1306 } upb_CType;
1307 
1308 // The repeated-ness of each field; this matches descriptor.proto.
1309 typedef enum {
1310   kUpb_Label_Optional = 1,
1311   kUpb_Label_Required = 2,
1312   kUpb_Label_Repeated = 3
1313 } upb_Label;
1314 
1315 // Descriptor types, as defined in descriptor.proto.
1316 typedef enum {
1317   kUpb_FieldType_Double = 1,
1318   kUpb_FieldType_Float = 2,
1319   kUpb_FieldType_Int64 = 3,
1320   kUpb_FieldType_UInt64 = 4,
1321   kUpb_FieldType_Int32 = 5,
1322   kUpb_FieldType_Fixed64 = 6,
1323   kUpb_FieldType_Fixed32 = 7,
1324   kUpb_FieldType_Bool = 8,
1325   kUpb_FieldType_String = 9,
1326   kUpb_FieldType_Group = 10,
1327   kUpb_FieldType_Message = 11,
1328   kUpb_FieldType_Bytes = 12,
1329   kUpb_FieldType_UInt32 = 13,
1330   kUpb_FieldType_Enum = 14,
1331   kUpb_FieldType_SFixed32 = 15,
1332   kUpb_FieldType_SFixed64 = 16,
1333   kUpb_FieldType_SInt32 = 17,
1334   kUpb_FieldType_SInt64 = 18,
1335 } upb_FieldType;
1336 
1337 #define kUpb_FieldType_SizeOf 19
1338 
1339 #ifdef __cplusplus
1340 extern "C" {
1341 #endif
1342 
1343 // Convert from upb_FieldType to upb_CType
upb_FieldType_CType(upb_FieldType field_type)1344 UPB_INLINE upb_CType upb_FieldType_CType(upb_FieldType field_type) {
1345   static const upb_CType c_type[] = {
1346       kUpb_CType_Double,   // kUpb_FieldType_Double
1347       kUpb_CType_Float,    // kUpb_FieldType_Float
1348       kUpb_CType_Int64,    // kUpb_FieldType_Int64
1349       kUpb_CType_UInt64,   // kUpb_FieldType_UInt64
1350       kUpb_CType_Int32,    // kUpb_FieldType_Int32
1351       kUpb_CType_UInt64,   // kUpb_FieldType_Fixed64
1352       kUpb_CType_UInt32,   // kUpb_FieldType_Fixed32
1353       kUpb_CType_Bool,     // kUpb_FieldType_Bool
1354       kUpb_CType_String,   // kUpb_FieldType_String
1355       kUpb_CType_Message,  // kUpb_FieldType_Group
1356       kUpb_CType_Message,  // kUpb_FieldType_Message
1357       kUpb_CType_Bytes,    // kUpb_FieldType_Bytes
1358       kUpb_CType_UInt32,   // kUpb_FieldType_UInt32
1359       kUpb_CType_Enum,     // kUpb_FieldType_Enum
1360       kUpb_CType_Int32,    // kUpb_FieldType_SFixed32
1361       kUpb_CType_Int64,    // kUpb_FieldType_SFixed64
1362       kUpb_CType_Int32,    // kUpb_FieldType_SInt32
1363       kUpb_CType_Int64,    // kUpb_FieldType_SInt64
1364   };
1365 
1366   // -1 here because the enum is one-based but the table is zero-based.
1367   return c_type[field_type - 1];
1368 }
1369 
upb_FieldType_IsPackable(upb_FieldType field_type)1370 UPB_INLINE bool upb_FieldType_IsPackable(upb_FieldType field_type) {
1371   // clang-format off
1372   const unsigned kUnpackableTypes =
1373       (1 << kUpb_FieldType_String) |
1374       (1 << kUpb_FieldType_Bytes) |
1375       (1 << kUpb_FieldType_Message) |
1376       (1 << kUpb_FieldType_Group);
1377   // clang-format on
1378   return (1 << field_type) & ~kUnpackableTypes;
1379 }
1380 
1381 #ifdef __cplusplus
1382 } /* extern "C" */
1383 #endif
1384 
1385 
1386 #endif /* UPB_BASE_DESCRIPTOR_CONSTANTS_H_ */
1387 
1388 #ifndef UPB_MINI_TABLE_INTERNAL_EXTENSION_H_
1389 #define UPB_MINI_TABLE_INTERNAL_EXTENSION_H_
1390 
1391 #include <stddef.h>
1392 #include <stdint.h>
1393 
1394 
1395 #ifndef UPB_MINI_TABLE_INTERNAL_FIELD_H_
1396 #define UPB_MINI_TABLE_INTERNAL_FIELD_H_
1397 
1398 #include <stddef.h>
1399 #include <stdint.h>
1400 
1401 
1402 #ifndef UPB_MINI_TABLE_INTERNAL_SIZE_LOG2_H_
1403 #define UPB_MINI_TABLE_INTERNAL_SIZE_LOG2_H_
1404 
1405 #include <stddef.h>
1406 #include <stdint.h>
1407 
1408 
1409 // Must be last.
1410 
1411 #ifdef __cplusplus
1412 extern "C" {
1413 #endif
1414 
1415 // Return the log2 of the storage size in bytes for a upb_CType
UPB_PRIVATE(_upb_CType_SizeLg2)1416 UPB_INLINE int UPB_PRIVATE(_upb_CType_SizeLg2)(upb_CType c_type) {
1417   static const int8_t size[] = {
1418       0,               // kUpb_CType_Bool
1419       2,               // kUpb_CType_Float
1420       2,               // kUpb_CType_Int32
1421       2,               // kUpb_CType_UInt32
1422       2,               // kUpb_CType_Enum
1423       UPB_SIZE(2, 3),  // kUpb_CType_Message
1424       3,               // kUpb_CType_Double
1425       3,               // kUpb_CType_Int64
1426       3,               // kUpb_CType_UInt64
1427       UPB_SIZE(3, 4),  // kUpb_CType_String
1428       UPB_SIZE(3, 4),  // kUpb_CType_Bytes
1429   };
1430 
1431   // -1 here because the enum is one-based but the table is zero-based.
1432   return size[c_type - 1];
1433 }
1434 
1435 // Return the log2 of the storage size in bytes for a upb_FieldType
UPB_PRIVATE(_upb_FieldType_SizeLg2)1436 UPB_INLINE int UPB_PRIVATE(_upb_FieldType_SizeLg2)(upb_FieldType field_type) {
1437   static const int8_t size[] = {
1438       3,               // kUpb_FieldType_Double
1439       2,               // kUpb_FieldType_Float
1440       3,               // kUpb_FieldType_Int64
1441       3,               // kUpb_FieldType_UInt64
1442       2,               // kUpb_FieldType_Int32
1443       3,               // kUpb_FieldType_Fixed64
1444       2,               // kUpb_FieldType_Fixed32
1445       0,               // kUpb_FieldType_Bool
1446       UPB_SIZE(3, 4),  // kUpb_FieldType_String
1447       UPB_SIZE(2, 3),  // kUpb_FieldType_Group
1448       UPB_SIZE(2, 3),  // kUpb_FieldType_Message
1449       UPB_SIZE(3, 4),  // kUpb_FieldType_Bytes
1450       2,               // kUpb_FieldType_UInt32
1451       2,               // kUpb_FieldType_Enum
1452       2,               // kUpb_FieldType_SFixed32
1453       3,               // kUpb_FieldType_SFixed64
1454       2,               // kUpb_FieldType_SInt32
1455       3,               // kUpb_FieldType_SInt64
1456   };
1457 
1458   // -1 here because the enum is one-based but the table is zero-based.
1459   return size[field_type - 1];
1460 }
1461 
1462 #ifdef __cplusplus
1463 } /* extern "C" */
1464 #endif
1465 
1466 
1467 #endif /* UPB_MINI_TABLE_INTERNAL_SIZE_LOG2_H_ */
1468 
1469 // Must be last.
1470 
1471 // LINT.IfChange(struct_definition)
1472 struct upb_MiniTableField {
1473   uint32_t UPB_ONLYBITS(number);
1474   uint16_t UPB_ONLYBITS(offset);
1475   int16_t presence;  // If >0, hasbit_index.  If <0, ~oneof_index
1476 
1477   // Indexes into `upb_MiniTable.subs`
1478   // Will be set to `kUpb_NoSub` if `descriptortype` != MESSAGE/GROUP/ENUM
1479   uint16_t UPB_PRIVATE(submsg_index);
1480 
1481   uint8_t UPB_PRIVATE(descriptortype);
1482 
1483   // upb_FieldMode | upb_LabelFlags | (upb_FieldRep << kUpb_FieldRep_Shift)
1484   uint8_t UPB_ONLYBITS(mode);
1485 };
1486 
1487 #define kUpb_NoSub ((uint16_t) - 1)
1488 
1489 typedef enum {
1490   kUpb_FieldMode_Map = 0,
1491   kUpb_FieldMode_Array = 1,
1492   kUpb_FieldMode_Scalar = 2,
1493 } upb_FieldMode;
1494 
1495 // Mask to isolate the upb_FieldMode from field.mode.
1496 #define kUpb_FieldMode_Mask 3
1497 
1498 // Extra flags on the mode field.
1499 typedef enum {
1500   kUpb_LabelFlags_IsPacked = 4,
1501   kUpb_LabelFlags_IsExtension = 8,
1502   // Indicates that this descriptor type is an "alternate type":
1503   //   - for Int32, this indicates that the actual type is Enum (but was
1504   //     rewritten to Int32 because it is an open enum that requires no check).
1505   //   - for Bytes, this indicates that the actual type is String (but does
1506   //     not require any UTF-8 check).
1507   kUpb_LabelFlags_IsAlternate = 16,
1508 } upb_LabelFlags;
1509 
1510 // Note: we sort by this number when calculating layout order.
1511 typedef enum {
1512   kUpb_FieldRep_1Byte = 0,
1513   kUpb_FieldRep_4Byte = 1,
1514   kUpb_FieldRep_StringView = 2,
1515   kUpb_FieldRep_8Byte = 3,
1516 
1517   kUpb_FieldRep_NativePointer =
1518       UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte),
1519   kUpb_FieldRep_Max = kUpb_FieldRep_8Byte,
1520 } upb_FieldRep;
1521 
1522 #define kUpb_FieldRep_Shift 6
1523 
1524 #ifdef __cplusplus
1525 extern "C" {
1526 #endif
1527 
1528 UPB_INLINE upb_FieldMode
UPB_PRIVATE(_upb_MiniTableField_Mode)1529 UPB_PRIVATE(_upb_MiniTableField_Mode)(const struct upb_MiniTableField* f) {
1530   return (upb_FieldMode)(f->UPB_ONLYBITS(mode) & kUpb_FieldMode_Mask);
1531 }
1532 
1533 UPB_INLINE upb_FieldRep
UPB_PRIVATE(_upb_MiniTableField_GetRep)1534 UPB_PRIVATE(_upb_MiniTableField_GetRep)(const struct upb_MiniTableField* f) {
1535   return (upb_FieldRep)(f->UPB_ONLYBITS(mode) >> kUpb_FieldRep_Shift);
1536 }
1537 
upb_MiniTableField_IsArray(const struct upb_MiniTableField * f)1538 UPB_API_INLINE bool upb_MiniTableField_IsArray(
1539     const struct upb_MiniTableField* f) {
1540   return UPB_PRIVATE(_upb_MiniTableField_Mode)(f) == kUpb_FieldMode_Array;
1541 }
1542 
upb_MiniTableField_IsMap(const struct upb_MiniTableField * f)1543 UPB_API_INLINE bool upb_MiniTableField_IsMap(
1544     const struct upb_MiniTableField* f) {
1545   return UPB_PRIVATE(_upb_MiniTableField_Mode)(f) == kUpb_FieldMode_Map;
1546 }
1547 
upb_MiniTableField_IsScalar(const struct upb_MiniTableField * f)1548 UPB_API_INLINE bool upb_MiniTableField_IsScalar(
1549     const struct upb_MiniTableField* f) {
1550   return UPB_PRIVATE(_upb_MiniTableField_Mode)(f) == kUpb_FieldMode_Scalar;
1551 }
1552 
UPB_PRIVATE(_upb_MiniTableField_IsAlternate)1553 UPB_INLINE bool UPB_PRIVATE(_upb_MiniTableField_IsAlternate)(
1554     const struct upb_MiniTableField* f) {
1555   return (f->UPB_ONLYBITS(mode) & kUpb_LabelFlags_IsAlternate) != 0;
1556 }
1557 
upb_MiniTableField_IsExtension(const struct upb_MiniTableField * f)1558 UPB_API_INLINE bool upb_MiniTableField_IsExtension(
1559     const struct upb_MiniTableField* f) {
1560   return (f->UPB_ONLYBITS(mode) & kUpb_LabelFlags_IsExtension) != 0;
1561 }
1562 
upb_MiniTableField_IsPacked(const struct upb_MiniTableField * f)1563 UPB_API_INLINE bool upb_MiniTableField_IsPacked(
1564     const struct upb_MiniTableField* f) {
1565   return (f->UPB_ONLYBITS(mode) & kUpb_LabelFlags_IsPacked) != 0;
1566 }
1567 
1568 UPB_API_INLINE upb_FieldType
upb_MiniTableField_Type(const struct upb_MiniTableField * f)1569 upb_MiniTableField_Type(const struct upb_MiniTableField* f) {
1570   const upb_FieldType type = (upb_FieldType)f->UPB_PRIVATE(descriptortype);
1571   if (UPB_PRIVATE(_upb_MiniTableField_IsAlternate)(f)) {
1572     if (type == kUpb_FieldType_Int32) return kUpb_FieldType_Enum;
1573     if (type == kUpb_FieldType_Bytes) return kUpb_FieldType_String;
1574     UPB_ASSERT(false);
1575   }
1576   return type;
1577 }
1578 
1579 UPB_API_INLINE
upb_MiniTableField_CType(const struct upb_MiniTableField * f)1580 upb_CType upb_MiniTableField_CType(const struct upb_MiniTableField* f) {
1581   return upb_FieldType_CType(upb_MiniTableField_Type(f));
1582 }
1583 
UPB_PRIVATE(_upb_MiniTableField_HasHasbit)1584 UPB_INLINE bool UPB_PRIVATE(_upb_MiniTableField_HasHasbit)(
1585     const struct upb_MiniTableField* f) {
1586   return f->presence > 0;
1587 }
1588 
UPB_PRIVATE(_upb_MiniTableField_HasbitMask)1589 UPB_INLINE char UPB_PRIVATE(_upb_MiniTableField_HasbitMask)(
1590     const struct upb_MiniTableField* f) {
1591   UPB_ASSERT(UPB_PRIVATE(_upb_MiniTableField_HasHasbit)(f));
1592   const size_t index = f->presence;
1593   return 1 << (index % 8);
1594 }
1595 
UPB_PRIVATE(_upb_MiniTableField_HasbitOffset)1596 UPB_INLINE size_t UPB_PRIVATE(_upb_MiniTableField_HasbitOffset)(
1597     const struct upb_MiniTableField* f) {
1598   UPB_ASSERT(UPB_PRIVATE(_upb_MiniTableField_HasHasbit)(f));
1599   const size_t index = f->presence;
1600   return index / 8;
1601 }
1602 
upb_MiniTableField_IsClosedEnum(const struct upb_MiniTableField * f)1603 UPB_API_INLINE bool upb_MiniTableField_IsClosedEnum(
1604     const struct upb_MiniTableField* f) {
1605   return f->UPB_PRIVATE(descriptortype) == kUpb_FieldType_Enum;
1606 }
1607 
upb_MiniTableField_IsInOneof(const struct upb_MiniTableField * f)1608 UPB_API_INLINE bool upb_MiniTableField_IsInOneof(
1609     const struct upb_MiniTableField* f) {
1610   return f->presence < 0;
1611 }
1612 
upb_MiniTableField_IsSubMessage(const struct upb_MiniTableField * f)1613 UPB_API_INLINE bool upb_MiniTableField_IsSubMessage(
1614     const struct upb_MiniTableField* f) {
1615   return f->UPB_PRIVATE(descriptortype) == kUpb_FieldType_Message ||
1616          f->UPB_PRIVATE(descriptortype) == kUpb_FieldType_Group;
1617 }
1618 
upb_MiniTableField_HasPresence(const struct upb_MiniTableField * f)1619 UPB_API_INLINE bool upb_MiniTableField_HasPresence(
1620     const struct upb_MiniTableField* f) {
1621   if (upb_MiniTableField_IsExtension(f)) {
1622     return upb_MiniTableField_IsScalar(f);
1623   } else {
1624     return f->presence != 0;
1625   }
1626 }
1627 
1628 UPB_API_INLINE uint32_t
upb_MiniTableField_Number(const struct upb_MiniTableField * f)1629 upb_MiniTableField_Number(const struct upb_MiniTableField* f) {
1630   return f->UPB_ONLYBITS(number);
1631 }
1632 
1633 UPB_INLINE uint16_t
UPB_PRIVATE(_upb_MiniTableField_Offset)1634 UPB_PRIVATE(_upb_MiniTableField_Offset)(const struct upb_MiniTableField* f) {
1635   return f->UPB_ONLYBITS(offset);
1636 }
1637 
UPB_PRIVATE(_upb_MiniTableField_OneofOffset)1638 UPB_INLINE size_t UPB_PRIVATE(_upb_MiniTableField_OneofOffset)(
1639     const struct upb_MiniTableField* f) {
1640   UPB_ASSERT(upb_MiniTableField_IsInOneof(f));
1641   return ~(ptrdiff_t)f->presence;
1642 }
1643 
UPB_PRIVATE(_upb_MiniTableField_CheckIsArray)1644 UPB_INLINE void UPB_PRIVATE(_upb_MiniTableField_CheckIsArray)(
1645     const struct upb_MiniTableField* f) {
1646   UPB_ASSUME(UPB_PRIVATE(_upb_MiniTableField_GetRep)(f) ==
1647              kUpb_FieldRep_NativePointer);
1648   UPB_ASSUME(upb_MiniTableField_IsArray(f));
1649   UPB_ASSUME(f->presence == 0);
1650 }
1651 
UPB_PRIVATE(_upb_MiniTableField_CheckIsMap)1652 UPB_INLINE void UPB_PRIVATE(_upb_MiniTableField_CheckIsMap)(
1653     const struct upb_MiniTableField* f) {
1654   UPB_ASSUME(UPB_PRIVATE(_upb_MiniTableField_GetRep)(f) ==
1655              kUpb_FieldRep_NativePointer);
1656   UPB_ASSUME(upb_MiniTableField_IsMap(f));
1657   UPB_ASSUME(f->presence == 0);
1658 }
1659 
UPB_PRIVATE(_upb_MiniTableField_ElemSizeLg2)1660 UPB_INLINE size_t UPB_PRIVATE(_upb_MiniTableField_ElemSizeLg2)(
1661     const struct upb_MiniTableField* f) {
1662   const upb_FieldType field_type = upb_MiniTableField_Type(f);
1663   return UPB_PRIVATE(_upb_FieldType_SizeLg2)(field_type);
1664 }
1665 
1666 // LINT.ThenChange(//depot/google3/third_party/upb/bits/typescript/mini_table_field.ts)
1667 
1668 #ifdef __cplusplus
1669 } /* extern "C" */
1670 #endif
1671 
1672 
1673 #endif /* UPB_MINI_TABLE_INTERNAL_FIELD_H_ */
1674 
1675 #ifndef UPB_MINI_TABLE_INTERNAL_SUB_H_
1676 #define UPB_MINI_TABLE_INTERNAL_SUB_H_
1677 
1678 // Must be last.
1679 
1680 typedef union {
1681   const struct upb_MiniTable* const* UPB_PRIVATE(submsg);
1682   const struct upb_MiniTableEnum* UPB_PRIVATE(subenum);
1683 } upb_MiniTableSubInternal;
1684 
1685 union upb_MiniTableSub {
1686   const struct upb_MiniTable* UPB_PRIVATE(submsg);
1687   const struct upb_MiniTableEnum* UPB_PRIVATE(subenum);
1688 };
1689 
1690 #ifdef __cplusplus
1691 extern "C" {
1692 #endif
1693 
upb_MiniTableSub_FromEnum(const struct upb_MiniTableEnum * subenum)1694 UPB_API_INLINE union upb_MiniTableSub upb_MiniTableSub_FromEnum(
1695     const struct upb_MiniTableEnum* subenum) {
1696   union upb_MiniTableSub out;
1697   out.UPB_PRIVATE(subenum) = subenum;
1698   return out;
1699 }
1700 
upb_MiniTableSub_FromMessage(const struct upb_MiniTable * submsg)1701 UPB_API_INLINE union upb_MiniTableSub upb_MiniTableSub_FromMessage(
1702     const struct upb_MiniTable* submsg) {
1703   union upb_MiniTableSub out;
1704   out.UPB_PRIVATE(submsg) = submsg;
1705   return out;
1706 }
1707 
upb_MiniTableSub_Enum(const union upb_MiniTableSub sub)1708 UPB_API_INLINE const struct upb_MiniTableEnum* upb_MiniTableSub_Enum(
1709     const union upb_MiniTableSub sub) {
1710   return sub.UPB_PRIVATE(subenum);
1711 }
1712 
upb_MiniTableSub_Message(const union upb_MiniTableSub sub)1713 UPB_API_INLINE const struct upb_MiniTable* upb_MiniTableSub_Message(
1714     const union upb_MiniTableSub sub) {
1715   return sub.UPB_PRIVATE(submsg);
1716 }
1717 
1718 #ifdef __cplusplus
1719 } /* extern "C" */
1720 #endif
1721 
1722 
1723 #endif /* UPB_MINI_TABLE_INTERNAL_SUB_H_ */
1724 
1725 // Must be last.
1726 
1727 struct upb_MiniTableExtension {
1728   // Do not move this field. We need to be able to alias pointers.
1729   struct upb_MiniTableField UPB_PRIVATE(field);
1730 
1731   const struct upb_MiniTable* UPB_PRIVATE(extendee);
1732   union upb_MiniTableSub UPB_PRIVATE(sub);  // NULL unless submsg or proto2 enum
1733 };
1734 
1735 #ifdef __cplusplus
1736 extern "C" {
1737 #endif
1738 
1739 UPB_API_INLINE upb_CType
upb_MiniTableExtension_CType(const struct upb_MiniTableExtension * e)1740 upb_MiniTableExtension_CType(const struct upb_MiniTableExtension* e) {
1741   return upb_MiniTableField_CType(&e->UPB_PRIVATE(field));
1742 }
1743 
1744 UPB_API_INLINE uint32_t
upb_MiniTableExtension_Number(const struct upb_MiniTableExtension * e)1745 upb_MiniTableExtension_Number(const struct upb_MiniTableExtension* e) {
1746   return e->UPB_PRIVATE(field).UPB_ONLYBITS(number);
1747 }
1748 
upb_MiniTableExtension_GetSubMessage(const struct upb_MiniTableExtension * e)1749 UPB_API_INLINE const struct upb_MiniTable* upb_MiniTableExtension_GetSubMessage(
1750     const struct upb_MiniTableExtension* e) {
1751   if (upb_MiniTableExtension_CType(e) != kUpb_CType_Message) {
1752     return NULL;
1753   }
1754   return upb_MiniTableSub_Message(e->UPB_PRIVATE(sub));
1755 }
1756 
upb_MiniTableExtension_SetSubMessage(struct upb_MiniTableExtension * e,const struct upb_MiniTable * m)1757 UPB_API_INLINE void upb_MiniTableExtension_SetSubMessage(
1758     struct upb_MiniTableExtension* e, const struct upb_MiniTable* m) {
1759   e->UPB_PRIVATE(sub).UPB_PRIVATE(submsg) = m;
1760 }
1761 
UPB_PRIVATE(_upb_MiniTableExtension_GetRep)1762 UPB_INLINE upb_FieldRep UPB_PRIVATE(_upb_MiniTableExtension_GetRep)(
1763     const struct upb_MiniTableExtension* e) {
1764   return UPB_PRIVATE(_upb_MiniTableField_GetRep)(&e->UPB_PRIVATE(field));
1765 }
1766 
1767 #ifdef __cplusplus
1768 } /* extern "C" */
1769 #endif
1770 
1771 
1772 #endif /* UPB_MINI_TABLE_INTERNAL_EXTENSION_H_ */
1773 
1774 #ifndef UPB_MINI_TABLE_MESSAGE_H_
1775 #define UPB_MINI_TABLE_MESSAGE_H_
1776 
1777 
1778 #ifndef UPB_MINI_TABLE_ENUM_H_
1779 #define UPB_MINI_TABLE_ENUM_H_
1780 
1781 #include <stdint.h>
1782 
1783 
1784 #ifndef UPB_MINI_TABLE_INTERNAL_ENUM_H_
1785 #define UPB_MINI_TABLE_INTERNAL_ENUM_H_
1786 
1787 #include <stdint.h>
1788 
1789 // Must be last.
1790 
1791 struct upb_MiniTableEnum {
1792   uint32_t UPB_PRIVATE(mask_limit);   // Highest that can be tested with mask.
1793   uint32_t UPB_PRIVATE(value_count);  // Number of values after the bitfield.
1794   uint32_t UPB_PRIVATE(data)[];       // Bitmask + enumerated values follow.
1795 };
1796 
1797 #ifdef __cplusplus
1798 extern "C" {
1799 #endif
1800 
upb_MiniTableEnum_CheckValue(const struct upb_MiniTableEnum * e,uint32_t val)1801 UPB_API_INLINE bool upb_MiniTableEnum_CheckValue(
1802     const struct upb_MiniTableEnum* e, uint32_t val) {
1803   if (UPB_LIKELY(val < 64)) {
1804     const uint64_t mask =
1805         e->UPB_PRIVATE(data)[0] | ((uint64_t)e->UPB_PRIVATE(data)[1] << 32);
1806     const uint64_t bit = 1ULL << val;
1807     return (mask & bit) != 0;
1808   }
1809   if (UPB_LIKELY(val < e->UPB_PRIVATE(mask_limit))) {
1810     const uint32_t mask = e->UPB_PRIVATE(data)[val / 32];
1811     const uint32_t bit = 1ULL << (val % 32);
1812     return (mask & bit) != 0;
1813   }
1814 
1815   // OPT: binary search long lists?
1816   const uint32_t* start =
1817       &e->UPB_PRIVATE(data)[e->UPB_PRIVATE(mask_limit) / 32];
1818   const uint32_t* limit = &e->UPB_PRIVATE(
1819       data)[e->UPB_PRIVATE(mask_limit) / 32 + e->UPB_PRIVATE(value_count)];
1820   for (const uint32_t* p = start; p < limit; p++) {
1821     if (*p == val) return true;
1822   }
1823   return false;
1824 }
1825 
1826 #ifdef __cplusplus
1827 } /* extern "C" */
1828 #endif
1829 
1830 
1831 #endif /* UPB_MINI_TABLE_INTERNAL_ENUM_H_ */
1832 
1833 // Must be last
1834 
1835 typedef struct upb_MiniTableEnum upb_MiniTableEnum;
1836 
1837 #ifdef __cplusplus
1838 extern "C" {
1839 #endif
1840 
1841 // Validates enum value against range defined by enum mini table.
1842 UPB_API_INLINE bool upb_MiniTableEnum_CheckValue(const upb_MiniTableEnum* e,
1843                                                  uint32_t val);
1844 
1845 #ifdef __cplusplus
1846 } /* extern "C" */
1847 #endif
1848 
1849 
1850 #endif /* UPB_MINI_TABLE_ENUM_H_ */
1851 
1852 #ifndef UPB_MINI_TABLE_FIELD_H_
1853 #define UPB_MINI_TABLE_FIELD_H_
1854 
1855 #include <stdint.h>
1856 
1857 
1858 // Must be last.
1859 
1860 typedef struct upb_MiniTableField upb_MiniTableField;
1861 
1862 #ifdef __cplusplus
1863 extern "C" {
1864 #endif
1865 
1866 UPB_API_INLINE upb_CType upb_MiniTableField_CType(const upb_MiniTableField* f);
1867 
1868 UPB_API_INLINE bool upb_MiniTableField_HasPresence(const upb_MiniTableField* f);
1869 
1870 UPB_API_INLINE bool upb_MiniTableField_IsArray(const upb_MiniTableField* f);
1871 
1872 UPB_API_INLINE bool upb_MiniTableField_IsClosedEnum(
1873     const upb_MiniTableField* f);
1874 
1875 UPB_API_INLINE bool upb_MiniTableField_IsExtension(const upb_MiniTableField* f);
1876 
1877 UPB_API_INLINE bool upb_MiniTableField_IsInOneof(const upb_MiniTableField* f);
1878 
1879 UPB_API_INLINE bool upb_MiniTableField_IsMap(const upb_MiniTableField* f);
1880 
1881 UPB_API_INLINE bool upb_MiniTableField_IsPacked(const upb_MiniTableField* f);
1882 
1883 UPB_API_INLINE bool upb_MiniTableField_IsScalar(const upb_MiniTableField* f);
1884 
1885 UPB_API_INLINE bool upb_MiniTableField_IsSubMessage(
1886     const upb_MiniTableField* f);
1887 
1888 UPB_API_INLINE uint32_t upb_MiniTableField_Number(const upb_MiniTableField* f);
1889 
1890 UPB_API_INLINE upb_FieldType
1891 upb_MiniTableField_Type(const upb_MiniTableField* f);
1892 
1893 #ifdef __cplusplus
1894 } /* extern "C" */
1895 #endif
1896 
1897 
1898 #endif /* UPB_MINI_TABLE_FIELD_H_ */
1899 
1900 #ifndef UPB_MINI_TABLE_INTERNAL_MESSAGE_H_
1901 #define UPB_MINI_TABLE_INTERNAL_MESSAGE_H_
1902 
1903 #include <stddef.h>
1904 #include <stdint.h>
1905 
1906 
1907 // Must be last.
1908 
1909 struct upb_Decoder;
1910 struct upb_Message;
1911 typedef const char* _upb_FieldParser(struct upb_Decoder* d, const char* ptr,
1912                                      struct upb_Message* msg, intptr_t table,
1913                                      uint64_t hasbits, uint64_t data);
1914 typedef struct {
1915   uint64_t field_data;
1916   _upb_FieldParser* field_parser;
1917 } _upb_FastTable_Entry;
1918 
1919 typedef enum {
1920   kUpb_ExtMode_NonExtendable = 0,  // Non-extendable message.
1921   kUpb_ExtMode_Extendable = 1,     // Normal extendable message.
1922   kUpb_ExtMode_IsMessageSet = 2,   // MessageSet message.
1923   kUpb_ExtMode_IsMessageSet_ITEM =
1924       3,  // MessageSet item (temporary only, see decode.c)
1925 
1926   // During table building we steal a bit to indicate that the message is a map
1927   // entry.  *Only* used during table building!
1928   kUpb_ExtMode_IsMapEntry = 4,
1929 } upb_ExtMode;
1930 
1931 // upb_MiniTable represents the memory layout of a given upb_MessageDef.
1932 // The members are public so generated code can initialize them,
1933 // but users MUST NOT directly read or write any of its members.
1934 
1935 // LINT.IfChange(minitable_struct_definition)
1936 struct upb_MiniTable {
1937   const upb_MiniTableSubInternal* UPB_PRIVATE(subs);
1938   const struct upb_MiniTableField* UPB_ONLYBITS(fields);
1939 
1940   // Must be aligned to sizeof(void*). Doesn't include internal members like
1941   // unknown fields, extension dict, pointer to msglayout, etc.
1942   uint16_t UPB_PRIVATE(size);
1943 
1944   uint16_t UPB_ONLYBITS(field_count);
1945 
1946   uint8_t UPB_PRIVATE(ext);  // upb_ExtMode, uint8_t here so sizeof(ext) == 1
1947   uint8_t UPB_PRIVATE(dense_below);
1948   uint8_t UPB_PRIVATE(table_mask);
1949   uint8_t UPB_PRIVATE(required_count);  // Required fields have the low hasbits.
1950 
1951 #ifdef UPB_TRACING_ENABLED
1952   const char* UPB_PRIVATE(full_name);
1953 #endif
1954 
1955 #ifdef UPB_FASTTABLE_ENABLED
1956   // To statically initialize the tables of variable length, we need a flexible
1957   // array member, and we need to compile in gnu99 mode (constant initialization
1958   // of flexible array members is a GNU extension, not in C99 unfortunately.
1959   _upb_FastTable_Entry UPB_PRIVATE(fasttable)[];
1960 #endif
1961 };
1962 // LINT.ThenChange(//depot/google3/third_party/upb/bits/typescript/mini_table.ts)
1963 
1964 #ifdef __cplusplus
1965 extern "C" {
1966 #endif
1967 
UPB_PRIVATE(_upb_MiniTable_StrongReference)1968 UPB_INLINE const struct upb_MiniTable* UPB_PRIVATE(
1969     _upb_MiniTable_StrongReference)(const struct upb_MiniTable* mt) {
1970 #if defined(__GNUC__)
1971   __asm__("" : : "r"(mt));
1972 #else
1973   const struct upb_MiniTable* volatile unused = mt;
1974   (void)&unused;  // Use address to avoid an extra load of "unused".
1975 #endif
1976   return mt;
1977 }
1978 
UPB_PRIVATE(_upb_MiniTable_Empty)1979 UPB_INLINE const struct upb_MiniTable* UPB_PRIVATE(_upb_MiniTable_Empty)(void) {
1980   extern const struct upb_MiniTable UPB_PRIVATE(_kUpb_MiniTable_Empty);
1981 
1982   return &UPB_PRIVATE(_kUpb_MiniTable_Empty);
1983 }
1984 
upb_MiniTable_FieldCount(const struct upb_MiniTable * m)1985 UPB_API_INLINE int upb_MiniTable_FieldCount(const struct upb_MiniTable* m) {
1986   return m->UPB_ONLYBITS(field_count);
1987 }
1988 
UPB_PRIVATE(_upb_MiniTable_IsEmpty)1989 UPB_INLINE bool UPB_PRIVATE(_upb_MiniTable_IsEmpty)(
1990     const struct upb_MiniTable* m) {
1991   extern const struct upb_MiniTable UPB_PRIVATE(_kUpb_MiniTable_Empty);
1992 
1993   return m == &UPB_PRIVATE(_kUpb_MiniTable_Empty);
1994 }
1995 
upb_MiniTable_GetFieldByIndex(const struct upb_MiniTable * m,uint32_t i)1996 UPB_API_INLINE const struct upb_MiniTableField* upb_MiniTable_GetFieldByIndex(
1997     const struct upb_MiniTable* m, uint32_t i) {
1998   return &m->UPB_ONLYBITS(fields)[i];
1999 }
2000 
UPB_PRIVATE(_upb_MiniTable_GetSubTableByIndex)2001 UPB_INLINE const struct upb_MiniTable* UPB_PRIVATE(
2002     _upb_MiniTable_GetSubTableByIndex)(const struct upb_MiniTable* m,
2003                                        uint32_t i) {
2004   return *m->UPB_PRIVATE(subs)[i].UPB_PRIVATE(submsg);
2005 }
2006 
upb_MiniTable_SubMessage(const struct upb_MiniTable * m,const struct upb_MiniTableField * f)2007 UPB_API_INLINE const struct upb_MiniTable* upb_MiniTable_SubMessage(
2008     const struct upb_MiniTable* m, const struct upb_MiniTableField* f) {
2009   if (upb_MiniTableField_CType(f) != kUpb_CType_Message) {
2010     return NULL;
2011   }
2012   return UPB_PRIVATE(_upb_MiniTable_GetSubTableByIndex)(
2013       m, f->UPB_PRIVATE(submsg_index));
2014 }
2015 
upb_MiniTable_GetSubMessageTable(const struct upb_MiniTable * m,const struct upb_MiniTableField * f)2016 UPB_API_INLINE const struct upb_MiniTable* upb_MiniTable_GetSubMessageTable(
2017     const struct upb_MiniTable* m, const struct upb_MiniTableField* f) {
2018   UPB_ASSUME(upb_MiniTableField_CType(f) == kUpb_CType_Message);
2019   const struct upb_MiniTable* ret = upb_MiniTable_SubMessage(m, f);
2020   UPB_ASSUME(ret);
2021   return UPB_PRIVATE(_upb_MiniTable_IsEmpty)(ret) ? NULL : ret;
2022 }
2023 
upb_MiniTable_FieldIsLinked(const struct upb_MiniTable * m,const struct upb_MiniTableField * f)2024 UPB_API_INLINE bool upb_MiniTable_FieldIsLinked(
2025     const struct upb_MiniTable* m, const struct upb_MiniTableField* f) {
2026   return upb_MiniTable_GetSubMessageTable(m, f) != NULL;
2027 }
2028 
upb_MiniTable_MapEntrySubMessage(const struct upb_MiniTable * m,const struct upb_MiniTableField * f)2029 UPB_API_INLINE const struct upb_MiniTable* upb_MiniTable_MapEntrySubMessage(
2030     const struct upb_MiniTable* m, const struct upb_MiniTableField* f) {
2031   UPB_ASSERT(upb_MiniTable_FieldIsLinked(m, f));  // Map entries must be linked.
2032   UPB_ASSERT(upb_MiniTableField_IsMap(f));        // Function precondition.
2033   return upb_MiniTable_SubMessage(m, f);
2034 }
2035 
upb_MiniTable_GetSubEnumTable(const struct upb_MiniTable * m,const struct upb_MiniTableField * f)2036 UPB_API_INLINE const struct upb_MiniTableEnum* upb_MiniTable_GetSubEnumTable(
2037     const struct upb_MiniTable* m, const struct upb_MiniTableField* f) {
2038   UPB_ASSERT(upb_MiniTableField_CType(f) == kUpb_CType_Enum);
2039   return m->UPB_PRIVATE(subs)[f->UPB_PRIVATE(submsg_index)].UPB_PRIVATE(
2040       subenum);
2041 }
2042 
upb_MiniTable_MapKey(const struct upb_MiniTable * m)2043 UPB_API_INLINE const struct upb_MiniTableField* upb_MiniTable_MapKey(
2044     const struct upb_MiniTable* m) {
2045   UPB_ASSERT(upb_MiniTable_FieldCount(m) == 2);
2046   const struct upb_MiniTableField* f = upb_MiniTable_GetFieldByIndex(m, 0);
2047   UPB_ASSERT(upb_MiniTableField_Number(f) == 1);
2048   return f;
2049 }
2050 
upb_MiniTable_MapValue(const struct upb_MiniTable * m)2051 UPB_API_INLINE const struct upb_MiniTableField* upb_MiniTable_MapValue(
2052     const struct upb_MiniTable* m) {
2053   UPB_ASSERT(upb_MiniTable_FieldCount(m) == 2);
2054   const struct upb_MiniTableField* f = upb_MiniTable_GetFieldByIndex(m, 1);
2055   UPB_ASSERT(upb_MiniTableField_Number(f) == 2);
2056   return f;
2057 }
2058 
2059 // Computes a bitmask in which the |m->required_count| lowest bits are set.
2060 //
2061 // Sample output:
2062 //    RequiredMask(1) => 0b1 (0x1)
2063 //    RequiredMask(5) => 0b11111 (0x1f)
2064 UPB_INLINE uint64_t
UPB_PRIVATE(_upb_MiniTable_RequiredMask)2065 UPB_PRIVATE(_upb_MiniTable_RequiredMask)(const struct upb_MiniTable* m) {
2066   int n = m->UPB_PRIVATE(required_count);
2067   UPB_ASSERT(0 < n && n <= 64);
2068   return (1ULL << n) - 1;
2069 }
2070 
2071 #ifdef UPB_TRACING_ENABLED
upb_MiniTable_FullName(const struct upb_MiniTable * mini_table)2072 UPB_INLINE const char* upb_MiniTable_FullName(
2073     const struct upb_MiniTable* mini_table) {
2074   return mini_table->UPB_PRIVATE(full_name);
2075 }
2076 // Initializes tracing proto name from language runtimes that construct
2077 // mini tables dynamically at runtime. The runtime is responsible for passing
2078 // controlling lifetime of name such as storing in same arena as mini_table.
upb_MiniTable_SetFullName(struct upb_MiniTable * mini_table,const char * full_name)2079 UPB_INLINE void upb_MiniTable_SetFullName(struct upb_MiniTable* mini_table,
2080                                           const char* full_name) {
2081   mini_table->UPB_PRIVATE(full_name) = full_name;
2082 }
2083 #endif
2084 
2085 #ifdef __cplusplus
2086 } /* extern "C" */
2087 #endif
2088 
2089 
2090 #endif /* UPB_MINI_TABLE_INTERNAL_MESSAGE_H_ */
2091 
2092 // Must be last.
2093 
2094 typedef struct upb_MiniTable upb_MiniTable;
2095 
2096 #ifdef __cplusplus
2097 extern "C" {
2098 #endif
2099 
2100 UPB_API const upb_MiniTableField* upb_MiniTable_FindFieldByNumber(
2101     const upb_MiniTable* m, uint32_t number);
2102 
2103 UPB_API_INLINE const upb_MiniTableField* upb_MiniTable_GetFieldByIndex(
2104     const upb_MiniTable* m, uint32_t index);
2105 
2106 UPB_API_INLINE int upb_MiniTable_FieldCount(const upb_MiniTable* m);
2107 
2108 // DEPRECATED: use upb_MiniTable_SubMessage() instead
2109 // Returns the MiniTable for a message field, NULL if the field is unlinked.
2110 UPB_API_INLINE const upb_MiniTable* upb_MiniTable_GetSubMessageTable(
2111     const upb_MiniTable* m, const upb_MiniTableField* f);
2112 
2113 // Returns the MiniTable for a message field if it is a submessage, otherwise
2114 // returns NULL.
2115 //
2116 // WARNING: if dynamic tree shaking is in use, the return value may be the
2117 // "empty", zero-field placeholder message instead of the real message type.
2118 // If the message is later linked, this function will begin returning the real
2119 // message type.
2120 UPB_API_INLINE const upb_MiniTable* upb_MiniTable_SubMessage(
2121     const upb_MiniTable* m, const upb_MiniTableField* f);
2122 
2123 // Returns the MiniTable for a map field.  The given field must refer to a map.
2124 UPB_API_INLINE const upb_MiniTable* upb_MiniTable_MapEntrySubMessage(
2125     const upb_MiniTable* m, const upb_MiniTableField* f);
2126 
2127 // Returns the MiniTableEnum for a message field, NULL if the field is unlinked.
2128 UPB_API_INLINE const upb_MiniTableEnum* upb_MiniTable_GetSubEnumTable(
2129     const upb_MiniTable* m, const upb_MiniTableField* f);
2130 
2131 // Returns the MiniTableField for the key of a map.
2132 UPB_API_INLINE const upb_MiniTableField* upb_MiniTable_MapKey(
2133     const upb_MiniTable* m);
2134 
2135 // Returns the MiniTableField for the value of a map.
2136 UPB_API_INLINE const upb_MiniTableField* upb_MiniTable_MapValue(
2137     const upb_MiniTable* m);
2138 
2139 // Returns true if this MiniTable field is linked to a MiniTable for the
2140 // sub-message.
2141 UPB_API_INLINE bool upb_MiniTable_FieldIsLinked(const upb_MiniTable* m,
2142                                                 const upb_MiniTableField* f);
2143 
2144 // If this field is in a oneof, returns the first field in the oneof.
2145 //
2146 // Otherwise returns NULL.
2147 //
2148 // Usage:
2149 //   const upb_MiniTableField* field = upb_MiniTable_GetOneof(m, f);
2150 //   do {
2151 //       ..
2152 //   } while (upb_MiniTable_NextOneofField(m, &field);
2153 //
2154 const upb_MiniTableField* upb_MiniTable_GetOneof(const upb_MiniTable* m,
2155                                                  const upb_MiniTableField* f);
2156 
2157 // Iterates to the next field in the oneof. If this is the last field in the
2158 // oneof, returns false. The ordering of fields in the oneof is not
2159 // guaranteed.
2160 // REQUIRES: |f| is the field initialized by upb_MiniTable_GetOneof and updated
2161 //           by prior upb_MiniTable_NextOneofField calls.
2162 bool upb_MiniTable_NextOneofField(const upb_MiniTable* m,
2163                                   const upb_MiniTableField** f);
2164 
2165 #ifdef __cplusplus
2166 } /* extern "C" */
2167 #endif
2168 
2169 
2170 #endif /* UPB_MINI_TABLE_MESSAGE_H_ */
2171 
2172 // Must be last.
2173 
2174 typedef struct upb_MiniTableExtension upb_MiniTableExtension;
2175 
2176 #ifdef __cplusplus
2177 extern "C" {
2178 #endif
2179 
2180 UPB_API_INLINE upb_CType
2181 upb_MiniTableExtension_CType(const upb_MiniTableExtension* e);
2182 
2183 UPB_API_INLINE uint32_t
2184 upb_MiniTableExtension_Number(const upb_MiniTableExtension* e);
2185 
2186 UPB_API_INLINE const upb_MiniTable* upb_MiniTableExtension_GetSubMessage(
2187     const upb_MiniTableExtension* e);
2188 
2189 UPB_API_INLINE void upb_MiniTableExtension_SetSubMessage(
2190     upb_MiniTableExtension* e, const upb_MiniTable* m);
2191 
2192 #ifdef __cplusplus
2193 } /* extern "C" */
2194 #endif
2195 
2196 
2197 #endif /* UPB_MINI_TABLE_EXTENSION_H_ */
2198 
2199 // Must be last.
2200 
2201 // The internal representation of an extension is self-describing: it contains
2202 // enough information that we can serialize it to binary format without needing
2203 // to look it up in a upb_ExtensionRegistry.
2204 //
2205 // This representation allocates 16 bytes to data on 64-bit platforms.
2206 // This is rather wasteful for scalars (in the extreme case of bool,
2207 // it wastes 15 bytes). We accept this because we expect messages to be
2208 // the most common extension type.
2209 typedef struct {
2210   const upb_MiniTableExtension* ext;
2211   upb_MessageValue data;
2212 } upb_Extension;
2213 
2214 #ifdef __cplusplus
2215 extern "C" {
2216 #endif
2217 
2218 // Adds the given extension data to the given message.
2219 // |ext| is copied into the message instance.
2220 // This logically replaces any previously-added extension with this number.
2221 upb_Extension* UPB_PRIVATE(_upb_Message_GetOrCreateExtension)(
2222     struct upb_Message* msg, const upb_MiniTableExtension* ext,
2223     upb_Arena* arena);
2224 
2225 // Returns an array of extensions for this message.
2226 // Note: the array is ordered in reverse relative to the order of creation.
2227 const upb_Extension* UPB_PRIVATE(_upb_Message_Getexts)(
2228     const struct upb_Message* msg, size_t* count);
2229 
2230 // Returns an extension for a message with a given mini table,
2231 // or NULL if no extension exists with this mini table.
2232 const upb_Extension* UPB_PRIVATE(_upb_Message_Getext)(
2233     const struct upb_Message* msg, const upb_MiniTableExtension* ext);
2234 
2235 #ifdef __cplusplus
2236 } /* extern "C" */
2237 #endif
2238 
2239 
2240 #endif /* UPB_MESSAGE_INTERNAL_EXTENSION_H_ */
2241 
2242 // Must be last.
2243 
2244 #ifdef __cplusplus
2245 extern "C" {
2246 #endif
2247 
2248 extern const float kUpb_FltInfinity;
2249 extern const double kUpb_Infinity;
2250 extern const double kUpb_NaN;
2251 
2252 // Internal members of a upb_Message that track unknown fields and/or
2253 // extensions. We can change this without breaking binary compatibility.
2254 
2255 typedef struct upb_Message_Internal {
2256   // Total size of this structure, including the data that follows.
2257   // Must be aligned to 8, which is alignof(upb_Extension)
2258   uint32_t size;
2259 
2260   /* Offsets relative to the beginning of this structure.
2261    *
2262    * Unknown data grows forward from the beginning to unknown_end.
2263    * Extension data grows backward from size to ext_begin.
2264    * When the two meet, we're out of data and have to realloc.
2265    *
2266    * If we imagine that the final member of this struct is:
2267    *   char data[size - overhead];  // overhead = sizeof(upb_Message_Internal)
2268    *
2269    * Then we have:
2270    *   unknown data: data[0 .. (unknown_end - overhead)]
2271    *   extensions data: data[(ext_begin - overhead) .. (size - overhead)] */
2272   uint32_t unknown_end;
2273   uint32_t ext_begin;
2274   // Data follows, as if there were an array:
2275   //   char data[size - sizeof(upb_Message_Internal)];
2276 } upb_Message_Internal;
2277 
2278 #ifdef UPB_TRACING_ENABLED
2279 UPB_API void upb_Message_LogNewMessage(const upb_MiniTable* m,
2280                                        const upb_Arena* arena);
2281 UPB_API void upb_Message_SetNewMessageTraceHandler(
2282     void (*handler)(const upb_MiniTable*, const upb_Arena*));
2283 #endif  // UPB_TRACING_ENABLED
2284 
2285 // Inline version upb_Message_New(), for internal use.
_upb_Message_New(const upb_MiniTable * m,upb_Arena * a)2286 UPB_INLINE struct upb_Message* _upb_Message_New(const upb_MiniTable* m,
2287                                                 upb_Arena* a) {
2288 #ifdef UPB_TRACING_ENABLED
2289   upb_Message_LogNewMessage(m, a);
2290 #endif  // UPB_TRACING_ENABLED
2291 
2292   const int size = m->UPB_PRIVATE(size);
2293   struct upb_Message* msg = (struct upb_Message*)upb_Arena_Malloc(a, size);
2294   if (UPB_UNLIKELY(!msg)) return NULL;
2295   memset(msg, 0, size);
2296   return msg;
2297 }
2298 
2299 // Discards the unknown fields for this message only.
2300 void _upb_Message_DiscardUnknown_shallow(struct upb_Message* msg);
2301 
2302 // Adds unknown data (serialized protobuf data) to the given message.
2303 // The data is copied into the message instance.
2304 bool UPB_PRIVATE(_upb_Message_AddUnknown)(struct upb_Message* msg,
2305                                           const char* data, size_t len,
2306                                           upb_Arena* arena);
2307 
2308 bool UPB_PRIVATE(_upb_Message_Realloc)(struct upb_Message* msg, size_t need,
2309                                        upb_Arena* arena);
2310 
2311 #ifdef __cplusplus
2312 } /* extern "C" */
2313 #endif
2314 
2315 
2316 #endif /* UPB_MESSAGE_INTERNAL_MESSAGE_H_ */
2317 
2318 #ifndef UPB_MESSAGE_INTERNAL_TYPES_H_
2319 #define UPB_MESSAGE_INTERNAL_TYPES_H_
2320 
2321 #include <stdint.h>
2322 
2323 // Must be last.
2324 
2325 #define UPB_OPAQUE(x) x##_opaque
2326 
2327 struct upb_Message {
2328   union {
2329     uintptr_t UPB_OPAQUE(internal);  // tagged pointer, low bit == frozen
2330     double d;  // Forces same size for 32-bit/64-bit builds
2331   };
2332 };
2333 
2334 #ifdef __cplusplus
2335 extern "C" {
2336 #endif
2337 
UPB_PRIVATE(_upb_Message_ShallowFreeze)2338 UPB_INLINE void UPB_PRIVATE(_upb_Message_ShallowFreeze)(
2339     struct upb_Message* msg) {
2340   msg->UPB_OPAQUE(internal) |= 1ULL;
2341 }
2342 
upb_Message_IsFrozen(const struct upb_Message * msg)2343 UPB_API_INLINE bool upb_Message_IsFrozen(const struct upb_Message* msg) {
2344   return (msg->UPB_OPAQUE(internal) & 1ULL) != 0;
2345 }
2346 
UPB_PRIVATE(_upb_Message_GetInternal)2347 UPB_INLINE struct upb_Message_Internal* UPB_PRIVATE(_upb_Message_GetInternal)(
2348     const struct upb_Message* msg) {
2349   const uintptr_t tmp = msg->UPB_OPAQUE(internal) & ~1ULL;
2350   return (struct upb_Message_Internal*)tmp;
2351 }
2352 
UPB_PRIVATE(_upb_Message_SetInternal)2353 UPB_INLINE void UPB_PRIVATE(_upb_Message_SetInternal)(
2354     struct upb_Message* msg, struct upb_Message_Internal* internal) {
2355   UPB_ASSERT(!upb_Message_IsFrozen(msg));
2356   msg->UPB_OPAQUE(internal) = (uintptr_t)internal;
2357 }
2358 
2359 #ifdef __cplusplus
2360 } /* extern "C" */
2361 #endif
2362 
2363 #undef UPB_OPAQUE
2364 
2365 
2366 #endif /* UPB_MESSAGE_INTERNAL_TYPES_H_ */
2367 
2368 // Must be last.
2369 
2370 typedef struct upb_Message upb_Message;
2371 
2372 #ifdef __cplusplus
2373 extern "C" {
2374 #endif
2375 
2376 // Creates a new message with the given mini_table on the given arena.
2377 UPB_API upb_Message* upb_Message_New(const upb_MiniTable* m, upb_Arena* arena);
2378 
2379 // Returns a reference to the message's unknown data.
2380 const char* upb_Message_GetUnknown(const upb_Message* msg, size_t* len);
2381 
2382 // Removes partial unknown data from message.
2383 void upb_Message_DeleteUnknown(upb_Message* msg, const char* data, size_t len);
2384 
2385 // Returns the number of extensions present in this message.
2386 size_t upb_Message_ExtensionCount(const upb_Message* msg);
2387 
2388 // Mark a message and all of its descendents as frozen/immutable.
2389 UPB_API void upb_Message_Freeze(upb_Message* msg, const upb_MiniTable* m);
2390 
2391 // Returns whether a message has been frozen.
2392 UPB_API_INLINE bool upb_Message_IsFrozen(const upb_Message* msg);
2393 
2394 #ifdef UPB_TRACING_ENABLED
2395 UPB_API void upb_Message_LogNewMessage(const upb_MiniTable* m,
2396                                        const upb_Arena* arena);
2397 
2398 UPB_API void upb_Message_SetNewMessageTraceHandler(
2399     void (*handler)(const upb_MiniTable* m, const upb_Arena* arena));
2400 #endif  // UPB_TRACING_ENABLED
2401 
2402 #ifdef __cplusplus
2403 } /* extern "C" */
2404 #endif
2405 
2406 
2407 #endif /* UPB_MESSAGE_MESSAGE_H_ */
2408 
2409 #ifndef UPB_REFLECTION_DEF_H_
2410 #define UPB_REFLECTION_DEF_H_
2411 
2412 // IWYU pragma: begin_exports
2413 
2414 // IWYU pragma: private, include "upb/reflection/def.h"
2415 
2416 #ifndef UPB_REFLECTION_DEF_POOL_H_
2417 #define UPB_REFLECTION_DEF_POOL_H_
2418 
2419 
2420 // IWYU pragma: private, include "upb/reflection/def.h"
2421 
2422 // Declarations common to all public def types.
2423 
2424 #ifndef UPB_REFLECTION_COMMON_H_
2425 #define UPB_REFLECTION_COMMON_H_
2426 
2427 #ifndef THIRD_PARTY_UPB_UPB_REFLECTION_DESCRIPTOR_BOOTSTRAP_H_
2428 #define THIRD_PARTY_UPB_UPB_REFLECTION_DESCRIPTOR_BOOTSTRAP_H_
2429 
2430 // IWYU pragma: begin_exports
2431 
2432 #if defined(UPB_BOOTSTRAP_STAGE) && UPB_BOOTSTRAP_STAGE == 0
2433 // This header is checked in.
2434 #elif UPB_BOOTSTRAP_STAGE == 1
2435 // This header is generated at build time by the bootstrapping process.
2436 #else
2437 // This is the normal header, generated by upb_c_proto_library().
2438 /* This file was generated by upb_generator from the input file:
2439  *
2440  *     google/protobuf/descriptor.proto
2441  *
2442  * Do not edit -- your changes will be discarded when the file is
2443  * regenerated.
2444  * NO CHECKED-IN PROTOBUF GENCODE */
2445 
2446 #ifndef GOOGLE_PROTOBUF_DESCRIPTOR_PROTO_UPB_H__UPB_H_
2447 #define GOOGLE_PROTOBUF_DESCRIPTOR_PROTO_UPB_H__UPB_H_
2448 
2449 
2450 #ifndef UPB_GENERATED_CODE_SUPPORT_H_
2451 #define UPB_GENERATED_CODE_SUPPORT_H_
2452 
2453 // IWYU pragma: begin_exports
2454 
2455 #ifndef UPB_BASE_UPCAST_H_
2456 #define UPB_BASE_UPCAST_H_
2457 
2458 // Must be last.
2459 
2460 // This macro provides a way to upcast message pointers in a way that is
2461 // somewhat more bulletproof than blindly casting a pointer. Example:
2462 //
2463 // typedef struct {
2464 //   upb_Message UPB_PRIVATE(base);
2465 // } pkg_FooMessage;
2466 //
2467 // void f(pkg_FooMessage* msg) {
2468 //   upb_Decode(UPB_UPCAST(msg), ...);
2469 // }
2470 
2471 #define UPB_UPCAST(x) (&(x)->base##_dont_copy_me__upb_internal_use_only)
2472 
2473 
2474 #endif /* UPB_BASE_UPCAST_H_ */
2475 
2476 #ifndef UPB_MESSAGE_ACCESSORS_H_
2477 #define UPB_MESSAGE_ACCESSORS_H_
2478 
2479 #include <stdint.h>
2480 
2481 
2482 #ifndef UPB_MESSAGE_ARRAY_H_
2483 #define UPB_MESSAGE_ARRAY_H_
2484 
2485 #include <stddef.h>
2486 
2487 
2488 #ifndef UPB_MESSAGE_INTERNAL_ARRAY_H_
2489 #define UPB_MESSAGE_INTERNAL_ARRAY_H_
2490 
2491 #include <stdint.h>
2492 #include <string.h>
2493 
2494 
2495 // Must be last.
2496 
2497 #define _UPB_ARRAY_MASK_IMM 0x4  // Frozen/immutable bit.
2498 #define _UPB_ARRAY_MASK_LG2 0x3  // Encoded elem size.
2499 #define _UPB_ARRAY_MASK_ALL (_UPB_ARRAY_MASK_IMM | _UPB_ARRAY_MASK_LG2)
2500 
2501 #ifdef __cplusplus
2502 extern "C" {
2503 #endif
2504 
2505 // LINT.IfChange(upb_Array)
2506 
2507 // Our internal representation for repeated fields.
2508 struct upb_Array {
2509   // This is a tagged pointer. Bits #0 and #1 encode the elem size as follows:
2510   //   0 maps to elem size 1
2511   //   1 maps to elem size 4
2512   //   2 maps to elem size 8
2513   //   3 maps to elem size 16
2514   //
2515   // Bit #2 contains the frozen/immutable flag.
2516   uintptr_t UPB_ONLYBITS(data);
2517 
2518   size_t UPB_ONLYBITS(size);     // The number of elements in the array.
2519   size_t UPB_PRIVATE(capacity);  // Allocated storage. Measured in elements.
2520 };
2521 
UPB_PRIVATE(_upb_Array_ShallowFreeze)2522 UPB_INLINE void UPB_PRIVATE(_upb_Array_ShallowFreeze)(struct upb_Array* arr) {
2523   arr->UPB_ONLYBITS(data) |= _UPB_ARRAY_MASK_IMM;
2524 }
2525 
upb_Array_IsFrozen(const struct upb_Array * arr)2526 UPB_API_INLINE bool upb_Array_IsFrozen(const struct upb_Array* arr) {
2527   return (arr->UPB_ONLYBITS(data) & _UPB_ARRAY_MASK_IMM) != 0;
2528 }
2529 
UPB_PRIVATE(_upb_Array_SetTaggedPtr)2530 UPB_INLINE void UPB_PRIVATE(_upb_Array_SetTaggedPtr)(struct upb_Array* array,
2531                                                      void* data, size_t lg2) {
2532   UPB_ASSERT(lg2 != 1);
2533   UPB_ASSERT(lg2 <= 4);
2534   const size_t bits = lg2 - (lg2 != 0);
2535   array->UPB_ONLYBITS(data) = (uintptr_t)data | bits;
2536 }
2537 
2538 UPB_INLINE size_t
UPB_PRIVATE(_upb_Array_ElemSizeLg2)2539 UPB_PRIVATE(_upb_Array_ElemSizeLg2)(const struct upb_Array* array) {
2540   const size_t bits = array->UPB_ONLYBITS(data) & _UPB_ARRAY_MASK_LG2;
2541   const size_t lg2 = bits + (bits != 0);
2542   return lg2;
2543 }
2544 
upb_Array_DataPtr(const struct upb_Array * array)2545 UPB_API_INLINE const void* upb_Array_DataPtr(const struct upb_Array* array) {
2546   UPB_PRIVATE(_upb_Array_ElemSizeLg2)(array);  // Check assertions.
2547   return (void*)(array->UPB_ONLYBITS(data) & ~(uintptr_t)_UPB_ARRAY_MASK_ALL);
2548 }
2549 
upb_Array_MutableDataPtr(struct upb_Array * array)2550 UPB_API_INLINE void* upb_Array_MutableDataPtr(struct upb_Array* array) {
2551   return (void*)upb_Array_DataPtr(array);
2552 }
2553 
UPB_PRIVATE(_upb_Array_New)2554 UPB_INLINE struct upb_Array* UPB_PRIVATE(_upb_Array_New)(upb_Arena* arena,
2555                                                          size_t init_capacity,
2556                                                          int elem_size_lg2) {
2557   UPB_ASSERT(elem_size_lg2 != 1);
2558   UPB_ASSERT(elem_size_lg2 <= 4);
2559   const size_t array_size =
2560       UPB_ALIGN_UP(sizeof(struct upb_Array), UPB_MALLOC_ALIGN);
2561   const size_t bytes = array_size + (init_capacity << elem_size_lg2);
2562   struct upb_Array* array = (struct upb_Array*)upb_Arena_Malloc(arena, bytes);
2563   if (!array) return NULL;
2564   UPB_PRIVATE(_upb_Array_SetTaggedPtr)
2565   (array, UPB_PTR_AT(array, array_size, void), elem_size_lg2);
2566   array->UPB_ONLYBITS(size) = 0;
2567   array->UPB_PRIVATE(capacity) = init_capacity;
2568   return array;
2569 }
2570 
2571 // Resizes the capacity of the array to be at least min_size.
2572 bool UPB_PRIVATE(_upb_Array_Realloc)(struct upb_Array* array, size_t min_size,
2573                                      upb_Arena* arena);
2574 
upb_Array_Reserve(struct upb_Array * array,size_t size,upb_Arena * arena)2575 UPB_API_INLINE bool upb_Array_Reserve(struct upb_Array* array, size_t size,
2576                                       upb_Arena* arena) {
2577   UPB_ASSERT(!upb_Array_IsFrozen(array));
2578   if (array->UPB_PRIVATE(capacity) < size)
2579     return UPB_PRIVATE(_upb_Array_Realloc)(array, size, arena);
2580   return true;
2581 }
2582 
2583 // Resize without initializing new elements.
UPB_PRIVATE(_upb_Array_ResizeUninitialized)2584 UPB_INLINE bool UPB_PRIVATE(_upb_Array_ResizeUninitialized)(
2585     struct upb_Array* array, size_t size, upb_Arena* arena) {
2586   UPB_ASSERT(!upb_Array_IsFrozen(array));
2587   UPB_ASSERT(size <= array->UPB_ONLYBITS(size) ||
2588              arena);  // Allow NULL arena when shrinking.
2589   if (!upb_Array_Reserve(array, size, arena)) return false;
2590   array->UPB_ONLYBITS(size) = size;
2591   return true;
2592 }
2593 
2594 // This function is intended for situations where elem_size is compile-time
2595 // constant or a known expression of the form (1 << lg2), so that the expression
2596 // i*elem_size does not result in an actual multiplication.
UPB_PRIVATE(_upb_Array_Set)2597 UPB_INLINE void UPB_PRIVATE(_upb_Array_Set)(struct upb_Array* array, size_t i,
2598                                             const void* data,
2599                                             size_t elem_size) {
2600   UPB_ASSERT(!upb_Array_IsFrozen(array));
2601   UPB_ASSERT(i < array->UPB_ONLYBITS(size));
2602   UPB_ASSERT(elem_size == 1U << UPB_PRIVATE(_upb_Array_ElemSizeLg2)(array));
2603   char* arr_data = (char*)upb_Array_MutableDataPtr(array);
2604   memcpy(arr_data + (i * elem_size), data, elem_size);
2605 }
2606 
upb_Array_Size(const struct upb_Array * arr)2607 UPB_API_INLINE size_t upb_Array_Size(const struct upb_Array* arr) {
2608   return arr->UPB_ONLYBITS(size);
2609 }
2610 
2611 // LINT.ThenChange(GoogleInternalName0)
2612 
2613 #ifdef __cplusplus
2614 } /* extern "C" */
2615 #endif
2616 
2617 #undef _UPB_ARRAY_MASK_IMM
2618 #undef _UPB_ARRAY_MASK_LG2
2619 #undef _UPB_ARRAY_MASK_ALL
2620 
2621 
2622 #endif /* UPB_MESSAGE_INTERNAL_ARRAY_H_ */
2623 
2624 // Must be last.
2625 
2626 typedef struct upb_Array upb_Array;
2627 
2628 #ifdef __cplusplus
2629 extern "C" {
2630 #endif
2631 
2632 // Creates a new array on the given arena that holds elements of this type.
2633 UPB_API upb_Array* upb_Array_New(upb_Arena* a, upb_CType type);
2634 
2635 // Returns the number of elements in the array.
2636 UPB_API_INLINE size_t upb_Array_Size(const upb_Array* arr);
2637 
2638 // Returns the given element, which must be within the array's current size.
2639 UPB_API upb_MessageValue upb_Array_Get(const upb_Array* arr, size_t i);
2640 
2641 // Returns a mutating pointer to the given element, which must be within the
2642 // array's current size.
2643 UPB_API upb_MutableMessageValue upb_Array_GetMutable(upb_Array* arr, size_t i);
2644 
2645 // Sets the given element, which must be within the array's current size.
2646 UPB_API void upb_Array_Set(upb_Array* arr, size_t i, upb_MessageValue val);
2647 
2648 // Appends an element to the array. Returns false on allocation failure.
2649 UPB_API bool upb_Array_Append(upb_Array* array, upb_MessageValue val,
2650                               upb_Arena* arena);
2651 
2652 // Moves elements within the array using memmove().
2653 // Like memmove(), the source and destination elements may be overlapping.
2654 UPB_API void upb_Array_Move(upb_Array* array, size_t dst_idx, size_t src_idx,
2655                             size_t count);
2656 
2657 // Inserts one or more empty elements into the array.
2658 // Existing elements are shifted right.
2659 // The new elements have undefined state and must be set with `upb_Array_Set()`.
2660 // REQUIRES: `i <= upb_Array_Size(arr)`
2661 UPB_API bool upb_Array_Insert(upb_Array* array, size_t i, size_t count,
2662                               upb_Arena* arena);
2663 
2664 // Deletes one or more elements from the array.
2665 // Existing elements are shifted left.
2666 // REQUIRES: `i + count <= upb_Array_Size(arr)`
2667 UPB_API void upb_Array_Delete(upb_Array* array, size_t i, size_t count);
2668 
2669 // Reserves |size| elements of storage for the array.
2670 UPB_API_INLINE bool upb_Array_Reserve(struct upb_Array* array, size_t size,
2671                                       upb_Arena* arena);
2672 
2673 // Changes the size of a vector. New elements are initialized to NULL/0.
2674 // Returns false on allocation failure.
2675 UPB_API bool upb_Array_Resize(upb_Array* array, size_t size, upb_Arena* arena);
2676 
2677 // Returns pointer to array data.
2678 UPB_API_INLINE const void* upb_Array_DataPtr(const upb_Array* arr);
2679 
2680 // Returns mutable pointer to array data.
2681 UPB_API_INLINE void* upb_Array_MutableDataPtr(upb_Array* arr);
2682 
2683 // Mark an array and all of its descendents as frozen/immutable.
2684 // If the array elements are messages then |m| must point to the minitable for
2685 // those messages. Otherwise |m| must be NULL.
2686 UPB_API void upb_Array_Freeze(upb_Array* arr, const upb_MiniTable* m);
2687 
2688 // Returns whether an array has been frozen.
2689 UPB_API_INLINE bool upb_Array_IsFrozen(const upb_Array* arr);
2690 
2691 #ifdef __cplusplus
2692 } /* extern "C" */
2693 #endif
2694 
2695 
2696 #endif /* UPB_MESSAGE_ARRAY_H_ */
2697 
2698 #ifndef UPB_MESSAGE_INTERNAL_ACCESSORS_H_
2699 #define UPB_MESSAGE_INTERNAL_ACCESSORS_H_
2700 
2701 #include <stddef.h>
2702 #include <stdint.h>
2703 #include <string.h>
2704 
2705 
2706 #ifndef UPB_BASE_INTERNAL_ENDIAN_H_
2707 #define UPB_BASE_INTERNAL_ENDIAN_H_
2708 
2709 #include <stdint.h>
2710 
2711 // Must be last.
2712 
2713 #ifdef __cplusplus
2714 extern "C" {
2715 #endif
2716 
upb_IsLittleEndian(void)2717 UPB_INLINE bool upb_IsLittleEndian(void) {
2718   const int x = 1;
2719   return *(char*)&x == 1;
2720 }
2721 
upb_BigEndian32(uint32_t val)2722 UPB_INLINE uint32_t upb_BigEndian32(uint32_t val) {
2723   if (upb_IsLittleEndian()) return val;
2724 
2725   return ((val & 0xff) << 24) | ((val & 0xff00) << 8) |
2726          ((val & 0xff0000) >> 8) | ((val & 0xff000000) >> 24);
2727 }
2728 
upb_BigEndian64(uint64_t val)2729 UPB_INLINE uint64_t upb_BigEndian64(uint64_t val) {
2730   if (upb_IsLittleEndian()) return val;
2731 
2732   const uint64_t hi = ((uint64_t)upb_BigEndian32((uint32_t)val)) << 32;
2733   const uint64_t lo = upb_BigEndian32((uint32_t)(val >> 32));
2734   return hi | lo;
2735 }
2736 
2737 #ifdef __cplusplus
2738 } /* extern "C" */
2739 #endif
2740 
2741 
2742 #endif /* UPB_BASE_INTERNAL_ENDIAN_H_ */
2743 
2744 #ifndef UPB_MESSAGE_INTERNAL_MAP_H_
2745 #define UPB_MESSAGE_INTERNAL_MAP_H_
2746 
2747 #include <stddef.h>
2748 #include <string.h>
2749 
2750 
2751 #ifndef UPB_HASH_STR_TABLE_H_
2752 #define UPB_HASH_STR_TABLE_H_
2753 
2754 
2755 /*
2756  * upb_table
2757  *
2758  * This header is INTERNAL-ONLY!  Its interfaces are not public or stable!
2759  * This file defines very fast int->upb_value (inttable) and string->upb_value
2760  * (strtable) hash tables.
2761  *
2762  * The table uses chained scatter with Brent's variation (inspired by the Lua
2763  * implementation of hash tables).  The hash function for strings is Austin
2764  * Appleby's "MurmurHash."
2765  *
2766  * The inttable uses uintptr_t as its key, which guarantees it can be used to
2767  * store pointers or integers of at least 32 bits (upb isn't really useful on
2768  * systems where sizeof(void*) < 4).
2769  *
2770  * The table must be homogeneous (all values of the same type).  In debug
2771  * mode, we check this on insert and lookup.
2772  */
2773 
2774 #ifndef UPB_HASH_COMMON_H_
2775 #define UPB_HASH_COMMON_H_
2776 
2777 #include <string.h>
2778 
2779 
2780 // Must be last.
2781 
2782 #ifdef __cplusplus
2783 extern "C" {
2784 #endif
2785 
2786 /* upb_value ******************************************************************/
2787 
2788 typedef struct {
2789   uint64_t val;
2790 } upb_value;
2791 
_upb_value_setval(upb_value * v,uint64_t val)2792 UPB_INLINE void _upb_value_setval(upb_value* v, uint64_t val) { v->val = val; }
2793 
2794 /* For each value ctype, define the following set of functions:
2795  *
2796  * // Get/set an int32 from a upb_value.
2797  * int32_t upb_value_getint32(upb_value val);
2798  * void upb_value_setint32(upb_value *val, int32_t cval);
2799  *
2800  * // Construct a new upb_value from an int32.
2801  * upb_value upb_value_int32(int32_t val); */
2802 #define FUNCS(name, membername, type_t, converter)                   \
2803   UPB_INLINE void upb_value_set##name(upb_value* val, type_t cval) { \
2804     val->val = (converter)cval;                                      \
2805   }                                                                  \
2806   UPB_INLINE upb_value upb_value_##name(type_t val) {                \
2807     upb_value ret;                                                   \
2808     upb_value_set##name(&ret, val);                                  \
2809     return ret;                                                      \
2810   }                                                                  \
2811   UPB_INLINE type_t upb_value_get##name(upb_value val) {             \
2812     return (type_t)(converter)val.val;                               \
2813   }
2814 
FUNCS(int32,int32,int32_t,int32_t)2815 FUNCS(int32, int32, int32_t, int32_t)
2816 FUNCS(int64, int64, int64_t, int64_t)
2817 FUNCS(uint32, uint32, uint32_t, uint32_t)
2818 FUNCS(uint64, uint64, uint64_t, uint64_t)
2819 FUNCS(bool, _bool, bool, bool)
2820 FUNCS(cstr, cstr, char*, uintptr_t)
2821 FUNCS(uintptr, uptr, uintptr_t, uintptr_t)
2822 FUNCS(ptr, ptr, void*, uintptr_t)
2823 FUNCS(constptr, constptr, const void*, uintptr_t)
2824 
2825 #undef FUNCS
2826 
2827 UPB_INLINE void upb_value_setfloat(upb_value* val, float cval) {
2828   memcpy(&val->val, &cval, sizeof(cval));
2829 }
2830 
upb_value_setdouble(upb_value * val,double cval)2831 UPB_INLINE void upb_value_setdouble(upb_value* val, double cval) {
2832   memcpy(&val->val, &cval, sizeof(cval));
2833 }
2834 
upb_value_float(float cval)2835 UPB_INLINE upb_value upb_value_float(float cval) {
2836   upb_value ret;
2837   upb_value_setfloat(&ret, cval);
2838   return ret;
2839 }
2840 
upb_value_double(double cval)2841 UPB_INLINE upb_value upb_value_double(double cval) {
2842   upb_value ret;
2843   upb_value_setdouble(&ret, cval);
2844   return ret;
2845 }
2846 
2847 /* upb_tabkey *****************************************************************/
2848 
2849 /* Either:
2850  *   1. an actual integer key, or
2851  *   2. a pointer to a string prefixed by its uint32_t length, owned by us.
2852  *
2853  * ...depending on whether this is a string table or an int table.  We would
2854  * make this a union of those two types, but C89 doesn't support statically
2855  * initializing a non-first union member. */
2856 typedef uintptr_t upb_tabkey;
2857 
upb_tabstr(upb_tabkey key,uint32_t * len)2858 UPB_INLINE char* upb_tabstr(upb_tabkey key, uint32_t* len) {
2859   char* mem = (char*)key;
2860   if (len) memcpy(len, mem, sizeof(*len));
2861   return mem + sizeof(*len);
2862 }
2863 
upb_tabstrview(upb_tabkey key)2864 UPB_INLINE upb_StringView upb_tabstrview(upb_tabkey key) {
2865   upb_StringView ret;
2866   uint32_t len;
2867   ret.data = upb_tabstr(key, &len);
2868   ret.size = len;
2869   return ret;
2870 }
2871 
2872 /* upb_tabval *****************************************************************/
2873 
2874 typedef struct upb_tabval {
2875   uint64_t val;
2876 } upb_tabval;
2877 
2878 #define UPB_TABVALUE_EMPTY_INIT \
2879   { -1 }
2880 
2881 /* upb_table ******************************************************************/
2882 
2883 typedef struct _upb_tabent {
2884   upb_tabkey key;
2885   upb_tabval val;
2886 
2887   /* Internal chaining.  This is const so we can create static initializers for
2888    * tables.  We cast away const sometimes, but *only* when the containing
2889    * upb_table is known to be non-const.  This requires a bit of care, but
2890    * the subtlety is confined to table.c. */
2891   const struct _upb_tabent* next;
2892 } upb_tabent;
2893 
2894 typedef struct {
2895   size_t count;       /* Number of entries in the hash part. */
2896   uint32_t mask;      /* Mask to turn hash value -> bucket. */
2897   uint32_t max_count; /* Max count before we hit our load limit. */
2898   uint8_t size_lg2;   /* Size of the hashtable part is 2^size_lg2 entries. */
2899   upb_tabent* entries;
2900 } upb_table;
2901 
upb_table_size(const upb_table * t)2902 UPB_INLINE size_t upb_table_size(const upb_table* t) {
2903   return t->size_lg2 ? 1 << t->size_lg2 : 0;
2904 }
2905 
2906 // Internal-only functions, in .h file only out of necessity.
2907 
upb_tabent_isempty(const upb_tabent * e)2908 UPB_INLINE bool upb_tabent_isempty(const upb_tabent* e) { return e->key == 0; }
2909 
2910 uint32_t _upb_Hash(const void* p, size_t n, uint64_t seed);
2911 
2912 #ifdef __cplusplus
2913 } /* extern "C" */
2914 #endif
2915 
2916 
2917 #endif /* UPB_HASH_COMMON_H_ */
2918 
2919 // Must be last.
2920 
2921 typedef struct {
2922   upb_table t;
2923 } upb_strtable;
2924 
2925 #ifdef __cplusplus
2926 extern "C" {
2927 #endif
2928 
2929 // Initialize a table. If memory allocation failed, false is returned and
2930 // the table is uninitialized.
2931 bool upb_strtable_init(upb_strtable* table, size_t expected_size, upb_Arena* a);
2932 
2933 // Returns the number of values in the table.
upb_strtable_count(const upb_strtable * t)2934 UPB_INLINE size_t upb_strtable_count(const upb_strtable* t) {
2935   return t->t.count;
2936 }
2937 
2938 void upb_strtable_clear(upb_strtable* t);
2939 
2940 // Inserts the given key into the hashtable with the given value.
2941 // The key must not already exist in the hash table. The key is not required
2942 // to be NULL-terminated, and the table will make an internal copy of the key.
2943 //
2944 // If a table resize was required but memory allocation failed, false is
2945 // returned and the table is unchanged. */
2946 bool upb_strtable_insert(upb_strtable* t, const char* key, size_t len,
2947                          upb_value val, upb_Arena* a);
2948 
2949 // Looks up key in this table, returning "true" if the key was found.
2950 // If v is non-NULL, copies the value for this key into *v.
2951 bool upb_strtable_lookup2(const upb_strtable* t, const char* key, size_t len,
2952                           upb_value* v);
2953 
2954 // For NULL-terminated strings.
upb_strtable_lookup(const upb_strtable * t,const char * key,upb_value * v)2955 UPB_INLINE bool upb_strtable_lookup(const upb_strtable* t, const char* key,
2956                                     upb_value* v) {
2957   return upb_strtable_lookup2(t, key, strlen(key), v);
2958 }
2959 
2960 // Removes an item from the table. Returns true if the remove was successful,
2961 // and stores the removed item in *val if non-NULL.
2962 bool upb_strtable_remove2(upb_strtable* t, const char* key, size_t len,
2963                           upb_value* val);
2964 
upb_strtable_remove(upb_strtable * t,const char * key,upb_value * v)2965 UPB_INLINE bool upb_strtable_remove(upb_strtable* t, const char* key,
2966                                     upb_value* v) {
2967   return upb_strtable_remove2(t, key, strlen(key), v);
2968 }
2969 
2970 // Exposed for testing only.
2971 bool upb_strtable_resize(upb_strtable* t, size_t size_lg2, upb_Arena* a);
2972 
2973 /* Iteration over strtable:
2974  *
2975  *   intptr_t iter = UPB_STRTABLE_BEGIN;
2976  *   upb_StringView key;
2977  *   upb_value val;
2978  *   while (upb_strtable_next2(t, &key, &val, &iter)) {
2979  *      // ...
2980  *   }
2981  */
2982 
2983 #define UPB_STRTABLE_BEGIN -1
2984 
2985 bool upb_strtable_next2(const upb_strtable* t, upb_StringView* key,
2986                         upb_value* val, intptr_t* iter);
2987 void upb_strtable_removeiter(upb_strtable* t, intptr_t* iter);
2988 void upb_strtable_setentryvalue(upb_strtable* t, intptr_t iter, upb_value v);
2989 
2990 /* DEPRECATED iterators, slated for removal.
2991  *
2992  * Iterators for string tables.  We are subject to some kind of unusual
2993  * design constraints:
2994  *
2995  * For high-level languages:
2996  *  - we must be able to guarantee that we don't crash or corrupt memory even if
2997  *    the program accesses an invalidated iterator.
2998  *
2999  * For C++11 range-based for:
3000  *  - iterators must be copyable
3001  *  - iterators must be comparable
3002  *  - it must be possible to construct an "end" value.
3003  *
3004  * Iteration order is undefined.
3005  *
3006  * Modifying the table invalidates iterators.  upb_{str,int}table_done() is
3007  * guaranteed to work even on an invalidated iterator, as long as the table it
3008  * is iterating over has not been freed.  Calling next() or accessing data from
3009  * an invalidated iterator yields unspecified elements from the table, but it is
3010  * guaranteed not to crash and to return real table elements (except when done()
3011  * is true). */
3012 /* upb_strtable_iter **********************************************************/
3013 
3014 /*   upb_strtable_iter i;
3015  *   upb_strtable_begin(&i, t);
3016  *   for(; !upb_strtable_done(&i); upb_strtable_next(&i)) {
3017  *     const char *key = upb_strtable_iter_key(&i);
3018  *     const upb_value val = upb_strtable_iter_value(&i);
3019  *     // ...
3020  *   }
3021  */
3022 
3023 typedef struct {
3024   const upb_strtable* t;
3025   size_t index;
3026 } upb_strtable_iter;
3027 
str_tabent(const upb_strtable_iter * i)3028 UPB_INLINE const upb_tabent* str_tabent(const upb_strtable_iter* i) {
3029   return &i->t->t.entries[i->index];
3030 }
3031 
3032 void upb_strtable_begin(upb_strtable_iter* i, const upb_strtable* t);
3033 void upb_strtable_next(upb_strtable_iter* i);
3034 bool upb_strtable_done(const upb_strtable_iter* i);
3035 upb_StringView upb_strtable_iter_key(const upb_strtable_iter* i);
3036 upb_value upb_strtable_iter_value(const upb_strtable_iter* i);
3037 void upb_strtable_iter_setdone(upb_strtable_iter* i);
3038 bool upb_strtable_iter_isequal(const upb_strtable_iter* i1,
3039                                const upb_strtable_iter* i2);
3040 
3041 #ifdef __cplusplus
3042 } /* extern "C" */
3043 #endif
3044 
3045 
3046 #endif /* UPB_HASH_STR_TABLE_H_ */
3047 
3048 // Must be last.
3049 
3050 typedef enum {
3051   kUpb_MapInsertStatus_Inserted = 0,
3052   kUpb_MapInsertStatus_Replaced = 1,
3053   kUpb_MapInsertStatus_OutOfMemory = 2,
3054 } upb_MapInsertStatus;
3055 
3056 // EVERYTHING BELOW THIS LINE IS INTERNAL - DO NOT USE /////////////////////////
3057 
3058 struct upb_Map {
3059   // Size of key and val, based on the map type.
3060   // Strings are represented as '0' because they must be handled specially.
3061   char key_size;
3062   char val_size;
3063   bool UPB_PRIVATE(is_frozen);
3064 
3065   upb_strtable table;
3066 };
3067 
3068 #ifdef __cplusplus
3069 extern "C" {
3070 #endif
3071 
UPB_PRIVATE(_upb_Map_ShallowFreeze)3072 UPB_INLINE void UPB_PRIVATE(_upb_Map_ShallowFreeze)(struct upb_Map* map) {
3073   map->UPB_PRIVATE(is_frozen) = true;
3074 }
3075 
upb_Map_IsFrozen(const struct upb_Map * map)3076 UPB_API_INLINE bool upb_Map_IsFrozen(const struct upb_Map* map) {
3077   return map->UPB_PRIVATE(is_frozen);
3078 }
3079 
3080 // Converting between internal table representation and user values.
3081 //
3082 // _upb_map_tokey() and _upb_map_fromkey() are inverses.
3083 // _upb_map_tovalue() and _upb_map_fromvalue() are inverses.
3084 //
3085 // These functions account for the fact that strings are treated differently
3086 // from other types when stored in a map.
3087 
_upb_map_tokey(const void * key,size_t size)3088 UPB_INLINE upb_StringView _upb_map_tokey(const void* key, size_t size) {
3089   if (size == UPB_MAPTYPE_STRING) {
3090     return *(upb_StringView*)key;
3091   } else {
3092     return upb_StringView_FromDataAndSize((const char*)key, size);
3093   }
3094 }
3095 
_upb_map_fromkey(upb_StringView key,void * out,size_t size)3096 UPB_INLINE void _upb_map_fromkey(upb_StringView key, void* out, size_t size) {
3097   if (size == UPB_MAPTYPE_STRING) {
3098     memcpy(out, &key, sizeof(key));
3099   } else {
3100     memcpy(out, key.data, size);
3101   }
3102 }
3103 
_upb_map_tovalue(const void * val,size_t size,upb_value * msgval,upb_Arena * a)3104 UPB_INLINE bool _upb_map_tovalue(const void* val, size_t size,
3105                                  upb_value* msgval, upb_Arena* a) {
3106   if (size == UPB_MAPTYPE_STRING) {
3107     upb_StringView* strp = (upb_StringView*)upb_Arena_Malloc(a, sizeof(*strp));
3108     if (!strp) return false;
3109     *strp = *(upb_StringView*)val;
3110     *msgval = upb_value_ptr(strp);
3111   } else {
3112     memcpy(msgval, val, size);
3113   }
3114   return true;
3115 }
3116 
_upb_map_fromvalue(upb_value val,void * out,size_t size)3117 UPB_INLINE void _upb_map_fromvalue(upb_value val, void* out, size_t size) {
3118   if (size == UPB_MAPTYPE_STRING) {
3119     const upb_StringView* strp = (const upb_StringView*)upb_value_getptr(val);
3120     memcpy(out, strp, sizeof(upb_StringView));
3121   } else {
3122     memcpy(out, &val, size);
3123   }
3124 }
3125 
_upb_map_next(const struct upb_Map * map,size_t * iter)3126 UPB_INLINE void* _upb_map_next(const struct upb_Map* map, size_t* iter) {
3127   upb_strtable_iter it;
3128   it.t = &map->table;
3129   it.index = *iter;
3130   upb_strtable_next(&it);
3131   *iter = it.index;
3132   if (upb_strtable_done(&it)) return NULL;
3133   return (void*)str_tabent(&it);
3134 }
3135 
_upb_Map_Clear(struct upb_Map * map)3136 UPB_INLINE void _upb_Map_Clear(struct upb_Map* map) {
3137   UPB_ASSERT(!upb_Map_IsFrozen(map));
3138 
3139   upb_strtable_clear(&map->table);
3140 }
3141 
_upb_Map_Delete(struct upb_Map * map,const void * key,size_t key_size,upb_value * val)3142 UPB_INLINE bool _upb_Map_Delete(struct upb_Map* map, const void* key,
3143                                 size_t key_size, upb_value* val) {
3144   UPB_ASSERT(!upb_Map_IsFrozen(map));
3145 
3146   upb_StringView k = _upb_map_tokey(key, key_size);
3147   return upb_strtable_remove2(&map->table, k.data, k.size, val);
3148 }
3149 
_upb_Map_Get(const struct upb_Map * map,const void * key,size_t key_size,void * val,size_t val_size)3150 UPB_INLINE bool _upb_Map_Get(const struct upb_Map* map, const void* key,
3151                              size_t key_size, void* val, size_t val_size) {
3152   upb_value tabval;
3153   upb_StringView k = _upb_map_tokey(key, key_size);
3154   bool ret = upb_strtable_lookup2(&map->table, k.data, k.size, &tabval);
3155   if (ret && val) {
3156     _upb_map_fromvalue(tabval, val, val_size);
3157   }
3158   return ret;
3159 }
3160 
_upb_Map_Insert(struct upb_Map * map,const void * key,size_t key_size,void * val,size_t val_size,upb_Arena * a)3161 UPB_INLINE upb_MapInsertStatus _upb_Map_Insert(struct upb_Map* map,
3162                                                const void* key, size_t key_size,
3163                                                void* val, size_t val_size,
3164                                                upb_Arena* a) {
3165   UPB_ASSERT(!upb_Map_IsFrozen(map));
3166 
3167   upb_StringView strkey = _upb_map_tokey(key, key_size);
3168   upb_value tabval = {0};
3169   if (!_upb_map_tovalue(val, val_size, &tabval, a)) {
3170     return kUpb_MapInsertStatus_OutOfMemory;
3171   }
3172 
3173   // TODO: add overwrite operation to minimize number of lookups.
3174   bool removed =
3175       upb_strtable_remove2(&map->table, strkey.data, strkey.size, NULL);
3176   if (!upb_strtable_insert(&map->table, strkey.data, strkey.size, tabval, a)) {
3177     return kUpb_MapInsertStatus_OutOfMemory;
3178   }
3179   return removed ? kUpb_MapInsertStatus_Replaced
3180                  : kUpb_MapInsertStatus_Inserted;
3181 }
3182 
_upb_Map_Size(const struct upb_Map * map)3183 UPB_INLINE size_t _upb_Map_Size(const struct upb_Map* map) {
3184   return map->table.t.count;
3185 }
3186 
3187 // Strings/bytes are special-cased in maps.
3188 extern char _upb_Map_CTypeSizeTable[12];
3189 
_upb_Map_CTypeSize(upb_CType ctype)3190 UPB_INLINE size_t _upb_Map_CTypeSize(upb_CType ctype) {
3191   return _upb_Map_CTypeSizeTable[ctype];
3192 }
3193 
3194 // Creates a new map on the given arena with this key/value type.
3195 struct upb_Map* _upb_Map_New(upb_Arena* a, size_t key_size, size_t value_size);
3196 
3197 #ifdef __cplusplus
3198 } /* extern "C" */
3199 #endif
3200 
3201 
3202 #endif /* UPB_MESSAGE_INTERNAL_MAP_H_ */
3203 
3204 #ifndef UPB_MINI_TABLE_INTERNAL_TAGGED_PTR_H_
3205 #define UPB_MINI_TABLE_INTERNAL_TAGGED_PTR_H_
3206 
3207 #include <stdint.h>
3208 
3209 
3210 // Must be last.
3211 
3212 #ifdef __cplusplus
3213 extern "C" {
3214 #endif
3215 
3216 // Internal-only because empty messages cannot be created by the user.
3217 UPB_INLINE uintptr_t
UPB_PRIVATE(_upb_TaggedMessagePtr_Pack)3218 UPB_PRIVATE(_upb_TaggedMessagePtr_Pack)(struct upb_Message* ptr, bool empty) {
3219   UPB_ASSERT(((uintptr_t)ptr & 1) == 0);
3220   return (uintptr_t)ptr | (empty ? 1 : 0);
3221 }
3222 
upb_TaggedMessagePtr_IsEmpty(uintptr_t ptr)3223 UPB_API_INLINE bool upb_TaggedMessagePtr_IsEmpty(uintptr_t ptr) {
3224   return ptr & 1;
3225 }
3226 
UPB_PRIVATE(_upb_TaggedMessagePtr_GetMessage)3227 UPB_INLINE struct upb_Message* UPB_PRIVATE(_upb_TaggedMessagePtr_GetMessage)(
3228     uintptr_t ptr) {
3229   return (struct upb_Message*)(ptr & ~(uintptr_t)1);
3230 }
3231 
upb_TaggedMessagePtr_GetNonEmptyMessage(uintptr_t ptr)3232 UPB_API_INLINE struct upb_Message* upb_TaggedMessagePtr_GetNonEmptyMessage(
3233     uintptr_t ptr) {
3234   UPB_ASSERT(!upb_TaggedMessagePtr_IsEmpty(ptr));
3235   return UPB_PRIVATE(_upb_TaggedMessagePtr_GetMessage)(ptr);
3236 }
3237 
UPB_PRIVATE(_upb_TaggedMessagePtr_GetEmptyMessage)3238 UPB_INLINE struct upb_Message* UPB_PRIVATE(
3239     _upb_TaggedMessagePtr_GetEmptyMessage)(uintptr_t ptr) {
3240   UPB_ASSERT(upb_TaggedMessagePtr_IsEmpty(ptr));
3241   return UPB_PRIVATE(_upb_TaggedMessagePtr_GetMessage)(ptr);
3242 }
3243 
3244 #ifdef __cplusplus
3245 } /* extern "C" */
3246 #endif
3247 
3248 
3249 #endif /* UPB_MINI_TABLE_INTERNAL_TAGGED_PTR_H_ */
3250 
3251 // Must be last.
3252 
3253 #if defined(__GNUC__) && !defined(__clang__)
3254 // GCC raises incorrect warnings in these functions.  It thinks that we are
3255 // overrunning buffers, but we carefully write the functions in this file to
3256 // guarantee that this is impossible.  GCC gets this wrong due it its failure
3257 // to perform constant propagation as we expect:
3258 //   - https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108217
3259 //   - https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108226
3260 //
3261 // Unfortunately this also indicates that GCC is not optimizing away the
3262 // switch() in cases where it should be, compromising the performance.
3263 #pragma GCC diagnostic push
3264 #pragma GCC diagnostic ignored "-Warray-bounds"
3265 #pragma GCC diagnostic ignored "-Wstringop-overflow"
3266 #if __GNUC__ >= 11
3267 #pragma GCC diagnostic ignored "-Wstringop-overread"
3268 #endif
3269 #endif
3270 
3271 #ifdef __cplusplus
3272 extern "C" {
3273 #endif
3274 
3275 // LINT.IfChange(presence_logic)
3276 
3277 // Hasbit access ///////////////////////////////////////////////////////////////
3278 
UPB_PRIVATE(_upb_Message_GetHasbit)3279 UPB_INLINE bool UPB_PRIVATE(_upb_Message_GetHasbit)(
3280     const struct upb_Message* msg, const upb_MiniTableField* f) {
3281   const size_t offset = UPB_PRIVATE(_upb_MiniTableField_HasbitOffset)(f);
3282   const char mask = UPB_PRIVATE(_upb_MiniTableField_HasbitMask)(f);
3283 
3284   return (*UPB_PTR_AT(msg, offset, const char) & mask) != 0;
3285 }
3286 
UPB_PRIVATE(_upb_Message_SetHasbit)3287 UPB_INLINE void UPB_PRIVATE(_upb_Message_SetHasbit)(
3288     const struct upb_Message* msg, const upb_MiniTableField* f) {
3289   const size_t offset = UPB_PRIVATE(_upb_MiniTableField_HasbitOffset)(f);
3290   const char mask = UPB_PRIVATE(_upb_MiniTableField_HasbitMask)(f);
3291 
3292   (*UPB_PTR_AT(msg, offset, char)) |= mask;
3293 }
3294 
UPB_PRIVATE(_upb_Message_ClearHasbit)3295 UPB_INLINE void UPB_PRIVATE(_upb_Message_ClearHasbit)(
3296     const struct upb_Message* msg, const upb_MiniTableField* f) {
3297   const size_t offset = UPB_PRIVATE(_upb_MiniTableField_HasbitOffset)(f);
3298   const char mask = UPB_PRIVATE(_upb_MiniTableField_HasbitMask)(f);
3299 
3300   (*UPB_PTR_AT(msg, offset, char)) &= ~mask;
3301 }
3302 
3303 // Oneof case access ///////////////////////////////////////////////////////////
3304 
UPB_PRIVATE(_upb_Message_OneofCasePtr)3305 UPB_INLINE uint32_t* UPB_PRIVATE(_upb_Message_OneofCasePtr)(
3306     struct upb_Message* msg, const upb_MiniTableField* f) {
3307   return UPB_PTR_AT(msg, UPB_PRIVATE(_upb_MiniTableField_OneofOffset)(f),
3308                     uint32_t);
3309 }
3310 
UPB_PRIVATE(_upb_Message_GetOneofCase)3311 UPB_INLINE uint32_t UPB_PRIVATE(_upb_Message_GetOneofCase)(
3312     const struct upb_Message* msg, const upb_MiniTableField* f) {
3313   const uint32_t* ptr =
3314       UPB_PRIVATE(_upb_Message_OneofCasePtr)((struct upb_Message*)msg, f);
3315 
3316   return *ptr;
3317 }
3318 
UPB_PRIVATE(_upb_Message_SetOneofCase)3319 UPB_INLINE void UPB_PRIVATE(_upb_Message_SetOneofCase)(
3320     struct upb_Message* msg, const upb_MiniTableField* f) {
3321   uint32_t* ptr = UPB_PRIVATE(_upb_Message_OneofCasePtr)(msg, f);
3322 
3323   *ptr = upb_MiniTableField_Number(f);
3324 }
3325 
3326 // Returns true if the given field is the current oneof case.
3327 // Does nothing if it is not the current oneof case.
UPB_PRIVATE(_upb_Message_ClearOneofCase)3328 UPB_INLINE bool UPB_PRIVATE(_upb_Message_ClearOneofCase)(
3329     struct upb_Message* msg, const upb_MiniTableField* f) {
3330   uint32_t* ptr = UPB_PRIVATE(_upb_Message_OneofCasePtr)(msg, f);
3331 
3332   if (*ptr != upb_MiniTableField_Number(f)) return false;
3333   *ptr = 0;
3334   return true;
3335 }
3336 
upb_Message_WhichOneofFieldNumber(const struct upb_Message * message,const upb_MiniTableField * oneof_field)3337 UPB_API_INLINE uint32_t upb_Message_WhichOneofFieldNumber(
3338     const struct upb_Message* message, const upb_MiniTableField* oneof_field) {
3339   UPB_ASSUME(upb_MiniTableField_IsInOneof(oneof_field));
3340   return UPB_PRIVATE(_upb_Message_GetOneofCase)(message, oneof_field);
3341 }
3342 
upb_Message_WhichOneof(const struct upb_Message * msg,const upb_MiniTable * m,const upb_MiniTableField * f)3343 UPB_API_INLINE const upb_MiniTableField* upb_Message_WhichOneof(
3344     const struct upb_Message* msg, const upb_MiniTable* m,
3345     const upb_MiniTableField* f) {
3346   uint32_t field_number = upb_Message_WhichOneofFieldNumber(msg, f);
3347   if (field_number == 0) {
3348     // No field in the oneof is set.
3349     return NULL;
3350   }
3351   return upb_MiniTable_FindFieldByNumber(m, field_number);
3352 }
3353 
3354 // LINT.ThenChange(GoogleInternalName2)
3355 
3356 // Returns false if the message is missing any of its required fields.
UPB_PRIVATE(_upb_Message_IsInitializedShallow)3357 UPB_INLINE bool UPB_PRIVATE(_upb_Message_IsInitializedShallow)(
3358     const struct upb_Message* msg, const upb_MiniTable* m) {
3359   uint64_t bits;
3360   memcpy(&bits, msg + 1, sizeof(bits));
3361   bits = upb_BigEndian64(bits);
3362   return (UPB_PRIVATE(_upb_MiniTable_RequiredMask)(m) & ~bits) == 0;
3363 }
3364 
UPB_PRIVATE(_upb_Message_MutableDataPtr)3365 UPB_INLINE void* UPB_PRIVATE(_upb_Message_MutableDataPtr)(
3366     struct upb_Message* msg, const upb_MiniTableField* f) {
3367   return (char*)msg + f->UPB_ONLYBITS(offset);
3368 }
3369 
UPB_PRIVATE(_upb_Message_DataPtr)3370 UPB_INLINE const void* UPB_PRIVATE(_upb_Message_DataPtr)(
3371     const struct upb_Message* msg, const upb_MiniTableField* f) {
3372   return (const char*)msg + f->UPB_ONLYBITS(offset);
3373 }
3374 
UPB_PRIVATE(_upb_Message_SetPresence)3375 UPB_INLINE void UPB_PRIVATE(_upb_Message_SetPresence)(
3376     struct upb_Message* msg, const upb_MiniTableField* f) {
3377   if (UPB_PRIVATE(_upb_MiniTableField_HasHasbit)(f)) {
3378     UPB_PRIVATE(_upb_Message_SetHasbit)(msg, f);
3379   } else if (upb_MiniTableField_IsInOneof(f)) {
3380     UPB_PRIVATE(_upb_Message_SetOneofCase)(msg, f);
3381   }
3382 }
3383 
UPB_PRIVATE(_upb_MiniTableField_DataCopy)3384 UPB_INLINE void UPB_PRIVATE(_upb_MiniTableField_DataCopy)(
3385     const upb_MiniTableField* f, void* to, const void* from) {
3386   switch (UPB_PRIVATE(_upb_MiniTableField_GetRep)(f)) {
3387     case kUpb_FieldRep_1Byte:
3388       memcpy(to, from, 1);
3389       return;
3390     case kUpb_FieldRep_4Byte:
3391       memcpy(to, from, 4);
3392       return;
3393     case kUpb_FieldRep_8Byte:
3394       memcpy(to, from, 8);
3395       return;
3396     case kUpb_FieldRep_StringView: {
3397       memcpy(to, from, sizeof(upb_StringView));
3398       return;
3399     }
3400   }
3401   UPB_UNREACHABLE();
3402 }
3403 
UPB_PRIVATE(_upb_MiniTableField_DataEquals)3404 UPB_INLINE bool UPB_PRIVATE(_upb_MiniTableField_DataEquals)(
3405     const upb_MiniTableField* f, const void* a, const void* b) {
3406   switch (UPB_PRIVATE(_upb_MiniTableField_GetRep)(f)) {
3407     case kUpb_FieldRep_1Byte:
3408       return memcmp(a, b, 1) == 0;
3409     case kUpb_FieldRep_4Byte:
3410       return memcmp(a, b, 4) == 0;
3411     case kUpb_FieldRep_8Byte:
3412       return memcmp(a, b, 8) == 0;
3413     case kUpb_FieldRep_StringView: {
3414       const upb_StringView sa = *(const upb_StringView*)a;
3415       const upb_StringView sb = *(const upb_StringView*)b;
3416       return upb_StringView_IsEqual(sa, sb);
3417     }
3418   }
3419   UPB_UNREACHABLE();
3420 }
3421 
UPB_PRIVATE(_upb_MiniTableField_DataClear)3422 UPB_INLINE void UPB_PRIVATE(_upb_MiniTableField_DataClear)(
3423     const upb_MiniTableField* f, void* val) {
3424   const char zero[16] = {0};
3425   UPB_PRIVATE(_upb_MiniTableField_DataCopy)(f, val, zero);
3426 }
3427 
UPB_PRIVATE(_upb_MiniTableField_DataIsZero)3428 UPB_INLINE bool UPB_PRIVATE(_upb_MiniTableField_DataIsZero)(
3429     const upb_MiniTableField* f, const void* val) {
3430   const char zero[16] = {0};
3431   return UPB_PRIVATE(_upb_MiniTableField_DataEquals)(f, val, zero);
3432 }
3433 
3434 // Here we define universal getter/setter functions for message fields.
3435 // These look very branchy and inefficient, but as long as the MiniTableField
3436 // values are known at compile time, all the branches are optimized away and
3437 // we are left with ideal code.  This can happen either through through
3438 // literals or UPB_ASSUME():
3439 //
3440 //   // Via struct literals.
3441 //   bool FooMessage_set_bool_field(const upb_Message* msg, bool val) {
3442 //     const upb_MiniTableField field = {1, 0, 0, /* etc... */};
3443 //     // All value in "field" are compile-time known.
3444 //     upb_Message_SetBaseField(msg, &field, &value);
3445 //   }
3446 //
3447 //   // Via UPB_ASSUME().
3448 //   UPB_INLINE bool upb_Message_SetBool(upb_Message* msg,
3449 //                                       const upb_MiniTableField* field,
3450 //                                       bool value, upb_Arena* a) {
3451 //     UPB_ASSUME(field->UPB_PRIVATE(descriptortype) == kUpb_FieldType_Bool);
3452 //     UPB_ASSUME(UPB_PRIVATE(_upb_MiniTableField_GetRep)(field) ==
3453 //                kUpb_FieldRep_1Byte);
3454 //     upb_Message_SetField(msg, field, &value, a);
3455 //   }
3456 //
3457 // As a result, we can use these universal getters/setters for *all* message
3458 // accessors: generated code, MiniTable accessors, and reflection.  The only
3459 // exception is the binary encoder/decoder, which need to be a bit more clever
3460 // about how they read/write the message data, for efficiency.
3461 //
3462 // These functions work on both extensions and non-extensions. If the field
3463 // of a setter is known to be a non-extension, the arena may be NULL and the
3464 // returned bool value may be ignored since it will always succeed.
3465 
upb_Message_HasBaseField(const struct upb_Message * msg,const upb_MiniTableField * field)3466 UPB_API_INLINE bool upb_Message_HasBaseField(const struct upb_Message* msg,
3467                                              const upb_MiniTableField* field) {
3468   UPB_ASSERT(upb_MiniTableField_HasPresence(field));
3469   UPB_ASSUME(!upb_MiniTableField_IsExtension(field));
3470   if (upb_MiniTableField_IsInOneof(field)) {
3471     return UPB_PRIVATE(_upb_Message_GetOneofCase)(msg, field) ==
3472            upb_MiniTableField_Number(field);
3473   } else {
3474     return UPB_PRIVATE(_upb_Message_GetHasbit)(msg, field);
3475   }
3476 }
3477 
upb_Message_HasExtension(const struct upb_Message * msg,const upb_MiniTableExtension * e)3478 UPB_API_INLINE bool upb_Message_HasExtension(const struct upb_Message* msg,
3479                                              const upb_MiniTableExtension* e) {
3480   UPB_ASSERT(upb_MiniTableField_HasPresence(&e->UPB_PRIVATE(field)));
3481   return UPB_PRIVATE(_upb_Message_Getext)(msg, e) != NULL;
3482 }
3483 
_upb_Message_GetNonExtensionField(const struct upb_Message * msg,const upb_MiniTableField * field,const void * default_val,void * val)3484 UPB_FORCEINLINE void _upb_Message_GetNonExtensionField(
3485     const struct upb_Message* msg, const upb_MiniTableField* field,
3486     const void* default_val, void* val) {
3487   UPB_ASSUME(!upb_MiniTableField_IsExtension(field));
3488   if ((upb_MiniTableField_IsInOneof(field) ||
3489        !UPB_PRIVATE(_upb_MiniTableField_DataIsZero)(field, default_val)) &&
3490       !upb_Message_HasBaseField(msg, field)) {
3491     UPB_PRIVATE(_upb_MiniTableField_DataCopy)(field, val, default_val);
3492     return;
3493   }
3494   UPB_PRIVATE(_upb_MiniTableField_DataCopy)
3495   (field, val, UPB_PRIVATE(_upb_Message_DataPtr)(msg, field));
3496 }
3497 
_upb_Message_GetExtensionField(const struct upb_Message * msg,const upb_MiniTableExtension * mt_ext,const void * default_val,void * val)3498 UPB_INLINE void _upb_Message_GetExtensionField(
3499     const struct upb_Message* msg, const upb_MiniTableExtension* mt_ext,
3500     const void* default_val, void* val) {
3501   const upb_Extension* ext = UPB_PRIVATE(_upb_Message_Getext)(msg, mt_ext);
3502   const upb_MiniTableField* f = &mt_ext->UPB_PRIVATE(field);
3503   UPB_ASSUME(upb_MiniTableField_IsExtension(f));
3504 
3505   if (ext) {
3506     UPB_PRIVATE(_upb_MiniTableField_DataCopy)(f, val, &ext->data);
3507   } else {
3508     UPB_PRIVATE(_upb_MiniTableField_DataCopy)(f, val, default_val);
3509   }
3510 }
3511 
3512 // NOTE: The default_val is only used for fields that support presence.
3513 // For repeated/map fields, the resulting upb_Array*/upb_Map* can be NULL if a
3514 // upb_Array/upb_Map has not been allocated yet. Array/map fields do not have
3515 // presence, so this is semantically identical to a pointer to an empty
3516 // array/map, and must be treated the same for all semantic purposes.
upb_Message_GetField(const struct upb_Message * msg,const upb_MiniTableField * field,upb_MessageValue default_val)3517 UPB_API_INLINE upb_MessageValue upb_Message_GetField(
3518     const struct upb_Message* msg, const upb_MiniTableField* field,
3519     upb_MessageValue default_val) {
3520   upb_MessageValue ret;
3521   if (upb_MiniTableField_IsExtension(field)) {
3522     _upb_Message_GetExtensionField(msg, (upb_MiniTableExtension*)field,
3523                                    &default_val, &ret);
3524   } else {
3525     _upb_Message_GetNonExtensionField(msg, field, &default_val, &ret);
3526   }
3527   return ret;
3528 }
3529 
upb_Message_SetBaseField(struct upb_Message * msg,const upb_MiniTableField * f,const void * val)3530 UPB_API_INLINE void upb_Message_SetBaseField(struct upb_Message* msg,
3531                                              const upb_MiniTableField* f,
3532                                              const void* val) {
3533   UPB_ASSERT(!upb_Message_IsFrozen(msg));
3534   UPB_ASSUME(!upb_MiniTableField_IsExtension(f));
3535   UPB_PRIVATE(_upb_Message_SetPresence)(msg, f);
3536   UPB_PRIVATE(_upb_MiniTableField_DataCopy)
3537   (f, UPB_PRIVATE(_upb_Message_MutableDataPtr)(msg, f), val);
3538 }
3539 
upb_Message_SetExtension(struct upb_Message * msg,const upb_MiniTableExtension * e,const void * val,upb_Arena * a)3540 UPB_API_INLINE bool upb_Message_SetExtension(struct upb_Message* msg,
3541                                              const upb_MiniTableExtension* e,
3542                                              const void* val, upb_Arena* a) {
3543   UPB_ASSERT(!upb_Message_IsFrozen(msg));
3544   UPB_ASSERT(a);
3545   upb_Extension* ext =
3546       UPB_PRIVATE(_upb_Message_GetOrCreateExtension)(msg, e, a);
3547   if (!ext) return false;
3548   UPB_PRIVATE(_upb_MiniTableField_DataCopy)
3549   (&e->UPB_PRIVATE(field), &ext->data, val);
3550   return true;
3551 }
3552 
3553 // Sets the value of the given field in the given msg. The return value is true
3554 // if the operation completed successfully, or false if memory allocation
3555 // failed.
UPB_PRIVATE(_upb_Message_SetField)3556 UPB_INLINE bool UPB_PRIVATE(_upb_Message_SetField)(struct upb_Message* msg,
3557                                                    const upb_MiniTableField* f,
3558                                                    upb_MessageValue val,
3559                                                    upb_Arena* a) {
3560   if (upb_MiniTableField_IsExtension(f)) {
3561     const upb_MiniTableExtension* ext = (const upb_MiniTableExtension*)f;
3562     return upb_Message_SetExtension(msg, ext, &val, a);
3563   } else {
3564     upb_Message_SetBaseField(msg, f, &val);
3565     return true;
3566   }
3567 }
3568 
upb_Message_GetArray(const struct upb_Message * msg,const upb_MiniTableField * f)3569 UPB_API_INLINE const upb_Array* upb_Message_GetArray(
3570     const struct upb_Message* msg, const upb_MiniTableField* f) {
3571   UPB_PRIVATE(_upb_MiniTableField_CheckIsArray)(f);
3572   upb_Array* ret;
3573   const upb_Array* default_val = NULL;
3574   _upb_Message_GetNonExtensionField(msg, f, &default_val, &ret);
3575   return ret;
3576 }
3577 
upb_Message_GetBool(const struct upb_Message * msg,const upb_MiniTableField * f,bool default_val)3578 UPB_API_INLINE bool upb_Message_GetBool(const struct upb_Message* msg,
3579                                         const upb_MiniTableField* f,
3580                                         bool default_val) {
3581   UPB_ASSUME(upb_MiniTableField_CType(f) == kUpb_CType_Bool);
3582   UPB_ASSUME(upb_MiniTableField_IsScalar(f));
3583   UPB_ASSUME(UPB_PRIVATE(_upb_MiniTableField_GetRep)(f) == kUpb_FieldRep_1Byte);
3584   upb_MessageValue def;
3585   def.bool_val = default_val;
3586   return upb_Message_GetField(msg, f, def).bool_val;
3587 }
3588 
upb_Message_GetDouble(const struct upb_Message * msg,const upb_MiniTableField * f,double default_val)3589 UPB_API_INLINE double upb_Message_GetDouble(const struct upb_Message* msg,
3590                                             const upb_MiniTableField* f,
3591                                             double default_val) {
3592   UPB_ASSUME(upb_MiniTableField_CType(f) == kUpb_CType_Double);
3593   UPB_ASSUME(upb_MiniTableField_IsScalar(f));
3594   UPB_ASSUME(UPB_PRIVATE(_upb_MiniTableField_GetRep)(f) == kUpb_FieldRep_8Byte);
3595 
3596   upb_MessageValue def;
3597   def.double_val = default_val;
3598   return upb_Message_GetField(msg, f, def).double_val;
3599 }
3600 
upb_Message_GetFloat(const struct upb_Message * msg,const upb_MiniTableField * f,float default_val)3601 UPB_API_INLINE float upb_Message_GetFloat(const struct upb_Message* msg,
3602                                           const upb_MiniTableField* f,
3603                                           float default_val) {
3604   UPB_ASSUME(upb_MiniTableField_CType(f) == kUpb_CType_Float);
3605   UPB_ASSUME(upb_MiniTableField_IsScalar(f));
3606   UPB_ASSUME(UPB_PRIVATE(_upb_MiniTableField_GetRep)(f) == kUpb_FieldRep_4Byte);
3607 
3608   upb_MessageValue def;
3609   def.float_val = default_val;
3610   return upb_Message_GetField(msg, f, def).float_val;
3611 }
3612 
upb_Message_GetInt32(const struct upb_Message * msg,const upb_MiniTableField * f,int32_t default_val)3613 UPB_API_INLINE int32_t upb_Message_GetInt32(const struct upb_Message* msg,
3614                                             const upb_MiniTableField* f,
3615                                             int32_t default_val) {
3616   UPB_ASSUME(upb_MiniTableField_CType(f) == kUpb_CType_Int32 ||
3617              upb_MiniTableField_CType(f) == kUpb_CType_Enum);
3618   UPB_ASSUME(upb_MiniTableField_IsScalar(f));
3619   UPB_ASSUME(UPB_PRIVATE(_upb_MiniTableField_GetRep)(f) == kUpb_FieldRep_4Byte);
3620 
3621   upb_MessageValue def;
3622   def.int32_val = default_val;
3623   return upb_Message_GetField(msg, f, def).int32_val;
3624 }
3625 
upb_Message_GetInt64(const struct upb_Message * msg,const upb_MiniTableField * f,int64_t default_val)3626 UPB_API_INLINE int64_t upb_Message_GetInt64(const struct upb_Message* msg,
3627                                             const upb_MiniTableField* f,
3628                                             int64_t default_val) {
3629   UPB_ASSUME(upb_MiniTableField_CType(f) == kUpb_CType_Int64);
3630   UPB_ASSUME(upb_MiniTableField_IsScalar(f));
3631   UPB_ASSUME(UPB_PRIVATE(_upb_MiniTableField_GetRep)(f) == kUpb_FieldRep_8Byte);
3632 
3633   upb_MessageValue def;
3634   def.int64_val = default_val;
3635   return upb_Message_GetField(msg, f, def).int64_val;
3636 }
3637 
UPB_PRIVATE(_upb_Message_AssertMapIsUntagged)3638 UPB_INLINE void UPB_PRIVATE(_upb_Message_AssertMapIsUntagged)(
3639     const struct upb_Message* msg, const upb_MiniTableField* field) {
3640   UPB_UNUSED(msg);
3641   UPB_PRIVATE(_upb_MiniTableField_CheckIsMap)(field);
3642 #ifndef NDEBUG
3643   uintptr_t default_val = 0;
3644   uintptr_t tagged;
3645   _upb_Message_GetNonExtensionField(msg, field, &default_val, &tagged);
3646   UPB_ASSERT(!upb_TaggedMessagePtr_IsEmpty(tagged));
3647 #endif
3648 }
3649 
upb_Message_GetMap(const struct upb_Message * msg,const upb_MiniTableField * f)3650 UPB_API_INLINE const struct upb_Map* upb_Message_GetMap(
3651     const struct upb_Message* msg, const upb_MiniTableField* f) {
3652   UPB_PRIVATE(_upb_MiniTableField_CheckIsMap)(f);
3653   UPB_PRIVATE(_upb_Message_AssertMapIsUntagged)(msg, f);
3654   struct upb_Map* ret;
3655   const struct upb_Map* default_val = NULL;
3656   _upb_Message_GetNonExtensionField(msg, f, &default_val, &ret);
3657   return ret;
3658 }
3659 
upb_Message_GetTaggedMessagePtr(const struct upb_Message * msg,const upb_MiniTableField * f,struct upb_Message * default_val)3660 UPB_API_INLINE uintptr_t upb_Message_GetTaggedMessagePtr(
3661     const struct upb_Message* msg, const upb_MiniTableField* f,
3662     struct upb_Message* default_val) {
3663   UPB_ASSUME(upb_MiniTableField_CType(f) == kUpb_CType_Message);
3664   UPB_ASSUME(UPB_PRIVATE(_upb_MiniTableField_GetRep)(f) ==
3665              UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte));
3666   UPB_ASSUME(upb_MiniTableField_IsScalar(f));
3667   uintptr_t tagged;
3668   _upb_Message_GetNonExtensionField(msg, f, &default_val, &tagged);
3669   return tagged;
3670 }
3671 
3672 // For internal use only; users cannot set tagged messages because only the
3673 // parser and the message copier are allowed to directly create an empty
3674 // message.
UPB_PRIVATE(_upb_Message_SetTaggedMessagePtr)3675 UPB_INLINE void UPB_PRIVATE(_upb_Message_SetTaggedMessagePtr)(
3676     struct upb_Message* msg, const upb_MiniTableField* f,
3677     uintptr_t sub_message) {
3678   UPB_ASSUME(upb_MiniTableField_CType(f) == kUpb_CType_Message);
3679   UPB_ASSUME(UPB_PRIVATE(_upb_MiniTableField_GetRep)(f) ==
3680              UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte));
3681   UPB_ASSUME(upb_MiniTableField_IsScalar(f));
3682   upb_Message_SetBaseField(msg, f, &sub_message);
3683 }
3684 
upb_Message_GetMessage(const struct upb_Message * msg,const upb_MiniTableField * f)3685 UPB_API_INLINE const struct upb_Message* upb_Message_GetMessage(
3686     const struct upb_Message* msg, const upb_MiniTableField* f) {
3687   uintptr_t tagged = upb_Message_GetTaggedMessagePtr(msg, f, NULL);
3688   return upb_TaggedMessagePtr_GetNonEmptyMessage(tagged);
3689 }
3690 
upb_Message_GetMutableArray(struct upb_Message * msg,const upb_MiniTableField * f)3691 UPB_API_INLINE upb_Array* upb_Message_GetMutableArray(
3692     struct upb_Message* msg, const upb_MiniTableField* f) {
3693   UPB_PRIVATE(_upb_MiniTableField_CheckIsArray)(f);
3694   return (upb_Array*)upb_Message_GetArray(msg, f);
3695 }
3696 
upb_Message_GetMutableMap(struct upb_Message * msg,const upb_MiniTableField * f)3697 UPB_API_INLINE struct upb_Map* upb_Message_GetMutableMap(
3698     struct upb_Message* msg, const upb_MiniTableField* f) {
3699   return (struct upb_Map*)upb_Message_GetMap(msg, f);
3700 }
3701 
upb_Message_GetMutableMessage(struct upb_Message * msg,const upb_MiniTableField * f)3702 UPB_API_INLINE struct upb_Message* upb_Message_GetMutableMessage(
3703     struct upb_Message* msg, const upb_MiniTableField* f) {
3704   return (struct upb_Message*)upb_Message_GetMessage(msg, f);
3705 }
3706 
upb_Message_GetOrCreateMutableArray(struct upb_Message * msg,const upb_MiniTableField * f,upb_Arena * arena)3707 UPB_API_INLINE upb_Array* upb_Message_GetOrCreateMutableArray(
3708     struct upb_Message* msg, const upb_MiniTableField* f, upb_Arena* arena) {
3709   UPB_ASSERT(arena);
3710   UPB_PRIVATE(_upb_MiniTableField_CheckIsArray)(f);
3711   upb_Array* array = upb_Message_GetMutableArray(msg, f);
3712   if (!array) {
3713     array = UPB_PRIVATE(_upb_Array_New)(
3714         arena, 4, UPB_PRIVATE(_upb_MiniTableField_ElemSizeLg2)(f));
3715     // Check again due to: https://godbolt.org/z/7WfaoKG1r
3716     UPB_PRIVATE(_upb_MiniTableField_CheckIsArray)(f);
3717     upb_MessageValue val;
3718     val.array_val = array;
3719     UPB_PRIVATE(_upb_Message_SetField)(msg, f, val, arena);
3720   }
3721   return array;
3722 }
3723 
_upb_Message_GetOrCreateMutableMap(struct upb_Message * msg,const upb_MiniTableField * field,size_t key_size,size_t val_size,upb_Arena * arena)3724 UPB_INLINE struct upb_Map* _upb_Message_GetOrCreateMutableMap(
3725     struct upb_Message* msg, const upb_MiniTableField* field, size_t key_size,
3726     size_t val_size, upb_Arena* arena) {
3727   UPB_PRIVATE(_upb_MiniTableField_CheckIsMap)(field);
3728   UPB_PRIVATE(_upb_Message_AssertMapIsUntagged)(msg, field);
3729   struct upb_Map* map = NULL;
3730   struct upb_Map* default_map_value = NULL;
3731   _upb_Message_GetNonExtensionField(msg, field, &default_map_value, &map);
3732   if (!map) {
3733     map = _upb_Map_New(arena, key_size, val_size);
3734     // Check again due to: https://godbolt.org/z/7WfaoKG1r
3735     UPB_PRIVATE(_upb_MiniTableField_CheckIsMap)(field);
3736     upb_Message_SetBaseField(msg, field, &map);
3737   }
3738   return map;
3739 }
3740 
upb_Message_GetOrCreateMutableMap(struct upb_Message * msg,const upb_MiniTable * map_entry_mini_table,const upb_MiniTableField * f,upb_Arena * arena)3741 UPB_API_INLINE struct upb_Map* upb_Message_GetOrCreateMutableMap(
3742     struct upb_Message* msg, const upb_MiniTable* map_entry_mini_table,
3743     const upb_MiniTableField* f, upb_Arena* arena) {
3744   UPB_ASSUME(upb_MiniTableField_CType(f) == kUpb_CType_Message);
3745   const upb_MiniTableField* map_entry_key_field =
3746       &map_entry_mini_table->UPB_ONLYBITS(fields)[0];
3747   const upb_MiniTableField* map_entry_value_field =
3748       &map_entry_mini_table->UPB_ONLYBITS(fields)[1];
3749   return _upb_Message_GetOrCreateMutableMap(
3750       msg, f, _upb_Map_CTypeSize(upb_MiniTableField_CType(map_entry_key_field)),
3751       _upb_Map_CTypeSize(upb_MiniTableField_CType(map_entry_value_field)),
3752       arena);
3753 }
3754 
upb_Message_GetOrCreateMutableMessage(struct upb_Message * msg,const upb_MiniTable * mini_table,const upb_MiniTableField * f,upb_Arena * arena)3755 UPB_API_INLINE struct upb_Message* upb_Message_GetOrCreateMutableMessage(
3756     struct upb_Message* msg, const upb_MiniTable* mini_table,
3757     const upb_MiniTableField* f, upb_Arena* arena) {
3758   UPB_ASSERT(arena);
3759   UPB_ASSUME(upb_MiniTableField_CType(f) == kUpb_CType_Message);
3760   UPB_ASSUME(!upb_MiniTableField_IsExtension(f));
3761   struct upb_Message* sub_message =
3762       *UPB_PTR_AT(msg, f->UPB_ONLYBITS(offset), struct upb_Message*);
3763   if (!sub_message) {
3764     const upb_MiniTable* sub_mini_table =
3765         upb_MiniTable_SubMessage(mini_table, f);
3766     UPB_ASSERT(sub_mini_table);
3767     sub_message = _upb_Message_New(sub_mini_table, arena);
3768     *UPB_PTR_AT(msg, f->UPB_ONLYBITS(offset), struct upb_Message*) =
3769         sub_message;
3770     UPB_PRIVATE(_upb_Message_SetPresence)(msg, f);
3771   }
3772   return sub_message;
3773 }
3774 
3775 UPB_API_INLINE upb_StringView
upb_Message_GetString(const struct upb_Message * msg,const upb_MiniTableField * f,upb_StringView default_val)3776 upb_Message_GetString(const struct upb_Message* msg,
3777                       const upb_MiniTableField* f, upb_StringView default_val) {
3778   UPB_ASSUME(upb_MiniTableField_CType(f) == kUpb_CType_String ||
3779              upb_MiniTableField_CType(f) == kUpb_CType_Bytes);
3780   UPB_ASSUME(UPB_PRIVATE(_upb_MiniTableField_GetRep)(f) ==
3781              kUpb_FieldRep_StringView);
3782 
3783   upb_MessageValue def;
3784   def.str_val = default_val;
3785   return upb_Message_GetField(msg, f, def).str_val;
3786 }
3787 
upb_Message_GetUInt32(const struct upb_Message * msg,const upb_MiniTableField * f,uint32_t default_val)3788 UPB_API_INLINE uint32_t upb_Message_GetUInt32(const struct upb_Message* msg,
3789                                               const upb_MiniTableField* f,
3790                                               uint32_t default_val) {
3791   UPB_ASSUME(upb_MiniTableField_CType(f) == kUpb_CType_UInt32);
3792   UPB_ASSUME(upb_MiniTableField_IsScalar(f));
3793   UPB_ASSUME(UPB_PRIVATE(_upb_MiniTableField_GetRep)(f) == kUpb_FieldRep_4Byte);
3794 
3795   upb_MessageValue def;
3796   def.uint32_val = default_val;
3797   return upb_Message_GetField(msg, f, def).uint32_val;
3798 }
3799 
upb_Message_GetUInt64(const struct upb_Message * msg,const upb_MiniTableField * f,uint64_t default_val)3800 UPB_API_INLINE uint64_t upb_Message_GetUInt64(const struct upb_Message* msg,
3801                                               const upb_MiniTableField* f,
3802                                               uint64_t default_val) {
3803   UPB_ASSUME(upb_MiniTableField_CType(f) == kUpb_CType_UInt64);
3804   UPB_ASSUME(upb_MiniTableField_IsScalar(f));
3805   UPB_ASSUME(UPB_PRIVATE(_upb_MiniTableField_GetRep)(f) == kUpb_FieldRep_8Byte);
3806 
3807   upb_MessageValue def;
3808   def.uint64_val = default_val;
3809   return upb_Message_GetField(msg, f, def).uint64_val;
3810 }
3811 
3812 // BaseField Setters ///////////////////////////////////////////////////////////
3813 
upb_Message_SetBaseFieldBool(struct upb_Message * msg,const upb_MiniTableField * f,bool value)3814 UPB_API_INLINE void upb_Message_SetBaseFieldBool(struct upb_Message* msg,
3815                                                  const upb_MiniTableField* f,
3816                                                  bool value) {
3817   UPB_ASSUME(upb_MiniTableField_CType(f) == kUpb_CType_Bool);
3818   UPB_ASSUME(upb_MiniTableField_IsScalar(f));
3819   UPB_ASSUME(UPB_PRIVATE(_upb_MiniTableField_GetRep)(f) == kUpb_FieldRep_1Byte);
3820   upb_Message_SetBaseField(msg, f, &value);
3821 }
3822 
upb_Message_SetBaseFieldDouble(struct upb_Message * msg,const upb_MiniTableField * f,double value)3823 UPB_API_INLINE void upb_Message_SetBaseFieldDouble(struct upb_Message* msg,
3824                                                    const upb_MiniTableField* f,
3825                                                    double value) {
3826   UPB_ASSUME(upb_MiniTableField_CType(f) == kUpb_CType_Double);
3827   UPB_ASSUME(upb_MiniTableField_IsScalar(f));
3828   UPB_ASSUME(UPB_PRIVATE(_upb_MiniTableField_GetRep)(f) == kUpb_FieldRep_8Byte);
3829   upb_Message_SetBaseField(msg, f, &value);
3830 }
3831 
upb_Message_SetBaseFieldFloat(struct upb_Message * msg,const upb_MiniTableField * f,float value)3832 UPB_API_INLINE void upb_Message_SetBaseFieldFloat(struct upb_Message* msg,
3833                                                   const upb_MiniTableField* f,
3834                                                   float value) {
3835   UPB_ASSUME(upb_MiniTableField_CType(f) == kUpb_CType_Float);
3836   UPB_ASSUME(upb_MiniTableField_IsScalar(f));
3837   UPB_ASSUME(UPB_PRIVATE(_upb_MiniTableField_GetRep)(f) == kUpb_FieldRep_4Byte);
3838   upb_Message_SetBaseField(msg, f, &value);
3839 }
3840 
upb_Message_SetBaseFieldInt32(struct upb_Message * msg,const upb_MiniTableField * f,int32_t value)3841 UPB_API_INLINE void upb_Message_SetBaseFieldInt32(struct upb_Message* msg,
3842                                                   const upb_MiniTableField* f,
3843                                                   int32_t value) {
3844   UPB_ASSUME(upb_MiniTableField_CType(f) == kUpb_CType_Int32 ||
3845              upb_MiniTableField_CType(f) == kUpb_CType_Enum);
3846   UPB_ASSUME(upb_MiniTableField_IsScalar(f));
3847   UPB_ASSUME(UPB_PRIVATE(_upb_MiniTableField_GetRep)(f) == kUpb_FieldRep_4Byte);
3848   upb_Message_SetBaseField(msg, f, &value);
3849 }
3850 
upb_Message_SetBaseFieldInt64(struct upb_Message * msg,const upb_MiniTableField * f,int64_t value)3851 UPB_API_INLINE void upb_Message_SetBaseFieldInt64(struct upb_Message* msg,
3852                                                   const upb_MiniTableField* f,
3853                                                   int64_t value) {
3854   UPB_ASSUME(upb_MiniTableField_CType(f) == kUpb_CType_Int64);
3855   UPB_ASSUME(upb_MiniTableField_IsScalar(f));
3856   UPB_ASSUME(UPB_PRIVATE(_upb_MiniTableField_GetRep)(f) == kUpb_FieldRep_8Byte);
3857   upb_Message_SetBaseField(msg, f, &value);
3858 }
3859 
upb_Message_SetBaseFieldMessage(struct upb_Message * msg,const upb_MiniTableField * f,struct upb_Message * value)3860 UPB_API_INLINE void upb_Message_SetBaseFieldMessage(struct upb_Message* msg,
3861                                                     const upb_MiniTableField* f,
3862                                                     struct upb_Message* value) {
3863   UPB_PRIVATE(_upb_Message_SetTaggedMessagePtr)
3864   (msg, f, UPB_PRIVATE(_upb_TaggedMessagePtr_Pack)(value, false));
3865 }
3866 
upb_Message_SetBaseFieldString(struct upb_Message * msg,const upb_MiniTableField * f,upb_StringView value)3867 UPB_API_INLINE void upb_Message_SetBaseFieldString(struct upb_Message* msg,
3868                                                    const upb_MiniTableField* f,
3869                                                    upb_StringView value) {
3870   UPB_ASSUME(upb_MiniTableField_CType(f) == kUpb_CType_String ||
3871              upb_MiniTableField_CType(f) == kUpb_CType_Bytes);
3872   UPB_ASSUME(upb_MiniTableField_IsScalar(f));
3873   UPB_ASSUME(UPB_PRIVATE(_upb_MiniTableField_GetRep)(f) ==
3874              kUpb_FieldRep_StringView);
3875   upb_Message_SetBaseField(msg, f, &value);
3876 }
3877 
upb_Message_SetBaseFieldUInt32(struct upb_Message * msg,const upb_MiniTableField * f,uint32_t value)3878 UPB_API_INLINE void upb_Message_SetBaseFieldUInt32(struct upb_Message* msg,
3879                                                    const upb_MiniTableField* f,
3880                                                    uint32_t value) {
3881   UPB_ASSUME(upb_MiniTableField_CType(f) == kUpb_CType_UInt32);
3882   UPB_ASSUME(upb_MiniTableField_IsScalar(f));
3883   UPB_ASSUME(UPB_PRIVATE(_upb_MiniTableField_GetRep)(f) == kUpb_FieldRep_4Byte);
3884   upb_Message_SetBaseField(msg, f, &value);
3885 }
3886 
upb_Message_SetBaseFieldUInt64(struct upb_Message * msg,const upb_MiniTableField * f,uint64_t value)3887 UPB_API_INLINE void upb_Message_SetBaseFieldUInt64(struct upb_Message* msg,
3888                                                    const upb_MiniTableField* f,
3889                                                    uint64_t value) {
3890   UPB_ASSUME(upb_MiniTableField_CType(f) == kUpb_CType_UInt64);
3891   UPB_ASSUME(upb_MiniTableField_IsScalar(f));
3892   UPB_ASSUME(UPB_PRIVATE(_upb_MiniTableField_GetRep)(f) == kUpb_FieldRep_8Byte);
3893   upb_Message_SetBaseField(msg, f, &value);
3894 }
3895 
upb_Message_SetClosedEnum(struct upb_Message * msg,const upb_MiniTable * m,const upb_MiniTableField * f,int32_t value)3896 UPB_API_INLINE void upb_Message_SetClosedEnum(struct upb_Message* msg,
3897                                               const upb_MiniTable* m,
3898                                               const upb_MiniTableField* f,
3899                                               int32_t value) {
3900   UPB_ASSERT(upb_MiniTableField_IsClosedEnum(f));
3901   UPB_ASSUME(UPB_PRIVATE(_upb_MiniTableField_GetRep)(f) == kUpb_FieldRep_4Byte);
3902   UPB_ASSERT(
3903       upb_MiniTableEnum_CheckValue(upb_MiniTable_GetSubEnumTable(m, f), value));
3904   upb_Message_SetBaseField(msg, f, &value);
3905 }
3906 
3907 // Extension Setters ///////////////////////////////////////////////////////////
3908 
upb_Message_SetExtensionBool(struct upb_Message * msg,const upb_MiniTableExtension * e,bool value,upb_Arena * a)3909 UPB_API_INLINE bool upb_Message_SetExtensionBool(
3910     struct upb_Message* msg, const upb_MiniTableExtension* e, bool value,
3911     upb_Arena* a) {
3912   UPB_ASSUME(upb_MiniTableExtension_CType(e) == kUpb_CType_Bool);
3913   UPB_ASSUME(UPB_PRIVATE(_upb_MiniTableExtension_GetRep)(e) ==
3914              kUpb_FieldRep_1Byte);
3915   return upb_Message_SetExtension(msg, e, &value, a);
3916 }
3917 
upb_Message_SetExtensionDouble(struct upb_Message * msg,const upb_MiniTableExtension * e,double value,upb_Arena * a)3918 UPB_API_INLINE bool upb_Message_SetExtensionDouble(
3919     struct upb_Message* msg, const upb_MiniTableExtension* e, double value,
3920     upb_Arena* a) {
3921   UPB_ASSUME(upb_MiniTableExtension_CType(e) == kUpb_CType_Double);
3922   UPB_ASSUME(UPB_PRIVATE(_upb_MiniTableExtension_GetRep)(e) ==
3923              kUpb_FieldRep_8Byte);
3924   return upb_Message_SetExtension(msg, e, &value, a);
3925 }
3926 
upb_Message_SetExtensionFloat(struct upb_Message * msg,const upb_MiniTableExtension * e,float value,upb_Arena * a)3927 UPB_API_INLINE bool upb_Message_SetExtensionFloat(
3928     struct upb_Message* msg, const upb_MiniTableExtension* e, float value,
3929     upb_Arena* a) {
3930   UPB_ASSUME(upb_MiniTableExtension_CType(e) == kUpb_CType_Float);
3931   UPB_ASSUME(UPB_PRIVATE(_upb_MiniTableExtension_GetRep)(e) ==
3932              kUpb_FieldRep_4Byte);
3933   return upb_Message_SetExtension(msg, e, &value, a);
3934 }
3935 
upb_Message_SetExtensionInt32(struct upb_Message * msg,const upb_MiniTableExtension * e,int32_t value,upb_Arena * a)3936 UPB_API_INLINE bool upb_Message_SetExtensionInt32(
3937     struct upb_Message* msg, const upb_MiniTableExtension* e, int32_t value,
3938     upb_Arena* a) {
3939   UPB_ASSUME(upb_MiniTableExtension_CType(e) == kUpb_CType_Int32 ||
3940              upb_MiniTableExtension_CType(e) == kUpb_CType_Enum);
3941   UPB_ASSUME(UPB_PRIVATE(_upb_MiniTableExtension_GetRep)(e) ==
3942              kUpb_FieldRep_4Byte);
3943   return upb_Message_SetExtension(msg, e, &value, a);
3944 }
3945 
upb_Message_SetExtensionInt64(struct upb_Message * msg,const upb_MiniTableExtension * e,int64_t value,upb_Arena * a)3946 UPB_API_INLINE bool upb_Message_SetExtensionInt64(
3947     struct upb_Message* msg, const upb_MiniTableExtension* e, int64_t value,
3948     upb_Arena* a) {
3949   UPB_ASSUME(upb_MiniTableExtension_CType(e) == kUpb_CType_Int64);
3950   UPB_ASSUME(UPB_PRIVATE(_upb_MiniTableExtension_GetRep)(e) ==
3951              kUpb_FieldRep_8Byte);
3952   return upb_Message_SetExtension(msg, e, &value, a);
3953 }
3954 
upb_Message_SetExtensionString(struct upb_Message * msg,const upb_MiniTableExtension * e,upb_StringView value,upb_Arena * a)3955 UPB_API_INLINE bool upb_Message_SetExtensionString(
3956     struct upb_Message* msg, const upb_MiniTableExtension* e,
3957     upb_StringView value, upb_Arena* a) {
3958   UPB_ASSUME(upb_MiniTableExtension_CType(e) == kUpb_CType_String ||
3959              upb_MiniTableExtension_CType(e) == kUpb_CType_Bytes);
3960   UPB_ASSUME(UPB_PRIVATE(_upb_MiniTableExtension_GetRep)(e) ==
3961              kUpb_FieldRep_StringView);
3962   return upb_Message_SetExtension(msg, e, &value, a);
3963 }
3964 
upb_Message_SetExtensionUInt32(struct upb_Message * msg,const upb_MiniTableExtension * e,uint32_t value,upb_Arena * a)3965 UPB_API_INLINE bool upb_Message_SetExtensionUInt32(
3966     struct upb_Message* msg, const upb_MiniTableExtension* e, uint32_t value,
3967     upb_Arena* a) {
3968   UPB_ASSUME(upb_MiniTableExtension_CType(e) == kUpb_CType_UInt32);
3969   UPB_ASSUME(UPB_PRIVATE(_upb_MiniTableExtension_GetRep)(e) ==
3970              kUpb_FieldRep_4Byte);
3971   return upb_Message_SetExtension(msg, e, &value, a);
3972 }
3973 
upb_Message_SetExtensionUInt64(struct upb_Message * msg,const upb_MiniTableExtension * e,uint64_t value,upb_Arena * a)3974 UPB_API_INLINE bool upb_Message_SetExtensionUInt64(
3975     struct upb_Message* msg, const upb_MiniTableExtension* e, uint64_t value,
3976     upb_Arena* a) {
3977   UPB_ASSUME(upb_MiniTableExtension_CType(e) == kUpb_CType_UInt64);
3978   UPB_ASSUME(UPB_PRIVATE(_upb_MiniTableExtension_GetRep)(e) ==
3979              kUpb_FieldRep_8Byte);
3980   return upb_Message_SetExtension(msg, e, &value, a);
3981 }
3982 
3983 // Universal Setters ///////////////////////////////////////////////////////////
3984 
upb_Message_SetBool(struct upb_Message * msg,const upb_MiniTableField * f,bool value,upb_Arena * a)3985 UPB_API_INLINE bool upb_Message_SetBool(struct upb_Message* msg,
3986                                         const upb_MiniTableField* f, bool value,
3987                                         upb_Arena* a) {
3988   return upb_MiniTableField_IsExtension(f)
3989              ? upb_Message_SetExtensionBool(
3990                    msg, (const upb_MiniTableExtension*)f, value, a)
3991              : (upb_Message_SetBaseFieldBool(msg, f, value), true);
3992 }
3993 
upb_Message_SetDouble(struct upb_Message * msg,const upb_MiniTableField * f,double value,upb_Arena * a)3994 UPB_API_INLINE bool upb_Message_SetDouble(struct upb_Message* msg,
3995                                           const upb_MiniTableField* f,
3996                                           double value, upb_Arena* a) {
3997   return upb_MiniTableField_IsExtension(f)
3998              ? upb_Message_SetExtensionDouble(
3999                    msg, (const upb_MiniTableExtension*)f, value, a)
4000              : (upb_Message_SetBaseFieldDouble(msg, f, value), true);
4001 }
4002 
upb_Message_SetFloat(struct upb_Message * msg,const upb_MiniTableField * f,float value,upb_Arena * a)4003 UPB_API_INLINE bool upb_Message_SetFloat(struct upb_Message* msg,
4004                                          const upb_MiniTableField* f,
4005                                          float value, upb_Arena* a) {
4006   return upb_MiniTableField_IsExtension(f)
4007              ? upb_Message_SetExtensionFloat(
4008                    msg, (const upb_MiniTableExtension*)f, value, a)
4009              : (upb_Message_SetBaseFieldFloat(msg, f, value), true);
4010 }
4011 
upb_Message_SetInt32(struct upb_Message * msg,const upb_MiniTableField * f,int32_t value,upb_Arena * a)4012 UPB_API_INLINE bool upb_Message_SetInt32(struct upb_Message* msg,
4013                                          const upb_MiniTableField* f,
4014                                          int32_t value, upb_Arena* a) {
4015   return upb_MiniTableField_IsExtension(f)
4016              ? upb_Message_SetExtensionInt32(
4017                    msg, (const upb_MiniTableExtension*)f, value, a)
4018              : (upb_Message_SetBaseFieldInt32(msg, f, value), true);
4019 }
4020 
upb_Message_SetInt64(struct upb_Message * msg,const upb_MiniTableField * f,int64_t value,upb_Arena * a)4021 UPB_API_INLINE bool upb_Message_SetInt64(struct upb_Message* msg,
4022                                          const upb_MiniTableField* f,
4023                                          int64_t value, upb_Arena* a) {
4024   return upb_MiniTableField_IsExtension(f)
4025              ? upb_Message_SetExtensionInt64(
4026                    msg, (const upb_MiniTableExtension*)f, value, a)
4027              : (upb_Message_SetBaseFieldInt64(msg, f, value), true);
4028 }
4029 
4030 // Sets the value of a message-typed field. The mini_tables of `msg` and
4031 // `value` must have been linked for this to work correctly.
upb_Message_SetMessage(struct upb_Message * msg,const upb_MiniTableField * f,struct upb_Message * value)4032 UPB_API_INLINE void upb_Message_SetMessage(struct upb_Message* msg,
4033                                            const upb_MiniTableField* f,
4034                                            struct upb_Message* value) {
4035   UPB_ASSERT(!upb_MiniTableField_IsExtension(f));
4036   upb_Message_SetBaseFieldMessage(msg, f, value);
4037 }
4038 
4039 // Sets the value of a `string` or `bytes` field. The bytes of the value are not
4040 // copied, so it is the caller's responsibility to ensure that they remain valid
4041 // for the lifetime of `msg`. That might be done by copying them into the given
4042 // arena, or by fusing that arena with the arena the bytes live in, for example.
upb_Message_SetString(struct upb_Message * msg,const upb_MiniTableField * f,upb_StringView value,upb_Arena * a)4043 UPB_API_INLINE bool upb_Message_SetString(struct upb_Message* msg,
4044                                           const upb_MiniTableField* f,
4045                                           upb_StringView value, upb_Arena* a) {
4046   return upb_MiniTableField_IsExtension(f)
4047              ? upb_Message_SetExtensionString(
4048                    msg, (const upb_MiniTableExtension*)f, value, a)
4049              : (upb_Message_SetBaseFieldString(msg, f, value), true);
4050 }
4051 
upb_Message_SetUInt32(struct upb_Message * msg,const upb_MiniTableField * f,uint32_t value,upb_Arena * a)4052 UPB_API_INLINE bool upb_Message_SetUInt32(struct upb_Message* msg,
4053                                           const upb_MiniTableField* f,
4054                                           uint32_t value, upb_Arena* a) {
4055   return upb_MiniTableField_IsExtension(f)
4056              ? upb_Message_SetExtensionUInt32(
4057                    msg, (const upb_MiniTableExtension*)f, value, a)
4058              : (upb_Message_SetBaseFieldUInt32(msg, f, value), true);
4059 }
4060 
upb_Message_SetUInt64(struct upb_Message * msg,const upb_MiniTableField * f,uint64_t value,upb_Arena * a)4061 UPB_API_INLINE bool upb_Message_SetUInt64(struct upb_Message* msg,
4062                                           const upb_MiniTableField* f,
4063                                           uint64_t value, upb_Arena* a) {
4064   return upb_MiniTableField_IsExtension(f)
4065              ? upb_Message_SetExtensionUInt64(
4066                    msg, (const upb_MiniTableExtension*)f, value, a)
4067              : (upb_Message_SetBaseFieldUInt64(msg, f, value), true);
4068 }
4069 
upb_Message_Clear(struct upb_Message * msg,const upb_MiniTable * m)4070 UPB_API_INLINE void upb_Message_Clear(struct upb_Message* msg,
4071                                       const upb_MiniTable* m) {
4072   UPB_ASSERT(!upb_Message_IsFrozen(msg));
4073   upb_Message_Internal* in = UPB_PRIVATE(_upb_Message_GetInternal)(msg);
4074   memset(msg, 0, m->UPB_PRIVATE(size));
4075   if (in) {
4076     // Reset the internal buffer to empty.
4077     in->unknown_end = sizeof(upb_Message_Internal);
4078     in->ext_begin = in->size;
4079     UPB_PRIVATE(_upb_Message_SetInternal)(msg, in);
4080   }
4081 }
4082 
upb_Message_ClearBaseField(struct upb_Message * msg,const upb_MiniTableField * f)4083 UPB_API_INLINE void upb_Message_ClearBaseField(struct upb_Message* msg,
4084                                                const upb_MiniTableField* f) {
4085   UPB_ASSERT(!upb_Message_IsFrozen(msg));
4086   if (UPB_PRIVATE(_upb_MiniTableField_HasHasbit)(f)) {
4087     UPB_PRIVATE(_upb_Message_ClearHasbit)(msg, f);
4088   } else if (upb_MiniTableField_IsInOneof(f)) {
4089     uint32_t* ptr = UPB_PRIVATE(_upb_Message_OneofCasePtr)(msg, f);
4090     if (*ptr != upb_MiniTableField_Number(f)) return;
4091     *ptr = 0;
4092   }
4093   const char zeros[16] = {0};
4094   UPB_PRIVATE(_upb_MiniTableField_DataCopy)
4095   (f, UPB_PRIVATE(_upb_Message_MutableDataPtr)(msg, f), zeros);
4096 }
4097 
upb_Message_ClearExtension(struct upb_Message * msg,const upb_MiniTableExtension * e)4098 UPB_API_INLINE void upb_Message_ClearExtension(
4099     struct upb_Message* msg, const upb_MiniTableExtension* e) {
4100   UPB_ASSERT(!upb_Message_IsFrozen(msg));
4101   upb_Message_Internal* in = UPB_PRIVATE(_upb_Message_GetInternal)(msg);
4102   if (!in) return;
4103   const upb_Extension* base = UPB_PTR_AT(in, in->ext_begin, upb_Extension);
4104   upb_Extension* ext = (upb_Extension*)UPB_PRIVATE(_upb_Message_Getext)(msg, e);
4105   if (ext) {
4106     *ext = *base;
4107     in->ext_begin += sizeof(upb_Extension);
4108   }
4109 }
4110 
upb_Message_ClearOneof(struct upb_Message * msg,const upb_MiniTable * m,const upb_MiniTableField * f)4111 UPB_API_INLINE void upb_Message_ClearOneof(struct upb_Message* msg,
4112                                            const upb_MiniTable* m,
4113                                            const upb_MiniTableField* f) {
4114   UPB_ASSERT(!upb_Message_IsFrozen(msg));
4115   uint32_t field_number = upb_Message_WhichOneofFieldNumber(msg, f);
4116   if (field_number == 0) {
4117     // No field in the oneof is set.
4118     return;
4119   }
4120 
4121   const upb_MiniTableField* field =
4122       upb_MiniTable_FindFieldByNumber(m, field_number);
4123   upb_Message_ClearBaseField(msg, field);
4124 }
4125 
upb_Message_ResizeArrayUninitialized(struct upb_Message * msg,const upb_MiniTableField * f,size_t size,upb_Arena * arena)4126 UPB_API_INLINE void* upb_Message_ResizeArrayUninitialized(
4127     struct upb_Message* msg, const upb_MiniTableField* f, size_t size,
4128     upb_Arena* arena) {
4129   UPB_PRIVATE(_upb_MiniTableField_CheckIsArray)(f);
4130   upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, f, arena);
4131   if (!arr || !UPB_PRIVATE(_upb_Array_ResizeUninitialized)(arr, size, arena)) {
4132     return NULL;
4133   }
4134   return upb_Array_MutableDataPtr(arr);
4135 }
4136 
4137 #ifdef __cplusplus
4138 } /* extern "C" */
4139 #endif
4140 
4141 #if defined(__GNUC__) && !defined(__clang__)
4142 #pragma GCC diagnostic pop
4143 #endif
4144 
4145 
4146 #endif  // UPB_MESSAGE_INTERNAL_ACCESSORS_H_
4147 
4148 #ifndef UPB_MESSAGE_MAP_H_
4149 #define UPB_MESSAGE_MAP_H_
4150 
4151 #include <stddef.h>
4152 
4153 
4154 // Must be last.
4155 
4156 typedef struct upb_Map upb_Map;
4157 
4158 #ifdef __cplusplus
4159 extern "C" {
4160 #endif
4161 
4162 // Creates a new map on the given arena with the given key/value size.
4163 UPB_API upb_Map* upb_Map_New(upb_Arena* a, upb_CType key_type,
4164                              upb_CType value_type);
4165 
4166 // Returns the number of entries in the map.
4167 UPB_API size_t upb_Map_Size(const upb_Map* map);
4168 
4169 // Stores a value for the given key into |*val| (or the zero value if the key is
4170 // not present). Returns whether the key was present. The |val| pointer may be
4171 // NULL, in which case the function tests whether the given key is present.
4172 UPB_API bool upb_Map_Get(const upb_Map* map, upb_MessageValue key,
4173                          upb_MessageValue* val);
4174 
4175 // Removes all entries in the map.
4176 UPB_API void upb_Map_Clear(upb_Map* map);
4177 
4178 // Sets the given key to the given value, returning whether the key was inserted
4179 // or replaced. If the key was inserted, then any existing iterators will be
4180 // invalidated.
4181 UPB_API upb_MapInsertStatus upb_Map_Insert(upb_Map* map, upb_MessageValue key,
4182                                            upb_MessageValue val,
4183                                            upb_Arena* arena);
4184 
4185 // Sets the given key to the given value. Returns false if memory allocation
4186 // failed. If the key is newly inserted, then any existing iterators will be
4187 // invalidated.
upb_Map_Set(upb_Map * map,upb_MessageValue key,upb_MessageValue val,upb_Arena * arena)4188 UPB_API_INLINE bool upb_Map_Set(upb_Map* map, upb_MessageValue key,
4189                                 upb_MessageValue val, upb_Arena* arena) {
4190   return upb_Map_Insert(map, key, val, arena) !=
4191          kUpb_MapInsertStatus_OutOfMemory;
4192 }
4193 
4194 // Deletes this key from the table. Returns true if the key was present.
4195 // If present and |val| is non-NULL, stores the deleted value.
4196 UPB_API bool upb_Map_Delete(upb_Map* map, upb_MessageValue key,
4197                             upb_MessageValue* val);
4198 
4199 // Map iteration:
4200 //
4201 // size_t iter = kUpb_Map_Begin;
4202 // upb_MessageValue key, val;
4203 // while (upb_Map_Next(map, &key, &val, &iter)) {
4204 //   ...
4205 // }
4206 
4207 #define kUpb_Map_Begin ((size_t) - 1)
4208 
4209 // Advances to the next entry. Returns false if no more entries are present.
4210 // Otherwise returns true and populates both *key and *value.
4211 UPB_API bool upb_Map_Next(const upb_Map* map, upb_MessageValue* key,
4212                           upb_MessageValue* val, size_t* iter);
4213 
4214 // Sets the value for the entry pointed to by iter.
4215 // WARNING: this does not currently work for string values!
4216 UPB_API void upb_Map_SetEntryValue(upb_Map* map, size_t iter,
4217                                    upb_MessageValue val);
4218 
4219 // DEPRECATED iterator, slated for removal.
4220 
4221 /* Map iteration:
4222  *
4223  * size_t iter = kUpb_Map_Begin;
4224  * while (upb_MapIterator_Next(map, &iter)) {
4225  *   upb_MessageValue key = upb_MapIterator_Key(map, iter);
4226  *   upb_MessageValue val = upb_MapIterator_Value(map, iter);
4227  * }
4228  */
4229 
4230 // Advances to the next entry. Returns false if no more entries are present.
4231 UPB_API bool upb_MapIterator_Next(const upb_Map* map, size_t* iter);
4232 
4233 // Returns true if the iterator still points to a valid entry, or false if the
4234 // iterator is past the last element. It is an error to call this function with
4235 // kUpb_Map_Begin (you must call next() at least once first).
4236 UPB_API bool upb_MapIterator_Done(const upb_Map* map, size_t iter);
4237 
4238 // Returns the key and value for this entry of the map.
4239 UPB_API upb_MessageValue upb_MapIterator_Key(const upb_Map* map, size_t iter);
4240 UPB_API upb_MessageValue upb_MapIterator_Value(const upb_Map* map, size_t iter);
4241 
4242 // Mark a map and all of its descendents as frozen/immutable.
4243 // If the map values are messages then |m| must point to the minitable for
4244 // those messages. Otherwise |m| must be NULL.
4245 UPB_API void upb_Map_Freeze(upb_Map* map, const upb_MiniTable* m);
4246 
4247 // Returns whether a map has been frozen.
4248 UPB_API_INLINE bool upb_Map_IsFrozen(const upb_Map* map);
4249 
4250 #ifdef __cplusplus
4251 } /* extern "C" */
4252 #endif
4253 
4254 
4255 #endif /* UPB_MESSAGE_MAP_H_ */
4256 
4257 #ifndef UPB_MINI_TABLE_TAGGED_PTR_H_
4258 #define UPB_MINI_TABLE_TAGGED_PTR_H_
4259 
4260 #include <stdint.h>
4261 
4262 
4263 // Must be last.
4264 
4265 // When a upb_Message* is stored in a message, array, or map, it is stored in a
4266 // tagged form. If the tag bit is set, the referenced upb_Message is of type
4267 // _kUpb_MiniTable_Empty (a sentinel message type with no fields) instead of
4268 // that field's true message type. This forms the basis of what we call
4269 // "dynamic tree shaking."
4270 //
4271 // See the documentation for kUpb_DecodeOption_ExperimentalAllowUnlinked for
4272 // more information.
4273 
4274 typedef uintptr_t upb_TaggedMessagePtr;
4275 
4276 #ifdef __cplusplus
4277 extern "C" {
4278 #endif
4279 
4280 // Users who enable unlinked sub-messages must use this to test whether a
4281 // message is empty before accessing it. If a message is empty, it must be
4282 // first promoted using the interfaces in message/promote.h.
4283 UPB_API_INLINE bool upb_TaggedMessagePtr_IsEmpty(upb_TaggedMessagePtr ptr);
4284 
4285 UPB_API_INLINE upb_Message* upb_TaggedMessagePtr_GetNonEmptyMessage(
4286     upb_TaggedMessagePtr ptr);
4287 
4288 #ifdef __cplusplus
4289 } /* extern "C" */
4290 #endif
4291 
4292 
4293 #endif /* UPB_MINI_TABLE_TAGGED_PTR_H_ */
4294 
4295 // Must be last.
4296 
4297 #ifdef __cplusplus
4298 extern "C" {
4299 #endif
4300 
4301 // Functions ending in BaseField() take a (upb_MiniTableField*) argument
4302 // and work only on non-extension fields.
4303 //
4304 // Functions ending in Extension() take a (upb_MiniTableExtension*) argument
4305 // and work only on extensions.
4306 
4307 UPB_API_INLINE void upb_Message_Clear(upb_Message* msg, const upb_MiniTable* m);
4308 
4309 UPB_API_INLINE void upb_Message_ClearBaseField(upb_Message* msg,
4310                                                const upb_MiniTableField* f);
4311 
4312 UPB_API_INLINE void upb_Message_ClearExtension(upb_Message* msg,
4313                                                const upb_MiniTableExtension* e);
4314 
4315 UPB_API_INLINE void upb_Message_ClearOneof(upb_Message* msg,
4316                                            const upb_MiniTable* m,
4317                                            const upb_MiniTableField* f);
4318 
4319 UPB_API_INLINE bool upb_Message_HasBaseField(const upb_Message* msg,
4320                                              const upb_MiniTableField* f);
4321 
4322 UPB_API_INLINE bool upb_Message_HasExtension(const upb_Message* msg,
4323                                              const upb_MiniTableExtension* e);
4324 
4325 UPB_API_INLINE upb_MessageValue
4326 upb_Message_GetField(const upb_Message* msg, const upb_MiniTableField* f,
4327                      upb_MessageValue default_val);
4328 
4329 UPB_API_INLINE upb_TaggedMessagePtr upb_Message_GetTaggedMessagePtr(
4330     const upb_Message* msg, const upb_MiniTableField* field,
4331     upb_Message* default_val);
4332 
4333 UPB_API_INLINE const upb_Array* upb_Message_GetArray(
4334     const upb_Message* msg, const upb_MiniTableField* f);
4335 
4336 UPB_API_INLINE bool upb_Message_GetBool(const upb_Message* msg,
4337                                         const upb_MiniTableField* f,
4338                                         bool default_val);
4339 
4340 UPB_API_INLINE double upb_Message_GetDouble(const upb_Message* msg,
4341                                             const upb_MiniTableField* field,
4342                                             double default_val);
4343 
4344 UPB_API_INLINE float upb_Message_GetFloat(const upb_Message* msg,
4345                                           const upb_MiniTableField* f,
4346                                           float default_val);
4347 
4348 UPB_API_INLINE int32_t upb_Message_GetInt32(const upb_Message* msg,
4349                                             const upb_MiniTableField* f,
4350                                             int32_t default_val);
4351 
4352 UPB_API_INLINE int64_t upb_Message_GetInt64(const upb_Message* msg,
4353                                             const upb_MiniTableField* f,
4354                                             int64_t default_val);
4355 
4356 UPB_API_INLINE const upb_Map* upb_Message_GetMap(const upb_Message* msg,
4357                                                  const upb_MiniTableField* f);
4358 
4359 UPB_API_INLINE const upb_Message* upb_Message_GetMessage(
4360     const upb_Message* msg, const upb_MiniTableField* f);
4361 
4362 UPB_API_INLINE upb_Array* upb_Message_GetMutableArray(
4363     upb_Message* msg, const upb_MiniTableField* f);
4364 
4365 UPB_API_INLINE upb_Map* upb_Message_GetMutableMap(upb_Message* msg,
4366                                                   const upb_MiniTableField* f);
4367 
4368 UPB_API_INLINE upb_Message* upb_Message_GetMutableMessage(
4369     upb_Message* msg, const upb_MiniTableField* f);
4370 
4371 UPB_API_INLINE upb_Array* upb_Message_GetOrCreateMutableArray(
4372     upb_Message* msg, const upb_MiniTableField* f, upb_Arena* arena);
4373 
4374 UPB_API_INLINE upb_Map* upb_Message_GetOrCreateMutableMap(
4375     upb_Message* msg, const upb_MiniTable* map_entry_mini_table,
4376     const upb_MiniTableField* f, upb_Arena* arena);
4377 
4378 UPB_API_INLINE upb_Message* upb_Message_GetOrCreateMutableMessage(
4379     upb_Message* msg, const upb_MiniTable* mini_table,
4380     const upb_MiniTableField* f, upb_Arena* arena);
4381 
4382 UPB_API_INLINE upb_StringView
4383 upb_Message_GetString(const upb_Message* msg, const upb_MiniTableField* field,
4384                       upb_StringView default_val);
4385 
4386 UPB_API_INLINE uint32_t upb_Message_GetUInt32(const upb_Message* msg,
4387                                               const upb_MiniTableField* f,
4388                                               uint32_t default_val);
4389 
4390 UPB_API_INLINE uint64_t upb_Message_GetUInt64(const upb_Message* msg,
4391                                               const upb_MiniTableField* f,
4392                                               uint64_t default_val);
4393 
4394 UPB_API_INLINE void upb_Message_SetClosedEnum(
4395     upb_Message* msg, const upb_MiniTable* msg_mini_table,
4396     const upb_MiniTableField* f, int32_t value);
4397 
4398 // BaseField Setters ///////////////////////////////////////////////////////////
4399 
4400 UPB_API_INLINE void upb_Message_SetBaseField(upb_Message* msg,
4401                                              const upb_MiniTableField* f,
4402                                              const void* val);
4403 
4404 UPB_API_INLINE void upb_Message_SetBaseFieldBool(struct upb_Message* msg,
4405                                                  const upb_MiniTableField* f,
4406                                                  bool value);
4407 
4408 UPB_API_INLINE void upb_Message_SetBaseFieldDouble(struct upb_Message* msg,
4409                                                    const upb_MiniTableField* f,
4410                                                    double value);
4411 
4412 UPB_API_INLINE void upb_Message_SetBaseFieldFloat(struct upb_Message* msg,
4413                                                   const upb_MiniTableField* f,
4414                                                   float value);
4415 
4416 UPB_API_INLINE void upb_Message_SetBaseFieldInt32(struct upb_Message* msg,
4417                                                   const upb_MiniTableField* f,
4418                                                   int32_t value);
4419 
4420 UPB_API_INLINE void upb_Message_SetBaseFieldInt64(struct upb_Message* msg,
4421                                                   const upb_MiniTableField* f,
4422                                                   int64_t value);
4423 
4424 UPB_API_INLINE void upb_Message_SetBaseFieldMessage(struct upb_Message* msg,
4425                                                     const upb_MiniTableField* f,
4426                                                     upb_Message* value);
4427 
4428 UPB_API_INLINE void upb_Message_SetBaseFieldString(struct upb_Message* msg,
4429                                                    const upb_MiniTableField* f,
4430                                                    upb_StringView value);
4431 
4432 UPB_API_INLINE void upb_Message_SetBaseFieldUInt32(struct upb_Message* msg,
4433                                                    const upb_MiniTableField* f,
4434                                                    uint32_t value);
4435 
4436 UPB_API_INLINE void upb_Message_SetBaseFieldUInt64(struct upb_Message* msg,
4437                                                    const upb_MiniTableField* f,
4438                                                    uint64_t value);
4439 
4440 // Extension Setters ///////////////////////////////////////////////////////////
4441 
4442 UPB_API_INLINE bool upb_Message_SetExtension(upb_Message* msg,
4443                                              const upb_MiniTableExtension* e,
4444                                              const void* value, upb_Arena* a);
4445 
4446 UPB_API_INLINE bool upb_Message_SetExtensionBool(
4447     struct upb_Message* msg, const upb_MiniTableExtension* e, bool value,
4448     upb_Arena* a);
4449 
4450 UPB_API_INLINE bool upb_Message_SetExtensionDouble(
4451     struct upb_Message* msg, const upb_MiniTableExtension* e, double value,
4452     upb_Arena* a);
4453 
4454 UPB_API_INLINE bool upb_Message_SetExtensionFloat(
4455     struct upb_Message* msg, const upb_MiniTableExtension* e, float value,
4456     upb_Arena* a);
4457 
4458 UPB_API_INLINE bool upb_Message_SetExtensionInt32(
4459     struct upb_Message* msg, const upb_MiniTableExtension* e, int32_t value,
4460     upb_Arena* a);
4461 
4462 UPB_API_INLINE bool upb_Message_SetExtensionInt64(
4463     struct upb_Message* msg, const upb_MiniTableExtension* e, int64_t value,
4464     upb_Arena* a);
4465 
4466 UPB_API_INLINE bool upb_Message_SetExtensionString(
4467     struct upb_Message* msg, const upb_MiniTableExtension* e,
4468     upb_StringView value, upb_Arena* a);
4469 
4470 UPB_API_INLINE bool upb_Message_SetExtensionUInt32(
4471     struct upb_Message* msg, const upb_MiniTableExtension* e, uint32_t value,
4472     upb_Arena* a);
4473 
4474 UPB_API_INLINE bool upb_Message_SetExtensionUInt64(
4475     struct upb_Message* msg, const upb_MiniTableExtension* e, uint64_t value,
4476     upb_Arena* a);
4477 
4478 // Universal Setters ///////////////////////////////////////////////////////////
4479 
4480 UPB_API_INLINE bool upb_Message_SetBool(upb_Message* msg,
4481                                         const upb_MiniTableField* f, bool value,
4482                                         upb_Arena* a);
4483 
4484 UPB_API_INLINE bool upb_Message_SetDouble(upb_Message* msg,
4485                                           const upb_MiniTableField* f,
4486                                           double value, upb_Arena* a);
4487 
4488 UPB_API_INLINE bool upb_Message_SetFloat(upb_Message* msg,
4489                                          const upb_MiniTableField* f,
4490                                          float value, upb_Arena* a);
4491 
4492 UPB_API_INLINE bool upb_Message_SetInt32(upb_Message* msg,
4493                                          const upb_MiniTableField* f,
4494                                          int32_t value, upb_Arena* a);
4495 
4496 UPB_API_INLINE bool upb_Message_SetInt64(upb_Message* msg,
4497                                          const upb_MiniTableField* f,
4498                                          int64_t value, upb_Arena* a);
4499 
4500 // Unlike the other similarly-named setters, this function can only be
4501 // called on base fields. Prefer upb_Message_SetBaseFieldMessage().
4502 UPB_API_INLINE void upb_Message_SetMessage(upb_Message* msg,
4503                                            const upb_MiniTableField* f,
4504                                            upb_Message* value);
4505 
4506 UPB_API_INLINE bool upb_Message_SetString(upb_Message* msg,
4507                                           const upb_MiniTableField* f,
4508                                           upb_StringView value, upb_Arena* a);
4509 
4510 UPB_API_INLINE bool upb_Message_SetUInt32(upb_Message* msg,
4511                                           const upb_MiniTableField* f,
4512                                           uint32_t value, upb_Arena* a);
4513 
4514 UPB_API_INLINE bool upb_Message_SetUInt64(upb_Message* msg,
4515                                           const upb_MiniTableField* f,
4516                                           uint64_t value, upb_Arena* a);
4517 
4518 ////////////////////////////////////////////////////////////////////////////////
4519 
4520 UPB_API_INLINE void* upb_Message_ResizeArrayUninitialized(
4521     upb_Message* msg, const upb_MiniTableField* f, size_t size,
4522     upb_Arena* arena);
4523 
4524 UPB_API_INLINE uint32_t upb_Message_WhichOneofFieldNumber(
4525     const upb_Message* message, const upb_MiniTableField* oneof_field);
4526 
4527 // For a field `f` which is in a oneof, return the field of that
4528 // oneof that is actually set (or NULL if none).
4529 UPB_API_INLINE const upb_MiniTableField* upb_Message_WhichOneof(
4530     const upb_Message* msg, const upb_MiniTable* m,
4531     const upb_MiniTableField* f);
4532 
4533 // Updates a map entry given an entry message.
4534 bool upb_Message_SetMapEntry(upb_Map* map, const upb_MiniTable* mini_table,
4535                              const upb_MiniTableField* field,
4536                              upb_Message* map_entry_message, upb_Arena* arena);
4537 
4538 #ifdef __cplusplus
4539 } /* extern "C" */
4540 #endif
4541 
4542 
4543 #endif  // UPB_MESSAGE_ACCESSORS_H_
4544 
4545 // These functions are only used by generated code.
4546 
4547 #ifndef UPB_MESSAGE_MAP_GENCODE_UTIL_H_
4548 #define UPB_MESSAGE_MAP_GENCODE_UTIL_H_
4549 
4550 
4551 // Must be last.
4552 
4553 #ifdef __cplusplus
4554 extern "C" {
4555 #endif
4556 
4557 // Message map operations, these get the map from the message first.
4558 
_upb_msg_map_key(const void * msg,void * key,size_t size)4559 UPB_INLINE void _upb_msg_map_key(const void* msg, void* key, size_t size) {
4560   const upb_tabent* ent = (const upb_tabent*)msg;
4561   uint32_t u32len;
4562   upb_StringView k;
4563   k.data = upb_tabstr(ent->key, &u32len);
4564   k.size = u32len;
4565   _upb_map_fromkey(k, key, size);
4566 }
4567 
_upb_msg_map_value(const void * msg,void * val,size_t size)4568 UPB_INLINE void _upb_msg_map_value(const void* msg, void* val, size_t size) {
4569   const upb_tabent* ent = (const upb_tabent*)msg;
4570   upb_value v = {ent->val.val};
4571   _upb_map_fromvalue(v, val, size);
4572 }
4573 
_upb_msg_map_set_value(void * msg,const void * val,size_t size)4574 UPB_INLINE void _upb_msg_map_set_value(void* msg, const void* val,
4575                                        size_t size) {
4576   upb_tabent* ent = (upb_tabent*)msg;
4577   // This is like _upb_map_tovalue() except the entry already exists
4578   // so we can reuse the allocated upb_StringView for string fields.
4579   if (size == UPB_MAPTYPE_STRING) {
4580     upb_StringView* strp = (upb_StringView*)(uintptr_t)ent->val.val;
4581     memcpy(strp, val, sizeof(*strp));
4582   } else {
4583     memcpy(&ent->val.val, val, size);
4584   }
4585 }
4586 
4587 #ifdef __cplusplus
4588 } /* extern "C" */
4589 #endif
4590 
4591 
4592 #endif /* UPB_MESSAGE_MAP_GENCODE_UTIL_H_ */
4593 
4594 #ifndef UPB_MINI_TABLE_DECODE_H_
4595 #define UPB_MINI_TABLE_DECODE_H_
4596 
4597 
4598 #ifndef UPB_MINI_TABLE_SUB_H_
4599 #define UPB_MINI_TABLE_SUB_H_
4600 
4601 
4602 // Must be last.
4603 
4604 typedef union upb_MiniTableSub upb_MiniTableSub;
4605 
4606 #ifdef __cplusplus
4607 extern "C" {
4608 #endif
4609 
4610 // Constructors
4611 
4612 UPB_API_INLINE upb_MiniTableSub
4613 upb_MiniTableSub_FromEnum(const upb_MiniTableEnum* subenum);
4614 
4615 UPB_API_INLINE upb_MiniTableSub
4616 upb_MiniTableSub_FromMessage(const upb_MiniTable* submsg);
4617 
4618 // Getters
4619 
4620 UPB_API_INLINE const upb_MiniTableEnum* upb_MiniTableSub_Enum(
4621     upb_MiniTableSub sub);
4622 
4623 UPB_API_INLINE const upb_MiniTable* upb_MiniTableSub_Message(
4624     upb_MiniTableSub sub);
4625 
4626 #ifdef __cplusplus
4627 } /* extern "C" */
4628 #endif
4629 
4630 
4631 #endif /* UPB_MINI_TABLE_SUB_H_ */
4632 
4633 // Export the newer headers, for legacy users.  New users should include the
4634 // more specific headers directly.
4635 // IWYU pragma: begin_exports
4636 
4637 #ifndef UPB_MINI_DESCRIPTOR_BUILD_ENUM_H_
4638 #define UPB_MINI_DESCRIPTOR_BUILD_ENUM_H_
4639 
4640 
4641 // Must be last.
4642 
4643 #ifdef __cplusplus
4644 extern "C" {
4645 #endif
4646 
4647 // Builds a upb_MiniTableEnum from an enum mini descriptor.
4648 // The mini descriptor must be for an enum, not a message.
4649 UPB_API upb_MiniTableEnum* upb_MiniTableEnum_Build(const char* data, size_t len,
4650                                                    upb_Arena* arena,
4651                                                    upb_Status* status);
4652 
4653 #ifdef __cplusplus
4654 } /* extern "C" */
4655 #endif
4656 
4657 
4658 #endif  // UPB_MINI_DESCRIPTOR_BUILD_ENUM_H_
4659 
4660 // Functions for linking MiniTables together once they are built from a
4661 // MiniDescriptor.
4662 //
4663 // These functions have names like upb_MiniTable_Link() because they operate on
4664 // MiniTables.  We put them here, rather than in the mini_table/ directory,
4665 // because they are only needed when building MiniTables from MiniDescriptors.
4666 // The interfaces in mini_table/ assume that MiniTables are immutable.
4667 
4668 #ifndef UPB_MINI_DESCRIPTOR_LINK_H_
4669 #define UPB_MINI_DESCRIPTOR_LINK_H_
4670 
4671 
4672 // Must be last.
4673 
4674 #ifdef __cplusplus
4675 extern "C" {
4676 #endif
4677 
4678 // Links a sub-message field to a MiniTable for that sub-message. If a
4679 // sub-message field is not linked, it will be treated as an unknown field
4680 // during parsing, and setting the field will not be allowed. It is possible
4681 // to link the message field later, at which point it will no longer be treated
4682 // as unknown. However there is no synchronization for this operation, which
4683 // means parallel mutation requires external synchronization.
4684 // Returns success/failure.
4685 UPB_API bool upb_MiniTable_SetSubMessage(upb_MiniTable* table,
4686                                          upb_MiniTableField* field,
4687                                          const upb_MiniTable* sub);
4688 
4689 // Links an enum field to a MiniTable for that enum.
4690 // All enum fields must be linked prior to parsing.
4691 // Returns success/failure.
4692 UPB_API bool upb_MiniTable_SetSubEnum(upb_MiniTable* table,
4693                                       upb_MiniTableField* field,
4694                                       const upb_MiniTableEnum* sub);
4695 
4696 // Returns a list of fields that require linking at runtime, to connect the
4697 // MiniTable to its sub-messages and sub-enums.  The list of fields will be
4698 // written to the `subs` array, which must have been allocated by the caller
4699 // and must be large enough to hold a list of all fields in the message.
4700 //
4701 // The order of the fields returned by this function is significant: it matches
4702 // the order expected by upb_MiniTable_Link() below.
4703 //
4704 // The return value packs the sub-message count and sub-enum count into a single
4705 // integer like so:
4706 //  return (msg_count << 16) | enum_count;
4707 UPB_API uint32_t upb_MiniTable_GetSubList(const upb_MiniTable* mt,
4708                                           const upb_MiniTableField** subs);
4709 
4710 // Links a message to its sub-messages and sub-enums.  The caller must pass
4711 // arrays of sub-tables and sub-enums, in the same length and order as is
4712 // returned by upb_MiniTable_GetSubList() above.  However, individual elements
4713 // of the sub_tables may be NULL if those sub-messages were tree shaken.
4714 //
4715 // Returns false if either array is too short, or if any of the tables fails
4716 // to link.
4717 UPB_API bool upb_MiniTable_Link(upb_MiniTable* mt,
4718                                 const upb_MiniTable** sub_tables,
4719                                 size_t sub_table_count,
4720                                 const upb_MiniTableEnum** sub_enums,
4721                                 size_t sub_enum_count);
4722 
4723 #ifdef __cplusplus
4724 } /* extern "C" */
4725 #endif
4726 
4727 
4728 #endif  // UPB_MINI_DESCRIPTOR_LINK_H_
4729 // IWYU pragma: end_exports
4730 
4731 // Must be last.
4732 
4733 typedef enum {
4734   kUpb_MiniTablePlatform_32Bit,
4735   kUpb_MiniTablePlatform_64Bit,
4736   kUpb_MiniTablePlatform_Native =
4737       UPB_SIZE(kUpb_MiniTablePlatform_32Bit, kUpb_MiniTablePlatform_64Bit),
4738 } upb_MiniTablePlatform;
4739 
4740 #ifdef __cplusplus
4741 extern "C" {
4742 #endif
4743 
4744 // Builds a mini table from the data encoded in the buffer [data, len]. If any
4745 // errors occur, returns NULL and sets a status message. In the success case,
4746 // the caller must call upb_MiniTable_SetSub*() for all message or proto2 enum
4747 // fields to link the table to the appropriate sub-tables.
4748 upb_MiniTable* _upb_MiniTable_Build(const char* data, size_t len,
4749                                     upb_MiniTablePlatform platform,
4750                                     upb_Arena* arena, upb_Status* status);
4751 
upb_MiniTable_Build(const char * data,size_t len,upb_Arena * arena,upb_Status * status)4752 UPB_API_INLINE upb_MiniTable* upb_MiniTable_Build(const char* data, size_t len,
4753                                                   upb_Arena* arena,
4754                                                   upb_Status* status) {
4755   return _upb_MiniTable_Build(data, len, kUpb_MiniTablePlatform_Native, arena,
4756                               status);
4757 }
4758 
4759 // Initializes a MiniTableExtension buffer that has already been allocated.
4760 // This is needed by upb_FileDef and upb_MessageDef, which allocate all of the
4761 // extensions together in a single contiguous array.
4762 const char* _upb_MiniTableExtension_Init(const char* data, size_t len,
4763                                          upb_MiniTableExtension* ext,
4764                                          const upb_MiniTable* extendee,
4765                                          upb_MiniTableSub sub,
4766                                          upb_MiniTablePlatform platform,
4767                                          upb_Status* status);
4768 
upb_MiniTableExtension_Init(const char * data,size_t len,upb_MiniTableExtension * ext,const upb_MiniTable * extendee,upb_MiniTableSub sub,upb_Status * status)4769 UPB_API_INLINE const char* upb_MiniTableExtension_Init(
4770     const char* data, size_t len, upb_MiniTableExtension* ext,
4771     const upb_MiniTable* extendee, upb_MiniTableSub sub, upb_Status* status) {
4772   return _upb_MiniTableExtension_Init(data, len, ext, extendee, sub,
4773                                       kUpb_MiniTablePlatform_Native, status);
4774 }
4775 
4776 UPB_API upb_MiniTableExtension* _upb_MiniTableExtension_Build(
4777     const char* data, size_t len, const upb_MiniTable* extendee,
4778     upb_MiniTableSub sub, upb_MiniTablePlatform platform, upb_Arena* arena,
4779     upb_Status* status);
4780 
upb_MiniTableExtension_Build(const char * data,size_t len,const upb_MiniTable * extendee,upb_Arena * arena,upb_Status * status)4781 UPB_API_INLINE upb_MiniTableExtension* upb_MiniTableExtension_Build(
4782     const char* data, size_t len, const upb_MiniTable* extendee,
4783     upb_Arena* arena, upb_Status* status) {
4784   upb_MiniTableSub sub = upb_MiniTableSub_FromMessage(NULL);
4785   return _upb_MiniTableExtension_Build(
4786       data, len, extendee, sub, kUpb_MiniTablePlatform_Native, arena, status);
4787 }
4788 
upb_MiniTableExtension_BuildMessage(const char * data,size_t len,const upb_MiniTable * extendee,upb_MiniTable * submsg,upb_Arena * arena,upb_Status * status)4789 UPB_API_INLINE upb_MiniTableExtension* upb_MiniTableExtension_BuildMessage(
4790     const char* data, size_t len, const upb_MiniTable* extendee,
4791     upb_MiniTable* submsg, upb_Arena* arena, upb_Status* status) {
4792   upb_MiniTableSub sub = upb_MiniTableSub_FromMessage(submsg);
4793   return _upb_MiniTableExtension_Build(
4794       data, len, extendee, sub, kUpb_MiniTablePlatform_Native, arena, status);
4795 }
4796 
upb_MiniTableExtension_BuildEnum(const char * data,size_t len,const upb_MiniTable * extendee,upb_MiniTableEnum * subenum,upb_Arena * arena,upb_Status * status)4797 UPB_API_INLINE upb_MiniTableExtension* upb_MiniTableExtension_BuildEnum(
4798     const char* data, size_t len, const upb_MiniTable* extendee,
4799     upb_MiniTableEnum* subenum, upb_Arena* arena, upb_Status* status) {
4800   upb_MiniTableSub sub = upb_MiniTableSub_FromEnum(subenum);
4801   return _upb_MiniTableExtension_Build(
4802       data, len, extendee, sub, kUpb_MiniTablePlatform_Native, arena, status);
4803 }
4804 
4805 // Like upb_MiniTable_Build(), but the user provides a buffer of layout data so
4806 // it can be reused from call to call, avoiding repeated realloc()/free().
4807 //
4808 // The caller owns `*buf` both before and after the call, and must free() it
4809 // when it is no longer in use.  The function will realloc() `*buf` as
4810 // necessary, updating `*size` accordingly.
4811 upb_MiniTable* upb_MiniTable_BuildWithBuf(const char* data, size_t len,
4812                                           upb_MiniTablePlatform platform,
4813                                           upb_Arena* arena, void** buf,
4814                                           size_t* buf_size, upb_Status* status);
4815 
4816 #ifdef __cplusplus
4817 } /* extern "C" */
4818 #endif
4819 
4820 
4821 #endif /* UPB_MINI_TABLE_DECODE_H_ */
4822 
4823 #ifndef UPB_MINI_TABLE_EXTENSION_REGISTRY_H_
4824 #define UPB_MINI_TABLE_EXTENSION_REGISTRY_H_
4825 
4826 
4827 // Must be last.
4828 
4829 #ifdef __cplusplus
4830 extern "C" {
4831 #endif
4832 
4833 /* Extension registry: a dynamic data structure that stores a map of:
4834  *   (upb_MiniTable, number) -> extension info
4835  *
4836  * upb_decode() uses upb_ExtensionRegistry to look up extensions while parsing
4837  * binary format.
4838  *
4839  * upb_ExtensionRegistry is part of the mini-table (msglayout) family of
4840  * objects. Like all mini-table objects, it is suitable for reflection-less
4841  * builds that do not want to expose names into the binary.
4842  *
4843  * Unlike most mini-table types, upb_ExtensionRegistry requires dynamic memory
4844  * allocation and dynamic initialization:
4845  * * If reflection is being used, then upb_DefPool will construct an appropriate
4846  *   upb_ExtensionRegistry automatically.
4847  * * For a mini-table only build, the user must manually construct the
4848  *   upb_ExtensionRegistry and populate it with all of the extensions the user
4849  * cares about.
4850  * * A third alternative is to manually unpack relevant extensions after the
4851  *   main parse is complete, similar to how Any works. This is perhaps the
4852  *   nicest solution from the perspective of reducing dependencies, avoiding
4853  *   dynamic memory allocation, and avoiding the need to parse uninteresting
4854  *   extensions.  The downsides are:
4855  *     (1) parse errors are not caught during the main parse
4856  *     (2) the CPU hit of parsing comes during access, which could cause an
4857  *         undesirable stutter in application performance.
4858  *
4859  * Users cannot directly get or put into this map. Users can only add the
4860  * extensions from a generated module and pass the extension registry to the
4861  * binary decoder.
4862  *
4863  * A upb_DefPool provides a upb_ExtensionRegistry, so any users who use
4864  * reflection do not need to populate a upb_ExtensionRegistry directly.
4865  */
4866 
4867 typedef struct upb_ExtensionRegistry upb_ExtensionRegistry;
4868 
4869 // Creates a upb_ExtensionRegistry in the given arena.
4870 // The arena must outlive any use of the extreg.
4871 UPB_API upb_ExtensionRegistry* upb_ExtensionRegistry_New(upb_Arena* arena);
4872 
4873 UPB_API bool upb_ExtensionRegistry_Add(upb_ExtensionRegistry* r,
4874                                        const upb_MiniTableExtension* e);
4875 
4876 // Adds the given extension info for the array |e| of size |count| into the
4877 // registry. If there are any errors, the entire array is backed out.
4878 // The extensions must outlive the registry.
4879 // Possible errors include OOM or an extension number that already exists.
4880 // TODO: There is currently no way to know the exact reason for failure.
4881 bool upb_ExtensionRegistry_AddArray(upb_ExtensionRegistry* r,
4882                                     const upb_MiniTableExtension** e,
4883                                     size_t count);
4884 
4885 #ifdef UPB_LINKARR_DECLARE
4886 
4887 // Adds all extensions linked into the binary into the registry.  The set of
4888 // linked extensions is assembled by the linker using linker arrays.  This
4889 // will likely not work properly if the extensions are split across multiple
4890 // shared libraries.
4891 //
4892 // Returns true if all extensions were added successfully, false on out of
4893 // memory or if any extensions were already present.
4894 //
4895 // This API is currently not available on MSVC (though it *is* available on
4896 // Windows using clang-cl).
4897 UPB_API bool upb_ExtensionRegistry_AddAllLinkedExtensions(
4898     upb_ExtensionRegistry* r);
4899 
4900 #endif  // UPB_LINKARR_DECLARE
4901 
4902 // Looks up the extension (if any) defined for message type |t| and field
4903 // number |num|. Returns the extension if found, otherwise NULL.
4904 UPB_API const upb_MiniTableExtension* upb_ExtensionRegistry_Lookup(
4905     const upb_ExtensionRegistry* r, const upb_MiniTable* t, uint32_t num);
4906 
4907 #ifdef __cplusplus
4908 } /* extern "C" */
4909 #endif
4910 
4911 
4912 #endif /* UPB_MINI_TABLE_EXTENSION_REGISTRY_H_ */
4913 
4914 #ifndef UPB_MINI_TABLE_FILE_H_
4915 #define UPB_MINI_TABLE_FILE_H_
4916 
4917 
4918 #ifndef UPB_MINI_TABLE_INTERNAL_FILE_H_
4919 #define UPB_MINI_TABLE_INTERNAL_FILE_H_
4920 
4921 // Must be last.
4922 
4923 struct upb_MiniTableFile {
4924   const struct upb_MiniTable** UPB_PRIVATE(msgs);
4925   const struct upb_MiniTableEnum** UPB_PRIVATE(enums);
4926   const struct upb_MiniTableExtension** UPB_PRIVATE(exts);
4927   int UPB_PRIVATE(msg_count);
4928   int UPB_PRIVATE(enum_count);
4929   int UPB_PRIVATE(ext_count);
4930 };
4931 
4932 #ifdef __cplusplus
4933 extern "C" {
4934 #endif
4935 
upb_MiniTableFile_EnumCount(const struct upb_MiniTableFile * f)4936 UPB_API_INLINE int upb_MiniTableFile_EnumCount(
4937     const struct upb_MiniTableFile* f) {
4938   return f->UPB_PRIVATE(enum_count);
4939 }
4940 
upb_MiniTableFile_ExtensionCount(const struct upb_MiniTableFile * f)4941 UPB_API_INLINE int upb_MiniTableFile_ExtensionCount(
4942     const struct upb_MiniTableFile* f) {
4943   return f->UPB_PRIVATE(ext_count);
4944 }
4945 
upb_MiniTableFile_MessageCount(const struct upb_MiniTableFile * f)4946 UPB_API_INLINE int upb_MiniTableFile_MessageCount(
4947     const struct upb_MiniTableFile* f) {
4948   return f->UPB_PRIVATE(msg_count);
4949 }
4950 
upb_MiniTableFile_Enum(const struct upb_MiniTableFile * f,int i)4951 UPB_API_INLINE const struct upb_MiniTableEnum* upb_MiniTableFile_Enum(
4952     const struct upb_MiniTableFile* f, int i) {
4953   UPB_ASSERT(i < f->UPB_PRIVATE(enum_count));
4954   return f->UPB_PRIVATE(enums)[i];
4955 }
4956 
upb_MiniTableFile_Extension(const struct upb_MiniTableFile * f,int i)4957 UPB_API_INLINE const struct upb_MiniTableExtension* upb_MiniTableFile_Extension(
4958     const struct upb_MiniTableFile* f, int i) {
4959   UPB_ASSERT(i < f->UPB_PRIVATE(ext_count));
4960   return f->UPB_PRIVATE(exts)[i];
4961 }
4962 
upb_MiniTableFile_Message(const struct upb_MiniTableFile * f,int i)4963 UPB_API_INLINE const struct upb_MiniTable* upb_MiniTableFile_Message(
4964     const struct upb_MiniTableFile* f, int i) {
4965   UPB_ASSERT(i < f->UPB_PRIVATE(msg_count));
4966   return f->UPB_PRIVATE(msgs)[i];
4967 }
4968 
4969 #ifdef __cplusplus
4970 } /* extern "C" */
4971 #endif
4972 
4973 
4974 #endif /* UPB_MINI_TABLE_INTERNAL_FILE_H_ */
4975 
4976 // Must be last.
4977 
4978 typedef struct upb_MiniTableFile upb_MiniTableFile;
4979 
4980 #ifdef __cplusplus
4981 extern "C" {
4982 #endif
4983 
4984 UPB_API_INLINE const upb_MiniTableEnum* upb_MiniTableFile_Enum(
4985     const upb_MiniTableFile* f, int i);
4986 
4987 UPB_API_INLINE int upb_MiniTableFile_EnumCount(const upb_MiniTableFile* f);
4988 
4989 UPB_API_INLINE const upb_MiniTableExtension* upb_MiniTableFile_Extension(
4990     const upb_MiniTableFile* f, int i);
4991 
4992 UPB_API_INLINE int upb_MiniTableFile_ExtensionCount(const upb_MiniTableFile* f);
4993 
4994 UPB_API_INLINE const upb_MiniTable* upb_MiniTableFile_Message(
4995     const upb_MiniTableFile* f, int i);
4996 
4997 UPB_API_INLINE int upb_MiniTableFile_MessageCount(const upb_MiniTableFile* f);
4998 
4999 #ifdef __cplusplus
5000 } /* extern "C" */
5001 #endif
5002 
5003 
5004 #endif /* UPB_MINI_TABLE_FILE_H_ */
5005 
5006 // upb_decode: parsing into a upb_Message using a upb_MiniTable.
5007 
5008 #ifndef UPB_WIRE_DECODE_H_
5009 #define UPB_WIRE_DECODE_H_
5010 
5011 #include <stddef.h>
5012 #include <stdint.h>
5013 
5014 
5015 // Must be last.
5016 
5017 #ifdef __cplusplus
5018 extern "C" {
5019 #endif
5020 
5021 enum {
5022   /* If set, strings will alias the input buffer instead of copying into the
5023    * arena. */
5024   kUpb_DecodeOption_AliasString = 1,
5025 
5026   /* If set, the parse will return failure if any message is missing any
5027    * required fields when the message data ends.  The parse will still continue,
5028    * and the failure will only be reported at the end.
5029    *
5030    * IMPORTANT CAVEATS:
5031    *
5032    * 1. This can throw a false positive failure if an incomplete message is seen
5033    *    on the wire but is later completed when the sub-message occurs again.
5034    *    For this reason, a second pass is required to verify a failure, to be
5035    *    truly robust.
5036    *
5037    * 2. This can return a false success if you are decoding into a message that
5038    *    already has some sub-message fields present.  If the sub-message does
5039    *    not occur in the binary payload, we will never visit it and discover the
5040    *    incomplete sub-message.  For this reason, this check is only useful for
5041    *    implementing ParseFromString() semantics.  For MergeFromString(), a
5042    *    post-parse validation step will always be necessary. */
5043   kUpb_DecodeOption_CheckRequired = 2,
5044 
5045   /* EXPERIMENTAL:
5046    *
5047    * If set, the parser will allow parsing of sub-message fields that were not
5048    * previously linked using upb_MiniTable_SetSubMessage().  The data will be
5049    * parsed into an internal "empty" message type that cannot be accessed
5050    * directly, but can be later promoted into the true message type if the
5051    * sub-message fields are linked at a later time.
5052    *
5053    * Users should set this option if they intend to perform dynamic tree shaking
5054    * and promoting using the interfaces in message/promote.h.  If this option is
5055    * enabled, it is important that the resulting messages are only accessed by
5056    * code that is aware of promotion rules:
5057    *
5058    * 1. Message pointers in upb_Message, upb_Array, and upb_Map are represented
5059    *    by a tagged pointer upb_TaggedMessagePointer.  The tag indicates whether
5060    *    the message uses the internal "empty" type.
5061    *
5062    * 2. Any code *reading* these message pointers must test whether the "empty"
5063    *    tag bit is set, using the interfaces in mini_table/types.h.  However
5064    *    writing of message pointers should always use plain upb_Message*, since
5065    *    users are not allowed to create "empty" messages.
5066    *
5067    * 3. It is always safe to test whether a field is present or test the array
5068    *    length; these interfaces will reflect that empty messages are present,
5069    *    even though their data cannot be accessed without promoting first.
5070    *
5071    * 4. If a message pointer is indeed tagged as empty, the message may not be
5072    *    accessed directly, only promoted through the interfaces in
5073    *    message/promote.h.
5074    *
5075    * 5. Tagged/empty messages may never be created by the user.  They may only
5076    *    be created by the parser or the message-copying logic in message/copy.h.
5077    */
5078   kUpb_DecodeOption_ExperimentalAllowUnlinked = 4,
5079 
5080   /* EXPERIMENTAL:
5081    *
5082    * If set, decoding will enforce UTF-8 validation for string fields, even for
5083    * proto2 or fields with `features.utf8_validation = NONE`. Normally, only
5084    * proto3 string fields will be validated for UTF-8. Decoding will return
5085    * kUpb_DecodeStatus_BadUtf8 for non-UTF-8 strings, which is the same behavior
5086    * as non-UTF-8 proto3 string fields.
5087    */
5088   kUpb_DecodeOption_AlwaysValidateUtf8 = 8,
5089 };
5090 
upb_DecodeOptions_MaxDepth(uint16_t depth)5091 UPB_INLINE uint32_t upb_DecodeOptions_MaxDepth(uint16_t depth) {
5092   return (uint32_t)depth << 16;
5093 }
5094 
upb_DecodeOptions_GetMaxDepth(uint32_t options)5095 UPB_INLINE uint16_t upb_DecodeOptions_GetMaxDepth(uint32_t options) {
5096   return options >> 16;
5097 }
5098 
5099 // Enforce an upper bound on recursion depth.
upb_Decode_LimitDepth(uint32_t decode_options,uint32_t limit)5100 UPB_INLINE int upb_Decode_LimitDepth(uint32_t decode_options, uint32_t limit) {
5101   uint32_t max_depth = upb_DecodeOptions_GetMaxDepth(decode_options);
5102   if (max_depth > limit) max_depth = limit;
5103   return upb_DecodeOptions_MaxDepth(max_depth) | (decode_options & 0xffff);
5104 }
5105 
5106 // LINT.IfChange
5107 typedef enum {
5108   kUpb_DecodeStatus_Ok = 0,
5109   kUpb_DecodeStatus_Malformed = 1,    // Wire format was corrupt
5110   kUpb_DecodeStatus_OutOfMemory = 2,  // Arena alloc failed
5111   kUpb_DecodeStatus_BadUtf8 = 3,      // String field had bad UTF-8
5112   kUpb_DecodeStatus_MaxDepthExceeded =
5113       4,  // Exceeded upb_DecodeOptions_MaxDepth
5114 
5115   // kUpb_DecodeOption_CheckRequired failed (see above), but the parse otherwise
5116   // succeeded.
5117   kUpb_DecodeStatus_MissingRequired = 5,
5118 
5119   // Unlinked sub-message field was present, but
5120   // kUpb_DecodeOptions_ExperimentalAllowUnlinked was not specified in the list
5121   // of options.
5122   kUpb_DecodeStatus_UnlinkedSubMessage = 6,
5123 } upb_DecodeStatus;
5124 // LINT.ThenChange(//depot/google3/third_party/protobuf/rust/upb.rs:decode_status)
5125 
5126 UPB_API upb_DecodeStatus upb_Decode(const char* buf, size_t size,
5127                                     upb_Message* msg, const upb_MiniTable* mt,
5128                                     const upb_ExtensionRegistry* extreg,
5129                                     int options, upb_Arena* arena);
5130 
5131 // Same as upb_Decode but with a varint-encoded length prepended.
5132 // On success 'num_bytes_read' will be set to the how many bytes were read,
5133 // on failure the contents of num_bytes_read is undefined.
5134 UPB_API upb_DecodeStatus upb_DecodeLengthPrefixed(
5135     const char* buf, size_t size, upb_Message* msg, size_t* num_bytes_read,
5136     const upb_MiniTable* mt, const upb_ExtensionRegistry* extreg, int options,
5137     upb_Arena* arena);
5138 
5139 // Utility function for wrapper languages to get an error string from a
5140 // upb_DecodeStatus.
5141 UPB_API const char* upb_DecodeStatus_String(upb_DecodeStatus status);
5142 #ifdef __cplusplus
5143 } /* extern "C" */
5144 #endif
5145 
5146 
5147 #endif /* UPB_WIRE_DECODE_H_ */
5148 
5149 // upb_Encode: parsing from a upb_Message using a upb_MiniTable.
5150 
5151 #ifndef UPB_WIRE_ENCODE_H_
5152 #define UPB_WIRE_ENCODE_H_
5153 
5154 #include <stddef.h>
5155 #include <stdint.h>
5156 
5157 
5158 // Must be last.
5159 
5160 #ifdef __cplusplus
5161 extern "C" {
5162 #endif
5163 
5164 enum {
5165   /* If set, the results of serializing will be deterministic across all
5166    * instances of this binary. There are no guarantees across different
5167    * binary builds.
5168    *
5169    * If your proto contains maps, the encoder will need to malloc()/free()
5170    * memory during encode. */
5171   kUpb_EncodeOption_Deterministic = 1,
5172 
5173   // When set, unknown fields are not encoded.
5174   kUpb_EncodeOption_SkipUnknown = 2,
5175 
5176   // When set, the encode will fail if any required fields are missing.
5177   kUpb_EncodeOption_CheckRequired = 4,
5178 };
5179 
5180 // LINT.IfChange
5181 typedef enum {
5182   kUpb_EncodeStatus_Ok = 0,
5183   kUpb_EncodeStatus_OutOfMemory = 1,  // Arena alloc failed
5184   kUpb_EncodeStatus_MaxDepthExceeded = 2,
5185 
5186   // kUpb_EncodeOption_CheckRequired failed but the parse otherwise succeeded.
5187   kUpb_EncodeStatus_MissingRequired = 3,
5188 } upb_EncodeStatus;
5189 // LINT.ThenChange(//depot/google3/third_party/protobuf/rust/upb.rs:encode_status)
5190 
upb_EncodeOptions_MaxDepth(uint16_t depth)5191 UPB_INLINE uint32_t upb_EncodeOptions_MaxDepth(uint16_t depth) {
5192   return (uint32_t)depth << 16;
5193 }
5194 
upb_EncodeOptions_GetMaxDepth(uint32_t options)5195 UPB_INLINE uint16_t upb_EncodeOptions_GetMaxDepth(uint32_t options) {
5196   return options >> 16;
5197 }
5198 
5199 // Enforce an upper bound on recursion depth.
upb_Encode_LimitDepth(uint32_t encode_options,uint32_t limit)5200 UPB_INLINE int upb_Encode_LimitDepth(uint32_t encode_options, uint32_t limit) {
5201   uint32_t max_depth = upb_EncodeOptions_GetMaxDepth(encode_options);
5202   if (max_depth > limit) max_depth = limit;
5203   return upb_EncodeOptions_MaxDepth(max_depth) | (encode_options & 0xffff);
5204 }
5205 
5206 UPB_API upb_EncodeStatus upb_Encode(const upb_Message* msg,
5207                                     const upb_MiniTable* l, int options,
5208                                     upb_Arena* arena, char** buf, size_t* size);
5209 
5210 // Encodes the message prepended by a varint of the serialized length.
5211 UPB_API upb_EncodeStatus upb_EncodeLengthPrefixed(const upb_Message* msg,
5212                                                   const upb_MiniTable* l,
5213                                                   int options, upb_Arena* arena,
5214                                                   char** buf, size_t* size);
5215 // Utility function for wrapper languages to get an error string from a
5216 // upb_EncodeStatus.
5217 UPB_API const char* upb_EncodeStatus_String(upb_EncodeStatus status);
5218 
5219 #ifdef __cplusplus
5220 } /* extern "C" */
5221 #endif
5222 
5223 
5224 #endif /* UPB_WIRE_ENCODE_H_ */
5225 
5226 // These are the specialized field parser functions for the fast parser.
5227 // Generated tables will refer to these by name.
5228 //
5229 // The function names are encoded with names like:
5230 //
5231 //   //  123 4
5232 //   upb_pss_1bt();   // Parse singular string, 1 byte tag.
5233 //
5234 // In position 1:
5235 //   - 'p' for parse, most function use this
5236 //   - 'c' for copy, for when we are copying strings instead of aliasing
5237 //
5238 // In position 2 (cardinality):
5239 //   - 's' for singular, with or without hasbit
5240 //   - 'o' for oneof
5241 //   - 'r' for non-packed repeated
5242 //   - 'p' for packed repeated
5243 //
5244 // In position 3 (type):
5245 //   - 'b1' for bool
5246 //   - 'v4' for 4-byte varint
5247 //   - 'v8' for 8-byte varint
5248 //   - 'z4' for zig-zag-encoded 4-byte varint
5249 //   - 'z8' for zig-zag-encoded 8-byte varint
5250 //   - 'f4' for 4-byte fixed
5251 //   - 'f8' for 8-byte fixed
5252 //   - 'm' for sub-message
5253 //   - 's' for string (validate UTF-8)
5254 //   - 'b' for bytes
5255 //
5256 // In position 4 (tag length):
5257 //   - '1' for one-byte tags (field numbers 1-15)
5258 //   - '2' for two-byte tags (field numbers 16-2048)
5259 
5260 #ifndef UPB_WIRE_INTERNAL_DECODE_FAST_H_
5261 #define UPB_WIRE_INTERNAL_DECODE_FAST_H_
5262 
5263 
5264 // Must be last.
5265 
5266 #ifdef __cplusplus
5267 extern "C" {
5268 #endif
5269 
5270 struct upb_Decoder;
5271 
5272 // The fallback, generic parsing function that can handle any field type.
5273 // This just uses the regular (non-fast) parser to parse a single field.
5274 const char* _upb_FastDecoder_DecodeGeneric(struct upb_Decoder* d,
5275                                            const char* ptr, upb_Message* msg,
5276                                            intptr_t table, uint64_t hasbits,
5277                                            uint64_t data);
5278 
5279 #define UPB_PARSE_PARAMS                                                    \
5280   struct upb_Decoder *d, const char *ptr, upb_Message *msg, intptr_t table, \
5281       uint64_t hasbits, uint64_t data
5282 
5283 /* primitive fields ***********************************************************/
5284 
5285 #define F(card, type, valbytes, tagbytes) \
5286   const char* upb_p##card##type##valbytes##_##tagbytes##bt(UPB_PARSE_PARAMS);
5287 
5288 #define TYPES(card, tagbytes) \
5289   F(card, b, 1, tagbytes)     \
5290   F(card, v, 4, tagbytes)     \
5291   F(card, v, 8, tagbytes)     \
5292   F(card, z, 4, tagbytes)     \
5293   F(card, z, 8, tagbytes)     \
5294   F(card, f, 4, tagbytes)     \
5295   F(card, f, 8, tagbytes)
5296 
5297 #define TAGBYTES(card) \
5298   TYPES(card, 1)       \
5299   TYPES(card, 2)
5300 
5301 TAGBYTES(s)
5302 TAGBYTES(o)
5303 TAGBYTES(r)
5304 TAGBYTES(p)
5305 
5306 #undef F
5307 #undef TYPES
5308 #undef TAGBYTES
5309 
5310 /* string fields **************************************************************/
5311 
5312 #define F(card, tagbytes, type)                                     \
5313   const char* upb_p##card##type##_##tagbytes##bt(UPB_PARSE_PARAMS); \
5314   const char* upb_c##card##type##_##tagbytes##bt(UPB_PARSE_PARAMS);
5315 
5316 #define UTF8(card, tagbytes) \
5317   F(card, tagbytes, s)       \
5318   F(card, tagbytes, b)
5319 
5320 #define TAGBYTES(card) \
5321   UTF8(card, 1)        \
5322   UTF8(card, 2)
5323 
5324 TAGBYTES(s)
5325 TAGBYTES(o)
5326 TAGBYTES(r)
5327 
5328 #undef F
5329 #undef UTF8
5330 #undef TAGBYTES
5331 
5332 /* sub-message fields *********************************************************/
5333 
5334 #define F(card, tagbytes, size_ceil, ceil_arg) \
5335   const char* upb_p##card##m_##tagbytes##bt_max##size_ceil##b(UPB_PARSE_PARAMS);
5336 
5337 #define SIZES(card, tagbytes) \
5338   F(card, tagbytes, 64, 64)   \
5339   F(card, tagbytes, 128, 128) \
5340   F(card, tagbytes, 192, 192) \
5341   F(card, tagbytes, 256, 256) \
5342   F(card, tagbytes, max, -1)
5343 
5344 #define TAGBYTES(card) \
5345   SIZES(card, 1)       \
5346   SIZES(card, 2)
5347 
5348 TAGBYTES(s)
5349 TAGBYTES(o)
5350 TAGBYTES(r)
5351 
5352 #undef F
5353 #undef SIZES
5354 #undef TAGBYTES
5355 
5356 #undef UPB_PARSE_PARAMS
5357 
5358 #ifdef __cplusplus
5359 } /* extern "C" */
5360 #endif
5361 
5362 
5363 #endif /* UPB_WIRE_INTERNAL_DECODE_FAST_H_ */
5364 // IWYU pragma: end_exports
5365 
5366 #endif  // UPB_GENERATED_CODE_SUPPORT_H_
5367 
5368 /* This file was generated by upb_generator from the input file:
5369  *
5370  *     google/protobuf/descriptor.proto
5371  *
5372  * Do not edit -- your changes will be discarded when the file is
5373  * regenerated.
5374  * NO CHECKED-IN PROTOBUF GENCODE */
5375 
5376 #ifndef GOOGLE_PROTOBUF_DESCRIPTOR_PROTO_UPB_H__UPB_MINITABLE_H_
5377 #define GOOGLE_PROTOBUF_DESCRIPTOR_PROTO_UPB_H__UPB_MINITABLE_H_
5378 
5379 
5380 // Must be last.
5381 
5382 #ifdef __cplusplus
5383 extern "C" {
5384 #endif
5385 
5386 extern const upb_MiniTable google__protobuf__FileDescriptorSet_msg_init;
5387 extern const upb_MiniTable* google__protobuf__FileDescriptorSet_msg_init_ptr;
5388 extern const upb_MiniTable google__protobuf__FileDescriptorProto_msg_init;
5389 extern const upb_MiniTable* google__protobuf__FileDescriptorProto_msg_init_ptr;
5390 extern const upb_MiniTable google__protobuf__DescriptorProto_msg_init;
5391 extern const upb_MiniTable* google__protobuf__DescriptorProto_msg_init_ptr;
5392 extern const upb_MiniTable google__protobuf__DescriptorProto__ExtensionRange_msg_init;
5393 extern const upb_MiniTable* google__protobuf__DescriptorProto__ExtensionRange_msg_init_ptr;
5394 extern const upb_MiniTable google__protobuf__DescriptorProto__ReservedRange_msg_init;
5395 extern const upb_MiniTable* google__protobuf__DescriptorProto__ReservedRange_msg_init_ptr;
5396 extern const upb_MiniTable google__protobuf__ExtensionRangeOptions_msg_init;
5397 extern const upb_MiniTable* google__protobuf__ExtensionRangeOptions_msg_init_ptr;
5398 extern const upb_MiniTable google__protobuf__ExtensionRangeOptions__Declaration_msg_init;
5399 extern const upb_MiniTable* google__protobuf__ExtensionRangeOptions__Declaration_msg_init_ptr;
5400 extern const upb_MiniTable google__protobuf__FieldDescriptorProto_msg_init;
5401 extern const upb_MiniTable* google__protobuf__FieldDescriptorProto_msg_init_ptr;
5402 extern const upb_MiniTable google__protobuf__OneofDescriptorProto_msg_init;
5403 extern const upb_MiniTable* google__protobuf__OneofDescriptorProto_msg_init_ptr;
5404 extern const upb_MiniTable google__protobuf__EnumDescriptorProto_msg_init;
5405 extern const upb_MiniTable* google__protobuf__EnumDescriptorProto_msg_init_ptr;
5406 extern const upb_MiniTable google__protobuf__EnumDescriptorProto__EnumReservedRange_msg_init;
5407 extern const upb_MiniTable* google__protobuf__EnumDescriptorProto__EnumReservedRange_msg_init_ptr;
5408 extern const upb_MiniTable google__protobuf__EnumValueDescriptorProto_msg_init;
5409 extern const upb_MiniTable* google__protobuf__EnumValueDescriptorProto_msg_init_ptr;
5410 extern const upb_MiniTable google__protobuf__ServiceDescriptorProto_msg_init;
5411 extern const upb_MiniTable* google__protobuf__ServiceDescriptorProto_msg_init_ptr;
5412 extern const upb_MiniTable google__protobuf__MethodDescriptorProto_msg_init;
5413 extern const upb_MiniTable* google__protobuf__MethodDescriptorProto_msg_init_ptr;
5414 extern const upb_MiniTable google__protobuf__FileOptions_msg_init;
5415 extern const upb_MiniTable* google__protobuf__FileOptions_msg_init_ptr;
5416 extern const upb_MiniTable google__protobuf__MessageOptions_msg_init;
5417 extern const upb_MiniTable* google__protobuf__MessageOptions_msg_init_ptr;
5418 extern const upb_MiniTable google__protobuf__FieldOptions_msg_init;
5419 extern const upb_MiniTable* google__protobuf__FieldOptions_msg_init_ptr;
5420 extern const upb_MiniTable google__protobuf__FieldOptions__EditionDefault_msg_init;
5421 extern const upb_MiniTable* google__protobuf__FieldOptions__EditionDefault_msg_init_ptr;
5422 extern const upb_MiniTable google__protobuf__FieldOptions__FeatureSupport_msg_init;
5423 extern const upb_MiniTable* google__protobuf__FieldOptions__FeatureSupport_msg_init_ptr;
5424 extern const upb_MiniTable google__protobuf__OneofOptions_msg_init;
5425 extern const upb_MiniTable* google__protobuf__OneofOptions_msg_init_ptr;
5426 extern const upb_MiniTable google__protobuf__EnumOptions_msg_init;
5427 extern const upb_MiniTable* google__protobuf__EnumOptions_msg_init_ptr;
5428 extern const upb_MiniTable google__protobuf__EnumValueOptions_msg_init;
5429 extern const upb_MiniTable* google__protobuf__EnumValueOptions_msg_init_ptr;
5430 extern const upb_MiniTable google__protobuf__ServiceOptions_msg_init;
5431 extern const upb_MiniTable* google__protobuf__ServiceOptions_msg_init_ptr;
5432 extern const upb_MiniTable google__protobuf__MethodOptions_msg_init;
5433 extern const upb_MiniTable* google__protobuf__MethodOptions_msg_init_ptr;
5434 extern const upb_MiniTable google__protobuf__UninterpretedOption_msg_init;
5435 extern const upb_MiniTable* google__protobuf__UninterpretedOption_msg_init_ptr;
5436 extern const upb_MiniTable google__protobuf__UninterpretedOption__NamePart_msg_init;
5437 extern const upb_MiniTable* google__protobuf__UninterpretedOption__NamePart_msg_init_ptr;
5438 extern const upb_MiniTable google__protobuf__FeatureSet_msg_init;
5439 extern const upb_MiniTable* google__protobuf__FeatureSet_msg_init_ptr;
5440 extern const upb_MiniTable google__protobuf__FeatureSetDefaults_msg_init;
5441 extern const upb_MiniTable* google__protobuf__FeatureSetDefaults_msg_init_ptr;
5442 extern const upb_MiniTable google__protobuf__FeatureSetDefaults__FeatureSetEditionDefault_msg_init;
5443 extern const upb_MiniTable* google__protobuf__FeatureSetDefaults__FeatureSetEditionDefault_msg_init_ptr;
5444 extern const upb_MiniTable google__protobuf__SourceCodeInfo_msg_init;
5445 extern const upb_MiniTable* google__protobuf__SourceCodeInfo_msg_init_ptr;
5446 extern const upb_MiniTable google__protobuf__SourceCodeInfo__Location_msg_init;
5447 extern const upb_MiniTable* google__protobuf__SourceCodeInfo__Location_msg_init_ptr;
5448 extern const upb_MiniTable google__protobuf__GeneratedCodeInfo_msg_init;
5449 extern const upb_MiniTable* google__protobuf__GeneratedCodeInfo_msg_init_ptr;
5450 extern const upb_MiniTable google__protobuf__GeneratedCodeInfo__Annotation_msg_init;
5451 extern const upb_MiniTable* google__protobuf__GeneratedCodeInfo__Annotation_msg_init_ptr;
5452 
5453 extern const upb_MiniTableEnum google__protobuf__Edition_enum_init;
5454 extern const upb_MiniTableEnum google__protobuf__ExtensionRangeOptions__VerificationState_enum_init;
5455 extern const upb_MiniTableEnum google__protobuf__FeatureSet__EnumType_enum_init;
5456 extern const upb_MiniTableEnum google__protobuf__FeatureSet__FieldPresence_enum_init;
5457 extern const upb_MiniTableEnum google__protobuf__FeatureSet__JsonFormat_enum_init;
5458 extern const upb_MiniTableEnum google__protobuf__FeatureSet__MessageEncoding_enum_init;
5459 extern const upb_MiniTableEnum google__protobuf__FeatureSet__RepeatedFieldEncoding_enum_init;
5460 extern const upb_MiniTableEnum google__protobuf__FeatureSet__Utf8Validation_enum_init;
5461 extern const upb_MiniTableEnum google__protobuf__FieldDescriptorProto__Label_enum_init;
5462 extern const upb_MiniTableEnum google__protobuf__FieldDescriptorProto__Type_enum_init;
5463 extern const upb_MiniTableEnum google__protobuf__FieldOptions__CType_enum_init;
5464 extern const upb_MiniTableEnum google__protobuf__FieldOptions__JSType_enum_init;
5465 extern const upb_MiniTableEnum google__protobuf__FieldOptions__OptionRetention_enum_init;
5466 extern const upb_MiniTableEnum google__protobuf__FieldOptions__OptionTargetType_enum_init;
5467 extern const upb_MiniTableEnum google__protobuf__FileOptions__OptimizeMode_enum_init;
5468 extern const upb_MiniTableEnum google__protobuf__GeneratedCodeInfo__Annotation__Semantic_enum_init;
5469 extern const upb_MiniTableEnum google__protobuf__MethodOptions__IdempotencyLevel_enum_init;
5470 extern const upb_MiniTableFile google_protobuf_descriptor_proto_upb_file_layout;
5471 
5472 #ifdef __cplusplus
5473 }  /* extern "C" */
5474 #endif
5475 
5476 
5477 #endif  /* GOOGLE_PROTOBUF_DESCRIPTOR_PROTO_UPB_H__UPB_MINITABLE_H_ */
5478 
5479 
5480 // Must be last.
5481 
5482 #ifdef __cplusplus
5483 extern "C" {
5484 #endif
5485 
5486 typedef struct google_protobuf_FileDescriptorSet { upb_Message UPB_PRIVATE(base); } google_protobuf_FileDescriptorSet;
5487 typedef struct google_protobuf_FileDescriptorProto { upb_Message UPB_PRIVATE(base); } google_protobuf_FileDescriptorProto;
5488 typedef struct google_protobuf_DescriptorProto { upb_Message UPB_PRIVATE(base); } google_protobuf_DescriptorProto;
5489 typedef struct google_protobuf_DescriptorProto_ExtensionRange { upb_Message UPB_PRIVATE(base); } google_protobuf_DescriptorProto_ExtensionRange;
5490 typedef struct google_protobuf_DescriptorProto_ReservedRange { upb_Message UPB_PRIVATE(base); } google_protobuf_DescriptorProto_ReservedRange;
5491 typedef struct google_protobuf_ExtensionRangeOptions { upb_Message UPB_PRIVATE(base); } google_protobuf_ExtensionRangeOptions;
5492 typedef struct google_protobuf_ExtensionRangeOptions_Declaration { upb_Message UPB_PRIVATE(base); } google_protobuf_ExtensionRangeOptions_Declaration;
5493 typedef struct google_protobuf_FieldDescriptorProto { upb_Message UPB_PRIVATE(base); } google_protobuf_FieldDescriptorProto;
5494 typedef struct google_protobuf_OneofDescriptorProto { upb_Message UPB_PRIVATE(base); } google_protobuf_OneofDescriptorProto;
5495 typedef struct google_protobuf_EnumDescriptorProto { upb_Message UPB_PRIVATE(base); } google_protobuf_EnumDescriptorProto;
5496 typedef struct google_protobuf_EnumDescriptorProto_EnumReservedRange { upb_Message UPB_PRIVATE(base); } google_protobuf_EnumDescriptorProto_EnumReservedRange;
5497 typedef struct google_protobuf_EnumValueDescriptorProto { upb_Message UPB_PRIVATE(base); } google_protobuf_EnumValueDescriptorProto;
5498 typedef struct google_protobuf_ServiceDescriptorProto { upb_Message UPB_PRIVATE(base); } google_protobuf_ServiceDescriptorProto;
5499 typedef struct google_protobuf_MethodDescriptorProto { upb_Message UPB_PRIVATE(base); } google_protobuf_MethodDescriptorProto;
5500 typedef struct google_protobuf_FileOptions { upb_Message UPB_PRIVATE(base); } google_protobuf_FileOptions;
5501 typedef struct google_protobuf_MessageOptions { upb_Message UPB_PRIVATE(base); } google_protobuf_MessageOptions;
5502 typedef struct google_protobuf_FieldOptions { upb_Message UPB_PRIVATE(base); } google_protobuf_FieldOptions;
5503 typedef struct google_protobuf_FieldOptions_EditionDefault { upb_Message UPB_PRIVATE(base); } google_protobuf_FieldOptions_EditionDefault;
5504 typedef struct google_protobuf_FieldOptions_FeatureSupport { upb_Message UPB_PRIVATE(base); } google_protobuf_FieldOptions_FeatureSupport;
5505 typedef struct google_protobuf_OneofOptions { upb_Message UPB_PRIVATE(base); } google_protobuf_OneofOptions;
5506 typedef struct google_protobuf_EnumOptions { upb_Message UPB_PRIVATE(base); } google_protobuf_EnumOptions;
5507 typedef struct google_protobuf_EnumValueOptions { upb_Message UPB_PRIVATE(base); } google_protobuf_EnumValueOptions;
5508 typedef struct google_protobuf_ServiceOptions { upb_Message UPB_PRIVATE(base); } google_protobuf_ServiceOptions;
5509 typedef struct google_protobuf_MethodOptions { upb_Message UPB_PRIVATE(base); } google_protobuf_MethodOptions;
5510 typedef struct google_protobuf_UninterpretedOption { upb_Message UPB_PRIVATE(base); } google_protobuf_UninterpretedOption;
5511 typedef struct google_protobuf_UninterpretedOption_NamePart { upb_Message UPB_PRIVATE(base); } google_protobuf_UninterpretedOption_NamePart;
5512 typedef struct google_protobuf_FeatureSet { upb_Message UPB_PRIVATE(base); } google_protobuf_FeatureSet;
5513 typedef struct google_protobuf_FeatureSetDefaults { upb_Message UPB_PRIVATE(base); } google_protobuf_FeatureSetDefaults;
5514 typedef struct google_protobuf_FeatureSetDefaults_FeatureSetEditionDefault { upb_Message UPB_PRIVATE(base); } google_protobuf_FeatureSetDefaults_FeatureSetEditionDefault;
5515 typedef struct google_protobuf_SourceCodeInfo { upb_Message UPB_PRIVATE(base); } google_protobuf_SourceCodeInfo;
5516 typedef struct google_protobuf_SourceCodeInfo_Location { upb_Message UPB_PRIVATE(base); } google_protobuf_SourceCodeInfo_Location;
5517 typedef struct google_protobuf_GeneratedCodeInfo { upb_Message UPB_PRIVATE(base); } google_protobuf_GeneratedCodeInfo;
5518 typedef struct google_protobuf_GeneratedCodeInfo_Annotation { upb_Message UPB_PRIVATE(base); } google_protobuf_GeneratedCodeInfo_Annotation;
5519 
5520 typedef enum {
5521   google_protobuf_EDITION_UNKNOWN = 0,
5522   google_protobuf_EDITION_1_TEST_ONLY = 1,
5523   google_protobuf_EDITION_2_TEST_ONLY = 2,
5524   google_protobuf_EDITION_LEGACY = 900,
5525   google_protobuf_EDITION_PROTO2 = 998,
5526   google_protobuf_EDITION_PROTO3 = 999,
5527   google_protobuf_EDITION_2023 = 1000,
5528   google_protobuf_EDITION_2024 = 1001,
5529   google_protobuf_EDITION_99997_TEST_ONLY = 99997,
5530   google_protobuf_EDITION_99998_TEST_ONLY = 99998,
5531   google_protobuf_EDITION_99999_TEST_ONLY = 99999,
5532   google_protobuf_EDITION_MAX = 2147483647
5533 } google_protobuf_Edition;
5534 
5535 typedef enum {
5536   google_protobuf_ExtensionRangeOptions_DECLARATION = 0,
5537   google_protobuf_ExtensionRangeOptions_UNVERIFIED = 1
5538 } google_protobuf_ExtensionRangeOptions_VerificationState;
5539 
5540 typedef enum {
5541   google_protobuf_FeatureSet_ENUM_TYPE_UNKNOWN = 0,
5542   google_protobuf_FeatureSet_OPEN = 1,
5543   google_protobuf_FeatureSet_CLOSED = 2
5544 } google_protobuf_FeatureSet_EnumType;
5545 
5546 typedef enum {
5547   google_protobuf_FeatureSet_FIELD_PRESENCE_UNKNOWN = 0,
5548   google_protobuf_FeatureSet_EXPLICIT = 1,
5549   google_protobuf_FeatureSet_IMPLICIT = 2,
5550   google_protobuf_FeatureSet_LEGACY_REQUIRED = 3
5551 } google_protobuf_FeatureSet_FieldPresence;
5552 
5553 typedef enum {
5554   google_protobuf_FeatureSet_JSON_FORMAT_UNKNOWN = 0,
5555   google_protobuf_FeatureSet_ALLOW = 1,
5556   google_protobuf_FeatureSet_LEGACY_BEST_EFFORT = 2
5557 } google_protobuf_FeatureSet_JsonFormat;
5558 
5559 typedef enum {
5560   google_protobuf_FeatureSet_MESSAGE_ENCODING_UNKNOWN = 0,
5561   google_protobuf_FeatureSet_LENGTH_PREFIXED = 1,
5562   google_protobuf_FeatureSet_DELIMITED = 2
5563 } google_protobuf_FeatureSet_MessageEncoding;
5564 
5565 typedef enum {
5566   google_protobuf_FeatureSet_REPEATED_FIELD_ENCODING_UNKNOWN = 0,
5567   google_protobuf_FeatureSet_PACKED = 1,
5568   google_protobuf_FeatureSet_EXPANDED = 2
5569 } google_protobuf_FeatureSet_RepeatedFieldEncoding;
5570 
5571 typedef enum {
5572   google_protobuf_FeatureSet_UTF8_VALIDATION_UNKNOWN = 0,
5573   google_protobuf_FeatureSet_VERIFY = 2,
5574   google_protobuf_FeatureSet_NONE = 3
5575 } google_protobuf_FeatureSet_Utf8Validation;
5576 
5577 typedef enum {
5578   google_protobuf_FieldDescriptorProto_LABEL_OPTIONAL = 1,
5579   google_protobuf_FieldDescriptorProto_LABEL_REQUIRED = 2,
5580   google_protobuf_FieldDescriptorProto_LABEL_REPEATED = 3
5581 } google_protobuf_FieldDescriptorProto_Label;
5582 
5583 typedef enum {
5584   google_protobuf_FieldDescriptorProto_TYPE_DOUBLE = 1,
5585   google_protobuf_FieldDescriptorProto_TYPE_FLOAT = 2,
5586   google_protobuf_FieldDescriptorProto_TYPE_INT64 = 3,
5587   google_protobuf_FieldDescriptorProto_TYPE_UINT64 = 4,
5588   google_protobuf_FieldDescriptorProto_TYPE_INT32 = 5,
5589   google_protobuf_FieldDescriptorProto_TYPE_FIXED64 = 6,
5590   google_protobuf_FieldDescriptorProto_TYPE_FIXED32 = 7,
5591   google_protobuf_FieldDescriptorProto_TYPE_BOOL = 8,
5592   google_protobuf_FieldDescriptorProto_TYPE_STRING = 9,
5593   google_protobuf_FieldDescriptorProto_TYPE_GROUP = 10,
5594   google_protobuf_FieldDescriptorProto_TYPE_MESSAGE = 11,
5595   google_protobuf_FieldDescriptorProto_TYPE_BYTES = 12,
5596   google_protobuf_FieldDescriptorProto_TYPE_UINT32 = 13,
5597   google_protobuf_FieldDescriptorProto_TYPE_ENUM = 14,
5598   google_protobuf_FieldDescriptorProto_TYPE_SFIXED32 = 15,
5599   google_protobuf_FieldDescriptorProto_TYPE_SFIXED64 = 16,
5600   google_protobuf_FieldDescriptorProto_TYPE_SINT32 = 17,
5601   google_protobuf_FieldDescriptorProto_TYPE_SINT64 = 18
5602 } google_protobuf_FieldDescriptorProto_Type;
5603 
5604 typedef enum {
5605   google_protobuf_FieldOptions_STRING = 0,
5606   google_protobuf_FieldOptions_CORD = 1,
5607   google_protobuf_FieldOptions_STRING_PIECE = 2
5608 } google_protobuf_FieldOptions_CType;
5609 
5610 typedef enum {
5611   google_protobuf_FieldOptions_JS_NORMAL = 0,
5612   google_protobuf_FieldOptions_JS_STRING = 1,
5613   google_protobuf_FieldOptions_JS_NUMBER = 2
5614 } google_protobuf_FieldOptions_JSType;
5615 
5616 typedef enum {
5617   google_protobuf_FieldOptions_RETENTION_UNKNOWN = 0,
5618   google_protobuf_FieldOptions_RETENTION_RUNTIME = 1,
5619   google_protobuf_FieldOptions_RETENTION_SOURCE = 2
5620 } google_protobuf_FieldOptions_OptionRetention;
5621 
5622 typedef enum {
5623   google_protobuf_FieldOptions_TARGET_TYPE_UNKNOWN = 0,
5624   google_protobuf_FieldOptions_TARGET_TYPE_FILE = 1,
5625   google_protobuf_FieldOptions_TARGET_TYPE_EXTENSION_RANGE = 2,
5626   google_protobuf_FieldOptions_TARGET_TYPE_MESSAGE = 3,
5627   google_protobuf_FieldOptions_TARGET_TYPE_FIELD = 4,
5628   google_protobuf_FieldOptions_TARGET_TYPE_ONEOF = 5,
5629   google_protobuf_FieldOptions_TARGET_TYPE_ENUM = 6,
5630   google_protobuf_FieldOptions_TARGET_TYPE_ENUM_ENTRY = 7,
5631   google_protobuf_FieldOptions_TARGET_TYPE_SERVICE = 8,
5632   google_protobuf_FieldOptions_TARGET_TYPE_METHOD = 9
5633 } google_protobuf_FieldOptions_OptionTargetType;
5634 
5635 typedef enum {
5636   google_protobuf_FileOptions_SPEED = 1,
5637   google_protobuf_FileOptions_CODE_SIZE = 2,
5638   google_protobuf_FileOptions_LITE_RUNTIME = 3
5639 } google_protobuf_FileOptions_OptimizeMode;
5640 
5641 typedef enum {
5642   google_protobuf_GeneratedCodeInfo_Annotation_NONE = 0,
5643   google_protobuf_GeneratedCodeInfo_Annotation_SET = 1,
5644   google_protobuf_GeneratedCodeInfo_Annotation_ALIAS = 2
5645 } google_protobuf_GeneratedCodeInfo_Annotation_Semantic;
5646 
5647 typedef enum {
5648   google_protobuf_MethodOptions_IDEMPOTENCY_UNKNOWN = 0,
5649   google_protobuf_MethodOptions_NO_SIDE_EFFECTS = 1,
5650   google_protobuf_MethodOptions_IDEMPOTENT = 2
5651 } google_protobuf_MethodOptions_IdempotencyLevel;
5652 
5653 
5654 
5655 /* google.protobuf.FileDescriptorSet */
5656 
google_protobuf_FileDescriptorSet_new(upb_Arena * arena)5657 UPB_INLINE google_protobuf_FileDescriptorSet* google_protobuf_FileDescriptorSet_new(upb_Arena* arena) {
5658   return (google_protobuf_FileDescriptorSet*)_upb_Message_New(&google__protobuf__FileDescriptorSet_msg_init, arena);
5659 }
google_protobuf_FileDescriptorSet_parse(const char * buf,size_t size,upb_Arena * arena)5660 UPB_INLINE google_protobuf_FileDescriptorSet* google_protobuf_FileDescriptorSet_parse(const char* buf, size_t size, upb_Arena* arena) {
5661   google_protobuf_FileDescriptorSet* ret = google_protobuf_FileDescriptorSet_new(arena);
5662   if (!ret) return NULL;
5663   if (upb_Decode(buf, size, UPB_UPCAST(ret), &google__protobuf__FileDescriptorSet_msg_init, NULL, 0, arena) !=
5664       kUpb_DecodeStatus_Ok) {
5665     return NULL;
5666   }
5667   return ret;
5668 }
google_protobuf_FileDescriptorSet_parse_ex(const char * buf,size_t size,const upb_ExtensionRegistry * extreg,int options,upb_Arena * arena)5669 UPB_INLINE google_protobuf_FileDescriptorSet* google_protobuf_FileDescriptorSet_parse_ex(const char* buf, size_t size,
5670                            const upb_ExtensionRegistry* extreg,
5671                            int options, upb_Arena* arena) {
5672   google_protobuf_FileDescriptorSet* ret = google_protobuf_FileDescriptorSet_new(arena);
5673   if (!ret) return NULL;
5674   if (upb_Decode(buf, size, UPB_UPCAST(ret), &google__protobuf__FileDescriptorSet_msg_init, extreg, options,
5675                  arena) != kUpb_DecodeStatus_Ok) {
5676     return NULL;
5677   }
5678   return ret;
5679 }
google_protobuf_FileDescriptorSet_serialize(const google_protobuf_FileDescriptorSet * msg,upb_Arena * arena,size_t * len)5680 UPB_INLINE char* google_protobuf_FileDescriptorSet_serialize(const google_protobuf_FileDescriptorSet* msg, upb_Arena* arena, size_t* len) {
5681   char* ptr;
5682   (void)upb_Encode(UPB_UPCAST(msg), &google__protobuf__FileDescriptorSet_msg_init, 0, arena, &ptr, len);
5683   return ptr;
5684 }
google_protobuf_FileDescriptorSet_serialize_ex(const google_protobuf_FileDescriptorSet * msg,int options,upb_Arena * arena,size_t * len)5685 UPB_INLINE char* google_protobuf_FileDescriptorSet_serialize_ex(const google_protobuf_FileDescriptorSet* msg, int options,
5686                                  upb_Arena* arena, size_t* len) {
5687   char* ptr;
5688   (void)upb_Encode(UPB_UPCAST(msg), &google__protobuf__FileDescriptorSet_msg_init, options, arena, &ptr, len);
5689   return ptr;
5690 }
google_protobuf_FileDescriptorSet_clear_file(google_protobuf_FileDescriptorSet * msg)5691 UPB_INLINE void google_protobuf_FileDescriptorSet_clear_file(google_protobuf_FileDescriptorSet* msg) {
5692   const upb_MiniTableField field = {1, 8, 0, 0, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
5693   upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
5694 }
google_protobuf_FileDescriptorSet_file(const google_protobuf_FileDescriptorSet * msg,size_t * size)5695 UPB_INLINE const google_protobuf_FileDescriptorProto* const* google_protobuf_FileDescriptorSet_file(const google_protobuf_FileDescriptorSet* msg, size_t* size) {
5696   const upb_MiniTableField field = {1, 8, 0, 0, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
5697   UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__FileDescriptorProto_msg_init);
5698   const upb_Array* arr = upb_Message_GetArray(UPB_UPCAST(msg), &field);
5699   if (arr) {
5700     if (size) *size = arr->UPB_PRIVATE(size);
5701     return (const google_protobuf_FileDescriptorProto* const*)upb_Array_DataPtr(arr);
5702   } else {
5703     if (size) *size = 0;
5704     return NULL;
5705   }
5706 }
_google_protobuf_FileDescriptorSet_file_upb_array(const google_protobuf_FileDescriptorSet * msg,size_t * size)5707 UPB_INLINE const upb_Array* _google_protobuf_FileDescriptorSet_file_upb_array(const google_protobuf_FileDescriptorSet* msg, size_t* size) {
5708   const upb_MiniTableField field = {1, 8, 0, 0, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
5709   UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__FileDescriptorProto_msg_init);
5710   const upb_Array* arr = upb_Message_GetArray(UPB_UPCAST(msg), &field);
5711   if (size) {
5712     *size = arr ? arr->UPB_PRIVATE(size) : 0;
5713   }
5714   return arr;
5715 }
_google_protobuf_FileDescriptorSet_file_mutable_upb_array(google_protobuf_FileDescriptorSet * msg,size_t * size,upb_Arena * arena)5716 UPB_INLINE upb_Array* _google_protobuf_FileDescriptorSet_file_mutable_upb_array(google_protobuf_FileDescriptorSet* msg, size_t* size, upb_Arena* arena) {
5717   const upb_MiniTableField field = {1, 8, 0, 0, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
5718   UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__FileDescriptorProto_msg_init);
5719   upb_Array* arr = upb_Message_GetOrCreateMutableArray(UPB_UPCAST(msg),
5720                                                        &field, arena);
5721   if (size) {
5722     *size = arr ? arr->UPB_PRIVATE(size) : 0;
5723   }
5724   return arr;
5725 }
5726 
google_protobuf_FileDescriptorSet_mutable_file(google_protobuf_FileDescriptorSet * msg,size_t * size)5727 UPB_INLINE google_protobuf_FileDescriptorProto** google_protobuf_FileDescriptorSet_mutable_file(google_protobuf_FileDescriptorSet* msg, size_t* size) {
5728   upb_MiniTableField field = {1, 8, 0, 0, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
5729   UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__FileDescriptorProto_msg_init);
5730   upb_Array* arr = upb_Message_GetMutableArray(UPB_UPCAST(msg), &field);
5731   if (arr) {
5732     if (size) *size = arr->UPB_PRIVATE(size);
5733     return (google_protobuf_FileDescriptorProto**)upb_Array_MutableDataPtr(arr);
5734   } else {
5735     if (size) *size = 0;
5736     return NULL;
5737   }
5738 }
google_protobuf_FileDescriptorSet_resize_file(google_protobuf_FileDescriptorSet * msg,size_t size,upb_Arena * arena)5739 UPB_INLINE google_protobuf_FileDescriptorProto** google_protobuf_FileDescriptorSet_resize_file(google_protobuf_FileDescriptorSet* msg, size_t size, upb_Arena* arena) {
5740   upb_MiniTableField field = {1, 8, 0, 0, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
5741   return (google_protobuf_FileDescriptorProto**)upb_Message_ResizeArrayUninitialized(UPB_UPCAST(msg),
5742                                                    &field, size, arena);
5743 }
google_protobuf_FileDescriptorSet_add_file(google_protobuf_FileDescriptorSet * msg,upb_Arena * arena)5744 UPB_INLINE struct google_protobuf_FileDescriptorProto* google_protobuf_FileDescriptorSet_add_file(google_protobuf_FileDescriptorSet* msg, upb_Arena* arena) {
5745   upb_MiniTableField field = {1, 8, 0, 0, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
5746   UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__FileDescriptorProto_msg_init);
5747   upb_Array* arr = upb_Message_GetOrCreateMutableArray(
5748       UPB_UPCAST(msg), &field, arena);
5749   if (!arr || !UPB_PRIVATE(_upb_Array_ResizeUninitialized)(
5750                   arr, arr->UPB_PRIVATE(size) + 1, arena)) {
5751     return NULL;
5752   }
5753   struct google_protobuf_FileDescriptorProto* sub = (struct google_protobuf_FileDescriptorProto*)_upb_Message_New(&google__protobuf__FileDescriptorProto_msg_init, arena);
5754   if (!arr || !sub) return NULL;
5755   UPB_PRIVATE(_upb_Array_Set)
5756   (arr, arr->UPB_PRIVATE(size) - 1, &sub, sizeof(sub));
5757   return sub;
5758 }
5759 
5760 /* google.protobuf.FileDescriptorProto */
5761 
google_protobuf_FileDescriptorProto_new(upb_Arena * arena)5762 UPB_INLINE google_protobuf_FileDescriptorProto* google_protobuf_FileDescriptorProto_new(upb_Arena* arena) {
5763   return (google_protobuf_FileDescriptorProto*)_upb_Message_New(&google__protobuf__FileDescriptorProto_msg_init, arena);
5764 }
google_protobuf_FileDescriptorProto_parse(const char * buf,size_t size,upb_Arena * arena)5765 UPB_INLINE google_protobuf_FileDescriptorProto* google_protobuf_FileDescriptorProto_parse(const char* buf, size_t size, upb_Arena* arena) {
5766   google_protobuf_FileDescriptorProto* ret = google_protobuf_FileDescriptorProto_new(arena);
5767   if (!ret) return NULL;
5768   if (upb_Decode(buf, size, UPB_UPCAST(ret), &google__protobuf__FileDescriptorProto_msg_init, NULL, 0, arena) !=
5769       kUpb_DecodeStatus_Ok) {
5770     return NULL;
5771   }
5772   return ret;
5773 }
google_protobuf_FileDescriptorProto_parse_ex(const char * buf,size_t size,const upb_ExtensionRegistry * extreg,int options,upb_Arena * arena)5774 UPB_INLINE google_protobuf_FileDescriptorProto* google_protobuf_FileDescriptorProto_parse_ex(const char* buf, size_t size,
5775                            const upb_ExtensionRegistry* extreg,
5776                            int options, upb_Arena* arena) {
5777   google_protobuf_FileDescriptorProto* ret = google_protobuf_FileDescriptorProto_new(arena);
5778   if (!ret) return NULL;
5779   if (upb_Decode(buf, size, UPB_UPCAST(ret), &google__protobuf__FileDescriptorProto_msg_init, extreg, options,
5780                  arena) != kUpb_DecodeStatus_Ok) {
5781     return NULL;
5782   }
5783   return ret;
5784 }
google_protobuf_FileDescriptorProto_serialize(const google_protobuf_FileDescriptorProto * msg,upb_Arena * arena,size_t * len)5785 UPB_INLINE char* google_protobuf_FileDescriptorProto_serialize(const google_protobuf_FileDescriptorProto* msg, upb_Arena* arena, size_t* len) {
5786   char* ptr;
5787   (void)upb_Encode(UPB_UPCAST(msg), &google__protobuf__FileDescriptorProto_msg_init, 0, arena, &ptr, len);
5788   return ptr;
5789 }
google_protobuf_FileDescriptorProto_serialize_ex(const google_protobuf_FileDescriptorProto * msg,int options,upb_Arena * arena,size_t * len)5790 UPB_INLINE char* google_protobuf_FileDescriptorProto_serialize_ex(const google_protobuf_FileDescriptorProto* msg, int options,
5791                                  upb_Arena* arena, size_t* len) {
5792   char* ptr;
5793   (void)upb_Encode(UPB_UPCAST(msg), &google__protobuf__FileDescriptorProto_msg_init, options, arena, &ptr, len);
5794   return ptr;
5795 }
google_protobuf_FileDescriptorProto_clear_name(google_protobuf_FileDescriptorProto * msg)5796 UPB_INLINE void google_protobuf_FileDescriptorProto_clear_name(google_protobuf_FileDescriptorProto* msg) {
5797   const upb_MiniTableField field = {1, UPB_SIZE(52, 16), 64, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
5798   upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
5799 }
google_protobuf_FileDescriptorProto_name(const google_protobuf_FileDescriptorProto * msg)5800 UPB_INLINE upb_StringView google_protobuf_FileDescriptorProto_name(const google_protobuf_FileDescriptorProto* msg) {
5801   upb_StringView default_val = upb_StringView_FromString("");
5802   upb_StringView ret;
5803   const upb_MiniTableField field = {1, UPB_SIZE(52, 16), 64, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
5804   _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field,
5805                                     &default_val, &ret);
5806   return ret;
5807 }
google_protobuf_FileDescriptorProto_has_name(const google_protobuf_FileDescriptorProto * msg)5808 UPB_INLINE bool google_protobuf_FileDescriptorProto_has_name(const google_protobuf_FileDescriptorProto* msg) {
5809   const upb_MiniTableField field = {1, UPB_SIZE(52, 16), 64, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
5810   return upb_Message_HasBaseField(UPB_UPCAST(msg), &field);
5811 }
google_protobuf_FileDescriptorProto_clear_package(google_protobuf_FileDescriptorProto * msg)5812 UPB_INLINE void google_protobuf_FileDescriptorProto_clear_package(google_protobuf_FileDescriptorProto* msg) {
5813   const upb_MiniTableField field = {2, UPB_SIZE(60, 32), 65, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
5814   upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
5815 }
google_protobuf_FileDescriptorProto_package(const google_protobuf_FileDescriptorProto * msg)5816 UPB_INLINE upb_StringView google_protobuf_FileDescriptorProto_package(const google_protobuf_FileDescriptorProto* msg) {
5817   upb_StringView default_val = upb_StringView_FromString("");
5818   upb_StringView ret;
5819   const upb_MiniTableField field = {2, UPB_SIZE(60, 32), 65, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
5820   _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field,
5821                                     &default_val, &ret);
5822   return ret;
5823 }
google_protobuf_FileDescriptorProto_has_package(const google_protobuf_FileDescriptorProto * msg)5824 UPB_INLINE bool google_protobuf_FileDescriptorProto_has_package(const google_protobuf_FileDescriptorProto* msg) {
5825   const upb_MiniTableField field = {2, UPB_SIZE(60, 32), 65, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
5826   return upb_Message_HasBaseField(UPB_UPCAST(msg), &field);
5827 }
google_protobuf_FileDescriptorProto_clear_dependency(google_protobuf_FileDescriptorProto * msg)5828 UPB_INLINE void google_protobuf_FileDescriptorProto_clear_dependency(google_protobuf_FileDescriptorProto* msg) {
5829   const upb_MiniTableField field = {3, UPB_SIZE(12, 48), 0, kUpb_NoSub, 12, (int)kUpb_FieldMode_Array | (int)kUpb_LabelFlags_IsAlternate | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
5830   upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
5831 }
google_protobuf_FileDescriptorProto_dependency(const google_protobuf_FileDescriptorProto * msg,size_t * size)5832 UPB_INLINE upb_StringView const* google_protobuf_FileDescriptorProto_dependency(const google_protobuf_FileDescriptorProto* msg, size_t* size) {
5833   const upb_MiniTableField field = {3, UPB_SIZE(12, 48), 0, kUpb_NoSub, 12, (int)kUpb_FieldMode_Array | (int)kUpb_LabelFlags_IsAlternate | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
5834   const upb_Array* arr = upb_Message_GetArray(UPB_UPCAST(msg), &field);
5835   if (arr) {
5836     if (size) *size = arr->UPB_PRIVATE(size);
5837     return (upb_StringView const*)upb_Array_DataPtr(arr);
5838   } else {
5839     if (size) *size = 0;
5840     return NULL;
5841   }
5842 }
_google_protobuf_FileDescriptorProto_dependency_upb_array(const google_protobuf_FileDescriptorProto * msg,size_t * size)5843 UPB_INLINE const upb_Array* _google_protobuf_FileDescriptorProto_dependency_upb_array(const google_protobuf_FileDescriptorProto* msg, size_t* size) {
5844   const upb_MiniTableField field = {3, UPB_SIZE(12, 48), 0, kUpb_NoSub, 12, (int)kUpb_FieldMode_Array | (int)kUpb_LabelFlags_IsAlternate | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
5845   const upb_Array* arr = upb_Message_GetArray(UPB_UPCAST(msg), &field);
5846   if (size) {
5847     *size = arr ? arr->UPB_PRIVATE(size) : 0;
5848   }
5849   return arr;
5850 }
_google_protobuf_FileDescriptorProto_dependency_mutable_upb_array(google_protobuf_FileDescriptorProto * msg,size_t * size,upb_Arena * arena)5851 UPB_INLINE upb_Array* _google_protobuf_FileDescriptorProto_dependency_mutable_upb_array(google_protobuf_FileDescriptorProto* msg, size_t* size, upb_Arena* arena) {
5852   const upb_MiniTableField field = {3, UPB_SIZE(12, 48), 0, kUpb_NoSub, 12, (int)kUpb_FieldMode_Array | (int)kUpb_LabelFlags_IsAlternate | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
5853   upb_Array* arr = upb_Message_GetOrCreateMutableArray(UPB_UPCAST(msg),
5854                                                        &field, arena);
5855   if (size) {
5856     *size = arr ? arr->UPB_PRIVATE(size) : 0;
5857   }
5858   return arr;
5859 }
google_protobuf_FileDescriptorProto_clear_message_type(google_protobuf_FileDescriptorProto * msg)5860 UPB_INLINE void google_protobuf_FileDescriptorProto_clear_message_type(google_protobuf_FileDescriptorProto* msg) {
5861   const upb_MiniTableField field = {4, UPB_SIZE(16, 56), 0, 0, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
5862   upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
5863 }
google_protobuf_FileDescriptorProto_message_type(const google_protobuf_FileDescriptorProto * msg,size_t * size)5864 UPB_INLINE const google_protobuf_DescriptorProto* const* google_protobuf_FileDescriptorProto_message_type(const google_protobuf_FileDescriptorProto* msg, size_t* size) {
5865   const upb_MiniTableField field = {4, UPB_SIZE(16, 56), 0, 0, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
5866   UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__DescriptorProto_msg_init);
5867   const upb_Array* arr = upb_Message_GetArray(UPB_UPCAST(msg), &field);
5868   if (arr) {
5869     if (size) *size = arr->UPB_PRIVATE(size);
5870     return (const google_protobuf_DescriptorProto* const*)upb_Array_DataPtr(arr);
5871   } else {
5872     if (size) *size = 0;
5873     return NULL;
5874   }
5875 }
_google_protobuf_FileDescriptorProto_message_type_upb_array(const google_protobuf_FileDescriptorProto * msg,size_t * size)5876 UPB_INLINE const upb_Array* _google_protobuf_FileDescriptorProto_message_type_upb_array(const google_protobuf_FileDescriptorProto* msg, size_t* size) {
5877   const upb_MiniTableField field = {4, UPB_SIZE(16, 56), 0, 0, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
5878   UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__DescriptorProto_msg_init);
5879   const upb_Array* arr = upb_Message_GetArray(UPB_UPCAST(msg), &field);
5880   if (size) {
5881     *size = arr ? arr->UPB_PRIVATE(size) : 0;
5882   }
5883   return arr;
5884 }
_google_protobuf_FileDescriptorProto_message_type_mutable_upb_array(google_protobuf_FileDescriptorProto * msg,size_t * size,upb_Arena * arena)5885 UPB_INLINE upb_Array* _google_protobuf_FileDescriptorProto_message_type_mutable_upb_array(google_protobuf_FileDescriptorProto* msg, size_t* size, upb_Arena* arena) {
5886   const upb_MiniTableField field = {4, UPB_SIZE(16, 56), 0, 0, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
5887   UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__DescriptorProto_msg_init);
5888   upb_Array* arr = upb_Message_GetOrCreateMutableArray(UPB_UPCAST(msg),
5889                                                        &field, arena);
5890   if (size) {
5891     *size = arr ? arr->UPB_PRIVATE(size) : 0;
5892   }
5893   return arr;
5894 }
google_protobuf_FileDescriptorProto_clear_enum_type(google_protobuf_FileDescriptorProto * msg)5895 UPB_INLINE void google_protobuf_FileDescriptorProto_clear_enum_type(google_protobuf_FileDescriptorProto* msg) {
5896   const upb_MiniTableField field = {5, UPB_SIZE(20, 64), 0, 1, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
5897   upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
5898 }
google_protobuf_FileDescriptorProto_enum_type(const google_protobuf_FileDescriptorProto * msg,size_t * size)5899 UPB_INLINE const google_protobuf_EnumDescriptorProto* const* google_protobuf_FileDescriptorProto_enum_type(const google_protobuf_FileDescriptorProto* msg, size_t* size) {
5900   const upb_MiniTableField field = {5, UPB_SIZE(20, 64), 0, 1, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
5901   UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__EnumDescriptorProto_msg_init);
5902   const upb_Array* arr = upb_Message_GetArray(UPB_UPCAST(msg), &field);
5903   if (arr) {
5904     if (size) *size = arr->UPB_PRIVATE(size);
5905     return (const google_protobuf_EnumDescriptorProto* const*)upb_Array_DataPtr(arr);
5906   } else {
5907     if (size) *size = 0;
5908     return NULL;
5909   }
5910 }
_google_protobuf_FileDescriptorProto_enum_type_upb_array(const google_protobuf_FileDescriptorProto * msg,size_t * size)5911 UPB_INLINE const upb_Array* _google_protobuf_FileDescriptorProto_enum_type_upb_array(const google_protobuf_FileDescriptorProto* msg, size_t* size) {
5912   const upb_MiniTableField field = {5, UPB_SIZE(20, 64), 0, 1, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
5913   UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__EnumDescriptorProto_msg_init);
5914   const upb_Array* arr = upb_Message_GetArray(UPB_UPCAST(msg), &field);
5915   if (size) {
5916     *size = arr ? arr->UPB_PRIVATE(size) : 0;
5917   }
5918   return arr;
5919 }
_google_protobuf_FileDescriptorProto_enum_type_mutable_upb_array(google_protobuf_FileDescriptorProto * msg,size_t * size,upb_Arena * arena)5920 UPB_INLINE upb_Array* _google_protobuf_FileDescriptorProto_enum_type_mutable_upb_array(google_protobuf_FileDescriptorProto* msg, size_t* size, upb_Arena* arena) {
5921   const upb_MiniTableField field = {5, UPB_SIZE(20, 64), 0, 1, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
5922   UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__EnumDescriptorProto_msg_init);
5923   upb_Array* arr = upb_Message_GetOrCreateMutableArray(UPB_UPCAST(msg),
5924                                                        &field, arena);
5925   if (size) {
5926     *size = arr ? arr->UPB_PRIVATE(size) : 0;
5927   }
5928   return arr;
5929 }
google_protobuf_FileDescriptorProto_clear_service(google_protobuf_FileDescriptorProto * msg)5930 UPB_INLINE void google_protobuf_FileDescriptorProto_clear_service(google_protobuf_FileDescriptorProto* msg) {
5931   const upb_MiniTableField field = {6, UPB_SIZE(24, 72), 0, 2, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
5932   upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
5933 }
google_protobuf_FileDescriptorProto_service(const google_protobuf_FileDescriptorProto * msg,size_t * size)5934 UPB_INLINE const google_protobuf_ServiceDescriptorProto* const* google_protobuf_FileDescriptorProto_service(const google_protobuf_FileDescriptorProto* msg, size_t* size) {
5935   const upb_MiniTableField field = {6, UPB_SIZE(24, 72), 0, 2, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
5936   UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__ServiceDescriptorProto_msg_init);
5937   const upb_Array* arr = upb_Message_GetArray(UPB_UPCAST(msg), &field);
5938   if (arr) {
5939     if (size) *size = arr->UPB_PRIVATE(size);
5940     return (const google_protobuf_ServiceDescriptorProto* const*)upb_Array_DataPtr(arr);
5941   } else {
5942     if (size) *size = 0;
5943     return NULL;
5944   }
5945 }
_google_protobuf_FileDescriptorProto_service_upb_array(const google_protobuf_FileDescriptorProto * msg,size_t * size)5946 UPB_INLINE const upb_Array* _google_protobuf_FileDescriptorProto_service_upb_array(const google_protobuf_FileDescriptorProto* msg, size_t* size) {
5947   const upb_MiniTableField field = {6, UPB_SIZE(24, 72), 0, 2, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
5948   UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__ServiceDescriptorProto_msg_init);
5949   const upb_Array* arr = upb_Message_GetArray(UPB_UPCAST(msg), &field);
5950   if (size) {
5951     *size = arr ? arr->UPB_PRIVATE(size) : 0;
5952   }
5953   return arr;
5954 }
_google_protobuf_FileDescriptorProto_service_mutable_upb_array(google_protobuf_FileDescriptorProto * msg,size_t * size,upb_Arena * arena)5955 UPB_INLINE upb_Array* _google_protobuf_FileDescriptorProto_service_mutable_upb_array(google_protobuf_FileDescriptorProto* msg, size_t* size, upb_Arena* arena) {
5956   const upb_MiniTableField field = {6, UPB_SIZE(24, 72), 0, 2, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
5957   UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__ServiceDescriptorProto_msg_init);
5958   upb_Array* arr = upb_Message_GetOrCreateMutableArray(UPB_UPCAST(msg),
5959                                                        &field, arena);
5960   if (size) {
5961     *size = arr ? arr->UPB_PRIVATE(size) : 0;
5962   }
5963   return arr;
5964 }
google_protobuf_FileDescriptorProto_clear_extension(google_protobuf_FileDescriptorProto * msg)5965 UPB_INLINE void google_protobuf_FileDescriptorProto_clear_extension(google_protobuf_FileDescriptorProto* msg) {
5966   const upb_MiniTableField field = {7, UPB_SIZE(28, 80), 0, 3, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
5967   upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
5968 }
google_protobuf_FileDescriptorProto_extension(const google_protobuf_FileDescriptorProto * msg,size_t * size)5969 UPB_INLINE const google_protobuf_FieldDescriptorProto* const* google_protobuf_FileDescriptorProto_extension(const google_protobuf_FileDescriptorProto* msg, size_t* size) {
5970   const upb_MiniTableField field = {7, UPB_SIZE(28, 80), 0, 3, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
5971   UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__FieldDescriptorProto_msg_init);
5972   const upb_Array* arr = upb_Message_GetArray(UPB_UPCAST(msg), &field);
5973   if (arr) {
5974     if (size) *size = arr->UPB_PRIVATE(size);
5975     return (const google_protobuf_FieldDescriptorProto* const*)upb_Array_DataPtr(arr);
5976   } else {
5977     if (size) *size = 0;
5978     return NULL;
5979   }
5980 }
_google_protobuf_FileDescriptorProto_extension_upb_array(const google_protobuf_FileDescriptorProto * msg,size_t * size)5981 UPB_INLINE const upb_Array* _google_protobuf_FileDescriptorProto_extension_upb_array(const google_protobuf_FileDescriptorProto* msg, size_t* size) {
5982   const upb_MiniTableField field = {7, UPB_SIZE(28, 80), 0, 3, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
5983   UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__FieldDescriptorProto_msg_init);
5984   const upb_Array* arr = upb_Message_GetArray(UPB_UPCAST(msg), &field);
5985   if (size) {
5986     *size = arr ? arr->UPB_PRIVATE(size) : 0;
5987   }
5988   return arr;
5989 }
_google_protobuf_FileDescriptorProto_extension_mutable_upb_array(google_protobuf_FileDescriptorProto * msg,size_t * size,upb_Arena * arena)5990 UPB_INLINE upb_Array* _google_protobuf_FileDescriptorProto_extension_mutable_upb_array(google_protobuf_FileDescriptorProto* msg, size_t* size, upb_Arena* arena) {
5991   const upb_MiniTableField field = {7, UPB_SIZE(28, 80), 0, 3, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
5992   UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__FieldDescriptorProto_msg_init);
5993   upb_Array* arr = upb_Message_GetOrCreateMutableArray(UPB_UPCAST(msg),
5994                                                        &field, arena);
5995   if (size) {
5996     *size = arr ? arr->UPB_PRIVATE(size) : 0;
5997   }
5998   return arr;
5999 }
google_protobuf_FileDescriptorProto_clear_options(google_protobuf_FileDescriptorProto * msg)6000 UPB_INLINE void google_protobuf_FileDescriptorProto_clear_options(google_protobuf_FileDescriptorProto* msg) {
6001   const upb_MiniTableField field = {8, UPB_SIZE(32, 88), 66, 4, 11, (int)kUpb_FieldMode_Scalar | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
6002   upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
6003 }
google_protobuf_FileDescriptorProto_options(const google_protobuf_FileDescriptorProto * msg)6004 UPB_INLINE const google_protobuf_FileOptions* google_protobuf_FileDescriptorProto_options(const google_protobuf_FileDescriptorProto* msg) {
6005   const google_protobuf_FileOptions* default_val = NULL;
6006   const google_protobuf_FileOptions* ret;
6007   const upb_MiniTableField field = {8, UPB_SIZE(32, 88), 66, 4, 11, (int)kUpb_FieldMode_Scalar | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
6008   UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__FileOptions_msg_init);
6009   _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field,
6010                                     &default_val, &ret);
6011   return ret;
6012 }
google_protobuf_FileDescriptorProto_has_options(const google_protobuf_FileDescriptorProto * msg)6013 UPB_INLINE bool google_protobuf_FileDescriptorProto_has_options(const google_protobuf_FileDescriptorProto* msg) {
6014   const upb_MiniTableField field = {8, UPB_SIZE(32, 88), 66, 4, 11, (int)kUpb_FieldMode_Scalar | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
6015   return upb_Message_HasBaseField(UPB_UPCAST(msg), &field);
6016 }
google_protobuf_FileDescriptorProto_clear_source_code_info(google_protobuf_FileDescriptorProto * msg)6017 UPB_INLINE void google_protobuf_FileDescriptorProto_clear_source_code_info(google_protobuf_FileDescriptorProto* msg) {
6018   const upb_MiniTableField field = {9, UPB_SIZE(36, 96), 67, 5, 11, (int)kUpb_FieldMode_Scalar | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
6019   upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
6020 }
google_protobuf_FileDescriptorProto_source_code_info(const google_protobuf_FileDescriptorProto * msg)6021 UPB_INLINE const google_protobuf_SourceCodeInfo* google_protobuf_FileDescriptorProto_source_code_info(const google_protobuf_FileDescriptorProto* msg) {
6022   const google_protobuf_SourceCodeInfo* default_val = NULL;
6023   const google_protobuf_SourceCodeInfo* ret;
6024   const upb_MiniTableField field = {9, UPB_SIZE(36, 96), 67, 5, 11, (int)kUpb_FieldMode_Scalar | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
6025   UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__SourceCodeInfo_msg_init);
6026   _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field,
6027                                     &default_val, &ret);
6028   return ret;
6029 }
google_protobuf_FileDescriptorProto_has_source_code_info(const google_protobuf_FileDescriptorProto * msg)6030 UPB_INLINE bool google_protobuf_FileDescriptorProto_has_source_code_info(const google_protobuf_FileDescriptorProto* msg) {
6031   const upb_MiniTableField field = {9, UPB_SIZE(36, 96), 67, 5, 11, (int)kUpb_FieldMode_Scalar | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
6032   return upb_Message_HasBaseField(UPB_UPCAST(msg), &field);
6033 }
google_protobuf_FileDescriptorProto_clear_public_dependency(google_protobuf_FileDescriptorProto * msg)6034 UPB_INLINE void google_protobuf_FileDescriptorProto_clear_public_dependency(google_protobuf_FileDescriptorProto* msg) {
6035   const upb_MiniTableField field = {10, UPB_SIZE(40, 104), 0, kUpb_NoSub, 5, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
6036   upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
6037 }
google_protobuf_FileDescriptorProto_public_dependency(const google_protobuf_FileDescriptorProto * msg,size_t * size)6038 UPB_INLINE int32_t const* google_protobuf_FileDescriptorProto_public_dependency(const google_protobuf_FileDescriptorProto* msg, size_t* size) {
6039   const upb_MiniTableField field = {10, UPB_SIZE(40, 104), 0, kUpb_NoSub, 5, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
6040   const upb_Array* arr = upb_Message_GetArray(UPB_UPCAST(msg), &field);
6041   if (arr) {
6042     if (size) *size = arr->UPB_PRIVATE(size);
6043     return (int32_t const*)upb_Array_DataPtr(arr);
6044   } else {
6045     if (size) *size = 0;
6046     return NULL;
6047   }
6048 }
_google_protobuf_FileDescriptorProto_public_dependency_upb_array(const google_protobuf_FileDescriptorProto * msg,size_t * size)6049 UPB_INLINE const upb_Array* _google_protobuf_FileDescriptorProto_public_dependency_upb_array(const google_protobuf_FileDescriptorProto* msg, size_t* size) {
6050   const upb_MiniTableField field = {10, UPB_SIZE(40, 104), 0, kUpb_NoSub, 5, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
6051   const upb_Array* arr = upb_Message_GetArray(UPB_UPCAST(msg), &field);
6052   if (size) {
6053     *size = arr ? arr->UPB_PRIVATE(size) : 0;
6054   }
6055   return arr;
6056 }
_google_protobuf_FileDescriptorProto_public_dependency_mutable_upb_array(google_protobuf_FileDescriptorProto * msg,size_t * size,upb_Arena * arena)6057 UPB_INLINE upb_Array* _google_protobuf_FileDescriptorProto_public_dependency_mutable_upb_array(google_protobuf_FileDescriptorProto* msg, size_t* size, upb_Arena* arena) {
6058   const upb_MiniTableField field = {10, UPB_SIZE(40, 104), 0, kUpb_NoSub, 5, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
6059   upb_Array* arr = upb_Message_GetOrCreateMutableArray(UPB_UPCAST(msg),
6060                                                        &field, arena);
6061   if (size) {
6062     *size = arr ? arr->UPB_PRIVATE(size) : 0;
6063   }
6064   return arr;
6065 }
google_protobuf_FileDescriptorProto_clear_weak_dependency(google_protobuf_FileDescriptorProto * msg)6066 UPB_INLINE void google_protobuf_FileDescriptorProto_clear_weak_dependency(google_protobuf_FileDescriptorProto* msg) {
6067   const upb_MiniTableField field = {11, UPB_SIZE(44, 112), 0, kUpb_NoSub, 5, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
6068   upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
6069 }
google_protobuf_FileDescriptorProto_weak_dependency(const google_protobuf_FileDescriptorProto * msg,size_t * size)6070 UPB_INLINE int32_t const* google_protobuf_FileDescriptorProto_weak_dependency(const google_protobuf_FileDescriptorProto* msg, size_t* size) {
6071   const upb_MiniTableField field = {11, UPB_SIZE(44, 112), 0, kUpb_NoSub, 5, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
6072   const upb_Array* arr = upb_Message_GetArray(UPB_UPCAST(msg), &field);
6073   if (arr) {
6074     if (size) *size = arr->UPB_PRIVATE(size);
6075     return (int32_t const*)upb_Array_DataPtr(arr);
6076   } else {
6077     if (size) *size = 0;
6078     return NULL;
6079   }
6080 }
_google_protobuf_FileDescriptorProto_weak_dependency_upb_array(const google_protobuf_FileDescriptorProto * msg,size_t * size)6081 UPB_INLINE const upb_Array* _google_protobuf_FileDescriptorProto_weak_dependency_upb_array(const google_protobuf_FileDescriptorProto* msg, size_t* size) {
6082   const upb_MiniTableField field = {11, UPB_SIZE(44, 112), 0, kUpb_NoSub, 5, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
6083   const upb_Array* arr = upb_Message_GetArray(UPB_UPCAST(msg), &field);
6084   if (size) {
6085     *size = arr ? arr->UPB_PRIVATE(size) : 0;
6086   }
6087   return arr;
6088 }
_google_protobuf_FileDescriptorProto_weak_dependency_mutable_upb_array(google_protobuf_FileDescriptorProto * msg,size_t * size,upb_Arena * arena)6089 UPB_INLINE upb_Array* _google_protobuf_FileDescriptorProto_weak_dependency_mutable_upb_array(google_protobuf_FileDescriptorProto* msg, size_t* size, upb_Arena* arena) {
6090   const upb_MiniTableField field = {11, UPB_SIZE(44, 112), 0, kUpb_NoSub, 5, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
6091   upb_Array* arr = upb_Message_GetOrCreateMutableArray(UPB_UPCAST(msg),
6092                                                        &field, arena);
6093   if (size) {
6094     *size = arr ? arr->UPB_PRIVATE(size) : 0;
6095   }
6096   return arr;
6097 }
google_protobuf_FileDescriptorProto_clear_syntax(google_protobuf_FileDescriptorProto * msg)6098 UPB_INLINE void google_protobuf_FileDescriptorProto_clear_syntax(google_protobuf_FileDescriptorProto* msg) {
6099   const upb_MiniTableField field = {12, UPB_SIZE(68, 120), 68, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
6100   upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
6101 }
google_protobuf_FileDescriptorProto_syntax(const google_protobuf_FileDescriptorProto * msg)6102 UPB_INLINE upb_StringView google_protobuf_FileDescriptorProto_syntax(const google_protobuf_FileDescriptorProto* msg) {
6103   upb_StringView default_val = upb_StringView_FromString("");
6104   upb_StringView ret;
6105   const upb_MiniTableField field = {12, UPB_SIZE(68, 120), 68, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
6106   _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field,
6107                                     &default_val, &ret);
6108   return ret;
6109 }
google_protobuf_FileDescriptorProto_has_syntax(const google_protobuf_FileDescriptorProto * msg)6110 UPB_INLINE bool google_protobuf_FileDescriptorProto_has_syntax(const google_protobuf_FileDescriptorProto* msg) {
6111   const upb_MiniTableField field = {12, UPB_SIZE(68, 120), 68, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
6112   return upb_Message_HasBaseField(UPB_UPCAST(msg), &field);
6113 }
google_protobuf_FileDescriptorProto_clear_edition(google_protobuf_FileDescriptorProto * msg)6114 UPB_INLINE void google_protobuf_FileDescriptorProto_clear_edition(google_protobuf_FileDescriptorProto* msg) {
6115   const upb_MiniTableField field = {14, UPB_SIZE(48, 12), 69, 6, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
6116   upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
6117 }
google_protobuf_FileDescriptorProto_edition(const google_protobuf_FileDescriptorProto * msg)6118 UPB_INLINE int32_t google_protobuf_FileDescriptorProto_edition(const google_protobuf_FileDescriptorProto* msg) {
6119   int32_t default_val = 0;
6120   int32_t ret;
6121   const upb_MiniTableField field = {14, UPB_SIZE(48, 12), 69, 6, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
6122   _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field,
6123                                     &default_val, &ret);
6124   return ret;
6125 }
google_protobuf_FileDescriptorProto_has_edition(const google_protobuf_FileDescriptorProto * msg)6126 UPB_INLINE bool google_protobuf_FileDescriptorProto_has_edition(const google_protobuf_FileDescriptorProto* msg) {
6127   const upb_MiniTableField field = {14, UPB_SIZE(48, 12), 69, 6, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
6128   return upb_Message_HasBaseField(UPB_UPCAST(msg), &field);
6129 }
6130 
google_protobuf_FileDescriptorProto_set_name(google_protobuf_FileDescriptorProto * msg,upb_StringView value)6131 UPB_INLINE void google_protobuf_FileDescriptorProto_set_name(google_protobuf_FileDescriptorProto *msg, upb_StringView value) {
6132   const upb_MiniTableField field = {1, UPB_SIZE(52, 16), 64, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
6133   upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
6134 }
google_protobuf_FileDescriptorProto_set_package(google_protobuf_FileDescriptorProto * msg,upb_StringView value)6135 UPB_INLINE void google_protobuf_FileDescriptorProto_set_package(google_protobuf_FileDescriptorProto *msg, upb_StringView value) {
6136   const upb_MiniTableField field = {2, UPB_SIZE(60, 32), 65, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
6137   upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
6138 }
google_protobuf_FileDescriptorProto_mutable_dependency(google_protobuf_FileDescriptorProto * msg,size_t * size)6139 UPB_INLINE upb_StringView* google_protobuf_FileDescriptorProto_mutable_dependency(google_protobuf_FileDescriptorProto* msg, size_t* size) {
6140   upb_MiniTableField field = {3, UPB_SIZE(12, 48), 0, kUpb_NoSub, 12, (int)kUpb_FieldMode_Array | (int)kUpb_LabelFlags_IsAlternate | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
6141   upb_Array* arr = upb_Message_GetMutableArray(UPB_UPCAST(msg), &field);
6142   if (arr) {
6143     if (size) *size = arr->UPB_PRIVATE(size);
6144     return (upb_StringView*)upb_Array_MutableDataPtr(arr);
6145   } else {
6146     if (size) *size = 0;
6147     return NULL;
6148   }
6149 }
google_protobuf_FileDescriptorProto_resize_dependency(google_protobuf_FileDescriptorProto * msg,size_t size,upb_Arena * arena)6150 UPB_INLINE upb_StringView* google_protobuf_FileDescriptorProto_resize_dependency(google_protobuf_FileDescriptorProto* msg, size_t size, upb_Arena* arena) {
6151   upb_MiniTableField field = {3, UPB_SIZE(12, 48), 0, kUpb_NoSub, 12, (int)kUpb_FieldMode_Array | (int)kUpb_LabelFlags_IsAlternate | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
6152   return (upb_StringView*)upb_Message_ResizeArrayUninitialized(UPB_UPCAST(msg),
6153                                                    &field, size, arena);
6154 }
google_protobuf_FileDescriptorProto_add_dependency(google_protobuf_FileDescriptorProto * msg,upb_StringView val,upb_Arena * arena)6155 UPB_INLINE bool google_protobuf_FileDescriptorProto_add_dependency(google_protobuf_FileDescriptorProto* msg, upb_StringView val, upb_Arena* arena) {
6156   upb_MiniTableField field = {3, UPB_SIZE(12, 48), 0, kUpb_NoSub, 12, (int)kUpb_FieldMode_Array | (int)kUpb_LabelFlags_IsAlternate | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
6157   upb_Array* arr = upb_Message_GetOrCreateMutableArray(
6158       UPB_UPCAST(msg), &field, arena);
6159   if (!arr || !UPB_PRIVATE(_upb_Array_ResizeUninitialized)(
6160                   arr, arr->UPB_PRIVATE(size) + 1, arena)) {
6161     return false;
6162   }
6163   UPB_PRIVATE(_upb_Array_Set)
6164   (arr, arr->UPB_PRIVATE(size) - 1, &val, sizeof(val));
6165   return true;
6166 }
google_protobuf_FileDescriptorProto_mutable_message_type(google_protobuf_FileDescriptorProto * msg,size_t * size)6167 UPB_INLINE google_protobuf_DescriptorProto** google_protobuf_FileDescriptorProto_mutable_message_type(google_protobuf_FileDescriptorProto* msg, size_t* size) {
6168   upb_MiniTableField field = {4, UPB_SIZE(16, 56), 0, 0, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
6169   UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__DescriptorProto_msg_init);
6170   upb_Array* arr = upb_Message_GetMutableArray(UPB_UPCAST(msg), &field);
6171   if (arr) {
6172     if (size) *size = arr->UPB_PRIVATE(size);
6173     return (google_protobuf_DescriptorProto**)upb_Array_MutableDataPtr(arr);
6174   } else {
6175     if (size) *size = 0;
6176     return NULL;
6177   }
6178 }
google_protobuf_FileDescriptorProto_resize_message_type(google_protobuf_FileDescriptorProto * msg,size_t size,upb_Arena * arena)6179 UPB_INLINE google_protobuf_DescriptorProto** google_protobuf_FileDescriptorProto_resize_message_type(google_protobuf_FileDescriptorProto* msg, size_t size, upb_Arena* arena) {
6180   upb_MiniTableField field = {4, UPB_SIZE(16, 56), 0, 0, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
6181   return (google_protobuf_DescriptorProto**)upb_Message_ResizeArrayUninitialized(UPB_UPCAST(msg),
6182                                                    &field, size, arena);
6183 }
google_protobuf_FileDescriptorProto_add_message_type(google_protobuf_FileDescriptorProto * msg,upb_Arena * arena)6184 UPB_INLINE struct google_protobuf_DescriptorProto* google_protobuf_FileDescriptorProto_add_message_type(google_protobuf_FileDescriptorProto* msg, upb_Arena* arena) {
6185   upb_MiniTableField field = {4, UPB_SIZE(16, 56), 0, 0, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
6186   UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__DescriptorProto_msg_init);
6187   upb_Array* arr = upb_Message_GetOrCreateMutableArray(
6188       UPB_UPCAST(msg), &field, arena);
6189   if (!arr || !UPB_PRIVATE(_upb_Array_ResizeUninitialized)(
6190                   arr, arr->UPB_PRIVATE(size) + 1, arena)) {
6191     return NULL;
6192   }
6193   struct google_protobuf_DescriptorProto* sub = (struct google_protobuf_DescriptorProto*)_upb_Message_New(&google__protobuf__DescriptorProto_msg_init, arena);
6194   if (!arr || !sub) return NULL;
6195   UPB_PRIVATE(_upb_Array_Set)
6196   (arr, arr->UPB_PRIVATE(size) - 1, &sub, sizeof(sub));
6197   return sub;
6198 }
google_protobuf_FileDescriptorProto_mutable_enum_type(google_protobuf_FileDescriptorProto * msg,size_t * size)6199 UPB_INLINE google_protobuf_EnumDescriptorProto** google_protobuf_FileDescriptorProto_mutable_enum_type(google_protobuf_FileDescriptorProto* msg, size_t* size) {
6200   upb_MiniTableField field = {5, UPB_SIZE(20, 64), 0, 1, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
6201   UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__EnumDescriptorProto_msg_init);
6202   upb_Array* arr = upb_Message_GetMutableArray(UPB_UPCAST(msg), &field);
6203   if (arr) {
6204     if (size) *size = arr->UPB_PRIVATE(size);
6205     return (google_protobuf_EnumDescriptorProto**)upb_Array_MutableDataPtr(arr);
6206   } else {
6207     if (size) *size = 0;
6208     return NULL;
6209   }
6210 }
google_protobuf_FileDescriptorProto_resize_enum_type(google_protobuf_FileDescriptorProto * msg,size_t size,upb_Arena * arena)6211 UPB_INLINE google_protobuf_EnumDescriptorProto** google_protobuf_FileDescriptorProto_resize_enum_type(google_protobuf_FileDescriptorProto* msg, size_t size, upb_Arena* arena) {
6212   upb_MiniTableField field = {5, UPB_SIZE(20, 64), 0, 1, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
6213   return (google_protobuf_EnumDescriptorProto**)upb_Message_ResizeArrayUninitialized(UPB_UPCAST(msg),
6214                                                    &field, size, arena);
6215 }
google_protobuf_FileDescriptorProto_add_enum_type(google_protobuf_FileDescriptorProto * msg,upb_Arena * arena)6216 UPB_INLINE struct google_protobuf_EnumDescriptorProto* google_protobuf_FileDescriptorProto_add_enum_type(google_protobuf_FileDescriptorProto* msg, upb_Arena* arena) {
6217   upb_MiniTableField field = {5, UPB_SIZE(20, 64), 0, 1, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
6218   UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__EnumDescriptorProto_msg_init);
6219   upb_Array* arr = upb_Message_GetOrCreateMutableArray(
6220       UPB_UPCAST(msg), &field, arena);
6221   if (!arr || !UPB_PRIVATE(_upb_Array_ResizeUninitialized)(
6222                   arr, arr->UPB_PRIVATE(size) + 1, arena)) {
6223     return NULL;
6224   }
6225   struct google_protobuf_EnumDescriptorProto* sub = (struct google_protobuf_EnumDescriptorProto*)_upb_Message_New(&google__protobuf__EnumDescriptorProto_msg_init, arena);
6226   if (!arr || !sub) return NULL;
6227   UPB_PRIVATE(_upb_Array_Set)
6228   (arr, arr->UPB_PRIVATE(size) - 1, &sub, sizeof(sub));
6229   return sub;
6230 }
google_protobuf_FileDescriptorProto_mutable_service(google_protobuf_FileDescriptorProto * msg,size_t * size)6231 UPB_INLINE google_protobuf_ServiceDescriptorProto** google_protobuf_FileDescriptorProto_mutable_service(google_protobuf_FileDescriptorProto* msg, size_t* size) {
6232   upb_MiniTableField field = {6, UPB_SIZE(24, 72), 0, 2, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
6233   UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__ServiceDescriptorProto_msg_init);
6234   upb_Array* arr = upb_Message_GetMutableArray(UPB_UPCAST(msg), &field);
6235   if (arr) {
6236     if (size) *size = arr->UPB_PRIVATE(size);
6237     return (google_protobuf_ServiceDescriptorProto**)upb_Array_MutableDataPtr(arr);
6238   } else {
6239     if (size) *size = 0;
6240     return NULL;
6241   }
6242 }
google_protobuf_FileDescriptorProto_resize_service(google_protobuf_FileDescriptorProto * msg,size_t size,upb_Arena * arena)6243 UPB_INLINE google_protobuf_ServiceDescriptorProto** google_protobuf_FileDescriptorProto_resize_service(google_protobuf_FileDescriptorProto* msg, size_t size, upb_Arena* arena) {
6244   upb_MiniTableField field = {6, UPB_SIZE(24, 72), 0, 2, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
6245   return (google_protobuf_ServiceDescriptorProto**)upb_Message_ResizeArrayUninitialized(UPB_UPCAST(msg),
6246                                                    &field, size, arena);
6247 }
google_protobuf_FileDescriptorProto_add_service(google_protobuf_FileDescriptorProto * msg,upb_Arena * arena)6248 UPB_INLINE struct google_protobuf_ServiceDescriptorProto* google_protobuf_FileDescriptorProto_add_service(google_protobuf_FileDescriptorProto* msg, upb_Arena* arena) {
6249   upb_MiniTableField field = {6, UPB_SIZE(24, 72), 0, 2, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
6250   UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__ServiceDescriptorProto_msg_init);
6251   upb_Array* arr = upb_Message_GetOrCreateMutableArray(
6252       UPB_UPCAST(msg), &field, arena);
6253   if (!arr || !UPB_PRIVATE(_upb_Array_ResizeUninitialized)(
6254                   arr, arr->UPB_PRIVATE(size) + 1, arena)) {
6255     return NULL;
6256   }
6257   struct google_protobuf_ServiceDescriptorProto* sub = (struct google_protobuf_ServiceDescriptorProto*)_upb_Message_New(&google__protobuf__ServiceDescriptorProto_msg_init, arena);
6258   if (!arr || !sub) return NULL;
6259   UPB_PRIVATE(_upb_Array_Set)
6260   (arr, arr->UPB_PRIVATE(size) - 1, &sub, sizeof(sub));
6261   return sub;
6262 }
google_protobuf_FileDescriptorProto_mutable_extension(google_protobuf_FileDescriptorProto * msg,size_t * size)6263 UPB_INLINE google_protobuf_FieldDescriptorProto** google_protobuf_FileDescriptorProto_mutable_extension(google_protobuf_FileDescriptorProto* msg, size_t* size) {
6264   upb_MiniTableField field = {7, UPB_SIZE(28, 80), 0, 3, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
6265   UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__FieldDescriptorProto_msg_init);
6266   upb_Array* arr = upb_Message_GetMutableArray(UPB_UPCAST(msg), &field);
6267   if (arr) {
6268     if (size) *size = arr->UPB_PRIVATE(size);
6269     return (google_protobuf_FieldDescriptorProto**)upb_Array_MutableDataPtr(arr);
6270   } else {
6271     if (size) *size = 0;
6272     return NULL;
6273   }
6274 }
google_protobuf_FileDescriptorProto_resize_extension(google_protobuf_FileDescriptorProto * msg,size_t size,upb_Arena * arena)6275 UPB_INLINE google_protobuf_FieldDescriptorProto** google_protobuf_FileDescriptorProto_resize_extension(google_protobuf_FileDescriptorProto* msg, size_t size, upb_Arena* arena) {
6276   upb_MiniTableField field = {7, UPB_SIZE(28, 80), 0, 3, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
6277   return (google_protobuf_FieldDescriptorProto**)upb_Message_ResizeArrayUninitialized(UPB_UPCAST(msg),
6278                                                    &field, size, arena);
6279 }
google_protobuf_FileDescriptorProto_add_extension(google_protobuf_FileDescriptorProto * msg,upb_Arena * arena)6280 UPB_INLINE struct google_protobuf_FieldDescriptorProto* google_protobuf_FileDescriptorProto_add_extension(google_protobuf_FileDescriptorProto* msg, upb_Arena* arena) {
6281   upb_MiniTableField field = {7, UPB_SIZE(28, 80), 0, 3, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
6282   UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__FieldDescriptorProto_msg_init);
6283   upb_Array* arr = upb_Message_GetOrCreateMutableArray(
6284       UPB_UPCAST(msg), &field, arena);
6285   if (!arr || !UPB_PRIVATE(_upb_Array_ResizeUninitialized)(
6286                   arr, arr->UPB_PRIVATE(size) + 1, arena)) {
6287     return NULL;
6288   }
6289   struct google_protobuf_FieldDescriptorProto* sub = (struct google_protobuf_FieldDescriptorProto*)_upb_Message_New(&google__protobuf__FieldDescriptorProto_msg_init, arena);
6290   if (!arr || !sub) return NULL;
6291   UPB_PRIVATE(_upb_Array_Set)
6292   (arr, arr->UPB_PRIVATE(size) - 1, &sub, sizeof(sub));
6293   return sub;
6294 }
google_protobuf_FileDescriptorProto_set_options(google_protobuf_FileDescriptorProto * msg,google_protobuf_FileOptions * value)6295 UPB_INLINE void google_protobuf_FileDescriptorProto_set_options(google_protobuf_FileDescriptorProto *msg, google_protobuf_FileOptions* value) {
6296   const upb_MiniTableField field = {8, UPB_SIZE(32, 88), 66, 4, 11, (int)kUpb_FieldMode_Scalar | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
6297   UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__FileOptions_msg_init);
6298   upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
6299 }
google_protobuf_FileDescriptorProto_mutable_options(google_protobuf_FileDescriptorProto * msg,upb_Arena * arena)6300 UPB_INLINE struct google_protobuf_FileOptions* google_protobuf_FileDescriptorProto_mutable_options(google_protobuf_FileDescriptorProto* msg, upb_Arena* arena) {
6301   struct google_protobuf_FileOptions* sub = (struct google_protobuf_FileOptions*)google_protobuf_FileDescriptorProto_options(msg);
6302   if (sub == NULL) {
6303     sub = (struct google_protobuf_FileOptions*)_upb_Message_New(&google__protobuf__FileOptions_msg_init, arena);
6304     if (sub) google_protobuf_FileDescriptorProto_set_options(msg, sub);
6305   }
6306   return sub;
6307 }
google_protobuf_FileDescriptorProto_set_source_code_info(google_protobuf_FileDescriptorProto * msg,google_protobuf_SourceCodeInfo * value)6308 UPB_INLINE void google_protobuf_FileDescriptorProto_set_source_code_info(google_protobuf_FileDescriptorProto *msg, google_protobuf_SourceCodeInfo* value) {
6309   const upb_MiniTableField field = {9, UPB_SIZE(36, 96), 67, 5, 11, (int)kUpb_FieldMode_Scalar | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
6310   UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__SourceCodeInfo_msg_init);
6311   upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
6312 }
google_protobuf_FileDescriptorProto_mutable_source_code_info(google_protobuf_FileDescriptorProto * msg,upb_Arena * arena)6313 UPB_INLINE struct google_protobuf_SourceCodeInfo* google_protobuf_FileDescriptorProto_mutable_source_code_info(google_protobuf_FileDescriptorProto* msg, upb_Arena* arena) {
6314   struct google_protobuf_SourceCodeInfo* sub = (struct google_protobuf_SourceCodeInfo*)google_protobuf_FileDescriptorProto_source_code_info(msg);
6315   if (sub == NULL) {
6316     sub = (struct google_protobuf_SourceCodeInfo*)_upb_Message_New(&google__protobuf__SourceCodeInfo_msg_init, arena);
6317     if (sub) google_protobuf_FileDescriptorProto_set_source_code_info(msg, sub);
6318   }
6319   return sub;
6320 }
google_protobuf_FileDescriptorProto_mutable_public_dependency(google_protobuf_FileDescriptorProto * msg,size_t * size)6321 UPB_INLINE int32_t* google_protobuf_FileDescriptorProto_mutable_public_dependency(google_protobuf_FileDescriptorProto* msg, size_t* size) {
6322   upb_MiniTableField field = {10, UPB_SIZE(40, 104), 0, kUpb_NoSub, 5, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
6323   upb_Array* arr = upb_Message_GetMutableArray(UPB_UPCAST(msg), &field);
6324   if (arr) {
6325     if (size) *size = arr->UPB_PRIVATE(size);
6326     return (int32_t*)upb_Array_MutableDataPtr(arr);
6327   } else {
6328     if (size) *size = 0;
6329     return NULL;
6330   }
6331 }
google_protobuf_FileDescriptorProto_resize_public_dependency(google_protobuf_FileDescriptorProto * msg,size_t size,upb_Arena * arena)6332 UPB_INLINE int32_t* google_protobuf_FileDescriptorProto_resize_public_dependency(google_protobuf_FileDescriptorProto* msg, size_t size, upb_Arena* arena) {
6333   upb_MiniTableField field = {10, UPB_SIZE(40, 104), 0, kUpb_NoSub, 5, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
6334   return (int32_t*)upb_Message_ResizeArrayUninitialized(UPB_UPCAST(msg),
6335                                                    &field, size, arena);
6336 }
google_protobuf_FileDescriptorProto_add_public_dependency(google_protobuf_FileDescriptorProto * msg,int32_t val,upb_Arena * arena)6337 UPB_INLINE bool google_protobuf_FileDescriptorProto_add_public_dependency(google_protobuf_FileDescriptorProto* msg, int32_t val, upb_Arena* arena) {
6338   upb_MiniTableField field = {10, UPB_SIZE(40, 104), 0, kUpb_NoSub, 5, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
6339   upb_Array* arr = upb_Message_GetOrCreateMutableArray(
6340       UPB_UPCAST(msg), &field, arena);
6341   if (!arr || !UPB_PRIVATE(_upb_Array_ResizeUninitialized)(
6342                   arr, arr->UPB_PRIVATE(size) + 1, arena)) {
6343     return false;
6344   }
6345   UPB_PRIVATE(_upb_Array_Set)
6346   (arr, arr->UPB_PRIVATE(size) - 1, &val, sizeof(val));
6347   return true;
6348 }
google_protobuf_FileDescriptorProto_mutable_weak_dependency(google_protobuf_FileDescriptorProto * msg,size_t * size)6349 UPB_INLINE int32_t* google_protobuf_FileDescriptorProto_mutable_weak_dependency(google_protobuf_FileDescriptorProto* msg, size_t* size) {
6350   upb_MiniTableField field = {11, UPB_SIZE(44, 112), 0, kUpb_NoSub, 5, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
6351   upb_Array* arr = upb_Message_GetMutableArray(UPB_UPCAST(msg), &field);
6352   if (arr) {
6353     if (size) *size = arr->UPB_PRIVATE(size);
6354     return (int32_t*)upb_Array_MutableDataPtr(arr);
6355   } else {
6356     if (size) *size = 0;
6357     return NULL;
6358   }
6359 }
google_protobuf_FileDescriptorProto_resize_weak_dependency(google_protobuf_FileDescriptorProto * msg,size_t size,upb_Arena * arena)6360 UPB_INLINE int32_t* google_protobuf_FileDescriptorProto_resize_weak_dependency(google_protobuf_FileDescriptorProto* msg, size_t size, upb_Arena* arena) {
6361   upb_MiniTableField field = {11, UPB_SIZE(44, 112), 0, kUpb_NoSub, 5, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
6362   return (int32_t*)upb_Message_ResizeArrayUninitialized(UPB_UPCAST(msg),
6363                                                    &field, size, arena);
6364 }
google_protobuf_FileDescriptorProto_add_weak_dependency(google_protobuf_FileDescriptorProto * msg,int32_t val,upb_Arena * arena)6365 UPB_INLINE bool google_protobuf_FileDescriptorProto_add_weak_dependency(google_protobuf_FileDescriptorProto* msg, int32_t val, upb_Arena* arena) {
6366   upb_MiniTableField field = {11, UPB_SIZE(44, 112), 0, kUpb_NoSub, 5, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
6367   upb_Array* arr = upb_Message_GetOrCreateMutableArray(
6368       UPB_UPCAST(msg), &field, arena);
6369   if (!arr || !UPB_PRIVATE(_upb_Array_ResizeUninitialized)(
6370                   arr, arr->UPB_PRIVATE(size) + 1, arena)) {
6371     return false;
6372   }
6373   UPB_PRIVATE(_upb_Array_Set)
6374   (arr, arr->UPB_PRIVATE(size) - 1, &val, sizeof(val));
6375   return true;
6376 }
google_protobuf_FileDescriptorProto_set_syntax(google_protobuf_FileDescriptorProto * msg,upb_StringView value)6377 UPB_INLINE void google_protobuf_FileDescriptorProto_set_syntax(google_protobuf_FileDescriptorProto *msg, upb_StringView value) {
6378   const upb_MiniTableField field = {12, UPB_SIZE(68, 120), 68, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
6379   upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
6380 }
google_protobuf_FileDescriptorProto_set_edition(google_protobuf_FileDescriptorProto * msg,int32_t value)6381 UPB_INLINE void google_protobuf_FileDescriptorProto_set_edition(google_protobuf_FileDescriptorProto *msg, int32_t value) {
6382   const upb_MiniTableField field = {14, UPB_SIZE(48, 12), 69, 6, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
6383   upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
6384 }
6385 
6386 /* google.protobuf.DescriptorProto */
6387 
google_protobuf_DescriptorProto_new(upb_Arena * arena)6388 UPB_INLINE google_protobuf_DescriptorProto* google_protobuf_DescriptorProto_new(upb_Arena* arena) {
6389   return (google_protobuf_DescriptorProto*)_upb_Message_New(&google__protobuf__DescriptorProto_msg_init, arena);
6390 }
google_protobuf_DescriptorProto_parse(const char * buf,size_t size,upb_Arena * arena)6391 UPB_INLINE google_protobuf_DescriptorProto* google_protobuf_DescriptorProto_parse(const char* buf, size_t size, upb_Arena* arena) {
6392   google_protobuf_DescriptorProto* ret = google_protobuf_DescriptorProto_new(arena);
6393   if (!ret) return NULL;
6394   if (upb_Decode(buf, size, UPB_UPCAST(ret), &google__protobuf__DescriptorProto_msg_init, NULL, 0, arena) !=
6395       kUpb_DecodeStatus_Ok) {
6396     return NULL;
6397   }
6398   return ret;
6399 }
google_protobuf_DescriptorProto_parse_ex(const char * buf,size_t size,const upb_ExtensionRegistry * extreg,int options,upb_Arena * arena)6400 UPB_INLINE google_protobuf_DescriptorProto* google_protobuf_DescriptorProto_parse_ex(const char* buf, size_t size,
6401                            const upb_ExtensionRegistry* extreg,
6402                            int options, upb_Arena* arena) {
6403   google_protobuf_DescriptorProto* ret = google_protobuf_DescriptorProto_new(arena);
6404   if (!ret) return NULL;
6405   if (upb_Decode(buf, size, UPB_UPCAST(ret), &google__protobuf__DescriptorProto_msg_init, extreg, options,
6406                  arena) != kUpb_DecodeStatus_Ok) {
6407     return NULL;
6408   }
6409   return ret;
6410 }
google_protobuf_DescriptorProto_serialize(const google_protobuf_DescriptorProto * msg,upb_Arena * arena,size_t * len)6411 UPB_INLINE char* google_protobuf_DescriptorProto_serialize(const google_protobuf_DescriptorProto* msg, upb_Arena* arena, size_t* len) {
6412   char* ptr;
6413   (void)upb_Encode(UPB_UPCAST(msg), &google__protobuf__DescriptorProto_msg_init, 0, arena, &ptr, len);
6414   return ptr;
6415 }
google_protobuf_DescriptorProto_serialize_ex(const google_protobuf_DescriptorProto * msg,int options,upb_Arena * arena,size_t * len)6416 UPB_INLINE char* google_protobuf_DescriptorProto_serialize_ex(const google_protobuf_DescriptorProto* msg, int options,
6417                                  upb_Arena* arena, size_t* len) {
6418   char* ptr;
6419   (void)upb_Encode(UPB_UPCAST(msg), &google__protobuf__DescriptorProto_msg_init, options, arena, &ptr, len);
6420   return ptr;
6421 }
google_protobuf_DescriptorProto_clear_name(google_protobuf_DescriptorProto * msg)6422 UPB_INLINE void google_protobuf_DescriptorProto_clear_name(google_protobuf_DescriptorProto* msg) {
6423   const upb_MiniTableField field = {1, UPB_SIZE(48, 16), 64, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
6424   upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
6425 }
google_protobuf_DescriptorProto_name(const google_protobuf_DescriptorProto * msg)6426 UPB_INLINE upb_StringView google_protobuf_DescriptorProto_name(const google_protobuf_DescriptorProto* msg) {
6427   upb_StringView default_val = upb_StringView_FromString("");
6428   upb_StringView ret;
6429   const upb_MiniTableField field = {1, UPB_SIZE(48, 16), 64, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
6430   _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field,
6431                                     &default_val, &ret);
6432   return ret;
6433 }
google_protobuf_DescriptorProto_has_name(const google_protobuf_DescriptorProto * msg)6434 UPB_INLINE bool google_protobuf_DescriptorProto_has_name(const google_protobuf_DescriptorProto* msg) {
6435   const upb_MiniTableField field = {1, UPB_SIZE(48, 16), 64, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
6436   return upb_Message_HasBaseField(UPB_UPCAST(msg), &field);
6437 }
google_protobuf_DescriptorProto_clear_field(google_protobuf_DescriptorProto * msg)6438 UPB_INLINE void google_protobuf_DescriptorProto_clear_field(google_protobuf_DescriptorProto* msg) {
6439   const upb_MiniTableField field = {2, UPB_SIZE(12, 32), 0, 0, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
6440   upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
6441 }
google_protobuf_DescriptorProto_field(const google_protobuf_DescriptorProto * msg,size_t * size)6442 UPB_INLINE const google_protobuf_FieldDescriptorProto* const* google_protobuf_DescriptorProto_field(const google_protobuf_DescriptorProto* msg, size_t* size) {
6443   const upb_MiniTableField field = {2, UPB_SIZE(12, 32), 0, 0, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
6444   UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__FieldDescriptorProto_msg_init);
6445   const upb_Array* arr = upb_Message_GetArray(UPB_UPCAST(msg), &field);
6446   if (arr) {
6447     if (size) *size = arr->UPB_PRIVATE(size);
6448     return (const google_protobuf_FieldDescriptorProto* const*)upb_Array_DataPtr(arr);
6449   } else {
6450     if (size) *size = 0;
6451     return NULL;
6452   }
6453 }
_google_protobuf_DescriptorProto_field_upb_array(const google_protobuf_DescriptorProto * msg,size_t * size)6454 UPB_INLINE const upb_Array* _google_protobuf_DescriptorProto_field_upb_array(const google_protobuf_DescriptorProto* msg, size_t* size) {
6455   const upb_MiniTableField field = {2, UPB_SIZE(12, 32), 0, 0, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
6456   UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__FieldDescriptorProto_msg_init);
6457   const upb_Array* arr = upb_Message_GetArray(UPB_UPCAST(msg), &field);
6458   if (size) {
6459     *size = arr ? arr->UPB_PRIVATE(size) : 0;
6460   }
6461   return arr;
6462 }
_google_protobuf_DescriptorProto_field_mutable_upb_array(google_protobuf_DescriptorProto * msg,size_t * size,upb_Arena * arena)6463 UPB_INLINE upb_Array* _google_protobuf_DescriptorProto_field_mutable_upb_array(google_protobuf_DescriptorProto* msg, size_t* size, upb_Arena* arena) {
6464   const upb_MiniTableField field = {2, UPB_SIZE(12, 32), 0, 0, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
6465   UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__FieldDescriptorProto_msg_init);
6466   upb_Array* arr = upb_Message_GetOrCreateMutableArray(UPB_UPCAST(msg),
6467                                                        &field, arena);
6468   if (size) {
6469     *size = arr ? arr->UPB_PRIVATE(size) : 0;
6470   }
6471   return arr;
6472 }
google_protobuf_DescriptorProto_clear_nested_type(google_protobuf_DescriptorProto * msg)6473 UPB_INLINE void google_protobuf_DescriptorProto_clear_nested_type(google_protobuf_DescriptorProto* msg) {
6474   const upb_MiniTableField field = {3, UPB_SIZE(16, 40), 0, 1, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
6475   upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
6476 }
google_protobuf_DescriptorProto_nested_type(const google_protobuf_DescriptorProto * msg,size_t * size)6477 UPB_INLINE const google_protobuf_DescriptorProto* const* google_protobuf_DescriptorProto_nested_type(const google_protobuf_DescriptorProto* msg, size_t* size) {
6478   const upb_MiniTableField field = {3, UPB_SIZE(16, 40), 0, 1, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
6479   UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__DescriptorProto_msg_init);
6480   const upb_Array* arr = upb_Message_GetArray(UPB_UPCAST(msg), &field);
6481   if (arr) {
6482     if (size) *size = arr->UPB_PRIVATE(size);
6483     return (const google_protobuf_DescriptorProto* const*)upb_Array_DataPtr(arr);
6484   } else {
6485     if (size) *size = 0;
6486     return NULL;
6487   }
6488 }
_google_protobuf_DescriptorProto_nested_type_upb_array(const google_protobuf_DescriptorProto * msg,size_t * size)6489 UPB_INLINE const upb_Array* _google_protobuf_DescriptorProto_nested_type_upb_array(const google_protobuf_DescriptorProto* msg, size_t* size) {
6490   const upb_MiniTableField field = {3, UPB_SIZE(16, 40), 0, 1, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
6491   UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__DescriptorProto_msg_init);
6492   const upb_Array* arr = upb_Message_GetArray(UPB_UPCAST(msg), &field);
6493   if (size) {
6494     *size = arr ? arr->UPB_PRIVATE(size) : 0;
6495   }
6496   return arr;
6497 }
_google_protobuf_DescriptorProto_nested_type_mutable_upb_array(google_protobuf_DescriptorProto * msg,size_t * size,upb_Arena * arena)6498 UPB_INLINE upb_Array* _google_protobuf_DescriptorProto_nested_type_mutable_upb_array(google_protobuf_DescriptorProto* msg, size_t* size, upb_Arena* arena) {
6499   const upb_MiniTableField field = {3, UPB_SIZE(16, 40), 0, 1, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
6500   UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__DescriptorProto_msg_init);
6501   upb_Array* arr = upb_Message_GetOrCreateMutableArray(UPB_UPCAST(msg),
6502                                                        &field, arena);
6503   if (size) {
6504     *size = arr ? arr->UPB_PRIVATE(size) : 0;
6505   }
6506   return arr;
6507 }
google_protobuf_DescriptorProto_clear_enum_type(google_protobuf_DescriptorProto * msg)6508 UPB_INLINE void google_protobuf_DescriptorProto_clear_enum_type(google_protobuf_DescriptorProto* msg) {
6509   const upb_MiniTableField field = {4, UPB_SIZE(20, 48), 0, 2, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
6510   upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
6511 }
google_protobuf_DescriptorProto_enum_type(const google_protobuf_DescriptorProto * msg,size_t * size)6512 UPB_INLINE const google_protobuf_EnumDescriptorProto* const* google_protobuf_DescriptorProto_enum_type(const google_protobuf_DescriptorProto* msg, size_t* size) {
6513   const upb_MiniTableField field = {4, UPB_SIZE(20, 48), 0, 2, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
6514   UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__EnumDescriptorProto_msg_init);
6515   const upb_Array* arr = upb_Message_GetArray(UPB_UPCAST(msg), &field);
6516   if (arr) {
6517     if (size) *size = arr->UPB_PRIVATE(size);
6518     return (const google_protobuf_EnumDescriptorProto* const*)upb_Array_DataPtr(arr);
6519   } else {
6520     if (size) *size = 0;
6521     return NULL;
6522   }
6523 }
_google_protobuf_DescriptorProto_enum_type_upb_array(const google_protobuf_DescriptorProto * msg,size_t * size)6524 UPB_INLINE const upb_Array* _google_protobuf_DescriptorProto_enum_type_upb_array(const google_protobuf_DescriptorProto* msg, size_t* size) {
6525   const upb_MiniTableField field = {4, UPB_SIZE(20, 48), 0, 2, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
6526   UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__EnumDescriptorProto_msg_init);
6527   const upb_Array* arr = upb_Message_GetArray(UPB_UPCAST(msg), &field);
6528   if (size) {
6529     *size = arr ? arr->UPB_PRIVATE(size) : 0;
6530   }
6531   return arr;
6532 }
_google_protobuf_DescriptorProto_enum_type_mutable_upb_array(google_protobuf_DescriptorProto * msg,size_t * size,upb_Arena * arena)6533 UPB_INLINE upb_Array* _google_protobuf_DescriptorProto_enum_type_mutable_upb_array(google_protobuf_DescriptorProto* msg, size_t* size, upb_Arena* arena) {
6534   const upb_MiniTableField field = {4, UPB_SIZE(20, 48), 0, 2, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
6535   UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__EnumDescriptorProto_msg_init);
6536   upb_Array* arr = upb_Message_GetOrCreateMutableArray(UPB_UPCAST(msg),
6537                                                        &field, arena);
6538   if (size) {
6539     *size = arr ? arr->UPB_PRIVATE(size) : 0;
6540   }
6541   return arr;
6542 }
google_protobuf_DescriptorProto_clear_extension_range(google_protobuf_DescriptorProto * msg)6543 UPB_INLINE void google_protobuf_DescriptorProto_clear_extension_range(google_protobuf_DescriptorProto* msg) {
6544   const upb_MiniTableField field = {5, UPB_SIZE(24, 56), 0, 3, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
6545   upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
6546 }
google_protobuf_DescriptorProto_extension_range(const google_protobuf_DescriptorProto * msg,size_t * size)6547 UPB_INLINE const google_protobuf_DescriptorProto_ExtensionRange* const* google_protobuf_DescriptorProto_extension_range(const google_protobuf_DescriptorProto* msg, size_t* size) {
6548   const upb_MiniTableField field = {5, UPB_SIZE(24, 56), 0, 3, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
6549   UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__DescriptorProto__ExtensionRange_msg_init);
6550   const upb_Array* arr = upb_Message_GetArray(UPB_UPCAST(msg), &field);
6551   if (arr) {
6552     if (size) *size = arr->UPB_PRIVATE(size);
6553     return (const google_protobuf_DescriptorProto_ExtensionRange* const*)upb_Array_DataPtr(arr);
6554   } else {
6555     if (size) *size = 0;
6556     return NULL;
6557   }
6558 }
_google_protobuf_DescriptorProto_extension_range_upb_array(const google_protobuf_DescriptorProto * msg,size_t * size)6559 UPB_INLINE const upb_Array* _google_protobuf_DescriptorProto_extension_range_upb_array(const google_protobuf_DescriptorProto* msg, size_t* size) {
6560   const upb_MiniTableField field = {5, UPB_SIZE(24, 56), 0, 3, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
6561   UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__DescriptorProto__ExtensionRange_msg_init);
6562   const upb_Array* arr = upb_Message_GetArray(UPB_UPCAST(msg), &field);
6563   if (size) {
6564     *size = arr ? arr->UPB_PRIVATE(size) : 0;
6565   }
6566   return arr;
6567 }
_google_protobuf_DescriptorProto_extension_range_mutable_upb_array(google_protobuf_DescriptorProto * msg,size_t * size,upb_Arena * arena)6568 UPB_INLINE upb_Array* _google_protobuf_DescriptorProto_extension_range_mutable_upb_array(google_protobuf_DescriptorProto* msg, size_t* size, upb_Arena* arena) {
6569   const upb_MiniTableField field = {5, UPB_SIZE(24, 56), 0, 3, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
6570   UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__DescriptorProto__ExtensionRange_msg_init);
6571   upb_Array* arr = upb_Message_GetOrCreateMutableArray(UPB_UPCAST(msg),
6572                                                        &field, arena);
6573   if (size) {
6574     *size = arr ? arr->UPB_PRIVATE(size) : 0;
6575   }
6576   return arr;
6577 }
google_protobuf_DescriptorProto_clear_extension(google_protobuf_DescriptorProto * msg)6578 UPB_INLINE void google_protobuf_DescriptorProto_clear_extension(google_protobuf_DescriptorProto* msg) {
6579   const upb_MiniTableField field = {6, UPB_SIZE(28, 64), 0, 4, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
6580   upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
6581 }
google_protobuf_DescriptorProto_extension(const google_protobuf_DescriptorProto * msg,size_t * size)6582 UPB_INLINE const google_protobuf_FieldDescriptorProto* const* google_protobuf_DescriptorProto_extension(const google_protobuf_DescriptorProto* msg, size_t* size) {
6583   const upb_MiniTableField field = {6, UPB_SIZE(28, 64), 0, 4, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
6584   UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__FieldDescriptorProto_msg_init);
6585   const upb_Array* arr = upb_Message_GetArray(UPB_UPCAST(msg), &field);
6586   if (arr) {
6587     if (size) *size = arr->UPB_PRIVATE(size);
6588     return (const google_protobuf_FieldDescriptorProto* const*)upb_Array_DataPtr(arr);
6589   } else {
6590     if (size) *size = 0;
6591     return NULL;
6592   }
6593 }
_google_protobuf_DescriptorProto_extension_upb_array(const google_protobuf_DescriptorProto * msg,size_t * size)6594 UPB_INLINE const upb_Array* _google_protobuf_DescriptorProto_extension_upb_array(const google_protobuf_DescriptorProto* msg, size_t* size) {
6595   const upb_MiniTableField field = {6, UPB_SIZE(28, 64), 0, 4, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
6596   UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__FieldDescriptorProto_msg_init);
6597   const upb_Array* arr = upb_Message_GetArray(UPB_UPCAST(msg), &field);
6598   if (size) {
6599     *size = arr ? arr->UPB_PRIVATE(size) : 0;
6600   }
6601   return arr;
6602 }
_google_protobuf_DescriptorProto_extension_mutable_upb_array(google_protobuf_DescriptorProto * msg,size_t * size,upb_Arena * arena)6603 UPB_INLINE upb_Array* _google_protobuf_DescriptorProto_extension_mutable_upb_array(google_protobuf_DescriptorProto* msg, size_t* size, upb_Arena* arena) {
6604   const upb_MiniTableField field = {6, UPB_SIZE(28, 64), 0, 4, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
6605   UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__FieldDescriptorProto_msg_init);
6606   upb_Array* arr = upb_Message_GetOrCreateMutableArray(UPB_UPCAST(msg),
6607                                                        &field, arena);
6608   if (size) {
6609     *size = arr ? arr->UPB_PRIVATE(size) : 0;
6610   }
6611   return arr;
6612 }
google_protobuf_DescriptorProto_clear_options(google_protobuf_DescriptorProto * msg)6613 UPB_INLINE void google_protobuf_DescriptorProto_clear_options(google_protobuf_DescriptorProto* msg) {
6614   const upb_MiniTableField field = {7, UPB_SIZE(32, 72), 65, 5, 11, (int)kUpb_FieldMode_Scalar | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
6615   upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
6616 }
google_protobuf_DescriptorProto_options(const google_protobuf_DescriptorProto * msg)6617 UPB_INLINE const google_protobuf_MessageOptions* google_protobuf_DescriptorProto_options(const google_protobuf_DescriptorProto* msg) {
6618   const google_protobuf_MessageOptions* default_val = NULL;
6619   const google_protobuf_MessageOptions* ret;
6620   const upb_MiniTableField field = {7, UPB_SIZE(32, 72), 65, 5, 11, (int)kUpb_FieldMode_Scalar | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
6621   UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__MessageOptions_msg_init);
6622   _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field,
6623                                     &default_val, &ret);
6624   return ret;
6625 }
google_protobuf_DescriptorProto_has_options(const google_protobuf_DescriptorProto * msg)6626 UPB_INLINE bool google_protobuf_DescriptorProto_has_options(const google_protobuf_DescriptorProto* msg) {
6627   const upb_MiniTableField field = {7, UPB_SIZE(32, 72), 65, 5, 11, (int)kUpb_FieldMode_Scalar | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
6628   return upb_Message_HasBaseField(UPB_UPCAST(msg), &field);
6629 }
google_protobuf_DescriptorProto_clear_oneof_decl(google_protobuf_DescriptorProto * msg)6630 UPB_INLINE void google_protobuf_DescriptorProto_clear_oneof_decl(google_protobuf_DescriptorProto* msg) {
6631   const upb_MiniTableField field = {8, UPB_SIZE(36, 80), 0, 6, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
6632   upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
6633 }
google_protobuf_DescriptorProto_oneof_decl(const google_protobuf_DescriptorProto * msg,size_t * size)6634 UPB_INLINE const google_protobuf_OneofDescriptorProto* const* google_protobuf_DescriptorProto_oneof_decl(const google_protobuf_DescriptorProto* msg, size_t* size) {
6635   const upb_MiniTableField field = {8, UPB_SIZE(36, 80), 0, 6, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
6636   UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__OneofDescriptorProto_msg_init);
6637   const upb_Array* arr = upb_Message_GetArray(UPB_UPCAST(msg), &field);
6638   if (arr) {
6639     if (size) *size = arr->UPB_PRIVATE(size);
6640     return (const google_protobuf_OneofDescriptorProto* const*)upb_Array_DataPtr(arr);
6641   } else {
6642     if (size) *size = 0;
6643     return NULL;
6644   }
6645 }
_google_protobuf_DescriptorProto_oneof_decl_upb_array(const google_protobuf_DescriptorProto * msg,size_t * size)6646 UPB_INLINE const upb_Array* _google_protobuf_DescriptorProto_oneof_decl_upb_array(const google_protobuf_DescriptorProto* msg, size_t* size) {
6647   const upb_MiniTableField field = {8, UPB_SIZE(36, 80), 0, 6, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
6648   UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__OneofDescriptorProto_msg_init);
6649   const upb_Array* arr = upb_Message_GetArray(UPB_UPCAST(msg), &field);
6650   if (size) {
6651     *size = arr ? arr->UPB_PRIVATE(size) : 0;
6652   }
6653   return arr;
6654 }
_google_protobuf_DescriptorProto_oneof_decl_mutable_upb_array(google_protobuf_DescriptorProto * msg,size_t * size,upb_Arena * arena)6655 UPB_INLINE upb_Array* _google_protobuf_DescriptorProto_oneof_decl_mutable_upb_array(google_protobuf_DescriptorProto* msg, size_t* size, upb_Arena* arena) {
6656   const upb_MiniTableField field = {8, UPB_SIZE(36, 80), 0, 6, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
6657   UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__OneofDescriptorProto_msg_init);
6658   upb_Array* arr = upb_Message_GetOrCreateMutableArray(UPB_UPCAST(msg),
6659                                                        &field, arena);
6660   if (size) {
6661     *size = arr ? arr->UPB_PRIVATE(size) : 0;
6662   }
6663   return arr;
6664 }
google_protobuf_DescriptorProto_clear_reserved_range(google_protobuf_DescriptorProto * msg)6665 UPB_INLINE void google_protobuf_DescriptorProto_clear_reserved_range(google_protobuf_DescriptorProto* msg) {
6666   const upb_MiniTableField field = {9, UPB_SIZE(40, 88), 0, 7, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
6667   upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
6668 }
google_protobuf_DescriptorProto_reserved_range(const google_protobuf_DescriptorProto * msg,size_t * size)6669 UPB_INLINE const google_protobuf_DescriptorProto_ReservedRange* const* google_protobuf_DescriptorProto_reserved_range(const google_protobuf_DescriptorProto* msg, size_t* size) {
6670   const upb_MiniTableField field = {9, UPB_SIZE(40, 88), 0, 7, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
6671   UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__DescriptorProto__ReservedRange_msg_init);
6672   const upb_Array* arr = upb_Message_GetArray(UPB_UPCAST(msg), &field);
6673   if (arr) {
6674     if (size) *size = arr->UPB_PRIVATE(size);
6675     return (const google_protobuf_DescriptorProto_ReservedRange* const*)upb_Array_DataPtr(arr);
6676   } else {
6677     if (size) *size = 0;
6678     return NULL;
6679   }
6680 }
_google_protobuf_DescriptorProto_reserved_range_upb_array(const google_protobuf_DescriptorProto * msg,size_t * size)6681 UPB_INLINE const upb_Array* _google_protobuf_DescriptorProto_reserved_range_upb_array(const google_protobuf_DescriptorProto* msg, size_t* size) {
6682   const upb_MiniTableField field = {9, UPB_SIZE(40, 88), 0, 7, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
6683   UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__DescriptorProto__ReservedRange_msg_init);
6684   const upb_Array* arr = upb_Message_GetArray(UPB_UPCAST(msg), &field);
6685   if (size) {
6686     *size = arr ? arr->UPB_PRIVATE(size) : 0;
6687   }
6688   return arr;
6689 }
_google_protobuf_DescriptorProto_reserved_range_mutable_upb_array(google_protobuf_DescriptorProto * msg,size_t * size,upb_Arena * arena)6690 UPB_INLINE upb_Array* _google_protobuf_DescriptorProto_reserved_range_mutable_upb_array(google_protobuf_DescriptorProto* msg, size_t* size, upb_Arena* arena) {
6691   const upb_MiniTableField field = {9, UPB_SIZE(40, 88), 0, 7, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
6692   UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__DescriptorProto__ReservedRange_msg_init);
6693   upb_Array* arr = upb_Message_GetOrCreateMutableArray(UPB_UPCAST(msg),
6694                                                        &field, arena);
6695   if (size) {
6696     *size = arr ? arr->UPB_PRIVATE(size) : 0;
6697   }
6698   return arr;
6699 }
google_protobuf_DescriptorProto_clear_reserved_name(google_protobuf_DescriptorProto * msg)6700 UPB_INLINE void google_protobuf_DescriptorProto_clear_reserved_name(google_protobuf_DescriptorProto* msg) {
6701   const upb_MiniTableField field = {10, UPB_SIZE(44, 96), 0, kUpb_NoSub, 12, (int)kUpb_FieldMode_Array | (int)kUpb_LabelFlags_IsAlternate | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
6702   upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
6703 }
google_protobuf_DescriptorProto_reserved_name(const google_protobuf_DescriptorProto * msg,size_t * size)6704 UPB_INLINE upb_StringView const* google_protobuf_DescriptorProto_reserved_name(const google_protobuf_DescriptorProto* msg, size_t* size) {
6705   const upb_MiniTableField field = {10, UPB_SIZE(44, 96), 0, kUpb_NoSub, 12, (int)kUpb_FieldMode_Array | (int)kUpb_LabelFlags_IsAlternate | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
6706   const upb_Array* arr = upb_Message_GetArray(UPB_UPCAST(msg), &field);
6707   if (arr) {
6708     if (size) *size = arr->UPB_PRIVATE(size);
6709     return (upb_StringView const*)upb_Array_DataPtr(arr);
6710   } else {
6711     if (size) *size = 0;
6712     return NULL;
6713   }
6714 }
_google_protobuf_DescriptorProto_reserved_name_upb_array(const google_protobuf_DescriptorProto * msg,size_t * size)6715 UPB_INLINE const upb_Array* _google_protobuf_DescriptorProto_reserved_name_upb_array(const google_protobuf_DescriptorProto* msg, size_t* size) {
6716   const upb_MiniTableField field = {10, UPB_SIZE(44, 96), 0, kUpb_NoSub, 12, (int)kUpb_FieldMode_Array | (int)kUpb_LabelFlags_IsAlternate | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
6717   const upb_Array* arr = upb_Message_GetArray(UPB_UPCAST(msg), &field);
6718   if (size) {
6719     *size = arr ? arr->UPB_PRIVATE(size) : 0;
6720   }
6721   return arr;
6722 }
_google_protobuf_DescriptorProto_reserved_name_mutable_upb_array(google_protobuf_DescriptorProto * msg,size_t * size,upb_Arena * arena)6723 UPB_INLINE upb_Array* _google_protobuf_DescriptorProto_reserved_name_mutable_upb_array(google_protobuf_DescriptorProto* msg, size_t* size, upb_Arena* arena) {
6724   const upb_MiniTableField field = {10, UPB_SIZE(44, 96), 0, kUpb_NoSub, 12, (int)kUpb_FieldMode_Array | (int)kUpb_LabelFlags_IsAlternate | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
6725   upb_Array* arr = upb_Message_GetOrCreateMutableArray(UPB_UPCAST(msg),
6726                                                        &field, arena);
6727   if (size) {
6728     *size = arr ? arr->UPB_PRIVATE(size) : 0;
6729   }
6730   return arr;
6731 }
6732 
google_protobuf_DescriptorProto_set_name(google_protobuf_DescriptorProto * msg,upb_StringView value)6733 UPB_INLINE void google_protobuf_DescriptorProto_set_name(google_protobuf_DescriptorProto *msg, upb_StringView value) {
6734   const upb_MiniTableField field = {1, UPB_SIZE(48, 16), 64, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
6735   upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
6736 }
google_protobuf_DescriptorProto_mutable_field(google_protobuf_DescriptorProto * msg,size_t * size)6737 UPB_INLINE google_protobuf_FieldDescriptorProto** google_protobuf_DescriptorProto_mutable_field(google_protobuf_DescriptorProto* msg, size_t* size) {
6738   upb_MiniTableField field = {2, UPB_SIZE(12, 32), 0, 0, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
6739   UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__FieldDescriptorProto_msg_init);
6740   upb_Array* arr = upb_Message_GetMutableArray(UPB_UPCAST(msg), &field);
6741   if (arr) {
6742     if (size) *size = arr->UPB_PRIVATE(size);
6743     return (google_protobuf_FieldDescriptorProto**)upb_Array_MutableDataPtr(arr);
6744   } else {
6745     if (size) *size = 0;
6746     return NULL;
6747   }
6748 }
google_protobuf_DescriptorProto_resize_field(google_protobuf_DescriptorProto * msg,size_t size,upb_Arena * arena)6749 UPB_INLINE google_protobuf_FieldDescriptorProto** google_protobuf_DescriptorProto_resize_field(google_protobuf_DescriptorProto* msg, size_t size, upb_Arena* arena) {
6750   upb_MiniTableField field = {2, UPB_SIZE(12, 32), 0, 0, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
6751   return (google_protobuf_FieldDescriptorProto**)upb_Message_ResizeArrayUninitialized(UPB_UPCAST(msg),
6752                                                    &field, size, arena);
6753 }
google_protobuf_DescriptorProto_add_field(google_protobuf_DescriptorProto * msg,upb_Arena * arena)6754 UPB_INLINE struct google_protobuf_FieldDescriptorProto* google_protobuf_DescriptorProto_add_field(google_protobuf_DescriptorProto* msg, upb_Arena* arena) {
6755   upb_MiniTableField field = {2, UPB_SIZE(12, 32), 0, 0, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
6756   UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__FieldDescriptorProto_msg_init);
6757   upb_Array* arr = upb_Message_GetOrCreateMutableArray(
6758       UPB_UPCAST(msg), &field, arena);
6759   if (!arr || !UPB_PRIVATE(_upb_Array_ResizeUninitialized)(
6760                   arr, arr->UPB_PRIVATE(size) + 1, arena)) {
6761     return NULL;
6762   }
6763   struct google_protobuf_FieldDescriptorProto* sub = (struct google_protobuf_FieldDescriptorProto*)_upb_Message_New(&google__protobuf__FieldDescriptorProto_msg_init, arena);
6764   if (!arr || !sub) return NULL;
6765   UPB_PRIVATE(_upb_Array_Set)
6766   (arr, arr->UPB_PRIVATE(size) - 1, &sub, sizeof(sub));
6767   return sub;
6768 }
google_protobuf_DescriptorProto_mutable_nested_type(google_protobuf_DescriptorProto * msg,size_t * size)6769 UPB_INLINE google_protobuf_DescriptorProto** google_protobuf_DescriptorProto_mutable_nested_type(google_protobuf_DescriptorProto* msg, size_t* size) {
6770   upb_MiniTableField field = {3, UPB_SIZE(16, 40), 0, 1, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
6771   UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__DescriptorProto_msg_init);
6772   upb_Array* arr = upb_Message_GetMutableArray(UPB_UPCAST(msg), &field);
6773   if (arr) {
6774     if (size) *size = arr->UPB_PRIVATE(size);
6775     return (google_protobuf_DescriptorProto**)upb_Array_MutableDataPtr(arr);
6776   } else {
6777     if (size) *size = 0;
6778     return NULL;
6779   }
6780 }
google_protobuf_DescriptorProto_resize_nested_type(google_protobuf_DescriptorProto * msg,size_t size,upb_Arena * arena)6781 UPB_INLINE google_protobuf_DescriptorProto** google_protobuf_DescriptorProto_resize_nested_type(google_protobuf_DescriptorProto* msg, size_t size, upb_Arena* arena) {
6782   upb_MiniTableField field = {3, UPB_SIZE(16, 40), 0, 1, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
6783   return (google_protobuf_DescriptorProto**)upb_Message_ResizeArrayUninitialized(UPB_UPCAST(msg),
6784                                                    &field, size, arena);
6785 }
google_protobuf_DescriptorProto_add_nested_type(google_protobuf_DescriptorProto * msg,upb_Arena * arena)6786 UPB_INLINE struct google_protobuf_DescriptorProto* google_protobuf_DescriptorProto_add_nested_type(google_protobuf_DescriptorProto* msg, upb_Arena* arena) {
6787   upb_MiniTableField field = {3, UPB_SIZE(16, 40), 0, 1, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
6788   UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__DescriptorProto_msg_init);
6789   upb_Array* arr = upb_Message_GetOrCreateMutableArray(
6790       UPB_UPCAST(msg), &field, arena);
6791   if (!arr || !UPB_PRIVATE(_upb_Array_ResizeUninitialized)(
6792                   arr, arr->UPB_PRIVATE(size) + 1, arena)) {
6793     return NULL;
6794   }
6795   struct google_protobuf_DescriptorProto* sub = (struct google_protobuf_DescriptorProto*)_upb_Message_New(&google__protobuf__DescriptorProto_msg_init, arena);
6796   if (!arr || !sub) return NULL;
6797   UPB_PRIVATE(_upb_Array_Set)
6798   (arr, arr->UPB_PRIVATE(size) - 1, &sub, sizeof(sub));
6799   return sub;
6800 }
google_protobuf_DescriptorProto_mutable_enum_type(google_protobuf_DescriptorProto * msg,size_t * size)6801 UPB_INLINE google_protobuf_EnumDescriptorProto** google_protobuf_DescriptorProto_mutable_enum_type(google_protobuf_DescriptorProto* msg, size_t* size) {
6802   upb_MiniTableField field = {4, UPB_SIZE(20, 48), 0, 2, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
6803   UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__EnumDescriptorProto_msg_init);
6804   upb_Array* arr = upb_Message_GetMutableArray(UPB_UPCAST(msg), &field);
6805   if (arr) {
6806     if (size) *size = arr->UPB_PRIVATE(size);
6807     return (google_protobuf_EnumDescriptorProto**)upb_Array_MutableDataPtr(arr);
6808   } else {
6809     if (size) *size = 0;
6810     return NULL;
6811   }
6812 }
google_protobuf_DescriptorProto_resize_enum_type(google_protobuf_DescriptorProto * msg,size_t size,upb_Arena * arena)6813 UPB_INLINE google_protobuf_EnumDescriptorProto** google_protobuf_DescriptorProto_resize_enum_type(google_protobuf_DescriptorProto* msg, size_t size, upb_Arena* arena) {
6814   upb_MiniTableField field = {4, UPB_SIZE(20, 48), 0, 2, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
6815   return (google_protobuf_EnumDescriptorProto**)upb_Message_ResizeArrayUninitialized(UPB_UPCAST(msg),
6816                                                    &field, size, arena);
6817 }
google_protobuf_DescriptorProto_add_enum_type(google_protobuf_DescriptorProto * msg,upb_Arena * arena)6818 UPB_INLINE struct google_protobuf_EnumDescriptorProto* google_protobuf_DescriptorProto_add_enum_type(google_protobuf_DescriptorProto* msg, upb_Arena* arena) {
6819   upb_MiniTableField field = {4, UPB_SIZE(20, 48), 0, 2, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
6820   UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__EnumDescriptorProto_msg_init);
6821   upb_Array* arr = upb_Message_GetOrCreateMutableArray(
6822       UPB_UPCAST(msg), &field, arena);
6823   if (!arr || !UPB_PRIVATE(_upb_Array_ResizeUninitialized)(
6824                   arr, arr->UPB_PRIVATE(size) + 1, arena)) {
6825     return NULL;
6826   }
6827   struct google_protobuf_EnumDescriptorProto* sub = (struct google_protobuf_EnumDescriptorProto*)_upb_Message_New(&google__protobuf__EnumDescriptorProto_msg_init, arena);
6828   if (!arr || !sub) return NULL;
6829   UPB_PRIVATE(_upb_Array_Set)
6830   (arr, arr->UPB_PRIVATE(size) - 1, &sub, sizeof(sub));
6831   return sub;
6832 }
google_protobuf_DescriptorProto_mutable_extension_range(google_protobuf_DescriptorProto * msg,size_t * size)6833 UPB_INLINE google_protobuf_DescriptorProto_ExtensionRange** google_protobuf_DescriptorProto_mutable_extension_range(google_protobuf_DescriptorProto* msg, size_t* size) {
6834   upb_MiniTableField field = {5, UPB_SIZE(24, 56), 0, 3, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
6835   UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__DescriptorProto__ExtensionRange_msg_init);
6836   upb_Array* arr = upb_Message_GetMutableArray(UPB_UPCAST(msg), &field);
6837   if (arr) {
6838     if (size) *size = arr->UPB_PRIVATE(size);
6839     return (google_protobuf_DescriptorProto_ExtensionRange**)upb_Array_MutableDataPtr(arr);
6840   } else {
6841     if (size) *size = 0;
6842     return NULL;
6843   }
6844 }
google_protobuf_DescriptorProto_resize_extension_range(google_protobuf_DescriptorProto * msg,size_t size,upb_Arena * arena)6845 UPB_INLINE google_protobuf_DescriptorProto_ExtensionRange** google_protobuf_DescriptorProto_resize_extension_range(google_protobuf_DescriptorProto* msg, size_t size, upb_Arena* arena) {
6846   upb_MiniTableField field = {5, UPB_SIZE(24, 56), 0, 3, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
6847   return (google_protobuf_DescriptorProto_ExtensionRange**)upb_Message_ResizeArrayUninitialized(UPB_UPCAST(msg),
6848                                                    &field, size, arena);
6849 }
google_protobuf_DescriptorProto_add_extension_range(google_protobuf_DescriptorProto * msg,upb_Arena * arena)6850 UPB_INLINE struct google_protobuf_DescriptorProto_ExtensionRange* google_protobuf_DescriptorProto_add_extension_range(google_protobuf_DescriptorProto* msg, upb_Arena* arena) {
6851   upb_MiniTableField field = {5, UPB_SIZE(24, 56), 0, 3, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
6852   UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__DescriptorProto__ExtensionRange_msg_init);
6853   upb_Array* arr = upb_Message_GetOrCreateMutableArray(
6854       UPB_UPCAST(msg), &field, arena);
6855   if (!arr || !UPB_PRIVATE(_upb_Array_ResizeUninitialized)(
6856                   arr, arr->UPB_PRIVATE(size) + 1, arena)) {
6857     return NULL;
6858   }
6859   struct google_protobuf_DescriptorProto_ExtensionRange* sub = (struct google_protobuf_DescriptorProto_ExtensionRange*)_upb_Message_New(&google__protobuf__DescriptorProto__ExtensionRange_msg_init, arena);
6860   if (!arr || !sub) return NULL;
6861   UPB_PRIVATE(_upb_Array_Set)
6862   (arr, arr->UPB_PRIVATE(size) - 1, &sub, sizeof(sub));
6863   return sub;
6864 }
google_protobuf_DescriptorProto_mutable_extension(google_protobuf_DescriptorProto * msg,size_t * size)6865 UPB_INLINE google_protobuf_FieldDescriptorProto** google_protobuf_DescriptorProto_mutable_extension(google_protobuf_DescriptorProto* msg, size_t* size) {
6866   upb_MiniTableField field = {6, UPB_SIZE(28, 64), 0, 4, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
6867   UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__FieldDescriptorProto_msg_init);
6868   upb_Array* arr = upb_Message_GetMutableArray(UPB_UPCAST(msg), &field);
6869   if (arr) {
6870     if (size) *size = arr->UPB_PRIVATE(size);
6871     return (google_protobuf_FieldDescriptorProto**)upb_Array_MutableDataPtr(arr);
6872   } else {
6873     if (size) *size = 0;
6874     return NULL;
6875   }
6876 }
google_protobuf_DescriptorProto_resize_extension(google_protobuf_DescriptorProto * msg,size_t size,upb_Arena * arena)6877 UPB_INLINE google_protobuf_FieldDescriptorProto** google_protobuf_DescriptorProto_resize_extension(google_protobuf_DescriptorProto* msg, size_t size, upb_Arena* arena) {
6878   upb_MiniTableField field = {6, UPB_SIZE(28, 64), 0, 4, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
6879   return (google_protobuf_FieldDescriptorProto**)upb_Message_ResizeArrayUninitialized(UPB_UPCAST(msg),
6880                                                    &field, size, arena);
6881 }
google_protobuf_DescriptorProto_add_extension(google_protobuf_DescriptorProto * msg,upb_Arena * arena)6882 UPB_INLINE struct google_protobuf_FieldDescriptorProto* google_protobuf_DescriptorProto_add_extension(google_protobuf_DescriptorProto* msg, upb_Arena* arena) {
6883   upb_MiniTableField field = {6, UPB_SIZE(28, 64), 0, 4, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
6884   UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__FieldDescriptorProto_msg_init);
6885   upb_Array* arr = upb_Message_GetOrCreateMutableArray(
6886       UPB_UPCAST(msg), &field, arena);
6887   if (!arr || !UPB_PRIVATE(_upb_Array_ResizeUninitialized)(
6888                   arr, arr->UPB_PRIVATE(size) + 1, arena)) {
6889     return NULL;
6890   }
6891   struct google_protobuf_FieldDescriptorProto* sub = (struct google_protobuf_FieldDescriptorProto*)_upb_Message_New(&google__protobuf__FieldDescriptorProto_msg_init, arena);
6892   if (!arr || !sub) return NULL;
6893   UPB_PRIVATE(_upb_Array_Set)
6894   (arr, arr->UPB_PRIVATE(size) - 1, &sub, sizeof(sub));
6895   return sub;
6896 }
google_protobuf_DescriptorProto_set_options(google_protobuf_DescriptorProto * msg,google_protobuf_MessageOptions * value)6897 UPB_INLINE void google_protobuf_DescriptorProto_set_options(google_protobuf_DescriptorProto *msg, google_protobuf_MessageOptions* value) {
6898   const upb_MiniTableField field = {7, UPB_SIZE(32, 72), 65, 5, 11, (int)kUpb_FieldMode_Scalar | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
6899   UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__MessageOptions_msg_init);
6900   upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
6901 }
google_protobuf_DescriptorProto_mutable_options(google_protobuf_DescriptorProto * msg,upb_Arena * arena)6902 UPB_INLINE struct google_protobuf_MessageOptions* google_protobuf_DescriptorProto_mutable_options(google_protobuf_DescriptorProto* msg, upb_Arena* arena) {
6903   struct google_protobuf_MessageOptions* sub = (struct google_protobuf_MessageOptions*)google_protobuf_DescriptorProto_options(msg);
6904   if (sub == NULL) {
6905     sub = (struct google_protobuf_MessageOptions*)_upb_Message_New(&google__protobuf__MessageOptions_msg_init, arena);
6906     if (sub) google_protobuf_DescriptorProto_set_options(msg, sub);
6907   }
6908   return sub;
6909 }
google_protobuf_DescriptorProto_mutable_oneof_decl(google_protobuf_DescriptorProto * msg,size_t * size)6910 UPB_INLINE google_protobuf_OneofDescriptorProto** google_protobuf_DescriptorProto_mutable_oneof_decl(google_protobuf_DescriptorProto* msg, size_t* size) {
6911   upb_MiniTableField field = {8, UPB_SIZE(36, 80), 0, 6, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
6912   UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__OneofDescriptorProto_msg_init);
6913   upb_Array* arr = upb_Message_GetMutableArray(UPB_UPCAST(msg), &field);
6914   if (arr) {
6915     if (size) *size = arr->UPB_PRIVATE(size);
6916     return (google_protobuf_OneofDescriptorProto**)upb_Array_MutableDataPtr(arr);
6917   } else {
6918     if (size) *size = 0;
6919     return NULL;
6920   }
6921 }
google_protobuf_DescriptorProto_resize_oneof_decl(google_protobuf_DescriptorProto * msg,size_t size,upb_Arena * arena)6922 UPB_INLINE google_protobuf_OneofDescriptorProto** google_protobuf_DescriptorProto_resize_oneof_decl(google_protobuf_DescriptorProto* msg, size_t size, upb_Arena* arena) {
6923   upb_MiniTableField field = {8, UPB_SIZE(36, 80), 0, 6, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
6924   return (google_protobuf_OneofDescriptorProto**)upb_Message_ResizeArrayUninitialized(UPB_UPCAST(msg),
6925                                                    &field, size, arena);
6926 }
google_protobuf_DescriptorProto_add_oneof_decl(google_protobuf_DescriptorProto * msg,upb_Arena * arena)6927 UPB_INLINE struct google_protobuf_OneofDescriptorProto* google_protobuf_DescriptorProto_add_oneof_decl(google_protobuf_DescriptorProto* msg, upb_Arena* arena) {
6928   upb_MiniTableField field = {8, UPB_SIZE(36, 80), 0, 6, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
6929   UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__OneofDescriptorProto_msg_init);
6930   upb_Array* arr = upb_Message_GetOrCreateMutableArray(
6931       UPB_UPCAST(msg), &field, arena);
6932   if (!arr || !UPB_PRIVATE(_upb_Array_ResizeUninitialized)(
6933                   arr, arr->UPB_PRIVATE(size) + 1, arena)) {
6934     return NULL;
6935   }
6936   struct google_protobuf_OneofDescriptorProto* sub = (struct google_protobuf_OneofDescriptorProto*)_upb_Message_New(&google__protobuf__OneofDescriptorProto_msg_init, arena);
6937   if (!arr || !sub) return NULL;
6938   UPB_PRIVATE(_upb_Array_Set)
6939   (arr, arr->UPB_PRIVATE(size) - 1, &sub, sizeof(sub));
6940   return sub;
6941 }
google_protobuf_DescriptorProto_mutable_reserved_range(google_protobuf_DescriptorProto * msg,size_t * size)6942 UPB_INLINE google_protobuf_DescriptorProto_ReservedRange** google_protobuf_DescriptorProto_mutable_reserved_range(google_protobuf_DescriptorProto* msg, size_t* size) {
6943   upb_MiniTableField field = {9, UPB_SIZE(40, 88), 0, 7, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
6944   UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__DescriptorProto__ReservedRange_msg_init);
6945   upb_Array* arr = upb_Message_GetMutableArray(UPB_UPCAST(msg), &field);
6946   if (arr) {
6947     if (size) *size = arr->UPB_PRIVATE(size);
6948     return (google_protobuf_DescriptorProto_ReservedRange**)upb_Array_MutableDataPtr(arr);
6949   } else {
6950     if (size) *size = 0;
6951     return NULL;
6952   }
6953 }
google_protobuf_DescriptorProto_resize_reserved_range(google_protobuf_DescriptorProto * msg,size_t size,upb_Arena * arena)6954 UPB_INLINE google_protobuf_DescriptorProto_ReservedRange** google_protobuf_DescriptorProto_resize_reserved_range(google_protobuf_DescriptorProto* msg, size_t size, upb_Arena* arena) {
6955   upb_MiniTableField field = {9, UPB_SIZE(40, 88), 0, 7, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
6956   return (google_protobuf_DescriptorProto_ReservedRange**)upb_Message_ResizeArrayUninitialized(UPB_UPCAST(msg),
6957                                                    &field, size, arena);
6958 }
google_protobuf_DescriptorProto_add_reserved_range(google_protobuf_DescriptorProto * msg,upb_Arena * arena)6959 UPB_INLINE struct google_protobuf_DescriptorProto_ReservedRange* google_protobuf_DescriptorProto_add_reserved_range(google_protobuf_DescriptorProto* msg, upb_Arena* arena) {
6960   upb_MiniTableField field = {9, UPB_SIZE(40, 88), 0, 7, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
6961   UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__DescriptorProto__ReservedRange_msg_init);
6962   upb_Array* arr = upb_Message_GetOrCreateMutableArray(
6963       UPB_UPCAST(msg), &field, arena);
6964   if (!arr || !UPB_PRIVATE(_upb_Array_ResizeUninitialized)(
6965                   arr, arr->UPB_PRIVATE(size) + 1, arena)) {
6966     return NULL;
6967   }
6968   struct google_protobuf_DescriptorProto_ReservedRange* sub = (struct google_protobuf_DescriptorProto_ReservedRange*)_upb_Message_New(&google__protobuf__DescriptorProto__ReservedRange_msg_init, arena);
6969   if (!arr || !sub) return NULL;
6970   UPB_PRIVATE(_upb_Array_Set)
6971   (arr, arr->UPB_PRIVATE(size) - 1, &sub, sizeof(sub));
6972   return sub;
6973 }
google_protobuf_DescriptorProto_mutable_reserved_name(google_protobuf_DescriptorProto * msg,size_t * size)6974 UPB_INLINE upb_StringView* google_protobuf_DescriptorProto_mutable_reserved_name(google_protobuf_DescriptorProto* msg, size_t* size) {
6975   upb_MiniTableField field = {10, UPB_SIZE(44, 96), 0, kUpb_NoSub, 12, (int)kUpb_FieldMode_Array | (int)kUpb_LabelFlags_IsAlternate | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
6976   upb_Array* arr = upb_Message_GetMutableArray(UPB_UPCAST(msg), &field);
6977   if (arr) {
6978     if (size) *size = arr->UPB_PRIVATE(size);
6979     return (upb_StringView*)upb_Array_MutableDataPtr(arr);
6980   } else {
6981     if (size) *size = 0;
6982     return NULL;
6983   }
6984 }
google_protobuf_DescriptorProto_resize_reserved_name(google_protobuf_DescriptorProto * msg,size_t size,upb_Arena * arena)6985 UPB_INLINE upb_StringView* google_protobuf_DescriptorProto_resize_reserved_name(google_protobuf_DescriptorProto* msg, size_t size, upb_Arena* arena) {
6986   upb_MiniTableField field = {10, UPB_SIZE(44, 96), 0, kUpb_NoSub, 12, (int)kUpb_FieldMode_Array | (int)kUpb_LabelFlags_IsAlternate | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
6987   return (upb_StringView*)upb_Message_ResizeArrayUninitialized(UPB_UPCAST(msg),
6988                                                    &field, size, arena);
6989 }
google_protobuf_DescriptorProto_add_reserved_name(google_protobuf_DescriptorProto * msg,upb_StringView val,upb_Arena * arena)6990 UPB_INLINE bool google_protobuf_DescriptorProto_add_reserved_name(google_protobuf_DescriptorProto* msg, upb_StringView val, upb_Arena* arena) {
6991   upb_MiniTableField field = {10, UPB_SIZE(44, 96), 0, kUpb_NoSub, 12, (int)kUpb_FieldMode_Array | (int)kUpb_LabelFlags_IsAlternate | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
6992   upb_Array* arr = upb_Message_GetOrCreateMutableArray(
6993       UPB_UPCAST(msg), &field, arena);
6994   if (!arr || !UPB_PRIVATE(_upb_Array_ResizeUninitialized)(
6995                   arr, arr->UPB_PRIVATE(size) + 1, arena)) {
6996     return false;
6997   }
6998   UPB_PRIVATE(_upb_Array_Set)
6999   (arr, arr->UPB_PRIVATE(size) - 1, &val, sizeof(val));
7000   return true;
7001 }
7002 
7003 /* google.protobuf.DescriptorProto.ExtensionRange */
7004 
google_protobuf_DescriptorProto_ExtensionRange_new(upb_Arena * arena)7005 UPB_INLINE google_protobuf_DescriptorProto_ExtensionRange* google_protobuf_DescriptorProto_ExtensionRange_new(upb_Arena* arena) {
7006   return (google_protobuf_DescriptorProto_ExtensionRange*)_upb_Message_New(&google__protobuf__DescriptorProto__ExtensionRange_msg_init, arena);
7007 }
google_protobuf_DescriptorProto_ExtensionRange_parse(const char * buf,size_t size,upb_Arena * arena)7008 UPB_INLINE google_protobuf_DescriptorProto_ExtensionRange* google_protobuf_DescriptorProto_ExtensionRange_parse(const char* buf, size_t size, upb_Arena* arena) {
7009   google_protobuf_DescriptorProto_ExtensionRange* ret = google_protobuf_DescriptorProto_ExtensionRange_new(arena);
7010   if (!ret) return NULL;
7011   if (upb_Decode(buf, size, UPB_UPCAST(ret), &google__protobuf__DescriptorProto__ExtensionRange_msg_init, NULL, 0, arena) !=
7012       kUpb_DecodeStatus_Ok) {
7013     return NULL;
7014   }
7015   return ret;
7016 }
google_protobuf_DescriptorProto_ExtensionRange_parse_ex(const char * buf,size_t size,const upb_ExtensionRegistry * extreg,int options,upb_Arena * arena)7017 UPB_INLINE google_protobuf_DescriptorProto_ExtensionRange* google_protobuf_DescriptorProto_ExtensionRange_parse_ex(const char* buf, size_t size,
7018                            const upb_ExtensionRegistry* extreg,
7019                            int options, upb_Arena* arena) {
7020   google_protobuf_DescriptorProto_ExtensionRange* ret = google_protobuf_DescriptorProto_ExtensionRange_new(arena);
7021   if (!ret) return NULL;
7022   if (upb_Decode(buf, size, UPB_UPCAST(ret), &google__protobuf__DescriptorProto__ExtensionRange_msg_init, extreg, options,
7023                  arena) != kUpb_DecodeStatus_Ok) {
7024     return NULL;
7025   }
7026   return ret;
7027 }
google_protobuf_DescriptorProto_ExtensionRange_serialize(const google_protobuf_DescriptorProto_ExtensionRange * msg,upb_Arena * arena,size_t * len)7028 UPB_INLINE char* google_protobuf_DescriptorProto_ExtensionRange_serialize(const google_protobuf_DescriptorProto_ExtensionRange* msg, upb_Arena* arena, size_t* len) {
7029   char* ptr;
7030   (void)upb_Encode(UPB_UPCAST(msg), &google__protobuf__DescriptorProto__ExtensionRange_msg_init, 0, arena, &ptr, len);
7031   return ptr;
7032 }
google_protobuf_DescriptorProto_ExtensionRange_serialize_ex(const google_protobuf_DescriptorProto_ExtensionRange * msg,int options,upb_Arena * arena,size_t * len)7033 UPB_INLINE char* google_protobuf_DescriptorProto_ExtensionRange_serialize_ex(const google_protobuf_DescriptorProto_ExtensionRange* msg, int options,
7034                                  upb_Arena* arena, size_t* len) {
7035   char* ptr;
7036   (void)upb_Encode(UPB_UPCAST(msg), &google__protobuf__DescriptorProto__ExtensionRange_msg_init, options, arena, &ptr, len);
7037   return ptr;
7038 }
google_protobuf_DescriptorProto_ExtensionRange_clear_start(google_protobuf_DescriptorProto_ExtensionRange * msg)7039 UPB_INLINE void google_protobuf_DescriptorProto_ExtensionRange_clear_start(google_protobuf_DescriptorProto_ExtensionRange* msg) {
7040   const upb_MiniTableField field = {1, 12, 64, kUpb_NoSub, 5, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
7041   upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
7042 }
google_protobuf_DescriptorProto_ExtensionRange_start(const google_protobuf_DescriptorProto_ExtensionRange * msg)7043 UPB_INLINE int32_t google_protobuf_DescriptorProto_ExtensionRange_start(const google_protobuf_DescriptorProto_ExtensionRange* msg) {
7044   int32_t default_val = (int32_t)0;
7045   int32_t ret;
7046   const upb_MiniTableField field = {1, 12, 64, kUpb_NoSub, 5, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
7047   _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field,
7048                                     &default_val, &ret);
7049   return ret;
7050 }
google_protobuf_DescriptorProto_ExtensionRange_has_start(const google_protobuf_DescriptorProto_ExtensionRange * msg)7051 UPB_INLINE bool google_protobuf_DescriptorProto_ExtensionRange_has_start(const google_protobuf_DescriptorProto_ExtensionRange* msg) {
7052   const upb_MiniTableField field = {1, 12, 64, kUpb_NoSub, 5, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
7053   return upb_Message_HasBaseField(UPB_UPCAST(msg), &field);
7054 }
google_protobuf_DescriptorProto_ExtensionRange_clear_end(google_protobuf_DescriptorProto_ExtensionRange * msg)7055 UPB_INLINE void google_protobuf_DescriptorProto_ExtensionRange_clear_end(google_protobuf_DescriptorProto_ExtensionRange* msg) {
7056   const upb_MiniTableField field = {2, 16, 65, kUpb_NoSub, 5, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
7057   upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
7058 }
google_protobuf_DescriptorProto_ExtensionRange_end(const google_protobuf_DescriptorProto_ExtensionRange * msg)7059 UPB_INLINE int32_t google_protobuf_DescriptorProto_ExtensionRange_end(const google_protobuf_DescriptorProto_ExtensionRange* msg) {
7060   int32_t default_val = (int32_t)0;
7061   int32_t ret;
7062   const upb_MiniTableField field = {2, 16, 65, kUpb_NoSub, 5, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
7063   _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field,
7064                                     &default_val, &ret);
7065   return ret;
7066 }
google_protobuf_DescriptorProto_ExtensionRange_has_end(const google_protobuf_DescriptorProto_ExtensionRange * msg)7067 UPB_INLINE bool google_protobuf_DescriptorProto_ExtensionRange_has_end(const google_protobuf_DescriptorProto_ExtensionRange* msg) {
7068   const upb_MiniTableField field = {2, 16, 65, kUpb_NoSub, 5, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
7069   return upb_Message_HasBaseField(UPB_UPCAST(msg), &field);
7070 }
google_protobuf_DescriptorProto_ExtensionRange_clear_options(google_protobuf_DescriptorProto_ExtensionRange * msg)7071 UPB_INLINE void google_protobuf_DescriptorProto_ExtensionRange_clear_options(google_protobuf_DescriptorProto_ExtensionRange* msg) {
7072   const upb_MiniTableField field = {3, UPB_SIZE(20, 24), 66, 0, 11, (int)kUpb_FieldMode_Scalar | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
7073   upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
7074 }
google_protobuf_DescriptorProto_ExtensionRange_options(const google_protobuf_DescriptorProto_ExtensionRange * msg)7075 UPB_INLINE const google_protobuf_ExtensionRangeOptions* google_protobuf_DescriptorProto_ExtensionRange_options(const google_protobuf_DescriptorProto_ExtensionRange* msg) {
7076   const google_protobuf_ExtensionRangeOptions* default_val = NULL;
7077   const google_protobuf_ExtensionRangeOptions* ret;
7078   const upb_MiniTableField field = {3, UPB_SIZE(20, 24), 66, 0, 11, (int)kUpb_FieldMode_Scalar | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
7079   UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__ExtensionRangeOptions_msg_init);
7080   _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field,
7081                                     &default_val, &ret);
7082   return ret;
7083 }
google_protobuf_DescriptorProto_ExtensionRange_has_options(const google_protobuf_DescriptorProto_ExtensionRange * msg)7084 UPB_INLINE bool google_protobuf_DescriptorProto_ExtensionRange_has_options(const google_protobuf_DescriptorProto_ExtensionRange* msg) {
7085   const upb_MiniTableField field = {3, UPB_SIZE(20, 24), 66, 0, 11, (int)kUpb_FieldMode_Scalar | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
7086   return upb_Message_HasBaseField(UPB_UPCAST(msg), &field);
7087 }
7088 
google_protobuf_DescriptorProto_ExtensionRange_set_start(google_protobuf_DescriptorProto_ExtensionRange * msg,int32_t value)7089 UPB_INLINE void google_protobuf_DescriptorProto_ExtensionRange_set_start(google_protobuf_DescriptorProto_ExtensionRange *msg, int32_t value) {
7090   const upb_MiniTableField field = {1, 12, 64, kUpb_NoSub, 5, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
7091   upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
7092 }
google_protobuf_DescriptorProto_ExtensionRange_set_end(google_protobuf_DescriptorProto_ExtensionRange * msg,int32_t value)7093 UPB_INLINE void google_protobuf_DescriptorProto_ExtensionRange_set_end(google_protobuf_DescriptorProto_ExtensionRange *msg, int32_t value) {
7094   const upb_MiniTableField field = {2, 16, 65, kUpb_NoSub, 5, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
7095   upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
7096 }
google_protobuf_DescriptorProto_ExtensionRange_set_options(google_protobuf_DescriptorProto_ExtensionRange * msg,google_protobuf_ExtensionRangeOptions * value)7097 UPB_INLINE void google_protobuf_DescriptorProto_ExtensionRange_set_options(google_protobuf_DescriptorProto_ExtensionRange *msg, google_protobuf_ExtensionRangeOptions* value) {
7098   const upb_MiniTableField field = {3, UPB_SIZE(20, 24), 66, 0, 11, (int)kUpb_FieldMode_Scalar | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
7099   UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__ExtensionRangeOptions_msg_init);
7100   upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
7101 }
google_protobuf_DescriptorProto_ExtensionRange_mutable_options(google_protobuf_DescriptorProto_ExtensionRange * msg,upb_Arena * arena)7102 UPB_INLINE struct google_protobuf_ExtensionRangeOptions* google_protobuf_DescriptorProto_ExtensionRange_mutable_options(google_protobuf_DescriptorProto_ExtensionRange* msg, upb_Arena* arena) {
7103   struct google_protobuf_ExtensionRangeOptions* sub = (struct google_protobuf_ExtensionRangeOptions*)google_protobuf_DescriptorProto_ExtensionRange_options(msg);
7104   if (sub == NULL) {
7105     sub = (struct google_protobuf_ExtensionRangeOptions*)_upb_Message_New(&google__protobuf__ExtensionRangeOptions_msg_init, arena);
7106     if (sub) google_protobuf_DescriptorProto_ExtensionRange_set_options(msg, sub);
7107   }
7108   return sub;
7109 }
7110 
7111 /* google.protobuf.DescriptorProto.ReservedRange */
7112 
google_protobuf_DescriptorProto_ReservedRange_new(upb_Arena * arena)7113 UPB_INLINE google_protobuf_DescriptorProto_ReservedRange* google_protobuf_DescriptorProto_ReservedRange_new(upb_Arena* arena) {
7114   return (google_protobuf_DescriptorProto_ReservedRange*)_upb_Message_New(&google__protobuf__DescriptorProto__ReservedRange_msg_init, arena);
7115 }
google_protobuf_DescriptorProto_ReservedRange_parse(const char * buf,size_t size,upb_Arena * arena)7116 UPB_INLINE google_protobuf_DescriptorProto_ReservedRange* google_protobuf_DescriptorProto_ReservedRange_parse(const char* buf, size_t size, upb_Arena* arena) {
7117   google_protobuf_DescriptorProto_ReservedRange* ret = google_protobuf_DescriptorProto_ReservedRange_new(arena);
7118   if (!ret) return NULL;
7119   if (upb_Decode(buf, size, UPB_UPCAST(ret), &google__protobuf__DescriptorProto__ReservedRange_msg_init, NULL, 0, arena) !=
7120       kUpb_DecodeStatus_Ok) {
7121     return NULL;
7122   }
7123   return ret;
7124 }
google_protobuf_DescriptorProto_ReservedRange_parse_ex(const char * buf,size_t size,const upb_ExtensionRegistry * extreg,int options,upb_Arena * arena)7125 UPB_INLINE google_protobuf_DescriptorProto_ReservedRange* google_protobuf_DescriptorProto_ReservedRange_parse_ex(const char* buf, size_t size,
7126                            const upb_ExtensionRegistry* extreg,
7127                            int options, upb_Arena* arena) {
7128   google_protobuf_DescriptorProto_ReservedRange* ret = google_protobuf_DescriptorProto_ReservedRange_new(arena);
7129   if (!ret) return NULL;
7130   if (upb_Decode(buf, size, UPB_UPCAST(ret), &google__protobuf__DescriptorProto__ReservedRange_msg_init, extreg, options,
7131                  arena) != kUpb_DecodeStatus_Ok) {
7132     return NULL;
7133   }
7134   return ret;
7135 }
google_protobuf_DescriptorProto_ReservedRange_serialize(const google_protobuf_DescriptorProto_ReservedRange * msg,upb_Arena * arena,size_t * len)7136 UPB_INLINE char* google_protobuf_DescriptorProto_ReservedRange_serialize(const google_protobuf_DescriptorProto_ReservedRange* msg, upb_Arena* arena, size_t* len) {
7137   char* ptr;
7138   (void)upb_Encode(UPB_UPCAST(msg), &google__protobuf__DescriptorProto__ReservedRange_msg_init, 0, arena, &ptr, len);
7139   return ptr;
7140 }
google_protobuf_DescriptorProto_ReservedRange_serialize_ex(const google_protobuf_DescriptorProto_ReservedRange * msg,int options,upb_Arena * arena,size_t * len)7141 UPB_INLINE char* google_protobuf_DescriptorProto_ReservedRange_serialize_ex(const google_protobuf_DescriptorProto_ReservedRange* msg, int options,
7142                                  upb_Arena* arena, size_t* len) {
7143   char* ptr;
7144   (void)upb_Encode(UPB_UPCAST(msg), &google__protobuf__DescriptorProto__ReservedRange_msg_init, options, arena, &ptr, len);
7145   return ptr;
7146 }
google_protobuf_DescriptorProto_ReservedRange_clear_start(google_protobuf_DescriptorProto_ReservedRange * msg)7147 UPB_INLINE void google_protobuf_DescriptorProto_ReservedRange_clear_start(google_protobuf_DescriptorProto_ReservedRange* msg) {
7148   const upb_MiniTableField field = {1, 12, 64, kUpb_NoSub, 5, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
7149   upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
7150 }
google_protobuf_DescriptorProto_ReservedRange_start(const google_protobuf_DescriptorProto_ReservedRange * msg)7151 UPB_INLINE int32_t google_protobuf_DescriptorProto_ReservedRange_start(const google_protobuf_DescriptorProto_ReservedRange* msg) {
7152   int32_t default_val = (int32_t)0;
7153   int32_t ret;
7154   const upb_MiniTableField field = {1, 12, 64, kUpb_NoSub, 5, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
7155   _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field,
7156                                     &default_val, &ret);
7157   return ret;
7158 }
google_protobuf_DescriptorProto_ReservedRange_has_start(const google_protobuf_DescriptorProto_ReservedRange * msg)7159 UPB_INLINE bool google_protobuf_DescriptorProto_ReservedRange_has_start(const google_protobuf_DescriptorProto_ReservedRange* msg) {
7160   const upb_MiniTableField field = {1, 12, 64, kUpb_NoSub, 5, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
7161   return upb_Message_HasBaseField(UPB_UPCAST(msg), &field);
7162 }
google_protobuf_DescriptorProto_ReservedRange_clear_end(google_protobuf_DescriptorProto_ReservedRange * msg)7163 UPB_INLINE void google_protobuf_DescriptorProto_ReservedRange_clear_end(google_protobuf_DescriptorProto_ReservedRange* msg) {
7164   const upb_MiniTableField field = {2, 16, 65, kUpb_NoSub, 5, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
7165   upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
7166 }
google_protobuf_DescriptorProto_ReservedRange_end(const google_protobuf_DescriptorProto_ReservedRange * msg)7167 UPB_INLINE int32_t google_protobuf_DescriptorProto_ReservedRange_end(const google_protobuf_DescriptorProto_ReservedRange* msg) {
7168   int32_t default_val = (int32_t)0;
7169   int32_t ret;
7170   const upb_MiniTableField field = {2, 16, 65, kUpb_NoSub, 5, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
7171   _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field,
7172                                     &default_val, &ret);
7173   return ret;
7174 }
google_protobuf_DescriptorProto_ReservedRange_has_end(const google_protobuf_DescriptorProto_ReservedRange * msg)7175 UPB_INLINE bool google_protobuf_DescriptorProto_ReservedRange_has_end(const google_protobuf_DescriptorProto_ReservedRange* msg) {
7176   const upb_MiniTableField field = {2, 16, 65, kUpb_NoSub, 5, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
7177   return upb_Message_HasBaseField(UPB_UPCAST(msg), &field);
7178 }
7179 
google_protobuf_DescriptorProto_ReservedRange_set_start(google_protobuf_DescriptorProto_ReservedRange * msg,int32_t value)7180 UPB_INLINE void google_protobuf_DescriptorProto_ReservedRange_set_start(google_protobuf_DescriptorProto_ReservedRange *msg, int32_t value) {
7181   const upb_MiniTableField field = {1, 12, 64, kUpb_NoSub, 5, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
7182   upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
7183 }
google_protobuf_DescriptorProto_ReservedRange_set_end(google_protobuf_DescriptorProto_ReservedRange * msg,int32_t value)7184 UPB_INLINE void google_protobuf_DescriptorProto_ReservedRange_set_end(google_protobuf_DescriptorProto_ReservedRange *msg, int32_t value) {
7185   const upb_MiniTableField field = {2, 16, 65, kUpb_NoSub, 5, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
7186   upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
7187 }
7188 
7189 /* google.protobuf.ExtensionRangeOptions */
7190 
google_protobuf_ExtensionRangeOptions_new(upb_Arena * arena)7191 UPB_INLINE google_protobuf_ExtensionRangeOptions* google_protobuf_ExtensionRangeOptions_new(upb_Arena* arena) {
7192   return (google_protobuf_ExtensionRangeOptions*)_upb_Message_New(&google__protobuf__ExtensionRangeOptions_msg_init, arena);
7193 }
google_protobuf_ExtensionRangeOptions_parse(const char * buf,size_t size,upb_Arena * arena)7194 UPB_INLINE google_protobuf_ExtensionRangeOptions* google_protobuf_ExtensionRangeOptions_parse(const char* buf, size_t size, upb_Arena* arena) {
7195   google_protobuf_ExtensionRangeOptions* ret = google_protobuf_ExtensionRangeOptions_new(arena);
7196   if (!ret) return NULL;
7197   if (upb_Decode(buf, size, UPB_UPCAST(ret), &google__protobuf__ExtensionRangeOptions_msg_init, NULL, 0, arena) !=
7198       kUpb_DecodeStatus_Ok) {
7199     return NULL;
7200   }
7201   return ret;
7202 }
google_protobuf_ExtensionRangeOptions_parse_ex(const char * buf,size_t size,const upb_ExtensionRegistry * extreg,int options,upb_Arena * arena)7203 UPB_INLINE google_protobuf_ExtensionRangeOptions* google_protobuf_ExtensionRangeOptions_parse_ex(const char* buf, size_t size,
7204                            const upb_ExtensionRegistry* extreg,
7205                            int options, upb_Arena* arena) {
7206   google_protobuf_ExtensionRangeOptions* ret = google_protobuf_ExtensionRangeOptions_new(arena);
7207   if (!ret) return NULL;
7208   if (upb_Decode(buf, size, UPB_UPCAST(ret), &google__protobuf__ExtensionRangeOptions_msg_init, extreg, options,
7209                  arena) != kUpb_DecodeStatus_Ok) {
7210     return NULL;
7211   }
7212   return ret;
7213 }
google_protobuf_ExtensionRangeOptions_serialize(const google_protobuf_ExtensionRangeOptions * msg,upb_Arena * arena,size_t * len)7214 UPB_INLINE char* google_protobuf_ExtensionRangeOptions_serialize(const google_protobuf_ExtensionRangeOptions* msg, upb_Arena* arena, size_t* len) {
7215   char* ptr;
7216   (void)upb_Encode(UPB_UPCAST(msg), &google__protobuf__ExtensionRangeOptions_msg_init, 0, arena, &ptr, len);
7217   return ptr;
7218 }
google_protobuf_ExtensionRangeOptions_serialize_ex(const google_protobuf_ExtensionRangeOptions * msg,int options,upb_Arena * arena,size_t * len)7219 UPB_INLINE char* google_protobuf_ExtensionRangeOptions_serialize_ex(const google_protobuf_ExtensionRangeOptions* msg, int options,
7220                                  upb_Arena* arena, size_t* len) {
7221   char* ptr;
7222   (void)upb_Encode(UPB_UPCAST(msg), &google__protobuf__ExtensionRangeOptions_msg_init, options, arena, &ptr, len);
7223   return ptr;
7224 }
google_protobuf_ExtensionRangeOptions_clear_declaration(google_protobuf_ExtensionRangeOptions * msg)7225 UPB_INLINE void google_protobuf_ExtensionRangeOptions_clear_declaration(google_protobuf_ExtensionRangeOptions* msg) {
7226   const upb_MiniTableField field = {2, UPB_SIZE(12, 16), 0, 0, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
7227   upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
7228 }
google_protobuf_ExtensionRangeOptions_declaration(const google_protobuf_ExtensionRangeOptions * msg,size_t * size)7229 UPB_INLINE const google_protobuf_ExtensionRangeOptions_Declaration* const* google_protobuf_ExtensionRangeOptions_declaration(const google_protobuf_ExtensionRangeOptions* msg, size_t* size) {
7230   const upb_MiniTableField field = {2, UPB_SIZE(12, 16), 0, 0, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
7231   UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__ExtensionRangeOptions__Declaration_msg_init);
7232   const upb_Array* arr = upb_Message_GetArray(UPB_UPCAST(msg), &field);
7233   if (arr) {
7234     if (size) *size = arr->UPB_PRIVATE(size);
7235     return (const google_protobuf_ExtensionRangeOptions_Declaration* const*)upb_Array_DataPtr(arr);
7236   } else {
7237     if (size) *size = 0;
7238     return NULL;
7239   }
7240 }
_google_protobuf_ExtensionRangeOptions_declaration_upb_array(const google_protobuf_ExtensionRangeOptions * msg,size_t * size)7241 UPB_INLINE const upb_Array* _google_protobuf_ExtensionRangeOptions_declaration_upb_array(const google_protobuf_ExtensionRangeOptions* msg, size_t* size) {
7242   const upb_MiniTableField field = {2, UPB_SIZE(12, 16), 0, 0, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
7243   UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__ExtensionRangeOptions__Declaration_msg_init);
7244   const upb_Array* arr = upb_Message_GetArray(UPB_UPCAST(msg), &field);
7245   if (size) {
7246     *size = arr ? arr->UPB_PRIVATE(size) : 0;
7247   }
7248   return arr;
7249 }
_google_protobuf_ExtensionRangeOptions_declaration_mutable_upb_array(google_protobuf_ExtensionRangeOptions * msg,size_t * size,upb_Arena * arena)7250 UPB_INLINE upb_Array* _google_protobuf_ExtensionRangeOptions_declaration_mutable_upb_array(google_protobuf_ExtensionRangeOptions* msg, size_t* size, upb_Arena* arena) {
7251   const upb_MiniTableField field = {2, UPB_SIZE(12, 16), 0, 0, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
7252   UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__ExtensionRangeOptions__Declaration_msg_init);
7253   upb_Array* arr = upb_Message_GetOrCreateMutableArray(UPB_UPCAST(msg),
7254                                                        &field, arena);
7255   if (size) {
7256     *size = arr ? arr->UPB_PRIVATE(size) : 0;
7257   }
7258   return arr;
7259 }
google_protobuf_ExtensionRangeOptions_clear_verification(google_protobuf_ExtensionRangeOptions * msg)7260 UPB_INLINE void google_protobuf_ExtensionRangeOptions_clear_verification(google_protobuf_ExtensionRangeOptions* msg) {
7261   const upb_MiniTableField field = {3, UPB_SIZE(16, 12), 64, 3, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
7262   upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
7263 }
google_protobuf_ExtensionRangeOptions_verification(const google_protobuf_ExtensionRangeOptions * msg)7264 UPB_INLINE int32_t google_protobuf_ExtensionRangeOptions_verification(const google_protobuf_ExtensionRangeOptions* msg) {
7265   int32_t default_val = 1;
7266   int32_t ret;
7267   const upb_MiniTableField field = {3, UPB_SIZE(16, 12), 64, 3, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
7268   _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field,
7269                                     &default_val, &ret);
7270   return ret;
7271 }
google_protobuf_ExtensionRangeOptions_has_verification(const google_protobuf_ExtensionRangeOptions * msg)7272 UPB_INLINE bool google_protobuf_ExtensionRangeOptions_has_verification(const google_protobuf_ExtensionRangeOptions* msg) {
7273   const upb_MiniTableField field = {3, UPB_SIZE(16, 12), 64, 3, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
7274   return upb_Message_HasBaseField(UPB_UPCAST(msg), &field);
7275 }
google_protobuf_ExtensionRangeOptions_clear_features(google_protobuf_ExtensionRangeOptions * msg)7276 UPB_INLINE void google_protobuf_ExtensionRangeOptions_clear_features(google_protobuf_ExtensionRangeOptions* msg) {
7277   const upb_MiniTableField field = {50, UPB_SIZE(20, 24), 65, 1, 11, (int)kUpb_FieldMode_Scalar | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
7278   upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
7279 }
google_protobuf_ExtensionRangeOptions_features(const google_protobuf_ExtensionRangeOptions * msg)7280 UPB_INLINE const google_protobuf_FeatureSet* google_protobuf_ExtensionRangeOptions_features(const google_protobuf_ExtensionRangeOptions* msg) {
7281   const google_protobuf_FeatureSet* default_val = NULL;
7282   const google_protobuf_FeatureSet* ret;
7283   const upb_MiniTableField field = {50, UPB_SIZE(20, 24), 65, 1, 11, (int)kUpb_FieldMode_Scalar | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
7284   UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__FeatureSet_msg_init);
7285   _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field,
7286                                     &default_val, &ret);
7287   return ret;
7288 }
google_protobuf_ExtensionRangeOptions_has_features(const google_protobuf_ExtensionRangeOptions * msg)7289 UPB_INLINE bool google_protobuf_ExtensionRangeOptions_has_features(const google_protobuf_ExtensionRangeOptions* msg) {
7290   const upb_MiniTableField field = {50, UPB_SIZE(20, 24), 65, 1, 11, (int)kUpb_FieldMode_Scalar | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
7291   return upb_Message_HasBaseField(UPB_UPCAST(msg), &field);
7292 }
google_protobuf_ExtensionRangeOptions_clear_uninterpreted_option(google_protobuf_ExtensionRangeOptions * msg)7293 UPB_INLINE void google_protobuf_ExtensionRangeOptions_clear_uninterpreted_option(google_protobuf_ExtensionRangeOptions* msg) {
7294   const upb_MiniTableField field = {999, UPB_SIZE(24, 32), 0, 2, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
7295   upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
7296 }
google_protobuf_ExtensionRangeOptions_uninterpreted_option(const google_protobuf_ExtensionRangeOptions * msg,size_t * size)7297 UPB_INLINE const google_protobuf_UninterpretedOption* const* google_protobuf_ExtensionRangeOptions_uninterpreted_option(const google_protobuf_ExtensionRangeOptions* msg, size_t* size) {
7298   const upb_MiniTableField field = {999, UPB_SIZE(24, 32), 0, 2, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
7299   UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__UninterpretedOption_msg_init);
7300   const upb_Array* arr = upb_Message_GetArray(UPB_UPCAST(msg), &field);
7301   if (arr) {
7302     if (size) *size = arr->UPB_PRIVATE(size);
7303     return (const google_protobuf_UninterpretedOption* const*)upb_Array_DataPtr(arr);
7304   } else {
7305     if (size) *size = 0;
7306     return NULL;
7307   }
7308 }
_google_protobuf_ExtensionRangeOptions_uninterpreted_option_upb_array(const google_protobuf_ExtensionRangeOptions * msg,size_t * size)7309 UPB_INLINE const upb_Array* _google_protobuf_ExtensionRangeOptions_uninterpreted_option_upb_array(const google_protobuf_ExtensionRangeOptions* msg, size_t* size) {
7310   const upb_MiniTableField field = {999, UPB_SIZE(24, 32), 0, 2, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
7311   UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__UninterpretedOption_msg_init);
7312   const upb_Array* arr = upb_Message_GetArray(UPB_UPCAST(msg), &field);
7313   if (size) {
7314     *size = arr ? arr->UPB_PRIVATE(size) : 0;
7315   }
7316   return arr;
7317 }
_google_protobuf_ExtensionRangeOptions_uninterpreted_option_mutable_upb_array(google_protobuf_ExtensionRangeOptions * msg,size_t * size,upb_Arena * arena)7318 UPB_INLINE upb_Array* _google_protobuf_ExtensionRangeOptions_uninterpreted_option_mutable_upb_array(google_protobuf_ExtensionRangeOptions* msg, size_t* size, upb_Arena* arena) {
7319   const upb_MiniTableField field = {999, UPB_SIZE(24, 32), 0, 2, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
7320   UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__UninterpretedOption_msg_init);
7321   upb_Array* arr = upb_Message_GetOrCreateMutableArray(UPB_UPCAST(msg),
7322                                                        &field, arena);
7323   if (size) {
7324     *size = arr ? arr->UPB_PRIVATE(size) : 0;
7325   }
7326   return arr;
7327 }
7328 
google_protobuf_ExtensionRangeOptions_mutable_declaration(google_protobuf_ExtensionRangeOptions * msg,size_t * size)7329 UPB_INLINE google_protobuf_ExtensionRangeOptions_Declaration** google_protobuf_ExtensionRangeOptions_mutable_declaration(google_protobuf_ExtensionRangeOptions* msg, size_t* size) {
7330   upb_MiniTableField field = {2, UPB_SIZE(12, 16), 0, 0, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
7331   UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__ExtensionRangeOptions__Declaration_msg_init);
7332   upb_Array* arr = upb_Message_GetMutableArray(UPB_UPCAST(msg), &field);
7333   if (arr) {
7334     if (size) *size = arr->UPB_PRIVATE(size);
7335     return (google_protobuf_ExtensionRangeOptions_Declaration**)upb_Array_MutableDataPtr(arr);
7336   } else {
7337     if (size) *size = 0;
7338     return NULL;
7339   }
7340 }
google_protobuf_ExtensionRangeOptions_resize_declaration(google_protobuf_ExtensionRangeOptions * msg,size_t size,upb_Arena * arena)7341 UPB_INLINE google_protobuf_ExtensionRangeOptions_Declaration** google_protobuf_ExtensionRangeOptions_resize_declaration(google_protobuf_ExtensionRangeOptions* msg, size_t size, upb_Arena* arena) {
7342   upb_MiniTableField field = {2, UPB_SIZE(12, 16), 0, 0, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
7343   return (google_protobuf_ExtensionRangeOptions_Declaration**)upb_Message_ResizeArrayUninitialized(UPB_UPCAST(msg),
7344                                                    &field, size, arena);
7345 }
google_protobuf_ExtensionRangeOptions_add_declaration(google_protobuf_ExtensionRangeOptions * msg,upb_Arena * arena)7346 UPB_INLINE struct google_protobuf_ExtensionRangeOptions_Declaration* google_protobuf_ExtensionRangeOptions_add_declaration(google_protobuf_ExtensionRangeOptions* msg, upb_Arena* arena) {
7347   upb_MiniTableField field = {2, UPB_SIZE(12, 16), 0, 0, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
7348   UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__ExtensionRangeOptions__Declaration_msg_init);
7349   upb_Array* arr = upb_Message_GetOrCreateMutableArray(
7350       UPB_UPCAST(msg), &field, arena);
7351   if (!arr || !UPB_PRIVATE(_upb_Array_ResizeUninitialized)(
7352                   arr, arr->UPB_PRIVATE(size) + 1, arena)) {
7353     return NULL;
7354   }
7355   struct google_protobuf_ExtensionRangeOptions_Declaration* sub = (struct google_protobuf_ExtensionRangeOptions_Declaration*)_upb_Message_New(&google__protobuf__ExtensionRangeOptions__Declaration_msg_init, arena);
7356   if (!arr || !sub) return NULL;
7357   UPB_PRIVATE(_upb_Array_Set)
7358   (arr, arr->UPB_PRIVATE(size) - 1, &sub, sizeof(sub));
7359   return sub;
7360 }
google_protobuf_ExtensionRangeOptions_set_verification(google_protobuf_ExtensionRangeOptions * msg,int32_t value)7361 UPB_INLINE void google_protobuf_ExtensionRangeOptions_set_verification(google_protobuf_ExtensionRangeOptions *msg, int32_t value) {
7362   const upb_MiniTableField field = {3, UPB_SIZE(16, 12), 64, 3, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
7363   upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
7364 }
google_protobuf_ExtensionRangeOptions_set_features(google_protobuf_ExtensionRangeOptions * msg,google_protobuf_FeatureSet * value)7365 UPB_INLINE void google_protobuf_ExtensionRangeOptions_set_features(google_protobuf_ExtensionRangeOptions *msg, google_protobuf_FeatureSet* value) {
7366   const upb_MiniTableField field = {50, UPB_SIZE(20, 24), 65, 1, 11, (int)kUpb_FieldMode_Scalar | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
7367   UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__FeatureSet_msg_init);
7368   upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
7369 }
google_protobuf_ExtensionRangeOptions_mutable_features(google_protobuf_ExtensionRangeOptions * msg,upb_Arena * arena)7370 UPB_INLINE struct google_protobuf_FeatureSet* google_protobuf_ExtensionRangeOptions_mutable_features(google_protobuf_ExtensionRangeOptions* msg, upb_Arena* arena) {
7371   struct google_protobuf_FeatureSet* sub = (struct google_protobuf_FeatureSet*)google_protobuf_ExtensionRangeOptions_features(msg);
7372   if (sub == NULL) {
7373     sub = (struct google_protobuf_FeatureSet*)_upb_Message_New(&google__protobuf__FeatureSet_msg_init, arena);
7374     if (sub) google_protobuf_ExtensionRangeOptions_set_features(msg, sub);
7375   }
7376   return sub;
7377 }
google_protobuf_ExtensionRangeOptions_mutable_uninterpreted_option(google_protobuf_ExtensionRangeOptions * msg,size_t * size)7378 UPB_INLINE google_protobuf_UninterpretedOption** google_protobuf_ExtensionRangeOptions_mutable_uninterpreted_option(google_protobuf_ExtensionRangeOptions* msg, size_t* size) {
7379   upb_MiniTableField field = {999, UPB_SIZE(24, 32), 0, 2, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
7380   UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__UninterpretedOption_msg_init);
7381   upb_Array* arr = upb_Message_GetMutableArray(UPB_UPCAST(msg), &field);
7382   if (arr) {
7383     if (size) *size = arr->UPB_PRIVATE(size);
7384     return (google_protobuf_UninterpretedOption**)upb_Array_MutableDataPtr(arr);
7385   } else {
7386     if (size) *size = 0;
7387     return NULL;
7388   }
7389 }
google_protobuf_ExtensionRangeOptions_resize_uninterpreted_option(google_protobuf_ExtensionRangeOptions * msg,size_t size,upb_Arena * arena)7390 UPB_INLINE google_protobuf_UninterpretedOption** google_protobuf_ExtensionRangeOptions_resize_uninterpreted_option(google_protobuf_ExtensionRangeOptions* msg, size_t size, upb_Arena* arena) {
7391   upb_MiniTableField field = {999, UPB_SIZE(24, 32), 0, 2, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
7392   return (google_protobuf_UninterpretedOption**)upb_Message_ResizeArrayUninitialized(UPB_UPCAST(msg),
7393                                                    &field, size, arena);
7394 }
google_protobuf_ExtensionRangeOptions_add_uninterpreted_option(google_protobuf_ExtensionRangeOptions * msg,upb_Arena * arena)7395 UPB_INLINE struct google_protobuf_UninterpretedOption* google_protobuf_ExtensionRangeOptions_add_uninterpreted_option(google_protobuf_ExtensionRangeOptions* msg, upb_Arena* arena) {
7396   upb_MiniTableField field = {999, UPB_SIZE(24, 32), 0, 2, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
7397   UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__UninterpretedOption_msg_init);
7398   upb_Array* arr = upb_Message_GetOrCreateMutableArray(
7399       UPB_UPCAST(msg), &field, arena);
7400   if (!arr || !UPB_PRIVATE(_upb_Array_ResizeUninitialized)(
7401                   arr, arr->UPB_PRIVATE(size) + 1, arena)) {
7402     return NULL;
7403   }
7404   struct google_protobuf_UninterpretedOption* sub = (struct google_protobuf_UninterpretedOption*)_upb_Message_New(&google__protobuf__UninterpretedOption_msg_init, arena);
7405   if (!arr || !sub) return NULL;
7406   UPB_PRIVATE(_upb_Array_Set)
7407   (arr, arr->UPB_PRIVATE(size) - 1, &sub, sizeof(sub));
7408   return sub;
7409 }
7410 
7411 /* google.protobuf.ExtensionRangeOptions.Declaration */
7412 
google_protobuf_ExtensionRangeOptions_Declaration_new(upb_Arena * arena)7413 UPB_INLINE google_protobuf_ExtensionRangeOptions_Declaration* google_protobuf_ExtensionRangeOptions_Declaration_new(upb_Arena* arena) {
7414   return (google_protobuf_ExtensionRangeOptions_Declaration*)_upb_Message_New(&google__protobuf__ExtensionRangeOptions__Declaration_msg_init, arena);
7415 }
google_protobuf_ExtensionRangeOptions_Declaration_parse(const char * buf,size_t size,upb_Arena * arena)7416 UPB_INLINE google_protobuf_ExtensionRangeOptions_Declaration* google_protobuf_ExtensionRangeOptions_Declaration_parse(const char* buf, size_t size, upb_Arena* arena) {
7417   google_protobuf_ExtensionRangeOptions_Declaration* ret = google_protobuf_ExtensionRangeOptions_Declaration_new(arena);
7418   if (!ret) return NULL;
7419   if (upb_Decode(buf, size, UPB_UPCAST(ret), &google__protobuf__ExtensionRangeOptions__Declaration_msg_init, NULL, 0, arena) !=
7420       kUpb_DecodeStatus_Ok) {
7421     return NULL;
7422   }
7423   return ret;
7424 }
google_protobuf_ExtensionRangeOptions_Declaration_parse_ex(const char * buf,size_t size,const upb_ExtensionRegistry * extreg,int options,upb_Arena * arena)7425 UPB_INLINE google_protobuf_ExtensionRangeOptions_Declaration* google_protobuf_ExtensionRangeOptions_Declaration_parse_ex(const char* buf, size_t size,
7426                            const upb_ExtensionRegistry* extreg,
7427                            int options, upb_Arena* arena) {
7428   google_protobuf_ExtensionRangeOptions_Declaration* ret = google_protobuf_ExtensionRangeOptions_Declaration_new(arena);
7429   if (!ret) return NULL;
7430   if (upb_Decode(buf, size, UPB_UPCAST(ret), &google__protobuf__ExtensionRangeOptions__Declaration_msg_init, extreg, options,
7431                  arena) != kUpb_DecodeStatus_Ok) {
7432     return NULL;
7433   }
7434   return ret;
7435 }
google_protobuf_ExtensionRangeOptions_Declaration_serialize(const google_protobuf_ExtensionRangeOptions_Declaration * msg,upb_Arena * arena,size_t * len)7436 UPB_INLINE char* google_protobuf_ExtensionRangeOptions_Declaration_serialize(const google_protobuf_ExtensionRangeOptions_Declaration* msg, upb_Arena* arena, size_t* len) {
7437   char* ptr;
7438   (void)upb_Encode(UPB_UPCAST(msg), &google__protobuf__ExtensionRangeOptions__Declaration_msg_init, 0, arena, &ptr, len);
7439   return ptr;
7440 }
google_protobuf_ExtensionRangeOptions_Declaration_serialize_ex(const google_protobuf_ExtensionRangeOptions_Declaration * msg,int options,upb_Arena * arena,size_t * len)7441 UPB_INLINE char* google_protobuf_ExtensionRangeOptions_Declaration_serialize_ex(const google_protobuf_ExtensionRangeOptions_Declaration* msg, int options,
7442                                  upb_Arena* arena, size_t* len) {
7443   char* ptr;
7444   (void)upb_Encode(UPB_UPCAST(msg), &google__protobuf__ExtensionRangeOptions__Declaration_msg_init, options, arena, &ptr, len);
7445   return ptr;
7446 }
google_protobuf_ExtensionRangeOptions_Declaration_clear_number(google_protobuf_ExtensionRangeOptions_Declaration * msg)7447 UPB_INLINE void google_protobuf_ExtensionRangeOptions_Declaration_clear_number(google_protobuf_ExtensionRangeOptions_Declaration* msg) {
7448   const upb_MiniTableField field = {1, 12, 64, kUpb_NoSub, 5, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
7449   upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
7450 }
google_protobuf_ExtensionRangeOptions_Declaration_number(const google_protobuf_ExtensionRangeOptions_Declaration * msg)7451 UPB_INLINE int32_t google_protobuf_ExtensionRangeOptions_Declaration_number(const google_protobuf_ExtensionRangeOptions_Declaration* msg) {
7452   int32_t default_val = (int32_t)0;
7453   int32_t ret;
7454   const upb_MiniTableField field = {1, 12, 64, kUpb_NoSub, 5, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
7455   _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field,
7456                                     &default_val, &ret);
7457   return ret;
7458 }
google_protobuf_ExtensionRangeOptions_Declaration_has_number(const google_protobuf_ExtensionRangeOptions_Declaration * msg)7459 UPB_INLINE bool google_protobuf_ExtensionRangeOptions_Declaration_has_number(const google_protobuf_ExtensionRangeOptions_Declaration* msg) {
7460   const upb_MiniTableField field = {1, 12, 64, kUpb_NoSub, 5, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
7461   return upb_Message_HasBaseField(UPB_UPCAST(msg), &field);
7462 }
google_protobuf_ExtensionRangeOptions_Declaration_clear_full_name(google_protobuf_ExtensionRangeOptions_Declaration * msg)7463 UPB_INLINE void google_protobuf_ExtensionRangeOptions_Declaration_clear_full_name(google_protobuf_ExtensionRangeOptions_Declaration* msg) {
7464   const upb_MiniTableField field = {2, UPB_SIZE(20, 24), 65, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
7465   upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
7466 }
google_protobuf_ExtensionRangeOptions_Declaration_full_name(const google_protobuf_ExtensionRangeOptions_Declaration * msg)7467 UPB_INLINE upb_StringView google_protobuf_ExtensionRangeOptions_Declaration_full_name(const google_protobuf_ExtensionRangeOptions_Declaration* msg) {
7468   upb_StringView default_val = upb_StringView_FromString("");
7469   upb_StringView ret;
7470   const upb_MiniTableField field = {2, UPB_SIZE(20, 24), 65, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
7471   _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field,
7472                                     &default_val, &ret);
7473   return ret;
7474 }
google_protobuf_ExtensionRangeOptions_Declaration_has_full_name(const google_protobuf_ExtensionRangeOptions_Declaration * msg)7475 UPB_INLINE bool google_protobuf_ExtensionRangeOptions_Declaration_has_full_name(const google_protobuf_ExtensionRangeOptions_Declaration* msg) {
7476   const upb_MiniTableField field = {2, UPB_SIZE(20, 24), 65, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
7477   return upb_Message_HasBaseField(UPB_UPCAST(msg), &field);
7478 }
google_protobuf_ExtensionRangeOptions_Declaration_clear_type(google_protobuf_ExtensionRangeOptions_Declaration * msg)7479 UPB_INLINE void google_protobuf_ExtensionRangeOptions_Declaration_clear_type(google_protobuf_ExtensionRangeOptions_Declaration* msg) {
7480   const upb_MiniTableField field = {3, UPB_SIZE(28, 40), 66, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
7481   upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
7482 }
google_protobuf_ExtensionRangeOptions_Declaration_type(const google_protobuf_ExtensionRangeOptions_Declaration * msg)7483 UPB_INLINE upb_StringView google_protobuf_ExtensionRangeOptions_Declaration_type(const google_protobuf_ExtensionRangeOptions_Declaration* msg) {
7484   upb_StringView default_val = upb_StringView_FromString("");
7485   upb_StringView ret;
7486   const upb_MiniTableField field = {3, UPB_SIZE(28, 40), 66, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
7487   _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field,
7488                                     &default_val, &ret);
7489   return ret;
7490 }
google_protobuf_ExtensionRangeOptions_Declaration_has_type(const google_protobuf_ExtensionRangeOptions_Declaration * msg)7491 UPB_INLINE bool google_protobuf_ExtensionRangeOptions_Declaration_has_type(const google_protobuf_ExtensionRangeOptions_Declaration* msg) {
7492   const upb_MiniTableField field = {3, UPB_SIZE(28, 40), 66, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
7493   return upb_Message_HasBaseField(UPB_UPCAST(msg), &field);
7494 }
google_protobuf_ExtensionRangeOptions_Declaration_clear_reserved(google_protobuf_ExtensionRangeOptions_Declaration * msg)7495 UPB_INLINE void google_protobuf_ExtensionRangeOptions_Declaration_clear_reserved(google_protobuf_ExtensionRangeOptions_Declaration* msg) {
7496   const upb_MiniTableField field = {5, 16, 67, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
7497   upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
7498 }
google_protobuf_ExtensionRangeOptions_Declaration_reserved(const google_protobuf_ExtensionRangeOptions_Declaration * msg)7499 UPB_INLINE bool google_protobuf_ExtensionRangeOptions_Declaration_reserved(const google_protobuf_ExtensionRangeOptions_Declaration* msg) {
7500   bool default_val = false;
7501   bool ret;
7502   const upb_MiniTableField field = {5, 16, 67, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
7503   _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field,
7504                                     &default_val, &ret);
7505   return ret;
7506 }
google_protobuf_ExtensionRangeOptions_Declaration_has_reserved(const google_protobuf_ExtensionRangeOptions_Declaration * msg)7507 UPB_INLINE bool google_protobuf_ExtensionRangeOptions_Declaration_has_reserved(const google_protobuf_ExtensionRangeOptions_Declaration* msg) {
7508   const upb_MiniTableField field = {5, 16, 67, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
7509   return upb_Message_HasBaseField(UPB_UPCAST(msg), &field);
7510 }
google_protobuf_ExtensionRangeOptions_Declaration_clear_repeated(google_protobuf_ExtensionRangeOptions_Declaration * msg)7511 UPB_INLINE void google_protobuf_ExtensionRangeOptions_Declaration_clear_repeated(google_protobuf_ExtensionRangeOptions_Declaration* msg) {
7512   const upb_MiniTableField field = {6, 17, 68, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
7513   upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
7514 }
google_protobuf_ExtensionRangeOptions_Declaration_repeated(const google_protobuf_ExtensionRangeOptions_Declaration * msg)7515 UPB_INLINE bool google_protobuf_ExtensionRangeOptions_Declaration_repeated(const google_protobuf_ExtensionRangeOptions_Declaration* msg) {
7516   bool default_val = false;
7517   bool ret;
7518   const upb_MiniTableField field = {6, 17, 68, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
7519   _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field,
7520                                     &default_val, &ret);
7521   return ret;
7522 }
google_protobuf_ExtensionRangeOptions_Declaration_has_repeated(const google_protobuf_ExtensionRangeOptions_Declaration * msg)7523 UPB_INLINE bool google_protobuf_ExtensionRangeOptions_Declaration_has_repeated(const google_protobuf_ExtensionRangeOptions_Declaration* msg) {
7524   const upb_MiniTableField field = {6, 17, 68, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
7525   return upb_Message_HasBaseField(UPB_UPCAST(msg), &field);
7526 }
7527 
google_protobuf_ExtensionRangeOptions_Declaration_set_number(google_protobuf_ExtensionRangeOptions_Declaration * msg,int32_t value)7528 UPB_INLINE void google_protobuf_ExtensionRangeOptions_Declaration_set_number(google_protobuf_ExtensionRangeOptions_Declaration *msg, int32_t value) {
7529   const upb_MiniTableField field = {1, 12, 64, kUpb_NoSub, 5, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
7530   upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
7531 }
google_protobuf_ExtensionRangeOptions_Declaration_set_full_name(google_protobuf_ExtensionRangeOptions_Declaration * msg,upb_StringView value)7532 UPB_INLINE void google_protobuf_ExtensionRangeOptions_Declaration_set_full_name(google_protobuf_ExtensionRangeOptions_Declaration *msg, upb_StringView value) {
7533   const upb_MiniTableField field = {2, UPB_SIZE(20, 24), 65, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
7534   upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
7535 }
google_protobuf_ExtensionRangeOptions_Declaration_set_type(google_protobuf_ExtensionRangeOptions_Declaration * msg,upb_StringView value)7536 UPB_INLINE void google_protobuf_ExtensionRangeOptions_Declaration_set_type(google_protobuf_ExtensionRangeOptions_Declaration *msg, upb_StringView value) {
7537   const upb_MiniTableField field = {3, UPB_SIZE(28, 40), 66, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
7538   upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
7539 }
google_protobuf_ExtensionRangeOptions_Declaration_set_reserved(google_protobuf_ExtensionRangeOptions_Declaration * msg,bool value)7540 UPB_INLINE void google_protobuf_ExtensionRangeOptions_Declaration_set_reserved(google_protobuf_ExtensionRangeOptions_Declaration *msg, bool value) {
7541   const upb_MiniTableField field = {5, 16, 67, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
7542   upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
7543 }
google_protobuf_ExtensionRangeOptions_Declaration_set_repeated(google_protobuf_ExtensionRangeOptions_Declaration * msg,bool value)7544 UPB_INLINE void google_protobuf_ExtensionRangeOptions_Declaration_set_repeated(google_protobuf_ExtensionRangeOptions_Declaration *msg, bool value) {
7545   const upb_MiniTableField field = {6, 17, 68, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
7546   upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
7547 }
7548 
7549 /* google.protobuf.FieldDescriptorProto */
7550 
google_protobuf_FieldDescriptorProto_new(upb_Arena * arena)7551 UPB_INLINE google_protobuf_FieldDescriptorProto* google_protobuf_FieldDescriptorProto_new(upb_Arena* arena) {
7552   return (google_protobuf_FieldDescriptorProto*)_upb_Message_New(&google__protobuf__FieldDescriptorProto_msg_init, arena);
7553 }
google_protobuf_FieldDescriptorProto_parse(const char * buf,size_t size,upb_Arena * arena)7554 UPB_INLINE google_protobuf_FieldDescriptorProto* google_protobuf_FieldDescriptorProto_parse(const char* buf, size_t size, upb_Arena* arena) {
7555   google_protobuf_FieldDescriptorProto* ret = google_protobuf_FieldDescriptorProto_new(arena);
7556   if (!ret) return NULL;
7557   if (upb_Decode(buf, size, UPB_UPCAST(ret), &google__protobuf__FieldDescriptorProto_msg_init, NULL, 0, arena) !=
7558       kUpb_DecodeStatus_Ok) {
7559     return NULL;
7560   }
7561   return ret;
7562 }
google_protobuf_FieldDescriptorProto_parse_ex(const char * buf,size_t size,const upb_ExtensionRegistry * extreg,int options,upb_Arena * arena)7563 UPB_INLINE google_protobuf_FieldDescriptorProto* google_protobuf_FieldDescriptorProto_parse_ex(const char* buf, size_t size,
7564                            const upb_ExtensionRegistry* extreg,
7565                            int options, upb_Arena* arena) {
7566   google_protobuf_FieldDescriptorProto* ret = google_protobuf_FieldDescriptorProto_new(arena);
7567   if (!ret) return NULL;
7568   if (upb_Decode(buf, size, UPB_UPCAST(ret), &google__protobuf__FieldDescriptorProto_msg_init, extreg, options,
7569                  arena) != kUpb_DecodeStatus_Ok) {
7570     return NULL;
7571   }
7572   return ret;
7573 }
google_protobuf_FieldDescriptorProto_serialize(const google_protobuf_FieldDescriptorProto * msg,upb_Arena * arena,size_t * len)7574 UPB_INLINE char* google_protobuf_FieldDescriptorProto_serialize(const google_protobuf_FieldDescriptorProto* msg, upb_Arena* arena, size_t* len) {
7575   char* ptr;
7576   (void)upb_Encode(UPB_UPCAST(msg), &google__protobuf__FieldDescriptorProto_msg_init, 0, arena, &ptr, len);
7577   return ptr;
7578 }
google_protobuf_FieldDescriptorProto_serialize_ex(const google_protobuf_FieldDescriptorProto * msg,int options,upb_Arena * arena,size_t * len)7579 UPB_INLINE char* google_protobuf_FieldDescriptorProto_serialize_ex(const google_protobuf_FieldDescriptorProto* msg, int options,
7580                                  upb_Arena* arena, size_t* len) {
7581   char* ptr;
7582   (void)upb_Encode(UPB_UPCAST(msg), &google__protobuf__FieldDescriptorProto_msg_init, options, arena, &ptr, len);
7583   return ptr;
7584 }
google_protobuf_FieldDescriptorProto_clear_name(google_protobuf_FieldDescriptorProto * msg)7585 UPB_INLINE void google_protobuf_FieldDescriptorProto_clear_name(google_protobuf_FieldDescriptorProto* msg) {
7586   const upb_MiniTableField field = {1, UPB_SIZE(36, 32), 64, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
7587   upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
7588 }
google_protobuf_FieldDescriptorProto_name(const google_protobuf_FieldDescriptorProto * msg)7589 UPB_INLINE upb_StringView google_protobuf_FieldDescriptorProto_name(const google_protobuf_FieldDescriptorProto* msg) {
7590   upb_StringView default_val = upb_StringView_FromString("");
7591   upb_StringView ret;
7592   const upb_MiniTableField field = {1, UPB_SIZE(36, 32), 64, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
7593   _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field,
7594                                     &default_val, &ret);
7595   return ret;
7596 }
google_protobuf_FieldDescriptorProto_has_name(const google_protobuf_FieldDescriptorProto * msg)7597 UPB_INLINE bool google_protobuf_FieldDescriptorProto_has_name(const google_protobuf_FieldDescriptorProto* msg) {
7598   const upb_MiniTableField field = {1, UPB_SIZE(36, 32), 64, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
7599   return upb_Message_HasBaseField(UPB_UPCAST(msg), &field);
7600 }
google_protobuf_FieldDescriptorProto_clear_extendee(google_protobuf_FieldDescriptorProto * msg)7601 UPB_INLINE void google_protobuf_FieldDescriptorProto_clear_extendee(google_protobuf_FieldDescriptorProto* msg) {
7602   const upb_MiniTableField field = {2, UPB_SIZE(44, 48), 65, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
7603   upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
7604 }
google_protobuf_FieldDescriptorProto_extendee(const google_protobuf_FieldDescriptorProto * msg)7605 UPB_INLINE upb_StringView google_protobuf_FieldDescriptorProto_extendee(const google_protobuf_FieldDescriptorProto* msg) {
7606   upb_StringView default_val = upb_StringView_FromString("");
7607   upb_StringView ret;
7608   const upb_MiniTableField field = {2, UPB_SIZE(44, 48), 65, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
7609   _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field,
7610                                     &default_val, &ret);
7611   return ret;
7612 }
google_protobuf_FieldDescriptorProto_has_extendee(const google_protobuf_FieldDescriptorProto * msg)7613 UPB_INLINE bool google_protobuf_FieldDescriptorProto_has_extendee(const google_protobuf_FieldDescriptorProto* msg) {
7614   const upb_MiniTableField field = {2, UPB_SIZE(44, 48), 65, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
7615   return upb_Message_HasBaseField(UPB_UPCAST(msg), &field);
7616 }
google_protobuf_FieldDescriptorProto_clear_number(google_protobuf_FieldDescriptorProto * msg)7617 UPB_INLINE void google_protobuf_FieldDescriptorProto_clear_number(google_protobuf_FieldDescriptorProto* msg) {
7618   const upb_MiniTableField field = {3, 12, 66, kUpb_NoSub, 5, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
7619   upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
7620 }
google_protobuf_FieldDescriptorProto_number(const google_protobuf_FieldDescriptorProto * msg)7621 UPB_INLINE int32_t google_protobuf_FieldDescriptorProto_number(const google_protobuf_FieldDescriptorProto* msg) {
7622   int32_t default_val = (int32_t)0;
7623   int32_t ret;
7624   const upb_MiniTableField field = {3, 12, 66, kUpb_NoSub, 5, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
7625   _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field,
7626                                     &default_val, &ret);
7627   return ret;
7628 }
google_protobuf_FieldDescriptorProto_has_number(const google_protobuf_FieldDescriptorProto * msg)7629 UPB_INLINE bool google_protobuf_FieldDescriptorProto_has_number(const google_protobuf_FieldDescriptorProto* msg) {
7630   const upb_MiniTableField field = {3, 12, 66, kUpb_NoSub, 5, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
7631   return upb_Message_HasBaseField(UPB_UPCAST(msg), &field);
7632 }
google_protobuf_FieldDescriptorProto_clear_label(google_protobuf_FieldDescriptorProto * msg)7633 UPB_INLINE void google_protobuf_FieldDescriptorProto_clear_label(google_protobuf_FieldDescriptorProto* msg) {
7634   const upb_MiniTableField field = {4, 16, 67, 1, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
7635   upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
7636 }
google_protobuf_FieldDescriptorProto_label(const google_protobuf_FieldDescriptorProto * msg)7637 UPB_INLINE int32_t google_protobuf_FieldDescriptorProto_label(const google_protobuf_FieldDescriptorProto* msg) {
7638   int32_t default_val = 1;
7639   int32_t ret;
7640   const upb_MiniTableField field = {4, 16, 67, 1, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
7641   _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field,
7642                                     &default_val, &ret);
7643   return ret;
7644 }
google_protobuf_FieldDescriptorProto_has_label(const google_protobuf_FieldDescriptorProto * msg)7645 UPB_INLINE bool google_protobuf_FieldDescriptorProto_has_label(const google_protobuf_FieldDescriptorProto* msg) {
7646   const upb_MiniTableField field = {4, 16, 67, 1, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
7647   return upb_Message_HasBaseField(UPB_UPCAST(msg), &field);
7648 }
google_protobuf_FieldDescriptorProto_clear_type(google_protobuf_FieldDescriptorProto * msg)7649 UPB_INLINE void google_protobuf_FieldDescriptorProto_clear_type(google_protobuf_FieldDescriptorProto* msg) {
7650   const upb_MiniTableField field = {5, 20, 68, 2, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
7651   upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
7652 }
google_protobuf_FieldDescriptorProto_type(const google_protobuf_FieldDescriptorProto * msg)7653 UPB_INLINE int32_t google_protobuf_FieldDescriptorProto_type(const google_protobuf_FieldDescriptorProto* msg) {
7654   int32_t default_val = 1;
7655   int32_t ret;
7656   const upb_MiniTableField field = {5, 20, 68, 2, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
7657   _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field,
7658                                     &default_val, &ret);
7659   return ret;
7660 }
google_protobuf_FieldDescriptorProto_has_type(const google_protobuf_FieldDescriptorProto * msg)7661 UPB_INLINE bool google_protobuf_FieldDescriptorProto_has_type(const google_protobuf_FieldDescriptorProto* msg) {
7662   const upb_MiniTableField field = {5, 20, 68, 2, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
7663   return upb_Message_HasBaseField(UPB_UPCAST(msg), &field);
7664 }
google_protobuf_FieldDescriptorProto_clear_type_name(google_protobuf_FieldDescriptorProto * msg)7665 UPB_INLINE void google_protobuf_FieldDescriptorProto_clear_type_name(google_protobuf_FieldDescriptorProto* msg) {
7666   const upb_MiniTableField field = {6, UPB_SIZE(52, 64), 69, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
7667   upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
7668 }
google_protobuf_FieldDescriptorProto_type_name(const google_protobuf_FieldDescriptorProto * msg)7669 UPB_INLINE upb_StringView google_protobuf_FieldDescriptorProto_type_name(const google_protobuf_FieldDescriptorProto* msg) {
7670   upb_StringView default_val = upb_StringView_FromString("");
7671   upb_StringView ret;
7672   const upb_MiniTableField field = {6, UPB_SIZE(52, 64), 69, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
7673   _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field,
7674                                     &default_val, &ret);
7675   return ret;
7676 }
google_protobuf_FieldDescriptorProto_has_type_name(const google_protobuf_FieldDescriptorProto * msg)7677 UPB_INLINE bool google_protobuf_FieldDescriptorProto_has_type_name(const google_protobuf_FieldDescriptorProto* msg) {
7678   const upb_MiniTableField field = {6, UPB_SIZE(52, 64), 69, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
7679   return upb_Message_HasBaseField(UPB_UPCAST(msg), &field);
7680 }
google_protobuf_FieldDescriptorProto_clear_default_value(google_protobuf_FieldDescriptorProto * msg)7681 UPB_INLINE void google_protobuf_FieldDescriptorProto_clear_default_value(google_protobuf_FieldDescriptorProto* msg) {
7682   const upb_MiniTableField field = {7, UPB_SIZE(60, 80), 70, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
7683   upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
7684 }
google_protobuf_FieldDescriptorProto_default_value(const google_protobuf_FieldDescriptorProto * msg)7685 UPB_INLINE upb_StringView google_protobuf_FieldDescriptorProto_default_value(const google_protobuf_FieldDescriptorProto* msg) {
7686   upb_StringView default_val = upb_StringView_FromString("");
7687   upb_StringView ret;
7688   const upb_MiniTableField field = {7, UPB_SIZE(60, 80), 70, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
7689   _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field,
7690                                     &default_val, &ret);
7691   return ret;
7692 }
google_protobuf_FieldDescriptorProto_has_default_value(const google_protobuf_FieldDescriptorProto * msg)7693 UPB_INLINE bool google_protobuf_FieldDescriptorProto_has_default_value(const google_protobuf_FieldDescriptorProto* msg) {
7694   const upb_MiniTableField field = {7, UPB_SIZE(60, 80), 70, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
7695   return upb_Message_HasBaseField(UPB_UPCAST(msg), &field);
7696 }
google_protobuf_FieldDescriptorProto_clear_options(google_protobuf_FieldDescriptorProto * msg)7697 UPB_INLINE void google_protobuf_FieldDescriptorProto_clear_options(google_protobuf_FieldDescriptorProto* msg) {
7698   const upb_MiniTableField field = {8, UPB_SIZE(24, 96), 71, 0, 11, (int)kUpb_FieldMode_Scalar | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
7699   upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
7700 }
google_protobuf_FieldDescriptorProto_options(const google_protobuf_FieldDescriptorProto * msg)7701 UPB_INLINE const google_protobuf_FieldOptions* google_protobuf_FieldDescriptorProto_options(const google_protobuf_FieldDescriptorProto* msg) {
7702   const google_protobuf_FieldOptions* default_val = NULL;
7703   const google_protobuf_FieldOptions* ret;
7704   const upb_MiniTableField field = {8, UPB_SIZE(24, 96), 71, 0, 11, (int)kUpb_FieldMode_Scalar | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
7705   UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__FieldOptions_msg_init);
7706   _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field,
7707                                     &default_val, &ret);
7708   return ret;
7709 }
google_protobuf_FieldDescriptorProto_has_options(const google_protobuf_FieldDescriptorProto * msg)7710 UPB_INLINE bool google_protobuf_FieldDescriptorProto_has_options(const google_protobuf_FieldDescriptorProto* msg) {
7711   const upb_MiniTableField field = {8, UPB_SIZE(24, 96), 71, 0, 11, (int)kUpb_FieldMode_Scalar | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
7712   return upb_Message_HasBaseField(UPB_UPCAST(msg), &field);
7713 }
google_protobuf_FieldDescriptorProto_clear_oneof_index(google_protobuf_FieldDescriptorProto * msg)7714 UPB_INLINE void google_protobuf_FieldDescriptorProto_clear_oneof_index(google_protobuf_FieldDescriptorProto* msg) {
7715   const upb_MiniTableField field = {9, UPB_SIZE(28, 24), 72, kUpb_NoSub, 5, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
7716   upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
7717 }
google_protobuf_FieldDescriptorProto_oneof_index(const google_protobuf_FieldDescriptorProto * msg)7718 UPB_INLINE int32_t google_protobuf_FieldDescriptorProto_oneof_index(const google_protobuf_FieldDescriptorProto* msg) {
7719   int32_t default_val = (int32_t)0;
7720   int32_t ret;
7721   const upb_MiniTableField field = {9, UPB_SIZE(28, 24), 72, kUpb_NoSub, 5, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
7722   _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field,
7723                                     &default_val, &ret);
7724   return ret;
7725 }
google_protobuf_FieldDescriptorProto_has_oneof_index(const google_protobuf_FieldDescriptorProto * msg)7726 UPB_INLINE bool google_protobuf_FieldDescriptorProto_has_oneof_index(const google_protobuf_FieldDescriptorProto* msg) {
7727   const upb_MiniTableField field = {9, UPB_SIZE(28, 24), 72, kUpb_NoSub, 5, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
7728   return upb_Message_HasBaseField(UPB_UPCAST(msg), &field);
7729 }
google_protobuf_FieldDescriptorProto_clear_json_name(google_protobuf_FieldDescriptorProto * msg)7730 UPB_INLINE void google_protobuf_FieldDescriptorProto_clear_json_name(google_protobuf_FieldDescriptorProto* msg) {
7731   const upb_MiniTableField field = {10, UPB_SIZE(68, 104), 73, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
7732   upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
7733 }
google_protobuf_FieldDescriptorProto_json_name(const google_protobuf_FieldDescriptorProto * msg)7734 UPB_INLINE upb_StringView google_protobuf_FieldDescriptorProto_json_name(const google_protobuf_FieldDescriptorProto* msg) {
7735   upb_StringView default_val = upb_StringView_FromString("");
7736   upb_StringView ret;
7737   const upb_MiniTableField field = {10, UPB_SIZE(68, 104), 73, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
7738   _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field,
7739                                     &default_val, &ret);
7740   return ret;
7741 }
google_protobuf_FieldDescriptorProto_has_json_name(const google_protobuf_FieldDescriptorProto * msg)7742 UPB_INLINE bool google_protobuf_FieldDescriptorProto_has_json_name(const google_protobuf_FieldDescriptorProto* msg) {
7743   const upb_MiniTableField field = {10, UPB_SIZE(68, 104), 73, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
7744   return upb_Message_HasBaseField(UPB_UPCAST(msg), &field);
7745 }
google_protobuf_FieldDescriptorProto_clear_proto3_optional(google_protobuf_FieldDescriptorProto * msg)7746 UPB_INLINE void google_protobuf_FieldDescriptorProto_clear_proto3_optional(google_protobuf_FieldDescriptorProto* msg) {
7747   const upb_MiniTableField field = {17, UPB_SIZE(32, 28), 74, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
7748   upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
7749 }
google_protobuf_FieldDescriptorProto_proto3_optional(const google_protobuf_FieldDescriptorProto * msg)7750 UPB_INLINE bool google_protobuf_FieldDescriptorProto_proto3_optional(const google_protobuf_FieldDescriptorProto* msg) {
7751   bool default_val = false;
7752   bool ret;
7753   const upb_MiniTableField field = {17, UPB_SIZE(32, 28), 74, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
7754   _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field,
7755                                     &default_val, &ret);
7756   return ret;
7757 }
google_protobuf_FieldDescriptorProto_has_proto3_optional(const google_protobuf_FieldDescriptorProto * msg)7758 UPB_INLINE bool google_protobuf_FieldDescriptorProto_has_proto3_optional(const google_protobuf_FieldDescriptorProto* msg) {
7759   const upb_MiniTableField field = {17, UPB_SIZE(32, 28), 74, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
7760   return upb_Message_HasBaseField(UPB_UPCAST(msg), &field);
7761 }
7762 
google_protobuf_FieldDescriptorProto_set_name(google_protobuf_FieldDescriptorProto * msg,upb_StringView value)7763 UPB_INLINE void google_protobuf_FieldDescriptorProto_set_name(google_protobuf_FieldDescriptorProto *msg, upb_StringView value) {
7764   const upb_MiniTableField field = {1, UPB_SIZE(36, 32), 64, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
7765   upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
7766 }
google_protobuf_FieldDescriptorProto_set_extendee(google_protobuf_FieldDescriptorProto * msg,upb_StringView value)7767 UPB_INLINE void google_protobuf_FieldDescriptorProto_set_extendee(google_protobuf_FieldDescriptorProto *msg, upb_StringView value) {
7768   const upb_MiniTableField field = {2, UPB_SIZE(44, 48), 65, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
7769   upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
7770 }
google_protobuf_FieldDescriptorProto_set_number(google_protobuf_FieldDescriptorProto * msg,int32_t value)7771 UPB_INLINE void google_protobuf_FieldDescriptorProto_set_number(google_protobuf_FieldDescriptorProto *msg, int32_t value) {
7772   const upb_MiniTableField field = {3, 12, 66, kUpb_NoSub, 5, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
7773   upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
7774 }
google_protobuf_FieldDescriptorProto_set_label(google_protobuf_FieldDescriptorProto * msg,int32_t value)7775 UPB_INLINE void google_protobuf_FieldDescriptorProto_set_label(google_protobuf_FieldDescriptorProto *msg, int32_t value) {
7776   const upb_MiniTableField field = {4, 16, 67, 1, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
7777   upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
7778 }
google_protobuf_FieldDescriptorProto_set_type(google_protobuf_FieldDescriptorProto * msg,int32_t value)7779 UPB_INLINE void google_protobuf_FieldDescriptorProto_set_type(google_protobuf_FieldDescriptorProto *msg, int32_t value) {
7780   const upb_MiniTableField field = {5, 20, 68, 2, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
7781   upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
7782 }
google_protobuf_FieldDescriptorProto_set_type_name(google_protobuf_FieldDescriptorProto * msg,upb_StringView value)7783 UPB_INLINE void google_protobuf_FieldDescriptorProto_set_type_name(google_protobuf_FieldDescriptorProto *msg, upb_StringView value) {
7784   const upb_MiniTableField field = {6, UPB_SIZE(52, 64), 69, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
7785   upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
7786 }
google_protobuf_FieldDescriptorProto_set_default_value(google_protobuf_FieldDescriptorProto * msg,upb_StringView value)7787 UPB_INLINE void google_protobuf_FieldDescriptorProto_set_default_value(google_protobuf_FieldDescriptorProto *msg, upb_StringView value) {
7788   const upb_MiniTableField field = {7, UPB_SIZE(60, 80), 70, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
7789   upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
7790 }
google_protobuf_FieldDescriptorProto_set_options(google_protobuf_FieldDescriptorProto * msg,google_protobuf_FieldOptions * value)7791 UPB_INLINE void google_protobuf_FieldDescriptorProto_set_options(google_protobuf_FieldDescriptorProto *msg, google_protobuf_FieldOptions* value) {
7792   const upb_MiniTableField field = {8, UPB_SIZE(24, 96), 71, 0, 11, (int)kUpb_FieldMode_Scalar | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
7793   UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__FieldOptions_msg_init);
7794   upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
7795 }
google_protobuf_FieldDescriptorProto_mutable_options(google_protobuf_FieldDescriptorProto * msg,upb_Arena * arena)7796 UPB_INLINE struct google_protobuf_FieldOptions* google_protobuf_FieldDescriptorProto_mutable_options(google_protobuf_FieldDescriptorProto* msg, upb_Arena* arena) {
7797   struct google_protobuf_FieldOptions* sub = (struct google_protobuf_FieldOptions*)google_protobuf_FieldDescriptorProto_options(msg);
7798   if (sub == NULL) {
7799     sub = (struct google_protobuf_FieldOptions*)_upb_Message_New(&google__protobuf__FieldOptions_msg_init, arena);
7800     if (sub) google_protobuf_FieldDescriptorProto_set_options(msg, sub);
7801   }
7802   return sub;
7803 }
google_protobuf_FieldDescriptorProto_set_oneof_index(google_protobuf_FieldDescriptorProto * msg,int32_t value)7804 UPB_INLINE void google_protobuf_FieldDescriptorProto_set_oneof_index(google_protobuf_FieldDescriptorProto *msg, int32_t value) {
7805   const upb_MiniTableField field = {9, UPB_SIZE(28, 24), 72, kUpb_NoSub, 5, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
7806   upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
7807 }
google_protobuf_FieldDescriptorProto_set_json_name(google_protobuf_FieldDescriptorProto * msg,upb_StringView value)7808 UPB_INLINE void google_protobuf_FieldDescriptorProto_set_json_name(google_protobuf_FieldDescriptorProto *msg, upb_StringView value) {
7809   const upb_MiniTableField field = {10, UPB_SIZE(68, 104), 73, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
7810   upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
7811 }
google_protobuf_FieldDescriptorProto_set_proto3_optional(google_protobuf_FieldDescriptorProto * msg,bool value)7812 UPB_INLINE void google_protobuf_FieldDescriptorProto_set_proto3_optional(google_protobuf_FieldDescriptorProto *msg, bool value) {
7813   const upb_MiniTableField field = {17, UPB_SIZE(32, 28), 74, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
7814   upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
7815 }
7816 
7817 /* google.protobuf.OneofDescriptorProto */
7818 
google_protobuf_OneofDescriptorProto_new(upb_Arena * arena)7819 UPB_INLINE google_protobuf_OneofDescriptorProto* google_protobuf_OneofDescriptorProto_new(upb_Arena* arena) {
7820   return (google_protobuf_OneofDescriptorProto*)_upb_Message_New(&google__protobuf__OneofDescriptorProto_msg_init, arena);
7821 }
google_protobuf_OneofDescriptorProto_parse(const char * buf,size_t size,upb_Arena * arena)7822 UPB_INLINE google_protobuf_OneofDescriptorProto* google_protobuf_OneofDescriptorProto_parse(const char* buf, size_t size, upb_Arena* arena) {
7823   google_protobuf_OneofDescriptorProto* ret = google_protobuf_OneofDescriptorProto_new(arena);
7824   if (!ret) return NULL;
7825   if (upb_Decode(buf, size, UPB_UPCAST(ret), &google__protobuf__OneofDescriptorProto_msg_init, NULL, 0, arena) !=
7826       kUpb_DecodeStatus_Ok) {
7827     return NULL;
7828   }
7829   return ret;
7830 }
google_protobuf_OneofDescriptorProto_parse_ex(const char * buf,size_t size,const upb_ExtensionRegistry * extreg,int options,upb_Arena * arena)7831 UPB_INLINE google_protobuf_OneofDescriptorProto* google_protobuf_OneofDescriptorProto_parse_ex(const char* buf, size_t size,
7832                            const upb_ExtensionRegistry* extreg,
7833                            int options, upb_Arena* arena) {
7834   google_protobuf_OneofDescriptorProto* ret = google_protobuf_OneofDescriptorProto_new(arena);
7835   if (!ret) return NULL;
7836   if (upb_Decode(buf, size, UPB_UPCAST(ret), &google__protobuf__OneofDescriptorProto_msg_init, extreg, options,
7837                  arena) != kUpb_DecodeStatus_Ok) {
7838     return NULL;
7839   }
7840   return ret;
7841 }
google_protobuf_OneofDescriptorProto_serialize(const google_protobuf_OneofDescriptorProto * msg,upb_Arena * arena,size_t * len)7842 UPB_INLINE char* google_protobuf_OneofDescriptorProto_serialize(const google_protobuf_OneofDescriptorProto* msg, upb_Arena* arena, size_t* len) {
7843   char* ptr;
7844   (void)upb_Encode(UPB_UPCAST(msg), &google__protobuf__OneofDescriptorProto_msg_init, 0, arena, &ptr, len);
7845   return ptr;
7846 }
google_protobuf_OneofDescriptorProto_serialize_ex(const google_protobuf_OneofDescriptorProto * msg,int options,upb_Arena * arena,size_t * len)7847 UPB_INLINE char* google_protobuf_OneofDescriptorProto_serialize_ex(const google_protobuf_OneofDescriptorProto* msg, int options,
7848                                  upb_Arena* arena, size_t* len) {
7849   char* ptr;
7850   (void)upb_Encode(UPB_UPCAST(msg), &google__protobuf__OneofDescriptorProto_msg_init, options, arena, &ptr, len);
7851   return ptr;
7852 }
google_protobuf_OneofDescriptorProto_clear_name(google_protobuf_OneofDescriptorProto * msg)7853 UPB_INLINE void google_protobuf_OneofDescriptorProto_clear_name(google_protobuf_OneofDescriptorProto* msg) {
7854   const upb_MiniTableField field = {1, 16, 64, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
7855   upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
7856 }
google_protobuf_OneofDescriptorProto_name(const google_protobuf_OneofDescriptorProto * msg)7857 UPB_INLINE upb_StringView google_protobuf_OneofDescriptorProto_name(const google_protobuf_OneofDescriptorProto* msg) {
7858   upb_StringView default_val = upb_StringView_FromString("");
7859   upb_StringView ret;
7860   const upb_MiniTableField field = {1, 16, 64, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
7861   _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field,
7862                                     &default_val, &ret);
7863   return ret;
7864 }
google_protobuf_OneofDescriptorProto_has_name(const google_protobuf_OneofDescriptorProto * msg)7865 UPB_INLINE bool google_protobuf_OneofDescriptorProto_has_name(const google_protobuf_OneofDescriptorProto* msg) {
7866   const upb_MiniTableField field = {1, 16, 64, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
7867   return upb_Message_HasBaseField(UPB_UPCAST(msg), &field);
7868 }
google_protobuf_OneofDescriptorProto_clear_options(google_protobuf_OneofDescriptorProto * msg)7869 UPB_INLINE void google_protobuf_OneofDescriptorProto_clear_options(google_protobuf_OneofDescriptorProto* msg) {
7870   const upb_MiniTableField field = {2, UPB_SIZE(12, 32), 65, 0, 11, (int)kUpb_FieldMode_Scalar | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
7871   upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
7872 }
google_protobuf_OneofDescriptorProto_options(const google_protobuf_OneofDescriptorProto * msg)7873 UPB_INLINE const google_protobuf_OneofOptions* google_protobuf_OneofDescriptorProto_options(const google_protobuf_OneofDescriptorProto* msg) {
7874   const google_protobuf_OneofOptions* default_val = NULL;
7875   const google_protobuf_OneofOptions* ret;
7876   const upb_MiniTableField field = {2, UPB_SIZE(12, 32), 65, 0, 11, (int)kUpb_FieldMode_Scalar | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
7877   UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__OneofOptions_msg_init);
7878   _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field,
7879                                     &default_val, &ret);
7880   return ret;
7881 }
google_protobuf_OneofDescriptorProto_has_options(const google_protobuf_OneofDescriptorProto * msg)7882 UPB_INLINE bool google_protobuf_OneofDescriptorProto_has_options(const google_protobuf_OneofDescriptorProto* msg) {
7883   const upb_MiniTableField field = {2, UPB_SIZE(12, 32), 65, 0, 11, (int)kUpb_FieldMode_Scalar | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
7884   return upb_Message_HasBaseField(UPB_UPCAST(msg), &field);
7885 }
7886 
google_protobuf_OneofDescriptorProto_set_name(google_protobuf_OneofDescriptorProto * msg,upb_StringView value)7887 UPB_INLINE void google_protobuf_OneofDescriptorProto_set_name(google_protobuf_OneofDescriptorProto *msg, upb_StringView value) {
7888   const upb_MiniTableField field = {1, 16, 64, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
7889   upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
7890 }
google_protobuf_OneofDescriptorProto_set_options(google_protobuf_OneofDescriptorProto * msg,google_protobuf_OneofOptions * value)7891 UPB_INLINE void google_protobuf_OneofDescriptorProto_set_options(google_protobuf_OneofDescriptorProto *msg, google_protobuf_OneofOptions* value) {
7892   const upb_MiniTableField field = {2, UPB_SIZE(12, 32), 65, 0, 11, (int)kUpb_FieldMode_Scalar | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
7893   UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__OneofOptions_msg_init);
7894   upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
7895 }
google_protobuf_OneofDescriptorProto_mutable_options(google_protobuf_OneofDescriptorProto * msg,upb_Arena * arena)7896 UPB_INLINE struct google_protobuf_OneofOptions* google_protobuf_OneofDescriptorProto_mutable_options(google_protobuf_OneofDescriptorProto* msg, upb_Arena* arena) {
7897   struct google_protobuf_OneofOptions* sub = (struct google_protobuf_OneofOptions*)google_protobuf_OneofDescriptorProto_options(msg);
7898   if (sub == NULL) {
7899     sub = (struct google_protobuf_OneofOptions*)_upb_Message_New(&google__protobuf__OneofOptions_msg_init, arena);
7900     if (sub) google_protobuf_OneofDescriptorProto_set_options(msg, sub);
7901   }
7902   return sub;
7903 }
7904 
7905 /* google.protobuf.EnumDescriptorProto */
7906 
google_protobuf_EnumDescriptorProto_new(upb_Arena * arena)7907 UPB_INLINE google_protobuf_EnumDescriptorProto* google_protobuf_EnumDescriptorProto_new(upb_Arena* arena) {
7908   return (google_protobuf_EnumDescriptorProto*)_upb_Message_New(&google__protobuf__EnumDescriptorProto_msg_init, arena);
7909 }
google_protobuf_EnumDescriptorProto_parse(const char * buf,size_t size,upb_Arena * arena)7910 UPB_INLINE google_protobuf_EnumDescriptorProto* google_protobuf_EnumDescriptorProto_parse(const char* buf, size_t size, upb_Arena* arena) {
7911   google_protobuf_EnumDescriptorProto* ret = google_protobuf_EnumDescriptorProto_new(arena);
7912   if (!ret) return NULL;
7913   if (upb_Decode(buf, size, UPB_UPCAST(ret), &google__protobuf__EnumDescriptorProto_msg_init, NULL, 0, arena) !=
7914       kUpb_DecodeStatus_Ok) {
7915     return NULL;
7916   }
7917   return ret;
7918 }
google_protobuf_EnumDescriptorProto_parse_ex(const char * buf,size_t size,const upb_ExtensionRegistry * extreg,int options,upb_Arena * arena)7919 UPB_INLINE google_protobuf_EnumDescriptorProto* google_protobuf_EnumDescriptorProto_parse_ex(const char* buf, size_t size,
7920                            const upb_ExtensionRegistry* extreg,
7921                            int options, upb_Arena* arena) {
7922   google_protobuf_EnumDescriptorProto* ret = google_protobuf_EnumDescriptorProto_new(arena);
7923   if (!ret) return NULL;
7924   if (upb_Decode(buf, size, UPB_UPCAST(ret), &google__protobuf__EnumDescriptorProto_msg_init, extreg, options,
7925                  arena) != kUpb_DecodeStatus_Ok) {
7926     return NULL;
7927   }
7928   return ret;
7929 }
google_protobuf_EnumDescriptorProto_serialize(const google_protobuf_EnumDescriptorProto * msg,upb_Arena * arena,size_t * len)7930 UPB_INLINE char* google_protobuf_EnumDescriptorProto_serialize(const google_protobuf_EnumDescriptorProto* msg, upb_Arena* arena, size_t* len) {
7931   char* ptr;
7932   (void)upb_Encode(UPB_UPCAST(msg), &google__protobuf__EnumDescriptorProto_msg_init, 0, arena, &ptr, len);
7933   return ptr;
7934 }
google_protobuf_EnumDescriptorProto_serialize_ex(const google_protobuf_EnumDescriptorProto * msg,int options,upb_Arena * arena,size_t * len)7935 UPB_INLINE char* google_protobuf_EnumDescriptorProto_serialize_ex(const google_protobuf_EnumDescriptorProto* msg, int options,
7936                                  upb_Arena* arena, size_t* len) {
7937   char* ptr;
7938   (void)upb_Encode(UPB_UPCAST(msg), &google__protobuf__EnumDescriptorProto_msg_init, options, arena, &ptr, len);
7939   return ptr;
7940 }
google_protobuf_EnumDescriptorProto_clear_name(google_protobuf_EnumDescriptorProto * msg)7941 UPB_INLINE void google_protobuf_EnumDescriptorProto_clear_name(google_protobuf_EnumDescriptorProto* msg) {
7942   const upb_MiniTableField field = {1, UPB_SIZE(28, 16), 64, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
7943   upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
7944 }
google_protobuf_EnumDescriptorProto_name(const google_protobuf_EnumDescriptorProto * msg)7945 UPB_INLINE upb_StringView google_protobuf_EnumDescriptorProto_name(const google_protobuf_EnumDescriptorProto* msg) {
7946   upb_StringView default_val = upb_StringView_FromString("");
7947   upb_StringView ret;
7948   const upb_MiniTableField field = {1, UPB_SIZE(28, 16), 64, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
7949   _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field,
7950                                     &default_val, &ret);
7951   return ret;
7952 }
google_protobuf_EnumDescriptorProto_has_name(const google_protobuf_EnumDescriptorProto * msg)7953 UPB_INLINE bool google_protobuf_EnumDescriptorProto_has_name(const google_protobuf_EnumDescriptorProto* msg) {
7954   const upb_MiniTableField field = {1, UPB_SIZE(28, 16), 64, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
7955   return upb_Message_HasBaseField(UPB_UPCAST(msg), &field);
7956 }
google_protobuf_EnumDescriptorProto_clear_value(google_protobuf_EnumDescriptorProto * msg)7957 UPB_INLINE void google_protobuf_EnumDescriptorProto_clear_value(google_protobuf_EnumDescriptorProto* msg) {
7958   const upb_MiniTableField field = {2, UPB_SIZE(12, 32), 0, 0, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
7959   upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
7960 }
google_protobuf_EnumDescriptorProto_value(const google_protobuf_EnumDescriptorProto * msg,size_t * size)7961 UPB_INLINE const google_protobuf_EnumValueDescriptorProto* const* google_protobuf_EnumDescriptorProto_value(const google_protobuf_EnumDescriptorProto* msg, size_t* size) {
7962   const upb_MiniTableField field = {2, UPB_SIZE(12, 32), 0, 0, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
7963   UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__EnumValueDescriptorProto_msg_init);
7964   const upb_Array* arr = upb_Message_GetArray(UPB_UPCAST(msg), &field);
7965   if (arr) {
7966     if (size) *size = arr->UPB_PRIVATE(size);
7967     return (const google_protobuf_EnumValueDescriptorProto* const*)upb_Array_DataPtr(arr);
7968   } else {
7969     if (size) *size = 0;
7970     return NULL;
7971   }
7972 }
_google_protobuf_EnumDescriptorProto_value_upb_array(const google_protobuf_EnumDescriptorProto * msg,size_t * size)7973 UPB_INLINE const upb_Array* _google_protobuf_EnumDescriptorProto_value_upb_array(const google_protobuf_EnumDescriptorProto* msg, size_t* size) {
7974   const upb_MiniTableField field = {2, UPB_SIZE(12, 32), 0, 0, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
7975   UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__EnumValueDescriptorProto_msg_init);
7976   const upb_Array* arr = upb_Message_GetArray(UPB_UPCAST(msg), &field);
7977   if (size) {
7978     *size = arr ? arr->UPB_PRIVATE(size) : 0;
7979   }
7980   return arr;
7981 }
_google_protobuf_EnumDescriptorProto_value_mutable_upb_array(google_protobuf_EnumDescriptorProto * msg,size_t * size,upb_Arena * arena)7982 UPB_INLINE upb_Array* _google_protobuf_EnumDescriptorProto_value_mutable_upb_array(google_protobuf_EnumDescriptorProto* msg, size_t* size, upb_Arena* arena) {
7983   const upb_MiniTableField field = {2, UPB_SIZE(12, 32), 0, 0, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
7984   UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__EnumValueDescriptorProto_msg_init);
7985   upb_Array* arr = upb_Message_GetOrCreateMutableArray(UPB_UPCAST(msg),
7986                                                        &field, arena);
7987   if (size) {
7988     *size = arr ? arr->UPB_PRIVATE(size) : 0;
7989   }
7990   return arr;
7991 }
google_protobuf_EnumDescriptorProto_clear_options(google_protobuf_EnumDescriptorProto * msg)7992 UPB_INLINE void google_protobuf_EnumDescriptorProto_clear_options(google_protobuf_EnumDescriptorProto* msg) {
7993   const upb_MiniTableField field = {3, UPB_SIZE(16, 40), 65, 1, 11, (int)kUpb_FieldMode_Scalar | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
7994   upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
7995 }
google_protobuf_EnumDescriptorProto_options(const google_protobuf_EnumDescriptorProto * msg)7996 UPB_INLINE const google_protobuf_EnumOptions* google_protobuf_EnumDescriptorProto_options(const google_protobuf_EnumDescriptorProto* msg) {
7997   const google_protobuf_EnumOptions* default_val = NULL;
7998   const google_protobuf_EnumOptions* ret;
7999   const upb_MiniTableField field = {3, UPB_SIZE(16, 40), 65, 1, 11, (int)kUpb_FieldMode_Scalar | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
8000   UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__EnumOptions_msg_init);
8001   _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field,
8002                                     &default_val, &ret);
8003   return ret;
8004 }
google_protobuf_EnumDescriptorProto_has_options(const google_protobuf_EnumDescriptorProto * msg)8005 UPB_INLINE bool google_protobuf_EnumDescriptorProto_has_options(const google_protobuf_EnumDescriptorProto* msg) {
8006   const upb_MiniTableField field = {3, UPB_SIZE(16, 40), 65, 1, 11, (int)kUpb_FieldMode_Scalar | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
8007   return upb_Message_HasBaseField(UPB_UPCAST(msg), &field);
8008 }
google_protobuf_EnumDescriptorProto_clear_reserved_range(google_protobuf_EnumDescriptorProto * msg)8009 UPB_INLINE void google_protobuf_EnumDescriptorProto_clear_reserved_range(google_protobuf_EnumDescriptorProto* msg) {
8010   const upb_MiniTableField field = {4, UPB_SIZE(20, 48), 0, 2, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
8011   upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
8012 }
google_protobuf_EnumDescriptorProto_reserved_range(const google_protobuf_EnumDescriptorProto * msg,size_t * size)8013 UPB_INLINE const google_protobuf_EnumDescriptorProto_EnumReservedRange* const* google_protobuf_EnumDescriptorProto_reserved_range(const google_protobuf_EnumDescriptorProto* msg, size_t* size) {
8014   const upb_MiniTableField field = {4, UPB_SIZE(20, 48), 0, 2, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
8015   UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__EnumDescriptorProto__EnumReservedRange_msg_init);
8016   const upb_Array* arr = upb_Message_GetArray(UPB_UPCAST(msg), &field);
8017   if (arr) {
8018     if (size) *size = arr->UPB_PRIVATE(size);
8019     return (const google_protobuf_EnumDescriptorProto_EnumReservedRange* const*)upb_Array_DataPtr(arr);
8020   } else {
8021     if (size) *size = 0;
8022     return NULL;
8023   }
8024 }
_google_protobuf_EnumDescriptorProto_reserved_range_upb_array(const google_protobuf_EnumDescriptorProto * msg,size_t * size)8025 UPB_INLINE const upb_Array* _google_protobuf_EnumDescriptorProto_reserved_range_upb_array(const google_protobuf_EnumDescriptorProto* msg, size_t* size) {
8026   const upb_MiniTableField field = {4, UPB_SIZE(20, 48), 0, 2, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
8027   UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__EnumDescriptorProto__EnumReservedRange_msg_init);
8028   const upb_Array* arr = upb_Message_GetArray(UPB_UPCAST(msg), &field);
8029   if (size) {
8030     *size = arr ? arr->UPB_PRIVATE(size) : 0;
8031   }
8032   return arr;
8033 }
_google_protobuf_EnumDescriptorProto_reserved_range_mutable_upb_array(google_protobuf_EnumDescriptorProto * msg,size_t * size,upb_Arena * arena)8034 UPB_INLINE upb_Array* _google_protobuf_EnumDescriptorProto_reserved_range_mutable_upb_array(google_protobuf_EnumDescriptorProto* msg, size_t* size, upb_Arena* arena) {
8035   const upb_MiniTableField field = {4, UPB_SIZE(20, 48), 0, 2, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
8036   UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__EnumDescriptorProto__EnumReservedRange_msg_init);
8037   upb_Array* arr = upb_Message_GetOrCreateMutableArray(UPB_UPCAST(msg),
8038                                                        &field, arena);
8039   if (size) {
8040     *size = arr ? arr->UPB_PRIVATE(size) : 0;
8041   }
8042   return arr;
8043 }
google_protobuf_EnumDescriptorProto_clear_reserved_name(google_protobuf_EnumDescriptorProto * msg)8044 UPB_INLINE void google_protobuf_EnumDescriptorProto_clear_reserved_name(google_protobuf_EnumDescriptorProto* msg) {
8045   const upb_MiniTableField field = {5, UPB_SIZE(24, 56), 0, kUpb_NoSub, 12, (int)kUpb_FieldMode_Array | (int)kUpb_LabelFlags_IsAlternate | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
8046   upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
8047 }
google_protobuf_EnumDescriptorProto_reserved_name(const google_protobuf_EnumDescriptorProto * msg,size_t * size)8048 UPB_INLINE upb_StringView const* google_protobuf_EnumDescriptorProto_reserved_name(const google_protobuf_EnumDescriptorProto* msg, size_t* size) {
8049   const upb_MiniTableField field = {5, UPB_SIZE(24, 56), 0, kUpb_NoSub, 12, (int)kUpb_FieldMode_Array | (int)kUpb_LabelFlags_IsAlternate | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
8050   const upb_Array* arr = upb_Message_GetArray(UPB_UPCAST(msg), &field);
8051   if (arr) {
8052     if (size) *size = arr->UPB_PRIVATE(size);
8053     return (upb_StringView const*)upb_Array_DataPtr(arr);
8054   } else {
8055     if (size) *size = 0;
8056     return NULL;
8057   }
8058 }
_google_protobuf_EnumDescriptorProto_reserved_name_upb_array(const google_protobuf_EnumDescriptorProto * msg,size_t * size)8059 UPB_INLINE const upb_Array* _google_protobuf_EnumDescriptorProto_reserved_name_upb_array(const google_protobuf_EnumDescriptorProto* msg, size_t* size) {
8060   const upb_MiniTableField field = {5, UPB_SIZE(24, 56), 0, kUpb_NoSub, 12, (int)kUpb_FieldMode_Array | (int)kUpb_LabelFlags_IsAlternate | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
8061   const upb_Array* arr = upb_Message_GetArray(UPB_UPCAST(msg), &field);
8062   if (size) {
8063     *size = arr ? arr->UPB_PRIVATE(size) : 0;
8064   }
8065   return arr;
8066 }
_google_protobuf_EnumDescriptorProto_reserved_name_mutable_upb_array(google_protobuf_EnumDescriptorProto * msg,size_t * size,upb_Arena * arena)8067 UPB_INLINE upb_Array* _google_protobuf_EnumDescriptorProto_reserved_name_mutable_upb_array(google_protobuf_EnumDescriptorProto* msg, size_t* size, upb_Arena* arena) {
8068   const upb_MiniTableField field = {5, UPB_SIZE(24, 56), 0, kUpb_NoSub, 12, (int)kUpb_FieldMode_Array | (int)kUpb_LabelFlags_IsAlternate | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
8069   upb_Array* arr = upb_Message_GetOrCreateMutableArray(UPB_UPCAST(msg),
8070                                                        &field, arena);
8071   if (size) {
8072     *size = arr ? arr->UPB_PRIVATE(size) : 0;
8073   }
8074   return arr;
8075 }
8076 
google_protobuf_EnumDescriptorProto_set_name(google_protobuf_EnumDescriptorProto * msg,upb_StringView value)8077 UPB_INLINE void google_protobuf_EnumDescriptorProto_set_name(google_protobuf_EnumDescriptorProto *msg, upb_StringView value) {
8078   const upb_MiniTableField field = {1, UPB_SIZE(28, 16), 64, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
8079   upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
8080 }
google_protobuf_EnumDescriptorProto_mutable_value(google_protobuf_EnumDescriptorProto * msg,size_t * size)8081 UPB_INLINE google_protobuf_EnumValueDescriptorProto** google_protobuf_EnumDescriptorProto_mutable_value(google_protobuf_EnumDescriptorProto* msg, size_t* size) {
8082   upb_MiniTableField field = {2, UPB_SIZE(12, 32), 0, 0, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
8083   UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__EnumValueDescriptorProto_msg_init);
8084   upb_Array* arr = upb_Message_GetMutableArray(UPB_UPCAST(msg), &field);
8085   if (arr) {
8086     if (size) *size = arr->UPB_PRIVATE(size);
8087     return (google_protobuf_EnumValueDescriptorProto**)upb_Array_MutableDataPtr(arr);
8088   } else {
8089     if (size) *size = 0;
8090     return NULL;
8091   }
8092 }
google_protobuf_EnumDescriptorProto_resize_value(google_protobuf_EnumDescriptorProto * msg,size_t size,upb_Arena * arena)8093 UPB_INLINE google_protobuf_EnumValueDescriptorProto** google_protobuf_EnumDescriptorProto_resize_value(google_protobuf_EnumDescriptorProto* msg, size_t size, upb_Arena* arena) {
8094   upb_MiniTableField field = {2, UPB_SIZE(12, 32), 0, 0, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
8095   return (google_protobuf_EnumValueDescriptorProto**)upb_Message_ResizeArrayUninitialized(UPB_UPCAST(msg),
8096                                                    &field, size, arena);
8097 }
google_protobuf_EnumDescriptorProto_add_value(google_protobuf_EnumDescriptorProto * msg,upb_Arena * arena)8098 UPB_INLINE struct google_protobuf_EnumValueDescriptorProto* google_protobuf_EnumDescriptorProto_add_value(google_protobuf_EnumDescriptorProto* msg, upb_Arena* arena) {
8099   upb_MiniTableField field = {2, UPB_SIZE(12, 32), 0, 0, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
8100   UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__EnumValueDescriptorProto_msg_init);
8101   upb_Array* arr = upb_Message_GetOrCreateMutableArray(
8102       UPB_UPCAST(msg), &field, arena);
8103   if (!arr || !UPB_PRIVATE(_upb_Array_ResizeUninitialized)(
8104                   arr, arr->UPB_PRIVATE(size) + 1, arena)) {
8105     return NULL;
8106   }
8107   struct google_protobuf_EnumValueDescriptorProto* sub = (struct google_protobuf_EnumValueDescriptorProto*)_upb_Message_New(&google__protobuf__EnumValueDescriptorProto_msg_init, arena);
8108   if (!arr || !sub) return NULL;
8109   UPB_PRIVATE(_upb_Array_Set)
8110   (arr, arr->UPB_PRIVATE(size) - 1, &sub, sizeof(sub));
8111   return sub;
8112 }
google_protobuf_EnumDescriptorProto_set_options(google_protobuf_EnumDescriptorProto * msg,google_protobuf_EnumOptions * value)8113 UPB_INLINE void google_protobuf_EnumDescriptorProto_set_options(google_protobuf_EnumDescriptorProto *msg, google_protobuf_EnumOptions* value) {
8114   const upb_MiniTableField field = {3, UPB_SIZE(16, 40), 65, 1, 11, (int)kUpb_FieldMode_Scalar | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
8115   UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__EnumOptions_msg_init);
8116   upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
8117 }
google_protobuf_EnumDescriptorProto_mutable_options(google_protobuf_EnumDescriptorProto * msg,upb_Arena * arena)8118 UPB_INLINE struct google_protobuf_EnumOptions* google_protobuf_EnumDescriptorProto_mutable_options(google_protobuf_EnumDescriptorProto* msg, upb_Arena* arena) {
8119   struct google_protobuf_EnumOptions* sub = (struct google_protobuf_EnumOptions*)google_protobuf_EnumDescriptorProto_options(msg);
8120   if (sub == NULL) {
8121     sub = (struct google_protobuf_EnumOptions*)_upb_Message_New(&google__protobuf__EnumOptions_msg_init, arena);
8122     if (sub) google_protobuf_EnumDescriptorProto_set_options(msg, sub);
8123   }
8124   return sub;
8125 }
google_protobuf_EnumDescriptorProto_mutable_reserved_range(google_protobuf_EnumDescriptorProto * msg,size_t * size)8126 UPB_INLINE google_protobuf_EnumDescriptorProto_EnumReservedRange** google_protobuf_EnumDescriptorProto_mutable_reserved_range(google_protobuf_EnumDescriptorProto* msg, size_t* size) {
8127   upb_MiniTableField field = {4, UPB_SIZE(20, 48), 0, 2, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
8128   UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__EnumDescriptorProto__EnumReservedRange_msg_init);
8129   upb_Array* arr = upb_Message_GetMutableArray(UPB_UPCAST(msg), &field);
8130   if (arr) {
8131     if (size) *size = arr->UPB_PRIVATE(size);
8132     return (google_protobuf_EnumDescriptorProto_EnumReservedRange**)upb_Array_MutableDataPtr(arr);
8133   } else {
8134     if (size) *size = 0;
8135     return NULL;
8136   }
8137 }
google_protobuf_EnumDescriptorProto_resize_reserved_range(google_protobuf_EnumDescriptorProto * msg,size_t size,upb_Arena * arena)8138 UPB_INLINE google_protobuf_EnumDescriptorProto_EnumReservedRange** google_protobuf_EnumDescriptorProto_resize_reserved_range(google_protobuf_EnumDescriptorProto* msg, size_t size, upb_Arena* arena) {
8139   upb_MiniTableField field = {4, UPB_SIZE(20, 48), 0, 2, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
8140   return (google_protobuf_EnumDescriptorProto_EnumReservedRange**)upb_Message_ResizeArrayUninitialized(UPB_UPCAST(msg),
8141                                                    &field, size, arena);
8142 }
google_protobuf_EnumDescriptorProto_add_reserved_range(google_protobuf_EnumDescriptorProto * msg,upb_Arena * arena)8143 UPB_INLINE struct google_protobuf_EnumDescriptorProto_EnumReservedRange* google_protobuf_EnumDescriptorProto_add_reserved_range(google_protobuf_EnumDescriptorProto* msg, upb_Arena* arena) {
8144   upb_MiniTableField field = {4, UPB_SIZE(20, 48), 0, 2, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
8145   UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__EnumDescriptorProto__EnumReservedRange_msg_init);
8146   upb_Array* arr = upb_Message_GetOrCreateMutableArray(
8147       UPB_UPCAST(msg), &field, arena);
8148   if (!arr || !UPB_PRIVATE(_upb_Array_ResizeUninitialized)(
8149                   arr, arr->UPB_PRIVATE(size) + 1, arena)) {
8150     return NULL;
8151   }
8152   struct google_protobuf_EnumDescriptorProto_EnumReservedRange* sub = (struct google_protobuf_EnumDescriptorProto_EnumReservedRange*)_upb_Message_New(&google__protobuf__EnumDescriptorProto__EnumReservedRange_msg_init, arena);
8153   if (!arr || !sub) return NULL;
8154   UPB_PRIVATE(_upb_Array_Set)
8155   (arr, arr->UPB_PRIVATE(size) - 1, &sub, sizeof(sub));
8156   return sub;
8157 }
google_protobuf_EnumDescriptorProto_mutable_reserved_name(google_protobuf_EnumDescriptorProto * msg,size_t * size)8158 UPB_INLINE upb_StringView* google_protobuf_EnumDescriptorProto_mutable_reserved_name(google_protobuf_EnumDescriptorProto* msg, size_t* size) {
8159   upb_MiniTableField field = {5, UPB_SIZE(24, 56), 0, kUpb_NoSub, 12, (int)kUpb_FieldMode_Array | (int)kUpb_LabelFlags_IsAlternate | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
8160   upb_Array* arr = upb_Message_GetMutableArray(UPB_UPCAST(msg), &field);
8161   if (arr) {
8162     if (size) *size = arr->UPB_PRIVATE(size);
8163     return (upb_StringView*)upb_Array_MutableDataPtr(arr);
8164   } else {
8165     if (size) *size = 0;
8166     return NULL;
8167   }
8168 }
google_protobuf_EnumDescriptorProto_resize_reserved_name(google_protobuf_EnumDescriptorProto * msg,size_t size,upb_Arena * arena)8169 UPB_INLINE upb_StringView* google_protobuf_EnumDescriptorProto_resize_reserved_name(google_protobuf_EnumDescriptorProto* msg, size_t size, upb_Arena* arena) {
8170   upb_MiniTableField field = {5, UPB_SIZE(24, 56), 0, kUpb_NoSub, 12, (int)kUpb_FieldMode_Array | (int)kUpb_LabelFlags_IsAlternate | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
8171   return (upb_StringView*)upb_Message_ResizeArrayUninitialized(UPB_UPCAST(msg),
8172                                                    &field, size, arena);
8173 }
google_protobuf_EnumDescriptorProto_add_reserved_name(google_protobuf_EnumDescriptorProto * msg,upb_StringView val,upb_Arena * arena)8174 UPB_INLINE bool google_protobuf_EnumDescriptorProto_add_reserved_name(google_protobuf_EnumDescriptorProto* msg, upb_StringView val, upb_Arena* arena) {
8175   upb_MiniTableField field = {5, UPB_SIZE(24, 56), 0, kUpb_NoSub, 12, (int)kUpb_FieldMode_Array | (int)kUpb_LabelFlags_IsAlternate | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
8176   upb_Array* arr = upb_Message_GetOrCreateMutableArray(
8177       UPB_UPCAST(msg), &field, arena);
8178   if (!arr || !UPB_PRIVATE(_upb_Array_ResizeUninitialized)(
8179                   arr, arr->UPB_PRIVATE(size) + 1, arena)) {
8180     return false;
8181   }
8182   UPB_PRIVATE(_upb_Array_Set)
8183   (arr, arr->UPB_PRIVATE(size) - 1, &val, sizeof(val));
8184   return true;
8185 }
8186 
8187 /* google.protobuf.EnumDescriptorProto.EnumReservedRange */
8188 
google_protobuf_EnumDescriptorProto_EnumReservedRange_new(upb_Arena * arena)8189 UPB_INLINE google_protobuf_EnumDescriptorProto_EnumReservedRange* google_protobuf_EnumDescriptorProto_EnumReservedRange_new(upb_Arena* arena) {
8190   return (google_protobuf_EnumDescriptorProto_EnumReservedRange*)_upb_Message_New(&google__protobuf__EnumDescriptorProto__EnumReservedRange_msg_init, arena);
8191 }
google_protobuf_EnumDescriptorProto_EnumReservedRange_parse(const char * buf,size_t size,upb_Arena * arena)8192 UPB_INLINE google_protobuf_EnumDescriptorProto_EnumReservedRange* google_protobuf_EnumDescriptorProto_EnumReservedRange_parse(const char* buf, size_t size, upb_Arena* arena) {
8193   google_protobuf_EnumDescriptorProto_EnumReservedRange* ret = google_protobuf_EnumDescriptorProto_EnumReservedRange_new(arena);
8194   if (!ret) return NULL;
8195   if (upb_Decode(buf, size, UPB_UPCAST(ret), &google__protobuf__EnumDescriptorProto__EnumReservedRange_msg_init, NULL, 0, arena) !=
8196       kUpb_DecodeStatus_Ok) {
8197     return NULL;
8198   }
8199   return ret;
8200 }
google_protobuf_EnumDescriptorProto_EnumReservedRange_parse_ex(const char * buf,size_t size,const upb_ExtensionRegistry * extreg,int options,upb_Arena * arena)8201 UPB_INLINE google_protobuf_EnumDescriptorProto_EnumReservedRange* google_protobuf_EnumDescriptorProto_EnumReservedRange_parse_ex(const char* buf, size_t size,
8202                            const upb_ExtensionRegistry* extreg,
8203                            int options, upb_Arena* arena) {
8204   google_protobuf_EnumDescriptorProto_EnumReservedRange* ret = google_protobuf_EnumDescriptorProto_EnumReservedRange_new(arena);
8205   if (!ret) return NULL;
8206   if (upb_Decode(buf, size, UPB_UPCAST(ret), &google__protobuf__EnumDescriptorProto__EnumReservedRange_msg_init, extreg, options,
8207                  arena) != kUpb_DecodeStatus_Ok) {
8208     return NULL;
8209   }
8210   return ret;
8211 }
google_protobuf_EnumDescriptorProto_EnumReservedRange_serialize(const google_protobuf_EnumDescriptorProto_EnumReservedRange * msg,upb_Arena * arena,size_t * len)8212 UPB_INLINE char* google_protobuf_EnumDescriptorProto_EnumReservedRange_serialize(const google_protobuf_EnumDescriptorProto_EnumReservedRange* msg, upb_Arena* arena, size_t* len) {
8213   char* ptr;
8214   (void)upb_Encode(UPB_UPCAST(msg), &google__protobuf__EnumDescriptorProto__EnumReservedRange_msg_init, 0, arena, &ptr, len);
8215   return ptr;
8216 }
google_protobuf_EnumDescriptorProto_EnumReservedRange_serialize_ex(const google_protobuf_EnumDescriptorProto_EnumReservedRange * msg,int options,upb_Arena * arena,size_t * len)8217 UPB_INLINE char* google_protobuf_EnumDescriptorProto_EnumReservedRange_serialize_ex(const google_protobuf_EnumDescriptorProto_EnumReservedRange* msg, int options,
8218                                  upb_Arena* arena, size_t* len) {
8219   char* ptr;
8220   (void)upb_Encode(UPB_UPCAST(msg), &google__protobuf__EnumDescriptorProto__EnumReservedRange_msg_init, options, arena, &ptr, len);
8221   return ptr;
8222 }
google_protobuf_EnumDescriptorProto_EnumReservedRange_clear_start(google_protobuf_EnumDescriptorProto_EnumReservedRange * msg)8223 UPB_INLINE void google_protobuf_EnumDescriptorProto_EnumReservedRange_clear_start(google_protobuf_EnumDescriptorProto_EnumReservedRange* msg) {
8224   const upb_MiniTableField field = {1, 12, 64, kUpb_NoSub, 5, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
8225   upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
8226 }
google_protobuf_EnumDescriptorProto_EnumReservedRange_start(const google_protobuf_EnumDescriptorProto_EnumReservedRange * msg)8227 UPB_INLINE int32_t google_protobuf_EnumDescriptorProto_EnumReservedRange_start(const google_protobuf_EnumDescriptorProto_EnumReservedRange* msg) {
8228   int32_t default_val = (int32_t)0;
8229   int32_t ret;
8230   const upb_MiniTableField field = {1, 12, 64, kUpb_NoSub, 5, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
8231   _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field,
8232                                     &default_val, &ret);
8233   return ret;
8234 }
google_protobuf_EnumDescriptorProto_EnumReservedRange_has_start(const google_protobuf_EnumDescriptorProto_EnumReservedRange * msg)8235 UPB_INLINE bool google_protobuf_EnumDescriptorProto_EnumReservedRange_has_start(const google_protobuf_EnumDescriptorProto_EnumReservedRange* msg) {
8236   const upb_MiniTableField field = {1, 12, 64, kUpb_NoSub, 5, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
8237   return upb_Message_HasBaseField(UPB_UPCAST(msg), &field);
8238 }
google_protobuf_EnumDescriptorProto_EnumReservedRange_clear_end(google_protobuf_EnumDescriptorProto_EnumReservedRange * msg)8239 UPB_INLINE void google_protobuf_EnumDescriptorProto_EnumReservedRange_clear_end(google_protobuf_EnumDescriptorProto_EnumReservedRange* msg) {
8240   const upb_MiniTableField field = {2, 16, 65, kUpb_NoSub, 5, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
8241   upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
8242 }
google_protobuf_EnumDescriptorProto_EnumReservedRange_end(const google_protobuf_EnumDescriptorProto_EnumReservedRange * msg)8243 UPB_INLINE int32_t google_protobuf_EnumDescriptorProto_EnumReservedRange_end(const google_protobuf_EnumDescriptorProto_EnumReservedRange* msg) {
8244   int32_t default_val = (int32_t)0;
8245   int32_t ret;
8246   const upb_MiniTableField field = {2, 16, 65, kUpb_NoSub, 5, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
8247   _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field,
8248                                     &default_val, &ret);
8249   return ret;
8250 }
google_protobuf_EnumDescriptorProto_EnumReservedRange_has_end(const google_protobuf_EnumDescriptorProto_EnumReservedRange * msg)8251 UPB_INLINE bool google_protobuf_EnumDescriptorProto_EnumReservedRange_has_end(const google_protobuf_EnumDescriptorProto_EnumReservedRange* msg) {
8252   const upb_MiniTableField field = {2, 16, 65, kUpb_NoSub, 5, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
8253   return upb_Message_HasBaseField(UPB_UPCAST(msg), &field);
8254 }
8255 
google_protobuf_EnumDescriptorProto_EnumReservedRange_set_start(google_protobuf_EnumDescriptorProto_EnumReservedRange * msg,int32_t value)8256 UPB_INLINE void google_protobuf_EnumDescriptorProto_EnumReservedRange_set_start(google_protobuf_EnumDescriptorProto_EnumReservedRange *msg, int32_t value) {
8257   const upb_MiniTableField field = {1, 12, 64, kUpb_NoSub, 5, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
8258   upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
8259 }
google_protobuf_EnumDescriptorProto_EnumReservedRange_set_end(google_protobuf_EnumDescriptorProto_EnumReservedRange * msg,int32_t value)8260 UPB_INLINE void google_protobuf_EnumDescriptorProto_EnumReservedRange_set_end(google_protobuf_EnumDescriptorProto_EnumReservedRange *msg, int32_t value) {
8261   const upb_MiniTableField field = {2, 16, 65, kUpb_NoSub, 5, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
8262   upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
8263 }
8264 
8265 /* google.protobuf.EnumValueDescriptorProto */
8266 
google_protobuf_EnumValueDescriptorProto_new(upb_Arena * arena)8267 UPB_INLINE google_protobuf_EnumValueDescriptorProto* google_protobuf_EnumValueDescriptorProto_new(upb_Arena* arena) {
8268   return (google_protobuf_EnumValueDescriptorProto*)_upb_Message_New(&google__protobuf__EnumValueDescriptorProto_msg_init, arena);
8269 }
google_protobuf_EnumValueDescriptorProto_parse(const char * buf,size_t size,upb_Arena * arena)8270 UPB_INLINE google_protobuf_EnumValueDescriptorProto* google_protobuf_EnumValueDescriptorProto_parse(const char* buf, size_t size, upb_Arena* arena) {
8271   google_protobuf_EnumValueDescriptorProto* ret = google_protobuf_EnumValueDescriptorProto_new(arena);
8272   if (!ret) return NULL;
8273   if (upb_Decode(buf, size, UPB_UPCAST(ret), &google__protobuf__EnumValueDescriptorProto_msg_init, NULL, 0, arena) !=
8274       kUpb_DecodeStatus_Ok) {
8275     return NULL;
8276   }
8277   return ret;
8278 }
google_protobuf_EnumValueDescriptorProto_parse_ex(const char * buf,size_t size,const upb_ExtensionRegistry * extreg,int options,upb_Arena * arena)8279 UPB_INLINE google_protobuf_EnumValueDescriptorProto* google_protobuf_EnumValueDescriptorProto_parse_ex(const char* buf, size_t size,
8280                            const upb_ExtensionRegistry* extreg,
8281                            int options, upb_Arena* arena) {
8282   google_protobuf_EnumValueDescriptorProto* ret = google_protobuf_EnumValueDescriptorProto_new(arena);
8283   if (!ret) return NULL;
8284   if (upb_Decode(buf, size, UPB_UPCAST(ret), &google__protobuf__EnumValueDescriptorProto_msg_init, extreg, options,
8285                  arena) != kUpb_DecodeStatus_Ok) {
8286     return NULL;
8287   }
8288   return ret;
8289 }
google_protobuf_EnumValueDescriptorProto_serialize(const google_protobuf_EnumValueDescriptorProto * msg,upb_Arena * arena,size_t * len)8290 UPB_INLINE char* google_protobuf_EnumValueDescriptorProto_serialize(const google_protobuf_EnumValueDescriptorProto* msg, upb_Arena* arena, size_t* len) {
8291   char* ptr;
8292   (void)upb_Encode(UPB_UPCAST(msg), &google__protobuf__EnumValueDescriptorProto_msg_init, 0, arena, &ptr, len);
8293   return ptr;
8294 }
google_protobuf_EnumValueDescriptorProto_serialize_ex(const google_protobuf_EnumValueDescriptorProto * msg,int options,upb_Arena * arena,size_t * len)8295 UPB_INLINE char* google_protobuf_EnumValueDescriptorProto_serialize_ex(const google_protobuf_EnumValueDescriptorProto* msg, int options,
8296                                  upb_Arena* arena, size_t* len) {
8297   char* ptr;
8298   (void)upb_Encode(UPB_UPCAST(msg), &google__protobuf__EnumValueDescriptorProto_msg_init, options, arena, &ptr, len);
8299   return ptr;
8300 }
google_protobuf_EnumValueDescriptorProto_clear_name(google_protobuf_EnumValueDescriptorProto * msg)8301 UPB_INLINE void google_protobuf_EnumValueDescriptorProto_clear_name(google_protobuf_EnumValueDescriptorProto* msg) {
8302   const upb_MiniTableField field = {1, UPB_SIZE(20, 16), 64, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
8303   upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
8304 }
google_protobuf_EnumValueDescriptorProto_name(const google_protobuf_EnumValueDescriptorProto * msg)8305 UPB_INLINE upb_StringView google_protobuf_EnumValueDescriptorProto_name(const google_protobuf_EnumValueDescriptorProto* msg) {
8306   upb_StringView default_val = upb_StringView_FromString("");
8307   upb_StringView ret;
8308   const upb_MiniTableField field = {1, UPB_SIZE(20, 16), 64, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
8309   _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field,
8310                                     &default_val, &ret);
8311   return ret;
8312 }
google_protobuf_EnumValueDescriptorProto_has_name(const google_protobuf_EnumValueDescriptorProto * msg)8313 UPB_INLINE bool google_protobuf_EnumValueDescriptorProto_has_name(const google_protobuf_EnumValueDescriptorProto* msg) {
8314   const upb_MiniTableField field = {1, UPB_SIZE(20, 16), 64, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
8315   return upb_Message_HasBaseField(UPB_UPCAST(msg), &field);
8316 }
google_protobuf_EnumValueDescriptorProto_clear_number(google_protobuf_EnumValueDescriptorProto * msg)8317 UPB_INLINE void google_protobuf_EnumValueDescriptorProto_clear_number(google_protobuf_EnumValueDescriptorProto* msg) {
8318   const upb_MiniTableField field = {2, 12, 65, kUpb_NoSub, 5, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
8319   upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
8320 }
google_protobuf_EnumValueDescriptorProto_number(const google_protobuf_EnumValueDescriptorProto * msg)8321 UPB_INLINE int32_t google_protobuf_EnumValueDescriptorProto_number(const google_protobuf_EnumValueDescriptorProto* msg) {
8322   int32_t default_val = (int32_t)0;
8323   int32_t ret;
8324   const upb_MiniTableField field = {2, 12, 65, kUpb_NoSub, 5, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
8325   _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field,
8326                                     &default_val, &ret);
8327   return ret;
8328 }
google_protobuf_EnumValueDescriptorProto_has_number(const google_protobuf_EnumValueDescriptorProto * msg)8329 UPB_INLINE bool google_protobuf_EnumValueDescriptorProto_has_number(const google_protobuf_EnumValueDescriptorProto* msg) {
8330   const upb_MiniTableField field = {2, 12, 65, kUpb_NoSub, 5, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
8331   return upb_Message_HasBaseField(UPB_UPCAST(msg), &field);
8332 }
google_protobuf_EnumValueDescriptorProto_clear_options(google_protobuf_EnumValueDescriptorProto * msg)8333 UPB_INLINE void google_protobuf_EnumValueDescriptorProto_clear_options(google_protobuf_EnumValueDescriptorProto* msg) {
8334   const upb_MiniTableField field = {3, UPB_SIZE(16, 32), 66, 0, 11, (int)kUpb_FieldMode_Scalar | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
8335   upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
8336 }
google_protobuf_EnumValueDescriptorProto_options(const google_protobuf_EnumValueDescriptorProto * msg)8337 UPB_INLINE const google_protobuf_EnumValueOptions* google_protobuf_EnumValueDescriptorProto_options(const google_protobuf_EnumValueDescriptorProto* msg) {
8338   const google_protobuf_EnumValueOptions* default_val = NULL;
8339   const google_protobuf_EnumValueOptions* ret;
8340   const upb_MiniTableField field = {3, UPB_SIZE(16, 32), 66, 0, 11, (int)kUpb_FieldMode_Scalar | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
8341   UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__EnumValueOptions_msg_init);
8342   _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field,
8343                                     &default_val, &ret);
8344   return ret;
8345 }
google_protobuf_EnumValueDescriptorProto_has_options(const google_protobuf_EnumValueDescriptorProto * msg)8346 UPB_INLINE bool google_protobuf_EnumValueDescriptorProto_has_options(const google_protobuf_EnumValueDescriptorProto* msg) {
8347   const upb_MiniTableField field = {3, UPB_SIZE(16, 32), 66, 0, 11, (int)kUpb_FieldMode_Scalar | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
8348   return upb_Message_HasBaseField(UPB_UPCAST(msg), &field);
8349 }
8350 
google_protobuf_EnumValueDescriptorProto_set_name(google_protobuf_EnumValueDescriptorProto * msg,upb_StringView value)8351 UPB_INLINE void google_protobuf_EnumValueDescriptorProto_set_name(google_protobuf_EnumValueDescriptorProto *msg, upb_StringView value) {
8352   const upb_MiniTableField field = {1, UPB_SIZE(20, 16), 64, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
8353   upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
8354 }
google_protobuf_EnumValueDescriptorProto_set_number(google_protobuf_EnumValueDescriptorProto * msg,int32_t value)8355 UPB_INLINE void google_protobuf_EnumValueDescriptorProto_set_number(google_protobuf_EnumValueDescriptorProto *msg, int32_t value) {
8356   const upb_MiniTableField field = {2, 12, 65, kUpb_NoSub, 5, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
8357   upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
8358 }
google_protobuf_EnumValueDescriptorProto_set_options(google_protobuf_EnumValueDescriptorProto * msg,google_protobuf_EnumValueOptions * value)8359 UPB_INLINE void google_protobuf_EnumValueDescriptorProto_set_options(google_protobuf_EnumValueDescriptorProto *msg, google_protobuf_EnumValueOptions* value) {
8360   const upb_MiniTableField field = {3, UPB_SIZE(16, 32), 66, 0, 11, (int)kUpb_FieldMode_Scalar | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
8361   UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__EnumValueOptions_msg_init);
8362   upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
8363 }
google_protobuf_EnumValueDescriptorProto_mutable_options(google_protobuf_EnumValueDescriptorProto * msg,upb_Arena * arena)8364 UPB_INLINE struct google_protobuf_EnumValueOptions* google_protobuf_EnumValueDescriptorProto_mutable_options(google_protobuf_EnumValueDescriptorProto* msg, upb_Arena* arena) {
8365   struct google_protobuf_EnumValueOptions* sub = (struct google_protobuf_EnumValueOptions*)google_protobuf_EnumValueDescriptorProto_options(msg);
8366   if (sub == NULL) {
8367     sub = (struct google_protobuf_EnumValueOptions*)_upb_Message_New(&google__protobuf__EnumValueOptions_msg_init, arena);
8368     if (sub) google_protobuf_EnumValueDescriptorProto_set_options(msg, sub);
8369   }
8370   return sub;
8371 }
8372 
8373 /* google.protobuf.ServiceDescriptorProto */
8374 
google_protobuf_ServiceDescriptorProto_new(upb_Arena * arena)8375 UPB_INLINE google_protobuf_ServiceDescriptorProto* google_protobuf_ServiceDescriptorProto_new(upb_Arena* arena) {
8376   return (google_protobuf_ServiceDescriptorProto*)_upb_Message_New(&google__protobuf__ServiceDescriptorProto_msg_init, arena);
8377 }
google_protobuf_ServiceDescriptorProto_parse(const char * buf,size_t size,upb_Arena * arena)8378 UPB_INLINE google_protobuf_ServiceDescriptorProto* google_protobuf_ServiceDescriptorProto_parse(const char* buf, size_t size, upb_Arena* arena) {
8379   google_protobuf_ServiceDescriptorProto* ret = google_protobuf_ServiceDescriptorProto_new(arena);
8380   if (!ret) return NULL;
8381   if (upb_Decode(buf, size, UPB_UPCAST(ret), &google__protobuf__ServiceDescriptorProto_msg_init, NULL, 0, arena) !=
8382       kUpb_DecodeStatus_Ok) {
8383     return NULL;
8384   }
8385   return ret;
8386 }
google_protobuf_ServiceDescriptorProto_parse_ex(const char * buf,size_t size,const upb_ExtensionRegistry * extreg,int options,upb_Arena * arena)8387 UPB_INLINE google_protobuf_ServiceDescriptorProto* google_protobuf_ServiceDescriptorProto_parse_ex(const char* buf, size_t size,
8388                            const upb_ExtensionRegistry* extreg,
8389                            int options, upb_Arena* arena) {
8390   google_protobuf_ServiceDescriptorProto* ret = google_protobuf_ServiceDescriptorProto_new(arena);
8391   if (!ret) return NULL;
8392   if (upb_Decode(buf, size, UPB_UPCAST(ret), &google__protobuf__ServiceDescriptorProto_msg_init, extreg, options,
8393                  arena) != kUpb_DecodeStatus_Ok) {
8394     return NULL;
8395   }
8396   return ret;
8397 }
google_protobuf_ServiceDescriptorProto_serialize(const google_protobuf_ServiceDescriptorProto * msg,upb_Arena * arena,size_t * len)8398 UPB_INLINE char* google_protobuf_ServiceDescriptorProto_serialize(const google_protobuf_ServiceDescriptorProto* msg, upb_Arena* arena, size_t* len) {
8399   char* ptr;
8400   (void)upb_Encode(UPB_UPCAST(msg), &google__protobuf__ServiceDescriptorProto_msg_init, 0, arena, &ptr, len);
8401   return ptr;
8402 }
google_protobuf_ServiceDescriptorProto_serialize_ex(const google_protobuf_ServiceDescriptorProto * msg,int options,upb_Arena * arena,size_t * len)8403 UPB_INLINE char* google_protobuf_ServiceDescriptorProto_serialize_ex(const google_protobuf_ServiceDescriptorProto* msg, int options,
8404                                  upb_Arena* arena, size_t* len) {
8405   char* ptr;
8406   (void)upb_Encode(UPB_UPCAST(msg), &google__protobuf__ServiceDescriptorProto_msg_init, options, arena, &ptr, len);
8407   return ptr;
8408 }
google_protobuf_ServiceDescriptorProto_clear_name(google_protobuf_ServiceDescriptorProto * msg)8409 UPB_INLINE void google_protobuf_ServiceDescriptorProto_clear_name(google_protobuf_ServiceDescriptorProto* msg) {
8410   const upb_MiniTableField field = {1, UPB_SIZE(20, 16), 64, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
8411   upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
8412 }
google_protobuf_ServiceDescriptorProto_name(const google_protobuf_ServiceDescriptorProto * msg)8413 UPB_INLINE upb_StringView google_protobuf_ServiceDescriptorProto_name(const google_protobuf_ServiceDescriptorProto* msg) {
8414   upb_StringView default_val = upb_StringView_FromString("");
8415   upb_StringView ret;
8416   const upb_MiniTableField field = {1, UPB_SIZE(20, 16), 64, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
8417   _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field,
8418                                     &default_val, &ret);
8419   return ret;
8420 }
google_protobuf_ServiceDescriptorProto_has_name(const google_protobuf_ServiceDescriptorProto * msg)8421 UPB_INLINE bool google_protobuf_ServiceDescriptorProto_has_name(const google_protobuf_ServiceDescriptorProto* msg) {
8422   const upb_MiniTableField field = {1, UPB_SIZE(20, 16), 64, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
8423   return upb_Message_HasBaseField(UPB_UPCAST(msg), &field);
8424 }
google_protobuf_ServiceDescriptorProto_clear_method(google_protobuf_ServiceDescriptorProto * msg)8425 UPB_INLINE void google_protobuf_ServiceDescriptorProto_clear_method(google_protobuf_ServiceDescriptorProto* msg) {
8426   const upb_MiniTableField field = {2, UPB_SIZE(12, 32), 0, 0, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
8427   upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
8428 }
google_protobuf_ServiceDescriptorProto_method(const google_protobuf_ServiceDescriptorProto * msg,size_t * size)8429 UPB_INLINE const google_protobuf_MethodDescriptorProto* const* google_protobuf_ServiceDescriptorProto_method(const google_protobuf_ServiceDescriptorProto* msg, size_t* size) {
8430   const upb_MiniTableField field = {2, UPB_SIZE(12, 32), 0, 0, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
8431   UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__MethodDescriptorProto_msg_init);
8432   const upb_Array* arr = upb_Message_GetArray(UPB_UPCAST(msg), &field);
8433   if (arr) {
8434     if (size) *size = arr->UPB_PRIVATE(size);
8435     return (const google_protobuf_MethodDescriptorProto* const*)upb_Array_DataPtr(arr);
8436   } else {
8437     if (size) *size = 0;
8438     return NULL;
8439   }
8440 }
_google_protobuf_ServiceDescriptorProto_method_upb_array(const google_protobuf_ServiceDescriptorProto * msg,size_t * size)8441 UPB_INLINE const upb_Array* _google_protobuf_ServiceDescriptorProto_method_upb_array(const google_protobuf_ServiceDescriptorProto* msg, size_t* size) {
8442   const upb_MiniTableField field = {2, UPB_SIZE(12, 32), 0, 0, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
8443   UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__MethodDescriptorProto_msg_init);
8444   const upb_Array* arr = upb_Message_GetArray(UPB_UPCAST(msg), &field);
8445   if (size) {
8446     *size = arr ? arr->UPB_PRIVATE(size) : 0;
8447   }
8448   return arr;
8449 }
_google_protobuf_ServiceDescriptorProto_method_mutable_upb_array(google_protobuf_ServiceDescriptorProto * msg,size_t * size,upb_Arena * arena)8450 UPB_INLINE upb_Array* _google_protobuf_ServiceDescriptorProto_method_mutable_upb_array(google_protobuf_ServiceDescriptorProto* msg, size_t* size, upb_Arena* arena) {
8451   const upb_MiniTableField field = {2, UPB_SIZE(12, 32), 0, 0, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
8452   UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__MethodDescriptorProto_msg_init);
8453   upb_Array* arr = upb_Message_GetOrCreateMutableArray(UPB_UPCAST(msg),
8454                                                        &field, arena);
8455   if (size) {
8456     *size = arr ? arr->UPB_PRIVATE(size) : 0;
8457   }
8458   return arr;
8459 }
google_protobuf_ServiceDescriptorProto_clear_options(google_protobuf_ServiceDescriptorProto * msg)8460 UPB_INLINE void google_protobuf_ServiceDescriptorProto_clear_options(google_protobuf_ServiceDescriptorProto* msg) {
8461   const upb_MiniTableField field = {3, UPB_SIZE(16, 40), 65, 1, 11, (int)kUpb_FieldMode_Scalar | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
8462   upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
8463 }
google_protobuf_ServiceDescriptorProto_options(const google_protobuf_ServiceDescriptorProto * msg)8464 UPB_INLINE const google_protobuf_ServiceOptions* google_protobuf_ServiceDescriptorProto_options(const google_protobuf_ServiceDescriptorProto* msg) {
8465   const google_protobuf_ServiceOptions* default_val = NULL;
8466   const google_protobuf_ServiceOptions* ret;
8467   const upb_MiniTableField field = {3, UPB_SIZE(16, 40), 65, 1, 11, (int)kUpb_FieldMode_Scalar | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
8468   UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__ServiceOptions_msg_init);
8469   _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field,
8470                                     &default_val, &ret);
8471   return ret;
8472 }
google_protobuf_ServiceDescriptorProto_has_options(const google_protobuf_ServiceDescriptorProto * msg)8473 UPB_INLINE bool google_protobuf_ServiceDescriptorProto_has_options(const google_protobuf_ServiceDescriptorProto* msg) {
8474   const upb_MiniTableField field = {3, UPB_SIZE(16, 40), 65, 1, 11, (int)kUpb_FieldMode_Scalar | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
8475   return upb_Message_HasBaseField(UPB_UPCAST(msg), &field);
8476 }
8477 
google_protobuf_ServiceDescriptorProto_set_name(google_protobuf_ServiceDescriptorProto * msg,upb_StringView value)8478 UPB_INLINE void google_protobuf_ServiceDescriptorProto_set_name(google_protobuf_ServiceDescriptorProto *msg, upb_StringView value) {
8479   const upb_MiniTableField field = {1, UPB_SIZE(20, 16), 64, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
8480   upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
8481 }
google_protobuf_ServiceDescriptorProto_mutable_method(google_protobuf_ServiceDescriptorProto * msg,size_t * size)8482 UPB_INLINE google_protobuf_MethodDescriptorProto** google_protobuf_ServiceDescriptorProto_mutable_method(google_protobuf_ServiceDescriptorProto* msg, size_t* size) {
8483   upb_MiniTableField field = {2, UPB_SIZE(12, 32), 0, 0, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
8484   UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__MethodDescriptorProto_msg_init);
8485   upb_Array* arr = upb_Message_GetMutableArray(UPB_UPCAST(msg), &field);
8486   if (arr) {
8487     if (size) *size = arr->UPB_PRIVATE(size);
8488     return (google_protobuf_MethodDescriptorProto**)upb_Array_MutableDataPtr(arr);
8489   } else {
8490     if (size) *size = 0;
8491     return NULL;
8492   }
8493 }
google_protobuf_ServiceDescriptorProto_resize_method(google_protobuf_ServiceDescriptorProto * msg,size_t size,upb_Arena * arena)8494 UPB_INLINE google_protobuf_MethodDescriptorProto** google_protobuf_ServiceDescriptorProto_resize_method(google_protobuf_ServiceDescriptorProto* msg, size_t size, upb_Arena* arena) {
8495   upb_MiniTableField field = {2, UPB_SIZE(12, 32), 0, 0, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
8496   return (google_protobuf_MethodDescriptorProto**)upb_Message_ResizeArrayUninitialized(UPB_UPCAST(msg),
8497                                                    &field, size, arena);
8498 }
google_protobuf_ServiceDescriptorProto_add_method(google_protobuf_ServiceDescriptorProto * msg,upb_Arena * arena)8499 UPB_INLINE struct google_protobuf_MethodDescriptorProto* google_protobuf_ServiceDescriptorProto_add_method(google_protobuf_ServiceDescriptorProto* msg, upb_Arena* arena) {
8500   upb_MiniTableField field = {2, UPB_SIZE(12, 32), 0, 0, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
8501   UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__MethodDescriptorProto_msg_init);
8502   upb_Array* arr = upb_Message_GetOrCreateMutableArray(
8503       UPB_UPCAST(msg), &field, arena);
8504   if (!arr || !UPB_PRIVATE(_upb_Array_ResizeUninitialized)(
8505                   arr, arr->UPB_PRIVATE(size) + 1, arena)) {
8506     return NULL;
8507   }
8508   struct google_protobuf_MethodDescriptorProto* sub = (struct google_protobuf_MethodDescriptorProto*)_upb_Message_New(&google__protobuf__MethodDescriptorProto_msg_init, arena);
8509   if (!arr || !sub) return NULL;
8510   UPB_PRIVATE(_upb_Array_Set)
8511   (arr, arr->UPB_PRIVATE(size) - 1, &sub, sizeof(sub));
8512   return sub;
8513 }
google_protobuf_ServiceDescriptorProto_set_options(google_protobuf_ServiceDescriptorProto * msg,google_protobuf_ServiceOptions * value)8514 UPB_INLINE void google_protobuf_ServiceDescriptorProto_set_options(google_protobuf_ServiceDescriptorProto *msg, google_protobuf_ServiceOptions* value) {
8515   const upb_MiniTableField field = {3, UPB_SIZE(16, 40), 65, 1, 11, (int)kUpb_FieldMode_Scalar | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
8516   UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__ServiceOptions_msg_init);
8517   upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
8518 }
google_protobuf_ServiceDescriptorProto_mutable_options(google_protobuf_ServiceDescriptorProto * msg,upb_Arena * arena)8519 UPB_INLINE struct google_protobuf_ServiceOptions* google_protobuf_ServiceDescriptorProto_mutable_options(google_protobuf_ServiceDescriptorProto* msg, upb_Arena* arena) {
8520   struct google_protobuf_ServiceOptions* sub = (struct google_protobuf_ServiceOptions*)google_protobuf_ServiceDescriptorProto_options(msg);
8521   if (sub == NULL) {
8522     sub = (struct google_protobuf_ServiceOptions*)_upb_Message_New(&google__protobuf__ServiceOptions_msg_init, arena);
8523     if (sub) google_protobuf_ServiceDescriptorProto_set_options(msg, sub);
8524   }
8525   return sub;
8526 }
8527 
8528 /* google.protobuf.MethodDescriptorProto */
8529 
google_protobuf_MethodDescriptorProto_new(upb_Arena * arena)8530 UPB_INLINE google_protobuf_MethodDescriptorProto* google_protobuf_MethodDescriptorProto_new(upb_Arena* arena) {
8531   return (google_protobuf_MethodDescriptorProto*)_upb_Message_New(&google__protobuf__MethodDescriptorProto_msg_init, arena);
8532 }
google_protobuf_MethodDescriptorProto_parse(const char * buf,size_t size,upb_Arena * arena)8533 UPB_INLINE google_protobuf_MethodDescriptorProto* google_protobuf_MethodDescriptorProto_parse(const char* buf, size_t size, upb_Arena* arena) {
8534   google_protobuf_MethodDescriptorProto* ret = google_protobuf_MethodDescriptorProto_new(arena);
8535   if (!ret) return NULL;
8536   if (upb_Decode(buf, size, UPB_UPCAST(ret), &google__protobuf__MethodDescriptorProto_msg_init, NULL, 0, arena) !=
8537       kUpb_DecodeStatus_Ok) {
8538     return NULL;
8539   }
8540   return ret;
8541 }
google_protobuf_MethodDescriptorProto_parse_ex(const char * buf,size_t size,const upb_ExtensionRegistry * extreg,int options,upb_Arena * arena)8542 UPB_INLINE google_protobuf_MethodDescriptorProto* google_protobuf_MethodDescriptorProto_parse_ex(const char* buf, size_t size,
8543                            const upb_ExtensionRegistry* extreg,
8544                            int options, upb_Arena* arena) {
8545   google_protobuf_MethodDescriptorProto* ret = google_protobuf_MethodDescriptorProto_new(arena);
8546   if (!ret) return NULL;
8547   if (upb_Decode(buf, size, UPB_UPCAST(ret), &google__protobuf__MethodDescriptorProto_msg_init, extreg, options,
8548                  arena) != kUpb_DecodeStatus_Ok) {
8549     return NULL;
8550   }
8551   return ret;
8552 }
google_protobuf_MethodDescriptorProto_serialize(const google_protobuf_MethodDescriptorProto * msg,upb_Arena * arena,size_t * len)8553 UPB_INLINE char* google_protobuf_MethodDescriptorProto_serialize(const google_protobuf_MethodDescriptorProto* msg, upb_Arena* arena, size_t* len) {
8554   char* ptr;
8555   (void)upb_Encode(UPB_UPCAST(msg), &google__protobuf__MethodDescriptorProto_msg_init, 0, arena, &ptr, len);
8556   return ptr;
8557 }
google_protobuf_MethodDescriptorProto_serialize_ex(const google_protobuf_MethodDescriptorProto * msg,int options,upb_Arena * arena,size_t * len)8558 UPB_INLINE char* google_protobuf_MethodDescriptorProto_serialize_ex(const google_protobuf_MethodDescriptorProto* msg, int options,
8559                                  upb_Arena* arena, size_t* len) {
8560   char* ptr;
8561   (void)upb_Encode(UPB_UPCAST(msg), &google__protobuf__MethodDescriptorProto_msg_init, options, arena, &ptr, len);
8562   return ptr;
8563 }
google_protobuf_MethodDescriptorProto_clear_name(google_protobuf_MethodDescriptorProto * msg)8564 UPB_INLINE void google_protobuf_MethodDescriptorProto_clear_name(google_protobuf_MethodDescriptorProto* msg) {
8565   const upb_MiniTableField field = {1, UPB_SIZE(20, 16), 64, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
8566   upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
8567 }
google_protobuf_MethodDescriptorProto_name(const google_protobuf_MethodDescriptorProto * msg)8568 UPB_INLINE upb_StringView google_protobuf_MethodDescriptorProto_name(const google_protobuf_MethodDescriptorProto* msg) {
8569   upb_StringView default_val = upb_StringView_FromString("");
8570   upb_StringView ret;
8571   const upb_MiniTableField field = {1, UPB_SIZE(20, 16), 64, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
8572   _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field,
8573                                     &default_val, &ret);
8574   return ret;
8575 }
google_protobuf_MethodDescriptorProto_has_name(const google_protobuf_MethodDescriptorProto * msg)8576 UPB_INLINE bool google_protobuf_MethodDescriptorProto_has_name(const google_protobuf_MethodDescriptorProto* msg) {
8577   const upb_MiniTableField field = {1, UPB_SIZE(20, 16), 64, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
8578   return upb_Message_HasBaseField(UPB_UPCAST(msg), &field);
8579 }
google_protobuf_MethodDescriptorProto_clear_input_type(google_protobuf_MethodDescriptorProto * msg)8580 UPB_INLINE void google_protobuf_MethodDescriptorProto_clear_input_type(google_protobuf_MethodDescriptorProto* msg) {
8581   const upb_MiniTableField field = {2, UPB_SIZE(28, 32), 65, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
8582   upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
8583 }
google_protobuf_MethodDescriptorProto_input_type(const google_protobuf_MethodDescriptorProto * msg)8584 UPB_INLINE upb_StringView google_protobuf_MethodDescriptorProto_input_type(const google_protobuf_MethodDescriptorProto* msg) {
8585   upb_StringView default_val = upb_StringView_FromString("");
8586   upb_StringView ret;
8587   const upb_MiniTableField field = {2, UPB_SIZE(28, 32), 65, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
8588   _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field,
8589                                     &default_val, &ret);
8590   return ret;
8591 }
google_protobuf_MethodDescriptorProto_has_input_type(const google_protobuf_MethodDescriptorProto * msg)8592 UPB_INLINE bool google_protobuf_MethodDescriptorProto_has_input_type(const google_protobuf_MethodDescriptorProto* msg) {
8593   const upb_MiniTableField field = {2, UPB_SIZE(28, 32), 65, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
8594   return upb_Message_HasBaseField(UPB_UPCAST(msg), &field);
8595 }
google_protobuf_MethodDescriptorProto_clear_output_type(google_protobuf_MethodDescriptorProto * msg)8596 UPB_INLINE void google_protobuf_MethodDescriptorProto_clear_output_type(google_protobuf_MethodDescriptorProto* msg) {
8597   const upb_MiniTableField field = {3, UPB_SIZE(36, 48), 66, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
8598   upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
8599 }
google_protobuf_MethodDescriptorProto_output_type(const google_protobuf_MethodDescriptorProto * msg)8600 UPB_INLINE upb_StringView google_protobuf_MethodDescriptorProto_output_type(const google_protobuf_MethodDescriptorProto* msg) {
8601   upb_StringView default_val = upb_StringView_FromString("");
8602   upb_StringView ret;
8603   const upb_MiniTableField field = {3, UPB_SIZE(36, 48), 66, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
8604   _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field,
8605                                     &default_val, &ret);
8606   return ret;
8607 }
google_protobuf_MethodDescriptorProto_has_output_type(const google_protobuf_MethodDescriptorProto * msg)8608 UPB_INLINE bool google_protobuf_MethodDescriptorProto_has_output_type(const google_protobuf_MethodDescriptorProto* msg) {
8609   const upb_MiniTableField field = {3, UPB_SIZE(36, 48), 66, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
8610   return upb_Message_HasBaseField(UPB_UPCAST(msg), &field);
8611 }
google_protobuf_MethodDescriptorProto_clear_options(google_protobuf_MethodDescriptorProto * msg)8612 UPB_INLINE void google_protobuf_MethodDescriptorProto_clear_options(google_protobuf_MethodDescriptorProto* msg) {
8613   const upb_MiniTableField field = {4, UPB_SIZE(12, 64), 67, 0, 11, (int)kUpb_FieldMode_Scalar | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
8614   upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
8615 }
google_protobuf_MethodDescriptorProto_options(const google_protobuf_MethodDescriptorProto * msg)8616 UPB_INLINE const google_protobuf_MethodOptions* google_protobuf_MethodDescriptorProto_options(const google_protobuf_MethodDescriptorProto* msg) {
8617   const google_protobuf_MethodOptions* default_val = NULL;
8618   const google_protobuf_MethodOptions* ret;
8619   const upb_MiniTableField field = {4, UPB_SIZE(12, 64), 67, 0, 11, (int)kUpb_FieldMode_Scalar | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
8620   UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__MethodOptions_msg_init);
8621   _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field,
8622                                     &default_val, &ret);
8623   return ret;
8624 }
google_protobuf_MethodDescriptorProto_has_options(const google_protobuf_MethodDescriptorProto * msg)8625 UPB_INLINE bool google_protobuf_MethodDescriptorProto_has_options(const google_protobuf_MethodDescriptorProto* msg) {
8626   const upb_MiniTableField field = {4, UPB_SIZE(12, 64), 67, 0, 11, (int)kUpb_FieldMode_Scalar | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
8627   return upb_Message_HasBaseField(UPB_UPCAST(msg), &field);
8628 }
google_protobuf_MethodDescriptorProto_clear_client_streaming(google_protobuf_MethodDescriptorProto * msg)8629 UPB_INLINE void google_protobuf_MethodDescriptorProto_clear_client_streaming(google_protobuf_MethodDescriptorProto* msg) {
8630   const upb_MiniTableField field = {5, UPB_SIZE(16, 9), 68, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
8631   upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
8632 }
google_protobuf_MethodDescriptorProto_client_streaming(const google_protobuf_MethodDescriptorProto * msg)8633 UPB_INLINE bool google_protobuf_MethodDescriptorProto_client_streaming(const google_protobuf_MethodDescriptorProto* msg) {
8634   bool default_val = false;
8635   bool ret;
8636   const upb_MiniTableField field = {5, UPB_SIZE(16, 9), 68, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
8637   _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field,
8638                                     &default_val, &ret);
8639   return ret;
8640 }
google_protobuf_MethodDescriptorProto_has_client_streaming(const google_protobuf_MethodDescriptorProto * msg)8641 UPB_INLINE bool google_protobuf_MethodDescriptorProto_has_client_streaming(const google_protobuf_MethodDescriptorProto* msg) {
8642   const upb_MiniTableField field = {5, UPB_SIZE(16, 9), 68, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
8643   return upb_Message_HasBaseField(UPB_UPCAST(msg), &field);
8644 }
google_protobuf_MethodDescriptorProto_clear_server_streaming(google_protobuf_MethodDescriptorProto * msg)8645 UPB_INLINE void google_protobuf_MethodDescriptorProto_clear_server_streaming(google_protobuf_MethodDescriptorProto* msg) {
8646   const upb_MiniTableField field = {6, UPB_SIZE(17, 10), 69, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
8647   upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
8648 }
google_protobuf_MethodDescriptorProto_server_streaming(const google_protobuf_MethodDescriptorProto * msg)8649 UPB_INLINE bool google_protobuf_MethodDescriptorProto_server_streaming(const google_protobuf_MethodDescriptorProto* msg) {
8650   bool default_val = false;
8651   bool ret;
8652   const upb_MiniTableField field = {6, UPB_SIZE(17, 10), 69, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
8653   _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field,
8654                                     &default_val, &ret);
8655   return ret;
8656 }
google_protobuf_MethodDescriptorProto_has_server_streaming(const google_protobuf_MethodDescriptorProto * msg)8657 UPB_INLINE bool google_protobuf_MethodDescriptorProto_has_server_streaming(const google_protobuf_MethodDescriptorProto* msg) {
8658   const upb_MiniTableField field = {6, UPB_SIZE(17, 10), 69, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
8659   return upb_Message_HasBaseField(UPB_UPCAST(msg), &field);
8660 }
8661 
google_protobuf_MethodDescriptorProto_set_name(google_protobuf_MethodDescriptorProto * msg,upb_StringView value)8662 UPB_INLINE void google_protobuf_MethodDescriptorProto_set_name(google_protobuf_MethodDescriptorProto *msg, upb_StringView value) {
8663   const upb_MiniTableField field = {1, UPB_SIZE(20, 16), 64, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
8664   upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
8665 }
google_protobuf_MethodDescriptorProto_set_input_type(google_protobuf_MethodDescriptorProto * msg,upb_StringView value)8666 UPB_INLINE void google_protobuf_MethodDescriptorProto_set_input_type(google_protobuf_MethodDescriptorProto *msg, upb_StringView value) {
8667   const upb_MiniTableField field = {2, UPB_SIZE(28, 32), 65, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
8668   upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
8669 }
google_protobuf_MethodDescriptorProto_set_output_type(google_protobuf_MethodDescriptorProto * msg,upb_StringView value)8670 UPB_INLINE void google_protobuf_MethodDescriptorProto_set_output_type(google_protobuf_MethodDescriptorProto *msg, upb_StringView value) {
8671   const upb_MiniTableField field = {3, UPB_SIZE(36, 48), 66, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
8672   upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
8673 }
google_protobuf_MethodDescriptorProto_set_options(google_protobuf_MethodDescriptorProto * msg,google_protobuf_MethodOptions * value)8674 UPB_INLINE void google_protobuf_MethodDescriptorProto_set_options(google_protobuf_MethodDescriptorProto *msg, google_protobuf_MethodOptions* value) {
8675   const upb_MiniTableField field = {4, UPB_SIZE(12, 64), 67, 0, 11, (int)kUpb_FieldMode_Scalar | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
8676   UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__MethodOptions_msg_init);
8677   upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
8678 }
google_protobuf_MethodDescriptorProto_mutable_options(google_protobuf_MethodDescriptorProto * msg,upb_Arena * arena)8679 UPB_INLINE struct google_protobuf_MethodOptions* google_protobuf_MethodDescriptorProto_mutable_options(google_protobuf_MethodDescriptorProto* msg, upb_Arena* arena) {
8680   struct google_protobuf_MethodOptions* sub = (struct google_protobuf_MethodOptions*)google_protobuf_MethodDescriptorProto_options(msg);
8681   if (sub == NULL) {
8682     sub = (struct google_protobuf_MethodOptions*)_upb_Message_New(&google__protobuf__MethodOptions_msg_init, arena);
8683     if (sub) google_protobuf_MethodDescriptorProto_set_options(msg, sub);
8684   }
8685   return sub;
8686 }
google_protobuf_MethodDescriptorProto_set_client_streaming(google_protobuf_MethodDescriptorProto * msg,bool value)8687 UPB_INLINE void google_protobuf_MethodDescriptorProto_set_client_streaming(google_protobuf_MethodDescriptorProto *msg, bool value) {
8688   const upb_MiniTableField field = {5, UPB_SIZE(16, 9), 68, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
8689   upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
8690 }
google_protobuf_MethodDescriptorProto_set_server_streaming(google_protobuf_MethodDescriptorProto * msg,bool value)8691 UPB_INLINE void google_protobuf_MethodDescriptorProto_set_server_streaming(google_protobuf_MethodDescriptorProto *msg, bool value) {
8692   const upb_MiniTableField field = {6, UPB_SIZE(17, 10), 69, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
8693   upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
8694 }
8695 
8696 /* google.protobuf.FileOptions */
8697 
google_protobuf_FileOptions_new(upb_Arena * arena)8698 UPB_INLINE google_protobuf_FileOptions* google_protobuf_FileOptions_new(upb_Arena* arena) {
8699   return (google_protobuf_FileOptions*)_upb_Message_New(&google__protobuf__FileOptions_msg_init, arena);
8700 }
google_protobuf_FileOptions_parse(const char * buf,size_t size,upb_Arena * arena)8701 UPB_INLINE google_protobuf_FileOptions* google_protobuf_FileOptions_parse(const char* buf, size_t size, upb_Arena* arena) {
8702   google_protobuf_FileOptions* ret = google_protobuf_FileOptions_new(arena);
8703   if (!ret) return NULL;
8704   if (upb_Decode(buf, size, UPB_UPCAST(ret), &google__protobuf__FileOptions_msg_init, NULL, 0, arena) !=
8705       kUpb_DecodeStatus_Ok) {
8706     return NULL;
8707   }
8708   return ret;
8709 }
google_protobuf_FileOptions_parse_ex(const char * buf,size_t size,const upb_ExtensionRegistry * extreg,int options,upb_Arena * arena)8710 UPB_INLINE google_protobuf_FileOptions* google_protobuf_FileOptions_parse_ex(const char* buf, size_t size,
8711                            const upb_ExtensionRegistry* extreg,
8712                            int options, upb_Arena* arena) {
8713   google_protobuf_FileOptions* ret = google_protobuf_FileOptions_new(arena);
8714   if (!ret) return NULL;
8715   if (upb_Decode(buf, size, UPB_UPCAST(ret), &google__protobuf__FileOptions_msg_init, extreg, options,
8716                  arena) != kUpb_DecodeStatus_Ok) {
8717     return NULL;
8718   }
8719   return ret;
8720 }
google_protobuf_FileOptions_serialize(const google_protobuf_FileOptions * msg,upb_Arena * arena,size_t * len)8721 UPB_INLINE char* google_protobuf_FileOptions_serialize(const google_protobuf_FileOptions* msg, upb_Arena* arena, size_t* len) {
8722   char* ptr;
8723   (void)upb_Encode(UPB_UPCAST(msg), &google__protobuf__FileOptions_msg_init, 0, arena, &ptr, len);
8724   return ptr;
8725 }
google_protobuf_FileOptions_serialize_ex(const google_protobuf_FileOptions * msg,int options,upb_Arena * arena,size_t * len)8726 UPB_INLINE char* google_protobuf_FileOptions_serialize_ex(const google_protobuf_FileOptions* msg, int options,
8727                                  upb_Arena* arena, size_t* len) {
8728   char* ptr;
8729   (void)upb_Encode(UPB_UPCAST(msg), &google__protobuf__FileOptions_msg_init, options, arena, &ptr, len);
8730   return ptr;
8731 }
google_protobuf_FileOptions_clear_java_package(google_protobuf_FileOptions * msg)8732 UPB_INLINE void google_protobuf_FileOptions_clear_java_package(google_protobuf_FileOptions* msg) {
8733   const upb_MiniTableField field = {1, UPB_SIZE(32, 24), 64, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
8734   upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
8735 }
google_protobuf_FileOptions_java_package(const google_protobuf_FileOptions * msg)8736 UPB_INLINE upb_StringView google_protobuf_FileOptions_java_package(const google_protobuf_FileOptions* msg) {
8737   upb_StringView default_val = upb_StringView_FromString("");
8738   upb_StringView ret;
8739   const upb_MiniTableField field = {1, UPB_SIZE(32, 24), 64, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
8740   _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field,
8741                                     &default_val, &ret);
8742   return ret;
8743 }
google_protobuf_FileOptions_has_java_package(const google_protobuf_FileOptions * msg)8744 UPB_INLINE bool google_protobuf_FileOptions_has_java_package(const google_protobuf_FileOptions* msg) {
8745   const upb_MiniTableField field = {1, UPB_SIZE(32, 24), 64, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
8746   return upb_Message_HasBaseField(UPB_UPCAST(msg), &field);
8747 }
google_protobuf_FileOptions_clear_java_outer_classname(google_protobuf_FileOptions * msg)8748 UPB_INLINE void google_protobuf_FileOptions_clear_java_outer_classname(google_protobuf_FileOptions* msg) {
8749   const upb_MiniTableField field = {8, 40, 65, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
8750   upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
8751 }
google_protobuf_FileOptions_java_outer_classname(const google_protobuf_FileOptions * msg)8752 UPB_INLINE upb_StringView google_protobuf_FileOptions_java_outer_classname(const google_protobuf_FileOptions* msg) {
8753   upb_StringView default_val = upb_StringView_FromString("");
8754   upb_StringView ret;
8755   const upb_MiniTableField field = {8, 40, 65, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
8756   _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field,
8757                                     &default_val, &ret);
8758   return ret;
8759 }
google_protobuf_FileOptions_has_java_outer_classname(const google_protobuf_FileOptions * msg)8760 UPB_INLINE bool google_protobuf_FileOptions_has_java_outer_classname(const google_protobuf_FileOptions* msg) {
8761   const upb_MiniTableField field = {8, 40, 65, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
8762   return upb_Message_HasBaseField(UPB_UPCAST(msg), &field);
8763 }
google_protobuf_FileOptions_clear_optimize_for(google_protobuf_FileOptions * msg)8764 UPB_INLINE void google_protobuf_FileOptions_clear_optimize_for(google_protobuf_FileOptions* msg) {
8765   const upb_MiniTableField field = {9, 12, 66, 2, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
8766   upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
8767 }
google_protobuf_FileOptions_optimize_for(const google_protobuf_FileOptions * msg)8768 UPB_INLINE int32_t google_protobuf_FileOptions_optimize_for(const google_protobuf_FileOptions* msg) {
8769   int32_t default_val = 1;
8770   int32_t ret;
8771   const upb_MiniTableField field = {9, 12, 66, 2, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
8772   _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field,
8773                                     &default_val, &ret);
8774   return ret;
8775 }
google_protobuf_FileOptions_has_optimize_for(const google_protobuf_FileOptions * msg)8776 UPB_INLINE bool google_protobuf_FileOptions_has_optimize_for(const google_protobuf_FileOptions* msg) {
8777   const upb_MiniTableField field = {9, 12, 66, 2, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
8778   return upb_Message_HasBaseField(UPB_UPCAST(msg), &field);
8779 }
google_protobuf_FileOptions_clear_java_multiple_files(google_protobuf_FileOptions * msg)8780 UPB_INLINE void google_protobuf_FileOptions_clear_java_multiple_files(google_protobuf_FileOptions* msg) {
8781   const upb_MiniTableField field = {10, 16, 67, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
8782   upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
8783 }
google_protobuf_FileOptions_java_multiple_files(const google_protobuf_FileOptions * msg)8784 UPB_INLINE bool google_protobuf_FileOptions_java_multiple_files(const google_protobuf_FileOptions* msg) {
8785   bool default_val = false;
8786   bool ret;
8787   const upb_MiniTableField field = {10, 16, 67, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
8788   _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field,
8789                                     &default_val, &ret);
8790   return ret;
8791 }
google_protobuf_FileOptions_has_java_multiple_files(const google_protobuf_FileOptions * msg)8792 UPB_INLINE bool google_protobuf_FileOptions_has_java_multiple_files(const google_protobuf_FileOptions* msg) {
8793   const upb_MiniTableField field = {10, 16, 67, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
8794   return upb_Message_HasBaseField(UPB_UPCAST(msg), &field);
8795 }
google_protobuf_FileOptions_clear_go_package(google_protobuf_FileOptions * msg)8796 UPB_INLINE void google_protobuf_FileOptions_clear_go_package(google_protobuf_FileOptions* msg) {
8797   const upb_MiniTableField field = {11, UPB_SIZE(48, 56), 68, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
8798   upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
8799 }
google_protobuf_FileOptions_go_package(const google_protobuf_FileOptions * msg)8800 UPB_INLINE upb_StringView google_protobuf_FileOptions_go_package(const google_protobuf_FileOptions* msg) {
8801   upb_StringView default_val = upb_StringView_FromString("");
8802   upb_StringView ret;
8803   const upb_MiniTableField field = {11, UPB_SIZE(48, 56), 68, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
8804   _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field,
8805                                     &default_val, &ret);
8806   return ret;
8807 }
google_protobuf_FileOptions_has_go_package(const google_protobuf_FileOptions * msg)8808 UPB_INLINE bool google_protobuf_FileOptions_has_go_package(const google_protobuf_FileOptions* msg) {
8809   const upb_MiniTableField field = {11, UPB_SIZE(48, 56), 68, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
8810   return upb_Message_HasBaseField(UPB_UPCAST(msg), &field);
8811 }
google_protobuf_FileOptions_clear_cc_generic_services(google_protobuf_FileOptions * msg)8812 UPB_INLINE void google_protobuf_FileOptions_clear_cc_generic_services(google_protobuf_FileOptions* msg) {
8813   const upb_MiniTableField field = {16, 17, 69, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
8814   upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
8815 }
google_protobuf_FileOptions_cc_generic_services(const google_protobuf_FileOptions * msg)8816 UPB_INLINE bool google_protobuf_FileOptions_cc_generic_services(const google_protobuf_FileOptions* msg) {
8817   bool default_val = false;
8818   bool ret;
8819   const upb_MiniTableField field = {16, 17, 69, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
8820   _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field,
8821                                     &default_val, &ret);
8822   return ret;
8823 }
google_protobuf_FileOptions_has_cc_generic_services(const google_protobuf_FileOptions * msg)8824 UPB_INLINE bool google_protobuf_FileOptions_has_cc_generic_services(const google_protobuf_FileOptions* msg) {
8825   const upb_MiniTableField field = {16, 17, 69, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
8826   return upb_Message_HasBaseField(UPB_UPCAST(msg), &field);
8827 }
google_protobuf_FileOptions_clear_java_generic_services(google_protobuf_FileOptions * msg)8828 UPB_INLINE void google_protobuf_FileOptions_clear_java_generic_services(google_protobuf_FileOptions* msg) {
8829   const upb_MiniTableField field = {17, 18, 70, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
8830   upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
8831 }
google_protobuf_FileOptions_java_generic_services(const google_protobuf_FileOptions * msg)8832 UPB_INLINE bool google_protobuf_FileOptions_java_generic_services(const google_protobuf_FileOptions* msg) {
8833   bool default_val = false;
8834   bool ret;
8835   const upb_MiniTableField field = {17, 18, 70, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
8836   _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field,
8837                                     &default_val, &ret);
8838   return ret;
8839 }
google_protobuf_FileOptions_has_java_generic_services(const google_protobuf_FileOptions * msg)8840 UPB_INLINE bool google_protobuf_FileOptions_has_java_generic_services(const google_protobuf_FileOptions* msg) {
8841   const upb_MiniTableField field = {17, 18, 70, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
8842   return upb_Message_HasBaseField(UPB_UPCAST(msg), &field);
8843 }
google_protobuf_FileOptions_clear_py_generic_services(google_protobuf_FileOptions * msg)8844 UPB_INLINE void google_protobuf_FileOptions_clear_py_generic_services(google_protobuf_FileOptions* msg) {
8845   const upb_MiniTableField field = {18, 19, 71, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
8846   upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
8847 }
google_protobuf_FileOptions_py_generic_services(const google_protobuf_FileOptions * msg)8848 UPB_INLINE bool google_protobuf_FileOptions_py_generic_services(const google_protobuf_FileOptions* msg) {
8849   bool default_val = false;
8850   bool ret;
8851   const upb_MiniTableField field = {18, 19, 71, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
8852   _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field,
8853                                     &default_val, &ret);
8854   return ret;
8855 }
google_protobuf_FileOptions_has_py_generic_services(const google_protobuf_FileOptions * msg)8856 UPB_INLINE bool google_protobuf_FileOptions_has_py_generic_services(const google_protobuf_FileOptions* msg) {
8857   const upb_MiniTableField field = {18, 19, 71, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
8858   return upb_Message_HasBaseField(UPB_UPCAST(msg), &field);
8859 }
google_protobuf_FileOptions_clear_java_generate_equals_and_hash(google_protobuf_FileOptions * msg)8860 UPB_INLINE void google_protobuf_FileOptions_clear_java_generate_equals_and_hash(google_protobuf_FileOptions* msg) {
8861   const upb_MiniTableField field = {20, 20, 72, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
8862   upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
8863 }
google_protobuf_FileOptions_java_generate_equals_and_hash(const google_protobuf_FileOptions * msg)8864 UPB_INLINE bool google_protobuf_FileOptions_java_generate_equals_and_hash(const google_protobuf_FileOptions* msg) {
8865   bool default_val = false;
8866   bool ret;
8867   const upb_MiniTableField field = {20, 20, 72, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
8868   _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field,
8869                                     &default_val, &ret);
8870   return ret;
8871 }
google_protobuf_FileOptions_has_java_generate_equals_and_hash(const google_protobuf_FileOptions * msg)8872 UPB_INLINE bool google_protobuf_FileOptions_has_java_generate_equals_and_hash(const google_protobuf_FileOptions* msg) {
8873   const upb_MiniTableField field = {20, 20, 72, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
8874   return upb_Message_HasBaseField(UPB_UPCAST(msg), &field);
8875 }
google_protobuf_FileOptions_clear_deprecated(google_protobuf_FileOptions * msg)8876 UPB_INLINE void google_protobuf_FileOptions_clear_deprecated(google_protobuf_FileOptions* msg) {
8877   const upb_MiniTableField field = {23, 21, 73, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
8878   upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
8879 }
google_protobuf_FileOptions_deprecated(const google_protobuf_FileOptions * msg)8880 UPB_INLINE bool google_protobuf_FileOptions_deprecated(const google_protobuf_FileOptions* msg) {
8881   bool default_val = false;
8882   bool ret;
8883   const upb_MiniTableField field = {23, 21, 73, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
8884   _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field,
8885                                     &default_val, &ret);
8886   return ret;
8887 }
google_protobuf_FileOptions_has_deprecated(const google_protobuf_FileOptions * msg)8888 UPB_INLINE bool google_protobuf_FileOptions_has_deprecated(const google_protobuf_FileOptions* msg) {
8889   const upb_MiniTableField field = {23, 21, 73, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
8890   return upb_Message_HasBaseField(UPB_UPCAST(msg), &field);
8891 }
google_protobuf_FileOptions_clear_java_string_check_utf8(google_protobuf_FileOptions * msg)8892 UPB_INLINE void google_protobuf_FileOptions_clear_java_string_check_utf8(google_protobuf_FileOptions* msg) {
8893   const upb_MiniTableField field = {27, 22, 74, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
8894   upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
8895 }
google_protobuf_FileOptions_java_string_check_utf8(const google_protobuf_FileOptions * msg)8896 UPB_INLINE bool google_protobuf_FileOptions_java_string_check_utf8(const google_protobuf_FileOptions* msg) {
8897   bool default_val = false;
8898   bool ret;
8899   const upb_MiniTableField field = {27, 22, 74, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
8900   _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field,
8901                                     &default_val, &ret);
8902   return ret;
8903 }
google_protobuf_FileOptions_has_java_string_check_utf8(const google_protobuf_FileOptions * msg)8904 UPB_INLINE bool google_protobuf_FileOptions_has_java_string_check_utf8(const google_protobuf_FileOptions* msg) {
8905   const upb_MiniTableField field = {27, 22, 74, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
8906   return upb_Message_HasBaseField(UPB_UPCAST(msg), &field);
8907 }
google_protobuf_FileOptions_clear_cc_enable_arenas(google_protobuf_FileOptions * msg)8908 UPB_INLINE void google_protobuf_FileOptions_clear_cc_enable_arenas(google_protobuf_FileOptions* msg) {
8909   const upb_MiniTableField field = {31, 23, 75, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
8910   upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
8911 }
google_protobuf_FileOptions_cc_enable_arenas(const google_protobuf_FileOptions * msg)8912 UPB_INLINE bool google_protobuf_FileOptions_cc_enable_arenas(const google_protobuf_FileOptions* msg) {
8913   bool default_val = true;
8914   bool ret;
8915   const upb_MiniTableField field = {31, 23, 75, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
8916   _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field,
8917                                     &default_val, &ret);
8918   return ret;
8919 }
google_protobuf_FileOptions_has_cc_enable_arenas(const google_protobuf_FileOptions * msg)8920 UPB_INLINE bool google_protobuf_FileOptions_has_cc_enable_arenas(const google_protobuf_FileOptions* msg) {
8921   const upb_MiniTableField field = {31, 23, 75, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
8922   return upb_Message_HasBaseField(UPB_UPCAST(msg), &field);
8923 }
google_protobuf_FileOptions_clear_objc_class_prefix(google_protobuf_FileOptions * msg)8924 UPB_INLINE void google_protobuf_FileOptions_clear_objc_class_prefix(google_protobuf_FileOptions* msg) {
8925   const upb_MiniTableField field = {36, UPB_SIZE(56, 72), 76, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
8926   upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
8927 }
google_protobuf_FileOptions_objc_class_prefix(const google_protobuf_FileOptions * msg)8928 UPB_INLINE upb_StringView google_protobuf_FileOptions_objc_class_prefix(const google_protobuf_FileOptions* msg) {
8929   upb_StringView default_val = upb_StringView_FromString("");
8930   upb_StringView ret;
8931   const upb_MiniTableField field = {36, UPB_SIZE(56, 72), 76, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
8932   _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field,
8933                                     &default_val, &ret);
8934   return ret;
8935 }
google_protobuf_FileOptions_has_objc_class_prefix(const google_protobuf_FileOptions * msg)8936 UPB_INLINE bool google_protobuf_FileOptions_has_objc_class_prefix(const google_protobuf_FileOptions* msg) {
8937   const upb_MiniTableField field = {36, UPB_SIZE(56, 72), 76, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
8938   return upb_Message_HasBaseField(UPB_UPCAST(msg), &field);
8939 }
google_protobuf_FileOptions_clear_csharp_namespace(google_protobuf_FileOptions * msg)8940 UPB_INLINE void google_protobuf_FileOptions_clear_csharp_namespace(google_protobuf_FileOptions* msg) {
8941   const upb_MiniTableField field = {37, UPB_SIZE(64, 88), 77, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
8942   upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
8943 }
google_protobuf_FileOptions_csharp_namespace(const google_protobuf_FileOptions * msg)8944 UPB_INLINE upb_StringView google_protobuf_FileOptions_csharp_namespace(const google_protobuf_FileOptions* msg) {
8945   upb_StringView default_val = upb_StringView_FromString("");
8946   upb_StringView ret;
8947   const upb_MiniTableField field = {37, UPB_SIZE(64, 88), 77, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
8948   _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field,
8949                                     &default_val, &ret);
8950   return ret;
8951 }
google_protobuf_FileOptions_has_csharp_namespace(const google_protobuf_FileOptions * msg)8952 UPB_INLINE bool google_protobuf_FileOptions_has_csharp_namespace(const google_protobuf_FileOptions* msg) {
8953   const upb_MiniTableField field = {37, UPB_SIZE(64, 88), 77, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
8954   return upb_Message_HasBaseField(UPB_UPCAST(msg), &field);
8955 }
google_protobuf_FileOptions_clear_swift_prefix(google_protobuf_FileOptions * msg)8956 UPB_INLINE void google_protobuf_FileOptions_clear_swift_prefix(google_protobuf_FileOptions* msg) {
8957   const upb_MiniTableField field = {39, UPB_SIZE(72, 104), 78, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
8958   upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
8959 }
google_protobuf_FileOptions_swift_prefix(const google_protobuf_FileOptions * msg)8960 UPB_INLINE upb_StringView google_protobuf_FileOptions_swift_prefix(const google_protobuf_FileOptions* msg) {
8961   upb_StringView default_val = upb_StringView_FromString("");
8962   upb_StringView ret;
8963   const upb_MiniTableField field = {39, UPB_SIZE(72, 104), 78, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
8964   _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field,
8965                                     &default_val, &ret);
8966   return ret;
8967 }
google_protobuf_FileOptions_has_swift_prefix(const google_protobuf_FileOptions * msg)8968 UPB_INLINE bool google_protobuf_FileOptions_has_swift_prefix(const google_protobuf_FileOptions* msg) {
8969   const upb_MiniTableField field = {39, UPB_SIZE(72, 104), 78, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
8970   return upb_Message_HasBaseField(UPB_UPCAST(msg), &field);
8971 }
google_protobuf_FileOptions_clear_php_class_prefix(google_protobuf_FileOptions * msg)8972 UPB_INLINE void google_protobuf_FileOptions_clear_php_class_prefix(google_protobuf_FileOptions* msg) {
8973   const upb_MiniTableField field = {40, UPB_SIZE(80, 120), 79, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
8974   upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
8975 }
google_protobuf_FileOptions_php_class_prefix(const google_protobuf_FileOptions * msg)8976 UPB_INLINE upb_StringView google_protobuf_FileOptions_php_class_prefix(const google_protobuf_FileOptions* msg) {
8977   upb_StringView default_val = upb_StringView_FromString("");
8978   upb_StringView ret;
8979   const upb_MiniTableField field = {40, UPB_SIZE(80, 120), 79, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
8980   _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field,
8981                                     &default_val, &ret);
8982   return ret;
8983 }
google_protobuf_FileOptions_has_php_class_prefix(const google_protobuf_FileOptions * msg)8984 UPB_INLINE bool google_protobuf_FileOptions_has_php_class_prefix(const google_protobuf_FileOptions* msg) {
8985   const upb_MiniTableField field = {40, UPB_SIZE(80, 120), 79, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
8986   return upb_Message_HasBaseField(UPB_UPCAST(msg), &field);
8987 }
google_protobuf_FileOptions_clear_php_namespace(google_protobuf_FileOptions * msg)8988 UPB_INLINE void google_protobuf_FileOptions_clear_php_namespace(google_protobuf_FileOptions* msg) {
8989   const upb_MiniTableField field = {41, UPB_SIZE(88, 136), 80, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
8990   upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
8991 }
google_protobuf_FileOptions_php_namespace(const google_protobuf_FileOptions * msg)8992 UPB_INLINE upb_StringView google_protobuf_FileOptions_php_namespace(const google_protobuf_FileOptions* msg) {
8993   upb_StringView default_val = upb_StringView_FromString("");
8994   upb_StringView ret;
8995   const upb_MiniTableField field = {41, UPB_SIZE(88, 136), 80, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
8996   _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field,
8997                                     &default_val, &ret);
8998   return ret;
8999 }
google_protobuf_FileOptions_has_php_namespace(const google_protobuf_FileOptions * msg)9000 UPB_INLINE bool google_protobuf_FileOptions_has_php_namespace(const google_protobuf_FileOptions* msg) {
9001   const upb_MiniTableField field = {41, UPB_SIZE(88, 136), 80, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
9002   return upb_Message_HasBaseField(UPB_UPCAST(msg), &field);
9003 }
google_protobuf_FileOptions_clear_php_metadata_namespace(google_protobuf_FileOptions * msg)9004 UPB_INLINE void google_protobuf_FileOptions_clear_php_metadata_namespace(google_protobuf_FileOptions* msg) {
9005   const upb_MiniTableField field = {44, UPB_SIZE(96, 152), 81, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
9006   upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
9007 }
google_protobuf_FileOptions_php_metadata_namespace(const google_protobuf_FileOptions * msg)9008 UPB_INLINE upb_StringView google_protobuf_FileOptions_php_metadata_namespace(const google_protobuf_FileOptions* msg) {
9009   upb_StringView default_val = upb_StringView_FromString("");
9010   upb_StringView ret;
9011   const upb_MiniTableField field = {44, UPB_SIZE(96, 152), 81, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
9012   _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field,
9013                                     &default_val, &ret);
9014   return ret;
9015 }
google_protobuf_FileOptions_has_php_metadata_namespace(const google_protobuf_FileOptions * msg)9016 UPB_INLINE bool google_protobuf_FileOptions_has_php_metadata_namespace(const google_protobuf_FileOptions* msg) {
9017   const upb_MiniTableField field = {44, UPB_SIZE(96, 152), 81, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
9018   return upb_Message_HasBaseField(UPB_UPCAST(msg), &field);
9019 }
google_protobuf_FileOptions_clear_ruby_package(google_protobuf_FileOptions * msg)9020 UPB_INLINE void google_protobuf_FileOptions_clear_ruby_package(google_protobuf_FileOptions* msg) {
9021   const upb_MiniTableField field = {45, UPB_SIZE(104, 168), 82, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
9022   upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
9023 }
google_protobuf_FileOptions_ruby_package(const google_protobuf_FileOptions * msg)9024 UPB_INLINE upb_StringView google_protobuf_FileOptions_ruby_package(const google_protobuf_FileOptions* msg) {
9025   upb_StringView default_val = upb_StringView_FromString("");
9026   upb_StringView ret;
9027   const upb_MiniTableField field = {45, UPB_SIZE(104, 168), 82, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
9028   _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field,
9029                                     &default_val, &ret);
9030   return ret;
9031 }
google_protobuf_FileOptions_has_ruby_package(const google_protobuf_FileOptions * msg)9032 UPB_INLINE bool google_protobuf_FileOptions_has_ruby_package(const google_protobuf_FileOptions* msg) {
9033   const upb_MiniTableField field = {45, UPB_SIZE(104, 168), 82, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
9034   return upb_Message_HasBaseField(UPB_UPCAST(msg), &field);
9035 }
google_protobuf_FileOptions_clear_features(google_protobuf_FileOptions * msg)9036 UPB_INLINE void google_protobuf_FileOptions_clear_features(google_protobuf_FileOptions* msg) {
9037   const upb_MiniTableField field = {50, UPB_SIZE(24, 184), 83, 0, 11, (int)kUpb_FieldMode_Scalar | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
9038   upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
9039 }
google_protobuf_FileOptions_features(const google_protobuf_FileOptions * msg)9040 UPB_INLINE const google_protobuf_FeatureSet* google_protobuf_FileOptions_features(const google_protobuf_FileOptions* msg) {
9041   const google_protobuf_FeatureSet* default_val = NULL;
9042   const google_protobuf_FeatureSet* ret;
9043   const upb_MiniTableField field = {50, UPB_SIZE(24, 184), 83, 0, 11, (int)kUpb_FieldMode_Scalar | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
9044   UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__FeatureSet_msg_init);
9045   _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field,
9046                                     &default_val, &ret);
9047   return ret;
9048 }
google_protobuf_FileOptions_has_features(const google_protobuf_FileOptions * msg)9049 UPB_INLINE bool google_protobuf_FileOptions_has_features(const google_protobuf_FileOptions* msg) {
9050   const upb_MiniTableField field = {50, UPB_SIZE(24, 184), 83, 0, 11, (int)kUpb_FieldMode_Scalar | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
9051   return upb_Message_HasBaseField(UPB_UPCAST(msg), &field);
9052 }
google_protobuf_FileOptions_clear_uninterpreted_option(google_protobuf_FileOptions * msg)9053 UPB_INLINE void google_protobuf_FileOptions_clear_uninterpreted_option(google_protobuf_FileOptions* msg) {
9054   const upb_MiniTableField field = {999, UPB_SIZE(28, 192), 0, 1, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
9055   upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
9056 }
google_protobuf_FileOptions_uninterpreted_option(const google_protobuf_FileOptions * msg,size_t * size)9057 UPB_INLINE const google_protobuf_UninterpretedOption* const* google_protobuf_FileOptions_uninterpreted_option(const google_protobuf_FileOptions* msg, size_t* size) {
9058   const upb_MiniTableField field = {999, UPB_SIZE(28, 192), 0, 1, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
9059   UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__UninterpretedOption_msg_init);
9060   const upb_Array* arr = upb_Message_GetArray(UPB_UPCAST(msg), &field);
9061   if (arr) {
9062     if (size) *size = arr->UPB_PRIVATE(size);
9063     return (const google_protobuf_UninterpretedOption* const*)upb_Array_DataPtr(arr);
9064   } else {
9065     if (size) *size = 0;
9066     return NULL;
9067   }
9068 }
_google_protobuf_FileOptions_uninterpreted_option_upb_array(const google_protobuf_FileOptions * msg,size_t * size)9069 UPB_INLINE const upb_Array* _google_protobuf_FileOptions_uninterpreted_option_upb_array(const google_protobuf_FileOptions* msg, size_t* size) {
9070   const upb_MiniTableField field = {999, UPB_SIZE(28, 192), 0, 1, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
9071   UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__UninterpretedOption_msg_init);
9072   const upb_Array* arr = upb_Message_GetArray(UPB_UPCAST(msg), &field);
9073   if (size) {
9074     *size = arr ? arr->UPB_PRIVATE(size) : 0;
9075   }
9076   return arr;
9077 }
_google_protobuf_FileOptions_uninterpreted_option_mutable_upb_array(google_protobuf_FileOptions * msg,size_t * size,upb_Arena * arena)9078 UPB_INLINE upb_Array* _google_protobuf_FileOptions_uninterpreted_option_mutable_upb_array(google_protobuf_FileOptions* msg, size_t* size, upb_Arena* arena) {
9079   const upb_MiniTableField field = {999, UPB_SIZE(28, 192), 0, 1, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
9080   UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__UninterpretedOption_msg_init);
9081   upb_Array* arr = upb_Message_GetOrCreateMutableArray(UPB_UPCAST(msg),
9082                                                        &field, arena);
9083   if (size) {
9084     *size = arr ? arr->UPB_PRIVATE(size) : 0;
9085   }
9086   return arr;
9087 }
9088 
google_protobuf_FileOptions_set_java_package(google_protobuf_FileOptions * msg,upb_StringView value)9089 UPB_INLINE void google_protobuf_FileOptions_set_java_package(google_protobuf_FileOptions *msg, upb_StringView value) {
9090   const upb_MiniTableField field = {1, UPB_SIZE(32, 24), 64, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
9091   upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
9092 }
google_protobuf_FileOptions_set_java_outer_classname(google_protobuf_FileOptions * msg,upb_StringView value)9093 UPB_INLINE void google_protobuf_FileOptions_set_java_outer_classname(google_protobuf_FileOptions *msg, upb_StringView value) {
9094   const upb_MiniTableField field = {8, 40, 65, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
9095   upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
9096 }
google_protobuf_FileOptions_set_optimize_for(google_protobuf_FileOptions * msg,int32_t value)9097 UPB_INLINE void google_protobuf_FileOptions_set_optimize_for(google_protobuf_FileOptions *msg, int32_t value) {
9098   const upb_MiniTableField field = {9, 12, 66, 2, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
9099   upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
9100 }
google_protobuf_FileOptions_set_java_multiple_files(google_protobuf_FileOptions * msg,bool value)9101 UPB_INLINE void google_protobuf_FileOptions_set_java_multiple_files(google_protobuf_FileOptions *msg, bool value) {
9102   const upb_MiniTableField field = {10, 16, 67, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
9103   upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
9104 }
google_protobuf_FileOptions_set_go_package(google_protobuf_FileOptions * msg,upb_StringView value)9105 UPB_INLINE void google_protobuf_FileOptions_set_go_package(google_protobuf_FileOptions *msg, upb_StringView value) {
9106   const upb_MiniTableField field = {11, UPB_SIZE(48, 56), 68, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
9107   upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
9108 }
google_protobuf_FileOptions_set_cc_generic_services(google_protobuf_FileOptions * msg,bool value)9109 UPB_INLINE void google_protobuf_FileOptions_set_cc_generic_services(google_protobuf_FileOptions *msg, bool value) {
9110   const upb_MiniTableField field = {16, 17, 69, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
9111   upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
9112 }
google_protobuf_FileOptions_set_java_generic_services(google_protobuf_FileOptions * msg,bool value)9113 UPB_INLINE void google_protobuf_FileOptions_set_java_generic_services(google_protobuf_FileOptions *msg, bool value) {
9114   const upb_MiniTableField field = {17, 18, 70, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
9115   upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
9116 }
google_protobuf_FileOptions_set_py_generic_services(google_protobuf_FileOptions * msg,bool value)9117 UPB_INLINE void google_protobuf_FileOptions_set_py_generic_services(google_protobuf_FileOptions *msg, bool value) {
9118   const upb_MiniTableField field = {18, 19, 71, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
9119   upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
9120 }
google_protobuf_FileOptions_set_java_generate_equals_and_hash(google_protobuf_FileOptions * msg,bool value)9121 UPB_INLINE void google_protobuf_FileOptions_set_java_generate_equals_and_hash(google_protobuf_FileOptions *msg, bool value) {
9122   const upb_MiniTableField field = {20, 20, 72, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
9123   upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
9124 }
google_protobuf_FileOptions_set_deprecated(google_protobuf_FileOptions * msg,bool value)9125 UPB_INLINE void google_protobuf_FileOptions_set_deprecated(google_protobuf_FileOptions *msg, bool value) {
9126   const upb_MiniTableField field = {23, 21, 73, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
9127   upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
9128 }
google_protobuf_FileOptions_set_java_string_check_utf8(google_protobuf_FileOptions * msg,bool value)9129 UPB_INLINE void google_protobuf_FileOptions_set_java_string_check_utf8(google_protobuf_FileOptions *msg, bool value) {
9130   const upb_MiniTableField field = {27, 22, 74, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
9131   upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
9132 }
google_protobuf_FileOptions_set_cc_enable_arenas(google_protobuf_FileOptions * msg,bool value)9133 UPB_INLINE void google_protobuf_FileOptions_set_cc_enable_arenas(google_protobuf_FileOptions *msg, bool value) {
9134   const upb_MiniTableField field = {31, 23, 75, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
9135   upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
9136 }
google_protobuf_FileOptions_set_objc_class_prefix(google_protobuf_FileOptions * msg,upb_StringView value)9137 UPB_INLINE void google_protobuf_FileOptions_set_objc_class_prefix(google_protobuf_FileOptions *msg, upb_StringView value) {
9138   const upb_MiniTableField field = {36, UPB_SIZE(56, 72), 76, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
9139   upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
9140 }
google_protobuf_FileOptions_set_csharp_namespace(google_protobuf_FileOptions * msg,upb_StringView value)9141 UPB_INLINE void google_protobuf_FileOptions_set_csharp_namespace(google_protobuf_FileOptions *msg, upb_StringView value) {
9142   const upb_MiniTableField field = {37, UPB_SIZE(64, 88), 77, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
9143   upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
9144 }
google_protobuf_FileOptions_set_swift_prefix(google_protobuf_FileOptions * msg,upb_StringView value)9145 UPB_INLINE void google_protobuf_FileOptions_set_swift_prefix(google_protobuf_FileOptions *msg, upb_StringView value) {
9146   const upb_MiniTableField field = {39, UPB_SIZE(72, 104), 78, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
9147   upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
9148 }
google_protobuf_FileOptions_set_php_class_prefix(google_protobuf_FileOptions * msg,upb_StringView value)9149 UPB_INLINE void google_protobuf_FileOptions_set_php_class_prefix(google_protobuf_FileOptions *msg, upb_StringView value) {
9150   const upb_MiniTableField field = {40, UPB_SIZE(80, 120), 79, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
9151   upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
9152 }
google_protobuf_FileOptions_set_php_namespace(google_protobuf_FileOptions * msg,upb_StringView value)9153 UPB_INLINE void google_protobuf_FileOptions_set_php_namespace(google_protobuf_FileOptions *msg, upb_StringView value) {
9154   const upb_MiniTableField field = {41, UPB_SIZE(88, 136), 80, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
9155   upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
9156 }
google_protobuf_FileOptions_set_php_metadata_namespace(google_protobuf_FileOptions * msg,upb_StringView value)9157 UPB_INLINE void google_protobuf_FileOptions_set_php_metadata_namespace(google_protobuf_FileOptions *msg, upb_StringView value) {
9158   const upb_MiniTableField field = {44, UPB_SIZE(96, 152), 81, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
9159   upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
9160 }
google_protobuf_FileOptions_set_ruby_package(google_protobuf_FileOptions * msg,upb_StringView value)9161 UPB_INLINE void google_protobuf_FileOptions_set_ruby_package(google_protobuf_FileOptions *msg, upb_StringView value) {
9162   const upb_MiniTableField field = {45, UPB_SIZE(104, 168), 82, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
9163   upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
9164 }
google_protobuf_FileOptions_set_features(google_protobuf_FileOptions * msg,google_protobuf_FeatureSet * value)9165 UPB_INLINE void google_protobuf_FileOptions_set_features(google_protobuf_FileOptions *msg, google_protobuf_FeatureSet* value) {
9166   const upb_MiniTableField field = {50, UPB_SIZE(24, 184), 83, 0, 11, (int)kUpb_FieldMode_Scalar | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
9167   UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__FeatureSet_msg_init);
9168   upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
9169 }
google_protobuf_FileOptions_mutable_features(google_protobuf_FileOptions * msg,upb_Arena * arena)9170 UPB_INLINE struct google_protobuf_FeatureSet* google_protobuf_FileOptions_mutable_features(google_protobuf_FileOptions* msg, upb_Arena* arena) {
9171   struct google_protobuf_FeatureSet* sub = (struct google_protobuf_FeatureSet*)google_protobuf_FileOptions_features(msg);
9172   if (sub == NULL) {
9173     sub = (struct google_protobuf_FeatureSet*)_upb_Message_New(&google__protobuf__FeatureSet_msg_init, arena);
9174     if (sub) google_protobuf_FileOptions_set_features(msg, sub);
9175   }
9176   return sub;
9177 }
google_protobuf_FileOptions_mutable_uninterpreted_option(google_protobuf_FileOptions * msg,size_t * size)9178 UPB_INLINE google_protobuf_UninterpretedOption** google_protobuf_FileOptions_mutable_uninterpreted_option(google_protobuf_FileOptions* msg, size_t* size) {
9179   upb_MiniTableField field = {999, UPB_SIZE(28, 192), 0, 1, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
9180   UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__UninterpretedOption_msg_init);
9181   upb_Array* arr = upb_Message_GetMutableArray(UPB_UPCAST(msg), &field);
9182   if (arr) {
9183     if (size) *size = arr->UPB_PRIVATE(size);
9184     return (google_protobuf_UninterpretedOption**)upb_Array_MutableDataPtr(arr);
9185   } else {
9186     if (size) *size = 0;
9187     return NULL;
9188   }
9189 }
google_protobuf_FileOptions_resize_uninterpreted_option(google_protobuf_FileOptions * msg,size_t size,upb_Arena * arena)9190 UPB_INLINE google_protobuf_UninterpretedOption** google_protobuf_FileOptions_resize_uninterpreted_option(google_protobuf_FileOptions* msg, size_t size, upb_Arena* arena) {
9191   upb_MiniTableField field = {999, UPB_SIZE(28, 192), 0, 1, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
9192   return (google_protobuf_UninterpretedOption**)upb_Message_ResizeArrayUninitialized(UPB_UPCAST(msg),
9193                                                    &field, size, arena);
9194 }
google_protobuf_FileOptions_add_uninterpreted_option(google_protobuf_FileOptions * msg,upb_Arena * arena)9195 UPB_INLINE struct google_protobuf_UninterpretedOption* google_protobuf_FileOptions_add_uninterpreted_option(google_protobuf_FileOptions* msg, upb_Arena* arena) {
9196   upb_MiniTableField field = {999, UPB_SIZE(28, 192), 0, 1, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
9197   UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__UninterpretedOption_msg_init);
9198   upb_Array* arr = upb_Message_GetOrCreateMutableArray(
9199       UPB_UPCAST(msg), &field, arena);
9200   if (!arr || !UPB_PRIVATE(_upb_Array_ResizeUninitialized)(
9201                   arr, arr->UPB_PRIVATE(size) + 1, arena)) {
9202     return NULL;
9203   }
9204   struct google_protobuf_UninterpretedOption* sub = (struct google_protobuf_UninterpretedOption*)_upb_Message_New(&google__protobuf__UninterpretedOption_msg_init, arena);
9205   if (!arr || !sub) return NULL;
9206   UPB_PRIVATE(_upb_Array_Set)
9207   (arr, arr->UPB_PRIVATE(size) - 1, &sub, sizeof(sub));
9208   return sub;
9209 }
9210 
9211 /* google.protobuf.MessageOptions */
9212 
google_protobuf_MessageOptions_new(upb_Arena * arena)9213 UPB_INLINE google_protobuf_MessageOptions* google_protobuf_MessageOptions_new(upb_Arena* arena) {
9214   return (google_protobuf_MessageOptions*)_upb_Message_New(&google__protobuf__MessageOptions_msg_init, arena);
9215 }
google_protobuf_MessageOptions_parse(const char * buf,size_t size,upb_Arena * arena)9216 UPB_INLINE google_protobuf_MessageOptions* google_protobuf_MessageOptions_parse(const char* buf, size_t size, upb_Arena* arena) {
9217   google_protobuf_MessageOptions* ret = google_protobuf_MessageOptions_new(arena);
9218   if (!ret) return NULL;
9219   if (upb_Decode(buf, size, UPB_UPCAST(ret), &google__protobuf__MessageOptions_msg_init, NULL, 0, arena) !=
9220       kUpb_DecodeStatus_Ok) {
9221     return NULL;
9222   }
9223   return ret;
9224 }
google_protobuf_MessageOptions_parse_ex(const char * buf,size_t size,const upb_ExtensionRegistry * extreg,int options,upb_Arena * arena)9225 UPB_INLINE google_protobuf_MessageOptions* google_protobuf_MessageOptions_parse_ex(const char* buf, size_t size,
9226                            const upb_ExtensionRegistry* extreg,
9227                            int options, upb_Arena* arena) {
9228   google_protobuf_MessageOptions* ret = google_protobuf_MessageOptions_new(arena);
9229   if (!ret) return NULL;
9230   if (upb_Decode(buf, size, UPB_UPCAST(ret), &google__protobuf__MessageOptions_msg_init, extreg, options,
9231                  arena) != kUpb_DecodeStatus_Ok) {
9232     return NULL;
9233   }
9234   return ret;
9235 }
google_protobuf_MessageOptions_serialize(const google_protobuf_MessageOptions * msg,upb_Arena * arena,size_t * len)9236 UPB_INLINE char* google_protobuf_MessageOptions_serialize(const google_protobuf_MessageOptions* msg, upb_Arena* arena, size_t* len) {
9237   char* ptr;
9238   (void)upb_Encode(UPB_UPCAST(msg), &google__protobuf__MessageOptions_msg_init, 0, arena, &ptr, len);
9239   return ptr;
9240 }
google_protobuf_MessageOptions_serialize_ex(const google_protobuf_MessageOptions * msg,int options,upb_Arena * arena,size_t * len)9241 UPB_INLINE char* google_protobuf_MessageOptions_serialize_ex(const google_protobuf_MessageOptions* msg, int options,
9242                                  upb_Arena* arena, size_t* len) {
9243   char* ptr;
9244   (void)upb_Encode(UPB_UPCAST(msg), &google__protobuf__MessageOptions_msg_init, options, arena, &ptr, len);
9245   return ptr;
9246 }
google_protobuf_MessageOptions_clear_message_set_wire_format(google_protobuf_MessageOptions * msg)9247 UPB_INLINE void google_protobuf_MessageOptions_clear_message_set_wire_format(google_protobuf_MessageOptions* msg) {
9248   const upb_MiniTableField field = {1, 9, 64, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
9249   upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
9250 }
google_protobuf_MessageOptions_message_set_wire_format(const google_protobuf_MessageOptions * msg)9251 UPB_INLINE bool google_protobuf_MessageOptions_message_set_wire_format(const google_protobuf_MessageOptions* msg) {
9252   bool default_val = false;
9253   bool ret;
9254   const upb_MiniTableField field = {1, 9, 64, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
9255   _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field,
9256                                     &default_val, &ret);
9257   return ret;
9258 }
google_protobuf_MessageOptions_has_message_set_wire_format(const google_protobuf_MessageOptions * msg)9259 UPB_INLINE bool google_protobuf_MessageOptions_has_message_set_wire_format(const google_protobuf_MessageOptions* msg) {
9260   const upb_MiniTableField field = {1, 9, 64, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
9261   return upb_Message_HasBaseField(UPB_UPCAST(msg), &field);
9262 }
google_protobuf_MessageOptions_clear_no_standard_descriptor_accessor(google_protobuf_MessageOptions * msg)9263 UPB_INLINE void google_protobuf_MessageOptions_clear_no_standard_descriptor_accessor(google_protobuf_MessageOptions* msg) {
9264   const upb_MiniTableField field = {2, 10, 65, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
9265   upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
9266 }
google_protobuf_MessageOptions_no_standard_descriptor_accessor(const google_protobuf_MessageOptions * msg)9267 UPB_INLINE bool google_protobuf_MessageOptions_no_standard_descriptor_accessor(const google_protobuf_MessageOptions* msg) {
9268   bool default_val = false;
9269   bool ret;
9270   const upb_MiniTableField field = {2, 10, 65, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
9271   _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field,
9272                                     &default_val, &ret);
9273   return ret;
9274 }
google_protobuf_MessageOptions_has_no_standard_descriptor_accessor(const google_protobuf_MessageOptions * msg)9275 UPB_INLINE bool google_protobuf_MessageOptions_has_no_standard_descriptor_accessor(const google_protobuf_MessageOptions* msg) {
9276   const upb_MiniTableField field = {2, 10, 65, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
9277   return upb_Message_HasBaseField(UPB_UPCAST(msg), &field);
9278 }
google_protobuf_MessageOptions_clear_deprecated(google_protobuf_MessageOptions * msg)9279 UPB_INLINE void google_protobuf_MessageOptions_clear_deprecated(google_protobuf_MessageOptions* msg) {
9280   const upb_MiniTableField field = {3, 11, 66, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
9281   upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
9282 }
google_protobuf_MessageOptions_deprecated(const google_protobuf_MessageOptions * msg)9283 UPB_INLINE bool google_protobuf_MessageOptions_deprecated(const google_protobuf_MessageOptions* msg) {
9284   bool default_val = false;
9285   bool ret;
9286   const upb_MiniTableField field = {3, 11, 66, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
9287   _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field,
9288                                     &default_val, &ret);
9289   return ret;
9290 }
google_protobuf_MessageOptions_has_deprecated(const google_protobuf_MessageOptions * msg)9291 UPB_INLINE bool google_protobuf_MessageOptions_has_deprecated(const google_protobuf_MessageOptions* msg) {
9292   const upb_MiniTableField field = {3, 11, 66, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
9293   return upb_Message_HasBaseField(UPB_UPCAST(msg), &field);
9294 }
google_protobuf_MessageOptions_clear_map_entry(google_protobuf_MessageOptions * msg)9295 UPB_INLINE void google_protobuf_MessageOptions_clear_map_entry(google_protobuf_MessageOptions* msg) {
9296   const upb_MiniTableField field = {7, 12, 67, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
9297   upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
9298 }
google_protobuf_MessageOptions_map_entry(const google_protobuf_MessageOptions * msg)9299 UPB_INLINE bool google_protobuf_MessageOptions_map_entry(const google_protobuf_MessageOptions* msg) {
9300   bool default_val = false;
9301   bool ret;
9302   const upb_MiniTableField field = {7, 12, 67, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
9303   _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field,
9304                                     &default_val, &ret);
9305   return ret;
9306 }
google_protobuf_MessageOptions_has_map_entry(const google_protobuf_MessageOptions * msg)9307 UPB_INLINE bool google_protobuf_MessageOptions_has_map_entry(const google_protobuf_MessageOptions* msg) {
9308   const upb_MiniTableField field = {7, 12, 67, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
9309   return upb_Message_HasBaseField(UPB_UPCAST(msg), &field);
9310 }
google_protobuf_MessageOptions_clear_deprecated_legacy_json_field_conflicts(google_protobuf_MessageOptions * msg)9311 UPB_INLINE void google_protobuf_MessageOptions_clear_deprecated_legacy_json_field_conflicts(google_protobuf_MessageOptions* msg) {
9312   const upb_MiniTableField field = {11, 13, 68, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
9313   upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
9314 }
google_protobuf_MessageOptions_deprecated_legacy_json_field_conflicts(const google_protobuf_MessageOptions * msg)9315 UPB_INLINE bool google_protobuf_MessageOptions_deprecated_legacy_json_field_conflicts(const google_protobuf_MessageOptions* msg) {
9316   bool default_val = false;
9317   bool ret;
9318   const upb_MiniTableField field = {11, 13, 68, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
9319   _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field,
9320                                     &default_val, &ret);
9321   return ret;
9322 }
google_protobuf_MessageOptions_has_deprecated_legacy_json_field_conflicts(const google_protobuf_MessageOptions * msg)9323 UPB_INLINE bool google_protobuf_MessageOptions_has_deprecated_legacy_json_field_conflicts(const google_protobuf_MessageOptions* msg) {
9324   const upb_MiniTableField field = {11, 13, 68, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
9325   return upb_Message_HasBaseField(UPB_UPCAST(msg), &field);
9326 }
google_protobuf_MessageOptions_clear_features(google_protobuf_MessageOptions * msg)9327 UPB_INLINE void google_protobuf_MessageOptions_clear_features(google_protobuf_MessageOptions* msg) {
9328   const upb_MiniTableField field = {12, 16, 69, 0, 11, (int)kUpb_FieldMode_Scalar | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
9329   upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
9330 }
google_protobuf_MessageOptions_features(const google_protobuf_MessageOptions * msg)9331 UPB_INLINE const google_protobuf_FeatureSet* google_protobuf_MessageOptions_features(const google_protobuf_MessageOptions* msg) {
9332   const google_protobuf_FeatureSet* default_val = NULL;
9333   const google_protobuf_FeatureSet* ret;
9334   const upb_MiniTableField field = {12, 16, 69, 0, 11, (int)kUpb_FieldMode_Scalar | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
9335   UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__FeatureSet_msg_init);
9336   _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field,
9337                                     &default_val, &ret);
9338   return ret;
9339 }
google_protobuf_MessageOptions_has_features(const google_protobuf_MessageOptions * msg)9340 UPB_INLINE bool google_protobuf_MessageOptions_has_features(const google_protobuf_MessageOptions* msg) {
9341   const upb_MiniTableField field = {12, 16, 69, 0, 11, (int)kUpb_FieldMode_Scalar | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
9342   return upb_Message_HasBaseField(UPB_UPCAST(msg), &field);
9343 }
google_protobuf_MessageOptions_clear_uninterpreted_option(google_protobuf_MessageOptions * msg)9344 UPB_INLINE void google_protobuf_MessageOptions_clear_uninterpreted_option(google_protobuf_MessageOptions* msg) {
9345   const upb_MiniTableField field = {999, UPB_SIZE(20, 24), 0, 1, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
9346   upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
9347 }
google_protobuf_MessageOptions_uninterpreted_option(const google_protobuf_MessageOptions * msg,size_t * size)9348 UPB_INLINE const google_protobuf_UninterpretedOption* const* google_protobuf_MessageOptions_uninterpreted_option(const google_protobuf_MessageOptions* msg, size_t* size) {
9349   const upb_MiniTableField field = {999, UPB_SIZE(20, 24), 0, 1, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
9350   UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__UninterpretedOption_msg_init);
9351   const upb_Array* arr = upb_Message_GetArray(UPB_UPCAST(msg), &field);
9352   if (arr) {
9353     if (size) *size = arr->UPB_PRIVATE(size);
9354     return (const google_protobuf_UninterpretedOption* const*)upb_Array_DataPtr(arr);
9355   } else {
9356     if (size) *size = 0;
9357     return NULL;
9358   }
9359 }
_google_protobuf_MessageOptions_uninterpreted_option_upb_array(const google_protobuf_MessageOptions * msg,size_t * size)9360 UPB_INLINE const upb_Array* _google_protobuf_MessageOptions_uninterpreted_option_upb_array(const google_protobuf_MessageOptions* msg, size_t* size) {
9361   const upb_MiniTableField field = {999, UPB_SIZE(20, 24), 0, 1, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
9362   UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__UninterpretedOption_msg_init);
9363   const upb_Array* arr = upb_Message_GetArray(UPB_UPCAST(msg), &field);
9364   if (size) {
9365     *size = arr ? arr->UPB_PRIVATE(size) : 0;
9366   }
9367   return arr;
9368 }
_google_protobuf_MessageOptions_uninterpreted_option_mutable_upb_array(google_protobuf_MessageOptions * msg,size_t * size,upb_Arena * arena)9369 UPB_INLINE upb_Array* _google_protobuf_MessageOptions_uninterpreted_option_mutable_upb_array(google_protobuf_MessageOptions* msg, size_t* size, upb_Arena* arena) {
9370   const upb_MiniTableField field = {999, UPB_SIZE(20, 24), 0, 1, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
9371   UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__UninterpretedOption_msg_init);
9372   upb_Array* arr = upb_Message_GetOrCreateMutableArray(UPB_UPCAST(msg),
9373                                                        &field, arena);
9374   if (size) {
9375     *size = arr ? arr->UPB_PRIVATE(size) : 0;
9376   }
9377   return arr;
9378 }
9379 
google_protobuf_MessageOptions_set_message_set_wire_format(google_protobuf_MessageOptions * msg,bool value)9380 UPB_INLINE void google_protobuf_MessageOptions_set_message_set_wire_format(google_protobuf_MessageOptions *msg, bool value) {
9381   const upb_MiniTableField field = {1, 9, 64, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
9382   upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
9383 }
google_protobuf_MessageOptions_set_no_standard_descriptor_accessor(google_protobuf_MessageOptions * msg,bool value)9384 UPB_INLINE void google_protobuf_MessageOptions_set_no_standard_descriptor_accessor(google_protobuf_MessageOptions *msg, bool value) {
9385   const upb_MiniTableField field = {2, 10, 65, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
9386   upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
9387 }
google_protobuf_MessageOptions_set_deprecated(google_protobuf_MessageOptions * msg,bool value)9388 UPB_INLINE void google_protobuf_MessageOptions_set_deprecated(google_protobuf_MessageOptions *msg, bool value) {
9389   const upb_MiniTableField field = {3, 11, 66, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
9390   upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
9391 }
google_protobuf_MessageOptions_set_map_entry(google_protobuf_MessageOptions * msg,bool value)9392 UPB_INLINE void google_protobuf_MessageOptions_set_map_entry(google_protobuf_MessageOptions *msg, bool value) {
9393   const upb_MiniTableField field = {7, 12, 67, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
9394   upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
9395 }
google_protobuf_MessageOptions_set_deprecated_legacy_json_field_conflicts(google_protobuf_MessageOptions * msg,bool value)9396 UPB_INLINE void google_protobuf_MessageOptions_set_deprecated_legacy_json_field_conflicts(google_protobuf_MessageOptions *msg, bool value) {
9397   const upb_MiniTableField field = {11, 13, 68, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
9398   upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
9399 }
google_protobuf_MessageOptions_set_features(google_protobuf_MessageOptions * msg,google_protobuf_FeatureSet * value)9400 UPB_INLINE void google_protobuf_MessageOptions_set_features(google_protobuf_MessageOptions *msg, google_protobuf_FeatureSet* value) {
9401   const upb_MiniTableField field = {12, 16, 69, 0, 11, (int)kUpb_FieldMode_Scalar | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
9402   UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__FeatureSet_msg_init);
9403   upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
9404 }
google_protobuf_MessageOptions_mutable_features(google_protobuf_MessageOptions * msg,upb_Arena * arena)9405 UPB_INLINE struct google_protobuf_FeatureSet* google_protobuf_MessageOptions_mutable_features(google_protobuf_MessageOptions* msg, upb_Arena* arena) {
9406   struct google_protobuf_FeatureSet* sub = (struct google_protobuf_FeatureSet*)google_protobuf_MessageOptions_features(msg);
9407   if (sub == NULL) {
9408     sub = (struct google_protobuf_FeatureSet*)_upb_Message_New(&google__protobuf__FeatureSet_msg_init, arena);
9409     if (sub) google_protobuf_MessageOptions_set_features(msg, sub);
9410   }
9411   return sub;
9412 }
google_protobuf_MessageOptions_mutable_uninterpreted_option(google_protobuf_MessageOptions * msg,size_t * size)9413 UPB_INLINE google_protobuf_UninterpretedOption** google_protobuf_MessageOptions_mutable_uninterpreted_option(google_protobuf_MessageOptions* msg, size_t* size) {
9414   upb_MiniTableField field = {999, UPB_SIZE(20, 24), 0, 1, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
9415   UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__UninterpretedOption_msg_init);
9416   upb_Array* arr = upb_Message_GetMutableArray(UPB_UPCAST(msg), &field);
9417   if (arr) {
9418     if (size) *size = arr->UPB_PRIVATE(size);
9419     return (google_protobuf_UninterpretedOption**)upb_Array_MutableDataPtr(arr);
9420   } else {
9421     if (size) *size = 0;
9422     return NULL;
9423   }
9424 }
google_protobuf_MessageOptions_resize_uninterpreted_option(google_protobuf_MessageOptions * msg,size_t size,upb_Arena * arena)9425 UPB_INLINE google_protobuf_UninterpretedOption** google_protobuf_MessageOptions_resize_uninterpreted_option(google_protobuf_MessageOptions* msg, size_t size, upb_Arena* arena) {
9426   upb_MiniTableField field = {999, UPB_SIZE(20, 24), 0, 1, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
9427   return (google_protobuf_UninterpretedOption**)upb_Message_ResizeArrayUninitialized(UPB_UPCAST(msg),
9428                                                    &field, size, arena);
9429 }
google_protobuf_MessageOptions_add_uninterpreted_option(google_protobuf_MessageOptions * msg,upb_Arena * arena)9430 UPB_INLINE struct google_protobuf_UninterpretedOption* google_protobuf_MessageOptions_add_uninterpreted_option(google_protobuf_MessageOptions* msg, upb_Arena* arena) {
9431   upb_MiniTableField field = {999, UPB_SIZE(20, 24), 0, 1, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
9432   UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__UninterpretedOption_msg_init);
9433   upb_Array* arr = upb_Message_GetOrCreateMutableArray(
9434       UPB_UPCAST(msg), &field, arena);
9435   if (!arr || !UPB_PRIVATE(_upb_Array_ResizeUninitialized)(
9436                   arr, arr->UPB_PRIVATE(size) + 1, arena)) {
9437     return NULL;
9438   }
9439   struct google_protobuf_UninterpretedOption* sub = (struct google_protobuf_UninterpretedOption*)_upb_Message_New(&google__protobuf__UninterpretedOption_msg_init, arena);
9440   if (!arr || !sub) return NULL;
9441   UPB_PRIVATE(_upb_Array_Set)
9442   (arr, arr->UPB_PRIVATE(size) - 1, &sub, sizeof(sub));
9443   return sub;
9444 }
9445 
9446 /* google.protobuf.FieldOptions */
9447 
google_protobuf_FieldOptions_new(upb_Arena * arena)9448 UPB_INLINE google_protobuf_FieldOptions* google_protobuf_FieldOptions_new(upb_Arena* arena) {
9449   return (google_protobuf_FieldOptions*)_upb_Message_New(&google__protobuf__FieldOptions_msg_init, arena);
9450 }
google_protobuf_FieldOptions_parse(const char * buf,size_t size,upb_Arena * arena)9451 UPB_INLINE google_protobuf_FieldOptions* google_protobuf_FieldOptions_parse(const char* buf, size_t size, upb_Arena* arena) {
9452   google_protobuf_FieldOptions* ret = google_protobuf_FieldOptions_new(arena);
9453   if (!ret) return NULL;
9454   if (upb_Decode(buf, size, UPB_UPCAST(ret), &google__protobuf__FieldOptions_msg_init, NULL, 0, arena) !=
9455       kUpb_DecodeStatus_Ok) {
9456     return NULL;
9457   }
9458   return ret;
9459 }
google_protobuf_FieldOptions_parse_ex(const char * buf,size_t size,const upb_ExtensionRegistry * extreg,int options,upb_Arena * arena)9460 UPB_INLINE google_protobuf_FieldOptions* google_protobuf_FieldOptions_parse_ex(const char* buf, size_t size,
9461                            const upb_ExtensionRegistry* extreg,
9462                            int options, upb_Arena* arena) {
9463   google_protobuf_FieldOptions* ret = google_protobuf_FieldOptions_new(arena);
9464   if (!ret) return NULL;
9465   if (upb_Decode(buf, size, UPB_UPCAST(ret), &google__protobuf__FieldOptions_msg_init, extreg, options,
9466                  arena) != kUpb_DecodeStatus_Ok) {
9467     return NULL;
9468   }
9469   return ret;
9470 }
google_protobuf_FieldOptions_serialize(const google_protobuf_FieldOptions * msg,upb_Arena * arena,size_t * len)9471 UPB_INLINE char* google_protobuf_FieldOptions_serialize(const google_protobuf_FieldOptions* msg, upb_Arena* arena, size_t* len) {
9472   char* ptr;
9473   (void)upb_Encode(UPB_UPCAST(msg), &google__protobuf__FieldOptions_msg_init, 0, arena, &ptr, len);
9474   return ptr;
9475 }
google_protobuf_FieldOptions_serialize_ex(const google_protobuf_FieldOptions * msg,int options,upb_Arena * arena,size_t * len)9476 UPB_INLINE char* google_protobuf_FieldOptions_serialize_ex(const google_protobuf_FieldOptions* msg, int options,
9477                                  upb_Arena* arena, size_t* len) {
9478   char* ptr;
9479   (void)upb_Encode(UPB_UPCAST(msg), &google__protobuf__FieldOptions_msg_init, options, arena, &ptr, len);
9480   return ptr;
9481 }
google_protobuf_FieldOptions_clear_ctype(google_protobuf_FieldOptions * msg)9482 UPB_INLINE void google_protobuf_FieldOptions_clear_ctype(google_protobuf_FieldOptions* msg) {
9483   const upb_MiniTableField field = {1, 12, 64, 4, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
9484   upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
9485 }
google_protobuf_FieldOptions_ctype(const google_protobuf_FieldOptions * msg)9486 UPB_INLINE int32_t google_protobuf_FieldOptions_ctype(const google_protobuf_FieldOptions* msg) {
9487   int32_t default_val = 0;
9488   int32_t ret;
9489   const upb_MiniTableField field = {1, 12, 64, 4, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
9490   _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field,
9491                                     &default_val, &ret);
9492   return ret;
9493 }
google_protobuf_FieldOptions_has_ctype(const google_protobuf_FieldOptions * msg)9494 UPB_INLINE bool google_protobuf_FieldOptions_has_ctype(const google_protobuf_FieldOptions* msg) {
9495   const upb_MiniTableField field = {1, 12, 64, 4, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
9496   return upb_Message_HasBaseField(UPB_UPCAST(msg), &field);
9497 }
google_protobuf_FieldOptions_clear_packed(google_protobuf_FieldOptions * msg)9498 UPB_INLINE void google_protobuf_FieldOptions_clear_packed(google_protobuf_FieldOptions* msg) {
9499   const upb_MiniTableField field = {2, 16, 65, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
9500   upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
9501 }
google_protobuf_FieldOptions_packed(const google_protobuf_FieldOptions * msg)9502 UPB_INLINE bool google_protobuf_FieldOptions_packed(const google_protobuf_FieldOptions* msg) {
9503   bool default_val = false;
9504   bool ret;
9505   const upb_MiniTableField field = {2, 16, 65, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
9506   _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field,
9507                                     &default_val, &ret);
9508   return ret;
9509 }
google_protobuf_FieldOptions_has_packed(const google_protobuf_FieldOptions * msg)9510 UPB_INLINE bool google_protobuf_FieldOptions_has_packed(const google_protobuf_FieldOptions* msg) {
9511   const upb_MiniTableField field = {2, 16, 65, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
9512   return upb_Message_HasBaseField(UPB_UPCAST(msg), &field);
9513 }
google_protobuf_FieldOptions_clear_deprecated(google_protobuf_FieldOptions * msg)9514 UPB_INLINE void google_protobuf_FieldOptions_clear_deprecated(google_protobuf_FieldOptions* msg) {
9515   const upb_MiniTableField field = {3, 17, 66, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
9516   upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
9517 }
google_protobuf_FieldOptions_deprecated(const google_protobuf_FieldOptions * msg)9518 UPB_INLINE bool google_protobuf_FieldOptions_deprecated(const google_protobuf_FieldOptions* msg) {
9519   bool default_val = false;
9520   bool ret;
9521   const upb_MiniTableField field = {3, 17, 66, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
9522   _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field,
9523                                     &default_val, &ret);
9524   return ret;
9525 }
google_protobuf_FieldOptions_has_deprecated(const google_protobuf_FieldOptions * msg)9526 UPB_INLINE bool google_protobuf_FieldOptions_has_deprecated(const google_protobuf_FieldOptions* msg) {
9527   const upb_MiniTableField field = {3, 17, 66, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
9528   return upb_Message_HasBaseField(UPB_UPCAST(msg), &field);
9529 }
google_protobuf_FieldOptions_clear_lazy(google_protobuf_FieldOptions * msg)9530 UPB_INLINE void google_protobuf_FieldOptions_clear_lazy(google_protobuf_FieldOptions* msg) {
9531   const upb_MiniTableField field = {5, 18, 67, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
9532   upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
9533 }
google_protobuf_FieldOptions_lazy(const google_protobuf_FieldOptions * msg)9534 UPB_INLINE bool google_protobuf_FieldOptions_lazy(const google_protobuf_FieldOptions* msg) {
9535   bool default_val = false;
9536   bool ret;
9537   const upb_MiniTableField field = {5, 18, 67, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
9538   _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field,
9539                                     &default_val, &ret);
9540   return ret;
9541 }
google_protobuf_FieldOptions_has_lazy(const google_protobuf_FieldOptions * msg)9542 UPB_INLINE bool google_protobuf_FieldOptions_has_lazy(const google_protobuf_FieldOptions* msg) {
9543   const upb_MiniTableField field = {5, 18, 67, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
9544   return upb_Message_HasBaseField(UPB_UPCAST(msg), &field);
9545 }
google_protobuf_FieldOptions_clear_jstype(google_protobuf_FieldOptions * msg)9546 UPB_INLINE void google_protobuf_FieldOptions_clear_jstype(google_protobuf_FieldOptions* msg) {
9547   const upb_MiniTableField field = {6, 20, 68, 5, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
9548   upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
9549 }
google_protobuf_FieldOptions_jstype(const google_protobuf_FieldOptions * msg)9550 UPB_INLINE int32_t google_protobuf_FieldOptions_jstype(const google_protobuf_FieldOptions* msg) {
9551   int32_t default_val = 0;
9552   int32_t ret;
9553   const upb_MiniTableField field = {6, 20, 68, 5, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
9554   _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field,
9555                                     &default_val, &ret);
9556   return ret;
9557 }
google_protobuf_FieldOptions_has_jstype(const google_protobuf_FieldOptions * msg)9558 UPB_INLINE bool google_protobuf_FieldOptions_has_jstype(const google_protobuf_FieldOptions* msg) {
9559   const upb_MiniTableField field = {6, 20, 68, 5, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
9560   return upb_Message_HasBaseField(UPB_UPCAST(msg), &field);
9561 }
google_protobuf_FieldOptions_clear_weak(google_protobuf_FieldOptions * msg)9562 UPB_INLINE void google_protobuf_FieldOptions_clear_weak(google_protobuf_FieldOptions* msg) {
9563   const upb_MiniTableField field = {10, 24, 69, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
9564   upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
9565 }
google_protobuf_FieldOptions_weak(const google_protobuf_FieldOptions * msg)9566 UPB_INLINE bool google_protobuf_FieldOptions_weak(const google_protobuf_FieldOptions* msg) {
9567   bool default_val = false;
9568   bool ret;
9569   const upb_MiniTableField field = {10, 24, 69, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
9570   _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field,
9571                                     &default_val, &ret);
9572   return ret;
9573 }
google_protobuf_FieldOptions_has_weak(const google_protobuf_FieldOptions * msg)9574 UPB_INLINE bool google_protobuf_FieldOptions_has_weak(const google_protobuf_FieldOptions* msg) {
9575   const upb_MiniTableField field = {10, 24, 69, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
9576   return upb_Message_HasBaseField(UPB_UPCAST(msg), &field);
9577 }
google_protobuf_FieldOptions_clear_unverified_lazy(google_protobuf_FieldOptions * msg)9578 UPB_INLINE void google_protobuf_FieldOptions_clear_unverified_lazy(google_protobuf_FieldOptions* msg) {
9579   const upb_MiniTableField field = {15, 25, 70, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
9580   upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
9581 }
google_protobuf_FieldOptions_unverified_lazy(const google_protobuf_FieldOptions * msg)9582 UPB_INLINE bool google_protobuf_FieldOptions_unverified_lazy(const google_protobuf_FieldOptions* msg) {
9583   bool default_val = false;
9584   bool ret;
9585   const upb_MiniTableField field = {15, 25, 70, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
9586   _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field,
9587                                     &default_val, &ret);
9588   return ret;
9589 }
google_protobuf_FieldOptions_has_unverified_lazy(const google_protobuf_FieldOptions * msg)9590 UPB_INLINE bool google_protobuf_FieldOptions_has_unverified_lazy(const google_protobuf_FieldOptions* msg) {
9591   const upb_MiniTableField field = {15, 25, 70, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
9592   return upb_Message_HasBaseField(UPB_UPCAST(msg), &field);
9593 }
google_protobuf_FieldOptions_clear_debug_redact(google_protobuf_FieldOptions * msg)9594 UPB_INLINE void google_protobuf_FieldOptions_clear_debug_redact(google_protobuf_FieldOptions* msg) {
9595   const upb_MiniTableField field = {16, 26, 71, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
9596   upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
9597 }
google_protobuf_FieldOptions_debug_redact(const google_protobuf_FieldOptions * msg)9598 UPB_INLINE bool google_protobuf_FieldOptions_debug_redact(const google_protobuf_FieldOptions* msg) {
9599   bool default_val = false;
9600   bool ret;
9601   const upb_MiniTableField field = {16, 26, 71, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
9602   _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field,
9603                                     &default_val, &ret);
9604   return ret;
9605 }
google_protobuf_FieldOptions_has_debug_redact(const google_protobuf_FieldOptions * msg)9606 UPB_INLINE bool google_protobuf_FieldOptions_has_debug_redact(const google_protobuf_FieldOptions* msg) {
9607   const upb_MiniTableField field = {16, 26, 71, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
9608   return upb_Message_HasBaseField(UPB_UPCAST(msg), &field);
9609 }
google_protobuf_FieldOptions_clear_retention(google_protobuf_FieldOptions * msg)9610 UPB_INLINE void google_protobuf_FieldOptions_clear_retention(google_protobuf_FieldOptions* msg) {
9611   const upb_MiniTableField field = {17, 28, 72, 6, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
9612   upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
9613 }
google_protobuf_FieldOptions_retention(const google_protobuf_FieldOptions * msg)9614 UPB_INLINE int32_t google_protobuf_FieldOptions_retention(const google_protobuf_FieldOptions* msg) {
9615   int32_t default_val = 0;
9616   int32_t ret;
9617   const upb_MiniTableField field = {17, 28, 72, 6, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
9618   _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field,
9619                                     &default_val, &ret);
9620   return ret;
9621 }
google_protobuf_FieldOptions_has_retention(const google_protobuf_FieldOptions * msg)9622 UPB_INLINE bool google_protobuf_FieldOptions_has_retention(const google_protobuf_FieldOptions* msg) {
9623   const upb_MiniTableField field = {17, 28, 72, 6, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
9624   return upb_Message_HasBaseField(UPB_UPCAST(msg), &field);
9625 }
google_protobuf_FieldOptions_clear_targets(google_protobuf_FieldOptions * msg)9626 UPB_INLINE void google_protobuf_FieldOptions_clear_targets(google_protobuf_FieldOptions* msg) {
9627   const upb_MiniTableField field = {19, 32, 0, 7, 14, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
9628   upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
9629 }
google_protobuf_FieldOptions_targets(const google_protobuf_FieldOptions * msg,size_t * size)9630 UPB_INLINE int32_t const* google_protobuf_FieldOptions_targets(const google_protobuf_FieldOptions* msg, size_t* size) {
9631   const upb_MiniTableField field = {19, 32, 0, 7, 14, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
9632   const upb_Array* arr = upb_Message_GetArray(UPB_UPCAST(msg), &field);
9633   if (arr) {
9634     if (size) *size = arr->UPB_PRIVATE(size);
9635     return (int32_t const*)upb_Array_DataPtr(arr);
9636   } else {
9637     if (size) *size = 0;
9638     return NULL;
9639   }
9640 }
_google_protobuf_FieldOptions_targets_upb_array(const google_protobuf_FieldOptions * msg,size_t * size)9641 UPB_INLINE const upb_Array* _google_protobuf_FieldOptions_targets_upb_array(const google_protobuf_FieldOptions* msg, size_t* size) {
9642   const upb_MiniTableField field = {19, 32, 0, 7, 14, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
9643   const upb_Array* arr = upb_Message_GetArray(UPB_UPCAST(msg), &field);
9644   if (size) {
9645     *size = arr ? arr->UPB_PRIVATE(size) : 0;
9646   }
9647   return arr;
9648 }
_google_protobuf_FieldOptions_targets_mutable_upb_array(google_protobuf_FieldOptions * msg,size_t * size,upb_Arena * arena)9649 UPB_INLINE upb_Array* _google_protobuf_FieldOptions_targets_mutable_upb_array(google_protobuf_FieldOptions* msg, size_t* size, upb_Arena* arena) {
9650   const upb_MiniTableField field = {19, 32, 0, 7, 14, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
9651   upb_Array* arr = upb_Message_GetOrCreateMutableArray(UPB_UPCAST(msg),
9652                                                        &field, arena);
9653   if (size) {
9654     *size = arr ? arr->UPB_PRIVATE(size) : 0;
9655   }
9656   return arr;
9657 }
google_protobuf_FieldOptions_clear_edition_defaults(google_protobuf_FieldOptions * msg)9658 UPB_INLINE void google_protobuf_FieldOptions_clear_edition_defaults(google_protobuf_FieldOptions* msg) {
9659   const upb_MiniTableField field = {20, UPB_SIZE(36, 40), 0, 0, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
9660   upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
9661 }
google_protobuf_FieldOptions_edition_defaults(const google_protobuf_FieldOptions * msg,size_t * size)9662 UPB_INLINE const google_protobuf_FieldOptions_EditionDefault* const* google_protobuf_FieldOptions_edition_defaults(const google_protobuf_FieldOptions* msg, size_t* size) {
9663   const upb_MiniTableField field = {20, UPB_SIZE(36, 40), 0, 0, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
9664   UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__FieldOptions__EditionDefault_msg_init);
9665   const upb_Array* arr = upb_Message_GetArray(UPB_UPCAST(msg), &field);
9666   if (arr) {
9667     if (size) *size = arr->UPB_PRIVATE(size);
9668     return (const google_protobuf_FieldOptions_EditionDefault* const*)upb_Array_DataPtr(arr);
9669   } else {
9670     if (size) *size = 0;
9671     return NULL;
9672   }
9673 }
_google_protobuf_FieldOptions_edition_defaults_upb_array(const google_protobuf_FieldOptions * msg,size_t * size)9674 UPB_INLINE const upb_Array* _google_protobuf_FieldOptions_edition_defaults_upb_array(const google_protobuf_FieldOptions* msg, size_t* size) {
9675   const upb_MiniTableField field = {20, UPB_SIZE(36, 40), 0, 0, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
9676   UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__FieldOptions__EditionDefault_msg_init);
9677   const upb_Array* arr = upb_Message_GetArray(UPB_UPCAST(msg), &field);
9678   if (size) {
9679     *size = arr ? arr->UPB_PRIVATE(size) : 0;
9680   }
9681   return arr;
9682 }
_google_protobuf_FieldOptions_edition_defaults_mutable_upb_array(google_protobuf_FieldOptions * msg,size_t * size,upb_Arena * arena)9683 UPB_INLINE upb_Array* _google_protobuf_FieldOptions_edition_defaults_mutable_upb_array(google_protobuf_FieldOptions* msg, size_t* size, upb_Arena* arena) {
9684   const upb_MiniTableField field = {20, UPB_SIZE(36, 40), 0, 0, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
9685   UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__FieldOptions__EditionDefault_msg_init);
9686   upb_Array* arr = upb_Message_GetOrCreateMutableArray(UPB_UPCAST(msg),
9687                                                        &field, arena);
9688   if (size) {
9689     *size = arr ? arr->UPB_PRIVATE(size) : 0;
9690   }
9691   return arr;
9692 }
google_protobuf_FieldOptions_clear_features(google_protobuf_FieldOptions * msg)9693 UPB_INLINE void google_protobuf_FieldOptions_clear_features(google_protobuf_FieldOptions* msg) {
9694   const upb_MiniTableField field = {21, UPB_SIZE(40, 48), 73, 1, 11, (int)kUpb_FieldMode_Scalar | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
9695   upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
9696 }
google_protobuf_FieldOptions_features(const google_protobuf_FieldOptions * msg)9697 UPB_INLINE const google_protobuf_FeatureSet* google_protobuf_FieldOptions_features(const google_protobuf_FieldOptions* msg) {
9698   const google_protobuf_FeatureSet* default_val = NULL;
9699   const google_protobuf_FeatureSet* ret;
9700   const upb_MiniTableField field = {21, UPB_SIZE(40, 48), 73, 1, 11, (int)kUpb_FieldMode_Scalar | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
9701   UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__FeatureSet_msg_init);
9702   _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field,
9703                                     &default_val, &ret);
9704   return ret;
9705 }
google_protobuf_FieldOptions_has_features(const google_protobuf_FieldOptions * msg)9706 UPB_INLINE bool google_protobuf_FieldOptions_has_features(const google_protobuf_FieldOptions* msg) {
9707   const upb_MiniTableField field = {21, UPB_SIZE(40, 48), 73, 1, 11, (int)kUpb_FieldMode_Scalar | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
9708   return upb_Message_HasBaseField(UPB_UPCAST(msg), &field);
9709 }
google_protobuf_FieldOptions_clear_feature_support(google_protobuf_FieldOptions * msg)9710 UPB_INLINE void google_protobuf_FieldOptions_clear_feature_support(google_protobuf_FieldOptions* msg) {
9711   const upb_MiniTableField field = {22, UPB_SIZE(44, 56), 74, 2, 11, (int)kUpb_FieldMode_Scalar | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
9712   upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
9713 }
google_protobuf_FieldOptions_feature_support(const google_protobuf_FieldOptions * msg)9714 UPB_INLINE const google_protobuf_FieldOptions_FeatureSupport* google_protobuf_FieldOptions_feature_support(const google_protobuf_FieldOptions* msg) {
9715   const google_protobuf_FieldOptions_FeatureSupport* default_val = NULL;
9716   const google_protobuf_FieldOptions_FeatureSupport* ret;
9717   const upb_MiniTableField field = {22, UPB_SIZE(44, 56), 74, 2, 11, (int)kUpb_FieldMode_Scalar | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
9718   UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__FieldOptions__FeatureSupport_msg_init);
9719   _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field,
9720                                     &default_val, &ret);
9721   return ret;
9722 }
google_protobuf_FieldOptions_has_feature_support(const google_protobuf_FieldOptions * msg)9723 UPB_INLINE bool google_protobuf_FieldOptions_has_feature_support(const google_protobuf_FieldOptions* msg) {
9724   const upb_MiniTableField field = {22, UPB_SIZE(44, 56), 74, 2, 11, (int)kUpb_FieldMode_Scalar | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
9725   return upb_Message_HasBaseField(UPB_UPCAST(msg), &field);
9726 }
google_protobuf_FieldOptions_clear_uninterpreted_option(google_protobuf_FieldOptions * msg)9727 UPB_INLINE void google_protobuf_FieldOptions_clear_uninterpreted_option(google_protobuf_FieldOptions* msg) {
9728   const upb_MiniTableField field = {999, UPB_SIZE(48, 64), 0, 3, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
9729   upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
9730 }
google_protobuf_FieldOptions_uninterpreted_option(const google_protobuf_FieldOptions * msg,size_t * size)9731 UPB_INLINE const google_protobuf_UninterpretedOption* const* google_protobuf_FieldOptions_uninterpreted_option(const google_protobuf_FieldOptions* msg, size_t* size) {
9732   const upb_MiniTableField field = {999, UPB_SIZE(48, 64), 0, 3, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
9733   UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__UninterpretedOption_msg_init);
9734   const upb_Array* arr = upb_Message_GetArray(UPB_UPCAST(msg), &field);
9735   if (arr) {
9736     if (size) *size = arr->UPB_PRIVATE(size);
9737     return (const google_protobuf_UninterpretedOption* const*)upb_Array_DataPtr(arr);
9738   } else {
9739     if (size) *size = 0;
9740     return NULL;
9741   }
9742 }
_google_protobuf_FieldOptions_uninterpreted_option_upb_array(const google_protobuf_FieldOptions * msg,size_t * size)9743 UPB_INLINE const upb_Array* _google_protobuf_FieldOptions_uninterpreted_option_upb_array(const google_protobuf_FieldOptions* msg, size_t* size) {
9744   const upb_MiniTableField field = {999, UPB_SIZE(48, 64), 0, 3, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
9745   UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__UninterpretedOption_msg_init);
9746   const upb_Array* arr = upb_Message_GetArray(UPB_UPCAST(msg), &field);
9747   if (size) {
9748     *size = arr ? arr->UPB_PRIVATE(size) : 0;
9749   }
9750   return arr;
9751 }
_google_protobuf_FieldOptions_uninterpreted_option_mutable_upb_array(google_protobuf_FieldOptions * msg,size_t * size,upb_Arena * arena)9752 UPB_INLINE upb_Array* _google_protobuf_FieldOptions_uninterpreted_option_mutable_upb_array(google_protobuf_FieldOptions* msg, size_t* size, upb_Arena* arena) {
9753   const upb_MiniTableField field = {999, UPB_SIZE(48, 64), 0, 3, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
9754   UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__UninterpretedOption_msg_init);
9755   upb_Array* arr = upb_Message_GetOrCreateMutableArray(UPB_UPCAST(msg),
9756                                                        &field, arena);
9757   if (size) {
9758     *size = arr ? arr->UPB_PRIVATE(size) : 0;
9759   }
9760   return arr;
9761 }
9762 
google_protobuf_FieldOptions_set_ctype(google_protobuf_FieldOptions * msg,int32_t value)9763 UPB_INLINE void google_protobuf_FieldOptions_set_ctype(google_protobuf_FieldOptions *msg, int32_t value) {
9764   const upb_MiniTableField field = {1, 12, 64, 4, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
9765   upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
9766 }
google_protobuf_FieldOptions_set_packed(google_protobuf_FieldOptions * msg,bool value)9767 UPB_INLINE void google_protobuf_FieldOptions_set_packed(google_protobuf_FieldOptions *msg, bool value) {
9768   const upb_MiniTableField field = {2, 16, 65, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
9769   upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
9770 }
google_protobuf_FieldOptions_set_deprecated(google_protobuf_FieldOptions * msg,bool value)9771 UPB_INLINE void google_protobuf_FieldOptions_set_deprecated(google_protobuf_FieldOptions *msg, bool value) {
9772   const upb_MiniTableField field = {3, 17, 66, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
9773   upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
9774 }
google_protobuf_FieldOptions_set_lazy(google_protobuf_FieldOptions * msg,bool value)9775 UPB_INLINE void google_protobuf_FieldOptions_set_lazy(google_protobuf_FieldOptions *msg, bool value) {
9776   const upb_MiniTableField field = {5, 18, 67, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
9777   upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
9778 }
google_protobuf_FieldOptions_set_jstype(google_protobuf_FieldOptions * msg,int32_t value)9779 UPB_INLINE void google_protobuf_FieldOptions_set_jstype(google_protobuf_FieldOptions *msg, int32_t value) {
9780   const upb_MiniTableField field = {6, 20, 68, 5, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
9781   upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
9782 }
google_protobuf_FieldOptions_set_weak(google_protobuf_FieldOptions * msg,bool value)9783 UPB_INLINE void google_protobuf_FieldOptions_set_weak(google_protobuf_FieldOptions *msg, bool value) {
9784   const upb_MiniTableField field = {10, 24, 69, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
9785   upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
9786 }
google_protobuf_FieldOptions_set_unverified_lazy(google_protobuf_FieldOptions * msg,bool value)9787 UPB_INLINE void google_protobuf_FieldOptions_set_unverified_lazy(google_protobuf_FieldOptions *msg, bool value) {
9788   const upb_MiniTableField field = {15, 25, 70, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
9789   upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
9790 }
google_protobuf_FieldOptions_set_debug_redact(google_protobuf_FieldOptions * msg,bool value)9791 UPB_INLINE void google_protobuf_FieldOptions_set_debug_redact(google_protobuf_FieldOptions *msg, bool value) {
9792   const upb_MiniTableField field = {16, 26, 71, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
9793   upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
9794 }
google_protobuf_FieldOptions_set_retention(google_protobuf_FieldOptions * msg,int32_t value)9795 UPB_INLINE void google_protobuf_FieldOptions_set_retention(google_protobuf_FieldOptions *msg, int32_t value) {
9796   const upb_MiniTableField field = {17, 28, 72, 6, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
9797   upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
9798 }
google_protobuf_FieldOptions_mutable_targets(google_protobuf_FieldOptions * msg,size_t * size)9799 UPB_INLINE int32_t* google_protobuf_FieldOptions_mutable_targets(google_protobuf_FieldOptions* msg, size_t* size) {
9800   upb_MiniTableField field = {19, 32, 0, 7, 14, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
9801   upb_Array* arr = upb_Message_GetMutableArray(UPB_UPCAST(msg), &field);
9802   if (arr) {
9803     if (size) *size = arr->UPB_PRIVATE(size);
9804     return (int32_t*)upb_Array_MutableDataPtr(arr);
9805   } else {
9806     if (size) *size = 0;
9807     return NULL;
9808   }
9809 }
google_protobuf_FieldOptions_resize_targets(google_protobuf_FieldOptions * msg,size_t size,upb_Arena * arena)9810 UPB_INLINE int32_t* google_protobuf_FieldOptions_resize_targets(google_protobuf_FieldOptions* msg, size_t size, upb_Arena* arena) {
9811   upb_MiniTableField field = {19, 32, 0, 7, 14, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
9812   return (int32_t*)upb_Message_ResizeArrayUninitialized(UPB_UPCAST(msg),
9813                                                    &field, size, arena);
9814 }
google_protobuf_FieldOptions_add_targets(google_protobuf_FieldOptions * msg,int32_t val,upb_Arena * arena)9815 UPB_INLINE bool google_protobuf_FieldOptions_add_targets(google_protobuf_FieldOptions* msg, int32_t val, upb_Arena* arena) {
9816   upb_MiniTableField field = {19, 32, 0, 7, 14, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
9817   upb_Array* arr = upb_Message_GetOrCreateMutableArray(
9818       UPB_UPCAST(msg), &field, arena);
9819   if (!arr || !UPB_PRIVATE(_upb_Array_ResizeUninitialized)(
9820                   arr, arr->UPB_PRIVATE(size) + 1, arena)) {
9821     return false;
9822   }
9823   UPB_PRIVATE(_upb_Array_Set)
9824   (arr, arr->UPB_PRIVATE(size) - 1, &val, sizeof(val));
9825   return true;
9826 }
google_protobuf_FieldOptions_mutable_edition_defaults(google_protobuf_FieldOptions * msg,size_t * size)9827 UPB_INLINE google_protobuf_FieldOptions_EditionDefault** google_protobuf_FieldOptions_mutable_edition_defaults(google_protobuf_FieldOptions* msg, size_t* size) {
9828   upb_MiniTableField field = {20, UPB_SIZE(36, 40), 0, 0, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
9829   UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__FieldOptions__EditionDefault_msg_init);
9830   upb_Array* arr = upb_Message_GetMutableArray(UPB_UPCAST(msg), &field);
9831   if (arr) {
9832     if (size) *size = arr->UPB_PRIVATE(size);
9833     return (google_protobuf_FieldOptions_EditionDefault**)upb_Array_MutableDataPtr(arr);
9834   } else {
9835     if (size) *size = 0;
9836     return NULL;
9837   }
9838 }
google_protobuf_FieldOptions_resize_edition_defaults(google_protobuf_FieldOptions * msg,size_t size,upb_Arena * arena)9839 UPB_INLINE google_protobuf_FieldOptions_EditionDefault** google_protobuf_FieldOptions_resize_edition_defaults(google_protobuf_FieldOptions* msg, size_t size, upb_Arena* arena) {
9840   upb_MiniTableField field = {20, UPB_SIZE(36, 40), 0, 0, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
9841   return (google_protobuf_FieldOptions_EditionDefault**)upb_Message_ResizeArrayUninitialized(UPB_UPCAST(msg),
9842                                                    &field, size, arena);
9843 }
google_protobuf_FieldOptions_add_edition_defaults(google_protobuf_FieldOptions * msg,upb_Arena * arena)9844 UPB_INLINE struct google_protobuf_FieldOptions_EditionDefault* google_protobuf_FieldOptions_add_edition_defaults(google_protobuf_FieldOptions* msg, upb_Arena* arena) {
9845   upb_MiniTableField field = {20, UPB_SIZE(36, 40), 0, 0, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
9846   UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__FieldOptions__EditionDefault_msg_init);
9847   upb_Array* arr = upb_Message_GetOrCreateMutableArray(
9848       UPB_UPCAST(msg), &field, arena);
9849   if (!arr || !UPB_PRIVATE(_upb_Array_ResizeUninitialized)(
9850                   arr, arr->UPB_PRIVATE(size) + 1, arena)) {
9851     return NULL;
9852   }
9853   struct google_protobuf_FieldOptions_EditionDefault* sub = (struct google_protobuf_FieldOptions_EditionDefault*)_upb_Message_New(&google__protobuf__FieldOptions__EditionDefault_msg_init, arena);
9854   if (!arr || !sub) return NULL;
9855   UPB_PRIVATE(_upb_Array_Set)
9856   (arr, arr->UPB_PRIVATE(size) - 1, &sub, sizeof(sub));
9857   return sub;
9858 }
google_protobuf_FieldOptions_set_features(google_protobuf_FieldOptions * msg,google_protobuf_FeatureSet * value)9859 UPB_INLINE void google_protobuf_FieldOptions_set_features(google_protobuf_FieldOptions *msg, google_protobuf_FeatureSet* value) {
9860   const upb_MiniTableField field = {21, UPB_SIZE(40, 48), 73, 1, 11, (int)kUpb_FieldMode_Scalar | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
9861   UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__FeatureSet_msg_init);
9862   upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
9863 }
google_protobuf_FieldOptions_mutable_features(google_protobuf_FieldOptions * msg,upb_Arena * arena)9864 UPB_INLINE struct google_protobuf_FeatureSet* google_protobuf_FieldOptions_mutable_features(google_protobuf_FieldOptions* msg, upb_Arena* arena) {
9865   struct google_protobuf_FeatureSet* sub = (struct google_protobuf_FeatureSet*)google_protobuf_FieldOptions_features(msg);
9866   if (sub == NULL) {
9867     sub = (struct google_protobuf_FeatureSet*)_upb_Message_New(&google__protobuf__FeatureSet_msg_init, arena);
9868     if (sub) google_protobuf_FieldOptions_set_features(msg, sub);
9869   }
9870   return sub;
9871 }
google_protobuf_FieldOptions_set_feature_support(google_protobuf_FieldOptions * msg,google_protobuf_FieldOptions_FeatureSupport * value)9872 UPB_INLINE void google_protobuf_FieldOptions_set_feature_support(google_protobuf_FieldOptions *msg, google_protobuf_FieldOptions_FeatureSupport* value) {
9873   const upb_MiniTableField field = {22, UPB_SIZE(44, 56), 74, 2, 11, (int)kUpb_FieldMode_Scalar | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
9874   UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__FieldOptions__FeatureSupport_msg_init);
9875   upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
9876 }
google_protobuf_FieldOptions_mutable_feature_support(google_protobuf_FieldOptions * msg,upb_Arena * arena)9877 UPB_INLINE struct google_protobuf_FieldOptions_FeatureSupport* google_protobuf_FieldOptions_mutable_feature_support(google_protobuf_FieldOptions* msg, upb_Arena* arena) {
9878   struct google_protobuf_FieldOptions_FeatureSupport* sub = (struct google_protobuf_FieldOptions_FeatureSupport*)google_protobuf_FieldOptions_feature_support(msg);
9879   if (sub == NULL) {
9880     sub = (struct google_protobuf_FieldOptions_FeatureSupport*)_upb_Message_New(&google__protobuf__FieldOptions__FeatureSupport_msg_init, arena);
9881     if (sub) google_protobuf_FieldOptions_set_feature_support(msg, sub);
9882   }
9883   return sub;
9884 }
google_protobuf_FieldOptions_mutable_uninterpreted_option(google_protobuf_FieldOptions * msg,size_t * size)9885 UPB_INLINE google_protobuf_UninterpretedOption** google_protobuf_FieldOptions_mutable_uninterpreted_option(google_protobuf_FieldOptions* msg, size_t* size) {
9886   upb_MiniTableField field = {999, UPB_SIZE(48, 64), 0, 3, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
9887   UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__UninterpretedOption_msg_init);
9888   upb_Array* arr = upb_Message_GetMutableArray(UPB_UPCAST(msg), &field);
9889   if (arr) {
9890     if (size) *size = arr->UPB_PRIVATE(size);
9891     return (google_protobuf_UninterpretedOption**)upb_Array_MutableDataPtr(arr);
9892   } else {
9893     if (size) *size = 0;
9894     return NULL;
9895   }
9896 }
google_protobuf_FieldOptions_resize_uninterpreted_option(google_protobuf_FieldOptions * msg,size_t size,upb_Arena * arena)9897 UPB_INLINE google_protobuf_UninterpretedOption** google_protobuf_FieldOptions_resize_uninterpreted_option(google_protobuf_FieldOptions* msg, size_t size, upb_Arena* arena) {
9898   upb_MiniTableField field = {999, UPB_SIZE(48, 64), 0, 3, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
9899   return (google_protobuf_UninterpretedOption**)upb_Message_ResizeArrayUninitialized(UPB_UPCAST(msg),
9900                                                    &field, size, arena);
9901 }
google_protobuf_FieldOptions_add_uninterpreted_option(google_protobuf_FieldOptions * msg,upb_Arena * arena)9902 UPB_INLINE struct google_protobuf_UninterpretedOption* google_protobuf_FieldOptions_add_uninterpreted_option(google_protobuf_FieldOptions* msg, upb_Arena* arena) {
9903   upb_MiniTableField field = {999, UPB_SIZE(48, 64), 0, 3, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
9904   UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__UninterpretedOption_msg_init);
9905   upb_Array* arr = upb_Message_GetOrCreateMutableArray(
9906       UPB_UPCAST(msg), &field, arena);
9907   if (!arr || !UPB_PRIVATE(_upb_Array_ResizeUninitialized)(
9908                   arr, arr->UPB_PRIVATE(size) + 1, arena)) {
9909     return NULL;
9910   }
9911   struct google_protobuf_UninterpretedOption* sub = (struct google_protobuf_UninterpretedOption*)_upb_Message_New(&google__protobuf__UninterpretedOption_msg_init, arena);
9912   if (!arr || !sub) return NULL;
9913   UPB_PRIVATE(_upb_Array_Set)
9914   (arr, arr->UPB_PRIVATE(size) - 1, &sub, sizeof(sub));
9915   return sub;
9916 }
9917 
9918 /* google.protobuf.FieldOptions.EditionDefault */
9919 
google_protobuf_FieldOptions_EditionDefault_new(upb_Arena * arena)9920 UPB_INLINE google_protobuf_FieldOptions_EditionDefault* google_protobuf_FieldOptions_EditionDefault_new(upb_Arena* arena) {
9921   return (google_protobuf_FieldOptions_EditionDefault*)_upb_Message_New(&google__protobuf__FieldOptions__EditionDefault_msg_init, arena);
9922 }
google_protobuf_FieldOptions_EditionDefault_parse(const char * buf,size_t size,upb_Arena * arena)9923 UPB_INLINE google_protobuf_FieldOptions_EditionDefault* google_protobuf_FieldOptions_EditionDefault_parse(const char* buf, size_t size, upb_Arena* arena) {
9924   google_protobuf_FieldOptions_EditionDefault* ret = google_protobuf_FieldOptions_EditionDefault_new(arena);
9925   if (!ret) return NULL;
9926   if (upb_Decode(buf, size, UPB_UPCAST(ret), &google__protobuf__FieldOptions__EditionDefault_msg_init, NULL, 0, arena) !=
9927       kUpb_DecodeStatus_Ok) {
9928     return NULL;
9929   }
9930   return ret;
9931 }
google_protobuf_FieldOptions_EditionDefault_parse_ex(const char * buf,size_t size,const upb_ExtensionRegistry * extreg,int options,upb_Arena * arena)9932 UPB_INLINE google_protobuf_FieldOptions_EditionDefault* google_protobuf_FieldOptions_EditionDefault_parse_ex(const char* buf, size_t size,
9933                            const upb_ExtensionRegistry* extreg,
9934                            int options, upb_Arena* arena) {
9935   google_protobuf_FieldOptions_EditionDefault* ret = google_protobuf_FieldOptions_EditionDefault_new(arena);
9936   if (!ret) return NULL;
9937   if (upb_Decode(buf, size, UPB_UPCAST(ret), &google__protobuf__FieldOptions__EditionDefault_msg_init, extreg, options,
9938                  arena) != kUpb_DecodeStatus_Ok) {
9939     return NULL;
9940   }
9941   return ret;
9942 }
google_protobuf_FieldOptions_EditionDefault_serialize(const google_protobuf_FieldOptions_EditionDefault * msg,upb_Arena * arena,size_t * len)9943 UPB_INLINE char* google_protobuf_FieldOptions_EditionDefault_serialize(const google_protobuf_FieldOptions_EditionDefault* msg, upb_Arena* arena, size_t* len) {
9944   char* ptr;
9945   (void)upb_Encode(UPB_UPCAST(msg), &google__protobuf__FieldOptions__EditionDefault_msg_init, 0, arena, &ptr, len);
9946   return ptr;
9947 }
google_protobuf_FieldOptions_EditionDefault_serialize_ex(const google_protobuf_FieldOptions_EditionDefault * msg,int options,upb_Arena * arena,size_t * len)9948 UPB_INLINE char* google_protobuf_FieldOptions_EditionDefault_serialize_ex(const google_protobuf_FieldOptions_EditionDefault* msg, int options,
9949                                  upb_Arena* arena, size_t* len) {
9950   char* ptr;
9951   (void)upb_Encode(UPB_UPCAST(msg), &google__protobuf__FieldOptions__EditionDefault_msg_init, options, arena, &ptr, len);
9952   return ptr;
9953 }
google_protobuf_FieldOptions_EditionDefault_clear_value(google_protobuf_FieldOptions_EditionDefault * msg)9954 UPB_INLINE void google_protobuf_FieldOptions_EditionDefault_clear_value(google_protobuf_FieldOptions_EditionDefault* msg) {
9955   const upb_MiniTableField field = {2, 16, 64, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
9956   upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
9957 }
google_protobuf_FieldOptions_EditionDefault_value(const google_protobuf_FieldOptions_EditionDefault * msg)9958 UPB_INLINE upb_StringView google_protobuf_FieldOptions_EditionDefault_value(const google_protobuf_FieldOptions_EditionDefault* msg) {
9959   upb_StringView default_val = upb_StringView_FromString("");
9960   upb_StringView ret;
9961   const upb_MiniTableField field = {2, 16, 64, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
9962   _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field,
9963                                     &default_val, &ret);
9964   return ret;
9965 }
google_protobuf_FieldOptions_EditionDefault_has_value(const google_protobuf_FieldOptions_EditionDefault * msg)9966 UPB_INLINE bool google_protobuf_FieldOptions_EditionDefault_has_value(const google_protobuf_FieldOptions_EditionDefault* msg) {
9967   const upb_MiniTableField field = {2, 16, 64, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
9968   return upb_Message_HasBaseField(UPB_UPCAST(msg), &field);
9969 }
google_protobuf_FieldOptions_EditionDefault_clear_edition(google_protobuf_FieldOptions_EditionDefault * msg)9970 UPB_INLINE void google_protobuf_FieldOptions_EditionDefault_clear_edition(google_protobuf_FieldOptions_EditionDefault* msg) {
9971   const upb_MiniTableField field = {3, 12, 65, 0, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
9972   upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
9973 }
google_protobuf_FieldOptions_EditionDefault_edition(const google_protobuf_FieldOptions_EditionDefault * msg)9974 UPB_INLINE int32_t google_protobuf_FieldOptions_EditionDefault_edition(const google_protobuf_FieldOptions_EditionDefault* msg) {
9975   int32_t default_val = 0;
9976   int32_t ret;
9977   const upb_MiniTableField field = {3, 12, 65, 0, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
9978   _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field,
9979                                     &default_val, &ret);
9980   return ret;
9981 }
google_protobuf_FieldOptions_EditionDefault_has_edition(const google_protobuf_FieldOptions_EditionDefault * msg)9982 UPB_INLINE bool google_protobuf_FieldOptions_EditionDefault_has_edition(const google_protobuf_FieldOptions_EditionDefault* msg) {
9983   const upb_MiniTableField field = {3, 12, 65, 0, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
9984   return upb_Message_HasBaseField(UPB_UPCAST(msg), &field);
9985 }
9986 
google_protobuf_FieldOptions_EditionDefault_set_value(google_protobuf_FieldOptions_EditionDefault * msg,upb_StringView value)9987 UPB_INLINE void google_protobuf_FieldOptions_EditionDefault_set_value(google_protobuf_FieldOptions_EditionDefault *msg, upb_StringView value) {
9988   const upb_MiniTableField field = {2, 16, 64, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
9989   upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
9990 }
google_protobuf_FieldOptions_EditionDefault_set_edition(google_protobuf_FieldOptions_EditionDefault * msg,int32_t value)9991 UPB_INLINE void google_protobuf_FieldOptions_EditionDefault_set_edition(google_protobuf_FieldOptions_EditionDefault *msg, int32_t value) {
9992   const upb_MiniTableField field = {3, 12, 65, 0, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
9993   upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
9994 }
9995 
9996 /* google.protobuf.FieldOptions.FeatureSupport */
9997 
google_protobuf_FieldOptions_FeatureSupport_new(upb_Arena * arena)9998 UPB_INLINE google_protobuf_FieldOptions_FeatureSupport* google_protobuf_FieldOptions_FeatureSupport_new(upb_Arena* arena) {
9999   return (google_protobuf_FieldOptions_FeatureSupport*)_upb_Message_New(&google__protobuf__FieldOptions__FeatureSupport_msg_init, arena);
10000 }
google_protobuf_FieldOptions_FeatureSupport_parse(const char * buf,size_t size,upb_Arena * arena)10001 UPB_INLINE google_protobuf_FieldOptions_FeatureSupport* google_protobuf_FieldOptions_FeatureSupport_parse(const char* buf, size_t size, upb_Arena* arena) {
10002   google_protobuf_FieldOptions_FeatureSupport* ret = google_protobuf_FieldOptions_FeatureSupport_new(arena);
10003   if (!ret) return NULL;
10004   if (upb_Decode(buf, size, UPB_UPCAST(ret), &google__protobuf__FieldOptions__FeatureSupport_msg_init, NULL, 0, arena) !=
10005       kUpb_DecodeStatus_Ok) {
10006     return NULL;
10007   }
10008   return ret;
10009 }
google_protobuf_FieldOptions_FeatureSupport_parse_ex(const char * buf,size_t size,const upb_ExtensionRegistry * extreg,int options,upb_Arena * arena)10010 UPB_INLINE google_protobuf_FieldOptions_FeatureSupport* google_protobuf_FieldOptions_FeatureSupport_parse_ex(const char* buf, size_t size,
10011                            const upb_ExtensionRegistry* extreg,
10012                            int options, upb_Arena* arena) {
10013   google_protobuf_FieldOptions_FeatureSupport* ret = google_protobuf_FieldOptions_FeatureSupport_new(arena);
10014   if (!ret) return NULL;
10015   if (upb_Decode(buf, size, UPB_UPCAST(ret), &google__protobuf__FieldOptions__FeatureSupport_msg_init, extreg, options,
10016                  arena) != kUpb_DecodeStatus_Ok) {
10017     return NULL;
10018   }
10019   return ret;
10020 }
google_protobuf_FieldOptions_FeatureSupport_serialize(const google_protobuf_FieldOptions_FeatureSupport * msg,upb_Arena * arena,size_t * len)10021 UPB_INLINE char* google_protobuf_FieldOptions_FeatureSupport_serialize(const google_protobuf_FieldOptions_FeatureSupport* msg, upb_Arena* arena, size_t* len) {
10022   char* ptr;
10023   (void)upb_Encode(UPB_UPCAST(msg), &google__protobuf__FieldOptions__FeatureSupport_msg_init, 0, arena, &ptr, len);
10024   return ptr;
10025 }
google_protobuf_FieldOptions_FeatureSupport_serialize_ex(const google_protobuf_FieldOptions_FeatureSupport * msg,int options,upb_Arena * arena,size_t * len)10026 UPB_INLINE char* google_protobuf_FieldOptions_FeatureSupport_serialize_ex(const google_protobuf_FieldOptions_FeatureSupport* msg, int options,
10027                                  upb_Arena* arena, size_t* len) {
10028   char* ptr;
10029   (void)upb_Encode(UPB_UPCAST(msg), &google__protobuf__FieldOptions__FeatureSupport_msg_init, options, arena, &ptr, len);
10030   return ptr;
10031 }
google_protobuf_FieldOptions_FeatureSupport_clear_edition_introduced(google_protobuf_FieldOptions_FeatureSupport * msg)10032 UPB_INLINE void google_protobuf_FieldOptions_FeatureSupport_clear_edition_introduced(google_protobuf_FieldOptions_FeatureSupport* msg) {
10033   const upb_MiniTableField field = {1, 12, 64, 0, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
10034   upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
10035 }
google_protobuf_FieldOptions_FeatureSupport_edition_introduced(const google_protobuf_FieldOptions_FeatureSupport * msg)10036 UPB_INLINE int32_t google_protobuf_FieldOptions_FeatureSupport_edition_introduced(const google_protobuf_FieldOptions_FeatureSupport* msg) {
10037   int32_t default_val = 0;
10038   int32_t ret;
10039   const upb_MiniTableField field = {1, 12, 64, 0, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
10040   _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field,
10041                                     &default_val, &ret);
10042   return ret;
10043 }
google_protobuf_FieldOptions_FeatureSupport_has_edition_introduced(const google_protobuf_FieldOptions_FeatureSupport * msg)10044 UPB_INLINE bool google_protobuf_FieldOptions_FeatureSupport_has_edition_introduced(const google_protobuf_FieldOptions_FeatureSupport* msg) {
10045   const upb_MiniTableField field = {1, 12, 64, 0, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
10046   return upb_Message_HasBaseField(UPB_UPCAST(msg), &field);
10047 }
google_protobuf_FieldOptions_FeatureSupport_clear_edition_deprecated(google_protobuf_FieldOptions_FeatureSupport * msg)10048 UPB_INLINE void google_protobuf_FieldOptions_FeatureSupport_clear_edition_deprecated(google_protobuf_FieldOptions_FeatureSupport* msg) {
10049   const upb_MiniTableField field = {2, 16, 65, 1, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
10050   upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
10051 }
google_protobuf_FieldOptions_FeatureSupport_edition_deprecated(const google_protobuf_FieldOptions_FeatureSupport * msg)10052 UPB_INLINE int32_t google_protobuf_FieldOptions_FeatureSupport_edition_deprecated(const google_protobuf_FieldOptions_FeatureSupport* msg) {
10053   int32_t default_val = 0;
10054   int32_t ret;
10055   const upb_MiniTableField field = {2, 16, 65, 1, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
10056   _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field,
10057                                     &default_val, &ret);
10058   return ret;
10059 }
google_protobuf_FieldOptions_FeatureSupport_has_edition_deprecated(const google_protobuf_FieldOptions_FeatureSupport * msg)10060 UPB_INLINE bool google_protobuf_FieldOptions_FeatureSupport_has_edition_deprecated(const google_protobuf_FieldOptions_FeatureSupport* msg) {
10061   const upb_MiniTableField field = {2, 16, 65, 1, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
10062   return upb_Message_HasBaseField(UPB_UPCAST(msg), &field);
10063 }
google_protobuf_FieldOptions_FeatureSupport_clear_deprecation_warning(google_protobuf_FieldOptions_FeatureSupport * msg)10064 UPB_INLINE void google_protobuf_FieldOptions_FeatureSupport_clear_deprecation_warning(google_protobuf_FieldOptions_FeatureSupport* msg) {
10065   const upb_MiniTableField field = {3, 24, 66, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
10066   upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
10067 }
google_protobuf_FieldOptions_FeatureSupport_deprecation_warning(const google_protobuf_FieldOptions_FeatureSupport * msg)10068 UPB_INLINE upb_StringView google_protobuf_FieldOptions_FeatureSupport_deprecation_warning(const google_protobuf_FieldOptions_FeatureSupport* msg) {
10069   upb_StringView default_val = upb_StringView_FromString("");
10070   upb_StringView ret;
10071   const upb_MiniTableField field = {3, 24, 66, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
10072   _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field,
10073                                     &default_val, &ret);
10074   return ret;
10075 }
google_protobuf_FieldOptions_FeatureSupport_has_deprecation_warning(const google_protobuf_FieldOptions_FeatureSupport * msg)10076 UPB_INLINE bool google_protobuf_FieldOptions_FeatureSupport_has_deprecation_warning(const google_protobuf_FieldOptions_FeatureSupport* msg) {
10077   const upb_MiniTableField field = {3, 24, 66, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
10078   return upb_Message_HasBaseField(UPB_UPCAST(msg), &field);
10079 }
google_protobuf_FieldOptions_FeatureSupport_clear_edition_removed(google_protobuf_FieldOptions_FeatureSupport * msg)10080 UPB_INLINE void google_protobuf_FieldOptions_FeatureSupport_clear_edition_removed(google_protobuf_FieldOptions_FeatureSupport* msg) {
10081   const upb_MiniTableField field = {4, 20, 67, 2, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
10082   upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
10083 }
google_protobuf_FieldOptions_FeatureSupport_edition_removed(const google_protobuf_FieldOptions_FeatureSupport * msg)10084 UPB_INLINE int32_t google_protobuf_FieldOptions_FeatureSupport_edition_removed(const google_protobuf_FieldOptions_FeatureSupport* msg) {
10085   int32_t default_val = 0;
10086   int32_t ret;
10087   const upb_MiniTableField field = {4, 20, 67, 2, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
10088   _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field,
10089                                     &default_val, &ret);
10090   return ret;
10091 }
google_protobuf_FieldOptions_FeatureSupport_has_edition_removed(const google_protobuf_FieldOptions_FeatureSupport * msg)10092 UPB_INLINE bool google_protobuf_FieldOptions_FeatureSupport_has_edition_removed(const google_protobuf_FieldOptions_FeatureSupport* msg) {
10093   const upb_MiniTableField field = {4, 20, 67, 2, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
10094   return upb_Message_HasBaseField(UPB_UPCAST(msg), &field);
10095 }
10096 
google_protobuf_FieldOptions_FeatureSupport_set_edition_introduced(google_protobuf_FieldOptions_FeatureSupport * msg,int32_t value)10097 UPB_INLINE void google_protobuf_FieldOptions_FeatureSupport_set_edition_introduced(google_protobuf_FieldOptions_FeatureSupport *msg, int32_t value) {
10098   const upb_MiniTableField field = {1, 12, 64, 0, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
10099   upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
10100 }
google_protobuf_FieldOptions_FeatureSupport_set_edition_deprecated(google_protobuf_FieldOptions_FeatureSupport * msg,int32_t value)10101 UPB_INLINE void google_protobuf_FieldOptions_FeatureSupport_set_edition_deprecated(google_protobuf_FieldOptions_FeatureSupport *msg, int32_t value) {
10102   const upb_MiniTableField field = {2, 16, 65, 1, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
10103   upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
10104 }
google_protobuf_FieldOptions_FeatureSupport_set_deprecation_warning(google_protobuf_FieldOptions_FeatureSupport * msg,upb_StringView value)10105 UPB_INLINE void google_protobuf_FieldOptions_FeatureSupport_set_deprecation_warning(google_protobuf_FieldOptions_FeatureSupport *msg, upb_StringView value) {
10106   const upb_MiniTableField field = {3, 24, 66, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
10107   upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
10108 }
google_protobuf_FieldOptions_FeatureSupport_set_edition_removed(google_protobuf_FieldOptions_FeatureSupport * msg,int32_t value)10109 UPB_INLINE void google_protobuf_FieldOptions_FeatureSupport_set_edition_removed(google_protobuf_FieldOptions_FeatureSupport *msg, int32_t value) {
10110   const upb_MiniTableField field = {4, 20, 67, 2, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
10111   upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
10112 }
10113 
10114 /* google.protobuf.OneofOptions */
10115 
google_protobuf_OneofOptions_new(upb_Arena * arena)10116 UPB_INLINE google_protobuf_OneofOptions* google_protobuf_OneofOptions_new(upb_Arena* arena) {
10117   return (google_protobuf_OneofOptions*)_upb_Message_New(&google__protobuf__OneofOptions_msg_init, arena);
10118 }
google_protobuf_OneofOptions_parse(const char * buf,size_t size,upb_Arena * arena)10119 UPB_INLINE google_protobuf_OneofOptions* google_protobuf_OneofOptions_parse(const char* buf, size_t size, upb_Arena* arena) {
10120   google_protobuf_OneofOptions* ret = google_protobuf_OneofOptions_new(arena);
10121   if (!ret) return NULL;
10122   if (upb_Decode(buf, size, UPB_UPCAST(ret), &google__protobuf__OneofOptions_msg_init, NULL, 0, arena) !=
10123       kUpb_DecodeStatus_Ok) {
10124     return NULL;
10125   }
10126   return ret;
10127 }
google_protobuf_OneofOptions_parse_ex(const char * buf,size_t size,const upb_ExtensionRegistry * extreg,int options,upb_Arena * arena)10128 UPB_INLINE google_protobuf_OneofOptions* google_protobuf_OneofOptions_parse_ex(const char* buf, size_t size,
10129                            const upb_ExtensionRegistry* extreg,
10130                            int options, upb_Arena* arena) {
10131   google_protobuf_OneofOptions* ret = google_protobuf_OneofOptions_new(arena);
10132   if (!ret) return NULL;
10133   if (upb_Decode(buf, size, UPB_UPCAST(ret), &google__protobuf__OneofOptions_msg_init, extreg, options,
10134                  arena) != kUpb_DecodeStatus_Ok) {
10135     return NULL;
10136   }
10137   return ret;
10138 }
google_protobuf_OneofOptions_serialize(const google_protobuf_OneofOptions * msg,upb_Arena * arena,size_t * len)10139 UPB_INLINE char* google_protobuf_OneofOptions_serialize(const google_protobuf_OneofOptions* msg, upb_Arena* arena, size_t* len) {
10140   char* ptr;
10141   (void)upb_Encode(UPB_UPCAST(msg), &google__protobuf__OneofOptions_msg_init, 0, arena, &ptr, len);
10142   return ptr;
10143 }
google_protobuf_OneofOptions_serialize_ex(const google_protobuf_OneofOptions * msg,int options,upb_Arena * arena,size_t * len)10144 UPB_INLINE char* google_protobuf_OneofOptions_serialize_ex(const google_protobuf_OneofOptions* msg, int options,
10145                                  upb_Arena* arena, size_t* len) {
10146   char* ptr;
10147   (void)upb_Encode(UPB_UPCAST(msg), &google__protobuf__OneofOptions_msg_init, options, arena, &ptr, len);
10148   return ptr;
10149 }
google_protobuf_OneofOptions_clear_features(google_protobuf_OneofOptions * msg)10150 UPB_INLINE void google_protobuf_OneofOptions_clear_features(google_protobuf_OneofOptions* msg) {
10151   const upb_MiniTableField field = {1, UPB_SIZE(12, 16), 64, 0, 11, (int)kUpb_FieldMode_Scalar | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
10152   upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
10153 }
google_protobuf_OneofOptions_features(const google_protobuf_OneofOptions * msg)10154 UPB_INLINE const google_protobuf_FeatureSet* google_protobuf_OneofOptions_features(const google_protobuf_OneofOptions* msg) {
10155   const google_protobuf_FeatureSet* default_val = NULL;
10156   const google_protobuf_FeatureSet* ret;
10157   const upb_MiniTableField field = {1, UPB_SIZE(12, 16), 64, 0, 11, (int)kUpb_FieldMode_Scalar | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
10158   UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__FeatureSet_msg_init);
10159   _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field,
10160                                     &default_val, &ret);
10161   return ret;
10162 }
google_protobuf_OneofOptions_has_features(const google_protobuf_OneofOptions * msg)10163 UPB_INLINE bool google_protobuf_OneofOptions_has_features(const google_protobuf_OneofOptions* msg) {
10164   const upb_MiniTableField field = {1, UPB_SIZE(12, 16), 64, 0, 11, (int)kUpb_FieldMode_Scalar | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
10165   return upb_Message_HasBaseField(UPB_UPCAST(msg), &field);
10166 }
google_protobuf_OneofOptions_clear_uninterpreted_option(google_protobuf_OneofOptions * msg)10167 UPB_INLINE void google_protobuf_OneofOptions_clear_uninterpreted_option(google_protobuf_OneofOptions* msg) {
10168   const upb_MiniTableField field = {999, UPB_SIZE(16, 24), 0, 1, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
10169   upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
10170 }
google_protobuf_OneofOptions_uninterpreted_option(const google_protobuf_OneofOptions * msg,size_t * size)10171 UPB_INLINE const google_protobuf_UninterpretedOption* const* google_protobuf_OneofOptions_uninterpreted_option(const google_protobuf_OneofOptions* msg, size_t* size) {
10172   const upb_MiniTableField field = {999, UPB_SIZE(16, 24), 0, 1, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
10173   UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__UninterpretedOption_msg_init);
10174   const upb_Array* arr = upb_Message_GetArray(UPB_UPCAST(msg), &field);
10175   if (arr) {
10176     if (size) *size = arr->UPB_PRIVATE(size);
10177     return (const google_protobuf_UninterpretedOption* const*)upb_Array_DataPtr(arr);
10178   } else {
10179     if (size) *size = 0;
10180     return NULL;
10181   }
10182 }
_google_protobuf_OneofOptions_uninterpreted_option_upb_array(const google_protobuf_OneofOptions * msg,size_t * size)10183 UPB_INLINE const upb_Array* _google_protobuf_OneofOptions_uninterpreted_option_upb_array(const google_protobuf_OneofOptions* msg, size_t* size) {
10184   const upb_MiniTableField field = {999, UPB_SIZE(16, 24), 0, 1, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
10185   UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__UninterpretedOption_msg_init);
10186   const upb_Array* arr = upb_Message_GetArray(UPB_UPCAST(msg), &field);
10187   if (size) {
10188     *size = arr ? arr->UPB_PRIVATE(size) : 0;
10189   }
10190   return arr;
10191 }
_google_protobuf_OneofOptions_uninterpreted_option_mutable_upb_array(google_protobuf_OneofOptions * msg,size_t * size,upb_Arena * arena)10192 UPB_INLINE upb_Array* _google_protobuf_OneofOptions_uninterpreted_option_mutable_upb_array(google_protobuf_OneofOptions* msg, size_t* size, upb_Arena* arena) {
10193   const upb_MiniTableField field = {999, UPB_SIZE(16, 24), 0, 1, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
10194   UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__UninterpretedOption_msg_init);
10195   upb_Array* arr = upb_Message_GetOrCreateMutableArray(UPB_UPCAST(msg),
10196                                                        &field, arena);
10197   if (size) {
10198     *size = arr ? arr->UPB_PRIVATE(size) : 0;
10199   }
10200   return arr;
10201 }
10202 
google_protobuf_OneofOptions_set_features(google_protobuf_OneofOptions * msg,google_protobuf_FeatureSet * value)10203 UPB_INLINE void google_protobuf_OneofOptions_set_features(google_protobuf_OneofOptions *msg, google_protobuf_FeatureSet* value) {
10204   const upb_MiniTableField field = {1, UPB_SIZE(12, 16), 64, 0, 11, (int)kUpb_FieldMode_Scalar | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
10205   UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__FeatureSet_msg_init);
10206   upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
10207 }
google_protobuf_OneofOptions_mutable_features(google_protobuf_OneofOptions * msg,upb_Arena * arena)10208 UPB_INLINE struct google_protobuf_FeatureSet* google_protobuf_OneofOptions_mutable_features(google_protobuf_OneofOptions* msg, upb_Arena* arena) {
10209   struct google_protobuf_FeatureSet* sub = (struct google_protobuf_FeatureSet*)google_protobuf_OneofOptions_features(msg);
10210   if (sub == NULL) {
10211     sub = (struct google_protobuf_FeatureSet*)_upb_Message_New(&google__protobuf__FeatureSet_msg_init, arena);
10212     if (sub) google_protobuf_OneofOptions_set_features(msg, sub);
10213   }
10214   return sub;
10215 }
google_protobuf_OneofOptions_mutable_uninterpreted_option(google_protobuf_OneofOptions * msg,size_t * size)10216 UPB_INLINE google_protobuf_UninterpretedOption** google_protobuf_OneofOptions_mutable_uninterpreted_option(google_protobuf_OneofOptions* msg, size_t* size) {
10217   upb_MiniTableField field = {999, UPB_SIZE(16, 24), 0, 1, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
10218   UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__UninterpretedOption_msg_init);
10219   upb_Array* arr = upb_Message_GetMutableArray(UPB_UPCAST(msg), &field);
10220   if (arr) {
10221     if (size) *size = arr->UPB_PRIVATE(size);
10222     return (google_protobuf_UninterpretedOption**)upb_Array_MutableDataPtr(arr);
10223   } else {
10224     if (size) *size = 0;
10225     return NULL;
10226   }
10227 }
google_protobuf_OneofOptions_resize_uninterpreted_option(google_protobuf_OneofOptions * msg,size_t size,upb_Arena * arena)10228 UPB_INLINE google_protobuf_UninterpretedOption** google_protobuf_OneofOptions_resize_uninterpreted_option(google_protobuf_OneofOptions* msg, size_t size, upb_Arena* arena) {
10229   upb_MiniTableField field = {999, UPB_SIZE(16, 24), 0, 1, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
10230   return (google_protobuf_UninterpretedOption**)upb_Message_ResizeArrayUninitialized(UPB_UPCAST(msg),
10231                                                    &field, size, arena);
10232 }
google_protobuf_OneofOptions_add_uninterpreted_option(google_protobuf_OneofOptions * msg,upb_Arena * arena)10233 UPB_INLINE struct google_protobuf_UninterpretedOption* google_protobuf_OneofOptions_add_uninterpreted_option(google_protobuf_OneofOptions* msg, upb_Arena* arena) {
10234   upb_MiniTableField field = {999, UPB_SIZE(16, 24), 0, 1, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
10235   UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__UninterpretedOption_msg_init);
10236   upb_Array* arr = upb_Message_GetOrCreateMutableArray(
10237       UPB_UPCAST(msg), &field, arena);
10238   if (!arr || !UPB_PRIVATE(_upb_Array_ResizeUninitialized)(
10239                   arr, arr->UPB_PRIVATE(size) + 1, arena)) {
10240     return NULL;
10241   }
10242   struct google_protobuf_UninterpretedOption* sub = (struct google_protobuf_UninterpretedOption*)_upb_Message_New(&google__protobuf__UninterpretedOption_msg_init, arena);
10243   if (!arr || !sub) return NULL;
10244   UPB_PRIVATE(_upb_Array_Set)
10245   (arr, arr->UPB_PRIVATE(size) - 1, &sub, sizeof(sub));
10246   return sub;
10247 }
10248 
10249 /* google.protobuf.EnumOptions */
10250 
google_protobuf_EnumOptions_new(upb_Arena * arena)10251 UPB_INLINE google_protobuf_EnumOptions* google_protobuf_EnumOptions_new(upb_Arena* arena) {
10252   return (google_protobuf_EnumOptions*)_upb_Message_New(&google__protobuf__EnumOptions_msg_init, arena);
10253 }
google_protobuf_EnumOptions_parse(const char * buf,size_t size,upb_Arena * arena)10254 UPB_INLINE google_protobuf_EnumOptions* google_protobuf_EnumOptions_parse(const char* buf, size_t size, upb_Arena* arena) {
10255   google_protobuf_EnumOptions* ret = google_protobuf_EnumOptions_new(arena);
10256   if (!ret) return NULL;
10257   if (upb_Decode(buf, size, UPB_UPCAST(ret), &google__protobuf__EnumOptions_msg_init, NULL, 0, arena) !=
10258       kUpb_DecodeStatus_Ok) {
10259     return NULL;
10260   }
10261   return ret;
10262 }
google_protobuf_EnumOptions_parse_ex(const char * buf,size_t size,const upb_ExtensionRegistry * extreg,int options,upb_Arena * arena)10263 UPB_INLINE google_protobuf_EnumOptions* google_protobuf_EnumOptions_parse_ex(const char* buf, size_t size,
10264                            const upb_ExtensionRegistry* extreg,
10265                            int options, upb_Arena* arena) {
10266   google_protobuf_EnumOptions* ret = google_protobuf_EnumOptions_new(arena);
10267   if (!ret) return NULL;
10268   if (upb_Decode(buf, size, UPB_UPCAST(ret), &google__protobuf__EnumOptions_msg_init, extreg, options,
10269                  arena) != kUpb_DecodeStatus_Ok) {
10270     return NULL;
10271   }
10272   return ret;
10273 }
google_protobuf_EnumOptions_serialize(const google_protobuf_EnumOptions * msg,upb_Arena * arena,size_t * len)10274 UPB_INLINE char* google_protobuf_EnumOptions_serialize(const google_protobuf_EnumOptions* msg, upb_Arena* arena, size_t* len) {
10275   char* ptr;
10276   (void)upb_Encode(UPB_UPCAST(msg), &google__protobuf__EnumOptions_msg_init, 0, arena, &ptr, len);
10277   return ptr;
10278 }
google_protobuf_EnumOptions_serialize_ex(const google_protobuf_EnumOptions * msg,int options,upb_Arena * arena,size_t * len)10279 UPB_INLINE char* google_protobuf_EnumOptions_serialize_ex(const google_protobuf_EnumOptions* msg, int options,
10280                                  upb_Arena* arena, size_t* len) {
10281   char* ptr;
10282   (void)upb_Encode(UPB_UPCAST(msg), &google__protobuf__EnumOptions_msg_init, options, arena, &ptr, len);
10283   return ptr;
10284 }
google_protobuf_EnumOptions_clear_allow_alias(google_protobuf_EnumOptions * msg)10285 UPB_INLINE void google_protobuf_EnumOptions_clear_allow_alias(google_protobuf_EnumOptions* msg) {
10286   const upb_MiniTableField field = {2, 9, 64, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
10287   upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
10288 }
google_protobuf_EnumOptions_allow_alias(const google_protobuf_EnumOptions * msg)10289 UPB_INLINE bool google_protobuf_EnumOptions_allow_alias(const google_protobuf_EnumOptions* msg) {
10290   bool default_val = false;
10291   bool ret;
10292   const upb_MiniTableField field = {2, 9, 64, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
10293   _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field,
10294                                     &default_val, &ret);
10295   return ret;
10296 }
google_protobuf_EnumOptions_has_allow_alias(const google_protobuf_EnumOptions * msg)10297 UPB_INLINE bool google_protobuf_EnumOptions_has_allow_alias(const google_protobuf_EnumOptions* msg) {
10298   const upb_MiniTableField field = {2, 9, 64, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
10299   return upb_Message_HasBaseField(UPB_UPCAST(msg), &field);
10300 }
google_protobuf_EnumOptions_clear_deprecated(google_protobuf_EnumOptions * msg)10301 UPB_INLINE void google_protobuf_EnumOptions_clear_deprecated(google_protobuf_EnumOptions* msg) {
10302   const upb_MiniTableField field = {3, 10, 65, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
10303   upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
10304 }
google_protobuf_EnumOptions_deprecated(const google_protobuf_EnumOptions * msg)10305 UPB_INLINE bool google_protobuf_EnumOptions_deprecated(const google_protobuf_EnumOptions* msg) {
10306   bool default_val = false;
10307   bool ret;
10308   const upb_MiniTableField field = {3, 10, 65, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
10309   _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field,
10310                                     &default_val, &ret);
10311   return ret;
10312 }
google_protobuf_EnumOptions_has_deprecated(const google_protobuf_EnumOptions * msg)10313 UPB_INLINE bool google_protobuf_EnumOptions_has_deprecated(const google_protobuf_EnumOptions* msg) {
10314   const upb_MiniTableField field = {3, 10, 65, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
10315   return upb_Message_HasBaseField(UPB_UPCAST(msg), &field);
10316 }
google_protobuf_EnumOptions_clear_deprecated_legacy_json_field_conflicts(google_protobuf_EnumOptions * msg)10317 UPB_INLINE void google_protobuf_EnumOptions_clear_deprecated_legacy_json_field_conflicts(google_protobuf_EnumOptions* msg) {
10318   const upb_MiniTableField field = {6, 11, 66, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
10319   upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
10320 }
google_protobuf_EnumOptions_deprecated_legacy_json_field_conflicts(const google_protobuf_EnumOptions * msg)10321 UPB_INLINE bool google_protobuf_EnumOptions_deprecated_legacy_json_field_conflicts(const google_protobuf_EnumOptions* msg) {
10322   bool default_val = false;
10323   bool ret;
10324   const upb_MiniTableField field = {6, 11, 66, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
10325   _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field,
10326                                     &default_val, &ret);
10327   return ret;
10328 }
google_protobuf_EnumOptions_has_deprecated_legacy_json_field_conflicts(const google_protobuf_EnumOptions * msg)10329 UPB_INLINE bool google_protobuf_EnumOptions_has_deprecated_legacy_json_field_conflicts(const google_protobuf_EnumOptions* msg) {
10330   const upb_MiniTableField field = {6, 11, 66, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
10331   return upb_Message_HasBaseField(UPB_UPCAST(msg), &field);
10332 }
google_protobuf_EnumOptions_clear_features(google_protobuf_EnumOptions * msg)10333 UPB_INLINE void google_protobuf_EnumOptions_clear_features(google_protobuf_EnumOptions* msg) {
10334   const upb_MiniTableField field = {7, UPB_SIZE(12, 16), 67, 0, 11, (int)kUpb_FieldMode_Scalar | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
10335   upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
10336 }
google_protobuf_EnumOptions_features(const google_protobuf_EnumOptions * msg)10337 UPB_INLINE const google_protobuf_FeatureSet* google_protobuf_EnumOptions_features(const google_protobuf_EnumOptions* msg) {
10338   const google_protobuf_FeatureSet* default_val = NULL;
10339   const google_protobuf_FeatureSet* ret;
10340   const upb_MiniTableField field = {7, UPB_SIZE(12, 16), 67, 0, 11, (int)kUpb_FieldMode_Scalar | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
10341   UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__FeatureSet_msg_init);
10342   _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field,
10343                                     &default_val, &ret);
10344   return ret;
10345 }
google_protobuf_EnumOptions_has_features(const google_protobuf_EnumOptions * msg)10346 UPB_INLINE bool google_protobuf_EnumOptions_has_features(const google_protobuf_EnumOptions* msg) {
10347   const upb_MiniTableField field = {7, UPB_SIZE(12, 16), 67, 0, 11, (int)kUpb_FieldMode_Scalar | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
10348   return upb_Message_HasBaseField(UPB_UPCAST(msg), &field);
10349 }
google_protobuf_EnumOptions_clear_uninterpreted_option(google_protobuf_EnumOptions * msg)10350 UPB_INLINE void google_protobuf_EnumOptions_clear_uninterpreted_option(google_protobuf_EnumOptions* msg) {
10351   const upb_MiniTableField field = {999, UPB_SIZE(16, 24), 0, 1, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
10352   upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
10353 }
google_protobuf_EnumOptions_uninterpreted_option(const google_protobuf_EnumOptions * msg,size_t * size)10354 UPB_INLINE const google_protobuf_UninterpretedOption* const* google_protobuf_EnumOptions_uninterpreted_option(const google_protobuf_EnumOptions* msg, size_t* size) {
10355   const upb_MiniTableField field = {999, UPB_SIZE(16, 24), 0, 1, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
10356   UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__UninterpretedOption_msg_init);
10357   const upb_Array* arr = upb_Message_GetArray(UPB_UPCAST(msg), &field);
10358   if (arr) {
10359     if (size) *size = arr->UPB_PRIVATE(size);
10360     return (const google_protobuf_UninterpretedOption* const*)upb_Array_DataPtr(arr);
10361   } else {
10362     if (size) *size = 0;
10363     return NULL;
10364   }
10365 }
_google_protobuf_EnumOptions_uninterpreted_option_upb_array(const google_protobuf_EnumOptions * msg,size_t * size)10366 UPB_INLINE const upb_Array* _google_protobuf_EnumOptions_uninterpreted_option_upb_array(const google_protobuf_EnumOptions* msg, size_t* size) {
10367   const upb_MiniTableField field = {999, UPB_SIZE(16, 24), 0, 1, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
10368   UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__UninterpretedOption_msg_init);
10369   const upb_Array* arr = upb_Message_GetArray(UPB_UPCAST(msg), &field);
10370   if (size) {
10371     *size = arr ? arr->UPB_PRIVATE(size) : 0;
10372   }
10373   return arr;
10374 }
_google_protobuf_EnumOptions_uninterpreted_option_mutable_upb_array(google_protobuf_EnumOptions * msg,size_t * size,upb_Arena * arena)10375 UPB_INLINE upb_Array* _google_protobuf_EnumOptions_uninterpreted_option_mutable_upb_array(google_protobuf_EnumOptions* msg, size_t* size, upb_Arena* arena) {
10376   const upb_MiniTableField field = {999, UPB_SIZE(16, 24), 0, 1, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
10377   UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__UninterpretedOption_msg_init);
10378   upb_Array* arr = upb_Message_GetOrCreateMutableArray(UPB_UPCAST(msg),
10379                                                        &field, arena);
10380   if (size) {
10381     *size = arr ? arr->UPB_PRIVATE(size) : 0;
10382   }
10383   return arr;
10384 }
10385 
google_protobuf_EnumOptions_set_allow_alias(google_protobuf_EnumOptions * msg,bool value)10386 UPB_INLINE void google_protobuf_EnumOptions_set_allow_alias(google_protobuf_EnumOptions *msg, bool value) {
10387   const upb_MiniTableField field = {2, 9, 64, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
10388   upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
10389 }
google_protobuf_EnumOptions_set_deprecated(google_protobuf_EnumOptions * msg,bool value)10390 UPB_INLINE void google_protobuf_EnumOptions_set_deprecated(google_protobuf_EnumOptions *msg, bool value) {
10391   const upb_MiniTableField field = {3, 10, 65, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
10392   upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
10393 }
google_protobuf_EnumOptions_set_deprecated_legacy_json_field_conflicts(google_protobuf_EnumOptions * msg,bool value)10394 UPB_INLINE void google_protobuf_EnumOptions_set_deprecated_legacy_json_field_conflicts(google_protobuf_EnumOptions *msg, bool value) {
10395   const upb_MiniTableField field = {6, 11, 66, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
10396   upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
10397 }
google_protobuf_EnumOptions_set_features(google_protobuf_EnumOptions * msg,google_protobuf_FeatureSet * value)10398 UPB_INLINE void google_protobuf_EnumOptions_set_features(google_protobuf_EnumOptions *msg, google_protobuf_FeatureSet* value) {
10399   const upb_MiniTableField field = {7, UPB_SIZE(12, 16), 67, 0, 11, (int)kUpb_FieldMode_Scalar | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
10400   UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__FeatureSet_msg_init);
10401   upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
10402 }
google_protobuf_EnumOptions_mutable_features(google_protobuf_EnumOptions * msg,upb_Arena * arena)10403 UPB_INLINE struct google_protobuf_FeatureSet* google_protobuf_EnumOptions_mutable_features(google_protobuf_EnumOptions* msg, upb_Arena* arena) {
10404   struct google_protobuf_FeatureSet* sub = (struct google_protobuf_FeatureSet*)google_protobuf_EnumOptions_features(msg);
10405   if (sub == NULL) {
10406     sub = (struct google_protobuf_FeatureSet*)_upb_Message_New(&google__protobuf__FeatureSet_msg_init, arena);
10407     if (sub) google_protobuf_EnumOptions_set_features(msg, sub);
10408   }
10409   return sub;
10410 }
google_protobuf_EnumOptions_mutable_uninterpreted_option(google_protobuf_EnumOptions * msg,size_t * size)10411 UPB_INLINE google_protobuf_UninterpretedOption** google_protobuf_EnumOptions_mutable_uninterpreted_option(google_protobuf_EnumOptions* msg, size_t* size) {
10412   upb_MiniTableField field = {999, UPB_SIZE(16, 24), 0, 1, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
10413   UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__UninterpretedOption_msg_init);
10414   upb_Array* arr = upb_Message_GetMutableArray(UPB_UPCAST(msg), &field);
10415   if (arr) {
10416     if (size) *size = arr->UPB_PRIVATE(size);
10417     return (google_protobuf_UninterpretedOption**)upb_Array_MutableDataPtr(arr);
10418   } else {
10419     if (size) *size = 0;
10420     return NULL;
10421   }
10422 }
google_protobuf_EnumOptions_resize_uninterpreted_option(google_protobuf_EnumOptions * msg,size_t size,upb_Arena * arena)10423 UPB_INLINE google_protobuf_UninterpretedOption** google_protobuf_EnumOptions_resize_uninterpreted_option(google_protobuf_EnumOptions* msg, size_t size, upb_Arena* arena) {
10424   upb_MiniTableField field = {999, UPB_SIZE(16, 24), 0, 1, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
10425   return (google_protobuf_UninterpretedOption**)upb_Message_ResizeArrayUninitialized(UPB_UPCAST(msg),
10426                                                    &field, size, arena);
10427 }
google_protobuf_EnumOptions_add_uninterpreted_option(google_protobuf_EnumOptions * msg,upb_Arena * arena)10428 UPB_INLINE struct google_protobuf_UninterpretedOption* google_protobuf_EnumOptions_add_uninterpreted_option(google_protobuf_EnumOptions* msg, upb_Arena* arena) {
10429   upb_MiniTableField field = {999, UPB_SIZE(16, 24), 0, 1, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
10430   UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__UninterpretedOption_msg_init);
10431   upb_Array* arr = upb_Message_GetOrCreateMutableArray(
10432       UPB_UPCAST(msg), &field, arena);
10433   if (!arr || !UPB_PRIVATE(_upb_Array_ResizeUninitialized)(
10434                   arr, arr->UPB_PRIVATE(size) + 1, arena)) {
10435     return NULL;
10436   }
10437   struct google_protobuf_UninterpretedOption* sub = (struct google_protobuf_UninterpretedOption*)_upb_Message_New(&google__protobuf__UninterpretedOption_msg_init, arena);
10438   if (!arr || !sub) return NULL;
10439   UPB_PRIVATE(_upb_Array_Set)
10440   (arr, arr->UPB_PRIVATE(size) - 1, &sub, sizeof(sub));
10441   return sub;
10442 }
10443 
10444 /* google.protobuf.EnumValueOptions */
10445 
google_protobuf_EnumValueOptions_new(upb_Arena * arena)10446 UPB_INLINE google_protobuf_EnumValueOptions* google_protobuf_EnumValueOptions_new(upb_Arena* arena) {
10447   return (google_protobuf_EnumValueOptions*)_upb_Message_New(&google__protobuf__EnumValueOptions_msg_init, arena);
10448 }
google_protobuf_EnumValueOptions_parse(const char * buf,size_t size,upb_Arena * arena)10449 UPB_INLINE google_protobuf_EnumValueOptions* google_protobuf_EnumValueOptions_parse(const char* buf, size_t size, upb_Arena* arena) {
10450   google_protobuf_EnumValueOptions* ret = google_protobuf_EnumValueOptions_new(arena);
10451   if (!ret) return NULL;
10452   if (upb_Decode(buf, size, UPB_UPCAST(ret), &google__protobuf__EnumValueOptions_msg_init, NULL, 0, arena) !=
10453       kUpb_DecodeStatus_Ok) {
10454     return NULL;
10455   }
10456   return ret;
10457 }
google_protobuf_EnumValueOptions_parse_ex(const char * buf,size_t size,const upb_ExtensionRegistry * extreg,int options,upb_Arena * arena)10458 UPB_INLINE google_protobuf_EnumValueOptions* google_protobuf_EnumValueOptions_parse_ex(const char* buf, size_t size,
10459                            const upb_ExtensionRegistry* extreg,
10460                            int options, upb_Arena* arena) {
10461   google_protobuf_EnumValueOptions* ret = google_protobuf_EnumValueOptions_new(arena);
10462   if (!ret) return NULL;
10463   if (upb_Decode(buf, size, UPB_UPCAST(ret), &google__protobuf__EnumValueOptions_msg_init, extreg, options,
10464                  arena) != kUpb_DecodeStatus_Ok) {
10465     return NULL;
10466   }
10467   return ret;
10468 }
google_protobuf_EnumValueOptions_serialize(const google_protobuf_EnumValueOptions * msg,upb_Arena * arena,size_t * len)10469 UPB_INLINE char* google_protobuf_EnumValueOptions_serialize(const google_protobuf_EnumValueOptions* msg, upb_Arena* arena, size_t* len) {
10470   char* ptr;
10471   (void)upb_Encode(UPB_UPCAST(msg), &google__protobuf__EnumValueOptions_msg_init, 0, arena, &ptr, len);
10472   return ptr;
10473 }
google_protobuf_EnumValueOptions_serialize_ex(const google_protobuf_EnumValueOptions * msg,int options,upb_Arena * arena,size_t * len)10474 UPB_INLINE char* google_protobuf_EnumValueOptions_serialize_ex(const google_protobuf_EnumValueOptions* msg, int options,
10475                                  upb_Arena* arena, size_t* len) {
10476   char* ptr;
10477   (void)upb_Encode(UPB_UPCAST(msg), &google__protobuf__EnumValueOptions_msg_init, options, arena, &ptr, len);
10478   return ptr;
10479 }
google_protobuf_EnumValueOptions_clear_deprecated(google_protobuf_EnumValueOptions * msg)10480 UPB_INLINE void google_protobuf_EnumValueOptions_clear_deprecated(google_protobuf_EnumValueOptions* msg) {
10481   const upb_MiniTableField field = {1, 9, 64, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
10482   upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
10483 }
google_protobuf_EnumValueOptions_deprecated(const google_protobuf_EnumValueOptions * msg)10484 UPB_INLINE bool google_protobuf_EnumValueOptions_deprecated(const google_protobuf_EnumValueOptions* msg) {
10485   bool default_val = false;
10486   bool ret;
10487   const upb_MiniTableField field = {1, 9, 64, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
10488   _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field,
10489                                     &default_val, &ret);
10490   return ret;
10491 }
google_protobuf_EnumValueOptions_has_deprecated(const google_protobuf_EnumValueOptions * msg)10492 UPB_INLINE bool google_protobuf_EnumValueOptions_has_deprecated(const google_protobuf_EnumValueOptions* msg) {
10493   const upb_MiniTableField field = {1, 9, 64, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
10494   return upb_Message_HasBaseField(UPB_UPCAST(msg), &field);
10495 }
google_protobuf_EnumValueOptions_clear_features(google_protobuf_EnumValueOptions * msg)10496 UPB_INLINE void google_protobuf_EnumValueOptions_clear_features(google_protobuf_EnumValueOptions* msg) {
10497   const upb_MiniTableField field = {2, UPB_SIZE(12, 16), 65, 0, 11, (int)kUpb_FieldMode_Scalar | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
10498   upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
10499 }
google_protobuf_EnumValueOptions_features(const google_protobuf_EnumValueOptions * msg)10500 UPB_INLINE const google_protobuf_FeatureSet* google_protobuf_EnumValueOptions_features(const google_protobuf_EnumValueOptions* msg) {
10501   const google_protobuf_FeatureSet* default_val = NULL;
10502   const google_protobuf_FeatureSet* ret;
10503   const upb_MiniTableField field = {2, UPB_SIZE(12, 16), 65, 0, 11, (int)kUpb_FieldMode_Scalar | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
10504   UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__FeatureSet_msg_init);
10505   _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field,
10506                                     &default_val, &ret);
10507   return ret;
10508 }
google_protobuf_EnumValueOptions_has_features(const google_protobuf_EnumValueOptions * msg)10509 UPB_INLINE bool google_protobuf_EnumValueOptions_has_features(const google_protobuf_EnumValueOptions* msg) {
10510   const upb_MiniTableField field = {2, UPB_SIZE(12, 16), 65, 0, 11, (int)kUpb_FieldMode_Scalar | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
10511   return upb_Message_HasBaseField(UPB_UPCAST(msg), &field);
10512 }
google_protobuf_EnumValueOptions_clear_debug_redact(google_protobuf_EnumValueOptions * msg)10513 UPB_INLINE void google_protobuf_EnumValueOptions_clear_debug_redact(google_protobuf_EnumValueOptions* msg) {
10514   const upb_MiniTableField field = {3, UPB_SIZE(16, 10), 66, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
10515   upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
10516 }
google_protobuf_EnumValueOptions_debug_redact(const google_protobuf_EnumValueOptions * msg)10517 UPB_INLINE bool google_protobuf_EnumValueOptions_debug_redact(const google_protobuf_EnumValueOptions* msg) {
10518   bool default_val = false;
10519   bool ret;
10520   const upb_MiniTableField field = {3, UPB_SIZE(16, 10), 66, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
10521   _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field,
10522                                     &default_val, &ret);
10523   return ret;
10524 }
google_protobuf_EnumValueOptions_has_debug_redact(const google_protobuf_EnumValueOptions * msg)10525 UPB_INLINE bool google_protobuf_EnumValueOptions_has_debug_redact(const google_protobuf_EnumValueOptions* msg) {
10526   const upb_MiniTableField field = {3, UPB_SIZE(16, 10), 66, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
10527   return upb_Message_HasBaseField(UPB_UPCAST(msg), &field);
10528 }
google_protobuf_EnumValueOptions_clear_feature_support(google_protobuf_EnumValueOptions * msg)10529 UPB_INLINE void google_protobuf_EnumValueOptions_clear_feature_support(google_protobuf_EnumValueOptions* msg) {
10530   const upb_MiniTableField field = {4, UPB_SIZE(20, 24), 67, 1, 11, (int)kUpb_FieldMode_Scalar | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
10531   upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
10532 }
google_protobuf_EnumValueOptions_feature_support(const google_protobuf_EnumValueOptions * msg)10533 UPB_INLINE const google_protobuf_FieldOptions_FeatureSupport* google_protobuf_EnumValueOptions_feature_support(const google_protobuf_EnumValueOptions* msg) {
10534   const google_protobuf_FieldOptions_FeatureSupport* default_val = NULL;
10535   const google_protobuf_FieldOptions_FeatureSupport* ret;
10536   const upb_MiniTableField field = {4, UPB_SIZE(20, 24), 67, 1, 11, (int)kUpb_FieldMode_Scalar | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
10537   UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__FieldOptions__FeatureSupport_msg_init);
10538   _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field,
10539                                     &default_val, &ret);
10540   return ret;
10541 }
google_protobuf_EnumValueOptions_has_feature_support(const google_protobuf_EnumValueOptions * msg)10542 UPB_INLINE bool google_protobuf_EnumValueOptions_has_feature_support(const google_protobuf_EnumValueOptions* msg) {
10543   const upb_MiniTableField field = {4, UPB_SIZE(20, 24), 67, 1, 11, (int)kUpb_FieldMode_Scalar | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
10544   return upb_Message_HasBaseField(UPB_UPCAST(msg), &field);
10545 }
google_protobuf_EnumValueOptions_clear_uninterpreted_option(google_protobuf_EnumValueOptions * msg)10546 UPB_INLINE void google_protobuf_EnumValueOptions_clear_uninterpreted_option(google_protobuf_EnumValueOptions* msg) {
10547   const upb_MiniTableField field = {999, UPB_SIZE(24, 32), 0, 2, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
10548   upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
10549 }
google_protobuf_EnumValueOptions_uninterpreted_option(const google_protobuf_EnumValueOptions * msg,size_t * size)10550 UPB_INLINE const google_protobuf_UninterpretedOption* const* google_protobuf_EnumValueOptions_uninterpreted_option(const google_protobuf_EnumValueOptions* msg, size_t* size) {
10551   const upb_MiniTableField field = {999, UPB_SIZE(24, 32), 0, 2, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
10552   UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__UninterpretedOption_msg_init);
10553   const upb_Array* arr = upb_Message_GetArray(UPB_UPCAST(msg), &field);
10554   if (arr) {
10555     if (size) *size = arr->UPB_PRIVATE(size);
10556     return (const google_protobuf_UninterpretedOption* const*)upb_Array_DataPtr(arr);
10557   } else {
10558     if (size) *size = 0;
10559     return NULL;
10560   }
10561 }
_google_protobuf_EnumValueOptions_uninterpreted_option_upb_array(const google_protobuf_EnumValueOptions * msg,size_t * size)10562 UPB_INLINE const upb_Array* _google_protobuf_EnumValueOptions_uninterpreted_option_upb_array(const google_protobuf_EnumValueOptions* msg, size_t* size) {
10563   const upb_MiniTableField field = {999, UPB_SIZE(24, 32), 0, 2, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
10564   UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__UninterpretedOption_msg_init);
10565   const upb_Array* arr = upb_Message_GetArray(UPB_UPCAST(msg), &field);
10566   if (size) {
10567     *size = arr ? arr->UPB_PRIVATE(size) : 0;
10568   }
10569   return arr;
10570 }
_google_protobuf_EnumValueOptions_uninterpreted_option_mutable_upb_array(google_protobuf_EnumValueOptions * msg,size_t * size,upb_Arena * arena)10571 UPB_INLINE upb_Array* _google_protobuf_EnumValueOptions_uninterpreted_option_mutable_upb_array(google_protobuf_EnumValueOptions* msg, size_t* size, upb_Arena* arena) {
10572   const upb_MiniTableField field = {999, UPB_SIZE(24, 32), 0, 2, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
10573   UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__UninterpretedOption_msg_init);
10574   upb_Array* arr = upb_Message_GetOrCreateMutableArray(UPB_UPCAST(msg),
10575                                                        &field, arena);
10576   if (size) {
10577     *size = arr ? arr->UPB_PRIVATE(size) : 0;
10578   }
10579   return arr;
10580 }
10581 
google_protobuf_EnumValueOptions_set_deprecated(google_protobuf_EnumValueOptions * msg,bool value)10582 UPB_INLINE void google_protobuf_EnumValueOptions_set_deprecated(google_protobuf_EnumValueOptions *msg, bool value) {
10583   const upb_MiniTableField field = {1, 9, 64, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
10584   upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
10585 }
google_protobuf_EnumValueOptions_set_features(google_protobuf_EnumValueOptions * msg,google_protobuf_FeatureSet * value)10586 UPB_INLINE void google_protobuf_EnumValueOptions_set_features(google_protobuf_EnumValueOptions *msg, google_protobuf_FeatureSet* value) {
10587   const upb_MiniTableField field = {2, UPB_SIZE(12, 16), 65, 0, 11, (int)kUpb_FieldMode_Scalar | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
10588   UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__FeatureSet_msg_init);
10589   upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
10590 }
google_protobuf_EnumValueOptions_mutable_features(google_protobuf_EnumValueOptions * msg,upb_Arena * arena)10591 UPB_INLINE struct google_protobuf_FeatureSet* google_protobuf_EnumValueOptions_mutable_features(google_protobuf_EnumValueOptions* msg, upb_Arena* arena) {
10592   struct google_protobuf_FeatureSet* sub = (struct google_protobuf_FeatureSet*)google_protobuf_EnumValueOptions_features(msg);
10593   if (sub == NULL) {
10594     sub = (struct google_protobuf_FeatureSet*)_upb_Message_New(&google__protobuf__FeatureSet_msg_init, arena);
10595     if (sub) google_protobuf_EnumValueOptions_set_features(msg, sub);
10596   }
10597   return sub;
10598 }
google_protobuf_EnumValueOptions_set_debug_redact(google_protobuf_EnumValueOptions * msg,bool value)10599 UPB_INLINE void google_protobuf_EnumValueOptions_set_debug_redact(google_protobuf_EnumValueOptions *msg, bool value) {
10600   const upb_MiniTableField field = {3, UPB_SIZE(16, 10), 66, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
10601   upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
10602 }
google_protobuf_EnumValueOptions_set_feature_support(google_protobuf_EnumValueOptions * msg,google_protobuf_FieldOptions_FeatureSupport * value)10603 UPB_INLINE void google_protobuf_EnumValueOptions_set_feature_support(google_protobuf_EnumValueOptions *msg, google_protobuf_FieldOptions_FeatureSupport* value) {
10604   const upb_MiniTableField field = {4, UPB_SIZE(20, 24), 67, 1, 11, (int)kUpb_FieldMode_Scalar | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
10605   UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__FieldOptions__FeatureSupport_msg_init);
10606   upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
10607 }
google_protobuf_EnumValueOptions_mutable_feature_support(google_protobuf_EnumValueOptions * msg,upb_Arena * arena)10608 UPB_INLINE struct google_protobuf_FieldOptions_FeatureSupport* google_protobuf_EnumValueOptions_mutable_feature_support(google_protobuf_EnumValueOptions* msg, upb_Arena* arena) {
10609   struct google_protobuf_FieldOptions_FeatureSupport* sub = (struct google_protobuf_FieldOptions_FeatureSupport*)google_protobuf_EnumValueOptions_feature_support(msg);
10610   if (sub == NULL) {
10611     sub = (struct google_protobuf_FieldOptions_FeatureSupport*)_upb_Message_New(&google__protobuf__FieldOptions__FeatureSupport_msg_init, arena);
10612     if (sub) google_protobuf_EnumValueOptions_set_feature_support(msg, sub);
10613   }
10614   return sub;
10615 }
google_protobuf_EnumValueOptions_mutable_uninterpreted_option(google_protobuf_EnumValueOptions * msg,size_t * size)10616 UPB_INLINE google_protobuf_UninterpretedOption** google_protobuf_EnumValueOptions_mutable_uninterpreted_option(google_protobuf_EnumValueOptions* msg, size_t* size) {
10617   upb_MiniTableField field = {999, UPB_SIZE(24, 32), 0, 2, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
10618   UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__UninterpretedOption_msg_init);
10619   upb_Array* arr = upb_Message_GetMutableArray(UPB_UPCAST(msg), &field);
10620   if (arr) {
10621     if (size) *size = arr->UPB_PRIVATE(size);
10622     return (google_protobuf_UninterpretedOption**)upb_Array_MutableDataPtr(arr);
10623   } else {
10624     if (size) *size = 0;
10625     return NULL;
10626   }
10627 }
google_protobuf_EnumValueOptions_resize_uninterpreted_option(google_protobuf_EnumValueOptions * msg,size_t size,upb_Arena * arena)10628 UPB_INLINE google_protobuf_UninterpretedOption** google_protobuf_EnumValueOptions_resize_uninterpreted_option(google_protobuf_EnumValueOptions* msg, size_t size, upb_Arena* arena) {
10629   upb_MiniTableField field = {999, UPB_SIZE(24, 32), 0, 2, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
10630   return (google_protobuf_UninterpretedOption**)upb_Message_ResizeArrayUninitialized(UPB_UPCAST(msg),
10631                                                    &field, size, arena);
10632 }
google_protobuf_EnumValueOptions_add_uninterpreted_option(google_protobuf_EnumValueOptions * msg,upb_Arena * arena)10633 UPB_INLINE struct google_protobuf_UninterpretedOption* google_protobuf_EnumValueOptions_add_uninterpreted_option(google_protobuf_EnumValueOptions* msg, upb_Arena* arena) {
10634   upb_MiniTableField field = {999, UPB_SIZE(24, 32), 0, 2, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
10635   UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__UninterpretedOption_msg_init);
10636   upb_Array* arr = upb_Message_GetOrCreateMutableArray(
10637       UPB_UPCAST(msg), &field, arena);
10638   if (!arr || !UPB_PRIVATE(_upb_Array_ResizeUninitialized)(
10639                   arr, arr->UPB_PRIVATE(size) + 1, arena)) {
10640     return NULL;
10641   }
10642   struct google_protobuf_UninterpretedOption* sub = (struct google_protobuf_UninterpretedOption*)_upb_Message_New(&google__protobuf__UninterpretedOption_msg_init, arena);
10643   if (!arr || !sub) return NULL;
10644   UPB_PRIVATE(_upb_Array_Set)
10645   (arr, arr->UPB_PRIVATE(size) - 1, &sub, sizeof(sub));
10646   return sub;
10647 }
10648 
10649 /* google.protobuf.ServiceOptions */
10650 
google_protobuf_ServiceOptions_new(upb_Arena * arena)10651 UPB_INLINE google_protobuf_ServiceOptions* google_protobuf_ServiceOptions_new(upb_Arena* arena) {
10652   return (google_protobuf_ServiceOptions*)_upb_Message_New(&google__protobuf__ServiceOptions_msg_init, arena);
10653 }
google_protobuf_ServiceOptions_parse(const char * buf,size_t size,upb_Arena * arena)10654 UPB_INLINE google_protobuf_ServiceOptions* google_protobuf_ServiceOptions_parse(const char* buf, size_t size, upb_Arena* arena) {
10655   google_protobuf_ServiceOptions* ret = google_protobuf_ServiceOptions_new(arena);
10656   if (!ret) return NULL;
10657   if (upb_Decode(buf, size, UPB_UPCAST(ret), &google__protobuf__ServiceOptions_msg_init, NULL, 0, arena) !=
10658       kUpb_DecodeStatus_Ok) {
10659     return NULL;
10660   }
10661   return ret;
10662 }
google_protobuf_ServiceOptions_parse_ex(const char * buf,size_t size,const upb_ExtensionRegistry * extreg,int options,upb_Arena * arena)10663 UPB_INLINE google_protobuf_ServiceOptions* google_protobuf_ServiceOptions_parse_ex(const char* buf, size_t size,
10664                            const upb_ExtensionRegistry* extreg,
10665                            int options, upb_Arena* arena) {
10666   google_protobuf_ServiceOptions* ret = google_protobuf_ServiceOptions_new(arena);
10667   if (!ret) return NULL;
10668   if (upb_Decode(buf, size, UPB_UPCAST(ret), &google__protobuf__ServiceOptions_msg_init, extreg, options,
10669                  arena) != kUpb_DecodeStatus_Ok) {
10670     return NULL;
10671   }
10672   return ret;
10673 }
google_protobuf_ServiceOptions_serialize(const google_protobuf_ServiceOptions * msg,upb_Arena * arena,size_t * len)10674 UPB_INLINE char* google_protobuf_ServiceOptions_serialize(const google_protobuf_ServiceOptions* msg, upb_Arena* arena, size_t* len) {
10675   char* ptr;
10676   (void)upb_Encode(UPB_UPCAST(msg), &google__protobuf__ServiceOptions_msg_init, 0, arena, &ptr, len);
10677   return ptr;
10678 }
google_protobuf_ServiceOptions_serialize_ex(const google_protobuf_ServiceOptions * msg,int options,upb_Arena * arena,size_t * len)10679 UPB_INLINE char* google_protobuf_ServiceOptions_serialize_ex(const google_protobuf_ServiceOptions* msg, int options,
10680                                  upb_Arena* arena, size_t* len) {
10681   char* ptr;
10682   (void)upb_Encode(UPB_UPCAST(msg), &google__protobuf__ServiceOptions_msg_init, options, arena, &ptr, len);
10683   return ptr;
10684 }
google_protobuf_ServiceOptions_clear_deprecated(google_protobuf_ServiceOptions * msg)10685 UPB_INLINE void google_protobuf_ServiceOptions_clear_deprecated(google_protobuf_ServiceOptions* msg) {
10686   const upb_MiniTableField field = {33, 9, 64, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
10687   upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
10688 }
google_protobuf_ServiceOptions_deprecated(const google_protobuf_ServiceOptions * msg)10689 UPB_INLINE bool google_protobuf_ServiceOptions_deprecated(const google_protobuf_ServiceOptions* msg) {
10690   bool default_val = false;
10691   bool ret;
10692   const upb_MiniTableField field = {33, 9, 64, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
10693   _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field,
10694                                     &default_val, &ret);
10695   return ret;
10696 }
google_protobuf_ServiceOptions_has_deprecated(const google_protobuf_ServiceOptions * msg)10697 UPB_INLINE bool google_protobuf_ServiceOptions_has_deprecated(const google_protobuf_ServiceOptions* msg) {
10698   const upb_MiniTableField field = {33, 9, 64, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
10699   return upb_Message_HasBaseField(UPB_UPCAST(msg), &field);
10700 }
google_protobuf_ServiceOptions_clear_features(google_protobuf_ServiceOptions * msg)10701 UPB_INLINE void google_protobuf_ServiceOptions_clear_features(google_protobuf_ServiceOptions* msg) {
10702   const upb_MiniTableField field = {34, UPB_SIZE(12, 16), 65, 0, 11, (int)kUpb_FieldMode_Scalar | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
10703   upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
10704 }
google_protobuf_ServiceOptions_features(const google_protobuf_ServiceOptions * msg)10705 UPB_INLINE const google_protobuf_FeatureSet* google_protobuf_ServiceOptions_features(const google_protobuf_ServiceOptions* msg) {
10706   const google_protobuf_FeatureSet* default_val = NULL;
10707   const google_protobuf_FeatureSet* ret;
10708   const upb_MiniTableField field = {34, UPB_SIZE(12, 16), 65, 0, 11, (int)kUpb_FieldMode_Scalar | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
10709   UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__FeatureSet_msg_init);
10710   _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field,
10711                                     &default_val, &ret);
10712   return ret;
10713 }
google_protobuf_ServiceOptions_has_features(const google_protobuf_ServiceOptions * msg)10714 UPB_INLINE bool google_protobuf_ServiceOptions_has_features(const google_protobuf_ServiceOptions* msg) {
10715   const upb_MiniTableField field = {34, UPB_SIZE(12, 16), 65, 0, 11, (int)kUpb_FieldMode_Scalar | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
10716   return upb_Message_HasBaseField(UPB_UPCAST(msg), &field);
10717 }
google_protobuf_ServiceOptions_clear_uninterpreted_option(google_protobuf_ServiceOptions * msg)10718 UPB_INLINE void google_protobuf_ServiceOptions_clear_uninterpreted_option(google_protobuf_ServiceOptions* msg) {
10719   const upb_MiniTableField field = {999, UPB_SIZE(16, 24), 0, 1, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
10720   upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
10721 }
google_protobuf_ServiceOptions_uninterpreted_option(const google_protobuf_ServiceOptions * msg,size_t * size)10722 UPB_INLINE const google_protobuf_UninterpretedOption* const* google_protobuf_ServiceOptions_uninterpreted_option(const google_protobuf_ServiceOptions* msg, size_t* size) {
10723   const upb_MiniTableField field = {999, UPB_SIZE(16, 24), 0, 1, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
10724   UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__UninterpretedOption_msg_init);
10725   const upb_Array* arr = upb_Message_GetArray(UPB_UPCAST(msg), &field);
10726   if (arr) {
10727     if (size) *size = arr->UPB_PRIVATE(size);
10728     return (const google_protobuf_UninterpretedOption* const*)upb_Array_DataPtr(arr);
10729   } else {
10730     if (size) *size = 0;
10731     return NULL;
10732   }
10733 }
_google_protobuf_ServiceOptions_uninterpreted_option_upb_array(const google_protobuf_ServiceOptions * msg,size_t * size)10734 UPB_INLINE const upb_Array* _google_protobuf_ServiceOptions_uninterpreted_option_upb_array(const google_protobuf_ServiceOptions* msg, size_t* size) {
10735   const upb_MiniTableField field = {999, UPB_SIZE(16, 24), 0, 1, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
10736   UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__UninterpretedOption_msg_init);
10737   const upb_Array* arr = upb_Message_GetArray(UPB_UPCAST(msg), &field);
10738   if (size) {
10739     *size = arr ? arr->UPB_PRIVATE(size) : 0;
10740   }
10741   return arr;
10742 }
_google_protobuf_ServiceOptions_uninterpreted_option_mutable_upb_array(google_protobuf_ServiceOptions * msg,size_t * size,upb_Arena * arena)10743 UPB_INLINE upb_Array* _google_protobuf_ServiceOptions_uninterpreted_option_mutable_upb_array(google_protobuf_ServiceOptions* msg, size_t* size, upb_Arena* arena) {
10744   const upb_MiniTableField field = {999, UPB_SIZE(16, 24), 0, 1, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
10745   UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__UninterpretedOption_msg_init);
10746   upb_Array* arr = upb_Message_GetOrCreateMutableArray(UPB_UPCAST(msg),
10747                                                        &field, arena);
10748   if (size) {
10749     *size = arr ? arr->UPB_PRIVATE(size) : 0;
10750   }
10751   return arr;
10752 }
10753 
google_protobuf_ServiceOptions_set_deprecated(google_protobuf_ServiceOptions * msg,bool value)10754 UPB_INLINE void google_protobuf_ServiceOptions_set_deprecated(google_protobuf_ServiceOptions *msg, bool value) {
10755   const upb_MiniTableField field = {33, 9, 64, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
10756   upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
10757 }
google_protobuf_ServiceOptions_set_features(google_protobuf_ServiceOptions * msg,google_protobuf_FeatureSet * value)10758 UPB_INLINE void google_protobuf_ServiceOptions_set_features(google_protobuf_ServiceOptions *msg, google_protobuf_FeatureSet* value) {
10759   const upb_MiniTableField field = {34, UPB_SIZE(12, 16), 65, 0, 11, (int)kUpb_FieldMode_Scalar | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
10760   UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__FeatureSet_msg_init);
10761   upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
10762 }
google_protobuf_ServiceOptions_mutable_features(google_protobuf_ServiceOptions * msg,upb_Arena * arena)10763 UPB_INLINE struct google_protobuf_FeatureSet* google_protobuf_ServiceOptions_mutable_features(google_protobuf_ServiceOptions* msg, upb_Arena* arena) {
10764   struct google_protobuf_FeatureSet* sub = (struct google_protobuf_FeatureSet*)google_protobuf_ServiceOptions_features(msg);
10765   if (sub == NULL) {
10766     sub = (struct google_protobuf_FeatureSet*)_upb_Message_New(&google__protobuf__FeatureSet_msg_init, arena);
10767     if (sub) google_protobuf_ServiceOptions_set_features(msg, sub);
10768   }
10769   return sub;
10770 }
google_protobuf_ServiceOptions_mutable_uninterpreted_option(google_protobuf_ServiceOptions * msg,size_t * size)10771 UPB_INLINE google_protobuf_UninterpretedOption** google_protobuf_ServiceOptions_mutable_uninterpreted_option(google_protobuf_ServiceOptions* msg, size_t* size) {
10772   upb_MiniTableField field = {999, UPB_SIZE(16, 24), 0, 1, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
10773   UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__UninterpretedOption_msg_init);
10774   upb_Array* arr = upb_Message_GetMutableArray(UPB_UPCAST(msg), &field);
10775   if (arr) {
10776     if (size) *size = arr->UPB_PRIVATE(size);
10777     return (google_protobuf_UninterpretedOption**)upb_Array_MutableDataPtr(arr);
10778   } else {
10779     if (size) *size = 0;
10780     return NULL;
10781   }
10782 }
google_protobuf_ServiceOptions_resize_uninterpreted_option(google_protobuf_ServiceOptions * msg,size_t size,upb_Arena * arena)10783 UPB_INLINE google_protobuf_UninterpretedOption** google_protobuf_ServiceOptions_resize_uninterpreted_option(google_protobuf_ServiceOptions* msg, size_t size, upb_Arena* arena) {
10784   upb_MiniTableField field = {999, UPB_SIZE(16, 24), 0, 1, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
10785   return (google_protobuf_UninterpretedOption**)upb_Message_ResizeArrayUninitialized(UPB_UPCAST(msg),
10786                                                    &field, size, arena);
10787 }
google_protobuf_ServiceOptions_add_uninterpreted_option(google_protobuf_ServiceOptions * msg,upb_Arena * arena)10788 UPB_INLINE struct google_protobuf_UninterpretedOption* google_protobuf_ServiceOptions_add_uninterpreted_option(google_protobuf_ServiceOptions* msg, upb_Arena* arena) {
10789   upb_MiniTableField field = {999, UPB_SIZE(16, 24), 0, 1, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
10790   UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__UninterpretedOption_msg_init);
10791   upb_Array* arr = upb_Message_GetOrCreateMutableArray(
10792       UPB_UPCAST(msg), &field, arena);
10793   if (!arr || !UPB_PRIVATE(_upb_Array_ResizeUninitialized)(
10794                   arr, arr->UPB_PRIVATE(size) + 1, arena)) {
10795     return NULL;
10796   }
10797   struct google_protobuf_UninterpretedOption* sub = (struct google_protobuf_UninterpretedOption*)_upb_Message_New(&google__protobuf__UninterpretedOption_msg_init, arena);
10798   if (!arr || !sub) return NULL;
10799   UPB_PRIVATE(_upb_Array_Set)
10800   (arr, arr->UPB_PRIVATE(size) - 1, &sub, sizeof(sub));
10801   return sub;
10802 }
10803 
10804 /* google.protobuf.MethodOptions */
10805 
google_protobuf_MethodOptions_new(upb_Arena * arena)10806 UPB_INLINE google_protobuf_MethodOptions* google_protobuf_MethodOptions_new(upb_Arena* arena) {
10807   return (google_protobuf_MethodOptions*)_upb_Message_New(&google__protobuf__MethodOptions_msg_init, arena);
10808 }
google_protobuf_MethodOptions_parse(const char * buf,size_t size,upb_Arena * arena)10809 UPB_INLINE google_protobuf_MethodOptions* google_protobuf_MethodOptions_parse(const char* buf, size_t size, upb_Arena* arena) {
10810   google_protobuf_MethodOptions* ret = google_protobuf_MethodOptions_new(arena);
10811   if (!ret) return NULL;
10812   if (upb_Decode(buf, size, UPB_UPCAST(ret), &google__protobuf__MethodOptions_msg_init, NULL, 0, arena) !=
10813       kUpb_DecodeStatus_Ok) {
10814     return NULL;
10815   }
10816   return ret;
10817 }
google_protobuf_MethodOptions_parse_ex(const char * buf,size_t size,const upb_ExtensionRegistry * extreg,int options,upb_Arena * arena)10818 UPB_INLINE google_protobuf_MethodOptions* google_protobuf_MethodOptions_parse_ex(const char* buf, size_t size,
10819                            const upb_ExtensionRegistry* extreg,
10820                            int options, upb_Arena* arena) {
10821   google_protobuf_MethodOptions* ret = google_protobuf_MethodOptions_new(arena);
10822   if (!ret) return NULL;
10823   if (upb_Decode(buf, size, UPB_UPCAST(ret), &google__protobuf__MethodOptions_msg_init, extreg, options,
10824                  arena) != kUpb_DecodeStatus_Ok) {
10825     return NULL;
10826   }
10827   return ret;
10828 }
google_protobuf_MethodOptions_serialize(const google_protobuf_MethodOptions * msg,upb_Arena * arena,size_t * len)10829 UPB_INLINE char* google_protobuf_MethodOptions_serialize(const google_protobuf_MethodOptions* msg, upb_Arena* arena, size_t* len) {
10830   char* ptr;
10831   (void)upb_Encode(UPB_UPCAST(msg), &google__protobuf__MethodOptions_msg_init, 0, arena, &ptr, len);
10832   return ptr;
10833 }
google_protobuf_MethodOptions_serialize_ex(const google_protobuf_MethodOptions * msg,int options,upb_Arena * arena,size_t * len)10834 UPB_INLINE char* google_protobuf_MethodOptions_serialize_ex(const google_protobuf_MethodOptions* msg, int options,
10835                                  upb_Arena* arena, size_t* len) {
10836   char* ptr;
10837   (void)upb_Encode(UPB_UPCAST(msg), &google__protobuf__MethodOptions_msg_init, options, arena, &ptr, len);
10838   return ptr;
10839 }
google_protobuf_MethodOptions_clear_deprecated(google_protobuf_MethodOptions * msg)10840 UPB_INLINE void google_protobuf_MethodOptions_clear_deprecated(google_protobuf_MethodOptions* msg) {
10841   const upb_MiniTableField field = {33, 9, 64, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
10842   upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
10843 }
google_protobuf_MethodOptions_deprecated(const google_protobuf_MethodOptions * msg)10844 UPB_INLINE bool google_protobuf_MethodOptions_deprecated(const google_protobuf_MethodOptions* msg) {
10845   bool default_val = false;
10846   bool ret;
10847   const upb_MiniTableField field = {33, 9, 64, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
10848   _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field,
10849                                     &default_val, &ret);
10850   return ret;
10851 }
google_protobuf_MethodOptions_has_deprecated(const google_protobuf_MethodOptions * msg)10852 UPB_INLINE bool google_protobuf_MethodOptions_has_deprecated(const google_protobuf_MethodOptions* msg) {
10853   const upb_MiniTableField field = {33, 9, 64, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
10854   return upb_Message_HasBaseField(UPB_UPCAST(msg), &field);
10855 }
google_protobuf_MethodOptions_clear_idempotency_level(google_protobuf_MethodOptions * msg)10856 UPB_INLINE void google_protobuf_MethodOptions_clear_idempotency_level(google_protobuf_MethodOptions* msg) {
10857   const upb_MiniTableField field = {34, 12, 65, 2, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
10858   upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
10859 }
google_protobuf_MethodOptions_idempotency_level(const google_protobuf_MethodOptions * msg)10860 UPB_INLINE int32_t google_protobuf_MethodOptions_idempotency_level(const google_protobuf_MethodOptions* msg) {
10861   int32_t default_val = 0;
10862   int32_t ret;
10863   const upb_MiniTableField field = {34, 12, 65, 2, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
10864   _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field,
10865                                     &default_val, &ret);
10866   return ret;
10867 }
google_protobuf_MethodOptions_has_idempotency_level(const google_protobuf_MethodOptions * msg)10868 UPB_INLINE bool google_protobuf_MethodOptions_has_idempotency_level(const google_protobuf_MethodOptions* msg) {
10869   const upb_MiniTableField field = {34, 12, 65, 2, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
10870   return upb_Message_HasBaseField(UPB_UPCAST(msg), &field);
10871 }
google_protobuf_MethodOptions_clear_features(google_protobuf_MethodOptions * msg)10872 UPB_INLINE void google_protobuf_MethodOptions_clear_features(google_protobuf_MethodOptions* msg) {
10873   const upb_MiniTableField field = {35, 16, 66, 0, 11, (int)kUpb_FieldMode_Scalar | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
10874   upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
10875 }
google_protobuf_MethodOptions_features(const google_protobuf_MethodOptions * msg)10876 UPB_INLINE const google_protobuf_FeatureSet* google_protobuf_MethodOptions_features(const google_protobuf_MethodOptions* msg) {
10877   const google_protobuf_FeatureSet* default_val = NULL;
10878   const google_protobuf_FeatureSet* ret;
10879   const upb_MiniTableField field = {35, 16, 66, 0, 11, (int)kUpb_FieldMode_Scalar | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
10880   UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__FeatureSet_msg_init);
10881   _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field,
10882                                     &default_val, &ret);
10883   return ret;
10884 }
google_protobuf_MethodOptions_has_features(const google_protobuf_MethodOptions * msg)10885 UPB_INLINE bool google_protobuf_MethodOptions_has_features(const google_protobuf_MethodOptions* msg) {
10886   const upb_MiniTableField field = {35, 16, 66, 0, 11, (int)kUpb_FieldMode_Scalar | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
10887   return upb_Message_HasBaseField(UPB_UPCAST(msg), &field);
10888 }
google_protobuf_MethodOptions_clear_uninterpreted_option(google_protobuf_MethodOptions * msg)10889 UPB_INLINE void google_protobuf_MethodOptions_clear_uninterpreted_option(google_protobuf_MethodOptions* msg) {
10890   const upb_MiniTableField field = {999, UPB_SIZE(20, 24), 0, 1, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
10891   upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
10892 }
google_protobuf_MethodOptions_uninterpreted_option(const google_protobuf_MethodOptions * msg,size_t * size)10893 UPB_INLINE const google_protobuf_UninterpretedOption* const* google_protobuf_MethodOptions_uninterpreted_option(const google_protobuf_MethodOptions* msg, size_t* size) {
10894   const upb_MiniTableField field = {999, UPB_SIZE(20, 24), 0, 1, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
10895   UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__UninterpretedOption_msg_init);
10896   const upb_Array* arr = upb_Message_GetArray(UPB_UPCAST(msg), &field);
10897   if (arr) {
10898     if (size) *size = arr->UPB_PRIVATE(size);
10899     return (const google_protobuf_UninterpretedOption* const*)upb_Array_DataPtr(arr);
10900   } else {
10901     if (size) *size = 0;
10902     return NULL;
10903   }
10904 }
_google_protobuf_MethodOptions_uninterpreted_option_upb_array(const google_protobuf_MethodOptions * msg,size_t * size)10905 UPB_INLINE const upb_Array* _google_protobuf_MethodOptions_uninterpreted_option_upb_array(const google_protobuf_MethodOptions* msg, size_t* size) {
10906   const upb_MiniTableField field = {999, UPB_SIZE(20, 24), 0, 1, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
10907   UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__UninterpretedOption_msg_init);
10908   const upb_Array* arr = upb_Message_GetArray(UPB_UPCAST(msg), &field);
10909   if (size) {
10910     *size = arr ? arr->UPB_PRIVATE(size) : 0;
10911   }
10912   return arr;
10913 }
_google_protobuf_MethodOptions_uninterpreted_option_mutable_upb_array(google_protobuf_MethodOptions * msg,size_t * size,upb_Arena * arena)10914 UPB_INLINE upb_Array* _google_protobuf_MethodOptions_uninterpreted_option_mutable_upb_array(google_protobuf_MethodOptions* msg, size_t* size, upb_Arena* arena) {
10915   const upb_MiniTableField field = {999, UPB_SIZE(20, 24), 0, 1, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
10916   UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__UninterpretedOption_msg_init);
10917   upb_Array* arr = upb_Message_GetOrCreateMutableArray(UPB_UPCAST(msg),
10918                                                        &field, arena);
10919   if (size) {
10920     *size = arr ? arr->UPB_PRIVATE(size) : 0;
10921   }
10922   return arr;
10923 }
10924 
google_protobuf_MethodOptions_set_deprecated(google_protobuf_MethodOptions * msg,bool value)10925 UPB_INLINE void google_protobuf_MethodOptions_set_deprecated(google_protobuf_MethodOptions *msg, bool value) {
10926   const upb_MiniTableField field = {33, 9, 64, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
10927   upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
10928 }
google_protobuf_MethodOptions_set_idempotency_level(google_protobuf_MethodOptions * msg,int32_t value)10929 UPB_INLINE void google_protobuf_MethodOptions_set_idempotency_level(google_protobuf_MethodOptions *msg, int32_t value) {
10930   const upb_MiniTableField field = {34, 12, 65, 2, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
10931   upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
10932 }
google_protobuf_MethodOptions_set_features(google_protobuf_MethodOptions * msg,google_protobuf_FeatureSet * value)10933 UPB_INLINE void google_protobuf_MethodOptions_set_features(google_protobuf_MethodOptions *msg, google_protobuf_FeatureSet* value) {
10934   const upb_MiniTableField field = {35, 16, 66, 0, 11, (int)kUpb_FieldMode_Scalar | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
10935   UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__FeatureSet_msg_init);
10936   upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
10937 }
google_protobuf_MethodOptions_mutable_features(google_protobuf_MethodOptions * msg,upb_Arena * arena)10938 UPB_INLINE struct google_protobuf_FeatureSet* google_protobuf_MethodOptions_mutable_features(google_protobuf_MethodOptions* msg, upb_Arena* arena) {
10939   struct google_protobuf_FeatureSet* sub = (struct google_protobuf_FeatureSet*)google_protobuf_MethodOptions_features(msg);
10940   if (sub == NULL) {
10941     sub = (struct google_protobuf_FeatureSet*)_upb_Message_New(&google__protobuf__FeatureSet_msg_init, arena);
10942     if (sub) google_protobuf_MethodOptions_set_features(msg, sub);
10943   }
10944   return sub;
10945 }
google_protobuf_MethodOptions_mutable_uninterpreted_option(google_protobuf_MethodOptions * msg,size_t * size)10946 UPB_INLINE google_protobuf_UninterpretedOption** google_protobuf_MethodOptions_mutable_uninterpreted_option(google_protobuf_MethodOptions* msg, size_t* size) {
10947   upb_MiniTableField field = {999, UPB_SIZE(20, 24), 0, 1, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
10948   UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__UninterpretedOption_msg_init);
10949   upb_Array* arr = upb_Message_GetMutableArray(UPB_UPCAST(msg), &field);
10950   if (arr) {
10951     if (size) *size = arr->UPB_PRIVATE(size);
10952     return (google_protobuf_UninterpretedOption**)upb_Array_MutableDataPtr(arr);
10953   } else {
10954     if (size) *size = 0;
10955     return NULL;
10956   }
10957 }
google_protobuf_MethodOptions_resize_uninterpreted_option(google_protobuf_MethodOptions * msg,size_t size,upb_Arena * arena)10958 UPB_INLINE google_protobuf_UninterpretedOption** google_protobuf_MethodOptions_resize_uninterpreted_option(google_protobuf_MethodOptions* msg, size_t size, upb_Arena* arena) {
10959   upb_MiniTableField field = {999, UPB_SIZE(20, 24), 0, 1, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
10960   return (google_protobuf_UninterpretedOption**)upb_Message_ResizeArrayUninitialized(UPB_UPCAST(msg),
10961                                                    &field, size, arena);
10962 }
google_protobuf_MethodOptions_add_uninterpreted_option(google_protobuf_MethodOptions * msg,upb_Arena * arena)10963 UPB_INLINE struct google_protobuf_UninterpretedOption* google_protobuf_MethodOptions_add_uninterpreted_option(google_protobuf_MethodOptions* msg, upb_Arena* arena) {
10964   upb_MiniTableField field = {999, UPB_SIZE(20, 24), 0, 1, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
10965   UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__UninterpretedOption_msg_init);
10966   upb_Array* arr = upb_Message_GetOrCreateMutableArray(
10967       UPB_UPCAST(msg), &field, arena);
10968   if (!arr || !UPB_PRIVATE(_upb_Array_ResizeUninitialized)(
10969                   arr, arr->UPB_PRIVATE(size) + 1, arena)) {
10970     return NULL;
10971   }
10972   struct google_protobuf_UninterpretedOption* sub = (struct google_protobuf_UninterpretedOption*)_upb_Message_New(&google__protobuf__UninterpretedOption_msg_init, arena);
10973   if (!arr || !sub) return NULL;
10974   UPB_PRIVATE(_upb_Array_Set)
10975   (arr, arr->UPB_PRIVATE(size) - 1, &sub, sizeof(sub));
10976   return sub;
10977 }
10978 
10979 /* google.protobuf.UninterpretedOption */
10980 
google_protobuf_UninterpretedOption_new(upb_Arena * arena)10981 UPB_INLINE google_protobuf_UninterpretedOption* google_protobuf_UninterpretedOption_new(upb_Arena* arena) {
10982   return (google_protobuf_UninterpretedOption*)_upb_Message_New(&google__protobuf__UninterpretedOption_msg_init, arena);
10983 }
google_protobuf_UninterpretedOption_parse(const char * buf,size_t size,upb_Arena * arena)10984 UPB_INLINE google_protobuf_UninterpretedOption* google_protobuf_UninterpretedOption_parse(const char* buf, size_t size, upb_Arena* arena) {
10985   google_protobuf_UninterpretedOption* ret = google_protobuf_UninterpretedOption_new(arena);
10986   if (!ret) return NULL;
10987   if (upb_Decode(buf, size, UPB_UPCAST(ret), &google__protobuf__UninterpretedOption_msg_init, NULL, 0, arena) !=
10988       kUpb_DecodeStatus_Ok) {
10989     return NULL;
10990   }
10991   return ret;
10992 }
google_protobuf_UninterpretedOption_parse_ex(const char * buf,size_t size,const upb_ExtensionRegistry * extreg,int options,upb_Arena * arena)10993 UPB_INLINE google_protobuf_UninterpretedOption* google_protobuf_UninterpretedOption_parse_ex(const char* buf, size_t size,
10994                            const upb_ExtensionRegistry* extreg,
10995                            int options, upb_Arena* arena) {
10996   google_protobuf_UninterpretedOption* ret = google_protobuf_UninterpretedOption_new(arena);
10997   if (!ret) return NULL;
10998   if (upb_Decode(buf, size, UPB_UPCAST(ret), &google__protobuf__UninterpretedOption_msg_init, extreg, options,
10999                  arena) != kUpb_DecodeStatus_Ok) {
11000     return NULL;
11001   }
11002   return ret;
11003 }
google_protobuf_UninterpretedOption_serialize(const google_protobuf_UninterpretedOption * msg,upb_Arena * arena,size_t * len)11004 UPB_INLINE char* google_protobuf_UninterpretedOption_serialize(const google_protobuf_UninterpretedOption* msg, upb_Arena* arena, size_t* len) {
11005   char* ptr;
11006   (void)upb_Encode(UPB_UPCAST(msg), &google__protobuf__UninterpretedOption_msg_init, 0, arena, &ptr, len);
11007   return ptr;
11008 }
google_protobuf_UninterpretedOption_serialize_ex(const google_protobuf_UninterpretedOption * msg,int options,upb_Arena * arena,size_t * len)11009 UPB_INLINE char* google_protobuf_UninterpretedOption_serialize_ex(const google_protobuf_UninterpretedOption* msg, int options,
11010                                  upb_Arena* arena, size_t* len) {
11011   char* ptr;
11012   (void)upb_Encode(UPB_UPCAST(msg), &google__protobuf__UninterpretedOption_msg_init, options, arena, &ptr, len);
11013   return ptr;
11014 }
google_protobuf_UninterpretedOption_clear_name(google_protobuf_UninterpretedOption * msg)11015 UPB_INLINE void google_protobuf_UninterpretedOption_clear_name(google_protobuf_UninterpretedOption* msg) {
11016   const upb_MiniTableField field = {2, UPB_SIZE(12, 16), 0, 0, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
11017   upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
11018 }
google_protobuf_UninterpretedOption_name(const google_protobuf_UninterpretedOption * msg,size_t * size)11019 UPB_INLINE const google_protobuf_UninterpretedOption_NamePart* const* google_protobuf_UninterpretedOption_name(const google_protobuf_UninterpretedOption* msg, size_t* size) {
11020   const upb_MiniTableField field = {2, UPB_SIZE(12, 16), 0, 0, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
11021   UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__UninterpretedOption__NamePart_msg_init);
11022   const upb_Array* arr = upb_Message_GetArray(UPB_UPCAST(msg), &field);
11023   if (arr) {
11024     if (size) *size = arr->UPB_PRIVATE(size);
11025     return (const google_protobuf_UninterpretedOption_NamePart* const*)upb_Array_DataPtr(arr);
11026   } else {
11027     if (size) *size = 0;
11028     return NULL;
11029   }
11030 }
_google_protobuf_UninterpretedOption_name_upb_array(const google_protobuf_UninterpretedOption * msg,size_t * size)11031 UPB_INLINE const upb_Array* _google_protobuf_UninterpretedOption_name_upb_array(const google_protobuf_UninterpretedOption* msg, size_t* size) {
11032   const upb_MiniTableField field = {2, UPB_SIZE(12, 16), 0, 0, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
11033   UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__UninterpretedOption__NamePart_msg_init);
11034   const upb_Array* arr = upb_Message_GetArray(UPB_UPCAST(msg), &field);
11035   if (size) {
11036     *size = arr ? arr->UPB_PRIVATE(size) : 0;
11037   }
11038   return arr;
11039 }
_google_protobuf_UninterpretedOption_name_mutable_upb_array(google_protobuf_UninterpretedOption * msg,size_t * size,upb_Arena * arena)11040 UPB_INLINE upb_Array* _google_protobuf_UninterpretedOption_name_mutable_upb_array(google_protobuf_UninterpretedOption* msg, size_t* size, upb_Arena* arena) {
11041   const upb_MiniTableField field = {2, UPB_SIZE(12, 16), 0, 0, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
11042   UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__UninterpretedOption__NamePart_msg_init);
11043   upb_Array* arr = upb_Message_GetOrCreateMutableArray(UPB_UPCAST(msg),
11044                                                        &field, arena);
11045   if (size) {
11046     *size = arr ? arr->UPB_PRIVATE(size) : 0;
11047   }
11048   return arr;
11049 }
google_protobuf_UninterpretedOption_clear_identifier_value(google_protobuf_UninterpretedOption * msg)11050 UPB_INLINE void google_protobuf_UninterpretedOption_clear_identifier_value(google_protobuf_UninterpretedOption* msg) {
11051   const upb_MiniTableField field = {3, UPB_SIZE(16, 24), 64, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
11052   upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
11053 }
google_protobuf_UninterpretedOption_identifier_value(const google_protobuf_UninterpretedOption * msg)11054 UPB_INLINE upb_StringView google_protobuf_UninterpretedOption_identifier_value(const google_protobuf_UninterpretedOption* msg) {
11055   upb_StringView default_val = upb_StringView_FromString("");
11056   upb_StringView ret;
11057   const upb_MiniTableField field = {3, UPB_SIZE(16, 24), 64, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
11058   _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field,
11059                                     &default_val, &ret);
11060   return ret;
11061 }
google_protobuf_UninterpretedOption_has_identifier_value(const google_protobuf_UninterpretedOption * msg)11062 UPB_INLINE bool google_protobuf_UninterpretedOption_has_identifier_value(const google_protobuf_UninterpretedOption* msg) {
11063   const upb_MiniTableField field = {3, UPB_SIZE(16, 24), 64, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
11064   return upb_Message_HasBaseField(UPB_UPCAST(msg), &field);
11065 }
google_protobuf_UninterpretedOption_clear_positive_int_value(google_protobuf_UninterpretedOption * msg)11066 UPB_INLINE void google_protobuf_UninterpretedOption_clear_positive_int_value(google_protobuf_UninterpretedOption* msg) {
11067   const upb_MiniTableField field = {4, UPB_SIZE(24, 40), 65, kUpb_NoSub, 4, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)};
11068   upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
11069 }
google_protobuf_UninterpretedOption_positive_int_value(const google_protobuf_UninterpretedOption * msg)11070 UPB_INLINE uint64_t google_protobuf_UninterpretedOption_positive_int_value(const google_protobuf_UninterpretedOption* msg) {
11071   uint64_t default_val = (uint64_t)0ull;
11072   uint64_t ret;
11073   const upb_MiniTableField field = {4, UPB_SIZE(24, 40), 65, kUpb_NoSub, 4, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)};
11074   _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field,
11075                                     &default_val, &ret);
11076   return ret;
11077 }
google_protobuf_UninterpretedOption_has_positive_int_value(const google_protobuf_UninterpretedOption * msg)11078 UPB_INLINE bool google_protobuf_UninterpretedOption_has_positive_int_value(const google_protobuf_UninterpretedOption* msg) {
11079   const upb_MiniTableField field = {4, UPB_SIZE(24, 40), 65, kUpb_NoSub, 4, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)};
11080   return upb_Message_HasBaseField(UPB_UPCAST(msg), &field);
11081 }
google_protobuf_UninterpretedOption_clear_negative_int_value(google_protobuf_UninterpretedOption * msg)11082 UPB_INLINE void google_protobuf_UninterpretedOption_clear_negative_int_value(google_protobuf_UninterpretedOption* msg) {
11083   const upb_MiniTableField field = {5, UPB_SIZE(32, 48), 66, kUpb_NoSub, 3, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)};
11084   upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
11085 }
google_protobuf_UninterpretedOption_negative_int_value(const google_protobuf_UninterpretedOption * msg)11086 UPB_INLINE int64_t google_protobuf_UninterpretedOption_negative_int_value(const google_protobuf_UninterpretedOption* msg) {
11087   int64_t default_val = (int64_t)0ll;
11088   int64_t ret;
11089   const upb_MiniTableField field = {5, UPB_SIZE(32, 48), 66, kUpb_NoSub, 3, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)};
11090   _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field,
11091                                     &default_val, &ret);
11092   return ret;
11093 }
google_protobuf_UninterpretedOption_has_negative_int_value(const google_protobuf_UninterpretedOption * msg)11094 UPB_INLINE bool google_protobuf_UninterpretedOption_has_negative_int_value(const google_protobuf_UninterpretedOption* msg) {
11095   const upb_MiniTableField field = {5, UPB_SIZE(32, 48), 66, kUpb_NoSub, 3, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)};
11096   return upb_Message_HasBaseField(UPB_UPCAST(msg), &field);
11097 }
google_protobuf_UninterpretedOption_clear_double_value(google_protobuf_UninterpretedOption * msg)11098 UPB_INLINE void google_protobuf_UninterpretedOption_clear_double_value(google_protobuf_UninterpretedOption* msg) {
11099   const upb_MiniTableField field = {6, UPB_SIZE(40, 56), 67, kUpb_NoSub, 1, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)};
11100   upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
11101 }
google_protobuf_UninterpretedOption_double_value(const google_protobuf_UninterpretedOption * msg)11102 UPB_INLINE double google_protobuf_UninterpretedOption_double_value(const google_protobuf_UninterpretedOption* msg) {
11103   double default_val = 0;
11104   double ret;
11105   const upb_MiniTableField field = {6, UPB_SIZE(40, 56), 67, kUpb_NoSub, 1, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)};
11106   _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field,
11107                                     &default_val, &ret);
11108   return ret;
11109 }
google_protobuf_UninterpretedOption_has_double_value(const google_protobuf_UninterpretedOption * msg)11110 UPB_INLINE bool google_protobuf_UninterpretedOption_has_double_value(const google_protobuf_UninterpretedOption* msg) {
11111   const upb_MiniTableField field = {6, UPB_SIZE(40, 56), 67, kUpb_NoSub, 1, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)};
11112   return upb_Message_HasBaseField(UPB_UPCAST(msg), &field);
11113 }
google_protobuf_UninterpretedOption_clear_string_value(google_protobuf_UninterpretedOption * msg)11114 UPB_INLINE void google_protobuf_UninterpretedOption_clear_string_value(google_protobuf_UninterpretedOption* msg) {
11115   const upb_MiniTableField field = {7, UPB_SIZE(48, 64), 68, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
11116   upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
11117 }
google_protobuf_UninterpretedOption_string_value(const google_protobuf_UninterpretedOption * msg)11118 UPB_INLINE upb_StringView google_protobuf_UninterpretedOption_string_value(const google_protobuf_UninterpretedOption* msg) {
11119   upb_StringView default_val = upb_StringView_FromString("");
11120   upb_StringView ret;
11121   const upb_MiniTableField field = {7, UPB_SIZE(48, 64), 68, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
11122   _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field,
11123                                     &default_val, &ret);
11124   return ret;
11125 }
google_protobuf_UninterpretedOption_has_string_value(const google_protobuf_UninterpretedOption * msg)11126 UPB_INLINE bool google_protobuf_UninterpretedOption_has_string_value(const google_protobuf_UninterpretedOption* msg) {
11127   const upb_MiniTableField field = {7, UPB_SIZE(48, 64), 68, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
11128   return upb_Message_HasBaseField(UPB_UPCAST(msg), &field);
11129 }
google_protobuf_UninterpretedOption_clear_aggregate_value(google_protobuf_UninterpretedOption * msg)11130 UPB_INLINE void google_protobuf_UninterpretedOption_clear_aggregate_value(google_protobuf_UninterpretedOption* msg) {
11131   const upb_MiniTableField field = {8, UPB_SIZE(56, 80), 69, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
11132   upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
11133 }
google_protobuf_UninterpretedOption_aggregate_value(const google_protobuf_UninterpretedOption * msg)11134 UPB_INLINE upb_StringView google_protobuf_UninterpretedOption_aggregate_value(const google_protobuf_UninterpretedOption* msg) {
11135   upb_StringView default_val = upb_StringView_FromString("");
11136   upb_StringView ret;
11137   const upb_MiniTableField field = {8, UPB_SIZE(56, 80), 69, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
11138   _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field,
11139                                     &default_val, &ret);
11140   return ret;
11141 }
google_protobuf_UninterpretedOption_has_aggregate_value(const google_protobuf_UninterpretedOption * msg)11142 UPB_INLINE bool google_protobuf_UninterpretedOption_has_aggregate_value(const google_protobuf_UninterpretedOption* msg) {
11143   const upb_MiniTableField field = {8, UPB_SIZE(56, 80), 69, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
11144   return upb_Message_HasBaseField(UPB_UPCAST(msg), &field);
11145 }
11146 
google_protobuf_UninterpretedOption_mutable_name(google_protobuf_UninterpretedOption * msg,size_t * size)11147 UPB_INLINE google_protobuf_UninterpretedOption_NamePart** google_protobuf_UninterpretedOption_mutable_name(google_protobuf_UninterpretedOption* msg, size_t* size) {
11148   upb_MiniTableField field = {2, UPB_SIZE(12, 16), 0, 0, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
11149   UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__UninterpretedOption__NamePart_msg_init);
11150   upb_Array* arr = upb_Message_GetMutableArray(UPB_UPCAST(msg), &field);
11151   if (arr) {
11152     if (size) *size = arr->UPB_PRIVATE(size);
11153     return (google_protobuf_UninterpretedOption_NamePart**)upb_Array_MutableDataPtr(arr);
11154   } else {
11155     if (size) *size = 0;
11156     return NULL;
11157   }
11158 }
google_protobuf_UninterpretedOption_resize_name(google_protobuf_UninterpretedOption * msg,size_t size,upb_Arena * arena)11159 UPB_INLINE google_protobuf_UninterpretedOption_NamePart** google_protobuf_UninterpretedOption_resize_name(google_protobuf_UninterpretedOption* msg, size_t size, upb_Arena* arena) {
11160   upb_MiniTableField field = {2, UPB_SIZE(12, 16), 0, 0, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
11161   return (google_protobuf_UninterpretedOption_NamePart**)upb_Message_ResizeArrayUninitialized(UPB_UPCAST(msg),
11162                                                    &field, size, arena);
11163 }
google_protobuf_UninterpretedOption_add_name(google_protobuf_UninterpretedOption * msg,upb_Arena * arena)11164 UPB_INLINE struct google_protobuf_UninterpretedOption_NamePart* google_protobuf_UninterpretedOption_add_name(google_protobuf_UninterpretedOption* msg, upb_Arena* arena) {
11165   upb_MiniTableField field = {2, UPB_SIZE(12, 16), 0, 0, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
11166   UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__UninterpretedOption__NamePart_msg_init);
11167   upb_Array* arr = upb_Message_GetOrCreateMutableArray(
11168       UPB_UPCAST(msg), &field, arena);
11169   if (!arr || !UPB_PRIVATE(_upb_Array_ResizeUninitialized)(
11170                   arr, arr->UPB_PRIVATE(size) + 1, arena)) {
11171     return NULL;
11172   }
11173   struct google_protobuf_UninterpretedOption_NamePart* sub = (struct google_protobuf_UninterpretedOption_NamePart*)_upb_Message_New(&google__protobuf__UninterpretedOption__NamePart_msg_init, arena);
11174   if (!arr || !sub) return NULL;
11175   UPB_PRIVATE(_upb_Array_Set)
11176   (arr, arr->UPB_PRIVATE(size) - 1, &sub, sizeof(sub));
11177   return sub;
11178 }
google_protobuf_UninterpretedOption_set_identifier_value(google_protobuf_UninterpretedOption * msg,upb_StringView value)11179 UPB_INLINE void google_protobuf_UninterpretedOption_set_identifier_value(google_protobuf_UninterpretedOption *msg, upb_StringView value) {
11180   const upb_MiniTableField field = {3, UPB_SIZE(16, 24), 64, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
11181   upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
11182 }
google_protobuf_UninterpretedOption_set_positive_int_value(google_protobuf_UninterpretedOption * msg,uint64_t value)11183 UPB_INLINE void google_protobuf_UninterpretedOption_set_positive_int_value(google_protobuf_UninterpretedOption *msg, uint64_t value) {
11184   const upb_MiniTableField field = {4, UPB_SIZE(24, 40), 65, kUpb_NoSub, 4, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)};
11185   upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
11186 }
google_protobuf_UninterpretedOption_set_negative_int_value(google_protobuf_UninterpretedOption * msg,int64_t value)11187 UPB_INLINE void google_protobuf_UninterpretedOption_set_negative_int_value(google_protobuf_UninterpretedOption *msg, int64_t value) {
11188   const upb_MiniTableField field = {5, UPB_SIZE(32, 48), 66, kUpb_NoSub, 3, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)};
11189   upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
11190 }
google_protobuf_UninterpretedOption_set_double_value(google_protobuf_UninterpretedOption * msg,double value)11191 UPB_INLINE void google_protobuf_UninterpretedOption_set_double_value(google_protobuf_UninterpretedOption *msg, double value) {
11192   const upb_MiniTableField field = {6, UPB_SIZE(40, 56), 67, kUpb_NoSub, 1, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)};
11193   upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
11194 }
google_protobuf_UninterpretedOption_set_string_value(google_protobuf_UninterpretedOption * msg,upb_StringView value)11195 UPB_INLINE void google_protobuf_UninterpretedOption_set_string_value(google_protobuf_UninterpretedOption *msg, upb_StringView value) {
11196   const upb_MiniTableField field = {7, UPB_SIZE(48, 64), 68, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
11197   upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
11198 }
google_protobuf_UninterpretedOption_set_aggregate_value(google_protobuf_UninterpretedOption * msg,upb_StringView value)11199 UPB_INLINE void google_protobuf_UninterpretedOption_set_aggregate_value(google_protobuf_UninterpretedOption *msg, upb_StringView value) {
11200   const upb_MiniTableField field = {8, UPB_SIZE(56, 80), 69, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
11201   upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
11202 }
11203 
11204 /* google.protobuf.UninterpretedOption.NamePart */
11205 
google_protobuf_UninterpretedOption_NamePart_new(upb_Arena * arena)11206 UPB_INLINE google_protobuf_UninterpretedOption_NamePart* google_protobuf_UninterpretedOption_NamePart_new(upb_Arena* arena) {
11207   return (google_protobuf_UninterpretedOption_NamePart*)_upb_Message_New(&google__protobuf__UninterpretedOption__NamePart_msg_init, arena);
11208 }
google_protobuf_UninterpretedOption_NamePart_parse(const char * buf,size_t size,upb_Arena * arena)11209 UPB_INLINE google_protobuf_UninterpretedOption_NamePart* google_protobuf_UninterpretedOption_NamePart_parse(const char* buf, size_t size, upb_Arena* arena) {
11210   google_protobuf_UninterpretedOption_NamePart* ret = google_protobuf_UninterpretedOption_NamePart_new(arena);
11211   if (!ret) return NULL;
11212   if (upb_Decode(buf, size, UPB_UPCAST(ret), &google__protobuf__UninterpretedOption__NamePart_msg_init, NULL, 0, arena) !=
11213       kUpb_DecodeStatus_Ok) {
11214     return NULL;
11215   }
11216   return ret;
11217 }
google_protobuf_UninterpretedOption_NamePart_parse_ex(const char * buf,size_t size,const upb_ExtensionRegistry * extreg,int options,upb_Arena * arena)11218 UPB_INLINE google_protobuf_UninterpretedOption_NamePart* google_protobuf_UninterpretedOption_NamePart_parse_ex(const char* buf, size_t size,
11219                            const upb_ExtensionRegistry* extreg,
11220                            int options, upb_Arena* arena) {
11221   google_protobuf_UninterpretedOption_NamePart* ret = google_protobuf_UninterpretedOption_NamePart_new(arena);
11222   if (!ret) return NULL;
11223   if (upb_Decode(buf, size, UPB_UPCAST(ret), &google__protobuf__UninterpretedOption__NamePart_msg_init, extreg, options,
11224                  arena) != kUpb_DecodeStatus_Ok) {
11225     return NULL;
11226   }
11227   return ret;
11228 }
google_protobuf_UninterpretedOption_NamePart_serialize(const google_protobuf_UninterpretedOption_NamePart * msg,upb_Arena * arena,size_t * len)11229 UPB_INLINE char* google_protobuf_UninterpretedOption_NamePart_serialize(const google_protobuf_UninterpretedOption_NamePart* msg, upb_Arena* arena, size_t* len) {
11230   char* ptr;
11231   (void)upb_Encode(UPB_UPCAST(msg), &google__protobuf__UninterpretedOption__NamePart_msg_init, 0, arena, &ptr, len);
11232   return ptr;
11233 }
google_protobuf_UninterpretedOption_NamePart_serialize_ex(const google_protobuf_UninterpretedOption_NamePart * msg,int options,upb_Arena * arena,size_t * len)11234 UPB_INLINE char* google_protobuf_UninterpretedOption_NamePart_serialize_ex(const google_protobuf_UninterpretedOption_NamePart* msg, int options,
11235                                  upb_Arena* arena, size_t* len) {
11236   char* ptr;
11237   (void)upb_Encode(UPB_UPCAST(msg), &google__protobuf__UninterpretedOption__NamePart_msg_init, options, arena, &ptr, len);
11238   return ptr;
11239 }
google_protobuf_UninterpretedOption_NamePart_clear_name_part(google_protobuf_UninterpretedOption_NamePart * msg)11240 UPB_INLINE void google_protobuf_UninterpretedOption_NamePart_clear_name_part(google_protobuf_UninterpretedOption_NamePart* msg) {
11241   const upb_MiniTableField field = {1, UPB_SIZE(12, 16), 64, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
11242   upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
11243 }
google_protobuf_UninterpretedOption_NamePart_name_part(const google_protobuf_UninterpretedOption_NamePart * msg)11244 UPB_INLINE upb_StringView google_protobuf_UninterpretedOption_NamePart_name_part(const google_protobuf_UninterpretedOption_NamePart* msg) {
11245   upb_StringView default_val = upb_StringView_FromString("");
11246   upb_StringView ret;
11247   const upb_MiniTableField field = {1, UPB_SIZE(12, 16), 64, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
11248   _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field,
11249                                     &default_val, &ret);
11250   return ret;
11251 }
google_protobuf_UninterpretedOption_NamePart_has_name_part(const google_protobuf_UninterpretedOption_NamePart * msg)11252 UPB_INLINE bool google_protobuf_UninterpretedOption_NamePart_has_name_part(const google_protobuf_UninterpretedOption_NamePart* msg) {
11253   const upb_MiniTableField field = {1, UPB_SIZE(12, 16), 64, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
11254   return upb_Message_HasBaseField(UPB_UPCAST(msg), &field);
11255 }
google_protobuf_UninterpretedOption_NamePart_clear_is_extension(google_protobuf_UninterpretedOption_NamePart * msg)11256 UPB_INLINE void google_protobuf_UninterpretedOption_NamePart_clear_is_extension(google_protobuf_UninterpretedOption_NamePart* msg) {
11257   const upb_MiniTableField field = {2, 9, 65, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
11258   upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
11259 }
google_protobuf_UninterpretedOption_NamePart_is_extension(const google_protobuf_UninterpretedOption_NamePart * msg)11260 UPB_INLINE bool google_protobuf_UninterpretedOption_NamePart_is_extension(const google_protobuf_UninterpretedOption_NamePart* msg) {
11261   bool default_val = false;
11262   bool ret;
11263   const upb_MiniTableField field = {2, 9, 65, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
11264   _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field,
11265                                     &default_val, &ret);
11266   return ret;
11267 }
google_protobuf_UninterpretedOption_NamePart_has_is_extension(const google_protobuf_UninterpretedOption_NamePart * msg)11268 UPB_INLINE bool google_protobuf_UninterpretedOption_NamePart_has_is_extension(const google_protobuf_UninterpretedOption_NamePart* msg) {
11269   const upb_MiniTableField field = {2, 9, 65, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
11270   return upb_Message_HasBaseField(UPB_UPCAST(msg), &field);
11271 }
11272 
google_protobuf_UninterpretedOption_NamePart_set_name_part(google_protobuf_UninterpretedOption_NamePart * msg,upb_StringView value)11273 UPB_INLINE void google_protobuf_UninterpretedOption_NamePart_set_name_part(google_protobuf_UninterpretedOption_NamePart *msg, upb_StringView value) {
11274   const upb_MiniTableField field = {1, UPB_SIZE(12, 16), 64, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
11275   upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
11276 }
google_protobuf_UninterpretedOption_NamePart_set_is_extension(google_protobuf_UninterpretedOption_NamePart * msg,bool value)11277 UPB_INLINE void google_protobuf_UninterpretedOption_NamePart_set_is_extension(google_protobuf_UninterpretedOption_NamePart *msg, bool value) {
11278   const upb_MiniTableField field = {2, 9, 65, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
11279   upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
11280 }
11281 
11282 /* google.protobuf.FeatureSet */
11283 
google_protobuf_FeatureSet_new(upb_Arena * arena)11284 UPB_INLINE google_protobuf_FeatureSet* google_protobuf_FeatureSet_new(upb_Arena* arena) {
11285   return (google_protobuf_FeatureSet*)_upb_Message_New(&google__protobuf__FeatureSet_msg_init, arena);
11286 }
google_protobuf_FeatureSet_parse(const char * buf,size_t size,upb_Arena * arena)11287 UPB_INLINE google_protobuf_FeatureSet* google_protobuf_FeatureSet_parse(const char* buf, size_t size, upb_Arena* arena) {
11288   google_protobuf_FeatureSet* ret = google_protobuf_FeatureSet_new(arena);
11289   if (!ret) return NULL;
11290   if (upb_Decode(buf, size, UPB_UPCAST(ret), &google__protobuf__FeatureSet_msg_init, NULL, 0, arena) !=
11291       kUpb_DecodeStatus_Ok) {
11292     return NULL;
11293   }
11294   return ret;
11295 }
google_protobuf_FeatureSet_parse_ex(const char * buf,size_t size,const upb_ExtensionRegistry * extreg,int options,upb_Arena * arena)11296 UPB_INLINE google_protobuf_FeatureSet* google_protobuf_FeatureSet_parse_ex(const char* buf, size_t size,
11297                            const upb_ExtensionRegistry* extreg,
11298                            int options, upb_Arena* arena) {
11299   google_protobuf_FeatureSet* ret = google_protobuf_FeatureSet_new(arena);
11300   if (!ret) return NULL;
11301   if (upb_Decode(buf, size, UPB_UPCAST(ret), &google__protobuf__FeatureSet_msg_init, extreg, options,
11302                  arena) != kUpb_DecodeStatus_Ok) {
11303     return NULL;
11304   }
11305   return ret;
11306 }
google_protobuf_FeatureSet_serialize(const google_protobuf_FeatureSet * msg,upb_Arena * arena,size_t * len)11307 UPB_INLINE char* google_protobuf_FeatureSet_serialize(const google_protobuf_FeatureSet* msg, upb_Arena* arena, size_t* len) {
11308   char* ptr;
11309   (void)upb_Encode(UPB_UPCAST(msg), &google__protobuf__FeatureSet_msg_init, 0, arena, &ptr, len);
11310   return ptr;
11311 }
google_protobuf_FeatureSet_serialize_ex(const google_protobuf_FeatureSet * msg,int options,upb_Arena * arena,size_t * len)11312 UPB_INLINE char* google_protobuf_FeatureSet_serialize_ex(const google_protobuf_FeatureSet* msg, int options,
11313                                  upb_Arena* arena, size_t* len) {
11314   char* ptr;
11315   (void)upb_Encode(UPB_UPCAST(msg), &google__protobuf__FeatureSet_msg_init, options, arena, &ptr, len);
11316   return ptr;
11317 }
google_protobuf_FeatureSet_clear_field_presence(google_protobuf_FeatureSet * msg)11318 UPB_INLINE void google_protobuf_FeatureSet_clear_field_presence(google_protobuf_FeatureSet* msg) {
11319   const upb_MiniTableField field = {1, 12, 64, 0, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
11320   upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
11321 }
google_protobuf_FeatureSet_field_presence(const google_protobuf_FeatureSet * msg)11322 UPB_INLINE int32_t google_protobuf_FeatureSet_field_presence(const google_protobuf_FeatureSet* msg) {
11323   int32_t default_val = 0;
11324   int32_t ret;
11325   const upb_MiniTableField field = {1, 12, 64, 0, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
11326   _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field,
11327                                     &default_val, &ret);
11328   return ret;
11329 }
google_protobuf_FeatureSet_has_field_presence(const google_protobuf_FeatureSet * msg)11330 UPB_INLINE bool google_protobuf_FeatureSet_has_field_presence(const google_protobuf_FeatureSet* msg) {
11331   const upb_MiniTableField field = {1, 12, 64, 0, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
11332   return upb_Message_HasBaseField(UPB_UPCAST(msg), &field);
11333 }
google_protobuf_FeatureSet_clear_enum_type(google_protobuf_FeatureSet * msg)11334 UPB_INLINE void google_protobuf_FeatureSet_clear_enum_type(google_protobuf_FeatureSet* msg) {
11335   const upb_MiniTableField field = {2, 16, 65, 1, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
11336   upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
11337 }
google_protobuf_FeatureSet_enum_type(const google_protobuf_FeatureSet * msg)11338 UPB_INLINE int32_t google_protobuf_FeatureSet_enum_type(const google_protobuf_FeatureSet* msg) {
11339   int32_t default_val = 0;
11340   int32_t ret;
11341   const upb_MiniTableField field = {2, 16, 65, 1, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
11342   _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field,
11343                                     &default_val, &ret);
11344   return ret;
11345 }
google_protobuf_FeatureSet_has_enum_type(const google_protobuf_FeatureSet * msg)11346 UPB_INLINE bool google_protobuf_FeatureSet_has_enum_type(const google_protobuf_FeatureSet* msg) {
11347   const upb_MiniTableField field = {2, 16, 65, 1, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
11348   return upb_Message_HasBaseField(UPB_UPCAST(msg), &field);
11349 }
google_protobuf_FeatureSet_clear_repeated_field_encoding(google_protobuf_FeatureSet * msg)11350 UPB_INLINE void google_protobuf_FeatureSet_clear_repeated_field_encoding(google_protobuf_FeatureSet* msg) {
11351   const upb_MiniTableField field = {3, 20, 66, 2, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
11352   upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
11353 }
google_protobuf_FeatureSet_repeated_field_encoding(const google_protobuf_FeatureSet * msg)11354 UPB_INLINE int32_t google_protobuf_FeatureSet_repeated_field_encoding(const google_protobuf_FeatureSet* msg) {
11355   int32_t default_val = 0;
11356   int32_t ret;
11357   const upb_MiniTableField field = {3, 20, 66, 2, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
11358   _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field,
11359                                     &default_val, &ret);
11360   return ret;
11361 }
google_protobuf_FeatureSet_has_repeated_field_encoding(const google_protobuf_FeatureSet * msg)11362 UPB_INLINE bool google_protobuf_FeatureSet_has_repeated_field_encoding(const google_protobuf_FeatureSet* msg) {
11363   const upb_MiniTableField field = {3, 20, 66, 2, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
11364   return upb_Message_HasBaseField(UPB_UPCAST(msg), &field);
11365 }
google_protobuf_FeatureSet_clear_utf8_validation(google_protobuf_FeatureSet * msg)11366 UPB_INLINE void google_protobuf_FeatureSet_clear_utf8_validation(google_protobuf_FeatureSet* msg) {
11367   const upb_MiniTableField field = {4, 24, 67, 3, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
11368   upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
11369 }
google_protobuf_FeatureSet_utf8_validation(const google_protobuf_FeatureSet * msg)11370 UPB_INLINE int32_t google_protobuf_FeatureSet_utf8_validation(const google_protobuf_FeatureSet* msg) {
11371   int32_t default_val = 0;
11372   int32_t ret;
11373   const upb_MiniTableField field = {4, 24, 67, 3, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
11374   _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field,
11375                                     &default_val, &ret);
11376   return ret;
11377 }
google_protobuf_FeatureSet_has_utf8_validation(const google_protobuf_FeatureSet * msg)11378 UPB_INLINE bool google_protobuf_FeatureSet_has_utf8_validation(const google_protobuf_FeatureSet* msg) {
11379   const upb_MiniTableField field = {4, 24, 67, 3, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
11380   return upb_Message_HasBaseField(UPB_UPCAST(msg), &field);
11381 }
google_protobuf_FeatureSet_clear_message_encoding(google_protobuf_FeatureSet * msg)11382 UPB_INLINE void google_protobuf_FeatureSet_clear_message_encoding(google_protobuf_FeatureSet* msg) {
11383   const upb_MiniTableField field = {5, 28, 68, 4, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
11384   upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
11385 }
google_protobuf_FeatureSet_message_encoding(const google_protobuf_FeatureSet * msg)11386 UPB_INLINE int32_t google_protobuf_FeatureSet_message_encoding(const google_protobuf_FeatureSet* msg) {
11387   int32_t default_val = 0;
11388   int32_t ret;
11389   const upb_MiniTableField field = {5, 28, 68, 4, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
11390   _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field,
11391                                     &default_val, &ret);
11392   return ret;
11393 }
google_protobuf_FeatureSet_has_message_encoding(const google_protobuf_FeatureSet * msg)11394 UPB_INLINE bool google_protobuf_FeatureSet_has_message_encoding(const google_protobuf_FeatureSet* msg) {
11395   const upb_MiniTableField field = {5, 28, 68, 4, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
11396   return upb_Message_HasBaseField(UPB_UPCAST(msg), &field);
11397 }
google_protobuf_FeatureSet_clear_json_format(google_protobuf_FeatureSet * msg)11398 UPB_INLINE void google_protobuf_FeatureSet_clear_json_format(google_protobuf_FeatureSet* msg) {
11399   const upb_MiniTableField field = {6, 32, 69, 5, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
11400   upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
11401 }
google_protobuf_FeatureSet_json_format(const google_protobuf_FeatureSet * msg)11402 UPB_INLINE int32_t google_protobuf_FeatureSet_json_format(const google_protobuf_FeatureSet* msg) {
11403   int32_t default_val = 0;
11404   int32_t ret;
11405   const upb_MiniTableField field = {6, 32, 69, 5, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
11406   _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field,
11407                                     &default_val, &ret);
11408   return ret;
11409 }
google_protobuf_FeatureSet_has_json_format(const google_protobuf_FeatureSet * msg)11410 UPB_INLINE bool google_protobuf_FeatureSet_has_json_format(const google_protobuf_FeatureSet* msg) {
11411   const upb_MiniTableField field = {6, 32, 69, 5, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
11412   return upb_Message_HasBaseField(UPB_UPCAST(msg), &field);
11413 }
11414 
google_protobuf_FeatureSet_set_field_presence(google_protobuf_FeatureSet * msg,int32_t value)11415 UPB_INLINE void google_protobuf_FeatureSet_set_field_presence(google_protobuf_FeatureSet *msg, int32_t value) {
11416   const upb_MiniTableField field = {1, 12, 64, 0, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
11417   upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
11418 }
google_protobuf_FeatureSet_set_enum_type(google_protobuf_FeatureSet * msg,int32_t value)11419 UPB_INLINE void google_protobuf_FeatureSet_set_enum_type(google_protobuf_FeatureSet *msg, int32_t value) {
11420   const upb_MiniTableField field = {2, 16, 65, 1, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
11421   upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
11422 }
google_protobuf_FeatureSet_set_repeated_field_encoding(google_protobuf_FeatureSet * msg,int32_t value)11423 UPB_INLINE void google_protobuf_FeatureSet_set_repeated_field_encoding(google_protobuf_FeatureSet *msg, int32_t value) {
11424   const upb_MiniTableField field = {3, 20, 66, 2, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
11425   upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
11426 }
google_protobuf_FeatureSet_set_utf8_validation(google_protobuf_FeatureSet * msg,int32_t value)11427 UPB_INLINE void google_protobuf_FeatureSet_set_utf8_validation(google_protobuf_FeatureSet *msg, int32_t value) {
11428   const upb_MiniTableField field = {4, 24, 67, 3, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
11429   upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
11430 }
google_protobuf_FeatureSet_set_message_encoding(google_protobuf_FeatureSet * msg,int32_t value)11431 UPB_INLINE void google_protobuf_FeatureSet_set_message_encoding(google_protobuf_FeatureSet *msg, int32_t value) {
11432   const upb_MiniTableField field = {5, 28, 68, 4, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
11433   upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
11434 }
google_protobuf_FeatureSet_set_json_format(google_protobuf_FeatureSet * msg,int32_t value)11435 UPB_INLINE void google_protobuf_FeatureSet_set_json_format(google_protobuf_FeatureSet *msg, int32_t value) {
11436   const upb_MiniTableField field = {6, 32, 69, 5, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
11437   upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
11438 }
11439 
11440 /* google.protobuf.FeatureSetDefaults */
11441 
google_protobuf_FeatureSetDefaults_new(upb_Arena * arena)11442 UPB_INLINE google_protobuf_FeatureSetDefaults* google_protobuf_FeatureSetDefaults_new(upb_Arena* arena) {
11443   return (google_protobuf_FeatureSetDefaults*)_upb_Message_New(&google__protobuf__FeatureSetDefaults_msg_init, arena);
11444 }
google_protobuf_FeatureSetDefaults_parse(const char * buf,size_t size,upb_Arena * arena)11445 UPB_INLINE google_protobuf_FeatureSetDefaults* google_protobuf_FeatureSetDefaults_parse(const char* buf, size_t size, upb_Arena* arena) {
11446   google_protobuf_FeatureSetDefaults* ret = google_protobuf_FeatureSetDefaults_new(arena);
11447   if (!ret) return NULL;
11448   if (upb_Decode(buf, size, UPB_UPCAST(ret), &google__protobuf__FeatureSetDefaults_msg_init, NULL, 0, arena) !=
11449       kUpb_DecodeStatus_Ok) {
11450     return NULL;
11451   }
11452   return ret;
11453 }
google_protobuf_FeatureSetDefaults_parse_ex(const char * buf,size_t size,const upb_ExtensionRegistry * extreg,int options,upb_Arena * arena)11454 UPB_INLINE google_protobuf_FeatureSetDefaults* google_protobuf_FeatureSetDefaults_parse_ex(const char* buf, size_t size,
11455                            const upb_ExtensionRegistry* extreg,
11456                            int options, upb_Arena* arena) {
11457   google_protobuf_FeatureSetDefaults* ret = google_protobuf_FeatureSetDefaults_new(arena);
11458   if (!ret) return NULL;
11459   if (upb_Decode(buf, size, UPB_UPCAST(ret), &google__protobuf__FeatureSetDefaults_msg_init, extreg, options,
11460                  arena) != kUpb_DecodeStatus_Ok) {
11461     return NULL;
11462   }
11463   return ret;
11464 }
google_protobuf_FeatureSetDefaults_serialize(const google_protobuf_FeatureSetDefaults * msg,upb_Arena * arena,size_t * len)11465 UPB_INLINE char* google_protobuf_FeatureSetDefaults_serialize(const google_protobuf_FeatureSetDefaults* msg, upb_Arena* arena, size_t* len) {
11466   char* ptr;
11467   (void)upb_Encode(UPB_UPCAST(msg), &google__protobuf__FeatureSetDefaults_msg_init, 0, arena, &ptr, len);
11468   return ptr;
11469 }
google_protobuf_FeatureSetDefaults_serialize_ex(const google_protobuf_FeatureSetDefaults * msg,int options,upb_Arena * arena,size_t * len)11470 UPB_INLINE char* google_protobuf_FeatureSetDefaults_serialize_ex(const google_protobuf_FeatureSetDefaults* msg, int options,
11471                                  upb_Arena* arena, size_t* len) {
11472   char* ptr;
11473   (void)upb_Encode(UPB_UPCAST(msg), &google__protobuf__FeatureSetDefaults_msg_init, options, arena, &ptr, len);
11474   return ptr;
11475 }
google_protobuf_FeatureSetDefaults_clear_defaults(google_protobuf_FeatureSetDefaults * msg)11476 UPB_INLINE void google_protobuf_FeatureSetDefaults_clear_defaults(google_protobuf_FeatureSetDefaults* msg) {
11477   const upb_MiniTableField field = {1, UPB_SIZE(12, 24), 0, 0, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
11478   upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
11479 }
google_protobuf_FeatureSetDefaults_defaults(const google_protobuf_FeatureSetDefaults * msg,size_t * size)11480 UPB_INLINE const google_protobuf_FeatureSetDefaults_FeatureSetEditionDefault* const* google_protobuf_FeatureSetDefaults_defaults(const google_protobuf_FeatureSetDefaults* msg, size_t* size) {
11481   const upb_MiniTableField field = {1, UPB_SIZE(12, 24), 0, 0, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
11482   UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__FeatureSetDefaults__FeatureSetEditionDefault_msg_init);
11483   const upb_Array* arr = upb_Message_GetArray(UPB_UPCAST(msg), &field);
11484   if (arr) {
11485     if (size) *size = arr->UPB_PRIVATE(size);
11486     return (const google_protobuf_FeatureSetDefaults_FeatureSetEditionDefault* const*)upb_Array_DataPtr(arr);
11487   } else {
11488     if (size) *size = 0;
11489     return NULL;
11490   }
11491 }
_google_protobuf_FeatureSetDefaults_defaults_upb_array(const google_protobuf_FeatureSetDefaults * msg,size_t * size)11492 UPB_INLINE const upb_Array* _google_protobuf_FeatureSetDefaults_defaults_upb_array(const google_protobuf_FeatureSetDefaults* msg, size_t* size) {
11493   const upb_MiniTableField field = {1, UPB_SIZE(12, 24), 0, 0, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
11494   UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__FeatureSetDefaults__FeatureSetEditionDefault_msg_init);
11495   const upb_Array* arr = upb_Message_GetArray(UPB_UPCAST(msg), &field);
11496   if (size) {
11497     *size = arr ? arr->UPB_PRIVATE(size) : 0;
11498   }
11499   return arr;
11500 }
_google_protobuf_FeatureSetDefaults_defaults_mutable_upb_array(google_protobuf_FeatureSetDefaults * msg,size_t * size,upb_Arena * arena)11501 UPB_INLINE upb_Array* _google_protobuf_FeatureSetDefaults_defaults_mutable_upb_array(google_protobuf_FeatureSetDefaults* msg, size_t* size, upb_Arena* arena) {
11502   const upb_MiniTableField field = {1, UPB_SIZE(12, 24), 0, 0, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
11503   UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__FeatureSetDefaults__FeatureSetEditionDefault_msg_init);
11504   upb_Array* arr = upb_Message_GetOrCreateMutableArray(UPB_UPCAST(msg),
11505                                                        &field, arena);
11506   if (size) {
11507     *size = arr ? arr->UPB_PRIVATE(size) : 0;
11508   }
11509   return arr;
11510 }
google_protobuf_FeatureSetDefaults_clear_minimum_edition(google_protobuf_FeatureSetDefaults * msg)11511 UPB_INLINE void google_protobuf_FeatureSetDefaults_clear_minimum_edition(google_protobuf_FeatureSetDefaults* msg) {
11512   const upb_MiniTableField field = {4, UPB_SIZE(16, 12), 64, 1, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
11513   upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
11514 }
google_protobuf_FeatureSetDefaults_minimum_edition(const google_protobuf_FeatureSetDefaults * msg)11515 UPB_INLINE int32_t google_protobuf_FeatureSetDefaults_minimum_edition(const google_protobuf_FeatureSetDefaults* msg) {
11516   int32_t default_val = 0;
11517   int32_t ret;
11518   const upb_MiniTableField field = {4, UPB_SIZE(16, 12), 64, 1, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
11519   _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field,
11520                                     &default_val, &ret);
11521   return ret;
11522 }
google_protobuf_FeatureSetDefaults_has_minimum_edition(const google_protobuf_FeatureSetDefaults * msg)11523 UPB_INLINE bool google_protobuf_FeatureSetDefaults_has_minimum_edition(const google_protobuf_FeatureSetDefaults* msg) {
11524   const upb_MiniTableField field = {4, UPB_SIZE(16, 12), 64, 1, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
11525   return upb_Message_HasBaseField(UPB_UPCAST(msg), &field);
11526 }
google_protobuf_FeatureSetDefaults_clear_maximum_edition(google_protobuf_FeatureSetDefaults * msg)11527 UPB_INLINE void google_protobuf_FeatureSetDefaults_clear_maximum_edition(google_protobuf_FeatureSetDefaults* msg) {
11528   const upb_MiniTableField field = {5, UPB_SIZE(20, 16), 65, 2, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
11529   upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
11530 }
google_protobuf_FeatureSetDefaults_maximum_edition(const google_protobuf_FeatureSetDefaults * msg)11531 UPB_INLINE int32_t google_protobuf_FeatureSetDefaults_maximum_edition(const google_protobuf_FeatureSetDefaults* msg) {
11532   int32_t default_val = 0;
11533   int32_t ret;
11534   const upb_MiniTableField field = {5, UPB_SIZE(20, 16), 65, 2, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
11535   _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field,
11536                                     &default_val, &ret);
11537   return ret;
11538 }
google_protobuf_FeatureSetDefaults_has_maximum_edition(const google_protobuf_FeatureSetDefaults * msg)11539 UPB_INLINE bool google_protobuf_FeatureSetDefaults_has_maximum_edition(const google_protobuf_FeatureSetDefaults* msg) {
11540   const upb_MiniTableField field = {5, UPB_SIZE(20, 16), 65, 2, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
11541   return upb_Message_HasBaseField(UPB_UPCAST(msg), &field);
11542 }
11543 
google_protobuf_FeatureSetDefaults_mutable_defaults(google_protobuf_FeatureSetDefaults * msg,size_t * size)11544 UPB_INLINE google_protobuf_FeatureSetDefaults_FeatureSetEditionDefault** google_protobuf_FeatureSetDefaults_mutable_defaults(google_protobuf_FeatureSetDefaults* msg, size_t* size) {
11545   upb_MiniTableField field = {1, UPB_SIZE(12, 24), 0, 0, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
11546   UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__FeatureSetDefaults__FeatureSetEditionDefault_msg_init);
11547   upb_Array* arr = upb_Message_GetMutableArray(UPB_UPCAST(msg), &field);
11548   if (arr) {
11549     if (size) *size = arr->UPB_PRIVATE(size);
11550     return (google_protobuf_FeatureSetDefaults_FeatureSetEditionDefault**)upb_Array_MutableDataPtr(arr);
11551   } else {
11552     if (size) *size = 0;
11553     return NULL;
11554   }
11555 }
google_protobuf_FeatureSetDefaults_resize_defaults(google_protobuf_FeatureSetDefaults * msg,size_t size,upb_Arena * arena)11556 UPB_INLINE google_protobuf_FeatureSetDefaults_FeatureSetEditionDefault** google_protobuf_FeatureSetDefaults_resize_defaults(google_protobuf_FeatureSetDefaults* msg, size_t size, upb_Arena* arena) {
11557   upb_MiniTableField field = {1, UPB_SIZE(12, 24), 0, 0, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
11558   return (google_protobuf_FeatureSetDefaults_FeatureSetEditionDefault**)upb_Message_ResizeArrayUninitialized(UPB_UPCAST(msg),
11559                                                    &field, size, arena);
11560 }
google_protobuf_FeatureSetDefaults_add_defaults(google_protobuf_FeatureSetDefaults * msg,upb_Arena * arena)11561 UPB_INLINE struct google_protobuf_FeatureSetDefaults_FeatureSetEditionDefault* google_protobuf_FeatureSetDefaults_add_defaults(google_protobuf_FeatureSetDefaults* msg, upb_Arena* arena) {
11562   upb_MiniTableField field = {1, UPB_SIZE(12, 24), 0, 0, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
11563   UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__FeatureSetDefaults__FeatureSetEditionDefault_msg_init);
11564   upb_Array* arr = upb_Message_GetOrCreateMutableArray(
11565       UPB_UPCAST(msg), &field, arena);
11566   if (!arr || !UPB_PRIVATE(_upb_Array_ResizeUninitialized)(
11567                   arr, arr->UPB_PRIVATE(size) + 1, arena)) {
11568     return NULL;
11569   }
11570   struct google_protobuf_FeatureSetDefaults_FeatureSetEditionDefault* sub = (struct google_protobuf_FeatureSetDefaults_FeatureSetEditionDefault*)_upb_Message_New(&google__protobuf__FeatureSetDefaults__FeatureSetEditionDefault_msg_init, arena);
11571   if (!arr || !sub) return NULL;
11572   UPB_PRIVATE(_upb_Array_Set)
11573   (arr, arr->UPB_PRIVATE(size) - 1, &sub, sizeof(sub));
11574   return sub;
11575 }
google_protobuf_FeatureSetDefaults_set_minimum_edition(google_protobuf_FeatureSetDefaults * msg,int32_t value)11576 UPB_INLINE void google_protobuf_FeatureSetDefaults_set_minimum_edition(google_protobuf_FeatureSetDefaults *msg, int32_t value) {
11577   const upb_MiniTableField field = {4, UPB_SIZE(16, 12), 64, 1, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
11578   upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
11579 }
google_protobuf_FeatureSetDefaults_set_maximum_edition(google_protobuf_FeatureSetDefaults * msg,int32_t value)11580 UPB_INLINE void google_protobuf_FeatureSetDefaults_set_maximum_edition(google_protobuf_FeatureSetDefaults *msg, int32_t value) {
11581   const upb_MiniTableField field = {5, UPB_SIZE(20, 16), 65, 2, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
11582   upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
11583 }
11584 
11585 /* google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault */
11586 
google_protobuf_FeatureSetDefaults_FeatureSetEditionDefault_new(upb_Arena * arena)11587 UPB_INLINE google_protobuf_FeatureSetDefaults_FeatureSetEditionDefault* google_protobuf_FeatureSetDefaults_FeatureSetEditionDefault_new(upb_Arena* arena) {
11588   return (google_protobuf_FeatureSetDefaults_FeatureSetEditionDefault*)_upb_Message_New(&google__protobuf__FeatureSetDefaults__FeatureSetEditionDefault_msg_init, arena);
11589 }
google_protobuf_FeatureSetDefaults_FeatureSetEditionDefault_parse(const char * buf,size_t size,upb_Arena * arena)11590 UPB_INLINE google_protobuf_FeatureSetDefaults_FeatureSetEditionDefault* google_protobuf_FeatureSetDefaults_FeatureSetEditionDefault_parse(const char* buf, size_t size, upb_Arena* arena) {
11591   google_protobuf_FeatureSetDefaults_FeatureSetEditionDefault* ret = google_protobuf_FeatureSetDefaults_FeatureSetEditionDefault_new(arena);
11592   if (!ret) return NULL;
11593   if (upb_Decode(buf, size, UPB_UPCAST(ret), &google__protobuf__FeatureSetDefaults__FeatureSetEditionDefault_msg_init, NULL, 0, arena) !=
11594       kUpb_DecodeStatus_Ok) {
11595     return NULL;
11596   }
11597   return ret;
11598 }
google_protobuf_FeatureSetDefaults_FeatureSetEditionDefault_parse_ex(const char * buf,size_t size,const upb_ExtensionRegistry * extreg,int options,upb_Arena * arena)11599 UPB_INLINE google_protobuf_FeatureSetDefaults_FeatureSetEditionDefault* google_protobuf_FeatureSetDefaults_FeatureSetEditionDefault_parse_ex(const char* buf, size_t size,
11600                            const upb_ExtensionRegistry* extreg,
11601                            int options, upb_Arena* arena) {
11602   google_protobuf_FeatureSetDefaults_FeatureSetEditionDefault* ret = google_protobuf_FeatureSetDefaults_FeatureSetEditionDefault_new(arena);
11603   if (!ret) return NULL;
11604   if (upb_Decode(buf, size, UPB_UPCAST(ret), &google__protobuf__FeatureSetDefaults__FeatureSetEditionDefault_msg_init, extreg, options,
11605                  arena) != kUpb_DecodeStatus_Ok) {
11606     return NULL;
11607   }
11608   return ret;
11609 }
google_protobuf_FeatureSetDefaults_FeatureSetEditionDefault_serialize(const google_protobuf_FeatureSetDefaults_FeatureSetEditionDefault * msg,upb_Arena * arena,size_t * len)11610 UPB_INLINE char* google_protobuf_FeatureSetDefaults_FeatureSetEditionDefault_serialize(const google_protobuf_FeatureSetDefaults_FeatureSetEditionDefault* msg, upb_Arena* arena, size_t* len) {
11611   char* ptr;
11612   (void)upb_Encode(UPB_UPCAST(msg), &google__protobuf__FeatureSetDefaults__FeatureSetEditionDefault_msg_init, 0, arena, &ptr, len);
11613   return ptr;
11614 }
google_protobuf_FeatureSetDefaults_FeatureSetEditionDefault_serialize_ex(const google_protobuf_FeatureSetDefaults_FeatureSetEditionDefault * msg,int options,upb_Arena * arena,size_t * len)11615 UPB_INLINE char* google_protobuf_FeatureSetDefaults_FeatureSetEditionDefault_serialize_ex(const google_protobuf_FeatureSetDefaults_FeatureSetEditionDefault* msg, int options,
11616                                  upb_Arena* arena, size_t* len) {
11617   char* ptr;
11618   (void)upb_Encode(UPB_UPCAST(msg), &google__protobuf__FeatureSetDefaults__FeatureSetEditionDefault_msg_init, options, arena, &ptr, len);
11619   return ptr;
11620 }
google_protobuf_FeatureSetDefaults_FeatureSetEditionDefault_clear_edition(google_protobuf_FeatureSetDefaults_FeatureSetEditionDefault * msg)11621 UPB_INLINE void google_protobuf_FeatureSetDefaults_FeatureSetEditionDefault_clear_edition(google_protobuf_FeatureSetDefaults_FeatureSetEditionDefault* msg) {
11622   const upb_MiniTableField field = {3, 12, 64, 2, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
11623   upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
11624 }
google_protobuf_FeatureSetDefaults_FeatureSetEditionDefault_edition(const google_protobuf_FeatureSetDefaults_FeatureSetEditionDefault * msg)11625 UPB_INLINE int32_t google_protobuf_FeatureSetDefaults_FeatureSetEditionDefault_edition(const google_protobuf_FeatureSetDefaults_FeatureSetEditionDefault* msg) {
11626   int32_t default_val = 0;
11627   int32_t ret;
11628   const upb_MiniTableField field = {3, 12, 64, 2, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
11629   _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field,
11630                                     &default_val, &ret);
11631   return ret;
11632 }
google_protobuf_FeatureSetDefaults_FeatureSetEditionDefault_has_edition(const google_protobuf_FeatureSetDefaults_FeatureSetEditionDefault * msg)11633 UPB_INLINE bool google_protobuf_FeatureSetDefaults_FeatureSetEditionDefault_has_edition(const google_protobuf_FeatureSetDefaults_FeatureSetEditionDefault* msg) {
11634   const upb_MiniTableField field = {3, 12, 64, 2, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
11635   return upb_Message_HasBaseField(UPB_UPCAST(msg), &field);
11636 }
google_protobuf_FeatureSetDefaults_FeatureSetEditionDefault_clear_overridable_features(google_protobuf_FeatureSetDefaults_FeatureSetEditionDefault * msg)11637 UPB_INLINE void google_protobuf_FeatureSetDefaults_FeatureSetEditionDefault_clear_overridable_features(google_protobuf_FeatureSetDefaults_FeatureSetEditionDefault* msg) {
11638   const upb_MiniTableField field = {4, 16, 65, 0, 11, (int)kUpb_FieldMode_Scalar | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
11639   upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
11640 }
google_protobuf_FeatureSetDefaults_FeatureSetEditionDefault_overridable_features(const google_protobuf_FeatureSetDefaults_FeatureSetEditionDefault * msg)11641 UPB_INLINE const google_protobuf_FeatureSet* google_protobuf_FeatureSetDefaults_FeatureSetEditionDefault_overridable_features(const google_protobuf_FeatureSetDefaults_FeatureSetEditionDefault* msg) {
11642   const google_protobuf_FeatureSet* default_val = NULL;
11643   const google_protobuf_FeatureSet* ret;
11644   const upb_MiniTableField field = {4, 16, 65, 0, 11, (int)kUpb_FieldMode_Scalar | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
11645   UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__FeatureSet_msg_init);
11646   _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field,
11647                                     &default_val, &ret);
11648   return ret;
11649 }
google_protobuf_FeatureSetDefaults_FeatureSetEditionDefault_has_overridable_features(const google_protobuf_FeatureSetDefaults_FeatureSetEditionDefault * msg)11650 UPB_INLINE bool google_protobuf_FeatureSetDefaults_FeatureSetEditionDefault_has_overridable_features(const google_protobuf_FeatureSetDefaults_FeatureSetEditionDefault* msg) {
11651   const upb_MiniTableField field = {4, 16, 65, 0, 11, (int)kUpb_FieldMode_Scalar | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
11652   return upb_Message_HasBaseField(UPB_UPCAST(msg), &field);
11653 }
google_protobuf_FeatureSetDefaults_FeatureSetEditionDefault_clear_fixed_features(google_protobuf_FeatureSetDefaults_FeatureSetEditionDefault * msg)11654 UPB_INLINE void google_protobuf_FeatureSetDefaults_FeatureSetEditionDefault_clear_fixed_features(google_protobuf_FeatureSetDefaults_FeatureSetEditionDefault* msg) {
11655   const upb_MiniTableField field = {5, UPB_SIZE(20, 24), 66, 1, 11, (int)kUpb_FieldMode_Scalar | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
11656   upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
11657 }
google_protobuf_FeatureSetDefaults_FeatureSetEditionDefault_fixed_features(const google_protobuf_FeatureSetDefaults_FeatureSetEditionDefault * msg)11658 UPB_INLINE const google_protobuf_FeatureSet* google_protobuf_FeatureSetDefaults_FeatureSetEditionDefault_fixed_features(const google_protobuf_FeatureSetDefaults_FeatureSetEditionDefault* msg) {
11659   const google_protobuf_FeatureSet* default_val = NULL;
11660   const google_protobuf_FeatureSet* ret;
11661   const upb_MiniTableField field = {5, UPB_SIZE(20, 24), 66, 1, 11, (int)kUpb_FieldMode_Scalar | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
11662   UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__FeatureSet_msg_init);
11663   _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field,
11664                                     &default_val, &ret);
11665   return ret;
11666 }
google_protobuf_FeatureSetDefaults_FeatureSetEditionDefault_has_fixed_features(const google_protobuf_FeatureSetDefaults_FeatureSetEditionDefault * msg)11667 UPB_INLINE bool google_protobuf_FeatureSetDefaults_FeatureSetEditionDefault_has_fixed_features(const google_protobuf_FeatureSetDefaults_FeatureSetEditionDefault* msg) {
11668   const upb_MiniTableField field = {5, UPB_SIZE(20, 24), 66, 1, 11, (int)kUpb_FieldMode_Scalar | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
11669   return upb_Message_HasBaseField(UPB_UPCAST(msg), &field);
11670 }
11671 
google_protobuf_FeatureSetDefaults_FeatureSetEditionDefault_set_edition(google_protobuf_FeatureSetDefaults_FeatureSetEditionDefault * msg,int32_t value)11672 UPB_INLINE void google_protobuf_FeatureSetDefaults_FeatureSetEditionDefault_set_edition(google_protobuf_FeatureSetDefaults_FeatureSetEditionDefault *msg, int32_t value) {
11673   const upb_MiniTableField field = {3, 12, 64, 2, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
11674   upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
11675 }
google_protobuf_FeatureSetDefaults_FeatureSetEditionDefault_set_overridable_features(google_protobuf_FeatureSetDefaults_FeatureSetEditionDefault * msg,google_protobuf_FeatureSet * value)11676 UPB_INLINE void google_protobuf_FeatureSetDefaults_FeatureSetEditionDefault_set_overridable_features(google_protobuf_FeatureSetDefaults_FeatureSetEditionDefault *msg, google_protobuf_FeatureSet* value) {
11677   const upb_MiniTableField field = {4, 16, 65, 0, 11, (int)kUpb_FieldMode_Scalar | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
11678   UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__FeatureSet_msg_init);
11679   upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
11680 }
google_protobuf_FeatureSetDefaults_FeatureSetEditionDefault_mutable_overridable_features(google_protobuf_FeatureSetDefaults_FeatureSetEditionDefault * msg,upb_Arena * arena)11681 UPB_INLINE struct google_protobuf_FeatureSet* google_protobuf_FeatureSetDefaults_FeatureSetEditionDefault_mutable_overridable_features(google_protobuf_FeatureSetDefaults_FeatureSetEditionDefault* msg, upb_Arena* arena) {
11682   struct google_protobuf_FeatureSet* sub = (struct google_protobuf_FeatureSet*)google_protobuf_FeatureSetDefaults_FeatureSetEditionDefault_overridable_features(msg);
11683   if (sub == NULL) {
11684     sub = (struct google_protobuf_FeatureSet*)_upb_Message_New(&google__protobuf__FeatureSet_msg_init, arena);
11685     if (sub) google_protobuf_FeatureSetDefaults_FeatureSetEditionDefault_set_overridable_features(msg, sub);
11686   }
11687   return sub;
11688 }
google_protobuf_FeatureSetDefaults_FeatureSetEditionDefault_set_fixed_features(google_protobuf_FeatureSetDefaults_FeatureSetEditionDefault * msg,google_protobuf_FeatureSet * value)11689 UPB_INLINE void google_protobuf_FeatureSetDefaults_FeatureSetEditionDefault_set_fixed_features(google_protobuf_FeatureSetDefaults_FeatureSetEditionDefault *msg, google_protobuf_FeatureSet* value) {
11690   const upb_MiniTableField field = {5, UPB_SIZE(20, 24), 66, 1, 11, (int)kUpb_FieldMode_Scalar | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
11691   UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__FeatureSet_msg_init);
11692   upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
11693 }
google_protobuf_FeatureSetDefaults_FeatureSetEditionDefault_mutable_fixed_features(google_protobuf_FeatureSetDefaults_FeatureSetEditionDefault * msg,upb_Arena * arena)11694 UPB_INLINE struct google_protobuf_FeatureSet* google_protobuf_FeatureSetDefaults_FeatureSetEditionDefault_mutable_fixed_features(google_protobuf_FeatureSetDefaults_FeatureSetEditionDefault* msg, upb_Arena* arena) {
11695   struct google_protobuf_FeatureSet* sub = (struct google_protobuf_FeatureSet*)google_protobuf_FeatureSetDefaults_FeatureSetEditionDefault_fixed_features(msg);
11696   if (sub == NULL) {
11697     sub = (struct google_protobuf_FeatureSet*)_upb_Message_New(&google__protobuf__FeatureSet_msg_init, arena);
11698     if (sub) google_protobuf_FeatureSetDefaults_FeatureSetEditionDefault_set_fixed_features(msg, sub);
11699   }
11700   return sub;
11701 }
11702 
11703 /* google.protobuf.SourceCodeInfo */
11704 
google_protobuf_SourceCodeInfo_new(upb_Arena * arena)11705 UPB_INLINE google_protobuf_SourceCodeInfo* google_protobuf_SourceCodeInfo_new(upb_Arena* arena) {
11706   return (google_protobuf_SourceCodeInfo*)_upb_Message_New(&google__protobuf__SourceCodeInfo_msg_init, arena);
11707 }
google_protobuf_SourceCodeInfo_parse(const char * buf,size_t size,upb_Arena * arena)11708 UPB_INLINE google_protobuf_SourceCodeInfo* google_protobuf_SourceCodeInfo_parse(const char* buf, size_t size, upb_Arena* arena) {
11709   google_protobuf_SourceCodeInfo* ret = google_protobuf_SourceCodeInfo_new(arena);
11710   if (!ret) return NULL;
11711   if (upb_Decode(buf, size, UPB_UPCAST(ret), &google__protobuf__SourceCodeInfo_msg_init, NULL, 0, arena) !=
11712       kUpb_DecodeStatus_Ok) {
11713     return NULL;
11714   }
11715   return ret;
11716 }
google_protobuf_SourceCodeInfo_parse_ex(const char * buf,size_t size,const upb_ExtensionRegistry * extreg,int options,upb_Arena * arena)11717 UPB_INLINE google_protobuf_SourceCodeInfo* google_protobuf_SourceCodeInfo_parse_ex(const char* buf, size_t size,
11718                            const upb_ExtensionRegistry* extreg,
11719                            int options, upb_Arena* arena) {
11720   google_protobuf_SourceCodeInfo* ret = google_protobuf_SourceCodeInfo_new(arena);
11721   if (!ret) return NULL;
11722   if (upb_Decode(buf, size, UPB_UPCAST(ret), &google__protobuf__SourceCodeInfo_msg_init, extreg, options,
11723                  arena) != kUpb_DecodeStatus_Ok) {
11724     return NULL;
11725   }
11726   return ret;
11727 }
google_protobuf_SourceCodeInfo_serialize(const google_protobuf_SourceCodeInfo * msg,upb_Arena * arena,size_t * len)11728 UPB_INLINE char* google_protobuf_SourceCodeInfo_serialize(const google_protobuf_SourceCodeInfo* msg, upb_Arena* arena, size_t* len) {
11729   char* ptr;
11730   (void)upb_Encode(UPB_UPCAST(msg), &google__protobuf__SourceCodeInfo_msg_init, 0, arena, &ptr, len);
11731   return ptr;
11732 }
google_protobuf_SourceCodeInfo_serialize_ex(const google_protobuf_SourceCodeInfo * msg,int options,upb_Arena * arena,size_t * len)11733 UPB_INLINE char* google_protobuf_SourceCodeInfo_serialize_ex(const google_protobuf_SourceCodeInfo* msg, int options,
11734                                  upb_Arena* arena, size_t* len) {
11735   char* ptr;
11736   (void)upb_Encode(UPB_UPCAST(msg), &google__protobuf__SourceCodeInfo_msg_init, options, arena, &ptr, len);
11737   return ptr;
11738 }
google_protobuf_SourceCodeInfo_clear_location(google_protobuf_SourceCodeInfo * msg)11739 UPB_INLINE void google_protobuf_SourceCodeInfo_clear_location(google_protobuf_SourceCodeInfo* msg) {
11740   const upb_MiniTableField field = {1, 8, 0, 0, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
11741   upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
11742 }
google_protobuf_SourceCodeInfo_location(const google_protobuf_SourceCodeInfo * msg,size_t * size)11743 UPB_INLINE const google_protobuf_SourceCodeInfo_Location* const* google_protobuf_SourceCodeInfo_location(const google_protobuf_SourceCodeInfo* msg, size_t* size) {
11744   const upb_MiniTableField field = {1, 8, 0, 0, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
11745   UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__SourceCodeInfo__Location_msg_init);
11746   const upb_Array* arr = upb_Message_GetArray(UPB_UPCAST(msg), &field);
11747   if (arr) {
11748     if (size) *size = arr->UPB_PRIVATE(size);
11749     return (const google_protobuf_SourceCodeInfo_Location* const*)upb_Array_DataPtr(arr);
11750   } else {
11751     if (size) *size = 0;
11752     return NULL;
11753   }
11754 }
_google_protobuf_SourceCodeInfo_location_upb_array(const google_protobuf_SourceCodeInfo * msg,size_t * size)11755 UPB_INLINE const upb_Array* _google_protobuf_SourceCodeInfo_location_upb_array(const google_protobuf_SourceCodeInfo* msg, size_t* size) {
11756   const upb_MiniTableField field = {1, 8, 0, 0, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
11757   UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__SourceCodeInfo__Location_msg_init);
11758   const upb_Array* arr = upb_Message_GetArray(UPB_UPCAST(msg), &field);
11759   if (size) {
11760     *size = arr ? arr->UPB_PRIVATE(size) : 0;
11761   }
11762   return arr;
11763 }
_google_protobuf_SourceCodeInfo_location_mutable_upb_array(google_protobuf_SourceCodeInfo * msg,size_t * size,upb_Arena * arena)11764 UPB_INLINE upb_Array* _google_protobuf_SourceCodeInfo_location_mutable_upb_array(google_protobuf_SourceCodeInfo* msg, size_t* size, upb_Arena* arena) {
11765   const upb_MiniTableField field = {1, 8, 0, 0, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
11766   UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__SourceCodeInfo__Location_msg_init);
11767   upb_Array* arr = upb_Message_GetOrCreateMutableArray(UPB_UPCAST(msg),
11768                                                        &field, arena);
11769   if (size) {
11770     *size = arr ? arr->UPB_PRIVATE(size) : 0;
11771   }
11772   return arr;
11773 }
11774 
google_protobuf_SourceCodeInfo_mutable_location(google_protobuf_SourceCodeInfo * msg,size_t * size)11775 UPB_INLINE google_protobuf_SourceCodeInfo_Location** google_protobuf_SourceCodeInfo_mutable_location(google_protobuf_SourceCodeInfo* msg, size_t* size) {
11776   upb_MiniTableField field = {1, 8, 0, 0, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
11777   UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__SourceCodeInfo__Location_msg_init);
11778   upb_Array* arr = upb_Message_GetMutableArray(UPB_UPCAST(msg), &field);
11779   if (arr) {
11780     if (size) *size = arr->UPB_PRIVATE(size);
11781     return (google_protobuf_SourceCodeInfo_Location**)upb_Array_MutableDataPtr(arr);
11782   } else {
11783     if (size) *size = 0;
11784     return NULL;
11785   }
11786 }
google_protobuf_SourceCodeInfo_resize_location(google_protobuf_SourceCodeInfo * msg,size_t size,upb_Arena * arena)11787 UPB_INLINE google_protobuf_SourceCodeInfo_Location** google_protobuf_SourceCodeInfo_resize_location(google_protobuf_SourceCodeInfo* msg, size_t size, upb_Arena* arena) {
11788   upb_MiniTableField field = {1, 8, 0, 0, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
11789   return (google_protobuf_SourceCodeInfo_Location**)upb_Message_ResizeArrayUninitialized(UPB_UPCAST(msg),
11790                                                    &field, size, arena);
11791 }
google_protobuf_SourceCodeInfo_add_location(google_protobuf_SourceCodeInfo * msg,upb_Arena * arena)11792 UPB_INLINE struct google_protobuf_SourceCodeInfo_Location* google_protobuf_SourceCodeInfo_add_location(google_protobuf_SourceCodeInfo* msg, upb_Arena* arena) {
11793   upb_MiniTableField field = {1, 8, 0, 0, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
11794   UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__SourceCodeInfo__Location_msg_init);
11795   upb_Array* arr = upb_Message_GetOrCreateMutableArray(
11796       UPB_UPCAST(msg), &field, arena);
11797   if (!arr || !UPB_PRIVATE(_upb_Array_ResizeUninitialized)(
11798                   arr, arr->UPB_PRIVATE(size) + 1, arena)) {
11799     return NULL;
11800   }
11801   struct google_protobuf_SourceCodeInfo_Location* sub = (struct google_protobuf_SourceCodeInfo_Location*)_upb_Message_New(&google__protobuf__SourceCodeInfo__Location_msg_init, arena);
11802   if (!arr || !sub) return NULL;
11803   UPB_PRIVATE(_upb_Array_Set)
11804   (arr, arr->UPB_PRIVATE(size) - 1, &sub, sizeof(sub));
11805   return sub;
11806 }
11807 
11808 /* google.protobuf.SourceCodeInfo.Location */
11809 
google_protobuf_SourceCodeInfo_Location_new(upb_Arena * arena)11810 UPB_INLINE google_protobuf_SourceCodeInfo_Location* google_protobuf_SourceCodeInfo_Location_new(upb_Arena* arena) {
11811   return (google_protobuf_SourceCodeInfo_Location*)_upb_Message_New(&google__protobuf__SourceCodeInfo__Location_msg_init, arena);
11812 }
google_protobuf_SourceCodeInfo_Location_parse(const char * buf,size_t size,upb_Arena * arena)11813 UPB_INLINE google_protobuf_SourceCodeInfo_Location* google_protobuf_SourceCodeInfo_Location_parse(const char* buf, size_t size, upb_Arena* arena) {
11814   google_protobuf_SourceCodeInfo_Location* ret = google_protobuf_SourceCodeInfo_Location_new(arena);
11815   if (!ret) return NULL;
11816   if (upb_Decode(buf, size, UPB_UPCAST(ret), &google__protobuf__SourceCodeInfo__Location_msg_init, NULL, 0, arena) !=
11817       kUpb_DecodeStatus_Ok) {
11818     return NULL;
11819   }
11820   return ret;
11821 }
google_protobuf_SourceCodeInfo_Location_parse_ex(const char * buf,size_t size,const upb_ExtensionRegistry * extreg,int options,upb_Arena * arena)11822 UPB_INLINE google_protobuf_SourceCodeInfo_Location* google_protobuf_SourceCodeInfo_Location_parse_ex(const char* buf, size_t size,
11823                            const upb_ExtensionRegistry* extreg,
11824                            int options, upb_Arena* arena) {
11825   google_protobuf_SourceCodeInfo_Location* ret = google_protobuf_SourceCodeInfo_Location_new(arena);
11826   if (!ret) return NULL;
11827   if (upb_Decode(buf, size, UPB_UPCAST(ret), &google__protobuf__SourceCodeInfo__Location_msg_init, extreg, options,
11828                  arena) != kUpb_DecodeStatus_Ok) {
11829     return NULL;
11830   }
11831   return ret;
11832 }
google_protobuf_SourceCodeInfo_Location_serialize(const google_protobuf_SourceCodeInfo_Location * msg,upb_Arena * arena,size_t * len)11833 UPB_INLINE char* google_protobuf_SourceCodeInfo_Location_serialize(const google_protobuf_SourceCodeInfo_Location* msg, upb_Arena* arena, size_t* len) {
11834   char* ptr;
11835   (void)upb_Encode(UPB_UPCAST(msg), &google__protobuf__SourceCodeInfo__Location_msg_init, 0, arena, &ptr, len);
11836   return ptr;
11837 }
google_protobuf_SourceCodeInfo_Location_serialize_ex(const google_protobuf_SourceCodeInfo_Location * msg,int options,upb_Arena * arena,size_t * len)11838 UPB_INLINE char* google_protobuf_SourceCodeInfo_Location_serialize_ex(const google_protobuf_SourceCodeInfo_Location* msg, int options,
11839                                  upb_Arena* arena, size_t* len) {
11840   char* ptr;
11841   (void)upb_Encode(UPB_UPCAST(msg), &google__protobuf__SourceCodeInfo__Location_msg_init, options, arena, &ptr, len);
11842   return ptr;
11843 }
google_protobuf_SourceCodeInfo_Location_clear_path(google_protobuf_SourceCodeInfo_Location * msg)11844 UPB_INLINE void google_protobuf_SourceCodeInfo_Location_clear_path(google_protobuf_SourceCodeInfo_Location* msg) {
11845   const upb_MiniTableField field = {1, UPB_SIZE(12, 16), 0, kUpb_NoSub, 5, (int)kUpb_FieldMode_Array | (int)kUpb_LabelFlags_IsPacked | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
11846   upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
11847 }
google_protobuf_SourceCodeInfo_Location_path(const google_protobuf_SourceCodeInfo_Location * msg,size_t * size)11848 UPB_INLINE int32_t const* google_protobuf_SourceCodeInfo_Location_path(const google_protobuf_SourceCodeInfo_Location* msg, size_t* size) {
11849   const upb_MiniTableField field = {1, UPB_SIZE(12, 16), 0, kUpb_NoSub, 5, (int)kUpb_FieldMode_Array | (int)kUpb_LabelFlags_IsPacked | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
11850   const upb_Array* arr = upb_Message_GetArray(UPB_UPCAST(msg), &field);
11851   if (arr) {
11852     if (size) *size = arr->UPB_PRIVATE(size);
11853     return (int32_t const*)upb_Array_DataPtr(arr);
11854   } else {
11855     if (size) *size = 0;
11856     return NULL;
11857   }
11858 }
_google_protobuf_SourceCodeInfo_Location_path_upb_array(const google_protobuf_SourceCodeInfo_Location * msg,size_t * size)11859 UPB_INLINE const upb_Array* _google_protobuf_SourceCodeInfo_Location_path_upb_array(const google_protobuf_SourceCodeInfo_Location* msg, size_t* size) {
11860   const upb_MiniTableField field = {1, UPB_SIZE(12, 16), 0, kUpb_NoSub, 5, (int)kUpb_FieldMode_Array | (int)kUpb_LabelFlags_IsPacked | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
11861   const upb_Array* arr = upb_Message_GetArray(UPB_UPCAST(msg), &field);
11862   if (size) {
11863     *size = arr ? arr->UPB_PRIVATE(size) : 0;
11864   }
11865   return arr;
11866 }
_google_protobuf_SourceCodeInfo_Location_path_mutable_upb_array(google_protobuf_SourceCodeInfo_Location * msg,size_t * size,upb_Arena * arena)11867 UPB_INLINE upb_Array* _google_protobuf_SourceCodeInfo_Location_path_mutable_upb_array(google_protobuf_SourceCodeInfo_Location* msg, size_t* size, upb_Arena* arena) {
11868   const upb_MiniTableField field = {1, UPB_SIZE(12, 16), 0, kUpb_NoSub, 5, (int)kUpb_FieldMode_Array | (int)kUpb_LabelFlags_IsPacked | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
11869   upb_Array* arr = upb_Message_GetOrCreateMutableArray(UPB_UPCAST(msg),
11870                                                        &field, arena);
11871   if (size) {
11872     *size = arr ? arr->UPB_PRIVATE(size) : 0;
11873   }
11874   return arr;
11875 }
google_protobuf_SourceCodeInfo_Location_clear_span(google_protobuf_SourceCodeInfo_Location * msg)11876 UPB_INLINE void google_protobuf_SourceCodeInfo_Location_clear_span(google_protobuf_SourceCodeInfo_Location* msg) {
11877   const upb_MiniTableField field = {2, UPB_SIZE(16, 24), 0, kUpb_NoSub, 5, (int)kUpb_FieldMode_Array | (int)kUpb_LabelFlags_IsPacked | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
11878   upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
11879 }
google_protobuf_SourceCodeInfo_Location_span(const google_protobuf_SourceCodeInfo_Location * msg,size_t * size)11880 UPB_INLINE int32_t const* google_protobuf_SourceCodeInfo_Location_span(const google_protobuf_SourceCodeInfo_Location* msg, size_t* size) {
11881   const upb_MiniTableField field = {2, UPB_SIZE(16, 24), 0, kUpb_NoSub, 5, (int)kUpb_FieldMode_Array | (int)kUpb_LabelFlags_IsPacked | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
11882   const upb_Array* arr = upb_Message_GetArray(UPB_UPCAST(msg), &field);
11883   if (arr) {
11884     if (size) *size = arr->UPB_PRIVATE(size);
11885     return (int32_t const*)upb_Array_DataPtr(arr);
11886   } else {
11887     if (size) *size = 0;
11888     return NULL;
11889   }
11890 }
_google_protobuf_SourceCodeInfo_Location_span_upb_array(const google_protobuf_SourceCodeInfo_Location * msg,size_t * size)11891 UPB_INLINE const upb_Array* _google_protobuf_SourceCodeInfo_Location_span_upb_array(const google_protobuf_SourceCodeInfo_Location* msg, size_t* size) {
11892   const upb_MiniTableField field = {2, UPB_SIZE(16, 24), 0, kUpb_NoSub, 5, (int)kUpb_FieldMode_Array | (int)kUpb_LabelFlags_IsPacked | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
11893   const upb_Array* arr = upb_Message_GetArray(UPB_UPCAST(msg), &field);
11894   if (size) {
11895     *size = arr ? arr->UPB_PRIVATE(size) : 0;
11896   }
11897   return arr;
11898 }
_google_protobuf_SourceCodeInfo_Location_span_mutable_upb_array(google_protobuf_SourceCodeInfo_Location * msg,size_t * size,upb_Arena * arena)11899 UPB_INLINE upb_Array* _google_protobuf_SourceCodeInfo_Location_span_mutable_upb_array(google_protobuf_SourceCodeInfo_Location* msg, size_t* size, upb_Arena* arena) {
11900   const upb_MiniTableField field = {2, UPB_SIZE(16, 24), 0, kUpb_NoSub, 5, (int)kUpb_FieldMode_Array | (int)kUpb_LabelFlags_IsPacked | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
11901   upb_Array* arr = upb_Message_GetOrCreateMutableArray(UPB_UPCAST(msg),
11902                                                        &field, arena);
11903   if (size) {
11904     *size = arr ? arr->UPB_PRIVATE(size) : 0;
11905   }
11906   return arr;
11907 }
google_protobuf_SourceCodeInfo_Location_clear_leading_comments(google_protobuf_SourceCodeInfo_Location * msg)11908 UPB_INLINE void google_protobuf_SourceCodeInfo_Location_clear_leading_comments(google_protobuf_SourceCodeInfo_Location* msg) {
11909   const upb_MiniTableField field = {3, UPB_SIZE(24, 32), 64, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
11910   upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
11911 }
google_protobuf_SourceCodeInfo_Location_leading_comments(const google_protobuf_SourceCodeInfo_Location * msg)11912 UPB_INLINE upb_StringView google_protobuf_SourceCodeInfo_Location_leading_comments(const google_protobuf_SourceCodeInfo_Location* msg) {
11913   upb_StringView default_val = upb_StringView_FromString("");
11914   upb_StringView ret;
11915   const upb_MiniTableField field = {3, UPB_SIZE(24, 32), 64, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
11916   _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field,
11917                                     &default_val, &ret);
11918   return ret;
11919 }
google_protobuf_SourceCodeInfo_Location_has_leading_comments(const google_protobuf_SourceCodeInfo_Location * msg)11920 UPB_INLINE bool google_protobuf_SourceCodeInfo_Location_has_leading_comments(const google_protobuf_SourceCodeInfo_Location* msg) {
11921   const upb_MiniTableField field = {3, UPB_SIZE(24, 32), 64, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
11922   return upb_Message_HasBaseField(UPB_UPCAST(msg), &field);
11923 }
google_protobuf_SourceCodeInfo_Location_clear_trailing_comments(google_protobuf_SourceCodeInfo_Location * msg)11924 UPB_INLINE void google_protobuf_SourceCodeInfo_Location_clear_trailing_comments(google_protobuf_SourceCodeInfo_Location* msg) {
11925   const upb_MiniTableField field = {4, UPB_SIZE(32, 48), 65, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
11926   upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
11927 }
google_protobuf_SourceCodeInfo_Location_trailing_comments(const google_protobuf_SourceCodeInfo_Location * msg)11928 UPB_INLINE upb_StringView google_protobuf_SourceCodeInfo_Location_trailing_comments(const google_protobuf_SourceCodeInfo_Location* msg) {
11929   upb_StringView default_val = upb_StringView_FromString("");
11930   upb_StringView ret;
11931   const upb_MiniTableField field = {4, UPB_SIZE(32, 48), 65, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
11932   _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field,
11933                                     &default_val, &ret);
11934   return ret;
11935 }
google_protobuf_SourceCodeInfo_Location_has_trailing_comments(const google_protobuf_SourceCodeInfo_Location * msg)11936 UPB_INLINE bool google_protobuf_SourceCodeInfo_Location_has_trailing_comments(const google_protobuf_SourceCodeInfo_Location* msg) {
11937   const upb_MiniTableField field = {4, UPB_SIZE(32, 48), 65, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
11938   return upb_Message_HasBaseField(UPB_UPCAST(msg), &field);
11939 }
google_protobuf_SourceCodeInfo_Location_clear_leading_detached_comments(google_protobuf_SourceCodeInfo_Location * msg)11940 UPB_INLINE void google_protobuf_SourceCodeInfo_Location_clear_leading_detached_comments(google_protobuf_SourceCodeInfo_Location* msg) {
11941   const upb_MiniTableField field = {6, UPB_SIZE(20, 64), 0, kUpb_NoSub, 12, (int)kUpb_FieldMode_Array | (int)kUpb_LabelFlags_IsAlternate | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
11942   upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
11943 }
google_protobuf_SourceCodeInfo_Location_leading_detached_comments(const google_protobuf_SourceCodeInfo_Location * msg,size_t * size)11944 UPB_INLINE upb_StringView const* google_protobuf_SourceCodeInfo_Location_leading_detached_comments(const google_protobuf_SourceCodeInfo_Location* msg, size_t* size) {
11945   const upb_MiniTableField field = {6, UPB_SIZE(20, 64), 0, kUpb_NoSub, 12, (int)kUpb_FieldMode_Array | (int)kUpb_LabelFlags_IsAlternate | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
11946   const upb_Array* arr = upb_Message_GetArray(UPB_UPCAST(msg), &field);
11947   if (arr) {
11948     if (size) *size = arr->UPB_PRIVATE(size);
11949     return (upb_StringView const*)upb_Array_DataPtr(arr);
11950   } else {
11951     if (size) *size = 0;
11952     return NULL;
11953   }
11954 }
_google_protobuf_SourceCodeInfo_Location_leading_detached_comments_upb_array(const google_protobuf_SourceCodeInfo_Location * msg,size_t * size)11955 UPB_INLINE const upb_Array* _google_protobuf_SourceCodeInfo_Location_leading_detached_comments_upb_array(const google_protobuf_SourceCodeInfo_Location* msg, size_t* size) {
11956   const upb_MiniTableField field = {6, UPB_SIZE(20, 64), 0, kUpb_NoSub, 12, (int)kUpb_FieldMode_Array | (int)kUpb_LabelFlags_IsAlternate | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
11957   const upb_Array* arr = upb_Message_GetArray(UPB_UPCAST(msg), &field);
11958   if (size) {
11959     *size = arr ? arr->UPB_PRIVATE(size) : 0;
11960   }
11961   return arr;
11962 }
_google_protobuf_SourceCodeInfo_Location_leading_detached_comments_mutable_upb_array(google_protobuf_SourceCodeInfo_Location * msg,size_t * size,upb_Arena * arena)11963 UPB_INLINE upb_Array* _google_protobuf_SourceCodeInfo_Location_leading_detached_comments_mutable_upb_array(google_protobuf_SourceCodeInfo_Location* msg, size_t* size, upb_Arena* arena) {
11964   const upb_MiniTableField field = {6, UPB_SIZE(20, 64), 0, kUpb_NoSub, 12, (int)kUpb_FieldMode_Array | (int)kUpb_LabelFlags_IsAlternate | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
11965   upb_Array* arr = upb_Message_GetOrCreateMutableArray(UPB_UPCAST(msg),
11966                                                        &field, arena);
11967   if (size) {
11968     *size = arr ? arr->UPB_PRIVATE(size) : 0;
11969   }
11970   return arr;
11971 }
11972 
google_protobuf_SourceCodeInfo_Location_mutable_path(google_protobuf_SourceCodeInfo_Location * msg,size_t * size)11973 UPB_INLINE int32_t* google_protobuf_SourceCodeInfo_Location_mutable_path(google_protobuf_SourceCodeInfo_Location* msg, size_t* size) {
11974   upb_MiniTableField field = {1, UPB_SIZE(12, 16), 0, kUpb_NoSub, 5, (int)kUpb_FieldMode_Array | (int)kUpb_LabelFlags_IsPacked | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
11975   upb_Array* arr = upb_Message_GetMutableArray(UPB_UPCAST(msg), &field);
11976   if (arr) {
11977     if (size) *size = arr->UPB_PRIVATE(size);
11978     return (int32_t*)upb_Array_MutableDataPtr(arr);
11979   } else {
11980     if (size) *size = 0;
11981     return NULL;
11982   }
11983 }
google_protobuf_SourceCodeInfo_Location_resize_path(google_protobuf_SourceCodeInfo_Location * msg,size_t size,upb_Arena * arena)11984 UPB_INLINE int32_t* google_protobuf_SourceCodeInfo_Location_resize_path(google_protobuf_SourceCodeInfo_Location* msg, size_t size, upb_Arena* arena) {
11985   upb_MiniTableField field = {1, UPB_SIZE(12, 16), 0, kUpb_NoSub, 5, (int)kUpb_FieldMode_Array | (int)kUpb_LabelFlags_IsPacked | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
11986   return (int32_t*)upb_Message_ResizeArrayUninitialized(UPB_UPCAST(msg),
11987                                                    &field, size, arena);
11988 }
google_protobuf_SourceCodeInfo_Location_add_path(google_protobuf_SourceCodeInfo_Location * msg,int32_t val,upb_Arena * arena)11989 UPB_INLINE bool google_protobuf_SourceCodeInfo_Location_add_path(google_protobuf_SourceCodeInfo_Location* msg, int32_t val, upb_Arena* arena) {
11990   upb_MiniTableField field = {1, UPB_SIZE(12, 16), 0, kUpb_NoSub, 5, (int)kUpb_FieldMode_Array | (int)kUpb_LabelFlags_IsPacked | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
11991   upb_Array* arr = upb_Message_GetOrCreateMutableArray(
11992       UPB_UPCAST(msg), &field, arena);
11993   if (!arr || !UPB_PRIVATE(_upb_Array_ResizeUninitialized)(
11994                   arr, arr->UPB_PRIVATE(size) + 1, arena)) {
11995     return false;
11996   }
11997   UPB_PRIVATE(_upb_Array_Set)
11998   (arr, arr->UPB_PRIVATE(size) - 1, &val, sizeof(val));
11999   return true;
12000 }
google_protobuf_SourceCodeInfo_Location_mutable_span(google_protobuf_SourceCodeInfo_Location * msg,size_t * size)12001 UPB_INLINE int32_t* google_protobuf_SourceCodeInfo_Location_mutable_span(google_protobuf_SourceCodeInfo_Location* msg, size_t* size) {
12002   upb_MiniTableField field = {2, UPB_SIZE(16, 24), 0, kUpb_NoSub, 5, (int)kUpb_FieldMode_Array | (int)kUpb_LabelFlags_IsPacked | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
12003   upb_Array* arr = upb_Message_GetMutableArray(UPB_UPCAST(msg), &field);
12004   if (arr) {
12005     if (size) *size = arr->UPB_PRIVATE(size);
12006     return (int32_t*)upb_Array_MutableDataPtr(arr);
12007   } else {
12008     if (size) *size = 0;
12009     return NULL;
12010   }
12011 }
google_protobuf_SourceCodeInfo_Location_resize_span(google_protobuf_SourceCodeInfo_Location * msg,size_t size,upb_Arena * arena)12012 UPB_INLINE int32_t* google_protobuf_SourceCodeInfo_Location_resize_span(google_protobuf_SourceCodeInfo_Location* msg, size_t size, upb_Arena* arena) {
12013   upb_MiniTableField field = {2, UPB_SIZE(16, 24), 0, kUpb_NoSub, 5, (int)kUpb_FieldMode_Array | (int)kUpb_LabelFlags_IsPacked | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
12014   return (int32_t*)upb_Message_ResizeArrayUninitialized(UPB_UPCAST(msg),
12015                                                    &field, size, arena);
12016 }
google_protobuf_SourceCodeInfo_Location_add_span(google_protobuf_SourceCodeInfo_Location * msg,int32_t val,upb_Arena * arena)12017 UPB_INLINE bool google_protobuf_SourceCodeInfo_Location_add_span(google_protobuf_SourceCodeInfo_Location* msg, int32_t val, upb_Arena* arena) {
12018   upb_MiniTableField field = {2, UPB_SIZE(16, 24), 0, kUpb_NoSub, 5, (int)kUpb_FieldMode_Array | (int)kUpb_LabelFlags_IsPacked | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
12019   upb_Array* arr = upb_Message_GetOrCreateMutableArray(
12020       UPB_UPCAST(msg), &field, arena);
12021   if (!arr || !UPB_PRIVATE(_upb_Array_ResizeUninitialized)(
12022                   arr, arr->UPB_PRIVATE(size) + 1, arena)) {
12023     return false;
12024   }
12025   UPB_PRIVATE(_upb_Array_Set)
12026   (arr, arr->UPB_PRIVATE(size) - 1, &val, sizeof(val));
12027   return true;
12028 }
google_protobuf_SourceCodeInfo_Location_set_leading_comments(google_protobuf_SourceCodeInfo_Location * msg,upb_StringView value)12029 UPB_INLINE void google_protobuf_SourceCodeInfo_Location_set_leading_comments(google_protobuf_SourceCodeInfo_Location *msg, upb_StringView value) {
12030   const upb_MiniTableField field = {3, UPB_SIZE(24, 32), 64, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
12031   upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
12032 }
google_protobuf_SourceCodeInfo_Location_set_trailing_comments(google_protobuf_SourceCodeInfo_Location * msg,upb_StringView value)12033 UPB_INLINE void google_protobuf_SourceCodeInfo_Location_set_trailing_comments(google_protobuf_SourceCodeInfo_Location *msg, upb_StringView value) {
12034   const upb_MiniTableField field = {4, UPB_SIZE(32, 48), 65, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
12035   upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
12036 }
google_protobuf_SourceCodeInfo_Location_mutable_leading_detached_comments(google_protobuf_SourceCodeInfo_Location * msg,size_t * size)12037 UPB_INLINE upb_StringView* google_protobuf_SourceCodeInfo_Location_mutable_leading_detached_comments(google_protobuf_SourceCodeInfo_Location* msg, size_t* size) {
12038   upb_MiniTableField field = {6, UPB_SIZE(20, 64), 0, kUpb_NoSub, 12, (int)kUpb_FieldMode_Array | (int)kUpb_LabelFlags_IsAlternate | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
12039   upb_Array* arr = upb_Message_GetMutableArray(UPB_UPCAST(msg), &field);
12040   if (arr) {
12041     if (size) *size = arr->UPB_PRIVATE(size);
12042     return (upb_StringView*)upb_Array_MutableDataPtr(arr);
12043   } else {
12044     if (size) *size = 0;
12045     return NULL;
12046   }
12047 }
google_protobuf_SourceCodeInfo_Location_resize_leading_detached_comments(google_protobuf_SourceCodeInfo_Location * msg,size_t size,upb_Arena * arena)12048 UPB_INLINE upb_StringView* google_protobuf_SourceCodeInfo_Location_resize_leading_detached_comments(google_protobuf_SourceCodeInfo_Location* msg, size_t size, upb_Arena* arena) {
12049   upb_MiniTableField field = {6, UPB_SIZE(20, 64), 0, kUpb_NoSub, 12, (int)kUpb_FieldMode_Array | (int)kUpb_LabelFlags_IsAlternate | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
12050   return (upb_StringView*)upb_Message_ResizeArrayUninitialized(UPB_UPCAST(msg),
12051                                                    &field, size, arena);
12052 }
google_protobuf_SourceCodeInfo_Location_add_leading_detached_comments(google_protobuf_SourceCodeInfo_Location * msg,upb_StringView val,upb_Arena * arena)12053 UPB_INLINE bool google_protobuf_SourceCodeInfo_Location_add_leading_detached_comments(google_protobuf_SourceCodeInfo_Location* msg, upb_StringView val, upb_Arena* arena) {
12054   upb_MiniTableField field = {6, UPB_SIZE(20, 64), 0, kUpb_NoSub, 12, (int)kUpb_FieldMode_Array | (int)kUpb_LabelFlags_IsAlternate | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
12055   upb_Array* arr = upb_Message_GetOrCreateMutableArray(
12056       UPB_UPCAST(msg), &field, arena);
12057   if (!arr || !UPB_PRIVATE(_upb_Array_ResizeUninitialized)(
12058                   arr, arr->UPB_PRIVATE(size) + 1, arena)) {
12059     return false;
12060   }
12061   UPB_PRIVATE(_upb_Array_Set)
12062   (arr, arr->UPB_PRIVATE(size) - 1, &val, sizeof(val));
12063   return true;
12064 }
12065 
12066 /* google.protobuf.GeneratedCodeInfo */
12067 
google_protobuf_GeneratedCodeInfo_new(upb_Arena * arena)12068 UPB_INLINE google_protobuf_GeneratedCodeInfo* google_protobuf_GeneratedCodeInfo_new(upb_Arena* arena) {
12069   return (google_protobuf_GeneratedCodeInfo*)_upb_Message_New(&google__protobuf__GeneratedCodeInfo_msg_init, arena);
12070 }
google_protobuf_GeneratedCodeInfo_parse(const char * buf,size_t size,upb_Arena * arena)12071 UPB_INLINE google_protobuf_GeneratedCodeInfo* google_protobuf_GeneratedCodeInfo_parse(const char* buf, size_t size, upb_Arena* arena) {
12072   google_protobuf_GeneratedCodeInfo* ret = google_protobuf_GeneratedCodeInfo_new(arena);
12073   if (!ret) return NULL;
12074   if (upb_Decode(buf, size, UPB_UPCAST(ret), &google__protobuf__GeneratedCodeInfo_msg_init, NULL, 0, arena) !=
12075       kUpb_DecodeStatus_Ok) {
12076     return NULL;
12077   }
12078   return ret;
12079 }
google_protobuf_GeneratedCodeInfo_parse_ex(const char * buf,size_t size,const upb_ExtensionRegistry * extreg,int options,upb_Arena * arena)12080 UPB_INLINE google_protobuf_GeneratedCodeInfo* google_protobuf_GeneratedCodeInfo_parse_ex(const char* buf, size_t size,
12081                            const upb_ExtensionRegistry* extreg,
12082                            int options, upb_Arena* arena) {
12083   google_protobuf_GeneratedCodeInfo* ret = google_protobuf_GeneratedCodeInfo_new(arena);
12084   if (!ret) return NULL;
12085   if (upb_Decode(buf, size, UPB_UPCAST(ret), &google__protobuf__GeneratedCodeInfo_msg_init, extreg, options,
12086                  arena) != kUpb_DecodeStatus_Ok) {
12087     return NULL;
12088   }
12089   return ret;
12090 }
google_protobuf_GeneratedCodeInfo_serialize(const google_protobuf_GeneratedCodeInfo * msg,upb_Arena * arena,size_t * len)12091 UPB_INLINE char* google_protobuf_GeneratedCodeInfo_serialize(const google_protobuf_GeneratedCodeInfo* msg, upb_Arena* arena, size_t* len) {
12092   char* ptr;
12093   (void)upb_Encode(UPB_UPCAST(msg), &google__protobuf__GeneratedCodeInfo_msg_init, 0, arena, &ptr, len);
12094   return ptr;
12095 }
google_protobuf_GeneratedCodeInfo_serialize_ex(const google_protobuf_GeneratedCodeInfo * msg,int options,upb_Arena * arena,size_t * len)12096 UPB_INLINE char* google_protobuf_GeneratedCodeInfo_serialize_ex(const google_protobuf_GeneratedCodeInfo* msg, int options,
12097                                  upb_Arena* arena, size_t* len) {
12098   char* ptr;
12099   (void)upb_Encode(UPB_UPCAST(msg), &google__protobuf__GeneratedCodeInfo_msg_init, options, arena, &ptr, len);
12100   return ptr;
12101 }
google_protobuf_GeneratedCodeInfo_clear_annotation(google_protobuf_GeneratedCodeInfo * msg)12102 UPB_INLINE void google_protobuf_GeneratedCodeInfo_clear_annotation(google_protobuf_GeneratedCodeInfo* msg) {
12103   const upb_MiniTableField field = {1, 8, 0, 0, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
12104   upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
12105 }
google_protobuf_GeneratedCodeInfo_annotation(const google_protobuf_GeneratedCodeInfo * msg,size_t * size)12106 UPB_INLINE const google_protobuf_GeneratedCodeInfo_Annotation* const* google_protobuf_GeneratedCodeInfo_annotation(const google_protobuf_GeneratedCodeInfo* msg, size_t* size) {
12107   const upb_MiniTableField field = {1, 8, 0, 0, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
12108   UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__GeneratedCodeInfo__Annotation_msg_init);
12109   const upb_Array* arr = upb_Message_GetArray(UPB_UPCAST(msg), &field);
12110   if (arr) {
12111     if (size) *size = arr->UPB_PRIVATE(size);
12112     return (const google_protobuf_GeneratedCodeInfo_Annotation* const*)upb_Array_DataPtr(arr);
12113   } else {
12114     if (size) *size = 0;
12115     return NULL;
12116   }
12117 }
_google_protobuf_GeneratedCodeInfo_annotation_upb_array(const google_protobuf_GeneratedCodeInfo * msg,size_t * size)12118 UPB_INLINE const upb_Array* _google_protobuf_GeneratedCodeInfo_annotation_upb_array(const google_protobuf_GeneratedCodeInfo* msg, size_t* size) {
12119   const upb_MiniTableField field = {1, 8, 0, 0, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
12120   UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__GeneratedCodeInfo__Annotation_msg_init);
12121   const upb_Array* arr = upb_Message_GetArray(UPB_UPCAST(msg), &field);
12122   if (size) {
12123     *size = arr ? arr->UPB_PRIVATE(size) : 0;
12124   }
12125   return arr;
12126 }
_google_protobuf_GeneratedCodeInfo_annotation_mutable_upb_array(google_protobuf_GeneratedCodeInfo * msg,size_t * size,upb_Arena * arena)12127 UPB_INLINE upb_Array* _google_protobuf_GeneratedCodeInfo_annotation_mutable_upb_array(google_protobuf_GeneratedCodeInfo* msg, size_t* size, upb_Arena* arena) {
12128   const upb_MiniTableField field = {1, 8, 0, 0, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
12129   UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__GeneratedCodeInfo__Annotation_msg_init);
12130   upb_Array* arr = upb_Message_GetOrCreateMutableArray(UPB_UPCAST(msg),
12131                                                        &field, arena);
12132   if (size) {
12133     *size = arr ? arr->UPB_PRIVATE(size) : 0;
12134   }
12135   return arr;
12136 }
12137 
google_protobuf_GeneratedCodeInfo_mutable_annotation(google_protobuf_GeneratedCodeInfo * msg,size_t * size)12138 UPB_INLINE google_protobuf_GeneratedCodeInfo_Annotation** google_protobuf_GeneratedCodeInfo_mutable_annotation(google_protobuf_GeneratedCodeInfo* msg, size_t* size) {
12139   upb_MiniTableField field = {1, 8, 0, 0, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
12140   UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__GeneratedCodeInfo__Annotation_msg_init);
12141   upb_Array* arr = upb_Message_GetMutableArray(UPB_UPCAST(msg), &field);
12142   if (arr) {
12143     if (size) *size = arr->UPB_PRIVATE(size);
12144     return (google_protobuf_GeneratedCodeInfo_Annotation**)upb_Array_MutableDataPtr(arr);
12145   } else {
12146     if (size) *size = 0;
12147     return NULL;
12148   }
12149 }
google_protobuf_GeneratedCodeInfo_resize_annotation(google_protobuf_GeneratedCodeInfo * msg,size_t size,upb_Arena * arena)12150 UPB_INLINE google_protobuf_GeneratedCodeInfo_Annotation** google_protobuf_GeneratedCodeInfo_resize_annotation(google_protobuf_GeneratedCodeInfo* msg, size_t size, upb_Arena* arena) {
12151   upb_MiniTableField field = {1, 8, 0, 0, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
12152   return (google_protobuf_GeneratedCodeInfo_Annotation**)upb_Message_ResizeArrayUninitialized(UPB_UPCAST(msg),
12153                                                    &field, size, arena);
12154 }
google_protobuf_GeneratedCodeInfo_add_annotation(google_protobuf_GeneratedCodeInfo * msg,upb_Arena * arena)12155 UPB_INLINE struct google_protobuf_GeneratedCodeInfo_Annotation* google_protobuf_GeneratedCodeInfo_add_annotation(google_protobuf_GeneratedCodeInfo* msg, upb_Arena* arena) {
12156   upb_MiniTableField field = {1, 8, 0, 0, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
12157   UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__GeneratedCodeInfo__Annotation_msg_init);
12158   upb_Array* arr = upb_Message_GetOrCreateMutableArray(
12159       UPB_UPCAST(msg), &field, arena);
12160   if (!arr || !UPB_PRIVATE(_upb_Array_ResizeUninitialized)(
12161                   arr, arr->UPB_PRIVATE(size) + 1, arena)) {
12162     return NULL;
12163   }
12164   struct google_protobuf_GeneratedCodeInfo_Annotation* sub = (struct google_protobuf_GeneratedCodeInfo_Annotation*)_upb_Message_New(&google__protobuf__GeneratedCodeInfo__Annotation_msg_init, arena);
12165   if (!arr || !sub) return NULL;
12166   UPB_PRIVATE(_upb_Array_Set)
12167   (arr, arr->UPB_PRIVATE(size) - 1, &sub, sizeof(sub));
12168   return sub;
12169 }
12170 
12171 /* google.protobuf.GeneratedCodeInfo.Annotation */
12172 
google_protobuf_GeneratedCodeInfo_Annotation_new(upb_Arena * arena)12173 UPB_INLINE google_protobuf_GeneratedCodeInfo_Annotation* google_protobuf_GeneratedCodeInfo_Annotation_new(upb_Arena* arena) {
12174   return (google_protobuf_GeneratedCodeInfo_Annotation*)_upb_Message_New(&google__protobuf__GeneratedCodeInfo__Annotation_msg_init, arena);
12175 }
google_protobuf_GeneratedCodeInfo_Annotation_parse(const char * buf,size_t size,upb_Arena * arena)12176 UPB_INLINE google_protobuf_GeneratedCodeInfo_Annotation* google_protobuf_GeneratedCodeInfo_Annotation_parse(const char* buf, size_t size, upb_Arena* arena) {
12177   google_protobuf_GeneratedCodeInfo_Annotation* ret = google_protobuf_GeneratedCodeInfo_Annotation_new(arena);
12178   if (!ret) return NULL;
12179   if (upb_Decode(buf, size, UPB_UPCAST(ret), &google__protobuf__GeneratedCodeInfo__Annotation_msg_init, NULL, 0, arena) !=
12180       kUpb_DecodeStatus_Ok) {
12181     return NULL;
12182   }
12183   return ret;
12184 }
google_protobuf_GeneratedCodeInfo_Annotation_parse_ex(const char * buf,size_t size,const upb_ExtensionRegistry * extreg,int options,upb_Arena * arena)12185 UPB_INLINE google_protobuf_GeneratedCodeInfo_Annotation* google_protobuf_GeneratedCodeInfo_Annotation_parse_ex(const char* buf, size_t size,
12186                            const upb_ExtensionRegistry* extreg,
12187                            int options, upb_Arena* arena) {
12188   google_protobuf_GeneratedCodeInfo_Annotation* ret = google_protobuf_GeneratedCodeInfo_Annotation_new(arena);
12189   if (!ret) return NULL;
12190   if (upb_Decode(buf, size, UPB_UPCAST(ret), &google__protobuf__GeneratedCodeInfo__Annotation_msg_init, extreg, options,
12191                  arena) != kUpb_DecodeStatus_Ok) {
12192     return NULL;
12193   }
12194   return ret;
12195 }
google_protobuf_GeneratedCodeInfo_Annotation_serialize(const google_protobuf_GeneratedCodeInfo_Annotation * msg,upb_Arena * arena,size_t * len)12196 UPB_INLINE char* google_protobuf_GeneratedCodeInfo_Annotation_serialize(const google_protobuf_GeneratedCodeInfo_Annotation* msg, upb_Arena* arena, size_t* len) {
12197   char* ptr;
12198   (void)upb_Encode(UPB_UPCAST(msg), &google__protobuf__GeneratedCodeInfo__Annotation_msg_init, 0, arena, &ptr, len);
12199   return ptr;
12200 }
google_protobuf_GeneratedCodeInfo_Annotation_serialize_ex(const google_protobuf_GeneratedCodeInfo_Annotation * msg,int options,upb_Arena * arena,size_t * len)12201 UPB_INLINE char* google_protobuf_GeneratedCodeInfo_Annotation_serialize_ex(const google_protobuf_GeneratedCodeInfo_Annotation* msg, int options,
12202                                  upb_Arena* arena, size_t* len) {
12203   char* ptr;
12204   (void)upb_Encode(UPB_UPCAST(msg), &google__protobuf__GeneratedCodeInfo__Annotation_msg_init, options, arena, &ptr, len);
12205   return ptr;
12206 }
google_protobuf_GeneratedCodeInfo_Annotation_clear_path(google_protobuf_GeneratedCodeInfo_Annotation * msg)12207 UPB_INLINE void google_protobuf_GeneratedCodeInfo_Annotation_clear_path(google_protobuf_GeneratedCodeInfo_Annotation* msg) {
12208   const upb_MiniTableField field = {1, UPB_SIZE(12, 24), 0, kUpb_NoSub, 5, (int)kUpb_FieldMode_Array | (int)kUpb_LabelFlags_IsPacked | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
12209   upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
12210 }
google_protobuf_GeneratedCodeInfo_Annotation_path(const google_protobuf_GeneratedCodeInfo_Annotation * msg,size_t * size)12211 UPB_INLINE int32_t const* google_protobuf_GeneratedCodeInfo_Annotation_path(const google_protobuf_GeneratedCodeInfo_Annotation* msg, size_t* size) {
12212   const upb_MiniTableField field = {1, UPB_SIZE(12, 24), 0, kUpb_NoSub, 5, (int)kUpb_FieldMode_Array | (int)kUpb_LabelFlags_IsPacked | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
12213   const upb_Array* arr = upb_Message_GetArray(UPB_UPCAST(msg), &field);
12214   if (arr) {
12215     if (size) *size = arr->UPB_PRIVATE(size);
12216     return (int32_t const*)upb_Array_DataPtr(arr);
12217   } else {
12218     if (size) *size = 0;
12219     return NULL;
12220   }
12221 }
_google_protobuf_GeneratedCodeInfo_Annotation_path_upb_array(const google_protobuf_GeneratedCodeInfo_Annotation * msg,size_t * size)12222 UPB_INLINE const upb_Array* _google_protobuf_GeneratedCodeInfo_Annotation_path_upb_array(const google_protobuf_GeneratedCodeInfo_Annotation* msg, size_t* size) {
12223   const upb_MiniTableField field = {1, UPB_SIZE(12, 24), 0, kUpb_NoSub, 5, (int)kUpb_FieldMode_Array | (int)kUpb_LabelFlags_IsPacked | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
12224   const upb_Array* arr = upb_Message_GetArray(UPB_UPCAST(msg), &field);
12225   if (size) {
12226     *size = arr ? arr->UPB_PRIVATE(size) : 0;
12227   }
12228   return arr;
12229 }
_google_protobuf_GeneratedCodeInfo_Annotation_path_mutable_upb_array(google_protobuf_GeneratedCodeInfo_Annotation * msg,size_t * size,upb_Arena * arena)12230 UPB_INLINE upb_Array* _google_protobuf_GeneratedCodeInfo_Annotation_path_mutable_upb_array(google_protobuf_GeneratedCodeInfo_Annotation* msg, size_t* size, upb_Arena* arena) {
12231   const upb_MiniTableField field = {1, UPB_SIZE(12, 24), 0, kUpb_NoSub, 5, (int)kUpb_FieldMode_Array | (int)kUpb_LabelFlags_IsPacked | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
12232   upb_Array* arr = upb_Message_GetOrCreateMutableArray(UPB_UPCAST(msg),
12233                                                        &field, arena);
12234   if (size) {
12235     *size = arr ? arr->UPB_PRIVATE(size) : 0;
12236   }
12237   return arr;
12238 }
google_protobuf_GeneratedCodeInfo_Annotation_clear_source_file(google_protobuf_GeneratedCodeInfo_Annotation * msg)12239 UPB_INLINE void google_protobuf_GeneratedCodeInfo_Annotation_clear_source_file(google_protobuf_GeneratedCodeInfo_Annotation* msg) {
12240   const upb_MiniTableField field = {2, UPB_SIZE(28, 32), 64, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
12241   upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
12242 }
google_protobuf_GeneratedCodeInfo_Annotation_source_file(const google_protobuf_GeneratedCodeInfo_Annotation * msg)12243 UPB_INLINE upb_StringView google_protobuf_GeneratedCodeInfo_Annotation_source_file(const google_protobuf_GeneratedCodeInfo_Annotation* msg) {
12244   upb_StringView default_val = upb_StringView_FromString("");
12245   upb_StringView ret;
12246   const upb_MiniTableField field = {2, UPB_SIZE(28, 32), 64, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
12247   _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field,
12248                                     &default_val, &ret);
12249   return ret;
12250 }
google_protobuf_GeneratedCodeInfo_Annotation_has_source_file(const google_protobuf_GeneratedCodeInfo_Annotation * msg)12251 UPB_INLINE bool google_protobuf_GeneratedCodeInfo_Annotation_has_source_file(const google_protobuf_GeneratedCodeInfo_Annotation* msg) {
12252   const upb_MiniTableField field = {2, UPB_SIZE(28, 32), 64, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
12253   return upb_Message_HasBaseField(UPB_UPCAST(msg), &field);
12254 }
google_protobuf_GeneratedCodeInfo_Annotation_clear_begin(google_protobuf_GeneratedCodeInfo_Annotation * msg)12255 UPB_INLINE void google_protobuf_GeneratedCodeInfo_Annotation_clear_begin(google_protobuf_GeneratedCodeInfo_Annotation* msg) {
12256   const upb_MiniTableField field = {3, UPB_SIZE(16, 12), 65, kUpb_NoSub, 5, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
12257   upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
12258 }
google_protobuf_GeneratedCodeInfo_Annotation_begin(const google_protobuf_GeneratedCodeInfo_Annotation * msg)12259 UPB_INLINE int32_t google_protobuf_GeneratedCodeInfo_Annotation_begin(const google_protobuf_GeneratedCodeInfo_Annotation* msg) {
12260   int32_t default_val = (int32_t)0;
12261   int32_t ret;
12262   const upb_MiniTableField field = {3, UPB_SIZE(16, 12), 65, kUpb_NoSub, 5, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
12263   _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field,
12264                                     &default_val, &ret);
12265   return ret;
12266 }
google_protobuf_GeneratedCodeInfo_Annotation_has_begin(const google_protobuf_GeneratedCodeInfo_Annotation * msg)12267 UPB_INLINE bool google_protobuf_GeneratedCodeInfo_Annotation_has_begin(const google_protobuf_GeneratedCodeInfo_Annotation* msg) {
12268   const upb_MiniTableField field = {3, UPB_SIZE(16, 12), 65, kUpb_NoSub, 5, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
12269   return upb_Message_HasBaseField(UPB_UPCAST(msg), &field);
12270 }
google_protobuf_GeneratedCodeInfo_Annotation_clear_end(google_protobuf_GeneratedCodeInfo_Annotation * msg)12271 UPB_INLINE void google_protobuf_GeneratedCodeInfo_Annotation_clear_end(google_protobuf_GeneratedCodeInfo_Annotation* msg) {
12272   const upb_MiniTableField field = {4, UPB_SIZE(20, 16), 66, kUpb_NoSub, 5, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
12273   upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
12274 }
google_protobuf_GeneratedCodeInfo_Annotation_end(const google_protobuf_GeneratedCodeInfo_Annotation * msg)12275 UPB_INLINE int32_t google_protobuf_GeneratedCodeInfo_Annotation_end(const google_protobuf_GeneratedCodeInfo_Annotation* msg) {
12276   int32_t default_val = (int32_t)0;
12277   int32_t ret;
12278   const upb_MiniTableField field = {4, UPB_SIZE(20, 16), 66, kUpb_NoSub, 5, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
12279   _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field,
12280                                     &default_val, &ret);
12281   return ret;
12282 }
google_protobuf_GeneratedCodeInfo_Annotation_has_end(const google_protobuf_GeneratedCodeInfo_Annotation * msg)12283 UPB_INLINE bool google_protobuf_GeneratedCodeInfo_Annotation_has_end(const google_protobuf_GeneratedCodeInfo_Annotation* msg) {
12284   const upb_MiniTableField field = {4, UPB_SIZE(20, 16), 66, kUpb_NoSub, 5, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
12285   return upb_Message_HasBaseField(UPB_UPCAST(msg), &field);
12286 }
google_protobuf_GeneratedCodeInfo_Annotation_clear_semantic(google_protobuf_GeneratedCodeInfo_Annotation * msg)12287 UPB_INLINE void google_protobuf_GeneratedCodeInfo_Annotation_clear_semantic(google_protobuf_GeneratedCodeInfo_Annotation* msg) {
12288   const upb_MiniTableField field = {5, UPB_SIZE(24, 20), 67, 0, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
12289   upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
12290 }
google_protobuf_GeneratedCodeInfo_Annotation_semantic(const google_protobuf_GeneratedCodeInfo_Annotation * msg)12291 UPB_INLINE int32_t google_protobuf_GeneratedCodeInfo_Annotation_semantic(const google_protobuf_GeneratedCodeInfo_Annotation* msg) {
12292   int32_t default_val = 0;
12293   int32_t ret;
12294   const upb_MiniTableField field = {5, UPB_SIZE(24, 20), 67, 0, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
12295   _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field,
12296                                     &default_val, &ret);
12297   return ret;
12298 }
google_protobuf_GeneratedCodeInfo_Annotation_has_semantic(const google_protobuf_GeneratedCodeInfo_Annotation * msg)12299 UPB_INLINE bool google_protobuf_GeneratedCodeInfo_Annotation_has_semantic(const google_protobuf_GeneratedCodeInfo_Annotation* msg) {
12300   const upb_MiniTableField field = {5, UPB_SIZE(24, 20), 67, 0, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
12301   return upb_Message_HasBaseField(UPB_UPCAST(msg), &field);
12302 }
12303 
google_protobuf_GeneratedCodeInfo_Annotation_mutable_path(google_protobuf_GeneratedCodeInfo_Annotation * msg,size_t * size)12304 UPB_INLINE int32_t* google_protobuf_GeneratedCodeInfo_Annotation_mutable_path(google_protobuf_GeneratedCodeInfo_Annotation* msg, size_t* size) {
12305   upb_MiniTableField field = {1, UPB_SIZE(12, 24), 0, kUpb_NoSub, 5, (int)kUpb_FieldMode_Array | (int)kUpb_LabelFlags_IsPacked | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
12306   upb_Array* arr = upb_Message_GetMutableArray(UPB_UPCAST(msg), &field);
12307   if (arr) {
12308     if (size) *size = arr->UPB_PRIVATE(size);
12309     return (int32_t*)upb_Array_MutableDataPtr(arr);
12310   } else {
12311     if (size) *size = 0;
12312     return NULL;
12313   }
12314 }
google_protobuf_GeneratedCodeInfo_Annotation_resize_path(google_protobuf_GeneratedCodeInfo_Annotation * msg,size_t size,upb_Arena * arena)12315 UPB_INLINE int32_t* google_protobuf_GeneratedCodeInfo_Annotation_resize_path(google_protobuf_GeneratedCodeInfo_Annotation* msg, size_t size, upb_Arena* arena) {
12316   upb_MiniTableField field = {1, UPB_SIZE(12, 24), 0, kUpb_NoSub, 5, (int)kUpb_FieldMode_Array | (int)kUpb_LabelFlags_IsPacked | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
12317   return (int32_t*)upb_Message_ResizeArrayUninitialized(UPB_UPCAST(msg),
12318                                                    &field, size, arena);
12319 }
google_protobuf_GeneratedCodeInfo_Annotation_add_path(google_protobuf_GeneratedCodeInfo_Annotation * msg,int32_t val,upb_Arena * arena)12320 UPB_INLINE bool google_protobuf_GeneratedCodeInfo_Annotation_add_path(google_protobuf_GeneratedCodeInfo_Annotation* msg, int32_t val, upb_Arena* arena) {
12321   upb_MiniTableField field = {1, UPB_SIZE(12, 24), 0, kUpb_NoSub, 5, (int)kUpb_FieldMode_Array | (int)kUpb_LabelFlags_IsPacked | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
12322   upb_Array* arr = upb_Message_GetOrCreateMutableArray(
12323       UPB_UPCAST(msg), &field, arena);
12324   if (!arr || !UPB_PRIVATE(_upb_Array_ResizeUninitialized)(
12325                   arr, arr->UPB_PRIVATE(size) + 1, arena)) {
12326     return false;
12327   }
12328   UPB_PRIVATE(_upb_Array_Set)
12329   (arr, arr->UPB_PRIVATE(size) - 1, &val, sizeof(val));
12330   return true;
12331 }
google_protobuf_GeneratedCodeInfo_Annotation_set_source_file(google_protobuf_GeneratedCodeInfo_Annotation * msg,upb_StringView value)12332 UPB_INLINE void google_protobuf_GeneratedCodeInfo_Annotation_set_source_file(google_protobuf_GeneratedCodeInfo_Annotation *msg, upb_StringView value) {
12333   const upb_MiniTableField field = {2, UPB_SIZE(28, 32), 64, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
12334   upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
12335 }
google_protobuf_GeneratedCodeInfo_Annotation_set_begin(google_protobuf_GeneratedCodeInfo_Annotation * msg,int32_t value)12336 UPB_INLINE void google_protobuf_GeneratedCodeInfo_Annotation_set_begin(google_protobuf_GeneratedCodeInfo_Annotation *msg, int32_t value) {
12337   const upb_MiniTableField field = {3, UPB_SIZE(16, 12), 65, kUpb_NoSub, 5, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
12338   upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
12339 }
google_protobuf_GeneratedCodeInfo_Annotation_set_end(google_protobuf_GeneratedCodeInfo_Annotation * msg,int32_t value)12340 UPB_INLINE void google_protobuf_GeneratedCodeInfo_Annotation_set_end(google_protobuf_GeneratedCodeInfo_Annotation *msg, int32_t value) {
12341   const upb_MiniTableField field = {4, UPB_SIZE(20, 16), 66, kUpb_NoSub, 5, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
12342   upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
12343 }
google_protobuf_GeneratedCodeInfo_Annotation_set_semantic(google_protobuf_GeneratedCodeInfo_Annotation * msg,int32_t value)12344 UPB_INLINE void google_protobuf_GeneratedCodeInfo_Annotation_set_semantic(google_protobuf_GeneratedCodeInfo_Annotation *msg, int32_t value) {
12345   const upb_MiniTableField field = {5, UPB_SIZE(24, 20), 67, 0, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
12346   upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
12347 }
12348 
12349 /* Max size 32 is google.protobuf.FileOptions */
12350 /* Max size 64 is google.protobuf.FileOptions */
12351 #define _UPB_MAXOPT_SIZE UPB_SIZE(112, 200)
12352 
12353 #ifdef __cplusplus
12354 }  /* extern "C" */
12355 #endif
12356 
12357 
12358 #endif  /* GOOGLE_PROTOBUF_DESCRIPTOR_PROTO_UPB_H__UPB_H_ */
12359 #endif
12360 
12361 // IWYU pragma: end_exports
12362 
12363 #endif  // THIRD_PARTY_UPB_UPB_REFLECTION_DESCRIPTOR_BOOTSTRAP_H_
12364 
12365 typedef enum {
12366   kUpb_Syntax_Proto2 = 2,
12367   kUpb_Syntax_Proto3 = 3,
12368   kUpb_Syntax_Editions = 99
12369 } upb_Syntax;
12370 
12371 // Forward declarations for circular references.
12372 typedef struct upb_DefPool upb_DefPool;
12373 typedef struct upb_EnumDef upb_EnumDef;
12374 typedef struct upb_EnumReservedRange upb_EnumReservedRange;
12375 typedef struct upb_EnumValueDef upb_EnumValueDef;
12376 typedef struct upb_ExtensionRange upb_ExtensionRange;
12377 typedef struct upb_FieldDef upb_FieldDef;
12378 typedef struct upb_FileDef upb_FileDef;
12379 typedef struct upb_MessageDef upb_MessageDef;
12380 typedef struct upb_MessageReservedRange upb_MessageReservedRange;
12381 typedef struct upb_MethodDef upb_MethodDef;
12382 typedef struct upb_OneofDef upb_OneofDef;
12383 typedef struct upb_ServiceDef upb_ServiceDef;
12384 
12385 // EVERYTHING BELOW THIS LINE IS INTERNAL - DO NOT USE /////////////////////////
12386 
12387 typedef struct upb_DefBuilder upb_DefBuilder;
12388 
12389 #endif /* UPB_REFLECTION_COMMON_H_ */
12390 
12391 #ifndef UPB_REFLECTION_DEF_TYPE_H_
12392 #define UPB_REFLECTION_DEF_TYPE_H_
12393 
12394 
12395 // Must be last.
12396 
12397 // Inside a symtab we store tagged pointers to specific def types.
12398 typedef enum {
12399   UPB_DEFTYPE_MASK = 7,
12400 
12401   // Only inside symtab table.
12402   UPB_DEFTYPE_EXT = 0,
12403   UPB_DEFTYPE_MSG = 1,
12404   UPB_DEFTYPE_ENUM = 2,
12405   UPB_DEFTYPE_ENUMVAL = 3,
12406   UPB_DEFTYPE_SERVICE = 4,
12407 
12408   // Only inside message table.
12409   UPB_DEFTYPE_FIELD = 0,
12410   UPB_DEFTYPE_ONEOF = 1,
12411 } upb_deftype_t;
12412 
12413 #ifdef __cplusplus
12414 extern "C" {
12415 #endif
12416 
12417 // Our 3-bit pointer tagging requires all pointers to be multiples of 8.
12418 // The arena will always yield 8-byte-aligned addresses, however we put
12419 // the defs into arrays. For each element in the array to be 8-byte-aligned,
12420 // the sizes of each def type must also be a multiple of 8.
12421 //
12422 // If any of these asserts fail, we need to add or remove padding on 32-bit
12423 // machines (64-bit machines will have 8-byte alignment already due to
12424 // pointers, which all of these structs have).
_upb_DefType_CheckPadding(size_t size)12425 UPB_INLINE void _upb_DefType_CheckPadding(size_t size) {
12426   UPB_ASSERT((size & UPB_DEFTYPE_MASK) == 0);
12427 }
12428 
12429 upb_deftype_t _upb_DefType_Type(upb_value v);
12430 
12431 upb_value _upb_DefType_Pack(const void* ptr, upb_deftype_t type);
12432 
12433 const void* _upb_DefType_Unpack(upb_value v, upb_deftype_t type);
12434 
12435 #ifdef __cplusplus
12436 } /* extern "C" */
12437 #endif
12438 
12439 
12440 #endif /* UPB_REFLECTION_DEF_TYPE_H_ */
12441 
12442 // Must be last.
12443 
12444 #ifdef __cplusplus
12445 extern "C" {
12446 #endif
12447 
12448 UPB_API void upb_DefPool_Free(upb_DefPool* s);
12449 
12450 UPB_API upb_DefPool* upb_DefPool_New(void);
12451 
12452 UPB_API const UPB_DESC(FeatureSetDefaults) *
12453     upb_DefPool_FeatureSetDefaults(const upb_DefPool* s);
12454 
12455 UPB_API bool upb_DefPool_SetFeatureSetDefaults(upb_DefPool* s,
12456                                                const char* serialized_defaults,
12457                                                size_t serialized_len,
12458                                                upb_Status* status);
12459 
12460 UPB_API const upb_MessageDef* upb_DefPool_FindMessageByName(
12461     const upb_DefPool* s, const char* sym);
12462 
12463 const upb_MessageDef* upb_DefPool_FindMessageByNameWithSize(
12464     const upb_DefPool* s, const char* sym, size_t len);
12465 
12466 UPB_API const upb_EnumDef* upb_DefPool_FindEnumByName(const upb_DefPool* s,
12467                                                       const char* sym);
12468 
12469 const upb_EnumValueDef* upb_DefPool_FindEnumByNameval(const upb_DefPool* s,
12470                                                       const char* sym);
12471 
12472 const upb_FileDef* upb_DefPool_FindFileByName(const upb_DefPool* s,
12473                                               const char* name);
12474 
12475 const upb_FileDef* upb_DefPool_FindFileByNameWithSize(const upb_DefPool* s,
12476                                                       const char* name,
12477                                                       size_t len);
12478 
12479 const upb_FieldDef* upb_DefPool_FindExtensionByMiniTable(
12480     const upb_DefPool* s, const upb_MiniTableExtension* ext);
12481 
12482 UPB_API const upb_FieldDef* upb_DefPool_FindExtensionByName(const upb_DefPool* s,
12483                                                     const char* sym);
12484 
12485 const upb_FieldDef* upb_DefPool_FindExtensionByNameWithSize(
12486     const upb_DefPool* s, const char* name, size_t size);
12487 
12488 const upb_FieldDef* upb_DefPool_FindExtensionByNumber(const upb_DefPool* s,
12489                                                       const upb_MessageDef* m,
12490                                                       int32_t fieldnum);
12491 
12492 UPB_API const upb_ServiceDef* upb_DefPool_FindServiceByName(
12493   const upb_DefPool* s, const char* name);
12494 
12495 const upb_ServiceDef* upb_DefPool_FindServiceByNameWithSize(
12496     const upb_DefPool* s, const char* name, size_t size);
12497 
12498 const upb_FileDef* upb_DefPool_FindFileContainingSymbol(const upb_DefPool* s,
12499                                                         const char* name);
12500 
12501 UPB_API const upb_FileDef* upb_DefPool_AddFile(
12502     upb_DefPool* s, const UPB_DESC(FileDescriptorProto) * file_proto,
12503     upb_Status* status);
12504 
12505 UPB_API const upb_ExtensionRegistry* upb_DefPool_ExtensionRegistry(
12506     const upb_DefPool* s);
12507 
12508 const upb_FieldDef** upb_DefPool_GetAllExtensions(const upb_DefPool* s,
12509                                                   const upb_MessageDef* m,
12510                                                   size_t* count);
12511 
12512 #ifdef __cplusplus
12513 } /* extern "C" */
12514 #endif
12515 
12516 
12517 #endif /* UPB_REFLECTION_DEF_POOL_H_ */
12518 
12519 // IWYU pragma: private, include "upb/reflection/def.h"
12520 
12521 #ifndef UPB_REFLECTION_ENUM_DEF_H_
12522 #define UPB_REFLECTION_ENUM_DEF_H_
12523 
12524 
12525 // Must be last.
12526 
12527 #ifdef __cplusplus
12528 extern "C" {
12529 #endif
12530 
12531 bool upb_EnumDef_CheckNumber(const upb_EnumDef* e, int32_t num);
12532 const upb_MessageDef* upb_EnumDef_ContainingType(const upb_EnumDef* e);
12533 int32_t upb_EnumDef_Default(const upb_EnumDef* e);
12534 UPB_API const upb_FileDef* upb_EnumDef_File(const upb_EnumDef* e);
12535 const upb_EnumValueDef* upb_EnumDef_FindValueByName(const upb_EnumDef* e,
12536                                                     const char* name);
12537 UPB_API const upb_EnumValueDef* upb_EnumDef_FindValueByNameWithSize(
12538     const upb_EnumDef* e, const char* name, size_t size);
12539 UPB_API const upb_EnumValueDef* upb_EnumDef_FindValueByNumber(
12540     const upb_EnumDef* e, int32_t num);
12541 UPB_API const char* upb_EnumDef_FullName(const upb_EnumDef* e);
12542 bool upb_EnumDef_HasOptions(const upb_EnumDef* e);
12543 bool upb_EnumDef_IsClosed(const upb_EnumDef* e);
12544 bool upb_EnumDef_IsSpecifiedAsClosed(const upb_EnumDef* e);
12545 
12546 // Creates a mini descriptor string for an enum, returns true on success.
12547 bool upb_EnumDef_MiniDescriptorEncode(const upb_EnumDef* e, upb_Arena* a,
12548                                       upb_StringView* out);
12549 
12550 const char* upb_EnumDef_Name(const upb_EnumDef* e);
12551 const UPB_DESC(EnumOptions) * upb_EnumDef_Options(const upb_EnumDef* e);
12552 const UPB_DESC(FeatureSet) * upb_EnumDef_ResolvedFeatures(const upb_EnumDef* e);
12553 
12554 upb_StringView upb_EnumDef_ReservedName(const upb_EnumDef* e, int i);
12555 int upb_EnumDef_ReservedNameCount(const upb_EnumDef* e);
12556 
12557 const upb_EnumReservedRange* upb_EnumDef_ReservedRange(const upb_EnumDef* e,
12558                                                        int i);
12559 int upb_EnumDef_ReservedRangeCount(const upb_EnumDef* e);
12560 
12561 UPB_API const upb_EnumValueDef* upb_EnumDef_Value(const upb_EnumDef* e, int i);
12562 UPB_API int upb_EnumDef_ValueCount(const upb_EnumDef* e);
12563 
12564 #ifdef __cplusplus
12565 } /* extern "C" */
12566 #endif
12567 
12568 
12569 #endif /* UPB_REFLECTION_ENUM_DEF_H_ */
12570 
12571 // IWYU pragma: private, include "upb/reflection/def.h"
12572 
12573 #ifndef UPB_REFLECTION_ENUM_VALUE_DEF_H_
12574 #define UPB_REFLECTION_ENUM_VALUE_DEF_H_
12575 
12576 
12577 // Must be last.
12578 
12579 #ifdef __cplusplus
12580 extern "C" {
12581 #endif
12582 
12583 const upb_EnumDef* upb_EnumValueDef_Enum(const upb_EnumValueDef* v);
12584 const char* upb_EnumValueDef_FullName(const upb_EnumValueDef* v);
12585 bool upb_EnumValueDef_HasOptions(const upb_EnumValueDef* v);
12586 uint32_t upb_EnumValueDef_Index(const upb_EnumValueDef* v);
12587 UPB_API const char* upb_EnumValueDef_Name(const upb_EnumValueDef* v);
12588 UPB_API int32_t upb_EnumValueDef_Number(const upb_EnumValueDef* v);
12589 const UPB_DESC(EnumValueOptions) *
12590     upb_EnumValueDef_Options(const upb_EnumValueDef* v);
12591 const UPB_DESC(FeatureSet) *
12592     upb_EnumValueDef_ResolvedFeatures(const upb_EnumValueDef* e);
12593 
12594 #ifdef __cplusplus
12595 } /* extern "C" */
12596 #endif
12597 
12598 
12599 #endif /* UPB_REFLECTION_ENUM_VALUE_DEF_H_ */
12600 
12601 // IWYU pragma: private, include "upb/reflection/def.h"
12602 
12603 #ifndef UPB_REFLECTION_EXTENSION_RANGE_H_
12604 #define UPB_REFLECTION_EXTENSION_RANGE_H_
12605 
12606 
12607 // Must be last.
12608 
12609 #ifdef __cplusplus
12610 extern "C" {
12611 #endif
12612 
12613 int32_t upb_ExtensionRange_Start(const upb_ExtensionRange* r);
12614 int32_t upb_ExtensionRange_End(const upb_ExtensionRange* r);
12615 
12616 bool upb_ExtensionRange_HasOptions(const upb_ExtensionRange* r);
12617 const UPB_DESC(ExtensionRangeOptions) *
12618     upb_ExtensionRange_Options(const upb_ExtensionRange* r);
12619 const UPB_DESC(FeatureSet) *
12620     upb_ExtensionRange_ResolvedFeatures(const upb_ExtensionRange* e);
12621 
12622 #ifdef __cplusplus
12623 } /* extern "C" */
12624 #endif
12625 
12626 
12627 #endif /* UPB_REFLECTION_EXTENSION_RANGE_H_ */
12628 
12629 // IWYU pragma: private, include "upb/reflection/def.h"
12630 
12631 #ifndef UPB_REFLECTION_FIELD_DEF_H_
12632 #define UPB_REFLECTION_FIELD_DEF_H_
12633 
12634 #include <stdint.h>
12635 
12636 
12637 // Must be last.
12638 
12639 // Maximum field number allowed for FieldDefs.
12640 // This is an inherent limit of the protobuf wire format.
12641 #define kUpb_MaxFieldNumber ((1 << 29) - 1)
12642 
12643 #ifdef __cplusplus
12644 extern "C" {
12645 #endif
12646 
12647 const upb_OneofDef* upb_FieldDef_ContainingOneof(const upb_FieldDef* f);
12648 UPB_API const upb_MessageDef* upb_FieldDef_ContainingType(
12649     const upb_FieldDef* f);
12650 UPB_API upb_CType upb_FieldDef_CType(const upb_FieldDef* f);
12651 UPB_API upb_MessageValue upb_FieldDef_Default(const upb_FieldDef* f);
12652 UPB_API const upb_EnumDef* upb_FieldDef_EnumSubDef(const upb_FieldDef* f);
12653 const upb_MessageDef* upb_FieldDef_ExtensionScope(const upb_FieldDef* f);
12654 UPB_API const upb_FileDef* upb_FieldDef_File(const upb_FieldDef* f);
12655 const char* upb_FieldDef_FullName(const upb_FieldDef* f);
12656 bool upb_FieldDef_HasDefault(const upb_FieldDef* f);
12657 bool upb_FieldDef_HasJsonName(const upb_FieldDef* f);
12658 bool upb_FieldDef_HasOptions(const upb_FieldDef* f);
12659 UPB_API bool upb_FieldDef_HasPresence(const upb_FieldDef* f);
12660 bool upb_FieldDef_HasSubDef(const upb_FieldDef* f);
12661 uint32_t upb_FieldDef_Index(const upb_FieldDef* f);
12662 UPB_API bool upb_FieldDef_IsEnum(const upb_FieldDef* f);
12663 bool upb_FieldDef_IsExtension(const upb_FieldDef* f);
12664 UPB_API bool upb_FieldDef_IsMap(const upb_FieldDef* f);
12665 bool upb_FieldDef_IsOptional(const upb_FieldDef* f);
12666 UPB_API bool upb_FieldDef_IsPacked(const upb_FieldDef* f);
12667 bool upb_FieldDef_IsPrimitive(const upb_FieldDef* f);
12668 UPB_API bool upb_FieldDef_IsRepeated(const upb_FieldDef* f);
12669 bool upb_FieldDef_IsRequired(const upb_FieldDef* f);
12670 bool upb_FieldDef_IsString(const upb_FieldDef* f);
12671 UPB_API bool upb_FieldDef_IsSubMessage(const upb_FieldDef* f);
12672 UPB_API const char* upb_FieldDef_JsonName(const upb_FieldDef* f);
12673 UPB_API upb_Label upb_FieldDef_Label(const upb_FieldDef* f);
12674 uint32_t upb_FieldDef_LayoutIndex(const upb_FieldDef* f);
12675 UPB_API const upb_MessageDef* upb_FieldDef_MessageSubDef(const upb_FieldDef* f);
12676 bool _upb_FieldDef_ValidateUtf8(const upb_FieldDef* f);
12677 bool _upb_FieldDef_IsGroupLike(const upb_FieldDef* f);
12678 
12679 // Creates a mini descriptor string for a field, returns true on success.
12680 bool upb_FieldDef_MiniDescriptorEncode(const upb_FieldDef* f, upb_Arena* a,
12681                                        upb_StringView* out);
12682 
12683 const upb_MiniTableField* upb_FieldDef_MiniTable(const upb_FieldDef* f);
12684 const upb_MiniTableExtension* upb_FieldDef_MiniTableExtension(
12685     const upb_FieldDef* f);
12686 UPB_API const char* upb_FieldDef_Name(const upb_FieldDef* f);
12687 UPB_API uint32_t upb_FieldDef_Number(const upb_FieldDef* f);
12688 const UPB_DESC(FieldOptions) * upb_FieldDef_Options(const upb_FieldDef* f);
12689 const UPB_DESC(FeatureSet) *
12690     upb_FieldDef_ResolvedFeatures(const upb_FieldDef* f);
12691 UPB_API const upb_OneofDef* upb_FieldDef_RealContainingOneof(
12692     const upb_FieldDef* f);
12693 UPB_API upb_FieldType upb_FieldDef_Type(const upb_FieldDef* f);
12694 
12695 #ifdef __cplusplus
12696 } /* extern "C" */
12697 #endif
12698 
12699 
12700 #endif /* UPB_REFLECTION_FIELD_DEF_H_ */
12701 
12702 // IWYU pragma: private, include "upb/reflection/def.h"
12703 
12704 #ifndef UPB_REFLECTION_FILE_DEF_H_
12705 #define UPB_REFLECTION_FILE_DEF_H_
12706 
12707 
12708 // Must be last.
12709 
12710 #ifdef __cplusplus
12711 extern "C" {
12712 #endif
12713 
12714 UPB_API const char* upb_FileDef_EditionName(int edition);
12715 
12716 const upb_FileDef* upb_FileDef_Dependency(const upb_FileDef* f, int i);
12717 int upb_FileDef_DependencyCount(const upb_FileDef* f);
12718 bool upb_FileDef_HasOptions(const upb_FileDef* f);
12719 UPB_API const char* upb_FileDef_Name(const upb_FileDef* f);
12720 const UPB_DESC(FileOptions) * upb_FileDef_Options(const upb_FileDef* f);
12721 const UPB_DESC(FeatureSet) * upb_FileDef_ResolvedFeatures(const upb_FileDef* f);
12722 const char* upb_FileDef_Package(const upb_FileDef* f);
12723 UPB_DESC(Edition) upb_FileDef_Edition(const upb_FileDef* f);
12724 UPB_API const upb_DefPool* upb_FileDef_Pool(const upb_FileDef* f);
12725 
12726 const upb_FileDef* upb_FileDef_PublicDependency(const upb_FileDef* f, int i);
12727 int upb_FileDef_PublicDependencyCount(const upb_FileDef* f);
12728 
12729 const upb_ServiceDef* upb_FileDef_Service(const upb_FileDef* f, int i);
12730 int upb_FileDef_ServiceCount(const upb_FileDef* f);
12731 
12732 UPB_API upb_Syntax upb_FileDef_Syntax(const upb_FileDef* f);
12733 
12734 const upb_EnumDef* upb_FileDef_TopLevelEnum(const upb_FileDef* f, int i);
12735 int upb_FileDef_TopLevelEnumCount(const upb_FileDef* f);
12736 
12737 const upb_FieldDef* upb_FileDef_TopLevelExtension(const upb_FileDef* f, int i);
12738 int upb_FileDef_TopLevelExtensionCount(const upb_FileDef* f);
12739 
12740 const upb_MessageDef* upb_FileDef_TopLevelMessage(const upb_FileDef* f, int i);
12741 int upb_FileDef_TopLevelMessageCount(const upb_FileDef* f);
12742 
12743 const upb_FileDef* upb_FileDef_WeakDependency(const upb_FileDef* f, int i);
12744 int upb_FileDef_WeakDependencyCount(const upb_FileDef* f);
12745 
12746 // Returns whether |symbol| is transitively included by |f|
12747 bool upb_FileDef_Resolves(const upb_FileDef* f, const char* symbol);
12748 
12749 #ifdef __cplusplus
12750 } /* extern "C" */
12751 #endif
12752 
12753 
12754 #endif /* UPB_REFLECTION_FILE_DEF_H_ */
12755 
12756 // IWYU pragma: private, include "upb/reflection/def.h"
12757 
12758 #ifndef UPB_REFLECTION_MESSAGE_DEF_H_
12759 #define UPB_REFLECTION_MESSAGE_DEF_H_
12760 
12761 
12762 // Must be last.
12763 
12764 // Well-known field tag numbers for map-entry messages.
12765 #define kUpb_MapEntry_KeyFieldNumber 1
12766 #define kUpb_MapEntry_ValueFieldNumber 2
12767 
12768 // Well-known field tag numbers for Any messages.
12769 #define kUpb_Any_TypeFieldNumber 1
12770 #define kUpb_Any_ValueFieldNumber 2
12771 
12772 // Well-known field tag numbers for duration messages.
12773 #define kUpb_Duration_SecondsFieldNumber 1
12774 #define kUpb_Duration_NanosFieldNumber 2
12775 
12776 // Well-known field tag numbers for timestamp messages.
12777 #define kUpb_Timestamp_SecondsFieldNumber 1
12778 #define kUpb_Timestamp_NanosFieldNumber 2
12779 
12780 // All the different kind of well known type messages. For simplicity of check,
12781 // number wrappers and string wrappers are grouped together. Make sure the
12782 // order and number of these groups are not changed.
12783 typedef enum {
12784   kUpb_WellKnown_Unspecified,
12785   kUpb_WellKnown_Any,
12786   kUpb_WellKnown_FieldMask,
12787   kUpb_WellKnown_Duration,
12788   kUpb_WellKnown_Timestamp,
12789 
12790   // number wrappers
12791   kUpb_WellKnown_DoubleValue,
12792   kUpb_WellKnown_FloatValue,
12793   kUpb_WellKnown_Int64Value,
12794   kUpb_WellKnown_UInt64Value,
12795   kUpb_WellKnown_Int32Value,
12796   kUpb_WellKnown_UInt32Value,
12797 
12798   // string wrappers
12799   kUpb_WellKnown_StringValue,
12800   kUpb_WellKnown_BytesValue,
12801   kUpb_WellKnown_BoolValue,
12802   kUpb_WellKnown_Value,
12803   kUpb_WellKnown_ListValue,
12804   kUpb_WellKnown_Struct,
12805 } upb_WellKnown;
12806 
12807 #ifdef __cplusplus
12808 extern "C" {
12809 #endif
12810 
12811 const upb_MessageDef* upb_MessageDef_ContainingType(const upb_MessageDef* m);
12812 
12813 const upb_ExtensionRange* upb_MessageDef_ExtensionRange(const upb_MessageDef* m,
12814                                                         int i);
12815 int upb_MessageDef_ExtensionRangeCount(const upb_MessageDef* m);
12816 
12817 UPB_API const upb_FieldDef* upb_MessageDef_Field(const upb_MessageDef* m,
12818                                                  int i);
12819 UPB_API int upb_MessageDef_FieldCount(const upb_MessageDef* m);
12820 
12821 UPB_API const upb_FileDef* upb_MessageDef_File(const upb_MessageDef* m);
12822 
12823 // Returns a field by either JSON name or regular proto name.
12824 const upb_FieldDef* upb_MessageDef_FindByJsonNameWithSize(
12825     const upb_MessageDef* m, const char* name, size_t size);
upb_MessageDef_FindByJsonName(const upb_MessageDef * m,const char * name)12826 UPB_INLINE const upb_FieldDef* upb_MessageDef_FindByJsonName(
12827     const upb_MessageDef* m, const char* name) {
12828   return upb_MessageDef_FindByJsonNameWithSize(m, name, strlen(name));
12829 }
12830 
12831 // Lookup of either field or oneof by name. Returns whether either was found.
12832 // If the return is true, then the found def will be set, and the non-found
12833 // one set to NULL.
12834 UPB_API bool upb_MessageDef_FindByNameWithSize(const upb_MessageDef* m,
12835                                                const char* name, size_t size,
12836                                                const upb_FieldDef** f,
12837                                                const upb_OneofDef** o);
upb_MessageDef_FindByName(const upb_MessageDef * m,const char * name,const upb_FieldDef ** f,const upb_OneofDef ** o)12838 UPB_INLINE bool upb_MessageDef_FindByName(const upb_MessageDef* m,
12839                                           const char* name,
12840                                           const upb_FieldDef** f,
12841                                           const upb_OneofDef** o) {
12842   return upb_MessageDef_FindByNameWithSize(m, name, strlen(name), f, o);
12843 }
12844 
12845 const upb_FieldDef* upb_MessageDef_FindFieldByName(const upb_MessageDef* m,
12846                                                    const char* name);
12847 UPB_API const upb_FieldDef* upb_MessageDef_FindFieldByNameWithSize(
12848     const upb_MessageDef* m, const char* name, size_t size);
12849 UPB_API const upb_FieldDef* upb_MessageDef_FindFieldByNumber(
12850     const upb_MessageDef* m, uint32_t i);
12851 const upb_OneofDef* upb_MessageDef_FindOneofByName(const upb_MessageDef* m,
12852                                                    const char* name);
12853 UPB_API const upb_OneofDef* upb_MessageDef_FindOneofByNameWithSize(
12854     const upb_MessageDef* m, const char* name, size_t size);
12855 UPB_API const char* upb_MessageDef_FullName(const upb_MessageDef* m);
12856 bool upb_MessageDef_HasOptions(const upb_MessageDef* m);
12857 bool upb_MessageDef_IsMapEntry(const upb_MessageDef* m);
12858 bool upb_MessageDef_IsMessageSet(const upb_MessageDef* m);
12859 
12860 // Creates a mini descriptor string for a message, returns true on success.
12861 bool upb_MessageDef_MiniDescriptorEncode(const upb_MessageDef* m, upb_Arena* a,
12862                                          upb_StringView* out);
12863 
12864 UPB_API const upb_MiniTable* upb_MessageDef_MiniTable(const upb_MessageDef* m);
12865 const char* upb_MessageDef_Name(const upb_MessageDef* m);
12866 
12867 const upb_EnumDef* upb_MessageDef_NestedEnum(const upb_MessageDef* m, int i);
12868 const upb_FieldDef* upb_MessageDef_NestedExtension(const upb_MessageDef* m,
12869                                                    int i);
12870 const upb_MessageDef* upb_MessageDef_NestedMessage(const upb_MessageDef* m,
12871                                                    int i);
12872 
12873 int upb_MessageDef_NestedEnumCount(const upb_MessageDef* m);
12874 int upb_MessageDef_NestedExtensionCount(const upb_MessageDef* m);
12875 int upb_MessageDef_NestedMessageCount(const upb_MessageDef* m);
12876 
12877 UPB_API const upb_OneofDef* upb_MessageDef_Oneof(const upb_MessageDef* m,
12878                                                  int i);
12879 UPB_API int upb_MessageDef_OneofCount(const upb_MessageDef* m);
12880 int upb_MessageDef_RealOneofCount(const upb_MessageDef* m);
12881 
12882 const UPB_DESC(MessageOptions) *
12883     upb_MessageDef_Options(const upb_MessageDef* m);
12884 const UPB_DESC(FeatureSet) *
12885     upb_MessageDef_ResolvedFeatures(const upb_MessageDef* m);
12886 
12887 upb_StringView upb_MessageDef_ReservedName(const upb_MessageDef* m, int i);
12888 int upb_MessageDef_ReservedNameCount(const upb_MessageDef* m);
12889 
12890 const upb_MessageReservedRange* upb_MessageDef_ReservedRange(
12891     const upb_MessageDef* m, int i);
12892 int upb_MessageDef_ReservedRangeCount(const upb_MessageDef* m);
12893 
12894 UPB_API upb_Syntax upb_MessageDef_Syntax(const upb_MessageDef* m);
12895 UPB_API upb_WellKnown upb_MessageDef_WellKnownType(const upb_MessageDef* m);
12896 
12897 #ifdef __cplusplus
12898 } /* extern "C" */
12899 #endif
12900 
12901 
12902 #endif /* UPB_REFLECTION_MESSAGE_DEF_H_ */
12903 
12904 // IWYU pragma: private, include "upb/reflection/def.h"
12905 
12906 #ifndef UPB_REFLECTION_METHOD_DEF_H_
12907 #define UPB_REFLECTION_METHOD_DEF_H_
12908 
12909 
12910 // Must be last.
12911 
12912 #ifdef __cplusplus
12913 extern "C" {
12914 #endif
12915 
12916 UPB_API bool upb_MethodDef_ClientStreaming(const upb_MethodDef* m);
12917 const char* upb_MethodDef_FullName(const upb_MethodDef* m);
12918 bool upb_MethodDef_HasOptions(const upb_MethodDef* m);
12919 int upb_MethodDef_Index(const upb_MethodDef* m);
12920 UPB_API const upb_MessageDef* upb_MethodDef_InputType(const upb_MethodDef* m);
12921 UPB_API const char* upb_MethodDef_Name(const upb_MethodDef* m);
12922 UPB_API const UPB_DESC(MethodOptions) *
12923     upb_MethodDef_Options(const upb_MethodDef* m);
12924 const UPB_DESC(FeatureSet) *
12925     upb_MethodDef_ResolvedFeatures(const upb_MethodDef* m);
12926 UPB_API const upb_MessageDef* upb_MethodDef_OutputType(const upb_MethodDef* m);
12927 UPB_API bool upb_MethodDef_ServerStreaming(const upb_MethodDef* m);
12928 UPB_API const upb_ServiceDef* upb_MethodDef_Service(const upb_MethodDef* m);
12929 
12930 #ifdef __cplusplus
12931 } /* extern "C" */
12932 #endif
12933 
12934 
12935 #endif /* UPB_REFLECTION_METHOD_DEF_H_ */
12936 
12937 // IWYU pragma: private, include "upb/reflection/def.h"
12938 
12939 #ifndef UPB_REFLECTION_ONEOF_DEF_H_
12940 #define UPB_REFLECTION_ONEOF_DEF_H_
12941 
12942 
12943 // Must be last.
12944 
12945 #ifdef __cplusplus
12946 extern "C" {
12947 #endif
12948 
12949 UPB_API const upb_MessageDef* upb_OneofDef_ContainingType(
12950     const upb_OneofDef* o);
12951 UPB_API const upb_FieldDef* upb_OneofDef_Field(const upb_OneofDef* o, int i);
12952 UPB_API int upb_OneofDef_FieldCount(const upb_OneofDef* o);
12953 const char* upb_OneofDef_FullName(const upb_OneofDef* o);
12954 bool upb_OneofDef_HasOptions(const upb_OneofDef* o);
12955 uint32_t upb_OneofDef_Index(const upb_OneofDef* o);
12956 bool upb_OneofDef_IsSynthetic(const upb_OneofDef* o);
12957 const upb_FieldDef* upb_OneofDef_LookupName(const upb_OneofDef* o,
12958                                             const char* name);
12959 const upb_FieldDef* upb_OneofDef_LookupNameWithSize(const upb_OneofDef* o,
12960                                                     const char* name,
12961                                                     size_t size);
12962 const upb_FieldDef* upb_OneofDef_LookupNumber(const upb_OneofDef* o,
12963                                               uint32_t num);
12964 UPB_API const char* upb_OneofDef_Name(const upb_OneofDef* o);
12965 int upb_OneofDef_numfields(const upb_OneofDef* o);
12966 const UPB_DESC(OneofOptions*) upb_OneofDef_Options(const upb_OneofDef* o);
12967 const UPB_DESC(FeatureSet*)
12968     upb_OneofDef_ResolvedFeatures(const upb_OneofDef* o);
12969 
12970 #ifdef __cplusplus
12971 } /* extern "C" */
12972 #endif
12973 
12974 
12975 #endif /* UPB_REFLECTION_ONEOF_DEF_H_ */
12976 
12977 // IWYU pragma: private, include "upb/reflection/def.h"
12978 
12979 #ifndef UPB_REFLECTION_SERVICE_DEF_H_
12980 #define UPB_REFLECTION_SERVICE_DEF_H_
12981 
12982 
12983 // Must be last.
12984 
12985 #ifdef __cplusplus
12986 extern "C" {
12987 #endif
12988 
12989 UPB_API const upb_FileDef* upb_ServiceDef_File(const upb_ServiceDef* s);
12990 const upb_MethodDef* upb_ServiceDef_FindMethodByName(const upb_ServiceDef* s,
12991                                                      const char* name);
12992 UPB_API const char* upb_ServiceDef_FullName(const upb_ServiceDef* s);
12993 bool upb_ServiceDef_HasOptions(const upb_ServiceDef* s);
12994 int upb_ServiceDef_Index(const upb_ServiceDef* s);
12995 UPB_API const upb_MethodDef* upb_ServiceDef_Method(const upb_ServiceDef* s,
12996                                                    int i);
12997 UPB_API int upb_ServiceDef_MethodCount(const upb_ServiceDef* s);
12998 const char* upb_ServiceDef_Name(const upb_ServiceDef* s);
12999 UPB_API const UPB_DESC(ServiceOptions) *
13000     upb_ServiceDef_Options(const upb_ServiceDef* s);
13001 const UPB_DESC(FeatureSet) *
13002     upb_ServiceDef_ResolvedFeatures(const upb_ServiceDef* s);
13003 
13004 #ifdef __cplusplus
13005 } /* extern "C" */
13006 #endif
13007 
13008 
13009 #endif /* UPB_REFLECTION_SERVICE_DEF_H_ */
13010 // IWYU pragma: end_exports
13011 
13012 #endif /* UPB_REFLECTION_DEF_H_ */
13013 
13014 // Must be last.
13015 
13016 #ifdef __cplusplus
13017 extern "C" {
13018 #endif
13019 
13020 enum { upb_JsonDecode_IgnoreUnknown = 1 };
13021 
13022 enum {
13023   kUpb_JsonDecodeResult_Ok = 0,
13024   kUpb_JsonDecodeResult_OkWithEmptyStringNumerics = 1,
13025   kUpb_JsonDecodeResult_Error = 2,
13026 };
13027 
13028 UPB_API int upb_JsonDecodeDetectingNonconformance(const char* buf, size_t size,
13029                                                   upb_Message* msg,
13030                                                   const upb_MessageDef* m,
13031                                                   const upb_DefPool* symtab,
13032                                                   int options, upb_Arena* arena,
13033                                                   upb_Status* status);
13034 
upb_JsonDecode(const char * buf,size_t size,upb_Message * msg,const upb_MessageDef * m,const upb_DefPool * symtab,int options,upb_Arena * arena,upb_Status * status)13035 UPB_API_INLINE bool upb_JsonDecode(const char* buf, size_t size,
13036                                    upb_Message* msg, const upb_MessageDef* m,
13037                                    const upb_DefPool* symtab, int options,
13038                                    upb_Arena* arena, upb_Status* status) {
13039   return upb_JsonDecodeDetectingNonconformance(buf, size, msg, m, symtab,
13040                                                options, arena, status) ==
13041          kUpb_JsonDecodeResult_Ok;
13042 }
13043 
13044 #ifdef __cplusplus
13045 } /* extern "C" */
13046 #endif
13047 
13048 
13049 #endif /* UPB_JSONDECODE_H_ */
13050 
13051 #ifndef UPB_LEX_ATOI_H_
13052 #define UPB_LEX_ATOI_H_
13053 
13054 #include <stdint.h>
13055 
13056 // Must be last.
13057 
13058 #ifdef __cplusplus
13059 extern "C" {
13060 #endif
13061 
13062 // We use these hand-written routines instead of strto[u]l() because the "long
13063 // long" variants aren't in c89. Also our version allows setting a ptr limit.
13064 // Return the new position of the pointer after parsing the int, or NULL on
13065 // integer overflow.
13066 
13067 const char* upb_BufToUint64(const char* ptr, const char* end, uint64_t* val);
13068 const char* upb_BufToInt64(const char* ptr, const char* end, int64_t* val,
13069                            bool* is_neg);
13070 
13071 #ifdef __cplusplus
13072 } /* extern "C" */
13073 #endif
13074 
13075 
13076 #endif /* UPB_LEX_ATOI_H_ */
13077 
13078 #ifndef UPB_LEX_UNICODE_H_
13079 #define UPB_LEX_UNICODE_H_
13080 
13081 #include <stdint.h>
13082 
13083 // Must be last.
13084 
13085 #ifdef __cplusplus
13086 extern "C" {
13087 #endif
13088 
13089 // Returns true iff a codepoint is the value for a high surrogate.
upb_Unicode_IsHigh(uint32_t cp)13090 UPB_INLINE bool upb_Unicode_IsHigh(uint32_t cp) {
13091   return (cp >= 0xd800 && cp <= 0xdbff);
13092 }
13093 
13094 // Returns true iff a codepoint is the value for a low surrogate.
upb_Unicode_IsLow(uint32_t cp)13095 UPB_INLINE bool upb_Unicode_IsLow(uint32_t cp) {
13096   return (cp >= 0xdc00 && cp <= 0xdfff);
13097 }
13098 
13099 // Returns the high 16-bit surrogate value for a supplementary codepoint.
13100 // Does not sanity-check the input.
upb_Unicode_ToHigh(uint32_t cp)13101 UPB_INLINE uint16_t upb_Unicode_ToHigh(uint32_t cp) {
13102   return (cp >> 10) + 0xd7c0;
13103 }
13104 
13105 // Returns the low 16-bit surrogate value for a supplementary codepoint.
13106 // Does not sanity-check the input.
upb_Unicode_ToLow(uint32_t cp)13107 UPB_INLINE uint16_t upb_Unicode_ToLow(uint32_t cp) {
13108   return (cp & 0x3ff) | 0xdc00;
13109 }
13110 
13111 // Returns the 32-bit value corresponding to a pair of 16-bit surrogates.
13112 // Does not sanity-check the input.
upb_Unicode_FromPair(uint32_t high,uint32_t low)13113 UPB_INLINE uint32_t upb_Unicode_FromPair(uint32_t high, uint32_t low) {
13114   return ((high & 0x3ff) << 10) + (low & 0x3ff) + 0x10000;
13115 }
13116 
13117 // Outputs a codepoint as UTF8.
13118 // Returns the number of bytes written (1-4 on success, 0 on error).
13119 // Does not sanity-check the input. Specifically does not check for surrogates.
13120 int upb_Unicode_ToUTF8(uint32_t cp, char* out);
13121 
13122 #ifdef __cplusplus
13123 } /* extern "C" */
13124 #endif
13125 
13126 
13127 #endif /* UPB_LEX_UNICODE_H_ */
13128 
13129 #ifndef UPB_REFLECTION_MESSAGE_H_
13130 #define UPB_REFLECTION_MESSAGE_H_
13131 
13132 #include <stddef.h>
13133 
13134 
13135 // Must be last.
13136 
13137 #ifdef __cplusplus
13138 extern "C" {
13139 #endif
13140 
13141 // Returns a mutable pointer to a map, array, or submessage value. If the given
13142 // arena is non-NULL this will construct a new object if it was not previously
13143 // present. May not be called for primitive fields.
13144 UPB_API upb_MutableMessageValue upb_Message_Mutable(upb_Message* msg,
13145                                                     const upb_FieldDef* f,
13146                                                     upb_Arena* a);
13147 
13148 // Returns the field that is set in the oneof, or NULL if none are set.
13149 UPB_API const upb_FieldDef* upb_Message_WhichOneofByDef(const upb_Message* msg,
13150                                                         const upb_OneofDef* o);
13151 
13152 // Clear all data and unknown fields.
13153 void upb_Message_ClearByDef(upb_Message* msg, const upb_MessageDef* m);
13154 
13155 // Clears any field presence and sets the value back to its default.
13156 UPB_API void upb_Message_ClearFieldByDef(upb_Message* msg,
13157                                          const upb_FieldDef* f);
13158 
13159 // May only be called for fields where upb_FieldDef_HasPresence(f) == true.
13160 UPB_API bool upb_Message_HasFieldByDef(const upb_Message* msg,
13161                                        const upb_FieldDef* f);
13162 
13163 // Returns the value in the message associated with this field def.
13164 UPB_API upb_MessageValue upb_Message_GetFieldByDef(const upb_Message* msg,
13165                                                    const upb_FieldDef* f);
13166 
13167 // Sets the given field to the given value. For a msg/array/map/string, the
13168 // caller must ensure that the target data outlives |msg| (by living either in
13169 // the same arena or a different arena that outlives it).
13170 //
13171 // Returns false if allocation fails.
13172 UPB_API bool upb_Message_SetFieldByDef(upb_Message* msg, const upb_FieldDef* f,
13173                                        upb_MessageValue val, upb_Arena* a);
13174 
13175 // Iterate over present fields.
13176 //
13177 // size_t iter = kUpb_Message_Begin;
13178 // const upb_FieldDef *f;
13179 // upb_MessageValue val;
13180 // while (upb_Message_Next(msg, m, ext_pool, &f, &val, &iter)) {
13181 //   process_field(f, val);
13182 // }
13183 //
13184 // If ext_pool is NULL, no extensions will be returned.  If the given symtab
13185 // returns extensions that don't match what is in this message, those extensions
13186 // will be skipped.
13187 
13188 #define kUpb_Message_Begin -1
13189 
13190 UPB_API bool upb_Message_Next(const upb_Message* msg, const upb_MessageDef* m,
13191                               const upb_DefPool* ext_pool,
13192                               const upb_FieldDef** f, upb_MessageValue* val,
13193                               size_t* iter);
13194 
13195 // Clears all unknown field data from this message and all submessages.
13196 UPB_API bool upb_Message_DiscardUnknown(upb_Message* msg,
13197                                         const upb_MessageDef* m, int maxdepth);
13198 
13199 #ifdef __cplusplus
13200 } /* extern "C" */
13201 #endif
13202 
13203 
13204 #endif /* UPB_REFLECTION_MESSAGE_H_ */
13205 
13206 #ifndef UPB_JSON_ENCODE_H_
13207 #define UPB_JSON_ENCODE_H_
13208 
13209 
13210 // Must be last.
13211 
13212 #ifdef __cplusplus
13213 extern "C" {
13214 #endif
13215 
13216 enum {
13217   /* When set, emits 0/default values.  TODO: proto3 only? */
13218   upb_JsonEncode_EmitDefaults = 1 << 0,
13219 
13220   /* When set, use normal (snake_case) field names instead of JSON (camelCase)
13221      names. */
13222   upb_JsonEncode_UseProtoNames = 1 << 1,
13223 
13224   /* When set, emits enums as their integer values instead of as their names. */
13225   upb_JsonEncode_FormatEnumsAsIntegers = 1 << 2
13226 };
13227 
13228 /* Encodes the given |msg| to JSON format.  The message's reflection is given in
13229  * |m|.  The DefPool in |ext_pool| is used to find extensions (if NULL,
13230  * extensions will not be printed).
13231  *
13232  * Output is placed in the given buffer, and always NULL-terminated.  The output
13233  * size (excluding NULL) is returned.  This means that a return value >= |size|
13234  * implies that the output was truncated.  (These are the same semantics as
13235  * snprintf()). */
13236 UPB_API size_t upb_JsonEncode(const upb_Message* msg, const upb_MessageDef* m,
13237                               const upb_DefPool* ext_pool, int options,
13238                               char* buf, size_t size, upb_Status* status);
13239 
13240 #ifdef __cplusplus
13241 } /* extern "C" */
13242 #endif
13243 
13244 
13245 #endif /* UPB_JSONENCODE_H_ */
13246 
13247 #ifndef UPB_LEX_ROUND_TRIP_H_
13248 #define UPB_LEX_ROUND_TRIP_H_
13249 
13250 // Must be last.
13251 
13252 // Encodes a float or double that is round-trippable, but as short as possible.
13253 // These routines are not fully optimal (not guaranteed to be shortest), but are
13254 // short-ish and match the implementation that has been used in protobuf since
13255 // the beginning.
13256 
13257 // The given buffer size must be at least kUpb_RoundTripBufferSize.
13258 enum { kUpb_RoundTripBufferSize = 32 };
13259 
13260 #ifdef __cplusplus
13261 extern "C" {
13262 #endif
13263 
13264 void _upb_EncodeRoundTripDouble(double val, char* buf, size_t size);
13265 void _upb_EncodeRoundTripFloat(float val, char* buf, size_t size);
13266 
13267 #ifdef __cplusplus
13268 } /* extern "C" */
13269 #endif
13270 
13271 
13272 #endif /* UPB_LEX_ROUND_TRIP_H_ */
13273 
13274 #ifndef UPB_PORT_VSNPRINTF_COMPAT_H_
13275 #define UPB_PORT_VSNPRINTF_COMPAT_H_
13276 
13277 // Must be last.
13278 
_upb_vsnprintf(char * buf,size_t size,const char * fmt,va_list ap)13279 UPB_INLINE int _upb_vsnprintf(char* buf, size_t size, const char* fmt,
13280                               va_list ap) {
13281 #if defined(__MINGW64__) || defined(__MINGW32__) || defined(_MSC_VER)
13282   // The msvc runtime has a non-conforming vsnprintf() that requires the
13283   // following compatibility code to become conformant.
13284   int n = -1;
13285   if (size != 0) n = _vsnprintf_s(buf, size, _TRUNCATE, fmt, ap);
13286   if (n == -1) n = _vscprintf(fmt, ap);
13287   return n;
13288 #else
13289   return vsnprintf(buf, size, fmt, ap);
13290 #endif
13291 }
13292 
13293 
13294 #endif  // UPB_PORT_VSNPRINTF_COMPAT_H_
13295 
13296 #ifndef UPB_PORT_ATOMIC_H_
13297 #define UPB_PORT_ATOMIC_H_
13298 
13299 
13300 #ifdef UPB_USE_C11_ATOMICS
13301 
13302 // IWYU pragma: begin_exports
13303 #include <stdatomic.h>
13304 #include <stdbool.h>
13305 // IWYU pragma: end_exports
13306 
13307 #define upb_Atomic_Init(addr, val) atomic_init(addr, val)
13308 #define upb_Atomic_Load(addr, order) atomic_load_explicit(addr, order)
13309 #define upb_Atomic_Store(addr, val, order) \
13310   atomic_store_explicit(addr, val, order)
13311 #define upb_Atomic_Add(addr, val, order) \
13312   atomic_fetch_add_explicit(addr, val, order)
13313 #define upb_Atomic_Sub(addr, val, order) \
13314   atomic_fetch_sub_explicit(addr, val, order)
13315 #define upb_Atomic_Exchange(addr, val, order) \
13316   atomic_exchange_explicit(addr, val, order)
13317 #define upb_Atomic_CompareExchangeStrong(addr, expected, desired,      \
13318                                          success_order, failure_order) \
13319   atomic_compare_exchange_strong_explicit(addr, expected, desired,     \
13320                                           success_order, failure_order)
13321 #define upb_Atomic_CompareExchangeWeak(addr, expected, desired, success_order, \
13322                                        failure_order)                          \
13323   atomic_compare_exchange_weak_explicit(addr, expected, desired,               \
13324                                         success_order, failure_order)
13325 
13326 #else  // !UPB_USE_C11_ATOMICS
13327 
13328 #include <string.h>
13329 
13330 #define upb_Atomic_Init(addr, val) (*addr = val)
13331 #define upb_Atomic_Load(addr, order) (*addr)
13332 #define upb_Atomic_Store(addr, val, order) (*(addr) = val)
13333 #define upb_Atomic_Add(addr, val, order) (*(addr) += val)
13334 #define upb_Atomic_Sub(addr, val, order) (*(addr) -= val)
13335 
_upb_NonAtomic_Exchange(void * addr,void * value)13336 UPB_INLINE void* _upb_NonAtomic_Exchange(void* addr, void* value) {
13337   void* old;
13338   memcpy(&old, addr, sizeof(value));
13339   memcpy(addr, &value, sizeof(value));
13340   return old;
13341 }
13342 
13343 #define upb_Atomic_Exchange(addr, val, order) _upb_NonAtomic_Exchange(addr, val)
13344 
13345 // `addr` and `expected` are logically double pointers.
_upb_NonAtomic_CompareExchangeStrongP(void * addr,void * expected,void * desired)13346 UPB_INLINE bool _upb_NonAtomic_CompareExchangeStrongP(void* addr,
13347                                                       void* expected,
13348                                                       void* desired) {
13349   if (memcmp(addr, expected, sizeof(desired)) == 0) {
13350     memcpy(addr, &desired, sizeof(desired));
13351     return true;
13352   } else {
13353     memcpy(expected, addr, sizeof(desired));
13354     return false;
13355   }
13356 }
13357 
13358 #define upb_Atomic_CompareExchangeStrong(addr, expected, desired,      \
13359                                          success_order, failure_order) \
13360   _upb_NonAtomic_CompareExchangeStrongP((void*)addr, (void*)expected,  \
13361                                         (void*)desired)
13362 #define upb_Atomic_CompareExchangeWeak(addr, expected, desired, success_order, \
13363                                        failure_order)                          \
13364   upb_Atomic_CompareExchangeStrong(addr, expected, desired, 0, 0)
13365 
13366 #endif
13367 
13368 
13369 #endif  // UPB_PORT_ATOMIC_H_
13370 
13371 #ifndef UPB_MESSAGE_COMPAT_H_
13372 #define UPB_MESSAGE_COMPAT_H_
13373 
13374 #include <stdint.h>
13375 
13376 
13377 // Must be last.
13378 
13379 // upb does not support mixing minitables from different sources but these
13380 // functions are still used by some existing users so for now we make them
13381 // available here. This may or may not change in the future so do not add
13382 // them to new code.
13383 
13384 #ifdef __cplusplus
13385 extern "C" {
13386 #endif
13387 
13388 const upb_MiniTableExtension* upb_Message_ExtensionByIndex(
13389     const upb_Message* msg, size_t index);
13390 
13391 // Returns the minitable with the given field number, or NULL on failure.
13392 const upb_MiniTableExtension* upb_Message_FindExtensionByNumber(
13393     const upb_Message* msg, uint32_t field_number);
13394 
13395 #ifdef __cplusplus
13396 } /* extern "C" */
13397 #endif
13398 
13399 
13400 #endif /* UPB_MESSAGE_COMPAT_H_ */
13401 
13402 // EVERYTHING BELOW THIS LINE IS INTERNAL - DO NOT USE /////////////////////////
13403 
13404 #ifndef UPB_MESSAGE_INTERNAL_MAP_SORTER_H_
13405 #define UPB_MESSAGE_INTERNAL_MAP_SORTER_H_
13406 
13407 #include <stdlib.h>
13408 
13409 
13410 #ifndef UPB_MESSAGE_INTERNAL_MAP_ENTRY_H_
13411 #define UPB_MESSAGE_INTERNAL_MAP_ENTRY_H_
13412 
13413 #include <stdint.h>
13414 
13415 
13416 // Map entries aren't actually stored for map fields, they are only used during
13417 // parsing. (It helps a lot if all map entry messages have the same layout.)
13418 // The mini_table layout code will ensure that all map entries have this layout.
13419 //
13420 // Note that users can and do create map entries directly, which will also use
13421 // this layout.
13422 
13423 typedef struct {
13424   struct upb_Message message;
13425   // We only need 2 hasbits max, but due to alignment we'll use 8 bytes here,
13426   // and the uint64_t helps make this clear.
13427   uint64_t hasbits;
13428   union {
13429     upb_StringView str;  // For str/bytes.
13430     upb_value val;       // For all other types.
13431     double d[2];         // Padding for 32-bit builds.
13432   } k;
13433   union {
13434     upb_StringView str;  // For str/bytes.
13435     upb_value val;       // For all other types.
13436     double d[2];         // Padding for 32-bit builds.
13437   } v;
13438 } upb_MapEntry;
13439 
13440 #endif  // UPB_MESSAGE_INTERNAL_MAP_ENTRY_H_
13441 
13442 // Must be last.
13443 
13444 #ifdef __cplusplus
13445 extern "C" {
13446 #endif
13447 
13448 // _upb_mapsorter sorts maps and provides ordered iteration over the entries.
13449 // Since maps can be recursive (map values can be messages which contain other
13450 // maps), _upb_mapsorter can contain a stack of maps.
13451 
13452 typedef struct {
13453   void const** entries;
13454   int size;
13455   int cap;
13456 } _upb_mapsorter;
13457 
13458 typedef struct {
13459   int start;
13460   int pos;
13461   int end;
13462 } _upb_sortedmap;
13463 
_upb_mapsorter_init(_upb_mapsorter * s)13464 UPB_INLINE void _upb_mapsorter_init(_upb_mapsorter* s) {
13465   s->entries = NULL;
13466   s->size = 0;
13467   s->cap = 0;
13468 }
13469 
_upb_mapsorter_destroy(_upb_mapsorter * s)13470 UPB_INLINE void _upb_mapsorter_destroy(_upb_mapsorter* s) {
13471   if (s->entries) upb_gfree(s->entries);
13472 }
13473 
_upb_sortedmap_next(_upb_mapsorter * s,const struct upb_Map * map,_upb_sortedmap * sorted,upb_MapEntry * ent)13474 UPB_INLINE bool _upb_sortedmap_next(_upb_mapsorter* s,
13475                                     const struct upb_Map* map,
13476                                     _upb_sortedmap* sorted, upb_MapEntry* ent) {
13477   if (sorted->pos == sorted->end) return false;
13478   const upb_tabent* tabent = (const upb_tabent*)s->entries[sorted->pos++];
13479   upb_StringView key = upb_tabstrview(tabent->key);
13480   _upb_map_fromkey(key, &ent->k, map->key_size);
13481   upb_value val = {tabent->val.val};
13482   _upb_map_fromvalue(val, &ent->v, map->val_size);
13483   return true;
13484 }
13485 
_upb_sortedmap_nextext(_upb_mapsorter * s,_upb_sortedmap * sorted,const upb_Extension ** ext)13486 UPB_INLINE bool _upb_sortedmap_nextext(_upb_mapsorter* s,
13487                                        _upb_sortedmap* sorted,
13488                                        const upb_Extension** ext) {
13489   if (sorted->pos == sorted->end) return false;
13490   *ext = (const upb_Extension*)s->entries[sorted->pos++];
13491   return true;
13492 }
13493 
_upb_mapsorter_popmap(_upb_mapsorter * s,_upb_sortedmap * sorted)13494 UPB_INLINE void _upb_mapsorter_popmap(_upb_mapsorter* s,
13495                                       _upb_sortedmap* sorted) {
13496   s->size = sorted->start;
13497 }
13498 
13499 bool _upb_mapsorter_pushmap(_upb_mapsorter* s, upb_FieldType key_type,
13500                             const struct upb_Map* map, _upb_sortedmap* sorted);
13501 
13502 bool _upb_mapsorter_pushexts(_upb_mapsorter* s, const upb_Extension* exts,
13503                              size_t count, _upb_sortedmap* sorted);
13504 
13505 #ifdef __cplusplus
13506 } /* extern "C" */
13507 #endif
13508 
13509 
13510 #endif /* UPB_MESSAGE_INTERNAL_MAP_SORTER_H_ */
13511 
13512 #ifndef UPB_BASE_INTERNAL_LOG2_H_
13513 #define UPB_BASE_INTERNAL_LOG2_H_
13514 
13515 // Must be last.
13516 
13517 #ifdef __cplusplus
13518 extern "C" {
13519 #endif
13520 
upb_Log2Ceiling(int x)13521 UPB_INLINE int upb_Log2Ceiling(int x) {
13522   if (x <= 1) return 0;
13523 #ifdef __GNUC__
13524   return 32 - __builtin_clz(x - 1);
13525 #else
13526   int lg2 = 0;
13527   while ((1 << lg2) < x) lg2++;
13528   return lg2;
13529 #endif
13530 }
13531 
upb_Log2CeilingSize(int x)13532 UPB_INLINE int upb_Log2CeilingSize(int x) { return 1 << upb_Log2Ceiling(x); }
13533 
13534 #ifdef __cplusplus
13535 } /* extern "C" */
13536 #endif
13537 
13538 
13539 #endif /* UPB_BASE_INTERNAL_LOG2_H_ */
13540 
13541 #ifndef UPB_MESSAGE_COMPARE_H_
13542 #define UPB_MESSAGE_COMPARE_H_
13543 
13544 #include <stddef.h>
13545 
13546 
13547 // Must be last.
13548 
13549 enum {
13550   // If set, upb_Message_IsEqual() will attempt to compare unknown fields.
13551   // By its very nature this comparison is inexact.
13552   kUpb_CompareOption_IncludeUnknownFields = (1 << 0)
13553 };
13554 
13555 #ifdef __cplusplus
13556 extern "C" {
13557 #endif
13558 
13559 // Returns true if no known fields or extensions are set in the message.
13560 UPB_API bool upb_Message_IsEmpty(const upb_Message* msg,
13561                                  const upb_MiniTable* m);
13562 
13563 UPB_API bool upb_Message_IsEqual(const upb_Message* msg1,
13564                                  const upb_Message* msg2,
13565                                  const upb_MiniTable* m, int options);
13566 
13567 // If |ctype| is a message then |m| must point to its minitable.
upb_MessageValue_IsEqual(upb_MessageValue val1,upb_MessageValue val2,upb_CType ctype,const upb_MiniTable * m,int options)13568 UPB_API_INLINE bool upb_MessageValue_IsEqual(upb_MessageValue val1,
13569                                              upb_MessageValue val2,
13570                                              upb_CType ctype,
13571                                              const upb_MiniTable* m,
13572                                              int options) {
13573   switch (ctype) {
13574     case kUpb_CType_Bool:
13575       return val1.bool_val == val2.bool_val;
13576 
13577     case kUpb_CType_Float:
13578     case kUpb_CType_Int32:
13579     case kUpb_CType_UInt32:
13580     case kUpb_CType_Enum:
13581       return val1.int32_val == val2.int32_val;
13582 
13583     case kUpb_CType_Double:
13584     case kUpb_CType_Int64:
13585     case kUpb_CType_UInt64:
13586       return val1.int64_val == val2.int64_val;
13587 
13588     case kUpb_CType_String:
13589     case kUpb_CType_Bytes:
13590       return upb_StringView_IsEqual(val1.str_val, val2.str_val);
13591 
13592     case kUpb_CType_Message:
13593       return upb_Message_IsEqual(val1.msg_val, val2.msg_val, m, options);
13594 
13595     default:
13596       UPB_UNREACHABLE();
13597       return false;
13598   }
13599 }
13600 
13601 #ifdef __cplusplus
13602 } /* extern "C" */
13603 #endif
13604 
13605 
13606 #endif  // UPB_MESSAGE_COMPARE_H_
13607 
13608 #ifndef UPB_MESSAGE_INTERNAL_COMPARE_UNKNOWN_H_
13609 #define UPB_MESSAGE_INTERNAL_COMPARE_UNKNOWN_H_
13610 
13611 #include <stddef.h>
13612 
13613 // Must be last.
13614 
13615 #ifdef __cplusplus
13616 extern "C" {
13617 #endif
13618 
13619 // Returns true if unknown fields from the two messages are equal when sorted
13620 // and varints are made canonical.
13621 //
13622 // This function is discouraged, as the comparison is inherently lossy without
13623 // schema data:
13624 //
13625 //  1. We don't know whether delimited fields are sub-messages. Unknown
13626 //     sub-messages will therefore not have their fields sorted and varints
13627 //     canonicalized.
13628 //  2. We don't know about oneof/non-repeated fields, which should semantically
13629 //     discard every value except the last.
13630 
13631 typedef enum {
13632   kUpb_UnknownCompareResult_Equal = 0,
13633   kUpb_UnknownCompareResult_NotEqual = 1,
13634   kUpb_UnknownCompareResult_OutOfMemory = 2,
13635   kUpb_UnknownCompareResult_MaxDepthExceeded = 3,
13636 } upb_UnknownCompareResult;
13637 
13638 upb_UnknownCompareResult UPB_PRIVATE(_upb_Message_UnknownFieldsAreEqual)(
13639     const char* buf1, size_t size1, const char* buf2, size_t size2,
13640     int max_depth);
13641 
13642 #ifdef __cplusplus
13643 } /* extern "C" */
13644 #endif
13645 
13646 
13647 #endif /* UPB_MESSAGE_INTERNAL_COMPARE_UNKNOWN_H_ */
13648 
13649 #ifndef THIRD_PARTY_UPB_UPB_MESSAGE_INTERNAL_ITERATOR_H_
13650 #define THIRD_PARTY_UPB_UPB_MESSAGE_INTERNAL_ITERATOR_H_
13651 
13652 #include <stddef.h>
13653 
13654 
13655 // Must be last.
13656 
13657 #define kUpb_BaseField_Begin ((size_t)-1)
13658 #define kUpb_Extension_Begin ((size_t)-1)
13659 
13660 bool UPB_PRIVATE(_upb_Message_NextBaseField)(const upb_Message* msg,
13661                                              const upb_MiniTable* m,
13662                                              const upb_MiniTableField** out_f,
13663                                              upb_MessageValue* out_v,
13664                                              size_t* iter);
13665 
13666 bool UPB_PRIVATE(_upb_Message_NextExtension)(
13667     const upb_Message* msg, const upb_MiniTable* m,
13668     const upb_MiniTableExtension** out_e, upb_MessageValue* out_v,
13669     size_t* iter);
13670 #endif  // THIRD_PARTY_UPB_UPB_MESSAGE_INTERNAL_ITERATOR_H_
13671 
13672 #ifndef UPB_MESSAGE_COPY_H_
13673 #define UPB_MESSAGE_COPY_H_
13674 
13675 
13676 // Must be last.
13677 
13678 #ifdef __cplusplus
13679 extern "C" {
13680 #endif
13681 
13682 // Deep clones a message using the provided target arena.
13683 upb_Message* upb_Message_DeepClone(const upb_Message* msg,
13684                                    const upb_MiniTable* m, upb_Arena* arena);
13685 
13686 // Shallow clones a message using the provided target arena.
13687 upb_Message* upb_Message_ShallowClone(const upb_Message* msg,
13688                                       const upb_MiniTable* m, upb_Arena* arena);
13689 
13690 // Deep clones array contents.
13691 upb_Array* upb_Array_DeepClone(const upb_Array* array, upb_CType value_type,
13692                                const upb_MiniTable* sub, upb_Arena* arena);
13693 
13694 // Deep clones map contents.
13695 upb_Map* upb_Map_DeepClone(const upb_Map* map, upb_CType key_type,
13696                            upb_CType value_type,
13697                            const upb_MiniTable* map_entry_table,
13698                            upb_Arena* arena);
13699 
13700 // Deep copies the message from src to dst.
13701 bool upb_Message_DeepCopy(upb_Message* dst, const upb_Message* src,
13702                           const upb_MiniTable* m, upb_Arena* arena);
13703 
13704 // Shallow copies the message from src to dst.
13705 void upb_Message_ShallowCopy(upb_Message* dst, const upb_Message* src,
13706                              const upb_MiniTable* m);
13707 
13708 #ifdef __cplusplus
13709 } /* extern "C" */
13710 #endif
13711 
13712 
13713 #endif  // UPB_MESSAGE_COPY_H_
13714 #ifndef THIRD_PARTY_UPB_UPB_MESSAGE_MERGE_H_
13715 #define THIRD_PARTY_UPB_UPB_MESSAGE_MERGE_H_
13716 
13717 
13718 // Must be last.
13719 
13720 #ifdef __cplusplus
13721 extern "C" {
13722 #endif
13723 
13724 UPB_API bool upb_Message_MergeFrom(upb_Message* dst, const upb_Message* src,
13725                                    const upb_MiniTable* mt,
13726                                    const upb_ExtensionRegistry* extreg,
13727                                    upb_Arena* arena);
13728 
13729 #ifdef __cplusplus
13730 } /* extern "C" */
13731 #endif
13732 
13733 #endif  // THIRD_PARTY_UPB_UPB_MESSAGE_MERGE_H_
13734 
13735 #ifndef UPB_MINI_DESCRIPTOR_INTERNAL_BASE92_H_
13736 #define UPB_MINI_DESCRIPTOR_INTERNAL_BASE92_H_
13737 
13738 #include <stdint.h>
13739 
13740 
13741 // Must be last.
13742 
13743 #ifdef __cplusplus
13744 extern "C" {
13745 #endif
13746 
_upb_ToBase92(int8_t ch)13747 UPB_INLINE char _upb_ToBase92(int8_t ch) {
13748   extern const char _kUpb_ToBase92[];
13749   UPB_ASSERT(0 <= ch && ch < 92);
13750   return _kUpb_ToBase92[ch];
13751 }
13752 
_upb_FromBase92(uint8_t ch)13753 UPB_INLINE char _upb_FromBase92(uint8_t ch) {
13754   extern const int8_t _kUpb_FromBase92[];
13755   if (' ' > ch || ch > '~') return -1;
13756   return _kUpb_FromBase92[ch - ' '];
13757 }
13758 
_upb_Base92_DecodeVarint(const char * ptr,const char * end,char first_ch,uint8_t min,uint8_t max,uint32_t * out_val)13759 UPB_INLINE const char* _upb_Base92_DecodeVarint(const char* ptr,
13760                                                 const char* end, char first_ch,
13761                                                 uint8_t min, uint8_t max,
13762                                                 uint32_t* out_val) {
13763   uint32_t val = 0;
13764   uint32_t shift = 0;
13765   const int bits_per_char =
13766       upb_Log2Ceiling(_upb_FromBase92(max) - _upb_FromBase92(min));
13767   char ch = first_ch;
13768   while (1) {
13769     uint32_t bits = _upb_FromBase92(ch) - _upb_FromBase92(min);
13770     val |= bits << shift;
13771     if (ptr == end || *ptr < min || max < *ptr) {
13772       *out_val = val;
13773       UPB_ASSUME(ptr != NULL);
13774       return ptr;
13775     }
13776     ch = *ptr++;
13777     shift += bits_per_char;
13778     if (shift >= 32) return NULL;
13779   }
13780 }
13781 
13782 #ifdef __cplusplus
13783 } /* extern "C" */
13784 #endif
13785 
13786 
13787 #endif  // UPB_MINI_DESCRIPTOR_INTERNAL_BASE92_H_
13788 
13789 #ifndef UPB_MINI_DESCRIPTOR_INTERNAL_DECODER_H_
13790 #define UPB_MINI_DESCRIPTOR_INTERNAL_DECODER_H_
13791 
13792 
13793 // Must be last.
13794 
13795 // upb_MdDecoder: used internally for decoding MiniDescriptors for messages,
13796 // extensions, and enums.
13797 typedef struct {
13798   const char* end;
13799   upb_Status* status;
13800   jmp_buf err;
13801 } upb_MdDecoder;
13802 
13803 UPB_PRINTF(2, 3)
upb_MdDecoder_ErrorJmp(upb_MdDecoder * d,const char * fmt,...)13804 UPB_NORETURN UPB_INLINE void upb_MdDecoder_ErrorJmp(upb_MdDecoder* d,
13805                                                     const char* fmt, ...) {
13806   if (d->status) {
13807     va_list argp;
13808     upb_Status_SetErrorMessage(d->status, "Error building mini table: ");
13809     va_start(argp, fmt);
13810     upb_Status_VAppendErrorFormat(d->status, fmt, argp);
13811     va_end(argp);
13812   }
13813   UPB_LONGJMP(d->err, 1);
13814 }
13815 
upb_MdDecoder_CheckOutOfMemory(upb_MdDecoder * d,const void * ptr)13816 UPB_INLINE void upb_MdDecoder_CheckOutOfMemory(upb_MdDecoder* d,
13817                                                const void* ptr) {
13818   if (!ptr) upb_MdDecoder_ErrorJmp(d, "Out of memory");
13819 }
13820 
upb_MdDecoder_DecodeBase92Varint(upb_MdDecoder * d,const char * ptr,char first_ch,uint8_t min,uint8_t max,uint32_t * out_val)13821 UPB_INLINE const char* upb_MdDecoder_DecodeBase92Varint(
13822     upb_MdDecoder* d, const char* ptr, char first_ch, uint8_t min, uint8_t max,
13823     uint32_t* out_val) {
13824   ptr = _upb_Base92_DecodeVarint(ptr, d->end, first_ch, min, max, out_val);
13825   if (!ptr) upb_MdDecoder_ErrorJmp(d, "Overlong varint");
13826   return ptr;
13827 }
13828 
13829 
13830 #endif  // UPB_MINI_DESCRIPTOR_INTERNAL_DECODER_H_
13831 
13832 #ifndef UPB_MINI_DESCRIPTOR_INTERNAL_WIRE_CONSTANTS_H_
13833 #define UPB_MINI_DESCRIPTOR_INTERNAL_WIRE_CONSTANTS_H_
13834 
13835 
13836 // Must be last.
13837 
13838 typedef enum {
13839   kUpb_EncodedType_Double = 0,
13840   kUpb_EncodedType_Float = 1,
13841   kUpb_EncodedType_Fixed32 = 2,
13842   kUpb_EncodedType_Fixed64 = 3,
13843   kUpb_EncodedType_SFixed32 = 4,
13844   kUpb_EncodedType_SFixed64 = 5,
13845   kUpb_EncodedType_Int32 = 6,
13846   kUpb_EncodedType_UInt32 = 7,
13847   kUpb_EncodedType_SInt32 = 8,
13848   kUpb_EncodedType_Int64 = 9,
13849   kUpb_EncodedType_UInt64 = 10,
13850   kUpb_EncodedType_SInt64 = 11,
13851   kUpb_EncodedType_OpenEnum = 12,
13852   kUpb_EncodedType_Bool = 13,
13853   kUpb_EncodedType_Bytes = 14,
13854   kUpb_EncodedType_String = 15,
13855   kUpb_EncodedType_Group = 16,
13856   kUpb_EncodedType_Message = 17,
13857   kUpb_EncodedType_ClosedEnum = 18,
13858 
13859   kUpb_EncodedType_RepeatedBase = 20,
13860 } upb_EncodedType;
13861 
13862 typedef enum {
13863   kUpb_EncodedFieldModifier_FlipPacked = 1 << 0,
13864   kUpb_EncodedFieldModifier_IsRequired = 1 << 1,
13865   kUpb_EncodedFieldModifier_IsProto3Singular = 1 << 2,
13866   kUpb_EncodedFieldModifier_FlipValidateUtf8 = 1 << 3,
13867 } upb_EncodedFieldModifier;
13868 
13869 enum {
13870   kUpb_EncodedValue_MinField = ' ',
13871   kUpb_EncodedValue_MaxField = 'I',
13872   kUpb_EncodedValue_MinModifier = 'L',
13873   kUpb_EncodedValue_MaxModifier = '[',
13874   kUpb_EncodedValue_End = '^',
13875   kUpb_EncodedValue_MinSkip = '_',
13876   kUpb_EncodedValue_MaxSkip = '~',
13877   kUpb_EncodedValue_OneofSeparator = '~',
13878   kUpb_EncodedValue_FieldSeparator = '|',
13879   kUpb_EncodedValue_MinOneofField = ' ',
13880   kUpb_EncodedValue_MaxOneofField = 'b',
13881   kUpb_EncodedValue_MaxEnumMask = 'A',
13882 };
13883 
13884 enum {
13885   kUpb_EncodedVersion_EnumV1 = '!',
13886   kUpb_EncodedVersion_ExtensionV1 = '#',
13887   kUpb_EncodedVersion_MapV1 = '%',
13888   kUpb_EncodedVersion_MessageV1 = '$',
13889   kUpb_EncodedVersion_MessageSetV1 = '&',
13890 };
13891 
13892 
13893 #endif  // UPB_MINI_DESCRIPTOR_INTERNAL_WIRE_CONSTANTS_H_
13894 
13895 #ifndef UPB_MINI_DESCRIPTOR_INTERNAL_MODIFIERS_H_
13896 #define UPB_MINI_DESCRIPTOR_INTERNAL_MODIFIERS_H_
13897 
13898 // Must be last.
13899 
13900 typedef enum {
13901   kUpb_FieldModifier_IsRepeated = 1 << 0,
13902   kUpb_FieldModifier_IsPacked = 1 << 1,
13903   kUpb_FieldModifier_IsClosedEnum = 1 << 2,
13904   kUpb_FieldModifier_IsProto3Singular = 1 << 3,
13905   kUpb_FieldModifier_IsRequired = 1 << 4,
13906   kUpb_FieldModifier_ValidateUtf8 = 1 << 5,
13907 } kUpb_FieldModifier;
13908 
13909 // These modifiers are also used on the wire.
13910 typedef enum {
13911   kUpb_MessageModifier_ValidateUtf8 = 1 << 0,
13912   kUpb_MessageModifier_DefaultIsPacked = 1 << 1,
13913   kUpb_MessageModifier_IsExtendable = 1 << 2,
13914 } kUpb_MessageModifier;
13915 
13916 
13917 #endif  // UPB_MINI_DESCRIPTOR_INTERNAL_MODIFIERS_H_
13918 
13919 #ifndef UPB_MINI_TABLE_COMPAT_H_
13920 #define UPB_MINI_TABLE_COMPAT_H_
13921 
13922 
13923 // Must be last.
13924 
13925 // upb does not support mixing minitables from different sources but these
13926 // functions are still used by some existing users so for now we make them
13927 // available here. This may or may not change in the future so do not add
13928 // them to new code.
13929 
13930 #ifdef __cplusplus
13931 extern "C" {
13932 #endif
13933 
13934 // Checks if memory layout of src is compatible with dst.
13935 bool upb_MiniTable_Compatible(const upb_MiniTable* src,
13936                               const upb_MiniTable* dst);
13937 
13938 typedef enum {
13939   kUpb_MiniTableEquals_NotEqual,
13940   kUpb_MiniTableEquals_Equal,
13941   kUpb_MiniTableEquals_OutOfMemory,
13942 } upb_MiniTableEquals_Status;
13943 
13944 // Checks equality of mini tables originating from different language runtimes.
13945 upb_MiniTableEquals_Status upb_MiniTable_Equals(const upb_MiniTable* src,
13946                                                 const upb_MiniTable* dst);
13947 
13948 #ifdef __cplusplus
13949 } /* extern "C" */
13950 #endif
13951 
13952 
13953 #endif /* UPB_MINI_TABLE_COMPAT_H_ */
13954 
13955 #ifndef UPB_HASH_INT_TABLE_H_
13956 #define UPB_HASH_INT_TABLE_H_
13957 
13958 
13959 // Must be last.
13960 
13961 typedef struct {
13962   upb_table t;              // For entries that don't fit in the array part.
13963   const upb_tabval* array;  // Array part of the table. See const note above.
13964   size_t array_size;        // Array part size.
13965   size_t array_count;       // Array part number of elements.
13966 } upb_inttable;
13967 
13968 #ifdef __cplusplus
13969 extern "C" {
13970 #endif
13971 
13972 // Initialize a table. If memory allocation failed, false is returned and
13973 // the table is uninitialized.
13974 bool upb_inttable_init(upb_inttable* table, upb_Arena* a);
13975 
13976 // Returns the number of values in the table.
13977 size_t upb_inttable_count(const upb_inttable* t);
13978 
13979 // Inserts the given key into the hashtable with the given value.
13980 // The key must not already exist in the hash table.
13981 // The value must not be UINTPTR_MAX.
13982 //
13983 // If a table resize was required but memory allocation failed, false is
13984 // returned and the table is unchanged.
13985 bool upb_inttable_insert(upb_inttable* t, uintptr_t key, upb_value val,
13986                          upb_Arena* a);
13987 
13988 // Looks up key in this table, returning "true" if the key was found.
13989 // If v is non-NULL, copies the value for this key into *v.
13990 bool upb_inttable_lookup(const upb_inttable* t, uintptr_t key, upb_value* v);
13991 
13992 // Removes an item from the table. Returns true if the remove was successful,
13993 // and stores the removed item in *val if non-NULL.
13994 bool upb_inttable_remove(upb_inttable* t, uintptr_t key, upb_value* val);
13995 
13996 // Updates an existing entry in an inttable.
13997 // If the entry does not exist, returns false and does nothing.
13998 // Unlike insert/remove, this does not invalidate iterators.
13999 bool upb_inttable_replace(upb_inttable* t, uintptr_t key, upb_value val);
14000 
14001 // Optimizes the table for the current set of entries, for both memory use and
14002 // lookup time. Client should call this after all entries have been inserted;
14003 // inserting more entries is legal, but will likely require a table resize.
14004 void upb_inttable_compact(upb_inttable* t, upb_Arena* a);
14005 
14006 // Iteration over inttable:
14007 //
14008 //   intptr_t iter = UPB_INTTABLE_BEGIN;
14009 //   uintptr_t key;
14010 //   upb_value val;
14011 //   while (upb_inttable_next(t, &key, &val, &iter)) {
14012 //      // ...
14013 //   }
14014 
14015 #define UPB_INTTABLE_BEGIN -1
14016 
14017 bool upb_inttable_next(const upb_inttable* t, uintptr_t* key, upb_value* val,
14018                        intptr_t* iter);
14019 void upb_inttable_removeiter(upb_inttable* t, intptr_t* iter);
14020 
14021 #ifdef __cplusplus
14022 } /* extern "C" */
14023 #endif
14024 
14025 
14026 #endif /* UPB_HASH_INT_TABLE_H_ */
14027 
14028 #ifndef UPB_WIRE_INTERNAL_CONSTANTS_H_
14029 #define UPB_WIRE_INTERNAL_CONSTANTS_H_
14030 
14031 #define kUpb_WireFormat_DefaultDepthLimit 100
14032 
14033 // MessageSet wire format is:
14034 //   message MessageSet {
14035 //     repeated group Item = 1 {
14036 //       required int32 type_id = 2;
14037 //       required bytes message = 3;
14038 //     }
14039 //   }
14040 
14041 enum {
14042   kUpb_MsgSet_Item = 1,
14043   kUpb_MsgSet_TypeId = 2,
14044   kUpb_MsgSet_Message = 3,
14045 };
14046 
14047 #endif /* UPB_WIRE_INTERNAL_CONSTANTS_H_ */
14048 
14049 /*
14050  * Internal implementation details of the decoder that are shared between
14051  * decode.c and decode_fast.c.
14052  */
14053 
14054 #ifndef UPB_WIRE_INTERNAL_DECODER_H_
14055 #define UPB_WIRE_INTERNAL_DECODER_H_
14056 
14057 #include "utf8_range.h"
14058 
14059 // Must be last.
14060 
14061 #define DECODE_NOGROUP (uint32_t) - 1
14062 
14063 typedef struct upb_Decoder {
14064   upb_EpsCopyInputStream input;
14065   const upb_ExtensionRegistry* extreg;
14066   const char* unknown;       // Start of unknown data, preserve at buffer flip
14067   upb_Message* unknown_msg;  // Pointer to preserve data to
14068   int depth;                 // Tracks recursion depth to bound stack usage.
14069   uint32_t end_group;  // field number of END_GROUP tag, else DECODE_NOGROUP.
14070   uint16_t options;
14071   bool missing_required;
14072   union {
14073     upb_Arena arena;
14074     void* foo[UPB_ARENA_SIZE_HACK];
14075   };
14076   upb_DecodeStatus status;
14077   jmp_buf err;
14078 
14079 #ifndef NDEBUG
14080   const char* debug_tagstart;
14081   const char* debug_valstart;
14082 #endif
14083 } upb_Decoder;
14084 
14085 /* Error function that will abort decoding with longjmp(). We can't declare this
14086  * UPB_NORETURN, even though it is appropriate, because if we do then compilers
14087  * will "helpfully" refuse to tailcall to it
14088  * (see: https://stackoverflow.com/a/55657013), which will defeat a major goal
14089  * of our optimizations. That is also why we must declare it in a separate file,
14090  * otherwise the compiler will see that it calls longjmp() and deduce that it is
14091  * noreturn. */
14092 const char* _upb_FastDecoder_ErrorJmp(upb_Decoder* d, int status);
14093 
14094 extern const uint8_t upb_utf8_offsets[];
14095 
14096 UPB_INLINE
_upb_Decoder_VerifyUtf8Inline(const char * ptr,int len)14097 bool _upb_Decoder_VerifyUtf8Inline(const char* ptr, int len) {
14098   return utf8_range_IsValid(ptr, len);
14099 }
14100 
14101 const char* _upb_Decoder_CheckRequired(upb_Decoder* d, const char* ptr,
14102                                        const upb_Message* msg,
14103                                        const upb_MiniTable* m);
14104 
14105 /* x86-64 pointers always have the high 16 bits matching. So we can shift
14106  * left 8 and right 8 without loss of information. */
decode_totable(const upb_MiniTable * tablep)14107 UPB_INLINE intptr_t decode_totable(const upb_MiniTable* tablep) {
14108   return ((intptr_t)tablep << 8) | tablep->UPB_PRIVATE(table_mask);
14109 }
14110 
decode_totablep(intptr_t table)14111 UPB_INLINE const upb_MiniTable* decode_totablep(intptr_t table) {
14112   return (const upb_MiniTable*)(table >> 8);
14113 }
14114 
14115 const char* _upb_Decoder_IsDoneFallback(upb_EpsCopyInputStream* e,
14116                                         const char* ptr, int overrun);
14117 
_upb_Decoder_IsDone(upb_Decoder * d,const char ** ptr)14118 UPB_INLINE bool _upb_Decoder_IsDone(upb_Decoder* d, const char** ptr) {
14119   return upb_EpsCopyInputStream_IsDoneWithCallback(
14120       &d->input, ptr, &_upb_Decoder_IsDoneFallback);
14121 }
14122 
_upb_Decoder_BufferFlipCallback(upb_EpsCopyInputStream * e,const char * old_end,const char * new_start)14123 UPB_INLINE const char* _upb_Decoder_BufferFlipCallback(
14124     upb_EpsCopyInputStream* e, const char* old_end, const char* new_start) {
14125   upb_Decoder* d = (upb_Decoder*)e;
14126   if (!old_end) _upb_FastDecoder_ErrorJmp(d, kUpb_DecodeStatus_Malformed);
14127 
14128   if (d->unknown) {
14129     if (!UPB_PRIVATE(_upb_Message_AddUnknown)(
14130             d->unknown_msg, d->unknown, old_end - d->unknown, &d->arena)) {
14131       _upb_FastDecoder_ErrorJmp(d, kUpb_DecodeStatus_OutOfMemory);
14132     }
14133     d->unknown = new_start;
14134   }
14135   return new_start;
14136 }
14137 
14138 #if UPB_FASTTABLE
14139 UPB_INLINE
_upb_FastDecoder_TagDispatch(upb_Decoder * d,const char * ptr,upb_Message * msg,intptr_t table,uint64_t hasbits,uint64_t tag)14140 const char* _upb_FastDecoder_TagDispatch(upb_Decoder* d, const char* ptr,
14141                                          upb_Message* msg, intptr_t table,
14142                                          uint64_t hasbits, uint64_t tag) {
14143   const upb_MiniTable* table_p = decode_totablep(table);
14144   uint8_t mask = table;
14145   uint64_t data;
14146   size_t idx = tag & mask;
14147   UPB_ASSUME((idx & 7) == 0);
14148   idx >>= 3;
14149   data = table_p->UPB_PRIVATE(fasttable)[idx].field_data ^ tag;
14150   UPB_MUSTTAIL return table_p->UPB_PRIVATE(fasttable)[idx].field_parser(
14151       d, ptr, msg, table, hasbits, data);
14152 }
14153 #endif
14154 
_upb_FastDecoder_LoadTag(const char * ptr)14155 UPB_INLINE uint32_t _upb_FastDecoder_LoadTag(const char* ptr) {
14156   uint16_t tag;
14157   memcpy(&tag, ptr, 2);
14158   return tag;
14159 }
14160 
14161 
14162 #endif /* UPB_WIRE_INTERNAL_DECODER_H_ */
14163 
14164 #ifndef UPB_WIRE_READER_H_
14165 #define UPB_WIRE_READER_H_
14166 
14167 
14168 #ifndef UPB_WIRE_INTERNAL_READER_H_
14169 #define UPB_WIRE_INTERNAL_READER_H_
14170 
14171 // Must be last.
14172 
14173 #define kUpb_WireReader_WireTypeBits 3
14174 #define kUpb_WireReader_WireTypeMask 7
14175 
14176 typedef struct {
14177   const char* ptr;
14178   uint64_t val;
14179 } UPB_PRIVATE(_upb_WireReader_LongVarint);
14180 
14181 #ifdef __cplusplus
14182 extern "C" {
14183 #endif
14184 
14185 UPB_PRIVATE(_upb_WireReader_LongVarint)
14186 UPB_PRIVATE(_upb_WireReader_ReadLongVarint)(const char* ptr, uint64_t val);
14187 
UPB_PRIVATE(_upb_WireReader_ReadVarint)14188 UPB_FORCEINLINE const char* UPB_PRIVATE(_upb_WireReader_ReadVarint)(
14189     const char* ptr, uint64_t* val, int maxlen, uint64_t maxval) {
14190   uint64_t byte = (uint8_t)*ptr;
14191   if (UPB_LIKELY((byte & 0x80) == 0)) {
14192     *val = (uint32_t)byte;
14193     return ptr + 1;
14194   }
14195   const char* start = ptr;
14196   UPB_PRIVATE(_upb_WireReader_LongVarint)
14197   res = UPB_PRIVATE(_upb_WireReader_ReadLongVarint)(ptr, byte);
14198   if (!res.ptr || (maxlen < 10 && res.ptr - start > maxlen) ||
14199       res.val > maxval) {
14200     return NULL;  // Malformed.
14201   }
14202   *val = res.val;
14203   return res.ptr;
14204 }
14205 
upb_WireReader_GetFieldNumber(uint32_t tag)14206 UPB_API_INLINE uint32_t upb_WireReader_GetFieldNumber(uint32_t tag) {
14207   return tag >> kUpb_WireReader_WireTypeBits;
14208 }
14209 
upb_WireReader_GetWireType(uint32_t tag)14210 UPB_API_INLINE uint8_t upb_WireReader_GetWireType(uint32_t tag) {
14211   return tag & kUpb_WireReader_WireTypeMask;
14212 }
14213 
14214 #ifdef __cplusplus
14215 } /* extern "C" */
14216 #endif
14217 
14218 
14219 #endif  // UPB_WIRE_INTERNAL_READER_H_
14220 
14221 #ifndef UPB_WIRE_TYPES_H_
14222 #define UPB_WIRE_TYPES_H_
14223 
14224 // A list of types as they are encoded on the wire.
14225 typedef enum {
14226   kUpb_WireType_Varint = 0,
14227   kUpb_WireType_64Bit = 1,
14228   kUpb_WireType_Delimited = 2,
14229   kUpb_WireType_StartGroup = 3,
14230   kUpb_WireType_EndGroup = 4,
14231   kUpb_WireType_32Bit = 5
14232 } upb_WireType;
14233 
14234 #endif /* UPB_WIRE_TYPES_H_ */
14235 
14236 // Must be last.
14237 
14238 // The upb_WireReader interface is suitable for general-purpose parsing of
14239 // protobuf binary wire format. It is designed to be used along with
14240 // upb_EpsCopyInputStream for buffering, and all parsing routines in this file
14241 // assume that at least kUpb_EpsCopyInputStream_SlopBytes worth of data is
14242 // available to read without any bounds checks.
14243 
14244 #ifdef __cplusplus
14245 extern "C" {
14246 #endif
14247 
14248 // Parses a tag into `tag`, and returns a pointer past the end of the tag, or
14249 // NULL if there was an error in the tag data.
14250 //
14251 // REQUIRES: there must be at least 10 bytes of data available at `ptr`.
14252 // Bounds checks must be performed before calling this function, preferably
14253 // by calling upb_EpsCopyInputStream_IsDone().
upb_WireReader_ReadTag(const char * ptr,uint32_t * tag)14254 UPB_FORCEINLINE const char* upb_WireReader_ReadTag(const char* ptr,
14255                                                    uint32_t* tag) {
14256   uint64_t val;
14257   ptr = UPB_PRIVATE(_upb_WireReader_ReadVarint)(ptr, &val, 5, UINT32_MAX);
14258   if (!ptr) return NULL;
14259   *tag = val;
14260   return ptr;
14261 }
14262 
14263 // Given a tag, returns the field number.
14264 UPB_API_INLINE uint32_t upb_WireReader_GetFieldNumber(uint32_t tag);
14265 
14266 // Given a tag, returns the wire type.
14267 UPB_API_INLINE uint8_t upb_WireReader_GetWireType(uint32_t tag);
14268 
upb_WireReader_ReadVarint(const char * ptr,uint64_t * val)14269 UPB_INLINE const char* upb_WireReader_ReadVarint(const char* ptr,
14270                                                  uint64_t* val) {
14271   return UPB_PRIVATE(_upb_WireReader_ReadVarint)(ptr, val, 10, UINT64_MAX);
14272 }
14273 
14274 // Skips data for a varint, returning a pointer past the end of the varint, or
14275 // NULL if there was an error in the varint data.
14276 //
14277 // REQUIRES: there must be at least 10 bytes of data available at `ptr`.
14278 // Bounds checks must be performed before calling this function, preferably
14279 // by calling upb_EpsCopyInputStream_IsDone().
upb_WireReader_SkipVarint(const char * ptr)14280 UPB_INLINE const char* upb_WireReader_SkipVarint(const char* ptr) {
14281   uint64_t val;
14282   return upb_WireReader_ReadVarint(ptr, &val);
14283 }
14284 
14285 // Reads a varint indicating the size of a delimited field into `size`, or
14286 // NULL if there was an error in the varint data.
14287 //
14288 // REQUIRES: there must be at least 10 bytes of data available at `ptr`.
14289 // Bounds checks must be performed before calling this function, preferably
14290 // by calling upb_EpsCopyInputStream_IsDone().
upb_WireReader_ReadSize(const char * ptr,int * size)14291 UPB_INLINE const char* upb_WireReader_ReadSize(const char* ptr, int* size) {
14292   uint64_t size64;
14293   ptr = upb_WireReader_ReadVarint(ptr, &size64);
14294   if (!ptr || size64 >= INT32_MAX) return NULL;
14295   *size = size64;
14296   return ptr;
14297 }
14298 
14299 // Reads a fixed32 field, performing byte swapping if necessary.
14300 //
14301 // REQUIRES: there must be at least 4 bytes of data available at `ptr`.
14302 // Bounds checks must be performed before calling this function, preferably
14303 // by calling upb_EpsCopyInputStream_IsDone().
upb_WireReader_ReadFixed32(const char * ptr,void * val)14304 UPB_INLINE const char* upb_WireReader_ReadFixed32(const char* ptr, void* val) {
14305   uint32_t uval;
14306   memcpy(&uval, ptr, 4);
14307   uval = upb_BigEndian32(uval);
14308   memcpy(val, &uval, 4);
14309   return ptr + 4;
14310 }
14311 
14312 // Reads a fixed64 field, performing byte swapping if necessary.
14313 //
14314 // REQUIRES: there must be at least 4 bytes of data available at `ptr`.
14315 // Bounds checks must be performed before calling this function, preferably
14316 // by calling upb_EpsCopyInputStream_IsDone().
upb_WireReader_ReadFixed64(const char * ptr,void * val)14317 UPB_INLINE const char* upb_WireReader_ReadFixed64(const char* ptr, void* val) {
14318   uint64_t uval;
14319   memcpy(&uval, ptr, 8);
14320   uval = upb_BigEndian64(uval);
14321   memcpy(val, &uval, 8);
14322   return ptr + 8;
14323 }
14324 
14325 const char* UPB_PRIVATE(_upb_WireReader_SkipGroup)(
14326     const char* ptr, uint32_t tag, int depth_limit,
14327     upb_EpsCopyInputStream* stream);
14328 
14329 // Skips data for a group, returning a pointer past the end of the group, or
14330 // NULL if there was an error parsing the group.  The `tag` argument should be
14331 // the start group tag that begins the group.  The `depth_limit` argument
14332 // indicates how many levels of recursion the group is allowed to have before
14333 // reporting a parse error (this limit exists to protect against stack
14334 // overflow).
14335 //
14336 // TODO: evaluate how the depth_limit should be specified. Do users need
14337 // control over this?
upb_WireReader_SkipGroup(const char * ptr,uint32_t tag,upb_EpsCopyInputStream * stream)14338 UPB_INLINE const char* upb_WireReader_SkipGroup(
14339     const char* ptr, uint32_t tag, upb_EpsCopyInputStream* stream) {
14340   return UPB_PRIVATE(_upb_WireReader_SkipGroup)(ptr, tag, 100, stream);
14341 }
14342 
_upb_WireReader_SkipValue(const char * ptr,uint32_t tag,int depth_limit,upb_EpsCopyInputStream * stream)14343 UPB_INLINE const char* _upb_WireReader_SkipValue(
14344     const char* ptr, uint32_t tag, int depth_limit,
14345     upb_EpsCopyInputStream* stream) {
14346   switch (upb_WireReader_GetWireType(tag)) {
14347     case kUpb_WireType_Varint:
14348       return upb_WireReader_SkipVarint(ptr);
14349     case kUpb_WireType_32Bit:
14350       return ptr + 4;
14351     case kUpb_WireType_64Bit:
14352       return ptr + 8;
14353     case kUpb_WireType_Delimited: {
14354       int size;
14355       ptr = upb_WireReader_ReadSize(ptr, &size);
14356       if (!ptr) return NULL;
14357       ptr += size;
14358       return ptr;
14359     }
14360     case kUpb_WireType_StartGroup:
14361       return UPB_PRIVATE(_upb_WireReader_SkipGroup)(ptr, tag, depth_limit,
14362                                                     stream);
14363     case kUpb_WireType_EndGroup:
14364       return NULL;  // Should be handled before now.
14365     default:
14366       return NULL;  // Unknown wire type.
14367   }
14368 }
14369 
14370 // Skips data for a wire value of any type, returning a pointer past the end of
14371 // the data, or NULL if there was an error parsing the group. The `tag` argument
14372 // should be the tag that was just parsed. The `depth_limit` argument indicates
14373 // how many levels of recursion a group is allowed to have before reporting a
14374 // parse error (this limit exists to protect against stack overflow).
14375 //
14376 // REQUIRES: there must be at least 10 bytes of data available at `ptr`.
14377 // Bounds checks must be performed before calling this function, preferably
14378 // by calling upb_EpsCopyInputStream_IsDone().
14379 //
14380 // TODO: evaluate how the depth_limit should be specified. Do users need
14381 // control over this?
upb_WireReader_SkipValue(const char * ptr,uint32_t tag,upb_EpsCopyInputStream * stream)14382 UPB_INLINE const char* upb_WireReader_SkipValue(
14383     const char* ptr, uint32_t tag, upb_EpsCopyInputStream* stream) {
14384   return _upb_WireReader_SkipValue(ptr, tag, 100, stream);
14385 }
14386 
14387 #ifdef __cplusplus
14388 } /* extern "C" */
14389 #endif
14390 
14391 
14392 #endif  // UPB_WIRE_READER_H_
14393 /* This file was generated by upb_generator from the input file:
14394  *
14395  *     google/protobuf/descriptor.proto
14396  *
14397  * Do not edit -- your changes will be discarded when the file is
14398  * regenerated.
14399  * NO CHECKED-IN PROTOBUF GENCODE */
14400 
14401 #ifndef GOOGLE_PROTOBUF_DESCRIPTOR_PROTO_UPB_H__UPBDEFS_H_
14402 #define GOOGLE_PROTOBUF_DESCRIPTOR_PROTO_UPB_H__UPBDEFS_H_
14403 
14404 
14405 #ifndef UPB_REFLECTION_DEF_POOL_INTERNAL_H_
14406 #define UPB_REFLECTION_DEF_POOL_INTERNAL_H_
14407 
14408 
14409 // Must be last.
14410 
14411 #ifdef __cplusplus
14412 extern "C" {
14413 #endif
14414 
14415 upb_Arena* _upb_DefPool_Arena(const upb_DefPool* s);
14416 size_t _upb_DefPool_BytesLoaded(const upb_DefPool* s);
14417 upb_ExtensionRegistry* _upb_DefPool_ExtReg(const upb_DefPool* s);
14418 
14419 bool _upb_DefPool_InsertExt(upb_DefPool* s, const upb_MiniTableExtension* ext,
14420                             const upb_FieldDef* f);
14421 bool _upb_DefPool_InsertSym(upb_DefPool* s, upb_StringView sym, upb_value v,
14422                             upb_Status* status);
14423 bool _upb_DefPool_LookupSym(const upb_DefPool* s, const char* sym, size_t size,
14424                             upb_value* v);
14425 
14426 void** _upb_DefPool_ScratchData(const upb_DefPool* s);
14427 size_t* _upb_DefPool_ScratchSize(const upb_DefPool* s);
14428 void _upb_DefPool_SetPlatform(upb_DefPool* s, upb_MiniTablePlatform platform);
14429 
14430 // For generated code only: loads a generated descriptor.
14431 typedef struct _upb_DefPool_Init {
14432   struct _upb_DefPool_Init** deps;  // Dependencies of this file.
14433   const upb_MiniTableFile* layout;
14434   const char* filename;
14435   upb_StringView descriptor;  // Serialized descriptor.
14436 } _upb_DefPool_Init;
14437 
14438 bool _upb_DefPool_LoadDefInit(upb_DefPool* s, const _upb_DefPool_Init* init);
14439 
14440 // Should only be directly called by tests. This variant lets us suppress
14441 // the use of compiled-in tables, forcing a rebuild of the tables at runtime.
14442 bool _upb_DefPool_LoadDefInitEx(upb_DefPool* s, const _upb_DefPool_Init* init,
14443                                 bool rebuild_minitable);
14444 
14445 #ifdef __cplusplus
14446 } /* extern "C" */
14447 #endif
14448 
14449 
14450 #endif /* UPB_REFLECTION_DEF_POOL_INTERNAL_H_ */
14451 
14452 #ifdef __cplusplus
14453 extern "C" {
14454 #endif
14455 
14456 extern _upb_DefPool_Init google_protobuf_descriptor_proto_upbdefinit;
14457 
google_protobuf_FileDescriptorSet_getmsgdef(upb_DefPool * s)14458 UPB_INLINE const upb_MessageDef *google_protobuf_FileDescriptorSet_getmsgdef(upb_DefPool *s) {
14459   _upb_DefPool_LoadDefInit(s, &google_protobuf_descriptor_proto_upbdefinit);
14460   return upb_DefPool_FindMessageByName(s, "google.protobuf.FileDescriptorSet");
14461 }
14462 
google_protobuf_FileDescriptorProto_getmsgdef(upb_DefPool * s)14463 UPB_INLINE const upb_MessageDef *google_protobuf_FileDescriptorProto_getmsgdef(upb_DefPool *s) {
14464   _upb_DefPool_LoadDefInit(s, &google_protobuf_descriptor_proto_upbdefinit);
14465   return upb_DefPool_FindMessageByName(s, "google.protobuf.FileDescriptorProto");
14466 }
14467 
google_protobuf_DescriptorProto_getmsgdef(upb_DefPool * s)14468 UPB_INLINE const upb_MessageDef *google_protobuf_DescriptorProto_getmsgdef(upb_DefPool *s) {
14469   _upb_DefPool_LoadDefInit(s, &google_protobuf_descriptor_proto_upbdefinit);
14470   return upb_DefPool_FindMessageByName(s, "google.protobuf.DescriptorProto");
14471 }
14472 
google_protobuf_DescriptorProto_ExtensionRange_getmsgdef(upb_DefPool * s)14473 UPB_INLINE const upb_MessageDef *google_protobuf_DescriptorProto_ExtensionRange_getmsgdef(upb_DefPool *s) {
14474   _upb_DefPool_LoadDefInit(s, &google_protobuf_descriptor_proto_upbdefinit);
14475   return upb_DefPool_FindMessageByName(s, "google.protobuf.DescriptorProto.ExtensionRange");
14476 }
14477 
google_protobuf_DescriptorProto_ReservedRange_getmsgdef(upb_DefPool * s)14478 UPB_INLINE const upb_MessageDef *google_protobuf_DescriptorProto_ReservedRange_getmsgdef(upb_DefPool *s) {
14479   _upb_DefPool_LoadDefInit(s, &google_protobuf_descriptor_proto_upbdefinit);
14480   return upb_DefPool_FindMessageByName(s, "google.protobuf.DescriptorProto.ReservedRange");
14481 }
14482 
google_protobuf_ExtensionRangeOptions_getmsgdef(upb_DefPool * s)14483 UPB_INLINE const upb_MessageDef *google_protobuf_ExtensionRangeOptions_getmsgdef(upb_DefPool *s) {
14484   _upb_DefPool_LoadDefInit(s, &google_protobuf_descriptor_proto_upbdefinit);
14485   return upb_DefPool_FindMessageByName(s, "google.protobuf.ExtensionRangeOptions");
14486 }
14487 
google_protobuf_ExtensionRangeOptions_Declaration_getmsgdef(upb_DefPool * s)14488 UPB_INLINE const upb_MessageDef *google_protobuf_ExtensionRangeOptions_Declaration_getmsgdef(upb_DefPool *s) {
14489   _upb_DefPool_LoadDefInit(s, &google_protobuf_descriptor_proto_upbdefinit);
14490   return upb_DefPool_FindMessageByName(s, "google.protobuf.ExtensionRangeOptions.Declaration");
14491 }
14492 
google_protobuf_FieldDescriptorProto_getmsgdef(upb_DefPool * s)14493 UPB_INLINE const upb_MessageDef *google_protobuf_FieldDescriptorProto_getmsgdef(upb_DefPool *s) {
14494   _upb_DefPool_LoadDefInit(s, &google_protobuf_descriptor_proto_upbdefinit);
14495   return upb_DefPool_FindMessageByName(s, "google.protobuf.FieldDescriptorProto");
14496 }
14497 
google_protobuf_OneofDescriptorProto_getmsgdef(upb_DefPool * s)14498 UPB_INLINE const upb_MessageDef *google_protobuf_OneofDescriptorProto_getmsgdef(upb_DefPool *s) {
14499   _upb_DefPool_LoadDefInit(s, &google_protobuf_descriptor_proto_upbdefinit);
14500   return upb_DefPool_FindMessageByName(s, "google.protobuf.OneofDescriptorProto");
14501 }
14502 
google_protobuf_EnumDescriptorProto_getmsgdef(upb_DefPool * s)14503 UPB_INLINE const upb_MessageDef *google_protobuf_EnumDescriptorProto_getmsgdef(upb_DefPool *s) {
14504   _upb_DefPool_LoadDefInit(s, &google_protobuf_descriptor_proto_upbdefinit);
14505   return upb_DefPool_FindMessageByName(s, "google.protobuf.EnumDescriptorProto");
14506 }
14507 
google_protobuf_EnumDescriptorProto_EnumReservedRange_getmsgdef(upb_DefPool * s)14508 UPB_INLINE const upb_MessageDef *google_protobuf_EnumDescriptorProto_EnumReservedRange_getmsgdef(upb_DefPool *s) {
14509   _upb_DefPool_LoadDefInit(s, &google_protobuf_descriptor_proto_upbdefinit);
14510   return upb_DefPool_FindMessageByName(s, "google.protobuf.EnumDescriptorProto.EnumReservedRange");
14511 }
14512 
google_protobuf_EnumValueDescriptorProto_getmsgdef(upb_DefPool * s)14513 UPB_INLINE const upb_MessageDef *google_protobuf_EnumValueDescriptorProto_getmsgdef(upb_DefPool *s) {
14514   _upb_DefPool_LoadDefInit(s, &google_protobuf_descriptor_proto_upbdefinit);
14515   return upb_DefPool_FindMessageByName(s, "google.protobuf.EnumValueDescriptorProto");
14516 }
14517 
google_protobuf_ServiceDescriptorProto_getmsgdef(upb_DefPool * s)14518 UPB_INLINE const upb_MessageDef *google_protobuf_ServiceDescriptorProto_getmsgdef(upb_DefPool *s) {
14519   _upb_DefPool_LoadDefInit(s, &google_protobuf_descriptor_proto_upbdefinit);
14520   return upb_DefPool_FindMessageByName(s, "google.protobuf.ServiceDescriptorProto");
14521 }
14522 
google_protobuf_MethodDescriptorProto_getmsgdef(upb_DefPool * s)14523 UPB_INLINE const upb_MessageDef *google_protobuf_MethodDescriptorProto_getmsgdef(upb_DefPool *s) {
14524   _upb_DefPool_LoadDefInit(s, &google_protobuf_descriptor_proto_upbdefinit);
14525   return upb_DefPool_FindMessageByName(s, "google.protobuf.MethodDescriptorProto");
14526 }
14527 
google_protobuf_FileOptions_getmsgdef(upb_DefPool * s)14528 UPB_INLINE const upb_MessageDef *google_protobuf_FileOptions_getmsgdef(upb_DefPool *s) {
14529   _upb_DefPool_LoadDefInit(s, &google_protobuf_descriptor_proto_upbdefinit);
14530   return upb_DefPool_FindMessageByName(s, "google.protobuf.FileOptions");
14531 }
14532 
google_protobuf_MessageOptions_getmsgdef(upb_DefPool * s)14533 UPB_INLINE const upb_MessageDef *google_protobuf_MessageOptions_getmsgdef(upb_DefPool *s) {
14534   _upb_DefPool_LoadDefInit(s, &google_protobuf_descriptor_proto_upbdefinit);
14535   return upb_DefPool_FindMessageByName(s, "google.protobuf.MessageOptions");
14536 }
14537 
google_protobuf_FieldOptions_getmsgdef(upb_DefPool * s)14538 UPB_INLINE const upb_MessageDef *google_protobuf_FieldOptions_getmsgdef(upb_DefPool *s) {
14539   _upb_DefPool_LoadDefInit(s, &google_protobuf_descriptor_proto_upbdefinit);
14540   return upb_DefPool_FindMessageByName(s, "google.protobuf.FieldOptions");
14541 }
14542 
google_protobuf_FieldOptions_EditionDefault_getmsgdef(upb_DefPool * s)14543 UPB_INLINE const upb_MessageDef *google_protobuf_FieldOptions_EditionDefault_getmsgdef(upb_DefPool *s) {
14544   _upb_DefPool_LoadDefInit(s, &google_protobuf_descriptor_proto_upbdefinit);
14545   return upb_DefPool_FindMessageByName(s, "google.protobuf.FieldOptions.EditionDefault");
14546 }
14547 
google_protobuf_FieldOptions_FeatureSupport_getmsgdef(upb_DefPool * s)14548 UPB_INLINE const upb_MessageDef *google_protobuf_FieldOptions_FeatureSupport_getmsgdef(upb_DefPool *s) {
14549   _upb_DefPool_LoadDefInit(s, &google_protobuf_descriptor_proto_upbdefinit);
14550   return upb_DefPool_FindMessageByName(s, "google.protobuf.FieldOptions.FeatureSupport");
14551 }
14552 
google_protobuf_OneofOptions_getmsgdef(upb_DefPool * s)14553 UPB_INLINE const upb_MessageDef *google_protobuf_OneofOptions_getmsgdef(upb_DefPool *s) {
14554   _upb_DefPool_LoadDefInit(s, &google_protobuf_descriptor_proto_upbdefinit);
14555   return upb_DefPool_FindMessageByName(s, "google.protobuf.OneofOptions");
14556 }
14557 
google_protobuf_EnumOptions_getmsgdef(upb_DefPool * s)14558 UPB_INLINE const upb_MessageDef *google_protobuf_EnumOptions_getmsgdef(upb_DefPool *s) {
14559   _upb_DefPool_LoadDefInit(s, &google_protobuf_descriptor_proto_upbdefinit);
14560   return upb_DefPool_FindMessageByName(s, "google.protobuf.EnumOptions");
14561 }
14562 
google_protobuf_EnumValueOptions_getmsgdef(upb_DefPool * s)14563 UPB_INLINE const upb_MessageDef *google_protobuf_EnumValueOptions_getmsgdef(upb_DefPool *s) {
14564   _upb_DefPool_LoadDefInit(s, &google_protobuf_descriptor_proto_upbdefinit);
14565   return upb_DefPool_FindMessageByName(s, "google.protobuf.EnumValueOptions");
14566 }
14567 
google_protobuf_ServiceOptions_getmsgdef(upb_DefPool * s)14568 UPB_INLINE const upb_MessageDef *google_protobuf_ServiceOptions_getmsgdef(upb_DefPool *s) {
14569   _upb_DefPool_LoadDefInit(s, &google_protobuf_descriptor_proto_upbdefinit);
14570   return upb_DefPool_FindMessageByName(s, "google.protobuf.ServiceOptions");
14571 }
14572 
google_protobuf_MethodOptions_getmsgdef(upb_DefPool * s)14573 UPB_INLINE const upb_MessageDef *google_protobuf_MethodOptions_getmsgdef(upb_DefPool *s) {
14574   _upb_DefPool_LoadDefInit(s, &google_protobuf_descriptor_proto_upbdefinit);
14575   return upb_DefPool_FindMessageByName(s, "google.protobuf.MethodOptions");
14576 }
14577 
google_protobuf_UninterpretedOption_getmsgdef(upb_DefPool * s)14578 UPB_INLINE const upb_MessageDef *google_protobuf_UninterpretedOption_getmsgdef(upb_DefPool *s) {
14579   _upb_DefPool_LoadDefInit(s, &google_protobuf_descriptor_proto_upbdefinit);
14580   return upb_DefPool_FindMessageByName(s, "google.protobuf.UninterpretedOption");
14581 }
14582 
google_protobuf_UninterpretedOption_NamePart_getmsgdef(upb_DefPool * s)14583 UPB_INLINE const upb_MessageDef *google_protobuf_UninterpretedOption_NamePart_getmsgdef(upb_DefPool *s) {
14584   _upb_DefPool_LoadDefInit(s, &google_protobuf_descriptor_proto_upbdefinit);
14585   return upb_DefPool_FindMessageByName(s, "google.protobuf.UninterpretedOption.NamePart");
14586 }
14587 
google_protobuf_FeatureSet_getmsgdef(upb_DefPool * s)14588 UPB_INLINE const upb_MessageDef *google_protobuf_FeatureSet_getmsgdef(upb_DefPool *s) {
14589   _upb_DefPool_LoadDefInit(s, &google_protobuf_descriptor_proto_upbdefinit);
14590   return upb_DefPool_FindMessageByName(s, "google.protobuf.FeatureSet");
14591 }
14592 
google_protobuf_FeatureSetDefaults_getmsgdef(upb_DefPool * s)14593 UPB_INLINE const upb_MessageDef *google_protobuf_FeatureSetDefaults_getmsgdef(upb_DefPool *s) {
14594   _upb_DefPool_LoadDefInit(s, &google_protobuf_descriptor_proto_upbdefinit);
14595   return upb_DefPool_FindMessageByName(s, "google.protobuf.FeatureSetDefaults");
14596 }
14597 
google_protobuf_FeatureSetDefaults_FeatureSetEditionDefault_getmsgdef(upb_DefPool * s)14598 UPB_INLINE const upb_MessageDef *google_protobuf_FeatureSetDefaults_FeatureSetEditionDefault_getmsgdef(upb_DefPool *s) {
14599   _upb_DefPool_LoadDefInit(s, &google_protobuf_descriptor_proto_upbdefinit);
14600   return upb_DefPool_FindMessageByName(s, "google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault");
14601 }
14602 
google_protobuf_SourceCodeInfo_getmsgdef(upb_DefPool * s)14603 UPB_INLINE const upb_MessageDef *google_protobuf_SourceCodeInfo_getmsgdef(upb_DefPool *s) {
14604   _upb_DefPool_LoadDefInit(s, &google_protobuf_descriptor_proto_upbdefinit);
14605   return upb_DefPool_FindMessageByName(s, "google.protobuf.SourceCodeInfo");
14606 }
14607 
google_protobuf_SourceCodeInfo_Location_getmsgdef(upb_DefPool * s)14608 UPB_INLINE const upb_MessageDef *google_protobuf_SourceCodeInfo_Location_getmsgdef(upb_DefPool *s) {
14609   _upb_DefPool_LoadDefInit(s, &google_protobuf_descriptor_proto_upbdefinit);
14610   return upb_DefPool_FindMessageByName(s, "google.protobuf.SourceCodeInfo.Location");
14611 }
14612 
google_protobuf_GeneratedCodeInfo_getmsgdef(upb_DefPool * s)14613 UPB_INLINE const upb_MessageDef *google_protobuf_GeneratedCodeInfo_getmsgdef(upb_DefPool *s) {
14614   _upb_DefPool_LoadDefInit(s, &google_protobuf_descriptor_proto_upbdefinit);
14615   return upb_DefPool_FindMessageByName(s, "google.protobuf.GeneratedCodeInfo");
14616 }
14617 
google_protobuf_GeneratedCodeInfo_Annotation_getmsgdef(upb_DefPool * s)14618 UPB_INLINE const upb_MessageDef *google_protobuf_GeneratedCodeInfo_Annotation_getmsgdef(upb_DefPool *s) {
14619   _upb_DefPool_LoadDefInit(s, &google_protobuf_descriptor_proto_upbdefinit);
14620   return upb_DefPool_FindMessageByName(s, "google.protobuf.GeneratedCodeInfo.Annotation");
14621 }
14622 
14623 #ifdef __cplusplus
14624 }  /* extern "C" */
14625 #endif
14626 
14627 
14628 #endif  /* GOOGLE_PROTOBUF_DESCRIPTOR_PROTO_UPB_H__UPBDEFS_H_ */
14629 
14630 #ifndef UPB_LEX_STRTOD_H_
14631 #define UPB_LEX_STRTOD_H_
14632 
14633 // Must be last.
14634 
14635 #ifdef __cplusplus
14636 extern "C" {
14637 #endif
14638 
14639 double _upb_NoLocaleStrtod(const char *str, char **endptr);
14640 
14641 #ifdef __cplusplus
14642 } /* extern "C" */
14643 #endif
14644 
14645 
14646 #endif /* UPB_LEX_STRTOD_H_ */
14647 
14648 #ifndef UPB_MINI_DESCRIPTOR_INTERNAL_ENCODE_H_
14649 #define UPB_MINI_DESCRIPTOR_INTERNAL_ENCODE_H_
14650 
14651 #include <stdint.h>
14652 
14653 
14654 // Must be last.
14655 
14656 // If the input buffer has at least this many bytes available, the encoder call
14657 // is guaranteed to succeed (as long as field number order is maintained).
14658 #define kUpb_MtDataEncoder_MinSize 16
14659 
14660 typedef struct {
14661   char* end;  // Limit of the buffer passed as a parameter.
14662   // Aliased to internal-only members in .cc.
14663   char internal[32];
14664 } upb_MtDataEncoder;
14665 
14666 #ifdef __cplusplus
14667 extern "C" {
14668 #endif
14669 
14670 // Encodes field/oneof information for a given message.  The sequence of calls
14671 // should look like:
14672 //
14673 //   upb_MtDataEncoder e;
14674 //   char buf[256];
14675 //   char* ptr = buf;
14676 //   e.end = ptr + sizeof(buf);
14677 //   unit64_t msg_mod = ...; // bitwise & of kUpb_MessageModifiers or zero
14678 //   ptr = upb_MtDataEncoder_StartMessage(&e, ptr, msg_mod);
14679 //   // Fields *must* be in field number order.
14680 //   ptr = upb_MtDataEncoder_PutField(&e, ptr, ...);
14681 //   ptr = upb_MtDataEncoder_PutField(&e, ptr, ...);
14682 //   ptr = upb_MtDataEncoder_PutField(&e, ptr, ...);
14683 //
14684 //   // If oneofs are present.  Oneofs must be encoded after regular fields.
14685 //   ptr = upb_MiniTable_StartOneof(&e, ptr)
14686 //   ptr = upb_MiniTable_PutOneofField(&e, ptr, ...);
14687 //   ptr = upb_MiniTable_PutOneofField(&e, ptr, ...);
14688 //
14689 //   ptr = upb_MiniTable_StartOneof(&e, ptr);
14690 //   ptr = upb_MiniTable_PutOneofField(&e, ptr, ...);
14691 //   ptr = upb_MiniTable_PutOneofField(&e, ptr, ...);
14692 //
14693 // Oneofs must be encoded after all regular fields.
14694 char* upb_MtDataEncoder_StartMessage(upb_MtDataEncoder* e, char* ptr,
14695                                      uint64_t msg_mod);
14696 char* upb_MtDataEncoder_PutField(upb_MtDataEncoder* e, char* ptr,
14697                                  upb_FieldType type, uint32_t field_num,
14698                                  uint64_t field_mod);
14699 char* upb_MtDataEncoder_StartOneof(upb_MtDataEncoder* e, char* ptr);
14700 char* upb_MtDataEncoder_PutOneofField(upb_MtDataEncoder* e, char* ptr,
14701                                       uint32_t field_num);
14702 
14703 // Encodes the set of values for a given enum. The values must be given in
14704 // order (after casting to uint32_t), and repeats are not allowed.
14705 char* upb_MtDataEncoder_StartEnum(upb_MtDataEncoder* e, char* ptr);
14706 char* upb_MtDataEncoder_PutEnumValue(upb_MtDataEncoder* e, char* ptr,
14707                                      uint32_t val);
14708 char* upb_MtDataEncoder_EndEnum(upb_MtDataEncoder* e, char* ptr);
14709 
14710 // Encodes an entire mini descriptor for an extension.
14711 char* upb_MtDataEncoder_EncodeExtension(upb_MtDataEncoder* e, char* ptr,
14712                                         upb_FieldType type, uint32_t field_num,
14713                                         uint64_t field_mod);
14714 
14715 // Encodes an entire mini descriptor for a map.
14716 char* upb_MtDataEncoder_EncodeMap(upb_MtDataEncoder* e, char* ptr,
14717                                   upb_FieldType key_type,
14718                                   upb_FieldType value_type, uint64_t key_mod,
14719                                   uint64_t value_mod);
14720 
14721 // Encodes an entire mini descriptor for a message set.
14722 char* upb_MtDataEncoder_EncodeMessageSet(upb_MtDataEncoder* e, char* ptr);
14723 
14724 #ifdef __cplusplus
14725 } /* extern "C" */
14726 #endif
14727 
14728 
14729 #endif /* UPB_MINI_DESCRIPTOR_INTERNAL_ENCODE_H_ */
14730 
14731 #ifndef UPB_REFLECTION_DEF_BUILDER_INTERNAL_H_
14732 #define UPB_REFLECTION_DEF_BUILDER_INTERNAL_H_
14733 
14734 
14735 // Must be last.
14736 
14737 // We want to copy the options verbatim into the destination options proto.
14738 // We use serialize+parse as our deep copy.
14739 #define UPB_DEF_SET_OPTIONS(target, desc_type, options_type, proto)           \
14740   if (UPB_DESC(desc_type##_has_options)(proto)) {                             \
14741     size_t size;                                                              \
14742     char* pb = UPB_DESC(options_type##_serialize)(                            \
14743         UPB_DESC(desc_type##_options)(proto), ctx->tmp_arena, &size);         \
14744     if (!pb) _upb_DefBuilder_OomErr(ctx);                                     \
14745     target =                                                                  \
14746         UPB_DESC(options_type##_parse)(pb, size, _upb_DefBuilder_Arena(ctx)); \
14747     if (!target) _upb_DefBuilder_OomErr(ctx);                                 \
14748   } else {                                                                    \
14749     target = (const UPB_DESC(options_type)*)kUpbDefOptDefault;                \
14750   }
14751 
14752 #ifdef __cplusplus
14753 extern "C" {
14754 #endif
14755 
14756 struct upb_DefBuilder {
14757   upb_DefPool* symtab;
14758   upb_strtable feature_cache;             // Caches features by identity.
14759   UPB_DESC(FeatureSet*) legacy_features;  // For computing legacy features.
14760   char* tmp_buf;                          // Temporary buffer in tmp_arena.
14761   size_t tmp_buf_size;                    // Size of temporary buffer.
14762   upb_FileDef* file;                 // File we are building.
14763   upb_Arena* arena;                  // Allocate defs here.
14764   upb_Arena* tmp_arena;              // For temporary allocations.
14765   upb_Status* status;                // Record errors here.
14766   const upb_MiniTableFile* layout;   // NULL if we should build layouts.
14767   upb_MiniTablePlatform platform;    // Platform we are targeting.
14768   int enum_count;                    // Count of enums built so far.
14769   int msg_count;                     // Count of messages built so far.
14770   int ext_count;                     // Count of extensions built so far.
14771   jmp_buf err;                       // longjmp() on error.
14772 };
14773 
14774 extern const char* kUpbDefOptDefault;
14775 
14776 // ctx->status has already been set elsewhere so just fail/longjmp()
14777 UPB_NORETURN void _upb_DefBuilder_FailJmp(upb_DefBuilder* ctx);
14778 
14779 UPB_NORETURN void _upb_DefBuilder_Errf(upb_DefBuilder* ctx, const char* fmt,
14780                                        ...) UPB_PRINTF(2, 3);
14781 UPB_NORETURN void _upb_DefBuilder_OomErr(upb_DefBuilder* ctx);
14782 
14783 const char* _upb_DefBuilder_MakeFullName(upb_DefBuilder* ctx,
14784                                          const char* prefix,
14785                                          upb_StringView name);
14786 
14787 // Given a symbol and the base symbol inside which it is defined,
14788 // find the symbol's definition.
14789 const void* _upb_DefBuilder_ResolveAny(upb_DefBuilder* ctx,
14790                                        const char* from_name_dbg,
14791                                        const char* base, upb_StringView sym,
14792                                        upb_deftype_t* type);
14793 
14794 const void* _upb_DefBuilder_Resolve(upb_DefBuilder* ctx,
14795                                     const char* from_name_dbg, const char* base,
14796                                     upb_StringView sym, upb_deftype_t type);
14797 
14798 char _upb_DefBuilder_ParseEscape(upb_DefBuilder* ctx, const upb_FieldDef* f,
14799                                  const char** src, const char* end);
14800 
14801 const char* _upb_DefBuilder_FullToShort(const char* fullname);
14802 
_upb_DefBuilder_Alloc(upb_DefBuilder * ctx,size_t bytes)14803 UPB_INLINE void* _upb_DefBuilder_Alloc(upb_DefBuilder* ctx, size_t bytes) {
14804   if (bytes == 0) return NULL;
14805   void* ret = upb_Arena_Malloc(ctx->arena, bytes);
14806   if (!ret) _upb_DefBuilder_OomErr(ctx);
14807   return ret;
14808 }
14809 
14810 // Adds a symbol |v| to the symtab, which must be a def pointer previously
14811 // packed with pack_def(). The def's pointer to upb_FileDef* must be set before
14812 // adding, so we know which entries to remove if building this file fails.
_upb_DefBuilder_Add(upb_DefBuilder * ctx,const char * name,upb_value v)14813 UPB_INLINE void _upb_DefBuilder_Add(upb_DefBuilder* ctx, const char* name,
14814                                     upb_value v) {
14815   upb_StringView sym = {.data = name, .size = strlen(name)};
14816   bool ok = _upb_DefPool_InsertSym(ctx->symtab, sym, v, ctx->status);
14817   if (!ok) _upb_DefBuilder_FailJmp(ctx);
14818 }
14819 
_upb_DefBuilder_Arena(const upb_DefBuilder * ctx)14820 UPB_INLINE upb_Arena* _upb_DefBuilder_Arena(const upb_DefBuilder* ctx) {
14821   return ctx->arena;
14822 }
14823 
_upb_DefBuilder_File(const upb_DefBuilder * ctx)14824 UPB_INLINE upb_FileDef* _upb_DefBuilder_File(const upb_DefBuilder* ctx) {
14825   return ctx->file;
14826 }
14827 
14828 // This version of CheckIdent() is only called by other, faster versions after
14829 // they detect a parsing error.
14830 void _upb_DefBuilder_CheckIdentSlow(upb_DefBuilder* ctx, upb_StringView name,
14831                                     bool full);
14832 
14833 // Verify a full identifier string. This is slightly more complicated than
14834 // verifying a relative identifier string because we must track '.' chars.
_upb_DefBuilder_CheckIdentFull(upb_DefBuilder * ctx,upb_StringView name)14835 UPB_INLINE void _upb_DefBuilder_CheckIdentFull(upb_DefBuilder* ctx,
14836                                                upb_StringView name) {
14837   bool good = name.size > 0;
14838   bool start = true;
14839 
14840   for (size_t i = 0; i < name.size; i++) {
14841     const char c = name.data[i];
14842     const char d = c | 0x20;  // force lowercase
14843     const bool is_alpha = (('a' <= d) & (d <= 'z')) | (c == '_');
14844     const bool is_numer = ('0' <= c) & (c <= '9') & !start;
14845     const bool is_dot = (c == '.') & !start;
14846 
14847     good &= is_alpha | is_numer | is_dot;
14848     start = is_dot;
14849   }
14850 
14851   if (!good) _upb_DefBuilder_CheckIdentSlow(ctx, name, true);
14852 }
14853 
14854 // Returns true if the returned feature set is new and must be populated.
14855 bool _upb_DefBuilder_GetOrCreateFeatureSet(upb_DefBuilder* ctx,
14856                                            const UPB_DESC(FeatureSet*) parent,
14857                                            upb_StringView key,
14858                                            UPB_DESC(FeatureSet**) set);
14859 
14860 const UPB_DESC(FeatureSet*)
14861     _upb_DefBuilder_DoResolveFeatures(upb_DefBuilder* ctx,
14862                                       const UPB_DESC(FeatureSet*) parent,
14863                                       const UPB_DESC(FeatureSet*) child,
14864                                       bool is_implicit);
14865 
UPB_DESC(FeatureSet *)14866 UPB_INLINE const UPB_DESC(FeatureSet*)
14867     _upb_DefBuilder_ResolveFeatures(upb_DefBuilder* ctx,
14868                                     const UPB_DESC(FeatureSet*) parent,
14869                                     const UPB_DESC(FeatureSet*) child) {
14870   return _upb_DefBuilder_DoResolveFeatures(ctx, parent, child, false);
14871 }
14872 
14873 #ifdef __cplusplus
14874 } /* extern "C" */
14875 #endif
14876 
14877 
14878 #endif /* UPB_REFLECTION_DEF_BUILDER_INTERNAL_H_ */
14879 
14880 #ifndef UPB_REFLECTION_ENUM_DEF_INTERNAL_H_
14881 #define UPB_REFLECTION_ENUM_DEF_INTERNAL_H_
14882 
14883 
14884 // Must be last.
14885 
14886 #ifdef __cplusplus
14887 extern "C" {
14888 #endif
14889 
14890 upb_EnumDef* _upb_EnumDef_At(const upb_EnumDef* e, int i);
14891 bool _upb_EnumDef_Insert(upb_EnumDef* e, upb_EnumValueDef* v, upb_Arena* a);
14892 const upb_MiniTableEnum* _upb_EnumDef_MiniTable(const upb_EnumDef* e);
14893 
14894 // Allocate and initialize an array of |n| enum defs.
14895 upb_EnumDef* _upb_EnumDefs_New(upb_DefBuilder* ctx, int n,
14896                                const UPB_DESC(EnumDescriptorProto*)
14897                                    const* protos,
14898                                const UPB_DESC(FeatureSet*) parent_features,
14899                                const upb_MessageDef* containing_type);
14900 
14901 #ifdef __cplusplus
14902 } /* extern "C" */
14903 #endif
14904 
14905 
14906 #endif /* UPB_REFLECTION_ENUM_DEF_INTERNAL_H_ */
14907 
14908 #ifndef UPB_REFLECTION_ENUM_VALUE_DEF_INTERNAL_H_
14909 #define UPB_REFLECTION_ENUM_VALUE_DEF_INTERNAL_H_
14910 
14911 
14912 // Must be last.
14913 
14914 #ifdef __cplusplus
14915 extern "C" {
14916 #endif
14917 
14918 upb_EnumValueDef* _upb_EnumValueDef_At(const upb_EnumValueDef* v, int i);
14919 
14920 // Allocate and initialize an array of |n| enum value defs owned by |e|.
14921 upb_EnumValueDef* _upb_EnumValueDefs_New(
14922     upb_DefBuilder* ctx, const char* prefix, int n,
14923     const UPB_DESC(EnumValueDescriptorProto*) const* protos,
14924     const UPB_DESC(FeatureSet*) parent_features, upb_EnumDef* e,
14925     bool* is_sorted);
14926 
14927 const upb_EnumValueDef** _upb_EnumValueDefs_Sorted(const upb_EnumValueDef* v,
14928                                                    int n, upb_Arena* a);
14929 
14930 #ifdef __cplusplus
14931 } /* extern "C" */
14932 #endif
14933 
14934 
14935 #endif /* UPB_REFLECTION_ENUM_VALUE_DEF_INTERNAL_H_ */
14936 
14937 #ifndef UPB_REFLECTION_FIELD_DEF_INTERNAL_H_
14938 #define UPB_REFLECTION_FIELD_DEF_INTERNAL_H_
14939 
14940 
14941 // Must be last.
14942 
14943 #ifdef __cplusplus
14944 extern "C" {
14945 #endif
14946 
14947 upb_FieldDef* _upb_FieldDef_At(const upb_FieldDef* f, int i);
14948 
14949 bool _upb_FieldDef_IsClosedEnum(const upb_FieldDef* f);
14950 bool _upb_FieldDef_IsProto3Optional(const upb_FieldDef* f);
14951 int _upb_FieldDef_LayoutIndex(const upb_FieldDef* f);
14952 uint64_t _upb_FieldDef_Modifiers(const upb_FieldDef* f);
14953 void _upb_FieldDef_Resolve(upb_DefBuilder* ctx, const char* prefix,
14954                            upb_FieldDef* f);
14955 void _upb_FieldDef_BuildMiniTableExtension(upb_DefBuilder* ctx,
14956                                            const upb_FieldDef* f);
14957 
14958 // Allocate and initialize an array of |n| extensions (field defs).
14959 upb_FieldDef* _upb_Extensions_New(upb_DefBuilder* ctx, int n,
14960                                   const UPB_DESC(FieldDescriptorProto*)
14961                                       const* protos,
14962                                   const UPB_DESC(FeatureSet*) parent_features,
14963                                   const char* prefix, upb_MessageDef* m);
14964 
14965 // Allocate and initialize an array of |n| field defs.
14966 upb_FieldDef* _upb_FieldDefs_New(upb_DefBuilder* ctx, int n,
14967                                  const UPB_DESC(FieldDescriptorProto*)
14968                                      const* protos,
14969                                  const UPB_DESC(FeatureSet*) parent_features,
14970                                  const char* prefix, upb_MessageDef* m,
14971                                  bool* is_sorted);
14972 
14973 // Allocate and return a list of pointers to the |n| field defs in |ff|,
14974 // sorted by field number.
14975 const upb_FieldDef** _upb_FieldDefs_Sorted(const upb_FieldDef* f, int n,
14976                                            upb_Arena* a);
14977 
14978 #ifdef __cplusplus
14979 } /* extern "C" */
14980 #endif
14981 
14982 
14983 #endif /* UPB_REFLECTION_FIELD_DEF_INTERNAL_H_ */
14984 
14985 #ifndef UPB_REFLECTION_FILE_DEF_INTERNAL_H_
14986 #define UPB_REFLECTION_FILE_DEF_INTERNAL_H_
14987 
14988 
14989 // Must be last.
14990 
14991 #ifdef __cplusplus
14992 extern "C" {
14993 #endif
14994 
14995 const upb_MiniTableExtension* _upb_FileDef_ExtensionMiniTable(
14996     const upb_FileDef* f, int i);
14997 const int32_t* _upb_FileDef_PublicDependencyIndexes(const upb_FileDef* f);
14998 const int32_t* _upb_FileDef_WeakDependencyIndexes(const upb_FileDef* f);
14999 
15000 // upb_FileDef_Package() returns "" if f->package is NULL, this does not.
15001 const char* _upb_FileDef_RawPackage(const upb_FileDef* f);
15002 
15003 void _upb_FileDef_Create(upb_DefBuilder* ctx,
15004                          const UPB_DESC(FileDescriptorProto) * file_proto);
15005 
15006 #ifdef __cplusplus
15007 } /* extern "C" */
15008 #endif
15009 
15010 
15011 #endif /* UPB_REFLECTION_FILE_DEF_INTERNAL_H_ */
15012 
15013 #ifndef UPB_REFLECTION_MESSAGE_DEF_INTERNAL_H_
15014 #define UPB_REFLECTION_MESSAGE_DEF_INTERNAL_H_
15015 
15016 
15017 // Must be last.
15018 
15019 #ifdef __cplusplus
15020 extern "C" {
15021 #endif
15022 
15023 upb_MessageDef* _upb_MessageDef_At(const upb_MessageDef* m, int i);
15024 bool _upb_MessageDef_InMessageSet(const upb_MessageDef* m);
15025 bool _upb_MessageDef_Insert(upb_MessageDef* m, const char* name, size_t size,
15026                             upb_value v, upb_Arena* a);
15027 void _upb_MessageDef_InsertField(upb_DefBuilder* ctx, upb_MessageDef* m,
15028                                  const upb_FieldDef* f);
15029 bool _upb_MessageDef_IsValidExtensionNumber(const upb_MessageDef* m, int n);
15030 void _upb_MessageDef_CreateMiniTable(upb_DefBuilder* ctx, upb_MessageDef* m);
15031 void _upb_MessageDef_LinkMiniTable(upb_DefBuilder* ctx,
15032                                    const upb_MessageDef* m);
15033 void _upb_MessageDef_Resolve(upb_DefBuilder* ctx, upb_MessageDef* m);
15034 
15035 // Allocate and initialize an array of |n| message defs.
15036 upb_MessageDef* _upb_MessageDefs_New(upb_DefBuilder* ctx, int n,
15037                                      const UPB_DESC(DescriptorProto*)
15038                                          const* protos,
15039                                      const UPB_DESC(FeatureSet*)
15040                                          parent_features,
15041                                      const upb_MessageDef* containing_type);
15042 
15043 #ifdef __cplusplus
15044 } /* extern "C" */
15045 #endif
15046 
15047 
15048 #endif /* UPB_REFLECTION_MESSAGE_DEF_INTERNAL_H_ */
15049 
15050 #ifndef UPB_REFLECTION_SERVICE_DEF_INTERNAL_H_
15051 #define UPB_REFLECTION_SERVICE_DEF_INTERNAL_H_
15052 
15053 
15054 // Must be last.
15055 
15056 #ifdef __cplusplus
15057 extern "C" {
15058 #endif
15059 
15060 upb_ServiceDef* _upb_ServiceDef_At(const upb_ServiceDef* s, int i);
15061 
15062 // Allocate and initialize an array of |n| service defs.
15063 upb_ServiceDef* _upb_ServiceDefs_New(upb_DefBuilder* ctx, int n,
15064                                      const UPB_DESC(ServiceDescriptorProto*)
15065                                          const* protos,
15066                                      const UPB_DESC(FeatureSet*)
15067                                          parent_features);
15068 
15069 #ifdef __cplusplus
15070 } /* extern "C" */
15071 #endif
15072 
15073 
15074 #endif /* UPB_REFLECTION_SERVICE_DEF_INTERNAL_H_ */
15075 
15076 #ifndef UPB_REFLECTION_UPB_EDITION_DEFAULTS_H_
15077 #define UPB_REFLECTION_UPB_EDITION_DEFAULTS_H_
15078 
15079 // This file contains the serialized FeatureSetDefaults object for
15080 // language-independent features and (possibly at some point) for upb-specific
15081 // features. This is used for feature resolution under Editions.
15082 // NOLINTBEGIN
15083 // clang-format off
15084 #define UPB_INTERNAL_UPB_EDITION_DEFAULTS "\n\023\030\204\007\"\000*\014\010\001\020\002\030\002 \003(\0010\002\n\023\030\347\007\"\000*\014\010\002\020\001\030\001 \002(\0010\001\n\023\030\350\007\"\014\010\001\020\001\030\001 \002(\0010\001*\000 \346\007(\350\007"
15085 // clang-format on
15086 // NOLINTEND
15087 
15088 #endif  // UPB_REFLECTION_UPB_EDITION_DEFAULTS_H_
15089 
15090 #ifndef UPB_REFLECTION_DESC_STATE_INTERNAL_H_
15091 #define UPB_REFLECTION_DESC_STATE_INTERNAL_H_
15092 
15093 
15094 // Must be last.
15095 
15096 // Manages the storage for mini descriptor strings as they are being encoded.
15097 // TODO: Move some of this state directly into the encoder, maybe.
15098 typedef struct {
15099   upb_MtDataEncoder e;
15100   size_t bufsize;
15101   char* buf;
15102   char* ptr;
15103 } upb_DescState;
15104 
15105 #ifdef __cplusplus
15106 extern "C" {
15107 #endif
15108 
_upb_DescState_Init(upb_DescState * d)15109 UPB_INLINE void _upb_DescState_Init(upb_DescState* d) {
15110   d->bufsize = kUpb_MtDataEncoder_MinSize * 2;
15111   d->buf = NULL;
15112   d->ptr = NULL;
15113 }
15114 
15115 bool _upb_DescState_Grow(upb_DescState* d, upb_Arena* a);
15116 
15117 #ifdef __cplusplus
15118 } /* extern "C" */
15119 #endif
15120 
15121 
15122 #endif /* UPB_REFLECTION_DESC_STATE_INTERNAL_H_ */
15123 
15124 #ifndef UPB_REFLECTION_ENUM_RESERVED_RANGE_INTERNAL_H_
15125 #define UPB_REFLECTION_ENUM_RESERVED_RANGE_INTERNAL_H_
15126 
15127 
15128 // IWYU pragma: private, include "upb/reflection/def.h"
15129 
15130 #ifndef UPB_REFLECTION_ENUM_RESERVED_RANGE_H_
15131 #define UPB_REFLECTION_ENUM_RESERVED_RANGE_H_
15132 
15133 
15134 // Must be last.
15135 
15136 #ifdef __cplusplus
15137 extern "C" {
15138 #endif
15139 
15140 int32_t upb_EnumReservedRange_Start(const upb_EnumReservedRange* r);
15141 int32_t upb_EnumReservedRange_End(const upb_EnumReservedRange* r);
15142 
15143 #ifdef __cplusplus
15144 } /* extern "C" */
15145 #endif
15146 
15147 
15148 #endif /* UPB_REFLECTION_ENUM_RESERVED_RANGE_H_ */
15149 
15150 // Must be last.
15151 
15152 #ifdef __cplusplus
15153 extern "C" {
15154 #endif
15155 
15156 upb_EnumReservedRange* _upb_EnumReservedRange_At(const upb_EnumReservedRange* r,
15157                                                  int i);
15158 
15159 // Allocate and initialize an array of |n| reserved ranges owned by |e|.
15160 upb_EnumReservedRange* _upb_EnumReservedRanges_New(
15161     upb_DefBuilder* ctx, int n,
15162     const UPB_DESC(EnumDescriptorProto_EnumReservedRange*) const* protos,
15163     const upb_EnumDef* e);
15164 
15165 #ifdef __cplusplus
15166 } /* extern "C" */
15167 #endif
15168 
15169 
15170 #endif /* UPB_REFLECTION_ENUM_RESERVED_RANGE_INTERNAL_H_ */
15171 
15172 #ifndef UPB_REFLECTION_INTERNAL_STRDUP2_H_
15173 #define UPB_REFLECTION_INTERNAL_STRDUP2_H_
15174 
15175 #include <stddef.h>
15176 
15177 
15178 // Must be last.
15179 
15180 #ifdef __cplusplus
15181 extern "C" {
15182 #endif
15183 
15184 // Variant that works with a length-delimited rather than NULL-delimited string,
15185 // as supported by strtable.
15186 char* upb_strdup2(const char* s, size_t len, upb_Arena* a);
15187 
15188 #ifdef __cplusplus
15189 } /* extern "C" */
15190 #endif
15191 
15192 
15193 #endif /* UPB_REFLECTION_INTERNAL_STRDUP2_H_ */
15194 
15195 #ifndef UPB_REFLECTION_EXTENSION_RANGE_INTERNAL_H_
15196 #define UPB_REFLECTION_EXTENSION_RANGE_INTERNAL_H_
15197 
15198 
15199 // Must be last.
15200 
15201 #ifdef __cplusplus
15202 extern "C" {
15203 #endif
15204 
15205 upb_ExtensionRange* _upb_ExtensionRange_At(const upb_ExtensionRange* r, int i);
15206 
15207 // Allocate and initialize an array of |n| extension ranges owned by |m|.
15208 upb_ExtensionRange* _upb_ExtensionRanges_New(
15209     upb_DefBuilder* ctx, int n,
15210     const UPB_DESC(DescriptorProto_ExtensionRange*) const* protos,
15211     const UPB_DESC(FeatureSet*) parent_features, const upb_MessageDef* m);
15212 
15213 #ifdef __cplusplus
15214 } /* extern "C" */
15215 #endif
15216 
15217 
15218 #endif /* UPB_REFLECTION_EXTENSION_RANGE_INTERNAL_H_ */
15219 
15220 #ifndef UPB_REFLECTION_ONEOF_DEF_INTERNAL_H_
15221 #define UPB_REFLECTION_ONEOF_DEF_INTERNAL_H_
15222 
15223 
15224 // Must be last.
15225 
15226 #ifdef __cplusplus
15227 extern "C" {
15228 #endif
15229 
15230 upb_OneofDef* _upb_OneofDef_At(const upb_OneofDef* o, int i);
15231 void _upb_OneofDef_Insert(upb_DefBuilder* ctx, upb_OneofDef* o,
15232                           const upb_FieldDef* f, const char* name, size_t size);
15233 
15234 // Allocate and initialize an array of |n| oneof defs owned by |m|.
15235 upb_OneofDef* _upb_OneofDefs_New(upb_DefBuilder* ctx, int n,
15236                                  const UPB_DESC(OneofDescriptorProto*)
15237                                      const* protos,
15238                                  const UPB_DESC(FeatureSet*) parent_features,
15239                                  upb_MessageDef* m);
15240 
15241 size_t _upb_OneofDefs_Finalize(upb_DefBuilder* ctx, upb_MessageDef* m);
15242 
15243 #ifdef __cplusplus
15244 } /* extern "C" */
15245 #endif
15246 
15247 
15248 #endif /* UPB_REFLECTION_ONEOF_DEF_INTERNAL_H_ */
15249 
15250 #ifndef UPB_REFLECTION_MESSAGE_RESERVED_RANGE_INTERNAL_H_
15251 #define UPB_REFLECTION_MESSAGE_RESERVED_RANGE_INTERNAL_H_
15252 
15253 
15254 // IWYU pragma: private, include "upb/reflection/def.h"
15255 
15256 #ifndef UPB_REFLECTION_MESSAGE_RESERVED_RANGE_H_
15257 #define UPB_REFLECTION_MESSAGE_RESERVED_RANGE_H_
15258 
15259 
15260 // Must be last.
15261 
15262 #ifdef __cplusplus
15263 extern "C" {
15264 #endif
15265 
15266 int32_t upb_MessageReservedRange_Start(const upb_MessageReservedRange* r);
15267 int32_t upb_MessageReservedRange_End(const upb_MessageReservedRange* r);
15268 
15269 #ifdef __cplusplus
15270 } /* extern "C" */
15271 #endif
15272 
15273 
15274 #endif /* UPB_REFLECTION_MESSAGE_RESERVED_RANGE_H_ */
15275 
15276 // Must be last.
15277 
15278 #ifdef __cplusplus
15279 extern "C" {
15280 #endif
15281 
15282 upb_MessageReservedRange* _upb_MessageReservedRange_At(
15283     const upb_MessageReservedRange* r, int i);
15284 
15285 // Allocate and initialize an array of |n| reserved ranges owned by |m|.
15286 upb_MessageReservedRange* _upb_MessageReservedRanges_New(
15287     upb_DefBuilder* ctx, int n,
15288     const UPB_DESC(DescriptorProto_ReservedRange) * const* protos,
15289     const upb_MessageDef* m);
15290 
15291 #ifdef __cplusplus
15292 } /* extern "C" */
15293 #endif
15294 
15295 
15296 #endif /* UPB_REFLECTION_MESSAGE_RESERVED_RANGE_INTERNAL_H_ */
15297 
15298 #ifndef UPB_REFLECTION_METHOD_DEF_INTERNAL_H_
15299 #define UPB_REFLECTION_METHOD_DEF_INTERNAL_H_
15300 
15301 
15302 // Must be last.
15303 
15304 #ifdef __cplusplus
15305 extern "C" {
15306 #endif
15307 
15308 upb_MethodDef* _upb_MethodDef_At(const upb_MethodDef* m, int i);
15309 
15310 // Allocate and initialize an array of |n| method defs owned by |s|.
15311 upb_MethodDef* _upb_MethodDefs_New(upb_DefBuilder* ctx, int n,
15312                                    const UPB_DESC(MethodDescriptorProto*)
15313                                        const* protos,
15314                                    const UPB_DESC(FeatureSet*) parent_features,
15315                                    upb_ServiceDef* s);
15316 
15317 #ifdef __cplusplus
15318 } /* extern "C" */
15319 #endif
15320 
15321 
15322 #endif /* UPB_REFLECTION_METHOD_DEF_INTERNAL_H_ */
15323 
15324 // This should #undef all macros #defined in def.inc
15325 
15326 #undef UPB_SIZE
15327 #undef UPB_PTR_AT
15328 #undef UPB_MAPTYPE_STRING
15329 #undef UPB_EXPORT
15330 #undef UPB_INLINE
15331 #undef UPB_API
15332 #undef UPBC_API
15333 #undef UPB_API_INLINE
15334 #undef UPB_ALIGN_UP
15335 #undef UPB_ALIGN_DOWN
15336 #undef UPB_ALIGN_MALLOC
15337 #undef UPB_ALIGN_OF
15338 #undef UPB_ALIGN_AS
15339 #undef UPB_MALLOC_ALIGN
15340 #undef UPB_LIKELY
15341 #undef UPB_UNLIKELY
15342 #undef UPB_FORCEINLINE
15343 #undef UPB_NOINLINE
15344 #undef UPB_NORETURN
15345 #undef UPB_PRINTF
15346 #undef UPB_MAX
15347 #undef UPB_MIN
15348 #undef UPB_UNUSED
15349 #undef UPB_ASSUME
15350 #undef UPB_ASSERT
15351 #undef UPB_UNREACHABLE
15352 #undef UPB_SETJMP
15353 #undef UPB_LONGJMP
15354 #undef UPB_PTRADD
15355 #undef UPB_MUSTTAIL
15356 #undef UPB_FASTTABLE_SUPPORTED
15357 #undef UPB_FASTTABLE_MASK
15358 #undef UPB_FASTTABLE
15359 #undef UPB_FASTTABLE_INIT
15360 #undef UPB_POISON_MEMORY_REGION
15361 #undef UPB_UNPOISON_MEMORY_REGION
15362 #undef UPB_ASAN
15363 #undef UPB_ASAN_GUARD_SIZE
15364 #undef UPB_CLANG_ASAN
15365 #undef UPB_TREAT_CLOSED_ENUMS_LIKE_OPEN
15366 #undef UPB_DEPRECATED
15367 #undef UPB_GNUC_MIN
15368 #undef UPB_DESCRIPTOR_UPB_H_FILENAME
15369 #undef UPB_DESC
15370 #undef UPB_DESC_MINITABLE
15371 #undef UPB_IS_GOOGLE3
15372 #undef UPB_ATOMIC
15373 #undef UPB_USE_C11_ATOMICS
15374 #undef UPB_PRIVATE
15375 #undef UPB_ONLYBITS
15376 #undef UPB_LINKARR_DECLARE
15377 #undef UPB_LINKARR_APPEND
15378 #undef UPB_LINKARR_START
15379 #undef UPB_LINKARR_STOP
15380 #undef UPB_FUTURE_BREAKING_CHANGES
15381 #undef UPB_FUTURE_PYTHON_CLOSED_ENUM_ENFORCEMENT
15382