1 /* Amalgamated source file */
2
3 // php.h intentionally defined NDEBUG. We have to define this macro in order to
4 // be used together with php.h
5 #ifndef NDEBUG
6 #define NDEBUG
7 #endif
8
9 #include <stdint.h>
10 #ifndef UINTPTR_MAX
11 #error must include stdint.h first
12 #endif
13
14 #if UINTPTR_MAX == 0xffffffff
15 #define UPB_SIZE(size32, size64) size32
16 #else
17 #define UPB_SIZE(size32, size64) size64
18 #endif
19
20 #define UPB_FIELD_AT(msg, fieldtype, offset) \
21 *(fieldtype*)((const char*)(msg) + offset)
22
23 #define UPB_READ_ONEOF(msg, fieldtype, offset, case_offset, case_val, default) \
24 UPB_FIELD_AT(msg, int, case_offset) == case_val \
25 ? UPB_FIELD_AT(msg, fieldtype, offset) \
26 : default
27
28 #define UPB_WRITE_ONEOF(msg, fieldtype, offset, value, case_offset, case_val) \
29 UPB_FIELD_AT(msg, int, case_offset) = case_val; \
30 UPB_FIELD_AT(msg, fieldtype, offset) = value;
31 /*
32 ** upb::Message is a representation for protobuf messages.
33 **
34 ** However it differs from other common representations like
35 ** google::protobuf::Message in one key way: it does not prescribe any
36 ** ownership between messages and submessages, and it relies on the
37 ** client to ensure that each submessage/array/map outlives its parent.
38 **
39 ** All messages, arrays, and maps live in an Arena. If the entire message
40 ** tree is in the same arena, ensuring proper lifetimes is simple. However
41 ** the client can mix arenas as long as they ensure that there are no
42 ** dangling pointers.
43 **
44 ** A client can access a upb::Message without knowing anything about
45 ** ownership semantics, but to create or mutate a message a user needs
46 ** to implement the memory management themselves.
47 **
48 ** TODO: UTF-8 checking?
49 **/
50
51 #ifndef UPB_MSG_H_
52 #define UPB_MSG_H_
53
54 #include <stdint.h>
55 #include <string.h>
56 /*
57 ** This file contains shared definitions that are widely used across upb.
58 **
59 ** This is a mixed C/C++ interface that offers a full API to both languages.
60 ** See the top-level README for more information.
61 */
62
63 #ifndef UPB_H_
64 #define UPB_H_
65
66 #include <assert.h>
67 #include <stdarg.h>
68 #include <stdbool.h>
69 #include <stddef.h>
70 #include <stdint.h>
71
72 #ifdef __cplusplus
73 #include <memory>
74 namespace upb {
75 class Arena;
76 class Status;
77 template <int N> class InlinedArena;
78 }
79 #endif
80
81 /* UPB_INLINE: inline if possible, emit standalone code if required. */
82 #ifdef __cplusplus
83 #define UPB_INLINE inline
84 #elif defined (__GNUC__)
85 #define UPB_INLINE static __inline__
86 #else
87 #define UPB_INLINE static
88 #endif
89
90 /* Hints to the compiler about likely/unlikely branches. */
91 #define UPB_LIKELY(x) __builtin_expect((x),1)
92
93 /* Define UPB_BIG_ENDIAN manually if you're on big endian and your compiler
94 * doesn't provide these preprocessor symbols. */
95 #if defined(__BYTE_ORDER__) && (__BYTE_ORDER__ == __ORDER_BIG_ENDIAN__)
96 #define UPB_BIG_ENDIAN
97 #endif
98
99 /* Macros for function attributes on compilers that support them. */
100 #ifdef __GNUC__
101 #define UPB_FORCEINLINE __inline__ __attribute__((always_inline))
102 #define UPB_NOINLINE __attribute__((noinline))
103 #define UPB_NORETURN __attribute__((__noreturn__))
104 #else /* !defined(__GNUC__) */
105 #define UPB_FORCEINLINE
106 #define UPB_NOINLINE
107 #define UPB_NORETURN
108 #endif
109
110 #if __STDC_VERSION__ >= 199901L || __cplusplus >= 201103L
111 /* C99/C++11 versions. */
112 #include <stdio.h>
113 #define _upb_snprintf snprintf
114 #define _upb_vsnprintf vsnprintf
115 #define _upb_va_copy(a, b) va_copy(a, b)
116 #elif defined __GNUC__
117 /* A few hacky workarounds for functions not in C89.
118 * For internal use only!
119 * TODO(haberman): fix these by including our own implementations, or finding
120 * another workaround.
121 */
122 #define _upb_snprintf __builtin_snprintf
123 #define _upb_vsnprintf __builtin_vsnprintf
124 #define _upb_va_copy(a, b) __va_copy(a, b)
125 #else
126 #error Need implementations of [v]snprintf and va_copy
127 #endif
128
129 #ifdef __cplusplus
130 #if __cplusplus >= 201103L || defined(__GXX_EXPERIMENTAL_CXX0X__) || \
131 (defined(_MSC_VER) && _MSC_VER >= 1900)
132 // C++11 is present
133 #else
134 #error upb requires C++11 for C++ support
135 #endif
136 #endif
137
138 #define UPB_MAX(x, y) ((x) > (y) ? (x) : (y))
139 #define UPB_MIN(x, y) ((x) < (y) ? (x) : (y))
140
141 #define UPB_UNUSED(var) (void)var
142
143 /* UPB_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 /* UPB_ASSERT_DEBUGVAR(): assert that uses functions or variables that only
152 * exist in debug mode. This turns into regular assert. */
153 #define UPB_ASSERT_DEBUGVAR(expr) assert(expr)
154
155 #ifdef __GNUC__
156 #define UPB_UNREACHABLE() do { assert(0); __builtin_unreachable(); } while(0)
157 #else
158 #define UPB_UNREACHABLE() do { assert(0); } while(0)
159 #endif
160
161 /* upb_status *****************************************************************/
162
163 /* upb_status represents a success or failure status and error message.
164 * It owns no resources and allocates no memory, so it should work
165 * even in OOM situations. */
166
167 /* The maximum length of an error message before it will get truncated. */
168 #define UPB_STATUS_MAX_MESSAGE 127
169
170 typedef struct {
171 bool ok;
172 char msg[UPB_STATUS_MAX_MESSAGE]; /* Error message; NULL-terminated. */
173 } upb_status;
174
175 #ifdef __cplusplus
176 extern "C" {
177 #endif
178
179 const char *upb_status_errmsg(const upb_status *status);
180 bool upb_ok(const upb_status *status);
181
182 /* Any of the functions that write to a status object allow status to be NULL,
183 * to support use cases where the function's caller does not care about the
184 * status message. */
185 void upb_status_clear(upb_status *status);
186 void upb_status_seterrmsg(upb_status *status, const char *msg);
187 void upb_status_seterrf(upb_status *status, const char *fmt, ...);
188 void upb_status_vseterrf(upb_status *status, const char *fmt, va_list args);
189
upb_status_setoom(upb_status * status)190 UPB_INLINE void upb_status_setoom(upb_status *status) {
191 upb_status_seterrmsg(status, "out of memory");
192 }
193
194 #ifdef __cplusplus
195 } /* extern "C" */
196
197 class upb::Status {
198 public:
Status()199 Status() { upb_status_clear(&status_); }
200
ptr()201 upb_status* ptr() { return &status_; }
202
203 /* Returns true if there is no error. */
ok()204 bool ok() const { return upb_ok(&status_); }
205
206 /* Guaranteed to be NULL-terminated. */
error_message()207 const char *error_message() const { return upb_status_errmsg(&status_); }
208
209 /* The error message will be truncated if it is longer than
210 * UPB_STATUS_MAX_MESSAGE-4. */
SetErrorMessage(const char * msg)211 void SetErrorMessage(const char *msg) { upb_status_seterrmsg(&status_, msg); }
SetFormattedErrorMessage(const char * fmt,...)212 void SetFormattedErrorMessage(const char *fmt, ...) {
213 va_list args;
214 va_start(args, fmt);
215 upb_status_vseterrf(&status_, fmt, args);
216 va_end(args);
217 }
218
219 /* Resets the status to a successful state with no message. */
Clear()220 void Clear() { upb_status_clear(&status_); }
221
222 private:
223 upb_status status_;
224 };
225
226 #endif /* __cplusplus */
227
228 /** upb_alloc *****************************************************************/
229
230 /* A upb_alloc is a possibly-stateful allocator object.
231 *
232 * It could either be an arena allocator (which doesn't require individual
233 * free() calls) or a regular malloc() (which does). The client must therefore
234 * free memory unless it knows that the allocator is an arena allocator. */
235
236 struct upb_alloc;
237 typedef struct upb_alloc upb_alloc;
238
239 /* A malloc()/free() function.
240 * If "size" is 0 then the function acts like free(), otherwise it acts like
241 * realloc(). Only "oldsize" bytes from a previous allocation are preserved. */
242 typedef void *upb_alloc_func(upb_alloc *alloc, void *ptr, size_t oldsize,
243 size_t size);
244
245 struct upb_alloc {
246 upb_alloc_func *func;
247 };
248
upb_malloc(upb_alloc * alloc,size_t size)249 UPB_INLINE void *upb_malloc(upb_alloc *alloc, size_t size) {
250 UPB_ASSERT(alloc);
251 return alloc->func(alloc, NULL, 0, size);
252 }
253
upb_realloc(upb_alloc * alloc,void * ptr,size_t oldsize,size_t size)254 UPB_INLINE void *upb_realloc(upb_alloc *alloc, void *ptr, size_t oldsize,
255 size_t size) {
256 UPB_ASSERT(alloc);
257 return alloc->func(alloc, ptr, oldsize, size);
258 }
259
upb_free(upb_alloc * alloc,void * ptr)260 UPB_INLINE void upb_free(upb_alloc *alloc, void *ptr) {
261 assert(alloc);
262 alloc->func(alloc, ptr, 0, 0);
263 }
264
265 /* The global allocator used by upb. Uses the standard malloc()/free(). */
266
267 extern upb_alloc upb_alloc_global;
268
269 /* Functions that hard-code the global malloc.
270 *
271 * We still get benefit because we can put custom logic into our global
272 * allocator, like injecting out-of-memory faults in debug/testing builds. */
273
upb_gmalloc(size_t size)274 UPB_INLINE void *upb_gmalloc(size_t size) {
275 return upb_malloc(&upb_alloc_global, size);
276 }
277
upb_grealloc(void * ptr,size_t oldsize,size_t size)278 UPB_INLINE void *upb_grealloc(void *ptr, size_t oldsize, size_t size) {
279 return upb_realloc(&upb_alloc_global, ptr, oldsize, size);
280 }
281
upb_gfree(void * ptr)282 UPB_INLINE void upb_gfree(void *ptr) {
283 upb_free(&upb_alloc_global, ptr);
284 }
285
286 /* upb_arena ******************************************************************/
287
288 /* upb_arena is a specific allocator implementation that uses arena allocation.
289 * The user provides an allocator that will be used to allocate the underlying
290 * arena blocks. Arenas by nature do not require the individual allocations
291 * to be freed. However the Arena does allow users to register cleanup
292 * functions that will run when the arena is destroyed.
293 *
294 * A upb_arena is *not* thread-safe.
295 *
296 * You could write a thread-safe arena allocator that satisfies the
297 * upb_alloc interface, but it would not be as efficient for the
298 * single-threaded case. */
299
300 typedef void upb_cleanup_func(void *ud);
301
302 struct upb_arena;
303 typedef struct upb_arena upb_arena;
304
305 #ifdef __cplusplus
306 extern "C" {
307 #endif
308
309 /* Creates an arena from the given initial block (if any -- n may be 0).
310 * Additional blocks will be allocated from |alloc|. If |alloc| is NULL, this
311 * is a fixed-size arena and cannot grow. */
312 upb_arena *upb_arena_init(void *mem, size_t n, upb_alloc *alloc);
313 void upb_arena_free(upb_arena *a);
314 bool upb_arena_addcleanup(upb_arena *a, void *ud, upb_cleanup_func *func);
315 size_t upb_arena_bytesallocated(const upb_arena *a);
316
upb_arena_alloc(upb_arena * a)317 UPB_INLINE upb_alloc *upb_arena_alloc(upb_arena *a) { return (upb_alloc*)a; }
318
319 /* Convenience wrappers around upb_alloc functions. */
320
upb_arena_malloc(upb_arena * a,size_t size)321 UPB_INLINE void *upb_arena_malloc(upb_arena *a, size_t size) {
322 return upb_malloc(upb_arena_alloc(a), size);
323 }
324
upb_arena_realloc(upb_arena * a,void * ptr,size_t oldsize,size_t size)325 UPB_INLINE void *upb_arena_realloc(upb_arena *a, void *ptr, size_t oldsize,
326 size_t size) {
327 return upb_realloc(upb_arena_alloc(a), ptr, oldsize, size);
328 }
329
upb_arena_new()330 UPB_INLINE upb_arena *upb_arena_new() {
331 return upb_arena_init(NULL, 0, &upb_alloc_global);
332 }
333
334 #ifdef __cplusplus
335 } /* extern "C" */
336
337 class upb::Arena {
338 public:
339 /* A simple arena with no initial memory block and the default allocator. */
Arena()340 Arena() : ptr_(upb_arena_new(), upb_arena_free) {}
341
ptr()342 upb_arena* ptr() { return ptr_.get(); }
343
344 /* Allows this arena to be used as a generic allocator.
345 *
346 * The arena does not need free() calls so when using Arena as an allocator
347 * it is safe to skip them. However they are no-ops so there is no harm in
348 * calling free() either. */
allocator()349 upb_alloc *allocator() { return upb_arena_alloc(ptr_.get()); }
350
351 /* Add a cleanup function to run when the arena is destroyed.
352 * Returns false on out-of-memory. */
AddCleanup(void * ud,upb_cleanup_func * func)353 bool AddCleanup(void *ud, upb_cleanup_func* func) {
354 return upb_arena_addcleanup(ptr_.get(), ud, func);
355 }
356
357 /* Total number of bytes that have been allocated. It is undefined what
358 * Realloc() does to &arena_ counter. */
BytesAllocated()359 size_t BytesAllocated() const { return upb_arena_bytesallocated(ptr_.get()); }
360
361 private:
362 std::unique_ptr<upb_arena, decltype(&upb_arena_free)> ptr_;
363 };
364
365 #endif
366
367 /* upb::InlinedArena **********************************************************/
368
369 /* upb::InlinedArena seeds the arenas with a predefined amount of memory. No
370 * heap memory will be allocated until the initial block is exceeded.
371 *
372 * These types only exist in C++ */
373
374 #ifdef __cplusplus
375
376 template <int N> class upb::InlinedArena : public upb::Arena {
377 public:
InlinedArena()378 InlinedArena() : ptr_(upb_arena_new(&initial_block_, N, &upb_alloc_global)) {}
379
ptr()380 upb_arena* ptr() { return ptr_.get(); }
381
382 private:
383 InlinedArena(const InlinedArena*) = delete;
384 InlinedArena& operator=(const InlinedArena*) = delete;
385
386 std::unique_ptr<upb_arena, decltype(&upb_arena_free)> ptr_;
387 char initial_block_[N];
388 };
389
390 #endif /* __cplusplus */
391
392 /* Constants ******************************************************************/
393
394 /* Generic function type. */
395 typedef void upb_func();
396
397 /* A list of types as they are encoded on-the-wire. */
398 typedef enum {
399 UPB_WIRE_TYPE_VARINT = 0,
400 UPB_WIRE_TYPE_64BIT = 1,
401 UPB_WIRE_TYPE_DELIMITED = 2,
402 UPB_WIRE_TYPE_START_GROUP = 3,
403 UPB_WIRE_TYPE_END_GROUP = 4,
404 UPB_WIRE_TYPE_32BIT = 5
405 } upb_wiretype_t;
406
407 /* The types a field can have. Note that this list is not identical to the
408 * types defined in descriptor.proto, which gives INT32 and SINT32 separate
409 * types (we distinguish the two with the "integer encoding" enum below). */
410 typedef enum {
411 /* Types stored in 1 byte. */
412 UPB_TYPE_BOOL = 1,
413 /* Types stored in 4 bytes. */
414 UPB_TYPE_FLOAT = 2,
415 UPB_TYPE_INT32 = 3,
416 UPB_TYPE_UINT32 = 4,
417 UPB_TYPE_ENUM = 5, /* Enum values are int32. */
418 /* Types stored as pointers (probably 4 or 8 bytes). */
419 UPB_TYPE_STRING = 6,
420 UPB_TYPE_BYTES = 7,
421 UPB_TYPE_MESSAGE = 8,
422 /* Types stored as 8 bytes. */
423 UPB_TYPE_DOUBLE = 9,
424 UPB_TYPE_INT64 = 10,
425 UPB_TYPE_UINT64 = 11
426 } upb_fieldtype_t;
427
428 /* The repeated-ness of each field; this matches descriptor.proto. */
429 typedef enum {
430 UPB_LABEL_OPTIONAL = 1,
431 UPB_LABEL_REQUIRED = 2,
432 UPB_LABEL_REPEATED = 3
433 } upb_label_t;
434
435 /* Descriptor types, as defined in descriptor.proto. */
436 typedef enum {
437 UPB_DESCRIPTOR_TYPE_DOUBLE = 1,
438 UPB_DESCRIPTOR_TYPE_FLOAT = 2,
439 UPB_DESCRIPTOR_TYPE_INT64 = 3,
440 UPB_DESCRIPTOR_TYPE_UINT64 = 4,
441 UPB_DESCRIPTOR_TYPE_INT32 = 5,
442 UPB_DESCRIPTOR_TYPE_FIXED64 = 6,
443 UPB_DESCRIPTOR_TYPE_FIXED32 = 7,
444 UPB_DESCRIPTOR_TYPE_BOOL = 8,
445 UPB_DESCRIPTOR_TYPE_STRING = 9,
446 UPB_DESCRIPTOR_TYPE_GROUP = 10,
447 UPB_DESCRIPTOR_TYPE_MESSAGE = 11,
448 UPB_DESCRIPTOR_TYPE_BYTES = 12,
449 UPB_DESCRIPTOR_TYPE_UINT32 = 13,
450 UPB_DESCRIPTOR_TYPE_ENUM = 14,
451 UPB_DESCRIPTOR_TYPE_SFIXED32 = 15,
452 UPB_DESCRIPTOR_TYPE_SFIXED64 = 16,
453 UPB_DESCRIPTOR_TYPE_SINT32 = 17,
454 UPB_DESCRIPTOR_TYPE_SINT64 = 18
455 } upb_descriptortype_t;
456
457 extern const uint8_t upb_desctype_to_fieldtype[];
458
459 #endif /* UPB_H_ */
460 /*
461 ** structs.int.h: structures definitions that are internal to upb.
462 */
463
464 #ifndef UPB_STRUCTS_H_
465 #define UPB_STRUCTS_H_
466
467
468 struct upb_array {
469 upb_fieldtype_t type;
470 uint8_t element_size;
471 void *data; /* Each element is element_size. */
472 size_t len; /* Measured in elements. */
473 size_t size; /* Measured in elements. */
474 upb_arena *arena;
475 };
476
477 #endif /* UPB_STRUCTS_H_ */
478
479
480 #ifdef __cplusplus
481
482 namespace upb {
483 class Array;
484 class Map;
485 class MapIterator;
486 class MessageLayout;
487 }
488
489 #endif
490
491 /* TODO(haberman): C++ accessors */
492
493 #ifdef __cplusplus
494 extern "C" {
495 #endif
496
497 typedef void upb_msg;
498
499 struct upb_array;
500 typedef struct upb_array upb_array;
501
502 struct upb_map;
503 typedef struct upb_map upb_map;
504
505 struct upb_mapiter;
506 typedef struct upb_mapiter upb_mapiter;
507
508 /** upb_msglayout *************************************************************/
509
510 /* upb_msglayout represents the memory layout of a given upb_msgdef. The
511 * members are public so generated code can initialize them, but users MUST NOT
512 * read or write any of its members. */
513
514 typedef struct {
515 uint32_t number;
516 uint16_t offset;
517 int16_t presence; /* If >0, hasbit_index+1. If <0, oneof_index+1. */
518 uint16_t submsg_index; /* undefined if descriptortype != MESSAGE or GROUP. */
519 uint8_t descriptortype;
520 uint8_t label;
521 } upb_msglayout_field;
522
523 typedef struct upb_msglayout {
524 const struct upb_msglayout *const* submsgs;
525 const upb_msglayout_field *fields;
526 /* Must be aligned to sizeof(void*). Doesn't include internal members like
527 * unknown fields, extension dict, pointer to msglayout, etc. */
528 uint16_t size;
529 uint16_t field_count;
530 bool extendable;
531 } upb_msglayout;
532
533 /** upb_strview ************************************************************/
534
535 typedef struct {
536 const char *data;
537 size_t size;
538 } upb_strview;
539
upb_strview_make(const char * data,size_t size)540 UPB_INLINE upb_strview upb_strview_make(const char *data, size_t size) {
541 upb_strview ret;
542 ret.data = data;
543 ret.size = size;
544 return ret;
545 }
546
upb_strview_makez(const char * data)547 UPB_INLINE upb_strview upb_strview_makez(const char *data) {
548 return upb_strview_make(data, strlen(data));
549 }
550
upb_strview_eql(upb_strview a,upb_strview b)551 UPB_INLINE bool upb_strview_eql(upb_strview a, upb_strview b) {
552 return a.size == b.size && memcmp(a.data, b.data, a.size) == 0;
553 }
554
555 #define UPB_STRVIEW_INIT(ptr, len) {ptr, len}
556
557 #define UPB_STRVIEW_FORMAT "%.*s"
558 #define UPB_STRVIEW_ARGS(view) (int)(view).size, (view).data
559
560 /** upb_msgval ****************************************************************/
561
562 /* A union representing all possible protobuf values. Used for generic get/set
563 * operations. */
564
565 typedef union {
566 bool b;
567 float flt;
568 double dbl;
569 int32_t i32;
570 int64_t i64;
571 uint32_t u32;
572 uint64_t u64;
573 const upb_map* map;
574 const upb_msg* msg;
575 const upb_array* arr;
576 const void* ptr;
577 upb_strview str;
578 } upb_msgval;
579
580 #define ACCESSORS(name, membername, ctype) \
581 UPB_INLINE ctype upb_msgval_get ## name(upb_msgval v) { \
582 return v.membername; \
583 } \
584 UPB_INLINE void upb_msgval_set ## name(upb_msgval *v, ctype cval) { \
585 v->membername = cval; \
586 } \
587 UPB_INLINE upb_msgval upb_msgval_ ## name(ctype v) { \
588 upb_msgval ret; \
589 ret.membername = v; \
590 return ret; \
591 }
592
ACCESSORS(bool,b,bool)593 ACCESSORS(bool, b, bool)
594 ACCESSORS(float, flt, float)
595 ACCESSORS(double, dbl, double)
596 ACCESSORS(int32, i32, int32_t)
597 ACCESSORS(int64, i64, int64_t)
598 ACCESSORS(uint32, u32, uint32_t)
599 ACCESSORS(uint64, u64, uint64_t)
600 ACCESSORS(map, map, const upb_map*)
601 ACCESSORS(msg, msg, const upb_msg*)
602 ACCESSORS(ptr, ptr, const void*)
603 ACCESSORS(arr, arr, const upb_array*)
604 ACCESSORS(str, str, upb_strview)
605
606 #undef ACCESSORS
607
608 UPB_INLINE upb_msgval upb_msgval_makestr(const char *data, size_t size) {
609 return upb_msgval_str(upb_strview_make(data, size));
610 }
611
612 /** upb_msg *******************************************************************/
613
614 /* A upb_msg represents a protobuf message. It always corresponds to a specific
615 * upb_msglayout, which describes how it is laid out in memory. */
616
617 /* Creates a new message of the given type/layout in this arena. */
618 upb_msg *upb_msg_new(const upb_msglayout *l, upb_arena *a);
619
620 /* Returns the arena for the given message. */
621 upb_arena *upb_msg_arena(const upb_msg *msg);
622
623 void upb_msg_addunknown(upb_msg *msg, const char *data, size_t len);
624 const char *upb_msg_getunknown(const upb_msg *msg, size_t *len);
625
626 /* Read-only message API. Can be safely called by anyone. */
627
628 /* Returns the value associated with this field:
629 * - for scalar fields (including strings), the value directly.
630 * - return upb_msg*, or upb_map* for msg/map.
631 * If the field is unset for these field types, returns NULL.
632 *
633 * TODO(haberman): should we let users store cached array/map/msg
634 * pointers here for fields that are unset? Could be useful for the
635 * strongly-owned submessage model (ie. generated C API that doesn't use
636 * arenas).
637 */
638 upb_msgval upb_msg_get(const upb_msg *msg,
639 int field_index,
640 const upb_msglayout *l);
641
642 /* May only be called for fields where upb_fielddef_haspresence(f) == true. */
643 bool upb_msg_has(const upb_msg *msg,
644 int field_index,
645 const upb_msglayout *l);
646
647 /* Mutable message API. May only be called by the owner of the message who
648 * knows its ownership scheme and how to keep it consistent. */
649
650 /* Sets the given field to the given value. Does not perform any memory
651 * management: if you overwrite a pointer to a msg/array/map/string without
652 * cleaning it up (or using an arena) it will leak.
653 */
654 void upb_msg_set(upb_msg *msg,
655 int field_index,
656 upb_msgval val,
657 const upb_msglayout *l);
658
659 /* For a primitive field, set it back to its default. For repeated, string, and
660 * submessage fields set it back to NULL. This could involve releasing some
661 * internal memory (for example, from an extension dictionary), but it is not
662 * recursive in any way and will not recover any memory that may be used by
663 * arrays/maps/strings/msgs that this field may have pointed to.
664 */
665 bool upb_msg_clearfield(upb_msg *msg,
666 int field_index,
667 const upb_msglayout *l);
668
669 /* TODO(haberman): copyfrom()/mergefrom()? */
670
671 /** upb_array *****************************************************************/
672
673 /* A upb_array stores data for a repeated field. The memory management
674 * semantics are the same as upb_msg. A upb_array allocates dynamic
675 * memory internally for the array elements. */
676
677 upb_array *upb_array_new(upb_fieldtype_t type, upb_arena *a);
678 upb_fieldtype_t upb_array_type(const upb_array *arr);
679
680 /* Read-only interface. Safe for anyone to call. */
681
682 size_t upb_array_size(const upb_array *arr);
683 upb_msgval upb_array_get(const upb_array *arr, size_t i);
684
685 /* Write interface. May only be called by the message's owner who can enforce
686 * its memory management invariants. */
687
688 bool upb_array_set(upb_array *arr, size_t i, upb_msgval val);
689
690 /** upb_map *******************************************************************/
691
692 /* A upb_map stores data for a map field. The memory management semantics are
693 * the same as upb_msg, with one notable exception. upb_map will internally
694 * store a copy of all string keys, but *not* any string values or submessages.
695 * So you must ensure that any string or message values outlive the map, and you
696 * must delete them manually when they are no longer required. */
697
698 upb_map *upb_map_new(upb_fieldtype_t ktype, upb_fieldtype_t vtype,
699 upb_arena *a);
700
701 /* Read-only interface. Safe for anyone to call. */
702
703 size_t upb_map_size(const upb_map *map);
704 upb_fieldtype_t upb_map_keytype(const upb_map *map);
705 upb_fieldtype_t upb_map_valuetype(const upb_map *map);
706 bool upb_map_get(const upb_map *map, upb_msgval key, upb_msgval *val);
707
708 /* Write interface. May only be called by the message's owner who can enforce
709 * its memory management invariants. */
710
711 /* Sets or overwrites an entry in the map. Return value indicates whether
712 * the operation succeeded or failed with OOM, and also whether an existing
713 * key was replaced or not. */
714 bool upb_map_set(upb_map *map,
715 upb_msgval key, upb_msgval val,
716 upb_msgval *valremoved);
717
718 /* Deletes an entry in the map. Returns true if the key was present. */
719 bool upb_map_del(upb_map *map, upb_msgval key);
720
721 /** upb_mapiter ***************************************************************/
722
723 /* For iterating over a map. Map iterators are invalidated by mutations to the
724 * map, but an invalidated iterator will never return junk or crash the process.
725 * An invalidated iterator may return entries that were already returned though,
726 * and if you keep invalidating the iterator during iteration, the program may
727 * enter an infinite loop. */
728
729 size_t upb_mapiter_sizeof();
730
731 void upb_mapiter_begin(upb_mapiter *i, const upb_map *t);
732 upb_mapiter *upb_mapiter_new(const upb_map *t, upb_alloc *a);
733 void upb_mapiter_free(upb_mapiter *i, upb_alloc *a);
734 void upb_mapiter_next(upb_mapiter *i);
735 bool upb_mapiter_done(const upb_mapiter *i);
736
737 upb_msgval upb_mapiter_key(const upb_mapiter *i);
738 upb_msgval upb_mapiter_value(const upb_mapiter *i);
739 void upb_mapiter_setdone(upb_mapiter *i);
740 bool upb_mapiter_isequal(const upb_mapiter *i1, const upb_mapiter *i2);
741
742 #ifdef __cplusplus
743 } /* extern "C" */
744 #endif
745
746 #endif /* UPB_MSG_H_ */
747 /* This file was generated by upbc (the upb compiler) from the input
748 * file:
749 *
750 * google/protobuf/descriptor.proto
751 *
752 * Do not edit -- your changes will be discarded when the file is
753 * regenerated. */
754
755 #ifndef GOOGLE_PROTOBUF_DESCRIPTOR_PROTO_UPB_H_
756 #define GOOGLE_PROTOBUF_DESCRIPTOR_PROTO_UPB_H_
757
758 /*
759 ** Functions for use by generated code. These are not public and users must
760 ** not call them directly.
761 */
762
763 #ifndef UPB_GENERATED_UTIL_H_
764 #define UPB_GENERATED_UTIL_H_
765
766 #include <stdint.h>
767
768 #define PTR_AT(msg, ofs, type) (type*)((const char*)msg + ofs)
769
_upb_array_accessor(const void * msg,size_t ofs,size_t * size)770 UPB_INLINE const void *_upb_array_accessor(const void *msg, size_t ofs,
771 size_t *size) {
772 const upb_array *arr = *PTR_AT(msg, ofs, const upb_array*);
773 if (arr) {
774 if (size) *size = arr->len;
775 return arr->data;
776 } else {
777 if (size) *size = 0;
778 return NULL;
779 }
780 }
781
_upb_array_mutable_accessor(void * msg,size_t ofs,size_t * size)782 UPB_INLINE void *_upb_array_mutable_accessor(void *msg, size_t ofs,
783 size_t *size) {
784 upb_array *arr = *PTR_AT(msg, ofs, upb_array*);
785 if (arr) {
786 if (size) *size = arr->len;
787 return arr->data;
788 } else {
789 if (size) *size = 0;
790 return NULL;
791 }
792 }
793
794 /* TODO(haberman): this is a mess. It will improve when upb_array no longer
795 * carries reflective state (type, elem_size). */
_upb_array_resize_accessor(void * msg,size_t ofs,size_t size,size_t elem_size,upb_fieldtype_t type,upb_arena * arena)796 UPB_INLINE void *_upb_array_resize_accessor(void *msg, size_t ofs, size_t size,
797 size_t elem_size,
798 upb_fieldtype_t type,
799 upb_arena *arena) {
800 upb_array *arr = *PTR_AT(msg, ofs, upb_array*);
801
802 if (!arr) {
803 arr = upb_array_new(type, arena);
804 if (!arr) return NULL;
805 *PTR_AT(msg, ofs, upb_array*) = arr;
806 }
807
808 if (size > arr->size) {
809 size_t new_size = UPB_MAX(arr->size, 4);
810 size_t old_bytes = arr->size * elem_size;
811 size_t new_bytes;
812 while (new_size < size) new_size *= 2;
813 new_bytes = new_size * elem_size;
814 arr->data = upb_arena_realloc(arena, arr->data, old_bytes, new_bytes);
815 if (!arr->data) {
816 return NULL;
817 }
818 arr->size = new_size;
819 }
820
821 arr->len = size;
822 return arr->data;
823 }
824
_upb_array_append_accessor(void * msg,size_t ofs,size_t elem_size,upb_fieldtype_t type,const void * value,upb_arena * arena)825 UPB_INLINE bool _upb_array_append_accessor(void *msg, size_t ofs,
826 size_t elem_size,
827 upb_fieldtype_t type,
828 const void *value,
829 upb_arena *arena) {
830 upb_array *arr = *PTR_AT(msg, ofs, upb_array*);
831 size_t i = arr ? arr->len : 0;
832 void *data =
833 _upb_array_resize_accessor(msg, ofs, i + 1, elem_size, type, arena);
834 if (!data) return false;
835 memcpy(PTR_AT(data, i * elem_size, char), value, elem_size);
836 return true;
837 }
838
_upb_has_field(const void * msg,size_t idx)839 UPB_INLINE bool _upb_has_field(const void *msg, size_t idx) {
840 return (*PTR_AT(msg, idx / 8, const char) & (1 << (idx % 8))) != 0;
841 }
842
_upb_sethas(const void * msg,size_t idx)843 UPB_INLINE bool _upb_sethas(const void *msg, size_t idx) {
844 return (*PTR_AT(msg, idx / 8, char)) |= (1 << (idx % 8));
845 }
846
_upb_clearhas(const void * msg,size_t idx)847 UPB_INLINE bool _upb_clearhas(const void *msg, size_t idx) {
848 return (*PTR_AT(msg, idx / 8, char)) &= ~(1 << (idx % 8));
849 }
850
_upb_has_oneof_field(const void * msg,size_t case_ofs,int32_t num)851 UPB_INLINE bool _upb_has_oneof_field(const void *msg, size_t case_ofs, int32_t num) {
852 return *PTR_AT(msg, case_ofs, int32_t) == num;
853 }
854
855 #undef PTR_AT
856
857 #endif /* UPB_GENERATED_UTIL_H_ */
858
859
860 /*
861 ** upb_decode: parsing into a upb_msg using a upb_msglayout.
862 */
863
864 #ifndef UPB_DECODE_H_
865 #define UPB_DECODE_H_
866
867
868 #ifdef __cplusplus
869 extern "C" {
870 #endif
871
872 bool upb_decode(const char *buf, size_t size, upb_msg *msg,
873 const upb_msglayout *l);
874
875 #ifdef __cplusplus
876 } /* extern "C" */
877 #endif
878
879 #endif /* UPB_DECODE_H_ */
880 /*
881 ** upb_encode: parsing into a upb_msg using a upb_msglayout.
882 */
883
884 #ifndef UPB_ENCODE_H_
885 #define UPB_ENCODE_H_
886
887
888 #ifdef __cplusplus
889 extern "C" {
890 #endif
891
892 char *upb_encode(const void *msg, const upb_msglayout *l, upb_arena *arena,
893 size_t *size);
894
895 #ifdef __cplusplus
896 } /* extern "C" */
897 #endif
898
899 #endif /* UPB_ENCODE_H_ */
900 #ifdef __cplusplus
901 extern "C" {
902 #endif
903
904 struct google_protobuf_FileDescriptorSet;
905 struct google_protobuf_FileDescriptorProto;
906 struct google_protobuf_DescriptorProto;
907 struct google_protobuf_DescriptorProto_ExtensionRange;
908 struct google_protobuf_DescriptorProto_ReservedRange;
909 struct google_protobuf_ExtensionRangeOptions;
910 struct google_protobuf_FieldDescriptorProto;
911 struct google_protobuf_OneofDescriptorProto;
912 struct google_protobuf_EnumDescriptorProto;
913 struct google_protobuf_EnumDescriptorProto_EnumReservedRange;
914 struct google_protobuf_EnumValueDescriptorProto;
915 struct google_protobuf_ServiceDescriptorProto;
916 struct google_protobuf_MethodDescriptorProto;
917 struct google_protobuf_FileOptions;
918 struct google_protobuf_MessageOptions;
919 struct google_protobuf_FieldOptions;
920 struct google_protobuf_OneofOptions;
921 struct google_protobuf_EnumOptions;
922 struct google_protobuf_EnumValueOptions;
923 struct google_protobuf_ServiceOptions;
924 struct google_protobuf_MethodOptions;
925 struct google_protobuf_UninterpretedOption;
926 struct google_protobuf_UninterpretedOption_NamePart;
927 struct google_protobuf_SourceCodeInfo;
928 struct google_protobuf_SourceCodeInfo_Location;
929 struct google_protobuf_GeneratedCodeInfo;
930 struct google_protobuf_GeneratedCodeInfo_Annotation;
931 typedef struct google_protobuf_FileDescriptorSet google_protobuf_FileDescriptorSet;
932 typedef struct google_protobuf_FileDescriptorProto google_protobuf_FileDescriptorProto;
933 typedef struct google_protobuf_DescriptorProto google_protobuf_DescriptorProto;
934 typedef struct google_protobuf_DescriptorProto_ExtensionRange google_protobuf_DescriptorProto_ExtensionRange;
935 typedef struct google_protobuf_DescriptorProto_ReservedRange google_protobuf_DescriptorProto_ReservedRange;
936 typedef struct google_protobuf_ExtensionRangeOptions google_protobuf_ExtensionRangeOptions;
937 typedef struct google_protobuf_FieldDescriptorProto google_protobuf_FieldDescriptorProto;
938 typedef struct google_protobuf_OneofDescriptorProto google_protobuf_OneofDescriptorProto;
939 typedef struct google_protobuf_EnumDescriptorProto google_protobuf_EnumDescriptorProto;
940 typedef struct google_protobuf_EnumDescriptorProto_EnumReservedRange google_protobuf_EnumDescriptorProto_EnumReservedRange;
941 typedef struct google_protobuf_EnumValueDescriptorProto google_protobuf_EnumValueDescriptorProto;
942 typedef struct google_protobuf_ServiceDescriptorProto google_protobuf_ServiceDescriptorProto;
943 typedef struct google_protobuf_MethodDescriptorProto google_protobuf_MethodDescriptorProto;
944 typedef struct google_protobuf_FileOptions google_protobuf_FileOptions;
945 typedef struct google_protobuf_MessageOptions google_protobuf_MessageOptions;
946 typedef struct google_protobuf_FieldOptions google_protobuf_FieldOptions;
947 typedef struct google_protobuf_OneofOptions google_protobuf_OneofOptions;
948 typedef struct google_protobuf_EnumOptions google_protobuf_EnumOptions;
949 typedef struct google_protobuf_EnumValueOptions google_protobuf_EnumValueOptions;
950 typedef struct google_protobuf_ServiceOptions google_protobuf_ServiceOptions;
951 typedef struct google_protobuf_MethodOptions google_protobuf_MethodOptions;
952 typedef struct google_protobuf_UninterpretedOption google_protobuf_UninterpretedOption;
953 typedef struct google_protobuf_UninterpretedOption_NamePart google_protobuf_UninterpretedOption_NamePart;
954 typedef struct google_protobuf_SourceCodeInfo google_protobuf_SourceCodeInfo;
955 typedef struct google_protobuf_SourceCodeInfo_Location google_protobuf_SourceCodeInfo_Location;
956 typedef struct google_protobuf_GeneratedCodeInfo google_protobuf_GeneratedCodeInfo;
957 typedef struct google_protobuf_GeneratedCodeInfo_Annotation google_protobuf_GeneratedCodeInfo_Annotation;
958 extern const upb_msglayout google_protobuf_FileDescriptorSet_msginit;
959 extern const upb_msglayout google_protobuf_FileDescriptorProto_msginit;
960 extern const upb_msglayout google_protobuf_DescriptorProto_msginit;
961 extern const upb_msglayout google_protobuf_DescriptorProto_ExtensionRange_msginit;
962 extern const upb_msglayout google_protobuf_DescriptorProto_ReservedRange_msginit;
963 extern const upb_msglayout google_protobuf_ExtensionRangeOptions_msginit;
964 extern const upb_msglayout google_protobuf_FieldDescriptorProto_msginit;
965 extern const upb_msglayout google_protobuf_OneofDescriptorProto_msginit;
966 extern const upb_msglayout google_protobuf_EnumDescriptorProto_msginit;
967 extern const upb_msglayout google_protobuf_EnumDescriptorProto_EnumReservedRange_msginit;
968 extern const upb_msglayout google_protobuf_EnumValueDescriptorProto_msginit;
969 extern const upb_msglayout google_protobuf_ServiceDescriptorProto_msginit;
970 extern const upb_msglayout google_protobuf_MethodDescriptorProto_msginit;
971 extern const upb_msglayout google_protobuf_FileOptions_msginit;
972 extern const upb_msglayout google_protobuf_MessageOptions_msginit;
973 extern const upb_msglayout google_protobuf_FieldOptions_msginit;
974 extern const upb_msglayout google_protobuf_OneofOptions_msginit;
975 extern const upb_msglayout google_protobuf_EnumOptions_msginit;
976 extern const upb_msglayout google_protobuf_EnumValueOptions_msginit;
977 extern const upb_msglayout google_protobuf_ServiceOptions_msginit;
978 extern const upb_msglayout google_protobuf_MethodOptions_msginit;
979 extern const upb_msglayout google_protobuf_UninterpretedOption_msginit;
980 extern const upb_msglayout google_protobuf_UninterpretedOption_NamePart_msginit;
981 extern const upb_msglayout google_protobuf_SourceCodeInfo_msginit;
982 extern const upb_msglayout google_protobuf_SourceCodeInfo_Location_msginit;
983 extern const upb_msglayout google_protobuf_GeneratedCodeInfo_msginit;
984 extern const upb_msglayout google_protobuf_GeneratedCodeInfo_Annotation_msginit;
985
986 /* Enums */
987
988 typedef enum {
989 google_protobuf_FieldDescriptorProto_LABEL_OPTIONAL = 1,
990 google_protobuf_FieldDescriptorProto_LABEL_REQUIRED = 2,
991 google_protobuf_FieldDescriptorProto_LABEL_REPEATED = 3
992 } google_protobuf_FieldDescriptorProto_Label;
993
994 typedef enum {
995 google_protobuf_FieldDescriptorProto_TYPE_DOUBLE = 1,
996 google_protobuf_FieldDescriptorProto_TYPE_FLOAT = 2,
997 google_protobuf_FieldDescriptorProto_TYPE_INT64 = 3,
998 google_protobuf_FieldDescriptorProto_TYPE_UINT64 = 4,
999 google_protobuf_FieldDescriptorProto_TYPE_INT32 = 5,
1000 google_protobuf_FieldDescriptorProto_TYPE_FIXED64 = 6,
1001 google_protobuf_FieldDescriptorProto_TYPE_FIXED32 = 7,
1002 google_protobuf_FieldDescriptorProto_TYPE_BOOL = 8,
1003 google_protobuf_FieldDescriptorProto_TYPE_STRING = 9,
1004 google_protobuf_FieldDescriptorProto_TYPE_GROUP = 10,
1005 google_protobuf_FieldDescriptorProto_TYPE_MESSAGE = 11,
1006 google_protobuf_FieldDescriptorProto_TYPE_BYTES = 12,
1007 google_protobuf_FieldDescriptorProto_TYPE_UINT32 = 13,
1008 google_protobuf_FieldDescriptorProto_TYPE_ENUM = 14,
1009 google_protobuf_FieldDescriptorProto_TYPE_SFIXED32 = 15,
1010 google_protobuf_FieldDescriptorProto_TYPE_SFIXED64 = 16,
1011 google_protobuf_FieldDescriptorProto_TYPE_SINT32 = 17,
1012 google_protobuf_FieldDescriptorProto_TYPE_SINT64 = 18
1013 } google_protobuf_FieldDescriptorProto_Type;
1014
1015 typedef enum {
1016 google_protobuf_FieldOptions_STRING = 0,
1017 google_protobuf_FieldOptions_CORD = 1,
1018 google_protobuf_FieldOptions_STRING_PIECE = 2
1019 } google_protobuf_FieldOptions_CType;
1020
1021 typedef enum {
1022 google_protobuf_FieldOptions_JS_NORMAL = 0,
1023 google_protobuf_FieldOptions_JS_STRING = 1,
1024 google_protobuf_FieldOptions_JS_NUMBER = 2
1025 } google_protobuf_FieldOptions_JSType;
1026
1027 typedef enum {
1028 google_protobuf_FileOptions_SPEED = 1,
1029 google_protobuf_FileOptions_CODE_SIZE = 2,
1030 google_protobuf_FileOptions_LITE_RUNTIME = 3
1031 } google_protobuf_FileOptions_OptimizeMode;
1032
1033 typedef enum {
1034 google_protobuf_MethodOptions_IDEMPOTENCY_UNKNOWN = 0,
1035 google_protobuf_MethodOptions_NO_SIDE_EFFECTS = 1,
1036 google_protobuf_MethodOptions_IDEMPOTENT = 2
1037 } google_protobuf_MethodOptions_IdempotencyLevel;
1038
1039
1040 /* google.protobuf.FileDescriptorSet */
1041
google_protobuf_FileDescriptorSet_new(upb_arena * arena)1042 UPB_INLINE google_protobuf_FileDescriptorSet *google_protobuf_FileDescriptorSet_new(upb_arena *arena) {
1043 return (google_protobuf_FileDescriptorSet *)upb_msg_new(&google_protobuf_FileDescriptorSet_msginit, arena);
1044 }
google_protobuf_FileDescriptorSet_parse(const char * buf,size_t size,upb_arena * arena)1045 UPB_INLINE google_protobuf_FileDescriptorSet *google_protobuf_FileDescriptorSet_parse(const char *buf, size_t size,
1046 upb_arena *arena) {
1047 google_protobuf_FileDescriptorSet *ret = google_protobuf_FileDescriptorSet_new(arena);
1048 return (ret && upb_decode(buf, size, ret, &google_protobuf_FileDescriptorSet_msginit)) ? ret : NULL;
1049 }
google_protobuf_FileDescriptorSet_serialize(const google_protobuf_FileDescriptorSet * msg,upb_arena * arena,size_t * len)1050 UPB_INLINE char *google_protobuf_FileDescriptorSet_serialize(const google_protobuf_FileDescriptorSet *msg, upb_arena *arena, size_t *len) {
1051 return upb_encode(msg, &google_protobuf_FileDescriptorSet_msginit, arena, len);
1052 }
1053
google_protobuf_FileDescriptorSet_file(const google_protobuf_FileDescriptorSet * msg,size_t * len)1054 UPB_INLINE const google_protobuf_FileDescriptorProto* const* google_protobuf_FileDescriptorSet_file(const google_protobuf_FileDescriptorSet *msg, size_t *len) { return (const google_protobuf_FileDescriptorProto* const*)_upb_array_accessor(msg, UPB_SIZE(0, 0), len); }
1055
google_protobuf_FileDescriptorSet_mutable_file(google_protobuf_FileDescriptorSet * msg,size_t * len)1056 UPB_INLINE google_protobuf_FileDescriptorProto** google_protobuf_FileDescriptorSet_mutable_file(google_protobuf_FileDescriptorSet *msg, size_t *len) {
1057 return (google_protobuf_FileDescriptorProto**)_upb_array_mutable_accessor(msg, UPB_SIZE(0, 0), len);
1058 }
google_protobuf_FileDescriptorSet_resize_file(google_protobuf_FileDescriptorSet * msg,size_t len,upb_arena * arena)1059 UPB_INLINE google_protobuf_FileDescriptorProto** google_protobuf_FileDescriptorSet_resize_file(google_protobuf_FileDescriptorSet *msg, size_t len, upb_arena *arena) {
1060 return (google_protobuf_FileDescriptorProto**)_upb_array_resize_accessor(msg, UPB_SIZE(0, 0), len, UPB_SIZE(4, 8), UPB_TYPE_MESSAGE, arena);
1061 }
google_protobuf_FileDescriptorSet_add_file(google_protobuf_FileDescriptorSet * msg,upb_arena * arena)1062 UPB_INLINE struct google_protobuf_FileDescriptorProto* google_protobuf_FileDescriptorSet_add_file(google_protobuf_FileDescriptorSet *msg, upb_arena *arena) {
1063 struct google_protobuf_FileDescriptorProto* sub = (struct google_protobuf_FileDescriptorProto*)upb_msg_new(&google_protobuf_FileDescriptorProto_msginit, arena);
1064 bool ok = _upb_array_append_accessor(
1065 msg, UPB_SIZE(0, 0), UPB_SIZE(4, 8), UPB_TYPE_MESSAGE, &sub, arena);
1066 if (!ok) return NULL;
1067 return sub;
1068 }
1069
1070
1071 /* google.protobuf.FileDescriptorProto */
1072
google_protobuf_FileDescriptorProto_new(upb_arena * arena)1073 UPB_INLINE google_protobuf_FileDescriptorProto *google_protobuf_FileDescriptorProto_new(upb_arena *arena) {
1074 return (google_protobuf_FileDescriptorProto *)upb_msg_new(&google_protobuf_FileDescriptorProto_msginit, arena);
1075 }
google_protobuf_FileDescriptorProto_parse(const char * buf,size_t size,upb_arena * arena)1076 UPB_INLINE google_protobuf_FileDescriptorProto *google_protobuf_FileDescriptorProto_parse(const char *buf, size_t size,
1077 upb_arena *arena) {
1078 google_protobuf_FileDescriptorProto *ret = google_protobuf_FileDescriptorProto_new(arena);
1079 return (ret && upb_decode(buf, size, ret, &google_protobuf_FileDescriptorProto_msginit)) ? ret : NULL;
1080 }
google_protobuf_FileDescriptorProto_serialize(const google_protobuf_FileDescriptorProto * msg,upb_arena * arena,size_t * len)1081 UPB_INLINE char *google_protobuf_FileDescriptorProto_serialize(const google_protobuf_FileDescriptorProto *msg, upb_arena *arena, size_t *len) {
1082 return upb_encode(msg, &google_protobuf_FileDescriptorProto_msginit, arena, len);
1083 }
1084
google_protobuf_FileDescriptorProto_has_name(const google_protobuf_FileDescriptorProto * msg)1085 UPB_INLINE bool google_protobuf_FileDescriptorProto_has_name(const google_protobuf_FileDescriptorProto *msg) { return _upb_has_field(msg, 1); }
google_protobuf_FileDescriptorProto_name(const google_protobuf_FileDescriptorProto * msg)1086 UPB_INLINE upb_strview google_protobuf_FileDescriptorProto_name(const google_protobuf_FileDescriptorProto *msg) { return UPB_FIELD_AT(msg, upb_strview, UPB_SIZE(4, 8)); }
google_protobuf_FileDescriptorProto_has_package(const google_protobuf_FileDescriptorProto * msg)1087 UPB_INLINE bool google_protobuf_FileDescriptorProto_has_package(const google_protobuf_FileDescriptorProto *msg) { return _upb_has_field(msg, 2); }
google_protobuf_FileDescriptorProto_package(const google_protobuf_FileDescriptorProto * msg)1088 UPB_INLINE upb_strview google_protobuf_FileDescriptorProto_package(const google_protobuf_FileDescriptorProto *msg) { return UPB_FIELD_AT(msg, upb_strview, UPB_SIZE(12, 24)); }
google_protobuf_FileDescriptorProto_dependency(const google_protobuf_FileDescriptorProto * msg,size_t * len)1089 UPB_INLINE upb_strview const* google_protobuf_FileDescriptorProto_dependency(const google_protobuf_FileDescriptorProto *msg, size_t *len) { return (upb_strview const*)_upb_array_accessor(msg, UPB_SIZE(36, 72), len); }
google_protobuf_FileDescriptorProto_message_type(const google_protobuf_FileDescriptorProto * msg,size_t * len)1090 UPB_INLINE const google_protobuf_DescriptorProto* const* google_protobuf_FileDescriptorProto_message_type(const google_protobuf_FileDescriptorProto *msg, size_t *len) { return (const google_protobuf_DescriptorProto* const*)_upb_array_accessor(msg, UPB_SIZE(40, 80), len); }
google_protobuf_FileDescriptorProto_enum_type(const google_protobuf_FileDescriptorProto * msg,size_t * len)1091 UPB_INLINE const google_protobuf_EnumDescriptorProto* const* google_protobuf_FileDescriptorProto_enum_type(const google_protobuf_FileDescriptorProto *msg, size_t *len) { return (const google_protobuf_EnumDescriptorProto* const*)_upb_array_accessor(msg, UPB_SIZE(44, 88), len); }
google_protobuf_FileDescriptorProto_service(const google_protobuf_FileDescriptorProto * msg,size_t * len)1092 UPB_INLINE const google_protobuf_ServiceDescriptorProto* const* google_protobuf_FileDescriptorProto_service(const google_protobuf_FileDescriptorProto *msg, size_t *len) { return (const google_protobuf_ServiceDescriptorProto* const*)_upb_array_accessor(msg, UPB_SIZE(48, 96), len); }
google_protobuf_FileDescriptorProto_extension(const google_protobuf_FileDescriptorProto * msg,size_t * len)1093 UPB_INLINE const google_protobuf_FieldDescriptorProto* const* google_protobuf_FileDescriptorProto_extension(const google_protobuf_FileDescriptorProto *msg, size_t *len) { return (const google_protobuf_FieldDescriptorProto* const*)_upb_array_accessor(msg, UPB_SIZE(52, 104), len); }
google_protobuf_FileDescriptorProto_has_options(const google_protobuf_FileDescriptorProto * msg)1094 UPB_INLINE bool google_protobuf_FileDescriptorProto_has_options(const google_protobuf_FileDescriptorProto *msg) { return _upb_has_field(msg, 4); }
google_protobuf_FileDescriptorProto_options(const google_protobuf_FileDescriptorProto * msg)1095 UPB_INLINE const google_protobuf_FileOptions* google_protobuf_FileDescriptorProto_options(const google_protobuf_FileDescriptorProto *msg) { return UPB_FIELD_AT(msg, const google_protobuf_FileOptions*, UPB_SIZE(28, 56)); }
google_protobuf_FileDescriptorProto_has_source_code_info(const google_protobuf_FileDescriptorProto * msg)1096 UPB_INLINE bool google_protobuf_FileDescriptorProto_has_source_code_info(const google_protobuf_FileDescriptorProto *msg) { return _upb_has_field(msg, 5); }
google_protobuf_FileDescriptorProto_source_code_info(const google_protobuf_FileDescriptorProto * msg)1097 UPB_INLINE const google_protobuf_SourceCodeInfo* google_protobuf_FileDescriptorProto_source_code_info(const google_protobuf_FileDescriptorProto *msg) { return UPB_FIELD_AT(msg, const google_protobuf_SourceCodeInfo*, UPB_SIZE(32, 64)); }
google_protobuf_FileDescriptorProto_public_dependency(const google_protobuf_FileDescriptorProto * msg,size_t * len)1098 UPB_INLINE int32_t const* google_protobuf_FileDescriptorProto_public_dependency(const google_protobuf_FileDescriptorProto *msg, size_t *len) { return (int32_t const*)_upb_array_accessor(msg, UPB_SIZE(56, 112), len); }
google_protobuf_FileDescriptorProto_weak_dependency(const google_protobuf_FileDescriptorProto * msg,size_t * len)1099 UPB_INLINE int32_t const* google_protobuf_FileDescriptorProto_weak_dependency(const google_protobuf_FileDescriptorProto *msg, size_t *len) { return (int32_t const*)_upb_array_accessor(msg, UPB_SIZE(60, 120), len); }
google_protobuf_FileDescriptorProto_has_syntax(const google_protobuf_FileDescriptorProto * msg)1100 UPB_INLINE bool google_protobuf_FileDescriptorProto_has_syntax(const google_protobuf_FileDescriptorProto *msg) { return _upb_has_field(msg, 3); }
google_protobuf_FileDescriptorProto_syntax(const google_protobuf_FileDescriptorProto * msg)1101 UPB_INLINE upb_strview google_protobuf_FileDescriptorProto_syntax(const google_protobuf_FileDescriptorProto *msg) { return UPB_FIELD_AT(msg, upb_strview, UPB_SIZE(20, 40)); }
1102
google_protobuf_FileDescriptorProto_set_name(google_protobuf_FileDescriptorProto * msg,upb_strview value)1103 UPB_INLINE void google_protobuf_FileDescriptorProto_set_name(google_protobuf_FileDescriptorProto *msg, upb_strview value) {
1104 _upb_sethas(msg, 1);
1105 UPB_FIELD_AT(msg, upb_strview, UPB_SIZE(4, 8)) = value;
1106 }
google_protobuf_FileDescriptorProto_set_package(google_protobuf_FileDescriptorProto * msg,upb_strview value)1107 UPB_INLINE void google_protobuf_FileDescriptorProto_set_package(google_protobuf_FileDescriptorProto *msg, upb_strview value) {
1108 _upb_sethas(msg, 2);
1109 UPB_FIELD_AT(msg, upb_strview, UPB_SIZE(12, 24)) = value;
1110 }
google_protobuf_FileDescriptorProto_mutable_dependency(google_protobuf_FileDescriptorProto * msg,size_t * len)1111 UPB_INLINE upb_strview* google_protobuf_FileDescriptorProto_mutable_dependency(google_protobuf_FileDescriptorProto *msg, size_t *len) {
1112 return (upb_strview*)_upb_array_mutable_accessor(msg, UPB_SIZE(36, 72), len);
1113 }
google_protobuf_FileDescriptorProto_resize_dependency(google_protobuf_FileDescriptorProto * msg,size_t len,upb_arena * arena)1114 UPB_INLINE upb_strview* google_protobuf_FileDescriptorProto_resize_dependency(google_protobuf_FileDescriptorProto *msg, size_t len, upb_arena *arena) {
1115 return (upb_strview*)_upb_array_resize_accessor(msg, UPB_SIZE(36, 72), len, UPB_SIZE(8, 16), UPB_TYPE_STRING, arena);
1116 }
google_protobuf_FileDescriptorProto_add_dependency(google_protobuf_FileDescriptorProto * msg,upb_strview val,upb_arena * arena)1117 UPB_INLINE bool google_protobuf_FileDescriptorProto_add_dependency(google_protobuf_FileDescriptorProto *msg, upb_strview val, upb_arena *arena) {
1118 return _upb_array_append_accessor(
1119 msg, UPB_SIZE(36, 72), UPB_SIZE(8, 16), UPB_TYPE_STRING, &val, arena);
1120 }
google_protobuf_FileDescriptorProto_mutable_message_type(google_protobuf_FileDescriptorProto * msg,size_t * len)1121 UPB_INLINE google_protobuf_DescriptorProto** google_protobuf_FileDescriptorProto_mutable_message_type(google_protobuf_FileDescriptorProto *msg, size_t *len) {
1122 return (google_protobuf_DescriptorProto**)_upb_array_mutable_accessor(msg, UPB_SIZE(40, 80), len);
1123 }
google_protobuf_FileDescriptorProto_resize_message_type(google_protobuf_FileDescriptorProto * msg,size_t len,upb_arena * arena)1124 UPB_INLINE google_protobuf_DescriptorProto** google_protobuf_FileDescriptorProto_resize_message_type(google_protobuf_FileDescriptorProto *msg, size_t len, upb_arena *arena) {
1125 return (google_protobuf_DescriptorProto**)_upb_array_resize_accessor(msg, UPB_SIZE(40, 80), len, UPB_SIZE(4, 8), UPB_TYPE_MESSAGE, arena);
1126 }
google_protobuf_FileDescriptorProto_add_message_type(google_protobuf_FileDescriptorProto * msg,upb_arena * arena)1127 UPB_INLINE struct google_protobuf_DescriptorProto* google_protobuf_FileDescriptorProto_add_message_type(google_protobuf_FileDescriptorProto *msg, upb_arena *arena) {
1128 struct google_protobuf_DescriptorProto* sub = (struct google_protobuf_DescriptorProto*)upb_msg_new(&google_protobuf_DescriptorProto_msginit, arena);
1129 bool ok = _upb_array_append_accessor(
1130 msg, UPB_SIZE(40, 80), UPB_SIZE(4, 8), UPB_TYPE_MESSAGE, &sub, arena);
1131 if (!ok) return NULL;
1132 return sub;
1133 }
google_protobuf_FileDescriptorProto_mutable_enum_type(google_protobuf_FileDescriptorProto * msg,size_t * len)1134 UPB_INLINE google_protobuf_EnumDescriptorProto** google_protobuf_FileDescriptorProto_mutable_enum_type(google_protobuf_FileDescriptorProto *msg, size_t *len) {
1135 return (google_protobuf_EnumDescriptorProto**)_upb_array_mutable_accessor(msg, UPB_SIZE(44, 88), len);
1136 }
google_protobuf_FileDescriptorProto_resize_enum_type(google_protobuf_FileDescriptorProto * msg,size_t len,upb_arena * arena)1137 UPB_INLINE google_protobuf_EnumDescriptorProto** google_protobuf_FileDescriptorProto_resize_enum_type(google_protobuf_FileDescriptorProto *msg, size_t len, upb_arena *arena) {
1138 return (google_protobuf_EnumDescriptorProto**)_upb_array_resize_accessor(msg, UPB_SIZE(44, 88), len, UPB_SIZE(4, 8), UPB_TYPE_MESSAGE, arena);
1139 }
google_protobuf_FileDescriptorProto_add_enum_type(google_protobuf_FileDescriptorProto * msg,upb_arena * arena)1140 UPB_INLINE struct google_protobuf_EnumDescriptorProto* google_protobuf_FileDescriptorProto_add_enum_type(google_protobuf_FileDescriptorProto *msg, upb_arena *arena) {
1141 struct google_protobuf_EnumDescriptorProto* sub = (struct google_protobuf_EnumDescriptorProto*)upb_msg_new(&google_protobuf_EnumDescriptorProto_msginit, arena);
1142 bool ok = _upb_array_append_accessor(
1143 msg, UPB_SIZE(44, 88), UPB_SIZE(4, 8), UPB_TYPE_MESSAGE, &sub, arena);
1144 if (!ok) return NULL;
1145 return sub;
1146 }
google_protobuf_FileDescriptorProto_mutable_service(google_protobuf_FileDescriptorProto * msg,size_t * len)1147 UPB_INLINE google_protobuf_ServiceDescriptorProto** google_protobuf_FileDescriptorProto_mutable_service(google_protobuf_FileDescriptorProto *msg, size_t *len) {
1148 return (google_protobuf_ServiceDescriptorProto**)_upb_array_mutable_accessor(msg, UPB_SIZE(48, 96), len);
1149 }
google_protobuf_FileDescriptorProto_resize_service(google_protobuf_FileDescriptorProto * msg,size_t len,upb_arena * arena)1150 UPB_INLINE google_protobuf_ServiceDescriptorProto** google_protobuf_FileDescriptorProto_resize_service(google_protobuf_FileDescriptorProto *msg, size_t len, upb_arena *arena) {
1151 return (google_protobuf_ServiceDescriptorProto**)_upb_array_resize_accessor(msg, UPB_SIZE(48, 96), len, UPB_SIZE(4, 8), UPB_TYPE_MESSAGE, arena);
1152 }
google_protobuf_FileDescriptorProto_add_service(google_protobuf_FileDescriptorProto * msg,upb_arena * arena)1153 UPB_INLINE struct google_protobuf_ServiceDescriptorProto* google_protobuf_FileDescriptorProto_add_service(google_protobuf_FileDescriptorProto *msg, upb_arena *arena) {
1154 struct google_protobuf_ServiceDescriptorProto* sub = (struct google_protobuf_ServiceDescriptorProto*)upb_msg_new(&google_protobuf_ServiceDescriptorProto_msginit, arena);
1155 bool ok = _upb_array_append_accessor(
1156 msg, UPB_SIZE(48, 96), UPB_SIZE(4, 8), UPB_TYPE_MESSAGE, &sub, arena);
1157 if (!ok) return NULL;
1158 return sub;
1159 }
google_protobuf_FileDescriptorProto_mutable_extension(google_protobuf_FileDescriptorProto * msg,size_t * len)1160 UPB_INLINE google_protobuf_FieldDescriptorProto** google_protobuf_FileDescriptorProto_mutable_extension(google_protobuf_FileDescriptorProto *msg, size_t *len) {
1161 return (google_protobuf_FieldDescriptorProto**)_upb_array_mutable_accessor(msg, UPB_SIZE(52, 104), len);
1162 }
google_protobuf_FileDescriptorProto_resize_extension(google_protobuf_FileDescriptorProto * msg,size_t len,upb_arena * arena)1163 UPB_INLINE google_protobuf_FieldDescriptorProto** google_protobuf_FileDescriptorProto_resize_extension(google_protobuf_FileDescriptorProto *msg, size_t len, upb_arena *arena) {
1164 return (google_protobuf_FieldDescriptorProto**)_upb_array_resize_accessor(msg, UPB_SIZE(52, 104), len, UPB_SIZE(4, 8), UPB_TYPE_MESSAGE, arena);
1165 }
google_protobuf_FileDescriptorProto_add_extension(google_protobuf_FileDescriptorProto * msg,upb_arena * arena)1166 UPB_INLINE struct google_protobuf_FieldDescriptorProto* google_protobuf_FileDescriptorProto_add_extension(google_protobuf_FileDescriptorProto *msg, upb_arena *arena) {
1167 struct google_protobuf_FieldDescriptorProto* sub = (struct google_protobuf_FieldDescriptorProto*)upb_msg_new(&google_protobuf_FieldDescriptorProto_msginit, arena);
1168 bool ok = _upb_array_append_accessor(
1169 msg, UPB_SIZE(52, 104), UPB_SIZE(4, 8), UPB_TYPE_MESSAGE, &sub, arena);
1170 if (!ok) return NULL;
1171 return sub;
1172 }
google_protobuf_FileDescriptorProto_set_options(google_protobuf_FileDescriptorProto * msg,google_protobuf_FileOptions * value)1173 UPB_INLINE void google_protobuf_FileDescriptorProto_set_options(google_protobuf_FileDescriptorProto *msg, google_protobuf_FileOptions* value) {
1174 _upb_sethas(msg, 4);
1175 UPB_FIELD_AT(msg, google_protobuf_FileOptions*, UPB_SIZE(28, 56)) = value;
1176 }
google_protobuf_FileDescriptorProto_mutable_options(google_protobuf_FileDescriptorProto * msg,upb_arena * arena)1177 UPB_INLINE struct google_protobuf_FileOptions* google_protobuf_FileDescriptorProto_mutable_options(google_protobuf_FileDescriptorProto *msg, upb_arena *arena) {
1178 struct google_protobuf_FileOptions* sub = (struct google_protobuf_FileOptions*)google_protobuf_FileDescriptorProto_options(msg);
1179 if (sub == NULL) {
1180 sub = (struct google_protobuf_FileOptions*)upb_msg_new(&google_protobuf_FileOptions_msginit, arena);
1181 if (!sub) return NULL;
1182 google_protobuf_FileDescriptorProto_set_options(msg, sub);
1183 }
1184 return sub;
1185 }
google_protobuf_FileDescriptorProto_set_source_code_info(google_protobuf_FileDescriptorProto * msg,google_protobuf_SourceCodeInfo * value)1186 UPB_INLINE void google_protobuf_FileDescriptorProto_set_source_code_info(google_protobuf_FileDescriptorProto *msg, google_protobuf_SourceCodeInfo* value) {
1187 _upb_sethas(msg, 5);
1188 UPB_FIELD_AT(msg, google_protobuf_SourceCodeInfo*, UPB_SIZE(32, 64)) = value;
1189 }
google_protobuf_FileDescriptorProto_mutable_source_code_info(google_protobuf_FileDescriptorProto * msg,upb_arena * arena)1190 UPB_INLINE struct google_protobuf_SourceCodeInfo* google_protobuf_FileDescriptorProto_mutable_source_code_info(google_protobuf_FileDescriptorProto *msg, upb_arena *arena) {
1191 struct google_protobuf_SourceCodeInfo* sub = (struct google_protobuf_SourceCodeInfo*)google_protobuf_FileDescriptorProto_source_code_info(msg);
1192 if (sub == NULL) {
1193 sub = (struct google_protobuf_SourceCodeInfo*)upb_msg_new(&google_protobuf_SourceCodeInfo_msginit, arena);
1194 if (!sub) return NULL;
1195 google_protobuf_FileDescriptorProto_set_source_code_info(msg, sub);
1196 }
1197 return sub;
1198 }
google_protobuf_FileDescriptorProto_mutable_public_dependency(google_protobuf_FileDescriptorProto * msg,size_t * len)1199 UPB_INLINE int32_t* google_protobuf_FileDescriptorProto_mutable_public_dependency(google_protobuf_FileDescriptorProto *msg, size_t *len) {
1200 return (int32_t*)_upb_array_mutable_accessor(msg, UPB_SIZE(56, 112), len);
1201 }
google_protobuf_FileDescriptorProto_resize_public_dependency(google_protobuf_FileDescriptorProto * msg,size_t len,upb_arena * arena)1202 UPB_INLINE int32_t* google_protobuf_FileDescriptorProto_resize_public_dependency(google_protobuf_FileDescriptorProto *msg, size_t len, upb_arena *arena) {
1203 return (int32_t*)_upb_array_resize_accessor(msg, UPB_SIZE(56, 112), len, UPB_SIZE(4, 4), UPB_TYPE_INT32, arena);
1204 }
google_protobuf_FileDescriptorProto_add_public_dependency(google_protobuf_FileDescriptorProto * msg,int32_t val,upb_arena * arena)1205 UPB_INLINE bool google_protobuf_FileDescriptorProto_add_public_dependency(google_protobuf_FileDescriptorProto *msg, int32_t val, upb_arena *arena) {
1206 return _upb_array_append_accessor(
1207 msg, UPB_SIZE(56, 112), UPB_SIZE(4, 4), UPB_TYPE_INT32, &val, arena);
1208 }
google_protobuf_FileDescriptorProto_mutable_weak_dependency(google_protobuf_FileDescriptorProto * msg,size_t * len)1209 UPB_INLINE int32_t* google_protobuf_FileDescriptorProto_mutable_weak_dependency(google_protobuf_FileDescriptorProto *msg, size_t *len) {
1210 return (int32_t*)_upb_array_mutable_accessor(msg, UPB_SIZE(60, 120), len);
1211 }
google_protobuf_FileDescriptorProto_resize_weak_dependency(google_protobuf_FileDescriptorProto * msg,size_t len,upb_arena * arena)1212 UPB_INLINE int32_t* google_protobuf_FileDescriptorProto_resize_weak_dependency(google_protobuf_FileDescriptorProto *msg, size_t len, upb_arena *arena) {
1213 return (int32_t*)_upb_array_resize_accessor(msg, UPB_SIZE(60, 120), len, UPB_SIZE(4, 4), UPB_TYPE_INT32, arena);
1214 }
google_protobuf_FileDescriptorProto_add_weak_dependency(google_protobuf_FileDescriptorProto * msg,int32_t val,upb_arena * arena)1215 UPB_INLINE bool google_protobuf_FileDescriptorProto_add_weak_dependency(google_protobuf_FileDescriptorProto *msg, int32_t val, upb_arena *arena) {
1216 return _upb_array_append_accessor(
1217 msg, UPB_SIZE(60, 120), UPB_SIZE(4, 4), UPB_TYPE_INT32, &val, arena);
1218 }
google_protobuf_FileDescriptorProto_set_syntax(google_protobuf_FileDescriptorProto * msg,upb_strview value)1219 UPB_INLINE void google_protobuf_FileDescriptorProto_set_syntax(google_protobuf_FileDescriptorProto *msg, upb_strview value) {
1220 _upb_sethas(msg, 3);
1221 UPB_FIELD_AT(msg, upb_strview, UPB_SIZE(20, 40)) = value;
1222 }
1223
1224
1225 /* google.protobuf.DescriptorProto */
1226
google_protobuf_DescriptorProto_new(upb_arena * arena)1227 UPB_INLINE google_protobuf_DescriptorProto *google_protobuf_DescriptorProto_new(upb_arena *arena) {
1228 return (google_protobuf_DescriptorProto *)upb_msg_new(&google_protobuf_DescriptorProto_msginit, arena);
1229 }
google_protobuf_DescriptorProto_parse(const char * buf,size_t size,upb_arena * arena)1230 UPB_INLINE google_protobuf_DescriptorProto *google_protobuf_DescriptorProto_parse(const char *buf, size_t size,
1231 upb_arena *arena) {
1232 google_protobuf_DescriptorProto *ret = google_protobuf_DescriptorProto_new(arena);
1233 return (ret && upb_decode(buf, size, ret, &google_protobuf_DescriptorProto_msginit)) ? ret : NULL;
1234 }
google_protobuf_DescriptorProto_serialize(const google_protobuf_DescriptorProto * msg,upb_arena * arena,size_t * len)1235 UPB_INLINE char *google_protobuf_DescriptorProto_serialize(const google_protobuf_DescriptorProto *msg, upb_arena *arena, size_t *len) {
1236 return upb_encode(msg, &google_protobuf_DescriptorProto_msginit, arena, len);
1237 }
1238
google_protobuf_DescriptorProto_has_name(const google_protobuf_DescriptorProto * msg)1239 UPB_INLINE bool google_protobuf_DescriptorProto_has_name(const google_protobuf_DescriptorProto *msg) { return _upb_has_field(msg, 1); }
google_protobuf_DescriptorProto_name(const google_protobuf_DescriptorProto * msg)1240 UPB_INLINE upb_strview google_protobuf_DescriptorProto_name(const google_protobuf_DescriptorProto *msg) { return UPB_FIELD_AT(msg, upb_strview, UPB_SIZE(4, 8)); }
google_protobuf_DescriptorProto_field(const google_protobuf_DescriptorProto * msg,size_t * len)1241 UPB_INLINE const google_protobuf_FieldDescriptorProto* const* google_protobuf_DescriptorProto_field(const google_protobuf_DescriptorProto *msg, size_t *len) { return (const google_protobuf_FieldDescriptorProto* const*)_upb_array_accessor(msg, UPB_SIZE(16, 32), len); }
google_protobuf_DescriptorProto_nested_type(const google_protobuf_DescriptorProto * msg,size_t * len)1242 UPB_INLINE const google_protobuf_DescriptorProto* const* google_protobuf_DescriptorProto_nested_type(const google_protobuf_DescriptorProto *msg, size_t *len) { return (const google_protobuf_DescriptorProto* const*)_upb_array_accessor(msg, UPB_SIZE(20, 40), len); }
google_protobuf_DescriptorProto_enum_type(const google_protobuf_DescriptorProto * msg,size_t * len)1243 UPB_INLINE const google_protobuf_EnumDescriptorProto* const* google_protobuf_DescriptorProto_enum_type(const google_protobuf_DescriptorProto *msg, size_t *len) { return (const google_protobuf_EnumDescriptorProto* const*)_upb_array_accessor(msg, UPB_SIZE(24, 48), len); }
google_protobuf_DescriptorProto_extension_range(const google_protobuf_DescriptorProto * msg,size_t * len)1244 UPB_INLINE const google_protobuf_DescriptorProto_ExtensionRange* const* google_protobuf_DescriptorProto_extension_range(const google_protobuf_DescriptorProto *msg, size_t *len) { return (const google_protobuf_DescriptorProto_ExtensionRange* const*)_upb_array_accessor(msg, UPB_SIZE(28, 56), len); }
google_protobuf_DescriptorProto_extension(const google_protobuf_DescriptorProto * msg,size_t * len)1245 UPB_INLINE const google_protobuf_FieldDescriptorProto* const* google_protobuf_DescriptorProto_extension(const google_protobuf_DescriptorProto *msg, size_t *len) { return (const google_protobuf_FieldDescriptorProto* const*)_upb_array_accessor(msg, UPB_SIZE(32, 64), len); }
google_protobuf_DescriptorProto_has_options(const google_protobuf_DescriptorProto * msg)1246 UPB_INLINE bool google_protobuf_DescriptorProto_has_options(const google_protobuf_DescriptorProto *msg) { return _upb_has_field(msg, 2); }
google_protobuf_DescriptorProto_options(const google_protobuf_DescriptorProto * msg)1247 UPB_INLINE const google_protobuf_MessageOptions* google_protobuf_DescriptorProto_options(const google_protobuf_DescriptorProto *msg) { return UPB_FIELD_AT(msg, const google_protobuf_MessageOptions*, UPB_SIZE(12, 24)); }
google_protobuf_DescriptorProto_oneof_decl(const google_protobuf_DescriptorProto * msg,size_t * len)1248 UPB_INLINE const google_protobuf_OneofDescriptorProto* const* google_protobuf_DescriptorProto_oneof_decl(const google_protobuf_DescriptorProto *msg, size_t *len) { return (const google_protobuf_OneofDescriptorProto* const*)_upb_array_accessor(msg, UPB_SIZE(36, 72), len); }
google_protobuf_DescriptorProto_reserved_range(const google_protobuf_DescriptorProto * msg,size_t * len)1249 UPB_INLINE const google_protobuf_DescriptorProto_ReservedRange* const* google_protobuf_DescriptorProto_reserved_range(const google_protobuf_DescriptorProto *msg, size_t *len) { return (const google_protobuf_DescriptorProto_ReservedRange* const*)_upb_array_accessor(msg, UPB_SIZE(40, 80), len); }
google_protobuf_DescriptorProto_reserved_name(const google_protobuf_DescriptorProto * msg,size_t * len)1250 UPB_INLINE upb_strview const* google_protobuf_DescriptorProto_reserved_name(const google_protobuf_DescriptorProto *msg, size_t *len) { return (upb_strview const*)_upb_array_accessor(msg, UPB_SIZE(44, 88), len); }
1251
google_protobuf_DescriptorProto_set_name(google_protobuf_DescriptorProto * msg,upb_strview value)1252 UPB_INLINE void google_protobuf_DescriptorProto_set_name(google_protobuf_DescriptorProto *msg, upb_strview value) {
1253 _upb_sethas(msg, 1);
1254 UPB_FIELD_AT(msg, upb_strview, UPB_SIZE(4, 8)) = value;
1255 }
google_protobuf_DescriptorProto_mutable_field(google_protobuf_DescriptorProto * msg,size_t * len)1256 UPB_INLINE google_protobuf_FieldDescriptorProto** google_protobuf_DescriptorProto_mutable_field(google_protobuf_DescriptorProto *msg, size_t *len) {
1257 return (google_protobuf_FieldDescriptorProto**)_upb_array_mutable_accessor(msg, UPB_SIZE(16, 32), len);
1258 }
google_protobuf_DescriptorProto_resize_field(google_protobuf_DescriptorProto * msg,size_t len,upb_arena * arena)1259 UPB_INLINE google_protobuf_FieldDescriptorProto** google_protobuf_DescriptorProto_resize_field(google_protobuf_DescriptorProto *msg, size_t len, upb_arena *arena) {
1260 return (google_protobuf_FieldDescriptorProto**)_upb_array_resize_accessor(msg, UPB_SIZE(16, 32), len, UPB_SIZE(4, 8), UPB_TYPE_MESSAGE, arena);
1261 }
google_protobuf_DescriptorProto_add_field(google_protobuf_DescriptorProto * msg,upb_arena * arena)1262 UPB_INLINE struct google_protobuf_FieldDescriptorProto* google_protobuf_DescriptorProto_add_field(google_protobuf_DescriptorProto *msg, upb_arena *arena) {
1263 struct google_protobuf_FieldDescriptorProto* sub = (struct google_protobuf_FieldDescriptorProto*)upb_msg_new(&google_protobuf_FieldDescriptorProto_msginit, arena);
1264 bool ok = _upb_array_append_accessor(
1265 msg, UPB_SIZE(16, 32), UPB_SIZE(4, 8), UPB_TYPE_MESSAGE, &sub, arena);
1266 if (!ok) return NULL;
1267 return sub;
1268 }
google_protobuf_DescriptorProto_mutable_nested_type(google_protobuf_DescriptorProto * msg,size_t * len)1269 UPB_INLINE google_protobuf_DescriptorProto** google_protobuf_DescriptorProto_mutable_nested_type(google_protobuf_DescriptorProto *msg, size_t *len) {
1270 return (google_protobuf_DescriptorProto**)_upb_array_mutable_accessor(msg, UPB_SIZE(20, 40), len);
1271 }
google_protobuf_DescriptorProto_resize_nested_type(google_protobuf_DescriptorProto * msg,size_t len,upb_arena * arena)1272 UPB_INLINE google_protobuf_DescriptorProto** google_protobuf_DescriptorProto_resize_nested_type(google_protobuf_DescriptorProto *msg, size_t len, upb_arena *arena) {
1273 return (google_protobuf_DescriptorProto**)_upb_array_resize_accessor(msg, UPB_SIZE(20, 40), len, UPB_SIZE(4, 8), UPB_TYPE_MESSAGE, arena);
1274 }
google_protobuf_DescriptorProto_add_nested_type(google_protobuf_DescriptorProto * msg,upb_arena * arena)1275 UPB_INLINE struct google_protobuf_DescriptorProto* google_protobuf_DescriptorProto_add_nested_type(google_protobuf_DescriptorProto *msg, upb_arena *arena) {
1276 struct google_protobuf_DescriptorProto* sub = (struct google_protobuf_DescriptorProto*)upb_msg_new(&google_protobuf_DescriptorProto_msginit, arena);
1277 bool ok = _upb_array_append_accessor(
1278 msg, UPB_SIZE(20, 40), UPB_SIZE(4, 8), UPB_TYPE_MESSAGE, &sub, arena);
1279 if (!ok) return NULL;
1280 return sub;
1281 }
google_protobuf_DescriptorProto_mutable_enum_type(google_protobuf_DescriptorProto * msg,size_t * len)1282 UPB_INLINE google_protobuf_EnumDescriptorProto** google_protobuf_DescriptorProto_mutable_enum_type(google_protobuf_DescriptorProto *msg, size_t *len) {
1283 return (google_protobuf_EnumDescriptorProto**)_upb_array_mutable_accessor(msg, UPB_SIZE(24, 48), len);
1284 }
google_protobuf_DescriptorProto_resize_enum_type(google_protobuf_DescriptorProto * msg,size_t len,upb_arena * arena)1285 UPB_INLINE google_protobuf_EnumDescriptorProto** google_protobuf_DescriptorProto_resize_enum_type(google_protobuf_DescriptorProto *msg, size_t len, upb_arena *arena) {
1286 return (google_protobuf_EnumDescriptorProto**)_upb_array_resize_accessor(msg, UPB_SIZE(24, 48), len, UPB_SIZE(4, 8), UPB_TYPE_MESSAGE, arena);
1287 }
google_protobuf_DescriptorProto_add_enum_type(google_protobuf_DescriptorProto * msg,upb_arena * arena)1288 UPB_INLINE struct google_protobuf_EnumDescriptorProto* google_protobuf_DescriptorProto_add_enum_type(google_protobuf_DescriptorProto *msg, upb_arena *arena) {
1289 struct google_protobuf_EnumDescriptorProto* sub = (struct google_protobuf_EnumDescriptorProto*)upb_msg_new(&google_protobuf_EnumDescriptorProto_msginit, arena);
1290 bool ok = _upb_array_append_accessor(
1291 msg, UPB_SIZE(24, 48), UPB_SIZE(4, 8), UPB_TYPE_MESSAGE, &sub, arena);
1292 if (!ok) return NULL;
1293 return sub;
1294 }
google_protobuf_DescriptorProto_mutable_extension_range(google_protobuf_DescriptorProto * msg,size_t * len)1295 UPB_INLINE google_protobuf_DescriptorProto_ExtensionRange** google_protobuf_DescriptorProto_mutable_extension_range(google_protobuf_DescriptorProto *msg, size_t *len) {
1296 return (google_protobuf_DescriptorProto_ExtensionRange**)_upb_array_mutable_accessor(msg, UPB_SIZE(28, 56), len);
1297 }
google_protobuf_DescriptorProto_resize_extension_range(google_protobuf_DescriptorProto * msg,size_t len,upb_arena * arena)1298 UPB_INLINE google_protobuf_DescriptorProto_ExtensionRange** google_protobuf_DescriptorProto_resize_extension_range(google_protobuf_DescriptorProto *msg, size_t len, upb_arena *arena) {
1299 return (google_protobuf_DescriptorProto_ExtensionRange**)_upb_array_resize_accessor(msg, UPB_SIZE(28, 56), len, UPB_SIZE(4, 8), UPB_TYPE_MESSAGE, arena);
1300 }
google_protobuf_DescriptorProto_add_extension_range(google_protobuf_DescriptorProto * msg,upb_arena * arena)1301 UPB_INLINE struct google_protobuf_DescriptorProto_ExtensionRange* google_protobuf_DescriptorProto_add_extension_range(google_protobuf_DescriptorProto *msg, upb_arena *arena) {
1302 struct google_protobuf_DescriptorProto_ExtensionRange* sub = (struct google_protobuf_DescriptorProto_ExtensionRange*)upb_msg_new(&google_protobuf_DescriptorProto_ExtensionRange_msginit, arena);
1303 bool ok = _upb_array_append_accessor(
1304 msg, UPB_SIZE(28, 56), UPB_SIZE(4, 8), UPB_TYPE_MESSAGE, &sub, arena);
1305 if (!ok) return NULL;
1306 return sub;
1307 }
google_protobuf_DescriptorProto_mutable_extension(google_protobuf_DescriptorProto * msg,size_t * len)1308 UPB_INLINE google_protobuf_FieldDescriptorProto** google_protobuf_DescriptorProto_mutable_extension(google_protobuf_DescriptorProto *msg, size_t *len) {
1309 return (google_protobuf_FieldDescriptorProto**)_upb_array_mutable_accessor(msg, UPB_SIZE(32, 64), len);
1310 }
google_protobuf_DescriptorProto_resize_extension(google_protobuf_DescriptorProto * msg,size_t len,upb_arena * arena)1311 UPB_INLINE google_protobuf_FieldDescriptorProto** google_protobuf_DescriptorProto_resize_extension(google_protobuf_DescriptorProto *msg, size_t len, upb_arena *arena) {
1312 return (google_protobuf_FieldDescriptorProto**)_upb_array_resize_accessor(msg, UPB_SIZE(32, 64), len, UPB_SIZE(4, 8), UPB_TYPE_MESSAGE, arena);
1313 }
google_protobuf_DescriptorProto_add_extension(google_protobuf_DescriptorProto * msg,upb_arena * arena)1314 UPB_INLINE struct google_protobuf_FieldDescriptorProto* google_protobuf_DescriptorProto_add_extension(google_protobuf_DescriptorProto *msg, upb_arena *arena) {
1315 struct google_protobuf_FieldDescriptorProto* sub = (struct google_protobuf_FieldDescriptorProto*)upb_msg_new(&google_protobuf_FieldDescriptorProto_msginit, arena);
1316 bool ok = _upb_array_append_accessor(
1317 msg, UPB_SIZE(32, 64), UPB_SIZE(4, 8), UPB_TYPE_MESSAGE, &sub, arena);
1318 if (!ok) return NULL;
1319 return sub;
1320 }
google_protobuf_DescriptorProto_set_options(google_protobuf_DescriptorProto * msg,google_protobuf_MessageOptions * value)1321 UPB_INLINE void google_protobuf_DescriptorProto_set_options(google_protobuf_DescriptorProto *msg, google_protobuf_MessageOptions* value) {
1322 _upb_sethas(msg, 2);
1323 UPB_FIELD_AT(msg, google_protobuf_MessageOptions*, UPB_SIZE(12, 24)) = value;
1324 }
google_protobuf_DescriptorProto_mutable_options(google_protobuf_DescriptorProto * msg,upb_arena * arena)1325 UPB_INLINE struct google_protobuf_MessageOptions* google_protobuf_DescriptorProto_mutable_options(google_protobuf_DescriptorProto *msg, upb_arena *arena) {
1326 struct google_protobuf_MessageOptions* sub = (struct google_protobuf_MessageOptions*)google_protobuf_DescriptorProto_options(msg);
1327 if (sub == NULL) {
1328 sub = (struct google_protobuf_MessageOptions*)upb_msg_new(&google_protobuf_MessageOptions_msginit, arena);
1329 if (!sub) return NULL;
1330 google_protobuf_DescriptorProto_set_options(msg, sub);
1331 }
1332 return sub;
1333 }
google_protobuf_DescriptorProto_mutable_oneof_decl(google_protobuf_DescriptorProto * msg,size_t * len)1334 UPB_INLINE google_protobuf_OneofDescriptorProto** google_protobuf_DescriptorProto_mutable_oneof_decl(google_protobuf_DescriptorProto *msg, size_t *len) {
1335 return (google_protobuf_OneofDescriptorProto**)_upb_array_mutable_accessor(msg, UPB_SIZE(36, 72), len);
1336 }
google_protobuf_DescriptorProto_resize_oneof_decl(google_protobuf_DescriptorProto * msg,size_t len,upb_arena * arena)1337 UPB_INLINE google_protobuf_OneofDescriptorProto** google_protobuf_DescriptorProto_resize_oneof_decl(google_protobuf_DescriptorProto *msg, size_t len, upb_arena *arena) {
1338 return (google_protobuf_OneofDescriptorProto**)_upb_array_resize_accessor(msg, UPB_SIZE(36, 72), len, UPB_SIZE(4, 8), UPB_TYPE_MESSAGE, arena);
1339 }
google_protobuf_DescriptorProto_add_oneof_decl(google_protobuf_DescriptorProto * msg,upb_arena * arena)1340 UPB_INLINE struct google_protobuf_OneofDescriptorProto* google_protobuf_DescriptorProto_add_oneof_decl(google_protobuf_DescriptorProto *msg, upb_arena *arena) {
1341 struct google_protobuf_OneofDescriptorProto* sub = (struct google_protobuf_OneofDescriptorProto*)upb_msg_new(&google_protobuf_OneofDescriptorProto_msginit, arena);
1342 bool ok = _upb_array_append_accessor(
1343 msg, UPB_SIZE(36, 72), UPB_SIZE(4, 8), UPB_TYPE_MESSAGE, &sub, arena);
1344 if (!ok) return NULL;
1345 return sub;
1346 }
google_protobuf_DescriptorProto_mutable_reserved_range(google_protobuf_DescriptorProto * msg,size_t * len)1347 UPB_INLINE google_protobuf_DescriptorProto_ReservedRange** google_protobuf_DescriptorProto_mutable_reserved_range(google_protobuf_DescriptorProto *msg, size_t *len) {
1348 return (google_protobuf_DescriptorProto_ReservedRange**)_upb_array_mutable_accessor(msg, UPB_SIZE(40, 80), len);
1349 }
google_protobuf_DescriptorProto_resize_reserved_range(google_protobuf_DescriptorProto * msg,size_t len,upb_arena * arena)1350 UPB_INLINE google_protobuf_DescriptorProto_ReservedRange** google_protobuf_DescriptorProto_resize_reserved_range(google_protobuf_DescriptorProto *msg, size_t len, upb_arena *arena) {
1351 return (google_protobuf_DescriptorProto_ReservedRange**)_upb_array_resize_accessor(msg, UPB_SIZE(40, 80), len, UPB_SIZE(4, 8), UPB_TYPE_MESSAGE, arena);
1352 }
google_protobuf_DescriptorProto_add_reserved_range(google_protobuf_DescriptorProto * msg,upb_arena * arena)1353 UPB_INLINE struct google_protobuf_DescriptorProto_ReservedRange* google_protobuf_DescriptorProto_add_reserved_range(google_protobuf_DescriptorProto *msg, upb_arena *arena) {
1354 struct google_protobuf_DescriptorProto_ReservedRange* sub = (struct google_protobuf_DescriptorProto_ReservedRange*)upb_msg_new(&google_protobuf_DescriptorProto_ReservedRange_msginit, arena);
1355 bool ok = _upb_array_append_accessor(
1356 msg, UPB_SIZE(40, 80), UPB_SIZE(4, 8), UPB_TYPE_MESSAGE, &sub, arena);
1357 if (!ok) return NULL;
1358 return sub;
1359 }
google_protobuf_DescriptorProto_mutable_reserved_name(google_protobuf_DescriptorProto * msg,size_t * len)1360 UPB_INLINE upb_strview* google_protobuf_DescriptorProto_mutable_reserved_name(google_protobuf_DescriptorProto *msg, size_t *len) {
1361 return (upb_strview*)_upb_array_mutable_accessor(msg, UPB_SIZE(44, 88), len);
1362 }
google_protobuf_DescriptorProto_resize_reserved_name(google_protobuf_DescriptorProto * msg,size_t len,upb_arena * arena)1363 UPB_INLINE upb_strview* google_protobuf_DescriptorProto_resize_reserved_name(google_protobuf_DescriptorProto *msg, size_t len, upb_arena *arena) {
1364 return (upb_strview*)_upb_array_resize_accessor(msg, UPB_SIZE(44, 88), len, UPB_SIZE(8, 16), UPB_TYPE_STRING, arena);
1365 }
google_protobuf_DescriptorProto_add_reserved_name(google_protobuf_DescriptorProto * msg,upb_strview val,upb_arena * arena)1366 UPB_INLINE bool google_protobuf_DescriptorProto_add_reserved_name(google_protobuf_DescriptorProto *msg, upb_strview val, upb_arena *arena) {
1367 return _upb_array_append_accessor(
1368 msg, UPB_SIZE(44, 88), UPB_SIZE(8, 16), UPB_TYPE_STRING, &val, arena);
1369 }
1370
1371
1372 /* google.protobuf.DescriptorProto.ExtensionRange */
1373
google_protobuf_DescriptorProto_ExtensionRange_new(upb_arena * arena)1374 UPB_INLINE google_protobuf_DescriptorProto_ExtensionRange *google_protobuf_DescriptorProto_ExtensionRange_new(upb_arena *arena) {
1375 return (google_protobuf_DescriptorProto_ExtensionRange *)upb_msg_new(&google_protobuf_DescriptorProto_ExtensionRange_msginit, arena);
1376 }
google_protobuf_DescriptorProto_ExtensionRange_parse(const char * buf,size_t size,upb_arena * arena)1377 UPB_INLINE google_protobuf_DescriptorProto_ExtensionRange *google_protobuf_DescriptorProto_ExtensionRange_parse(const char *buf, size_t size,
1378 upb_arena *arena) {
1379 google_protobuf_DescriptorProto_ExtensionRange *ret = google_protobuf_DescriptorProto_ExtensionRange_new(arena);
1380 return (ret && upb_decode(buf, size, ret, &google_protobuf_DescriptorProto_ExtensionRange_msginit)) ? ret : NULL;
1381 }
google_protobuf_DescriptorProto_ExtensionRange_serialize(const google_protobuf_DescriptorProto_ExtensionRange * msg,upb_arena * arena,size_t * len)1382 UPB_INLINE char *google_protobuf_DescriptorProto_ExtensionRange_serialize(const google_protobuf_DescriptorProto_ExtensionRange *msg, upb_arena *arena, size_t *len) {
1383 return upb_encode(msg, &google_protobuf_DescriptorProto_ExtensionRange_msginit, arena, len);
1384 }
1385
google_protobuf_DescriptorProto_ExtensionRange_has_start(const google_protobuf_DescriptorProto_ExtensionRange * msg)1386 UPB_INLINE bool google_protobuf_DescriptorProto_ExtensionRange_has_start(const google_protobuf_DescriptorProto_ExtensionRange *msg) { return _upb_has_field(msg, 1); }
google_protobuf_DescriptorProto_ExtensionRange_start(const google_protobuf_DescriptorProto_ExtensionRange * msg)1387 UPB_INLINE int32_t google_protobuf_DescriptorProto_ExtensionRange_start(const google_protobuf_DescriptorProto_ExtensionRange *msg) { return UPB_FIELD_AT(msg, int32_t, UPB_SIZE(4, 4)); }
google_protobuf_DescriptorProto_ExtensionRange_has_end(const google_protobuf_DescriptorProto_ExtensionRange * msg)1388 UPB_INLINE bool google_protobuf_DescriptorProto_ExtensionRange_has_end(const google_protobuf_DescriptorProto_ExtensionRange *msg) { return _upb_has_field(msg, 2); }
google_protobuf_DescriptorProto_ExtensionRange_end(const google_protobuf_DescriptorProto_ExtensionRange * msg)1389 UPB_INLINE int32_t google_protobuf_DescriptorProto_ExtensionRange_end(const google_protobuf_DescriptorProto_ExtensionRange *msg) { return UPB_FIELD_AT(msg, int32_t, UPB_SIZE(8, 8)); }
google_protobuf_DescriptorProto_ExtensionRange_has_options(const google_protobuf_DescriptorProto_ExtensionRange * msg)1390 UPB_INLINE bool google_protobuf_DescriptorProto_ExtensionRange_has_options(const google_protobuf_DescriptorProto_ExtensionRange *msg) { return _upb_has_field(msg, 3); }
google_protobuf_DescriptorProto_ExtensionRange_options(const google_protobuf_DescriptorProto_ExtensionRange * msg)1391 UPB_INLINE const google_protobuf_ExtensionRangeOptions* google_protobuf_DescriptorProto_ExtensionRange_options(const google_protobuf_DescriptorProto_ExtensionRange *msg) { return UPB_FIELD_AT(msg, const google_protobuf_ExtensionRangeOptions*, UPB_SIZE(12, 16)); }
1392
google_protobuf_DescriptorProto_ExtensionRange_set_start(google_protobuf_DescriptorProto_ExtensionRange * msg,int32_t value)1393 UPB_INLINE void google_protobuf_DescriptorProto_ExtensionRange_set_start(google_protobuf_DescriptorProto_ExtensionRange *msg, int32_t value) {
1394 _upb_sethas(msg, 1);
1395 UPB_FIELD_AT(msg, int32_t, UPB_SIZE(4, 4)) = value;
1396 }
google_protobuf_DescriptorProto_ExtensionRange_set_end(google_protobuf_DescriptorProto_ExtensionRange * msg,int32_t value)1397 UPB_INLINE void google_protobuf_DescriptorProto_ExtensionRange_set_end(google_protobuf_DescriptorProto_ExtensionRange *msg, int32_t value) {
1398 _upb_sethas(msg, 2);
1399 UPB_FIELD_AT(msg, int32_t, UPB_SIZE(8, 8)) = value;
1400 }
google_protobuf_DescriptorProto_ExtensionRange_set_options(google_protobuf_DescriptorProto_ExtensionRange * msg,google_protobuf_ExtensionRangeOptions * value)1401 UPB_INLINE void google_protobuf_DescriptorProto_ExtensionRange_set_options(google_protobuf_DescriptorProto_ExtensionRange *msg, google_protobuf_ExtensionRangeOptions* value) {
1402 _upb_sethas(msg, 3);
1403 UPB_FIELD_AT(msg, google_protobuf_ExtensionRangeOptions*, UPB_SIZE(12, 16)) = value;
1404 }
google_protobuf_DescriptorProto_ExtensionRange_mutable_options(google_protobuf_DescriptorProto_ExtensionRange * msg,upb_arena * arena)1405 UPB_INLINE struct google_protobuf_ExtensionRangeOptions* google_protobuf_DescriptorProto_ExtensionRange_mutable_options(google_protobuf_DescriptorProto_ExtensionRange *msg, upb_arena *arena) {
1406 struct google_protobuf_ExtensionRangeOptions* sub = (struct google_protobuf_ExtensionRangeOptions*)google_protobuf_DescriptorProto_ExtensionRange_options(msg);
1407 if (sub == NULL) {
1408 sub = (struct google_protobuf_ExtensionRangeOptions*)upb_msg_new(&google_protobuf_ExtensionRangeOptions_msginit, arena);
1409 if (!sub) return NULL;
1410 google_protobuf_DescriptorProto_ExtensionRange_set_options(msg, sub);
1411 }
1412 return sub;
1413 }
1414
1415
1416 /* google.protobuf.DescriptorProto.ReservedRange */
1417
google_protobuf_DescriptorProto_ReservedRange_new(upb_arena * arena)1418 UPB_INLINE google_protobuf_DescriptorProto_ReservedRange *google_protobuf_DescriptorProto_ReservedRange_new(upb_arena *arena) {
1419 return (google_protobuf_DescriptorProto_ReservedRange *)upb_msg_new(&google_protobuf_DescriptorProto_ReservedRange_msginit, arena);
1420 }
google_protobuf_DescriptorProto_ReservedRange_parse(const char * buf,size_t size,upb_arena * arena)1421 UPB_INLINE google_protobuf_DescriptorProto_ReservedRange *google_protobuf_DescriptorProto_ReservedRange_parse(const char *buf, size_t size,
1422 upb_arena *arena) {
1423 google_protobuf_DescriptorProto_ReservedRange *ret = google_protobuf_DescriptorProto_ReservedRange_new(arena);
1424 return (ret && upb_decode(buf, size, ret, &google_protobuf_DescriptorProto_ReservedRange_msginit)) ? ret : NULL;
1425 }
google_protobuf_DescriptorProto_ReservedRange_serialize(const google_protobuf_DescriptorProto_ReservedRange * msg,upb_arena * arena,size_t * len)1426 UPB_INLINE char *google_protobuf_DescriptorProto_ReservedRange_serialize(const google_protobuf_DescriptorProto_ReservedRange *msg, upb_arena *arena, size_t *len) {
1427 return upb_encode(msg, &google_protobuf_DescriptorProto_ReservedRange_msginit, arena, len);
1428 }
1429
google_protobuf_DescriptorProto_ReservedRange_has_start(const google_protobuf_DescriptorProto_ReservedRange * msg)1430 UPB_INLINE bool google_protobuf_DescriptorProto_ReservedRange_has_start(const google_protobuf_DescriptorProto_ReservedRange *msg) { return _upb_has_field(msg, 1); }
google_protobuf_DescriptorProto_ReservedRange_start(const google_protobuf_DescriptorProto_ReservedRange * msg)1431 UPB_INLINE int32_t google_protobuf_DescriptorProto_ReservedRange_start(const google_protobuf_DescriptorProto_ReservedRange *msg) { return UPB_FIELD_AT(msg, int32_t, UPB_SIZE(4, 4)); }
google_protobuf_DescriptorProto_ReservedRange_has_end(const google_protobuf_DescriptorProto_ReservedRange * msg)1432 UPB_INLINE bool google_protobuf_DescriptorProto_ReservedRange_has_end(const google_protobuf_DescriptorProto_ReservedRange *msg) { return _upb_has_field(msg, 2); }
google_protobuf_DescriptorProto_ReservedRange_end(const google_protobuf_DescriptorProto_ReservedRange * msg)1433 UPB_INLINE int32_t google_protobuf_DescriptorProto_ReservedRange_end(const google_protobuf_DescriptorProto_ReservedRange *msg) { return UPB_FIELD_AT(msg, int32_t, UPB_SIZE(8, 8)); }
1434
google_protobuf_DescriptorProto_ReservedRange_set_start(google_protobuf_DescriptorProto_ReservedRange * msg,int32_t value)1435 UPB_INLINE void google_protobuf_DescriptorProto_ReservedRange_set_start(google_protobuf_DescriptorProto_ReservedRange *msg, int32_t value) {
1436 _upb_sethas(msg, 1);
1437 UPB_FIELD_AT(msg, int32_t, UPB_SIZE(4, 4)) = value;
1438 }
google_protobuf_DescriptorProto_ReservedRange_set_end(google_protobuf_DescriptorProto_ReservedRange * msg,int32_t value)1439 UPB_INLINE void google_protobuf_DescriptorProto_ReservedRange_set_end(google_protobuf_DescriptorProto_ReservedRange *msg, int32_t value) {
1440 _upb_sethas(msg, 2);
1441 UPB_FIELD_AT(msg, int32_t, UPB_SIZE(8, 8)) = value;
1442 }
1443
1444
1445 /* google.protobuf.ExtensionRangeOptions */
1446
google_protobuf_ExtensionRangeOptions_new(upb_arena * arena)1447 UPB_INLINE google_protobuf_ExtensionRangeOptions *google_protobuf_ExtensionRangeOptions_new(upb_arena *arena) {
1448 return (google_protobuf_ExtensionRangeOptions *)upb_msg_new(&google_protobuf_ExtensionRangeOptions_msginit, arena);
1449 }
google_protobuf_ExtensionRangeOptions_parse(const char * buf,size_t size,upb_arena * arena)1450 UPB_INLINE google_protobuf_ExtensionRangeOptions *google_protobuf_ExtensionRangeOptions_parse(const char *buf, size_t size,
1451 upb_arena *arena) {
1452 google_protobuf_ExtensionRangeOptions *ret = google_protobuf_ExtensionRangeOptions_new(arena);
1453 return (ret && upb_decode(buf, size, ret, &google_protobuf_ExtensionRangeOptions_msginit)) ? ret : NULL;
1454 }
google_protobuf_ExtensionRangeOptions_serialize(const google_protobuf_ExtensionRangeOptions * msg,upb_arena * arena,size_t * len)1455 UPB_INLINE char *google_protobuf_ExtensionRangeOptions_serialize(const google_protobuf_ExtensionRangeOptions *msg, upb_arena *arena, size_t *len) {
1456 return upb_encode(msg, &google_protobuf_ExtensionRangeOptions_msginit, arena, len);
1457 }
1458
google_protobuf_ExtensionRangeOptions_uninterpreted_option(const google_protobuf_ExtensionRangeOptions * msg,size_t * len)1459 UPB_INLINE const google_protobuf_UninterpretedOption* const* google_protobuf_ExtensionRangeOptions_uninterpreted_option(const google_protobuf_ExtensionRangeOptions *msg, size_t *len) { return (const google_protobuf_UninterpretedOption* const*)_upb_array_accessor(msg, UPB_SIZE(0, 0), len); }
1460
google_protobuf_ExtensionRangeOptions_mutable_uninterpreted_option(google_protobuf_ExtensionRangeOptions * msg,size_t * len)1461 UPB_INLINE google_protobuf_UninterpretedOption** google_protobuf_ExtensionRangeOptions_mutable_uninterpreted_option(google_protobuf_ExtensionRangeOptions *msg, size_t *len) {
1462 return (google_protobuf_UninterpretedOption**)_upb_array_mutable_accessor(msg, UPB_SIZE(0, 0), len);
1463 }
google_protobuf_ExtensionRangeOptions_resize_uninterpreted_option(google_protobuf_ExtensionRangeOptions * msg,size_t len,upb_arena * arena)1464 UPB_INLINE google_protobuf_UninterpretedOption** google_protobuf_ExtensionRangeOptions_resize_uninterpreted_option(google_protobuf_ExtensionRangeOptions *msg, size_t len, upb_arena *arena) {
1465 return (google_protobuf_UninterpretedOption**)_upb_array_resize_accessor(msg, UPB_SIZE(0, 0), len, UPB_SIZE(4, 8), UPB_TYPE_MESSAGE, arena);
1466 }
google_protobuf_ExtensionRangeOptions_add_uninterpreted_option(google_protobuf_ExtensionRangeOptions * msg,upb_arena * arena)1467 UPB_INLINE struct google_protobuf_UninterpretedOption* google_protobuf_ExtensionRangeOptions_add_uninterpreted_option(google_protobuf_ExtensionRangeOptions *msg, upb_arena *arena) {
1468 struct google_protobuf_UninterpretedOption* sub = (struct google_protobuf_UninterpretedOption*)upb_msg_new(&google_protobuf_UninterpretedOption_msginit, arena);
1469 bool ok = _upb_array_append_accessor(
1470 msg, UPB_SIZE(0, 0), UPB_SIZE(4, 8), UPB_TYPE_MESSAGE, &sub, arena);
1471 if (!ok) return NULL;
1472 return sub;
1473 }
1474
1475
1476 /* google.protobuf.FieldDescriptorProto */
1477
google_protobuf_FieldDescriptorProto_new(upb_arena * arena)1478 UPB_INLINE google_protobuf_FieldDescriptorProto *google_protobuf_FieldDescriptorProto_new(upb_arena *arena) {
1479 return (google_protobuf_FieldDescriptorProto *)upb_msg_new(&google_protobuf_FieldDescriptorProto_msginit, arena);
1480 }
google_protobuf_FieldDescriptorProto_parse(const char * buf,size_t size,upb_arena * arena)1481 UPB_INLINE google_protobuf_FieldDescriptorProto *google_protobuf_FieldDescriptorProto_parse(const char *buf, size_t size,
1482 upb_arena *arena) {
1483 google_protobuf_FieldDescriptorProto *ret = google_protobuf_FieldDescriptorProto_new(arena);
1484 return (ret && upb_decode(buf, size, ret, &google_protobuf_FieldDescriptorProto_msginit)) ? ret : NULL;
1485 }
google_protobuf_FieldDescriptorProto_serialize(const google_protobuf_FieldDescriptorProto * msg,upb_arena * arena,size_t * len)1486 UPB_INLINE char *google_protobuf_FieldDescriptorProto_serialize(const google_protobuf_FieldDescriptorProto *msg, upb_arena *arena, size_t *len) {
1487 return upb_encode(msg, &google_protobuf_FieldDescriptorProto_msginit, arena, len);
1488 }
1489
google_protobuf_FieldDescriptorProto_has_name(const google_protobuf_FieldDescriptorProto * msg)1490 UPB_INLINE bool google_protobuf_FieldDescriptorProto_has_name(const google_protobuf_FieldDescriptorProto *msg) { return _upb_has_field(msg, 5); }
google_protobuf_FieldDescriptorProto_name(const google_protobuf_FieldDescriptorProto * msg)1491 UPB_INLINE upb_strview google_protobuf_FieldDescriptorProto_name(const google_protobuf_FieldDescriptorProto *msg) { return UPB_FIELD_AT(msg, upb_strview, UPB_SIZE(32, 32)); }
google_protobuf_FieldDescriptorProto_has_extendee(const google_protobuf_FieldDescriptorProto * msg)1492 UPB_INLINE bool google_protobuf_FieldDescriptorProto_has_extendee(const google_protobuf_FieldDescriptorProto *msg) { return _upb_has_field(msg, 6); }
google_protobuf_FieldDescriptorProto_extendee(const google_protobuf_FieldDescriptorProto * msg)1493 UPB_INLINE upb_strview google_protobuf_FieldDescriptorProto_extendee(const google_protobuf_FieldDescriptorProto *msg) { return UPB_FIELD_AT(msg, upb_strview, UPB_SIZE(40, 48)); }
google_protobuf_FieldDescriptorProto_has_number(const google_protobuf_FieldDescriptorProto * msg)1494 UPB_INLINE bool google_protobuf_FieldDescriptorProto_has_number(const google_protobuf_FieldDescriptorProto *msg) { return _upb_has_field(msg, 3); }
google_protobuf_FieldDescriptorProto_number(const google_protobuf_FieldDescriptorProto * msg)1495 UPB_INLINE int32_t google_protobuf_FieldDescriptorProto_number(const google_protobuf_FieldDescriptorProto *msg) { return UPB_FIELD_AT(msg, int32_t, UPB_SIZE(24, 24)); }
google_protobuf_FieldDescriptorProto_has_label(const google_protobuf_FieldDescriptorProto * msg)1496 UPB_INLINE bool google_protobuf_FieldDescriptorProto_has_label(const google_protobuf_FieldDescriptorProto *msg) { return _upb_has_field(msg, 1); }
google_protobuf_FieldDescriptorProto_label(const google_protobuf_FieldDescriptorProto * msg)1497 UPB_INLINE int32_t google_protobuf_FieldDescriptorProto_label(const google_protobuf_FieldDescriptorProto *msg) { return UPB_FIELD_AT(msg, int32_t, UPB_SIZE(8, 8)); }
google_protobuf_FieldDescriptorProto_has_type(const google_protobuf_FieldDescriptorProto * msg)1498 UPB_INLINE bool google_protobuf_FieldDescriptorProto_has_type(const google_protobuf_FieldDescriptorProto *msg) { return _upb_has_field(msg, 2); }
google_protobuf_FieldDescriptorProto_type(const google_protobuf_FieldDescriptorProto * msg)1499 UPB_INLINE int32_t google_protobuf_FieldDescriptorProto_type(const google_protobuf_FieldDescriptorProto *msg) { return UPB_FIELD_AT(msg, int32_t, UPB_SIZE(16, 16)); }
google_protobuf_FieldDescriptorProto_has_type_name(const google_protobuf_FieldDescriptorProto * msg)1500 UPB_INLINE bool google_protobuf_FieldDescriptorProto_has_type_name(const google_protobuf_FieldDescriptorProto *msg) { return _upb_has_field(msg, 7); }
google_protobuf_FieldDescriptorProto_type_name(const google_protobuf_FieldDescriptorProto * msg)1501 UPB_INLINE upb_strview google_protobuf_FieldDescriptorProto_type_name(const google_protobuf_FieldDescriptorProto *msg) { return UPB_FIELD_AT(msg, upb_strview, UPB_SIZE(48, 64)); }
google_protobuf_FieldDescriptorProto_has_default_value(const google_protobuf_FieldDescriptorProto * msg)1502 UPB_INLINE bool google_protobuf_FieldDescriptorProto_has_default_value(const google_protobuf_FieldDescriptorProto *msg) { return _upb_has_field(msg, 8); }
google_protobuf_FieldDescriptorProto_default_value(const google_protobuf_FieldDescriptorProto * msg)1503 UPB_INLINE upb_strview google_protobuf_FieldDescriptorProto_default_value(const google_protobuf_FieldDescriptorProto *msg) { return UPB_FIELD_AT(msg, upb_strview, UPB_SIZE(56, 80)); }
google_protobuf_FieldDescriptorProto_has_options(const google_protobuf_FieldDescriptorProto * msg)1504 UPB_INLINE bool google_protobuf_FieldDescriptorProto_has_options(const google_protobuf_FieldDescriptorProto *msg) { return _upb_has_field(msg, 10); }
google_protobuf_FieldDescriptorProto_options(const google_protobuf_FieldDescriptorProto * msg)1505 UPB_INLINE const google_protobuf_FieldOptions* google_protobuf_FieldDescriptorProto_options(const google_protobuf_FieldDescriptorProto *msg) { return UPB_FIELD_AT(msg, const google_protobuf_FieldOptions*, UPB_SIZE(72, 112)); }
google_protobuf_FieldDescriptorProto_has_oneof_index(const google_protobuf_FieldDescriptorProto * msg)1506 UPB_INLINE bool google_protobuf_FieldDescriptorProto_has_oneof_index(const google_protobuf_FieldDescriptorProto *msg) { return _upb_has_field(msg, 4); }
google_protobuf_FieldDescriptorProto_oneof_index(const google_protobuf_FieldDescriptorProto * msg)1507 UPB_INLINE int32_t google_protobuf_FieldDescriptorProto_oneof_index(const google_protobuf_FieldDescriptorProto *msg) { return UPB_FIELD_AT(msg, int32_t, UPB_SIZE(28, 28)); }
google_protobuf_FieldDescriptorProto_has_json_name(const google_protobuf_FieldDescriptorProto * msg)1508 UPB_INLINE bool google_protobuf_FieldDescriptorProto_has_json_name(const google_protobuf_FieldDescriptorProto *msg) { return _upb_has_field(msg, 9); }
google_protobuf_FieldDescriptorProto_json_name(const google_protobuf_FieldDescriptorProto * msg)1509 UPB_INLINE upb_strview google_protobuf_FieldDescriptorProto_json_name(const google_protobuf_FieldDescriptorProto *msg) { return UPB_FIELD_AT(msg, upb_strview, UPB_SIZE(64, 96)); }
1510
google_protobuf_FieldDescriptorProto_set_name(google_protobuf_FieldDescriptorProto * msg,upb_strview value)1511 UPB_INLINE void google_protobuf_FieldDescriptorProto_set_name(google_protobuf_FieldDescriptorProto *msg, upb_strview value) {
1512 _upb_sethas(msg, 5);
1513 UPB_FIELD_AT(msg, upb_strview, UPB_SIZE(32, 32)) = value;
1514 }
google_protobuf_FieldDescriptorProto_set_extendee(google_protobuf_FieldDescriptorProto * msg,upb_strview value)1515 UPB_INLINE void google_protobuf_FieldDescriptorProto_set_extendee(google_protobuf_FieldDescriptorProto *msg, upb_strview value) {
1516 _upb_sethas(msg, 6);
1517 UPB_FIELD_AT(msg, upb_strview, UPB_SIZE(40, 48)) = value;
1518 }
google_protobuf_FieldDescriptorProto_set_number(google_protobuf_FieldDescriptorProto * msg,int32_t value)1519 UPB_INLINE void google_protobuf_FieldDescriptorProto_set_number(google_protobuf_FieldDescriptorProto *msg, int32_t value) {
1520 _upb_sethas(msg, 3);
1521 UPB_FIELD_AT(msg, int32_t, UPB_SIZE(24, 24)) = value;
1522 }
google_protobuf_FieldDescriptorProto_set_label(google_protobuf_FieldDescriptorProto * msg,int32_t value)1523 UPB_INLINE void google_protobuf_FieldDescriptorProto_set_label(google_protobuf_FieldDescriptorProto *msg, int32_t value) {
1524 _upb_sethas(msg, 1);
1525 UPB_FIELD_AT(msg, int32_t, UPB_SIZE(8, 8)) = value;
1526 }
google_protobuf_FieldDescriptorProto_set_type(google_protobuf_FieldDescriptorProto * msg,int32_t value)1527 UPB_INLINE void google_protobuf_FieldDescriptorProto_set_type(google_protobuf_FieldDescriptorProto *msg, int32_t value) {
1528 _upb_sethas(msg, 2);
1529 UPB_FIELD_AT(msg, int32_t, UPB_SIZE(16, 16)) = value;
1530 }
google_protobuf_FieldDescriptorProto_set_type_name(google_protobuf_FieldDescriptorProto * msg,upb_strview value)1531 UPB_INLINE void google_protobuf_FieldDescriptorProto_set_type_name(google_protobuf_FieldDescriptorProto *msg, upb_strview value) {
1532 _upb_sethas(msg, 7);
1533 UPB_FIELD_AT(msg, upb_strview, UPB_SIZE(48, 64)) = value;
1534 }
google_protobuf_FieldDescriptorProto_set_default_value(google_protobuf_FieldDescriptorProto * msg,upb_strview value)1535 UPB_INLINE void google_protobuf_FieldDescriptorProto_set_default_value(google_protobuf_FieldDescriptorProto *msg, upb_strview value) {
1536 _upb_sethas(msg, 8);
1537 UPB_FIELD_AT(msg, upb_strview, UPB_SIZE(56, 80)) = value;
1538 }
google_protobuf_FieldDescriptorProto_set_options(google_protobuf_FieldDescriptorProto * msg,google_protobuf_FieldOptions * value)1539 UPB_INLINE void google_protobuf_FieldDescriptorProto_set_options(google_protobuf_FieldDescriptorProto *msg, google_protobuf_FieldOptions* value) {
1540 _upb_sethas(msg, 10);
1541 UPB_FIELD_AT(msg, google_protobuf_FieldOptions*, UPB_SIZE(72, 112)) = value;
1542 }
google_protobuf_FieldDescriptorProto_mutable_options(google_protobuf_FieldDescriptorProto * msg,upb_arena * arena)1543 UPB_INLINE struct google_protobuf_FieldOptions* google_protobuf_FieldDescriptorProto_mutable_options(google_protobuf_FieldDescriptorProto *msg, upb_arena *arena) {
1544 struct google_protobuf_FieldOptions* sub = (struct google_protobuf_FieldOptions*)google_protobuf_FieldDescriptorProto_options(msg);
1545 if (sub == NULL) {
1546 sub = (struct google_protobuf_FieldOptions*)upb_msg_new(&google_protobuf_FieldOptions_msginit, arena);
1547 if (!sub) return NULL;
1548 google_protobuf_FieldDescriptorProto_set_options(msg, sub);
1549 }
1550 return sub;
1551 }
google_protobuf_FieldDescriptorProto_set_oneof_index(google_protobuf_FieldDescriptorProto * msg,int32_t value)1552 UPB_INLINE void google_protobuf_FieldDescriptorProto_set_oneof_index(google_protobuf_FieldDescriptorProto *msg, int32_t value) {
1553 _upb_sethas(msg, 4);
1554 UPB_FIELD_AT(msg, int32_t, UPB_SIZE(28, 28)) = value;
1555 }
google_protobuf_FieldDescriptorProto_set_json_name(google_protobuf_FieldDescriptorProto * msg,upb_strview value)1556 UPB_INLINE void google_protobuf_FieldDescriptorProto_set_json_name(google_protobuf_FieldDescriptorProto *msg, upb_strview value) {
1557 _upb_sethas(msg, 9);
1558 UPB_FIELD_AT(msg, upb_strview, UPB_SIZE(64, 96)) = value;
1559 }
1560
1561
1562 /* google.protobuf.OneofDescriptorProto */
1563
google_protobuf_OneofDescriptorProto_new(upb_arena * arena)1564 UPB_INLINE google_protobuf_OneofDescriptorProto *google_protobuf_OneofDescriptorProto_new(upb_arena *arena) {
1565 return (google_protobuf_OneofDescriptorProto *)upb_msg_new(&google_protobuf_OneofDescriptorProto_msginit, arena);
1566 }
google_protobuf_OneofDescriptorProto_parse(const char * buf,size_t size,upb_arena * arena)1567 UPB_INLINE google_protobuf_OneofDescriptorProto *google_protobuf_OneofDescriptorProto_parse(const char *buf, size_t size,
1568 upb_arena *arena) {
1569 google_protobuf_OneofDescriptorProto *ret = google_protobuf_OneofDescriptorProto_new(arena);
1570 return (ret && upb_decode(buf, size, ret, &google_protobuf_OneofDescriptorProto_msginit)) ? ret : NULL;
1571 }
google_protobuf_OneofDescriptorProto_serialize(const google_protobuf_OneofDescriptorProto * msg,upb_arena * arena,size_t * len)1572 UPB_INLINE char *google_protobuf_OneofDescriptorProto_serialize(const google_protobuf_OneofDescriptorProto *msg, upb_arena *arena, size_t *len) {
1573 return upb_encode(msg, &google_protobuf_OneofDescriptorProto_msginit, arena, len);
1574 }
1575
google_protobuf_OneofDescriptorProto_has_name(const google_protobuf_OneofDescriptorProto * msg)1576 UPB_INLINE bool google_protobuf_OneofDescriptorProto_has_name(const google_protobuf_OneofDescriptorProto *msg) { return _upb_has_field(msg, 1); }
google_protobuf_OneofDescriptorProto_name(const google_protobuf_OneofDescriptorProto * msg)1577 UPB_INLINE upb_strview google_protobuf_OneofDescriptorProto_name(const google_protobuf_OneofDescriptorProto *msg) { return UPB_FIELD_AT(msg, upb_strview, UPB_SIZE(4, 8)); }
google_protobuf_OneofDescriptorProto_has_options(const google_protobuf_OneofDescriptorProto * msg)1578 UPB_INLINE bool google_protobuf_OneofDescriptorProto_has_options(const google_protobuf_OneofDescriptorProto *msg) { return _upb_has_field(msg, 2); }
google_protobuf_OneofDescriptorProto_options(const google_protobuf_OneofDescriptorProto * msg)1579 UPB_INLINE const google_protobuf_OneofOptions* google_protobuf_OneofDescriptorProto_options(const google_protobuf_OneofDescriptorProto *msg) { return UPB_FIELD_AT(msg, const google_protobuf_OneofOptions*, UPB_SIZE(12, 24)); }
1580
google_protobuf_OneofDescriptorProto_set_name(google_protobuf_OneofDescriptorProto * msg,upb_strview value)1581 UPB_INLINE void google_protobuf_OneofDescriptorProto_set_name(google_protobuf_OneofDescriptorProto *msg, upb_strview value) {
1582 _upb_sethas(msg, 1);
1583 UPB_FIELD_AT(msg, upb_strview, UPB_SIZE(4, 8)) = value;
1584 }
google_protobuf_OneofDescriptorProto_set_options(google_protobuf_OneofDescriptorProto * msg,google_protobuf_OneofOptions * value)1585 UPB_INLINE void google_protobuf_OneofDescriptorProto_set_options(google_protobuf_OneofDescriptorProto *msg, google_protobuf_OneofOptions* value) {
1586 _upb_sethas(msg, 2);
1587 UPB_FIELD_AT(msg, google_protobuf_OneofOptions*, UPB_SIZE(12, 24)) = value;
1588 }
google_protobuf_OneofDescriptorProto_mutable_options(google_protobuf_OneofDescriptorProto * msg,upb_arena * arena)1589 UPB_INLINE struct google_protobuf_OneofOptions* google_protobuf_OneofDescriptorProto_mutable_options(google_protobuf_OneofDescriptorProto *msg, upb_arena *arena) {
1590 struct google_protobuf_OneofOptions* sub = (struct google_protobuf_OneofOptions*)google_protobuf_OneofDescriptorProto_options(msg);
1591 if (sub == NULL) {
1592 sub = (struct google_protobuf_OneofOptions*)upb_msg_new(&google_protobuf_OneofOptions_msginit, arena);
1593 if (!sub) return NULL;
1594 google_protobuf_OneofDescriptorProto_set_options(msg, sub);
1595 }
1596 return sub;
1597 }
1598
1599
1600 /* google.protobuf.EnumDescriptorProto */
1601
google_protobuf_EnumDescriptorProto_new(upb_arena * arena)1602 UPB_INLINE google_protobuf_EnumDescriptorProto *google_protobuf_EnumDescriptorProto_new(upb_arena *arena) {
1603 return (google_protobuf_EnumDescriptorProto *)upb_msg_new(&google_protobuf_EnumDescriptorProto_msginit, arena);
1604 }
google_protobuf_EnumDescriptorProto_parse(const char * buf,size_t size,upb_arena * arena)1605 UPB_INLINE google_protobuf_EnumDescriptorProto *google_protobuf_EnumDescriptorProto_parse(const char *buf, size_t size,
1606 upb_arena *arena) {
1607 google_protobuf_EnumDescriptorProto *ret = google_protobuf_EnumDescriptorProto_new(arena);
1608 return (ret && upb_decode(buf, size, ret, &google_protobuf_EnumDescriptorProto_msginit)) ? ret : NULL;
1609 }
google_protobuf_EnumDescriptorProto_serialize(const google_protobuf_EnumDescriptorProto * msg,upb_arena * arena,size_t * len)1610 UPB_INLINE char *google_protobuf_EnumDescriptorProto_serialize(const google_protobuf_EnumDescriptorProto *msg, upb_arena *arena, size_t *len) {
1611 return upb_encode(msg, &google_protobuf_EnumDescriptorProto_msginit, arena, len);
1612 }
1613
google_protobuf_EnumDescriptorProto_has_name(const google_protobuf_EnumDescriptorProto * msg)1614 UPB_INLINE bool google_protobuf_EnumDescriptorProto_has_name(const google_protobuf_EnumDescriptorProto *msg) { return _upb_has_field(msg, 1); }
google_protobuf_EnumDescriptorProto_name(const google_protobuf_EnumDescriptorProto * msg)1615 UPB_INLINE upb_strview google_protobuf_EnumDescriptorProto_name(const google_protobuf_EnumDescriptorProto *msg) { return UPB_FIELD_AT(msg, upb_strview, UPB_SIZE(4, 8)); }
google_protobuf_EnumDescriptorProto_value(const google_protobuf_EnumDescriptorProto * msg,size_t * len)1616 UPB_INLINE const google_protobuf_EnumValueDescriptorProto* const* google_protobuf_EnumDescriptorProto_value(const google_protobuf_EnumDescriptorProto *msg, size_t *len) { return (const google_protobuf_EnumValueDescriptorProto* const*)_upb_array_accessor(msg, UPB_SIZE(16, 32), len); }
google_protobuf_EnumDescriptorProto_has_options(const google_protobuf_EnumDescriptorProto * msg)1617 UPB_INLINE bool google_protobuf_EnumDescriptorProto_has_options(const google_protobuf_EnumDescriptorProto *msg) { return _upb_has_field(msg, 2); }
google_protobuf_EnumDescriptorProto_options(const google_protobuf_EnumDescriptorProto * msg)1618 UPB_INLINE const google_protobuf_EnumOptions* google_protobuf_EnumDescriptorProto_options(const google_protobuf_EnumDescriptorProto *msg) { return UPB_FIELD_AT(msg, const google_protobuf_EnumOptions*, UPB_SIZE(12, 24)); }
google_protobuf_EnumDescriptorProto_reserved_range(const google_protobuf_EnumDescriptorProto * msg,size_t * len)1619 UPB_INLINE const google_protobuf_EnumDescriptorProto_EnumReservedRange* const* google_protobuf_EnumDescriptorProto_reserved_range(const google_protobuf_EnumDescriptorProto *msg, size_t *len) { return (const google_protobuf_EnumDescriptorProto_EnumReservedRange* const*)_upb_array_accessor(msg, UPB_SIZE(20, 40), len); }
google_protobuf_EnumDescriptorProto_reserved_name(const google_protobuf_EnumDescriptorProto * msg,size_t * len)1620 UPB_INLINE upb_strview const* google_protobuf_EnumDescriptorProto_reserved_name(const google_protobuf_EnumDescriptorProto *msg, size_t *len) { return (upb_strview const*)_upb_array_accessor(msg, UPB_SIZE(24, 48), len); }
1621
google_protobuf_EnumDescriptorProto_set_name(google_protobuf_EnumDescriptorProto * msg,upb_strview value)1622 UPB_INLINE void google_protobuf_EnumDescriptorProto_set_name(google_protobuf_EnumDescriptorProto *msg, upb_strview value) {
1623 _upb_sethas(msg, 1);
1624 UPB_FIELD_AT(msg, upb_strview, UPB_SIZE(4, 8)) = value;
1625 }
google_protobuf_EnumDescriptorProto_mutable_value(google_protobuf_EnumDescriptorProto * msg,size_t * len)1626 UPB_INLINE google_protobuf_EnumValueDescriptorProto** google_protobuf_EnumDescriptorProto_mutable_value(google_protobuf_EnumDescriptorProto *msg, size_t *len) {
1627 return (google_protobuf_EnumValueDescriptorProto**)_upb_array_mutable_accessor(msg, UPB_SIZE(16, 32), len);
1628 }
google_protobuf_EnumDescriptorProto_resize_value(google_protobuf_EnumDescriptorProto * msg,size_t len,upb_arena * arena)1629 UPB_INLINE google_protobuf_EnumValueDescriptorProto** google_protobuf_EnumDescriptorProto_resize_value(google_protobuf_EnumDescriptorProto *msg, size_t len, upb_arena *arena) {
1630 return (google_protobuf_EnumValueDescriptorProto**)_upb_array_resize_accessor(msg, UPB_SIZE(16, 32), len, UPB_SIZE(4, 8), UPB_TYPE_MESSAGE, arena);
1631 }
google_protobuf_EnumDescriptorProto_add_value(google_protobuf_EnumDescriptorProto * msg,upb_arena * arena)1632 UPB_INLINE struct google_protobuf_EnumValueDescriptorProto* google_protobuf_EnumDescriptorProto_add_value(google_protobuf_EnumDescriptorProto *msg, upb_arena *arena) {
1633 struct google_protobuf_EnumValueDescriptorProto* sub = (struct google_protobuf_EnumValueDescriptorProto*)upb_msg_new(&google_protobuf_EnumValueDescriptorProto_msginit, arena);
1634 bool ok = _upb_array_append_accessor(
1635 msg, UPB_SIZE(16, 32), UPB_SIZE(4, 8), UPB_TYPE_MESSAGE, &sub, arena);
1636 if (!ok) return NULL;
1637 return sub;
1638 }
google_protobuf_EnumDescriptorProto_set_options(google_protobuf_EnumDescriptorProto * msg,google_protobuf_EnumOptions * value)1639 UPB_INLINE void google_protobuf_EnumDescriptorProto_set_options(google_protobuf_EnumDescriptorProto *msg, google_protobuf_EnumOptions* value) {
1640 _upb_sethas(msg, 2);
1641 UPB_FIELD_AT(msg, google_protobuf_EnumOptions*, UPB_SIZE(12, 24)) = value;
1642 }
google_protobuf_EnumDescriptorProto_mutable_options(google_protobuf_EnumDescriptorProto * msg,upb_arena * arena)1643 UPB_INLINE struct google_protobuf_EnumOptions* google_protobuf_EnumDescriptorProto_mutable_options(google_protobuf_EnumDescriptorProto *msg, upb_arena *arena) {
1644 struct google_protobuf_EnumOptions* sub = (struct google_protobuf_EnumOptions*)google_protobuf_EnumDescriptorProto_options(msg);
1645 if (sub == NULL) {
1646 sub = (struct google_protobuf_EnumOptions*)upb_msg_new(&google_protobuf_EnumOptions_msginit, arena);
1647 if (!sub) return NULL;
1648 google_protobuf_EnumDescriptorProto_set_options(msg, sub);
1649 }
1650 return sub;
1651 }
google_protobuf_EnumDescriptorProto_mutable_reserved_range(google_protobuf_EnumDescriptorProto * msg,size_t * len)1652 UPB_INLINE google_protobuf_EnumDescriptorProto_EnumReservedRange** google_protobuf_EnumDescriptorProto_mutable_reserved_range(google_protobuf_EnumDescriptorProto *msg, size_t *len) {
1653 return (google_protobuf_EnumDescriptorProto_EnumReservedRange**)_upb_array_mutable_accessor(msg, UPB_SIZE(20, 40), len);
1654 }
google_protobuf_EnumDescriptorProto_resize_reserved_range(google_protobuf_EnumDescriptorProto * msg,size_t len,upb_arena * arena)1655 UPB_INLINE google_protobuf_EnumDescriptorProto_EnumReservedRange** google_protobuf_EnumDescriptorProto_resize_reserved_range(google_protobuf_EnumDescriptorProto *msg, size_t len, upb_arena *arena) {
1656 return (google_protobuf_EnumDescriptorProto_EnumReservedRange**)_upb_array_resize_accessor(msg, UPB_SIZE(20, 40), len, UPB_SIZE(4, 8), UPB_TYPE_MESSAGE, arena);
1657 }
google_protobuf_EnumDescriptorProto_add_reserved_range(google_protobuf_EnumDescriptorProto * msg,upb_arena * arena)1658 UPB_INLINE struct google_protobuf_EnumDescriptorProto_EnumReservedRange* google_protobuf_EnumDescriptorProto_add_reserved_range(google_protobuf_EnumDescriptorProto *msg, upb_arena *arena) {
1659 struct google_protobuf_EnumDescriptorProto_EnumReservedRange* sub = (struct google_protobuf_EnumDescriptorProto_EnumReservedRange*)upb_msg_new(&google_protobuf_EnumDescriptorProto_EnumReservedRange_msginit, arena);
1660 bool ok = _upb_array_append_accessor(
1661 msg, UPB_SIZE(20, 40), UPB_SIZE(4, 8), UPB_TYPE_MESSAGE, &sub, arena);
1662 if (!ok) return NULL;
1663 return sub;
1664 }
google_protobuf_EnumDescriptorProto_mutable_reserved_name(google_protobuf_EnumDescriptorProto * msg,size_t * len)1665 UPB_INLINE upb_strview* google_protobuf_EnumDescriptorProto_mutable_reserved_name(google_protobuf_EnumDescriptorProto *msg, size_t *len) {
1666 return (upb_strview*)_upb_array_mutable_accessor(msg, UPB_SIZE(24, 48), len);
1667 }
google_protobuf_EnumDescriptorProto_resize_reserved_name(google_protobuf_EnumDescriptorProto * msg,size_t len,upb_arena * arena)1668 UPB_INLINE upb_strview* google_protobuf_EnumDescriptorProto_resize_reserved_name(google_protobuf_EnumDescriptorProto *msg, size_t len, upb_arena *arena) {
1669 return (upb_strview*)_upb_array_resize_accessor(msg, UPB_SIZE(24, 48), len, UPB_SIZE(8, 16), UPB_TYPE_STRING, arena);
1670 }
google_protobuf_EnumDescriptorProto_add_reserved_name(google_protobuf_EnumDescriptorProto * msg,upb_strview val,upb_arena * arena)1671 UPB_INLINE bool google_protobuf_EnumDescriptorProto_add_reserved_name(google_protobuf_EnumDescriptorProto *msg, upb_strview val, upb_arena *arena) {
1672 return _upb_array_append_accessor(
1673 msg, UPB_SIZE(24, 48), UPB_SIZE(8, 16), UPB_TYPE_STRING, &val, arena);
1674 }
1675
1676
1677 /* google.protobuf.EnumDescriptorProto.EnumReservedRange */
1678
google_protobuf_EnumDescriptorProto_EnumReservedRange_new(upb_arena * arena)1679 UPB_INLINE google_protobuf_EnumDescriptorProto_EnumReservedRange *google_protobuf_EnumDescriptorProto_EnumReservedRange_new(upb_arena *arena) {
1680 return (google_protobuf_EnumDescriptorProto_EnumReservedRange *)upb_msg_new(&google_protobuf_EnumDescriptorProto_EnumReservedRange_msginit, arena);
1681 }
google_protobuf_EnumDescriptorProto_EnumReservedRange_parse(const char * buf,size_t size,upb_arena * arena)1682 UPB_INLINE google_protobuf_EnumDescriptorProto_EnumReservedRange *google_protobuf_EnumDescriptorProto_EnumReservedRange_parse(const char *buf, size_t size,
1683 upb_arena *arena) {
1684 google_protobuf_EnumDescriptorProto_EnumReservedRange *ret = google_protobuf_EnumDescriptorProto_EnumReservedRange_new(arena);
1685 return (ret && upb_decode(buf, size, ret, &google_protobuf_EnumDescriptorProto_EnumReservedRange_msginit)) ? ret : NULL;
1686 }
google_protobuf_EnumDescriptorProto_EnumReservedRange_serialize(const google_protobuf_EnumDescriptorProto_EnumReservedRange * msg,upb_arena * arena,size_t * len)1687 UPB_INLINE char *google_protobuf_EnumDescriptorProto_EnumReservedRange_serialize(const google_protobuf_EnumDescriptorProto_EnumReservedRange *msg, upb_arena *arena, size_t *len) {
1688 return upb_encode(msg, &google_protobuf_EnumDescriptorProto_EnumReservedRange_msginit, arena, len);
1689 }
1690
google_protobuf_EnumDescriptorProto_EnumReservedRange_has_start(const google_protobuf_EnumDescriptorProto_EnumReservedRange * msg)1691 UPB_INLINE bool google_protobuf_EnumDescriptorProto_EnumReservedRange_has_start(const google_protobuf_EnumDescriptorProto_EnumReservedRange *msg) { return _upb_has_field(msg, 1); }
google_protobuf_EnumDescriptorProto_EnumReservedRange_start(const google_protobuf_EnumDescriptorProto_EnumReservedRange * msg)1692 UPB_INLINE int32_t google_protobuf_EnumDescriptorProto_EnumReservedRange_start(const google_protobuf_EnumDescriptorProto_EnumReservedRange *msg) { return UPB_FIELD_AT(msg, int32_t, UPB_SIZE(4, 4)); }
google_protobuf_EnumDescriptorProto_EnumReservedRange_has_end(const google_protobuf_EnumDescriptorProto_EnumReservedRange * msg)1693 UPB_INLINE bool google_protobuf_EnumDescriptorProto_EnumReservedRange_has_end(const google_protobuf_EnumDescriptorProto_EnumReservedRange *msg) { return _upb_has_field(msg, 2); }
google_protobuf_EnumDescriptorProto_EnumReservedRange_end(const google_protobuf_EnumDescriptorProto_EnumReservedRange * msg)1694 UPB_INLINE int32_t google_protobuf_EnumDescriptorProto_EnumReservedRange_end(const google_protobuf_EnumDescriptorProto_EnumReservedRange *msg) { return UPB_FIELD_AT(msg, int32_t, UPB_SIZE(8, 8)); }
1695
google_protobuf_EnumDescriptorProto_EnumReservedRange_set_start(google_protobuf_EnumDescriptorProto_EnumReservedRange * msg,int32_t value)1696 UPB_INLINE void google_protobuf_EnumDescriptorProto_EnumReservedRange_set_start(google_protobuf_EnumDescriptorProto_EnumReservedRange *msg, int32_t value) {
1697 _upb_sethas(msg, 1);
1698 UPB_FIELD_AT(msg, int32_t, UPB_SIZE(4, 4)) = value;
1699 }
google_protobuf_EnumDescriptorProto_EnumReservedRange_set_end(google_protobuf_EnumDescriptorProto_EnumReservedRange * msg,int32_t value)1700 UPB_INLINE void google_protobuf_EnumDescriptorProto_EnumReservedRange_set_end(google_protobuf_EnumDescriptorProto_EnumReservedRange *msg, int32_t value) {
1701 _upb_sethas(msg, 2);
1702 UPB_FIELD_AT(msg, int32_t, UPB_SIZE(8, 8)) = value;
1703 }
1704
1705
1706 /* google.protobuf.EnumValueDescriptorProto */
1707
google_protobuf_EnumValueDescriptorProto_new(upb_arena * arena)1708 UPB_INLINE google_protobuf_EnumValueDescriptorProto *google_protobuf_EnumValueDescriptorProto_new(upb_arena *arena) {
1709 return (google_protobuf_EnumValueDescriptorProto *)upb_msg_new(&google_protobuf_EnumValueDescriptorProto_msginit, arena);
1710 }
google_protobuf_EnumValueDescriptorProto_parse(const char * buf,size_t size,upb_arena * arena)1711 UPB_INLINE google_protobuf_EnumValueDescriptorProto *google_protobuf_EnumValueDescriptorProto_parse(const char *buf, size_t size,
1712 upb_arena *arena) {
1713 google_protobuf_EnumValueDescriptorProto *ret = google_protobuf_EnumValueDescriptorProto_new(arena);
1714 return (ret && upb_decode(buf, size, ret, &google_protobuf_EnumValueDescriptorProto_msginit)) ? ret : NULL;
1715 }
google_protobuf_EnumValueDescriptorProto_serialize(const google_protobuf_EnumValueDescriptorProto * msg,upb_arena * arena,size_t * len)1716 UPB_INLINE char *google_protobuf_EnumValueDescriptorProto_serialize(const google_protobuf_EnumValueDescriptorProto *msg, upb_arena *arena, size_t *len) {
1717 return upb_encode(msg, &google_protobuf_EnumValueDescriptorProto_msginit, arena, len);
1718 }
1719
google_protobuf_EnumValueDescriptorProto_has_name(const google_protobuf_EnumValueDescriptorProto * msg)1720 UPB_INLINE bool google_protobuf_EnumValueDescriptorProto_has_name(const google_protobuf_EnumValueDescriptorProto *msg) { return _upb_has_field(msg, 2); }
google_protobuf_EnumValueDescriptorProto_name(const google_protobuf_EnumValueDescriptorProto * msg)1721 UPB_INLINE upb_strview google_protobuf_EnumValueDescriptorProto_name(const google_protobuf_EnumValueDescriptorProto *msg) { return UPB_FIELD_AT(msg, upb_strview, UPB_SIZE(8, 8)); }
google_protobuf_EnumValueDescriptorProto_has_number(const google_protobuf_EnumValueDescriptorProto * msg)1722 UPB_INLINE bool google_protobuf_EnumValueDescriptorProto_has_number(const google_protobuf_EnumValueDescriptorProto *msg) { return _upb_has_field(msg, 1); }
google_protobuf_EnumValueDescriptorProto_number(const google_protobuf_EnumValueDescriptorProto * msg)1723 UPB_INLINE int32_t google_protobuf_EnumValueDescriptorProto_number(const google_protobuf_EnumValueDescriptorProto *msg) { return UPB_FIELD_AT(msg, int32_t, UPB_SIZE(4, 4)); }
google_protobuf_EnumValueDescriptorProto_has_options(const google_protobuf_EnumValueDescriptorProto * msg)1724 UPB_INLINE bool google_protobuf_EnumValueDescriptorProto_has_options(const google_protobuf_EnumValueDescriptorProto *msg) { return _upb_has_field(msg, 3); }
google_protobuf_EnumValueDescriptorProto_options(const google_protobuf_EnumValueDescriptorProto * msg)1725 UPB_INLINE const google_protobuf_EnumValueOptions* google_protobuf_EnumValueDescriptorProto_options(const google_protobuf_EnumValueDescriptorProto *msg) { return UPB_FIELD_AT(msg, const google_protobuf_EnumValueOptions*, UPB_SIZE(16, 24)); }
1726
google_protobuf_EnumValueDescriptorProto_set_name(google_protobuf_EnumValueDescriptorProto * msg,upb_strview value)1727 UPB_INLINE void google_protobuf_EnumValueDescriptorProto_set_name(google_protobuf_EnumValueDescriptorProto *msg, upb_strview value) {
1728 _upb_sethas(msg, 2);
1729 UPB_FIELD_AT(msg, upb_strview, UPB_SIZE(8, 8)) = value;
1730 }
google_protobuf_EnumValueDescriptorProto_set_number(google_protobuf_EnumValueDescriptorProto * msg,int32_t value)1731 UPB_INLINE void google_protobuf_EnumValueDescriptorProto_set_number(google_protobuf_EnumValueDescriptorProto *msg, int32_t value) {
1732 _upb_sethas(msg, 1);
1733 UPB_FIELD_AT(msg, int32_t, UPB_SIZE(4, 4)) = value;
1734 }
google_protobuf_EnumValueDescriptorProto_set_options(google_protobuf_EnumValueDescriptorProto * msg,google_protobuf_EnumValueOptions * value)1735 UPB_INLINE void google_protobuf_EnumValueDescriptorProto_set_options(google_protobuf_EnumValueDescriptorProto *msg, google_protobuf_EnumValueOptions* value) {
1736 _upb_sethas(msg, 3);
1737 UPB_FIELD_AT(msg, google_protobuf_EnumValueOptions*, UPB_SIZE(16, 24)) = value;
1738 }
google_protobuf_EnumValueDescriptorProto_mutable_options(google_protobuf_EnumValueDescriptorProto * msg,upb_arena * arena)1739 UPB_INLINE struct google_protobuf_EnumValueOptions* google_protobuf_EnumValueDescriptorProto_mutable_options(google_protobuf_EnumValueDescriptorProto *msg, upb_arena *arena) {
1740 struct google_protobuf_EnumValueOptions* sub = (struct google_protobuf_EnumValueOptions*)google_protobuf_EnumValueDescriptorProto_options(msg);
1741 if (sub == NULL) {
1742 sub = (struct google_protobuf_EnumValueOptions*)upb_msg_new(&google_protobuf_EnumValueOptions_msginit, arena);
1743 if (!sub) return NULL;
1744 google_protobuf_EnumValueDescriptorProto_set_options(msg, sub);
1745 }
1746 return sub;
1747 }
1748
1749
1750 /* google.protobuf.ServiceDescriptorProto */
1751
google_protobuf_ServiceDescriptorProto_new(upb_arena * arena)1752 UPB_INLINE google_protobuf_ServiceDescriptorProto *google_protobuf_ServiceDescriptorProto_new(upb_arena *arena) {
1753 return (google_protobuf_ServiceDescriptorProto *)upb_msg_new(&google_protobuf_ServiceDescriptorProto_msginit, arena);
1754 }
google_protobuf_ServiceDescriptorProto_parse(const char * buf,size_t size,upb_arena * arena)1755 UPB_INLINE google_protobuf_ServiceDescriptorProto *google_protobuf_ServiceDescriptorProto_parse(const char *buf, size_t size,
1756 upb_arena *arena) {
1757 google_protobuf_ServiceDescriptorProto *ret = google_protobuf_ServiceDescriptorProto_new(arena);
1758 return (ret && upb_decode(buf, size, ret, &google_protobuf_ServiceDescriptorProto_msginit)) ? ret : NULL;
1759 }
google_protobuf_ServiceDescriptorProto_serialize(const google_protobuf_ServiceDescriptorProto * msg,upb_arena * arena,size_t * len)1760 UPB_INLINE char *google_protobuf_ServiceDescriptorProto_serialize(const google_protobuf_ServiceDescriptorProto *msg, upb_arena *arena, size_t *len) {
1761 return upb_encode(msg, &google_protobuf_ServiceDescriptorProto_msginit, arena, len);
1762 }
1763
google_protobuf_ServiceDescriptorProto_has_name(const google_protobuf_ServiceDescriptorProto * msg)1764 UPB_INLINE bool google_protobuf_ServiceDescriptorProto_has_name(const google_protobuf_ServiceDescriptorProto *msg) { return _upb_has_field(msg, 1); }
google_protobuf_ServiceDescriptorProto_name(const google_protobuf_ServiceDescriptorProto * msg)1765 UPB_INLINE upb_strview google_protobuf_ServiceDescriptorProto_name(const google_protobuf_ServiceDescriptorProto *msg) { return UPB_FIELD_AT(msg, upb_strview, UPB_SIZE(4, 8)); }
google_protobuf_ServiceDescriptorProto_method(const google_protobuf_ServiceDescriptorProto * msg,size_t * len)1766 UPB_INLINE const google_protobuf_MethodDescriptorProto* const* google_protobuf_ServiceDescriptorProto_method(const google_protobuf_ServiceDescriptorProto *msg, size_t *len) { return (const google_protobuf_MethodDescriptorProto* const*)_upb_array_accessor(msg, UPB_SIZE(16, 32), len); }
google_protobuf_ServiceDescriptorProto_has_options(const google_protobuf_ServiceDescriptorProto * msg)1767 UPB_INLINE bool google_protobuf_ServiceDescriptorProto_has_options(const google_protobuf_ServiceDescriptorProto *msg) { return _upb_has_field(msg, 2); }
google_protobuf_ServiceDescriptorProto_options(const google_protobuf_ServiceDescriptorProto * msg)1768 UPB_INLINE const google_protobuf_ServiceOptions* google_protobuf_ServiceDescriptorProto_options(const google_protobuf_ServiceDescriptorProto *msg) { return UPB_FIELD_AT(msg, const google_protobuf_ServiceOptions*, UPB_SIZE(12, 24)); }
1769
google_protobuf_ServiceDescriptorProto_set_name(google_protobuf_ServiceDescriptorProto * msg,upb_strview value)1770 UPB_INLINE void google_protobuf_ServiceDescriptorProto_set_name(google_protobuf_ServiceDescriptorProto *msg, upb_strview value) {
1771 _upb_sethas(msg, 1);
1772 UPB_FIELD_AT(msg, upb_strview, UPB_SIZE(4, 8)) = value;
1773 }
google_protobuf_ServiceDescriptorProto_mutable_method(google_protobuf_ServiceDescriptorProto * msg,size_t * len)1774 UPB_INLINE google_protobuf_MethodDescriptorProto** google_protobuf_ServiceDescriptorProto_mutable_method(google_protobuf_ServiceDescriptorProto *msg, size_t *len) {
1775 return (google_protobuf_MethodDescriptorProto**)_upb_array_mutable_accessor(msg, UPB_SIZE(16, 32), len);
1776 }
google_protobuf_ServiceDescriptorProto_resize_method(google_protobuf_ServiceDescriptorProto * msg,size_t len,upb_arena * arena)1777 UPB_INLINE google_protobuf_MethodDescriptorProto** google_protobuf_ServiceDescriptorProto_resize_method(google_protobuf_ServiceDescriptorProto *msg, size_t len, upb_arena *arena) {
1778 return (google_protobuf_MethodDescriptorProto**)_upb_array_resize_accessor(msg, UPB_SIZE(16, 32), len, UPB_SIZE(4, 8), UPB_TYPE_MESSAGE, arena);
1779 }
google_protobuf_ServiceDescriptorProto_add_method(google_protobuf_ServiceDescriptorProto * msg,upb_arena * arena)1780 UPB_INLINE struct google_protobuf_MethodDescriptorProto* google_protobuf_ServiceDescriptorProto_add_method(google_protobuf_ServiceDescriptorProto *msg, upb_arena *arena) {
1781 struct google_protobuf_MethodDescriptorProto* sub = (struct google_protobuf_MethodDescriptorProto*)upb_msg_new(&google_protobuf_MethodDescriptorProto_msginit, arena);
1782 bool ok = _upb_array_append_accessor(
1783 msg, UPB_SIZE(16, 32), UPB_SIZE(4, 8), UPB_TYPE_MESSAGE, &sub, arena);
1784 if (!ok) return NULL;
1785 return sub;
1786 }
google_protobuf_ServiceDescriptorProto_set_options(google_protobuf_ServiceDescriptorProto * msg,google_protobuf_ServiceOptions * value)1787 UPB_INLINE void google_protobuf_ServiceDescriptorProto_set_options(google_protobuf_ServiceDescriptorProto *msg, google_protobuf_ServiceOptions* value) {
1788 _upb_sethas(msg, 2);
1789 UPB_FIELD_AT(msg, google_protobuf_ServiceOptions*, UPB_SIZE(12, 24)) = value;
1790 }
google_protobuf_ServiceDescriptorProto_mutable_options(google_protobuf_ServiceDescriptorProto * msg,upb_arena * arena)1791 UPB_INLINE struct google_protobuf_ServiceOptions* google_protobuf_ServiceDescriptorProto_mutable_options(google_protobuf_ServiceDescriptorProto *msg, upb_arena *arena) {
1792 struct google_protobuf_ServiceOptions* sub = (struct google_protobuf_ServiceOptions*)google_protobuf_ServiceDescriptorProto_options(msg);
1793 if (sub == NULL) {
1794 sub = (struct google_protobuf_ServiceOptions*)upb_msg_new(&google_protobuf_ServiceOptions_msginit, arena);
1795 if (!sub) return NULL;
1796 google_protobuf_ServiceDescriptorProto_set_options(msg, sub);
1797 }
1798 return sub;
1799 }
1800
1801
1802 /* google.protobuf.MethodDescriptorProto */
1803
google_protobuf_MethodDescriptorProto_new(upb_arena * arena)1804 UPB_INLINE google_protobuf_MethodDescriptorProto *google_protobuf_MethodDescriptorProto_new(upb_arena *arena) {
1805 return (google_protobuf_MethodDescriptorProto *)upb_msg_new(&google_protobuf_MethodDescriptorProto_msginit, arena);
1806 }
google_protobuf_MethodDescriptorProto_parse(const char * buf,size_t size,upb_arena * arena)1807 UPB_INLINE google_protobuf_MethodDescriptorProto *google_protobuf_MethodDescriptorProto_parse(const char *buf, size_t size,
1808 upb_arena *arena) {
1809 google_protobuf_MethodDescriptorProto *ret = google_protobuf_MethodDescriptorProto_new(arena);
1810 return (ret && upb_decode(buf, size, ret, &google_protobuf_MethodDescriptorProto_msginit)) ? ret : NULL;
1811 }
google_protobuf_MethodDescriptorProto_serialize(const google_protobuf_MethodDescriptorProto * msg,upb_arena * arena,size_t * len)1812 UPB_INLINE char *google_protobuf_MethodDescriptorProto_serialize(const google_protobuf_MethodDescriptorProto *msg, upb_arena *arena, size_t *len) {
1813 return upb_encode(msg, &google_protobuf_MethodDescriptorProto_msginit, arena, len);
1814 }
1815
google_protobuf_MethodDescriptorProto_has_name(const google_protobuf_MethodDescriptorProto * msg)1816 UPB_INLINE bool google_protobuf_MethodDescriptorProto_has_name(const google_protobuf_MethodDescriptorProto *msg) { return _upb_has_field(msg, 3); }
google_protobuf_MethodDescriptorProto_name(const google_protobuf_MethodDescriptorProto * msg)1817 UPB_INLINE upb_strview google_protobuf_MethodDescriptorProto_name(const google_protobuf_MethodDescriptorProto *msg) { return UPB_FIELD_AT(msg, upb_strview, UPB_SIZE(4, 8)); }
google_protobuf_MethodDescriptorProto_has_input_type(const google_protobuf_MethodDescriptorProto * msg)1818 UPB_INLINE bool google_protobuf_MethodDescriptorProto_has_input_type(const google_protobuf_MethodDescriptorProto *msg) { return _upb_has_field(msg, 4); }
google_protobuf_MethodDescriptorProto_input_type(const google_protobuf_MethodDescriptorProto * msg)1819 UPB_INLINE upb_strview google_protobuf_MethodDescriptorProto_input_type(const google_protobuf_MethodDescriptorProto *msg) { return UPB_FIELD_AT(msg, upb_strview, UPB_SIZE(12, 24)); }
google_protobuf_MethodDescriptorProto_has_output_type(const google_protobuf_MethodDescriptorProto * msg)1820 UPB_INLINE bool google_protobuf_MethodDescriptorProto_has_output_type(const google_protobuf_MethodDescriptorProto *msg) { return _upb_has_field(msg, 5); }
google_protobuf_MethodDescriptorProto_output_type(const google_protobuf_MethodDescriptorProto * msg)1821 UPB_INLINE upb_strview google_protobuf_MethodDescriptorProto_output_type(const google_protobuf_MethodDescriptorProto *msg) { return UPB_FIELD_AT(msg, upb_strview, UPB_SIZE(20, 40)); }
google_protobuf_MethodDescriptorProto_has_options(const google_protobuf_MethodDescriptorProto * msg)1822 UPB_INLINE bool google_protobuf_MethodDescriptorProto_has_options(const google_protobuf_MethodDescriptorProto *msg) { return _upb_has_field(msg, 6); }
google_protobuf_MethodDescriptorProto_options(const google_protobuf_MethodDescriptorProto * msg)1823 UPB_INLINE const google_protobuf_MethodOptions* google_protobuf_MethodDescriptorProto_options(const google_protobuf_MethodDescriptorProto *msg) { return UPB_FIELD_AT(msg, const google_protobuf_MethodOptions*, UPB_SIZE(28, 56)); }
google_protobuf_MethodDescriptorProto_has_client_streaming(const google_protobuf_MethodDescriptorProto * msg)1824 UPB_INLINE bool google_protobuf_MethodDescriptorProto_has_client_streaming(const google_protobuf_MethodDescriptorProto *msg) { return _upb_has_field(msg, 1); }
google_protobuf_MethodDescriptorProto_client_streaming(const google_protobuf_MethodDescriptorProto * msg)1825 UPB_INLINE bool google_protobuf_MethodDescriptorProto_client_streaming(const google_protobuf_MethodDescriptorProto *msg) { return UPB_FIELD_AT(msg, bool, UPB_SIZE(1, 1)); }
google_protobuf_MethodDescriptorProto_has_server_streaming(const google_protobuf_MethodDescriptorProto * msg)1826 UPB_INLINE bool google_protobuf_MethodDescriptorProto_has_server_streaming(const google_protobuf_MethodDescriptorProto *msg) { return _upb_has_field(msg, 2); }
google_protobuf_MethodDescriptorProto_server_streaming(const google_protobuf_MethodDescriptorProto * msg)1827 UPB_INLINE bool google_protobuf_MethodDescriptorProto_server_streaming(const google_protobuf_MethodDescriptorProto *msg) { return UPB_FIELD_AT(msg, bool, UPB_SIZE(2, 2)); }
1828
google_protobuf_MethodDescriptorProto_set_name(google_protobuf_MethodDescriptorProto * msg,upb_strview value)1829 UPB_INLINE void google_protobuf_MethodDescriptorProto_set_name(google_protobuf_MethodDescriptorProto *msg, upb_strview value) {
1830 _upb_sethas(msg, 3);
1831 UPB_FIELD_AT(msg, upb_strview, UPB_SIZE(4, 8)) = value;
1832 }
google_protobuf_MethodDescriptorProto_set_input_type(google_protobuf_MethodDescriptorProto * msg,upb_strview value)1833 UPB_INLINE void google_protobuf_MethodDescriptorProto_set_input_type(google_protobuf_MethodDescriptorProto *msg, upb_strview value) {
1834 _upb_sethas(msg, 4);
1835 UPB_FIELD_AT(msg, upb_strview, UPB_SIZE(12, 24)) = value;
1836 }
google_protobuf_MethodDescriptorProto_set_output_type(google_protobuf_MethodDescriptorProto * msg,upb_strview value)1837 UPB_INLINE void google_protobuf_MethodDescriptorProto_set_output_type(google_protobuf_MethodDescriptorProto *msg, upb_strview value) {
1838 _upb_sethas(msg, 5);
1839 UPB_FIELD_AT(msg, upb_strview, UPB_SIZE(20, 40)) = value;
1840 }
google_protobuf_MethodDescriptorProto_set_options(google_protobuf_MethodDescriptorProto * msg,google_protobuf_MethodOptions * value)1841 UPB_INLINE void google_protobuf_MethodDescriptorProto_set_options(google_protobuf_MethodDescriptorProto *msg, google_protobuf_MethodOptions* value) {
1842 _upb_sethas(msg, 6);
1843 UPB_FIELD_AT(msg, google_protobuf_MethodOptions*, UPB_SIZE(28, 56)) = value;
1844 }
google_protobuf_MethodDescriptorProto_mutable_options(google_protobuf_MethodDescriptorProto * msg,upb_arena * arena)1845 UPB_INLINE struct google_protobuf_MethodOptions* google_protobuf_MethodDescriptorProto_mutable_options(google_protobuf_MethodDescriptorProto *msg, upb_arena *arena) {
1846 struct google_protobuf_MethodOptions* sub = (struct google_protobuf_MethodOptions*)google_protobuf_MethodDescriptorProto_options(msg);
1847 if (sub == NULL) {
1848 sub = (struct google_protobuf_MethodOptions*)upb_msg_new(&google_protobuf_MethodOptions_msginit, arena);
1849 if (!sub) return NULL;
1850 google_protobuf_MethodDescriptorProto_set_options(msg, sub);
1851 }
1852 return sub;
1853 }
google_protobuf_MethodDescriptorProto_set_client_streaming(google_protobuf_MethodDescriptorProto * msg,bool value)1854 UPB_INLINE void google_protobuf_MethodDescriptorProto_set_client_streaming(google_protobuf_MethodDescriptorProto *msg, bool value) {
1855 _upb_sethas(msg, 1);
1856 UPB_FIELD_AT(msg, bool, UPB_SIZE(1, 1)) = value;
1857 }
google_protobuf_MethodDescriptorProto_set_server_streaming(google_protobuf_MethodDescriptorProto * msg,bool value)1858 UPB_INLINE void google_protobuf_MethodDescriptorProto_set_server_streaming(google_protobuf_MethodDescriptorProto *msg, bool value) {
1859 _upb_sethas(msg, 2);
1860 UPB_FIELD_AT(msg, bool, UPB_SIZE(2, 2)) = value;
1861 }
1862
1863
1864 /* google.protobuf.FileOptions */
1865
google_protobuf_FileOptions_new(upb_arena * arena)1866 UPB_INLINE google_protobuf_FileOptions *google_protobuf_FileOptions_new(upb_arena *arena) {
1867 return (google_protobuf_FileOptions *)upb_msg_new(&google_protobuf_FileOptions_msginit, arena);
1868 }
google_protobuf_FileOptions_parse(const char * buf,size_t size,upb_arena * arena)1869 UPB_INLINE google_protobuf_FileOptions *google_protobuf_FileOptions_parse(const char *buf, size_t size,
1870 upb_arena *arena) {
1871 google_protobuf_FileOptions *ret = google_protobuf_FileOptions_new(arena);
1872 return (ret && upb_decode(buf, size, ret, &google_protobuf_FileOptions_msginit)) ? ret : NULL;
1873 }
google_protobuf_FileOptions_serialize(const google_protobuf_FileOptions * msg,upb_arena * arena,size_t * len)1874 UPB_INLINE char *google_protobuf_FileOptions_serialize(const google_protobuf_FileOptions *msg, upb_arena *arena, size_t *len) {
1875 return upb_encode(msg, &google_protobuf_FileOptions_msginit, arena, len);
1876 }
1877
google_protobuf_FileOptions_has_java_package(const google_protobuf_FileOptions * msg)1878 UPB_INLINE bool google_protobuf_FileOptions_has_java_package(const google_protobuf_FileOptions *msg) { return _upb_has_field(msg, 11); }
google_protobuf_FileOptions_java_package(const google_protobuf_FileOptions * msg)1879 UPB_INLINE upb_strview google_protobuf_FileOptions_java_package(const google_protobuf_FileOptions *msg) { return UPB_FIELD_AT(msg, upb_strview, UPB_SIZE(28, 32)); }
google_protobuf_FileOptions_has_java_outer_classname(const google_protobuf_FileOptions * msg)1880 UPB_INLINE bool google_protobuf_FileOptions_has_java_outer_classname(const google_protobuf_FileOptions *msg) { return _upb_has_field(msg, 12); }
google_protobuf_FileOptions_java_outer_classname(const google_protobuf_FileOptions * msg)1881 UPB_INLINE upb_strview google_protobuf_FileOptions_java_outer_classname(const google_protobuf_FileOptions *msg) { return UPB_FIELD_AT(msg, upb_strview, UPB_SIZE(36, 48)); }
google_protobuf_FileOptions_has_optimize_for(const google_protobuf_FileOptions * msg)1882 UPB_INLINE bool google_protobuf_FileOptions_has_optimize_for(const google_protobuf_FileOptions *msg) { return _upb_has_field(msg, 1); }
google_protobuf_FileOptions_optimize_for(const google_protobuf_FileOptions * msg)1883 UPB_INLINE int32_t google_protobuf_FileOptions_optimize_for(const google_protobuf_FileOptions *msg) { return UPB_FIELD_AT(msg, int32_t, UPB_SIZE(8, 8)); }
google_protobuf_FileOptions_has_java_multiple_files(const google_protobuf_FileOptions * msg)1884 UPB_INLINE bool google_protobuf_FileOptions_has_java_multiple_files(const google_protobuf_FileOptions *msg) { return _upb_has_field(msg, 2); }
google_protobuf_FileOptions_java_multiple_files(const google_protobuf_FileOptions * msg)1885 UPB_INLINE bool google_protobuf_FileOptions_java_multiple_files(const google_protobuf_FileOptions *msg) { return UPB_FIELD_AT(msg, bool, UPB_SIZE(16, 16)); }
google_protobuf_FileOptions_has_go_package(const google_protobuf_FileOptions * msg)1886 UPB_INLINE bool google_protobuf_FileOptions_has_go_package(const google_protobuf_FileOptions *msg) { return _upb_has_field(msg, 13); }
google_protobuf_FileOptions_go_package(const google_protobuf_FileOptions * msg)1887 UPB_INLINE upb_strview google_protobuf_FileOptions_go_package(const google_protobuf_FileOptions *msg) { return UPB_FIELD_AT(msg, upb_strview, UPB_SIZE(44, 64)); }
google_protobuf_FileOptions_has_cc_generic_services(const google_protobuf_FileOptions * msg)1888 UPB_INLINE bool google_protobuf_FileOptions_has_cc_generic_services(const google_protobuf_FileOptions *msg) { return _upb_has_field(msg, 3); }
google_protobuf_FileOptions_cc_generic_services(const google_protobuf_FileOptions * msg)1889 UPB_INLINE bool google_protobuf_FileOptions_cc_generic_services(const google_protobuf_FileOptions *msg) { return UPB_FIELD_AT(msg, bool, UPB_SIZE(17, 17)); }
google_protobuf_FileOptions_has_java_generic_services(const google_protobuf_FileOptions * msg)1890 UPB_INLINE bool google_protobuf_FileOptions_has_java_generic_services(const google_protobuf_FileOptions *msg) { return _upb_has_field(msg, 4); }
google_protobuf_FileOptions_java_generic_services(const google_protobuf_FileOptions * msg)1891 UPB_INLINE bool google_protobuf_FileOptions_java_generic_services(const google_protobuf_FileOptions *msg) { return UPB_FIELD_AT(msg, bool, UPB_SIZE(18, 18)); }
google_protobuf_FileOptions_has_py_generic_services(const google_protobuf_FileOptions * msg)1892 UPB_INLINE bool google_protobuf_FileOptions_has_py_generic_services(const google_protobuf_FileOptions *msg) { return _upb_has_field(msg, 5); }
google_protobuf_FileOptions_py_generic_services(const google_protobuf_FileOptions * msg)1893 UPB_INLINE bool google_protobuf_FileOptions_py_generic_services(const google_protobuf_FileOptions *msg) { return UPB_FIELD_AT(msg, bool, UPB_SIZE(19, 19)); }
google_protobuf_FileOptions_has_java_generate_equals_and_hash(const google_protobuf_FileOptions * msg)1894 UPB_INLINE bool google_protobuf_FileOptions_has_java_generate_equals_and_hash(const google_protobuf_FileOptions *msg) { return _upb_has_field(msg, 6); }
google_protobuf_FileOptions_java_generate_equals_and_hash(const google_protobuf_FileOptions * msg)1895 UPB_INLINE bool google_protobuf_FileOptions_java_generate_equals_and_hash(const google_protobuf_FileOptions *msg) { return UPB_FIELD_AT(msg, bool, UPB_SIZE(20, 20)); }
google_protobuf_FileOptions_has_deprecated(const google_protobuf_FileOptions * msg)1896 UPB_INLINE bool google_protobuf_FileOptions_has_deprecated(const google_protobuf_FileOptions *msg) { return _upb_has_field(msg, 7); }
google_protobuf_FileOptions_deprecated(const google_protobuf_FileOptions * msg)1897 UPB_INLINE bool google_protobuf_FileOptions_deprecated(const google_protobuf_FileOptions *msg) { return UPB_FIELD_AT(msg, bool, UPB_SIZE(21, 21)); }
google_protobuf_FileOptions_has_java_string_check_utf8(const google_protobuf_FileOptions * msg)1898 UPB_INLINE bool google_protobuf_FileOptions_has_java_string_check_utf8(const google_protobuf_FileOptions *msg) { return _upb_has_field(msg, 8); }
google_protobuf_FileOptions_java_string_check_utf8(const google_protobuf_FileOptions * msg)1899 UPB_INLINE bool google_protobuf_FileOptions_java_string_check_utf8(const google_protobuf_FileOptions *msg) { return UPB_FIELD_AT(msg, bool, UPB_SIZE(22, 22)); }
google_protobuf_FileOptions_has_cc_enable_arenas(const google_protobuf_FileOptions * msg)1900 UPB_INLINE bool google_protobuf_FileOptions_has_cc_enable_arenas(const google_protobuf_FileOptions *msg) { return _upb_has_field(msg, 9); }
google_protobuf_FileOptions_cc_enable_arenas(const google_protobuf_FileOptions * msg)1901 UPB_INLINE bool google_protobuf_FileOptions_cc_enable_arenas(const google_protobuf_FileOptions *msg) { return UPB_FIELD_AT(msg, bool, UPB_SIZE(23, 23)); }
google_protobuf_FileOptions_has_objc_class_prefix(const google_protobuf_FileOptions * msg)1902 UPB_INLINE bool google_protobuf_FileOptions_has_objc_class_prefix(const google_protobuf_FileOptions *msg) { return _upb_has_field(msg, 14); }
google_protobuf_FileOptions_objc_class_prefix(const google_protobuf_FileOptions * msg)1903 UPB_INLINE upb_strview google_protobuf_FileOptions_objc_class_prefix(const google_protobuf_FileOptions *msg) { return UPB_FIELD_AT(msg, upb_strview, UPB_SIZE(52, 80)); }
google_protobuf_FileOptions_has_csharp_namespace(const google_protobuf_FileOptions * msg)1904 UPB_INLINE bool google_protobuf_FileOptions_has_csharp_namespace(const google_protobuf_FileOptions *msg) { return _upb_has_field(msg, 15); }
google_protobuf_FileOptions_csharp_namespace(const google_protobuf_FileOptions * msg)1905 UPB_INLINE upb_strview google_protobuf_FileOptions_csharp_namespace(const google_protobuf_FileOptions *msg) { return UPB_FIELD_AT(msg, upb_strview, UPB_SIZE(60, 96)); }
google_protobuf_FileOptions_has_swift_prefix(const google_protobuf_FileOptions * msg)1906 UPB_INLINE bool google_protobuf_FileOptions_has_swift_prefix(const google_protobuf_FileOptions *msg) { return _upb_has_field(msg, 16); }
google_protobuf_FileOptions_swift_prefix(const google_protobuf_FileOptions * msg)1907 UPB_INLINE upb_strview google_protobuf_FileOptions_swift_prefix(const google_protobuf_FileOptions *msg) { return UPB_FIELD_AT(msg, upb_strview, UPB_SIZE(68, 112)); }
google_protobuf_FileOptions_has_php_class_prefix(const google_protobuf_FileOptions * msg)1908 UPB_INLINE bool google_protobuf_FileOptions_has_php_class_prefix(const google_protobuf_FileOptions *msg) { return _upb_has_field(msg, 17); }
google_protobuf_FileOptions_php_class_prefix(const google_protobuf_FileOptions * msg)1909 UPB_INLINE upb_strview google_protobuf_FileOptions_php_class_prefix(const google_protobuf_FileOptions *msg) { return UPB_FIELD_AT(msg, upb_strview, UPB_SIZE(76, 128)); }
google_protobuf_FileOptions_has_php_namespace(const google_protobuf_FileOptions * msg)1910 UPB_INLINE bool google_protobuf_FileOptions_has_php_namespace(const google_protobuf_FileOptions *msg) { return _upb_has_field(msg, 18); }
google_protobuf_FileOptions_php_namespace(const google_protobuf_FileOptions * msg)1911 UPB_INLINE upb_strview google_protobuf_FileOptions_php_namespace(const google_protobuf_FileOptions *msg) { return UPB_FIELD_AT(msg, upb_strview, UPB_SIZE(84, 144)); }
google_protobuf_FileOptions_has_php_generic_services(const google_protobuf_FileOptions * msg)1912 UPB_INLINE bool google_protobuf_FileOptions_has_php_generic_services(const google_protobuf_FileOptions *msg) { return _upb_has_field(msg, 10); }
google_protobuf_FileOptions_php_generic_services(const google_protobuf_FileOptions * msg)1913