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