• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 // Ruby is still using proto3 enum semantics for proto2
2 #define UPB_DISABLE_CLOSED_ENUM_CHECKING
3 /* Amalgamated source file */
4 
5 /*
6  * This is where we define internal portability macros used across upb.
7  *
8  * All of these macros are undef'd in undef.inc to avoid leaking them to users.
9  *
10  * The correct usage is:
11  *
12  *   #include "upb/foobar.h"
13  *   #include "upb/baz.h"
14  *
15  *   // MUST be last included header.
16  *   #include "upb/port/def.inc"
17  *
18  *   // Code for this file.
19  *   // <...>
20  *
21  *   // Can be omitted for .c files, required for .h.
22  *   #include "upb/port/undef.inc"
23  *
24  * This file is private and must not be included by users!
25  */
26 
27 #if !((defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L) || \
28       (defined(__cplusplus) && __cplusplus >= 201402L) ||           \
29       (defined(_MSC_VER) && _MSC_VER >= 1900))
30 #error upb requires C99 or C++14 or MSVC >= 2015.
31 #endif
32 
33 // Portable check for GCC minimum version:
34 // https://gcc.gnu.org/onlinedocs/cpp/Common-Predefined-Macros.html
35 #if defined(__GNUC__) && defined(__GNUC_MINOR__) && defined(__GNUC_PATCHLEVEL__)
36 #define UPB_GNUC_MIN(x, y) \
37   (__GNUC__ > (x) || __GNUC__ == (x) && __GNUC_MINOR__ >= (y))
38 #else
39 #define UPB_GNUC_MIN(x, y) 0
40 #endif
41 
42 #include <assert.h>
43 #include <setjmp.h>
44 #include <stdbool.h>
45 #include <stdint.h>
46 #include <stdio.h>
47 #include <stdlib.h>
48 
49 #ifndef UINTPTR_MAX
50 Error, UINTPTR_MAX is undefined
51 #endif
52 
53 #if UINTPTR_MAX == 0xffffffff
54 #define UPB_SIZE(size32, size64) size32
55 #else
56 #define UPB_SIZE(size32, size64) size64
57 #endif
58 
59 /* If we always read/write as a consistent type to each address, this shouldn't
60  * violate aliasing.
61  */
62 #define UPB_PTR_AT(msg, ofs, type) ((type*)((char*)(msg) + (ofs)))
63 
64 #define UPB_MAPTYPE_STRING 0
65 
66 // UPB_EXPORT: always generate a public symbol.
67 #if defined(__GNUC__) || defined(__clang__)
68 #define UPB_EXPORT __attribute__((visibility("default"))) __attribute__((used))
69 #else
70 #define UPB_EXPORT
71 #endif
72 
73 // UPB_INLINE: inline if possible, emit standalone code if required.
74 #ifdef __cplusplus
75 #define UPB_INLINE inline
76 #elif defined (__GNUC__) || defined(__clang__)
77 #define UPB_INLINE static __inline__
78 #else
79 #define UPB_INLINE static
80 #endif
81 
82 #ifdef UPB_BUILD_API
83 #define UPB_API UPB_EXPORT
84 #define UPB_API_INLINE UPB_EXPORT
85 #else
86 #define UPB_API
87 #define UPB_API_INLINE UPB_INLINE
88 #endif
89 
90 #ifdef EXPORT_UPBC
91 #define UPBC_API UPB_EXPORT
92 #else
93 #define UPBC_API
94 #endif
95 
96 #define UPB_MALLOC_ALIGN 8
97 #define UPB_ALIGN_UP(size, align) (((size) + (align) - 1) / (align) * (align))
98 #define UPB_ALIGN_DOWN(size, align) ((size) / (align) * (align))
99 #define UPB_ALIGN_MALLOC(size) UPB_ALIGN_UP(size, UPB_MALLOC_ALIGN)
100 #ifdef __clang__
101 #define UPB_ALIGN_OF(type) _Alignof(type)
102 #else
103 #define UPB_ALIGN_OF(type) offsetof (struct { char c; type member; }, member)
104 #endif
105 
106 #ifdef _MSC_VER
107 // Some versions of our Windows compiler don't support the C11 syntax.
108 #define UPB_ALIGN_AS(x) __declspec(align(x))
109 #else
110 #define UPB_ALIGN_AS(x) _Alignas(x)
111 #endif
112 
113 // Hints to the compiler about likely/unlikely branches.
114 #if defined (__GNUC__) || defined(__clang__)
115 #define UPB_LIKELY(x) __builtin_expect((bool)(x), 1)
116 #define UPB_UNLIKELY(x) __builtin_expect((bool)(x), 0)
117 #else
118 #define UPB_LIKELY(x) (x)
119 #define UPB_UNLIKELY(x) (x)
120 #endif
121 
122 // Macros for function attributes on compilers that support them.
123 #ifdef __GNUC__
124 #define UPB_FORCEINLINE __inline__ __attribute__((always_inline)) static
125 #define UPB_NOINLINE __attribute__((noinline))
126 #define UPB_NORETURN __attribute__((__noreturn__))
127 #define UPB_PRINTF(str, first_vararg) __attribute__((format (printf, str, first_vararg)))
128 #elif defined(_MSC_VER)
129 #define UPB_NOINLINE
130 #define UPB_FORCEINLINE static
131 #define UPB_NORETURN __declspec(noreturn)
132 #define UPB_PRINTF(str, first_vararg)
133 #else  /* !defined(__GNUC__) */
134 #define UPB_FORCEINLINE static
135 #define UPB_NOINLINE
136 #define UPB_NORETURN
137 #define UPB_PRINTF(str, first_vararg)
138 #endif
139 
140 #define UPB_MAX(x, y) ((x) > (y) ? (x) : (y))
141 #define UPB_MIN(x, y) ((x) < (y) ? (x) : (y))
142 
143 #define UPB_UNUSED(var) (void)var
144 
145 // UPB_ASSUME(): in release mode, we tell the compiler to assume this is true.
146 #ifdef NDEBUG
147 #ifdef __GNUC__
148 #define UPB_ASSUME(expr) if (!(expr)) __builtin_unreachable()
149 #elif defined _MSC_VER
150 #define UPB_ASSUME(expr) if (!(expr)) __assume(0)
151 #else
152 #define UPB_ASSUME(expr) do {} while (false && (expr))
153 #endif
154 #else
155 #define UPB_ASSUME(expr) assert(expr)
156 #endif
157 
158 /* UPB_ASSERT(): in release mode, we use the expression without letting it be
159  * evaluated.  This prevents "unused variable" warnings. */
160 #ifdef NDEBUG
161 #define UPB_ASSERT(expr) do {} while (false && (expr))
162 #else
163 #define UPB_ASSERT(expr) assert(expr)
164 #endif
165 
166 #if defined(__GNUC__) || defined(__clang__)
167 #define UPB_UNREACHABLE() do { assert(0); __builtin_unreachable(); } while(0)
168 #elif defined(_MSC_VER)
169 #define UPB_UNREACHABLE() \
170   do {                    \
171     assert(0);            \
172     __assume(0);          \
173   } while (0)
174 #else
175 #define UPB_UNREACHABLE() do { assert(0); } while(0)
176 #endif
177 
178 /* UPB_SETJMP() / UPB_LONGJMP(): avoid setting/restoring signal mask. */
179 #ifdef __APPLE__
180 #define UPB_SETJMP(buf) _setjmp(buf)
181 #define UPB_LONGJMP(buf, val) _longjmp(buf, val)
182 #elif defined(WASM_WAMR)
183 #define UPB_SETJMP(buf) 0
184 #define UPB_LONGJMP(buf, val) abort()
185 #else
186 #define UPB_SETJMP(buf) setjmp(buf)
187 #define UPB_LONGJMP(buf, val) longjmp(buf, val)
188 #endif
189 
190 #ifdef __GNUC__
191 #define UPB_USE_C11_ATOMICS
192 #define UPB_ATOMIC(T) _Atomic(T)
193 #else
194 #define UPB_ATOMIC(T) T
195 #endif
196 
197 /* UPB_PTRADD(ptr, ofs): add pointer while avoiding "NULL + 0" UB */
198 #define UPB_PTRADD(ptr, ofs) ((ofs) ? (ptr) + (ofs) : (ptr))
199 
200 #define UPB_PRIVATE(x) x##_dont_copy_me__upb_internal_use_only
201 
202 #ifdef UPB_ALLOW_PRIVATE_ACCESS__FOR_BITS_ONLY
203 #define UPB_ONLYBITS(x) x
204 #else
205 #define UPB_ONLYBITS(x) UPB_PRIVATE(x)
206 #endif
207 
208 /* Configure whether fasttable is switched on or not. *************************/
209 
210 #ifdef __has_attribute
211 #define UPB_HAS_ATTRIBUTE(x) __has_attribute(x)
212 #else
213 #define UPB_HAS_ATTRIBUTE(x) 0
214 #endif
215 
216 #if UPB_HAS_ATTRIBUTE(musttail)
217 #define UPB_MUSTTAIL __attribute__((musttail))
218 #else
219 #define UPB_MUSTTAIL
220 #endif
221 
222 #undef UPB_HAS_ATTRIBUTE
223 
224 /* This check is not fully robust: it does not require that we have "musttail"
225  * support available. We need tail calls to avoid consuming arbitrary amounts
226  * of stack space.
227  *
228  * GCC/Clang can mostly be trusted to generate tail calls as long as
229  * optimization is enabled, but, debug builds will not generate tail calls
230  * unless "musttail" is available.
231  *
232  * We should probably either:
233  *   1. require that the compiler supports musttail.
234  *   2. add some fallback code for when musttail isn't available (ie. return
235  *      instead of tail calling). This is safe and portable, but this comes at
236  *      a CPU cost.
237  */
238 #if (defined(__x86_64__) || defined(__aarch64__)) && defined(__GNUC__)
239 #define UPB_FASTTABLE_SUPPORTED 1
240 #else
241 #define UPB_FASTTABLE_SUPPORTED 0
242 #endif
243 
244 /* define UPB_ENABLE_FASTTABLE to force fast table support.
245  * This is useful when we want to ensure we are really getting fasttable,
246  * for example for testing or benchmarking. */
247 #if defined(UPB_ENABLE_FASTTABLE)
248 #if !UPB_FASTTABLE_SUPPORTED
249 #error fasttable is x86-64/ARM64 only and requires GCC or Clang.
250 #endif
251 #define UPB_FASTTABLE 1
252 /* Define UPB_TRY_ENABLE_FASTTABLE to use fasttable if possible.
253  * This is useful for releasing code that might be used on multiple platforms,
254  * for example the PHP or Ruby C extensions. */
255 #elif defined(UPB_TRY_ENABLE_FASTTABLE)
256 #define UPB_FASTTABLE UPB_FASTTABLE_SUPPORTED
257 #else
258 #define UPB_FASTTABLE 0
259 #endif
260 
261 /* UPB_FASTTABLE_INIT() allows protos compiled for fasttable to gracefully
262  * degrade to non-fasttable if the runtime or platform do not support it. */
263 #if !UPB_FASTTABLE
264 #define UPB_FASTTABLE_INIT(...)
265 #define UPB_FASTTABLE_MASK(mask) -1
266 #else
267 #define UPB_FASTTABLE_INIT(...) __VA_ARGS__
268 #define UPB_FASTTABLE_MASK(mask) mask
269 #endif
270 
271 #undef UPB_FASTTABLE_SUPPORTED
272 
273 /* ASAN poisoning (for arena).
274  * If using UPB from an interpreted language like Ruby, a build of the
275  * interpreter compiled with ASAN enabled must be used in order to get sane and
276  * expected behavior.
277  */
278 
279 /* Due to preprocessor limitations, the conditional logic for setting
280  * UPN_CLANG_ASAN below cannot be consolidated into a portable one-liner.
281  * See https://gcc.gnu.org/onlinedocs/cpp/_005f_005fhas_005fattribute.html.
282  */
283 #if defined(__has_feature)
284 #if __has_feature(address_sanitizer)
285 #define UPB_CLANG_ASAN 1
286 #else
287 #define UPB_CLANG_ASAN 0
288 #endif
289 #else
290 #define UPB_CLANG_ASAN 0
291 #endif
292 
293 #if defined(__SANITIZE_ADDRESS__) || UPB_CLANG_ASAN
294 #define UPB_ASAN 1
295 #define UPB_ASAN_GUARD_SIZE 32
296 #ifdef __cplusplus
297     extern "C" {
298 #endif
299 void __asan_poison_memory_region(void const volatile *addr, size_t size);
300 void __asan_unpoison_memory_region(void const volatile *addr, size_t size);
301 #ifdef __cplusplus
302 }  /* extern "C" */
303 #endif
304 #define UPB_POISON_MEMORY_REGION(addr, size) \
305   __asan_poison_memory_region((addr), (size))
306 #define UPB_UNPOISON_MEMORY_REGION(addr, size) \
307   __asan_unpoison_memory_region((addr), (size))
308 #else
309 #define UPB_ASAN 0
310 #define UPB_ASAN_GUARD_SIZE 0
311 #define UPB_POISON_MEMORY_REGION(addr, size) \
312   ((void)(addr), (void)(size))
313 #define UPB_UNPOISON_MEMORY_REGION(addr, size) \
314   ((void)(addr), (void)(size))
315 #endif
316 
317 /* Disable proto2 arena behavior (TEMPORARY) **********************************/
318 
319 #ifdef UPB_DISABLE_CLOSED_ENUM_CHECKING
320 #define UPB_TREAT_CLOSED_ENUMS_LIKE_OPEN 1
321 #else
322 #define UPB_TREAT_CLOSED_ENUMS_LIKE_OPEN 0
323 #endif
324 
325 #if defined(__cplusplus)
326 #if defined(__clang__) || UPB_GNUC_MIN(6, 0)
327 // https://gcc.gnu.org/gcc-6/changes.html
328 #if __cplusplus >= 201402L
329 #define UPB_DEPRECATED [[deprecated]]
330 #else
331 #define UPB_DEPRECATED __attribute__((deprecated))
332 #endif
333 #else
334 #define UPB_DEPRECATED
335 #endif
336 #else
337 #define UPB_DEPRECATED
338 #endif
339 
340 #if defined(UPB_IS_GOOGLE3) && \
341     (!defined(UPB_BOOTSTRAP_STAGE) || UPB_BOOTSTRAP_STAGE != 0)
342 #define UPB_DESC(sym) proto2_##sym
343 #define UPB_DESC_MINITABLE(sym) &proto2__##sym##_msg_init
344 #elif defined(UPB_BOOTSTRAP_STAGE) && UPB_BOOTSTRAP_STAGE == 0
345 #define UPB_DESC(sym) google_protobuf_##sym
346 #define UPB_DESC_MINITABLE(sym) google__protobuf__##sym##_msg_init()
347 #else
348 #define UPB_DESC(sym) google_protobuf_##sym
349 #define UPB_DESC_MINITABLE(sym) &google__protobuf__##sym##_msg_init
350 #endif
351 
352 #undef UPB_IS_GOOGLE3
353 
354 // Linker arrays combine elements from multiple translation units into a single
355 // array that can be iterated over at runtime.
356 //
357 // It is an alternative to pre-main "registration" functions.
358 //
359 // Usage:
360 //
361 //   // In N translation units.
362 //   UPB_LINKARR_APPEND(foo_array) static int elems[3] = {1, 2, 3};
363 //
364 //   // At runtime:
365 //   UPB_LINKARR_DECLARE(foo_array, int);
366 //
367 //   void f() {
368 //     const int* start = UPB_LINKARR_START(foo_array);
369 //     const int* stop = UPB_LINKARR_STOP(foo_array);
370 //     for (const int* p = start; p < stop; p++) {
371 //       // Windows can introduce zero padding, so we have to skip zeroes.
372 //       if (*p != 0) {
373 //         vec.push_back(*p);
374 //       }
375 //     }
376 //   }
377 
378 #if defined(__ELF__) || defined(__wasm__)
379 
380 #define UPB_LINKARR_APPEND(name) \
381   __attribute__((retain, used, section("linkarr_" #name)))
382 #define UPB_LINKARR_DECLARE(name, type)     \
383   extern type const __start_linkarr_##name; \
384   extern type const __stop_linkarr_##name;  \
385   UPB_LINKARR_APPEND(name) type UPB_linkarr_internal_empty_##name[1]
386 #define UPB_LINKARR_START(name) (&__start_linkarr_##name)
387 #define UPB_LINKARR_STOP(name) (&__stop_linkarr_##name)
388 
389 #elif defined(__MACH__)
390 
391 /* As described in: https://stackoverflow.com/a/22366882 */
392 #define UPB_LINKARR_APPEND(name) \
393   __attribute__((retain, used, section("__DATA,__la_" #name)))
394 #define UPB_LINKARR_DECLARE(name, type)           \
395   extern type const __start_linkarr_##name __asm( \
396       "section$start$__DATA$__la_" #name);        \
397   extern type const __stop_linkarr_##name __asm(  \
398       "section$end$__DATA$"                       \
399       "__la_" #name);                             \
400   UPB_LINKARR_APPEND(name) type UPB_linkarr_internal_empty_##name[1]
401 #define UPB_LINKARR_START(name) (&__start_linkarr_##name)
402 #define UPB_LINKARR_STOP(name) (&__stop_linkarr_##name)
403 
404 #elif defined(_MSC_VER) && defined(__clang__)
405 
406 /* See:
407  *   https://devblogs.microsoft.com/oldnewthing/20181107-00/?p=100155
408  *   https://devblogs.microsoft.com/oldnewthing/20181108-00/?p=100165
409  *   https://devblogs.microsoft.com/oldnewthing/20181109-00/?p=100175 */
410 
411 // Usage of __attribute__ here probably means this is Clang-specific, and would
412 // not work on MSVC.
413 #define UPB_LINKARR_APPEND(name) \
414   __declspec(allocate("la_" #name "$j")) __attribute__((retain, used))
415 #define UPB_LINKARR_DECLARE(name, type)                               \
416   __declspec(allocate("la_" #name "$a")) type __start_linkarr_##name; \
417   __declspec(allocate("la_" #name "$z")) type __stop_linkarr_##name;  \
418   UPB_LINKARR_APPEND(name) type UPB_linkarr_internal_empty_##name[1] = {0}
419 #define UPB_LINKARR_START(name) (&__start_linkarr_##name)
420 #define UPB_LINKARR_STOP(name) (&__stop_linkarr_##name)
421 
422 #else
423 
424 // Linker arrays are not supported on this platform.  Make appends a no-op but
425 // don't define the other macros.
426 #define UPB_LINKARR_APPEND(name)
427 
428 #endif
429 
430 // Future versions of upb will include breaking changes to some APIs.
431 // This macro can be set to enable these API changes ahead of time, so that
432 // user code can be updated before upgrading versions of protobuf.
433 #ifdef UPB_FUTURE_BREAKING_CHANGES
434 
435 // Properly enforce closed enums in python.
436 // Owner: mkruskal@
437 #define UPB_FUTURE_PYTHON_CLOSED_ENUM_ENFORCEMENT 1
438 
439 #endif
440 
441 #ifndef UPB_BASE_STATUS_H_
442 #define UPB_BASE_STATUS_H_
443 
444 #include <stdarg.h>
445 
446 // Must be last.
447 
448 #define _kUpb_Status_MaxMessage 511
449 
450 typedef struct {
451   bool ok;
452   char msg[_kUpb_Status_MaxMessage];  // Error message; NULL-terminated.
453 } upb_Status;
454 
455 #ifdef __cplusplus
456 extern "C" {
457 #endif
458 
459 UPB_API const char* upb_Status_ErrorMessage(const upb_Status* status);
460 UPB_API bool upb_Status_IsOk(const upb_Status* status);
461 
462 // These are no-op if |status| is NULL.
463 UPB_API void upb_Status_Clear(upb_Status* status);
464 void upb_Status_SetErrorMessage(upb_Status* status, const char* msg);
465 void upb_Status_SetErrorFormat(upb_Status* status, const char* fmt, ...)
466     UPB_PRINTF(2, 3);
467 void upb_Status_VSetErrorFormat(upb_Status* status, const char* fmt,
468                                 va_list args) UPB_PRINTF(2, 0);
469 void upb_Status_VAppendErrorFormat(upb_Status* status, const char* fmt,
470                                    va_list args) UPB_PRINTF(2, 0);
471 
472 #ifdef __cplusplus
473 } /* extern "C" */
474 #endif
475 
476 
477 #endif /* UPB_BASE_STATUS_H_ */
478 
479 #ifndef UPB_WIRE_EPS_COPY_INPUT_STREAM_H_
480 #define UPB_WIRE_EPS_COPY_INPUT_STREAM_H_
481 
482 #include <string.h>
483 
484 
485 /* upb_Arena is a specific allocator implementation that uses arena allocation.
486  * The user provides an allocator that will be used to allocate the underlying
487  * arena blocks.  Arenas by nature do not require the individual allocations
488  * to be freed.  However the Arena does allow users to register cleanup
489  * functions that will run when the arena is destroyed.
490  *
491  * A upb_Arena is *not* thread-safe.
492  *
493  * You could write a thread-safe arena allocator that satisfies the
494  * upb_alloc interface, but it would not be as efficient for the
495  * single-threaded case. */
496 
497 #ifndef UPB_MEM_ARENA_H_
498 #define UPB_MEM_ARENA_H_
499 
500 #include <stddef.h>
501 #include <stdint.h>
502 
503 
504 #ifndef UPB_MEM_ALLOC_H_
505 #define UPB_MEM_ALLOC_H_
506 
507 // Must be last.
508 
509 #ifdef __cplusplus
510 extern "C" {
511 #endif
512 
513 typedef struct upb_alloc upb_alloc;
514 
515 /* A combined `malloc()`/`free()` function.
516  * If `size` is 0 then the function acts like `free()`, otherwise it acts like
517  * `realloc()`.  Only `oldsize` bytes from a previous allocation are
518  * preserved. */
519 typedef void* upb_alloc_func(upb_alloc* alloc, void* ptr, size_t oldsize,
520                              size_t size);
521 
522 /* A upb_alloc is a possibly-stateful allocator object.
523  *
524  * It could either be an arena allocator (which doesn't require individual
525  * `free()` calls) or a regular `malloc()` (which does).  The client must
526  * therefore free memory unless it knows that the allocator is an arena
527  * allocator. */
528 struct upb_alloc {
529   upb_alloc_func* func;
530 };
531 
upb_malloc(upb_alloc * alloc,size_t size)532 UPB_INLINE void* upb_malloc(upb_alloc* alloc, size_t size) {
533   UPB_ASSERT(alloc);
534   return alloc->func(alloc, NULL, 0, size);
535 }
536 
upb_realloc(upb_alloc * alloc,void * ptr,size_t oldsize,size_t size)537 UPB_INLINE void* upb_realloc(upb_alloc* alloc, void* ptr, size_t oldsize,
538                              size_t size) {
539   UPB_ASSERT(alloc);
540   return alloc->func(alloc, ptr, oldsize, size);
541 }
542 
upb_free(upb_alloc * alloc,void * ptr)543 UPB_INLINE void upb_free(upb_alloc* alloc, void* ptr) {
544   UPB_ASSERT(alloc);
545   alloc->func(alloc, ptr, 0, 0);
546 }
547 
548 // The global allocator used by upb. Uses the standard malloc()/free().
549 
550 extern upb_alloc upb_alloc_global;
551 
552 /* Functions that hard-code the global malloc.
553  *
554  * We still get benefit because we can put custom logic into our global
555  * allocator, like injecting out-of-memory faults in debug/testing builds. */
556 
upb_gmalloc(size_t size)557 UPB_INLINE void* upb_gmalloc(size_t size) {
558   return upb_malloc(&upb_alloc_global, size);
559 }
560 
upb_grealloc(void * ptr,size_t oldsize,size_t size)561 UPB_INLINE void* upb_grealloc(void* ptr, size_t oldsize, size_t size) {
562   return upb_realloc(&upb_alloc_global, ptr, oldsize, size);
563 }
564 
upb_gfree(void * ptr)565 UPB_INLINE void upb_gfree(void* ptr) { upb_free(&upb_alloc_global, ptr); }
566 
567 #ifdef __cplusplus
568 } /* extern "C" */
569 #endif
570 
571 
572 #endif /* UPB_MEM_ALLOC_H_ */
573 
574 #ifndef UPB_MEM_INTERNAL_ARENA_H_
575 #define UPB_MEM_INTERNAL_ARENA_H_
576 
577 #include <stddef.h>
578 #include <stdint.h>
579 #include <string.h>
580 
581 // Must be last.
582 
583 // This is QUITE an ugly hack, which specifies the number of pointers needed
584 // to equal (or exceed) the storage required for one upb_Arena.
585 //
586 // We need this because the decoder inlines a upb_Arena for performance but
587 // the full struct is not visible outside of arena.c. Yes, I know, it's awful.
588 #define UPB_ARENA_SIZE_HACK 7
589 
590 // LINT.IfChange(upb_Arena)
591 
592 struct upb_Arena {
593   char* UPB_ONLYBITS(ptr);
594   char* UPB_ONLYBITS(end);
595 };
596 
597 // LINT.ThenChange(//depot/google3/third_party/upb/bits/typescript/arena.ts:upb_Arena)
598 
599 #ifdef __cplusplus
600 extern "C" {
601 #endif
602 
603 void UPB_PRIVATE(_upb_Arena_SwapIn)(struct upb_Arena* des,
604                                     const struct upb_Arena* src);
605 void UPB_PRIVATE(_upb_Arena_SwapOut)(struct upb_Arena* des,
606                                      const struct upb_Arena* src);
607 
608 // Returns whether |ptr| was allocated directly by |a| (so care must be used
609 // with fused arenas).
610 UPB_API bool UPB_ONLYBITS(_upb_Arena_Contains)(const struct upb_Arena* a,
611                                                void* ptr);
612 
UPB_PRIVATE(_upb_ArenaHas)613 UPB_INLINE size_t UPB_PRIVATE(_upb_ArenaHas)(const struct upb_Arena* a) {
614   return (size_t)(a->UPB_ONLYBITS(end) - a->UPB_ONLYBITS(ptr));
615 }
616 
upb_Arena_Malloc(struct upb_Arena * a,size_t size)617 UPB_API_INLINE void* upb_Arena_Malloc(struct upb_Arena* a, size_t size) {
618   void* UPB_PRIVATE(_upb_Arena_SlowMalloc)(struct upb_Arena * a, size_t size);
619 
620   size = UPB_ALIGN_MALLOC(size);
621   const size_t span = size + UPB_ASAN_GUARD_SIZE;
622   if (UPB_UNLIKELY(UPB_PRIVATE(_upb_ArenaHas)(a) < span)) {
623     return UPB_PRIVATE(_upb_Arena_SlowMalloc)(a, span);
624   }
625 
626   // We have enough space to do a fast malloc.
627   void* ret = a->UPB_ONLYBITS(ptr);
628   UPB_ASSERT(UPB_ALIGN_MALLOC((uintptr_t)ret) == (uintptr_t)ret);
629   UPB_ASSERT(UPB_ALIGN_MALLOC(size) == size);
630   UPB_UNPOISON_MEMORY_REGION(ret, size);
631 
632   a->UPB_ONLYBITS(ptr) += span;
633 
634   return ret;
635 }
636 
upb_Arena_Realloc(struct upb_Arena * a,void * ptr,size_t oldsize,size_t size)637 UPB_API_INLINE void* upb_Arena_Realloc(struct upb_Arena* a, void* ptr,
638                                        size_t oldsize, size_t size) {
639   oldsize = UPB_ALIGN_MALLOC(oldsize);
640   size = UPB_ALIGN_MALLOC(size);
641   bool is_most_recent_alloc =
642       (uintptr_t)ptr + oldsize == (uintptr_t)a->UPB_ONLYBITS(ptr);
643 
644   if (is_most_recent_alloc) {
645     ptrdiff_t diff = size - oldsize;
646     if ((ptrdiff_t)UPB_PRIVATE(_upb_ArenaHas)(a) >= diff) {
647       a->UPB_ONLYBITS(ptr) += diff;
648       return ptr;
649     }
650   } else if (size <= oldsize) {
651     return ptr;
652   }
653 
654   void* ret = upb_Arena_Malloc(a, size);
655 
656   if (ret && oldsize > 0) {
657     memcpy(ret, ptr, UPB_MIN(oldsize, size));
658   }
659 
660   return ret;
661 }
662 
upb_Arena_ShrinkLast(struct upb_Arena * a,void * ptr,size_t oldsize,size_t size)663 UPB_API_INLINE void upb_Arena_ShrinkLast(struct upb_Arena* a, void* ptr,
664                                          size_t oldsize, size_t size) {
665   oldsize = UPB_ALIGN_MALLOC(oldsize);
666   size = UPB_ALIGN_MALLOC(size);
667   // Must be the last alloc.
668   UPB_ASSERT((char*)ptr + oldsize ==
669              a->UPB_ONLYBITS(ptr) - UPB_ASAN_GUARD_SIZE);
670   UPB_ASSERT(size <= oldsize);
671   a->UPB_ONLYBITS(ptr) = (char*)ptr + size;
672 }
673 
674 #ifdef __cplusplus
675 } /* extern "C" */
676 #endif
677 
678 
679 #endif /* UPB_MEM_INTERNAL_ARENA_H_ */
680 
681 // Must be last.
682 
683 typedef struct upb_Arena upb_Arena;
684 
685 #ifdef __cplusplus
686 extern "C" {
687 #endif
688 
689 // Creates an arena from the given initial block (if any -- n may be 0).
690 // Additional blocks will be allocated from |alloc|.  If |alloc| is NULL, this
691 // is a fixed-size arena and cannot grow.
692 UPB_API upb_Arena* upb_Arena_Init(void* mem, size_t n, upb_alloc* alloc);
693 
694 UPB_API void upb_Arena_Free(upb_Arena* a);
695 UPB_API bool upb_Arena_Fuse(upb_Arena* a, upb_Arena* b);
696 
697 bool upb_Arena_IncRefFor(upb_Arena* a, const void* owner);
698 void upb_Arena_DecRefFor(upb_Arena* a, const void* owner);
699 
700 size_t upb_Arena_SpaceAllocated(upb_Arena* a, size_t* fused_count);
701 uint32_t upb_Arena_DebugRefCount(upb_Arena* a);
702 
upb_Arena_New(void)703 UPB_API_INLINE upb_Arena* upb_Arena_New(void) {
704   return upb_Arena_Init(NULL, 0, &upb_alloc_global);
705 }
706 
707 UPB_API_INLINE void* upb_Arena_Malloc(struct upb_Arena* a, size_t size);
708 
709 UPB_API_INLINE void* upb_Arena_Realloc(upb_Arena* a, void* ptr, size_t oldsize,
710                                        size_t size);
711 
712 // Sets the maximum block size for all arenas. This is a global configuration
713 // setting that will affect all existing and future arenas. If
714 // upb_Arena_Malloc() is called with a size larger than this, we will exceed
715 // this size and allocate a larger block.
716 //
717 // This API is meant for experimentation only. It will likely be removed in
718 // the future.
719 void upb_Arena_SetMaxBlockSize(size_t max);
720 
721 // Shrinks the last alloc from arena.
722 // REQUIRES: (ptr, oldsize) was the last malloc/realloc from this arena.
723 // We could also add a upb_Arena_TryShrinkLast() which is simply a no-op if
724 // this was not the last alloc.
725 UPB_API_INLINE void upb_Arena_ShrinkLast(upb_Arena* a, void* ptr,
726                                          size_t oldsize, size_t size);
727 
728 #ifdef UPB_TRACING_ENABLED
729 void upb_Arena_SetTraceHandler(void (*initArenaTraceHandler)(const upb_Arena*,
730                                                              size_t size),
731                                void (*fuseArenaTraceHandler)(const upb_Arena*,
732                                                              const upb_Arena*),
733                                void (*freeArenaTraceHandler)(const upb_Arena*));
734 #endif
735 
736 #ifdef __cplusplus
737 } /* extern "C" */
738 #endif
739 
740 
741 #endif /* UPB_MEM_ARENA_H_ */
742 
743 // Must be last.
744 
745 #ifdef __cplusplus
746 extern "C" {
747 #endif
748 
749 // The maximum number of bytes a single protobuf field can take up in the
750 // wire format.  We only want to do one bounds check per field, so the input
751 // stream guarantees that after upb_EpsCopyInputStream_IsDone() is called,
752 // the decoder can read this many bytes without performing another bounds
753 // check.  The stream will copy into a patch buffer as necessary to guarantee
754 // this invariant.
755 #define kUpb_EpsCopyInputStream_SlopBytes 16
756 
757 enum {
758   kUpb_EpsCopyInputStream_NoAliasing = 0,
759   kUpb_EpsCopyInputStream_OnPatch = 1,
760   kUpb_EpsCopyInputStream_NoDelta = 2
761 };
762 
763 typedef struct {
764   const char* end;        // Can read up to SlopBytes bytes beyond this.
765   const char* limit_ptr;  // For bounds checks, = end + UPB_MIN(limit, 0)
766   uintptr_t aliasing;
767   int limit;   // Submessage limit relative to end
768   bool error;  // To distinguish between EOF and error.
769   char patch[kUpb_EpsCopyInputStream_SlopBytes * 2];
770 } upb_EpsCopyInputStream;
771 
772 // Returns true if the stream is in the error state. A stream enters the error
773 // state when the user reads past a limit (caught in IsDone()) or the
774 // ZeroCopyInputStream returns an error.
upb_EpsCopyInputStream_IsError(upb_EpsCopyInputStream * e)775 UPB_INLINE bool upb_EpsCopyInputStream_IsError(upb_EpsCopyInputStream* e) {
776   return e->error;
777 }
778 
779 typedef const char* upb_EpsCopyInputStream_BufferFlipCallback(
780     upb_EpsCopyInputStream* e, const char* old_end, const char* new_start);
781 
782 typedef const char* upb_EpsCopyInputStream_IsDoneFallbackFunc(
783     upb_EpsCopyInputStream* e, const char* ptr, int overrun);
784 
785 // Initializes a upb_EpsCopyInputStream using the contents of the buffer
786 // [*ptr, size].  Updates `*ptr` as necessary to guarantee that at least
787 // kUpb_EpsCopyInputStream_SlopBytes are available to read.
upb_EpsCopyInputStream_Init(upb_EpsCopyInputStream * e,const char ** ptr,size_t size,bool enable_aliasing)788 UPB_INLINE void upb_EpsCopyInputStream_Init(upb_EpsCopyInputStream* e,
789                                             const char** ptr, size_t size,
790                                             bool enable_aliasing) {
791   if (size <= kUpb_EpsCopyInputStream_SlopBytes) {
792     memset(&e->patch, 0, 32);
793     if (size) memcpy(&e->patch, *ptr, size);
794     e->aliasing = enable_aliasing ? (uintptr_t)*ptr - (uintptr_t)e->patch
795                                   : kUpb_EpsCopyInputStream_NoAliasing;
796     *ptr = e->patch;
797     e->end = *ptr + size;
798     e->limit = 0;
799   } else {
800     e->end = *ptr + size - kUpb_EpsCopyInputStream_SlopBytes;
801     e->limit = kUpb_EpsCopyInputStream_SlopBytes;
802     e->aliasing = enable_aliasing ? kUpb_EpsCopyInputStream_NoDelta
803                                   : kUpb_EpsCopyInputStream_NoAliasing;
804   }
805   e->limit_ptr = e->end;
806   e->error = false;
807 }
808 
809 typedef enum {
810   // The current stream position is at a limit.
811   kUpb_IsDoneStatus_Done,
812 
813   // The current stream position is not at a limit.
814   kUpb_IsDoneStatus_NotDone,
815 
816   // The current stream position is not at a limit, and the stream needs to
817   // be flipped to a new buffer before more data can be read.
818   kUpb_IsDoneStatus_NeedFallback,
819 } upb_IsDoneStatus;
820 
821 // Returns the status of the current stream position.  This is a low-level
822 // function, it is simpler to call upb_EpsCopyInputStream_IsDone() if possible.
upb_EpsCopyInputStream_IsDoneStatus(upb_EpsCopyInputStream * e,const char * ptr,int * overrun)823 UPB_INLINE upb_IsDoneStatus upb_EpsCopyInputStream_IsDoneStatus(
824     upb_EpsCopyInputStream* e, const char* ptr, int* overrun) {
825   *overrun = ptr - e->end;
826   if (UPB_LIKELY(ptr < e->limit_ptr)) {
827     return kUpb_IsDoneStatus_NotDone;
828   } else if (UPB_LIKELY(*overrun == e->limit)) {
829     return kUpb_IsDoneStatus_Done;
830   } else {
831     return kUpb_IsDoneStatus_NeedFallback;
832   }
833 }
834 
835 // Returns true if the stream has hit a limit, either the current delimited
836 // limit or the overall end-of-stream. As a side effect, this function may flip
837 // the pointer to a new buffer if there are less than
838 // kUpb_EpsCopyInputStream_SlopBytes of data to be read in the current buffer.
839 //
840 // Postcondition: if the function returns false, there are at least
841 // kUpb_EpsCopyInputStream_SlopBytes of data available to read at *ptr.
upb_EpsCopyInputStream_IsDoneWithCallback(upb_EpsCopyInputStream * e,const char ** ptr,upb_EpsCopyInputStream_IsDoneFallbackFunc * func)842 UPB_INLINE bool upb_EpsCopyInputStream_IsDoneWithCallback(
843     upb_EpsCopyInputStream* e, const char** ptr,
844     upb_EpsCopyInputStream_IsDoneFallbackFunc* func) {
845   int overrun;
846   switch (upb_EpsCopyInputStream_IsDoneStatus(e, *ptr, &overrun)) {
847     case kUpb_IsDoneStatus_Done:
848       return true;
849     case kUpb_IsDoneStatus_NotDone:
850       return false;
851     case kUpb_IsDoneStatus_NeedFallback:
852       *ptr = func(e, *ptr, overrun);
853       return *ptr == NULL;
854   }
855   UPB_UNREACHABLE();
856 }
857 
858 const char* _upb_EpsCopyInputStream_IsDoneFallbackNoCallback(
859     upb_EpsCopyInputStream* e, const char* ptr, int overrun);
860 
861 // A simpler version of IsDoneWithCallback() that does not support a buffer flip
862 // callback. Useful in cases where we do not need to insert custom logic at
863 // every buffer flip.
864 //
865 // If this returns true, the user must call upb_EpsCopyInputStream_IsError()
866 // to distinguish between EOF and error.
upb_EpsCopyInputStream_IsDone(upb_EpsCopyInputStream * e,const char ** ptr)867 UPB_INLINE bool upb_EpsCopyInputStream_IsDone(upb_EpsCopyInputStream* e,
868                                               const char** ptr) {
869   return upb_EpsCopyInputStream_IsDoneWithCallback(
870       e, ptr, _upb_EpsCopyInputStream_IsDoneFallbackNoCallback);
871 }
872 
873 // Returns the total number of bytes that are safe to read from the current
874 // buffer without reading uninitialized or unallocated memory.
875 //
876 // Note that this check does not respect any semantic limits on the stream,
877 // either limits from PushLimit() or the overall stream end, so some of these
878 // bytes may have unpredictable, nonsense values in them. The guarantee is only
879 // that the bytes are valid to read from the perspective of the C language
880 // (ie. you can read without triggering UBSAN or ASAN).
upb_EpsCopyInputStream_BytesAvailable(upb_EpsCopyInputStream * e,const char * ptr)881 UPB_INLINE size_t upb_EpsCopyInputStream_BytesAvailable(
882     upb_EpsCopyInputStream* e, const char* ptr) {
883   return (e->end - ptr) + kUpb_EpsCopyInputStream_SlopBytes;
884 }
885 
886 // Returns true if the given delimited field size is valid (it does not extend
887 // beyond any previously-pushed limits).  `ptr` should point to the beginning
888 // of the field data, after the delimited size.
889 //
890 // Note that this does *not* guarantee that all of the data for this field is in
891 // the current buffer.
upb_EpsCopyInputStream_CheckSize(const upb_EpsCopyInputStream * e,const char * ptr,int size)892 UPB_INLINE bool upb_EpsCopyInputStream_CheckSize(
893     const upb_EpsCopyInputStream* e, const char* ptr, int size) {
894   UPB_ASSERT(size >= 0);
895   return ptr - e->end + size <= e->limit;
896 }
897 
_upb_EpsCopyInputStream_CheckSizeAvailable(upb_EpsCopyInputStream * e,const char * ptr,int size,bool submessage)898 UPB_INLINE bool _upb_EpsCopyInputStream_CheckSizeAvailable(
899     upb_EpsCopyInputStream* e, const char* ptr, int size, bool submessage) {
900   // This is one extra branch compared to the more normal:
901   //   return (size_t)(end - ptr) < size;
902   // However it is one less computation if we are just about to use "ptr + len":
903   //   https://godbolt.org/z/35YGPz
904   // In microbenchmarks this shows a small improvement.
905   uintptr_t uptr = (uintptr_t)ptr;
906   uintptr_t uend = (uintptr_t)e->limit_ptr;
907   uintptr_t res = uptr + (size_t)size;
908   if (!submessage) uend += kUpb_EpsCopyInputStream_SlopBytes;
909   // NOTE: this check depends on having a linear address space.  This is not
910   // technically guaranteed by uintptr_t.
911   bool ret = res >= uptr && res <= uend;
912   if (size < 0) UPB_ASSERT(!ret);
913   return ret;
914 }
915 
916 // Returns true if the given delimited field size is valid (it does not extend
917 // beyond any previously-pushed limited) *and* all of the data for this field is
918 // available to be read in the current buffer.
919 //
920 // If the size is negative, this function will always return false. This
921 // property can be useful in some cases.
upb_EpsCopyInputStream_CheckDataSizeAvailable(upb_EpsCopyInputStream * e,const char * ptr,int size)922 UPB_INLINE bool upb_EpsCopyInputStream_CheckDataSizeAvailable(
923     upb_EpsCopyInputStream* e, const char* ptr, int size) {
924   return _upb_EpsCopyInputStream_CheckSizeAvailable(e, ptr, size, false);
925 }
926 
927 // Returns true if the given sub-message size is valid (it does not extend
928 // beyond any previously-pushed limited) *and* all of the data for this
929 // sub-message is available to be parsed in the current buffer.
930 //
931 // This implies that all fields from the sub-message can be parsed from the
932 // current buffer while maintaining the invariant that we always have at least
933 // kUpb_EpsCopyInputStream_SlopBytes of data available past the beginning of
934 // any individual field start.
935 //
936 // If the size is negative, this function will always return false. This
937 // property can be useful in some cases.
upb_EpsCopyInputStream_CheckSubMessageSizeAvailable(upb_EpsCopyInputStream * e,const char * ptr,int size)938 UPB_INLINE bool upb_EpsCopyInputStream_CheckSubMessageSizeAvailable(
939     upb_EpsCopyInputStream* e, const char* ptr, int size) {
940   return _upb_EpsCopyInputStream_CheckSizeAvailable(e, ptr, size, true);
941 }
942 
943 // Returns true if aliasing_enabled=true was passed to
944 // upb_EpsCopyInputStream_Init() when this stream was initialized.
upb_EpsCopyInputStream_AliasingEnabled(upb_EpsCopyInputStream * e)945 UPB_INLINE bool upb_EpsCopyInputStream_AliasingEnabled(
946     upb_EpsCopyInputStream* e) {
947   return e->aliasing != kUpb_EpsCopyInputStream_NoAliasing;
948 }
949 
950 // Returns true if aliasing_enabled=true was passed to
951 // upb_EpsCopyInputStream_Init() when this stream was initialized *and* we can
952 // alias into the region [ptr, size] in an input buffer.
upb_EpsCopyInputStream_AliasingAvailable(upb_EpsCopyInputStream * e,const char * ptr,size_t size)953 UPB_INLINE bool upb_EpsCopyInputStream_AliasingAvailable(
954     upb_EpsCopyInputStream* e, const char* ptr, size_t size) {
955   // When EpsCopyInputStream supports streaming, this will need to become a
956   // runtime check.
957   return upb_EpsCopyInputStream_CheckDataSizeAvailable(e, ptr, size) &&
958          e->aliasing >= kUpb_EpsCopyInputStream_NoDelta;
959 }
960 
961 // Returns a pointer into an input buffer that corresponds to the parsing
962 // pointer `ptr`.  The returned pointer may be the same as `ptr`, but also may
963 // be different if we are currently parsing out of the patch buffer.
964 //
965 // REQUIRES: Aliasing must be available for the given pointer. If the input is a
966 // flat buffer and aliasing is enabled, then aliasing will always be available.
upb_EpsCopyInputStream_GetAliasedPtr(upb_EpsCopyInputStream * e,const char * ptr)967 UPB_INLINE const char* upb_EpsCopyInputStream_GetAliasedPtr(
968     upb_EpsCopyInputStream* e, const char* ptr) {
969   UPB_ASSUME(upb_EpsCopyInputStream_AliasingAvailable(e, ptr, 0));
970   uintptr_t delta =
971       e->aliasing == kUpb_EpsCopyInputStream_NoDelta ? 0 : e->aliasing;
972   return (const char*)((uintptr_t)ptr + delta);
973 }
974 
975 // Reads string data from the input, aliasing into the input buffer instead of
976 // copying. The parsing pointer is passed in `*ptr`, and will be updated if
977 // necessary to point to the actual input buffer. Returns the new parsing
978 // pointer, which will be advanced past the string data.
979 //
980 // REQUIRES: Aliasing must be available for this data region (test with
981 // upb_EpsCopyInputStream_AliasingAvailable().
upb_EpsCopyInputStream_ReadStringAliased(upb_EpsCopyInputStream * e,const char ** ptr,size_t size)982 UPB_INLINE const char* upb_EpsCopyInputStream_ReadStringAliased(
983     upb_EpsCopyInputStream* e, const char** ptr, size_t size) {
984   UPB_ASSUME(upb_EpsCopyInputStream_AliasingAvailable(e, *ptr, size));
985   const char* ret = *ptr + size;
986   *ptr = upb_EpsCopyInputStream_GetAliasedPtr(e, *ptr);
987   UPB_ASSUME(ret != NULL);
988   return ret;
989 }
990 
991 // Skips `size` bytes of data from the input and returns a pointer past the end.
992 // Returns NULL on end of stream or error.
upb_EpsCopyInputStream_Skip(upb_EpsCopyInputStream * e,const char * ptr,int size)993 UPB_INLINE const char* upb_EpsCopyInputStream_Skip(upb_EpsCopyInputStream* e,
994                                                    const char* ptr, int size) {
995   if (!upb_EpsCopyInputStream_CheckDataSizeAvailable(e, ptr, size)) return NULL;
996   return ptr + size;
997 }
998 
999 // Copies `size` bytes of data from the input `ptr` into the buffer `to`, and
1000 // 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)1001 UPB_INLINE const char* upb_EpsCopyInputStream_Copy(upb_EpsCopyInputStream* e,
1002                                                    const char* ptr, void* to,
1003                                                    int size) {
1004   if (!upb_EpsCopyInputStream_CheckDataSizeAvailable(e, ptr, size)) return NULL;
1005   memcpy(to, ptr, size);
1006   return ptr + size;
1007 }
1008 
1009 // Reads string data from the stream and advances the pointer accordingly.
1010 // If aliasing was enabled when the stream was initialized, then the returned
1011 // pointer will point into the input buffer if possible, otherwise new data
1012 // will be allocated from arena and copied into. We may be forced to copy even
1013 // if aliasing was enabled if the input data spans input buffers.
1014 //
1015 // 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)1016 UPB_INLINE const char* upb_EpsCopyInputStream_ReadString(
1017     upb_EpsCopyInputStream* e, const char** ptr, size_t size,
1018     upb_Arena* arena) {
1019   if (upb_EpsCopyInputStream_AliasingAvailable(e, *ptr, size)) {
1020     return upb_EpsCopyInputStream_ReadStringAliased(e, ptr, size);
1021   } else {
1022     // We need to allocate and copy.
1023     if (!upb_EpsCopyInputStream_CheckDataSizeAvailable(e, *ptr, size)) {
1024       return NULL;
1025     }
1026     UPB_ASSERT(arena);
1027     char* data = (char*)upb_Arena_Malloc(arena, size);
1028     if (!data) return NULL;
1029     const char* ret = upb_EpsCopyInputStream_Copy(e, *ptr, data, size);
1030     *ptr = data;
1031     return ret;
1032   }
1033 }
1034 
_upb_EpsCopyInputStream_CheckLimit(upb_EpsCopyInputStream * e)1035 UPB_INLINE void _upb_EpsCopyInputStream_CheckLimit(upb_EpsCopyInputStream* e) {
1036   UPB_ASSERT(e->limit_ptr == e->end + UPB_MIN(0, e->limit));
1037 }
1038 
1039 // Pushes a limit onto the stack of limits for the current stream.  The limit
1040 // will extend for `size` bytes beyond the position in `ptr`.  Future calls to
1041 // upb_EpsCopyInputStream_IsDone() will return `true` when the stream position
1042 // reaches this limit.
1043 //
1044 // Returns a delta that the caller must store and supply to PopLimit() below.
upb_EpsCopyInputStream_PushLimit(upb_EpsCopyInputStream * e,const char * ptr,int size)1045 UPB_INLINE int upb_EpsCopyInputStream_PushLimit(upb_EpsCopyInputStream* e,
1046                                                 const char* ptr, int size) {
1047   int limit = size + (int)(ptr - e->end);
1048   int delta = e->limit - limit;
1049   _upb_EpsCopyInputStream_CheckLimit(e);
1050   UPB_ASSERT(limit <= e->limit);
1051   e->limit = limit;
1052   e->limit_ptr = e->end + UPB_MIN(0, limit);
1053   _upb_EpsCopyInputStream_CheckLimit(e);
1054   return delta;
1055 }
1056 
1057 // Pops the last limit that was pushed on this stream.  This may only be called
1058 // once IsDone() returns true.  The user must pass the delta that was returned
1059 // from PushLimit().
upb_EpsCopyInputStream_PopLimit(upb_EpsCopyInputStream * e,const char * ptr,int saved_delta)1060 UPB_INLINE void upb_EpsCopyInputStream_PopLimit(upb_EpsCopyInputStream* e,
1061                                                 const char* ptr,
1062                                                 int saved_delta) {
1063   UPB_ASSERT(ptr - e->end == e->limit);
1064   _upb_EpsCopyInputStream_CheckLimit(e);
1065   e->limit += saved_delta;
1066   e->limit_ptr = e->end + UPB_MIN(0, e->limit);
1067   _upb_EpsCopyInputStream_CheckLimit(e);
1068 }
1069 
_upb_EpsCopyInputStream_IsDoneFallbackInline(upb_EpsCopyInputStream * e,const char * ptr,int overrun,upb_EpsCopyInputStream_BufferFlipCallback * callback)1070 UPB_INLINE const char* _upb_EpsCopyInputStream_IsDoneFallbackInline(
1071     upb_EpsCopyInputStream* e, const char* ptr, int overrun,
1072     upb_EpsCopyInputStream_BufferFlipCallback* callback) {
1073   if (overrun < e->limit) {
1074     // Need to copy remaining data into patch buffer.
1075     UPB_ASSERT(overrun < kUpb_EpsCopyInputStream_SlopBytes);
1076     const char* old_end = ptr;
1077     const char* new_start = &e->patch[0] + overrun;
1078     memset(e->patch + kUpb_EpsCopyInputStream_SlopBytes, 0,
1079            kUpb_EpsCopyInputStream_SlopBytes);
1080     memcpy(e->patch, e->end, kUpb_EpsCopyInputStream_SlopBytes);
1081     ptr = new_start;
1082     e->end = &e->patch[kUpb_EpsCopyInputStream_SlopBytes];
1083     e->limit -= kUpb_EpsCopyInputStream_SlopBytes;
1084     e->limit_ptr = e->end + e->limit;
1085     UPB_ASSERT(ptr < e->limit_ptr);
1086     if (e->aliasing != kUpb_EpsCopyInputStream_NoAliasing) {
1087       e->aliasing = (uintptr_t)old_end - (uintptr_t)new_start;
1088     }
1089     return callback(e, old_end, new_start);
1090   } else {
1091     UPB_ASSERT(overrun > e->limit);
1092     e->error = true;
1093     return callback(e, NULL, NULL);
1094   }
1095 }
1096 
1097 typedef const char* upb_EpsCopyInputStream_ParseDelimitedFunc(
1098     upb_EpsCopyInputStream* e, const char* ptr, void* ctx);
1099 
1100 // Tries to perform a fast-path handling of the given delimited message data.
1101 // If the sub-message beginning at `*ptr` and extending for `len` is short and
1102 // fits within this buffer, calls `func` with `ctx` as a parameter, where the
1103 // pushing and popping of limits is handled automatically and with lower cost
1104 // than the normal PushLimit()/PopLimit() sequence.
upb_EpsCopyInputStream_TryParseDelimitedFast(upb_EpsCopyInputStream * e,const char ** ptr,int len,upb_EpsCopyInputStream_ParseDelimitedFunc * func,void * ctx)1105 UPB_FORCEINLINE bool upb_EpsCopyInputStream_TryParseDelimitedFast(
1106     upb_EpsCopyInputStream* e, const char** ptr, int len,
1107     upb_EpsCopyInputStream_ParseDelimitedFunc* func, void* ctx) {
1108   if (!upb_EpsCopyInputStream_CheckSubMessageSizeAvailable(e, *ptr, len)) {
1109     return false;
1110   }
1111 
1112   // Fast case: Sub-message is <128 bytes and fits in the current buffer.
1113   // This means we can preserve limit/limit_ptr verbatim.
1114   const char* saved_limit_ptr = e->limit_ptr;
1115   int saved_limit = e->limit;
1116   e->limit_ptr = *ptr + len;
1117   e->limit = e->limit_ptr - e->end;
1118   UPB_ASSERT(e->limit_ptr == e->end + UPB_MIN(0, e->limit));
1119   *ptr = func(e, *ptr, ctx);
1120   e->limit_ptr = saved_limit_ptr;
1121   e->limit = saved_limit;
1122   UPB_ASSERT(e->limit_ptr == e->end + UPB_MIN(0, e->limit));
1123   return true;
1124 }
1125 
1126 #ifdef __cplusplus
1127 } /* extern "C" */
1128 #endif
1129 
1130 
1131 #endif  // UPB_WIRE_EPS_COPY_INPUT_STREAM_H_
1132 
1133 #ifndef UPB_JSON_DECODE_H_
1134 #define UPB_JSON_DECODE_H_
1135 
1136 #include <stddef.h>
1137 
1138 
1139 // Public APIs for message operations that do not depend on the schema.
1140 //
1141 // MiniTable-based accessors live in accessors.h.
1142 
1143 #ifndef UPB_MESSAGE_MESSAGE_H_
1144 #define UPB_MESSAGE_MESSAGE_H_
1145 
1146 #include <stddef.h>
1147 
1148 
1149 /*
1150 ** Our memory representation for parsing tables and messages themselves.
1151 ** Functions in this file are used by generated code and possibly reflection.
1152 **
1153 ** The definitions in this file are internal to upb.
1154 **/
1155 
1156 #ifndef UPB_MESSAGE_INTERNAL_MESSAGE_H_
1157 #define UPB_MESSAGE_INTERNAL_MESSAGE_H_
1158 
1159 #include <stdlib.h>
1160 #include <string.h>
1161 
1162 
1163 #ifndef UPB_MESSAGE_INTERNAL_EXTENSION_H_
1164 #define UPB_MESSAGE_INTERNAL_EXTENSION_H_
1165 
1166 #include <stddef.h>
1167 
1168 
1169 // Users should include array.h or map.h instead.
1170 // IWYU pragma: private, include "upb/message/array.h"
1171 
1172 #ifndef UPB_MESSAGE_VALUE_H_
1173 #define UPB_MESSAGE_VALUE_H_
1174 
1175 #include <stdint.h>
1176 #include <string.h>
1177 
1178 #ifndef UPB_BASE_STRING_VIEW_H_
1179 #define UPB_BASE_STRING_VIEW_H_
1180 
1181 #include <string.h>
1182 
1183 // Must be last.
1184 
1185 #define UPB_STRINGVIEW_INIT(ptr, len) \
1186   { ptr, len }
1187 
1188 #define UPB_STRINGVIEW_FORMAT "%.*s"
1189 #define UPB_STRINGVIEW_ARGS(view) (int)(view).size, (view).data
1190 
1191 // LINT.IfChange(struct_definition)
1192 typedef struct {
1193   const char* data;
1194   size_t size;
1195 } upb_StringView;
1196 
1197 #ifdef __cplusplus
1198 extern "C" {
1199 #endif
1200 
upb_StringView_FromDataAndSize(const char * data,size_t size)1201 UPB_API_INLINE upb_StringView upb_StringView_FromDataAndSize(const char* data,
1202                                                              size_t size) {
1203   upb_StringView ret;
1204   ret.data = data;
1205   ret.size = size;
1206   return ret;
1207 }
1208 
upb_StringView_FromString(const char * data)1209 UPB_INLINE upb_StringView upb_StringView_FromString(const char* data) {
1210   return upb_StringView_FromDataAndSize(data, strlen(data));
1211 }
1212 
upb_StringView_IsEqual(upb_StringView a,upb_StringView b)1213 UPB_INLINE bool upb_StringView_IsEqual(upb_StringView a, upb_StringView b) {
1214   return (a.size == b.size) && (!a.size || !memcmp(a.data, b.data, a.size));
1215 }
1216 
1217 // LINT.ThenChange(
1218 //  GoogleInternalName1,
1219 //  //depot/google3/third_party/upb/bits/golang/accessor.go:map_go_string,
1220 //  //depot/google3/third_party/upb/bits/typescript/string_view.ts
1221 // )
1222 
1223 #ifdef __cplusplus
1224 } /* extern "C" */
1225 #endif
1226 
1227 
1228 #endif /* UPB_BASE_STRING_VIEW_H_ */
1229 
1230 // Must be last.
1231 
1232 #ifdef __cplusplus
1233 extern "C" {
1234 #endif
1235 
1236 typedef union {
1237   bool bool_val;
1238   float float_val;
1239   double double_val;
1240   int32_t int32_val;
1241   int64_t int64_val;
1242   uint32_t uint32_val;
1243   uint64_t uint64_val;
1244   const struct upb_Array* array_val;
1245   const struct upb_Map* map_val;
1246   const struct upb_Message* msg_val;
1247   upb_StringView str_val;
1248 
1249   // EXPERIMENTAL: A tagged upb_Message*.  Users must use this instead of
1250   // msg_val if unlinked sub-messages may possibly be in use.  See the
1251   // documentation in kUpb_DecodeOption_ExperimentalAllowUnlinked for more
1252   // information.
1253   uintptr_t tagged_msg_val;  // upb_TaggedMessagePtr
1254 } upb_MessageValue;
1255 
upb_MessageValue_Zero(void)1256 UPB_API_INLINE upb_MessageValue upb_MessageValue_Zero(void) {
1257   upb_MessageValue zero;
1258   memset(&zero, 0, sizeof(zero));
1259   return zero;
1260 }
1261 
1262 typedef union {
1263   struct upb_Array* array;
1264   struct upb_Map* map;
1265   struct upb_Message* msg;
1266 } upb_MutableMessageValue;
1267 
upb_MutableMessageValue_Zero(void)1268 UPB_API_INLINE upb_MutableMessageValue upb_MutableMessageValue_Zero(void) {
1269   upb_MutableMessageValue zero;
1270   memset(&zero, 0, sizeof(zero));
1271   return zero;
1272 }
1273 
1274 #ifdef __cplusplus
1275 } /* extern "C" */
1276 #endif
1277 
1278 
1279 #endif /* UPB_MESSAGE_VALUE_H_ */
1280 
1281 #ifndef UPB_MINI_TABLE_EXTENSION_H_
1282 #define UPB_MINI_TABLE_EXTENSION_H_
1283 
1284 #include <stdint.h>
1285 
1286 
1287 #ifndef UPB_BASE_DESCRIPTOR_CONSTANTS_H_
1288 #define UPB_BASE_DESCRIPTOR_CONSTANTS_H_
1289 
1290 // Must be last.
1291 
1292 // The types a field can have. Note that this list is not identical to the
1293 // types defined in descriptor.proto, which gives INT32 and SINT32 separate
1294 // types (we distinguish the two with the "integer encoding" enum below).
1295 // This enum is an internal convenience only and has no meaning outside of upb.
1296 typedef enum {
1297   kUpb_CType_Bool = 1,
1298   kUpb_CType_Float = 2,
1299   kUpb_CType_Int32 = 3,
1300   kUpb_CType_UInt32 = 4,
1301   kUpb_CType_Enum = 5,  // Enum values are int32. TODO: rename
1302   kUpb_CType_Message = 6,
1303   kUpb_CType_Double = 7,
1304   kUpb_CType_Int64 = 8,
1305   kUpb_CType_UInt64 = 9,
1306   kUpb_CType_String = 10,
1307   kUpb_CType_Bytes = 11
1308 } upb_CType;
1309 
1310 // The repeated-ness of each field; this matches descriptor.proto.
1311 typedef enum {
1312   kUpb_Label_Optional = 1,
1313   kUpb_Label_Required = 2,
1314   kUpb_Label_Repeated = 3
1315 } upb_Label;
1316 
1317 // Descriptor types, as defined in descriptor.proto.
1318 typedef enum {
1319   kUpb_FieldType_Double = 1,
1320   kUpb_FieldType_Float = 2,
1321   kUpb_FieldType_Int64 = 3,
1322   kUpb_FieldType_UInt64 = 4,
1323   kUpb_FieldType_Int32 = 5,
1324   kUpb_FieldType_Fixed64 = 6,
1325   kUpb_FieldType_Fixed32 = 7,
1326   kUpb_FieldType_Bool = 8,
1327   kUpb_FieldType_String = 9,
1328   kUpb_FieldType_Group = 10,
1329   kUpb_FieldType_Message = 11,
1330   kUpb_FieldType_Bytes = 12,
1331   kUpb_FieldType_UInt32 = 13,
1332   kUpb_FieldType_Enum = 14,
1333   kUpb_FieldType_SFixed32 = 15,
1334   kUpb_FieldType_SFixed64 = 16,
1335   kUpb_FieldType_SInt32 = 17,
1336   kUpb_FieldType_SInt64 = 18,
1337 } upb_FieldType;
1338 
1339 #define kUpb_FieldType_SizeOf 19
1340 
1341 #ifdef __cplusplus
1342 extern "C" {
1343 #endif
1344 
1345 // Convert from upb_FieldType to upb_CType
upb_FieldType_CType(upb_FieldType field_type)1346 UPB_INLINE upb_CType upb_FieldType_CType(upb_FieldType field_type) {
1347   static const upb_CType c_type[] = {
1348       kUpb_CType_Double,   // kUpb_FieldType_Double
1349       kUpb_CType_Float,    // kUpb_FieldType_Float
1350       kUpb_CType_Int64,    // kUpb_FieldType_Int64
1351       kUpb_CType_UInt64,   // kUpb_FieldType_UInt64
1352       kUpb_CType_Int32,    // kUpb_FieldType_Int32
1353       kUpb_CType_UInt64,   // kUpb_FieldType_Fixed64
1354       kUpb_CType_UInt32,   // kUpb_FieldType_Fixed32
1355       kUpb_CType_Bool,     // kUpb_FieldType_Bool
1356       kUpb_CType_String,   // kUpb_FieldType_String
1357       kUpb_CType_Message,  // kUpb_FieldType_Group
1358       kUpb_CType_Message,  // kUpb_FieldType_Message
1359       kUpb_CType_Bytes,    // kUpb_FieldType_Bytes
1360       kUpb_CType_UInt32,   // kUpb_FieldType_UInt32
1361       kUpb_CType_Enum,     // kUpb_FieldType_Enum
1362       kUpb_CType_Int32,    // kUpb_FieldType_SFixed32
1363       kUpb_CType_Int64,    // kUpb_FieldType_SFixed64
1364       kUpb_CType_Int32,    // kUpb_FieldType_SInt32
1365       kUpb_CType_Int64,    // kUpb_FieldType_SInt64
1366   };
1367 
1368   // -1 here because the enum is one-based but the table is zero-based.
1369   return c_type[field_type - 1];
1370 }
1371 
upb_FieldType_IsPackable(upb_FieldType field_type)1372 UPB_INLINE bool upb_FieldType_IsPackable(upb_FieldType field_type) {
1373   // clang-format off
1374   const unsigned kUnpackableTypes =
1375       (1 << kUpb_FieldType_String) |
1376       (1 << kUpb_FieldType_Bytes) |
1377       (1 << kUpb_FieldType_Message) |
1378       (1 << kUpb_FieldType_Group);
1379   // clang-format on
1380   return (1 << field_type) & ~kUnpackableTypes;
1381 }
1382 
1383 #ifdef __cplusplus
1384 } /* extern "C" */
1385 #endif
1386 
1387 
1388 #endif /* UPB_BASE_DESCRIPTOR_CONSTANTS_H_ */
1389 
1390 #ifndef UPB_MINI_TABLE_INTERNAL_EXTENSION_H_
1391 #define UPB_MINI_TABLE_INTERNAL_EXTENSION_H_
1392 
1393 #include <stddef.h>
1394 #include <stdint.h>
1395 
1396 
1397 #ifndef UPB_MINI_TABLE_INTERNAL_FIELD_H_
1398 #define UPB_MINI_TABLE_INTERNAL_FIELD_H_
1399 
1400 #include <stddef.h>
1401 #include <stdint.h>
1402 
1403 
1404 #ifndef UPB_MINI_TABLE_INTERNAL_SIZE_LOG2_H_
1405 #define UPB_MINI_TABLE_INTERNAL_SIZE_LOG2_H_
1406 
1407 #include <stddef.h>
1408 #include <stdint.h>
1409 
1410 
1411 // Must be last.
1412 
1413 #ifdef __cplusplus
1414 extern "C" {
1415 #endif
1416 
1417 // Return the log2 of the storage size in bytes for a upb_CType
UPB_PRIVATE(_upb_CType_SizeLg2)1418 UPB_INLINE int UPB_PRIVATE(_upb_CType_SizeLg2)(upb_CType c_type) {
1419   static const int8_t size[] = {
1420       0,               // kUpb_CType_Bool
1421       2,               // kUpb_CType_Float
1422       2,               // kUpb_CType_Int32
1423       2,               // kUpb_CType_UInt32
1424       2,               // kUpb_CType_Enum
1425       UPB_SIZE(2, 3),  // kUpb_CType_Message
1426       3,               // kUpb_CType_Double
1427       3,               // kUpb_CType_Int64
1428       3,               // kUpb_CType_UInt64
1429       UPB_SIZE(3, 4),  // kUpb_CType_String
1430       UPB_SIZE(3, 4),  // kUpb_CType_Bytes
1431   };
1432 
1433   // -1 here because the enum is one-based but the table is zero-based.
1434   return size[c_type - 1];
1435 }
1436 
1437 // Return the log2 of the storage size in bytes for a upb_FieldType
UPB_PRIVATE(_upb_FieldType_SizeLg2)1438 UPB_INLINE int UPB_PRIVATE(_upb_FieldType_SizeLg2)(upb_FieldType field_type) {
1439   static const int8_t size[] = {
1440       3,               // kUpb_FieldType_Double
1441       2,               // kUpb_FieldType_Float
1442       3,               // kUpb_FieldType_Int64
1443       3,               // kUpb_FieldType_UInt64
1444       2,               // kUpb_FieldType_Int32
1445       3,               // kUpb_FieldType_Fixed64
1446       2,               // kUpb_FieldType_Fixed32
1447       0,               // kUpb_FieldType_Bool
1448       UPB_SIZE(3, 4),  // kUpb_FieldType_String
1449       UPB_SIZE(2, 3),  // kUpb_FieldType_Group
1450       UPB_SIZE(2, 3),  // kUpb_FieldType_Message
1451       UPB_SIZE(3, 4),  // kUpb_FieldType_Bytes
1452       2,               // kUpb_FieldType_UInt32
1453       2,               // kUpb_FieldType_Enum
1454       2,               // kUpb_FieldType_SFixed32
1455       3,               // kUpb_FieldType_SFixed64
1456       2,               // kUpb_FieldType_SInt32
1457       3,               // kUpb_FieldType_SInt64
1458   };
1459 
1460   // -1 here because the enum is one-based but the table is zero-based.
1461   return size[field_type - 1];
1462 }
1463 
1464 #ifdef __cplusplus
1465 } /* extern "C" */
1466 #endif
1467 
1468 
1469 #endif /* UPB_MINI_TABLE_INTERNAL_SIZE_LOG2_H_ */
1470 
1471 // Must be last.
1472 
1473 // LINT.IfChange(struct_definition)
1474 struct upb_MiniTableField {
1475   uint32_t UPB_ONLYBITS(number);
1476   uint16_t UPB_ONLYBITS(offset);
1477   int16_t presence;  // If >0, hasbit_index.  If <0, ~oneof_index
1478 
1479   // Indexes into `upb_MiniTable.subs`
1480   // Will be set to `kUpb_NoSub` if `descriptortype` != MESSAGE/GROUP/ENUM
1481   uint16_t UPB_PRIVATE(submsg_index);
1482 
1483   uint8_t UPB_PRIVATE(descriptortype);
1484 
1485   // upb_FieldMode | upb_LabelFlags | (upb_FieldRep << kUpb_FieldRep_Shift)
1486   uint8_t UPB_ONLYBITS(mode);
1487 };
1488 
1489 #define kUpb_NoSub ((uint16_t) - 1)
1490 
1491 typedef enum {
1492   kUpb_FieldMode_Map = 0,
1493   kUpb_FieldMode_Array = 1,
1494   kUpb_FieldMode_Scalar = 2,
1495 } upb_FieldMode;
1496 
1497 // Mask to isolate the upb_FieldMode from field.mode.
1498 #define kUpb_FieldMode_Mask 3
1499 
1500 // Extra flags on the mode field.
1501 typedef enum {
1502   kUpb_LabelFlags_IsPacked = 4,
1503   kUpb_LabelFlags_IsExtension = 8,
1504   // Indicates that this descriptor type is an "alternate type":
1505   //   - for Int32, this indicates that the actual type is Enum (but was
1506   //     rewritten to Int32 because it is an open enum that requires no check).
1507   //   - for Bytes, this indicates that the actual type is String (but does
1508   //     not require any UTF-8 check).
1509   kUpb_LabelFlags_IsAlternate = 16,
1510 } upb_LabelFlags;
1511 
1512 // Note: we sort by this number when calculating layout order.
1513 typedef enum {
1514   kUpb_FieldRep_1Byte = 0,
1515   kUpb_FieldRep_4Byte = 1,
1516   kUpb_FieldRep_StringView = 2,
1517   kUpb_FieldRep_8Byte = 3,
1518 
1519   kUpb_FieldRep_NativePointer =
1520       UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte),
1521   kUpb_FieldRep_Max = kUpb_FieldRep_8Byte,
1522 } upb_FieldRep;
1523 
1524 #define kUpb_FieldRep_Shift 6
1525 
1526 #ifdef __cplusplus
1527 extern "C" {
1528 #endif
1529 
1530 UPB_INLINE upb_FieldMode
UPB_PRIVATE(_upb_MiniTableField_Mode)1531 UPB_PRIVATE(_upb_MiniTableField_Mode)(const struct upb_MiniTableField* f) {
1532   return (upb_FieldMode)(f->UPB_ONLYBITS(mode) & kUpb_FieldMode_Mask);
1533 }
1534 
1535 UPB_INLINE upb_FieldRep
UPB_PRIVATE(_upb_MiniTableField_GetRep)1536 UPB_PRIVATE(_upb_MiniTableField_GetRep)(const struct upb_MiniTableField* f) {
1537   return (upb_FieldRep)(f->UPB_ONLYBITS(mode) >> kUpb_FieldRep_Shift);
1538 }
1539 
upb_MiniTableField_IsArray(const struct upb_MiniTableField * f)1540 UPB_API_INLINE bool upb_MiniTableField_IsArray(
1541     const struct upb_MiniTableField* f) {
1542   return UPB_PRIVATE(_upb_MiniTableField_Mode)(f) == kUpb_FieldMode_Array;
1543 }
1544 
upb_MiniTableField_IsMap(const struct upb_MiniTableField * f)1545 UPB_API_INLINE bool upb_MiniTableField_IsMap(
1546     const struct upb_MiniTableField* f) {
1547   return UPB_PRIVATE(_upb_MiniTableField_Mode)(f) == kUpb_FieldMode_Map;
1548 }
1549 
upb_MiniTableField_IsScalar(const struct upb_MiniTableField * f)1550 UPB_API_INLINE bool upb_MiniTableField_IsScalar(
1551     const struct upb_MiniTableField* f) {
1552   return UPB_PRIVATE(_upb_MiniTableField_Mode)(f) == kUpb_FieldMode_Scalar;
1553 }
1554 
UPB_PRIVATE(_upb_MiniTableField_IsAlternate)1555 UPB_INLINE bool UPB_PRIVATE(_upb_MiniTableField_IsAlternate)(
1556     const struct upb_MiniTableField* f) {
1557   return (f->UPB_ONLYBITS(mode) & kUpb_LabelFlags_IsAlternate) != 0;
1558 }
1559 
upb_MiniTableField_IsExtension(const struct upb_MiniTableField * f)1560 UPB_API_INLINE bool upb_MiniTableField_IsExtension(
1561     const struct upb_MiniTableField* f) {
1562   return (f->UPB_ONLYBITS(mode) & kUpb_LabelFlags_IsExtension) != 0;
1563 }
1564 
upb_MiniTableField_IsPacked(const struct upb_MiniTableField * f)1565 UPB_API_INLINE bool upb_MiniTableField_IsPacked(
1566     const struct upb_MiniTableField* f) {
1567   return (f->UPB_ONLYBITS(mode) & kUpb_LabelFlags_IsPacked) != 0;
1568 }
1569 
1570 UPB_API_INLINE upb_FieldType
upb_MiniTableField_Type(const struct upb_MiniTableField * f)1571 upb_MiniTableField_Type(const struct upb_MiniTableField* f) {
1572   const upb_FieldType type = (upb_FieldType)f->UPB_PRIVATE(descriptortype);
1573   if (UPB_PRIVATE(_upb_MiniTableField_IsAlternate)(f)) {
1574     if (type == kUpb_FieldType_Int32) return kUpb_FieldType_Enum;
1575     if (type == kUpb_FieldType_Bytes) return kUpb_FieldType_String;
1576     UPB_ASSERT(false);
1577   }
1578   return type;
1579 }
1580 
1581 UPB_API_INLINE
upb_MiniTableField_CType(const struct upb_MiniTableField * f)1582 upb_CType upb_MiniTableField_CType(const struct upb_MiniTableField* f) {
1583   return upb_FieldType_CType(upb_MiniTableField_Type(f));
1584 }
1585 
UPB_PRIVATE(_upb_MiniTableField_HasHasbit)1586 UPB_INLINE bool UPB_PRIVATE(_upb_MiniTableField_HasHasbit)(
1587     const struct upb_MiniTableField* f) {
1588   return f->presence > 0;
1589 }
1590 
UPB_PRIVATE(_upb_MiniTableField_HasbitMask)1591 UPB_INLINE char UPB_PRIVATE(_upb_MiniTableField_HasbitMask)(
1592     const struct upb_MiniTableField* f) {
1593   UPB_ASSERT(UPB_PRIVATE(_upb_MiniTableField_HasHasbit)(f));
1594   const size_t index = f->presence;
1595   return 1 << (index % 8);
1596 }
1597 
UPB_PRIVATE(_upb_MiniTableField_HasbitOffset)1598 UPB_INLINE size_t UPB_PRIVATE(_upb_MiniTableField_HasbitOffset)(
1599     const struct upb_MiniTableField* f) {
1600   UPB_ASSERT(UPB_PRIVATE(_upb_MiniTableField_HasHasbit)(f));
1601   const size_t index = f->presence;
1602   return index / 8;
1603 }
1604 
upb_MiniTableField_IsClosedEnum(const struct upb_MiniTableField * f)1605 UPB_API_INLINE bool upb_MiniTableField_IsClosedEnum(
1606     const struct upb_MiniTableField* f) {
1607   return f->UPB_PRIVATE(descriptortype) == kUpb_FieldType_Enum;
1608 }
1609 
upb_MiniTableField_IsInOneof(const struct upb_MiniTableField * f)1610 UPB_API_INLINE bool upb_MiniTableField_IsInOneof(
1611     const struct upb_MiniTableField* f) {
1612   return f->presence < 0;
1613 }
1614 
upb_MiniTableField_IsSubMessage(const struct upb_MiniTableField * f)1615 UPB_API_INLINE bool upb_MiniTableField_IsSubMessage(
1616     const struct upb_MiniTableField* f) {
1617   return f->UPB_PRIVATE(descriptortype) == kUpb_FieldType_Message ||
1618          f->UPB_PRIVATE(descriptortype) == kUpb_FieldType_Group;
1619 }
1620 
upb_MiniTableField_HasPresence(const struct upb_MiniTableField * f)1621 UPB_API_INLINE bool upb_MiniTableField_HasPresence(
1622     const struct upb_MiniTableField* f) {
1623   if (upb_MiniTableField_IsExtension(f)) {
1624     return upb_MiniTableField_IsScalar(f);
1625   } else {
1626     return f->presence != 0;
1627   }
1628 }
1629 
1630 UPB_API_INLINE uint32_t
upb_MiniTableField_Number(const struct upb_MiniTableField * f)1631 upb_MiniTableField_Number(const struct upb_MiniTableField* f) {
1632   return f->UPB_ONLYBITS(number);
1633 }
1634 
1635 UPB_INLINE uint16_t
UPB_PRIVATE(_upb_MiniTableField_Offset)1636 UPB_PRIVATE(_upb_MiniTableField_Offset)(const struct upb_MiniTableField* f) {
1637   return f->UPB_ONLYBITS(offset);
1638 }
1639 
UPB_PRIVATE(_upb_MiniTableField_OneofOffset)1640 UPB_INLINE size_t UPB_PRIVATE(_upb_MiniTableField_OneofOffset)(
1641     const struct upb_MiniTableField* f) {
1642   UPB_ASSERT(upb_MiniTableField_IsInOneof(f));
1643   return ~(ptrdiff_t)f->presence;
1644 }
1645 
UPB_PRIVATE(_upb_MiniTableField_CheckIsArray)1646 UPB_INLINE void UPB_PRIVATE(_upb_MiniTableField_CheckIsArray)(
1647     const struct upb_MiniTableField* f) {
1648   UPB_ASSUME(UPB_PRIVATE(_upb_MiniTableField_GetRep)(f) ==
1649              kUpb_FieldRep_NativePointer);
1650   UPB_ASSUME(upb_MiniTableField_IsArray(f));
1651   UPB_ASSUME(f->presence == 0);
1652 }
1653 
UPB_PRIVATE(_upb_MiniTableField_CheckIsMap)1654 UPB_INLINE void UPB_PRIVATE(_upb_MiniTableField_CheckIsMap)(
1655     const struct upb_MiniTableField* f) {
1656   UPB_ASSUME(UPB_PRIVATE(_upb_MiniTableField_GetRep)(f) ==
1657              kUpb_FieldRep_NativePointer);
1658   UPB_ASSUME(upb_MiniTableField_IsMap(f));
1659   UPB_ASSUME(f->presence == 0);
1660 }
1661 
UPB_PRIVATE(_upb_MiniTableField_ElemSizeLg2)1662 UPB_INLINE size_t UPB_PRIVATE(_upb_MiniTableField_ElemSizeLg2)(
1663     const struct upb_MiniTableField* f) {
1664   const upb_FieldType field_type = upb_MiniTableField_Type(f);
1665   return UPB_PRIVATE(_upb_FieldType_SizeLg2)(field_type);
1666 }
1667 
1668 // LINT.ThenChange(//depot/google3/third_party/upb/bits/typescript/mini_table_field.ts)
1669 
1670 #ifdef __cplusplus
1671 } /* extern "C" */
1672 #endif
1673 
1674 
1675 #endif /* UPB_MINI_TABLE_INTERNAL_FIELD_H_ */
1676 
1677 #ifndef UPB_MINI_TABLE_INTERNAL_SUB_H_
1678 #define UPB_MINI_TABLE_INTERNAL_SUB_H_
1679 
1680 // Must be last.
1681 
1682 typedef union {
1683   const struct upb_MiniTable* const* UPB_PRIVATE(submsg);
1684   const struct upb_MiniTableEnum* UPB_PRIVATE(subenum);
1685 } upb_MiniTableSubInternal;
1686 
1687 union upb_MiniTableSub {
1688   const struct upb_MiniTable* UPB_PRIVATE(submsg);
1689   const struct upb_MiniTableEnum* UPB_PRIVATE(subenum);
1690 };
1691 
1692 #ifdef __cplusplus
1693 extern "C" {
1694 #endif
1695 
upb_MiniTableSub_FromEnum(const struct upb_MiniTableEnum * subenum)1696 UPB_API_INLINE union upb_MiniTableSub upb_MiniTableSub_FromEnum(
1697     const struct upb_MiniTableEnum* subenum) {
1698   union upb_MiniTableSub out;
1699   out.UPB_PRIVATE(subenum) = subenum;
1700   return out;
1701 }
1702 
upb_MiniTableSub_FromMessage(const struct upb_MiniTable * submsg)1703 UPB_API_INLINE union upb_MiniTableSub upb_MiniTableSub_FromMessage(
1704     const struct upb_MiniTable* submsg) {
1705   union upb_MiniTableSub out;
1706   out.UPB_PRIVATE(submsg) = submsg;
1707   return out;
1708 }
1709 
upb_MiniTableSub_Enum(const union upb_MiniTableSub sub)1710 UPB_API_INLINE const struct upb_MiniTableEnum* upb_MiniTableSub_Enum(
1711     const union upb_MiniTableSub sub) {
1712   return sub.UPB_PRIVATE(subenum);
1713 }
1714 
upb_MiniTableSub_Message(const union upb_MiniTableSub sub)1715 UPB_API_INLINE const struct upb_MiniTable* upb_MiniTableSub_Message(
1716     const union upb_MiniTableSub sub) {
1717   return sub.UPB_PRIVATE(submsg);
1718 }
1719 
1720 #ifdef __cplusplus
1721 } /* extern "C" */
1722 #endif
1723 
1724 
1725 #endif /* UPB_MINI_TABLE_INTERNAL_SUB_H_ */
1726 
1727 // Must be last.
1728 
1729 struct upb_MiniTableExtension {
1730   // Do not move this field. We need to be able to alias pointers.
1731   struct upb_MiniTableField UPB_PRIVATE(field);
1732 
1733   const struct upb_MiniTable* UPB_PRIVATE(extendee);
1734   union upb_MiniTableSub UPB_PRIVATE(sub);  // NULL unless submsg or proto2 enum
1735 };
1736 
1737 #ifdef __cplusplus
1738 extern "C" {
1739 #endif
1740 
1741 UPB_API_INLINE upb_CType
upb_MiniTableExtension_CType(const struct upb_MiniTableExtension * e)1742 upb_MiniTableExtension_CType(const struct upb_MiniTableExtension* e) {
1743   return upb_MiniTableField_CType(&e->UPB_PRIVATE(field));
1744 }
1745 
1746 UPB_API_INLINE uint32_t
upb_MiniTableExtension_Number(const struct upb_MiniTableExtension * e)1747 upb_MiniTableExtension_Number(const struct upb_MiniTableExtension* e) {
1748   return e->UPB_PRIVATE(field).UPB_ONLYBITS(number);
1749 }
1750 
upb_MiniTableExtension_GetSubMessage(const struct upb_MiniTableExtension * e)1751 UPB_API_INLINE const struct upb_MiniTable* upb_MiniTableExtension_GetSubMessage(
1752     const struct upb_MiniTableExtension* e) {
1753   if (upb_MiniTableExtension_CType(e) != kUpb_CType_Message) {
1754     return NULL;
1755   }
1756   return upb_MiniTableSub_Message(e->UPB_PRIVATE(sub));
1757 }
1758 
upb_MiniTableExtension_SetSubMessage(struct upb_MiniTableExtension * e,const struct upb_MiniTable * m)1759 UPB_API_INLINE void upb_MiniTableExtension_SetSubMessage(
1760     struct upb_MiniTableExtension* e, const struct upb_MiniTable* m) {
1761   e->UPB_PRIVATE(sub).UPB_PRIVATE(submsg) = m;
1762 }
1763 
UPB_PRIVATE(_upb_MiniTableExtension_GetRep)1764 UPB_INLINE upb_FieldRep UPB_PRIVATE(_upb_MiniTableExtension_GetRep)(
1765     const struct upb_MiniTableExtension* e) {
1766   return UPB_PRIVATE(_upb_MiniTableField_GetRep)(&e->UPB_PRIVATE(field));
1767 }
1768 
1769 #ifdef __cplusplus
1770 } /* extern "C" */
1771 #endif
1772 
1773 
1774 #endif /* UPB_MINI_TABLE_INTERNAL_EXTENSION_H_ */
1775 
1776 #ifndef UPB_MINI_TABLE_MESSAGE_H_
1777 #define UPB_MINI_TABLE_MESSAGE_H_
1778 
1779 
1780 #ifndef UPB_MINI_TABLE_ENUM_H_
1781 #define UPB_MINI_TABLE_ENUM_H_
1782 
1783 #include <stdint.h>
1784 
1785 
1786 #ifndef UPB_MINI_TABLE_INTERNAL_ENUM_H_
1787 #define UPB_MINI_TABLE_INTERNAL_ENUM_H_
1788 
1789 #include <stdint.h>
1790 
1791 // Must be last.
1792 
1793 struct upb_MiniTableEnum {
1794   uint32_t UPB_PRIVATE(mask_limit);   // Highest that can be tested with mask.
1795   uint32_t UPB_PRIVATE(value_count);  // Number of values after the bitfield.
1796   uint32_t UPB_PRIVATE(data)[];       // Bitmask + enumerated values follow.
1797 };
1798 
1799 #ifdef __cplusplus
1800 extern "C" {
1801 #endif
1802 
upb_MiniTableEnum_CheckValue(const struct upb_MiniTableEnum * e,uint32_t val)1803 UPB_API_INLINE bool upb_MiniTableEnum_CheckValue(
1804     const struct upb_MiniTableEnum* e, uint32_t val) {
1805   if (UPB_LIKELY(val < 64)) {
1806     const uint64_t mask =
1807         e->UPB_PRIVATE(data)[0] | ((uint64_t)e->UPB_PRIVATE(data)[1] << 32);
1808     const uint64_t bit = 1ULL << val;
1809     return (mask & bit) != 0;
1810   }
1811   if (UPB_LIKELY(val < e->UPB_PRIVATE(mask_limit))) {
1812     const uint32_t mask = e->UPB_PRIVATE(data)[val / 32];
1813     const uint32_t bit = 1ULL << (val % 32);
1814     return (mask & bit) != 0;
1815   }
1816 
1817   // OPT: binary search long lists?
1818   const uint32_t* start =
1819       &e->UPB_PRIVATE(data)[e->UPB_PRIVATE(mask_limit) / 32];
1820   const uint32_t* limit = &e->UPB_PRIVATE(
1821       data)[e->UPB_PRIVATE(mask_limit) / 32 + e->UPB_PRIVATE(value_count)];
1822   for (const uint32_t* p = start; p < limit; p++) {
1823     if (*p == val) return true;
1824   }
1825   return false;
1826 }
1827 
1828 #ifdef __cplusplus
1829 } /* extern "C" */
1830 #endif
1831 
1832 
1833 #endif /* UPB_MINI_TABLE_INTERNAL_ENUM_H_ */
1834 
1835 // Must be last
1836 
1837 typedef struct upb_MiniTableEnum upb_MiniTableEnum;
1838 
1839 #ifdef __cplusplus
1840 extern "C" {
1841 #endif
1842 
1843 // Validates enum value against range defined by enum mini table.
1844 UPB_API_INLINE bool upb_MiniTableEnum_CheckValue(const upb_MiniTableEnum* e,
1845                                                  uint32_t val);
1846 
1847 #ifdef __cplusplus
1848 } /* extern "C" */
1849 #endif
1850 
1851 
1852 #endif /* UPB_MINI_TABLE_ENUM_H_ */
1853 
1854 #ifndef UPB_MINI_TABLE_FIELD_H_
1855 #define UPB_MINI_TABLE_FIELD_H_
1856 
1857 #include <stdint.h>
1858 
1859 
1860 // Must be last.
1861 
1862 typedef struct upb_MiniTableField upb_MiniTableField;
1863 
1864 #ifdef __cplusplus
1865 extern "C" {
1866 #endif
1867 
1868 UPB_API_INLINE upb_CType upb_MiniTableField_CType(const upb_MiniTableField* f);
1869 
1870 UPB_API_INLINE bool upb_MiniTableField_HasPresence(const upb_MiniTableField* f);
1871 
1872 UPB_API_INLINE bool upb_MiniTableField_IsArray(const upb_MiniTableField* f);
1873 
1874 UPB_API_INLINE bool upb_MiniTableField_IsClosedEnum(
1875     const upb_MiniTableField* f);
1876 
1877 UPB_API_INLINE bool upb_MiniTableField_IsExtension(const upb_MiniTableField* f);
1878 
1879 UPB_API_INLINE bool upb_MiniTableField_IsInOneof(const upb_MiniTableField* f);
1880 
1881 UPB_API_INLINE bool upb_MiniTableField_IsMap(const upb_MiniTableField* f);
1882 
1883 UPB_API_INLINE bool upb_MiniTableField_IsPacked(const upb_MiniTableField* f);
1884 
1885 UPB_API_INLINE bool upb_MiniTableField_IsScalar(const upb_MiniTableField* f);
1886 
1887 UPB_API_INLINE bool upb_MiniTableField_IsSubMessage(
1888     const upb_MiniTableField* f);
1889 
1890 UPB_API_INLINE uint32_t upb_MiniTableField_Number(const upb_MiniTableField* f);
1891 
1892 UPB_API_INLINE upb_FieldType
1893 upb_MiniTableField_Type(const upb_MiniTableField* f);
1894 
1895 #ifdef __cplusplus
1896 } /* extern "C" */
1897 #endif
1898 
1899 
1900 #endif /* UPB_MINI_TABLE_FIELD_H_ */
1901 
1902 #ifndef UPB_MINI_TABLE_INTERNAL_MESSAGE_H_
1903 #define UPB_MINI_TABLE_INTERNAL_MESSAGE_H_
1904 
1905 #include <stddef.h>
1906 #include <stdint.h>
1907 
1908 
1909 // Must be last.
1910 
1911 struct upb_Decoder;
1912 struct upb_Message;
1913 typedef const char* _upb_FieldParser(struct upb_Decoder* d, const char* ptr,
1914                                      struct upb_Message* msg, intptr_t table,
1915                                      uint64_t hasbits, uint64_t data);
1916 typedef struct {
1917   uint64_t field_data;
1918   _upb_FieldParser* field_parser;
1919 } _upb_FastTable_Entry;
1920 
1921 typedef enum {
1922   kUpb_ExtMode_NonExtendable = 0,  // Non-extendable message.
1923   kUpb_ExtMode_Extendable = 1,     // Normal extendable message.
1924   kUpb_ExtMode_IsMessageSet = 2,   // MessageSet message.
1925   kUpb_ExtMode_IsMessageSet_ITEM =
1926       3,  // MessageSet item (temporary only, see decode.c)
1927 
1928   // During table building we steal a bit to indicate that the message is a map
1929   // entry.  *Only* used during table building!
1930   kUpb_ExtMode_IsMapEntry = 4,
1931 } upb_ExtMode;
1932 
1933 // upb_MiniTable represents the memory layout of a given upb_MessageDef.
1934 // The members are public so generated code can initialize them,
1935 // but users MUST NOT directly read or write any of its members.
1936 
1937 // LINT.IfChange(minitable_struct_definition)
1938 struct upb_MiniTable {
1939   const upb_MiniTableSubInternal* UPB_PRIVATE(subs);
1940   const struct upb_MiniTableField* UPB_ONLYBITS(fields);
1941 
1942   // Must be aligned to sizeof(void*). Doesn't include internal members like
1943   // unknown fields, extension dict, pointer to msglayout, etc.
1944   uint16_t UPB_PRIVATE(size);
1945 
1946   uint16_t UPB_ONLYBITS(field_count);
1947 
1948   uint8_t UPB_PRIVATE(ext);  // upb_ExtMode, uint8_t here so sizeof(ext) == 1
1949   uint8_t UPB_PRIVATE(dense_below);
1950   uint8_t UPB_PRIVATE(table_mask);
1951   uint8_t UPB_PRIVATE(required_count);  // Required fields have the low hasbits.
1952 
1953 #ifdef UPB_TRACING_ENABLED
1954   const char* UPB_PRIVATE(full_name);
1955 #endif
1956 
1957 #ifdef UPB_FASTTABLE_ENABLED
1958   // To statically initialize the tables of variable length, we need a flexible
1959   // array member, and we need to compile in gnu99 mode (constant initialization
1960   // of flexible array members is a GNU extension, not in C99 unfortunately.
1961   _upb_FastTable_Entry UPB_PRIVATE(fasttable)[];
1962 #endif
1963 };
1964 // LINT.ThenChange(//depot/google3/third_party/upb/bits/typescript/mini_table.ts)
1965 
1966 #ifdef __cplusplus
1967 extern "C" {
1968 #endif
1969 
UPB_PRIVATE(_upb_MiniTable_StrongReference)1970 UPB_INLINE const struct upb_MiniTable* UPB_PRIVATE(
1971     _upb_MiniTable_StrongReference)(const struct upb_MiniTable* mt) {
1972 #if defined(__GNUC__)
1973   __asm__("" : : "r"(mt));
1974 #else
1975   const struct upb_MiniTable* volatile unused = mt;
1976   (void)&unused;  // Use address to avoid an extra load of "unused".
1977 #endif
1978   return mt;
1979 }
1980 
UPB_PRIVATE(_upb_MiniTable_Empty)1981 UPB_INLINE const struct upb_MiniTable* UPB_PRIVATE(_upb_MiniTable_Empty)(void) {
1982   extern const struct upb_MiniTable UPB_PRIVATE(_kUpb_MiniTable_Empty);
1983 
1984   return &UPB_PRIVATE(_kUpb_MiniTable_Empty);
1985 }
1986 
upb_MiniTable_FieldCount(const struct upb_MiniTable * m)1987 UPB_API_INLINE int upb_MiniTable_FieldCount(const struct upb_MiniTable* m) {
1988   return m->UPB_ONLYBITS(field_count);
1989 }
1990 
UPB_PRIVATE(_upb_MiniTable_IsEmpty)1991 UPB_INLINE bool UPB_PRIVATE(_upb_MiniTable_IsEmpty)(
1992     const struct upb_MiniTable* m) {
1993   extern const struct upb_MiniTable UPB_PRIVATE(_kUpb_MiniTable_Empty);
1994 
1995   return m == &UPB_PRIVATE(_kUpb_MiniTable_Empty);
1996 }
1997 
upb_MiniTable_GetFieldByIndex(const struct upb_MiniTable * m,uint32_t i)1998 UPB_API_INLINE const struct upb_MiniTableField* upb_MiniTable_GetFieldByIndex(
1999     const struct upb_MiniTable* m, uint32_t i) {
2000   return &m->UPB_ONLYBITS(fields)[i];
2001 }
2002 
UPB_PRIVATE(_upb_MiniTable_GetSubTableByIndex)2003 UPB_INLINE const struct upb_MiniTable* UPB_PRIVATE(
2004     _upb_MiniTable_GetSubTableByIndex)(const struct upb_MiniTable* m,
2005                                        uint32_t i) {
2006   return *m->UPB_PRIVATE(subs)[i].UPB_PRIVATE(submsg);
2007 }
2008 
upb_MiniTable_SubMessage(const struct upb_MiniTable * m,const struct upb_MiniTableField * f)2009 UPB_API_INLINE const struct upb_MiniTable* upb_MiniTable_SubMessage(
2010     const struct upb_MiniTable* m, const struct upb_MiniTableField* f) {
2011   if (upb_MiniTableField_CType(f) != kUpb_CType_Message) {
2012     return NULL;
2013   }
2014   return UPB_PRIVATE(_upb_MiniTable_GetSubTableByIndex)(
2015       m, f->UPB_PRIVATE(submsg_index));
2016 }
2017 
upb_MiniTable_GetSubMessageTable(const struct upb_MiniTable * m,const struct upb_MiniTableField * f)2018 UPB_API_INLINE const struct upb_MiniTable* upb_MiniTable_GetSubMessageTable(
2019     const struct upb_MiniTable* m, const struct upb_MiniTableField* f) {
2020   UPB_ASSUME(upb_MiniTableField_CType(f) == kUpb_CType_Message);
2021   const struct upb_MiniTable* ret = upb_MiniTable_SubMessage(m, f);
2022   UPB_ASSUME(ret);
2023   return UPB_PRIVATE(_upb_MiniTable_IsEmpty)(ret) ? NULL : ret;
2024 }
2025 
upb_MiniTable_FieldIsLinked(const struct upb_MiniTable * m,const struct upb_MiniTableField * f)2026 UPB_API_INLINE bool upb_MiniTable_FieldIsLinked(
2027     const struct upb_MiniTable* m, const struct upb_MiniTableField* f) {
2028   return upb_MiniTable_GetSubMessageTable(m, f) != NULL;
2029 }
2030 
upb_MiniTable_MapEntrySubMessage(const struct upb_MiniTable * m,const struct upb_MiniTableField * f)2031 UPB_API_INLINE const struct upb_MiniTable* upb_MiniTable_MapEntrySubMessage(
2032     const struct upb_MiniTable* m, const struct upb_MiniTableField* f) {
2033   UPB_ASSERT(upb_MiniTable_FieldIsLinked(m, f));  // Map entries must be linked.
2034   UPB_ASSERT(upb_MiniTableField_IsMap(f));        // Function precondition.
2035   return upb_MiniTable_SubMessage(m, f);
2036 }
2037 
upb_MiniTable_GetSubEnumTable(const struct upb_MiniTable * m,const struct upb_MiniTableField * f)2038 UPB_API_INLINE const struct upb_MiniTableEnum* upb_MiniTable_GetSubEnumTable(
2039     const struct upb_MiniTable* m, const struct upb_MiniTableField* f) {
2040   UPB_ASSERT(upb_MiniTableField_CType(f) == kUpb_CType_Enum);
2041   return m->UPB_PRIVATE(subs)[f->UPB_PRIVATE(submsg_index)].UPB_PRIVATE(
2042       subenum);
2043 }
2044 
upb_MiniTable_MapKey(const struct upb_MiniTable * m)2045 UPB_API_INLINE const struct upb_MiniTableField* upb_MiniTable_MapKey(
2046     const struct upb_MiniTable* m) {
2047   UPB_ASSERT(upb_MiniTable_FieldCount(m) == 2);
2048   const struct upb_MiniTableField* f = upb_MiniTable_GetFieldByIndex(m, 0);
2049   UPB_ASSERT(upb_MiniTableField_Number(f) == 1);
2050   return f;
2051 }
2052 
upb_MiniTable_MapValue(const struct upb_MiniTable * m)2053 UPB_API_INLINE const struct upb_MiniTableField* upb_MiniTable_MapValue(
2054     const struct upb_MiniTable* m) {
2055   UPB_ASSERT(upb_MiniTable_FieldCount(m) == 2);
2056   const struct upb_MiniTableField* f = upb_MiniTable_GetFieldByIndex(m, 1);
2057   UPB_ASSERT(upb_MiniTableField_Number(f) == 2);
2058   return f;
2059 }
2060 
2061 // Computes a bitmask in which the |m->required_count| lowest bits are set.
2062 //
2063 // Sample output:
2064 //    RequiredMask(1) => 0b1 (0x1)
2065 //    RequiredMask(5) => 0b11111 (0x1f)
2066 UPB_INLINE uint64_t
UPB_PRIVATE(_upb_MiniTable_RequiredMask)2067 UPB_PRIVATE(_upb_MiniTable_RequiredMask)(const struct upb_MiniTable* m) {
2068   int n = m->UPB_PRIVATE(required_count);
2069   UPB_ASSERT(0 < n && n <= 64);
2070   return (1ULL << n) - 1;
2071 }
2072 
2073 #ifdef UPB_TRACING_ENABLED
upb_MiniTable_FullName(const struct upb_MiniTable * mini_table)2074 UPB_INLINE const char* upb_MiniTable_FullName(
2075     const struct upb_MiniTable* mini_table) {
2076   return mini_table->UPB_PRIVATE(full_name);
2077 }
2078 // Initializes tracing proto name from language runtimes that construct
2079 // mini tables dynamically at runtime. The runtime is responsible for passing
2080 // 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)2081 UPB_INLINE void upb_MiniTable_SetFullName(struct upb_MiniTable* mini_table,
2082                                           const char* full_name) {
2083   mini_table->UPB_PRIVATE(full_name) = full_name;
2084 }
2085 #endif
2086 
2087 #ifdef __cplusplus
2088 } /* extern "C" */
2089 #endif
2090 
2091 
2092 #endif /* UPB_MINI_TABLE_INTERNAL_MESSAGE_H_ */
2093 
2094 // Must be last.
2095 
2096 typedef struct upb_MiniTable upb_MiniTable;
2097 
2098 #ifdef __cplusplus
2099 extern "C" {
2100 #endif
2101 
2102 UPB_API const upb_MiniTableField* upb_MiniTable_FindFieldByNumber(
2103     const upb_MiniTable* m, uint32_t number);
2104 
2105 UPB_API_INLINE const upb_MiniTableField* upb_MiniTable_GetFieldByIndex(
2106     const upb_MiniTable* m, uint32_t index);
2107 
2108 UPB_API_INLINE int upb_MiniTable_FieldCount(const upb_MiniTable* m);
2109 
2110 // DEPRECATED: use upb_MiniTable_SubMessage() instead
2111 // Returns the MiniTable for a message field, NULL if the field is unlinked.
2112 UPB_API_INLINE const upb_MiniTable* upb_MiniTable_GetSubMessageTable(
2113     const upb_MiniTable* m, const upb_MiniTableField* f);
2114 
2115 // Returns the MiniTable for a message field if it is a submessage, otherwise
2116 // returns NULL.
2117 //
2118 // WARNING: if dynamic tree shaking is in use, the return value may be the
2119 // "empty", zero-field placeholder message instead of the real message type.
2120 // If the message is later linked, this function will begin returning the real
2121 // message type.
2122 UPB_API_INLINE const upb_MiniTable* upb_MiniTable_SubMessage(
2123     const upb_MiniTable* m, const upb_MiniTableField* f);
2124 
2125 // Returns the MiniTable for a map field.  The given field must refer to a map.
2126 UPB_API_INLINE const upb_MiniTable* upb_MiniTable_MapEntrySubMessage(
2127     const upb_MiniTable* m, const upb_MiniTableField* f);
2128 
2129 // Returns the MiniTableEnum for a message field, NULL if the field is unlinked.
2130 UPB_API_INLINE const upb_MiniTableEnum* upb_MiniTable_GetSubEnumTable(
2131     const upb_MiniTable* m, const upb_MiniTableField* f);
2132 
2133 // Returns the MiniTableField for the key of a map.
2134 UPB_API_INLINE const upb_MiniTableField* upb_MiniTable_MapKey(
2135     const upb_MiniTable* m);
2136 
2137 // Returns the MiniTableField for the value of a map.
2138 UPB_API_INLINE const upb_MiniTableField* upb_MiniTable_MapValue(
2139     const upb_MiniTable* m);
2140 
2141 // Returns true if this MiniTable field is linked to a MiniTable for the
2142 // sub-message.
2143 UPB_API_INLINE bool upb_MiniTable_FieldIsLinked(const upb_MiniTable* m,
2144                                                 const upb_MiniTableField* f);
2145 
2146 // If this field is in a oneof, returns the first field in the oneof.
2147 //
2148 // Otherwise returns NULL.
2149 //
2150 // Usage:
2151 //   const upb_MiniTableField* field = upb_MiniTable_GetOneof(m, f);
2152 //   do {
2153 //       ..
2154 //   } while (upb_MiniTable_NextOneofField(m, &field);
2155 //
2156 const upb_MiniTableField* upb_MiniTable_GetOneof(const upb_MiniTable* m,
2157                                                  const upb_MiniTableField* f);
2158 
2159 // Iterates to the next field in the oneof. If this is the last field in the
2160 // oneof, returns false. The ordering of fields in the oneof is not
2161 // guaranteed.
2162 // REQUIRES: |f| is the field initialized by upb_MiniTable_GetOneof and updated
2163 //           by prior upb_MiniTable_NextOneofField calls.
2164 bool upb_MiniTable_NextOneofField(const upb_MiniTable* m,
2165                                   const upb_MiniTableField** f);
2166 
2167 #ifdef __cplusplus
2168 } /* extern "C" */
2169 #endif
2170 
2171 
2172 #endif /* UPB_MINI_TABLE_MESSAGE_H_ */
2173 
2174 // Must be last.
2175 
2176 typedef struct upb_MiniTableExtension upb_MiniTableExtension;
2177 
2178 #ifdef __cplusplus
2179 extern "C" {
2180 #endif
2181 
2182 UPB_API_INLINE upb_CType
2183 upb_MiniTableExtension_CType(const upb_MiniTableExtension* e);
2184 
2185 UPB_API_INLINE uint32_t
2186 upb_MiniTableExtension_Number(const upb_MiniTableExtension* e);
2187 
2188 UPB_API_INLINE const upb_MiniTable* upb_MiniTableExtension_GetSubMessage(
2189     const upb_MiniTableExtension* e);
2190 
2191 UPB_API_INLINE void upb_MiniTableExtension_SetSubMessage(
2192     upb_MiniTableExtension* e, const upb_MiniTable* m);
2193 
2194 #ifdef __cplusplus
2195 } /* extern "C" */
2196 #endif
2197 
2198 
2199 #endif /* UPB_MINI_TABLE_EXTENSION_H_ */
2200 
2201 // Must be last.
2202 
2203 // The internal representation of an extension is self-describing: it contains
2204 // enough information that we can serialize it to binary format without needing
2205 // to look it up in a upb_ExtensionRegistry.
2206 //
2207 // This representation allocates 16 bytes to data on 64-bit platforms.
2208 // This is rather wasteful for scalars (in the extreme case of bool,
2209 // it wastes 15 bytes). We accept this because we expect messages to be
2210 // the most common extension type.
2211 typedef struct {
2212   const upb_MiniTableExtension* ext;
2213   upb_MessageValue data;
2214 } upb_Extension;
2215 
2216 #ifdef __cplusplus
2217 extern "C" {
2218 #endif
2219 
2220 // Adds the given extension data to the given message.
2221 // |ext| is copied into the message instance.
2222 // This logically replaces any previously-added extension with this number.
2223 upb_Extension* UPB_PRIVATE(_upb_Message_GetOrCreateExtension)(
2224     struct upb_Message* msg, const upb_MiniTableExtension* ext,
2225     upb_Arena* arena);
2226 
2227 // Returns an array of extensions for this message.
2228 // Note: the array is ordered in reverse relative to the order of creation.
2229 const upb_Extension* UPB_PRIVATE(_upb_Message_Getexts)(
2230     const struct upb_Message* msg, size_t* count);
2231 
2232 // Returns an extension for a message with a given mini table,
2233 // or NULL if no extension exists with this mini table.
2234 const upb_Extension* UPB_PRIVATE(_upb_Message_Getext)(
2235     const struct upb_Message* msg, const upb_MiniTableExtension* ext);
2236 
2237 #ifdef __cplusplus
2238 } /* extern "C" */
2239 #endif
2240 
2241 
2242 #endif /* UPB_MESSAGE_INTERNAL_EXTENSION_H_ */
2243 
2244 // Must be last.
2245 
2246 #ifdef __cplusplus
2247 extern "C" {
2248 #endif
2249 
2250 extern const float kUpb_FltInfinity;
2251 extern const double kUpb_Infinity;
2252 extern const double kUpb_NaN;
2253 
2254 // Internal members of a upb_Message that track unknown fields and/or
2255 // extensions. We can change this without breaking binary compatibility.
2256 
2257 typedef struct upb_Message_Internal {
2258   // Total size of this structure, including the data that follows.
2259   // Must be aligned to 8, which is alignof(upb_Extension)
2260   uint32_t size;
2261 
2262   /* Offsets relative to the beginning of this structure.
2263    *
2264    * Unknown data grows forward from the beginning to unknown_end.
2265    * Extension data grows backward from size to ext_begin.
2266    * When the two meet, we're out of data and have to realloc.
2267    *
2268    * If we imagine that the final member of this struct is:
2269    *   char data[size - overhead];  // overhead = sizeof(upb_Message_Internal)
2270    *
2271    * Then we have:
2272    *   unknown data: data[0 .. (unknown_end - overhead)]
2273    *   extensions data: data[(ext_begin - overhead) .. (size - overhead)] */
2274   uint32_t unknown_end;
2275   uint32_t ext_begin;
2276   // Data follows, as if there were an array:
2277   //   char data[size - sizeof(upb_Message_Internal)];
2278 } upb_Message_Internal;
2279 
2280 #ifdef UPB_TRACING_ENABLED
2281 UPB_API void upb_Message_LogNewMessage(const upb_MiniTable* m,
2282                                        const upb_Arena* arena);
2283 UPB_API void upb_Message_SetNewMessageTraceHandler(
2284     void (*handler)(const upb_MiniTable*, const upb_Arena*));
2285 #endif  // UPB_TRACING_ENABLED
2286 
2287 // Inline version upb_Message_New(), for internal use.
_upb_Message_New(const upb_MiniTable * m,upb_Arena * a)2288 UPB_INLINE struct upb_Message* _upb_Message_New(const upb_MiniTable* m,
2289                                                 upb_Arena* a) {
2290 #ifdef UPB_TRACING_ENABLED
2291   upb_Message_LogNewMessage(m, a);
2292 #endif  // UPB_TRACING_ENABLED
2293 
2294   const int size = m->UPB_PRIVATE(size);
2295   struct upb_Message* msg = (struct upb_Message*)upb_Arena_Malloc(a, size);
2296   if (UPB_UNLIKELY(!msg)) return NULL;
2297   memset(msg, 0, size);
2298   return msg;
2299 }
2300 
2301 // Discards the unknown fields for this message only.
2302 void _upb_Message_DiscardUnknown_shallow(struct upb_Message* msg);
2303 
2304 // Adds unknown data (serialized protobuf data) to the given message.
2305 // The data is copied into the message instance.
2306 bool UPB_PRIVATE(_upb_Message_AddUnknown)(struct upb_Message* msg,
2307                                           const char* data, size_t len,
2308                                           upb_Arena* arena);
2309 
2310 bool UPB_PRIVATE(_upb_Message_Realloc)(struct upb_Message* msg, size_t need,
2311                                        upb_Arena* arena);
2312 
2313 #ifdef __cplusplus
2314 } /* extern "C" */
2315 #endif
2316 
2317 
2318 #endif /* UPB_MESSAGE_INTERNAL_MESSAGE_H_ */
2319 
2320 #ifndef UPB_MESSAGE_INTERNAL_TYPES_H_
2321 #define UPB_MESSAGE_INTERNAL_TYPES_H_
2322 
2323 #include <stdint.h>
2324 
2325 // Must be last.
2326 
2327 #define UPB_OPAQUE(x) x##_opaque
2328 
2329 struct upb_Message {
2330   union {
2331     uintptr_t UPB_OPAQUE(internal);  // tagged pointer, low bit == frozen
2332     double d;  // Forces same size for 32-bit/64-bit builds
2333   };
2334 };
2335 
2336 #ifdef __cplusplus
2337 extern "C" {
2338 #endif
2339 
UPB_PRIVATE(_upb_Message_ShallowFreeze)2340 UPB_INLINE void UPB_PRIVATE(_upb_Message_ShallowFreeze)(
2341     struct upb_Message* msg) {
2342   msg->UPB_OPAQUE(internal) |= 1ULL;
2343 }
2344 
upb_Message_IsFrozen(const struct upb_Message * msg)2345 UPB_API_INLINE bool upb_Message_IsFrozen(const struct upb_Message* msg) {
2346   return (msg->UPB_OPAQUE(internal) & 1ULL) != 0;
2347 }
2348 
UPB_PRIVATE(_upb_Message_GetInternal)2349 UPB_INLINE struct upb_Message_Internal* UPB_PRIVATE(_upb_Message_GetInternal)(
2350     const struct upb_Message* msg) {
2351   const uintptr_t tmp = msg->UPB_OPAQUE(internal) & ~1ULL;
2352   return (struct upb_Message_Internal*)tmp;
2353 }
2354 
UPB_PRIVATE(_upb_Message_SetInternal)2355 UPB_INLINE void UPB_PRIVATE(_upb_Message_SetInternal)(
2356     struct upb_Message* msg, struct upb_Message_Internal* internal) {
2357   UPB_ASSERT(!upb_Message_IsFrozen(msg));
2358   msg->UPB_OPAQUE(internal) = (uintptr_t)internal;
2359 }
2360 
2361 #ifdef __cplusplus
2362 } /* extern "C" */
2363 #endif
2364 
2365 #undef UPB_OPAQUE
2366 
2367 
2368 #endif /* UPB_MESSAGE_INTERNAL_TYPES_H_ */
2369 
2370 // Must be last.
2371 
2372 typedef struct upb_Message upb_Message;
2373 
2374 #ifdef __cplusplus
2375 extern "C" {
2376 #endif
2377 
2378 // Creates a new message with the given mini_table on the given arena.
2379 UPB_API upb_Message* upb_Message_New(const upb_MiniTable* m, upb_Arena* arena);
2380 
2381 // Returns a reference to the message's unknown data.
2382 const char* upb_Message_GetUnknown(const upb_Message* msg, size_t* len);
2383 
2384 // Removes partial unknown data from message.
2385 void upb_Message_DeleteUnknown(upb_Message* msg, const char* data, size_t len);
2386 
2387 // Returns the number of extensions present in this message.
2388 size_t upb_Message_ExtensionCount(const upb_Message* msg);
2389 
2390 // Mark a message and all of its descendents as frozen/immutable.
2391 UPB_API void upb_Message_Freeze(upb_Message* msg, const upb_MiniTable* m);
2392 
2393 // Returns whether a message has been frozen.
2394 UPB_API_INLINE bool upb_Message_IsFrozen(const upb_Message* msg);
2395 
2396 #ifdef UPB_TRACING_ENABLED
2397 UPB_API void upb_Message_LogNewMessage(const upb_MiniTable* m,
2398                                        const upb_Arena* arena);
2399 
2400 UPB_API void upb_Message_SetNewMessageTraceHandler(
2401     void (*handler)(const upb_MiniTable* m, const upb_Arena* arena));
2402 #endif  // UPB_TRACING_ENABLED
2403 
2404 #ifdef __cplusplus
2405 } /* extern "C" */
2406 #endif
2407 
2408 
2409 #endif /* UPB_MESSAGE_MESSAGE_H_ */
2410 
2411 #ifndef UPB_REFLECTION_DEF_H_
2412 #define UPB_REFLECTION_DEF_H_
2413 
2414 // IWYU pragma: begin_exports
2415 
2416 // IWYU pragma: private, include "upb/reflection/def.h"
2417 
2418 #ifndef UPB_REFLECTION_DEF_POOL_H_
2419 #define UPB_REFLECTION_DEF_POOL_H_
2420 
2421 
2422 // IWYU pragma: private, include "upb/reflection/def.h"
2423 
2424 // Declarations common to all public def types.
2425 
2426 #ifndef UPB_REFLECTION_COMMON_H_
2427 #define UPB_REFLECTION_COMMON_H_
2428 
2429 #ifndef THIRD_PARTY_UPB_UPB_REFLECTION_DESCRIPTOR_BOOTSTRAP_H_
2430 #define THIRD_PARTY_UPB_UPB_REFLECTION_DESCRIPTOR_BOOTSTRAP_H_
2431 
2432 // IWYU pragma: begin_exports
2433 
2434 #if defined(UPB_BOOTSTRAP_STAGE) && UPB_BOOTSTRAP_STAGE == 0
2435 // This header is checked in.
2436 #elif UPB_BOOTSTRAP_STAGE == 1
2437 // This header is generated at build time by the bootstrapping process.
2438 #else
2439 // This is the normal header, generated by upb_c_proto_library().
2440 /* This file was generated by upb_generator from the input file:
2441  *
2442  *     google/protobuf/descriptor.proto
2443  *
2444  * Do not edit -- your changes will be discarded when the file is
2445  * regenerated.
2446  * NO CHECKED-IN PROTOBUF GENCODE */
2447 
2448 #ifndef GOOGLE_PROTOBUF_DESCRIPTOR_PROTO_UPB_H__UPB_H_
2449 #define GOOGLE_PROTOBUF_DESCRIPTOR_PROTO_UPB_H__UPB_H_
2450 
2451 
2452 #ifndef UPB_GENERATED_CODE_SUPPORT_H_
2453 #define UPB_GENERATED_CODE_SUPPORT_H_
2454 
2455 // IWYU pragma: begin_exports
2456 
2457 #ifndef UPB_BASE_UPCAST_H_
2458 #define UPB_BASE_UPCAST_H_
2459 
2460 // Must be last.
2461 
2462 // This macro provides a way to upcast message pointers in a way that is
2463 // somewhat more bulletproof than blindly casting a pointer. Example:
2464 //
2465 // typedef struct {
2466 //   upb_Message UPB_PRIVATE(base);
2467 // } pkg_FooMessage;
2468 //
2469 // void f(pkg_FooMessage* msg) {
2470 //   upb_Decode(UPB_UPCAST(msg), ...);
2471 // }
2472 
2473 #define UPB_UPCAST(x) (&(x)->base##_dont_copy_me__upb_internal_use_only)
2474 
2475 
2476 #endif /* UPB_BASE_UPCAST_H_ */
2477 
2478 #ifndef UPB_MESSAGE_ACCESSORS_H_
2479 #define UPB_MESSAGE_ACCESSORS_H_
2480 
2481 #include <stdint.h>
2482 
2483 
2484 #ifndef UPB_MESSAGE_ARRAY_H_
2485 #define UPB_MESSAGE_ARRAY_H_
2486 
2487 #include <stddef.h>
2488 
2489 
2490 #ifndef UPB_MESSAGE_INTERNAL_ARRAY_H_
2491 #define UPB_MESSAGE_INTERNAL_ARRAY_H_
2492 
2493 #include <stdint.h>
2494 #include <string.h>
2495 
2496 
2497 // Must be last.
2498 
2499 #define _UPB_ARRAY_MASK_IMM 0x4  // Frozen/immutable bit.
2500 #define _UPB_ARRAY_MASK_LG2 0x3  // Encoded elem size.
2501 #define _UPB_ARRAY_MASK_ALL (_UPB_ARRAY_MASK_IMM | _UPB_ARRAY_MASK_LG2)
2502 
2503 #ifdef __cplusplus
2504 extern "C" {
2505 #endif
2506 
2507 // LINT.IfChange(upb_Array)
2508 
2509 // Our internal representation for repeated fields.
2510 struct upb_Array {
2511   // This is a tagged pointer. Bits #0 and #1 encode the elem size as follows:
2512   //   0 maps to elem size 1
2513   //   1 maps to elem size 4
2514   //   2 maps to elem size 8
2515   //   3 maps to elem size 16
2516   //
2517   // Bit #2 contains the frozen/immutable flag.
2518   uintptr_t UPB_ONLYBITS(data);
2519 
2520   size_t UPB_ONLYBITS(size);     // The number of elements in the array.
2521   size_t UPB_PRIVATE(capacity);  // Allocated storage. Measured in elements.
2522 };
2523 
UPB_PRIVATE(_upb_Array_ShallowFreeze)2524 UPB_INLINE void UPB_PRIVATE(_upb_Array_ShallowFreeze)(struct upb_Array* arr) {
2525   arr->UPB_ONLYBITS(data) |= _UPB_ARRAY_MASK_IMM;
2526 }
2527 
upb_Array_IsFrozen(const struct upb_Array * arr)2528 UPB_API_INLINE bool upb_Array_IsFrozen(const struct upb_Array* arr) {
2529   return (arr->UPB_ONLYBITS(data) & _UPB_ARRAY_MASK_IMM) != 0;
2530 }
2531 
UPB_PRIVATE(_upb_Array_SetTaggedPtr)2532 UPB_INLINE void UPB_PRIVATE(_upb_Array_SetTaggedPtr)(struct upb_Array* array,
2533                                                      void* data, size_t lg2) {
2534   UPB_ASSERT(lg2 != 1);
2535   UPB_ASSERT(lg2 <= 4);
2536   const size_t bits = lg2 - (lg2 != 0);
2537   array->UPB_ONLYBITS(data) = (uintptr_t)data | bits;
2538 }
2539 
2540 UPB_INLINE size_t
UPB_PRIVATE(_upb_Array_ElemSizeLg2)2541 UPB_PRIVATE(_upb_Array_ElemSizeLg2)(const struct upb_Array* array) {
2542   const size_t bits = array->UPB_ONLYBITS(data) & _UPB_ARRAY_MASK_LG2;
2543   const size_t lg2 = bits + (bits != 0);
2544   return lg2;
2545 }
2546 
upb_Array_DataPtr(const struct upb_Array * array)2547 UPB_API_INLINE const void* upb_Array_DataPtr(const struct upb_Array* array) {
2548   UPB_PRIVATE(_upb_Array_ElemSizeLg2)(array);  // Check assertions.
2549   return (void*)(array->UPB_ONLYBITS(data) & ~(uintptr_t)_UPB_ARRAY_MASK_ALL);
2550 }
2551 
upb_Array_MutableDataPtr(struct upb_Array * array)2552 UPB_API_INLINE void* upb_Array_MutableDataPtr(struct upb_Array* array) {
2553   return (void*)upb_Array_DataPtr(array);
2554 }
2555 
UPB_PRIVATE(_upb_Array_New)2556 UPB_INLINE struct upb_Array* UPB_PRIVATE(_upb_Array_New)(upb_Arena* arena,
2557                                                          size_t init_capacity,
2558                                                          int elem_size_lg2) {
2559   UPB_ASSERT(elem_size_lg2 != 1);
2560   UPB_ASSERT(elem_size_lg2 <= 4);
2561   const size_t array_size =
2562       UPB_ALIGN_UP(sizeof(struct upb_Array), UPB_MALLOC_ALIGN);
2563   const size_t bytes = array_size + (init_capacity << elem_size_lg2);
2564   struct upb_Array* array = (struct upb_Array*)upb_Arena_Malloc(arena, bytes);
2565   if (!array) return NULL;
2566   UPB_PRIVATE(_upb_Array_SetTaggedPtr)
2567   (array, UPB_PTR_AT(array, array_size, void), elem_size_lg2);
2568   array->UPB_ONLYBITS(size) = 0;
2569   array->UPB_PRIVATE(capacity) = init_capacity;
2570   return array;
2571 }
2572 
2573 // Resizes the capacity of the array to be at least min_size.
2574 bool UPB_PRIVATE(_upb_Array_Realloc)(struct upb_Array* array, size_t min_size,
2575                                      upb_Arena* arena);
2576 
upb_Array_Reserve(struct upb_Array * array,size_t size,upb_Arena * arena)2577 UPB_API_INLINE bool upb_Array_Reserve(struct upb_Array* array, size_t size,
2578                                       upb_Arena* arena) {
2579   UPB_ASSERT(!upb_Array_IsFrozen(array));
2580   if (array->UPB_PRIVATE(capacity) < size)
2581     return UPB_PRIVATE(_upb_Array_Realloc)(array, size, arena);
2582   return true;
2583 }
2584 
2585 // Resize without initializing new elements.
UPB_PRIVATE(_upb_Array_ResizeUninitialized)2586 UPB_INLINE bool UPB_PRIVATE(_upb_Array_ResizeUninitialized)(
2587     struct upb_Array* array, size_t size, upb_Arena* arena) {
2588   UPB_ASSERT(!upb_Array_IsFrozen(array));
2589   UPB_ASSERT(size <= array->UPB_ONLYBITS(size) ||
2590              arena);  // Allow NULL arena when shrinking.
2591   if (!upb_Array_Reserve(array, size, arena)) return false;
2592   array->UPB_ONLYBITS(size) = size;
2593   return true;
2594 }
2595 
2596 // This function is intended for situations where elem_size is compile-time
2597 // constant or a known expression of the form (1 << lg2), so that the expression
2598 // i*elem_size does not result in an actual multiplication.
UPB_PRIVATE(_upb_Array_Set)2599 UPB_INLINE void UPB_PRIVATE(_upb_Array_Set)(struct upb_Array* array, size_t i,
2600                                             const void* data,
2601                                             size_t elem_size) {
2602   UPB_ASSERT(!upb_Array_IsFrozen(array));
2603   UPB_ASSERT(i < array->UPB_ONLYBITS(size));
2604   UPB_ASSERT(elem_size == 1U << UPB_PRIVATE(_upb_Array_ElemSizeLg2)(array));
2605   char* arr_data = (char*)upb_Array_MutableDataPtr(array);
2606   memcpy(arr_data + (i * elem_size), data, elem_size);
2607 }
2608 
upb_Array_Size(const struct upb_Array * arr)2609 UPB_API_INLINE size_t upb_Array_Size(const struct upb_Array* arr) {
2610   return arr->UPB_ONLYBITS(size);
2611 }
2612 
2613 // LINT.ThenChange(GoogleInternalName0)
2614 
2615 #ifdef __cplusplus
2616 } /* extern "C" */
2617 #endif
2618 
2619 #undef _UPB_ARRAY_MASK_IMM
2620 #undef _UPB_ARRAY_MASK_LG2
2621 #undef _UPB_ARRAY_MASK_ALL
2622 
2623 
2624 #endif /* UPB_MESSAGE_INTERNAL_ARRAY_H_ */
2625 
2626 // Must be last.
2627 
2628 typedef struct upb_Array upb_Array;
2629 
2630 #ifdef __cplusplus
2631 extern "C" {
2632 #endif
2633 
2634 // Creates a new array on the given arena that holds elements of this type.
2635 UPB_API upb_Array* upb_Array_New(upb_Arena* a, upb_CType type);
2636 
2637 // Returns the number of elements in the array.
2638 UPB_API_INLINE size_t upb_Array_Size(const upb_Array* arr);
2639 
2640 // Returns the given element, which must be within the array's current size.
2641 UPB_API upb_MessageValue upb_Array_Get(const upb_Array* arr, size_t i);
2642 
2643 // Returns a mutating pointer to the given element, which must be within the
2644 // array's current size.
2645 UPB_API upb_MutableMessageValue upb_Array_GetMutable(upb_Array* arr, size_t i);
2646 
2647 // Sets the given element, which must be within the array's current size.
2648 UPB_API void upb_Array_Set(upb_Array* arr, size_t i, upb_MessageValue val);
2649 
2650 // Appends an element to the array. Returns false on allocation failure.
2651 UPB_API bool upb_Array_Append(upb_Array* array, upb_MessageValue val,
2652                               upb_Arena* arena);
2653 
2654 // Moves elements within the array using memmove().
2655 // Like memmove(), the source and destination elements may be overlapping.
2656 UPB_API void upb_Array_Move(upb_Array* array, size_t dst_idx, size_t src_idx,
2657                             size_t count);
2658 
2659 // Inserts one or more empty elements into the array.
2660 // Existing elements are shifted right.
2661 // The new elements have undefined state and must be set with `upb_Array_Set()`.
2662 // REQUIRES: `i <= upb_Array_Size(arr)`
2663 UPB_API bool upb_Array_Insert(upb_Array* array, size_t i, size_t count,
2664                               upb_Arena* arena);
2665 
2666 // Deletes one or more elements from the array.
2667 // Existing elements are shifted left.
2668 // REQUIRES: `i + count <= upb_Array_Size(arr)`
2669 UPB_API void upb_Array_Delete(upb_Array* array, size_t i, size_t count);
2670 
2671 // Reserves |size| elements of storage for the array.
2672 UPB_API_INLINE bool upb_Array_Reserve(struct upb_Array* array, size_t size,
2673                                       upb_Arena* arena);
2674 
2675 // Changes the size of a vector. New elements are initialized to NULL/0.
2676 // Returns false on allocation failure.
2677 UPB_API bool upb_Array_Resize(upb_Array* array, size_t size, upb_Arena* arena);
2678 
2679 // Returns pointer to array data.
2680 UPB_API_INLINE const void* upb_Array_DataPtr(const upb_Array* arr);
2681 
2682 // Returns mutable pointer to array data.
2683 UPB_API_INLINE void* upb_Array_MutableDataPtr(upb_Array* arr);
2684 
2685 // Mark an array and all of its descendents as frozen/immutable.
2686 // If the array elements are messages then |m| must point to the minitable for
2687 // those messages. Otherwise |m| must be NULL.
2688 UPB_API void upb_Array_Freeze(upb_Array* arr, const upb_MiniTable* m);
2689 
2690 // Returns whether an array has been frozen.
2691 UPB_API_INLINE bool upb_Array_IsFrozen(const upb_Array* arr);
2692 
2693 #ifdef __cplusplus
2694 } /* extern "C" */
2695 #endif
2696 
2697 
2698 #endif /* UPB_MESSAGE_ARRAY_H_ */
2699 
2700 #ifndef UPB_MESSAGE_INTERNAL_ACCESSORS_H_
2701 #define UPB_MESSAGE_INTERNAL_ACCESSORS_H_
2702 
2703 #include <stddef.h>
2704 #include <stdint.h>
2705 #include <string.h>
2706 
2707 
2708 #ifndef UPB_BASE_INTERNAL_ENDIAN_H_
2709 #define UPB_BASE_INTERNAL_ENDIAN_H_
2710 
2711 #include <stdint.h>
2712 
2713 // Must be last.
2714 
2715 #ifdef __cplusplus
2716 extern "C" {
2717 #endif
2718 
upb_IsLittleEndian(void)2719 UPB_INLINE bool upb_IsLittleEndian(void) {
2720   const int x = 1;
2721   return *(char*)&x == 1;
2722 }
2723 
upb_BigEndian32(uint32_t val)2724 UPB_INLINE uint32_t upb_BigEndian32(uint32_t val) {
2725   if (upb_IsLittleEndian()) return val;
2726 
2727   return ((val & 0xff) << 24) | ((val & 0xff00) << 8) |
2728          ((val & 0xff0000) >> 8) | ((val & 0xff000000) >> 24);
2729 }
2730 
upb_BigEndian64(uint64_t val)2731 UPB_INLINE uint64_t upb_BigEndian64(uint64_t val) {
2732   if (upb_IsLittleEndian()) return val;
2733 
2734   const uint64_t hi = ((uint64_t)upb_BigEndian32((uint32_t)val)) << 32;
2735   const uint64_t lo = upb_BigEndian32((uint32_t)(val >> 32));
2736   return hi | lo;
2737 }
2738 
2739 #ifdef __cplusplus
2740 } /* extern "C" */
2741 #endif
2742 
2743 
2744 #endif /* UPB_BASE_INTERNAL_ENDIAN_H_ */
2745 
2746 #ifndef UPB_MESSAGE_INTERNAL_MAP_H_
2747 #define UPB_MESSAGE_INTERNAL_MAP_H_
2748 
2749 #include <stddef.h>
2750 #include <string.h>
2751 
2752 
2753 #ifndef UPB_HASH_STR_TABLE_H_
2754 #define UPB_HASH_STR_TABLE_H_
2755 
2756 
2757 /*
2758  * upb_table
2759  *
2760  * This header is INTERNAL-ONLY!  Its interfaces are not public or stable!
2761  * This file defines very fast int->upb_value (inttable) and string->upb_value
2762  * (strtable) hash tables.
2763  *
2764  * The table uses chained scatter with Brent's variation (inspired by the Lua
2765  * implementation of hash tables).  The hash function for strings is Austin
2766  * Appleby's "MurmurHash."
2767  *
2768  * The inttable uses uintptr_t as its key, which guarantees it can be used to
2769  * store pointers or integers of at least 32 bits (upb isn't really useful on
2770  * systems where sizeof(void*) < 4).
2771  *
2772  * The table must be homogeneous (all values of the same type).  In debug
2773  * mode, we check this on insert and lookup.
2774  */
2775 
2776 #ifndef UPB_HASH_COMMON_H_
2777 #define UPB_HASH_COMMON_H_
2778 
2779 #include <string.h>
2780 
2781 
2782 // Must be last.
2783 
2784 #ifdef __cplusplus
2785 extern "C" {
2786 #endif
2787 
2788 /* upb_value ******************************************************************/
2789 
2790 typedef struct {
2791   uint64_t val;
2792 } upb_value;
2793 
_upb_value_setval(upb_value * v,uint64_t val)2794 UPB_INLINE void _upb_value_setval(upb_value* v, uint64_t val) { v->val = val; }
2795 
2796 /* For each value ctype, define the following set of functions:
2797  *
2798  * // Get/set an int32 from a upb_value.
2799  * int32_t upb_value_getint32(upb_value val);
2800  * void upb_value_setint32(upb_value *val, int32_t cval);
2801  *
2802  * // Construct a new upb_value from an int32.
2803  * upb_value upb_value_int32(int32_t val); */
2804 #define FUNCS(name, membername, type_t, converter)                   \
2805   UPB_INLINE void upb_value_set##name(upb_value* val, type_t cval) { \
2806     val->val = (converter)cval;                                      \
2807   }                                                                  \
2808   UPB_INLINE upb_value upb_value_##name(type_t val) {                \
2809     upb_value ret;                                                   \
2810     upb_value_set##name(&ret, val);                                  \
2811     return ret;                                                      \
2812   }                                                                  \
2813   UPB_INLINE type_t upb_value_get##name(upb_value val) {             \
2814     return (type_t)(converter)val.val;                               \
2815   }
2816 
FUNCS(int32,int32,int32_t,int32_t)2817 FUNCS(int32, int32, int32_t, int32_t)
2818 FUNCS(int64, int64, int64_t, int64_t)
2819 FUNCS(uint32, uint32, uint32_t, uint32_t)
2820 FUNCS(uint64, uint64, uint64_t, uint64_t)
2821 FUNCS(bool, _bool, bool, bool)
2822 FUNCS(cstr, cstr, char*, uintptr_t)
2823 FUNCS(uintptr, uptr, uintptr_t, uintptr_t)
2824 FUNCS(ptr, ptr, void*, uintptr_t)
2825 FUNCS(constptr, constptr, const void*, uintptr_t)
2826 
2827 #undef FUNCS
2828 
2829 UPB_INLINE void upb_value_setfloat(upb_value* val, float cval) {
2830   memcpy(&val->val, &cval, sizeof(cval));
2831 }
2832 
upb_value_setdouble(upb_value * val,double cval)2833 UPB_INLINE void upb_value_setdouble(upb_value* val, double cval) {
2834   memcpy(&val->val, &cval, sizeof(cval));
2835 }
2836 
upb_value_float(float cval)2837 UPB_INLINE upb_value upb_value_float(float cval) {
2838   upb_value ret;
2839   upb_value_setfloat(&ret, cval);
2840   return ret;
2841 }
2842 
upb_value_double(double cval)2843 UPB_INLINE upb_value upb_value_double(double cval) {
2844   upb_value ret;
2845   upb_value_setdouble(&ret, cval);
2846   return ret;
2847 }
2848 
2849 /* upb_tabkey *****************************************************************/
2850 
2851 /* Either:
2852  *   1. an actual integer key, or
2853  *   2. a pointer to a string prefixed by its uint32_t length, owned by us.
2854  *
2855  * ...depending on whether this is a string table or an int table.  We would
2856  * make this a union of those two types, but C89 doesn't support statically
2857  * initializing a non-first union member. */
2858 typedef uintptr_t upb_tabkey;
2859 
upb_tabstr(upb_tabkey key,uint32_t * len)2860 UPB_INLINE char* upb_tabstr(upb_tabkey key, uint32_t* len) {
2861   char* mem = (char*)key;
2862   if (len) memcpy(len, mem, sizeof(*len));
2863   return mem + sizeof(*len);
2864 }
2865 
upb_tabstrview(upb_tabkey key)2866 UPB_INLINE upb_StringView upb_tabstrview(upb_tabkey key) {
2867   upb_StringView ret;
2868   uint32_t len;
2869   ret.data = upb_tabstr(key, &len);
2870   ret.size = len;
2871   return ret;
2872 }
2873 
2874 /* upb_tabval *****************************************************************/
2875 
2876 typedef struct upb_tabval {
2877   uint64_t val;
2878 } upb_tabval;
2879 
2880 #define UPB_TABVALUE_EMPTY_INIT \
2881   { -1 }
2882 
2883 /* upb_table ******************************************************************/
2884 
2885 typedef struct _upb_tabent {
2886   upb_tabkey key;
2887   upb_tabval val;
2888 
2889   /* Internal chaining.  This is const so we can create static initializers for
2890    * tables.  We cast away const sometimes, but *only* when the containing
2891    * upb_table is known to be non-const.  This requires a bit of care, but
2892    * the subtlety is confined to table.c. */
2893   const struct _upb_tabent* next;
2894 } upb_tabent;
2895 
2896 typedef struct {
2897   size_t count;       /* Number of entries in the hash part. */
2898   uint32_t mask;      /* Mask to turn hash value -> bucket. */
2899   uint32_t max_count; /* Max count before we hit our load limit. */
2900   uint8_t size_lg2;   /* Size of the hashtable part is 2^size_lg2 entries. */
2901   upb_tabent* entries;
2902 } upb_table;
2903 
upb_table_size(const upb_table * t)2904 UPB_INLINE size_t upb_table_size(const upb_table* t) {
2905   return t->size_lg2 ? 1 << t->size_lg2 : 0;
2906 }
2907 
2908 // Internal-only functions, in .h file only out of necessity.
2909 
upb_tabent_isempty(const upb_tabent * e)2910 UPB_INLINE bool upb_tabent_isempty(const upb_tabent* e) { return e->key == 0; }
2911 
2912 uint32_t _upb_Hash(const void* p, size_t n, uint64_t seed);
2913 
2914 #ifdef __cplusplus
2915 } /* extern "C" */
2916 #endif
2917 
2918 
2919 #endif /* UPB_HASH_COMMON_H_ */
2920 
2921 // Must be last.
2922 
2923 typedef struct {
2924   upb_table t;
2925 } upb_strtable;
2926 
2927 #ifdef __cplusplus
2928 extern "C" {
2929 #endif
2930 
2931 // Initialize a table. If memory allocation failed, false is returned and
2932 // the table is uninitialized.
2933 bool upb_strtable_init(upb_strtable* table, size_t expected_size, upb_Arena* a);
2934 
2935 // Returns the number of values in the table.
upb_strtable_count(const upb_strtable * t)2936 UPB_INLINE size_t upb_strtable_count(const upb_strtable* t) {
2937   return t->t.count;
2938 }
2939 
2940 void upb_strtable_clear(upb_strtable* t);
2941 
2942 // Inserts the given key into the hashtable with the given value.
2943 // The key must not already exist in the hash table. The key is not required
2944 // to be NULL-terminated, and the table will make an internal copy of the key.
2945 //
2946 // If a table resize was required but memory allocation failed, false is
2947 // returned and the table is unchanged. */
2948 bool upb_strtable_insert(upb_strtable* t, const char* key, size_t len,
2949                          upb_value val, upb_Arena* a);
2950 
2951 // Looks up key in this table, returning "true" if the key was found.
2952 // If v is non-NULL, copies the value for this key into *v.
2953 bool upb_strtable_lookup2(const upb_strtable* t, const char* key, size_t len,
2954                           upb_value* v);
2955 
2956 // For NULL-terminated strings.
upb_strtable_lookup(const upb_strtable * t,const char * key,upb_value * v)2957 UPB_INLINE bool upb_strtable_lookup(const upb_strtable* t, const char* key,
2958                                     upb_value* v) {
2959   return upb_strtable_lookup2(t, key, strlen(key), v);
2960 }
2961 
2962 // Removes an item from the table. Returns true if the remove was successful,
2963 // and stores the removed item in *val if non-NULL.
2964 bool upb_strtable_remove2(upb_strtable* t, const char* key, size_t len,
2965                           upb_value* val);
2966 
upb_strtable_remove(upb_strtable * t,const char * key,upb_value * v)2967 UPB_INLINE bool upb_strtable_remove(upb_strtable* t, const char* key,
2968                                     upb_value* v) {
2969   return upb_strtable_remove2(t, key, strlen(key), v);
2970 }
2971 
2972 // Exposed for testing only.
2973 bool upb_strtable_resize(upb_strtable* t, size_t size_lg2, upb_Arena* a);
2974 
2975 /* Iteration over strtable:
2976  *
2977  *   intptr_t iter = UPB_STRTABLE_BEGIN;
2978  *   upb_StringView key;
2979  *   upb_value val;
2980  *   while (upb_strtable_next2(t, &key, &val, &iter)) {
2981  *      // ...
2982  *   }
2983  */
2984 
2985 #define UPB_STRTABLE_BEGIN -1
2986 
2987 bool upb_strtable_next2(const upb_strtable* t, upb_StringView* key,
2988                         upb_value* val, intptr_t* iter);
2989 void upb_strtable_removeiter(upb_strtable* t, intptr_t* iter);
2990 void upb_strtable_setentryvalue(upb_strtable* t, intptr_t iter, upb_value v);
2991 
2992 /* DEPRECATED iterators, slated for removal.
2993  *
2994  * Iterators for string tables.  We are subject to some kind of unusual
2995  * design constraints:
2996  *
2997  * For high-level languages:
2998  *  - we must be able to guarantee that we don't crash or corrupt memory even if
2999  *    the program accesses an invalidated iterator.
3000  *
3001  * For C++11 range-based for:
3002  *  - iterators must be copyable
3003  *  - iterators must be comparable
3004  *  - it must be possible to construct an "end" value.
3005  *
3006  * Iteration order is undefined.
3007  *
3008  * Modifying the table invalidates iterators.  upb_{str,int}table_done() is
3009  * guaranteed to work even on an invalidated iterator, as long as the table it
3010  * is iterating over has not been freed.  Calling next() or accessing data from
3011  * an invalidated iterator yields unspecified elements from the table, but it is
3012  * guaranteed not to crash and to return real table elements (except when done()
3013  * is true). */
3014 /* upb_strtable_iter **********************************************************/
3015 
3016 /*   upb_strtable_iter i;
3017  *   upb_strtable_begin(&i, t);
3018  *   for(; !upb_strtable_done(&i); upb_strtable_next(&i)) {
3019  *     const char *key = upb_strtable_iter_key(&i);
3020  *     const upb_value val = upb_strtable_iter_value(&i);
3021  *     // ...
3022  *   }
3023  */
3024 
3025 typedef struct {
3026   const upb_strtable* t;
3027   size_t index;
3028 } upb_strtable_iter;
3029 
str_tabent(const upb_strtable_iter * i)3030 UPB_INLINE const upb_tabent* str_tabent(const upb_strtable_iter* i) {
3031   return &i->t->t.entries[i->index];
3032 }
3033 
3034 void upb_strtable_begin(upb_strtable_iter* i, const upb_strtable* t);
3035 void upb_strtable_next(upb_strtable_iter* i);
3036 bool upb_strtable_done(const upb_strtable_iter* i);
3037 upb_StringView upb_strtable_iter_key(const upb_strtable_iter* i);
3038 upb_value upb_strtable_iter_value(const upb_strtable_iter* i);
3039 void upb_strtable_iter_setdone(upb_strtable_iter* i);
3040 bool upb_strtable_iter_isequal(const upb_strtable_iter* i1,
3041                                const upb_strtable_iter* i2);
3042 
3043 #ifdef __cplusplus
3044 } /* extern "C" */
3045 #endif
3046 
3047 
3048 #endif /* UPB_HASH_STR_TABLE_H_ */
3049 
3050 // Must be last.
3051 
3052 typedef enum {
3053   kUpb_MapInsertStatus_Inserted = 0,
3054   kUpb_MapInsertStatus_Replaced = 1,
3055   kUpb_MapInsertStatus_OutOfMemory = 2,
3056 } upb_MapInsertStatus;
3057 
3058 // EVERYTHING BELOW THIS LINE IS INTERNAL - DO NOT USE /////////////////////////
3059 
3060 struct upb_Map {
3061   // Size of key and val, based on the map type.
3062   // Strings are represented as '0' because they must be handled specially.
3063   char key_size;
3064   char val_size;
3065   bool UPB_PRIVATE(is_frozen);
3066 
3067   upb_strtable table;
3068 };
3069 
3070 #ifdef __cplusplus
3071 extern "C" {
3072 #endif
3073 
UPB_PRIVATE(_upb_Map_ShallowFreeze)3074 UPB_INLINE void UPB_PRIVATE(_upb_Map_ShallowFreeze)(struct upb_Map* map) {
3075   map->UPB_PRIVATE(is_frozen) = true;
3076 }
3077 
upb_Map_IsFrozen(const struct upb_Map * map)3078 UPB_API_INLINE bool upb_Map_IsFrozen(const struct upb_Map* map) {
3079   return map->UPB_PRIVATE(is_frozen);
3080 }
3081 
3082 // Converting between internal table representation and user values.
3083 //
3084 // _upb_map_tokey() and _upb_map_fromkey() are inverses.
3085 // _upb_map_tovalue() and _upb_map_fromvalue() are inverses.
3086 //
3087 // These functions account for the fact that strings are treated differently
3088 // from other types when stored in a map.
3089 
_upb_map_tokey(const void * key,size_t size)3090 UPB_INLINE upb_StringView _upb_map_tokey(const void* key, size_t size) {
3091   if (size == UPB_MAPTYPE_STRING) {
3092     return *(upb_StringView*)key;
3093   } else {
3094     return upb_StringView_FromDataAndSize((const char*)key, size);
3095   }
3096 }
3097 
_upb_map_fromkey(upb_StringView key,void * out,size_t size)3098 UPB_INLINE void _upb_map_fromkey(upb_StringView key, void* out, size_t size) {
3099   if (size == UPB_MAPTYPE_STRING) {
3100     memcpy(out, &key, sizeof(key));
3101   } else {
3102     memcpy(out, key.data, size);
3103   }
3104 }
3105 
_upb_map_tovalue(const void * val,size_t size,upb_value * msgval,upb_Arena * a)3106 UPB_INLINE bool _upb_map_tovalue(const void* val, size_t size,
3107                                  upb_value* msgval, upb_Arena* a) {
3108   if (size == UPB_MAPTYPE_STRING) {
3109     upb_StringView* strp = (upb_StringView*)upb_Arena_Malloc(a, sizeof(*strp));
3110     if (!strp) return false;
3111     *strp = *(upb_StringView*)val;
3112     *msgval = upb_value_ptr(strp);
3113   } else {
3114     memcpy(msgval, val, size);
3115   }
3116   return true;
3117 }
3118 
_upb_map_fromvalue(upb_value val,void * out,size_t size)3119 UPB_INLINE void _upb_map_fromvalue(upb_value val, void* out, size_t size) {
3120   if (size == UPB_MAPTYPE_STRING) {
3121     const upb_StringView* strp = (const upb_StringView*)upb_value_getptr(val);
3122     memcpy(out, strp, sizeof(upb_StringView));
3123   } else {
3124     memcpy(out, &val, size);
3125   }
3126 }
3127 
_upb_map_next(const struct upb_Map * map,size_t * iter)3128 UPB_INLINE void* _upb_map_next(const struct upb_Map* map, size_t* iter) {
3129   upb_strtable_iter it;
3130   it.t = &map->table;
3131   it.index = *iter;
3132   upb_strtable_next(&it);
3133   *iter = it.index;
3134   if (upb_strtable_done(&it)) return NULL;
3135   return (void*)str_tabent(&it);
3136 }
3137 
_upb_Map_Clear(struct upb_Map * map)3138 UPB_INLINE void _upb_Map_Clear(struct upb_Map* map) {
3139   UPB_ASSERT(!upb_Map_IsFrozen(map));
3140 
3141   upb_strtable_clear(&map->table);
3142 }
3143 
_upb_Map_Delete(struct upb_Map * map,const void * key,size_t key_size,upb_value * val)3144 UPB_INLINE bool _upb_Map_Delete(struct upb_Map* map, const void* key,
3145                                 size_t key_size, upb_value* val) {
3146   UPB_ASSERT(!upb_Map_IsFrozen(map));
3147 
3148   upb_StringView k = _upb_map_tokey(key, key_size);
3149   return upb_strtable_remove2(&map->table, k.data, k.size, val);
3150 }
3151 
_upb_Map_Get(const struct upb_Map * map,const void * key,size_t key_size,void * val,size_t val_size)3152 UPB_INLINE bool _upb_Map_Get(const struct upb_Map* map, const void* key,
3153                              size_t key_size, void* val, size_t val_size) {
3154   upb_value tabval;
3155   upb_StringView k = _upb_map_tokey(key, key_size);
3156   bool ret = upb_strtable_lookup2(&map->table, k.data, k.size, &tabval);
3157   if (ret && val) {
3158     _upb_map_fromvalue(tabval, val, val_size);
3159   }
3160   return ret;
3161 }
3162 
_upb_Map_Insert(struct upb_Map * map,const void * key,size_t key_size,void * val,size_t val_size,upb_Arena * a)3163 UPB_INLINE upb_MapInsertStatus _upb_Map_Insert(struct upb_Map* map,
3164                                                const void* key, size_t key_size,
3165                                                void* val, size_t val_size,
3166                                                upb_Arena* a) {
3167   UPB_ASSERT(!upb_Map_IsFrozen(map));
3168 
3169   upb_StringView strkey = _upb_map_tokey(key, key_size);
3170   upb_value tabval = {0};
3171   if (!_upb_map_tovalue(val, val_size, &tabval, a)) {
3172     return kUpb_MapInsertStatus_OutOfMemory;
3173   }
3174 
3175   // TODO: add overwrite operation to minimize number of lookups.
3176   bool removed =
3177       upb_strtable_remove2(&map->table, strkey.data, strkey.size, NULL);
3178   if (!upb_strtable_insert(&map->table, strkey.data, strkey.size, tabval, a)) {
3179     return kUpb_MapInsertStatus_OutOfMemory;
3180   }
3181   return removed ? kUpb_MapInsertStatus_Replaced
3182                  : kUpb_MapInsertStatus_Inserted;
3183 }
3184 
_upb_Map_Size(const struct upb_Map * map)3185 UPB_INLINE size_t _upb_Map_Size(const struct upb_Map* map) {
3186   return map->table.t.count;
3187 }
3188 
3189 // Strings/bytes are special-cased in maps.
3190 extern char _upb_Map_CTypeSizeTable[12];
3191 
_upb_Map_CTypeSize(upb_CType ctype)3192 UPB_INLINE size_t _upb_Map_CTypeSize(upb_CType ctype) {
3193   return _upb_Map_CTypeSizeTable[ctype];
3194 }
3195 
3196 // Creates a new map on the given arena with this key/value type.
3197 struct upb_Map* _upb_Map_New(upb_Arena* a, size_t key_size, size_t value_size);
3198 
3199 #ifdef __cplusplus
3200 } /* extern "C" */
3201 #endif
3202 
3203 
3204 #endif /* UPB_MESSAGE_INTERNAL_MAP_H_ */
3205 
3206 #ifndef UPB_MINI_TABLE_INTERNAL_TAGGED_PTR_H_
3207 #define UPB_MINI_TABLE_INTERNAL_TAGGED_PTR_H_
3208 
3209 #include <stdint.h>
3210 
3211 
3212 // Must be last.
3213 
3214 #ifdef __cplusplus
3215 extern "C" {
3216 #endif
3217 
3218 // Internal-only because empty messages cannot be created by the user.
3219 UPB_INLINE uintptr_t
UPB_PRIVATE(_upb_TaggedMessagePtr_Pack)3220 UPB_PRIVATE(_upb_TaggedMessagePtr_Pack)(struct upb_Message* ptr, bool empty) {
3221   UPB_ASSERT(((uintptr_t)ptr & 1) == 0);
3222   return (uintptr_t)ptr | (empty ? 1 : 0);
3223 }
3224 
upb_TaggedMessagePtr_IsEmpty(uintptr_t ptr)3225 UPB_API_INLINE bool upb_TaggedMessagePtr_IsEmpty(uintptr_t ptr) {
3226   return ptr & 1;
3227 }
3228 
UPB_PRIVATE(_upb_TaggedMessagePtr_GetMessage)3229 UPB_INLINE struct upb_Message* UPB_PRIVATE(_upb_TaggedMessagePtr_GetMessage)(
3230     uintptr_t ptr) {
3231   return (struct upb_Message*)(ptr & ~(uintptr_t)1);
3232 }
3233 
upb_TaggedMessagePtr_GetNonEmptyMessage(uintptr_t ptr)3234 UPB_API_INLINE struct upb_Message* upb_TaggedMessagePtr_GetNonEmptyMessage(
3235     uintptr_t ptr) {
3236   UPB_ASSERT(!upb_TaggedMessagePtr_IsEmpty(ptr));
3237   return UPB_PRIVATE(_upb_TaggedMessagePtr_GetMessage)(ptr);
3238 }
3239 
UPB_PRIVATE(_upb_TaggedMessagePtr_GetEmptyMessage)3240 UPB_INLINE struct upb_Message* UPB_PRIVATE(
3241     _upb_TaggedMessagePtr_GetEmptyMessage)(uintptr_t ptr) {
3242   UPB_ASSERT(upb_TaggedMessagePtr_IsEmpty(ptr));
3243   return UPB_PRIVATE(_upb_TaggedMessagePtr_GetMessage)(ptr);
3244 }
3245 
3246 #ifdef __cplusplus
3247 } /* extern "C" */
3248 #endif
3249 
3250 
3251 #endif /* UPB_MINI_TABLE_INTERNAL_TAGGED_PTR_H_ */
3252 
3253 // Must be last.
3254 
3255 #if defined(__GNUC__) && !defined(__clang__)
3256 // GCC raises incorrect warnings in these functions.  It thinks that we are
3257 // overrunning buffers, but we carefully write the functions in this file to
3258 // guarantee that this is impossible.  GCC gets this wrong due it its failure
3259 // to perform constant propagation as we expect:
3260 //   - https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108217
3261 //   - https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108226
3262 //
3263 // Unfortunately this also indicates that GCC is not optimizing away the
3264 // switch() in cases where it should be, compromising the performance.
3265 #pragma GCC diagnostic push
3266 #pragma GCC diagnostic ignored "-Warray-bounds"
3267 #pragma GCC diagnostic ignored "-Wstringop-overflow"
3268 #if __GNUC__ >= 11
3269 #pragma GCC diagnostic ignored "-Wstringop-overread"
3270 #endif
3271 #endif
3272 
3273 #ifdef __cplusplus
3274 extern "C" {
3275 #endif
3276 
3277 // LINT.IfChange(presence_logic)
3278 
3279 // Hasbit access ///////////////////////////////////////////////////////////////
3280 
UPB_PRIVATE(_upb_Message_GetHasbit)3281 UPB_INLINE bool UPB_PRIVATE(_upb_Message_GetHasbit)(
3282     const struct upb_Message* msg, const upb_MiniTableField* f) {
3283   const size_t offset = UPB_PRIVATE(_upb_MiniTableField_HasbitOffset)(f);
3284   const char mask = UPB_PRIVATE(_upb_MiniTableField_HasbitMask)(f);
3285 
3286   return (*UPB_PTR_AT(msg, offset, const char) & mask) != 0;
3287 }
3288 
UPB_PRIVATE(_upb_Message_SetHasbit)3289 UPB_INLINE void UPB_PRIVATE(_upb_Message_SetHasbit)(
3290     const struct upb_Message* msg, const upb_MiniTableField* f) {
3291   const size_t offset = UPB_PRIVATE(_upb_MiniTableField_HasbitOffset)(f);
3292   const char mask = UPB_PRIVATE(_upb_MiniTableField_HasbitMask)(f);
3293 
3294   (*UPB_PTR_AT(msg, offset, char)) |= mask;
3295 }
3296 
UPB_PRIVATE(_upb_Message_ClearHasbit)3297 UPB_INLINE void UPB_PRIVATE(_upb_Message_ClearHasbit)(
3298     const struct upb_Message* msg, const upb_MiniTableField* f) {
3299   const size_t offset = UPB_PRIVATE(_upb_MiniTableField_HasbitOffset)(f);
3300   const char mask = UPB_PRIVATE(_upb_MiniTableField_HasbitMask)(f);
3301 
3302   (*UPB_PTR_AT(msg, offset, char)) &= ~mask;
3303 }
3304 
3305 // Oneof case access ///////////////////////////////////////////////////////////
3306 
UPB_PRIVATE(_upb_Message_OneofCasePtr)3307 UPB_INLINE uint32_t* UPB_PRIVATE(_upb_Message_OneofCasePtr)(
3308     struct upb_Message* msg, const upb_MiniTableField* f) {
3309   return UPB_PTR_AT(msg, UPB_PRIVATE(_upb_MiniTableField_OneofOffset)(f),
3310                     uint32_t);
3311 }
3312 
UPB_PRIVATE(_upb_Message_GetOneofCase)3313 UPB_INLINE uint32_t UPB_PRIVATE(_upb_Message_GetOneofCase)(
3314     const struct upb_Message* msg, const upb_MiniTableField* f) {
3315   const uint32_t* ptr =
3316       UPB_PRIVATE(_upb_Message_OneofCasePtr)((struct upb_Message*)msg, f);
3317 
3318   return *ptr;
3319 }
3320 
UPB_PRIVATE(_upb_Message_SetOneofCase)3321 UPB_INLINE void UPB_PRIVATE(_upb_Message_SetOneofCase)(
3322     struct upb_Message* msg, const upb_MiniTableField* f) {
3323   uint32_t* ptr = UPB_PRIVATE(_upb_Message_OneofCasePtr)(msg, f);
3324 
3325   *ptr = upb_MiniTableField_Number(f);
3326 }
3327 
3328 // Returns true if the given field is the current oneof case.
3329 // Does nothing if it is not the current oneof case.
UPB_PRIVATE(_upb_Message_ClearOneofCase)3330 UPB_INLINE bool UPB_PRIVATE(_upb_Message_ClearOneofCase)(
3331     struct upb_Message* msg, const upb_MiniTableField* f) {
3332   uint32_t* ptr = UPB_PRIVATE(_upb_Message_OneofCasePtr)(msg, f);
3333 
3334   if (*ptr != upb_MiniTableField_Number(f)) return false;
3335   *ptr = 0;
3336   return true;
3337 }
3338 
upb_Message_WhichOneofFieldNumber(const struct upb_Message * message,const upb_MiniTableField * oneof_field)3339 UPB_API_INLINE uint32_t upb_Message_WhichOneofFieldNumber(
3340     const struct upb_Message* message, const upb_MiniTableField* oneof_field) {
3341   UPB_ASSUME(upb_MiniTableField_IsInOneof(oneof_field));
3342   return UPB_PRIVATE(_upb_Message_GetOneofCase)(message, oneof_field);
3343 }
3344 
upb_Message_WhichOneof(const struct upb_Message * msg,const upb_MiniTable * m,const upb_MiniTableField * f)3345 UPB_API_INLINE const upb_MiniTableField* upb_Message_WhichOneof(
3346     const struct upb_Message* msg, const upb_MiniTable* m,
3347     const upb_MiniTableField* f) {
3348   uint32_t field_number = upb_Message_WhichOneofFieldNumber(msg, f);
3349   if (field_number == 0) {
3350     // No field in the oneof is set.
3351     return NULL;
3352   }
3353   return upb_MiniTable_FindFieldByNumber(m, field_number);
3354 }
3355 
3356 // LINT.ThenChange(GoogleInternalName2)
3357 
3358 // Returns false if the message is missing any of its required fields.
UPB_PRIVATE(_upb_Message_IsInitializedShallow)3359 UPB_INLINE bool UPB_PRIVATE(_upb_Message_IsInitializedShallow)(
3360     const struct upb_Message* msg, const upb_MiniTable* m) {
3361   uint64_t bits;
3362   memcpy(&bits, msg + 1, sizeof(bits));
3363   bits = upb_BigEndian64(bits);
3364   return (UPB_PRIVATE(_upb_MiniTable_RequiredMask)(m) & ~bits) == 0;
3365 }
3366 
UPB_PRIVATE(_upb_Message_MutableDataPtr)3367 UPB_INLINE void* UPB_PRIVATE(_upb_Message_MutableDataPtr)(
3368     struct upb_Message* msg, const upb_MiniTableField* f) {
3369   return (char*)msg + f->UPB_ONLYBITS(offset);
3370 }
3371 
UPB_PRIVATE(_upb_Message_DataPtr)3372 UPB_INLINE const void* UPB_PRIVATE(_upb_Message_DataPtr)(
3373     const struct upb_Message* msg, const upb_MiniTableField* f) {
3374   return (const char*)msg + f->UPB_ONLYBITS(offset);
3375 }
3376 
UPB_PRIVATE(_upb_Message_SetPresence)3377 UPB_INLINE void UPB_PRIVATE(_upb_Message_SetPresence)(
3378     struct upb_Message* msg, const upb_MiniTableField* f) {
3379   if (UPB_PRIVATE(_upb_MiniTableField_HasHasbit)(f)) {
3380     UPB_PRIVATE(_upb_Message_SetHasbit)(msg, f);
3381   } else if (upb_MiniTableField_IsInOneof(f)) {
3382     UPB_PRIVATE(_upb_Message_SetOneofCase)(msg, f);
3383   }
3384 }
3385 
UPB_PRIVATE(_upb_MiniTableField_DataCopy)3386 UPB_INLINE void UPB_PRIVATE(_upb_MiniTableField_DataCopy)(
3387     const upb_MiniTableField* f, void* to, const void* from) {
3388   switch (UPB_PRIVATE(_upb_MiniTableField_GetRep)(f)) {
3389     case kUpb_FieldRep_1Byte:
3390       memcpy(to, from, 1);
3391       return;
3392     case kUpb_FieldRep_4Byte:
3393       memcpy(to, from, 4);
3394       return;
3395     case kUpb_FieldRep_8Byte:
3396       memcpy(to, from, 8);
3397       return;
3398     case kUpb_FieldRep_StringView: {
3399       memcpy(to, from, sizeof(upb_StringView));
3400       return;
3401     }
3402   }
3403   UPB_UNREACHABLE();
3404 }
3405 
UPB_PRIVATE(_upb_MiniTableField_DataEquals)3406 UPB_INLINE bool UPB_PRIVATE(_upb_MiniTableField_DataEquals)(
3407     const upb_MiniTableField* f, const void* a, const void* b) {
3408   switch (UPB_PRIVATE(_upb_MiniTableField_GetRep)(f)) {
3409     case kUpb_FieldRep_1Byte:
3410       return memcmp(a, b, 1) == 0;
3411     case kUpb_FieldRep_4Byte:
3412       return memcmp(a, b, 4) == 0;
3413     case kUpb_FieldRep_8Byte:
3414       return memcmp(a, b, 8) == 0;
3415     case kUpb_FieldRep_StringView: {
3416       const upb_StringView sa = *(const upb_StringView*)a;
3417       const upb_StringView sb = *(const upb_StringView*)b;
3418       return upb_StringView_IsEqual(sa, sb);
3419     }
3420   }
3421   UPB_UNREACHABLE();
3422 }
3423 
UPB_PRIVATE(_upb_MiniTableField_DataClear)3424 UPB_INLINE void UPB_PRIVATE(_upb_MiniTableField_DataClear)(
3425     const upb_MiniTableField* f, void* val) {
3426   const char zero[16] = {0};
3427   UPB_PRIVATE(_upb_MiniTableField_DataCopy)(f, val, zero);
3428 }
3429 
UPB_PRIVATE(_upb_MiniTableField_DataIsZero)3430 UPB_INLINE bool UPB_PRIVATE(_upb_MiniTableField_DataIsZero)(
3431     const upb_MiniTableField* f, const void* val) {
3432   const char zero[16] = {0};
3433   return UPB_PRIVATE(_upb_MiniTableField_DataEquals)(f, val, zero);
3434 }
3435 
3436 // Here we define universal getter/setter functions for message fields.
3437 // These look very branchy and inefficient, but as long as the MiniTableField
3438 // values are known at compile time, all the branches are optimized away and
3439 // we are left with ideal code.  This can happen either through through
3440 // literals or UPB_ASSUME():
3441 //
3442 //   // Via struct literals.
3443 //   bool FooMessage_set_bool_field(const upb_Message* msg, bool val) {
3444 //     const upb_MiniTableField field = {1, 0, 0, /* etc... */};
3445 //     // All value in "field" are compile-time known.
3446 //     upb_Message_SetBaseField(msg, &field, &value);
3447 //   }
3448 //
3449 //   // Via UPB_ASSUME().
3450 //   UPB_INLINE bool upb_Message_SetBool(upb_Message* msg,
3451 //                                       const upb_MiniTableField* field,
3452 //                                       bool value, upb_Arena* a) {
3453 //     UPB_ASSUME(field->UPB_PRIVATE(descriptortype) == kUpb_FieldType_Bool);
3454 //     UPB_ASSUME(UPB_PRIVATE(_upb_MiniTableField_GetRep)(field) ==
3455 //                kUpb_FieldRep_1Byte);
3456 //     upb_Message_SetField(msg, field, &value, a);
3457 //   }
3458 //
3459 // As a result, we can use these universal getters/setters for *all* message
3460 // accessors: generated code, MiniTable accessors, and reflection.  The only
3461 // exception is the binary encoder/decoder, which need to be a bit more clever
3462 // about how they read/write the message data, for efficiency.
3463 //
3464 // These functions work on both extensions and non-extensions. If the field
3465 // of a setter is known to be a non-extension, the arena may be NULL and the
3466 // returned bool value may be ignored since it will always succeed.
3467 
upb_Message_HasBaseField(const struct upb_Message * msg,const upb_MiniTableField * field)3468 UPB_API_INLINE bool upb_Message_HasBaseField(const struct upb_Message* msg,
3469                                              const upb_MiniTableField* field) {
3470   UPB_ASSERT(upb_MiniTableField_HasPresence(field));
3471   UPB_ASSUME(!upb_MiniTableField_IsExtension(field));
3472   if (upb_MiniTableField_IsInOneof(field)) {
3473     return UPB_PRIVATE(_upb_Message_GetOneofCase)(msg, field) ==
3474            upb_MiniTableField_Number(field);
3475   } else {
3476     return UPB_PRIVATE(_upb_Message_GetHasbit)(msg, field);
3477   }
3478 }
3479 
upb_Message_HasExtension(const struct upb_Message * msg,const upb_MiniTableExtension * e)3480 UPB_API_INLINE bool upb_Message_HasExtension(const struct upb_Message* msg,
3481                                              const upb_MiniTableExtension* e) {
3482   UPB_ASSERT(upb_MiniTableField_HasPresence(&e->UPB_PRIVATE(field)));
3483   return UPB_PRIVATE(_upb_Message_Getext)(msg, e) != NULL;
3484 }
3485 
_upb_Message_GetNonExtensionField(const struct upb_Message * msg,const upb_MiniTableField * field,const void * default_val,void * val)3486 UPB_FORCEINLINE void _upb_Message_GetNonExtensionField(
3487     const struct upb_Message* msg, const upb_MiniTableField* field,
3488     const void* default_val, void* val) {
3489   UPB_ASSUME(!upb_MiniTableField_IsExtension(field));
3490   if ((upb_MiniTableField_IsInOneof(field) ||
3491        !UPB_PRIVATE(_upb_MiniTableField_DataIsZero)(field, default_val)) &&
3492       !upb_Message_HasBaseField(msg, field)) {
3493     UPB_PRIVATE(_upb_MiniTableField_DataCopy)(field, val, default_val);
3494     return;
3495   }
3496   UPB_PRIVATE(_upb_MiniTableField_DataCopy)
3497   (field, val, UPB_PRIVATE(_upb_Message_DataPtr)(msg, field));
3498 }
3499 
_upb_Message_GetExtensionField(const struct upb_Message * msg,const upb_MiniTableExtension * mt_ext,const void * default_val,void * val)3500 UPB_INLINE void _upb_Message_GetExtensionField(
3501     const struct upb_Message* msg, const upb_MiniTableExtension* mt_ext,
3502     const void* default_val, void* val) {
3503   const upb_Extension* ext = UPB_PRIVATE(_upb_Message_Getext)(msg, mt_ext);
3504   const upb_MiniTableField* f = &mt_ext->UPB_PRIVATE(field);
3505   UPB_ASSUME(upb_MiniTableField_IsExtension(f));
3506 
3507   if (ext) {
3508     UPB_PRIVATE(_upb_MiniTableField_DataCopy)(f, val, &ext->data);
3509   } else {
3510     UPB_PRIVATE(_upb_MiniTableField_DataCopy)(f, val, default_val);
3511   }
3512 }
3513 
3514 // NOTE: The default_val is only used for fields that support presence.
3515 // For repeated/map fields, the resulting upb_Array*/upb_Map* can be NULL if a
3516 // upb_Array/upb_Map has not been allocated yet. Array/map fields do not have
3517 // presence, so this is semantically identical to a pointer to an empty
3518 // 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)3519 UPB_API_INLINE upb_MessageValue upb_Message_GetField(
3520     const struct upb_Message* msg, const upb_MiniTableField* field,
3521     upb_MessageValue default_val) {
3522   upb_MessageValue ret;
3523   if (upb_MiniTableField_IsExtension(field)) {
3524     _upb_Message_GetExtensionField(msg, (upb_MiniTableExtension*)field,
3525                                    &default_val, &ret);
3526   } else {
3527     _upb_Message_GetNonExtensionField(msg, field, &default_val, &ret);
3528   }
3529   return ret;
3530 }
3531 
upb_Message_SetBaseField(struct upb_Message * msg,const upb_MiniTableField * f,const void * val)3532 UPB_API_INLINE void upb_Message_SetBaseField(struct upb_Message* msg,
3533                                              const upb_MiniTableField* f,
3534                                              const void* val) {
3535   UPB_ASSERT(!upb_Message_IsFrozen(msg));
3536   UPB_ASSUME(!upb_MiniTableField_IsExtension(f));
3537   UPB_PRIVATE(_upb_Message_SetPresence)(msg, f);
3538   UPB_PRIVATE(_upb_MiniTableField_DataCopy)
3539   (f, UPB_PRIVATE(_upb_Message_MutableDataPtr)(msg, f), val);
3540 }
3541 
upb_Message_SetExtension(struct upb_Message * msg,const upb_MiniTableExtension * e,const void * val,upb_Arena * a)3542 UPB_API_INLINE bool upb_Message_SetExtension(struct upb_Message* msg,
3543                                              const upb_MiniTableExtension* e,
3544                                              const void* val, upb_Arena* a) {
3545   UPB_ASSERT(!upb_Message_IsFrozen(msg));
3546   UPB_ASSERT(a);
3547   upb_Extension* ext =
3548       UPB_PRIVATE(_upb_Message_GetOrCreateExtension)(msg, e, a);
3549   if (!ext) return false;
3550   UPB_PRIVATE(_upb_MiniTableField_DataCopy)
3551   (&e->UPB_PRIVATE(field), &ext->data, val);
3552   return true;
3553 }
3554 
3555 // Sets the value of the given field in the given msg. The return value is true
3556 // if the operation completed successfully, or false if memory allocation
3557 // failed.
UPB_PRIVATE(_upb_Message_SetField)3558 UPB_INLINE bool UPB_PRIVATE(_upb_Message_SetField)(struct upb_Message* msg,
3559                                                    const upb_MiniTableField* f,
3560                                                    upb_MessageValue val,
3561                                                    upb_Arena* a) {
3562   if (upb_MiniTableField_IsExtension(f)) {
3563     const upb_MiniTableExtension* ext = (const upb_MiniTableExtension*)f;
3564     return upb_Message_SetExtension(msg, ext, &val, a);
3565   } else {
3566     upb_Message_SetBaseField(msg, f, &val);
3567     return true;
3568   }
3569 }
3570 
upb_Message_GetArray(const struct upb_Message * msg,const upb_MiniTableField * f)3571 UPB_API_INLINE const upb_Array* upb_Message_GetArray(
3572     const struct upb_Message* msg, const upb_MiniTableField* f) {
3573   UPB_PRIVATE(_upb_MiniTableField_CheckIsArray)(f);
3574   upb_Array* ret;
3575   const upb_Array* default_val = NULL;
3576   _upb_Message_GetNonExtensionField(msg, f, &default_val, &ret);
3577   return ret;
3578 }
3579 
upb_Message_GetBool(const struct upb_Message * msg,const upb_MiniTableField * f,bool default_val)3580 UPB_API_INLINE bool upb_Message_GetBool(const struct upb_Message* msg,
3581                                         const upb_MiniTableField* f,
3582                                         bool default_val) {
3583   UPB_ASSUME(upb_MiniTableField_CType(f) == kUpb_CType_Bool);
3584   UPB_ASSUME(upb_MiniTableField_IsScalar(f));
3585   UPB_ASSUME(UPB_PRIVATE(_upb_MiniTableField_GetRep)(f) == kUpb_FieldRep_1Byte);
3586   upb_MessageValue def;
3587   def.bool_val = default_val;
3588   return upb_Message_GetField(msg, f, def).bool_val;
3589 }
3590 
upb_Message_GetDouble(const struct upb_Message * msg,const upb_MiniTableField * f,double default_val)3591 UPB_API_INLINE double upb_Message_GetDouble(const struct upb_Message* msg,
3592                                             const upb_MiniTableField* f,
3593                                             double default_val) {
3594   UPB_ASSUME(upb_MiniTableField_CType(f) == kUpb_CType_Double);
3595   UPB_ASSUME(upb_MiniTableField_IsScalar(f));
3596   UPB_ASSUME(UPB_PRIVATE(_upb_MiniTableField_GetRep)(f) == kUpb_FieldRep_8Byte);
3597 
3598   upb_MessageValue def;
3599   def.double_val = default_val;
3600   return upb_Message_GetField(msg, f, def).double_val;
3601 }
3602 
upb_Message_GetFloat(const struct upb_Message * msg,const upb_MiniTableField * f,float default_val)3603 UPB_API_INLINE float upb_Message_GetFloat(const struct upb_Message* msg,
3604                                           const upb_MiniTableField* f,
3605                                           float default_val) {
3606   UPB_ASSUME(upb_MiniTableField_CType(f) == kUpb_CType_Float);
3607   UPB_ASSUME(upb_MiniTableField_IsScalar(f));
3608   UPB_ASSUME(UPB_PRIVATE(_upb_MiniTableField_GetRep)(f) == kUpb_FieldRep_4Byte);
3609 
3610   upb_MessageValue def;
3611   def.float_val = default_val;
3612   return upb_Message_GetField(msg, f, def).float_val;
3613 }
3614 
upb_Message_GetInt32(const struct upb_Message * msg,const upb_MiniTableField * f,int32_t default_val)3615 UPB_API_INLINE int32_t upb_Message_GetInt32(const struct upb_Message* msg,
3616                                             const upb_MiniTableField* f,
3617                                             int32_t default_val) {
3618   UPB_ASSUME(upb_MiniTableField_CType(f) == kUpb_CType_Int32 ||
3619              upb_MiniTableField_CType(f) == kUpb_CType_Enum);
3620   UPB_ASSUME(upb_MiniTableField_IsScalar(f));
3621   UPB_ASSUME(UPB_PRIVATE(_upb_MiniTableField_GetRep)(f) == kUpb_FieldRep_4Byte);
3622 
3623   upb_MessageValue def;
3624   def.int32_val = default_val;
3625   return upb_Message_GetField(msg, f, def).int32_val;
3626 }
3627 
upb_Message_GetInt64(const struct upb_Message * msg,const upb_MiniTableField * f,int64_t default_val)3628 UPB_API_INLINE int64_t upb_Message_GetInt64(const struct upb_Message* msg,
3629                                             const upb_MiniTableField* f,
3630                                             int64_t default_val) {
3631   UPB_ASSUME(upb_MiniTableField_CType(f) == kUpb_CType_Int64);
3632   UPB_ASSUME(upb_MiniTableField_IsScalar(f));
3633   UPB_ASSUME(UPB_PRIVATE(_upb_MiniTableField_GetRep)(f) == kUpb_FieldRep_8Byte);
3634 
3635   upb_MessageValue def;
3636   def.int64_val = default_val;
3637   return upb_Message_GetField(msg, f, def).int64_val;
3638 }
3639 
UPB_PRIVATE(_upb_Message_AssertMapIsUntagged)3640 UPB_INLINE void UPB_PRIVATE(_upb_Message_AssertMapIsUntagged)(
3641     const struct upb_Message* msg, const upb_MiniTableField* field) {
3642   UPB_UNUSED(msg);
3643   UPB_PRIVATE(_upb_MiniTableField_CheckIsMap)(field);
3644 #ifndef NDEBUG
3645   uintptr_t default_val = 0;
3646   uintptr_t tagged;
3647   _upb_Message_GetNonExtensionField(msg, field, &default_val, &tagged);
3648   UPB_ASSERT(!upb_TaggedMessagePtr_IsEmpty(tagged));
3649 #endif
3650 }
3651 
upb_Message_GetMap(const struct upb_Message * msg,const upb_MiniTableField * f)3652 UPB_API_INLINE const struct upb_Map* upb_Message_GetMap(
3653     const struct upb_Message* msg, const upb_MiniTableField* f) {
3654   UPB_PRIVATE(_upb_MiniTableField_CheckIsMap)(f);
3655   UPB_PRIVATE(_upb_Message_AssertMapIsUntagged)(msg, f);
3656   struct upb_Map* ret;
3657   const struct upb_Map* default_val = NULL;
3658   _upb_Message_GetNonExtensionField(msg, f, &default_val, &ret);
3659   return ret;
3660 }
3661 
upb_Message_GetTaggedMessagePtr(const struct upb_Message * msg,const upb_MiniTableField * f,struct upb_Message * default_val)3662 UPB_API_INLINE uintptr_t upb_Message_GetTaggedMessagePtr(
3663     const struct upb_Message* msg, const upb_MiniTableField* f,
3664     struct upb_Message* default_val) {
3665   UPB_ASSUME(upb_MiniTableField_CType(f) == kUpb_CType_Message);
3666   UPB_ASSUME(UPB_PRIVATE(_upb_MiniTableField_GetRep)(f) ==
3667              UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte));
3668   UPB_ASSUME(upb_MiniTableField_IsScalar(f));
3669   uintptr_t tagged;
3670   _upb_Message_GetNonExtensionField(msg, f, &default_val, &tagged);
3671   return tagged;
3672 }
3673 
3674 // For internal use only; users cannot set tagged messages because only the
3675 // parser and the message copier are allowed to directly create an empty
3676 // message.
UPB_PRIVATE(_upb_Message_SetTaggedMessagePtr)3677 UPB_INLINE void UPB_PRIVATE(_upb_Message_SetTaggedMessagePtr)(
3678     struct upb_Message* msg, const upb_MiniTableField* f,
3679     uintptr_t sub_message) {
3680   UPB_ASSUME(upb_MiniTableField_CType(f) == kUpb_CType_Message);
3681   UPB_ASSUME(UPB_PRIVATE(_upb_MiniTableField_GetRep)(f) ==
3682              UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte));
3683   UPB_ASSUME(upb_MiniTableField_IsScalar(f));
3684   upb_Message_SetBaseField(msg, f, &sub_message);
3685 }
3686 
upb_Message_GetMessage(const struct upb_Message * msg,const upb_MiniTableField * f)3687 UPB_API_INLINE const struct upb_Message* upb_Message_GetMessage(
3688     const struct upb_Message* msg, const upb_MiniTableField* f) {
3689   uintptr_t tagged = upb_Message_GetTaggedMessagePtr(msg, f, NULL);
3690   return upb_TaggedMessagePtr_GetNonEmptyMessage(tagged);
3691 }
3692 
upb_Message_GetMutableArray(struct upb_Message * msg,const upb_MiniTableField * f)3693 UPB_API_INLINE upb_Array* upb_Message_GetMutableArray(
3694     struct upb_Message* msg, const upb_MiniTableField* f) {
3695   UPB_PRIVATE(_upb_MiniTableField_CheckIsArray)(f);
3696   return (upb_Array*)upb_Message_GetArray(msg, f);
3697 }
3698 
upb_Message_GetMutableMap(struct upb_Message * msg,const upb_MiniTableField * f)3699 UPB_API_INLINE struct upb_Map* upb_Message_GetMutableMap(
3700     struct upb_Message* msg, const upb_MiniTableField* f) {
3701   return (struct upb_Map*)upb_Message_GetMap(msg, f);
3702 }
3703 
upb_Message_GetMutableMessage(struct upb_Message * msg,const upb_MiniTableField * f)3704 UPB_API_INLINE struct upb_Message* upb_Message_GetMutableMessage(
3705     struct upb_Message* msg, const upb_MiniTableField* f) {
3706   return (struct upb_Message*)upb_Message_GetMessage(msg, f);
3707 }
3708 
upb_Message_GetOrCreateMutableArray(struct upb_Message * msg,const upb_MiniTableField * f,upb_Arena * arena)3709 UPB_API_INLINE upb_Array* upb_Message_GetOrCreateMutableArray(
3710     struct upb_Message* msg, const upb_MiniTableField* f, upb_Arena* arena) {
3711   UPB_ASSERT(arena);
3712   UPB_PRIVATE(_upb_MiniTableField_CheckIsArray)(f);
3713   upb_Array* array = upb_Message_GetMutableArray(msg, f);
3714   if (!array) {
3715     array = UPB_PRIVATE(_upb_Array_New)(
3716         arena, 4, UPB_PRIVATE(_upb_MiniTableField_ElemSizeLg2)(f));
3717     // Check again due to: https://godbolt.org/z/7WfaoKG1r
3718     UPB_PRIVATE(_upb_MiniTableField_CheckIsArray)(f);
3719     upb_MessageValue val;
3720     val.array_val = array;
3721     UPB_PRIVATE(_upb_Message_SetField)(msg, f, val, arena);
3722   }
3723   return array;
3724 }
3725 
_upb_Message_GetOrCreateMutableMap(struct upb_Message * msg,const upb_MiniTableField * field,size_t key_size,size_t val_size,upb_Arena * arena)3726 UPB_INLINE struct upb_Map* _upb_Message_GetOrCreateMutableMap(
3727     struct upb_Message* msg, const upb_MiniTableField* field, size_t key_size,
3728     size_t val_size, upb_Arena* arena) {
3729   UPB_PRIVATE(_upb_MiniTableField_CheckIsMap)(field);
3730   UPB_PRIVATE(_upb_Message_AssertMapIsUntagged)(msg, field);
3731   struct upb_Map* map = NULL;
3732   struct upb_Map* default_map_value = NULL;
3733   _upb_Message_GetNonExtensionField(msg, field, &default_map_value, &map);
3734   if (!map) {
3735     map = _upb_Map_New(arena, key_size, val_size);
3736     // Check again due to: https://godbolt.org/z/7WfaoKG1r
3737     UPB_PRIVATE(_upb_MiniTableField_CheckIsMap)(field);
3738     upb_Message_SetBaseField(msg, field, &map);
3739   }
3740   return map;
3741 }
3742 
upb_Message_GetOrCreateMutableMap(struct upb_Message * msg,const upb_MiniTable * map_entry_mini_table,const upb_MiniTableField * f,upb_Arena * arena)3743 UPB_API_INLINE struct upb_Map* upb_Message_GetOrCreateMutableMap(
3744     struct upb_Message* msg, const upb_MiniTable* map_entry_mini_table,
3745     const upb_MiniTableField* f, upb_Arena* arena) {
3746   UPB_ASSUME(upb_MiniTableField_CType(f) == kUpb_CType_Message);
3747   const upb_MiniTableField* map_entry_key_field =
3748       &map_entry_mini_table->UPB_ONLYBITS(fields)[0];
3749   const upb_MiniTableField* map_entry_value_field =
3750       &map_entry_mini_table->UPB_ONLYBITS(fields)[1];
3751   return _upb_Message_GetOrCreateMutableMap(
3752       msg, f, _upb_Map_CTypeSize(upb_MiniTableField_CType(map_entry_key_field)),
3753       _upb_Map_CTypeSize(upb_MiniTableField_CType(map_entry_value_field)),
3754       arena);
3755 }
3756 
upb_Message_GetOrCreateMutableMessage(struct upb_Message * msg,const upb_MiniTable * mini_table,const upb_MiniTableField * f,upb_Arena * arena)3757 UPB_API_INLINE struct upb_Message* upb_Message_GetOrCreateMutableMessage(
3758     struct upb_Message* msg, const upb_MiniTable* mini_table,
3759     const upb_MiniTableField* f, upb_Arena* arena) {
3760   UPB_ASSERT(arena);
3761   UPB_ASSUME(upb_MiniTableField_CType(f) == kUpb_CType_Message);
3762   UPB_ASSUME(!upb_MiniTableField_IsExtension(f));
3763   struct upb_Message* sub_message =
3764       *UPB_PTR_AT(msg, f->UPB_ONLYBITS(offset), struct upb_Message*);
3765   if (!sub_message) {
3766     const upb_MiniTable* sub_mini_table =
3767         upb_MiniTable_SubMessage(mini_table, f);
3768     UPB_ASSERT(sub_mini_table);
3769     sub_message = _upb_Message_New(sub_mini_table, arena);
3770     *UPB_PTR_AT(msg, f->UPB_ONLYBITS(offset), struct upb_Message*) =
3771         sub_message;
3772     UPB_PRIVATE(_upb_Message_SetPresence)(msg, f);
3773   }
3774   return sub_message;
3775 }
3776 
3777 UPB_API_INLINE upb_StringView
upb_Message_GetString(const struct upb_Message * msg,const upb_MiniTableField * f,upb_StringView default_val)3778 upb_Message_GetString(const struct upb_Message* msg,
3779                       const upb_MiniTableField* f, upb_StringView default_val) {
3780   UPB_ASSUME(upb_MiniTableField_CType(f) == kUpb_CType_String ||
3781              upb_MiniTableField_CType(f) == kUpb_CType_Bytes);
3782   UPB_ASSUME(UPB_PRIVATE(_upb_MiniTableField_GetRep)(f) ==
3783              kUpb_FieldRep_StringView);
3784 
3785   upb_MessageValue def;
3786   def.str_val = default_val;
3787   return upb_Message_GetField(msg, f, def).str_val;
3788 }
3789 
upb_Message_GetUInt32(const struct upb_Message * msg,const upb_MiniTableField * f,uint32_t default_val)3790 UPB_API_INLINE uint32_t upb_Message_GetUInt32(const struct upb_Message* msg,
3791                                               const upb_MiniTableField* f,
3792                                               uint32_t default_val) {
3793   UPB_ASSUME(upb_MiniTableField_CType(f) == kUpb_CType_UInt32);
3794   UPB_ASSUME(upb_MiniTableField_IsScalar(f));
3795   UPB_ASSUME(UPB_PRIVATE(_upb_MiniTableField_GetRep)(f) == kUpb_FieldRep_4Byte);
3796 
3797   upb_MessageValue def;
3798   def.uint32_val = default_val;
3799   return upb_Message_GetField(msg, f, def).uint32_val;
3800 }
3801 
upb_Message_GetUInt64(const struct upb_Message * msg,const upb_MiniTableField * f,uint64_t default_val)3802 UPB_API_INLINE uint64_t upb_Message_GetUInt64(const struct upb_Message* msg,
3803                                               const upb_MiniTableField* f,
3804                                               uint64_t default_val) {
3805   UPB_ASSUME(upb_MiniTableField_CType(f) == kUpb_CType_UInt64);
3806   UPB_ASSUME(upb_MiniTableField_IsScalar(f));
3807   UPB_ASSUME(UPB_PRIVATE(_upb_MiniTableField_GetRep)(f) == kUpb_FieldRep_8Byte);
3808 
3809   upb_MessageValue def;
3810   def.uint64_val = default_val;
3811   return upb_Message_GetField(msg, f, def).uint64_val;
3812 }
3813 
3814 // BaseField Setters ///////////////////////////////////////////////////////////
3815 
upb_Message_SetBaseFieldBool(struct upb_Message * msg,const upb_MiniTableField * f,bool value)3816 UPB_API_INLINE void upb_Message_SetBaseFieldBool(struct upb_Message* msg,
3817                                                  const upb_MiniTableField* f,
3818                                                  bool value) {
3819   UPB_ASSUME(upb_MiniTableField_CType(f) == kUpb_CType_Bool);
3820   UPB_ASSUME(upb_MiniTableField_IsScalar(f));
3821   UPB_ASSUME(UPB_PRIVATE(_upb_MiniTableField_GetRep)(f) == kUpb_FieldRep_1Byte);
3822   upb_Message_SetBaseField(msg, f, &value);
3823 }
3824 
upb_Message_SetBaseFieldDouble(struct upb_Message * msg,const upb_MiniTableField * f,double value)3825 UPB_API_INLINE void upb_Message_SetBaseFieldDouble(struct upb_Message* msg,
3826                                                    const upb_MiniTableField* f,
3827                                                    double value) {
3828   UPB_ASSUME(upb_MiniTableField_CType(f) == kUpb_CType_Double);
3829   UPB_ASSUME(upb_MiniTableField_IsScalar(f));
3830   UPB_ASSUME(UPB_PRIVATE(_upb_MiniTableField_GetRep)(f) == kUpb_FieldRep_8Byte);
3831   upb_Message_SetBaseField(msg, f, &value);
3832 }
3833 
upb_Message_SetBaseFieldFloat(struct upb_Message * msg,const upb_MiniTableField * f,float value)3834 UPB_API_INLINE void upb_Message_SetBaseFieldFloat(struct upb_Message* msg,
3835                                                   const upb_MiniTableField* f,
3836                                                   float value) {
3837   UPB_ASSUME(upb_MiniTableField_CType(f) == kUpb_CType_Float);
3838   UPB_ASSUME(upb_MiniTableField_IsScalar(f));
3839   UPB_ASSUME(UPB_PRIVATE(_upb_MiniTableField_GetRep)(f) == kUpb_FieldRep_4Byte);
3840   upb_Message_SetBaseField(msg, f, &value);
3841 }
3842 
upb_Message_SetBaseFieldInt32(struct upb_Message * msg,const upb_MiniTableField * f,int32_t value)3843 UPB_API_INLINE void upb_Message_SetBaseFieldInt32(struct upb_Message* msg,
3844                                                   const upb_MiniTableField* f,
3845                                                   int32_t value) {
3846   UPB_ASSUME(upb_MiniTableField_CType(f) == kUpb_CType_Int32 ||
3847              upb_MiniTableField_CType(f) == kUpb_CType_Enum);
3848   UPB_ASSUME(upb_MiniTableField_IsScalar(f));
3849   UPB_ASSUME(UPB_PRIVATE(_upb_MiniTableField_GetRep)(f) == kUpb_FieldRep_4Byte);
3850   upb_Message_SetBaseField(msg, f, &value);
3851 }
3852 
upb_Message_SetBaseFieldInt64(struct upb_Message * msg,const upb_MiniTableField * f,int64_t value)3853 UPB_API_INLINE void upb_Message_SetBaseFieldInt64(struct upb_Message* msg,
3854                                                   const upb_MiniTableField* f,
3855                                                   int64_t value) {
3856   UPB_ASSUME(upb_MiniTableField_CType(f) == kUpb_CType_Int64);
3857   UPB_ASSUME(upb_MiniTableField_IsScalar(f));
3858   UPB_ASSUME(UPB_PRIVATE(_upb_MiniTableField_GetRep)(f) == kUpb_FieldRep_8Byte);
3859   upb_Message_SetBaseField(msg, f, &value);
3860 }
3861 
upb_Message_SetBaseFieldMessage(struct upb_Message * msg,const upb_MiniTableField * f,struct upb_Message * value)3862 UPB_API_INLINE void upb_Message_SetBaseFieldMessage(struct upb_Message* msg,
3863                                                     const upb_MiniTableField* f,
3864                                                     struct upb_Message* value) {
3865   UPB_PRIVATE(_upb_Message_SetTaggedMessagePtr)
3866   (msg, f, UPB_PRIVATE(_upb_TaggedMessagePtr_Pack)(value, false));
3867 }
3868 
upb_Message_SetBaseFieldString(struct upb_Message * msg,const upb_MiniTableField * f,upb_StringView value)3869 UPB_API_INLINE void upb_Message_SetBaseFieldString(struct upb_Message* msg,
3870                                                    const upb_MiniTableField* f,
3871                                                    upb_StringView value) {
3872   UPB_ASSUME(upb_MiniTableField_CType(f) == kUpb_CType_String ||
3873              upb_MiniTableField_CType(f) == kUpb_CType_Bytes);
3874   UPB_ASSUME(upb_MiniTableField_IsScalar(f));
3875   UPB_ASSUME(UPB_PRIVATE(_upb_MiniTableField_GetRep)(f) ==
3876              kUpb_FieldRep_StringView);
3877   upb_Message_SetBaseField(msg, f, &value);
3878 }
3879 
upb_Message_SetBaseFieldUInt32(struct upb_Message * msg,const upb_MiniTableField * f,uint32_t value)3880 UPB_API_INLINE void upb_Message_SetBaseFieldUInt32(struct upb_Message* msg,
3881                                                    const upb_MiniTableField* f,
3882                                                    uint32_t value) {
3883   UPB_ASSUME(upb_MiniTableField_CType(f) == kUpb_CType_UInt32);
3884   UPB_ASSUME(upb_MiniTableField_IsScalar(f));
3885   UPB_ASSUME(UPB_PRIVATE(_upb_MiniTableField_GetRep)(f) == kUpb_FieldRep_4Byte);
3886   upb_Message_SetBaseField(msg, f, &value);
3887 }
3888 
upb_Message_SetBaseFieldUInt64(struct upb_Message * msg,const upb_MiniTableField * f,uint64_t value)3889 UPB_API_INLINE void upb_Message_SetBaseFieldUInt64(struct upb_Message* msg,
3890                                                    const upb_MiniTableField* f,
3891                                                    uint64_t value) {
3892   UPB_ASSUME(upb_MiniTableField_CType(f) == kUpb_CType_UInt64);
3893   UPB_ASSUME(upb_MiniTableField_IsScalar(f));
3894   UPB_ASSUME(UPB_PRIVATE(_upb_MiniTableField_GetRep)(f) == kUpb_FieldRep_8Byte);
3895   upb_Message_SetBaseField(msg, f, &value);
3896 }
3897 
upb_Message_SetClosedEnum(struct upb_Message * msg,const upb_MiniTable * m,const upb_MiniTableField * f,int32_t value)3898 UPB_API_INLINE void upb_Message_SetClosedEnum(struct upb_Message* msg,
3899                                               const upb_MiniTable* m,
3900                                               const upb_MiniTableField* f,
3901                                               int32_t value) {
3902   UPB_ASSERT(upb_MiniTableField_IsClosedEnum(f));
3903   UPB_ASSUME(UPB_PRIVATE(_upb_MiniTableField_GetRep)(f) == kUpb_FieldRep_4Byte);
3904   UPB_ASSERT(
3905       upb_MiniTableEnum_CheckValue(upb_MiniTable_GetSubEnumTable(m, f), value));
3906   upb_Message_SetBaseField(msg, f, &value);
3907 }
3908 
3909 // Extension Setters ///////////////////////////////////////////////////////////
3910 
upb_Message_SetExtensionBool(struct upb_Message * msg,const upb_MiniTableExtension * e,bool value,upb_Arena * a)3911 UPB_API_INLINE bool upb_Message_SetExtensionBool(
3912     struct upb_Message* msg, const upb_MiniTableExtension* e, bool value,
3913     upb_Arena* a) {
3914   UPB_ASSUME(upb_MiniTableExtension_CType(e) == kUpb_CType_Bool);
3915   UPB_ASSUME(UPB_PRIVATE(_upb_MiniTableExtension_GetRep)(e) ==
3916              kUpb_FieldRep_1Byte);
3917   return upb_Message_SetExtension(msg, e, &value, a);
3918 }
3919 
upb_Message_SetExtensionDouble(struct upb_Message * msg,const upb_MiniTableExtension * e,double value,upb_Arena * a)3920 UPB_API_INLINE bool upb_Message_SetExtensionDouble(
3921     struct upb_Message* msg, const upb_MiniTableExtension* e, double value,
3922     upb_Arena* a) {
3923   UPB_ASSUME(upb_MiniTableExtension_CType(e) == kUpb_CType_Double);
3924   UPB_ASSUME(UPB_PRIVATE(_upb_MiniTableExtension_GetRep)(e) ==
3925              kUpb_FieldRep_8Byte);
3926   return upb_Message_SetExtension(msg, e, &value, a);
3927 }
3928 
upb_Message_SetExtensionFloat(struct upb_Message * msg,const upb_MiniTableExtension * e,float value,upb_Arena * a)3929 UPB_API_INLINE bool upb_Message_SetExtensionFloat(
3930     struct upb_Message* msg, const upb_MiniTableExtension* e, float value,
3931     upb_Arena* a) {
3932   UPB_ASSUME(upb_MiniTableExtension_CType(e) == kUpb_CType_Float);
3933   UPB_ASSUME(UPB_PRIVATE(_upb_MiniTableExtension_GetRep)(e) ==
3934              kUpb_FieldRep_4Byte);
3935   return upb_Message_SetExtension(msg, e, &value, a);
3936 }
3937 
upb_Message_SetExtensionInt32(struct upb_Message * msg,const upb_MiniTableExtension * e,int32_t value,upb_Arena * a)3938 UPB_API_INLINE bool upb_Message_SetExtensionInt32(
3939     struct upb_Message* msg, const upb_MiniTableExtension* e, int32_t value,
3940     upb_Arena* a) {
3941   UPB_ASSUME(upb_MiniTableExtension_CType(e) == kUpb_CType_Int32 ||
3942              upb_MiniTableExtension_CType(e) == kUpb_CType_Enum);
3943   UPB_ASSUME(UPB_PRIVATE(_upb_MiniTableExtension_GetRep)(e) ==
3944              kUpb_FieldRep_4Byte);
3945   return upb_Message_SetExtension(msg, e, &value, a);
3946 }
3947 
upb_Message_SetExtensionInt64(struct upb_Message * msg,const upb_MiniTableExtension * e,int64_t value,upb_Arena * a)3948 UPB_API_INLINE bool upb_Message_SetExtensionInt64(
3949     struct upb_Message* msg, const upb_MiniTableExtension* e, int64_t value,
3950     upb_Arena* a) {
3951   UPB_ASSUME(upb_MiniTableExtension_CType(e) == kUpb_CType_Int64);
3952   UPB_ASSUME(UPB_PRIVATE(_upb_MiniTableExtension_GetRep)(e) ==
3953              kUpb_FieldRep_8Byte);
3954   return upb_Message_SetExtension(msg, e, &value, a);
3955 }
3956 
upb_Message_SetExtensionString(struct upb_Message * msg,const upb_MiniTableExtension * e,upb_StringView value,upb_Arena * a)3957 UPB_API_INLINE bool upb_Message_SetExtensionString(
3958     struct upb_Message* msg, const upb_MiniTableExtension* e,
3959     upb_StringView value, upb_Arena* a) {
3960   UPB_ASSUME(upb_MiniTableExtension_CType(e) == kUpb_CType_String ||
3961              upb_MiniTableExtension_CType(e) == kUpb_CType_Bytes);
3962   UPB_ASSUME(UPB_PRIVATE(_upb_MiniTableExtension_GetRep)(e) ==
3963              kUpb_FieldRep_StringView);
3964   return upb_Message_SetExtension(msg, e, &value, a);
3965 }
3966 
upb_Message_SetExtensionUInt32(struct upb_Message * msg,const upb_MiniTableExtension * e,uint32_t value,upb_Arena * a)3967 UPB_API_INLINE bool upb_Message_SetExtensionUInt32(
3968     struct upb_Message* msg, const upb_MiniTableExtension* e, uint32_t value,
3969     upb_Arena* a) {
3970   UPB_ASSUME(upb_MiniTableExtension_CType(e) == kUpb_CType_UInt32);
3971   UPB_ASSUME(UPB_PRIVATE(_upb_MiniTableExtension_GetRep)(e) ==
3972              kUpb_FieldRep_4Byte);
3973   return upb_Message_SetExtension(msg, e, &value, a);
3974 }
3975 
upb_Message_SetExtensionUInt64(struct upb_Message * msg,const upb_MiniTableExtension * e,uint64_t value,upb_Arena * a)3976 UPB_API_INLINE bool upb_Message_SetExtensionUInt64(
3977     struct upb_Message* msg, const upb_MiniTableExtension* e, uint64_t value,
3978     upb_Arena* a) {
3979   UPB_ASSUME(upb_MiniTableExtension_CType(e) == kUpb_CType_UInt64);
3980   UPB_ASSUME(UPB_PRIVATE(_upb_MiniTableExtension_GetRep)(e) ==
3981              kUpb_FieldRep_8Byte);
3982   return upb_Message_SetExtension(msg, e, &value, a);
3983 }
3984 
3985 // Universal Setters ///////////////////////////////////////////////////////////
3986 
upb_Message_SetBool(struct upb_Message * msg,const upb_MiniTableField * f,bool value,upb_Arena * a)3987 UPB_API_INLINE bool upb_Message_SetBool(struct upb_Message* msg,
3988                                         const upb_MiniTableField* f, bool value,
3989                                         upb_Arena* a) {
3990   return upb_MiniTableField_IsExtension(f)
3991              ? upb_Message_SetExtensionBool(
3992                    msg, (const upb_MiniTableExtension*)f, value, a)
3993              : (upb_Message_SetBaseFieldBool(msg, f, value), true);
3994 }
3995 
upb_Message_SetDouble(struct upb_Message * msg,const upb_MiniTableField * f,double value,upb_Arena * a)3996 UPB_API_INLINE bool upb_Message_SetDouble(struct upb_Message* msg,
3997                                           const upb_MiniTableField* f,
3998                                           double value, upb_Arena* a) {
3999   return upb_MiniTableField_IsExtension(f)
4000              ? upb_Message_SetExtensionDouble(
4001                    msg, (const upb_MiniTableExtension*)f, value, a)
4002              : (upb_Message_SetBaseFieldDouble(msg, f, value), true);
4003 }
4004 
upb_Message_SetFloat(struct upb_Message * msg,const upb_MiniTableField * f,float value,upb_Arena * a)4005 UPB_API_INLINE bool upb_Message_SetFloat(struct upb_Message* msg,
4006                                          const upb_MiniTableField* f,
4007                                          float value, upb_Arena* a) {
4008   return upb_MiniTableField_IsExtension(f)
4009              ? upb_Message_SetExtensionFloat(
4010                    msg, (const upb_MiniTableExtension*)f, value, a)
4011              : (upb_Message_SetBaseFieldFloat(msg, f, value), true);
4012 }
4013 
upb_Message_SetInt32(struct upb_Message * msg,const upb_MiniTableField * f,int32_t value,upb_Arena * a)4014 UPB_API_INLINE bool upb_Message_SetInt32(struct upb_Message* msg,
4015                                          const upb_MiniTableField* f,
4016                                          int32_t value, upb_Arena* a) {
4017   return upb_MiniTableField_IsExtension(f)
4018              ? upb_Message_SetExtensionInt32(
4019                    msg, (const upb_MiniTableExtension*)f, value, a)
4020              : (upb_Message_SetBaseFieldInt32(msg, f, value), true);
4021 }
4022 
upb_Message_SetInt64(struct upb_Message * msg,const upb_MiniTableField * f,int64_t value,upb_Arena * a)4023 UPB_API_INLINE bool upb_Message_SetInt64(struct upb_Message* msg,
4024                                          const upb_MiniTableField* f,
4025                                          int64_t value, upb_Arena* a) {
4026   return upb_MiniTableField_IsExtension(f)
4027              ? upb_Message_SetExtensionInt64(
4028                    msg, (const upb_MiniTableExtension*)f, value, a)
4029              : (upb_Message_SetBaseFieldInt64(msg, f, value), true);
4030 }
4031 
4032 // Sets the value of a message-typed field. The mini_tables of `msg` and
4033 // `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)4034 UPB_API_INLINE void upb_Message_SetMessage(struct upb_Message* msg,
4035                                            const upb_MiniTableField* f,
4036                                            struct upb_Message* value) {
4037   UPB_ASSERT(!upb_MiniTableField_IsExtension(f));
4038   upb_Message_SetBaseFieldMessage(msg, f, value);
4039 }
4040 
4041 // Sets the value of a `string` or `bytes` field. The bytes of the value are not
4042 // copied, so it is the caller's responsibility to ensure that they remain valid
4043 // for the lifetime of `msg`. That might be done by copying them into the given
4044 // 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)4045 UPB_API_INLINE bool upb_Message_SetString(struct upb_Message* msg,
4046                                           const upb_MiniTableField* f,
4047                                           upb_StringView value, upb_Arena* a) {
4048   return upb_MiniTableField_IsExtension(f)
4049              ? upb_Message_SetExtensionString(
4050                    msg, (const upb_MiniTableExtension*)f, value, a)
4051              : (upb_Message_SetBaseFieldString(msg, f, value), true);
4052 }
4053 
upb_Message_SetUInt32(struct upb_Message * msg,const upb_MiniTableField * f,uint32_t value,upb_Arena * a)4054 UPB_API_INLINE bool upb_Message_SetUInt32(struct upb_Message* msg,
4055                                           const upb_MiniTableField* f,
4056                                           uint32_t value, upb_Arena* a) {
4057   return upb_MiniTableField_IsExtension(f)
4058              ? upb_Message_SetExtensionUInt32(
4059                    msg, (const upb_MiniTableExtension*)f, value, a)
4060              : (upb_Message_SetBaseFieldUInt32(msg, f, value), true);
4061 }
4062 
upb_Message_SetUInt64(struct upb_Message * msg,const upb_MiniTableField * f,uint64_t value,upb_Arena * a)4063 UPB_API_INLINE bool upb_Message_SetUInt64(struct upb_Message* msg,
4064                                           const upb_MiniTableField* f,
4065                                           uint64_t value, upb_Arena* a) {
4066   return upb_MiniTableField_IsExtension(f)
4067              ? upb_Message_SetExtensionUInt64(
4068                    msg, (const upb_MiniTableExtension*)f, value, a)
4069              : (upb_Message_SetBaseFieldUInt64(msg, f, value), true);
4070 }
4071 
upb_Message_Clear(struct upb_Message * msg,const upb_MiniTable * m)4072 UPB_API_INLINE void upb_Message_Clear(struct upb_Message* msg,
4073                                       const upb_MiniTable* m) {
4074   UPB_ASSERT(!upb_Message_IsFrozen(msg));
4075   upb_Message_Internal* in = UPB_PRIVATE(_upb_Message_GetInternal)(msg);
4076   memset(msg, 0, m->UPB_PRIVATE(size));
4077   if (in) {
4078     // Reset the internal buffer to empty.
4079     in->unknown_end = sizeof(upb_Message_Internal);
4080     in->ext_begin = in->size;
4081     UPB_PRIVATE(_upb_Message_SetInternal)(msg, in);
4082   }
4083 }
4084 
upb_Message_ClearBaseField(struct upb_Message * msg,const upb_MiniTableField * f)4085 UPB_API_INLINE void upb_Message_ClearBaseField(struct upb_Message* msg,
4086                                                const upb_MiniTableField* f) {
4087   UPB_ASSERT(!upb_Message_IsFrozen(msg));
4088   if (UPB_PRIVATE(_upb_MiniTableField_HasHasbit)(f)) {
4089     UPB_PRIVATE(_upb_Message_ClearHasbit)(msg, f);
4090   } else if (upb_MiniTableField_IsInOneof(f)) {
4091     uint32_t* ptr = UPB_PRIVATE(_upb_Message_OneofCasePtr)(msg, f);
4092     if (*ptr != upb_MiniTableField_Number(f)) return;
4093     *ptr = 0;
4094   }
4095   const char zeros[16] = {0};
4096   UPB_PRIVATE(_upb_MiniTableField_DataCopy)
4097   (f, UPB_PRIVATE(_upb_Message_MutableDataPtr)(msg, f), zeros);
4098 }
4099 
upb_Message_ClearExtension(struct upb_Message * msg,const upb_MiniTableExtension * e)4100 UPB_API_INLINE void upb_Message_ClearExtension(
4101     struct upb_Message* msg, const upb_MiniTableExtension* e) {
4102   UPB_ASSERT(!upb_Message_IsFrozen(msg));
4103   upb_Message_Internal* in = UPB_PRIVATE(_upb_Message_GetInternal)(msg);
4104   if (!in) return;
4105   const upb_Extension* base = UPB_PTR_AT(in, in->ext_begin, upb_Extension);
4106   upb_Extension* ext = (upb_Extension*)UPB_PRIVATE(_upb_Message_Getext)(msg, e);
4107   if (ext) {
4108     *ext = *base;
4109     in->ext_begin += sizeof(upb_Extension);
4110   }
4111 }
4112 
upb_Message_ClearOneof(struct upb_Message * msg,const upb_MiniTable * m,const upb_MiniTableField * f)4113 UPB_API_INLINE void upb_Message_ClearOneof(struct upb_Message* msg,
4114                                            const upb_MiniTable* m,
4115                                            const upb_MiniTableField* f) {
4116   UPB_ASSERT(!upb_Message_IsFrozen(msg));
4117   uint32_t field_number = upb_Message_WhichOneofFieldNumber(msg, f);
4118   if (field_number == 0) {
4119     // No field in the oneof is set.
4120     return;
4121   }
4122 
4123   const upb_MiniTableField* field =
4124       upb_MiniTable_FindFieldByNumber(m, field_number);
4125   upb_Message_ClearBaseField(msg, field);
4126 }
4127 
upb_Message_ResizeArrayUninitialized(struct upb_Message * msg,const upb_MiniTableField * f,size_t size,upb_Arena * arena)4128 UPB_API_INLINE void* upb_Message_ResizeArrayUninitialized(
4129     struct upb_Message* msg, const upb_MiniTableField* f, size_t size,
4130     upb_Arena* arena) {
4131   UPB_PRIVATE(_upb_MiniTableField_CheckIsArray)(f);
4132   upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, f, arena);
4133   if (!arr || !UPB_PRIVATE(_upb_Array_ResizeUninitialized)(arr, size, arena)) {
4134     return NULL;
4135   }
4136   return upb_Array_MutableDataPtr(arr);
4137 }
4138 
4139 #ifdef __cplusplus
4140 } /* extern "C" */
4141 #endif
4142 
4143 #if defined(__GNUC__) && !defined(__clang__)
4144 #pragma GCC diagnostic pop
4145 #endif
4146 
4147 
4148 #endif  // UPB_MESSAGE_INTERNAL_ACCESSORS_H_
4149 
4150 #ifndef UPB_MESSAGE_MAP_H_
4151 #define UPB_MESSAGE_MAP_H_
4152 
4153 #include <stddef.h>
4154 
4155 
4156 // Must be last.
4157 
4158 typedef struct upb_Map upb_Map;
4159 
4160 #ifdef __cplusplus
4161 extern "C" {
4162 #endif
4163 
4164 // Creates a new map on the given arena with the given key/value size.
4165 UPB_API upb_Map* upb_Map_New(upb_Arena* a, upb_CType key_type,
4166                              upb_CType value_type);
4167 
4168 // Returns the number of entries in the map.
4169 UPB_API size_t upb_Map_Size(const upb_Map* map);
4170 
4171 // Stores a value for the given key into |*val| (or the zero value if the key is
4172 // not present). Returns whether the key was present. The |val| pointer may be
4173 // NULL, in which case the function tests whether the given key is present.
4174 UPB_API bool upb_Map_Get(const upb_Map* map, upb_MessageValue key,
4175                          upb_MessageValue* val);
4176 
4177 // Removes all entries in the map.
4178 UPB_API void upb_Map_Clear(upb_Map* map);
4179 
4180 // Sets the given key to the given value, returning whether the key was inserted
4181 // or replaced. If the key was inserted, then any existing iterators will be
4182 // invalidated.
4183 UPB_API upb_MapInsertStatus upb_Map_Insert(upb_Map* map, upb_MessageValue key,
4184                                            upb_MessageValue val,
4185                                            upb_Arena* arena);
4186 
4187 // Sets the given key to the given value. Returns false if memory allocation
4188 // failed. If the key is newly inserted, then any existing iterators will be
4189 // invalidated.
upb_Map_Set(upb_Map * map,upb_MessageValue key,upb_MessageValue val,upb_Arena * arena)4190 UPB_API_INLINE bool upb_Map_Set(upb_Map* map, upb_MessageValue key,
4191                                 upb_MessageValue val, upb_Arena* arena) {
4192   return upb_Map_Insert(map, key, val, arena) !=
4193          kUpb_MapInsertStatus_OutOfMemory;
4194 }
4195 
4196 // Deletes this key from the table. Returns true if the key was present.
4197 // If present and |val| is non-NULL, stores the deleted value.
4198 UPB_API bool upb_Map_Delete(upb_Map* map, upb_MessageValue key,
4199                             upb_MessageValue* val);
4200 
4201 // Map iteration:
4202 //
4203 // size_t iter = kUpb_Map_Begin;
4204 // upb_MessageValue key, val;
4205 // while (upb_Map_Next(map, &key, &val, &iter)) {
4206 //   ...
4207 // }
4208 
4209 #define kUpb_Map_Begin ((size_t) - 1)
4210 
4211 // Advances to the next entry. Returns false if no more entries are present.
4212 // Otherwise returns true and populates both *key and *value.
4213 UPB_API bool upb_Map_Next(const upb_Map* map, upb_MessageValue* key,
4214                           upb_MessageValue* val, size_t* iter);
4215 
4216 // Sets the value for the entry pointed to by iter.
4217 // WARNING: this does not currently work for string values!
4218 UPB_API void upb_Map_SetEntryValue(upb_Map* map, size_t iter,
4219                                    upb_MessageValue val);
4220 
4221 // DEPRECATED iterator, slated for removal.
4222 
4223 /* Map iteration:
4224  *
4225  * size_t iter = kUpb_Map_Begin;
4226  * while (upb_MapIterator_Next(map, &iter)) {
4227  *   upb_MessageValue key = upb_MapIterator_Key(map, iter);
4228  *   upb_MessageValue val = upb_MapIterator_Value(map, iter);
4229  * }
4230  */
4231 
4232 // Advances to the next entry. Returns false if no more entries are present.
4233 UPB_API bool upb_MapIterator_Next(const upb_Map* map, size_t* iter);
4234 
4235 // Returns true if the iterator still points to a valid entry, or false if the
4236 // iterator is past the last element. It is an error to call this function with
4237 // kUpb_Map_Begin (you must call next() at least once first).
4238 UPB_API bool upb_MapIterator_Done(const upb_Map* map, size_t iter);
4239 
4240 // Returns the key and value for this entry of the map.
4241 UPB_API upb_MessageValue upb_MapIterator_Key(const upb_Map* map, size_t iter);
4242 UPB_API upb_MessageValue upb_MapIterator_Value(const upb_Map* map, size_t iter);
4243 
4244 // Mark a map and all of its descendents as frozen/immutable.
4245 // If the map values are messages then |m| must point to the minitable for
4246 // those messages. Otherwise |m| must be NULL.
4247 UPB_API void upb_Map_Freeze(upb_Map* map, const upb_MiniTable* m);
4248 
4249 // Returns whether a map has been frozen.
4250 UPB_API_INLINE bool upb_Map_IsFrozen(const upb_Map* map);
4251 
4252 #ifdef __cplusplus
4253 } /* extern "C" */
4254 #endif
4255 
4256 
4257 #endif /* UPB_MESSAGE_MAP_H_ */
4258 
4259 #ifndef UPB_MINI_TABLE_TAGGED_PTR_H_
4260 #define UPB_MINI_TABLE_TAGGED_PTR_H_
4261 
4262 #include <stdint.h>
4263 
4264 
4265 // Must be last.
4266 
4267 // When a upb_Message* is stored in a message, array, or map, it is stored in a
4268 // tagged form. If the tag bit is set, the referenced upb_Message is of type
4269 // _kUpb_MiniTable_Empty (a sentinel message type with no fields) instead of
4270 // that field's true message type. This forms the basis of what we call
4271 // "dynamic tree shaking."
4272 //
4273 // See the documentation for kUpb_DecodeOption_ExperimentalAllowUnlinked for
4274 // more information.
4275 
4276 typedef uintptr_t upb_TaggedMessagePtr;
4277 
4278 #ifdef __cplusplus
4279 extern "C" {
4280 #endif
4281 
4282 // Users who enable unlinked sub-messages must use this to test whether a
4283 // message is empty before accessing it. If a message is empty, it must be
4284 // first promoted using the interfaces in message/promote.h.
4285 UPB_API_INLINE bool upb_TaggedMessagePtr_IsEmpty(upb_TaggedMessagePtr ptr);
4286 
4287 UPB_API_INLINE upb_Message* upb_TaggedMessagePtr_GetNonEmptyMessage(
4288     upb_TaggedMessagePtr ptr);
4289 
4290 #ifdef __cplusplus
4291 } /* extern "C" */
4292 #endif
4293 
4294 
4295 #endif /* UPB_MINI_TABLE_TAGGED_PTR_H_ */
4296 
4297 // Must be last.
4298 
4299 #ifdef __cplusplus
4300 extern "C" {
4301 #endif
4302 
4303 // Functions ending in BaseField() take a (upb_MiniTableField*) argument
4304 // and work only on non-extension fields.
4305 //
4306 // Functions ending in Extension() take a (upb_MiniTableExtension*) argument
4307 // and work only on extensions.
4308 
4309 UPB_API_INLINE void upb_Message_Clear(upb_Message* msg, const upb_MiniTable* m);
4310 
4311 UPB_API_INLINE void upb_Message_ClearBaseField(upb_Message* msg,
4312                                                const upb_MiniTableField* f);
4313 
4314 UPB_API_INLINE void upb_Message_ClearExtension(upb_Message* msg,
4315                                                const upb_MiniTableExtension* e);
4316 
4317 UPB_API_INLINE void upb_Message_ClearOneof(upb_Message* msg,
4318                                            const upb_MiniTable* m,
4319                                            const upb_MiniTableField* f);
4320 
4321 UPB_API_INLINE bool upb_Message_HasBaseField(const upb_Message* msg,
4322                                              const upb_MiniTableField* f);
4323 
4324 UPB_API_INLINE bool upb_Message_HasExtension(const upb_Message* msg,
4325                                              const upb_MiniTableExtension* e);
4326 
4327 UPB_API_INLINE upb_MessageValue
4328 upb_Message_GetField(const upb_Message* msg, const upb_MiniTableField* f,
4329                      upb_MessageValue default_val);
4330 
4331 UPB_API_INLINE upb_TaggedMessagePtr upb_Message_GetTaggedMessagePtr(
4332     const upb_Message* msg, const upb_MiniTableField* field,
4333     upb_Message* default_val);
4334 
4335 UPB_API_INLINE const upb_Array* upb_Message_GetArray(
4336     const upb_Message* msg, const upb_MiniTableField* f);
4337 
4338 UPB_API_INLINE bool upb_Message_GetBool(const upb_Message* msg,
4339                                         const upb_MiniTableField* f,
4340                                         bool default_val);
4341 
4342 UPB_API_INLINE double upb_Message_GetDouble(const upb_Message* msg,
4343                                             const upb_MiniTableField* field,
4344                                             double default_val);
4345 
4346 UPB_API_INLINE float upb_Message_GetFloat(const upb_Message* msg,
4347                                           const upb_MiniTableField* f,
4348                                           float default_val);
4349 
4350 UPB_API_INLINE int32_t upb_Message_GetInt32(const upb_Message* msg,
4351                                             const upb_MiniTableField* f,
4352                                             int32_t default_val);
4353 
4354 UPB_API_INLINE int64_t upb_Message_GetInt64(const upb_Message* msg,
4355                                             const upb_MiniTableField* f,
4356                                             int64_t default_val);
4357 
4358 UPB_API_INLINE const upb_Map* upb_Message_GetMap(const upb_Message* msg,
4359                                                  const upb_MiniTableField* f);
4360 
4361 UPB_API_INLINE const upb_Message* upb_Message_GetMessage(
4362     const upb_Message* msg, const upb_MiniTableField* f);
4363 
4364 UPB_API_INLINE upb_Array* upb_Message_GetMutableArray(
4365     upb_Message* msg, const upb_MiniTableField* f);
4366 
4367 UPB_API_INLINE upb_Map* upb_Message_GetMutableMap(upb_Message* msg,
4368                                                   const upb_MiniTableField* f);
4369 
4370 UPB_API_INLINE upb_Message* upb_Message_GetMutableMessage(
4371     upb_Message* msg, const upb_MiniTableField* f);
4372 
4373 UPB_API_INLINE upb_Array* upb_Message_GetOrCreateMutableArray(
4374     upb_Message* msg, const upb_MiniTableField* f, upb_Arena* arena);
4375 
4376 UPB_API_INLINE upb_Map* upb_Message_GetOrCreateMutableMap(
4377     upb_Message* msg, const upb_MiniTable* map_entry_mini_table,
4378     const upb_MiniTableField* f, upb_Arena* arena);
4379 
4380 UPB_API_INLINE upb_Message* upb_Message_GetOrCreateMutableMessage(
4381     upb_Message* msg, const upb_MiniTable* mini_table,
4382     const upb_MiniTableField* f, upb_Arena* arena);
4383 
4384 UPB_API_INLINE upb_StringView
4385 upb_Message_GetString(const upb_Message* msg, const upb_MiniTableField* field,
4386                       upb_StringView default_val);
4387 
4388 UPB_API_INLINE uint32_t upb_Message_GetUInt32(const upb_Message* msg,
4389                                               const upb_MiniTableField* f,
4390                                               uint32_t default_val);
4391 
4392 UPB_API_INLINE uint64_t upb_Message_GetUInt64(const upb_Message* msg,
4393                                               const upb_MiniTableField* f,
4394                                               uint64_t default_val);
4395 
4396 UPB_API_INLINE void upb_Message_SetClosedEnum(
4397     upb_Message* msg, const upb_MiniTable* msg_mini_table,
4398     const upb_MiniTableField* f, int32_t value);
4399 
4400 // BaseField Setters ///////////////////////////////////////////////////////////
4401 
4402 UPB_API_INLINE void upb_Message_SetBaseField(upb_Message* msg,
4403                                              const upb_MiniTableField* f,
4404                                              const void* val);
4405 
4406 UPB_API_INLINE void upb_Message_SetBaseFieldBool(struct upb_Message* msg,
4407                                                  const upb_MiniTableField* f,
4408                                                  bool value);
4409 
4410 UPB_API_INLINE void upb_Message_SetBaseFieldDouble(struct upb_Message* msg,
4411                                                    const upb_MiniTableField* f,
4412                                                    double value);
4413 
4414 UPB_API_INLINE void upb_Message_SetBaseFieldFloat(struct upb_Message* msg,
4415                                                   const upb_MiniTableField* f,
4416                                                   float value);
4417 
4418 UPB_API_INLINE void upb_Message_SetBaseFieldInt32(struct upb_Message* msg,
4419                                                   const upb_MiniTableField* f,
4420                                                   int32_t value);
4421 
4422 UPB_API_INLINE void upb_Message_SetBaseFieldInt64(struct upb_Message* msg,
4423                                                   const upb_MiniTableField* f,
4424                                                   int64_t value);
4425 
4426 UPB_API_INLINE void upb_Message_SetBaseFieldMessage(struct upb_Message* msg,
4427                                                     const upb_MiniTableField* f,
4428                                                     upb_Message* value);
4429 
4430 UPB_API_INLINE void upb_Message_SetBaseFieldString(struct upb_Message* msg,
4431                                                    const upb_MiniTableField* f,
4432                                                    upb_StringView value);
4433 
4434 UPB_API_INLINE void upb_Message_SetBaseFieldUInt32(struct upb_Message* msg,
4435                                                    const upb_MiniTableField* f,
4436                                                    uint32_t value);
4437 
4438 UPB_API_INLINE void upb_Message_SetBaseFieldUInt64(struct upb_Message* msg,
4439                                                    const upb_MiniTableField* f,
4440                                                    uint64_t value);
4441 
4442 // Extension Setters ///////////////////////////////////////////////////////////
4443 
4444 UPB_API_INLINE bool upb_Message_SetExtension(upb_Message* msg,
4445                                              const upb_MiniTableExtension* e,
4446                                              const void* value, upb_Arena* a);
4447 
4448 UPB_API_INLINE bool upb_Message_SetExtensionBool(
4449     struct upb_Message* msg, const upb_MiniTableExtension* e, bool value,
4450     upb_Arena* a);
4451 
4452 UPB_API_INLINE bool upb_Message_SetExtensionDouble(
4453     struct upb_Message* msg, const upb_MiniTableExtension* e, double value,
4454     upb_Arena* a);
4455 
4456 UPB_API_INLINE bool upb_Message_SetExtensionFloat(
4457     struct upb_Message* msg, const upb_MiniTableExtension* e, float value,
4458     upb_Arena* a);
4459 
4460 UPB_API_INLINE bool upb_Message_SetExtensionInt32(
4461     struct upb_Message* msg, const upb_MiniTableExtension* e, int32_t value,
4462     upb_Arena* a);
4463 
4464 UPB_API_INLINE bool upb_Message_SetExtensionInt64(
4465     struct upb_Message* msg, const upb_MiniTableExtension* e, int64_t value,
4466     upb_Arena* a);
4467 
4468 UPB_API_INLINE bool upb_Message_SetExtensionString(
4469     struct upb_Message* msg, const upb_MiniTableExtension* e,
4470     upb_StringView value, upb_Arena* a);
4471 
4472 UPB_API_INLINE bool upb_Message_SetExtensionUInt32(
4473     struct upb_Message* msg, const upb_MiniTableExtension* e, uint32_t value,
4474     upb_Arena* a);
4475 
4476 UPB_API_INLINE bool upb_Message_SetExtensionUInt64(
4477     struct upb_Message* msg, const upb_MiniTableExtension* e, uint64_t value,
4478     upb_Arena* a);
4479 
4480 // Universal Setters ///////////////////////////////////////////////////////////
4481 
4482 UPB_API_INLINE bool upb_Message_SetBool(upb_Message* msg,
4483                                         const upb_MiniTableField* f, bool value,
4484                                         upb_Arena* a);
4485 
4486 UPB_API_INLINE bool upb_Message_SetDouble(upb_Message* msg,
4487                                           const upb_MiniTableField* f,
4488                                           double value, upb_Arena* a);
4489 
4490 UPB_API_INLINE bool upb_Message_SetFloat(upb_Message* msg,
4491                                          const upb_MiniTableField* f,
4492                                          float value, upb_Arena* a);
4493 
4494 UPB_API_INLINE bool upb_Message_SetInt32(upb_Message* msg,
4495                                          const upb_MiniTableField* f,
4496                                          int32_t value, upb_Arena* a);
4497 
4498 UPB_API_INLINE bool upb_Message_SetInt64(upb_Message* msg,
4499                                          const upb_MiniTableField* f,
4500                                          int64_t value, upb_Arena* a);
4501 
4502 // Unlike the other similarly-named setters, this function can only be
4503 // called on base fields. Prefer upb_Message_SetBaseFieldMessage().
4504 UPB_API_INLINE void upb_Message_SetMessage(upb_Message* msg,
4505                                            const upb_MiniTableField* f,
4506                                            upb_Message* value);
4507 
4508 UPB_API_INLINE bool upb_Message_SetString(upb_Message* msg,
4509                                           const upb_MiniTableField* f,
4510                                           upb_StringView value, upb_Arena* a);
4511 
4512 UPB_API_INLINE bool upb_Message_SetUInt32(upb_Message* msg,
4513                                           const upb_MiniTableField* f,
4514                                           uint32_t value, upb_Arena* a);
4515 
4516 UPB_API_INLINE bool upb_Message_SetUInt64(upb_Message* msg,
4517                                           const upb_MiniTableField* f,
4518                                           uint64_t value, upb_Arena* a);
4519 
4520 ////////////////////////////////////////////////////////////////////////////////
4521 
4522 UPB_API_INLINE void* upb_Message_ResizeArrayUninitialized(
4523     upb_Message* msg, const upb_MiniTableField* f, size_t size,
4524     upb_Arena* arena);
4525 
4526 UPB_API_INLINE uint32_t upb_Message_WhichOneofFieldNumber(
4527     const upb_Message* message, const upb_MiniTableField* oneof_field);
4528 
4529 // For a field `f` which is in a oneof, return the field of that
4530 // oneof that is actually set (or NULL if none).
4531 UPB_API_INLINE const upb_MiniTableField* upb_Message_WhichOneof(
4532     const upb_Message* msg, const upb_MiniTable* m,
4533     const upb_MiniTableField* f);
4534 
4535 // Updates a map entry given an entry message.
4536 bool upb_Message_SetMapEntry(upb_Map* map, const upb_MiniTable* mini_table,
4537                              const upb_MiniTableField* field,
4538                              upb_Message* map_entry_message, upb_Arena* arena);
4539 
4540 #ifdef __cplusplus
4541 } /* extern "C" */
4542 #endif
4543 
4544 
4545 #endif  // UPB_MESSAGE_ACCESSORS_H_
4546 
4547 // These functions are only used by generated code.
4548 
4549 #ifndef UPB_MESSAGE_MAP_GENCODE_UTIL_H_
4550 #define UPB_MESSAGE_MAP_GENCODE_UTIL_H_
4551 
4552 
4553 // Must be last.
4554 
4555 #ifdef __cplusplus
4556 extern "C" {
4557 #endif
4558 
4559 // Message map operations, these get the map from the message first.
4560 
_upb_msg_map_key(const void * msg,void * key,size_t size)4561 UPB_INLINE void _upb_msg_map_key(const void* msg, void* key, size_t size) {
4562   const upb_tabent* ent = (const upb_tabent*)msg;
4563   uint32_t u32len;
4564   upb_StringView k;
4565   k.data = upb_tabstr(ent->key, &u32len);
4566   k.size = u32len;
4567   _upb_map_fromkey(k, key, size);
4568 }
4569 
_upb_msg_map_value(const void * msg,void * val,size_t size)4570 UPB_INLINE void _upb_msg_map_value(const void* msg, void* val, size_t size) {
4571   const upb_tabent* ent = (const upb_tabent*)msg;
4572   upb_value v = {ent->val.val};
4573   _upb_map_fromvalue(v, val, size);
4574 }
4575 
_upb_msg_map_set_value(void * msg,const void * val,size_t size)4576 UPB_INLINE void _upb_msg_map_set_value(void* msg, const void* val,
4577                                        size_t size) {
4578   upb_tabent* ent = (upb_tabent*)msg;
4579   // This is like _upb_map_tovalue() except the entry already exists
4580   // so we can reuse the allocated upb_StringView for string fields.
4581   if (size == UPB_MAPTYPE_STRING) {
4582     upb_StringView* strp = (upb_StringView*)(uintptr_t)ent->val.val;
4583     memcpy(strp, val, sizeof(*strp));
4584   } else {
4585     memcpy(&ent->val.val, val, size);
4586   }
4587 }
4588 
4589 #ifdef __cplusplus
4590 } /* extern "C" */
4591 #endif
4592 
4593 
4594 #endif /* UPB_MESSAGE_MAP_GENCODE_UTIL_H_ */
4595 
4596 #ifndef UPB_MINI_TABLE_DECODE_H_
4597 #define UPB_MINI_TABLE_DECODE_H_
4598 
4599 
4600 #ifndef UPB_MINI_TABLE_SUB_H_
4601 #define UPB_MINI_TABLE_SUB_H_
4602 
4603 
4604 // Must be last.
4605 
4606 typedef union upb_MiniTableSub upb_MiniTableSub;
4607 
4608 #ifdef __cplusplus
4609 extern "C" {
4610 #endif
4611 
4612 // Constructors
4613 
4614 UPB_API_INLINE upb_MiniTableSub
4615 upb_MiniTableSub_FromEnum(const upb_MiniTableEnum* subenum);
4616 
4617 UPB_API_INLINE upb_MiniTableSub
4618 upb_MiniTableSub_FromMessage(const upb_MiniTable* submsg);
4619 
4620 // Getters
4621 
4622 UPB_API_INLINE const upb_MiniTableEnum* upb_MiniTableSub_Enum(
4623     upb_MiniTableSub sub);
4624 
4625 UPB_API_INLINE const upb_MiniTable* upb_MiniTableSub_Message(
4626     upb_MiniTableSub sub);
4627 
4628 #ifdef __cplusplus
4629 } /* extern "C" */
4630 #endif
4631 
4632 
4633 #endif /* UPB_MINI_TABLE_SUB_H_ */
4634 
4635 // Export the newer headers, for legacy users.  New users should include the
4636 // more specific headers directly.
4637 // IWYU pragma: begin_exports
4638 
4639 #ifndef UPB_MINI_DESCRIPTOR_BUILD_ENUM_H_
4640 #define UPB_MINI_DESCRIPTOR_BUILD_ENUM_H_
4641 
4642 
4643 // Must be last.
4644 
4645 #ifdef __cplusplus
4646 extern "C" {
4647 #endif
4648 
4649 // Builds a upb_MiniTableEnum from an enum mini descriptor.
4650 // The mini descriptor must be for an enum, not a message.
4651 UPB_API upb_MiniTableEnum* upb_MiniTableEnum_Build(const char* data, size_t len,
4652                                                    upb_Arena* arena,
4653                                                    upb_Status* status);
4654 
4655 #ifdef __cplusplus
4656 } /* extern "C" */
4657 #endif
4658 
4659 
4660 #endif  // UPB_MINI_DESCRIPTOR_BUILD_ENUM_H_
4661 
4662 // Functions for linking MiniTables together once they are built from a
4663 // MiniDescriptor.
4664 //
4665 // These functions have names like upb_MiniTable_Link() because they operate on
4666 // MiniTables.  We put them here, rather than in the mini_table/ directory,
4667 // because they are only needed when building MiniTables from MiniDescriptors.
4668 // The interfaces in mini_table/ assume that MiniTables are immutable.
4669 
4670 #ifndef UPB_MINI_DESCRIPTOR_LINK_H_
4671 #define UPB_MINI_DESCRIPTOR_LINK_H_
4672 
4673 
4674 // Must be last.
4675 
4676 #ifdef __cplusplus
4677 extern "C" {
4678 #endif
4679 
4680 // Links a sub-message field to a MiniTable for that sub-message. If a
4681 // sub-message field is not linked, it will be treated as an unknown field
4682 // during parsing, and setting the field will not be allowed. It is possible
4683 // to link the message field later, at which point it will no longer be treated
4684 // as unknown. However there is no synchronization for this operation, which
4685 // means parallel mutation requires external synchronization.
4686 // Returns success/failure.
4687 UPB_API bool upb_MiniTable_SetSubMessage(upb_MiniTable* table,
4688                                          upb_MiniTableField* field,
4689                                          const upb_MiniTable* sub);
4690 
4691 // Links an enum field to a MiniTable for that enum.
4692 // All enum fields must be linked prior to parsing.
4693 // Returns success/failure.
4694 UPB_API bool upb_MiniTable_SetSubEnum(upb_MiniTable* table,
4695                                       upb_MiniTableField* field,
4696                                       const upb_MiniTableEnum* sub);
4697 
4698 // Returns a list of fields that require linking at runtime, to connect the
4699 // MiniTable to its sub-messages and sub-enums.  The list of fields will be
4700 // written to the `subs` array, which must have been allocated by the caller
4701 // and must be large enough to hold a list of all fields in the message.
4702 //
4703 // The order of the fields returned by this function is significant: it matches
4704 // the order expected by upb_MiniTable_Link() below.
4705 //
4706 // The return value packs the sub-message count and sub-enum count into a single
4707 // integer like so:
4708 //  return (msg_count << 16) | enum_count;
4709 UPB_API uint32_t upb_MiniTable_GetSubList(const upb_MiniTable* mt,
4710                                           const upb_MiniTableField** subs);
4711 
4712 // Links a message to its sub-messages and sub-enums.  The caller must pass
4713 // arrays of sub-tables and sub-enums, in the same length and order as is
4714 // returned by upb_MiniTable_GetSubList() above.  However, individual elements
4715 // of the sub_tables may be NULL if those sub-messages were tree shaken.
4716 //
4717 // Returns false if either array is too short, or if any of the tables fails
4718 // to link.
4719 UPB_API bool upb_MiniTable_Link(upb_MiniTable* mt,
4720                                 const upb_MiniTable** sub_tables,
4721                                 size_t sub_table_count,
4722                                 const upb_MiniTableEnum** sub_enums,
4723                                 size_t sub_enum_count);
4724 
4725 #ifdef __cplusplus
4726 } /* extern "C" */
4727 #endif
4728 
4729 
4730 #endif  // UPB_MINI_DESCRIPTOR_LINK_H_
4731 // IWYU pragma: end_exports
4732 
4733 // Must be last.
4734 
4735 typedef enum {
4736   kUpb_MiniTablePlatform_32Bit,
4737   kUpb_MiniTablePlatform_64Bit,
4738   kUpb_MiniTablePlatform_Native =
4739       UPB_SIZE(kUpb_MiniTablePlatform_32Bit, kUpb_MiniTablePlatform_64Bit),
4740 } upb_MiniTablePlatform;
4741 
4742 #ifdef __cplusplus
4743 extern "C" {
4744 #endif
4745 
4746 // Builds a mini table from the data encoded in the buffer [data, len]. If any
4747 // errors occur, returns NULL and sets a status message. In the success case,
4748 // the caller must call upb_MiniTable_SetSub*() for all message or proto2 enum
4749 // fields to link the table to the appropriate sub-tables.
4750 upb_MiniTable* _upb_MiniTable_Build(const char* data, size_t len,
4751                                     upb_MiniTablePlatform platform,
4752                                     upb_Arena* arena, upb_Status* status);
4753 
upb_MiniTable_Build(const char * data,size_t len,upb_Arena * arena,upb_Status * status)4754 UPB_API_INLINE upb_MiniTable* upb_MiniTable_Build(const char* data, size_t len,
4755                                                   upb_Arena* arena,
4756                                                   upb_Status* status) {
4757   return _upb_MiniTable_Build(data, len, kUpb_MiniTablePlatform_Native, arena,
4758                               status);
4759 }
4760 
4761 // Initializes a MiniTableExtension buffer that has already been allocated.
4762 // This is needed by upb_FileDef and upb_MessageDef, which allocate all of the
4763 // extensions together in a single contiguous array.
4764 const char* _upb_MiniTableExtension_Init(const char* data, size_t len,
4765                                          upb_MiniTableExtension* ext,
4766                                          const upb_MiniTable* extendee,
4767                                          upb_MiniTableSub sub,
4768                                          upb_MiniTablePlatform platform,
4769                                          upb_Status* status);
4770 
upb_MiniTableExtension_Init(const char * data,size_t len,upb_MiniTableExtension * ext,const upb_MiniTable * extendee,upb_MiniTableSub sub,upb_Status * status)4771 UPB_API_INLINE const char* upb_MiniTableExtension_Init(
4772     const char* data, size_t len, upb_MiniTableExtension* ext,
4773     const upb_MiniTable* extendee, upb_MiniTableSub sub, upb_Status* status) {
4774   return _upb_MiniTableExtension_Init(data, len, ext, extendee, sub,
4775                                       kUpb_MiniTablePlatform_Native, status);
4776 }
4777 
4778 UPB_API upb_MiniTableExtension* _upb_MiniTableExtension_Build(
4779     const char* data, size_t len, const upb_MiniTable* extendee,
4780     upb_MiniTableSub sub, upb_MiniTablePlatform platform, upb_Arena* arena,
4781     upb_Status* status);
4782 
upb_MiniTableExtension_Build(const char * data,size_t len,const upb_MiniTable * extendee,upb_Arena * arena,upb_Status * status)4783 UPB_API_INLINE upb_MiniTableExtension* upb_MiniTableExtension_Build(
4784     const char* data, size_t len, const upb_MiniTable* extendee,
4785     upb_Arena* arena, upb_Status* status) {
4786   upb_MiniTableSub sub = upb_MiniTableSub_FromMessage(NULL);
4787   return _upb_MiniTableExtension_Build(
4788       data, len, extendee, sub, kUpb_MiniTablePlatform_Native, arena, status);
4789 }
4790 
upb_MiniTableExtension_BuildMessage(const char * data,size_t len,const upb_MiniTable * extendee,upb_MiniTable * submsg,upb_Arena * arena,upb_Status * status)4791 UPB_API_INLINE upb_MiniTableExtension* upb_MiniTableExtension_BuildMessage(
4792     const char* data, size_t len, const upb_MiniTable* extendee,
4793     upb_MiniTable* submsg, upb_Arena* arena, upb_Status* status) {
4794   upb_MiniTableSub sub = upb_MiniTableSub_FromMessage(submsg);
4795   return _upb_MiniTableExtension_Build(
4796       data, len, extendee, sub, kUpb_MiniTablePlatform_Native, arena, status);
4797 }
4798 
upb_MiniTableExtension_BuildEnum(const char * data,size_t len,const upb_MiniTable * extendee,upb_MiniTableEnum * subenum,upb_Arena * arena,upb_Status * status)4799 UPB_API_INLINE upb_MiniTableExtension* upb_MiniTableExtension_BuildEnum(
4800     const char* data, size_t len, const upb_MiniTable* extendee,
4801     upb_MiniTableEnum* subenum, upb_Arena* arena, upb_Status* status) {
4802   upb_MiniTableSub sub = upb_MiniTableSub_FromEnum(subenum);
4803   return _upb_MiniTableExtension_Build(
4804       data, len, extendee, sub, kUpb_MiniTablePlatform_Native, arena, status);
4805 }
4806 
4807 // Like upb_MiniTable_Build(), but the user provides a buffer of layout data so
4808 // it can be reused from call to call, avoiding repeated realloc()/free().
4809 //
4810 // The caller owns `*buf` both before and after the call, and must free() it
4811 // when it is no longer in use.  The function will realloc() `*buf` as
4812 // necessary, updating `*size` accordingly.
4813 upb_MiniTable* upb_MiniTable_BuildWithBuf(const char* data, size_t len,
4814                                           upb_MiniTablePlatform platform,
4815                                           upb_Arena* arena, void** buf,
4816                                           size_t* buf_size, upb_Status* status);
4817 
4818 #ifdef __cplusplus
4819 } /* extern "C" */
4820 #endif
4821 
4822 
4823 #endif /* UPB_MINI_TABLE_DECODE_H_ */
4824 
4825 #ifndef UPB_MINI_TABLE_EXTENSION_REGISTRY_H_
4826 #define UPB_MINI_TABLE_EXTENSION_REGISTRY_H_
4827 
4828 
4829 // Must be last.
4830 
4831 #ifdef __cplusplus
4832 extern "C" {
4833 #endif
4834 
4835 /* Extension registry: a dynamic data structure that stores a map of:
4836  *   (upb_MiniTable, number) -> extension info
4837  *
4838  * upb_decode() uses upb_ExtensionRegistry to look up extensions while parsing
4839  * binary format.
4840  *
4841  * upb_ExtensionRegistry is part of the mini-table (msglayout) family of
4842  * objects. Like all mini-table objects, it is suitable for reflection-less
4843  * builds that do not want to expose names into the binary.
4844  *
4845  * Unlike most mini-table types, upb_ExtensionRegistry requires dynamic memory
4846  * allocation and dynamic initialization:
4847  * * If reflection is being used, then upb_DefPool will construct an appropriate
4848  *   upb_ExtensionRegistry automatically.
4849  * * For a mini-table only build, the user must manually construct the
4850  *   upb_ExtensionRegistry and populate it with all of the extensions the user
4851  * cares about.
4852  * * A third alternative is to manually unpack relevant extensions after the
4853  *   main parse is complete, similar to how Any works. This is perhaps the
4854  *   nicest solution from the perspective of reducing dependencies, avoiding
4855  *   dynamic memory allocation, and avoiding the need to parse uninteresting
4856  *   extensions.  The downsides are:
4857  *     (1) parse errors are not caught during the main parse
4858  *     (2) the CPU hit of parsing comes during access, which could cause an
4859  *         undesirable stutter in application performance.
4860  *
4861  * Users cannot directly get or put into this map. Users can only add the
4862  * extensions from a generated module and pass the extension registry to the
4863  * binary decoder.
4864  *
4865  * A upb_DefPool provides a upb_ExtensionRegistry, so any users who use
4866  * reflection do not need to populate a upb_ExtensionRegistry directly.
4867  */
4868 
4869 typedef struct upb_ExtensionRegistry upb_ExtensionRegistry;
4870 
4871 // Creates a upb_ExtensionRegistry in the given arena.
4872 // The arena must outlive any use of the extreg.
4873 UPB_API upb_ExtensionRegistry* upb_ExtensionRegistry_New(upb_Arena* arena);
4874 
4875 UPB_API bool upb_ExtensionRegistry_Add(upb_ExtensionRegistry* r,
4876                                        const upb_MiniTableExtension* e);
4877 
4878 // Adds the given extension info for the array |e| of size |count| into the
4879 // registry. If there are any errors, the entire array is backed out.
4880 // The extensions must outlive the registry.
4881 // Possible errors include OOM or an extension number that already exists.
4882 // TODO: There is currently no way to know the exact reason for failure.
4883 bool upb_ExtensionRegistry_AddArray(upb_ExtensionRegistry* r,
4884                                     const upb_MiniTableExtension** e,
4885                                     size_t count);
4886 
4887 #ifdef UPB_LINKARR_DECLARE
4888 
4889 // Adds all extensions linked into the binary into the registry.  The set of
4890 // linked extensions is assembled by the linker using linker arrays.  This
4891 // will likely not work properly if the extensions are split across multiple
4892 // shared libraries.
4893 //
4894 // Returns true if all extensions were added successfully, false on out of
4895 // memory or if any extensions were already present.
4896 //
4897 // This API is currently not available on MSVC (though it *is* available on
4898 // Windows using clang-cl).
4899 UPB_API bool upb_ExtensionRegistry_AddAllLinkedExtensions(
4900     upb_ExtensionRegistry* r);
4901 
4902 #endif  // UPB_LINKARR_DECLARE
4903 
4904 // Looks up the extension (if any) defined for message type |t| and field
4905 // number |num|. Returns the extension if found, otherwise NULL.
4906 UPB_API const upb_MiniTableExtension* upb_ExtensionRegistry_Lookup(
4907     const upb_ExtensionRegistry* r, const upb_MiniTable* t, uint32_t num);
4908 
4909 #ifdef __cplusplus
4910 } /* extern "C" */
4911 #endif
4912 
4913 
4914 #endif /* UPB_MINI_TABLE_EXTENSION_REGISTRY_H_ */
4915 
4916 #ifndef UPB_MINI_TABLE_FILE_H_
4917 #define UPB_MINI_TABLE_FILE_H_
4918 
4919 
4920 #ifndef UPB_MINI_TABLE_INTERNAL_FILE_H_
4921 #define UPB_MINI_TABLE_INTERNAL_FILE_H_
4922 
4923 // Must be last.
4924 
4925 struct upb_MiniTableFile {
4926   const struct upb_MiniTable** UPB_PRIVATE(msgs);
4927   const struct upb_MiniTableEnum** UPB_PRIVATE(enums);
4928   const struct upb_MiniTableExtension** UPB_PRIVATE(exts);
4929   int UPB_PRIVATE(msg_count);
4930   int UPB_PRIVATE(enum_count);
4931   int UPB_PRIVATE(ext_count);
4932 };
4933 
4934 #ifdef __cplusplus
4935 extern "C" {
4936 #endif
4937 
upb_MiniTableFile_EnumCount(const struct upb_MiniTableFile * f)4938 UPB_API_INLINE int upb_MiniTableFile_EnumCount(
4939     const struct upb_MiniTableFile* f) {
4940   return f->UPB_PRIVATE(enum_count);
4941 }
4942 
upb_MiniTableFile_ExtensionCount(const struct upb_MiniTableFile * f)4943 UPB_API_INLINE int upb_MiniTableFile_ExtensionCount(
4944     const struct upb_MiniTableFile* f) {
4945   return f->UPB_PRIVATE(ext_count);
4946 }
4947 
upb_MiniTableFile_MessageCount(const struct upb_MiniTableFile * f)4948 UPB_API_INLINE int upb_MiniTableFile_MessageCount(
4949     const struct upb_MiniTableFile* f) {
4950   return f->UPB_PRIVATE(msg_count);
4951 }
4952 
upb_MiniTableFile_Enum(const struct upb_MiniTableFile * f,int i)4953 UPB_API_INLINE const struct upb_MiniTableEnum* upb_MiniTableFile_Enum(
4954     const struct upb_MiniTableFile* f, int i) {
4955   UPB_ASSERT(i < f->UPB_PRIVATE(enum_count));
4956   return f->UPB_PRIVATE(enums)[i];
4957 }
4958 
upb_MiniTableFile_Extension(const struct upb_MiniTableFile * f,int i)4959 UPB_API_INLINE const struct upb_MiniTableExtension* upb_MiniTableFile_Extension(
4960     const struct upb_MiniTableFile* f, int i) {
4961   UPB_ASSERT(i < f->UPB_PRIVATE(ext_count));
4962   return f->UPB_PRIVATE(exts)[i];
4963 }
4964 
upb_MiniTableFile_Message(const struct upb_MiniTableFile * f,int i)4965 UPB_API_INLINE const struct upb_MiniTable* upb_MiniTableFile_Message(
4966     const struct upb_MiniTableFile* f, int i) {
4967   UPB_ASSERT(i < f->UPB_PRIVATE(msg_count));
4968   return f->UPB_PRIVATE(msgs)[i];
4969 }
4970 
4971 #ifdef __cplusplus
4972 } /* extern "C" */
4973 #endif
4974 
4975 
4976 #endif /* UPB_MINI_TABLE_INTERNAL_FILE_H_ */
4977 
4978 // Must be last.
4979 
4980 typedef struct upb_MiniTableFile upb_MiniTableFile;
4981 
4982 #ifdef __cplusplus
4983 extern "C" {
4984 #endif
4985 
4986 UPB_API_INLINE const upb_MiniTableEnum* upb_MiniTableFile_Enum(
4987     const upb_MiniTableFile* f, int i);
4988 
4989 UPB_API_INLINE int upb_MiniTableFile_EnumCount(const upb_MiniTableFile* f);
4990 
4991 UPB_API_INLINE const upb_MiniTableExtension* upb_MiniTableFile_Extension(
4992     const upb_MiniTableFile* f, int i);
4993 
4994 UPB_API_INLINE int upb_MiniTableFile_ExtensionCount(const upb_MiniTableFile* f);
4995 
4996 UPB_API_INLINE const upb_MiniTable* upb_MiniTableFile_Message(
4997     const upb_MiniTableFile* f, int i);
4998 
4999 UPB_API_INLINE int upb_MiniTableFile_MessageCount(const upb_MiniTableFile* f);
5000 
5001 #ifdef __cplusplus
5002 } /* extern "C" */
5003 #endif
5004 
5005 
5006 #endif /* UPB_MINI_TABLE_FILE_H_ */
5007 
5008 // upb_decode: parsing into a upb_Message using a upb_MiniTable.
5009 
5010 #ifndef UPB_WIRE_DECODE_H_
5011 #define UPB_WIRE_DECODE_H_
5012 
5013 #include <stddef.h>
5014 #include <stdint.h>
5015 
5016 
5017 // Must be last.
5018 
5019 #ifdef __cplusplus
5020 extern "C" {
5021 #endif
5022 
5023 enum {
5024   /* If set, strings will alias the input buffer instead of copying into the
5025    * arena. */
5026   kUpb_DecodeOption_AliasString = 1,
5027 
5028   /* If set, the parse will return failure if any message is missing any
5029    * required fields when the message data ends.  The parse will still continue,
5030    * and the failure will only be reported at the end.
5031    *
5032    * IMPORTANT CAVEATS:
5033    *
5034    * 1. This can throw a false positive failure if an incomplete message is seen
5035    *    on the wire but is later completed when the sub-message occurs again.
5036    *    For this reason, a second pass is required to verify a failure, to be
5037    *    truly robust.
5038    *
5039    * 2. This can return a false success if you are decoding into a message that
5040    *    already has some sub-message fields present.  If the sub-message does
5041    *    not occur in the binary payload, we will never visit it and discover the
5042    *    incomplete sub-message.  For this reason, this check is only useful for
5043    *    implementing ParseFromString() semantics.  For MergeFromString(), a
5044    *    post-parse validation step will always be necessary. */
5045   kUpb_DecodeOption_CheckRequired = 2,
5046 
5047   /* EXPERIMENTAL:
5048    *
5049    * If set, the parser will allow parsing of sub-message fields that were not
5050    * previously linked using upb_MiniTable_SetSubMessage().  The data will be
5051    * parsed into an internal "empty" message type that cannot be accessed
5052    * directly, but can be later promoted into the true message type if the
5053    * sub-message fields are linked at a later time.
5054    *
5055    * Users should set this option if they intend to perform dynamic tree shaking
5056    * and promoting using the interfaces in message/promote.h.  If this option is
5057    * enabled, it is important that the resulting messages are only accessed by
5058    * code that is aware of promotion rules:
5059    *
5060    * 1. Message pointers in upb_Message, upb_Array, and upb_Map are represented
5061    *    by a tagged pointer upb_TaggedMessagePointer.  The tag indicates whether
5062    *    the message uses the internal "empty" type.
5063    *
5064    * 2. Any code *reading* these message pointers must test whether the "empty"
5065    *    tag bit is set, using the interfaces in mini_table/types.h.  However
5066    *    writing of message pointers should always use plain upb_Message*, since
5067    *    users are not allowed to create "empty" messages.
5068    *
5069    * 3. It is always safe to test whether a field is present or test the array
5070    *    length; these interfaces will reflect that empty messages are present,
5071    *    even though their data cannot be accessed without promoting first.
5072    *
5073    * 4. If a message pointer is indeed tagged as empty, the message may not be
5074    *    accessed directly, only promoted through the interfaces in
5075    *    message/promote.h.
5076    *
5077    * 5. Tagged/empty messages may never be created by the user.  They may only
5078    *    be created by the parser or the message-copying logic in message/copy.h.
5079    */
5080   kUpb_DecodeOption_ExperimentalAllowUnlinked = 4,
5081 
5082   /* EXPERIMENTAL:
5083    *
5084    * If set, decoding will enforce UTF-8 validation for string fields, even for
5085    * proto2 or fields with `features.utf8_validation = NONE`. Normally, only
5086    * proto3 string fields will be validated for UTF-8. Decoding will return
5087    * kUpb_DecodeStatus_BadUtf8 for non-UTF-8 strings, which is the same behavior
5088    * as non-UTF-8 proto3 string fields.
5089    */
5090   kUpb_DecodeOption_AlwaysValidateUtf8 = 8,
5091 };
5092 
upb_DecodeOptions_MaxDepth(uint16_t depth)5093 UPB_INLINE uint32_t upb_DecodeOptions_MaxDepth(uint16_t depth) {
5094   return (uint32_t)depth << 16;
5095 }
5096 
upb_DecodeOptions_GetMaxDepth(uint32_t options)5097 UPB_INLINE uint16_t upb_DecodeOptions_GetMaxDepth(uint32_t options) {
5098   return options >> 16;
5099 }
5100 
5101 // Enforce an upper bound on recursion depth.
upb_Decode_LimitDepth(uint32_t decode_options,uint32_t limit)5102 UPB_INLINE int upb_Decode_LimitDepth(uint32_t decode_options, uint32_t limit) {
5103   uint32_t max_depth = upb_DecodeOptions_GetMaxDepth(decode_options);
5104   if (max_depth > limit) max_depth = limit;
5105   return upb_DecodeOptions_MaxDepth(max_depth) | (decode_options & 0xffff);
5106 }
5107 
5108 // LINT.IfChange
5109 typedef enum {
5110   kUpb_DecodeStatus_Ok = 0,
5111   kUpb_DecodeStatus_Malformed = 1,    // Wire format was corrupt
5112   kUpb_DecodeStatus_OutOfMemory = 2,  // Arena alloc failed
5113   kUpb_DecodeStatus_BadUtf8 = 3,      // String field had bad UTF-8
5114   kUpb_DecodeStatus_MaxDepthExceeded =
5115       4,  // Exceeded upb_DecodeOptions_MaxDepth
5116 
5117   // kUpb_DecodeOption_CheckRequired failed (see above), but the parse otherwise
5118   // succeeded.
5119   kUpb_DecodeStatus_MissingRequired = 5,
5120 
5121   // Unlinked sub-message field was present, but
5122   // kUpb_DecodeOptions_ExperimentalAllowUnlinked was not specified in the list
5123   // of options.
5124   kUpb_DecodeStatus_UnlinkedSubMessage = 6,
5125 } upb_DecodeStatus;
5126 // LINT.ThenChange(//depot/google3/third_party/protobuf/rust/upb.rs:decode_status)
5127 
5128 UPB_API upb_DecodeStatus upb_Decode(const char* buf, size_t size,
5129                                     upb_Message* msg, const upb_MiniTable* mt,
5130                                     const upb_ExtensionRegistry* extreg,
5131                                     int options, upb_Arena* arena);
5132 
5133 // Same as upb_Decode but with a varint-encoded length prepended.
5134 // On success 'num_bytes_read' will be set to the how many bytes were read,
5135 // on failure the contents of num_bytes_read is undefined.
5136 UPB_API upb_DecodeStatus upb_DecodeLengthPrefixed(
5137     const char* buf, size_t size, upb_Message* msg, size_t* num_bytes_read,
5138     const upb_MiniTable* mt, const upb_ExtensionRegistry* extreg, int options,
5139     upb_Arena* arena);
5140 
5141 // Utility function for wrapper languages to get an error string from a
5142 // upb_DecodeStatus.
5143 UPB_API const char* upb_DecodeStatus_String(upb_DecodeStatus status);
5144 #ifdef __cplusplus
5145 } /* extern "C" */
5146 #endif
5147 
5148 
5149 #endif /* UPB_WIRE_DECODE_H_ */
5150 
5151 // upb_Encode: parsing from a upb_Message using a upb_MiniTable.
5152 
5153 #ifndef UPB_WIRE_ENCODE_H_
5154 #define UPB_WIRE_ENCODE_H_
5155 
5156 #include <stddef.h>
5157 #include <stdint.h>
5158 
5159 
5160 // Must be last.
5161 
5162 #ifdef __cplusplus
5163 extern "C" {
5164 #endif
5165 
5166 enum {
5167   /* If set, the results of serializing will be deterministic across all
5168    * instances of this binary. There are no guarantees across different
5169    * binary builds.
5170    *
5171    * If your proto contains maps, the encoder will need to malloc()/free()
5172    * memory during encode. */
5173   kUpb_EncodeOption_Deterministic = 1,
5174 
5175   // When set, unknown fields are not encoded.
5176   kUpb_EncodeOption_SkipUnknown = 2,
5177 
5178   // When set, the encode will fail if any required fields are missing.
5179   kUpb_EncodeOption_CheckRequired = 4,
5180 };
5181 
5182 // LINT.IfChange
5183 typedef enum {
5184   kUpb_EncodeStatus_Ok = 0,
5185   kUpb_EncodeStatus_OutOfMemory = 1,  // Arena alloc failed
5186   kUpb_EncodeStatus_MaxDepthExceeded = 2,
5187 
5188   // kUpb_EncodeOption_CheckRequired failed but the parse otherwise succeeded.
5189   kUpb_EncodeStatus_MissingRequired = 3,
5190 } upb_EncodeStatus;
5191 // LINT.ThenChange(//depot/google3/third_party/protobuf/rust/upb.rs:encode_status)
5192 
upb_EncodeOptions_MaxDepth(uint16_t depth)5193 UPB_INLINE uint32_t upb_EncodeOptions_MaxDepth(uint16_t depth) {
5194   return (uint32_t)depth << 16;
5195 }
5196 
upb_EncodeOptions_GetMaxDepth(uint32_t options)5197 UPB_INLINE uint16_t upb_EncodeOptions_GetMaxDepth(uint32_t options) {
5198   return options >> 16;
5199 }
5200 
5201 // Enforce an upper bound on recursion depth.
upb_Encode_LimitDepth(uint32_t encode_options,uint32_t limit)5202 UPB_INLINE int upb_Encode_LimitDepth(uint32_t encode_options, uint32_t limit) {
5203   uint32_t max_depth = upb_EncodeOptions_GetMaxDepth(encode_options);
5204   if (max_depth > limit) max_depth = limit;
5205   return upb_EncodeOptions_MaxDepth(max_depth) | (encode_options & 0xffff);
5206 }
5207 
5208 UPB_API upb_EncodeStatus upb_Encode(const upb_Message* msg,
5209                                     const upb_MiniTable* l, int options,
5210                                     upb_Arena* arena, char** buf, size_t* size);
5211 
5212 // Encodes the message prepended by a varint of the serialized length.
5213 UPB_API upb_EncodeStatus upb_EncodeLengthPrefixed(const upb_Message* msg,
5214                                                   const upb_MiniTable* l,
5215                                                   int options, upb_Arena* arena,
5216                                                   char** buf, size_t* size);
5217 // Utility function for wrapper languages to get an error string from a
5218 // upb_EncodeStatus.
5219 UPB_API const char* upb_EncodeStatus_String(upb_EncodeStatus status);
5220 
5221 #ifdef __cplusplus
5222 } /* extern "C" */
5223 #endif
5224 
5225 
5226 #endif /* UPB_WIRE_ENCODE_H_ */
5227 
5228 // These are the specialized field parser functions for the fast parser.
5229 // Generated tables will refer to these by name.
5230 //
5231 // The function names are encoded with names like:
5232 //
5233 //   //  123 4
5234 //   upb_pss_1bt();   // Parse singular string, 1 byte tag.
5235 //
5236 // In position 1:
5237 //   - 'p' for parse, most function use this
5238 //   - 'c' for copy, for when we are copying strings instead of aliasing
5239 //
5240 // In position 2 (cardinality):
5241 //   - 's' for singular, with or without hasbit
5242 //   - 'o' for oneof
5243 //   - 'r' for non-packed repeated
5244 //   - 'p' for packed repeated
5245 //
5246 // In position 3 (type):
5247 //   - 'b1' for bool
5248 //   - 'v4' for 4-byte varint
5249 //   - 'v8' for 8-byte varint
5250 //   - 'z4' for zig-zag-encoded 4-byte varint
5251 //   - 'z8' for zig-zag-encoded 8-byte varint
5252 //   - 'f4' for 4-byte fixed
5253 //   - 'f8' for 8-byte fixed
5254 //   - 'm' for sub-message
5255 //   - 's' for string (validate UTF-8)
5256 //   - 'b' for bytes
5257 //
5258 // In position 4 (tag length):
5259 //   - '1' for one-byte tags (field numbers 1-15)
5260 //   - '2' for two-byte tags (field numbers 16-2048)
5261 
5262 #ifndef UPB_WIRE_INTERNAL_DECODE_FAST_H_
5263 #define UPB_WIRE_INTERNAL_DECODE_FAST_H_
5264 
5265 
5266 // Must be last.
5267 
5268 #ifdef __cplusplus
5269 extern "C" {
5270 #endif
5271 
5272 struct upb_Decoder;
5273 
5274 // The fallback, generic parsing function that can handle any field type.
5275 // This just uses the regular (non-fast) parser to parse a single field.
5276 const char* _upb_FastDecoder_DecodeGeneric(struct upb_Decoder* d,
5277                                            const char* ptr, upb_Message* msg,
5278                                            intptr_t table, uint64_t hasbits,
5279                                            uint64_t data);
5280 
5281 #define UPB_PARSE_PARAMS                                                    \
5282   struct upb_Decoder *d, const char *ptr, upb_Message *msg, intptr_t table, \
5283       uint64_t hasbits, uint64_t data
5284 
5285 /* primitive fields ***********************************************************/
5286 
5287 #define F(card, type, valbytes, tagbytes) \
5288   const char* upb_p##card##type##valbytes##_##tagbytes##bt(UPB_PARSE_PARAMS);
5289 
5290 #define TYPES(card, tagbytes) \
5291   F(card, b, 1, tagbytes)     \
5292   F(card, v, 4, tagbytes)     \
5293   F(card, v, 8, tagbytes)     \
5294   F(card, z, 4, tagbytes)     \
5295   F(card, z, 8, tagbytes)     \
5296   F(card, f, 4, tagbytes)     \
5297   F(card, f, 8, tagbytes)
5298 
5299 #define TAGBYTES(card) \
5300   TYPES(card, 1)       \
5301   TYPES(card, 2)
5302 
5303 TAGBYTES(s)
5304 TAGBYTES(o)
5305 TAGBYTES(r)
5306 TAGBYTES(p)
5307 
5308 #undef F
5309 #undef TYPES
5310 #undef TAGBYTES
5311 
5312 /* string fields **************************************************************/
5313 
5314 #define F(card, tagbytes, type)                                     \
5315   const char* upb_p##card##type##_##tagbytes##bt(UPB_PARSE_PARAMS); \
5316   const char* upb_c##card##type##_##tagbytes##bt(UPB_PARSE_PARAMS);
5317 
5318 #define UTF8(card, tagbytes) \
5319   F(card, tagbytes, s)       \
5320   F(card, tagbytes, b)
5321 
5322 #define TAGBYTES(card) \
5323   UTF8(card, 1)        \
5324   UTF8(card, 2)
5325 
5326 TAGBYTES(s)
5327 TAGBYTES(o)
5328 TAGBYTES(r)
5329 
5330 #undef F
5331 #undef UTF8
5332 #undef TAGBYTES
5333 
5334 /* sub-message fields *********************************************************/
5335 
5336 #define F(card, tagbytes, size_ceil, ceil_arg) \
5337   const char* upb_p##card##m_##tagbytes##bt_max##size_ceil##b(UPB_PARSE_PARAMS);
5338 
5339 #define SIZES(card, tagbytes) \
5340   F(card, tagbytes, 64, 64)   \
5341   F(card, tagbytes, 128, 128) \
5342   F(card, tagbytes, 192, 192) \
5343   F(card, tagbytes, 256, 256) \
5344   F(card, tagbytes, max, -1)
5345 
5346 #define TAGBYTES(card) \
5347   SIZES(card, 1)       \
5348   SIZES(card, 2)
5349 
5350 TAGBYTES(s)
5351 TAGBYTES(o)
5352 TAGBYTES(r)
5353 
5354 #undef F
5355 #undef SIZES
5356 #undef TAGBYTES
5357 
5358 #undef UPB_PARSE_PARAMS
5359 
5360 #ifdef __cplusplus
5361 } /* extern "C" */
5362 #endif
5363 
5364 
5365 #endif /* UPB_WIRE_INTERNAL_DECODE_FAST_H_ */
5366 // IWYU pragma: end_exports
5367 
5368 #endif  // UPB_GENERATED_CODE_SUPPORT_H_
5369 
5370 /* This file was generated by upb_generator from the input file:
5371  *
5372  *     google/protobuf/descriptor.proto
5373  *
5374  * Do not edit -- your changes will be discarded when the file is
5375  * regenerated.
5376  * NO CHECKED-IN PROTOBUF GENCODE */
5377 
5378 #ifndef GOOGLE_PROTOBUF_DESCRIPTOR_PROTO_UPB_H__UPB_MINITABLE_H_
5379 #define GOOGLE_PROTOBUF_DESCRIPTOR_PROTO_UPB_H__UPB_MINITABLE_H_
5380 
5381 
5382 // Must be last.
5383 
5384 #ifdef __cplusplus
5385 extern "C" {
5386 #endif
5387 
5388 extern const upb_MiniTable google__protobuf__FileDescriptorSet_msg_init;
5389 extern const upb_MiniTable* google__protobuf__FileDescriptorSet_msg_init_ptr;
5390 extern const upb_MiniTable google__protobuf__FileDescriptorProto_msg_init;
5391 extern const upb_MiniTable* google__protobuf__FileDescriptorProto_msg_init_ptr;
5392 extern const upb_MiniTable google__protobuf__DescriptorProto_msg_init;
5393 extern const upb_MiniTable* google__protobuf__DescriptorProto_msg_init_ptr;
5394 extern const upb_MiniTable google__protobuf__DescriptorProto__ExtensionRange_msg_init;
5395 extern const upb_MiniTable* google__protobuf__DescriptorProto__ExtensionRange_msg_init_ptr;
5396 extern const upb_MiniTable google__protobuf__DescriptorProto__ReservedRange_msg_init;
5397 extern const upb_MiniTable* google__protobuf__DescriptorProto__ReservedRange_msg_init_ptr;
5398 extern const upb_MiniTable google__protobuf__ExtensionRangeOptions_msg_init;
5399 extern const upb_MiniTable* google__protobuf__ExtensionRangeOptions_msg_init_ptr;
5400 extern const upb_MiniTable google__protobuf__ExtensionRangeOptions__Declaration_msg_init;
5401 extern const upb_MiniTable* google__protobuf__ExtensionRangeOptions__Declaration_msg_init_ptr;
5402 extern const upb_MiniTable google__protobuf__FieldDescriptorProto_msg_init;
5403 extern const upb_MiniTable* google__protobuf__FieldDescriptorProto_msg_init_ptr;
5404 extern const upb_MiniTable google__protobuf__OneofDescriptorProto_msg_init;
5405 extern const upb_MiniTable* google__protobuf__OneofDescriptorProto_msg_init_ptr;
5406 extern const upb_MiniTable google__protobuf__EnumDescriptorProto_msg_init;
5407 extern const upb_MiniTable* google__protobuf__EnumDescriptorProto_msg_init_ptr;
5408 extern const upb_MiniTable google__protobuf__EnumDescriptorProto__EnumReservedRange_msg_init;
5409 extern const upb_MiniTable* google__protobuf__EnumDescriptorProto__EnumReservedRange_msg_init_ptr;
5410 extern const upb_MiniTable google__protobuf__EnumValueDescriptorProto_msg_init;
5411 extern const upb_MiniTable* google__protobuf__EnumValueDescriptorProto_msg_init_ptr;
5412 extern const upb_MiniTable google__protobuf__ServiceDescriptorProto_msg_init;
5413 extern const upb_MiniTable* google__protobuf__ServiceDescriptorProto_msg_init_ptr;
5414 extern const upb_MiniTable google__protobuf__MethodDescriptorProto_msg_init;
5415 extern const upb_MiniTable* google__protobuf__MethodDescriptorProto_msg_init_ptr;
5416 extern const upb_MiniTable google__protobuf__FileOptions_msg_init;
5417 extern const upb_MiniTable* google__protobuf__FileOptions_msg_init_ptr;
5418 extern const upb_MiniTable google__protobuf__MessageOptions_msg_init;
5419 extern const upb_MiniTable* google__protobuf__MessageOptions_msg_init_ptr;
5420 extern const upb_MiniTable google__protobuf__FieldOptions_msg_init;
5421 extern const upb_MiniTable* google__protobuf__FieldOptions_msg_init_ptr;
5422 extern const upb_MiniTable google__protobuf__FieldOptions__EditionDefault_msg_init;
5423 extern const upb_MiniTable* google__protobuf__FieldOptions__EditionDefault_msg_init_ptr;
5424 extern const upb_MiniTable google__protobuf__FieldOptions__FeatureSupport_msg_init;
5425 extern const upb_MiniTable* google__protobuf__FieldOptions__FeatureSupport_msg_init_ptr;
5426 extern const upb_MiniTable google__protobuf__OneofOptions_msg_init;
5427 extern const upb_MiniTable* google__protobuf__OneofOptions_msg_init_ptr;
5428 extern const upb_MiniTable google__protobuf__EnumOptions_msg_init;
5429 extern const upb_MiniTable* google__protobuf__EnumOptions_msg_init_ptr;
5430 extern const upb_MiniTable google__protobuf__EnumValueOptions_msg_init;
5431 extern const upb_MiniTable* google__protobuf__EnumValueOptions_msg_init_ptr;
5432 extern const upb_MiniTable google__protobuf__ServiceOptions_msg_init;
5433 extern const upb_MiniTable* google__protobuf__ServiceOptions_msg_init_ptr;
5434 extern const upb_MiniTable google__protobuf__MethodOptions_msg_init;
5435 extern const upb_MiniTable* google__protobuf__MethodOptions_msg_init_ptr;
5436 extern const upb_MiniTable google__protobuf__UninterpretedOption_msg_init;
5437 extern const upb_MiniTable* google__protobuf__UninterpretedOption_msg_init_ptr;
5438 extern const upb_MiniTable google__protobuf__UninterpretedOption__NamePart_msg_init;
5439 extern const upb_MiniTable* google__protobuf__UninterpretedOption__NamePart_msg_init_ptr;
5440 extern const upb_MiniTable google__protobuf__FeatureSet_msg_init;
5441 extern const upb_MiniTable* google__protobuf__FeatureSet_msg_init_ptr;
5442 extern const upb_MiniTable google__protobuf__FeatureSetDefaults_msg_init;
5443 extern const upb_MiniTable* google__protobuf__FeatureSetDefaults_msg_init_ptr;
5444 extern const upb_MiniTable google__protobuf__FeatureSetDefaults__FeatureSetEditionDefault_msg_init;
5445 extern const upb_MiniTable* google__protobuf__FeatureSetDefaults__FeatureSetEditionDefault_msg_init_ptr;
5446 extern const upb_MiniTable google__protobuf__SourceCodeInfo_msg_init;
5447 extern const upb_MiniTable* google__protobuf__SourceCodeInfo_msg_init_ptr;
5448 extern const upb_MiniTable google__protobuf__SourceCodeInfo__Location_msg_init;
5449 extern const upb_MiniTable* google__protobuf__SourceCodeInfo__Location_msg_init_ptr;
5450 extern const upb_MiniTable google__protobuf__GeneratedCodeInfo_msg_init;
5451 extern const upb_MiniTable* google__protobuf__GeneratedCodeInfo_msg_init_ptr;
5452 extern const upb_MiniTable google__protobuf__GeneratedCodeInfo__Annotation_msg_init;
5453 extern const upb_MiniTable* google__protobuf__GeneratedCodeInfo__Annotation_msg_init_ptr;
5454 
5455 extern const upb_MiniTableEnum google__protobuf__Edition_enum_init;
5456 extern const upb_MiniTableEnum google__protobuf__ExtensionRangeOptions__VerificationState_enum_init;
5457 extern const upb_MiniTableEnum google__protobuf__FeatureSet__EnumType_enum_init;
5458 extern const upb_MiniTableEnum google__protobuf__FeatureSet__FieldPresence_enum_init;
5459 extern const upb_MiniTableEnum google__protobuf__FeatureSet__JsonFormat_enum_init;
5460 extern const upb_MiniTableEnum google__protobuf__FeatureSet__MessageEncoding_enum_init;
5461 extern const upb_MiniTableEnum google__protobuf__FeatureSet__RepeatedFieldEncoding_enum_init;
5462 extern const upb_MiniTableEnum google__protobuf__FeatureSet__Utf8Validation_enum_init;
5463 extern const upb_MiniTableEnum google__protobuf__FieldDescriptorProto__Label_enum_init;
5464 extern const upb_MiniTableEnum google__protobuf__FieldDescriptorProto__Type_enum_init;
5465 extern const upb_MiniTableEnum google__protobuf__FieldOptions__CType_enum_init;
5466 extern const upb_MiniTableEnum google__protobuf__FieldOptions__JSType_enum_init;
5467 extern const upb_MiniTableEnum google__protobuf__FieldOptions__OptionRetention_enum_init;
5468 extern const upb_MiniTableEnum google__protobuf__FieldOptions__OptionTargetType_enum_init;
5469 extern const upb_MiniTableEnum google__protobuf__FileOptions__OptimizeMode_enum_init;
5470 extern const upb_MiniTableEnum google__protobuf__GeneratedCodeInfo__Annotation__Semantic_enum_init;
5471 extern const upb_MiniTableEnum google__protobuf__MethodOptions__IdempotencyLevel_enum_init;
5472 extern const upb_MiniTableFile google_protobuf_descriptor_proto_upb_file_layout;
5473 
5474 #ifdef __cplusplus
5475 }  /* extern "C" */
5476 #endif
5477 
5478 
5479 #endif  /* GOOGLE_PROTOBUF_DESCRIPTOR_PROTO_UPB_H__UPB_MINITABLE_H_ */
5480 
5481 
5482 // Must be last.
5483 
5484 #ifdef __cplusplus
5485 extern "C" {
5486 #endif
5487 
5488 typedef struct google_protobuf_FileDescriptorSet { upb_Message UPB_PRIVATE(base); } google_protobuf_FileDescriptorSet;
5489 typedef struct google_protobuf_FileDescriptorProto { upb_Message UPB_PRIVATE(base); } google_protobuf_FileDescriptorProto;
5490 typedef struct google_protobuf_DescriptorProto { upb_Message UPB_PRIVATE(base); } google_protobuf_DescriptorProto;
5491 typedef struct google_protobuf_DescriptorProto_ExtensionRange { upb_Message UPB_PRIVATE(base); } google_protobuf_DescriptorProto_ExtensionRange;
5492 typedef struct google_protobuf_DescriptorProto_ReservedRange { upb_Message UPB_PRIVATE(base); } google_protobuf_DescriptorProto_ReservedRange;
5493 typedef struct google_protobuf_ExtensionRangeOptions { upb_Message UPB_PRIVATE(base); } google_protobuf_ExtensionRangeOptions;
5494 typedef struct google_protobuf_ExtensionRangeOptions_Declaration { upb_Message UPB_PRIVATE(base); } google_protobuf_ExtensionRangeOptions_Declaration;
5495 typedef struct google_protobuf_FieldDescriptorProto { upb_Message UPB_PRIVATE(base); } google_protobuf_FieldDescriptorProto;
5496 typedef struct google_protobuf_OneofDescriptorProto { upb_Message UPB_PRIVATE(base); } google_protobuf_OneofDescriptorProto;
5497 typedef struct google_protobuf_EnumDescriptorProto { upb_Message UPB_PRIVATE(base); } google_protobuf_EnumDescriptorProto;
5498 typedef struct google_protobuf_EnumDescriptorProto_EnumReservedRange { upb_Message UPB_PRIVATE(base); } google_protobuf_EnumDescriptorProto_EnumReservedRange;
5499 typedef struct google_protobuf_EnumValueDescriptorProto { upb_Message UPB_PRIVATE(base); } google_protobuf_EnumValueDescriptorProto;
5500 typedef struct google_protobuf_ServiceDescriptorProto { upb_Message UPB_PRIVATE(base); } google_protobuf_ServiceDescriptorProto;
5501 typedef struct google_protobuf_MethodDescriptorProto { upb_Message UPB_PRIVATE(base); } google_protobuf_MethodDescriptorProto;
5502 typedef struct google_protobuf_FileOptions { upb_Message UPB_PRIVATE(base); } google_protobuf_FileOptions;
5503 typedef struct google_protobuf_MessageOptions { upb_Message UPB_PRIVATE(base); } google_protobuf_MessageOptions;
5504 typedef struct google_protobuf_FieldOptions { upb_Message UPB_PRIVATE(base); } google_protobuf_FieldOptions;
5505 typedef struct google_protobuf_FieldOptions_EditionDefault { upb_Message UPB_PRIVATE(base); } google_protobuf_FieldOptions_EditionDefault;
5506 typedef struct google_protobuf_FieldOptions_FeatureSupport { upb_Message UPB_PRIVATE(base); } google_protobuf_FieldOptions_FeatureSupport;
5507 typedef struct google_protobuf_OneofOptions { upb_Message UPB_PRIVATE(base); } google_protobuf_OneofOptions;
5508 typedef struct google_protobuf_EnumOptions { upb_Message UPB_PRIVATE(base); } google_protobuf_EnumOptions;
5509 typedef struct google_protobuf_EnumValueOptions { upb_Message UPB_PRIVATE(base); } google_protobuf_EnumValueOptions;
5510 typedef struct google_protobuf_ServiceOptions { upb_Message UPB_PRIVATE(base); } google_protobuf_ServiceOptions;
5511 typedef struct google_protobuf_MethodOptions { upb_Message UPB_PRIVATE(base); } google_protobuf_MethodOptions;
5512 typedef struct google_protobuf_UninterpretedOption { upb_Message UPB_PRIVATE(base); } google_protobuf_UninterpretedOption;
5513 typedef struct google_protobuf_UninterpretedOption_NamePart { upb_Message UPB_PRIVATE(base); } google_protobuf_UninterpretedOption_NamePart;
5514 typedef struct google_protobuf_FeatureSet { upb_Message UPB_PRIVATE(base); } google_protobuf_FeatureSet;
5515 typedef struct google_protobuf_FeatureSetDefaults { upb_Message UPB_PRIVATE(base); } google_protobuf_FeatureSetDefaults;
5516 typedef struct google_protobuf_FeatureSetDefaults_FeatureSetEditionDefault { upb_Message UPB_PRIVATE(base); } google_protobuf_FeatureSetDefaults_FeatureSetEditionDefault;
5517 typedef struct google_protobuf_SourceCodeInfo { upb_Message UPB_PRIVATE(base); } google_protobuf_SourceCodeInfo;
5518 typedef struct google_protobuf_SourceCodeInfo_Location { upb_Message UPB_PRIVATE(base); } google_protobuf_SourceCodeInfo_Location;
5519 typedef struct google_protobuf_GeneratedCodeInfo { upb_Message UPB_PRIVATE(base); } google_protobuf_GeneratedCodeInfo;
5520 typedef struct google_protobuf_GeneratedCodeInfo_Annotation { upb_Message UPB_PRIVATE(base); } google_protobuf_GeneratedCodeInfo_Annotation;
5521 
5522 typedef enum {
5523   google_protobuf_EDITION_UNKNOWN = 0,
5524   google_protobuf_EDITION_1_TEST_ONLY = 1,
5525   google_protobuf_EDITION_2_TEST_ONLY = 2,
5526   google_protobuf_EDITION_LEGACY = 900,
5527   google_protobuf_EDITION_PROTO2 = 998,
5528   google_protobuf_EDITION_PROTO3 = 999,
5529   google_protobuf_EDITION_2023 = 1000,
5530   google_protobuf_EDITION_2024 = 1001,
5531   google_protobuf_EDITION_99997_TEST_ONLY = 99997,
5532   google_protobuf_EDITION_99998_TEST_ONLY = 99998,
5533   google_protobuf_EDITION_99999_TEST_ONLY = 99999,
5534   google_protobuf_EDITION_MAX = 2147483647
5535 } google_protobuf_Edition;
5536 
5537 typedef enum {
5538   google_protobuf_ExtensionRangeOptions_DECLARATION = 0,
5539   google_protobuf_ExtensionRangeOptions_UNVERIFIED = 1
5540 } google_protobuf_ExtensionRangeOptions_VerificationState;
5541 
5542 typedef enum {
5543   google_protobuf_FeatureSet_ENUM_TYPE_UNKNOWN = 0,
5544   google_protobuf_FeatureSet_OPEN = 1,
5545   google_protobuf_FeatureSet_CLOSED = 2
5546 } google_protobuf_FeatureSet_EnumType;
5547 
5548 typedef enum {
5549   google_protobuf_FeatureSet_FIELD_PRESENCE_UNKNOWN = 0,
5550   google_protobuf_FeatureSet_EXPLICIT = 1,
5551   google_protobuf_FeatureSet_IMPLICIT = 2,
5552   google_protobuf_FeatureSet_LEGACY_REQUIRED = 3
5553 } google_protobuf_FeatureSet_FieldPresence;
5554 
5555 typedef enum {
5556   google_protobuf_FeatureSet_JSON_FORMAT_UNKNOWN = 0,
5557   google_protobuf_FeatureSet_ALLOW = 1,
5558   google_protobuf_FeatureSet_LEGACY_BEST_EFFORT = 2
5559 } google_protobuf_FeatureSet_JsonFormat;
5560 
5561 typedef enum {
5562   google_protobuf_FeatureSet_MESSAGE_ENCODING_UNKNOWN = 0,
5563   google_protobuf_FeatureSet_LENGTH_PREFIXED = 1,
5564   google_protobuf_FeatureSet_DELIMITED = 2
5565 } google_protobuf_FeatureSet_MessageEncoding;
5566 
5567 typedef enum {
5568   google_protobuf_FeatureSet_REPEATED_FIELD_ENCODING_UNKNOWN = 0,
5569   google_protobuf_FeatureSet_PACKED = 1,
5570   google_protobuf_FeatureSet_EXPANDED = 2
5571 } google_protobuf_FeatureSet_RepeatedFieldEncoding;
5572 
5573 typedef enum {
5574   google_protobuf_FeatureSet_UTF8_VALIDATION_UNKNOWN = 0,
5575   google_protobuf_FeatureSet_VERIFY = 2,
5576   google_protobuf_FeatureSet_NONE = 3
5577 } google_protobuf_FeatureSet_Utf8Validation;
5578 
5579 typedef enum {
5580   google_protobuf_FieldDescriptorProto_LABEL_OPTIONAL = 1,
5581   google_protobuf_FieldDescriptorProto_LABEL_REQUIRED = 2,
5582   google_protobuf_FieldDescriptorProto_LABEL_REPEATED = 3
5583 } google_protobuf_FieldDescriptorProto_Label;
5584 
5585 typedef enum {
5586   google_protobuf_FieldDescriptorProto_TYPE_DOUBLE = 1,
5587   google_protobuf_FieldDescriptorProto_TYPE_FLOAT = 2,
5588   google_protobuf_FieldDescriptorProto_TYPE_INT64 = 3,
5589   google_protobuf_FieldDescriptorProto_TYPE_UINT64 = 4,
5590   google_protobuf_FieldDescriptorProto_TYPE_INT32 = 5,
5591   google_protobuf_FieldDescriptorProto_TYPE_FIXED64 = 6,
5592   google_protobuf_FieldDescriptorProto_TYPE_FIXED32 = 7,
5593   google_protobuf_FieldDescriptorProto_TYPE_BOOL = 8,
5594   google_protobuf_FieldDescriptorProto_TYPE_STRING = 9,
5595   google_protobuf_FieldDescriptorProto_TYPE_GROUP = 10,
5596   google_protobuf_FieldDescriptorProto_TYPE_MESSAGE = 11,
5597   google_protobuf_FieldDescriptorProto_TYPE_BYTES = 12,
5598   google_protobuf_FieldDescriptorProto_TYPE_UINT32 = 13,
5599   google_protobuf_FieldDescriptorProto_TYPE_ENUM = 14,
5600   google_protobuf_FieldDescriptorProto_TYPE_SFIXED32 = 15,
5601   google_protobuf_FieldDescriptorProto_TYPE_SFIXED64 = 16,
5602   google_protobuf_FieldDescriptorProto_TYPE_SINT32 = 17,
5603   google_protobuf_FieldDescriptorProto_TYPE_SINT64 = 18
5604 } google_protobuf_FieldDescriptorProto_Type;
5605 
5606 typedef enum {
5607   google_protobuf_FieldOptions_STRING = 0,
5608   google_protobuf_FieldOptions_CORD = 1,
5609   google_protobuf_FieldOptions_STRING_PIECE = 2
5610 } google_protobuf_FieldOptions_CType;
5611 
5612 typedef enum {
5613   google_protobuf_FieldOptions_JS_NORMAL = 0,
5614   google_protobuf_FieldOptions_JS_STRING = 1,
5615   google_protobuf_FieldOptions_JS_NUMBER = 2
5616 } google_protobuf_FieldOptions_JSType;
5617 
5618 typedef enum {
5619   google_protobuf_FieldOptions_RETENTION_UNKNOWN = 0,
5620   google_protobuf_FieldOptions_RETENTION_RUNTIME = 1,
5621   google_protobuf_FieldOptions_RETENTION_SOURCE = 2
5622 } google_protobuf_FieldOptions_OptionRetention;
5623 
5624 typedef enum {
5625   google_protobuf_FieldOptions_TARGET_TYPE_UNKNOWN = 0,
5626   google_protobuf_FieldOptions_TARGET_TYPE_FILE = 1,
5627   google_protobuf_FieldOptions_TARGET_TYPE_EXTENSION_RANGE = 2,
5628   google_protobuf_FieldOptions_TARGET_TYPE_MESSAGE = 3,
5629   google_protobuf_FieldOptions_TARGET_TYPE_FIELD = 4,
5630   google_protobuf_FieldOptions_TARGET_TYPE_ONEOF = 5,
5631   google_protobuf_FieldOptions_TARGET_TYPE_ENUM = 6,
5632   google_protobuf_FieldOptions_TARGET_TYPE_ENUM_ENTRY = 7,
5633   google_protobuf_FieldOptions_TARGET_TYPE_SERVICE = 8,
5634   google_protobuf_FieldOptions_TARGET_TYPE_METHOD = 9
5635 } google_protobuf_FieldOptions_OptionTargetType;
5636 
5637 typedef enum {
5638   google_protobuf_FileOptions_SPEED = 1,
5639   google_protobuf_FileOptions_CODE_SIZE = 2,
5640   google_protobuf_FileOptions_LITE_RUNTIME = 3
5641 } google_protobuf_FileOptions_OptimizeMode;
5642 
5643 typedef enum {
5644   google_protobuf_GeneratedCodeInfo_Annotation_NONE = 0,
5645   google_protobuf_GeneratedCodeInfo_Annotation_SET = 1,
5646   google_protobuf_GeneratedCodeInfo_Annotation_ALIAS = 2
5647 } google_protobuf_GeneratedCodeInfo_Annotation_Semantic;
5648 
5649 typedef enum {
5650   google_protobuf_MethodOptions_IDEMPOTENCY_UNKNOWN = 0,
5651   google_protobuf_MethodOptions_NO_SIDE_EFFECTS = 1,
5652   google_protobuf_MethodOptions_IDEMPOTENT = 2
5653 } google_protobuf_MethodOptions_IdempotencyLevel;
5654 
5655 
5656 
5657 /* google.protobuf.FileDescriptorSet */
5658 
google_protobuf_FileDescriptorSet_new(upb_Arena * arena)5659 UPB_INLINE google_protobuf_FileDescriptorSet* google_protobuf_FileDescriptorSet_new(upb_Arena* arena) {
5660   return (google_protobuf_FileDescriptorSet*)_upb_Message_New(&google__protobuf__FileDescriptorSet_msg_init, arena);
5661 }
google_protobuf_FileDescriptorSet_parse(const char * buf,size_t size,upb_Arena * arena)5662 UPB_INLINE google_protobuf_FileDescriptorSet* google_protobuf_FileDescriptorSet_parse(const char* buf, size_t size, upb_Arena* arena) {
5663   google_protobuf_FileDescriptorSet* ret = google_protobuf_FileDescriptorSet_new(arena);
5664   if (!ret) return NULL;
5665   if (upb_Decode(buf, size, UPB_UPCAST(ret), &google__protobuf__FileDescriptorSet_msg_init, NULL, 0, arena) !=
5666       kUpb_DecodeStatus_Ok) {
5667     return NULL;
5668   }
5669   return ret;
5670 }
google_protobuf_FileDescriptorSet_parse_ex(const char * buf,size_t size,const upb_ExtensionRegistry * extreg,int options,upb_Arena * arena)5671 UPB_INLINE google_protobuf_FileDescriptorSet* google_protobuf_FileDescriptorSet_parse_ex(const char* buf, size_t size,
5672                            const upb_ExtensionRegistry* extreg,
5673                            int options, upb_Arena* arena) {
5674   google_protobuf_FileDescriptorSet* ret = google_protobuf_FileDescriptorSet_new(arena);
5675   if (!ret) return NULL;
5676   if (upb_Decode(buf, size, UPB_UPCAST(ret), &google__protobuf__FileDescriptorSet_msg_init, extreg, options,
5677                  arena) != kUpb_DecodeStatus_Ok) {
5678     return NULL;
5679   }
5680   return ret;
5681 }
google_protobuf_FileDescriptorSet_serialize(const google_protobuf_FileDescriptorSet * msg,upb_Arena * arena,size_t * len)5682 UPB_INLINE char* google_protobuf_FileDescriptorSet_serialize(const google_protobuf_FileDescriptorSet* msg, upb_Arena* arena, size_t* len) {
5683   char* ptr;
5684   (void)upb_Encode(UPB_UPCAST(msg), &google__protobuf__FileDescriptorSet_msg_init, 0, arena, &ptr, len);
5685   return ptr;
5686 }
google_protobuf_FileDescriptorSet_serialize_ex(const google_protobuf_FileDescriptorSet * msg,int options,upb_Arena * arena,size_t * len)5687 UPB_INLINE char* google_protobuf_FileDescriptorSet_serialize_ex(const google_protobuf_FileDescriptorSet* msg, int options,
5688                                  upb_Arena* arena, size_t* len) {
5689   char* ptr;
5690   (void)upb_Encode(UPB_UPCAST(msg), &google__protobuf__FileDescriptorSet_msg_init, options, arena, &ptr, len);
5691   return ptr;
5692 }
google_protobuf_FileDescriptorSet_clear_file(google_protobuf_FileDescriptorSet * msg)5693 UPB_INLINE void google_protobuf_FileDescriptorSet_clear_file(google_protobuf_FileDescriptorSet* msg) {
5694   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)};
5695   upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
5696 }
google_protobuf_FileDescriptorSet_file(const google_protobuf_FileDescriptorSet * msg,size_t * size)5697 UPB_INLINE const google_protobuf_FileDescriptorProto* const* google_protobuf_FileDescriptorSet_file(const google_protobuf_FileDescriptorSet* msg, size_t* size) {
5698   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)};
5699   UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__FileDescriptorProto_msg_init);
5700   const upb_Array* arr = upb_Message_GetArray(UPB_UPCAST(msg), &field);
5701   if (arr) {
5702     if (size) *size = arr->UPB_PRIVATE(size);
5703     return (const google_protobuf_FileDescriptorProto* const*)upb_Array_DataPtr(arr);
5704   } else {
5705     if (size) *size = 0;
5706     return NULL;
5707   }
5708 }
_google_protobuf_FileDescriptorSet_file_upb_array(const google_protobuf_FileDescriptorSet * msg,size_t * size)5709 UPB_INLINE const upb_Array* _google_protobuf_FileDescriptorSet_file_upb_array(const google_protobuf_FileDescriptorSet* msg, size_t* size) {
5710   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)};
5711   UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__FileDescriptorProto_msg_init);
5712   const upb_Array* arr = upb_Message_GetArray(UPB_UPCAST(msg), &field);
5713   if (size) {
5714     *size = arr ? arr->UPB_PRIVATE(size) : 0;
5715   }
5716   return arr;
5717 }
_google_protobuf_FileDescriptorSet_file_mutable_upb_array(google_protobuf_FileDescriptorSet * msg,size_t * size,upb_Arena * arena)5718 UPB_INLINE upb_Array* _google_protobuf_FileDescriptorSet_file_mutable_upb_array(google_protobuf_FileDescriptorSet* msg, size_t* size, upb_Arena* arena) {
5719   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)};
5720   UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__FileDescriptorProto_msg_init);
5721   upb_Array* arr = upb_Message_GetOrCreateMutableArray(UPB_UPCAST(msg),
5722                                                        &field, arena);
5723   if (size) {
5724     *size = arr ? arr->UPB_PRIVATE(size) : 0;
5725   }
5726   return arr;
5727 }
5728 
google_protobuf_FileDescriptorSet_mutable_file(google_protobuf_FileDescriptorSet * msg,size_t * size)5729 UPB_INLINE google_protobuf_FileDescriptorProto** google_protobuf_FileDescriptorSet_mutable_file(google_protobuf_FileDescriptorSet* msg, size_t* size) {
5730   upb_MiniTableField field = {1, 8, 0, 0, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
5731   UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__FileDescriptorProto_msg_init);
5732   upb_Array* arr = upb_Message_GetMutableArray(UPB_UPCAST(msg), &field);
5733   if (arr) {
5734     if (size) *size = arr->UPB_PRIVATE(size);
5735     return (google_protobuf_FileDescriptorProto**)upb_Array_MutableDataPtr(arr);
5736   } else {
5737     if (size) *size = 0;
5738     return NULL;
5739   }
5740 }
google_protobuf_FileDescriptorSet_resize_file(google_protobuf_FileDescriptorSet * msg,size_t size,upb_Arena * arena)5741 UPB_INLINE google_protobuf_FileDescriptorProto** google_protobuf_FileDescriptorSet_resize_file(google_protobuf_FileDescriptorSet* msg, size_t size, upb_Arena* arena) {
5742   upb_MiniTableField field = {1, 8, 0, 0, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
5743   return (google_protobuf_FileDescriptorProto**)upb_Message_ResizeArrayUninitialized(UPB_UPCAST(msg),
5744                                                    &field, size, arena);
5745 }
google_protobuf_FileDescriptorSet_add_file(google_protobuf_FileDescriptorSet * msg,upb_Arena * arena)5746 UPB_INLINE struct google_protobuf_FileDescriptorProto* google_protobuf_FileDescriptorSet_add_file(google_protobuf_FileDescriptorSet* msg, upb_Arena* arena) {
5747   upb_MiniTableField field = {1, 8, 0, 0, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
5748   UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__FileDescriptorProto_msg_init);
5749   upb_Array* arr = upb_Message_GetOrCreateMutableArray(
5750       UPB_UPCAST(msg), &field, arena);
5751   if (!arr || !UPB_PRIVATE(_upb_Array_ResizeUninitialized)(
5752                   arr, arr->UPB_PRIVATE(size) + 1, arena)) {
5753     return NULL;
5754   }
5755   struct google_protobuf_FileDescriptorProto* sub = (struct google_protobuf_FileDescriptorProto*)_upb_Message_New(&google__protobuf__FileDescriptorProto_msg_init, arena);
5756   if (!arr || !sub) return NULL;
5757   UPB_PRIVATE(_upb_Array_Set)
5758   (arr, arr->UPB_PRIVATE(size) - 1, &sub, sizeof(sub));
5759   return sub;
5760 }
5761 
5762 /* google.protobuf.FileDescriptorProto */
5763 
google_protobuf_FileDescriptorProto_new(upb_Arena * arena)5764 UPB_INLINE google_protobuf_FileDescriptorProto* google_protobuf_FileDescriptorProto_new(upb_Arena* arena) {
5765   return (google_protobuf_FileDescriptorProto*)_upb_Message_New(&google__protobuf__FileDescriptorProto_msg_init, arena);
5766 }
google_protobuf_FileDescriptorProto_parse(const char * buf,size_t size,upb_Arena * arena)5767 UPB_INLINE google_protobuf_FileDescriptorProto* google_protobuf_FileDescriptorProto_parse(const char* buf, size_t size, upb_Arena* arena) {
5768   google_protobuf_FileDescriptorProto* ret = google_protobuf_FileDescriptorProto_new(arena);
5769   if (!ret) return NULL;
5770   if (upb_Decode(buf, size, UPB_UPCAST(ret), &google__protobuf__FileDescriptorProto_msg_init, NULL, 0, arena) !=
5771       kUpb_DecodeStatus_Ok) {
5772     return NULL;
5773   }
5774   return ret;
5775 }
google_protobuf_FileDescriptorProto_parse_ex(const char * buf,size_t size,const upb_ExtensionRegistry * extreg,int options,upb_Arena * arena)5776 UPB_INLINE google_protobuf_FileDescriptorProto* google_protobuf_FileDescriptorProto_parse_ex(const char* buf, size_t size,
5777                            const upb_ExtensionRegistry* extreg,
5778                            int options, upb_Arena* arena) {
5779   google_protobuf_FileDescriptorProto* ret = google_protobuf_FileDescriptorProto_new(arena);
5780   if (!ret) return NULL;
5781   if (upb_Decode(buf, size, UPB_UPCAST(ret), &google__protobuf__FileDescriptorProto_msg_init, extreg, options,
5782                  arena) != kUpb_DecodeStatus_Ok) {
5783     return NULL;
5784   }
5785   return ret;
5786 }
google_protobuf_FileDescriptorProto_serialize(const google_protobuf_FileDescriptorProto * msg,upb_Arena * arena,size_t * len)5787 UPB_INLINE char* google_protobuf_FileDescriptorProto_serialize(const google_protobuf_FileDescriptorProto* msg, upb_Arena* arena, size_t* len) {
5788   char* ptr;
5789   (void)upb_Encode(UPB_UPCAST(msg), &google__protobuf__FileDescriptorProto_msg_init, 0, arena, &ptr, len);
5790   return ptr;
5791 }
google_protobuf_FileDescriptorProto_serialize_ex(const google_protobuf_FileDescriptorProto * msg,int options,upb_Arena * arena,size_t * len)5792 UPB_INLINE char* google_protobuf_FileDescriptorProto_serialize_ex(const google_protobuf_FileDescriptorProto* msg, int options,
5793                                  upb_Arena* arena, size_t* len) {
5794   char* ptr;
5795   (void)upb_Encode(UPB_UPCAST(msg), &google__protobuf__FileDescriptorProto_msg_init, options, arena, &ptr, len);
5796   return ptr;
5797 }
google_protobuf_FileDescriptorProto_clear_name(google_protobuf_FileDescriptorProto * msg)5798 UPB_INLINE void google_protobuf_FileDescriptorProto_clear_name(google_protobuf_FileDescriptorProto* msg) {
5799   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)};
5800   upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
5801 }
google_protobuf_FileDescriptorProto_name(const google_protobuf_FileDescriptorProto * msg)5802 UPB_INLINE upb_StringView google_protobuf_FileDescriptorProto_name(const google_protobuf_FileDescriptorProto* msg) {
5803   upb_StringView default_val = upb_StringView_FromString("");
5804   upb_StringView ret;
5805   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)};
5806   _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field,
5807                                     &default_val, &ret);
5808   return ret;
5809 }
google_protobuf_FileDescriptorProto_has_name(const google_protobuf_FileDescriptorProto * msg)5810 UPB_INLINE bool google_protobuf_FileDescriptorProto_has_name(const google_protobuf_FileDescriptorProto* msg) {
5811   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)};
5812   return upb_Message_HasBaseField(UPB_UPCAST(msg), &field);
5813 }
google_protobuf_FileDescriptorProto_clear_package(google_protobuf_FileDescriptorProto * msg)5814 UPB_INLINE void google_protobuf_FileDescriptorProto_clear_package(google_protobuf_FileDescriptorProto* msg) {
5815   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)};
5816   upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
5817 }
google_protobuf_FileDescriptorProto_package(const google_protobuf_FileDescriptorProto * msg)5818 UPB_INLINE upb_StringView google_protobuf_FileDescriptorProto_package(const google_protobuf_FileDescriptorProto* msg) {
5819   upb_StringView default_val = upb_StringView_FromString("");
5820   upb_StringView ret;
5821   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)};
5822   _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field,
5823                                     &default_val, &ret);
5824   return ret;
5825 }
google_protobuf_FileDescriptorProto_has_package(const google_protobuf_FileDescriptorProto * msg)5826 UPB_INLINE bool google_protobuf_FileDescriptorProto_has_package(const google_protobuf_FileDescriptorProto* msg) {
5827   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)};
5828   return upb_Message_HasBaseField(UPB_UPCAST(msg), &field);
5829 }
google_protobuf_FileDescriptorProto_clear_dependency(google_protobuf_FileDescriptorProto * msg)5830 UPB_INLINE void google_protobuf_FileDescriptorProto_clear_dependency(google_protobuf_FileDescriptorProto* msg) {
5831   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)};
5832   upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
5833 }
google_protobuf_FileDescriptorProto_dependency(const google_protobuf_FileDescriptorProto * msg,size_t * size)5834 UPB_INLINE upb_StringView const* google_protobuf_FileDescriptorProto_dependency(const google_protobuf_FileDescriptorProto* msg, size_t* size) {
5835   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)};
5836   const upb_Array* arr = upb_Message_GetArray(UPB_UPCAST(msg), &field);
5837   if (arr) {
5838     if (size) *size = arr->UPB_PRIVATE(size);
5839     return (upb_StringView const*)upb_Array_DataPtr(arr);
5840   } else {
5841     if (size) *size = 0;
5842     return NULL;
5843   }
5844 }
_google_protobuf_FileDescriptorProto_dependency_upb_array(const google_protobuf_FileDescriptorProto * msg,size_t * size)5845 UPB_INLINE const upb_Array* _google_protobuf_FileDescriptorProto_dependency_upb_array(const google_protobuf_FileDescriptorProto* msg, size_t* size) {
5846   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)};
5847   const upb_Array* arr = upb_Message_GetArray(UPB_UPCAST(msg), &field);
5848   if (size) {
5849     *size = arr ? arr->UPB_PRIVATE(size) : 0;
5850   }
5851   return arr;
5852 }
_google_protobuf_FileDescriptorProto_dependency_mutable_upb_array(google_protobuf_FileDescriptorProto * msg,size_t * size,upb_Arena * arena)5853 UPB_INLINE upb_Array* _google_protobuf_FileDescriptorProto_dependency_mutable_upb_array(google_protobuf_FileDescriptorProto* msg, size_t* size, upb_Arena* arena) {
5854   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)};
5855   upb_Array* arr = upb_Message_GetOrCreateMutableArray(UPB_UPCAST(msg),
5856                                                        &field, arena);
5857   if (size) {
5858     *size = arr ? arr->UPB_PRIVATE(size) : 0;
5859   }
5860   return arr;
5861 }
google_protobuf_FileDescriptorProto_clear_message_type(google_protobuf_FileDescriptorProto * msg)5862 UPB_INLINE void google_protobuf_FileDescriptorProto_clear_message_type(google_protobuf_FileDescriptorProto* msg) {
5863   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)};
5864   upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
5865 }
google_protobuf_FileDescriptorProto_message_type(const google_protobuf_FileDescriptorProto * msg,size_t * size)5866 UPB_INLINE const google_protobuf_DescriptorProto* const* google_protobuf_FileDescriptorProto_message_type(const google_protobuf_FileDescriptorProto* msg, size_t* size) {
5867   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)};
5868   UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__DescriptorProto_msg_init);
5869   const upb_Array* arr = upb_Message_GetArray(UPB_UPCAST(msg), &field);
5870   if (arr) {
5871     if (size) *size = arr->UPB_PRIVATE(size);
5872     return (const google_protobuf_DescriptorProto* const*)upb_Array_DataPtr(arr);
5873   } else {
5874     if (size) *size = 0;
5875     return NULL;
5876   }
5877 }
_google_protobuf_FileDescriptorProto_message_type_upb_array(const google_protobuf_FileDescriptorProto * msg,size_t * size)5878 UPB_INLINE const upb_Array* _google_protobuf_FileDescriptorProto_message_type_upb_array(const google_protobuf_FileDescriptorProto* msg, size_t* size) {
5879   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)};
5880   UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__DescriptorProto_msg_init);
5881   const upb_Array* arr = upb_Message_GetArray(UPB_UPCAST(msg), &field);
5882   if (size) {
5883     *size = arr ? arr->UPB_PRIVATE(size) : 0;
5884   }
5885   return arr;
5886 }
_google_protobuf_FileDescriptorProto_message_type_mutable_upb_array(google_protobuf_FileDescriptorProto * msg,size_t * size,upb_Arena * arena)5887 UPB_INLINE upb_Array* _google_protobuf_FileDescriptorProto_message_type_mutable_upb_array(google_protobuf_FileDescriptorProto* msg, size_t* size, upb_Arena* arena) {
5888   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)};
5889   UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__DescriptorProto_msg_init);
5890   upb_Array* arr = upb_Message_GetOrCreateMutableArray(UPB_UPCAST(msg),
5891                                                        &field, arena);
5892   if (size) {
5893     *size = arr ? arr->UPB_PRIVATE(size) : 0;
5894   }
5895   return arr;
5896 }
google_protobuf_FileDescriptorProto_clear_enum_type(google_protobuf_FileDescriptorProto * msg)5897 UPB_INLINE void google_protobuf_FileDescriptorProto_clear_enum_type(google_protobuf_FileDescriptorProto* msg) {
5898   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)};
5899   upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
5900 }
google_protobuf_FileDescriptorProto_enum_type(const google_protobuf_FileDescriptorProto * msg,size_t * size)5901 UPB_INLINE const google_protobuf_EnumDescriptorProto* const* google_protobuf_FileDescriptorProto_enum_type(const google_protobuf_FileDescriptorProto* msg, size_t* size) {
5902   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)};
5903   UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__EnumDescriptorProto_msg_init);
5904   const upb_Array* arr = upb_Message_GetArray(UPB_UPCAST(msg), &field);
5905   if (arr) {
5906     if (size) *size = arr->UPB_PRIVATE(size);
5907     return (const google_protobuf_EnumDescriptorProto* const*)upb_Array_DataPtr(arr);
5908   } else {
5909     if (size) *size = 0;
5910     return NULL;
5911   }
5912 }
_google_protobuf_FileDescriptorProto_enum_type_upb_array(const google_protobuf_FileDescriptorProto * msg,size_t * size)5913 UPB_INLINE const upb_Array* _google_protobuf_FileDescriptorProto_enum_type_upb_array(const google_protobuf_FileDescriptorProto* msg, size_t* size) {
5914   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)};
5915   UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__EnumDescriptorProto_msg_init);
5916   const upb_Array* arr = upb_Message_GetArray(UPB_UPCAST(msg), &field);
5917   if (size) {
5918     *size = arr ? arr->UPB_PRIVATE(size) : 0;
5919   }
5920   return arr;
5921 }
_google_protobuf_FileDescriptorProto_enum_type_mutable_upb_array(google_protobuf_FileDescriptorProto * msg,size_t * size,upb_Arena * arena)5922 UPB_INLINE upb_Array* _google_protobuf_FileDescriptorProto_enum_type_mutable_upb_array(google_protobuf_FileDescriptorProto* msg, size_t* size, upb_Arena* arena) {
5923   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)};
5924   UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__EnumDescriptorProto_msg_init);
5925   upb_Array* arr = upb_Message_GetOrCreateMutableArray(UPB_UPCAST(msg),
5926                                                        &field, arena);
5927   if (size) {
5928     *size = arr ? arr->UPB_PRIVATE(size) : 0;
5929   }
5930   return arr;
5931 }
google_protobuf_FileDescriptorProto_clear_service(google_protobuf_FileDescriptorProto * msg)5932 UPB_INLINE void google_protobuf_FileDescriptorProto_clear_service(google_protobuf_FileDescriptorProto* msg) {
5933   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)};
5934   upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
5935 }
google_protobuf_FileDescriptorProto_service(const google_protobuf_FileDescriptorProto * msg,size_t * size)5936 UPB_INLINE const google_protobuf_ServiceDescriptorProto* const* google_protobuf_FileDescriptorProto_service(const google_protobuf_FileDescriptorProto* msg, size_t* size) {
5937   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)};
5938   UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__ServiceDescriptorProto_msg_init);
5939   const upb_Array* arr = upb_Message_GetArray(UPB_UPCAST(msg), &field);
5940   if (arr) {
5941     if (size) *size = arr->UPB_PRIVATE(size);
5942     return (const google_protobuf_ServiceDescriptorProto* const*)upb_Array_DataPtr(arr);
5943   } else {
5944     if (size) *size = 0;
5945     return NULL;
5946   }
5947 }
_google_protobuf_FileDescriptorProto_service_upb_array(const google_protobuf_FileDescriptorProto * msg,size_t * size)5948 UPB_INLINE const upb_Array* _google_protobuf_FileDescriptorProto_service_upb_array(const google_protobuf_FileDescriptorProto* msg, size_t* size) {
5949   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)};
5950   UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__ServiceDescriptorProto_msg_init);
5951   const upb_Array* arr = upb_Message_GetArray(UPB_UPCAST(msg), &field);
5952   if (size) {
5953     *size = arr ? arr->UPB_PRIVATE(size) : 0;
5954   }
5955   return arr;
5956 }
_google_protobuf_FileDescriptorProto_service_mutable_upb_array(google_protobuf_FileDescriptorProto * msg,size_t * size,upb_Arena * arena)5957 UPB_INLINE upb_Array* _google_protobuf_FileDescriptorProto_service_mutable_upb_array(google_protobuf_FileDescriptorProto* msg, size_t* size, upb_Arena* arena) {
5958   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)};
5959   UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__ServiceDescriptorProto_msg_init);
5960   upb_Array* arr = upb_Message_GetOrCreateMutableArray(UPB_UPCAST(msg),
5961                                                        &field, arena);
5962   if (size) {
5963     *size = arr ? arr->UPB_PRIVATE(size) : 0;
5964   }
5965   return arr;
5966 }
google_protobuf_FileDescriptorProto_clear_extension(google_protobuf_FileDescriptorProto * msg)5967 UPB_INLINE void google_protobuf_FileDescriptorProto_clear_extension(google_protobuf_FileDescriptorProto* msg) {
5968   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)};
5969   upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
5970 }
google_protobuf_FileDescriptorProto_extension(const google_protobuf_FileDescriptorProto * msg,size_t * size)5971 UPB_INLINE const google_protobuf_FieldDescriptorProto* const* google_protobuf_FileDescriptorProto_extension(const google_protobuf_FileDescriptorProto* msg, size_t* size) {
5972   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)};
5973   UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__FieldDescriptorProto_msg_init);
5974   const upb_Array* arr = upb_Message_GetArray(UPB_UPCAST(msg), &field);
5975   if (arr) {
5976     if (size) *size = arr->UPB_PRIVATE(size);
5977     return (const google_protobuf_FieldDescriptorProto* const*)upb_Array_DataPtr(arr);
5978   } else {
5979     if (size) *size = 0;
5980     return NULL;
5981   }
5982 }
_google_protobuf_FileDescriptorProto_extension_upb_array(const google_protobuf_FileDescriptorProto * msg,size_t * size)5983 UPB_INLINE const upb_Array* _google_protobuf_FileDescriptorProto_extension_upb_array(const google_protobuf_FileDescriptorProto* msg, size_t* size) {
5984   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)};
5985   UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__FieldDescriptorProto_msg_init);
5986   const upb_Array* arr = upb_Message_GetArray(UPB_UPCAST(msg), &field);
5987   if (size) {
5988     *size = arr ? arr->UPB_PRIVATE(size) : 0;
5989   }
5990   return arr;
5991 }
_google_protobuf_FileDescriptorProto_extension_mutable_upb_array(google_protobuf_FileDescriptorProto * msg,size_t * size,upb_Arena * arena)5992 UPB_INLINE upb_Array* _google_protobuf_FileDescriptorProto_extension_mutable_upb_array(google_protobuf_FileDescriptorProto* msg, size_t* size, upb_Arena* arena) {
5993   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)};
5994   UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__FieldDescriptorProto_msg_init);
5995   upb_Array* arr = upb_Message_GetOrCreateMutableArray(UPB_UPCAST(msg),
5996                                                        &field, arena);
5997   if (size) {
5998     *size = arr ? arr->UPB_PRIVATE(size) : 0;
5999   }
6000   return arr;
6001 }
google_protobuf_FileDescriptorProto_clear_options(google_protobuf_FileDescriptorProto * msg)6002 UPB_INLINE void google_protobuf_FileDescriptorProto_clear_options(google_protobuf_FileDescriptorProto* msg) {
6003   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)};
6004   upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
6005 }
google_protobuf_FileDescriptorProto_options(const google_protobuf_FileDescriptorProto * msg)6006 UPB_INLINE const google_protobuf_FileOptions* google_protobuf_FileDescriptorProto_options(const google_protobuf_FileDescriptorProto* msg) {
6007   const google_protobuf_FileOptions* default_val = NULL;
6008   const google_protobuf_FileOptions* ret;
6009   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)};
6010   UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__FileOptions_msg_init);
6011   _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field,
6012                                     &default_val, &ret);
6013   return ret;
6014 }
google_protobuf_FileDescriptorProto_has_options(const google_protobuf_FileDescriptorProto * msg)6015 UPB_INLINE bool google_protobuf_FileDescriptorProto_has_options(const google_protobuf_FileDescriptorProto* msg) {
6016   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)};
6017   return upb_Message_HasBaseField(UPB_UPCAST(msg), &field);
6018 }
google_protobuf_FileDescriptorProto_clear_source_code_info(google_protobuf_FileDescriptorProto * msg)6019 UPB_INLINE void google_protobuf_FileDescriptorProto_clear_source_code_info(google_protobuf_FileDescriptorProto* msg) {
6020   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)};
6021   upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
6022 }
google_protobuf_FileDescriptorProto_source_code_info(const google_protobuf_FileDescriptorProto * msg)6023 UPB_INLINE const google_protobuf_SourceCodeInfo* google_protobuf_FileDescriptorProto_source_code_info(const google_protobuf_FileDescriptorProto* msg) {
6024   const google_protobuf_SourceCodeInfo* default_val = NULL;
6025   const google_protobuf_SourceCodeInfo* ret;
6026   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)};
6027   UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__SourceCodeInfo_msg_init);
6028   _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field,
6029                                     &default_val, &ret);
6030   return ret;
6031 }
google_protobuf_FileDescriptorProto_has_source_code_info(const google_protobuf_FileDescriptorProto * msg)6032 UPB_INLINE bool google_protobuf_FileDescriptorProto_has_source_code_info(const google_protobuf_FileDescriptorProto* msg) {
6033   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)};
6034   return upb_Message_HasBaseField(UPB_UPCAST(msg), &field);
6035 }
google_protobuf_FileDescriptorProto_clear_public_dependency(google_protobuf_FileDescriptorProto * msg)6036 UPB_INLINE void google_protobuf_FileDescriptorProto_clear_public_dependency(google_protobuf_FileDescriptorProto* msg) {
6037   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)};
6038   upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
6039 }
google_protobuf_FileDescriptorProto_public_dependency(const google_protobuf_FileDescriptorProto * msg,size_t * size)6040 UPB_INLINE int32_t const* google_protobuf_FileDescriptorProto_public_dependency(const google_protobuf_FileDescriptorProto* msg, size_t* size) {
6041   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)};
6042   const upb_Array* arr = upb_Message_GetArray(UPB_UPCAST(msg), &field);
6043   if (arr) {
6044     if (size) *size = arr->UPB_PRIVATE(size);
6045     return (int32_t const*)upb_Array_DataPtr(arr);
6046   } else {
6047     if (size) *size = 0;
6048     return NULL;
6049   }
6050 }
_google_protobuf_FileDescriptorProto_public_dependency_upb_array(const google_protobuf_FileDescriptorProto * msg,size_t * size)6051 UPB_INLINE const upb_Array* _google_protobuf_FileDescriptorProto_public_dependency_upb_array(const google_protobuf_FileDescriptorProto* msg, size_t* size) {
6052   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)};
6053   const upb_Array* arr = upb_Message_GetArray(UPB_UPCAST(msg), &field);
6054   if (size) {
6055     *size = arr ? arr->UPB_PRIVATE(size) : 0;
6056   }
6057   return arr;
6058 }
_google_protobuf_FileDescriptorProto_public_dependency_mutable_upb_array(google_protobuf_FileDescriptorProto * msg,size_t * size,upb_Arena * arena)6059 UPB_INLINE upb_Array* _google_protobuf_FileDescriptorProto_public_dependency_mutable_upb_array(google_protobuf_FileDescriptorProto* msg, size_t* size, upb_Arena* arena) {
6060   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)};
6061   upb_Array* arr = upb_Message_GetOrCreateMutableArray(UPB_UPCAST(msg),
6062                                                        &field, arena);
6063   if (size) {
6064     *size = arr ? arr->UPB_PRIVATE(size) : 0;
6065   }
6066   return arr;
6067 }
google_protobuf_FileDescriptorProto_clear_weak_dependency(google_protobuf_FileDescriptorProto * msg)6068 UPB_INLINE void google_protobuf_FileDescriptorProto_clear_weak_dependency(google_protobuf_FileDescriptorProto* msg) {
6069   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)};
6070   upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
6071 }
google_protobuf_FileDescriptorProto_weak_dependency(const google_protobuf_FileDescriptorProto * msg,size_t * size)6072 UPB_INLINE int32_t const* google_protobuf_FileDescriptorProto_weak_dependency(const google_protobuf_FileDescriptorProto* msg, size_t* size) {
6073   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)};
6074   const upb_Array* arr = upb_Message_GetArray(UPB_UPCAST(msg), &field);
6075   if (arr) {
6076     if (size) *size = arr->UPB_PRIVATE(size);
6077     return (int32_t const*)upb_Array_DataPtr(arr);
6078   } else {
6079     if (size) *size = 0;
6080     return NULL;
6081   }
6082 }
_google_protobuf_FileDescriptorProto_weak_dependency_upb_array(const google_protobuf_FileDescriptorProto * msg,size_t * size)6083 UPB_INLINE const upb_Array* _google_protobuf_FileDescriptorProto_weak_dependency_upb_array(const google_protobuf_FileDescriptorProto* msg, size_t* size) {
6084   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)};
6085   const upb_Array* arr = upb_Message_GetArray(UPB_UPCAST(msg), &field);
6086   if (size) {
6087     *size = arr ? arr->UPB_PRIVATE(size) : 0;
6088   }
6089   return arr;
6090 }
_google_protobuf_FileDescriptorProto_weak_dependency_mutable_upb_array(google_protobuf_FileDescriptorProto * msg,size_t * size,upb_Arena * arena)6091 UPB_INLINE upb_Array* _google_protobuf_FileDescriptorProto_weak_dependency_mutable_upb_array(google_protobuf_FileDescriptorProto* msg, size_t* size, upb_Arena* arena) {
6092   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)};
6093   upb_Array* arr = upb_Message_GetOrCreateMutableArray(UPB_UPCAST(msg),
6094                                                        &field, arena);
6095   if (size) {
6096     *size = arr ? arr->UPB_PRIVATE(size) : 0;
6097   }
6098   return arr;
6099 }
google_protobuf_FileDescriptorProto_clear_syntax(google_protobuf_FileDescriptorProto * msg)6100 UPB_INLINE void google_protobuf_FileDescriptorProto_clear_syntax(google_protobuf_FileDescriptorProto* msg) {
6101   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)};
6102   upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
6103 }
google_protobuf_FileDescriptorProto_syntax(const google_protobuf_FileDescriptorProto * msg)6104 UPB_INLINE upb_StringView google_protobuf_FileDescriptorProto_syntax(const google_protobuf_FileDescriptorProto* msg) {
6105   upb_StringView default_val = upb_StringView_FromString("");
6106   upb_StringView ret;
6107   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)};
6108   _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field,
6109                                     &default_val, &ret);
6110   return ret;
6111 }
google_protobuf_FileDescriptorProto_has_syntax(const google_protobuf_FileDescriptorProto * msg)6112 UPB_INLINE bool google_protobuf_FileDescriptorProto_has_syntax(const google_protobuf_FileDescriptorProto* msg) {
6113   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)};
6114   return upb_Message_HasBaseField(UPB_UPCAST(msg), &field);
6115 }
google_protobuf_FileDescriptorProto_clear_edition(google_protobuf_FileDescriptorProto * msg)6116 UPB_INLINE void google_protobuf_FileDescriptorProto_clear_edition(google_protobuf_FileDescriptorProto* msg) {
6117   const upb_MiniTableField field = {14, UPB_SIZE(48, 12), 69, 6, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
6118   upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
6119 }
google_protobuf_FileDescriptorProto_edition(const google_protobuf_FileDescriptorProto * msg)6120 UPB_INLINE int32_t google_protobuf_FileDescriptorProto_edition(const google_protobuf_FileDescriptorProto* msg) {
6121   int32_t default_val = 0;
6122   int32_t ret;
6123   const upb_MiniTableField field = {14, UPB_SIZE(48, 12), 69, 6, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
6124   _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field,
6125                                     &default_val, &ret);
6126   return ret;
6127 }
google_protobuf_FileDescriptorProto_has_edition(const google_protobuf_FileDescriptorProto * msg)6128 UPB_INLINE bool google_protobuf_FileDescriptorProto_has_edition(const google_protobuf_FileDescriptorProto* msg) {
6129   const upb_MiniTableField field = {14, UPB_SIZE(48, 12), 69, 6, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
6130   return upb_Message_HasBaseField(UPB_UPCAST(msg), &field);
6131 }
6132 
google_protobuf_FileDescriptorProto_set_name(google_protobuf_FileDescriptorProto * msg,upb_StringView value)6133 UPB_INLINE void google_protobuf_FileDescriptorProto_set_name(google_protobuf_FileDescriptorProto *msg, upb_StringView value) {
6134   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)};
6135   upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
6136 }
google_protobuf_FileDescriptorProto_set_package(google_protobuf_FileDescriptorProto * msg,upb_StringView value)6137 UPB_INLINE void google_protobuf_FileDescriptorProto_set_package(google_protobuf_FileDescriptorProto *msg, upb_StringView value) {
6138   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)};
6139   upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
6140 }
google_protobuf_FileDescriptorProto_mutable_dependency(google_protobuf_FileDescriptorProto * msg,size_t * size)6141 UPB_INLINE upb_StringView* google_protobuf_FileDescriptorProto_mutable_dependency(google_protobuf_FileDescriptorProto* msg, size_t* size) {
6142   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)};
6143   upb_Array* arr = upb_Message_GetMutableArray(UPB_UPCAST(msg), &field);
6144   if (arr) {
6145     if (size) *size = arr->UPB_PRIVATE(size);
6146     return (upb_StringView*)upb_Array_MutableDataPtr(arr);
6147   } else {
6148     if (size) *size = 0;
6149     return NULL;
6150   }
6151 }
google_protobuf_FileDescriptorProto_resize_dependency(google_protobuf_FileDescriptorProto * msg,size_t size,upb_Arena * arena)6152 UPB_INLINE upb_StringView* google_protobuf_FileDescriptorProto_resize_dependency(google_protobuf_FileDescriptorProto* msg, size_t size, upb_Arena* arena) {
6153   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)};
6154   return (upb_StringView*)upb_Message_ResizeArrayUninitialized(UPB_UPCAST(msg),
6155                                                    &field, size, arena);
6156 }
google_protobuf_FileDescriptorProto_add_dependency(google_protobuf_FileDescriptorProto * msg,upb_StringView val,upb_Arena * arena)6157 UPB_INLINE bool google_protobuf_FileDescriptorProto_add_dependency(google_protobuf_FileDescriptorProto* msg, upb_StringView val, upb_Arena* arena) {
6158   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)};
6159   upb_Array* arr = upb_Message_GetOrCreateMutableArray(
6160       UPB_UPCAST(msg), &field, arena);
6161   if (!arr || !UPB_PRIVATE(_upb_Array_ResizeUninitialized)(
6162                   arr, arr->UPB_PRIVATE(size) + 1, arena)) {
6163     return false;
6164   }
6165   UPB_PRIVATE(_upb_Array_Set)
6166   (arr, arr->UPB_PRIVATE(size) - 1, &val, sizeof(val));
6167   return true;
6168 }
google_protobuf_FileDescriptorProto_mutable_message_type(google_protobuf_FileDescriptorProto * msg,size_t * size)6169 UPB_INLINE google_protobuf_DescriptorProto** google_protobuf_FileDescriptorProto_mutable_message_type(google_protobuf_FileDescriptorProto* msg, size_t* size) {
6170   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)};
6171   UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__DescriptorProto_msg_init);
6172   upb_Array* arr = upb_Message_GetMutableArray(UPB_UPCAST(msg), &field);
6173   if (arr) {
6174     if (size) *size = arr->UPB_PRIVATE(size);
6175     return (google_protobuf_DescriptorProto**)upb_Array_MutableDataPtr(arr);
6176   } else {
6177     if (size) *size = 0;
6178     return NULL;
6179   }
6180 }
google_protobuf_FileDescriptorProto_resize_message_type(google_protobuf_FileDescriptorProto * msg,size_t size,upb_Arena * arena)6181 UPB_INLINE google_protobuf_DescriptorProto** google_protobuf_FileDescriptorProto_resize_message_type(google_protobuf_FileDescriptorProto* msg, size_t size, upb_Arena* arena) {
6182   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)};
6183   return (google_protobuf_DescriptorProto**)upb_Message_ResizeArrayUninitialized(UPB_UPCAST(msg),
6184                                                    &field, size, arena);
6185 }
google_protobuf_FileDescriptorProto_add_message_type(google_protobuf_FileDescriptorProto * msg,upb_Arena * arena)6186 UPB_INLINE struct google_protobuf_DescriptorProto* google_protobuf_FileDescriptorProto_add_message_type(google_protobuf_FileDescriptorProto* msg, upb_Arena* arena) {
6187   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)};
6188   UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__DescriptorProto_msg_init);
6189   upb_Array* arr = upb_Message_GetOrCreateMutableArray(
6190       UPB_UPCAST(msg), &field, arena);
6191   if (!arr || !UPB_PRIVATE(_upb_Array_ResizeUninitialized)(
6192                   arr, arr->UPB_PRIVATE(size) + 1, arena)) {
6193     return NULL;
6194   }
6195   struct google_protobuf_DescriptorProto* sub = (struct google_protobuf_DescriptorProto*)_upb_Message_New(&google__protobuf__DescriptorProto_msg_init, arena);
6196   if (!arr || !sub) return NULL;
6197   UPB_PRIVATE(_upb_Array_Set)
6198   (arr, arr->UPB_PRIVATE(size) - 1, &sub, sizeof(sub));
6199   return sub;
6200 }
google_protobuf_FileDescriptorProto_mutable_enum_type(google_protobuf_FileDescriptorProto * msg,size_t * size)6201 UPB_INLINE google_protobuf_EnumDescriptorProto** google_protobuf_FileDescriptorProto_mutable_enum_type(google_protobuf_FileDescriptorProto* msg, size_t* size) {
6202   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)};
6203   UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__EnumDescriptorProto_msg_init);
6204   upb_Array* arr = upb_Message_GetMutableArray(UPB_UPCAST(msg), &field);
6205   if (arr) {
6206     if (size) *size = arr->UPB_PRIVATE(size);
6207     return (google_protobuf_EnumDescriptorProto**)upb_Array_MutableDataPtr(arr);
6208   } else {
6209     if (size) *size = 0;
6210     return NULL;
6211   }
6212 }
google_protobuf_FileDescriptorProto_resize_enum_type(google_protobuf_FileDescriptorProto * msg,size_t size,upb_Arena * arena)6213 UPB_INLINE google_protobuf_EnumDescriptorProto** google_protobuf_FileDescriptorProto_resize_enum_type(google_protobuf_FileDescriptorProto* msg, size_t size, upb_Arena* arena) {
6214   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)};
6215   return (google_protobuf_EnumDescriptorProto**)upb_Message_ResizeArrayUninitialized(UPB_UPCAST(msg),
6216                                                    &field, size, arena);
6217 }
google_protobuf_FileDescriptorProto_add_enum_type(google_protobuf_FileDescriptorProto * msg,upb_Arena * arena)6218 UPB_INLINE struct google_protobuf_EnumDescriptorProto* google_protobuf_FileDescriptorProto_add_enum_type(google_protobuf_FileDescriptorProto* msg, upb_Arena* arena) {
6219   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)};
6220   UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__EnumDescriptorProto_msg_init);
6221   upb_Array* arr = upb_Message_GetOrCreateMutableArray(
6222       UPB_UPCAST(msg), &field, arena);
6223   if (!arr || !UPB_PRIVATE(_upb_Array_ResizeUninitialized)(
6224                   arr, arr->UPB_PRIVATE(size) + 1, arena)) {
6225     return NULL;
6226   }
6227   struct google_protobuf_EnumDescriptorProto* sub = (struct google_protobuf_EnumDescriptorProto*)_upb_Message_New(&google__protobuf__EnumDescriptorProto_msg_init, arena);
6228   if (!arr || !sub) return NULL;
6229   UPB_PRIVATE(_upb_Array_Set)
6230   (arr, arr->UPB_PRIVATE(size) - 1, &sub, sizeof(sub));
6231   return sub;
6232 }
google_protobuf_FileDescriptorProto_mutable_service(google_protobuf_FileDescriptorProto * msg,size_t * size)6233 UPB_INLINE google_protobuf_ServiceDescriptorProto** google_protobuf_FileDescriptorProto_mutable_service(google_protobuf_FileDescriptorProto* msg, size_t* size) {
6234   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)};
6235   UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__ServiceDescriptorProto_msg_init);
6236   upb_Array* arr = upb_Message_GetMutableArray(UPB_UPCAST(msg), &field);
6237   if (arr) {
6238     if (size) *size = arr->UPB_PRIVATE(size);
6239     return (google_protobuf_ServiceDescriptorProto**)upb_Array_MutableDataPtr(arr);
6240   } else {
6241     if (size) *size = 0;
6242     return NULL;
6243   }
6244 }
google_protobuf_FileDescriptorProto_resize_service(google_protobuf_FileDescriptorProto * msg,size_t size,upb_Arena * arena)6245 UPB_INLINE google_protobuf_ServiceDescriptorProto** google_protobuf_FileDescriptorProto_resize_service(google_protobuf_FileDescriptorProto* msg, size_t size, upb_Arena* arena) {
6246   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)};
6247   return (google_protobuf_ServiceDescriptorProto**)upb_Message_ResizeArrayUninitialized(UPB_UPCAST(msg),
6248                                                    &field, size, arena);
6249 }
google_protobuf_FileDescriptorProto_add_service(google_protobuf_FileDescriptorProto * msg,upb_Arena * arena)6250 UPB_INLINE struct google_protobuf_ServiceDescriptorProto* google_protobuf_FileDescriptorProto_add_service(google_protobuf_FileDescriptorProto* msg, upb_Arena* arena) {
6251   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)};
6252   UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__ServiceDescriptorProto_msg_init);
6253   upb_Array* arr = upb_Message_GetOrCreateMutableArray(
6254       UPB_UPCAST(msg), &field, arena);
6255   if (!arr || !UPB_PRIVATE(_upb_Array_ResizeUninitialized)(
6256                   arr, arr->UPB_PRIVATE(size) + 1, arena)) {
6257     return NULL;
6258   }
6259   struct google_protobuf_ServiceDescriptorProto* sub = (struct google_protobuf_ServiceDescriptorProto*)_upb_Message_New(&google__protobuf__ServiceDescriptorProto_msg_init, arena);
6260   if (!arr || !sub) return NULL;
6261   UPB_PRIVATE(_upb_Array_Set)
6262   (arr, arr->UPB_PRIVATE(size) - 1, &sub, sizeof(sub));
6263   return sub;
6264 }
google_protobuf_FileDescriptorProto_mutable_extension(google_protobuf_FileDescriptorProto * msg,size_t * size)6265 UPB_INLINE google_protobuf_FieldDescriptorProto** google_protobuf_FileDescriptorProto_mutable_extension(google_protobuf_FileDescriptorProto* msg, size_t* size) {
6266   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)};
6267   UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__FieldDescriptorProto_msg_init);
6268   upb_Array* arr = upb_Message_GetMutableArray(UPB_UPCAST(msg), &field);
6269   if (arr) {
6270     if (size) *size = arr->UPB_PRIVATE(size);
6271     return (google_protobuf_FieldDescriptorProto**)upb_Array_MutableDataPtr(arr);
6272   } else {
6273     if (size) *size = 0;
6274     return NULL;
6275   }
6276 }
google_protobuf_FileDescriptorProto_resize_extension(google_protobuf_FileDescriptorProto * msg,size_t size,upb_Arena * arena)6277 UPB_INLINE google_protobuf_FieldDescriptorProto** google_protobuf_FileDescriptorProto_resize_extension(google_protobuf_FileDescriptorProto* msg, size_t size, upb_Arena* arena) {
6278   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)};
6279   return (google_protobuf_FieldDescriptorProto**)upb_Message_ResizeArrayUninitialized(UPB_UPCAST(msg),
6280                                                    &field, size, arena);
6281 }
google_protobuf_FileDescriptorProto_add_extension(google_protobuf_FileDescriptorProto * msg,upb_Arena * arena)6282 UPB_INLINE struct google_protobuf_FieldDescriptorProto* google_protobuf_FileDescriptorProto_add_extension(google_protobuf_FileDescriptorProto* msg, upb_Arena* arena) {
6283   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)};
6284   UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__FieldDescriptorProto_msg_init);
6285   upb_Array* arr = upb_Message_GetOrCreateMutableArray(
6286       UPB_UPCAST(msg), &field, arena);
6287   if (!arr || !UPB_PRIVATE(_upb_Array_ResizeUninitialized)(
6288                   arr, arr->UPB_PRIVATE(size) + 1, arena)) {
6289     return NULL;
6290   }
6291   struct google_protobuf_FieldDescriptorProto* sub = (struct google_protobuf_FieldDescriptorProto*)_upb_Message_New(&google__protobuf__FieldDescriptorProto_msg_init, arena);
6292   if (!arr || !sub) return NULL;
6293   UPB_PRIVATE(_upb_Array_Set)
6294   (arr, arr->UPB_PRIVATE(size) - 1, &sub, sizeof(sub));
6295   return sub;
6296 }
google_protobuf_FileDescriptorProto_set_options(google_protobuf_FileDescriptorProto * msg,google_protobuf_FileOptions * value)6297 UPB_INLINE void google_protobuf_FileDescriptorProto_set_options(google_protobuf_FileDescriptorProto *msg, google_protobuf_FileOptions* value) {
6298   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)};
6299   UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__FileOptions_msg_init);
6300   upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
6301 }
google_protobuf_FileDescriptorProto_mutable_options(google_protobuf_FileDescriptorProto * msg,upb_Arena * arena)6302 UPB_INLINE struct google_protobuf_FileOptions* google_protobuf_FileDescriptorProto_mutable_options(google_protobuf_FileDescriptorProto* msg, upb_Arena* arena) {
6303   struct google_protobuf_FileOptions* sub = (struct google_protobuf_FileOptions*)google_protobuf_FileDescriptorProto_options(msg);
6304   if (sub == NULL) {
6305     sub = (struct google_protobuf_FileOptions*)_upb_Message_New(&google__protobuf__FileOptions_msg_init, arena);
6306     if (sub) google_protobuf_FileDescriptorProto_set_options(msg, sub);
6307   }
6308   return sub;
6309 }
google_protobuf_FileDescriptorProto_set_source_code_info(google_protobuf_FileDescriptorProto * msg,google_protobuf_SourceCodeInfo * value)6310 UPB_INLINE void google_protobuf_FileDescriptorProto_set_source_code_info(google_protobuf_FileDescriptorProto *msg, google_protobuf_SourceCodeInfo* value) {
6311   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)};
6312   UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__SourceCodeInfo_msg_init);
6313   upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
6314 }
google_protobuf_FileDescriptorProto_mutable_source_code_info(google_protobuf_FileDescriptorProto * msg,upb_Arena * arena)6315 UPB_INLINE struct google_protobuf_SourceCodeInfo* google_protobuf_FileDescriptorProto_mutable_source_code_info(google_protobuf_FileDescriptorProto* msg, upb_Arena* arena) {
6316   struct google_protobuf_SourceCodeInfo* sub = (struct google_protobuf_SourceCodeInfo*)google_protobuf_FileDescriptorProto_source_code_info(msg);
6317   if (sub == NULL) {
6318     sub = (struct google_protobuf_SourceCodeInfo*)_upb_Message_New(&google__protobuf__SourceCodeInfo_msg_init, arena);
6319     if (sub) google_protobuf_FileDescriptorProto_set_source_code_info(msg, sub);
6320   }
6321   return sub;
6322 }
google_protobuf_FileDescriptorProto_mutable_public_dependency(google_protobuf_FileDescriptorProto * msg,size_t * size)6323 UPB_INLINE int32_t* google_protobuf_FileDescriptorProto_mutable_public_dependency(google_protobuf_FileDescriptorProto* msg, size_t* size) {
6324   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)};
6325   upb_Array* arr = upb_Message_GetMutableArray(UPB_UPCAST(msg), &field);
6326   if (arr) {
6327     if (size) *size = arr->UPB_PRIVATE(size);
6328     return (int32_t*)upb_Array_MutableDataPtr(arr);
6329   } else {
6330     if (size) *size = 0;
6331     return NULL;
6332   }
6333 }
google_protobuf_FileDescriptorProto_resize_public_dependency(google_protobuf_FileDescriptorProto * msg,size_t size,upb_Arena * arena)6334 UPB_INLINE int32_t* google_protobuf_FileDescriptorProto_resize_public_dependency(google_protobuf_FileDescriptorProto* msg, size_t size, upb_Arena* arena) {
6335   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)};
6336   return (int32_t*)upb_Message_ResizeArrayUninitialized(UPB_UPCAST(msg),
6337                                                    &field, size, arena);
6338 }
google_protobuf_FileDescriptorProto_add_public_dependency(google_protobuf_FileDescriptorProto * msg,int32_t val,upb_Arena * arena)6339 UPB_INLINE bool google_protobuf_FileDescriptorProto_add_public_dependency(google_protobuf_FileDescriptorProto* msg, int32_t val, upb_Arena* arena) {
6340   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)};
6341   upb_Array* arr = upb_Message_GetOrCreateMutableArray(
6342       UPB_UPCAST(msg), &field, arena);
6343   if (!arr || !UPB_PRIVATE(_upb_Array_ResizeUninitialized)(
6344                   arr, arr->UPB_PRIVATE(size) + 1, arena)) {
6345     return false;
6346   }
6347   UPB_PRIVATE(_upb_Array_Set)
6348   (arr, arr->UPB_PRIVATE(size) - 1, &val, sizeof(val));
6349   return true;
6350 }
google_protobuf_FileDescriptorProto_mutable_weak_dependency(google_protobuf_FileDescriptorProto * msg,size_t * size)6351 UPB_INLINE int32_t* google_protobuf_FileDescriptorProto_mutable_weak_dependency(google_protobuf_FileDescriptorProto* msg, size_t* size) {
6352   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)};
6353   upb_Array* arr = upb_Message_GetMutableArray(UPB_UPCAST(msg), &field);
6354   if (arr) {
6355     if (size) *size = arr->UPB_PRIVATE(size);
6356     return (int32_t*)upb_Array_MutableDataPtr(arr);
6357   } else {
6358     if (size) *size = 0;
6359     return NULL;
6360   }
6361 }
google_protobuf_FileDescriptorProto_resize_weak_dependency(google_protobuf_FileDescriptorProto * msg,size_t size,upb_Arena * arena)6362 UPB_INLINE int32_t* google_protobuf_FileDescriptorProto_resize_weak_dependency(google_protobuf_FileDescriptorProto* msg, size_t size, upb_Arena* arena) {
6363   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)};
6364   return (int32_t*)upb_Message_ResizeArrayUninitialized(UPB_UPCAST(msg),
6365                                                    &field, size, arena);
6366 }
google_protobuf_FileDescriptorProto_add_weak_dependency(google_protobuf_FileDescriptorProto * msg,int32_t val,upb_Arena * arena)6367 UPB_INLINE bool google_protobuf_FileDescriptorProto_add_weak_dependency(google_protobuf_FileDescriptorProto* msg, int32_t val, upb_Arena* arena) {
6368   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)};
6369   upb_Array* arr = upb_Message_GetOrCreateMutableArray(
6370       UPB_UPCAST(msg), &field, arena);
6371   if (!arr || !UPB_PRIVATE(_upb_Array_ResizeUninitialized)(
6372                   arr, arr->UPB_PRIVATE(size) + 1, arena)) {
6373     return false;
6374   }
6375   UPB_PRIVATE(_upb_Array_Set)
6376   (arr, arr->UPB_PRIVATE(size) - 1, &val, sizeof(val));
6377   return true;
6378 }
google_protobuf_FileDescriptorProto_set_syntax(google_protobuf_FileDescriptorProto * msg,upb_StringView value)6379 UPB_INLINE void google_protobuf_FileDescriptorProto_set_syntax(google_protobuf_FileDescriptorProto *msg, upb_StringView value) {
6380   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)};
6381   upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
6382 }
google_protobuf_FileDescriptorProto_set_edition(google_protobuf_FileDescriptorProto * msg,int32_t value)6383 UPB_INLINE void google_protobuf_FileDescriptorProto_set_edition(google_protobuf_FileDescriptorProto *msg, int32_t value) {
6384   const upb_MiniTableField field = {14, UPB_SIZE(48, 12), 69, 6, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
6385   upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
6386 }
6387 
6388 /* google.protobuf.DescriptorProto */
6389 
google_protobuf_DescriptorProto_new(upb_Arena * arena)6390 UPB_INLINE google_protobuf_DescriptorProto* google_protobuf_DescriptorProto_new(upb_Arena* arena) {
6391   return (google_protobuf_DescriptorProto*)_upb_Message_New(&google__protobuf__DescriptorProto_msg_init, arena);
6392 }
google_protobuf_DescriptorProto_parse(const char * buf,size_t size,upb_Arena * arena)6393 UPB_INLINE google_protobuf_DescriptorProto* google_protobuf_DescriptorProto_parse(const char* buf, size_t size, upb_Arena* arena) {
6394   google_protobuf_DescriptorProto* ret = google_protobuf_DescriptorProto_new(arena);
6395   if (!ret) return NULL;
6396   if (upb_Decode(buf, size, UPB_UPCAST(ret), &google__protobuf__DescriptorProto_msg_init, NULL, 0, arena) !=
6397       kUpb_DecodeStatus_Ok) {
6398     return NULL;
6399   }
6400   return ret;
6401 }
google_protobuf_DescriptorProto_parse_ex(const char * buf,size_t size,const upb_ExtensionRegistry * extreg,int options,upb_Arena * arena)6402 UPB_INLINE google_protobuf_DescriptorProto* google_protobuf_DescriptorProto_parse_ex(const char* buf, size_t size,
6403                            const upb_ExtensionRegistry* extreg,
6404                            int options, upb_Arena* arena) {
6405   google_protobuf_DescriptorProto* ret = google_protobuf_DescriptorProto_new(arena);
6406   if (!ret) return NULL;
6407   if (upb_Decode(buf, size, UPB_UPCAST(ret), &google__protobuf__DescriptorProto_msg_init, extreg, options,
6408                  arena) != kUpb_DecodeStatus_Ok) {
6409     return NULL;
6410   }
6411   return ret;
6412 }
google_protobuf_DescriptorProto_serialize(const google_protobuf_DescriptorProto * msg,upb_Arena * arena,size_t * len)6413 UPB_INLINE char* google_protobuf_DescriptorProto_serialize(const google_protobuf_DescriptorProto* msg, upb_Arena* arena, size_t* len) {
6414   char* ptr;
6415   (void)upb_Encode(UPB_UPCAST(msg), &google__protobuf__DescriptorProto_msg_init, 0, arena, &ptr, len);
6416   return ptr;
6417 }
google_protobuf_DescriptorProto_serialize_ex(const google_protobuf_DescriptorProto * msg,int options,upb_Arena * arena,size_t * len)6418 UPB_INLINE char* google_protobuf_DescriptorProto_serialize_ex(const google_protobuf_DescriptorProto* msg, int options,
6419                                  upb_Arena* arena, size_t* len) {
6420   char* ptr;
6421   (void)upb_Encode(UPB_UPCAST(msg), &google__protobuf__DescriptorProto_msg_init, options, arena, &ptr, len);
6422   return ptr;
6423 }
google_protobuf_DescriptorProto_clear_name(google_protobuf_DescriptorProto * msg)6424 UPB_INLINE void google_protobuf_DescriptorProto_clear_name(google_protobuf_DescriptorProto* msg) {
6425   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)};
6426   upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
6427 }
google_protobuf_DescriptorProto_name(const google_protobuf_DescriptorProto * msg)6428 UPB_INLINE upb_StringView google_protobuf_DescriptorProto_name(const google_protobuf_DescriptorProto* msg) {
6429   upb_StringView default_val = upb_StringView_FromString("");
6430   upb_StringView ret;
6431   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)};
6432   _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field,
6433                                     &default_val, &ret);
6434   return ret;
6435 }
google_protobuf_DescriptorProto_has_name(const google_protobuf_DescriptorProto * msg)6436 UPB_INLINE bool google_protobuf_DescriptorProto_has_name(const google_protobuf_DescriptorProto* msg) {
6437   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)};
6438   return upb_Message_HasBaseField(UPB_UPCAST(msg), &field);
6439 }
google_protobuf_DescriptorProto_clear_field(google_protobuf_DescriptorProto * msg)6440 UPB_INLINE void google_protobuf_DescriptorProto_clear_field(google_protobuf_DescriptorProto* msg) {
6441   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)};
6442   upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
6443 }
google_protobuf_DescriptorProto_field(const google_protobuf_DescriptorProto * msg,size_t * size)6444 UPB_INLINE const google_protobuf_FieldDescriptorProto* const* google_protobuf_DescriptorProto_field(const google_protobuf_DescriptorProto* msg, size_t* size) {
6445   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)};
6446   UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__FieldDescriptorProto_msg_init);
6447   const upb_Array* arr = upb_Message_GetArray(UPB_UPCAST(msg), &field);
6448   if (arr) {
6449     if (size) *size = arr->UPB_PRIVATE(size);
6450     return (const google_protobuf_FieldDescriptorProto* const*)upb_Array_DataPtr(arr);
6451   } else {
6452     if (size) *size = 0;
6453     return NULL;
6454   }
6455 }
_google_protobuf_DescriptorProto_field_upb_array(const google_protobuf_DescriptorProto * msg,size_t * size)6456 UPB_INLINE const upb_Array* _google_protobuf_DescriptorProto_field_upb_array(const google_protobuf_DescriptorProto* msg, size_t* size) {
6457   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)};
6458   UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__FieldDescriptorProto_msg_init);
6459   const upb_Array* arr = upb_Message_GetArray(UPB_UPCAST(msg), &field);
6460   if (size) {
6461     *size = arr ? arr->UPB_PRIVATE(size) : 0;
6462   }
6463   return arr;
6464 }
_google_protobuf_DescriptorProto_field_mutable_upb_array(google_protobuf_DescriptorProto * msg,size_t * size,upb_Arena * arena)6465 UPB_INLINE upb_Array* _google_protobuf_DescriptorProto_field_mutable_upb_array(google_protobuf_DescriptorProto* msg, size_t* size, upb_Arena* arena) {
6466   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)};
6467   UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__FieldDescriptorProto_msg_init);
6468   upb_Array* arr = upb_Message_GetOrCreateMutableArray(UPB_UPCAST(msg),
6469                                                        &field, arena);
6470   if (size) {
6471     *size = arr ? arr->UPB_PRIVATE(size) : 0;
6472   }
6473   return arr;
6474 }
google_protobuf_DescriptorProto_clear_nested_type(google_protobuf_DescriptorProto * msg)6475 UPB_INLINE void google_protobuf_DescriptorProto_clear_nested_type(google_protobuf_DescriptorProto* msg) {
6476   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)};
6477   upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
6478 }
google_protobuf_DescriptorProto_nested_type(const google_protobuf_DescriptorProto * msg,size_t * size)6479 UPB_INLINE const google_protobuf_DescriptorProto* const* google_protobuf_DescriptorProto_nested_type(const google_protobuf_DescriptorProto* msg, size_t* size) {
6480   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)};
6481   UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__DescriptorProto_msg_init);
6482   const upb_Array* arr = upb_Message_GetArray(UPB_UPCAST(msg), &field);
6483   if (arr) {
6484     if (size) *size = arr->UPB_PRIVATE(size);
6485     return (const google_protobuf_DescriptorProto* const*)upb_Array_DataPtr(arr);
6486   } else {
6487     if (size) *size = 0;
6488     return NULL;
6489   }
6490 }
_google_protobuf_DescriptorProto_nested_type_upb_array(const google_protobuf_DescriptorProto * msg,size_t * size)6491 UPB_INLINE const upb_Array* _google_protobuf_DescriptorProto_nested_type_upb_array(const google_protobuf_DescriptorProto* msg, size_t* size) {
6492   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)};
6493   UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__DescriptorProto_msg_init);
6494   const upb_Array* arr = upb_Message_GetArray(UPB_UPCAST(msg), &field);
6495   if (size) {
6496     *size = arr ? arr->UPB_PRIVATE(size) : 0;
6497   }
6498   return arr;
6499 }
_google_protobuf_DescriptorProto_nested_type_mutable_upb_array(google_protobuf_DescriptorProto * msg,size_t * size,upb_Arena * arena)6500 UPB_INLINE upb_Array* _google_protobuf_DescriptorProto_nested_type_mutable_upb_array(google_protobuf_DescriptorProto* msg, size_t* size, upb_Arena* arena) {
6501   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)};
6502   UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__DescriptorProto_msg_init);
6503   upb_Array* arr = upb_Message_GetOrCreateMutableArray(UPB_UPCAST(msg),
6504                                                        &field, arena);
6505   if (size) {
6506     *size = arr ? arr->UPB_PRIVATE(size) : 0;
6507   }
6508   return arr;
6509 }
google_protobuf_DescriptorProto_clear_enum_type(google_protobuf_DescriptorProto * msg)6510 UPB_INLINE void google_protobuf_DescriptorProto_clear_enum_type(google_protobuf_DescriptorProto* msg) {
6511   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)};
6512   upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
6513 }
google_protobuf_DescriptorProto_enum_type(const google_protobuf_DescriptorProto * msg,size_t * size)6514 UPB_INLINE const google_protobuf_EnumDescriptorProto* const* google_protobuf_DescriptorProto_enum_type(const google_protobuf_DescriptorProto* msg, size_t* size) {
6515   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)};
6516   UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__EnumDescriptorProto_msg_init);
6517   const upb_Array* arr = upb_Message_GetArray(UPB_UPCAST(msg), &field);
6518   if (arr) {
6519     if (size) *size = arr->UPB_PRIVATE(size);
6520     return (const google_protobuf_EnumDescriptorProto* const*)upb_Array_DataPtr(arr);
6521   } else {
6522     if (size) *size = 0;
6523     return NULL;
6524   }
6525 }
_google_protobuf_DescriptorProto_enum_type_upb_array(const google_protobuf_DescriptorProto * msg,size_t * size)6526 UPB_INLINE const upb_Array* _google_protobuf_DescriptorProto_enum_type_upb_array(const google_protobuf_DescriptorProto* msg, size_t* size) {
6527   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)};
6528   UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__EnumDescriptorProto_msg_init);
6529   const upb_Array* arr = upb_Message_GetArray(UPB_UPCAST(msg), &field);
6530   if (size) {
6531     *size = arr ? arr->UPB_PRIVATE(size) : 0;
6532   }
6533   return arr;
6534 }
_google_protobuf_DescriptorProto_enum_type_mutable_upb_array(google_protobuf_DescriptorProto * msg,size_t * size,upb_Arena * arena)6535 UPB_INLINE upb_Array* _google_protobuf_DescriptorProto_enum_type_mutable_upb_array(google_protobuf_DescriptorProto* msg, size_t* size, upb_Arena* arena) {
6536   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)};
6537   UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__EnumDescriptorProto_msg_init);
6538   upb_Array* arr = upb_Message_GetOrCreateMutableArray(UPB_UPCAST(msg),
6539                                                        &field, arena);
6540   if (size) {
6541     *size = arr ? arr->UPB_PRIVATE(size) : 0;
6542   }
6543   return arr;
6544 }
google_protobuf_DescriptorProto_clear_extension_range(google_protobuf_DescriptorProto * msg)6545 UPB_INLINE void google_protobuf_DescriptorProto_clear_extension_range(google_protobuf_DescriptorProto* msg) {
6546   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)};
6547   upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
6548 }
google_protobuf_DescriptorProto_extension_range(const google_protobuf_DescriptorProto * msg,size_t * size)6549 UPB_INLINE const google_protobuf_DescriptorProto_ExtensionRange* const* google_protobuf_DescriptorProto_extension_range(const google_protobuf_DescriptorProto* msg, size_t* size) {
6550   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)};
6551   UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__DescriptorProto__ExtensionRange_msg_init);
6552   const upb_Array* arr = upb_Message_GetArray(UPB_UPCAST(msg), &field);
6553   if (arr) {
6554     if (size) *size = arr->UPB_PRIVATE(size);
6555     return (const google_protobuf_DescriptorProto_ExtensionRange* const*)upb_Array_DataPtr(arr);
6556   } else {
6557     if (size) *size = 0;
6558     return NULL;
6559   }
6560 }
_google_protobuf_DescriptorProto_extension_range_upb_array(const google_protobuf_DescriptorProto * msg,size_t * size)6561 UPB_INLINE const upb_Array* _google_protobuf_DescriptorProto_extension_range_upb_array(const google_protobuf_DescriptorProto* msg, size_t* size) {
6562   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)};
6563   UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__DescriptorProto__ExtensionRange_msg_init);
6564   const upb_Array* arr = upb_Message_GetArray(UPB_UPCAST(msg), &field);
6565   if (size) {
6566     *size = arr ? arr->UPB_PRIVATE(size) : 0;
6567   }
6568   return arr;
6569 }
_google_protobuf_DescriptorProto_extension_range_mutable_upb_array(google_protobuf_DescriptorProto * msg,size_t * size,upb_Arena * arena)6570 UPB_INLINE upb_Array* _google_protobuf_DescriptorProto_extension_range_mutable_upb_array(google_protobuf_DescriptorProto* msg, size_t* size, upb_Arena* arena) {
6571   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)};
6572   UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__DescriptorProto__ExtensionRange_msg_init);
6573   upb_Array* arr = upb_Message_GetOrCreateMutableArray(UPB_UPCAST(msg),
6574                                                        &field, arena);
6575   if (size) {
6576     *size = arr ? arr->UPB_PRIVATE(size) : 0;
6577   }
6578   return arr;
6579 }
google_protobuf_DescriptorProto_clear_extension(google_protobuf_DescriptorProto * msg)6580 UPB_INLINE void google_protobuf_DescriptorProto_clear_extension(google_protobuf_DescriptorProto* msg) {
6581   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)};
6582   upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
6583 }
google_protobuf_DescriptorProto_extension(const google_protobuf_DescriptorProto * msg,size_t * size)6584 UPB_INLINE const google_protobuf_FieldDescriptorProto* const* google_protobuf_DescriptorProto_extension(const google_protobuf_DescriptorProto* msg, size_t* size) {
6585   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)};
6586   UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__FieldDescriptorProto_msg_init);
6587   const upb_Array* arr = upb_Message_GetArray(UPB_UPCAST(msg), &field);
6588   if (arr) {
6589     if (size) *size = arr->UPB_PRIVATE(size);
6590     return (const google_protobuf_FieldDescriptorProto* const*)upb_Array_DataPtr(arr);
6591   } else {
6592     if (size) *size = 0;
6593     return NULL;
6594   }
6595 }
_google_protobuf_DescriptorProto_extension_upb_array(const google_protobuf_DescriptorProto * msg,size_t * size)6596 UPB_INLINE const upb_Array* _google_protobuf_DescriptorProto_extension_upb_array(const google_protobuf_DescriptorProto* msg, size_t* size) {
6597   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)};
6598   UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__FieldDescriptorProto_msg_init);
6599   const upb_Array* arr = upb_Message_GetArray(UPB_UPCAST(msg), &field);
6600   if (size) {
6601     *size = arr ? arr->UPB_PRIVATE(size) : 0;
6602   }
6603   return arr;
6604 }
_google_protobuf_DescriptorProto_extension_mutable_upb_array(google_protobuf_DescriptorProto * msg,size_t * size,upb_Arena * arena)6605 UPB_INLINE upb_Array* _google_protobuf_DescriptorProto_extension_mutable_upb_array(google_protobuf_DescriptorProto* msg, size_t* size, upb_Arena* arena) {
6606   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)};
6607   UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__FieldDescriptorProto_msg_init);
6608   upb_Array* arr = upb_Message_GetOrCreateMutableArray(UPB_UPCAST(msg),
6609                                                        &field, arena);
6610   if (size) {
6611     *size = arr ? arr->UPB_PRIVATE(size) : 0;
6612   }
6613   return arr;
6614 }
google_protobuf_DescriptorProto_clear_options(google_protobuf_DescriptorProto * msg)6615 UPB_INLINE void google_protobuf_DescriptorProto_clear_options(google_protobuf_DescriptorProto* msg) {
6616   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)};
6617   upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
6618 }
google_protobuf_DescriptorProto_options(const google_protobuf_DescriptorProto * msg)6619 UPB_INLINE const google_protobuf_MessageOptions* google_protobuf_DescriptorProto_options(const google_protobuf_DescriptorProto* msg) {
6620   const google_protobuf_MessageOptions* default_val = NULL;
6621   const google_protobuf_MessageOptions* ret;
6622   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)};
6623   UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__MessageOptions_msg_init);
6624   _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field,
6625                                     &default_val, &ret);
6626   return ret;
6627 }
google_protobuf_DescriptorProto_has_options(const google_protobuf_DescriptorProto * msg)6628 UPB_INLINE bool google_protobuf_DescriptorProto_has_options(const google_protobuf_DescriptorProto* msg) {
6629   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)};
6630   return upb_Message_HasBaseField(UPB_UPCAST(msg), &field);
6631 }
google_protobuf_DescriptorProto_clear_oneof_decl(google_protobuf_DescriptorProto * msg)6632 UPB_INLINE void google_protobuf_DescriptorProto_clear_oneof_decl(google_protobuf_DescriptorProto* msg) {
6633   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)};
6634   upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
6635 }
google_protobuf_DescriptorProto_oneof_decl(const google_protobuf_DescriptorProto * msg,size_t * size)6636 UPB_INLINE const google_protobuf_OneofDescriptorProto* const* google_protobuf_DescriptorProto_oneof_decl(const google_protobuf_DescriptorProto* msg, size_t* size) {
6637   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)};
6638   UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__OneofDescriptorProto_msg_init);
6639   const upb_Array* arr = upb_Message_GetArray(UPB_UPCAST(msg), &field);
6640   if (arr) {
6641     if (size) *size = arr->UPB_PRIVATE(size);
6642     return (const google_protobuf_OneofDescriptorProto* const*)upb_Array_DataPtr(arr);
6643   } else {
6644     if (size) *size = 0;
6645     return NULL;
6646   }
6647 }
_google_protobuf_DescriptorProto_oneof_decl_upb_array(const google_protobuf_DescriptorProto * msg,size_t * size)6648 UPB_INLINE const upb_Array* _google_protobuf_DescriptorProto_oneof_decl_upb_array(const google_protobuf_DescriptorProto* msg, size_t* size) {
6649   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)};
6650   UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__OneofDescriptorProto_msg_init);
6651   const upb_Array* arr = upb_Message_GetArray(UPB_UPCAST(msg), &field);
6652   if (size) {
6653     *size = arr ? arr->UPB_PRIVATE(size) : 0;
6654   }
6655   return arr;
6656 }
_google_protobuf_DescriptorProto_oneof_decl_mutable_upb_array(google_protobuf_DescriptorProto * msg,size_t * size,upb_Arena * arena)6657 UPB_INLINE upb_Array* _google_protobuf_DescriptorProto_oneof_decl_mutable_upb_array(google_protobuf_DescriptorProto* msg, size_t* size, upb_Arena* arena) {
6658   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)};
6659   UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__OneofDescriptorProto_msg_init);
6660   upb_Array* arr = upb_Message_GetOrCreateMutableArray(UPB_UPCAST(msg),
6661                                                        &field, arena);
6662   if (size) {
6663     *size = arr ? arr->UPB_PRIVATE(size) : 0;
6664   }
6665   return arr;
6666 }
google_protobuf_DescriptorProto_clear_reserved_range(google_protobuf_DescriptorProto * msg)6667 UPB_INLINE void google_protobuf_DescriptorProto_clear_reserved_range(google_protobuf_DescriptorProto* msg) {
6668   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)};
6669   upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
6670 }
google_protobuf_DescriptorProto_reserved_range(const google_protobuf_DescriptorProto * msg,size_t * size)6671 UPB_INLINE const google_protobuf_DescriptorProto_ReservedRange* const* google_protobuf_DescriptorProto_reserved_range(const google_protobuf_DescriptorProto* msg, size_t* size) {
6672   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)};
6673   UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__DescriptorProto__ReservedRange_msg_init);
6674   const upb_Array* arr = upb_Message_GetArray(UPB_UPCAST(msg), &field);
6675   if (arr) {
6676     if (size) *size = arr->UPB_PRIVATE(size);
6677     return (const google_protobuf_DescriptorProto_ReservedRange* const*)upb_Array_DataPtr(arr);
6678   } else {
6679     if (size) *size = 0;
6680     return NULL;
6681   }
6682 }
_google_protobuf_DescriptorProto_reserved_range_upb_array(const google_protobuf_DescriptorProto * msg,size_t * size)6683 UPB_INLINE const upb_Array* _google_protobuf_DescriptorProto_reserved_range_upb_array(const google_protobuf_DescriptorProto* msg, size_t* size) {
6684   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)};
6685   UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__DescriptorProto__ReservedRange_msg_init);
6686   const upb_Array* arr = upb_Message_GetArray(UPB_UPCAST(msg), &field);
6687   if (size) {
6688     *size = arr ? arr->UPB_PRIVATE(size) : 0;
6689   }
6690   return arr;
6691 }
_google_protobuf_DescriptorProto_reserved_range_mutable_upb_array(google_protobuf_DescriptorProto * msg,size_t * size,upb_Arena * arena)6692 UPB_INLINE upb_Array* _google_protobuf_DescriptorProto_reserved_range_mutable_upb_array(google_protobuf_DescriptorProto* msg, size_t* size, upb_Arena* arena) {
6693   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)};
6694   UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__DescriptorProto__ReservedRange_msg_init);
6695   upb_Array* arr = upb_Message_GetOrCreateMutableArray(UPB_UPCAST(msg),
6696                                                        &field, arena);
6697   if (size) {
6698     *size = arr ? arr->UPB_PRIVATE(size) : 0;
6699   }
6700   return arr;
6701 }
google_protobuf_DescriptorProto_clear_reserved_name(google_protobuf_DescriptorProto * msg)6702 UPB_INLINE void google_protobuf_DescriptorProto_clear_reserved_name(google_protobuf_DescriptorProto* msg) {
6703   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)};
6704   upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
6705 }
google_protobuf_DescriptorProto_reserved_name(const google_protobuf_DescriptorProto * msg,size_t * size)6706 UPB_INLINE upb_StringView const* google_protobuf_DescriptorProto_reserved_name(const google_protobuf_DescriptorProto* msg, size_t* size) {
6707   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)};
6708   const upb_Array* arr = upb_Message_GetArray(UPB_UPCAST(msg), &field);
6709   if (arr) {
6710     if (size) *size = arr->UPB_PRIVATE(size);
6711     return (upb_StringView const*)upb_Array_DataPtr(arr);
6712   } else {
6713     if (size) *size = 0;
6714     return NULL;
6715   }
6716 }
_google_protobuf_DescriptorProto_reserved_name_upb_array(const google_protobuf_DescriptorProto * msg,size_t * size)6717 UPB_INLINE const upb_Array* _google_protobuf_DescriptorProto_reserved_name_upb_array(const google_protobuf_DescriptorProto* msg, size_t* size) {
6718   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)};
6719   const upb_Array* arr = upb_Message_GetArray(UPB_UPCAST(msg), &field);
6720   if (size) {
6721     *size = arr ? arr->UPB_PRIVATE(size) : 0;
6722   }
6723   return arr;
6724 }
_google_protobuf_DescriptorProto_reserved_name_mutable_upb_array(google_protobuf_DescriptorProto * msg,size_t * size,upb_Arena * arena)6725 UPB_INLINE upb_Array* _google_protobuf_DescriptorProto_reserved_name_mutable_upb_array(google_protobuf_DescriptorProto* msg, size_t* size, upb_Arena* arena) {
6726   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)};
6727   upb_Array* arr = upb_Message_GetOrCreateMutableArray(UPB_UPCAST(msg),
6728                                                        &field, arena);
6729   if (size) {
6730     *size = arr ? arr->UPB_PRIVATE(size) : 0;
6731   }
6732   return arr;
6733 }
6734 
google_protobuf_DescriptorProto_set_name(google_protobuf_DescriptorProto * msg,upb_StringView value)6735 UPB_INLINE void google_protobuf_DescriptorProto_set_name(google_protobuf_DescriptorProto *msg, upb_StringView value) {
6736   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)};
6737   upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
6738 }
google_protobuf_DescriptorProto_mutable_field(google_protobuf_DescriptorProto * msg,size_t * size)6739 UPB_INLINE google_protobuf_FieldDescriptorProto** google_protobuf_DescriptorProto_mutable_field(google_protobuf_DescriptorProto* msg, size_t* size) {
6740   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)};
6741   UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__FieldDescriptorProto_msg_init);
6742   upb_Array* arr = upb_Message_GetMutableArray(UPB_UPCAST(msg), &field);
6743   if (arr) {
6744     if (size) *size = arr->UPB_PRIVATE(size);
6745     return (google_protobuf_FieldDescriptorProto**)upb_Array_MutableDataPtr(arr);
6746   } else {
6747     if (size) *size = 0;
6748     return NULL;
6749   }
6750 }
google_protobuf_DescriptorProto_resize_field(google_protobuf_DescriptorProto * msg,size_t size,upb_Arena * arena)6751 UPB_INLINE google_protobuf_FieldDescriptorProto** google_protobuf_DescriptorProto_resize_field(google_protobuf_DescriptorProto* msg, size_t size, upb_Arena* arena) {
6752   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)};
6753   return (google_protobuf_FieldDescriptorProto**)upb_Message_ResizeArrayUninitialized(UPB_UPCAST(msg),
6754                                                    &field, size, arena);
6755 }
google_protobuf_DescriptorProto_add_field(google_protobuf_DescriptorProto * msg,upb_Arena * arena)6756 UPB_INLINE struct google_protobuf_FieldDescriptorProto* google_protobuf_DescriptorProto_add_field(google_protobuf_DescriptorProto* msg, upb_Arena* arena) {
6757   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)};
6758   UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__FieldDescriptorProto_msg_init);
6759   upb_Array* arr = upb_Message_GetOrCreateMutableArray(
6760       UPB_UPCAST(msg), &field, arena);
6761   if (!arr || !UPB_PRIVATE(_upb_Array_ResizeUninitialized)(
6762                   arr, arr->UPB_PRIVATE(size) + 1, arena)) {
6763     return NULL;
6764   }
6765   struct google_protobuf_FieldDescriptorProto* sub = (struct google_protobuf_FieldDescriptorProto*)_upb_Message_New(&google__protobuf__FieldDescriptorProto_msg_init, arena);
6766   if (!arr || !sub) return NULL;
6767   UPB_PRIVATE(_upb_Array_Set)
6768   (arr, arr->UPB_PRIVATE(size) - 1, &sub, sizeof(sub));
6769   return sub;
6770 }
google_protobuf_DescriptorProto_mutable_nested_type(google_protobuf_DescriptorProto * msg,size_t * size)6771 UPB_INLINE google_protobuf_DescriptorProto** google_protobuf_DescriptorProto_mutable_nested_type(google_protobuf_DescriptorProto* msg, size_t* size) {
6772   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)};
6773   UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__DescriptorProto_msg_init);
6774   upb_Array* arr = upb_Message_GetMutableArray(UPB_UPCAST(msg), &field);
6775   if (arr) {
6776     if (size) *size = arr->UPB_PRIVATE(size);
6777     return (google_protobuf_DescriptorProto**)upb_Array_MutableDataPtr(arr);
6778   } else {
6779     if (size) *size = 0;
6780     return NULL;
6781   }
6782 }
google_protobuf_DescriptorProto_resize_nested_type(google_protobuf_DescriptorProto * msg,size_t size,upb_Arena * arena)6783 UPB_INLINE google_protobuf_DescriptorProto** google_protobuf_DescriptorProto_resize_nested_type(google_protobuf_DescriptorProto* msg, size_t size, upb_Arena* arena) {
6784   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)};
6785   return (google_protobuf_DescriptorProto**)upb_Message_ResizeArrayUninitialized(UPB_UPCAST(msg),
6786                                                    &field, size, arena);
6787 }
google_protobuf_DescriptorProto_add_nested_type(google_protobuf_DescriptorProto * msg,upb_Arena * arena)6788 UPB_INLINE struct google_protobuf_DescriptorProto* google_protobuf_DescriptorProto_add_nested_type(google_protobuf_DescriptorProto* msg, upb_Arena* arena) {
6789   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)};
6790   UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__DescriptorProto_msg_init);
6791   upb_Array* arr = upb_Message_GetOrCreateMutableArray(
6792       UPB_UPCAST(msg), &field, arena);
6793   if (!arr || !UPB_PRIVATE(_upb_Array_ResizeUninitialized)(
6794                   arr, arr->UPB_PRIVATE(size) + 1, arena)) {
6795     return NULL;
6796   }
6797   struct google_protobuf_DescriptorProto* sub = (struct google_protobuf_DescriptorProto*)_upb_Message_New(&google__protobuf__DescriptorProto_msg_init, arena);
6798   if (!arr || !sub) return NULL;
6799   UPB_PRIVATE(_upb_Array_Set)
6800   (arr, arr->UPB_PRIVATE(size) - 1, &sub, sizeof(sub));
6801   return sub;
6802 }
google_protobuf_DescriptorProto_mutable_enum_type(google_protobuf_DescriptorProto * msg,size_t * size)6803 UPB_INLINE google_protobuf_EnumDescriptorProto** google_protobuf_DescriptorProto_mutable_enum_type(google_protobuf_DescriptorProto* msg, size_t* size) {
6804   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)};
6805   UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__EnumDescriptorProto_msg_init);
6806   upb_Array* arr = upb_Message_GetMutableArray(UPB_UPCAST(msg), &field);
6807   if (arr) {
6808     if (size) *size = arr->UPB_PRIVATE(size);
6809     return (google_protobuf_EnumDescriptorProto**)upb_Array_MutableDataPtr(arr);
6810   } else {
6811     if (size) *size = 0;
6812     return NULL;
6813   }
6814 }
google_protobuf_DescriptorProto_resize_enum_type(google_protobuf_DescriptorProto * msg,size_t size,upb_Arena * arena)6815 UPB_INLINE google_protobuf_EnumDescriptorProto** google_protobuf_DescriptorProto_resize_enum_type(google_protobuf_DescriptorProto* msg, size_t size, upb_Arena* arena) {
6816   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)};
6817   return (google_protobuf_EnumDescriptorProto**)upb_Message_ResizeArrayUninitialized(UPB_UPCAST(msg),
6818                                                    &field, size, arena);
6819 }
google_protobuf_DescriptorProto_add_enum_type(google_protobuf_DescriptorProto * msg,upb_Arena * arena)6820 UPB_INLINE struct google_protobuf_EnumDescriptorProto* google_protobuf_DescriptorProto_add_enum_type(google_protobuf_DescriptorProto* msg, upb_Arena* arena) {
6821   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)};
6822   UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__EnumDescriptorProto_msg_init);
6823   upb_Array* arr = upb_Message_GetOrCreateMutableArray(
6824       UPB_UPCAST(msg), &field, arena);
6825   if (!arr || !UPB_PRIVATE(_upb_Array_ResizeUninitialized)(
6826                   arr, arr->UPB_PRIVATE(size) + 1, arena)) {
6827     return NULL;
6828   }
6829   struct google_protobuf_EnumDescriptorProto* sub = (struct google_protobuf_EnumDescriptorProto*)_upb_Message_New(&google__protobuf__EnumDescriptorProto_msg_init, arena);
6830   if (!arr || !sub) return NULL;
6831   UPB_PRIVATE(_upb_Array_Set)
6832   (arr, arr->UPB_PRIVATE(size) - 1, &sub, sizeof(sub));
6833   return sub;
6834 }
google_protobuf_DescriptorProto_mutable_extension_range(google_protobuf_DescriptorProto * msg,size_t * size)6835 UPB_INLINE google_protobuf_DescriptorProto_ExtensionRange** google_protobuf_DescriptorProto_mutable_extension_range(google_protobuf_DescriptorProto* msg, size_t* size) {
6836   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)};
6837   UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__DescriptorProto__ExtensionRange_msg_init);
6838   upb_Array* arr = upb_Message_GetMutableArray(UPB_UPCAST(msg), &field);
6839   if (arr) {
6840     if (size) *size = arr->UPB_PRIVATE(size);
6841     return (google_protobuf_DescriptorProto_ExtensionRange**)upb_Array_MutableDataPtr(arr);
6842   } else {
6843     if (size) *size = 0;
6844     return NULL;
6845   }
6846 }
google_protobuf_DescriptorProto_resize_extension_range(google_protobuf_DescriptorProto * msg,size_t size,upb_Arena * arena)6847 UPB_INLINE google_protobuf_DescriptorProto_ExtensionRange** google_protobuf_DescriptorProto_resize_extension_range(google_protobuf_DescriptorProto* msg, size_t size, upb_Arena* arena) {
6848   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)};
6849   return (google_protobuf_DescriptorProto_ExtensionRange**)upb_Message_ResizeArrayUninitialized(UPB_UPCAST(msg),
6850                                                    &field, size, arena);
6851 }
google_protobuf_DescriptorProto_add_extension_range(google_protobuf_DescriptorProto * msg,upb_Arena * arena)6852 UPB_INLINE struct google_protobuf_DescriptorProto_ExtensionRange* google_protobuf_DescriptorProto_add_extension_range(google_protobuf_DescriptorProto* msg, upb_Arena* arena) {
6853   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)};
6854   UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__DescriptorProto__ExtensionRange_msg_init);
6855   upb_Array* arr = upb_Message_GetOrCreateMutableArray(
6856       UPB_UPCAST(msg), &field, arena);
6857   if (!arr || !UPB_PRIVATE(_upb_Array_ResizeUninitialized)(
6858                   arr, arr->UPB_PRIVATE(size) + 1, arena)) {
6859     return NULL;
6860   }
6861   struct google_protobuf_DescriptorProto_ExtensionRange* sub = (struct google_protobuf_DescriptorProto_ExtensionRange*)_upb_Message_New(&google__protobuf__DescriptorProto__ExtensionRange_msg_init, arena);
6862   if (!arr || !sub) return NULL;
6863   UPB_PRIVATE(_upb_Array_Set)
6864   (arr, arr->UPB_PRIVATE(size) - 1, &sub, sizeof(sub));
6865   return sub;
6866 }
google_protobuf_DescriptorProto_mutable_extension(google_protobuf_DescriptorProto * msg,size_t * size)6867 UPB_INLINE google_protobuf_FieldDescriptorProto** google_protobuf_DescriptorProto_mutable_extension(google_protobuf_DescriptorProto* msg, size_t* size) {
6868   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)};
6869   UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__FieldDescriptorProto_msg_init);
6870   upb_Array* arr = upb_Message_GetMutableArray(UPB_UPCAST(msg), &field);
6871   if (arr) {
6872     if (size) *size = arr->UPB_PRIVATE(size);
6873     return (google_protobuf_FieldDescriptorProto**)upb_Array_MutableDataPtr(arr);
6874   } else {
6875     if (size) *size = 0;
6876     return NULL;
6877   }
6878 }
google_protobuf_DescriptorProto_resize_extension(google_protobuf_DescriptorProto * msg,size_t size,upb_Arena * arena)6879 UPB_INLINE google_protobuf_FieldDescriptorProto** google_protobuf_DescriptorProto_resize_extension(google_protobuf_DescriptorProto* msg, size_t size, upb_Arena* arena) {
6880   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)};
6881   return (google_protobuf_FieldDescriptorProto**)upb_Message_ResizeArrayUninitialized(UPB_UPCAST(msg),
6882                                                    &field, size, arena);
6883 }
google_protobuf_DescriptorProto_add_extension(google_protobuf_DescriptorProto * msg,upb_Arena * arena)6884 UPB_INLINE struct google_protobuf_FieldDescriptorProto* google_protobuf_DescriptorProto_add_extension(google_protobuf_DescriptorProto* msg, upb_Arena* arena) {
6885   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)};
6886   UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__FieldDescriptorProto_msg_init);
6887   upb_Array* arr = upb_Message_GetOrCreateMutableArray(
6888       UPB_UPCAST(msg), &field, arena);
6889   if (!arr || !UPB_PRIVATE(_upb_Array_ResizeUninitialized)(
6890                   arr, arr->UPB_PRIVATE(size) + 1, arena)) {
6891     return NULL;
6892   }
6893   struct google_protobuf_FieldDescriptorProto* sub = (struct google_protobuf_FieldDescriptorProto*)_upb_Message_New(&google__protobuf__FieldDescriptorProto_msg_init, arena);
6894   if (!arr || !sub) return NULL;
6895   UPB_PRIVATE(_upb_Array_Set)
6896   (arr, arr->UPB_PRIVATE(size) - 1, &sub, sizeof(sub));
6897   return sub;
6898 }
google_protobuf_DescriptorProto_set_options(google_protobuf_DescriptorProto * msg,google_protobuf_MessageOptions * value)6899 UPB_INLINE void google_protobuf_DescriptorProto_set_options(google_protobuf_DescriptorProto *msg, google_protobuf_MessageOptions* value) {
6900   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)};
6901   UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__MessageOptions_msg_init);
6902   upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
6903 }
google_protobuf_DescriptorProto_mutable_options(google_protobuf_DescriptorProto * msg,upb_Arena * arena)6904 UPB_INLINE struct google_protobuf_MessageOptions* google_protobuf_DescriptorProto_mutable_options(google_protobuf_DescriptorProto* msg, upb_Arena* arena) {
6905   struct google_protobuf_MessageOptions* sub = (struct google_protobuf_MessageOptions*)google_protobuf_DescriptorProto_options(msg);
6906   if (sub == NULL) {
6907     sub = (struct google_protobuf_MessageOptions*)_upb_Message_New(&google__protobuf__MessageOptions_msg_init, arena);
6908     if (sub) google_protobuf_DescriptorProto_set_options(msg, sub);
6909   }
6910   return sub;
6911 }
google_protobuf_DescriptorProto_mutable_oneof_decl(google_protobuf_DescriptorProto * msg,size_t * size)6912 UPB_INLINE google_protobuf_OneofDescriptorProto** google_protobuf_DescriptorProto_mutable_oneof_decl(google_protobuf_DescriptorProto* msg, size_t* size) {
6913   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)};
6914   UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__OneofDescriptorProto_msg_init);
6915   upb_Array* arr = upb_Message_GetMutableArray(UPB_UPCAST(msg), &field);
6916   if (arr) {
6917     if (size) *size = arr->UPB_PRIVATE(size);
6918     return (google_protobuf_OneofDescriptorProto**)upb_Array_MutableDataPtr(arr);
6919   } else {
6920     if (size) *size = 0;
6921     return NULL;
6922   }
6923 }
google_protobuf_DescriptorProto_resize_oneof_decl(google_protobuf_DescriptorProto * msg,size_t size,upb_Arena * arena)6924 UPB_INLINE google_protobuf_OneofDescriptorProto** google_protobuf_DescriptorProto_resize_oneof_decl(google_protobuf_DescriptorProto* msg, size_t size, upb_Arena* arena) {
6925   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)};
6926   return (google_protobuf_OneofDescriptorProto**)upb_Message_ResizeArrayUninitialized(UPB_UPCAST(msg),
6927                                                    &field, size, arena);
6928 }
google_protobuf_DescriptorProto_add_oneof_decl(google_protobuf_DescriptorProto * msg,upb_Arena * arena)6929 UPB_INLINE struct google_protobuf_OneofDescriptorProto* google_protobuf_DescriptorProto_add_oneof_decl(google_protobuf_DescriptorProto* msg, upb_Arena* arena) {
6930   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)};
6931   UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__OneofDescriptorProto_msg_init);
6932   upb_Array* arr = upb_Message_GetOrCreateMutableArray(
6933       UPB_UPCAST(msg), &field, arena);
6934   if (!arr || !UPB_PRIVATE(_upb_Array_ResizeUninitialized)(
6935                   arr, arr->UPB_PRIVATE(size) + 1, arena)) {
6936     return NULL;
6937   }
6938   struct google_protobuf_OneofDescriptorProto* sub = (struct google_protobuf_OneofDescriptorProto*)_upb_Message_New(&google__protobuf__OneofDescriptorProto_msg_init, arena);
6939   if (!arr || !sub) return NULL;
6940   UPB_PRIVATE(_upb_Array_Set)
6941   (arr, arr->UPB_PRIVATE(size) - 1, &sub, sizeof(sub));
6942   return sub;
6943 }
google_protobuf_DescriptorProto_mutable_reserved_range(google_protobuf_DescriptorProto * msg,size_t * size)6944 UPB_INLINE google_protobuf_DescriptorProto_ReservedRange** google_protobuf_DescriptorProto_mutable_reserved_range(google_protobuf_DescriptorProto* msg, size_t* size) {
6945   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)};
6946   UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__DescriptorProto__ReservedRange_msg_init);
6947   upb_Array* arr = upb_Message_GetMutableArray(UPB_UPCAST(msg), &field);
6948   if (arr) {
6949     if (size) *size = arr->UPB_PRIVATE(size);
6950     return (google_protobuf_DescriptorProto_ReservedRange**)upb_Array_MutableDataPtr(arr);
6951   } else {
6952     if (size) *size = 0;
6953     return NULL;
6954   }
6955 }
google_protobuf_DescriptorProto_resize_reserved_range(google_protobuf_DescriptorProto * msg,size_t size,upb_Arena * arena)6956 UPB_INLINE google_protobuf_DescriptorProto_ReservedRange** google_protobuf_DescriptorProto_resize_reserved_range(google_protobuf_DescriptorProto* msg, size_t size, upb_Arena* arena) {
6957   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)};
6958   return (google_protobuf_DescriptorProto_ReservedRange**)upb_Message_ResizeArrayUninitialized(UPB_UPCAST(msg),
6959                                                    &field, size, arena);
6960 }
google_protobuf_DescriptorProto_add_reserved_range(google_protobuf_DescriptorProto * msg,upb_Arena * arena)6961 UPB_INLINE struct google_protobuf_DescriptorProto_ReservedRange* google_protobuf_DescriptorProto_add_reserved_range(google_protobuf_DescriptorProto* msg, upb_Arena* arena) {
6962   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)};
6963   UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__DescriptorProto__ReservedRange_msg_init);
6964   upb_Array* arr = upb_Message_GetOrCreateMutableArray(
6965       UPB_UPCAST(msg), &field, arena);
6966   if (!arr || !UPB_PRIVATE(_upb_Array_ResizeUninitialized)(
6967                   arr, arr->UPB_PRIVATE(size) + 1, arena)) {
6968     return NULL;
6969   }
6970   struct google_protobuf_DescriptorProto_ReservedRange* sub = (struct google_protobuf_DescriptorProto_ReservedRange*)_upb_Message_New(&google__protobuf__DescriptorProto__ReservedRange_msg_init, arena);
6971   if (!arr || !sub) return NULL;
6972   UPB_PRIVATE(_upb_Array_Set)
6973   (arr, arr->UPB_PRIVATE(size) - 1, &sub, sizeof(sub));
6974   return sub;
6975 }
google_protobuf_DescriptorProto_mutable_reserved_name(google_protobuf_DescriptorProto * msg,size_t * size)6976 UPB_INLINE upb_StringView* google_protobuf_DescriptorProto_mutable_reserved_name(google_protobuf_DescriptorProto* msg, size_t* size) {
6977   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)};
6978   upb_Array* arr = upb_Message_GetMutableArray(UPB_UPCAST(msg), &field);
6979   if (arr) {
6980     if (size) *size = arr->UPB_PRIVATE(size);
6981     return (upb_StringView*)upb_Array_MutableDataPtr(arr);
6982   } else {
6983     if (size) *size = 0;
6984     return NULL;
6985   }
6986 }
google_protobuf_DescriptorProto_resize_reserved_name(google_protobuf_DescriptorProto * msg,size_t size,upb_Arena * arena)6987 UPB_INLINE upb_StringView* google_protobuf_DescriptorProto_resize_reserved_name(google_protobuf_DescriptorProto* msg, size_t size, upb_Arena* arena) {
6988   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)};
6989   return (upb_StringView*)upb_Message_ResizeArrayUninitialized(UPB_UPCAST(msg),
6990                                                    &field, size, arena);
6991 }
google_protobuf_DescriptorProto_add_reserved_name(google_protobuf_DescriptorProto * msg,upb_StringView val,upb_Arena * arena)6992 UPB_INLINE bool google_protobuf_DescriptorProto_add_reserved_name(google_protobuf_DescriptorProto* msg, upb_StringView val, upb_Arena* arena) {
6993   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)};
6994   upb_Array* arr = upb_Message_GetOrCreateMutableArray(
6995       UPB_UPCAST(msg), &field, arena);
6996   if (!arr || !UPB_PRIVATE(_upb_Array_ResizeUninitialized)(
6997                   arr, arr->UPB_PRIVATE(size) + 1, arena)) {
6998     return false;
6999   }
7000   UPB_PRIVATE(_upb_Array_Set)
7001   (arr, arr->UPB_PRIVATE(size) - 1, &val, sizeof(val));
7002   return true;
7003 }
7004 
7005 /* google.protobuf.DescriptorProto.ExtensionRange */
7006 
google_protobuf_DescriptorProto_ExtensionRange_new(upb_Arena * arena)7007 UPB_INLINE google_protobuf_DescriptorProto_ExtensionRange* google_protobuf_DescriptorProto_ExtensionRange_new(upb_Arena* arena) {
7008   return (google_protobuf_DescriptorProto_ExtensionRange*)_upb_Message_New(&google__protobuf__DescriptorProto__ExtensionRange_msg_init, arena);
7009 }
google_protobuf_DescriptorProto_ExtensionRange_parse(const char * buf,size_t size,upb_Arena * arena)7010 UPB_INLINE google_protobuf_DescriptorProto_ExtensionRange* google_protobuf_DescriptorProto_ExtensionRange_parse(const char* buf, size_t size, upb_Arena* arena) {
7011   google_protobuf_DescriptorProto_ExtensionRange* ret = google_protobuf_DescriptorProto_ExtensionRange_new(arena);
7012   if (!ret) return NULL;
7013   if (upb_Decode(buf, size, UPB_UPCAST(ret), &google__protobuf__DescriptorProto__ExtensionRange_msg_init, NULL, 0, arena) !=
7014       kUpb_DecodeStatus_Ok) {
7015     return NULL;
7016   }
7017   return ret;
7018 }
google_protobuf_DescriptorProto_ExtensionRange_parse_ex(const char * buf,size_t size,const upb_ExtensionRegistry * extreg,int options,upb_Arena * arena)7019 UPB_INLINE google_protobuf_DescriptorProto_ExtensionRange* google_protobuf_DescriptorProto_ExtensionRange_parse_ex(const char* buf, size_t size,
7020                            const upb_ExtensionRegistry* extreg,
7021                            int options, upb_Arena* arena) {
7022   google_protobuf_DescriptorProto_ExtensionRange* ret = google_protobuf_DescriptorProto_ExtensionRange_new(arena);
7023   if (!ret) return NULL;
7024   if (upb_Decode(buf, size, UPB_UPCAST(ret), &google__protobuf__DescriptorProto__ExtensionRange_msg_init, extreg, options,
7025                  arena) != kUpb_DecodeStatus_Ok) {
7026     return NULL;
7027   }
7028   return ret;
7029 }
google_protobuf_DescriptorProto_ExtensionRange_serialize(const google_protobuf_DescriptorProto_ExtensionRange * msg,upb_Arena * arena,size_t * len)7030 UPB_INLINE char* google_protobuf_DescriptorProto_ExtensionRange_serialize(const google_protobuf_DescriptorProto_ExtensionRange* msg, upb_Arena* arena, size_t* len) {
7031   char* ptr;
7032   (void)upb_Encode(UPB_UPCAST(msg), &google__protobuf__DescriptorProto__ExtensionRange_msg_init, 0, arena, &ptr, len);
7033   return ptr;
7034 }
google_protobuf_DescriptorProto_ExtensionRange_serialize_ex(const google_protobuf_DescriptorProto_ExtensionRange * msg,int options,upb_Arena * arena,size_t * len)7035 UPB_INLINE char* google_protobuf_DescriptorProto_ExtensionRange_serialize_ex(const google_protobuf_DescriptorProto_ExtensionRange* msg, int options,
7036                                  upb_Arena* arena, size_t* len) {
7037   char* ptr;
7038   (void)upb_Encode(UPB_UPCAST(msg), &google__protobuf__DescriptorProto__ExtensionRange_msg_init, options, arena, &ptr, len);
7039   return ptr;
7040 }
google_protobuf_DescriptorProto_ExtensionRange_clear_start(google_protobuf_DescriptorProto_ExtensionRange * msg)7041 UPB_INLINE void google_protobuf_DescriptorProto_ExtensionRange_clear_start(google_protobuf_DescriptorProto_ExtensionRange* msg) {
7042   const upb_MiniTableField field = {1, 12, 64, kUpb_NoSub, 5, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
7043   upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
7044 }
google_protobuf_DescriptorProto_ExtensionRange_start(const google_protobuf_DescriptorProto_ExtensionRange * msg)7045 UPB_INLINE int32_t google_protobuf_DescriptorProto_ExtensionRange_start(const google_protobuf_DescriptorProto_ExtensionRange* msg) {
7046   int32_t default_val = (int32_t)0;
7047   int32_t ret;
7048   const upb_MiniTableField field = {1, 12, 64, kUpb_NoSub, 5, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
7049   _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field,
7050                                     &default_val, &ret);
7051   return ret;
7052 }
google_protobuf_DescriptorProto_ExtensionRange_has_start(const google_protobuf_DescriptorProto_ExtensionRange * msg)7053 UPB_INLINE bool google_protobuf_DescriptorProto_ExtensionRange_has_start(const google_protobuf_DescriptorProto_ExtensionRange* msg) {
7054   const upb_MiniTableField field = {1, 12, 64, kUpb_NoSub, 5, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
7055   return upb_Message_HasBaseField(UPB_UPCAST(msg), &field);
7056 }
google_protobuf_DescriptorProto_ExtensionRange_clear_end(google_protobuf_DescriptorProto_ExtensionRange * msg)7057 UPB_INLINE void google_protobuf_DescriptorProto_ExtensionRange_clear_end(google_protobuf_DescriptorProto_ExtensionRange* msg) {
7058   const upb_MiniTableField field = {2, 16, 65, kUpb_NoSub, 5, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
7059   upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
7060 }
google_protobuf_DescriptorProto_ExtensionRange_end(const google_protobuf_DescriptorProto_ExtensionRange * msg)7061 UPB_INLINE int32_t google_protobuf_DescriptorProto_ExtensionRange_end(const google_protobuf_DescriptorProto_ExtensionRange* msg) {
7062   int32_t default_val = (int32_t)0;
7063   int32_t ret;
7064   const upb_MiniTableField field = {2, 16, 65, kUpb_NoSub, 5, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
7065   _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field,
7066                                     &default_val, &ret);
7067   return ret;
7068 }
google_protobuf_DescriptorProto_ExtensionRange_has_end(const google_protobuf_DescriptorProto_ExtensionRange * msg)7069 UPB_INLINE bool google_protobuf_DescriptorProto_ExtensionRange_has_end(const google_protobuf_DescriptorProto_ExtensionRange* msg) {
7070   const upb_MiniTableField field = {2, 16, 65, kUpb_NoSub, 5, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
7071   return upb_Message_HasBaseField(UPB_UPCAST(msg), &field);
7072 }
google_protobuf_DescriptorProto_ExtensionRange_clear_options(google_protobuf_DescriptorProto_ExtensionRange * msg)7073 UPB_INLINE void google_protobuf_DescriptorProto_ExtensionRange_clear_options(google_protobuf_DescriptorProto_ExtensionRange* msg) {
7074   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)};
7075   upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
7076 }
google_protobuf_DescriptorProto_ExtensionRange_options(const google_protobuf_DescriptorProto_ExtensionRange * msg)7077 UPB_INLINE const google_protobuf_ExtensionRangeOptions* google_protobuf_DescriptorProto_ExtensionRange_options(const google_protobuf_DescriptorProto_ExtensionRange* msg) {
7078   const google_protobuf_ExtensionRangeOptions* default_val = NULL;
7079   const google_protobuf_ExtensionRangeOptions* ret;
7080   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)};
7081   UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__ExtensionRangeOptions_msg_init);
7082   _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field,
7083                                     &default_val, &ret);
7084   return ret;
7085 }
google_protobuf_DescriptorProto_ExtensionRange_has_options(const google_protobuf_DescriptorProto_ExtensionRange * msg)7086 UPB_INLINE bool google_protobuf_DescriptorProto_ExtensionRange_has_options(const google_protobuf_DescriptorProto_ExtensionRange* msg) {
7087   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)};
7088   return upb_Message_HasBaseField(UPB_UPCAST(msg), &field);
7089 }
7090 
google_protobuf_DescriptorProto_ExtensionRange_set_start(google_protobuf_DescriptorProto_ExtensionRange * msg,int32_t value)7091 UPB_INLINE void google_protobuf_DescriptorProto_ExtensionRange_set_start(google_protobuf_DescriptorProto_ExtensionRange *msg, int32_t value) {
7092   const upb_MiniTableField field = {1, 12, 64, kUpb_NoSub, 5, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
7093   upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
7094 }
google_protobuf_DescriptorProto_ExtensionRange_set_end(google_protobuf_DescriptorProto_ExtensionRange * msg,int32_t value)7095 UPB_INLINE void google_protobuf_DescriptorProto_ExtensionRange_set_end(google_protobuf_DescriptorProto_ExtensionRange *msg, int32_t value) {
7096   const upb_MiniTableField field = {2, 16, 65, kUpb_NoSub, 5, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
7097   upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
7098 }
google_protobuf_DescriptorProto_ExtensionRange_set_options(google_protobuf_DescriptorProto_ExtensionRange * msg,google_protobuf_ExtensionRangeOptions * value)7099 UPB_INLINE void google_protobuf_DescriptorProto_ExtensionRange_set_options(google_protobuf_DescriptorProto_ExtensionRange *msg, google_protobuf_ExtensionRangeOptions* value) {
7100   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)};
7101   UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__ExtensionRangeOptions_msg_init);
7102   upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
7103 }
google_protobuf_DescriptorProto_ExtensionRange_mutable_options(google_protobuf_DescriptorProto_ExtensionRange * msg,upb_Arena * arena)7104 UPB_INLINE struct google_protobuf_ExtensionRangeOptions* google_protobuf_DescriptorProto_ExtensionRange_mutable_options(google_protobuf_DescriptorProto_ExtensionRange* msg, upb_Arena* arena) {
7105   struct google_protobuf_ExtensionRangeOptions* sub = (struct google_protobuf_ExtensionRangeOptions*)google_protobuf_DescriptorProto_ExtensionRange_options(msg);
7106   if (sub == NULL) {
7107     sub = (struct google_protobuf_ExtensionRangeOptions*)_upb_Message_New(&google__protobuf__ExtensionRangeOptions_msg_init, arena);
7108     if (sub) google_protobuf_DescriptorProto_ExtensionRange_set_options(msg, sub);
7109   }
7110   return sub;
7111 }
7112 
7113 /* google.protobuf.DescriptorProto.ReservedRange */
7114 
google_protobuf_DescriptorProto_ReservedRange_new(upb_Arena * arena)7115 UPB_INLINE google_protobuf_DescriptorProto_ReservedRange* google_protobuf_DescriptorProto_ReservedRange_new(upb_Arena* arena) {
7116   return (google_protobuf_DescriptorProto_ReservedRange*)_upb_Message_New(&google__protobuf__DescriptorProto__ReservedRange_msg_init, arena);
7117 }
google_protobuf_DescriptorProto_ReservedRange_parse(const char * buf,size_t size,upb_Arena * arena)7118 UPB_INLINE google_protobuf_DescriptorProto_ReservedRange* google_protobuf_DescriptorProto_ReservedRange_parse(const char* buf, size_t size, upb_Arena* arena) {
7119   google_protobuf_DescriptorProto_ReservedRange* ret = google_protobuf_DescriptorProto_ReservedRange_new(arena);
7120   if (!ret) return NULL;
7121   if (upb_Decode(buf, size, UPB_UPCAST(ret), &google__protobuf__DescriptorProto__ReservedRange_msg_init, NULL, 0, arena) !=
7122       kUpb_DecodeStatus_Ok) {
7123     return NULL;
7124   }
7125   return ret;
7126 }
google_protobuf_DescriptorProto_ReservedRange_parse_ex(const char * buf,size_t size,const upb_ExtensionRegistry * extreg,int options,upb_Arena * arena)7127 UPB_INLINE google_protobuf_DescriptorProto_ReservedRange* google_protobuf_DescriptorProto_ReservedRange_parse_ex(const char* buf, size_t size,
7128                            const upb_ExtensionRegistry* extreg,
7129                            int options, upb_Arena* arena) {
7130   google_protobuf_DescriptorProto_ReservedRange* ret = google_protobuf_DescriptorProto_ReservedRange_new(arena);
7131   if (!ret) return NULL;
7132   if (upb_Decode(buf, size, UPB_UPCAST(ret), &google__protobuf__DescriptorProto__ReservedRange_msg_init, extreg, options,
7133                  arena) != kUpb_DecodeStatus_Ok) {
7134     return NULL;
7135   }
7136   return ret;
7137 }
google_protobuf_DescriptorProto_ReservedRange_serialize(const google_protobuf_DescriptorProto_ReservedRange * msg,upb_Arena * arena,size_t * len)7138 UPB_INLINE char* google_protobuf_DescriptorProto_ReservedRange_serialize(const google_protobuf_DescriptorProto_ReservedRange* msg, upb_Arena* arena, size_t* len) {
7139   char* ptr;
7140   (void)upb_Encode(UPB_UPCAST(msg), &google__protobuf__DescriptorProto__ReservedRange_msg_init, 0, arena, &ptr, len);
7141   return ptr;
7142 }
google_protobuf_DescriptorProto_ReservedRange_serialize_ex(const google_protobuf_DescriptorProto_ReservedRange * msg,int options,upb_Arena * arena,size_t * len)7143 UPB_INLINE char* google_protobuf_DescriptorProto_ReservedRange_serialize_ex(const google_protobuf_DescriptorProto_ReservedRange* msg, int options,
7144                                  upb_Arena* arena, size_t* len) {
7145   char* ptr;
7146   (void)upb_Encode(UPB_UPCAST(msg), &google__protobuf__DescriptorProto__ReservedRange_msg_init, options, arena, &ptr, len);
7147   return ptr;
7148 }
google_protobuf_DescriptorProto_ReservedRange_clear_start(google_protobuf_DescriptorProto_ReservedRange * msg)7149 UPB_INLINE void google_protobuf_DescriptorProto_ReservedRange_clear_start(google_protobuf_DescriptorProto_ReservedRange* msg) {
7150   const upb_MiniTableField field = {1, 12, 64, kUpb_NoSub, 5, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
7151   upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
7152 }
google_protobuf_DescriptorProto_ReservedRange_start(const google_protobuf_DescriptorProto_ReservedRange * msg)7153 UPB_INLINE int32_t google_protobuf_DescriptorProto_ReservedRange_start(const google_protobuf_DescriptorProto_ReservedRange* msg) {
7154   int32_t default_val = (int32_t)0;
7155   int32_t ret;
7156   const upb_MiniTableField field = {1, 12, 64, kUpb_NoSub, 5, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
7157   _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field,
7158                                     &default_val, &ret);
7159   return ret;
7160 }
google_protobuf_DescriptorProto_ReservedRange_has_start(const google_protobuf_DescriptorProto_ReservedRange * msg)7161 UPB_INLINE bool google_protobuf_DescriptorProto_ReservedRange_has_start(const google_protobuf_DescriptorProto_ReservedRange* msg) {
7162   const upb_MiniTableField field = {1, 12, 64, kUpb_NoSub, 5, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
7163   return upb_Message_HasBaseField(UPB_UPCAST(msg), &field);
7164 }
google_protobuf_DescriptorProto_ReservedRange_clear_end(google_protobuf_DescriptorProto_ReservedRange * msg)7165 UPB_INLINE void google_protobuf_DescriptorProto_ReservedRange_clear_end(google_protobuf_DescriptorProto_ReservedRange* msg) {
7166   const upb_MiniTableField field = {2, 16, 65, kUpb_NoSub, 5, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
7167   upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
7168 }
google_protobuf_DescriptorProto_ReservedRange_end(const google_protobuf_DescriptorProto_ReservedRange * msg)7169 UPB_INLINE int32_t google_protobuf_DescriptorProto_ReservedRange_end(const google_protobuf_DescriptorProto_ReservedRange* msg) {
7170   int32_t default_val = (int32_t)0;
7171   int32_t ret;
7172   const upb_MiniTableField field = {2, 16, 65, kUpb_NoSub, 5, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
7173   _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field,
7174                                     &default_val, &ret);
7175   return ret;
7176 }
google_protobuf_DescriptorProto_ReservedRange_has_end(const google_protobuf_DescriptorProto_ReservedRange * msg)7177 UPB_INLINE bool google_protobuf_DescriptorProto_ReservedRange_has_end(const google_protobuf_DescriptorProto_ReservedRange* msg) {
7178   const upb_MiniTableField field = {2, 16, 65, kUpb_NoSub, 5, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
7179   return upb_Message_HasBaseField(UPB_UPCAST(msg), &field);
7180 }
7181 
google_protobuf_DescriptorProto_ReservedRange_set_start(google_protobuf_DescriptorProto_ReservedRange * msg,int32_t value)7182 UPB_INLINE void google_protobuf_DescriptorProto_ReservedRange_set_start(google_protobuf_DescriptorProto_ReservedRange *msg, int32_t value) {
7183   const upb_MiniTableField field = {1, 12, 64, kUpb_NoSub, 5, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
7184   upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
7185 }
google_protobuf_DescriptorProto_ReservedRange_set_end(google_protobuf_DescriptorProto_ReservedRange * msg,int32_t value)7186 UPB_INLINE void google_protobuf_DescriptorProto_ReservedRange_set_end(google_protobuf_DescriptorProto_ReservedRange *msg, int32_t value) {
7187   const upb_MiniTableField field = {2, 16, 65, kUpb_NoSub, 5, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
7188   upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
7189 }
7190 
7191 /* google.protobuf.ExtensionRangeOptions */
7192 
google_protobuf_ExtensionRangeOptions_new(upb_Arena * arena)7193 UPB_INLINE google_protobuf_ExtensionRangeOptions* google_protobuf_ExtensionRangeOptions_new(upb_Arena* arena) {
7194   return (google_protobuf_ExtensionRangeOptions*)_upb_Message_New(&google__protobuf__ExtensionRangeOptions_msg_init, arena);
7195 }
google_protobuf_ExtensionRangeOptions_parse(const char * buf,size_t size,upb_Arena * arena)7196 UPB_INLINE google_protobuf_ExtensionRangeOptions* google_protobuf_ExtensionRangeOptions_parse(const char* buf, size_t size, upb_Arena* arena) {
7197   google_protobuf_ExtensionRangeOptions* ret = google_protobuf_ExtensionRangeOptions_new(arena);
7198   if (!ret) return NULL;
7199   if (upb_Decode(buf, size, UPB_UPCAST(ret), &google__protobuf__ExtensionRangeOptions_msg_init, NULL, 0, arena) !=
7200       kUpb_DecodeStatus_Ok) {
7201     return NULL;
7202   }
7203   return ret;
7204 }
google_protobuf_ExtensionRangeOptions_parse_ex(const char * buf,size_t size,const upb_ExtensionRegistry * extreg,int options,upb_Arena * arena)7205 UPB_INLINE google_protobuf_ExtensionRangeOptions* google_protobuf_ExtensionRangeOptions_parse_ex(const char* buf, size_t size,
7206                            const upb_ExtensionRegistry* extreg,
7207                            int options, upb_Arena* arena) {
7208   google_protobuf_ExtensionRangeOptions* ret = google_protobuf_ExtensionRangeOptions_new(arena);
7209   if (!ret) return NULL;
7210   if (upb_Decode(buf, size, UPB_UPCAST(ret), &google__protobuf__ExtensionRangeOptions_msg_init, extreg, options,
7211                  arena) != kUpb_DecodeStatus_Ok) {
7212     return NULL;
7213   }
7214   return ret;
7215 }
google_protobuf_ExtensionRangeOptions_serialize(const google_protobuf_ExtensionRangeOptions * msg,upb_Arena * arena,size_t * len)7216 UPB_INLINE char* google_protobuf_ExtensionRangeOptions_serialize(const google_protobuf_ExtensionRangeOptions* msg, upb_Arena* arena, size_t* len) {
7217   char* ptr;
7218   (void)upb_Encode(UPB_UPCAST(msg), &google__protobuf__ExtensionRangeOptions_msg_init, 0, arena, &ptr, len);
7219   return ptr;
7220 }
google_protobuf_ExtensionRangeOptions_serialize_ex(const google_protobuf_ExtensionRangeOptions * msg,int options,upb_Arena * arena,size_t * len)7221 UPB_INLINE char* google_protobuf_ExtensionRangeOptions_serialize_ex(const google_protobuf_ExtensionRangeOptions* msg, int options,
7222                                  upb_Arena* arena, size_t* len) {
7223   char* ptr;
7224   (void)upb_Encode(UPB_UPCAST(msg), &google__protobuf__ExtensionRangeOptions_msg_init, options, arena, &ptr, len);
7225   return ptr;
7226 }
google_protobuf_ExtensionRangeOptions_clear_declaration(google_protobuf_ExtensionRangeOptions * msg)7227 UPB_INLINE void google_protobuf_ExtensionRangeOptions_clear_declaration(google_protobuf_ExtensionRangeOptions* msg) {
7228   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)};
7229   upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
7230 }
google_protobuf_ExtensionRangeOptions_declaration(const google_protobuf_ExtensionRangeOptions * msg,size_t * size)7231 UPB_INLINE const google_protobuf_ExtensionRangeOptions_Declaration* const* google_protobuf_ExtensionRangeOptions_declaration(const google_protobuf_ExtensionRangeOptions* msg, size_t* size) {
7232   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)};
7233   UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__ExtensionRangeOptions__Declaration_msg_init);
7234   const upb_Array* arr = upb_Message_GetArray(UPB_UPCAST(msg), &field);
7235   if (arr) {
7236     if (size) *size = arr->UPB_PRIVATE(size);
7237     return (const google_protobuf_ExtensionRangeOptions_Declaration* const*)upb_Array_DataPtr(arr);
7238   } else {
7239     if (size) *size = 0;
7240     return NULL;
7241   }
7242 }
_google_protobuf_ExtensionRangeOptions_declaration_upb_array(const google_protobuf_ExtensionRangeOptions * msg,size_t * size)7243 UPB_INLINE const upb_Array* _google_protobuf_ExtensionRangeOptions_declaration_upb_array(const google_protobuf_ExtensionRangeOptions* msg, size_t* size) {
7244   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)};
7245   UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__ExtensionRangeOptions__Declaration_msg_init);
7246   const upb_Array* arr = upb_Message_GetArray(UPB_UPCAST(msg), &field);
7247   if (size) {
7248     *size = arr ? arr->UPB_PRIVATE(size) : 0;
7249   }
7250   return arr;
7251 }
_google_protobuf_ExtensionRangeOptions_declaration_mutable_upb_array(google_protobuf_ExtensionRangeOptions * msg,size_t * size,upb_Arena * arena)7252 UPB_INLINE upb_Array* _google_protobuf_ExtensionRangeOptions_declaration_mutable_upb_array(google_protobuf_ExtensionRangeOptions* msg, size_t* size, upb_Arena* arena) {
7253   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)};
7254   UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__ExtensionRangeOptions__Declaration_msg_init);
7255   upb_Array* arr = upb_Message_GetOrCreateMutableArray(UPB_UPCAST(msg),
7256                                                        &field, arena);
7257   if (size) {
7258     *size = arr ? arr->UPB_PRIVATE(size) : 0;
7259   }
7260   return arr;
7261 }
google_protobuf_ExtensionRangeOptions_clear_verification(google_protobuf_ExtensionRangeOptions * msg)7262 UPB_INLINE void google_protobuf_ExtensionRangeOptions_clear_verification(google_protobuf_ExtensionRangeOptions* msg) {
7263   const upb_MiniTableField field = {3, UPB_SIZE(16, 12), 64, 3, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
7264   upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
7265 }
google_protobuf_ExtensionRangeOptions_verification(const google_protobuf_ExtensionRangeOptions * msg)7266 UPB_INLINE int32_t google_protobuf_ExtensionRangeOptions_verification(const google_protobuf_ExtensionRangeOptions* msg) {
7267   int32_t default_val = 1;
7268   int32_t ret;
7269   const upb_MiniTableField field = {3, UPB_SIZE(16, 12), 64, 3, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
7270   _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field,
7271                                     &default_val, &ret);
7272   return ret;
7273 }
google_protobuf_ExtensionRangeOptions_has_verification(const google_protobuf_ExtensionRangeOptions * msg)7274 UPB_INLINE bool google_protobuf_ExtensionRangeOptions_has_verification(const google_protobuf_ExtensionRangeOptions* msg) {
7275   const upb_MiniTableField field = {3, UPB_SIZE(16, 12), 64, 3, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
7276   return upb_Message_HasBaseField(UPB_UPCAST(msg), &field);
7277 }
google_protobuf_ExtensionRangeOptions_clear_features(google_protobuf_ExtensionRangeOptions * msg)7278 UPB_INLINE void google_protobuf_ExtensionRangeOptions_clear_features(google_protobuf_ExtensionRangeOptions* msg) {
7279   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)};
7280   upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
7281 }
google_protobuf_ExtensionRangeOptions_features(const google_protobuf_ExtensionRangeOptions * msg)7282 UPB_INLINE const google_protobuf_FeatureSet* google_protobuf_ExtensionRangeOptions_features(const google_protobuf_ExtensionRangeOptions* msg) {
7283   const google_protobuf_FeatureSet* default_val = NULL;
7284   const google_protobuf_FeatureSet* ret;
7285   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)};
7286   UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__FeatureSet_msg_init);
7287   _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field,
7288                                     &default_val, &ret);
7289   return ret;
7290 }
google_protobuf_ExtensionRangeOptions_has_features(const google_protobuf_ExtensionRangeOptions * msg)7291 UPB_INLINE bool google_protobuf_ExtensionRangeOptions_has_features(const google_protobuf_ExtensionRangeOptions* msg) {
7292   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)};
7293   return upb_Message_HasBaseField(UPB_UPCAST(msg), &field);
7294 }
google_protobuf_ExtensionRangeOptions_clear_uninterpreted_option(google_protobuf_ExtensionRangeOptions * msg)7295 UPB_INLINE void google_protobuf_ExtensionRangeOptions_clear_uninterpreted_option(google_protobuf_ExtensionRangeOptions* msg) {
7296   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)};
7297   upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
7298 }
google_protobuf_ExtensionRangeOptions_uninterpreted_option(const google_protobuf_ExtensionRangeOptions * msg,size_t * size)7299 UPB_INLINE const google_protobuf_UninterpretedOption* const* google_protobuf_ExtensionRangeOptions_uninterpreted_option(const google_protobuf_ExtensionRangeOptions* msg, size_t* size) {
7300   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)};
7301   UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__UninterpretedOption_msg_init);
7302   const upb_Array* arr = upb_Message_GetArray(UPB_UPCAST(msg), &field);
7303   if (arr) {
7304     if (size) *size = arr->UPB_PRIVATE(size);
7305     return (const google_protobuf_UninterpretedOption* const*)upb_Array_DataPtr(arr);
7306   } else {
7307     if (size) *size = 0;
7308     return NULL;
7309   }
7310 }
_google_protobuf_ExtensionRangeOptions_uninterpreted_option_upb_array(const google_protobuf_ExtensionRangeOptions * msg,size_t * size)7311 UPB_INLINE const upb_Array* _google_protobuf_ExtensionRangeOptions_uninterpreted_option_upb_array(const google_protobuf_ExtensionRangeOptions* msg, size_t* size) {
7312   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)};
7313   UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__UninterpretedOption_msg_init);
7314   const upb_Array* arr = upb_Message_GetArray(UPB_UPCAST(msg), &field);
7315   if (size) {
7316     *size = arr ? arr->UPB_PRIVATE(size) : 0;
7317   }
7318   return arr;
7319 }
_google_protobuf_ExtensionRangeOptions_uninterpreted_option_mutable_upb_array(google_protobuf_ExtensionRangeOptions * msg,size_t * size,upb_Arena * arena)7320 UPB_INLINE upb_Array* _google_protobuf_ExtensionRangeOptions_uninterpreted_option_mutable_upb_array(google_protobuf_ExtensionRangeOptions* msg, size_t* size, upb_Arena* arena) {
7321   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)};
7322   UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__UninterpretedOption_msg_init);
7323   upb_Array* arr = upb_Message_GetOrCreateMutableArray(UPB_UPCAST(msg),
7324                                                        &field, arena);
7325   if (size) {
7326     *size = arr ? arr->UPB_PRIVATE(size) : 0;
7327   }
7328   return arr;
7329 }
7330 
google_protobuf_ExtensionRangeOptions_mutable_declaration(google_protobuf_ExtensionRangeOptions * msg,size_t * size)7331 UPB_INLINE google_protobuf_ExtensionRangeOptions_Declaration** google_protobuf_ExtensionRangeOptions_mutable_declaration(google_protobuf_ExtensionRangeOptions* msg, size_t* size) {
7332   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)};
7333   UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__ExtensionRangeOptions__Declaration_msg_init);
7334   upb_Array* arr = upb_Message_GetMutableArray(UPB_UPCAST(msg), &field);
7335   if (arr) {
7336     if (size) *size = arr->UPB_PRIVATE(size);
7337     return (google_protobuf_ExtensionRangeOptions_Declaration**)upb_Array_MutableDataPtr(arr);
7338   } else {
7339     if (size) *size = 0;
7340     return NULL;
7341   }
7342 }
google_protobuf_ExtensionRangeOptions_resize_declaration(google_protobuf_ExtensionRangeOptions * msg,size_t size,upb_Arena * arena)7343 UPB_INLINE google_protobuf_ExtensionRangeOptions_Declaration** google_protobuf_ExtensionRangeOptions_resize_declaration(google_protobuf_ExtensionRangeOptions* msg, size_t size, upb_Arena* arena) {
7344   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)};
7345   return (google_protobuf_ExtensionRangeOptions_Declaration**)upb_Message_ResizeArrayUninitialized(UPB_UPCAST(msg),
7346                                                    &field, size, arena);
7347 }
google_protobuf_ExtensionRangeOptions_add_declaration(google_protobuf_ExtensionRangeOptions * msg,upb_Arena * arena)7348 UPB_INLINE struct google_protobuf_ExtensionRangeOptions_Declaration* google_protobuf_ExtensionRangeOptions_add_declaration(google_protobuf_ExtensionRangeOptions* msg, upb_Arena* arena) {
7349   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)};
7350   UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__ExtensionRangeOptions__Declaration_msg_init);
7351   upb_Array* arr = upb_Message_GetOrCreateMutableArray(
7352       UPB_UPCAST(msg), &field, arena);
7353   if (!arr || !UPB_PRIVATE(_upb_Array_ResizeUninitialized)(
7354                   arr, arr->UPB_PRIVATE(size) + 1, arena)) {
7355     return NULL;
7356   }
7357   struct google_protobuf_ExtensionRangeOptions_Declaration* sub = (struct google_protobuf_ExtensionRangeOptions_Declaration*)_upb_Message_New(&google__protobuf__ExtensionRangeOptions__Declaration_msg_init, arena);
7358   if (!arr || !sub) return NULL;
7359   UPB_PRIVATE(_upb_Array_Set)
7360   (arr, arr->UPB_PRIVATE(size) - 1, &sub, sizeof(sub));
7361   return sub;
7362 }
google_protobuf_ExtensionRangeOptions_set_verification(google_protobuf_ExtensionRangeOptions * msg,int32_t value)7363 UPB_INLINE void google_protobuf_ExtensionRangeOptions_set_verification(google_protobuf_ExtensionRangeOptions *msg, int32_t value) {
7364   const upb_MiniTableField field = {3, UPB_SIZE(16, 12), 64, 3, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
7365   upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
7366 }
google_protobuf_ExtensionRangeOptions_set_features(google_protobuf_ExtensionRangeOptions * msg,google_protobuf_FeatureSet * value)7367 UPB_INLINE void google_protobuf_ExtensionRangeOptions_set_features(google_protobuf_ExtensionRangeOptions *msg, google_protobuf_FeatureSet* value) {
7368   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)};
7369   UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__FeatureSet_msg_init);
7370   upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
7371 }
google_protobuf_ExtensionRangeOptions_mutable_features(google_protobuf_ExtensionRangeOptions * msg,upb_Arena * arena)7372 UPB_INLINE struct google_protobuf_FeatureSet* google_protobuf_ExtensionRangeOptions_mutable_features(google_protobuf_ExtensionRangeOptions* msg, upb_Arena* arena) {
7373   struct google_protobuf_FeatureSet* sub = (struct google_protobuf_FeatureSet*)google_protobuf_ExtensionRangeOptions_features(msg);
7374   if (sub == NULL) {
7375     sub = (struct google_protobuf_FeatureSet*)_upb_Message_New(&google__protobuf__FeatureSet_msg_init, arena);
7376     if (sub) google_protobuf_ExtensionRangeOptions_set_features(msg, sub);
7377   }
7378   return sub;
7379 }
google_protobuf_ExtensionRangeOptions_mutable_uninterpreted_option(google_protobuf_ExtensionRangeOptions * msg,size_t * size)7380 UPB_INLINE google_protobuf_UninterpretedOption** google_protobuf_ExtensionRangeOptions_mutable_uninterpreted_option(google_protobuf_ExtensionRangeOptions* msg, size_t* size) {
7381   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)};
7382   UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__UninterpretedOption_msg_init);
7383   upb_Array* arr = upb_Message_GetMutableArray(UPB_UPCAST(msg), &field);
7384   if (arr) {
7385     if (size) *size = arr->UPB_PRIVATE(size);
7386     return (google_protobuf_UninterpretedOption**)upb_Array_MutableDataPtr(arr);
7387   } else {
7388     if (size) *size = 0;
7389     return NULL;
7390   }
7391 }
google_protobuf_ExtensionRangeOptions_resize_uninterpreted_option(google_protobuf_ExtensionRangeOptions * msg,size_t size,upb_Arena * arena)7392 UPB_INLINE google_protobuf_UninterpretedOption** google_protobuf_ExtensionRangeOptions_resize_uninterpreted_option(google_protobuf_ExtensionRangeOptions* msg, size_t size, upb_Arena* arena) {
7393   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)};
7394   return (google_protobuf_UninterpretedOption**)upb_Message_ResizeArrayUninitialized(UPB_UPCAST(msg),
7395                                                    &field, size, arena);
7396 }
google_protobuf_ExtensionRangeOptions_add_uninterpreted_option(google_protobuf_ExtensionRangeOptions * msg,upb_Arena * arena)7397 UPB_INLINE struct google_protobuf_UninterpretedOption* google_protobuf_ExtensionRangeOptions_add_uninterpreted_option(google_protobuf_ExtensionRangeOptions* msg, upb_Arena* arena) {
7398   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)};
7399   UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__UninterpretedOption_msg_init);
7400   upb_Array* arr = upb_Message_GetOrCreateMutableArray(
7401       UPB_UPCAST(msg), &field, arena);
7402   if (!arr || !UPB_PRIVATE(_upb_Array_ResizeUninitialized)(
7403                   arr, arr->UPB_PRIVATE(size) + 1, arena)) {
7404     return NULL;
7405   }
7406   struct google_protobuf_UninterpretedOption* sub = (struct google_protobuf_UninterpretedOption*)_upb_Message_New(&google__protobuf__UninterpretedOption_msg_init, arena);
7407   if (!arr || !sub) return NULL;
7408   UPB_PRIVATE(_upb_Array_Set)
7409   (arr, arr->UPB_PRIVATE(size) - 1, &sub, sizeof(sub));
7410   return sub;
7411 }
7412 
7413 /* google.protobuf.ExtensionRangeOptions.Declaration */
7414 
google_protobuf_ExtensionRangeOptions_Declaration_new(upb_Arena * arena)7415 UPB_INLINE google_protobuf_ExtensionRangeOptions_Declaration* google_protobuf_ExtensionRangeOptions_Declaration_new(upb_Arena* arena) {
7416   return (google_protobuf_ExtensionRangeOptions_Declaration*)_upb_Message_New(&google__protobuf__ExtensionRangeOptions__Declaration_msg_init, arena);
7417 }
google_protobuf_ExtensionRangeOptions_Declaration_parse(const char * buf,size_t size,upb_Arena * arena)7418 UPB_INLINE google_protobuf_ExtensionRangeOptions_Declaration* google_protobuf_ExtensionRangeOptions_Declaration_parse(const char* buf, size_t size, upb_Arena* arena) {
7419   google_protobuf_ExtensionRangeOptions_Declaration* ret = google_protobuf_ExtensionRangeOptions_Declaration_new(arena);
7420   if (!ret) return NULL;
7421   if (upb_Decode(buf, size, UPB_UPCAST(ret), &google__protobuf__ExtensionRangeOptions__Declaration_msg_init, NULL, 0, arena) !=
7422       kUpb_DecodeStatus_Ok) {
7423     return NULL;
7424   }
7425   return ret;
7426 }
google_protobuf_ExtensionRangeOptions_Declaration_parse_ex(const char * buf,size_t size,const upb_ExtensionRegistry * extreg,int options,upb_Arena * arena)7427 UPB_INLINE google_protobuf_ExtensionRangeOptions_Declaration* google_protobuf_ExtensionRangeOptions_Declaration_parse_ex(const char* buf, size_t size,
7428                            const upb_ExtensionRegistry* extreg,
7429                            int options, upb_Arena* arena) {
7430   google_protobuf_ExtensionRangeOptions_Declaration* ret = google_protobuf_ExtensionRangeOptions_Declaration_new(arena);
7431   if (!ret) return NULL;
7432   if (upb_Decode(buf, size, UPB_UPCAST(ret), &google__protobuf__ExtensionRangeOptions__Declaration_msg_init, extreg, options,
7433                  arena) != kUpb_DecodeStatus_Ok) {
7434     return NULL;
7435   }
7436   return ret;
7437 }
google_protobuf_ExtensionRangeOptions_Declaration_serialize(const google_protobuf_ExtensionRangeOptions_Declaration * msg,upb_Arena * arena,size_t * len)7438 UPB_INLINE char* google_protobuf_ExtensionRangeOptions_Declaration_serialize(const google_protobuf_ExtensionRangeOptions_Declaration* msg, upb_Arena* arena, size_t* len) {
7439   char* ptr;
7440   (void)upb_Encode(UPB_UPCAST(msg), &google__protobuf__ExtensionRangeOptions__Declaration_msg_init, 0, arena, &ptr, len);
7441   return ptr;
7442 }
google_protobuf_ExtensionRangeOptions_Declaration_serialize_ex(const google_protobuf_ExtensionRangeOptions_Declaration * msg,int options,upb_Arena * arena,size_t * len)7443 UPB_INLINE char* google_protobuf_ExtensionRangeOptions_Declaration_serialize_ex(const google_protobuf_ExtensionRangeOptions_Declaration* msg, int options,
7444                                  upb_Arena* arena, size_t* len) {
7445   char* ptr;
7446   (void)upb_Encode(UPB_UPCAST(msg), &google__protobuf__ExtensionRangeOptions__Declaration_msg_init, options, arena, &ptr, len);
7447   return ptr;
7448 }
google_protobuf_ExtensionRangeOptions_Declaration_clear_number(google_protobuf_ExtensionRangeOptions_Declaration * msg)7449 UPB_INLINE void google_protobuf_ExtensionRangeOptions_Declaration_clear_number(google_protobuf_ExtensionRangeOptions_Declaration* msg) {
7450   const upb_MiniTableField field = {1, 12, 64, kUpb_NoSub, 5, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
7451   upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
7452 }
google_protobuf_ExtensionRangeOptions_Declaration_number(const google_protobuf_ExtensionRangeOptions_Declaration * msg)7453 UPB_INLINE int32_t google_protobuf_ExtensionRangeOptions_Declaration_number(const google_protobuf_ExtensionRangeOptions_Declaration* msg) {
7454   int32_t default_val = (int32_t)0;
7455   int32_t ret;
7456   const upb_MiniTableField field = {1, 12, 64, kUpb_NoSub, 5, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
7457   _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field,
7458                                     &default_val, &ret);
7459   return ret;
7460 }
google_protobuf_ExtensionRangeOptions_Declaration_has_number(const google_protobuf_ExtensionRangeOptions_Declaration * msg)7461 UPB_INLINE bool google_protobuf_ExtensionRangeOptions_Declaration_has_number(const google_protobuf_ExtensionRangeOptions_Declaration* msg) {
7462   const upb_MiniTableField field = {1, 12, 64, kUpb_NoSub, 5, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
7463   return upb_Message_HasBaseField(UPB_UPCAST(msg), &field);
7464 }
google_protobuf_ExtensionRangeOptions_Declaration_clear_full_name(google_protobuf_ExtensionRangeOptions_Declaration * msg)7465 UPB_INLINE void google_protobuf_ExtensionRangeOptions_Declaration_clear_full_name(google_protobuf_ExtensionRangeOptions_Declaration* msg) {
7466   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)};
7467   upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
7468 }
google_protobuf_ExtensionRangeOptions_Declaration_full_name(const google_protobuf_ExtensionRangeOptions_Declaration * msg)7469 UPB_INLINE upb_StringView google_protobuf_ExtensionRangeOptions_Declaration_full_name(const google_protobuf_ExtensionRangeOptions_Declaration* msg) {
7470   upb_StringView default_val = upb_StringView_FromString("");
7471   upb_StringView ret;
7472   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)};
7473   _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field,
7474                                     &default_val, &ret);
7475   return ret;
7476 }
google_protobuf_ExtensionRangeOptions_Declaration_has_full_name(const google_protobuf_ExtensionRangeOptions_Declaration * msg)7477 UPB_INLINE bool google_protobuf_ExtensionRangeOptions_Declaration_has_full_name(const google_protobuf_ExtensionRangeOptions_Declaration* msg) {
7478   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)};
7479   return upb_Message_HasBaseField(UPB_UPCAST(msg), &field);
7480 }
google_protobuf_ExtensionRangeOptions_Declaration_clear_type(google_protobuf_ExtensionRangeOptions_Declaration * msg)7481 UPB_INLINE void google_protobuf_ExtensionRangeOptions_Declaration_clear_type(google_protobuf_ExtensionRangeOptions_Declaration* msg) {
7482   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)};
7483   upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
7484 }
google_protobuf_ExtensionRangeOptions_Declaration_type(const google_protobuf_ExtensionRangeOptions_Declaration * msg)7485 UPB_INLINE upb_StringView google_protobuf_ExtensionRangeOptions_Declaration_type(const google_protobuf_ExtensionRangeOptions_Declaration* msg) {
7486   upb_StringView default_val = upb_StringView_FromString("");
7487   upb_StringView ret;
7488   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)};
7489   _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field,
7490                                     &default_val, &ret);
7491   return ret;
7492 }
google_protobuf_ExtensionRangeOptions_Declaration_has_type(const google_protobuf_ExtensionRangeOptions_Declaration * msg)7493 UPB_INLINE bool google_protobuf_ExtensionRangeOptions_Declaration_has_type(const google_protobuf_ExtensionRangeOptions_Declaration* msg) {
7494   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)};
7495   return upb_Message_HasBaseField(UPB_UPCAST(msg), &field);
7496 }
google_protobuf_ExtensionRangeOptions_Declaration_clear_reserved(google_protobuf_ExtensionRangeOptions_Declaration * msg)7497 UPB_INLINE void google_protobuf_ExtensionRangeOptions_Declaration_clear_reserved(google_protobuf_ExtensionRangeOptions_Declaration* msg) {
7498   const upb_MiniTableField field = {5, 16, 67, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
7499   upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
7500 }
google_protobuf_ExtensionRangeOptions_Declaration_reserved(const google_protobuf_ExtensionRangeOptions_Declaration * msg)7501 UPB_INLINE bool google_protobuf_ExtensionRangeOptions_Declaration_reserved(const google_protobuf_ExtensionRangeOptions_Declaration* msg) {
7502   bool default_val = false;
7503   bool ret;
7504   const upb_MiniTableField field = {5, 16, 67, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
7505   _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field,
7506                                     &default_val, &ret);
7507   return ret;
7508 }
google_protobuf_ExtensionRangeOptions_Declaration_has_reserved(const google_protobuf_ExtensionRangeOptions_Declaration * msg)7509 UPB_INLINE bool google_protobuf_ExtensionRangeOptions_Declaration_has_reserved(const google_protobuf_ExtensionRangeOptions_Declaration* msg) {
7510   const upb_MiniTableField field = {5, 16, 67, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
7511   return upb_Message_HasBaseField(UPB_UPCAST(msg), &field);
7512 }
google_protobuf_ExtensionRangeOptions_Declaration_clear_repeated(google_protobuf_ExtensionRangeOptions_Declaration * msg)7513 UPB_INLINE void google_protobuf_ExtensionRangeOptions_Declaration_clear_repeated(google_protobuf_ExtensionRangeOptions_Declaration* msg) {
7514   const upb_MiniTableField field = {6, 17, 68, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
7515   upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
7516 }
google_protobuf_ExtensionRangeOptions_Declaration_repeated(const google_protobuf_ExtensionRangeOptions_Declaration * msg)7517 UPB_INLINE bool google_protobuf_ExtensionRangeOptions_Declaration_repeated(const google_protobuf_ExtensionRangeOptions_Declaration* msg) {
7518   bool default_val = false;
7519   bool ret;
7520   const upb_MiniTableField field = {6, 17, 68, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
7521   _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field,
7522                                     &default_val, &ret);
7523   return ret;
7524 }
google_protobuf_ExtensionRangeOptions_Declaration_has_repeated(const google_protobuf_ExtensionRangeOptions_Declaration * msg)7525 UPB_INLINE bool google_protobuf_ExtensionRangeOptions_Declaration_has_repeated(const google_protobuf_ExtensionRangeOptions_Declaration* msg) {
7526   const upb_MiniTableField field = {6, 17, 68, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
7527   return upb_Message_HasBaseField(UPB_UPCAST(msg), &field);
7528 }
7529 
google_protobuf_ExtensionRangeOptions_Declaration_set_number(google_protobuf_ExtensionRangeOptions_Declaration * msg,int32_t value)7530 UPB_INLINE void google_protobuf_ExtensionRangeOptions_Declaration_set_number(google_protobuf_ExtensionRangeOptions_Declaration *msg, int32_t value) {
7531   const upb_MiniTableField field = {1, 12, 64, kUpb_NoSub, 5, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
7532   upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
7533 }
google_protobuf_ExtensionRangeOptions_Declaration_set_full_name(google_protobuf_ExtensionRangeOptions_Declaration * msg,upb_StringView value)7534 UPB_INLINE void google_protobuf_ExtensionRangeOptions_Declaration_set_full_name(google_protobuf_ExtensionRangeOptions_Declaration *msg, upb_StringView value) {
7535   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)};
7536   upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
7537 }
google_protobuf_ExtensionRangeOptions_Declaration_set_type(google_protobuf_ExtensionRangeOptions_Declaration * msg,upb_StringView value)7538 UPB_INLINE void google_protobuf_ExtensionRangeOptions_Declaration_set_type(google_protobuf_ExtensionRangeOptions_Declaration *msg, upb_StringView value) {
7539   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)};
7540   upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
7541 }
google_protobuf_ExtensionRangeOptions_Declaration_set_reserved(google_protobuf_ExtensionRangeOptions_Declaration * msg,bool value)7542 UPB_INLINE void google_protobuf_ExtensionRangeOptions_Declaration_set_reserved(google_protobuf_ExtensionRangeOptions_Declaration *msg, bool value) {
7543   const upb_MiniTableField field = {5, 16, 67, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
7544   upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
7545 }
google_protobuf_ExtensionRangeOptions_Declaration_set_repeated(google_protobuf_ExtensionRangeOptions_Declaration * msg,bool value)7546 UPB_INLINE void google_protobuf_ExtensionRangeOptions_Declaration_set_repeated(google_protobuf_ExtensionRangeOptions_Declaration *msg, bool value) {
7547   const upb_MiniTableField field = {6, 17, 68, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
7548   upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
7549 }
7550 
7551 /* google.protobuf.FieldDescriptorProto */
7552 
google_protobuf_FieldDescriptorProto_new(upb_Arena * arena)7553 UPB_INLINE google_protobuf_FieldDescriptorProto* google_protobuf_FieldDescriptorProto_new(upb_Arena* arena) {
7554   return (google_protobuf_FieldDescriptorProto*)_upb_Message_New(&google__protobuf__FieldDescriptorProto_msg_init, arena);
7555 }
google_protobuf_FieldDescriptorProto_parse(const char * buf,size_t size,upb_Arena * arena)7556 UPB_INLINE google_protobuf_FieldDescriptorProto* google_protobuf_FieldDescriptorProto_parse(const char* buf, size_t size, upb_Arena* arena) {
7557   google_protobuf_FieldDescriptorProto* ret = google_protobuf_FieldDescriptorProto_new(arena);
7558   if (!ret) return NULL;
7559   if (upb_Decode(buf, size, UPB_UPCAST(ret), &google__protobuf__FieldDescriptorProto_msg_init, NULL, 0, arena) !=
7560       kUpb_DecodeStatus_Ok) {
7561     return NULL;
7562   }
7563   return ret;
7564 }
google_protobuf_FieldDescriptorProto_parse_ex(const char * buf,size_t size,const upb_ExtensionRegistry * extreg,int options,upb_Arena * arena)7565 UPB_INLINE google_protobuf_FieldDescriptorProto* google_protobuf_FieldDescriptorProto_parse_ex(const char* buf, size_t size,
7566                            const upb_ExtensionRegistry* extreg,
7567                            int options, upb_Arena* arena) {
7568   google_protobuf_FieldDescriptorProto* ret = google_protobuf_FieldDescriptorProto_new(arena);
7569   if (!ret) return NULL;
7570   if (upb_Decode(buf, size, UPB_UPCAST(ret), &google__protobuf__FieldDescriptorProto_msg_init, extreg, options,
7571                  arena) != kUpb_DecodeStatus_Ok) {
7572     return NULL;
7573   }
7574   return ret;
7575 }
google_protobuf_FieldDescriptorProto_serialize(const google_protobuf_FieldDescriptorProto * msg,upb_Arena * arena,size_t * len)7576 UPB_INLINE char* google_protobuf_FieldDescriptorProto_serialize(const google_protobuf_FieldDescriptorProto* msg, upb_Arena* arena, size_t* len) {
7577   char* ptr;
7578   (void)upb_Encode(UPB_UPCAST(msg), &google__protobuf__FieldDescriptorProto_msg_init, 0, arena, &ptr, len);
7579   return ptr;
7580 }
google_protobuf_FieldDescriptorProto_serialize_ex(const google_protobuf_FieldDescriptorProto * msg,int options,upb_Arena * arena,size_t * len)7581 UPB_INLINE char* google_protobuf_FieldDescriptorProto_serialize_ex(const google_protobuf_FieldDescriptorProto* msg, int options,
7582                                  upb_Arena* arena, size_t* len) {
7583   char* ptr;
7584   (void)upb_Encode(UPB_UPCAST(msg), &google__protobuf__FieldDescriptorProto_msg_init, options, arena, &ptr, len);
7585   return ptr;
7586 }
google_protobuf_FieldDescriptorProto_clear_name(google_protobuf_FieldDescriptorProto * msg)7587 UPB_INLINE void google_protobuf_FieldDescriptorProto_clear_name(google_protobuf_FieldDescriptorProto* msg) {
7588   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)};
7589   upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
7590 }
google_protobuf_FieldDescriptorProto_name(const google_protobuf_FieldDescriptorProto * msg)7591 UPB_INLINE upb_StringView google_protobuf_FieldDescriptorProto_name(const google_protobuf_FieldDescriptorProto* msg) {
7592   upb_StringView default_val = upb_StringView_FromString("");
7593   upb_StringView ret;
7594   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)};
7595   _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field,
7596                                     &default_val, &ret);
7597   return ret;
7598 }
google_protobuf_FieldDescriptorProto_has_name(const google_protobuf_FieldDescriptorProto * msg)7599 UPB_INLINE bool google_protobuf_FieldDescriptorProto_has_name(const google_protobuf_FieldDescriptorProto* msg) {
7600   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)};
7601   return upb_Message_HasBaseField(UPB_UPCAST(msg), &field);
7602 }
google_protobuf_FieldDescriptorProto_clear_extendee(google_protobuf_FieldDescriptorProto * msg)7603 UPB_INLINE void google_protobuf_FieldDescriptorProto_clear_extendee(google_protobuf_FieldDescriptorProto* msg) {
7604   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)};
7605   upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
7606 }
google_protobuf_FieldDescriptorProto_extendee(const google_protobuf_FieldDescriptorProto * msg)7607 UPB_INLINE upb_StringView google_protobuf_FieldDescriptorProto_extendee(const google_protobuf_FieldDescriptorProto* msg) {
7608   upb_StringView default_val = upb_StringView_FromString("");
7609   upb_StringView ret;
7610   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)};
7611   _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field,
7612                                     &default_val, &ret);
7613   return ret;
7614 }
google_protobuf_FieldDescriptorProto_has_extendee(const google_protobuf_FieldDescriptorProto * msg)7615 UPB_INLINE bool google_protobuf_FieldDescriptorProto_has_extendee(const google_protobuf_FieldDescriptorProto* msg) {
7616   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)};
7617   return upb_Message_HasBaseField(UPB_UPCAST(msg), &field);
7618 }
google_protobuf_FieldDescriptorProto_clear_number(google_protobuf_FieldDescriptorProto * msg)7619 UPB_INLINE void google_protobuf_FieldDescriptorProto_clear_number(google_protobuf_FieldDescriptorProto* msg) {
7620   const upb_MiniTableField field = {3, 12, 66, kUpb_NoSub, 5, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
7621   upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
7622 }
google_protobuf_FieldDescriptorProto_number(const google_protobuf_FieldDescriptorProto * msg)7623 UPB_INLINE int32_t google_protobuf_FieldDescriptorProto_number(const google_protobuf_FieldDescriptorProto* msg) {
7624   int32_t default_val = (int32_t)0;
7625   int32_t ret;
7626   const upb_MiniTableField field = {3, 12, 66, kUpb_NoSub, 5, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
7627   _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field,
7628                                     &default_val, &ret);
7629   return ret;
7630 }
google_protobuf_FieldDescriptorProto_has_number(const google_protobuf_FieldDescriptorProto * msg)7631 UPB_INLINE bool google_protobuf_FieldDescriptorProto_has_number(const google_protobuf_FieldDescriptorProto* msg) {
7632   const upb_MiniTableField field = {3, 12, 66, kUpb_NoSub, 5, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
7633   return upb_Message_HasBaseField(UPB_UPCAST(msg), &field);
7634 }
google_protobuf_FieldDescriptorProto_clear_label(google_protobuf_FieldDescriptorProto * msg)7635 UPB_INLINE void google_protobuf_FieldDescriptorProto_clear_label(google_protobuf_FieldDescriptorProto* msg) {
7636   const upb_MiniTableField field = {4, 16, 67, 1, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
7637   upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
7638 }
google_protobuf_FieldDescriptorProto_label(const google_protobuf_FieldDescriptorProto * msg)7639 UPB_INLINE int32_t google_protobuf_FieldDescriptorProto_label(const google_protobuf_FieldDescriptorProto* msg) {
7640   int32_t default_val = 1;
7641   int32_t ret;
7642   const upb_MiniTableField field = {4, 16, 67, 1, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
7643   _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field,
7644                                     &default_val, &ret);
7645   return ret;
7646 }
google_protobuf_FieldDescriptorProto_has_label(const google_protobuf_FieldDescriptorProto * msg)7647 UPB_INLINE bool google_protobuf_FieldDescriptorProto_has_label(const google_protobuf_FieldDescriptorProto* msg) {
7648   const upb_MiniTableField field = {4, 16, 67, 1, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
7649   return upb_Message_HasBaseField(UPB_UPCAST(msg), &field);
7650 }
google_protobuf_FieldDescriptorProto_clear_type(google_protobuf_FieldDescriptorProto * msg)7651 UPB_INLINE void google_protobuf_FieldDescriptorProto_clear_type(google_protobuf_FieldDescriptorProto* msg) {
7652   const upb_MiniTableField field = {5, 20, 68, 2, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
7653   upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
7654 }
google_protobuf_FieldDescriptorProto_type(const google_protobuf_FieldDescriptorProto * msg)7655 UPB_INLINE int32_t google_protobuf_FieldDescriptorProto_type(const google_protobuf_FieldDescriptorProto* msg) {
7656   int32_t default_val = 1;
7657   int32_t ret;
7658   const upb_MiniTableField field = {5, 20, 68, 2, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
7659   _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field,
7660                                     &default_val, &ret);
7661   return ret;
7662 }
google_protobuf_FieldDescriptorProto_has_type(const google_protobuf_FieldDescriptorProto * msg)7663 UPB_INLINE bool google_protobuf_FieldDescriptorProto_has_type(const google_protobuf_FieldDescriptorProto* msg) {
7664   const upb_MiniTableField field = {5, 20, 68, 2, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
7665   return upb_Message_HasBaseField(UPB_UPCAST(msg), &field);
7666 }
google_protobuf_FieldDescriptorProto_clear_type_name(google_protobuf_FieldDescriptorProto * msg)7667 UPB_INLINE void google_protobuf_FieldDescriptorProto_clear_type_name(google_protobuf_FieldDescriptorProto* msg) {
7668   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)};
7669   upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
7670 }
google_protobuf_FieldDescriptorProto_type_name(const google_protobuf_FieldDescriptorProto * msg)7671 UPB_INLINE upb_StringView google_protobuf_FieldDescriptorProto_type_name(const google_protobuf_FieldDescriptorProto* msg) {
7672   upb_StringView default_val = upb_StringView_FromString("");
7673   upb_StringView ret;
7674   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)};
7675   _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field,
7676                                     &default_val, &ret);
7677   return ret;
7678 }
google_protobuf_FieldDescriptorProto_has_type_name(const google_protobuf_FieldDescriptorProto * msg)7679 UPB_INLINE bool google_protobuf_FieldDescriptorProto_has_type_name(const google_protobuf_FieldDescriptorProto* msg) {
7680   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)};
7681   return upb_Message_HasBaseField(UPB_UPCAST(msg), &field);
7682 }
google_protobuf_FieldDescriptorProto_clear_default_value(google_protobuf_FieldDescriptorProto * msg)7683 UPB_INLINE void google_protobuf_FieldDescriptorProto_clear_default_value(google_protobuf_FieldDescriptorProto* msg) {
7684   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)};
7685   upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
7686 }
google_protobuf_FieldDescriptorProto_default_value(const google_protobuf_FieldDescriptorProto * msg)7687 UPB_INLINE upb_StringView google_protobuf_FieldDescriptorProto_default_value(const google_protobuf_FieldDescriptorProto* msg) {
7688   upb_StringView default_val = upb_StringView_FromString("");
7689   upb_StringView ret;
7690   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)};
7691   _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field,
7692                                     &default_val, &ret);
7693   return ret;
7694 }
google_protobuf_FieldDescriptorProto_has_default_value(const google_protobuf_FieldDescriptorProto * msg)7695 UPB_INLINE bool google_protobuf_FieldDescriptorProto_has_default_value(const google_protobuf_FieldDescriptorProto* msg) {
7696   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)};
7697   return upb_Message_HasBaseField(UPB_UPCAST(msg), &field);
7698 }
google_protobuf_FieldDescriptorProto_clear_options(google_protobuf_FieldDescriptorProto * msg)7699 UPB_INLINE void google_protobuf_FieldDescriptorProto_clear_options(google_protobuf_FieldDescriptorProto* msg) {
7700   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)};
7701   upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
7702 }
google_protobuf_FieldDescriptorProto_options(const google_protobuf_FieldDescriptorProto * msg)7703 UPB_INLINE const google_protobuf_FieldOptions* google_protobuf_FieldDescriptorProto_options(const google_protobuf_FieldDescriptorProto* msg) {
7704   const google_protobuf_FieldOptions* default_val = NULL;
7705   const google_protobuf_FieldOptions* ret;
7706   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)};
7707   UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__FieldOptions_msg_init);
7708   _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field,
7709                                     &default_val, &ret);
7710   return ret;
7711 }
google_protobuf_FieldDescriptorProto_has_options(const google_protobuf_FieldDescriptorProto * msg)7712 UPB_INLINE bool google_protobuf_FieldDescriptorProto_has_options(const google_protobuf_FieldDescriptorProto* msg) {
7713   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)};
7714   return upb_Message_HasBaseField(UPB_UPCAST(msg), &field);
7715 }
google_protobuf_FieldDescriptorProto_clear_oneof_index(google_protobuf_FieldDescriptorProto * msg)7716 UPB_INLINE void google_protobuf_FieldDescriptorProto_clear_oneof_index(google_protobuf_FieldDescriptorProto* msg) {
7717   const upb_MiniTableField field = {9, UPB_SIZE(28, 24), 72, kUpb_NoSub, 5, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
7718   upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
7719 }
google_protobuf_FieldDescriptorProto_oneof_index(const google_protobuf_FieldDescriptorProto * msg)7720 UPB_INLINE int32_t google_protobuf_FieldDescriptorProto_oneof_index(const google_protobuf_FieldDescriptorProto* msg) {
7721   int32_t default_val = (int32_t)0;
7722   int32_t ret;
7723   const upb_MiniTableField field = {9, UPB_SIZE(28, 24), 72, kUpb_NoSub, 5, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
7724   _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field,
7725                                     &default_val, &ret);
7726   return ret;
7727 }
google_protobuf_FieldDescriptorProto_has_oneof_index(const google_protobuf_FieldDescriptorProto * msg)7728 UPB_INLINE bool google_protobuf_FieldDescriptorProto_has_oneof_index(const google_protobuf_FieldDescriptorProto* msg) {
7729   const upb_MiniTableField field = {9, UPB_SIZE(28, 24), 72, kUpb_NoSub, 5, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
7730   return upb_Message_HasBaseField(UPB_UPCAST(msg), &field);
7731 }
google_protobuf_FieldDescriptorProto_clear_json_name(google_protobuf_FieldDescriptorProto * msg)7732 UPB_INLINE void google_protobuf_FieldDescriptorProto_clear_json_name(google_protobuf_FieldDescriptorProto* msg) {
7733   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)};
7734   upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
7735 }
google_protobuf_FieldDescriptorProto_json_name(const google_protobuf_FieldDescriptorProto * msg)7736 UPB_INLINE upb_StringView google_protobuf_FieldDescriptorProto_json_name(const google_protobuf_FieldDescriptorProto* msg) {
7737   upb_StringView default_val = upb_StringView_FromString("");
7738   upb_StringView ret;
7739   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)};
7740   _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field,
7741                                     &default_val, &ret);
7742   return ret;
7743 }
google_protobuf_FieldDescriptorProto_has_json_name(const google_protobuf_FieldDescriptorProto * msg)7744 UPB_INLINE bool google_protobuf_FieldDescriptorProto_has_json_name(const google_protobuf_FieldDescriptorProto* msg) {
7745   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)};
7746   return upb_Message_HasBaseField(UPB_UPCAST(msg), &field);
7747 }
google_protobuf_FieldDescriptorProto_clear_proto3_optional(google_protobuf_FieldDescriptorProto * msg)7748 UPB_INLINE void google_protobuf_FieldDescriptorProto_clear_proto3_optional(google_protobuf_FieldDescriptorProto* msg) {
7749   const upb_MiniTableField field = {17, UPB_SIZE(32, 28), 74, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
7750   upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
7751 }
google_protobuf_FieldDescriptorProto_proto3_optional(const google_protobuf_FieldDescriptorProto * msg)7752 UPB_INLINE bool google_protobuf_FieldDescriptorProto_proto3_optional(const google_protobuf_FieldDescriptorProto* msg) {
7753   bool default_val = false;
7754   bool ret;
7755   const upb_MiniTableField field = {17, UPB_SIZE(32, 28), 74, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
7756   _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field,
7757                                     &default_val, &ret);
7758   return ret;
7759 }
google_protobuf_FieldDescriptorProto_has_proto3_optional(const google_protobuf_FieldDescriptorProto * msg)7760 UPB_INLINE bool google_protobuf_FieldDescriptorProto_has_proto3_optional(const google_protobuf_FieldDescriptorProto* msg) {
7761   const upb_MiniTableField field = {17, UPB_SIZE(32, 28), 74, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
7762   return upb_Message_HasBaseField(UPB_UPCAST(msg), &field);
7763 }
7764 
google_protobuf_FieldDescriptorProto_set_name(google_protobuf_FieldDescriptorProto * msg,upb_StringView value)7765 UPB_INLINE void google_protobuf_FieldDescriptorProto_set_name(google_protobuf_FieldDescriptorProto *msg, upb_StringView value) {
7766   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)};
7767   upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
7768 }
google_protobuf_FieldDescriptorProto_set_extendee(google_protobuf_FieldDescriptorProto * msg,upb_StringView value)7769 UPB_INLINE void google_protobuf_FieldDescriptorProto_set_extendee(google_protobuf_FieldDescriptorProto *msg, upb_StringView value) {
7770   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)};
7771   upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
7772 }
google_protobuf_FieldDescriptorProto_set_number(google_protobuf_FieldDescriptorProto * msg,int32_t value)7773 UPB_INLINE void google_protobuf_FieldDescriptorProto_set_number(google_protobuf_FieldDescriptorProto *msg, int32_t value) {
7774   const upb_MiniTableField field = {3, 12, 66, kUpb_NoSub, 5, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
7775   upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
7776 }
google_protobuf_FieldDescriptorProto_set_label(google_protobuf_FieldDescriptorProto * msg,int32_t value)7777 UPB_INLINE void google_protobuf_FieldDescriptorProto_set_label(google_protobuf_FieldDescriptorProto *msg, int32_t value) {
7778   const upb_MiniTableField field = {4, 16, 67, 1, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
7779   upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
7780 }
google_protobuf_FieldDescriptorProto_set_type(google_protobuf_FieldDescriptorProto * msg,int32_t value)7781 UPB_INLINE void google_protobuf_FieldDescriptorProto_set_type(google_protobuf_FieldDescriptorProto *msg, int32_t value) {
7782   const upb_MiniTableField field = {5, 20, 68, 2, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
7783   upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
7784 }
google_protobuf_FieldDescriptorProto_set_type_name(google_protobuf_FieldDescriptorProto * msg,upb_StringView value)7785 UPB_INLINE void google_protobuf_FieldDescriptorProto_set_type_name(google_protobuf_FieldDescriptorProto *msg, upb_StringView value) {
7786   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)};
7787   upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
7788 }
google_protobuf_FieldDescriptorProto_set_default_value(google_protobuf_FieldDescriptorProto * msg,upb_StringView value)7789 UPB_INLINE void google_protobuf_FieldDescriptorProto_set_default_value(google_protobuf_FieldDescriptorProto *msg, upb_StringView value) {
7790   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)};
7791   upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
7792 }
google_protobuf_FieldDescriptorProto_set_options(google_protobuf_FieldDescriptorProto * msg,google_protobuf_FieldOptions * value)7793 UPB_INLINE void google_protobuf_FieldDescriptorProto_set_options(google_protobuf_FieldDescriptorProto *msg, google_protobuf_FieldOptions* value) {
7794   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)};
7795   UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__FieldOptions_msg_init);
7796   upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
7797 }
google_protobuf_FieldDescriptorProto_mutable_options(google_protobuf_FieldDescriptorProto * msg,upb_Arena * arena)7798 UPB_INLINE struct google_protobuf_FieldOptions* google_protobuf_FieldDescriptorProto_mutable_options(google_protobuf_FieldDescriptorProto* msg, upb_Arena* arena) {
7799   struct google_protobuf_FieldOptions* sub = (struct google_protobuf_FieldOptions*)google_protobuf_FieldDescriptorProto_options(msg);
7800   if (sub == NULL) {
7801     sub = (struct google_protobuf_FieldOptions*)_upb_Message_New(&google__protobuf__FieldOptions_msg_init, arena);
7802     if (sub) google_protobuf_FieldDescriptorProto_set_options(msg, sub);
7803   }
7804   return sub;
7805 }
google_protobuf_FieldDescriptorProto_set_oneof_index(google_protobuf_FieldDescriptorProto * msg,int32_t value)7806 UPB_INLINE void google_protobuf_FieldDescriptorProto_set_oneof_index(google_protobuf_FieldDescriptorProto *msg, int32_t value) {
7807   const upb_MiniTableField field = {9, UPB_SIZE(28, 24), 72, kUpb_NoSub, 5, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
7808   upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
7809 }
google_protobuf_FieldDescriptorProto_set_json_name(google_protobuf_FieldDescriptorProto * msg,upb_StringView value)7810 UPB_INLINE void google_protobuf_FieldDescriptorProto_set_json_name(google_protobuf_FieldDescriptorProto *msg, upb_StringView value) {
7811   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)};
7812   upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
7813 }
google_protobuf_FieldDescriptorProto_set_proto3_optional(google_protobuf_FieldDescriptorProto * msg,bool value)7814 UPB_INLINE void google_protobuf_FieldDescriptorProto_set_proto3_optional(google_protobuf_FieldDescriptorProto *msg, bool value) {
7815   const upb_MiniTableField field = {17, UPB_SIZE(32, 28), 74, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
7816   upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
7817 }
7818 
7819 /* google.protobuf.OneofDescriptorProto */
7820 
google_protobuf_OneofDescriptorProto_new(upb_Arena * arena)7821 UPB_INLINE google_protobuf_OneofDescriptorProto* google_protobuf_OneofDescriptorProto_new(upb_Arena* arena) {
7822   return (google_protobuf_OneofDescriptorProto*)_upb_Message_New(&google__protobuf__OneofDescriptorProto_msg_init, arena);
7823 }
google_protobuf_OneofDescriptorProto_parse(const char * buf,size_t size,upb_Arena * arena)7824 UPB_INLINE google_protobuf_OneofDescriptorProto* google_protobuf_OneofDescriptorProto_parse(const char* buf, size_t size, upb_Arena* arena) {
7825   google_protobuf_OneofDescriptorProto* ret = google_protobuf_OneofDescriptorProto_new(arena);
7826   if (!ret) return NULL;
7827   if (upb_Decode(buf, size, UPB_UPCAST(ret), &google__protobuf__OneofDescriptorProto_msg_init, NULL, 0, arena) !=
7828       kUpb_DecodeStatus_Ok) {
7829     return NULL;
7830   }
7831   return ret;
7832 }
google_protobuf_OneofDescriptorProto_parse_ex(const char * buf,size_t size,const upb_ExtensionRegistry * extreg,int options,upb_Arena * arena)7833 UPB_INLINE google_protobuf_OneofDescriptorProto* google_protobuf_OneofDescriptorProto_parse_ex(const char* buf, size_t size,
7834                            const upb_ExtensionRegistry* extreg,
7835                            int options, upb_Arena* arena) {
7836   google_protobuf_OneofDescriptorProto* ret = google_protobuf_OneofDescriptorProto_new(arena);
7837   if (!ret) return NULL;
7838   if (upb_Decode(buf, size, UPB_UPCAST(ret), &google__protobuf__OneofDescriptorProto_msg_init, extreg, options,
7839                  arena) != kUpb_DecodeStatus_Ok) {
7840     return NULL;
7841   }
7842   return ret;
7843 }
google_protobuf_OneofDescriptorProto_serialize(const google_protobuf_OneofDescriptorProto * msg,upb_Arena * arena,size_t * len)7844 UPB_INLINE char* google_protobuf_OneofDescriptorProto_serialize(const google_protobuf_OneofDescriptorProto* msg, upb_Arena* arena, size_t* len) {
7845   char* ptr;
7846   (void)upb_Encode(UPB_UPCAST(msg), &google__protobuf__OneofDescriptorProto_msg_init, 0, arena, &ptr, len);
7847   return ptr;
7848 }
google_protobuf_OneofDescriptorProto_serialize_ex(const google_protobuf_OneofDescriptorProto * msg,int options,upb_Arena * arena,size_t * len)7849 UPB_INLINE char* google_protobuf_OneofDescriptorProto_serialize_ex(const google_protobuf_OneofDescriptorProto* msg, int options,
7850                                  upb_Arena* arena, size_t* len) {
7851   char* ptr;
7852   (void)upb_Encode(UPB_UPCAST(msg), &google__protobuf__OneofDescriptorProto_msg_init, options, arena, &ptr, len);
7853   return ptr;
7854 }
google_protobuf_OneofDescriptorProto_clear_name(google_protobuf_OneofDescriptorProto * msg)7855 UPB_INLINE void google_protobuf_OneofDescriptorProto_clear_name(google_protobuf_OneofDescriptorProto* msg) {
7856   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)};
7857   upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
7858 }
google_protobuf_OneofDescriptorProto_name(const google_protobuf_OneofDescriptorProto * msg)7859 UPB_INLINE upb_StringView google_protobuf_OneofDescriptorProto_name(const google_protobuf_OneofDescriptorProto* msg) {
7860   upb_StringView default_val = upb_StringView_FromString("");
7861   upb_StringView ret;
7862   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)};
7863   _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field,
7864                                     &default_val, &ret);
7865   return ret;
7866 }
google_protobuf_OneofDescriptorProto_has_name(const google_protobuf_OneofDescriptorProto * msg)7867 UPB_INLINE bool google_protobuf_OneofDescriptorProto_has_name(const google_protobuf_OneofDescriptorProto* msg) {
7868   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)};
7869   return upb_Message_HasBaseField(UPB_UPCAST(msg), &field);
7870 }
google_protobuf_OneofDescriptorProto_clear_options(google_protobuf_OneofDescriptorProto * msg)7871 UPB_INLINE void google_protobuf_OneofDescriptorProto_clear_options(google_protobuf_OneofDescriptorProto* msg) {
7872   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)};
7873   upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
7874 }
google_protobuf_OneofDescriptorProto_options(const google_protobuf_OneofDescriptorProto * msg)7875 UPB_INLINE const google_protobuf_OneofOptions* google_protobuf_OneofDescriptorProto_options(const google_protobuf_OneofDescriptorProto* msg) {
7876   const google_protobuf_OneofOptions* default_val = NULL;
7877   const google_protobuf_OneofOptions* ret;
7878   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)};
7879   UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__OneofOptions_msg_init);
7880   _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field,
7881                                     &default_val, &ret);
7882   return ret;
7883 }
google_protobuf_OneofDescriptorProto_has_options(const google_protobuf_OneofDescriptorProto * msg)7884 UPB_INLINE bool google_protobuf_OneofDescriptorProto_has_options(const google_protobuf_OneofDescriptorProto* msg) {
7885   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)};
7886   return upb_Message_HasBaseField(UPB_UPCAST(msg), &field);
7887 }
7888 
google_protobuf_OneofDescriptorProto_set_name(google_protobuf_OneofDescriptorProto * msg,upb_StringView value)7889 UPB_INLINE void google_protobuf_OneofDescriptorProto_set_name(google_protobuf_OneofDescriptorProto *msg, upb_StringView value) {
7890   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)};
7891   upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
7892 }
google_protobuf_OneofDescriptorProto_set_options(google_protobuf_OneofDescriptorProto * msg,google_protobuf_OneofOptions * value)7893 UPB_INLINE void google_protobuf_OneofDescriptorProto_set_options(google_protobuf_OneofDescriptorProto *msg, google_protobuf_OneofOptions* value) {
7894   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)};
7895   UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__OneofOptions_msg_init);
7896   upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
7897 }
google_protobuf_OneofDescriptorProto_mutable_options(google_protobuf_OneofDescriptorProto * msg,upb_Arena * arena)7898 UPB_INLINE struct google_protobuf_OneofOptions* google_protobuf_OneofDescriptorProto_mutable_options(google_protobuf_OneofDescriptorProto* msg, upb_Arena* arena) {
7899   struct google_protobuf_OneofOptions* sub = (struct google_protobuf_OneofOptions*)google_protobuf_OneofDescriptorProto_options(msg);
7900   if (sub == NULL) {
7901     sub = (struct google_protobuf_OneofOptions*)_upb_Message_New(&google__protobuf__OneofOptions_msg_init, arena);
7902     if (sub) google_protobuf_OneofDescriptorProto_set_options(msg, sub);
7903   }
7904   return sub;
7905 }
7906 
7907 /* google.protobuf.EnumDescriptorProto */
7908 
google_protobuf_EnumDescriptorProto_new(upb_Arena * arena)7909 UPB_INLINE google_protobuf_EnumDescriptorProto* google_protobuf_EnumDescriptorProto_new(upb_Arena* arena) {
7910   return (google_protobuf_EnumDescriptorProto*)_upb_Message_New(&google__protobuf__EnumDescriptorProto_msg_init, arena);
7911 }
google_protobuf_EnumDescriptorProto_parse(const char * buf,size_t size,upb_Arena * arena)7912 UPB_INLINE google_protobuf_EnumDescriptorProto* google_protobuf_EnumDescriptorProto_parse(const char* buf, size_t size, upb_Arena* arena) {
7913   google_protobuf_EnumDescriptorProto* ret = google_protobuf_EnumDescriptorProto_new(arena);
7914   if (!ret) return NULL;
7915   if (upb_Decode(buf, size, UPB_UPCAST(ret), &google__protobuf__EnumDescriptorProto_msg_init, NULL, 0, arena) !=
7916       kUpb_DecodeStatus_Ok) {
7917     return NULL;
7918   }
7919   return ret;
7920 }
google_protobuf_EnumDescriptorProto_parse_ex(const char * buf,size_t size,const upb_ExtensionRegistry * extreg,int options,upb_Arena * arena)7921 UPB_INLINE google_protobuf_EnumDescriptorProto* google_protobuf_EnumDescriptorProto_parse_ex(const char* buf, size_t size,
7922                            const upb_ExtensionRegistry* extreg,
7923                            int options, upb_Arena* arena) {
7924   google_protobuf_EnumDescriptorProto* ret = google_protobuf_EnumDescriptorProto_new(arena);
7925   if (!ret) return NULL;
7926   if (upb_Decode(buf, size, UPB_UPCAST(ret), &google__protobuf__EnumDescriptorProto_msg_init, extreg, options,
7927                  arena) != kUpb_DecodeStatus_Ok) {
7928     return NULL;
7929   }
7930   return ret;
7931 }
google_protobuf_EnumDescriptorProto_serialize(const google_protobuf_EnumDescriptorProto * msg,upb_Arena * arena,size_t * len)7932 UPB_INLINE char* google_protobuf_EnumDescriptorProto_serialize(const google_protobuf_EnumDescriptorProto* msg, upb_Arena* arena, size_t* len) {
7933   char* ptr;
7934   (void)upb_Encode(UPB_UPCAST(msg), &google__protobuf__EnumDescriptorProto_msg_init, 0, arena, &ptr, len);
7935   return ptr;
7936 }
google_protobuf_EnumDescriptorProto_serialize_ex(const google_protobuf_EnumDescriptorProto * msg,int options,upb_Arena * arena,size_t * len)7937 UPB_INLINE char* google_protobuf_EnumDescriptorProto_serialize_ex(const google_protobuf_EnumDescriptorProto* msg, int options,
7938                                  upb_Arena* arena, size_t* len) {
7939   char* ptr;
7940   (void)upb_Encode(UPB_UPCAST(msg), &google__protobuf__EnumDescriptorProto_msg_init, options, arena, &ptr, len);
7941   return ptr;
7942 }
google_protobuf_EnumDescriptorProto_clear_name(google_protobuf_EnumDescriptorProto * msg)7943 UPB_INLINE void google_protobuf_EnumDescriptorProto_clear_name(google_protobuf_EnumDescriptorProto* msg) {
7944   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)};
7945   upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
7946 }
google_protobuf_EnumDescriptorProto_name(const google_protobuf_EnumDescriptorProto * msg)7947 UPB_INLINE upb_StringView google_protobuf_EnumDescriptorProto_name(const google_protobuf_EnumDescriptorProto* msg) {
7948   upb_StringView default_val = upb_StringView_FromString("");
7949   upb_StringView ret;
7950   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)};
7951   _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field,
7952                                     &default_val, &ret);
7953   return ret;
7954 }
google_protobuf_EnumDescriptorProto_has_name(const google_protobuf_EnumDescriptorProto * msg)7955 UPB_INLINE bool google_protobuf_EnumDescriptorProto_has_name(const google_protobuf_EnumDescriptorProto* msg) {
7956   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)};
7957   return upb_Message_HasBaseField(UPB_UPCAST(msg), &field);
7958 }
google_protobuf_EnumDescriptorProto_clear_value(google_protobuf_EnumDescriptorProto * msg)7959 UPB_INLINE void google_protobuf_EnumDescriptorProto_clear_value(google_protobuf_EnumDescriptorProto* msg) {
7960   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)};
7961   upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
7962 }
google_protobuf_EnumDescriptorProto_value(const google_protobuf_EnumDescriptorProto * msg,size_t * size)7963 UPB_INLINE const google_protobuf_EnumValueDescriptorProto* const* google_protobuf_EnumDescriptorProto_value(const google_protobuf_EnumDescriptorProto* msg, size_t* size) {
7964   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)};
7965   UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__EnumValueDescriptorProto_msg_init);
7966   const upb_Array* arr = upb_Message_GetArray(UPB_UPCAST(msg), &field);
7967   if (arr) {
7968     if (size) *size = arr->UPB_PRIVATE(size);
7969     return (const google_protobuf_EnumValueDescriptorProto* const*)upb_Array_DataPtr(arr);
7970   } else {
7971     if (size) *size = 0;
7972     return NULL;
7973   }
7974 }
_google_protobuf_EnumDescriptorProto_value_upb_array(const google_protobuf_EnumDescriptorProto * msg,size_t * size)7975 UPB_INLINE const upb_Array* _google_protobuf_EnumDescriptorProto_value_upb_array(const google_protobuf_EnumDescriptorProto* msg, size_t* size) {
7976   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)};
7977   UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__EnumValueDescriptorProto_msg_init);
7978   const upb_Array* arr = upb_Message_GetArray(UPB_UPCAST(msg), &field);
7979   if (size) {
7980     *size = arr ? arr->UPB_PRIVATE(size) : 0;
7981   }
7982   return arr;
7983 }
_google_protobuf_EnumDescriptorProto_value_mutable_upb_array(google_protobuf_EnumDescriptorProto * msg,size_t * size,upb_Arena * arena)7984 UPB_INLINE upb_Array* _google_protobuf_EnumDescriptorProto_value_mutable_upb_array(google_protobuf_EnumDescriptorProto* msg, size_t* size, upb_Arena* arena) {
7985   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)};
7986   UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__EnumValueDescriptorProto_msg_init);
7987   upb_Array* arr = upb_Message_GetOrCreateMutableArray(UPB_UPCAST(msg),
7988                                                        &field, arena);
7989   if (size) {
7990     *size = arr ? arr->UPB_PRIVATE(size) : 0;
7991   }
7992   return arr;
7993 }
google_protobuf_EnumDescriptorProto_clear_options(google_protobuf_EnumDescriptorProto * msg)7994 UPB_INLINE void google_protobuf_EnumDescriptorProto_clear_options(google_protobuf_EnumDescriptorProto* msg) {
7995   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)};
7996   upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
7997 }
google_protobuf_EnumDescriptorProto_options(const google_protobuf_EnumDescriptorProto * msg)7998 UPB_INLINE const google_protobuf_EnumOptions* google_protobuf_EnumDescriptorProto_options(const google_protobuf_EnumDescriptorProto* msg) {
7999   const google_protobuf_EnumOptions* default_val = NULL;
8000   const google_protobuf_EnumOptions* ret;
8001   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)};
8002   UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__EnumOptions_msg_init);
8003   _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field,
8004                                     &default_val, &ret);
8005   return ret;
8006 }
google_protobuf_EnumDescriptorProto_has_options(const google_protobuf_EnumDescriptorProto * msg)8007 UPB_INLINE bool google_protobuf_EnumDescriptorProto_has_options(const google_protobuf_EnumDescriptorProto* msg) {
8008   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)};
8009   return upb_Message_HasBaseField(UPB_UPCAST(msg), &field);
8010 }
google_protobuf_EnumDescriptorProto_clear_reserved_range(google_protobuf_EnumDescriptorProto * msg)8011 UPB_INLINE void google_protobuf_EnumDescriptorProto_clear_reserved_range(google_protobuf_EnumDescriptorProto* msg) {
8012   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)};
8013   upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
8014 }
google_protobuf_EnumDescriptorProto_reserved_range(const google_protobuf_EnumDescriptorProto * msg,size_t * size)8015 UPB_INLINE const google_protobuf_EnumDescriptorProto_EnumReservedRange* const* google_protobuf_EnumDescriptorProto_reserved_range(const google_protobuf_EnumDescriptorProto* msg, size_t* size) {
8016   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)};
8017   UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__EnumDescriptorProto__EnumReservedRange_msg_init);
8018   const upb_Array* arr = upb_Message_GetArray(UPB_UPCAST(msg), &field);
8019   if (arr) {
8020     if (size) *size = arr->UPB_PRIVATE(size);
8021     return (const google_protobuf_EnumDescriptorProto_EnumReservedRange* const*)upb_Array_DataPtr(arr);
8022   } else {
8023     if (size) *size = 0;
8024     return NULL;
8025   }
8026 }
_google_protobuf_EnumDescriptorProto_reserved_range_upb_array(const google_protobuf_EnumDescriptorProto * msg,size_t * size)8027 UPB_INLINE const upb_Array* _google_protobuf_EnumDescriptorProto_reserved_range_upb_array(const google_protobuf_EnumDescriptorProto* msg, size_t* size) {
8028   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)};
8029   UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__EnumDescriptorProto__EnumReservedRange_msg_init);
8030   const upb_Array* arr = upb_Message_GetArray(UPB_UPCAST(msg), &field);
8031   if (size) {
8032     *size = arr ? arr->UPB_PRIVATE(size) : 0;
8033   }
8034   return arr;
8035 }
_google_protobuf_EnumDescriptorProto_reserved_range_mutable_upb_array(google_protobuf_EnumDescriptorProto * msg,size_t * size,upb_Arena * arena)8036 UPB_INLINE upb_Array* _google_protobuf_EnumDescriptorProto_reserved_range_mutable_upb_array(google_protobuf_EnumDescriptorProto* msg, size_t* size, upb_Arena* arena) {
8037   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)};
8038   UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__EnumDescriptorProto__EnumReservedRange_msg_init);
8039   upb_Array* arr = upb_Message_GetOrCreateMutableArray(UPB_UPCAST(msg),
8040                                                        &field, arena);
8041   if (size) {
8042     *size = arr ? arr->UPB_PRIVATE(size) : 0;
8043   }
8044   return arr;
8045 }
google_protobuf_EnumDescriptorProto_clear_reserved_name(google_protobuf_EnumDescriptorProto * msg)8046 UPB_INLINE void google_protobuf_EnumDescriptorProto_clear_reserved_name(google_protobuf_EnumDescriptorProto* msg) {
8047   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)};
8048   upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
8049 }
google_protobuf_EnumDescriptorProto_reserved_name(const google_protobuf_EnumDescriptorProto * msg,size_t * size)8050 UPB_INLINE upb_StringView const* google_protobuf_EnumDescriptorProto_reserved_name(const google_protobuf_EnumDescriptorProto* msg, size_t* size) {
8051   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)};
8052   const upb_Array* arr = upb_Message_GetArray(UPB_UPCAST(msg), &field);
8053   if (arr) {
8054     if (size) *size = arr->UPB_PRIVATE(size);
8055     return (upb_StringView const*)upb_Array_DataPtr(arr);
8056   } else {
8057     if (size) *size = 0;
8058     return NULL;
8059   }
8060 }
_google_protobuf_EnumDescriptorProto_reserved_name_upb_array(const google_protobuf_EnumDescriptorProto * msg,size_t * size)8061 UPB_INLINE const upb_Array* _google_protobuf_EnumDescriptorProto_reserved_name_upb_array(const google_protobuf_EnumDescriptorProto* msg, size_t* size) {
8062   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)};
8063   const upb_Array* arr = upb_Message_GetArray(UPB_UPCAST(msg), &field);
8064   if (size) {
8065     *size = arr ? arr->UPB_PRIVATE(size) : 0;
8066   }
8067   return arr;
8068 }
_google_protobuf_EnumDescriptorProto_reserved_name_mutable_upb_array(google_protobuf_EnumDescriptorProto * msg,size_t * size,upb_Arena * arena)8069 UPB_INLINE upb_Array* _google_protobuf_EnumDescriptorProto_reserved_name_mutable_upb_array(google_protobuf_EnumDescriptorProto* msg, size_t* size, upb_Arena* arena) {
8070   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)};
8071   upb_Array* arr = upb_Message_GetOrCreateMutableArray(UPB_UPCAST(msg),
8072                                                        &field, arena);
8073   if (size) {
8074     *size = arr ? arr->UPB_PRIVATE(size) : 0;
8075   }
8076   return arr;
8077 }
8078 
google_protobuf_EnumDescriptorProto_set_name(google_protobuf_EnumDescriptorProto * msg,upb_StringView value)8079 UPB_INLINE void google_protobuf_EnumDescriptorProto_set_name(google_protobuf_EnumDescriptorProto *msg, upb_StringView value) {
8080   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)};
8081   upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
8082 }
google_protobuf_EnumDescriptorProto_mutable_value(google_protobuf_EnumDescriptorProto * msg,size_t * size)8083 UPB_INLINE google_protobuf_EnumValueDescriptorProto** google_protobuf_EnumDescriptorProto_mutable_value(google_protobuf_EnumDescriptorProto* msg, size_t* size) {
8084   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)};
8085   UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__EnumValueDescriptorProto_msg_init);
8086   upb_Array* arr = upb_Message_GetMutableArray(UPB_UPCAST(msg), &field);
8087   if (arr) {
8088     if (size) *size = arr->UPB_PRIVATE(size);
8089     return (google_protobuf_EnumValueDescriptorProto**)upb_Array_MutableDataPtr(arr);
8090   } else {
8091     if (size) *size = 0;
8092     return NULL;
8093   }
8094 }
google_protobuf_EnumDescriptorProto_resize_value(google_protobuf_EnumDescriptorProto * msg,size_t size,upb_Arena * arena)8095 UPB_INLINE google_protobuf_EnumValueDescriptorProto** google_protobuf_EnumDescriptorProto_resize_value(google_protobuf_EnumDescriptorProto* msg, size_t size, upb_Arena* arena) {
8096   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)};
8097   return (google_protobuf_EnumValueDescriptorProto**)upb_Message_ResizeArrayUninitialized(UPB_UPCAST(msg),
8098                                                    &field, size, arena);
8099 }
google_protobuf_EnumDescriptorProto_add_value(google_protobuf_EnumDescriptorProto * msg,upb_Arena * arena)8100 UPB_INLINE struct google_protobuf_EnumValueDescriptorProto* google_protobuf_EnumDescriptorProto_add_value(google_protobuf_EnumDescriptorProto* msg, upb_Arena* arena) {
8101   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)};
8102   UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__EnumValueDescriptorProto_msg_init);
8103   upb_Array* arr = upb_Message_GetOrCreateMutableArray(
8104       UPB_UPCAST(msg), &field, arena);
8105   if (!arr || !UPB_PRIVATE(_upb_Array_ResizeUninitialized)(
8106                   arr, arr->UPB_PRIVATE(size) + 1, arena)) {
8107     return NULL;
8108   }
8109   struct google_protobuf_EnumValueDescriptorProto* sub = (struct google_protobuf_EnumValueDescriptorProto*)_upb_Message_New(&google__protobuf__EnumValueDescriptorProto_msg_init, arena);
8110   if (!arr || !sub) return NULL;
8111   UPB_PRIVATE(_upb_Array_Set)
8112   (arr, arr->UPB_PRIVATE(size) - 1, &sub, sizeof(sub));
8113   return sub;
8114 }
google_protobuf_EnumDescriptorProto_set_options(google_protobuf_EnumDescriptorProto * msg,google_protobuf_EnumOptions * value)8115 UPB_INLINE void google_protobuf_EnumDescriptorProto_set_options(google_protobuf_EnumDescriptorProto *msg, google_protobuf_EnumOptions* value) {
8116   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)};
8117   UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__EnumOptions_msg_init);
8118   upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
8119 }
google_protobuf_EnumDescriptorProto_mutable_options(google_protobuf_EnumDescriptorProto * msg,upb_Arena * arena)8120 UPB_INLINE struct google_protobuf_EnumOptions* google_protobuf_EnumDescriptorProto_mutable_options(google_protobuf_EnumDescriptorProto* msg, upb_Arena* arena) {
8121   struct google_protobuf_EnumOptions* sub = (struct google_protobuf_EnumOptions*)google_protobuf_EnumDescriptorProto_options(msg);
8122   if (sub == NULL) {
8123     sub = (struct google_protobuf_EnumOptions*)_upb_Message_New(&google__protobuf__EnumOptions_msg_init, arena);
8124     if (sub) google_protobuf_EnumDescriptorProto_set_options(msg, sub);
8125   }
8126   return sub;
8127 }
google_protobuf_EnumDescriptorProto_mutable_reserved_range(google_protobuf_EnumDescriptorProto * msg,size_t * size)8128 UPB_INLINE google_protobuf_EnumDescriptorProto_EnumReservedRange** google_protobuf_EnumDescriptorProto_mutable_reserved_range(google_protobuf_EnumDescriptorProto* msg, size_t* size) {
8129   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)};
8130   UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__EnumDescriptorProto__EnumReservedRange_msg_init);
8131   upb_Array* arr = upb_Message_GetMutableArray(UPB_UPCAST(msg), &field);
8132   if (arr) {
8133     if (size) *size = arr->UPB_PRIVATE(size);
8134     return (google_protobuf_EnumDescriptorProto_EnumReservedRange**)upb_Array_MutableDataPtr(arr);
8135   } else {
8136     if (size) *size = 0;
8137     return NULL;
8138   }
8139 }
google_protobuf_EnumDescriptorProto_resize_reserved_range(google_protobuf_EnumDescriptorProto * msg,size_t size,upb_Arena * arena)8140 UPB_INLINE google_protobuf_EnumDescriptorProto_EnumReservedRange** google_protobuf_EnumDescriptorProto_resize_reserved_range(google_protobuf_EnumDescriptorProto* msg, size_t size, upb_Arena* arena) {
8141   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)};
8142   return (google_protobuf_EnumDescriptorProto_EnumReservedRange**)upb_Message_ResizeArrayUninitialized(UPB_UPCAST(msg),
8143                                                    &field, size, arena);
8144 }
google_protobuf_EnumDescriptorProto_add_reserved_range(google_protobuf_EnumDescriptorProto * msg,upb_Arena * arena)8145 UPB_INLINE struct google_protobuf_EnumDescriptorProto_EnumReservedRange* google_protobuf_EnumDescriptorProto_add_reserved_range(google_protobuf_EnumDescriptorProto* msg, upb_Arena* arena) {
8146   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)};
8147   UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__EnumDescriptorProto__EnumReservedRange_msg_init);
8148   upb_Array* arr = upb_Message_GetOrCreateMutableArray(
8149       UPB_UPCAST(msg), &field, arena);
8150   if (!arr || !UPB_PRIVATE(_upb_Array_ResizeUninitialized)(
8151                   arr, arr->UPB_PRIVATE(size) + 1, arena)) {
8152     return NULL;
8153   }
8154   struct google_protobuf_EnumDescriptorProto_EnumReservedRange* sub = (struct google_protobuf_EnumDescriptorProto_EnumReservedRange*)_upb_Message_New(&google__protobuf__EnumDescriptorProto__EnumReservedRange_msg_init, arena);
8155   if (!arr || !sub) return NULL;
8156   UPB_PRIVATE(_upb_Array_Set)
8157   (arr, arr->UPB_PRIVATE(size) - 1, &sub, sizeof(sub));
8158   return sub;
8159 }
google_protobuf_EnumDescriptorProto_mutable_reserved_name(google_protobuf_EnumDescriptorProto * msg,size_t * size)8160 UPB_INLINE upb_StringView* google_protobuf_EnumDescriptorProto_mutable_reserved_name(google_protobuf_EnumDescriptorProto* msg, size_t* size) {
8161   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)};
8162   upb_Array* arr = upb_Message_GetMutableArray(UPB_UPCAST(msg), &field);
8163   if (arr) {
8164     if (size) *size = arr->UPB_PRIVATE(size);
8165     return (upb_StringView*)upb_Array_MutableDataPtr(arr);
8166   } else {
8167     if (size) *size = 0;
8168     return NULL;
8169   }
8170 }
google_protobuf_EnumDescriptorProto_resize_reserved_name(google_protobuf_EnumDescriptorProto * msg,size_t size,upb_Arena * arena)8171 UPB_INLINE upb_StringView* google_protobuf_EnumDescriptorProto_resize_reserved_name(google_protobuf_EnumDescriptorProto* msg, size_t size, upb_Arena* arena) {
8172   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)};
8173   return (upb_StringView*)upb_Message_ResizeArrayUninitialized(UPB_UPCAST(msg),
8174                                                    &field, size, arena);
8175 }
google_protobuf_EnumDescriptorProto_add_reserved_name(google_protobuf_EnumDescriptorProto * msg,upb_StringView val,upb_Arena * arena)8176 UPB_INLINE bool google_protobuf_EnumDescriptorProto_add_reserved_name(google_protobuf_EnumDescriptorProto* msg, upb_StringView val, upb_Arena* arena) {
8177   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)};
8178   upb_Array* arr = upb_Message_GetOrCreateMutableArray(
8179       UPB_UPCAST(msg), &field, arena);
8180   if (!arr || !UPB_PRIVATE(_upb_Array_ResizeUninitialized)(
8181                   arr, arr->UPB_PRIVATE(size) + 1, arena)) {
8182     return false;
8183   }
8184   UPB_PRIVATE(_upb_Array_Set)
8185   (arr, arr->UPB_PRIVATE(size) - 1, &val, sizeof(val));
8186   return true;
8187 }
8188 
8189 /* google.protobuf.EnumDescriptorProto.EnumReservedRange */
8190 
google_protobuf_EnumDescriptorProto_EnumReservedRange_new(upb_Arena * arena)8191 UPB_INLINE google_protobuf_EnumDescriptorProto_EnumReservedRange* google_protobuf_EnumDescriptorProto_EnumReservedRange_new(upb_Arena* arena) {
8192   return (google_protobuf_EnumDescriptorProto_EnumReservedRange*)_upb_Message_New(&google__protobuf__EnumDescriptorProto__EnumReservedRange_msg_init, arena);
8193 }
google_protobuf_EnumDescriptorProto_EnumReservedRange_parse(const char * buf,size_t size,upb_Arena * arena)8194 UPB_INLINE google_protobuf_EnumDescriptorProto_EnumReservedRange* google_protobuf_EnumDescriptorProto_EnumReservedRange_parse(const char* buf, size_t size, upb_Arena* arena) {
8195   google_protobuf_EnumDescriptorProto_EnumReservedRange* ret = google_protobuf_EnumDescriptorProto_EnumReservedRange_new(arena);
8196   if (!ret) return NULL;
8197   if (upb_Decode(buf, size, UPB_UPCAST(ret), &google__protobuf__EnumDescriptorProto__EnumReservedRange_msg_init, NULL, 0, arena) !=
8198       kUpb_DecodeStatus_Ok) {
8199     return NULL;
8200   }
8201   return ret;
8202 }
google_protobuf_EnumDescriptorProto_EnumReservedRange_parse_ex(const char * buf,size_t size,const upb_ExtensionRegistry * extreg,int options,upb_Arena * arena)8203 UPB_INLINE google_protobuf_EnumDescriptorProto_EnumReservedRange* google_protobuf_EnumDescriptorProto_EnumReservedRange_parse_ex(const char* buf, size_t size,
8204                            const upb_ExtensionRegistry* extreg,
8205                            int options, upb_Arena* arena) {
8206   google_protobuf_EnumDescriptorProto_EnumReservedRange* ret = google_protobuf_EnumDescriptorProto_EnumReservedRange_new(arena);
8207   if (!ret) return NULL;
8208   if (upb_Decode(buf, size, UPB_UPCAST(ret), &google__protobuf__EnumDescriptorProto__EnumReservedRange_msg_init, extreg, options,
8209                  arena) != kUpb_DecodeStatus_Ok) {
8210     return NULL;
8211   }
8212   return ret;
8213 }
google_protobuf_EnumDescriptorProto_EnumReservedRange_serialize(const google_protobuf_EnumDescriptorProto_EnumReservedRange * msg,upb_Arena * arena,size_t * len)8214 UPB_INLINE char* google_protobuf_EnumDescriptorProto_EnumReservedRange_serialize(const google_protobuf_EnumDescriptorProto_EnumReservedRange* msg, upb_Arena* arena, size_t* len) {
8215   char* ptr;
8216   (void)upb_Encode(UPB_UPCAST(msg), &google__protobuf__EnumDescriptorProto__EnumReservedRange_msg_init, 0, arena, &ptr, len);
8217   return ptr;
8218 }
google_protobuf_EnumDescriptorProto_EnumReservedRange_serialize_ex(const google_protobuf_EnumDescriptorProto_EnumReservedRange * msg,int options,upb_Arena * arena,size_t * len)8219 UPB_INLINE char* google_protobuf_EnumDescriptorProto_EnumReservedRange_serialize_ex(const google_protobuf_EnumDescriptorProto_EnumReservedRange* msg, int options,
8220                                  upb_Arena* arena, size_t* len) {
8221   char* ptr;
8222   (void)upb_Encode(UPB_UPCAST(msg), &google__protobuf__EnumDescriptorProto__EnumReservedRange_msg_init, options, arena, &ptr, len);
8223   return ptr;
8224 }
google_protobuf_EnumDescriptorProto_EnumReservedRange_clear_start(google_protobuf_EnumDescriptorProto_EnumReservedRange * msg)8225 UPB_INLINE void google_protobuf_EnumDescriptorProto_EnumReservedRange_clear_start(google_protobuf_EnumDescriptorProto_EnumReservedRange* msg) {
8226   const upb_MiniTableField field = {1, 12, 64, kUpb_NoSub, 5, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
8227   upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
8228 }
google_protobuf_EnumDescriptorProto_EnumReservedRange_start(const google_protobuf_EnumDescriptorProto_EnumReservedRange * msg)8229 UPB_INLINE int32_t google_protobuf_EnumDescriptorProto_EnumReservedRange_start(const google_protobuf_EnumDescriptorProto_EnumReservedRange* msg) {
8230   int32_t default_val = (int32_t)0;
8231   int32_t ret;
8232   const upb_MiniTableField field = {1, 12, 64, kUpb_NoSub, 5, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
8233   _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field,
8234                                     &default_val, &ret);
8235   return ret;
8236 }
google_protobuf_EnumDescriptorProto_EnumReservedRange_has_start(const google_protobuf_EnumDescriptorProto_EnumReservedRange * msg)8237 UPB_INLINE bool google_protobuf_EnumDescriptorProto_EnumReservedRange_has_start(const google_protobuf_EnumDescriptorProto_EnumReservedRange* msg) {
8238   const upb_MiniTableField field = {1, 12, 64, kUpb_NoSub, 5, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
8239   return upb_Message_HasBaseField(UPB_UPCAST(msg), &field);
8240 }
google_protobuf_EnumDescriptorProto_EnumReservedRange_clear_end(google_protobuf_EnumDescriptorProto_EnumReservedRange * msg)8241 UPB_INLINE void google_protobuf_EnumDescriptorProto_EnumReservedRange_clear_end(google_protobuf_EnumDescriptorProto_EnumReservedRange* msg) {
8242   const upb_MiniTableField field = {2, 16, 65, kUpb_NoSub, 5, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
8243   upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
8244 }
google_protobuf_EnumDescriptorProto_EnumReservedRange_end(const google_protobuf_EnumDescriptorProto_EnumReservedRange * msg)8245 UPB_INLINE int32_t google_protobuf_EnumDescriptorProto_EnumReservedRange_end(const google_protobuf_EnumDescriptorProto_EnumReservedRange* msg) {
8246   int32_t default_val = (int32_t)0;
8247   int32_t ret;
8248   const upb_MiniTableField field = {2, 16, 65, kUpb_NoSub, 5, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
8249   _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field,
8250                                     &default_val, &ret);
8251   return ret;
8252 }
google_protobuf_EnumDescriptorProto_EnumReservedRange_has_end(const google_protobuf_EnumDescriptorProto_EnumReservedRange * msg)8253 UPB_INLINE bool google_protobuf_EnumDescriptorProto_EnumReservedRange_has_end(const google_protobuf_EnumDescriptorProto_EnumReservedRange* msg) {
8254   const upb_MiniTableField field = {2, 16, 65, kUpb_NoSub, 5, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
8255   return upb_Message_HasBaseField(UPB_UPCAST(msg), &field);
8256 }
8257 
google_protobuf_EnumDescriptorProto_EnumReservedRange_set_start(google_protobuf_EnumDescriptorProto_EnumReservedRange * msg,int32_t value)8258 UPB_INLINE void google_protobuf_EnumDescriptorProto_EnumReservedRange_set_start(google_protobuf_EnumDescriptorProto_EnumReservedRange *msg, int32_t value) {
8259   const upb_MiniTableField field = {1, 12, 64, kUpb_NoSub, 5, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
8260   upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
8261 }
google_protobuf_EnumDescriptorProto_EnumReservedRange_set_end(google_protobuf_EnumDescriptorProto_EnumReservedRange * msg,int32_t value)8262 UPB_INLINE void google_protobuf_EnumDescriptorProto_EnumReservedRange_set_end(google_protobuf_EnumDescriptorProto_EnumReservedRange *msg, int32_t value) {
8263   const upb_MiniTableField field = {2, 16, 65, kUpb_NoSub, 5, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
8264   upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
8265 }
8266 
8267 /* google.protobuf.EnumValueDescriptorProto */
8268 
google_protobuf_EnumValueDescriptorProto_new(upb_Arena * arena)8269 UPB_INLINE google_protobuf_EnumValueDescriptorProto* google_protobuf_EnumValueDescriptorProto_new(upb_Arena* arena) {
8270   return (google_protobuf_EnumValueDescriptorProto*)_upb_Message_New(&google__protobuf__EnumValueDescriptorProto_msg_init, arena);
8271 }
google_protobuf_EnumValueDescriptorProto_parse(const char * buf,size_t size,upb_Arena * arena)8272 UPB_INLINE google_protobuf_EnumValueDescriptorProto* google_protobuf_EnumValueDescriptorProto_parse(const char* buf, size_t size, upb_Arena* arena) {
8273   google_protobuf_EnumValueDescriptorProto* ret = google_protobuf_EnumValueDescriptorProto_new(arena);
8274   if (!ret) return NULL;
8275   if (upb_Decode(buf, size, UPB_UPCAST(ret), &google__protobuf__EnumValueDescriptorProto_msg_init, NULL, 0, arena) !=
8276       kUpb_DecodeStatus_Ok) {
8277     return NULL;
8278   }
8279   return ret;
8280 }
google_protobuf_EnumValueDescriptorProto_parse_ex(const char * buf,size_t size,const upb_ExtensionRegistry * extreg,int options,upb_Arena * arena)8281 UPB_INLINE google_protobuf_EnumValueDescriptorProto* google_protobuf_EnumValueDescriptorProto_parse_ex(const char* buf, size_t size,
8282                            const upb_ExtensionRegistry* extreg,
8283                            int options, upb_Arena* arena) {
8284   google_protobuf_EnumValueDescriptorProto* ret = google_protobuf_EnumValueDescriptorProto_new(arena);
8285   if (!ret) return NULL;
8286   if (upb_Decode(buf, size, UPB_UPCAST(ret), &google__protobuf__EnumValueDescriptorProto_msg_init, extreg, options,
8287                  arena) != kUpb_DecodeStatus_Ok) {
8288     return NULL;
8289   }
8290   return ret;
8291 }
google_protobuf_EnumValueDescriptorProto_serialize(const google_protobuf_EnumValueDescriptorProto * msg,upb_Arena * arena,size_t * len)8292 UPB_INLINE char* google_protobuf_EnumValueDescriptorProto_serialize(const google_protobuf_EnumValueDescriptorProto* msg, upb_Arena* arena, size_t* len) {
8293   char* ptr;
8294   (void)upb_Encode(UPB_UPCAST(msg), &google__protobuf__EnumValueDescriptorProto_msg_init, 0, arena, &ptr, len);
8295   return ptr;
8296 }
google_protobuf_EnumValueDescriptorProto_serialize_ex(const google_protobuf_EnumValueDescriptorProto * msg,int options,upb_Arena * arena,size_t * len)8297 UPB_INLINE char* google_protobuf_EnumValueDescriptorProto_serialize_ex(const google_protobuf_EnumValueDescriptorProto* msg, int options,
8298                                  upb_Arena* arena, size_t* len) {
8299   char* ptr;
8300   (void)upb_Encode(UPB_UPCAST(msg), &google__protobuf__EnumValueDescriptorProto_msg_init, options, arena, &ptr, len);
8301   return ptr;
8302 }
google_protobuf_EnumValueDescriptorProto_clear_name(google_protobuf_EnumValueDescriptorProto * msg)8303 UPB_INLINE void google_protobuf_EnumValueDescriptorProto_clear_name(google_protobuf_EnumValueDescriptorProto* msg) {
8304   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)};
8305   upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
8306 }
google_protobuf_EnumValueDescriptorProto_name(const google_protobuf_EnumValueDescriptorProto * msg)8307 UPB_INLINE upb_StringView google_protobuf_EnumValueDescriptorProto_name(const google_protobuf_EnumValueDescriptorProto* msg) {
8308   upb_StringView default_val = upb_StringView_FromString("");
8309   upb_StringView ret;
8310   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)};
8311   _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field,
8312                                     &default_val, &ret);
8313   return ret;
8314 }
google_protobuf_EnumValueDescriptorProto_has_name(const google_protobuf_EnumValueDescriptorProto * msg)8315 UPB_INLINE bool google_protobuf_EnumValueDescriptorProto_has_name(const google_protobuf_EnumValueDescriptorProto* msg) {
8316   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)};
8317   return upb_Message_HasBaseField(UPB_UPCAST(msg), &field);
8318 }
google_protobuf_EnumValueDescriptorProto_clear_number(google_protobuf_EnumValueDescriptorProto * msg)8319 UPB_INLINE void google_protobuf_EnumValueDescriptorProto_clear_number(google_protobuf_EnumValueDescriptorProto* msg) {
8320   const upb_MiniTableField field = {2, 12, 65, kUpb_NoSub, 5, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
8321   upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
8322 }
google_protobuf_EnumValueDescriptorProto_number(const google_protobuf_EnumValueDescriptorProto * msg)8323 UPB_INLINE int32_t google_protobuf_EnumValueDescriptorProto_number(const google_protobuf_EnumValueDescriptorProto* msg) {
8324   int32_t default_val = (int32_t)0;
8325   int32_t ret;
8326   const upb_MiniTableField field = {2, 12, 65, kUpb_NoSub, 5, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
8327   _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field,
8328                                     &default_val, &ret);
8329   return ret;
8330 }
google_protobuf_EnumValueDescriptorProto_has_number(const google_protobuf_EnumValueDescriptorProto * msg)8331 UPB_INLINE bool google_protobuf_EnumValueDescriptorProto_has_number(const google_protobuf_EnumValueDescriptorProto* msg) {
8332   const upb_MiniTableField field = {2, 12, 65, kUpb_NoSub, 5, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
8333   return upb_Message_HasBaseField(UPB_UPCAST(msg), &field);
8334 }
google_protobuf_EnumValueDescriptorProto_clear_options(google_protobuf_EnumValueDescriptorProto * msg)8335 UPB_INLINE void google_protobuf_EnumValueDescriptorProto_clear_options(google_protobuf_EnumValueDescriptorProto* msg) {
8336   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)};
8337   upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
8338 }
google_protobuf_EnumValueDescriptorProto_options(const google_protobuf_EnumValueDescriptorProto * msg)8339 UPB_INLINE const google_protobuf_EnumValueOptions* google_protobuf_EnumValueDescriptorProto_options(const google_protobuf_EnumValueDescriptorProto* msg) {
8340   const google_protobuf_EnumValueOptions* default_val = NULL;
8341   const google_protobuf_EnumValueOptions* ret;
8342   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)};
8343   UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__EnumValueOptions_msg_init);
8344   _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field,
8345                                     &default_val, &ret);
8346   return ret;
8347 }
google_protobuf_EnumValueDescriptorProto_has_options(const google_protobuf_EnumValueDescriptorProto * msg)8348 UPB_INLINE bool google_protobuf_EnumValueDescriptorProto_has_options(const google_protobuf_EnumValueDescriptorProto* msg) {
8349   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)};
8350   return upb_Message_HasBaseField(UPB_UPCAST(msg), &field);
8351 }
8352 
google_protobuf_EnumValueDescriptorProto_set_name(google_protobuf_EnumValueDescriptorProto * msg,upb_StringView value)8353 UPB_INLINE void google_protobuf_EnumValueDescriptorProto_set_name(google_protobuf_EnumValueDescriptorProto *msg, upb_StringView value) {
8354   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)};
8355   upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
8356 }
google_protobuf_EnumValueDescriptorProto_set_number(google_protobuf_EnumValueDescriptorProto * msg,int32_t value)8357 UPB_INLINE void google_protobuf_EnumValueDescriptorProto_set_number(google_protobuf_EnumValueDescriptorProto *msg, int32_t value) {
8358   const upb_MiniTableField field = {2, 12, 65, kUpb_NoSub, 5, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
8359   upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
8360 }
google_protobuf_EnumValueDescriptorProto_set_options(google_protobuf_EnumValueDescriptorProto * msg,google_protobuf_EnumValueOptions * value)8361 UPB_INLINE void google_protobuf_EnumValueDescriptorProto_set_options(google_protobuf_EnumValueDescriptorProto *msg, google_protobuf_EnumValueOptions* value) {
8362   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)};
8363   UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__EnumValueOptions_msg_init);
8364   upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
8365 }
google_protobuf_EnumValueDescriptorProto_mutable_options(google_protobuf_EnumValueDescriptorProto * msg,upb_Arena * arena)8366 UPB_INLINE struct google_protobuf_EnumValueOptions* google_protobuf_EnumValueDescriptorProto_mutable_options(google_protobuf_EnumValueDescriptorProto* msg, upb_Arena* arena) {
8367   struct google_protobuf_EnumValueOptions* sub = (struct google_protobuf_EnumValueOptions*)google_protobuf_EnumValueDescriptorProto_options(msg);
8368   if (sub == NULL) {
8369     sub = (struct google_protobuf_EnumValueOptions*)_upb_Message_New(&google__protobuf__EnumValueOptions_msg_init, arena);
8370     if (sub) google_protobuf_EnumValueDescriptorProto_set_options(msg, sub);
8371   }
8372   return sub;
8373 }
8374 
8375 /* google.protobuf.ServiceDescriptorProto */
8376 
google_protobuf_ServiceDescriptorProto_new(upb_Arena * arena)8377 UPB_INLINE google_protobuf_ServiceDescriptorProto* google_protobuf_ServiceDescriptorProto_new(upb_Arena* arena) {
8378   return (google_protobuf_ServiceDescriptorProto*)_upb_Message_New(&google__protobuf__ServiceDescriptorProto_msg_init, arena);
8379 }
google_protobuf_ServiceDescriptorProto_parse(const char * buf,size_t size,upb_Arena * arena)8380 UPB_INLINE google_protobuf_ServiceDescriptorProto* google_protobuf_ServiceDescriptorProto_parse(const char* buf, size_t size, upb_Arena* arena) {
8381   google_protobuf_ServiceDescriptorProto* ret = google_protobuf_ServiceDescriptorProto_new(arena);
8382   if (!ret) return NULL;
8383   if (upb_Decode(buf, size, UPB_UPCAST(ret), &google__protobuf__ServiceDescriptorProto_msg_init, NULL, 0, arena) !=
8384       kUpb_DecodeStatus_Ok) {
8385     return NULL;
8386   }
8387   return ret;
8388 }
google_protobuf_ServiceDescriptorProto_parse_ex(const char * buf,size_t size,const upb_ExtensionRegistry * extreg,int options,upb_Arena * arena)8389 UPB_INLINE google_protobuf_ServiceDescriptorProto* google_protobuf_ServiceDescriptorProto_parse_ex(const char* buf, size_t size,
8390                            const upb_ExtensionRegistry* extreg,
8391                            int options, upb_Arena* arena) {
8392   google_protobuf_ServiceDescriptorProto* ret = google_protobuf_ServiceDescriptorProto_new(arena);
8393   if (!ret) return NULL;
8394   if (upb_Decode(buf, size, UPB_UPCAST(ret), &google__protobuf__ServiceDescriptorProto_msg_init, extreg, options,
8395                  arena) != kUpb_DecodeStatus_Ok) {
8396     return NULL;
8397   }
8398   return ret;
8399 }
google_protobuf_ServiceDescriptorProto_serialize(const google_protobuf_ServiceDescriptorProto * msg,upb_Arena * arena,size_t * len)8400 UPB_INLINE char* google_protobuf_ServiceDescriptorProto_serialize(const google_protobuf_ServiceDescriptorProto* msg, upb_Arena* arena, size_t* len) {
8401   char* ptr;
8402   (void)upb_Encode(UPB_UPCAST(msg), &google__protobuf__ServiceDescriptorProto_msg_init, 0, arena, &ptr, len);
8403   return ptr;
8404 }
google_protobuf_ServiceDescriptorProto_serialize_ex(const google_protobuf_ServiceDescriptorProto * msg,int options,upb_Arena * arena,size_t * len)8405 UPB_INLINE char* google_protobuf_ServiceDescriptorProto_serialize_ex(const google_protobuf_ServiceDescriptorProto* msg, int options,
8406                                  upb_Arena* arena, size_t* len) {
8407   char* ptr;
8408   (void)upb_Encode(UPB_UPCAST(msg), &google__protobuf__ServiceDescriptorProto_msg_init, options, arena, &ptr, len);
8409   return ptr;
8410 }
google_protobuf_ServiceDescriptorProto_clear_name(google_protobuf_ServiceDescriptorProto * msg)8411 UPB_INLINE void google_protobuf_ServiceDescriptorProto_clear_name(google_protobuf_ServiceDescriptorProto* msg) {
8412   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)};
8413   upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
8414 }
google_protobuf_ServiceDescriptorProto_name(const google_protobuf_ServiceDescriptorProto * msg)8415 UPB_INLINE upb_StringView google_protobuf_ServiceDescriptorProto_name(const google_protobuf_ServiceDescriptorProto* msg) {
8416   upb_StringView default_val = upb_StringView_FromString("");
8417   upb_StringView ret;
8418   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)};
8419   _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field,
8420                                     &default_val, &ret);
8421   return ret;
8422 }
google_protobuf_ServiceDescriptorProto_has_name(const google_protobuf_ServiceDescriptorProto * msg)8423 UPB_INLINE bool google_protobuf_ServiceDescriptorProto_has_name(const google_protobuf_ServiceDescriptorProto* msg) {
8424   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)};
8425   return upb_Message_HasBaseField(UPB_UPCAST(msg), &field);
8426 }
google_protobuf_ServiceDescriptorProto_clear_method(google_protobuf_ServiceDescriptorProto * msg)8427 UPB_INLINE void google_protobuf_ServiceDescriptorProto_clear_method(google_protobuf_ServiceDescriptorProto* msg) {
8428   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)};
8429   upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
8430 }
google_protobuf_ServiceDescriptorProto_method(const google_protobuf_ServiceDescriptorProto * msg,size_t * size)8431 UPB_INLINE const google_protobuf_MethodDescriptorProto* const* google_protobuf_ServiceDescriptorProto_method(const google_protobuf_ServiceDescriptorProto* msg, size_t* size) {
8432   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)};
8433   UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__MethodDescriptorProto_msg_init);
8434   const upb_Array* arr = upb_Message_GetArray(UPB_UPCAST(msg), &field);
8435   if (arr) {
8436     if (size) *size = arr->UPB_PRIVATE(size);
8437     return (const google_protobuf_MethodDescriptorProto* const*)upb_Array_DataPtr(arr);
8438   } else {
8439     if (size) *size = 0;
8440     return NULL;
8441   }
8442 }
_google_protobuf_ServiceDescriptorProto_method_upb_array(const google_protobuf_ServiceDescriptorProto * msg,size_t * size)8443 UPB_INLINE const upb_Array* _google_protobuf_ServiceDescriptorProto_method_upb_array(const google_protobuf_ServiceDescriptorProto* msg, size_t* size) {
8444   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)};
8445   UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__MethodDescriptorProto_msg_init);
8446   const upb_Array* arr = upb_Message_GetArray(UPB_UPCAST(msg), &field);
8447   if (size) {
8448     *size = arr ? arr->UPB_PRIVATE(size) : 0;
8449   }
8450   return arr;
8451 }
_google_protobuf_ServiceDescriptorProto_method_mutable_upb_array(google_protobuf_ServiceDescriptorProto * msg,size_t * size,upb_Arena * arena)8452 UPB_INLINE upb_Array* _google_protobuf_ServiceDescriptorProto_method_mutable_upb_array(google_protobuf_ServiceDescriptorProto* msg, size_t* size, upb_Arena* arena) {
8453   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)};
8454   UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__MethodDescriptorProto_msg_init);
8455   upb_Array* arr = upb_Message_GetOrCreateMutableArray(UPB_UPCAST(msg),
8456                                                        &field, arena);
8457   if (size) {
8458     *size = arr ? arr->UPB_PRIVATE(size) : 0;
8459   }
8460   return arr;
8461 }
google_protobuf_ServiceDescriptorProto_clear_options(google_protobuf_ServiceDescriptorProto * msg)8462 UPB_INLINE void google_protobuf_ServiceDescriptorProto_clear_options(google_protobuf_ServiceDescriptorProto* msg) {
8463   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)};
8464   upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
8465 }
google_protobuf_ServiceDescriptorProto_options(const google_protobuf_ServiceDescriptorProto * msg)8466 UPB_INLINE const google_protobuf_ServiceOptions* google_protobuf_ServiceDescriptorProto_options(const google_protobuf_ServiceDescriptorProto* msg) {
8467   const google_protobuf_ServiceOptions* default_val = NULL;
8468   const google_protobuf_ServiceOptions* ret;
8469   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)};
8470   UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__ServiceOptions_msg_init);
8471   _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field,
8472                                     &default_val, &ret);
8473   return ret;
8474 }
google_protobuf_ServiceDescriptorProto_has_options(const google_protobuf_ServiceDescriptorProto * msg)8475 UPB_INLINE bool google_protobuf_ServiceDescriptorProto_has_options(const google_protobuf_ServiceDescriptorProto* msg) {
8476   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)};
8477   return upb_Message_HasBaseField(UPB_UPCAST(msg), &field);
8478 }
8479 
google_protobuf_ServiceDescriptorProto_set_name(google_protobuf_ServiceDescriptorProto * msg,upb_StringView value)8480 UPB_INLINE void google_protobuf_ServiceDescriptorProto_set_name(google_protobuf_ServiceDescriptorProto *msg, upb_StringView value) {
8481   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)};
8482   upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
8483 }
google_protobuf_ServiceDescriptorProto_mutable_method(google_protobuf_ServiceDescriptorProto * msg,size_t * size)8484 UPB_INLINE google_protobuf_MethodDescriptorProto** google_protobuf_ServiceDescriptorProto_mutable_method(google_protobuf_ServiceDescriptorProto* msg, size_t* size) {
8485   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)};
8486   UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__MethodDescriptorProto_msg_init);
8487   upb_Array* arr = upb_Message_GetMutableArray(UPB_UPCAST(msg), &field);
8488   if (arr) {
8489     if (size) *size = arr->UPB_PRIVATE(size);
8490     return (google_protobuf_MethodDescriptorProto**)upb_Array_MutableDataPtr(arr);
8491   } else {
8492     if (size) *size = 0;
8493     return NULL;
8494   }
8495 }
google_protobuf_ServiceDescriptorProto_resize_method(google_protobuf_ServiceDescriptorProto * msg,size_t size,upb_Arena * arena)8496 UPB_INLINE google_protobuf_MethodDescriptorProto** google_protobuf_ServiceDescriptorProto_resize_method(google_protobuf_ServiceDescriptorProto* msg, size_t size, upb_Arena* arena) {
8497   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)};
8498   return (google_protobuf_MethodDescriptorProto**)upb_Message_ResizeArrayUninitialized(UPB_UPCAST(msg),
8499                                                    &field, size, arena);
8500 }
google_protobuf_ServiceDescriptorProto_add_method(google_protobuf_ServiceDescriptorProto * msg,upb_Arena * arena)8501 UPB_INLINE struct google_protobuf_MethodDescriptorProto* google_protobuf_ServiceDescriptorProto_add_method(google_protobuf_ServiceDescriptorProto* msg, upb_Arena* arena) {
8502   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)};
8503   UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__MethodDescriptorProto_msg_init);
8504   upb_Array* arr = upb_Message_GetOrCreateMutableArray(
8505       UPB_UPCAST(msg), &field, arena);
8506   if (!arr || !UPB_PRIVATE(_upb_Array_ResizeUninitialized)(
8507                   arr, arr->UPB_PRIVATE(size) + 1, arena)) {
8508     return NULL;
8509   }
8510   struct google_protobuf_MethodDescriptorProto* sub = (struct google_protobuf_MethodDescriptorProto*)_upb_Message_New(&google__protobuf__MethodDescriptorProto_msg_init, arena);
8511   if (!arr || !sub) return NULL;
8512   UPB_PRIVATE(_upb_Array_Set)
8513   (arr, arr->UPB_PRIVATE(size) - 1, &sub, sizeof(sub));
8514   return sub;
8515 }
google_protobuf_ServiceDescriptorProto_set_options(google_protobuf_ServiceDescriptorProto * msg,google_protobuf_ServiceOptions * value)8516 UPB_INLINE void google_protobuf_ServiceDescriptorProto_set_options(google_protobuf_ServiceDescriptorProto *msg, google_protobuf_ServiceOptions* value) {
8517   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)};
8518   UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__ServiceOptions_msg_init);
8519   upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
8520 }
google_protobuf_ServiceDescriptorProto_mutable_options(google_protobuf_ServiceDescriptorProto * msg,upb_Arena * arena)8521 UPB_INLINE struct google_protobuf_ServiceOptions* google_protobuf_ServiceDescriptorProto_mutable_options(google_protobuf_ServiceDescriptorProto* msg, upb_Arena* arena) {
8522   struct google_protobuf_ServiceOptions* sub = (struct google_protobuf_ServiceOptions*)google_protobuf_ServiceDescriptorProto_options(msg);
8523   if (sub == NULL) {
8524     sub = (struct google_protobuf_ServiceOptions*)_upb_Message_New(&google__protobuf__ServiceOptions_msg_init, arena);
8525     if (sub) google_protobuf_ServiceDescriptorProto_set_options(msg, sub);
8526   }
8527   return sub;
8528 }
8529 
8530 /* google.protobuf.MethodDescriptorProto */
8531 
google_protobuf_MethodDescriptorProto_new(upb_Arena * arena)8532 UPB_INLINE google_protobuf_MethodDescriptorProto* google_protobuf_MethodDescriptorProto_new(upb_Arena* arena) {
8533   return (google_protobuf_MethodDescriptorProto*)_upb_Message_New(&google__protobuf__MethodDescriptorProto_msg_init, arena);
8534 }
google_protobuf_MethodDescriptorProto_parse(const char * buf,size_t size,upb_Arena * arena)8535 UPB_INLINE google_protobuf_MethodDescriptorProto* google_protobuf_MethodDescriptorProto_parse(const char* buf, size_t size, upb_Arena* arena) {
8536   google_protobuf_MethodDescriptorProto* ret = google_protobuf_MethodDescriptorProto_new(arena);
8537   if (!ret) return NULL;
8538   if (upb_Decode(buf, size, UPB_UPCAST(ret), &google__protobuf__MethodDescriptorProto_msg_init, NULL, 0, arena) !=
8539       kUpb_DecodeStatus_Ok) {
8540     return NULL;
8541   }
8542   return ret;
8543 }
google_protobuf_MethodDescriptorProto_parse_ex(const char * buf,size_t size,const upb_ExtensionRegistry * extreg,int options,upb_Arena * arena)8544 UPB_INLINE google_protobuf_MethodDescriptorProto* google_protobuf_MethodDescriptorProto_parse_ex(const char* buf, size_t size,
8545                            const upb_ExtensionRegistry* extreg,
8546                            int options, upb_Arena* arena) {
8547   google_protobuf_MethodDescriptorProto* ret = google_protobuf_MethodDescriptorProto_new(arena);
8548   if (!ret) return NULL;
8549   if (upb_Decode(buf, size, UPB_UPCAST(ret), &google__protobuf__MethodDescriptorProto_msg_init, extreg, options,
8550                  arena) != kUpb_DecodeStatus_Ok) {
8551     return NULL;
8552   }
8553   return ret;
8554 }
google_protobuf_MethodDescriptorProto_serialize(const google_protobuf_MethodDescriptorProto * msg,upb_Arena * arena,size_t * len)8555 UPB_INLINE char* google_protobuf_MethodDescriptorProto_serialize(const google_protobuf_MethodDescriptorProto* msg, upb_Arena* arena, size_t* len) {
8556   char* ptr;
8557   (void)upb_Encode(UPB_UPCAST(msg), &google__protobuf__MethodDescriptorProto_msg_init, 0, arena, &ptr, len);
8558   return ptr;
8559 }
google_protobuf_MethodDescriptorProto_serialize_ex(const google_protobuf_MethodDescriptorProto * msg,int options,upb_Arena * arena,size_t * len)8560 UPB_INLINE char* google_protobuf_MethodDescriptorProto_serialize_ex(const google_protobuf_MethodDescriptorProto* msg, int options,
8561                                  upb_Arena* arena, size_t* len) {
8562   char* ptr;
8563   (void)upb_Encode(UPB_UPCAST(msg), &google__protobuf__MethodDescriptorProto_msg_init, options, arena, &ptr, len);
8564   return ptr;
8565 }
google_protobuf_MethodDescriptorProto_clear_name(google_protobuf_MethodDescriptorProto * msg)8566 UPB_INLINE void google_protobuf_MethodDescriptorProto_clear_name(google_protobuf_MethodDescriptorProto* msg) {
8567   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)};
8568   upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
8569 }
google_protobuf_MethodDescriptorProto_name(const google_protobuf_MethodDescriptorProto * msg)8570 UPB_INLINE upb_StringView google_protobuf_MethodDescriptorProto_name(const google_protobuf_MethodDescriptorProto* msg) {
8571   upb_StringView default_val = upb_StringView_FromString("");
8572   upb_StringView ret;
8573   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)};
8574   _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field,
8575                                     &default_val, &ret);
8576   return ret;
8577 }
google_protobuf_MethodDescriptorProto_has_name(const google_protobuf_MethodDescriptorProto * msg)8578 UPB_INLINE bool google_protobuf_MethodDescriptorProto_has_name(const google_protobuf_MethodDescriptorProto* msg) {
8579   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)};
8580   return upb_Message_HasBaseField(UPB_UPCAST(msg), &field);
8581 }
google_protobuf_MethodDescriptorProto_clear_input_type(google_protobuf_MethodDescriptorProto * msg)8582 UPB_INLINE void google_protobuf_MethodDescriptorProto_clear_input_type(google_protobuf_MethodDescriptorProto* msg) {
8583   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)};
8584   upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
8585 }
google_protobuf_MethodDescriptorProto_input_type(const google_protobuf_MethodDescriptorProto * msg)8586 UPB_INLINE upb_StringView google_protobuf_MethodDescriptorProto_input_type(const google_protobuf_MethodDescriptorProto* msg) {
8587   upb_StringView default_val = upb_StringView_FromString("");
8588   upb_StringView ret;
8589   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)};
8590   _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field,
8591                                     &default_val, &ret);
8592   return ret;
8593 }
google_protobuf_MethodDescriptorProto_has_input_type(const google_protobuf_MethodDescriptorProto * msg)8594 UPB_INLINE bool google_protobuf_MethodDescriptorProto_has_input_type(const google_protobuf_MethodDescriptorProto* msg) {
8595   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)};
8596   return upb_Message_HasBaseField(UPB_UPCAST(msg), &field);
8597 }
google_protobuf_MethodDescriptorProto_clear_output_type(google_protobuf_MethodDescriptorProto * msg)8598 UPB_INLINE void google_protobuf_MethodDescriptorProto_clear_output_type(google_protobuf_MethodDescriptorProto* msg) {
8599   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)};
8600   upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
8601 }
google_protobuf_MethodDescriptorProto_output_type(const google_protobuf_MethodDescriptorProto * msg)8602 UPB_INLINE upb_StringView google_protobuf_MethodDescriptorProto_output_type(const google_protobuf_MethodDescriptorProto* msg) {
8603   upb_StringView default_val = upb_StringView_FromString("");
8604   upb_StringView ret;
8605   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)};
8606   _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field,
8607                                     &default_val, &ret);
8608   return ret;
8609 }
google_protobuf_MethodDescriptorProto_has_output_type(const google_protobuf_MethodDescriptorProto * msg)8610 UPB_INLINE bool google_protobuf_MethodDescriptorProto_has_output_type(const google_protobuf_MethodDescriptorProto* msg) {
8611   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)};
8612   return upb_Message_HasBaseField(UPB_UPCAST(msg), &field);
8613 }
google_protobuf_MethodDescriptorProto_clear_options(google_protobuf_MethodDescriptorProto * msg)8614 UPB_INLINE void google_protobuf_MethodDescriptorProto_clear_options(google_protobuf_MethodDescriptorProto* msg) {
8615   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)};
8616   upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
8617 }
google_protobuf_MethodDescriptorProto_options(const google_protobuf_MethodDescriptorProto * msg)8618 UPB_INLINE const google_protobuf_MethodOptions* google_protobuf_MethodDescriptorProto_options(const google_protobuf_MethodDescriptorProto* msg) {
8619   const google_protobuf_MethodOptions* default_val = NULL;
8620   const google_protobuf_MethodOptions* ret;
8621   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)};
8622   UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__MethodOptions_msg_init);
8623   _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field,
8624                                     &default_val, &ret);
8625   return ret;
8626 }
google_protobuf_MethodDescriptorProto_has_options(const google_protobuf_MethodDescriptorProto * msg)8627 UPB_INLINE bool google_protobuf_MethodDescriptorProto_has_options(const google_protobuf_MethodDescriptorProto* msg) {
8628   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)};
8629   return upb_Message_HasBaseField(UPB_UPCAST(msg), &field);
8630 }
google_protobuf_MethodDescriptorProto_clear_client_streaming(google_protobuf_MethodDescriptorProto * msg)8631 UPB_INLINE void google_protobuf_MethodDescriptorProto_clear_client_streaming(google_protobuf_MethodDescriptorProto* msg) {
8632   const upb_MiniTableField field = {5, UPB_SIZE(16, 9), 68, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
8633   upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
8634 }
google_protobuf_MethodDescriptorProto_client_streaming(const google_protobuf_MethodDescriptorProto * msg)8635 UPB_INLINE bool google_protobuf_MethodDescriptorProto_client_streaming(const google_protobuf_MethodDescriptorProto* msg) {
8636   bool default_val = false;
8637   bool ret;
8638   const upb_MiniTableField field = {5, UPB_SIZE(16, 9), 68, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
8639   _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field,
8640                                     &default_val, &ret);
8641   return ret;
8642 }
google_protobuf_MethodDescriptorProto_has_client_streaming(const google_protobuf_MethodDescriptorProto * msg)8643 UPB_INLINE bool google_protobuf_MethodDescriptorProto_has_client_streaming(const google_protobuf_MethodDescriptorProto* msg) {
8644   const upb_MiniTableField field = {5, UPB_SIZE(16, 9), 68, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
8645   return upb_Message_HasBaseField(UPB_UPCAST(msg), &field);
8646 }
google_protobuf_MethodDescriptorProto_clear_server_streaming(google_protobuf_MethodDescriptorProto * msg)8647 UPB_INLINE void google_protobuf_MethodDescriptorProto_clear_server_streaming(google_protobuf_MethodDescriptorProto* msg) {
8648   const upb_MiniTableField field = {6, UPB_SIZE(17, 10), 69, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
8649   upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
8650 }
google_protobuf_MethodDescriptorProto_server_streaming(const google_protobuf_MethodDescriptorProto * msg)8651 UPB_INLINE bool google_protobuf_MethodDescriptorProto_server_streaming(const google_protobuf_MethodDescriptorProto* msg) {
8652   bool default_val = false;
8653   bool ret;
8654   const upb_MiniTableField field = {6, UPB_SIZE(17, 10), 69, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
8655   _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field,
8656                                     &default_val, &ret);
8657   return ret;
8658 }
google_protobuf_MethodDescriptorProto_has_server_streaming(const google_protobuf_MethodDescriptorProto * msg)8659 UPB_INLINE bool google_protobuf_MethodDescriptorProto_has_server_streaming(const google_protobuf_MethodDescriptorProto* msg) {
8660   const upb_MiniTableField field = {6, UPB_SIZE(17, 10), 69, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
8661   return upb_Message_HasBaseField(UPB_UPCAST(msg), &field);
8662 }
8663 
google_protobuf_MethodDescriptorProto_set_name(google_protobuf_MethodDescriptorProto * msg,upb_StringView value)8664 UPB_INLINE void google_protobuf_MethodDescriptorProto_set_name(google_protobuf_MethodDescriptorProto *msg, upb_StringView value) {
8665   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)};
8666   upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
8667 }
google_protobuf_MethodDescriptorProto_set_input_type(google_protobuf_MethodDescriptorProto * msg,upb_StringView value)8668 UPB_INLINE void google_protobuf_MethodDescriptorProto_set_input_type(google_protobuf_MethodDescriptorProto *msg, upb_StringView value) {
8669   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)};
8670   upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
8671 }
google_protobuf_MethodDescriptorProto_set_output_type(google_protobuf_MethodDescriptorProto * msg,upb_StringView value)8672 UPB_INLINE void google_protobuf_MethodDescriptorProto_set_output_type(google_protobuf_MethodDescriptorProto *msg, upb_StringView value) {
8673   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)};
8674   upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
8675 }
google_protobuf_MethodDescriptorProto_set_options(google_protobuf_MethodDescriptorProto * msg,google_protobuf_MethodOptions * value)8676 UPB_INLINE void google_protobuf_MethodDescriptorProto_set_options(google_protobuf_MethodDescriptorProto *msg, google_protobuf_MethodOptions* value) {
8677   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)};
8678   UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__MethodOptions_msg_init);
8679   upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
8680 }
google_protobuf_MethodDescriptorProto_mutable_options(google_protobuf_MethodDescriptorProto * msg,upb_Arena * arena)8681 UPB_INLINE struct google_protobuf_MethodOptions* google_protobuf_MethodDescriptorProto_mutable_options(google_protobuf_MethodDescriptorProto* msg, upb_Arena* arena) {
8682   struct google_protobuf_MethodOptions* sub = (struct google_protobuf_MethodOptions*)google_protobuf_MethodDescriptorProto_options(msg);
8683   if (sub == NULL) {
8684     sub = (struct google_protobuf_MethodOptions*)_upb_Message_New(&google__protobuf__MethodOptions_msg_init, arena);
8685     if (sub) google_protobuf_MethodDescriptorProto_set_options(msg, sub);
8686   }
8687   return sub;
8688 }
google_protobuf_MethodDescriptorProto_set_client_streaming(google_protobuf_MethodDescriptorProto * msg,bool value)8689 UPB_INLINE void google_protobuf_MethodDescriptorProto_set_client_streaming(google_protobuf_MethodDescriptorProto *msg, bool value) {
8690   const upb_MiniTableField field = {5, UPB_SIZE(16, 9), 68, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
8691   upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
8692 }
google_protobuf_MethodDescriptorProto_set_server_streaming(google_protobuf_MethodDescriptorProto * msg,bool value)8693 UPB_INLINE void google_protobuf_MethodDescriptorProto_set_server_streaming(google_protobuf_MethodDescriptorProto *msg, bool value) {
8694   const upb_MiniTableField field = {6, UPB_SIZE(17, 10), 69, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
8695   upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
8696 }
8697 
8698 /* google.protobuf.FileOptions */
8699 
google_protobuf_FileOptions_new(upb_Arena * arena)8700 UPB_INLINE google_protobuf_FileOptions* google_protobuf_FileOptions_new(upb_Arena* arena) {
8701   return (google_protobuf_FileOptions*)_upb_Message_New(&google__protobuf__FileOptions_msg_init, arena);
8702 }
google_protobuf_FileOptions_parse(const char * buf,size_t size,upb_Arena * arena)8703 UPB_INLINE google_protobuf_FileOptions* google_protobuf_FileOptions_parse(const char* buf, size_t size, upb_Arena* arena) {
8704   google_protobuf_FileOptions* ret = google_protobuf_FileOptions_new(arena);
8705   if (!ret) return NULL;
8706   if (upb_Decode(buf, size, UPB_UPCAST(ret), &google__protobuf__FileOptions_msg_init, NULL, 0, arena) !=
8707       kUpb_DecodeStatus_Ok) {
8708     return NULL;
8709   }
8710   return ret;
8711 }
google_protobuf_FileOptions_parse_ex(const char * buf,size_t size,const upb_ExtensionRegistry * extreg,int options,upb_Arena * arena)8712 UPB_INLINE google_protobuf_FileOptions* google_protobuf_FileOptions_parse_ex(const char* buf, size_t size,
8713                            const upb_ExtensionRegistry* extreg,
8714                            int options, upb_Arena* arena) {
8715   google_protobuf_FileOptions* ret = google_protobuf_FileOptions_new(arena);
8716   if (!ret) return NULL;
8717   if (upb_Decode(buf, size, UPB_UPCAST(ret), &google__protobuf__FileOptions_msg_init, extreg, options,
8718                  arena) != kUpb_DecodeStatus_Ok) {
8719     return NULL;
8720   }
8721   return ret;
8722 }
google_protobuf_FileOptions_serialize(const google_protobuf_FileOptions * msg,upb_Arena * arena,size_t * len)8723 UPB_INLINE char* google_protobuf_FileOptions_serialize(const google_protobuf_FileOptions* msg, upb_Arena* arena, size_t* len) {
8724   char* ptr;
8725   (void)upb_Encode(UPB_UPCAST(msg), &google__protobuf__FileOptions_msg_init, 0, arena, &ptr, len);
8726   return ptr;
8727 }
google_protobuf_FileOptions_serialize_ex(const google_protobuf_FileOptions * msg,int options,upb_Arena * arena,size_t * len)8728 UPB_INLINE char* google_protobuf_FileOptions_serialize_ex(const google_protobuf_FileOptions* msg, int options,
8729                                  upb_Arena* arena, size_t* len) {
8730   char* ptr;
8731   (void)upb_Encode(UPB_UPCAST(msg), &google__protobuf__FileOptions_msg_init, options, arena, &ptr, len);
8732   return ptr;
8733 }
google_protobuf_FileOptions_clear_java_package(google_protobuf_FileOptions * msg)8734 UPB_INLINE void google_protobuf_FileOptions_clear_java_package(google_protobuf_FileOptions* msg) {
8735   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)};
8736   upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
8737 }
google_protobuf_FileOptions_java_package(const google_protobuf_FileOptions * msg)8738 UPB_INLINE upb_StringView google_protobuf_FileOptions_java_package(const google_protobuf_FileOptions* msg) {
8739   upb_StringView default_val = upb_StringView_FromString("");
8740   upb_StringView ret;
8741   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)};
8742   _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field,
8743                                     &default_val, &ret);
8744   return ret;
8745 }
google_protobuf_FileOptions_has_java_package(const google_protobuf_FileOptions * msg)8746 UPB_INLINE bool google_protobuf_FileOptions_has_java_package(const google_protobuf_FileOptions* msg) {
8747   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)};
8748   return upb_Message_HasBaseField(UPB_UPCAST(msg), &field);
8749 }
google_protobuf_FileOptions_clear_java_outer_classname(google_protobuf_FileOptions * msg)8750 UPB_INLINE void google_protobuf_FileOptions_clear_java_outer_classname(google_protobuf_FileOptions* msg) {
8751   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)};
8752   upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
8753 }
google_protobuf_FileOptions_java_outer_classname(const google_protobuf_FileOptions * msg)8754 UPB_INLINE upb_StringView google_protobuf_FileOptions_java_outer_classname(const google_protobuf_FileOptions* msg) {
8755   upb_StringView default_val = upb_StringView_FromString("");
8756   upb_StringView ret;
8757   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)};
8758   _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field,
8759                                     &default_val, &ret);
8760   return ret;
8761 }
google_protobuf_FileOptions_has_java_outer_classname(const google_protobuf_FileOptions * msg)8762 UPB_INLINE bool google_protobuf_FileOptions_has_java_outer_classname(const google_protobuf_FileOptions* msg) {
8763   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)};
8764   return upb_Message_HasBaseField(UPB_UPCAST(msg), &field);
8765 }
google_protobuf_FileOptions_clear_optimize_for(google_protobuf_FileOptions * msg)8766 UPB_INLINE void google_protobuf_FileOptions_clear_optimize_for(google_protobuf_FileOptions* msg) {
8767   const upb_MiniTableField field = {9, 12, 66, 2, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
8768   upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
8769 }
google_protobuf_FileOptions_optimize_for(const google_protobuf_FileOptions * msg)8770 UPB_INLINE int32_t google_protobuf_FileOptions_optimize_for(const google_protobuf_FileOptions* msg) {
8771   int32_t default_val = 1;
8772   int32_t ret;
8773   const upb_MiniTableField field = {9, 12, 66, 2, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
8774   _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field,
8775                                     &default_val, &ret);
8776   return ret;
8777 }
google_protobuf_FileOptions_has_optimize_for(const google_protobuf_FileOptions * msg)8778 UPB_INLINE bool google_protobuf_FileOptions_has_optimize_for(const google_protobuf_FileOptions* msg) {
8779   const upb_MiniTableField field = {9, 12, 66, 2, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
8780   return upb_Message_HasBaseField(UPB_UPCAST(msg), &field);
8781 }
google_protobuf_FileOptions_clear_java_multiple_files(google_protobuf_FileOptions * msg)8782 UPB_INLINE void google_protobuf_FileOptions_clear_java_multiple_files(google_protobuf_FileOptions* msg) {
8783   const upb_MiniTableField field = {10, 16, 67, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
8784   upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
8785 }
google_protobuf_FileOptions_java_multiple_files(const google_protobuf_FileOptions * msg)8786 UPB_INLINE bool google_protobuf_FileOptions_java_multiple_files(const google_protobuf_FileOptions* msg) {
8787   bool default_val = false;
8788   bool ret;
8789   const upb_MiniTableField field = {10, 16, 67, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
8790   _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field,
8791                                     &default_val, &ret);
8792   return ret;
8793 }
google_protobuf_FileOptions_has_java_multiple_files(const google_protobuf_FileOptions * msg)8794 UPB_INLINE bool google_protobuf_FileOptions_has_java_multiple_files(const google_protobuf_FileOptions* msg) {
8795   const upb_MiniTableField field = {10, 16, 67, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
8796   return upb_Message_HasBaseField(UPB_UPCAST(msg), &field);
8797 }
google_protobuf_FileOptions_clear_go_package(google_protobuf_FileOptions * msg)8798 UPB_INLINE void google_protobuf_FileOptions_clear_go_package(google_protobuf_FileOptions* msg) {
8799   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)};
8800   upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
8801 }
google_protobuf_FileOptions_go_package(const google_protobuf_FileOptions * msg)8802 UPB_INLINE upb_StringView google_protobuf_FileOptions_go_package(const google_protobuf_FileOptions* msg) {
8803   upb_StringView default_val = upb_StringView_FromString("");
8804   upb_StringView ret;
8805   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)};
8806   _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field,
8807                                     &default_val, &ret);
8808   return ret;
8809 }
google_protobuf_FileOptions_has_go_package(const google_protobuf_FileOptions * msg)8810 UPB_INLINE bool google_protobuf_FileOptions_has_go_package(const google_protobuf_FileOptions* msg) {
8811   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)};
8812   return upb_Message_HasBaseField(UPB_UPCAST(msg), &field);
8813 }
google_protobuf_FileOptions_clear_cc_generic_services(google_protobuf_FileOptions * msg)8814 UPB_INLINE void google_protobuf_FileOptions_clear_cc_generic_services(google_protobuf_FileOptions* msg) {
8815   const upb_MiniTableField field = {16, 17, 69, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
8816   upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
8817 }
google_protobuf_FileOptions_cc_generic_services(const google_protobuf_FileOptions * msg)8818 UPB_INLINE bool google_protobuf_FileOptions_cc_generic_services(const google_protobuf_FileOptions* msg) {
8819   bool default_val = false;
8820   bool ret;
8821   const upb_MiniTableField field = {16, 17, 69, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
8822   _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field,
8823                                     &default_val, &ret);
8824   return ret;
8825 }
google_protobuf_FileOptions_has_cc_generic_services(const google_protobuf_FileOptions * msg)8826 UPB_INLINE bool google_protobuf_FileOptions_has_cc_generic_services(const google_protobuf_FileOptions* msg) {
8827   const upb_MiniTableField field = {16, 17, 69, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
8828   return upb_Message_HasBaseField(UPB_UPCAST(msg), &field);
8829 }
google_protobuf_FileOptions_clear_java_generic_services(google_protobuf_FileOptions * msg)8830 UPB_INLINE void google_protobuf_FileOptions_clear_java_generic_services(google_protobuf_FileOptions* msg) {
8831   const upb_MiniTableField field = {17, 18, 70, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
8832   upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
8833 }
google_protobuf_FileOptions_java_generic_services(const google_protobuf_FileOptions * msg)8834 UPB_INLINE bool google_protobuf_FileOptions_java_generic_services(const google_protobuf_FileOptions* msg) {
8835   bool default_val = false;
8836   bool ret;
8837   const upb_MiniTableField field = {17, 18, 70, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
8838   _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field,
8839                                     &default_val, &ret);
8840   return ret;
8841 }
google_protobuf_FileOptions_has_java_generic_services(const google_protobuf_FileOptions * msg)8842 UPB_INLINE bool google_protobuf_FileOptions_has_java_generic_services(const google_protobuf_FileOptions* msg) {
8843   const upb_MiniTableField field = {17, 18, 70, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
8844   return upb_Message_HasBaseField(UPB_UPCAST(msg), &field);
8845 }
google_protobuf_FileOptions_clear_py_generic_services(google_protobuf_FileOptions * msg)8846 UPB_INLINE void google_protobuf_FileOptions_clear_py_generic_services(google_protobuf_FileOptions* msg) {
8847   const upb_MiniTableField field = {18, 19, 71, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
8848   upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
8849 }
google_protobuf_FileOptions_py_generic_services(const google_protobuf_FileOptions * msg)8850 UPB_INLINE bool google_protobuf_FileOptions_py_generic_services(const google_protobuf_FileOptions* msg) {
8851   bool default_val = false;
8852   bool ret;
8853   const upb_MiniTableField field = {18, 19, 71, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
8854   _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field,
8855                                     &default_val, &ret);
8856   return ret;
8857 }
google_protobuf_FileOptions_has_py_generic_services(const google_protobuf_FileOptions * msg)8858 UPB_INLINE bool google_protobuf_FileOptions_has_py_generic_services(const google_protobuf_FileOptions* msg) {
8859   const upb_MiniTableField field = {18, 19, 71, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
8860   return upb_Message_HasBaseField(UPB_UPCAST(msg), &field);
8861 }
google_protobuf_FileOptions_clear_java_generate_equals_and_hash(google_protobuf_FileOptions * msg)8862 UPB_INLINE void google_protobuf_FileOptions_clear_java_generate_equals_and_hash(google_protobuf_FileOptions* msg) {
8863   const upb_MiniTableField field = {20, 20, 72, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
8864   upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
8865 }
google_protobuf_FileOptions_java_generate_equals_and_hash(const google_protobuf_FileOptions * msg)8866 UPB_INLINE bool google_protobuf_FileOptions_java_generate_equals_and_hash(const google_protobuf_FileOptions* msg) {
8867   bool default_val = false;
8868   bool ret;
8869   const upb_MiniTableField field = {20, 20, 72, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
8870   _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field,
8871                                     &default_val, &ret);
8872   return ret;
8873 }
google_protobuf_FileOptions_has_java_generate_equals_and_hash(const google_protobuf_FileOptions * msg)8874 UPB_INLINE bool google_protobuf_FileOptions_has_java_generate_equals_and_hash(const google_protobuf_FileOptions* msg) {
8875   const upb_MiniTableField field = {20, 20, 72, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
8876   return upb_Message_HasBaseField(UPB_UPCAST(msg), &field);
8877 }
google_protobuf_FileOptions_clear_deprecated(google_protobuf_FileOptions * msg)8878 UPB_INLINE void google_protobuf_FileOptions_clear_deprecated(google_protobuf_FileOptions* msg) {
8879   const upb_MiniTableField field = {23, 21, 73, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
8880   upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
8881 }
google_protobuf_FileOptions_deprecated(const google_protobuf_FileOptions * msg)8882 UPB_INLINE bool google_protobuf_FileOptions_deprecated(const google_protobuf_FileOptions* msg) {
8883   bool default_val = false;
8884   bool ret;
8885   const upb_MiniTableField field = {23, 21, 73, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
8886   _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field,
8887                                     &default_val, &ret);
8888   return ret;
8889 }
google_protobuf_FileOptions_has_deprecated(const google_protobuf_FileOptions * msg)8890 UPB_INLINE bool google_protobuf_FileOptions_has_deprecated(const google_protobuf_FileOptions* msg) {
8891   const upb_MiniTableField field = {23, 21, 73, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
8892   return upb_Message_HasBaseField(UPB_UPCAST(msg), &field);
8893 }
google_protobuf_FileOptions_clear_java_string_check_utf8(google_protobuf_FileOptions * msg)8894 UPB_INLINE void google_protobuf_FileOptions_clear_java_string_check_utf8(google_protobuf_FileOptions* msg) {
8895   const upb_MiniTableField field = {27, 22, 74, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
8896   upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
8897 }
google_protobuf_FileOptions_java_string_check_utf8(const google_protobuf_FileOptions * msg)8898 UPB_INLINE bool google_protobuf_FileOptions_java_string_check_utf8(const google_protobuf_FileOptions* msg) {
8899   bool default_val = false;
8900   bool ret;
8901   const upb_MiniTableField field = {27, 22, 74, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
8902   _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field,
8903                                     &default_val, &ret);
8904   return ret;
8905 }
google_protobuf_FileOptions_has_java_string_check_utf8(const google_protobuf_FileOptions * msg)8906 UPB_INLINE bool google_protobuf_FileOptions_has_java_string_check_utf8(const google_protobuf_FileOptions* msg) {
8907   const upb_MiniTableField field = {27, 22, 74, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
8908   return upb_Message_HasBaseField(UPB_UPCAST(msg), &field);
8909 }
google_protobuf_FileOptions_clear_cc_enable_arenas(google_protobuf_FileOptions * msg)8910 UPB_INLINE void google_protobuf_FileOptions_clear_cc_enable_arenas(google_protobuf_FileOptions* msg) {
8911   const upb_MiniTableField field = {31, 23, 75, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
8912   upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
8913 }
google_protobuf_FileOptions_cc_enable_arenas(const google_protobuf_FileOptions * msg)8914 UPB_INLINE bool google_protobuf_FileOptions_cc_enable_arenas(const google_protobuf_FileOptions* msg) {
8915   bool default_val = true;
8916   bool ret;
8917   const upb_MiniTableField field = {31, 23, 75, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
8918   _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field,
8919                                     &default_val, &ret);
8920   return ret;
8921 }
google_protobuf_FileOptions_has_cc_enable_arenas(const google_protobuf_FileOptions * msg)8922 UPB_INLINE bool google_protobuf_FileOptions_has_cc_enable_arenas(const google_protobuf_FileOptions* msg) {
8923   const upb_MiniTableField field = {31, 23, 75, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
8924   return upb_Message_HasBaseField(UPB_UPCAST(msg), &field);
8925 }
google_protobuf_FileOptions_clear_objc_class_prefix(google_protobuf_FileOptions * msg)8926 UPB_INLINE void google_protobuf_FileOptions_clear_objc_class_prefix(google_protobuf_FileOptions* msg) {
8927   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)};
8928   upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
8929 }
google_protobuf_FileOptions_objc_class_prefix(const google_protobuf_FileOptions * msg)8930 UPB_INLINE upb_StringView google_protobuf_FileOptions_objc_class_prefix(const google_protobuf_FileOptions* msg) {
8931   upb_StringView default_val = upb_StringView_FromString("");
8932   upb_StringView ret;
8933   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)};
8934   _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field,
8935                                     &default_val, &ret);
8936   return ret;
8937 }
google_protobuf_FileOptions_has_objc_class_prefix(const google_protobuf_FileOptions * msg)8938 UPB_INLINE bool google_protobuf_FileOptions_has_objc_class_prefix(const google_protobuf_FileOptions* msg) {
8939   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)};
8940   return upb_Message_HasBaseField(UPB_UPCAST(msg), &field);
8941 }
google_protobuf_FileOptions_clear_csharp_namespace(google_protobuf_FileOptions * msg)8942 UPB_INLINE void google_protobuf_FileOptions_clear_csharp_namespace(google_protobuf_FileOptions* msg) {
8943   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)};
8944   upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
8945 }
google_protobuf_FileOptions_csharp_namespace(const google_protobuf_FileOptions * msg)8946 UPB_INLINE upb_StringView google_protobuf_FileOptions_csharp_namespace(const google_protobuf_FileOptions* msg) {
8947   upb_StringView default_val = upb_StringView_FromString("");
8948   upb_StringView ret;
8949   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)};
8950   _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field,
8951                                     &default_val, &ret);
8952   return ret;
8953 }
google_protobuf_FileOptions_has_csharp_namespace(const google_protobuf_FileOptions * msg)8954 UPB_INLINE bool google_protobuf_FileOptions_has_csharp_namespace(const google_protobuf_FileOptions* msg) {
8955   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)};
8956   return upb_Message_HasBaseField(UPB_UPCAST(msg), &field);
8957 }
google_protobuf_FileOptions_clear_swift_prefix(google_protobuf_FileOptions * msg)8958 UPB_INLINE void google_protobuf_FileOptions_clear_swift_prefix(google_protobuf_FileOptions* msg) {
8959   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)};
8960   upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
8961 }
google_protobuf_FileOptions_swift_prefix(const google_protobuf_FileOptions * msg)8962 UPB_INLINE upb_StringView google_protobuf_FileOptions_swift_prefix(const google_protobuf_FileOptions* msg) {
8963   upb_StringView default_val = upb_StringView_FromString("");
8964   upb_StringView ret;
8965   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)};
8966   _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field,
8967                                     &default_val, &ret);
8968   return ret;
8969 }
google_protobuf_FileOptions_has_swift_prefix(const google_protobuf_FileOptions * msg)8970 UPB_INLINE bool google_protobuf_FileOptions_has_swift_prefix(const google_protobuf_FileOptions* msg) {
8971   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)};
8972   return upb_Message_HasBaseField(UPB_UPCAST(msg), &field);
8973 }
google_protobuf_FileOptions_clear_php_class_prefix(google_protobuf_FileOptions * msg)8974 UPB_INLINE void google_protobuf_FileOptions_clear_php_class_prefix(google_protobuf_FileOptions* msg) {
8975   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)};
8976   upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
8977 }
google_protobuf_FileOptions_php_class_prefix(const google_protobuf_FileOptions * msg)8978 UPB_INLINE upb_StringView google_protobuf_FileOptions_php_class_prefix(const google_protobuf_FileOptions* msg) {
8979   upb_StringView default_val = upb_StringView_FromString("");
8980   upb_StringView ret;
8981   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)};
8982   _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field,
8983                                     &default_val, &ret);
8984   return ret;
8985 }
google_protobuf_FileOptions_has_php_class_prefix(const google_protobuf_FileOptions * msg)8986 UPB_INLINE bool google_protobuf_FileOptions_has_php_class_prefix(const google_protobuf_FileOptions* msg) {
8987   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)};
8988   return upb_Message_HasBaseField(UPB_UPCAST(msg), &field);
8989 }
google_protobuf_FileOptions_clear_php_namespace(google_protobuf_FileOptions * msg)8990 UPB_INLINE void google_protobuf_FileOptions_clear_php_namespace(google_protobuf_FileOptions* msg) {
8991   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)};
8992   upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
8993 }
google_protobuf_FileOptions_php_namespace(const google_protobuf_FileOptions * msg)8994 UPB_INLINE upb_StringView google_protobuf_FileOptions_php_namespace(const google_protobuf_FileOptions* msg) {
8995   upb_StringView default_val = upb_StringView_FromString("");
8996   upb_StringView ret;
8997   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)};
8998   _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field,
8999                                     &default_val, &ret);
9000   return ret;
9001 }
google_protobuf_FileOptions_has_php_namespace(const google_protobuf_FileOptions * msg)9002 UPB_INLINE bool google_protobuf_FileOptions_has_php_namespace(const google_protobuf_FileOptions* msg) {
9003   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)};
9004   return upb_Message_HasBaseField(UPB_UPCAST(msg), &field);
9005 }
google_protobuf_FileOptions_clear_php_metadata_namespace(google_protobuf_FileOptions * msg)9006 UPB_INLINE void google_protobuf_FileOptions_clear_php_metadata_namespace(google_protobuf_FileOptions* msg) {
9007   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)};
9008   upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
9009 }
google_protobuf_FileOptions_php_metadata_namespace(const google_protobuf_FileOptions * msg)9010 UPB_INLINE upb_StringView google_protobuf_FileOptions_php_metadata_namespace(const google_protobuf_FileOptions* msg) {
9011   upb_StringView default_val = upb_StringView_FromString("");
9012   upb_StringView ret;
9013   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)};
9014   _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field,
9015                                     &default_val, &ret);
9016   return ret;
9017 }
google_protobuf_FileOptions_has_php_metadata_namespace(const google_protobuf_FileOptions * msg)9018 UPB_INLINE bool google_protobuf_FileOptions_has_php_metadata_namespace(const google_protobuf_FileOptions* msg) {
9019   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)};
9020   return upb_Message_HasBaseField(UPB_UPCAST(msg), &field);
9021 }
google_protobuf_FileOptions_clear_ruby_package(google_protobuf_FileOptions * msg)9022 UPB_INLINE void google_protobuf_FileOptions_clear_ruby_package(google_protobuf_FileOptions* msg) {
9023   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)};
9024   upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
9025 }
google_protobuf_FileOptions_ruby_package(const google_protobuf_FileOptions * msg)9026 UPB_INLINE upb_StringView google_protobuf_FileOptions_ruby_package(const google_protobuf_FileOptions* msg) {
9027   upb_StringView default_val = upb_StringView_FromString("");
9028   upb_StringView ret;
9029   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)};
9030   _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field,
9031                                     &default_val, &ret);
9032   return ret;
9033 }
google_protobuf_FileOptions_has_ruby_package(const google_protobuf_FileOptions * msg)9034 UPB_INLINE bool google_protobuf_FileOptions_has_ruby_package(const google_protobuf_FileOptions* msg) {
9035   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)};
9036   return upb_Message_HasBaseField(UPB_UPCAST(msg), &field);
9037 }
google_protobuf_FileOptions_clear_features(google_protobuf_FileOptions * msg)9038 UPB_INLINE void google_protobuf_FileOptions_clear_features(google_protobuf_FileOptions* msg) {
9039   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)};
9040   upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
9041 }
google_protobuf_FileOptions_features(const google_protobuf_FileOptions * msg)9042 UPB_INLINE const google_protobuf_FeatureSet* google_protobuf_FileOptions_features(const google_protobuf_FileOptions* msg) {
9043   const google_protobuf_FeatureSet* default_val = NULL;
9044   const google_protobuf_FeatureSet* ret;
9045   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)};
9046   UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__FeatureSet_msg_init);
9047   _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field,
9048                                     &default_val, &ret);
9049   return ret;
9050 }
google_protobuf_FileOptions_has_features(const google_protobuf_FileOptions * msg)9051 UPB_INLINE bool google_protobuf_FileOptions_has_features(const google_protobuf_FileOptions* msg) {
9052   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)};
9053   return upb_Message_HasBaseField(UPB_UPCAST(msg), &field);
9054 }
google_protobuf_FileOptions_clear_uninterpreted_option(google_protobuf_FileOptions * msg)9055 UPB_INLINE void google_protobuf_FileOptions_clear_uninterpreted_option(google_protobuf_FileOptions* msg) {
9056   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)};
9057   upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
9058 }
google_protobuf_FileOptions_uninterpreted_option(const google_protobuf_FileOptions * msg,size_t * size)9059 UPB_INLINE const google_protobuf_UninterpretedOption* const* google_protobuf_FileOptions_uninterpreted_option(const google_protobuf_FileOptions* msg, size_t* size) {
9060   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)};
9061   UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__UninterpretedOption_msg_init);
9062   const upb_Array* arr = upb_Message_GetArray(UPB_UPCAST(msg), &field);
9063   if (arr) {
9064     if (size) *size = arr->UPB_PRIVATE(size);
9065     return (const google_protobuf_UninterpretedOption* const*)upb_Array_DataPtr(arr);
9066   } else {
9067     if (size) *size = 0;
9068     return NULL;
9069   }
9070 }
_google_protobuf_FileOptions_uninterpreted_option_upb_array(const google_protobuf_FileOptions * msg,size_t * size)9071 UPB_INLINE const upb_Array* _google_protobuf_FileOptions_uninterpreted_option_upb_array(const google_protobuf_FileOptions* msg, size_t* size) {
9072   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)};
9073   UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__UninterpretedOption_msg_init);
9074   const upb_Array* arr = upb_Message_GetArray(UPB_UPCAST(msg), &field);
9075   if (size) {
9076     *size = arr ? arr->UPB_PRIVATE(size) : 0;
9077   }
9078   return arr;
9079 }
_google_protobuf_FileOptions_uninterpreted_option_mutable_upb_array(google_protobuf_FileOptions * msg,size_t * size,upb_Arena * arena)9080 UPB_INLINE upb_Array* _google_protobuf_FileOptions_uninterpreted_option_mutable_upb_array(google_protobuf_FileOptions* msg, size_t* size, upb_Arena* arena) {
9081   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)};
9082   UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__UninterpretedOption_msg_init);
9083   upb_Array* arr = upb_Message_GetOrCreateMutableArray(UPB_UPCAST(msg),
9084                                                        &field, arena);
9085   if (size) {
9086     *size = arr ? arr->UPB_PRIVATE(size) : 0;
9087   }
9088   return arr;
9089 }
9090 
google_protobuf_FileOptions_set_java_package(google_protobuf_FileOptions * msg,upb_StringView value)9091 UPB_INLINE void google_protobuf_FileOptions_set_java_package(google_protobuf_FileOptions *msg, upb_StringView value) {
9092   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)};
9093   upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
9094 }
google_protobuf_FileOptions_set_java_outer_classname(google_protobuf_FileOptions * msg,upb_StringView value)9095 UPB_INLINE void google_protobuf_FileOptions_set_java_outer_classname(google_protobuf_FileOptions *msg, upb_StringView value) {
9096   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)};
9097   upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
9098 }
google_protobuf_FileOptions_set_optimize_for(google_protobuf_FileOptions * msg,int32_t value)9099 UPB_INLINE void google_protobuf_FileOptions_set_optimize_for(google_protobuf_FileOptions *msg, int32_t value) {
9100   const upb_MiniTableField field = {9, 12, 66, 2, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
9101   upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
9102 }
google_protobuf_FileOptions_set_java_multiple_files(google_protobuf_FileOptions * msg,bool value)9103 UPB_INLINE void google_protobuf_FileOptions_set_java_multiple_files(google_protobuf_FileOptions *msg, bool value) {
9104   const upb_MiniTableField field = {10, 16, 67, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
9105   upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
9106 }
google_protobuf_FileOptions_set_go_package(google_protobuf_FileOptions * msg,upb_StringView value)9107 UPB_INLINE void google_protobuf_FileOptions_set_go_package(google_protobuf_FileOptions *msg, upb_StringView value) {
9108   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)};
9109   upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
9110 }
google_protobuf_FileOptions_set_cc_generic_services(google_protobuf_FileOptions * msg,bool value)9111 UPB_INLINE void google_protobuf_FileOptions_set_cc_generic_services(google_protobuf_FileOptions *msg, bool value) {
9112   const upb_MiniTableField field = {16, 17, 69, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
9113   upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
9114 }
google_protobuf_FileOptions_set_java_generic_services(google_protobuf_FileOptions * msg,bool value)9115 UPB_INLINE void google_protobuf_FileOptions_set_java_generic_services(google_protobuf_FileOptions *msg, bool value) {
9116   const upb_MiniTableField field = {17, 18, 70, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
9117   upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
9118 }
google_protobuf_FileOptions_set_py_generic_services(google_protobuf_FileOptions * msg,bool value)9119 UPB_INLINE void google_protobuf_FileOptions_set_py_generic_services(google_protobuf_FileOptions *msg, bool value) {
9120   const upb_MiniTableField field = {18, 19, 71, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
9121   upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
9122 }
google_protobuf_FileOptions_set_java_generate_equals_and_hash(google_protobuf_FileOptions * msg,bool value)9123 UPB_INLINE void google_protobuf_FileOptions_set_java_generate_equals_and_hash(google_protobuf_FileOptions *msg, bool value) {
9124   const upb_MiniTableField field = {20, 20, 72, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
9125   upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
9126 }
google_protobuf_FileOptions_set_deprecated(google_protobuf_FileOptions * msg,bool value)9127 UPB_INLINE void google_protobuf_FileOptions_set_deprecated(google_protobuf_FileOptions *msg, bool value) {
9128   const upb_MiniTableField field = {23, 21, 73, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
9129   upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
9130 }
google_protobuf_FileOptions_set_java_string_check_utf8(google_protobuf_FileOptions * msg,bool value)9131 UPB_INLINE void google_protobuf_FileOptions_set_java_string_check_utf8(google_protobuf_FileOptions *msg, bool value) {
9132   const upb_MiniTableField field = {27, 22, 74, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
9133   upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
9134 }
google_protobuf_FileOptions_set_cc_enable_arenas(google_protobuf_FileOptions * msg,bool value)9135 UPB_INLINE void google_protobuf_FileOptions_set_cc_enable_arenas(google_protobuf_FileOptions *msg, bool value) {
9136   const upb_MiniTableField field = {31, 23, 75, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
9137   upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
9138 }
google_protobuf_FileOptions_set_objc_class_prefix(google_protobuf_FileOptions * msg,upb_StringView value)9139 UPB_INLINE void google_protobuf_FileOptions_set_objc_class_prefix(google_protobuf_FileOptions *msg, upb_StringView value) {
9140   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)};
9141   upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
9142 }
google_protobuf_FileOptions_set_csharp_namespace(google_protobuf_FileOptions * msg,upb_StringView value)9143 UPB_INLINE void google_protobuf_FileOptions_set_csharp_namespace(google_protobuf_FileOptions *msg, upb_StringView value) {
9144   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)};
9145   upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
9146 }
google_protobuf_FileOptions_set_swift_prefix(google_protobuf_FileOptions * msg,upb_StringView value)9147 UPB_INLINE void google_protobuf_FileOptions_set_swift_prefix(google_protobuf_FileOptions *msg, upb_StringView value) {
9148   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)};
9149   upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
9150 }
google_protobuf_FileOptions_set_php_class_prefix(google_protobuf_FileOptions * msg,upb_StringView value)9151 UPB_INLINE void google_protobuf_FileOptions_set_php_class_prefix(google_protobuf_FileOptions *msg, upb_StringView value) {
9152   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)};
9153   upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
9154 }
google_protobuf_FileOptions_set_php_namespace(google_protobuf_FileOptions * msg,upb_StringView value)9155 UPB_INLINE void google_protobuf_FileOptions_set_php_namespace(google_protobuf_FileOptions *msg, upb_StringView value) {
9156   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)};
9157   upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
9158 }
google_protobuf_FileOptions_set_php_metadata_namespace(google_protobuf_FileOptions * msg,upb_StringView value)9159 UPB_INLINE void google_protobuf_FileOptions_set_php_metadata_namespace(google_protobuf_FileOptions *msg, upb_StringView value) {
9160   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)};
9161   upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
9162 }
google_protobuf_FileOptions_set_ruby_package(google_protobuf_FileOptions * msg,upb_StringView value)9163 UPB_INLINE void google_protobuf_FileOptions_set_ruby_package(google_protobuf_FileOptions *msg, upb_StringView value) {
9164   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)};
9165   upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
9166 }
google_protobuf_FileOptions_set_features(google_protobuf_FileOptions * msg,google_protobuf_FeatureSet * value)9167 UPB_INLINE void google_protobuf_FileOptions_set_features(google_protobuf_FileOptions *msg, google_protobuf_FeatureSet* value) {
9168   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)};
9169   UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__FeatureSet_msg_init);
9170   upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
9171 }
google_protobuf_FileOptions_mutable_features(google_protobuf_FileOptions * msg,upb_Arena * arena)9172 UPB_INLINE struct google_protobuf_FeatureSet* google_protobuf_FileOptions_mutable_features(google_protobuf_FileOptions* msg, upb_Arena* arena) {
9173   struct google_protobuf_FeatureSet* sub = (struct google_protobuf_FeatureSet*)google_protobuf_FileOptions_features(msg);
9174   if (sub == NULL) {
9175     sub = (struct google_protobuf_FeatureSet*)_upb_Message_New(&google__protobuf__FeatureSet_msg_init, arena);
9176     if (sub) google_protobuf_FileOptions_set_features(msg, sub);
9177   }
9178   return sub;
9179 }
google_protobuf_FileOptions_mutable_uninterpreted_option(google_protobuf_FileOptions * msg,size_t * size)9180 UPB_INLINE google_protobuf_UninterpretedOption** google_protobuf_FileOptions_mutable_uninterpreted_option(google_protobuf_FileOptions* msg, size_t* size) {
9181   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)};
9182   UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__UninterpretedOption_msg_init);
9183   upb_Array* arr = upb_Message_GetMutableArray(UPB_UPCAST(msg), &field);
9184   if (arr) {
9185     if (size) *size = arr->UPB_PRIVATE(size);
9186     return (google_protobuf_UninterpretedOption**)upb_Array_MutableDataPtr(arr);
9187   } else {
9188     if (size) *size = 0;
9189     return NULL;
9190   }
9191 }
google_protobuf_FileOptions_resize_uninterpreted_option(google_protobuf_FileOptions * msg,size_t size,upb_Arena * arena)9192 UPB_INLINE google_protobuf_UninterpretedOption** google_protobuf_FileOptions_resize_uninterpreted_option(google_protobuf_FileOptions* msg, size_t size, upb_Arena* arena) {
9193   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)};
9194   return (google_protobuf_UninterpretedOption**)upb_Message_ResizeArrayUninitialized(UPB_UPCAST(msg),
9195                                                    &field, size, arena);
9196 }
google_protobuf_FileOptions_add_uninterpreted_option(google_protobuf_FileOptions * msg,upb_Arena * arena)9197 UPB_INLINE struct google_protobuf_UninterpretedOption* google_protobuf_FileOptions_add_uninterpreted_option(google_protobuf_FileOptions* msg, upb_Arena* arena) {
9198   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)};
9199   UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__UninterpretedOption_msg_init);
9200   upb_Array* arr = upb_Message_GetOrCreateMutableArray(
9201       UPB_UPCAST(msg), &field, arena);
9202   if (!arr || !UPB_PRIVATE(_upb_Array_ResizeUninitialized)(
9203                   arr, arr->UPB_PRIVATE(size) + 1, arena)) {
9204     return NULL;
9205   }
9206   struct google_protobuf_UninterpretedOption* sub = (struct google_protobuf_UninterpretedOption*)_upb_Message_New(&google__protobuf__UninterpretedOption_msg_init, arena);
9207   if (!arr || !sub) return NULL;
9208   UPB_PRIVATE(_upb_Array_Set)
9209   (arr, arr->UPB_PRIVATE(size) - 1, &sub, sizeof(sub));
9210   return sub;
9211 }
9212 
9213 /* google.protobuf.MessageOptions */
9214 
google_protobuf_MessageOptions_new(upb_Arena * arena)9215 UPB_INLINE google_protobuf_MessageOptions* google_protobuf_MessageOptions_new(upb_Arena* arena) {
9216   return (google_protobuf_MessageOptions*)_upb_Message_New(&google__protobuf__MessageOptions_msg_init, arena);
9217 }
google_protobuf_MessageOptions_parse(const char * buf,size_t size,upb_Arena * arena)9218 UPB_INLINE google_protobuf_MessageOptions* google_protobuf_MessageOptions_parse(const char* buf, size_t size, upb_Arena* arena) {
9219   google_protobuf_MessageOptions* ret = google_protobuf_MessageOptions_new(arena);
9220   if (!ret) return NULL;
9221   if (upb_Decode(buf, size, UPB_UPCAST(ret), &google__protobuf__MessageOptions_msg_init, NULL, 0, arena) !=
9222       kUpb_DecodeStatus_Ok) {
9223     return NULL;
9224   }
9225   return ret;
9226 }
google_protobuf_MessageOptions_parse_ex(const char * buf,size_t size,const upb_ExtensionRegistry * extreg,int options,upb_Arena * arena)9227 UPB_INLINE google_protobuf_MessageOptions* google_protobuf_MessageOptions_parse_ex(const char* buf, size_t size,
9228                            const upb_ExtensionRegistry* extreg,
9229                            int options, upb_Arena* arena) {
9230   google_protobuf_MessageOptions* ret = google_protobuf_MessageOptions_new(arena);
9231   if (!ret) return NULL;
9232   if (upb_Decode(buf, size, UPB_UPCAST(ret), &google__protobuf__MessageOptions_msg_init, extreg, options,
9233                  arena) != kUpb_DecodeStatus_Ok) {
9234     return NULL;
9235   }
9236   return ret;
9237 }
google_protobuf_MessageOptions_serialize(const google_protobuf_MessageOptions * msg,upb_Arena * arena,size_t * len)9238 UPB_INLINE char* google_protobuf_MessageOptions_serialize(const google_protobuf_MessageOptions* msg, upb_Arena* arena, size_t* len) {
9239   char* ptr;
9240   (void)upb_Encode(UPB_UPCAST(msg), &google__protobuf__MessageOptions_msg_init, 0, arena, &ptr, len);
9241   return ptr;
9242 }
google_protobuf_MessageOptions_serialize_ex(const google_protobuf_MessageOptions * msg,int options,upb_Arena * arena,size_t * len)9243 UPB_INLINE char* google_protobuf_MessageOptions_serialize_ex(const google_protobuf_MessageOptions* msg, int options,
9244                                  upb_Arena* arena, size_t* len) {
9245   char* ptr;
9246   (void)upb_Encode(UPB_UPCAST(msg), &google__protobuf__MessageOptions_msg_init, options, arena, &ptr, len);
9247   return ptr;
9248 }
google_protobuf_MessageOptions_clear_message_set_wire_format(google_protobuf_MessageOptions * msg)9249 UPB_INLINE void google_protobuf_MessageOptions_clear_message_set_wire_format(google_protobuf_MessageOptions* msg) {
9250   const upb_MiniTableField field = {1, 9, 64, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
9251   upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
9252 }
google_protobuf_MessageOptions_message_set_wire_format(const google_protobuf_MessageOptions * msg)9253 UPB_INLINE bool google_protobuf_MessageOptions_message_set_wire_format(const google_protobuf_MessageOptions* msg) {
9254   bool default_val = false;
9255   bool ret;
9256   const upb_MiniTableField field = {1, 9, 64, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
9257   _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field,
9258                                     &default_val, &ret);
9259   return ret;
9260 }
google_protobuf_MessageOptions_has_message_set_wire_format(const google_protobuf_MessageOptions * msg)9261 UPB_INLINE bool google_protobuf_MessageOptions_has_message_set_wire_format(const google_protobuf_MessageOptions* msg) {
9262   const upb_MiniTableField field = {1, 9, 64, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
9263   return upb_Message_HasBaseField(UPB_UPCAST(msg), &field);
9264 }
google_protobuf_MessageOptions_clear_no_standard_descriptor_accessor(google_protobuf_MessageOptions * msg)9265 UPB_INLINE void google_protobuf_MessageOptions_clear_no_standard_descriptor_accessor(google_protobuf_MessageOptions* msg) {
9266   const upb_MiniTableField field = {2, 10, 65, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
9267   upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
9268 }
google_protobuf_MessageOptions_no_standard_descriptor_accessor(const google_protobuf_MessageOptions * msg)9269 UPB_INLINE bool google_protobuf_MessageOptions_no_standard_descriptor_accessor(const google_protobuf_MessageOptions* msg) {
9270   bool default_val = false;
9271   bool ret;
9272   const upb_MiniTableField field = {2, 10, 65, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
9273   _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field,
9274                                     &default_val, &ret);
9275   return ret;
9276 }
google_protobuf_MessageOptions_has_no_standard_descriptor_accessor(const google_protobuf_MessageOptions * msg)9277 UPB_INLINE bool google_protobuf_MessageOptions_has_no_standard_descriptor_accessor(const google_protobuf_MessageOptions* msg) {
9278   const upb_MiniTableField field = {2, 10, 65, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
9279   return upb_Message_HasBaseField(UPB_UPCAST(msg), &field);
9280 }
google_protobuf_MessageOptions_clear_deprecated(google_protobuf_MessageOptions * msg)9281 UPB_INLINE void google_protobuf_MessageOptions_clear_deprecated(google_protobuf_MessageOptions* msg) {
9282   const upb_MiniTableField field = {3, 11, 66, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
9283   upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
9284 }
google_protobuf_MessageOptions_deprecated(const google_protobuf_MessageOptions * msg)9285 UPB_INLINE bool google_protobuf_MessageOptions_deprecated(const google_protobuf_MessageOptions* msg) {
9286   bool default_val = false;
9287   bool ret;
9288   const upb_MiniTableField field = {3, 11, 66, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
9289   _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field,
9290                                     &default_val, &ret);
9291   return ret;
9292 }
google_protobuf_MessageOptions_has_deprecated(const google_protobuf_MessageOptions * msg)9293 UPB_INLINE bool google_protobuf_MessageOptions_has_deprecated(const google_protobuf_MessageOptions* msg) {
9294   const upb_MiniTableField field = {3, 11, 66, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
9295   return upb_Message_HasBaseField(UPB_UPCAST(msg), &field);
9296 }
google_protobuf_MessageOptions_clear_map_entry(google_protobuf_MessageOptions * msg)9297 UPB_INLINE void google_protobuf_MessageOptions_clear_map_entry(google_protobuf_MessageOptions* msg) {
9298   const upb_MiniTableField field = {7, 12, 67, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
9299   upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
9300 }
google_protobuf_MessageOptions_map_entry(const google_protobuf_MessageOptions * msg)9301 UPB_INLINE bool google_protobuf_MessageOptions_map_entry(const google_protobuf_MessageOptions* msg) {
9302   bool default_val = false;
9303   bool ret;
9304   const upb_MiniTableField field = {7, 12, 67, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
9305   _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field,
9306                                     &default_val, &ret);
9307   return ret;
9308 }
google_protobuf_MessageOptions_has_map_entry(const google_protobuf_MessageOptions * msg)9309 UPB_INLINE bool google_protobuf_MessageOptions_has_map_entry(const google_protobuf_MessageOptions* msg) {
9310   const upb_MiniTableField field = {7, 12, 67, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
9311   return upb_Message_HasBaseField(UPB_UPCAST(msg), &field);
9312 }
google_protobuf_MessageOptions_clear_deprecated_legacy_json_field_conflicts(google_protobuf_MessageOptions * msg)9313 UPB_INLINE void google_protobuf_MessageOptions_clear_deprecated_legacy_json_field_conflicts(google_protobuf_MessageOptions* msg) {
9314   const upb_MiniTableField field = {11, 13, 68, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
9315   upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
9316 }
google_protobuf_MessageOptions_deprecated_legacy_json_field_conflicts(const google_protobuf_MessageOptions * msg)9317 UPB_INLINE bool google_protobuf_MessageOptions_deprecated_legacy_json_field_conflicts(const google_protobuf_MessageOptions* msg) {
9318   bool default_val = false;
9319   bool ret;
9320   const upb_MiniTableField field = {11, 13, 68, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
9321   _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field,
9322                                     &default_val, &ret);
9323   return ret;
9324 }
google_protobuf_MessageOptions_has_deprecated_legacy_json_field_conflicts(const google_protobuf_MessageOptions * msg)9325 UPB_INLINE bool google_protobuf_MessageOptions_has_deprecated_legacy_json_field_conflicts(const google_protobuf_MessageOptions* msg) {
9326   const upb_MiniTableField field = {11, 13, 68, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
9327   return upb_Message_HasBaseField(UPB_UPCAST(msg), &field);
9328 }
google_protobuf_MessageOptions_clear_features(google_protobuf_MessageOptions * msg)9329 UPB_INLINE void google_protobuf_MessageOptions_clear_features(google_protobuf_MessageOptions* msg) {
9330   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)};
9331   upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
9332 }
google_protobuf_MessageOptions_features(const google_protobuf_MessageOptions * msg)9333 UPB_INLINE const google_protobuf_FeatureSet* google_protobuf_MessageOptions_features(const google_protobuf_MessageOptions* msg) {
9334   const google_protobuf_FeatureSet* default_val = NULL;
9335   const google_protobuf_FeatureSet* ret;
9336   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)};
9337   UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__FeatureSet_msg_init);
9338   _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field,
9339                                     &default_val, &ret);
9340   return ret;
9341 }
google_protobuf_MessageOptions_has_features(const google_protobuf_MessageOptions * msg)9342 UPB_INLINE bool google_protobuf_MessageOptions_has_features(const google_protobuf_MessageOptions* msg) {
9343   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)};
9344   return upb_Message_HasBaseField(UPB_UPCAST(msg), &field);
9345 }
google_protobuf_MessageOptions_clear_uninterpreted_option(google_protobuf_MessageOptions * msg)9346 UPB_INLINE void google_protobuf_MessageOptions_clear_uninterpreted_option(google_protobuf_MessageOptions* msg) {
9347   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)};
9348   upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
9349 }
google_protobuf_MessageOptions_uninterpreted_option(const google_protobuf_MessageOptions * msg,size_t * size)9350 UPB_INLINE const google_protobuf_UninterpretedOption* const* google_protobuf_MessageOptions_uninterpreted_option(const google_protobuf_MessageOptions* msg, size_t* size) {
9351   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)};
9352   UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__UninterpretedOption_msg_init);
9353   const upb_Array* arr = upb_Message_GetArray(UPB_UPCAST(msg), &field);
9354   if (arr) {
9355     if (size) *size = arr->UPB_PRIVATE(size);
9356     return (const google_protobuf_UninterpretedOption* const*)upb_Array_DataPtr(arr);
9357   } else {
9358     if (size) *size = 0;
9359     return NULL;
9360   }
9361 }
_google_protobuf_MessageOptions_uninterpreted_option_upb_array(const google_protobuf_MessageOptions * msg,size_t * size)9362 UPB_INLINE const upb_Array* _google_protobuf_MessageOptions_uninterpreted_option_upb_array(const google_protobuf_MessageOptions* msg, size_t* size) {
9363   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)};
9364   UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__UninterpretedOption_msg_init);
9365   const upb_Array* arr = upb_Message_GetArray(UPB_UPCAST(msg), &field);
9366   if (size) {
9367     *size = arr ? arr->UPB_PRIVATE(size) : 0;
9368   }
9369   return arr;
9370 }
_google_protobuf_MessageOptions_uninterpreted_option_mutable_upb_array(google_protobuf_MessageOptions * msg,size_t * size,upb_Arena * arena)9371 UPB_INLINE upb_Array* _google_protobuf_MessageOptions_uninterpreted_option_mutable_upb_array(google_protobuf_MessageOptions* msg, size_t* size, upb_Arena* arena) {
9372   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)};
9373   UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__UninterpretedOption_msg_init);
9374   upb_Array* arr = upb_Message_GetOrCreateMutableArray(UPB_UPCAST(msg),
9375                                                        &field, arena);
9376   if (size) {
9377     *size = arr ? arr->UPB_PRIVATE(size) : 0;
9378   }
9379   return arr;
9380 }
9381 
google_protobuf_MessageOptions_set_message_set_wire_format(google_protobuf_MessageOptions * msg,bool value)9382 UPB_INLINE void google_protobuf_MessageOptions_set_message_set_wire_format(google_protobuf_MessageOptions *msg, bool value) {
9383   const upb_MiniTableField field = {1, 9, 64, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
9384   upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
9385 }
google_protobuf_MessageOptions_set_no_standard_descriptor_accessor(google_protobuf_MessageOptions * msg,bool value)9386 UPB_INLINE void google_protobuf_MessageOptions_set_no_standard_descriptor_accessor(google_protobuf_MessageOptions *msg, bool value) {
9387   const upb_MiniTableField field = {2, 10, 65, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
9388   upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
9389 }
google_protobuf_MessageOptions_set_deprecated(google_protobuf_MessageOptions * msg,bool value)9390 UPB_INLINE void google_protobuf_MessageOptions_set_deprecated(google_protobuf_MessageOptions *msg, bool value) {
9391   const upb_MiniTableField field = {3, 11, 66, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
9392   upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
9393 }
google_protobuf_MessageOptions_set_map_entry(google_protobuf_MessageOptions * msg,bool value)9394 UPB_INLINE void google_protobuf_MessageOptions_set_map_entry(google_protobuf_MessageOptions *msg, bool value) {
9395   const upb_MiniTableField field = {7, 12, 67, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
9396   upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
9397 }
google_protobuf_MessageOptions_set_deprecated_legacy_json_field_conflicts(google_protobuf_MessageOptions * msg,bool value)9398 UPB_INLINE void google_protobuf_MessageOptions_set_deprecated_legacy_json_field_conflicts(google_protobuf_MessageOptions *msg, bool value) {
9399   const upb_MiniTableField field = {11, 13, 68, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
9400   upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
9401 }
google_protobuf_MessageOptions_set_features(google_protobuf_MessageOptions * msg,google_protobuf_FeatureSet * value)9402 UPB_INLINE void google_protobuf_MessageOptions_set_features(google_protobuf_MessageOptions *msg, google_protobuf_FeatureSet* value) {
9403   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)};
9404   UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__FeatureSet_msg_init);
9405   upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
9406 }
google_protobuf_MessageOptions_mutable_features(google_protobuf_MessageOptions * msg,upb_Arena * arena)9407 UPB_INLINE struct google_protobuf_FeatureSet* google_protobuf_MessageOptions_mutable_features(google_protobuf_MessageOptions* msg, upb_Arena* arena) {
9408   struct google_protobuf_FeatureSet* sub = (struct google_protobuf_FeatureSet*)google_protobuf_MessageOptions_features(msg);
9409   if (sub == NULL) {
9410     sub = (struct google_protobuf_FeatureSet*)_upb_Message_New(&google__protobuf__FeatureSet_msg_init, arena);
9411     if (sub) google_protobuf_MessageOptions_set_features(msg, sub);
9412   }
9413   return sub;
9414 }
google_protobuf_MessageOptions_mutable_uninterpreted_option(google_protobuf_MessageOptions * msg,size_t * size)9415 UPB_INLINE google_protobuf_UninterpretedOption** google_protobuf_MessageOptions_mutable_uninterpreted_option(google_protobuf_MessageOptions* msg, size_t* size) {
9416   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)};
9417   UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__UninterpretedOption_msg_init);
9418   upb_Array* arr = upb_Message_GetMutableArray(UPB_UPCAST(msg), &field);
9419   if (arr) {
9420     if (size) *size = arr->UPB_PRIVATE(size);
9421     return (google_protobuf_UninterpretedOption**)upb_Array_MutableDataPtr(arr);
9422   } else {
9423     if (size) *size = 0;
9424     return NULL;
9425   }
9426 }
google_protobuf_MessageOptions_resize_uninterpreted_option(google_protobuf_MessageOptions * msg,size_t size,upb_Arena * arena)9427 UPB_INLINE google_protobuf_UninterpretedOption** google_protobuf_MessageOptions_resize_uninterpreted_option(google_protobuf_MessageOptions* msg, size_t size, upb_Arena* arena) {
9428   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)};
9429   return (google_protobuf_UninterpretedOption**)upb_Message_ResizeArrayUninitialized(UPB_UPCAST(msg),
9430                                                    &field, size, arena);
9431 }
google_protobuf_MessageOptions_add_uninterpreted_option(google_protobuf_MessageOptions * msg,upb_Arena * arena)9432 UPB_INLINE struct google_protobuf_UninterpretedOption* google_protobuf_MessageOptions_add_uninterpreted_option(google_protobuf_MessageOptions* msg, upb_Arena* arena) {
9433   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)};
9434   UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__UninterpretedOption_msg_init);
9435   upb_Array* arr = upb_Message_GetOrCreateMutableArray(
9436       UPB_UPCAST(msg), &field, arena);
9437   if (!arr || !UPB_PRIVATE(_upb_Array_ResizeUninitialized)(
9438                   arr, arr->UPB_PRIVATE(size) + 1, arena)) {
9439     return NULL;
9440   }
9441   struct google_protobuf_UninterpretedOption* sub = (struct google_protobuf_UninterpretedOption*)_upb_Message_New(&google__protobuf__UninterpretedOption_msg_init, arena);
9442   if (!arr || !sub) return NULL;
9443   UPB_PRIVATE(_upb_Array_Set)
9444   (arr, arr->UPB_PRIVATE(size) - 1, &sub, sizeof(sub));
9445   return sub;
9446 }
9447 
9448 /* google.protobuf.FieldOptions */
9449 
google_protobuf_FieldOptions_new(upb_Arena * arena)9450 UPB_INLINE google_protobuf_FieldOptions* google_protobuf_FieldOptions_new(upb_Arena* arena) {
9451   return (google_protobuf_FieldOptions*)_upb_Message_New(&google__protobuf__FieldOptions_msg_init, arena);
9452 }
google_protobuf_FieldOptions_parse(const char * buf,size_t size,upb_Arena * arena)9453 UPB_INLINE google_protobuf_FieldOptions* google_protobuf_FieldOptions_parse(const char* buf, size_t size, upb_Arena* arena) {
9454   google_protobuf_FieldOptions* ret = google_protobuf_FieldOptions_new(arena);
9455   if (!ret) return NULL;
9456   if (upb_Decode(buf, size, UPB_UPCAST(ret), &google__protobuf__FieldOptions_msg_init, NULL, 0, arena) !=
9457       kUpb_DecodeStatus_Ok) {
9458     return NULL;
9459   }
9460   return ret;
9461 }
google_protobuf_FieldOptions_parse_ex(const char * buf,size_t size,const upb_ExtensionRegistry * extreg,int options,upb_Arena * arena)9462 UPB_INLINE google_protobuf_FieldOptions* google_protobuf_FieldOptions_parse_ex(const char* buf, size_t size,
9463                            const upb_ExtensionRegistry* extreg,
9464                            int options, upb_Arena* arena) {
9465   google_protobuf_FieldOptions* ret = google_protobuf_FieldOptions_new(arena);
9466   if (!ret) return NULL;
9467   if (upb_Decode(buf, size, UPB_UPCAST(ret), &google__protobuf__FieldOptions_msg_init, extreg, options,
9468                  arena) != kUpb_DecodeStatus_Ok) {
9469     return NULL;
9470   }
9471   return ret;
9472 }
google_protobuf_FieldOptions_serialize(const google_protobuf_FieldOptions * msg,upb_Arena * arena,size_t * len)9473 UPB_INLINE char* google_protobuf_FieldOptions_serialize(const google_protobuf_FieldOptions* msg, upb_Arena* arena, size_t* len) {
9474   char* ptr;
9475   (void)upb_Encode(UPB_UPCAST(msg), &google__protobuf__FieldOptions_msg_init, 0, arena, &ptr, len);
9476   return ptr;
9477 }
google_protobuf_FieldOptions_serialize_ex(const google_protobuf_FieldOptions * msg,int options,upb_Arena * arena,size_t * len)9478 UPB_INLINE char* google_protobuf_FieldOptions_serialize_ex(const google_protobuf_FieldOptions* msg, int options,
9479                                  upb_Arena* arena, size_t* len) {
9480   char* ptr;
9481   (void)upb_Encode(UPB_UPCAST(msg), &google__protobuf__FieldOptions_msg_init, options, arena, &ptr, len);
9482   return ptr;
9483 }
google_protobuf_FieldOptions_clear_ctype(google_protobuf_FieldOptions * msg)9484 UPB_INLINE void google_protobuf_FieldOptions_clear_ctype(google_protobuf_FieldOptions* msg) {
9485   const upb_MiniTableField field = {1, 12, 64, 4, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
9486   upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
9487 }
google_protobuf_FieldOptions_ctype(const google_protobuf_FieldOptions * msg)9488 UPB_INLINE int32_t google_protobuf_FieldOptions_ctype(const google_protobuf_FieldOptions* msg) {
9489   int32_t default_val = 0;
9490   int32_t ret;
9491   const upb_MiniTableField field = {1, 12, 64, 4, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
9492   _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field,
9493                                     &default_val, &ret);
9494   return ret;
9495 }
google_protobuf_FieldOptions_has_ctype(const google_protobuf_FieldOptions * msg)9496 UPB_INLINE bool google_protobuf_FieldOptions_has_ctype(const google_protobuf_FieldOptions* msg) {
9497   const upb_MiniTableField field = {1, 12, 64, 4, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
9498   return upb_Message_HasBaseField(UPB_UPCAST(msg), &field);
9499 }
google_protobuf_FieldOptions_clear_packed(google_protobuf_FieldOptions * msg)9500 UPB_INLINE void google_protobuf_FieldOptions_clear_packed(google_protobuf_FieldOptions* msg) {
9501   const upb_MiniTableField field = {2, 16, 65, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
9502   upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
9503 }
google_protobuf_FieldOptions_packed(const google_protobuf_FieldOptions * msg)9504 UPB_INLINE bool google_protobuf_FieldOptions_packed(const google_protobuf_FieldOptions* msg) {
9505   bool default_val = false;
9506   bool ret;
9507   const upb_MiniTableField field = {2, 16, 65, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
9508   _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field,
9509                                     &default_val, &ret);
9510   return ret;
9511 }
google_protobuf_FieldOptions_has_packed(const google_protobuf_FieldOptions * msg)9512 UPB_INLINE bool google_protobuf_FieldOptions_has_packed(const google_protobuf_FieldOptions* msg) {
9513   const upb_MiniTableField field = {2, 16, 65, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
9514   return upb_Message_HasBaseField(UPB_UPCAST(msg), &field);
9515 }
google_protobuf_FieldOptions_clear_deprecated(google_protobuf_FieldOptions * msg)9516 UPB_INLINE void google_protobuf_FieldOptions_clear_deprecated(google_protobuf_FieldOptions* msg) {
9517   const upb_MiniTableField field = {3, 17, 66, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
9518   upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
9519 }
google_protobuf_FieldOptions_deprecated(const google_protobuf_FieldOptions * msg)9520 UPB_INLINE bool google_protobuf_FieldOptions_deprecated(const google_protobuf_FieldOptions* msg) {
9521   bool default_val = false;
9522   bool ret;
9523   const upb_MiniTableField field = {3, 17, 66, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
9524   _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field,
9525                                     &default_val, &ret);
9526   return ret;
9527 }
google_protobuf_FieldOptions_has_deprecated(const google_protobuf_FieldOptions * msg)9528 UPB_INLINE bool google_protobuf_FieldOptions_has_deprecated(const google_protobuf_FieldOptions* msg) {
9529   const upb_MiniTableField field = {3, 17, 66, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
9530   return upb_Message_HasBaseField(UPB_UPCAST(msg), &field);
9531 }
google_protobuf_FieldOptions_clear_lazy(google_protobuf_FieldOptions * msg)9532 UPB_INLINE void google_protobuf_FieldOptions_clear_lazy(google_protobuf_FieldOptions* msg) {
9533   const upb_MiniTableField field = {5, 18, 67, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
9534   upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
9535 }
google_protobuf_FieldOptions_lazy(const google_protobuf_FieldOptions * msg)9536 UPB_INLINE bool google_protobuf_FieldOptions_lazy(const google_protobuf_FieldOptions* msg) {
9537   bool default_val = false;
9538   bool ret;
9539   const upb_MiniTableField field = {5, 18, 67, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
9540   _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field,
9541                                     &default_val, &ret);
9542   return ret;
9543 }
google_protobuf_FieldOptions_has_lazy(const google_protobuf_FieldOptions * msg)9544 UPB_INLINE bool google_protobuf_FieldOptions_has_lazy(const google_protobuf_FieldOptions* msg) {
9545   const upb_MiniTableField field = {5, 18, 67, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
9546   return upb_Message_HasBaseField(UPB_UPCAST(msg), &field);
9547 }
google_protobuf_FieldOptions_clear_jstype(google_protobuf_FieldOptions * msg)9548 UPB_INLINE void google_protobuf_FieldOptions_clear_jstype(google_protobuf_FieldOptions* msg) {
9549   const upb_MiniTableField field = {6, 20, 68, 5, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
9550   upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
9551 }
google_protobuf_FieldOptions_jstype(const google_protobuf_FieldOptions * msg)9552 UPB_INLINE int32_t google_protobuf_FieldOptions_jstype(const google_protobuf_FieldOptions* msg) {
9553   int32_t default_val = 0;
9554   int32_t ret;
9555   const upb_MiniTableField field = {6, 20, 68, 5, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
9556   _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field,
9557                                     &default_val, &ret);
9558   return ret;
9559 }
google_protobuf_FieldOptions_has_jstype(const google_protobuf_FieldOptions * msg)9560 UPB_INLINE bool google_protobuf_FieldOptions_has_jstype(const google_protobuf_FieldOptions* msg) {
9561   const upb_MiniTableField field = {6, 20, 68, 5, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
9562   return upb_Message_HasBaseField(UPB_UPCAST(msg), &field);
9563 }
google_protobuf_FieldOptions_clear_weak(google_protobuf_FieldOptions * msg)9564 UPB_INLINE void google_protobuf_FieldOptions_clear_weak(google_protobuf_FieldOptions* msg) {
9565   const upb_MiniTableField field = {10, 24, 69, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
9566   upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
9567 }
google_protobuf_FieldOptions_weak(const google_protobuf_FieldOptions * msg)9568 UPB_INLINE bool google_protobuf_FieldOptions_weak(const google_protobuf_FieldOptions* msg) {
9569   bool default_val = false;
9570   bool ret;
9571   const upb_MiniTableField field = {10, 24, 69, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
9572   _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field,
9573                                     &default_val, &ret);
9574   return ret;
9575 }
google_protobuf_FieldOptions_has_weak(const google_protobuf_FieldOptions * msg)9576 UPB_INLINE bool google_protobuf_FieldOptions_has_weak(const google_protobuf_FieldOptions* msg) {
9577   const upb_MiniTableField field = {10, 24, 69, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
9578   return upb_Message_HasBaseField(UPB_UPCAST(msg), &field);
9579 }
google_protobuf_FieldOptions_clear_unverified_lazy(google_protobuf_FieldOptions * msg)9580 UPB_INLINE void google_protobuf_FieldOptions_clear_unverified_lazy(google_protobuf_FieldOptions* msg) {
9581   const upb_MiniTableField field = {15, 25, 70, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
9582   upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
9583 }
google_protobuf_FieldOptions_unverified_lazy(const google_protobuf_FieldOptions * msg)9584 UPB_INLINE bool google_protobuf_FieldOptions_unverified_lazy(const google_protobuf_FieldOptions* msg) {
9585   bool default_val = false;
9586   bool ret;
9587   const upb_MiniTableField field = {15, 25, 70, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
9588   _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field,
9589                                     &default_val, &ret);
9590   return ret;
9591 }
google_protobuf_FieldOptions_has_unverified_lazy(const google_protobuf_FieldOptions * msg)9592 UPB_INLINE bool google_protobuf_FieldOptions_has_unverified_lazy(const google_protobuf_FieldOptions* msg) {
9593   const upb_MiniTableField field = {15, 25, 70, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
9594   return upb_Message_HasBaseField(UPB_UPCAST(msg), &field);
9595 }
google_protobuf_FieldOptions_clear_debug_redact(google_protobuf_FieldOptions * msg)9596 UPB_INLINE void google_protobuf_FieldOptions_clear_debug_redact(google_protobuf_FieldOptions* msg) {
9597   const upb_MiniTableField field = {16, 26, 71, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
9598   upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
9599 }
google_protobuf_FieldOptions_debug_redact(const google_protobuf_FieldOptions * msg)9600 UPB_INLINE bool google_protobuf_FieldOptions_debug_redact(const google_protobuf_FieldOptions* msg) {
9601   bool default_val = false;
9602   bool ret;
9603   const upb_MiniTableField field = {16, 26, 71, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
9604   _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field,
9605                                     &default_val, &ret);
9606   return ret;
9607 }
google_protobuf_FieldOptions_has_debug_redact(const google_protobuf_FieldOptions * msg)9608 UPB_INLINE bool google_protobuf_FieldOptions_has_debug_redact(const google_protobuf_FieldOptions* msg) {
9609   const upb_MiniTableField field = {16, 26, 71, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
9610   return upb_Message_HasBaseField(UPB_UPCAST(msg), &field);
9611 }
google_protobuf_FieldOptions_clear_retention(google_protobuf_FieldOptions * msg)9612 UPB_INLINE void google_protobuf_FieldOptions_clear_retention(google_protobuf_FieldOptions* msg) {
9613   const upb_MiniTableField field = {17, 28, 72, 6, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
9614   upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
9615 }
google_protobuf_FieldOptions_retention(const google_protobuf_FieldOptions * msg)9616 UPB_INLINE int32_t google_protobuf_FieldOptions_retention(const google_protobuf_FieldOptions* msg) {
9617   int32_t default_val = 0;
9618   int32_t ret;
9619   const upb_MiniTableField field = {17, 28, 72, 6, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
9620   _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field,
9621                                     &default_val, &ret);
9622   return ret;
9623 }
google_protobuf_FieldOptions_has_retention(const google_protobuf_FieldOptions * msg)9624 UPB_INLINE bool google_protobuf_FieldOptions_has_retention(const google_protobuf_FieldOptions* msg) {
9625   const upb_MiniTableField field = {17, 28, 72, 6, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
9626   return upb_Message_HasBaseField(UPB_UPCAST(msg), &field);
9627 }
google_protobuf_FieldOptions_clear_targets(google_protobuf_FieldOptions * msg)9628 UPB_INLINE void google_protobuf_FieldOptions_clear_targets(google_protobuf_FieldOptions* msg) {
9629   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)};
9630   upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
9631 }
google_protobuf_FieldOptions_targets(const google_protobuf_FieldOptions * msg,size_t * size)9632 UPB_INLINE int32_t const* google_protobuf_FieldOptions_targets(const google_protobuf_FieldOptions* msg, size_t* size) {
9633   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)};
9634   const upb_Array* arr = upb_Message_GetArray(UPB_UPCAST(msg), &field);
9635   if (arr) {
9636     if (size) *size = arr->UPB_PRIVATE(size);
9637     return (int32_t const*)upb_Array_DataPtr(arr);
9638   } else {
9639     if (size) *size = 0;
9640     return NULL;
9641   }
9642 }
_google_protobuf_FieldOptions_targets_upb_array(const google_protobuf_FieldOptions * msg,size_t * size)9643 UPB_INLINE const upb_Array* _google_protobuf_FieldOptions_targets_upb_array(const google_protobuf_FieldOptions* msg, size_t* size) {
9644   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)};
9645   const upb_Array* arr = upb_Message_GetArray(UPB_UPCAST(msg), &field);
9646   if (size) {
9647     *size = arr ? arr->UPB_PRIVATE(size) : 0;
9648   }
9649   return arr;
9650 }
_google_protobuf_FieldOptions_targets_mutable_upb_array(google_protobuf_FieldOptions * msg,size_t * size,upb_Arena * arena)9651 UPB_INLINE upb_Array* _google_protobuf_FieldOptions_targets_mutable_upb_array(google_protobuf_FieldOptions* msg, size_t* size, upb_Arena* arena) {
9652   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)};
9653   upb_Array* arr = upb_Message_GetOrCreateMutableArray(UPB_UPCAST(msg),
9654                                                        &field, arena);
9655   if (size) {
9656     *size = arr ? arr->UPB_PRIVATE(size) : 0;
9657   }
9658   return arr;
9659 }
google_protobuf_FieldOptions_clear_edition_defaults(google_protobuf_FieldOptions * msg)9660 UPB_INLINE void google_protobuf_FieldOptions_clear_edition_defaults(google_protobuf_FieldOptions* msg) {
9661   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)};
9662   upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
9663 }
google_protobuf_FieldOptions_edition_defaults(const google_protobuf_FieldOptions * msg,size_t * size)9664 UPB_INLINE const google_protobuf_FieldOptions_EditionDefault* const* google_protobuf_FieldOptions_edition_defaults(const google_protobuf_FieldOptions* msg, size_t* size) {
9665   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)};
9666   UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__FieldOptions__EditionDefault_msg_init);
9667   const upb_Array* arr = upb_Message_GetArray(UPB_UPCAST(msg), &field);
9668   if (arr) {
9669     if (size) *size = arr->UPB_PRIVATE(size);
9670     return (const google_protobuf_FieldOptions_EditionDefault* const*)upb_Array_DataPtr(arr);
9671   } else {
9672     if (size) *size = 0;
9673     return NULL;
9674   }
9675 }
_google_protobuf_FieldOptions_edition_defaults_upb_array(const google_protobuf_FieldOptions * msg,size_t * size)9676 UPB_INLINE const upb_Array* _google_protobuf_FieldOptions_edition_defaults_upb_array(const google_protobuf_FieldOptions* msg, size_t* size) {
9677   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)};
9678   UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__FieldOptions__EditionDefault_msg_init);
9679   const upb_Array* arr = upb_Message_GetArray(UPB_UPCAST(msg), &field);
9680   if (size) {
9681     *size = arr ? arr->UPB_PRIVATE(size) : 0;
9682   }
9683   return arr;
9684 }
_google_protobuf_FieldOptions_edition_defaults_mutable_upb_array(google_protobuf_FieldOptions * msg,size_t * size,upb_Arena * arena)9685 UPB_INLINE upb_Array* _google_protobuf_FieldOptions_edition_defaults_mutable_upb_array(google_protobuf_FieldOptions* msg, size_t* size, upb_Arena* arena) {
9686   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)};
9687   UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__FieldOptions__EditionDefault_msg_init);
9688   upb_Array* arr = upb_Message_GetOrCreateMutableArray(UPB_UPCAST(msg),
9689                                                        &field, arena);
9690   if (size) {
9691     *size = arr ? arr->UPB_PRIVATE(size) : 0;
9692   }
9693   return arr;
9694 }
google_protobuf_FieldOptions_clear_features(google_protobuf_FieldOptions * msg)9695 UPB_INLINE void google_protobuf_FieldOptions_clear_features(google_protobuf_FieldOptions* msg) {
9696   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)};
9697   upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
9698 }
google_protobuf_FieldOptions_features(const google_protobuf_FieldOptions * msg)9699 UPB_INLINE const google_protobuf_FeatureSet* google_protobuf_FieldOptions_features(const google_protobuf_FieldOptions* msg) {
9700   const google_protobuf_FeatureSet* default_val = NULL;
9701   const google_protobuf_FeatureSet* ret;
9702   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)};
9703   UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__FeatureSet_msg_init);
9704   _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field,
9705                                     &default_val, &ret);
9706   return ret;
9707 }
google_protobuf_FieldOptions_has_features(const google_protobuf_FieldOptions * msg)9708 UPB_INLINE bool google_protobuf_FieldOptions_has_features(const google_protobuf_FieldOptions* msg) {
9709   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)};
9710   return upb_Message_HasBaseField(UPB_UPCAST(msg), &field);
9711 }
google_protobuf_FieldOptions_clear_feature_support(google_protobuf_FieldOptions * msg)9712 UPB_INLINE void google_protobuf_FieldOptions_clear_feature_support(google_protobuf_FieldOptions* msg) {
9713   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)};
9714   upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
9715 }
google_protobuf_FieldOptions_feature_support(const google_protobuf_FieldOptions * msg)9716 UPB_INLINE const google_protobuf_FieldOptions_FeatureSupport* google_protobuf_FieldOptions_feature_support(const google_protobuf_FieldOptions* msg) {
9717   const google_protobuf_FieldOptions_FeatureSupport* default_val = NULL;
9718   const google_protobuf_FieldOptions_FeatureSupport* ret;
9719   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)};
9720   UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__FieldOptions__FeatureSupport_msg_init);
9721   _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field,
9722                                     &default_val, &ret);
9723   return ret;
9724 }
google_protobuf_FieldOptions_has_feature_support(const google_protobuf_FieldOptions * msg)9725 UPB_INLINE bool google_protobuf_FieldOptions_has_feature_support(const google_protobuf_FieldOptions* msg) {
9726   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)};
9727   return upb_Message_HasBaseField(UPB_UPCAST(msg), &field);
9728 }
google_protobuf_FieldOptions_clear_uninterpreted_option(google_protobuf_FieldOptions * msg)9729 UPB_INLINE void google_protobuf_FieldOptions_clear_uninterpreted_option(google_protobuf_FieldOptions* msg) {
9730   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)};
9731   upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
9732 }
google_protobuf_FieldOptions_uninterpreted_option(const google_protobuf_FieldOptions * msg,size_t * size)9733 UPB_INLINE const google_protobuf_UninterpretedOption* const* google_protobuf_FieldOptions_uninterpreted_option(const google_protobuf_FieldOptions* msg, size_t* size) {
9734   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)};
9735   UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__UninterpretedOption_msg_init);
9736   const upb_Array* arr = upb_Message_GetArray(UPB_UPCAST(msg), &field);
9737   if (arr) {
9738     if (size) *size = arr->UPB_PRIVATE(size);
9739     return (const google_protobuf_UninterpretedOption* const*)upb_Array_DataPtr(arr);
9740   } else {
9741     if (size) *size = 0;
9742     return NULL;
9743   }
9744 }
_google_protobuf_FieldOptions_uninterpreted_option_upb_array(const google_protobuf_FieldOptions * msg,size_t * size)9745 UPB_INLINE const upb_Array* _google_protobuf_FieldOptions_uninterpreted_option_upb_array(const google_protobuf_FieldOptions* msg, size_t* size) {
9746   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)};
9747   UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__UninterpretedOption_msg_init);
9748   const upb_Array* arr = upb_Message_GetArray(UPB_UPCAST(msg), &field);
9749   if (size) {
9750     *size = arr ? arr->UPB_PRIVATE(size) : 0;
9751   }
9752   return arr;
9753 }
_google_protobuf_FieldOptions_uninterpreted_option_mutable_upb_array(google_protobuf_FieldOptions * msg,size_t * size,upb_Arena * arena)9754 UPB_INLINE upb_Array* _google_protobuf_FieldOptions_uninterpreted_option_mutable_upb_array(google_protobuf_FieldOptions* msg, size_t* size, upb_Arena* arena) {
9755   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)};
9756   UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__UninterpretedOption_msg_init);
9757   upb_Array* arr = upb_Message_GetOrCreateMutableArray(UPB_UPCAST(msg),
9758                                                        &field, arena);
9759   if (size) {
9760     *size = arr ? arr->UPB_PRIVATE(size) : 0;
9761   }
9762   return arr;
9763 }
9764 
google_protobuf_FieldOptions_set_ctype(google_protobuf_FieldOptions * msg,int32_t value)9765 UPB_INLINE void google_protobuf_FieldOptions_set_ctype(google_protobuf_FieldOptions *msg, int32_t value) {
9766   const upb_MiniTableField field = {1, 12, 64, 4, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
9767   upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
9768 }
google_protobuf_FieldOptions_set_packed(google_protobuf_FieldOptions * msg,bool value)9769 UPB_INLINE void google_protobuf_FieldOptions_set_packed(google_protobuf_FieldOptions *msg, bool value) {
9770   const upb_MiniTableField field = {2, 16, 65, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
9771   upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
9772 }
google_protobuf_FieldOptions_set_deprecated(google_protobuf_FieldOptions * msg,bool value)9773 UPB_INLINE void google_protobuf_FieldOptions_set_deprecated(google_protobuf_FieldOptions *msg, bool value) {
9774   const upb_MiniTableField field = {3, 17, 66, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
9775   upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
9776 }
google_protobuf_FieldOptions_set_lazy(google_protobuf_FieldOptions * msg,bool value)9777 UPB_INLINE void google_protobuf_FieldOptions_set_lazy(google_protobuf_FieldOptions *msg, bool value) {
9778   const upb_MiniTableField field = {5, 18, 67, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
9779   upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
9780 }
google_protobuf_FieldOptions_set_jstype(google_protobuf_FieldOptions * msg,int32_t value)9781 UPB_INLINE void google_protobuf_FieldOptions_set_jstype(google_protobuf_FieldOptions *msg, int32_t value) {
9782   const upb_MiniTableField field = {6, 20, 68, 5, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
9783   upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
9784 }
google_protobuf_FieldOptions_set_weak(google_protobuf_FieldOptions * msg,bool value)9785 UPB_INLINE void google_protobuf_FieldOptions_set_weak(google_protobuf_FieldOptions *msg, bool value) {
9786   const upb_MiniTableField field = {10, 24, 69, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
9787   upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
9788 }
google_protobuf_FieldOptions_set_unverified_lazy(google_protobuf_FieldOptions * msg,bool value)9789 UPB_INLINE void google_protobuf_FieldOptions_set_unverified_lazy(google_protobuf_FieldOptions *msg, bool value) {
9790   const upb_MiniTableField field = {15, 25, 70, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
9791   upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
9792 }
google_protobuf_FieldOptions_set_debug_redact(google_protobuf_FieldOptions * msg,bool value)9793 UPB_INLINE void google_protobuf_FieldOptions_set_debug_redact(google_protobuf_FieldOptions *msg, bool value) {
9794   const upb_MiniTableField field = {16, 26, 71, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
9795   upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
9796 }
google_protobuf_FieldOptions_set_retention(google_protobuf_FieldOptions * msg,int32_t value)9797 UPB_INLINE void google_protobuf_FieldOptions_set_retention(google_protobuf_FieldOptions *msg, int32_t value) {
9798   const upb_MiniTableField field = {17, 28, 72, 6, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
9799   upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
9800 }
google_protobuf_FieldOptions_mutable_targets(google_protobuf_FieldOptions * msg,size_t * size)9801 UPB_INLINE int32_t* google_protobuf_FieldOptions_mutable_targets(google_protobuf_FieldOptions* msg, size_t* size) {
9802   upb_MiniTableField field = {19, 32, 0, 7, 14, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
9803   upb_Array* arr = upb_Message_GetMutableArray(UPB_UPCAST(msg), &field);
9804   if (arr) {
9805     if (size) *size = arr->UPB_PRIVATE(size);
9806     return (int32_t*)upb_Array_MutableDataPtr(arr);
9807   } else {
9808     if (size) *size = 0;
9809     return NULL;
9810   }
9811 }
google_protobuf_FieldOptions_resize_targets(google_protobuf_FieldOptions * msg,size_t size,upb_Arena * arena)9812 UPB_INLINE int32_t* google_protobuf_FieldOptions_resize_targets(google_protobuf_FieldOptions* msg, size_t size, upb_Arena* arena) {
9813   upb_MiniTableField field = {19, 32, 0, 7, 14, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
9814   return (int32_t*)upb_Message_ResizeArrayUninitialized(UPB_UPCAST(msg),
9815                                                    &field, size, arena);
9816 }
google_protobuf_FieldOptions_add_targets(google_protobuf_FieldOptions * msg,int32_t val,upb_Arena * arena)9817 UPB_INLINE bool google_protobuf_FieldOptions_add_targets(google_protobuf_FieldOptions* msg, int32_t val, upb_Arena* arena) {
9818   upb_MiniTableField field = {19, 32, 0, 7, 14, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
9819   upb_Array* arr = upb_Message_GetOrCreateMutableArray(
9820       UPB_UPCAST(msg), &field, arena);
9821   if (!arr || !UPB_PRIVATE(_upb_Array_ResizeUninitialized)(
9822                   arr, arr->UPB_PRIVATE(size) + 1, arena)) {
9823     return false;
9824   }
9825   UPB_PRIVATE(_upb_Array_Set)
9826   (arr, arr->UPB_PRIVATE(size) - 1, &val, sizeof(val));
9827   return true;
9828 }
google_protobuf_FieldOptions_mutable_edition_defaults(google_protobuf_FieldOptions * msg,size_t * size)9829 UPB_INLINE google_protobuf_FieldOptions_EditionDefault** google_protobuf_FieldOptions_mutable_edition_defaults(google_protobuf_FieldOptions* msg, size_t* size) {
9830   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)};
9831   UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__FieldOptions__EditionDefault_msg_init);
9832   upb_Array* arr = upb_Message_GetMutableArray(UPB_UPCAST(msg), &field);
9833   if (arr) {
9834     if (size) *size = arr->UPB_PRIVATE(size);
9835     return (google_protobuf_FieldOptions_EditionDefault**)upb_Array_MutableDataPtr(arr);
9836   } else {
9837     if (size) *size = 0;
9838     return NULL;
9839   }
9840 }
google_protobuf_FieldOptions_resize_edition_defaults(google_protobuf_FieldOptions * msg,size_t size,upb_Arena * arena)9841 UPB_INLINE google_protobuf_FieldOptions_EditionDefault** google_protobuf_FieldOptions_resize_edition_defaults(google_protobuf_FieldOptions* msg, size_t size, upb_Arena* arena) {
9842   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)};
9843   return (google_protobuf_FieldOptions_EditionDefault**)upb_Message_ResizeArrayUninitialized(UPB_UPCAST(msg),
9844                                                    &field, size, arena);
9845 }
google_protobuf_FieldOptions_add_edition_defaults(google_protobuf_FieldOptions * msg,upb_Arena * arena)9846 UPB_INLINE struct google_protobuf_FieldOptions_EditionDefault* google_protobuf_FieldOptions_add_edition_defaults(google_protobuf_FieldOptions* msg, upb_Arena* arena) {
9847   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)};
9848   UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__FieldOptions__EditionDefault_msg_init);
9849   upb_Array* arr = upb_Message_GetOrCreateMutableArray(
9850       UPB_UPCAST(msg), &field, arena);
9851   if (!arr || !UPB_PRIVATE(_upb_Array_ResizeUninitialized)(
9852                   arr, arr->UPB_PRIVATE(size) + 1, arena)) {
9853     return NULL;
9854   }
9855   struct google_protobuf_FieldOptions_EditionDefault* sub = (struct google_protobuf_FieldOptions_EditionDefault*)_upb_Message_New(&google__protobuf__FieldOptions__EditionDefault_msg_init, arena);
9856   if (!arr || !sub) return NULL;
9857   UPB_PRIVATE(_upb_Array_Set)
9858   (arr, arr->UPB_PRIVATE(size) - 1, &sub, sizeof(sub));
9859   return sub;
9860 }
google_protobuf_FieldOptions_set_features(google_protobuf_FieldOptions * msg,google_protobuf_FeatureSet * value)9861 UPB_INLINE void google_protobuf_FieldOptions_set_features(google_protobuf_FieldOptions *msg, google_protobuf_FeatureSet* value) {
9862   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)};
9863   UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__FeatureSet_msg_init);
9864   upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
9865 }
google_protobuf_FieldOptions_mutable_features(google_protobuf_FieldOptions * msg,upb_Arena * arena)9866 UPB_INLINE struct google_protobuf_FeatureSet* google_protobuf_FieldOptions_mutable_features(google_protobuf_FieldOptions* msg, upb_Arena* arena) {
9867   struct google_protobuf_FeatureSet* sub = (struct google_protobuf_FeatureSet*)google_protobuf_FieldOptions_features(msg);
9868   if (sub == NULL) {
9869     sub = (struct google_protobuf_FeatureSet*)_upb_Message_New(&google__protobuf__FeatureSet_msg_init, arena);
9870     if (sub) google_protobuf_FieldOptions_set_features(msg, sub);
9871   }
9872   return sub;
9873 }
google_protobuf_FieldOptions_set_feature_support(google_protobuf_FieldOptions * msg,google_protobuf_FieldOptions_FeatureSupport * value)9874 UPB_INLINE void google_protobuf_FieldOptions_set_feature_support(google_protobuf_FieldOptions *msg, google_protobuf_FieldOptions_FeatureSupport* value) {
9875   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)};
9876   UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__FieldOptions__FeatureSupport_msg_init);
9877   upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
9878 }
google_protobuf_FieldOptions_mutable_feature_support(google_protobuf_FieldOptions * msg,upb_Arena * arena)9879 UPB_INLINE struct google_protobuf_FieldOptions_FeatureSupport* google_protobuf_FieldOptions_mutable_feature_support(google_protobuf_FieldOptions* msg, upb_Arena* arena) {
9880   struct google_protobuf_FieldOptions_FeatureSupport* sub = (struct google_protobuf_FieldOptions_FeatureSupport*)google_protobuf_FieldOptions_feature_support(msg);
9881   if (sub == NULL) {
9882     sub = (struct google_protobuf_FieldOptions_FeatureSupport*)_upb_Message_New(&google__protobuf__FieldOptions__FeatureSupport_msg_init, arena);
9883     if (sub) google_protobuf_FieldOptions_set_feature_support(msg, sub);
9884   }
9885   return sub;
9886 }
google_protobuf_FieldOptions_mutable_uninterpreted_option(google_protobuf_FieldOptions * msg,size_t * size)9887 UPB_INLINE google_protobuf_UninterpretedOption** google_protobuf_FieldOptions_mutable_uninterpreted_option(google_protobuf_FieldOptions* msg, size_t* size) {
9888   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)};
9889   UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__UninterpretedOption_msg_init);
9890   upb_Array* arr = upb_Message_GetMutableArray(UPB_UPCAST(msg), &field);
9891   if (arr) {
9892     if (size) *size = arr->UPB_PRIVATE(size);
9893     return (google_protobuf_UninterpretedOption**)upb_Array_MutableDataPtr(arr);
9894   } else {
9895     if (size) *size = 0;
9896     return NULL;
9897   }
9898 }
google_protobuf_FieldOptions_resize_uninterpreted_option(google_protobuf_FieldOptions * msg,size_t size,upb_Arena * arena)9899 UPB_INLINE google_protobuf_UninterpretedOption** google_protobuf_FieldOptions_resize_uninterpreted_option(google_protobuf_FieldOptions* msg, size_t size, upb_Arena* arena) {
9900   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)};
9901   return (google_protobuf_UninterpretedOption**)upb_Message_ResizeArrayUninitialized(UPB_UPCAST(msg),
9902                                                    &field, size, arena);
9903 }
google_protobuf_FieldOptions_add_uninterpreted_option(google_protobuf_FieldOptions * msg,upb_Arena * arena)9904 UPB_INLINE struct google_protobuf_UninterpretedOption* google_protobuf_FieldOptions_add_uninterpreted_option(google_protobuf_FieldOptions* msg, upb_Arena* arena) {
9905   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)};
9906   UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__UninterpretedOption_msg_init);
9907   upb_Array* arr = upb_Message_GetOrCreateMutableArray(
9908       UPB_UPCAST(msg), &field, arena);
9909   if (!arr || !UPB_PRIVATE(_upb_Array_ResizeUninitialized)(
9910                   arr, arr->UPB_PRIVATE(size) + 1, arena)) {
9911     return NULL;
9912   }
9913   struct google_protobuf_UninterpretedOption* sub = (struct google_protobuf_UninterpretedOption*)_upb_Message_New(&google__protobuf__UninterpretedOption_msg_init, arena);
9914   if (!arr || !sub) return NULL;
9915   UPB_PRIVATE(_upb_Array_Set)
9916   (arr, arr->UPB_PRIVATE(size) - 1, &sub, sizeof(sub));
9917   return sub;
9918 }
9919 
9920 /* google.protobuf.FieldOptions.EditionDefault */
9921 
google_protobuf_FieldOptions_EditionDefault_new(upb_Arena * arena)9922 UPB_INLINE google_protobuf_FieldOptions_EditionDefault* google_protobuf_FieldOptions_EditionDefault_new(upb_Arena* arena) {
9923   return (google_protobuf_FieldOptions_EditionDefault*)_upb_Message_New(&google__protobuf__FieldOptions__EditionDefault_msg_init, arena);
9924 }
google_protobuf_FieldOptions_EditionDefault_parse(const char * buf,size_t size,upb_Arena * arena)9925 UPB_INLINE google_protobuf_FieldOptions_EditionDefault* google_protobuf_FieldOptions_EditionDefault_parse(const char* buf, size_t size, upb_Arena* arena) {
9926   google_protobuf_FieldOptions_EditionDefault* ret = google_protobuf_FieldOptions_EditionDefault_new(arena);
9927   if (!ret) return NULL;
9928   if (upb_Decode(buf, size, UPB_UPCAST(ret), &google__protobuf__FieldOptions__EditionDefault_msg_init, NULL, 0, arena) !=
9929       kUpb_DecodeStatus_Ok) {
9930     return NULL;
9931   }
9932   return ret;
9933 }
google_protobuf_FieldOptions_EditionDefault_parse_ex(const char * buf,size_t size,const upb_ExtensionRegistry * extreg,int options,upb_Arena * arena)9934 UPB_INLINE google_protobuf_FieldOptions_EditionDefault* google_protobuf_FieldOptions_EditionDefault_parse_ex(const char* buf, size_t size,
9935                            const upb_ExtensionRegistry* extreg,
9936                            int options, upb_Arena* arena) {
9937   google_protobuf_FieldOptions_EditionDefault* ret = google_protobuf_FieldOptions_EditionDefault_new(arena);
9938   if (!ret) return NULL;
9939   if (upb_Decode(buf, size, UPB_UPCAST(ret), &google__protobuf__FieldOptions__EditionDefault_msg_init, extreg, options,
9940                  arena) != kUpb_DecodeStatus_Ok) {
9941     return NULL;
9942   }
9943   return ret;
9944 }
google_protobuf_FieldOptions_EditionDefault_serialize(const google_protobuf_FieldOptions_EditionDefault * msg,upb_Arena * arena,size_t * len)9945 UPB_INLINE char* google_protobuf_FieldOptions_EditionDefault_serialize(const google_protobuf_FieldOptions_EditionDefault* msg, upb_Arena* arena, size_t* len) {
9946   char* ptr;
9947   (void)upb_Encode(UPB_UPCAST(msg), &google__protobuf__FieldOptions__EditionDefault_msg_init, 0, arena, &ptr, len);
9948   return ptr;
9949 }
google_protobuf_FieldOptions_EditionDefault_serialize_ex(const google_protobuf_FieldOptions_EditionDefault * msg,int options,upb_Arena * arena,size_t * len)9950 UPB_INLINE char* google_protobuf_FieldOptions_EditionDefault_serialize_ex(const google_protobuf_FieldOptions_EditionDefault* msg, int options,
9951                                  upb_Arena* arena, size_t* len) {
9952   char* ptr;
9953   (void)upb_Encode(UPB_UPCAST(msg), &google__protobuf__FieldOptions__EditionDefault_msg_init, options, arena, &ptr, len);
9954   return ptr;
9955 }
google_protobuf_FieldOptions_EditionDefault_clear_value(google_protobuf_FieldOptions_EditionDefault * msg)9956 UPB_INLINE void google_protobuf_FieldOptions_EditionDefault_clear_value(google_protobuf_FieldOptions_EditionDefault* msg) {
9957   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)};
9958   upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
9959 }
google_protobuf_FieldOptions_EditionDefault_value(const google_protobuf_FieldOptions_EditionDefault * msg)9960 UPB_INLINE upb_StringView google_protobuf_FieldOptions_EditionDefault_value(const google_protobuf_FieldOptions_EditionDefault* msg) {
9961   upb_StringView default_val = upb_StringView_FromString("");
9962   upb_StringView ret;
9963   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)};
9964   _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field,
9965                                     &default_val, &ret);
9966   return ret;
9967 }
google_protobuf_FieldOptions_EditionDefault_has_value(const google_protobuf_FieldOptions_EditionDefault * msg)9968 UPB_INLINE bool google_protobuf_FieldOptions_EditionDefault_has_value(const google_protobuf_FieldOptions_EditionDefault* msg) {
9969   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)};
9970   return upb_Message_HasBaseField(UPB_UPCAST(msg), &field);
9971 }
google_protobuf_FieldOptions_EditionDefault_clear_edition(google_protobuf_FieldOptions_EditionDefault * msg)9972 UPB_INLINE void google_protobuf_FieldOptions_EditionDefault_clear_edition(google_protobuf_FieldOptions_EditionDefault* msg) {
9973   const upb_MiniTableField field = {3, 12, 65, 0, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
9974   upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
9975 }
google_protobuf_FieldOptions_EditionDefault_edition(const google_protobuf_FieldOptions_EditionDefault * msg)9976 UPB_INLINE int32_t google_protobuf_FieldOptions_EditionDefault_edition(const google_protobuf_FieldOptions_EditionDefault* msg) {
9977   int32_t default_val = 0;
9978   int32_t ret;
9979   const upb_MiniTableField field = {3, 12, 65, 0, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
9980   _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field,
9981                                     &default_val, &ret);
9982   return ret;
9983 }
google_protobuf_FieldOptions_EditionDefault_has_edition(const google_protobuf_FieldOptions_EditionDefault * msg)9984 UPB_INLINE bool google_protobuf_FieldOptions_EditionDefault_has_edition(const google_protobuf_FieldOptions_EditionDefault* msg) {
9985   const upb_MiniTableField field = {3, 12, 65, 0, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
9986   return upb_Message_HasBaseField(UPB_UPCAST(msg), &field);
9987 }
9988 
google_protobuf_FieldOptions_EditionDefault_set_value(google_protobuf_FieldOptions_EditionDefault * msg,upb_StringView value)9989 UPB_INLINE void google_protobuf_FieldOptions_EditionDefault_set_value(google_protobuf_FieldOptions_EditionDefault *msg, upb_StringView value) {
9990   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)};
9991   upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
9992 }
google_protobuf_FieldOptions_EditionDefault_set_edition(google_protobuf_FieldOptions_EditionDefault * msg,int32_t value)9993 UPB_INLINE void google_protobuf_FieldOptions_EditionDefault_set_edition(google_protobuf_FieldOptions_EditionDefault *msg, int32_t value) {
9994   const upb_MiniTableField field = {3, 12, 65, 0, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
9995   upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
9996 }
9997 
9998 /* google.protobuf.FieldOptions.FeatureSupport */
9999 
google_protobuf_FieldOptions_FeatureSupport_new(upb_Arena * arena)10000 UPB_INLINE google_protobuf_FieldOptions_FeatureSupport* google_protobuf_FieldOptions_FeatureSupport_new(upb_Arena* arena) {
10001   return (google_protobuf_FieldOptions_FeatureSupport*)_upb_Message_New(&google__protobuf__FieldOptions__FeatureSupport_msg_init, arena);
10002 }
google_protobuf_FieldOptions_FeatureSupport_parse(const char * buf,size_t size,upb_Arena * arena)10003 UPB_INLINE google_protobuf_FieldOptions_FeatureSupport* google_protobuf_FieldOptions_FeatureSupport_parse(const char* buf, size_t size, upb_Arena* arena) {
10004   google_protobuf_FieldOptions_FeatureSupport* ret = google_protobuf_FieldOptions_FeatureSupport_new(arena);
10005   if (!ret) return NULL;
10006   if (upb_Decode(buf, size, UPB_UPCAST(ret), &google__protobuf__FieldOptions__FeatureSupport_msg_init, NULL, 0, arena) !=
10007       kUpb_DecodeStatus_Ok) {
10008     return NULL;
10009   }
10010   return ret;
10011 }
google_protobuf_FieldOptions_FeatureSupport_parse_ex(const char * buf,size_t size,const upb_ExtensionRegistry * extreg,int options,upb_Arena * arena)10012 UPB_INLINE google_protobuf_FieldOptions_FeatureSupport* google_protobuf_FieldOptions_FeatureSupport_parse_ex(const char* buf, size_t size,
10013                            const upb_ExtensionRegistry* extreg,
10014                            int options, upb_Arena* arena) {
10015   google_protobuf_FieldOptions_FeatureSupport* ret = google_protobuf_FieldOptions_FeatureSupport_new(arena);
10016   if (!ret) return NULL;
10017   if (upb_Decode(buf, size, UPB_UPCAST(ret), &google__protobuf__FieldOptions__FeatureSupport_msg_init, extreg, options,
10018                  arena) != kUpb_DecodeStatus_Ok) {
10019     return NULL;
10020   }
10021   return ret;
10022 }
google_protobuf_FieldOptions_FeatureSupport_serialize(const google_protobuf_FieldOptions_FeatureSupport * msg,upb_Arena * arena,size_t * len)10023 UPB_INLINE char* google_protobuf_FieldOptions_FeatureSupport_serialize(const google_protobuf_FieldOptions_FeatureSupport* msg, upb_Arena* arena, size_t* len) {
10024   char* ptr;
10025   (void)upb_Encode(UPB_UPCAST(msg), &google__protobuf__FieldOptions__FeatureSupport_msg_init, 0, arena, &ptr, len);
10026   return ptr;
10027 }
google_protobuf_FieldOptions_FeatureSupport_serialize_ex(const google_protobuf_FieldOptions_FeatureSupport * msg,int options,upb_Arena * arena,size_t * len)10028 UPB_INLINE char* google_protobuf_FieldOptions_FeatureSupport_serialize_ex(const google_protobuf_FieldOptions_FeatureSupport* msg, int options,
10029                                  upb_Arena* arena, size_t* len) {
10030   char* ptr;
10031   (void)upb_Encode(UPB_UPCAST(msg), &google__protobuf__FieldOptions__FeatureSupport_msg_init, options, arena, &ptr, len);
10032   return ptr;
10033 }
google_protobuf_FieldOptions_FeatureSupport_clear_edition_introduced(google_protobuf_FieldOptions_FeatureSupport * msg)10034 UPB_INLINE void google_protobuf_FieldOptions_FeatureSupport_clear_edition_introduced(google_protobuf_FieldOptions_FeatureSupport* msg) {
10035   const upb_MiniTableField field = {1, 12, 64, 0, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
10036   upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
10037 }
google_protobuf_FieldOptions_FeatureSupport_edition_introduced(const google_protobuf_FieldOptions_FeatureSupport * msg)10038 UPB_INLINE int32_t google_protobuf_FieldOptions_FeatureSupport_edition_introduced(const google_protobuf_FieldOptions_FeatureSupport* msg) {
10039   int32_t default_val = 0;
10040   int32_t ret;
10041   const upb_MiniTableField field = {1, 12, 64, 0, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
10042   _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field,
10043                                     &default_val, &ret);
10044   return ret;
10045 }
google_protobuf_FieldOptions_FeatureSupport_has_edition_introduced(const google_protobuf_FieldOptions_FeatureSupport * msg)10046 UPB_INLINE bool google_protobuf_FieldOptions_FeatureSupport_has_edition_introduced(const google_protobuf_FieldOptions_FeatureSupport* msg) {
10047   const upb_MiniTableField field = {1, 12, 64, 0, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
10048   return upb_Message_HasBaseField(UPB_UPCAST(msg), &field);
10049 }
google_protobuf_FieldOptions_FeatureSupport_clear_edition_deprecated(google_protobuf_FieldOptions_FeatureSupport * msg)10050 UPB_INLINE void google_protobuf_FieldOptions_FeatureSupport_clear_edition_deprecated(google_protobuf_FieldOptions_FeatureSupport* msg) {
10051   const upb_MiniTableField field = {2, 16, 65, 1, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
10052   upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
10053 }
google_protobuf_FieldOptions_FeatureSupport_edition_deprecated(const google_protobuf_FieldOptions_FeatureSupport * msg)10054 UPB_INLINE int32_t google_protobuf_FieldOptions_FeatureSupport_edition_deprecated(const google_protobuf_FieldOptions_FeatureSupport* msg) {
10055   int32_t default_val = 0;
10056   int32_t ret;
10057   const upb_MiniTableField field = {2, 16, 65, 1, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
10058   _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field,
10059                                     &default_val, &ret);
10060   return ret;
10061 }
google_protobuf_FieldOptions_FeatureSupport_has_edition_deprecated(const google_protobuf_FieldOptions_FeatureSupport * msg)10062 UPB_INLINE bool google_protobuf_FieldOptions_FeatureSupport_has_edition_deprecated(const google_protobuf_FieldOptions_FeatureSupport* msg) {
10063   const upb_MiniTableField field = {2, 16, 65, 1, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
10064   return upb_Message_HasBaseField(UPB_UPCAST(msg), &field);
10065 }
google_protobuf_FieldOptions_FeatureSupport_clear_deprecation_warning(google_protobuf_FieldOptions_FeatureSupport * msg)10066 UPB_INLINE void google_protobuf_FieldOptions_FeatureSupport_clear_deprecation_warning(google_protobuf_FieldOptions_FeatureSupport* msg) {
10067   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)};
10068   upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
10069 }
google_protobuf_FieldOptions_FeatureSupport_deprecation_warning(const google_protobuf_FieldOptions_FeatureSupport * msg)10070 UPB_INLINE upb_StringView google_protobuf_FieldOptions_FeatureSupport_deprecation_warning(const google_protobuf_FieldOptions_FeatureSupport* msg) {
10071   upb_StringView default_val = upb_StringView_FromString("");
10072   upb_StringView ret;
10073   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)};
10074   _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field,
10075                                     &default_val, &ret);
10076   return ret;
10077 }
google_protobuf_FieldOptions_FeatureSupport_has_deprecation_warning(const google_protobuf_FieldOptions_FeatureSupport * msg)10078 UPB_INLINE bool google_protobuf_FieldOptions_FeatureSupport_has_deprecation_warning(const google_protobuf_FieldOptions_FeatureSupport* msg) {
10079   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)};
10080   return upb_Message_HasBaseField(UPB_UPCAST(msg), &field);
10081 }
google_protobuf_FieldOptions_FeatureSupport_clear_edition_removed(google_protobuf_FieldOptions_FeatureSupport * msg)10082 UPB_INLINE void google_protobuf_FieldOptions_FeatureSupport_clear_edition_removed(google_protobuf_FieldOptions_FeatureSupport* msg) {
10083   const upb_MiniTableField field = {4, 20, 67, 2, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
10084   upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
10085 }
google_protobuf_FieldOptions_FeatureSupport_edition_removed(const google_protobuf_FieldOptions_FeatureSupport * msg)10086 UPB_INLINE int32_t google_protobuf_FieldOptions_FeatureSupport_edition_removed(const google_protobuf_FieldOptions_FeatureSupport* msg) {
10087   int32_t default_val = 0;
10088   int32_t ret;
10089   const upb_MiniTableField field = {4, 20, 67, 2, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
10090   _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field,
10091                                     &default_val, &ret);
10092   return ret;
10093 }
google_protobuf_FieldOptions_FeatureSupport_has_edition_removed(const google_protobuf_FieldOptions_FeatureSupport * msg)10094 UPB_INLINE bool google_protobuf_FieldOptions_FeatureSupport_has_edition_removed(const google_protobuf_FieldOptions_FeatureSupport* msg) {
10095   const upb_MiniTableField field = {4, 20, 67, 2, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
10096   return upb_Message_HasBaseField(UPB_UPCAST(msg), &field);
10097 }
10098 
google_protobuf_FieldOptions_FeatureSupport_set_edition_introduced(google_protobuf_FieldOptions_FeatureSupport * msg,int32_t value)10099 UPB_INLINE void google_protobuf_FieldOptions_FeatureSupport_set_edition_introduced(google_protobuf_FieldOptions_FeatureSupport *msg, int32_t value) {
10100   const upb_MiniTableField field = {1, 12, 64, 0, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
10101   upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
10102 }
google_protobuf_FieldOptions_FeatureSupport_set_edition_deprecated(google_protobuf_FieldOptions_FeatureSupport * msg,int32_t value)10103 UPB_INLINE void google_protobuf_FieldOptions_FeatureSupport_set_edition_deprecated(google_protobuf_FieldOptions_FeatureSupport *msg, int32_t value) {
10104   const upb_MiniTableField field = {2, 16, 65, 1, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
10105   upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
10106 }
google_protobuf_FieldOptions_FeatureSupport_set_deprecation_warning(google_protobuf_FieldOptions_FeatureSupport * msg,upb_StringView value)10107 UPB_INLINE void google_protobuf_FieldOptions_FeatureSupport_set_deprecation_warning(google_protobuf_FieldOptions_FeatureSupport *msg, upb_StringView value) {
10108   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)};
10109   upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
10110 }
google_protobuf_FieldOptions_FeatureSupport_set_edition_removed(google_protobuf_FieldOptions_FeatureSupport * msg,int32_t value)10111 UPB_INLINE void google_protobuf_FieldOptions_FeatureSupport_set_edition_removed(google_protobuf_FieldOptions_FeatureSupport *msg, int32_t value) {
10112   const upb_MiniTableField field = {4, 20, 67, 2, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
10113   upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
10114 }
10115 
10116 /* google.protobuf.OneofOptions */
10117 
google_protobuf_OneofOptions_new(upb_Arena * arena)10118 UPB_INLINE google_protobuf_OneofOptions* google_protobuf_OneofOptions_new(upb_Arena* arena) {
10119   return (google_protobuf_OneofOptions*)_upb_Message_New(&google__protobuf__OneofOptions_msg_init, arena);
10120 }
google_protobuf_OneofOptions_parse(const char * buf,size_t size,upb_Arena * arena)10121 UPB_INLINE google_protobuf_OneofOptions* google_protobuf_OneofOptions_parse(const char* buf, size_t size, upb_Arena* arena) {
10122   google_protobuf_OneofOptions* ret = google_protobuf_OneofOptions_new(arena);
10123   if (!ret) return NULL;
10124   if (upb_Decode(buf, size, UPB_UPCAST(ret), &google__protobuf__OneofOptions_msg_init, NULL, 0, arena) !=
10125       kUpb_DecodeStatus_Ok) {
10126     return NULL;
10127   }
10128   return ret;
10129 }
google_protobuf_OneofOptions_parse_ex(const char * buf,size_t size,const upb_ExtensionRegistry * extreg,int options,upb_Arena * arena)10130 UPB_INLINE google_protobuf_OneofOptions* google_protobuf_OneofOptions_parse_ex(const char* buf, size_t size,
10131                            const upb_ExtensionRegistry* extreg,
10132                            int options, upb_Arena* arena) {
10133   google_protobuf_OneofOptions* ret = google_protobuf_OneofOptions_new(arena);
10134   if (!ret) return NULL;
10135   if (upb_Decode(buf, size, UPB_UPCAST(ret), &google__protobuf__OneofOptions_msg_init, extreg, options,
10136                  arena) != kUpb_DecodeStatus_Ok) {
10137     return NULL;
10138   }
10139   return ret;
10140 }
google_protobuf_OneofOptions_serialize(const google_protobuf_OneofOptions * msg,upb_Arena * arena,size_t * len)10141 UPB_INLINE char* google_protobuf_OneofOptions_serialize(const google_protobuf_OneofOptions* msg, upb_Arena* arena, size_t* len) {
10142   char* ptr;
10143   (void)upb_Encode(UPB_UPCAST(msg), &google__protobuf__OneofOptions_msg_init, 0, arena, &ptr, len);
10144   return ptr;
10145 }
google_protobuf_OneofOptions_serialize_ex(const google_protobuf_OneofOptions * msg,int options,upb_Arena * arena,size_t * len)10146 UPB_INLINE char* google_protobuf_OneofOptions_serialize_ex(const google_protobuf_OneofOptions* msg, int options,
10147                                  upb_Arena* arena, size_t* len) {
10148   char* ptr;
10149   (void)upb_Encode(UPB_UPCAST(msg), &google__protobuf__OneofOptions_msg_init, options, arena, &ptr, len);
10150   return ptr;
10151 }
google_protobuf_OneofOptions_clear_features(google_protobuf_OneofOptions * msg)10152 UPB_INLINE void google_protobuf_OneofOptions_clear_features(google_protobuf_OneofOptions* msg) {
10153   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)};
10154   upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
10155 }
google_protobuf_OneofOptions_features(const google_protobuf_OneofOptions * msg)10156 UPB_INLINE const google_protobuf_FeatureSet* google_protobuf_OneofOptions_features(const google_protobuf_OneofOptions* msg) {
10157   const google_protobuf_FeatureSet* default_val = NULL;
10158   const google_protobuf_FeatureSet* ret;
10159   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)};
10160   UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__FeatureSet_msg_init);
10161   _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field,
10162                                     &default_val, &ret);
10163   return ret;
10164 }
google_protobuf_OneofOptions_has_features(const google_protobuf_OneofOptions * msg)10165 UPB_INLINE bool google_protobuf_OneofOptions_has_features(const google_protobuf_OneofOptions* msg) {
10166   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)};
10167   return upb_Message_HasBaseField(UPB_UPCAST(msg), &field);
10168 }
google_protobuf_OneofOptions_clear_uninterpreted_option(google_protobuf_OneofOptions * msg)10169 UPB_INLINE void google_protobuf_OneofOptions_clear_uninterpreted_option(google_protobuf_OneofOptions* msg) {
10170   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)};
10171   upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
10172 }
google_protobuf_OneofOptions_uninterpreted_option(const google_protobuf_OneofOptions * msg,size_t * size)10173 UPB_INLINE const google_protobuf_UninterpretedOption* const* google_protobuf_OneofOptions_uninterpreted_option(const google_protobuf_OneofOptions* msg, size_t* size) {
10174   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)};
10175   UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__UninterpretedOption_msg_init);
10176   const upb_Array* arr = upb_Message_GetArray(UPB_UPCAST(msg), &field);
10177   if (arr) {
10178     if (size) *size = arr->UPB_PRIVATE(size);
10179     return (const google_protobuf_UninterpretedOption* const*)upb_Array_DataPtr(arr);
10180   } else {
10181     if (size) *size = 0;
10182     return NULL;
10183   }
10184 }
_google_protobuf_OneofOptions_uninterpreted_option_upb_array(const google_protobuf_OneofOptions * msg,size_t * size)10185 UPB_INLINE const upb_Array* _google_protobuf_OneofOptions_uninterpreted_option_upb_array(const google_protobuf_OneofOptions* msg, size_t* size) {
10186   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)};
10187   UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__UninterpretedOption_msg_init);
10188   const upb_Array* arr = upb_Message_GetArray(UPB_UPCAST(msg), &field);
10189   if (size) {
10190     *size = arr ? arr->UPB_PRIVATE(size) : 0;
10191   }
10192   return arr;
10193 }
_google_protobuf_OneofOptions_uninterpreted_option_mutable_upb_array(google_protobuf_OneofOptions * msg,size_t * size,upb_Arena * arena)10194 UPB_INLINE upb_Array* _google_protobuf_OneofOptions_uninterpreted_option_mutable_upb_array(google_protobuf_OneofOptions* msg, size_t* size, upb_Arena* arena) {
10195   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)};
10196   UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__UninterpretedOption_msg_init);
10197   upb_Array* arr = upb_Message_GetOrCreateMutableArray(UPB_UPCAST(msg),
10198                                                        &field, arena);
10199   if (size) {
10200     *size = arr ? arr->UPB_PRIVATE(size) : 0;
10201   }
10202   return arr;
10203 }
10204 
google_protobuf_OneofOptions_set_features(google_protobuf_OneofOptions * msg,google_protobuf_FeatureSet * value)10205 UPB_INLINE void google_protobuf_OneofOptions_set_features(google_protobuf_OneofOptions *msg, google_protobuf_FeatureSet* value) {
10206   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)};
10207   UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__FeatureSet_msg_init);
10208   upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
10209 }
google_protobuf_OneofOptions_mutable_features(google_protobuf_OneofOptions * msg,upb_Arena * arena)10210 UPB_INLINE struct google_protobuf_FeatureSet* google_protobuf_OneofOptions_mutable_features(google_protobuf_OneofOptions* msg, upb_Arena* arena) {
10211   struct google_protobuf_FeatureSet* sub = (struct google_protobuf_FeatureSet*)google_protobuf_OneofOptions_features(msg);
10212   if (sub == NULL) {
10213     sub = (struct google_protobuf_FeatureSet*)_upb_Message_New(&google__protobuf__FeatureSet_msg_init, arena);
10214     if (sub) google_protobuf_OneofOptions_set_features(msg, sub);
10215   }
10216   return sub;
10217 }
google_protobuf_OneofOptions_mutable_uninterpreted_option(google_protobuf_OneofOptions * msg,size_t * size)10218 UPB_INLINE google_protobuf_UninterpretedOption** google_protobuf_OneofOptions_mutable_uninterpreted_option(google_protobuf_OneofOptions* msg, size_t* size) {
10219   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)};
10220   UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__UninterpretedOption_msg_init);
10221   upb_Array* arr = upb_Message_GetMutableArray(UPB_UPCAST(msg), &field);
10222   if (arr) {
10223     if (size) *size = arr->UPB_PRIVATE(size);
10224     return (google_protobuf_UninterpretedOption**)upb_Array_MutableDataPtr(arr);
10225   } else {
10226     if (size) *size = 0;
10227     return NULL;
10228   }
10229 }
google_protobuf_OneofOptions_resize_uninterpreted_option(google_protobuf_OneofOptions * msg,size_t size,upb_Arena * arena)10230 UPB_INLINE google_protobuf_UninterpretedOption** google_protobuf_OneofOptions_resize_uninterpreted_option(google_protobuf_OneofOptions* msg, size_t size, upb_Arena* arena) {
10231   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)};
10232   return (google_protobuf_UninterpretedOption**)upb_Message_ResizeArrayUninitialized(UPB_UPCAST(msg),
10233                                                    &field, size, arena);
10234 }
google_protobuf_OneofOptions_add_uninterpreted_option(google_protobuf_OneofOptions * msg,upb_Arena * arena)10235 UPB_INLINE struct google_protobuf_UninterpretedOption* google_protobuf_OneofOptions_add_uninterpreted_option(google_protobuf_OneofOptions* msg, upb_Arena* arena) {
10236   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)};
10237   UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__UninterpretedOption_msg_init);
10238   upb_Array* arr = upb_Message_GetOrCreateMutableArray(
10239       UPB_UPCAST(msg), &field, arena);
10240   if (!arr || !UPB_PRIVATE(_upb_Array_ResizeUninitialized)(
10241                   arr, arr->UPB_PRIVATE(size) + 1, arena)) {
10242     return NULL;
10243   }
10244   struct google_protobuf_UninterpretedOption* sub = (struct google_protobuf_UninterpretedOption*)_upb_Message_New(&google__protobuf__UninterpretedOption_msg_init, arena);
10245   if (!arr || !sub) return NULL;
10246   UPB_PRIVATE(_upb_Array_Set)
10247   (arr, arr->UPB_PRIVATE(size) - 1, &sub, sizeof(sub));
10248   return sub;
10249 }
10250 
10251 /* google.protobuf.EnumOptions */
10252 
google_protobuf_EnumOptions_new(upb_Arena * arena)10253 UPB_INLINE google_protobuf_EnumOptions* google_protobuf_EnumOptions_new(upb_Arena* arena) {
10254   return (google_protobuf_EnumOptions*)_upb_Message_New(&google__protobuf__EnumOptions_msg_init, arena);
10255 }
google_protobuf_EnumOptions_parse(const char * buf,size_t size,upb_Arena * arena)10256 UPB_INLINE google_protobuf_EnumOptions* google_protobuf_EnumOptions_parse(const char* buf, size_t size, upb_Arena* arena) {
10257   google_protobuf_EnumOptions* ret = google_protobuf_EnumOptions_new(arena);
10258   if (!ret) return NULL;
10259   if (upb_Decode(buf, size, UPB_UPCAST(ret), &google__protobuf__EnumOptions_msg_init, NULL, 0, arena) !=
10260       kUpb_DecodeStatus_Ok) {
10261     return NULL;
10262   }
10263   return ret;
10264 }
google_protobuf_EnumOptions_parse_ex(const char * buf,size_t size,const upb_ExtensionRegistry * extreg,int options,upb_Arena * arena)10265 UPB_INLINE google_protobuf_EnumOptions* google_protobuf_EnumOptions_parse_ex(const char* buf, size_t size,
10266                            const upb_ExtensionRegistry* extreg,
10267                            int options, upb_Arena* arena) {
10268   google_protobuf_EnumOptions* ret = google_protobuf_EnumOptions_new(arena);
10269   if (!ret) return NULL;
10270   if (upb_Decode(buf, size, UPB_UPCAST(ret), &google__protobuf__EnumOptions_msg_init, extreg, options,
10271                  arena) != kUpb_DecodeStatus_Ok) {
10272     return NULL;
10273   }
10274   return ret;
10275 }
google_protobuf_EnumOptions_serialize(const google_protobuf_EnumOptions * msg,upb_Arena * arena,size_t * len)10276 UPB_INLINE char* google_protobuf_EnumOptions_serialize(const google_protobuf_EnumOptions* msg, upb_Arena* arena, size_t* len) {
10277   char* ptr;
10278   (void)upb_Encode(UPB_UPCAST(msg), &google__protobuf__EnumOptions_msg_init, 0, arena, &ptr, len);
10279   return ptr;
10280 }
google_protobuf_EnumOptions_serialize_ex(const google_protobuf_EnumOptions * msg,int options,upb_Arena * arena,size_t * len)10281 UPB_INLINE char* google_protobuf_EnumOptions_serialize_ex(const google_protobuf_EnumOptions* msg, int options,
10282                                  upb_Arena* arena, size_t* len) {
10283   char* ptr;
10284   (void)upb_Encode(UPB_UPCAST(msg), &google__protobuf__EnumOptions_msg_init, options, arena, &ptr, len);
10285   return ptr;
10286 }
google_protobuf_EnumOptions_clear_allow_alias(google_protobuf_EnumOptions * msg)10287 UPB_INLINE void google_protobuf_EnumOptions_clear_allow_alias(google_protobuf_EnumOptions* msg) {
10288   const upb_MiniTableField field = {2, 9, 64, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
10289   upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
10290 }
google_protobuf_EnumOptions_allow_alias(const google_protobuf_EnumOptions * msg)10291 UPB_INLINE bool google_protobuf_EnumOptions_allow_alias(const google_protobuf_EnumOptions* msg) {
10292   bool default_val = false;
10293   bool ret;
10294   const upb_MiniTableField field = {2, 9, 64, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
10295   _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field,
10296                                     &default_val, &ret);
10297   return ret;
10298 }
google_protobuf_EnumOptions_has_allow_alias(const google_protobuf_EnumOptions * msg)10299 UPB_INLINE bool google_protobuf_EnumOptions_has_allow_alias(const google_protobuf_EnumOptions* msg) {
10300   const upb_MiniTableField field = {2, 9, 64, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
10301   return upb_Message_HasBaseField(UPB_UPCAST(msg), &field);
10302 }
google_protobuf_EnumOptions_clear_deprecated(google_protobuf_EnumOptions * msg)10303 UPB_INLINE void google_protobuf_EnumOptions_clear_deprecated(google_protobuf_EnumOptions* msg) {
10304   const upb_MiniTableField field = {3, 10, 65, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
10305   upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
10306 }
google_protobuf_EnumOptions_deprecated(const google_protobuf_EnumOptions * msg)10307 UPB_INLINE bool google_protobuf_EnumOptions_deprecated(const google_protobuf_EnumOptions* msg) {
10308   bool default_val = false;
10309   bool ret;
10310   const upb_MiniTableField field = {3, 10, 65, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
10311   _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field,
10312                                     &default_val, &ret);
10313   return ret;
10314 }
google_protobuf_EnumOptions_has_deprecated(const google_protobuf_EnumOptions * msg)10315 UPB_INLINE bool google_protobuf_EnumOptions_has_deprecated(const google_protobuf_EnumOptions* msg) {
10316   const upb_MiniTableField field = {3, 10, 65, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
10317   return upb_Message_HasBaseField(UPB_UPCAST(msg), &field);
10318 }
google_protobuf_EnumOptions_clear_deprecated_legacy_json_field_conflicts(google_protobuf_EnumOptions * msg)10319 UPB_INLINE void google_protobuf_EnumOptions_clear_deprecated_legacy_json_field_conflicts(google_protobuf_EnumOptions* msg) {
10320   const upb_MiniTableField field = {6, 11, 66, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
10321   upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
10322 }
google_protobuf_EnumOptions_deprecated_legacy_json_field_conflicts(const google_protobuf_EnumOptions * msg)10323 UPB_INLINE bool google_protobuf_EnumOptions_deprecated_legacy_json_field_conflicts(const google_protobuf_EnumOptions* msg) {
10324   bool default_val = false;
10325   bool ret;
10326   const upb_MiniTableField field = {6, 11, 66, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
10327   _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field,
10328                                     &default_val, &ret);
10329   return ret;
10330 }
google_protobuf_EnumOptions_has_deprecated_legacy_json_field_conflicts(const google_protobuf_EnumOptions * msg)10331 UPB_INLINE bool google_protobuf_EnumOptions_has_deprecated_legacy_json_field_conflicts(const google_protobuf_EnumOptions* msg) {
10332   const upb_MiniTableField field = {6, 11, 66, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
10333   return upb_Message_HasBaseField(UPB_UPCAST(msg), &field);
10334 }
google_protobuf_EnumOptions_clear_features(google_protobuf_EnumOptions * msg)10335 UPB_INLINE void google_protobuf_EnumOptions_clear_features(google_protobuf_EnumOptions* msg) {
10336   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)};
10337   upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
10338 }
google_protobuf_EnumOptions_features(const google_protobuf_EnumOptions * msg)10339 UPB_INLINE const google_protobuf_FeatureSet* google_protobuf_EnumOptions_features(const google_protobuf_EnumOptions* msg) {
10340   const google_protobuf_FeatureSet* default_val = NULL;
10341   const google_protobuf_FeatureSet* ret;
10342   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)};
10343   UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__FeatureSet_msg_init);
10344   _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field,
10345                                     &default_val, &ret);
10346   return ret;
10347 }
google_protobuf_EnumOptions_has_features(const google_protobuf_EnumOptions * msg)10348 UPB_INLINE bool google_protobuf_EnumOptions_has_features(const google_protobuf_EnumOptions* msg) {
10349   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)};
10350   return upb_Message_HasBaseField(UPB_UPCAST(msg), &field);
10351 }
google_protobuf_EnumOptions_clear_uninterpreted_option(google_protobuf_EnumOptions * msg)10352 UPB_INLINE void google_protobuf_EnumOptions_clear_uninterpreted_option(google_protobuf_EnumOptions* msg) {
10353   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)};
10354   upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
10355 }
google_protobuf_EnumOptions_uninterpreted_option(const google_protobuf_EnumOptions * msg,size_t * size)10356 UPB_INLINE const google_protobuf_UninterpretedOption* const* google_protobuf_EnumOptions_uninterpreted_option(const google_protobuf_EnumOptions* msg, size_t* size) {
10357   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)};
10358   UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__UninterpretedOption_msg_init);
10359   const upb_Array* arr = upb_Message_GetArray(UPB_UPCAST(msg), &field);
10360   if (arr) {
10361     if (size) *size = arr->UPB_PRIVATE(size);
10362     return (const google_protobuf_UninterpretedOption* const*)upb_Array_DataPtr(arr);
10363   } else {
10364     if (size) *size = 0;
10365     return NULL;
10366   }
10367 }
_google_protobuf_EnumOptions_uninterpreted_option_upb_array(const google_protobuf_EnumOptions * msg,size_t * size)10368 UPB_INLINE const upb_Array* _google_protobuf_EnumOptions_uninterpreted_option_upb_array(const google_protobuf_EnumOptions* msg, size_t* size) {
10369   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)};
10370   UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__UninterpretedOption_msg_init);
10371   const upb_Array* arr = upb_Message_GetArray(UPB_UPCAST(msg), &field);
10372   if (size) {
10373     *size = arr ? arr->UPB_PRIVATE(size) : 0;
10374   }
10375   return arr;
10376 }
_google_protobuf_EnumOptions_uninterpreted_option_mutable_upb_array(google_protobuf_EnumOptions * msg,size_t * size,upb_Arena * arena)10377 UPB_INLINE upb_Array* _google_protobuf_EnumOptions_uninterpreted_option_mutable_upb_array(google_protobuf_EnumOptions* msg, size_t* size, upb_Arena* arena) {
10378   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)};
10379   UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__UninterpretedOption_msg_init);
10380   upb_Array* arr = upb_Message_GetOrCreateMutableArray(UPB_UPCAST(msg),
10381                                                        &field, arena);
10382   if (size) {
10383     *size = arr ? arr->UPB_PRIVATE(size) : 0;
10384   }
10385   return arr;
10386 }
10387 
google_protobuf_EnumOptions_set_allow_alias(google_protobuf_EnumOptions * msg,bool value)10388 UPB_INLINE void google_protobuf_EnumOptions_set_allow_alias(google_protobuf_EnumOptions *msg, bool value) {
10389   const upb_MiniTableField field = {2, 9, 64, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
10390   upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
10391 }
google_protobuf_EnumOptions_set_deprecated(google_protobuf_EnumOptions * msg,bool value)10392 UPB_INLINE void google_protobuf_EnumOptions_set_deprecated(google_protobuf_EnumOptions *msg, bool value) {
10393   const upb_MiniTableField field = {3, 10, 65, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
10394   upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
10395 }
google_protobuf_EnumOptions_set_deprecated_legacy_json_field_conflicts(google_protobuf_EnumOptions * msg,bool value)10396 UPB_INLINE void google_protobuf_EnumOptions_set_deprecated_legacy_json_field_conflicts(google_protobuf_EnumOptions *msg, bool value) {
10397   const upb_MiniTableField field = {6, 11, 66, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
10398   upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
10399 }
google_protobuf_EnumOptions_set_features(google_protobuf_EnumOptions * msg,google_protobuf_FeatureSet * value)10400 UPB_INLINE void google_protobuf_EnumOptions_set_features(google_protobuf_EnumOptions *msg, google_protobuf_FeatureSet* value) {
10401   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)};
10402   UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__FeatureSet_msg_init);
10403   upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
10404 }
google_protobuf_EnumOptions_mutable_features(google_protobuf_EnumOptions * msg,upb_Arena * arena)10405 UPB_INLINE struct google_protobuf_FeatureSet* google_protobuf_EnumOptions_mutable_features(google_protobuf_EnumOptions* msg, upb_Arena* arena) {
10406   struct google_protobuf_FeatureSet* sub = (struct google_protobuf_FeatureSet*)google_protobuf_EnumOptions_features(msg);
10407   if (sub == NULL) {
10408     sub = (struct google_protobuf_FeatureSet*)_upb_Message_New(&google__protobuf__FeatureSet_msg_init, arena);
10409     if (sub) google_protobuf_EnumOptions_set_features(msg, sub);
10410   }
10411   return sub;
10412 }
google_protobuf_EnumOptions_mutable_uninterpreted_option(google_protobuf_EnumOptions * msg,size_t * size)10413 UPB_INLINE google_protobuf_UninterpretedOption** google_protobuf_EnumOptions_mutable_uninterpreted_option(google_protobuf_EnumOptions* msg, size_t* size) {
10414   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)};
10415   UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__UninterpretedOption_msg_init);
10416   upb_Array* arr = upb_Message_GetMutableArray(UPB_UPCAST(msg), &field);
10417   if (arr) {
10418     if (size) *size = arr->UPB_PRIVATE(size);
10419     return (google_protobuf_UninterpretedOption**)upb_Array_MutableDataPtr(arr);
10420   } else {
10421     if (size) *size = 0;
10422     return NULL;
10423   }
10424 }
google_protobuf_EnumOptions_resize_uninterpreted_option(google_protobuf_EnumOptions * msg,size_t size,upb_Arena * arena)10425 UPB_INLINE google_protobuf_UninterpretedOption** google_protobuf_EnumOptions_resize_uninterpreted_option(google_protobuf_EnumOptions* msg, size_t size, upb_Arena* arena) {
10426   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)};
10427   return (google_protobuf_UninterpretedOption**)upb_Message_ResizeArrayUninitialized(UPB_UPCAST(msg),
10428                                                    &field, size, arena);
10429 }
google_protobuf_EnumOptions_add_uninterpreted_option(google_protobuf_EnumOptions * msg,upb_Arena * arena)10430 UPB_INLINE struct google_protobuf_UninterpretedOption* google_protobuf_EnumOptions_add_uninterpreted_option(google_protobuf_EnumOptions* msg, upb_Arena* arena) {
10431   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)};
10432   UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__UninterpretedOption_msg_init);
10433   upb_Array* arr = upb_Message_GetOrCreateMutableArray(
10434       UPB_UPCAST(msg), &field, arena);
10435   if (!arr || !UPB_PRIVATE(_upb_Array_ResizeUninitialized)(
10436                   arr, arr->UPB_PRIVATE(size) + 1, arena)) {
10437     return NULL;
10438   }
10439   struct google_protobuf_UninterpretedOption* sub = (struct google_protobuf_UninterpretedOption*)_upb_Message_New(&google__protobuf__UninterpretedOption_msg_init, arena);
10440   if (!arr || !sub) return NULL;
10441   UPB_PRIVATE(_upb_Array_Set)
10442   (arr, arr->UPB_PRIVATE(size) - 1, &sub, sizeof(sub));
10443   return sub;
10444 }
10445 
10446 /* google.protobuf.EnumValueOptions */
10447 
google_protobuf_EnumValueOptions_new(upb_Arena * arena)10448 UPB_INLINE google_protobuf_EnumValueOptions* google_protobuf_EnumValueOptions_new(upb_Arena* arena) {
10449   return (google_protobuf_EnumValueOptions*)_upb_Message_New(&google__protobuf__EnumValueOptions_msg_init, arena);
10450 }
google_protobuf_EnumValueOptions_parse(const char * buf,size_t size,upb_Arena * arena)10451 UPB_INLINE google_protobuf_EnumValueOptions* google_protobuf_EnumValueOptions_parse(const char* buf, size_t size, upb_Arena* arena) {
10452   google_protobuf_EnumValueOptions* ret = google_protobuf_EnumValueOptions_new(arena);
10453   if (!ret) return NULL;
10454   if (upb_Decode(buf, size, UPB_UPCAST(ret), &google__protobuf__EnumValueOptions_msg_init, NULL, 0, arena) !=
10455       kUpb_DecodeStatus_Ok) {
10456     return NULL;
10457   }
10458   return ret;
10459 }
google_protobuf_EnumValueOptions_parse_ex(const char * buf,size_t size,const upb_ExtensionRegistry * extreg,int options,upb_Arena * arena)10460 UPB_INLINE google_protobuf_EnumValueOptions* google_protobuf_EnumValueOptions_parse_ex(const char* buf, size_t size,
10461                            const upb_ExtensionRegistry* extreg,
10462                            int options, upb_Arena* arena) {
10463   google_protobuf_EnumValueOptions* ret = google_protobuf_EnumValueOptions_new(arena);
10464   if (!ret) return NULL;
10465   if (upb_Decode(buf, size, UPB_UPCAST(ret), &google__protobuf__EnumValueOptions_msg_init, extreg, options,
10466                  arena) != kUpb_DecodeStatus_Ok) {
10467     return NULL;
10468   }
10469   return ret;
10470 }
google_protobuf_EnumValueOptions_serialize(const google_protobuf_EnumValueOptions * msg,upb_Arena * arena,size_t * len)10471 UPB_INLINE char* google_protobuf_EnumValueOptions_serialize(const google_protobuf_EnumValueOptions* msg, upb_Arena* arena, size_t* len) {
10472   char* ptr;
10473   (void)upb_Encode(UPB_UPCAST(msg), &google__protobuf__EnumValueOptions_msg_init, 0, arena, &ptr, len);
10474   return ptr;
10475 }
google_protobuf_EnumValueOptions_serialize_ex(const google_protobuf_EnumValueOptions * msg,int options,upb_Arena * arena,size_t * len)10476 UPB_INLINE char* google_protobuf_EnumValueOptions_serialize_ex(const google_protobuf_EnumValueOptions* msg, int options,
10477                                  upb_Arena* arena, size_t* len) {
10478   char* ptr;
10479   (void)upb_Encode(UPB_UPCAST(msg), &google__protobuf__EnumValueOptions_msg_init, options, arena, &ptr, len);
10480   return ptr;
10481 }
google_protobuf_EnumValueOptions_clear_deprecated(google_protobuf_EnumValueOptions * msg)10482 UPB_INLINE void google_protobuf_EnumValueOptions_clear_deprecated(google_protobuf_EnumValueOptions* msg) {
10483   const upb_MiniTableField field = {1, 9, 64, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
10484   upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
10485 }
google_protobuf_EnumValueOptions_deprecated(const google_protobuf_EnumValueOptions * msg)10486 UPB_INLINE bool google_protobuf_EnumValueOptions_deprecated(const google_protobuf_EnumValueOptions* msg) {
10487   bool default_val = false;
10488   bool ret;
10489   const upb_MiniTableField field = {1, 9, 64, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
10490   _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field,
10491                                     &default_val, &ret);
10492   return ret;
10493 }
google_protobuf_EnumValueOptions_has_deprecated(const google_protobuf_EnumValueOptions * msg)10494 UPB_INLINE bool google_protobuf_EnumValueOptions_has_deprecated(const google_protobuf_EnumValueOptions* msg) {
10495   const upb_MiniTableField field = {1, 9, 64, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
10496   return upb_Message_HasBaseField(UPB_UPCAST(msg), &field);
10497 }
google_protobuf_EnumValueOptions_clear_features(google_protobuf_EnumValueOptions * msg)10498 UPB_INLINE void google_protobuf_EnumValueOptions_clear_features(google_protobuf_EnumValueOptions* msg) {
10499   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)};
10500   upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
10501 }
google_protobuf_EnumValueOptions_features(const google_protobuf_EnumValueOptions * msg)10502 UPB_INLINE const google_protobuf_FeatureSet* google_protobuf_EnumValueOptions_features(const google_protobuf_EnumValueOptions* msg) {
10503   const google_protobuf_FeatureSet* default_val = NULL;
10504   const google_protobuf_FeatureSet* ret;
10505   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)};
10506   UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__FeatureSet_msg_init);
10507   _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field,
10508                                     &default_val, &ret);
10509   return ret;
10510 }
google_protobuf_EnumValueOptions_has_features(const google_protobuf_EnumValueOptions * msg)10511 UPB_INLINE bool google_protobuf_EnumValueOptions_has_features(const google_protobuf_EnumValueOptions* msg) {
10512   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)};
10513   return upb_Message_HasBaseField(UPB_UPCAST(msg), &field);
10514 }
google_protobuf_EnumValueOptions_clear_debug_redact(google_protobuf_EnumValueOptions * msg)10515 UPB_INLINE void google_protobuf_EnumValueOptions_clear_debug_redact(google_protobuf_EnumValueOptions* msg) {
10516   const upb_MiniTableField field = {3, UPB_SIZE(16, 10), 66, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
10517   upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
10518 }
google_protobuf_EnumValueOptions_debug_redact(const google_protobuf_EnumValueOptions * msg)10519 UPB_INLINE bool google_protobuf_EnumValueOptions_debug_redact(const google_protobuf_EnumValueOptions* msg) {
10520   bool default_val = false;
10521   bool ret;
10522   const upb_MiniTableField field = {3, UPB_SIZE(16, 10), 66, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
10523   _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field,
10524                                     &default_val, &ret);
10525   return ret;
10526 }
google_protobuf_EnumValueOptions_has_debug_redact(const google_protobuf_EnumValueOptions * msg)10527 UPB_INLINE bool google_protobuf_EnumValueOptions_has_debug_redact(const google_protobuf_EnumValueOptions* msg) {
10528   const upb_MiniTableField field = {3, UPB_SIZE(16, 10), 66, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
10529   return upb_Message_HasBaseField(UPB_UPCAST(msg), &field);
10530 }
google_protobuf_EnumValueOptions_clear_feature_support(google_protobuf_EnumValueOptions * msg)10531 UPB_INLINE void google_protobuf_EnumValueOptions_clear_feature_support(google_protobuf_EnumValueOptions* msg) {
10532   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)};
10533   upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
10534 }
google_protobuf_EnumValueOptions_feature_support(const google_protobuf_EnumValueOptions * msg)10535 UPB_INLINE const google_protobuf_FieldOptions_FeatureSupport* google_protobuf_EnumValueOptions_feature_support(const google_protobuf_EnumValueOptions* msg) {
10536   const google_protobuf_FieldOptions_FeatureSupport* default_val = NULL;
10537   const google_protobuf_FieldOptions_FeatureSupport* ret;
10538   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)};
10539   UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__FieldOptions__FeatureSupport_msg_init);
10540   _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field,
10541                                     &default_val, &ret);
10542   return ret;
10543 }
google_protobuf_EnumValueOptions_has_feature_support(const google_protobuf_EnumValueOptions * msg)10544 UPB_INLINE bool google_protobuf_EnumValueOptions_has_feature_support(const google_protobuf_EnumValueOptions* msg) {
10545   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)};
10546   return upb_Message_HasBaseField(UPB_UPCAST(msg), &field);
10547 }
google_protobuf_EnumValueOptions_clear_uninterpreted_option(google_protobuf_EnumValueOptions * msg)10548 UPB_INLINE void google_protobuf_EnumValueOptions_clear_uninterpreted_option(google_protobuf_EnumValueOptions* msg) {
10549   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)};
10550   upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
10551 }
google_protobuf_EnumValueOptions_uninterpreted_option(const google_protobuf_EnumValueOptions * msg,size_t * size)10552 UPB_INLINE const google_protobuf_UninterpretedOption* const* google_protobuf_EnumValueOptions_uninterpreted_option(const google_protobuf_EnumValueOptions* msg, size_t* size) {
10553   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)};
10554   UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__UninterpretedOption_msg_init);
10555   const upb_Array* arr = upb_Message_GetArray(UPB_UPCAST(msg), &field);
10556   if (arr) {
10557     if (size) *size = arr->UPB_PRIVATE(size);
10558     return (const google_protobuf_UninterpretedOption* const*)upb_Array_DataPtr(arr);
10559   } else {
10560     if (size) *size = 0;
10561     return NULL;
10562   }
10563 }
_google_protobuf_EnumValueOptions_uninterpreted_option_upb_array(const google_protobuf_EnumValueOptions * msg,size_t * size)10564 UPB_INLINE const upb_Array* _google_protobuf_EnumValueOptions_uninterpreted_option_upb_array(const google_protobuf_EnumValueOptions* msg, size_t* size) {
10565   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)};
10566   UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__UninterpretedOption_msg_init);
10567   const upb_Array* arr = upb_Message_GetArray(UPB_UPCAST(msg), &field);
10568   if (size) {
10569     *size = arr ? arr->UPB_PRIVATE(size) : 0;
10570   }
10571   return arr;
10572 }
_google_protobuf_EnumValueOptions_uninterpreted_option_mutable_upb_array(google_protobuf_EnumValueOptions * msg,size_t * size,upb_Arena * arena)10573 UPB_INLINE upb_Array* _google_protobuf_EnumValueOptions_uninterpreted_option_mutable_upb_array(google_protobuf_EnumValueOptions* msg, size_t* size, upb_Arena* arena) {
10574   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)};
10575   UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__UninterpretedOption_msg_init);
10576   upb_Array* arr = upb_Message_GetOrCreateMutableArray(UPB_UPCAST(msg),
10577                                                        &field, arena);
10578   if (size) {
10579     *size = arr ? arr->UPB_PRIVATE(size) : 0;
10580   }
10581   return arr;
10582 }
10583 
google_protobuf_EnumValueOptions_set_deprecated(google_protobuf_EnumValueOptions * msg,bool value)10584 UPB_INLINE void google_protobuf_EnumValueOptions_set_deprecated(google_protobuf_EnumValueOptions *msg, bool value) {
10585   const upb_MiniTableField field = {1, 9, 64, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
10586   upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
10587 }
google_protobuf_EnumValueOptions_set_features(google_protobuf_EnumValueOptions * msg,google_protobuf_FeatureSet * value)10588 UPB_INLINE void google_protobuf_EnumValueOptions_set_features(google_protobuf_EnumValueOptions *msg, google_protobuf_FeatureSet* value) {
10589   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)};
10590   UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__FeatureSet_msg_init);
10591   upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
10592 }
google_protobuf_EnumValueOptions_mutable_features(google_protobuf_EnumValueOptions * msg,upb_Arena * arena)10593 UPB_INLINE struct google_protobuf_FeatureSet* google_protobuf_EnumValueOptions_mutable_features(google_protobuf_EnumValueOptions* msg, upb_Arena* arena) {
10594   struct google_protobuf_FeatureSet* sub = (struct google_protobuf_FeatureSet*)google_protobuf_EnumValueOptions_features(msg);
10595   if (sub == NULL) {
10596     sub = (struct google_protobuf_FeatureSet*)_upb_Message_New(&google__protobuf__FeatureSet_msg_init, arena);
10597     if (sub) google_protobuf_EnumValueOptions_set_features(msg, sub);
10598   }
10599   return sub;
10600 }
google_protobuf_EnumValueOptions_set_debug_redact(google_protobuf_EnumValueOptions * msg,bool value)10601 UPB_INLINE void google_protobuf_EnumValueOptions_set_debug_redact(google_protobuf_EnumValueOptions *msg, bool value) {
10602   const upb_MiniTableField field = {3, UPB_SIZE(16, 10), 66, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
10603   upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
10604 }
google_protobuf_EnumValueOptions_set_feature_support(google_protobuf_EnumValueOptions * msg,google_protobuf_FieldOptions_FeatureSupport * value)10605 UPB_INLINE void google_protobuf_EnumValueOptions_set_feature_support(google_protobuf_EnumValueOptions *msg, google_protobuf_FieldOptions_FeatureSupport* value) {
10606   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)};
10607   UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__FieldOptions__FeatureSupport_msg_init);
10608   upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
10609 }
google_protobuf_EnumValueOptions_mutable_feature_support(google_protobuf_EnumValueOptions * msg,upb_Arena * arena)10610 UPB_INLINE struct google_protobuf_FieldOptions_FeatureSupport* google_protobuf_EnumValueOptions_mutable_feature_support(google_protobuf_EnumValueOptions* msg, upb_Arena* arena) {
10611   struct google_protobuf_FieldOptions_FeatureSupport* sub = (struct google_protobuf_FieldOptions_FeatureSupport*)google_protobuf_EnumValueOptions_feature_support(msg);
10612   if (sub == NULL) {
10613     sub = (struct google_protobuf_FieldOptions_FeatureSupport*)_upb_Message_New(&google__protobuf__FieldOptions__FeatureSupport_msg_init, arena);
10614     if (sub) google_protobuf_EnumValueOptions_set_feature_support(msg, sub);
10615   }
10616   return sub;
10617 }
google_protobuf_EnumValueOptions_mutable_uninterpreted_option(google_protobuf_EnumValueOptions * msg,size_t * size)10618 UPB_INLINE google_protobuf_UninterpretedOption** google_protobuf_EnumValueOptions_mutable_uninterpreted_option(google_protobuf_EnumValueOptions* msg, size_t* size) {
10619   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)};
10620   UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__UninterpretedOption_msg_init);
10621   upb_Array* arr = upb_Message_GetMutableArray(UPB_UPCAST(msg), &field);
10622   if (arr) {
10623     if (size) *size = arr->UPB_PRIVATE(size);
10624     return (google_protobuf_UninterpretedOption**)upb_Array_MutableDataPtr(arr);
10625   } else {
10626     if (size) *size = 0;
10627     return NULL;
10628   }
10629 }
google_protobuf_EnumValueOptions_resize_uninterpreted_option(google_protobuf_EnumValueOptions * msg,size_t size,upb_Arena * arena)10630 UPB_INLINE google_protobuf_UninterpretedOption** google_protobuf_EnumValueOptions_resize_uninterpreted_option(google_protobuf_EnumValueOptions* msg, size_t size, upb_Arena* arena) {
10631   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)};
10632   return (google_protobuf_UninterpretedOption**)upb_Message_ResizeArrayUninitialized(UPB_UPCAST(msg),
10633                                                    &field, size, arena);
10634 }
google_protobuf_EnumValueOptions_add_uninterpreted_option(google_protobuf_EnumValueOptions * msg,upb_Arena * arena)10635 UPB_INLINE struct google_protobuf_UninterpretedOption* google_protobuf_EnumValueOptions_add_uninterpreted_option(google_protobuf_EnumValueOptions* msg, upb_Arena* arena) {
10636   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)};
10637   UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__UninterpretedOption_msg_init);
10638   upb_Array* arr = upb_Message_GetOrCreateMutableArray(
10639       UPB_UPCAST(msg), &field, arena);
10640   if (!arr || !UPB_PRIVATE(_upb_Array_ResizeUninitialized)(
10641                   arr, arr->UPB_PRIVATE(size) + 1, arena)) {
10642     return NULL;
10643   }
10644   struct google_protobuf_UninterpretedOption* sub = (struct google_protobuf_UninterpretedOption*)_upb_Message_New(&google__protobuf__UninterpretedOption_msg_init, arena);
10645   if (!arr || !sub) return NULL;
10646   UPB_PRIVATE(_upb_Array_Set)
10647   (arr, arr->UPB_PRIVATE(size) - 1, &sub, sizeof(sub));
10648   return sub;
10649 }
10650 
10651 /* google.protobuf.ServiceOptions */
10652 
google_protobuf_ServiceOptions_new(upb_Arena * arena)10653 UPB_INLINE google_protobuf_ServiceOptions* google_protobuf_ServiceOptions_new(upb_Arena* arena) {
10654   return (google_protobuf_ServiceOptions*)_upb_Message_New(&google__protobuf__ServiceOptions_msg_init, arena);
10655 }
google_protobuf_ServiceOptions_parse(const char * buf,size_t size,upb_Arena * arena)10656 UPB_INLINE google_protobuf_ServiceOptions* google_protobuf_ServiceOptions_parse(const char* buf, size_t size, upb_Arena* arena) {
10657   google_protobuf_ServiceOptions* ret = google_protobuf_ServiceOptions_new(arena);
10658   if (!ret) return NULL;
10659   if (upb_Decode(buf, size, UPB_UPCAST(ret), &google__protobuf__ServiceOptions_msg_init, NULL, 0, arena) !=
10660       kUpb_DecodeStatus_Ok) {
10661     return NULL;
10662   }
10663   return ret;
10664 }
google_protobuf_ServiceOptions_parse_ex(const char * buf,size_t size,const upb_ExtensionRegistry * extreg,int options,upb_Arena * arena)10665 UPB_INLINE google_protobuf_ServiceOptions* google_protobuf_ServiceOptions_parse_ex(const char* buf, size_t size,
10666                            const upb_ExtensionRegistry* extreg,
10667                            int options, upb_Arena* arena) {
10668   google_protobuf_ServiceOptions* ret = google_protobuf_ServiceOptions_new(arena);
10669   if (!ret) return NULL;
10670   if (upb_Decode(buf, size, UPB_UPCAST(ret), &google__protobuf__ServiceOptions_msg_init, extreg, options,
10671                  arena) != kUpb_DecodeStatus_Ok) {
10672     return NULL;
10673   }
10674   return ret;
10675 }
google_protobuf_ServiceOptions_serialize(const google_protobuf_ServiceOptions * msg,upb_Arena * arena,size_t * len)10676 UPB_INLINE char* google_protobuf_ServiceOptions_serialize(const google_protobuf_ServiceOptions* msg, upb_Arena* arena, size_t* len) {
10677   char* ptr;
10678   (void)upb_Encode(UPB_UPCAST(msg), &google__protobuf__ServiceOptions_msg_init, 0, arena, &ptr, len);
10679   return ptr;
10680 }
google_protobuf_ServiceOptions_serialize_ex(const google_protobuf_ServiceOptions * msg,int options,upb_Arena * arena,size_t * len)10681 UPB_INLINE char* google_protobuf_ServiceOptions_serialize_ex(const google_protobuf_ServiceOptions* msg, int options,
10682                                  upb_Arena* arena, size_t* len) {
10683   char* ptr;
10684   (void)upb_Encode(UPB_UPCAST(msg), &google__protobuf__ServiceOptions_msg_init, options, arena, &ptr, len);
10685   return ptr;
10686 }
google_protobuf_ServiceOptions_clear_deprecated(google_protobuf_ServiceOptions * msg)10687 UPB_INLINE void google_protobuf_ServiceOptions_clear_deprecated(google_protobuf_ServiceOptions* msg) {
10688   const upb_MiniTableField field = {33, 9, 64, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
10689   upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
10690 }
google_protobuf_ServiceOptions_deprecated(const google_protobuf_ServiceOptions * msg)10691 UPB_INLINE bool google_protobuf_ServiceOptions_deprecated(const google_protobuf_ServiceOptions* msg) {
10692   bool default_val = false;
10693   bool ret;
10694   const upb_MiniTableField field = {33, 9, 64, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
10695   _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field,
10696                                     &default_val, &ret);
10697   return ret;
10698 }
google_protobuf_ServiceOptions_has_deprecated(const google_protobuf_ServiceOptions * msg)10699 UPB_INLINE bool google_protobuf_ServiceOptions_has_deprecated(const google_protobuf_ServiceOptions* msg) {
10700   const upb_MiniTableField field = {33, 9, 64, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
10701   return upb_Message_HasBaseField(UPB_UPCAST(msg), &field);
10702 }
google_protobuf_ServiceOptions_clear_features(google_protobuf_ServiceOptions * msg)10703 UPB_INLINE void google_protobuf_ServiceOptions_clear_features(google_protobuf_ServiceOptions* msg) {
10704   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)};
10705   upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
10706 }
google_protobuf_ServiceOptions_features(const google_protobuf_ServiceOptions * msg)10707 UPB_INLINE const google_protobuf_FeatureSet* google_protobuf_ServiceOptions_features(const google_protobuf_ServiceOptions* msg) {
10708   const google_protobuf_FeatureSet* default_val = NULL;
10709   const google_protobuf_FeatureSet* ret;
10710   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)};
10711   UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__FeatureSet_msg_init);
10712   _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field,
10713                                     &default_val, &ret);
10714   return ret;
10715 }
google_protobuf_ServiceOptions_has_features(const google_protobuf_ServiceOptions * msg)10716 UPB_INLINE bool google_protobuf_ServiceOptions_has_features(const google_protobuf_ServiceOptions* msg) {
10717   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)};
10718   return upb_Message_HasBaseField(UPB_UPCAST(msg), &field);
10719 }
google_protobuf_ServiceOptions_clear_uninterpreted_option(google_protobuf_ServiceOptions * msg)10720 UPB_INLINE void google_protobuf_ServiceOptions_clear_uninterpreted_option(google_protobuf_ServiceOptions* msg) {
10721   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)};
10722   upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
10723 }
google_protobuf_ServiceOptions_uninterpreted_option(const google_protobuf_ServiceOptions * msg,size_t * size)10724 UPB_INLINE const google_protobuf_UninterpretedOption* const* google_protobuf_ServiceOptions_uninterpreted_option(const google_protobuf_ServiceOptions* msg, size_t* size) {
10725   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)};
10726   UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__UninterpretedOption_msg_init);
10727   const upb_Array* arr = upb_Message_GetArray(UPB_UPCAST(msg), &field);
10728   if (arr) {
10729     if (size) *size = arr->UPB_PRIVATE(size);
10730     return (const google_protobuf_UninterpretedOption* const*)upb_Array_DataPtr(arr);
10731   } else {
10732     if (size) *size = 0;
10733     return NULL;
10734   }
10735 }
_google_protobuf_ServiceOptions_uninterpreted_option_upb_array(const google_protobuf_ServiceOptions * msg,size_t * size)10736 UPB_INLINE const upb_Array* _google_protobuf_ServiceOptions_uninterpreted_option_upb_array(const google_protobuf_ServiceOptions* msg, size_t* size) {
10737   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)};
10738   UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__UninterpretedOption_msg_init);
10739   const upb_Array* arr = upb_Message_GetArray(UPB_UPCAST(msg), &field);
10740   if (size) {
10741     *size = arr ? arr->UPB_PRIVATE(size) : 0;
10742   }
10743   return arr;
10744 }
_google_protobuf_ServiceOptions_uninterpreted_option_mutable_upb_array(google_protobuf_ServiceOptions * msg,size_t * size,upb_Arena * arena)10745 UPB_INLINE upb_Array* _google_protobuf_ServiceOptions_uninterpreted_option_mutable_upb_array(google_protobuf_ServiceOptions* msg, size_t* size, upb_Arena* arena) {
10746   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)};
10747   UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__UninterpretedOption_msg_init);
10748   upb_Array* arr = upb_Message_GetOrCreateMutableArray(UPB_UPCAST(msg),
10749                                                        &field, arena);
10750   if (size) {
10751     *size = arr ? arr->UPB_PRIVATE(size) : 0;
10752   }
10753   return arr;
10754 }
10755 
google_protobuf_ServiceOptions_set_deprecated(google_protobuf_ServiceOptions * msg,bool value)10756 UPB_INLINE void google_protobuf_ServiceOptions_set_deprecated(google_protobuf_ServiceOptions *msg, bool value) {
10757   const upb_MiniTableField field = {33, 9, 64, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
10758   upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
10759 }
google_protobuf_ServiceOptions_set_features(google_protobuf_ServiceOptions * msg,google_protobuf_FeatureSet * value)10760 UPB_INLINE void google_protobuf_ServiceOptions_set_features(google_protobuf_ServiceOptions *msg, google_protobuf_FeatureSet* value) {
10761   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)};
10762   UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__FeatureSet_msg_init);
10763   upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
10764 }
google_protobuf_ServiceOptions_mutable_features(google_protobuf_ServiceOptions * msg,upb_Arena * arena)10765 UPB_INLINE struct google_protobuf_FeatureSet* google_protobuf_ServiceOptions_mutable_features(google_protobuf_ServiceOptions* msg, upb_Arena* arena) {
10766   struct google_protobuf_FeatureSet* sub = (struct google_protobuf_FeatureSet*)google_protobuf_ServiceOptions_features(msg);
10767   if (sub == NULL) {
10768     sub = (struct google_protobuf_FeatureSet*)_upb_Message_New(&google__protobuf__FeatureSet_msg_init, arena);
10769     if (sub) google_protobuf_ServiceOptions_set_features(msg, sub);
10770   }
10771   return sub;
10772 }
google_protobuf_ServiceOptions_mutable_uninterpreted_option(google_protobuf_ServiceOptions * msg,size_t * size)10773 UPB_INLINE google_protobuf_UninterpretedOption** google_protobuf_ServiceOptions_mutable_uninterpreted_option(google_protobuf_ServiceOptions* msg, size_t* size) {
10774   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)};
10775   UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__UninterpretedOption_msg_init);
10776   upb_Array* arr = upb_Message_GetMutableArray(UPB_UPCAST(msg), &field);
10777   if (arr) {
10778     if (size) *size = arr->UPB_PRIVATE(size);
10779     return (google_protobuf_UninterpretedOption**)upb_Array_MutableDataPtr(arr);
10780   } else {
10781     if (size) *size = 0;
10782     return NULL;
10783   }
10784 }
google_protobuf_ServiceOptions_resize_uninterpreted_option(google_protobuf_ServiceOptions * msg,size_t size,upb_Arena * arena)10785 UPB_INLINE google_protobuf_UninterpretedOption** google_protobuf_ServiceOptions_resize_uninterpreted_option(google_protobuf_ServiceOptions* msg, size_t size, upb_Arena* arena) {
10786   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)};
10787   return (google_protobuf_UninterpretedOption**)upb_Message_ResizeArrayUninitialized(UPB_UPCAST(msg),
10788                                                    &field, size, arena);
10789 }
google_protobuf_ServiceOptions_add_uninterpreted_option(google_protobuf_ServiceOptions * msg,upb_Arena * arena)10790 UPB_INLINE struct google_protobuf_UninterpretedOption* google_protobuf_ServiceOptions_add_uninterpreted_option(google_protobuf_ServiceOptions* msg, upb_Arena* arena) {
10791   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)};
10792   UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__UninterpretedOption_msg_init);
10793   upb_Array* arr = upb_Message_GetOrCreateMutableArray(
10794       UPB_UPCAST(msg), &field, arena);
10795   if (!arr || !UPB_PRIVATE(_upb_Array_ResizeUninitialized)(
10796                   arr, arr->UPB_PRIVATE(size) + 1, arena)) {
10797     return NULL;
10798   }
10799   struct google_protobuf_UninterpretedOption* sub = (struct google_protobuf_UninterpretedOption*)_upb_Message_New(&google__protobuf__UninterpretedOption_msg_init, arena);
10800   if (!arr || !sub) return NULL;
10801   UPB_PRIVATE(_upb_Array_Set)
10802   (arr, arr->UPB_PRIVATE(size) - 1, &sub, sizeof(sub));
10803   return sub;
10804 }
10805 
10806 /* google.protobuf.MethodOptions */
10807 
google_protobuf_MethodOptions_new(upb_Arena * arena)10808 UPB_INLINE google_protobuf_MethodOptions* google_protobuf_MethodOptions_new(upb_Arena* arena) {
10809   return (google_protobuf_MethodOptions*)_upb_Message_New(&google__protobuf__MethodOptions_msg_init, arena);
10810 }
google_protobuf_MethodOptions_parse(const char * buf,size_t size,upb_Arena * arena)10811 UPB_INLINE google_protobuf_MethodOptions* google_protobuf_MethodOptions_parse(const char* buf, size_t size, upb_Arena* arena) {
10812   google_protobuf_MethodOptions* ret = google_protobuf_MethodOptions_new(arena);
10813   if (!ret) return NULL;
10814   if (upb_Decode(buf, size, UPB_UPCAST(ret), &google__protobuf__MethodOptions_msg_init, NULL, 0, arena) !=
10815       kUpb_DecodeStatus_Ok) {
10816     return NULL;
10817   }
10818   return ret;
10819 }
google_protobuf_MethodOptions_parse_ex(const char * buf,size_t size,const upb_ExtensionRegistry * extreg,int options,upb_Arena * arena)10820 UPB_INLINE google_protobuf_MethodOptions* google_protobuf_MethodOptions_parse_ex(const char* buf, size_t size,
10821                            const upb_ExtensionRegistry* extreg,
10822                            int options, upb_Arena* arena) {
10823   google_protobuf_MethodOptions* ret = google_protobuf_MethodOptions_new(arena);
10824   if (!ret) return NULL;
10825   if (upb_Decode(buf, size, UPB_UPCAST(ret), &google__protobuf__MethodOptions_msg_init, extreg, options,
10826                  arena) != kUpb_DecodeStatus_Ok) {
10827     return NULL;
10828   }
10829   return ret;
10830 }
google_protobuf_MethodOptions_serialize(const google_protobuf_MethodOptions * msg,upb_Arena * arena,size_t * len)10831 UPB_INLINE char* google_protobuf_MethodOptions_serialize(const google_protobuf_MethodOptions* msg, upb_Arena* arena, size_t* len) {
10832   char* ptr;
10833   (void)upb_Encode(UPB_UPCAST(msg), &google__protobuf__MethodOptions_msg_init, 0, arena, &ptr, len);
10834   return ptr;
10835 }
google_protobuf_MethodOptions_serialize_ex(const google_protobuf_MethodOptions * msg,int options,upb_Arena * arena,size_t * len)10836 UPB_INLINE char* google_protobuf_MethodOptions_serialize_ex(const google_protobuf_MethodOptions* msg, int options,
10837                                  upb_Arena* arena, size_t* len) {
10838   char* ptr;
10839   (void)upb_Encode(UPB_UPCAST(msg), &google__protobuf__MethodOptions_msg_init, options, arena, &ptr, len);
10840   return ptr;
10841 }
google_protobuf_MethodOptions_clear_deprecated(google_protobuf_MethodOptions * msg)10842 UPB_INLINE void google_protobuf_MethodOptions_clear_deprecated(google_protobuf_MethodOptions* msg) {
10843   const upb_MiniTableField field = {33, 9, 64, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
10844   upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
10845 }
google_protobuf_MethodOptions_deprecated(const google_protobuf_MethodOptions * msg)10846 UPB_INLINE bool google_protobuf_MethodOptions_deprecated(const google_protobuf_MethodOptions* msg) {
10847   bool default_val = false;
10848   bool ret;
10849   const upb_MiniTableField field = {33, 9, 64, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
10850   _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field,
10851                                     &default_val, &ret);
10852   return ret;
10853 }
google_protobuf_MethodOptions_has_deprecated(const google_protobuf_MethodOptions * msg)10854 UPB_INLINE bool google_protobuf_MethodOptions_has_deprecated(const google_protobuf_MethodOptions* msg) {
10855   const upb_MiniTableField field = {33, 9, 64, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
10856   return upb_Message_HasBaseField(UPB_UPCAST(msg), &field);
10857 }
google_protobuf_MethodOptions_clear_idempotency_level(google_protobuf_MethodOptions * msg)10858 UPB_INLINE void google_protobuf_MethodOptions_clear_idempotency_level(google_protobuf_MethodOptions* msg) {
10859   const upb_MiniTableField field = {34, 12, 65, 2, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
10860   upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
10861 }
google_protobuf_MethodOptions_idempotency_level(const google_protobuf_MethodOptions * msg)10862 UPB_INLINE int32_t google_protobuf_MethodOptions_idempotency_level(const google_protobuf_MethodOptions* msg) {
10863   int32_t default_val = 0;
10864   int32_t ret;
10865   const upb_MiniTableField field = {34, 12, 65, 2, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
10866   _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field,
10867                                     &default_val, &ret);
10868   return ret;
10869 }
google_protobuf_MethodOptions_has_idempotency_level(const google_protobuf_MethodOptions * msg)10870 UPB_INLINE bool google_protobuf_MethodOptions_has_idempotency_level(const google_protobuf_MethodOptions* msg) {
10871   const upb_MiniTableField field = {34, 12, 65, 2, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
10872   return upb_Message_HasBaseField(UPB_UPCAST(msg), &field);
10873 }
google_protobuf_MethodOptions_clear_features(google_protobuf_MethodOptions * msg)10874 UPB_INLINE void google_protobuf_MethodOptions_clear_features(google_protobuf_MethodOptions* msg) {
10875   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)};
10876   upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
10877 }
google_protobuf_MethodOptions_features(const google_protobuf_MethodOptions * msg)10878 UPB_INLINE const google_protobuf_FeatureSet* google_protobuf_MethodOptions_features(const google_protobuf_MethodOptions* msg) {
10879   const google_protobuf_FeatureSet* default_val = NULL;
10880   const google_protobuf_FeatureSet* ret;
10881   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)};
10882   UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__FeatureSet_msg_init);
10883   _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field,
10884                                     &default_val, &ret);
10885   return ret;
10886 }
google_protobuf_MethodOptions_has_features(const google_protobuf_MethodOptions * msg)10887 UPB_INLINE bool google_protobuf_MethodOptions_has_features(const google_protobuf_MethodOptions* msg) {
10888   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)};
10889   return upb_Message_HasBaseField(UPB_UPCAST(msg), &field);
10890 }
google_protobuf_MethodOptions_clear_uninterpreted_option(google_protobuf_MethodOptions * msg)10891 UPB_INLINE void google_protobuf_MethodOptions_clear_uninterpreted_option(google_protobuf_MethodOptions* msg) {
10892   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)};
10893   upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
10894 }
google_protobuf_MethodOptions_uninterpreted_option(const google_protobuf_MethodOptions * msg,size_t * size)10895 UPB_INLINE const google_protobuf_UninterpretedOption* const* google_protobuf_MethodOptions_uninterpreted_option(const google_protobuf_MethodOptions* msg, size_t* size) {
10896   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)};
10897   UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__UninterpretedOption_msg_init);
10898   const upb_Array* arr = upb_Message_GetArray(UPB_UPCAST(msg), &field);
10899   if (arr) {
10900     if (size) *size = arr->UPB_PRIVATE(size);
10901     return (const google_protobuf_UninterpretedOption* const*)upb_Array_DataPtr(arr);
10902   } else {
10903     if (size) *size = 0;
10904     return NULL;
10905   }
10906 }
_google_protobuf_MethodOptions_uninterpreted_option_upb_array(const google_protobuf_MethodOptions * msg,size_t * size)10907 UPB_INLINE const upb_Array* _google_protobuf_MethodOptions_uninterpreted_option_upb_array(const google_protobuf_MethodOptions* msg, size_t* size) {
10908   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)};
10909   UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__UninterpretedOption_msg_init);
10910   const upb_Array* arr = upb_Message_GetArray(UPB_UPCAST(msg), &field);
10911   if (size) {
10912     *size = arr ? arr->UPB_PRIVATE(size) : 0;
10913   }
10914   return arr;
10915 }
_google_protobuf_MethodOptions_uninterpreted_option_mutable_upb_array(google_protobuf_MethodOptions * msg,size_t * size,upb_Arena * arena)10916 UPB_INLINE upb_Array* _google_protobuf_MethodOptions_uninterpreted_option_mutable_upb_array(google_protobuf_MethodOptions* msg, size_t* size, upb_Arena* arena) {
10917   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)};
10918   UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__UninterpretedOption_msg_init);
10919   upb_Array* arr = upb_Message_GetOrCreateMutableArray(UPB_UPCAST(msg),
10920                                                        &field, arena);
10921   if (size) {
10922     *size = arr ? arr->UPB_PRIVATE(size) : 0;
10923   }
10924   return arr;
10925 }
10926 
google_protobuf_MethodOptions_set_deprecated(google_protobuf_MethodOptions * msg,bool value)10927 UPB_INLINE void google_protobuf_MethodOptions_set_deprecated(google_protobuf_MethodOptions *msg, bool value) {
10928   const upb_MiniTableField field = {33, 9, 64, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
10929   upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
10930 }
google_protobuf_MethodOptions_set_idempotency_level(google_protobuf_MethodOptions * msg,int32_t value)10931 UPB_INLINE void google_protobuf_MethodOptions_set_idempotency_level(google_protobuf_MethodOptions *msg, int32_t value) {
10932   const upb_MiniTableField field = {34, 12, 65, 2, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
10933   upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
10934 }
google_protobuf_MethodOptions_set_features(google_protobuf_MethodOptions * msg,google_protobuf_FeatureSet * value)10935 UPB_INLINE void google_protobuf_MethodOptions_set_features(google_protobuf_MethodOptions *msg, google_protobuf_FeatureSet* value) {
10936   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)};
10937   UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__FeatureSet_msg_init);
10938   upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
10939 }
google_protobuf_MethodOptions_mutable_features(google_protobuf_MethodOptions * msg,upb_Arena * arena)10940 UPB_INLINE struct google_protobuf_FeatureSet* google_protobuf_MethodOptions_mutable_features(google_protobuf_MethodOptions* msg, upb_Arena* arena) {
10941   struct google_protobuf_FeatureSet* sub = (struct google_protobuf_FeatureSet*)google_protobuf_MethodOptions_features(msg);
10942   if (sub == NULL) {
10943     sub = (struct google_protobuf_FeatureSet*)_upb_Message_New(&google__protobuf__FeatureSet_msg_init, arena);
10944     if (sub) google_protobuf_MethodOptions_set_features(msg, sub);
10945   }
10946   return sub;
10947 }
google_protobuf_MethodOptions_mutable_uninterpreted_option(google_protobuf_MethodOptions * msg,size_t * size)10948 UPB_INLINE google_protobuf_UninterpretedOption** google_protobuf_MethodOptions_mutable_uninterpreted_option(google_protobuf_MethodOptions* msg, size_t* size) {
10949   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)};
10950   UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__UninterpretedOption_msg_init);
10951   upb_Array* arr = upb_Message_GetMutableArray(UPB_UPCAST(msg), &field);
10952   if (arr) {
10953     if (size) *size = arr->UPB_PRIVATE(size);
10954     return (google_protobuf_UninterpretedOption**)upb_Array_MutableDataPtr(arr);
10955   } else {
10956     if (size) *size = 0;
10957     return NULL;
10958   }
10959 }
google_protobuf_MethodOptions_resize_uninterpreted_option(google_protobuf_MethodOptions * msg,size_t size,upb_Arena * arena)10960 UPB_INLINE google_protobuf_UninterpretedOption** google_protobuf_MethodOptions_resize_uninterpreted_option(google_protobuf_MethodOptions* msg, size_t size, upb_Arena* arena) {
10961   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)};
10962   return (google_protobuf_UninterpretedOption**)upb_Message_ResizeArrayUninitialized(UPB_UPCAST(msg),
10963                                                    &field, size, arena);
10964 }
google_protobuf_MethodOptions_add_uninterpreted_option(google_protobuf_MethodOptions * msg,upb_Arena * arena)10965 UPB_INLINE struct google_protobuf_UninterpretedOption* google_protobuf_MethodOptions_add_uninterpreted_option(google_protobuf_MethodOptions* msg, upb_Arena* arena) {
10966   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)};
10967   UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__UninterpretedOption_msg_init);
10968   upb_Array* arr = upb_Message_GetOrCreateMutableArray(
10969       UPB_UPCAST(msg), &field, arena);
10970   if (!arr || !UPB_PRIVATE(_upb_Array_ResizeUninitialized)(
10971                   arr, arr->UPB_PRIVATE(size) + 1, arena)) {
10972     return NULL;
10973   }
10974   struct google_protobuf_UninterpretedOption* sub = (struct google_protobuf_UninterpretedOption*)_upb_Message_New(&google__protobuf__UninterpretedOption_msg_init, arena);
10975   if (!arr || !sub) return NULL;
10976   UPB_PRIVATE(_upb_Array_Set)
10977   (arr, arr->UPB_PRIVATE(size) - 1, &sub, sizeof(sub));
10978   return sub;
10979 }
10980 
10981 /* google.protobuf.UninterpretedOption */
10982 
google_protobuf_UninterpretedOption_new(upb_Arena * arena)10983 UPB_INLINE google_protobuf_UninterpretedOption* google_protobuf_UninterpretedOption_new(upb_Arena* arena) {
10984   return (google_protobuf_UninterpretedOption*)_upb_Message_New(&google__protobuf__UninterpretedOption_msg_init, arena);
10985 }
google_protobuf_UninterpretedOption_parse(const char * buf,size_t size,upb_Arena * arena)10986 UPB_INLINE google_protobuf_UninterpretedOption* google_protobuf_UninterpretedOption_parse(const char* buf, size_t size, upb_Arena* arena) {
10987   google_protobuf_UninterpretedOption* ret = google_protobuf_UninterpretedOption_new(arena);
10988   if (!ret) return NULL;
10989   if (upb_Decode(buf, size, UPB_UPCAST(ret), &google__protobuf__UninterpretedOption_msg_init, NULL, 0, arena) !=
10990       kUpb_DecodeStatus_Ok) {
10991     return NULL;
10992   }
10993   return ret;
10994 }
google_protobuf_UninterpretedOption_parse_ex(const char * buf,size_t size,const upb_ExtensionRegistry * extreg,int options,upb_Arena * arena)10995 UPB_INLINE google_protobuf_UninterpretedOption* google_protobuf_UninterpretedOption_parse_ex(const char* buf, size_t size,
10996                            const upb_ExtensionRegistry* extreg,
10997                            int options, upb_Arena* arena) {
10998   google_protobuf_UninterpretedOption* ret = google_protobuf_UninterpretedOption_new(arena);
10999   if (!ret) return NULL;
11000   if (upb_Decode(buf, size, UPB_UPCAST(ret), &google__protobuf__UninterpretedOption_msg_init, extreg, options,
11001                  arena) != kUpb_DecodeStatus_Ok) {
11002     return NULL;
11003   }
11004   return ret;
11005 }
google_protobuf_UninterpretedOption_serialize(const google_protobuf_UninterpretedOption * msg,upb_Arena * arena,size_t * len)11006 UPB_INLINE char* google_protobuf_UninterpretedOption_serialize(const google_protobuf_UninterpretedOption* msg, upb_Arena* arena, size_t* len) {
11007   char* ptr;
11008   (void)upb_Encode(UPB_UPCAST(msg), &google__protobuf__UninterpretedOption_msg_init, 0, arena, &ptr, len);
11009   return ptr;
11010 }
google_protobuf_UninterpretedOption_serialize_ex(const google_protobuf_UninterpretedOption * msg,int options,upb_Arena * arena,size_t * len)11011 UPB_INLINE char* google_protobuf_UninterpretedOption_serialize_ex(const google_protobuf_UninterpretedOption* msg, int options,
11012                                  upb_Arena* arena, size_t* len) {
11013   char* ptr;
11014   (void)upb_Encode(UPB_UPCAST(msg), &google__protobuf__UninterpretedOption_msg_init, options, arena, &ptr, len);
11015   return ptr;
11016 }
google_protobuf_UninterpretedOption_clear_name(google_protobuf_UninterpretedOption * msg)11017 UPB_INLINE void google_protobuf_UninterpretedOption_clear_name(google_protobuf_UninterpretedOption* msg) {
11018   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)};
11019   upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
11020 }
google_protobuf_UninterpretedOption_name(const google_protobuf_UninterpretedOption * msg,size_t * size)11021 UPB_INLINE const google_protobuf_UninterpretedOption_NamePart* const* google_protobuf_UninterpretedOption_name(const google_protobuf_UninterpretedOption* msg, size_t* size) {
11022   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)};
11023   UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__UninterpretedOption__NamePart_msg_init);
11024   const upb_Array* arr = upb_Message_GetArray(UPB_UPCAST(msg), &field);
11025   if (arr) {
11026     if (size) *size = arr->UPB_PRIVATE(size);
11027     return (const google_protobuf_UninterpretedOption_NamePart* const*)upb_Array_DataPtr(arr);
11028   } else {
11029     if (size) *size = 0;
11030     return NULL;
11031   }
11032 }
_google_protobuf_UninterpretedOption_name_upb_array(const google_protobuf_UninterpretedOption * msg,size_t * size)11033 UPB_INLINE const upb_Array* _google_protobuf_UninterpretedOption_name_upb_array(const google_protobuf_UninterpretedOption* msg, size_t* size) {
11034   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)};
11035   UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__UninterpretedOption__NamePart_msg_init);
11036   const upb_Array* arr = upb_Message_GetArray(UPB_UPCAST(msg), &field);
11037   if (size) {
11038     *size = arr ? arr->UPB_PRIVATE(size) : 0;
11039   }
11040   return arr;
11041 }
_google_protobuf_UninterpretedOption_name_mutable_upb_array(google_protobuf_UninterpretedOption * msg,size_t * size,upb_Arena * arena)11042 UPB_INLINE upb_Array* _google_protobuf_UninterpretedOption_name_mutable_upb_array(google_protobuf_UninterpretedOption* msg, size_t* size, upb_Arena* arena) {
11043   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)};
11044   UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__UninterpretedOption__NamePart_msg_init);
11045   upb_Array* arr = upb_Message_GetOrCreateMutableArray(UPB_UPCAST(msg),
11046                                                        &field, arena);
11047   if (size) {
11048     *size = arr ? arr->UPB_PRIVATE(size) : 0;
11049   }
11050   return arr;
11051 }
google_protobuf_UninterpretedOption_clear_identifier_value(google_protobuf_UninterpretedOption * msg)11052 UPB_INLINE void google_protobuf_UninterpretedOption_clear_identifier_value(google_protobuf_UninterpretedOption* msg) {
11053   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)};
11054   upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
11055 }
google_protobuf_UninterpretedOption_identifier_value(const google_protobuf_UninterpretedOption * msg)11056 UPB_INLINE upb_StringView google_protobuf_UninterpretedOption_identifier_value(const google_protobuf_UninterpretedOption* msg) {
11057   upb_StringView default_val = upb_StringView_FromString("");
11058   upb_StringView ret;
11059   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)};
11060   _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field,
11061                                     &default_val, &ret);
11062   return ret;
11063 }
google_protobuf_UninterpretedOption_has_identifier_value(const google_protobuf_UninterpretedOption * msg)11064 UPB_INLINE bool google_protobuf_UninterpretedOption_has_identifier_value(const google_protobuf_UninterpretedOption* msg) {
11065   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)};
11066   return upb_Message_HasBaseField(UPB_UPCAST(msg), &field);
11067 }
google_protobuf_UninterpretedOption_clear_positive_int_value(google_protobuf_UninterpretedOption * msg)11068 UPB_INLINE void google_protobuf_UninterpretedOption_clear_positive_int_value(google_protobuf_UninterpretedOption* msg) {
11069   const upb_MiniTableField field = {4, UPB_SIZE(24, 40), 65, kUpb_NoSub, 4, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)};
11070   upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
11071 }
google_protobuf_UninterpretedOption_positive_int_value(const google_protobuf_UninterpretedOption * msg)11072 UPB_INLINE uint64_t google_protobuf_UninterpretedOption_positive_int_value(const google_protobuf_UninterpretedOption* msg) {
11073   uint64_t default_val = (uint64_t)0ull;
11074   uint64_t ret;
11075   const upb_MiniTableField field = {4, UPB_SIZE(24, 40), 65, kUpb_NoSub, 4, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)};
11076   _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field,
11077                                     &default_val, &ret);
11078   return ret;
11079 }
google_protobuf_UninterpretedOption_has_positive_int_value(const google_protobuf_UninterpretedOption * msg)11080 UPB_INLINE bool google_protobuf_UninterpretedOption_has_positive_int_value(const google_protobuf_UninterpretedOption* msg) {
11081   const upb_MiniTableField field = {4, UPB_SIZE(24, 40), 65, kUpb_NoSub, 4, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)};
11082   return upb_Message_HasBaseField(UPB_UPCAST(msg), &field);
11083 }
google_protobuf_UninterpretedOption_clear_negative_int_value(google_protobuf_UninterpretedOption * msg)11084 UPB_INLINE void google_protobuf_UninterpretedOption_clear_negative_int_value(google_protobuf_UninterpretedOption* msg) {
11085   const upb_MiniTableField field = {5, UPB_SIZE(32, 48), 66, kUpb_NoSub, 3, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)};
11086   upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
11087 }
google_protobuf_UninterpretedOption_negative_int_value(const google_protobuf_UninterpretedOption * msg)11088 UPB_INLINE int64_t google_protobuf_UninterpretedOption_negative_int_value(const google_protobuf_UninterpretedOption* msg) {
11089   int64_t default_val = (int64_t)0ll;
11090   int64_t ret;
11091   const upb_MiniTableField field = {5, UPB_SIZE(32, 48), 66, kUpb_NoSub, 3, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)};
11092   _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field,
11093                                     &default_val, &ret);
11094   return ret;
11095 }
google_protobuf_UninterpretedOption_has_negative_int_value(const google_protobuf_UninterpretedOption * msg)11096 UPB_INLINE bool google_protobuf_UninterpretedOption_has_negative_int_value(const google_protobuf_UninterpretedOption* msg) {
11097   const upb_MiniTableField field = {5, UPB_SIZE(32, 48), 66, kUpb_NoSub, 3, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)};
11098   return upb_Message_HasBaseField(UPB_UPCAST(msg), &field);
11099 }
google_protobuf_UninterpretedOption_clear_double_value(google_protobuf_UninterpretedOption * msg)11100 UPB_INLINE void google_protobuf_UninterpretedOption_clear_double_value(google_protobuf_UninterpretedOption* msg) {
11101   const upb_MiniTableField field = {6, UPB_SIZE(40, 56), 67, kUpb_NoSub, 1, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)};
11102   upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
11103 }
google_protobuf_UninterpretedOption_double_value(const google_protobuf_UninterpretedOption * msg)11104 UPB_INLINE double google_protobuf_UninterpretedOption_double_value(const google_protobuf_UninterpretedOption* msg) {
11105   double default_val = 0;
11106   double ret;
11107   const upb_MiniTableField field = {6, UPB_SIZE(40, 56), 67, kUpb_NoSub, 1, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)};
11108   _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field,
11109                                     &default_val, &ret);
11110   return ret;
11111 }
google_protobuf_UninterpretedOption_has_double_value(const google_protobuf_UninterpretedOption * msg)11112 UPB_INLINE bool google_protobuf_UninterpretedOption_has_double_value(const google_protobuf_UninterpretedOption* msg) {
11113   const upb_MiniTableField field = {6, UPB_SIZE(40, 56), 67, kUpb_NoSub, 1, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)};
11114   return upb_Message_HasBaseField(UPB_UPCAST(msg), &field);
11115 }
google_protobuf_UninterpretedOption_clear_string_value(google_protobuf_UninterpretedOption * msg)11116 UPB_INLINE void google_protobuf_UninterpretedOption_clear_string_value(google_protobuf_UninterpretedOption* msg) {
11117   const upb_MiniTableField field = {7, UPB_SIZE(48, 64), 68, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
11118   upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
11119 }
google_protobuf_UninterpretedOption_string_value(const google_protobuf_UninterpretedOption * msg)11120 UPB_INLINE upb_StringView google_protobuf_UninterpretedOption_string_value(const google_protobuf_UninterpretedOption* msg) {
11121   upb_StringView default_val = upb_StringView_FromString("");
11122   upb_StringView ret;
11123   const upb_MiniTableField field = {7, UPB_SIZE(48, 64), 68, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
11124   _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field,
11125                                     &default_val, &ret);
11126   return ret;
11127 }
google_protobuf_UninterpretedOption_has_string_value(const google_protobuf_UninterpretedOption * msg)11128 UPB_INLINE bool google_protobuf_UninterpretedOption_has_string_value(const google_protobuf_UninterpretedOption* msg) {
11129   const upb_MiniTableField field = {7, UPB_SIZE(48, 64), 68, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
11130   return upb_Message_HasBaseField(UPB_UPCAST(msg), &field);
11131 }
google_protobuf_UninterpretedOption_clear_aggregate_value(google_protobuf_UninterpretedOption * msg)11132 UPB_INLINE void google_protobuf_UninterpretedOption_clear_aggregate_value(google_protobuf_UninterpretedOption* msg) {
11133   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)};
11134   upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
11135 }
google_protobuf_UninterpretedOption_aggregate_value(const google_protobuf_UninterpretedOption * msg)11136 UPB_INLINE upb_StringView google_protobuf_UninterpretedOption_aggregate_value(const google_protobuf_UninterpretedOption* msg) {
11137   upb_StringView default_val = upb_StringView_FromString("");
11138   upb_StringView ret;
11139   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)};
11140   _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field,
11141                                     &default_val, &ret);
11142   return ret;
11143 }
google_protobuf_UninterpretedOption_has_aggregate_value(const google_protobuf_UninterpretedOption * msg)11144 UPB_INLINE bool google_protobuf_UninterpretedOption_has_aggregate_value(const google_protobuf_UninterpretedOption* msg) {
11145   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)};
11146   return upb_Message_HasBaseField(UPB_UPCAST(msg), &field);
11147 }
11148 
google_protobuf_UninterpretedOption_mutable_name(google_protobuf_UninterpretedOption * msg,size_t * size)11149 UPB_INLINE google_protobuf_UninterpretedOption_NamePart** google_protobuf_UninterpretedOption_mutable_name(google_protobuf_UninterpretedOption* msg, size_t* size) {
11150   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)};
11151   UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__UninterpretedOption__NamePart_msg_init);
11152   upb_Array* arr = upb_Message_GetMutableArray(UPB_UPCAST(msg), &field);
11153   if (arr) {
11154     if (size) *size = arr->UPB_PRIVATE(size);
11155     return (google_protobuf_UninterpretedOption_NamePart**)upb_Array_MutableDataPtr(arr);
11156   } else {
11157     if (size) *size = 0;
11158     return NULL;
11159   }
11160 }
google_protobuf_UninterpretedOption_resize_name(google_protobuf_UninterpretedOption * msg,size_t size,upb_Arena * arena)11161 UPB_INLINE google_protobuf_UninterpretedOption_NamePart** google_protobuf_UninterpretedOption_resize_name(google_protobuf_UninterpretedOption* msg, size_t size, upb_Arena* arena) {
11162   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)};
11163   return (google_protobuf_UninterpretedOption_NamePart**)upb_Message_ResizeArrayUninitialized(UPB_UPCAST(msg),
11164                                                    &field, size, arena);
11165 }
google_protobuf_UninterpretedOption_add_name(google_protobuf_UninterpretedOption * msg,upb_Arena * arena)11166 UPB_INLINE struct google_protobuf_UninterpretedOption_NamePart* google_protobuf_UninterpretedOption_add_name(google_protobuf_UninterpretedOption* msg, upb_Arena* arena) {
11167   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)};
11168   UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__UninterpretedOption__NamePart_msg_init);
11169   upb_Array* arr = upb_Message_GetOrCreateMutableArray(
11170       UPB_UPCAST(msg), &field, arena);
11171   if (!arr || !UPB_PRIVATE(_upb_Array_ResizeUninitialized)(
11172                   arr, arr->UPB_PRIVATE(size) + 1, arena)) {
11173     return NULL;
11174   }
11175   struct google_protobuf_UninterpretedOption_NamePart* sub = (struct google_protobuf_UninterpretedOption_NamePart*)_upb_Message_New(&google__protobuf__UninterpretedOption__NamePart_msg_init, arena);
11176   if (!arr || !sub) return NULL;
11177   UPB_PRIVATE(_upb_Array_Set)
11178   (arr, arr->UPB_PRIVATE(size) - 1, &sub, sizeof(sub));
11179   return sub;
11180 }
google_protobuf_UninterpretedOption_set_identifier_value(google_protobuf_UninterpretedOption * msg,upb_StringView value)11181 UPB_INLINE void google_protobuf_UninterpretedOption_set_identifier_value(google_protobuf_UninterpretedOption *msg, upb_StringView value) {
11182   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)};
11183   upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
11184 }
google_protobuf_UninterpretedOption_set_positive_int_value(google_protobuf_UninterpretedOption * msg,uint64_t value)11185 UPB_INLINE void google_protobuf_UninterpretedOption_set_positive_int_value(google_protobuf_UninterpretedOption *msg, uint64_t value) {
11186   const upb_MiniTableField field = {4, UPB_SIZE(24, 40), 65, kUpb_NoSub, 4, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)};
11187   upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
11188 }
google_protobuf_UninterpretedOption_set_negative_int_value(google_protobuf_UninterpretedOption * msg,int64_t value)11189 UPB_INLINE void google_protobuf_UninterpretedOption_set_negative_int_value(google_protobuf_UninterpretedOption *msg, int64_t value) {
11190   const upb_MiniTableField field = {5, UPB_SIZE(32, 48), 66, kUpb_NoSub, 3, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)};
11191   upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
11192 }
google_protobuf_UninterpretedOption_set_double_value(google_protobuf_UninterpretedOption * msg,double value)11193 UPB_INLINE void google_protobuf_UninterpretedOption_set_double_value(google_protobuf_UninterpretedOption *msg, double value) {
11194   const upb_MiniTableField field = {6, UPB_SIZE(40, 56), 67, kUpb_NoSub, 1, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)};
11195   upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
11196 }
google_protobuf_UninterpretedOption_set_string_value(google_protobuf_UninterpretedOption * msg,upb_StringView value)11197 UPB_INLINE void google_protobuf_UninterpretedOption_set_string_value(google_protobuf_UninterpretedOption *msg, upb_StringView value) {
11198   const upb_MiniTableField field = {7, UPB_SIZE(48, 64), 68, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
11199   upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
11200 }
google_protobuf_UninterpretedOption_set_aggregate_value(google_protobuf_UninterpretedOption * msg,upb_StringView value)11201 UPB_INLINE void google_protobuf_UninterpretedOption_set_aggregate_value(google_protobuf_UninterpretedOption *msg, upb_StringView value) {
11202   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)};
11203   upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
11204 }
11205 
11206 /* google.protobuf.UninterpretedOption.NamePart */
11207 
google_protobuf_UninterpretedOption_NamePart_new(upb_Arena * arena)11208 UPB_INLINE google_protobuf_UninterpretedOption_NamePart* google_protobuf_UninterpretedOption_NamePart_new(upb_Arena* arena) {
11209   return (google_protobuf_UninterpretedOption_NamePart*)_upb_Message_New(&google__protobuf__UninterpretedOption__NamePart_msg_init, arena);
11210 }
google_protobuf_UninterpretedOption_NamePart_parse(const char * buf,size_t size,upb_Arena * arena)11211 UPB_INLINE google_protobuf_UninterpretedOption_NamePart* google_protobuf_UninterpretedOption_NamePart_parse(const char* buf, size_t size, upb_Arena* arena) {
11212   google_protobuf_UninterpretedOption_NamePart* ret = google_protobuf_UninterpretedOption_NamePart_new(arena);
11213   if (!ret) return NULL;
11214   if (upb_Decode(buf, size, UPB_UPCAST(ret), &google__protobuf__UninterpretedOption__NamePart_msg_init, NULL, 0, arena) !=
11215       kUpb_DecodeStatus_Ok) {
11216     return NULL;
11217   }
11218   return ret;
11219 }
google_protobuf_UninterpretedOption_NamePart_parse_ex(const char * buf,size_t size,const upb_ExtensionRegistry * extreg,int options,upb_Arena * arena)11220 UPB_INLINE google_protobuf_UninterpretedOption_NamePart* google_protobuf_UninterpretedOption_NamePart_parse_ex(const char* buf, size_t size,
11221                            const upb_ExtensionRegistry* extreg,
11222                            int options, upb_Arena* arena) {
11223   google_protobuf_UninterpretedOption_NamePart* ret = google_protobuf_UninterpretedOption_NamePart_new(arena);
11224   if (!ret) return NULL;
11225   if (upb_Decode(buf, size, UPB_UPCAST(ret), &google__protobuf__UninterpretedOption__NamePart_msg_init, extreg, options,
11226                  arena) != kUpb_DecodeStatus_Ok) {
11227     return NULL;
11228   }
11229   return ret;
11230 }
google_protobuf_UninterpretedOption_NamePart_serialize(const google_protobuf_UninterpretedOption_NamePart * msg,upb_Arena * arena,size_t * len)11231 UPB_INLINE char* google_protobuf_UninterpretedOption_NamePart_serialize(const google_protobuf_UninterpretedOption_NamePart* msg, upb_Arena* arena, size_t* len) {
11232   char* ptr;
11233   (void)upb_Encode(UPB_UPCAST(msg), &google__protobuf__UninterpretedOption__NamePart_msg_init, 0, arena, &ptr, len);
11234   return ptr;
11235 }
google_protobuf_UninterpretedOption_NamePart_serialize_ex(const google_protobuf_UninterpretedOption_NamePart * msg,int options,upb_Arena * arena,size_t * len)11236 UPB_INLINE char* google_protobuf_UninterpretedOption_NamePart_serialize_ex(const google_protobuf_UninterpretedOption_NamePart* msg, int options,
11237                                  upb_Arena* arena, size_t* len) {
11238   char* ptr;
11239   (void)upb_Encode(UPB_UPCAST(msg), &google__protobuf__UninterpretedOption__NamePart_msg_init, options, arena, &ptr, len);
11240   return ptr;
11241 }
google_protobuf_UninterpretedOption_NamePart_clear_name_part(google_protobuf_UninterpretedOption_NamePart * msg)11242 UPB_INLINE void google_protobuf_UninterpretedOption_NamePart_clear_name_part(google_protobuf_UninterpretedOption_NamePart* msg) {
11243   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)};
11244   upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
11245 }
google_protobuf_UninterpretedOption_NamePart_name_part(const google_protobuf_UninterpretedOption_NamePart * msg)11246 UPB_INLINE upb_StringView google_protobuf_UninterpretedOption_NamePart_name_part(const google_protobuf_UninterpretedOption_NamePart* msg) {
11247   upb_StringView default_val = upb_StringView_FromString("");
11248   upb_StringView ret;
11249   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)};
11250   _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field,
11251                                     &default_val, &ret);
11252   return ret;
11253 }
google_protobuf_UninterpretedOption_NamePart_has_name_part(const google_protobuf_UninterpretedOption_NamePart * msg)11254 UPB_INLINE bool google_protobuf_UninterpretedOption_NamePart_has_name_part(const google_protobuf_UninterpretedOption_NamePart* msg) {
11255   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)};
11256   return upb_Message_HasBaseField(UPB_UPCAST(msg), &field);
11257 }
google_protobuf_UninterpretedOption_NamePart_clear_is_extension(google_protobuf_UninterpretedOption_NamePart * msg)11258 UPB_INLINE void google_protobuf_UninterpretedOption_NamePart_clear_is_extension(google_protobuf_UninterpretedOption_NamePart* msg) {
11259   const upb_MiniTableField field = {2, 9, 65, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
11260   upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
11261 }
google_protobuf_UninterpretedOption_NamePart_is_extension(const google_protobuf_UninterpretedOption_NamePart * msg)11262 UPB_INLINE bool google_protobuf_UninterpretedOption_NamePart_is_extension(const google_protobuf_UninterpretedOption_NamePart* msg) {
11263   bool default_val = false;
11264   bool ret;
11265   const upb_MiniTableField field = {2, 9, 65, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
11266   _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field,
11267                                     &default_val, &ret);
11268   return ret;
11269 }
google_protobuf_UninterpretedOption_NamePart_has_is_extension(const google_protobuf_UninterpretedOption_NamePart * msg)11270 UPB_INLINE bool google_protobuf_UninterpretedOption_NamePart_has_is_extension(const google_protobuf_UninterpretedOption_NamePart* msg) {
11271   const upb_MiniTableField field = {2, 9, 65, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
11272   return upb_Message_HasBaseField(UPB_UPCAST(msg), &field);
11273 }
11274 
google_protobuf_UninterpretedOption_NamePart_set_name_part(google_protobuf_UninterpretedOption_NamePart * msg,upb_StringView value)11275 UPB_INLINE void google_protobuf_UninterpretedOption_NamePart_set_name_part(google_protobuf_UninterpretedOption_NamePart *msg, upb_StringView value) {
11276   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)};
11277   upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
11278 }
google_protobuf_UninterpretedOption_NamePart_set_is_extension(google_protobuf_UninterpretedOption_NamePart * msg,bool value)11279 UPB_INLINE void google_protobuf_UninterpretedOption_NamePart_set_is_extension(google_protobuf_UninterpretedOption_NamePart *msg, bool value) {
11280   const upb_MiniTableField field = {2, 9, 65, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
11281   upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
11282 }
11283 
11284 /* google.protobuf.FeatureSet */
11285 
google_protobuf_FeatureSet_new(upb_Arena * arena)11286 UPB_INLINE google_protobuf_FeatureSet* google_protobuf_FeatureSet_new(upb_Arena* arena) {
11287   return (google_protobuf_FeatureSet*)_upb_Message_New(&google__protobuf__FeatureSet_msg_init, arena);
11288 }
google_protobuf_FeatureSet_parse(const char * buf,size_t size,upb_Arena * arena)11289 UPB_INLINE google_protobuf_FeatureSet* google_protobuf_FeatureSet_parse(const char* buf, size_t size, upb_Arena* arena) {
11290   google_protobuf_FeatureSet* ret = google_protobuf_FeatureSet_new(arena);
11291   if (!ret) return NULL;
11292   if (upb_Decode(buf, size, UPB_UPCAST(ret), &google__protobuf__FeatureSet_msg_init, NULL, 0, arena) !=
11293       kUpb_DecodeStatus_Ok) {
11294     return NULL;
11295   }
11296   return ret;
11297 }
google_protobuf_FeatureSet_parse_ex(const char * buf,size_t size,const upb_ExtensionRegistry * extreg,int options,upb_Arena * arena)11298 UPB_INLINE google_protobuf_FeatureSet* google_protobuf_FeatureSet_parse_ex(const char* buf, size_t size,
11299                            const upb_ExtensionRegistry* extreg,
11300                            int options, upb_Arena* arena) {
11301   google_protobuf_FeatureSet* ret = google_protobuf_FeatureSet_new(arena);
11302   if (!ret) return NULL;
11303   if (upb_Decode(buf, size, UPB_UPCAST(ret), &google__protobuf__FeatureSet_msg_init, extreg, options,
11304                  arena) != kUpb_DecodeStatus_Ok) {
11305     return NULL;
11306   }
11307   return ret;
11308 }
google_protobuf_FeatureSet_serialize(const google_protobuf_FeatureSet * msg,upb_Arena * arena,size_t * len)11309 UPB_INLINE char* google_protobuf_FeatureSet_serialize(const google_protobuf_FeatureSet* msg, upb_Arena* arena, size_t* len) {
11310   char* ptr;
11311   (void)upb_Encode(UPB_UPCAST(msg), &google__protobuf__FeatureSet_msg_init, 0, arena, &ptr, len);
11312   return ptr;
11313 }
google_protobuf_FeatureSet_serialize_ex(const google_protobuf_FeatureSet * msg,int options,upb_Arena * arena,size_t * len)11314 UPB_INLINE char* google_protobuf_FeatureSet_serialize_ex(const google_protobuf_FeatureSet* msg, int options,
11315                                  upb_Arena* arena, size_t* len) {
11316   char* ptr;
11317   (void)upb_Encode(UPB_UPCAST(msg), &google__protobuf__FeatureSet_msg_init, options, arena, &ptr, len);
11318   return ptr;
11319 }
google_protobuf_FeatureSet_clear_field_presence(google_protobuf_FeatureSet * msg)11320 UPB_INLINE void google_protobuf_FeatureSet_clear_field_presence(google_protobuf_FeatureSet* msg) {
11321   const upb_MiniTableField field = {1, 12, 64, 0, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
11322   upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
11323 }
google_protobuf_FeatureSet_field_presence(const google_protobuf_FeatureSet * msg)11324 UPB_INLINE int32_t google_protobuf_FeatureSet_field_presence(const google_protobuf_FeatureSet* msg) {
11325   int32_t default_val = 0;
11326   int32_t ret;
11327   const upb_MiniTableField field = {1, 12, 64, 0, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
11328   _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field,
11329                                     &default_val, &ret);
11330   return ret;
11331 }
google_protobuf_FeatureSet_has_field_presence(const google_protobuf_FeatureSet * msg)11332 UPB_INLINE bool google_protobuf_FeatureSet_has_field_presence(const google_protobuf_FeatureSet* msg) {
11333   const upb_MiniTableField field = {1, 12, 64, 0, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
11334   return upb_Message_HasBaseField(UPB_UPCAST(msg), &field);
11335 }
google_protobuf_FeatureSet_clear_enum_type(google_protobuf_FeatureSet * msg)11336 UPB_INLINE void google_protobuf_FeatureSet_clear_enum_type(google_protobuf_FeatureSet* msg) {
11337   const upb_MiniTableField field = {2, 16, 65, 1, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
11338   upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
11339 }
google_protobuf_FeatureSet_enum_type(const google_protobuf_FeatureSet * msg)11340 UPB_INLINE int32_t google_protobuf_FeatureSet_enum_type(const google_protobuf_FeatureSet* msg) {
11341   int32_t default_val = 0;
11342   int32_t ret;
11343   const upb_MiniTableField field = {2, 16, 65, 1, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
11344   _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field,
11345                                     &default_val, &ret);
11346   return ret;
11347 }
google_protobuf_FeatureSet_has_enum_type(const google_protobuf_FeatureSet * msg)11348 UPB_INLINE bool google_protobuf_FeatureSet_has_enum_type(const google_protobuf_FeatureSet* msg) {
11349   const upb_MiniTableField field = {2, 16, 65, 1, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
11350   return upb_Message_HasBaseField(UPB_UPCAST(msg), &field);
11351 }
google_protobuf_FeatureSet_clear_repeated_field_encoding(google_protobuf_FeatureSet * msg)11352 UPB_INLINE void google_protobuf_FeatureSet_clear_repeated_field_encoding(google_protobuf_FeatureSet* msg) {
11353   const upb_MiniTableField field = {3, 20, 66, 2, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
11354   upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
11355 }
google_protobuf_FeatureSet_repeated_field_encoding(const google_protobuf_FeatureSet * msg)11356 UPB_INLINE int32_t google_protobuf_FeatureSet_repeated_field_encoding(const google_protobuf_FeatureSet* msg) {
11357   int32_t default_val = 0;
11358   int32_t ret;
11359   const upb_MiniTableField field = {3, 20, 66, 2, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
11360   _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field,
11361                                     &default_val, &ret);
11362   return ret;
11363 }
google_protobuf_FeatureSet_has_repeated_field_encoding(const google_protobuf_FeatureSet * msg)11364 UPB_INLINE bool google_protobuf_FeatureSet_has_repeated_field_encoding(const google_protobuf_FeatureSet* msg) {
11365   const upb_MiniTableField field = {3, 20, 66, 2, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
11366   return upb_Message_HasBaseField(UPB_UPCAST(msg), &field);
11367 }
google_protobuf_FeatureSet_clear_utf8_validation(google_protobuf_FeatureSet * msg)11368 UPB_INLINE void google_protobuf_FeatureSet_clear_utf8_validation(google_protobuf_FeatureSet* msg) {
11369   const upb_MiniTableField field = {4, 24, 67, 3, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
11370   upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
11371 }
google_protobuf_FeatureSet_utf8_validation(const google_protobuf_FeatureSet * msg)11372 UPB_INLINE int32_t google_protobuf_FeatureSet_utf8_validation(const google_protobuf_FeatureSet* msg) {
11373   int32_t default_val = 0;
11374   int32_t ret;
11375   const upb_MiniTableField field = {4, 24, 67, 3, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
11376   _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field,
11377                                     &default_val, &ret);
11378   return ret;
11379 }
google_protobuf_FeatureSet_has_utf8_validation(const google_protobuf_FeatureSet * msg)11380 UPB_INLINE bool google_protobuf_FeatureSet_has_utf8_validation(const google_protobuf_FeatureSet* msg) {
11381   const upb_MiniTableField field = {4, 24, 67, 3, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
11382   return upb_Message_HasBaseField(UPB_UPCAST(msg), &field);
11383 }
google_protobuf_FeatureSet_clear_message_encoding(google_protobuf_FeatureSet * msg)11384 UPB_INLINE void google_protobuf_FeatureSet_clear_message_encoding(google_protobuf_FeatureSet* msg) {
11385   const upb_MiniTableField field = {5, 28, 68, 4, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
11386   upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
11387 }
google_protobuf_FeatureSet_message_encoding(const google_protobuf_FeatureSet * msg)11388 UPB_INLINE int32_t google_protobuf_FeatureSet_message_encoding(const google_protobuf_FeatureSet* msg) {
11389   int32_t default_val = 0;
11390   int32_t ret;
11391   const upb_MiniTableField field = {5, 28, 68, 4, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
11392   _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field,
11393                                     &default_val, &ret);
11394   return ret;
11395 }
google_protobuf_FeatureSet_has_message_encoding(const google_protobuf_FeatureSet * msg)11396 UPB_INLINE bool google_protobuf_FeatureSet_has_message_encoding(const google_protobuf_FeatureSet* msg) {
11397   const upb_MiniTableField field = {5, 28, 68, 4, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
11398   return upb_Message_HasBaseField(UPB_UPCAST(msg), &field);
11399 }
google_protobuf_FeatureSet_clear_json_format(google_protobuf_FeatureSet * msg)11400 UPB_INLINE void google_protobuf_FeatureSet_clear_json_format(google_protobuf_FeatureSet* msg) {
11401   const upb_MiniTableField field = {6, 32, 69, 5, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
11402   upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
11403 }
google_protobuf_FeatureSet_json_format(const google_protobuf_FeatureSet * msg)11404 UPB_INLINE int32_t google_protobuf_FeatureSet_json_format(const google_protobuf_FeatureSet* msg) {
11405   int32_t default_val = 0;
11406   int32_t ret;
11407   const upb_MiniTableField field = {6, 32, 69, 5, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
11408   _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field,
11409                                     &default_val, &ret);
11410   return ret;
11411 }
google_protobuf_FeatureSet_has_json_format(const google_protobuf_FeatureSet * msg)11412 UPB_INLINE bool google_protobuf_FeatureSet_has_json_format(const google_protobuf_FeatureSet* msg) {
11413   const upb_MiniTableField field = {6, 32, 69, 5, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
11414   return upb_Message_HasBaseField(UPB_UPCAST(msg), &field);
11415 }
11416 
google_protobuf_FeatureSet_set_field_presence(google_protobuf_FeatureSet * msg,int32_t value)11417 UPB_INLINE void google_protobuf_FeatureSet_set_field_presence(google_protobuf_FeatureSet *msg, int32_t value) {
11418   const upb_MiniTableField field = {1, 12, 64, 0, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
11419   upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
11420 }
google_protobuf_FeatureSet_set_enum_type(google_protobuf_FeatureSet * msg,int32_t value)11421 UPB_INLINE void google_protobuf_FeatureSet_set_enum_type(google_protobuf_FeatureSet *msg, int32_t value) {
11422   const upb_MiniTableField field = {2, 16, 65, 1, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
11423   upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
11424 }
google_protobuf_FeatureSet_set_repeated_field_encoding(google_protobuf_FeatureSet * msg,int32_t value)11425 UPB_INLINE void google_protobuf_FeatureSet_set_repeated_field_encoding(google_protobuf_FeatureSet *msg, int32_t value) {
11426   const upb_MiniTableField field = {3, 20, 66, 2, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
11427   upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
11428 }
google_protobuf_FeatureSet_set_utf8_validation(google_protobuf_FeatureSet * msg,int32_t value)11429 UPB_INLINE void google_protobuf_FeatureSet_set_utf8_validation(google_protobuf_FeatureSet *msg, int32_t value) {
11430   const upb_MiniTableField field = {4, 24, 67, 3, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
11431   upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
11432 }
google_protobuf_FeatureSet_set_message_encoding(google_protobuf_FeatureSet * msg,int32_t value)11433 UPB_INLINE void google_protobuf_FeatureSet_set_message_encoding(google_protobuf_FeatureSet *msg, int32_t value) {
11434   const upb_MiniTableField field = {5, 28, 68, 4, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
11435   upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
11436 }
google_protobuf_FeatureSet_set_json_format(google_protobuf_FeatureSet * msg,int32_t value)11437 UPB_INLINE void google_protobuf_FeatureSet_set_json_format(google_protobuf_FeatureSet *msg, int32_t value) {
11438   const upb_MiniTableField field = {6, 32, 69, 5, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
11439   upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
11440 }
11441 
11442 /* google.protobuf.FeatureSetDefaults */
11443 
google_protobuf_FeatureSetDefaults_new(upb_Arena * arena)11444 UPB_INLINE google_protobuf_FeatureSetDefaults* google_protobuf_FeatureSetDefaults_new(upb_Arena* arena) {
11445   return (google_protobuf_FeatureSetDefaults*)_upb_Message_New(&google__protobuf__FeatureSetDefaults_msg_init, arena);
11446 }
google_protobuf_FeatureSetDefaults_parse(const char * buf,size_t size,upb_Arena * arena)11447 UPB_INLINE google_protobuf_FeatureSetDefaults* google_protobuf_FeatureSetDefaults_parse(const char* buf, size_t size, upb_Arena* arena) {
11448   google_protobuf_FeatureSetDefaults* ret = google_protobuf_FeatureSetDefaults_new(arena);
11449   if (!ret) return NULL;
11450   if (upb_Decode(buf, size, UPB_UPCAST(ret), &google__protobuf__FeatureSetDefaults_msg_init, NULL, 0, arena) !=
11451       kUpb_DecodeStatus_Ok) {
11452     return NULL;
11453   }
11454   return ret;
11455 }
google_protobuf_FeatureSetDefaults_parse_ex(const char * buf,size_t size,const upb_ExtensionRegistry * extreg,int options,upb_Arena * arena)11456 UPB_INLINE google_protobuf_FeatureSetDefaults* google_protobuf_FeatureSetDefaults_parse_ex(const char* buf, size_t size,
11457                            const upb_ExtensionRegistry* extreg,
11458                            int options, upb_Arena* arena) {
11459   google_protobuf_FeatureSetDefaults* ret = google_protobuf_FeatureSetDefaults_new(arena);
11460   if (!ret) return NULL;
11461   if (upb_Decode(buf, size, UPB_UPCAST(ret), &google__protobuf__FeatureSetDefaults_msg_init, extreg, options,
11462                  arena) != kUpb_DecodeStatus_Ok) {
11463     return NULL;
11464   }
11465   return ret;
11466 }
google_protobuf_FeatureSetDefaults_serialize(const google_protobuf_FeatureSetDefaults * msg,upb_Arena * arena,size_t * len)11467 UPB_INLINE char* google_protobuf_FeatureSetDefaults_serialize(const google_protobuf_FeatureSetDefaults* msg, upb_Arena* arena, size_t* len) {
11468   char* ptr;
11469   (void)upb_Encode(UPB_UPCAST(msg), &google__protobuf__FeatureSetDefaults_msg_init, 0, arena, &ptr, len);
11470   return ptr;
11471 }
google_protobuf_FeatureSetDefaults_serialize_ex(const google_protobuf_FeatureSetDefaults * msg,int options,upb_Arena * arena,size_t * len)11472 UPB_INLINE char* google_protobuf_FeatureSetDefaults_serialize_ex(const google_protobuf_FeatureSetDefaults* msg, int options,
11473                                  upb_Arena* arena, size_t* len) {
11474   char* ptr;
11475   (void)upb_Encode(UPB_UPCAST(msg), &google__protobuf__FeatureSetDefaults_msg_init, options, arena, &ptr, len);
11476   return ptr;
11477 }
google_protobuf_FeatureSetDefaults_clear_defaults(google_protobuf_FeatureSetDefaults * msg)11478 UPB_INLINE void google_protobuf_FeatureSetDefaults_clear_defaults(google_protobuf_FeatureSetDefaults* msg) {
11479   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)};
11480   upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
11481 }
google_protobuf_FeatureSetDefaults_defaults(const google_protobuf_FeatureSetDefaults * msg,size_t * size)11482 UPB_INLINE const google_protobuf_FeatureSetDefaults_FeatureSetEditionDefault* const* google_protobuf_FeatureSetDefaults_defaults(const google_protobuf_FeatureSetDefaults* msg, size_t* size) {
11483   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)};
11484   UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__FeatureSetDefaults__FeatureSetEditionDefault_msg_init);
11485   const upb_Array* arr = upb_Message_GetArray(UPB_UPCAST(msg), &field);
11486   if (arr) {
11487     if (size) *size = arr->UPB_PRIVATE(size);
11488     return (const google_protobuf_FeatureSetDefaults_FeatureSetEditionDefault* const*)upb_Array_DataPtr(arr);
11489   } else {
11490     if (size) *size = 0;
11491     return NULL;
11492   }
11493 }
_google_protobuf_FeatureSetDefaults_defaults_upb_array(const google_protobuf_FeatureSetDefaults * msg,size_t * size)11494 UPB_INLINE const upb_Array* _google_protobuf_FeatureSetDefaults_defaults_upb_array(const google_protobuf_FeatureSetDefaults* msg, size_t* size) {
11495   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)};
11496   UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__FeatureSetDefaults__FeatureSetEditionDefault_msg_init);
11497   const upb_Array* arr = upb_Message_GetArray(UPB_UPCAST(msg), &field);
11498   if (size) {
11499     *size = arr ? arr->UPB_PRIVATE(size) : 0;
11500   }
11501   return arr;
11502 }
_google_protobuf_FeatureSetDefaults_defaults_mutable_upb_array(google_protobuf_FeatureSetDefaults * msg,size_t * size,upb_Arena * arena)11503 UPB_INLINE upb_Array* _google_protobuf_FeatureSetDefaults_defaults_mutable_upb_array(google_protobuf_FeatureSetDefaults* msg, size_t* size, upb_Arena* arena) {
11504   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)};
11505   UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__FeatureSetDefaults__FeatureSetEditionDefault_msg_init);
11506   upb_Array* arr = upb_Message_GetOrCreateMutableArray(UPB_UPCAST(msg),
11507                                                        &field, arena);
11508   if (size) {
11509     *size = arr ? arr->UPB_PRIVATE(size) : 0;
11510   }
11511   return arr;
11512 }
google_protobuf_FeatureSetDefaults_clear_minimum_edition(google_protobuf_FeatureSetDefaults * msg)11513 UPB_INLINE void google_protobuf_FeatureSetDefaults_clear_minimum_edition(google_protobuf_FeatureSetDefaults* msg) {
11514   const upb_MiniTableField field = {4, UPB_SIZE(16, 12), 64, 1, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
11515   upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
11516 }
google_protobuf_FeatureSetDefaults_minimum_edition(const google_protobuf_FeatureSetDefaults * msg)11517 UPB_INLINE int32_t google_protobuf_FeatureSetDefaults_minimum_edition(const google_protobuf_FeatureSetDefaults* msg) {
11518   int32_t default_val = 0;
11519   int32_t ret;
11520   const upb_MiniTableField field = {4, UPB_SIZE(16, 12), 64, 1, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
11521   _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field,
11522                                     &default_val, &ret);
11523   return ret;
11524 }
google_protobuf_FeatureSetDefaults_has_minimum_edition(const google_protobuf_FeatureSetDefaults * msg)11525 UPB_INLINE bool google_protobuf_FeatureSetDefaults_has_minimum_edition(const google_protobuf_FeatureSetDefaults* msg) {
11526   const upb_MiniTableField field = {4, UPB_SIZE(16, 12), 64, 1, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
11527   return upb_Message_HasBaseField(UPB_UPCAST(msg), &field);
11528 }
google_protobuf_FeatureSetDefaults_clear_maximum_edition(google_protobuf_FeatureSetDefaults * msg)11529 UPB_INLINE void google_protobuf_FeatureSetDefaults_clear_maximum_edition(google_protobuf_FeatureSetDefaults* msg) {
11530   const upb_MiniTableField field = {5, UPB_SIZE(20, 16), 65, 2, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
11531   upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
11532 }
google_protobuf_FeatureSetDefaults_maximum_edition(const google_protobuf_FeatureSetDefaults * msg)11533 UPB_INLINE int32_t google_protobuf_FeatureSetDefaults_maximum_edition(const google_protobuf_FeatureSetDefaults* msg) {
11534   int32_t default_val = 0;
11535   int32_t ret;
11536   const upb_MiniTableField field = {5, UPB_SIZE(20, 16), 65, 2, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
11537   _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field,
11538                                     &default_val, &ret);
11539   return ret;
11540 }
google_protobuf_FeatureSetDefaults_has_maximum_edition(const google_protobuf_FeatureSetDefaults * msg)11541 UPB_INLINE bool google_protobuf_FeatureSetDefaults_has_maximum_edition(const google_protobuf_FeatureSetDefaults* msg) {
11542   const upb_MiniTableField field = {5, UPB_SIZE(20, 16), 65, 2, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
11543   return upb_Message_HasBaseField(UPB_UPCAST(msg), &field);
11544 }
11545 
google_protobuf_FeatureSetDefaults_mutable_defaults(google_protobuf_FeatureSetDefaults * msg,size_t * size)11546 UPB_INLINE google_protobuf_FeatureSetDefaults_FeatureSetEditionDefault** google_protobuf_FeatureSetDefaults_mutable_defaults(google_protobuf_FeatureSetDefaults* msg, size_t* size) {
11547   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)};
11548   UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__FeatureSetDefaults__FeatureSetEditionDefault_msg_init);
11549   upb_Array* arr = upb_Message_GetMutableArray(UPB_UPCAST(msg), &field);
11550   if (arr) {
11551     if (size) *size = arr->UPB_PRIVATE(size);
11552     return (google_protobuf_FeatureSetDefaults_FeatureSetEditionDefault**)upb_Array_MutableDataPtr(arr);
11553   } else {
11554     if (size) *size = 0;
11555     return NULL;
11556   }
11557 }
google_protobuf_FeatureSetDefaults_resize_defaults(google_protobuf_FeatureSetDefaults * msg,size_t size,upb_Arena * arena)11558 UPB_INLINE google_protobuf_FeatureSetDefaults_FeatureSetEditionDefault** google_protobuf_FeatureSetDefaults_resize_defaults(google_protobuf_FeatureSetDefaults* msg, size_t size, upb_Arena* arena) {
11559   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)};
11560   return (google_protobuf_FeatureSetDefaults_FeatureSetEditionDefault**)upb_Message_ResizeArrayUninitialized(UPB_UPCAST(msg),
11561                                                    &field, size, arena);
11562 }
google_protobuf_FeatureSetDefaults_add_defaults(google_protobuf_FeatureSetDefaults * msg,upb_Arena * arena)11563 UPB_INLINE struct google_protobuf_FeatureSetDefaults_FeatureSetEditionDefault* google_protobuf_FeatureSetDefaults_add_defaults(google_protobuf_FeatureSetDefaults* msg, upb_Arena* arena) {
11564   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)};
11565   UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__FeatureSetDefaults__FeatureSetEditionDefault_msg_init);
11566   upb_Array* arr = upb_Message_GetOrCreateMutableArray(
11567       UPB_UPCAST(msg), &field, arena);
11568   if (!arr || !UPB_PRIVATE(_upb_Array_ResizeUninitialized)(
11569                   arr, arr->UPB_PRIVATE(size) + 1, arena)) {
11570     return NULL;
11571   }
11572   struct google_protobuf_FeatureSetDefaults_FeatureSetEditionDefault* sub = (struct google_protobuf_FeatureSetDefaults_FeatureSetEditionDefault*)_upb_Message_New(&google__protobuf__FeatureSetDefaults__FeatureSetEditionDefault_msg_init, arena);
11573   if (!arr || !sub) return NULL;
11574   UPB_PRIVATE(_upb_Array_Set)
11575   (arr, arr->UPB_PRIVATE(size) - 1, &sub, sizeof(sub));
11576   return sub;
11577 }
google_protobuf_FeatureSetDefaults_set_minimum_edition(google_protobuf_FeatureSetDefaults * msg,int32_t value)11578 UPB_INLINE void google_protobuf_FeatureSetDefaults_set_minimum_edition(google_protobuf_FeatureSetDefaults *msg, int32_t value) {
11579   const upb_MiniTableField field = {4, UPB_SIZE(16, 12), 64, 1, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
11580   upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
11581 }
google_protobuf_FeatureSetDefaults_set_maximum_edition(google_protobuf_FeatureSetDefaults * msg,int32_t value)11582 UPB_INLINE void google_protobuf_FeatureSetDefaults_set_maximum_edition(google_protobuf_FeatureSetDefaults *msg, int32_t value) {
11583   const upb_MiniTableField field = {5, UPB_SIZE(20, 16), 65, 2, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
11584   upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
11585 }
11586 
11587 /* google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault */
11588 
google_protobuf_FeatureSetDefaults_FeatureSetEditionDefault_new(upb_Arena * arena)11589 UPB_INLINE google_protobuf_FeatureSetDefaults_FeatureSetEditionDefault* google_protobuf_FeatureSetDefaults_FeatureSetEditionDefault_new(upb_Arena* arena) {
11590   return (google_protobuf_FeatureSetDefaults_FeatureSetEditionDefault*)_upb_Message_New(&google__protobuf__FeatureSetDefaults__FeatureSetEditionDefault_msg_init, arena);
11591 }
google_protobuf_FeatureSetDefaults_FeatureSetEditionDefault_parse(const char * buf,size_t size,upb_Arena * arena)11592 UPB_INLINE google_protobuf_FeatureSetDefaults_FeatureSetEditionDefault* google_protobuf_FeatureSetDefaults_FeatureSetEditionDefault_parse(const char* buf, size_t size, upb_Arena* arena) {
11593   google_protobuf_FeatureSetDefaults_FeatureSetEditionDefault* ret = google_protobuf_FeatureSetDefaults_FeatureSetEditionDefault_new(arena);
11594   if (!ret) return NULL;
11595   if (upb_Decode(buf, size, UPB_UPCAST(ret), &google__protobuf__FeatureSetDefaults__FeatureSetEditionDefault_msg_init, NULL, 0, arena) !=
11596       kUpb_DecodeStatus_Ok) {
11597     return NULL;
11598   }
11599   return ret;
11600 }
google_protobuf_FeatureSetDefaults_FeatureSetEditionDefault_parse_ex(const char * buf,size_t size,const upb_ExtensionRegistry * extreg,int options,upb_Arena * arena)11601 UPB_INLINE google_protobuf_FeatureSetDefaults_FeatureSetEditionDefault* google_protobuf_FeatureSetDefaults_FeatureSetEditionDefault_parse_ex(const char* buf, size_t size,
11602                            const upb_ExtensionRegistry* extreg,
11603                            int options, upb_Arena* arena) {
11604   google_protobuf_FeatureSetDefaults_FeatureSetEditionDefault* ret = google_protobuf_FeatureSetDefaults_FeatureSetEditionDefault_new(arena);
11605   if (!ret) return NULL;
11606   if (upb_Decode(buf, size, UPB_UPCAST(ret), &google__protobuf__FeatureSetDefaults__FeatureSetEditionDefault_msg_init, extreg, options,
11607                  arena) != kUpb_DecodeStatus_Ok) {
11608     return NULL;
11609   }
11610   return ret;
11611 }
google_protobuf_FeatureSetDefaults_FeatureSetEditionDefault_serialize(const google_protobuf_FeatureSetDefaults_FeatureSetEditionDefault * msg,upb_Arena * arena,size_t * len)11612 UPB_INLINE char* google_protobuf_FeatureSetDefaults_FeatureSetEditionDefault_serialize(const google_protobuf_FeatureSetDefaults_FeatureSetEditionDefault* msg, upb_Arena* arena, size_t* len) {
11613   char* ptr;
11614   (void)upb_Encode(UPB_UPCAST(msg), &google__protobuf__FeatureSetDefaults__FeatureSetEditionDefault_msg_init, 0, arena, &ptr, len);
11615   return ptr;
11616 }
google_protobuf_FeatureSetDefaults_FeatureSetEditionDefault_serialize_ex(const google_protobuf_FeatureSetDefaults_FeatureSetEditionDefault * msg,int options,upb_Arena * arena,size_t * len)11617 UPB_INLINE char* google_protobuf_FeatureSetDefaults_FeatureSetEditionDefault_serialize_ex(const google_protobuf_FeatureSetDefaults_FeatureSetEditionDefault* msg, int options,
11618                                  upb_Arena* arena, size_t* len) {
11619   char* ptr;
11620   (void)upb_Encode(UPB_UPCAST(msg), &google__protobuf__FeatureSetDefaults__FeatureSetEditionDefault_msg_init, options, arena, &ptr, len);
11621   return ptr;
11622 }
google_protobuf_FeatureSetDefaults_FeatureSetEditionDefault_clear_edition(google_protobuf_FeatureSetDefaults_FeatureSetEditionDefault * msg)11623 UPB_INLINE void google_protobuf_FeatureSetDefaults_FeatureSetEditionDefault_clear_edition(google_protobuf_FeatureSetDefaults_FeatureSetEditionDefault* msg) {
11624   const upb_MiniTableField field = {3, 12, 64, 2, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
11625   upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
11626 }
google_protobuf_FeatureSetDefaults_FeatureSetEditionDefault_edition(const google_protobuf_FeatureSetDefaults_FeatureSetEditionDefault * msg)11627 UPB_INLINE int32_t google_protobuf_FeatureSetDefaults_FeatureSetEditionDefault_edition(const google_protobuf_FeatureSetDefaults_FeatureSetEditionDefault* msg) {
11628   int32_t default_val = 0;
11629   int32_t ret;
11630   const upb_MiniTableField field = {3, 12, 64, 2, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
11631   _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field,
11632                                     &default_val, &ret);
11633   return ret;
11634 }
google_protobuf_FeatureSetDefaults_FeatureSetEditionDefault_has_edition(const google_protobuf_FeatureSetDefaults_FeatureSetEditionDefault * msg)11635 UPB_INLINE bool google_protobuf_FeatureSetDefaults_FeatureSetEditionDefault_has_edition(const google_protobuf_FeatureSetDefaults_FeatureSetEditionDefault* msg) {
11636   const upb_MiniTableField field = {3, 12, 64, 2, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
11637   return upb_Message_HasBaseField(UPB_UPCAST(msg), &field);
11638 }
google_protobuf_FeatureSetDefaults_FeatureSetEditionDefault_clear_overridable_features(google_protobuf_FeatureSetDefaults_FeatureSetEditionDefault * msg)11639 UPB_INLINE void google_protobuf_FeatureSetDefaults_FeatureSetEditionDefault_clear_overridable_features(google_protobuf_FeatureSetDefaults_FeatureSetEditionDefault* msg) {
11640   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)};
11641   upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
11642 }
google_protobuf_FeatureSetDefaults_FeatureSetEditionDefault_overridable_features(const google_protobuf_FeatureSetDefaults_FeatureSetEditionDefault * msg)11643 UPB_INLINE const google_protobuf_FeatureSet* google_protobuf_FeatureSetDefaults_FeatureSetEditionDefault_overridable_features(const google_protobuf_FeatureSetDefaults_FeatureSetEditionDefault* msg) {
11644   const google_protobuf_FeatureSet* default_val = NULL;
11645   const google_protobuf_FeatureSet* ret;
11646   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)};
11647   UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__FeatureSet_msg_init);
11648   _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field,
11649                                     &default_val, &ret);
11650   return ret;
11651 }
google_protobuf_FeatureSetDefaults_FeatureSetEditionDefault_has_overridable_features(const google_protobuf_FeatureSetDefaults_FeatureSetEditionDefault * msg)11652 UPB_INLINE bool google_protobuf_FeatureSetDefaults_FeatureSetEditionDefault_has_overridable_features(const google_protobuf_FeatureSetDefaults_FeatureSetEditionDefault* msg) {
11653   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)};
11654   return upb_Message_HasBaseField(UPB_UPCAST(msg), &field);
11655 }
google_protobuf_FeatureSetDefaults_FeatureSetEditionDefault_clear_fixed_features(google_protobuf_FeatureSetDefaults_FeatureSetEditionDefault * msg)11656 UPB_INLINE void google_protobuf_FeatureSetDefaults_FeatureSetEditionDefault_clear_fixed_features(google_protobuf_FeatureSetDefaults_FeatureSetEditionDefault* msg) {
11657   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)};
11658   upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
11659 }
google_protobuf_FeatureSetDefaults_FeatureSetEditionDefault_fixed_features(const google_protobuf_FeatureSetDefaults_FeatureSetEditionDefault * msg)11660 UPB_INLINE const google_protobuf_FeatureSet* google_protobuf_FeatureSetDefaults_FeatureSetEditionDefault_fixed_features(const google_protobuf_FeatureSetDefaults_FeatureSetEditionDefault* msg) {
11661   const google_protobuf_FeatureSet* default_val = NULL;
11662   const google_protobuf_FeatureSet* ret;
11663   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)};
11664   UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__FeatureSet_msg_init);
11665   _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field,
11666                                     &default_val, &ret);
11667   return ret;
11668 }
google_protobuf_FeatureSetDefaults_FeatureSetEditionDefault_has_fixed_features(const google_protobuf_FeatureSetDefaults_FeatureSetEditionDefault * msg)11669 UPB_INLINE bool google_protobuf_FeatureSetDefaults_FeatureSetEditionDefault_has_fixed_features(const google_protobuf_FeatureSetDefaults_FeatureSetEditionDefault* msg) {
11670   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)};
11671   return upb_Message_HasBaseField(UPB_UPCAST(msg), &field);
11672 }
11673 
google_protobuf_FeatureSetDefaults_FeatureSetEditionDefault_set_edition(google_protobuf_FeatureSetDefaults_FeatureSetEditionDefault * msg,int32_t value)11674 UPB_INLINE void google_protobuf_FeatureSetDefaults_FeatureSetEditionDefault_set_edition(google_protobuf_FeatureSetDefaults_FeatureSetEditionDefault *msg, int32_t value) {
11675   const upb_MiniTableField field = {3, 12, 64, 2, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
11676   upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
11677 }
google_protobuf_FeatureSetDefaults_FeatureSetEditionDefault_set_overridable_features(google_protobuf_FeatureSetDefaults_FeatureSetEditionDefault * msg,google_protobuf_FeatureSet * value)11678 UPB_INLINE void google_protobuf_FeatureSetDefaults_FeatureSetEditionDefault_set_overridable_features(google_protobuf_FeatureSetDefaults_FeatureSetEditionDefault *msg, google_protobuf_FeatureSet* value) {
11679   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)};
11680   UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__FeatureSet_msg_init);
11681   upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
11682 }
google_protobuf_FeatureSetDefaults_FeatureSetEditionDefault_mutable_overridable_features(google_protobuf_FeatureSetDefaults_FeatureSetEditionDefault * msg,upb_Arena * arena)11683 UPB_INLINE struct google_protobuf_FeatureSet* google_protobuf_FeatureSetDefaults_FeatureSetEditionDefault_mutable_overridable_features(google_protobuf_FeatureSetDefaults_FeatureSetEditionDefault* msg, upb_Arena* arena) {
11684   struct google_protobuf_FeatureSet* sub = (struct google_protobuf_FeatureSet*)google_protobuf_FeatureSetDefaults_FeatureSetEditionDefault_overridable_features(msg);
11685   if (sub == NULL) {
11686     sub = (struct google_protobuf_FeatureSet*)_upb_Message_New(&google__protobuf__FeatureSet_msg_init, arena);
11687     if (sub) google_protobuf_FeatureSetDefaults_FeatureSetEditionDefault_set_overridable_features(msg, sub);
11688   }
11689   return sub;
11690 }
google_protobuf_FeatureSetDefaults_FeatureSetEditionDefault_set_fixed_features(google_protobuf_FeatureSetDefaults_FeatureSetEditionDefault * msg,google_protobuf_FeatureSet * value)11691 UPB_INLINE void google_protobuf_FeatureSetDefaults_FeatureSetEditionDefault_set_fixed_features(google_protobuf_FeatureSetDefaults_FeatureSetEditionDefault *msg, google_protobuf_FeatureSet* value) {
11692   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)};
11693   UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__FeatureSet_msg_init);
11694   upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
11695 }
google_protobuf_FeatureSetDefaults_FeatureSetEditionDefault_mutable_fixed_features(google_protobuf_FeatureSetDefaults_FeatureSetEditionDefault * msg,upb_Arena * arena)11696 UPB_INLINE struct google_protobuf_FeatureSet* google_protobuf_FeatureSetDefaults_FeatureSetEditionDefault_mutable_fixed_features(google_protobuf_FeatureSetDefaults_FeatureSetEditionDefault* msg, upb_Arena* arena) {
11697   struct google_protobuf_FeatureSet* sub = (struct google_protobuf_FeatureSet*)google_protobuf_FeatureSetDefaults_FeatureSetEditionDefault_fixed_features(msg);
11698   if (sub == NULL) {
11699     sub = (struct google_protobuf_FeatureSet*)_upb_Message_New(&google__protobuf__FeatureSet_msg_init, arena);
11700     if (sub) google_protobuf_FeatureSetDefaults_FeatureSetEditionDefault_set_fixed_features(msg, sub);
11701   }
11702   return sub;
11703 }
11704 
11705 /* google.protobuf.SourceCodeInfo */
11706 
google_protobuf_SourceCodeInfo_new(upb_Arena * arena)11707 UPB_INLINE google_protobuf_SourceCodeInfo* google_protobuf_SourceCodeInfo_new(upb_Arena* arena) {
11708   return (google_protobuf_SourceCodeInfo*)_upb_Message_New(&google__protobuf__SourceCodeInfo_msg_init, arena);
11709 }
google_protobuf_SourceCodeInfo_parse(const char * buf,size_t size,upb_Arena * arena)11710 UPB_INLINE google_protobuf_SourceCodeInfo* google_protobuf_SourceCodeInfo_parse(const char* buf, size_t size, upb_Arena* arena) {
11711   google_protobuf_SourceCodeInfo* ret = google_protobuf_SourceCodeInfo_new(arena);
11712   if (!ret) return NULL;
11713   if (upb_Decode(buf, size, UPB_UPCAST(ret), &google__protobuf__SourceCodeInfo_msg_init, NULL, 0, arena) !=
11714       kUpb_DecodeStatus_Ok) {
11715     return NULL;
11716   }
11717   return ret;
11718 }
google_protobuf_SourceCodeInfo_parse_ex(const char * buf,size_t size,const upb_ExtensionRegistry * extreg,int options,upb_Arena * arena)11719 UPB_INLINE google_protobuf_SourceCodeInfo* google_protobuf_SourceCodeInfo_parse_ex(const char* buf, size_t size,
11720                            const upb_ExtensionRegistry* extreg,
11721                            int options, upb_Arena* arena) {
11722   google_protobuf_SourceCodeInfo* ret = google_protobuf_SourceCodeInfo_new(arena);
11723   if (!ret) return NULL;
11724   if (upb_Decode(buf, size, UPB_UPCAST(ret), &google__protobuf__SourceCodeInfo_msg_init, extreg, options,
11725                  arena) != kUpb_DecodeStatus_Ok) {
11726     return NULL;
11727   }
11728   return ret;
11729 }
google_protobuf_SourceCodeInfo_serialize(const google_protobuf_SourceCodeInfo * msg,upb_Arena * arena,size_t * len)11730 UPB_INLINE char* google_protobuf_SourceCodeInfo_serialize(const google_protobuf_SourceCodeInfo* msg, upb_Arena* arena, size_t* len) {
11731   char* ptr;
11732   (void)upb_Encode(UPB_UPCAST(msg), &google__protobuf__SourceCodeInfo_msg_init, 0, arena, &ptr, len);
11733   return ptr;
11734 }
google_protobuf_SourceCodeInfo_serialize_ex(const google_protobuf_SourceCodeInfo * msg,int options,upb_Arena * arena,size_t * len)11735 UPB_INLINE char* google_protobuf_SourceCodeInfo_serialize_ex(const google_protobuf_SourceCodeInfo* msg, int options,
11736                                  upb_Arena* arena, size_t* len) {
11737   char* ptr;
11738   (void)upb_Encode(UPB_UPCAST(msg), &google__protobuf__SourceCodeInfo_msg_init, options, arena, &ptr, len);
11739   return ptr;
11740 }
google_protobuf_SourceCodeInfo_clear_location(google_protobuf_SourceCodeInfo * msg)11741 UPB_INLINE void google_protobuf_SourceCodeInfo_clear_location(google_protobuf_SourceCodeInfo* msg) {
11742   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)};
11743   upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
11744 }
google_protobuf_SourceCodeInfo_location(const google_protobuf_SourceCodeInfo * msg,size_t * size)11745 UPB_INLINE const google_protobuf_SourceCodeInfo_Location* const* google_protobuf_SourceCodeInfo_location(const google_protobuf_SourceCodeInfo* msg, size_t* size) {
11746   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)};
11747   UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__SourceCodeInfo__Location_msg_init);
11748   const upb_Array* arr = upb_Message_GetArray(UPB_UPCAST(msg), &field);
11749   if (arr) {
11750     if (size) *size = arr->UPB_PRIVATE(size);
11751     return (const google_protobuf_SourceCodeInfo_Location* const*)upb_Array_DataPtr(arr);
11752   } else {
11753     if (size) *size = 0;
11754     return NULL;
11755   }
11756 }
_google_protobuf_SourceCodeInfo_location_upb_array(const google_protobuf_SourceCodeInfo * msg,size_t * size)11757 UPB_INLINE const upb_Array* _google_protobuf_SourceCodeInfo_location_upb_array(const google_protobuf_SourceCodeInfo* msg, size_t* size) {
11758   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)};
11759   UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__SourceCodeInfo__Location_msg_init);
11760   const upb_Array* arr = upb_Message_GetArray(UPB_UPCAST(msg), &field);
11761   if (size) {
11762     *size = arr ? arr->UPB_PRIVATE(size) : 0;
11763   }
11764   return arr;
11765 }
_google_protobuf_SourceCodeInfo_location_mutable_upb_array(google_protobuf_SourceCodeInfo * msg,size_t * size,upb_Arena * arena)11766 UPB_INLINE upb_Array* _google_protobuf_SourceCodeInfo_location_mutable_upb_array(google_protobuf_SourceCodeInfo* msg, size_t* size, upb_Arena* arena) {
11767   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)};
11768   UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__SourceCodeInfo__Location_msg_init);
11769   upb_Array* arr = upb_Message_GetOrCreateMutableArray(UPB_UPCAST(msg),
11770                                                        &field, arena);
11771   if (size) {
11772     *size = arr ? arr->UPB_PRIVATE(size) : 0;
11773   }
11774   return arr;
11775 }
11776 
google_protobuf_SourceCodeInfo_mutable_location(google_protobuf_SourceCodeInfo * msg,size_t * size)11777 UPB_INLINE google_protobuf_SourceCodeInfo_Location** google_protobuf_SourceCodeInfo_mutable_location(google_protobuf_SourceCodeInfo* msg, size_t* size) {
11778   upb_MiniTableField field = {1, 8, 0, 0, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
11779   UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__SourceCodeInfo__Location_msg_init);
11780   upb_Array* arr = upb_Message_GetMutableArray(UPB_UPCAST(msg), &field);
11781   if (arr) {
11782     if (size) *size = arr->UPB_PRIVATE(size);
11783     return (google_protobuf_SourceCodeInfo_Location**)upb_Array_MutableDataPtr(arr);
11784   } else {
11785     if (size) *size = 0;
11786     return NULL;
11787   }
11788 }
google_protobuf_SourceCodeInfo_resize_location(google_protobuf_SourceCodeInfo * msg,size_t size,upb_Arena * arena)11789 UPB_INLINE google_protobuf_SourceCodeInfo_Location** google_protobuf_SourceCodeInfo_resize_location(google_protobuf_SourceCodeInfo* msg, size_t size, upb_Arena* arena) {
11790   upb_MiniTableField field = {1, 8, 0, 0, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
11791   return (google_protobuf_SourceCodeInfo_Location**)upb_Message_ResizeArrayUninitialized(UPB_UPCAST(msg),
11792                                                    &field, size, arena);
11793 }
google_protobuf_SourceCodeInfo_add_location(google_protobuf_SourceCodeInfo * msg,upb_Arena * arena)11794 UPB_INLINE struct google_protobuf_SourceCodeInfo_Location* google_protobuf_SourceCodeInfo_add_location(google_protobuf_SourceCodeInfo* msg, upb_Arena* arena) {
11795   upb_MiniTableField field = {1, 8, 0, 0, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
11796   UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__SourceCodeInfo__Location_msg_init);
11797   upb_Array* arr = upb_Message_GetOrCreateMutableArray(
11798       UPB_UPCAST(msg), &field, arena);
11799   if (!arr || !UPB_PRIVATE(_upb_Array_ResizeUninitialized)(
11800                   arr, arr->UPB_PRIVATE(size) + 1, arena)) {
11801     return NULL;
11802   }
11803   struct google_protobuf_SourceCodeInfo_Location* sub = (struct google_protobuf_SourceCodeInfo_Location*)_upb_Message_New(&google__protobuf__SourceCodeInfo__Location_msg_init, arena);
11804   if (!arr || !sub) return NULL;
11805   UPB_PRIVATE(_upb_Array_Set)
11806   (arr, arr->UPB_PRIVATE(size) - 1, &sub, sizeof(sub));
11807   return sub;
11808 }
11809 
11810 /* google.protobuf.SourceCodeInfo.Location */
11811 
google_protobuf_SourceCodeInfo_Location_new(upb_Arena * arena)11812 UPB_INLINE google_protobuf_SourceCodeInfo_Location* google_protobuf_SourceCodeInfo_Location_new(upb_Arena* arena) {
11813   return (google_protobuf_SourceCodeInfo_Location*)_upb_Message_New(&google__protobuf__SourceCodeInfo__Location_msg_init, arena);
11814 }
google_protobuf_SourceCodeInfo_Location_parse(const char * buf,size_t size,upb_Arena * arena)11815 UPB_INLINE google_protobuf_SourceCodeInfo_Location* google_protobuf_SourceCodeInfo_Location_parse(const char* buf, size_t size, upb_Arena* arena) {
11816   google_protobuf_SourceCodeInfo_Location* ret = google_protobuf_SourceCodeInfo_Location_new(arena);
11817   if (!ret) return NULL;
11818   if (upb_Decode(buf, size, UPB_UPCAST(ret), &google__protobuf__SourceCodeInfo__Location_msg_init, NULL, 0, arena) !=
11819       kUpb_DecodeStatus_Ok) {
11820     return NULL;
11821   }
11822   return ret;
11823 }
google_protobuf_SourceCodeInfo_Location_parse_ex(const char * buf,size_t size,const upb_ExtensionRegistry * extreg,int options,upb_Arena * arena)11824 UPB_INLINE google_protobuf_SourceCodeInfo_Location* google_protobuf_SourceCodeInfo_Location_parse_ex(const char* buf, size_t size,
11825                            const upb_ExtensionRegistry* extreg,
11826                            int options, upb_Arena* arena) {
11827   google_protobuf_SourceCodeInfo_Location* ret = google_protobuf_SourceCodeInfo_Location_new(arena);
11828   if (!ret) return NULL;
11829   if (upb_Decode(buf, size, UPB_UPCAST(ret), &google__protobuf__SourceCodeInfo__Location_msg_init, extreg, options,
11830                  arena) != kUpb_DecodeStatus_Ok) {
11831     return NULL;
11832   }
11833   return ret;
11834 }
google_protobuf_SourceCodeInfo_Location_serialize(const google_protobuf_SourceCodeInfo_Location * msg,upb_Arena * arena,size_t * len)11835 UPB_INLINE char* google_protobuf_SourceCodeInfo_Location_serialize(const google_protobuf_SourceCodeInfo_Location* msg, upb_Arena* arena, size_t* len) {
11836   char* ptr;
11837   (void)upb_Encode(UPB_UPCAST(msg), &google__protobuf__SourceCodeInfo__Location_msg_init, 0, arena, &ptr, len);
11838   return ptr;
11839 }
google_protobuf_SourceCodeInfo_Location_serialize_ex(const google_protobuf_SourceCodeInfo_Location * msg,int options,upb_Arena * arena,size_t * len)11840 UPB_INLINE char* google_protobuf_SourceCodeInfo_Location_serialize_ex(const google_protobuf_SourceCodeInfo_Location* msg, int options,
11841                                  upb_Arena* arena, size_t* len) {
11842   char* ptr;
11843   (void)upb_Encode(UPB_UPCAST(msg), &google__protobuf__SourceCodeInfo__Location_msg_init, options, arena, &ptr, len);
11844   return ptr;
11845 }
google_protobuf_SourceCodeInfo_Location_clear_path(google_protobuf_SourceCodeInfo_Location * msg)11846 UPB_INLINE void google_protobuf_SourceCodeInfo_Location_clear_path(google_protobuf_SourceCodeInfo_Location* msg) {
11847   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)};
11848   upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
11849 }
google_protobuf_SourceCodeInfo_Location_path(const google_protobuf_SourceCodeInfo_Location * msg,size_t * size)11850 UPB_INLINE int32_t const* google_protobuf_SourceCodeInfo_Location_path(const google_protobuf_SourceCodeInfo_Location* msg, size_t* size) {
11851   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)};
11852   const upb_Array* arr = upb_Message_GetArray(UPB_UPCAST(msg), &field);
11853   if (arr) {
11854     if (size) *size = arr->UPB_PRIVATE(size);
11855     return (int32_t const*)upb_Array_DataPtr(arr);
11856   } else {
11857     if (size) *size = 0;
11858     return NULL;
11859   }
11860 }
_google_protobuf_SourceCodeInfo_Location_path_upb_array(const google_protobuf_SourceCodeInfo_Location * msg,size_t * size)11861 UPB_INLINE const upb_Array* _google_protobuf_SourceCodeInfo_Location_path_upb_array(const google_protobuf_SourceCodeInfo_Location* msg, size_t* size) {
11862   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)};
11863   const upb_Array* arr = upb_Message_GetArray(UPB_UPCAST(msg), &field);
11864   if (size) {
11865     *size = arr ? arr->UPB_PRIVATE(size) : 0;
11866   }
11867   return arr;
11868 }
_google_protobuf_SourceCodeInfo_Location_path_mutable_upb_array(google_protobuf_SourceCodeInfo_Location * msg,size_t * size,upb_Arena * arena)11869 UPB_INLINE upb_Array* _google_protobuf_SourceCodeInfo_Location_path_mutable_upb_array(google_protobuf_SourceCodeInfo_Location* msg, size_t* size, upb_Arena* arena) {
11870   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)};
11871   upb_Array* arr = upb_Message_GetOrCreateMutableArray(UPB_UPCAST(msg),
11872                                                        &field, arena);
11873   if (size) {
11874     *size = arr ? arr->UPB_PRIVATE(size) : 0;
11875   }
11876   return arr;
11877 }
google_protobuf_SourceCodeInfo_Location_clear_span(google_protobuf_SourceCodeInfo_Location * msg)11878 UPB_INLINE void google_protobuf_SourceCodeInfo_Location_clear_span(google_protobuf_SourceCodeInfo_Location* msg) {
11879   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)};
11880   upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
11881 }
google_protobuf_SourceCodeInfo_Location_span(const google_protobuf_SourceCodeInfo_Location * msg,size_t * size)11882 UPB_INLINE int32_t const* google_protobuf_SourceCodeInfo_Location_span(const google_protobuf_SourceCodeInfo_Location* msg, size_t* size) {
11883   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)};
11884   const upb_Array* arr = upb_Message_GetArray(UPB_UPCAST(msg), &field);
11885   if (arr) {
11886     if (size) *size = arr->UPB_PRIVATE(size);
11887     return (int32_t const*)upb_Array_DataPtr(arr);
11888   } else {
11889     if (size) *size = 0;
11890     return NULL;
11891   }
11892 }
_google_protobuf_SourceCodeInfo_Location_span_upb_array(const google_protobuf_SourceCodeInfo_Location * msg,size_t * size)11893 UPB_INLINE const upb_Array* _google_protobuf_SourceCodeInfo_Location_span_upb_array(const google_protobuf_SourceCodeInfo_Location* msg, size_t* size) {
11894   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)};
11895   const upb_Array* arr = upb_Message_GetArray(UPB_UPCAST(msg), &field);
11896   if (size) {
11897     *size = arr ? arr->UPB_PRIVATE(size) : 0;
11898   }
11899   return arr;
11900 }
_google_protobuf_SourceCodeInfo_Location_span_mutable_upb_array(google_protobuf_SourceCodeInfo_Location * msg,size_t * size,upb_Arena * arena)11901 UPB_INLINE upb_Array* _google_protobuf_SourceCodeInfo_Location_span_mutable_upb_array(google_protobuf_SourceCodeInfo_Location* msg, size_t* size, upb_Arena* arena) {
11902   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)};
11903   upb_Array* arr = upb_Message_GetOrCreateMutableArray(UPB_UPCAST(msg),
11904                                                        &field, arena);
11905   if (size) {
11906     *size = arr ? arr->UPB_PRIVATE(size) : 0;
11907   }
11908   return arr;
11909 }
google_protobuf_SourceCodeInfo_Location_clear_leading_comments(google_protobuf_SourceCodeInfo_Location * msg)11910 UPB_INLINE void google_protobuf_SourceCodeInfo_Location_clear_leading_comments(google_protobuf_SourceCodeInfo_Location* msg) {
11911   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)};
11912   upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
11913 }
google_protobuf_SourceCodeInfo_Location_leading_comments(const google_protobuf_SourceCodeInfo_Location * msg)11914 UPB_INLINE upb_StringView google_protobuf_SourceCodeInfo_Location_leading_comments(const google_protobuf_SourceCodeInfo_Location* msg) {
11915   upb_StringView default_val = upb_StringView_FromString("");
11916   upb_StringView ret;
11917   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)};
11918   _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field,
11919                                     &default_val, &ret);
11920   return ret;
11921 }
google_protobuf_SourceCodeInfo_Location_has_leading_comments(const google_protobuf_SourceCodeInfo_Location * msg)11922 UPB_INLINE bool google_protobuf_SourceCodeInfo_Location_has_leading_comments(const google_protobuf_SourceCodeInfo_Location* msg) {
11923   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)};
11924   return upb_Message_HasBaseField(UPB_UPCAST(msg), &field);
11925 }
google_protobuf_SourceCodeInfo_Location_clear_trailing_comments(google_protobuf_SourceCodeInfo_Location * msg)11926 UPB_INLINE void google_protobuf_SourceCodeInfo_Location_clear_trailing_comments(google_protobuf_SourceCodeInfo_Location* msg) {
11927   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)};
11928   upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
11929 }
google_protobuf_SourceCodeInfo_Location_trailing_comments(const google_protobuf_SourceCodeInfo_Location * msg)11930 UPB_INLINE upb_StringView google_protobuf_SourceCodeInfo_Location_trailing_comments(const google_protobuf_SourceCodeInfo_Location* msg) {
11931   upb_StringView default_val = upb_StringView_FromString("");
11932   upb_StringView ret;
11933   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)};
11934   _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field,
11935                                     &default_val, &ret);
11936   return ret;
11937 }
google_protobuf_SourceCodeInfo_Location_has_trailing_comments(const google_protobuf_SourceCodeInfo_Location * msg)11938 UPB_INLINE bool google_protobuf_SourceCodeInfo_Location_has_trailing_comments(const google_protobuf_SourceCodeInfo_Location* msg) {
11939   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)};
11940   return upb_Message_HasBaseField(UPB_UPCAST(msg), &field);
11941 }
google_protobuf_SourceCodeInfo_Location_clear_leading_detached_comments(google_protobuf_SourceCodeInfo_Location * msg)11942 UPB_INLINE void google_protobuf_SourceCodeInfo_Location_clear_leading_detached_comments(google_protobuf_SourceCodeInfo_Location* msg) {
11943   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)};
11944   upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
11945 }
google_protobuf_SourceCodeInfo_Location_leading_detached_comments(const google_protobuf_SourceCodeInfo_Location * msg,size_t * size)11946 UPB_INLINE upb_StringView const* google_protobuf_SourceCodeInfo_Location_leading_detached_comments(const google_protobuf_SourceCodeInfo_Location* msg, size_t* size) {
11947   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)};
11948   const upb_Array* arr = upb_Message_GetArray(UPB_UPCAST(msg), &field);
11949   if (arr) {
11950     if (size) *size = arr->UPB_PRIVATE(size);
11951     return (upb_StringView const*)upb_Array_DataPtr(arr);
11952   } else {
11953     if (size) *size = 0;
11954     return NULL;
11955   }
11956 }
_google_protobuf_SourceCodeInfo_Location_leading_detached_comments_upb_array(const google_protobuf_SourceCodeInfo_Location * msg,size_t * size)11957 UPB_INLINE const upb_Array* _google_protobuf_SourceCodeInfo_Location_leading_detached_comments_upb_array(const google_protobuf_SourceCodeInfo_Location* msg, size_t* size) {
11958   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)};
11959   const upb_Array* arr = upb_Message_GetArray(UPB_UPCAST(msg), &field);
11960   if (size) {
11961     *size = arr ? arr->UPB_PRIVATE(size) : 0;
11962   }
11963   return arr;
11964 }
_google_protobuf_SourceCodeInfo_Location_leading_detached_comments_mutable_upb_array(google_protobuf_SourceCodeInfo_Location * msg,size_t * size,upb_Arena * arena)11965 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) {
11966   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)};
11967   upb_Array* arr = upb_Message_GetOrCreateMutableArray(UPB_UPCAST(msg),
11968                                                        &field, arena);
11969   if (size) {
11970     *size = arr ? arr->UPB_PRIVATE(size) : 0;
11971   }
11972   return arr;
11973 }
11974 
google_protobuf_SourceCodeInfo_Location_mutable_path(google_protobuf_SourceCodeInfo_Location * msg,size_t * size)11975 UPB_INLINE int32_t* google_protobuf_SourceCodeInfo_Location_mutable_path(google_protobuf_SourceCodeInfo_Location* msg, size_t* size) {
11976   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)};
11977   upb_Array* arr = upb_Message_GetMutableArray(UPB_UPCAST(msg), &field);
11978   if (arr) {
11979     if (size) *size = arr->UPB_PRIVATE(size);
11980     return (int32_t*)upb_Array_MutableDataPtr(arr);
11981   } else {
11982     if (size) *size = 0;
11983     return NULL;
11984   }
11985 }
google_protobuf_SourceCodeInfo_Location_resize_path(google_protobuf_SourceCodeInfo_Location * msg,size_t size,upb_Arena * arena)11986 UPB_INLINE int32_t* google_protobuf_SourceCodeInfo_Location_resize_path(google_protobuf_SourceCodeInfo_Location* msg, size_t size, upb_Arena* arena) {
11987   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)};
11988   return (int32_t*)upb_Message_ResizeArrayUninitialized(UPB_UPCAST(msg),
11989                                                    &field, size, arena);
11990 }
google_protobuf_SourceCodeInfo_Location_add_path(google_protobuf_SourceCodeInfo_Location * msg,int32_t val,upb_Arena * arena)11991 UPB_INLINE bool google_protobuf_SourceCodeInfo_Location_add_path(google_protobuf_SourceCodeInfo_Location* msg, int32_t val, upb_Arena* arena) {
11992   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)};
11993   upb_Array* arr = upb_Message_GetOrCreateMutableArray(
11994       UPB_UPCAST(msg), &field, arena);
11995   if (!arr || !UPB_PRIVATE(_upb_Array_ResizeUninitialized)(
11996                   arr, arr->UPB_PRIVATE(size) + 1, arena)) {
11997     return false;
11998   }
11999   UPB_PRIVATE(_upb_Array_Set)
12000   (arr, arr->UPB_PRIVATE(size) - 1, &val, sizeof(val));
12001   return true;
12002 }
google_protobuf_SourceCodeInfo_Location_mutable_span(google_protobuf_SourceCodeInfo_Location * msg,size_t * size)12003 UPB_INLINE int32_t* google_protobuf_SourceCodeInfo_Location_mutable_span(google_protobuf_SourceCodeInfo_Location* msg, size_t* size) {
12004   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)};
12005   upb_Array* arr = upb_Message_GetMutableArray(UPB_UPCAST(msg), &field);
12006   if (arr) {
12007     if (size) *size = arr->UPB_PRIVATE(size);
12008     return (int32_t*)upb_Array_MutableDataPtr(arr);
12009   } else {
12010     if (size) *size = 0;
12011     return NULL;
12012   }
12013 }
google_protobuf_SourceCodeInfo_Location_resize_span(google_protobuf_SourceCodeInfo_Location * msg,size_t size,upb_Arena * arena)12014 UPB_INLINE int32_t* google_protobuf_SourceCodeInfo_Location_resize_span(google_protobuf_SourceCodeInfo_Location* msg, size_t size, upb_Arena* arena) {
12015   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)};
12016   return (int32_t*)upb_Message_ResizeArrayUninitialized(UPB_UPCAST(msg),
12017                                                    &field, size, arena);
12018 }
google_protobuf_SourceCodeInfo_Location_add_span(google_protobuf_SourceCodeInfo_Location * msg,int32_t val,upb_Arena * arena)12019 UPB_INLINE bool google_protobuf_SourceCodeInfo_Location_add_span(google_protobuf_SourceCodeInfo_Location* msg, int32_t val, upb_Arena* arena) {
12020   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)};
12021   upb_Array* arr = upb_Message_GetOrCreateMutableArray(
12022       UPB_UPCAST(msg), &field, arena);
12023   if (!arr || !UPB_PRIVATE(_upb_Array_ResizeUninitialized)(
12024                   arr, arr->UPB_PRIVATE(size) + 1, arena)) {
12025     return false;
12026   }
12027   UPB_PRIVATE(_upb_Array_Set)
12028   (arr, arr->UPB_PRIVATE(size) - 1, &val, sizeof(val));
12029   return true;
12030 }
google_protobuf_SourceCodeInfo_Location_set_leading_comments(google_protobuf_SourceCodeInfo_Location * msg,upb_StringView value)12031 UPB_INLINE void google_protobuf_SourceCodeInfo_Location_set_leading_comments(google_protobuf_SourceCodeInfo_Location *msg, upb_StringView value) {
12032   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)};
12033   upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
12034 }
google_protobuf_SourceCodeInfo_Location_set_trailing_comments(google_protobuf_SourceCodeInfo_Location * msg,upb_StringView value)12035 UPB_INLINE void google_protobuf_SourceCodeInfo_Location_set_trailing_comments(google_protobuf_SourceCodeInfo_Location *msg, upb_StringView value) {
12036   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)};
12037   upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
12038 }
google_protobuf_SourceCodeInfo_Location_mutable_leading_detached_comments(google_protobuf_SourceCodeInfo_Location * msg,size_t * size)12039 UPB_INLINE upb_StringView* google_protobuf_SourceCodeInfo_Location_mutable_leading_detached_comments(google_protobuf_SourceCodeInfo_Location* msg, size_t* size) {
12040   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)};
12041   upb_Array* arr = upb_Message_GetMutableArray(UPB_UPCAST(msg), &field);
12042   if (arr) {
12043     if (size) *size = arr->UPB_PRIVATE(size);
12044     return (upb_StringView*)upb_Array_MutableDataPtr(arr);
12045   } else {
12046     if (size) *size = 0;
12047     return NULL;
12048   }
12049 }
google_protobuf_SourceCodeInfo_Location_resize_leading_detached_comments(google_protobuf_SourceCodeInfo_Location * msg,size_t size,upb_Arena * arena)12050 UPB_INLINE upb_StringView* google_protobuf_SourceCodeInfo_Location_resize_leading_detached_comments(google_protobuf_SourceCodeInfo_Location* msg, size_t size, upb_Arena* arena) {
12051   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)};
12052   return (upb_StringView*)upb_Message_ResizeArrayUninitialized(UPB_UPCAST(msg),
12053                                                    &field, size, arena);
12054 }
google_protobuf_SourceCodeInfo_Location_add_leading_detached_comments(google_protobuf_SourceCodeInfo_Location * msg,upb_StringView val,upb_Arena * arena)12055 UPB_INLINE bool google_protobuf_SourceCodeInfo_Location_add_leading_detached_comments(google_protobuf_SourceCodeInfo_Location* msg, upb_StringView val, upb_Arena* arena) {
12056   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)};
12057   upb_Array* arr = upb_Message_GetOrCreateMutableArray(
12058       UPB_UPCAST(msg), &field, arena);
12059   if (!arr || !UPB_PRIVATE(_upb_Array_ResizeUninitialized)(
12060                   arr, arr->UPB_PRIVATE(size) + 1, arena)) {
12061     return false;
12062   }
12063   UPB_PRIVATE(_upb_Array_Set)
12064   (arr, arr->UPB_PRIVATE(size) - 1, &val, sizeof(val));
12065   return true;
12066 }
12067 
12068 /* google.protobuf.GeneratedCodeInfo */
12069 
google_protobuf_GeneratedCodeInfo_new(upb_Arena * arena)12070 UPB_INLINE google_protobuf_GeneratedCodeInfo* google_protobuf_GeneratedCodeInfo_new(upb_Arena* arena) {
12071   return (google_protobuf_GeneratedCodeInfo*)_upb_Message_New(&google__protobuf__GeneratedCodeInfo_msg_init, arena);
12072 }
google_protobuf_GeneratedCodeInfo_parse(const char * buf,size_t size,upb_Arena * arena)12073 UPB_INLINE google_protobuf_GeneratedCodeInfo* google_protobuf_GeneratedCodeInfo_parse(const char* buf, size_t size, upb_Arena* arena) {
12074   google_protobuf_GeneratedCodeInfo* ret = google_protobuf_GeneratedCodeInfo_new(arena);
12075   if (!ret) return NULL;
12076   if (upb_Decode(buf, size, UPB_UPCAST(ret), &google__protobuf__GeneratedCodeInfo_msg_init, NULL, 0, arena) !=
12077       kUpb_DecodeStatus_Ok) {
12078     return NULL;
12079   }
12080   return ret;
12081 }
google_protobuf_GeneratedCodeInfo_parse_ex(const char * buf,size_t size,const upb_ExtensionRegistry * extreg,int options,upb_Arena * arena)12082 UPB_INLINE google_protobuf_GeneratedCodeInfo* google_protobuf_GeneratedCodeInfo_parse_ex(const char* buf, size_t size,
12083                            const upb_ExtensionRegistry* extreg,
12084                            int options, upb_Arena* arena) {
12085   google_protobuf_GeneratedCodeInfo* ret = google_protobuf_GeneratedCodeInfo_new(arena);
12086   if (!ret) return NULL;
12087   if (upb_Decode(buf, size, UPB_UPCAST(ret), &google__protobuf__GeneratedCodeInfo_msg_init, extreg, options,
12088                  arena) != kUpb_DecodeStatus_Ok) {
12089     return NULL;
12090   }
12091   return ret;
12092 }
google_protobuf_GeneratedCodeInfo_serialize(const google_protobuf_GeneratedCodeInfo * msg,upb_Arena * arena,size_t * len)12093 UPB_INLINE char* google_protobuf_GeneratedCodeInfo_serialize(const google_protobuf_GeneratedCodeInfo* msg, upb_Arena* arena, size_t* len) {
12094   char* ptr;
12095   (void)upb_Encode(UPB_UPCAST(msg), &google__protobuf__GeneratedCodeInfo_msg_init, 0, arena, &ptr, len);
12096   return ptr;
12097 }
google_protobuf_GeneratedCodeInfo_serialize_ex(const google_protobuf_GeneratedCodeInfo * msg,int options,upb_Arena * arena,size_t * len)12098 UPB_INLINE char* google_protobuf_GeneratedCodeInfo_serialize_ex(const google_protobuf_GeneratedCodeInfo* msg, int options,
12099                                  upb_Arena* arena, size_t* len) {
12100   char* ptr;
12101   (void)upb_Encode(UPB_UPCAST(msg), &google__protobuf__GeneratedCodeInfo_msg_init, options, arena, &ptr, len);
12102   return ptr;
12103 }
google_protobuf_GeneratedCodeInfo_clear_annotation(google_protobuf_GeneratedCodeInfo * msg)12104 UPB_INLINE void google_protobuf_GeneratedCodeInfo_clear_annotation(google_protobuf_GeneratedCodeInfo* msg) {
12105   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)};
12106   upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
12107 }
google_protobuf_GeneratedCodeInfo_annotation(const google_protobuf_GeneratedCodeInfo * msg,size_t * size)12108 UPB_INLINE const google_protobuf_GeneratedCodeInfo_Annotation* const* google_protobuf_GeneratedCodeInfo_annotation(const google_protobuf_GeneratedCodeInfo* msg, size_t* size) {
12109   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)};
12110   UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__GeneratedCodeInfo__Annotation_msg_init);
12111   const upb_Array* arr = upb_Message_GetArray(UPB_UPCAST(msg), &field);
12112   if (arr) {
12113     if (size) *size = arr->UPB_PRIVATE(size);
12114     return (const google_protobuf_GeneratedCodeInfo_Annotation* const*)upb_Array_DataPtr(arr);
12115   } else {
12116     if (size) *size = 0;
12117     return NULL;
12118   }
12119 }
_google_protobuf_GeneratedCodeInfo_annotation_upb_array(const google_protobuf_GeneratedCodeInfo * msg,size_t * size)12120 UPB_INLINE const upb_Array* _google_protobuf_GeneratedCodeInfo_annotation_upb_array(const google_protobuf_GeneratedCodeInfo* msg, size_t* size) {
12121   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)};
12122   UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__GeneratedCodeInfo__Annotation_msg_init);
12123   const upb_Array* arr = upb_Message_GetArray(UPB_UPCAST(msg), &field);
12124   if (size) {
12125     *size = arr ? arr->UPB_PRIVATE(size) : 0;
12126   }
12127   return arr;
12128 }
_google_protobuf_GeneratedCodeInfo_annotation_mutable_upb_array(google_protobuf_GeneratedCodeInfo * msg,size_t * size,upb_Arena * arena)12129 UPB_INLINE upb_Array* _google_protobuf_GeneratedCodeInfo_annotation_mutable_upb_array(google_protobuf_GeneratedCodeInfo* msg, size_t* size, upb_Arena* arena) {
12130   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)};
12131   UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__GeneratedCodeInfo__Annotation_msg_init);
12132   upb_Array* arr = upb_Message_GetOrCreateMutableArray(UPB_UPCAST(msg),
12133                                                        &field, arena);
12134   if (size) {
12135     *size = arr ? arr->UPB_PRIVATE(size) : 0;
12136   }
12137   return arr;
12138 }
12139 
google_protobuf_GeneratedCodeInfo_mutable_annotation(google_protobuf_GeneratedCodeInfo * msg,size_t * size)12140 UPB_INLINE google_protobuf_GeneratedCodeInfo_Annotation** google_protobuf_GeneratedCodeInfo_mutable_annotation(google_protobuf_GeneratedCodeInfo* msg, size_t* size) {
12141   upb_MiniTableField field = {1, 8, 0, 0, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
12142   UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__GeneratedCodeInfo__Annotation_msg_init);
12143   upb_Array* arr = upb_Message_GetMutableArray(UPB_UPCAST(msg), &field);
12144   if (arr) {
12145     if (size) *size = arr->UPB_PRIVATE(size);
12146     return (google_protobuf_GeneratedCodeInfo_Annotation**)upb_Array_MutableDataPtr(arr);
12147   } else {
12148     if (size) *size = 0;
12149     return NULL;
12150   }
12151 }
google_protobuf_GeneratedCodeInfo_resize_annotation(google_protobuf_GeneratedCodeInfo * msg,size_t size,upb_Arena * arena)12152 UPB_INLINE google_protobuf_GeneratedCodeInfo_Annotation** google_protobuf_GeneratedCodeInfo_resize_annotation(google_protobuf_GeneratedCodeInfo* msg, size_t size, upb_Arena* arena) {
12153   upb_MiniTableField field = {1, 8, 0, 0, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
12154   return (google_protobuf_GeneratedCodeInfo_Annotation**)upb_Message_ResizeArrayUninitialized(UPB_UPCAST(msg),
12155                                                    &field, size, arena);
12156 }
google_protobuf_GeneratedCodeInfo_add_annotation(google_protobuf_GeneratedCodeInfo * msg,upb_Arena * arena)12157 UPB_INLINE struct google_protobuf_GeneratedCodeInfo_Annotation* google_protobuf_GeneratedCodeInfo_add_annotation(google_protobuf_GeneratedCodeInfo* msg, upb_Arena* arena) {
12158   upb_MiniTableField field = {1, 8, 0, 0, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
12159   UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__GeneratedCodeInfo__Annotation_msg_init);
12160   upb_Array* arr = upb_Message_GetOrCreateMutableArray(
12161       UPB_UPCAST(msg), &field, arena);
12162   if (!arr || !UPB_PRIVATE(_upb_Array_ResizeUninitialized)(
12163                   arr, arr->UPB_PRIVATE(size) + 1, arena)) {
12164     return NULL;
12165   }
12166   struct google_protobuf_GeneratedCodeInfo_Annotation* sub = (struct google_protobuf_GeneratedCodeInfo_Annotation*)_upb_Message_New(&google__protobuf__GeneratedCodeInfo__Annotation_msg_init, arena);
12167   if (!arr || !sub) return NULL;
12168   UPB_PRIVATE(_upb_Array_Set)
12169   (arr, arr->UPB_PRIVATE(size) - 1, &sub, sizeof(sub));
12170   return sub;
12171 }
12172 
12173 /* google.protobuf.GeneratedCodeInfo.Annotation */
12174 
google_protobuf_GeneratedCodeInfo_Annotation_new(upb_Arena * arena)12175 UPB_INLINE google_protobuf_GeneratedCodeInfo_Annotation* google_protobuf_GeneratedCodeInfo_Annotation_new(upb_Arena* arena) {
12176   return (google_protobuf_GeneratedCodeInfo_Annotation*)_upb_Message_New(&google__protobuf__GeneratedCodeInfo__Annotation_msg_init, arena);
12177 }
google_protobuf_GeneratedCodeInfo_Annotation_parse(const char * buf,size_t size,upb_Arena * arena)12178 UPB_INLINE google_protobuf_GeneratedCodeInfo_Annotation* google_protobuf_GeneratedCodeInfo_Annotation_parse(const char* buf, size_t size, upb_Arena* arena) {
12179   google_protobuf_GeneratedCodeInfo_Annotation* ret = google_protobuf_GeneratedCodeInfo_Annotation_new(arena);
12180   if (!ret) return NULL;
12181   if (upb_Decode(buf, size, UPB_UPCAST(ret), &google__protobuf__GeneratedCodeInfo__Annotation_msg_init, NULL, 0, arena) !=
12182       kUpb_DecodeStatus_Ok) {
12183     return NULL;
12184   }
12185   return ret;
12186 }
google_protobuf_GeneratedCodeInfo_Annotation_parse_ex(const char * buf,size_t size,const upb_ExtensionRegistry * extreg,int options,upb_Arena * arena)12187 UPB_INLINE google_protobuf_GeneratedCodeInfo_Annotation* google_protobuf_GeneratedCodeInfo_Annotation_parse_ex(const char* buf, size_t size,
12188                            const upb_ExtensionRegistry* extreg,
12189                            int options, upb_Arena* arena) {
12190   google_protobuf_GeneratedCodeInfo_Annotation* ret = google_protobuf_GeneratedCodeInfo_Annotation_new(arena);
12191   if (!ret) return NULL;
12192   if (upb_Decode(buf, size, UPB_UPCAST(ret), &google__protobuf__GeneratedCodeInfo__Annotation_msg_init, extreg, options,
12193                  arena) != kUpb_DecodeStatus_Ok) {
12194     return NULL;
12195   }
12196   return ret;
12197 }
google_protobuf_GeneratedCodeInfo_Annotation_serialize(const google_protobuf_GeneratedCodeInfo_Annotation * msg,upb_Arena * arena,size_t * len)12198 UPB_INLINE char* google_protobuf_GeneratedCodeInfo_Annotation_serialize(const google_protobuf_GeneratedCodeInfo_Annotation* msg, upb_Arena* arena, size_t* len) {
12199   char* ptr;
12200   (void)upb_Encode(UPB_UPCAST(msg), &google__protobuf__GeneratedCodeInfo__Annotation_msg_init, 0, arena, &ptr, len);
12201   return ptr;
12202 }
google_protobuf_GeneratedCodeInfo_Annotation_serialize_ex(const google_protobuf_GeneratedCodeInfo_Annotation * msg,int options,upb_Arena * arena,size_t * len)12203 UPB_INLINE char* google_protobuf_GeneratedCodeInfo_Annotation_serialize_ex(const google_protobuf_GeneratedCodeInfo_Annotation* msg, int options,
12204                                  upb_Arena* arena, size_t* len) {
12205   char* ptr;
12206   (void)upb_Encode(UPB_UPCAST(msg), &google__protobuf__GeneratedCodeInfo__Annotation_msg_init, options, arena, &ptr, len);
12207   return ptr;
12208 }
google_protobuf_GeneratedCodeInfo_Annotation_clear_path(google_protobuf_GeneratedCodeInfo_Annotation * msg)12209 UPB_INLINE void google_protobuf_GeneratedCodeInfo_Annotation_clear_path(google_protobuf_GeneratedCodeInfo_Annotation* msg) {
12210   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)};
12211   upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
12212 }
google_protobuf_GeneratedCodeInfo_Annotation_path(const google_protobuf_GeneratedCodeInfo_Annotation * msg,size_t * size)12213 UPB_INLINE int32_t const* google_protobuf_GeneratedCodeInfo_Annotation_path(const google_protobuf_GeneratedCodeInfo_Annotation* msg, size_t* size) {
12214   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)};
12215   const upb_Array* arr = upb_Message_GetArray(UPB_UPCAST(msg), &field);
12216   if (arr) {
12217     if (size) *size = arr->UPB_PRIVATE(size);
12218     return (int32_t const*)upb_Array_DataPtr(arr);
12219   } else {
12220     if (size) *size = 0;
12221     return NULL;
12222   }
12223 }
_google_protobuf_GeneratedCodeInfo_Annotation_path_upb_array(const google_protobuf_GeneratedCodeInfo_Annotation * msg,size_t * size)12224 UPB_INLINE const upb_Array* _google_protobuf_GeneratedCodeInfo_Annotation_path_upb_array(const google_protobuf_GeneratedCodeInfo_Annotation* msg, size_t* size) {
12225   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)};
12226   const upb_Array* arr = upb_Message_GetArray(UPB_UPCAST(msg), &field);
12227   if (size) {
12228     *size = arr ? arr->UPB_PRIVATE(size) : 0;
12229   }
12230   return arr;
12231 }
_google_protobuf_GeneratedCodeInfo_Annotation_path_mutable_upb_array(google_protobuf_GeneratedCodeInfo_Annotation * msg,size_t * size,upb_Arena * arena)12232 UPB_INLINE upb_Array* _google_protobuf_GeneratedCodeInfo_Annotation_path_mutable_upb_array(google_protobuf_GeneratedCodeInfo_Annotation* msg, size_t* size, upb_Arena* arena) {
12233   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)};
12234   upb_Array* arr = upb_Message_GetOrCreateMutableArray(UPB_UPCAST(msg),
12235                                                        &field, arena);
12236   if (size) {
12237     *size = arr ? arr->UPB_PRIVATE(size) : 0;
12238   }
12239   return arr;
12240 }
google_protobuf_GeneratedCodeInfo_Annotation_clear_source_file(google_protobuf_GeneratedCodeInfo_Annotation * msg)12241 UPB_INLINE void google_protobuf_GeneratedCodeInfo_Annotation_clear_source_file(google_protobuf_GeneratedCodeInfo_Annotation* msg) {
12242   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)};
12243   upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
12244 }
google_protobuf_GeneratedCodeInfo_Annotation_source_file(const google_protobuf_GeneratedCodeInfo_Annotation * msg)12245 UPB_INLINE upb_StringView google_protobuf_GeneratedCodeInfo_Annotation_source_file(const google_protobuf_GeneratedCodeInfo_Annotation* msg) {
12246   upb_StringView default_val = upb_StringView_FromString("");
12247   upb_StringView ret;
12248   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)};
12249   _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field,
12250                                     &default_val, &ret);
12251   return ret;
12252 }
google_protobuf_GeneratedCodeInfo_Annotation_has_source_file(const google_protobuf_GeneratedCodeInfo_Annotation * msg)12253 UPB_INLINE bool google_protobuf_GeneratedCodeInfo_Annotation_has_source_file(const google_protobuf_GeneratedCodeInfo_Annotation* msg) {
12254   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)};
12255   return upb_Message_HasBaseField(UPB_UPCAST(msg), &field);
12256 }
google_protobuf_GeneratedCodeInfo_Annotation_clear_begin(google_protobuf_GeneratedCodeInfo_Annotation * msg)12257 UPB_INLINE void google_protobuf_GeneratedCodeInfo_Annotation_clear_begin(google_protobuf_GeneratedCodeInfo_Annotation* msg) {
12258   const upb_MiniTableField field = {3, UPB_SIZE(16, 12), 65, kUpb_NoSub, 5, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
12259   upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
12260 }
google_protobuf_GeneratedCodeInfo_Annotation_begin(const google_protobuf_GeneratedCodeInfo_Annotation * msg)12261 UPB_INLINE int32_t google_protobuf_GeneratedCodeInfo_Annotation_begin(const google_protobuf_GeneratedCodeInfo_Annotation* msg) {
12262   int32_t default_val = (int32_t)0;
12263   int32_t ret;
12264   const upb_MiniTableField field = {3, UPB_SIZE(16, 12), 65, kUpb_NoSub, 5, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
12265   _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field,
12266                                     &default_val, &ret);
12267   return ret;
12268 }
google_protobuf_GeneratedCodeInfo_Annotation_has_begin(const google_protobuf_GeneratedCodeInfo_Annotation * msg)12269 UPB_INLINE bool google_protobuf_GeneratedCodeInfo_Annotation_has_begin(const google_protobuf_GeneratedCodeInfo_Annotation* msg) {
12270   const upb_MiniTableField field = {3, UPB_SIZE(16, 12), 65, kUpb_NoSub, 5, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
12271   return upb_Message_HasBaseField(UPB_UPCAST(msg), &field);
12272 }
google_protobuf_GeneratedCodeInfo_Annotation_clear_end(google_protobuf_GeneratedCodeInfo_Annotation * msg)12273 UPB_INLINE void google_protobuf_GeneratedCodeInfo_Annotation_clear_end(google_protobuf_GeneratedCodeInfo_Annotation* msg) {
12274   const upb_MiniTableField field = {4, UPB_SIZE(20, 16), 66, kUpb_NoSub, 5, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
12275   upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
12276 }
google_protobuf_GeneratedCodeInfo_Annotation_end(const google_protobuf_GeneratedCodeInfo_Annotation * msg)12277 UPB_INLINE int32_t google_protobuf_GeneratedCodeInfo_Annotation_end(const google_protobuf_GeneratedCodeInfo_Annotation* msg) {
12278   int32_t default_val = (int32_t)0;
12279   int32_t ret;
12280   const upb_MiniTableField field = {4, UPB_SIZE(20, 16), 66, kUpb_NoSub, 5, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
12281   _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field,
12282                                     &default_val, &ret);
12283   return ret;
12284 }
google_protobuf_GeneratedCodeInfo_Annotation_has_end(const google_protobuf_GeneratedCodeInfo_Annotation * msg)12285 UPB_INLINE bool google_protobuf_GeneratedCodeInfo_Annotation_has_end(const google_protobuf_GeneratedCodeInfo_Annotation* msg) {
12286   const upb_MiniTableField field = {4, UPB_SIZE(20, 16), 66, kUpb_NoSub, 5, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
12287   return upb_Message_HasBaseField(UPB_UPCAST(msg), &field);
12288 }
google_protobuf_GeneratedCodeInfo_Annotation_clear_semantic(google_protobuf_GeneratedCodeInfo_Annotation * msg)12289 UPB_INLINE void google_protobuf_GeneratedCodeInfo_Annotation_clear_semantic(google_protobuf_GeneratedCodeInfo_Annotation* msg) {
12290   const upb_MiniTableField field = {5, UPB_SIZE(24, 20), 67, 0, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
12291   upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
12292 }
google_protobuf_GeneratedCodeInfo_Annotation_semantic(const google_protobuf_GeneratedCodeInfo_Annotation * msg)12293 UPB_INLINE int32_t google_protobuf_GeneratedCodeInfo_Annotation_semantic(const google_protobuf_GeneratedCodeInfo_Annotation* msg) {
12294   int32_t default_val = 0;
12295   int32_t ret;
12296   const upb_MiniTableField field = {5, UPB_SIZE(24, 20), 67, 0, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
12297   _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field,
12298                                     &default_val, &ret);
12299   return ret;
12300 }
google_protobuf_GeneratedCodeInfo_Annotation_has_semantic(const google_protobuf_GeneratedCodeInfo_Annotation * msg)12301 UPB_INLINE bool google_protobuf_GeneratedCodeInfo_Annotation_has_semantic(const google_protobuf_GeneratedCodeInfo_Annotation* msg) {
12302   const upb_MiniTableField field = {5, UPB_SIZE(24, 20), 67, 0, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
12303   return upb_Message_HasBaseField(UPB_UPCAST(msg), &field);
12304 }
12305 
google_protobuf_GeneratedCodeInfo_Annotation_mutable_path(google_protobuf_GeneratedCodeInfo_Annotation * msg,size_t * size)12306 UPB_INLINE int32_t* google_protobuf_GeneratedCodeInfo_Annotation_mutable_path(google_protobuf_GeneratedCodeInfo_Annotation* msg, size_t* size) {
12307   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)};
12308   upb_Array* arr = upb_Message_GetMutableArray(UPB_UPCAST(msg), &field);
12309   if (arr) {
12310     if (size) *size = arr->UPB_PRIVATE(size);
12311     return (int32_t*)upb_Array_MutableDataPtr(arr);
12312   } else {
12313     if (size) *size = 0;
12314     return NULL;
12315   }
12316 }
google_protobuf_GeneratedCodeInfo_Annotation_resize_path(google_protobuf_GeneratedCodeInfo_Annotation * msg,size_t size,upb_Arena * arena)12317 UPB_INLINE int32_t* google_protobuf_GeneratedCodeInfo_Annotation_resize_path(google_protobuf_GeneratedCodeInfo_Annotation* msg, size_t size, upb_Arena* arena) {
12318   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)};
12319   return (int32_t*)upb_Message_ResizeArrayUninitialized(UPB_UPCAST(msg),
12320                                                    &field, size, arena);
12321 }
google_protobuf_GeneratedCodeInfo_Annotation_add_path(google_protobuf_GeneratedCodeInfo_Annotation * msg,int32_t val,upb_Arena * arena)12322 UPB_INLINE bool google_protobuf_GeneratedCodeInfo_Annotation_add_path(google_protobuf_GeneratedCodeInfo_Annotation* msg, int32_t val, upb_Arena* arena) {
12323   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)};
12324   upb_Array* arr = upb_Message_GetOrCreateMutableArray(
12325       UPB_UPCAST(msg), &field, arena);
12326   if (!arr || !UPB_PRIVATE(_upb_Array_ResizeUninitialized)(
12327                   arr, arr->UPB_PRIVATE(size) + 1, arena)) {
12328     return false;
12329   }
12330   UPB_PRIVATE(_upb_Array_Set)
12331   (arr, arr->UPB_PRIVATE(size) - 1, &val, sizeof(val));
12332   return true;
12333 }
google_protobuf_GeneratedCodeInfo_Annotation_set_source_file(google_protobuf_GeneratedCodeInfo_Annotation * msg,upb_StringView value)12334 UPB_INLINE void google_protobuf_GeneratedCodeInfo_Annotation_set_source_file(google_protobuf_GeneratedCodeInfo_Annotation *msg, upb_StringView value) {
12335   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)};
12336   upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
12337 }
google_protobuf_GeneratedCodeInfo_Annotation_set_begin(google_protobuf_GeneratedCodeInfo_Annotation * msg,int32_t value)12338 UPB_INLINE void google_protobuf_GeneratedCodeInfo_Annotation_set_begin(google_protobuf_GeneratedCodeInfo_Annotation *msg, int32_t value) {
12339   const upb_MiniTableField field = {3, UPB_SIZE(16, 12), 65, kUpb_NoSub, 5, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
12340   upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
12341 }
google_protobuf_GeneratedCodeInfo_Annotation_set_end(google_protobuf_GeneratedCodeInfo_Annotation * msg,int32_t value)12342 UPB_INLINE void google_protobuf_GeneratedCodeInfo_Annotation_set_end(google_protobuf_GeneratedCodeInfo_Annotation *msg, int32_t value) {
12343   const upb_MiniTableField field = {4, UPB_SIZE(20, 16), 66, kUpb_NoSub, 5, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
12344   upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
12345 }
google_protobuf_GeneratedCodeInfo_Annotation_set_semantic(google_protobuf_GeneratedCodeInfo_Annotation * msg,int32_t value)12346 UPB_INLINE void google_protobuf_GeneratedCodeInfo_Annotation_set_semantic(google_protobuf_GeneratedCodeInfo_Annotation *msg, int32_t value) {
12347   const upb_MiniTableField field = {5, UPB_SIZE(24, 20), 67, 0, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
12348   upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
12349 }
12350 
12351 /* Max size 32 is google.protobuf.FileOptions */
12352 /* Max size 64 is google.protobuf.FileOptions */
12353 #define _UPB_MAXOPT_SIZE UPB_SIZE(112, 200)
12354 
12355 #ifdef __cplusplus
12356 }  /* extern "C" */
12357 #endif
12358 
12359 
12360 #endif  /* GOOGLE_PROTOBUF_DESCRIPTOR_PROTO_UPB_H__UPB_H_ */
12361 #endif
12362 
12363 // IWYU pragma: end_exports
12364 
12365 #endif  // THIRD_PARTY_UPB_UPB_REFLECTION_DESCRIPTOR_BOOTSTRAP_H_
12366 
12367 typedef enum {
12368   kUpb_Syntax_Proto2 = 2,
12369   kUpb_Syntax_Proto3 = 3,
12370   kUpb_Syntax_Editions = 99
12371 } upb_Syntax;
12372 
12373 // Forward declarations for circular references.
12374 typedef struct upb_DefPool upb_DefPool;
12375 typedef struct upb_EnumDef upb_EnumDef;
12376 typedef struct upb_EnumReservedRange upb_EnumReservedRange;
12377 typedef struct upb_EnumValueDef upb_EnumValueDef;
12378 typedef struct upb_ExtensionRange upb_ExtensionRange;
12379 typedef struct upb_FieldDef upb_FieldDef;
12380 typedef struct upb_FileDef upb_FileDef;
12381 typedef struct upb_MessageDef upb_MessageDef;
12382 typedef struct upb_MessageReservedRange upb_MessageReservedRange;
12383 typedef struct upb_MethodDef upb_MethodDef;
12384 typedef struct upb_OneofDef upb_OneofDef;
12385 typedef struct upb_ServiceDef upb_ServiceDef;
12386 
12387 // EVERYTHING BELOW THIS LINE IS INTERNAL - DO NOT USE /////////////////////////
12388 
12389 typedef struct upb_DefBuilder upb_DefBuilder;
12390 
12391 #endif /* UPB_REFLECTION_COMMON_H_ */
12392 
12393 #ifndef UPB_REFLECTION_DEF_TYPE_H_
12394 #define UPB_REFLECTION_DEF_TYPE_H_
12395 
12396 
12397 // Must be last.
12398 
12399 // Inside a symtab we store tagged pointers to specific def types.
12400 typedef enum {
12401   UPB_DEFTYPE_MASK = 7,
12402 
12403   // Only inside symtab table.
12404   UPB_DEFTYPE_EXT = 0,
12405   UPB_DEFTYPE_MSG = 1,
12406   UPB_DEFTYPE_ENUM = 2,
12407   UPB_DEFTYPE_ENUMVAL = 3,
12408   UPB_DEFTYPE_SERVICE = 4,
12409 
12410   // Only inside message table.
12411   UPB_DEFTYPE_FIELD = 0,
12412   UPB_DEFTYPE_ONEOF = 1,
12413 } upb_deftype_t;
12414 
12415 #ifdef __cplusplus
12416 extern "C" {
12417 #endif
12418 
12419 // Our 3-bit pointer tagging requires all pointers to be multiples of 8.
12420 // The arena will always yield 8-byte-aligned addresses, however we put
12421 // the defs into arrays. For each element in the array to be 8-byte-aligned,
12422 // the sizes of each def type must also be a multiple of 8.
12423 //
12424 // If any of these asserts fail, we need to add or remove padding on 32-bit
12425 // machines (64-bit machines will have 8-byte alignment already due to
12426 // pointers, which all of these structs have).
_upb_DefType_CheckPadding(size_t size)12427 UPB_INLINE void _upb_DefType_CheckPadding(size_t size) {
12428   UPB_ASSERT((size & UPB_DEFTYPE_MASK) == 0);
12429 }
12430 
12431 upb_deftype_t _upb_DefType_Type(upb_value v);
12432 
12433 upb_value _upb_DefType_Pack(const void* ptr, upb_deftype_t type);
12434 
12435 const void* _upb_DefType_Unpack(upb_value v, upb_deftype_t type);
12436 
12437 #ifdef __cplusplus
12438 } /* extern "C" */
12439 #endif
12440 
12441 
12442 #endif /* UPB_REFLECTION_DEF_TYPE_H_ */
12443 
12444 // Must be last.
12445 
12446 #ifdef __cplusplus
12447 extern "C" {
12448 #endif
12449 
12450 UPB_API void upb_DefPool_Free(upb_DefPool* s);
12451 
12452 UPB_API upb_DefPool* upb_DefPool_New(void);
12453 
12454 UPB_API const UPB_DESC(FeatureSetDefaults) *
12455     upb_DefPool_FeatureSetDefaults(const upb_DefPool* s);
12456 
12457 UPB_API bool upb_DefPool_SetFeatureSetDefaults(upb_DefPool* s,
12458                                                const char* serialized_defaults,
12459                                                size_t serialized_len,
12460                                                upb_Status* status);
12461 
12462 UPB_API const upb_MessageDef* upb_DefPool_FindMessageByName(
12463     const upb_DefPool* s, const char* sym);
12464 
12465 const upb_MessageDef* upb_DefPool_FindMessageByNameWithSize(
12466     const upb_DefPool* s, const char* sym, size_t len);
12467 
12468 UPB_API const upb_EnumDef* upb_DefPool_FindEnumByName(const upb_DefPool* s,
12469                                                       const char* sym);
12470 
12471 const upb_EnumValueDef* upb_DefPool_FindEnumByNameval(const upb_DefPool* s,
12472                                                       const char* sym);
12473 
12474 const upb_FileDef* upb_DefPool_FindFileByName(const upb_DefPool* s,
12475                                               const char* name);
12476 
12477 const upb_FileDef* upb_DefPool_FindFileByNameWithSize(const upb_DefPool* s,
12478                                                       const char* name,
12479                                                       size_t len);
12480 
12481 const upb_FieldDef* upb_DefPool_FindExtensionByMiniTable(
12482     const upb_DefPool* s, const upb_MiniTableExtension* ext);
12483 
12484 UPB_API const upb_FieldDef* upb_DefPool_FindExtensionByName(const upb_DefPool* s,
12485                                                     const char* sym);
12486 
12487 const upb_FieldDef* upb_DefPool_FindExtensionByNameWithSize(
12488     const upb_DefPool* s, const char* name, size_t size);
12489 
12490 const upb_FieldDef* upb_DefPool_FindExtensionByNumber(const upb_DefPool* s,
12491                                                       const upb_MessageDef* m,
12492                                                       int32_t fieldnum);
12493 
12494 UPB_API const upb_ServiceDef* upb_DefPool_FindServiceByName(
12495   const upb_DefPool* s, const char* name);
12496 
12497 const upb_ServiceDef* upb_DefPool_FindServiceByNameWithSize(
12498     const upb_DefPool* s, const char* name, size_t size);
12499 
12500 const upb_FileDef* upb_DefPool_FindFileContainingSymbol(const upb_DefPool* s,
12501                                                         const char* name);
12502 
12503 UPB_API const upb_FileDef* upb_DefPool_AddFile(
12504     upb_DefPool* s, const UPB_DESC(FileDescriptorProto) * file_proto,
12505     upb_Status* status);
12506 
12507 UPB_API const upb_ExtensionRegistry* upb_DefPool_ExtensionRegistry(
12508     const upb_DefPool* s);
12509 
12510 const upb_FieldDef** upb_DefPool_GetAllExtensions(const upb_DefPool* s,
12511                                                   const upb_MessageDef* m,
12512                                                   size_t* count);
12513 
12514 #ifdef __cplusplus
12515 } /* extern "C" */
12516 #endif
12517 
12518 
12519 #endif /* UPB_REFLECTION_DEF_POOL_H_ */
12520 
12521 // IWYU pragma: private, include "upb/reflection/def.h"
12522 
12523 #ifndef UPB_REFLECTION_ENUM_DEF_H_
12524 #define UPB_REFLECTION_ENUM_DEF_H_
12525 
12526 
12527 // Must be last.
12528 
12529 #ifdef __cplusplus
12530 extern "C" {
12531 #endif
12532 
12533 bool upb_EnumDef_CheckNumber(const upb_EnumDef* e, int32_t num);
12534 const upb_MessageDef* upb_EnumDef_ContainingType(const upb_EnumDef* e);
12535 int32_t upb_EnumDef_Default(const upb_EnumDef* e);
12536 UPB_API const upb_FileDef* upb_EnumDef_File(const upb_EnumDef* e);
12537 const upb_EnumValueDef* upb_EnumDef_FindValueByName(const upb_EnumDef* e,
12538                                                     const char* name);
12539 UPB_API const upb_EnumValueDef* upb_EnumDef_FindValueByNameWithSize(
12540     const upb_EnumDef* e, const char* name, size_t size);
12541 UPB_API const upb_EnumValueDef* upb_EnumDef_FindValueByNumber(
12542     const upb_EnumDef* e, int32_t num);
12543 UPB_API const char* upb_EnumDef_FullName(const upb_EnumDef* e);
12544 bool upb_EnumDef_HasOptions(const upb_EnumDef* e);
12545 bool upb_EnumDef_IsClosed(const upb_EnumDef* e);
12546 bool upb_EnumDef_IsSpecifiedAsClosed(const upb_EnumDef* e);
12547 
12548 // Creates a mini descriptor string for an enum, returns true on success.
12549 bool upb_EnumDef_MiniDescriptorEncode(const upb_EnumDef* e, upb_Arena* a,
12550                                       upb_StringView* out);
12551 
12552 const char* upb_EnumDef_Name(const upb_EnumDef* e);
12553 const UPB_DESC(EnumOptions) * upb_EnumDef_Options(const upb_EnumDef* e);
12554 const UPB_DESC(FeatureSet) * upb_EnumDef_ResolvedFeatures(const upb_EnumDef* e);
12555 
12556 upb_StringView upb_EnumDef_ReservedName(const upb_EnumDef* e, int i);
12557 int upb_EnumDef_ReservedNameCount(const upb_EnumDef* e);
12558 
12559 const upb_EnumReservedRange* upb_EnumDef_ReservedRange(const upb_EnumDef* e,
12560                                                        int i);
12561 int upb_EnumDef_ReservedRangeCount(const upb_EnumDef* e);
12562 
12563 UPB_API const upb_EnumValueDef* upb_EnumDef_Value(const upb_EnumDef* e, int i);
12564 UPB_API int upb_EnumDef_ValueCount(const upb_EnumDef* e);
12565 
12566 #ifdef __cplusplus
12567 } /* extern "C" */
12568 #endif
12569 
12570 
12571 #endif /* UPB_REFLECTION_ENUM_DEF_H_ */
12572 
12573 // IWYU pragma: private, include "upb/reflection/def.h"
12574 
12575 #ifndef UPB_REFLECTION_ENUM_VALUE_DEF_H_
12576 #define UPB_REFLECTION_ENUM_VALUE_DEF_H_
12577 
12578 
12579 // Must be last.
12580 
12581 #ifdef __cplusplus
12582 extern "C" {
12583 #endif
12584 
12585 const upb_EnumDef* upb_EnumValueDef_Enum(const upb_EnumValueDef* v);
12586 const char* upb_EnumValueDef_FullName(const upb_EnumValueDef* v);
12587 bool upb_EnumValueDef_HasOptions(const upb_EnumValueDef* v);
12588 uint32_t upb_EnumValueDef_Index(const upb_EnumValueDef* v);
12589 UPB_API const char* upb_EnumValueDef_Name(const upb_EnumValueDef* v);
12590 UPB_API int32_t upb_EnumValueDef_Number(const upb_EnumValueDef* v);
12591 const UPB_DESC(EnumValueOptions) *
12592     upb_EnumValueDef_Options(const upb_EnumValueDef* v);
12593 const UPB_DESC(FeatureSet) *
12594     upb_EnumValueDef_ResolvedFeatures(const upb_EnumValueDef* e);
12595 
12596 #ifdef __cplusplus
12597 } /* extern "C" */
12598 #endif
12599 
12600 
12601 #endif /* UPB_REFLECTION_ENUM_VALUE_DEF_H_ */
12602 
12603 // IWYU pragma: private, include "upb/reflection/def.h"
12604 
12605 #ifndef UPB_REFLECTION_EXTENSION_RANGE_H_
12606 #define UPB_REFLECTION_EXTENSION_RANGE_H_
12607 
12608 
12609 // Must be last.
12610 
12611 #ifdef __cplusplus
12612 extern "C" {
12613 #endif
12614 
12615 int32_t upb_ExtensionRange_Start(const upb_ExtensionRange* r);
12616 int32_t upb_ExtensionRange_End(const upb_ExtensionRange* r);
12617 
12618 bool upb_ExtensionRange_HasOptions(const upb_ExtensionRange* r);
12619 const UPB_DESC(ExtensionRangeOptions) *
12620     upb_ExtensionRange_Options(const upb_ExtensionRange* r);
12621 const UPB_DESC(FeatureSet) *
12622     upb_ExtensionRange_ResolvedFeatures(const upb_ExtensionRange* e);
12623 
12624 #ifdef __cplusplus
12625 } /* extern "C" */
12626 #endif
12627 
12628 
12629 #endif /* UPB_REFLECTION_EXTENSION_RANGE_H_ */
12630 
12631 // IWYU pragma: private, include "upb/reflection/def.h"
12632 
12633 #ifndef UPB_REFLECTION_FIELD_DEF_H_
12634 #define UPB_REFLECTION_FIELD_DEF_H_
12635 
12636 #include <stdint.h>
12637 
12638 
12639 // Must be last.
12640 
12641 // Maximum field number allowed for FieldDefs.
12642 // This is an inherent limit of the protobuf wire format.
12643 #define kUpb_MaxFieldNumber ((1 << 29) - 1)
12644 
12645 #ifdef __cplusplus
12646 extern "C" {
12647 #endif
12648 
12649 const upb_OneofDef* upb_FieldDef_ContainingOneof(const upb_FieldDef* f);
12650 UPB_API const upb_MessageDef* upb_FieldDef_ContainingType(
12651     const upb_FieldDef* f);
12652 UPB_API upb_CType upb_FieldDef_CType(const upb_FieldDef* f);
12653 UPB_API upb_MessageValue upb_FieldDef_Default(const upb_FieldDef* f);
12654 UPB_API const upb_EnumDef* upb_FieldDef_EnumSubDef(const upb_FieldDef* f);
12655 const upb_MessageDef* upb_FieldDef_ExtensionScope(const upb_FieldDef* f);
12656 UPB_API const upb_FileDef* upb_FieldDef_File(const upb_FieldDef* f);
12657 const char* upb_FieldDef_FullName(const upb_FieldDef* f);
12658 bool upb_FieldDef_HasDefault(const upb_FieldDef* f);
12659 bool upb_FieldDef_HasJsonName(const upb_FieldDef* f);
12660 bool upb_FieldDef_HasOptions(const upb_FieldDef* f);
12661 UPB_API bool upb_FieldDef_HasPresence(const upb_FieldDef* f);
12662 bool upb_FieldDef_HasSubDef(const upb_FieldDef* f);
12663 uint32_t upb_FieldDef_Index(const upb_FieldDef* f);
12664 UPB_API bool upb_FieldDef_IsEnum(const upb_FieldDef* f);
12665 bool upb_FieldDef_IsExtension(const upb_FieldDef* f);
12666 UPB_API bool upb_FieldDef_IsMap(const upb_FieldDef* f);
12667 bool upb_FieldDef_IsOptional(const upb_FieldDef* f);
12668 UPB_API bool upb_FieldDef_IsPacked(const upb_FieldDef* f);
12669 bool upb_FieldDef_IsPrimitive(const upb_FieldDef* f);
12670 UPB_API bool upb_FieldDef_IsRepeated(const upb_FieldDef* f);
12671 bool upb_FieldDef_IsRequired(const upb_FieldDef* f);
12672 bool upb_FieldDef_IsString(const upb_FieldDef* f);
12673 UPB_API bool upb_FieldDef_IsSubMessage(const upb_FieldDef* f);
12674 UPB_API const char* upb_FieldDef_JsonName(const upb_FieldDef* f);
12675 UPB_API upb_Label upb_FieldDef_Label(const upb_FieldDef* f);
12676 uint32_t upb_FieldDef_LayoutIndex(const upb_FieldDef* f);
12677 UPB_API const upb_MessageDef* upb_FieldDef_MessageSubDef(const upb_FieldDef* f);
12678 bool _upb_FieldDef_ValidateUtf8(const upb_FieldDef* f);
12679 bool _upb_FieldDef_IsGroupLike(const upb_FieldDef* f);
12680 
12681 // Creates a mini descriptor string for a field, returns true on success.
12682 bool upb_FieldDef_MiniDescriptorEncode(const upb_FieldDef* f, upb_Arena* a,
12683                                        upb_StringView* out);
12684 
12685 const upb_MiniTableField* upb_FieldDef_MiniTable(const upb_FieldDef* f);
12686 const upb_MiniTableExtension* upb_FieldDef_MiniTableExtension(
12687     const upb_FieldDef* f);
12688 UPB_API const char* upb_FieldDef_Name(const upb_FieldDef* f);
12689 UPB_API uint32_t upb_FieldDef_Number(const upb_FieldDef* f);
12690 const UPB_DESC(FieldOptions) * upb_FieldDef_Options(const upb_FieldDef* f);
12691 const UPB_DESC(FeatureSet) *
12692     upb_FieldDef_ResolvedFeatures(const upb_FieldDef* f);
12693 UPB_API const upb_OneofDef* upb_FieldDef_RealContainingOneof(
12694     const upb_FieldDef* f);
12695 UPB_API upb_FieldType upb_FieldDef_Type(const upb_FieldDef* f);
12696 
12697 #ifdef __cplusplus
12698 } /* extern "C" */
12699 #endif
12700 
12701 
12702 #endif /* UPB_REFLECTION_FIELD_DEF_H_ */
12703 
12704 // IWYU pragma: private, include "upb/reflection/def.h"
12705 
12706 #ifndef UPB_REFLECTION_FILE_DEF_H_
12707 #define UPB_REFLECTION_FILE_DEF_H_
12708 
12709 
12710 // Must be last.
12711 
12712 #ifdef __cplusplus
12713 extern "C" {
12714 #endif
12715 
12716 UPB_API const char* upb_FileDef_EditionName(int edition);
12717 
12718 const upb_FileDef* upb_FileDef_Dependency(const upb_FileDef* f, int i);
12719 int upb_FileDef_DependencyCount(const upb_FileDef* f);
12720 bool upb_FileDef_HasOptions(const upb_FileDef* f);
12721 UPB_API const char* upb_FileDef_Name(const upb_FileDef* f);
12722 const UPB_DESC(FileOptions) * upb_FileDef_Options(const upb_FileDef* f);
12723 const UPB_DESC(FeatureSet) * upb_FileDef_ResolvedFeatures(const upb_FileDef* f);
12724 const char* upb_FileDef_Package(const upb_FileDef* f);
12725 UPB_DESC(Edition) upb_FileDef_Edition(const upb_FileDef* f);
12726 UPB_API const upb_DefPool* upb_FileDef_Pool(const upb_FileDef* f);
12727 
12728 const upb_FileDef* upb_FileDef_PublicDependency(const upb_FileDef* f, int i);
12729 int upb_FileDef_PublicDependencyCount(const upb_FileDef* f);
12730 
12731 const upb_ServiceDef* upb_FileDef_Service(const upb_FileDef* f, int i);
12732 int upb_FileDef_ServiceCount(const upb_FileDef* f);
12733 
12734 UPB_API upb_Syntax upb_FileDef_Syntax(const upb_FileDef* f);
12735 
12736 const upb_EnumDef* upb_FileDef_TopLevelEnum(const upb_FileDef* f, int i);
12737 int upb_FileDef_TopLevelEnumCount(const upb_FileDef* f);
12738 
12739 const upb_FieldDef* upb_FileDef_TopLevelExtension(const upb_FileDef* f, int i);
12740 int upb_FileDef_TopLevelExtensionCount(const upb_FileDef* f);
12741 
12742 const upb_MessageDef* upb_FileDef_TopLevelMessage(const upb_FileDef* f, int i);
12743 int upb_FileDef_TopLevelMessageCount(const upb_FileDef* f);
12744 
12745 const upb_FileDef* upb_FileDef_WeakDependency(const upb_FileDef* f, int i);
12746 int upb_FileDef_WeakDependencyCount(const upb_FileDef* f);
12747 
12748 // Returns whether |symbol| is transitively included by |f|
12749 bool upb_FileDef_Resolves(const upb_FileDef* f, const char* symbol);
12750 
12751 #ifdef __cplusplus
12752 } /* extern "C" */
12753 #endif
12754 
12755 
12756 #endif /* UPB_REFLECTION_FILE_DEF_H_ */
12757 
12758 // IWYU pragma: private, include "upb/reflection/def.h"
12759 
12760 #ifndef UPB_REFLECTION_MESSAGE_DEF_H_
12761 #define UPB_REFLECTION_MESSAGE_DEF_H_
12762 
12763 
12764 // Must be last.
12765 
12766 // Well-known field tag numbers for map-entry messages.
12767 #define kUpb_MapEntry_KeyFieldNumber 1
12768 #define kUpb_MapEntry_ValueFieldNumber 2
12769 
12770 // Well-known field tag numbers for Any messages.
12771 #define kUpb_Any_TypeFieldNumber 1
12772 #define kUpb_Any_ValueFieldNumber 2
12773 
12774 // Well-known field tag numbers for duration messages.
12775 #define kUpb_Duration_SecondsFieldNumber 1
12776 #define kUpb_Duration_NanosFieldNumber 2
12777 
12778 // Well-known field tag numbers for timestamp messages.
12779 #define kUpb_Timestamp_SecondsFieldNumber 1
12780 #define kUpb_Timestamp_NanosFieldNumber 2
12781 
12782 // All the different kind of well known type messages. For simplicity of check,
12783 // number wrappers and string wrappers are grouped together. Make sure the
12784 // order and number of these groups are not changed.
12785 typedef enum {
12786   kUpb_WellKnown_Unspecified,
12787   kUpb_WellKnown_Any,
12788   kUpb_WellKnown_FieldMask,
12789   kUpb_WellKnown_Duration,
12790   kUpb_WellKnown_Timestamp,
12791 
12792   // number wrappers
12793   kUpb_WellKnown_DoubleValue,
12794   kUpb_WellKnown_FloatValue,
12795   kUpb_WellKnown_Int64Value,
12796   kUpb_WellKnown_UInt64Value,
12797   kUpb_WellKnown_Int32Value,
12798   kUpb_WellKnown_UInt32Value,
12799 
12800   // string wrappers
12801   kUpb_WellKnown_StringValue,
12802   kUpb_WellKnown_BytesValue,
12803   kUpb_WellKnown_BoolValue,
12804   kUpb_WellKnown_Value,
12805   kUpb_WellKnown_ListValue,
12806   kUpb_WellKnown_Struct,
12807 } upb_WellKnown;
12808 
12809 #ifdef __cplusplus
12810 extern "C" {
12811 #endif
12812 
12813 const upb_MessageDef* upb_MessageDef_ContainingType(const upb_MessageDef* m);
12814 
12815 const upb_ExtensionRange* upb_MessageDef_ExtensionRange(const upb_MessageDef* m,
12816                                                         int i);
12817 int upb_MessageDef_ExtensionRangeCount(const upb_MessageDef* m);
12818 
12819 UPB_API const upb_FieldDef* upb_MessageDef_Field(const upb_MessageDef* m,
12820                                                  int i);
12821 UPB_API int upb_MessageDef_FieldCount(const upb_MessageDef* m);
12822 
12823 UPB_API const upb_FileDef* upb_MessageDef_File(const upb_MessageDef* m);
12824 
12825 // Returns a field by either JSON name or regular proto name.
12826 const upb_FieldDef* upb_MessageDef_FindByJsonNameWithSize(
12827     const upb_MessageDef* m, const char* name, size_t size);
upb_MessageDef_FindByJsonName(const upb_MessageDef * m,const char * name)12828 UPB_INLINE const upb_FieldDef* upb_MessageDef_FindByJsonName(
12829     const upb_MessageDef* m, const char* name) {
12830   return upb_MessageDef_FindByJsonNameWithSize(m, name, strlen(name));
12831 }
12832 
12833 // Lookup of either field or oneof by name. Returns whether either was found.
12834 // If the return is true, then the found def will be set, and the non-found
12835 // one set to NULL.
12836 UPB_API bool upb_MessageDef_FindByNameWithSize(const upb_MessageDef* m,
12837                                                const char* name, size_t size,
12838                                                const upb_FieldDef** f,
12839                                                const upb_OneofDef** o);
upb_MessageDef_FindByName(const upb_MessageDef * m,const char * name,const upb_FieldDef ** f,const upb_OneofDef ** o)12840 UPB_INLINE bool upb_MessageDef_FindByName(const upb_MessageDef* m,
12841                                           const char* name,
12842                                           const upb_FieldDef** f,
12843                                           const upb_OneofDef** o) {
12844   return upb_MessageDef_FindByNameWithSize(m, name, strlen(name), f, o);
12845 }
12846 
12847 const upb_FieldDef* upb_MessageDef_FindFieldByName(const upb_MessageDef* m,
12848                                                    const char* name);
12849 UPB_API const upb_FieldDef* upb_MessageDef_FindFieldByNameWithSize(
12850     const upb_MessageDef* m, const char* name, size_t size);
12851 UPB_API const upb_FieldDef* upb_MessageDef_FindFieldByNumber(
12852     const upb_MessageDef* m, uint32_t i);
12853 const upb_OneofDef* upb_MessageDef_FindOneofByName(const upb_MessageDef* m,
12854                                                    const char* name);
12855 UPB_API const upb_OneofDef* upb_MessageDef_FindOneofByNameWithSize(
12856     const upb_MessageDef* m, const char* name, size_t size);
12857 UPB_API const char* upb_MessageDef_FullName(const upb_MessageDef* m);
12858 bool upb_MessageDef_HasOptions(const upb_MessageDef* m);
12859 bool upb_MessageDef_IsMapEntry(const upb_MessageDef* m);
12860 bool upb_MessageDef_IsMessageSet(const upb_MessageDef* m);
12861 
12862 // Creates a mini descriptor string for a message, returns true on success.
12863 bool upb_MessageDef_MiniDescriptorEncode(const upb_MessageDef* m, upb_Arena* a,
12864                                          upb_StringView* out);
12865 
12866 UPB_API const upb_MiniTable* upb_MessageDef_MiniTable(const upb_MessageDef* m);
12867 const char* upb_MessageDef_Name(const upb_MessageDef* m);
12868 
12869 const upb_EnumDef* upb_MessageDef_NestedEnum(const upb_MessageDef* m, int i);
12870 const upb_FieldDef* upb_MessageDef_NestedExtension(const upb_MessageDef* m,
12871                                                    int i);
12872 const upb_MessageDef* upb_MessageDef_NestedMessage(const upb_MessageDef* m,
12873                                                    int i);
12874 
12875 int upb_MessageDef_NestedEnumCount(const upb_MessageDef* m);
12876 int upb_MessageDef_NestedExtensionCount(const upb_MessageDef* m);
12877 int upb_MessageDef_NestedMessageCount(const upb_MessageDef* m);
12878 
12879 UPB_API const upb_OneofDef* upb_MessageDef_Oneof(const upb_MessageDef* m,
12880                                                  int i);
12881 UPB_API int upb_MessageDef_OneofCount(const upb_MessageDef* m);
12882 int upb_MessageDef_RealOneofCount(const upb_MessageDef* m);
12883 
12884 const UPB_DESC(MessageOptions) *
12885     upb_MessageDef_Options(const upb_MessageDef* m);
12886 const UPB_DESC(FeatureSet) *
12887     upb_MessageDef_ResolvedFeatures(const upb_MessageDef* m);
12888 
12889 upb_StringView upb_MessageDef_ReservedName(const upb_MessageDef* m, int i);
12890 int upb_MessageDef_ReservedNameCount(const upb_MessageDef* m);
12891 
12892 const upb_MessageReservedRange* upb_MessageDef_ReservedRange(
12893     const upb_MessageDef* m, int i);
12894 int upb_MessageDef_ReservedRangeCount(const upb_MessageDef* m);
12895 
12896 UPB_API upb_Syntax upb_MessageDef_Syntax(const upb_MessageDef* m);
12897 UPB_API upb_WellKnown upb_MessageDef_WellKnownType(const upb_MessageDef* m);
12898 
12899 #ifdef __cplusplus
12900 } /* extern "C" */
12901 #endif
12902 
12903 
12904 #endif /* UPB_REFLECTION_MESSAGE_DEF_H_ */
12905 
12906 // IWYU pragma: private, include "upb/reflection/def.h"
12907 
12908 #ifndef UPB_REFLECTION_METHOD_DEF_H_
12909 #define UPB_REFLECTION_METHOD_DEF_H_
12910 
12911 
12912 // Must be last.
12913 
12914 #ifdef __cplusplus
12915 extern "C" {
12916 #endif
12917 
12918 UPB_API bool upb_MethodDef_ClientStreaming(const upb_MethodDef* m);
12919 const char* upb_MethodDef_FullName(const upb_MethodDef* m);
12920 bool upb_MethodDef_HasOptions(const upb_MethodDef* m);
12921 int upb_MethodDef_Index(const upb_MethodDef* m);
12922 UPB_API const upb_MessageDef* upb_MethodDef_InputType(const upb_MethodDef* m);
12923 UPB_API const char* upb_MethodDef_Name(const upb_MethodDef* m);
12924 UPB_API const UPB_DESC(MethodOptions) *
12925     upb_MethodDef_Options(const upb_MethodDef* m);
12926 const UPB_DESC(FeatureSet) *
12927     upb_MethodDef_ResolvedFeatures(const upb_MethodDef* m);
12928 UPB_API const upb_MessageDef* upb_MethodDef_OutputType(const upb_MethodDef* m);
12929 UPB_API bool upb_MethodDef_ServerStreaming(const upb_MethodDef* m);
12930 UPB_API const upb_ServiceDef* upb_MethodDef_Service(const upb_MethodDef* m);
12931 
12932 #ifdef __cplusplus
12933 } /* extern "C" */
12934 #endif
12935 
12936 
12937 #endif /* UPB_REFLECTION_METHOD_DEF_H_ */
12938 
12939 // IWYU pragma: private, include "upb/reflection/def.h"
12940 
12941 #ifndef UPB_REFLECTION_ONEOF_DEF_H_
12942 #define UPB_REFLECTION_ONEOF_DEF_H_
12943 
12944 
12945 // Must be last.
12946 
12947 #ifdef __cplusplus
12948 extern "C" {
12949 #endif
12950 
12951 UPB_API const upb_MessageDef* upb_OneofDef_ContainingType(
12952     const upb_OneofDef* o);
12953 UPB_API const upb_FieldDef* upb_OneofDef_Field(const upb_OneofDef* o, int i);
12954 UPB_API int upb_OneofDef_FieldCount(const upb_OneofDef* o);
12955 const char* upb_OneofDef_FullName(const upb_OneofDef* o);
12956 bool upb_OneofDef_HasOptions(const upb_OneofDef* o);
12957 uint32_t upb_OneofDef_Index(const upb_OneofDef* o);
12958 bool upb_OneofDef_IsSynthetic(const upb_OneofDef* o);
12959 const upb_FieldDef* upb_OneofDef_LookupName(const upb_OneofDef* o,
12960                                             const char* name);
12961 const upb_FieldDef* upb_OneofDef_LookupNameWithSize(const upb_OneofDef* o,
12962                                                     const char* name,
12963                                                     size_t size);
12964 const upb_FieldDef* upb_OneofDef_LookupNumber(const upb_OneofDef* o,
12965                                               uint32_t num);
12966 UPB_API const char* upb_OneofDef_Name(const upb_OneofDef* o);
12967 int upb_OneofDef_numfields(const upb_OneofDef* o);
12968 const UPB_DESC(OneofOptions*) upb_OneofDef_Options(const upb_OneofDef* o);
12969 const UPB_DESC(FeatureSet*)
12970     upb_OneofDef_ResolvedFeatures(const upb_OneofDef* o);
12971 
12972 #ifdef __cplusplus
12973 } /* extern "C" */
12974 #endif
12975 
12976 
12977 #endif /* UPB_REFLECTION_ONEOF_DEF_H_ */
12978 
12979 // IWYU pragma: private, include "upb/reflection/def.h"
12980 
12981 #ifndef UPB_REFLECTION_SERVICE_DEF_H_
12982 #define UPB_REFLECTION_SERVICE_DEF_H_
12983 
12984 
12985 // Must be last.
12986 
12987 #ifdef __cplusplus
12988 extern "C" {
12989 #endif
12990 
12991 UPB_API const upb_FileDef* upb_ServiceDef_File(const upb_ServiceDef* s);
12992 const upb_MethodDef* upb_ServiceDef_FindMethodByName(const upb_ServiceDef* s,
12993                                                      const char* name);
12994 UPB_API const char* upb_ServiceDef_FullName(const upb_ServiceDef* s);
12995 bool upb_ServiceDef_HasOptions(const upb_ServiceDef* s);
12996 int upb_ServiceDef_Index(const upb_ServiceDef* s);
12997 UPB_API const upb_MethodDef* upb_ServiceDef_Method(const upb_ServiceDef* s,
12998                                                    int i);
12999 UPB_API int upb_ServiceDef_MethodCount(const upb_ServiceDef* s);
13000 const char* upb_ServiceDef_Name(const upb_ServiceDef* s);
13001 UPB_API const UPB_DESC(ServiceOptions) *
13002     upb_ServiceDef_Options(const upb_ServiceDef* s);
13003 const UPB_DESC(FeatureSet) *
13004     upb_ServiceDef_ResolvedFeatures(const upb_ServiceDef* s);
13005 
13006 #ifdef __cplusplus
13007 } /* extern "C" */
13008 #endif
13009 
13010 
13011 #endif /* UPB_REFLECTION_SERVICE_DEF_H_ */
13012 // IWYU pragma: end_exports
13013 
13014 #endif /* UPB_REFLECTION_DEF_H_ */
13015 
13016 // Must be last.
13017 
13018 #ifdef __cplusplus
13019 extern "C" {
13020 #endif
13021 
13022 enum { upb_JsonDecode_IgnoreUnknown = 1 };
13023 
13024 enum {
13025   kUpb_JsonDecodeResult_Ok = 0,
13026   kUpb_JsonDecodeResult_OkWithEmptyStringNumerics = 1,
13027   kUpb_JsonDecodeResult_Error = 2,
13028 };
13029 
13030 UPB_API int upb_JsonDecodeDetectingNonconformance(const char* buf, size_t size,
13031                                                   upb_Message* msg,
13032                                                   const upb_MessageDef* m,
13033                                                   const upb_DefPool* symtab,
13034                                                   int options, upb_Arena* arena,
13035                                                   upb_Status* status);
13036 
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)13037 UPB_API_INLINE bool upb_JsonDecode(const char* buf, size_t size,
13038                                    upb_Message* msg, const upb_MessageDef* m,
13039                                    const upb_DefPool* symtab, int options,
13040                                    upb_Arena* arena, upb_Status* status) {
13041   return upb_JsonDecodeDetectingNonconformance(buf, size, msg, m, symtab,
13042                                                options, arena, status) ==
13043          kUpb_JsonDecodeResult_Ok;
13044 }
13045 
13046 #ifdef __cplusplus
13047 } /* extern "C" */
13048 #endif
13049 
13050 
13051 #endif /* UPB_JSONDECODE_H_ */
13052 
13053 #ifndef UPB_LEX_ATOI_H_
13054 #define UPB_LEX_ATOI_H_
13055 
13056 #include <stdint.h>
13057 
13058 // Must be last.
13059 
13060 #ifdef __cplusplus
13061 extern "C" {
13062 #endif
13063 
13064 // We use these hand-written routines instead of strto[u]l() because the "long
13065 // long" variants aren't in c89. Also our version allows setting a ptr limit.
13066 // Return the new position of the pointer after parsing the int, or NULL on
13067 // integer overflow.
13068 
13069 const char* upb_BufToUint64(const char* ptr, const char* end, uint64_t* val);
13070 const char* upb_BufToInt64(const char* ptr, const char* end, int64_t* val,
13071                            bool* is_neg);
13072 
13073 #ifdef __cplusplus
13074 } /* extern "C" */
13075 #endif
13076 
13077 
13078 #endif /* UPB_LEX_ATOI_H_ */
13079 
13080 #ifndef UPB_LEX_UNICODE_H_
13081 #define UPB_LEX_UNICODE_H_
13082 
13083 #include <stdint.h>
13084 
13085 // Must be last.
13086 
13087 #ifdef __cplusplus
13088 extern "C" {
13089 #endif
13090 
13091 // Returns true iff a codepoint is the value for a high surrogate.
upb_Unicode_IsHigh(uint32_t cp)13092 UPB_INLINE bool upb_Unicode_IsHigh(uint32_t cp) {
13093   return (cp >= 0xd800 && cp <= 0xdbff);
13094 }
13095 
13096 // Returns true iff a codepoint is the value for a low surrogate.
upb_Unicode_IsLow(uint32_t cp)13097 UPB_INLINE bool upb_Unicode_IsLow(uint32_t cp) {
13098   return (cp >= 0xdc00 && cp <= 0xdfff);
13099 }
13100 
13101 // Returns the high 16-bit surrogate value for a supplementary codepoint.
13102 // Does not sanity-check the input.
upb_Unicode_ToHigh(uint32_t cp)13103 UPB_INLINE uint16_t upb_Unicode_ToHigh(uint32_t cp) {
13104   return (cp >> 10) + 0xd7c0;
13105 }
13106 
13107 // Returns the low 16-bit surrogate value for a supplementary codepoint.
13108 // Does not sanity-check the input.
upb_Unicode_ToLow(uint32_t cp)13109 UPB_INLINE uint16_t upb_Unicode_ToLow(uint32_t cp) {
13110   return (cp & 0x3ff) | 0xdc00;
13111 }
13112 
13113 // Returns the 32-bit value corresponding to a pair of 16-bit surrogates.
13114 // Does not sanity-check the input.
upb_Unicode_FromPair(uint32_t high,uint32_t low)13115 UPB_INLINE uint32_t upb_Unicode_FromPair(uint32_t high, uint32_t low) {
13116   return ((high & 0x3ff) << 10) + (low & 0x3ff) + 0x10000;
13117 }
13118 
13119 // Outputs a codepoint as UTF8.
13120 // Returns the number of bytes written (1-4 on success, 0 on error).
13121 // Does not sanity-check the input. Specifically does not check for surrogates.
13122 int upb_Unicode_ToUTF8(uint32_t cp, char* out);
13123 
13124 #ifdef __cplusplus
13125 } /* extern "C" */
13126 #endif
13127 
13128 
13129 #endif /* UPB_LEX_UNICODE_H_ */
13130 
13131 #ifndef UPB_REFLECTION_MESSAGE_H_
13132 #define UPB_REFLECTION_MESSAGE_H_
13133 
13134 #include <stddef.h>
13135 
13136 
13137 // Must be last.
13138 
13139 #ifdef __cplusplus
13140 extern "C" {
13141 #endif
13142 
13143 // Returns a mutable pointer to a map, array, or submessage value. If the given
13144 // arena is non-NULL this will construct a new object if it was not previously
13145 // present. May not be called for primitive fields.
13146 UPB_API upb_MutableMessageValue upb_Message_Mutable(upb_Message* msg,
13147                                                     const upb_FieldDef* f,
13148                                                     upb_Arena* a);
13149 
13150 // Returns the field that is set in the oneof, or NULL if none are set.
13151 UPB_API const upb_FieldDef* upb_Message_WhichOneofByDef(const upb_Message* msg,
13152                                                         const upb_OneofDef* o);
13153 
13154 // Clear all data and unknown fields.
13155 void upb_Message_ClearByDef(upb_Message* msg, const upb_MessageDef* m);
13156 
13157 // Clears any field presence and sets the value back to its default.
13158 UPB_API void upb_Message_ClearFieldByDef(upb_Message* msg,
13159                                          const upb_FieldDef* f);
13160 
13161 // May only be called for fields where upb_FieldDef_HasPresence(f) == true.
13162 UPB_API bool upb_Message_HasFieldByDef(const upb_Message* msg,
13163                                        const upb_FieldDef* f);
13164 
13165 // Returns the value in the message associated with this field def.
13166 UPB_API upb_MessageValue upb_Message_GetFieldByDef(const upb_Message* msg,
13167                                                    const upb_FieldDef* f);
13168 
13169 // Sets the given field to the given value. For a msg/array/map/string, the
13170 // caller must ensure that the target data outlives |msg| (by living either in
13171 // the same arena or a different arena that outlives it).
13172 //
13173 // Returns false if allocation fails.
13174 UPB_API bool upb_Message_SetFieldByDef(upb_Message* msg, const upb_FieldDef* f,
13175                                        upb_MessageValue val, upb_Arena* a);
13176 
13177 // Iterate over present fields.
13178 //
13179 // size_t iter = kUpb_Message_Begin;
13180 // const upb_FieldDef *f;
13181 // upb_MessageValue val;
13182 // while (upb_Message_Next(msg, m, ext_pool, &f, &val, &iter)) {
13183 //   process_field(f, val);
13184 // }
13185 //
13186 // If ext_pool is NULL, no extensions will be returned.  If the given symtab
13187 // returns extensions that don't match what is in this message, those extensions
13188 // will be skipped.
13189 
13190 #define kUpb_Message_Begin -1
13191 
13192 UPB_API bool upb_Message_Next(const upb_Message* msg, const upb_MessageDef* m,
13193                               const upb_DefPool* ext_pool,
13194                               const upb_FieldDef** f, upb_MessageValue* val,
13195                               size_t* iter);
13196 
13197 // Clears all unknown field data from this message and all submessages.
13198 UPB_API bool upb_Message_DiscardUnknown(upb_Message* msg,
13199                                         const upb_MessageDef* m, int maxdepth);
13200 
13201 #ifdef __cplusplus
13202 } /* extern "C" */
13203 #endif
13204 
13205 
13206 #endif /* UPB_REFLECTION_MESSAGE_H_ */
13207 
13208 #ifndef UPB_JSON_ENCODE_H_
13209 #define UPB_JSON_ENCODE_H_
13210 
13211 
13212 // Must be last.
13213 
13214 #ifdef __cplusplus
13215 extern "C" {
13216 #endif
13217 
13218 enum {
13219   /* When set, emits 0/default values.  TODO: proto3 only? */
13220   upb_JsonEncode_EmitDefaults = 1 << 0,
13221 
13222   /* When set, use normal (snake_case) field names instead of JSON (camelCase)
13223      names. */
13224   upb_JsonEncode_UseProtoNames = 1 << 1,
13225 
13226   /* When set, emits enums as their integer values instead of as their names. */
13227   upb_JsonEncode_FormatEnumsAsIntegers = 1 << 2
13228 };
13229 
13230 /* Encodes the given |msg| to JSON format.  The message's reflection is given in
13231  * |m|.  The DefPool in |ext_pool| is used to find extensions (if NULL,
13232  * extensions will not be printed).
13233  *
13234  * Output is placed in the given buffer, and always NULL-terminated.  The output
13235  * size (excluding NULL) is returned.  This means that a return value >= |size|
13236  * implies that the output was truncated.  (These are the same semantics as
13237  * snprintf()). */
13238 UPB_API size_t upb_JsonEncode(const upb_Message* msg, const upb_MessageDef* m,
13239                               const upb_DefPool* ext_pool, int options,
13240                               char* buf, size_t size, upb_Status* status);
13241 
13242 #ifdef __cplusplus
13243 } /* extern "C" */
13244 #endif
13245 
13246 
13247 #endif /* UPB_JSONENCODE_H_ */
13248 
13249 #ifndef UPB_LEX_ROUND_TRIP_H_
13250 #define UPB_LEX_ROUND_TRIP_H_
13251 
13252 // Must be last.
13253 
13254 // Encodes a float or double that is round-trippable, but as short as possible.
13255 // These routines are not fully optimal (not guaranteed to be shortest), but are
13256 // short-ish and match the implementation that has been used in protobuf since
13257 // the beginning.
13258 
13259 // The given buffer size must be at least kUpb_RoundTripBufferSize.
13260 enum { kUpb_RoundTripBufferSize = 32 };
13261 
13262 #ifdef __cplusplus
13263 extern "C" {
13264 #endif
13265 
13266 void _upb_EncodeRoundTripDouble(double val, char* buf, size_t size);
13267 void _upb_EncodeRoundTripFloat(float val, char* buf, size_t size);
13268 
13269 #ifdef __cplusplus
13270 } /* extern "C" */
13271 #endif
13272 
13273 
13274 #endif /* UPB_LEX_ROUND_TRIP_H_ */
13275 
13276 #ifndef UPB_PORT_VSNPRINTF_COMPAT_H_
13277 #define UPB_PORT_VSNPRINTF_COMPAT_H_
13278 
13279 // Must be last.
13280 
_upb_vsnprintf(char * buf,size_t size,const char * fmt,va_list ap)13281 UPB_INLINE int _upb_vsnprintf(char* buf, size_t size, const char* fmt,
13282                               va_list ap) {
13283 #if defined(__MINGW64__) || defined(__MINGW32__) || defined(_MSC_VER)
13284   // The msvc runtime has a non-conforming vsnprintf() that requires the
13285   // following compatibility code to become conformant.
13286   int n = -1;
13287   if (size != 0) n = _vsnprintf_s(buf, size, _TRUNCATE, fmt, ap);
13288   if (n == -1) n = _vscprintf(fmt, ap);
13289   return n;
13290 #else
13291   return vsnprintf(buf, size, fmt, ap);
13292 #endif
13293 }
13294 
13295 
13296 #endif  // UPB_PORT_VSNPRINTF_COMPAT_H_
13297 
13298 #ifndef UPB_PORT_ATOMIC_H_
13299 #define UPB_PORT_ATOMIC_H_
13300 
13301 
13302 #ifdef UPB_USE_C11_ATOMICS
13303 
13304 // IWYU pragma: begin_exports
13305 #include <stdatomic.h>
13306 #include <stdbool.h>
13307 // IWYU pragma: end_exports
13308 
13309 #define upb_Atomic_Init(addr, val) atomic_init(addr, val)
13310 #define upb_Atomic_Load(addr, order) atomic_load_explicit(addr, order)
13311 #define upb_Atomic_Store(addr, val, order) \
13312   atomic_store_explicit(addr, val, order)
13313 #define upb_Atomic_Add(addr, val, order) \
13314   atomic_fetch_add_explicit(addr, val, order)
13315 #define upb_Atomic_Sub(addr, val, order) \
13316   atomic_fetch_sub_explicit(addr, val, order)
13317 #define upb_Atomic_Exchange(addr, val, order) \
13318   atomic_exchange_explicit(addr, val, order)
13319 #define upb_Atomic_CompareExchangeStrong(addr, expected, desired,      \
13320                                          success_order, failure_order) \
13321   atomic_compare_exchange_strong_explicit(addr, expected, desired,     \
13322                                           success_order, failure_order)
13323 #define upb_Atomic_CompareExchangeWeak(addr, expected, desired, success_order, \
13324                                        failure_order)                          \
13325   atomic_compare_exchange_weak_explicit(addr, expected, desired,               \
13326                                         success_order, failure_order)
13327 
13328 #else  // !UPB_USE_C11_ATOMICS
13329 
13330 #include <string.h>
13331 
13332 #define upb_Atomic_Init(addr, val) (*addr = val)
13333 #define upb_Atomic_Load(addr, order) (*addr)
13334 #define upb_Atomic_Store(addr, val, order) (*(addr) = val)
13335 #define upb_Atomic_Add(addr, val, order) (*(addr) += val)
13336 #define upb_Atomic_Sub(addr, val, order) (*(addr) -= val)
13337 
_upb_NonAtomic_Exchange(void * addr,void * value)13338 UPB_INLINE void* _upb_NonAtomic_Exchange(void* addr, void* value) {
13339   void* old;
13340   memcpy(&old, addr, sizeof(value));
13341   memcpy(addr, &value, sizeof(value));
13342   return old;
13343 }
13344 
13345 #define upb_Atomic_Exchange(addr, val, order) _upb_NonAtomic_Exchange(addr, val)
13346 
13347 // `addr` and `expected` are logically double pointers.
_upb_NonAtomic_CompareExchangeStrongP(void * addr,void * expected,void * desired)13348 UPB_INLINE bool _upb_NonAtomic_CompareExchangeStrongP(void* addr,
13349                                                       void* expected,
13350                                                       void* desired) {
13351   if (memcmp(addr, expected, sizeof(desired)) == 0) {
13352     memcpy(addr, &desired, sizeof(desired));
13353     return true;
13354   } else {
13355     memcpy(expected, addr, sizeof(desired));
13356     return false;
13357   }
13358 }
13359 
13360 #define upb_Atomic_CompareExchangeStrong(addr, expected, desired,      \
13361                                          success_order, failure_order) \
13362   _upb_NonAtomic_CompareExchangeStrongP((void*)addr, (void*)expected,  \
13363                                         (void*)desired)
13364 #define upb_Atomic_CompareExchangeWeak(addr, expected, desired, success_order, \
13365                                        failure_order)                          \
13366   upb_Atomic_CompareExchangeStrong(addr, expected, desired, 0, 0)
13367 
13368 #endif
13369 
13370 
13371 #endif  // UPB_PORT_ATOMIC_H_
13372 
13373 #ifndef UPB_MESSAGE_COMPAT_H_
13374 #define UPB_MESSAGE_COMPAT_H_
13375 
13376 #include <stdint.h>
13377 
13378 
13379 // Must be last.
13380 
13381 // upb does not support mixing minitables from different sources but these
13382 // functions are still used by some existing users so for now we make them
13383 // available here. This may or may not change in the future so do not add
13384 // them to new code.
13385 
13386 #ifdef __cplusplus
13387 extern "C" {
13388 #endif
13389 
13390 const upb_MiniTableExtension* upb_Message_ExtensionByIndex(
13391     const upb_Message* msg, size_t index);
13392 
13393 // Returns the minitable with the given field number, or NULL on failure.
13394 const upb_MiniTableExtension* upb_Message_FindExtensionByNumber(
13395     const upb_Message* msg, uint32_t field_number);
13396 
13397 #ifdef __cplusplus
13398 } /* extern "C" */
13399 #endif
13400 
13401 
13402 #endif /* UPB_MESSAGE_COMPAT_H_ */
13403 
13404 // EVERYTHING BELOW THIS LINE IS INTERNAL - DO NOT USE /////////////////////////
13405 
13406 #ifndef UPB_MESSAGE_INTERNAL_MAP_SORTER_H_
13407 #define UPB_MESSAGE_INTERNAL_MAP_SORTER_H_
13408 
13409 #include <stdlib.h>
13410 
13411 
13412 #ifndef UPB_MESSAGE_INTERNAL_MAP_ENTRY_H_
13413 #define UPB_MESSAGE_INTERNAL_MAP_ENTRY_H_
13414 
13415 #include <stdint.h>
13416 
13417 
13418 // Map entries aren't actually stored for map fields, they are only used during
13419 // parsing. (It helps a lot if all map entry messages have the same layout.)
13420 // The mini_table layout code will ensure that all map entries have this layout.
13421 //
13422 // Note that users can and do create map entries directly, which will also use
13423 // this layout.
13424 
13425 typedef struct {
13426   struct upb_Message message;
13427   // We only need 2 hasbits max, but due to alignment we'll use 8 bytes here,
13428   // and the uint64_t helps make this clear.
13429   uint64_t hasbits;
13430   union {
13431     upb_StringView str;  // For str/bytes.
13432     upb_value val;       // For all other types.
13433     double d[2];         // Padding for 32-bit builds.
13434   } k;
13435   union {
13436     upb_StringView str;  // For str/bytes.
13437     upb_value val;       // For all other types.
13438     double d[2];         // Padding for 32-bit builds.
13439   } v;
13440 } upb_MapEntry;
13441 
13442 #endif  // UPB_MESSAGE_INTERNAL_MAP_ENTRY_H_
13443 
13444 // Must be last.
13445 
13446 #ifdef __cplusplus
13447 extern "C" {
13448 #endif
13449 
13450 // _upb_mapsorter sorts maps and provides ordered iteration over the entries.
13451 // Since maps can be recursive (map values can be messages which contain other
13452 // maps), _upb_mapsorter can contain a stack of maps.
13453 
13454 typedef struct {
13455   void const** entries;
13456   int size;
13457   int cap;
13458 } _upb_mapsorter;
13459 
13460 typedef struct {
13461   int start;
13462   int pos;
13463   int end;
13464 } _upb_sortedmap;
13465 
_upb_mapsorter_init(_upb_mapsorter * s)13466 UPB_INLINE void _upb_mapsorter_init(_upb_mapsorter* s) {
13467   s->entries = NULL;
13468   s->size = 0;
13469   s->cap = 0;
13470 }
13471 
_upb_mapsorter_destroy(_upb_mapsorter * s)13472 UPB_INLINE void _upb_mapsorter_destroy(_upb_mapsorter* s) {
13473   if (s->entries) upb_gfree(s->entries);
13474 }
13475 
_upb_sortedmap_next(_upb_mapsorter * s,const struct upb_Map * map,_upb_sortedmap * sorted,upb_MapEntry * ent)13476 UPB_INLINE bool _upb_sortedmap_next(_upb_mapsorter* s,
13477                                     const struct upb_Map* map,
13478                                     _upb_sortedmap* sorted, upb_MapEntry* ent) {
13479   if (sorted->pos == sorted->end) return false;
13480   const upb_tabent* tabent = (const upb_tabent*)s->entries[sorted->pos++];
13481   upb_StringView key = upb_tabstrview(tabent->key);
13482   _upb_map_fromkey(key, &ent->k, map->key_size);
13483   upb_value val = {tabent->val.val};
13484   _upb_map_fromvalue(val, &ent->v, map->val_size);
13485   return true;
13486 }
13487 
_upb_sortedmap_nextext(_upb_mapsorter * s,_upb_sortedmap * sorted,const upb_Extension ** ext)13488 UPB_INLINE bool _upb_sortedmap_nextext(_upb_mapsorter* s,
13489                                        _upb_sortedmap* sorted,
13490                                        const upb_Extension** ext) {
13491   if (sorted->pos == sorted->end) return false;
13492   *ext = (const upb_Extension*)s->entries[sorted->pos++];
13493   return true;
13494 }
13495 
_upb_mapsorter_popmap(_upb_mapsorter * s,_upb_sortedmap * sorted)13496 UPB_INLINE void _upb_mapsorter_popmap(_upb_mapsorter* s,
13497                                       _upb_sortedmap* sorted) {
13498   s->size = sorted->start;
13499 }
13500 
13501 bool _upb_mapsorter_pushmap(_upb_mapsorter* s, upb_FieldType key_type,
13502                             const struct upb_Map* map, _upb_sortedmap* sorted);
13503 
13504 bool _upb_mapsorter_pushexts(_upb_mapsorter* s, const upb_Extension* exts,
13505                              size_t count, _upb_sortedmap* sorted);
13506 
13507 #ifdef __cplusplus
13508 } /* extern "C" */
13509 #endif
13510 
13511 
13512 #endif /* UPB_MESSAGE_INTERNAL_MAP_SORTER_H_ */
13513 
13514 #ifndef UPB_BASE_INTERNAL_LOG2_H_
13515 #define UPB_BASE_INTERNAL_LOG2_H_
13516 
13517 // Must be last.
13518 
13519 #ifdef __cplusplus
13520 extern "C" {
13521 #endif
13522 
upb_Log2Ceiling(int x)13523 UPB_INLINE int upb_Log2Ceiling(int x) {
13524   if (x <= 1) return 0;
13525 #ifdef __GNUC__
13526   return 32 - __builtin_clz(x - 1);
13527 #else
13528   int lg2 = 0;
13529   while ((1 << lg2) < x) lg2++;
13530   return lg2;
13531 #endif
13532 }
13533 
upb_Log2CeilingSize(int x)13534 UPB_INLINE int upb_Log2CeilingSize(int x) { return 1 << upb_Log2Ceiling(x); }
13535 
13536 #ifdef __cplusplus
13537 } /* extern "C" */
13538 #endif
13539 
13540 
13541 #endif /* UPB_BASE_INTERNAL_LOG2_H_ */
13542 
13543 #ifndef UPB_MESSAGE_COMPARE_H_
13544 #define UPB_MESSAGE_COMPARE_H_
13545 
13546 #include <stddef.h>
13547 
13548 
13549 // Must be last.
13550 
13551 enum {
13552   // If set, upb_Message_IsEqual() will attempt to compare unknown fields.
13553   // By its very nature this comparison is inexact.
13554   kUpb_CompareOption_IncludeUnknownFields = (1 << 0)
13555 };
13556 
13557 #ifdef __cplusplus
13558 extern "C" {
13559 #endif
13560 
13561 // Returns true if no known fields or extensions are set in the message.
13562 UPB_API bool upb_Message_IsEmpty(const upb_Message* msg,
13563                                  const upb_MiniTable* m);
13564 
13565 UPB_API bool upb_Message_IsEqual(const upb_Message* msg1,
13566                                  const upb_Message* msg2,
13567                                  const upb_MiniTable* m, int options);
13568 
13569 // 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)13570 UPB_API_INLINE bool upb_MessageValue_IsEqual(upb_MessageValue val1,
13571                                              upb_MessageValue val2,
13572                                              upb_CType ctype,
13573                                              const upb_MiniTable* m,
13574                                              int options) {
13575   switch (ctype) {
13576     case kUpb_CType_Bool:
13577       return val1.bool_val == val2.bool_val;
13578 
13579     case kUpb_CType_Float:
13580     case kUpb_CType_Int32:
13581     case kUpb_CType_UInt32:
13582     case kUpb_CType_Enum:
13583       return val1.int32_val == val2.int32_val;
13584 
13585     case kUpb_CType_Double:
13586     case kUpb_CType_Int64:
13587     case kUpb_CType_UInt64:
13588       return val1.int64_val == val2.int64_val;
13589 
13590     case kUpb_CType_String:
13591     case kUpb_CType_Bytes:
13592       return upb_StringView_IsEqual(val1.str_val, val2.str_val);
13593 
13594     case kUpb_CType_Message:
13595       return upb_Message_IsEqual(val1.msg_val, val2.msg_val, m, options);
13596 
13597     default:
13598       UPB_UNREACHABLE();
13599       return false;
13600   }
13601 }
13602 
13603 #ifdef __cplusplus
13604 } /* extern "C" */
13605 #endif
13606 
13607 
13608 #endif  // UPB_MESSAGE_COMPARE_H_
13609 
13610 #ifndef UPB_MESSAGE_INTERNAL_COMPARE_UNKNOWN_H_
13611 #define UPB_MESSAGE_INTERNAL_COMPARE_UNKNOWN_H_
13612 
13613 #include <stddef.h>
13614 
13615 // Must be last.
13616 
13617 #ifdef __cplusplus
13618 extern "C" {
13619 #endif
13620 
13621 // Returns true if unknown fields from the two messages are equal when sorted
13622 // and varints are made canonical.
13623 //
13624 // This function is discouraged, as the comparison is inherently lossy without
13625 // schema data:
13626 //
13627 //  1. We don't know whether delimited fields are sub-messages. Unknown
13628 //     sub-messages will therefore not have their fields sorted and varints
13629 //     canonicalized.
13630 //  2. We don't know about oneof/non-repeated fields, which should semantically
13631 //     discard every value except the last.
13632 
13633 typedef enum {
13634   kUpb_UnknownCompareResult_Equal = 0,
13635   kUpb_UnknownCompareResult_NotEqual = 1,
13636   kUpb_UnknownCompareResult_OutOfMemory = 2,
13637   kUpb_UnknownCompareResult_MaxDepthExceeded = 3,
13638 } upb_UnknownCompareResult;
13639 
13640 upb_UnknownCompareResult UPB_PRIVATE(_upb_Message_UnknownFieldsAreEqual)(
13641     const char* buf1, size_t size1, const char* buf2, size_t size2,
13642     int max_depth);
13643 
13644 #ifdef __cplusplus
13645 } /* extern "C" */
13646 #endif
13647 
13648 
13649 #endif /* UPB_MESSAGE_INTERNAL_COMPARE_UNKNOWN_H_ */
13650 
13651 #ifndef THIRD_PARTY_UPB_UPB_MESSAGE_INTERNAL_ITERATOR_H_
13652 #define THIRD_PARTY_UPB_UPB_MESSAGE_INTERNAL_ITERATOR_H_
13653 
13654 #include <stddef.h>
13655 
13656 
13657 // Must be last.
13658 
13659 #define kUpb_BaseField_Begin ((size_t)-1)
13660 #define kUpb_Extension_Begin ((size_t)-1)
13661 
13662 bool UPB_PRIVATE(_upb_Message_NextBaseField)(const upb_Message* msg,
13663                                              const upb_MiniTable* m,
13664                                              const upb_MiniTableField** out_f,
13665                                              upb_MessageValue* out_v,
13666                                              size_t* iter);
13667 
13668 bool UPB_PRIVATE(_upb_Message_NextExtension)(
13669     const upb_Message* msg, const upb_MiniTable* m,
13670     const upb_MiniTableExtension** out_e, upb_MessageValue* out_v,
13671     size_t* iter);
13672 #endif  // THIRD_PARTY_UPB_UPB_MESSAGE_INTERNAL_ITERATOR_H_
13673 
13674 #ifndef UPB_MESSAGE_COPY_H_
13675 #define UPB_MESSAGE_COPY_H_
13676 
13677 
13678 // Must be last.
13679 
13680 #ifdef __cplusplus
13681 extern "C" {
13682 #endif
13683 
13684 // Deep clones a message using the provided target arena.
13685 upb_Message* upb_Message_DeepClone(const upb_Message* msg,
13686                                    const upb_MiniTable* m, upb_Arena* arena);
13687 
13688 // Shallow clones a message using the provided target arena.
13689 upb_Message* upb_Message_ShallowClone(const upb_Message* msg,
13690                                       const upb_MiniTable* m, upb_Arena* arena);
13691 
13692 // Deep clones array contents.
13693 upb_Array* upb_Array_DeepClone(const upb_Array* array, upb_CType value_type,
13694                                const upb_MiniTable* sub, upb_Arena* arena);
13695 
13696 // Deep clones map contents.
13697 upb_Map* upb_Map_DeepClone(const upb_Map* map, upb_CType key_type,
13698                            upb_CType value_type,
13699                            const upb_MiniTable* map_entry_table,
13700                            upb_Arena* arena);
13701 
13702 // Deep copies the message from src to dst.
13703 bool upb_Message_DeepCopy(upb_Message* dst, const upb_Message* src,
13704                           const upb_MiniTable* m, upb_Arena* arena);
13705 
13706 // Shallow copies the message from src to dst.
13707 void upb_Message_ShallowCopy(upb_Message* dst, const upb_Message* src,
13708                              const upb_MiniTable* m);
13709 
13710 #ifdef __cplusplus
13711 } /* extern "C" */
13712 #endif
13713 
13714 
13715 #endif  // UPB_MESSAGE_COPY_H_
13716 #ifndef THIRD_PARTY_UPB_UPB_MESSAGE_MERGE_H_
13717 #define THIRD_PARTY_UPB_UPB_MESSAGE_MERGE_H_
13718 
13719 
13720 // Must be last.
13721 
13722 #ifdef __cplusplus
13723 extern "C" {
13724 #endif
13725 
13726 UPB_API bool upb_Message_MergeFrom(upb_Message* dst, const upb_Message* src,
13727                                    const upb_MiniTable* mt,
13728                                    const upb_ExtensionRegistry* extreg,
13729                                    upb_Arena* arena);
13730 
13731 #ifdef __cplusplus
13732 } /* extern "C" */
13733 #endif
13734 
13735 #endif  // THIRD_PARTY_UPB_UPB_MESSAGE_MERGE_H_
13736 
13737 #ifndef UPB_MINI_DESCRIPTOR_INTERNAL_BASE92_H_
13738 #define UPB_MINI_DESCRIPTOR_INTERNAL_BASE92_H_
13739 
13740 #include <stdint.h>
13741 
13742 
13743 // Must be last.
13744 
13745 #ifdef __cplusplus
13746 extern "C" {
13747 #endif
13748 
_upb_ToBase92(int8_t ch)13749 UPB_INLINE char _upb_ToBase92(int8_t ch) {
13750   extern const char _kUpb_ToBase92[];
13751   UPB_ASSERT(0 <= ch && ch < 92);
13752   return _kUpb_ToBase92[ch];
13753 }
13754 
_upb_FromBase92(uint8_t ch)13755 UPB_INLINE char _upb_FromBase92(uint8_t ch) {
13756   extern const int8_t _kUpb_FromBase92[];
13757   if (' ' > ch || ch > '~') return -1;
13758   return _kUpb_FromBase92[ch - ' '];
13759 }
13760 
_upb_Base92_DecodeVarint(const char * ptr,const char * end,char first_ch,uint8_t min,uint8_t max,uint32_t * out_val)13761 UPB_INLINE const char* _upb_Base92_DecodeVarint(const char* ptr,
13762                                                 const char* end, char first_ch,
13763                                                 uint8_t min, uint8_t max,
13764                                                 uint32_t* out_val) {
13765   uint32_t val = 0;
13766   uint32_t shift = 0;
13767   const int bits_per_char =
13768       upb_Log2Ceiling(_upb_FromBase92(max) - _upb_FromBase92(min));
13769   char ch = first_ch;
13770   while (1) {
13771     uint32_t bits = _upb_FromBase92(ch) - _upb_FromBase92(min);
13772     val |= bits << shift;
13773     if (ptr == end || *ptr < min || max < *ptr) {
13774       *out_val = val;
13775       UPB_ASSUME(ptr != NULL);
13776       return ptr;
13777     }
13778     ch = *ptr++;
13779     shift += bits_per_char;
13780     if (shift >= 32) return NULL;
13781   }
13782 }
13783 
13784 #ifdef __cplusplus
13785 } /* extern "C" */
13786 #endif
13787 
13788 
13789 #endif  // UPB_MINI_DESCRIPTOR_INTERNAL_BASE92_H_
13790 
13791 #ifndef UPB_MINI_DESCRIPTOR_INTERNAL_DECODER_H_
13792 #define UPB_MINI_DESCRIPTOR_INTERNAL_DECODER_H_
13793 
13794 
13795 // Must be last.
13796 
13797 // upb_MdDecoder: used internally for decoding MiniDescriptors for messages,
13798 // extensions, and enums.
13799 typedef struct {
13800   const char* end;
13801   upb_Status* status;
13802   jmp_buf err;
13803 } upb_MdDecoder;
13804 
13805 UPB_PRINTF(2, 3)
upb_MdDecoder_ErrorJmp(upb_MdDecoder * d,const char * fmt,...)13806 UPB_NORETURN UPB_INLINE void upb_MdDecoder_ErrorJmp(upb_MdDecoder* d,
13807                                                     const char* fmt, ...) {
13808   if (d->status) {
13809     va_list argp;
13810     upb_Status_SetErrorMessage(d->status, "Error building mini table: ");
13811     va_start(argp, fmt);
13812     upb_Status_VAppendErrorFormat(d->status, fmt, argp);
13813     va_end(argp);
13814   }
13815   UPB_LONGJMP(d->err, 1);
13816 }
13817 
upb_MdDecoder_CheckOutOfMemory(upb_MdDecoder * d,const void * ptr)13818 UPB_INLINE void upb_MdDecoder_CheckOutOfMemory(upb_MdDecoder* d,
13819                                                const void* ptr) {
13820   if (!ptr) upb_MdDecoder_ErrorJmp(d, "Out of memory");
13821 }
13822 
upb_MdDecoder_DecodeBase92Varint(upb_MdDecoder * d,const char * ptr,char first_ch,uint8_t min,uint8_t max,uint32_t * out_val)13823 UPB_INLINE const char* upb_MdDecoder_DecodeBase92Varint(
13824     upb_MdDecoder* d, const char* ptr, char first_ch, uint8_t min, uint8_t max,
13825     uint32_t* out_val) {
13826   ptr = _upb_Base92_DecodeVarint(ptr, d->end, first_ch, min, max, out_val);
13827   if (!ptr) upb_MdDecoder_ErrorJmp(d, "Overlong varint");
13828   return ptr;
13829 }
13830 
13831 
13832 #endif  // UPB_MINI_DESCRIPTOR_INTERNAL_DECODER_H_
13833 
13834 #ifndef UPB_MINI_DESCRIPTOR_INTERNAL_WIRE_CONSTANTS_H_
13835 #define UPB_MINI_DESCRIPTOR_INTERNAL_WIRE_CONSTANTS_H_
13836 
13837 
13838 // Must be last.
13839 
13840 typedef enum {
13841   kUpb_EncodedType_Double = 0,
13842   kUpb_EncodedType_Float = 1,
13843   kUpb_EncodedType_Fixed32 = 2,
13844   kUpb_EncodedType_Fixed64 = 3,
13845   kUpb_EncodedType_SFixed32 = 4,
13846   kUpb_EncodedType_SFixed64 = 5,
13847   kUpb_EncodedType_Int32 = 6,
13848   kUpb_EncodedType_UInt32 = 7,
13849   kUpb_EncodedType_SInt32 = 8,
13850   kUpb_EncodedType_Int64 = 9,
13851   kUpb_EncodedType_UInt64 = 10,
13852   kUpb_EncodedType_SInt64 = 11,
13853   kUpb_EncodedType_OpenEnum = 12,
13854   kUpb_EncodedType_Bool = 13,
13855   kUpb_EncodedType_Bytes = 14,
13856   kUpb_EncodedType_String = 15,
13857   kUpb_EncodedType_Group = 16,
13858   kUpb_EncodedType_Message = 17,
13859   kUpb_EncodedType_ClosedEnum = 18,
13860 
13861   kUpb_EncodedType_RepeatedBase = 20,
13862 } upb_EncodedType;
13863 
13864 typedef enum {
13865   kUpb_EncodedFieldModifier_FlipPacked = 1 << 0,
13866   kUpb_EncodedFieldModifier_IsRequired = 1 << 1,
13867   kUpb_EncodedFieldModifier_IsProto3Singular = 1 << 2,
13868   kUpb_EncodedFieldModifier_FlipValidateUtf8 = 1 << 3,
13869 } upb_EncodedFieldModifier;
13870 
13871 enum {
13872   kUpb_EncodedValue_MinField = ' ',
13873   kUpb_EncodedValue_MaxField = 'I',
13874   kUpb_EncodedValue_MinModifier = 'L',
13875   kUpb_EncodedValue_MaxModifier = '[',
13876   kUpb_EncodedValue_End = '^',
13877   kUpb_EncodedValue_MinSkip = '_',
13878   kUpb_EncodedValue_MaxSkip = '~',
13879   kUpb_EncodedValue_OneofSeparator = '~',
13880   kUpb_EncodedValue_FieldSeparator = '|',
13881   kUpb_EncodedValue_MinOneofField = ' ',
13882   kUpb_EncodedValue_MaxOneofField = 'b',
13883   kUpb_EncodedValue_MaxEnumMask = 'A',
13884 };
13885 
13886 enum {
13887   kUpb_EncodedVersion_EnumV1 = '!',
13888   kUpb_EncodedVersion_ExtensionV1 = '#',
13889   kUpb_EncodedVersion_MapV1 = '%',
13890   kUpb_EncodedVersion_MessageV1 = '$',
13891   kUpb_EncodedVersion_MessageSetV1 = '&',
13892 };
13893 
13894 
13895 #endif  // UPB_MINI_DESCRIPTOR_INTERNAL_WIRE_CONSTANTS_H_
13896 
13897 #ifndef UPB_MINI_DESCRIPTOR_INTERNAL_MODIFIERS_H_
13898 #define UPB_MINI_DESCRIPTOR_INTERNAL_MODIFIERS_H_
13899 
13900 // Must be last.
13901 
13902 typedef enum {
13903   kUpb_FieldModifier_IsRepeated = 1 << 0,
13904   kUpb_FieldModifier_IsPacked = 1 << 1,
13905   kUpb_FieldModifier_IsClosedEnum = 1 << 2,
13906   kUpb_FieldModifier_IsProto3Singular = 1 << 3,
13907   kUpb_FieldModifier_IsRequired = 1 << 4,
13908   kUpb_FieldModifier_ValidateUtf8 = 1 << 5,
13909 } kUpb_FieldModifier;
13910 
13911 // These modifiers are also used on the wire.
13912 typedef enum {
13913   kUpb_MessageModifier_ValidateUtf8 = 1 << 0,
13914   kUpb_MessageModifier_DefaultIsPacked = 1 << 1,
13915   kUpb_MessageModifier_IsExtendable = 1 << 2,
13916 } kUpb_MessageModifier;
13917 
13918 
13919 #endif  // UPB_MINI_DESCRIPTOR_INTERNAL_MODIFIERS_H_
13920 
13921 #ifndef UPB_MINI_TABLE_COMPAT_H_
13922 #define UPB_MINI_TABLE_COMPAT_H_
13923 
13924 
13925 // Must be last.
13926 
13927 // upb does not support mixing minitables from different sources but these
13928 // functions are still used by some existing users so for now we make them
13929 // available here. This may or may not change in the future so do not add
13930 // them to new code.
13931 
13932 #ifdef __cplusplus
13933 extern "C" {
13934 #endif
13935 
13936 // Checks if memory layout of src is compatible with dst.
13937 bool upb_MiniTable_Compatible(const upb_MiniTable* src,
13938                               const upb_MiniTable* dst);
13939 
13940 typedef enum {
13941   kUpb_MiniTableEquals_NotEqual,
13942   kUpb_MiniTableEquals_Equal,
13943   kUpb_MiniTableEquals_OutOfMemory,
13944 } upb_MiniTableEquals_Status;
13945 
13946 // Checks equality of mini tables originating from different language runtimes.
13947 upb_MiniTableEquals_Status upb_MiniTable_Equals(const upb_MiniTable* src,
13948                                                 const upb_MiniTable* dst);
13949 
13950 #ifdef __cplusplus
13951 } /* extern "C" */
13952 #endif
13953 
13954 
13955 #endif /* UPB_MINI_TABLE_COMPAT_H_ */
13956 
13957 #ifndef UPB_HASH_INT_TABLE_H_
13958 #define UPB_HASH_INT_TABLE_H_
13959 
13960 
13961 // Must be last.
13962 
13963 typedef struct {
13964   upb_table t;              // For entries that don't fit in the array part.
13965   const upb_tabval* array;  // Array part of the table. See const note above.
13966   size_t array_size;        // Array part size.
13967   size_t array_count;       // Array part number of elements.
13968 } upb_inttable;
13969 
13970 #ifdef __cplusplus
13971 extern "C" {
13972 #endif
13973 
13974 // Initialize a table. If memory allocation failed, false is returned and
13975 // the table is uninitialized.
13976 bool upb_inttable_init(upb_inttable* table, upb_Arena* a);
13977 
13978 // Returns the number of values in the table.
13979 size_t upb_inttable_count(const upb_inttable* t);
13980 
13981 // Inserts the given key into the hashtable with the given value.
13982 // The key must not already exist in the hash table.
13983 // The value must not be UINTPTR_MAX.
13984 //
13985 // If a table resize was required but memory allocation failed, false is
13986 // returned and the table is unchanged.
13987 bool upb_inttable_insert(upb_inttable* t, uintptr_t key, upb_value val,
13988                          upb_Arena* a);
13989 
13990 // Looks up key in this table, returning "true" if the key was found.
13991 // If v is non-NULL, copies the value for this key into *v.
13992 bool upb_inttable_lookup(const upb_inttable* t, uintptr_t key, upb_value* v);
13993 
13994 // Removes an item from the table. Returns true if the remove was successful,
13995 // and stores the removed item in *val if non-NULL.
13996 bool upb_inttable_remove(upb_inttable* t, uintptr_t key, upb_value* val);
13997 
13998 // Updates an existing entry in an inttable.
13999 // If the entry does not exist, returns false and does nothing.
14000 // Unlike insert/remove, this does not invalidate iterators.
14001 bool upb_inttable_replace(upb_inttable* t, uintptr_t key, upb_value val);
14002 
14003 // Optimizes the table for the current set of entries, for both memory use and
14004 // lookup time. Client should call this after all entries have been inserted;
14005 // inserting more entries is legal, but will likely require a table resize.
14006 void upb_inttable_compact(upb_inttable* t, upb_Arena* a);
14007 
14008 // Iteration over inttable:
14009 //
14010 //   intptr_t iter = UPB_INTTABLE_BEGIN;
14011 //   uintptr_t key;
14012 //   upb_value val;
14013 //   while (upb_inttable_next(t, &key, &val, &iter)) {
14014 //      // ...
14015 //   }
14016 
14017 #define UPB_INTTABLE_BEGIN -1
14018 
14019 bool upb_inttable_next(const upb_inttable* t, uintptr_t* key, upb_value* val,
14020                        intptr_t* iter);
14021 void upb_inttable_removeiter(upb_inttable* t, intptr_t* iter);
14022 
14023 #ifdef __cplusplus
14024 } /* extern "C" */
14025 #endif
14026 
14027 
14028 #endif /* UPB_HASH_INT_TABLE_H_ */
14029 
14030 #ifndef UPB_WIRE_INTERNAL_CONSTANTS_H_
14031 #define UPB_WIRE_INTERNAL_CONSTANTS_H_
14032 
14033 #define kUpb_WireFormat_DefaultDepthLimit 100
14034 
14035 // MessageSet wire format is:
14036 //   message MessageSet {
14037 //     repeated group Item = 1 {
14038 //       required int32 type_id = 2;
14039 //       required bytes message = 3;
14040 //     }
14041 //   }
14042 
14043 enum {
14044   kUpb_MsgSet_Item = 1,
14045   kUpb_MsgSet_TypeId = 2,
14046   kUpb_MsgSet_Message = 3,
14047 };
14048 
14049 #endif /* UPB_WIRE_INTERNAL_CONSTANTS_H_ */
14050 
14051 /*
14052  * Internal implementation details of the decoder that are shared between
14053  * decode.c and decode_fast.c.
14054  */
14055 
14056 #ifndef UPB_WIRE_INTERNAL_DECODER_H_
14057 #define UPB_WIRE_INTERNAL_DECODER_H_
14058 
14059 #include "utf8_range.h"
14060 
14061 // Must be last.
14062 
14063 #define DECODE_NOGROUP (uint32_t) - 1
14064 
14065 typedef struct upb_Decoder {
14066   upb_EpsCopyInputStream input;
14067   const upb_ExtensionRegistry* extreg;
14068   const char* unknown;       // Start of unknown data, preserve at buffer flip
14069   upb_Message* unknown_msg;  // Pointer to preserve data to
14070   int depth;                 // Tracks recursion depth to bound stack usage.
14071   uint32_t end_group;  // field number of END_GROUP tag, else DECODE_NOGROUP.
14072   uint16_t options;
14073   bool missing_required;
14074   union {
14075     upb_Arena arena;
14076     void* foo[UPB_ARENA_SIZE_HACK];
14077   };
14078   upb_DecodeStatus status;
14079   jmp_buf err;
14080 
14081 #ifndef NDEBUG
14082   const char* debug_tagstart;
14083   const char* debug_valstart;
14084 #endif
14085 } upb_Decoder;
14086 
14087 /* Error function that will abort decoding with longjmp(). We can't declare this
14088  * UPB_NORETURN, even though it is appropriate, because if we do then compilers
14089  * will "helpfully" refuse to tailcall to it
14090  * (see: https://stackoverflow.com/a/55657013), which will defeat a major goal
14091  * of our optimizations. That is also why we must declare it in a separate file,
14092  * otherwise the compiler will see that it calls longjmp() and deduce that it is
14093  * noreturn. */
14094 const char* _upb_FastDecoder_ErrorJmp(upb_Decoder* d, int status);
14095 
14096 extern const uint8_t upb_utf8_offsets[];
14097 
14098 UPB_INLINE
_upb_Decoder_VerifyUtf8Inline(const char * ptr,int len)14099 bool _upb_Decoder_VerifyUtf8Inline(const char* ptr, int len) {
14100   return utf8_range_IsValid(ptr, len);
14101 }
14102 
14103 const char* _upb_Decoder_CheckRequired(upb_Decoder* d, const char* ptr,
14104                                        const upb_Message* msg,
14105                                        const upb_MiniTable* m);
14106 
14107 /* x86-64 pointers always have the high 16 bits matching. So we can shift
14108  * left 8 and right 8 without loss of information. */
decode_totable(const upb_MiniTable * tablep)14109 UPB_INLINE intptr_t decode_totable(const upb_MiniTable* tablep) {
14110   return ((intptr_t)tablep << 8) | tablep->UPB_PRIVATE(table_mask);
14111 }
14112 
decode_totablep(intptr_t table)14113 UPB_INLINE const upb_MiniTable* decode_totablep(intptr_t table) {
14114   return (const upb_MiniTable*)(table >> 8);
14115 }
14116 
14117 const char* _upb_Decoder_IsDoneFallback(upb_EpsCopyInputStream* e,
14118                                         const char* ptr, int overrun);
14119 
_upb_Decoder_IsDone(upb_Decoder * d,const char ** ptr)14120 UPB_INLINE bool _upb_Decoder_IsDone(upb_Decoder* d, const char** ptr) {
14121   return upb_EpsCopyInputStream_IsDoneWithCallback(
14122       &d->input, ptr, &_upb_Decoder_IsDoneFallback);
14123 }
14124 
_upb_Decoder_BufferFlipCallback(upb_EpsCopyInputStream * e,const char * old_end,const char * new_start)14125 UPB_INLINE const char* _upb_Decoder_BufferFlipCallback(
14126     upb_EpsCopyInputStream* e, const char* old_end, const char* new_start) {
14127   upb_Decoder* d = (upb_Decoder*)e;
14128   if (!old_end) _upb_FastDecoder_ErrorJmp(d, kUpb_DecodeStatus_Malformed);
14129 
14130   if (d->unknown) {
14131     if (!UPB_PRIVATE(_upb_Message_AddUnknown)(
14132             d->unknown_msg, d->unknown, old_end - d->unknown, &d->arena)) {
14133       _upb_FastDecoder_ErrorJmp(d, kUpb_DecodeStatus_OutOfMemory);
14134     }
14135     d->unknown = new_start;
14136   }
14137   return new_start;
14138 }
14139 
14140 #if UPB_FASTTABLE
14141 UPB_INLINE
_upb_FastDecoder_TagDispatch(upb_Decoder * d,const char * ptr,upb_Message * msg,intptr_t table,uint64_t hasbits,uint64_t tag)14142 const char* _upb_FastDecoder_TagDispatch(upb_Decoder* d, const char* ptr,
14143                                          upb_Message* msg, intptr_t table,
14144                                          uint64_t hasbits, uint64_t tag) {
14145   const upb_MiniTable* table_p = decode_totablep(table);
14146   uint8_t mask = table;
14147   uint64_t data;
14148   size_t idx = tag & mask;
14149   UPB_ASSUME((idx & 7) == 0);
14150   idx >>= 3;
14151   data = table_p->UPB_PRIVATE(fasttable)[idx].field_data ^ tag;
14152   UPB_MUSTTAIL return table_p->UPB_PRIVATE(fasttable)[idx].field_parser(
14153       d, ptr, msg, table, hasbits, data);
14154 }
14155 #endif
14156 
_upb_FastDecoder_LoadTag(const char * ptr)14157 UPB_INLINE uint32_t _upb_FastDecoder_LoadTag(const char* ptr) {
14158   uint16_t tag;
14159   memcpy(&tag, ptr, 2);
14160   return tag;
14161 }
14162 
14163 
14164 #endif /* UPB_WIRE_INTERNAL_DECODER_H_ */
14165 
14166 #ifndef UPB_WIRE_READER_H_
14167 #define UPB_WIRE_READER_H_
14168 
14169 
14170 #ifndef UPB_WIRE_INTERNAL_READER_H_
14171 #define UPB_WIRE_INTERNAL_READER_H_
14172 
14173 // Must be last.
14174 
14175 #define kUpb_WireReader_WireTypeBits 3
14176 #define kUpb_WireReader_WireTypeMask 7
14177 
14178 typedef struct {
14179   const char* ptr;
14180   uint64_t val;
14181 } UPB_PRIVATE(_upb_WireReader_LongVarint);
14182 
14183 #ifdef __cplusplus
14184 extern "C" {
14185 #endif
14186 
14187 UPB_PRIVATE(_upb_WireReader_LongVarint)
14188 UPB_PRIVATE(_upb_WireReader_ReadLongVarint)(const char* ptr, uint64_t val);
14189 
UPB_PRIVATE(_upb_WireReader_ReadVarint)14190 UPB_FORCEINLINE const char* UPB_PRIVATE(_upb_WireReader_ReadVarint)(
14191     const char* ptr, uint64_t* val, int maxlen, uint64_t maxval) {
14192   uint64_t byte = (uint8_t)*ptr;
14193   if (UPB_LIKELY((byte & 0x80) == 0)) {
14194     *val = (uint32_t)byte;
14195     return ptr + 1;
14196   }
14197   const char* start = ptr;
14198   UPB_PRIVATE(_upb_WireReader_LongVarint)
14199   res = UPB_PRIVATE(_upb_WireReader_ReadLongVarint)(ptr, byte);
14200   if (!res.ptr || (maxlen < 10 && res.ptr - start > maxlen) ||
14201       res.val > maxval) {
14202     return NULL;  // Malformed.
14203   }
14204   *val = res.val;
14205   return res.ptr;
14206 }
14207 
upb_WireReader_GetFieldNumber(uint32_t tag)14208 UPB_API_INLINE uint32_t upb_WireReader_GetFieldNumber(uint32_t tag) {
14209   return tag >> kUpb_WireReader_WireTypeBits;
14210 }
14211 
upb_WireReader_GetWireType(uint32_t tag)14212 UPB_API_INLINE uint8_t upb_WireReader_GetWireType(uint32_t tag) {
14213   return tag & kUpb_WireReader_WireTypeMask;
14214 }
14215 
14216 #ifdef __cplusplus
14217 } /* extern "C" */
14218 #endif
14219 
14220 
14221 #endif  // UPB_WIRE_INTERNAL_READER_H_
14222 
14223 #ifndef UPB_WIRE_TYPES_H_
14224 #define UPB_WIRE_TYPES_H_
14225 
14226 // A list of types as they are encoded on the wire.
14227 typedef enum {
14228   kUpb_WireType_Varint = 0,
14229   kUpb_WireType_64Bit = 1,
14230   kUpb_WireType_Delimited = 2,
14231   kUpb_WireType_StartGroup = 3,
14232   kUpb_WireType_EndGroup = 4,
14233   kUpb_WireType_32Bit = 5
14234 } upb_WireType;
14235 
14236 #endif /* UPB_WIRE_TYPES_H_ */
14237 
14238 // Must be last.
14239 
14240 // The upb_WireReader interface is suitable for general-purpose parsing of
14241 // protobuf binary wire format. It is designed to be used along with
14242 // upb_EpsCopyInputStream for buffering, and all parsing routines in this file
14243 // assume that at least kUpb_EpsCopyInputStream_SlopBytes worth of data is
14244 // available to read without any bounds checks.
14245 
14246 #ifdef __cplusplus
14247 extern "C" {
14248 #endif
14249 
14250 // Parses a tag into `tag`, and returns a pointer past the end of the tag, or
14251 // NULL if there was an error in the tag data.
14252 //
14253 // REQUIRES: there must be at least 10 bytes of data available at `ptr`.
14254 // Bounds checks must be performed before calling this function, preferably
14255 // by calling upb_EpsCopyInputStream_IsDone().
upb_WireReader_ReadTag(const char * ptr,uint32_t * tag)14256 UPB_FORCEINLINE const char* upb_WireReader_ReadTag(const char* ptr,
14257                                                    uint32_t* tag) {
14258   uint64_t val;
14259   ptr = UPB_PRIVATE(_upb_WireReader_ReadVarint)(ptr, &val, 5, UINT32_MAX);
14260   if (!ptr) return NULL;
14261   *tag = val;
14262   return ptr;
14263 }
14264 
14265 // Given a tag, returns the field number.
14266 UPB_API_INLINE uint32_t upb_WireReader_GetFieldNumber(uint32_t tag);
14267 
14268 // Given a tag, returns the wire type.
14269 UPB_API_INLINE uint8_t upb_WireReader_GetWireType(uint32_t tag);
14270 
upb_WireReader_ReadVarint(const char * ptr,uint64_t * val)14271 UPB_INLINE const char* upb_WireReader_ReadVarint(const char* ptr,
14272                                                  uint64_t* val) {
14273   return UPB_PRIVATE(_upb_WireReader_ReadVarint)(ptr, val, 10, UINT64_MAX);
14274 }
14275 
14276 // Skips data for a varint, returning a pointer past the end of the varint, or
14277 // NULL if there was an error in the varint data.
14278 //
14279 // REQUIRES: there must be at least 10 bytes of data available at `ptr`.
14280 // Bounds checks must be performed before calling this function, preferably
14281 // by calling upb_EpsCopyInputStream_IsDone().
upb_WireReader_SkipVarint(const char * ptr)14282 UPB_INLINE const char* upb_WireReader_SkipVarint(const char* ptr) {
14283   uint64_t val;
14284   return upb_WireReader_ReadVarint(ptr, &val);
14285 }
14286 
14287 // Reads a varint indicating the size of a delimited field into `size`, or
14288 // NULL if there was an error in the varint data.
14289 //
14290 // REQUIRES: there must be at least 10 bytes of data available at `ptr`.
14291 // Bounds checks must be performed before calling this function, preferably
14292 // by calling upb_EpsCopyInputStream_IsDone().
upb_WireReader_ReadSize(const char * ptr,int * size)14293 UPB_INLINE const char* upb_WireReader_ReadSize(const char* ptr, int* size) {
14294   uint64_t size64;
14295   ptr = upb_WireReader_ReadVarint(ptr, &size64);
14296   if (!ptr || size64 >= INT32_MAX) return NULL;
14297   *size = size64;
14298   return ptr;
14299 }
14300 
14301 // Reads a fixed32 field, performing byte swapping if necessary.
14302 //
14303 // REQUIRES: there must be at least 4 bytes of data available at `ptr`.
14304 // Bounds checks must be performed before calling this function, preferably
14305 // by calling upb_EpsCopyInputStream_IsDone().
upb_WireReader_ReadFixed32(const char * ptr,void * val)14306 UPB_INLINE const char* upb_WireReader_ReadFixed32(const char* ptr, void* val) {
14307   uint32_t uval;
14308   memcpy(&uval, ptr, 4);
14309   uval = upb_BigEndian32(uval);
14310   memcpy(val, &uval, 4);
14311   return ptr + 4;
14312 }
14313 
14314 // Reads a fixed64 field, performing byte swapping if necessary.
14315 //
14316 // REQUIRES: there must be at least 4 bytes of data available at `ptr`.
14317 // Bounds checks must be performed before calling this function, preferably
14318 // by calling upb_EpsCopyInputStream_IsDone().
upb_WireReader_ReadFixed64(const char * ptr,void * val)14319 UPB_INLINE const char* upb_WireReader_ReadFixed64(const char* ptr, void* val) {
14320   uint64_t uval;
14321   memcpy(&uval, ptr, 8);
14322   uval = upb_BigEndian64(uval);
14323   memcpy(val, &uval, 8);
14324   return ptr + 8;
14325 }
14326 
14327 const char* UPB_PRIVATE(_upb_WireReader_SkipGroup)(
14328     const char* ptr, uint32_t tag, int depth_limit,
14329     upb_EpsCopyInputStream* stream);
14330 
14331 // Skips data for a group, returning a pointer past the end of the group, or
14332 // NULL if there was an error parsing the group.  The `tag` argument should be
14333 // the start group tag that begins the group.  The `depth_limit` argument
14334 // indicates how many levels of recursion the group is allowed to have before
14335 // reporting a parse error (this limit exists to protect against stack
14336 // overflow).
14337 //
14338 // TODO: evaluate how the depth_limit should be specified. Do users need
14339 // control over this?
upb_WireReader_SkipGroup(const char * ptr,uint32_t tag,upb_EpsCopyInputStream * stream)14340 UPB_INLINE const char* upb_WireReader_SkipGroup(
14341     const char* ptr, uint32_t tag, upb_EpsCopyInputStream* stream) {
14342   return UPB_PRIVATE(_upb_WireReader_SkipGroup)(ptr, tag, 100, stream);
14343 }
14344 
_upb_WireReader_SkipValue(const char * ptr,uint32_t tag,int depth_limit,upb_EpsCopyInputStream * stream)14345 UPB_INLINE const char* _upb_WireReader_SkipValue(
14346     const char* ptr, uint32_t tag, int depth_limit,
14347     upb_EpsCopyInputStream* stream) {
14348   switch (upb_WireReader_GetWireType(tag)) {
14349     case kUpb_WireType_Varint:
14350       return upb_WireReader_SkipVarint(ptr);
14351     case kUpb_WireType_32Bit:
14352       return ptr + 4;
14353     case kUpb_WireType_64Bit:
14354       return ptr + 8;
14355     case kUpb_WireType_Delimited: {
14356       int size;
14357       ptr = upb_WireReader_ReadSize(ptr, &size);
14358       if (!ptr) return NULL;
14359       ptr += size;
14360       return ptr;
14361     }
14362     case kUpb_WireType_StartGroup:
14363       return UPB_PRIVATE(_upb_WireReader_SkipGroup)(ptr, tag, depth_limit,
14364                                                     stream);
14365     case kUpb_WireType_EndGroup:
14366       return NULL;  // Should be handled before now.
14367     default:
14368       return NULL;  // Unknown wire type.
14369   }
14370 }
14371 
14372 // Skips data for a wire value of any type, returning a pointer past the end of
14373 // the data, or NULL if there was an error parsing the group. The `tag` argument
14374 // should be the tag that was just parsed. The `depth_limit` argument indicates
14375 // how many levels of recursion a group is allowed to have before reporting a
14376 // parse error (this limit exists to protect against stack overflow).
14377 //
14378 // REQUIRES: there must be at least 10 bytes of data available at `ptr`.
14379 // Bounds checks must be performed before calling this function, preferably
14380 // by calling upb_EpsCopyInputStream_IsDone().
14381 //
14382 // TODO: evaluate how the depth_limit should be specified. Do users need
14383 // control over this?
upb_WireReader_SkipValue(const char * ptr,uint32_t tag,upb_EpsCopyInputStream * stream)14384 UPB_INLINE const char* upb_WireReader_SkipValue(
14385     const char* ptr, uint32_t tag, upb_EpsCopyInputStream* stream) {
14386   return _upb_WireReader_SkipValue(ptr, tag, 100, stream);
14387 }
14388 
14389 #ifdef __cplusplus
14390 } /* extern "C" */
14391 #endif
14392 
14393 
14394 #endif  // UPB_WIRE_READER_H_
14395 
14396 #ifndef UPB_LEX_STRTOD_H_
14397 #define UPB_LEX_STRTOD_H_
14398 
14399 // Must be last.
14400 
14401 #ifdef __cplusplus
14402 extern "C" {
14403 #endif
14404 
14405 double _upb_NoLocaleStrtod(const char *str, char **endptr);
14406 
14407 #ifdef __cplusplus
14408 } /* extern "C" */
14409 #endif
14410 
14411 
14412 #endif /* UPB_LEX_STRTOD_H_ */
14413 
14414 #ifndef UPB_MINI_DESCRIPTOR_INTERNAL_ENCODE_H_
14415 #define UPB_MINI_DESCRIPTOR_INTERNAL_ENCODE_H_
14416 
14417 #include <stdint.h>
14418 
14419 
14420 // Must be last.
14421 
14422 // If the input buffer has at least this many bytes available, the encoder call
14423 // is guaranteed to succeed (as long as field number order is maintained).
14424 #define kUpb_MtDataEncoder_MinSize 16
14425 
14426 typedef struct {
14427   char* end;  // Limit of the buffer passed as a parameter.
14428   // Aliased to internal-only members in .cc.
14429   char internal[32];
14430 } upb_MtDataEncoder;
14431 
14432 #ifdef __cplusplus
14433 extern "C" {
14434 #endif
14435 
14436 // Encodes field/oneof information for a given message.  The sequence of calls
14437 // should look like:
14438 //
14439 //   upb_MtDataEncoder e;
14440 //   char buf[256];
14441 //   char* ptr = buf;
14442 //   e.end = ptr + sizeof(buf);
14443 //   unit64_t msg_mod = ...; // bitwise & of kUpb_MessageModifiers or zero
14444 //   ptr = upb_MtDataEncoder_StartMessage(&e, ptr, msg_mod);
14445 //   // Fields *must* be in field number order.
14446 //   ptr = upb_MtDataEncoder_PutField(&e, ptr, ...);
14447 //   ptr = upb_MtDataEncoder_PutField(&e, ptr, ...);
14448 //   ptr = upb_MtDataEncoder_PutField(&e, ptr, ...);
14449 //
14450 //   // If oneofs are present.  Oneofs must be encoded after regular fields.
14451 //   ptr = upb_MiniTable_StartOneof(&e, ptr)
14452 //   ptr = upb_MiniTable_PutOneofField(&e, ptr, ...);
14453 //   ptr = upb_MiniTable_PutOneofField(&e, ptr, ...);
14454 //
14455 //   ptr = upb_MiniTable_StartOneof(&e, ptr);
14456 //   ptr = upb_MiniTable_PutOneofField(&e, ptr, ...);
14457 //   ptr = upb_MiniTable_PutOneofField(&e, ptr, ...);
14458 //
14459 // Oneofs must be encoded after all regular fields.
14460 char* upb_MtDataEncoder_StartMessage(upb_MtDataEncoder* e, char* ptr,
14461                                      uint64_t msg_mod);
14462 char* upb_MtDataEncoder_PutField(upb_MtDataEncoder* e, char* ptr,
14463                                  upb_FieldType type, uint32_t field_num,
14464                                  uint64_t field_mod);
14465 char* upb_MtDataEncoder_StartOneof(upb_MtDataEncoder* e, char* ptr);
14466 char* upb_MtDataEncoder_PutOneofField(upb_MtDataEncoder* e, char* ptr,
14467                                       uint32_t field_num);
14468 
14469 // Encodes the set of values for a given enum. The values must be given in
14470 // order (after casting to uint32_t), and repeats are not allowed.
14471 char* upb_MtDataEncoder_StartEnum(upb_MtDataEncoder* e, char* ptr);
14472 char* upb_MtDataEncoder_PutEnumValue(upb_MtDataEncoder* e, char* ptr,
14473                                      uint32_t val);
14474 char* upb_MtDataEncoder_EndEnum(upb_MtDataEncoder* e, char* ptr);
14475 
14476 // Encodes an entire mini descriptor for an extension.
14477 char* upb_MtDataEncoder_EncodeExtension(upb_MtDataEncoder* e, char* ptr,
14478                                         upb_FieldType type, uint32_t field_num,
14479                                         uint64_t field_mod);
14480 
14481 // Encodes an entire mini descriptor for a map.
14482 char* upb_MtDataEncoder_EncodeMap(upb_MtDataEncoder* e, char* ptr,
14483                                   upb_FieldType key_type,
14484                                   upb_FieldType value_type, uint64_t key_mod,
14485                                   uint64_t value_mod);
14486 
14487 // Encodes an entire mini descriptor for a message set.
14488 char* upb_MtDataEncoder_EncodeMessageSet(upb_MtDataEncoder* e, char* ptr);
14489 
14490 #ifdef __cplusplus
14491 } /* extern "C" */
14492 #endif
14493 
14494 
14495 #endif /* UPB_MINI_DESCRIPTOR_INTERNAL_ENCODE_H_ */
14496 
14497 #ifndef UPB_REFLECTION_DEF_POOL_INTERNAL_H_
14498 #define UPB_REFLECTION_DEF_POOL_INTERNAL_H_
14499 
14500 
14501 // Must be last.
14502 
14503 #ifdef __cplusplus
14504 extern "C" {
14505 #endif
14506 
14507 upb_Arena* _upb_DefPool_Arena(const upb_DefPool* s);
14508 size_t _upb_DefPool_BytesLoaded(const upb_DefPool* s);
14509 upb_ExtensionRegistry* _upb_DefPool_ExtReg(const upb_DefPool* s);
14510 
14511 bool _upb_DefPool_InsertExt(upb_DefPool* s, const upb_MiniTableExtension* ext,
14512                             const upb_FieldDef* f);
14513 bool _upb_DefPool_InsertSym(upb_DefPool* s, upb_StringView sym, upb_value v,
14514                             upb_Status* status);
14515 bool _upb_DefPool_LookupSym(const upb_DefPool* s, const char* sym, size_t size,
14516                             upb_value* v);
14517 
14518 void** _upb_DefPool_ScratchData(const upb_DefPool* s);
14519 size_t* _upb_DefPool_ScratchSize(const upb_DefPool* s);
14520 void _upb_DefPool_SetPlatform(upb_DefPool* s, upb_MiniTablePlatform platform);
14521 
14522 // For generated code only: loads a generated descriptor.
14523 typedef struct _upb_DefPool_Init {
14524   struct _upb_DefPool_Init** deps;  // Dependencies of this file.
14525   const upb_MiniTableFile* layout;
14526   const char* filename;
14527   upb_StringView descriptor;  // Serialized descriptor.
14528 } _upb_DefPool_Init;
14529 
14530 bool _upb_DefPool_LoadDefInit(upb_DefPool* s, const _upb_DefPool_Init* init);
14531 
14532 // Should only be directly called by tests. This variant lets us suppress
14533 // the use of compiled-in tables, forcing a rebuild of the tables at runtime.
14534 bool _upb_DefPool_LoadDefInitEx(upb_DefPool* s, const _upb_DefPool_Init* init,
14535                                 bool rebuild_minitable);
14536 
14537 #ifdef __cplusplus
14538 } /* extern "C" */
14539 #endif
14540 
14541 
14542 #endif /* UPB_REFLECTION_DEF_POOL_INTERNAL_H_ */
14543 
14544 #ifndef UPB_REFLECTION_DEF_BUILDER_INTERNAL_H_
14545 #define UPB_REFLECTION_DEF_BUILDER_INTERNAL_H_
14546 
14547 
14548 // Must be last.
14549 
14550 // We want to copy the options verbatim into the destination options proto.
14551 // We use serialize+parse as our deep copy.
14552 #define UPB_DEF_SET_OPTIONS(target, desc_type, options_type, proto)           \
14553   if (UPB_DESC(desc_type##_has_options)(proto)) {                             \
14554     size_t size;                                                              \
14555     char* pb = UPB_DESC(options_type##_serialize)(                            \
14556         UPB_DESC(desc_type##_options)(proto), ctx->tmp_arena, &size);         \
14557     if (!pb) _upb_DefBuilder_OomErr(ctx);                                     \
14558     target =                                                                  \
14559         UPB_DESC(options_type##_parse)(pb, size, _upb_DefBuilder_Arena(ctx)); \
14560     if (!target) _upb_DefBuilder_OomErr(ctx);                                 \
14561   } else {                                                                    \
14562     target = (const UPB_DESC(options_type)*)kUpbDefOptDefault;                \
14563   }
14564 
14565 #ifdef __cplusplus
14566 extern "C" {
14567 #endif
14568 
14569 struct upb_DefBuilder {
14570   upb_DefPool* symtab;
14571   upb_strtable feature_cache;             // Caches features by identity.
14572   UPB_DESC(FeatureSet*) legacy_features;  // For computing legacy features.
14573   char* tmp_buf;                          // Temporary buffer in tmp_arena.
14574   size_t tmp_buf_size;                    // Size of temporary buffer.
14575   upb_FileDef* file;                 // File we are building.
14576   upb_Arena* arena;                  // Allocate defs here.
14577   upb_Arena* tmp_arena;              // For temporary allocations.
14578   upb_Status* status;                // Record errors here.
14579   const upb_MiniTableFile* layout;   // NULL if we should build layouts.
14580   upb_MiniTablePlatform platform;    // Platform we are targeting.
14581   int enum_count;                    // Count of enums built so far.
14582   int msg_count;                     // Count of messages built so far.
14583   int ext_count;                     // Count of extensions built so far.
14584   jmp_buf err;                       // longjmp() on error.
14585 };
14586 
14587 extern const char* kUpbDefOptDefault;
14588 
14589 // ctx->status has already been set elsewhere so just fail/longjmp()
14590 UPB_NORETURN void _upb_DefBuilder_FailJmp(upb_DefBuilder* ctx);
14591 
14592 UPB_NORETURN void _upb_DefBuilder_Errf(upb_DefBuilder* ctx, const char* fmt,
14593                                        ...) UPB_PRINTF(2, 3);
14594 UPB_NORETURN void _upb_DefBuilder_OomErr(upb_DefBuilder* ctx);
14595 
14596 const char* _upb_DefBuilder_MakeFullName(upb_DefBuilder* ctx,
14597                                          const char* prefix,
14598                                          upb_StringView name);
14599 
14600 // Given a symbol and the base symbol inside which it is defined,
14601 // find the symbol's definition.
14602 const void* _upb_DefBuilder_ResolveAny(upb_DefBuilder* ctx,
14603                                        const char* from_name_dbg,
14604                                        const char* base, upb_StringView sym,
14605                                        upb_deftype_t* type);
14606 
14607 const void* _upb_DefBuilder_Resolve(upb_DefBuilder* ctx,
14608                                     const char* from_name_dbg, const char* base,
14609                                     upb_StringView sym, upb_deftype_t type);
14610 
14611 char _upb_DefBuilder_ParseEscape(upb_DefBuilder* ctx, const upb_FieldDef* f,
14612                                  const char** src, const char* end);
14613 
14614 const char* _upb_DefBuilder_FullToShort(const char* fullname);
14615 
_upb_DefBuilder_Alloc(upb_DefBuilder * ctx,size_t bytes)14616 UPB_INLINE void* _upb_DefBuilder_Alloc(upb_DefBuilder* ctx, size_t bytes) {
14617   if (bytes == 0) return NULL;
14618   void* ret = upb_Arena_Malloc(ctx->arena, bytes);
14619   if (!ret) _upb_DefBuilder_OomErr(ctx);
14620   return ret;
14621 }
14622 
14623 // Adds a symbol |v| to the symtab, which must be a def pointer previously
14624 // packed with pack_def(). The def's pointer to upb_FileDef* must be set before
14625 // 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)14626 UPB_INLINE void _upb_DefBuilder_Add(upb_DefBuilder* ctx, const char* name,
14627                                     upb_value v) {
14628   upb_StringView sym = {.data = name, .size = strlen(name)};
14629   bool ok = _upb_DefPool_InsertSym(ctx->symtab, sym, v, ctx->status);
14630   if (!ok) _upb_DefBuilder_FailJmp(ctx);
14631 }
14632 
_upb_DefBuilder_Arena(const upb_DefBuilder * ctx)14633 UPB_INLINE upb_Arena* _upb_DefBuilder_Arena(const upb_DefBuilder* ctx) {
14634   return ctx->arena;
14635 }
14636 
_upb_DefBuilder_File(const upb_DefBuilder * ctx)14637 UPB_INLINE upb_FileDef* _upb_DefBuilder_File(const upb_DefBuilder* ctx) {
14638   return ctx->file;
14639 }
14640 
14641 // This version of CheckIdent() is only called by other, faster versions after
14642 // they detect a parsing error.
14643 void _upb_DefBuilder_CheckIdentSlow(upb_DefBuilder* ctx, upb_StringView name,
14644                                     bool full);
14645 
14646 // Verify a full identifier string. This is slightly more complicated than
14647 // verifying a relative identifier string because we must track '.' chars.
_upb_DefBuilder_CheckIdentFull(upb_DefBuilder * ctx,upb_StringView name)14648 UPB_INLINE void _upb_DefBuilder_CheckIdentFull(upb_DefBuilder* ctx,
14649                                                upb_StringView name) {
14650   bool good = name.size > 0;
14651   bool start = true;
14652 
14653   for (size_t i = 0; i < name.size; i++) {
14654     const char c = name.data[i];
14655     const char d = c | 0x20;  // force lowercase
14656     const bool is_alpha = (('a' <= d) & (d <= 'z')) | (c == '_');
14657     const bool is_numer = ('0' <= c) & (c <= '9') & !start;
14658     const bool is_dot = (c == '.') & !start;
14659 
14660     good &= is_alpha | is_numer | is_dot;
14661     start = is_dot;
14662   }
14663 
14664   if (!good) _upb_DefBuilder_CheckIdentSlow(ctx, name, true);
14665 }
14666 
14667 // Returns true if the returned feature set is new and must be populated.
14668 bool _upb_DefBuilder_GetOrCreateFeatureSet(upb_DefBuilder* ctx,
14669                                            const UPB_DESC(FeatureSet*) parent,
14670                                            upb_StringView key,
14671                                            UPB_DESC(FeatureSet**) set);
14672 
14673 const UPB_DESC(FeatureSet*)
14674     _upb_DefBuilder_DoResolveFeatures(upb_DefBuilder* ctx,
14675                                       const UPB_DESC(FeatureSet*) parent,
14676                                       const UPB_DESC(FeatureSet*) child,
14677                                       bool is_implicit);
14678 
UPB_DESC(FeatureSet *)14679 UPB_INLINE const UPB_DESC(FeatureSet*)
14680     _upb_DefBuilder_ResolveFeatures(upb_DefBuilder* ctx,
14681                                     const UPB_DESC(FeatureSet*) parent,
14682                                     const UPB_DESC(FeatureSet*) child) {
14683   return _upb_DefBuilder_DoResolveFeatures(ctx, parent, child, false);
14684 }
14685 
14686 #ifdef __cplusplus
14687 } /* extern "C" */
14688 #endif
14689 
14690 
14691 #endif /* UPB_REFLECTION_DEF_BUILDER_INTERNAL_H_ */
14692 
14693 #ifndef UPB_REFLECTION_ENUM_DEF_INTERNAL_H_
14694 #define UPB_REFLECTION_ENUM_DEF_INTERNAL_H_
14695 
14696 
14697 // Must be last.
14698 
14699 #ifdef __cplusplus
14700 extern "C" {
14701 #endif
14702 
14703 upb_EnumDef* _upb_EnumDef_At(const upb_EnumDef* e, int i);
14704 bool _upb_EnumDef_Insert(upb_EnumDef* e, upb_EnumValueDef* v, upb_Arena* a);
14705 const upb_MiniTableEnum* _upb_EnumDef_MiniTable(const upb_EnumDef* e);
14706 
14707 // Allocate and initialize an array of |n| enum defs.
14708 upb_EnumDef* _upb_EnumDefs_New(upb_DefBuilder* ctx, int n,
14709                                const UPB_DESC(EnumDescriptorProto*)
14710                                    const* protos,
14711                                const UPB_DESC(FeatureSet*) parent_features,
14712                                const upb_MessageDef* containing_type);
14713 
14714 #ifdef __cplusplus
14715 } /* extern "C" */
14716 #endif
14717 
14718 
14719 #endif /* UPB_REFLECTION_ENUM_DEF_INTERNAL_H_ */
14720 
14721 #ifndef UPB_REFLECTION_ENUM_VALUE_DEF_INTERNAL_H_
14722 #define UPB_REFLECTION_ENUM_VALUE_DEF_INTERNAL_H_
14723 
14724 
14725 // Must be last.
14726 
14727 #ifdef __cplusplus
14728 extern "C" {
14729 #endif
14730 
14731 upb_EnumValueDef* _upb_EnumValueDef_At(const upb_EnumValueDef* v, int i);
14732 
14733 // Allocate and initialize an array of |n| enum value defs owned by |e|.
14734 upb_EnumValueDef* _upb_EnumValueDefs_New(
14735     upb_DefBuilder* ctx, const char* prefix, int n,
14736     const UPB_DESC(EnumValueDescriptorProto*) const* protos,
14737     const UPB_DESC(FeatureSet*) parent_features, upb_EnumDef* e,
14738     bool* is_sorted);
14739 
14740 const upb_EnumValueDef** _upb_EnumValueDefs_Sorted(const upb_EnumValueDef* v,
14741                                                    int n, upb_Arena* a);
14742 
14743 #ifdef __cplusplus
14744 } /* extern "C" */
14745 #endif
14746 
14747 
14748 #endif /* UPB_REFLECTION_ENUM_VALUE_DEF_INTERNAL_H_ */
14749 
14750 #ifndef UPB_REFLECTION_FIELD_DEF_INTERNAL_H_
14751 #define UPB_REFLECTION_FIELD_DEF_INTERNAL_H_
14752 
14753 
14754 // Must be last.
14755 
14756 #ifdef __cplusplus
14757 extern "C" {
14758 #endif
14759 
14760 upb_FieldDef* _upb_FieldDef_At(const upb_FieldDef* f, int i);
14761 
14762 bool _upb_FieldDef_IsClosedEnum(const upb_FieldDef* f);
14763 bool _upb_FieldDef_IsProto3Optional(const upb_FieldDef* f);
14764 int _upb_FieldDef_LayoutIndex(const upb_FieldDef* f);
14765 uint64_t _upb_FieldDef_Modifiers(const upb_FieldDef* f);
14766 void _upb_FieldDef_Resolve(upb_DefBuilder* ctx, const char* prefix,
14767                            upb_FieldDef* f);
14768 void _upb_FieldDef_BuildMiniTableExtension(upb_DefBuilder* ctx,
14769                                            const upb_FieldDef* f);
14770 
14771 // Allocate and initialize an array of |n| extensions (field defs).
14772 upb_FieldDef* _upb_Extensions_New(upb_DefBuilder* ctx, int n,
14773                                   const UPB_DESC(FieldDescriptorProto*)
14774                                       const* protos,
14775                                   const UPB_DESC(FeatureSet*) parent_features,
14776                                   const char* prefix, upb_MessageDef* m);
14777 
14778 // Allocate and initialize an array of |n| field defs.
14779 upb_FieldDef* _upb_FieldDefs_New(upb_DefBuilder* ctx, int n,
14780                                  const UPB_DESC(FieldDescriptorProto*)
14781                                      const* protos,
14782                                  const UPB_DESC(FeatureSet*) parent_features,
14783                                  const char* prefix, upb_MessageDef* m,
14784                                  bool* is_sorted);
14785 
14786 // Allocate and return a list of pointers to the |n| field defs in |ff|,
14787 // sorted by field number.
14788 const upb_FieldDef** _upb_FieldDefs_Sorted(const upb_FieldDef* f, int n,
14789                                            upb_Arena* a);
14790 
14791 #ifdef __cplusplus
14792 } /* extern "C" */
14793 #endif
14794 
14795 
14796 #endif /* UPB_REFLECTION_FIELD_DEF_INTERNAL_H_ */
14797 
14798 #ifndef UPB_REFLECTION_FILE_DEF_INTERNAL_H_
14799 #define UPB_REFLECTION_FILE_DEF_INTERNAL_H_
14800 
14801 
14802 // Must be last.
14803 
14804 #ifdef __cplusplus
14805 extern "C" {
14806 #endif
14807 
14808 const upb_MiniTableExtension* _upb_FileDef_ExtensionMiniTable(
14809     const upb_FileDef* f, int i);
14810 const int32_t* _upb_FileDef_PublicDependencyIndexes(const upb_FileDef* f);
14811 const int32_t* _upb_FileDef_WeakDependencyIndexes(const upb_FileDef* f);
14812 
14813 // upb_FileDef_Package() returns "" if f->package is NULL, this does not.
14814 const char* _upb_FileDef_RawPackage(const upb_FileDef* f);
14815 
14816 void _upb_FileDef_Create(upb_DefBuilder* ctx,
14817                          const UPB_DESC(FileDescriptorProto) * file_proto);
14818 
14819 #ifdef __cplusplus
14820 } /* extern "C" */
14821 #endif
14822 
14823 
14824 #endif /* UPB_REFLECTION_FILE_DEF_INTERNAL_H_ */
14825 
14826 #ifndef UPB_REFLECTION_MESSAGE_DEF_INTERNAL_H_
14827 #define UPB_REFLECTION_MESSAGE_DEF_INTERNAL_H_
14828 
14829 
14830 // Must be last.
14831 
14832 #ifdef __cplusplus
14833 extern "C" {
14834 #endif
14835 
14836 upb_MessageDef* _upb_MessageDef_At(const upb_MessageDef* m, int i);
14837 bool _upb_MessageDef_InMessageSet(const upb_MessageDef* m);
14838 bool _upb_MessageDef_Insert(upb_MessageDef* m, const char* name, size_t size,
14839                             upb_value v, upb_Arena* a);
14840 void _upb_MessageDef_InsertField(upb_DefBuilder* ctx, upb_MessageDef* m,
14841                                  const upb_FieldDef* f);
14842 bool _upb_MessageDef_IsValidExtensionNumber(const upb_MessageDef* m, int n);
14843 void _upb_MessageDef_CreateMiniTable(upb_DefBuilder* ctx, upb_MessageDef* m);
14844 void _upb_MessageDef_LinkMiniTable(upb_DefBuilder* ctx,
14845                                    const upb_MessageDef* m);
14846 void _upb_MessageDef_Resolve(upb_DefBuilder* ctx, upb_MessageDef* m);
14847 
14848 // Allocate and initialize an array of |n| message defs.
14849 upb_MessageDef* _upb_MessageDefs_New(upb_DefBuilder* ctx, int n,
14850                                      const UPB_DESC(DescriptorProto*)
14851                                          const* protos,
14852                                      const UPB_DESC(FeatureSet*)
14853                                          parent_features,
14854                                      const upb_MessageDef* containing_type);
14855 
14856 #ifdef __cplusplus
14857 } /* extern "C" */
14858 #endif
14859 
14860 
14861 #endif /* UPB_REFLECTION_MESSAGE_DEF_INTERNAL_H_ */
14862 
14863 #ifndef UPB_REFLECTION_SERVICE_DEF_INTERNAL_H_
14864 #define UPB_REFLECTION_SERVICE_DEF_INTERNAL_H_
14865 
14866 
14867 // Must be last.
14868 
14869 #ifdef __cplusplus
14870 extern "C" {
14871 #endif
14872 
14873 upb_ServiceDef* _upb_ServiceDef_At(const upb_ServiceDef* s, int i);
14874 
14875 // Allocate and initialize an array of |n| service defs.
14876 upb_ServiceDef* _upb_ServiceDefs_New(upb_DefBuilder* ctx, int n,
14877                                      const UPB_DESC(ServiceDescriptorProto*)
14878                                          const* protos,
14879                                      const UPB_DESC(FeatureSet*)
14880                                          parent_features);
14881 
14882 #ifdef __cplusplus
14883 } /* extern "C" */
14884 #endif
14885 
14886 
14887 #endif /* UPB_REFLECTION_SERVICE_DEF_INTERNAL_H_ */
14888 
14889 #ifndef UPB_REFLECTION_UPB_EDITION_DEFAULTS_H_
14890 #define UPB_REFLECTION_UPB_EDITION_DEFAULTS_H_
14891 
14892 // This file contains the serialized FeatureSetDefaults object for
14893 // language-independent features and (possibly at some point) for upb-specific
14894 // features. This is used for feature resolution under Editions.
14895 // NOLINTBEGIN
14896 // clang-format off
14897 #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"
14898 // clang-format on
14899 // NOLINTEND
14900 
14901 #endif  // UPB_REFLECTION_UPB_EDITION_DEFAULTS_H_
14902 
14903 #ifndef UPB_REFLECTION_DESC_STATE_INTERNAL_H_
14904 #define UPB_REFLECTION_DESC_STATE_INTERNAL_H_
14905 
14906 
14907 // Must be last.
14908 
14909 // Manages the storage for mini descriptor strings as they are being encoded.
14910 // TODO: Move some of this state directly into the encoder, maybe.
14911 typedef struct {
14912   upb_MtDataEncoder e;
14913   size_t bufsize;
14914   char* buf;
14915   char* ptr;
14916 } upb_DescState;
14917 
14918 #ifdef __cplusplus
14919 extern "C" {
14920 #endif
14921 
_upb_DescState_Init(upb_DescState * d)14922 UPB_INLINE void _upb_DescState_Init(upb_DescState* d) {
14923   d->bufsize = kUpb_MtDataEncoder_MinSize * 2;
14924   d->buf = NULL;
14925   d->ptr = NULL;
14926 }
14927 
14928 bool _upb_DescState_Grow(upb_DescState* d, upb_Arena* a);
14929 
14930 #ifdef __cplusplus
14931 } /* extern "C" */
14932 #endif
14933 
14934 
14935 #endif /* UPB_REFLECTION_DESC_STATE_INTERNAL_H_ */
14936 
14937 #ifndef UPB_REFLECTION_ENUM_RESERVED_RANGE_INTERNAL_H_
14938 #define UPB_REFLECTION_ENUM_RESERVED_RANGE_INTERNAL_H_
14939 
14940 
14941 // IWYU pragma: private, include "upb/reflection/def.h"
14942 
14943 #ifndef UPB_REFLECTION_ENUM_RESERVED_RANGE_H_
14944 #define UPB_REFLECTION_ENUM_RESERVED_RANGE_H_
14945 
14946 
14947 // Must be last.
14948 
14949 #ifdef __cplusplus
14950 extern "C" {
14951 #endif
14952 
14953 int32_t upb_EnumReservedRange_Start(const upb_EnumReservedRange* r);
14954 int32_t upb_EnumReservedRange_End(const upb_EnumReservedRange* r);
14955 
14956 #ifdef __cplusplus
14957 } /* extern "C" */
14958 #endif
14959 
14960 
14961 #endif /* UPB_REFLECTION_ENUM_RESERVED_RANGE_H_ */
14962 
14963 // Must be last.
14964 
14965 #ifdef __cplusplus
14966 extern "C" {
14967 #endif
14968 
14969 upb_EnumReservedRange* _upb_EnumReservedRange_At(const upb_EnumReservedRange* r,
14970                                                  int i);
14971 
14972 // Allocate and initialize an array of |n| reserved ranges owned by |e|.
14973 upb_EnumReservedRange* _upb_EnumReservedRanges_New(
14974     upb_DefBuilder* ctx, int n,
14975     const UPB_DESC(EnumDescriptorProto_EnumReservedRange*) const* protos,
14976     const upb_EnumDef* e);
14977 
14978 #ifdef __cplusplus
14979 } /* extern "C" */
14980 #endif
14981 
14982 
14983 #endif /* UPB_REFLECTION_ENUM_RESERVED_RANGE_INTERNAL_H_ */
14984 
14985 #ifndef UPB_REFLECTION_INTERNAL_STRDUP2_H_
14986 #define UPB_REFLECTION_INTERNAL_STRDUP2_H_
14987 
14988 #include <stddef.h>
14989 
14990 
14991 // Must be last.
14992 
14993 #ifdef __cplusplus
14994 extern "C" {
14995 #endif
14996 
14997 // Variant that works with a length-delimited rather than NULL-delimited string,
14998 // as supported by strtable.
14999 char* upb_strdup2(const char* s, size_t len, upb_Arena* a);
15000 
15001 #ifdef __cplusplus
15002 } /* extern "C" */
15003 #endif
15004 
15005 
15006 #endif /* UPB_REFLECTION_INTERNAL_STRDUP2_H_ */
15007 
15008 #ifndef UPB_REFLECTION_EXTENSION_RANGE_INTERNAL_H_
15009 #define UPB_REFLECTION_EXTENSION_RANGE_INTERNAL_H_
15010 
15011 
15012 // Must be last.
15013 
15014 #ifdef __cplusplus
15015 extern "C" {
15016 #endif
15017 
15018 upb_ExtensionRange* _upb_ExtensionRange_At(const upb_ExtensionRange* r, int i);
15019 
15020 // Allocate and initialize an array of |n| extension ranges owned by |m|.
15021 upb_ExtensionRange* _upb_ExtensionRanges_New(
15022     upb_DefBuilder* ctx, int n,
15023     const UPB_DESC(DescriptorProto_ExtensionRange*) const* protos,
15024     const UPB_DESC(FeatureSet*) parent_features, const upb_MessageDef* m);
15025 
15026 #ifdef __cplusplus
15027 } /* extern "C" */
15028 #endif
15029 
15030 
15031 #endif /* UPB_REFLECTION_EXTENSION_RANGE_INTERNAL_H_ */
15032 
15033 #ifndef UPB_REFLECTION_ONEOF_DEF_INTERNAL_H_
15034 #define UPB_REFLECTION_ONEOF_DEF_INTERNAL_H_
15035 
15036 
15037 // Must be last.
15038 
15039 #ifdef __cplusplus
15040 extern "C" {
15041 #endif
15042 
15043 upb_OneofDef* _upb_OneofDef_At(const upb_OneofDef* o, int i);
15044 void _upb_OneofDef_Insert(upb_DefBuilder* ctx, upb_OneofDef* o,
15045                           const upb_FieldDef* f, const char* name, size_t size);
15046 
15047 // Allocate and initialize an array of |n| oneof defs owned by |m|.
15048 upb_OneofDef* _upb_OneofDefs_New(upb_DefBuilder* ctx, int n,
15049                                  const UPB_DESC(OneofDescriptorProto*)
15050                                      const* protos,
15051                                  const UPB_DESC(FeatureSet*) parent_features,
15052                                  upb_MessageDef* m);
15053 
15054 size_t _upb_OneofDefs_Finalize(upb_DefBuilder* ctx, upb_MessageDef* m);
15055 
15056 #ifdef __cplusplus
15057 } /* extern "C" */
15058 #endif
15059 
15060 
15061 #endif /* UPB_REFLECTION_ONEOF_DEF_INTERNAL_H_ */
15062 
15063 #ifndef UPB_REFLECTION_MESSAGE_RESERVED_RANGE_INTERNAL_H_
15064 #define UPB_REFLECTION_MESSAGE_RESERVED_RANGE_INTERNAL_H_
15065 
15066 
15067 // IWYU pragma: private, include "upb/reflection/def.h"
15068 
15069 #ifndef UPB_REFLECTION_MESSAGE_RESERVED_RANGE_H_
15070 #define UPB_REFLECTION_MESSAGE_RESERVED_RANGE_H_
15071 
15072 
15073 // Must be last.
15074 
15075 #ifdef __cplusplus
15076 extern "C" {
15077 #endif
15078 
15079 int32_t upb_MessageReservedRange_Start(const upb_MessageReservedRange* r);
15080 int32_t upb_MessageReservedRange_End(const upb_MessageReservedRange* r);
15081 
15082 #ifdef __cplusplus
15083 } /* extern "C" */
15084 #endif
15085 
15086 
15087 #endif /* UPB_REFLECTION_MESSAGE_RESERVED_RANGE_H_ */
15088 
15089 // Must be last.
15090 
15091 #ifdef __cplusplus
15092 extern "C" {
15093 #endif
15094 
15095 upb_MessageReservedRange* _upb_MessageReservedRange_At(
15096     const upb_MessageReservedRange* r, int i);
15097 
15098 // Allocate and initialize an array of |n| reserved ranges owned by |m|.
15099 upb_MessageReservedRange* _upb_MessageReservedRanges_New(
15100     upb_DefBuilder* ctx, int n,
15101     const UPB_DESC(DescriptorProto_ReservedRange) * const* protos,
15102     const upb_MessageDef* m);
15103 
15104 #ifdef __cplusplus
15105 } /* extern "C" */
15106 #endif
15107 
15108 
15109 #endif /* UPB_REFLECTION_MESSAGE_RESERVED_RANGE_INTERNAL_H_ */
15110 
15111 #ifndef UPB_REFLECTION_METHOD_DEF_INTERNAL_H_
15112 #define UPB_REFLECTION_METHOD_DEF_INTERNAL_H_
15113 
15114 
15115 // Must be last.
15116 
15117 #ifdef __cplusplus
15118 extern "C" {
15119 #endif
15120 
15121 upb_MethodDef* _upb_MethodDef_At(const upb_MethodDef* m, int i);
15122 
15123 // Allocate and initialize an array of |n| method defs owned by |s|.
15124 upb_MethodDef* _upb_MethodDefs_New(upb_DefBuilder* ctx, int n,
15125                                    const UPB_DESC(MethodDescriptorProto*)
15126                                        const* protos,
15127                                    const UPB_DESC(FeatureSet*) parent_features,
15128                                    upb_ServiceDef* s);
15129 
15130 #ifdef __cplusplus
15131 } /* extern "C" */
15132 #endif
15133 
15134 
15135 #endif /* UPB_REFLECTION_METHOD_DEF_INTERNAL_H_ */
15136 
15137 // This should #undef all macros #defined in def.inc
15138 
15139 #undef UPB_SIZE
15140 #undef UPB_PTR_AT
15141 #undef UPB_MAPTYPE_STRING
15142 #undef UPB_EXPORT
15143 #undef UPB_INLINE
15144 #undef UPB_API
15145 #undef UPBC_API
15146 #undef UPB_API_INLINE
15147 #undef UPB_ALIGN_UP
15148 #undef UPB_ALIGN_DOWN
15149 #undef UPB_ALIGN_MALLOC
15150 #undef UPB_ALIGN_OF
15151 #undef UPB_ALIGN_AS
15152 #undef UPB_MALLOC_ALIGN
15153 #undef UPB_LIKELY
15154 #undef UPB_UNLIKELY
15155 #undef UPB_FORCEINLINE
15156 #undef UPB_NOINLINE
15157 #undef UPB_NORETURN
15158 #undef UPB_PRINTF
15159 #undef UPB_MAX
15160 #undef UPB_MIN
15161 #undef UPB_UNUSED
15162 #undef UPB_ASSUME
15163 #undef UPB_ASSERT
15164 #undef UPB_UNREACHABLE
15165 #undef UPB_SETJMP
15166 #undef UPB_LONGJMP
15167 #undef UPB_PTRADD
15168 #undef UPB_MUSTTAIL
15169 #undef UPB_FASTTABLE_SUPPORTED
15170 #undef UPB_FASTTABLE_MASK
15171 #undef UPB_FASTTABLE
15172 #undef UPB_FASTTABLE_INIT
15173 #undef UPB_POISON_MEMORY_REGION
15174 #undef UPB_UNPOISON_MEMORY_REGION
15175 #undef UPB_ASAN
15176 #undef UPB_ASAN_GUARD_SIZE
15177 #undef UPB_CLANG_ASAN
15178 #undef UPB_TREAT_CLOSED_ENUMS_LIKE_OPEN
15179 #undef UPB_DEPRECATED
15180 #undef UPB_GNUC_MIN
15181 #undef UPB_DESCRIPTOR_UPB_H_FILENAME
15182 #undef UPB_DESC
15183 #undef UPB_DESC_MINITABLE
15184 #undef UPB_IS_GOOGLE3
15185 #undef UPB_ATOMIC
15186 #undef UPB_USE_C11_ATOMICS
15187 #undef UPB_PRIVATE
15188 #undef UPB_ONLYBITS
15189 #undef UPB_LINKARR_DECLARE
15190 #undef UPB_LINKARR_APPEND
15191 #undef UPB_LINKARR_START
15192 #undef UPB_LINKARR_STOP
15193 #undef UPB_FUTURE_BREAKING_CHANGES
15194 #undef UPB_FUTURE_PYTHON_CLOSED_ENUM_ENFORCEMENT
15195