blob: 73164b44ef4f9310a7f8e9f47873fe85eab94476 [file] [log] [blame]
Joshua Haberman7ecf43f2022-03-14 13:11:29 -07001// Ruby is still using proto3 enum semantics for proto2
Protobuf Team Bot5e8d7e52024-03-15 22:28:30 +00002#define UPB_DISABLE_CLOSED_ENUM_CHECKING
Joshua Haberman9abf6e22021-01-13 12:16:25 -08003/* Amalgamated source file */
Joshua Habermandd69a482021-05-17 22:40:33 -07004
5/*
Eric Salo8809a112022-11-21 13:01:06 -08006 * This is where we define internal portability macros used across upb.
Joshua Habermandd69a482021-05-17 22:40:33 -07007 *
Eric Salo8809a112022-11-21 13:01:06 -08008 * All of these macros are undef'd in undef.inc to avoid leaking them to users.
Joshua Habermandd69a482021-05-17 22:40:33 -07009 *
10 * The correct usage is:
11 *
Protobuf Team Bot06310352023-09-26 21:54:58 +000012 * #include "upb/foobar.h"
13 * #include "upb/baz.h"
Joshua Habermandd69a482021-05-17 22:40:33 -070014 *
15 * // MUST be last included header.
Protobuf Team Bot06310352023-09-26 21:54:58 +000016 * #include "upb/port/def.inc"
Joshua Habermandd69a482021-05-17 22:40:33 -070017 *
18 * // Code for this file.
19 * // <...>
20 *
21 * // Can be omitted for .c files, required for .h.
Protobuf Team Bot06310352023-09-26 21:54:58 +000022 * #include "upb/port/undef.inc"
Joshua Habermandd69a482021-05-17 22:40:33 -070023 *
24 * This file is private and must not be included by users!
25 */
Joshua Haberman9abf6e22021-01-13 12:16:25 -080026
27#if !((defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L) || \
Mike Kruskalfd0b1a52022-10-14 16:27:22 -070028 (defined(__cplusplus) && __cplusplus >= 201402L) || \
Joshua Haberman9abf6e22021-01-13 12:16:25 -080029 (defined(_MSC_VER) && _MSC_VER >= 1900))
Mike Kruskalfd0b1a52022-10-14 16:27:22 -070030#error upb requires C99 or C++14 or MSVC >= 2015.
Joshua Haberman9abf6e22021-01-13 12:16:25 -080031#endif
32
Joshua Habermand3995ec2022-09-30 16:54:39 -070033// Portable check for GCC minimum version:
34// https://gcc.gnu.org/onlinedocs/cpp/Common-Predefined-Macros.html
35#if defined(__GNUC__) && defined(__GNUC_MINOR__) && defined(__GNUC_PATCHLEVEL__)
36#define UPB_GNUC_MIN(x, y) \
37 (__GNUC__ > (x) || __GNUC__ == (x) && __GNUC_MINOR__ >= (y))
38#else
39#define UPB_GNUC_MIN(x, y) 0
40#endif
41
42#include <assert.h>
43#include <setjmp.h>
44#include <stdbool.h>
Joshua Habermand3995ec2022-09-30 16:54:39 -070045#include <stdint.h>
Eric Salo8809a112022-11-21 13:01:06 -080046#include <stdio.h>
Joshua Haberman9abf6e22021-01-13 12:16:25 -080047
Adam Cozzette7d5592e2023-08-23 12:15:26 -070048#ifndef UINTPTR_MAX
49Error, UINTPTR_MAX is undefined
50#endif
51
Joshua Haberman9abf6e22021-01-13 12:16:25 -080052#if UINTPTR_MAX == 0xffffffff
53#define UPB_SIZE(size32, size64) size32
54#else
55#define UPB_SIZE(size32, size64) size64
56#endif
57
58/* If we always read/write as a consistent type to each address, this shouldn't
59 * violate aliasing.
60 */
61#define UPB_PTR_AT(msg, ofs, type) ((type*)((char*)(msg) + (ofs)))
62
Joshua Haberman9abf6e22021-01-13 12:16:25 -080063#define UPB_MAPTYPE_STRING 0
64
Eric Salo3f36a912022-12-05 14:12:25 -080065// UPB_EXPORT: always generate a public symbol.
66#if defined(__GNUC__) || defined(__clang__)
67#define UPB_EXPORT __attribute__((visibility("default"))) __attribute__((used))
68#else
69#define UPB_EXPORT
70#endif
71
72// UPB_INLINE: inline if possible, emit standalone code if required.
Joshua Haberman9abf6e22021-01-13 12:16:25 -080073#ifdef __cplusplus
74#define UPB_INLINE inline
75#elif defined (__GNUC__) || defined(__clang__)
76#define UPB_INLINE static __inline__
77#else
78#define UPB_INLINE static
79#endif
80
Eric Salo3f36a912022-12-05 14:12:25 -080081#ifdef UPB_BUILD_API
82#define UPB_API UPB_EXPORT
83#define UPB_API_INLINE UPB_EXPORT
84#else
85#define UPB_API
86#define UPB_API_INLINE UPB_INLINE
87#endif
88
Joshua Habermand3995ec2022-09-30 16:54:39 -070089#define UPB_MALLOC_ALIGN 8
Joshua Haberman9abf6e22021-01-13 12:16:25 -080090#define UPB_ALIGN_UP(size, align) (((size) + (align) - 1) / (align) * (align))
91#define UPB_ALIGN_DOWN(size, align) ((size) / (align) * (align))
Joshua Habermand3995ec2022-09-30 16:54:39 -070092#define UPB_ALIGN_MALLOC(size) UPB_ALIGN_UP(size, UPB_MALLOC_ALIGN)
Mike Kruskal232ecf42023-01-14 00:09:40 -080093#ifdef __clang__
94#define UPB_ALIGN_OF(type) _Alignof(type)
95#else
Joshua Haberman9abf6e22021-01-13 12:16:25 -080096#define UPB_ALIGN_OF(type) offsetof (struct { char c; type member; }, member)
Mike Kruskal232ecf42023-01-14 00:09:40 -080097#endif
Joshua Haberman9abf6e22021-01-13 12:16:25 -080098
Protobuf Team Bote2785502023-12-21 21:28:36 +000099#ifdef _MSC_VER
100// Some versions of our Windows compiler don't support the C11 syntax.
101#define UPB_ALIGN_AS(x) __declspec(align(x))
102#else
103#define UPB_ALIGN_AS(x) _Alignas(x)
104#endif
105
Eric Salo8809a112022-11-21 13:01:06 -0800106// Hints to the compiler about likely/unlikely branches.
Joshua Haberman9abf6e22021-01-13 12:16:25 -0800107#if defined (__GNUC__) || defined(__clang__)
Eric Salo8809a112022-11-21 13:01:06 -0800108#define UPB_LIKELY(x) __builtin_expect((bool)(x), 1)
109#define UPB_UNLIKELY(x) __builtin_expect((bool)(x), 0)
Joshua Haberman9abf6e22021-01-13 12:16:25 -0800110#else
111#define UPB_LIKELY(x) (x)
112#define UPB_UNLIKELY(x) (x)
113#endif
114
Eric Salo8809a112022-11-21 13:01:06 -0800115// Macros for function attributes on compilers that support them.
Joshua Haberman9abf6e22021-01-13 12:16:25 -0800116#ifdef __GNUC__
Protobuf Team Bot1d143b52024-01-25 20:29:43 +0000117#define UPB_FORCEINLINE __inline__ __attribute__((always_inline)) static
Joshua Haberman9abf6e22021-01-13 12:16:25 -0800118#define UPB_NOINLINE __attribute__((noinline))
119#define UPB_NORETURN __attribute__((__noreturn__))
120#define UPB_PRINTF(str, first_vararg) __attribute__((format (printf, str, first_vararg)))
121#elif defined(_MSC_VER)
122#define UPB_NOINLINE
Protobuf Team Bot1d143b52024-01-25 20:29:43 +0000123#define UPB_FORCEINLINE static
Joshua Haberman9abf6e22021-01-13 12:16:25 -0800124#define UPB_NORETURN __declspec(noreturn)
125#define UPB_PRINTF(str, first_vararg)
126#else /* !defined(__GNUC__) */
Protobuf Team Bot1d143b52024-01-25 20:29:43 +0000127#define UPB_FORCEINLINE static
Joshua Haberman9abf6e22021-01-13 12:16:25 -0800128#define UPB_NOINLINE
129#define UPB_NORETURN
130#define UPB_PRINTF(str, first_vararg)
131#endif
132
133#define UPB_MAX(x, y) ((x) > (y) ? (x) : (y))
134#define UPB_MIN(x, y) ((x) < (y) ? (x) : (y))
135
136#define UPB_UNUSED(var) (void)var
137
Eric Salo8809a112022-11-21 13:01:06 -0800138// UPB_ASSUME(): in release mode, we tell the compiler to assume this is true.
Joshua Haberman9abf6e22021-01-13 12:16:25 -0800139#ifdef NDEBUG
140#ifdef __GNUC__
141#define UPB_ASSUME(expr) if (!(expr)) __builtin_unreachable()
142#elif defined _MSC_VER
143#define UPB_ASSUME(expr) if (!(expr)) __assume(0)
144#else
145#define UPB_ASSUME(expr) do {} while (false && (expr))
146#endif
147#else
148#define UPB_ASSUME(expr) assert(expr)
149#endif
150
151/* UPB_ASSERT(): in release mode, we use the expression without letting it be
152 * evaluated. This prevents "unused variable" warnings. */
153#ifdef NDEBUG
154#define UPB_ASSERT(expr) do {} while (false && (expr))
155#else
156#define UPB_ASSERT(expr) assert(expr)
157#endif
158
159#if defined(__GNUC__) || defined(__clang__)
160#define UPB_UNREACHABLE() do { assert(0); __builtin_unreachable(); } while(0)
Eric Salo10505992022-12-12 12:16:36 -0800161#elif defined(_MSC_VER)
162#define UPB_UNREACHABLE() \
163 do { \
164 assert(0); \
165 __assume(0); \
166 } while (0)
Joshua Haberman9abf6e22021-01-13 12:16:25 -0800167#else
168#define UPB_UNREACHABLE() do { assert(0); } while(0)
169#endif
170
171/* UPB_SETJMP() / UPB_LONGJMP(): avoid setting/restoring signal mask. */
172#ifdef __APPLE__
173#define UPB_SETJMP(buf) _setjmp(buf)
174#define UPB_LONGJMP(buf, val) _longjmp(buf, val)
175#else
176#define UPB_SETJMP(buf) setjmp(buf)
177#define UPB_LONGJMP(buf, val) longjmp(buf, val)
178#endif
179
Eric Salodfb71552023-03-22 12:35:09 -0700180#ifdef __GNUC__
181#define UPB_USE_C11_ATOMICS
Deanna Garciac7d979d2023-04-14 17:22:13 -0700182#define UPB_ATOMIC(T) _Atomic(T)
Eric Salodfb71552023-03-22 12:35:09 -0700183#else
Deanna Garciac7d979d2023-04-14 17:22:13 -0700184#define UPB_ATOMIC(T) T
Eric Salodfb71552023-03-22 12:35:09 -0700185#endif
186
Joshua Habermandd69a482021-05-17 22:40:33 -0700187/* UPB_PTRADD(ptr, ofs): add pointer while avoiding "NULL + 0" UB */
188#define UPB_PTRADD(ptr, ofs) ((ofs) ? (ptr) + (ofs) : (ptr))
189
Deanna Garciac7d979d2023-04-14 17:22:13 -0700190#define UPB_PRIVATE(x) x##_dont_copy_me__upb_internal_use_only
191
Protobuf Team Bot07194fc2023-11-30 05:43:03 +0000192#ifdef UPB_ALLOW_PRIVATE_ACCESS__FOR_BITS_ONLY
193#define UPB_ONLYBITS(x) x
194#else
195#define UPB_ONLYBITS(x) UPB_PRIVATE(x)
196#endif
197
Joshua Haberman9abf6e22021-01-13 12:16:25 -0800198/* Configure whether fasttable is switched on or not. *************************/
199
Joshua Habermandd69a482021-05-17 22:40:33 -0700200#ifdef __has_attribute
201#define UPB_HAS_ATTRIBUTE(x) __has_attribute(x)
202#else
203#define UPB_HAS_ATTRIBUTE(x) 0
204#endif
205
206#if UPB_HAS_ATTRIBUTE(musttail)
207#define UPB_MUSTTAIL __attribute__((musttail))
208#else
209#define UPB_MUSTTAIL
210#endif
211
212#undef UPB_HAS_ATTRIBUTE
213
214/* This check is not fully robust: it does not require that we have "musttail"
215 * support available. We need tail calls to avoid consuming arbitrary amounts
216 * of stack space.
217 *
218 * GCC/Clang can mostly be trusted to generate tail calls as long as
219 * optimization is enabled, but, debug builds will not generate tail calls
220 * unless "musttail" is available.
221 *
222 * We should probably either:
223 * 1. require that the compiler supports musttail.
224 * 2. add some fallback code for when musttail isn't available (ie. return
225 * instead of tail calling). This is safe and portable, but this comes at
226 * a CPU cost.
227 */
228#if (defined(__x86_64__) || defined(__aarch64__)) && defined(__GNUC__)
Joshua Haberman9abf6e22021-01-13 12:16:25 -0800229#define UPB_FASTTABLE_SUPPORTED 1
230#else
231#define UPB_FASTTABLE_SUPPORTED 0
232#endif
233
234/* define UPB_ENABLE_FASTTABLE to force fast table support.
235 * This is useful when we want to ensure we are really getting fasttable,
236 * for example for testing or benchmarking. */
237#if defined(UPB_ENABLE_FASTTABLE)
238#if !UPB_FASTTABLE_SUPPORTED
Joshua Habermandd69a482021-05-17 22:40:33 -0700239#error fasttable is x86-64/ARM64 only and requires GCC or Clang.
Joshua Haberman9abf6e22021-01-13 12:16:25 -0800240#endif
241#define UPB_FASTTABLE 1
242/* Define UPB_TRY_ENABLE_FASTTABLE to use fasttable if possible.
243 * This is useful for releasing code that might be used on multiple platforms,
244 * for example the PHP or Ruby C extensions. */
245#elif defined(UPB_TRY_ENABLE_FASTTABLE)
246#define UPB_FASTTABLE UPB_FASTTABLE_SUPPORTED
247#else
248#define UPB_FASTTABLE 0
249#endif
250
251/* UPB_FASTTABLE_INIT() allows protos compiled for fasttable to gracefully
Mike Kruskal232ecf42023-01-14 00:09:40 -0800252 * degrade to non-fasttable if the runtime or platform do not support it. */
253#if !UPB_FASTTABLE
Joshua Haberman9abf6e22021-01-13 12:16:25 -0800254#define UPB_FASTTABLE_INIT(...)
Mike Kruskal232ecf42023-01-14 00:09:40 -0800255#define UPB_FASTTABLE_MASK(mask) -1
Joshua Haberman9abf6e22021-01-13 12:16:25 -0800256#else
257#define UPB_FASTTABLE_INIT(...) __VA_ARGS__
Mike Kruskal232ecf42023-01-14 00:09:40 -0800258#define UPB_FASTTABLE_MASK(mask) mask
Joshua Haberman9abf6e22021-01-13 12:16:25 -0800259#endif
260
261#undef UPB_FASTTABLE_SUPPORTED
262
Joshua Habermand3995ec2022-09-30 16:54:39 -0700263/* ASAN poisoning (for arena).
264 * If using UPB from an interpreted language like Ruby, a build of the
Joshua Haberman488b8b92022-09-30 18:07:16 -0700265 * interpreter compiled with ASAN enabled must be used in order to get sane and
Joshua Habermand3995ec2022-09-30 16:54:39 -0700266 * expected behavior.
267 */
Joshua Haberman9abf6e22021-01-13 12:16:25 -0800268
Sandy Zhange3b09432023-08-07 09:30:02 -0700269/* Due to preprocessor limitations, the conditional logic for setting
270 * UPN_CLANG_ASAN below cannot be consolidated into a portable one-liner.
271 * See https://gcc.gnu.org/onlinedocs/cpp/_005f_005fhas_005fattribute.html.
272 */
273#if defined(__has_feature)
274#if __has_feature(address_sanitizer)
275#define UPB_CLANG_ASAN 1
276#else
277#define UPB_CLANG_ASAN 0
278#endif
279#else
280#define UPB_CLANG_ASAN 0
281#endif
282
283#if defined(__SANITIZE_ADDRESS__) || UPB_CLANG_ASAN
Joshua Haberman9abf6e22021-01-13 12:16:25 -0800284#define UPB_ASAN 1
Sandy Zhange3b09432023-08-07 09:30:02 -0700285#define UPB_ASAN_GUARD_SIZE 32
Joshua Haberman9abf6e22021-01-13 12:16:25 -0800286#ifdef __cplusplus
Adam Cozzette7d5592e2023-08-23 12:15:26 -0700287 extern "C" {
Joshua Haberman9abf6e22021-01-13 12:16:25 -0800288#endif
289void __asan_poison_memory_region(void const volatile *addr, size_t size);
290void __asan_unpoison_memory_region(void const volatile *addr, size_t size);
291#ifdef __cplusplus
292} /* extern "C" */
293#endif
294#define UPB_POISON_MEMORY_REGION(addr, size) \
295 __asan_poison_memory_region((addr), (size))
296#define UPB_UNPOISON_MEMORY_REGION(addr, size) \
297 __asan_unpoison_memory_region((addr), (size))
298#else
299#define UPB_ASAN 0
Sandy Zhange3b09432023-08-07 09:30:02 -0700300#define UPB_ASAN_GUARD_SIZE 0
Joshua Haberman9abf6e22021-01-13 12:16:25 -0800301#define UPB_POISON_MEMORY_REGION(addr, size) \
302 ((void)(addr), (void)(size))
303#define UPB_UNPOISON_MEMORY_REGION(addr, size) \
304 ((void)(addr), (void)(size))
Joshua Habermandd69a482021-05-17 22:40:33 -0700305#endif
306
Joshua Haberman7ecf43f2022-03-14 13:11:29 -0700307/* Disable proto2 arena behavior (TEMPORARY) **********************************/
308
Protobuf Team Bot5e8d7e52024-03-15 22:28:30 +0000309#ifdef UPB_DISABLE_CLOSED_ENUM_CHECKING
310#define UPB_TREAT_CLOSED_ENUMS_LIKE_OPEN 1
Joshua Haberman7ecf43f2022-03-14 13:11:29 -0700311#else
Protobuf Team Bot5e8d7e52024-03-15 22:28:30 +0000312#define UPB_TREAT_CLOSED_ENUMS_LIKE_OPEN 0
Joshua Haberman7ecf43f2022-03-14 13:11:29 -0700313#endif
314
Joshua Habermand3995ec2022-09-30 16:54:39 -0700315#if defined(__cplusplus)
316#if defined(__clang__) || UPB_GNUC_MIN(6, 0)
317// https://gcc.gnu.org/gcc-6/changes.html
318#if __cplusplus >= 201402L
319#define UPB_DEPRECATED [[deprecated]]
320#else
321#define UPB_DEPRECATED __attribute__((deprecated))
322#endif
323#else
324#define UPB_DEPRECATED
325#endif
326#else
327#define UPB_DEPRECATED
328#endif
Joshua Haberman9abf6e22021-01-13 12:16:25 -0800329
Mike Kruskal232ecf42023-01-14 00:09:40 -0800330// begin:google_only
331// #define UPB_IS_GOOGLE3
332// end:google_only
333
334#if defined(UPB_IS_GOOGLE3) && !defined(UPB_BOOTSTRAP_STAGE0)
335#define UPB_DESC(sym) proto2_##sym
Protobuf Team Botce9dcc22023-11-03 22:38:26 +0000336#define UPB_DESC_MINITABLE(sym) &proto2__##sym##_msg_init
337#elif defined(UPB_BOOTSTRAP_STAGE0)
338#define UPB_DESC(sym) google_protobuf_##sym
339#define UPB_DESC_MINITABLE(sym) google__protobuf__##sym##_msg_init()
Mike Kruskal232ecf42023-01-14 00:09:40 -0800340#else
341#define UPB_DESC(sym) google_protobuf_##sym
Protobuf Team Botce9dcc22023-11-03 22:38:26 +0000342#define UPB_DESC_MINITABLE(sym) &google__protobuf__##sym##_msg_init
Mike Kruskal232ecf42023-01-14 00:09:40 -0800343#endif
344
Protobuf Team Bot5d58cb82024-03-06 19:59:18 +0000345
Protobuf Team Botbf7ac9f2024-06-04 17:32:11 +0000346// Linker arrays combine elements from multiple translation units into a single
347// array that can be iterated over at runtime.
348//
349// It is an alternative to pre-main "registration" functions.
350//
351// Usage:
352//
353// // In N translation units.
354// UPB_LINKARR_APPEND(foo_array) static int elems[3] = {1, 2, 3};
355//
356// // At runtime:
357// UPB_LINKARR_DECLARE(foo_array, int);
358//
359// void f() {
360// const int* start = UPB_LINKARR_START(foo_array);
361// const int* stop = UPB_LINKARR_STOP(foo_array);
362// for (const int* p = start; p < stop; p++) {
363// // Windows can introduce zero padding, so we have to skip zeroes.
364// if (*p != 0) {
365// vec.push_back(*p);
366// }
367// }
368// }
369
370#if defined(__ELF__) || defined(__wasm__)
371
372#define UPB_LINKARR_APPEND(name) \
373 __attribute__((retain, used, section("linkarr_" #name)))
374#define UPB_LINKARR_DECLARE(name, type) \
375 extern type const __start_linkarr_##name; \
376 extern type const __stop_linkarr_##name; \
Protobuf Team Bot9f2893a2024-06-11 18:26:04 +0000377 UPB_LINKARR_APPEND(name) type UPB_linkarr_internal_empty_##name[1]
Protobuf Team Botbf7ac9f2024-06-04 17:32:11 +0000378#define UPB_LINKARR_START(name) (&__start_linkarr_##name)
379#define UPB_LINKARR_STOP(name) (&__stop_linkarr_##name)
380
381#elif defined(__MACH__)
382
383/* As described in: https://stackoverflow.com/a/22366882 */
384#define UPB_LINKARR_APPEND(name) \
Protobuf Team Botbbf52272024-06-11 23:07:36 +0000385 __attribute__((retain, used, section("__DATA,__la_" #name)))
Protobuf Team Botbf7ac9f2024-06-04 17:32:11 +0000386#define UPB_LINKARR_DECLARE(name, type) \
387 extern type const __start_linkarr_##name __asm( \
Protobuf Team Botbbf52272024-06-11 23:07:36 +0000388 "section$start$__DATA$__la_" #name); \
Protobuf Team Botbf7ac9f2024-06-04 17:32:11 +0000389 extern type const __stop_linkarr_##name __asm( \
390 "section$end$__DATA$" \
Protobuf Team Botbbf52272024-06-11 23:07:36 +0000391 "__la_" #name); \
Protobuf Team Bot9f2893a2024-06-11 18:26:04 +0000392 UPB_LINKARR_APPEND(name) type UPB_linkarr_internal_empty_##name[1]
Protobuf Team Botbf7ac9f2024-06-04 17:32:11 +0000393#define UPB_LINKARR_START(name) (&__start_linkarr_##name)
394#define UPB_LINKARR_STOP(name) (&__stop_linkarr_##name)
395
396#elif defined(_MSC_VER) && defined(__clang__)
397
398/* See:
399 * https://devblogs.microsoft.com/oldnewthing/20181107-00/?p=100155
400 * https://devblogs.microsoft.com/oldnewthing/20181108-00/?p=100165
401 * https://devblogs.microsoft.com/oldnewthing/20181109-00/?p=100175 */
402
403// Usage of __attribute__ here probably means this is Clang-specific, and would
404// not work on MSVC.
405#define UPB_LINKARR_APPEND(name) \
406 __declspec(allocate("la_" #name "$j")) __attribute__((retain, used))
407#define UPB_LINKARR_DECLARE(name, type) \
408 __declspec(allocate("la_" #name "$a")) type __start_linkarr_##name; \
409 __declspec(allocate("la_" #name "$z")) type __stop_linkarr_##name; \
410 UPB_LINKARR_APPEND(name) type UPB_linkarr_internal_empty_##name[1] = {0}
411#define UPB_LINKARR_START(name) (&__start_linkarr_##name)
412#define UPB_LINKARR_STOP(name) (&__stop_linkarr_##name)
413
414#else
415
416// Linker arrays are not supported on this platform. Make appends a no-op but
417// don't define the other macros.
418#define UPB_LINKARR_APPEND(name)
419
420#endif
421
Eric Salo8809a112022-11-21 13:01:06 -0800422#ifndef UPB_BASE_STATUS_H_
423#define UPB_BASE_STATUS_H_
424
425#include <stdarg.h>
Mike Kruskal9cf9db82022-11-04 21:22:31 -0700426
427// Must be last.
428
Protobuf Team Botb931e792024-01-31 21:16:11 +0000429#define _kUpb_Status_MaxMessage 511
Eric Salo8809a112022-11-21 13:01:06 -0800430
431typedef struct {
432 bool ok;
433 char msg[_kUpb_Status_MaxMessage]; // Error message; NULL-terminated.
434} upb_Status;
435
Mike Kruskal9cf9db82022-11-04 21:22:31 -0700436#ifdef __cplusplus
437extern "C" {
438#endif
439
Eric Salo3f36a912022-12-05 14:12:25 -0800440UPB_API const char* upb_Status_ErrorMessage(const upb_Status* status);
441UPB_API bool upb_Status_IsOk(const upb_Status* status);
Mike Kruskal9cf9db82022-11-04 21:22:31 -0700442
Eric Salo8809a112022-11-21 13:01:06 -0800443// These are no-op if |status| is NULL.
Eric Salo3f36a912022-12-05 14:12:25 -0800444UPB_API void upb_Status_Clear(upb_Status* status);
Eric Salo8809a112022-11-21 13:01:06 -0800445void upb_Status_SetErrorMessage(upb_Status* status, const char* msg);
446void upb_Status_SetErrorFormat(upb_Status* status, const char* fmt, ...)
447 UPB_PRINTF(2, 3);
448void upb_Status_VSetErrorFormat(upb_Status* status, const char* fmt,
449 va_list args) UPB_PRINTF(2, 0);
450void upb_Status_VAppendErrorFormat(upb_Status* status, const char* fmt,
451 va_list args) UPB_PRINTF(2, 0);
Mike Kruskal9cf9db82022-11-04 21:22:31 -0700452
453#ifdef __cplusplus
454} /* extern "C" */
455#endif
456
457
Eric Salo8809a112022-11-21 13:01:06 -0800458#endif /* UPB_BASE_STATUS_H_ */
Mike Kruskal9cf9db82022-11-04 21:22:31 -0700459
Protobuf Team Bot376ba2f2023-09-29 22:17:43 +0000460#ifndef UPB_GENERATED_CODE_SUPPORT_H_
461#define UPB_GENERATED_CODE_SUPPORT_H_
Joshua Habermand3995ec2022-09-30 16:54:39 -0700462
Protobuf Team Bot376ba2f2023-09-29 22:17:43 +0000463// IWYU pragma: begin_exports
Joshua Haberman9abf6e22021-01-13 12:16:25 -0800464
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +0000465#ifndef UPB_BASE_UPCAST_H_
466#define UPB_BASE_UPCAST_H_
467
468// Must be last.
469
470// This macro provides a way to upcast message pointers in a way that is
471// somewhat more bulletproof than blindly casting a pointer. Example:
472//
473// typedef struct {
474// upb_Message UPB_PRIVATE(base);
475// } pkg_FooMessage;
476//
477// void f(pkg_FooMessage* msg) {
478// upb_Decode(UPB_UPCAST(msg), ...);
479// }
480
481#define UPB_UPCAST(x) (&(x)->base##_dont_copy_me__upb_internal_use_only)
482
483
484#endif /* UPB_BASE_UPCAST_H_ */
485
Protobuf Team Bot376ba2f2023-09-29 22:17:43 +0000486#ifndef UPB_MESSAGE_ACCESSORS_H_
487#define UPB_MESSAGE_ACCESSORS_H_
Protobuf Team Bot473d20d2023-09-15 22:27:16 +0000488
Protobuf Team Bot54573a42023-11-21 14:47:34 +0000489#ifndef UPB_BASE_STRING_VIEW_H_
490#define UPB_BASE_STRING_VIEW_H_
Eric Salo8809a112022-11-21 13:01:06 -0800491
Protobuf Team Bot54573a42023-11-21 14:47:34 +0000492#include <string.h>
Protobuf Team Bot376ba2f2023-09-29 22:17:43 +0000493
Protobuf Team Bot54573a42023-11-21 14:47:34 +0000494// Must be last.
Protobuf Team Bot376ba2f2023-09-29 22:17:43 +0000495
Protobuf Team Bot54573a42023-11-21 14:47:34 +0000496#define UPB_STRINGVIEW_INIT(ptr, len) \
497 { ptr, len }
498
499#define UPB_STRINGVIEW_FORMAT "%.*s"
500#define UPB_STRINGVIEW_ARGS(view) (int)(view).size, (view).data
501
502// LINT.IfChange(struct_definition)
503typedef struct {
504 const char* data;
505 size_t size;
506} upb_StringView;
Protobuf Team Bot54573a42023-11-21 14:47:34 +0000507
508#ifdef __cplusplus
509extern "C" {
510#endif
511
512UPB_API_INLINE upb_StringView upb_StringView_FromDataAndSize(const char* data,
513 size_t size) {
514 upb_StringView ret;
515 ret.data = data;
516 ret.size = size;
517 return ret;
518}
519
520UPB_INLINE upb_StringView upb_StringView_FromString(const char* data) {
521 return upb_StringView_FromDataAndSize(data, strlen(data));
522}
523
524UPB_INLINE bool upb_StringView_IsEqual(upb_StringView a, upb_StringView b) {
Protobuf Team Botddc54062023-12-12 20:03:38 +0000525 return (a.size == b.size) && (!a.size || !memcmp(a.data, b.data, a.size));
Protobuf Team Bot54573a42023-11-21 14:47:34 +0000526}
527
Protobuf Team Bot030ab8d2023-12-01 19:20:11 +0000528// LINT.ThenChange(
Protobuf Team Botfd82df72024-01-29 20:24:42 +0000529// GoogleInternalName1,
Protobuf Team Bot030ab8d2023-12-01 19:20:11 +0000530// //depot/google3/third_party/upb/bits/golang/accessor.go:map_go_string,
531// //depot/google3/third_party/upb/bits/typescript/string_view.ts
532// )
533
Protobuf Team Bot54573a42023-11-21 14:47:34 +0000534#ifdef __cplusplus
535} /* extern "C" */
536#endif
537
538
539#endif /* UPB_BASE_STRING_VIEW_H_ */
Protobuf Team Bot376ba2f2023-09-29 22:17:43 +0000540
Eric Salo8809a112022-11-21 13:01:06 -0800541/* upb_Arena is a specific allocator implementation that uses arena allocation.
542 * The user provides an allocator that will be used to allocate the underlying
543 * arena blocks. Arenas by nature do not require the individual allocations
544 * to be freed. However the Arena does allow users to register cleanup
545 * functions that will run when the arena is destroyed.
Joshua Habermandd69a482021-05-17 22:40:33 -0700546 *
Eric Salo8809a112022-11-21 13:01:06 -0800547 * A upb_Arena is *not* thread-safe.
548 *
549 * You could write a thread-safe arena allocator that satisfies the
550 * upb_alloc interface, but it would not be as efficient for the
551 * single-threaded case. */
Joshua Haberman9abf6e22021-01-13 12:16:25 -0800552
Mike Kruskal9cf9db82022-11-04 21:22:31 -0700553#ifndef UPB_MEM_ARENA_H_
554#define UPB_MEM_ARENA_H_
Joshua Habermandd69a482021-05-17 22:40:33 -0700555
Adam Cozzette7d5592e2023-08-23 12:15:26 -0700556#include <stddef.h>
557#include <stdint.h>
Joshua Haberman9abf6e22021-01-13 12:16:25 -0800558
559
Mike Kruskal9cf9db82022-11-04 21:22:31 -0700560#ifndef UPB_MEM_ALLOC_H_
561#define UPB_MEM_ALLOC_H_
Joshua Habermand3995ec2022-09-30 16:54:39 -0700562
563// Must be last.
564
Joshua Haberman9abf6e22021-01-13 12:16:25 -0800565#ifdef __cplusplus
566extern "C" {
567#endif
568
Joshua Habermand3995ec2022-09-30 16:54:39 -0700569typedef struct upb_alloc upb_alloc;
Joshua Haberman9abf6e22021-01-13 12:16:25 -0800570
Joshua Habermand3995ec2022-09-30 16:54:39 -0700571/* A combined `malloc()`/`free()` function.
572 * If `size` is 0 then the function acts like `free()`, otherwise it acts like
573 * `realloc()`. Only `oldsize` bytes from a previous allocation are
574 * preserved. */
575typedef void* upb_alloc_func(upb_alloc* alloc, void* ptr, size_t oldsize,
576 size_t size);
577
578/* A upb_alloc is a possibly-stateful allocator object.
579 *
580 * It could either be an arena allocator (which doesn't require individual
581 * `free()` calls) or a regular `malloc()` (which does). The client must
582 * therefore free memory unless it knows that the allocator is an arena
583 * allocator. */
584struct upb_alloc {
585 upb_alloc_func* func;
586};
587
588UPB_INLINE void* upb_malloc(upb_alloc* alloc, size_t size) {
589 UPB_ASSERT(alloc);
590 return alloc->func(alloc, NULL, 0, size);
591}
592
593UPB_INLINE void* upb_realloc(upb_alloc* alloc, void* ptr, size_t oldsize,
594 size_t size) {
595 UPB_ASSERT(alloc);
596 return alloc->func(alloc, ptr, oldsize, size);
597}
598
599UPB_INLINE void upb_free(upb_alloc* alloc, void* ptr) {
600 UPB_ASSERT(alloc);
601 alloc->func(alloc, ptr, 0, 0);
602}
603
Mike Kruskal9cf9db82022-11-04 21:22:31 -0700604// The global allocator used by upb. Uses the standard malloc()/free().
Joshua Habermand3995ec2022-09-30 16:54:39 -0700605
606extern upb_alloc upb_alloc_global;
607
608/* Functions that hard-code the global malloc.
609 *
610 * We still get benefit because we can put custom logic into our global
611 * allocator, like injecting out-of-memory faults in debug/testing builds. */
612
613UPB_INLINE void* upb_gmalloc(size_t size) {
614 return upb_malloc(&upb_alloc_global, size);
615}
616
617UPB_INLINE void* upb_grealloc(void* ptr, size_t oldsize, size_t size) {
618 return upb_realloc(&upb_alloc_global, ptr, oldsize, size);
619}
620
621UPB_INLINE void upb_gfree(void* ptr) { upb_free(&upb_alloc_global, ptr); }
622
623#ifdef __cplusplus
624} /* extern "C" */
625#endif
626
627
Mike Kruskal9cf9db82022-11-04 21:22:31 -0700628#endif /* UPB_MEM_ALLOC_H_ */
Joshua Habermand3995ec2022-09-30 16:54:39 -0700629
Protobuf Team Botf75fe9e2023-12-19 22:41:49 +0000630#ifndef UPB_MEM_INTERNAL_ARENA_H_
631#define UPB_MEM_INTERNAL_ARENA_H_
632
633#include <stddef.h>
634#include <stdint.h>
635#include <string.h>
636
637// Must be last.
638
639// This is QUITE an ugly hack, which specifies the number of pointers needed
640// to equal (or exceed) the storage required for one upb_Arena.
641//
642// We need this because the decoder inlines a upb_Arena for performance but
643// the full struct is not visible outside of arena.c. Yes, I know, it's awful.
644#define UPB_ARENA_SIZE_HACK 7
645
Protobuf Team Bot6964e2c2023-12-21 15:42:16 +0000646// LINT.IfChange(upb_Arena)
Protobuf Team Botf75fe9e2023-12-19 22:41:49 +0000647
648struct upb_Arena {
649 char* UPB_ONLYBITS(ptr);
650 char* UPB_ONLYBITS(end);
651};
652
Protobuf Team Bot6964e2c2023-12-21 15:42:16 +0000653// LINT.ThenChange(//depot/google3/third_party/upb/bits/typescript/arena.ts:upb_Arena)
Protobuf Team Botf75fe9e2023-12-19 22:41:49 +0000654
655#ifdef __cplusplus
656extern "C" {
657#endif
658
659void UPB_PRIVATE(_upb_Arena_SwapIn)(struct upb_Arena* des,
660 const struct upb_Arena* src);
661void UPB_PRIVATE(_upb_Arena_SwapOut)(struct upb_Arena* des,
662 const struct upb_Arena* src);
663
Protobuf Team Bot56409302024-02-12 16:52:47 +0000664// Returns whether |ptr| was allocated directly by |a| (so care must be used
665// with fused arenas).
666UPB_API bool UPB_ONLYBITS(_upb_Arena_Contains)(const struct upb_Arena* a,
667 void* ptr);
668
Protobuf Team Botf75fe9e2023-12-19 22:41:49 +0000669UPB_INLINE size_t UPB_PRIVATE(_upb_ArenaHas)(const struct upb_Arena* a) {
670 return (size_t)(a->UPB_ONLYBITS(end) - a->UPB_ONLYBITS(ptr));
671}
672
Protobuf Team Botb3878b52024-02-08 21:50:53 +0000673UPB_API_INLINE void* upb_Arena_Malloc(struct upb_Arena* a, size_t size) {
Protobuf Team Botf75fe9e2023-12-19 22:41:49 +0000674 void* UPB_PRIVATE(_upb_Arena_SlowMalloc)(struct upb_Arena * a, size_t size);
675
676 size = UPB_ALIGN_MALLOC(size);
677 const size_t span = size + UPB_ASAN_GUARD_SIZE;
678 if (UPB_UNLIKELY(UPB_PRIVATE(_upb_ArenaHas)(a) < span)) {
679 return UPB_PRIVATE(_upb_Arena_SlowMalloc)(a, span);
680 }
681
682 // We have enough space to do a fast malloc.
683 void* ret = a->UPB_ONLYBITS(ptr);
684 UPB_ASSERT(UPB_ALIGN_MALLOC((uintptr_t)ret) == (uintptr_t)ret);
685 UPB_ASSERT(UPB_ALIGN_MALLOC(size) == size);
686 UPB_UNPOISON_MEMORY_REGION(ret, size);
687
688 a->UPB_ONLYBITS(ptr) += span;
689
690 return ret;
691}
692
Protobuf Team Botb3878b52024-02-08 21:50:53 +0000693UPB_API_INLINE void* upb_Arena_Realloc(struct upb_Arena* a, void* ptr,
694 size_t oldsize, size_t size) {
Protobuf Team Botf75fe9e2023-12-19 22:41:49 +0000695 oldsize = UPB_ALIGN_MALLOC(oldsize);
696 size = UPB_ALIGN_MALLOC(size);
697 bool is_most_recent_alloc =
698 (uintptr_t)ptr + oldsize == (uintptr_t)a->UPB_ONLYBITS(ptr);
699
700 if (is_most_recent_alloc) {
701 ptrdiff_t diff = size - oldsize;
702 if ((ptrdiff_t)UPB_PRIVATE(_upb_ArenaHas)(a) >= diff) {
703 a->UPB_ONLYBITS(ptr) += diff;
704 return ptr;
705 }
706 } else if (size <= oldsize) {
707 return ptr;
708 }
709
Protobuf Team Botb3878b52024-02-08 21:50:53 +0000710 void* ret = upb_Arena_Malloc(a, size);
Protobuf Team Botf75fe9e2023-12-19 22:41:49 +0000711
712 if (ret && oldsize > 0) {
713 memcpy(ret, ptr, UPB_MIN(oldsize, size));
714 }
715
716 return ret;
717}
718
Protobuf Team Botb3878b52024-02-08 21:50:53 +0000719UPB_API_INLINE void upb_Arena_ShrinkLast(struct upb_Arena* a, void* ptr,
720 size_t oldsize, size_t size) {
Protobuf Team Botf75fe9e2023-12-19 22:41:49 +0000721 oldsize = UPB_ALIGN_MALLOC(oldsize);
722 size = UPB_ALIGN_MALLOC(size);
723 // Must be the last alloc.
724 UPB_ASSERT((char*)ptr + oldsize ==
725 a->UPB_ONLYBITS(ptr) - UPB_ASAN_GUARD_SIZE);
726 UPB_ASSERT(size <= oldsize);
727 a->UPB_ONLYBITS(ptr) = (char*)ptr + size;
728}
729
730#ifdef __cplusplus
731} /* extern "C" */
732#endif
733
734
735#endif /* UPB_MEM_INTERNAL_ARENA_H_ */
736
Joshua Habermand3995ec2022-09-30 16:54:39 -0700737// Must be last.
738
Joshua Habermand3995ec2022-09-30 16:54:39 -0700739typedef struct upb_Arena upb_Arena;
Joshua Haberman9abf6e22021-01-13 12:16:25 -0800740
Eric Salo8809a112022-11-21 13:01:06 -0800741#ifdef __cplusplus
742extern "C" {
743#endif
744
Mike Kruskal3bc50492022-12-01 13:34:12 -0800745// Creates an arena from the given initial block (if any -- n may be 0).
746// Additional blocks will be allocated from |alloc|. If |alloc| is NULL, this
747// is a fixed-size arena and cannot grow.
Eric Salo3f36a912022-12-05 14:12:25 -0800748UPB_API upb_Arena* upb_Arena_Init(void* mem, size_t n, upb_alloc* alloc);
Mike Kruskal3bc50492022-12-01 13:34:12 -0800749
Eric Salo3f36a912022-12-05 14:12:25 -0800750UPB_API void upb_Arena_Free(upb_Arena* a);
Eric Salo3f36a912022-12-05 14:12:25 -0800751UPB_API bool upb_Arena_Fuse(upb_Arena* a, upb_Arena* b);
752
Protobuf Team Bot3d597c22023-12-13 04:04:17 +0000753bool upb_Arena_IncRefFor(upb_Arena* a, const void* owner);
754void upb_Arena_DecRefFor(upb_Arena* a, const void* owner);
Protobuf Team Bot777d6a92023-10-06 23:52:49 +0000755
Protobuf Team Bota3c33a82024-02-13 21:14:13 +0000756size_t upb_Arena_SpaceAllocated(upb_Arena* a, size_t* fused_count);
Protobuf Team Bot3d597c22023-12-13 04:04:17 +0000757uint32_t upb_Arena_DebugRefCount(upb_Arena* a);
758
Protobuf Team Botf75fe9e2023-12-19 22:41:49 +0000759UPB_API_INLINE upb_Arena* upb_Arena_New(void) {
760 return upb_Arena_Init(NULL, 0, &upb_alloc_global);
Joshua Habermand3995ec2022-09-30 16:54:39 -0700761}
762
Protobuf Team Botb3878b52024-02-08 21:50:53 +0000763UPB_API_INLINE void* upb_Arena_Malloc(struct upb_Arena* a, size_t size);
Eric Salo8809a112022-11-21 13:01:06 -0800764
Protobuf Team Botf75fe9e2023-12-19 22:41:49 +0000765UPB_API_INLINE void* upb_Arena_Realloc(upb_Arena* a, void* ptr, size_t oldsize,
Protobuf Team Botb3878b52024-02-08 21:50:53 +0000766 size_t size);
Joshua Habermand3995ec2022-09-30 16:54:39 -0700767
Joshua Habermand3995ec2022-09-30 16:54:39 -0700768// Shrinks the last alloc from arena.
769// REQUIRES: (ptr, oldsize) was the last malloc/realloc from this arena.
770// We could also add a upb_Arena_TryShrinkLast() which is simply a no-op if
771// this was not the last alloc.
Eric Salo3f36a912022-12-05 14:12:25 -0800772UPB_API_INLINE void upb_Arena_ShrinkLast(upb_Arena* a, void* ptr,
Protobuf Team Botb3878b52024-02-08 21:50:53 +0000773 size_t oldsize, size_t size);
Joshua Habermand3995ec2022-09-30 16:54:39 -0700774
Protobuf Team Botfb08bca2024-03-14 15:21:13 +0000775#ifdef UPB_TRACING_ENABLED
776void upb_Arena_SetTraceHandler(void (*initArenaTraceHandler)(const upb_Arena*,
777 size_t size),
778 void (*fuseArenaTraceHandler)(const upb_Arena*,
779 const upb_Arena*),
780 void (*freeArenaTraceHandler)(const upb_Arena*));
781#endif
782
Joshua Habermand3995ec2022-09-30 16:54:39 -0700783#ifdef __cplusplus
784} /* extern "C" */
785#endif
786
787
Mike Kruskal9cf9db82022-11-04 21:22:31 -0700788#endif /* UPB_MEM_ARENA_H_ */
Joshua Habermand3995ec2022-09-30 16:54:39 -0700789
Protobuf Team Bot54573a42023-11-21 14:47:34 +0000790#ifndef UPB_MESSAGE_ARRAY_H_
791#define UPB_MESSAGE_ARRAY_H_
792
793#include <stddef.h>
794
795
Protobuf Team Bot4d3a98c2024-05-08 01:37:14 +0000796#ifndef UPB_BASE_DESCRIPTOR_CONSTANTS_H_
797#define UPB_BASE_DESCRIPTOR_CONSTANTS_H_
798
799// Must be last.
800
801// The types a field can have. Note that this list is not identical to the
802// types defined in descriptor.proto, which gives INT32 and SINT32 separate
803// types (we distinguish the two with the "integer encoding" enum below).
804// This enum is an internal convenience only and has no meaning outside of upb.
805typedef enum {
806 kUpb_CType_Bool = 1,
807 kUpb_CType_Float = 2,
808 kUpb_CType_Int32 = 3,
809 kUpb_CType_UInt32 = 4,
810 kUpb_CType_Enum = 5, // Enum values are int32. TODO: rename
811 kUpb_CType_Message = 6,
812 kUpb_CType_Double = 7,
813 kUpb_CType_Int64 = 8,
814 kUpb_CType_UInt64 = 9,
815 kUpb_CType_String = 10,
816 kUpb_CType_Bytes = 11
817} upb_CType;
818
819// The repeated-ness of each field; this matches descriptor.proto.
820typedef enum {
821 kUpb_Label_Optional = 1,
822 kUpb_Label_Required = 2,
823 kUpb_Label_Repeated = 3
824} upb_Label;
825
826// Descriptor types, as defined in descriptor.proto.
827typedef enum {
828 kUpb_FieldType_Double = 1,
829 kUpb_FieldType_Float = 2,
830 kUpb_FieldType_Int64 = 3,
831 kUpb_FieldType_UInt64 = 4,
832 kUpb_FieldType_Int32 = 5,
833 kUpb_FieldType_Fixed64 = 6,
834 kUpb_FieldType_Fixed32 = 7,
835 kUpb_FieldType_Bool = 8,
836 kUpb_FieldType_String = 9,
837 kUpb_FieldType_Group = 10,
838 kUpb_FieldType_Message = 11,
839 kUpb_FieldType_Bytes = 12,
840 kUpb_FieldType_UInt32 = 13,
841 kUpb_FieldType_Enum = 14,
842 kUpb_FieldType_SFixed32 = 15,
843 kUpb_FieldType_SFixed64 = 16,
844 kUpb_FieldType_SInt32 = 17,
845 kUpb_FieldType_SInt64 = 18,
846} upb_FieldType;
847
848#define kUpb_FieldType_SizeOf 19
849
850#ifdef __cplusplus
851extern "C" {
852#endif
853
854// Convert from upb_FieldType to upb_CType
855UPB_INLINE upb_CType upb_FieldType_CType(upb_FieldType field_type) {
856 static const upb_CType c_type[] = {
857 kUpb_CType_Double, // kUpb_FieldType_Double
858 kUpb_CType_Float, // kUpb_FieldType_Float
859 kUpb_CType_Int64, // kUpb_FieldType_Int64
860 kUpb_CType_UInt64, // kUpb_FieldType_UInt64
861 kUpb_CType_Int32, // kUpb_FieldType_Int32
862 kUpb_CType_UInt64, // kUpb_FieldType_Fixed64
863 kUpb_CType_UInt32, // kUpb_FieldType_Fixed32
864 kUpb_CType_Bool, // kUpb_FieldType_Bool
865 kUpb_CType_String, // kUpb_FieldType_String
866 kUpb_CType_Message, // kUpb_FieldType_Group
867 kUpb_CType_Message, // kUpb_FieldType_Message
868 kUpb_CType_Bytes, // kUpb_FieldType_Bytes
869 kUpb_CType_UInt32, // kUpb_FieldType_UInt32
870 kUpb_CType_Enum, // kUpb_FieldType_Enum
871 kUpb_CType_Int32, // kUpb_FieldType_SFixed32
872 kUpb_CType_Int64, // kUpb_FieldType_SFixed64
873 kUpb_CType_Int32, // kUpb_FieldType_SInt32
874 kUpb_CType_Int64, // kUpb_FieldType_SInt64
875 };
876
877 // -1 here because the enum is one-based but the table is zero-based.
878 return c_type[field_type - 1];
879}
880
881UPB_INLINE bool upb_FieldType_IsPackable(upb_FieldType field_type) {
882 // clang-format off
883 const unsigned kUnpackableTypes =
884 (1 << kUpb_FieldType_String) |
885 (1 << kUpb_FieldType_Bytes) |
886 (1 << kUpb_FieldType_Message) |
887 (1 << kUpb_FieldType_Group);
888 // clang-format on
889 return (1 << field_type) & ~kUnpackableTypes;
890}
891
892#ifdef __cplusplus
893} /* extern "C" */
894#endif
895
896
897#endif /* UPB_BASE_DESCRIPTOR_CONSTANTS_H_ */
898
Protobuf Team Bot81e54332024-01-11 21:04:07 +0000899#ifndef UPB_MESSAGE_INTERNAL_ARRAY_H_
900#define UPB_MESSAGE_INTERNAL_ARRAY_H_
901
902#include <stdint.h>
903#include <string.h>
904
905
906// Must be last.
907
908#define _UPB_ARRAY_MASK_IMM 0x4 // Frozen/immutable bit.
909#define _UPB_ARRAY_MASK_LG2 0x3 // Encoded elem size.
910#define _UPB_ARRAY_MASK_ALL (_UPB_ARRAY_MASK_IMM | _UPB_ARRAY_MASK_LG2)
911
912#ifdef __cplusplus
913extern "C" {
914#endif
915
Protobuf Team Botfd82df72024-01-29 20:24:42 +0000916// LINT.IfChange(upb_Array)
917
Protobuf Team Bot81e54332024-01-11 21:04:07 +0000918// Our internal representation for repeated fields.
919struct upb_Array {
920 // This is a tagged pointer. Bits #0 and #1 encode the elem size as follows:
921 // 0 maps to elem size 1
922 // 1 maps to elem size 4
923 // 2 maps to elem size 8
924 // 3 maps to elem size 16
925 //
Protobuf Team Bot886a0b12024-01-26 21:23:01 +0000926 // Bit #2 contains the frozen/immutable flag.
Protobuf Team Bot81e54332024-01-11 21:04:07 +0000927 uintptr_t UPB_ONLYBITS(data);
928
929 size_t UPB_ONLYBITS(size); // The number of elements in the array.
930 size_t UPB_PRIVATE(capacity); // Allocated storage. Measured in elements.
931};
932
Protobuf Team Bot886a0b12024-01-26 21:23:01 +0000933UPB_INLINE void UPB_PRIVATE(_upb_Array_ShallowFreeze)(struct upb_Array* arr) {
934 arr->UPB_ONLYBITS(data) |= _UPB_ARRAY_MASK_IMM;
935}
936
Protobuf Team Botb3878b52024-02-08 21:50:53 +0000937UPB_API_INLINE bool upb_Array_IsFrozen(const struct upb_Array* arr) {
Protobuf Team Bot886a0b12024-01-26 21:23:01 +0000938 return (arr->UPB_ONLYBITS(data) & _UPB_ARRAY_MASK_IMM) != 0;
939}
940
Protobuf Team Bot81e54332024-01-11 21:04:07 +0000941UPB_INLINE void UPB_PRIVATE(_upb_Array_SetTaggedPtr)(struct upb_Array* array,
942 void* data, size_t lg2) {
943 UPB_ASSERT(lg2 != 1);
944 UPB_ASSERT(lg2 <= 4);
945 const size_t bits = lg2 - (lg2 != 0);
946 array->UPB_ONLYBITS(data) = (uintptr_t)data | bits;
947}
948
949UPB_INLINE size_t
950UPB_PRIVATE(_upb_Array_ElemSizeLg2)(const struct upb_Array* array) {
951 const size_t bits = array->UPB_ONLYBITS(data) & _UPB_ARRAY_MASK_LG2;
952 const size_t lg2 = bits + (bits != 0);
953 return lg2;
954}
955
Protobuf Team Botb3878b52024-02-08 21:50:53 +0000956UPB_API_INLINE const void* upb_Array_DataPtr(const struct upb_Array* array) {
Protobuf Team Bot81e54332024-01-11 21:04:07 +0000957 UPB_PRIVATE(_upb_Array_ElemSizeLg2)(array); // Check assertions.
958 return (void*)(array->UPB_ONLYBITS(data) & ~(uintptr_t)_UPB_ARRAY_MASK_ALL);
959}
960
Protobuf Team Botb3878b52024-02-08 21:50:53 +0000961UPB_API_INLINE void* upb_Array_MutableDataPtr(struct upb_Array* array) {
962 return (void*)upb_Array_DataPtr(array);
Protobuf Team Bot81e54332024-01-11 21:04:07 +0000963}
964
965UPB_INLINE struct upb_Array* UPB_PRIVATE(_upb_Array_New)(upb_Arena* arena,
966 size_t init_capacity,
967 int elem_size_lg2) {
968 UPB_ASSERT(elem_size_lg2 != 1);
969 UPB_ASSERT(elem_size_lg2 <= 4);
970 const size_t array_size =
971 UPB_ALIGN_UP(sizeof(struct upb_Array), UPB_MALLOC_ALIGN);
972 const size_t bytes = array_size + (init_capacity << elem_size_lg2);
973 struct upb_Array* array = (struct upb_Array*)upb_Arena_Malloc(arena, bytes);
974 if (!array) return NULL;
975 UPB_PRIVATE(_upb_Array_SetTaggedPtr)
976 (array, UPB_PTR_AT(array, array_size, void), elem_size_lg2);
977 array->UPB_ONLYBITS(size) = 0;
978 array->UPB_PRIVATE(capacity) = init_capacity;
979 return array;
980}
981
982// Resizes the capacity of the array to be at least min_size.
983bool UPB_PRIVATE(_upb_Array_Realloc)(struct upb_Array* array, size_t min_size,
984 upb_Arena* arena);
985
Protobuf Team Bot4b6de0f2024-03-29 19:09:40 +0000986UPB_API_INLINE bool upb_Array_Reserve(struct upb_Array* array, size_t size,
987 upb_Arena* arena) {
Protobuf Team Botb3878b52024-02-08 21:50:53 +0000988 UPB_ASSERT(!upb_Array_IsFrozen(array));
Protobuf Team Bot81e54332024-01-11 21:04:07 +0000989 if (array->UPB_PRIVATE(capacity) < size)
990 return UPB_PRIVATE(_upb_Array_Realloc)(array, size, arena);
991 return true;
992}
993
994// Resize without initializing new elements.
995UPB_INLINE bool UPB_PRIVATE(_upb_Array_ResizeUninitialized)(
996 struct upb_Array* array, size_t size, upb_Arena* arena) {
Protobuf Team Botb3878b52024-02-08 21:50:53 +0000997 UPB_ASSERT(!upb_Array_IsFrozen(array));
Protobuf Team Bot81e54332024-01-11 21:04:07 +0000998 UPB_ASSERT(size <= array->UPB_ONLYBITS(size) ||
999 arena); // Allow NULL arena when shrinking.
Protobuf Team Bot4b6de0f2024-03-29 19:09:40 +00001000 if (!upb_Array_Reserve(array, size, arena)) return false;
Protobuf Team Bot81e54332024-01-11 21:04:07 +00001001 array->UPB_ONLYBITS(size) = size;
1002 return true;
1003}
1004
1005// This function is intended for situations where elem_size is compile-time
1006// constant or a known expression of the form (1 << lg2), so that the expression
1007// i*elem_size does not result in an actual multiplication.
1008UPB_INLINE void UPB_PRIVATE(_upb_Array_Set)(struct upb_Array* array, size_t i,
1009 const void* data,
1010 size_t elem_size) {
Protobuf Team Botb3878b52024-02-08 21:50:53 +00001011 UPB_ASSERT(!upb_Array_IsFrozen(array));
Protobuf Team Bot81e54332024-01-11 21:04:07 +00001012 UPB_ASSERT(i < array->UPB_ONLYBITS(size));
1013 UPB_ASSERT(elem_size == 1U << UPB_PRIVATE(_upb_Array_ElemSizeLg2)(array));
Protobuf Team Botb3878b52024-02-08 21:50:53 +00001014 char* arr_data = (char*)upb_Array_MutableDataPtr(array);
Protobuf Team Bot81e54332024-01-11 21:04:07 +00001015 memcpy(arr_data + (i * elem_size), data, elem_size);
1016}
1017
Protobuf Team Botb3878b52024-02-08 21:50:53 +00001018UPB_API_INLINE size_t upb_Array_Size(const struct upb_Array* arr) {
Protobuf Team Bot81e54332024-01-11 21:04:07 +00001019 return arr->UPB_ONLYBITS(size);
1020}
1021
Protobuf Team Botfd82df72024-01-29 20:24:42 +00001022// LINT.ThenChange(GoogleInternalName0)
Protobuf Team Bot81e54332024-01-11 21:04:07 +00001023
1024#ifdef __cplusplus
1025} /* extern "C" */
1026#endif
1027
1028#undef _UPB_ARRAY_MASK_IMM
1029#undef _UPB_ARRAY_MASK_LG2
1030#undef _UPB_ARRAY_MASK_ALL
1031
1032
1033#endif /* UPB_MESSAGE_INTERNAL_ARRAY_H_ */
1034
Protobuf Team Bot473d20d2023-09-15 22:27:16 +00001035// Users should include array.h or map.h instead.
Protobuf Team Bot376ba2f2023-09-29 22:17:43 +00001036// IWYU pragma: private, include "upb/message/array.h"
Protobuf Team Bot473d20d2023-09-15 22:27:16 +00001037
1038#ifndef UPB_MESSAGE_VALUE_H_
1039#define UPB_MESSAGE_VALUE_H_
1040
1041#include <stdint.h>
1042
Protobuf Team Bot473d20d2023-09-15 22:27:16 +00001043
Protobuf Team Bote1253cd2024-01-08 23:09:09 +00001044typedef union {
1045 bool bool_val;
1046 float float_val;
1047 double double_val;
1048 int32_t int32_val;
1049 int64_t int64_val;
1050 uint32_t uint32_val;
1051 uint64_t uint64_val;
1052 const struct upb_Array* array_val;
1053 const struct upb_Map* map_val;
1054 const struct upb_Message* msg_val;
1055 upb_StringView str_val;
Protobuf Team Bot473d20d2023-09-15 22:27:16 +00001056
Protobuf Team Bote1253cd2024-01-08 23:09:09 +00001057 // EXPERIMENTAL: A tagged upb_Message*. Users must use this instead of
1058 // msg_val if unlinked sub-messages may possibly be in use. See the
1059 // documentation in kUpb_DecodeOption_ExperimentalAllowUnlinked for more
1060 // information.
1061 uintptr_t tagged_msg_val; // upb_TaggedMessagePtr
1062} upb_MessageValue;
Protobuf Team Bot7c687212023-11-14 03:01:42 +00001063
Protobuf Team Bote1253cd2024-01-08 23:09:09 +00001064typedef union {
1065 struct upb_Array* array;
1066 struct upb_Map* map;
1067 struct upb_Message* msg;
1068} upb_MutableMessageValue;
1069
1070#endif /* UPB_MESSAGE_VALUE_H_ */
Protobuf Team Botdcc1f612023-09-05 21:56:25 +00001071
Protobuf Team Bote1253cd2024-01-08 23:09:09 +00001072#ifndef UPB_MINI_TABLE_FIELD_H_
1073#define UPB_MINI_TABLE_FIELD_H_
1074
1075#include <stdint.h>
1076
1077
1078#ifndef UPB_MINI_TABLE_INTERNAL_FIELD_H_
1079#define UPB_MINI_TABLE_INTERNAL_FIELD_H_
1080
1081#include <stddef.h>
1082#include <stdint.h>
1083
1084
1085#ifndef UPB_MINI_TABLE_INTERNAL_SIZE_LOG2_H_
1086#define UPB_MINI_TABLE_INTERNAL_SIZE_LOG2_H_
1087
1088#include <stddef.h>
1089#include <stdint.h>
1090
1091
1092// Must be last.
1093
1094#ifdef __cplusplus
1095extern "C" {
1096#endif
1097
1098// Return the log2 of the storage size in bytes for a upb_CType
1099UPB_INLINE int UPB_PRIVATE(_upb_CType_SizeLg2)(upb_CType c_type) {
1100 static const int8_t size[] = {
1101 0, // kUpb_CType_Bool
1102 2, // kUpb_CType_Float
1103 2, // kUpb_CType_Int32
1104 2, // kUpb_CType_UInt32
1105 2, // kUpb_CType_Enum
1106 UPB_SIZE(2, 3), // kUpb_CType_Message
1107 3, // kUpb_CType_Double
1108 3, // kUpb_CType_Int64
1109 3, // kUpb_CType_UInt64
1110 UPB_SIZE(3, 4), // kUpb_CType_String
1111 UPB_SIZE(3, 4), // kUpb_CType_Bytes
1112 };
1113
1114 // -1 here because the enum is one-based but the table is zero-based.
1115 return size[c_type - 1];
1116}
1117
1118// Return the log2 of the storage size in bytes for a upb_FieldType
1119UPB_INLINE int UPB_PRIVATE(_upb_FieldType_SizeLg2)(upb_FieldType field_type) {
1120 static const int8_t size[] = {
1121 3, // kUpb_FieldType_Double
1122 2, // kUpb_FieldType_Float
1123 3, // kUpb_FieldType_Int64
1124 3, // kUpb_FieldType_UInt64
1125 2, // kUpb_FieldType_Int32
1126 3, // kUpb_FieldType_Fixed64
1127 2, // kUpb_FieldType_Fixed32
1128 0, // kUpb_FieldType_Bool
1129 UPB_SIZE(3, 4), // kUpb_FieldType_String
1130 UPB_SIZE(2, 3), // kUpb_FieldType_Group
1131 UPB_SIZE(2, 3), // kUpb_FieldType_Message
1132 UPB_SIZE(3, 4), // kUpb_FieldType_Bytes
1133 2, // kUpb_FieldType_UInt32
1134 2, // kUpb_FieldType_Enum
1135 2, // kUpb_FieldType_SFixed32
1136 3, // kUpb_FieldType_SFixed64
1137 2, // kUpb_FieldType_SInt32
1138 3, // kUpb_FieldType_SInt64
1139 };
1140
1141 // -1 here because the enum is one-based but the table is zero-based.
1142 return size[field_type - 1];
1143}
1144
1145#ifdef __cplusplus
1146} /* extern "C" */
1147#endif
1148
1149
1150#endif /* UPB_MINI_TABLE_INTERNAL_SIZE_LOG2_H_ */
1151
1152// Must be last.
1153
1154// LINT.IfChange(struct_definition)
1155struct upb_MiniTableField {
1156 uint32_t UPB_ONLYBITS(number);
1157 uint16_t UPB_ONLYBITS(offset);
1158 int16_t presence; // If >0, hasbit_index. If <0, ~oneof_index
1159
1160 // Indexes into `upb_MiniTable.subs`
1161 // Will be set to `kUpb_NoSub` if `descriptortype` != MESSAGE/GROUP/ENUM
1162 uint16_t UPB_PRIVATE(submsg_index);
1163
1164 uint8_t UPB_PRIVATE(descriptortype);
1165
1166 // upb_FieldMode | upb_LabelFlags | (upb_FieldRep << kUpb_FieldRep_Shift)
1167 uint8_t UPB_ONLYBITS(mode);
1168};
1169
Protobuf Team Botb3878b52024-02-08 21:50:53 +00001170#define kUpb_NoSub ((uint16_t) - 1)
Protobuf Team Bote1253cd2024-01-08 23:09:09 +00001171
1172typedef enum {
1173 kUpb_FieldMode_Map = 0,
1174 kUpb_FieldMode_Array = 1,
1175 kUpb_FieldMode_Scalar = 2,
1176} upb_FieldMode;
1177
1178// Mask to isolate the upb_FieldMode from field.mode.
1179#define kUpb_FieldMode_Mask 3
1180
1181// Extra flags on the mode field.
1182typedef enum {
1183 kUpb_LabelFlags_IsPacked = 4,
1184 kUpb_LabelFlags_IsExtension = 8,
1185 // Indicates that this descriptor type is an "alternate type":
1186 // - for Int32, this indicates that the actual type is Enum (but was
1187 // rewritten to Int32 because it is an open enum that requires no check).
1188 // - for Bytes, this indicates that the actual type is String (but does
1189 // not require any UTF-8 check).
1190 kUpb_LabelFlags_IsAlternate = 16,
1191} upb_LabelFlags;
1192
1193// Note: we sort by this number when calculating layout order.
1194typedef enum {
1195 kUpb_FieldRep_1Byte = 0,
1196 kUpb_FieldRep_4Byte = 1,
1197 kUpb_FieldRep_StringView = 2,
1198 kUpb_FieldRep_8Byte = 3,
1199
1200 kUpb_FieldRep_NativePointer =
1201 UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte),
1202 kUpb_FieldRep_Max = kUpb_FieldRep_8Byte,
1203} upb_FieldRep;
1204
1205#define kUpb_FieldRep_Shift 6
1206
1207#ifdef __cplusplus
1208extern "C" {
1209#endif
1210
1211UPB_INLINE upb_FieldMode
1212UPB_PRIVATE(_upb_MiniTableField_Mode)(const struct upb_MiniTableField* f) {
1213 return (upb_FieldMode)(f->UPB_ONLYBITS(mode) & kUpb_FieldMode_Mask);
1214}
1215
1216UPB_INLINE upb_FieldRep
1217UPB_PRIVATE(_upb_MiniTableField_GetRep)(const struct upb_MiniTableField* f) {
1218 return (upb_FieldRep)(f->UPB_ONLYBITS(mode) >> kUpb_FieldRep_Shift);
1219}
1220
Protobuf Team Botb3878b52024-02-08 21:50:53 +00001221UPB_API_INLINE bool upb_MiniTableField_IsArray(
Protobuf Team Bote1253cd2024-01-08 23:09:09 +00001222 const struct upb_MiniTableField* f) {
1223 return UPB_PRIVATE(_upb_MiniTableField_Mode)(f) == kUpb_FieldMode_Array;
1224}
1225
Protobuf Team Botb3878b52024-02-08 21:50:53 +00001226UPB_API_INLINE bool upb_MiniTableField_IsMap(
Protobuf Team Bote1253cd2024-01-08 23:09:09 +00001227 const struct upb_MiniTableField* f) {
1228 return UPB_PRIVATE(_upb_MiniTableField_Mode)(f) == kUpb_FieldMode_Map;
1229}
1230
Protobuf Team Botb3878b52024-02-08 21:50:53 +00001231UPB_API_INLINE bool upb_MiniTableField_IsScalar(
Protobuf Team Bote1253cd2024-01-08 23:09:09 +00001232 const struct upb_MiniTableField* f) {
1233 return UPB_PRIVATE(_upb_MiniTableField_Mode)(f) == kUpb_FieldMode_Scalar;
1234}
1235
1236UPB_INLINE bool UPB_PRIVATE(_upb_MiniTableField_IsAlternate)(
1237 const struct upb_MiniTableField* f) {
1238 return (f->UPB_ONLYBITS(mode) & kUpb_LabelFlags_IsAlternate) != 0;
1239}
1240
Protobuf Team Botb3878b52024-02-08 21:50:53 +00001241UPB_API_INLINE bool upb_MiniTableField_IsExtension(
Protobuf Team Bote1253cd2024-01-08 23:09:09 +00001242 const struct upb_MiniTableField* f) {
1243 return (f->UPB_ONLYBITS(mode) & kUpb_LabelFlags_IsExtension) != 0;
1244}
1245
Protobuf Team Botb3878b52024-02-08 21:50:53 +00001246UPB_API_INLINE bool upb_MiniTableField_IsPacked(
Protobuf Team Bote1253cd2024-01-08 23:09:09 +00001247 const struct upb_MiniTableField* f) {
1248 return (f->UPB_ONLYBITS(mode) & kUpb_LabelFlags_IsPacked) != 0;
1249}
1250
Protobuf Team Botb3878b52024-02-08 21:50:53 +00001251UPB_API_INLINE upb_FieldType
1252upb_MiniTableField_Type(const struct upb_MiniTableField* f) {
Protobuf Team Bote1253cd2024-01-08 23:09:09 +00001253 const upb_FieldType type = (upb_FieldType)f->UPB_PRIVATE(descriptortype);
1254 if (UPB_PRIVATE(_upb_MiniTableField_IsAlternate)(f)) {
1255 if (type == kUpb_FieldType_Int32) return kUpb_FieldType_Enum;
1256 if (type == kUpb_FieldType_Bytes) return kUpb_FieldType_String;
1257 UPB_ASSERT(false);
1258 }
1259 return type;
1260}
1261
Protobuf Team Botb3878b52024-02-08 21:50:53 +00001262UPB_API_INLINE
1263upb_CType upb_MiniTableField_CType(const struct upb_MiniTableField* f) {
1264 return upb_FieldType_CType(upb_MiniTableField_Type(f));
Protobuf Team Bote1253cd2024-01-08 23:09:09 +00001265}
1266
1267UPB_INLINE bool UPB_PRIVATE(_upb_MiniTableField_HasHasbit)(
1268 const struct upb_MiniTableField* f) {
1269 return f->presence > 0;
1270}
1271
1272UPB_INLINE char UPB_PRIVATE(_upb_MiniTableField_HasbitMask)(
1273 const struct upb_MiniTableField* f) {
1274 UPB_ASSERT(UPB_PRIVATE(_upb_MiniTableField_HasHasbit)(f));
1275 const size_t index = f->presence;
1276 return 1 << (index % 8);
1277}
1278
1279UPB_INLINE size_t UPB_PRIVATE(_upb_MiniTableField_HasbitOffset)(
1280 const struct upb_MiniTableField* f) {
1281 UPB_ASSERT(UPB_PRIVATE(_upb_MiniTableField_HasHasbit)(f));
1282 const size_t index = f->presence;
1283 return index / 8;
1284}
1285
Protobuf Team Botb3878b52024-02-08 21:50:53 +00001286UPB_API_INLINE bool upb_MiniTableField_IsClosedEnum(
Protobuf Team Bote1253cd2024-01-08 23:09:09 +00001287 const struct upb_MiniTableField* f) {
1288 return f->UPB_PRIVATE(descriptortype) == kUpb_FieldType_Enum;
1289}
1290
Protobuf Team Bot89587682024-02-29 17:19:51 +00001291UPB_API_INLINE bool upb_MiniTableField_IsInOneof(
Protobuf Team Bote1253cd2024-01-08 23:09:09 +00001292 const struct upb_MiniTableField* f) {
1293 return f->presence < 0;
1294}
1295
Protobuf Team Botb3878b52024-02-08 21:50:53 +00001296UPB_API_INLINE bool upb_MiniTableField_IsSubMessage(
Protobuf Team Bote1253cd2024-01-08 23:09:09 +00001297 const struct upb_MiniTableField* f) {
1298 return f->UPB_PRIVATE(descriptortype) == kUpb_FieldType_Message ||
1299 f->UPB_PRIVATE(descriptortype) == kUpb_FieldType_Group;
1300}
1301
Protobuf Team Botb3878b52024-02-08 21:50:53 +00001302UPB_API_INLINE bool upb_MiniTableField_HasPresence(
Protobuf Team Bote1253cd2024-01-08 23:09:09 +00001303 const struct upb_MiniTableField* f) {
Protobuf Team Botb3878b52024-02-08 21:50:53 +00001304 if (upb_MiniTableField_IsExtension(f)) {
1305 return upb_MiniTableField_IsScalar(f);
Protobuf Team Bote1253cd2024-01-08 23:09:09 +00001306 } else {
1307 return f->presence != 0;
1308 }
1309}
1310
Protobuf Team Botb3878b52024-02-08 21:50:53 +00001311UPB_API_INLINE uint32_t
1312upb_MiniTableField_Number(const struct upb_MiniTableField* f) {
Protobuf Team Bote1253cd2024-01-08 23:09:09 +00001313 return f->UPB_ONLYBITS(number);
1314}
1315
1316UPB_INLINE uint16_t
1317UPB_PRIVATE(_upb_MiniTableField_Offset)(const struct upb_MiniTableField* f) {
1318 return f->UPB_ONLYBITS(offset);
1319}
1320
1321UPB_INLINE size_t UPB_PRIVATE(_upb_MiniTableField_OneofOffset)(
1322 const struct upb_MiniTableField* f) {
Protobuf Team Botb3878b52024-02-08 21:50:53 +00001323 UPB_ASSERT(upb_MiniTableField_IsInOneof(f));
Protobuf Team Bote1253cd2024-01-08 23:09:09 +00001324 return ~(ptrdiff_t)f->presence;
1325}
1326
1327UPB_INLINE void UPB_PRIVATE(_upb_MiniTableField_CheckIsArray)(
1328 const struct upb_MiniTableField* f) {
1329 UPB_ASSUME(UPB_PRIVATE(_upb_MiniTableField_GetRep)(f) ==
1330 kUpb_FieldRep_NativePointer);
Protobuf Team Botb3878b52024-02-08 21:50:53 +00001331 UPB_ASSUME(upb_MiniTableField_IsArray(f));
Protobuf Team Bote1253cd2024-01-08 23:09:09 +00001332 UPB_ASSUME(f->presence == 0);
1333}
1334
1335UPB_INLINE void UPB_PRIVATE(_upb_MiniTableField_CheckIsMap)(
1336 const struct upb_MiniTableField* f) {
1337 UPB_ASSUME(UPB_PRIVATE(_upb_MiniTableField_GetRep)(f) ==
1338 kUpb_FieldRep_NativePointer);
Protobuf Team Botb3878b52024-02-08 21:50:53 +00001339 UPB_ASSUME(upb_MiniTableField_IsMap(f));
Protobuf Team Bote1253cd2024-01-08 23:09:09 +00001340 UPB_ASSUME(f->presence == 0);
1341}
1342
1343UPB_INLINE size_t UPB_PRIVATE(_upb_MiniTableField_ElemSizeLg2)(
1344 const struct upb_MiniTableField* f) {
Protobuf Team Botb3878b52024-02-08 21:50:53 +00001345 const upb_FieldType field_type = upb_MiniTableField_Type(f);
Protobuf Team Bote1253cd2024-01-08 23:09:09 +00001346 return UPB_PRIVATE(_upb_FieldType_SizeLg2)(field_type);
1347}
1348
1349// LINT.ThenChange(//depot/google3/third_party/upb/bits/typescript/mini_table_field.ts)
1350
1351#ifdef __cplusplus
1352} /* extern "C" */
1353#endif
1354
1355
1356#endif /* UPB_MINI_TABLE_INTERNAL_FIELD_H_ */
1357
1358// Must be last.
1359
1360typedef struct upb_MiniTableField upb_MiniTableField;
1361
1362#ifdef __cplusplus
1363extern "C" {
1364#endif
1365
Protobuf Team Botb3878b52024-02-08 21:50:53 +00001366UPB_API_INLINE upb_CType upb_MiniTableField_CType(const upb_MiniTableField* f);
Protobuf Team Bote1253cd2024-01-08 23:09:09 +00001367
Protobuf Team Botb3878b52024-02-08 21:50:53 +00001368UPB_API_INLINE bool upb_MiniTableField_HasPresence(const upb_MiniTableField* f);
Protobuf Team Bote1253cd2024-01-08 23:09:09 +00001369
Protobuf Team Botb3878b52024-02-08 21:50:53 +00001370UPB_API_INLINE bool upb_MiniTableField_IsArray(const upb_MiniTableField* f);
Protobuf Team Bote1253cd2024-01-08 23:09:09 +00001371
1372UPB_API_INLINE bool upb_MiniTableField_IsClosedEnum(
Protobuf Team Botb3878b52024-02-08 21:50:53 +00001373 const upb_MiniTableField* f);
Protobuf Team Bote1253cd2024-01-08 23:09:09 +00001374
Protobuf Team Botb3878b52024-02-08 21:50:53 +00001375UPB_API_INLINE bool upb_MiniTableField_IsExtension(const upb_MiniTableField* f);
Protobuf Team Bote1253cd2024-01-08 23:09:09 +00001376
Protobuf Team Botb3878b52024-02-08 21:50:53 +00001377UPB_API_INLINE bool upb_MiniTableField_IsInOneof(const upb_MiniTableField* f);
Protobuf Team Bote1253cd2024-01-08 23:09:09 +00001378
Protobuf Team Botb3878b52024-02-08 21:50:53 +00001379UPB_API_INLINE bool upb_MiniTableField_IsMap(const upb_MiniTableField* f);
Protobuf Team Bote1253cd2024-01-08 23:09:09 +00001380
Protobuf Team Botb3878b52024-02-08 21:50:53 +00001381UPB_API_INLINE bool upb_MiniTableField_IsPacked(const upb_MiniTableField* f);
Protobuf Team Bote1253cd2024-01-08 23:09:09 +00001382
Protobuf Team Botb3878b52024-02-08 21:50:53 +00001383UPB_API_INLINE bool upb_MiniTableField_IsScalar(const upb_MiniTableField* f);
Protobuf Team Bote1253cd2024-01-08 23:09:09 +00001384
1385UPB_API_INLINE bool upb_MiniTableField_IsSubMessage(
Protobuf Team Botb3878b52024-02-08 21:50:53 +00001386 const upb_MiniTableField* f);
Protobuf Team Bote1253cd2024-01-08 23:09:09 +00001387
Protobuf Team Botb3878b52024-02-08 21:50:53 +00001388UPB_API_INLINE uint32_t upb_MiniTableField_Number(const upb_MiniTableField* f);
Protobuf Team Bote1253cd2024-01-08 23:09:09 +00001389
1390UPB_API_INLINE upb_FieldType
Protobuf Team Botb3878b52024-02-08 21:50:53 +00001391upb_MiniTableField_Type(const upb_MiniTableField* f);
Protobuf Team Bote1253cd2024-01-08 23:09:09 +00001392
1393#ifdef __cplusplus
1394} /* extern "C" */
1395#endif
1396
1397
1398#endif /* UPB_MINI_TABLE_FIELD_H_ */
1399
Protobuf Team Bot886a0b12024-01-26 21:23:01 +00001400#ifndef UPB_MINI_TABLE_MESSAGE_H_
1401#define UPB_MINI_TABLE_MESSAGE_H_
1402
1403
1404#ifndef UPB_MINI_TABLE_ENUM_H_
1405#define UPB_MINI_TABLE_ENUM_H_
1406
1407#include <stdint.h>
1408
1409
1410#ifndef UPB_MINI_TABLE_INTERNAL_ENUM_H_
1411#define UPB_MINI_TABLE_INTERNAL_ENUM_H_
1412
1413#include <stdint.h>
1414
1415// Must be last.
1416
1417struct upb_MiniTableEnum {
1418 uint32_t UPB_PRIVATE(mask_limit); // Highest that can be tested with mask.
1419 uint32_t UPB_PRIVATE(value_count); // Number of values after the bitfield.
1420 uint32_t UPB_PRIVATE(data)[]; // Bitmask + enumerated values follow.
1421};
1422
1423#ifdef __cplusplus
1424extern "C" {
1425#endif
1426
Protobuf Team Botb3878b52024-02-08 21:50:53 +00001427UPB_API_INLINE bool upb_MiniTableEnum_CheckValue(
Protobuf Team Bot886a0b12024-01-26 21:23:01 +00001428 const struct upb_MiniTableEnum* e, uint32_t val) {
1429 if (UPB_LIKELY(val < 64)) {
1430 const uint64_t mask =
1431 e->UPB_PRIVATE(data)[0] | ((uint64_t)e->UPB_PRIVATE(data)[1] << 32);
1432 const uint64_t bit = 1ULL << val;
1433 return (mask & bit) != 0;
1434 }
1435 if (UPB_LIKELY(val < e->UPB_PRIVATE(mask_limit))) {
1436 const uint32_t mask = e->UPB_PRIVATE(data)[val / 32];
1437 const uint32_t bit = 1ULL << (val % 32);
1438 return (mask & bit) != 0;
1439 }
1440
1441 // OPT: binary search long lists?
1442 const uint32_t* start =
1443 &e->UPB_PRIVATE(data)[e->UPB_PRIVATE(mask_limit) / 32];
1444 const uint32_t* limit = &e->UPB_PRIVATE(
1445 data)[e->UPB_PRIVATE(mask_limit) / 32 + e->UPB_PRIVATE(value_count)];
1446 for (const uint32_t* p = start; p < limit; p++) {
1447 if (*p == val) return true;
1448 }
1449 return false;
1450}
1451
1452#ifdef __cplusplus
1453} /* extern "C" */
1454#endif
1455
1456
1457#endif /* UPB_MINI_TABLE_INTERNAL_ENUM_H_ */
1458
1459// Must be last
1460
1461typedef struct upb_MiniTableEnum upb_MiniTableEnum;
1462
1463#ifdef __cplusplus
1464extern "C" {
1465#endif
1466
1467// Validates enum value against range defined by enum mini table.
Protobuf Team Botb3878b52024-02-08 21:50:53 +00001468UPB_API_INLINE bool upb_MiniTableEnum_CheckValue(const upb_MiniTableEnum* e,
1469 uint32_t val);
Protobuf Team Bot886a0b12024-01-26 21:23:01 +00001470
1471#ifdef __cplusplus
1472} /* extern "C" */
1473#endif
1474
1475
1476#endif /* UPB_MINI_TABLE_ENUM_H_ */
1477
Protobuf Team Bote1253cd2024-01-08 23:09:09 +00001478#ifndef UPB_MINI_TABLE_INTERNAL_MESSAGE_H_
1479#define UPB_MINI_TABLE_INTERNAL_MESSAGE_H_
1480
Protobuf Team Botd1cf09a2024-04-19 22:43:34 +00001481#include <stddef.h>
Protobuf Team Bote1253cd2024-01-08 23:09:09 +00001482#include <stdint.h>
1483
1484
1485#ifndef UPB_MINI_TABLE_INTERNAL_SUB_H_
1486#define UPB_MINI_TABLE_INTERNAL_SUB_H_
1487
1488// Must be last.
1489
Protobuf Team Bot532f0c22024-06-05 03:21:24 +00001490typedef union {
1491 const struct upb_MiniTable* const* UPB_PRIVATE(submsg);
1492 const struct upb_MiniTableEnum* UPB_PRIVATE(subenum);
1493} upb_MiniTableSubInternal;
1494
Protobuf Team Bote1253cd2024-01-08 23:09:09 +00001495union upb_MiniTableSub {
1496 const struct upb_MiniTable* UPB_PRIVATE(submsg);
1497 const struct upb_MiniTableEnum* UPB_PRIVATE(subenum);
1498};
1499
1500#ifdef __cplusplus
1501extern "C" {
1502#endif
1503
Protobuf Team Botb3878b52024-02-08 21:50:53 +00001504UPB_API_INLINE union upb_MiniTableSub upb_MiniTableSub_FromEnum(
Protobuf Team Bote1253cd2024-01-08 23:09:09 +00001505 const struct upb_MiniTableEnum* subenum) {
1506 union upb_MiniTableSub out;
1507 out.UPB_PRIVATE(subenum) = subenum;
1508 return out;
1509}
1510
Protobuf Team Botb3878b52024-02-08 21:50:53 +00001511UPB_API_INLINE union upb_MiniTableSub upb_MiniTableSub_FromMessage(
Protobuf Team Bote1253cd2024-01-08 23:09:09 +00001512 const struct upb_MiniTable* submsg) {
1513 union upb_MiniTableSub out;
1514 out.UPB_PRIVATE(submsg) = submsg;
1515 return out;
1516}
1517
Protobuf Team Botb3878b52024-02-08 21:50:53 +00001518UPB_API_INLINE const struct upb_MiniTableEnum* upb_MiniTableSub_Enum(
Protobuf Team Bote1253cd2024-01-08 23:09:09 +00001519 const union upb_MiniTableSub sub) {
1520 return sub.UPB_PRIVATE(subenum);
1521}
1522
Protobuf Team Botb3878b52024-02-08 21:50:53 +00001523UPB_API_INLINE const struct upb_MiniTable* upb_MiniTableSub_Message(
Protobuf Team Bote1253cd2024-01-08 23:09:09 +00001524 const union upb_MiniTableSub sub) {
1525 return sub.UPB_PRIVATE(submsg);
1526}
1527
1528#ifdef __cplusplus
1529} /* extern "C" */
1530#endif
1531
1532
1533#endif /* UPB_MINI_TABLE_INTERNAL_SUB_H_ */
1534
1535// Must be last.
1536
1537struct upb_Decoder;
Protobuf Team Botc12c96e2024-01-16 07:41:08 +00001538struct upb_Message;
Protobuf Team Bote1253cd2024-01-08 23:09:09 +00001539typedef const char* _upb_FieldParser(struct upb_Decoder* d, const char* ptr,
1540 struct upb_Message* msg, intptr_t table,
1541 uint64_t hasbits, uint64_t data);
1542typedef struct {
1543 uint64_t field_data;
1544 _upb_FieldParser* field_parser;
1545} _upb_FastTable_Entry;
1546
1547typedef enum {
1548 kUpb_ExtMode_NonExtendable = 0, // Non-extendable message.
1549 kUpb_ExtMode_Extendable = 1, // Normal extendable message.
1550 kUpb_ExtMode_IsMessageSet = 2, // MessageSet message.
1551 kUpb_ExtMode_IsMessageSet_ITEM =
1552 3, // MessageSet item (temporary only, see decode.c)
1553
1554 // During table building we steal a bit to indicate that the message is a map
1555 // entry. *Only* used during table building!
1556 kUpb_ExtMode_IsMapEntry = 4,
1557} upb_ExtMode;
1558
1559// upb_MiniTable represents the memory layout of a given upb_MessageDef.
1560// The members are public so generated code can initialize them,
1561// but users MUST NOT directly read or write any of its members.
1562
1563// LINT.IfChange(minitable_struct_definition)
1564struct upb_MiniTable {
Protobuf Team Bot532f0c22024-06-05 03:21:24 +00001565 const upb_MiniTableSubInternal* UPB_PRIVATE(subs);
Protobuf Team Bote1253cd2024-01-08 23:09:09 +00001566 const struct upb_MiniTableField* UPB_ONLYBITS(fields);
1567
1568 // Must be aligned to sizeof(void*). Doesn't include internal members like
1569 // unknown fields, extension dict, pointer to msglayout, etc.
1570 uint16_t UPB_PRIVATE(size);
1571
1572 uint16_t UPB_ONLYBITS(field_count);
1573
1574 uint8_t UPB_PRIVATE(ext); // upb_ExtMode, uint8_t here so sizeof(ext) == 1
1575 uint8_t UPB_PRIVATE(dense_below);
1576 uint8_t UPB_PRIVATE(table_mask);
1577 uint8_t UPB_PRIVATE(required_count); // Required fields have the low hasbits.
Protobuf Team Botccfab6a2024-03-07 20:32:42 +00001578
Protobuf Team Bot5d58cb82024-03-06 19:59:18 +00001579#ifdef UPB_TRACING_ENABLED
1580 const char* UPB_PRIVATE(full_name);
1581#endif
Protobuf Team Bote1253cd2024-01-08 23:09:09 +00001582
Protobuf Team Bot5d58cb82024-03-06 19:59:18 +00001583#ifdef UPB_FASTTABLE_ENABLED
Protobuf Team Bote1253cd2024-01-08 23:09:09 +00001584 // To statically initialize the tables of variable length, we need a flexible
1585 // array member, and we need to compile in gnu99 mode (constant initialization
1586 // of flexible array members is a GNU extension, not in C99 unfortunately.
1587 _upb_FastTable_Entry UPB_PRIVATE(fasttable)[];
Protobuf Team Bot5d58cb82024-03-06 19:59:18 +00001588#endif
Protobuf Team Bote1253cd2024-01-08 23:09:09 +00001589};
1590// LINT.ThenChange(//depot/google3/third_party/upb/bits/typescript/mini_table.ts)
1591
1592#ifdef __cplusplus
1593extern "C" {
1594#endif
1595
Protobuf Team Bota9387b52024-06-12 15:17:52 +00001596UPB_INLINE const struct upb_MiniTable* UPB_PRIVATE(
1597 _upb_MiniTable_StrongReference)(const struct upb_MiniTable* mt) {
1598#if defined(__GNUC__)
1599 __asm__("" : : "r"(mt));
1600#else
1601 const struct upb_MiniTable* volatile unused = mt;
1602 (void)&unused; // Use address to avoid an extra load of "unused".
1603#endif
1604 return mt;
1605}
1606
Protobuf Team Bote1253cd2024-01-08 23:09:09 +00001607UPB_INLINE const struct upb_MiniTable* UPB_PRIVATE(_upb_MiniTable_Empty)(void) {
1608 extern const struct upb_MiniTable UPB_PRIVATE(_kUpb_MiniTable_Empty);
1609
1610 return &UPB_PRIVATE(_kUpb_MiniTable_Empty);
1611}
1612
Protobuf Team Botb3878b52024-02-08 21:50:53 +00001613UPB_API_INLINE int upb_MiniTable_FieldCount(const struct upb_MiniTable* m) {
Protobuf Team Bote1253cd2024-01-08 23:09:09 +00001614 return m->UPB_ONLYBITS(field_count);
1615}
1616
1617UPB_INLINE bool UPB_PRIVATE(_upb_MiniTable_IsEmpty)(
1618 const struct upb_MiniTable* m) {
1619 extern const struct upb_MiniTable UPB_PRIVATE(_kUpb_MiniTable_Empty);
1620
1621 return m == &UPB_PRIVATE(_kUpb_MiniTable_Empty);
1622}
1623
Protobuf Team Botb3878b52024-02-08 21:50:53 +00001624UPB_API_INLINE const struct upb_MiniTableField* upb_MiniTable_GetFieldByIndex(
1625 const struct upb_MiniTable* m, uint32_t i) {
Protobuf Team Bote1253cd2024-01-08 23:09:09 +00001626 return &m->UPB_ONLYBITS(fields)[i];
1627}
1628
Protobuf Team Bot532f0c22024-06-05 03:21:24 +00001629UPB_INLINE const struct upb_MiniTable* UPB_PRIVATE(
1630 _upb_MiniTable_GetSubTableByIndex)(const struct upb_MiniTable* m,
1631 uint32_t i) {
1632 return *m->UPB_PRIVATE(subs)[i].UPB_PRIVATE(submsg);
Protobuf Team Bote1253cd2024-01-08 23:09:09 +00001633}
1634
Protobuf Team Botb3878b52024-02-08 21:50:53 +00001635UPB_API_INLINE const struct upb_MiniTable* upb_MiniTable_SubMessage(
Protobuf Team Bot886a0b12024-01-26 21:23:01 +00001636 const struct upb_MiniTable* m, const struct upb_MiniTableField* f) {
Protobuf Team Botb3878b52024-02-08 21:50:53 +00001637 if (upb_MiniTableField_CType(f) != kUpb_CType_Message) {
Protobuf Team Bot886a0b12024-01-26 21:23:01 +00001638 return NULL;
1639 }
Protobuf Team Bot532f0c22024-06-05 03:21:24 +00001640 return UPB_PRIVATE(_upb_MiniTable_GetSubTableByIndex)(
1641 m, f->UPB_PRIVATE(submsg_index));
Protobuf Team Botd1cf09a2024-04-19 22:43:34 +00001642}
1643
1644UPB_API_INLINE const struct upb_MiniTable* upb_MiniTable_GetSubMessageTable(
1645 const struct upb_MiniTable* m, const struct upb_MiniTableField* f) {
1646 UPB_ASSUME(upb_MiniTableField_CType(f) == kUpb_CType_Message);
1647 const struct upb_MiniTable* ret = upb_MiniTable_SubMessage(m, f);
1648 UPB_ASSUME(ret);
1649 return UPB_PRIVATE(_upb_MiniTable_IsEmpty)(ret) ? NULL : ret;
1650}
1651
1652UPB_API_INLINE bool upb_MiniTable_FieldIsLinked(
1653 const struct upb_MiniTable* m, const struct upb_MiniTableField* f) {
1654 return upb_MiniTable_GetSubMessageTable(m, f) != NULL;
1655}
1656
1657UPB_API_INLINE const struct upb_MiniTable* upb_MiniTable_MapEntrySubMessage(
1658 const struct upb_MiniTable* m, const struct upb_MiniTableField* f) {
1659 UPB_ASSERT(upb_MiniTable_FieldIsLinked(m, f)); // Map entries must be linked.
1660 UPB_ASSERT(upb_MiniTableField_IsMap(f)); // Function precondition.
1661 return upb_MiniTable_SubMessage(m, f);
Protobuf Team Bot886a0b12024-01-26 21:23:01 +00001662}
1663
Protobuf Team Botb3878b52024-02-08 21:50:53 +00001664UPB_API_INLINE const struct upb_MiniTableEnum* upb_MiniTable_GetSubEnumTable(
Protobuf Team Bote1253cd2024-01-08 23:09:09 +00001665 const struct upb_MiniTable* m, const struct upb_MiniTableField* f) {
Protobuf Team Botb3878b52024-02-08 21:50:53 +00001666 UPB_ASSERT(upb_MiniTableField_CType(f) == kUpb_CType_Enum);
Protobuf Team Botd1cf09a2024-04-19 22:43:34 +00001667 return m->UPB_PRIVATE(subs)[f->UPB_PRIVATE(submsg_index)].UPB_PRIVATE(
1668 subenum);
Protobuf Team Botb3878b52024-02-08 21:50:53 +00001669}
1670
1671UPB_API_INLINE const struct upb_MiniTableField* upb_MiniTable_MapKey(
1672 const struct upb_MiniTable* m) {
1673 UPB_ASSERT(upb_MiniTable_FieldCount(m) == 2);
1674 const struct upb_MiniTableField* f = upb_MiniTable_GetFieldByIndex(m, 0);
1675 UPB_ASSERT(upb_MiniTableField_Number(f) == 1);
1676 return f;
1677}
1678
1679UPB_API_INLINE const struct upb_MiniTableField* upb_MiniTable_MapValue(
1680 const struct upb_MiniTable* m) {
1681 UPB_ASSERT(upb_MiniTable_FieldCount(m) == 2);
1682 const struct upb_MiniTableField* f = upb_MiniTable_GetFieldByIndex(m, 1);
1683 UPB_ASSERT(upb_MiniTableField_Number(f) == 2);
1684 return f;
1685}
1686
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00001687// Computes a bitmask in which the |m->required_count| lowest bits are set.
Protobuf Team Bote1253cd2024-01-08 23:09:09 +00001688//
1689// Sample output:
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00001690// RequiredMask(1) => 0b1 (0x1)
1691// RequiredMask(5) => 0b11111 (0x1f)
Protobuf Team Bote1253cd2024-01-08 23:09:09 +00001692UPB_INLINE uint64_t
1693UPB_PRIVATE(_upb_MiniTable_RequiredMask)(const struct upb_MiniTable* m) {
1694 int n = m->UPB_PRIVATE(required_count);
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00001695 UPB_ASSERT(0 < n && n <= 64);
1696 return (1ULL << n) - 1;
Protobuf Team Bote1253cd2024-01-08 23:09:09 +00001697}
1698
Protobuf Team Bot5d58cb82024-03-06 19:59:18 +00001699#ifdef UPB_TRACING_ENABLED
1700UPB_INLINE const char* upb_MiniTable_FullName(
1701 const struct upb_MiniTable* mini_table) {
1702 return mini_table->UPB_PRIVATE(full_name);
1703}
Protobuf Team Botccfab6a2024-03-07 20:32:42 +00001704// Initializes tracing proto name from language runtimes that construct
1705// mini tables dynamically at runtime. The runtime is responsible for passing
1706// controlling lifetime of name such as storing in same arena as mini_table.
Protobuf Team Bot3ee01202024-03-07 23:27:46 +00001707UPB_INLINE void upb_MiniTable_SetFullName(struct upb_MiniTable* mini_table,
1708 const char* full_name) {
Protobuf Team Botccfab6a2024-03-07 20:32:42 +00001709 mini_table->UPB_PRIVATE(full_name) = full_name;
1710}
Protobuf Team Bot5d58cb82024-03-06 19:59:18 +00001711#endif
1712
Protobuf Team Bote1253cd2024-01-08 23:09:09 +00001713#ifdef __cplusplus
1714} /* extern "C" */
1715#endif
1716
1717
1718#endif /* UPB_MINI_TABLE_INTERNAL_MESSAGE_H_ */
1719
1720// Must be last.
1721
1722typedef struct upb_MiniTable upb_MiniTable;
1723
1724#ifdef __cplusplus
1725extern "C" {
1726#endif
1727
1728UPB_API const upb_MiniTableField* upb_MiniTable_FindFieldByNumber(
1729 const upb_MiniTable* m, uint32_t number);
1730
1731UPB_API_INLINE const upb_MiniTableField* upb_MiniTable_GetFieldByIndex(
Protobuf Team Botb3878b52024-02-08 21:50:53 +00001732 const upb_MiniTable* m, uint32_t index);
Protobuf Team Bote1253cd2024-01-08 23:09:09 +00001733
Protobuf Team Botb3878b52024-02-08 21:50:53 +00001734UPB_API_INLINE int upb_MiniTable_FieldCount(const upb_MiniTable* m);
Protobuf Team Bote1253cd2024-01-08 23:09:09 +00001735
Protobuf Team Bot886a0b12024-01-26 21:23:01 +00001736// DEPRECATED: use upb_MiniTable_SubMessage() instead
Protobuf Team Bote1253cd2024-01-08 23:09:09 +00001737// Returns the MiniTable for a message field, NULL if the field is unlinked.
1738UPB_API_INLINE const upb_MiniTable* upb_MiniTable_GetSubMessageTable(
Protobuf Team Botb3878b52024-02-08 21:50:53 +00001739 const upb_MiniTable* m, const upb_MiniTableField* f);
Protobuf Team Bote1253cd2024-01-08 23:09:09 +00001740
Protobuf Team Botd1cf09a2024-04-19 22:43:34 +00001741// Returns the MiniTable for a message field if it is a submessage, otherwise
1742// returns NULL.
1743//
1744// WARNING: if dynamic tree shaking is in use, the return value may be the
1745// "empty", zero-field placeholder message instead of the real message type.
1746// If the message is later linked, this function will begin returning the real
1747// message type.
Protobuf Team Bot886a0b12024-01-26 21:23:01 +00001748UPB_API_INLINE const upb_MiniTable* upb_MiniTable_SubMessage(
Protobuf Team Botb3878b52024-02-08 21:50:53 +00001749 const upb_MiniTable* m, const upb_MiniTableField* f);
Protobuf Team Bot886a0b12024-01-26 21:23:01 +00001750
Protobuf Team Botd1cf09a2024-04-19 22:43:34 +00001751// Returns the MiniTable for a map field. The given field must refer to a map.
1752UPB_API_INLINE const upb_MiniTable* upb_MiniTable_MapEntrySubMessage(
1753 const upb_MiniTable* m, const upb_MiniTableField* f);
1754
Protobuf Team Bote1253cd2024-01-08 23:09:09 +00001755// Returns the MiniTableEnum for a message field, NULL if the field is unlinked.
1756UPB_API_INLINE const upb_MiniTableEnum* upb_MiniTable_GetSubEnumTable(
Protobuf Team Botb3878b52024-02-08 21:50:53 +00001757 const upb_MiniTable* m, const upb_MiniTableField* f);
Protobuf Team Bote1253cd2024-01-08 23:09:09 +00001758
1759// Returns the MiniTableField for the key of a map.
1760UPB_API_INLINE const upb_MiniTableField* upb_MiniTable_MapKey(
Protobuf Team Botb3878b52024-02-08 21:50:53 +00001761 const upb_MiniTable* m);
Protobuf Team Bote1253cd2024-01-08 23:09:09 +00001762
1763// Returns the MiniTableField for the value of a map.
1764UPB_API_INLINE const upb_MiniTableField* upb_MiniTable_MapValue(
Protobuf Team Botb3878b52024-02-08 21:50:53 +00001765 const upb_MiniTable* m);
Protobuf Team Bote1253cd2024-01-08 23:09:09 +00001766
1767// Returns true if this MiniTable field is linked to a MiniTable for the
1768// sub-message.
Protobuf Team Bot54f512b2024-04-08 18:30:15 +00001769UPB_API_INLINE bool upb_MiniTable_FieldIsLinked(const upb_MiniTable* m,
1770 const upb_MiniTableField* f);
Protobuf Team Bote1253cd2024-01-08 23:09:09 +00001771
1772// If this field is in a oneof, returns the first field in the oneof.
1773//
1774// Otherwise returns NULL.
1775//
1776// Usage:
1777// const upb_MiniTableField* field = upb_MiniTable_GetOneof(m, f);
1778// do {
1779// ..
1780// } while (upb_MiniTable_NextOneofField(m, &field);
1781//
1782const upb_MiniTableField* upb_MiniTable_GetOneof(const upb_MiniTable* m,
1783 const upb_MiniTableField* f);
1784
1785// Iterates to the next field in the oneof. If this is the last field in the
1786// oneof, returns false. The ordering of fields in the oneof is not
1787// guaranteed.
1788// REQUIRES: |f| is the field initialized by upb_MiniTable_GetOneof and updated
1789// by prior upb_MiniTable_NextOneofField calls.
1790bool upb_MiniTable_NextOneofField(const upb_MiniTable* m,
1791 const upb_MiniTableField** f);
1792
1793#ifdef __cplusplus
1794} /* extern "C" */
1795#endif
1796
1797
1798#endif /* UPB_MINI_TABLE_MESSAGE_H_ */
1799
1800// Must be last.
1801
Protobuf Team Bot886a0b12024-01-26 21:23:01 +00001802typedef struct upb_Array upb_Array;
1803
1804#ifdef __cplusplus
1805extern "C" {
1806#endif
1807
1808// Creates a new array on the given arena that holds elements of this type.
1809UPB_API upb_Array* upb_Array_New(upb_Arena* a, upb_CType type);
1810
1811// Returns the number of elements in the array.
Protobuf Team Botb3878b52024-02-08 21:50:53 +00001812UPB_API_INLINE size_t upb_Array_Size(const upb_Array* arr);
Protobuf Team Bot886a0b12024-01-26 21:23:01 +00001813
1814// Returns the given element, which must be within the array's current size.
1815UPB_API upb_MessageValue upb_Array_Get(const upb_Array* arr, size_t i);
1816
1817// Returns a mutating pointer to the given element, which must be within the
1818// array's current size.
1819UPB_API upb_MutableMessageValue upb_Array_GetMutable(upb_Array* arr, size_t i);
1820
1821// Sets the given element, which must be within the array's current size.
1822UPB_API void upb_Array_Set(upb_Array* arr, size_t i, upb_MessageValue val);
1823
1824// Appends an element to the array. Returns false on allocation failure.
1825UPB_API bool upb_Array_Append(upb_Array* array, upb_MessageValue val,
1826 upb_Arena* arena);
1827
1828// Moves elements within the array using memmove().
1829// Like memmove(), the source and destination elements may be overlapping.
1830UPB_API void upb_Array_Move(upb_Array* array, size_t dst_idx, size_t src_idx,
1831 size_t count);
1832
1833// Inserts one or more empty elements into the array.
1834// Existing elements are shifted right.
1835// The new elements have undefined state and must be set with `upb_Array_Set()`.
1836// REQUIRES: `i <= upb_Array_Size(arr)`
1837UPB_API bool upb_Array_Insert(upb_Array* array, size_t i, size_t count,
1838 upb_Arena* arena);
1839
1840// Deletes one or more elements from the array.
1841// Existing elements are shifted left.
1842// REQUIRES: `i + count <= upb_Array_Size(arr)`
1843UPB_API void upb_Array_Delete(upb_Array* array, size_t i, size_t count);
1844
Protobuf Team Bot4b6de0f2024-03-29 19:09:40 +00001845// Reserves |size| elements of storage for the array.
1846UPB_API_INLINE bool upb_Array_Reserve(struct upb_Array* array, size_t size,
1847 upb_Arena* arena);
1848
Protobuf Team Bot886a0b12024-01-26 21:23:01 +00001849// Changes the size of a vector. New elements are initialized to NULL/0.
1850// Returns false on allocation failure.
1851UPB_API bool upb_Array_Resize(upb_Array* array, size_t size, upb_Arena* arena);
1852
1853// Returns pointer to array data.
Protobuf Team Botb3878b52024-02-08 21:50:53 +00001854UPB_API_INLINE const void* upb_Array_DataPtr(const upb_Array* arr);
Protobuf Team Bot886a0b12024-01-26 21:23:01 +00001855
1856// Returns mutable pointer to array data.
Protobuf Team Botb3878b52024-02-08 21:50:53 +00001857UPB_API_INLINE void* upb_Array_MutableDataPtr(upb_Array* arr);
Protobuf Team Bot886a0b12024-01-26 21:23:01 +00001858
1859// Mark an array and all of its descendents as frozen/immutable.
1860// If the array elements are messages then |m| must point to the minitable for
1861// those messages. Otherwise |m| must be NULL.
1862UPB_API void upb_Array_Freeze(upb_Array* arr, const upb_MiniTable* m);
1863
1864// Returns whether an array has been frozen.
Protobuf Team Botb3878b52024-02-08 21:50:53 +00001865UPB_API_INLINE bool upb_Array_IsFrozen(const upb_Array* arr);
Protobuf Team Bot886a0b12024-01-26 21:23:01 +00001866
1867#ifdef __cplusplus
1868} /* extern "C" */
1869#endif
1870
1871
1872#endif /* UPB_MESSAGE_ARRAY_H_ */
1873
1874#ifndef UPB_MESSAGE_INTERNAL_ACCESSORS_H_
1875#define UPB_MESSAGE_INTERNAL_ACCESSORS_H_
1876
1877#include <stddef.h>
1878#include <stdint.h>
1879#include <string.h>
1880
1881
1882#ifndef UPB_BASE_INTERNAL_ENDIAN_H_
1883#define UPB_BASE_INTERNAL_ENDIAN_H_
1884
1885#include <stdint.h>
1886
1887// Must be last.
1888
1889#ifdef __cplusplus
1890extern "C" {
1891#endif
1892
1893UPB_INLINE bool upb_IsLittleEndian(void) {
1894 const int x = 1;
1895 return *(char*)&x == 1;
1896}
1897
1898UPB_INLINE uint32_t upb_BigEndian32(uint32_t val) {
1899 if (upb_IsLittleEndian()) return val;
1900
1901 return ((val & 0xff) << 24) | ((val & 0xff00) << 8) |
1902 ((val & 0xff0000) >> 8) | ((val & 0xff000000) >> 24);
1903}
1904
1905UPB_INLINE uint64_t upb_BigEndian64(uint64_t val) {
1906 if (upb_IsLittleEndian()) return val;
1907
1908 const uint64_t hi = ((uint64_t)upb_BigEndian32((uint32_t)val)) << 32;
1909 const uint64_t lo = upb_BigEndian32((uint32_t)(val >> 32));
1910 return hi | lo;
1911}
1912
1913#ifdef __cplusplus
1914} /* extern "C" */
1915#endif
1916
1917
1918#endif /* UPB_BASE_INTERNAL_ENDIAN_H_ */
1919
1920#ifndef UPB_MESSAGE_INTERNAL_EXTENSION_H_
1921#define UPB_MESSAGE_INTERNAL_EXTENSION_H_
1922
Protobuf Team Bot4df6e042024-01-30 19:27:52 +00001923#include <stddef.h>
Protobuf Team Bot886a0b12024-01-26 21:23:01 +00001924
Protobuf Team Bote1253cd2024-01-08 23:09:09 +00001925
1926#ifndef UPB_MINI_TABLE_EXTENSION_H_
1927#define UPB_MINI_TABLE_EXTENSION_H_
1928
1929#include <stdint.h>
1930
1931
1932#ifndef UPB_MINI_TABLE_INTERNAL_EXTENSION_H_
1933#define UPB_MINI_TABLE_INTERNAL_EXTENSION_H_
1934
Protobuf Team Boteb31de32024-05-09 22:09:21 +00001935#include <stddef.h>
Protobuf Team Bote1253cd2024-01-08 23:09:09 +00001936#include <stdint.h>
1937
1938
1939// Must be last.
1940
1941struct upb_MiniTableExtension {
1942 // Do not move this field. We need to be able to alias pointers.
1943 struct upb_MiniTableField UPB_PRIVATE(field);
1944
1945 const struct upb_MiniTable* UPB_PRIVATE(extendee);
1946 union upb_MiniTableSub UPB_PRIVATE(sub); // NULL unless submsg or proto2 enum
1947};
1948
1949#ifdef __cplusplus
1950extern "C" {
1951#endif
1952
Protobuf Team Botb3878b52024-02-08 21:50:53 +00001953UPB_API_INLINE upb_CType
1954upb_MiniTableExtension_CType(const struct upb_MiniTableExtension* e) {
1955 return upb_MiniTableField_CType(&e->UPB_PRIVATE(field));
Protobuf Team Bote1253cd2024-01-08 23:09:09 +00001956}
1957
Protobuf Team Botb3878b52024-02-08 21:50:53 +00001958UPB_API_INLINE uint32_t
1959upb_MiniTableExtension_Number(const struct upb_MiniTableExtension* e) {
Protobuf Team Bote1253cd2024-01-08 23:09:09 +00001960 return e->UPB_PRIVATE(field).UPB_ONLYBITS(number);
1961}
1962
Protobuf Team Botb3878b52024-02-08 21:50:53 +00001963UPB_API_INLINE const struct upb_MiniTable* upb_MiniTableExtension_GetSubMessage(
Protobuf Team Bote1253cd2024-01-08 23:09:09 +00001964 const struct upb_MiniTableExtension* e) {
Protobuf Team Boteb31de32024-05-09 22:09:21 +00001965 if (upb_MiniTableExtension_CType(e) != kUpb_CType_Message) {
1966 return NULL;
1967 }
Protobuf Team Botb3878b52024-02-08 21:50:53 +00001968 return upb_MiniTableSub_Message(e->UPB_PRIVATE(sub));
Protobuf Team Bote1253cd2024-01-08 23:09:09 +00001969}
1970
Protobuf Team Botb3878b52024-02-08 21:50:53 +00001971UPB_API_INLINE void upb_MiniTableExtension_SetSubMessage(
Protobuf Team Bote1253cd2024-01-08 23:09:09 +00001972 struct upb_MiniTableExtension* e, const struct upb_MiniTable* m) {
1973 e->UPB_PRIVATE(sub).UPB_PRIVATE(submsg) = m;
1974}
1975
Protobuf Team Bot6afb1302024-05-08 02:19:22 +00001976UPB_INLINE upb_FieldRep UPB_PRIVATE(_upb_MiniTableExtension_GetRep)(
1977 const struct upb_MiniTableExtension* e) {
1978 return UPB_PRIVATE(_upb_MiniTableField_GetRep)(&e->UPB_PRIVATE(field));
1979}
1980
Protobuf Team Bote1253cd2024-01-08 23:09:09 +00001981#ifdef __cplusplus
1982} /* extern "C" */
1983#endif
1984
1985
1986#endif /* UPB_MINI_TABLE_INTERNAL_EXTENSION_H_ */
1987
1988// Must be last.
1989
1990typedef struct upb_MiniTableExtension upb_MiniTableExtension;
1991
1992#ifdef __cplusplus
1993extern "C" {
1994#endif
1995
Protobuf Team Botfe6a6012024-01-18 00:05:28 +00001996UPB_API_INLINE upb_CType
Protobuf Team Botb3878b52024-02-08 21:50:53 +00001997upb_MiniTableExtension_CType(const upb_MiniTableExtension* e);
Protobuf Team Bote1253cd2024-01-08 23:09:09 +00001998
1999UPB_API_INLINE uint32_t
Protobuf Team Botb3878b52024-02-08 21:50:53 +00002000upb_MiniTableExtension_Number(const upb_MiniTableExtension* e);
Protobuf Team Bote1253cd2024-01-08 23:09:09 +00002001
2002UPB_API_INLINE const upb_MiniTable* upb_MiniTableExtension_GetSubMessage(
Protobuf Team Botb3878b52024-02-08 21:50:53 +00002003 const upb_MiniTableExtension* e);
Protobuf Team Bote1253cd2024-01-08 23:09:09 +00002004
2005UPB_API_INLINE void upb_MiniTableExtension_SetSubMessage(
Protobuf Team Botb3878b52024-02-08 21:50:53 +00002006 upb_MiniTableExtension* e, const upb_MiniTable* m);
Protobuf Team Bote1253cd2024-01-08 23:09:09 +00002007
2008#ifdef __cplusplus
2009} /* extern "C" */
2010#endif
2011
2012
2013#endif /* UPB_MINI_TABLE_EXTENSION_H_ */
2014
2015// Must be last.
2016
2017// The internal representation of an extension is self-describing: it contains
2018// enough information that we can serialize it to binary format without needing
2019// to look it up in a upb_ExtensionRegistry.
2020//
2021// This representation allocates 16 bytes to data on 64-bit platforms.
2022// This is rather wasteful for scalars (in the extreme case of bool,
2023// it wastes 15 bytes). We accept this because we expect messages to be
2024// the most common extension type.
Protobuf Team Botc13512a2024-01-25 18:53:49 +00002025typedef struct {
Protobuf Team Bote1253cd2024-01-08 23:09:09 +00002026 const upb_MiniTableExtension* ext;
Protobuf Team Bot4df6e042024-01-30 19:27:52 +00002027 upb_MessageValue data;
Protobuf Team Botc13512a2024-01-25 18:53:49 +00002028} upb_Extension;
Protobuf Team Bote1253cd2024-01-08 23:09:09 +00002029
2030#ifdef __cplusplus
2031extern "C" {
2032#endif
2033
2034// Adds the given extension data to the given message.
2035// |ext| is copied into the message instance.
2036// This logically replaces any previously-added extension with this number.
Protobuf Team Botc13512a2024-01-25 18:53:49 +00002037upb_Extension* UPB_PRIVATE(_upb_Message_GetOrCreateExtension)(
Protobuf Team Bote1253cd2024-01-08 23:09:09 +00002038 struct upb_Message* msg, const upb_MiniTableExtension* ext,
2039 upb_Arena* arena);
2040
2041// Returns an array of extensions for this message.
2042// Note: the array is ordered in reverse relative to the order of creation.
Protobuf Team Botc13512a2024-01-25 18:53:49 +00002043const upb_Extension* UPB_PRIVATE(_upb_Message_Getexts)(
Protobuf Team Bote1253cd2024-01-08 23:09:09 +00002044 const struct upb_Message* msg, size_t* count);
2045
2046// Returns an extension for a message with a given mini table,
2047// or NULL if no extension exists with this mini table.
Protobuf Team Botc13512a2024-01-25 18:53:49 +00002048const upb_Extension* UPB_PRIVATE(_upb_Message_Getext)(
Protobuf Team Bote1253cd2024-01-08 23:09:09 +00002049 const struct upb_Message* msg, const upb_MiniTableExtension* ext);
2050
2051#ifdef __cplusplus
2052} /* extern "C" */
2053#endif
2054
2055
2056#endif /* UPB_MESSAGE_INTERNAL_EXTENSION_H_ */
Protobuf Team Bot499c7482023-12-30 01:42:17 +00002057
2058#ifndef UPB_MESSAGE_INTERNAL_MAP_H_
2059#define UPB_MESSAGE_INTERNAL_MAP_H_
2060
2061#include <stddef.h>
2062#include <string.h>
2063
2064
2065#ifndef UPB_HASH_STR_TABLE_H_
2066#define UPB_HASH_STR_TABLE_H_
2067
2068
2069/*
2070 * upb_table
2071 *
2072 * This header is INTERNAL-ONLY! Its interfaces are not public or stable!
2073 * This file defines very fast int->upb_value (inttable) and string->upb_value
2074 * (strtable) hash tables.
2075 *
2076 * The table uses chained scatter with Brent's variation (inspired by the Lua
2077 * implementation of hash tables). The hash function for strings is Austin
2078 * Appleby's "MurmurHash."
2079 *
2080 * The inttable uses uintptr_t as its key, which guarantees it can be used to
2081 * store pointers or integers of at least 32 bits (upb isn't really useful on
2082 * systems where sizeof(void*) < 4).
2083 *
2084 * The table must be homogeneous (all values of the same type). In debug
2085 * mode, we check this on insert and lookup.
2086 */
2087
2088#ifndef UPB_HASH_COMMON_H_
2089#define UPB_HASH_COMMON_H_
2090
2091#include <string.h>
2092
2093
2094// Must be last.
2095
2096#ifdef __cplusplus
2097extern "C" {
2098#endif
2099
2100/* upb_value ******************************************************************/
2101
2102typedef struct {
2103 uint64_t val;
2104} upb_value;
2105
2106UPB_INLINE void _upb_value_setval(upb_value* v, uint64_t val) { v->val = val; }
2107
2108/* For each value ctype, define the following set of functions:
2109 *
2110 * // Get/set an int32 from a upb_value.
2111 * int32_t upb_value_getint32(upb_value val);
2112 * void upb_value_setint32(upb_value *val, int32_t cval);
2113 *
2114 * // Construct a new upb_value from an int32.
2115 * upb_value upb_value_int32(int32_t val); */
2116#define FUNCS(name, membername, type_t, converter) \
2117 UPB_INLINE void upb_value_set##name(upb_value* val, type_t cval) { \
2118 val->val = (converter)cval; \
2119 } \
2120 UPB_INLINE upb_value upb_value_##name(type_t val) { \
2121 upb_value ret; \
2122 upb_value_set##name(&ret, val); \
2123 return ret; \
2124 } \
2125 UPB_INLINE type_t upb_value_get##name(upb_value val) { \
2126 return (type_t)(converter)val.val; \
2127 }
2128
2129FUNCS(int32, int32, int32_t, int32_t)
2130FUNCS(int64, int64, int64_t, int64_t)
2131FUNCS(uint32, uint32, uint32_t, uint32_t)
2132FUNCS(uint64, uint64, uint64_t, uint64_t)
2133FUNCS(bool, _bool, bool, bool)
2134FUNCS(cstr, cstr, char*, uintptr_t)
2135FUNCS(uintptr, uptr, uintptr_t, uintptr_t)
2136FUNCS(ptr, ptr, void*, uintptr_t)
2137FUNCS(constptr, constptr, const void*, uintptr_t)
2138
2139#undef FUNCS
2140
2141UPB_INLINE void upb_value_setfloat(upb_value* val, float cval) {
2142 memcpy(&val->val, &cval, sizeof(cval));
2143}
2144
2145UPB_INLINE void upb_value_setdouble(upb_value* val, double cval) {
2146 memcpy(&val->val, &cval, sizeof(cval));
2147}
2148
2149UPB_INLINE upb_value upb_value_float(float cval) {
2150 upb_value ret;
2151 upb_value_setfloat(&ret, cval);
2152 return ret;
2153}
2154
2155UPB_INLINE upb_value upb_value_double(double cval) {
2156 upb_value ret;
2157 upb_value_setdouble(&ret, cval);
2158 return ret;
2159}
2160
2161/* upb_tabkey *****************************************************************/
2162
2163/* Either:
2164 * 1. an actual integer key, or
2165 * 2. a pointer to a string prefixed by its uint32_t length, owned by us.
2166 *
2167 * ...depending on whether this is a string table or an int table. We would
2168 * make this a union of those two types, but C89 doesn't support statically
2169 * initializing a non-first union member. */
2170typedef uintptr_t upb_tabkey;
2171
2172UPB_INLINE char* upb_tabstr(upb_tabkey key, uint32_t* len) {
2173 char* mem = (char*)key;
2174 if (len) memcpy(len, mem, sizeof(*len));
2175 return mem + sizeof(*len);
2176}
2177
2178UPB_INLINE upb_StringView upb_tabstrview(upb_tabkey key) {
2179 upb_StringView ret;
2180 uint32_t len;
2181 ret.data = upb_tabstr(key, &len);
2182 ret.size = len;
2183 return ret;
2184}
2185
2186/* upb_tabval *****************************************************************/
2187
2188typedef struct upb_tabval {
2189 uint64_t val;
2190} upb_tabval;
2191
2192#define UPB_TABVALUE_EMPTY_INIT \
2193 { -1 }
2194
2195/* upb_table ******************************************************************/
2196
2197typedef struct _upb_tabent {
2198 upb_tabkey key;
2199 upb_tabval val;
2200
2201 /* Internal chaining. This is const so we can create static initializers for
2202 * tables. We cast away const sometimes, but *only* when the containing
2203 * upb_table is known to be non-const. This requires a bit of care, but
2204 * the subtlety is confined to table.c. */
2205 const struct _upb_tabent* next;
2206} upb_tabent;
2207
2208typedef struct {
2209 size_t count; /* Number of entries in the hash part. */
2210 uint32_t mask; /* Mask to turn hash value -> bucket. */
2211 uint32_t max_count; /* Max count before we hit our load limit. */
2212 uint8_t size_lg2; /* Size of the hashtable part is 2^size_lg2 entries. */
2213 upb_tabent* entries;
2214} upb_table;
2215
2216UPB_INLINE size_t upb_table_size(const upb_table* t) {
2217 return t->size_lg2 ? 1 << t->size_lg2 : 0;
2218}
2219
2220// Internal-only functions, in .h file only out of necessity.
2221
2222UPB_INLINE bool upb_tabent_isempty(const upb_tabent* e) { return e->key == 0; }
2223
2224uint32_t _upb_Hash(const void* p, size_t n, uint64_t seed);
2225
2226#ifdef __cplusplus
2227} /* extern "C" */
2228#endif
2229
2230
2231#endif /* UPB_HASH_COMMON_H_ */
2232
2233// Must be last.
2234
2235typedef struct {
2236 upb_table t;
2237} upb_strtable;
2238
2239#ifdef __cplusplus
2240extern "C" {
2241#endif
2242
2243// Initialize a table. If memory allocation failed, false is returned and
2244// the table is uninitialized.
2245bool upb_strtable_init(upb_strtable* table, size_t expected_size, upb_Arena* a);
2246
2247// Returns the number of values in the table.
2248UPB_INLINE size_t upb_strtable_count(const upb_strtable* t) {
2249 return t->t.count;
2250}
2251
2252void upb_strtable_clear(upb_strtable* t);
2253
2254// Inserts the given key into the hashtable with the given value.
2255// The key must not already exist in the hash table. The key is not required
2256// to be NULL-terminated, and the table will make an internal copy of the key.
2257//
2258// If a table resize was required but memory allocation failed, false is
2259// returned and the table is unchanged. */
2260bool upb_strtable_insert(upb_strtable* t, const char* key, size_t len,
2261 upb_value val, upb_Arena* a);
2262
2263// Looks up key in this table, returning "true" if the key was found.
2264// If v is non-NULL, copies the value for this key into *v.
2265bool upb_strtable_lookup2(const upb_strtable* t, const char* key, size_t len,
2266 upb_value* v);
2267
2268// For NULL-terminated strings.
2269UPB_INLINE bool upb_strtable_lookup(const upb_strtable* t, const char* key,
2270 upb_value* v) {
2271 return upb_strtable_lookup2(t, key, strlen(key), v);
2272}
2273
2274// Removes an item from the table. Returns true if the remove was successful,
2275// and stores the removed item in *val if non-NULL.
2276bool upb_strtable_remove2(upb_strtable* t, const char* key, size_t len,
2277 upb_value* val);
2278
2279UPB_INLINE bool upb_strtable_remove(upb_strtable* t, const char* key,
2280 upb_value* v) {
2281 return upb_strtable_remove2(t, key, strlen(key), v);
2282}
2283
2284// Exposed for testing only.
2285bool upb_strtable_resize(upb_strtable* t, size_t size_lg2, upb_Arena* a);
2286
2287/* Iteration over strtable:
2288 *
2289 * intptr_t iter = UPB_STRTABLE_BEGIN;
2290 * upb_StringView key;
2291 * upb_value val;
2292 * while (upb_strtable_next2(t, &key, &val, &iter)) {
2293 * // ...
2294 * }
2295 */
2296
2297#define UPB_STRTABLE_BEGIN -1
2298
2299bool upb_strtable_next2(const upb_strtable* t, upb_StringView* key,
2300 upb_value* val, intptr_t* iter);
2301void upb_strtable_removeiter(upb_strtable* t, intptr_t* iter);
2302void upb_strtable_setentryvalue(upb_strtable* t, intptr_t iter, upb_value v);
2303
2304/* DEPRECATED iterators, slated for removal.
2305 *
2306 * Iterators for string tables. We are subject to some kind of unusual
2307 * design constraints:
2308 *
2309 * For high-level languages:
2310 * - we must be able to guarantee that we don't crash or corrupt memory even if
2311 * the program accesses an invalidated iterator.
2312 *
2313 * For C++11 range-based for:
2314 * - iterators must be copyable
2315 * - iterators must be comparable
2316 * - it must be possible to construct an "end" value.
2317 *
2318 * Iteration order is undefined.
2319 *
2320 * Modifying the table invalidates iterators. upb_{str,int}table_done() is
2321 * guaranteed to work even on an invalidated iterator, as long as the table it
2322 * is iterating over has not been freed. Calling next() or accessing data from
2323 * an invalidated iterator yields unspecified elements from the table, but it is
2324 * guaranteed not to crash and to return real table elements (except when done()
2325 * is true). */
2326/* upb_strtable_iter **********************************************************/
2327
2328/* upb_strtable_iter i;
2329 * upb_strtable_begin(&i, t);
2330 * for(; !upb_strtable_done(&i); upb_strtable_next(&i)) {
2331 * const char *key = upb_strtable_iter_key(&i);
2332 * const upb_value val = upb_strtable_iter_value(&i);
2333 * // ...
2334 * }
2335 */
2336
2337typedef struct {
2338 const upb_strtable* t;
2339 size_t index;
2340} upb_strtable_iter;
2341
2342UPB_INLINE const upb_tabent* str_tabent(const upb_strtable_iter* i) {
2343 return &i->t->t.entries[i->index];
2344}
2345
2346void upb_strtable_begin(upb_strtable_iter* i, const upb_strtable* t);
2347void upb_strtable_next(upb_strtable_iter* i);
2348bool upb_strtable_done(const upb_strtable_iter* i);
2349upb_StringView upb_strtable_iter_key(const upb_strtable_iter* i);
2350upb_value upb_strtable_iter_value(const upb_strtable_iter* i);
2351void upb_strtable_iter_setdone(upb_strtable_iter* i);
2352bool upb_strtable_iter_isequal(const upb_strtable_iter* i1,
2353 const upb_strtable_iter* i2);
2354
2355#ifdef __cplusplus
2356} /* extern "C" */
2357#endif
2358
2359
2360#endif /* UPB_HASH_STR_TABLE_H_ */
2361
2362// Must be last.
2363
2364typedef enum {
2365 kUpb_MapInsertStatus_Inserted = 0,
2366 kUpb_MapInsertStatus_Replaced = 1,
2367 kUpb_MapInsertStatus_OutOfMemory = 2,
2368} upb_MapInsertStatus;
2369
2370// EVERYTHING BELOW THIS LINE IS INTERNAL - DO NOT USE /////////////////////////
2371
2372struct upb_Map {
2373 // Size of key and val, based on the map type.
2374 // Strings are represented as '0' because they must be handled specially.
2375 char key_size;
2376 char val_size;
Protobuf Team Bot886a0b12024-01-26 21:23:01 +00002377 bool UPB_PRIVATE(is_frozen);
Protobuf Team Bot499c7482023-12-30 01:42:17 +00002378
2379 upb_strtable table;
2380};
2381
2382#ifdef __cplusplus
2383extern "C" {
2384#endif
2385
Protobuf Team Bot886a0b12024-01-26 21:23:01 +00002386UPB_INLINE void UPB_PRIVATE(_upb_Map_ShallowFreeze)(struct upb_Map* map) {
2387 map->UPB_PRIVATE(is_frozen) = true;
2388}
2389
Protobuf Team Botb3878b52024-02-08 21:50:53 +00002390UPB_API_INLINE bool upb_Map_IsFrozen(const struct upb_Map* map) {
Protobuf Team Bot886a0b12024-01-26 21:23:01 +00002391 return map->UPB_PRIVATE(is_frozen);
2392}
2393
Protobuf Team Bot499c7482023-12-30 01:42:17 +00002394// Converting between internal table representation and user values.
2395//
2396// _upb_map_tokey() and _upb_map_fromkey() are inverses.
2397// _upb_map_tovalue() and _upb_map_fromvalue() are inverses.
2398//
2399// These functions account for the fact that strings are treated differently
2400// from other types when stored in a map.
2401
2402UPB_INLINE upb_StringView _upb_map_tokey(const void* key, size_t size) {
2403 if (size == UPB_MAPTYPE_STRING) {
2404 return *(upb_StringView*)key;
2405 } else {
2406 return upb_StringView_FromDataAndSize((const char*)key, size);
2407 }
2408}
2409
2410UPB_INLINE void _upb_map_fromkey(upb_StringView key, void* out, size_t size) {
2411 if (size == UPB_MAPTYPE_STRING) {
2412 memcpy(out, &key, sizeof(key));
2413 } else {
2414 memcpy(out, key.data, size);
2415 }
2416}
2417
2418UPB_INLINE bool _upb_map_tovalue(const void* val, size_t size,
2419 upb_value* msgval, upb_Arena* a) {
2420 if (size == UPB_MAPTYPE_STRING) {
2421 upb_StringView* strp = (upb_StringView*)upb_Arena_Malloc(a, sizeof(*strp));
2422 if (!strp) return false;
2423 *strp = *(upb_StringView*)val;
2424 *msgval = upb_value_ptr(strp);
2425 } else {
2426 memcpy(msgval, val, size);
2427 }
2428 return true;
2429}
2430
2431UPB_INLINE void _upb_map_fromvalue(upb_value val, void* out, size_t size) {
2432 if (size == UPB_MAPTYPE_STRING) {
2433 const upb_StringView* strp = (const upb_StringView*)upb_value_getptr(val);
2434 memcpy(out, strp, sizeof(upb_StringView));
2435 } else {
2436 memcpy(out, &val, size);
2437 }
2438}
2439
2440UPB_INLINE void* _upb_map_next(const struct upb_Map* map, size_t* iter) {
2441 upb_strtable_iter it;
2442 it.t = &map->table;
2443 it.index = *iter;
2444 upb_strtable_next(&it);
2445 *iter = it.index;
2446 if (upb_strtable_done(&it)) return NULL;
2447 return (void*)str_tabent(&it);
2448}
2449
2450UPB_INLINE void _upb_Map_Clear(struct upb_Map* map) {
Protobuf Team Botb3878b52024-02-08 21:50:53 +00002451 UPB_ASSERT(!upb_Map_IsFrozen(map));
Protobuf Team Bot886a0b12024-01-26 21:23:01 +00002452
Protobuf Team Bot499c7482023-12-30 01:42:17 +00002453 upb_strtable_clear(&map->table);
2454}
2455
2456UPB_INLINE bool _upb_Map_Delete(struct upb_Map* map, const void* key,
2457 size_t key_size, upb_value* val) {
Protobuf Team Botb3878b52024-02-08 21:50:53 +00002458 UPB_ASSERT(!upb_Map_IsFrozen(map));
Protobuf Team Bot886a0b12024-01-26 21:23:01 +00002459
Protobuf Team Bot499c7482023-12-30 01:42:17 +00002460 upb_StringView k = _upb_map_tokey(key, key_size);
2461 return upb_strtable_remove2(&map->table, k.data, k.size, val);
2462}
2463
2464UPB_INLINE bool _upb_Map_Get(const struct upb_Map* map, const void* key,
2465 size_t key_size, void* val, size_t val_size) {
2466 upb_value tabval;
2467 upb_StringView k = _upb_map_tokey(key, key_size);
2468 bool ret = upb_strtable_lookup2(&map->table, k.data, k.size, &tabval);
2469 if (ret && val) {
2470 _upb_map_fromvalue(tabval, val, val_size);
2471 }
2472 return ret;
2473}
2474
2475UPB_INLINE upb_MapInsertStatus _upb_Map_Insert(struct upb_Map* map,
2476 const void* key, size_t key_size,
2477 void* val, size_t val_size,
2478 upb_Arena* a) {
Protobuf Team Botb3878b52024-02-08 21:50:53 +00002479 UPB_ASSERT(!upb_Map_IsFrozen(map));
Protobuf Team Bot886a0b12024-01-26 21:23:01 +00002480
Protobuf Team Bot499c7482023-12-30 01:42:17 +00002481 upb_StringView strkey = _upb_map_tokey(key, key_size);
2482 upb_value tabval = {0};
2483 if (!_upb_map_tovalue(val, val_size, &tabval, a)) {
2484 return kUpb_MapInsertStatus_OutOfMemory;
2485 }
2486
2487 // TODO: add overwrite operation to minimize number of lookups.
2488 bool removed =
2489 upb_strtable_remove2(&map->table, strkey.data, strkey.size, NULL);
2490 if (!upb_strtable_insert(&map->table, strkey.data, strkey.size, tabval, a)) {
2491 return kUpb_MapInsertStatus_OutOfMemory;
2492 }
2493 return removed ? kUpb_MapInsertStatus_Replaced
2494 : kUpb_MapInsertStatus_Inserted;
2495}
2496
2497UPB_INLINE size_t _upb_Map_Size(const struct upb_Map* map) {
2498 return map->table.t.count;
2499}
2500
2501// Strings/bytes are special-cased in maps.
2502extern char _upb_Map_CTypeSizeTable[12];
2503
2504UPB_INLINE size_t _upb_Map_CTypeSize(upb_CType ctype) {
2505 return _upb_Map_CTypeSizeTable[ctype];
2506}
2507
2508// Creates a new map on the given arena with this key/value type.
2509struct upb_Map* _upb_Map_New(upb_Arena* a, size_t key_size, size_t value_size);
2510
2511#ifdef __cplusplus
2512} /* extern "C" */
2513#endif
2514
2515
2516#endif /* UPB_MESSAGE_INTERNAL_MAP_H_ */
Protobuf Team Bot4ffe0862023-12-06 02:02:36 +00002517
Protobuf Team Bot4df6e042024-01-30 19:27:52 +00002518/*
2519** Our memory representation for parsing tables and messages themselves.
2520** Functions in this file are used by generated code and possibly reflection.
2521**
2522** The definitions in this file are internal to upb.
2523**/
2524
2525#ifndef UPB_MESSAGE_INTERNAL_MESSAGE_H_
2526#define UPB_MESSAGE_INTERNAL_MESSAGE_H_
2527
2528#include <stdlib.h>
2529#include <string.h>
2530
2531
2532// Must be last.
2533
2534#ifdef __cplusplus
2535extern "C" {
2536#endif
2537
2538extern const float kUpb_FltInfinity;
2539extern const double kUpb_Infinity;
2540extern const double kUpb_NaN;
2541
2542// Internal members of a upb_Message that track unknown fields and/or
2543// extensions. We can change this without breaking binary compatibility.
2544
2545typedef struct upb_Message_Internal {
2546 // Total size of this structure, including the data that follows.
2547 // Must be aligned to 8, which is alignof(upb_Extension)
2548 uint32_t size;
2549
2550 /* Offsets relative to the beginning of this structure.
2551 *
2552 * Unknown data grows forward from the beginning to unknown_end.
2553 * Extension data grows backward from size to ext_begin.
2554 * When the two meet, we're out of data and have to realloc.
2555 *
2556 * If we imagine that the final member of this struct is:
2557 * char data[size - overhead]; // overhead = sizeof(upb_Message_Internal)
2558 *
2559 * Then we have:
2560 * unknown data: data[0 .. (unknown_end - overhead)]
2561 * extensions data: data[(ext_begin - overhead) .. (size - overhead)] */
2562 uint32_t unknown_end;
2563 uint32_t ext_begin;
2564 // Data follows, as if there were an array:
2565 // char data[size - sizeof(upb_Message_Internal)];
2566} upb_Message_Internal;
2567
Protobuf Team Botccfab6a2024-03-07 20:32:42 +00002568#ifdef UPB_TRACING_ENABLED
Protobuf Team Bot51cba7c2024-05-06 13:34:40 +00002569UPB_API void upb_Message_LogNewMessage(const upb_MiniTable* m,
2570 const upb_Arena* arena);
2571UPB_API void upb_Message_SetNewMessageTraceHandler(
2572 void (*handler)(const upb_MiniTable*, const upb_Arena*));
2573#endif // UPB_TRACING_ENABLED
Protobuf Team Botccfab6a2024-03-07 20:32:42 +00002574
Protobuf Team Bot4df6e042024-01-30 19:27:52 +00002575// Inline version upb_Message_New(), for internal use.
2576UPB_INLINE struct upb_Message* _upb_Message_New(const upb_MiniTable* m,
2577 upb_Arena* a) {
Protobuf Team Botccfab6a2024-03-07 20:32:42 +00002578#ifdef UPB_TRACING_ENABLED
Protobuf Team Bot51cba7c2024-05-06 13:34:40 +00002579 upb_Message_LogNewMessage(m, a);
2580#endif // UPB_TRACING_ENABLED
2581
Protobuf Team Bot4df6e042024-01-30 19:27:52 +00002582 const int size = m->UPB_PRIVATE(size);
2583 struct upb_Message* msg = (struct upb_Message*)upb_Arena_Malloc(a, size);
2584 if (UPB_UNLIKELY(!msg)) return NULL;
2585 memset(msg, 0, size);
2586 return msg;
2587}
2588
2589// Discards the unknown fields for this message only.
2590void _upb_Message_DiscardUnknown_shallow(struct upb_Message* msg);
2591
2592// Adds unknown data (serialized protobuf data) to the given message.
2593// The data is copied into the message instance.
2594bool UPB_PRIVATE(_upb_Message_AddUnknown)(struct upb_Message* msg,
2595 const char* data, size_t len,
2596 upb_Arena* arena);
2597
2598bool UPB_PRIVATE(_upb_Message_Realloc)(struct upb_Message* msg, size_t need,
2599 upb_Arena* arena);
2600
2601#ifdef __cplusplus
2602} /* extern "C" */
2603#endif
2604
2605
2606#endif /* UPB_MESSAGE_INTERNAL_MESSAGE_H_ */
2607
Protobuf Team Bot499c7482023-12-30 01:42:17 +00002608#ifndef UPB_MINI_TABLE_INTERNAL_TAGGED_PTR_H_
2609#define UPB_MINI_TABLE_INTERNAL_TAGGED_PTR_H_
2610
2611#include <stdint.h>
2612
2613
2614// Must be last.
2615
Protobuf Team Bot499c7482023-12-30 01:42:17 +00002616#ifdef __cplusplus
2617extern "C" {
2618#endif
2619
2620// Internal-only because empty messages cannot be created by the user.
Protobuf Team Bote1253cd2024-01-08 23:09:09 +00002621UPB_INLINE uintptr_t
Protobuf Team Bot499c7482023-12-30 01:42:17 +00002622UPB_PRIVATE(_upb_TaggedMessagePtr_Pack)(struct upb_Message* ptr, bool empty) {
2623 UPB_ASSERT(((uintptr_t)ptr & 1) == 0);
2624 return (uintptr_t)ptr | (empty ? 1 : 0);
2625}
2626
Protobuf Team Botb3878b52024-02-08 21:50:53 +00002627UPB_API_INLINE bool upb_TaggedMessagePtr_IsEmpty(uintptr_t ptr) {
Protobuf Team Bot499c7482023-12-30 01:42:17 +00002628 return ptr & 1;
2629}
2630
2631UPB_INLINE struct upb_Message* UPB_PRIVATE(_upb_TaggedMessagePtr_GetMessage)(
Protobuf Team Bote1253cd2024-01-08 23:09:09 +00002632 uintptr_t ptr) {
Protobuf Team Bot499c7482023-12-30 01:42:17 +00002633 return (struct upb_Message*)(ptr & ~(uintptr_t)1);
2634}
2635
Protobuf Team Botb3878b52024-02-08 21:50:53 +00002636UPB_API_INLINE struct upb_Message* upb_TaggedMessagePtr_GetNonEmptyMessage(
2637 uintptr_t ptr) {
2638 UPB_ASSERT(!upb_TaggedMessagePtr_IsEmpty(ptr));
Protobuf Team Bot499c7482023-12-30 01:42:17 +00002639 return UPB_PRIVATE(_upb_TaggedMessagePtr_GetMessage)(ptr);
2640}
2641
2642UPB_INLINE struct upb_Message* UPB_PRIVATE(
Protobuf Team Bote1253cd2024-01-08 23:09:09 +00002643 _upb_TaggedMessagePtr_GetEmptyMessage)(uintptr_t ptr) {
Protobuf Team Botb3878b52024-02-08 21:50:53 +00002644 UPB_ASSERT(upb_TaggedMessagePtr_IsEmpty(ptr));
Protobuf Team Bot499c7482023-12-30 01:42:17 +00002645 return UPB_PRIVATE(_upb_TaggedMessagePtr_GetMessage)(ptr);
2646}
2647
2648#ifdef __cplusplus
2649} /* extern "C" */
2650#endif
2651
2652
2653#endif /* UPB_MINI_TABLE_INTERNAL_TAGGED_PTR_H_ */
2654
Protobuf Team Botc12c96e2024-01-16 07:41:08 +00002655#ifndef UPB_MESSAGE_INTERNAL_TYPES_H_
2656#define UPB_MESSAGE_INTERNAL_TYPES_H_
2657
Protobuf Team Bot886a0b12024-01-26 21:23:01 +00002658#include <stdint.h>
2659
2660// Must be last.
2661
2662#define UPB_OPAQUE(x) x##_opaque
2663
Protobuf Team Botc12c96e2024-01-16 07:41:08 +00002664struct upb_Message {
2665 union {
Protobuf Team Bot886a0b12024-01-26 21:23:01 +00002666 uintptr_t UPB_OPAQUE(internal); // tagged pointer, low bit == frozen
Protobuf Team Botc12c96e2024-01-16 07:41:08 +00002667 double d; // Forces same size for 32-bit/64-bit builds
2668 };
2669};
2670
Protobuf Team Botb3878b52024-02-08 21:50:53 +00002671#ifdef __cplusplus
2672extern "C" {
2673#endif
2674
Protobuf Team Bot886a0b12024-01-26 21:23:01 +00002675UPB_INLINE void UPB_PRIVATE(_upb_Message_ShallowFreeze)(
2676 struct upb_Message* msg) {
2677 msg->UPB_OPAQUE(internal) |= 1ULL;
2678}
2679
Protobuf Team Botb3878b52024-02-08 21:50:53 +00002680UPB_API_INLINE bool upb_Message_IsFrozen(const struct upb_Message* msg) {
Protobuf Team Bot886a0b12024-01-26 21:23:01 +00002681 return (msg->UPB_OPAQUE(internal) & 1ULL) != 0;
2682}
2683
2684UPB_INLINE struct upb_Message_Internal* UPB_PRIVATE(_upb_Message_GetInternal)(
2685 const struct upb_Message* msg) {
2686 const uintptr_t tmp = msg->UPB_OPAQUE(internal) & ~1ULL;
2687 return (struct upb_Message_Internal*)tmp;
2688}
2689
2690UPB_INLINE void UPB_PRIVATE(_upb_Message_SetInternal)(
2691 struct upb_Message* msg, struct upb_Message_Internal* internal) {
Protobuf Team Botb3878b52024-02-08 21:50:53 +00002692 UPB_ASSERT(!upb_Message_IsFrozen(msg));
Protobuf Team Bot886a0b12024-01-26 21:23:01 +00002693 msg->UPB_OPAQUE(internal) = (uintptr_t)internal;
2694}
2695
Protobuf Team Botb3878b52024-02-08 21:50:53 +00002696#ifdef __cplusplus
2697} /* extern "C" */
2698#endif
2699
Protobuf Team Bot886a0b12024-01-26 21:23:01 +00002700#undef UPB_OPAQUE
2701
2702
Protobuf Team Botc12c96e2024-01-16 07:41:08 +00002703#endif /* UPB_MESSAGE_INTERNAL_TYPES_H_ */
2704
Eric Salo8809a112022-11-21 13:01:06 -08002705// Must be last.
2706
Eric Salob7d54ac2022-12-29 11:59:42 -08002707#if defined(__GNUC__) && !defined(__clang__)
2708// GCC raises incorrect warnings in these functions. It thinks that we are
2709// overrunning buffers, but we carefully write the functions in this file to
2710// guarantee that this is impossible. GCC gets this wrong due it its failure
2711// to perform constant propagation as we expect:
2712// - https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108217
2713// - https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108226
2714//
2715// Unfortunately this also indicates that GCC is not optimizing away the
2716// switch() in cases where it should be, compromising the performance.
2717#pragma GCC diagnostic push
2718#pragma GCC diagnostic ignored "-Warray-bounds"
2719#pragma GCC diagnostic ignored "-Wstringop-overflow"
Mike Kruskal232ecf42023-01-14 00:09:40 -08002720#if __GNUC__ >= 11
Eric Salob7d54ac2022-12-29 11:59:42 -08002721#pragma GCC diagnostic ignored "-Wstringop-overread"
2722#endif
Mike Kruskal232ecf42023-01-14 00:09:40 -08002723#endif
Eric Salob7d54ac2022-12-29 11:59:42 -08002724
Eric Salo8809a112022-11-21 13:01:06 -08002725#ifdef __cplusplus
2726extern "C" {
2727#endif
2728
Mike Kruskal9d435022023-07-11 12:45:07 -07002729// LINT.IfChange(presence_logic)
2730
2731// Hasbit access ///////////////////////////////////////////////////////////////
2732
Protobuf Team Bot7713df52023-12-05 20:16:11 +00002733UPB_INLINE bool UPB_PRIVATE(_upb_Message_GetHasbit)(
Protobuf Team Bot499c7482023-12-30 01:42:17 +00002734 const struct upb_Message* msg, const upb_MiniTableField* f) {
Protobuf Team Bota0e81952023-12-21 14:54:29 +00002735 const size_t offset = UPB_PRIVATE(_upb_MiniTableField_HasbitOffset)(f);
2736 const char mask = UPB_PRIVATE(_upb_MiniTableField_HasbitMask)(f);
2737
Protobuf Team Botb8c1a272023-11-15 17:49:10 +00002738 return (*UPB_PTR_AT(msg, offset, const char) & mask) != 0;
Mike Kruskal9d435022023-07-11 12:45:07 -07002739}
2740
Protobuf Team Bot7713df52023-12-05 20:16:11 +00002741UPB_INLINE void UPB_PRIVATE(_upb_Message_SetHasbit)(
Protobuf Team Bot499c7482023-12-30 01:42:17 +00002742 const struct upb_Message* msg, const upb_MiniTableField* f) {
Protobuf Team Bota0e81952023-12-21 14:54:29 +00002743 const size_t offset = UPB_PRIVATE(_upb_MiniTableField_HasbitOffset)(f);
2744 const char mask = UPB_PRIVATE(_upb_MiniTableField_HasbitMask)(f);
2745
Protobuf Team Botb8c1a272023-11-15 17:49:10 +00002746 (*UPB_PTR_AT(msg, offset, char)) |= mask;
2747}
2748
Protobuf Team Bot7713df52023-12-05 20:16:11 +00002749UPB_INLINE void UPB_PRIVATE(_upb_Message_ClearHasbit)(
Protobuf Team Bot499c7482023-12-30 01:42:17 +00002750 const struct upb_Message* msg, const upb_MiniTableField* f) {
Protobuf Team Bota0e81952023-12-21 14:54:29 +00002751 const size_t offset = UPB_PRIVATE(_upb_MiniTableField_HasbitOffset)(f);
2752 const char mask = UPB_PRIVATE(_upb_MiniTableField_HasbitMask)(f);
2753
Protobuf Team Botb8c1a272023-11-15 17:49:10 +00002754 (*UPB_PTR_AT(msg, offset, char)) &= ~mask;
2755}
2756
Mike Kruskal9d435022023-07-11 12:45:07 -07002757// Oneof case access ///////////////////////////////////////////////////////////
2758
Protobuf Team Bot7d4ead22023-12-05 21:25:30 +00002759UPB_INLINE uint32_t* UPB_PRIVATE(_upb_Message_OneofCasePtr)(
Protobuf Team Bot499c7482023-12-30 01:42:17 +00002760 struct upb_Message* msg, const upb_MiniTableField* f) {
Protobuf Team Bota0e81952023-12-21 14:54:29 +00002761 return UPB_PTR_AT(msg, UPB_PRIVATE(_upb_MiniTableField_OneofOffset)(f),
2762 uint32_t);
Mike Kruskal9d435022023-07-11 12:45:07 -07002763}
2764
Protobuf Team Bot7d4ead22023-12-05 21:25:30 +00002765UPB_INLINE uint32_t UPB_PRIVATE(_upb_Message_GetOneofCase)(
Protobuf Team Bot499c7482023-12-30 01:42:17 +00002766 const struct upb_Message* msg, const upb_MiniTableField* f) {
Protobuf Team Bot18d4a762024-01-02 05:41:47 +00002767 const uint32_t* ptr =
2768 UPB_PRIVATE(_upb_Message_OneofCasePtr)((struct upb_Message*)msg, f);
2769
2770 return *ptr;
Mike Kruskal9d435022023-07-11 12:45:07 -07002771}
2772
Protobuf Team Bot7d4ead22023-12-05 21:25:30 +00002773UPB_INLINE void UPB_PRIVATE(_upb_Message_SetOneofCase)(
Protobuf Team Bot499c7482023-12-30 01:42:17 +00002774 struct upb_Message* msg, const upb_MiniTableField* f) {
Protobuf Team Bot18d4a762024-01-02 05:41:47 +00002775 uint32_t* ptr = UPB_PRIVATE(_upb_Message_OneofCasePtr)(msg, f);
2776
2777 *ptr = upb_MiniTableField_Number(f);
Protobuf Team Botb8c1a272023-11-15 17:49:10 +00002778}
2779
Protobuf Team Bot18d4a762024-01-02 05:41:47 +00002780// Returns true if the given field is the current oneof case.
2781// Does nothing if it is not the current oneof case.
2782UPB_INLINE bool UPB_PRIVATE(_upb_Message_ClearOneofCase)(
2783 struct upb_Message* msg, const upb_MiniTableField* f) {
2784 uint32_t* ptr = UPB_PRIVATE(_upb_Message_OneofCasePtr)(msg, f);
2785
2786 if (*ptr != upb_MiniTableField_Number(f)) return false;
2787 *ptr = 0;
2788 return true;
2789}
Protobuf Team Botb8c1a272023-11-15 17:49:10 +00002790
Protobuf Team Bot7646fbf2024-05-03 19:47:53 +00002791UPB_API_INLINE uint32_t upb_Message_WhichOneofFieldNumber(
2792 const struct upb_Message* message, const upb_MiniTableField* oneof_field) {
2793 UPB_ASSUME(upb_MiniTableField_IsInOneof(oneof_field));
2794 return UPB_PRIVATE(_upb_Message_GetOneofCase)(message, oneof_field);
2795}
2796
Protobuf Team Bot6cce6222024-05-28 17:15:46 +00002797UPB_API_INLINE const upb_MiniTableField* upb_Message_WhichOneof(
2798 const struct upb_Message* msg, const upb_MiniTable* m,
2799 const upb_MiniTableField* f) {
2800 uint32_t field_number = upb_Message_WhichOneofFieldNumber(msg, f);
2801 if (field_number == 0) {
2802 // No field in the oneof is set.
2803 return NULL;
2804 }
2805 return upb_MiniTable_FindFieldByNumber(m, field_number);
2806}
2807
Mike Kruskal9d435022023-07-11 12:45:07 -07002808// LINT.ThenChange(GoogleInternalName2)
Mike Kruskal9d435022023-07-11 12:45:07 -07002809
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00002810// Returns false if the message is missing any of its required fields.
2811UPB_INLINE bool UPB_PRIVATE(_upb_Message_IsInitializedShallow)(
2812 const struct upb_Message* msg, const upb_MiniTable* m) {
2813 uint64_t bits;
2814 memcpy(&bits, msg + 1, sizeof(bits));
2815 bits = upb_BigEndian64(bits);
2816 return (UPB_PRIVATE(_upb_MiniTable_RequiredMask)(m) & ~bits) == 0;
2817}
2818
Protobuf Team Bot9bee7472024-01-10 18:09:23 +00002819UPB_INLINE void* UPB_PRIVATE(_upb_Message_MutableDataPtr)(
Protobuf Team Bot18d4a762024-01-02 05:41:47 +00002820 struct upb_Message* msg, const upb_MiniTableField* f) {
2821 return (char*)msg + f->UPB_ONLYBITS(offset);
Eric Salo8809a112022-11-21 13:01:06 -08002822}
2823
Protobuf Team Bot9bee7472024-01-10 18:09:23 +00002824UPB_INLINE const void* UPB_PRIVATE(_upb_Message_DataPtr)(
Protobuf Team Bot18d4a762024-01-02 05:41:47 +00002825 const struct upb_Message* msg, const upb_MiniTableField* f) {
2826 return (const char*)msg + f->UPB_ONLYBITS(offset);
Eric Salo8809a112022-11-21 13:01:06 -08002827}
2828
Protobuf Team Bot7d4ead22023-12-05 21:25:30 +00002829UPB_INLINE void UPB_PRIVATE(_upb_Message_SetPresence)(
Protobuf Team Bot18d4a762024-01-02 05:41:47 +00002830 struct upb_Message* msg, const upb_MiniTableField* f) {
2831 if (UPB_PRIVATE(_upb_MiniTableField_HasHasbit)(f)) {
2832 UPB_PRIVATE(_upb_Message_SetHasbit)(msg, f);
2833 } else if (upb_MiniTableField_IsInOneof(f)) {
2834 UPB_PRIVATE(_upb_Message_SetOneofCase)(msg, f);
Eric Salo8809a112022-11-21 13:01:06 -08002835 }
2836}
2837
Protobuf Team Botddc54062023-12-12 20:03:38 +00002838UPB_INLINE void UPB_PRIVATE(_upb_MiniTableField_DataCopy)(
Protobuf Team Bot18d4a762024-01-02 05:41:47 +00002839 const upb_MiniTableField* f, void* to, const void* from) {
2840 switch (UPB_PRIVATE(_upb_MiniTableField_GetRep)(f)) {
Eric Salo8809a112022-11-21 13:01:06 -08002841 case kUpb_FieldRep_1Byte:
2842 memcpy(to, from, 1);
2843 return;
2844 case kUpb_FieldRep_4Byte:
2845 memcpy(to, from, 4);
2846 return;
2847 case kUpb_FieldRep_8Byte:
2848 memcpy(to, from, 8);
2849 return;
2850 case kUpb_FieldRep_StringView: {
2851 memcpy(to, from, sizeof(upb_StringView));
2852 return;
2853 }
2854 }
2855 UPB_UNREACHABLE();
2856}
2857
Protobuf Team Bot18d4a762024-01-02 05:41:47 +00002858UPB_INLINE bool UPB_PRIVATE(_upb_MiniTableField_DataEquals)(
2859 const upb_MiniTableField* f, const void* a, const void* b) {
2860 switch (UPB_PRIVATE(_upb_MiniTableField_GetRep)(f)) {
2861 case kUpb_FieldRep_1Byte:
2862 return memcmp(a, b, 1) == 0;
2863 case kUpb_FieldRep_4Byte:
2864 return memcmp(a, b, 4) == 0;
2865 case kUpb_FieldRep_8Byte:
2866 return memcmp(a, b, 8) == 0;
2867 case kUpb_FieldRep_StringView: {
2868 const upb_StringView sa = *(const upb_StringView*)a;
2869 const upb_StringView sb = *(const upb_StringView*)b;
2870 return upb_StringView_IsEqual(sa, sb);
2871 }
2872 }
2873 UPB_UNREACHABLE();
2874}
2875
2876UPB_INLINE void UPB_PRIVATE(_upb_MiniTableField_DataClear)(
2877 const upb_MiniTableField* f, void* val) {
2878 const char zero[16] = {0};
Protobuf Team Bot8203e2f2024-05-20 19:23:30 +00002879 UPB_PRIVATE(_upb_MiniTableField_DataCopy)(f, val, zero);
Protobuf Team Bot18d4a762024-01-02 05:41:47 +00002880}
2881
2882UPB_INLINE bool UPB_PRIVATE(_upb_MiniTableField_DataIsZero)(
2883 const upb_MiniTableField* f, const void* val) {
2884 const char zero[16] = {0};
2885 return UPB_PRIVATE(_upb_MiniTableField_DataEquals)(f, val, zero);
2886}
2887
Eric Salo8809a112022-11-21 13:01:06 -08002888// Here we define universal getter/setter functions for message fields.
2889// These look very branchy and inefficient, but as long as the MiniTableField
2890// values are known at compile time, all the branches are optimized away and
2891// we are left with ideal code. This can happen either through through
2892// literals or UPB_ASSUME():
2893//
Eric Salob598b2d2022-12-22 23:14:27 -08002894// // Via struct literals.
Eric Salo8809a112022-11-21 13:01:06 -08002895// bool FooMessage_set_bool_field(const upb_Message* msg, bool val) {
2896// const upb_MiniTableField field = {1, 0, 0, /* etc... */};
2897// // All value in "field" are compile-time known.
Protobuf Team Botac32c972024-04-10 03:30:05 +00002898// upb_Message_SetBaseField(msg, &field, &value);
Eric Salo8809a112022-11-21 13:01:06 -08002899// }
2900//
2901// // Via UPB_ASSUME().
Eric Salo10505992022-12-12 12:16:36 -08002902// UPB_INLINE bool upb_Message_SetBool(upb_Message* msg,
2903// const upb_MiniTableField* field,
2904// bool value, upb_Arena* a) {
Deanna Garciabd6a0cf2023-04-20 10:30:44 -07002905// UPB_ASSUME(field->UPB_PRIVATE(descriptortype) == kUpb_FieldType_Bool);
Protobuf Team Bot42169722023-11-29 03:54:33 +00002906// UPB_ASSUME(UPB_PRIVATE(_upb_MiniTableField_GetRep)(field) ==
2907// kUpb_FieldRep_1Byte);
Protobuf Team Bot54573a42023-11-21 14:47:34 +00002908// upb_Message_SetField(msg, field, &value, a);
Eric Salo8809a112022-11-21 13:01:06 -08002909// }
2910//
2911// As a result, we can use these universal getters/setters for *all* message
2912// accessors: generated code, MiniTable accessors, and reflection. The only
2913// exception is the binary encoder/decoder, which need to be a bit more clever
Eric Salob598b2d2022-12-22 23:14:27 -08002914// about how they read/write the message data, for efficiency.
Eric Salo10505992022-12-12 12:16:36 -08002915//
2916// These functions work on both extensions and non-extensions. If the field
2917// of a setter is known to be a non-extension, the arena may be NULL and the
2918// returned bool value may be ignored since it will always succeed.
Eric Salo8809a112022-11-21 13:01:06 -08002919
Protobuf Team Botb3878b52024-02-08 21:50:53 +00002920UPB_API_INLINE bool upb_Message_HasBaseField(const struct upb_Message* msg,
2921 const upb_MiniTableField* field) {
Eric Salo10505992022-12-12 12:16:36 -08002922 UPB_ASSERT(upb_MiniTableField_HasPresence(field));
2923 UPB_ASSUME(!upb_MiniTableField_IsExtension(field));
Protobuf Team Bote81cda12023-11-21 18:23:13 +00002924 if (upb_MiniTableField_IsInOneof(field)) {
Protobuf Team Bot7d4ead22023-12-05 21:25:30 +00002925 return UPB_PRIVATE(_upb_Message_GetOneofCase)(msg, field) ==
Protobuf Team Bot7bdd38e2023-12-01 23:06:45 +00002926 upb_MiniTableField_Number(field);
Eric Salo10505992022-12-12 12:16:36 -08002927 } else {
Protobuf Team Bot7713df52023-12-05 20:16:11 +00002928 return UPB_PRIVATE(_upb_Message_GetHasbit)(msg, field);
Eric Salo10505992022-12-12 12:16:36 -08002929 }
2930}
2931
Protobuf Team Botb3878b52024-02-08 21:50:53 +00002932UPB_API_INLINE bool upb_Message_HasExtension(const struct upb_Message* msg,
2933 const upb_MiniTableExtension* e) {
2934 UPB_ASSERT(upb_MiniTableField_HasPresence(&e->UPB_PRIVATE(field)));
2935 return UPB_PRIVATE(_upb_Message_Getext)(msg, e) != NULL;
Protobuf Team Bot8c1f6352024-01-10 05:18:15 +00002936}
2937
Protobuf Team Bot1d143b52024-01-25 20:29:43 +00002938UPB_FORCEINLINE void _upb_Message_GetNonExtensionField(
Protobuf Team Bot499c7482023-12-30 01:42:17 +00002939 const struct upb_Message* msg, const upb_MiniTableField* field,
Eric Salo8809a112022-11-21 13:01:06 -08002940 const void* default_val, void* val) {
2941 UPB_ASSUME(!upb_MiniTableField_IsExtension(field));
Protobuf Team Bote81cda12023-11-21 18:23:13 +00002942 if ((upb_MiniTableField_IsInOneof(field) ||
Protobuf Team Botddc54062023-12-12 20:03:38 +00002943 !UPB_PRIVATE(_upb_MiniTableField_DataIsZero)(field, default_val)) &&
Protobuf Team Botb3878b52024-02-08 21:50:53 +00002944 !upb_Message_HasBaseField(msg, field)) {
Protobuf Team Botddc54062023-12-12 20:03:38 +00002945 UPB_PRIVATE(_upb_MiniTableField_DataCopy)(field, val, default_val);
Eric Salo8809a112022-11-21 13:01:06 -08002946 return;
2947 }
Protobuf Team Botddc54062023-12-12 20:03:38 +00002948 UPB_PRIVATE(_upb_MiniTableField_DataCopy)
Protobuf Team Bot9bee7472024-01-10 18:09:23 +00002949 (field, val, UPB_PRIVATE(_upb_Message_DataPtr)(msg, field));
Eric Salo8809a112022-11-21 13:01:06 -08002950}
2951
Eric Salo10505992022-12-12 12:16:36 -08002952UPB_INLINE void _upb_Message_GetExtensionField(
Protobuf Team Bot499c7482023-12-30 01:42:17 +00002953 const struct upb_Message* msg, const upb_MiniTableExtension* mt_ext,
Eric Salo8809a112022-11-21 13:01:06 -08002954 const void* default_val, void* val) {
Protobuf Team Botc13512a2024-01-25 18:53:49 +00002955 const upb_Extension* ext = UPB_PRIVATE(_upb_Message_Getext)(msg, mt_ext);
Protobuf Team Botddc54062023-12-12 20:03:38 +00002956 const upb_MiniTableField* f = &mt_ext->UPB_PRIVATE(field);
2957 UPB_ASSUME(upb_MiniTableField_IsExtension(f));
2958
Eric Salo8809a112022-11-21 13:01:06 -08002959 if (ext) {
Protobuf Team Botddc54062023-12-12 20:03:38 +00002960 UPB_PRIVATE(_upb_MiniTableField_DataCopy)(f, val, &ext->data);
Eric Salo8809a112022-11-21 13:01:06 -08002961 } else {
Protobuf Team Botddc54062023-12-12 20:03:38 +00002962 UPB_PRIVATE(_upb_MiniTableField_DataCopy)(f, val, default_val);
Eric Salo8809a112022-11-21 13:01:06 -08002963 }
2964}
2965
Protobuf Team Bot7646fbf2024-05-03 19:47:53 +00002966// NOTE: The default_val is only used for fields that support presence.
2967// For repeated/map fields, the resulting upb_Array*/upb_Map* can be NULL if a
2968// upb_Array/upb_Map has not been allocated yet. Array/map fields do not have
2969// presence, so this is semantically identical to a pointer to an empty
2970// array/map, and must be treated the same for all semantic purposes.
2971UPB_API_INLINE upb_MessageValue upb_Message_GetField(
2972 const struct upb_Message* msg, const upb_MiniTableField* field,
2973 upb_MessageValue default_val) {
2974 upb_MessageValue ret;
2975 if (upb_MiniTableField_IsExtension(field)) {
2976 _upb_Message_GetExtensionField(msg, (upb_MiniTableExtension*)field,
2977 &default_val, &ret);
2978 } else {
2979 _upb_Message_GetNonExtensionField(msg, field, &default_val, &ret);
2980 }
2981 return ret;
2982}
2983
Protobuf Team Botac32c972024-04-10 03:30:05 +00002984UPB_API_INLINE void upb_Message_SetBaseField(struct upb_Message* msg,
2985 const upb_MiniTableField* f,
2986 const void* val) {
Protobuf Team Botb3878b52024-02-08 21:50:53 +00002987 UPB_ASSERT(!upb_Message_IsFrozen(msg));
Protobuf Team Botac32c972024-04-10 03:30:05 +00002988 UPB_ASSUME(!upb_MiniTableField_IsExtension(f));
2989 UPB_PRIVATE(_upb_Message_SetPresence)(msg, f);
Protobuf Team Botddc54062023-12-12 20:03:38 +00002990 UPB_PRIVATE(_upb_MiniTableField_DataCopy)
Protobuf Team Botac32c972024-04-10 03:30:05 +00002991 (f, UPB_PRIVATE(_upb_Message_MutableDataPtr)(msg, f), val);
Eric Salo8809a112022-11-21 13:01:06 -08002992}
2993
Protobuf Team Botac32c972024-04-10 03:30:05 +00002994UPB_API_INLINE bool upb_Message_SetExtension(struct upb_Message* msg,
2995 const upb_MiniTableExtension* e,
2996 const void* val, upb_Arena* a) {
Protobuf Team Botb3878b52024-02-08 21:50:53 +00002997 UPB_ASSERT(!upb_Message_IsFrozen(msg));
Eric Salo10505992022-12-12 12:16:36 -08002998 UPB_ASSERT(a);
Protobuf Team Botc13512a2024-01-25 18:53:49 +00002999 upb_Extension* ext =
Protobuf Team Botac32c972024-04-10 03:30:05 +00003000 UPB_PRIVATE(_upb_Message_GetOrCreateExtension)(msg, e, a);
Eric Salo8809a112022-11-21 13:01:06 -08003001 if (!ext) return false;
Protobuf Team Botddc54062023-12-12 20:03:38 +00003002 UPB_PRIVATE(_upb_MiniTableField_DataCopy)
Protobuf Team Botac32c972024-04-10 03:30:05 +00003003 (&e->UPB_PRIVATE(field), &ext->data, val);
Eric Salo8809a112022-11-21 13:01:06 -08003004 return true;
3005}
3006
Protobuf Team Bot7646fbf2024-05-03 19:47:53 +00003007// Sets the value of the given field in the given msg. The return value is true
3008// if the operation completed successfully, or false if memory allocation
3009// failed.
3010UPB_INLINE bool UPB_PRIVATE(_upb_Message_SetField)(struct upb_Message* msg,
3011 const upb_MiniTableField* f,
3012 upb_MessageValue val,
3013 upb_Arena* a) {
3014 if (upb_MiniTableField_IsExtension(f)) {
3015 const upb_MiniTableExtension* ext = (const upb_MiniTableExtension*)f;
3016 return upb_Message_SetExtension(msg, ext, &val, a);
3017 } else {
3018 upb_Message_SetBaseField(msg, f, &val);
3019 return true;
3020 }
3021}
3022
3023UPB_API_INLINE const upb_Array* upb_Message_GetArray(
3024 const struct upb_Message* msg, const upb_MiniTableField* f) {
3025 UPB_PRIVATE(_upb_MiniTableField_CheckIsArray)(f);
3026 upb_Array* ret;
3027 const upb_Array* default_val = NULL;
3028 _upb_Message_GetNonExtensionField(msg, f, &default_val, &ret);
3029 return ret;
3030}
3031
3032UPB_API_INLINE bool upb_Message_GetBool(const struct upb_Message* msg,
3033 const upb_MiniTableField* f,
3034 bool default_val) {
3035 UPB_ASSUME(upb_MiniTableField_CType(f) == kUpb_CType_Bool);
Protobuf Team Bot7646fbf2024-05-03 19:47:53 +00003036 UPB_ASSUME(upb_MiniTableField_IsScalar(f));
Protobuf Team Bot6afb1302024-05-08 02:19:22 +00003037 UPB_ASSUME(UPB_PRIVATE(_upb_MiniTableField_GetRep)(f) == kUpb_FieldRep_1Byte);
Protobuf Team Bot7646fbf2024-05-03 19:47:53 +00003038 upb_MessageValue def;
3039 def.bool_val = default_val;
3040 return upb_Message_GetField(msg, f, def).bool_val;
3041}
3042
3043UPB_API_INLINE double upb_Message_GetDouble(const struct upb_Message* msg,
3044 const upb_MiniTableField* f,
3045 double default_val) {
3046 UPB_ASSUME(upb_MiniTableField_CType(f) == kUpb_CType_Double);
Protobuf Team Bot7646fbf2024-05-03 19:47:53 +00003047 UPB_ASSUME(upb_MiniTableField_IsScalar(f));
Protobuf Team Bot6afb1302024-05-08 02:19:22 +00003048 UPB_ASSUME(UPB_PRIVATE(_upb_MiniTableField_GetRep)(f) == kUpb_FieldRep_8Byte);
Protobuf Team Bot7646fbf2024-05-03 19:47:53 +00003049
3050 upb_MessageValue def;
3051 def.double_val = default_val;
3052 return upb_Message_GetField(msg, f, def).double_val;
3053}
3054
3055UPB_API_INLINE float upb_Message_GetFloat(const struct upb_Message* msg,
3056 const upb_MiniTableField* f,
3057 float default_val) {
3058 UPB_ASSUME(upb_MiniTableField_CType(f) == kUpb_CType_Float);
Protobuf Team Bot7646fbf2024-05-03 19:47:53 +00003059 UPB_ASSUME(upb_MiniTableField_IsScalar(f));
Protobuf Team Bot6afb1302024-05-08 02:19:22 +00003060 UPB_ASSUME(UPB_PRIVATE(_upb_MiniTableField_GetRep)(f) == kUpb_FieldRep_4Byte);
Protobuf Team Bot7646fbf2024-05-03 19:47:53 +00003061
3062 upb_MessageValue def;
3063 def.float_val = default_val;
3064 return upb_Message_GetField(msg, f, def).float_val;
3065}
3066
3067UPB_API_INLINE int32_t upb_Message_GetInt32(const struct upb_Message* msg,
3068 const upb_MiniTableField* f,
3069 int32_t default_val) {
3070 UPB_ASSUME(upb_MiniTableField_CType(f) == kUpb_CType_Int32 ||
3071 upb_MiniTableField_CType(f) == kUpb_CType_Enum);
Protobuf Team Bot7646fbf2024-05-03 19:47:53 +00003072 UPB_ASSUME(upb_MiniTableField_IsScalar(f));
Protobuf Team Bot6afb1302024-05-08 02:19:22 +00003073 UPB_ASSUME(UPB_PRIVATE(_upb_MiniTableField_GetRep)(f) == kUpb_FieldRep_4Byte);
Protobuf Team Bot7646fbf2024-05-03 19:47:53 +00003074
3075 upb_MessageValue def;
3076 def.int32_val = default_val;
3077 return upb_Message_GetField(msg, f, def).int32_val;
3078}
3079
3080UPB_API_INLINE int64_t upb_Message_GetInt64(const struct upb_Message* msg,
3081 const upb_MiniTableField* f,
3082 int64_t default_val) {
3083 UPB_ASSUME(upb_MiniTableField_CType(f) == kUpb_CType_Int64);
Protobuf Team Bot7646fbf2024-05-03 19:47:53 +00003084 UPB_ASSUME(upb_MiniTableField_IsScalar(f));
Protobuf Team Bot6afb1302024-05-08 02:19:22 +00003085 UPB_ASSUME(UPB_PRIVATE(_upb_MiniTableField_GetRep)(f) == kUpb_FieldRep_8Byte);
Protobuf Team Bot7646fbf2024-05-03 19:47:53 +00003086
3087 upb_MessageValue def;
3088 def.int64_val = default_val;
3089 return upb_Message_GetField(msg, f, def).int64_val;
3090}
3091
3092UPB_INLINE void UPB_PRIVATE(_upb_Message_AssertMapIsUntagged)(
3093 const struct upb_Message* msg, const upb_MiniTableField* field) {
3094 UPB_UNUSED(msg);
3095 UPB_PRIVATE(_upb_MiniTableField_CheckIsMap)(field);
3096#ifndef NDEBUG
3097 uintptr_t default_val = 0;
3098 uintptr_t tagged;
3099 _upb_Message_GetNonExtensionField(msg, field, &default_val, &tagged);
3100 UPB_ASSERT(!upb_TaggedMessagePtr_IsEmpty(tagged));
3101#endif
3102}
3103
3104UPB_API_INLINE const struct upb_Map* upb_Message_GetMap(
3105 const struct upb_Message* msg, const upb_MiniTableField* f) {
3106 UPB_PRIVATE(_upb_MiniTableField_CheckIsMap)(f);
3107 UPB_PRIVATE(_upb_Message_AssertMapIsUntagged)(msg, f);
3108 struct upb_Map* ret;
3109 const struct upb_Map* default_val = NULL;
3110 _upb_Message_GetNonExtensionField(msg, f, &default_val, &ret);
3111 return ret;
3112}
3113
Protobuf Team Bot4d3a98c2024-05-08 01:37:14 +00003114UPB_API_INLINE uintptr_t upb_Message_GetTaggedMessagePtr(
3115 const struct upb_Message* msg, const upb_MiniTableField* f,
3116 struct upb_Message* default_val) {
3117 UPB_ASSUME(upb_MiniTableField_CType(f) == kUpb_CType_Message);
3118 UPB_ASSUME(UPB_PRIVATE(_upb_MiniTableField_GetRep)(f) ==
3119 UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte));
3120 UPB_ASSUME(upb_MiniTableField_IsScalar(f));
3121 uintptr_t tagged;
3122 _upb_Message_GetNonExtensionField(msg, f, &default_val, &tagged);
3123 return tagged;
3124}
3125
3126// For internal use only; users cannot set tagged messages because only the
3127// parser and the message copier are allowed to directly create an empty
3128// message.
3129UPB_INLINE void UPB_PRIVATE(_upb_Message_SetTaggedMessagePtr)(
3130 struct upb_Message* msg, const upb_MiniTableField* f,
3131 uintptr_t sub_message) {
3132 UPB_ASSUME(upb_MiniTableField_CType(f) == kUpb_CType_Message);
3133 UPB_ASSUME(UPB_PRIVATE(_upb_MiniTableField_GetRep)(f) ==
3134 UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte));
3135 UPB_ASSUME(upb_MiniTableField_IsScalar(f));
3136 upb_Message_SetBaseField(msg, f, &sub_message);
3137}
3138
3139UPB_API_INLINE const struct upb_Message* upb_Message_GetMessage(
3140 const struct upb_Message* msg, const upb_MiniTableField* f) {
3141 uintptr_t tagged = upb_Message_GetTaggedMessagePtr(msg, f, NULL);
3142 return upb_TaggedMessagePtr_GetNonEmptyMessage(tagged);
3143}
3144
Protobuf Team Bot7646fbf2024-05-03 19:47:53 +00003145UPB_API_INLINE upb_Array* upb_Message_GetMutableArray(
3146 struct upb_Message* msg, const upb_MiniTableField* f) {
3147 UPB_PRIVATE(_upb_MiniTableField_CheckIsArray)(f);
3148 return (upb_Array*)upb_Message_GetArray(msg, f);
3149}
3150
3151UPB_API_INLINE struct upb_Map* upb_Message_GetMutableMap(
3152 struct upb_Message* msg, const upb_MiniTableField* f) {
3153 return (struct upb_Map*)upb_Message_GetMap(msg, f);
3154}
3155
Protobuf Team Bot4d3a98c2024-05-08 01:37:14 +00003156UPB_API_INLINE struct upb_Message* upb_Message_GetMutableMessage(
3157 struct upb_Message* msg, const upb_MiniTableField* f) {
3158 return (struct upb_Message*)upb_Message_GetMessage(msg, f);
3159}
3160
Protobuf Team Bot7646fbf2024-05-03 19:47:53 +00003161UPB_API_INLINE upb_Array* upb_Message_GetOrCreateMutableArray(
3162 struct upb_Message* msg, const upb_MiniTableField* f, upb_Arena* arena) {
3163 UPB_ASSERT(arena);
3164 UPB_PRIVATE(_upb_MiniTableField_CheckIsArray)(f);
3165 upb_Array* array = upb_Message_GetMutableArray(msg, f);
3166 if (!array) {
3167 array = UPB_PRIVATE(_upb_Array_New)(
3168 arena, 4, UPB_PRIVATE(_upb_MiniTableField_ElemSizeLg2)(f));
3169 // Check again due to: https://godbolt.org/z/7WfaoKG1r
3170 UPB_PRIVATE(_upb_MiniTableField_CheckIsArray)(f);
3171 upb_MessageValue val;
3172 val.array_val = array;
3173 UPB_PRIVATE(_upb_Message_SetField)(msg, f, val, arena);
3174 }
3175 return array;
3176}
3177
3178UPB_INLINE struct upb_Map* _upb_Message_GetOrCreateMutableMap(
3179 struct upb_Message* msg, const upb_MiniTableField* field, size_t key_size,
3180 size_t val_size, upb_Arena* arena) {
3181 UPB_PRIVATE(_upb_MiniTableField_CheckIsMap)(field);
3182 UPB_PRIVATE(_upb_Message_AssertMapIsUntagged)(msg, field);
3183 struct upb_Map* map = NULL;
3184 struct upb_Map* default_map_value = NULL;
3185 _upb_Message_GetNonExtensionField(msg, field, &default_map_value, &map);
3186 if (!map) {
3187 map = _upb_Map_New(arena, key_size, val_size);
3188 // Check again due to: https://godbolt.org/z/7WfaoKG1r
3189 UPB_PRIVATE(_upb_MiniTableField_CheckIsMap)(field);
3190 upb_Message_SetBaseField(msg, field, &map);
3191 }
3192 return map;
3193}
3194
3195UPB_API_INLINE struct upb_Map* upb_Message_GetOrCreateMutableMap(
3196 struct upb_Message* msg, const upb_MiniTable* map_entry_mini_table,
3197 const upb_MiniTableField* f, upb_Arena* arena) {
3198 UPB_ASSUME(upb_MiniTableField_CType(f) == kUpb_CType_Message);
3199 const upb_MiniTableField* map_entry_key_field =
3200 &map_entry_mini_table->UPB_ONLYBITS(fields)[0];
3201 const upb_MiniTableField* map_entry_value_field =
3202 &map_entry_mini_table->UPB_ONLYBITS(fields)[1];
3203 return _upb_Message_GetOrCreateMutableMap(
3204 msg, f, _upb_Map_CTypeSize(upb_MiniTableField_CType(map_entry_key_field)),
3205 _upb_Map_CTypeSize(upb_MiniTableField_CType(map_entry_value_field)),
3206 arena);
3207}
3208
3209UPB_API_INLINE struct upb_Message* upb_Message_GetOrCreateMutableMessage(
3210 struct upb_Message* msg, const upb_MiniTable* mini_table,
3211 const upb_MiniTableField* f, upb_Arena* arena) {
3212 UPB_ASSERT(arena);
3213 UPB_ASSUME(upb_MiniTableField_CType(f) == kUpb_CType_Message);
3214 UPB_ASSUME(!upb_MiniTableField_IsExtension(f));
3215 struct upb_Message* sub_message =
3216 *UPB_PTR_AT(msg, f->UPB_ONLYBITS(offset), struct upb_Message*);
3217 if (!sub_message) {
3218 const upb_MiniTable* sub_mini_table =
3219 upb_MiniTable_SubMessage(mini_table, f);
3220 UPB_ASSERT(sub_mini_table);
3221 sub_message = _upb_Message_New(sub_mini_table, arena);
3222 *UPB_PTR_AT(msg, f->UPB_ONLYBITS(offset), struct upb_Message*) =
3223 sub_message;
3224 UPB_PRIVATE(_upb_Message_SetPresence)(msg, f);
3225 }
3226 return sub_message;
3227}
3228
3229UPB_API_INLINE upb_StringView
3230upb_Message_GetString(const struct upb_Message* msg,
3231 const upb_MiniTableField* f, upb_StringView default_val) {
3232 UPB_ASSUME(upb_MiniTableField_CType(f) == kUpb_CType_String ||
3233 upb_MiniTableField_CType(f) == kUpb_CType_Bytes);
3234 UPB_ASSUME(UPB_PRIVATE(_upb_MiniTableField_GetRep)(f) ==
3235 kUpb_FieldRep_StringView);
Protobuf Team Bot7646fbf2024-05-03 19:47:53 +00003236
3237 upb_MessageValue def;
3238 def.str_val = default_val;
3239 return upb_Message_GetField(msg, f, def).str_val;
3240}
3241
3242UPB_API_INLINE uint32_t upb_Message_GetUInt32(const struct upb_Message* msg,
3243 const upb_MiniTableField* f,
3244 uint32_t default_val) {
3245 UPB_ASSUME(upb_MiniTableField_CType(f) == kUpb_CType_UInt32);
Protobuf Team Bot7646fbf2024-05-03 19:47:53 +00003246 UPB_ASSUME(upb_MiniTableField_IsScalar(f));
Protobuf Team Bot6afb1302024-05-08 02:19:22 +00003247 UPB_ASSUME(UPB_PRIVATE(_upb_MiniTableField_GetRep)(f) == kUpb_FieldRep_4Byte);
Protobuf Team Bot7646fbf2024-05-03 19:47:53 +00003248
3249 upb_MessageValue def;
3250 def.uint32_val = default_val;
3251 return upb_Message_GetField(msg, f, def).uint32_val;
3252}
3253
3254UPB_API_INLINE uint64_t upb_Message_GetUInt64(const struct upb_Message* msg,
3255 const upb_MiniTableField* f,
3256 uint64_t default_val) {
3257 UPB_ASSUME(upb_MiniTableField_CType(f) == kUpb_CType_UInt64);
Protobuf Team Bot7646fbf2024-05-03 19:47:53 +00003258 UPB_ASSUME(upb_MiniTableField_IsScalar(f));
Protobuf Team Bot6afb1302024-05-08 02:19:22 +00003259 UPB_ASSUME(UPB_PRIVATE(_upb_MiniTableField_GetRep)(f) == kUpb_FieldRep_8Byte);
Protobuf Team Bot7646fbf2024-05-03 19:47:53 +00003260
3261 upb_MessageValue def;
3262 def.uint64_val = default_val;
3263 return upb_Message_GetField(msg, f, def).uint64_val;
3264}
3265
Protobuf Team Bot6afb1302024-05-08 02:19:22 +00003266// BaseField Setters ///////////////////////////////////////////////////////////
3267
3268UPB_API_INLINE void upb_Message_SetBaseFieldBool(struct upb_Message* msg,
3269 const upb_MiniTableField* f,
3270 bool value) {
Protobuf Team Bot7646fbf2024-05-03 19:47:53 +00003271 UPB_ASSUME(upb_MiniTableField_CType(f) == kUpb_CType_Bool);
Protobuf Team Bot7646fbf2024-05-03 19:47:53 +00003272 UPB_ASSUME(upb_MiniTableField_IsScalar(f));
Protobuf Team Bot6afb1302024-05-08 02:19:22 +00003273 UPB_ASSUME(UPB_PRIVATE(_upb_MiniTableField_GetRep)(f) == kUpb_FieldRep_1Byte);
3274 upb_Message_SetBaseField(msg, f, &value);
3275}
3276
3277UPB_API_INLINE void upb_Message_SetBaseFieldDouble(struct upb_Message* msg,
3278 const upb_MiniTableField* f,
3279 double value) {
3280 UPB_ASSUME(upb_MiniTableField_CType(f) == kUpb_CType_Double);
3281 UPB_ASSUME(upb_MiniTableField_IsScalar(f));
3282 UPB_ASSUME(UPB_PRIVATE(_upb_MiniTableField_GetRep)(f) == kUpb_FieldRep_8Byte);
3283 upb_Message_SetBaseField(msg, f, &value);
3284}
3285
3286UPB_API_INLINE void upb_Message_SetBaseFieldFloat(struct upb_Message* msg,
3287 const upb_MiniTableField* f,
3288 float value) {
3289 UPB_ASSUME(upb_MiniTableField_CType(f) == kUpb_CType_Float);
3290 UPB_ASSUME(upb_MiniTableField_IsScalar(f));
3291 UPB_ASSUME(UPB_PRIVATE(_upb_MiniTableField_GetRep)(f) == kUpb_FieldRep_4Byte);
3292 upb_Message_SetBaseField(msg, f, &value);
3293}
3294
3295UPB_API_INLINE void upb_Message_SetBaseFieldInt32(struct upb_Message* msg,
3296 const upb_MiniTableField* f,
3297 int32_t value) {
3298 UPB_ASSUME(upb_MiniTableField_CType(f) == kUpb_CType_Int32 ||
3299 upb_MiniTableField_CType(f) == kUpb_CType_Enum);
3300 UPB_ASSUME(upb_MiniTableField_IsScalar(f));
3301 UPB_ASSUME(UPB_PRIVATE(_upb_MiniTableField_GetRep)(f) == kUpb_FieldRep_4Byte);
3302 upb_Message_SetBaseField(msg, f, &value);
3303}
3304
3305UPB_API_INLINE void upb_Message_SetBaseFieldInt64(struct upb_Message* msg,
3306 const upb_MiniTableField* f,
3307 int64_t value) {
3308 UPB_ASSUME(upb_MiniTableField_CType(f) == kUpb_CType_Int64);
3309 UPB_ASSUME(upb_MiniTableField_IsScalar(f));
3310 UPB_ASSUME(UPB_PRIVATE(_upb_MiniTableField_GetRep)(f) == kUpb_FieldRep_8Byte);
3311 upb_Message_SetBaseField(msg, f, &value);
3312}
3313
3314UPB_API_INLINE void upb_Message_SetBaseFieldString(struct upb_Message* msg,
3315 const upb_MiniTableField* f,
3316 upb_StringView value) {
3317 UPB_ASSUME(upb_MiniTableField_CType(f) == kUpb_CType_String ||
3318 upb_MiniTableField_CType(f) == kUpb_CType_Bytes);
3319 UPB_ASSUME(upb_MiniTableField_IsScalar(f));
3320 UPB_ASSUME(UPB_PRIVATE(_upb_MiniTableField_GetRep)(f) ==
3321 kUpb_FieldRep_StringView);
3322 upb_Message_SetBaseField(msg, f, &value);
3323}
3324
3325UPB_API_INLINE void upb_Message_SetBaseFieldUInt32(struct upb_Message* msg,
3326 const upb_MiniTableField* f,
3327 uint32_t value) {
3328 UPB_ASSUME(upb_MiniTableField_CType(f) == kUpb_CType_UInt32);
3329 UPB_ASSUME(upb_MiniTableField_IsScalar(f));
3330 UPB_ASSUME(UPB_PRIVATE(_upb_MiniTableField_GetRep)(f) == kUpb_FieldRep_4Byte);
3331 upb_Message_SetBaseField(msg, f, &value);
3332}
3333
3334UPB_API_INLINE void upb_Message_SetBaseFieldUInt64(struct upb_Message* msg,
3335 const upb_MiniTableField* f,
3336 uint64_t value) {
3337 UPB_ASSUME(upb_MiniTableField_CType(f) == kUpb_CType_UInt64);
3338 UPB_ASSUME(upb_MiniTableField_IsScalar(f));
3339 UPB_ASSUME(UPB_PRIVATE(_upb_MiniTableField_GetRep)(f) == kUpb_FieldRep_8Byte);
3340 upb_Message_SetBaseField(msg, f, &value);
Protobuf Team Bot7646fbf2024-05-03 19:47:53 +00003341}
3342
Protobuf Team Botddc70b02024-05-11 02:21:06 +00003343UPB_API_INLINE void upb_Message_SetClosedEnum(struct upb_Message* msg,
3344 const upb_MiniTable* m,
3345 const upb_MiniTableField* f,
3346 int32_t value) {
Protobuf Team Bot7646fbf2024-05-03 19:47:53 +00003347 UPB_ASSERT(upb_MiniTableField_IsClosedEnum(f));
3348 UPB_ASSUME(UPB_PRIVATE(_upb_MiniTableField_GetRep)(f) == kUpb_FieldRep_4Byte);
Protobuf Team Botddc70b02024-05-11 02:21:06 +00003349 UPB_ASSERT(
3350 upb_MiniTableEnum_CheckValue(upb_MiniTable_GetSubEnumTable(m, f), value));
Protobuf Team Bot7646fbf2024-05-03 19:47:53 +00003351 upb_Message_SetBaseField(msg, f, &value);
3352}
3353
Protobuf Team Bot6afb1302024-05-08 02:19:22 +00003354// Extension Setters ///////////////////////////////////////////////////////////
3355
3356UPB_API_INLINE bool upb_Message_SetExtensionBool(
3357 struct upb_Message* msg, const upb_MiniTableExtension* e, bool value,
3358 upb_Arena* a) {
3359 UPB_ASSUME(upb_MiniTableExtension_CType(e) == kUpb_CType_Bool);
3360 UPB_ASSUME(UPB_PRIVATE(_upb_MiniTableExtension_GetRep)(e) ==
3361 kUpb_FieldRep_1Byte);
3362 return upb_Message_SetExtension(msg, e, &value, a);
3363}
3364
3365UPB_API_INLINE bool upb_Message_SetExtensionDouble(
3366 struct upb_Message* msg, const upb_MiniTableExtension* e, double value,
3367 upb_Arena* a) {
3368 UPB_ASSUME(upb_MiniTableExtension_CType(e) == kUpb_CType_Double);
3369 UPB_ASSUME(UPB_PRIVATE(_upb_MiniTableExtension_GetRep)(e) ==
3370 kUpb_FieldRep_8Byte);
3371 return upb_Message_SetExtension(msg, e, &value, a);
3372}
3373
3374UPB_API_INLINE bool upb_Message_SetExtensionFloat(
3375 struct upb_Message* msg, const upb_MiniTableExtension* e, float value,
3376 upb_Arena* a) {
3377 UPB_ASSUME(upb_MiniTableExtension_CType(e) == kUpb_CType_Float);
3378 UPB_ASSUME(UPB_PRIVATE(_upb_MiniTableExtension_GetRep)(e) ==
3379 kUpb_FieldRep_4Byte);
3380 return upb_Message_SetExtension(msg, e, &value, a);
3381}
3382
3383UPB_API_INLINE bool upb_Message_SetExtensionInt32(
3384 struct upb_Message* msg, const upb_MiniTableExtension* e, int32_t value,
3385 upb_Arena* a) {
3386 UPB_ASSUME(upb_MiniTableExtension_CType(e) == kUpb_CType_Int32 ||
3387 upb_MiniTableExtension_CType(e) == kUpb_CType_Enum);
3388 UPB_ASSUME(UPB_PRIVATE(_upb_MiniTableExtension_GetRep)(e) ==
3389 kUpb_FieldRep_4Byte);
3390 return upb_Message_SetExtension(msg, e, &value, a);
3391}
3392
3393UPB_API_INLINE bool upb_Message_SetExtensionInt64(
3394 struct upb_Message* msg, const upb_MiniTableExtension* e, int64_t value,
3395 upb_Arena* a) {
3396 UPB_ASSUME(upb_MiniTableExtension_CType(e) == kUpb_CType_Int64);
3397 UPB_ASSUME(UPB_PRIVATE(_upb_MiniTableExtension_GetRep)(e) ==
3398 kUpb_FieldRep_8Byte);
3399 return upb_Message_SetExtension(msg, e, &value, a);
3400}
3401
3402UPB_API_INLINE bool upb_Message_SetExtensionString(
3403 struct upb_Message* msg, const upb_MiniTableExtension* e,
3404 upb_StringView value, upb_Arena* a) {
3405 UPB_ASSUME(upb_MiniTableExtension_CType(e) == kUpb_CType_String ||
3406 upb_MiniTableExtension_CType(e) == kUpb_CType_Bytes);
3407 UPB_ASSUME(UPB_PRIVATE(_upb_MiniTableExtension_GetRep)(e) ==
3408 kUpb_FieldRep_StringView);
3409 return upb_Message_SetExtension(msg, e, &value, a);
3410}
3411
3412UPB_API_INLINE bool upb_Message_SetExtensionUInt32(
3413 struct upb_Message* msg, const upb_MiniTableExtension* e, uint32_t value,
3414 upb_Arena* a) {
3415 UPB_ASSUME(upb_MiniTableExtension_CType(e) == kUpb_CType_UInt32);
3416 UPB_ASSUME(UPB_PRIVATE(_upb_MiniTableExtension_GetRep)(e) ==
3417 kUpb_FieldRep_4Byte);
3418 return upb_Message_SetExtension(msg, e, &value, a);
3419}
3420
3421UPB_API_INLINE bool upb_Message_SetExtensionUInt64(
3422 struct upb_Message* msg, const upb_MiniTableExtension* e, uint64_t value,
3423 upb_Arena* a) {
3424 UPB_ASSUME(upb_MiniTableExtension_CType(e) == kUpb_CType_UInt64);
3425 UPB_ASSUME(UPB_PRIVATE(_upb_MiniTableExtension_GetRep)(e) ==
3426 kUpb_FieldRep_8Byte);
3427 return upb_Message_SetExtension(msg, e, &value, a);
3428}
3429
3430// Universal Setters ///////////////////////////////////////////////////////////
3431
3432UPB_API_INLINE bool upb_Message_SetBool(struct upb_Message* msg,
3433 const upb_MiniTableField* f, bool value,
3434 upb_Arena* a) {
3435 return upb_MiniTableField_IsExtension(f)
3436 ? upb_Message_SetExtensionBool(
3437 msg, (const upb_MiniTableExtension*)f, value, a)
3438 : (upb_Message_SetBaseFieldBool(msg, f, value), true);
3439}
3440
Protobuf Team Bot7646fbf2024-05-03 19:47:53 +00003441UPB_API_INLINE bool upb_Message_SetDouble(struct upb_Message* msg,
3442 const upb_MiniTableField* f,
3443 double value, upb_Arena* a) {
Protobuf Team Bot6afb1302024-05-08 02:19:22 +00003444 return upb_MiniTableField_IsExtension(f)
3445 ? upb_Message_SetExtensionDouble(
3446 msg, (const upb_MiniTableExtension*)f, value, a)
3447 : (upb_Message_SetBaseFieldDouble(msg, f, value), true);
Protobuf Team Bot7646fbf2024-05-03 19:47:53 +00003448}
3449
3450UPB_API_INLINE bool upb_Message_SetFloat(struct upb_Message* msg,
3451 const upb_MiniTableField* f,
3452 float value, upb_Arena* a) {
Protobuf Team Bot6afb1302024-05-08 02:19:22 +00003453 return upb_MiniTableField_IsExtension(f)
3454 ? upb_Message_SetExtensionFloat(
3455 msg, (const upb_MiniTableExtension*)f, value, a)
3456 : (upb_Message_SetBaseFieldFloat(msg, f, value), true);
Protobuf Team Bot7646fbf2024-05-03 19:47:53 +00003457}
3458
3459UPB_API_INLINE bool upb_Message_SetInt32(struct upb_Message* msg,
3460 const upb_MiniTableField* f,
3461 int32_t value, upb_Arena* a) {
Protobuf Team Bot6afb1302024-05-08 02:19:22 +00003462 return upb_MiniTableField_IsExtension(f)
3463 ? upb_Message_SetExtensionInt32(
3464 msg, (const upb_MiniTableExtension*)f, value, a)
3465 : (upb_Message_SetBaseFieldInt32(msg, f, value), true);
Protobuf Team Bot7646fbf2024-05-03 19:47:53 +00003466}
3467
3468UPB_API_INLINE bool upb_Message_SetInt64(struct upb_Message* msg,
3469 const upb_MiniTableField* f,
3470 int64_t value, upb_Arena* a) {
Protobuf Team Bot6afb1302024-05-08 02:19:22 +00003471 return upb_MiniTableField_IsExtension(f)
3472 ? upb_Message_SetExtensionInt64(
3473 msg, (const upb_MiniTableExtension*)f, value, a)
3474 : (upb_Message_SetBaseFieldInt64(msg, f, value), true);
Protobuf Team Bot7646fbf2024-05-03 19:47:53 +00003475}
3476
Protobuf Team Bot4d3a98c2024-05-08 01:37:14 +00003477// Sets the value of a message-typed field. The mini_tables of `msg` and
Protobuf Team Botb51dc1b2024-05-09 21:34:06 +00003478// `value` must have been linked for this to work correctly.
Protobuf Team Bot4d3a98c2024-05-08 01:37:14 +00003479UPB_API_INLINE void upb_Message_SetMessage(struct upb_Message* msg,
Protobuf Team Bot4d3a98c2024-05-08 01:37:14 +00003480 const upb_MiniTableField* f,
Protobuf Team Botb51dc1b2024-05-09 21:34:06 +00003481 struct upb_Message* value) {
Protobuf Team Bot4d3a98c2024-05-08 01:37:14 +00003482 UPB_PRIVATE(_upb_Message_SetTaggedMessagePtr)
Protobuf Team Botb51dc1b2024-05-09 21:34:06 +00003483 (msg, f, UPB_PRIVATE(_upb_TaggedMessagePtr_Pack)(value, false));
Protobuf Team Bot4d3a98c2024-05-08 01:37:14 +00003484}
3485
Protobuf Team Bot7646fbf2024-05-03 19:47:53 +00003486// Sets the value of a `string` or `bytes` field. The bytes of the value are not
3487// copied, so it is the caller's responsibility to ensure that they remain valid
3488// for the lifetime of `msg`. That might be done by copying them into the given
3489// arena, or by fusing that arena with the arena the bytes live in, for example.
3490UPB_API_INLINE bool upb_Message_SetString(struct upb_Message* msg,
3491 const upb_MiniTableField* f,
3492 upb_StringView value, upb_Arena* a) {
Protobuf Team Bot6afb1302024-05-08 02:19:22 +00003493 return upb_MiniTableField_IsExtension(f)
3494 ? upb_Message_SetExtensionString(
3495 msg, (const upb_MiniTableExtension*)f, value, a)
3496 : (upb_Message_SetBaseFieldString(msg, f, value), true);
Protobuf Team Bot7646fbf2024-05-03 19:47:53 +00003497}
3498
3499UPB_API_INLINE bool upb_Message_SetUInt32(struct upb_Message* msg,
3500 const upb_MiniTableField* f,
3501 uint32_t value, upb_Arena* a) {
Protobuf Team Bot6afb1302024-05-08 02:19:22 +00003502 return upb_MiniTableField_IsExtension(f)
3503 ? upb_Message_SetExtensionUInt32(
3504 msg, (const upb_MiniTableExtension*)f, value, a)
3505 : (upb_Message_SetBaseFieldUInt32(msg, f, value), true);
Protobuf Team Bot7646fbf2024-05-03 19:47:53 +00003506}
3507
3508UPB_API_INLINE bool upb_Message_SetUInt64(struct upb_Message* msg,
3509 const upb_MiniTableField* f,
3510 uint64_t value, upb_Arena* a) {
Protobuf Team Bot6afb1302024-05-08 02:19:22 +00003511 return upb_MiniTableField_IsExtension(f)
3512 ? upb_Message_SetExtensionUInt64(
3513 msg, (const upb_MiniTableExtension*)f, value, a)
3514 : (upb_Message_SetBaseFieldUInt64(msg, f, value), true);
Protobuf Team Bot7646fbf2024-05-03 19:47:53 +00003515}
3516
Protobuf Team Botb3878b52024-02-08 21:50:53 +00003517UPB_API_INLINE void upb_Message_Clear(struct upb_Message* msg,
3518 const upb_MiniTable* m) {
3519 UPB_ASSERT(!upb_Message_IsFrozen(msg));
Protobuf Team Botd813cc02024-04-08 19:12:29 +00003520 upb_Message_Internal* in = UPB_PRIVATE(_upb_Message_GetInternal)(msg);
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00003521 memset(msg, 0, m->UPB_PRIVATE(size));
Protobuf Team Botd813cc02024-04-08 19:12:29 +00003522 if (in) {
3523 // Reset the internal buffer to empty.
3524 in->unknown_end = sizeof(upb_Message_Internal);
3525 in->ext_begin = in->size;
3526 UPB_PRIVATE(_upb_Message_SetInternal)(msg, in);
3527 }
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00003528}
3529
Protobuf Team Botb3878b52024-02-08 21:50:53 +00003530UPB_API_INLINE void upb_Message_ClearBaseField(struct upb_Message* msg,
3531 const upb_MiniTableField* f) {
3532 UPB_ASSERT(!upb_Message_IsFrozen(msg));
Protobuf Team Bot4e90ead2024-01-08 15:46:34 +00003533 if (UPB_PRIVATE(_upb_MiniTableField_HasHasbit)(f)) {
3534 UPB_PRIVATE(_upb_Message_ClearHasbit)(msg, f);
3535 } else if (upb_MiniTableField_IsInOneof(f)) {
3536 uint32_t* ptr = UPB_PRIVATE(_upb_Message_OneofCasePtr)(msg, f);
3537 if (*ptr != upb_MiniTableField_Number(f)) return;
3538 *ptr = 0;
3539 }
3540 const char zeros[16] = {0};
3541 UPB_PRIVATE(_upb_MiniTableField_DataCopy)
Protobuf Team Bot9bee7472024-01-10 18:09:23 +00003542 (f, UPB_PRIVATE(_upb_Message_MutableDataPtr)(msg, f), zeros);
Protobuf Team Bot4e90ead2024-01-08 15:46:34 +00003543}
3544
Protobuf Team Botb3878b52024-02-08 21:50:53 +00003545UPB_API_INLINE void upb_Message_ClearExtension(
Protobuf Team Bot4e90ead2024-01-08 15:46:34 +00003546 struct upb_Message* msg, const upb_MiniTableExtension* e) {
Protobuf Team Botb3878b52024-02-08 21:50:53 +00003547 UPB_ASSERT(!upb_Message_IsFrozen(msg));
Protobuf Team Bot886a0b12024-01-26 21:23:01 +00003548 upb_Message_Internal* in = UPB_PRIVATE(_upb_Message_GetInternal)(msg);
Protobuf Team Bot2b797382023-12-30 23:16:16 +00003549 if (!in) return;
Protobuf Team Botc13512a2024-01-25 18:53:49 +00003550 const upb_Extension* base = UPB_PTR_AT(in, in->ext_begin, upb_Extension);
3551 upb_Extension* ext = (upb_Extension*)UPB_PRIVATE(_upb_Message_Getext)(msg, e);
Eric Salo10505992022-12-12 12:16:36 -08003552 if (ext) {
3553 *ext = *base;
Protobuf Team Botc13512a2024-01-25 18:53:49 +00003554 in->ext_begin += sizeof(upb_Extension);
Mike Kruskal3bc50492022-12-01 13:34:12 -08003555 }
3556}
3557
Protobuf Team Botae17e812024-05-07 16:59:23 +00003558UPB_API_INLINE void upb_Message_ClearOneof(struct upb_Message* msg,
3559 const upb_MiniTable* m,
3560 const upb_MiniTableField* f) {
3561 UPB_ASSERT(!upb_Message_IsFrozen(msg));
3562 uint32_t field_number = upb_Message_WhichOneofFieldNumber(msg, f);
3563 if (field_number == 0) {
3564 // No field in the oneof is set.
3565 return;
3566 }
3567
3568 const upb_MiniTableField* field =
3569 upb_MiniTable_FindFieldByNumber(m, field_number);
3570 upb_Message_ClearBaseField(msg, field);
3571}
3572
Protobuf Team Bot7646fbf2024-05-03 19:47:53 +00003573UPB_API_INLINE void* upb_Message_ResizeArrayUninitialized(
3574 struct upb_Message* msg, const upb_MiniTableField* f, size_t size,
3575 upb_Arena* arena) {
3576 UPB_PRIVATE(_upb_MiniTableField_CheckIsArray)(f);
3577 upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, f, arena);
3578 if (!arr || !UPB_PRIVATE(_upb_Array_ResizeUninitialized)(arr, size, arena)) {
3579 return NULL;
Eric Salob7d54ac2022-12-29 11:59:42 -08003580 }
Protobuf Team Bot7646fbf2024-05-03 19:47:53 +00003581 return upb_Array_MutableDataPtr(arr);
Eric Salob7d54ac2022-12-29 11:59:42 -08003582}
3583
Deanna Garciabd6a0cf2023-04-20 10:30:44 -07003584#ifdef __cplusplus
3585} /* extern "C" */
3586#endif
3587
3588#if defined(__GNUC__) && !defined(__clang__)
3589#pragma GCC diagnostic pop
3590#endif
3591
3592
Sandy Zhange3b09432023-08-07 09:30:02 -07003593#endif // UPB_MESSAGE_INTERNAL_ACCESSORS_H_
Deanna Garciabd6a0cf2023-04-20 10:30:44 -07003594
Protobuf Team Bot499c7482023-12-30 01:42:17 +00003595#ifndef UPB_MESSAGE_MAP_H_
3596#define UPB_MESSAGE_MAP_H_
Protobuf Team Bot376ba2f2023-09-29 22:17:43 +00003597
Protobuf Team Bot499c7482023-12-30 01:42:17 +00003598#include <stddef.h>
Protobuf Team Bot376ba2f2023-09-29 22:17:43 +00003599
3600
3601// Must be last.
3602
Protobuf Team Bot499c7482023-12-30 01:42:17 +00003603typedef struct upb_Map upb_Map;
Protobuf Team Botc9a8b462023-11-18 01:30:26 +00003604
Protobuf Team Bot376ba2f2023-09-29 22:17:43 +00003605#ifdef __cplusplus
3606extern "C" {
3607#endif
3608
Protobuf Team Bot499c7482023-12-30 01:42:17 +00003609// Creates a new map on the given arena with the given key/value size.
3610UPB_API upb_Map* upb_Map_New(upb_Arena* a, upb_CType key_type,
3611 upb_CType value_type);
Protobuf Team Botc9a8b462023-11-18 01:30:26 +00003612
Protobuf Team Bot499c7482023-12-30 01:42:17 +00003613// Returns the number of entries in the map.
3614UPB_API size_t upb_Map_Size(const upb_Map* map);
Protobuf Team Bot376ba2f2023-09-29 22:17:43 +00003615
Protobuf Team Bot499c7482023-12-30 01:42:17 +00003616// Stores a value for the given key into |*val| (or the zero value if the key is
3617// not present). Returns whether the key was present. The |val| pointer may be
3618// NULL, in which case the function tests whether the given key is present.
3619UPB_API bool upb_Map_Get(const upb_Map* map, upb_MessageValue key,
3620 upb_MessageValue* val);
3621
3622// Removes all entries in the map.
3623UPB_API void upb_Map_Clear(upb_Map* map);
3624
3625// Sets the given key to the given value, returning whether the key was inserted
3626// or replaced. If the key was inserted, then any existing iterators will be
3627// invalidated.
3628UPB_API upb_MapInsertStatus upb_Map_Insert(upb_Map* map, upb_MessageValue key,
3629 upb_MessageValue val,
3630 upb_Arena* arena);
3631
3632// Sets the given key to the given value. Returns false if memory allocation
3633// failed. If the key is newly inserted, then any existing iterators will be
3634// invalidated.
3635UPB_API_INLINE bool upb_Map_Set(upb_Map* map, upb_MessageValue key,
3636 upb_MessageValue val, upb_Arena* arena) {
3637 return upb_Map_Insert(map, key, val, arena) !=
3638 kUpb_MapInsertStatus_OutOfMemory;
Protobuf Team Botc9a8b462023-11-18 01:30:26 +00003639}
3640
Protobuf Team Bot499c7482023-12-30 01:42:17 +00003641// Deletes this key from the table. Returns true if the key was present.
3642// If present and |val| is non-NULL, stores the deleted value.
3643UPB_API bool upb_Map_Delete(upb_Map* map, upb_MessageValue key,
3644 upb_MessageValue* val);
3645
Protobuf Team Bot499c7482023-12-30 01:42:17 +00003646// Map iteration:
3647//
3648// size_t iter = kUpb_Map_Begin;
3649// upb_MessageValue key, val;
3650// while (upb_Map_Next(map, &key, &val, &iter)) {
3651// ...
3652// }
Protobuf Team Bot376ba2f2023-09-29 22:17:43 +00003653
Protobuf Team Botb3878b52024-02-08 21:50:53 +00003654#define kUpb_Map_Begin ((size_t) - 1)
Protobuf Team Bot376ba2f2023-09-29 22:17:43 +00003655
Protobuf Team Bot499c7482023-12-30 01:42:17 +00003656// Advances to the next entry. Returns false if no more entries are present.
3657// Otherwise returns true and populates both *key and *value.
3658UPB_API bool upb_Map_Next(const upb_Map* map, upb_MessageValue* key,
3659 upb_MessageValue* val, size_t* iter);
Protobuf Team Bot376ba2f2023-09-29 22:17:43 +00003660
Protobuf Team Bot499c7482023-12-30 01:42:17 +00003661// Sets the value for the entry pointed to by iter.
3662// WARNING: this does not currently work for string values!
3663UPB_API void upb_Map_SetEntryValue(upb_Map* map, size_t iter,
3664 upb_MessageValue val);
Protobuf Team Bot376ba2f2023-09-29 22:17:43 +00003665
Protobuf Team Bot499c7482023-12-30 01:42:17 +00003666// DEPRECATED iterator, slated for removal.
Protobuf Team Bot376ba2f2023-09-29 22:17:43 +00003667
Protobuf Team Bot499c7482023-12-30 01:42:17 +00003668/* Map iteration:
3669 *
3670 * size_t iter = kUpb_Map_Begin;
3671 * while (upb_MapIterator_Next(map, &iter)) {
3672 * upb_MessageValue key = upb_MapIterator_Key(map, iter);
3673 * upb_MessageValue val = upb_MapIterator_Value(map, iter);
3674 * }
3675 */
Protobuf Team Bot376ba2f2023-09-29 22:17:43 +00003676
Protobuf Team Bot499c7482023-12-30 01:42:17 +00003677// Advances to the next entry. Returns false if no more entries are present.
3678UPB_API bool upb_MapIterator_Next(const upb_Map* map, size_t* iter);
Protobuf Team Bot376ba2f2023-09-29 22:17:43 +00003679
Protobuf Team Bot499c7482023-12-30 01:42:17 +00003680// Returns true if the iterator still points to a valid entry, or false if the
3681// iterator is past the last element. It is an error to call this function with
3682// kUpb_Map_Begin (you must call next() at least once first).
3683UPB_API bool upb_MapIterator_Done(const upb_Map* map, size_t iter);
3684
3685// Returns the key and value for this entry of the map.
3686UPB_API upb_MessageValue upb_MapIterator_Key(const upb_Map* map, size_t iter);
3687UPB_API upb_MessageValue upb_MapIterator_Value(const upb_Map* map, size_t iter);
Protobuf Team Bot030ab8d2023-12-01 19:20:11 +00003688
Protobuf Team Bot886a0b12024-01-26 21:23:01 +00003689// Mark a map and all of its descendents as frozen/immutable.
3690// If the map values are messages then |m| must point to the minitable for
3691// those messages. Otherwise |m| must be NULL.
3692UPB_API void upb_Map_Freeze(upb_Map* map, const upb_MiniTable* m);
3693
3694// Returns whether a map has been frozen.
Protobuf Team Botb3878b52024-02-08 21:50:53 +00003695UPB_API_INLINE bool upb_Map_IsFrozen(const upb_Map* map);
Protobuf Team Bot886a0b12024-01-26 21:23:01 +00003696
Protobuf Team Bot376ba2f2023-09-29 22:17:43 +00003697#ifdef __cplusplus
3698} /* extern "C" */
3699#endif
3700
Protobuf Team Bot499c7482023-12-30 01:42:17 +00003701
3702#endif /* UPB_MESSAGE_MAP_H_ */
3703
Protobuf Team Bot499c7482023-12-30 01:42:17 +00003704// Public APIs for message operations that do not depend on the schema.
3705//
3706// MiniTable-based accessors live in accessors.h.
3707
3708#ifndef UPB_MESSAGE_MESSAGE_H_
3709#define UPB_MESSAGE_MESSAGE_H_
3710
3711#include <stddef.h>
3712
3713
3714// Must be last.
3715
Protobuf Team Bot499c7482023-12-30 01:42:17 +00003716typedef struct upb_Message upb_Message;
3717
3718#ifdef __cplusplus
3719extern "C" {
3720#endif
3721
3722// Creates a new message with the given mini_table on the given arena.
3723UPB_API upb_Message* upb_Message_New(const upb_MiniTable* m, upb_Arena* arena);
3724
3725// Returns a reference to the message's unknown data.
3726const char* upb_Message_GetUnknown(const upb_Message* msg, size_t* len);
3727
3728// Removes partial unknown data from message.
3729void upb_Message_DeleteUnknown(upb_Message* msg, const char* data, size_t len);
3730
3731// Returns the number of extensions present in this message.
3732size_t upb_Message_ExtensionCount(const upb_Message* msg);
3733
Protobuf Team Bot886a0b12024-01-26 21:23:01 +00003734// Mark a message and all of its descendents as frozen/immutable.
3735UPB_API void upb_Message_Freeze(upb_Message* msg, const upb_MiniTable* m);
3736
3737// Returns whether a message has been frozen.
Protobuf Team Botb3878b52024-02-08 21:50:53 +00003738UPB_API_INLINE bool upb_Message_IsFrozen(const upb_Message* msg);
Protobuf Team Bot886a0b12024-01-26 21:23:01 +00003739
Protobuf Team Botfb08bca2024-03-14 15:21:13 +00003740#ifdef UPB_TRACING_ENABLED
Protobuf Team Bot51cba7c2024-05-06 13:34:40 +00003741UPB_API void upb_Message_LogNewMessage(const upb_MiniTable* m,
3742 const upb_Arena* arena);
3743
3744UPB_API void upb_Message_SetNewMessageTraceHandler(
3745 void (*handler)(const upb_MiniTable* m, const upb_Arena* arena));
3746#endif // UPB_TRACING_ENABLED
Protobuf Team Botfb08bca2024-03-14 15:21:13 +00003747
Protobuf Team Bot499c7482023-12-30 01:42:17 +00003748#ifdef __cplusplus
3749} /* extern "C" */
3750#endif
3751
3752
3753#endif /* UPB_MESSAGE_MESSAGE_H_ */
3754
Protobuf Team Botd1cf09a2024-04-19 22:43:34 +00003755#ifndef UPB_MINI_TABLE_TAGGED_PTR_H_
3756#define UPB_MINI_TABLE_TAGGED_PTR_H_
3757
3758#include <stdint.h>
3759
3760
Protobuf Team Bot499c7482023-12-30 01:42:17 +00003761// Must be last.
3762
3763// When a upb_Message* is stored in a message, array, or map, it is stored in a
3764// tagged form. If the tag bit is set, the referenced upb_Message is of type
3765// _kUpb_MiniTable_Empty (a sentinel message type with no fields) instead of
3766// that field's true message type. This forms the basis of what we call
3767// "dynamic tree shaking."
3768//
3769// See the documentation for kUpb_DecodeOption_ExperimentalAllowUnlinked for
3770// more information.
3771
3772typedef uintptr_t upb_TaggedMessagePtr;
3773
3774#ifdef __cplusplus
3775extern "C" {
3776#endif
3777
3778// Users who enable unlinked sub-messages must use this to test whether a
3779// message is empty before accessing it. If a message is empty, it must be
3780// first promoted using the interfaces in message/promote.h.
Protobuf Team Botb3878b52024-02-08 21:50:53 +00003781UPB_API_INLINE bool upb_TaggedMessagePtr_IsEmpty(upb_TaggedMessagePtr ptr);
Protobuf Team Bot499c7482023-12-30 01:42:17 +00003782
Protobuf Team Botb3878b52024-02-08 21:50:53 +00003783UPB_API_INLINE upb_Message* upb_TaggedMessagePtr_GetNonEmptyMessage(
3784 upb_TaggedMessagePtr ptr);
Protobuf Team Bot499c7482023-12-30 01:42:17 +00003785
3786#ifdef __cplusplus
3787} /* extern "C" */
3788#endif
3789
3790
3791#endif /* UPB_MINI_TABLE_TAGGED_PTR_H_ */
Protobuf Team Bot376ba2f2023-09-29 22:17:43 +00003792
Deanna Garciabd6a0cf2023-04-20 10:30:44 -07003793// Must be last.
3794
3795#ifdef __cplusplus
3796extern "C" {
3797#endif
Eric Salo10505992022-12-12 12:16:36 -08003798
Protobuf Team Bot4e90ead2024-01-08 15:46:34 +00003799// Functions ending in BaseField() take a (upb_MiniTableField*) argument
3800// and work only on non-extension fields.
3801//
3802// Functions ending in Extension() take a (upb_MiniTableExtension*) argument
3803// and work only on extensions.
Mike Kruskal3bc50492022-12-01 13:34:12 -08003804
Protobuf Team Botb3878b52024-02-08 21:50:53 +00003805UPB_API_INLINE void upb_Message_Clear(upb_Message* msg, const upb_MiniTable* m);
Protobuf Team Bot4e90ead2024-01-08 15:46:34 +00003806
3807UPB_API_INLINE void upb_Message_ClearBaseField(upb_Message* msg,
Protobuf Team Botb3878b52024-02-08 21:50:53 +00003808 const upb_MiniTableField* f);
Protobuf Team Bot4e90ead2024-01-08 15:46:34 +00003809
Protobuf Team Botb3878b52024-02-08 21:50:53 +00003810UPB_API_INLINE void upb_Message_ClearExtension(upb_Message* msg,
3811 const upb_MiniTableExtension* e);
Jie Luof36a5c62023-05-23 17:56:18 -07003812
Protobuf Team Botae17e812024-05-07 16:59:23 +00003813UPB_API_INLINE void upb_Message_ClearOneof(upb_Message* msg,
3814 const upb_MiniTable* m,
3815 const upb_MiniTableField* f);
3816
Protobuf Team Bot8c1f6352024-01-10 05:18:15 +00003817UPB_API_INLINE bool upb_Message_HasBaseField(const upb_Message* msg,
Protobuf Team Botb3878b52024-02-08 21:50:53 +00003818 const upb_MiniTableField* f);
Protobuf Team Bot8c1f6352024-01-10 05:18:15 +00003819
3820UPB_API_INLINE bool upb_Message_HasExtension(const upb_Message* msg,
Protobuf Team Botb3878b52024-02-08 21:50:53 +00003821 const upb_MiniTableExtension* e);
Eric Salo8809a112022-11-21 13:01:06 -08003822
Protobuf Team Bot7646fbf2024-05-03 19:47:53 +00003823UPB_API_INLINE upb_MessageValue
3824upb_Message_GetField(const upb_Message* msg, const upb_MiniTableField* f,
3825 upb_MessageValue default_val);
Eric Salob598b2d2022-12-22 23:14:27 -08003826
Protobuf Team Bot4d3a98c2024-05-08 01:37:14 +00003827UPB_API_INLINE upb_TaggedMessagePtr upb_Message_GetTaggedMessagePtr(
3828 const upb_Message* msg, const upb_MiniTableField* field,
3829 upb_Message* default_val);
3830
Protobuf Team Bot7646fbf2024-05-03 19:47:53 +00003831UPB_API_INLINE const upb_Array* upb_Message_GetArray(
3832 const upb_Message* msg, const upb_MiniTableField* f);
Protobuf Team Bot54573a42023-11-21 14:47:34 +00003833
Eric Salo10505992022-12-12 12:16:36 -08003834UPB_API_INLINE bool upb_Message_GetBool(const upb_Message* msg,
Protobuf Team Bot7646fbf2024-05-03 19:47:53 +00003835 const upb_MiniTableField* f,
3836 bool default_val);
Eric Salo8809a112022-11-21 13:01:06 -08003837
Eric Salo10505992022-12-12 12:16:36 -08003838UPB_API_INLINE double upb_Message_GetDouble(const upb_Message* msg,
3839 const upb_MiniTableField* field,
Protobuf Team Bot7646fbf2024-05-03 19:47:53 +00003840 double default_val);
Protobuf Team Bot54573a42023-11-21 14:47:34 +00003841
Protobuf Team Bot7646fbf2024-05-03 19:47:53 +00003842UPB_API_INLINE float upb_Message_GetFloat(const upb_Message* msg,
3843 const upb_MiniTableField* f,
3844 float default_val);
Eric Salo8809a112022-11-21 13:01:06 -08003845
Protobuf Team Bot7646fbf2024-05-03 19:47:53 +00003846UPB_API_INLINE int32_t upb_Message_GetInt32(const upb_Message* msg,
3847 const upb_MiniTableField* f,
3848 int32_t default_val);
3849
3850UPB_API_INLINE int64_t upb_Message_GetInt64(const upb_Message* msg,
3851 const upb_MiniTableField* f,
3852 int64_t default_val);
3853
3854UPB_API_INLINE const upb_Map* upb_Message_GetMap(const upb_Message* msg,
3855 const upb_MiniTableField* f);
3856
Protobuf Team Bot4d3a98c2024-05-08 01:37:14 +00003857UPB_API_INLINE const upb_Message* upb_Message_GetMessage(
3858 const upb_Message* msg, const upb_MiniTableField* f);
3859
Protobuf Team Bot7646fbf2024-05-03 19:47:53 +00003860UPB_API_INLINE upb_Array* upb_Message_GetMutableArray(
3861 upb_Message* msg, const upb_MiniTableField* f);
3862
3863UPB_API_INLINE upb_Map* upb_Message_GetMutableMap(upb_Message* msg,
3864 const upb_MiniTableField* f);
3865
Protobuf Team Bot4d3a98c2024-05-08 01:37:14 +00003866UPB_API_INLINE upb_Message* upb_Message_GetMutableMessage(
3867 upb_Message* msg, const upb_MiniTableField* f);
3868
Protobuf Team Bot7646fbf2024-05-03 19:47:53 +00003869UPB_API_INLINE upb_Array* upb_Message_GetOrCreateMutableArray(
3870 upb_Message* msg, const upb_MiniTableField* f, upb_Arena* arena);
3871
3872UPB_API_INLINE upb_Map* upb_Message_GetOrCreateMutableMap(
3873 upb_Message* msg, const upb_MiniTable* map_entry_mini_table,
3874 const upb_MiniTableField* f, upb_Arena* arena);
3875
3876UPB_API_INLINE upb_Message* upb_Message_GetOrCreateMutableMessage(
3877 upb_Message* msg, const upb_MiniTable* mini_table,
3878 const upb_MiniTableField* f, upb_Arena* arena);
Eric Salo8809a112022-11-21 13:01:06 -08003879
Eric Salo3f36a912022-12-05 14:12:25 -08003880UPB_API_INLINE upb_StringView
Eric Salo10505992022-12-12 12:16:36 -08003881upb_Message_GetString(const upb_Message* msg, const upb_MiniTableField* field,
Protobuf Team Bot7646fbf2024-05-03 19:47:53 +00003882 upb_StringView default_val);
Protobuf Team Bot54573a42023-11-21 14:47:34 +00003883
Protobuf Team Bot7646fbf2024-05-03 19:47:53 +00003884UPB_API_INLINE uint32_t upb_Message_GetUInt32(const upb_Message* msg,
3885 const upb_MiniTableField* f,
3886 uint32_t default_val);
Eric Salo8809a112022-11-21 13:01:06 -08003887
Protobuf Team Bot7646fbf2024-05-03 19:47:53 +00003888UPB_API_INLINE uint64_t upb_Message_GetUInt64(const upb_Message* msg,
3889 const upb_MiniTableField* f,
3890 uint64_t default_val);
3891
Protobuf Team Bot7646fbf2024-05-03 19:47:53 +00003892UPB_API_INLINE void upb_Message_SetClosedEnum(
3893 upb_Message* msg, const upb_MiniTable* msg_mini_table,
3894 const upb_MiniTableField* f, int32_t value);
3895
Protobuf Team Botddc70b02024-05-11 02:21:06 +00003896// BaseField Setters ///////////////////////////////////////////////////////////
3897
3898UPB_API_INLINE void upb_Message_SetBaseField(upb_Message* msg,
3899 const upb_MiniTableField* f,
3900 const void* val);
3901
3902UPB_API_INLINE void upb_Message_SetBaseFieldBool(struct upb_Message* msg,
3903 const upb_MiniTableField* f,
3904 bool value);
3905
3906UPB_API_INLINE void upb_Message_SetBaseFieldDouble(struct upb_Message* msg,
3907 const upb_MiniTableField* f,
3908 double value);
3909
3910UPB_API_INLINE void upb_Message_SetBaseFieldFloat(struct upb_Message* msg,
3911 const upb_MiniTableField* f,
3912 float value);
3913
3914UPB_API_INLINE void upb_Message_SetBaseFieldInt32(struct upb_Message* msg,
3915 const upb_MiniTableField* f,
3916 int32_t value);
3917
3918UPB_API_INLINE void upb_Message_SetBaseFieldInt64(struct upb_Message* msg,
3919 const upb_MiniTableField* f,
3920 int64_t value);
3921
3922UPB_API_INLINE void upb_Message_SetBaseFieldString(struct upb_Message* msg,
3923 const upb_MiniTableField* f,
3924 upb_StringView value);
3925
3926UPB_API_INLINE void upb_Message_SetBaseFieldUInt32(struct upb_Message* msg,
3927 const upb_MiniTableField* f,
3928 uint32_t value);
3929
3930UPB_API_INLINE void upb_Message_SetBaseFieldUInt64(struct upb_Message* msg,
3931 const upb_MiniTableField* f,
3932 uint64_t value);
3933
3934// Extension Setters ///////////////////////////////////////////////////////////
3935
3936UPB_API_INLINE bool upb_Message_SetExtension(upb_Message* msg,
3937 const upb_MiniTableExtension* e,
3938 const void* value, upb_Arena* a);
3939
3940UPB_API_INLINE bool upb_Message_SetExtensionBool(
3941 struct upb_Message* msg, const upb_MiniTableExtension* e, bool value,
3942 upb_Arena* a);
3943
3944UPB_API_INLINE bool upb_Message_SetExtensionDouble(
3945 struct upb_Message* msg, const upb_MiniTableExtension* e, double value,
3946 upb_Arena* a);
3947
3948UPB_API_INLINE bool upb_Message_SetExtensionFloat(
3949 struct upb_Message* msg, const upb_MiniTableExtension* e, float value,
3950 upb_Arena* a);
3951
3952UPB_API_INLINE bool upb_Message_SetExtensionInt32(
3953 struct upb_Message* msg, const upb_MiniTableExtension* e, int32_t value,
3954 upb_Arena* a);
3955
3956UPB_API_INLINE bool upb_Message_SetExtensionInt64(
3957 struct upb_Message* msg, const upb_MiniTableExtension* e, int64_t value,
3958 upb_Arena* a);
3959
3960UPB_API_INLINE bool upb_Message_SetExtensionString(
3961 struct upb_Message* msg, const upb_MiniTableExtension* e,
3962 upb_StringView value, upb_Arena* a);
3963
3964UPB_API_INLINE bool upb_Message_SetExtensionUInt32(
3965 struct upb_Message* msg, const upb_MiniTableExtension* e, uint32_t value,
3966 upb_Arena* a);
3967
3968UPB_API_INLINE bool upb_Message_SetExtensionUInt64(
3969 struct upb_Message* msg, const upb_MiniTableExtension* e, uint64_t value,
3970 upb_Arena* a);
3971
3972// Universal Setters ///////////////////////////////////////////////////////////
3973
3974UPB_API_INLINE bool upb_Message_SetBool(upb_Message* msg,
3975 const upb_MiniTableField* f, bool value,
3976 upb_Arena* a);
3977
Protobuf Team Bot7646fbf2024-05-03 19:47:53 +00003978UPB_API_INLINE bool upb_Message_SetDouble(upb_Message* msg,
3979 const upb_MiniTableField* f,
3980 double value, upb_Arena* a);
3981
3982UPB_API_INLINE bool upb_Message_SetFloat(upb_Message* msg,
3983 const upb_MiniTableField* f,
3984 float value, upb_Arena* a);
3985
3986UPB_API_INLINE bool upb_Message_SetInt32(upb_Message* msg,
3987 const upb_MiniTableField* f,
3988 int32_t value, upb_Arena* a);
3989
3990UPB_API_INLINE bool upb_Message_SetInt64(upb_Message* msg,
3991 const upb_MiniTableField* f,
3992 int64_t value, upb_Arena* a);
3993
Protobuf Team Bot4d3a98c2024-05-08 01:37:14 +00003994UPB_API_INLINE void upb_Message_SetMessage(upb_Message* msg,
Protobuf Team Bot4d3a98c2024-05-08 01:37:14 +00003995 const upb_MiniTableField* f,
Protobuf Team Botb51dc1b2024-05-09 21:34:06 +00003996 upb_Message* value);
Protobuf Team Bot4d3a98c2024-05-08 01:37:14 +00003997
Eric Salo10505992022-12-12 12:16:36 -08003998UPB_API_INLINE bool upb_Message_SetString(upb_Message* msg,
Protobuf Team Bot7646fbf2024-05-03 19:47:53 +00003999 const upb_MiniTableField* f,
4000 upb_StringView value, upb_Arena* a);
4001
4002UPB_API_INLINE bool upb_Message_SetUInt32(upb_Message* msg,
4003 const upb_MiniTableField* f,
4004 uint32_t value, upb_Arena* a);
4005
4006UPB_API_INLINE bool upb_Message_SetUInt64(upb_Message* msg,
4007 const upb_MiniTableField* f,
4008 uint64_t value, upb_Arena* a);
Eric Salo8809a112022-11-21 13:01:06 -08004009
Protobuf Team Botddc70b02024-05-11 02:21:06 +00004010////////////////////////////////////////////////////////////////////////////////
4011
Jie Luof36a5c62023-05-23 17:56:18 -07004012UPB_API_INLINE void* upb_Message_ResizeArrayUninitialized(
Protobuf Team Bot7646fbf2024-05-03 19:47:53 +00004013 upb_Message* msg, const upb_MiniTableField* f, size_t size,
4014 upb_Arena* arena);
Eric Salo10505992022-12-12 12:16:36 -08004015
Protobuf Team Bot7646fbf2024-05-03 19:47:53 +00004016UPB_API_INLINE uint32_t upb_Message_WhichOneofFieldNumber(
4017 const upb_Message* message, const upb_MiniTableField* oneof_field);
Eric Salob598b2d2022-12-22 23:14:27 -08004018
Protobuf Team Bot6cce6222024-05-28 17:15:46 +00004019// For a field `f` which is in a oneof, return the field of that
4020// oneof that is actually set (or NULL if none).
4021UPB_API_INLINE const upb_MiniTableField* upb_Message_WhichOneof(
4022 const upb_Message* msg, const upb_MiniTable* m,
4023 const upb_MiniTableField* f);
4024
Eric Salob598b2d2022-12-22 23:14:27 -08004025// Updates a map entry given an entry message.
Protobuf Team Bot5b343372023-12-19 06:18:53 +00004026bool upb_Message_SetMapEntry(upb_Map* map, const upb_MiniTable* mini_table,
4027 const upb_MiniTableField* field,
4028 upb_Message* map_entry_message, upb_Arena* arena);
Eric Salob598b2d2022-12-22 23:14:27 -08004029
Eric Salo8809a112022-11-21 13:01:06 -08004030#ifdef __cplusplus
4031} /* extern "C" */
4032#endif
4033
4034
4035#endif // UPB_MESSAGE_ACCESSORS_H_
4036
Protobuf Team Bot376ba2f2023-09-29 22:17:43 +00004037// These functions are only used by generated code.
4038
4039#ifndef UPB_MESSAGE_MAP_GENCODE_UTIL_H_
4040#define UPB_MESSAGE_MAP_GENCODE_UTIL_H_
4041
4042
4043// Must be last.
4044
4045#ifdef __cplusplus
4046extern "C" {
4047#endif
4048
4049// Message map operations, these get the map from the message first.
4050
4051UPB_INLINE void _upb_msg_map_key(const void* msg, void* key, size_t size) {
4052 const upb_tabent* ent = (const upb_tabent*)msg;
4053 uint32_t u32len;
4054 upb_StringView k;
4055 k.data = upb_tabstr(ent->key, &u32len);
4056 k.size = u32len;
4057 _upb_map_fromkey(k, key, size);
4058}
4059
4060UPB_INLINE void _upb_msg_map_value(const void* msg, void* val, size_t size) {
4061 const upb_tabent* ent = (const upb_tabent*)msg;
4062 upb_value v = {ent->val.val};
4063 _upb_map_fromvalue(v, val, size);
4064}
4065
4066UPB_INLINE void _upb_msg_map_set_value(void* msg, const void* val,
4067 size_t size) {
4068 upb_tabent* ent = (upb_tabent*)msg;
4069 // This is like _upb_map_tovalue() except the entry already exists
4070 // so we can reuse the allocated upb_StringView for string fields.
4071 if (size == UPB_MAPTYPE_STRING) {
4072 upb_StringView* strp = (upb_StringView*)(uintptr_t)ent->val.val;
4073 memcpy(strp, val, sizeof(*strp));
4074 } else {
4075 memcpy(&ent->val.val, val, size);
4076 }
4077}
4078
4079#ifdef __cplusplus
4080} /* extern "C" */
4081#endif
4082
4083
4084#endif /* UPB_MESSAGE_MAP_GENCODE_UTIL_H_ */
4085
Mike Kruskal9d435022023-07-11 12:45:07 -07004086#ifndef UPB_MINI_TABLE_DECODE_H_
4087#define UPB_MINI_TABLE_DECODE_H_
4088
4089
Protobuf Team Bot4d3a98c2024-05-08 01:37:14 +00004090#ifndef UPB_MINI_TABLE_SUB_H_
4091#define UPB_MINI_TABLE_SUB_H_
4092
4093
4094// Must be last.
4095
4096typedef union upb_MiniTableSub upb_MiniTableSub;
4097
4098#ifdef __cplusplus
4099extern "C" {
4100#endif
4101
4102// Constructors
4103
4104UPB_API_INLINE upb_MiniTableSub
4105upb_MiniTableSub_FromEnum(const upb_MiniTableEnum* subenum);
4106
4107UPB_API_INLINE upb_MiniTableSub
4108upb_MiniTableSub_FromMessage(const upb_MiniTable* submsg);
4109
4110// Getters
4111
4112UPB_API_INLINE const upb_MiniTableEnum* upb_MiniTableSub_Enum(
4113 upb_MiniTableSub sub);
4114
4115UPB_API_INLINE const upb_MiniTable* upb_MiniTableSub_Message(
4116 upb_MiniTableSub sub);
4117
4118#ifdef __cplusplus
4119} /* extern "C" */
4120#endif
4121
4122
4123#endif /* UPB_MINI_TABLE_SUB_H_ */
4124
Mike Kruskal9d435022023-07-11 12:45:07 -07004125// Export the newer headers, for legacy users. New users should include the
4126// more specific headers directly.
4127// IWYU pragma: begin_exports
Protobuf Team Bot59b938b2024-04-08 17:18:48 +00004128
Mike Kruskal9d435022023-07-11 12:45:07 -07004129#ifndef UPB_MINI_DESCRIPTOR_BUILD_ENUM_H_
4130#define UPB_MINI_DESCRIPTOR_BUILD_ENUM_H_
4131
4132
4133// Must be last.
4134
4135#ifdef __cplusplus
4136extern "C" {
4137#endif
4138
Protobuf Team Bot59b938b2024-04-08 17:18:48 +00004139// Builds a upb_MiniTableEnum from an enum mini descriptor.
4140// The mini descriptor must be for an enum, not a message.
4141UPB_API upb_MiniTableEnum* upb_MiniTableEnum_Build(const char* data, size_t len,
4142 upb_Arena* arena,
4143 upb_Status* status);
Mike Kruskal9d435022023-07-11 12:45:07 -07004144
4145#ifdef __cplusplus
4146} /* extern "C" */
4147#endif
4148
4149
4150#endif // UPB_MINI_DESCRIPTOR_BUILD_ENUM_H_
4151
4152// Functions for linking MiniTables together once they are built from a
4153// MiniDescriptor.
4154//
4155// These functions have names like upb_MiniTable_Link() because they operate on
4156// MiniTables. We put them here, rather than in the mini_table/ directory,
4157// because they are only needed when building MiniTables from MiniDescriptors.
4158// The interfaces in mini_table/ assume that MiniTables are immutable.
4159
4160#ifndef UPB_MINI_DESCRIPTOR_LINK_H_
4161#define UPB_MINI_DESCRIPTOR_LINK_H_
4162
4163
4164// Must be last.
4165
4166#ifdef __cplusplus
4167extern "C" {
4168#endif
4169
4170// Links a sub-message field to a MiniTable for that sub-message. If a
4171// sub-message field is not linked, it will be treated as an unknown field
4172// during parsing, and setting the field will not be allowed. It is possible
4173// to link the message field later, at which point it will no longer be treated
4174// as unknown. However there is no synchronization for this operation, which
4175// means parallel mutation requires external synchronization.
4176// Returns success/failure.
4177UPB_API bool upb_MiniTable_SetSubMessage(upb_MiniTable* table,
4178 upb_MiniTableField* field,
4179 const upb_MiniTable* sub);
4180
4181// Links an enum field to a MiniTable for that enum.
4182// All enum fields must be linked prior to parsing.
4183// Returns success/failure.
4184UPB_API bool upb_MiniTable_SetSubEnum(upb_MiniTable* table,
4185 upb_MiniTableField* field,
4186 const upb_MiniTableEnum* sub);
4187
4188// Returns a list of fields that require linking at runtime, to connect the
4189// MiniTable to its sub-messages and sub-enums. The list of fields will be
4190// written to the `subs` array, which must have been allocated by the caller
4191// and must be large enough to hold a list of all fields in the message.
4192//
4193// The order of the fields returned by this function is significant: it matches
4194// the order expected by upb_MiniTable_Link() below.
4195//
4196// The return value packs the sub-message count and sub-enum count into a single
4197// integer like so:
4198// return (msg_count << 16) | enum_count;
4199UPB_API uint32_t upb_MiniTable_GetSubList(const upb_MiniTable* mt,
4200 const upb_MiniTableField** subs);
4201
4202// Links a message to its sub-messages and sub-enums. The caller must pass
4203// arrays of sub-tables and sub-enums, in the same length and order as is
4204// returned by upb_MiniTable_GetSubList() above. However, individual elements
4205// of the sub_tables may be NULL if those sub-messages were tree shaken.
4206//
4207// Returns false if either array is too short, or if any of the tables fails
4208// to link.
4209UPB_API bool upb_MiniTable_Link(upb_MiniTable* mt,
4210 const upb_MiniTable** sub_tables,
4211 size_t sub_table_count,
4212 const upb_MiniTableEnum** sub_enums,
4213 size_t sub_enum_count);
4214
4215#ifdef __cplusplus
4216} /* extern "C" */
4217#endif
4218
4219
4220#endif // UPB_MINI_DESCRIPTOR_LINK_H_
4221// IWYU pragma: end_exports
4222
4223// Must be last.
4224
4225typedef enum {
4226 kUpb_MiniTablePlatform_32Bit,
4227 kUpb_MiniTablePlatform_64Bit,
4228 kUpb_MiniTablePlatform_Native =
4229 UPB_SIZE(kUpb_MiniTablePlatform_32Bit, kUpb_MiniTablePlatform_64Bit),
4230} upb_MiniTablePlatform;
4231
4232#ifdef __cplusplus
4233extern "C" {
4234#endif
4235
4236// Builds a mini table from the data encoded in the buffer [data, len]. If any
4237// errors occur, returns NULL and sets a status message. In the success case,
4238// the caller must call upb_MiniTable_SetSub*() for all message or proto2 enum
4239// fields to link the table to the appropriate sub-tables.
4240upb_MiniTable* _upb_MiniTable_Build(const char* data, size_t len,
4241 upb_MiniTablePlatform platform,
4242 upb_Arena* arena, upb_Status* status);
4243
4244UPB_API_INLINE upb_MiniTable* upb_MiniTable_Build(const char* data, size_t len,
4245 upb_Arena* arena,
4246 upb_Status* status) {
4247 return _upb_MiniTable_Build(data, len, kUpb_MiniTablePlatform_Native, arena,
4248 status);
4249}
4250
4251// Initializes a MiniTableExtension buffer that has already been allocated.
4252// This is needed by upb_FileDef and upb_MessageDef, which allocate all of the
4253// extensions together in a single contiguous array.
4254const char* _upb_MiniTableExtension_Init(const char* data, size_t len,
4255 upb_MiniTableExtension* ext,
4256 const upb_MiniTable* extendee,
4257 upb_MiniTableSub sub,
4258 upb_MiniTablePlatform platform,
4259 upb_Status* status);
4260
4261UPB_API_INLINE const char* upb_MiniTableExtension_Init(
4262 const char* data, size_t len, upb_MiniTableExtension* ext,
4263 const upb_MiniTable* extendee, upb_MiniTableSub sub, upb_Status* status) {
4264 return _upb_MiniTableExtension_Init(data, len, ext, extendee, sub,
4265 kUpb_MiniTablePlatform_Native, status);
4266}
4267
4268UPB_API upb_MiniTableExtension* _upb_MiniTableExtension_Build(
4269 const char* data, size_t len, const upb_MiniTable* extendee,
4270 upb_MiniTableSub sub, upb_MiniTablePlatform platform, upb_Arena* arena,
4271 upb_Status* status);
4272
4273UPB_API_INLINE upb_MiniTableExtension* upb_MiniTableExtension_Build(
4274 const char* data, size_t len, const upb_MiniTable* extendee,
4275 upb_Arena* arena, upb_Status* status) {
Protobuf Team Bot842f56b2023-11-29 05:02:57 +00004276 upb_MiniTableSub sub = upb_MiniTableSub_FromMessage(NULL);
Mike Kruskal9d435022023-07-11 12:45:07 -07004277 return _upb_MiniTableExtension_Build(
4278 data, len, extendee, sub, kUpb_MiniTablePlatform_Native, arena, status);
4279}
4280
4281UPB_API_INLINE upb_MiniTableExtension* upb_MiniTableExtension_BuildMessage(
4282 const char* data, size_t len, const upb_MiniTable* extendee,
4283 upb_MiniTable* submsg, upb_Arena* arena, upb_Status* status) {
Protobuf Team Bot842f56b2023-11-29 05:02:57 +00004284 upb_MiniTableSub sub = upb_MiniTableSub_FromMessage(submsg);
Mike Kruskal9d435022023-07-11 12:45:07 -07004285 return _upb_MiniTableExtension_Build(
4286 data, len, extendee, sub, kUpb_MiniTablePlatform_Native, arena, status);
4287}
4288
4289UPB_API_INLINE upb_MiniTableExtension* upb_MiniTableExtension_BuildEnum(
4290 const char* data, size_t len, const upb_MiniTable* extendee,
4291 upb_MiniTableEnum* subenum, upb_Arena* arena, upb_Status* status) {
Protobuf Team Bot842f56b2023-11-29 05:02:57 +00004292 upb_MiniTableSub sub = upb_MiniTableSub_FromEnum(subenum);
Mike Kruskal9d435022023-07-11 12:45:07 -07004293 return _upb_MiniTableExtension_Build(
4294 data, len, extendee, sub, kUpb_MiniTablePlatform_Native, arena, status);
4295}
4296
4297// Like upb_MiniTable_Build(), but the user provides a buffer of layout data so
4298// it can be reused from call to call, avoiding repeated realloc()/free().
4299//
4300// The caller owns `*buf` both before and after the call, and must free() it
4301// when it is no longer in use. The function will realloc() `*buf` as
4302// necessary, updating `*size` accordingly.
4303upb_MiniTable* upb_MiniTable_BuildWithBuf(const char* data, size_t len,
4304 upb_MiniTablePlatform platform,
4305 upb_Arena* arena, void** buf,
4306 size_t* buf_size, upb_Status* status);
4307
4308#ifdef __cplusplus
4309} /* extern "C" */
4310#endif
4311
4312
4313#endif /* UPB_MINI_TABLE_DECODE_H_ */
4314
Protobuf Team Bot4eeaa222023-12-04 05:00:05 +00004315#ifndef UPB_MINI_TABLE_EXTENSION_REGISTRY_H_
4316#define UPB_MINI_TABLE_EXTENSION_REGISTRY_H_
4317
4318
4319// Must be last.
4320
4321#ifdef __cplusplus
4322extern "C" {
4323#endif
4324
4325/* Extension registry: a dynamic data structure that stores a map of:
4326 * (upb_MiniTable, number) -> extension info
4327 *
4328 * upb_decode() uses upb_ExtensionRegistry to look up extensions while parsing
4329 * binary format.
4330 *
4331 * upb_ExtensionRegistry is part of the mini-table (msglayout) family of
4332 * objects. Like all mini-table objects, it is suitable for reflection-less
4333 * builds that do not want to expose names into the binary.
4334 *
4335 * Unlike most mini-table types, upb_ExtensionRegistry requires dynamic memory
4336 * allocation and dynamic initialization:
4337 * * If reflection is being used, then upb_DefPool will construct an appropriate
4338 * upb_ExtensionRegistry automatically.
4339 * * For a mini-table only build, the user must manually construct the
4340 * upb_ExtensionRegistry and populate it with all of the extensions the user
4341 * cares about.
4342 * * A third alternative is to manually unpack relevant extensions after the
4343 * main parse is complete, similar to how Any works. This is perhaps the
4344 * nicest solution from the perspective of reducing dependencies, avoiding
4345 * dynamic memory allocation, and avoiding the need to parse uninteresting
4346 * extensions. The downsides are:
4347 * (1) parse errors are not caught during the main parse
4348 * (2) the CPU hit of parsing comes during access, which could cause an
4349 * undesirable stutter in application performance.
4350 *
4351 * Users cannot directly get or put into this map. Users can only add the
4352 * extensions from a generated module and pass the extension registry to the
4353 * binary decoder.
4354 *
4355 * A upb_DefPool provides a upb_ExtensionRegistry, so any users who use
4356 * reflection do not need to populate a upb_ExtensionRegistry directly.
4357 */
4358
4359typedef struct upb_ExtensionRegistry upb_ExtensionRegistry;
4360
4361// Creates a upb_ExtensionRegistry in the given arena.
4362// The arena must outlive any use of the extreg.
4363UPB_API upb_ExtensionRegistry* upb_ExtensionRegistry_New(upb_Arena* arena);
4364
4365UPB_API bool upb_ExtensionRegistry_Add(upb_ExtensionRegistry* r,
4366 const upb_MiniTableExtension* e);
4367
4368// Adds the given extension info for the array |e| of size |count| into the
4369// registry. If there are any errors, the entire array is backed out.
4370// The extensions must outlive the registry.
4371// Possible errors include OOM or an extension number that already exists.
4372// TODO: There is currently no way to know the exact reason for failure.
4373bool upb_ExtensionRegistry_AddArray(upb_ExtensionRegistry* r,
4374 const upb_MiniTableExtension** e,
4375 size_t count);
4376
Protobuf Team Botbf7ac9f2024-06-04 17:32:11 +00004377#ifdef UPB_LINKARR_DECLARE
4378
4379// Adds all extensions linked into the binary into the registry. The set of
4380// linked extensions is assembled by the linker using linker arrays. This
4381// will likely not work properly if the extensions are split across multiple
4382// shared libraries.
4383//
4384// Returns true if all extensions were added successfully, false on out of
4385// memory or if any extensions were already present.
4386//
4387// This API is currently not available on MSVC (though it *is* available on
4388// Windows using clang-cl).
4389UPB_API bool upb_ExtensionRegistry_AddAllLinkedExtensions(
4390 upb_ExtensionRegistry* r);
4391
4392#endif // UPB_LINKARR_DECLARE
4393
Protobuf Team Bot4eeaa222023-12-04 05:00:05 +00004394// Looks up the extension (if any) defined for message type |t| and field
4395// number |num|. Returns the extension if found, otherwise NULL.
4396UPB_API const upb_MiniTableExtension* upb_ExtensionRegistry_Lookup(
4397 const upb_ExtensionRegistry* r, const upb_MiniTable* t, uint32_t num);
4398
4399#ifdef __cplusplus
4400} /* extern "C" */
4401#endif
4402
4403
4404#endif /* UPB_MINI_TABLE_EXTENSION_REGISTRY_H_ */
4405
Mike Kruskal9d435022023-07-11 12:45:07 -07004406#ifndef UPB_MINI_TABLE_FILE_H_
4407#define UPB_MINI_TABLE_FILE_H_
4408
4409
4410#ifndef UPB_MINI_TABLE_INTERNAL_FILE_H_
4411#define UPB_MINI_TABLE_INTERNAL_FILE_H_
4412
Mike Kruskal9d435022023-07-11 12:45:07 -07004413// Must be last.
4414
4415struct upb_MiniTableFile {
Protobuf Team Bot4c743452023-12-26 22:55:49 +00004416 const struct upb_MiniTable** UPB_PRIVATE(msgs);
4417 const struct upb_MiniTableEnum** UPB_PRIVATE(enums);
4418 const struct upb_MiniTableExtension** UPB_PRIVATE(exts);
Protobuf Team Botff422002023-11-28 17:31:45 +00004419 int UPB_PRIVATE(msg_count);
4420 int UPB_PRIVATE(enum_count);
4421 int UPB_PRIVATE(ext_count);
Mike Kruskal9d435022023-07-11 12:45:07 -07004422};
4423
Protobuf Team Botff422002023-11-28 17:31:45 +00004424#ifdef __cplusplus
4425extern "C" {
4426#endif
4427
Protobuf Team Botb3878b52024-02-08 21:50:53 +00004428UPB_API_INLINE int upb_MiniTableFile_EnumCount(
Protobuf Team Bot4c743452023-12-26 22:55:49 +00004429 const struct upb_MiniTableFile* f) {
Protobuf Team Botff422002023-11-28 17:31:45 +00004430 return f->UPB_PRIVATE(enum_count);
4431}
4432
Protobuf Team Botb3878b52024-02-08 21:50:53 +00004433UPB_API_INLINE int upb_MiniTableFile_ExtensionCount(
Protobuf Team Bot4c743452023-12-26 22:55:49 +00004434 const struct upb_MiniTableFile* f) {
Protobuf Team Botff422002023-11-28 17:31:45 +00004435 return f->UPB_PRIVATE(ext_count);
4436}
4437
Protobuf Team Botb3878b52024-02-08 21:50:53 +00004438UPB_API_INLINE int upb_MiniTableFile_MessageCount(
Protobuf Team Bot4c743452023-12-26 22:55:49 +00004439 const struct upb_MiniTableFile* f) {
Protobuf Team Botff422002023-11-28 17:31:45 +00004440 return f->UPB_PRIVATE(msg_count);
4441}
4442
Protobuf Team Botb3878b52024-02-08 21:50:53 +00004443UPB_API_INLINE const struct upb_MiniTableEnum* upb_MiniTableFile_Enum(
Protobuf Team Bot4c743452023-12-26 22:55:49 +00004444 const struct upb_MiniTableFile* f, int i) {
Protobuf Team Botff422002023-11-28 17:31:45 +00004445 UPB_ASSERT(i < f->UPB_PRIVATE(enum_count));
4446 return f->UPB_PRIVATE(enums)[i];
4447}
4448
Protobuf Team Botb3878b52024-02-08 21:50:53 +00004449UPB_API_INLINE const struct upb_MiniTableExtension* upb_MiniTableFile_Extension(
4450 const struct upb_MiniTableFile* f, int i) {
Protobuf Team Botff422002023-11-28 17:31:45 +00004451 UPB_ASSERT(i < f->UPB_PRIVATE(ext_count));
4452 return f->UPB_PRIVATE(exts)[i];
4453}
4454
Protobuf Team Botb3878b52024-02-08 21:50:53 +00004455UPB_API_INLINE const struct upb_MiniTable* upb_MiniTableFile_Message(
Protobuf Team Bot4c743452023-12-26 22:55:49 +00004456 const struct upb_MiniTableFile* f, int i) {
Protobuf Team Botff422002023-11-28 17:31:45 +00004457 UPB_ASSERT(i < f->UPB_PRIVATE(msg_count));
4458 return f->UPB_PRIVATE(msgs)[i];
4459}
4460
4461#ifdef __cplusplus
4462} /* extern "C" */
4463#endif
4464
Mike Kruskal9d435022023-07-11 12:45:07 -07004465
4466#endif /* UPB_MINI_TABLE_INTERNAL_FILE_H_ */
4467
Protobuf Team Botff422002023-11-28 17:31:45 +00004468// Must be last.
4469
Protobuf Team Bot9b4aff22023-12-27 21:35:01 +00004470typedef struct upb_MiniTableFile upb_MiniTableFile;
4471
Protobuf Team Botff422002023-11-28 17:31:45 +00004472#ifdef __cplusplus
4473extern "C" {
4474#endif
4475
Protobuf Team Bot1db94652023-12-20 02:08:18 +00004476UPB_API_INLINE const upb_MiniTableEnum* upb_MiniTableFile_Enum(
Protobuf Team Botb3878b52024-02-08 21:50:53 +00004477 const upb_MiniTableFile* f, int i);
Protobuf Team Botff422002023-11-28 17:31:45 +00004478
Protobuf Team Botb3878b52024-02-08 21:50:53 +00004479UPB_API_INLINE int upb_MiniTableFile_EnumCount(const upb_MiniTableFile* f);
Protobuf Team Botff422002023-11-28 17:31:45 +00004480
Protobuf Team Bot1db94652023-12-20 02:08:18 +00004481UPB_API_INLINE const upb_MiniTableExtension* upb_MiniTableFile_Extension(
Protobuf Team Botb3878b52024-02-08 21:50:53 +00004482 const upb_MiniTableFile* f, int i);
Protobuf Team Botff422002023-11-28 17:31:45 +00004483
Protobuf Team Botb3878b52024-02-08 21:50:53 +00004484UPB_API_INLINE int upb_MiniTableFile_ExtensionCount(const upb_MiniTableFile* f);
Protobuf Team Botff422002023-11-28 17:31:45 +00004485
Protobuf Team Bot1db94652023-12-20 02:08:18 +00004486UPB_API_INLINE const upb_MiniTable* upb_MiniTableFile_Message(
Protobuf Team Botb3878b52024-02-08 21:50:53 +00004487 const upb_MiniTableFile* f, int i);
Protobuf Team Botff422002023-11-28 17:31:45 +00004488
Protobuf Team Botb3878b52024-02-08 21:50:53 +00004489UPB_API_INLINE int upb_MiniTableFile_MessageCount(const upb_MiniTableFile* f);
Protobuf Team Botff422002023-11-28 17:31:45 +00004490
4491#ifdef __cplusplus
4492} /* extern "C" */
4493#endif
4494
4495
Mike Kruskal9d435022023-07-11 12:45:07 -07004496#endif /* UPB_MINI_TABLE_FILE_H_ */
4497
Mike Kruskal9cf9db82022-11-04 21:22:31 -07004498// upb_decode: parsing into a upb_Message using a upb_MiniTable.
Joshua Haberman9abf6e22021-01-13 12:16:25 -08004499
Mike Kruskal9cf9db82022-11-04 21:22:31 -07004500#ifndef UPB_WIRE_DECODE_H_
4501#define UPB_WIRE_DECODE_H_
Joshua Haberman9abf6e22021-01-13 12:16:25 -08004502
Protobuf Team Bot743bf922023-09-14 01:12:11 +00004503#include <stddef.h>
4504#include <stdint.h>
Joshua Haberman9abf6e22021-01-13 12:16:25 -08004505
Adam Cozzette7d5592e2023-08-23 12:15:26 -07004506
Joshua Habermand3995ec2022-09-30 16:54:39 -07004507// Must be last.
Joshua Haberman9abf6e22021-01-13 12:16:25 -08004508
4509#ifdef __cplusplus
4510extern "C" {
4511#endif
4512
4513enum {
Joshua Habermand3995ec2022-09-30 16:54:39 -07004514 /* If set, strings will alias the input buffer instead of copying into the
4515 * arena. */
4516 kUpb_DecodeOption_AliasString = 1,
4517
4518 /* If set, the parse will return failure if any message is missing any
4519 * required fields when the message data ends. The parse will still continue,
4520 * and the failure will only be reported at the end.
Joshua Haberman9abf6e22021-01-13 12:16:25 -08004521 *
Joshua Habermand3995ec2022-09-30 16:54:39 -07004522 * IMPORTANT CAVEATS:
4523 *
4524 * 1. This can throw a false positive failure if an incomplete message is seen
4525 * on the wire but is later completed when the sub-message occurs again.
4526 * For this reason, a second pass is required to verify a failure, to be
4527 * truly robust.
4528 *
4529 * 2. This can return a false success if you are decoding into a message that
4530 * already has some sub-message fields present. If the sub-message does
4531 * not occur in the binary payload, we will never visit it and discover the
4532 * incomplete sub-message. For this reason, this check is only useful for
4533 * implemting ParseFromString() semantics. For MergeFromString(), a
4534 * post-parse validation step will always be necessary. */
4535 kUpb_DecodeOption_CheckRequired = 2,
Jie Luo3560e232023-06-12 00:33:50 -07004536
4537 /* EXPERIMENTAL:
4538 *
4539 * If set, the parser will allow parsing of sub-message fields that were not
4540 * previously linked using upb_MiniTable_SetSubMessage(). The data will be
4541 * parsed into an internal "empty" message type that cannot be accessed
4542 * directly, but can be later promoted into the true message type if the
4543 * sub-message fields are linked at a later time.
4544 *
4545 * Users should set this option if they intend to perform dynamic tree shaking
4546 * and promoting using the interfaces in message/promote.h. If this option is
4547 * enabled, it is important that the resulting messages are only accessed by
4548 * code that is aware of promotion rules:
4549 *
4550 * 1. Message pointers in upb_Message, upb_Array, and upb_Map are represented
4551 * by a tagged pointer upb_TaggedMessagePointer. The tag indicates whether
4552 * the message uses the internal "empty" type.
4553 *
4554 * 2. Any code *reading* these message pointers must test whether the "empty"
4555 * tag bit is set, using the interfaces in mini_table/types.h. However
4556 * writing of message pointers should always use plain upb_Message*, since
4557 * users are not allowed to create "empty" messages.
4558 *
4559 * 3. It is always safe to test whether a field is present or test the array
4560 * length; these interfaces will reflect that empty messages are present,
4561 * even though their data cannot be accessed without promoting first.
4562 *
4563 * 4. If a message pointer is indeed tagged as empty, the message may not be
4564 * accessed directly, only promoted through the interfaces in
4565 * message/promote.h.
4566 *
4567 * 5. Tagged/empty messages may never be created by the user. They may only
4568 * be created by the parser or the message-copying logic in message/copy.h.
4569 */
4570 kUpb_DecodeOption_ExperimentalAllowUnlinked = 4,
Protobuf Team Bot1610bf12024-01-10 21:45:42 +00004571
4572 /* EXPERIMENTAL:
4573 *
4574 * If set, decoding will enforce UTF-8 validation for string fields, even for
4575 * proto2 or fields with `features.utf8_validation = NONE`. Normally, only
4576 * proto3 string fields will be validated for UTF-8. Decoding will return
4577 * kUpb_DecodeStatus_BadUtf8 for non-UTF-8 strings, which is the same behavior
4578 * as non-UTF-8 proto3 string fields.
4579 */
4580 kUpb_DecodeOption_AlwaysValidateUtf8 = 8,
Joshua Haberman9abf6e22021-01-13 12:16:25 -08004581};
4582
Deanna Garciac7d979d2023-04-14 17:22:13 -07004583UPB_INLINE uint32_t upb_DecodeOptions_MaxDepth(uint16_t depth) {
4584 return (uint32_t)depth << 16;
4585}
4586
4587UPB_INLINE uint16_t upb_DecodeOptions_GetMaxDepth(uint32_t options) {
4588 return options >> 16;
4589}
Joshua Haberman9abf6e22021-01-13 12:16:25 -08004590
Jakob Buchgraberc0c79b22023-03-20 08:13:52 -07004591// Enforce an upper bound on recursion depth.
4592UPB_INLINE int upb_Decode_LimitDepth(uint32_t decode_options, uint32_t limit) {
Deanna Garciac7d979d2023-04-14 17:22:13 -07004593 uint32_t max_depth = upb_DecodeOptions_GetMaxDepth(decode_options);
Jakob Buchgraberc0c79b22023-03-20 08:13:52 -07004594 if (max_depth > limit) max_depth = limit;
Deanna Garciac7d979d2023-04-14 17:22:13 -07004595 return upb_DecodeOptions_MaxDepth(max_depth) | (decode_options & 0xffff);
Jakob Buchgraberc0c79b22023-03-20 08:13:52 -07004596}
4597
Protobuf Team Bot762233d2024-04-10 13:38:37 +00004598// LINT.IfChange
Joshua Habermand3995ec2022-09-30 16:54:39 -07004599typedef enum {
4600 kUpb_DecodeStatus_Ok = 0,
Deanna Garciabd6a0cf2023-04-20 10:30:44 -07004601 kUpb_DecodeStatus_Malformed = 1, // Wire format was corrupt
4602 kUpb_DecodeStatus_OutOfMemory = 2, // Arena alloc failed
4603 kUpb_DecodeStatus_BadUtf8 = 3, // String field had bad UTF-8
4604 kUpb_DecodeStatus_MaxDepthExceeded =
4605 4, // Exceeded upb_DecodeOptions_MaxDepth
Joshua Haberman9abf6e22021-01-13 12:16:25 -08004606
Joshua Habermand3995ec2022-09-30 16:54:39 -07004607 // kUpb_DecodeOption_CheckRequired failed (see above), but the parse otherwise
4608 // succeeded.
4609 kUpb_DecodeStatus_MissingRequired = 5,
Jie Luo3560e232023-06-12 00:33:50 -07004610
4611 // Unlinked sub-message field was present, but
4612 // kUpb_DecodeOptions_ExperimentalAllowUnlinked was not specified in the list
4613 // of options.
4614 kUpb_DecodeStatus_UnlinkedSubMessage = 6,
Joshua Habermand3995ec2022-09-30 16:54:39 -07004615} upb_DecodeStatus;
Protobuf Team Bot762233d2024-04-10 13:38:37 +00004616// LINT.ThenChange(//depot/google3/third_party/protobuf/rust/upb.rs:decode_status)
Joshua Habermand3995ec2022-09-30 16:54:39 -07004617
Eric Salo10505992022-12-12 12:16:36 -08004618UPB_API upb_DecodeStatus upb_Decode(const char* buf, size_t size,
Protobuf Team Botd86fe392024-04-03 14:19:48 +00004619 upb_Message* msg, const upb_MiniTable* mt,
Eric Salo10505992022-12-12 12:16:36 -08004620 const upb_ExtensionRegistry* extreg,
4621 int options, upb_Arena* arena);
Joshua Haberman9abf6e22021-01-13 12:16:25 -08004622
Protobuf Team Botd86fe392024-04-03 14:19:48 +00004623// Same as upb_Decode but with a varint-encoded length prepended.
4624// On success 'num_bytes_read' will be set to the how many bytes were read,
4625// on failure the contents of num_bytes_read is undefined.
Protobuf Team Botb9bde6a2024-04-03 19:25:27 +00004626UPB_API upb_DecodeStatus upb_DecodeLengthPrefixed(
Protobuf Team Botd86fe392024-04-03 14:19:48 +00004627 const char* buf, size_t size, upb_Message* msg, size_t* num_bytes_read,
4628 const upb_MiniTable* mt, const upb_ExtensionRegistry* extreg, int options,
4629 upb_Arena* arena);
4630
Protobuf Team Bot5dfdd852024-05-17 15:56:35 +00004631// Utility function for wrapper languages to get an error string from a
4632// upb_DecodeStatus.
4633UPB_API const char* upb_DecodeStatus_String(upb_DecodeStatus status);
Joshua Haberman9abf6e22021-01-13 12:16:25 -08004634#ifdef __cplusplus
Joshua Habermanf41049a2022-01-21 14:41:25 -08004635} /* extern "C" */
Joshua Haberman9abf6e22021-01-13 12:16:25 -08004636#endif
4637
Joshua Habermandd69a482021-05-17 22:40:33 -07004638
Mike Kruskal9cf9db82022-11-04 21:22:31 -07004639#endif /* UPB_WIRE_DECODE_H_ */
Joshua Habermand3995ec2022-09-30 16:54:39 -07004640
Protobuf Team Botda56def2023-12-26 19:08:52 +00004641// upb_Encode: parsing from a upb_Message using a upb_MiniTable.
4642
4643#ifndef UPB_WIRE_ENCODE_H_
4644#define UPB_WIRE_ENCODE_H_
4645
4646#include <stddef.h>
4647#include <stdint.h>
4648
4649
4650// Must be last.
4651
4652#ifdef __cplusplus
4653extern "C" {
4654#endif
4655
4656enum {
4657 /* If set, the results of serializing will be deterministic across all
4658 * instances of this binary. There are no guarantees across different
4659 * binary builds.
4660 *
4661 * If your proto contains maps, the encoder will need to malloc()/free()
4662 * memory during encode. */
4663 kUpb_EncodeOption_Deterministic = 1,
4664
Protobuf Team Bote22539b2024-04-08 23:26:12 +00004665 // When set, unknown fields are not encoded.
Protobuf Team Botda56def2023-12-26 19:08:52 +00004666 kUpb_EncodeOption_SkipUnknown = 2,
4667
4668 // When set, the encode will fail if any required fields are missing.
4669 kUpb_EncodeOption_CheckRequired = 4,
4670};
4671
Protobuf Team Bot762233d2024-04-10 13:38:37 +00004672// LINT.IfChange
Protobuf Team Botda56def2023-12-26 19:08:52 +00004673typedef enum {
4674 kUpb_EncodeStatus_Ok = 0,
4675 kUpb_EncodeStatus_OutOfMemory = 1, // Arena alloc failed
4676 kUpb_EncodeStatus_MaxDepthExceeded = 2,
4677
4678 // kUpb_EncodeOption_CheckRequired failed but the parse otherwise succeeded.
4679 kUpb_EncodeStatus_MissingRequired = 3,
4680} upb_EncodeStatus;
Protobuf Team Bot762233d2024-04-10 13:38:37 +00004681// LINT.ThenChange(//depot/google3/third_party/protobuf/rust/upb.rs:encode_status)
Protobuf Team Botda56def2023-12-26 19:08:52 +00004682
4683UPB_INLINE uint32_t upb_EncodeOptions_MaxDepth(uint16_t depth) {
4684 return (uint32_t)depth << 16;
4685}
4686
4687UPB_INLINE uint16_t upb_EncodeOptions_GetMaxDepth(uint32_t options) {
4688 return options >> 16;
4689}
4690
4691// Enforce an upper bound on recursion depth.
4692UPB_INLINE int upb_Encode_LimitDepth(uint32_t encode_options, uint32_t limit) {
4693 uint32_t max_depth = upb_EncodeOptions_GetMaxDepth(encode_options);
4694 if (max_depth > limit) max_depth = limit;
4695 return upb_EncodeOptions_MaxDepth(max_depth) | (encode_options & 0xffff);
4696}
4697
4698UPB_API upb_EncodeStatus upb_Encode(const upb_Message* msg,
4699 const upb_MiniTable* l, int options,
4700 upb_Arena* arena, char** buf, size_t* size);
4701
Protobuf Team Botd86fe392024-04-03 14:19:48 +00004702// Encodes the message prepended by a varint of the serialized length.
Protobuf Team Botb9bde6a2024-04-03 19:25:27 +00004703UPB_API upb_EncodeStatus upb_EncodeLengthPrefixed(const upb_Message* msg,
4704 const upb_MiniTable* l,
4705 int options, upb_Arena* arena,
4706 char** buf, size_t* size);
Protobuf Team Bot5dfdd852024-05-17 15:56:35 +00004707// Utility function for wrapper languages to get an error string from a
4708// upb_EncodeStatus.
4709UPB_API const char* upb_EncodeStatus_String(upb_EncodeStatus status);
Protobuf Team Botd86fe392024-04-03 14:19:48 +00004710
Protobuf Team Botda56def2023-12-26 19:08:52 +00004711#ifdef __cplusplus
4712} /* extern "C" */
4713#endif
4714
4715
4716#endif /* UPB_WIRE_ENCODE_H_ */
4717
Joshua Haberman9abf6e22021-01-13 12:16:25 -08004718// These are the specialized field parser functions for the fast parser.
4719// Generated tables will refer to these by name.
4720//
4721// The function names are encoded with names like:
4722//
4723// // 123 4
4724// upb_pss_1bt(); // Parse singular string, 1 byte tag.
4725//
4726// In position 1:
4727// - 'p' for parse, most function use this
4728// - 'c' for copy, for when we are copying strings instead of aliasing
4729//
4730// In position 2 (cardinality):
4731// - 's' for singular, with or without hasbit
4732// - 'o' for oneof
4733// - 'r' for non-packed repeated
4734// - 'p' for packed repeated
4735//
4736// In position 3 (type):
4737// - 'b1' for bool
4738// - 'v4' for 4-byte varint
4739// - 'v8' for 8-byte varint
4740// - 'z4' for zig-zag-encoded 4-byte varint
4741// - 'z8' for zig-zag-encoded 8-byte varint
4742// - 'f4' for 4-byte fixed
4743// - 'f8' for 8-byte fixed
4744// - 'm' for sub-message
4745// - 's' for string (validate UTF-8)
4746// - 'b' for bytes
4747//
4748// In position 4 (tag length):
4749// - '1' for one-byte tags (field numbers 1-15)
4750// - '2' for two-byte tags (field numbers 16-2048)
4751
Protobuf Team Botde5ea1e2024-01-02 04:02:53 +00004752#ifndef UPB_WIRE_INTERNAL_DECODE_FAST_H_
4753#define UPB_WIRE_INTERNAL_DECODE_FAST_H_
Joshua Haberman9abf6e22021-01-13 12:16:25 -08004754
4755
Joshua Habermand3995ec2022-09-30 16:54:39 -07004756// Must be last.
4757
4758#ifdef __cplusplus
4759extern "C" {
4760#endif
4761
Joshua Habermanf41049a2022-01-21 14:41:25 -08004762struct upb_Decoder;
Joshua Haberman9abf6e22021-01-13 12:16:25 -08004763
4764// The fallback, generic parsing function that can handle any field type.
4765// This just uses the regular (non-fast) parser to parse a single field.
Joshua Habermand3995ec2022-09-30 16:54:39 -07004766const char* _upb_FastDecoder_DecodeGeneric(struct upb_Decoder* d,
4767 const char* ptr, upb_Message* msg,
4768 intptr_t table, uint64_t hasbits,
4769 uint64_t data);
Joshua Haberman9abf6e22021-01-13 12:16:25 -08004770
Joshua Habermanf41049a2022-01-21 14:41:25 -08004771#define UPB_PARSE_PARAMS \
4772 struct upb_Decoder *d, const char *ptr, upb_Message *msg, intptr_t table, \
Joshua Haberman9abf6e22021-01-13 12:16:25 -08004773 uint64_t hasbits, uint64_t data
4774
4775/* primitive fields ***********************************************************/
4776
4777#define F(card, type, valbytes, tagbytes) \
Joshua Habermanf41049a2022-01-21 14:41:25 -08004778 const char* upb_p##card##type##valbytes##_##tagbytes##bt(UPB_PARSE_PARAMS);
Joshua Haberman9abf6e22021-01-13 12:16:25 -08004779
4780#define TYPES(card, tagbytes) \
4781 F(card, b, 1, tagbytes) \
4782 F(card, v, 4, tagbytes) \
4783 F(card, v, 8, tagbytes) \
4784 F(card, z, 4, tagbytes) \
4785 F(card, z, 8, tagbytes) \
4786 F(card, f, 4, tagbytes) \
4787 F(card, f, 8, tagbytes)
4788
4789#define TAGBYTES(card) \
4790 TYPES(card, 1) \
4791 TYPES(card, 2)
4792
4793TAGBYTES(s)
4794TAGBYTES(o)
4795TAGBYTES(r)
4796TAGBYTES(p)
4797
4798#undef F
4799#undef TYPES
4800#undef TAGBYTES
4801
4802/* string fields **************************************************************/
4803
4804#define F(card, tagbytes, type) \
Joshua Habermanf41049a2022-01-21 14:41:25 -08004805 const char* upb_p##card##type##_##tagbytes##bt(UPB_PARSE_PARAMS); \
4806 const char* upb_c##card##type##_##tagbytes##bt(UPB_PARSE_PARAMS);
Joshua Haberman9abf6e22021-01-13 12:16:25 -08004807
4808#define UTF8(card, tagbytes) \
4809 F(card, tagbytes, s) \
4810 F(card, tagbytes, b)
4811
4812#define TAGBYTES(card) \
4813 UTF8(card, 1) \
4814 UTF8(card, 2)
4815
4816TAGBYTES(s)
4817TAGBYTES(o)
4818TAGBYTES(r)
4819
4820#undef F
Protobuf Team Botde5ea1e2024-01-02 04:02:53 +00004821#undef UTF8
Joshua Haberman9abf6e22021-01-13 12:16:25 -08004822#undef TAGBYTES
4823
4824/* sub-message fields *********************************************************/
4825
4826#define F(card, tagbytes, size_ceil, ceil_arg) \
Joshua Habermanf41049a2022-01-21 14:41:25 -08004827 const char* upb_p##card##m_##tagbytes##bt_max##size_ceil##b(UPB_PARSE_PARAMS);
Joshua Haberman9abf6e22021-01-13 12:16:25 -08004828
4829#define SIZES(card, tagbytes) \
Joshua Habermanf41049a2022-01-21 14:41:25 -08004830 F(card, tagbytes, 64, 64) \
Joshua Haberman9abf6e22021-01-13 12:16:25 -08004831 F(card, tagbytes, 128, 128) \
4832 F(card, tagbytes, 192, 192) \
4833 F(card, tagbytes, 256, 256) \
4834 F(card, tagbytes, max, -1)
4835
4836#define TAGBYTES(card) \
Joshua Habermanf41049a2022-01-21 14:41:25 -08004837 SIZES(card, 1) \
Joshua Haberman9abf6e22021-01-13 12:16:25 -08004838 SIZES(card, 2)
4839
4840TAGBYTES(s)
4841TAGBYTES(o)
4842TAGBYTES(r)
4843
Joshua Haberman9abf6e22021-01-13 12:16:25 -08004844#undef F
Protobuf Team Botde5ea1e2024-01-02 04:02:53 +00004845#undef SIZES
4846#undef TAGBYTES
Joshua Haberman9abf6e22021-01-13 12:16:25 -08004847
4848#undef UPB_PARSE_PARAMS
4849
Joshua Habermand3995ec2022-09-30 16:54:39 -07004850#ifdef __cplusplus
4851} /* extern "C" */
4852#endif
4853
4854
Protobuf Team Botde5ea1e2024-01-02 04:02:53 +00004855#endif /* UPB_WIRE_INTERNAL_DECODE_FAST_H_ */
Mike Kruskal9d435022023-07-11 12:45:07 -07004856// IWYU pragma: end_exports
4857
4858#endif // UPB_GENERATED_CODE_SUPPORT_H_
Protobuf Team Bot0cb912c2023-09-28 20:14:04 +00004859/* This file was generated by upb_generator from the input file:
Mike Kruskal9d435022023-07-11 12:45:07 -07004860 *
4861 * google/protobuf/descriptor.proto
4862 *
4863 * Do not edit -- your changes will be discarded when the file is
Protobuf Team Botd3b2fc52024-05-02 17:02:37 +00004864 * regenerated.
4865 * NO CHECKED-IN PROTOBUF GENCODE */
Mike Kruskal9d435022023-07-11 12:45:07 -07004866
Protobuf Team Botd11eb712023-09-15 00:25:33 +00004867#ifndef GOOGLE_PROTOBUF_DESCRIPTOR_PROTO_UPB_MINITABLE_H_
4868#define GOOGLE_PROTOBUF_DESCRIPTOR_PROTO_UPB_MINITABLE_H_
4869
4870
4871// Must be last.
4872
4873#ifdef __cplusplus
4874extern "C" {
4875#endif
4876
Protobuf Team Botd14a3362023-10-07 23:51:34 +00004877extern const upb_MiniTable google__protobuf__FileDescriptorSet_msg_init;
Protobuf Team Bot532f0c22024-06-05 03:21:24 +00004878extern const upb_MiniTable* google__protobuf__FileDescriptorSet_msg_init_ptr;
Protobuf Team Botd14a3362023-10-07 23:51:34 +00004879extern const upb_MiniTable google__protobuf__FileDescriptorProto_msg_init;
Protobuf Team Bot532f0c22024-06-05 03:21:24 +00004880extern const upb_MiniTable* google__protobuf__FileDescriptorProto_msg_init_ptr;
Protobuf Team Botd14a3362023-10-07 23:51:34 +00004881extern const upb_MiniTable google__protobuf__DescriptorProto_msg_init;
Protobuf Team Bot532f0c22024-06-05 03:21:24 +00004882extern const upb_MiniTable* google__protobuf__DescriptorProto_msg_init_ptr;
Protobuf Team Botd14a3362023-10-07 23:51:34 +00004883extern const upb_MiniTable google__protobuf__DescriptorProto__ExtensionRange_msg_init;
Protobuf Team Bot532f0c22024-06-05 03:21:24 +00004884extern const upb_MiniTable* google__protobuf__DescriptorProto__ExtensionRange_msg_init_ptr;
Protobuf Team Botd14a3362023-10-07 23:51:34 +00004885extern const upb_MiniTable google__protobuf__DescriptorProto__ReservedRange_msg_init;
Protobuf Team Bot532f0c22024-06-05 03:21:24 +00004886extern const upb_MiniTable* google__protobuf__DescriptorProto__ReservedRange_msg_init_ptr;
Protobuf Team Botd14a3362023-10-07 23:51:34 +00004887extern const upb_MiniTable google__protobuf__ExtensionRangeOptions_msg_init;
Protobuf Team Bot532f0c22024-06-05 03:21:24 +00004888extern const upb_MiniTable* google__protobuf__ExtensionRangeOptions_msg_init_ptr;
Protobuf Team Botd14a3362023-10-07 23:51:34 +00004889extern const upb_MiniTable google__protobuf__ExtensionRangeOptions__Declaration_msg_init;
Protobuf Team Bot532f0c22024-06-05 03:21:24 +00004890extern const upb_MiniTable* google__protobuf__ExtensionRangeOptions__Declaration_msg_init_ptr;
Protobuf Team Botd14a3362023-10-07 23:51:34 +00004891extern const upb_MiniTable google__protobuf__FieldDescriptorProto_msg_init;
Protobuf Team Bot532f0c22024-06-05 03:21:24 +00004892extern const upb_MiniTable* google__protobuf__FieldDescriptorProto_msg_init_ptr;
Protobuf Team Botd14a3362023-10-07 23:51:34 +00004893extern const upb_MiniTable google__protobuf__OneofDescriptorProto_msg_init;
Protobuf Team Bot532f0c22024-06-05 03:21:24 +00004894extern const upb_MiniTable* google__protobuf__OneofDescriptorProto_msg_init_ptr;
Protobuf Team Botd14a3362023-10-07 23:51:34 +00004895extern const upb_MiniTable google__protobuf__EnumDescriptorProto_msg_init;
Protobuf Team Bot532f0c22024-06-05 03:21:24 +00004896extern const upb_MiniTable* google__protobuf__EnumDescriptorProto_msg_init_ptr;
Protobuf Team Botd14a3362023-10-07 23:51:34 +00004897extern const upb_MiniTable google__protobuf__EnumDescriptorProto__EnumReservedRange_msg_init;
Protobuf Team Bot532f0c22024-06-05 03:21:24 +00004898extern const upb_MiniTable* google__protobuf__EnumDescriptorProto__EnumReservedRange_msg_init_ptr;
Protobuf Team Botd14a3362023-10-07 23:51:34 +00004899extern const upb_MiniTable google__protobuf__EnumValueDescriptorProto_msg_init;
Protobuf Team Bot532f0c22024-06-05 03:21:24 +00004900extern const upb_MiniTable* google__protobuf__EnumValueDescriptorProto_msg_init_ptr;
Protobuf Team Botd14a3362023-10-07 23:51:34 +00004901extern const upb_MiniTable google__protobuf__ServiceDescriptorProto_msg_init;
Protobuf Team Bot532f0c22024-06-05 03:21:24 +00004902extern const upb_MiniTable* google__protobuf__ServiceDescriptorProto_msg_init_ptr;
Protobuf Team Botd14a3362023-10-07 23:51:34 +00004903extern const upb_MiniTable google__protobuf__MethodDescriptorProto_msg_init;
Protobuf Team Bot532f0c22024-06-05 03:21:24 +00004904extern const upb_MiniTable* google__protobuf__MethodDescriptorProto_msg_init_ptr;
Protobuf Team Botd14a3362023-10-07 23:51:34 +00004905extern const upb_MiniTable google__protobuf__FileOptions_msg_init;
Protobuf Team Bot532f0c22024-06-05 03:21:24 +00004906extern const upb_MiniTable* google__protobuf__FileOptions_msg_init_ptr;
Protobuf Team Botd14a3362023-10-07 23:51:34 +00004907extern const upb_MiniTable google__protobuf__MessageOptions_msg_init;
Protobuf Team Bot532f0c22024-06-05 03:21:24 +00004908extern const upb_MiniTable* google__protobuf__MessageOptions_msg_init_ptr;
Protobuf Team Botd14a3362023-10-07 23:51:34 +00004909extern const upb_MiniTable google__protobuf__FieldOptions_msg_init;
Protobuf Team Bot532f0c22024-06-05 03:21:24 +00004910extern const upb_MiniTable* google__protobuf__FieldOptions_msg_init_ptr;
Protobuf Team Botd14a3362023-10-07 23:51:34 +00004911extern const upb_MiniTable google__protobuf__FieldOptions__EditionDefault_msg_init;
Protobuf Team Bot532f0c22024-06-05 03:21:24 +00004912extern const upb_MiniTable* google__protobuf__FieldOptions__EditionDefault_msg_init_ptr;
Protobuf Team Bot85edb7e2024-04-03 02:43:54 +00004913extern const upb_MiniTable google__protobuf__FieldOptions__FeatureSupport_msg_init;
Protobuf Team Bot532f0c22024-06-05 03:21:24 +00004914extern const upb_MiniTable* google__protobuf__FieldOptions__FeatureSupport_msg_init_ptr;
Protobuf Team Botd14a3362023-10-07 23:51:34 +00004915extern const upb_MiniTable google__protobuf__OneofOptions_msg_init;
Protobuf Team Bot532f0c22024-06-05 03:21:24 +00004916extern const upb_MiniTable* google__protobuf__OneofOptions_msg_init_ptr;
Protobuf Team Botd14a3362023-10-07 23:51:34 +00004917extern const upb_MiniTable google__protobuf__EnumOptions_msg_init;
Protobuf Team Bot532f0c22024-06-05 03:21:24 +00004918extern const upb_MiniTable* google__protobuf__EnumOptions_msg_init_ptr;
Protobuf Team Botd14a3362023-10-07 23:51:34 +00004919extern const upb_MiniTable google__protobuf__EnumValueOptions_msg_init;
Protobuf Team Bot532f0c22024-06-05 03:21:24 +00004920extern const upb_MiniTable* google__protobuf__EnumValueOptions_msg_init_ptr;
Protobuf Team Botd14a3362023-10-07 23:51:34 +00004921extern const upb_MiniTable google__protobuf__ServiceOptions_msg_init;
Protobuf Team Bot532f0c22024-06-05 03:21:24 +00004922extern const upb_MiniTable* google__protobuf__ServiceOptions_msg_init_ptr;
Protobuf Team Botd14a3362023-10-07 23:51:34 +00004923extern const upb_MiniTable google__protobuf__MethodOptions_msg_init;
Protobuf Team Bot532f0c22024-06-05 03:21:24 +00004924extern const upb_MiniTable* google__protobuf__MethodOptions_msg_init_ptr;
Protobuf Team Botd14a3362023-10-07 23:51:34 +00004925extern const upb_MiniTable google__protobuf__UninterpretedOption_msg_init;
Protobuf Team Bot532f0c22024-06-05 03:21:24 +00004926extern const upb_MiniTable* google__protobuf__UninterpretedOption_msg_init_ptr;
Protobuf Team Botd14a3362023-10-07 23:51:34 +00004927extern const upb_MiniTable google__protobuf__UninterpretedOption__NamePart_msg_init;
Protobuf Team Bot532f0c22024-06-05 03:21:24 +00004928extern const upb_MiniTable* google__protobuf__UninterpretedOption__NamePart_msg_init_ptr;
Protobuf Team Botd14a3362023-10-07 23:51:34 +00004929extern const upb_MiniTable google__protobuf__FeatureSet_msg_init;
Protobuf Team Bot532f0c22024-06-05 03:21:24 +00004930extern const upb_MiniTable* google__protobuf__FeatureSet_msg_init_ptr;
Protobuf Team Botd14a3362023-10-07 23:51:34 +00004931extern const upb_MiniTable google__protobuf__FeatureSetDefaults_msg_init;
Protobuf Team Bot532f0c22024-06-05 03:21:24 +00004932extern const upb_MiniTable* google__protobuf__FeatureSetDefaults_msg_init_ptr;
Protobuf Team Botd14a3362023-10-07 23:51:34 +00004933extern const upb_MiniTable google__protobuf__FeatureSetDefaults__FeatureSetEditionDefault_msg_init;
Protobuf Team Bot532f0c22024-06-05 03:21:24 +00004934extern const upb_MiniTable* google__protobuf__FeatureSetDefaults__FeatureSetEditionDefault_msg_init_ptr;
Protobuf Team Botd14a3362023-10-07 23:51:34 +00004935extern const upb_MiniTable google__protobuf__SourceCodeInfo_msg_init;
Protobuf Team Bot532f0c22024-06-05 03:21:24 +00004936extern const upb_MiniTable* google__protobuf__SourceCodeInfo_msg_init_ptr;
Protobuf Team Botd14a3362023-10-07 23:51:34 +00004937extern const upb_MiniTable google__protobuf__SourceCodeInfo__Location_msg_init;
Protobuf Team Bot532f0c22024-06-05 03:21:24 +00004938extern const upb_MiniTable* google__protobuf__SourceCodeInfo__Location_msg_init_ptr;
Protobuf Team Botd14a3362023-10-07 23:51:34 +00004939extern const upb_MiniTable google__protobuf__GeneratedCodeInfo_msg_init;
Protobuf Team Bot532f0c22024-06-05 03:21:24 +00004940extern const upb_MiniTable* google__protobuf__GeneratedCodeInfo_msg_init_ptr;
Protobuf Team Botd14a3362023-10-07 23:51:34 +00004941extern const upb_MiniTable google__protobuf__GeneratedCodeInfo__Annotation_msg_init;
Protobuf Team Bot532f0c22024-06-05 03:21:24 +00004942extern const upb_MiniTable* google__protobuf__GeneratedCodeInfo__Annotation_msg_init_ptr;
Protobuf Team Botd11eb712023-09-15 00:25:33 +00004943
4944extern const upb_MiniTableEnum google_protobuf_Edition_enum_init;
4945extern const upb_MiniTableEnum google_protobuf_ExtensionRangeOptions_VerificationState_enum_init;
4946extern const upb_MiniTableEnum google_protobuf_FeatureSet_EnumType_enum_init;
4947extern const upb_MiniTableEnum google_protobuf_FeatureSet_FieldPresence_enum_init;
4948extern const upb_MiniTableEnum google_protobuf_FeatureSet_JsonFormat_enum_init;
4949extern const upb_MiniTableEnum google_protobuf_FeatureSet_MessageEncoding_enum_init;
4950extern const upb_MiniTableEnum google_protobuf_FeatureSet_RepeatedFieldEncoding_enum_init;
Protobuf Team Bot61127952023-09-26 20:07:33 +00004951extern const upb_MiniTableEnum google_protobuf_FeatureSet_Utf8Validation_enum_init;
Protobuf Team Botd11eb712023-09-15 00:25:33 +00004952extern const upb_MiniTableEnum google_protobuf_FieldDescriptorProto_Label_enum_init;
4953extern const upb_MiniTableEnum google_protobuf_FieldDescriptorProto_Type_enum_init;
4954extern const upb_MiniTableEnum google_protobuf_FieldOptions_CType_enum_init;
4955extern const upb_MiniTableEnum google_protobuf_FieldOptions_JSType_enum_init;
4956extern const upb_MiniTableEnum google_protobuf_FieldOptions_OptionRetention_enum_init;
4957extern const upb_MiniTableEnum google_protobuf_FieldOptions_OptionTargetType_enum_init;
4958extern const upb_MiniTableEnum google_protobuf_FileOptions_OptimizeMode_enum_init;
4959extern const upb_MiniTableEnum google_protobuf_GeneratedCodeInfo_Annotation_Semantic_enum_init;
4960extern const upb_MiniTableEnum google_protobuf_MethodOptions_IdempotencyLevel_enum_init;
4961extern const upb_MiniTableFile google_protobuf_descriptor_proto_upb_file_layout;
4962
4963#ifdef __cplusplus
4964} /* extern "C" */
4965#endif
4966
4967
4968#endif /* GOOGLE_PROTOBUF_DESCRIPTOR_PROTO_UPB_MINITABLE_H_ */
4969
4970#ifndef UPB_WIRE_EPS_COPY_INPUT_STREAM_H_
4971#define UPB_WIRE_EPS_COPY_INPUT_STREAM_H_
4972
4973#include <string.h>
4974
4975
4976// Must be last.
4977
4978#ifdef __cplusplus
4979extern "C" {
4980#endif
4981
4982// The maximum number of bytes a single protobuf field can take up in the
4983// wire format. We only want to do one bounds check per field, so the input
4984// stream guarantees that after upb_EpsCopyInputStream_IsDone() is called,
4985// the decoder can read this many bytes without performing another bounds
4986// check. The stream will copy into a patch buffer as necessary to guarantee
4987// this invariant.
4988#define kUpb_EpsCopyInputStream_SlopBytes 16
4989
4990enum {
4991 kUpb_EpsCopyInputStream_NoAliasing = 0,
4992 kUpb_EpsCopyInputStream_OnPatch = 1,
4993 kUpb_EpsCopyInputStream_NoDelta = 2
4994};
4995
4996typedef struct {
4997 const char* end; // Can read up to SlopBytes bytes beyond this.
4998 const char* limit_ptr; // For bounds checks, = end + UPB_MIN(limit, 0)
4999 uintptr_t aliasing;
Protobuf Team Bot1d143b52024-01-25 20:29:43 +00005000 int limit; // Submessage limit relative to end
5001 bool error; // To distinguish between EOF and error.
Protobuf Team Botd11eb712023-09-15 00:25:33 +00005002 char patch[kUpb_EpsCopyInputStream_SlopBytes * 2];
5003} upb_EpsCopyInputStream;
5004
5005// Returns true if the stream is in the error state. A stream enters the error
5006// state when the user reads past a limit (caught in IsDone()) or the
5007// ZeroCopyInputStream returns an error.
5008UPB_INLINE bool upb_EpsCopyInputStream_IsError(upb_EpsCopyInputStream* e) {
5009 return e->error;
5010}
5011
5012typedef const char* upb_EpsCopyInputStream_BufferFlipCallback(
5013 upb_EpsCopyInputStream* e, const char* old_end, const char* new_start);
5014
5015typedef const char* upb_EpsCopyInputStream_IsDoneFallbackFunc(
5016 upb_EpsCopyInputStream* e, const char* ptr, int overrun);
5017
5018// Initializes a upb_EpsCopyInputStream using the contents of the buffer
5019// [*ptr, size]. Updates `*ptr` as necessary to guarantee that at least
5020// kUpb_EpsCopyInputStream_SlopBytes are available to read.
5021UPB_INLINE void upb_EpsCopyInputStream_Init(upb_EpsCopyInputStream* e,
5022 const char** ptr, size_t size,
5023 bool enable_aliasing) {
5024 if (size <= kUpb_EpsCopyInputStream_SlopBytes) {
5025 memset(&e->patch, 0, 32);
5026 if (size) memcpy(&e->patch, *ptr, size);
5027 e->aliasing = enable_aliasing ? (uintptr_t)*ptr - (uintptr_t)e->patch
5028 : kUpb_EpsCopyInputStream_NoAliasing;
5029 *ptr = e->patch;
5030 e->end = *ptr + size;
5031 e->limit = 0;
5032 } else {
5033 e->end = *ptr + size - kUpb_EpsCopyInputStream_SlopBytes;
5034 e->limit = kUpb_EpsCopyInputStream_SlopBytes;
5035 e->aliasing = enable_aliasing ? kUpb_EpsCopyInputStream_NoDelta
5036 : kUpb_EpsCopyInputStream_NoAliasing;
5037 }
5038 e->limit_ptr = e->end;
5039 e->error = false;
5040}
5041
5042typedef enum {
5043 // The current stream position is at a limit.
5044 kUpb_IsDoneStatus_Done,
5045
5046 // The current stream position is not at a limit.
5047 kUpb_IsDoneStatus_NotDone,
5048
5049 // The current stream position is not at a limit, and the stream needs to
5050 // be flipped to a new buffer before more data can be read.
5051 kUpb_IsDoneStatus_NeedFallback,
5052} upb_IsDoneStatus;
5053
5054// Returns the status of the current stream position. This is a low-level
5055// function, it is simpler to call upb_EpsCopyInputStream_IsDone() if possible.
5056UPB_INLINE upb_IsDoneStatus upb_EpsCopyInputStream_IsDoneStatus(
5057 upb_EpsCopyInputStream* e, const char* ptr, int* overrun) {
5058 *overrun = ptr - e->end;
5059 if (UPB_LIKELY(ptr < e->limit_ptr)) {
5060 return kUpb_IsDoneStatus_NotDone;
5061 } else if (UPB_LIKELY(*overrun == e->limit)) {
5062 return kUpb_IsDoneStatus_Done;
5063 } else {
5064 return kUpb_IsDoneStatus_NeedFallback;
5065 }
5066}
5067
5068// Returns true if the stream has hit a limit, either the current delimited
5069// limit or the overall end-of-stream. As a side effect, this function may flip
5070// the pointer to a new buffer if there are less than
5071// kUpb_EpsCopyInputStream_SlopBytes of data to be read in the current buffer.
5072//
5073// Postcondition: if the function returns false, there are at least
5074// kUpb_EpsCopyInputStream_SlopBytes of data available to read at *ptr.
5075UPB_INLINE bool upb_EpsCopyInputStream_IsDoneWithCallback(
5076 upb_EpsCopyInputStream* e, const char** ptr,
5077 upb_EpsCopyInputStream_IsDoneFallbackFunc* func) {
5078 int overrun;
5079 switch (upb_EpsCopyInputStream_IsDoneStatus(e, *ptr, &overrun)) {
5080 case kUpb_IsDoneStatus_Done:
5081 return true;
5082 case kUpb_IsDoneStatus_NotDone:
5083 return false;
5084 case kUpb_IsDoneStatus_NeedFallback:
5085 *ptr = func(e, *ptr, overrun);
5086 return *ptr == NULL;
5087 }
5088 UPB_UNREACHABLE();
5089}
5090
5091const char* _upb_EpsCopyInputStream_IsDoneFallbackNoCallback(
5092 upb_EpsCopyInputStream* e, const char* ptr, int overrun);
5093
5094// A simpler version of IsDoneWithCallback() that does not support a buffer flip
5095// callback. Useful in cases where we do not need to insert custom logic at
5096// every buffer flip.
5097//
5098// If this returns true, the user must call upb_EpsCopyInputStream_IsError()
5099// to distinguish between EOF and error.
5100UPB_INLINE bool upb_EpsCopyInputStream_IsDone(upb_EpsCopyInputStream* e,
5101 const char** ptr) {
5102 return upb_EpsCopyInputStream_IsDoneWithCallback(
5103 e, ptr, _upb_EpsCopyInputStream_IsDoneFallbackNoCallback);
5104}
5105
5106// Returns the total number of bytes that are safe to read from the current
5107// buffer without reading uninitialized or unallocated memory.
5108//
5109// Note that this check does not respect any semantic limits on the stream,
5110// either limits from PushLimit() or the overall stream end, so some of these
5111// bytes may have unpredictable, nonsense values in them. The guarantee is only
5112// that the bytes are valid to read from the perspective of the C language
5113// (ie. you can read without triggering UBSAN or ASAN).
5114UPB_INLINE size_t upb_EpsCopyInputStream_BytesAvailable(
5115 upb_EpsCopyInputStream* e, const char* ptr) {
5116 return (e->end - ptr) + kUpb_EpsCopyInputStream_SlopBytes;
5117}
5118
5119// Returns true if the given delimited field size is valid (it does not extend
5120// beyond any previously-pushed limits). `ptr` should point to the beginning
5121// of the field data, after the delimited size.
5122//
5123// Note that this does *not* guarantee that all of the data for this field is in
5124// the current buffer.
5125UPB_INLINE bool upb_EpsCopyInputStream_CheckSize(
5126 const upb_EpsCopyInputStream* e, const char* ptr, int size) {
5127 UPB_ASSERT(size >= 0);
5128 return ptr - e->end + size <= e->limit;
5129}
5130
5131UPB_INLINE bool _upb_EpsCopyInputStream_CheckSizeAvailable(
5132 upb_EpsCopyInputStream* e, const char* ptr, int size, bool submessage) {
5133 // This is one extra branch compared to the more normal:
5134 // return (size_t)(end - ptr) < size;
5135 // However it is one less computation if we are just about to use "ptr + len":
5136 // https://godbolt.org/z/35YGPz
5137 // In microbenchmarks this shows a small improvement.
5138 uintptr_t uptr = (uintptr_t)ptr;
5139 uintptr_t uend = (uintptr_t)e->limit_ptr;
5140 uintptr_t res = uptr + (size_t)size;
5141 if (!submessage) uend += kUpb_EpsCopyInputStream_SlopBytes;
5142 // NOTE: this check depends on having a linear address space. This is not
5143 // technically guaranteed by uintptr_t.
5144 bool ret = res >= uptr && res <= uend;
5145 if (size < 0) UPB_ASSERT(!ret);
5146 return ret;
5147}
5148
5149// Returns true if the given delimited field size is valid (it does not extend
5150// beyond any previously-pushed limited) *and* all of the data for this field is
5151// available to be read in the current buffer.
5152//
5153// If the size is negative, this function will always return false. This
5154// property can be useful in some cases.
5155UPB_INLINE bool upb_EpsCopyInputStream_CheckDataSizeAvailable(
5156 upb_EpsCopyInputStream* e, const char* ptr, int size) {
5157 return _upb_EpsCopyInputStream_CheckSizeAvailable(e, ptr, size, false);
5158}
5159
5160// Returns true if the given sub-message size is valid (it does not extend
5161// beyond any previously-pushed limited) *and* all of the data for this
5162// sub-message is available to be parsed in the current buffer.
5163//
5164// This implies that all fields from the sub-message can be parsed from the
5165// current buffer while maintaining the invariant that we always have at least
5166// kUpb_EpsCopyInputStream_SlopBytes of data available past the beginning of
5167// any individual field start.
5168//
5169// If the size is negative, this function will always return false. This
5170// property can be useful in some cases.
5171UPB_INLINE bool upb_EpsCopyInputStream_CheckSubMessageSizeAvailable(
5172 upb_EpsCopyInputStream* e, const char* ptr, int size) {
5173 return _upb_EpsCopyInputStream_CheckSizeAvailable(e, ptr, size, true);
5174}
5175
5176// Returns true if aliasing_enabled=true was passed to
5177// upb_EpsCopyInputStream_Init() when this stream was initialized.
5178UPB_INLINE bool upb_EpsCopyInputStream_AliasingEnabled(
5179 upb_EpsCopyInputStream* e) {
5180 return e->aliasing != kUpb_EpsCopyInputStream_NoAliasing;
5181}
5182
5183// Returns true if aliasing_enabled=true was passed to
5184// upb_EpsCopyInputStream_Init() when this stream was initialized *and* we can
5185// alias into the region [ptr, size] in an input buffer.
5186UPB_INLINE bool upb_EpsCopyInputStream_AliasingAvailable(
5187 upb_EpsCopyInputStream* e, const char* ptr, size_t size) {
5188 // When EpsCopyInputStream supports streaming, this will need to become a
5189 // runtime check.
5190 return upb_EpsCopyInputStream_CheckDataSizeAvailable(e, ptr, size) &&
5191 e->aliasing >= kUpb_EpsCopyInputStream_NoDelta;
5192}
5193
5194// Returns a pointer into an input buffer that corresponds to the parsing
5195// pointer `ptr`. The returned pointer may be the same as `ptr`, but also may
5196// be different if we are currently parsing out of the patch buffer.
5197//
5198// REQUIRES: Aliasing must be available for the given pointer. If the input is a
5199// flat buffer and aliasing is enabled, then aliasing will always be available.
5200UPB_INLINE const char* upb_EpsCopyInputStream_GetAliasedPtr(
5201 upb_EpsCopyInputStream* e, const char* ptr) {
5202 UPB_ASSUME(upb_EpsCopyInputStream_AliasingAvailable(e, ptr, 0));
5203 uintptr_t delta =
5204 e->aliasing == kUpb_EpsCopyInputStream_NoDelta ? 0 : e->aliasing;
5205 return (const char*)((uintptr_t)ptr + delta);
5206}
5207
5208// Reads string data from the input, aliasing into the input buffer instead of
5209// copying. The parsing pointer is passed in `*ptr`, and will be updated if
5210// necessary to point to the actual input buffer. Returns the new parsing
5211// pointer, which will be advanced past the string data.
5212//
5213// REQUIRES: Aliasing must be available for this data region (test with
5214// upb_EpsCopyInputStream_AliasingAvailable().
5215UPB_INLINE const char* upb_EpsCopyInputStream_ReadStringAliased(
5216 upb_EpsCopyInputStream* e, const char** ptr, size_t size) {
5217 UPB_ASSUME(upb_EpsCopyInputStream_AliasingAvailable(e, *ptr, size));
5218 const char* ret = *ptr + size;
5219 *ptr = upb_EpsCopyInputStream_GetAliasedPtr(e, *ptr);
5220 UPB_ASSUME(ret != NULL);
5221 return ret;
5222}
5223
5224// Skips `size` bytes of data from the input and returns a pointer past the end.
5225// Returns NULL on end of stream or error.
5226UPB_INLINE const char* upb_EpsCopyInputStream_Skip(upb_EpsCopyInputStream* e,
5227 const char* ptr, int size) {
5228 if (!upb_EpsCopyInputStream_CheckDataSizeAvailable(e, ptr, size)) return NULL;
5229 return ptr + size;
5230}
5231
5232// Copies `size` bytes of data from the input `ptr` into the buffer `to`, and
5233// returns a pointer past the end. Returns NULL on end of stream or error.
5234UPB_INLINE const char* upb_EpsCopyInputStream_Copy(upb_EpsCopyInputStream* e,
5235 const char* ptr, void* to,
5236 int size) {
5237 if (!upb_EpsCopyInputStream_CheckDataSizeAvailable(e, ptr, size)) return NULL;
5238 memcpy(to, ptr, size);
5239 return ptr + size;
5240}
5241
5242// Reads string data from the stream and advances the pointer accordingly.
5243// If aliasing was enabled when the stream was initialized, then the returned
5244// pointer will point into the input buffer if possible, otherwise new data
5245// will be allocated from arena and copied into. We may be forced to copy even
5246// if aliasing was enabled if the input data spans input buffers.
5247//
5248// Returns NULL if memory allocation failed, or we reached a premature EOF.
5249UPB_INLINE const char* upb_EpsCopyInputStream_ReadString(
5250 upb_EpsCopyInputStream* e, const char** ptr, size_t size,
5251 upb_Arena* arena) {
5252 if (upb_EpsCopyInputStream_AliasingAvailable(e, *ptr, size)) {
5253 return upb_EpsCopyInputStream_ReadStringAliased(e, ptr, size);
5254 } else {
5255 // We need to allocate and copy.
5256 if (!upb_EpsCopyInputStream_CheckDataSizeAvailable(e, *ptr, size)) {
5257 return NULL;
5258 }
5259 UPB_ASSERT(arena);
5260 char* data = (char*)upb_Arena_Malloc(arena, size);
5261 if (!data) return NULL;
5262 const char* ret = upb_EpsCopyInputStream_Copy(e, *ptr, data, size);
5263 *ptr = data;
5264 return ret;
5265 }
5266}
5267
5268UPB_INLINE void _upb_EpsCopyInputStream_CheckLimit(upb_EpsCopyInputStream* e) {
5269 UPB_ASSERT(e->limit_ptr == e->end + UPB_MIN(0, e->limit));
5270}
5271
5272// Pushes a limit onto the stack of limits for the current stream. The limit
5273// will extend for `size` bytes beyond the position in `ptr`. Future calls to
5274// upb_EpsCopyInputStream_IsDone() will return `true` when the stream position
5275// reaches this limit.
5276//
5277// Returns a delta that the caller must store and supply to PopLimit() below.
5278UPB_INLINE int upb_EpsCopyInputStream_PushLimit(upb_EpsCopyInputStream* e,
5279 const char* ptr, int size) {
5280 int limit = size + (int)(ptr - e->end);
5281 int delta = e->limit - limit;
5282 _upb_EpsCopyInputStream_CheckLimit(e);
5283 UPB_ASSERT(limit <= e->limit);
5284 e->limit = limit;
5285 e->limit_ptr = e->end + UPB_MIN(0, limit);
5286 _upb_EpsCopyInputStream_CheckLimit(e);
5287 return delta;
5288}
5289
5290// Pops the last limit that was pushed on this stream. This may only be called
5291// once IsDone() returns true. The user must pass the delta that was returned
5292// from PushLimit().
5293UPB_INLINE void upb_EpsCopyInputStream_PopLimit(upb_EpsCopyInputStream* e,
5294 const char* ptr,
5295 int saved_delta) {
5296 UPB_ASSERT(ptr - e->end == e->limit);
5297 _upb_EpsCopyInputStream_CheckLimit(e);
5298 e->limit += saved_delta;
5299 e->limit_ptr = e->end + UPB_MIN(0, e->limit);
5300 _upb_EpsCopyInputStream_CheckLimit(e);
5301}
5302
5303UPB_INLINE const char* _upb_EpsCopyInputStream_IsDoneFallbackInline(
5304 upb_EpsCopyInputStream* e, const char* ptr, int overrun,
5305 upb_EpsCopyInputStream_BufferFlipCallback* callback) {
5306 if (overrun < e->limit) {
5307 // Need to copy remaining data into patch buffer.
5308 UPB_ASSERT(overrun < kUpb_EpsCopyInputStream_SlopBytes);
5309 const char* old_end = ptr;
5310 const char* new_start = &e->patch[0] + overrun;
5311 memset(e->patch + kUpb_EpsCopyInputStream_SlopBytes, 0,
5312 kUpb_EpsCopyInputStream_SlopBytes);
5313 memcpy(e->patch, e->end, kUpb_EpsCopyInputStream_SlopBytes);
5314 ptr = new_start;
5315 e->end = &e->patch[kUpb_EpsCopyInputStream_SlopBytes];
5316 e->limit -= kUpb_EpsCopyInputStream_SlopBytes;
5317 e->limit_ptr = e->end + e->limit;
5318 UPB_ASSERT(ptr < e->limit_ptr);
5319 if (e->aliasing != kUpb_EpsCopyInputStream_NoAliasing) {
5320 e->aliasing = (uintptr_t)old_end - (uintptr_t)new_start;
5321 }
5322 return callback(e, old_end, new_start);
5323 } else {
5324 UPB_ASSERT(overrun > e->limit);
5325 e->error = true;
5326 return callback(e, NULL, NULL);
5327 }
5328}
5329
5330typedef const char* upb_EpsCopyInputStream_ParseDelimitedFunc(
5331 upb_EpsCopyInputStream* e, const char* ptr, void* ctx);
5332
5333// Tries to perform a fast-path handling of the given delimited message data.
5334// If the sub-message beginning at `*ptr` and extending for `len` is short and
5335// fits within this buffer, calls `func` with `ctx` as a parameter, where the
5336// pushing and popping of limits is handled automatically and with lower cost
5337// than the normal PushLimit()/PopLimit() sequence.
Protobuf Team Bot1d143b52024-01-25 20:29:43 +00005338UPB_FORCEINLINE bool upb_EpsCopyInputStream_TryParseDelimitedFast(
Protobuf Team Botd11eb712023-09-15 00:25:33 +00005339 upb_EpsCopyInputStream* e, const char** ptr, int len,
5340 upb_EpsCopyInputStream_ParseDelimitedFunc* func, void* ctx) {
5341 if (!upb_EpsCopyInputStream_CheckSubMessageSizeAvailable(e, *ptr, len)) {
5342 return false;
5343 }
5344
5345 // Fast case: Sub-message is <128 bytes and fits in the current buffer.
5346 // This means we can preserve limit/limit_ptr verbatim.
5347 const char* saved_limit_ptr = e->limit_ptr;
5348 int saved_limit = e->limit;
5349 e->limit_ptr = *ptr + len;
5350 e->limit = e->limit_ptr - e->end;
5351 UPB_ASSERT(e->limit_ptr == e->end + UPB_MIN(0, e->limit));
5352 *ptr = func(e, *ptr, ctx);
5353 e->limit_ptr = saved_limit_ptr;
5354 e->limit = saved_limit;
5355 UPB_ASSERT(e->limit_ptr == e->end + UPB_MIN(0, e->limit));
5356 return true;
5357}
5358
5359#ifdef __cplusplus
5360} /* extern "C" */
5361#endif
5362
5363
5364#endif // UPB_WIRE_EPS_COPY_INPUT_STREAM_H_
5365
Protobuf Team Botd11eb712023-09-15 00:25:33 +00005366#ifndef UPB_JSON_DECODE_H_
5367#define UPB_JSON_DECODE_H_
5368
5369
5370#ifndef UPB_REFLECTION_DEF_H_
5371#define UPB_REFLECTION_DEF_H_
5372
5373// IWYU pragma: begin_exports
5374
Protobuf Team Bot06310352023-09-26 21:54:58 +00005375// IWYU pragma: private, include "upb/reflection/def.h"
Protobuf Team Botd11eb712023-09-15 00:25:33 +00005376
5377#ifndef UPB_REFLECTION_DEF_POOL_H_
5378#define UPB_REFLECTION_DEF_POOL_H_
5379
5380
Protobuf Team Bot06310352023-09-26 21:54:58 +00005381// IWYU pragma: private, include "upb/reflection/def.h"
Protobuf Team Botd11eb712023-09-15 00:25:33 +00005382
5383// Declarations common to all public def types.
5384
5385#ifndef UPB_REFLECTION_COMMON_H_
5386#define UPB_REFLECTION_COMMON_H_
5387
5388// begin:google_only
5389// #ifndef UPB_BOOTSTRAP_STAGE0
5390// #include "net/proto2/proto/descriptor.upb.h"
5391// #else
5392// #include "google/protobuf/descriptor.upb.h"
5393// #endif
5394// end:google_only
5395
5396// begin:github_only
Protobuf Team Bot0cb912c2023-09-28 20:14:04 +00005397/* This file was generated by upb_generator from the input file:
Protobuf Team Botd11eb712023-09-15 00:25:33 +00005398 *
5399 * google/protobuf/descriptor.proto
5400 *
5401 * Do not edit -- your changes will be discarded when the file is
Protobuf Team Botd3b2fc52024-05-02 17:02:37 +00005402 * regenerated.
5403 * NO CHECKED-IN PROTOBUF GENCODE */
Protobuf Team Botd11eb712023-09-15 00:25:33 +00005404
Mike Kruskal9d435022023-07-11 12:45:07 -07005405#ifndef GOOGLE_PROTOBUF_DESCRIPTOR_PROTO_UPB_H_
5406#define GOOGLE_PROTOBUF_DESCRIPTOR_PROTO_UPB_H_
Joshua Habermand3995ec2022-09-30 16:54:39 -07005407
Protobuf Team Bot111d6552023-09-15 21:07:08 +00005408
5409
5410// Must be last.
Joshua Haberman9abf6e22021-01-13 12:16:25 -08005411
5412#ifdef __cplusplus
5413extern "C" {
5414#endif
5415
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +00005416typedef struct google_protobuf_FileDescriptorSet { upb_Message UPB_PRIVATE(base); } google_protobuf_FileDescriptorSet;
5417typedef struct google_protobuf_FileDescriptorProto { upb_Message UPB_PRIVATE(base); } google_protobuf_FileDescriptorProto;
5418typedef struct google_protobuf_DescriptorProto { upb_Message UPB_PRIVATE(base); } google_protobuf_DescriptorProto;
5419typedef struct google_protobuf_DescriptorProto_ExtensionRange { upb_Message UPB_PRIVATE(base); } google_protobuf_DescriptorProto_ExtensionRange;
5420typedef struct google_protobuf_DescriptorProto_ReservedRange { upb_Message UPB_PRIVATE(base); } google_protobuf_DescriptorProto_ReservedRange;
5421typedef struct google_protobuf_ExtensionRangeOptions { upb_Message UPB_PRIVATE(base); } google_protobuf_ExtensionRangeOptions;
5422typedef struct google_protobuf_ExtensionRangeOptions_Declaration { upb_Message UPB_PRIVATE(base); } google_protobuf_ExtensionRangeOptions_Declaration;
5423typedef struct google_protobuf_FieldDescriptorProto { upb_Message UPB_PRIVATE(base); } google_protobuf_FieldDescriptorProto;
5424typedef struct google_protobuf_OneofDescriptorProto { upb_Message UPB_PRIVATE(base); } google_protobuf_OneofDescriptorProto;
5425typedef struct google_protobuf_EnumDescriptorProto { upb_Message UPB_PRIVATE(base); } google_protobuf_EnumDescriptorProto;
5426typedef struct google_protobuf_EnumDescriptorProto_EnumReservedRange { upb_Message UPB_PRIVATE(base); } google_protobuf_EnumDescriptorProto_EnumReservedRange;
5427typedef struct google_protobuf_EnumValueDescriptorProto { upb_Message UPB_PRIVATE(base); } google_protobuf_EnumValueDescriptorProto;
5428typedef struct google_protobuf_ServiceDescriptorProto { upb_Message UPB_PRIVATE(base); } google_protobuf_ServiceDescriptorProto;
5429typedef struct google_protobuf_MethodDescriptorProto { upb_Message UPB_PRIVATE(base); } google_protobuf_MethodDescriptorProto;
5430typedef struct google_protobuf_FileOptions { upb_Message UPB_PRIVATE(base); } google_protobuf_FileOptions;
5431typedef struct google_protobuf_MessageOptions { upb_Message UPB_PRIVATE(base); } google_protobuf_MessageOptions;
5432typedef struct google_protobuf_FieldOptions { upb_Message UPB_PRIVATE(base); } google_protobuf_FieldOptions;
5433typedef struct google_protobuf_FieldOptions_EditionDefault { upb_Message UPB_PRIVATE(base); } google_protobuf_FieldOptions_EditionDefault;
Protobuf Team Bot85edb7e2024-04-03 02:43:54 +00005434typedef struct google_protobuf_FieldOptions_FeatureSupport { upb_Message UPB_PRIVATE(base); } google_protobuf_FieldOptions_FeatureSupport;
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +00005435typedef struct google_protobuf_OneofOptions { upb_Message UPB_PRIVATE(base); } google_protobuf_OneofOptions;
5436typedef struct google_protobuf_EnumOptions { upb_Message UPB_PRIVATE(base); } google_protobuf_EnumOptions;
5437typedef struct google_protobuf_EnumValueOptions { upb_Message UPB_PRIVATE(base); } google_protobuf_EnumValueOptions;
5438typedef struct google_protobuf_ServiceOptions { upb_Message UPB_PRIVATE(base); } google_protobuf_ServiceOptions;
5439typedef struct google_protobuf_MethodOptions { upb_Message UPB_PRIVATE(base); } google_protobuf_MethodOptions;
5440typedef struct google_protobuf_UninterpretedOption { upb_Message UPB_PRIVATE(base); } google_protobuf_UninterpretedOption;
5441typedef struct google_protobuf_UninterpretedOption_NamePart { upb_Message UPB_PRIVATE(base); } google_protobuf_UninterpretedOption_NamePart;
5442typedef struct google_protobuf_FeatureSet { upb_Message UPB_PRIVATE(base); } google_protobuf_FeatureSet;
5443typedef struct google_protobuf_FeatureSetDefaults { upb_Message UPB_PRIVATE(base); } google_protobuf_FeatureSetDefaults;
5444typedef struct google_protobuf_FeatureSetDefaults_FeatureSetEditionDefault { upb_Message UPB_PRIVATE(base); } google_protobuf_FeatureSetDefaults_FeatureSetEditionDefault;
5445typedef struct google_protobuf_SourceCodeInfo { upb_Message UPB_PRIVATE(base); } google_protobuf_SourceCodeInfo;
5446typedef struct google_protobuf_SourceCodeInfo_Location { upb_Message UPB_PRIVATE(base); } google_protobuf_SourceCodeInfo_Location;
5447typedef struct google_protobuf_GeneratedCodeInfo { upb_Message UPB_PRIVATE(base); } google_protobuf_GeneratedCodeInfo;
5448typedef struct google_protobuf_GeneratedCodeInfo_Annotation { upb_Message UPB_PRIVATE(base); } google_protobuf_GeneratedCodeInfo_Annotation;
Joshua Haberman9abf6e22021-01-13 12:16:25 -08005449
5450typedef enum {
Protobuf Team Botfa98bb32023-09-01 18:11:09 +00005451 google_protobuf_EDITION_UNKNOWN = 0,
5452 google_protobuf_EDITION_1_TEST_ONLY = 1,
5453 google_protobuf_EDITION_2_TEST_ONLY = 2,
Protobuf Team Bot2322a872024-04-10 17:23:17 +00005454 google_protobuf_EDITION_LEGACY = 900,
Protobuf Team Bot67038022023-10-04 04:14:37 +00005455 google_protobuf_EDITION_PROTO2 = 998,
5456 google_protobuf_EDITION_PROTO3 = 999,
Protobuf Team Botfa98bb32023-09-01 18:11:09 +00005457 google_protobuf_EDITION_2023 = 1000,
Protobuf Team Bot41c8f2a2024-01-11 00:10:17 +00005458 google_protobuf_EDITION_2024 = 1001,
Protobuf Team Botfa98bb32023-09-01 18:11:09 +00005459 google_protobuf_EDITION_99997_TEST_ONLY = 99997,
5460 google_protobuf_EDITION_99998_TEST_ONLY = 99998,
Protobuf Team Botde57b672023-11-30 22:16:47 +00005461 google_protobuf_EDITION_99999_TEST_ONLY = 99999,
5462 google_protobuf_EDITION_MAX = 2147483647
Protobuf Team Botfa98bb32023-09-01 18:11:09 +00005463} google_protobuf_Edition;
5464
5465typedef enum {
Protobuf Team Bot469f0272023-04-21 18:12:45 -07005466 google_protobuf_ExtensionRangeOptions_DECLARATION = 0,
5467 google_protobuf_ExtensionRangeOptions_UNVERIFIED = 1
5468} google_protobuf_ExtensionRangeOptions_VerificationState;
5469
5470typedef enum {
Mike Kruskal4f9e4172023-06-30 20:14:50 -07005471 google_protobuf_FeatureSet_ENUM_TYPE_UNKNOWN = 0,
5472 google_protobuf_FeatureSet_OPEN = 1,
5473 google_protobuf_FeatureSet_CLOSED = 2
5474} google_protobuf_FeatureSet_EnumType;
5475
5476typedef enum {
5477 google_protobuf_FeatureSet_FIELD_PRESENCE_UNKNOWN = 0,
5478 google_protobuf_FeatureSet_EXPLICIT = 1,
5479 google_protobuf_FeatureSet_IMPLICIT = 2,
5480 google_protobuf_FeatureSet_LEGACY_REQUIRED = 3
5481} google_protobuf_FeatureSet_FieldPresence;
5482
5483typedef enum {
5484 google_protobuf_FeatureSet_JSON_FORMAT_UNKNOWN = 0,
5485 google_protobuf_FeatureSet_ALLOW = 1,
5486 google_protobuf_FeatureSet_LEGACY_BEST_EFFORT = 2
5487} google_protobuf_FeatureSet_JsonFormat;
5488
5489typedef enum {
5490 google_protobuf_FeatureSet_MESSAGE_ENCODING_UNKNOWN = 0,
5491 google_protobuf_FeatureSet_LENGTH_PREFIXED = 1,
5492 google_protobuf_FeatureSet_DELIMITED = 2
5493} google_protobuf_FeatureSet_MessageEncoding;
5494
5495typedef enum {
5496 google_protobuf_FeatureSet_REPEATED_FIELD_ENCODING_UNKNOWN = 0,
5497 google_protobuf_FeatureSet_PACKED = 1,
5498 google_protobuf_FeatureSet_EXPANDED = 2
5499} google_protobuf_FeatureSet_RepeatedFieldEncoding;
5500
5501typedef enum {
Protobuf Team Bot61127952023-09-26 20:07:33 +00005502 google_protobuf_FeatureSet_UTF8_VALIDATION_UNKNOWN = 0,
Protobuf Team Bot5b8b87f2023-11-30 05:12:08 +00005503 google_protobuf_FeatureSet_VERIFY = 2,
5504 google_protobuf_FeatureSet_NONE = 3
Protobuf Team Bot61127952023-09-26 20:07:33 +00005505} google_protobuf_FeatureSet_Utf8Validation;
5506
5507typedef enum {
Mike Kruskalccbdaa72023-02-02 20:42:14 -08005508 google_protobuf_FieldDescriptorProto_LABEL_OPTIONAL = 1,
5509 google_protobuf_FieldDescriptorProto_LABEL_REQUIRED = 2,
5510 google_protobuf_FieldDescriptorProto_LABEL_REPEATED = 3
5511} google_protobuf_FieldDescriptorProto_Label;
5512
5513typedef enum {
Joshua Haberman9abf6e22021-01-13 12:16:25 -08005514 google_protobuf_FieldDescriptorProto_TYPE_DOUBLE = 1,
5515 google_protobuf_FieldDescriptorProto_TYPE_FLOAT = 2,
5516 google_protobuf_FieldDescriptorProto_TYPE_INT64 = 3,
5517 google_protobuf_FieldDescriptorProto_TYPE_UINT64 = 4,
5518 google_protobuf_FieldDescriptorProto_TYPE_INT32 = 5,
5519 google_protobuf_FieldDescriptorProto_TYPE_FIXED64 = 6,
5520 google_protobuf_FieldDescriptorProto_TYPE_FIXED32 = 7,
5521 google_protobuf_FieldDescriptorProto_TYPE_BOOL = 8,
5522 google_protobuf_FieldDescriptorProto_TYPE_STRING = 9,
5523 google_protobuf_FieldDescriptorProto_TYPE_GROUP = 10,
5524 google_protobuf_FieldDescriptorProto_TYPE_MESSAGE = 11,
5525 google_protobuf_FieldDescriptorProto_TYPE_BYTES = 12,
5526 google_protobuf_FieldDescriptorProto_TYPE_UINT32 = 13,
5527 google_protobuf_FieldDescriptorProto_TYPE_ENUM = 14,
5528 google_protobuf_FieldDescriptorProto_TYPE_SFIXED32 = 15,
5529 google_protobuf_FieldDescriptorProto_TYPE_SFIXED64 = 16,
5530 google_protobuf_FieldDescriptorProto_TYPE_SINT32 = 17,
5531 google_protobuf_FieldDescriptorProto_TYPE_SINT64 = 18
5532} google_protobuf_FieldDescriptorProto_Type;
5533
5534typedef enum {
5535 google_protobuf_FieldOptions_STRING = 0,
5536 google_protobuf_FieldOptions_CORD = 1,
5537 google_protobuf_FieldOptions_STRING_PIECE = 2
5538} google_protobuf_FieldOptions_CType;
5539
5540typedef enum {
5541 google_protobuf_FieldOptions_JS_NORMAL = 0,
5542 google_protobuf_FieldOptions_JS_STRING = 1,
5543 google_protobuf_FieldOptions_JS_NUMBER = 2
5544} google_protobuf_FieldOptions_JSType;
5545
5546typedef enum {
Adam Cozzette90ff32c2023-01-21 15:04:56 -08005547 google_protobuf_FieldOptions_RETENTION_UNKNOWN = 0,
5548 google_protobuf_FieldOptions_RETENTION_RUNTIME = 1,
5549 google_protobuf_FieldOptions_RETENTION_SOURCE = 2
5550} google_protobuf_FieldOptions_OptionRetention;
5551
5552typedef enum {
5553 google_protobuf_FieldOptions_TARGET_TYPE_UNKNOWN = 0,
5554 google_protobuf_FieldOptions_TARGET_TYPE_FILE = 1,
5555 google_protobuf_FieldOptions_TARGET_TYPE_EXTENSION_RANGE = 2,
5556 google_protobuf_FieldOptions_TARGET_TYPE_MESSAGE = 3,
5557 google_protobuf_FieldOptions_TARGET_TYPE_FIELD = 4,
5558 google_protobuf_FieldOptions_TARGET_TYPE_ONEOF = 5,
5559 google_protobuf_FieldOptions_TARGET_TYPE_ENUM = 6,
5560 google_protobuf_FieldOptions_TARGET_TYPE_ENUM_ENTRY = 7,
5561 google_protobuf_FieldOptions_TARGET_TYPE_SERVICE = 8,
5562 google_protobuf_FieldOptions_TARGET_TYPE_METHOD = 9
5563} google_protobuf_FieldOptions_OptionTargetType;
5564
5565typedef enum {
Mike Kruskalccbdaa72023-02-02 20:42:14 -08005566 google_protobuf_FileOptions_SPEED = 1,
5567 google_protobuf_FileOptions_CODE_SIZE = 2,
5568 google_protobuf_FileOptions_LITE_RUNTIME = 3
5569} google_protobuf_FileOptions_OptimizeMode;
Joshua Haberman9abf6e22021-01-13 12:16:25 -08005570
5571typedef enum {
Joshua Habermand3995ec2022-09-30 16:54:39 -07005572 google_protobuf_GeneratedCodeInfo_Annotation_NONE = 0,
5573 google_protobuf_GeneratedCodeInfo_Annotation_SET = 1,
5574 google_protobuf_GeneratedCodeInfo_Annotation_ALIAS = 2
5575} google_protobuf_GeneratedCodeInfo_Annotation_Semantic;
5576
Mike Kruskalccbdaa72023-02-02 20:42:14 -08005577typedef enum {
5578 google_protobuf_MethodOptions_IDEMPOTENCY_UNKNOWN = 0,
5579 google_protobuf_MethodOptions_NO_SIDE_EFFECTS = 1,
5580 google_protobuf_MethodOptions_IDEMPOTENT = 2
5581} google_protobuf_MethodOptions_IdempotencyLevel;
Joshua Haberman9abf6e22021-01-13 12:16:25 -08005582
Mike Kruskalccbdaa72023-02-02 20:42:14 -08005583
Joshua Habermanf41049a2022-01-21 14:41:25 -08005584
Joshua Haberman9abf6e22021-01-13 12:16:25 -08005585/* google.protobuf.FileDescriptorSet */
5586
Joshua Habermanf41049a2022-01-21 14:41:25 -08005587UPB_INLINE google_protobuf_FileDescriptorSet* google_protobuf_FileDescriptorSet_new(upb_Arena* arena) {
Protobuf Team Bot4ffe0862023-12-06 02:02:36 +00005588 return (google_protobuf_FileDescriptorSet*)_upb_Message_New(&google__protobuf__FileDescriptorSet_msg_init, arena);
Joshua Haberman9abf6e22021-01-13 12:16:25 -08005589}
Joshua Habermanf41049a2022-01-21 14:41:25 -08005590UPB_INLINE google_protobuf_FileDescriptorSet* google_protobuf_FileDescriptorSet_parse(const char* buf, size_t size, upb_Arena* arena) {
5591 google_protobuf_FileDescriptorSet* ret = google_protobuf_FileDescriptorSet_new(arena);
Joshua Haberman9d578a32021-08-02 15:32:01 -07005592 if (!ret) return NULL;
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +00005593 if (upb_Decode(buf, size, UPB_UPCAST(ret), &google__protobuf__FileDescriptorSet_msg_init, NULL, 0, arena) !=
5594 kUpb_DecodeStatus_Ok) {
Joshua Haberman9d578a32021-08-02 15:32:01 -07005595 return NULL;
5596 }
5597 return ret;
Joshua Haberman9abf6e22021-01-13 12:16:25 -08005598}
Joshua Habermanf41049a2022-01-21 14:41:25 -08005599UPB_INLINE google_protobuf_FileDescriptorSet* google_protobuf_FileDescriptorSet_parse_ex(const char* buf, size_t size,
5600 const upb_ExtensionRegistry* extreg,
5601 int options, upb_Arena* arena) {
5602 google_protobuf_FileDescriptorSet* ret = google_protobuf_FileDescriptorSet_new(arena);
5603 if (!ret) return NULL;
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +00005604 if (upb_Decode(buf, size, UPB_UPCAST(ret), &google__protobuf__FileDescriptorSet_msg_init, extreg, options,
5605 arena) != kUpb_DecodeStatus_Ok) {
Joshua Habermanf41049a2022-01-21 14:41:25 -08005606 return NULL;
5607 }
5608 return ret;
Joshua Haberman9abf6e22021-01-13 12:16:25 -08005609}
Joshua Habermanf41049a2022-01-21 14:41:25 -08005610UPB_INLINE char* google_protobuf_FileDescriptorSet_serialize(const google_protobuf_FileDescriptorSet* msg, upb_Arena* arena, size_t* len) {
Joshua Habermand3995ec2022-09-30 16:54:39 -07005611 char* ptr;
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +00005612 (void)upb_Encode(UPB_UPCAST(msg), &google__protobuf__FileDescriptorSet_msg_init, 0, arena, &ptr, len);
Joshua Habermand3995ec2022-09-30 16:54:39 -07005613 return ptr;
Joshua Habermanf41049a2022-01-21 14:41:25 -08005614}
5615UPB_INLINE char* google_protobuf_FileDescriptorSet_serialize_ex(const google_protobuf_FileDescriptorSet* msg, int options,
5616 upb_Arena* arena, size_t* len) {
Joshua Habermand3995ec2022-09-30 16:54:39 -07005617 char* ptr;
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +00005618 (void)upb_Encode(UPB_UPCAST(msg), &google__protobuf__FileDescriptorSet_msg_init, options, arena, &ptr, len);
Joshua Habermand3995ec2022-09-30 16:54:39 -07005619 return ptr;
Joshua Habermanf41049a2022-01-21 14:41:25 -08005620}
Mike Kruskal3bc50492022-12-01 13:34:12 -08005621UPB_INLINE void google_protobuf_FileDescriptorSet_clear_file(google_protobuf_FileDescriptorSet* msg) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00005622 const upb_MiniTableField field = {1, 8, 0, 0, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
Protobuf Team Bot4e90ead2024-01-08 15:46:34 +00005623 upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
Joshua Habermand3995ec2022-09-30 16:54:39 -07005624}
Eric Salob7d54ac2022-12-29 11:59:42 -08005625UPB_INLINE const google_protobuf_FileDescriptorProto* const* google_protobuf_FileDescriptorSet_file(const google_protobuf_FileDescriptorSet* msg, size_t* size) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00005626 const upb_MiniTableField field = {1, 8, 0, 0, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
Protobuf Team Bota9387b52024-06-12 15:17:52 +00005627 UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__FileDescriptorProto_msg_init);
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +00005628 const upb_Array* arr = upb_Message_GetArray(UPB_UPCAST(msg), &field);
Eric Salob7d54ac2022-12-29 11:59:42 -08005629 if (arr) {
Protobuf Team Botf73985a2023-12-19 00:14:19 +00005630 if (size) *size = arr->UPB_PRIVATE(size);
Protobuf Team Bot81e54332024-01-11 21:04:07 +00005631 return (const google_protobuf_FileDescriptorProto* const*)upb_Array_DataPtr(arr);
Eric Salob7d54ac2022-12-29 11:59:42 -08005632 } else {
5633 if (size) *size = 0;
5634 return NULL;
5635 }
Joshua Haberman7ecf43f2022-03-14 13:11:29 -07005636}
Deanna Garciab26afb52023-04-25 13:37:18 -07005637UPB_INLINE const upb_Array* _google_protobuf_FileDescriptorSet_file_upb_array(const google_protobuf_FileDescriptorSet* msg, size_t* size) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00005638 const upb_MiniTableField field = {1, 8, 0, 0, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
Protobuf Team Bota9387b52024-06-12 15:17:52 +00005639 UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__FileDescriptorProto_msg_init);
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +00005640 const upb_Array* arr = upb_Message_GetArray(UPB_UPCAST(msg), &field);
Deanna Garciab26afb52023-04-25 13:37:18 -07005641 if (size) {
Protobuf Team Botf73985a2023-12-19 00:14:19 +00005642 *size = arr ? arr->UPB_PRIVATE(size) : 0;
Deanna Garciab26afb52023-04-25 13:37:18 -07005643 }
5644 return arr;
5645}
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +00005646UPB_INLINE upb_Array* _google_protobuf_FileDescriptorSet_file_mutable_upb_array(google_protobuf_FileDescriptorSet* msg, size_t* size, upb_Arena* arena) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00005647 const upb_MiniTableField field = {1, 8, 0, 0, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
Protobuf Team Bota9387b52024-06-12 15:17:52 +00005648 UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__FileDescriptorProto_msg_init);
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +00005649 upb_Array* arr = upb_Message_GetOrCreateMutableArray(UPB_UPCAST(msg),
5650 &field, arena);
Deanna Garciab26afb52023-04-25 13:37:18 -07005651 if (size) {
Protobuf Team Botf73985a2023-12-19 00:14:19 +00005652 *size = arr ? arr->UPB_PRIVATE(size) : 0;
Deanna Garciab26afb52023-04-25 13:37:18 -07005653 }
5654 return arr;
5655}
Joshua Haberman9abf6e22021-01-13 12:16:25 -08005656
Eric Salob7d54ac2022-12-29 11:59:42 -08005657UPB_INLINE google_protobuf_FileDescriptorProto** google_protobuf_FileDescriptorSet_mutable_file(google_protobuf_FileDescriptorSet* msg, size_t* size) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00005658 upb_MiniTableField field = {1, 8, 0, 0, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
Protobuf Team Bota9387b52024-06-12 15:17:52 +00005659 UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__FileDescriptorProto_msg_init);
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +00005660 upb_Array* arr = upb_Message_GetMutableArray(UPB_UPCAST(msg), &field);
Eric Salob7d54ac2022-12-29 11:59:42 -08005661 if (arr) {
Protobuf Team Botf73985a2023-12-19 00:14:19 +00005662 if (size) *size = arr->UPB_PRIVATE(size);
Protobuf Team Bot81e54332024-01-11 21:04:07 +00005663 return (google_protobuf_FileDescriptorProto**)upb_Array_MutableDataPtr(arr);
Eric Salob7d54ac2022-12-29 11:59:42 -08005664 } else {
5665 if (size) *size = 0;
5666 return NULL;
5667 }
Joshua Haberman9abf6e22021-01-13 12:16:25 -08005668}
Eric Salob7d54ac2022-12-29 11:59:42 -08005669UPB_INLINE google_protobuf_FileDescriptorProto** google_protobuf_FileDescriptorSet_resize_file(google_protobuf_FileDescriptorSet* msg, size_t size, upb_Arena* arena) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00005670 upb_MiniTableField field = {1, 8, 0, 0, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +00005671 return (google_protobuf_FileDescriptorProto**)upb_Message_ResizeArrayUninitialized(UPB_UPCAST(msg),
5672 &field, size, arena);
Joshua Haberman9abf6e22021-01-13 12:16:25 -08005673}
Joshua Haberman7ecf43f2022-03-14 13:11:29 -07005674UPB_INLINE struct google_protobuf_FileDescriptorProto* google_protobuf_FileDescriptorSet_add_file(google_protobuf_FileDescriptorSet* msg, upb_Arena* arena) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00005675 upb_MiniTableField field = {1, 8, 0, 0, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
Protobuf Team Bota9387b52024-06-12 15:17:52 +00005676 UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__FileDescriptorProto_msg_init);
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +00005677 upb_Array* arr = upb_Message_GetOrCreateMutableArray(
5678 UPB_UPCAST(msg), &field, arena);
Protobuf Team Bot81e54332024-01-11 21:04:07 +00005679 if (!arr || !UPB_PRIVATE(_upb_Array_ResizeUninitialized)(
Protobuf Team Botf73985a2023-12-19 00:14:19 +00005680 arr, arr->UPB_PRIVATE(size) + 1, arena)) {
Eric Salob7d54ac2022-12-29 11:59:42 -08005681 return NULL;
5682 }
Protobuf Team Bot4ffe0862023-12-06 02:02:36 +00005683 struct google_protobuf_FileDescriptorProto* sub = (struct google_protobuf_FileDescriptorProto*)_upb_Message_New(&google__protobuf__FileDescriptorProto_msg_init, arena);
Eric Salob7d54ac2022-12-29 11:59:42 -08005684 if (!arr || !sub) return NULL;
Protobuf Team Botf73985a2023-12-19 00:14:19 +00005685 UPB_PRIVATE(_upb_Array_Set)
5686 (arr, arr->UPB_PRIVATE(size) - 1, &sub, sizeof(sub));
Joshua Haberman9abf6e22021-01-13 12:16:25 -08005687 return sub;
5688}
5689
5690/* google.protobuf.FileDescriptorProto */
5691
Joshua Habermanf41049a2022-01-21 14:41:25 -08005692UPB_INLINE google_protobuf_FileDescriptorProto* google_protobuf_FileDescriptorProto_new(upb_Arena* arena) {
Protobuf Team Bot4ffe0862023-12-06 02:02:36 +00005693 return (google_protobuf_FileDescriptorProto*)_upb_Message_New(&google__protobuf__FileDescriptorProto_msg_init, arena);
Joshua Haberman9abf6e22021-01-13 12:16:25 -08005694}
Joshua Habermanf41049a2022-01-21 14:41:25 -08005695UPB_INLINE google_protobuf_FileDescriptorProto* google_protobuf_FileDescriptorProto_parse(const char* buf, size_t size, upb_Arena* arena) {
5696 google_protobuf_FileDescriptorProto* ret = google_protobuf_FileDescriptorProto_new(arena);
Joshua Haberman9d578a32021-08-02 15:32:01 -07005697 if (!ret) return NULL;
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +00005698 if (upb_Decode(buf, size, UPB_UPCAST(ret), &google__protobuf__FileDescriptorProto_msg_init, NULL, 0, arena) !=
5699 kUpb_DecodeStatus_Ok) {
Joshua Haberman9d578a32021-08-02 15:32:01 -07005700 return NULL;
5701 }
5702 return ret;
Joshua Haberman9abf6e22021-01-13 12:16:25 -08005703}
Joshua Habermanf41049a2022-01-21 14:41:25 -08005704UPB_INLINE google_protobuf_FileDescriptorProto* google_protobuf_FileDescriptorProto_parse_ex(const char* buf, size_t size,
5705 const upb_ExtensionRegistry* extreg,
5706 int options, upb_Arena* arena) {
5707 google_protobuf_FileDescriptorProto* ret = google_protobuf_FileDescriptorProto_new(arena);
5708 if (!ret) return NULL;
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +00005709 if (upb_Decode(buf, size, UPB_UPCAST(ret), &google__protobuf__FileDescriptorProto_msg_init, extreg, options,
5710 arena) != kUpb_DecodeStatus_Ok) {
Joshua Habermanf41049a2022-01-21 14:41:25 -08005711 return NULL;
5712 }
5713 return ret;
Joshua Haberman9abf6e22021-01-13 12:16:25 -08005714}
Joshua Habermanf41049a2022-01-21 14:41:25 -08005715UPB_INLINE char* google_protobuf_FileDescriptorProto_serialize(const google_protobuf_FileDescriptorProto* msg, upb_Arena* arena, size_t* len) {
Joshua Habermand3995ec2022-09-30 16:54:39 -07005716 char* ptr;
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +00005717 (void)upb_Encode(UPB_UPCAST(msg), &google__protobuf__FileDescriptorProto_msg_init, 0, arena, &ptr, len);
Joshua Habermand3995ec2022-09-30 16:54:39 -07005718 return ptr;
Joshua Habermanf41049a2022-01-21 14:41:25 -08005719}
5720UPB_INLINE char* google_protobuf_FileDescriptorProto_serialize_ex(const google_protobuf_FileDescriptorProto* msg, int options,
5721 upb_Arena* arena, size_t* len) {
Joshua Habermand3995ec2022-09-30 16:54:39 -07005722 char* ptr;
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +00005723 (void)upb_Encode(UPB_UPCAST(msg), &google__protobuf__FileDescriptorProto_msg_init, options, arena, &ptr, len);
Joshua Habermand3995ec2022-09-30 16:54:39 -07005724 return ptr;
Joshua Habermanf41049a2022-01-21 14:41:25 -08005725}
Mike Kruskal3bc50492022-12-01 13:34:12 -08005726UPB_INLINE void google_protobuf_FileDescriptorProto_clear_name(google_protobuf_FileDescriptorProto* msg) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00005727 const upb_MiniTableField field = {1, UPB_SIZE(52, 16), 64, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
Protobuf Team Bot4e90ead2024-01-08 15:46:34 +00005728 upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
Joshua Habermand3995ec2022-09-30 16:54:39 -07005729}
Joshua Habermanf41049a2022-01-21 14:41:25 -08005730UPB_INLINE upb_StringView google_protobuf_FileDescriptorProto_name(const google_protobuf_FileDescriptorProto* msg) {
Eric Salo8809a112022-11-21 13:01:06 -08005731 upb_StringView default_val = upb_StringView_FromString("");
5732 upb_StringView ret;
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00005733 const upb_MiniTableField field = {1, UPB_SIZE(52, 16), 64, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +00005734 _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field,
5735 &default_val, &ret);
Eric Salo8809a112022-11-21 13:01:06 -08005736 return ret;
Joshua Habermanf41049a2022-01-21 14:41:25 -08005737}
Mike Kruskal3bc50492022-12-01 13:34:12 -08005738UPB_INLINE bool google_protobuf_FileDescriptorProto_has_name(const google_protobuf_FileDescriptorProto* msg) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00005739 const upb_MiniTableField field = {1, UPB_SIZE(52, 16), 64, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
Protobuf Team Bot8c1f6352024-01-10 05:18:15 +00005740 return upb_Message_HasBaseField(UPB_UPCAST(msg), &field);
Joshua Haberman7ecf43f2022-03-14 13:11:29 -07005741}
Mike Kruskal3bc50492022-12-01 13:34:12 -08005742UPB_INLINE void google_protobuf_FileDescriptorProto_clear_package(google_protobuf_FileDescriptorProto* msg) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00005743 const upb_MiniTableField field = {2, UPB_SIZE(60, 32), 65, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
Protobuf Team Bot4e90ead2024-01-08 15:46:34 +00005744 upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
Joshua Habermand3995ec2022-09-30 16:54:39 -07005745}
Joshua Habermanf41049a2022-01-21 14:41:25 -08005746UPB_INLINE upb_StringView google_protobuf_FileDescriptorProto_package(const google_protobuf_FileDescriptorProto* msg) {
Eric Salo8809a112022-11-21 13:01:06 -08005747 upb_StringView default_val = upb_StringView_FromString("");
5748 upb_StringView ret;
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00005749 const upb_MiniTableField field = {2, UPB_SIZE(60, 32), 65, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +00005750 _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field,
5751 &default_val, &ret);
Eric Salo8809a112022-11-21 13:01:06 -08005752 return ret;
Joshua Habermanf41049a2022-01-21 14:41:25 -08005753}
Mike Kruskal3bc50492022-12-01 13:34:12 -08005754UPB_INLINE bool google_protobuf_FileDescriptorProto_has_package(const google_protobuf_FileDescriptorProto* msg) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00005755 const upb_MiniTableField field = {2, UPB_SIZE(60, 32), 65, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
Protobuf Team Bot8c1f6352024-01-10 05:18:15 +00005756 return upb_Message_HasBaseField(UPB_UPCAST(msg), &field);
Mike Kruskal3bc50492022-12-01 13:34:12 -08005757}
5758UPB_INLINE void google_protobuf_FileDescriptorProto_clear_dependency(google_protobuf_FileDescriptorProto* msg) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00005759 const upb_MiniTableField field = {3, UPB_SIZE(12, 48), 0, kUpb_NoSub, 12, (int)kUpb_FieldMode_Array | (int)kUpb_LabelFlags_IsAlternate | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
Protobuf Team Bot4e90ead2024-01-08 15:46:34 +00005760 upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
Joshua Habermand3995ec2022-09-30 16:54:39 -07005761}
Eric Salob7d54ac2022-12-29 11:59:42 -08005762UPB_INLINE upb_StringView const* google_protobuf_FileDescriptorProto_dependency(const google_protobuf_FileDescriptorProto* msg, size_t* size) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00005763 const upb_MiniTableField field = {3, UPB_SIZE(12, 48), 0, kUpb_NoSub, 12, (int)kUpb_FieldMode_Array | (int)kUpb_LabelFlags_IsAlternate | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +00005764 const upb_Array* arr = upb_Message_GetArray(UPB_UPCAST(msg), &field);
Eric Salob7d54ac2022-12-29 11:59:42 -08005765 if (arr) {
Protobuf Team Botf73985a2023-12-19 00:14:19 +00005766 if (size) *size = arr->UPB_PRIVATE(size);
Protobuf Team Bot81e54332024-01-11 21:04:07 +00005767 return (upb_StringView const*)upb_Array_DataPtr(arr);
Eric Salob7d54ac2022-12-29 11:59:42 -08005768 } else {
5769 if (size) *size = 0;
5770 return NULL;
5771 }
Joshua Haberman7ecf43f2022-03-14 13:11:29 -07005772}
Deanna Garciab26afb52023-04-25 13:37:18 -07005773UPB_INLINE const upb_Array* _google_protobuf_FileDescriptorProto_dependency_upb_array(const google_protobuf_FileDescriptorProto* msg, size_t* size) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00005774 const upb_MiniTableField field = {3, UPB_SIZE(12, 48), 0, kUpb_NoSub, 12, (int)kUpb_FieldMode_Array | (int)kUpb_LabelFlags_IsAlternate | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +00005775 const upb_Array* arr = upb_Message_GetArray(UPB_UPCAST(msg), &field);
Deanna Garciab26afb52023-04-25 13:37:18 -07005776 if (size) {
Protobuf Team Botf73985a2023-12-19 00:14:19 +00005777 *size = arr ? arr->UPB_PRIVATE(size) : 0;
Deanna Garciab26afb52023-04-25 13:37:18 -07005778 }
5779 return arr;
5780}
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +00005781UPB_INLINE upb_Array* _google_protobuf_FileDescriptorProto_dependency_mutable_upb_array(google_protobuf_FileDescriptorProto* msg, size_t* size, upb_Arena* arena) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00005782 const upb_MiniTableField field = {3, UPB_SIZE(12, 48), 0, kUpb_NoSub, 12, (int)kUpb_FieldMode_Array | (int)kUpb_LabelFlags_IsAlternate | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +00005783 upb_Array* arr = upb_Message_GetOrCreateMutableArray(UPB_UPCAST(msg),
5784 &field, arena);
Deanna Garciab26afb52023-04-25 13:37:18 -07005785 if (size) {
Protobuf Team Botf73985a2023-12-19 00:14:19 +00005786 *size = arr ? arr->UPB_PRIVATE(size) : 0;
Deanna Garciab26afb52023-04-25 13:37:18 -07005787 }
5788 return arr;
5789}
Mike Kruskal3bc50492022-12-01 13:34:12 -08005790UPB_INLINE void google_protobuf_FileDescriptorProto_clear_message_type(google_protobuf_FileDescriptorProto* msg) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00005791 const upb_MiniTableField field = {4, UPB_SIZE(16, 56), 0, 0, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
Protobuf Team Bot4e90ead2024-01-08 15:46:34 +00005792 upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
Joshua Haberman7ecf43f2022-03-14 13:11:29 -07005793}
Eric Salob7d54ac2022-12-29 11:59:42 -08005794UPB_INLINE const google_protobuf_DescriptorProto* const* google_protobuf_FileDescriptorProto_message_type(const google_protobuf_FileDescriptorProto* msg, size_t* size) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00005795 const upb_MiniTableField field = {4, UPB_SIZE(16, 56), 0, 0, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
Protobuf Team Bota9387b52024-06-12 15:17:52 +00005796 UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__DescriptorProto_msg_init);
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +00005797 const upb_Array* arr = upb_Message_GetArray(UPB_UPCAST(msg), &field);
Eric Salob7d54ac2022-12-29 11:59:42 -08005798 if (arr) {
Protobuf Team Botf73985a2023-12-19 00:14:19 +00005799 if (size) *size = arr->UPB_PRIVATE(size);
Protobuf Team Bot81e54332024-01-11 21:04:07 +00005800 return (const google_protobuf_DescriptorProto* const*)upb_Array_DataPtr(arr);
Eric Salob7d54ac2022-12-29 11:59:42 -08005801 } else {
5802 if (size) *size = 0;
5803 return NULL;
5804 }
Joshua Haberman7ecf43f2022-03-14 13:11:29 -07005805}
Deanna Garciab26afb52023-04-25 13:37:18 -07005806UPB_INLINE const upb_Array* _google_protobuf_FileDescriptorProto_message_type_upb_array(const google_protobuf_FileDescriptorProto* msg, size_t* size) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00005807 const upb_MiniTableField field = {4, UPB_SIZE(16, 56), 0, 0, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
Protobuf Team Bota9387b52024-06-12 15:17:52 +00005808 UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__DescriptorProto_msg_init);
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +00005809 const upb_Array* arr = upb_Message_GetArray(UPB_UPCAST(msg), &field);
Deanna Garciab26afb52023-04-25 13:37:18 -07005810 if (size) {
Protobuf Team Botf73985a2023-12-19 00:14:19 +00005811 *size = arr ? arr->UPB_PRIVATE(size) : 0;
Deanna Garciab26afb52023-04-25 13:37:18 -07005812 }
5813 return arr;
5814}
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +00005815UPB_INLINE upb_Array* _google_protobuf_FileDescriptorProto_message_type_mutable_upb_array(google_protobuf_FileDescriptorProto* msg, size_t* size, upb_Arena* arena) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00005816 const upb_MiniTableField field = {4, UPB_SIZE(16, 56), 0, 0, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
Protobuf Team Bota9387b52024-06-12 15:17:52 +00005817 UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__DescriptorProto_msg_init);
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +00005818 upb_Array* arr = upb_Message_GetOrCreateMutableArray(UPB_UPCAST(msg),
5819 &field, arena);
Deanna Garciab26afb52023-04-25 13:37:18 -07005820 if (size) {
Protobuf Team Botf73985a2023-12-19 00:14:19 +00005821 *size = arr ? arr->UPB_PRIVATE(size) : 0;
Deanna Garciab26afb52023-04-25 13:37:18 -07005822 }
5823 return arr;
5824}
Mike Kruskal3bc50492022-12-01 13:34:12 -08005825UPB_INLINE void google_protobuf_FileDescriptorProto_clear_enum_type(google_protobuf_FileDescriptorProto* msg) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00005826 const upb_MiniTableField field = {5, UPB_SIZE(20, 64), 0, 1, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
Protobuf Team Bot4e90ead2024-01-08 15:46:34 +00005827 upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
Joshua Haberman7ecf43f2022-03-14 13:11:29 -07005828}
Eric Salob7d54ac2022-12-29 11:59:42 -08005829UPB_INLINE const google_protobuf_EnumDescriptorProto* const* google_protobuf_FileDescriptorProto_enum_type(const google_protobuf_FileDescriptorProto* msg, size_t* size) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00005830 const upb_MiniTableField field = {5, UPB_SIZE(20, 64), 0, 1, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
Protobuf Team Bota9387b52024-06-12 15:17:52 +00005831 UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__EnumDescriptorProto_msg_init);
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +00005832 const upb_Array* arr = upb_Message_GetArray(UPB_UPCAST(msg), &field);
Eric Salob7d54ac2022-12-29 11:59:42 -08005833 if (arr) {
Protobuf Team Botf73985a2023-12-19 00:14:19 +00005834 if (size) *size = arr->UPB_PRIVATE(size);
Protobuf Team Bot81e54332024-01-11 21:04:07 +00005835 return (const google_protobuf_EnumDescriptorProto* const*)upb_Array_DataPtr(arr);
Eric Salob7d54ac2022-12-29 11:59:42 -08005836 } else {
5837 if (size) *size = 0;
5838 return NULL;
5839 }
Joshua Haberman7ecf43f2022-03-14 13:11:29 -07005840}
Deanna Garciab26afb52023-04-25 13:37:18 -07005841UPB_INLINE const upb_Array* _google_protobuf_FileDescriptorProto_enum_type_upb_array(const google_protobuf_FileDescriptorProto* msg, size_t* size) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00005842 const upb_MiniTableField field = {5, UPB_SIZE(20, 64), 0, 1, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
Protobuf Team Bota9387b52024-06-12 15:17:52 +00005843 UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__EnumDescriptorProto_msg_init);
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +00005844 const upb_Array* arr = upb_Message_GetArray(UPB_UPCAST(msg), &field);
Deanna Garciab26afb52023-04-25 13:37:18 -07005845 if (size) {
Protobuf Team Botf73985a2023-12-19 00:14:19 +00005846 *size = arr ? arr->UPB_PRIVATE(size) : 0;
Deanna Garciab26afb52023-04-25 13:37:18 -07005847 }
5848 return arr;
5849}
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +00005850UPB_INLINE upb_Array* _google_protobuf_FileDescriptorProto_enum_type_mutable_upb_array(google_protobuf_FileDescriptorProto* msg, size_t* size, upb_Arena* arena) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00005851 const upb_MiniTableField field = {5, UPB_SIZE(20, 64), 0, 1, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
Protobuf Team Bota9387b52024-06-12 15:17:52 +00005852 UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__EnumDescriptorProto_msg_init);
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +00005853 upb_Array* arr = upb_Message_GetOrCreateMutableArray(UPB_UPCAST(msg),
5854 &field, arena);
Deanna Garciab26afb52023-04-25 13:37:18 -07005855 if (size) {
Protobuf Team Botf73985a2023-12-19 00:14:19 +00005856 *size = arr ? arr->UPB_PRIVATE(size) : 0;
Deanna Garciab26afb52023-04-25 13:37:18 -07005857 }
5858 return arr;
5859}
Mike Kruskal3bc50492022-12-01 13:34:12 -08005860UPB_INLINE void google_protobuf_FileDescriptorProto_clear_service(google_protobuf_FileDescriptorProto* msg) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00005861 const upb_MiniTableField field = {6, UPB_SIZE(24, 72), 0, 2, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
Protobuf Team Bot4e90ead2024-01-08 15:46:34 +00005862 upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
Joshua Haberman7ecf43f2022-03-14 13:11:29 -07005863}
Eric Salob7d54ac2022-12-29 11:59:42 -08005864UPB_INLINE const google_protobuf_ServiceDescriptorProto* const* google_protobuf_FileDescriptorProto_service(const google_protobuf_FileDescriptorProto* msg, size_t* size) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00005865 const upb_MiniTableField field = {6, UPB_SIZE(24, 72), 0, 2, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
Protobuf Team Bota9387b52024-06-12 15:17:52 +00005866 UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__ServiceDescriptorProto_msg_init);
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +00005867 const upb_Array* arr = upb_Message_GetArray(UPB_UPCAST(msg), &field);
Eric Salob7d54ac2022-12-29 11:59:42 -08005868 if (arr) {
Protobuf Team Botf73985a2023-12-19 00:14:19 +00005869 if (size) *size = arr->UPB_PRIVATE(size);
Protobuf Team Bot81e54332024-01-11 21:04:07 +00005870 return (const google_protobuf_ServiceDescriptorProto* const*)upb_Array_DataPtr(arr);
Eric Salob7d54ac2022-12-29 11:59:42 -08005871 } else {
5872 if (size) *size = 0;
5873 return NULL;
5874 }
Joshua Haberman7ecf43f2022-03-14 13:11:29 -07005875}
Deanna Garciab26afb52023-04-25 13:37:18 -07005876UPB_INLINE const upb_Array* _google_protobuf_FileDescriptorProto_service_upb_array(const google_protobuf_FileDescriptorProto* msg, size_t* size) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00005877 const upb_MiniTableField field = {6, UPB_SIZE(24, 72), 0, 2, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
Protobuf Team Bota9387b52024-06-12 15:17:52 +00005878 UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__ServiceDescriptorProto_msg_init);
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +00005879 const upb_Array* arr = upb_Message_GetArray(UPB_UPCAST(msg), &field);
Deanna Garciab26afb52023-04-25 13:37:18 -07005880 if (size) {
Protobuf Team Botf73985a2023-12-19 00:14:19 +00005881 *size = arr ? arr->UPB_PRIVATE(size) : 0;
Deanna Garciab26afb52023-04-25 13:37:18 -07005882 }
5883 return arr;
5884}
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +00005885UPB_INLINE upb_Array* _google_protobuf_FileDescriptorProto_service_mutable_upb_array(google_protobuf_FileDescriptorProto* msg, size_t* size, upb_Arena* arena) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00005886 const upb_MiniTableField field = {6, UPB_SIZE(24, 72), 0, 2, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
Protobuf Team Bota9387b52024-06-12 15:17:52 +00005887 UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__ServiceDescriptorProto_msg_init);
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +00005888 upb_Array* arr = upb_Message_GetOrCreateMutableArray(UPB_UPCAST(msg),
5889 &field, arena);
Deanna Garciab26afb52023-04-25 13:37:18 -07005890 if (size) {
Protobuf Team Botf73985a2023-12-19 00:14:19 +00005891 *size = arr ? arr->UPB_PRIVATE(size) : 0;
Deanna Garciab26afb52023-04-25 13:37:18 -07005892 }
5893 return arr;
5894}
Mike Kruskal3bc50492022-12-01 13:34:12 -08005895UPB_INLINE void google_protobuf_FileDescriptorProto_clear_extension(google_protobuf_FileDescriptorProto* msg) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00005896 const upb_MiniTableField field = {7, UPB_SIZE(28, 80), 0, 3, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
Protobuf Team Bot4e90ead2024-01-08 15:46:34 +00005897 upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
Joshua Haberman7ecf43f2022-03-14 13:11:29 -07005898}
Eric Salob7d54ac2022-12-29 11:59:42 -08005899UPB_INLINE const google_protobuf_FieldDescriptorProto* const* google_protobuf_FileDescriptorProto_extension(const google_protobuf_FileDescriptorProto* msg, size_t* size) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00005900 const upb_MiniTableField field = {7, UPB_SIZE(28, 80), 0, 3, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
Protobuf Team Bota9387b52024-06-12 15:17:52 +00005901 UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__FieldDescriptorProto_msg_init);
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +00005902 const upb_Array* arr = upb_Message_GetArray(UPB_UPCAST(msg), &field);
Eric Salob7d54ac2022-12-29 11:59:42 -08005903 if (arr) {
Protobuf Team Botf73985a2023-12-19 00:14:19 +00005904 if (size) *size = arr->UPB_PRIVATE(size);
Protobuf Team Bot81e54332024-01-11 21:04:07 +00005905 return (const google_protobuf_FieldDescriptorProto* const*)upb_Array_DataPtr(arr);
Eric Salob7d54ac2022-12-29 11:59:42 -08005906 } else {
5907 if (size) *size = 0;
5908 return NULL;
5909 }
Joshua Haberman7ecf43f2022-03-14 13:11:29 -07005910}
Deanna Garciab26afb52023-04-25 13:37:18 -07005911UPB_INLINE const upb_Array* _google_protobuf_FileDescriptorProto_extension_upb_array(const google_protobuf_FileDescriptorProto* msg, size_t* size) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00005912 const upb_MiniTableField field = {7, UPB_SIZE(28, 80), 0, 3, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
Protobuf Team Bota9387b52024-06-12 15:17:52 +00005913 UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__FieldDescriptorProto_msg_init);
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +00005914 const upb_Array* arr = upb_Message_GetArray(UPB_UPCAST(msg), &field);
Deanna Garciab26afb52023-04-25 13:37:18 -07005915 if (size) {
Protobuf Team Botf73985a2023-12-19 00:14:19 +00005916 *size = arr ? arr->UPB_PRIVATE(size) : 0;
Deanna Garciab26afb52023-04-25 13:37:18 -07005917 }
5918 return arr;
5919}
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +00005920UPB_INLINE upb_Array* _google_protobuf_FileDescriptorProto_extension_mutable_upb_array(google_protobuf_FileDescriptorProto* msg, size_t* size, upb_Arena* arena) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00005921 const upb_MiniTableField field = {7, UPB_SIZE(28, 80), 0, 3, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
Protobuf Team Bota9387b52024-06-12 15:17:52 +00005922 UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__FieldDescriptorProto_msg_init);
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +00005923 upb_Array* arr = upb_Message_GetOrCreateMutableArray(UPB_UPCAST(msg),
5924 &field, arena);
Deanna Garciab26afb52023-04-25 13:37:18 -07005925 if (size) {
Protobuf Team Botf73985a2023-12-19 00:14:19 +00005926 *size = arr ? arr->UPB_PRIVATE(size) : 0;
Deanna Garciab26afb52023-04-25 13:37:18 -07005927 }
5928 return arr;
5929}
Mike Kruskal3bc50492022-12-01 13:34:12 -08005930UPB_INLINE void google_protobuf_FileDescriptorProto_clear_options(google_protobuf_FileDescriptorProto* msg) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00005931 const upb_MiniTableField field = {8, UPB_SIZE(32, 88), 66, 4, 11, (int)kUpb_FieldMode_Scalar | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
Protobuf Team Bot4e90ead2024-01-08 15:46:34 +00005932 upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
Joshua Habermand3995ec2022-09-30 16:54:39 -07005933}
Joshua Habermanf41049a2022-01-21 14:41:25 -08005934UPB_INLINE const google_protobuf_FileOptions* google_protobuf_FileDescriptorProto_options(const google_protobuf_FileDescriptorProto* msg) {
Eric Salo8809a112022-11-21 13:01:06 -08005935 const google_protobuf_FileOptions* default_val = NULL;
5936 const google_protobuf_FileOptions* ret;
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00005937 const upb_MiniTableField field = {8, UPB_SIZE(32, 88), 66, 4, 11, (int)kUpb_FieldMode_Scalar | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
Protobuf Team Bota9387b52024-06-12 15:17:52 +00005938 UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__FileOptions_msg_init);
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +00005939 _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field,
5940 &default_val, &ret);
Eric Salo8809a112022-11-21 13:01:06 -08005941 return ret;
Joshua Habermanf41049a2022-01-21 14:41:25 -08005942}
Mike Kruskal3bc50492022-12-01 13:34:12 -08005943UPB_INLINE bool google_protobuf_FileDescriptorProto_has_options(const google_protobuf_FileDescriptorProto* msg) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00005944 const upb_MiniTableField field = {8, UPB_SIZE(32, 88), 66, 4, 11, (int)kUpb_FieldMode_Scalar | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
Protobuf Team Bot8c1f6352024-01-10 05:18:15 +00005945 return upb_Message_HasBaseField(UPB_UPCAST(msg), &field);
Joshua Haberman7ecf43f2022-03-14 13:11:29 -07005946}
Mike Kruskal3bc50492022-12-01 13:34:12 -08005947UPB_INLINE void google_protobuf_FileDescriptorProto_clear_source_code_info(google_protobuf_FileDescriptorProto* msg) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00005948 const upb_MiniTableField field = {9, UPB_SIZE(36, 96), 67, 5, 11, (int)kUpb_FieldMode_Scalar | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
Protobuf Team Bot4e90ead2024-01-08 15:46:34 +00005949 upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
Joshua Habermand3995ec2022-09-30 16:54:39 -07005950}
Joshua Habermanf41049a2022-01-21 14:41:25 -08005951UPB_INLINE const google_protobuf_SourceCodeInfo* google_protobuf_FileDescriptorProto_source_code_info(const google_protobuf_FileDescriptorProto* msg) {
Eric Salo8809a112022-11-21 13:01:06 -08005952 const google_protobuf_SourceCodeInfo* default_val = NULL;
5953 const google_protobuf_SourceCodeInfo* ret;
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00005954 const upb_MiniTableField field = {9, UPB_SIZE(36, 96), 67, 5, 11, (int)kUpb_FieldMode_Scalar | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
Protobuf Team Bota9387b52024-06-12 15:17:52 +00005955 UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__SourceCodeInfo_msg_init);
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +00005956 _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field,
5957 &default_val, &ret);
Eric Salo8809a112022-11-21 13:01:06 -08005958 return ret;
Joshua Habermand3995ec2022-09-30 16:54:39 -07005959}
Mike Kruskal3bc50492022-12-01 13:34:12 -08005960UPB_INLINE bool google_protobuf_FileDescriptorProto_has_source_code_info(const google_protobuf_FileDescriptorProto* msg) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00005961 const upb_MiniTableField field = {9, UPB_SIZE(36, 96), 67, 5, 11, (int)kUpb_FieldMode_Scalar | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
Protobuf Team Bot8c1f6352024-01-10 05:18:15 +00005962 return upb_Message_HasBaseField(UPB_UPCAST(msg), &field);
Mike Kruskal3bc50492022-12-01 13:34:12 -08005963}
5964UPB_INLINE void google_protobuf_FileDescriptorProto_clear_public_dependency(google_protobuf_FileDescriptorProto* msg) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00005965 const upb_MiniTableField field = {10, UPB_SIZE(40, 104), 0, kUpb_NoSub, 5, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
Protobuf Team Bot4e90ead2024-01-08 15:46:34 +00005966 upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
Joshua Habermanf41049a2022-01-21 14:41:25 -08005967}
Eric Salob7d54ac2022-12-29 11:59:42 -08005968UPB_INLINE int32_t const* google_protobuf_FileDescriptorProto_public_dependency(const google_protobuf_FileDescriptorProto* msg, size_t* size) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00005969 const upb_MiniTableField field = {10, UPB_SIZE(40, 104), 0, kUpb_NoSub, 5, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +00005970 const upb_Array* arr = upb_Message_GetArray(UPB_UPCAST(msg), &field);
Eric Salob7d54ac2022-12-29 11:59:42 -08005971 if (arr) {
Protobuf Team Botf73985a2023-12-19 00:14:19 +00005972 if (size) *size = arr->UPB_PRIVATE(size);
Protobuf Team Bot81e54332024-01-11 21:04:07 +00005973 return (int32_t const*)upb_Array_DataPtr(arr);
Eric Salob7d54ac2022-12-29 11:59:42 -08005974 } else {
5975 if (size) *size = 0;
5976 return NULL;
5977 }
Joshua Habermand3995ec2022-09-30 16:54:39 -07005978}
Deanna Garciab26afb52023-04-25 13:37:18 -07005979UPB_INLINE const upb_Array* _google_protobuf_FileDescriptorProto_public_dependency_upb_array(const google_protobuf_FileDescriptorProto* msg, size_t* size) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00005980 const upb_MiniTableField field = {10, UPB_SIZE(40, 104), 0, kUpb_NoSub, 5, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +00005981 const upb_Array* arr = upb_Message_GetArray(UPB_UPCAST(msg), &field);
Deanna Garciab26afb52023-04-25 13:37:18 -07005982 if (size) {
Protobuf Team Botf73985a2023-12-19 00:14:19 +00005983 *size = arr ? arr->UPB_PRIVATE(size) : 0;
Deanna Garciab26afb52023-04-25 13:37:18 -07005984 }
5985 return arr;
5986}
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +00005987UPB_INLINE upb_Array* _google_protobuf_FileDescriptorProto_public_dependency_mutable_upb_array(google_protobuf_FileDescriptorProto* msg, size_t* size, upb_Arena* arena) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00005988 const upb_MiniTableField field = {10, UPB_SIZE(40, 104), 0, kUpb_NoSub, 5, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +00005989 upb_Array* arr = upb_Message_GetOrCreateMutableArray(UPB_UPCAST(msg),
5990 &field, arena);
Deanna Garciab26afb52023-04-25 13:37:18 -07005991 if (size) {
Protobuf Team Botf73985a2023-12-19 00:14:19 +00005992 *size = arr ? arr->UPB_PRIVATE(size) : 0;
Deanna Garciab26afb52023-04-25 13:37:18 -07005993 }
5994 return arr;
5995}
Mike Kruskal3bc50492022-12-01 13:34:12 -08005996UPB_INLINE void google_protobuf_FileDescriptorProto_clear_weak_dependency(google_protobuf_FileDescriptorProto* msg) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00005997 const upb_MiniTableField field = {11, UPB_SIZE(44, 112), 0, kUpb_NoSub, 5, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
Protobuf Team Bot4e90ead2024-01-08 15:46:34 +00005998 upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
Joshua Haberman7ecf43f2022-03-14 13:11:29 -07005999}
Eric Salob7d54ac2022-12-29 11:59:42 -08006000UPB_INLINE int32_t const* google_protobuf_FileDescriptorProto_weak_dependency(const google_protobuf_FileDescriptorProto* msg, size_t* size) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00006001 const upb_MiniTableField field = {11, UPB_SIZE(44, 112), 0, kUpb_NoSub, 5, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +00006002 const upb_Array* arr = upb_Message_GetArray(UPB_UPCAST(msg), &field);
Eric Salob7d54ac2022-12-29 11:59:42 -08006003 if (arr) {
Protobuf Team Botf73985a2023-12-19 00:14:19 +00006004 if (size) *size = arr->UPB_PRIVATE(size);
Protobuf Team Bot81e54332024-01-11 21:04:07 +00006005 return (int32_t const*)upb_Array_DataPtr(arr);
Eric Salob7d54ac2022-12-29 11:59:42 -08006006 } else {
6007 if (size) *size = 0;
6008 return NULL;
6009 }
Joshua Haberman7ecf43f2022-03-14 13:11:29 -07006010}
Deanna Garciab26afb52023-04-25 13:37:18 -07006011UPB_INLINE const upb_Array* _google_protobuf_FileDescriptorProto_weak_dependency_upb_array(const google_protobuf_FileDescriptorProto* msg, size_t* size) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00006012 const upb_MiniTableField field = {11, UPB_SIZE(44, 112), 0, kUpb_NoSub, 5, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +00006013 const upb_Array* arr = upb_Message_GetArray(UPB_UPCAST(msg), &field);
Deanna Garciab26afb52023-04-25 13:37:18 -07006014 if (size) {
Protobuf Team Botf73985a2023-12-19 00:14:19 +00006015 *size = arr ? arr->UPB_PRIVATE(size) : 0;
Deanna Garciab26afb52023-04-25 13:37:18 -07006016 }
6017 return arr;
6018}
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +00006019UPB_INLINE upb_Array* _google_protobuf_FileDescriptorProto_weak_dependency_mutable_upb_array(google_protobuf_FileDescriptorProto* msg, size_t* size, upb_Arena* arena) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00006020 const upb_MiniTableField field = {11, UPB_SIZE(44, 112), 0, kUpb_NoSub, 5, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +00006021 upb_Array* arr = upb_Message_GetOrCreateMutableArray(UPB_UPCAST(msg),
6022 &field, arena);
Deanna Garciab26afb52023-04-25 13:37:18 -07006023 if (size) {
Protobuf Team Botf73985a2023-12-19 00:14:19 +00006024 *size = arr ? arr->UPB_PRIVATE(size) : 0;
Deanna Garciab26afb52023-04-25 13:37:18 -07006025 }
6026 return arr;
6027}
Mike Kruskal3bc50492022-12-01 13:34:12 -08006028UPB_INLINE void google_protobuf_FileDescriptorProto_clear_syntax(google_protobuf_FileDescriptorProto* msg) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00006029 const upb_MiniTableField field = {12, UPB_SIZE(68, 120), 68, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
Protobuf Team Bot4e90ead2024-01-08 15:46:34 +00006030 upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
Joshua Habermand3995ec2022-09-30 16:54:39 -07006031}
Joshua Habermanf41049a2022-01-21 14:41:25 -08006032UPB_INLINE upb_StringView google_protobuf_FileDescriptorProto_syntax(const google_protobuf_FileDescriptorProto* msg) {
Eric Salo8809a112022-11-21 13:01:06 -08006033 upb_StringView default_val = upb_StringView_FromString("");
6034 upb_StringView ret;
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00006035 const upb_MiniTableField field = {12, UPB_SIZE(68, 120), 68, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +00006036 _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field,
6037 &default_val, &ret);
Eric Salo8809a112022-11-21 13:01:06 -08006038 return ret;
Joshua Habermand3995ec2022-09-30 16:54:39 -07006039}
Mike Kruskal3bc50492022-12-01 13:34:12 -08006040UPB_INLINE bool google_protobuf_FileDescriptorProto_has_syntax(const google_protobuf_FileDescriptorProto* msg) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00006041 const upb_MiniTableField field = {12, UPB_SIZE(68, 120), 68, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
Protobuf Team Bot8c1f6352024-01-10 05:18:15 +00006042 return upb_Message_HasBaseField(UPB_UPCAST(msg), &field);
Joshua Habermand3995ec2022-09-30 16:54:39 -07006043}
Mike Kruskal3bc50492022-12-01 13:34:12 -08006044UPB_INLINE void google_protobuf_FileDescriptorProto_clear_edition(google_protobuf_FileDescriptorProto* msg) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00006045 const upb_MiniTableField field = {14, UPB_SIZE(48, 12), 69, 6, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
Protobuf Team Bot4e90ead2024-01-08 15:46:34 +00006046 upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
Joshua Habermand3995ec2022-09-30 16:54:39 -07006047}
Protobuf Team Botab58f8f2023-09-26 16:14:19 +00006048UPB_INLINE int32_t google_protobuf_FileDescriptorProto_edition(const google_protobuf_FileDescriptorProto* msg) {
6049 int32_t default_val = 0;
6050 int32_t ret;
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00006051 const upb_MiniTableField field = {14, UPB_SIZE(48, 12), 69, 6, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +00006052 _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field,
6053 &default_val, &ret);
Eric Salo8809a112022-11-21 13:01:06 -08006054 return ret;
Joshua Habermanf41049a2022-01-21 14:41:25 -08006055}
Mike Kruskal3bc50492022-12-01 13:34:12 -08006056UPB_INLINE bool google_protobuf_FileDescriptorProto_has_edition(const google_protobuf_FileDescriptorProto* msg) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00006057 const upb_MiniTableField field = {14, UPB_SIZE(48, 12), 69, 6, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
Protobuf Team Bot8c1f6352024-01-10 05:18:15 +00006058 return upb_Message_HasBaseField(UPB_UPCAST(msg), &field);
Mike Kruskal3bc50492022-12-01 13:34:12 -08006059}
Joshua Haberman9abf6e22021-01-13 12:16:25 -08006060
Joshua Habermanf41049a2022-01-21 14:41:25 -08006061UPB_INLINE void google_protobuf_FileDescriptorProto_set_name(google_protobuf_FileDescriptorProto *msg, upb_StringView value) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00006062 const upb_MiniTableField field = {1, UPB_SIZE(52, 16), 64, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
Protobuf Team Botac32c972024-04-10 03:30:05 +00006063 upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
Mike Kruskal232ecf42023-01-14 00:09:40 -08006064}
6065UPB_INLINE void google_protobuf_FileDescriptorProto_set_package(google_protobuf_FileDescriptorProto *msg, upb_StringView value) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00006066 const upb_MiniTableField field = {2, UPB_SIZE(60, 32), 65, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
Protobuf Team Botac32c972024-04-10 03:30:05 +00006067 upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
Mike Kruskal232ecf42023-01-14 00:09:40 -08006068}
6069UPB_INLINE upb_StringView* google_protobuf_FileDescriptorProto_mutable_dependency(google_protobuf_FileDescriptorProto* msg, size_t* size) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00006070 upb_MiniTableField field = {3, UPB_SIZE(12, 48), 0, kUpb_NoSub, 12, (int)kUpb_FieldMode_Array | (int)kUpb_LabelFlags_IsAlternate | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +00006071 upb_Array* arr = upb_Message_GetMutableArray(UPB_UPCAST(msg), &field);
Eric Salob7d54ac2022-12-29 11:59:42 -08006072 if (arr) {
Protobuf Team Botf73985a2023-12-19 00:14:19 +00006073 if (size) *size = arr->UPB_PRIVATE(size);
Protobuf Team Bot81e54332024-01-11 21:04:07 +00006074 return (upb_StringView*)upb_Array_MutableDataPtr(arr);
Eric Salob7d54ac2022-12-29 11:59:42 -08006075 } else {
6076 if (size) *size = 0;
6077 return NULL;
6078 }
Joshua Haberman9abf6e22021-01-13 12:16:25 -08006079}
Eric Salob7d54ac2022-12-29 11:59:42 -08006080UPB_INLINE upb_StringView* google_protobuf_FileDescriptorProto_resize_dependency(google_protobuf_FileDescriptorProto* msg, size_t size, upb_Arena* arena) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00006081 upb_MiniTableField field = {3, UPB_SIZE(12, 48), 0, kUpb_NoSub, 12, (int)kUpb_FieldMode_Array | (int)kUpb_LabelFlags_IsAlternate | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +00006082 return (upb_StringView*)upb_Message_ResizeArrayUninitialized(UPB_UPCAST(msg),
6083 &field, size, arena);
Joshua Haberman9abf6e22021-01-13 12:16:25 -08006084}
Joshua Haberman7ecf43f2022-03-14 13:11:29 -07006085UPB_INLINE bool google_protobuf_FileDescriptorProto_add_dependency(google_protobuf_FileDescriptorProto* msg, upb_StringView val, upb_Arena* arena) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00006086 upb_MiniTableField field = {3, UPB_SIZE(12, 48), 0, kUpb_NoSub, 12, (int)kUpb_FieldMode_Array | (int)kUpb_LabelFlags_IsAlternate | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +00006087 upb_Array* arr = upb_Message_GetOrCreateMutableArray(
6088 UPB_UPCAST(msg), &field, arena);
Protobuf Team Bot81e54332024-01-11 21:04:07 +00006089 if (!arr || !UPB_PRIVATE(_upb_Array_ResizeUninitialized)(
Protobuf Team Botf73985a2023-12-19 00:14:19 +00006090 arr, arr->UPB_PRIVATE(size) + 1, arena)) {
Eric Salob7d54ac2022-12-29 11:59:42 -08006091 return false;
6092 }
Protobuf Team Botf73985a2023-12-19 00:14:19 +00006093 UPB_PRIVATE(_upb_Array_Set)
6094 (arr, arr->UPB_PRIVATE(size) - 1, &val, sizeof(val));
Eric Salob7d54ac2022-12-29 11:59:42 -08006095 return true;
Joshua Haberman9abf6e22021-01-13 12:16:25 -08006096}
Eric Salob7d54ac2022-12-29 11:59:42 -08006097UPB_INLINE google_protobuf_DescriptorProto** google_protobuf_FileDescriptorProto_mutable_message_type(google_protobuf_FileDescriptorProto* msg, size_t* size) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00006098 upb_MiniTableField field = {4, UPB_SIZE(16, 56), 0, 0, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
Protobuf Team Bota9387b52024-06-12 15:17:52 +00006099 UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__DescriptorProto_msg_init);
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +00006100 upb_Array* arr = upb_Message_GetMutableArray(UPB_UPCAST(msg), &field);
Eric Salob7d54ac2022-12-29 11:59:42 -08006101 if (arr) {
Protobuf Team Botf73985a2023-12-19 00:14:19 +00006102 if (size) *size = arr->UPB_PRIVATE(size);
Protobuf Team Bot81e54332024-01-11 21:04:07 +00006103 return (google_protobuf_DescriptorProto**)upb_Array_MutableDataPtr(arr);
Eric Salob7d54ac2022-12-29 11:59:42 -08006104 } else {
6105 if (size) *size = 0;
6106 return NULL;
6107 }
Joshua Haberman9abf6e22021-01-13 12:16:25 -08006108}
Eric Salob7d54ac2022-12-29 11:59:42 -08006109UPB_INLINE google_protobuf_DescriptorProto** google_protobuf_FileDescriptorProto_resize_message_type(google_protobuf_FileDescriptorProto* msg, size_t size, upb_Arena* arena) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00006110 upb_MiniTableField field = {4, UPB_SIZE(16, 56), 0, 0, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +00006111 return (google_protobuf_DescriptorProto**)upb_Message_ResizeArrayUninitialized(UPB_UPCAST(msg),
6112 &field, size, arena);
Joshua Haberman9abf6e22021-01-13 12:16:25 -08006113}
Joshua Haberman7ecf43f2022-03-14 13:11:29 -07006114UPB_INLINE struct google_protobuf_DescriptorProto* google_protobuf_FileDescriptorProto_add_message_type(google_protobuf_FileDescriptorProto* msg, upb_Arena* arena) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00006115 upb_MiniTableField field = {4, UPB_SIZE(16, 56), 0, 0, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
Protobuf Team Bota9387b52024-06-12 15:17:52 +00006116 UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__DescriptorProto_msg_init);
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +00006117 upb_Array* arr = upb_Message_GetOrCreateMutableArray(
6118 UPB_UPCAST(msg), &field, arena);
Protobuf Team Bot81e54332024-01-11 21:04:07 +00006119 if (!arr || !UPB_PRIVATE(_upb_Array_ResizeUninitialized)(
Protobuf Team Botf73985a2023-12-19 00:14:19 +00006120 arr, arr->UPB_PRIVATE(size) + 1, arena)) {
Eric Salob7d54ac2022-12-29 11:59:42 -08006121 return NULL;
6122 }
Protobuf Team Bot4ffe0862023-12-06 02:02:36 +00006123 struct google_protobuf_DescriptorProto* sub = (struct google_protobuf_DescriptorProto*)_upb_Message_New(&google__protobuf__DescriptorProto_msg_init, arena);
Eric Salob7d54ac2022-12-29 11:59:42 -08006124 if (!arr || !sub) return NULL;
Protobuf Team Botf73985a2023-12-19 00:14:19 +00006125 UPB_PRIVATE(_upb_Array_Set)
6126 (arr, arr->UPB_PRIVATE(size) - 1, &sub, sizeof(sub));
Joshua Haberman9abf6e22021-01-13 12:16:25 -08006127 return sub;
6128}
Eric Salob7d54ac2022-12-29 11:59:42 -08006129UPB_INLINE google_protobuf_EnumDescriptorProto** google_protobuf_FileDescriptorProto_mutable_enum_type(google_protobuf_FileDescriptorProto* msg, size_t* size) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00006130 upb_MiniTableField field = {5, UPB_SIZE(20, 64), 0, 1, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
Protobuf Team Bota9387b52024-06-12 15:17:52 +00006131 UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__EnumDescriptorProto_msg_init);
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +00006132 upb_Array* arr = upb_Message_GetMutableArray(UPB_UPCAST(msg), &field);
Eric Salob7d54ac2022-12-29 11:59:42 -08006133 if (arr) {
Protobuf Team Botf73985a2023-12-19 00:14:19 +00006134 if (size) *size = arr->UPB_PRIVATE(size);
Protobuf Team Bot81e54332024-01-11 21:04:07 +00006135 return (google_protobuf_EnumDescriptorProto**)upb_Array_MutableDataPtr(arr);
Eric Salob7d54ac2022-12-29 11:59:42 -08006136 } else {
6137 if (size) *size = 0;
6138 return NULL;
6139 }
Joshua Haberman9abf6e22021-01-13 12:16:25 -08006140}
Eric Salob7d54ac2022-12-29 11:59:42 -08006141UPB_INLINE google_protobuf_EnumDescriptorProto** google_protobuf_FileDescriptorProto_resize_enum_type(google_protobuf_FileDescriptorProto* msg, size_t size, upb_Arena* arena) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00006142 upb_MiniTableField field = {5, UPB_SIZE(20, 64), 0, 1, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +00006143 return (google_protobuf_EnumDescriptorProto**)upb_Message_ResizeArrayUninitialized(UPB_UPCAST(msg),
6144 &field, size, arena);
Joshua Haberman9abf6e22021-01-13 12:16:25 -08006145}
Joshua Haberman7ecf43f2022-03-14 13:11:29 -07006146UPB_INLINE struct google_protobuf_EnumDescriptorProto* google_protobuf_FileDescriptorProto_add_enum_type(google_protobuf_FileDescriptorProto* msg, upb_Arena* arena) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00006147 upb_MiniTableField field = {5, UPB_SIZE(20, 64), 0, 1, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
Protobuf Team Bota9387b52024-06-12 15:17:52 +00006148 UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__EnumDescriptorProto_msg_init);
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +00006149 upb_Array* arr = upb_Message_GetOrCreateMutableArray(
6150 UPB_UPCAST(msg), &field, arena);
Protobuf Team Bot81e54332024-01-11 21:04:07 +00006151 if (!arr || !UPB_PRIVATE(_upb_Array_ResizeUninitialized)(
Protobuf Team Botf73985a2023-12-19 00:14:19 +00006152 arr, arr->UPB_PRIVATE(size) + 1, arena)) {
Eric Salob7d54ac2022-12-29 11:59:42 -08006153 return NULL;
6154 }
Protobuf Team Bot4ffe0862023-12-06 02:02:36 +00006155 struct google_protobuf_EnumDescriptorProto* sub = (struct google_protobuf_EnumDescriptorProto*)_upb_Message_New(&google__protobuf__EnumDescriptorProto_msg_init, arena);
Eric Salob7d54ac2022-12-29 11:59:42 -08006156 if (!arr || !sub) return NULL;
Protobuf Team Botf73985a2023-12-19 00:14:19 +00006157 UPB_PRIVATE(_upb_Array_Set)
6158 (arr, arr->UPB_PRIVATE(size) - 1, &sub, sizeof(sub));
Joshua Haberman9abf6e22021-01-13 12:16:25 -08006159 return sub;
6160}
Eric Salob7d54ac2022-12-29 11:59:42 -08006161UPB_INLINE google_protobuf_ServiceDescriptorProto** google_protobuf_FileDescriptorProto_mutable_service(google_protobuf_FileDescriptorProto* msg, size_t* size) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00006162 upb_MiniTableField field = {6, UPB_SIZE(24, 72), 0, 2, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
Protobuf Team Bota9387b52024-06-12 15:17:52 +00006163 UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__ServiceDescriptorProto_msg_init);
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +00006164 upb_Array* arr = upb_Message_GetMutableArray(UPB_UPCAST(msg), &field);
Eric Salob7d54ac2022-12-29 11:59:42 -08006165 if (arr) {
Protobuf Team Botf73985a2023-12-19 00:14:19 +00006166 if (size) *size = arr->UPB_PRIVATE(size);
Protobuf Team Bot81e54332024-01-11 21:04:07 +00006167 return (google_protobuf_ServiceDescriptorProto**)upb_Array_MutableDataPtr(arr);
Eric Salob7d54ac2022-12-29 11:59:42 -08006168 } else {
6169 if (size) *size = 0;
6170 return NULL;
6171 }
Joshua Haberman9abf6e22021-01-13 12:16:25 -08006172}
Eric Salob7d54ac2022-12-29 11:59:42 -08006173UPB_INLINE google_protobuf_ServiceDescriptorProto** google_protobuf_FileDescriptorProto_resize_service(google_protobuf_FileDescriptorProto* msg, size_t size, upb_Arena* arena) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00006174 upb_MiniTableField field = {6, UPB_SIZE(24, 72), 0, 2, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +00006175 return (google_protobuf_ServiceDescriptorProto**)upb_Message_ResizeArrayUninitialized(UPB_UPCAST(msg),
6176 &field, size, arena);
Joshua Haberman9abf6e22021-01-13 12:16:25 -08006177}
Joshua Haberman7ecf43f2022-03-14 13:11:29 -07006178UPB_INLINE struct google_protobuf_ServiceDescriptorProto* google_protobuf_FileDescriptorProto_add_service(google_protobuf_FileDescriptorProto* msg, upb_Arena* arena) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00006179 upb_MiniTableField field = {6, UPB_SIZE(24, 72), 0, 2, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
Protobuf Team Bota9387b52024-06-12 15:17:52 +00006180 UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__ServiceDescriptorProto_msg_init);
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +00006181 upb_Array* arr = upb_Message_GetOrCreateMutableArray(
6182 UPB_UPCAST(msg), &field, arena);
Protobuf Team Bot81e54332024-01-11 21:04:07 +00006183 if (!arr || !UPB_PRIVATE(_upb_Array_ResizeUninitialized)(
Protobuf Team Botf73985a2023-12-19 00:14:19 +00006184 arr, arr->UPB_PRIVATE(size) + 1, arena)) {
Eric Salob7d54ac2022-12-29 11:59:42 -08006185 return NULL;
6186 }
Protobuf Team Bot4ffe0862023-12-06 02:02:36 +00006187 struct google_protobuf_ServiceDescriptorProto* sub = (struct google_protobuf_ServiceDescriptorProto*)_upb_Message_New(&google__protobuf__ServiceDescriptorProto_msg_init, arena);
Eric Salob7d54ac2022-12-29 11:59:42 -08006188 if (!arr || !sub) return NULL;
Protobuf Team Botf73985a2023-12-19 00:14:19 +00006189 UPB_PRIVATE(_upb_Array_Set)
6190 (arr, arr->UPB_PRIVATE(size) - 1, &sub, sizeof(sub));
Joshua Haberman9abf6e22021-01-13 12:16:25 -08006191 return sub;
6192}
Eric Salob7d54ac2022-12-29 11:59:42 -08006193UPB_INLINE google_protobuf_FieldDescriptorProto** google_protobuf_FileDescriptorProto_mutable_extension(google_protobuf_FileDescriptorProto* msg, size_t* size) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00006194 upb_MiniTableField field = {7, UPB_SIZE(28, 80), 0, 3, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
Protobuf Team Bota9387b52024-06-12 15:17:52 +00006195 UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__FieldDescriptorProto_msg_init);
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +00006196 upb_Array* arr = upb_Message_GetMutableArray(UPB_UPCAST(msg), &field);
Eric Salob7d54ac2022-12-29 11:59:42 -08006197 if (arr) {
Protobuf Team Botf73985a2023-12-19 00:14:19 +00006198 if (size) *size = arr->UPB_PRIVATE(size);
Protobuf Team Bot81e54332024-01-11 21:04:07 +00006199 return (google_protobuf_FieldDescriptorProto**)upb_Array_MutableDataPtr(arr);
Eric Salob7d54ac2022-12-29 11:59:42 -08006200 } else {
6201 if (size) *size = 0;
6202 return NULL;
6203 }
Joshua Haberman9abf6e22021-01-13 12:16:25 -08006204}
Eric Salob7d54ac2022-12-29 11:59:42 -08006205UPB_INLINE google_protobuf_FieldDescriptorProto** google_protobuf_FileDescriptorProto_resize_extension(google_protobuf_FileDescriptorProto* msg, size_t size, upb_Arena* arena) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00006206 upb_MiniTableField field = {7, UPB_SIZE(28, 80), 0, 3, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +00006207 return (google_protobuf_FieldDescriptorProto**)upb_Message_ResizeArrayUninitialized(UPB_UPCAST(msg),
6208 &field, size, arena);
Joshua Haberman9abf6e22021-01-13 12:16:25 -08006209}
Joshua Haberman7ecf43f2022-03-14 13:11:29 -07006210UPB_INLINE struct google_protobuf_FieldDescriptorProto* google_protobuf_FileDescriptorProto_add_extension(google_protobuf_FileDescriptorProto* msg, upb_Arena* arena) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00006211 upb_MiniTableField field = {7, UPB_SIZE(28, 80), 0, 3, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
Protobuf Team Bota9387b52024-06-12 15:17:52 +00006212 UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__FieldDescriptorProto_msg_init);
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +00006213 upb_Array* arr = upb_Message_GetOrCreateMutableArray(
6214 UPB_UPCAST(msg), &field, arena);
Protobuf Team Bot81e54332024-01-11 21:04:07 +00006215 if (!arr || !UPB_PRIVATE(_upb_Array_ResizeUninitialized)(
Protobuf Team Botf73985a2023-12-19 00:14:19 +00006216 arr, arr->UPB_PRIVATE(size) + 1, arena)) {
Eric Salob7d54ac2022-12-29 11:59:42 -08006217 return NULL;
6218 }
Protobuf Team Bot4ffe0862023-12-06 02:02:36 +00006219 struct google_protobuf_FieldDescriptorProto* sub = (struct google_protobuf_FieldDescriptorProto*)_upb_Message_New(&google__protobuf__FieldDescriptorProto_msg_init, arena);
Eric Salob7d54ac2022-12-29 11:59:42 -08006220 if (!arr || !sub) return NULL;
Protobuf Team Botf73985a2023-12-19 00:14:19 +00006221 UPB_PRIVATE(_upb_Array_Set)
6222 (arr, arr->UPB_PRIVATE(size) - 1, &sub, sizeof(sub));
Joshua Haberman9abf6e22021-01-13 12:16:25 -08006223 return sub;
6224}
6225UPB_INLINE void google_protobuf_FileDescriptorProto_set_options(google_protobuf_FileDescriptorProto *msg, google_protobuf_FileOptions* value) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00006226 const upb_MiniTableField field = {8, UPB_SIZE(32, 88), 66, 4, 11, (int)kUpb_FieldMode_Scalar | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
Protobuf Team Bota9387b52024-06-12 15:17:52 +00006227 UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__FileOptions_msg_init);
Protobuf Team Botac32c972024-04-10 03:30:05 +00006228 upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
Mike Kruskal232ecf42023-01-14 00:09:40 -08006229}
6230UPB_INLINE struct google_protobuf_FileOptions* google_protobuf_FileDescriptorProto_mutable_options(google_protobuf_FileDescriptorProto* msg, upb_Arena* arena) {
Joshua Haberman9abf6e22021-01-13 12:16:25 -08006231 struct google_protobuf_FileOptions* sub = (struct google_protobuf_FileOptions*)google_protobuf_FileDescriptorProto_options(msg);
6232 if (sub == NULL) {
Protobuf Team Bot4ffe0862023-12-06 02:02:36 +00006233 sub = (struct google_protobuf_FileOptions*)_upb_Message_New(&google__protobuf__FileOptions_msg_init, arena);
Eric Salo8809a112022-11-21 13:01:06 -08006234 if (sub) google_protobuf_FileDescriptorProto_set_options(msg, sub);
Joshua Haberman9abf6e22021-01-13 12:16:25 -08006235 }
6236 return sub;
6237}
6238UPB_INLINE void google_protobuf_FileDescriptorProto_set_source_code_info(google_protobuf_FileDescriptorProto *msg, google_protobuf_SourceCodeInfo* value) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00006239 const upb_MiniTableField field = {9, UPB_SIZE(36, 96), 67, 5, 11, (int)kUpb_FieldMode_Scalar | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
Protobuf Team Bota9387b52024-06-12 15:17:52 +00006240 UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__SourceCodeInfo_msg_init);
Protobuf Team Botac32c972024-04-10 03:30:05 +00006241 upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
Mike Kruskal232ecf42023-01-14 00:09:40 -08006242}
6243UPB_INLINE struct google_protobuf_SourceCodeInfo* google_protobuf_FileDescriptorProto_mutable_source_code_info(google_protobuf_FileDescriptorProto* msg, upb_Arena* arena) {
Joshua Haberman9abf6e22021-01-13 12:16:25 -08006244 struct google_protobuf_SourceCodeInfo* sub = (struct google_protobuf_SourceCodeInfo*)google_protobuf_FileDescriptorProto_source_code_info(msg);
6245 if (sub == NULL) {
Protobuf Team Bot4ffe0862023-12-06 02:02:36 +00006246 sub = (struct google_protobuf_SourceCodeInfo*)_upb_Message_New(&google__protobuf__SourceCodeInfo_msg_init, arena);
Eric Salo8809a112022-11-21 13:01:06 -08006247 if (sub) google_protobuf_FileDescriptorProto_set_source_code_info(msg, sub);
Joshua Haberman9abf6e22021-01-13 12:16:25 -08006248 }
6249 return sub;
6250}
Eric Salob7d54ac2022-12-29 11:59:42 -08006251UPB_INLINE int32_t* google_protobuf_FileDescriptorProto_mutable_public_dependency(google_protobuf_FileDescriptorProto* msg, size_t* size) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00006252 upb_MiniTableField field = {10, UPB_SIZE(40, 104), 0, kUpb_NoSub, 5, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +00006253 upb_Array* arr = upb_Message_GetMutableArray(UPB_UPCAST(msg), &field);
Eric Salob7d54ac2022-12-29 11:59:42 -08006254 if (arr) {
Protobuf Team Botf73985a2023-12-19 00:14:19 +00006255 if (size) *size = arr->UPB_PRIVATE(size);
Protobuf Team Bot81e54332024-01-11 21:04:07 +00006256 return (int32_t*)upb_Array_MutableDataPtr(arr);
Eric Salob7d54ac2022-12-29 11:59:42 -08006257 } else {
6258 if (size) *size = 0;
6259 return NULL;
6260 }
Joshua Haberman9abf6e22021-01-13 12:16:25 -08006261}
Eric Salob7d54ac2022-12-29 11:59:42 -08006262UPB_INLINE int32_t* google_protobuf_FileDescriptorProto_resize_public_dependency(google_protobuf_FileDescriptorProto* msg, size_t size, upb_Arena* arena) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00006263 upb_MiniTableField field = {10, UPB_SIZE(40, 104), 0, kUpb_NoSub, 5, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +00006264 return (int32_t*)upb_Message_ResizeArrayUninitialized(UPB_UPCAST(msg),
6265 &field, size, arena);
Joshua Haberman9abf6e22021-01-13 12:16:25 -08006266}
Joshua Haberman7ecf43f2022-03-14 13:11:29 -07006267UPB_INLINE bool google_protobuf_FileDescriptorProto_add_public_dependency(google_protobuf_FileDescriptorProto* msg, int32_t val, upb_Arena* arena) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00006268 upb_MiniTableField field = {10, UPB_SIZE(40, 104), 0, kUpb_NoSub, 5, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +00006269 upb_Array* arr = upb_Message_GetOrCreateMutableArray(
6270 UPB_UPCAST(msg), &field, arena);
Protobuf Team Bot81e54332024-01-11 21:04:07 +00006271 if (!arr || !UPB_PRIVATE(_upb_Array_ResizeUninitialized)(
Protobuf Team Botf73985a2023-12-19 00:14:19 +00006272 arr, arr->UPB_PRIVATE(size) + 1, arena)) {
Eric Salob7d54ac2022-12-29 11:59:42 -08006273 return false;
6274 }
Protobuf Team Botf73985a2023-12-19 00:14:19 +00006275 UPB_PRIVATE(_upb_Array_Set)
6276 (arr, arr->UPB_PRIVATE(size) - 1, &val, sizeof(val));
Eric Salob7d54ac2022-12-29 11:59:42 -08006277 return true;
Joshua Haberman9abf6e22021-01-13 12:16:25 -08006278}
Eric Salob7d54ac2022-12-29 11:59:42 -08006279UPB_INLINE int32_t* google_protobuf_FileDescriptorProto_mutable_weak_dependency(google_protobuf_FileDescriptorProto* msg, size_t* size) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00006280 upb_MiniTableField field = {11, UPB_SIZE(44, 112), 0, kUpb_NoSub, 5, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +00006281 upb_Array* arr = upb_Message_GetMutableArray(UPB_UPCAST(msg), &field);
Eric Salob7d54ac2022-12-29 11:59:42 -08006282 if (arr) {
Protobuf Team Botf73985a2023-12-19 00:14:19 +00006283 if (size) *size = arr->UPB_PRIVATE(size);
Protobuf Team Bot81e54332024-01-11 21:04:07 +00006284 return (int32_t*)upb_Array_MutableDataPtr(arr);
Eric Salob7d54ac2022-12-29 11:59:42 -08006285 } else {
6286 if (size) *size = 0;
6287 return NULL;
6288 }
Joshua Haberman9abf6e22021-01-13 12:16:25 -08006289}
Eric Salob7d54ac2022-12-29 11:59:42 -08006290UPB_INLINE int32_t* google_protobuf_FileDescriptorProto_resize_weak_dependency(google_protobuf_FileDescriptorProto* msg, size_t size, upb_Arena* arena) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00006291 upb_MiniTableField field = {11, UPB_SIZE(44, 112), 0, kUpb_NoSub, 5, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +00006292 return (int32_t*)upb_Message_ResizeArrayUninitialized(UPB_UPCAST(msg),
6293 &field, size, arena);
Joshua Haberman9abf6e22021-01-13 12:16:25 -08006294}
Joshua Haberman7ecf43f2022-03-14 13:11:29 -07006295UPB_INLINE bool google_protobuf_FileDescriptorProto_add_weak_dependency(google_protobuf_FileDescriptorProto* msg, int32_t val, upb_Arena* arena) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00006296 upb_MiniTableField field = {11, UPB_SIZE(44, 112), 0, kUpb_NoSub, 5, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +00006297 upb_Array* arr = upb_Message_GetOrCreateMutableArray(
6298 UPB_UPCAST(msg), &field, arena);
Protobuf Team Bot81e54332024-01-11 21:04:07 +00006299 if (!arr || !UPB_PRIVATE(_upb_Array_ResizeUninitialized)(
Protobuf Team Botf73985a2023-12-19 00:14:19 +00006300 arr, arr->UPB_PRIVATE(size) + 1, arena)) {
Eric Salob7d54ac2022-12-29 11:59:42 -08006301 return false;
6302 }
Protobuf Team Botf73985a2023-12-19 00:14:19 +00006303 UPB_PRIVATE(_upb_Array_Set)
6304 (arr, arr->UPB_PRIVATE(size) - 1, &val, sizeof(val));
Eric Salob7d54ac2022-12-29 11:59:42 -08006305 return true;
Joshua Haberman9abf6e22021-01-13 12:16:25 -08006306}
Joshua Habermanf41049a2022-01-21 14:41:25 -08006307UPB_INLINE void google_protobuf_FileDescriptorProto_set_syntax(google_protobuf_FileDescriptorProto *msg, upb_StringView value) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00006308 const upb_MiniTableField field = {12, UPB_SIZE(68, 120), 68, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
Protobuf Team Botac32c972024-04-10 03:30:05 +00006309 upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
Mike Kruskal232ecf42023-01-14 00:09:40 -08006310}
Protobuf Team Botab58f8f2023-09-26 16:14:19 +00006311UPB_INLINE void google_protobuf_FileDescriptorProto_set_edition(google_protobuf_FileDescriptorProto *msg, int32_t value) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00006312 const upb_MiniTableField field = {14, UPB_SIZE(48, 12), 69, 6, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
Protobuf Team Botac32c972024-04-10 03:30:05 +00006313 upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
Joshua Habermand3995ec2022-09-30 16:54:39 -07006314}
Mike Kruskal232ecf42023-01-14 00:09:40 -08006315
Joshua Haberman9abf6e22021-01-13 12:16:25 -08006316/* google.protobuf.DescriptorProto */
6317
Joshua Habermanf41049a2022-01-21 14:41:25 -08006318UPB_INLINE google_protobuf_DescriptorProto* google_protobuf_DescriptorProto_new(upb_Arena* arena) {
Protobuf Team Bot4ffe0862023-12-06 02:02:36 +00006319 return (google_protobuf_DescriptorProto*)_upb_Message_New(&google__protobuf__DescriptorProto_msg_init, arena);
Joshua Haberman9abf6e22021-01-13 12:16:25 -08006320}
Joshua Habermanf41049a2022-01-21 14:41:25 -08006321UPB_INLINE google_protobuf_DescriptorProto* google_protobuf_DescriptorProto_parse(const char* buf, size_t size, upb_Arena* arena) {
6322 google_protobuf_DescriptorProto* ret = google_protobuf_DescriptorProto_new(arena);
Joshua Haberman9d578a32021-08-02 15:32:01 -07006323 if (!ret) return NULL;
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +00006324 if (upb_Decode(buf, size, UPB_UPCAST(ret), &google__protobuf__DescriptorProto_msg_init, NULL, 0, arena) !=
6325 kUpb_DecodeStatus_Ok) {
Joshua Haberman9d578a32021-08-02 15:32:01 -07006326 return NULL;
6327 }
6328 return ret;
Joshua Haberman9abf6e22021-01-13 12:16:25 -08006329}
Joshua Habermanf41049a2022-01-21 14:41:25 -08006330UPB_INLINE google_protobuf_DescriptorProto* google_protobuf_DescriptorProto_parse_ex(const char* buf, size_t size,
6331 const upb_ExtensionRegistry* extreg,
6332 int options, upb_Arena* arena) {
6333 google_protobuf_DescriptorProto* ret = google_protobuf_DescriptorProto_new(arena);
6334 if (!ret) return NULL;
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +00006335 if (upb_Decode(buf, size, UPB_UPCAST(ret), &google__protobuf__DescriptorProto_msg_init, extreg, options,
6336 arena) != kUpb_DecodeStatus_Ok) {
Joshua Habermanf41049a2022-01-21 14:41:25 -08006337 return NULL;
6338 }
6339 return ret;
Joshua Haberman9abf6e22021-01-13 12:16:25 -08006340}
Joshua Habermanf41049a2022-01-21 14:41:25 -08006341UPB_INLINE char* google_protobuf_DescriptorProto_serialize(const google_protobuf_DescriptorProto* msg, upb_Arena* arena, size_t* len) {
Joshua Habermand3995ec2022-09-30 16:54:39 -07006342 char* ptr;
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +00006343 (void)upb_Encode(UPB_UPCAST(msg), &google__protobuf__DescriptorProto_msg_init, 0, arena, &ptr, len);
Joshua Habermand3995ec2022-09-30 16:54:39 -07006344 return ptr;
Joshua Habermanf41049a2022-01-21 14:41:25 -08006345}
6346UPB_INLINE char* google_protobuf_DescriptorProto_serialize_ex(const google_protobuf_DescriptorProto* msg, int options,
6347 upb_Arena* arena, size_t* len) {
Joshua Habermand3995ec2022-09-30 16:54:39 -07006348 char* ptr;
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +00006349 (void)upb_Encode(UPB_UPCAST(msg), &google__protobuf__DescriptorProto_msg_init, options, arena, &ptr, len);
Joshua Habermand3995ec2022-09-30 16:54:39 -07006350 return ptr;
Joshua Habermanf41049a2022-01-21 14:41:25 -08006351}
Mike Kruskal3bc50492022-12-01 13:34:12 -08006352UPB_INLINE void google_protobuf_DescriptorProto_clear_name(google_protobuf_DescriptorProto* msg) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00006353 const upb_MiniTableField field = {1, UPB_SIZE(48, 16), 64, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
Protobuf Team Bot4e90ead2024-01-08 15:46:34 +00006354 upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
Joshua Habermand3995ec2022-09-30 16:54:39 -07006355}
Joshua Habermanf41049a2022-01-21 14:41:25 -08006356UPB_INLINE upb_StringView google_protobuf_DescriptorProto_name(const google_protobuf_DescriptorProto* msg) {
Eric Salo8809a112022-11-21 13:01:06 -08006357 upb_StringView default_val = upb_StringView_FromString("");
6358 upb_StringView ret;
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00006359 const upb_MiniTableField field = {1, UPB_SIZE(48, 16), 64, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +00006360 _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field,
6361 &default_val, &ret);
Eric Salo8809a112022-11-21 13:01:06 -08006362 return ret;
Joshua Habermanf41049a2022-01-21 14:41:25 -08006363}
Mike Kruskal3bc50492022-12-01 13:34:12 -08006364UPB_INLINE bool google_protobuf_DescriptorProto_has_name(const google_protobuf_DescriptorProto* msg) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00006365 const upb_MiniTableField field = {1, UPB_SIZE(48, 16), 64, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
Protobuf Team Bot8c1f6352024-01-10 05:18:15 +00006366 return upb_Message_HasBaseField(UPB_UPCAST(msg), &field);
Joshua Habermand3995ec2022-09-30 16:54:39 -07006367}
Mike Kruskal3bc50492022-12-01 13:34:12 -08006368UPB_INLINE void google_protobuf_DescriptorProto_clear_field(google_protobuf_DescriptorProto* msg) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00006369 const upb_MiniTableField field = {2, UPB_SIZE(12, 32), 0, 0, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
Protobuf Team Bot4e90ead2024-01-08 15:46:34 +00006370 upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
Joshua Haberman7ecf43f2022-03-14 13:11:29 -07006371}
Eric Salob7d54ac2022-12-29 11:59:42 -08006372UPB_INLINE const google_protobuf_FieldDescriptorProto* const* google_protobuf_DescriptorProto_field(const google_protobuf_DescriptorProto* msg, size_t* size) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00006373 const upb_MiniTableField field = {2, UPB_SIZE(12, 32), 0, 0, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
Protobuf Team Bota9387b52024-06-12 15:17:52 +00006374 UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__FieldDescriptorProto_msg_init);
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +00006375 const upb_Array* arr = upb_Message_GetArray(UPB_UPCAST(msg), &field);
Eric Salob7d54ac2022-12-29 11:59:42 -08006376 if (arr) {
Protobuf Team Botf73985a2023-12-19 00:14:19 +00006377 if (size) *size = arr->UPB_PRIVATE(size);
Protobuf Team Bot81e54332024-01-11 21:04:07 +00006378 return (const google_protobuf_FieldDescriptorProto* const*)upb_Array_DataPtr(arr);
Eric Salob7d54ac2022-12-29 11:59:42 -08006379 } else {
6380 if (size) *size = 0;
6381 return NULL;
6382 }
Joshua Haberman7ecf43f2022-03-14 13:11:29 -07006383}
Deanna Garciab26afb52023-04-25 13:37:18 -07006384UPB_INLINE const upb_Array* _google_protobuf_DescriptorProto_field_upb_array(const google_protobuf_DescriptorProto* msg, size_t* size) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00006385 const upb_MiniTableField field = {2, UPB_SIZE(12, 32), 0, 0, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
Protobuf Team Bota9387b52024-06-12 15:17:52 +00006386 UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__FieldDescriptorProto_msg_init);
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +00006387 const upb_Array* arr = upb_Message_GetArray(UPB_UPCAST(msg), &field);
Deanna Garciab26afb52023-04-25 13:37:18 -07006388 if (size) {
Protobuf Team Botf73985a2023-12-19 00:14:19 +00006389 *size = arr ? arr->UPB_PRIVATE(size) : 0;
Deanna Garciab26afb52023-04-25 13:37:18 -07006390 }
6391 return arr;
6392}
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +00006393UPB_INLINE upb_Array* _google_protobuf_DescriptorProto_field_mutable_upb_array(google_protobuf_DescriptorProto* msg, size_t* size, upb_Arena* arena) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00006394 const upb_MiniTableField field = {2, UPB_SIZE(12, 32), 0, 0, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
Protobuf Team Bota9387b52024-06-12 15:17:52 +00006395 UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__FieldDescriptorProto_msg_init);
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +00006396 upb_Array* arr = upb_Message_GetOrCreateMutableArray(UPB_UPCAST(msg),
6397 &field, arena);
Deanna Garciab26afb52023-04-25 13:37:18 -07006398 if (size) {
Protobuf Team Botf73985a2023-12-19 00:14:19 +00006399 *size = arr ? arr->UPB_PRIVATE(size) : 0;
Deanna Garciab26afb52023-04-25 13:37:18 -07006400 }
6401 return arr;
6402}
Mike Kruskal3bc50492022-12-01 13:34:12 -08006403UPB_INLINE void google_protobuf_DescriptorProto_clear_nested_type(google_protobuf_DescriptorProto* msg) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00006404 const upb_MiniTableField field = {3, UPB_SIZE(16, 40), 0, 1, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
Protobuf Team Bot4e90ead2024-01-08 15:46:34 +00006405 upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
Joshua Haberman7ecf43f2022-03-14 13:11:29 -07006406}
Eric Salob7d54ac2022-12-29 11:59:42 -08006407UPB_INLINE const google_protobuf_DescriptorProto* const* google_protobuf_DescriptorProto_nested_type(const google_protobuf_DescriptorProto* msg, size_t* size) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00006408 const upb_MiniTableField field = {3, UPB_SIZE(16, 40), 0, 1, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
Protobuf Team Bota9387b52024-06-12 15:17:52 +00006409 UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__DescriptorProto_msg_init);
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +00006410 const upb_Array* arr = upb_Message_GetArray(UPB_UPCAST(msg), &field);
Eric Salob7d54ac2022-12-29 11:59:42 -08006411 if (arr) {
Protobuf Team Botf73985a2023-12-19 00:14:19 +00006412 if (size) *size = arr->UPB_PRIVATE(size);
Protobuf Team Bot81e54332024-01-11 21:04:07 +00006413 return (const google_protobuf_DescriptorProto* const*)upb_Array_DataPtr(arr);
Eric Salob7d54ac2022-12-29 11:59:42 -08006414 } else {
6415 if (size) *size = 0;
6416 return NULL;
6417 }
Joshua Haberman7ecf43f2022-03-14 13:11:29 -07006418}
Deanna Garciab26afb52023-04-25 13:37:18 -07006419UPB_INLINE const upb_Array* _google_protobuf_DescriptorProto_nested_type_upb_array(const google_protobuf_DescriptorProto* msg, size_t* size) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00006420 const upb_MiniTableField field = {3, UPB_SIZE(16, 40), 0, 1, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
Protobuf Team Bota9387b52024-06-12 15:17:52 +00006421 UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__DescriptorProto_msg_init);
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +00006422 const upb_Array* arr = upb_Message_GetArray(UPB_UPCAST(msg), &field);
Deanna Garciab26afb52023-04-25 13:37:18 -07006423 if (size) {
Protobuf Team Botf73985a2023-12-19 00:14:19 +00006424 *size = arr ? arr->UPB_PRIVATE(size) : 0;
Deanna Garciab26afb52023-04-25 13:37:18 -07006425 }
6426 return arr;
6427}
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +00006428UPB_INLINE upb_Array* _google_protobuf_DescriptorProto_nested_type_mutable_upb_array(google_protobuf_DescriptorProto* msg, size_t* size, upb_Arena* arena) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00006429 const upb_MiniTableField field = {3, UPB_SIZE(16, 40), 0, 1, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
Protobuf Team Bota9387b52024-06-12 15:17:52 +00006430 UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__DescriptorProto_msg_init);
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +00006431 upb_Array* arr = upb_Message_GetOrCreateMutableArray(UPB_UPCAST(msg),
6432 &field, arena);
Deanna Garciab26afb52023-04-25 13:37:18 -07006433 if (size) {
Protobuf Team Botf73985a2023-12-19 00:14:19 +00006434 *size = arr ? arr->UPB_PRIVATE(size) : 0;
Deanna Garciab26afb52023-04-25 13:37:18 -07006435 }
6436 return arr;
6437}
Mike Kruskal3bc50492022-12-01 13:34:12 -08006438UPB_INLINE void google_protobuf_DescriptorProto_clear_enum_type(google_protobuf_DescriptorProto* msg) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00006439 const upb_MiniTableField field = {4, UPB_SIZE(20, 48), 0, 2, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
Protobuf Team Bot4e90ead2024-01-08 15:46:34 +00006440 upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
Joshua Haberman7ecf43f2022-03-14 13:11:29 -07006441}
Eric Salob7d54ac2022-12-29 11:59:42 -08006442UPB_INLINE const google_protobuf_EnumDescriptorProto* const* google_protobuf_DescriptorProto_enum_type(const google_protobuf_DescriptorProto* msg, size_t* size) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00006443 const upb_MiniTableField field = {4, UPB_SIZE(20, 48), 0, 2, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
Protobuf Team Bota9387b52024-06-12 15:17:52 +00006444 UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__EnumDescriptorProto_msg_init);
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +00006445 const upb_Array* arr = upb_Message_GetArray(UPB_UPCAST(msg), &field);
Eric Salob7d54ac2022-12-29 11:59:42 -08006446 if (arr) {
Protobuf Team Botf73985a2023-12-19 00:14:19 +00006447 if (size) *size = arr->UPB_PRIVATE(size);
Protobuf Team Bot81e54332024-01-11 21:04:07 +00006448 return (const google_protobuf_EnumDescriptorProto* const*)upb_Array_DataPtr(arr);
Eric Salob7d54ac2022-12-29 11:59:42 -08006449 } else {
6450 if (size) *size = 0;
6451 return NULL;
6452 }
Joshua Haberman7ecf43f2022-03-14 13:11:29 -07006453}
Deanna Garciab26afb52023-04-25 13:37:18 -07006454UPB_INLINE const upb_Array* _google_protobuf_DescriptorProto_enum_type_upb_array(const google_protobuf_DescriptorProto* msg, size_t* size) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00006455 const upb_MiniTableField field = {4, UPB_SIZE(20, 48), 0, 2, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
Protobuf Team Bota9387b52024-06-12 15:17:52 +00006456 UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__EnumDescriptorProto_msg_init);
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +00006457 const upb_Array* arr = upb_Message_GetArray(UPB_UPCAST(msg), &field);
Deanna Garciab26afb52023-04-25 13:37:18 -07006458 if (size) {
Protobuf Team Botf73985a2023-12-19 00:14:19 +00006459 *size = arr ? arr->UPB_PRIVATE(size) : 0;
Deanna Garciab26afb52023-04-25 13:37:18 -07006460 }
6461 return arr;
6462}
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +00006463UPB_INLINE upb_Array* _google_protobuf_DescriptorProto_enum_type_mutable_upb_array(google_protobuf_DescriptorProto* msg, size_t* size, upb_Arena* arena) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00006464 const upb_MiniTableField field = {4, UPB_SIZE(20, 48), 0, 2, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
Protobuf Team Bota9387b52024-06-12 15:17:52 +00006465 UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__EnumDescriptorProto_msg_init);
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +00006466 upb_Array* arr = upb_Message_GetOrCreateMutableArray(UPB_UPCAST(msg),
6467 &field, arena);
Deanna Garciab26afb52023-04-25 13:37:18 -07006468 if (size) {
Protobuf Team Botf73985a2023-12-19 00:14:19 +00006469 *size = arr ? arr->UPB_PRIVATE(size) : 0;
Deanna Garciab26afb52023-04-25 13:37:18 -07006470 }
6471 return arr;
6472}
Mike Kruskal3bc50492022-12-01 13:34:12 -08006473UPB_INLINE void google_protobuf_DescriptorProto_clear_extension_range(google_protobuf_DescriptorProto* msg) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00006474 const upb_MiniTableField field = {5, UPB_SIZE(24, 56), 0, 3, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
Protobuf Team Bot4e90ead2024-01-08 15:46:34 +00006475 upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
Joshua Haberman7ecf43f2022-03-14 13:11:29 -07006476}
Eric Salob7d54ac2022-12-29 11:59:42 -08006477UPB_INLINE const google_protobuf_DescriptorProto_ExtensionRange* const* google_protobuf_DescriptorProto_extension_range(const google_protobuf_DescriptorProto* msg, size_t* size) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00006478 const upb_MiniTableField field = {5, UPB_SIZE(24, 56), 0, 3, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
Protobuf Team Bota9387b52024-06-12 15:17:52 +00006479 UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__DescriptorProto__ExtensionRange_msg_init);
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +00006480 const upb_Array* arr = upb_Message_GetArray(UPB_UPCAST(msg), &field);
Eric Salob7d54ac2022-12-29 11:59:42 -08006481 if (arr) {
Protobuf Team Botf73985a2023-12-19 00:14:19 +00006482 if (size) *size = arr->UPB_PRIVATE(size);
Protobuf Team Bot81e54332024-01-11 21:04:07 +00006483 return (const google_protobuf_DescriptorProto_ExtensionRange* const*)upb_Array_DataPtr(arr);
Eric Salob7d54ac2022-12-29 11:59:42 -08006484 } else {
6485 if (size) *size = 0;
6486 return NULL;
6487 }
Joshua Haberman7ecf43f2022-03-14 13:11:29 -07006488}
Deanna Garciab26afb52023-04-25 13:37:18 -07006489UPB_INLINE const upb_Array* _google_protobuf_DescriptorProto_extension_range_upb_array(const google_protobuf_DescriptorProto* msg, size_t* size) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00006490 const upb_MiniTableField field = {5, UPB_SIZE(24, 56), 0, 3, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
Protobuf Team Bota9387b52024-06-12 15:17:52 +00006491 UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__DescriptorProto__ExtensionRange_msg_init);
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +00006492 const upb_Array* arr = upb_Message_GetArray(UPB_UPCAST(msg), &field);
Deanna Garciab26afb52023-04-25 13:37:18 -07006493 if (size) {
Protobuf Team Botf73985a2023-12-19 00:14:19 +00006494 *size = arr ? arr->UPB_PRIVATE(size) : 0;
Deanna Garciab26afb52023-04-25 13:37:18 -07006495 }
6496 return arr;
6497}
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +00006498UPB_INLINE upb_Array* _google_protobuf_DescriptorProto_extension_range_mutable_upb_array(google_protobuf_DescriptorProto* msg, size_t* size, upb_Arena* arena) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00006499 const upb_MiniTableField field = {5, UPB_SIZE(24, 56), 0, 3, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
Protobuf Team Bota9387b52024-06-12 15:17:52 +00006500 UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__DescriptorProto__ExtensionRange_msg_init);
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +00006501 upb_Array* arr = upb_Message_GetOrCreateMutableArray(UPB_UPCAST(msg),
6502 &field, arena);
Deanna Garciab26afb52023-04-25 13:37:18 -07006503 if (size) {
Protobuf Team Botf73985a2023-12-19 00:14:19 +00006504 *size = arr ? arr->UPB_PRIVATE(size) : 0;
Deanna Garciab26afb52023-04-25 13:37:18 -07006505 }
6506 return arr;
6507}
Mike Kruskal3bc50492022-12-01 13:34:12 -08006508UPB_INLINE void google_protobuf_DescriptorProto_clear_extension(google_protobuf_DescriptorProto* msg) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00006509 const upb_MiniTableField field = {6, UPB_SIZE(28, 64), 0, 4, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
Protobuf Team Bot4e90ead2024-01-08 15:46:34 +00006510 upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
Joshua Haberman7ecf43f2022-03-14 13:11:29 -07006511}
Eric Salob7d54ac2022-12-29 11:59:42 -08006512UPB_INLINE const google_protobuf_FieldDescriptorProto* const* google_protobuf_DescriptorProto_extension(const google_protobuf_DescriptorProto* msg, size_t* size) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00006513 const upb_MiniTableField field = {6, UPB_SIZE(28, 64), 0, 4, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
Protobuf Team Bota9387b52024-06-12 15:17:52 +00006514 UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__FieldDescriptorProto_msg_init);
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +00006515 const upb_Array* arr = upb_Message_GetArray(UPB_UPCAST(msg), &field);
Eric Salob7d54ac2022-12-29 11:59:42 -08006516 if (arr) {
Protobuf Team Botf73985a2023-12-19 00:14:19 +00006517 if (size) *size = arr->UPB_PRIVATE(size);
Protobuf Team Bot81e54332024-01-11 21:04:07 +00006518 return (const google_protobuf_FieldDescriptorProto* const*)upb_Array_DataPtr(arr);
Eric Salob7d54ac2022-12-29 11:59:42 -08006519 } else {
6520 if (size) *size = 0;
6521 return NULL;
6522 }
Joshua Haberman7ecf43f2022-03-14 13:11:29 -07006523}
Deanna Garciab26afb52023-04-25 13:37:18 -07006524UPB_INLINE const upb_Array* _google_protobuf_DescriptorProto_extension_upb_array(const google_protobuf_DescriptorProto* msg, size_t* size) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00006525 const upb_MiniTableField field = {6, UPB_SIZE(28, 64), 0, 4, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
Protobuf Team Bota9387b52024-06-12 15:17:52 +00006526 UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__FieldDescriptorProto_msg_init);
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +00006527 const upb_Array* arr = upb_Message_GetArray(UPB_UPCAST(msg), &field);
Deanna Garciab26afb52023-04-25 13:37:18 -07006528 if (size) {
Protobuf Team Botf73985a2023-12-19 00:14:19 +00006529 *size = arr ? arr->UPB_PRIVATE(size) : 0;
Deanna Garciab26afb52023-04-25 13:37:18 -07006530 }
6531 return arr;
6532}
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +00006533UPB_INLINE upb_Array* _google_protobuf_DescriptorProto_extension_mutable_upb_array(google_protobuf_DescriptorProto* msg, size_t* size, upb_Arena* arena) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00006534 const upb_MiniTableField field = {6, UPB_SIZE(28, 64), 0, 4, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
Protobuf Team Bota9387b52024-06-12 15:17:52 +00006535 UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__FieldDescriptorProto_msg_init);
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +00006536 upb_Array* arr = upb_Message_GetOrCreateMutableArray(UPB_UPCAST(msg),
6537 &field, arena);
Deanna Garciab26afb52023-04-25 13:37:18 -07006538 if (size) {
Protobuf Team Botf73985a2023-12-19 00:14:19 +00006539 *size = arr ? arr->UPB_PRIVATE(size) : 0;
Deanna Garciab26afb52023-04-25 13:37:18 -07006540 }
6541 return arr;
6542}
Mike Kruskal3bc50492022-12-01 13:34:12 -08006543UPB_INLINE void google_protobuf_DescriptorProto_clear_options(google_protobuf_DescriptorProto* msg) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00006544 const upb_MiniTableField field = {7, UPB_SIZE(32, 72), 65, 5, 11, (int)kUpb_FieldMode_Scalar | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
Protobuf Team Bot4e90ead2024-01-08 15:46:34 +00006545 upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
Joshua Habermand3995ec2022-09-30 16:54:39 -07006546}
Joshua Habermanf41049a2022-01-21 14:41:25 -08006547UPB_INLINE const google_protobuf_MessageOptions* google_protobuf_DescriptorProto_options(const google_protobuf_DescriptorProto* msg) {
Eric Salo8809a112022-11-21 13:01:06 -08006548 const google_protobuf_MessageOptions* default_val = NULL;
6549 const google_protobuf_MessageOptions* ret;
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00006550 const upb_MiniTableField field = {7, UPB_SIZE(32, 72), 65, 5, 11, (int)kUpb_FieldMode_Scalar | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
Protobuf Team Bota9387b52024-06-12 15:17:52 +00006551 UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__MessageOptions_msg_init);
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +00006552 _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field,
6553 &default_val, &ret);
Eric Salo8809a112022-11-21 13:01:06 -08006554 return ret;
Joshua Habermanf41049a2022-01-21 14:41:25 -08006555}
Mike Kruskal3bc50492022-12-01 13:34:12 -08006556UPB_INLINE bool google_protobuf_DescriptorProto_has_options(const google_protobuf_DescriptorProto* msg) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00006557 const upb_MiniTableField field = {7, UPB_SIZE(32, 72), 65, 5, 11, (int)kUpb_FieldMode_Scalar | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
Protobuf Team Bot8c1f6352024-01-10 05:18:15 +00006558 return upb_Message_HasBaseField(UPB_UPCAST(msg), &field);
Joshua Haberman7ecf43f2022-03-14 13:11:29 -07006559}
Mike Kruskal3bc50492022-12-01 13:34:12 -08006560UPB_INLINE void google_protobuf_DescriptorProto_clear_oneof_decl(google_protobuf_DescriptorProto* msg) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00006561 const upb_MiniTableField field = {8, UPB_SIZE(36, 80), 0, 6, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
Protobuf Team Bot4e90ead2024-01-08 15:46:34 +00006562 upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
Joshua Habermand3995ec2022-09-30 16:54:39 -07006563}
Eric Salob7d54ac2022-12-29 11:59:42 -08006564UPB_INLINE const google_protobuf_OneofDescriptorProto* const* google_protobuf_DescriptorProto_oneof_decl(const google_protobuf_DescriptorProto* msg, size_t* size) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00006565 const upb_MiniTableField field = {8, UPB_SIZE(36, 80), 0, 6, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
Protobuf Team Bota9387b52024-06-12 15:17:52 +00006566 UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__OneofDescriptorProto_msg_init);
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +00006567 const upb_Array* arr = upb_Message_GetArray(UPB_UPCAST(msg), &field);
Eric Salob7d54ac2022-12-29 11:59:42 -08006568 if (arr) {
Protobuf Team Botf73985a2023-12-19 00:14:19 +00006569 if (size) *size = arr->UPB_PRIVATE(size);
Protobuf Team Bot81e54332024-01-11 21:04:07 +00006570 return (const google_protobuf_OneofDescriptorProto* const*)upb_Array_DataPtr(arr);
Eric Salob7d54ac2022-12-29 11:59:42 -08006571 } else {
6572 if (size) *size = 0;
6573 return NULL;
6574 }
Joshua Haberman7ecf43f2022-03-14 13:11:29 -07006575}
Deanna Garciab26afb52023-04-25 13:37:18 -07006576UPB_INLINE const upb_Array* _google_protobuf_DescriptorProto_oneof_decl_upb_array(const google_protobuf_DescriptorProto* msg, size_t* size) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00006577 const upb_MiniTableField field = {8, UPB_SIZE(36, 80), 0, 6, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
Protobuf Team Bota9387b52024-06-12 15:17:52 +00006578 UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__OneofDescriptorProto_msg_init);
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +00006579 const upb_Array* arr = upb_Message_GetArray(UPB_UPCAST(msg), &field);
Deanna Garciab26afb52023-04-25 13:37:18 -07006580 if (size) {
Protobuf Team Botf73985a2023-12-19 00:14:19 +00006581 *size = arr ? arr->UPB_PRIVATE(size) : 0;
Deanna Garciab26afb52023-04-25 13:37:18 -07006582 }
6583 return arr;
6584}
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +00006585UPB_INLINE upb_Array* _google_protobuf_DescriptorProto_oneof_decl_mutable_upb_array(google_protobuf_DescriptorProto* msg, size_t* size, upb_Arena* arena) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00006586 const upb_MiniTableField field = {8, UPB_SIZE(36, 80), 0, 6, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
Protobuf Team Bota9387b52024-06-12 15:17:52 +00006587 UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__OneofDescriptorProto_msg_init);
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +00006588 upb_Array* arr = upb_Message_GetOrCreateMutableArray(UPB_UPCAST(msg),
6589 &field, arena);
Deanna Garciab26afb52023-04-25 13:37:18 -07006590 if (size) {
Protobuf Team Botf73985a2023-12-19 00:14:19 +00006591 *size = arr ? arr->UPB_PRIVATE(size) : 0;
Deanna Garciab26afb52023-04-25 13:37:18 -07006592 }
6593 return arr;
6594}
Mike Kruskal3bc50492022-12-01 13:34:12 -08006595UPB_INLINE void google_protobuf_DescriptorProto_clear_reserved_range(google_protobuf_DescriptorProto* msg) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00006596 const upb_MiniTableField field = {9, UPB_SIZE(40, 88), 0, 7, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
Protobuf Team Bot4e90ead2024-01-08 15:46:34 +00006597 upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
Joshua Habermand3995ec2022-09-30 16:54:39 -07006598}
Eric Salob7d54ac2022-12-29 11:59:42 -08006599UPB_INLINE const google_protobuf_DescriptorProto_ReservedRange* const* google_protobuf_DescriptorProto_reserved_range(const google_protobuf_DescriptorProto* msg, size_t* size) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00006600 const upb_MiniTableField field = {9, UPB_SIZE(40, 88), 0, 7, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
Protobuf Team Bota9387b52024-06-12 15:17:52 +00006601 UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__DescriptorProto__ReservedRange_msg_init);
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +00006602 const upb_Array* arr = upb_Message_GetArray(UPB_UPCAST(msg), &field);
Eric Salob7d54ac2022-12-29 11:59:42 -08006603 if (arr) {
Protobuf Team Botf73985a2023-12-19 00:14:19 +00006604 if (size) *size = arr->UPB_PRIVATE(size);
Protobuf Team Bot81e54332024-01-11 21:04:07 +00006605 return (const google_protobuf_DescriptorProto_ReservedRange* const*)upb_Array_DataPtr(arr);
Eric Salob7d54ac2022-12-29 11:59:42 -08006606 } else {
6607 if (size) *size = 0;
6608 return NULL;
6609 }
Joshua Haberman7ecf43f2022-03-14 13:11:29 -07006610}
Deanna Garciab26afb52023-04-25 13:37:18 -07006611UPB_INLINE const upb_Array* _google_protobuf_DescriptorProto_reserved_range_upb_array(const google_protobuf_DescriptorProto* msg, size_t* size) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00006612 const upb_MiniTableField field = {9, UPB_SIZE(40, 88), 0, 7, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
Protobuf Team Bota9387b52024-06-12 15:17:52 +00006613 UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__DescriptorProto__ReservedRange_msg_init);
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +00006614 const upb_Array* arr = upb_Message_GetArray(UPB_UPCAST(msg), &field);
Deanna Garciab26afb52023-04-25 13:37:18 -07006615 if (size) {
Protobuf Team Botf73985a2023-12-19 00:14:19 +00006616 *size = arr ? arr->UPB_PRIVATE(size) : 0;
Deanna Garciab26afb52023-04-25 13:37:18 -07006617 }
6618 return arr;
6619}
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +00006620UPB_INLINE upb_Array* _google_protobuf_DescriptorProto_reserved_range_mutable_upb_array(google_protobuf_DescriptorProto* msg, size_t* size, upb_Arena* arena) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00006621 const upb_MiniTableField field = {9, UPB_SIZE(40, 88), 0, 7, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
Protobuf Team Bota9387b52024-06-12 15:17:52 +00006622 UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__DescriptorProto__ReservedRange_msg_init);
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +00006623 upb_Array* arr = upb_Message_GetOrCreateMutableArray(UPB_UPCAST(msg),
6624 &field, arena);
Deanna Garciab26afb52023-04-25 13:37:18 -07006625 if (size) {
Protobuf Team Botf73985a2023-12-19 00:14:19 +00006626 *size = arr ? arr->UPB_PRIVATE(size) : 0;
Deanna Garciab26afb52023-04-25 13:37:18 -07006627 }
6628 return arr;
6629}
Mike Kruskal3bc50492022-12-01 13:34:12 -08006630UPB_INLINE void google_protobuf_DescriptorProto_clear_reserved_name(google_protobuf_DescriptorProto* msg) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00006631 const upb_MiniTableField field = {10, UPB_SIZE(44, 96), 0, kUpb_NoSub, 12, (int)kUpb_FieldMode_Array | (int)kUpb_LabelFlags_IsAlternate | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
Protobuf Team Bot4e90ead2024-01-08 15:46:34 +00006632 upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
Joshua Habermand3995ec2022-09-30 16:54:39 -07006633}
Eric Salob7d54ac2022-12-29 11:59:42 -08006634UPB_INLINE upb_StringView const* google_protobuf_DescriptorProto_reserved_name(const google_protobuf_DescriptorProto* msg, size_t* size) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00006635 const upb_MiniTableField field = {10, UPB_SIZE(44, 96), 0, kUpb_NoSub, 12, (int)kUpb_FieldMode_Array | (int)kUpb_LabelFlags_IsAlternate | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +00006636 const upb_Array* arr = upb_Message_GetArray(UPB_UPCAST(msg), &field);
Eric Salob7d54ac2022-12-29 11:59:42 -08006637 if (arr) {
Protobuf Team Botf73985a2023-12-19 00:14:19 +00006638 if (size) *size = arr->UPB_PRIVATE(size);
Protobuf Team Bot81e54332024-01-11 21:04:07 +00006639 return (upb_StringView const*)upb_Array_DataPtr(arr);
Eric Salob7d54ac2022-12-29 11:59:42 -08006640 } else {
6641 if (size) *size = 0;
6642 return NULL;
6643 }
Joshua Haberman7ecf43f2022-03-14 13:11:29 -07006644}
Deanna Garciab26afb52023-04-25 13:37:18 -07006645UPB_INLINE const upb_Array* _google_protobuf_DescriptorProto_reserved_name_upb_array(const google_protobuf_DescriptorProto* msg, size_t* size) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00006646 const upb_MiniTableField field = {10, UPB_SIZE(44, 96), 0, kUpb_NoSub, 12, (int)kUpb_FieldMode_Array | (int)kUpb_LabelFlags_IsAlternate | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +00006647 const upb_Array* arr = upb_Message_GetArray(UPB_UPCAST(msg), &field);
Deanna Garciab26afb52023-04-25 13:37:18 -07006648 if (size) {
Protobuf Team Botf73985a2023-12-19 00:14:19 +00006649 *size = arr ? arr->UPB_PRIVATE(size) : 0;
Deanna Garciab26afb52023-04-25 13:37:18 -07006650 }
6651 return arr;
6652}
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +00006653UPB_INLINE upb_Array* _google_protobuf_DescriptorProto_reserved_name_mutable_upb_array(google_protobuf_DescriptorProto* msg, size_t* size, upb_Arena* arena) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00006654 const upb_MiniTableField field = {10, UPB_SIZE(44, 96), 0, kUpb_NoSub, 12, (int)kUpb_FieldMode_Array | (int)kUpb_LabelFlags_IsAlternate | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +00006655 upb_Array* arr = upb_Message_GetOrCreateMutableArray(UPB_UPCAST(msg),
6656 &field, arena);
Deanna Garciab26afb52023-04-25 13:37:18 -07006657 if (size) {
Protobuf Team Botf73985a2023-12-19 00:14:19 +00006658 *size = arr ? arr->UPB_PRIVATE(size) : 0;
Deanna Garciab26afb52023-04-25 13:37:18 -07006659 }
6660 return arr;
6661}
Joshua Haberman9abf6e22021-01-13 12:16:25 -08006662
Joshua Habermanf41049a2022-01-21 14:41:25 -08006663UPB_INLINE void google_protobuf_DescriptorProto_set_name(google_protobuf_DescriptorProto *msg, upb_StringView value) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00006664 const upb_MiniTableField field = {1, UPB_SIZE(48, 16), 64, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
Protobuf Team Botac32c972024-04-10 03:30:05 +00006665 upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
Mike Kruskal232ecf42023-01-14 00:09:40 -08006666}
6667UPB_INLINE google_protobuf_FieldDescriptorProto** google_protobuf_DescriptorProto_mutable_field(google_protobuf_DescriptorProto* msg, size_t* size) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00006668 upb_MiniTableField field = {2, UPB_SIZE(12, 32), 0, 0, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
Protobuf Team Bota9387b52024-06-12 15:17:52 +00006669 UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__FieldDescriptorProto_msg_init);
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +00006670 upb_Array* arr = upb_Message_GetMutableArray(UPB_UPCAST(msg), &field);
Eric Salob7d54ac2022-12-29 11:59:42 -08006671 if (arr) {
Protobuf Team Botf73985a2023-12-19 00:14:19 +00006672 if (size) *size = arr->UPB_PRIVATE(size);
Protobuf Team Bot81e54332024-01-11 21:04:07 +00006673 return (google_protobuf_FieldDescriptorProto**)upb_Array_MutableDataPtr(arr);
Eric Salob7d54ac2022-12-29 11:59:42 -08006674 } else {
6675 if (size) *size = 0;
6676 return NULL;
6677 }
Joshua Haberman9abf6e22021-01-13 12:16:25 -08006678}
Eric Salob7d54ac2022-12-29 11:59:42 -08006679UPB_INLINE google_protobuf_FieldDescriptorProto** google_protobuf_DescriptorProto_resize_field(google_protobuf_DescriptorProto* msg, size_t size, upb_Arena* arena) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00006680 upb_MiniTableField field = {2, UPB_SIZE(12, 32), 0, 0, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +00006681 return (google_protobuf_FieldDescriptorProto**)upb_Message_ResizeArrayUninitialized(UPB_UPCAST(msg),
6682 &field, size, arena);
Joshua Haberman9abf6e22021-01-13 12:16:25 -08006683}
Joshua Haberman7ecf43f2022-03-14 13:11:29 -07006684UPB_INLINE struct google_protobuf_FieldDescriptorProto* google_protobuf_DescriptorProto_add_field(google_protobuf_DescriptorProto* msg, upb_Arena* arena) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00006685 upb_MiniTableField field = {2, UPB_SIZE(12, 32), 0, 0, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
Protobuf Team Bota9387b52024-06-12 15:17:52 +00006686 UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__FieldDescriptorProto_msg_init);
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +00006687 upb_Array* arr = upb_Message_GetOrCreateMutableArray(
6688 UPB_UPCAST(msg), &field, arena);
Protobuf Team Bot81e54332024-01-11 21:04:07 +00006689 if (!arr || !UPB_PRIVATE(_upb_Array_ResizeUninitialized)(
Protobuf Team Botf73985a2023-12-19 00:14:19 +00006690 arr, arr->UPB_PRIVATE(size) + 1, arena)) {
Eric Salob7d54ac2022-12-29 11:59:42 -08006691 return NULL;
6692 }
Protobuf Team Bot4ffe0862023-12-06 02:02:36 +00006693 struct google_protobuf_FieldDescriptorProto* sub = (struct google_protobuf_FieldDescriptorProto*)_upb_Message_New(&google__protobuf__FieldDescriptorProto_msg_init, arena);
Eric Salob7d54ac2022-12-29 11:59:42 -08006694 if (!arr || !sub) return NULL;
Protobuf Team Botf73985a2023-12-19 00:14:19 +00006695 UPB_PRIVATE(_upb_Array_Set)
6696 (arr, arr->UPB_PRIVATE(size) - 1, &sub, sizeof(sub));
Joshua Haberman9abf6e22021-01-13 12:16:25 -08006697 return sub;
6698}
Eric Salob7d54ac2022-12-29 11:59:42 -08006699UPB_INLINE google_protobuf_DescriptorProto** google_protobuf_DescriptorProto_mutable_nested_type(google_protobuf_DescriptorProto* msg, size_t* size) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00006700 upb_MiniTableField field = {3, UPB_SIZE(16, 40), 0, 1, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
Protobuf Team Bota9387b52024-06-12 15:17:52 +00006701 UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__DescriptorProto_msg_init);
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +00006702 upb_Array* arr = upb_Message_GetMutableArray(UPB_UPCAST(msg), &field);
Eric Salob7d54ac2022-12-29 11:59:42 -08006703 if (arr) {
Protobuf Team Botf73985a2023-12-19 00:14:19 +00006704 if (size) *size = arr->UPB_PRIVATE(size);
Protobuf Team Bot81e54332024-01-11 21:04:07 +00006705 return (google_protobuf_DescriptorProto**)upb_Array_MutableDataPtr(arr);
Eric Salob7d54ac2022-12-29 11:59:42 -08006706 } else {
6707 if (size) *size = 0;
6708 return NULL;
6709 }
Joshua Haberman9abf6e22021-01-13 12:16:25 -08006710}
Eric Salob7d54ac2022-12-29 11:59:42 -08006711UPB_INLINE google_protobuf_DescriptorProto** google_protobuf_DescriptorProto_resize_nested_type(google_protobuf_DescriptorProto* msg, size_t size, upb_Arena* arena) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00006712 upb_MiniTableField field = {3, UPB_SIZE(16, 40), 0, 1, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +00006713 return (google_protobuf_DescriptorProto**)upb_Message_ResizeArrayUninitialized(UPB_UPCAST(msg),
6714 &field, size, arena);
Joshua Haberman9abf6e22021-01-13 12:16:25 -08006715}
Joshua Haberman7ecf43f2022-03-14 13:11:29 -07006716UPB_INLINE struct google_protobuf_DescriptorProto* google_protobuf_DescriptorProto_add_nested_type(google_protobuf_DescriptorProto* msg, upb_Arena* arena) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00006717 upb_MiniTableField field = {3, UPB_SIZE(16, 40), 0, 1, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
Protobuf Team Bota9387b52024-06-12 15:17:52 +00006718 UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__DescriptorProto_msg_init);
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +00006719 upb_Array* arr = upb_Message_GetOrCreateMutableArray(
6720 UPB_UPCAST(msg), &field, arena);
Protobuf Team Bot81e54332024-01-11 21:04:07 +00006721 if (!arr || !UPB_PRIVATE(_upb_Array_ResizeUninitialized)(
Protobuf Team Botf73985a2023-12-19 00:14:19 +00006722 arr, arr->UPB_PRIVATE(size) + 1, arena)) {
Eric Salob7d54ac2022-12-29 11:59:42 -08006723 return NULL;
6724 }
Protobuf Team Bot4ffe0862023-12-06 02:02:36 +00006725 struct google_protobuf_DescriptorProto* sub = (struct google_protobuf_DescriptorProto*)_upb_Message_New(&google__protobuf__DescriptorProto_msg_init, arena);
Eric Salob7d54ac2022-12-29 11:59:42 -08006726 if (!arr || !sub) return NULL;
Protobuf Team Botf73985a2023-12-19 00:14:19 +00006727 UPB_PRIVATE(_upb_Array_Set)
6728 (arr, arr->UPB_PRIVATE(size) - 1, &sub, sizeof(sub));
Joshua Haberman9abf6e22021-01-13 12:16:25 -08006729 return sub;
6730}
Eric Salob7d54ac2022-12-29 11:59:42 -08006731UPB_INLINE google_protobuf_EnumDescriptorProto** google_protobuf_DescriptorProto_mutable_enum_type(google_protobuf_DescriptorProto* msg, size_t* size) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00006732 upb_MiniTableField field = {4, UPB_SIZE(20, 48), 0, 2, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
Protobuf Team Bota9387b52024-06-12 15:17:52 +00006733 UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__EnumDescriptorProto_msg_init);
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +00006734 upb_Array* arr = upb_Message_GetMutableArray(UPB_UPCAST(msg), &field);
Eric Salob7d54ac2022-12-29 11:59:42 -08006735 if (arr) {
Protobuf Team Botf73985a2023-12-19 00:14:19 +00006736 if (size) *size = arr->UPB_PRIVATE(size);
Protobuf Team Bot81e54332024-01-11 21:04:07 +00006737 return (google_protobuf_EnumDescriptorProto**)upb_Array_MutableDataPtr(arr);
Eric Salob7d54ac2022-12-29 11:59:42 -08006738 } else {
6739 if (size) *size = 0;
6740 return NULL;
6741 }
Joshua Haberman9abf6e22021-01-13 12:16:25 -08006742}
Eric Salob7d54ac2022-12-29 11:59:42 -08006743UPB_INLINE google_protobuf_EnumDescriptorProto** google_protobuf_DescriptorProto_resize_enum_type(google_protobuf_DescriptorProto* msg, size_t size, upb_Arena* arena) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00006744 upb_MiniTableField field = {4, UPB_SIZE(20, 48), 0, 2, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +00006745 return (google_protobuf_EnumDescriptorProto**)upb_Message_ResizeArrayUninitialized(UPB_UPCAST(msg),
6746 &field, size, arena);
Joshua Haberman9abf6e22021-01-13 12:16:25 -08006747}
Joshua Haberman7ecf43f2022-03-14 13:11:29 -07006748UPB_INLINE struct google_protobuf_EnumDescriptorProto* google_protobuf_DescriptorProto_add_enum_type(google_protobuf_DescriptorProto* msg, upb_Arena* arena) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00006749 upb_MiniTableField field = {4, UPB_SIZE(20, 48), 0, 2, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
Protobuf Team Bota9387b52024-06-12 15:17:52 +00006750 UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__EnumDescriptorProto_msg_init);
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +00006751 upb_Array* arr = upb_Message_GetOrCreateMutableArray(
6752 UPB_UPCAST(msg), &field, arena);
Protobuf Team Bot81e54332024-01-11 21:04:07 +00006753 if (!arr || !UPB_PRIVATE(_upb_Array_ResizeUninitialized)(
Protobuf Team Botf73985a2023-12-19 00:14:19 +00006754 arr, arr->UPB_PRIVATE(size) + 1, arena)) {
Eric Salob7d54ac2022-12-29 11:59:42 -08006755 return NULL;
6756 }
Protobuf Team Bot4ffe0862023-12-06 02:02:36 +00006757 struct google_protobuf_EnumDescriptorProto* sub = (struct google_protobuf_EnumDescriptorProto*)_upb_Message_New(&google__protobuf__EnumDescriptorProto_msg_init, arena);
Eric Salob7d54ac2022-12-29 11:59:42 -08006758 if (!arr || !sub) return NULL;
Protobuf Team Botf73985a2023-12-19 00:14:19 +00006759 UPB_PRIVATE(_upb_Array_Set)
6760 (arr, arr->UPB_PRIVATE(size) - 1, &sub, sizeof(sub));
Joshua Haberman9abf6e22021-01-13 12:16:25 -08006761 return sub;
6762}
Eric Salob7d54ac2022-12-29 11:59:42 -08006763UPB_INLINE google_protobuf_DescriptorProto_ExtensionRange** google_protobuf_DescriptorProto_mutable_extension_range(google_protobuf_DescriptorProto* msg, size_t* size) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00006764 upb_MiniTableField field = {5, UPB_SIZE(24, 56), 0, 3, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
Protobuf Team Bota9387b52024-06-12 15:17:52 +00006765 UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__DescriptorProto__ExtensionRange_msg_init);
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +00006766 upb_Array* arr = upb_Message_GetMutableArray(UPB_UPCAST(msg), &field);
Eric Salob7d54ac2022-12-29 11:59:42 -08006767 if (arr) {
Protobuf Team Botf73985a2023-12-19 00:14:19 +00006768 if (size) *size = arr->UPB_PRIVATE(size);
Protobuf Team Bot81e54332024-01-11 21:04:07 +00006769 return (google_protobuf_DescriptorProto_ExtensionRange**)upb_Array_MutableDataPtr(arr);
Eric Salob7d54ac2022-12-29 11:59:42 -08006770 } else {
6771 if (size) *size = 0;
6772 return NULL;
6773 }
Joshua Haberman9abf6e22021-01-13 12:16:25 -08006774}
Eric Salob7d54ac2022-12-29 11:59:42 -08006775UPB_INLINE google_protobuf_DescriptorProto_ExtensionRange** google_protobuf_DescriptorProto_resize_extension_range(google_protobuf_DescriptorProto* msg, size_t size, upb_Arena* arena) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00006776 upb_MiniTableField field = {5, UPB_SIZE(24, 56), 0, 3, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +00006777 return (google_protobuf_DescriptorProto_ExtensionRange**)upb_Message_ResizeArrayUninitialized(UPB_UPCAST(msg),
6778 &field, size, arena);
Joshua Haberman9abf6e22021-01-13 12:16:25 -08006779}
Joshua Haberman7ecf43f2022-03-14 13:11:29 -07006780UPB_INLINE struct google_protobuf_DescriptorProto_ExtensionRange* google_protobuf_DescriptorProto_add_extension_range(google_protobuf_DescriptorProto* msg, upb_Arena* arena) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00006781 upb_MiniTableField field = {5, UPB_SIZE(24, 56), 0, 3, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
Protobuf Team Bota9387b52024-06-12 15:17:52 +00006782 UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__DescriptorProto__ExtensionRange_msg_init);
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +00006783 upb_Array* arr = upb_Message_GetOrCreateMutableArray(
6784 UPB_UPCAST(msg), &field, arena);
Protobuf Team Bot81e54332024-01-11 21:04:07 +00006785 if (!arr || !UPB_PRIVATE(_upb_Array_ResizeUninitialized)(
Protobuf Team Botf73985a2023-12-19 00:14:19 +00006786 arr, arr->UPB_PRIVATE(size) + 1, arena)) {
Eric Salob7d54ac2022-12-29 11:59:42 -08006787 return NULL;
6788 }
Protobuf Team Bot4ffe0862023-12-06 02:02:36 +00006789 struct google_protobuf_DescriptorProto_ExtensionRange* sub = (struct google_protobuf_DescriptorProto_ExtensionRange*)_upb_Message_New(&google__protobuf__DescriptorProto__ExtensionRange_msg_init, arena);
Eric Salob7d54ac2022-12-29 11:59:42 -08006790 if (!arr || !sub) return NULL;
Protobuf Team Botf73985a2023-12-19 00:14:19 +00006791 UPB_PRIVATE(_upb_Array_Set)
6792 (arr, arr->UPB_PRIVATE(size) - 1, &sub, sizeof(sub));
Joshua Haberman9abf6e22021-01-13 12:16:25 -08006793 return sub;
6794}
Eric Salob7d54ac2022-12-29 11:59:42 -08006795UPB_INLINE google_protobuf_FieldDescriptorProto** google_protobuf_DescriptorProto_mutable_extension(google_protobuf_DescriptorProto* msg, size_t* size) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00006796 upb_MiniTableField field = {6, UPB_SIZE(28, 64), 0, 4, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
Protobuf Team Bota9387b52024-06-12 15:17:52 +00006797 UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__FieldDescriptorProto_msg_init);
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +00006798 upb_Array* arr = upb_Message_GetMutableArray(UPB_UPCAST(msg), &field);
Eric Salob7d54ac2022-12-29 11:59:42 -08006799 if (arr) {
Protobuf Team Botf73985a2023-12-19 00:14:19 +00006800 if (size) *size = arr->UPB_PRIVATE(size);
Protobuf Team Bot81e54332024-01-11 21:04:07 +00006801 return (google_protobuf_FieldDescriptorProto**)upb_Array_MutableDataPtr(arr);
Eric Salob7d54ac2022-12-29 11:59:42 -08006802 } else {
6803 if (size) *size = 0;
6804 return NULL;
6805 }
Joshua Haberman9abf6e22021-01-13 12:16:25 -08006806}
Eric Salob7d54ac2022-12-29 11:59:42 -08006807UPB_INLINE google_protobuf_FieldDescriptorProto** google_protobuf_DescriptorProto_resize_extension(google_protobuf_DescriptorProto* msg, size_t size, upb_Arena* arena) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00006808 upb_MiniTableField field = {6, UPB_SIZE(28, 64), 0, 4, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +00006809 return (google_protobuf_FieldDescriptorProto**)upb_Message_ResizeArrayUninitialized(UPB_UPCAST(msg),
6810 &field, size, arena);
Joshua Haberman9abf6e22021-01-13 12:16:25 -08006811}
Joshua Haberman7ecf43f2022-03-14 13:11:29 -07006812UPB_INLINE struct google_protobuf_FieldDescriptorProto* google_protobuf_DescriptorProto_add_extension(google_protobuf_DescriptorProto* msg, upb_Arena* arena) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00006813 upb_MiniTableField field = {6, UPB_SIZE(28, 64), 0, 4, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
Protobuf Team Bota9387b52024-06-12 15:17:52 +00006814 UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__FieldDescriptorProto_msg_init);
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +00006815 upb_Array* arr = upb_Message_GetOrCreateMutableArray(
6816 UPB_UPCAST(msg), &field, arena);
Protobuf Team Bot81e54332024-01-11 21:04:07 +00006817 if (!arr || !UPB_PRIVATE(_upb_Array_ResizeUninitialized)(
Protobuf Team Botf73985a2023-12-19 00:14:19 +00006818 arr, arr->UPB_PRIVATE(size) + 1, arena)) {
Eric Salob7d54ac2022-12-29 11:59:42 -08006819 return NULL;
6820 }
Protobuf Team Bot4ffe0862023-12-06 02:02:36 +00006821 struct google_protobuf_FieldDescriptorProto* sub = (struct google_protobuf_FieldDescriptorProto*)_upb_Message_New(&google__protobuf__FieldDescriptorProto_msg_init, arena);
Eric Salob7d54ac2022-12-29 11:59:42 -08006822 if (!arr || !sub) return NULL;
Protobuf Team Botf73985a2023-12-19 00:14:19 +00006823 UPB_PRIVATE(_upb_Array_Set)
6824 (arr, arr->UPB_PRIVATE(size) - 1, &sub, sizeof(sub));
Joshua Haberman9abf6e22021-01-13 12:16:25 -08006825 return sub;
6826}
6827UPB_INLINE void google_protobuf_DescriptorProto_set_options(google_protobuf_DescriptorProto *msg, google_protobuf_MessageOptions* value) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00006828 const upb_MiniTableField field = {7, UPB_SIZE(32, 72), 65, 5, 11, (int)kUpb_FieldMode_Scalar | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
Protobuf Team Bota9387b52024-06-12 15:17:52 +00006829 UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__MessageOptions_msg_init);
Protobuf Team Botac32c972024-04-10 03:30:05 +00006830 upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
Mike Kruskal232ecf42023-01-14 00:09:40 -08006831}
6832UPB_INLINE struct google_protobuf_MessageOptions* google_protobuf_DescriptorProto_mutable_options(google_protobuf_DescriptorProto* msg, upb_Arena* arena) {
Joshua Haberman9abf6e22021-01-13 12:16:25 -08006833 struct google_protobuf_MessageOptions* sub = (struct google_protobuf_MessageOptions*)google_protobuf_DescriptorProto_options(msg);
6834 if (sub == NULL) {
Protobuf Team Bot4ffe0862023-12-06 02:02:36 +00006835 sub = (struct google_protobuf_MessageOptions*)_upb_Message_New(&google__protobuf__MessageOptions_msg_init, arena);
Eric Salo8809a112022-11-21 13:01:06 -08006836 if (sub) google_protobuf_DescriptorProto_set_options(msg, sub);
Joshua Haberman9abf6e22021-01-13 12:16:25 -08006837 }
6838 return sub;
6839}
Eric Salob7d54ac2022-12-29 11:59:42 -08006840UPB_INLINE google_protobuf_OneofDescriptorProto** google_protobuf_DescriptorProto_mutable_oneof_decl(google_protobuf_DescriptorProto* msg, size_t* size) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00006841 upb_MiniTableField field = {8, UPB_SIZE(36, 80), 0, 6, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
Protobuf Team Bota9387b52024-06-12 15:17:52 +00006842 UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__OneofDescriptorProto_msg_init);
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +00006843 upb_Array* arr = upb_Message_GetMutableArray(UPB_UPCAST(msg), &field);
Eric Salob7d54ac2022-12-29 11:59:42 -08006844 if (arr) {
Protobuf Team Botf73985a2023-12-19 00:14:19 +00006845 if (size) *size = arr->UPB_PRIVATE(size);
Protobuf Team Bot81e54332024-01-11 21:04:07 +00006846 return (google_protobuf_OneofDescriptorProto**)upb_Array_MutableDataPtr(arr);
Eric Salob7d54ac2022-12-29 11:59:42 -08006847 } else {
6848 if (size) *size = 0;
6849 return NULL;
6850 }
Joshua Haberman9abf6e22021-01-13 12:16:25 -08006851}
Eric Salob7d54ac2022-12-29 11:59:42 -08006852UPB_INLINE google_protobuf_OneofDescriptorProto** google_protobuf_DescriptorProto_resize_oneof_decl(google_protobuf_DescriptorProto* msg, size_t size, upb_Arena* arena) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00006853 upb_MiniTableField field = {8, UPB_SIZE(36, 80), 0, 6, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +00006854 return (google_protobuf_OneofDescriptorProto**)upb_Message_ResizeArrayUninitialized(UPB_UPCAST(msg),
6855 &field, size, arena);
Joshua Haberman9abf6e22021-01-13 12:16:25 -08006856}
Joshua Haberman7ecf43f2022-03-14 13:11:29 -07006857UPB_INLINE struct google_protobuf_OneofDescriptorProto* google_protobuf_DescriptorProto_add_oneof_decl(google_protobuf_DescriptorProto* msg, upb_Arena* arena) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00006858 upb_MiniTableField field = {8, UPB_SIZE(36, 80), 0, 6, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
Protobuf Team Bota9387b52024-06-12 15:17:52 +00006859 UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__OneofDescriptorProto_msg_init);
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +00006860 upb_Array* arr = upb_Message_GetOrCreateMutableArray(
6861 UPB_UPCAST(msg), &field, arena);
Protobuf Team Bot81e54332024-01-11 21:04:07 +00006862 if (!arr || !UPB_PRIVATE(_upb_Array_ResizeUninitialized)(
Protobuf Team Botf73985a2023-12-19 00:14:19 +00006863 arr, arr->UPB_PRIVATE(size) + 1, arena)) {
Eric Salob7d54ac2022-12-29 11:59:42 -08006864 return NULL;
6865 }
Protobuf Team Bot4ffe0862023-12-06 02:02:36 +00006866 struct google_protobuf_OneofDescriptorProto* sub = (struct google_protobuf_OneofDescriptorProto*)_upb_Message_New(&google__protobuf__OneofDescriptorProto_msg_init, arena);
Eric Salob7d54ac2022-12-29 11:59:42 -08006867 if (!arr || !sub) return NULL;
Protobuf Team Botf73985a2023-12-19 00:14:19 +00006868 UPB_PRIVATE(_upb_Array_Set)
6869 (arr, arr->UPB_PRIVATE(size) - 1, &sub, sizeof(sub));
Joshua Haberman9abf6e22021-01-13 12:16:25 -08006870 return sub;
6871}
Eric Salob7d54ac2022-12-29 11:59:42 -08006872UPB_INLINE google_protobuf_DescriptorProto_ReservedRange** google_protobuf_DescriptorProto_mutable_reserved_range(google_protobuf_DescriptorProto* msg, size_t* size) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00006873 upb_MiniTableField field = {9, UPB_SIZE(40, 88), 0, 7, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
Protobuf Team Bota9387b52024-06-12 15:17:52 +00006874 UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__DescriptorProto__ReservedRange_msg_init);
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +00006875 upb_Array* arr = upb_Message_GetMutableArray(UPB_UPCAST(msg), &field);
Eric Salob7d54ac2022-12-29 11:59:42 -08006876 if (arr) {
Protobuf Team Botf73985a2023-12-19 00:14:19 +00006877 if (size) *size = arr->UPB_PRIVATE(size);
Protobuf Team Bot81e54332024-01-11 21:04:07 +00006878 return (google_protobuf_DescriptorProto_ReservedRange**)upb_Array_MutableDataPtr(arr);
Eric Salob7d54ac2022-12-29 11:59:42 -08006879 } else {
6880 if (size) *size = 0;
6881 return NULL;
6882 }
Joshua Haberman9abf6e22021-01-13 12:16:25 -08006883}
Eric Salob7d54ac2022-12-29 11:59:42 -08006884UPB_INLINE google_protobuf_DescriptorProto_ReservedRange** google_protobuf_DescriptorProto_resize_reserved_range(google_protobuf_DescriptorProto* msg, size_t size, upb_Arena* arena) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00006885 upb_MiniTableField field = {9, UPB_SIZE(40, 88), 0, 7, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +00006886 return (google_protobuf_DescriptorProto_ReservedRange**)upb_Message_ResizeArrayUninitialized(UPB_UPCAST(msg),
6887 &field, size, arena);
Joshua Haberman9abf6e22021-01-13 12:16:25 -08006888}
Joshua Haberman7ecf43f2022-03-14 13:11:29 -07006889UPB_INLINE struct google_protobuf_DescriptorProto_ReservedRange* google_protobuf_DescriptorProto_add_reserved_range(google_protobuf_DescriptorProto* msg, upb_Arena* arena) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00006890 upb_MiniTableField field = {9, UPB_SIZE(40, 88), 0, 7, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
Protobuf Team Bota9387b52024-06-12 15:17:52 +00006891 UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__DescriptorProto__ReservedRange_msg_init);
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +00006892 upb_Array* arr = upb_Message_GetOrCreateMutableArray(
6893 UPB_UPCAST(msg), &field, arena);
Protobuf Team Bot81e54332024-01-11 21:04:07 +00006894 if (!arr || !UPB_PRIVATE(_upb_Array_ResizeUninitialized)(
Protobuf Team Botf73985a2023-12-19 00:14:19 +00006895 arr, arr->UPB_PRIVATE(size) + 1, arena)) {
Eric Salob7d54ac2022-12-29 11:59:42 -08006896 return NULL;
6897 }
Protobuf Team Bot4ffe0862023-12-06 02:02:36 +00006898 struct google_protobuf_DescriptorProto_ReservedRange* sub = (struct google_protobuf_DescriptorProto_ReservedRange*)_upb_Message_New(&google__protobuf__DescriptorProto__ReservedRange_msg_init, arena);
Eric Salob7d54ac2022-12-29 11:59:42 -08006899 if (!arr || !sub) return NULL;
Protobuf Team Botf73985a2023-12-19 00:14:19 +00006900 UPB_PRIVATE(_upb_Array_Set)
6901 (arr, arr->UPB_PRIVATE(size) - 1, &sub, sizeof(sub));
Joshua Haberman9abf6e22021-01-13 12:16:25 -08006902 return sub;
6903}
Eric Salob7d54ac2022-12-29 11:59:42 -08006904UPB_INLINE upb_StringView* google_protobuf_DescriptorProto_mutable_reserved_name(google_protobuf_DescriptorProto* msg, size_t* size) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00006905 upb_MiniTableField field = {10, UPB_SIZE(44, 96), 0, kUpb_NoSub, 12, (int)kUpb_FieldMode_Array | (int)kUpb_LabelFlags_IsAlternate | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +00006906 upb_Array* arr = upb_Message_GetMutableArray(UPB_UPCAST(msg), &field);
Eric Salob7d54ac2022-12-29 11:59:42 -08006907 if (arr) {
Protobuf Team Botf73985a2023-12-19 00:14:19 +00006908 if (size) *size = arr->UPB_PRIVATE(size);
Protobuf Team Bot81e54332024-01-11 21:04:07 +00006909 return (upb_StringView*)upb_Array_MutableDataPtr(arr);
Eric Salob7d54ac2022-12-29 11:59:42 -08006910 } else {
6911 if (size) *size = 0;
6912 return NULL;
6913 }
Joshua Haberman9abf6e22021-01-13 12:16:25 -08006914}
Eric Salob7d54ac2022-12-29 11:59:42 -08006915UPB_INLINE upb_StringView* google_protobuf_DescriptorProto_resize_reserved_name(google_protobuf_DescriptorProto* msg, size_t size, upb_Arena* arena) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00006916 upb_MiniTableField field = {10, UPB_SIZE(44, 96), 0, kUpb_NoSub, 12, (int)kUpb_FieldMode_Array | (int)kUpb_LabelFlags_IsAlternate | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +00006917 return (upb_StringView*)upb_Message_ResizeArrayUninitialized(UPB_UPCAST(msg),
6918 &field, size, arena);
Joshua Haberman9abf6e22021-01-13 12:16:25 -08006919}
Joshua Haberman7ecf43f2022-03-14 13:11:29 -07006920UPB_INLINE bool google_protobuf_DescriptorProto_add_reserved_name(google_protobuf_DescriptorProto* msg, upb_StringView val, upb_Arena* arena) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00006921 upb_MiniTableField field = {10, UPB_SIZE(44, 96), 0, kUpb_NoSub, 12, (int)kUpb_FieldMode_Array | (int)kUpb_LabelFlags_IsAlternate | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +00006922 upb_Array* arr = upb_Message_GetOrCreateMutableArray(
6923 UPB_UPCAST(msg), &field, arena);
Protobuf Team Bot81e54332024-01-11 21:04:07 +00006924 if (!arr || !UPB_PRIVATE(_upb_Array_ResizeUninitialized)(
Protobuf Team Botf73985a2023-12-19 00:14:19 +00006925 arr, arr->UPB_PRIVATE(size) + 1, arena)) {
Eric Salob7d54ac2022-12-29 11:59:42 -08006926 return false;
6927 }
Protobuf Team Botf73985a2023-12-19 00:14:19 +00006928 UPB_PRIVATE(_upb_Array_Set)
6929 (arr, arr->UPB_PRIVATE(size) - 1, &val, sizeof(val));
Eric Salob7d54ac2022-12-29 11:59:42 -08006930 return true;
Joshua Haberman9abf6e22021-01-13 12:16:25 -08006931}
6932
6933/* google.protobuf.DescriptorProto.ExtensionRange */
6934
Joshua Habermanf41049a2022-01-21 14:41:25 -08006935UPB_INLINE google_protobuf_DescriptorProto_ExtensionRange* google_protobuf_DescriptorProto_ExtensionRange_new(upb_Arena* arena) {
Protobuf Team Bot4ffe0862023-12-06 02:02:36 +00006936 return (google_protobuf_DescriptorProto_ExtensionRange*)_upb_Message_New(&google__protobuf__DescriptorProto__ExtensionRange_msg_init, arena);
Joshua Haberman9abf6e22021-01-13 12:16:25 -08006937}
Joshua Habermanf41049a2022-01-21 14:41:25 -08006938UPB_INLINE google_protobuf_DescriptorProto_ExtensionRange* google_protobuf_DescriptorProto_ExtensionRange_parse(const char* buf, size_t size, upb_Arena* arena) {
6939 google_protobuf_DescriptorProto_ExtensionRange* ret = google_protobuf_DescriptorProto_ExtensionRange_new(arena);
Joshua Haberman9d578a32021-08-02 15:32:01 -07006940 if (!ret) return NULL;
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +00006941 if (upb_Decode(buf, size, UPB_UPCAST(ret), &google__protobuf__DescriptorProto__ExtensionRange_msg_init, NULL, 0, arena) !=
6942 kUpb_DecodeStatus_Ok) {
Joshua Haberman9d578a32021-08-02 15:32:01 -07006943 return NULL;
6944 }
6945 return ret;
Joshua Haberman9abf6e22021-01-13 12:16:25 -08006946}
Joshua Habermanf41049a2022-01-21 14:41:25 -08006947UPB_INLINE google_protobuf_DescriptorProto_ExtensionRange* google_protobuf_DescriptorProto_ExtensionRange_parse_ex(const char* buf, size_t size,
6948 const upb_ExtensionRegistry* extreg,
6949 int options, upb_Arena* arena) {
6950 google_protobuf_DescriptorProto_ExtensionRange* ret = google_protobuf_DescriptorProto_ExtensionRange_new(arena);
6951 if (!ret) return NULL;
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +00006952 if (upb_Decode(buf, size, UPB_UPCAST(ret), &google__protobuf__DescriptorProto__ExtensionRange_msg_init, extreg, options,
6953 arena) != kUpb_DecodeStatus_Ok) {
Joshua Habermanf41049a2022-01-21 14:41:25 -08006954 return NULL;
6955 }
6956 return ret;
Joshua Haberman9abf6e22021-01-13 12:16:25 -08006957}
Joshua Habermanf41049a2022-01-21 14:41:25 -08006958UPB_INLINE char* google_protobuf_DescriptorProto_ExtensionRange_serialize(const google_protobuf_DescriptorProto_ExtensionRange* msg, upb_Arena* arena, size_t* len) {
Joshua Habermand3995ec2022-09-30 16:54:39 -07006959 char* ptr;
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +00006960 (void)upb_Encode(UPB_UPCAST(msg), &google__protobuf__DescriptorProto__ExtensionRange_msg_init, 0, arena, &ptr, len);
Joshua Habermand3995ec2022-09-30 16:54:39 -07006961 return ptr;
Joshua Habermanf41049a2022-01-21 14:41:25 -08006962}
6963UPB_INLINE char* google_protobuf_DescriptorProto_ExtensionRange_serialize_ex(const google_protobuf_DescriptorProto_ExtensionRange* msg, int options,
6964 upb_Arena* arena, size_t* len) {
Joshua Habermand3995ec2022-09-30 16:54:39 -07006965 char* ptr;
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +00006966 (void)upb_Encode(UPB_UPCAST(msg), &google__protobuf__DescriptorProto__ExtensionRange_msg_init, options, arena, &ptr, len);
Joshua Habermand3995ec2022-09-30 16:54:39 -07006967 return ptr;
Joshua Habermanf41049a2022-01-21 14:41:25 -08006968}
Mike Kruskal3bc50492022-12-01 13:34:12 -08006969UPB_INLINE void google_protobuf_DescriptorProto_ExtensionRange_clear_start(google_protobuf_DescriptorProto_ExtensionRange* msg) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00006970 const upb_MiniTableField field = {1, 12, 64, kUpb_NoSub, 5, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
Protobuf Team Bot4e90ead2024-01-08 15:46:34 +00006971 upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
Joshua Habermand3995ec2022-09-30 16:54:39 -07006972}
Joshua Habermanf41049a2022-01-21 14:41:25 -08006973UPB_INLINE int32_t google_protobuf_DescriptorProto_ExtensionRange_start(const google_protobuf_DescriptorProto_ExtensionRange* msg) {
Eric Salo8809a112022-11-21 13:01:06 -08006974 int32_t default_val = (int32_t)0;
6975 int32_t ret;
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00006976 const upb_MiniTableField field = {1, 12, 64, kUpb_NoSub, 5, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +00006977 _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field,
6978 &default_val, &ret);
Eric Salo8809a112022-11-21 13:01:06 -08006979 return ret;
Joshua Habermanf41049a2022-01-21 14:41:25 -08006980}
Mike Kruskal3bc50492022-12-01 13:34:12 -08006981UPB_INLINE bool google_protobuf_DescriptorProto_ExtensionRange_has_start(const google_protobuf_DescriptorProto_ExtensionRange* msg) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00006982 const upb_MiniTableField field = {1, 12, 64, kUpb_NoSub, 5, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
Protobuf Team Bot8c1f6352024-01-10 05:18:15 +00006983 return upb_Message_HasBaseField(UPB_UPCAST(msg), &field);
Joshua Haberman7ecf43f2022-03-14 13:11:29 -07006984}
Mike Kruskal3bc50492022-12-01 13:34:12 -08006985UPB_INLINE void google_protobuf_DescriptorProto_ExtensionRange_clear_end(google_protobuf_DescriptorProto_ExtensionRange* msg) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00006986 const upb_MiniTableField field = {2, 16, 65, kUpb_NoSub, 5, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
Protobuf Team Bot4e90ead2024-01-08 15:46:34 +00006987 upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
Joshua Habermand3995ec2022-09-30 16:54:39 -07006988}
Joshua Habermanf41049a2022-01-21 14:41:25 -08006989UPB_INLINE int32_t google_protobuf_DescriptorProto_ExtensionRange_end(const google_protobuf_DescriptorProto_ExtensionRange* msg) {
Eric Salo8809a112022-11-21 13:01:06 -08006990 int32_t default_val = (int32_t)0;
6991 int32_t ret;
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00006992 const upb_MiniTableField field = {2, 16, 65, kUpb_NoSub, 5, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +00006993 _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field,
6994 &default_val, &ret);
Eric Salo8809a112022-11-21 13:01:06 -08006995 return ret;
Joshua Habermanf41049a2022-01-21 14:41:25 -08006996}
Mike Kruskal3bc50492022-12-01 13:34:12 -08006997UPB_INLINE bool google_protobuf_DescriptorProto_ExtensionRange_has_end(const google_protobuf_DescriptorProto_ExtensionRange* msg) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00006998 const upb_MiniTableField field = {2, 16, 65, kUpb_NoSub, 5, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
Protobuf Team Bot8c1f6352024-01-10 05:18:15 +00006999 return upb_Message_HasBaseField(UPB_UPCAST(msg), &field);
Joshua Haberman7ecf43f2022-03-14 13:11:29 -07007000}
Mike Kruskal3bc50492022-12-01 13:34:12 -08007001UPB_INLINE void google_protobuf_DescriptorProto_ExtensionRange_clear_options(google_protobuf_DescriptorProto_ExtensionRange* msg) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00007002 const upb_MiniTableField field = {3, UPB_SIZE(20, 24), 66, 0, 11, (int)kUpb_FieldMode_Scalar | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
Protobuf Team Bot4e90ead2024-01-08 15:46:34 +00007003 upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
Joshua Habermand3995ec2022-09-30 16:54:39 -07007004}
Joshua Habermanf41049a2022-01-21 14:41:25 -08007005UPB_INLINE const google_protobuf_ExtensionRangeOptions* google_protobuf_DescriptorProto_ExtensionRange_options(const google_protobuf_DescriptorProto_ExtensionRange* msg) {
Eric Salo8809a112022-11-21 13:01:06 -08007006 const google_protobuf_ExtensionRangeOptions* default_val = NULL;
7007 const google_protobuf_ExtensionRangeOptions* ret;
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00007008 const upb_MiniTableField field = {3, UPB_SIZE(20, 24), 66, 0, 11, (int)kUpb_FieldMode_Scalar | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
Protobuf Team Bota9387b52024-06-12 15:17:52 +00007009 UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__ExtensionRangeOptions_msg_init);
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +00007010 _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field,
7011 &default_val, &ret);
Eric Salo8809a112022-11-21 13:01:06 -08007012 return ret;
Joshua Habermanf41049a2022-01-21 14:41:25 -08007013}
Mike Kruskal3bc50492022-12-01 13:34:12 -08007014UPB_INLINE bool google_protobuf_DescriptorProto_ExtensionRange_has_options(const google_protobuf_DescriptorProto_ExtensionRange* msg) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00007015 const upb_MiniTableField field = {3, UPB_SIZE(20, 24), 66, 0, 11, (int)kUpb_FieldMode_Scalar | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
Protobuf Team Bot8c1f6352024-01-10 05:18:15 +00007016 return upb_Message_HasBaseField(UPB_UPCAST(msg), &field);
Mike Kruskal3bc50492022-12-01 13:34:12 -08007017}
Joshua Haberman9abf6e22021-01-13 12:16:25 -08007018
7019UPB_INLINE void google_protobuf_DescriptorProto_ExtensionRange_set_start(google_protobuf_DescriptorProto_ExtensionRange *msg, int32_t value) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00007020 const upb_MiniTableField field = {1, 12, 64, kUpb_NoSub, 5, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
Protobuf Team Botac32c972024-04-10 03:30:05 +00007021 upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
Mike Kruskal232ecf42023-01-14 00:09:40 -08007022}
7023UPB_INLINE void google_protobuf_DescriptorProto_ExtensionRange_set_end(google_protobuf_DescriptorProto_ExtensionRange *msg, int32_t value) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00007024 const upb_MiniTableField field = {2, 16, 65, kUpb_NoSub, 5, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
Protobuf Team Botac32c972024-04-10 03:30:05 +00007025 upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
Mike Kruskal232ecf42023-01-14 00:09:40 -08007026}
7027UPB_INLINE void google_protobuf_DescriptorProto_ExtensionRange_set_options(google_protobuf_DescriptorProto_ExtensionRange *msg, google_protobuf_ExtensionRangeOptions* value) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00007028 const upb_MiniTableField field = {3, UPB_SIZE(20, 24), 66, 0, 11, (int)kUpb_FieldMode_Scalar | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
Protobuf Team Bota9387b52024-06-12 15:17:52 +00007029 UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__ExtensionRangeOptions_msg_init);
Protobuf Team Botac32c972024-04-10 03:30:05 +00007030 upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
Mike Kruskal232ecf42023-01-14 00:09:40 -08007031}
7032UPB_INLINE struct google_protobuf_ExtensionRangeOptions* google_protobuf_DescriptorProto_ExtensionRange_mutable_options(google_protobuf_DescriptorProto_ExtensionRange* msg, upb_Arena* arena) {
Joshua Haberman9abf6e22021-01-13 12:16:25 -08007033 struct google_protobuf_ExtensionRangeOptions* sub = (struct google_protobuf_ExtensionRangeOptions*)google_protobuf_DescriptorProto_ExtensionRange_options(msg);
7034 if (sub == NULL) {
Protobuf Team Bot4ffe0862023-12-06 02:02:36 +00007035 sub = (struct google_protobuf_ExtensionRangeOptions*)_upb_Message_New(&google__protobuf__ExtensionRangeOptions_msg_init, arena);
Eric Salo8809a112022-11-21 13:01:06 -08007036 if (sub) google_protobuf_DescriptorProto_ExtensionRange_set_options(msg, sub);
Joshua Haberman9abf6e22021-01-13 12:16:25 -08007037 }
7038 return sub;
7039}
7040
7041/* google.protobuf.DescriptorProto.ReservedRange */
7042
Joshua Habermanf41049a2022-01-21 14:41:25 -08007043UPB_INLINE google_protobuf_DescriptorProto_ReservedRange* google_protobuf_DescriptorProto_ReservedRange_new(upb_Arena* arena) {
Protobuf Team Bot4ffe0862023-12-06 02:02:36 +00007044 return (google_protobuf_DescriptorProto_ReservedRange*)_upb_Message_New(&google__protobuf__DescriptorProto__ReservedRange_msg_init, arena);
Joshua Haberman9abf6e22021-01-13 12:16:25 -08007045}
Joshua Habermanf41049a2022-01-21 14:41:25 -08007046UPB_INLINE google_protobuf_DescriptorProto_ReservedRange* google_protobuf_DescriptorProto_ReservedRange_parse(const char* buf, size_t size, upb_Arena* arena) {
7047 google_protobuf_DescriptorProto_ReservedRange* ret = google_protobuf_DescriptorProto_ReservedRange_new(arena);
Joshua Haberman9d578a32021-08-02 15:32:01 -07007048 if (!ret) return NULL;
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +00007049 if (upb_Decode(buf, size, UPB_UPCAST(ret), &google__protobuf__DescriptorProto__ReservedRange_msg_init, NULL, 0, arena) !=
7050 kUpb_DecodeStatus_Ok) {
Joshua Haberman9d578a32021-08-02 15:32:01 -07007051 return NULL;
7052 }
7053 return ret;
Joshua Haberman9abf6e22021-01-13 12:16:25 -08007054}
Joshua Habermanf41049a2022-01-21 14:41:25 -08007055UPB_INLINE google_protobuf_DescriptorProto_ReservedRange* google_protobuf_DescriptorProto_ReservedRange_parse_ex(const char* buf, size_t size,
7056 const upb_ExtensionRegistry* extreg,
7057 int options, upb_Arena* arena) {
7058 google_protobuf_DescriptorProto_ReservedRange* ret = google_protobuf_DescriptorProto_ReservedRange_new(arena);
7059 if (!ret) return NULL;
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +00007060 if (upb_Decode(buf, size, UPB_UPCAST(ret), &google__protobuf__DescriptorProto__ReservedRange_msg_init, extreg, options,
7061 arena) != kUpb_DecodeStatus_Ok) {
Joshua Habermanf41049a2022-01-21 14:41:25 -08007062 return NULL;
7063 }
7064 return ret;
Joshua Haberman9abf6e22021-01-13 12:16:25 -08007065}
Joshua Habermanf41049a2022-01-21 14:41:25 -08007066UPB_INLINE char* google_protobuf_DescriptorProto_ReservedRange_serialize(const google_protobuf_DescriptorProto_ReservedRange* msg, upb_Arena* arena, size_t* len) {
Joshua Habermand3995ec2022-09-30 16:54:39 -07007067 char* ptr;
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +00007068 (void)upb_Encode(UPB_UPCAST(msg), &google__protobuf__DescriptorProto__ReservedRange_msg_init, 0, arena, &ptr, len);
Joshua Habermand3995ec2022-09-30 16:54:39 -07007069 return ptr;
Joshua Habermanf41049a2022-01-21 14:41:25 -08007070}
7071UPB_INLINE char* google_protobuf_DescriptorProto_ReservedRange_serialize_ex(const google_protobuf_DescriptorProto_ReservedRange* msg, int options,
7072 upb_Arena* arena, size_t* len) {
Joshua Habermand3995ec2022-09-30 16:54:39 -07007073 char* ptr;
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +00007074 (void)upb_Encode(UPB_UPCAST(msg), &google__protobuf__DescriptorProto__ReservedRange_msg_init, options, arena, &ptr, len);
Joshua Habermand3995ec2022-09-30 16:54:39 -07007075 return ptr;
Joshua Habermanf41049a2022-01-21 14:41:25 -08007076}
Mike Kruskal3bc50492022-12-01 13:34:12 -08007077UPB_INLINE void google_protobuf_DescriptorProto_ReservedRange_clear_start(google_protobuf_DescriptorProto_ReservedRange* msg) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00007078 const upb_MiniTableField field = {1, 12, 64, kUpb_NoSub, 5, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
Protobuf Team Bot4e90ead2024-01-08 15:46:34 +00007079 upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
Joshua Habermand3995ec2022-09-30 16:54:39 -07007080}
Joshua Habermanf41049a2022-01-21 14:41:25 -08007081UPB_INLINE int32_t google_protobuf_DescriptorProto_ReservedRange_start(const google_protobuf_DescriptorProto_ReservedRange* msg) {
Eric Salo8809a112022-11-21 13:01:06 -08007082 int32_t default_val = (int32_t)0;
7083 int32_t ret;
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00007084 const upb_MiniTableField field = {1, 12, 64, kUpb_NoSub, 5, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +00007085 _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field,
7086 &default_val, &ret);
Eric Salo8809a112022-11-21 13:01:06 -08007087 return ret;
Joshua Habermanf41049a2022-01-21 14:41:25 -08007088}
Mike Kruskal3bc50492022-12-01 13:34:12 -08007089UPB_INLINE bool google_protobuf_DescriptorProto_ReservedRange_has_start(const google_protobuf_DescriptorProto_ReservedRange* msg) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00007090 const upb_MiniTableField field = {1, 12, 64, kUpb_NoSub, 5, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
Protobuf Team Bot8c1f6352024-01-10 05:18:15 +00007091 return upb_Message_HasBaseField(UPB_UPCAST(msg), &field);
Joshua Haberman7ecf43f2022-03-14 13:11:29 -07007092}
Mike Kruskal3bc50492022-12-01 13:34:12 -08007093UPB_INLINE void google_protobuf_DescriptorProto_ReservedRange_clear_end(google_protobuf_DescriptorProto_ReservedRange* msg) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00007094 const upb_MiniTableField field = {2, 16, 65, kUpb_NoSub, 5, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
Protobuf Team Bot4e90ead2024-01-08 15:46:34 +00007095 upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
Joshua Habermand3995ec2022-09-30 16:54:39 -07007096}
Joshua Habermanf41049a2022-01-21 14:41:25 -08007097UPB_INLINE int32_t google_protobuf_DescriptorProto_ReservedRange_end(const google_protobuf_DescriptorProto_ReservedRange* msg) {
Eric Salo8809a112022-11-21 13:01:06 -08007098 int32_t default_val = (int32_t)0;
7099 int32_t ret;
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00007100 const upb_MiniTableField field = {2, 16, 65, kUpb_NoSub, 5, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +00007101 _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field,
7102 &default_val, &ret);
Eric Salo8809a112022-11-21 13:01:06 -08007103 return ret;
Joshua Habermanf41049a2022-01-21 14:41:25 -08007104}
Mike Kruskal3bc50492022-12-01 13:34:12 -08007105UPB_INLINE bool google_protobuf_DescriptorProto_ReservedRange_has_end(const google_protobuf_DescriptorProto_ReservedRange* msg) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00007106 const upb_MiniTableField field = {2, 16, 65, kUpb_NoSub, 5, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
Protobuf Team Bot8c1f6352024-01-10 05:18:15 +00007107 return upb_Message_HasBaseField(UPB_UPCAST(msg), &field);
Mike Kruskal3bc50492022-12-01 13:34:12 -08007108}
Joshua Haberman9abf6e22021-01-13 12:16:25 -08007109
7110UPB_INLINE void google_protobuf_DescriptorProto_ReservedRange_set_start(google_protobuf_DescriptorProto_ReservedRange *msg, int32_t value) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00007111 const upb_MiniTableField field = {1, 12, 64, kUpb_NoSub, 5, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
Protobuf Team Botac32c972024-04-10 03:30:05 +00007112 upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
Mike Kruskal232ecf42023-01-14 00:09:40 -08007113}
7114UPB_INLINE void google_protobuf_DescriptorProto_ReservedRange_set_end(google_protobuf_DescriptorProto_ReservedRange *msg, int32_t value) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00007115 const upb_MiniTableField field = {2, 16, 65, kUpb_NoSub, 5, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
Protobuf Team Botac32c972024-04-10 03:30:05 +00007116 upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
Joshua Haberman9abf6e22021-01-13 12:16:25 -08007117}
Mike Kruskal232ecf42023-01-14 00:09:40 -08007118
Joshua Haberman9abf6e22021-01-13 12:16:25 -08007119/* google.protobuf.ExtensionRangeOptions */
7120
Joshua Habermanf41049a2022-01-21 14:41:25 -08007121UPB_INLINE google_protobuf_ExtensionRangeOptions* google_protobuf_ExtensionRangeOptions_new(upb_Arena* arena) {
Protobuf Team Bot4ffe0862023-12-06 02:02:36 +00007122 return (google_protobuf_ExtensionRangeOptions*)_upb_Message_New(&google__protobuf__ExtensionRangeOptions_msg_init, arena);
Joshua Haberman9abf6e22021-01-13 12:16:25 -08007123}
Joshua Habermanf41049a2022-01-21 14:41:25 -08007124UPB_INLINE google_protobuf_ExtensionRangeOptions* google_protobuf_ExtensionRangeOptions_parse(const char* buf, size_t size, upb_Arena* arena) {
7125 google_protobuf_ExtensionRangeOptions* ret = google_protobuf_ExtensionRangeOptions_new(arena);
Joshua Haberman9d578a32021-08-02 15:32:01 -07007126 if (!ret) return NULL;
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +00007127 if (upb_Decode(buf, size, UPB_UPCAST(ret), &google__protobuf__ExtensionRangeOptions_msg_init, NULL, 0, arena) !=
7128 kUpb_DecodeStatus_Ok) {
Joshua Haberman9d578a32021-08-02 15:32:01 -07007129 return NULL;
7130 }
7131 return ret;
Joshua Haberman9abf6e22021-01-13 12:16:25 -08007132}
Joshua Habermanf41049a2022-01-21 14:41:25 -08007133UPB_INLINE google_protobuf_ExtensionRangeOptions* google_protobuf_ExtensionRangeOptions_parse_ex(const char* buf, size_t size,
7134 const upb_ExtensionRegistry* extreg,
7135 int options, upb_Arena* arena) {
7136 google_protobuf_ExtensionRangeOptions* ret = google_protobuf_ExtensionRangeOptions_new(arena);
7137 if (!ret) return NULL;
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +00007138 if (upb_Decode(buf, size, UPB_UPCAST(ret), &google__protobuf__ExtensionRangeOptions_msg_init, extreg, options,
7139 arena) != kUpb_DecodeStatus_Ok) {
Joshua Habermanf41049a2022-01-21 14:41:25 -08007140 return NULL;
7141 }
7142 return ret;
Joshua Haberman9abf6e22021-01-13 12:16:25 -08007143}
Joshua Habermanf41049a2022-01-21 14:41:25 -08007144UPB_INLINE char* google_protobuf_ExtensionRangeOptions_serialize(const google_protobuf_ExtensionRangeOptions* msg, upb_Arena* arena, size_t* len) {
Joshua Habermand3995ec2022-09-30 16:54:39 -07007145 char* ptr;
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +00007146 (void)upb_Encode(UPB_UPCAST(msg), &google__protobuf__ExtensionRangeOptions_msg_init, 0, arena, &ptr, len);
Joshua Habermand3995ec2022-09-30 16:54:39 -07007147 return ptr;
Joshua Habermanf41049a2022-01-21 14:41:25 -08007148}
7149UPB_INLINE char* google_protobuf_ExtensionRangeOptions_serialize_ex(const google_protobuf_ExtensionRangeOptions* msg, int options,
7150 upb_Arena* arena, size_t* len) {
Joshua Habermand3995ec2022-09-30 16:54:39 -07007151 char* ptr;
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +00007152 (void)upb_Encode(UPB_UPCAST(msg), &google__protobuf__ExtensionRangeOptions_msg_init, options, arena, &ptr, len);
Joshua Habermand3995ec2022-09-30 16:54:39 -07007153 return ptr;
Joshua Habermanf41049a2022-01-21 14:41:25 -08007154}
Mike Kruskal145900f2023-03-27 09:55:52 -07007155UPB_INLINE void google_protobuf_ExtensionRangeOptions_clear_declaration(google_protobuf_ExtensionRangeOptions* msg) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00007156 const upb_MiniTableField field = {2, UPB_SIZE(12, 16), 0, 0, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
Protobuf Team Bot4e90ead2024-01-08 15:46:34 +00007157 upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
Mike Kruskal145900f2023-03-27 09:55:52 -07007158}
7159UPB_INLINE const google_protobuf_ExtensionRangeOptions_Declaration* const* google_protobuf_ExtensionRangeOptions_declaration(const google_protobuf_ExtensionRangeOptions* msg, size_t* size) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00007160 const upb_MiniTableField field = {2, UPB_SIZE(12, 16), 0, 0, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
Protobuf Team Bota9387b52024-06-12 15:17:52 +00007161 UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__ExtensionRangeOptions__Declaration_msg_init);
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +00007162 const upb_Array* arr = upb_Message_GetArray(UPB_UPCAST(msg), &field);
Mike Kruskal145900f2023-03-27 09:55:52 -07007163 if (arr) {
Protobuf Team Botf73985a2023-12-19 00:14:19 +00007164 if (size) *size = arr->UPB_PRIVATE(size);
Protobuf Team Bot81e54332024-01-11 21:04:07 +00007165 return (const google_protobuf_ExtensionRangeOptions_Declaration* const*)upb_Array_DataPtr(arr);
Mike Kruskal145900f2023-03-27 09:55:52 -07007166 } else {
7167 if (size) *size = 0;
7168 return NULL;
7169 }
7170}
Deanna Garciab26afb52023-04-25 13:37:18 -07007171UPB_INLINE const upb_Array* _google_protobuf_ExtensionRangeOptions_declaration_upb_array(const google_protobuf_ExtensionRangeOptions* msg, size_t* size) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00007172 const upb_MiniTableField field = {2, UPB_SIZE(12, 16), 0, 0, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
Protobuf Team Bota9387b52024-06-12 15:17:52 +00007173 UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__ExtensionRangeOptions__Declaration_msg_init);
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +00007174 const upb_Array* arr = upb_Message_GetArray(UPB_UPCAST(msg), &field);
Deanna Garciab26afb52023-04-25 13:37:18 -07007175 if (size) {
Protobuf Team Botf73985a2023-12-19 00:14:19 +00007176 *size = arr ? arr->UPB_PRIVATE(size) : 0;
Deanna Garciab26afb52023-04-25 13:37:18 -07007177 }
7178 return arr;
7179}
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +00007180UPB_INLINE upb_Array* _google_protobuf_ExtensionRangeOptions_declaration_mutable_upb_array(google_protobuf_ExtensionRangeOptions* msg, size_t* size, upb_Arena* arena) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00007181 const upb_MiniTableField field = {2, UPB_SIZE(12, 16), 0, 0, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
Protobuf Team Bota9387b52024-06-12 15:17:52 +00007182 UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__ExtensionRangeOptions__Declaration_msg_init);
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +00007183 upb_Array* arr = upb_Message_GetOrCreateMutableArray(UPB_UPCAST(msg),
7184 &field, arena);
Deanna Garciab26afb52023-04-25 13:37:18 -07007185 if (size) {
Protobuf Team Botf73985a2023-12-19 00:14:19 +00007186 *size = arr ? arr->UPB_PRIVATE(size) : 0;
Deanna Garciab26afb52023-04-25 13:37:18 -07007187 }
7188 return arr;
7189}
Protobuf Team Bot469f0272023-04-21 18:12:45 -07007190UPB_INLINE void google_protobuf_ExtensionRangeOptions_clear_verification(google_protobuf_ExtensionRangeOptions* msg) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00007191 const upb_MiniTableField field = {3, UPB_SIZE(16, 12), 64, 3, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
Protobuf Team Bot4e90ead2024-01-08 15:46:34 +00007192 upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
Protobuf Team Bot469f0272023-04-21 18:12:45 -07007193}
7194UPB_INLINE int32_t google_protobuf_ExtensionRangeOptions_verification(const google_protobuf_ExtensionRangeOptions* msg) {
7195 int32_t default_val = 1;
7196 int32_t ret;
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00007197 const upb_MiniTableField field = {3, UPB_SIZE(16, 12), 64, 3, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +00007198 _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field,
7199 &default_val, &ret);
Protobuf Team Bot469f0272023-04-21 18:12:45 -07007200 return ret;
7201}
7202UPB_INLINE bool google_protobuf_ExtensionRangeOptions_has_verification(const google_protobuf_ExtensionRangeOptions* msg) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00007203 const upb_MiniTableField field = {3, UPB_SIZE(16, 12), 64, 3, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
Protobuf Team Bot8c1f6352024-01-10 05:18:15 +00007204 return upb_Message_HasBaseField(UPB_UPCAST(msg), &field);
Mike Kruskal4f9e4172023-06-30 20:14:50 -07007205}
7206UPB_INLINE void google_protobuf_ExtensionRangeOptions_clear_features(google_protobuf_ExtensionRangeOptions* msg) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00007207 const upb_MiniTableField field = {50, UPB_SIZE(20, 24), 65, 1, 11, (int)kUpb_FieldMode_Scalar | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
Protobuf Team Bot4e90ead2024-01-08 15:46:34 +00007208 upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
Mike Kruskal4f9e4172023-06-30 20:14:50 -07007209}
7210UPB_INLINE const google_protobuf_FeatureSet* google_protobuf_ExtensionRangeOptions_features(const google_protobuf_ExtensionRangeOptions* msg) {
7211 const google_protobuf_FeatureSet* default_val = NULL;
7212 const google_protobuf_FeatureSet* ret;
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00007213 const upb_MiniTableField field = {50, UPB_SIZE(20, 24), 65, 1, 11, (int)kUpb_FieldMode_Scalar | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
Protobuf Team Bota9387b52024-06-12 15:17:52 +00007214 UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__FeatureSet_msg_init);
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +00007215 _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field,
7216 &default_val, &ret);
Mike Kruskal4f9e4172023-06-30 20:14:50 -07007217 return ret;
7218}
7219UPB_INLINE bool google_protobuf_ExtensionRangeOptions_has_features(const google_protobuf_ExtensionRangeOptions* msg) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00007220 const upb_MiniTableField field = {50, UPB_SIZE(20, 24), 65, 1, 11, (int)kUpb_FieldMode_Scalar | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
Protobuf Team Bot8c1f6352024-01-10 05:18:15 +00007221 return upb_Message_HasBaseField(UPB_UPCAST(msg), &field);
Protobuf Team Bot469f0272023-04-21 18:12:45 -07007222}
Mike Kruskal3bc50492022-12-01 13:34:12 -08007223UPB_INLINE void google_protobuf_ExtensionRangeOptions_clear_uninterpreted_option(google_protobuf_ExtensionRangeOptions* msg) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00007224 const upb_MiniTableField field = {999, UPB_SIZE(24, 32), 0, 2, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
Protobuf Team Bot4e90ead2024-01-08 15:46:34 +00007225 upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
Joshua Habermand3995ec2022-09-30 16:54:39 -07007226}
Eric Salob7d54ac2022-12-29 11:59:42 -08007227UPB_INLINE const google_protobuf_UninterpretedOption* const* google_protobuf_ExtensionRangeOptions_uninterpreted_option(const google_protobuf_ExtensionRangeOptions* msg, size_t* size) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00007228 const upb_MiniTableField field = {999, UPB_SIZE(24, 32), 0, 2, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
Protobuf Team Bota9387b52024-06-12 15:17:52 +00007229 UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__UninterpretedOption_msg_init);
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +00007230 const upb_Array* arr = upb_Message_GetArray(UPB_UPCAST(msg), &field);
Eric Salob7d54ac2022-12-29 11:59:42 -08007231 if (arr) {
Protobuf Team Botf73985a2023-12-19 00:14:19 +00007232 if (size) *size = arr->UPB_PRIVATE(size);
Protobuf Team Bot81e54332024-01-11 21:04:07 +00007233 return (const google_protobuf_UninterpretedOption* const*)upb_Array_DataPtr(arr);
Eric Salob7d54ac2022-12-29 11:59:42 -08007234 } else {
7235 if (size) *size = 0;
7236 return NULL;
7237 }
Joshua Haberman7ecf43f2022-03-14 13:11:29 -07007238}
Deanna Garciab26afb52023-04-25 13:37:18 -07007239UPB_INLINE const upb_Array* _google_protobuf_ExtensionRangeOptions_uninterpreted_option_upb_array(const google_protobuf_ExtensionRangeOptions* msg, size_t* size) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00007240 const upb_MiniTableField field = {999, UPB_SIZE(24, 32), 0, 2, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
Protobuf Team Bota9387b52024-06-12 15:17:52 +00007241 UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__UninterpretedOption_msg_init);
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +00007242 const upb_Array* arr = upb_Message_GetArray(UPB_UPCAST(msg), &field);
Deanna Garciab26afb52023-04-25 13:37:18 -07007243 if (size) {
Protobuf Team Botf73985a2023-12-19 00:14:19 +00007244 *size = arr ? arr->UPB_PRIVATE(size) : 0;
Deanna Garciab26afb52023-04-25 13:37:18 -07007245 }
7246 return arr;
7247}
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +00007248UPB_INLINE upb_Array* _google_protobuf_ExtensionRangeOptions_uninterpreted_option_mutable_upb_array(google_protobuf_ExtensionRangeOptions* msg, size_t* size, upb_Arena* arena) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00007249 const upb_MiniTableField field = {999, UPB_SIZE(24, 32), 0, 2, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
Protobuf Team Bota9387b52024-06-12 15:17:52 +00007250 UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__UninterpretedOption_msg_init);
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +00007251 upb_Array* arr = upb_Message_GetOrCreateMutableArray(UPB_UPCAST(msg),
7252 &field, arena);
Deanna Garciab26afb52023-04-25 13:37:18 -07007253 if (size) {
Protobuf Team Botf73985a2023-12-19 00:14:19 +00007254 *size = arr ? arr->UPB_PRIVATE(size) : 0;
Deanna Garciab26afb52023-04-25 13:37:18 -07007255 }
7256 return arr;
7257}
Joshua Haberman9abf6e22021-01-13 12:16:25 -08007258
Mike Kruskal145900f2023-03-27 09:55:52 -07007259UPB_INLINE google_protobuf_ExtensionRangeOptions_Declaration** google_protobuf_ExtensionRangeOptions_mutable_declaration(google_protobuf_ExtensionRangeOptions* msg, size_t* size) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00007260 upb_MiniTableField field = {2, UPB_SIZE(12, 16), 0, 0, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
Protobuf Team Bota9387b52024-06-12 15:17:52 +00007261 UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__ExtensionRangeOptions__Declaration_msg_init);
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +00007262 upb_Array* arr = upb_Message_GetMutableArray(UPB_UPCAST(msg), &field);
Mike Kruskal145900f2023-03-27 09:55:52 -07007263 if (arr) {
Protobuf Team Botf73985a2023-12-19 00:14:19 +00007264 if (size) *size = arr->UPB_PRIVATE(size);
Protobuf Team Bot81e54332024-01-11 21:04:07 +00007265 return (google_protobuf_ExtensionRangeOptions_Declaration**)upb_Array_MutableDataPtr(arr);
Mike Kruskal145900f2023-03-27 09:55:52 -07007266 } else {
7267 if (size) *size = 0;
7268 return NULL;
7269 }
7270}
7271UPB_INLINE google_protobuf_ExtensionRangeOptions_Declaration** google_protobuf_ExtensionRangeOptions_resize_declaration(google_protobuf_ExtensionRangeOptions* msg, size_t size, upb_Arena* arena) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00007272 upb_MiniTableField field = {2, UPB_SIZE(12, 16), 0, 0, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +00007273 return (google_protobuf_ExtensionRangeOptions_Declaration**)upb_Message_ResizeArrayUninitialized(UPB_UPCAST(msg),
7274 &field, size, arena);
Mike Kruskal145900f2023-03-27 09:55:52 -07007275}
7276UPB_INLINE struct google_protobuf_ExtensionRangeOptions_Declaration* google_protobuf_ExtensionRangeOptions_add_declaration(google_protobuf_ExtensionRangeOptions* msg, upb_Arena* arena) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00007277 upb_MiniTableField field = {2, UPB_SIZE(12, 16), 0, 0, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
Protobuf Team Bota9387b52024-06-12 15:17:52 +00007278 UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__ExtensionRangeOptions__Declaration_msg_init);
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +00007279 upb_Array* arr = upb_Message_GetOrCreateMutableArray(
7280 UPB_UPCAST(msg), &field, arena);
Protobuf Team Bot81e54332024-01-11 21:04:07 +00007281 if (!arr || !UPB_PRIVATE(_upb_Array_ResizeUninitialized)(
Protobuf Team Botf73985a2023-12-19 00:14:19 +00007282 arr, arr->UPB_PRIVATE(size) + 1, arena)) {
Mike Kruskal145900f2023-03-27 09:55:52 -07007283 return NULL;
7284 }
Protobuf Team Bot4ffe0862023-12-06 02:02:36 +00007285 struct google_protobuf_ExtensionRangeOptions_Declaration* sub = (struct google_protobuf_ExtensionRangeOptions_Declaration*)_upb_Message_New(&google__protobuf__ExtensionRangeOptions__Declaration_msg_init, arena);
Mike Kruskal145900f2023-03-27 09:55:52 -07007286 if (!arr || !sub) return NULL;
Protobuf Team Botf73985a2023-12-19 00:14:19 +00007287 UPB_PRIVATE(_upb_Array_Set)
7288 (arr, arr->UPB_PRIVATE(size) - 1, &sub, sizeof(sub));
Mike Kruskal145900f2023-03-27 09:55:52 -07007289 return sub;
7290}
Protobuf Team Bot469f0272023-04-21 18:12:45 -07007291UPB_INLINE void google_protobuf_ExtensionRangeOptions_set_verification(google_protobuf_ExtensionRangeOptions *msg, int32_t value) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00007292 const upb_MiniTableField field = {3, UPB_SIZE(16, 12), 64, 3, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
Protobuf Team Botac32c972024-04-10 03:30:05 +00007293 upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
Protobuf Team Bot469f0272023-04-21 18:12:45 -07007294}
Mike Kruskal4f9e4172023-06-30 20:14:50 -07007295UPB_INLINE void google_protobuf_ExtensionRangeOptions_set_features(google_protobuf_ExtensionRangeOptions *msg, google_protobuf_FeatureSet* value) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00007296 const upb_MiniTableField field = {50, UPB_SIZE(20, 24), 65, 1, 11, (int)kUpb_FieldMode_Scalar | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
Protobuf Team Bota9387b52024-06-12 15:17:52 +00007297 UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__FeatureSet_msg_init);
Protobuf Team Botac32c972024-04-10 03:30:05 +00007298 upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
Mike Kruskal4f9e4172023-06-30 20:14:50 -07007299}
7300UPB_INLINE struct google_protobuf_FeatureSet* google_protobuf_ExtensionRangeOptions_mutable_features(google_protobuf_ExtensionRangeOptions* msg, upb_Arena* arena) {
7301 struct google_protobuf_FeatureSet* sub = (struct google_protobuf_FeatureSet*)google_protobuf_ExtensionRangeOptions_features(msg);
7302 if (sub == NULL) {
Protobuf Team Bot4ffe0862023-12-06 02:02:36 +00007303 sub = (struct google_protobuf_FeatureSet*)_upb_Message_New(&google__protobuf__FeatureSet_msg_init, arena);
Mike Kruskal4f9e4172023-06-30 20:14:50 -07007304 if (sub) google_protobuf_ExtensionRangeOptions_set_features(msg, sub);
7305 }
7306 return sub;
7307}
Eric Salob7d54ac2022-12-29 11:59:42 -08007308UPB_INLINE google_protobuf_UninterpretedOption** google_protobuf_ExtensionRangeOptions_mutable_uninterpreted_option(google_protobuf_ExtensionRangeOptions* msg, size_t* size) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00007309 upb_MiniTableField field = {999, UPB_SIZE(24, 32), 0, 2, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
Protobuf Team Bota9387b52024-06-12 15:17:52 +00007310 UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__UninterpretedOption_msg_init);
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +00007311 upb_Array* arr = upb_Message_GetMutableArray(UPB_UPCAST(msg), &field);
Eric Salob7d54ac2022-12-29 11:59:42 -08007312 if (arr) {
Protobuf Team Botf73985a2023-12-19 00:14:19 +00007313 if (size) *size = arr->UPB_PRIVATE(size);
Protobuf Team Bot81e54332024-01-11 21:04:07 +00007314 return (google_protobuf_UninterpretedOption**)upb_Array_MutableDataPtr(arr);
Eric Salob7d54ac2022-12-29 11:59:42 -08007315 } else {
7316 if (size) *size = 0;
7317 return NULL;
7318 }
Joshua Haberman9abf6e22021-01-13 12:16:25 -08007319}
Eric Salob7d54ac2022-12-29 11:59:42 -08007320UPB_INLINE google_protobuf_UninterpretedOption** google_protobuf_ExtensionRangeOptions_resize_uninterpreted_option(google_protobuf_ExtensionRangeOptions* msg, size_t size, upb_Arena* arena) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00007321 upb_MiniTableField field = {999, UPB_SIZE(24, 32), 0, 2, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +00007322 return (google_protobuf_UninterpretedOption**)upb_Message_ResizeArrayUninitialized(UPB_UPCAST(msg),
7323 &field, size, arena);
Joshua Haberman9abf6e22021-01-13 12:16:25 -08007324}
Joshua Haberman7ecf43f2022-03-14 13:11:29 -07007325UPB_INLINE struct google_protobuf_UninterpretedOption* google_protobuf_ExtensionRangeOptions_add_uninterpreted_option(google_protobuf_ExtensionRangeOptions* msg, upb_Arena* arena) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00007326 upb_MiniTableField field = {999, UPB_SIZE(24, 32), 0, 2, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
Protobuf Team Bota9387b52024-06-12 15:17:52 +00007327 UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__UninterpretedOption_msg_init);
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +00007328 upb_Array* arr = upb_Message_GetOrCreateMutableArray(
7329 UPB_UPCAST(msg), &field, arena);
Protobuf Team Bot81e54332024-01-11 21:04:07 +00007330 if (!arr || !UPB_PRIVATE(_upb_Array_ResizeUninitialized)(
Protobuf Team Botf73985a2023-12-19 00:14:19 +00007331 arr, arr->UPB_PRIVATE(size) + 1, arena)) {
Eric Salob7d54ac2022-12-29 11:59:42 -08007332 return NULL;
7333 }
Protobuf Team Bot4ffe0862023-12-06 02:02:36 +00007334 struct google_protobuf_UninterpretedOption* sub = (struct google_protobuf_UninterpretedOption*)_upb_Message_New(&google__protobuf__UninterpretedOption_msg_init, arena);
Eric Salob7d54ac2022-12-29 11:59:42 -08007335 if (!arr || !sub) return NULL;
Protobuf Team Botf73985a2023-12-19 00:14:19 +00007336 UPB_PRIVATE(_upb_Array_Set)
7337 (arr, arr->UPB_PRIVATE(size) - 1, &sub, sizeof(sub));
Joshua Haberman9abf6e22021-01-13 12:16:25 -08007338 return sub;
7339}
7340
Mike Kruskal145900f2023-03-27 09:55:52 -07007341/* google.protobuf.ExtensionRangeOptions.Declaration */
7342
7343UPB_INLINE google_protobuf_ExtensionRangeOptions_Declaration* google_protobuf_ExtensionRangeOptions_Declaration_new(upb_Arena* arena) {
Protobuf Team Bot4ffe0862023-12-06 02:02:36 +00007344 return (google_protobuf_ExtensionRangeOptions_Declaration*)_upb_Message_New(&google__protobuf__ExtensionRangeOptions__Declaration_msg_init, arena);
Mike Kruskal145900f2023-03-27 09:55:52 -07007345}
7346UPB_INLINE google_protobuf_ExtensionRangeOptions_Declaration* google_protobuf_ExtensionRangeOptions_Declaration_parse(const char* buf, size_t size, upb_Arena* arena) {
7347 google_protobuf_ExtensionRangeOptions_Declaration* ret = google_protobuf_ExtensionRangeOptions_Declaration_new(arena);
7348 if (!ret) return NULL;
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +00007349 if (upb_Decode(buf, size, UPB_UPCAST(ret), &google__protobuf__ExtensionRangeOptions__Declaration_msg_init, NULL, 0, arena) !=
7350 kUpb_DecodeStatus_Ok) {
Mike Kruskal145900f2023-03-27 09:55:52 -07007351 return NULL;
7352 }
7353 return ret;
7354}
7355UPB_INLINE google_protobuf_ExtensionRangeOptions_Declaration* google_protobuf_ExtensionRangeOptions_Declaration_parse_ex(const char* buf, size_t size,
7356 const upb_ExtensionRegistry* extreg,
7357 int options, upb_Arena* arena) {
7358 google_protobuf_ExtensionRangeOptions_Declaration* ret = google_protobuf_ExtensionRangeOptions_Declaration_new(arena);
7359 if (!ret) return NULL;
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +00007360 if (upb_Decode(buf, size, UPB_UPCAST(ret), &google__protobuf__ExtensionRangeOptions__Declaration_msg_init, extreg, options,
7361 arena) != kUpb_DecodeStatus_Ok) {
Mike Kruskal145900f2023-03-27 09:55:52 -07007362 return NULL;
7363 }
7364 return ret;
7365}
7366UPB_INLINE char* google_protobuf_ExtensionRangeOptions_Declaration_serialize(const google_protobuf_ExtensionRangeOptions_Declaration* msg, upb_Arena* arena, size_t* len) {
7367 char* ptr;
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +00007368 (void)upb_Encode(UPB_UPCAST(msg), &google__protobuf__ExtensionRangeOptions__Declaration_msg_init, 0, arena, &ptr, len);
Mike Kruskal145900f2023-03-27 09:55:52 -07007369 return ptr;
7370}
7371UPB_INLINE char* google_protobuf_ExtensionRangeOptions_Declaration_serialize_ex(const google_protobuf_ExtensionRangeOptions_Declaration* msg, int options,
7372 upb_Arena* arena, size_t* len) {
7373 char* ptr;
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +00007374 (void)upb_Encode(UPB_UPCAST(msg), &google__protobuf__ExtensionRangeOptions__Declaration_msg_init, options, arena, &ptr, len);
Mike Kruskal145900f2023-03-27 09:55:52 -07007375 return ptr;
7376}
7377UPB_INLINE void google_protobuf_ExtensionRangeOptions_Declaration_clear_number(google_protobuf_ExtensionRangeOptions_Declaration* msg) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00007378 const upb_MiniTableField field = {1, 12, 64, kUpb_NoSub, 5, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
Protobuf Team Bot4e90ead2024-01-08 15:46:34 +00007379 upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
Mike Kruskal145900f2023-03-27 09:55:52 -07007380}
7381UPB_INLINE int32_t google_protobuf_ExtensionRangeOptions_Declaration_number(const google_protobuf_ExtensionRangeOptions_Declaration* msg) {
7382 int32_t default_val = (int32_t)0;
7383 int32_t ret;
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00007384 const upb_MiniTableField field = {1, 12, 64, kUpb_NoSub, 5, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +00007385 _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field,
7386 &default_val, &ret);
Mike Kruskal145900f2023-03-27 09:55:52 -07007387 return ret;
7388}
7389UPB_INLINE bool google_protobuf_ExtensionRangeOptions_Declaration_has_number(const google_protobuf_ExtensionRangeOptions_Declaration* msg) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00007390 const upb_MiniTableField field = {1, 12, 64, kUpb_NoSub, 5, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
Protobuf Team Bot8c1f6352024-01-10 05:18:15 +00007391 return upb_Message_HasBaseField(UPB_UPCAST(msg), &field);
Mike Kruskal145900f2023-03-27 09:55:52 -07007392}
7393UPB_INLINE void google_protobuf_ExtensionRangeOptions_Declaration_clear_full_name(google_protobuf_ExtensionRangeOptions_Declaration* msg) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00007394 const upb_MiniTableField field = {2, UPB_SIZE(20, 24), 65, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
Protobuf Team Bot4e90ead2024-01-08 15:46:34 +00007395 upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
Mike Kruskal145900f2023-03-27 09:55:52 -07007396}
7397UPB_INLINE upb_StringView google_protobuf_ExtensionRangeOptions_Declaration_full_name(const google_protobuf_ExtensionRangeOptions_Declaration* msg) {
7398 upb_StringView default_val = upb_StringView_FromString("");
7399 upb_StringView ret;
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00007400 const upb_MiniTableField field = {2, UPB_SIZE(20, 24), 65, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +00007401 _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field,
7402 &default_val, &ret);
Mike Kruskal145900f2023-03-27 09:55:52 -07007403 return ret;
7404}
7405UPB_INLINE bool google_protobuf_ExtensionRangeOptions_Declaration_has_full_name(const google_protobuf_ExtensionRangeOptions_Declaration* msg) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00007406 const upb_MiniTableField field = {2, UPB_SIZE(20, 24), 65, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
Protobuf Team Bot8c1f6352024-01-10 05:18:15 +00007407 return upb_Message_HasBaseField(UPB_UPCAST(msg), &field);
Mike Kruskal145900f2023-03-27 09:55:52 -07007408}
7409UPB_INLINE void google_protobuf_ExtensionRangeOptions_Declaration_clear_type(google_protobuf_ExtensionRangeOptions_Declaration* msg) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00007410 const upb_MiniTableField field = {3, UPB_SIZE(28, 40), 66, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
Protobuf Team Bot4e90ead2024-01-08 15:46:34 +00007411 upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
Mike Kruskal145900f2023-03-27 09:55:52 -07007412}
7413UPB_INLINE upb_StringView google_protobuf_ExtensionRangeOptions_Declaration_type(const google_protobuf_ExtensionRangeOptions_Declaration* msg) {
7414 upb_StringView default_val = upb_StringView_FromString("");
7415 upb_StringView ret;
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00007416 const upb_MiniTableField field = {3, UPB_SIZE(28, 40), 66, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +00007417 _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field,
7418 &default_val, &ret);
Mike Kruskal145900f2023-03-27 09:55:52 -07007419 return ret;
7420}
7421UPB_INLINE bool google_protobuf_ExtensionRangeOptions_Declaration_has_type(const google_protobuf_ExtensionRangeOptions_Declaration* msg) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00007422 const upb_MiniTableField field = {3, UPB_SIZE(28, 40), 66, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
Protobuf Team Bot8c1f6352024-01-10 05:18:15 +00007423 return upb_Message_HasBaseField(UPB_UPCAST(msg), &field);
Mike Kruskal145900f2023-03-27 09:55:52 -07007424}
Protobuf Team Bot41287bd2023-04-10 18:57:14 -07007425UPB_INLINE void google_protobuf_ExtensionRangeOptions_Declaration_clear_reserved(google_protobuf_ExtensionRangeOptions_Declaration* msg) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00007426 const upb_MiniTableField field = {5, 16, 67, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
Protobuf Team Bot4e90ead2024-01-08 15:46:34 +00007427 upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
Protobuf Team Bot41287bd2023-04-10 18:57:14 -07007428}
7429UPB_INLINE bool google_protobuf_ExtensionRangeOptions_Declaration_reserved(const google_protobuf_ExtensionRangeOptions_Declaration* msg) {
7430 bool default_val = false;
7431 bool ret;
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00007432 const upb_MiniTableField field = {5, 16, 67, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +00007433 _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field,
7434 &default_val, &ret);
Protobuf Team Bot41287bd2023-04-10 18:57:14 -07007435 return ret;
7436}
7437UPB_INLINE bool google_protobuf_ExtensionRangeOptions_Declaration_has_reserved(const google_protobuf_ExtensionRangeOptions_Declaration* msg) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00007438 const upb_MiniTableField field = {5, 16, 67, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
Protobuf Team Bot8c1f6352024-01-10 05:18:15 +00007439 return upb_Message_HasBaseField(UPB_UPCAST(msg), &field);
Protobuf Team Bot41287bd2023-04-10 18:57:14 -07007440}
Protobuf Team Bot469f0272023-04-21 18:12:45 -07007441UPB_INLINE void google_protobuf_ExtensionRangeOptions_Declaration_clear_repeated(google_protobuf_ExtensionRangeOptions_Declaration* msg) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00007442 const upb_MiniTableField field = {6, 17, 68, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
Protobuf Team Bot4e90ead2024-01-08 15:46:34 +00007443 upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
Protobuf Team Bot469f0272023-04-21 18:12:45 -07007444}
7445UPB_INLINE bool google_protobuf_ExtensionRangeOptions_Declaration_repeated(const google_protobuf_ExtensionRangeOptions_Declaration* msg) {
7446 bool default_val = false;
7447 bool ret;
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00007448 const upb_MiniTableField field = {6, 17, 68, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +00007449 _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field,
7450 &default_val, &ret);
Protobuf Team Bot469f0272023-04-21 18:12:45 -07007451 return ret;
7452}
7453UPB_INLINE bool google_protobuf_ExtensionRangeOptions_Declaration_has_repeated(const google_protobuf_ExtensionRangeOptions_Declaration* msg) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00007454 const upb_MiniTableField field = {6, 17, 68, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
Protobuf Team Bot8c1f6352024-01-10 05:18:15 +00007455 return upb_Message_HasBaseField(UPB_UPCAST(msg), &field);
Protobuf Team Bot469f0272023-04-21 18:12:45 -07007456}
Mike Kruskal145900f2023-03-27 09:55:52 -07007457
7458UPB_INLINE void google_protobuf_ExtensionRangeOptions_Declaration_set_number(google_protobuf_ExtensionRangeOptions_Declaration *msg, int32_t value) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00007459 const upb_MiniTableField field = {1, 12, 64, kUpb_NoSub, 5, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
Protobuf Team Botac32c972024-04-10 03:30:05 +00007460 upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
Mike Kruskal145900f2023-03-27 09:55:52 -07007461}
7462UPB_INLINE void google_protobuf_ExtensionRangeOptions_Declaration_set_full_name(google_protobuf_ExtensionRangeOptions_Declaration *msg, upb_StringView value) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00007463 const upb_MiniTableField field = {2, UPB_SIZE(20, 24), 65, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
Protobuf Team Botac32c972024-04-10 03:30:05 +00007464 upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
Mike Kruskal145900f2023-03-27 09:55:52 -07007465}
7466UPB_INLINE void google_protobuf_ExtensionRangeOptions_Declaration_set_type(google_protobuf_ExtensionRangeOptions_Declaration *msg, upb_StringView value) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00007467 const upb_MiniTableField field = {3, UPB_SIZE(28, 40), 66, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
Protobuf Team Botac32c972024-04-10 03:30:05 +00007468 upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
Mike Kruskal145900f2023-03-27 09:55:52 -07007469}
Protobuf Team Bot41287bd2023-04-10 18:57:14 -07007470UPB_INLINE void google_protobuf_ExtensionRangeOptions_Declaration_set_reserved(google_protobuf_ExtensionRangeOptions_Declaration *msg, bool value) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00007471 const upb_MiniTableField field = {5, 16, 67, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
Protobuf Team Botac32c972024-04-10 03:30:05 +00007472 upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
Protobuf Team Bot41287bd2023-04-10 18:57:14 -07007473}
Protobuf Team Bot469f0272023-04-21 18:12:45 -07007474UPB_INLINE void google_protobuf_ExtensionRangeOptions_Declaration_set_repeated(google_protobuf_ExtensionRangeOptions_Declaration *msg, bool value) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00007475 const upb_MiniTableField field = {6, 17, 68, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
Protobuf Team Botac32c972024-04-10 03:30:05 +00007476 upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
Protobuf Team Bot469f0272023-04-21 18:12:45 -07007477}
Mike Kruskal145900f2023-03-27 09:55:52 -07007478
Joshua Haberman9abf6e22021-01-13 12:16:25 -08007479/* google.protobuf.FieldDescriptorProto */
7480
Joshua Habermanf41049a2022-01-21 14:41:25 -08007481UPB_INLINE google_protobuf_FieldDescriptorProto* google_protobuf_FieldDescriptorProto_new(upb_Arena* arena) {
Protobuf Team Bot4ffe0862023-12-06 02:02:36 +00007482 return (google_protobuf_FieldDescriptorProto*)_upb_Message_New(&google__protobuf__FieldDescriptorProto_msg_init, arena);
Joshua Haberman9abf6e22021-01-13 12:16:25 -08007483}
Joshua Habermanf41049a2022-01-21 14:41:25 -08007484UPB_INLINE google_protobuf_FieldDescriptorProto* google_protobuf_FieldDescriptorProto_parse(const char* buf, size_t size, upb_Arena* arena) {
7485 google_protobuf_FieldDescriptorProto* ret = google_protobuf_FieldDescriptorProto_new(arena);
Joshua Haberman9d578a32021-08-02 15:32:01 -07007486 if (!ret) return NULL;
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +00007487 if (upb_Decode(buf, size, UPB_UPCAST(ret), &google__protobuf__FieldDescriptorProto_msg_init, NULL, 0, arena) !=
7488 kUpb_DecodeStatus_Ok) {
Joshua Haberman9d578a32021-08-02 15:32:01 -07007489 return NULL;
7490 }
7491 return ret;
Joshua Haberman9abf6e22021-01-13 12:16:25 -08007492}
Joshua Habermanf41049a2022-01-21 14:41:25 -08007493UPB_INLINE google_protobuf_FieldDescriptorProto* google_protobuf_FieldDescriptorProto_parse_ex(const char* buf, size_t size,
7494 const upb_ExtensionRegistry* extreg,
7495 int options, upb_Arena* arena) {
7496 google_protobuf_FieldDescriptorProto* ret = google_protobuf_FieldDescriptorProto_new(arena);
7497 if (!ret) return NULL;
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +00007498 if (upb_Decode(buf, size, UPB_UPCAST(ret), &google__protobuf__FieldDescriptorProto_msg_init, extreg, options,
7499 arena) != kUpb_DecodeStatus_Ok) {
Joshua Habermanf41049a2022-01-21 14:41:25 -08007500 return NULL;
7501 }
7502 return ret;
Joshua Haberman9abf6e22021-01-13 12:16:25 -08007503}
Joshua Habermanf41049a2022-01-21 14:41:25 -08007504UPB_INLINE char* google_protobuf_FieldDescriptorProto_serialize(const google_protobuf_FieldDescriptorProto* msg, upb_Arena* arena, size_t* len) {
Joshua Habermand3995ec2022-09-30 16:54:39 -07007505 char* ptr;
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +00007506 (void)upb_Encode(UPB_UPCAST(msg), &google__protobuf__FieldDescriptorProto_msg_init, 0, arena, &ptr, len);
Joshua Habermand3995ec2022-09-30 16:54:39 -07007507 return ptr;
Joshua Habermanf41049a2022-01-21 14:41:25 -08007508}
7509UPB_INLINE char* google_protobuf_FieldDescriptorProto_serialize_ex(const google_protobuf_FieldDescriptorProto* msg, int options,
7510 upb_Arena* arena, size_t* len) {
Joshua Habermand3995ec2022-09-30 16:54:39 -07007511 char* ptr;
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +00007512 (void)upb_Encode(UPB_UPCAST(msg), &google__protobuf__FieldDescriptorProto_msg_init, options, arena, &ptr, len);
Joshua Habermand3995ec2022-09-30 16:54:39 -07007513 return ptr;
Joshua Habermanf41049a2022-01-21 14:41:25 -08007514}
Mike Kruskal3bc50492022-12-01 13:34:12 -08007515UPB_INLINE void google_protobuf_FieldDescriptorProto_clear_name(google_protobuf_FieldDescriptorProto* msg) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00007516 const upb_MiniTableField field = {1, UPB_SIZE(36, 32), 64, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
Protobuf Team Bot4e90ead2024-01-08 15:46:34 +00007517 upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
Joshua Habermand3995ec2022-09-30 16:54:39 -07007518}
Joshua Habermanf41049a2022-01-21 14:41:25 -08007519UPB_INLINE upb_StringView google_protobuf_FieldDescriptorProto_name(const google_protobuf_FieldDescriptorProto* msg) {
Eric Salo8809a112022-11-21 13:01:06 -08007520 upb_StringView default_val = upb_StringView_FromString("");
7521 upb_StringView ret;
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00007522 const upb_MiniTableField field = {1, UPB_SIZE(36, 32), 64, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +00007523 _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field,
7524 &default_val, &ret);
Eric Salo8809a112022-11-21 13:01:06 -08007525 return ret;
Joshua Haberman9abf6e22021-01-13 12:16:25 -08007526}
Mike Kruskal3bc50492022-12-01 13:34:12 -08007527UPB_INLINE bool google_protobuf_FieldDescriptorProto_has_name(const google_protobuf_FieldDescriptorProto* msg) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00007528 const upb_MiniTableField field = {1, UPB_SIZE(36, 32), 64, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
Protobuf Team Bot8c1f6352024-01-10 05:18:15 +00007529 return upb_Message_HasBaseField(UPB_UPCAST(msg), &field);
Joshua Haberman7ecf43f2022-03-14 13:11:29 -07007530}
Mike Kruskal3bc50492022-12-01 13:34:12 -08007531UPB_INLINE void google_protobuf_FieldDescriptorProto_clear_extendee(google_protobuf_FieldDescriptorProto* msg) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00007532 const upb_MiniTableField field = {2, UPB_SIZE(44, 48), 65, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
Protobuf Team Bot4e90ead2024-01-08 15:46:34 +00007533 upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
Joshua Habermand3995ec2022-09-30 16:54:39 -07007534}
Joshua Habermanf41049a2022-01-21 14:41:25 -08007535UPB_INLINE upb_StringView google_protobuf_FieldDescriptorProto_extendee(const google_protobuf_FieldDescriptorProto* msg) {
Eric Salo8809a112022-11-21 13:01:06 -08007536 upb_StringView default_val = upb_StringView_FromString("");
7537 upb_StringView ret;
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00007538 const upb_MiniTableField field = {2, UPB_SIZE(44, 48), 65, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +00007539 _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field,
7540 &default_val, &ret);
Eric Salo8809a112022-11-21 13:01:06 -08007541 return ret;
Joshua Habermanf41049a2022-01-21 14:41:25 -08007542}
Mike Kruskal3bc50492022-12-01 13:34:12 -08007543UPB_INLINE bool google_protobuf_FieldDescriptorProto_has_extendee(const google_protobuf_FieldDescriptorProto* msg) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00007544 const upb_MiniTableField field = {2, UPB_SIZE(44, 48), 65, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
Protobuf Team Bot8c1f6352024-01-10 05:18:15 +00007545 return upb_Message_HasBaseField(UPB_UPCAST(msg), &field);
Joshua Haberman7ecf43f2022-03-14 13:11:29 -07007546}
Mike Kruskal3bc50492022-12-01 13:34:12 -08007547UPB_INLINE void google_protobuf_FieldDescriptorProto_clear_number(google_protobuf_FieldDescriptorProto* msg) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00007548 const upb_MiniTableField field = {3, 12, 66, kUpb_NoSub, 5, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
Protobuf Team Bot4e90ead2024-01-08 15:46:34 +00007549 upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
Joshua Habermand3995ec2022-09-30 16:54:39 -07007550}
Joshua Habermanf41049a2022-01-21 14:41:25 -08007551UPB_INLINE int32_t google_protobuf_FieldDescriptorProto_number(const google_protobuf_FieldDescriptorProto* msg) {
Eric Salo8809a112022-11-21 13:01:06 -08007552 int32_t default_val = (int32_t)0;
7553 int32_t ret;
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00007554 const upb_MiniTableField field = {3, 12, 66, kUpb_NoSub, 5, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +00007555 _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field,
7556 &default_val, &ret);
Eric Salo8809a112022-11-21 13:01:06 -08007557 return ret;
Joshua Habermanf41049a2022-01-21 14:41:25 -08007558}
Mike Kruskal3bc50492022-12-01 13:34:12 -08007559UPB_INLINE bool google_protobuf_FieldDescriptorProto_has_number(const google_protobuf_FieldDescriptorProto* msg) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00007560 const upb_MiniTableField field = {3, 12, 66, kUpb_NoSub, 5, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
Protobuf Team Bot8c1f6352024-01-10 05:18:15 +00007561 return upb_Message_HasBaseField(UPB_UPCAST(msg), &field);
Joshua Haberman7ecf43f2022-03-14 13:11:29 -07007562}
Mike Kruskal3bc50492022-12-01 13:34:12 -08007563UPB_INLINE void google_protobuf_FieldDescriptorProto_clear_label(google_protobuf_FieldDescriptorProto* msg) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00007564 const upb_MiniTableField field = {4, 16, 67, 1, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
Protobuf Team Bot4e90ead2024-01-08 15:46:34 +00007565 upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
Joshua Habermand3995ec2022-09-30 16:54:39 -07007566}
Joshua Habermanf41049a2022-01-21 14:41:25 -08007567UPB_INLINE int32_t google_protobuf_FieldDescriptorProto_label(const google_protobuf_FieldDescriptorProto* msg) {
Eric Salo8809a112022-11-21 13:01:06 -08007568 int32_t default_val = 1;
7569 int32_t ret;
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00007570 const upb_MiniTableField field = {4, 16, 67, 1, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +00007571 _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field,
7572 &default_val, &ret);
Eric Salo8809a112022-11-21 13:01:06 -08007573 return ret;
Joshua Habermanf41049a2022-01-21 14:41:25 -08007574}
Mike Kruskal3bc50492022-12-01 13:34:12 -08007575UPB_INLINE bool google_protobuf_FieldDescriptorProto_has_label(const google_protobuf_FieldDescriptorProto* msg) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00007576 const upb_MiniTableField field = {4, 16, 67, 1, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
Protobuf Team Bot8c1f6352024-01-10 05:18:15 +00007577 return upb_Message_HasBaseField(UPB_UPCAST(msg), &field);
Joshua Haberman7ecf43f2022-03-14 13:11:29 -07007578}
Mike Kruskal3bc50492022-12-01 13:34:12 -08007579UPB_INLINE void google_protobuf_FieldDescriptorProto_clear_type(google_protobuf_FieldDescriptorProto* msg) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00007580 const upb_MiniTableField field = {5, 20, 68, 2, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
Protobuf Team Bot4e90ead2024-01-08 15:46:34 +00007581 upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
Joshua Habermand3995ec2022-09-30 16:54:39 -07007582}
Joshua Habermanf41049a2022-01-21 14:41:25 -08007583UPB_INLINE int32_t google_protobuf_FieldDescriptorProto_type(const google_protobuf_FieldDescriptorProto* msg) {
Eric Salo8809a112022-11-21 13:01:06 -08007584 int32_t default_val = 1;
7585 int32_t ret;
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00007586 const upb_MiniTableField field = {5, 20, 68, 2, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +00007587 _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field,
7588 &default_val, &ret);
Eric Salo8809a112022-11-21 13:01:06 -08007589 return ret;
Joshua Habermanf41049a2022-01-21 14:41:25 -08007590}
Mike Kruskal3bc50492022-12-01 13:34:12 -08007591UPB_INLINE bool google_protobuf_FieldDescriptorProto_has_type(const google_protobuf_FieldDescriptorProto* msg) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00007592 const upb_MiniTableField field = {5, 20, 68, 2, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
Protobuf Team Bot8c1f6352024-01-10 05:18:15 +00007593 return upb_Message_HasBaseField(UPB_UPCAST(msg), &field);
Joshua Haberman7ecf43f2022-03-14 13:11:29 -07007594}
Mike Kruskal3bc50492022-12-01 13:34:12 -08007595UPB_INLINE void google_protobuf_FieldDescriptorProto_clear_type_name(google_protobuf_FieldDescriptorProto* msg) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00007596 const upb_MiniTableField field = {6, UPB_SIZE(52, 64), 69, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
Protobuf Team Bot4e90ead2024-01-08 15:46:34 +00007597 upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
Joshua Habermand3995ec2022-09-30 16:54:39 -07007598}
Joshua Habermanf41049a2022-01-21 14:41:25 -08007599UPB_INLINE upb_StringView google_protobuf_FieldDescriptorProto_type_name(const google_protobuf_FieldDescriptorProto* msg) {
Eric Salo8809a112022-11-21 13:01:06 -08007600 upb_StringView default_val = upb_StringView_FromString("");
7601 upb_StringView ret;
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00007602 const upb_MiniTableField field = {6, UPB_SIZE(52, 64), 69, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +00007603 _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field,
7604 &default_val, &ret);
Eric Salo8809a112022-11-21 13:01:06 -08007605 return ret;
Joshua Habermanf41049a2022-01-21 14:41:25 -08007606}
Mike Kruskal3bc50492022-12-01 13:34:12 -08007607UPB_INLINE bool google_protobuf_FieldDescriptorProto_has_type_name(const google_protobuf_FieldDescriptorProto* msg) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00007608 const upb_MiniTableField field = {6, UPB_SIZE(52, 64), 69, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
Protobuf Team Bot8c1f6352024-01-10 05:18:15 +00007609 return upb_Message_HasBaseField(UPB_UPCAST(msg), &field);
Joshua Haberman7ecf43f2022-03-14 13:11:29 -07007610}
Mike Kruskal3bc50492022-12-01 13:34:12 -08007611UPB_INLINE void google_protobuf_FieldDescriptorProto_clear_default_value(google_protobuf_FieldDescriptorProto* msg) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00007612 const upb_MiniTableField field = {7, UPB_SIZE(60, 80), 70, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
Protobuf Team Bot4e90ead2024-01-08 15:46:34 +00007613 upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
Joshua Habermand3995ec2022-09-30 16:54:39 -07007614}
Joshua Habermanf41049a2022-01-21 14:41:25 -08007615UPB_INLINE upb_StringView google_protobuf_FieldDescriptorProto_default_value(const google_protobuf_FieldDescriptorProto* msg) {
Eric Salo8809a112022-11-21 13:01:06 -08007616 upb_StringView default_val = upb_StringView_FromString("");
7617 upb_StringView ret;
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00007618 const upb_MiniTableField field = {7, UPB_SIZE(60, 80), 70, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +00007619 _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field,
7620 &default_val, &ret);
Eric Salo8809a112022-11-21 13:01:06 -08007621 return ret;
Joshua Habermanf41049a2022-01-21 14:41:25 -08007622}
Mike Kruskal3bc50492022-12-01 13:34:12 -08007623UPB_INLINE bool google_protobuf_FieldDescriptorProto_has_default_value(const google_protobuf_FieldDescriptorProto* msg) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00007624 const upb_MiniTableField field = {7, UPB_SIZE(60, 80), 70, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
Protobuf Team Bot8c1f6352024-01-10 05:18:15 +00007625 return upb_Message_HasBaseField(UPB_UPCAST(msg), &field);
Joshua Haberman7ecf43f2022-03-14 13:11:29 -07007626}
Mike Kruskal3bc50492022-12-01 13:34:12 -08007627UPB_INLINE void google_protobuf_FieldDescriptorProto_clear_options(google_protobuf_FieldDescriptorProto* msg) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00007628 const upb_MiniTableField field = {8, UPB_SIZE(24, 96), 71, 0, 11, (int)kUpb_FieldMode_Scalar | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
Protobuf Team Bot4e90ead2024-01-08 15:46:34 +00007629 upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
Joshua Habermand3995ec2022-09-30 16:54:39 -07007630}
Joshua Habermanf41049a2022-01-21 14:41:25 -08007631UPB_INLINE const google_protobuf_FieldOptions* google_protobuf_FieldDescriptorProto_options(const google_protobuf_FieldDescriptorProto* msg) {
Eric Salo8809a112022-11-21 13:01:06 -08007632 const google_protobuf_FieldOptions* default_val = NULL;
7633 const google_protobuf_FieldOptions* ret;
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00007634 const upb_MiniTableField field = {8, UPB_SIZE(24, 96), 71, 0, 11, (int)kUpb_FieldMode_Scalar | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
Protobuf Team Bota9387b52024-06-12 15:17:52 +00007635 UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__FieldOptions_msg_init);
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +00007636 _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field,
7637 &default_val, &ret);
Eric Salo8809a112022-11-21 13:01:06 -08007638 return ret;
Joshua Habermanf41049a2022-01-21 14:41:25 -08007639}
Mike Kruskal3bc50492022-12-01 13:34:12 -08007640UPB_INLINE bool google_protobuf_FieldDescriptorProto_has_options(const google_protobuf_FieldDescriptorProto* msg) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00007641 const upb_MiniTableField field = {8, UPB_SIZE(24, 96), 71, 0, 11, (int)kUpb_FieldMode_Scalar | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
Protobuf Team Bot8c1f6352024-01-10 05:18:15 +00007642 return upb_Message_HasBaseField(UPB_UPCAST(msg), &field);
Joshua Haberman7ecf43f2022-03-14 13:11:29 -07007643}
Mike Kruskal3bc50492022-12-01 13:34:12 -08007644UPB_INLINE void google_protobuf_FieldDescriptorProto_clear_oneof_index(google_protobuf_FieldDescriptorProto* msg) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00007645 const upb_MiniTableField field = {9, UPB_SIZE(28, 24), 72, kUpb_NoSub, 5, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
Protobuf Team Bot4e90ead2024-01-08 15:46:34 +00007646 upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
Joshua Habermand3995ec2022-09-30 16:54:39 -07007647}
Joshua Habermanf41049a2022-01-21 14:41:25 -08007648UPB_INLINE int32_t google_protobuf_FieldDescriptorProto_oneof_index(const google_protobuf_FieldDescriptorProto* msg) {
Eric Salo8809a112022-11-21 13:01:06 -08007649 int32_t default_val = (int32_t)0;
7650 int32_t ret;
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00007651 const upb_MiniTableField field = {9, UPB_SIZE(28, 24), 72, kUpb_NoSub, 5, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +00007652 _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field,
7653 &default_val, &ret);
Eric Salo8809a112022-11-21 13:01:06 -08007654 return ret;
Joshua Habermanf41049a2022-01-21 14:41:25 -08007655}
Mike Kruskal3bc50492022-12-01 13:34:12 -08007656UPB_INLINE bool google_protobuf_FieldDescriptorProto_has_oneof_index(const google_protobuf_FieldDescriptorProto* msg) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00007657 const upb_MiniTableField field = {9, UPB_SIZE(28, 24), 72, kUpb_NoSub, 5, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
Protobuf Team Bot8c1f6352024-01-10 05:18:15 +00007658 return upb_Message_HasBaseField(UPB_UPCAST(msg), &field);
Joshua Haberman7ecf43f2022-03-14 13:11:29 -07007659}
Mike Kruskal3bc50492022-12-01 13:34:12 -08007660UPB_INLINE void google_protobuf_FieldDescriptorProto_clear_json_name(google_protobuf_FieldDescriptorProto* msg) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00007661 const upb_MiniTableField field = {10, UPB_SIZE(68, 104), 73, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
Protobuf Team Bot4e90ead2024-01-08 15:46:34 +00007662 upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
Joshua Habermand3995ec2022-09-30 16:54:39 -07007663}
Joshua Habermanf41049a2022-01-21 14:41:25 -08007664UPB_INLINE upb_StringView google_protobuf_FieldDescriptorProto_json_name(const google_protobuf_FieldDescriptorProto* msg) {
Eric Salo8809a112022-11-21 13:01:06 -08007665 upb_StringView default_val = upb_StringView_FromString("");
7666 upb_StringView ret;
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00007667 const upb_MiniTableField field = {10, UPB_SIZE(68, 104), 73, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +00007668 _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field,
7669 &default_val, &ret);
Eric Salo8809a112022-11-21 13:01:06 -08007670 return ret;
Joshua Habermanf41049a2022-01-21 14:41:25 -08007671}
Mike Kruskal3bc50492022-12-01 13:34:12 -08007672UPB_INLINE bool google_protobuf_FieldDescriptorProto_has_json_name(const google_protobuf_FieldDescriptorProto* msg) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00007673 const upb_MiniTableField field = {10, UPB_SIZE(68, 104), 73, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
Protobuf Team Bot8c1f6352024-01-10 05:18:15 +00007674 return upb_Message_HasBaseField(UPB_UPCAST(msg), &field);
Joshua Haberman7ecf43f2022-03-14 13:11:29 -07007675}
Mike Kruskal3bc50492022-12-01 13:34:12 -08007676UPB_INLINE void google_protobuf_FieldDescriptorProto_clear_proto3_optional(google_protobuf_FieldDescriptorProto* msg) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00007677 const upb_MiniTableField field = {17, UPB_SIZE(32, 28), 74, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
Protobuf Team Bot4e90ead2024-01-08 15:46:34 +00007678 upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
Joshua Habermand3995ec2022-09-30 16:54:39 -07007679}
Joshua Habermanf41049a2022-01-21 14:41:25 -08007680UPB_INLINE bool google_protobuf_FieldDescriptorProto_proto3_optional(const google_protobuf_FieldDescriptorProto* msg) {
Eric Salo8809a112022-11-21 13:01:06 -08007681 bool default_val = false;
7682 bool ret;
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00007683 const upb_MiniTableField field = {17, UPB_SIZE(32, 28), 74, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +00007684 _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field,
7685 &default_val, &ret);
Eric Salo8809a112022-11-21 13:01:06 -08007686 return ret;
Joshua Habermanf41049a2022-01-21 14:41:25 -08007687}
Mike Kruskal3bc50492022-12-01 13:34:12 -08007688UPB_INLINE bool google_protobuf_FieldDescriptorProto_has_proto3_optional(const google_protobuf_FieldDescriptorProto* msg) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00007689 const upb_MiniTableField field = {17, UPB_SIZE(32, 28), 74, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
Protobuf Team Bot8c1f6352024-01-10 05:18:15 +00007690 return upb_Message_HasBaseField(UPB_UPCAST(msg), &field);
Mike Kruskal3bc50492022-12-01 13:34:12 -08007691}
Joshua Habermanf41049a2022-01-21 14:41:25 -08007692
7693UPB_INLINE void google_protobuf_FieldDescriptorProto_set_name(google_protobuf_FieldDescriptorProto *msg, upb_StringView value) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00007694 const upb_MiniTableField field = {1, UPB_SIZE(36, 32), 64, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
Protobuf Team Botac32c972024-04-10 03:30:05 +00007695 upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
Mike Kruskal232ecf42023-01-14 00:09:40 -08007696}
7697UPB_INLINE void google_protobuf_FieldDescriptorProto_set_extendee(google_protobuf_FieldDescriptorProto *msg, upb_StringView value) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00007698 const upb_MiniTableField field = {2, UPB_SIZE(44, 48), 65, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
Protobuf Team Botac32c972024-04-10 03:30:05 +00007699 upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
Mike Kruskal232ecf42023-01-14 00:09:40 -08007700}
7701UPB_INLINE void google_protobuf_FieldDescriptorProto_set_number(google_protobuf_FieldDescriptorProto *msg, int32_t value) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00007702 const upb_MiniTableField field = {3, 12, 66, kUpb_NoSub, 5, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
Protobuf Team Botac32c972024-04-10 03:30:05 +00007703 upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
Mike Kruskal232ecf42023-01-14 00:09:40 -08007704}
7705UPB_INLINE void google_protobuf_FieldDescriptorProto_set_label(google_protobuf_FieldDescriptorProto *msg, int32_t value) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00007706 const upb_MiniTableField field = {4, 16, 67, 1, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
Protobuf Team Botac32c972024-04-10 03:30:05 +00007707 upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
Mike Kruskal232ecf42023-01-14 00:09:40 -08007708}
7709UPB_INLINE void google_protobuf_FieldDescriptorProto_set_type(google_protobuf_FieldDescriptorProto *msg, int32_t value) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00007710 const upb_MiniTableField field = {5, 20, 68, 2, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
Protobuf Team Botac32c972024-04-10 03:30:05 +00007711 upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
Mike Kruskal232ecf42023-01-14 00:09:40 -08007712}
7713UPB_INLINE void google_protobuf_FieldDescriptorProto_set_type_name(google_protobuf_FieldDescriptorProto *msg, upb_StringView value) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00007714 const upb_MiniTableField field = {6, UPB_SIZE(52, 64), 69, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
Protobuf Team Botac32c972024-04-10 03:30:05 +00007715 upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
Mike Kruskal232ecf42023-01-14 00:09:40 -08007716}
7717UPB_INLINE void google_protobuf_FieldDescriptorProto_set_default_value(google_protobuf_FieldDescriptorProto *msg, upb_StringView value) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00007718 const upb_MiniTableField field = {7, UPB_SIZE(60, 80), 70, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
Protobuf Team Botac32c972024-04-10 03:30:05 +00007719 upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
Mike Kruskal232ecf42023-01-14 00:09:40 -08007720}
7721UPB_INLINE void google_protobuf_FieldDescriptorProto_set_options(google_protobuf_FieldDescriptorProto *msg, google_protobuf_FieldOptions* value) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00007722 const upb_MiniTableField field = {8, UPB_SIZE(24, 96), 71, 0, 11, (int)kUpb_FieldMode_Scalar | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
Protobuf Team Bota9387b52024-06-12 15:17:52 +00007723 UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__FieldOptions_msg_init);
Protobuf Team Botac32c972024-04-10 03:30:05 +00007724 upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
Mike Kruskal232ecf42023-01-14 00:09:40 -08007725}
7726UPB_INLINE struct google_protobuf_FieldOptions* google_protobuf_FieldDescriptorProto_mutable_options(google_protobuf_FieldDescriptorProto* msg, upb_Arena* arena) {
Joshua Haberman9abf6e22021-01-13 12:16:25 -08007727 struct google_protobuf_FieldOptions* sub = (struct google_protobuf_FieldOptions*)google_protobuf_FieldDescriptorProto_options(msg);
7728 if (sub == NULL) {
Protobuf Team Bot4ffe0862023-12-06 02:02:36 +00007729 sub = (struct google_protobuf_FieldOptions*)_upb_Message_New(&google__protobuf__FieldOptions_msg_init, arena);
Eric Salo8809a112022-11-21 13:01:06 -08007730 if (sub) google_protobuf_FieldDescriptorProto_set_options(msg, sub);
Joshua Haberman9abf6e22021-01-13 12:16:25 -08007731 }
7732 return sub;
7733}
7734UPB_INLINE void google_protobuf_FieldDescriptorProto_set_oneof_index(google_protobuf_FieldDescriptorProto *msg, int32_t value) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00007735 const upb_MiniTableField field = {9, UPB_SIZE(28, 24), 72, kUpb_NoSub, 5, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
Protobuf Team Botac32c972024-04-10 03:30:05 +00007736 upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
Mike Kruskal232ecf42023-01-14 00:09:40 -08007737}
7738UPB_INLINE void google_protobuf_FieldDescriptorProto_set_json_name(google_protobuf_FieldDescriptorProto *msg, upb_StringView value) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00007739 const upb_MiniTableField field = {10, UPB_SIZE(68, 104), 73, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
Protobuf Team Botac32c972024-04-10 03:30:05 +00007740 upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
Mike Kruskal232ecf42023-01-14 00:09:40 -08007741}
7742UPB_INLINE void google_protobuf_FieldDescriptorProto_set_proto3_optional(google_protobuf_FieldDescriptorProto *msg, bool value) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00007743 const upb_MiniTableField field = {17, UPB_SIZE(32, 28), 74, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
Protobuf Team Botac32c972024-04-10 03:30:05 +00007744 upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
Joshua Haberman9abf6e22021-01-13 12:16:25 -08007745}
Mike Kruskal232ecf42023-01-14 00:09:40 -08007746
Joshua Haberman9abf6e22021-01-13 12:16:25 -08007747/* google.protobuf.OneofDescriptorProto */
7748
Joshua Habermanf41049a2022-01-21 14:41:25 -08007749UPB_INLINE google_protobuf_OneofDescriptorProto* google_protobuf_OneofDescriptorProto_new(upb_Arena* arena) {
Protobuf Team Bot4ffe0862023-12-06 02:02:36 +00007750 return (google_protobuf_OneofDescriptorProto*)_upb_Message_New(&google__protobuf__OneofDescriptorProto_msg_init, arena);
Joshua Haberman9abf6e22021-01-13 12:16:25 -08007751}
Joshua Habermanf41049a2022-01-21 14:41:25 -08007752UPB_INLINE google_protobuf_OneofDescriptorProto* google_protobuf_OneofDescriptorProto_parse(const char* buf, size_t size, upb_Arena* arena) {
7753 google_protobuf_OneofDescriptorProto* ret = google_protobuf_OneofDescriptorProto_new(arena);
Joshua Haberman9d578a32021-08-02 15:32:01 -07007754 if (!ret) return NULL;
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +00007755 if (upb_Decode(buf, size, UPB_UPCAST(ret), &google__protobuf__OneofDescriptorProto_msg_init, NULL, 0, arena) !=
7756 kUpb_DecodeStatus_Ok) {
Joshua Haberman9d578a32021-08-02 15:32:01 -07007757 return NULL;
7758 }
7759 return ret;
Joshua Haberman9abf6e22021-01-13 12:16:25 -08007760}
Joshua Habermanf41049a2022-01-21 14:41:25 -08007761UPB_INLINE google_protobuf_OneofDescriptorProto* google_protobuf_OneofDescriptorProto_parse_ex(const char* buf, size_t size,
7762 const upb_ExtensionRegistry* extreg,
7763 int options, upb_Arena* arena) {
7764 google_protobuf_OneofDescriptorProto* ret = google_protobuf_OneofDescriptorProto_new(arena);
7765 if (!ret) return NULL;
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +00007766 if (upb_Decode(buf, size, UPB_UPCAST(ret), &google__protobuf__OneofDescriptorProto_msg_init, extreg, options,
7767 arena) != kUpb_DecodeStatus_Ok) {
Joshua Habermanf41049a2022-01-21 14:41:25 -08007768 return NULL;
7769 }
7770 return ret;
7771}
7772UPB_INLINE char* google_protobuf_OneofDescriptorProto_serialize(const google_protobuf_OneofDescriptorProto* msg, upb_Arena* arena, size_t* len) {
Joshua Habermand3995ec2022-09-30 16:54:39 -07007773 char* ptr;
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +00007774 (void)upb_Encode(UPB_UPCAST(msg), &google__protobuf__OneofDescriptorProto_msg_init, 0, arena, &ptr, len);
Joshua Habermand3995ec2022-09-30 16:54:39 -07007775 return ptr;
Joshua Habermanf41049a2022-01-21 14:41:25 -08007776}
7777UPB_INLINE char* google_protobuf_OneofDescriptorProto_serialize_ex(const google_protobuf_OneofDescriptorProto* msg, int options,
7778 upb_Arena* arena, size_t* len) {
Joshua Habermand3995ec2022-09-30 16:54:39 -07007779 char* ptr;
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +00007780 (void)upb_Encode(UPB_UPCAST(msg), &google__protobuf__OneofDescriptorProto_msg_init, options, arena, &ptr, len);
Joshua Habermand3995ec2022-09-30 16:54:39 -07007781 return ptr;
Joshua Habermanf41049a2022-01-21 14:41:25 -08007782}
Mike Kruskal3bc50492022-12-01 13:34:12 -08007783UPB_INLINE void google_protobuf_OneofDescriptorProto_clear_name(google_protobuf_OneofDescriptorProto* msg) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00007784 const upb_MiniTableField field = {1, 16, 64, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
Protobuf Team Bot4e90ead2024-01-08 15:46:34 +00007785 upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
Joshua Habermand3995ec2022-09-30 16:54:39 -07007786}
Joshua Habermanf41049a2022-01-21 14:41:25 -08007787UPB_INLINE upb_StringView google_protobuf_OneofDescriptorProto_name(const google_protobuf_OneofDescriptorProto* msg) {
Eric Salo8809a112022-11-21 13:01:06 -08007788 upb_StringView default_val = upb_StringView_FromString("");
7789 upb_StringView ret;
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00007790 const upb_MiniTableField field = {1, 16, 64, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +00007791 _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field,
7792 &default_val, &ret);
Eric Salo8809a112022-11-21 13:01:06 -08007793 return ret;
Joshua Habermanf41049a2022-01-21 14:41:25 -08007794}
Mike Kruskal3bc50492022-12-01 13:34:12 -08007795UPB_INLINE bool google_protobuf_OneofDescriptorProto_has_name(const google_protobuf_OneofDescriptorProto* msg) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00007796 const upb_MiniTableField field = {1, 16, 64, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
Protobuf Team Bot8c1f6352024-01-10 05:18:15 +00007797 return upb_Message_HasBaseField(UPB_UPCAST(msg), &field);
Joshua Haberman7ecf43f2022-03-14 13:11:29 -07007798}
Mike Kruskal3bc50492022-12-01 13:34:12 -08007799UPB_INLINE void google_protobuf_OneofDescriptorProto_clear_options(google_protobuf_OneofDescriptorProto* msg) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00007800 const upb_MiniTableField field = {2, UPB_SIZE(12, 32), 65, 0, 11, (int)kUpb_FieldMode_Scalar | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
Protobuf Team Bot4e90ead2024-01-08 15:46:34 +00007801 upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
Joshua Habermand3995ec2022-09-30 16:54:39 -07007802}
Joshua Habermanf41049a2022-01-21 14:41:25 -08007803UPB_INLINE const google_protobuf_OneofOptions* google_protobuf_OneofDescriptorProto_options(const google_protobuf_OneofDescriptorProto* msg) {
Eric Salo8809a112022-11-21 13:01:06 -08007804 const google_protobuf_OneofOptions* default_val = NULL;
7805 const google_protobuf_OneofOptions* ret;
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00007806 const upb_MiniTableField field = {2, UPB_SIZE(12, 32), 65, 0, 11, (int)kUpb_FieldMode_Scalar | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
Protobuf Team Bota9387b52024-06-12 15:17:52 +00007807 UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__OneofOptions_msg_init);
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +00007808 _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field,
7809 &default_val, &ret);
Eric Salo8809a112022-11-21 13:01:06 -08007810 return ret;
Joshua Haberman9abf6e22021-01-13 12:16:25 -08007811}
Mike Kruskal3bc50492022-12-01 13:34:12 -08007812UPB_INLINE bool google_protobuf_OneofDescriptorProto_has_options(const google_protobuf_OneofDescriptorProto* msg) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00007813 const upb_MiniTableField field = {2, UPB_SIZE(12, 32), 65, 0, 11, (int)kUpb_FieldMode_Scalar | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
Protobuf Team Bot8c1f6352024-01-10 05:18:15 +00007814 return upb_Message_HasBaseField(UPB_UPCAST(msg), &field);
Mike Kruskal3bc50492022-12-01 13:34:12 -08007815}
Joshua Haberman9abf6e22021-01-13 12:16:25 -08007816
Joshua Habermanf41049a2022-01-21 14:41:25 -08007817UPB_INLINE void google_protobuf_OneofDescriptorProto_set_name(google_protobuf_OneofDescriptorProto *msg, upb_StringView value) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00007818 const upb_MiniTableField field = {1, 16, 64, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
Protobuf Team Botac32c972024-04-10 03:30:05 +00007819 upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
Mike Kruskal232ecf42023-01-14 00:09:40 -08007820}
7821UPB_INLINE void google_protobuf_OneofDescriptorProto_set_options(google_protobuf_OneofDescriptorProto *msg, google_protobuf_OneofOptions* value) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00007822 const upb_MiniTableField field = {2, UPB_SIZE(12, 32), 65, 0, 11, (int)kUpb_FieldMode_Scalar | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
Protobuf Team Bota9387b52024-06-12 15:17:52 +00007823 UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__OneofOptions_msg_init);
Protobuf Team Botac32c972024-04-10 03:30:05 +00007824 upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
Mike Kruskal232ecf42023-01-14 00:09:40 -08007825}
7826UPB_INLINE struct google_protobuf_OneofOptions* google_protobuf_OneofDescriptorProto_mutable_options(google_protobuf_OneofDescriptorProto* msg, upb_Arena* arena) {
Joshua Haberman9abf6e22021-01-13 12:16:25 -08007827 struct google_protobuf_OneofOptions* sub = (struct google_protobuf_OneofOptions*)google_protobuf_OneofDescriptorProto_options(msg);
7828 if (sub == NULL) {
Protobuf Team Bot4ffe0862023-12-06 02:02:36 +00007829 sub = (struct google_protobuf_OneofOptions*)_upb_Message_New(&google__protobuf__OneofOptions_msg_init, arena);
Eric Salo8809a112022-11-21 13:01:06 -08007830 if (sub) google_protobuf_OneofDescriptorProto_set_options(msg, sub);
Joshua Haberman9abf6e22021-01-13 12:16:25 -08007831 }
7832 return sub;
7833}
7834
7835/* google.protobuf.EnumDescriptorProto */
7836
Joshua Habermanf41049a2022-01-21 14:41:25 -08007837UPB_INLINE google_protobuf_EnumDescriptorProto* google_protobuf_EnumDescriptorProto_new(upb_Arena* arena) {
Protobuf Team Bot4ffe0862023-12-06 02:02:36 +00007838 return (google_protobuf_EnumDescriptorProto*)_upb_Message_New(&google__protobuf__EnumDescriptorProto_msg_init, arena);
Joshua Haberman9abf6e22021-01-13 12:16:25 -08007839}
Joshua Habermanf41049a2022-01-21 14:41:25 -08007840UPB_INLINE google_protobuf_EnumDescriptorProto* google_protobuf_EnumDescriptorProto_parse(const char* buf, size_t size, upb_Arena* arena) {
7841 google_protobuf_EnumDescriptorProto* ret = google_protobuf_EnumDescriptorProto_new(arena);
Joshua Haberman9d578a32021-08-02 15:32:01 -07007842 if (!ret) return NULL;
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +00007843 if (upb_Decode(buf, size, UPB_UPCAST(ret), &google__protobuf__EnumDescriptorProto_msg_init, NULL, 0, arena) !=
7844 kUpb_DecodeStatus_Ok) {
Joshua Haberman9d578a32021-08-02 15:32:01 -07007845 return NULL;
7846 }
7847 return ret;
Joshua Haberman9abf6e22021-01-13 12:16:25 -08007848}
Joshua Habermanf41049a2022-01-21 14:41:25 -08007849UPB_INLINE google_protobuf_EnumDescriptorProto* google_protobuf_EnumDescriptorProto_parse_ex(const char* buf, size_t size,
7850 const upb_ExtensionRegistry* extreg,
7851 int options, upb_Arena* arena) {
7852 google_protobuf_EnumDescriptorProto* ret = google_protobuf_EnumDescriptorProto_new(arena);
7853 if (!ret) return NULL;
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +00007854 if (upb_Decode(buf, size, UPB_UPCAST(ret), &google__protobuf__EnumDescriptorProto_msg_init, extreg, options,
7855 arena) != kUpb_DecodeStatus_Ok) {
Joshua Habermanf41049a2022-01-21 14:41:25 -08007856 return NULL;
7857 }
7858 return ret;
Joshua Haberman9abf6e22021-01-13 12:16:25 -08007859}
Joshua Habermanf41049a2022-01-21 14:41:25 -08007860UPB_INLINE char* google_protobuf_EnumDescriptorProto_serialize(const google_protobuf_EnumDescriptorProto* msg, upb_Arena* arena, size_t* len) {
Joshua Habermand3995ec2022-09-30 16:54:39 -07007861 char* ptr;
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +00007862 (void)upb_Encode(UPB_UPCAST(msg), &google__protobuf__EnumDescriptorProto_msg_init, 0, arena, &ptr, len);
Joshua Habermand3995ec2022-09-30 16:54:39 -07007863 return ptr;
Joshua Habermanf41049a2022-01-21 14:41:25 -08007864}
7865UPB_INLINE char* google_protobuf_EnumDescriptorProto_serialize_ex(const google_protobuf_EnumDescriptorProto* msg, int options,
7866 upb_Arena* arena, size_t* len) {
Joshua Habermand3995ec2022-09-30 16:54:39 -07007867 char* ptr;
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +00007868 (void)upb_Encode(UPB_UPCAST(msg), &google__protobuf__EnumDescriptorProto_msg_init, options, arena, &ptr, len);
Joshua Habermand3995ec2022-09-30 16:54:39 -07007869 return ptr;
Joshua Habermanf41049a2022-01-21 14:41:25 -08007870}
Mike Kruskal3bc50492022-12-01 13:34:12 -08007871UPB_INLINE void google_protobuf_EnumDescriptorProto_clear_name(google_protobuf_EnumDescriptorProto* msg) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00007872 const upb_MiniTableField field = {1, UPB_SIZE(28, 16), 64, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
Protobuf Team Bot4e90ead2024-01-08 15:46:34 +00007873 upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
Joshua Habermand3995ec2022-09-30 16:54:39 -07007874}
Joshua Habermanf41049a2022-01-21 14:41:25 -08007875UPB_INLINE upb_StringView google_protobuf_EnumDescriptorProto_name(const google_protobuf_EnumDescriptorProto* msg) {
Eric Salo8809a112022-11-21 13:01:06 -08007876 upb_StringView default_val = upb_StringView_FromString("");
7877 upb_StringView ret;
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00007878 const upb_MiniTableField field = {1, UPB_SIZE(28, 16), 64, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +00007879 _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field,
7880 &default_val, &ret);
Eric Salo8809a112022-11-21 13:01:06 -08007881 return ret;
Joshua Habermanf41049a2022-01-21 14:41:25 -08007882}
Mike Kruskal3bc50492022-12-01 13:34:12 -08007883UPB_INLINE bool google_protobuf_EnumDescriptorProto_has_name(const google_protobuf_EnumDescriptorProto* msg) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00007884 const upb_MiniTableField field = {1, UPB_SIZE(28, 16), 64, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
Protobuf Team Bot8c1f6352024-01-10 05:18:15 +00007885 return upb_Message_HasBaseField(UPB_UPCAST(msg), &field);
Joshua Habermand3995ec2022-09-30 16:54:39 -07007886}
Mike Kruskal3bc50492022-12-01 13:34:12 -08007887UPB_INLINE void google_protobuf_EnumDescriptorProto_clear_value(google_protobuf_EnumDescriptorProto* msg) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00007888 const upb_MiniTableField field = {2, UPB_SIZE(12, 32), 0, 0, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
Protobuf Team Bot4e90ead2024-01-08 15:46:34 +00007889 upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
Joshua Haberman7ecf43f2022-03-14 13:11:29 -07007890}
Eric Salob7d54ac2022-12-29 11:59:42 -08007891UPB_INLINE const google_protobuf_EnumValueDescriptorProto* const* google_protobuf_EnumDescriptorProto_value(const google_protobuf_EnumDescriptorProto* msg, size_t* size) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00007892 const upb_MiniTableField field = {2, UPB_SIZE(12, 32), 0, 0, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
Protobuf Team Bota9387b52024-06-12 15:17:52 +00007893 UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__EnumValueDescriptorProto_msg_init);
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +00007894 const upb_Array* arr = upb_Message_GetArray(UPB_UPCAST(msg), &field);
Eric Salob7d54ac2022-12-29 11:59:42 -08007895 if (arr) {
Protobuf Team Botf73985a2023-12-19 00:14:19 +00007896 if (size) *size = arr->UPB_PRIVATE(size);
Protobuf Team Bot81e54332024-01-11 21:04:07 +00007897 return (const google_protobuf_EnumValueDescriptorProto* const*)upb_Array_DataPtr(arr);
Eric Salob7d54ac2022-12-29 11:59:42 -08007898 } else {
7899 if (size) *size = 0;
7900 return NULL;
7901 }
Joshua Haberman7ecf43f2022-03-14 13:11:29 -07007902}
Deanna Garciab26afb52023-04-25 13:37:18 -07007903UPB_INLINE const upb_Array* _google_protobuf_EnumDescriptorProto_value_upb_array(const google_protobuf_EnumDescriptorProto* msg, size_t* size) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00007904 const upb_MiniTableField field = {2, UPB_SIZE(12, 32), 0, 0, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
Protobuf Team Bota9387b52024-06-12 15:17:52 +00007905 UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__EnumValueDescriptorProto_msg_init);
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +00007906 const upb_Array* arr = upb_Message_GetArray(UPB_UPCAST(msg), &field);
Deanna Garciab26afb52023-04-25 13:37:18 -07007907 if (size) {
Protobuf Team Botf73985a2023-12-19 00:14:19 +00007908 *size = arr ? arr->UPB_PRIVATE(size) : 0;
Deanna Garciab26afb52023-04-25 13:37:18 -07007909 }
7910 return arr;
7911}
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +00007912UPB_INLINE upb_Array* _google_protobuf_EnumDescriptorProto_value_mutable_upb_array(google_protobuf_EnumDescriptorProto* msg, size_t* size, upb_Arena* arena) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00007913 const upb_MiniTableField field = {2, UPB_SIZE(12, 32), 0, 0, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
Protobuf Team Bota9387b52024-06-12 15:17:52 +00007914 UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__EnumValueDescriptorProto_msg_init);
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +00007915 upb_Array* arr = upb_Message_GetOrCreateMutableArray(UPB_UPCAST(msg),
7916 &field, arena);
Deanna Garciab26afb52023-04-25 13:37:18 -07007917 if (size) {
Protobuf Team Botf73985a2023-12-19 00:14:19 +00007918 *size = arr ? arr->UPB_PRIVATE(size) : 0;
Deanna Garciab26afb52023-04-25 13:37:18 -07007919 }
7920 return arr;
7921}
Mike Kruskal3bc50492022-12-01 13:34:12 -08007922UPB_INLINE void google_protobuf_EnumDescriptorProto_clear_options(google_protobuf_EnumDescriptorProto* msg) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00007923 const upb_MiniTableField field = {3, UPB_SIZE(16, 40), 65, 1, 11, (int)kUpb_FieldMode_Scalar | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
Protobuf Team Bot4e90ead2024-01-08 15:46:34 +00007924 upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
Joshua Habermand3995ec2022-09-30 16:54:39 -07007925}
Joshua Habermanf41049a2022-01-21 14:41:25 -08007926UPB_INLINE const google_protobuf_EnumOptions* google_protobuf_EnumDescriptorProto_options(const google_protobuf_EnumDescriptorProto* msg) {
Eric Salo8809a112022-11-21 13:01:06 -08007927 const google_protobuf_EnumOptions* default_val = NULL;
7928 const google_protobuf_EnumOptions* ret;
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00007929 const upb_MiniTableField field = {3, UPB_SIZE(16, 40), 65, 1, 11, (int)kUpb_FieldMode_Scalar | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
Protobuf Team Bota9387b52024-06-12 15:17:52 +00007930 UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__EnumOptions_msg_init);
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +00007931 _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field,
7932 &default_val, &ret);
Eric Salo8809a112022-11-21 13:01:06 -08007933 return ret;
Joshua Habermanf41049a2022-01-21 14:41:25 -08007934}
Mike Kruskal3bc50492022-12-01 13:34:12 -08007935UPB_INLINE bool google_protobuf_EnumDescriptorProto_has_options(const google_protobuf_EnumDescriptorProto* msg) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00007936 const upb_MiniTableField field = {3, UPB_SIZE(16, 40), 65, 1, 11, (int)kUpb_FieldMode_Scalar | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
Protobuf Team Bot8c1f6352024-01-10 05:18:15 +00007937 return upb_Message_HasBaseField(UPB_UPCAST(msg), &field);
Joshua Haberman7ecf43f2022-03-14 13:11:29 -07007938}
Mike Kruskal3bc50492022-12-01 13:34:12 -08007939UPB_INLINE void google_protobuf_EnumDescriptorProto_clear_reserved_range(google_protobuf_EnumDescriptorProto* msg) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00007940 const upb_MiniTableField field = {4, UPB_SIZE(20, 48), 0, 2, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
Protobuf Team Bot4e90ead2024-01-08 15:46:34 +00007941 upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
Joshua Habermand3995ec2022-09-30 16:54:39 -07007942}
Eric Salob7d54ac2022-12-29 11:59:42 -08007943UPB_INLINE const google_protobuf_EnumDescriptorProto_EnumReservedRange* const* google_protobuf_EnumDescriptorProto_reserved_range(const google_protobuf_EnumDescriptorProto* msg, size_t* size) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00007944 const upb_MiniTableField field = {4, UPB_SIZE(20, 48), 0, 2, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
Protobuf Team Bota9387b52024-06-12 15:17:52 +00007945 UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__EnumDescriptorProto__EnumReservedRange_msg_init);
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +00007946 const upb_Array* arr = upb_Message_GetArray(UPB_UPCAST(msg), &field);
Eric Salob7d54ac2022-12-29 11:59:42 -08007947 if (arr) {
Protobuf Team Botf73985a2023-12-19 00:14:19 +00007948 if (size) *size = arr->UPB_PRIVATE(size);
Protobuf Team Bot81e54332024-01-11 21:04:07 +00007949 return (const google_protobuf_EnumDescriptorProto_EnumReservedRange* const*)upb_Array_DataPtr(arr);
Eric Salob7d54ac2022-12-29 11:59:42 -08007950 } else {
7951 if (size) *size = 0;
7952 return NULL;
7953 }
Joshua Haberman7ecf43f2022-03-14 13:11:29 -07007954}
Deanna Garciab26afb52023-04-25 13:37:18 -07007955UPB_INLINE const upb_Array* _google_protobuf_EnumDescriptorProto_reserved_range_upb_array(const google_protobuf_EnumDescriptorProto* msg, size_t* size) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00007956 const upb_MiniTableField field = {4, UPB_SIZE(20, 48), 0, 2, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
Protobuf Team Bota9387b52024-06-12 15:17:52 +00007957 UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__EnumDescriptorProto__EnumReservedRange_msg_init);
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +00007958 const upb_Array* arr = upb_Message_GetArray(UPB_UPCAST(msg), &field);
Deanna Garciab26afb52023-04-25 13:37:18 -07007959 if (size) {
Protobuf Team Botf73985a2023-12-19 00:14:19 +00007960 *size = arr ? arr->UPB_PRIVATE(size) : 0;
Deanna Garciab26afb52023-04-25 13:37:18 -07007961 }
7962 return arr;
7963}
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +00007964UPB_INLINE upb_Array* _google_protobuf_EnumDescriptorProto_reserved_range_mutable_upb_array(google_protobuf_EnumDescriptorProto* msg, size_t* size, upb_Arena* arena) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00007965 const upb_MiniTableField field = {4, UPB_SIZE(20, 48), 0, 2, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
Protobuf Team Bota9387b52024-06-12 15:17:52 +00007966 UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__EnumDescriptorProto__EnumReservedRange_msg_init);
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +00007967 upb_Array* arr = upb_Message_GetOrCreateMutableArray(UPB_UPCAST(msg),
7968 &field, arena);
Deanna Garciab26afb52023-04-25 13:37:18 -07007969 if (size) {
Protobuf Team Botf73985a2023-12-19 00:14:19 +00007970 *size = arr ? arr->UPB_PRIVATE(size) : 0;
Deanna Garciab26afb52023-04-25 13:37:18 -07007971 }
7972 return arr;
7973}
Mike Kruskal3bc50492022-12-01 13:34:12 -08007974UPB_INLINE void google_protobuf_EnumDescriptorProto_clear_reserved_name(google_protobuf_EnumDescriptorProto* msg) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00007975 const upb_MiniTableField field = {5, UPB_SIZE(24, 56), 0, kUpb_NoSub, 12, (int)kUpb_FieldMode_Array | (int)kUpb_LabelFlags_IsAlternate | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
Protobuf Team Bot4e90ead2024-01-08 15:46:34 +00007976 upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
Joshua Habermand3995ec2022-09-30 16:54:39 -07007977}
Eric Salob7d54ac2022-12-29 11:59:42 -08007978UPB_INLINE upb_StringView const* google_protobuf_EnumDescriptorProto_reserved_name(const google_protobuf_EnumDescriptorProto* msg, size_t* size) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00007979 const upb_MiniTableField field = {5, UPB_SIZE(24, 56), 0, kUpb_NoSub, 12, (int)kUpb_FieldMode_Array | (int)kUpb_LabelFlags_IsAlternate | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +00007980 const upb_Array* arr = upb_Message_GetArray(UPB_UPCAST(msg), &field);
Eric Salob7d54ac2022-12-29 11:59:42 -08007981 if (arr) {
Protobuf Team Botf73985a2023-12-19 00:14:19 +00007982 if (size) *size = arr->UPB_PRIVATE(size);
Protobuf Team Bot81e54332024-01-11 21:04:07 +00007983 return (upb_StringView const*)upb_Array_DataPtr(arr);
Eric Salob7d54ac2022-12-29 11:59:42 -08007984 } else {
7985 if (size) *size = 0;
7986 return NULL;
7987 }
Joshua Haberman7ecf43f2022-03-14 13:11:29 -07007988}
Deanna Garciab26afb52023-04-25 13:37:18 -07007989UPB_INLINE const upb_Array* _google_protobuf_EnumDescriptorProto_reserved_name_upb_array(const google_protobuf_EnumDescriptorProto* msg, size_t* size) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00007990 const upb_MiniTableField field = {5, UPB_SIZE(24, 56), 0, kUpb_NoSub, 12, (int)kUpb_FieldMode_Array | (int)kUpb_LabelFlags_IsAlternate | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +00007991 const upb_Array* arr = upb_Message_GetArray(UPB_UPCAST(msg), &field);
Deanna Garciab26afb52023-04-25 13:37:18 -07007992 if (size) {
Protobuf Team Botf73985a2023-12-19 00:14:19 +00007993 *size = arr ? arr->UPB_PRIVATE(size) : 0;
Deanna Garciab26afb52023-04-25 13:37:18 -07007994 }
7995 return arr;
7996}
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +00007997UPB_INLINE upb_Array* _google_protobuf_EnumDescriptorProto_reserved_name_mutable_upb_array(google_protobuf_EnumDescriptorProto* msg, size_t* size, upb_Arena* arena) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00007998 const upb_MiniTableField field = {5, UPB_SIZE(24, 56), 0, kUpb_NoSub, 12, (int)kUpb_FieldMode_Array | (int)kUpb_LabelFlags_IsAlternate | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +00007999 upb_Array* arr = upb_Message_GetOrCreateMutableArray(UPB_UPCAST(msg),
8000 &field, arena);
Deanna Garciab26afb52023-04-25 13:37:18 -07008001 if (size) {
Protobuf Team Botf73985a2023-12-19 00:14:19 +00008002 *size = arr ? arr->UPB_PRIVATE(size) : 0;
Deanna Garciab26afb52023-04-25 13:37:18 -07008003 }
8004 return arr;
8005}
Joshua Haberman9abf6e22021-01-13 12:16:25 -08008006
Joshua Habermanf41049a2022-01-21 14:41:25 -08008007UPB_INLINE void google_protobuf_EnumDescriptorProto_set_name(google_protobuf_EnumDescriptorProto *msg, upb_StringView value) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00008008 const upb_MiniTableField field = {1, UPB_SIZE(28, 16), 64, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
Protobuf Team Botac32c972024-04-10 03:30:05 +00008009 upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
Mike Kruskal232ecf42023-01-14 00:09:40 -08008010}
8011UPB_INLINE google_protobuf_EnumValueDescriptorProto** google_protobuf_EnumDescriptorProto_mutable_value(google_protobuf_EnumDescriptorProto* msg, size_t* size) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00008012 upb_MiniTableField field = {2, UPB_SIZE(12, 32), 0, 0, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
Protobuf Team Bota9387b52024-06-12 15:17:52 +00008013 UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__EnumValueDescriptorProto_msg_init);
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +00008014 upb_Array* arr = upb_Message_GetMutableArray(UPB_UPCAST(msg), &field);
Eric Salob7d54ac2022-12-29 11:59:42 -08008015 if (arr) {
Protobuf Team Botf73985a2023-12-19 00:14:19 +00008016 if (size) *size = arr->UPB_PRIVATE(size);
Protobuf Team Bot81e54332024-01-11 21:04:07 +00008017 return (google_protobuf_EnumValueDescriptorProto**)upb_Array_MutableDataPtr(arr);
Eric Salob7d54ac2022-12-29 11:59:42 -08008018 } else {
8019 if (size) *size = 0;
8020 return NULL;
8021 }
Joshua Haberman9abf6e22021-01-13 12:16:25 -08008022}
Eric Salob7d54ac2022-12-29 11:59:42 -08008023UPB_INLINE google_protobuf_EnumValueDescriptorProto** google_protobuf_EnumDescriptorProto_resize_value(google_protobuf_EnumDescriptorProto* msg, size_t size, upb_Arena* arena) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00008024 upb_MiniTableField field = {2, UPB_SIZE(12, 32), 0, 0, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +00008025 return (google_protobuf_EnumValueDescriptorProto**)upb_Message_ResizeArrayUninitialized(UPB_UPCAST(msg),
8026 &field, size, arena);
Joshua Haberman9abf6e22021-01-13 12:16:25 -08008027}
Joshua Haberman7ecf43f2022-03-14 13:11:29 -07008028UPB_INLINE struct google_protobuf_EnumValueDescriptorProto* google_protobuf_EnumDescriptorProto_add_value(google_protobuf_EnumDescriptorProto* msg, upb_Arena* arena) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00008029 upb_MiniTableField field = {2, UPB_SIZE(12, 32), 0, 0, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
Protobuf Team Bota9387b52024-06-12 15:17:52 +00008030 UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__EnumValueDescriptorProto_msg_init);
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +00008031 upb_Array* arr = upb_Message_GetOrCreateMutableArray(
8032 UPB_UPCAST(msg), &field, arena);
Protobuf Team Bot81e54332024-01-11 21:04:07 +00008033 if (!arr || !UPB_PRIVATE(_upb_Array_ResizeUninitialized)(
Protobuf Team Botf73985a2023-12-19 00:14:19 +00008034 arr, arr->UPB_PRIVATE(size) + 1, arena)) {
Eric Salob7d54ac2022-12-29 11:59:42 -08008035 return NULL;
8036 }
Protobuf Team Bot4ffe0862023-12-06 02:02:36 +00008037 struct google_protobuf_EnumValueDescriptorProto* sub = (struct google_protobuf_EnumValueDescriptorProto*)_upb_Message_New(&google__protobuf__EnumValueDescriptorProto_msg_init, arena);
Eric Salob7d54ac2022-12-29 11:59:42 -08008038 if (!arr || !sub) return NULL;
Protobuf Team Botf73985a2023-12-19 00:14:19 +00008039 UPB_PRIVATE(_upb_Array_Set)
8040 (arr, arr->UPB_PRIVATE(size) - 1, &sub, sizeof(sub));
Joshua Haberman9abf6e22021-01-13 12:16:25 -08008041 return sub;
8042}
8043UPB_INLINE void google_protobuf_EnumDescriptorProto_set_options(google_protobuf_EnumDescriptorProto *msg, google_protobuf_EnumOptions* value) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00008044 const upb_MiniTableField field = {3, UPB_SIZE(16, 40), 65, 1, 11, (int)kUpb_FieldMode_Scalar | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
Protobuf Team Bota9387b52024-06-12 15:17:52 +00008045 UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__EnumOptions_msg_init);
Protobuf Team Botac32c972024-04-10 03:30:05 +00008046 upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
Mike Kruskal232ecf42023-01-14 00:09:40 -08008047}
8048UPB_INLINE struct google_protobuf_EnumOptions* google_protobuf_EnumDescriptorProto_mutable_options(google_protobuf_EnumDescriptorProto* msg, upb_Arena* arena) {
Joshua Haberman9abf6e22021-01-13 12:16:25 -08008049 struct google_protobuf_EnumOptions* sub = (struct google_protobuf_EnumOptions*)google_protobuf_EnumDescriptorProto_options(msg);
8050 if (sub == NULL) {
Protobuf Team Bot4ffe0862023-12-06 02:02:36 +00008051 sub = (struct google_protobuf_EnumOptions*)_upb_Message_New(&google__protobuf__EnumOptions_msg_init, arena);
Eric Salo8809a112022-11-21 13:01:06 -08008052 if (sub) google_protobuf_EnumDescriptorProto_set_options(msg, sub);
Joshua Haberman9abf6e22021-01-13 12:16:25 -08008053 }
8054 return sub;
8055}
Eric Salob7d54ac2022-12-29 11:59:42 -08008056UPB_INLINE google_protobuf_EnumDescriptorProto_EnumReservedRange** google_protobuf_EnumDescriptorProto_mutable_reserved_range(google_protobuf_EnumDescriptorProto* msg, size_t* size) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00008057 upb_MiniTableField field = {4, UPB_SIZE(20, 48), 0, 2, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
Protobuf Team Bota9387b52024-06-12 15:17:52 +00008058 UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__EnumDescriptorProto__EnumReservedRange_msg_init);
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +00008059 upb_Array* arr = upb_Message_GetMutableArray(UPB_UPCAST(msg), &field);
Eric Salob7d54ac2022-12-29 11:59:42 -08008060 if (arr) {
Protobuf Team Botf73985a2023-12-19 00:14:19 +00008061 if (size) *size = arr->UPB_PRIVATE(size);
Protobuf Team Bot81e54332024-01-11 21:04:07 +00008062 return (google_protobuf_EnumDescriptorProto_EnumReservedRange**)upb_Array_MutableDataPtr(arr);
Eric Salob7d54ac2022-12-29 11:59:42 -08008063 } else {
8064 if (size) *size = 0;
8065 return NULL;
8066 }
Joshua Haberman9abf6e22021-01-13 12:16:25 -08008067}
Eric Salob7d54ac2022-12-29 11:59:42 -08008068UPB_INLINE google_protobuf_EnumDescriptorProto_EnumReservedRange** google_protobuf_EnumDescriptorProto_resize_reserved_range(google_protobuf_EnumDescriptorProto* msg, size_t size, upb_Arena* arena) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00008069 upb_MiniTableField field = {4, UPB_SIZE(20, 48), 0, 2, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +00008070 return (google_protobuf_EnumDescriptorProto_EnumReservedRange**)upb_Message_ResizeArrayUninitialized(UPB_UPCAST(msg),
8071 &field, size, arena);
Joshua Haberman9abf6e22021-01-13 12:16:25 -08008072}
Joshua Haberman7ecf43f2022-03-14 13:11:29 -07008073UPB_INLINE struct google_protobuf_EnumDescriptorProto_EnumReservedRange* google_protobuf_EnumDescriptorProto_add_reserved_range(google_protobuf_EnumDescriptorProto* msg, upb_Arena* arena) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00008074 upb_MiniTableField field = {4, UPB_SIZE(20, 48), 0, 2, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
Protobuf Team Bota9387b52024-06-12 15:17:52 +00008075 UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__EnumDescriptorProto__EnumReservedRange_msg_init);
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +00008076 upb_Array* arr = upb_Message_GetOrCreateMutableArray(
8077 UPB_UPCAST(msg), &field, arena);
Protobuf Team Bot81e54332024-01-11 21:04:07 +00008078 if (!arr || !UPB_PRIVATE(_upb_Array_ResizeUninitialized)(
Protobuf Team Botf73985a2023-12-19 00:14:19 +00008079 arr, arr->UPB_PRIVATE(size) + 1, arena)) {
Eric Salob7d54ac2022-12-29 11:59:42 -08008080 return NULL;
8081 }
Protobuf Team Bot4ffe0862023-12-06 02:02:36 +00008082 struct google_protobuf_EnumDescriptorProto_EnumReservedRange* sub = (struct google_protobuf_EnumDescriptorProto_EnumReservedRange*)_upb_Message_New(&google__protobuf__EnumDescriptorProto__EnumReservedRange_msg_init, arena);
Eric Salob7d54ac2022-12-29 11:59:42 -08008083 if (!arr || !sub) return NULL;
Protobuf Team Botf73985a2023-12-19 00:14:19 +00008084 UPB_PRIVATE(_upb_Array_Set)
8085 (arr, arr->UPB_PRIVATE(size) - 1, &sub, sizeof(sub));
Joshua Haberman9abf6e22021-01-13 12:16:25 -08008086 return sub;
8087}
Eric Salob7d54ac2022-12-29 11:59:42 -08008088UPB_INLINE upb_StringView* google_protobuf_EnumDescriptorProto_mutable_reserved_name(google_protobuf_EnumDescriptorProto* msg, size_t* size) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00008089 upb_MiniTableField field = {5, UPB_SIZE(24, 56), 0, kUpb_NoSub, 12, (int)kUpb_FieldMode_Array | (int)kUpb_LabelFlags_IsAlternate | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +00008090 upb_Array* arr = upb_Message_GetMutableArray(UPB_UPCAST(msg), &field);
Eric Salob7d54ac2022-12-29 11:59:42 -08008091 if (arr) {
Protobuf Team Botf73985a2023-12-19 00:14:19 +00008092 if (size) *size = arr->UPB_PRIVATE(size);
Protobuf Team Bot81e54332024-01-11 21:04:07 +00008093 return (upb_StringView*)upb_Array_MutableDataPtr(arr);
Eric Salob7d54ac2022-12-29 11:59:42 -08008094 } else {
8095 if (size) *size = 0;
8096 return NULL;
8097 }
Joshua Haberman9abf6e22021-01-13 12:16:25 -08008098}
Eric Salob7d54ac2022-12-29 11:59:42 -08008099UPB_INLINE upb_StringView* google_protobuf_EnumDescriptorProto_resize_reserved_name(google_protobuf_EnumDescriptorProto* msg, size_t size, upb_Arena* arena) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00008100 upb_MiniTableField field = {5, UPB_SIZE(24, 56), 0, kUpb_NoSub, 12, (int)kUpb_FieldMode_Array | (int)kUpb_LabelFlags_IsAlternate | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +00008101 return (upb_StringView*)upb_Message_ResizeArrayUninitialized(UPB_UPCAST(msg),
8102 &field, size, arena);
Joshua Haberman9abf6e22021-01-13 12:16:25 -08008103}
Joshua Haberman7ecf43f2022-03-14 13:11:29 -07008104UPB_INLINE bool google_protobuf_EnumDescriptorProto_add_reserved_name(google_protobuf_EnumDescriptorProto* msg, upb_StringView val, upb_Arena* arena) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00008105 upb_MiniTableField field = {5, UPB_SIZE(24, 56), 0, kUpb_NoSub, 12, (int)kUpb_FieldMode_Array | (int)kUpb_LabelFlags_IsAlternate | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +00008106 upb_Array* arr = upb_Message_GetOrCreateMutableArray(
8107 UPB_UPCAST(msg), &field, arena);
Protobuf Team Bot81e54332024-01-11 21:04:07 +00008108 if (!arr || !UPB_PRIVATE(_upb_Array_ResizeUninitialized)(
Protobuf Team Botf73985a2023-12-19 00:14:19 +00008109 arr, arr->UPB_PRIVATE(size) + 1, arena)) {
Eric Salob7d54ac2022-12-29 11:59:42 -08008110 return false;
8111 }
Protobuf Team Botf73985a2023-12-19 00:14:19 +00008112 UPB_PRIVATE(_upb_Array_Set)
8113 (arr, arr->UPB_PRIVATE(size) - 1, &val, sizeof(val));
Eric Salob7d54ac2022-12-29 11:59:42 -08008114 return true;
Joshua Haberman9abf6e22021-01-13 12:16:25 -08008115}
8116
8117/* google.protobuf.EnumDescriptorProto.EnumReservedRange */
8118
Joshua Habermanf41049a2022-01-21 14:41:25 -08008119UPB_INLINE google_protobuf_EnumDescriptorProto_EnumReservedRange* google_protobuf_EnumDescriptorProto_EnumReservedRange_new(upb_Arena* arena) {
Protobuf Team Bot4ffe0862023-12-06 02:02:36 +00008120 return (google_protobuf_EnumDescriptorProto_EnumReservedRange*)_upb_Message_New(&google__protobuf__EnumDescriptorProto__EnumReservedRange_msg_init, arena);
Joshua Haberman9abf6e22021-01-13 12:16:25 -08008121}
Joshua Habermanf41049a2022-01-21 14:41:25 -08008122UPB_INLINE google_protobuf_EnumDescriptorProto_EnumReservedRange* google_protobuf_EnumDescriptorProto_EnumReservedRange_parse(const char* buf, size_t size, upb_Arena* arena) {
8123 google_protobuf_EnumDescriptorProto_EnumReservedRange* ret = google_protobuf_EnumDescriptorProto_EnumReservedRange_new(arena);
Joshua Haberman9d578a32021-08-02 15:32:01 -07008124 if (!ret) return NULL;
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +00008125 if (upb_Decode(buf, size, UPB_UPCAST(ret), &google__protobuf__EnumDescriptorProto__EnumReservedRange_msg_init, NULL, 0, arena) !=
8126 kUpb_DecodeStatus_Ok) {
Joshua Haberman9d578a32021-08-02 15:32:01 -07008127 return NULL;
8128 }
8129 return ret;
Joshua Haberman9abf6e22021-01-13 12:16:25 -08008130}
Joshua Habermanf41049a2022-01-21 14:41:25 -08008131UPB_INLINE google_protobuf_EnumDescriptorProto_EnumReservedRange* google_protobuf_EnumDescriptorProto_EnumReservedRange_parse_ex(const char* buf, size_t size,
8132 const upb_ExtensionRegistry* extreg,
8133 int options, upb_Arena* arena) {
8134 google_protobuf_EnumDescriptorProto_EnumReservedRange* ret = google_protobuf_EnumDescriptorProto_EnumReservedRange_new(arena);
8135 if (!ret) return NULL;
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +00008136 if (upb_Decode(buf, size, UPB_UPCAST(ret), &google__protobuf__EnumDescriptorProto__EnumReservedRange_msg_init, extreg, options,
8137 arena) != kUpb_DecodeStatus_Ok) {
Joshua Habermanf41049a2022-01-21 14:41:25 -08008138 return NULL;
8139 }
8140 return ret;
Joshua Haberman9abf6e22021-01-13 12:16:25 -08008141}
Joshua Habermanf41049a2022-01-21 14:41:25 -08008142UPB_INLINE char* google_protobuf_EnumDescriptorProto_EnumReservedRange_serialize(const google_protobuf_EnumDescriptorProto_EnumReservedRange* msg, upb_Arena* arena, size_t* len) {
Joshua Habermand3995ec2022-09-30 16:54:39 -07008143 char* ptr;
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +00008144 (void)upb_Encode(UPB_UPCAST(msg), &google__protobuf__EnumDescriptorProto__EnumReservedRange_msg_init, 0, arena, &ptr, len);
Joshua Habermand3995ec2022-09-30 16:54:39 -07008145 return ptr;
Joshua Habermanf41049a2022-01-21 14:41:25 -08008146}
8147UPB_INLINE char* google_protobuf_EnumDescriptorProto_EnumReservedRange_serialize_ex(const google_protobuf_EnumDescriptorProto_EnumReservedRange* msg, int options,
8148 upb_Arena* arena, size_t* len) {
Joshua Habermand3995ec2022-09-30 16:54:39 -07008149 char* ptr;
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +00008150 (void)upb_Encode(UPB_UPCAST(msg), &google__protobuf__EnumDescriptorProto__EnumReservedRange_msg_init, options, arena, &ptr, len);
Joshua Habermand3995ec2022-09-30 16:54:39 -07008151 return ptr;
Joshua Habermanf41049a2022-01-21 14:41:25 -08008152}
Mike Kruskal3bc50492022-12-01 13:34:12 -08008153UPB_INLINE void google_protobuf_EnumDescriptorProto_EnumReservedRange_clear_start(google_protobuf_EnumDescriptorProto_EnumReservedRange* msg) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00008154 const upb_MiniTableField field = {1, 12, 64, kUpb_NoSub, 5, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
Protobuf Team Bot4e90ead2024-01-08 15:46:34 +00008155 upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
Joshua Habermand3995ec2022-09-30 16:54:39 -07008156}
Joshua Habermanf41049a2022-01-21 14:41:25 -08008157UPB_INLINE int32_t google_protobuf_EnumDescriptorProto_EnumReservedRange_start(const google_protobuf_EnumDescriptorProto_EnumReservedRange* msg) {
Eric Salo8809a112022-11-21 13:01:06 -08008158 int32_t default_val = (int32_t)0;
8159 int32_t ret;
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00008160 const upb_MiniTableField field = {1, 12, 64, kUpb_NoSub, 5, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +00008161 _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field,
8162 &default_val, &ret);
Eric Salo8809a112022-11-21 13:01:06 -08008163 return ret;
Joshua Habermanf41049a2022-01-21 14:41:25 -08008164}
Mike Kruskal3bc50492022-12-01 13:34:12 -08008165UPB_INLINE bool google_protobuf_EnumDescriptorProto_EnumReservedRange_has_start(const google_protobuf_EnumDescriptorProto_EnumReservedRange* msg) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00008166 const upb_MiniTableField field = {1, 12, 64, kUpb_NoSub, 5, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
Protobuf Team Bot8c1f6352024-01-10 05:18:15 +00008167 return upb_Message_HasBaseField(UPB_UPCAST(msg), &field);
Joshua Haberman7ecf43f2022-03-14 13:11:29 -07008168}
Mike Kruskal3bc50492022-12-01 13:34:12 -08008169UPB_INLINE void google_protobuf_EnumDescriptorProto_EnumReservedRange_clear_end(google_protobuf_EnumDescriptorProto_EnumReservedRange* msg) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00008170 const upb_MiniTableField field = {2, 16, 65, kUpb_NoSub, 5, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
Protobuf Team Bot4e90ead2024-01-08 15:46:34 +00008171 upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
Joshua Habermand3995ec2022-09-30 16:54:39 -07008172}
Joshua Habermanf41049a2022-01-21 14:41:25 -08008173UPB_INLINE int32_t google_protobuf_EnumDescriptorProto_EnumReservedRange_end(const google_protobuf_EnumDescriptorProto_EnumReservedRange* msg) {
Eric Salo8809a112022-11-21 13:01:06 -08008174 int32_t default_val = (int32_t)0;
8175 int32_t ret;
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00008176 const upb_MiniTableField field = {2, 16, 65, kUpb_NoSub, 5, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +00008177 _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field,
8178 &default_val, &ret);
Eric Salo8809a112022-11-21 13:01:06 -08008179 return ret;
Joshua Habermanf41049a2022-01-21 14:41:25 -08008180}
Mike Kruskal3bc50492022-12-01 13:34:12 -08008181UPB_INLINE bool google_protobuf_EnumDescriptorProto_EnumReservedRange_has_end(const google_protobuf_EnumDescriptorProto_EnumReservedRange* msg) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00008182 const upb_MiniTableField field = {2, 16, 65, kUpb_NoSub, 5, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
Protobuf Team Bot8c1f6352024-01-10 05:18:15 +00008183 return upb_Message_HasBaseField(UPB_UPCAST(msg), &field);
Mike Kruskal3bc50492022-12-01 13:34:12 -08008184}
Joshua Haberman9abf6e22021-01-13 12:16:25 -08008185
8186UPB_INLINE void google_protobuf_EnumDescriptorProto_EnumReservedRange_set_start(google_protobuf_EnumDescriptorProto_EnumReservedRange *msg, int32_t value) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00008187 const upb_MiniTableField field = {1, 12, 64, kUpb_NoSub, 5, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
Protobuf Team Botac32c972024-04-10 03:30:05 +00008188 upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
Mike Kruskal232ecf42023-01-14 00:09:40 -08008189}
8190UPB_INLINE void google_protobuf_EnumDescriptorProto_EnumReservedRange_set_end(google_protobuf_EnumDescriptorProto_EnumReservedRange *msg, int32_t value) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00008191 const upb_MiniTableField field = {2, 16, 65, kUpb_NoSub, 5, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
Protobuf Team Botac32c972024-04-10 03:30:05 +00008192 upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
Joshua Haberman9abf6e22021-01-13 12:16:25 -08008193}
Mike Kruskal232ecf42023-01-14 00:09:40 -08008194
Joshua Haberman9abf6e22021-01-13 12:16:25 -08008195/* google.protobuf.EnumValueDescriptorProto */
8196
Joshua Habermanf41049a2022-01-21 14:41:25 -08008197UPB_INLINE google_protobuf_EnumValueDescriptorProto* google_protobuf_EnumValueDescriptorProto_new(upb_Arena* arena) {
Protobuf Team Bot4ffe0862023-12-06 02:02:36 +00008198 return (google_protobuf_EnumValueDescriptorProto*)_upb_Message_New(&google__protobuf__EnumValueDescriptorProto_msg_init, arena);
Joshua Haberman9abf6e22021-01-13 12:16:25 -08008199}
Joshua Habermanf41049a2022-01-21 14:41:25 -08008200UPB_INLINE google_protobuf_EnumValueDescriptorProto* google_protobuf_EnumValueDescriptorProto_parse(const char* buf, size_t size, upb_Arena* arena) {
8201 google_protobuf_EnumValueDescriptorProto* ret = google_protobuf_EnumValueDescriptorProto_new(arena);
Joshua Haberman9d578a32021-08-02 15:32:01 -07008202 if (!ret) return NULL;
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +00008203 if (upb_Decode(buf, size, UPB_UPCAST(ret), &google__protobuf__EnumValueDescriptorProto_msg_init, NULL, 0, arena) !=
8204 kUpb_DecodeStatus_Ok) {
Joshua Haberman9d578a32021-08-02 15:32:01 -07008205 return NULL;
8206 }
8207 return ret;
Joshua Haberman9abf6e22021-01-13 12:16:25 -08008208}
Joshua Habermanf41049a2022-01-21 14:41:25 -08008209UPB_INLINE google_protobuf_EnumValueDescriptorProto* google_protobuf_EnumValueDescriptorProto_parse_ex(const char* buf, size_t size,
8210 const upb_ExtensionRegistry* extreg,
8211 int options, upb_Arena* arena) {
8212 google_protobuf_EnumValueDescriptorProto* ret = google_protobuf_EnumValueDescriptorProto_new(arena);
8213 if (!ret) return NULL;
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +00008214 if (upb_Decode(buf, size, UPB_UPCAST(ret), &google__protobuf__EnumValueDescriptorProto_msg_init, extreg, options,
8215 arena) != kUpb_DecodeStatus_Ok) {
Joshua Habermanf41049a2022-01-21 14:41:25 -08008216 return NULL;
8217 }
8218 return ret;
8219}
8220UPB_INLINE char* google_protobuf_EnumValueDescriptorProto_serialize(const google_protobuf_EnumValueDescriptorProto* msg, upb_Arena* arena, size_t* len) {
Joshua Habermand3995ec2022-09-30 16:54:39 -07008221 char* ptr;
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +00008222 (void)upb_Encode(UPB_UPCAST(msg), &google__protobuf__EnumValueDescriptorProto_msg_init, 0, arena, &ptr, len);
Joshua Habermand3995ec2022-09-30 16:54:39 -07008223 return ptr;
Joshua Habermanf41049a2022-01-21 14:41:25 -08008224}
8225UPB_INLINE char* google_protobuf_EnumValueDescriptorProto_serialize_ex(const google_protobuf_EnumValueDescriptorProto* msg, int options,
8226 upb_Arena* arena, size_t* len) {
Joshua Habermand3995ec2022-09-30 16:54:39 -07008227 char* ptr;
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +00008228 (void)upb_Encode(UPB_UPCAST(msg), &google__protobuf__EnumValueDescriptorProto_msg_init, options, arena, &ptr, len);
Joshua Habermand3995ec2022-09-30 16:54:39 -07008229 return ptr;
Joshua Habermanf41049a2022-01-21 14:41:25 -08008230}
Mike Kruskal3bc50492022-12-01 13:34:12 -08008231UPB_INLINE void google_protobuf_EnumValueDescriptorProto_clear_name(google_protobuf_EnumValueDescriptorProto* msg) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00008232 const upb_MiniTableField field = {1, UPB_SIZE(20, 16), 64, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
Protobuf Team Bot4e90ead2024-01-08 15:46:34 +00008233 upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
Joshua Habermand3995ec2022-09-30 16:54:39 -07008234}
Joshua Habermanf41049a2022-01-21 14:41:25 -08008235UPB_INLINE upb_StringView google_protobuf_EnumValueDescriptorProto_name(const google_protobuf_EnumValueDescriptorProto* msg) {
Eric Salo8809a112022-11-21 13:01:06 -08008236 upb_StringView default_val = upb_StringView_FromString("");
8237 upb_StringView ret;
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00008238 const upb_MiniTableField field = {1, UPB_SIZE(20, 16), 64, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +00008239 _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field,
8240 &default_val, &ret);
Eric Salo8809a112022-11-21 13:01:06 -08008241 return ret;
Joshua Habermanf41049a2022-01-21 14:41:25 -08008242}
Mike Kruskal3bc50492022-12-01 13:34:12 -08008243UPB_INLINE bool google_protobuf_EnumValueDescriptorProto_has_name(const google_protobuf_EnumValueDescriptorProto* msg) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00008244 const upb_MiniTableField field = {1, UPB_SIZE(20, 16), 64, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
Protobuf Team Bot8c1f6352024-01-10 05:18:15 +00008245 return upb_Message_HasBaseField(UPB_UPCAST(msg), &field);
Joshua Haberman7ecf43f2022-03-14 13:11:29 -07008246}
Mike Kruskal3bc50492022-12-01 13:34:12 -08008247UPB_INLINE void google_protobuf_EnumValueDescriptorProto_clear_number(google_protobuf_EnumValueDescriptorProto* msg) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00008248 const upb_MiniTableField field = {2, 12, 65, kUpb_NoSub, 5, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
Protobuf Team Bot4e90ead2024-01-08 15:46:34 +00008249 upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
Joshua Habermand3995ec2022-09-30 16:54:39 -07008250}
Joshua Habermanf41049a2022-01-21 14:41:25 -08008251UPB_INLINE int32_t google_protobuf_EnumValueDescriptorProto_number(const google_protobuf_EnumValueDescriptorProto* msg) {
Eric Salo8809a112022-11-21 13:01:06 -08008252 int32_t default_val = (int32_t)0;
8253 int32_t ret;
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00008254 const upb_MiniTableField field = {2, 12, 65, kUpb_NoSub, 5, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +00008255 _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field,
8256 &default_val, &ret);
Eric Salo8809a112022-11-21 13:01:06 -08008257 return ret;
Joshua Habermanf41049a2022-01-21 14:41:25 -08008258}
Mike Kruskal3bc50492022-12-01 13:34:12 -08008259UPB_INLINE bool google_protobuf_EnumValueDescriptorProto_has_number(const google_protobuf_EnumValueDescriptorProto* msg) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00008260 const upb_MiniTableField field = {2, 12, 65, kUpb_NoSub, 5, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
Protobuf Team Bot8c1f6352024-01-10 05:18:15 +00008261 return upb_Message_HasBaseField(UPB_UPCAST(msg), &field);
Joshua Haberman7ecf43f2022-03-14 13:11:29 -07008262}
Mike Kruskal3bc50492022-12-01 13:34:12 -08008263UPB_INLINE void google_protobuf_EnumValueDescriptorProto_clear_options(google_protobuf_EnumValueDescriptorProto* msg) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00008264 const upb_MiniTableField field = {3, UPB_SIZE(16, 32), 66, 0, 11, (int)kUpb_FieldMode_Scalar | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
Protobuf Team Bot4e90ead2024-01-08 15:46:34 +00008265 upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
Joshua Habermand3995ec2022-09-30 16:54:39 -07008266}
Joshua Habermanf41049a2022-01-21 14:41:25 -08008267UPB_INLINE const google_protobuf_EnumValueOptions* google_protobuf_EnumValueDescriptorProto_options(const google_protobuf_EnumValueDescriptorProto* msg) {
Eric Salo8809a112022-11-21 13:01:06 -08008268 const google_protobuf_EnumValueOptions* default_val = NULL;
8269 const google_protobuf_EnumValueOptions* ret;
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00008270 const upb_MiniTableField field = {3, UPB_SIZE(16, 32), 66, 0, 11, (int)kUpb_FieldMode_Scalar | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
Protobuf Team Bota9387b52024-06-12 15:17:52 +00008271 UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__EnumValueOptions_msg_init);
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +00008272 _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field,
8273 &default_val, &ret);
Eric Salo8809a112022-11-21 13:01:06 -08008274 return ret;
Joshua Haberman9abf6e22021-01-13 12:16:25 -08008275}
Mike Kruskal3bc50492022-12-01 13:34:12 -08008276UPB_INLINE bool google_protobuf_EnumValueDescriptorProto_has_options(const google_protobuf_EnumValueDescriptorProto* msg) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00008277 const upb_MiniTableField field = {3, UPB_SIZE(16, 32), 66, 0, 11, (int)kUpb_FieldMode_Scalar | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
Protobuf Team Bot8c1f6352024-01-10 05:18:15 +00008278 return upb_Message_HasBaseField(UPB_UPCAST(msg), &field);
Mike Kruskal3bc50492022-12-01 13:34:12 -08008279}
Joshua Haberman9abf6e22021-01-13 12:16:25 -08008280
Joshua Habermanf41049a2022-01-21 14:41:25 -08008281UPB_INLINE void google_protobuf_EnumValueDescriptorProto_set_name(google_protobuf_EnumValueDescriptorProto *msg, upb_StringView value) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00008282 const upb_MiniTableField field = {1, UPB_SIZE(20, 16), 64, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
Protobuf Team Botac32c972024-04-10 03:30:05 +00008283 upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
Mike Kruskal232ecf42023-01-14 00:09:40 -08008284}
8285UPB_INLINE void google_protobuf_EnumValueDescriptorProto_set_number(google_protobuf_EnumValueDescriptorProto *msg, int32_t value) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00008286 const upb_MiniTableField field = {2, 12, 65, kUpb_NoSub, 5, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
Protobuf Team Botac32c972024-04-10 03:30:05 +00008287 upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
Mike Kruskal232ecf42023-01-14 00:09:40 -08008288}
8289UPB_INLINE void google_protobuf_EnumValueDescriptorProto_set_options(google_protobuf_EnumValueDescriptorProto *msg, google_protobuf_EnumValueOptions* value) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00008290 const upb_MiniTableField field = {3, UPB_SIZE(16, 32), 66, 0, 11, (int)kUpb_FieldMode_Scalar | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
Protobuf Team Bota9387b52024-06-12 15:17:52 +00008291 UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__EnumValueOptions_msg_init);
Protobuf Team Botac32c972024-04-10 03:30:05 +00008292 upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
Mike Kruskal232ecf42023-01-14 00:09:40 -08008293}
8294UPB_INLINE struct google_protobuf_EnumValueOptions* google_protobuf_EnumValueDescriptorProto_mutable_options(google_protobuf_EnumValueDescriptorProto* msg, upb_Arena* arena) {
Joshua Haberman9abf6e22021-01-13 12:16:25 -08008295 struct google_protobuf_EnumValueOptions* sub = (struct google_protobuf_EnumValueOptions*)google_protobuf_EnumValueDescriptorProto_options(msg);
8296 if (sub == NULL) {
Protobuf Team Bot4ffe0862023-12-06 02:02:36 +00008297 sub = (struct google_protobuf_EnumValueOptions*)_upb_Message_New(&google__protobuf__EnumValueOptions_msg_init, arena);
Eric Salo8809a112022-11-21 13:01:06 -08008298 if (sub) google_protobuf_EnumValueDescriptorProto_set_options(msg, sub);
Joshua Haberman9abf6e22021-01-13 12:16:25 -08008299 }
8300 return sub;
8301}
8302
8303/* google.protobuf.ServiceDescriptorProto */
8304
Joshua Habermanf41049a2022-01-21 14:41:25 -08008305UPB_INLINE google_protobuf_ServiceDescriptorProto* google_protobuf_ServiceDescriptorProto_new(upb_Arena* arena) {
Protobuf Team Bot4ffe0862023-12-06 02:02:36 +00008306 return (google_protobuf_ServiceDescriptorProto*)_upb_Message_New(&google__protobuf__ServiceDescriptorProto_msg_init, arena);
Joshua Haberman9abf6e22021-01-13 12:16:25 -08008307}
Joshua Habermanf41049a2022-01-21 14:41:25 -08008308UPB_INLINE google_protobuf_ServiceDescriptorProto* google_protobuf_ServiceDescriptorProto_parse(const char* buf, size_t size, upb_Arena* arena) {
8309 google_protobuf_ServiceDescriptorProto* ret = google_protobuf_ServiceDescriptorProto_new(arena);
Joshua Haberman9d578a32021-08-02 15:32:01 -07008310 if (!ret) return NULL;
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +00008311 if (upb_Decode(buf, size, UPB_UPCAST(ret), &google__protobuf__ServiceDescriptorProto_msg_init, NULL, 0, arena) !=
8312 kUpb_DecodeStatus_Ok) {
Joshua Haberman9d578a32021-08-02 15:32:01 -07008313 return NULL;
8314 }
8315 return ret;
Joshua Haberman9abf6e22021-01-13 12:16:25 -08008316}
Joshua Habermanf41049a2022-01-21 14:41:25 -08008317UPB_INLINE google_protobuf_ServiceDescriptorProto* google_protobuf_ServiceDescriptorProto_parse_ex(const char* buf, size_t size,
8318 const upb_ExtensionRegistry* extreg,
8319 int options, upb_Arena* arena) {
8320 google_protobuf_ServiceDescriptorProto* ret = google_protobuf_ServiceDescriptorProto_new(arena);
8321 if (!ret) return NULL;
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +00008322 if (upb_Decode(buf, size, UPB_UPCAST(ret), &google__protobuf__ServiceDescriptorProto_msg_init, extreg, options,
8323 arena) != kUpb_DecodeStatus_Ok) {
Joshua Habermanf41049a2022-01-21 14:41:25 -08008324 return NULL;
8325 }
8326 return ret;
Joshua Haberman9abf6e22021-01-13 12:16:25 -08008327}
Joshua Habermanf41049a2022-01-21 14:41:25 -08008328UPB_INLINE char* google_protobuf_ServiceDescriptorProto_serialize(const google_protobuf_ServiceDescriptorProto* msg, upb_Arena* arena, size_t* len) {
Joshua Habermand3995ec2022-09-30 16:54:39 -07008329 char* ptr;
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +00008330 (void)upb_Encode(UPB_UPCAST(msg), &google__protobuf__ServiceDescriptorProto_msg_init, 0, arena, &ptr, len);
Joshua Habermand3995ec2022-09-30 16:54:39 -07008331 return ptr;
Joshua Habermanf41049a2022-01-21 14:41:25 -08008332}
8333UPB_INLINE char* google_protobuf_ServiceDescriptorProto_serialize_ex(const google_protobuf_ServiceDescriptorProto* msg, int options,
8334 upb_Arena* arena, size_t* len) {
Joshua Habermand3995ec2022-09-30 16:54:39 -07008335 char* ptr;
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +00008336 (void)upb_Encode(UPB_UPCAST(msg), &google__protobuf__ServiceDescriptorProto_msg_init, options, arena, &ptr, len);
Joshua Habermand3995ec2022-09-30 16:54:39 -07008337 return ptr;
Joshua Habermanf41049a2022-01-21 14:41:25 -08008338}
Mike Kruskal3bc50492022-12-01 13:34:12 -08008339UPB_INLINE void google_protobuf_ServiceDescriptorProto_clear_name(google_protobuf_ServiceDescriptorProto* msg) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00008340 const upb_MiniTableField field = {1, UPB_SIZE(20, 16), 64, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
Protobuf Team Bot4e90ead2024-01-08 15:46:34 +00008341 upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
Joshua Habermand3995ec2022-09-30 16:54:39 -07008342}
Joshua Habermanf41049a2022-01-21 14:41:25 -08008343UPB_INLINE upb_StringView google_protobuf_ServiceDescriptorProto_name(const google_protobuf_ServiceDescriptorProto* msg) {
Eric Salo8809a112022-11-21 13:01:06 -08008344 upb_StringView default_val = upb_StringView_FromString("");
8345 upb_StringView ret;
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00008346 const upb_MiniTableField field = {1, UPB_SIZE(20, 16), 64, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +00008347 _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field,
8348 &default_val, &ret);
Eric Salo8809a112022-11-21 13:01:06 -08008349 return ret;
Joshua Habermanf41049a2022-01-21 14:41:25 -08008350}
Mike Kruskal3bc50492022-12-01 13:34:12 -08008351UPB_INLINE bool google_protobuf_ServiceDescriptorProto_has_name(const google_protobuf_ServiceDescriptorProto* msg) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00008352 const upb_MiniTableField field = {1, UPB_SIZE(20, 16), 64, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
Protobuf Team Bot8c1f6352024-01-10 05:18:15 +00008353 return upb_Message_HasBaseField(UPB_UPCAST(msg), &field);
Joshua Habermand3995ec2022-09-30 16:54:39 -07008354}
Mike Kruskal3bc50492022-12-01 13:34:12 -08008355UPB_INLINE void google_protobuf_ServiceDescriptorProto_clear_method(google_protobuf_ServiceDescriptorProto* msg) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00008356 const upb_MiniTableField field = {2, UPB_SIZE(12, 32), 0, 0, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
Protobuf Team Bot4e90ead2024-01-08 15:46:34 +00008357 upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
Joshua Haberman7ecf43f2022-03-14 13:11:29 -07008358}
Eric Salob7d54ac2022-12-29 11:59:42 -08008359UPB_INLINE const google_protobuf_MethodDescriptorProto* const* google_protobuf_ServiceDescriptorProto_method(const google_protobuf_ServiceDescriptorProto* msg, size_t* size) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00008360 const upb_MiniTableField field = {2, UPB_SIZE(12, 32), 0, 0, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
Protobuf Team Bota9387b52024-06-12 15:17:52 +00008361 UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__MethodDescriptorProto_msg_init);
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +00008362 const upb_Array* arr = upb_Message_GetArray(UPB_UPCAST(msg), &field);
Eric Salob7d54ac2022-12-29 11:59:42 -08008363 if (arr) {
Protobuf Team Botf73985a2023-12-19 00:14:19 +00008364 if (size) *size = arr->UPB_PRIVATE(size);
Protobuf Team Bot81e54332024-01-11 21:04:07 +00008365 return (const google_protobuf_MethodDescriptorProto* const*)upb_Array_DataPtr(arr);
Eric Salob7d54ac2022-12-29 11:59:42 -08008366 } else {
8367 if (size) *size = 0;
8368 return NULL;
8369 }
Joshua Haberman7ecf43f2022-03-14 13:11:29 -07008370}
Deanna Garciab26afb52023-04-25 13:37:18 -07008371UPB_INLINE const upb_Array* _google_protobuf_ServiceDescriptorProto_method_upb_array(const google_protobuf_ServiceDescriptorProto* msg, size_t* size) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00008372 const upb_MiniTableField field = {2, UPB_SIZE(12, 32), 0, 0, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
Protobuf Team Bota9387b52024-06-12 15:17:52 +00008373 UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__MethodDescriptorProto_msg_init);
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +00008374 const upb_Array* arr = upb_Message_GetArray(UPB_UPCAST(msg), &field);
Deanna Garciab26afb52023-04-25 13:37:18 -07008375 if (size) {
Protobuf Team Botf73985a2023-12-19 00:14:19 +00008376 *size = arr ? arr->UPB_PRIVATE(size) : 0;
Deanna Garciab26afb52023-04-25 13:37:18 -07008377 }
8378 return arr;
8379}
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +00008380UPB_INLINE upb_Array* _google_protobuf_ServiceDescriptorProto_method_mutable_upb_array(google_protobuf_ServiceDescriptorProto* msg, size_t* size, upb_Arena* arena) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00008381 const upb_MiniTableField field = {2, UPB_SIZE(12, 32), 0, 0, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
Protobuf Team Bota9387b52024-06-12 15:17:52 +00008382 UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__MethodDescriptorProto_msg_init);
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +00008383 upb_Array* arr = upb_Message_GetOrCreateMutableArray(UPB_UPCAST(msg),
8384 &field, arena);
Deanna Garciab26afb52023-04-25 13:37:18 -07008385 if (size) {
Protobuf Team Botf73985a2023-12-19 00:14:19 +00008386 *size = arr ? arr->UPB_PRIVATE(size) : 0;
Deanna Garciab26afb52023-04-25 13:37:18 -07008387 }
8388 return arr;
8389}
Mike Kruskal3bc50492022-12-01 13:34:12 -08008390UPB_INLINE void google_protobuf_ServiceDescriptorProto_clear_options(google_protobuf_ServiceDescriptorProto* msg) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00008391 const upb_MiniTableField field = {3, UPB_SIZE(16, 40), 65, 1, 11, (int)kUpb_FieldMode_Scalar | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
Protobuf Team Bot4e90ead2024-01-08 15:46:34 +00008392 upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
Joshua Habermand3995ec2022-09-30 16:54:39 -07008393}
Joshua Habermanf41049a2022-01-21 14:41:25 -08008394UPB_INLINE const google_protobuf_ServiceOptions* google_protobuf_ServiceDescriptorProto_options(const google_protobuf_ServiceDescriptorProto* msg) {
Eric Salo8809a112022-11-21 13:01:06 -08008395 const google_protobuf_ServiceOptions* default_val = NULL;
8396 const google_protobuf_ServiceOptions* ret;
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00008397 const upb_MiniTableField field = {3, UPB_SIZE(16, 40), 65, 1, 11, (int)kUpb_FieldMode_Scalar | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
Protobuf Team Bota9387b52024-06-12 15:17:52 +00008398 UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__ServiceOptions_msg_init);
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +00008399 _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field,
8400 &default_val, &ret);
Eric Salo8809a112022-11-21 13:01:06 -08008401 return ret;
Joshua Habermanf41049a2022-01-21 14:41:25 -08008402}
Mike Kruskal3bc50492022-12-01 13:34:12 -08008403UPB_INLINE bool google_protobuf_ServiceDescriptorProto_has_options(const google_protobuf_ServiceDescriptorProto* msg) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00008404 const upb_MiniTableField field = {3, UPB_SIZE(16, 40), 65, 1, 11, (int)kUpb_FieldMode_Scalar | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
Protobuf Team Bot8c1f6352024-01-10 05:18:15 +00008405 return upb_Message_HasBaseField(UPB_UPCAST(msg), &field);
Mike Kruskal3bc50492022-12-01 13:34:12 -08008406}
Joshua Haberman9abf6e22021-01-13 12:16:25 -08008407
Joshua Habermanf41049a2022-01-21 14:41:25 -08008408UPB_INLINE void google_protobuf_ServiceDescriptorProto_set_name(google_protobuf_ServiceDescriptorProto *msg, upb_StringView value) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00008409 const upb_MiniTableField field = {1, UPB_SIZE(20, 16), 64, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
Protobuf Team Botac32c972024-04-10 03:30:05 +00008410 upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
Mike Kruskal232ecf42023-01-14 00:09:40 -08008411}
8412UPB_INLINE google_protobuf_MethodDescriptorProto** google_protobuf_ServiceDescriptorProto_mutable_method(google_protobuf_ServiceDescriptorProto* msg, size_t* size) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00008413 upb_MiniTableField field = {2, UPB_SIZE(12, 32), 0, 0, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
Protobuf Team Bota9387b52024-06-12 15:17:52 +00008414 UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__MethodDescriptorProto_msg_init);
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +00008415 upb_Array* arr = upb_Message_GetMutableArray(UPB_UPCAST(msg), &field);
Eric Salob7d54ac2022-12-29 11:59:42 -08008416 if (arr) {
Protobuf Team Botf73985a2023-12-19 00:14:19 +00008417 if (size) *size = arr->UPB_PRIVATE(size);
Protobuf Team Bot81e54332024-01-11 21:04:07 +00008418 return (google_protobuf_MethodDescriptorProto**)upb_Array_MutableDataPtr(arr);
Eric Salob7d54ac2022-12-29 11:59:42 -08008419 } else {
8420 if (size) *size = 0;
8421 return NULL;
8422 }
Joshua Haberman9abf6e22021-01-13 12:16:25 -08008423}
Eric Salob7d54ac2022-12-29 11:59:42 -08008424UPB_INLINE google_protobuf_MethodDescriptorProto** google_protobuf_ServiceDescriptorProto_resize_method(google_protobuf_ServiceDescriptorProto* msg, size_t size, upb_Arena* arena) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00008425 upb_MiniTableField field = {2, UPB_SIZE(12, 32), 0, 0, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +00008426 return (google_protobuf_MethodDescriptorProto**)upb_Message_ResizeArrayUninitialized(UPB_UPCAST(msg),
8427 &field, size, arena);
Joshua Haberman9abf6e22021-01-13 12:16:25 -08008428}
Joshua Haberman7ecf43f2022-03-14 13:11:29 -07008429UPB_INLINE struct google_protobuf_MethodDescriptorProto* google_protobuf_ServiceDescriptorProto_add_method(google_protobuf_ServiceDescriptorProto* msg, upb_Arena* arena) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00008430 upb_MiniTableField field = {2, UPB_SIZE(12, 32), 0, 0, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
Protobuf Team Bota9387b52024-06-12 15:17:52 +00008431 UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__MethodDescriptorProto_msg_init);
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +00008432 upb_Array* arr = upb_Message_GetOrCreateMutableArray(
8433 UPB_UPCAST(msg), &field, arena);
Protobuf Team Bot81e54332024-01-11 21:04:07 +00008434 if (!arr || !UPB_PRIVATE(_upb_Array_ResizeUninitialized)(
Protobuf Team Botf73985a2023-12-19 00:14:19 +00008435 arr, arr->UPB_PRIVATE(size) + 1, arena)) {
Eric Salob7d54ac2022-12-29 11:59:42 -08008436 return NULL;
8437 }
Protobuf Team Bot4ffe0862023-12-06 02:02:36 +00008438 struct google_protobuf_MethodDescriptorProto* sub = (struct google_protobuf_MethodDescriptorProto*)_upb_Message_New(&google__protobuf__MethodDescriptorProto_msg_init, arena);
Eric Salob7d54ac2022-12-29 11:59:42 -08008439 if (!arr || !sub) return NULL;
Protobuf Team Botf73985a2023-12-19 00:14:19 +00008440 UPB_PRIVATE(_upb_Array_Set)
8441 (arr, arr->UPB_PRIVATE(size) - 1, &sub, sizeof(sub));
Joshua Haberman9abf6e22021-01-13 12:16:25 -08008442 return sub;
8443}
8444UPB_INLINE void google_protobuf_ServiceDescriptorProto_set_options(google_protobuf_ServiceDescriptorProto *msg, google_protobuf_ServiceOptions* value) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00008445 const upb_MiniTableField field = {3, UPB_SIZE(16, 40), 65, 1, 11, (int)kUpb_FieldMode_Scalar | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
Protobuf Team Bota9387b52024-06-12 15:17:52 +00008446 UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__ServiceOptions_msg_init);
Protobuf Team Botac32c972024-04-10 03:30:05 +00008447 upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
Mike Kruskal232ecf42023-01-14 00:09:40 -08008448}
8449UPB_INLINE struct google_protobuf_ServiceOptions* google_protobuf_ServiceDescriptorProto_mutable_options(google_protobuf_ServiceDescriptorProto* msg, upb_Arena* arena) {
Joshua Haberman9abf6e22021-01-13 12:16:25 -08008450 struct google_protobuf_ServiceOptions* sub = (struct google_protobuf_ServiceOptions*)google_protobuf_ServiceDescriptorProto_options(msg);
8451 if (sub == NULL) {
Protobuf Team Bot4ffe0862023-12-06 02:02:36 +00008452 sub = (struct google_protobuf_ServiceOptions*)_upb_Message_New(&google__protobuf__ServiceOptions_msg_init, arena);
Eric Salo8809a112022-11-21 13:01:06 -08008453 if (sub) google_protobuf_ServiceDescriptorProto_set_options(msg, sub);
Joshua Haberman9abf6e22021-01-13 12:16:25 -08008454 }
8455 return sub;
8456}
8457
8458/* google.protobuf.MethodDescriptorProto */
8459
Joshua Habermanf41049a2022-01-21 14:41:25 -08008460UPB_INLINE google_protobuf_MethodDescriptorProto* google_protobuf_MethodDescriptorProto_new(upb_Arena* arena) {
Protobuf Team Bot4ffe0862023-12-06 02:02:36 +00008461 return (google_protobuf_MethodDescriptorProto*)_upb_Message_New(&google__protobuf__MethodDescriptorProto_msg_init, arena);
Joshua Haberman9abf6e22021-01-13 12:16:25 -08008462}
Joshua Habermanf41049a2022-01-21 14:41:25 -08008463UPB_INLINE google_protobuf_MethodDescriptorProto* google_protobuf_MethodDescriptorProto_parse(const char* buf, size_t size, upb_Arena* arena) {
8464 google_protobuf_MethodDescriptorProto* ret = google_protobuf_MethodDescriptorProto_new(arena);
Joshua Haberman9d578a32021-08-02 15:32:01 -07008465 if (!ret) return NULL;
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +00008466 if (upb_Decode(buf, size, UPB_UPCAST(ret), &google__protobuf__MethodDescriptorProto_msg_init, NULL, 0, arena) !=
8467 kUpb_DecodeStatus_Ok) {
Joshua Haberman9d578a32021-08-02 15:32:01 -07008468 return NULL;
8469 }
8470 return ret;
Joshua Haberman9abf6e22021-01-13 12:16:25 -08008471}
Joshua Habermanf41049a2022-01-21 14:41:25 -08008472UPB_INLINE google_protobuf_MethodDescriptorProto* google_protobuf_MethodDescriptorProto_parse_ex(const char* buf, size_t size,
8473 const upb_ExtensionRegistry* extreg,
8474 int options, upb_Arena* arena) {
8475 google_protobuf_MethodDescriptorProto* ret = google_protobuf_MethodDescriptorProto_new(arena);
8476 if (!ret) return NULL;
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +00008477 if (upb_Decode(buf, size, UPB_UPCAST(ret), &google__protobuf__MethodDescriptorProto_msg_init, extreg, options,
8478 arena) != kUpb_DecodeStatus_Ok) {
Joshua Habermanf41049a2022-01-21 14:41:25 -08008479 return NULL;
8480 }
8481 return ret;
Joshua Haberman9abf6e22021-01-13 12:16:25 -08008482}
Joshua Habermanf41049a2022-01-21 14:41:25 -08008483UPB_INLINE char* google_protobuf_MethodDescriptorProto_serialize(const google_protobuf_MethodDescriptorProto* msg, upb_Arena* arena, size_t* len) {
Joshua Habermand3995ec2022-09-30 16:54:39 -07008484 char* ptr;
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +00008485 (void)upb_Encode(UPB_UPCAST(msg), &google__protobuf__MethodDescriptorProto_msg_init, 0, arena, &ptr, len);
Joshua Habermand3995ec2022-09-30 16:54:39 -07008486 return ptr;
Joshua Habermanf41049a2022-01-21 14:41:25 -08008487}
8488UPB_INLINE char* google_protobuf_MethodDescriptorProto_serialize_ex(const google_protobuf_MethodDescriptorProto* msg, int options,
8489 upb_Arena* arena, size_t* len) {
Joshua Habermand3995ec2022-09-30 16:54:39 -07008490 char* ptr;
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +00008491 (void)upb_Encode(UPB_UPCAST(msg), &google__protobuf__MethodDescriptorProto_msg_init, options, arena, &ptr, len);
Joshua Habermand3995ec2022-09-30 16:54:39 -07008492 return ptr;
Joshua Habermanf41049a2022-01-21 14:41:25 -08008493}
Mike Kruskal3bc50492022-12-01 13:34:12 -08008494UPB_INLINE void google_protobuf_MethodDescriptorProto_clear_name(google_protobuf_MethodDescriptorProto* msg) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00008495 const upb_MiniTableField field = {1, UPB_SIZE(20, 16), 64, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
Protobuf Team Bot4e90ead2024-01-08 15:46:34 +00008496 upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
Joshua Habermand3995ec2022-09-30 16:54:39 -07008497}
Joshua Habermanf41049a2022-01-21 14:41:25 -08008498UPB_INLINE upb_StringView google_protobuf_MethodDescriptorProto_name(const google_protobuf_MethodDescriptorProto* msg) {
Eric Salo8809a112022-11-21 13:01:06 -08008499 upb_StringView default_val = upb_StringView_FromString("");
8500 upb_StringView ret;
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00008501 const upb_MiniTableField field = {1, UPB_SIZE(20, 16), 64, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +00008502 _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field,
8503 &default_val, &ret);
Eric Salo8809a112022-11-21 13:01:06 -08008504 return ret;
Joshua Habermanf41049a2022-01-21 14:41:25 -08008505}
Mike Kruskal3bc50492022-12-01 13:34:12 -08008506UPB_INLINE bool google_protobuf_MethodDescriptorProto_has_name(const google_protobuf_MethodDescriptorProto* msg) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00008507 const upb_MiniTableField field = {1, UPB_SIZE(20, 16), 64, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
Protobuf Team Bot8c1f6352024-01-10 05:18:15 +00008508 return upb_Message_HasBaseField(UPB_UPCAST(msg), &field);
Joshua Haberman7ecf43f2022-03-14 13:11:29 -07008509}
Mike Kruskal3bc50492022-12-01 13:34:12 -08008510UPB_INLINE void google_protobuf_MethodDescriptorProto_clear_input_type(google_protobuf_MethodDescriptorProto* msg) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00008511 const upb_MiniTableField field = {2, UPB_SIZE(28, 32), 65, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
Protobuf Team Bot4e90ead2024-01-08 15:46:34 +00008512 upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
Joshua Habermand3995ec2022-09-30 16:54:39 -07008513}
Joshua Habermanf41049a2022-01-21 14:41:25 -08008514UPB_INLINE upb_StringView google_protobuf_MethodDescriptorProto_input_type(const google_protobuf_MethodDescriptorProto* msg) {
Eric Salo8809a112022-11-21 13:01:06 -08008515 upb_StringView default_val = upb_StringView_FromString("");
8516 upb_StringView ret;
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00008517 const upb_MiniTableField field = {2, UPB_SIZE(28, 32), 65, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +00008518 _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field,
8519 &default_val, &ret);
Eric Salo8809a112022-11-21 13:01:06 -08008520 return ret;
Joshua Habermanf41049a2022-01-21 14:41:25 -08008521}
Mike Kruskal3bc50492022-12-01 13:34:12 -08008522UPB_INLINE bool google_protobuf_MethodDescriptorProto_has_input_type(const google_protobuf_MethodDescriptorProto* msg) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00008523 const upb_MiniTableField field = {2, UPB_SIZE(28, 32), 65, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
Protobuf Team Bot8c1f6352024-01-10 05:18:15 +00008524 return upb_Message_HasBaseField(UPB_UPCAST(msg), &field);
Joshua Haberman7ecf43f2022-03-14 13:11:29 -07008525}
Mike Kruskal3bc50492022-12-01 13:34:12 -08008526UPB_INLINE void google_protobuf_MethodDescriptorProto_clear_output_type(google_protobuf_MethodDescriptorProto* msg) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00008527 const upb_MiniTableField field = {3, UPB_SIZE(36, 48), 66, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
Protobuf Team Bot4e90ead2024-01-08 15:46:34 +00008528 upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
Joshua Habermand3995ec2022-09-30 16:54:39 -07008529}
Joshua Habermanf41049a2022-01-21 14:41:25 -08008530UPB_INLINE upb_StringView google_protobuf_MethodDescriptorProto_output_type(const google_protobuf_MethodDescriptorProto* msg) {
Eric Salo8809a112022-11-21 13:01:06 -08008531 upb_StringView default_val = upb_StringView_FromString("");
8532 upb_StringView ret;
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00008533 const upb_MiniTableField field = {3, UPB_SIZE(36, 48), 66, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +00008534 _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field,
8535 &default_val, &ret);
Eric Salo8809a112022-11-21 13:01:06 -08008536 return ret;
Joshua Habermanf41049a2022-01-21 14:41:25 -08008537}
Mike Kruskal3bc50492022-12-01 13:34:12 -08008538UPB_INLINE bool google_protobuf_MethodDescriptorProto_has_output_type(const google_protobuf_MethodDescriptorProto* msg) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00008539 const upb_MiniTableField field = {3, UPB_SIZE(36, 48), 66, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
Protobuf Team Bot8c1f6352024-01-10 05:18:15 +00008540 return upb_Message_HasBaseField(UPB_UPCAST(msg), &field);
Joshua Haberman7ecf43f2022-03-14 13:11:29 -07008541}
Mike Kruskal3bc50492022-12-01 13:34:12 -08008542UPB_INLINE void google_protobuf_MethodDescriptorProto_clear_options(google_protobuf_MethodDescriptorProto* msg) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00008543 const upb_MiniTableField field = {4, UPB_SIZE(12, 64), 67, 0, 11, (int)kUpb_FieldMode_Scalar | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
Protobuf Team Bot4e90ead2024-01-08 15:46:34 +00008544 upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
Joshua Habermand3995ec2022-09-30 16:54:39 -07008545}
Joshua Habermanf41049a2022-01-21 14:41:25 -08008546UPB_INLINE const google_protobuf_MethodOptions* google_protobuf_MethodDescriptorProto_options(const google_protobuf_MethodDescriptorProto* msg) {
Eric Salo8809a112022-11-21 13:01:06 -08008547 const google_protobuf_MethodOptions* default_val = NULL;
8548 const google_protobuf_MethodOptions* ret;
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00008549 const upb_MiniTableField field = {4, UPB_SIZE(12, 64), 67, 0, 11, (int)kUpb_FieldMode_Scalar | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
Protobuf Team Bota9387b52024-06-12 15:17:52 +00008550 UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__MethodOptions_msg_init);
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +00008551 _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field,
8552 &default_val, &ret);
Eric Salo8809a112022-11-21 13:01:06 -08008553 return ret;
Joshua Habermanf41049a2022-01-21 14:41:25 -08008554}
Mike Kruskal3bc50492022-12-01 13:34:12 -08008555UPB_INLINE bool google_protobuf_MethodDescriptorProto_has_options(const google_protobuf_MethodDescriptorProto* msg) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00008556 const upb_MiniTableField field = {4, UPB_SIZE(12, 64), 67, 0, 11, (int)kUpb_FieldMode_Scalar | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
Protobuf Team Bot8c1f6352024-01-10 05:18:15 +00008557 return upb_Message_HasBaseField(UPB_UPCAST(msg), &field);
Joshua Haberman7ecf43f2022-03-14 13:11:29 -07008558}
Mike Kruskal3bc50492022-12-01 13:34:12 -08008559UPB_INLINE void google_protobuf_MethodDescriptorProto_clear_client_streaming(google_protobuf_MethodDescriptorProto* msg) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00008560 const upb_MiniTableField field = {5, UPB_SIZE(16, 9), 68, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
Protobuf Team Bot4e90ead2024-01-08 15:46:34 +00008561 upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
Joshua Habermand3995ec2022-09-30 16:54:39 -07008562}
Joshua Habermanf41049a2022-01-21 14:41:25 -08008563UPB_INLINE bool google_protobuf_MethodDescriptorProto_client_streaming(const google_protobuf_MethodDescriptorProto* msg) {
Eric Salo8809a112022-11-21 13:01:06 -08008564 bool default_val = false;
8565 bool ret;
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00008566 const upb_MiniTableField field = {5, UPB_SIZE(16, 9), 68, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +00008567 _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field,
8568 &default_val, &ret);
Eric Salo8809a112022-11-21 13:01:06 -08008569 return ret;
Joshua Habermanf41049a2022-01-21 14:41:25 -08008570}
Mike Kruskal3bc50492022-12-01 13:34:12 -08008571UPB_INLINE bool google_protobuf_MethodDescriptorProto_has_client_streaming(const google_protobuf_MethodDescriptorProto* msg) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00008572 const upb_MiniTableField field = {5, UPB_SIZE(16, 9), 68, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
Protobuf Team Bot8c1f6352024-01-10 05:18:15 +00008573 return upb_Message_HasBaseField(UPB_UPCAST(msg), &field);
Joshua Haberman7ecf43f2022-03-14 13:11:29 -07008574}
Mike Kruskal3bc50492022-12-01 13:34:12 -08008575UPB_INLINE void google_protobuf_MethodDescriptorProto_clear_server_streaming(google_protobuf_MethodDescriptorProto* msg) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00008576 const upb_MiniTableField field = {6, UPB_SIZE(17, 10), 69, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
Protobuf Team Bot4e90ead2024-01-08 15:46:34 +00008577 upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
Joshua Habermand3995ec2022-09-30 16:54:39 -07008578}
Joshua Habermanf41049a2022-01-21 14:41:25 -08008579UPB_INLINE bool google_protobuf_MethodDescriptorProto_server_streaming(const google_protobuf_MethodDescriptorProto* msg) {
Eric Salo8809a112022-11-21 13:01:06 -08008580 bool default_val = false;
8581 bool ret;
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00008582 const upb_MiniTableField field = {6, UPB_SIZE(17, 10), 69, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +00008583 _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field,
8584 &default_val, &ret);
Eric Salo8809a112022-11-21 13:01:06 -08008585 return ret;
Joshua Habermanf41049a2022-01-21 14:41:25 -08008586}
Mike Kruskal3bc50492022-12-01 13:34:12 -08008587UPB_INLINE bool google_protobuf_MethodDescriptorProto_has_server_streaming(const google_protobuf_MethodDescriptorProto* msg) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00008588 const upb_MiniTableField field = {6, UPB_SIZE(17, 10), 69, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
Protobuf Team Bot8c1f6352024-01-10 05:18:15 +00008589 return upb_Message_HasBaseField(UPB_UPCAST(msg), &field);
Mike Kruskal3bc50492022-12-01 13:34:12 -08008590}
Joshua Haberman9abf6e22021-01-13 12:16:25 -08008591
Joshua Habermanf41049a2022-01-21 14:41:25 -08008592UPB_INLINE void google_protobuf_MethodDescriptorProto_set_name(google_protobuf_MethodDescriptorProto *msg, upb_StringView value) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00008593 const upb_MiniTableField field = {1, UPB_SIZE(20, 16), 64, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
Protobuf Team Botac32c972024-04-10 03:30:05 +00008594 upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
Mike Kruskal232ecf42023-01-14 00:09:40 -08008595}
8596UPB_INLINE void google_protobuf_MethodDescriptorProto_set_input_type(google_protobuf_MethodDescriptorProto *msg, upb_StringView value) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00008597 const upb_MiniTableField field = {2, UPB_SIZE(28, 32), 65, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
Protobuf Team Botac32c972024-04-10 03:30:05 +00008598 upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
Mike Kruskal232ecf42023-01-14 00:09:40 -08008599}
8600UPB_INLINE void google_protobuf_MethodDescriptorProto_set_output_type(google_protobuf_MethodDescriptorProto *msg, upb_StringView value) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00008601 const upb_MiniTableField field = {3, UPB_SIZE(36, 48), 66, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
Protobuf Team Botac32c972024-04-10 03:30:05 +00008602 upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
Mike Kruskal232ecf42023-01-14 00:09:40 -08008603}
8604UPB_INLINE void google_protobuf_MethodDescriptorProto_set_options(google_protobuf_MethodDescriptorProto *msg, google_protobuf_MethodOptions* value) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00008605 const upb_MiniTableField field = {4, UPB_SIZE(12, 64), 67, 0, 11, (int)kUpb_FieldMode_Scalar | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
Protobuf Team Bota9387b52024-06-12 15:17:52 +00008606 UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__MethodOptions_msg_init);
Protobuf Team Botac32c972024-04-10 03:30:05 +00008607 upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
Mike Kruskal232ecf42023-01-14 00:09:40 -08008608}
8609UPB_INLINE struct google_protobuf_MethodOptions* google_protobuf_MethodDescriptorProto_mutable_options(google_protobuf_MethodDescriptorProto* msg, upb_Arena* arena) {
Joshua Haberman9abf6e22021-01-13 12:16:25 -08008610 struct google_protobuf_MethodOptions* sub = (struct google_protobuf_MethodOptions*)google_protobuf_MethodDescriptorProto_options(msg);
8611 if (sub == NULL) {
Protobuf Team Bot4ffe0862023-12-06 02:02:36 +00008612 sub = (struct google_protobuf_MethodOptions*)_upb_Message_New(&google__protobuf__MethodOptions_msg_init, arena);
Eric Salo8809a112022-11-21 13:01:06 -08008613 if (sub) google_protobuf_MethodDescriptorProto_set_options(msg, sub);
Joshua Haberman9abf6e22021-01-13 12:16:25 -08008614 }
8615 return sub;
8616}
8617UPB_INLINE void google_protobuf_MethodDescriptorProto_set_client_streaming(google_protobuf_MethodDescriptorProto *msg, bool value) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00008618 const upb_MiniTableField field = {5, UPB_SIZE(16, 9), 68, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
Protobuf Team Botac32c972024-04-10 03:30:05 +00008619 upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
Mike Kruskal232ecf42023-01-14 00:09:40 -08008620}
8621UPB_INLINE void google_protobuf_MethodDescriptorProto_set_server_streaming(google_protobuf_MethodDescriptorProto *msg, bool value) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00008622 const upb_MiniTableField field = {6, UPB_SIZE(17, 10), 69, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
Protobuf Team Botac32c972024-04-10 03:30:05 +00008623 upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
Joshua Haberman9abf6e22021-01-13 12:16:25 -08008624}
Mike Kruskal232ecf42023-01-14 00:09:40 -08008625
Joshua Haberman9abf6e22021-01-13 12:16:25 -08008626/* google.protobuf.FileOptions */
8627
Joshua Habermanf41049a2022-01-21 14:41:25 -08008628UPB_INLINE google_protobuf_FileOptions* google_protobuf_FileOptions_new(upb_Arena* arena) {
Protobuf Team Bot4ffe0862023-12-06 02:02:36 +00008629 return (google_protobuf_FileOptions*)_upb_Message_New(&google__protobuf__FileOptions_msg_init, arena);
Joshua Haberman9abf6e22021-01-13 12:16:25 -08008630}
Joshua Habermanf41049a2022-01-21 14:41:25 -08008631UPB_INLINE google_protobuf_FileOptions* google_protobuf_FileOptions_parse(const char* buf, size_t size, upb_Arena* arena) {
8632 google_protobuf_FileOptions* ret = google_protobuf_FileOptions_new(arena);
Joshua Haberman9d578a32021-08-02 15:32:01 -07008633 if (!ret) return NULL;
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +00008634 if (upb_Decode(buf, size, UPB_UPCAST(ret), &google__protobuf__FileOptions_msg_init, NULL, 0, arena) !=
8635 kUpb_DecodeStatus_Ok) {
Joshua Haberman9d578a32021-08-02 15:32:01 -07008636 return NULL;
8637 }
8638 return ret;
Joshua Haberman9abf6e22021-01-13 12:16:25 -08008639}
Joshua Habermanf41049a2022-01-21 14:41:25 -08008640UPB_INLINE google_protobuf_FileOptions* google_protobuf_FileOptions_parse_ex(const char* buf, size_t size,
8641 const upb_ExtensionRegistry* extreg,
8642 int options, upb_Arena* arena) {
8643 google_protobuf_FileOptions* ret = google_protobuf_FileOptions_new(arena);
8644 if (!ret) return NULL;
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +00008645 if (upb_Decode(buf, size, UPB_UPCAST(ret), &google__protobuf__FileOptions_msg_init, extreg, options,
8646 arena) != kUpb_DecodeStatus_Ok) {
Joshua Habermanf41049a2022-01-21 14:41:25 -08008647 return NULL;
8648 }
8649 return ret;
Joshua Haberman9abf6e22021-01-13 12:16:25 -08008650}
Joshua Habermanf41049a2022-01-21 14:41:25 -08008651UPB_INLINE char* google_protobuf_FileOptions_serialize(const google_protobuf_FileOptions* msg, upb_Arena* arena, size_t* len) {
Joshua Habermand3995ec2022-09-30 16:54:39 -07008652 char* ptr;
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +00008653 (void)upb_Encode(UPB_UPCAST(msg), &google__protobuf__FileOptions_msg_init, 0, arena, &ptr, len);
Joshua Habermand3995ec2022-09-30 16:54:39 -07008654 return ptr;
Joshua Habermanf41049a2022-01-21 14:41:25 -08008655}
8656UPB_INLINE char* google_protobuf_FileOptions_serialize_ex(const google_protobuf_FileOptions* msg, int options,
8657 upb_Arena* arena, size_t* len) {
Joshua Habermand3995ec2022-09-30 16:54:39 -07008658 char* ptr;
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +00008659 (void)upb_Encode(UPB_UPCAST(msg), &google__protobuf__FileOptions_msg_init, options, arena, &ptr, len);
Joshua Habermand3995ec2022-09-30 16:54:39 -07008660 return ptr;
Joshua Habermanf41049a2022-01-21 14:41:25 -08008661}
Mike Kruskal3bc50492022-12-01 13:34:12 -08008662UPB_INLINE void google_protobuf_FileOptions_clear_java_package(google_protobuf_FileOptions* msg) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00008663 const upb_MiniTableField field = {1, UPB_SIZE(32, 24), 64, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
Protobuf Team Bot4e90ead2024-01-08 15:46:34 +00008664 upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
Joshua Habermand3995ec2022-09-30 16:54:39 -07008665}
Joshua Habermanf41049a2022-01-21 14:41:25 -08008666UPB_INLINE upb_StringView google_protobuf_FileOptions_java_package(const google_protobuf_FileOptions* msg) {
Eric Salo8809a112022-11-21 13:01:06 -08008667 upb_StringView default_val = upb_StringView_FromString("");
8668 upb_StringView ret;
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00008669 const upb_MiniTableField field = {1, UPB_SIZE(32, 24), 64, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +00008670 _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field,
8671 &default_val, &ret);
Eric Salo8809a112022-11-21 13:01:06 -08008672 return ret;
Joshua Habermanf41049a2022-01-21 14:41:25 -08008673}
Mike Kruskal3bc50492022-12-01 13:34:12 -08008674UPB_INLINE bool google_protobuf_FileOptions_has_java_package(const google_protobuf_FileOptions* msg) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00008675 const upb_MiniTableField field = {1, UPB_SIZE(32, 24), 64, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
Protobuf Team Bot8c1f6352024-01-10 05:18:15 +00008676 return upb_Message_HasBaseField(UPB_UPCAST(msg), &field);
Joshua Haberman7ecf43f2022-03-14 13:11:29 -07008677}
Mike Kruskal3bc50492022-12-01 13:34:12 -08008678UPB_INLINE void google_protobuf_FileOptions_clear_java_outer_classname(google_protobuf_FileOptions* msg) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00008679 const upb_MiniTableField field = {8, 40, 65, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
Protobuf Team Bot4e90ead2024-01-08 15:46:34 +00008680 upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
Joshua Habermand3995ec2022-09-30 16:54:39 -07008681}
Joshua Habermanf41049a2022-01-21 14:41:25 -08008682UPB_INLINE upb_StringView google_protobuf_FileOptions_java_outer_classname(const google_protobuf_FileOptions* msg) {
Eric Salo8809a112022-11-21 13:01:06 -08008683 upb_StringView default_val = upb_StringView_FromString("");
8684 upb_StringView ret;
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00008685 const upb_MiniTableField field = {8, 40, 65, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +00008686 _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field,
8687 &default_val, &ret);
Eric Salo8809a112022-11-21 13:01:06 -08008688 return ret;
Joshua Habermanf41049a2022-01-21 14:41:25 -08008689}
Mike Kruskal3bc50492022-12-01 13:34:12 -08008690UPB_INLINE bool google_protobuf_FileOptions_has_java_outer_classname(const google_protobuf_FileOptions* msg) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00008691 const upb_MiniTableField field = {8, 40, 65, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
Protobuf Team Bot8c1f6352024-01-10 05:18:15 +00008692 return upb_Message_HasBaseField(UPB_UPCAST(msg), &field);
Joshua Haberman7ecf43f2022-03-14 13:11:29 -07008693}
Mike Kruskal3bc50492022-12-01 13:34:12 -08008694UPB_INLINE void google_protobuf_FileOptions_clear_optimize_for(google_protobuf_FileOptions* msg) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00008695 const upb_MiniTableField field = {9, 12, 66, 2, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
Protobuf Team Bot4e90ead2024-01-08 15:46:34 +00008696 upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
Joshua Habermand3995ec2022-09-30 16:54:39 -07008697}
Joshua Habermanf41049a2022-01-21 14:41:25 -08008698UPB_INLINE int32_t google_protobuf_FileOptions_optimize_for(const google_protobuf_FileOptions* msg) {
Eric Salo8809a112022-11-21 13:01:06 -08008699 int32_t default_val = 1;
8700 int32_t ret;
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00008701 const upb_MiniTableField field = {9, 12, 66, 2, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +00008702 _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field,
8703 &default_val, &ret);
Eric Salo8809a112022-11-21 13:01:06 -08008704 return ret;
Joshua Habermanf41049a2022-01-21 14:41:25 -08008705}
Mike Kruskal3bc50492022-12-01 13:34:12 -08008706UPB_INLINE bool google_protobuf_FileOptions_has_optimize_for(const google_protobuf_FileOptions* msg) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00008707 const upb_MiniTableField field = {9, 12, 66, 2, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
Protobuf Team Bot8c1f6352024-01-10 05:18:15 +00008708 return upb_Message_HasBaseField(UPB_UPCAST(msg), &field);
Joshua Haberman7ecf43f2022-03-14 13:11:29 -07008709}
Mike Kruskal3bc50492022-12-01 13:34:12 -08008710UPB_INLINE void google_protobuf_FileOptions_clear_java_multiple_files(google_protobuf_FileOptions* msg) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00008711 const upb_MiniTableField field = {10, 16, 67, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
Protobuf Team Bot4e90ead2024-01-08 15:46:34 +00008712 upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
Joshua Habermand3995ec2022-09-30 16:54:39 -07008713}
Joshua Habermanf41049a2022-01-21 14:41:25 -08008714UPB_INLINE bool google_protobuf_FileOptions_java_multiple_files(const google_protobuf_FileOptions* msg) {
Eric Salo8809a112022-11-21 13:01:06 -08008715 bool default_val = false;
8716 bool ret;
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00008717 const upb_MiniTableField field = {10, 16, 67, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +00008718 _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field,
8719 &default_val, &ret);
Eric Salo8809a112022-11-21 13:01:06 -08008720 return ret;
Joshua Habermanf41049a2022-01-21 14:41:25 -08008721}
Mike Kruskal3bc50492022-12-01 13:34:12 -08008722UPB_INLINE bool google_protobuf_FileOptions_has_java_multiple_files(const google_protobuf_FileOptions* msg) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00008723 const upb_MiniTableField field = {10, 16, 67, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
Protobuf Team Bot8c1f6352024-01-10 05:18:15 +00008724 return upb_Message_HasBaseField(UPB_UPCAST(msg), &field);
Joshua Haberman7ecf43f2022-03-14 13:11:29 -07008725}
Mike Kruskal3bc50492022-12-01 13:34:12 -08008726UPB_INLINE void google_protobuf_FileOptions_clear_go_package(google_protobuf_FileOptions* msg) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00008727 const upb_MiniTableField field = {11, UPB_SIZE(48, 56), 68, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
Protobuf Team Bot4e90ead2024-01-08 15:46:34 +00008728 upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
Joshua Habermand3995ec2022-09-30 16:54:39 -07008729}
Joshua Habermanf41049a2022-01-21 14:41:25 -08008730UPB_INLINE upb_StringView google_protobuf_FileOptions_go_package(const google_protobuf_FileOptions* msg) {
Eric Salo8809a112022-11-21 13:01:06 -08008731 upb_StringView default_val = upb_StringView_FromString("");
8732 upb_StringView ret;
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00008733 const upb_MiniTableField field = {11, UPB_SIZE(48, 56), 68, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +00008734 _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field,
8735 &default_val, &ret);
Eric Salo8809a112022-11-21 13:01:06 -08008736 return ret;
Joshua Habermanf41049a2022-01-21 14:41:25 -08008737}
Mike Kruskal3bc50492022-12-01 13:34:12 -08008738UPB_INLINE bool google_protobuf_FileOptions_has_go_package(const google_protobuf_FileOptions* msg) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00008739 const upb_MiniTableField field = {11, UPB_SIZE(48, 56), 68, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
Protobuf Team Bot8c1f6352024-01-10 05:18:15 +00008740 return upb_Message_HasBaseField(UPB_UPCAST(msg), &field);
Joshua Haberman7ecf43f2022-03-14 13:11:29 -07008741}
Mike Kruskal3bc50492022-12-01 13:34:12 -08008742UPB_INLINE void google_protobuf_FileOptions_clear_cc_generic_services(google_protobuf_FileOptions* msg) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00008743 const upb_MiniTableField field = {16, 17, 69, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
Protobuf Team Bot4e90ead2024-01-08 15:46:34 +00008744 upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
Joshua Habermand3995ec2022-09-30 16:54:39 -07008745}
Joshua Habermanf41049a2022-01-21 14:41:25 -08008746UPB_INLINE bool google_protobuf_FileOptions_cc_generic_services(const google_protobuf_FileOptions* msg) {
Eric Salo8809a112022-11-21 13:01:06 -08008747 bool default_val = false;
8748 bool ret;
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00008749 const upb_MiniTableField field = {16, 17, 69, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +00008750 _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field,
8751 &default_val, &ret);
Eric Salo8809a112022-11-21 13:01:06 -08008752 return ret;
Joshua Habermanf41049a2022-01-21 14:41:25 -08008753}
Mike Kruskal3bc50492022-12-01 13:34:12 -08008754UPB_INLINE bool google_protobuf_FileOptions_has_cc_generic_services(const google_protobuf_FileOptions* msg) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00008755 const upb_MiniTableField field = {16, 17, 69, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
Protobuf Team Bot8c1f6352024-01-10 05:18:15 +00008756 return upb_Message_HasBaseField(UPB_UPCAST(msg), &field);
Joshua Haberman7ecf43f2022-03-14 13:11:29 -07008757}
Mike Kruskal3bc50492022-12-01 13:34:12 -08008758UPB_INLINE void google_protobuf_FileOptions_clear_java_generic_services(google_protobuf_FileOptions* msg) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00008759 const upb_MiniTableField field = {17, 18, 70, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
Protobuf Team Bot4e90ead2024-01-08 15:46:34 +00008760 upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
Joshua Habermand3995ec2022-09-30 16:54:39 -07008761}
Joshua Habermanf41049a2022-01-21 14:41:25 -08008762UPB_INLINE bool google_protobuf_FileOptions_java_generic_services(const google_protobuf_FileOptions* msg) {
Eric Salo8809a112022-11-21 13:01:06 -08008763 bool default_val = false;
8764 bool ret;
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00008765 const upb_MiniTableField field = {17, 18, 70, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +00008766 _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field,
8767 &default_val, &ret);
Eric Salo8809a112022-11-21 13:01:06 -08008768 return ret;
Joshua Habermanf41049a2022-01-21 14:41:25 -08008769}
Mike Kruskal3bc50492022-12-01 13:34:12 -08008770UPB_INLINE bool google_protobuf_FileOptions_has_java_generic_services(const google_protobuf_FileOptions* msg) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00008771 const upb_MiniTableField field = {17, 18, 70, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
Protobuf Team Bot8c1f6352024-01-10 05:18:15 +00008772 return upb_Message_HasBaseField(UPB_UPCAST(msg), &field);
Joshua Haberman7ecf43f2022-03-14 13:11:29 -07008773}
Mike Kruskal3bc50492022-12-01 13:34:12 -08008774UPB_INLINE void google_protobuf_FileOptions_clear_py_generic_services(google_protobuf_FileOptions* msg) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00008775 const upb_MiniTableField field = {18, 19, 71, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
Protobuf Team Bot4e90ead2024-01-08 15:46:34 +00008776 upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
Joshua Habermand3995ec2022-09-30 16:54:39 -07008777}
Joshua Habermanf41049a2022-01-21 14:41:25 -08008778UPB_INLINE bool google_protobuf_FileOptions_py_generic_services(const google_protobuf_FileOptions* msg) {
Eric Salo8809a112022-11-21 13:01:06 -08008779 bool default_val = false;
8780 bool ret;
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00008781 const upb_MiniTableField field = {18, 19, 71, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +00008782 _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field,
8783 &default_val, &ret);
Eric Salo8809a112022-11-21 13:01:06 -08008784 return ret;
Joshua Habermanf41049a2022-01-21 14:41:25 -08008785}
Mike Kruskal3bc50492022-12-01 13:34:12 -08008786UPB_INLINE bool google_protobuf_FileOptions_has_py_generic_services(const google_protobuf_FileOptions* msg) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00008787 const upb_MiniTableField field = {18, 19, 71, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
Protobuf Team Bot8c1f6352024-01-10 05:18:15 +00008788 return upb_Message_HasBaseField(UPB_UPCAST(msg), &field);
Joshua Haberman7ecf43f2022-03-14 13:11:29 -07008789}
Mike Kruskal3bc50492022-12-01 13:34:12 -08008790UPB_INLINE void google_protobuf_FileOptions_clear_java_generate_equals_and_hash(google_protobuf_FileOptions* msg) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00008791 const upb_MiniTableField field = {20, 20, 72, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
Protobuf Team Bot4e90ead2024-01-08 15:46:34 +00008792 upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
Joshua Habermand3995ec2022-09-30 16:54:39 -07008793}
Joshua Habermanf41049a2022-01-21 14:41:25 -08008794UPB_INLINE bool google_protobuf_FileOptions_java_generate_equals_and_hash(const google_protobuf_FileOptions* msg) {
Eric Salo8809a112022-11-21 13:01:06 -08008795 bool default_val = false;
8796 bool ret;
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00008797 const upb_MiniTableField field = {20, 20, 72, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +00008798 _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field,
8799 &default_val, &ret);
Eric Salo8809a112022-11-21 13:01:06 -08008800 return ret;
Joshua Habermanf41049a2022-01-21 14:41:25 -08008801}
Mike Kruskal3bc50492022-12-01 13:34:12 -08008802UPB_INLINE bool google_protobuf_FileOptions_has_java_generate_equals_and_hash(const google_protobuf_FileOptions* msg) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00008803 const upb_MiniTableField field = {20, 20, 72, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
Protobuf Team Bot8c1f6352024-01-10 05:18:15 +00008804 return upb_Message_HasBaseField(UPB_UPCAST(msg), &field);
Joshua Haberman7ecf43f2022-03-14 13:11:29 -07008805}
Mike Kruskal3bc50492022-12-01 13:34:12 -08008806UPB_INLINE void google_protobuf_FileOptions_clear_deprecated(google_protobuf_FileOptions* msg) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00008807 const upb_MiniTableField field = {23, 21, 73, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
Protobuf Team Bot4e90ead2024-01-08 15:46:34 +00008808 upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
Joshua Habermand3995ec2022-09-30 16:54:39 -07008809}
Joshua Habermanf41049a2022-01-21 14:41:25 -08008810UPB_INLINE bool google_protobuf_FileOptions_deprecated(const google_protobuf_FileOptions* msg) {
Eric Salo8809a112022-11-21 13:01:06 -08008811 bool default_val = false;
8812 bool ret;
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00008813 const upb_MiniTableField field = {23, 21, 73, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +00008814 _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field,
8815 &default_val, &ret);
Eric Salo8809a112022-11-21 13:01:06 -08008816 return ret;
Joshua Habermanf41049a2022-01-21 14:41:25 -08008817}
Mike Kruskal3bc50492022-12-01 13:34:12 -08008818UPB_INLINE bool google_protobuf_FileOptions_has_deprecated(const google_protobuf_FileOptions* msg) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00008819 const upb_MiniTableField field = {23, 21, 73, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
Protobuf Team Bot8c1f6352024-01-10 05:18:15 +00008820 return upb_Message_HasBaseField(UPB_UPCAST(msg), &field);
Joshua Haberman7ecf43f2022-03-14 13:11:29 -07008821}
Mike Kruskal3bc50492022-12-01 13:34:12 -08008822UPB_INLINE void google_protobuf_FileOptions_clear_java_string_check_utf8(google_protobuf_FileOptions* msg) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00008823 const upb_MiniTableField field = {27, 22, 74, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
Protobuf Team Bot4e90ead2024-01-08 15:46:34 +00008824 upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
Joshua Habermand3995ec2022-09-30 16:54:39 -07008825}
Joshua Habermanf41049a2022-01-21 14:41:25 -08008826UPB_INLINE bool google_protobuf_FileOptions_java_string_check_utf8(const google_protobuf_FileOptions* msg) {
Eric Salo8809a112022-11-21 13:01:06 -08008827 bool default_val = false;
8828 bool ret;
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00008829 const upb_MiniTableField field = {27, 22, 74, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +00008830 _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field,
8831 &default_val, &ret);
Eric Salo8809a112022-11-21 13:01:06 -08008832 return ret;
Joshua Habermanf41049a2022-01-21 14:41:25 -08008833}
Mike Kruskal3bc50492022-12-01 13:34:12 -08008834UPB_INLINE bool google_protobuf_FileOptions_has_java_string_check_utf8(const google_protobuf_FileOptions* msg) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00008835 const upb_MiniTableField field = {27, 22, 74, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
Protobuf Team Bot8c1f6352024-01-10 05:18:15 +00008836 return upb_Message_HasBaseField(UPB_UPCAST(msg), &field);
Joshua Haberman7ecf43f2022-03-14 13:11:29 -07008837}
Mike Kruskal3bc50492022-12-01 13:34:12 -08008838UPB_INLINE void google_protobuf_FileOptions_clear_cc_enable_arenas(google_protobuf_FileOptions* msg) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00008839 const upb_MiniTableField field = {31, 23, 75, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
Protobuf Team Bot4e90ead2024-01-08 15:46:34 +00008840 upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
Joshua Habermand3995ec2022-09-30 16:54:39 -07008841}
Joshua Habermanf41049a2022-01-21 14:41:25 -08008842UPB_INLINE bool google_protobuf_FileOptions_cc_enable_arenas(const google_protobuf_FileOptions* msg) {
Eric Salo8809a112022-11-21 13:01:06 -08008843 bool default_val = true;
8844 bool ret;
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00008845 const upb_MiniTableField field = {31, 23, 75, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +00008846 _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field,
8847 &default_val, &ret);
Eric Salo8809a112022-11-21 13:01:06 -08008848 return ret;
Joshua Habermanf41049a2022-01-21 14:41:25 -08008849}
Mike Kruskal3bc50492022-12-01 13:34:12 -08008850UPB_INLINE bool google_protobuf_FileOptions_has_cc_enable_arenas(const google_protobuf_FileOptions* msg) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00008851 const upb_MiniTableField field = {31, 23, 75, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
Protobuf Team Bot8c1f6352024-01-10 05:18:15 +00008852 return upb_Message_HasBaseField(UPB_UPCAST(msg), &field);
Joshua Haberman7ecf43f2022-03-14 13:11:29 -07008853}
Mike Kruskal3bc50492022-12-01 13:34:12 -08008854UPB_INLINE void google_protobuf_FileOptions_clear_objc_class_prefix(google_protobuf_FileOptions* msg) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00008855 const upb_MiniTableField field = {36, UPB_SIZE(56, 72), 76, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
Protobuf Team Bot4e90ead2024-01-08 15:46:34 +00008856 upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
Joshua Habermand3995ec2022-09-30 16:54:39 -07008857}
Joshua Habermanf41049a2022-01-21 14:41:25 -08008858UPB_INLINE upb_StringView google_protobuf_FileOptions_objc_class_prefix(const google_protobuf_FileOptions* msg) {
Eric Salo8809a112022-11-21 13:01:06 -08008859 upb_StringView default_val = upb_StringView_FromString("");
8860 upb_StringView ret;
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00008861 const upb_MiniTableField field = {36, UPB_SIZE(56, 72), 76, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +00008862 _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field,
8863 &default_val, &ret);
Eric Salo8809a112022-11-21 13:01:06 -08008864 return ret;
Joshua Habermanf41049a2022-01-21 14:41:25 -08008865}
Mike Kruskal3bc50492022-12-01 13:34:12 -08008866UPB_INLINE bool google_protobuf_FileOptions_has_objc_class_prefix(const google_protobuf_FileOptions* msg) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00008867 const upb_MiniTableField field = {36, UPB_SIZE(56, 72), 76, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
Protobuf Team Bot8c1f6352024-01-10 05:18:15 +00008868 return upb_Message_HasBaseField(UPB_UPCAST(msg), &field);
Joshua Haberman7ecf43f2022-03-14 13:11:29 -07008869}
Mike Kruskal3bc50492022-12-01 13:34:12 -08008870UPB_INLINE void google_protobuf_FileOptions_clear_csharp_namespace(google_protobuf_FileOptions* msg) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00008871 const upb_MiniTableField field = {37, UPB_SIZE(64, 88), 77, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
Protobuf Team Bot4e90ead2024-01-08 15:46:34 +00008872 upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
Joshua Habermand3995ec2022-09-30 16:54:39 -07008873}
Joshua Habermanf41049a2022-01-21 14:41:25 -08008874UPB_INLINE upb_StringView google_protobuf_FileOptions_csharp_namespace(const google_protobuf_FileOptions* msg) {
Eric Salo8809a112022-11-21 13:01:06 -08008875 upb_StringView default_val = upb_StringView_FromString("");
8876 upb_StringView ret;
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00008877 const upb_MiniTableField field = {37, UPB_SIZE(64, 88), 77, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +00008878 _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field,
8879 &default_val, &ret);
Eric Salo8809a112022-11-21 13:01:06 -08008880 return ret;
Joshua Habermanf41049a2022-01-21 14:41:25 -08008881}
Mike Kruskal3bc50492022-12-01 13:34:12 -08008882UPB_INLINE bool google_protobuf_FileOptions_has_csharp_namespace(const google_protobuf_FileOptions* msg) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00008883 const upb_MiniTableField field = {37, UPB_SIZE(64, 88), 77, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
Protobuf Team Bot8c1f6352024-01-10 05:18:15 +00008884 return upb_Message_HasBaseField(UPB_UPCAST(msg), &field);
Joshua Haberman7ecf43f2022-03-14 13:11:29 -07008885}
Mike Kruskal3bc50492022-12-01 13:34:12 -08008886UPB_INLINE void google_protobuf_FileOptions_clear_swift_prefix(google_protobuf_FileOptions* msg) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00008887 const upb_MiniTableField field = {39, UPB_SIZE(72, 104), 78, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
Protobuf Team Bot4e90ead2024-01-08 15:46:34 +00008888 upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
Joshua Habermand3995ec2022-09-30 16:54:39 -07008889}
Joshua Habermanf41049a2022-01-21 14:41:25 -08008890UPB_INLINE upb_StringView google_protobuf_FileOptions_swift_prefix(const google_protobuf_FileOptions* msg) {
Eric Salo8809a112022-11-21 13:01:06 -08008891 upb_StringView default_val = upb_StringView_FromString("");
8892 upb_StringView ret;
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00008893 const upb_MiniTableField field = {39, UPB_SIZE(72, 104), 78, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +00008894 _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field,
8895 &default_val, &ret);
Eric Salo8809a112022-11-21 13:01:06 -08008896 return ret;
Joshua Habermanf41049a2022-01-21 14:41:25 -08008897}
Mike Kruskal3bc50492022-12-01 13:34:12 -08008898UPB_INLINE bool google_protobuf_FileOptions_has_swift_prefix(const google_protobuf_FileOptions* msg) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00008899 const upb_MiniTableField field = {39, UPB_SIZE(72, 104), 78, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
Protobuf Team Bot8c1f6352024-01-10 05:18:15 +00008900 return upb_Message_HasBaseField(UPB_UPCAST(msg), &field);
Joshua Haberman7ecf43f2022-03-14 13:11:29 -07008901}
Mike Kruskal3bc50492022-12-01 13:34:12 -08008902UPB_INLINE void google_protobuf_FileOptions_clear_php_class_prefix(google_protobuf_FileOptions* msg) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00008903 const upb_MiniTableField field = {40, UPB_SIZE(80, 120), 79, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
Protobuf Team Bot4e90ead2024-01-08 15:46:34 +00008904 upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
Joshua Habermand3995ec2022-09-30 16:54:39 -07008905}
Joshua Habermanf41049a2022-01-21 14:41:25 -08008906UPB_INLINE upb_StringView google_protobuf_FileOptions_php_class_prefix(const google_protobuf_FileOptions* msg) {
Eric Salo8809a112022-11-21 13:01:06 -08008907 upb_StringView default_val = upb_StringView_FromString("");
8908 upb_StringView ret;
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00008909 const upb_MiniTableField field = {40, UPB_SIZE(80, 120), 79, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +00008910 _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field,
8911 &default_val, &ret);
Eric Salo8809a112022-11-21 13:01:06 -08008912 return ret;
Joshua Habermanf41049a2022-01-21 14:41:25 -08008913}
Mike Kruskal3bc50492022-12-01 13:34:12 -08008914UPB_INLINE bool google_protobuf_FileOptions_has_php_class_prefix(const google_protobuf_FileOptions* msg) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00008915 const upb_MiniTableField field = {40, UPB_SIZE(80, 120), 79, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
Protobuf Team Bot8c1f6352024-01-10 05:18:15 +00008916 return upb_Message_HasBaseField(UPB_UPCAST(msg), &field);
Joshua Haberman7ecf43f2022-03-14 13:11:29 -07008917}
Mike Kruskal3bc50492022-12-01 13:34:12 -08008918UPB_INLINE void google_protobuf_FileOptions_clear_php_namespace(google_protobuf_FileOptions* msg) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00008919 const upb_MiniTableField field = {41, UPB_SIZE(88, 136), 80, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
Protobuf Team Bot4e90ead2024-01-08 15:46:34 +00008920 upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
Joshua Habermand3995ec2022-09-30 16:54:39 -07008921}
Joshua Habermanf41049a2022-01-21 14:41:25 -08008922UPB_INLINE upb_StringView google_protobuf_FileOptions_php_namespace(const google_protobuf_FileOptions* msg) {
Eric Salo8809a112022-11-21 13:01:06 -08008923 upb_StringView default_val = upb_StringView_FromString("");
8924 upb_StringView ret;
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00008925 const upb_MiniTableField field = {41, UPB_SIZE(88, 136), 80, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +00008926 _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field,
8927 &default_val, &ret);
Eric Salo8809a112022-11-21 13:01:06 -08008928 return ret;
Joshua Habermanf41049a2022-01-21 14:41:25 -08008929}
Mike Kruskal3bc50492022-12-01 13:34:12 -08008930UPB_INLINE bool google_protobuf_FileOptions_has_php_namespace(const google_protobuf_FileOptions* msg) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00008931 const upb_MiniTableField field = {41, UPB_SIZE(88, 136), 80, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
Protobuf Team Bot8c1f6352024-01-10 05:18:15 +00008932 return upb_Message_HasBaseField(UPB_UPCAST(msg), &field);
Joshua Haberman7ecf43f2022-03-14 13:11:29 -07008933}
Mike Kruskal3bc50492022-12-01 13:34:12 -08008934UPB_INLINE void google_protobuf_FileOptions_clear_php_metadata_namespace(google_protobuf_FileOptions* msg) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00008935 const upb_MiniTableField field = {44, UPB_SIZE(96, 152), 81, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
Protobuf Team Bot4e90ead2024-01-08 15:46:34 +00008936 upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
Joshua Habermand3995ec2022-09-30 16:54:39 -07008937}
Joshua Habermanf41049a2022-01-21 14:41:25 -08008938UPB_INLINE upb_StringView google_protobuf_FileOptions_php_metadata_namespace(const google_protobuf_FileOptions* msg) {
Eric Salo8809a112022-11-21 13:01:06 -08008939 upb_StringView default_val = upb_StringView_FromString("");
8940 upb_StringView ret;
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00008941 const upb_MiniTableField field = {44, UPB_SIZE(96, 152), 81, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +00008942 _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field,
8943 &default_val, &ret);
Eric Salo8809a112022-11-21 13:01:06 -08008944 return ret;
Joshua Habermanf41049a2022-01-21 14:41:25 -08008945}
Mike Kruskal3bc50492022-12-01 13:34:12 -08008946UPB_INLINE bool google_protobuf_FileOptions_has_php_metadata_namespace(const google_protobuf_FileOptions* msg) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00008947 const upb_MiniTableField field = {44, UPB_SIZE(96, 152), 81, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
Protobuf Team Bot8c1f6352024-01-10 05:18:15 +00008948 return upb_Message_HasBaseField(UPB_UPCAST(msg), &field);
Joshua Haberman7ecf43f2022-03-14 13:11:29 -07008949}
Mike Kruskal3bc50492022-12-01 13:34:12 -08008950UPB_INLINE void google_protobuf_FileOptions_clear_ruby_package(google_protobuf_FileOptions* msg) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00008951 const upb_MiniTableField field = {45, UPB_SIZE(104, 168), 82, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
Protobuf Team Bot4e90ead2024-01-08 15:46:34 +00008952 upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
Joshua Habermand3995ec2022-09-30 16:54:39 -07008953}
Joshua Habermanf41049a2022-01-21 14:41:25 -08008954UPB_INLINE upb_StringView google_protobuf_FileOptions_ruby_package(const google_protobuf_FileOptions* msg) {
Eric Salo8809a112022-11-21 13:01:06 -08008955 upb_StringView default_val = upb_StringView_FromString("");
8956 upb_StringView ret;
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00008957 const upb_MiniTableField field = {45, UPB_SIZE(104, 168), 82, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +00008958 _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field,
8959 &default_val, &ret);
Eric Salo8809a112022-11-21 13:01:06 -08008960 return ret;
Joshua Habermanf41049a2022-01-21 14:41:25 -08008961}
Mike Kruskal3bc50492022-12-01 13:34:12 -08008962UPB_INLINE bool google_protobuf_FileOptions_has_ruby_package(const google_protobuf_FileOptions* msg) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00008963 const upb_MiniTableField field = {45, UPB_SIZE(104, 168), 82, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
Protobuf Team Bot8c1f6352024-01-10 05:18:15 +00008964 return upb_Message_HasBaseField(UPB_UPCAST(msg), &field);
Mike Kruskal4f9e4172023-06-30 20:14:50 -07008965}
8966UPB_INLINE void google_protobuf_FileOptions_clear_features(google_protobuf_FileOptions* msg) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00008967 const upb_MiniTableField field = {50, UPB_SIZE(24, 184), 83, 0, 11, (int)kUpb_FieldMode_Scalar | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
Protobuf Team Bot4e90ead2024-01-08 15:46:34 +00008968 upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
Mike Kruskal4f9e4172023-06-30 20:14:50 -07008969}
8970UPB_INLINE const google_protobuf_FeatureSet* google_protobuf_FileOptions_features(const google_protobuf_FileOptions* msg) {
8971 const google_protobuf_FeatureSet* default_val = NULL;
8972 const google_protobuf_FeatureSet* ret;
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00008973 const upb_MiniTableField field = {50, UPB_SIZE(24, 184), 83, 0, 11, (int)kUpb_FieldMode_Scalar | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
Protobuf Team Bota9387b52024-06-12 15:17:52 +00008974 UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__FeatureSet_msg_init);
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +00008975 _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field,
8976 &default_val, &ret);
Mike Kruskal4f9e4172023-06-30 20:14:50 -07008977 return ret;
8978}
8979UPB_INLINE bool google_protobuf_FileOptions_has_features(const google_protobuf_FileOptions* msg) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00008980 const upb_MiniTableField field = {50, UPB_SIZE(24, 184), 83, 0, 11, (int)kUpb_FieldMode_Scalar | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
Protobuf Team Bot8c1f6352024-01-10 05:18:15 +00008981 return upb_Message_HasBaseField(UPB_UPCAST(msg), &field);
Joshua Haberman7ecf43f2022-03-14 13:11:29 -07008982}
Mike Kruskal3bc50492022-12-01 13:34:12 -08008983UPB_INLINE void google_protobuf_FileOptions_clear_uninterpreted_option(google_protobuf_FileOptions* msg) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00008984 const upb_MiniTableField field = {999, UPB_SIZE(28, 192), 0, 1, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
Protobuf Team Bot4e90ead2024-01-08 15:46:34 +00008985 upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
Joshua Habermand3995ec2022-09-30 16:54:39 -07008986}
Eric Salob7d54ac2022-12-29 11:59:42 -08008987UPB_INLINE const google_protobuf_UninterpretedOption* const* google_protobuf_FileOptions_uninterpreted_option(const google_protobuf_FileOptions* msg, size_t* size) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00008988 const upb_MiniTableField field = {999, UPB_SIZE(28, 192), 0, 1, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
Protobuf Team Bota9387b52024-06-12 15:17:52 +00008989 UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__UninterpretedOption_msg_init);
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +00008990 const upb_Array* arr = upb_Message_GetArray(UPB_UPCAST(msg), &field);
Eric Salob7d54ac2022-12-29 11:59:42 -08008991 if (arr) {
Protobuf Team Botf73985a2023-12-19 00:14:19 +00008992 if (size) *size = arr->UPB_PRIVATE(size);
Protobuf Team Bot81e54332024-01-11 21:04:07 +00008993 return (const google_protobuf_UninterpretedOption* const*)upb_Array_DataPtr(arr);
Eric Salob7d54ac2022-12-29 11:59:42 -08008994 } else {
8995 if (size) *size = 0;
8996 return NULL;
8997 }
Joshua Haberman7ecf43f2022-03-14 13:11:29 -07008998}
Deanna Garciab26afb52023-04-25 13:37:18 -07008999UPB_INLINE const upb_Array* _google_protobuf_FileOptions_uninterpreted_option_upb_array(const google_protobuf_FileOptions* msg, size_t* size) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00009000 const upb_MiniTableField field = {999, UPB_SIZE(28, 192), 0, 1, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
Protobuf Team Bota9387b52024-06-12 15:17:52 +00009001 UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__UninterpretedOption_msg_init);
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +00009002 const upb_Array* arr = upb_Message_GetArray(UPB_UPCAST(msg), &field);
Deanna Garciab26afb52023-04-25 13:37:18 -07009003 if (size) {
Protobuf Team Botf73985a2023-12-19 00:14:19 +00009004 *size = arr ? arr->UPB_PRIVATE(size) : 0;
Deanna Garciab26afb52023-04-25 13:37:18 -07009005 }
9006 return arr;
9007}
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +00009008UPB_INLINE upb_Array* _google_protobuf_FileOptions_uninterpreted_option_mutable_upb_array(google_protobuf_FileOptions* msg, size_t* size, upb_Arena* arena) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00009009 const upb_MiniTableField field = {999, UPB_SIZE(28, 192), 0, 1, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
Protobuf Team Bota9387b52024-06-12 15:17:52 +00009010 UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__UninterpretedOption_msg_init);
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +00009011 upb_Array* arr = upb_Message_GetOrCreateMutableArray(UPB_UPCAST(msg),
9012 &field, arena);
Deanna Garciab26afb52023-04-25 13:37:18 -07009013 if (size) {
Protobuf Team Botf73985a2023-12-19 00:14:19 +00009014 *size = arr ? arr->UPB_PRIVATE(size) : 0;
Deanna Garciab26afb52023-04-25 13:37:18 -07009015 }
9016 return arr;
9017}
Joshua Haberman9abf6e22021-01-13 12:16:25 -08009018
Joshua Habermanf41049a2022-01-21 14:41:25 -08009019UPB_INLINE void google_protobuf_FileOptions_set_java_package(google_protobuf_FileOptions *msg, upb_StringView value) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00009020 const upb_MiniTableField field = {1, UPB_SIZE(32, 24), 64, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
Protobuf Team Botac32c972024-04-10 03:30:05 +00009021 upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
Mike Kruskal232ecf42023-01-14 00:09:40 -08009022}
9023UPB_INLINE void google_protobuf_FileOptions_set_java_outer_classname(google_protobuf_FileOptions *msg, upb_StringView value) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00009024 const upb_MiniTableField field = {8, 40, 65, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
Protobuf Team Botac32c972024-04-10 03:30:05 +00009025 upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
Mike Kruskal232ecf42023-01-14 00:09:40 -08009026}
9027UPB_INLINE void google_protobuf_FileOptions_set_optimize_for(google_protobuf_FileOptions *msg, int32_t value) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00009028 const upb_MiniTableField field = {9, 12, 66, 2, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
Protobuf Team Botac32c972024-04-10 03:30:05 +00009029 upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
Mike Kruskal232ecf42023-01-14 00:09:40 -08009030}
9031UPB_INLINE void google_protobuf_FileOptions_set_java_multiple_files(google_protobuf_FileOptions *msg, bool value) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00009032 const upb_MiniTableField field = {10, 16, 67, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
Protobuf Team Botac32c972024-04-10 03:30:05 +00009033 upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
Mike Kruskal232ecf42023-01-14 00:09:40 -08009034}
9035UPB_INLINE void google_protobuf_FileOptions_set_go_package(google_protobuf_FileOptions *msg, upb_StringView value) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00009036 const upb_MiniTableField field = {11, UPB_SIZE(48, 56), 68, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
Protobuf Team Botac32c972024-04-10 03:30:05 +00009037 upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
Mike Kruskal232ecf42023-01-14 00:09:40 -08009038}
9039UPB_INLINE void google_protobuf_FileOptions_set_cc_generic_services(google_protobuf_FileOptions *msg, bool value) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00009040 const upb_MiniTableField field = {16, 17, 69, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
Protobuf Team Botac32c972024-04-10 03:30:05 +00009041 upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
Mike Kruskal232ecf42023-01-14 00:09:40 -08009042}
9043UPB_INLINE void google_protobuf_FileOptions_set_java_generic_services(google_protobuf_FileOptions *msg, bool value) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00009044 const upb_MiniTableField field = {17, 18, 70, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
Protobuf Team Botac32c972024-04-10 03:30:05 +00009045 upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
Mike Kruskal232ecf42023-01-14 00:09:40 -08009046}
9047UPB_INLINE void google_protobuf_FileOptions_set_py_generic_services(google_protobuf_FileOptions *msg, bool value) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00009048 const upb_MiniTableField field = {18, 19, 71, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
Protobuf Team Botac32c972024-04-10 03:30:05 +00009049 upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
Mike Kruskal232ecf42023-01-14 00:09:40 -08009050}
9051UPB_INLINE void google_protobuf_FileOptions_set_java_generate_equals_and_hash(google_protobuf_FileOptions *msg, bool value) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00009052 const upb_MiniTableField field = {20, 20, 72, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
Protobuf Team Botac32c972024-04-10 03:30:05 +00009053 upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
Mike Kruskal232ecf42023-01-14 00:09:40 -08009054}
9055UPB_INLINE void google_protobuf_FileOptions_set_deprecated(google_protobuf_FileOptions *msg, bool value) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00009056 const upb_MiniTableField field = {23, 21, 73, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
Protobuf Team Botac32c972024-04-10 03:30:05 +00009057 upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
Mike Kruskal232ecf42023-01-14 00:09:40 -08009058}
9059UPB_INLINE void google_protobuf_FileOptions_set_java_string_check_utf8(google_protobuf_FileOptions *msg, bool value) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00009060 const upb_MiniTableField field = {27, 22, 74, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
Protobuf Team Botac32c972024-04-10 03:30:05 +00009061 upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
Mike Kruskal232ecf42023-01-14 00:09:40 -08009062}
9063UPB_INLINE void google_protobuf_FileOptions_set_cc_enable_arenas(google_protobuf_FileOptions *msg, bool value) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00009064 const upb_MiniTableField field = {31, 23, 75, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
Protobuf Team Botac32c972024-04-10 03:30:05 +00009065 upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
Mike Kruskal232ecf42023-01-14 00:09:40 -08009066}
9067UPB_INLINE void google_protobuf_FileOptions_set_objc_class_prefix(google_protobuf_FileOptions *msg, upb_StringView value) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00009068 const upb_MiniTableField field = {36, UPB_SIZE(56, 72), 76, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
Protobuf Team Botac32c972024-04-10 03:30:05 +00009069 upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
Mike Kruskal232ecf42023-01-14 00:09:40 -08009070}
9071UPB_INLINE void google_protobuf_FileOptions_set_csharp_namespace(google_protobuf_FileOptions *msg, upb_StringView value) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00009072 const upb_MiniTableField field = {37, UPB_SIZE(64, 88), 77, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
Protobuf Team Botac32c972024-04-10 03:30:05 +00009073 upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
Mike Kruskal232ecf42023-01-14 00:09:40 -08009074}
9075UPB_INLINE void google_protobuf_FileOptions_set_swift_prefix(google_protobuf_FileOptions *msg, upb_StringView value) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00009076 const upb_MiniTableField field = {39, UPB_SIZE(72, 104), 78, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
Protobuf Team Botac32c972024-04-10 03:30:05 +00009077 upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
Mike Kruskal232ecf42023-01-14 00:09:40 -08009078}
9079UPB_INLINE void google_protobuf_FileOptions_set_php_class_prefix(google_protobuf_FileOptions *msg, upb_StringView value) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00009080 const upb_MiniTableField field = {40, UPB_SIZE(80, 120), 79, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
Protobuf Team Botac32c972024-04-10 03:30:05 +00009081 upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
Mike Kruskal232ecf42023-01-14 00:09:40 -08009082}
9083UPB_INLINE void google_protobuf_FileOptions_set_php_namespace(google_protobuf_FileOptions *msg, upb_StringView value) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00009084 const upb_MiniTableField field = {41, UPB_SIZE(88, 136), 80, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
Protobuf Team Botac32c972024-04-10 03:30:05 +00009085 upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
Mike Kruskal232ecf42023-01-14 00:09:40 -08009086}
9087UPB_INLINE void google_protobuf_FileOptions_set_php_metadata_namespace(google_protobuf_FileOptions *msg, upb_StringView value) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00009088 const upb_MiniTableField field = {44, UPB_SIZE(96, 152), 81, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
Protobuf Team Botac32c972024-04-10 03:30:05 +00009089 upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
Mike Kruskal232ecf42023-01-14 00:09:40 -08009090}
9091UPB_INLINE void google_protobuf_FileOptions_set_ruby_package(google_protobuf_FileOptions *msg, upb_StringView value) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00009092 const upb_MiniTableField field = {45, UPB_SIZE(104, 168), 82, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
Protobuf Team Botac32c972024-04-10 03:30:05 +00009093 upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
Mike Kruskal232ecf42023-01-14 00:09:40 -08009094}
Mike Kruskal4f9e4172023-06-30 20:14:50 -07009095UPB_INLINE void google_protobuf_FileOptions_set_features(google_protobuf_FileOptions *msg, google_protobuf_FeatureSet* value) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00009096 const upb_MiniTableField field = {50, UPB_SIZE(24, 184), 83, 0, 11, (int)kUpb_FieldMode_Scalar | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
Protobuf Team Bota9387b52024-06-12 15:17:52 +00009097 UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__FeatureSet_msg_init);
Protobuf Team Botac32c972024-04-10 03:30:05 +00009098 upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
Mike Kruskal4f9e4172023-06-30 20:14:50 -07009099}
9100UPB_INLINE struct google_protobuf_FeatureSet* google_protobuf_FileOptions_mutable_features(google_protobuf_FileOptions* msg, upb_Arena* arena) {
9101 struct google_protobuf_FeatureSet* sub = (struct google_protobuf_FeatureSet*)google_protobuf_FileOptions_features(msg);
9102 if (sub == NULL) {
Protobuf Team Bot4ffe0862023-12-06 02:02:36 +00009103 sub = (struct google_protobuf_FeatureSet*)_upb_Message_New(&google__protobuf__FeatureSet_msg_init, arena);
Mike Kruskal4f9e4172023-06-30 20:14:50 -07009104 if (sub) google_protobuf_FileOptions_set_features(msg, sub);
9105 }
9106 return sub;
9107}
Mike Kruskal232ecf42023-01-14 00:09:40 -08009108UPB_INLINE google_protobuf_UninterpretedOption** google_protobuf_FileOptions_mutable_uninterpreted_option(google_protobuf_FileOptions* msg, size_t* size) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00009109 upb_MiniTableField field = {999, UPB_SIZE(28, 192), 0, 1, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
Protobuf Team Bota9387b52024-06-12 15:17:52 +00009110 UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__UninterpretedOption_msg_init);
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +00009111 upb_Array* arr = upb_Message_GetMutableArray(UPB_UPCAST(msg), &field);
Eric Salob7d54ac2022-12-29 11:59:42 -08009112 if (arr) {
Protobuf Team Botf73985a2023-12-19 00:14:19 +00009113 if (size) *size = arr->UPB_PRIVATE(size);
Protobuf Team Bot81e54332024-01-11 21:04:07 +00009114 return (google_protobuf_UninterpretedOption**)upb_Array_MutableDataPtr(arr);
Eric Salob7d54ac2022-12-29 11:59:42 -08009115 } else {
9116 if (size) *size = 0;
9117 return NULL;
9118 }
Joshua Haberman9abf6e22021-01-13 12:16:25 -08009119}
Eric Salob7d54ac2022-12-29 11:59:42 -08009120UPB_INLINE google_protobuf_UninterpretedOption** google_protobuf_FileOptions_resize_uninterpreted_option(google_protobuf_FileOptions* msg, size_t size, upb_Arena* arena) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00009121 upb_MiniTableField field = {999, UPB_SIZE(28, 192), 0, 1, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +00009122 return (google_protobuf_UninterpretedOption**)upb_Message_ResizeArrayUninitialized(UPB_UPCAST(msg),
9123 &field, size, arena);
Joshua Haberman9abf6e22021-01-13 12:16:25 -08009124}
Joshua Haberman7ecf43f2022-03-14 13:11:29 -07009125UPB_INLINE struct google_protobuf_UninterpretedOption* google_protobuf_FileOptions_add_uninterpreted_option(google_protobuf_FileOptions* msg, upb_Arena* arena) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00009126 upb_MiniTableField field = {999, UPB_SIZE(28, 192), 0, 1, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
Protobuf Team Bota9387b52024-06-12 15:17:52 +00009127 UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__UninterpretedOption_msg_init);
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +00009128 upb_Array* arr = upb_Message_GetOrCreateMutableArray(
9129 UPB_UPCAST(msg), &field, arena);
Protobuf Team Bot81e54332024-01-11 21:04:07 +00009130 if (!arr || !UPB_PRIVATE(_upb_Array_ResizeUninitialized)(
Protobuf Team Botf73985a2023-12-19 00:14:19 +00009131 arr, arr->UPB_PRIVATE(size) + 1, arena)) {
Eric Salob7d54ac2022-12-29 11:59:42 -08009132 return NULL;
9133 }
Protobuf Team Bot4ffe0862023-12-06 02:02:36 +00009134 struct google_protobuf_UninterpretedOption* sub = (struct google_protobuf_UninterpretedOption*)_upb_Message_New(&google__protobuf__UninterpretedOption_msg_init, arena);
Eric Salob7d54ac2022-12-29 11:59:42 -08009135 if (!arr || !sub) return NULL;
Protobuf Team Botf73985a2023-12-19 00:14:19 +00009136 UPB_PRIVATE(_upb_Array_Set)
9137 (arr, arr->UPB_PRIVATE(size) - 1, &sub, sizeof(sub));
Joshua Haberman9abf6e22021-01-13 12:16:25 -08009138 return sub;
9139}
9140
9141/* google.protobuf.MessageOptions */
9142
Joshua Habermanf41049a2022-01-21 14:41:25 -08009143UPB_INLINE google_protobuf_MessageOptions* google_protobuf_MessageOptions_new(upb_Arena* arena) {
Protobuf Team Bot4ffe0862023-12-06 02:02:36 +00009144 return (google_protobuf_MessageOptions*)_upb_Message_New(&google__protobuf__MessageOptions_msg_init, arena);
Joshua Haberman9abf6e22021-01-13 12:16:25 -08009145}
Joshua Habermanf41049a2022-01-21 14:41:25 -08009146UPB_INLINE google_protobuf_MessageOptions* google_protobuf_MessageOptions_parse(const char* buf, size_t size, upb_Arena* arena) {
9147 google_protobuf_MessageOptions* ret = google_protobuf_MessageOptions_new(arena);
Joshua Haberman9d578a32021-08-02 15:32:01 -07009148 if (!ret) return NULL;
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +00009149 if (upb_Decode(buf, size, UPB_UPCAST(ret), &google__protobuf__MessageOptions_msg_init, NULL, 0, arena) !=
9150 kUpb_DecodeStatus_Ok) {
Joshua Haberman9d578a32021-08-02 15:32:01 -07009151 return NULL;
9152 }
9153 return ret;
Joshua Haberman9abf6e22021-01-13 12:16:25 -08009154}
Joshua Habermanf41049a2022-01-21 14:41:25 -08009155UPB_INLINE google_protobuf_MessageOptions* google_protobuf_MessageOptions_parse_ex(const char* buf, size_t size,
9156 const upb_ExtensionRegistry* extreg,
9157 int options, upb_Arena* arena) {
9158 google_protobuf_MessageOptions* ret = google_protobuf_MessageOptions_new(arena);
9159 if (!ret) return NULL;
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +00009160 if (upb_Decode(buf, size, UPB_UPCAST(ret), &google__protobuf__MessageOptions_msg_init, extreg, options,
9161 arena) != kUpb_DecodeStatus_Ok) {
Joshua Habermanf41049a2022-01-21 14:41:25 -08009162 return NULL;
9163 }
9164 return ret;
Joshua Haberman9abf6e22021-01-13 12:16:25 -08009165}
Joshua Habermanf41049a2022-01-21 14:41:25 -08009166UPB_INLINE char* google_protobuf_MessageOptions_serialize(const google_protobuf_MessageOptions* msg, upb_Arena* arena, size_t* len) {
Joshua Habermand3995ec2022-09-30 16:54:39 -07009167 char* ptr;
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +00009168 (void)upb_Encode(UPB_UPCAST(msg), &google__protobuf__MessageOptions_msg_init, 0, arena, &ptr, len);
Joshua Habermand3995ec2022-09-30 16:54:39 -07009169 return ptr;
Joshua Habermanf41049a2022-01-21 14:41:25 -08009170}
9171UPB_INLINE char* google_protobuf_MessageOptions_serialize_ex(const google_protobuf_MessageOptions* msg, int options,
9172 upb_Arena* arena, size_t* len) {
Joshua Habermand3995ec2022-09-30 16:54:39 -07009173 char* ptr;
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +00009174 (void)upb_Encode(UPB_UPCAST(msg), &google__protobuf__MessageOptions_msg_init, options, arena, &ptr, len);
Joshua Habermand3995ec2022-09-30 16:54:39 -07009175 return ptr;
Joshua Habermanf41049a2022-01-21 14:41:25 -08009176}
Mike Kruskal3bc50492022-12-01 13:34:12 -08009177UPB_INLINE void google_protobuf_MessageOptions_clear_message_set_wire_format(google_protobuf_MessageOptions* msg) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00009178 const upb_MiniTableField field = {1, 9, 64, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
Protobuf Team Bot4e90ead2024-01-08 15:46:34 +00009179 upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
Joshua Habermand3995ec2022-09-30 16:54:39 -07009180}
Joshua Habermanf41049a2022-01-21 14:41:25 -08009181UPB_INLINE bool google_protobuf_MessageOptions_message_set_wire_format(const google_protobuf_MessageOptions* msg) {
Eric Salo8809a112022-11-21 13:01:06 -08009182 bool default_val = false;
9183 bool ret;
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00009184 const upb_MiniTableField field = {1, 9, 64, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +00009185 _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field,
9186 &default_val, &ret);
Eric Salo8809a112022-11-21 13:01:06 -08009187 return ret;
Joshua Habermanf41049a2022-01-21 14:41:25 -08009188}
Mike Kruskal3bc50492022-12-01 13:34:12 -08009189UPB_INLINE bool google_protobuf_MessageOptions_has_message_set_wire_format(const google_protobuf_MessageOptions* msg) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00009190 const upb_MiniTableField field = {1, 9, 64, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
Protobuf Team Bot8c1f6352024-01-10 05:18:15 +00009191 return upb_Message_HasBaseField(UPB_UPCAST(msg), &field);
Joshua Haberman7ecf43f2022-03-14 13:11:29 -07009192}
Mike Kruskal3bc50492022-12-01 13:34:12 -08009193UPB_INLINE void google_protobuf_MessageOptions_clear_no_standard_descriptor_accessor(google_protobuf_MessageOptions* msg) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00009194 const upb_MiniTableField field = {2, 10, 65, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
Protobuf Team Bot4e90ead2024-01-08 15:46:34 +00009195 upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
Joshua Habermand3995ec2022-09-30 16:54:39 -07009196}
Joshua Habermanf41049a2022-01-21 14:41:25 -08009197UPB_INLINE bool google_protobuf_MessageOptions_no_standard_descriptor_accessor(const google_protobuf_MessageOptions* msg) {
Eric Salo8809a112022-11-21 13:01:06 -08009198 bool default_val = false;
9199 bool ret;
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00009200 const upb_MiniTableField field = {2, 10, 65, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +00009201 _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field,
9202 &default_val, &ret);
Eric Salo8809a112022-11-21 13:01:06 -08009203 return ret;
Joshua Habermanf41049a2022-01-21 14:41:25 -08009204}
Mike Kruskal3bc50492022-12-01 13:34:12 -08009205UPB_INLINE bool google_protobuf_MessageOptions_has_no_standard_descriptor_accessor(const google_protobuf_MessageOptions* msg) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00009206 const upb_MiniTableField field = {2, 10, 65, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
Protobuf Team Bot8c1f6352024-01-10 05:18:15 +00009207 return upb_Message_HasBaseField(UPB_UPCAST(msg), &field);
Joshua Haberman7ecf43f2022-03-14 13:11:29 -07009208}
Mike Kruskal3bc50492022-12-01 13:34:12 -08009209UPB_INLINE void google_protobuf_MessageOptions_clear_deprecated(google_protobuf_MessageOptions* msg) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00009210 const upb_MiniTableField field = {3, 11, 66, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
Protobuf Team Bot4e90ead2024-01-08 15:46:34 +00009211 upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
Joshua Habermand3995ec2022-09-30 16:54:39 -07009212}
Joshua Habermanf41049a2022-01-21 14:41:25 -08009213UPB_INLINE bool google_protobuf_MessageOptions_deprecated(const google_protobuf_MessageOptions* msg) {
Eric Salo8809a112022-11-21 13:01:06 -08009214 bool default_val = false;
9215 bool ret;
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00009216 const upb_MiniTableField field = {3, 11, 66, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +00009217 _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field,
9218 &default_val, &ret);
Eric Salo8809a112022-11-21 13:01:06 -08009219 return ret;
Joshua Habermanf41049a2022-01-21 14:41:25 -08009220}
Mike Kruskal3bc50492022-12-01 13:34:12 -08009221UPB_INLINE bool google_protobuf_MessageOptions_has_deprecated(const google_protobuf_MessageOptions* msg) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00009222 const upb_MiniTableField field = {3, 11, 66, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
Protobuf Team Bot8c1f6352024-01-10 05:18:15 +00009223 return upb_Message_HasBaseField(UPB_UPCAST(msg), &field);
Joshua Haberman7ecf43f2022-03-14 13:11:29 -07009224}
Mike Kruskal3bc50492022-12-01 13:34:12 -08009225UPB_INLINE void google_protobuf_MessageOptions_clear_map_entry(google_protobuf_MessageOptions* msg) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00009226 const upb_MiniTableField field = {7, 12, 67, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
Protobuf Team Bot4e90ead2024-01-08 15:46:34 +00009227 upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
Joshua Habermand3995ec2022-09-30 16:54:39 -07009228}
Joshua Habermanf41049a2022-01-21 14:41:25 -08009229UPB_INLINE bool google_protobuf_MessageOptions_map_entry(const google_protobuf_MessageOptions* msg) {
Eric Salo8809a112022-11-21 13:01:06 -08009230 bool default_val = false;
9231 bool ret;
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00009232 const upb_MiniTableField field = {7, 12, 67, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +00009233 _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field,
9234 &default_val, &ret);
Eric Salo8809a112022-11-21 13:01:06 -08009235 return ret;
Joshua Habermanf41049a2022-01-21 14:41:25 -08009236}
Mike Kruskal3bc50492022-12-01 13:34:12 -08009237UPB_INLINE bool google_protobuf_MessageOptions_has_map_entry(const google_protobuf_MessageOptions* msg) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00009238 const upb_MiniTableField field = {7, 12, 67, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
Protobuf Team Bot8c1f6352024-01-10 05:18:15 +00009239 return upb_Message_HasBaseField(UPB_UPCAST(msg), &field);
Joshua Haberman7ecf43f2022-03-14 13:11:29 -07009240}
Mike Kruskal6b87d6f2022-12-14 10:36:53 -08009241UPB_INLINE void google_protobuf_MessageOptions_clear_deprecated_legacy_json_field_conflicts(google_protobuf_MessageOptions* msg) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00009242 const upb_MiniTableField field = {11, 13, 68, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
Protobuf Team Bot4e90ead2024-01-08 15:46:34 +00009243 upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
Mike Kruskal6b87d6f2022-12-14 10:36:53 -08009244}
9245UPB_INLINE bool google_protobuf_MessageOptions_deprecated_legacy_json_field_conflicts(const google_protobuf_MessageOptions* msg) {
9246 bool default_val = false;
9247 bool ret;
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00009248 const upb_MiniTableField field = {11, 13, 68, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +00009249 _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field,
9250 &default_val, &ret);
Mike Kruskal6b87d6f2022-12-14 10:36:53 -08009251 return ret;
9252}
9253UPB_INLINE bool google_protobuf_MessageOptions_has_deprecated_legacy_json_field_conflicts(const google_protobuf_MessageOptions* msg) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00009254 const upb_MiniTableField field = {11, 13, 68, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
Protobuf Team Bot8c1f6352024-01-10 05:18:15 +00009255 return upb_Message_HasBaseField(UPB_UPCAST(msg), &field);
Mike Kruskal6b87d6f2022-12-14 10:36:53 -08009256}
Mike Kruskal4f9e4172023-06-30 20:14:50 -07009257UPB_INLINE void google_protobuf_MessageOptions_clear_features(google_protobuf_MessageOptions* msg) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00009258 const upb_MiniTableField field = {12, 16, 69, 0, 11, (int)kUpb_FieldMode_Scalar | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
Protobuf Team Bot4e90ead2024-01-08 15:46:34 +00009259 upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
Mike Kruskal4f9e4172023-06-30 20:14:50 -07009260}
9261UPB_INLINE const google_protobuf_FeatureSet* google_protobuf_MessageOptions_features(const google_protobuf_MessageOptions* msg) {
9262 const google_protobuf_FeatureSet* default_val = NULL;
9263 const google_protobuf_FeatureSet* ret;
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00009264 const upb_MiniTableField field = {12, 16, 69, 0, 11, (int)kUpb_FieldMode_Scalar | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
Protobuf Team Bota9387b52024-06-12 15:17:52 +00009265 UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__FeatureSet_msg_init);
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +00009266 _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field,
9267 &default_val, &ret);
Mike Kruskal4f9e4172023-06-30 20:14:50 -07009268 return ret;
9269}
9270UPB_INLINE bool google_protobuf_MessageOptions_has_features(const google_protobuf_MessageOptions* msg) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00009271 const upb_MiniTableField field = {12, 16, 69, 0, 11, (int)kUpb_FieldMode_Scalar | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
Protobuf Team Bot8c1f6352024-01-10 05:18:15 +00009272 return upb_Message_HasBaseField(UPB_UPCAST(msg), &field);
Mike Kruskal4f9e4172023-06-30 20:14:50 -07009273}
Mike Kruskal3bc50492022-12-01 13:34:12 -08009274UPB_INLINE void google_protobuf_MessageOptions_clear_uninterpreted_option(google_protobuf_MessageOptions* msg) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00009275 const upb_MiniTableField field = {999, UPB_SIZE(20, 24), 0, 1, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
Protobuf Team Bot4e90ead2024-01-08 15:46:34 +00009276 upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
Joshua Habermand3995ec2022-09-30 16:54:39 -07009277}
Eric Salob7d54ac2022-12-29 11:59:42 -08009278UPB_INLINE const google_protobuf_UninterpretedOption* const* google_protobuf_MessageOptions_uninterpreted_option(const google_protobuf_MessageOptions* msg, size_t* size) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00009279 const upb_MiniTableField field = {999, UPB_SIZE(20, 24), 0, 1, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
Protobuf Team Bota9387b52024-06-12 15:17:52 +00009280 UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__UninterpretedOption_msg_init);
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +00009281 const upb_Array* arr = upb_Message_GetArray(UPB_UPCAST(msg), &field);
Eric Salob7d54ac2022-12-29 11:59:42 -08009282 if (arr) {
Protobuf Team Botf73985a2023-12-19 00:14:19 +00009283 if (size) *size = arr->UPB_PRIVATE(size);
Protobuf Team Bot81e54332024-01-11 21:04:07 +00009284 return (const google_protobuf_UninterpretedOption* const*)upb_Array_DataPtr(arr);
Eric Salob7d54ac2022-12-29 11:59:42 -08009285 } else {
9286 if (size) *size = 0;
9287 return NULL;
9288 }
Joshua Haberman7ecf43f2022-03-14 13:11:29 -07009289}
Deanna Garciab26afb52023-04-25 13:37:18 -07009290UPB_INLINE const upb_Array* _google_protobuf_MessageOptions_uninterpreted_option_upb_array(const google_protobuf_MessageOptions* msg, size_t* size) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00009291 const upb_MiniTableField field = {999, UPB_SIZE(20, 24), 0, 1, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
Protobuf Team Bota9387b52024-06-12 15:17:52 +00009292 UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__UninterpretedOption_msg_init);
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +00009293 const upb_Array* arr = upb_Message_GetArray(UPB_UPCAST(msg), &field);
Deanna Garciab26afb52023-04-25 13:37:18 -07009294 if (size) {
Protobuf Team Botf73985a2023-12-19 00:14:19 +00009295 *size = arr ? arr->UPB_PRIVATE(size) : 0;
Deanna Garciab26afb52023-04-25 13:37:18 -07009296 }
9297 return arr;
9298}
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +00009299UPB_INLINE upb_Array* _google_protobuf_MessageOptions_uninterpreted_option_mutable_upb_array(google_protobuf_MessageOptions* msg, size_t* size, upb_Arena* arena) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00009300 const upb_MiniTableField field = {999, UPB_SIZE(20, 24), 0, 1, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
Protobuf Team Bota9387b52024-06-12 15:17:52 +00009301 UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__UninterpretedOption_msg_init);
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +00009302 upb_Array* arr = upb_Message_GetOrCreateMutableArray(UPB_UPCAST(msg),
9303 &field, arena);
Deanna Garciab26afb52023-04-25 13:37:18 -07009304 if (size) {
Protobuf Team Botf73985a2023-12-19 00:14:19 +00009305 *size = arr ? arr->UPB_PRIVATE(size) : 0;
Deanna Garciab26afb52023-04-25 13:37:18 -07009306 }
9307 return arr;
9308}
Joshua Haberman9abf6e22021-01-13 12:16:25 -08009309
9310UPB_INLINE void google_protobuf_MessageOptions_set_message_set_wire_format(google_protobuf_MessageOptions *msg, bool value) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00009311 const upb_MiniTableField field = {1, 9, 64, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
Protobuf Team Botac32c972024-04-10 03:30:05 +00009312 upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
Mike Kruskal232ecf42023-01-14 00:09:40 -08009313}
9314UPB_INLINE void google_protobuf_MessageOptions_set_no_standard_descriptor_accessor(google_protobuf_MessageOptions *msg, bool value) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00009315 const upb_MiniTableField field = {2, 10, 65, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
Protobuf Team Botac32c972024-04-10 03:30:05 +00009316 upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
Mike Kruskal232ecf42023-01-14 00:09:40 -08009317}
9318UPB_INLINE void google_protobuf_MessageOptions_set_deprecated(google_protobuf_MessageOptions *msg, bool value) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00009319 const upb_MiniTableField field = {3, 11, 66, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
Protobuf Team Botac32c972024-04-10 03:30:05 +00009320 upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
Mike Kruskal232ecf42023-01-14 00:09:40 -08009321}
9322UPB_INLINE void google_protobuf_MessageOptions_set_map_entry(google_protobuf_MessageOptions *msg, bool value) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00009323 const upb_MiniTableField field = {7, 12, 67, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
Protobuf Team Botac32c972024-04-10 03:30:05 +00009324 upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
Mike Kruskal232ecf42023-01-14 00:09:40 -08009325}
9326UPB_INLINE void google_protobuf_MessageOptions_set_deprecated_legacy_json_field_conflicts(google_protobuf_MessageOptions *msg, bool value) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00009327 const upb_MiniTableField field = {11, 13, 68, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
Protobuf Team Botac32c972024-04-10 03:30:05 +00009328 upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
Mike Kruskal232ecf42023-01-14 00:09:40 -08009329}
Mike Kruskal4f9e4172023-06-30 20:14:50 -07009330UPB_INLINE void google_protobuf_MessageOptions_set_features(google_protobuf_MessageOptions *msg, google_protobuf_FeatureSet* value) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00009331 const upb_MiniTableField field = {12, 16, 69, 0, 11, (int)kUpb_FieldMode_Scalar | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
Protobuf Team Bota9387b52024-06-12 15:17:52 +00009332 UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__FeatureSet_msg_init);
Protobuf Team Botac32c972024-04-10 03:30:05 +00009333 upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
Mike Kruskal4f9e4172023-06-30 20:14:50 -07009334}
9335UPB_INLINE struct google_protobuf_FeatureSet* google_protobuf_MessageOptions_mutable_features(google_protobuf_MessageOptions* msg, upb_Arena* arena) {
9336 struct google_protobuf_FeatureSet* sub = (struct google_protobuf_FeatureSet*)google_protobuf_MessageOptions_features(msg);
9337 if (sub == NULL) {
Protobuf Team Bot4ffe0862023-12-06 02:02:36 +00009338 sub = (struct google_protobuf_FeatureSet*)_upb_Message_New(&google__protobuf__FeatureSet_msg_init, arena);
Mike Kruskal4f9e4172023-06-30 20:14:50 -07009339 if (sub) google_protobuf_MessageOptions_set_features(msg, sub);
9340 }
9341 return sub;
9342}
Mike Kruskal232ecf42023-01-14 00:09:40 -08009343UPB_INLINE google_protobuf_UninterpretedOption** google_protobuf_MessageOptions_mutable_uninterpreted_option(google_protobuf_MessageOptions* msg, size_t* size) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00009344 upb_MiniTableField field = {999, UPB_SIZE(20, 24), 0, 1, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
Protobuf Team Bota9387b52024-06-12 15:17:52 +00009345 UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__UninterpretedOption_msg_init);
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +00009346 upb_Array* arr = upb_Message_GetMutableArray(UPB_UPCAST(msg), &field);
Eric Salob7d54ac2022-12-29 11:59:42 -08009347 if (arr) {
Protobuf Team Botf73985a2023-12-19 00:14:19 +00009348 if (size) *size = arr->UPB_PRIVATE(size);
Protobuf Team Bot81e54332024-01-11 21:04:07 +00009349 return (google_protobuf_UninterpretedOption**)upb_Array_MutableDataPtr(arr);
Eric Salob7d54ac2022-12-29 11:59:42 -08009350 } else {
9351 if (size) *size = 0;
9352 return NULL;
9353 }
Joshua Haberman9abf6e22021-01-13 12:16:25 -08009354}
Eric Salob7d54ac2022-12-29 11:59:42 -08009355UPB_INLINE google_protobuf_UninterpretedOption** google_protobuf_MessageOptions_resize_uninterpreted_option(google_protobuf_MessageOptions* msg, size_t size, upb_Arena* arena) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00009356 upb_MiniTableField field = {999, UPB_SIZE(20, 24), 0, 1, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +00009357 return (google_protobuf_UninterpretedOption**)upb_Message_ResizeArrayUninitialized(UPB_UPCAST(msg),
9358 &field, size, arena);
Joshua Haberman9abf6e22021-01-13 12:16:25 -08009359}
Joshua Haberman7ecf43f2022-03-14 13:11:29 -07009360UPB_INLINE struct google_protobuf_UninterpretedOption* google_protobuf_MessageOptions_add_uninterpreted_option(google_protobuf_MessageOptions* msg, upb_Arena* arena) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00009361 upb_MiniTableField field = {999, UPB_SIZE(20, 24), 0, 1, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
Protobuf Team Bota9387b52024-06-12 15:17:52 +00009362 UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__UninterpretedOption_msg_init);
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +00009363 upb_Array* arr = upb_Message_GetOrCreateMutableArray(
9364 UPB_UPCAST(msg), &field, arena);
Protobuf Team Bot81e54332024-01-11 21:04:07 +00009365 if (!arr || !UPB_PRIVATE(_upb_Array_ResizeUninitialized)(
Protobuf Team Botf73985a2023-12-19 00:14:19 +00009366 arr, arr->UPB_PRIVATE(size) + 1, arena)) {
Eric Salob7d54ac2022-12-29 11:59:42 -08009367 return NULL;
9368 }
Protobuf Team Bot4ffe0862023-12-06 02:02:36 +00009369 struct google_protobuf_UninterpretedOption* sub = (struct google_protobuf_UninterpretedOption*)_upb_Message_New(&google__protobuf__UninterpretedOption_msg_init, arena);
Eric Salob7d54ac2022-12-29 11:59:42 -08009370 if (!arr || !sub) return NULL;
Protobuf Team Botf73985a2023-12-19 00:14:19 +00009371 UPB_PRIVATE(_upb_Array_Set)
9372 (arr, arr->UPB_PRIVATE(size) - 1, &sub, sizeof(sub));
Joshua Haberman9abf6e22021-01-13 12:16:25 -08009373 return sub;
9374}
9375
9376/* google.protobuf.FieldOptions */
9377
Joshua Habermanf41049a2022-01-21 14:41:25 -08009378UPB_INLINE google_protobuf_FieldOptions* google_protobuf_FieldOptions_new(upb_Arena* arena) {
Protobuf Team Bot4ffe0862023-12-06 02:02:36 +00009379 return (google_protobuf_FieldOptions*)_upb_Message_New(&google__protobuf__FieldOptions_msg_init, arena);
Joshua Haberman9abf6e22021-01-13 12:16:25 -08009380}
Joshua Habermanf41049a2022-01-21 14:41:25 -08009381UPB_INLINE google_protobuf_FieldOptions* google_protobuf_FieldOptions_parse(const char* buf, size_t size, upb_Arena* arena) {
9382 google_protobuf_FieldOptions* ret = google_protobuf_FieldOptions_new(arena);
Joshua Haberman9d578a32021-08-02 15:32:01 -07009383 if (!ret) return NULL;
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +00009384 if (upb_Decode(buf, size, UPB_UPCAST(ret), &google__protobuf__FieldOptions_msg_init, NULL, 0, arena) !=
9385 kUpb_DecodeStatus_Ok) {
Joshua Haberman9d578a32021-08-02 15:32:01 -07009386 return NULL;
9387 }
9388 return ret;
Joshua Haberman9abf6e22021-01-13 12:16:25 -08009389}
Joshua Habermanf41049a2022-01-21 14:41:25 -08009390UPB_INLINE google_protobuf_FieldOptions* google_protobuf_FieldOptions_parse_ex(const char* buf, size_t size,
9391 const upb_ExtensionRegistry* extreg,
9392 int options, upb_Arena* arena) {
9393 google_protobuf_FieldOptions* ret = google_protobuf_FieldOptions_new(arena);
9394 if (!ret) return NULL;
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +00009395 if (upb_Decode(buf, size, UPB_UPCAST(ret), &google__protobuf__FieldOptions_msg_init, extreg, options,
9396 arena) != kUpb_DecodeStatus_Ok) {
Joshua Habermanf41049a2022-01-21 14:41:25 -08009397 return NULL;
9398 }
9399 return ret;
Joshua Haberman9abf6e22021-01-13 12:16:25 -08009400}
Joshua Habermanf41049a2022-01-21 14:41:25 -08009401UPB_INLINE char* google_protobuf_FieldOptions_serialize(const google_protobuf_FieldOptions* msg, upb_Arena* arena, size_t* len) {
Joshua Habermand3995ec2022-09-30 16:54:39 -07009402 char* ptr;
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +00009403 (void)upb_Encode(UPB_UPCAST(msg), &google__protobuf__FieldOptions_msg_init, 0, arena, &ptr, len);
Joshua Habermand3995ec2022-09-30 16:54:39 -07009404 return ptr;
Joshua Habermanf41049a2022-01-21 14:41:25 -08009405}
9406UPB_INLINE char* google_protobuf_FieldOptions_serialize_ex(const google_protobuf_FieldOptions* msg, int options,
9407 upb_Arena* arena, size_t* len) {
Joshua Habermand3995ec2022-09-30 16:54:39 -07009408 char* ptr;
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +00009409 (void)upb_Encode(UPB_UPCAST(msg), &google__protobuf__FieldOptions_msg_init, options, arena, &ptr, len);
Joshua Habermand3995ec2022-09-30 16:54:39 -07009410 return ptr;
Joshua Habermanf41049a2022-01-21 14:41:25 -08009411}
Mike Kruskal3bc50492022-12-01 13:34:12 -08009412UPB_INLINE void google_protobuf_FieldOptions_clear_ctype(google_protobuf_FieldOptions* msg) {
Protobuf Team Bot85edb7e2024-04-03 02:43:54 +00009413 const upb_MiniTableField field = {1, 12, 64, 4, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
Protobuf Team Bot4e90ead2024-01-08 15:46:34 +00009414 upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
Joshua Habermand3995ec2022-09-30 16:54:39 -07009415}
Joshua Habermanf41049a2022-01-21 14:41:25 -08009416UPB_INLINE int32_t google_protobuf_FieldOptions_ctype(const google_protobuf_FieldOptions* msg) {
Eric Salo8809a112022-11-21 13:01:06 -08009417 int32_t default_val = 0;
9418 int32_t ret;
Protobuf Team Bot85edb7e2024-04-03 02:43:54 +00009419 const upb_MiniTableField field = {1, 12, 64, 4, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +00009420 _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field,
9421 &default_val, &ret);
Eric Salo8809a112022-11-21 13:01:06 -08009422 return ret;
Joshua Habermanf41049a2022-01-21 14:41:25 -08009423}
Mike Kruskal3bc50492022-12-01 13:34:12 -08009424UPB_INLINE bool google_protobuf_FieldOptions_has_ctype(const google_protobuf_FieldOptions* msg) {
Protobuf Team Bot85edb7e2024-04-03 02:43:54 +00009425 const upb_MiniTableField field = {1, 12, 64, 4, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
Protobuf Team Bot8c1f6352024-01-10 05:18:15 +00009426 return upb_Message_HasBaseField(UPB_UPCAST(msg), &field);
Joshua Haberman7ecf43f2022-03-14 13:11:29 -07009427}
Mike Kruskal3bc50492022-12-01 13:34:12 -08009428UPB_INLINE void google_protobuf_FieldOptions_clear_packed(google_protobuf_FieldOptions* msg) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00009429 const upb_MiniTableField field = {2, 16, 65, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
Protobuf Team Bot4e90ead2024-01-08 15:46:34 +00009430 upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
Joshua Habermand3995ec2022-09-30 16:54:39 -07009431}
Joshua Habermanf41049a2022-01-21 14:41:25 -08009432UPB_INLINE bool google_protobuf_FieldOptions_packed(const google_protobuf_FieldOptions* msg) {
Eric Salo8809a112022-11-21 13:01:06 -08009433 bool default_val = false;
9434 bool ret;
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00009435 const upb_MiniTableField field = {2, 16, 65, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +00009436 _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field,
9437 &default_val, &ret);
Eric Salo8809a112022-11-21 13:01:06 -08009438 return ret;
Joshua Habermanf41049a2022-01-21 14:41:25 -08009439}
Mike Kruskal3bc50492022-12-01 13:34:12 -08009440UPB_INLINE bool google_protobuf_FieldOptions_has_packed(const google_protobuf_FieldOptions* msg) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00009441 const upb_MiniTableField field = {2, 16, 65, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
Protobuf Team Bot8c1f6352024-01-10 05:18:15 +00009442 return upb_Message_HasBaseField(UPB_UPCAST(msg), &field);
Joshua Haberman7ecf43f2022-03-14 13:11:29 -07009443}
Mike Kruskal3bc50492022-12-01 13:34:12 -08009444UPB_INLINE void google_protobuf_FieldOptions_clear_deprecated(google_protobuf_FieldOptions* msg) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00009445 const upb_MiniTableField field = {3, 17, 66, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
Protobuf Team Bot4e90ead2024-01-08 15:46:34 +00009446 upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
Joshua Habermand3995ec2022-09-30 16:54:39 -07009447}
Joshua Habermanf41049a2022-01-21 14:41:25 -08009448UPB_INLINE bool google_protobuf_FieldOptions_deprecated(const google_protobuf_FieldOptions* msg) {
Eric Salo8809a112022-11-21 13:01:06 -08009449 bool default_val = false;
9450 bool ret;
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00009451 const upb_MiniTableField field = {3, 17, 66, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +00009452 _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field,
9453 &default_val, &ret);
Eric Salo8809a112022-11-21 13:01:06 -08009454 return ret;
Joshua Habermanf41049a2022-01-21 14:41:25 -08009455}
Mike Kruskal3bc50492022-12-01 13:34:12 -08009456UPB_INLINE bool google_protobuf_FieldOptions_has_deprecated(const google_protobuf_FieldOptions* msg) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00009457 const upb_MiniTableField field = {3, 17, 66, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
Protobuf Team Bot8c1f6352024-01-10 05:18:15 +00009458 return upb_Message_HasBaseField(UPB_UPCAST(msg), &field);
Joshua Haberman7ecf43f2022-03-14 13:11:29 -07009459}
Mike Kruskal3bc50492022-12-01 13:34:12 -08009460UPB_INLINE void google_protobuf_FieldOptions_clear_lazy(google_protobuf_FieldOptions* msg) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00009461 const upb_MiniTableField field = {5, 18, 67, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
Protobuf Team Bot4e90ead2024-01-08 15:46:34 +00009462 upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
Joshua Habermand3995ec2022-09-30 16:54:39 -07009463}
Joshua Habermanf41049a2022-01-21 14:41:25 -08009464UPB_INLINE bool google_protobuf_FieldOptions_lazy(const google_protobuf_FieldOptions* msg) {
Eric Salo8809a112022-11-21 13:01:06 -08009465 bool default_val = false;
9466 bool ret;
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00009467 const upb_MiniTableField field = {5, 18, 67, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +00009468 _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field,
9469 &default_val, &ret);
Eric Salo8809a112022-11-21 13:01:06 -08009470 return ret;
Joshua Habermanf41049a2022-01-21 14:41:25 -08009471}
Mike Kruskal3bc50492022-12-01 13:34:12 -08009472UPB_INLINE bool google_protobuf_FieldOptions_has_lazy(const google_protobuf_FieldOptions* msg) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00009473 const upb_MiniTableField field = {5, 18, 67, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
Protobuf Team Bot8c1f6352024-01-10 05:18:15 +00009474 return upb_Message_HasBaseField(UPB_UPCAST(msg), &field);
Joshua Haberman7ecf43f2022-03-14 13:11:29 -07009475}
Mike Kruskal3bc50492022-12-01 13:34:12 -08009476UPB_INLINE void google_protobuf_FieldOptions_clear_jstype(google_protobuf_FieldOptions* msg) {
Protobuf Team Bot85edb7e2024-04-03 02:43:54 +00009477 const upb_MiniTableField field = {6, 20, 68, 5, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
Protobuf Team Bot4e90ead2024-01-08 15:46:34 +00009478 upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
Joshua Habermand3995ec2022-09-30 16:54:39 -07009479}
Joshua Habermanf41049a2022-01-21 14:41:25 -08009480UPB_INLINE int32_t google_protobuf_FieldOptions_jstype(const google_protobuf_FieldOptions* msg) {
Eric Salo8809a112022-11-21 13:01:06 -08009481 int32_t default_val = 0;
9482 int32_t ret;
Protobuf Team Bot85edb7e2024-04-03 02:43:54 +00009483 const upb_MiniTableField field = {6, 20, 68, 5, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +00009484 _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field,
9485 &default_val, &ret);
Eric Salo8809a112022-11-21 13:01:06 -08009486 return ret;
Joshua Habermanf41049a2022-01-21 14:41:25 -08009487}
Mike Kruskal3bc50492022-12-01 13:34:12 -08009488UPB_INLINE bool google_protobuf_FieldOptions_has_jstype(const google_protobuf_FieldOptions* msg) {
Protobuf Team Bot85edb7e2024-04-03 02:43:54 +00009489 const upb_MiniTableField field = {6, 20, 68, 5, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
Protobuf Team Bot8c1f6352024-01-10 05:18:15 +00009490 return upb_Message_HasBaseField(UPB_UPCAST(msg), &field);
Joshua Haberman7ecf43f2022-03-14 13:11:29 -07009491}
Mike Kruskal3bc50492022-12-01 13:34:12 -08009492UPB_INLINE void google_protobuf_FieldOptions_clear_weak(google_protobuf_FieldOptions* msg) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00009493 const upb_MiniTableField field = {10, 24, 69, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
Protobuf Team Bot4e90ead2024-01-08 15:46:34 +00009494 upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
Joshua Habermand3995ec2022-09-30 16:54:39 -07009495}
Joshua Habermanf41049a2022-01-21 14:41:25 -08009496UPB_INLINE bool google_protobuf_FieldOptions_weak(const google_protobuf_FieldOptions* msg) {
Eric Salo8809a112022-11-21 13:01:06 -08009497 bool default_val = false;
9498 bool ret;
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00009499 const upb_MiniTableField field = {10, 24, 69, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +00009500 _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field,
9501 &default_val, &ret);
Eric Salo8809a112022-11-21 13:01:06 -08009502 return ret;
Joshua Habermanf41049a2022-01-21 14:41:25 -08009503}
Mike Kruskal3bc50492022-12-01 13:34:12 -08009504UPB_INLINE bool google_protobuf_FieldOptions_has_weak(const google_protobuf_FieldOptions* msg) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00009505 const upb_MiniTableField field = {10, 24, 69, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
Protobuf Team Bot8c1f6352024-01-10 05:18:15 +00009506 return upb_Message_HasBaseField(UPB_UPCAST(msg), &field);
Joshua Haberman7ecf43f2022-03-14 13:11:29 -07009507}
Mike Kruskal3bc50492022-12-01 13:34:12 -08009508UPB_INLINE void google_protobuf_FieldOptions_clear_unverified_lazy(google_protobuf_FieldOptions* msg) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00009509 const upb_MiniTableField field = {15, 25, 70, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
Protobuf Team Bot4e90ead2024-01-08 15:46:34 +00009510 upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
Joshua Habermand3995ec2022-09-30 16:54:39 -07009511}
Joshua Haberman7ecf43f2022-03-14 13:11:29 -07009512UPB_INLINE bool google_protobuf_FieldOptions_unverified_lazy(const google_protobuf_FieldOptions* msg) {
Eric Salo8809a112022-11-21 13:01:06 -08009513 bool default_val = false;
9514 bool ret;
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00009515 const upb_MiniTableField field = {15, 25, 70, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +00009516 _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field,
9517 &default_val, &ret);
Eric Salo8809a112022-11-21 13:01:06 -08009518 return ret;
Joshua Haberman7ecf43f2022-03-14 13:11:29 -07009519}
Mike Kruskal3bc50492022-12-01 13:34:12 -08009520UPB_INLINE bool google_protobuf_FieldOptions_has_unverified_lazy(const google_protobuf_FieldOptions* msg) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00009521 const upb_MiniTableField field = {15, 25, 70, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
Protobuf Team Bot8c1f6352024-01-10 05:18:15 +00009522 return upb_Message_HasBaseField(UPB_UPCAST(msg), &field);
Joshua Haberman7ecf43f2022-03-14 13:11:29 -07009523}
Protobuf Team Bot9238c482022-12-16 20:01:55 -08009524UPB_INLINE void google_protobuf_FieldOptions_clear_debug_redact(google_protobuf_FieldOptions* msg) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00009525 const upb_MiniTableField field = {16, 26, 71, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
Protobuf Team Bot4e90ead2024-01-08 15:46:34 +00009526 upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
Protobuf Team Bot9238c482022-12-16 20:01:55 -08009527}
9528UPB_INLINE bool google_protobuf_FieldOptions_debug_redact(const google_protobuf_FieldOptions* msg) {
9529 bool default_val = false;
9530 bool ret;
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00009531 const upb_MiniTableField field = {16, 26, 71, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +00009532 _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field,
9533 &default_val, &ret);
Protobuf Team Bot9238c482022-12-16 20:01:55 -08009534 return ret;
9535}
9536UPB_INLINE bool google_protobuf_FieldOptions_has_debug_redact(const google_protobuf_FieldOptions* msg) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00009537 const upb_MiniTableField field = {16, 26, 71, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
Protobuf Team Bot8c1f6352024-01-10 05:18:15 +00009538 return upb_Message_HasBaseField(UPB_UPCAST(msg), &field);
Protobuf Team Bot9238c482022-12-16 20:01:55 -08009539}
Adam Cozzette5a568372023-01-24 20:35:59 -08009540UPB_INLINE void google_protobuf_FieldOptions_clear_retention(google_protobuf_FieldOptions* msg) {
Protobuf Team Bot85edb7e2024-04-03 02:43:54 +00009541 const upb_MiniTableField field = {17, 28, 72, 6, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
Protobuf Team Bot4e90ead2024-01-08 15:46:34 +00009542 upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
Adam Cozzette5a568372023-01-24 20:35:59 -08009543}
9544UPB_INLINE int32_t google_protobuf_FieldOptions_retention(const google_protobuf_FieldOptions* msg) {
9545 int32_t default_val = 0;
9546 int32_t ret;
Protobuf Team Bot85edb7e2024-04-03 02:43:54 +00009547 const upb_MiniTableField field = {17, 28, 72, 6, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +00009548 _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field,
9549 &default_val, &ret);
Adam Cozzette5a568372023-01-24 20:35:59 -08009550 return ret;
9551}
9552UPB_INLINE bool google_protobuf_FieldOptions_has_retention(const google_protobuf_FieldOptions* msg) {
Protobuf Team Bot85edb7e2024-04-03 02:43:54 +00009553 const upb_MiniTableField field = {17, 28, 72, 6, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
Protobuf Team Bot8c1f6352024-01-10 05:18:15 +00009554 return upb_Message_HasBaseField(UPB_UPCAST(msg), &field);
Adam Cozzette5a568372023-01-24 20:35:59 -08009555}
Mike Kruskal0c121392023-03-18 00:05:41 -07009556UPB_INLINE void google_protobuf_FieldOptions_clear_targets(google_protobuf_FieldOptions* msg) {
Protobuf Team Bot85edb7e2024-04-03 02:43:54 +00009557 const upb_MiniTableField field = {19, 32, 0, 7, 14, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
Protobuf Team Bot4e90ead2024-01-08 15:46:34 +00009558 upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
Adam Cozzette5a568372023-01-24 20:35:59 -08009559}
Mike Kruskal0c121392023-03-18 00:05:41 -07009560UPB_INLINE int32_t const* google_protobuf_FieldOptions_targets(const google_protobuf_FieldOptions* msg, size_t* size) {
Protobuf Team Bot85edb7e2024-04-03 02:43:54 +00009561 const upb_MiniTableField field = {19, 32, 0, 7, 14, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +00009562 const upb_Array* arr = upb_Message_GetArray(UPB_UPCAST(msg), &field);
Mike Kruskal0c121392023-03-18 00:05:41 -07009563 if (arr) {
Protobuf Team Botf73985a2023-12-19 00:14:19 +00009564 if (size) *size = arr->UPB_PRIVATE(size);
Protobuf Team Bot81e54332024-01-11 21:04:07 +00009565 return (int32_t const*)upb_Array_DataPtr(arr);
Mike Kruskal0c121392023-03-18 00:05:41 -07009566 } else {
9567 if (size) *size = 0;
9568 return NULL;
9569 }
Adam Cozzette5a568372023-01-24 20:35:59 -08009570}
Deanna Garciab26afb52023-04-25 13:37:18 -07009571UPB_INLINE const upb_Array* _google_protobuf_FieldOptions_targets_upb_array(const google_protobuf_FieldOptions* msg, size_t* size) {
Protobuf Team Bot85edb7e2024-04-03 02:43:54 +00009572 const upb_MiniTableField field = {19, 32, 0, 7, 14, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +00009573 const upb_Array* arr = upb_Message_GetArray(UPB_UPCAST(msg), &field);
Deanna Garciab26afb52023-04-25 13:37:18 -07009574 if (size) {
Protobuf Team Botf73985a2023-12-19 00:14:19 +00009575 *size = arr ? arr->UPB_PRIVATE(size) : 0;
Deanna Garciab26afb52023-04-25 13:37:18 -07009576 }
9577 return arr;
9578}
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +00009579UPB_INLINE upb_Array* _google_protobuf_FieldOptions_targets_mutable_upb_array(google_protobuf_FieldOptions* msg, size_t* size, upb_Arena* arena) {
Protobuf Team Bot85edb7e2024-04-03 02:43:54 +00009580 const upb_MiniTableField field = {19, 32, 0, 7, 14, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +00009581 upb_Array* arr = upb_Message_GetOrCreateMutableArray(UPB_UPCAST(msg),
9582 &field, arena);
Deanna Garciab26afb52023-04-25 13:37:18 -07009583 if (size) {
Protobuf Team Botf73985a2023-12-19 00:14:19 +00009584 *size = arr ? arr->UPB_PRIVATE(size) : 0;
Deanna Garciab26afb52023-04-25 13:37:18 -07009585 }
9586 return arr;
9587}
Mike Kruskal4f9e4172023-06-30 20:14:50 -07009588UPB_INLINE void google_protobuf_FieldOptions_clear_edition_defaults(google_protobuf_FieldOptions* msg) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00009589 const upb_MiniTableField field = {20, UPB_SIZE(36, 40), 0, 0, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
Protobuf Team Bot4e90ead2024-01-08 15:46:34 +00009590 upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
Mike Kruskal4f9e4172023-06-30 20:14:50 -07009591}
9592UPB_INLINE const google_protobuf_FieldOptions_EditionDefault* const* google_protobuf_FieldOptions_edition_defaults(const google_protobuf_FieldOptions* msg, size_t* size) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00009593 const upb_MiniTableField field = {20, UPB_SIZE(36, 40), 0, 0, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
Protobuf Team Bota9387b52024-06-12 15:17:52 +00009594 UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__FieldOptions__EditionDefault_msg_init);
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +00009595 const upb_Array* arr = upb_Message_GetArray(UPB_UPCAST(msg), &field);
Mike Kruskal4f9e4172023-06-30 20:14:50 -07009596 if (arr) {
Protobuf Team Botf73985a2023-12-19 00:14:19 +00009597 if (size) *size = arr->UPB_PRIVATE(size);
Protobuf Team Bot81e54332024-01-11 21:04:07 +00009598 return (const google_protobuf_FieldOptions_EditionDefault* const*)upb_Array_DataPtr(arr);
Mike Kruskal4f9e4172023-06-30 20:14:50 -07009599 } else {
9600 if (size) *size = 0;
9601 return NULL;
9602 }
9603}
9604UPB_INLINE const upb_Array* _google_protobuf_FieldOptions_edition_defaults_upb_array(const google_protobuf_FieldOptions* msg, size_t* size) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00009605 const upb_MiniTableField field = {20, UPB_SIZE(36, 40), 0, 0, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
Protobuf Team Bota9387b52024-06-12 15:17:52 +00009606 UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__FieldOptions__EditionDefault_msg_init);
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +00009607 const upb_Array* arr = upb_Message_GetArray(UPB_UPCAST(msg), &field);
Mike Kruskal4f9e4172023-06-30 20:14:50 -07009608 if (size) {
Protobuf Team Botf73985a2023-12-19 00:14:19 +00009609 *size = arr ? arr->UPB_PRIVATE(size) : 0;
Mike Kruskal4f9e4172023-06-30 20:14:50 -07009610 }
9611 return arr;
9612}
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +00009613UPB_INLINE upb_Array* _google_protobuf_FieldOptions_edition_defaults_mutable_upb_array(google_protobuf_FieldOptions* msg, size_t* size, upb_Arena* arena) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00009614 const upb_MiniTableField field = {20, UPB_SIZE(36, 40), 0, 0, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
Protobuf Team Bota9387b52024-06-12 15:17:52 +00009615 UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__FieldOptions__EditionDefault_msg_init);
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +00009616 upb_Array* arr = upb_Message_GetOrCreateMutableArray(UPB_UPCAST(msg),
9617 &field, arena);
Mike Kruskal4f9e4172023-06-30 20:14:50 -07009618 if (size) {
Protobuf Team Botf73985a2023-12-19 00:14:19 +00009619 *size = arr ? arr->UPB_PRIVATE(size) : 0;
Mike Kruskal4f9e4172023-06-30 20:14:50 -07009620 }
9621 return arr;
9622}
Mike Kruskal4f9e4172023-06-30 20:14:50 -07009623UPB_INLINE void google_protobuf_FieldOptions_clear_features(google_protobuf_FieldOptions* msg) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00009624 const upb_MiniTableField field = {21, UPB_SIZE(40, 48), 73, 1, 11, (int)kUpb_FieldMode_Scalar | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
Protobuf Team Bot4e90ead2024-01-08 15:46:34 +00009625 upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
Mike Kruskal4f9e4172023-06-30 20:14:50 -07009626}
9627UPB_INLINE const google_protobuf_FeatureSet* google_protobuf_FieldOptions_features(const google_protobuf_FieldOptions* msg) {
9628 const google_protobuf_FeatureSet* default_val = NULL;
9629 const google_protobuf_FeatureSet* ret;
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00009630 const upb_MiniTableField field = {21, UPB_SIZE(40, 48), 73, 1, 11, (int)kUpb_FieldMode_Scalar | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
Protobuf Team Bota9387b52024-06-12 15:17:52 +00009631 UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__FeatureSet_msg_init);
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +00009632 _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field,
9633 &default_val, &ret);
Mike Kruskal4f9e4172023-06-30 20:14:50 -07009634 return ret;
9635}
9636UPB_INLINE bool google_protobuf_FieldOptions_has_features(const google_protobuf_FieldOptions* msg) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00009637 const upb_MiniTableField field = {21, UPB_SIZE(40, 48), 73, 1, 11, (int)kUpb_FieldMode_Scalar | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
Protobuf Team Bot8c1f6352024-01-10 05:18:15 +00009638 return upb_Message_HasBaseField(UPB_UPCAST(msg), &field);
Mike Kruskal4f9e4172023-06-30 20:14:50 -07009639}
Protobuf Team Bot85edb7e2024-04-03 02:43:54 +00009640UPB_INLINE void google_protobuf_FieldOptions_clear_feature_support(google_protobuf_FieldOptions* msg) {
9641 const upb_MiniTableField field = {22, UPB_SIZE(44, 56), 74, 2, 11, (int)kUpb_FieldMode_Scalar | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
9642 upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
9643}
9644UPB_INLINE const google_protobuf_FieldOptions_FeatureSupport* google_protobuf_FieldOptions_feature_support(const google_protobuf_FieldOptions* msg) {
9645 const google_protobuf_FieldOptions_FeatureSupport* default_val = NULL;
9646 const google_protobuf_FieldOptions_FeatureSupport* ret;
9647 const upb_MiniTableField field = {22, UPB_SIZE(44, 56), 74, 2, 11, (int)kUpb_FieldMode_Scalar | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
Protobuf Team Bota9387b52024-06-12 15:17:52 +00009648 UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__FieldOptions__FeatureSupport_msg_init);
Protobuf Team Bot85edb7e2024-04-03 02:43:54 +00009649 _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field,
9650 &default_val, &ret);
9651 return ret;
9652}
9653UPB_INLINE bool google_protobuf_FieldOptions_has_feature_support(const google_protobuf_FieldOptions* msg) {
9654 const upb_MiniTableField field = {22, UPB_SIZE(44, 56), 74, 2, 11, (int)kUpb_FieldMode_Scalar | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
9655 return upb_Message_HasBaseField(UPB_UPCAST(msg), &field);
9656}
Mike Kruskal3bc50492022-12-01 13:34:12 -08009657UPB_INLINE void google_protobuf_FieldOptions_clear_uninterpreted_option(google_protobuf_FieldOptions* msg) {
Protobuf Team Bot85edb7e2024-04-03 02:43:54 +00009658 const upb_MiniTableField field = {999, UPB_SIZE(48, 64), 0, 3, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
Protobuf Team Bot4e90ead2024-01-08 15:46:34 +00009659 upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
Joshua Habermand3995ec2022-09-30 16:54:39 -07009660}
Eric Salob7d54ac2022-12-29 11:59:42 -08009661UPB_INLINE const google_protobuf_UninterpretedOption* const* google_protobuf_FieldOptions_uninterpreted_option(const google_protobuf_FieldOptions* msg, size_t* size) {
Protobuf Team Bot85edb7e2024-04-03 02:43:54 +00009662 const upb_MiniTableField field = {999, UPB_SIZE(48, 64), 0, 3, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
Protobuf Team Bota9387b52024-06-12 15:17:52 +00009663 UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__UninterpretedOption_msg_init);
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +00009664 const upb_Array* arr = upb_Message_GetArray(UPB_UPCAST(msg), &field);
Eric Salob7d54ac2022-12-29 11:59:42 -08009665 if (arr) {
Protobuf Team Botf73985a2023-12-19 00:14:19 +00009666 if (size) *size = arr->UPB_PRIVATE(size);
Protobuf Team Bot81e54332024-01-11 21:04:07 +00009667 return (const google_protobuf_UninterpretedOption* const*)upb_Array_DataPtr(arr);
Eric Salob7d54ac2022-12-29 11:59:42 -08009668 } else {
9669 if (size) *size = 0;
9670 return NULL;
9671 }
Joshua Haberman7ecf43f2022-03-14 13:11:29 -07009672}
Deanna Garciab26afb52023-04-25 13:37:18 -07009673UPB_INLINE const upb_Array* _google_protobuf_FieldOptions_uninterpreted_option_upb_array(const google_protobuf_FieldOptions* msg, size_t* size) {
Protobuf Team Bot85edb7e2024-04-03 02:43:54 +00009674 const upb_MiniTableField field = {999, UPB_SIZE(48, 64), 0, 3, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
Protobuf Team Bota9387b52024-06-12 15:17:52 +00009675 UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__UninterpretedOption_msg_init);
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +00009676 const upb_Array* arr = upb_Message_GetArray(UPB_UPCAST(msg), &field);
Deanna Garciab26afb52023-04-25 13:37:18 -07009677 if (size) {
Protobuf Team Botf73985a2023-12-19 00:14:19 +00009678 *size = arr ? arr->UPB_PRIVATE(size) : 0;
Deanna Garciab26afb52023-04-25 13:37:18 -07009679 }
9680 return arr;
9681}
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +00009682UPB_INLINE upb_Array* _google_protobuf_FieldOptions_uninterpreted_option_mutable_upb_array(google_protobuf_FieldOptions* msg, size_t* size, upb_Arena* arena) {
Protobuf Team Bot85edb7e2024-04-03 02:43:54 +00009683 const upb_MiniTableField field = {999, UPB_SIZE(48, 64), 0, 3, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
Protobuf Team Bota9387b52024-06-12 15:17:52 +00009684 UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__UninterpretedOption_msg_init);
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +00009685 upb_Array* arr = upb_Message_GetOrCreateMutableArray(UPB_UPCAST(msg),
9686 &field, arena);
Deanna Garciab26afb52023-04-25 13:37:18 -07009687 if (size) {
Protobuf Team Botf73985a2023-12-19 00:14:19 +00009688 *size = arr ? arr->UPB_PRIVATE(size) : 0;
Deanna Garciab26afb52023-04-25 13:37:18 -07009689 }
9690 return arr;
9691}
Joshua Haberman9abf6e22021-01-13 12:16:25 -08009692
9693UPB_INLINE void google_protobuf_FieldOptions_set_ctype(google_protobuf_FieldOptions *msg, int32_t value) {
Protobuf Team Bot85edb7e2024-04-03 02:43:54 +00009694 const upb_MiniTableField field = {1, 12, 64, 4, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
Protobuf Team Botac32c972024-04-10 03:30:05 +00009695 upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
Mike Kruskal232ecf42023-01-14 00:09:40 -08009696}
9697UPB_INLINE void google_protobuf_FieldOptions_set_packed(google_protobuf_FieldOptions *msg, bool value) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00009698 const upb_MiniTableField field = {2, 16, 65, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
Protobuf Team Botac32c972024-04-10 03:30:05 +00009699 upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
Mike Kruskal232ecf42023-01-14 00:09:40 -08009700}
9701UPB_INLINE void google_protobuf_FieldOptions_set_deprecated(google_protobuf_FieldOptions *msg, bool value) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00009702 const upb_MiniTableField field = {3, 17, 66, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
Protobuf Team Botac32c972024-04-10 03:30:05 +00009703 upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
Mike Kruskal232ecf42023-01-14 00:09:40 -08009704}
9705UPB_INLINE void google_protobuf_FieldOptions_set_lazy(google_protobuf_FieldOptions *msg, bool value) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00009706 const upb_MiniTableField field = {5, 18, 67, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
Protobuf Team Botac32c972024-04-10 03:30:05 +00009707 upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
Mike Kruskal232ecf42023-01-14 00:09:40 -08009708}
9709UPB_INLINE void google_protobuf_FieldOptions_set_jstype(google_protobuf_FieldOptions *msg, int32_t value) {
Protobuf Team Bot85edb7e2024-04-03 02:43:54 +00009710 const upb_MiniTableField field = {6, 20, 68, 5, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
Protobuf Team Botac32c972024-04-10 03:30:05 +00009711 upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
Mike Kruskal232ecf42023-01-14 00:09:40 -08009712}
9713UPB_INLINE void google_protobuf_FieldOptions_set_weak(google_protobuf_FieldOptions *msg, bool value) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00009714 const upb_MiniTableField field = {10, 24, 69, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
Protobuf Team Botac32c972024-04-10 03:30:05 +00009715 upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
Mike Kruskal232ecf42023-01-14 00:09:40 -08009716}
9717UPB_INLINE void google_protobuf_FieldOptions_set_unverified_lazy(google_protobuf_FieldOptions *msg, bool value) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00009718 const upb_MiniTableField field = {15, 25, 70, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
Protobuf Team Botac32c972024-04-10 03:30:05 +00009719 upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
Mike Kruskal232ecf42023-01-14 00:09:40 -08009720}
9721UPB_INLINE void google_protobuf_FieldOptions_set_debug_redact(google_protobuf_FieldOptions *msg, bool value) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00009722 const upb_MiniTableField field = {16, 26, 71, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
Protobuf Team Botac32c972024-04-10 03:30:05 +00009723 upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
Mike Kruskal232ecf42023-01-14 00:09:40 -08009724}
Adam Cozzette5a568372023-01-24 20:35:59 -08009725UPB_INLINE void google_protobuf_FieldOptions_set_retention(google_protobuf_FieldOptions *msg, int32_t value) {
Protobuf Team Bot85edb7e2024-04-03 02:43:54 +00009726 const upb_MiniTableField field = {17, 28, 72, 6, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
Protobuf Team Botac32c972024-04-10 03:30:05 +00009727 upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
Adam Cozzette5a568372023-01-24 20:35:59 -08009728}
Mike Kruskal0c121392023-03-18 00:05:41 -07009729UPB_INLINE int32_t* google_protobuf_FieldOptions_mutable_targets(google_protobuf_FieldOptions* msg, size_t* size) {
Protobuf Team Bot85edb7e2024-04-03 02:43:54 +00009730 upb_MiniTableField field = {19, 32, 0, 7, 14, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +00009731 upb_Array* arr = upb_Message_GetMutableArray(UPB_UPCAST(msg), &field);
Mike Kruskal0c121392023-03-18 00:05:41 -07009732 if (arr) {
Protobuf Team Botf73985a2023-12-19 00:14:19 +00009733 if (size) *size = arr->UPB_PRIVATE(size);
Protobuf Team Bot81e54332024-01-11 21:04:07 +00009734 return (int32_t*)upb_Array_MutableDataPtr(arr);
Mike Kruskal0c121392023-03-18 00:05:41 -07009735 } else {
9736 if (size) *size = 0;
9737 return NULL;
9738 }
9739}
9740UPB_INLINE int32_t* google_protobuf_FieldOptions_resize_targets(google_protobuf_FieldOptions* msg, size_t size, upb_Arena* arena) {
Protobuf Team Bot85edb7e2024-04-03 02:43:54 +00009741 upb_MiniTableField field = {19, 32, 0, 7, 14, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +00009742 return (int32_t*)upb_Message_ResizeArrayUninitialized(UPB_UPCAST(msg),
9743 &field, size, arena);
Mike Kruskal0c121392023-03-18 00:05:41 -07009744}
9745UPB_INLINE bool google_protobuf_FieldOptions_add_targets(google_protobuf_FieldOptions* msg, int32_t val, upb_Arena* arena) {
Protobuf Team Bot85edb7e2024-04-03 02:43:54 +00009746 upb_MiniTableField field = {19, 32, 0, 7, 14, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +00009747 upb_Array* arr = upb_Message_GetOrCreateMutableArray(
9748 UPB_UPCAST(msg), &field, arena);
Protobuf Team Bot81e54332024-01-11 21:04:07 +00009749 if (!arr || !UPB_PRIVATE(_upb_Array_ResizeUninitialized)(
Protobuf Team Botf73985a2023-12-19 00:14:19 +00009750 arr, arr->UPB_PRIVATE(size) + 1, arena)) {
Mike Kruskal0c121392023-03-18 00:05:41 -07009751 return false;
9752 }
Protobuf Team Botf73985a2023-12-19 00:14:19 +00009753 UPB_PRIVATE(_upb_Array_Set)
9754 (arr, arr->UPB_PRIVATE(size) - 1, &val, sizeof(val));
Mike Kruskal0c121392023-03-18 00:05:41 -07009755 return true;
Adam Cozzette5a568372023-01-24 20:35:59 -08009756}
Mike Kruskal4f9e4172023-06-30 20:14:50 -07009757UPB_INLINE google_protobuf_FieldOptions_EditionDefault** google_protobuf_FieldOptions_mutable_edition_defaults(google_protobuf_FieldOptions* msg, size_t* size) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00009758 upb_MiniTableField field = {20, UPB_SIZE(36, 40), 0, 0, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
Protobuf Team Bota9387b52024-06-12 15:17:52 +00009759 UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__FieldOptions__EditionDefault_msg_init);
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +00009760 upb_Array* arr = upb_Message_GetMutableArray(UPB_UPCAST(msg), &field);
Mike Kruskal4f9e4172023-06-30 20:14:50 -07009761 if (arr) {
Protobuf Team Botf73985a2023-12-19 00:14:19 +00009762 if (size) *size = arr->UPB_PRIVATE(size);
Protobuf Team Bot81e54332024-01-11 21:04:07 +00009763 return (google_protobuf_FieldOptions_EditionDefault**)upb_Array_MutableDataPtr(arr);
Mike Kruskal4f9e4172023-06-30 20:14:50 -07009764 } else {
9765 if (size) *size = 0;
9766 return NULL;
9767 }
9768}
9769UPB_INLINE google_protobuf_FieldOptions_EditionDefault** google_protobuf_FieldOptions_resize_edition_defaults(google_protobuf_FieldOptions* msg, size_t size, upb_Arena* arena) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00009770 upb_MiniTableField field = {20, UPB_SIZE(36, 40), 0, 0, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +00009771 return (google_protobuf_FieldOptions_EditionDefault**)upb_Message_ResizeArrayUninitialized(UPB_UPCAST(msg),
9772 &field, size, arena);
Mike Kruskal4f9e4172023-06-30 20:14:50 -07009773}
9774UPB_INLINE struct google_protobuf_FieldOptions_EditionDefault* google_protobuf_FieldOptions_add_edition_defaults(google_protobuf_FieldOptions* msg, upb_Arena* arena) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00009775 upb_MiniTableField field = {20, UPB_SIZE(36, 40), 0, 0, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
Protobuf Team Bota9387b52024-06-12 15:17:52 +00009776 UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__FieldOptions__EditionDefault_msg_init);
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +00009777 upb_Array* arr = upb_Message_GetOrCreateMutableArray(
9778 UPB_UPCAST(msg), &field, arena);
Protobuf Team Bot81e54332024-01-11 21:04:07 +00009779 if (!arr || !UPB_PRIVATE(_upb_Array_ResizeUninitialized)(
Protobuf Team Botf73985a2023-12-19 00:14:19 +00009780 arr, arr->UPB_PRIVATE(size) + 1, arena)) {
Mike Kruskal4f9e4172023-06-30 20:14:50 -07009781 return NULL;
9782 }
Protobuf Team Bot4ffe0862023-12-06 02:02:36 +00009783 struct google_protobuf_FieldOptions_EditionDefault* sub = (struct google_protobuf_FieldOptions_EditionDefault*)_upb_Message_New(&google__protobuf__FieldOptions__EditionDefault_msg_init, arena);
Mike Kruskal4f9e4172023-06-30 20:14:50 -07009784 if (!arr || !sub) return NULL;
Protobuf Team Botf73985a2023-12-19 00:14:19 +00009785 UPB_PRIVATE(_upb_Array_Set)
9786 (arr, arr->UPB_PRIVATE(size) - 1, &sub, sizeof(sub));
Mike Kruskal4f9e4172023-06-30 20:14:50 -07009787 return sub;
9788}
9789UPB_INLINE void google_protobuf_FieldOptions_set_features(google_protobuf_FieldOptions *msg, google_protobuf_FeatureSet* value) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00009790 const upb_MiniTableField field = {21, UPB_SIZE(40, 48), 73, 1, 11, (int)kUpb_FieldMode_Scalar | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
Protobuf Team Bota9387b52024-06-12 15:17:52 +00009791 UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__FeatureSet_msg_init);
Protobuf Team Botac32c972024-04-10 03:30:05 +00009792 upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
Mike Kruskal4f9e4172023-06-30 20:14:50 -07009793}
9794UPB_INLINE struct google_protobuf_FeatureSet* google_protobuf_FieldOptions_mutable_features(google_protobuf_FieldOptions* msg, upb_Arena* arena) {
9795 struct google_protobuf_FeatureSet* sub = (struct google_protobuf_FeatureSet*)google_protobuf_FieldOptions_features(msg);
9796 if (sub == NULL) {
Protobuf Team Bot4ffe0862023-12-06 02:02:36 +00009797 sub = (struct google_protobuf_FeatureSet*)_upb_Message_New(&google__protobuf__FeatureSet_msg_init, arena);
Mike Kruskal4f9e4172023-06-30 20:14:50 -07009798 if (sub) google_protobuf_FieldOptions_set_features(msg, sub);
9799 }
9800 return sub;
9801}
Protobuf Team Bot85edb7e2024-04-03 02:43:54 +00009802UPB_INLINE void google_protobuf_FieldOptions_set_feature_support(google_protobuf_FieldOptions *msg, google_protobuf_FieldOptions_FeatureSupport* value) {
9803 const upb_MiniTableField field = {22, UPB_SIZE(44, 56), 74, 2, 11, (int)kUpb_FieldMode_Scalar | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
Protobuf Team Bota9387b52024-06-12 15:17:52 +00009804 UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__FieldOptions__FeatureSupport_msg_init);
Protobuf Team Botac32c972024-04-10 03:30:05 +00009805 upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
Protobuf Team Bot85edb7e2024-04-03 02:43:54 +00009806}
9807UPB_INLINE struct google_protobuf_FieldOptions_FeatureSupport* google_protobuf_FieldOptions_mutable_feature_support(google_protobuf_FieldOptions* msg, upb_Arena* arena) {
9808 struct google_protobuf_FieldOptions_FeatureSupport* sub = (struct google_protobuf_FieldOptions_FeatureSupport*)google_protobuf_FieldOptions_feature_support(msg);
9809 if (sub == NULL) {
9810 sub = (struct google_protobuf_FieldOptions_FeatureSupport*)_upb_Message_New(&google__protobuf__FieldOptions__FeatureSupport_msg_init, arena);
9811 if (sub) google_protobuf_FieldOptions_set_feature_support(msg, sub);
9812 }
9813 return sub;
9814}
Mike Kruskal232ecf42023-01-14 00:09:40 -08009815UPB_INLINE google_protobuf_UninterpretedOption** google_protobuf_FieldOptions_mutable_uninterpreted_option(google_protobuf_FieldOptions* msg, size_t* size) {
Protobuf Team Bot85edb7e2024-04-03 02:43:54 +00009816 upb_MiniTableField field = {999, UPB_SIZE(48, 64), 0, 3, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
Protobuf Team Bota9387b52024-06-12 15:17:52 +00009817 UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__UninterpretedOption_msg_init);
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +00009818 upb_Array* arr = upb_Message_GetMutableArray(UPB_UPCAST(msg), &field);
Eric Salob7d54ac2022-12-29 11:59:42 -08009819 if (arr) {
Protobuf Team Botf73985a2023-12-19 00:14:19 +00009820 if (size) *size = arr->UPB_PRIVATE(size);
Protobuf Team Bot81e54332024-01-11 21:04:07 +00009821 return (google_protobuf_UninterpretedOption**)upb_Array_MutableDataPtr(arr);
Eric Salob7d54ac2022-12-29 11:59:42 -08009822 } else {
9823 if (size) *size = 0;
9824 return NULL;
9825 }
Joshua Haberman9abf6e22021-01-13 12:16:25 -08009826}
Eric Salob7d54ac2022-12-29 11:59:42 -08009827UPB_INLINE google_protobuf_UninterpretedOption** google_protobuf_FieldOptions_resize_uninterpreted_option(google_protobuf_FieldOptions* msg, size_t size, upb_Arena* arena) {
Protobuf Team Bot85edb7e2024-04-03 02:43:54 +00009828 upb_MiniTableField field = {999, UPB_SIZE(48, 64), 0, 3, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +00009829 return (google_protobuf_UninterpretedOption**)upb_Message_ResizeArrayUninitialized(UPB_UPCAST(msg),
9830 &field, size, arena);
Joshua Haberman7ecf43f2022-03-14 13:11:29 -07009831}
9832UPB_INLINE struct google_protobuf_UninterpretedOption* google_protobuf_FieldOptions_add_uninterpreted_option(google_protobuf_FieldOptions* msg, upb_Arena* arena) {
Protobuf Team Bot85edb7e2024-04-03 02:43:54 +00009833 upb_MiniTableField field = {999, UPB_SIZE(48, 64), 0, 3, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
Protobuf Team Bota9387b52024-06-12 15:17:52 +00009834 UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__UninterpretedOption_msg_init);
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +00009835 upb_Array* arr = upb_Message_GetOrCreateMutableArray(
9836 UPB_UPCAST(msg), &field, arena);
Protobuf Team Bot81e54332024-01-11 21:04:07 +00009837 if (!arr || !UPB_PRIVATE(_upb_Array_ResizeUninitialized)(
Protobuf Team Botf73985a2023-12-19 00:14:19 +00009838 arr, arr->UPB_PRIVATE(size) + 1, arena)) {
Eric Salob7d54ac2022-12-29 11:59:42 -08009839 return NULL;
9840 }
Protobuf Team Bot4ffe0862023-12-06 02:02:36 +00009841 struct google_protobuf_UninterpretedOption* sub = (struct google_protobuf_UninterpretedOption*)_upb_Message_New(&google__protobuf__UninterpretedOption_msg_init, arena);
Eric Salob7d54ac2022-12-29 11:59:42 -08009842 if (!arr || !sub) return NULL;
Protobuf Team Botf73985a2023-12-19 00:14:19 +00009843 UPB_PRIVATE(_upb_Array_Set)
9844 (arr, arr->UPB_PRIVATE(size) - 1, &sub, sizeof(sub));
Joshua Haberman9abf6e22021-01-13 12:16:25 -08009845 return sub;
9846}
9847
Mike Kruskal4f9e4172023-06-30 20:14:50 -07009848/* google.protobuf.FieldOptions.EditionDefault */
9849
9850UPB_INLINE google_protobuf_FieldOptions_EditionDefault* google_protobuf_FieldOptions_EditionDefault_new(upb_Arena* arena) {
Protobuf Team Bot4ffe0862023-12-06 02:02:36 +00009851 return (google_protobuf_FieldOptions_EditionDefault*)_upb_Message_New(&google__protobuf__FieldOptions__EditionDefault_msg_init, arena);
Mike Kruskal4f9e4172023-06-30 20:14:50 -07009852}
9853UPB_INLINE google_protobuf_FieldOptions_EditionDefault* google_protobuf_FieldOptions_EditionDefault_parse(const char* buf, size_t size, upb_Arena* arena) {
9854 google_protobuf_FieldOptions_EditionDefault* ret = google_protobuf_FieldOptions_EditionDefault_new(arena);
9855 if (!ret) return NULL;
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +00009856 if (upb_Decode(buf, size, UPB_UPCAST(ret), &google__protobuf__FieldOptions__EditionDefault_msg_init, NULL, 0, arena) !=
9857 kUpb_DecodeStatus_Ok) {
Mike Kruskal4f9e4172023-06-30 20:14:50 -07009858 return NULL;
9859 }
9860 return ret;
9861}
9862UPB_INLINE google_protobuf_FieldOptions_EditionDefault* google_protobuf_FieldOptions_EditionDefault_parse_ex(const char* buf, size_t size,
9863 const upb_ExtensionRegistry* extreg,
9864 int options, upb_Arena* arena) {
9865 google_protobuf_FieldOptions_EditionDefault* ret = google_protobuf_FieldOptions_EditionDefault_new(arena);
9866 if (!ret) return NULL;
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +00009867 if (upb_Decode(buf, size, UPB_UPCAST(ret), &google__protobuf__FieldOptions__EditionDefault_msg_init, extreg, options,
9868 arena) != kUpb_DecodeStatus_Ok) {
Mike Kruskal4f9e4172023-06-30 20:14:50 -07009869 return NULL;
9870 }
9871 return ret;
9872}
9873UPB_INLINE char* google_protobuf_FieldOptions_EditionDefault_serialize(const google_protobuf_FieldOptions_EditionDefault* msg, upb_Arena* arena, size_t* len) {
9874 char* ptr;
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +00009875 (void)upb_Encode(UPB_UPCAST(msg), &google__protobuf__FieldOptions__EditionDefault_msg_init, 0, arena, &ptr, len);
Mike Kruskal4f9e4172023-06-30 20:14:50 -07009876 return ptr;
9877}
9878UPB_INLINE char* google_protobuf_FieldOptions_EditionDefault_serialize_ex(const google_protobuf_FieldOptions_EditionDefault* msg, int options,
9879 upb_Arena* arena, size_t* len) {
9880 char* ptr;
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +00009881 (void)upb_Encode(UPB_UPCAST(msg), &google__protobuf__FieldOptions__EditionDefault_msg_init, options, arena, &ptr, len);
Mike Kruskal4f9e4172023-06-30 20:14:50 -07009882 return ptr;
9883}
Mike Kruskal4f9e4172023-06-30 20:14:50 -07009884UPB_INLINE void google_protobuf_FieldOptions_EditionDefault_clear_value(google_protobuf_FieldOptions_EditionDefault* msg) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00009885 const upb_MiniTableField field = {2, 16, 64, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
Protobuf Team Bot4e90ead2024-01-08 15:46:34 +00009886 upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
Mike Kruskal4f9e4172023-06-30 20:14:50 -07009887}
9888UPB_INLINE upb_StringView google_protobuf_FieldOptions_EditionDefault_value(const google_protobuf_FieldOptions_EditionDefault* msg) {
9889 upb_StringView default_val = upb_StringView_FromString("");
9890 upb_StringView ret;
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00009891 const upb_MiniTableField field = {2, 16, 64, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +00009892 _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field,
9893 &default_val, &ret);
Mike Kruskal4f9e4172023-06-30 20:14:50 -07009894 return ret;
9895}
9896UPB_INLINE bool google_protobuf_FieldOptions_EditionDefault_has_value(const google_protobuf_FieldOptions_EditionDefault* msg) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00009897 const upb_MiniTableField field = {2, 16, 64, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
Protobuf Team Bot8c1f6352024-01-10 05:18:15 +00009898 return upb_Message_HasBaseField(UPB_UPCAST(msg), &field);
Protobuf Team Botfa98bb32023-09-01 18:11:09 +00009899}
Protobuf Team Botab58f8f2023-09-26 16:14:19 +00009900UPB_INLINE void google_protobuf_FieldOptions_EditionDefault_clear_edition(google_protobuf_FieldOptions_EditionDefault* msg) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00009901 const upb_MiniTableField field = {3, 12, 65, 0, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
Protobuf Team Bot4e90ead2024-01-08 15:46:34 +00009902 upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
Protobuf Team Botfa98bb32023-09-01 18:11:09 +00009903}
Protobuf Team Botab58f8f2023-09-26 16:14:19 +00009904UPB_INLINE int32_t google_protobuf_FieldOptions_EditionDefault_edition(const google_protobuf_FieldOptions_EditionDefault* msg) {
Protobuf Team Botfa98bb32023-09-01 18:11:09 +00009905 int32_t default_val = 0;
9906 int32_t ret;
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00009907 const upb_MiniTableField field = {3, 12, 65, 0, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +00009908 _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field,
9909 &default_val, &ret);
Protobuf Team Botfa98bb32023-09-01 18:11:09 +00009910 return ret;
9911}
Protobuf Team Botab58f8f2023-09-26 16:14:19 +00009912UPB_INLINE bool google_protobuf_FieldOptions_EditionDefault_has_edition(const google_protobuf_FieldOptions_EditionDefault* msg) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00009913 const upb_MiniTableField field = {3, 12, 65, 0, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
Protobuf Team Bot8c1f6352024-01-10 05:18:15 +00009914 return upb_Message_HasBaseField(UPB_UPCAST(msg), &field);
Mike Kruskal4f9e4172023-06-30 20:14:50 -07009915}
9916
Mike Kruskal4f9e4172023-06-30 20:14:50 -07009917UPB_INLINE void google_protobuf_FieldOptions_EditionDefault_set_value(google_protobuf_FieldOptions_EditionDefault *msg, upb_StringView value) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00009918 const upb_MiniTableField field = {2, 16, 64, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
Protobuf Team Botac32c972024-04-10 03:30:05 +00009919 upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
Protobuf Team Botfa98bb32023-09-01 18:11:09 +00009920}
Protobuf Team Botab58f8f2023-09-26 16:14:19 +00009921UPB_INLINE void google_protobuf_FieldOptions_EditionDefault_set_edition(google_protobuf_FieldOptions_EditionDefault *msg, int32_t value) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +00009922 const upb_MiniTableField field = {3, 12, 65, 0, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
Protobuf Team Botac32c972024-04-10 03:30:05 +00009923 upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
Mike Kruskal4f9e4172023-06-30 20:14:50 -07009924}
9925
Protobuf Team Bot85edb7e2024-04-03 02:43:54 +00009926/* google.protobuf.FieldOptions.FeatureSupport */
9927
9928UPB_INLINE google_protobuf_FieldOptions_FeatureSupport* google_protobuf_FieldOptions_FeatureSupport_new(upb_Arena* arena) {
9929 return (google_protobuf_FieldOptions_FeatureSupport*)_upb_Message_New(&google__protobuf__FieldOptions__FeatureSupport_msg_init, arena);
9930}
9931UPB_INLINE google_protobuf_FieldOptions_FeatureSupport* google_protobuf_FieldOptions_FeatureSupport_parse(const char* buf, size_t size, upb_Arena* arena) {
9932 google_protobuf_FieldOptions_FeatureSupport* ret = google_protobuf_FieldOptions_FeatureSupport_new(arena);
9933 if (!ret) return NULL;
9934 if (upb_Decode(buf, size, UPB_UPCAST(ret), &google__protobuf__FieldOptions__FeatureSupport_msg_init, NULL, 0, arena) !=
9935 kUpb_DecodeStatus_Ok) {
9936 return NULL;
9937 }
9938 return ret;
9939}
9940UPB_INLINE google_protobuf_FieldOptions_FeatureSupport* google_protobuf_FieldOptions_FeatureSupport_parse_ex(const char* buf, size_t size,
9941 const upb_ExtensionRegistry* extreg,
9942 int options, upb_Arena* arena) {
9943 google_protobuf_FieldOptions_FeatureSupport* ret = google_protobuf_FieldOptions_FeatureSupport_new(arena);
9944 if (!ret) return NULL;
9945 if (upb_Decode(buf, size, UPB_UPCAST(ret), &google__protobuf__FieldOptions__FeatureSupport_msg_init, extreg, options,
9946 arena) != kUpb_DecodeStatus_Ok) {
9947 return NULL;
9948 }
9949 return ret;
9950}
9951UPB_INLINE char* google_protobuf_FieldOptions_FeatureSupport_serialize(const google_protobuf_FieldOptions_FeatureSupport* msg, upb_Arena* arena, size_t* len) {
9952 char* ptr;
9953 (void)upb_Encode(UPB_UPCAST(msg), &google__protobuf__FieldOptions__FeatureSupport_msg_init, 0, arena, &ptr, len);
9954 return ptr;
9955}
9956UPB_INLINE char* google_protobuf_FieldOptions_FeatureSupport_serialize_ex(const google_protobuf_FieldOptions_FeatureSupport* msg, int options,
9957 upb_Arena* arena, size_t* len) {
9958 char* ptr;
9959 (void)upb_Encode(UPB_UPCAST(msg), &google__protobuf__FieldOptions__FeatureSupport_msg_init, options, arena, &ptr, len);
9960 return ptr;
9961}
9962UPB_INLINE void google_protobuf_FieldOptions_FeatureSupport_clear_edition_introduced(google_protobuf_FieldOptions_FeatureSupport* msg) {
9963 const upb_MiniTableField field = {1, 12, 64, 0, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
9964 upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
9965}
9966UPB_INLINE int32_t google_protobuf_FieldOptions_FeatureSupport_edition_introduced(const google_protobuf_FieldOptions_FeatureSupport* msg) {
9967 int32_t default_val = 0;
9968 int32_t ret;
9969 const upb_MiniTableField field = {1, 12, 64, 0, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
9970 _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field,
9971 &default_val, &ret);
9972 return ret;
9973}
9974UPB_INLINE bool google_protobuf_FieldOptions_FeatureSupport_has_edition_introduced(const google_protobuf_FieldOptions_FeatureSupport* msg) {
9975 const upb_MiniTableField field = {1, 12, 64, 0, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
9976 return upb_Message_HasBaseField(UPB_UPCAST(msg), &field);
9977}
9978UPB_INLINE void google_protobuf_FieldOptions_FeatureSupport_clear_edition_deprecated(google_protobuf_FieldOptions_FeatureSupport* msg) {
9979 const upb_MiniTableField field = {2, 16, 65, 1, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
9980 upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
9981}
9982UPB_INLINE int32_t google_protobuf_FieldOptions_FeatureSupport_edition_deprecated(const google_protobuf_FieldOptions_FeatureSupport* msg) {
9983 int32_t default_val = 0;
9984 int32_t ret;
9985 const upb_MiniTableField field = {2, 16, 65, 1, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
9986 _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field,
9987 &default_val, &ret);
9988 return ret;
9989}
9990UPB_INLINE bool google_protobuf_FieldOptions_FeatureSupport_has_edition_deprecated(const google_protobuf_FieldOptions_FeatureSupport* msg) {
9991 const upb_MiniTableField field = {2, 16, 65, 1, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
9992 return upb_Message_HasBaseField(UPB_UPCAST(msg), &field);
9993}
9994UPB_INLINE void google_protobuf_FieldOptions_FeatureSupport_clear_deprecation_warning(google_protobuf_FieldOptions_FeatureSupport* msg) {
9995 const upb_MiniTableField field = {3, 24, 66, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
9996 upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
9997}
9998UPB_INLINE upb_StringView google_protobuf_FieldOptions_FeatureSupport_deprecation_warning(const google_protobuf_FieldOptions_FeatureSupport* msg) {
9999 upb_StringView default_val = upb_StringView_FromString("");
10000 upb_StringView ret;
10001 const upb_MiniTableField field = {3, 24, 66, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
10002 _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field,
10003 &default_val, &ret);
10004 return ret;
10005}
10006UPB_INLINE bool google_protobuf_FieldOptions_FeatureSupport_has_deprecation_warning(const google_protobuf_FieldOptions_FeatureSupport* msg) {
10007 const upb_MiniTableField field = {3, 24, 66, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
10008 return upb_Message_HasBaseField(UPB_UPCAST(msg), &field);
10009}
10010UPB_INLINE void google_protobuf_FieldOptions_FeatureSupport_clear_edition_removed(google_protobuf_FieldOptions_FeatureSupport* msg) {
10011 const upb_MiniTableField field = {4, 20, 67, 2, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
10012 upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
10013}
10014UPB_INLINE int32_t google_protobuf_FieldOptions_FeatureSupport_edition_removed(const google_protobuf_FieldOptions_FeatureSupport* msg) {
10015 int32_t default_val = 0;
10016 int32_t ret;
10017 const upb_MiniTableField field = {4, 20, 67, 2, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
10018 _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field,
10019 &default_val, &ret);
10020 return ret;
10021}
10022UPB_INLINE bool google_protobuf_FieldOptions_FeatureSupport_has_edition_removed(const google_protobuf_FieldOptions_FeatureSupport* msg) {
10023 const upb_MiniTableField field = {4, 20, 67, 2, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
10024 return upb_Message_HasBaseField(UPB_UPCAST(msg), &field);
10025}
10026
10027UPB_INLINE void google_protobuf_FieldOptions_FeatureSupport_set_edition_introduced(google_protobuf_FieldOptions_FeatureSupport *msg, int32_t value) {
10028 const upb_MiniTableField field = {1, 12, 64, 0, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
Protobuf Team Botac32c972024-04-10 03:30:05 +000010029 upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
Protobuf Team Bot85edb7e2024-04-03 02:43:54 +000010030}
10031UPB_INLINE void google_protobuf_FieldOptions_FeatureSupport_set_edition_deprecated(google_protobuf_FieldOptions_FeatureSupport *msg, int32_t value) {
10032 const upb_MiniTableField field = {2, 16, 65, 1, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
Protobuf Team Botac32c972024-04-10 03:30:05 +000010033 upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
Protobuf Team Bot85edb7e2024-04-03 02:43:54 +000010034}
10035UPB_INLINE void google_protobuf_FieldOptions_FeatureSupport_set_deprecation_warning(google_protobuf_FieldOptions_FeatureSupport *msg, upb_StringView value) {
10036 const upb_MiniTableField field = {3, 24, 66, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
Protobuf Team Botac32c972024-04-10 03:30:05 +000010037 upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
Protobuf Team Bot85edb7e2024-04-03 02:43:54 +000010038}
10039UPB_INLINE void google_protobuf_FieldOptions_FeatureSupport_set_edition_removed(google_protobuf_FieldOptions_FeatureSupport *msg, int32_t value) {
10040 const upb_MiniTableField field = {4, 20, 67, 2, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
Protobuf Team Botac32c972024-04-10 03:30:05 +000010041 upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
Protobuf Team Bot85edb7e2024-04-03 02:43:54 +000010042}
10043
Joshua Haberman9abf6e22021-01-13 12:16:25 -080010044/* google.protobuf.OneofOptions */
10045
Joshua Habermanf41049a2022-01-21 14:41:25 -080010046UPB_INLINE google_protobuf_OneofOptions* google_protobuf_OneofOptions_new(upb_Arena* arena) {
Protobuf Team Bot4ffe0862023-12-06 02:02:36 +000010047 return (google_protobuf_OneofOptions*)_upb_Message_New(&google__protobuf__OneofOptions_msg_init, arena);
Joshua Haberman9abf6e22021-01-13 12:16:25 -080010048}
Joshua Habermanf41049a2022-01-21 14:41:25 -080010049UPB_INLINE google_protobuf_OneofOptions* google_protobuf_OneofOptions_parse(const char* buf, size_t size, upb_Arena* arena) {
10050 google_protobuf_OneofOptions* ret = google_protobuf_OneofOptions_new(arena);
Joshua Haberman9d578a32021-08-02 15:32:01 -070010051 if (!ret) return NULL;
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +000010052 if (upb_Decode(buf, size, UPB_UPCAST(ret), &google__protobuf__OneofOptions_msg_init, NULL, 0, arena) !=
10053 kUpb_DecodeStatus_Ok) {
Joshua Haberman9d578a32021-08-02 15:32:01 -070010054 return NULL;
10055 }
10056 return ret;
Joshua Haberman9abf6e22021-01-13 12:16:25 -080010057}
Joshua Habermanf41049a2022-01-21 14:41:25 -080010058UPB_INLINE google_protobuf_OneofOptions* google_protobuf_OneofOptions_parse_ex(const char* buf, size_t size,
10059 const upb_ExtensionRegistry* extreg,
10060 int options, upb_Arena* arena) {
10061 google_protobuf_OneofOptions* ret = google_protobuf_OneofOptions_new(arena);
10062 if (!ret) return NULL;
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +000010063 if (upb_Decode(buf, size, UPB_UPCAST(ret), &google__protobuf__OneofOptions_msg_init, extreg, options,
10064 arena) != kUpb_DecodeStatus_Ok) {
Joshua Habermanf41049a2022-01-21 14:41:25 -080010065 return NULL;
10066 }
10067 return ret;
Joshua Haberman9abf6e22021-01-13 12:16:25 -080010068}
Joshua Habermanf41049a2022-01-21 14:41:25 -080010069UPB_INLINE char* google_protobuf_OneofOptions_serialize(const google_protobuf_OneofOptions* msg, upb_Arena* arena, size_t* len) {
Joshua Habermand3995ec2022-09-30 16:54:39 -070010070 char* ptr;
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +000010071 (void)upb_Encode(UPB_UPCAST(msg), &google__protobuf__OneofOptions_msg_init, 0, arena, &ptr, len);
Joshua Habermand3995ec2022-09-30 16:54:39 -070010072 return ptr;
Joshua Habermanf41049a2022-01-21 14:41:25 -080010073}
10074UPB_INLINE char* google_protobuf_OneofOptions_serialize_ex(const google_protobuf_OneofOptions* msg, int options,
10075 upb_Arena* arena, size_t* len) {
Joshua Habermand3995ec2022-09-30 16:54:39 -070010076 char* ptr;
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +000010077 (void)upb_Encode(UPB_UPCAST(msg), &google__protobuf__OneofOptions_msg_init, options, arena, &ptr, len);
Joshua Habermand3995ec2022-09-30 16:54:39 -070010078 return ptr;
Joshua Habermanf41049a2022-01-21 14:41:25 -080010079}
Mike Kruskal4f9e4172023-06-30 20:14:50 -070010080UPB_INLINE void google_protobuf_OneofOptions_clear_features(google_protobuf_OneofOptions* msg) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +000010081 const upb_MiniTableField field = {1, UPB_SIZE(12, 16), 64, 0, 11, (int)kUpb_FieldMode_Scalar | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
Protobuf Team Bot4e90ead2024-01-08 15:46:34 +000010082 upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
Mike Kruskal4f9e4172023-06-30 20:14:50 -070010083}
10084UPB_INLINE const google_protobuf_FeatureSet* google_protobuf_OneofOptions_features(const google_protobuf_OneofOptions* msg) {
10085 const google_protobuf_FeatureSet* default_val = NULL;
10086 const google_protobuf_FeatureSet* ret;
Protobuf Team Bot03440ec2024-01-11 23:13:19 +000010087 const upb_MiniTableField field = {1, UPB_SIZE(12, 16), 64, 0, 11, (int)kUpb_FieldMode_Scalar | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
Protobuf Team Bota9387b52024-06-12 15:17:52 +000010088 UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__FeatureSet_msg_init);
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +000010089 _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field,
10090 &default_val, &ret);
Mike Kruskal4f9e4172023-06-30 20:14:50 -070010091 return ret;
10092}
10093UPB_INLINE bool google_protobuf_OneofOptions_has_features(const google_protobuf_OneofOptions* msg) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +000010094 const upb_MiniTableField field = {1, UPB_SIZE(12, 16), 64, 0, 11, (int)kUpb_FieldMode_Scalar | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
Protobuf Team Bot8c1f6352024-01-10 05:18:15 +000010095 return upb_Message_HasBaseField(UPB_UPCAST(msg), &field);
Mike Kruskal4f9e4172023-06-30 20:14:50 -070010096}
Mike Kruskal3bc50492022-12-01 13:34:12 -080010097UPB_INLINE void google_protobuf_OneofOptions_clear_uninterpreted_option(google_protobuf_OneofOptions* msg) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +000010098 const upb_MiniTableField field = {999, UPB_SIZE(16, 24), 0, 1, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
Protobuf Team Bot4e90ead2024-01-08 15:46:34 +000010099 upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
Joshua Habermand3995ec2022-09-30 16:54:39 -070010100}
Eric Salob7d54ac2022-12-29 11:59:42 -080010101UPB_INLINE const google_protobuf_UninterpretedOption* const* google_protobuf_OneofOptions_uninterpreted_option(const google_protobuf_OneofOptions* msg, size_t* size) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +000010102 const upb_MiniTableField field = {999, UPB_SIZE(16, 24), 0, 1, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
Protobuf Team Bota9387b52024-06-12 15:17:52 +000010103 UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__UninterpretedOption_msg_init);
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +000010104 const upb_Array* arr = upb_Message_GetArray(UPB_UPCAST(msg), &field);
Eric Salob7d54ac2022-12-29 11:59:42 -080010105 if (arr) {
Protobuf Team Botf73985a2023-12-19 00:14:19 +000010106 if (size) *size = arr->UPB_PRIVATE(size);
Protobuf Team Bot81e54332024-01-11 21:04:07 +000010107 return (const google_protobuf_UninterpretedOption* const*)upb_Array_DataPtr(arr);
Eric Salob7d54ac2022-12-29 11:59:42 -080010108 } else {
10109 if (size) *size = 0;
10110 return NULL;
10111 }
Joshua Haberman7ecf43f2022-03-14 13:11:29 -070010112}
Deanna Garciab26afb52023-04-25 13:37:18 -070010113UPB_INLINE const upb_Array* _google_protobuf_OneofOptions_uninterpreted_option_upb_array(const google_protobuf_OneofOptions* msg, size_t* size) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +000010114 const upb_MiniTableField field = {999, UPB_SIZE(16, 24), 0, 1, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
Protobuf Team Bota9387b52024-06-12 15:17:52 +000010115 UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__UninterpretedOption_msg_init);
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +000010116 const upb_Array* arr = upb_Message_GetArray(UPB_UPCAST(msg), &field);
Deanna Garciab26afb52023-04-25 13:37:18 -070010117 if (size) {
Protobuf Team Botf73985a2023-12-19 00:14:19 +000010118 *size = arr ? arr->UPB_PRIVATE(size) : 0;
Deanna Garciab26afb52023-04-25 13:37:18 -070010119 }
10120 return arr;
10121}
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +000010122UPB_INLINE upb_Array* _google_protobuf_OneofOptions_uninterpreted_option_mutable_upb_array(google_protobuf_OneofOptions* msg, size_t* size, upb_Arena* arena) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +000010123 const upb_MiniTableField field = {999, UPB_SIZE(16, 24), 0, 1, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
Protobuf Team Bota9387b52024-06-12 15:17:52 +000010124 UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__UninterpretedOption_msg_init);
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +000010125 upb_Array* arr = upb_Message_GetOrCreateMutableArray(UPB_UPCAST(msg),
10126 &field, arena);
Deanna Garciab26afb52023-04-25 13:37:18 -070010127 if (size) {
Protobuf Team Botf73985a2023-12-19 00:14:19 +000010128 *size = arr ? arr->UPB_PRIVATE(size) : 0;
Deanna Garciab26afb52023-04-25 13:37:18 -070010129 }
10130 return arr;
10131}
Joshua Haberman9abf6e22021-01-13 12:16:25 -080010132
Mike Kruskal4f9e4172023-06-30 20:14:50 -070010133UPB_INLINE void google_protobuf_OneofOptions_set_features(google_protobuf_OneofOptions *msg, google_protobuf_FeatureSet* value) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +000010134 const upb_MiniTableField field = {1, UPB_SIZE(12, 16), 64, 0, 11, (int)kUpb_FieldMode_Scalar | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
Protobuf Team Bota9387b52024-06-12 15:17:52 +000010135 UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__FeatureSet_msg_init);
Protobuf Team Botac32c972024-04-10 03:30:05 +000010136 upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
Mike Kruskal4f9e4172023-06-30 20:14:50 -070010137}
10138UPB_INLINE struct google_protobuf_FeatureSet* google_protobuf_OneofOptions_mutable_features(google_protobuf_OneofOptions* msg, upb_Arena* arena) {
10139 struct google_protobuf_FeatureSet* sub = (struct google_protobuf_FeatureSet*)google_protobuf_OneofOptions_features(msg);
10140 if (sub == NULL) {
Protobuf Team Bot4ffe0862023-12-06 02:02:36 +000010141 sub = (struct google_protobuf_FeatureSet*)_upb_Message_New(&google__protobuf__FeatureSet_msg_init, arena);
Mike Kruskal4f9e4172023-06-30 20:14:50 -070010142 if (sub) google_protobuf_OneofOptions_set_features(msg, sub);
10143 }
10144 return sub;
10145}
Eric Salob7d54ac2022-12-29 11:59:42 -080010146UPB_INLINE google_protobuf_UninterpretedOption** google_protobuf_OneofOptions_mutable_uninterpreted_option(google_protobuf_OneofOptions* msg, size_t* size) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +000010147 upb_MiniTableField field = {999, UPB_SIZE(16, 24), 0, 1, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
Protobuf Team Bota9387b52024-06-12 15:17:52 +000010148 UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__UninterpretedOption_msg_init);
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +000010149 upb_Array* arr = upb_Message_GetMutableArray(UPB_UPCAST(msg), &field);
Eric Salob7d54ac2022-12-29 11:59:42 -080010150 if (arr) {
Protobuf Team Botf73985a2023-12-19 00:14:19 +000010151 if (size) *size = arr->UPB_PRIVATE(size);
Protobuf Team Bot81e54332024-01-11 21:04:07 +000010152 return (google_protobuf_UninterpretedOption**)upb_Array_MutableDataPtr(arr);
Eric Salob7d54ac2022-12-29 11:59:42 -080010153 } else {
10154 if (size) *size = 0;
10155 return NULL;
10156 }
Joshua Haberman9abf6e22021-01-13 12:16:25 -080010157}
Eric Salob7d54ac2022-12-29 11:59:42 -080010158UPB_INLINE google_protobuf_UninterpretedOption** google_protobuf_OneofOptions_resize_uninterpreted_option(google_protobuf_OneofOptions* msg, size_t size, upb_Arena* arena) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +000010159 upb_MiniTableField field = {999, UPB_SIZE(16, 24), 0, 1, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +000010160 return (google_protobuf_UninterpretedOption**)upb_Message_ResizeArrayUninitialized(UPB_UPCAST(msg),
10161 &field, size, arena);
Joshua Haberman9abf6e22021-01-13 12:16:25 -080010162}
Joshua Haberman7ecf43f2022-03-14 13:11:29 -070010163UPB_INLINE struct google_protobuf_UninterpretedOption* google_protobuf_OneofOptions_add_uninterpreted_option(google_protobuf_OneofOptions* msg, upb_Arena* arena) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +000010164 upb_MiniTableField field = {999, UPB_SIZE(16, 24), 0, 1, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
Protobuf Team Bota9387b52024-06-12 15:17:52 +000010165 UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__UninterpretedOption_msg_init);
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +000010166 upb_Array* arr = upb_Message_GetOrCreateMutableArray(
10167 UPB_UPCAST(msg), &field, arena);
Protobuf Team Bot81e54332024-01-11 21:04:07 +000010168 if (!arr || !UPB_PRIVATE(_upb_Array_ResizeUninitialized)(
Protobuf Team Botf73985a2023-12-19 00:14:19 +000010169 arr, arr->UPB_PRIVATE(size) + 1, arena)) {
Eric Salob7d54ac2022-12-29 11:59:42 -080010170 return NULL;
10171 }
Protobuf Team Bot4ffe0862023-12-06 02:02:36 +000010172 struct google_protobuf_UninterpretedOption* sub = (struct google_protobuf_UninterpretedOption*)_upb_Message_New(&google__protobuf__UninterpretedOption_msg_init, arena);
Eric Salob7d54ac2022-12-29 11:59:42 -080010173 if (!arr || !sub) return NULL;
Protobuf Team Botf73985a2023-12-19 00:14:19 +000010174 UPB_PRIVATE(_upb_Array_Set)
10175 (arr, arr->UPB_PRIVATE(size) - 1, &sub, sizeof(sub));
Joshua Haberman9abf6e22021-01-13 12:16:25 -080010176 return sub;
10177}
10178
10179/* google.protobuf.EnumOptions */
10180
Joshua Habermanf41049a2022-01-21 14:41:25 -080010181UPB_INLINE google_protobuf_EnumOptions* google_protobuf_EnumOptions_new(upb_Arena* arena) {
Protobuf Team Bot4ffe0862023-12-06 02:02:36 +000010182 return (google_protobuf_EnumOptions*)_upb_Message_New(&google__protobuf__EnumOptions_msg_init, arena);
Joshua Haberman9abf6e22021-01-13 12:16:25 -080010183}
Joshua Habermanf41049a2022-01-21 14:41:25 -080010184UPB_INLINE google_protobuf_EnumOptions* google_protobuf_EnumOptions_parse(const char* buf, size_t size, upb_Arena* arena) {
10185 google_protobuf_EnumOptions* ret = google_protobuf_EnumOptions_new(arena);
Joshua Haberman9d578a32021-08-02 15:32:01 -070010186 if (!ret) return NULL;
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +000010187 if (upb_Decode(buf, size, UPB_UPCAST(ret), &google__protobuf__EnumOptions_msg_init, NULL, 0, arena) !=
10188 kUpb_DecodeStatus_Ok) {
Joshua Haberman9d578a32021-08-02 15:32:01 -070010189 return NULL;
10190 }
10191 return ret;
Joshua Haberman9abf6e22021-01-13 12:16:25 -080010192}
Joshua Habermanf41049a2022-01-21 14:41:25 -080010193UPB_INLINE google_protobuf_EnumOptions* google_protobuf_EnumOptions_parse_ex(const char* buf, size_t size,
10194 const upb_ExtensionRegistry* extreg,
10195 int options, upb_Arena* arena) {
10196 google_protobuf_EnumOptions* ret = google_protobuf_EnumOptions_new(arena);
10197 if (!ret) return NULL;
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +000010198 if (upb_Decode(buf, size, UPB_UPCAST(ret), &google__protobuf__EnumOptions_msg_init, extreg, options,
10199 arena) != kUpb_DecodeStatus_Ok) {
Joshua Habermanf41049a2022-01-21 14:41:25 -080010200 return NULL;
10201 }
10202 return ret;
Joshua Haberman9abf6e22021-01-13 12:16:25 -080010203}
Joshua Habermanf41049a2022-01-21 14:41:25 -080010204UPB_INLINE char* google_protobuf_EnumOptions_serialize(const google_protobuf_EnumOptions* msg, upb_Arena* arena, size_t* len) {
Joshua Habermand3995ec2022-09-30 16:54:39 -070010205 char* ptr;
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +000010206 (void)upb_Encode(UPB_UPCAST(msg), &google__protobuf__EnumOptions_msg_init, 0, arena, &ptr, len);
Joshua Habermand3995ec2022-09-30 16:54:39 -070010207 return ptr;
Joshua Habermanf41049a2022-01-21 14:41:25 -080010208}
10209UPB_INLINE char* google_protobuf_EnumOptions_serialize_ex(const google_protobuf_EnumOptions* msg, int options,
10210 upb_Arena* arena, size_t* len) {
Joshua Habermand3995ec2022-09-30 16:54:39 -070010211 char* ptr;
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +000010212 (void)upb_Encode(UPB_UPCAST(msg), &google__protobuf__EnumOptions_msg_init, options, arena, &ptr, len);
Joshua Habermand3995ec2022-09-30 16:54:39 -070010213 return ptr;
Joshua Habermanf41049a2022-01-21 14:41:25 -080010214}
Mike Kruskal3bc50492022-12-01 13:34:12 -080010215UPB_INLINE void google_protobuf_EnumOptions_clear_allow_alias(google_protobuf_EnumOptions* msg) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +000010216 const upb_MiniTableField field = {2, 9, 64, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
Protobuf Team Bot4e90ead2024-01-08 15:46:34 +000010217 upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
Joshua Habermand3995ec2022-09-30 16:54:39 -070010218}
Joshua Habermanf41049a2022-01-21 14:41:25 -080010219UPB_INLINE bool google_protobuf_EnumOptions_allow_alias(const google_protobuf_EnumOptions* msg) {
Eric Salo8809a112022-11-21 13:01:06 -080010220 bool default_val = false;
10221 bool ret;
Protobuf Team Bot03440ec2024-01-11 23:13:19 +000010222 const upb_MiniTableField field = {2, 9, 64, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +000010223 _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field,
10224 &default_val, &ret);
Eric Salo8809a112022-11-21 13:01:06 -080010225 return ret;
Joshua Habermanf41049a2022-01-21 14:41:25 -080010226}
Mike Kruskal3bc50492022-12-01 13:34:12 -080010227UPB_INLINE bool google_protobuf_EnumOptions_has_allow_alias(const google_protobuf_EnumOptions* msg) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +000010228 const upb_MiniTableField field = {2, 9, 64, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
Protobuf Team Bot8c1f6352024-01-10 05:18:15 +000010229 return upb_Message_HasBaseField(UPB_UPCAST(msg), &field);
Joshua Haberman7ecf43f2022-03-14 13:11:29 -070010230}
Mike Kruskal3bc50492022-12-01 13:34:12 -080010231UPB_INLINE void google_protobuf_EnumOptions_clear_deprecated(google_protobuf_EnumOptions* msg) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +000010232 const upb_MiniTableField field = {3, 10, 65, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
Protobuf Team Bot4e90ead2024-01-08 15:46:34 +000010233 upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
Joshua Habermand3995ec2022-09-30 16:54:39 -070010234}
Joshua Habermanf41049a2022-01-21 14:41:25 -080010235UPB_INLINE bool google_protobuf_EnumOptions_deprecated(const google_protobuf_EnumOptions* msg) {
Eric Salo8809a112022-11-21 13:01:06 -080010236 bool default_val = false;
10237 bool ret;
Protobuf Team Bot03440ec2024-01-11 23:13:19 +000010238 const upb_MiniTableField field = {3, 10, 65, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +000010239 _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field,
10240 &default_val, &ret);
Eric Salo8809a112022-11-21 13:01:06 -080010241 return ret;
Joshua Habermanf41049a2022-01-21 14:41:25 -080010242}
Mike Kruskal3bc50492022-12-01 13:34:12 -080010243UPB_INLINE bool google_protobuf_EnumOptions_has_deprecated(const google_protobuf_EnumOptions* msg) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +000010244 const upb_MiniTableField field = {3, 10, 65, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
Protobuf Team Bot8c1f6352024-01-10 05:18:15 +000010245 return upb_Message_HasBaseField(UPB_UPCAST(msg), &field);
Joshua Haberman7ecf43f2022-03-14 13:11:29 -070010246}
Mike Kruskal6b87d6f2022-12-14 10:36:53 -080010247UPB_INLINE void google_protobuf_EnumOptions_clear_deprecated_legacy_json_field_conflicts(google_protobuf_EnumOptions* msg) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +000010248 const upb_MiniTableField field = {6, 11, 66, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
Protobuf Team Bot4e90ead2024-01-08 15:46:34 +000010249 upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
Mike Kruskal6b87d6f2022-12-14 10:36:53 -080010250}
10251UPB_INLINE bool google_protobuf_EnumOptions_deprecated_legacy_json_field_conflicts(const google_protobuf_EnumOptions* msg) {
10252 bool default_val = false;
10253 bool ret;
Protobuf Team Bot03440ec2024-01-11 23:13:19 +000010254 const upb_MiniTableField field = {6, 11, 66, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +000010255 _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field,
10256 &default_val, &ret);
Mike Kruskal6b87d6f2022-12-14 10:36:53 -080010257 return ret;
10258}
10259UPB_INLINE bool google_protobuf_EnumOptions_has_deprecated_legacy_json_field_conflicts(const google_protobuf_EnumOptions* msg) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +000010260 const upb_MiniTableField field = {6, 11, 66, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
Protobuf Team Bot8c1f6352024-01-10 05:18:15 +000010261 return upb_Message_HasBaseField(UPB_UPCAST(msg), &field);
Mike Kruskal6b87d6f2022-12-14 10:36:53 -080010262}
Mike Kruskal4f9e4172023-06-30 20:14:50 -070010263UPB_INLINE void google_protobuf_EnumOptions_clear_features(google_protobuf_EnumOptions* msg) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +000010264 const upb_MiniTableField field = {7, UPB_SIZE(12, 16), 67, 0, 11, (int)kUpb_FieldMode_Scalar | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
Protobuf Team Bot4e90ead2024-01-08 15:46:34 +000010265 upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
Mike Kruskal4f9e4172023-06-30 20:14:50 -070010266}
10267UPB_INLINE const google_protobuf_FeatureSet* google_protobuf_EnumOptions_features(const google_protobuf_EnumOptions* msg) {
10268 const google_protobuf_FeatureSet* default_val = NULL;
10269 const google_protobuf_FeatureSet* ret;
Protobuf Team Bot03440ec2024-01-11 23:13:19 +000010270 const upb_MiniTableField field = {7, UPB_SIZE(12, 16), 67, 0, 11, (int)kUpb_FieldMode_Scalar | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
Protobuf Team Bota9387b52024-06-12 15:17:52 +000010271 UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__FeatureSet_msg_init);
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +000010272 _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field,
10273 &default_val, &ret);
Mike Kruskal4f9e4172023-06-30 20:14:50 -070010274 return ret;
10275}
10276UPB_INLINE bool google_protobuf_EnumOptions_has_features(const google_protobuf_EnumOptions* msg) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +000010277 const upb_MiniTableField field = {7, UPB_SIZE(12, 16), 67, 0, 11, (int)kUpb_FieldMode_Scalar | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
Protobuf Team Bot8c1f6352024-01-10 05:18:15 +000010278 return upb_Message_HasBaseField(UPB_UPCAST(msg), &field);
Mike Kruskal4f9e4172023-06-30 20:14:50 -070010279}
Mike Kruskal3bc50492022-12-01 13:34:12 -080010280UPB_INLINE void google_protobuf_EnumOptions_clear_uninterpreted_option(google_protobuf_EnumOptions* msg) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +000010281 const upb_MiniTableField field = {999, UPB_SIZE(16, 24), 0, 1, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
Protobuf Team Bot4e90ead2024-01-08 15:46:34 +000010282 upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
Joshua Habermand3995ec2022-09-30 16:54:39 -070010283}
Eric Salob7d54ac2022-12-29 11:59:42 -080010284UPB_INLINE const google_protobuf_UninterpretedOption* const* google_protobuf_EnumOptions_uninterpreted_option(const google_protobuf_EnumOptions* msg, size_t* size) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +000010285 const upb_MiniTableField field = {999, UPB_SIZE(16, 24), 0, 1, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
Protobuf Team Bota9387b52024-06-12 15:17:52 +000010286 UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__UninterpretedOption_msg_init);
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +000010287 const upb_Array* arr = upb_Message_GetArray(UPB_UPCAST(msg), &field);
Eric Salob7d54ac2022-12-29 11:59:42 -080010288 if (arr) {
Protobuf Team Botf73985a2023-12-19 00:14:19 +000010289 if (size) *size = arr->UPB_PRIVATE(size);
Protobuf Team Bot81e54332024-01-11 21:04:07 +000010290 return (const google_protobuf_UninterpretedOption* const*)upb_Array_DataPtr(arr);
Eric Salob7d54ac2022-12-29 11:59:42 -080010291 } else {
10292 if (size) *size = 0;
10293 return NULL;
10294 }
Joshua Haberman7ecf43f2022-03-14 13:11:29 -070010295}
Deanna Garciab26afb52023-04-25 13:37:18 -070010296UPB_INLINE const upb_Array* _google_protobuf_EnumOptions_uninterpreted_option_upb_array(const google_protobuf_EnumOptions* msg, size_t* size) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +000010297 const upb_MiniTableField field = {999, UPB_SIZE(16, 24), 0, 1, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
Protobuf Team Bota9387b52024-06-12 15:17:52 +000010298 UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__UninterpretedOption_msg_init);
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +000010299 const upb_Array* arr = upb_Message_GetArray(UPB_UPCAST(msg), &field);
Deanna Garciab26afb52023-04-25 13:37:18 -070010300 if (size) {
Protobuf Team Botf73985a2023-12-19 00:14:19 +000010301 *size = arr ? arr->UPB_PRIVATE(size) : 0;
Deanna Garciab26afb52023-04-25 13:37:18 -070010302 }
10303 return arr;
10304}
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +000010305UPB_INLINE upb_Array* _google_protobuf_EnumOptions_uninterpreted_option_mutable_upb_array(google_protobuf_EnumOptions* msg, size_t* size, upb_Arena* arena) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +000010306 const upb_MiniTableField field = {999, UPB_SIZE(16, 24), 0, 1, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
Protobuf Team Bota9387b52024-06-12 15:17:52 +000010307 UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__UninterpretedOption_msg_init);
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +000010308 upb_Array* arr = upb_Message_GetOrCreateMutableArray(UPB_UPCAST(msg),
10309 &field, arena);
Deanna Garciab26afb52023-04-25 13:37:18 -070010310 if (size) {
Protobuf Team Botf73985a2023-12-19 00:14:19 +000010311 *size = arr ? arr->UPB_PRIVATE(size) : 0;
Deanna Garciab26afb52023-04-25 13:37:18 -070010312 }
10313 return arr;
10314}
Joshua Haberman9abf6e22021-01-13 12:16:25 -080010315
10316UPB_INLINE void google_protobuf_EnumOptions_set_allow_alias(google_protobuf_EnumOptions *msg, bool value) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +000010317 const upb_MiniTableField field = {2, 9, 64, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
Protobuf Team Botac32c972024-04-10 03:30:05 +000010318 upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
Mike Kruskal232ecf42023-01-14 00:09:40 -080010319}
10320UPB_INLINE void google_protobuf_EnumOptions_set_deprecated(google_protobuf_EnumOptions *msg, bool value) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +000010321 const upb_MiniTableField field = {3, 10, 65, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
Protobuf Team Botac32c972024-04-10 03:30:05 +000010322 upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
Mike Kruskal232ecf42023-01-14 00:09:40 -080010323}
10324UPB_INLINE void google_protobuf_EnumOptions_set_deprecated_legacy_json_field_conflicts(google_protobuf_EnumOptions *msg, bool value) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +000010325 const upb_MiniTableField field = {6, 11, 66, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
Protobuf Team Botac32c972024-04-10 03:30:05 +000010326 upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
Mike Kruskal232ecf42023-01-14 00:09:40 -080010327}
Mike Kruskal4f9e4172023-06-30 20:14:50 -070010328UPB_INLINE void google_protobuf_EnumOptions_set_features(google_protobuf_EnumOptions *msg, google_protobuf_FeatureSet* value) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +000010329 const upb_MiniTableField field = {7, UPB_SIZE(12, 16), 67, 0, 11, (int)kUpb_FieldMode_Scalar | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
Protobuf Team Bota9387b52024-06-12 15:17:52 +000010330 UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__FeatureSet_msg_init);
Protobuf Team Botac32c972024-04-10 03:30:05 +000010331 upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
Mike Kruskal4f9e4172023-06-30 20:14:50 -070010332}
10333UPB_INLINE struct google_protobuf_FeatureSet* google_protobuf_EnumOptions_mutable_features(google_protobuf_EnumOptions* msg, upb_Arena* arena) {
10334 struct google_protobuf_FeatureSet* sub = (struct google_protobuf_FeatureSet*)google_protobuf_EnumOptions_features(msg);
10335 if (sub == NULL) {
Protobuf Team Bot4ffe0862023-12-06 02:02:36 +000010336 sub = (struct google_protobuf_FeatureSet*)_upb_Message_New(&google__protobuf__FeatureSet_msg_init, arena);
Mike Kruskal4f9e4172023-06-30 20:14:50 -070010337 if (sub) google_protobuf_EnumOptions_set_features(msg, sub);
10338 }
10339 return sub;
10340}
Mike Kruskal232ecf42023-01-14 00:09:40 -080010341UPB_INLINE google_protobuf_UninterpretedOption** google_protobuf_EnumOptions_mutable_uninterpreted_option(google_protobuf_EnumOptions* msg, size_t* size) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +000010342 upb_MiniTableField field = {999, UPB_SIZE(16, 24), 0, 1, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
Protobuf Team Bota9387b52024-06-12 15:17:52 +000010343 UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__UninterpretedOption_msg_init);
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +000010344 upb_Array* arr = upb_Message_GetMutableArray(UPB_UPCAST(msg), &field);
Eric Salob7d54ac2022-12-29 11:59:42 -080010345 if (arr) {
Protobuf Team Botf73985a2023-12-19 00:14:19 +000010346 if (size) *size = arr->UPB_PRIVATE(size);
Protobuf Team Bot81e54332024-01-11 21:04:07 +000010347 return (google_protobuf_UninterpretedOption**)upb_Array_MutableDataPtr(arr);
Eric Salob7d54ac2022-12-29 11:59:42 -080010348 } else {
10349 if (size) *size = 0;
10350 return NULL;
10351 }
Joshua Haberman9abf6e22021-01-13 12:16:25 -080010352}
Eric Salob7d54ac2022-12-29 11:59:42 -080010353UPB_INLINE google_protobuf_UninterpretedOption** google_protobuf_EnumOptions_resize_uninterpreted_option(google_protobuf_EnumOptions* msg, size_t size, upb_Arena* arena) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +000010354 upb_MiniTableField field = {999, UPB_SIZE(16, 24), 0, 1, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +000010355 return (google_protobuf_UninterpretedOption**)upb_Message_ResizeArrayUninitialized(UPB_UPCAST(msg),
10356 &field, size, arena);
Joshua Haberman9abf6e22021-01-13 12:16:25 -080010357}
Joshua Haberman7ecf43f2022-03-14 13:11:29 -070010358UPB_INLINE struct google_protobuf_UninterpretedOption* google_protobuf_EnumOptions_add_uninterpreted_option(google_protobuf_EnumOptions* msg, upb_Arena* arena) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +000010359 upb_MiniTableField field = {999, UPB_SIZE(16, 24), 0, 1, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
Protobuf Team Bota9387b52024-06-12 15:17:52 +000010360 UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__UninterpretedOption_msg_init);
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +000010361 upb_Array* arr = upb_Message_GetOrCreateMutableArray(
10362 UPB_UPCAST(msg), &field, arena);
Protobuf Team Bot81e54332024-01-11 21:04:07 +000010363 if (!arr || !UPB_PRIVATE(_upb_Array_ResizeUninitialized)(
Protobuf Team Botf73985a2023-12-19 00:14:19 +000010364 arr, arr->UPB_PRIVATE(size) + 1, arena)) {
Eric Salob7d54ac2022-12-29 11:59:42 -080010365 return NULL;
10366 }
Protobuf Team Bot4ffe0862023-12-06 02:02:36 +000010367 struct google_protobuf_UninterpretedOption* sub = (struct google_protobuf_UninterpretedOption*)_upb_Message_New(&google__protobuf__UninterpretedOption_msg_init, arena);
Eric Salob7d54ac2022-12-29 11:59:42 -080010368 if (!arr || !sub) return NULL;
Protobuf Team Botf73985a2023-12-19 00:14:19 +000010369 UPB_PRIVATE(_upb_Array_Set)
10370 (arr, arr->UPB_PRIVATE(size) - 1, &sub, sizeof(sub));
Joshua Haberman9abf6e22021-01-13 12:16:25 -080010371 return sub;
10372}
10373
10374/* google.protobuf.EnumValueOptions */
10375
Joshua Habermanf41049a2022-01-21 14:41:25 -080010376UPB_INLINE google_protobuf_EnumValueOptions* google_protobuf_EnumValueOptions_new(upb_Arena* arena) {
Protobuf Team Bot4ffe0862023-12-06 02:02:36 +000010377 return (google_protobuf_EnumValueOptions*)_upb_Message_New(&google__protobuf__EnumValueOptions_msg_init, arena);
Joshua Haberman9abf6e22021-01-13 12:16:25 -080010378}
Joshua Habermanf41049a2022-01-21 14:41:25 -080010379UPB_INLINE google_protobuf_EnumValueOptions* google_protobuf_EnumValueOptions_parse(const char* buf, size_t size, upb_Arena* arena) {
10380 google_protobuf_EnumValueOptions* ret = google_protobuf_EnumValueOptions_new(arena);
Joshua Haberman9d578a32021-08-02 15:32:01 -070010381 if (!ret) return NULL;
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +000010382 if (upb_Decode(buf, size, UPB_UPCAST(ret), &google__protobuf__EnumValueOptions_msg_init, NULL, 0, arena) !=
10383 kUpb_DecodeStatus_Ok) {
Joshua Haberman9d578a32021-08-02 15:32:01 -070010384 return NULL;
10385 }
10386 return ret;
Joshua Haberman9abf6e22021-01-13 12:16:25 -080010387}
Joshua Habermanf41049a2022-01-21 14:41:25 -080010388UPB_INLINE google_protobuf_EnumValueOptions* google_protobuf_EnumValueOptions_parse_ex(const char* buf, size_t size,
10389 const upb_ExtensionRegistry* extreg,
10390 int options, upb_Arena* arena) {
10391 google_protobuf_EnumValueOptions* ret = google_protobuf_EnumValueOptions_new(arena);
10392 if (!ret) return NULL;
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +000010393 if (upb_Decode(buf, size, UPB_UPCAST(ret), &google__protobuf__EnumValueOptions_msg_init, extreg, options,
10394 arena) != kUpb_DecodeStatus_Ok) {
Joshua Habermanf41049a2022-01-21 14:41:25 -080010395 return NULL;
10396 }
10397 return ret;
Joshua Haberman9abf6e22021-01-13 12:16:25 -080010398}
Joshua Habermanf41049a2022-01-21 14:41:25 -080010399UPB_INLINE char* google_protobuf_EnumValueOptions_serialize(const google_protobuf_EnumValueOptions* msg, upb_Arena* arena, size_t* len) {
Joshua Habermand3995ec2022-09-30 16:54:39 -070010400 char* ptr;
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +000010401 (void)upb_Encode(UPB_UPCAST(msg), &google__protobuf__EnumValueOptions_msg_init, 0, arena, &ptr, len);
Joshua Habermand3995ec2022-09-30 16:54:39 -070010402 return ptr;
Joshua Habermanf41049a2022-01-21 14:41:25 -080010403}
10404UPB_INLINE char* google_protobuf_EnumValueOptions_serialize_ex(const google_protobuf_EnumValueOptions* msg, int options,
10405 upb_Arena* arena, size_t* len) {
Joshua Habermand3995ec2022-09-30 16:54:39 -070010406 char* ptr;
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +000010407 (void)upb_Encode(UPB_UPCAST(msg), &google__protobuf__EnumValueOptions_msg_init, options, arena, &ptr, len);
Joshua Habermand3995ec2022-09-30 16:54:39 -070010408 return ptr;
Joshua Habermanf41049a2022-01-21 14:41:25 -080010409}
Mike Kruskal3bc50492022-12-01 13:34:12 -080010410UPB_INLINE void google_protobuf_EnumValueOptions_clear_deprecated(google_protobuf_EnumValueOptions* msg) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +000010411 const upb_MiniTableField field = {1, 9, 64, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
Protobuf Team Bot4e90ead2024-01-08 15:46:34 +000010412 upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
Joshua Habermand3995ec2022-09-30 16:54:39 -070010413}
Joshua Habermanf41049a2022-01-21 14:41:25 -080010414UPB_INLINE bool google_protobuf_EnumValueOptions_deprecated(const google_protobuf_EnumValueOptions* msg) {
Eric Salo8809a112022-11-21 13:01:06 -080010415 bool default_val = false;
10416 bool ret;
Protobuf Team Bot03440ec2024-01-11 23:13:19 +000010417 const upb_MiniTableField field = {1, 9, 64, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +000010418 _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field,
10419 &default_val, &ret);
Eric Salo8809a112022-11-21 13:01:06 -080010420 return ret;
Joshua Habermanf41049a2022-01-21 14:41:25 -080010421}
Mike Kruskal3bc50492022-12-01 13:34:12 -080010422UPB_INLINE bool google_protobuf_EnumValueOptions_has_deprecated(const google_protobuf_EnumValueOptions* msg) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +000010423 const upb_MiniTableField field = {1, 9, 64, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
Protobuf Team Bot8c1f6352024-01-10 05:18:15 +000010424 return upb_Message_HasBaseField(UPB_UPCAST(msg), &field);
Joshua Haberman7ecf43f2022-03-14 13:11:29 -070010425}
Mike Kruskal4f9e4172023-06-30 20:14:50 -070010426UPB_INLINE void google_protobuf_EnumValueOptions_clear_features(google_protobuf_EnumValueOptions* msg) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +000010427 const upb_MiniTableField field = {2, UPB_SIZE(12, 16), 65, 0, 11, (int)kUpb_FieldMode_Scalar | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
Protobuf Team Bot4e90ead2024-01-08 15:46:34 +000010428 upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
Mike Kruskal4f9e4172023-06-30 20:14:50 -070010429}
10430UPB_INLINE const google_protobuf_FeatureSet* google_protobuf_EnumValueOptions_features(const google_protobuf_EnumValueOptions* msg) {
10431 const google_protobuf_FeatureSet* default_val = NULL;
10432 const google_protobuf_FeatureSet* ret;
Protobuf Team Bot03440ec2024-01-11 23:13:19 +000010433 const upb_MiniTableField field = {2, UPB_SIZE(12, 16), 65, 0, 11, (int)kUpb_FieldMode_Scalar | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
Protobuf Team Bota9387b52024-06-12 15:17:52 +000010434 UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__FeatureSet_msg_init);
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +000010435 _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field,
10436 &default_val, &ret);
Mike Kruskal4f9e4172023-06-30 20:14:50 -070010437 return ret;
10438}
10439UPB_INLINE bool google_protobuf_EnumValueOptions_has_features(const google_protobuf_EnumValueOptions* msg) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +000010440 const upb_MiniTableField field = {2, UPB_SIZE(12, 16), 65, 0, 11, (int)kUpb_FieldMode_Scalar | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
Protobuf Team Bot8c1f6352024-01-10 05:18:15 +000010441 return upb_Message_HasBaseField(UPB_UPCAST(msg), &field);
Mike Kruskal4f9e4172023-06-30 20:14:50 -070010442}
Mike Kruskal12e0f1d2023-05-31 15:40:54 -070010443UPB_INLINE void google_protobuf_EnumValueOptions_clear_debug_redact(google_protobuf_EnumValueOptions* msg) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +000010444 const upb_MiniTableField field = {3, UPB_SIZE(16, 10), 66, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
Protobuf Team Bot4e90ead2024-01-08 15:46:34 +000010445 upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
Mike Kruskal12e0f1d2023-05-31 15:40:54 -070010446}
10447UPB_INLINE bool google_protobuf_EnumValueOptions_debug_redact(const google_protobuf_EnumValueOptions* msg) {
10448 bool default_val = false;
10449 bool ret;
Protobuf Team Bot03440ec2024-01-11 23:13:19 +000010450 const upb_MiniTableField field = {3, UPB_SIZE(16, 10), 66, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +000010451 _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field,
10452 &default_val, &ret);
Mike Kruskal12e0f1d2023-05-31 15:40:54 -070010453 return ret;
10454}
10455UPB_INLINE bool google_protobuf_EnumValueOptions_has_debug_redact(const google_protobuf_EnumValueOptions* msg) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +000010456 const upb_MiniTableField field = {3, UPB_SIZE(16, 10), 66, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
Protobuf Team Bot8c1f6352024-01-10 05:18:15 +000010457 return upb_Message_HasBaseField(UPB_UPCAST(msg), &field);
Mike Kruskal12e0f1d2023-05-31 15:40:54 -070010458}
Protobuf Team Bot2e9c0a72024-05-21 23:17:21 +000010459UPB_INLINE void google_protobuf_EnumValueOptions_clear_feature_support(google_protobuf_EnumValueOptions* msg) {
10460 const upb_MiniTableField field = {4, UPB_SIZE(20, 24), 67, 1, 11, (int)kUpb_FieldMode_Scalar | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
10461 upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
10462}
10463UPB_INLINE const google_protobuf_FieldOptions_FeatureSupport* google_protobuf_EnumValueOptions_feature_support(const google_protobuf_EnumValueOptions* msg) {
10464 const google_protobuf_FieldOptions_FeatureSupport* default_val = NULL;
10465 const google_protobuf_FieldOptions_FeatureSupport* ret;
10466 const upb_MiniTableField field = {4, UPB_SIZE(20, 24), 67, 1, 11, (int)kUpb_FieldMode_Scalar | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
Protobuf Team Bota9387b52024-06-12 15:17:52 +000010467 UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__FieldOptions__FeatureSupport_msg_init);
Protobuf Team Bot2e9c0a72024-05-21 23:17:21 +000010468 _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field,
10469 &default_val, &ret);
10470 return ret;
10471}
10472UPB_INLINE bool google_protobuf_EnumValueOptions_has_feature_support(const google_protobuf_EnumValueOptions* msg) {
10473 const upb_MiniTableField field = {4, UPB_SIZE(20, 24), 67, 1, 11, (int)kUpb_FieldMode_Scalar | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
10474 return upb_Message_HasBaseField(UPB_UPCAST(msg), &field);
10475}
Mike Kruskal3bc50492022-12-01 13:34:12 -080010476UPB_INLINE void google_protobuf_EnumValueOptions_clear_uninterpreted_option(google_protobuf_EnumValueOptions* msg) {
Protobuf Team Bot2e9c0a72024-05-21 23:17:21 +000010477 const upb_MiniTableField field = {999, UPB_SIZE(24, 32), 0, 2, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
Protobuf Team Bot4e90ead2024-01-08 15:46:34 +000010478 upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
Joshua Habermand3995ec2022-09-30 16:54:39 -070010479}
Eric Salob7d54ac2022-12-29 11:59:42 -080010480UPB_INLINE const google_protobuf_UninterpretedOption* const* google_protobuf_EnumValueOptions_uninterpreted_option(const google_protobuf_EnumValueOptions* msg, size_t* size) {
Protobuf Team Bot2e9c0a72024-05-21 23:17:21 +000010481 const upb_MiniTableField field = {999, UPB_SIZE(24, 32), 0, 2, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
Protobuf Team Bota9387b52024-06-12 15:17:52 +000010482 UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__UninterpretedOption_msg_init);
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +000010483 const upb_Array* arr = upb_Message_GetArray(UPB_UPCAST(msg), &field);
Eric Salob7d54ac2022-12-29 11:59:42 -080010484 if (arr) {
Protobuf Team Botf73985a2023-12-19 00:14:19 +000010485 if (size) *size = arr->UPB_PRIVATE(size);
Protobuf Team Bot81e54332024-01-11 21:04:07 +000010486 return (const google_protobuf_UninterpretedOption* const*)upb_Array_DataPtr(arr);
Eric Salob7d54ac2022-12-29 11:59:42 -080010487 } else {
10488 if (size) *size = 0;
10489 return NULL;
10490 }
Joshua Haberman7ecf43f2022-03-14 13:11:29 -070010491}
Deanna Garciab26afb52023-04-25 13:37:18 -070010492UPB_INLINE const upb_Array* _google_protobuf_EnumValueOptions_uninterpreted_option_upb_array(const google_protobuf_EnumValueOptions* msg, size_t* size) {
Protobuf Team Bot2e9c0a72024-05-21 23:17:21 +000010493 const upb_MiniTableField field = {999, UPB_SIZE(24, 32), 0, 2, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
Protobuf Team Bota9387b52024-06-12 15:17:52 +000010494 UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__UninterpretedOption_msg_init);
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +000010495 const upb_Array* arr = upb_Message_GetArray(UPB_UPCAST(msg), &field);
Deanna Garciab26afb52023-04-25 13:37:18 -070010496 if (size) {
Protobuf Team Botf73985a2023-12-19 00:14:19 +000010497 *size = arr ? arr->UPB_PRIVATE(size) : 0;
Deanna Garciab26afb52023-04-25 13:37:18 -070010498 }
10499 return arr;
10500}
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +000010501UPB_INLINE upb_Array* _google_protobuf_EnumValueOptions_uninterpreted_option_mutable_upb_array(google_protobuf_EnumValueOptions* msg, size_t* size, upb_Arena* arena) {
Protobuf Team Bot2e9c0a72024-05-21 23:17:21 +000010502 const upb_MiniTableField field = {999, UPB_SIZE(24, 32), 0, 2, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
Protobuf Team Bota9387b52024-06-12 15:17:52 +000010503 UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__UninterpretedOption_msg_init);
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +000010504 upb_Array* arr = upb_Message_GetOrCreateMutableArray(UPB_UPCAST(msg),
10505 &field, arena);
Deanna Garciab26afb52023-04-25 13:37:18 -070010506 if (size) {
Protobuf Team Botf73985a2023-12-19 00:14:19 +000010507 *size = arr ? arr->UPB_PRIVATE(size) : 0;
Deanna Garciab26afb52023-04-25 13:37:18 -070010508 }
10509 return arr;
10510}
Joshua Haberman9abf6e22021-01-13 12:16:25 -080010511
10512UPB_INLINE void google_protobuf_EnumValueOptions_set_deprecated(google_protobuf_EnumValueOptions *msg, bool value) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +000010513 const upb_MiniTableField field = {1, 9, 64, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
Protobuf Team Botac32c972024-04-10 03:30:05 +000010514 upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
Mike Kruskal232ecf42023-01-14 00:09:40 -080010515}
Mike Kruskal4f9e4172023-06-30 20:14:50 -070010516UPB_INLINE void google_protobuf_EnumValueOptions_set_features(google_protobuf_EnumValueOptions *msg, google_protobuf_FeatureSet* value) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +000010517 const upb_MiniTableField field = {2, UPB_SIZE(12, 16), 65, 0, 11, (int)kUpb_FieldMode_Scalar | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
Protobuf Team Bota9387b52024-06-12 15:17:52 +000010518 UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__FeatureSet_msg_init);
Protobuf Team Botac32c972024-04-10 03:30:05 +000010519 upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
Mike Kruskal4f9e4172023-06-30 20:14:50 -070010520}
10521UPB_INLINE struct google_protobuf_FeatureSet* google_protobuf_EnumValueOptions_mutable_features(google_protobuf_EnumValueOptions* msg, upb_Arena* arena) {
10522 struct google_protobuf_FeatureSet* sub = (struct google_protobuf_FeatureSet*)google_protobuf_EnumValueOptions_features(msg);
10523 if (sub == NULL) {
Protobuf Team Bot4ffe0862023-12-06 02:02:36 +000010524 sub = (struct google_protobuf_FeatureSet*)_upb_Message_New(&google__protobuf__FeatureSet_msg_init, arena);
Mike Kruskal4f9e4172023-06-30 20:14:50 -070010525 if (sub) google_protobuf_EnumValueOptions_set_features(msg, sub);
10526 }
10527 return sub;
10528}
Mike Kruskal12e0f1d2023-05-31 15:40:54 -070010529UPB_INLINE void google_protobuf_EnumValueOptions_set_debug_redact(google_protobuf_EnumValueOptions *msg, bool value) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +000010530 const upb_MiniTableField field = {3, UPB_SIZE(16, 10), 66, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
Protobuf Team Botac32c972024-04-10 03:30:05 +000010531 upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
Mike Kruskal12e0f1d2023-05-31 15:40:54 -070010532}
Protobuf Team Bot2e9c0a72024-05-21 23:17:21 +000010533UPB_INLINE void google_protobuf_EnumValueOptions_set_feature_support(google_protobuf_EnumValueOptions *msg, google_protobuf_FieldOptions_FeatureSupport* value) {
10534 const upb_MiniTableField field = {4, UPB_SIZE(20, 24), 67, 1, 11, (int)kUpb_FieldMode_Scalar | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
Protobuf Team Bota9387b52024-06-12 15:17:52 +000010535 UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__FieldOptions__FeatureSupport_msg_init);
Protobuf Team Bot2e9c0a72024-05-21 23:17:21 +000010536 upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
10537}
10538UPB_INLINE struct google_protobuf_FieldOptions_FeatureSupport* google_protobuf_EnumValueOptions_mutable_feature_support(google_protobuf_EnumValueOptions* msg, upb_Arena* arena) {
10539 struct google_protobuf_FieldOptions_FeatureSupport* sub = (struct google_protobuf_FieldOptions_FeatureSupport*)google_protobuf_EnumValueOptions_feature_support(msg);
10540 if (sub == NULL) {
10541 sub = (struct google_protobuf_FieldOptions_FeatureSupport*)_upb_Message_New(&google__protobuf__FieldOptions__FeatureSupport_msg_init, arena);
10542 if (sub) google_protobuf_EnumValueOptions_set_feature_support(msg, sub);
10543 }
10544 return sub;
10545}
Mike Kruskal232ecf42023-01-14 00:09:40 -080010546UPB_INLINE google_protobuf_UninterpretedOption** google_protobuf_EnumValueOptions_mutable_uninterpreted_option(google_protobuf_EnumValueOptions* msg, size_t* size) {
Protobuf Team Bot2e9c0a72024-05-21 23:17:21 +000010547 upb_MiniTableField field = {999, UPB_SIZE(24, 32), 0, 2, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
Protobuf Team Bota9387b52024-06-12 15:17:52 +000010548 UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__UninterpretedOption_msg_init);
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +000010549 upb_Array* arr = upb_Message_GetMutableArray(UPB_UPCAST(msg), &field);
Eric Salob7d54ac2022-12-29 11:59:42 -080010550 if (arr) {
Protobuf Team Botf73985a2023-12-19 00:14:19 +000010551 if (size) *size = arr->UPB_PRIVATE(size);
Protobuf Team Bot81e54332024-01-11 21:04:07 +000010552 return (google_protobuf_UninterpretedOption**)upb_Array_MutableDataPtr(arr);
Eric Salob7d54ac2022-12-29 11:59:42 -080010553 } else {
10554 if (size) *size = 0;
10555 return NULL;
10556 }
Joshua Haberman9abf6e22021-01-13 12:16:25 -080010557}
Eric Salob7d54ac2022-12-29 11:59:42 -080010558UPB_INLINE google_protobuf_UninterpretedOption** google_protobuf_EnumValueOptions_resize_uninterpreted_option(google_protobuf_EnumValueOptions* msg, size_t size, upb_Arena* arena) {
Protobuf Team Bot2e9c0a72024-05-21 23:17:21 +000010559 upb_MiniTableField field = {999, UPB_SIZE(24, 32), 0, 2, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +000010560 return (google_protobuf_UninterpretedOption**)upb_Message_ResizeArrayUninitialized(UPB_UPCAST(msg),
10561 &field, size, arena);
Joshua Haberman9abf6e22021-01-13 12:16:25 -080010562}
Joshua Haberman7ecf43f2022-03-14 13:11:29 -070010563UPB_INLINE struct google_protobuf_UninterpretedOption* google_protobuf_EnumValueOptions_add_uninterpreted_option(google_protobuf_EnumValueOptions* msg, upb_Arena* arena) {
Protobuf Team Bot2e9c0a72024-05-21 23:17:21 +000010564 upb_MiniTableField field = {999, UPB_SIZE(24, 32), 0, 2, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
Protobuf Team Bota9387b52024-06-12 15:17:52 +000010565 UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__UninterpretedOption_msg_init);
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +000010566 upb_Array* arr = upb_Message_GetOrCreateMutableArray(
10567 UPB_UPCAST(msg), &field, arena);
Protobuf Team Bot81e54332024-01-11 21:04:07 +000010568 if (!arr || !UPB_PRIVATE(_upb_Array_ResizeUninitialized)(
Protobuf Team Botf73985a2023-12-19 00:14:19 +000010569 arr, arr->UPB_PRIVATE(size) + 1, arena)) {
Eric Salob7d54ac2022-12-29 11:59:42 -080010570 return NULL;
10571 }
Protobuf Team Bot4ffe0862023-12-06 02:02:36 +000010572 struct google_protobuf_UninterpretedOption* sub = (struct google_protobuf_UninterpretedOption*)_upb_Message_New(&google__protobuf__UninterpretedOption_msg_init, arena);
Eric Salob7d54ac2022-12-29 11:59:42 -080010573 if (!arr || !sub) return NULL;
Protobuf Team Botf73985a2023-12-19 00:14:19 +000010574 UPB_PRIVATE(_upb_Array_Set)
10575 (arr, arr->UPB_PRIVATE(size) - 1, &sub, sizeof(sub));
Joshua Haberman9abf6e22021-01-13 12:16:25 -080010576 return sub;
10577}
10578
10579/* google.protobuf.ServiceOptions */
10580
Joshua Habermanf41049a2022-01-21 14:41:25 -080010581UPB_INLINE google_protobuf_ServiceOptions* google_protobuf_ServiceOptions_new(upb_Arena* arena) {
Protobuf Team Bot4ffe0862023-12-06 02:02:36 +000010582 return (google_protobuf_ServiceOptions*)_upb_Message_New(&google__protobuf__ServiceOptions_msg_init, arena);
Joshua Haberman9abf6e22021-01-13 12:16:25 -080010583}
Joshua Habermanf41049a2022-01-21 14:41:25 -080010584UPB_INLINE google_protobuf_ServiceOptions* google_protobuf_ServiceOptions_parse(const char* buf, size_t size, upb_Arena* arena) {
10585 google_protobuf_ServiceOptions* ret = google_protobuf_ServiceOptions_new(arena);
Joshua Haberman9d578a32021-08-02 15:32:01 -070010586 if (!ret) return NULL;
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +000010587 if (upb_Decode(buf, size, UPB_UPCAST(ret), &google__protobuf__ServiceOptions_msg_init, NULL, 0, arena) !=
10588 kUpb_DecodeStatus_Ok) {
Joshua Haberman9d578a32021-08-02 15:32:01 -070010589 return NULL;
10590 }
10591 return ret;
Joshua Haberman9abf6e22021-01-13 12:16:25 -080010592}
Joshua Habermanf41049a2022-01-21 14:41:25 -080010593UPB_INLINE google_protobuf_ServiceOptions* google_protobuf_ServiceOptions_parse_ex(const char* buf, size_t size,
10594 const upb_ExtensionRegistry* extreg,
10595 int options, upb_Arena* arena) {
10596 google_protobuf_ServiceOptions* ret = google_protobuf_ServiceOptions_new(arena);
10597 if (!ret) return NULL;
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +000010598 if (upb_Decode(buf, size, UPB_UPCAST(ret), &google__protobuf__ServiceOptions_msg_init, extreg, options,
10599 arena) != kUpb_DecodeStatus_Ok) {
Joshua Habermanf41049a2022-01-21 14:41:25 -080010600 return NULL;
10601 }
10602 return ret;
Joshua Haberman9abf6e22021-01-13 12:16:25 -080010603}
Joshua Habermanf41049a2022-01-21 14:41:25 -080010604UPB_INLINE char* google_protobuf_ServiceOptions_serialize(const google_protobuf_ServiceOptions* msg, upb_Arena* arena, size_t* len) {
Joshua Habermand3995ec2022-09-30 16:54:39 -070010605 char* ptr;
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +000010606 (void)upb_Encode(UPB_UPCAST(msg), &google__protobuf__ServiceOptions_msg_init, 0, arena, &ptr, len);
Joshua Habermand3995ec2022-09-30 16:54:39 -070010607 return ptr;
Joshua Habermanf41049a2022-01-21 14:41:25 -080010608}
10609UPB_INLINE char* google_protobuf_ServiceOptions_serialize_ex(const google_protobuf_ServiceOptions* msg, int options,
10610 upb_Arena* arena, size_t* len) {
Joshua Habermand3995ec2022-09-30 16:54:39 -070010611 char* ptr;
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +000010612 (void)upb_Encode(UPB_UPCAST(msg), &google__protobuf__ServiceOptions_msg_init, options, arena, &ptr, len);
Joshua Habermand3995ec2022-09-30 16:54:39 -070010613 return ptr;
Joshua Habermanf41049a2022-01-21 14:41:25 -080010614}
Mike Kruskal3bc50492022-12-01 13:34:12 -080010615UPB_INLINE void google_protobuf_ServiceOptions_clear_deprecated(google_protobuf_ServiceOptions* msg) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +000010616 const upb_MiniTableField field = {33, 9, 64, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
Protobuf Team Bot4e90ead2024-01-08 15:46:34 +000010617 upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
Joshua Habermand3995ec2022-09-30 16:54:39 -070010618}
Joshua Habermanf41049a2022-01-21 14:41:25 -080010619UPB_INLINE bool google_protobuf_ServiceOptions_deprecated(const google_protobuf_ServiceOptions* msg) {
Eric Salo8809a112022-11-21 13:01:06 -080010620 bool default_val = false;
10621 bool ret;
Protobuf Team Bot03440ec2024-01-11 23:13:19 +000010622 const upb_MiniTableField field = {33, 9, 64, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +000010623 _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field,
10624 &default_val, &ret);
Eric Salo8809a112022-11-21 13:01:06 -080010625 return ret;
Joshua Habermanf41049a2022-01-21 14:41:25 -080010626}
Mike Kruskal3bc50492022-12-01 13:34:12 -080010627UPB_INLINE bool google_protobuf_ServiceOptions_has_deprecated(const google_protobuf_ServiceOptions* msg) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +000010628 const upb_MiniTableField field = {33, 9, 64, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
Protobuf Team Bot8c1f6352024-01-10 05:18:15 +000010629 return upb_Message_HasBaseField(UPB_UPCAST(msg), &field);
Joshua Haberman7ecf43f2022-03-14 13:11:29 -070010630}
Mike Kruskal4f9e4172023-06-30 20:14:50 -070010631UPB_INLINE void google_protobuf_ServiceOptions_clear_features(google_protobuf_ServiceOptions* msg) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +000010632 const upb_MiniTableField field = {34, UPB_SIZE(12, 16), 65, 0, 11, (int)kUpb_FieldMode_Scalar | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
Protobuf Team Bot4e90ead2024-01-08 15:46:34 +000010633 upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
Mike Kruskal4f9e4172023-06-30 20:14:50 -070010634}
10635UPB_INLINE const google_protobuf_FeatureSet* google_protobuf_ServiceOptions_features(const google_protobuf_ServiceOptions* msg) {
10636 const google_protobuf_FeatureSet* default_val = NULL;
10637 const google_protobuf_FeatureSet* ret;
Protobuf Team Bot03440ec2024-01-11 23:13:19 +000010638 const upb_MiniTableField field = {34, UPB_SIZE(12, 16), 65, 0, 11, (int)kUpb_FieldMode_Scalar | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
Protobuf Team Bota9387b52024-06-12 15:17:52 +000010639 UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__FeatureSet_msg_init);
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +000010640 _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field,
10641 &default_val, &ret);
Mike Kruskal4f9e4172023-06-30 20:14:50 -070010642 return ret;
10643}
10644UPB_INLINE bool google_protobuf_ServiceOptions_has_features(const google_protobuf_ServiceOptions* msg) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +000010645 const upb_MiniTableField field = {34, UPB_SIZE(12, 16), 65, 0, 11, (int)kUpb_FieldMode_Scalar | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
Protobuf Team Bot8c1f6352024-01-10 05:18:15 +000010646 return upb_Message_HasBaseField(UPB_UPCAST(msg), &field);
Mike Kruskal4f9e4172023-06-30 20:14:50 -070010647}
Mike Kruskal3bc50492022-12-01 13:34:12 -080010648UPB_INLINE void google_protobuf_ServiceOptions_clear_uninterpreted_option(google_protobuf_ServiceOptions* msg) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +000010649 const upb_MiniTableField field = {999, UPB_SIZE(16, 24), 0, 1, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
Protobuf Team Bot4e90ead2024-01-08 15:46:34 +000010650 upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
Joshua Habermand3995ec2022-09-30 16:54:39 -070010651}
Eric Salob7d54ac2022-12-29 11:59:42 -080010652UPB_INLINE const google_protobuf_UninterpretedOption* const* google_protobuf_ServiceOptions_uninterpreted_option(const google_protobuf_ServiceOptions* msg, size_t* size) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +000010653 const upb_MiniTableField field = {999, UPB_SIZE(16, 24), 0, 1, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
Protobuf Team Bota9387b52024-06-12 15:17:52 +000010654 UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__UninterpretedOption_msg_init);
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +000010655 const upb_Array* arr = upb_Message_GetArray(UPB_UPCAST(msg), &field);
Eric Salob7d54ac2022-12-29 11:59:42 -080010656 if (arr) {
Protobuf Team Botf73985a2023-12-19 00:14:19 +000010657 if (size) *size = arr->UPB_PRIVATE(size);
Protobuf Team Bot81e54332024-01-11 21:04:07 +000010658 return (const google_protobuf_UninterpretedOption* const*)upb_Array_DataPtr(arr);
Eric Salob7d54ac2022-12-29 11:59:42 -080010659 } else {
10660 if (size) *size = 0;
10661 return NULL;
10662 }
Joshua Haberman7ecf43f2022-03-14 13:11:29 -070010663}
Deanna Garciab26afb52023-04-25 13:37:18 -070010664UPB_INLINE const upb_Array* _google_protobuf_ServiceOptions_uninterpreted_option_upb_array(const google_protobuf_ServiceOptions* msg, size_t* size) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +000010665 const upb_MiniTableField field = {999, UPB_SIZE(16, 24), 0, 1, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
Protobuf Team Bota9387b52024-06-12 15:17:52 +000010666 UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__UninterpretedOption_msg_init);
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +000010667 const upb_Array* arr = upb_Message_GetArray(UPB_UPCAST(msg), &field);
Deanna Garciab26afb52023-04-25 13:37:18 -070010668 if (size) {
Protobuf Team Botf73985a2023-12-19 00:14:19 +000010669 *size = arr ? arr->UPB_PRIVATE(size) : 0;
Deanna Garciab26afb52023-04-25 13:37:18 -070010670 }
10671 return arr;
10672}
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +000010673UPB_INLINE upb_Array* _google_protobuf_ServiceOptions_uninterpreted_option_mutable_upb_array(google_protobuf_ServiceOptions* msg, size_t* size, upb_Arena* arena) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +000010674 const upb_MiniTableField field = {999, UPB_SIZE(16, 24), 0, 1, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
Protobuf Team Bota9387b52024-06-12 15:17:52 +000010675 UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__UninterpretedOption_msg_init);
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +000010676 upb_Array* arr = upb_Message_GetOrCreateMutableArray(UPB_UPCAST(msg),
10677 &field, arena);
Deanna Garciab26afb52023-04-25 13:37:18 -070010678 if (size) {
Protobuf Team Botf73985a2023-12-19 00:14:19 +000010679 *size = arr ? arr->UPB_PRIVATE(size) : 0;
Deanna Garciab26afb52023-04-25 13:37:18 -070010680 }
10681 return arr;
10682}
Joshua Haberman9abf6e22021-01-13 12:16:25 -080010683
10684UPB_INLINE void google_protobuf_ServiceOptions_set_deprecated(google_protobuf_ServiceOptions *msg, bool value) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +000010685 const upb_MiniTableField field = {33, 9, 64, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
Protobuf Team Botac32c972024-04-10 03:30:05 +000010686 upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
Mike Kruskal232ecf42023-01-14 00:09:40 -080010687}
Mike Kruskal4f9e4172023-06-30 20:14:50 -070010688UPB_INLINE void google_protobuf_ServiceOptions_set_features(google_protobuf_ServiceOptions *msg, google_protobuf_FeatureSet* value) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +000010689 const upb_MiniTableField field = {34, UPB_SIZE(12, 16), 65, 0, 11, (int)kUpb_FieldMode_Scalar | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
Protobuf Team Bota9387b52024-06-12 15:17:52 +000010690 UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__FeatureSet_msg_init);
Protobuf Team Botac32c972024-04-10 03:30:05 +000010691 upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
Mike Kruskal4f9e4172023-06-30 20:14:50 -070010692}
10693UPB_INLINE struct google_protobuf_FeatureSet* google_protobuf_ServiceOptions_mutable_features(google_protobuf_ServiceOptions* msg, upb_Arena* arena) {
10694 struct google_protobuf_FeatureSet* sub = (struct google_protobuf_FeatureSet*)google_protobuf_ServiceOptions_features(msg);
10695 if (sub == NULL) {
Protobuf Team Bot4ffe0862023-12-06 02:02:36 +000010696 sub = (struct google_protobuf_FeatureSet*)_upb_Message_New(&google__protobuf__FeatureSet_msg_init, arena);
Mike Kruskal4f9e4172023-06-30 20:14:50 -070010697 if (sub) google_protobuf_ServiceOptions_set_features(msg, sub);
10698 }
10699 return sub;
10700}
Mike Kruskal232ecf42023-01-14 00:09:40 -080010701UPB_INLINE google_protobuf_UninterpretedOption** google_protobuf_ServiceOptions_mutable_uninterpreted_option(google_protobuf_ServiceOptions* msg, size_t* size) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +000010702 upb_MiniTableField field = {999, UPB_SIZE(16, 24), 0, 1, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
Protobuf Team Bota9387b52024-06-12 15:17:52 +000010703 UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__UninterpretedOption_msg_init);
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +000010704 upb_Array* arr = upb_Message_GetMutableArray(UPB_UPCAST(msg), &field);
Eric Salob7d54ac2022-12-29 11:59:42 -080010705 if (arr) {
Protobuf Team Botf73985a2023-12-19 00:14:19 +000010706 if (size) *size = arr->UPB_PRIVATE(size);
Protobuf Team Bot81e54332024-01-11 21:04:07 +000010707 return (google_protobuf_UninterpretedOption**)upb_Array_MutableDataPtr(arr);
Eric Salob7d54ac2022-12-29 11:59:42 -080010708 } else {
10709 if (size) *size = 0;
10710 return NULL;
10711 }
Joshua Haberman9abf6e22021-01-13 12:16:25 -080010712}
Eric Salob7d54ac2022-12-29 11:59:42 -080010713UPB_INLINE google_protobuf_UninterpretedOption** google_protobuf_ServiceOptions_resize_uninterpreted_option(google_protobuf_ServiceOptions* msg, size_t size, upb_Arena* arena) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +000010714 upb_MiniTableField field = {999, UPB_SIZE(16, 24), 0, 1, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +000010715 return (google_protobuf_UninterpretedOption**)upb_Message_ResizeArrayUninitialized(UPB_UPCAST(msg),
10716 &field, size, arena);
Joshua Haberman9abf6e22021-01-13 12:16:25 -080010717}
Joshua Haberman7ecf43f2022-03-14 13:11:29 -070010718UPB_INLINE struct google_protobuf_UninterpretedOption* google_protobuf_ServiceOptions_add_uninterpreted_option(google_protobuf_ServiceOptions* msg, upb_Arena* arena) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +000010719 upb_MiniTableField field = {999, UPB_SIZE(16, 24), 0, 1, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
Protobuf Team Bota9387b52024-06-12 15:17:52 +000010720 UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__UninterpretedOption_msg_init);
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +000010721 upb_Array* arr = upb_Message_GetOrCreateMutableArray(
10722 UPB_UPCAST(msg), &field, arena);
Protobuf Team Bot81e54332024-01-11 21:04:07 +000010723 if (!arr || !UPB_PRIVATE(_upb_Array_ResizeUninitialized)(
Protobuf Team Botf73985a2023-12-19 00:14:19 +000010724 arr, arr->UPB_PRIVATE(size) + 1, arena)) {
Eric Salob7d54ac2022-12-29 11:59:42 -080010725 return NULL;
10726 }
Protobuf Team Bot4ffe0862023-12-06 02:02:36 +000010727 struct google_protobuf_UninterpretedOption* sub = (struct google_protobuf_UninterpretedOption*)_upb_Message_New(&google__protobuf__UninterpretedOption_msg_init, arena);
Eric Salob7d54ac2022-12-29 11:59:42 -080010728 if (!arr || !sub) return NULL;
Protobuf Team Botf73985a2023-12-19 00:14:19 +000010729 UPB_PRIVATE(_upb_Array_Set)
10730 (arr, arr->UPB_PRIVATE(size) - 1, &sub, sizeof(sub));
Joshua Haberman9abf6e22021-01-13 12:16:25 -080010731 return sub;
10732}
10733
10734/* google.protobuf.MethodOptions */
10735
Joshua Habermanf41049a2022-01-21 14:41:25 -080010736UPB_INLINE google_protobuf_MethodOptions* google_protobuf_MethodOptions_new(upb_Arena* arena) {
Protobuf Team Bot4ffe0862023-12-06 02:02:36 +000010737 return (google_protobuf_MethodOptions*)_upb_Message_New(&google__protobuf__MethodOptions_msg_init, arena);
Joshua Haberman9abf6e22021-01-13 12:16:25 -080010738}
Joshua Habermanf41049a2022-01-21 14:41:25 -080010739UPB_INLINE google_protobuf_MethodOptions* google_protobuf_MethodOptions_parse(const char* buf, size_t size, upb_Arena* arena) {
10740 google_protobuf_MethodOptions* ret = google_protobuf_MethodOptions_new(arena);
Joshua Haberman9d578a32021-08-02 15:32:01 -070010741 if (!ret) return NULL;
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +000010742 if (upb_Decode(buf, size, UPB_UPCAST(ret), &google__protobuf__MethodOptions_msg_init, NULL, 0, arena) !=
10743 kUpb_DecodeStatus_Ok) {
Joshua Haberman9d578a32021-08-02 15:32:01 -070010744 return NULL;
10745 }
10746 return ret;
Joshua Haberman9abf6e22021-01-13 12:16:25 -080010747}
Joshua Habermanf41049a2022-01-21 14:41:25 -080010748UPB_INLINE google_protobuf_MethodOptions* google_protobuf_MethodOptions_parse_ex(const char* buf, size_t size,
10749 const upb_ExtensionRegistry* extreg,
10750 int options, upb_Arena* arena) {
10751 google_protobuf_MethodOptions* ret = google_protobuf_MethodOptions_new(arena);
10752 if (!ret) return NULL;
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +000010753 if (upb_Decode(buf, size, UPB_UPCAST(ret), &google__protobuf__MethodOptions_msg_init, extreg, options,
10754 arena) != kUpb_DecodeStatus_Ok) {
Joshua Habermanf41049a2022-01-21 14:41:25 -080010755 return NULL;
10756 }
10757 return ret;
Joshua Haberman9abf6e22021-01-13 12:16:25 -080010758}
Joshua Habermanf41049a2022-01-21 14:41:25 -080010759UPB_INLINE char* google_protobuf_MethodOptions_serialize(const google_protobuf_MethodOptions* msg, upb_Arena* arena, size_t* len) {
Joshua Habermand3995ec2022-09-30 16:54:39 -070010760 char* ptr;
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +000010761 (void)upb_Encode(UPB_UPCAST(msg), &google__protobuf__MethodOptions_msg_init, 0, arena, &ptr, len);
Joshua Habermand3995ec2022-09-30 16:54:39 -070010762 return ptr;
Joshua Habermanf41049a2022-01-21 14:41:25 -080010763}
10764UPB_INLINE char* google_protobuf_MethodOptions_serialize_ex(const google_protobuf_MethodOptions* msg, int options,
10765 upb_Arena* arena, size_t* len) {
Joshua Habermand3995ec2022-09-30 16:54:39 -070010766 char* ptr;
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +000010767 (void)upb_Encode(UPB_UPCAST(msg), &google__protobuf__MethodOptions_msg_init, options, arena, &ptr, len);
Joshua Habermand3995ec2022-09-30 16:54:39 -070010768 return ptr;
Joshua Habermanf41049a2022-01-21 14:41:25 -080010769}
Mike Kruskal3bc50492022-12-01 13:34:12 -080010770UPB_INLINE void google_protobuf_MethodOptions_clear_deprecated(google_protobuf_MethodOptions* msg) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +000010771 const upb_MiniTableField field = {33, 9, 64, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
Protobuf Team Bot4e90ead2024-01-08 15:46:34 +000010772 upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
Joshua Habermand3995ec2022-09-30 16:54:39 -070010773}
Joshua Habermanf41049a2022-01-21 14:41:25 -080010774UPB_INLINE bool google_protobuf_MethodOptions_deprecated(const google_protobuf_MethodOptions* msg) {
Eric Salo8809a112022-11-21 13:01:06 -080010775 bool default_val = false;
10776 bool ret;
Protobuf Team Bot03440ec2024-01-11 23:13:19 +000010777 const upb_MiniTableField field = {33, 9, 64, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +000010778 _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field,
10779 &default_val, &ret);
Eric Salo8809a112022-11-21 13:01:06 -080010780 return ret;
Joshua Habermanf41049a2022-01-21 14:41:25 -080010781}
Mike Kruskal3bc50492022-12-01 13:34:12 -080010782UPB_INLINE bool google_protobuf_MethodOptions_has_deprecated(const google_protobuf_MethodOptions* msg) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +000010783 const upb_MiniTableField field = {33, 9, 64, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
Protobuf Team Bot8c1f6352024-01-10 05:18:15 +000010784 return upb_Message_HasBaseField(UPB_UPCAST(msg), &field);
Joshua Haberman7ecf43f2022-03-14 13:11:29 -070010785}
Mike Kruskal3bc50492022-12-01 13:34:12 -080010786UPB_INLINE void google_protobuf_MethodOptions_clear_idempotency_level(google_protobuf_MethodOptions* msg) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +000010787 const upb_MiniTableField field = {34, 12, 65, 2, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
Protobuf Team Bot4e90ead2024-01-08 15:46:34 +000010788 upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
Joshua Habermand3995ec2022-09-30 16:54:39 -070010789}
Joshua Habermanf41049a2022-01-21 14:41:25 -080010790UPB_INLINE int32_t google_protobuf_MethodOptions_idempotency_level(const google_protobuf_MethodOptions* msg) {
Eric Salo8809a112022-11-21 13:01:06 -080010791 int32_t default_val = 0;
10792 int32_t ret;
Protobuf Team Bot03440ec2024-01-11 23:13:19 +000010793 const upb_MiniTableField field = {34, 12, 65, 2, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +000010794 _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field,
10795 &default_val, &ret);
Eric Salo8809a112022-11-21 13:01:06 -080010796 return ret;
Joshua Habermanf41049a2022-01-21 14:41:25 -080010797}
Mike Kruskal3bc50492022-12-01 13:34:12 -080010798UPB_INLINE bool google_protobuf_MethodOptions_has_idempotency_level(const google_protobuf_MethodOptions* msg) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +000010799 const upb_MiniTableField field = {34, 12, 65, 2, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
Protobuf Team Bot8c1f6352024-01-10 05:18:15 +000010800 return upb_Message_HasBaseField(UPB_UPCAST(msg), &field);
Mike Kruskal4f9e4172023-06-30 20:14:50 -070010801}
10802UPB_INLINE void google_protobuf_MethodOptions_clear_features(google_protobuf_MethodOptions* msg) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +000010803 const upb_MiniTableField field = {35, 16, 66, 0, 11, (int)kUpb_FieldMode_Scalar | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
Protobuf Team Bot4e90ead2024-01-08 15:46:34 +000010804 upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
Mike Kruskal4f9e4172023-06-30 20:14:50 -070010805}
10806UPB_INLINE const google_protobuf_FeatureSet* google_protobuf_MethodOptions_features(const google_protobuf_MethodOptions* msg) {
10807 const google_protobuf_FeatureSet* default_val = NULL;
10808 const google_protobuf_FeatureSet* ret;
Protobuf Team Bot03440ec2024-01-11 23:13:19 +000010809 const upb_MiniTableField field = {35, 16, 66, 0, 11, (int)kUpb_FieldMode_Scalar | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
Protobuf Team Bota9387b52024-06-12 15:17:52 +000010810 UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__FeatureSet_msg_init);
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +000010811 _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field,
10812 &default_val, &ret);
Mike Kruskal4f9e4172023-06-30 20:14:50 -070010813 return ret;
10814}
10815UPB_INLINE bool google_protobuf_MethodOptions_has_features(const google_protobuf_MethodOptions* msg) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +000010816 const upb_MiniTableField field = {35, 16, 66, 0, 11, (int)kUpb_FieldMode_Scalar | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
Protobuf Team Bot8c1f6352024-01-10 05:18:15 +000010817 return upb_Message_HasBaseField(UPB_UPCAST(msg), &field);
Joshua Habermand3995ec2022-09-30 16:54:39 -070010818}
Mike Kruskal3bc50492022-12-01 13:34:12 -080010819UPB_INLINE void google_protobuf_MethodOptions_clear_uninterpreted_option(google_protobuf_MethodOptions* msg) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +000010820 const upb_MiniTableField field = {999, UPB_SIZE(20, 24), 0, 1, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
Protobuf Team Bot4e90ead2024-01-08 15:46:34 +000010821 upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
Joshua Haberman7ecf43f2022-03-14 13:11:29 -070010822}
Eric Salob7d54ac2022-12-29 11:59:42 -080010823UPB_INLINE const google_protobuf_UninterpretedOption* const* google_protobuf_MethodOptions_uninterpreted_option(const google_protobuf_MethodOptions* msg, size_t* size) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +000010824 const upb_MiniTableField field = {999, UPB_SIZE(20, 24), 0, 1, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
Protobuf Team Bota9387b52024-06-12 15:17:52 +000010825 UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__UninterpretedOption_msg_init);
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +000010826 const upb_Array* arr = upb_Message_GetArray(UPB_UPCAST(msg), &field);
Eric Salob7d54ac2022-12-29 11:59:42 -080010827 if (arr) {
Protobuf Team Botf73985a2023-12-19 00:14:19 +000010828 if (size) *size = arr->UPB_PRIVATE(size);
Protobuf Team Bot81e54332024-01-11 21:04:07 +000010829 return (const google_protobuf_UninterpretedOption* const*)upb_Array_DataPtr(arr);
Eric Salob7d54ac2022-12-29 11:59:42 -080010830 } else {
10831 if (size) *size = 0;
10832 return NULL;
10833 }
Joshua Haberman7ecf43f2022-03-14 13:11:29 -070010834}
Deanna Garciab26afb52023-04-25 13:37:18 -070010835UPB_INLINE const upb_Array* _google_protobuf_MethodOptions_uninterpreted_option_upb_array(const google_protobuf_MethodOptions* msg, size_t* size) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +000010836 const upb_MiniTableField field = {999, UPB_SIZE(20, 24), 0, 1, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
Protobuf Team Bota9387b52024-06-12 15:17:52 +000010837 UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__UninterpretedOption_msg_init);
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +000010838 const upb_Array* arr = upb_Message_GetArray(UPB_UPCAST(msg), &field);
Deanna Garciab26afb52023-04-25 13:37:18 -070010839 if (size) {
Protobuf Team Botf73985a2023-12-19 00:14:19 +000010840 *size = arr ? arr->UPB_PRIVATE(size) : 0;
Deanna Garciab26afb52023-04-25 13:37:18 -070010841 }
10842 return arr;
10843}
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +000010844UPB_INLINE upb_Array* _google_protobuf_MethodOptions_uninterpreted_option_mutable_upb_array(google_protobuf_MethodOptions* msg, size_t* size, upb_Arena* arena) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +000010845 const upb_MiniTableField field = {999, UPB_SIZE(20, 24), 0, 1, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
Protobuf Team Bota9387b52024-06-12 15:17:52 +000010846 UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__UninterpretedOption_msg_init);
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +000010847 upb_Array* arr = upb_Message_GetOrCreateMutableArray(UPB_UPCAST(msg),
10848 &field, arena);
Deanna Garciab26afb52023-04-25 13:37:18 -070010849 if (size) {
Protobuf Team Botf73985a2023-12-19 00:14:19 +000010850 *size = arr ? arr->UPB_PRIVATE(size) : 0;
Deanna Garciab26afb52023-04-25 13:37:18 -070010851 }
10852 return arr;
10853}
Joshua Haberman9abf6e22021-01-13 12:16:25 -080010854
10855UPB_INLINE void google_protobuf_MethodOptions_set_deprecated(google_protobuf_MethodOptions *msg, bool value) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +000010856 const upb_MiniTableField field = {33, 9, 64, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
Protobuf Team Botac32c972024-04-10 03:30:05 +000010857 upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
Mike Kruskal232ecf42023-01-14 00:09:40 -080010858}
10859UPB_INLINE void google_protobuf_MethodOptions_set_idempotency_level(google_protobuf_MethodOptions *msg, int32_t value) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +000010860 const upb_MiniTableField field = {34, 12, 65, 2, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
Protobuf Team Botac32c972024-04-10 03:30:05 +000010861 upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
Mike Kruskal232ecf42023-01-14 00:09:40 -080010862}
Mike Kruskal4f9e4172023-06-30 20:14:50 -070010863UPB_INLINE void google_protobuf_MethodOptions_set_features(google_protobuf_MethodOptions *msg, google_protobuf_FeatureSet* value) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +000010864 const upb_MiniTableField field = {35, 16, 66, 0, 11, (int)kUpb_FieldMode_Scalar | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
Protobuf Team Bota9387b52024-06-12 15:17:52 +000010865 UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__FeatureSet_msg_init);
Protobuf Team Botac32c972024-04-10 03:30:05 +000010866 upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
Mike Kruskal4f9e4172023-06-30 20:14:50 -070010867}
10868UPB_INLINE struct google_protobuf_FeatureSet* google_protobuf_MethodOptions_mutable_features(google_protobuf_MethodOptions* msg, upb_Arena* arena) {
10869 struct google_protobuf_FeatureSet* sub = (struct google_protobuf_FeatureSet*)google_protobuf_MethodOptions_features(msg);
10870 if (sub == NULL) {
Protobuf Team Bot4ffe0862023-12-06 02:02:36 +000010871 sub = (struct google_protobuf_FeatureSet*)_upb_Message_New(&google__protobuf__FeatureSet_msg_init, arena);
Mike Kruskal4f9e4172023-06-30 20:14:50 -070010872 if (sub) google_protobuf_MethodOptions_set_features(msg, sub);
10873 }
10874 return sub;
10875}
Mike Kruskal232ecf42023-01-14 00:09:40 -080010876UPB_INLINE google_protobuf_UninterpretedOption** google_protobuf_MethodOptions_mutable_uninterpreted_option(google_protobuf_MethodOptions* msg, size_t* size) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +000010877 upb_MiniTableField field = {999, UPB_SIZE(20, 24), 0, 1, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
Protobuf Team Bota9387b52024-06-12 15:17:52 +000010878 UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__UninterpretedOption_msg_init);
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +000010879 upb_Array* arr = upb_Message_GetMutableArray(UPB_UPCAST(msg), &field);
Eric Salob7d54ac2022-12-29 11:59:42 -080010880 if (arr) {
Protobuf Team Botf73985a2023-12-19 00:14:19 +000010881 if (size) *size = arr->UPB_PRIVATE(size);
Protobuf Team Bot81e54332024-01-11 21:04:07 +000010882 return (google_protobuf_UninterpretedOption**)upb_Array_MutableDataPtr(arr);
Eric Salob7d54ac2022-12-29 11:59:42 -080010883 } else {
10884 if (size) *size = 0;
10885 return NULL;
10886 }
Joshua Haberman9abf6e22021-01-13 12:16:25 -080010887}
Eric Salob7d54ac2022-12-29 11:59:42 -080010888UPB_INLINE google_protobuf_UninterpretedOption** google_protobuf_MethodOptions_resize_uninterpreted_option(google_protobuf_MethodOptions* msg, size_t size, upb_Arena* arena) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +000010889 upb_MiniTableField field = {999, UPB_SIZE(20, 24), 0, 1, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +000010890 return (google_protobuf_UninterpretedOption**)upb_Message_ResizeArrayUninitialized(UPB_UPCAST(msg),
10891 &field, size, arena);
Joshua Haberman9abf6e22021-01-13 12:16:25 -080010892}
Joshua Haberman7ecf43f2022-03-14 13:11:29 -070010893UPB_INLINE struct google_protobuf_UninterpretedOption* google_protobuf_MethodOptions_add_uninterpreted_option(google_protobuf_MethodOptions* msg, upb_Arena* arena) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +000010894 upb_MiniTableField field = {999, UPB_SIZE(20, 24), 0, 1, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
Protobuf Team Bota9387b52024-06-12 15:17:52 +000010895 UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__UninterpretedOption_msg_init);
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +000010896 upb_Array* arr = upb_Message_GetOrCreateMutableArray(
10897 UPB_UPCAST(msg), &field, arena);
Protobuf Team Bot81e54332024-01-11 21:04:07 +000010898 if (!arr || !UPB_PRIVATE(_upb_Array_ResizeUninitialized)(
Protobuf Team Botf73985a2023-12-19 00:14:19 +000010899 arr, arr->UPB_PRIVATE(size) + 1, arena)) {
Eric Salob7d54ac2022-12-29 11:59:42 -080010900 return NULL;
10901 }
Protobuf Team Bot4ffe0862023-12-06 02:02:36 +000010902 struct google_protobuf_UninterpretedOption* sub = (struct google_protobuf_UninterpretedOption*)_upb_Message_New(&google__protobuf__UninterpretedOption_msg_init, arena);
Eric Salob7d54ac2022-12-29 11:59:42 -080010903 if (!arr || !sub) return NULL;
Protobuf Team Botf73985a2023-12-19 00:14:19 +000010904 UPB_PRIVATE(_upb_Array_Set)
10905 (arr, arr->UPB_PRIVATE(size) - 1, &sub, sizeof(sub));
Joshua Haberman9abf6e22021-01-13 12:16:25 -080010906 return sub;
10907}
10908
10909/* google.protobuf.UninterpretedOption */
10910
Joshua Habermanf41049a2022-01-21 14:41:25 -080010911UPB_INLINE google_protobuf_UninterpretedOption* google_protobuf_UninterpretedOption_new(upb_Arena* arena) {
Protobuf Team Bot4ffe0862023-12-06 02:02:36 +000010912 return (google_protobuf_UninterpretedOption*)_upb_Message_New(&google__protobuf__UninterpretedOption_msg_init, arena);
Joshua Haberman9abf6e22021-01-13 12:16:25 -080010913}
Joshua Habermanf41049a2022-01-21 14:41:25 -080010914UPB_INLINE google_protobuf_UninterpretedOption* google_protobuf_UninterpretedOption_parse(const char* buf, size_t size, upb_Arena* arena) {
10915 google_protobuf_UninterpretedOption* ret = google_protobuf_UninterpretedOption_new(arena);
Joshua Haberman9d578a32021-08-02 15:32:01 -070010916 if (!ret) return NULL;
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +000010917 if (upb_Decode(buf, size, UPB_UPCAST(ret), &google__protobuf__UninterpretedOption_msg_init, NULL, 0, arena) !=
10918 kUpb_DecodeStatus_Ok) {
Joshua Haberman9d578a32021-08-02 15:32:01 -070010919 return NULL;
10920 }
10921 return ret;
Joshua Haberman9abf6e22021-01-13 12:16:25 -080010922}
Joshua Habermanf41049a2022-01-21 14:41:25 -080010923UPB_INLINE google_protobuf_UninterpretedOption* google_protobuf_UninterpretedOption_parse_ex(const char* buf, size_t size,
10924 const upb_ExtensionRegistry* extreg,
10925 int options, upb_Arena* arena) {
10926 google_protobuf_UninterpretedOption* ret = google_protobuf_UninterpretedOption_new(arena);
10927 if (!ret) return NULL;
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +000010928 if (upb_Decode(buf, size, UPB_UPCAST(ret), &google__protobuf__UninterpretedOption_msg_init, extreg, options,
10929 arena) != kUpb_DecodeStatus_Ok) {
Joshua Habermanf41049a2022-01-21 14:41:25 -080010930 return NULL;
10931 }
10932 return ret;
Joshua Haberman9abf6e22021-01-13 12:16:25 -080010933}
Joshua Habermanf41049a2022-01-21 14:41:25 -080010934UPB_INLINE char* google_protobuf_UninterpretedOption_serialize(const google_protobuf_UninterpretedOption* msg, upb_Arena* arena, size_t* len) {
Joshua Habermand3995ec2022-09-30 16:54:39 -070010935 char* ptr;
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +000010936 (void)upb_Encode(UPB_UPCAST(msg), &google__protobuf__UninterpretedOption_msg_init, 0, arena, &ptr, len);
Joshua Habermand3995ec2022-09-30 16:54:39 -070010937 return ptr;
Joshua Habermanf41049a2022-01-21 14:41:25 -080010938}
10939UPB_INLINE char* google_protobuf_UninterpretedOption_serialize_ex(const google_protobuf_UninterpretedOption* msg, int options,
10940 upb_Arena* arena, size_t* len) {
Joshua Habermand3995ec2022-09-30 16:54:39 -070010941 char* ptr;
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +000010942 (void)upb_Encode(UPB_UPCAST(msg), &google__protobuf__UninterpretedOption_msg_init, options, arena, &ptr, len);
Joshua Habermand3995ec2022-09-30 16:54:39 -070010943 return ptr;
Joshua Habermanf41049a2022-01-21 14:41:25 -080010944}
Mike Kruskal3bc50492022-12-01 13:34:12 -080010945UPB_INLINE void google_protobuf_UninterpretedOption_clear_name(google_protobuf_UninterpretedOption* msg) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +000010946 const upb_MiniTableField field = {2, UPB_SIZE(12, 16), 0, 0, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
Protobuf Team Bot4e90ead2024-01-08 15:46:34 +000010947 upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
Joshua Haberman7ecf43f2022-03-14 13:11:29 -070010948}
Eric Salob7d54ac2022-12-29 11:59:42 -080010949UPB_INLINE const google_protobuf_UninterpretedOption_NamePart* const* google_protobuf_UninterpretedOption_name(const google_protobuf_UninterpretedOption* msg, size_t* size) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +000010950 const upb_MiniTableField field = {2, UPB_SIZE(12, 16), 0, 0, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
Protobuf Team Bota9387b52024-06-12 15:17:52 +000010951 UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__UninterpretedOption__NamePart_msg_init);
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +000010952 const upb_Array* arr = upb_Message_GetArray(UPB_UPCAST(msg), &field);
Eric Salob7d54ac2022-12-29 11:59:42 -080010953 if (arr) {
Protobuf Team Botf73985a2023-12-19 00:14:19 +000010954 if (size) *size = arr->UPB_PRIVATE(size);
Protobuf Team Bot81e54332024-01-11 21:04:07 +000010955 return (const google_protobuf_UninterpretedOption_NamePart* const*)upb_Array_DataPtr(arr);
Eric Salob7d54ac2022-12-29 11:59:42 -080010956 } else {
10957 if (size) *size = 0;
10958 return NULL;
10959 }
Joshua Haberman7ecf43f2022-03-14 13:11:29 -070010960}
Deanna Garciab26afb52023-04-25 13:37:18 -070010961UPB_INLINE const upb_Array* _google_protobuf_UninterpretedOption_name_upb_array(const google_protobuf_UninterpretedOption* msg, size_t* size) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +000010962 const upb_MiniTableField field = {2, UPB_SIZE(12, 16), 0, 0, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
Protobuf Team Bota9387b52024-06-12 15:17:52 +000010963 UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__UninterpretedOption__NamePart_msg_init);
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +000010964 const upb_Array* arr = upb_Message_GetArray(UPB_UPCAST(msg), &field);
Deanna Garciab26afb52023-04-25 13:37:18 -070010965 if (size) {
Protobuf Team Botf73985a2023-12-19 00:14:19 +000010966 *size = arr ? arr->UPB_PRIVATE(size) : 0;
Deanna Garciab26afb52023-04-25 13:37:18 -070010967 }
10968 return arr;
10969}
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +000010970UPB_INLINE upb_Array* _google_protobuf_UninterpretedOption_name_mutable_upb_array(google_protobuf_UninterpretedOption* msg, size_t* size, upb_Arena* arena) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +000010971 const upb_MiniTableField field = {2, UPB_SIZE(12, 16), 0, 0, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
Protobuf Team Bota9387b52024-06-12 15:17:52 +000010972 UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__UninterpretedOption__NamePart_msg_init);
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +000010973 upb_Array* arr = upb_Message_GetOrCreateMutableArray(UPB_UPCAST(msg),
10974 &field, arena);
Deanna Garciab26afb52023-04-25 13:37:18 -070010975 if (size) {
Protobuf Team Botf73985a2023-12-19 00:14:19 +000010976 *size = arr ? arr->UPB_PRIVATE(size) : 0;
Deanna Garciab26afb52023-04-25 13:37:18 -070010977 }
10978 return arr;
10979}
Mike Kruskal3bc50492022-12-01 13:34:12 -080010980UPB_INLINE void google_protobuf_UninterpretedOption_clear_identifier_value(google_protobuf_UninterpretedOption* msg) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +000010981 const upb_MiniTableField field = {3, UPB_SIZE(16, 24), 64, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
Protobuf Team Bot4e90ead2024-01-08 15:46:34 +000010982 upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
Joshua Habermand3995ec2022-09-30 16:54:39 -070010983}
Joshua Habermanf41049a2022-01-21 14:41:25 -080010984UPB_INLINE upb_StringView google_protobuf_UninterpretedOption_identifier_value(const google_protobuf_UninterpretedOption* msg) {
Eric Salo8809a112022-11-21 13:01:06 -080010985 upb_StringView default_val = upb_StringView_FromString("");
10986 upb_StringView ret;
Protobuf Team Bot03440ec2024-01-11 23:13:19 +000010987 const upb_MiniTableField field = {3, UPB_SIZE(16, 24), 64, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +000010988 _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field,
10989 &default_val, &ret);
Eric Salo8809a112022-11-21 13:01:06 -080010990 return ret;
Joshua Habermanf41049a2022-01-21 14:41:25 -080010991}
Mike Kruskal3bc50492022-12-01 13:34:12 -080010992UPB_INLINE bool google_protobuf_UninterpretedOption_has_identifier_value(const google_protobuf_UninterpretedOption* msg) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +000010993 const upb_MiniTableField field = {3, UPB_SIZE(16, 24), 64, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
Protobuf Team Bot8c1f6352024-01-10 05:18:15 +000010994 return upb_Message_HasBaseField(UPB_UPCAST(msg), &field);
Joshua Haberman7ecf43f2022-03-14 13:11:29 -070010995}
Mike Kruskal3bc50492022-12-01 13:34:12 -080010996UPB_INLINE void google_protobuf_UninterpretedOption_clear_positive_int_value(google_protobuf_UninterpretedOption* msg) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +000010997 const upb_MiniTableField field = {4, UPB_SIZE(24, 40), 65, kUpb_NoSub, 4, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)};
Protobuf Team Bot4e90ead2024-01-08 15:46:34 +000010998 upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
Joshua Habermand3995ec2022-09-30 16:54:39 -070010999}
Joshua Habermanf41049a2022-01-21 14:41:25 -080011000UPB_INLINE uint64_t google_protobuf_UninterpretedOption_positive_int_value(const google_protobuf_UninterpretedOption* msg) {
Eric Salo8809a112022-11-21 13:01:06 -080011001 uint64_t default_val = (uint64_t)0ull;
11002 uint64_t ret;
Protobuf Team Bot03440ec2024-01-11 23:13:19 +000011003 const upb_MiniTableField field = {4, UPB_SIZE(24, 40), 65, kUpb_NoSub, 4, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)};
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +000011004 _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field,
11005 &default_val, &ret);
Eric Salo8809a112022-11-21 13:01:06 -080011006 return ret;
Joshua Habermanf41049a2022-01-21 14:41:25 -080011007}
Mike Kruskal3bc50492022-12-01 13:34:12 -080011008UPB_INLINE bool google_protobuf_UninterpretedOption_has_positive_int_value(const google_protobuf_UninterpretedOption* msg) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +000011009 const upb_MiniTableField field = {4, UPB_SIZE(24, 40), 65, kUpb_NoSub, 4, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)};
Protobuf Team Bot8c1f6352024-01-10 05:18:15 +000011010 return upb_Message_HasBaseField(UPB_UPCAST(msg), &field);
Joshua Haberman7ecf43f2022-03-14 13:11:29 -070011011}
Mike Kruskal3bc50492022-12-01 13:34:12 -080011012UPB_INLINE void google_protobuf_UninterpretedOption_clear_negative_int_value(google_protobuf_UninterpretedOption* msg) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +000011013 const upb_MiniTableField field = {5, UPB_SIZE(32, 48), 66, kUpb_NoSub, 3, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)};
Protobuf Team Bot4e90ead2024-01-08 15:46:34 +000011014 upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
Joshua Habermand3995ec2022-09-30 16:54:39 -070011015}
Joshua Habermanf41049a2022-01-21 14:41:25 -080011016UPB_INLINE int64_t google_protobuf_UninterpretedOption_negative_int_value(const google_protobuf_UninterpretedOption* msg) {
Eric Salo8809a112022-11-21 13:01:06 -080011017 int64_t default_val = (int64_t)0ll;
11018 int64_t ret;
Protobuf Team Bot03440ec2024-01-11 23:13:19 +000011019 const upb_MiniTableField field = {5, UPB_SIZE(32, 48), 66, kUpb_NoSub, 3, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)};
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +000011020 _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field,
11021 &default_val, &ret);
Eric Salo8809a112022-11-21 13:01:06 -080011022 return ret;
Joshua Habermanf41049a2022-01-21 14:41:25 -080011023}
Mike Kruskal3bc50492022-12-01 13:34:12 -080011024UPB_INLINE bool google_protobuf_UninterpretedOption_has_negative_int_value(const google_protobuf_UninterpretedOption* msg) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +000011025 const upb_MiniTableField field = {5, UPB_SIZE(32, 48), 66, kUpb_NoSub, 3, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)};
Protobuf Team Bot8c1f6352024-01-10 05:18:15 +000011026 return upb_Message_HasBaseField(UPB_UPCAST(msg), &field);
Joshua Haberman7ecf43f2022-03-14 13:11:29 -070011027}
Mike Kruskal3bc50492022-12-01 13:34:12 -080011028UPB_INLINE void google_protobuf_UninterpretedOption_clear_double_value(google_protobuf_UninterpretedOption* msg) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +000011029 const upb_MiniTableField field = {6, UPB_SIZE(40, 56), 67, kUpb_NoSub, 1, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)};
Protobuf Team Bot4e90ead2024-01-08 15:46:34 +000011030 upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
Joshua Habermand3995ec2022-09-30 16:54:39 -070011031}
Joshua Habermanf41049a2022-01-21 14:41:25 -080011032UPB_INLINE double google_protobuf_UninterpretedOption_double_value(const google_protobuf_UninterpretedOption* msg) {
Eric Salo8809a112022-11-21 13:01:06 -080011033 double default_val = 0;
11034 double ret;
Protobuf Team Bot03440ec2024-01-11 23:13:19 +000011035 const upb_MiniTableField field = {6, UPB_SIZE(40, 56), 67, kUpb_NoSub, 1, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)};
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +000011036 _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field,
11037 &default_val, &ret);
Eric Salo8809a112022-11-21 13:01:06 -080011038 return ret;
Joshua Habermanf41049a2022-01-21 14:41:25 -080011039}
Mike Kruskal3bc50492022-12-01 13:34:12 -080011040UPB_INLINE bool google_protobuf_UninterpretedOption_has_double_value(const google_protobuf_UninterpretedOption* msg) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +000011041 const upb_MiniTableField field = {6, UPB_SIZE(40, 56), 67, kUpb_NoSub, 1, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)};
Protobuf Team Bot8c1f6352024-01-10 05:18:15 +000011042 return upb_Message_HasBaseField(UPB_UPCAST(msg), &field);
Joshua Haberman7ecf43f2022-03-14 13:11:29 -070011043}
Mike Kruskal3bc50492022-12-01 13:34:12 -080011044UPB_INLINE void google_protobuf_UninterpretedOption_clear_string_value(google_protobuf_UninterpretedOption* msg) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +000011045 const upb_MiniTableField field = {7, UPB_SIZE(48, 64), 68, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
Protobuf Team Bot4e90ead2024-01-08 15:46:34 +000011046 upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
Joshua Habermand3995ec2022-09-30 16:54:39 -070011047}
Joshua Habermanf41049a2022-01-21 14:41:25 -080011048UPB_INLINE upb_StringView google_protobuf_UninterpretedOption_string_value(const google_protobuf_UninterpretedOption* msg) {
Eric Salo8809a112022-11-21 13:01:06 -080011049 upb_StringView default_val = upb_StringView_FromString("");
11050 upb_StringView ret;
Protobuf Team Bot03440ec2024-01-11 23:13:19 +000011051 const upb_MiniTableField field = {7, UPB_SIZE(48, 64), 68, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +000011052 _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field,
11053 &default_val, &ret);
Eric Salo8809a112022-11-21 13:01:06 -080011054 return ret;
Joshua Habermanf41049a2022-01-21 14:41:25 -080011055}
Mike Kruskal3bc50492022-12-01 13:34:12 -080011056UPB_INLINE bool google_protobuf_UninterpretedOption_has_string_value(const google_protobuf_UninterpretedOption* msg) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +000011057 const upb_MiniTableField field = {7, UPB_SIZE(48, 64), 68, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
Protobuf Team Bot8c1f6352024-01-10 05:18:15 +000011058 return upb_Message_HasBaseField(UPB_UPCAST(msg), &field);
Joshua Haberman7ecf43f2022-03-14 13:11:29 -070011059}
Mike Kruskal3bc50492022-12-01 13:34:12 -080011060UPB_INLINE void google_protobuf_UninterpretedOption_clear_aggregate_value(google_protobuf_UninterpretedOption* msg) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +000011061 const upb_MiniTableField field = {8, UPB_SIZE(56, 80), 69, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
Protobuf Team Bot4e90ead2024-01-08 15:46:34 +000011062 upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
Joshua Habermand3995ec2022-09-30 16:54:39 -070011063}
Joshua Habermanf41049a2022-01-21 14:41:25 -080011064UPB_INLINE upb_StringView google_protobuf_UninterpretedOption_aggregate_value(const google_protobuf_UninterpretedOption* msg) {
Eric Salo8809a112022-11-21 13:01:06 -080011065 upb_StringView default_val = upb_StringView_FromString("");
11066 upb_StringView ret;
Protobuf Team Bot03440ec2024-01-11 23:13:19 +000011067 const upb_MiniTableField field = {8, UPB_SIZE(56, 80), 69, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +000011068 _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field,
11069 &default_val, &ret);
Eric Salo8809a112022-11-21 13:01:06 -080011070 return ret;
Joshua Habermanf41049a2022-01-21 14:41:25 -080011071}
Mike Kruskal3bc50492022-12-01 13:34:12 -080011072UPB_INLINE bool google_protobuf_UninterpretedOption_has_aggregate_value(const google_protobuf_UninterpretedOption* msg) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +000011073 const upb_MiniTableField field = {8, UPB_SIZE(56, 80), 69, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
Protobuf Team Bot8c1f6352024-01-10 05:18:15 +000011074 return upb_Message_HasBaseField(UPB_UPCAST(msg), &field);
Mike Kruskal3bc50492022-12-01 13:34:12 -080011075}
Joshua Haberman9abf6e22021-01-13 12:16:25 -080011076
Eric Salob7d54ac2022-12-29 11:59:42 -080011077UPB_INLINE google_protobuf_UninterpretedOption_NamePart** google_protobuf_UninterpretedOption_mutable_name(google_protobuf_UninterpretedOption* msg, size_t* size) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +000011078 upb_MiniTableField field = {2, UPB_SIZE(12, 16), 0, 0, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
Protobuf Team Bota9387b52024-06-12 15:17:52 +000011079 UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__UninterpretedOption__NamePart_msg_init);
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +000011080 upb_Array* arr = upb_Message_GetMutableArray(UPB_UPCAST(msg), &field);
Eric Salob7d54ac2022-12-29 11:59:42 -080011081 if (arr) {
Protobuf Team Botf73985a2023-12-19 00:14:19 +000011082 if (size) *size = arr->UPB_PRIVATE(size);
Protobuf Team Bot81e54332024-01-11 21:04:07 +000011083 return (google_protobuf_UninterpretedOption_NamePart**)upb_Array_MutableDataPtr(arr);
Eric Salob7d54ac2022-12-29 11:59:42 -080011084 } else {
11085 if (size) *size = 0;
11086 return NULL;
11087 }
Joshua Haberman9abf6e22021-01-13 12:16:25 -080011088}
Eric Salob7d54ac2022-12-29 11:59:42 -080011089UPB_INLINE google_protobuf_UninterpretedOption_NamePart** google_protobuf_UninterpretedOption_resize_name(google_protobuf_UninterpretedOption* msg, size_t size, upb_Arena* arena) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +000011090 upb_MiniTableField field = {2, UPB_SIZE(12, 16), 0, 0, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +000011091 return (google_protobuf_UninterpretedOption_NamePart**)upb_Message_ResizeArrayUninitialized(UPB_UPCAST(msg),
11092 &field, size, arena);
Joshua Haberman9abf6e22021-01-13 12:16:25 -080011093}
Joshua Haberman7ecf43f2022-03-14 13:11:29 -070011094UPB_INLINE struct google_protobuf_UninterpretedOption_NamePart* google_protobuf_UninterpretedOption_add_name(google_protobuf_UninterpretedOption* msg, upb_Arena* arena) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +000011095 upb_MiniTableField field = {2, UPB_SIZE(12, 16), 0, 0, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
Protobuf Team Bota9387b52024-06-12 15:17:52 +000011096 UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__UninterpretedOption__NamePart_msg_init);
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +000011097 upb_Array* arr = upb_Message_GetOrCreateMutableArray(
11098 UPB_UPCAST(msg), &field, arena);
Protobuf Team Bot81e54332024-01-11 21:04:07 +000011099 if (!arr || !UPB_PRIVATE(_upb_Array_ResizeUninitialized)(
Protobuf Team Botf73985a2023-12-19 00:14:19 +000011100 arr, arr->UPB_PRIVATE(size) + 1, arena)) {
Eric Salob7d54ac2022-12-29 11:59:42 -080011101 return NULL;
11102 }
Protobuf Team Bot4ffe0862023-12-06 02:02:36 +000011103 struct google_protobuf_UninterpretedOption_NamePart* sub = (struct google_protobuf_UninterpretedOption_NamePart*)_upb_Message_New(&google__protobuf__UninterpretedOption__NamePart_msg_init, arena);
Eric Salob7d54ac2022-12-29 11:59:42 -080011104 if (!arr || !sub) return NULL;
Protobuf Team Botf73985a2023-12-19 00:14:19 +000011105 UPB_PRIVATE(_upb_Array_Set)
11106 (arr, arr->UPB_PRIVATE(size) - 1, &sub, sizeof(sub));
Joshua Haberman9abf6e22021-01-13 12:16:25 -080011107 return sub;
11108}
Joshua Habermanf41049a2022-01-21 14:41:25 -080011109UPB_INLINE void google_protobuf_UninterpretedOption_set_identifier_value(google_protobuf_UninterpretedOption *msg, upb_StringView value) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +000011110 const upb_MiniTableField field = {3, UPB_SIZE(16, 24), 64, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
Protobuf Team Botac32c972024-04-10 03:30:05 +000011111 upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
Mike Kruskal232ecf42023-01-14 00:09:40 -080011112}
11113UPB_INLINE void google_protobuf_UninterpretedOption_set_positive_int_value(google_protobuf_UninterpretedOption *msg, uint64_t value) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +000011114 const upb_MiniTableField field = {4, UPB_SIZE(24, 40), 65, kUpb_NoSub, 4, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)};
Protobuf Team Botac32c972024-04-10 03:30:05 +000011115 upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
Mike Kruskal232ecf42023-01-14 00:09:40 -080011116}
11117UPB_INLINE void google_protobuf_UninterpretedOption_set_negative_int_value(google_protobuf_UninterpretedOption *msg, int64_t value) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +000011118 const upb_MiniTableField field = {5, UPB_SIZE(32, 48), 66, kUpb_NoSub, 3, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)};
Protobuf Team Botac32c972024-04-10 03:30:05 +000011119 upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
Mike Kruskal232ecf42023-01-14 00:09:40 -080011120}
11121UPB_INLINE void google_protobuf_UninterpretedOption_set_double_value(google_protobuf_UninterpretedOption *msg, double value) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +000011122 const upb_MiniTableField field = {6, UPB_SIZE(40, 56), 67, kUpb_NoSub, 1, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)};
Protobuf Team Botac32c972024-04-10 03:30:05 +000011123 upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
Mike Kruskal232ecf42023-01-14 00:09:40 -080011124}
11125UPB_INLINE void google_protobuf_UninterpretedOption_set_string_value(google_protobuf_UninterpretedOption *msg, upb_StringView value) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +000011126 const upb_MiniTableField field = {7, UPB_SIZE(48, 64), 68, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
Protobuf Team Botac32c972024-04-10 03:30:05 +000011127 upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
Mike Kruskal232ecf42023-01-14 00:09:40 -080011128}
11129UPB_INLINE void google_protobuf_UninterpretedOption_set_aggregate_value(google_protobuf_UninterpretedOption *msg, upb_StringView value) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +000011130 const upb_MiniTableField field = {8, UPB_SIZE(56, 80), 69, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
Protobuf Team Botac32c972024-04-10 03:30:05 +000011131 upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
Joshua Haberman9abf6e22021-01-13 12:16:25 -080011132}
Mike Kruskal232ecf42023-01-14 00:09:40 -080011133
Joshua Haberman9abf6e22021-01-13 12:16:25 -080011134/* google.protobuf.UninterpretedOption.NamePart */
11135
Joshua Habermanf41049a2022-01-21 14:41:25 -080011136UPB_INLINE google_protobuf_UninterpretedOption_NamePart* google_protobuf_UninterpretedOption_NamePart_new(upb_Arena* arena) {
Protobuf Team Bot4ffe0862023-12-06 02:02:36 +000011137 return (google_protobuf_UninterpretedOption_NamePart*)_upb_Message_New(&google__protobuf__UninterpretedOption__NamePart_msg_init, arena);
Joshua Haberman9abf6e22021-01-13 12:16:25 -080011138}
Joshua Habermanf41049a2022-01-21 14:41:25 -080011139UPB_INLINE google_protobuf_UninterpretedOption_NamePart* google_protobuf_UninterpretedOption_NamePart_parse(const char* buf, size_t size, upb_Arena* arena) {
11140 google_protobuf_UninterpretedOption_NamePart* ret = google_protobuf_UninterpretedOption_NamePart_new(arena);
Joshua Haberman9d578a32021-08-02 15:32:01 -070011141 if (!ret) return NULL;
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +000011142 if (upb_Decode(buf, size, UPB_UPCAST(ret), &google__protobuf__UninterpretedOption__NamePart_msg_init, NULL, 0, arena) !=
11143 kUpb_DecodeStatus_Ok) {
Joshua Haberman9d578a32021-08-02 15:32:01 -070011144 return NULL;
11145 }
11146 return ret;
Joshua Haberman9abf6e22021-01-13 12:16:25 -080011147}
Joshua Habermanf41049a2022-01-21 14:41:25 -080011148UPB_INLINE google_protobuf_UninterpretedOption_NamePart* google_protobuf_UninterpretedOption_NamePart_parse_ex(const char* buf, size_t size,
11149 const upb_ExtensionRegistry* extreg,
11150 int options, upb_Arena* arena) {
11151 google_protobuf_UninterpretedOption_NamePart* ret = google_protobuf_UninterpretedOption_NamePart_new(arena);
11152 if (!ret) return NULL;
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +000011153 if (upb_Decode(buf, size, UPB_UPCAST(ret), &google__protobuf__UninterpretedOption__NamePart_msg_init, extreg, options,
11154 arena) != kUpb_DecodeStatus_Ok) {
Joshua Habermanf41049a2022-01-21 14:41:25 -080011155 return NULL;
11156 }
11157 return ret;
11158}
11159UPB_INLINE char* google_protobuf_UninterpretedOption_NamePart_serialize(const google_protobuf_UninterpretedOption_NamePart* msg, upb_Arena* arena, size_t* len) {
Joshua Habermand3995ec2022-09-30 16:54:39 -070011160 char* ptr;
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +000011161 (void)upb_Encode(UPB_UPCAST(msg), &google__protobuf__UninterpretedOption__NamePart_msg_init, 0, arena, &ptr, len);
Joshua Habermand3995ec2022-09-30 16:54:39 -070011162 return ptr;
Joshua Habermanf41049a2022-01-21 14:41:25 -080011163}
11164UPB_INLINE char* google_protobuf_UninterpretedOption_NamePart_serialize_ex(const google_protobuf_UninterpretedOption_NamePart* msg, int options,
11165 upb_Arena* arena, size_t* len) {
Joshua Habermand3995ec2022-09-30 16:54:39 -070011166 char* ptr;
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +000011167 (void)upb_Encode(UPB_UPCAST(msg), &google__protobuf__UninterpretedOption__NamePart_msg_init, options, arena, &ptr, len);
Joshua Habermand3995ec2022-09-30 16:54:39 -070011168 return ptr;
Joshua Habermanf41049a2022-01-21 14:41:25 -080011169}
Mike Kruskal3bc50492022-12-01 13:34:12 -080011170UPB_INLINE void google_protobuf_UninterpretedOption_NamePart_clear_name_part(google_protobuf_UninterpretedOption_NamePart* msg) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +000011171 const upb_MiniTableField field = {1, UPB_SIZE(12, 16), 64, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
Protobuf Team Bot4e90ead2024-01-08 15:46:34 +000011172 upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
Joshua Habermand3995ec2022-09-30 16:54:39 -070011173}
Joshua Habermanf41049a2022-01-21 14:41:25 -080011174UPB_INLINE upb_StringView google_protobuf_UninterpretedOption_NamePart_name_part(const google_protobuf_UninterpretedOption_NamePart* msg) {
Eric Salo8809a112022-11-21 13:01:06 -080011175 upb_StringView default_val = upb_StringView_FromString("");
11176 upb_StringView ret;
Protobuf Team Bot03440ec2024-01-11 23:13:19 +000011177 const upb_MiniTableField field = {1, UPB_SIZE(12, 16), 64, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +000011178 _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field,
11179 &default_val, &ret);
Eric Salo8809a112022-11-21 13:01:06 -080011180 return ret;
Joshua Habermanf41049a2022-01-21 14:41:25 -080011181}
Mike Kruskal3bc50492022-12-01 13:34:12 -080011182UPB_INLINE bool google_protobuf_UninterpretedOption_NamePart_has_name_part(const google_protobuf_UninterpretedOption_NamePart* msg) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +000011183 const upb_MiniTableField field = {1, UPB_SIZE(12, 16), 64, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
Protobuf Team Bot8c1f6352024-01-10 05:18:15 +000011184 return upb_Message_HasBaseField(UPB_UPCAST(msg), &field);
Joshua Haberman7ecf43f2022-03-14 13:11:29 -070011185}
Mike Kruskal3bc50492022-12-01 13:34:12 -080011186UPB_INLINE void google_protobuf_UninterpretedOption_NamePart_clear_is_extension(google_protobuf_UninterpretedOption_NamePart* msg) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +000011187 const upb_MiniTableField field = {2, 9, 65, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
Protobuf Team Bot4e90ead2024-01-08 15:46:34 +000011188 upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
Joshua Habermand3995ec2022-09-30 16:54:39 -070011189}
Joshua Habermanf41049a2022-01-21 14:41:25 -080011190UPB_INLINE bool google_protobuf_UninterpretedOption_NamePart_is_extension(const google_protobuf_UninterpretedOption_NamePart* msg) {
Eric Salo8809a112022-11-21 13:01:06 -080011191 bool default_val = false;
11192 bool ret;
Protobuf Team Bot03440ec2024-01-11 23:13:19 +000011193 const upb_MiniTableField field = {2, 9, 65, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +000011194 _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field,
11195 &default_val, &ret);
Eric Salo8809a112022-11-21 13:01:06 -080011196 return ret;
Joshua Haberman9abf6e22021-01-13 12:16:25 -080011197}
Mike Kruskal3bc50492022-12-01 13:34:12 -080011198UPB_INLINE bool google_protobuf_UninterpretedOption_NamePart_has_is_extension(const google_protobuf_UninterpretedOption_NamePart* msg) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +000011199 const upb_MiniTableField field = {2, 9, 65, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
Protobuf Team Bot8c1f6352024-01-10 05:18:15 +000011200 return upb_Message_HasBaseField(UPB_UPCAST(msg), &field);
Mike Kruskal3bc50492022-12-01 13:34:12 -080011201}
Joshua Haberman9abf6e22021-01-13 12:16:25 -080011202
Joshua Habermanf41049a2022-01-21 14:41:25 -080011203UPB_INLINE void google_protobuf_UninterpretedOption_NamePart_set_name_part(google_protobuf_UninterpretedOption_NamePart *msg, upb_StringView value) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +000011204 const upb_MiniTableField field = {1, UPB_SIZE(12, 16), 64, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
Protobuf Team Botac32c972024-04-10 03:30:05 +000011205 upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
Mike Kruskal232ecf42023-01-14 00:09:40 -080011206}
11207UPB_INLINE void google_protobuf_UninterpretedOption_NamePart_set_is_extension(google_protobuf_UninterpretedOption_NamePart *msg, bool value) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +000011208 const upb_MiniTableField field = {2, 9, 65, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
Protobuf Team Botac32c972024-04-10 03:30:05 +000011209 upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
Joshua Haberman9abf6e22021-01-13 12:16:25 -080011210}
Mike Kruskal232ecf42023-01-14 00:09:40 -080011211
Mike Kruskal4f9e4172023-06-30 20:14:50 -070011212/* google.protobuf.FeatureSet */
11213
11214UPB_INLINE google_protobuf_FeatureSet* google_protobuf_FeatureSet_new(upb_Arena* arena) {
Protobuf Team Bot4ffe0862023-12-06 02:02:36 +000011215 return (google_protobuf_FeatureSet*)_upb_Message_New(&google__protobuf__FeatureSet_msg_init, arena);
Mike Kruskal4f9e4172023-06-30 20:14:50 -070011216}
11217UPB_INLINE google_protobuf_FeatureSet* google_protobuf_FeatureSet_parse(const char* buf, size_t size, upb_Arena* arena) {
11218 google_protobuf_FeatureSet* ret = google_protobuf_FeatureSet_new(arena);
11219 if (!ret) return NULL;
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +000011220 if (upb_Decode(buf, size, UPB_UPCAST(ret), &google__protobuf__FeatureSet_msg_init, NULL, 0, arena) !=
11221 kUpb_DecodeStatus_Ok) {
Mike Kruskal4f9e4172023-06-30 20:14:50 -070011222 return NULL;
11223 }
11224 return ret;
11225}
11226UPB_INLINE google_protobuf_FeatureSet* google_protobuf_FeatureSet_parse_ex(const char* buf, size_t size,
11227 const upb_ExtensionRegistry* extreg,
11228 int options, upb_Arena* arena) {
11229 google_protobuf_FeatureSet* ret = google_protobuf_FeatureSet_new(arena);
11230 if (!ret) return NULL;
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +000011231 if (upb_Decode(buf, size, UPB_UPCAST(ret), &google__protobuf__FeatureSet_msg_init, extreg, options,
11232 arena) != kUpb_DecodeStatus_Ok) {
Mike Kruskal4f9e4172023-06-30 20:14:50 -070011233 return NULL;
11234 }
11235 return ret;
11236}
11237UPB_INLINE char* google_protobuf_FeatureSet_serialize(const google_protobuf_FeatureSet* msg, upb_Arena* arena, size_t* len) {
11238 char* ptr;
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +000011239 (void)upb_Encode(UPB_UPCAST(msg), &google__protobuf__FeatureSet_msg_init, 0, arena, &ptr, len);
Mike Kruskal4f9e4172023-06-30 20:14:50 -070011240 return ptr;
11241}
11242UPB_INLINE char* google_protobuf_FeatureSet_serialize_ex(const google_protobuf_FeatureSet* msg, int options,
11243 upb_Arena* arena, size_t* len) {
11244 char* ptr;
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +000011245 (void)upb_Encode(UPB_UPCAST(msg), &google__protobuf__FeatureSet_msg_init, options, arena, &ptr, len);
Mike Kruskal4f9e4172023-06-30 20:14:50 -070011246 return ptr;
11247}
11248UPB_INLINE void google_protobuf_FeatureSet_clear_field_presence(google_protobuf_FeatureSet* msg) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +000011249 const upb_MiniTableField field = {1, 12, 64, 0, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
Protobuf Team Bot4e90ead2024-01-08 15:46:34 +000011250 upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
Mike Kruskal4f9e4172023-06-30 20:14:50 -070011251}
11252UPB_INLINE int32_t google_protobuf_FeatureSet_field_presence(const google_protobuf_FeatureSet* msg) {
11253 int32_t default_val = 0;
11254 int32_t ret;
Protobuf Team Bot03440ec2024-01-11 23:13:19 +000011255 const upb_MiniTableField field = {1, 12, 64, 0, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +000011256 _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field,
11257 &default_val, &ret);
Mike Kruskal4f9e4172023-06-30 20:14:50 -070011258 return ret;
11259}
11260UPB_INLINE bool google_protobuf_FeatureSet_has_field_presence(const google_protobuf_FeatureSet* msg) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +000011261 const upb_MiniTableField field = {1, 12, 64, 0, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
Protobuf Team Bot8c1f6352024-01-10 05:18:15 +000011262 return upb_Message_HasBaseField(UPB_UPCAST(msg), &field);
Mike Kruskal4f9e4172023-06-30 20:14:50 -070011263}
11264UPB_INLINE void google_protobuf_FeatureSet_clear_enum_type(google_protobuf_FeatureSet* msg) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +000011265 const upb_MiniTableField field = {2, 16, 65, 1, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
Protobuf Team Bot4e90ead2024-01-08 15:46:34 +000011266 upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
Mike Kruskal4f9e4172023-06-30 20:14:50 -070011267}
11268UPB_INLINE int32_t google_protobuf_FeatureSet_enum_type(const google_protobuf_FeatureSet* msg) {
11269 int32_t default_val = 0;
11270 int32_t ret;
Protobuf Team Bot03440ec2024-01-11 23:13:19 +000011271 const upb_MiniTableField field = {2, 16, 65, 1, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +000011272 _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field,
11273 &default_val, &ret);
Mike Kruskal4f9e4172023-06-30 20:14:50 -070011274 return ret;
11275}
11276UPB_INLINE bool google_protobuf_FeatureSet_has_enum_type(const google_protobuf_FeatureSet* msg) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +000011277 const upb_MiniTableField field = {2, 16, 65, 1, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
Protobuf Team Bot8c1f6352024-01-10 05:18:15 +000011278 return upb_Message_HasBaseField(UPB_UPCAST(msg), &field);
Mike Kruskal4f9e4172023-06-30 20:14:50 -070011279}
11280UPB_INLINE void google_protobuf_FeatureSet_clear_repeated_field_encoding(google_protobuf_FeatureSet* msg) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +000011281 const upb_MiniTableField field = {3, 20, 66, 2, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
Protobuf Team Bot4e90ead2024-01-08 15:46:34 +000011282 upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
Mike Kruskal4f9e4172023-06-30 20:14:50 -070011283}
11284UPB_INLINE int32_t google_protobuf_FeatureSet_repeated_field_encoding(const google_protobuf_FeatureSet* msg) {
11285 int32_t default_val = 0;
11286 int32_t ret;
Protobuf Team Bot03440ec2024-01-11 23:13:19 +000011287 const upb_MiniTableField field = {3, 20, 66, 2, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +000011288 _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field,
11289 &default_val, &ret);
Mike Kruskal4f9e4172023-06-30 20:14:50 -070011290 return ret;
11291}
11292UPB_INLINE bool google_protobuf_FeatureSet_has_repeated_field_encoding(const google_protobuf_FeatureSet* msg) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +000011293 const upb_MiniTableField field = {3, 20, 66, 2, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
Protobuf Team Bot8c1f6352024-01-10 05:18:15 +000011294 return upb_Message_HasBaseField(UPB_UPCAST(msg), &field);
Mike Kruskal4f9e4172023-06-30 20:14:50 -070011295}
Protobuf Team Bot61127952023-09-26 20:07:33 +000011296UPB_INLINE void google_protobuf_FeatureSet_clear_utf8_validation(google_protobuf_FeatureSet* msg) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +000011297 const upb_MiniTableField field = {4, 24, 67, 3, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
Protobuf Team Bot4e90ead2024-01-08 15:46:34 +000011298 upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
Protobuf Team Bot61127952023-09-26 20:07:33 +000011299}
11300UPB_INLINE int32_t google_protobuf_FeatureSet_utf8_validation(const google_protobuf_FeatureSet* msg) {
11301 int32_t default_val = 0;
11302 int32_t ret;
Protobuf Team Bot03440ec2024-01-11 23:13:19 +000011303 const upb_MiniTableField field = {4, 24, 67, 3, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +000011304 _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field,
11305 &default_val, &ret);
Protobuf Team Bot61127952023-09-26 20:07:33 +000011306 return ret;
11307}
11308UPB_INLINE bool google_protobuf_FeatureSet_has_utf8_validation(const google_protobuf_FeatureSet* msg) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +000011309 const upb_MiniTableField field = {4, 24, 67, 3, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
Protobuf Team Bot8c1f6352024-01-10 05:18:15 +000011310 return upb_Message_HasBaseField(UPB_UPCAST(msg), &field);
Protobuf Team Bot61127952023-09-26 20:07:33 +000011311}
Mike Kruskal4f9e4172023-06-30 20:14:50 -070011312UPB_INLINE void google_protobuf_FeatureSet_clear_message_encoding(google_protobuf_FeatureSet* msg) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +000011313 const upb_MiniTableField field = {5, 28, 68, 4, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
Protobuf Team Bot4e90ead2024-01-08 15:46:34 +000011314 upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
Mike Kruskal4f9e4172023-06-30 20:14:50 -070011315}
11316UPB_INLINE int32_t google_protobuf_FeatureSet_message_encoding(const google_protobuf_FeatureSet* msg) {
11317 int32_t default_val = 0;
11318 int32_t ret;
Protobuf Team Bot03440ec2024-01-11 23:13:19 +000011319 const upb_MiniTableField field = {5, 28, 68, 4, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +000011320 _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field,
11321 &default_val, &ret);
Mike Kruskal4f9e4172023-06-30 20:14:50 -070011322 return ret;
11323}
11324UPB_INLINE bool google_protobuf_FeatureSet_has_message_encoding(const google_protobuf_FeatureSet* msg) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +000011325 const upb_MiniTableField field = {5, 28, 68, 4, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
Protobuf Team Bot8c1f6352024-01-10 05:18:15 +000011326 return upb_Message_HasBaseField(UPB_UPCAST(msg), &field);
Mike Kruskal4f9e4172023-06-30 20:14:50 -070011327}
11328UPB_INLINE void google_protobuf_FeatureSet_clear_json_format(google_protobuf_FeatureSet* msg) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +000011329 const upb_MiniTableField field = {6, 32, 69, 5, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
Protobuf Team Bot4e90ead2024-01-08 15:46:34 +000011330 upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
Mike Kruskal4f9e4172023-06-30 20:14:50 -070011331}
11332UPB_INLINE int32_t google_protobuf_FeatureSet_json_format(const google_protobuf_FeatureSet* msg) {
11333 int32_t default_val = 0;
11334 int32_t ret;
Protobuf Team Bot03440ec2024-01-11 23:13:19 +000011335 const upb_MiniTableField field = {6, 32, 69, 5, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +000011336 _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field,
11337 &default_val, &ret);
Mike Kruskal4f9e4172023-06-30 20:14:50 -070011338 return ret;
11339}
11340UPB_INLINE bool google_protobuf_FeatureSet_has_json_format(const google_protobuf_FeatureSet* msg) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +000011341 const upb_MiniTableField field = {6, 32, 69, 5, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
Protobuf Team Bot8c1f6352024-01-10 05:18:15 +000011342 return upb_Message_HasBaseField(UPB_UPCAST(msg), &field);
Mike Kruskal4f9e4172023-06-30 20:14:50 -070011343}
11344
11345UPB_INLINE void google_protobuf_FeatureSet_set_field_presence(google_protobuf_FeatureSet *msg, int32_t value) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +000011346 const upb_MiniTableField field = {1, 12, 64, 0, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
Protobuf Team Botac32c972024-04-10 03:30:05 +000011347 upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
Mike Kruskal4f9e4172023-06-30 20:14:50 -070011348}
11349UPB_INLINE void google_protobuf_FeatureSet_set_enum_type(google_protobuf_FeatureSet *msg, int32_t value) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +000011350 const upb_MiniTableField field = {2, 16, 65, 1, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
Protobuf Team Botac32c972024-04-10 03:30:05 +000011351 upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
Mike Kruskal4f9e4172023-06-30 20:14:50 -070011352}
11353UPB_INLINE void google_protobuf_FeatureSet_set_repeated_field_encoding(google_protobuf_FeatureSet *msg, int32_t value) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +000011354 const upb_MiniTableField field = {3, 20, 66, 2, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
Protobuf Team Botac32c972024-04-10 03:30:05 +000011355 upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
Mike Kruskal4f9e4172023-06-30 20:14:50 -070011356}
Protobuf Team Bot61127952023-09-26 20:07:33 +000011357UPB_INLINE void google_protobuf_FeatureSet_set_utf8_validation(google_protobuf_FeatureSet *msg, int32_t value) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +000011358 const upb_MiniTableField field = {4, 24, 67, 3, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
Protobuf Team Botac32c972024-04-10 03:30:05 +000011359 upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
Protobuf Team Bot61127952023-09-26 20:07:33 +000011360}
Mike Kruskal4f9e4172023-06-30 20:14:50 -070011361UPB_INLINE void google_protobuf_FeatureSet_set_message_encoding(google_protobuf_FeatureSet *msg, int32_t value) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +000011362 const upb_MiniTableField field = {5, 28, 68, 4, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
Protobuf Team Botac32c972024-04-10 03:30:05 +000011363 upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
Mike Kruskal4f9e4172023-06-30 20:14:50 -070011364}
11365UPB_INLINE void google_protobuf_FeatureSet_set_json_format(google_protobuf_FeatureSet *msg, int32_t value) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +000011366 const upb_MiniTableField field = {6, 32, 69, 5, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
Protobuf Team Botac32c972024-04-10 03:30:05 +000011367 upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
Mike Kruskal4f9e4172023-06-30 20:14:50 -070011368}
11369
Mike Kruskalba964702023-08-22 17:37:48 -070011370/* google.protobuf.FeatureSetDefaults */
11371
11372UPB_INLINE google_protobuf_FeatureSetDefaults* google_protobuf_FeatureSetDefaults_new(upb_Arena* arena) {
Protobuf Team Bot4ffe0862023-12-06 02:02:36 +000011373 return (google_protobuf_FeatureSetDefaults*)_upb_Message_New(&google__protobuf__FeatureSetDefaults_msg_init, arena);
Mike Kruskalba964702023-08-22 17:37:48 -070011374}
11375UPB_INLINE google_protobuf_FeatureSetDefaults* google_protobuf_FeatureSetDefaults_parse(const char* buf, size_t size, upb_Arena* arena) {
11376 google_protobuf_FeatureSetDefaults* ret = google_protobuf_FeatureSetDefaults_new(arena);
11377 if (!ret) return NULL;
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +000011378 if (upb_Decode(buf, size, UPB_UPCAST(ret), &google__protobuf__FeatureSetDefaults_msg_init, NULL, 0, arena) !=
11379 kUpb_DecodeStatus_Ok) {
Mike Kruskalba964702023-08-22 17:37:48 -070011380 return NULL;
11381 }
11382 return ret;
11383}
11384UPB_INLINE google_protobuf_FeatureSetDefaults* google_protobuf_FeatureSetDefaults_parse_ex(const char* buf, size_t size,
11385 const upb_ExtensionRegistry* extreg,
11386 int options, upb_Arena* arena) {
11387 google_protobuf_FeatureSetDefaults* ret = google_protobuf_FeatureSetDefaults_new(arena);
11388 if (!ret) return NULL;
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +000011389 if (upb_Decode(buf, size, UPB_UPCAST(ret), &google__protobuf__FeatureSetDefaults_msg_init, extreg, options,
11390 arena) != kUpb_DecodeStatus_Ok) {
Mike Kruskalba964702023-08-22 17:37:48 -070011391 return NULL;
11392 }
11393 return ret;
11394}
11395UPB_INLINE char* google_protobuf_FeatureSetDefaults_serialize(const google_protobuf_FeatureSetDefaults* msg, upb_Arena* arena, size_t* len) {
11396 char* ptr;
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +000011397 (void)upb_Encode(UPB_UPCAST(msg), &google__protobuf__FeatureSetDefaults_msg_init, 0, arena, &ptr, len);
Mike Kruskalba964702023-08-22 17:37:48 -070011398 return ptr;
11399}
11400UPB_INLINE char* google_protobuf_FeatureSetDefaults_serialize_ex(const google_protobuf_FeatureSetDefaults* msg, int options,
11401 upb_Arena* arena, size_t* len) {
11402 char* ptr;
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +000011403 (void)upb_Encode(UPB_UPCAST(msg), &google__protobuf__FeatureSetDefaults_msg_init, options, arena, &ptr, len);
Mike Kruskalba964702023-08-22 17:37:48 -070011404 return ptr;
11405}
11406UPB_INLINE void google_protobuf_FeatureSetDefaults_clear_defaults(google_protobuf_FeatureSetDefaults* msg) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +000011407 const upb_MiniTableField field = {1, UPB_SIZE(12, 24), 0, 0, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
Protobuf Team Bot4e90ead2024-01-08 15:46:34 +000011408 upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
Mike Kruskalba964702023-08-22 17:37:48 -070011409}
11410UPB_INLINE const google_protobuf_FeatureSetDefaults_FeatureSetEditionDefault* const* google_protobuf_FeatureSetDefaults_defaults(const google_protobuf_FeatureSetDefaults* msg, size_t* size) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +000011411 const upb_MiniTableField field = {1, UPB_SIZE(12, 24), 0, 0, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
Protobuf Team Bota9387b52024-06-12 15:17:52 +000011412 UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__FeatureSetDefaults__FeatureSetEditionDefault_msg_init);
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +000011413 const upb_Array* arr = upb_Message_GetArray(UPB_UPCAST(msg), &field);
Mike Kruskalba964702023-08-22 17:37:48 -070011414 if (arr) {
Protobuf Team Botf73985a2023-12-19 00:14:19 +000011415 if (size) *size = arr->UPB_PRIVATE(size);
Protobuf Team Bot81e54332024-01-11 21:04:07 +000011416 return (const google_protobuf_FeatureSetDefaults_FeatureSetEditionDefault* const*)upb_Array_DataPtr(arr);
Mike Kruskalba964702023-08-22 17:37:48 -070011417 } else {
11418 if (size) *size = 0;
11419 return NULL;
11420 }
11421}
11422UPB_INLINE const upb_Array* _google_protobuf_FeatureSetDefaults_defaults_upb_array(const google_protobuf_FeatureSetDefaults* msg, size_t* size) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +000011423 const upb_MiniTableField field = {1, UPB_SIZE(12, 24), 0, 0, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
Protobuf Team Bota9387b52024-06-12 15:17:52 +000011424 UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__FeatureSetDefaults__FeatureSetEditionDefault_msg_init);
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +000011425 const upb_Array* arr = upb_Message_GetArray(UPB_UPCAST(msg), &field);
Mike Kruskalba964702023-08-22 17:37:48 -070011426 if (size) {
Protobuf Team Botf73985a2023-12-19 00:14:19 +000011427 *size = arr ? arr->UPB_PRIVATE(size) : 0;
Mike Kruskalba964702023-08-22 17:37:48 -070011428 }
11429 return arr;
11430}
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +000011431UPB_INLINE upb_Array* _google_protobuf_FeatureSetDefaults_defaults_mutable_upb_array(google_protobuf_FeatureSetDefaults* msg, size_t* size, upb_Arena* arena) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +000011432 const upb_MiniTableField field = {1, UPB_SIZE(12, 24), 0, 0, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
Protobuf Team Bota9387b52024-06-12 15:17:52 +000011433 UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__FeatureSetDefaults__FeatureSetEditionDefault_msg_init);
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +000011434 upb_Array* arr = upb_Message_GetOrCreateMutableArray(UPB_UPCAST(msg),
11435 &field, arena);
Mike Kruskalba964702023-08-22 17:37:48 -070011436 if (size) {
Protobuf Team Botf73985a2023-12-19 00:14:19 +000011437 *size = arr ? arr->UPB_PRIVATE(size) : 0;
Mike Kruskalba964702023-08-22 17:37:48 -070011438 }
11439 return arr;
11440}
Mike Kruskalba964702023-08-22 17:37:48 -070011441UPB_INLINE void google_protobuf_FeatureSetDefaults_clear_minimum_edition(google_protobuf_FeatureSetDefaults* msg) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +000011442 const upb_MiniTableField field = {4, UPB_SIZE(16, 12), 64, 1, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
Protobuf Team Bot4e90ead2024-01-08 15:46:34 +000011443 upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
Mike Kruskalba964702023-08-22 17:37:48 -070011444}
Protobuf Team Botab58f8f2023-09-26 16:14:19 +000011445UPB_INLINE int32_t google_protobuf_FeatureSetDefaults_minimum_edition(const google_protobuf_FeatureSetDefaults* msg) {
11446 int32_t default_val = 0;
11447 int32_t ret;
Protobuf Team Bot03440ec2024-01-11 23:13:19 +000011448 const upb_MiniTableField field = {4, UPB_SIZE(16, 12), 64, 1, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +000011449 _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field,
11450 &default_val, &ret);
Mike Kruskalba964702023-08-22 17:37:48 -070011451 return ret;
11452}
11453UPB_INLINE bool google_protobuf_FeatureSetDefaults_has_minimum_edition(const google_protobuf_FeatureSetDefaults* msg) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +000011454 const upb_MiniTableField field = {4, UPB_SIZE(16, 12), 64, 1, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
Protobuf Team Bot8c1f6352024-01-10 05:18:15 +000011455 return upb_Message_HasBaseField(UPB_UPCAST(msg), &field);
Mike Kruskalba964702023-08-22 17:37:48 -070011456}
11457UPB_INLINE void google_protobuf_FeatureSetDefaults_clear_maximum_edition(google_protobuf_FeatureSetDefaults* msg) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +000011458 const upb_MiniTableField field = {5, UPB_SIZE(20, 16), 65, 2, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
Protobuf Team Bot4e90ead2024-01-08 15:46:34 +000011459 upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
Mike Kruskalba964702023-08-22 17:37:48 -070011460}
Protobuf Team Botab58f8f2023-09-26 16:14:19 +000011461UPB_INLINE int32_t google_protobuf_FeatureSetDefaults_maximum_edition(const google_protobuf_FeatureSetDefaults* msg) {
11462 int32_t default_val = 0;
11463 int32_t ret;
Protobuf Team Bot03440ec2024-01-11 23:13:19 +000011464 const upb_MiniTableField field = {5, UPB_SIZE(20, 16), 65, 2, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +000011465 _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field,
11466 &default_val, &ret);
Mike Kruskalba964702023-08-22 17:37:48 -070011467 return ret;
11468}
11469UPB_INLINE bool google_protobuf_FeatureSetDefaults_has_maximum_edition(const google_protobuf_FeatureSetDefaults* msg) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +000011470 const upb_MiniTableField field = {5, UPB_SIZE(20, 16), 65, 2, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
Protobuf Team Bot8c1f6352024-01-10 05:18:15 +000011471 return upb_Message_HasBaseField(UPB_UPCAST(msg), &field);
Mike Kruskalba964702023-08-22 17:37:48 -070011472}
11473
11474UPB_INLINE google_protobuf_FeatureSetDefaults_FeatureSetEditionDefault** google_protobuf_FeatureSetDefaults_mutable_defaults(google_protobuf_FeatureSetDefaults* msg, size_t* size) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +000011475 upb_MiniTableField field = {1, UPB_SIZE(12, 24), 0, 0, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
Protobuf Team Bota9387b52024-06-12 15:17:52 +000011476 UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__FeatureSetDefaults__FeatureSetEditionDefault_msg_init);
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +000011477 upb_Array* arr = upb_Message_GetMutableArray(UPB_UPCAST(msg), &field);
Mike Kruskalba964702023-08-22 17:37:48 -070011478 if (arr) {
Protobuf Team Botf73985a2023-12-19 00:14:19 +000011479 if (size) *size = arr->UPB_PRIVATE(size);
Protobuf Team Bot81e54332024-01-11 21:04:07 +000011480 return (google_protobuf_FeatureSetDefaults_FeatureSetEditionDefault**)upb_Array_MutableDataPtr(arr);
Mike Kruskalba964702023-08-22 17:37:48 -070011481 } else {
11482 if (size) *size = 0;
11483 return NULL;
11484 }
11485}
11486UPB_INLINE google_protobuf_FeatureSetDefaults_FeatureSetEditionDefault** google_protobuf_FeatureSetDefaults_resize_defaults(google_protobuf_FeatureSetDefaults* msg, size_t size, upb_Arena* arena) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +000011487 upb_MiniTableField field = {1, UPB_SIZE(12, 24), 0, 0, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +000011488 return (google_protobuf_FeatureSetDefaults_FeatureSetEditionDefault**)upb_Message_ResizeArrayUninitialized(UPB_UPCAST(msg),
11489 &field, size, arena);
Mike Kruskalba964702023-08-22 17:37:48 -070011490}
11491UPB_INLINE struct google_protobuf_FeatureSetDefaults_FeatureSetEditionDefault* google_protobuf_FeatureSetDefaults_add_defaults(google_protobuf_FeatureSetDefaults* msg, upb_Arena* arena) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +000011492 upb_MiniTableField field = {1, UPB_SIZE(12, 24), 0, 0, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
Protobuf Team Bota9387b52024-06-12 15:17:52 +000011493 UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__FeatureSetDefaults__FeatureSetEditionDefault_msg_init);
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +000011494 upb_Array* arr = upb_Message_GetOrCreateMutableArray(
11495 UPB_UPCAST(msg), &field, arena);
Protobuf Team Bot81e54332024-01-11 21:04:07 +000011496 if (!arr || !UPB_PRIVATE(_upb_Array_ResizeUninitialized)(
Protobuf Team Botf73985a2023-12-19 00:14:19 +000011497 arr, arr->UPB_PRIVATE(size) + 1, arena)) {
Mike Kruskalba964702023-08-22 17:37:48 -070011498 return NULL;
11499 }
Protobuf Team Bot4ffe0862023-12-06 02:02:36 +000011500 struct google_protobuf_FeatureSetDefaults_FeatureSetEditionDefault* sub = (struct google_protobuf_FeatureSetDefaults_FeatureSetEditionDefault*)_upb_Message_New(&google__protobuf__FeatureSetDefaults__FeatureSetEditionDefault_msg_init, arena);
Mike Kruskalba964702023-08-22 17:37:48 -070011501 if (!arr || !sub) return NULL;
Protobuf Team Botf73985a2023-12-19 00:14:19 +000011502 UPB_PRIVATE(_upb_Array_Set)
11503 (arr, arr->UPB_PRIVATE(size) - 1, &sub, sizeof(sub));
Mike Kruskalba964702023-08-22 17:37:48 -070011504 return sub;
11505}
Protobuf Team Botab58f8f2023-09-26 16:14:19 +000011506UPB_INLINE void google_protobuf_FeatureSetDefaults_set_minimum_edition(google_protobuf_FeatureSetDefaults *msg, int32_t value) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +000011507 const upb_MiniTableField field = {4, UPB_SIZE(16, 12), 64, 1, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
Protobuf Team Botac32c972024-04-10 03:30:05 +000011508 upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
Mike Kruskalba964702023-08-22 17:37:48 -070011509}
Protobuf Team Botab58f8f2023-09-26 16:14:19 +000011510UPB_INLINE void google_protobuf_FeatureSetDefaults_set_maximum_edition(google_protobuf_FeatureSetDefaults *msg, int32_t value) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +000011511 const upb_MiniTableField field = {5, UPB_SIZE(20, 16), 65, 2, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
Protobuf Team Botac32c972024-04-10 03:30:05 +000011512 upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
Mike Kruskalba964702023-08-22 17:37:48 -070011513}
11514
11515/* google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault */
11516
11517UPB_INLINE google_protobuf_FeatureSetDefaults_FeatureSetEditionDefault* google_protobuf_FeatureSetDefaults_FeatureSetEditionDefault_new(upb_Arena* arena) {
Protobuf Team Bot4ffe0862023-12-06 02:02:36 +000011518 return (google_protobuf_FeatureSetDefaults_FeatureSetEditionDefault*)_upb_Message_New(&google__protobuf__FeatureSetDefaults__FeatureSetEditionDefault_msg_init, arena);
Mike Kruskalba964702023-08-22 17:37:48 -070011519}
11520UPB_INLINE google_protobuf_FeatureSetDefaults_FeatureSetEditionDefault* google_protobuf_FeatureSetDefaults_FeatureSetEditionDefault_parse(const char* buf, size_t size, upb_Arena* arena) {
11521 google_protobuf_FeatureSetDefaults_FeatureSetEditionDefault* ret = google_protobuf_FeatureSetDefaults_FeatureSetEditionDefault_new(arena);
11522 if (!ret) return NULL;
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +000011523 if (upb_Decode(buf, size, UPB_UPCAST(ret), &google__protobuf__FeatureSetDefaults__FeatureSetEditionDefault_msg_init, NULL, 0, arena) !=
11524 kUpb_DecodeStatus_Ok) {
Mike Kruskalba964702023-08-22 17:37:48 -070011525 return NULL;
11526 }
11527 return ret;
11528}
11529UPB_INLINE google_protobuf_FeatureSetDefaults_FeatureSetEditionDefault* google_protobuf_FeatureSetDefaults_FeatureSetEditionDefault_parse_ex(const char* buf, size_t size,
11530 const upb_ExtensionRegistry* extreg,
11531 int options, upb_Arena* arena) {
11532 google_protobuf_FeatureSetDefaults_FeatureSetEditionDefault* ret = google_protobuf_FeatureSetDefaults_FeatureSetEditionDefault_new(arena);
11533 if (!ret) return NULL;
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +000011534 if (upb_Decode(buf, size, UPB_UPCAST(ret), &google__protobuf__FeatureSetDefaults__FeatureSetEditionDefault_msg_init, extreg, options,
11535 arena) != kUpb_DecodeStatus_Ok) {
Mike Kruskalba964702023-08-22 17:37:48 -070011536 return NULL;
11537 }
11538 return ret;
11539}
11540UPB_INLINE char* google_protobuf_FeatureSetDefaults_FeatureSetEditionDefault_serialize(const google_protobuf_FeatureSetDefaults_FeatureSetEditionDefault* msg, upb_Arena* arena, size_t* len) {
11541 char* ptr;
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +000011542 (void)upb_Encode(UPB_UPCAST(msg), &google__protobuf__FeatureSetDefaults__FeatureSetEditionDefault_msg_init, 0, arena, &ptr, len);
Mike Kruskalba964702023-08-22 17:37:48 -070011543 return ptr;
11544}
11545UPB_INLINE char* google_protobuf_FeatureSetDefaults_FeatureSetEditionDefault_serialize_ex(const google_protobuf_FeatureSetDefaults_FeatureSetEditionDefault* msg, int options,
11546 upb_Arena* arena, size_t* len) {
11547 char* ptr;
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +000011548 (void)upb_Encode(UPB_UPCAST(msg), &google__protobuf__FeatureSetDefaults__FeatureSetEditionDefault_msg_init, options, arena, &ptr, len);
Mike Kruskalba964702023-08-22 17:37:48 -070011549 return ptr;
11550}
Protobuf Team Botab58f8f2023-09-26 16:14:19 +000011551UPB_INLINE void google_protobuf_FeatureSetDefaults_FeatureSetEditionDefault_clear_edition(google_protobuf_FeatureSetDefaults_FeatureSetEditionDefault* msg) {
Protobuf Team Bot6afdd5a2024-04-17 22:09:39 +000011552 const upb_MiniTableField field = {3, 12, 64, 2, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
Protobuf Team Bot4e90ead2024-01-08 15:46:34 +000011553 upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
Protobuf Team Botfa98bb32023-09-01 18:11:09 +000011554}
Protobuf Team Botab58f8f2023-09-26 16:14:19 +000011555UPB_INLINE int32_t google_protobuf_FeatureSetDefaults_FeatureSetEditionDefault_edition(const google_protobuf_FeatureSetDefaults_FeatureSetEditionDefault* msg) {
Protobuf Team Botfa98bb32023-09-01 18:11:09 +000011556 int32_t default_val = 0;
11557 int32_t ret;
Protobuf Team Bot6afdd5a2024-04-17 22:09:39 +000011558 const upb_MiniTableField field = {3, 12, 64, 2, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +000011559 _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field,
11560 &default_val, &ret);
Protobuf Team Botfa98bb32023-09-01 18:11:09 +000011561 return ret;
11562}
Protobuf Team Botab58f8f2023-09-26 16:14:19 +000011563UPB_INLINE bool google_protobuf_FeatureSetDefaults_FeatureSetEditionDefault_has_edition(const google_protobuf_FeatureSetDefaults_FeatureSetEditionDefault* msg) {
Protobuf Team Bot6afdd5a2024-04-17 22:09:39 +000011564 const upb_MiniTableField field = {3, 12, 64, 2, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
Protobuf Team Bot85edb7e2024-04-03 02:43:54 +000011565 return upb_Message_HasBaseField(UPB_UPCAST(msg), &field);
11566}
11567UPB_INLINE void google_protobuf_FeatureSetDefaults_FeatureSetEditionDefault_clear_overridable_features(google_protobuf_FeatureSetDefaults_FeatureSetEditionDefault* msg) {
Protobuf Team Bot6afdd5a2024-04-17 22:09:39 +000011568 const upb_MiniTableField field = {4, 16, 65, 0, 11, (int)kUpb_FieldMode_Scalar | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
Protobuf Team Bot85edb7e2024-04-03 02:43:54 +000011569 upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
11570}
11571UPB_INLINE const google_protobuf_FeatureSet* google_protobuf_FeatureSetDefaults_FeatureSetEditionDefault_overridable_features(const google_protobuf_FeatureSetDefaults_FeatureSetEditionDefault* msg) {
11572 const google_protobuf_FeatureSet* default_val = NULL;
11573 const google_protobuf_FeatureSet* ret;
Protobuf Team Bot6afdd5a2024-04-17 22:09:39 +000011574 const upb_MiniTableField field = {4, 16, 65, 0, 11, (int)kUpb_FieldMode_Scalar | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
Protobuf Team Bota9387b52024-06-12 15:17:52 +000011575 UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__FeatureSet_msg_init);
Protobuf Team Bot85edb7e2024-04-03 02:43:54 +000011576 _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field,
11577 &default_val, &ret);
11578 return ret;
11579}
11580UPB_INLINE bool google_protobuf_FeatureSetDefaults_FeatureSetEditionDefault_has_overridable_features(const google_protobuf_FeatureSetDefaults_FeatureSetEditionDefault* msg) {
Protobuf Team Bot6afdd5a2024-04-17 22:09:39 +000011581 const upb_MiniTableField field = {4, 16, 65, 0, 11, (int)kUpb_FieldMode_Scalar | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
Protobuf Team Bot85edb7e2024-04-03 02:43:54 +000011582 return upb_Message_HasBaseField(UPB_UPCAST(msg), &field);
11583}
11584UPB_INLINE void google_protobuf_FeatureSetDefaults_FeatureSetEditionDefault_clear_fixed_features(google_protobuf_FeatureSetDefaults_FeatureSetEditionDefault* msg) {
Protobuf Team Bot6afdd5a2024-04-17 22:09:39 +000011585 const upb_MiniTableField field = {5, UPB_SIZE(20, 24), 66, 1, 11, (int)kUpb_FieldMode_Scalar | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
Protobuf Team Bot85edb7e2024-04-03 02:43:54 +000011586 upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
11587}
11588UPB_INLINE const google_protobuf_FeatureSet* google_protobuf_FeatureSetDefaults_FeatureSetEditionDefault_fixed_features(const google_protobuf_FeatureSetDefaults_FeatureSetEditionDefault* msg) {
11589 const google_protobuf_FeatureSet* default_val = NULL;
11590 const google_protobuf_FeatureSet* ret;
Protobuf Team Bot6afdd5a2024-04-17 22:09:39 +000011591 const upb_MiniTableField field = {5, UPB_SIZE(20, 24), 66, 1, 11, (int)kUpb_FieldMode_Scalar | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
Protobuf Team Bota9387b52024-06-12 15:17:52 +000011592 UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__FeatureSet_msg_init);
Protobuf Team Bot85edb7e2024-04-03 02:43:54 +000011593 _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field,
11594 &default_val, &ret);
11595 return ret;
11596}
11597UPB_INLINE bool google_protobuf_FeatureSetDefaults_FeatureSetEditionDefault_has_fixed_features(const google_protobuf_FeatureSetDefaults_FeatureSetEditionDefault* msg) {
Protobuf Team Bot6afdd5a2024-04-17 22:09:39 +000011598 const upb_MiniTableField field = {5, UPB_SIZE(20, 24), 66, 1, 11, (int)kUpb_FieldMode_Scalar | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
Protobuf Team Bot8c1f6352024-01-10 05:18:15 +000011599 return upb_Message_HasBaseField(UPB_UPCAST(msg), &field);
Protobuf Team Botfa98bb32023-09-01 18:11:09 +000011600}
Mike Kruskalba964702023-08-22 17:37:48 -070011601
Protobuf Team Botab58f8f2023-09-26 16:14:19 +000011602UPB_INLINE void google_protobuf_FeatureSetDefaults_FeatureSetEditionDefault_set_edition(google_protobuf_FeatureSetDefaults_FeatureSetEditionDefault *msg, int32_t value) {
Protobuf Team Bot6afdd5a2024-04-17 22:09:39 +000011603 const upb_MiniTableField field = {3, 12, 64, 2, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
Protobuf Team Botac32c972024-04-10 03:30:05 +000011604 upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
Protobuf Team Botfa98bb32023-09-01 18:11:09 +000011605}
Protobuf Team Bot85edb7e2024-04-03 02:43:54 +000011606UPB_INLINE void google_protobuf_FeatureSetDefaults_FeatureSetEditionDefault_set_overridable_features(google_protobuf_FeatureSetDefaults_FeatureSetEditionDefault *msg, google_protobuf_FeatureSet* value) {
Protobuf Team Bot6afdd5a2024-04-17 22:09:39 +000011607 const upb_MiniTableField field = {4, 16, 65, 0, 11, (int)kUpb_FieldMode_Scalar | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
Protobuf Team Bota9387b52024-06-12 15:17:52 +000011608 UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__FeatureSet_msg_init);
Protobuf Team Botac32c972024-04-10 03:30:05 +000011609 upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
Protobuf Team Bot85edb7e2024-04-03 02:43:54 +000011610}
11611UPB_INLINE struct google_protobuf_FeatureSet* google_protobuf_FeatureSetDefaults_FeatureSetEditionDefault_mutable_overridable_features(google_protobuf_FeatureSetDefaults_FeatureSetEditionDefault* msg, upb_Arena* arena) {
11612 struct google_protobuf_FeatureSet* sub = (struct google_protobuf_FeatureSet*)google_protobuf_FeatureSetDefaults_FeatureSetEditionDefault_overridable_features(msg);
11613 if (sub == NULL) {
11614 sub = (struct google_protobuf_FeatureSet*)_upb_Message_New(&google__protobuf__FeatureSet_msg_init, arena);
11615 if (sub) google_protobuf_FeatureSetDefaults_FeatureSetEditionDefault_set_overridable_features(msg, sub);
11616 }
11617 return sub;
11618}
11619UPB_INLINE void google_protobuf_FeatureSetDefaults_FeatureSetEditionDefault_set_fixed_features(google_protobuf_FeatureSetDefaults_FeatureSetEditionDefault *msg, google_protobuf_FeatureSet* value) {
Protobuf Team Bot6afdd5a2024-04-17 22:09:39 +000011620 const upb_MiniTableField field = {5, UPB_SIZE(20, 24), 66, 1, 11, (int)kUpb_FieldMode_Scalar | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
Protobuf Team Bota9387b52024-06-12 15:17:52 +000011621 UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__FeatureSet_msg_init);
Protobuf Team Botac32c972024-04-10 03:30:05 +000011622 upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
Protobuf Team Bot85edb7e2024-04-03 02:43:54 +000011623}
11624UPB_INLINE struct google_protobuf_FeatureSet* google_protobuf_FeatureSetDefaults_FeatureSetEditionDefault_mutable_fixed_features(google_protobuf_FeatureSetDefaults_FeatureSetEditionDefault* msg, upb_Arena* arena) {
11625 struct google_protobuf_FeatureSet* sub = (struct google_protobuf_FeatureSet*)google_protobuf_FeatureSetDefaults_FeatureSetEditionDefault_fixed_features(msg);
11626 if (sub == NULL) {
11627 sub = (struct google_protobuf_FeatureSet*)_upb_Message_New(&google__protobuf__FeatureSet_msg_init, arena);
11628 if (sub) google_protobuf_FeatureSetDefaults_FeatureSetEditionDefault_set_fixed_features(msg, sub);
11629 }
11630 return sub;
11631}
Mike Kruskalba964702023-08-22 17:37:48 -070011632
Joshua Haberman9abf6e22021-01-13 12:16:25 -080011633/* google.protobuf.SourceCodeInfo */
11634
Joshua Habermanf41049a2022-01-21 14:41:25 -080011635UPB_INLINE google_protobuf_SourceCodeInfo* google_protobuf_SourceCodeInfo_new(upb_Arena* arena) {
Protobuf Team Bot4ffe0862023-12-06 02:02:36 +000011636 return (google_protobuf_SourceCodeInfo*)_upb_Message_New(&google__protobuf__SourceCodeInfo_msg_init, arena);
Joshua Haberman9abf6e22021-01-13 12:16:25 -080011637}
Joshua Habermanf41049a2022-01-21 14:41:25 -080011638UPB_INLINE google_protobuf_SourceCodeInfo* google_protobuf_SourceCodeInfo_parse(const char* buf, size_t size, upb_Arena* arena) {
11639 google_protobuf_SourceCodeInfo* ret = google_protobuf_SourceCodeInfo_new(arena);
Joshua Haberman9d578a32021-08-02 15:32:01 -070011640 if (!ret) return NULL;
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +000011641 if (upb_Decode(buf, size, UPB_UPCAST(ret), &google__protobuf__SourceCodeInfo_msg_init, NULL, 0, arena) !=
11642 kUpb_DecodeStatus_Ok) {
Joshua Haberman9d578a32021-08-02 15:32:01 -070011643 return NULL;
11644 }
11645 return ret;
Joshua Haberman9abf6e22021-01-13 12:16:25 -080011646}
Joshua Habermanf41049a2022-01-21 14:41:25 -080011647UPB_INLINE google_protobuf_SourceCodeInfo* google_protobuf_SourceCodeInfo_parse_ex(const char* buf, size_t size,
11648 const upb_ExtensionRegistry* extreg,
11649 int options, upb_Arena* arena) {
11650 google_protobuf_SourceCodeInfo* ret = google_protobuf_SourceCodeInfo_new(arena);
11651 if (!ret) return NULL;
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +000011652 if (upb_Decode(buf, size, UPB_UPCAST(ret), &google__protobuf__SourceCodeInfo_msg_init, extreg, options,
11653 arena) != kUpb_DecodeStatus_Ok) {
Joshua Habermanf41049a2022-01-21 14:41:25 -080011654 return NULL;
11655 }
11656 return ret;
Joshua Haberman9abf6e22021-01-13 12:16:25 -080011657}
Joshua Habermanf41049a2022-01-21 14:41:25 -080011658UPB_INLINE char* google_protobuf_SourceCodeInfo_serialize(const google_protobuf_SourceCodeInfo* msg, upb_Arena* arena, size_t* len) {
Joshua Habermand3995ec2022-09-30 16:54:39 -070011659 char* ptr;
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +000011660 (void)upb_Encode(UPB_UPCAST(msg), &google__protobuf__SourceCodeInfo_msg_init, 0, arena, &ptr, len);
Joshua Habermand3995ec2022-09-30 16:54:39 -070011661 return ptr;
Joshua Habermanf41049a2022-01-21 14:41:25 -080011662}
11663UPB_INLINE char* google_protobuf_SourceCodeInfo_serialize_ex(const google_protobuf_SourceCodeInfo* msg, int options,
11664 upb_Arena* arena, size_t* len) {
Joshua Habermand3995ec2022-09-30 16:54:39 -070011665 char* ptr;
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +000011666 (void)upb_Encode(UPB_UPCAST(msg), &google__protobuf__SourceCodeInfo_msg_init, options, arena, &ptr, len);
Joshua Habermand3995ec2022-09-30 16:54:39 -070011667 return ptr;
Joshua Habermanf41049a2022-01-21 14:41:25 -080011668}
Mike Kruskal3bc50492022-12-01 13:34:12 -080011669UPB_INLINE void google_protobuf_SourceCodeInfo_clear_location(google_protobuf_SourceCodeInfo* msg) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +000011670 const upb_MiniTableField field = {1, 8, 0, 0, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
Protobuf Team Bot4e90ead2024-01-08 15:46:34 +000011671 upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
Joshua Habermand3995ec2022-09-30 16:54:39 -070011672}
Eric Salob7d54ac2022-12-29 11:59:42 -080011673UPB_INLINE const google_protobuf_SourceCodeInfo_Location* const* google_protobuf_SourceCodeInfo_location(const google_protobuf_SourceCodeInfo* msg, size_t* size) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +000011674 const upb_MiniTableField field = {1, 8, 0, 0, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
Protobuf Team Bota9387b52024-06-12 15:17:52 +000011675 UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__SourceCodeInfo__Location_msg_init);
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +000011676 const upb_Array* arr = upb_Message_GetArray(UPB_UPCAST(msg), &field);
Eric Salob7d54ac2022-12-29 11:59:42 -080011677 if (arr) {
Protobuf Team Botf73985a2023-12-19 00:14:19 +000011678 if (size) *size = arr->UPB_PRIVATE(size);
Protobuf Team Bot81e54332024-01-11 21:04:07 +000011679 return (const google_protobuf_SourceCodeInfo_Location* const*)upb_Array_DataPtr(arr);
Eric Salob7d54ac2022-12-29 11:59:42 -080011680 } else {
11681 if (size) *size = 0;
11682 return NULL;
11683 }
Joshua Haberman7ecf43f2022-03-14 13:11:29 -070011684}
Deanna Garciab26afb52023-04-25 13:37:18 -070011685UPB_INLINE const upb_Array* _google_protobuf_SourceCodeInfo_location_upb_array(const google_protobuf_SourceCodeInfo* msg, size_t* size) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +000011686 const upb_MiniTableField field = {1, 8, 0, 0, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
Protobuf Team Bota9387b52024-06-12 15:17:52 +000011687 UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__SourceCodeInfo__Location_msg_init);
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +000011688 const upb_Array* arr = upb_Message_GetArray(UPB_UPCAST(msg), &field);
Deanna Garciab26afb52023-04-25 13:37:18 -070011689 if (size) {
Protobuf Team Botf73985a2023-12-19 00:14:19 +000011690 *size = arr ? arr->UPB_PRIVATE(size) : 0;
Deanna Garciab26afb52023-04-25 13:37:18 -070011691 }
11692 return arr;
11693}
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +000011694UPB_INLINE upb_Array* _google_protobuf_SourceCodeInfo_location_mutable_upb_array(google_protobuf_SourceCodeInfo* msg, size_t* size, upb_Arena* arena) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +000011695 const upb_MiniTableField field = {1, 8, 0, 0, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
Protobuf Team Bota9387b52024-06-12 15:17:52 +000011696 UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__SourceCodeInfo__Location_msg_init);
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +000011697 upb_Array* arr = upb_Message_GetOrCreateMutableArray(UPB_UPCAST(msg),
11698 &field, arena);
Deanna Garciab26afb52023-04-25 13:37:18 -070011699 if (size) {
Protobuf Team Botf73985a2023-12-19 00:14:19 +000011700 *size = arr ? arr->UPB_PRIVATE(size) : 0;
Deanna Garciab26afb52023-04-25 13:37:18 -070011701 }
11702 return arr;
11703}
Joshua Haberman9abf6e22021-01-13 12:16:25 -080011704
Eric Salob7d54ac2022-12-29 11:59:42 -080011705UPB_INLINE google_protobuf_SourceCodeInfo_Location** google_protobuf_SourceCodeInfo_mutable_location(google_protobuf_SourceCodeInfo* msg, size_t* size) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +000011706 upb_MiniTableField field = {1, 8, 0, 0, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
Protobuf Team Bota9387b52024-06-12 15:17:52 +000011707 UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__SourceCodeInfo__Location_msg_init);
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +000011708 upb_Array* arr = upb_Message_GetMutableArray(UPB_UPCAST(msg), &field);
Eric Salob7d54ac2022-12-29 11:59:42 -080011709 if (arr) {
Protobuf Team Botf73985a2023-12-19 00:14:19 +000011710 if (size) *size = arr->UPB_PRIVATE(size);
Protobuf Team Bot81e54332024-01-11 21:04:07 +000011711 return (google_protobuf_SourceCodeInfo_Location**)upb_Array_MutableDataPtr(arr);
Eric Salob7d54ac2022-12-29 11:59:42 -080011712 } else {
11713 if (size) *size = 0;
11714 return NULL;
11715 }
Joshua Haberman9abf6e22021-01-13 12:16:25 -080011716}
Eric Salob7d54ac2022-12-29 11:59:42 -080011717UPB_INLINE google_protobuf_SourceCodeInfo_Location** google_protobuf_SourceCodeInfo_resize_location(google_protobuf_SourceCodeInfo* msg, size_t size, upb_Arena* arena) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +000011718 upb_MiniTableField field = {1, 8, 0, 0, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +000011719 return (google_protobuf_SourceCodeInfo_Location**)upb_Message_ResizeArrayUninitialized(UPB_UPCAST(msg),
11720 &field, size, arena);
Joshua Haberman9abf6e22021-01-13 12:16:25 -080011721}
Joshua Haberman7ecf43f2022-03-14 13:11:29 -070011722UPB_INLINE struct google_protobuf_SourceCodeInfo_Location* google_protobuf_SourceCodeInfo_add_location(google_protobuf_SourceCodeInfo* msg, upb_Arena* arena) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +000011723 upb_MiniTableField field = {1, 8, 0, 0, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
Protobuf Team Bota9387b52024-06-12 15:17:52 +000011724 UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__SourceCodeInfo__Location_msg_init);
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +000011725 upb_Array* arr = upb_Message_GetOrCreateMutableArray(
11726 UPB_UPCAST(msg), &field, arena);
Protobuf Team Bot81e54332024-01-11 21:04:07 +000011727 if (!arr || !UPB_PRIVATE(_upb_Array_ResizeUninitialized)(
Protobuf Team Botf73985a2023-12-19 00:14:19 +000011728 arr, arr->UPB_PRIVATE(size) + 1, arena)) {
Eric Salob7d54ac2022-12-29 11:59:42 -080011729 return NULL;
11730 }
Protobuf Team Bot4ffe0862023-12-06 02:02:36 +000011731 struct google_protobuf_SourceCodeInfo_Location* sub = (struct google_protobuf_SourceCodeInfo_Location*)_upb_Message_New(&google__protobuf__SourceCodeInfo__Location_msg_init, arena);
Eric Salob7d54ac2022-12-29 11:59:42 -080011732 if (!arr || !sub) return NULL;
Protobuf Team Botf73985a2023-12-19 00:14:19 +000011733 UPB_PRIVATE(_upb_Array_Set)
11734 (arr, arr->UPB_PRIVATE(size) - 1, &sub, sizeof(sub));
Joshua Haberman9abf6e22021-01-13 12:16:25 -080011735 return sub;
11736}
11737
11738/* google.protobuf.SourceCodeInfo.Location */
11739
Joshua Habermanf41049a2022-01-21 14:41:25 -080011740UPB_INLINE google_protobuf_SourceCodeInfo_Location* google_protobuf_SourceCodeInfo_Location_new(upb_Arena* arena) {
Protobuf Team Bot4ffe0862023-12-06 02:02:36 +000011741 return (google_protobuf_SourceCodeInfo_Location*)_upb_Message_New(&google__protobuf__SourceCodeInfo__Location_msg_init, arena);
Joshua Haberman9abf6e22021-01-13 12:16:25 -080011742}
Joshua Habermanf41049a2022-01-21 14:41:25 -080011743UPB_INLINE google_protobuf_SourceCodeInfo_Location* google_protobuf_SourceCodeInfo_Location_parse(const char* buf, size_t size, upb_Arena* arena) {
11744 google_protobuf_SourceCodeInfo_Location* ret = google_protobuf_SourceCodeInfo_Location_new(arena);
Joshua Haberman9d578a32021-08-02 15:32:01 -070011745 if (!ret) return NULL;
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +000011746 if (upb_Decode(buf, size, UPB_UPCAST(ret), &google__protobuf__SourceCodeInfo__Location_msg_init, NULL, 0, arena) !=
11747 kUpb_DecodeStatus_Ok) {
Joshua Haberman9d578a32021-08-02 15:32:01 -070011748 return NULL;
11749 }
11750 return ret;
Joshua Haberman9abf6e22021-01-13 12:16:25 -080011751}
Joshua Habermanf41049a2022-01-21 14:41:25 -080011752UPB_INLINE google_protobuf_SourceCodeInfo_Location* google_protobuf_SourceCodeInfo_Location_parse_ex(const char* buf, size_t size,
11753 const upb_ExtensionRegistry* extreg,
11754 int options, upb_Arena* arena) {
11755 google_protobuf_SourceCodeInfo_Location* ret = google_protobuf_SourceCodeInfo_Location_new(arena);
11756 if (!ret) return NULL;
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +000011757 if (upb_Decode(buf, size, UPB_UPCAST(ret), &google__protobuf__SourceCodeInfo__Location_msg_init, extreg, options,
11758 arena) != kUpb_DecodeStatus_Ok) {
Joshua Habermanf41049a2022-01-21 14:41:25 -080011759 return NULL;
11760 }
11761 return ret;
Joshua Haberman9abf6e22021-01-13 12:16:25 -080011762}
Joshua Habermanf41049a2022-01-21 14:41:25 -080011763UPB_INLINE char* google_protobuf_SourceCodeInfo_Location_serialize(const google_protobuf_SourceCodeInfo_Location* msg, upb_Arena* arena, size_t* len) {
Joshua Habermand3995ec2022-09-30 16:54:39 -070011764 char* ptr;
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +000011765 (void)upb_Encode(UPB_UPCAST(msg), &google__protobuf__SourceCodeInfo__Location_msg_init, 0, arena, &ptr, len);
Joshua Habermand3995ec2022-09-30 16:54:39 -070011766 return ptr;
Joshua Habermanf41049a2022-01-21 14:41:25 -080011767}
11768UPB_INLINE char* google_protobuf_SourceCodeInfo_Location_serialize_ex(const google_protobuf_SourceCodeInfo_Location* msg, int options,
11769 upb_Arena* arena, size_t* len) {
Joshua Habermand3995ec2022-09-30 16:54:39 -070011770 char* ptr;
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +000011771 (void)upb_Encode(UPB_UPCAST(msg), &google__protobuf__SourceCodeInfo__Location_msg_init, options, arena, &ptr, len);
Joshua Habermand3995ec2022-09-30 16:54:39 -070011772 return ptr;
11773}
Mike Kruskal3bc50492022-12-01 13:34:12 -080011774UPB_INLINE void google_protobuf_SourceCodeInfo_Location_clear_path(google_protobuf_SourceCodeInfo_Location* msg) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +000011775 const upb_MiniTableField field = {1, UPB_SIZE(12, 16), 0, kUpb_NoSub, 5, (int)kUpb_FieldMode_Array | (int)kUpb_LabelFlags_IsPacked | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
Protobuf Team Bot4e90ead2024-01-08 15:46:34 +000011776 upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
Joshua Habermanf41049a2022-01-21 14:41:25 -080011777}
Eric Salob7d54ac2022-12-29 11:59:42 -080011778UPB_INLINE int32_t const* google_protobuf_SourceCodeInfo_Location_path(const google_protobuf_SourceCodeInfo_Location* msg, size_t* size) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +000011779 const upb_MiniTableField field = {1, UPB_SIZE(12, 16), 0, kUpb_NoSub, 5, (int)kUpb_FieldMode_Array | (int)kUpb_LabelFlags_IsPacked | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +000011780 const upb_Array* arr = upb_Message_GetArray(UPB_UPCAST(msg), &field);
Eric Salob7d54ac2022-12-29 11:59:42 -080011781 if (arr) {
Protobuf Team Botf73985a2023-12-19 00:14:19 +000011782 if (size) *size = arr->UPB_PRIVATE(size);
Protobuf Team Bot81e54332024-01-11 21:04:07 +000011783 return (int32_t const*)upb_Array_DataPtr(arr);
Eric Salob7d54ac2022-12-29 11:59:42 -080011784 } else {
11785 if (size) *size = 0;
11786 return NULL;
11787 }
Joshua Habermand3995ec2022-09-30 16:54:39 -070011788}
Deanna Garciab26afb52023-04-25 13:37:18 -070011789UPB_INLINE const upb_Array* _google_protobuf_SourceCodeInfo_Location_path_upb_array(const google_protobuf_SourceCodeInfo_Location* msg, size_t* size) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +000011790 const upb_MiniTableField field = {1, UPB_SIZE(12, 16), 0, kUpb_NoSub, 5, (int)kUpb_FieldMode_Array | (int)kUpb_LabelFlags_IsPacked | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +000011791 const upb_Array* arr = upb_Message_GetArray(UPB_UPCAST(msg), &field);
Deanna Garciab26afb52023-04-25 13:37:18 -070011792 if (size) {
Protobuf Team Botf73985a2023-12-19 00:14:19 +000011793 *size = arr ? arr->UPB_PRIVATE(size) : 0;
Deanna Garciab26afb52023-04-25 13:37:18 -070011794 }
11795 return arr;
11796}
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +000011797UPB_INLINE upb_Array* _google_protobuf_SourceCodeInfo_Location_path_mutable_upb_array(google_protobuf_SourceCodeInfo_Location* msg, size_t* size, upb_Arena* arena) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +000011798 const upb_MiniTableField field = {1, UPB_SIZE(12, 16), 0, kUpb_NoSub, 5, (int)kUpb_FieldMode_Array | (int)kUpb_LabelFlags_IsPacked | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +000011799 upb_Array* arr = upb_Message_GetOrCreateMutableArray(UPB_UPCAST(msg),
11800 &field, arena);
Deanna Garciab26afb52023-04-25 13:37:18 -070011801 if (size) {
Protobuf Team Botf73985a2023-12-19 00:14:19 +000011802 *size = arr ? arr->UPB_PRIVATE(size) : 0;
Deanna Garciab26afb52023-04-25 13:37:18 -070011803 }
11804 return arr;
11805}
Mike Kruskal3bc50492022-12-01 13:34:12 -080011806UPB_INLINE void google_protobuf_SourceCodeInfo_Location_clear_span(google_protobuf_SourceCodeInfo_Location* msg) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +000011807 const upb_MiniTableField field = {2, UPB_SIZE(16, 24), 0, kUpb_NoSub, 5, (int)kUpb_FieldMode_Array | (int)kUpb_LabelFlags_IsPacked | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
Protobuf Team Bot4e90ead2024-01-08 15:46:34 +000011808 upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
Joshua Haberman7ecf43f2022-03-14 13:11:29 -070011809}
Eric Salob7d54ac2022-12-29 11:59:42 -080011810UPB_INLINE int32_t const* google_protobuf_SourceCodeInfo_Location_span(const google_protobuf_SourceCodeInfo_Location* msg, size_t* size) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +000011811 const upb_MiniTableField field = {2, UPB_SIZE(16, 24), 0, kUpb_NoSub, 5, (int)kUpb_FieldMode_Array | (int)kUpb_LabelFlags_IsPacked | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +000011812 const upb_Array* arr = upb_Message_GetArray(UPB_UPCAST(msg), &field);
Eric Salob7d54ac2022-12-29 11:59:42 -080011813 if (arr) {
Protobuf Team Botf73985a2023-12-19 00:14:19 +000011814 if (size) *size = arr->UPB_PRIVATE(size);
Protobuf Team Bot81e54332024-01-11 21:04:07 +000011815 return (int32_t const*)upb_Array_DataPtr(arr);
Eric Salob7d54ac2022-12-29 11:59:42 -080011816 } else {
11817 if (size) *size = 0;
11818 return NULL;
11819 }
Joshua Haberman7ecf43f2022-03-14 13:11:29 -070011820}
Deanna Garciab26afb52023-04-25 13:37:18 -070011821UPB_INLINE const upb_Array* _google_protobuf_SourceCodeInfo_Location_span_upb_array(const google_protobuf_SourceCodeInfo_Location* msg, size_t* size) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +000011822 const upb_MiniTableField field = {2, UPB_SIZE(16, 24), 0, kUpb_NoSub, 5, (int)kUpb_FieldMode_Array | (int)kUpb_LabelFlags_IsPacked | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +000011823 const upb_Array* arr = upb_Message_GetArray(UPB_UPCAST(msg), &field);
Deanna Garciab26afb52023-04-25 13:37:18 -070011824 if (size) {
Protobuf Team Botf73985a2023-12-19 00:14:19 +000011825 *size = arr ? arr->UPB_PRIVATE(size) : 0;
Deanna Garciab26afb52023-04-25 13:37:18 -070011826 }
11827 return arr;
11828}
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +000011829UPB_INLINE upb_Array* _google_protobuf_SourceCodeInfo_Location_span_mutable_upb_array(google_protobuf_SourceCodeInfo_Location* msg, size_t* size, upb_Arena* arena) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +000011830 const upb_MiniTableField field = {2, UPB_SIZE(16, 24), 0, kUpb_NoSub, 5, (int)kUpb_FieldMode_Array | (int)kUpb_LabelFlags_IsPacked | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +000011831 upb_Array* arr = upb_Message_GetOrCreateMutableArray(UPB_UPCAST(msg),
11832 &field, arena);
Deanna Garciab26afb52023-04-25 13:37:18 -070011833 if (size) {
Protobuf Team Botf73985a2023-12-19 00:14:19 +000011834 *size = arr ? arr->UPB_PRIVATE(size) : 0;
Deanna Garciab26afb52023-04-25 13:37:18 -070011835 }
11836 return arr;
11837}
Mike Kruskal3bc50492022-12-01 13:34:12 -080011838UPB_INLINE void google_protobuf_SourceCodeInfo_Location_clear_leading_comments(google_protobuf_SourceCodeInfo_Location* msg) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +000011839 const upb_MiniTableField field = {3, UPB_SIZE(24, 32), 64, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
Protobuf Team Bot4e90ead2024-01-08 15:46:34 +000011840 upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
Joshua Habermand3995ec2022-09-30 16:54:39 -070011841}
Joshua Habermanf41049a2022-01-21 14:41:25 -080011842UPB_INLINE upb_StringView google_protobuf_SourceCodeInfo_Location_leading_comments(const google_protobuf_SourceCodeInfo_Location* msg) {
Eric Salo8809a112022-11-21 13:01:06 -080011843 upb_StringView default_val = upb_StringView_FromString("");
11844 upb_StringView ret;
Protobuf Team Bot03440ec2024-01-11 23:13:19 +000011845 const upb_MiniTableField field = {3, UPB_SIZE(24, 32), 64, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +000011846 _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field,
11847 &default_val, &ret);
Eric Salo8809a112022-11-21 13:01:06 -080011848 return ret;
Joshua Habermanf41049a2022-01-21 14:41:25 -080011849}
Mike Kruskal3bc50492022-12-01 13:34:12 -080011850UPB_INLINE bool google_protobuf_SourceCodeInfo_Location_has_leading_comments(const google_protobuf_SourceCodeInfo_Location* msg) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +000011851 const upb_MiniTableField field = {3, UPB_SIZE(24, 32), 64, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
Protobuf Team Bot8c1f6352024-01-10 05:18:15 +000011852 return upb_Message_HasBaseField(UPB_UPCAST(msg), &field);
Joshua Haberman7ecf43f2022-03-14 13:11:29 -070011853}
Mike Kruskal3bc50492022-12-01 13:34:12 -080011854UPB_INLINE void google_protobuf_SourceCodeInfo_Location_clear_trailing_comments(google_protobuf_SourceCodeInfo_Location* msg) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +000011855 const upb_MiniTableField field = {4, UPB_SIZE(32, 48), 65, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
Protobuf Team Bot4e90ead2024-01-08 15:46:34 +000011856 upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
Joshua Habermand3995ec2022-09-30 16:54:39 -070011857}
Joshua Habermanf41049a2022-01-21 14:41:25 -080011858UPB_INLINE upb_StringView google_protobuf_SourceCodeInfo_Location_trailing_comments(const google_protobuf_SourceCodeInfo_Location* msg) {
Eric Salo8809a112022-11-21 13:01:06 -080011859 upb_StringView default_val = upb_StringView_FromString("");
11860 upb_StringView ret;
Protobuf Team Bot03440ec2024-01-11 23:13:19 +000011861 const upb_MiniTableField field = {4, UPB_SIZE(32, 48), 65, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +000011862 _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field,
11863 &default_val, &ret);
Eric Salo8809a112022-11-21 13:01:06 -080011864 return ret;
Joshua Habermand3995ec2022-09-30 16:54:39 -070011865}
Mike Kruskal3bc50492022-12-01 13:34:12 -080011866UPB_INLINE bool google_protobuf_SourceCodeInfo_Location_has_trailing_comments(const google_protobuf_SourceCodeInfo_Location* msg) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +000011867 const upb_MiniTableField field = {4, UPB_SIZE(32, 48), 65, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
Protobuf Team Bot8c1f6352024-01-10 05:18:15 +000011868 return upb_Message_HasBaseField(UPB_UPCAST(msg), &field);
Mike Kruskal3bc50492022-12-01 13:34:12 -080011869}
11870UPB_INLINE void google_protobuf_SourceCodeInfo_Location_clear_leading_detached_comments(google_protobuf_SourceCodeInfo_Location* msg) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +000011871 const upb_MiniTableField field = {6, UPB_SIZE(20, 64), 0, kUpb_NoSub, 12, (int)kUpb_FieldMode_Array | (int)kUpb_LabelFlags_IsAlternate | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
Protobuf Team Bot4e90ead2024-01-08 15:46:34 +000011872 upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
Joshua Habermanf41049a2022-01-21 14:41:25 -080011873}
Eric Salob7d54ac2022-12-29 11:59:42 -080011874UPB_INLINE upb_StringView const* google_protobuf_SourceCodeInfo_Location_leading_detached_comments(const google_protobuf_SourceCodeInfo_Location* msg, size_t* size) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +000011875 const upb_MiniTableField field = {6, UPB_SIZE(20, 64), 0, kUpb_NoSub, 12, (int)kUpb_FieldMode_Array | (int)kUpb_LabelFlags_IsAlternate | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +000011876 const upb_Array* arr = upb_Message_GetArray(UPB_UPCAST(msg), &field);
Eric Salob7d54ac2022-12-29 11:59:42 -080011877 if (arr) {
Protobuf Team Botf73985a2023-12-19 00:14:19 +000011878 if (size) *size = arr->UPB_PRIVATE(size);
Protobuf Team Bot81e54332024-01-11 21:04:07 +000011879 return (upb_StringView const*)upb_Array_DataPtr(arr);
Eric Salob7d54ac2022-12-29 11:59:42 -080011880 } else {
11881 if (size) *size = 0;
11882 return NULL;
11883 }
Joshua Haberman7ecf43f2022-03-14 13:11:29 -070011884}
Deanna Garciab26afb52023-04-25 13:37:18 -070011885UPB_INLINE const upb_Array* _google_protobuf_SourceCodeInfo_Location_leading_detached_comments_upb_array(const google_protobuf_SourceCodeInfo_Location* msg, size_t* size) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +000011886 const upb_MiniTableField field = {6, UPB_SIZE(20, 64), 0, kUpb_NoSub, 12, (int)kUpb_FieldMode_Array | (int)kUpb_LabelFlags_IsAlternate | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +000011887 const upb_Array* arr = upb_Message_GetArray(UPB_UPCAST(msg), &field);
Deanna Garciab26afb52023-04-25 13:37:18 -070011888 if (size) {
Protobuf Team Botf73985a2023-12-19 00:14:19 +000011889 *size = arr ? arr->UPB_PRIVATE(size) : 0;
Deanna Garciab26afb52023-04-25 13:37:18 -070011890 }
11891 return arr;
11892}
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +000011893UPB_INLINE upb_Array* _google_protobuf_SourceCodeInfo_Location_leading_detached_comments_mutable_upb_array(google_protobuf_SourceCodeInfo_Location* msg, size_t* size, upb_Arena* arena) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +000011894 const upb_MiniTableField field = {6, UPB_SIZE(20, 64), 0, kUpb_NoSub, 12, (int)kUpb_FieldMode_Array | (int)kUpb_LabelFlags_IsAlternate | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +000011895 upb_Array* arr = upb_Message_GetOrCreateMutableArray(UPB_UPCAST(msg),
11896 &field, arena);
Deanna Garciab26afb52023-04-25 13:37:18 -070011897 if (size) {
Protobuf Team Botf73985a2023-12-19 00:14:19 +000011898 *size = arr ? arr->UPB_PRIVATE(size) : 0;
Deanna Garciab26afb52023-04-25 13:37:18 -070011899 }
11900 return arr;
11901}
Joshua Haberman9abf6e22021-01-13 12:16:25 -080011902
Eric Salob7d54ac2022-12-29 11:59:42 -080011903UPB_INLINE int32_t* google_protobuf_SourceCodeInfo_Location_mutable_path(google_protobuf_SourceCodeInfo_Location* msg, size_t* size) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +000011904 upb_MiniTableField field = {1, UPB_SIZE(12, 16), 0, kUpb_NoSub, 5, (int)kUpb_FieldMode_Array | (int)kUpb_LabelFlags_IsPacked | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +000011905 upb_Array* arr = upb_Message_GetMutableArray(UPB_UPCAST(msg), &field);
Eric Salob7d54ac2022-12-29 11:59:42 -080011906 if (arr) {
Protobuf Team Botf73985a2023-12-19 00:14:19 +000011907 if (size) *size = arr->UPB_PRIVATE(size);
Protobuf Team Bot81e54332024-01-11 21:04:07 +000011908 return (int32_t*)upb_Array_MutableDataPtr(arr);
Eric Salob7d54ac2022-12-29 11:59:42 -080011909 } else {
11910 if (size) *size = 0;
11911 return NULL;
11912 }
Joshua Haberman9abf6e22021-01-13 12:16:25 -080011913}
Eric Salob7d54ac2022-12-29 11:59:42 -080011914UPB_INLINE int32_t* google_protobuf_SourceCodeInfo_Location_resize_path(google_protobuf_SourceCodeInfo_Location* msg, size_t size, upb_Arena* arena) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +000011915 upb_MiniTableField field = {1, UPB_SIZE(12, 16), 0, kUpb_NoSub, 5, (int)kUpb_FieldMode_Array | (int)kUpb_LabelFlags_IsPacked | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +000011916 return (int32_t*)upb_Message_ResizeArrayUninitialized(UPB_UPCAST(msg),
11917 &field, size, arena);
Joshua Haberman9abf6e22021-01-13 12:16:25 -080011918}
Joshua Haberman7ecf43f2022-03-14 13:11:29 -070011919UPB_INLINE bool google_protobuf_SourceCodeInfo_Location_add_path(google_protobuf_SourceCodeInfo_Location* msg, int32_t val, upb_Arena* arena) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +000011920 upb_MiniTableField field = {1, UPB_SIZE(12, 16), 0, kUpb_NoSub, 5, (int)kUpb_FieldMode_Array | (int)kUpb_LabelFlags_IsPacked | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +000011921 upb_Array* arr = upb_Message_GetOrCreateMutableArray(
11922 UPB_UPCAST(msg), &field, arena);
Protobuf Team Bot81e54332024-01-11 21:04:07 +000011923 if (!arr || !UPB_PRIVATE(_upb_Array_ResizeUninitialized)(
Protobuf Team Botf73985a2023-12-19 00:14:19 +000011924 arr, arr->UPB_PRIVATE(size) + 1, arena)) {
Eric Salob7d54ac2022-12-29 11:59:42 -080011925 return false;
11926 }
Protobuf Team Botf73985a2023-12-19 00:14:19 +000011927 UPB_PRIVATE(_upb_Array_Set)
11928 (arr, arr->UPB_PRIVATE(size) - 1, &val, sizeof(val));
Eric Salob7d54ac2022-12-29 11:59:42 -080011929 return true;
Joshua Haberman9abf6e22021-01-13 12:16:25 -080011930}
Eric Salob7d54ac2022-12-29 11:59:42 -080011931UPB_INLINE int32_t* google_protobuf_SourceCodeInfo_Location_mutable_span(google_protobuf_SourceCodeInfo_Location* msg, size_t* size) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +000011932 upb_MiniTableField field = {2, UPB_SIZE(16, 24), 0, kUpb_NoSub, 5, (int)kUpb_FieldMode_Array | (int)kUpb_LabelFlags_IsPacked | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +000011933 upb_Array* arr = upb_Message_GetMutableArray(UPB_UPCAST(msg), &field);
Eric Salob7d54ac2022-12-29 11:59:42 -080011934 if (arr) {
Protobuf Team Botf73985a2023-12-19 00:14:19 +000011935 if (size) *size = arr->UPB_PRIVATE(size);
Protobuf Team Bot81e54332024-01-11 21:04:07 +000011936 return (int32_t*)upb_Array_MutableDataPtr(arr);
Eric Salob7d54ac2022-12-29 11:59:42 -080011937 } else {
11938 if (size) *size = 0;
11939 return NULL;
11940 }
Joshua Haberman9abf6e22021-01-13 12:16:25 -080011941}
Eric Salob7d54ac2022-12-29 11:59:42 -080011942UPB_INLINE int32_t* google_protobuf_SourceCodeInfo_Location_resize_span(google_protobuf_SourceCodeInfo_Location* msg, size_t size, upb_Arena* arena) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +000011943 upb_MiniTableField field = {2, UPB_SIZE(16, 24), 0, kUpb_NoSub, 5, (int)kUpb_FieldMode_Array | (int)kUpb_LabelFlags_IsPacked | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +000011944 return (int32_t*)upb_Message_ResizeArrayUninitialized(UPB_UPCAST(msg),
11945 &field, size, arena);
Joshua Haberman9abf6e22021-01-13 12:16:25 -080011946}
Joshua Haberman7ecf43f2022-03-14 13:11:29 -070011947UPB_INLINE bool google_protobuf_SourceCodeInfo_Location_add_span(google_protobuf_SourceCodeInfo_Location* msg, int32_t val, upb_Arena* arena) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +000011948 upb_MiniTableField field = {2, UPB_SIZE(16, 24), 0, kUpb_NoSub, 5, (int)kUpb_FieldMode_Array | (int)kUpb_LabelFlags_IsPacked | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +000011949 upb_Array* arr = upb_Message_GetOrCreateMutableArray(
11950 UPB_UPCAST(msg), &field, arena);
Protobuf Team Bot81e54332024-01-11 21:04:07 +000011951 if (!arr || !UPB_PRIVATE(_upb_Array_ResizeUninitialized)(
Protobuf Team Botf73985a2023-12-19 00:14:19 +000011952 arr, arr->UPB_PRIVATE(size) + 1, arena)) {
Eric Salob7d54ac2022-12-29 11:59:42 -080011953 return false;
11954 }
Protobuf Team Botf73985a2023-12-19 00:14:19 +000011955 UPB_PRIVATE(_upb_Array_Set)
11956 (arr, arr->UPB_PRIVATE(size) - 1, &val, sizeof(val));
Eric Salob7d54ac2022-12-29 11:59:42 -080011957 return true;
Joshua Haberman9abf6e22021-01-13 12:16:25 -080011958}
Joshua Habermanf41049a2022-01-21 14:41:25 -080011959UPB_INLINE void google_protobuf_SourceCodeInfo_Location_set_leading_comments(google_protobuf_SourceCodeInfo_Location *msg, upb_StringView value) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +000011960 const upb_MiniTableField field = {3, UPB_SIZE(24, 32), 64, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
Protobuf Team Botac32c972024-04-10 03:30:05 +000011961 upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
Mike Kruskal232ecf42023-01-14 00:09:40 -080011962}
11963UPB_INLINE void google_protobuf_SourceCodeInfo_Location_set_trailing_comments(google_protobuf_SourceCodeInfo_Location *msg, upb_StringView value) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +000011964 const upb_MiniTableField field = {4, UPB_SIZE(32, 48), 65, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
Protobuf Team Botac32c972024-04-10 03:30:05 +000011965 upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
Mike Kruskal232ecf42023-01-14 00:09:40 -080011966}
11967UPB_INLINE upb_StringView* google_protobuf_SourceCodeInfo_Location_mutable_leading_detached_comments(google_protobuf_SourceCodeInfo_Location* msg, size_t* size) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +000011968 upb_MiniTableField field = {6, UPB_SIZE(20, 64), 0, kUpb_NoSub, 12, (int)kUpb_FieldMode_Array | (int)kUpb_LabelFlags_IsAlternate | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +000011969 upb_Array* arr = upb_Message_GetMutableArray(UPB_UPCAST(msg), &field);
Eric Salob7d54ac2022-12-29 11:59:42 -080011970 if (arr) {
Protobuf Team Botf73985a2023-12-19 00:14:19 +000011971 if (size) *size = arr->UPB_PRIVATE(size);
Protobuf Team Bot81e54332024-01-11 21:04:07 +000011972 return (upb_StringView*)upb_Array_MutableDataPtr(arr);
Eric Salob7d54ac2022-12-29 11:59:42 -080011973 } else {
11974 if (size) *size = 0;
11975 return NULL;
11976 }
Joshua Haberman9abf6e22021-01-13 12:16:25 -080011977}
Eric Salob7d54ac2022-12-29 11:59:42 -080011978UPB_INLINE upb_StringView* google_protobuf_SourceCodeInfo_Location_resize_leading_detached_comments(google_protobuf_SourceCodeInfo_Location* msg, size_t size, upb_Arena* arena) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +000011979 upb_MiniTableField field = {6, UPB_SIZE(20, 64), 0, kUpb_NoSub, 12, (int)kUpb_FieldMode_Array | (int)kUpb_LabelFlags_IsAlternate | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +000011980 return (upb_StringView*)upb_Message_ResizeArrayUninitialized(UPB_UPCAST(msg),
11981 &field, size, arena);
Joshua Haberman9abf6e22021-01-13 12:16:25 -080011982}
Joshua Haberman7ecf43f2022-03-14 13:11:29 -070011983UPB_INLINE bool google_protobuf_SourceCodeInfo_Location_add_leading_detached_comments(google_protobuf_SourceCodeInfo_Location* msg, upb_StringView val, upb_Arena* arena) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +000011984 upb_MiniTableField field = {6, UPB_SIZE(20, 64), 0, kUpb_NoSub, 12, (int)kUpb_FieldMode_Array | (int)kUpb_LabelFlags_IsAlternate | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +000011985 upb_Array* arr = upb_Message_GetOrCreateMutableArray(
11986 UPB_UPCAST(msg), &field, arena);
Protobuf Team Bot81e54332024-01-11 21:04:07 +000011987 if (!arr || !UPB_PRIVATE(_upb_Array_ResizeUninitialized)(
Protobuf Team Botf73985a2023-12-19 00:14:19 +000011988 arr, arr->UPB_PRIVATE(size) + 1, arena)) {
Eric Salob7d54ac2022-12-29 11:59:42 -080011989 return false;
11990 }
Protobuf Team Botf73985a2023-12-19 00:14:19 +000011991 UPB_PRIVATE(_upb_Array_Set)
11992 (arr, arr->UPB_PRIVATE(size) - 1, &val, sizeof(val));
Eric Salob7d54ac2022-12-29 11:59:42 -080011993 return true;
Joshua Haberman9abf6e22021-01-13 12:16:25 -080011994}
11995
11996/* google.protobuf.GeneratedCodeInfo */
11997
Joshua Habermanf41049a2022-01-21 14:41:25 -080011998UPB_INLINE google_protobuf_GeneratedCodeInfo* google_protobuf_GeneratedCodeInfo_new(upb_Arena* arena) {
Protobuf Team Bot4ffe0862023-12-06 02:02:36 +000011999 return (google_protobuf_GeneratedCodeInfo*)_upb_Message_New(&google__protobuf__GeneratedCodeInfo_msg_init, arena);
Joshua Haberman9abf6e22021-01-13 12:16:25 -080012000}
Joshua Habermanf41049a2022-01-21 14:41:25 -080012001UPB_INLINE google_protobuf_GeneratedCodeInfo* google_protobuf_GeneratedCodeInfo_parse(const char* buf, size_t size, upb_Arena* arena) {
12002 google_protobuf_GeneratedCodeInfo* ret = google_protobuf_GeneratedCodeInfo_new(arena);
Joshua Haberman9d578a32021-08-02 15:32:01 -070012003 if (!ret) return NULL;
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +000012004 if (upb_Decode(buf, size, UPB_UPCAST(ret), &google__protobuf__GeneratedCodeInfo_msg_init, NULL, 0, arena) !=
12005 kUpb_DecodeStatus_Ok) {
Joshua Haberman9d578a32021-08-02 15:32:01 -070012006 return NULL;
12007 }
12008 return ret;
Joshua Haberman9abf6e22021-01-13 12:16:25 -080012009}
Joshua Habermanf41049a2022-01-21 14:41:25 -080012010UPB_INLINE google_protobuf_GeneratedCodeInfo* google_protobuf_GeneratedCodeInfo_parse_ex(const char* buf, size_t size,
12011 const upb_ExtensionRegistry* extreg,
12012 int options, upb_Arena* arena) {
12013 google_protobuf_GeneratedCodeInfo* ret = google_protobuf_GeneratedCodeInfo_new(arena);
12014 if (!ret) return NULL;
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +000012015 if (upb_Decode(buf, size, UPB_UPCAST(ret), &google__protobuf__GeneratedCodeInfo_msg_init, extreg, options,
12016 arena) != kUpb_DecodeStatus_Ok) {
Joshua Habermanf41049a2022-01-21 14:41:25 -080012017 return NULL;
12018 }
12019 return ret;
Joshua Haberman9abf6e22021-01-13 12:16:25 -080012020}
Joshua Habermanf41049a2022-01-21 14:41:25 -080012021UPB_INLINE char* google_protobuf_GeneratedCodeInfo_serialize(const google_protobuf_GeneratedCodeInfo* msg, upb_Arena* arena, size_t* len) {
Joshua Habermand3995ec2022-09-30 16:54:39 -070012022 char* ptr;
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +000012023 (void)upb_Encode(UPB_UPCAST(msg), &google__protobuf__GeneratedCodeInfo_msg_init, 0, arena, &ptr, len);
Joshua Habermand3995ec2022-09-30 16:54:39 -070012024 return ptr;
Joshua Habermanf41049a2022-01-21 14:41:25 -080012025}
12026UPB_INLINE char* google_protobuf_GeneratedCodeInfo_serialize_ex(const google_protobuf_GeneratedCodeInfo* msg, int options,
12027 upb_Arena* arena, size_t* len) {
Joshua Habermand3995ec2022-09-30 16:54:39 -070012028 char* ptr;
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +000012029 (void)upb_Encode(UPB_UPCAST(msg), &google__protobuf__GeneratedCodeInfo_msg_init, options, arena, &ptr, len);
Joshua Habermand3995ec2022-09-30 16:54:39 -070012030 return ptr;
Joshua Habermanf41049a2022-01-21 14:41:25 -080012031}
Mike Kruskal3bc50492022-12-01 13:34:12 -080012032UPB_INLINE void google_protobuf_GeneratedCodeInfo_clear_annotation(google_protobuf_GeneratedCodeInfo* msg) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +000012033 const upb_MiniTableField field = {1, 8, 0, 0, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
Protobuf Team Bot4e90ead2024-01-08 15:46:34 +000012034 upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
Joshua Habermand3995ec2022-09-30 16:54:39 -070012035}
Eric Salob7d54ac2022-12-29 11:59:42 -080012036UPB_INLINE const google_protobuf_GeneratedCodeInfo_Annotation* const* google_protobuf_GeneratedCodeInfo_annotation(const google_protobuf_GeneratedCodeInfo* msg, size_t* size) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +000012037 const upb_MiniTableField field = {1, 8, 0, 0, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
Protobuf Team Bota9387b52024-06-12 15:17:52 +000012038 UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__GeneratedCodeInfo__Annotation_msg_init);
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +000012039 const upb_Array* arr = upb_Message_GetArray(UPB_UPCAST(msg), &field);
Eric Salob7d54ac2022-12-29 11:59:42 -080012040 if (arr) {
Protobuf Team Botf73985a2023-12-19 00:14:19 +000012041 if (size) *size = arr->UPB_PRIVATE(size);
Protobuf Team Bot81e54332024-01-11 21:04:07 +000012042 return (const google_protobuf_GeneratedCodeInfo_Annotation* const*)upb_Array_DataPtr(arr);
Eric Salob7d54ac2022-12-29 11:59:42 -080012043 } else {
12044 if (size) *size = 0;
12045 return NULL;
12046 }
Joshua Haberman7ecf43f2022-03-14 13:11:29 -070012047}
Deanna Garciab26afb52023-04-25 13:37:18 -070012048UPB_INLINE const upb_Array* _google_protobuf_GeneratedCodeInfo_annotation_upb_array(const google_protobuf_GeneratedCodeInfo* msg, size_t* size) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +000012049 const upb_MiniTableField field = {1, 8, 0, 0, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
Protobuf Team Bota9387b52024-06-12 15:17:52 +000012050 UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__GeneratedCodeInfo__Annotation_msg_init);
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +000012051 const upb_Array* arr = upb_Message_GetArray(UPB_UPCAST(msg), &field);
Deanna Garciab26afb52023-04-25 13:37:18 -070012052 if (size) {
Protobuf Team Botf73985a2023-12-19 00:14:19 +000012053 *size = arr ? arr->UPB_PRIVATE(size) : 0;
Deanna Garciab26afb52023-04-25 13:37:18 -070012054 }
12055 return arr;
12056}
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +000012057UPB_INLINE upb_Array* _google_protobuf_GeneratedCodeInfo_annotation_mutable_upb_array(google_protobuf_GeneratedCodeInfo* msg, size_t* size, upb_Arena* arena) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +000012058 const upb_MiniTableField field = {1, 8, 0, 0, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
Protobuf Team Bota9387b52024-06-12 15:17:52 +000012059 UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__GeneratedCodeInfo__Annotation_msg_init);
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +000012060 upb_Array* arr = upb_Message_GetOrCreateMutableArray(UPB_UPCAST(msg),
12061 &field, arena);
Deanna Garciab26afb52023-04-25 13:37:18 -070012062 if (size) {
Protobuf Team Botf73985a2023-12-19 00:14:19 +000012063 *size = arr ? arr->UPB_PRIVATE(size) : 0;
Deanna Garciab26afb52023-04-25 13:37:18 -070012064 }
12065 return arr;
12066}
Joshua Haberman9abf6e22021-01-13 12:16:25 -080012067
Eric Salob7d54ac2022-12-29 11:59:42 -080012068UPB_INLINE google_protobuf_GeneratedCodeInfo_Annotation** google_protobuf_GeneratedCodeInfo_mutable_annotation(google_protobuf_GeneratedCodeInfo* msg, size_t* size) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +000012069 upb_MiniTableField field = {1, 8, 0, 0, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
Protobuf Team Bota9387b52024-06-12 15:17:52 +000012070 UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__GeneratedCodeInfo__Annotation_msg_init);
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +000012071 upb_Array* arr = upb_Message_GetMutableArray(UPB_UPCAST(msg), &field);
Eric Salob7d54ac2022-12-29 11:59:42 -080012072 if (arr) {
Protobuf Team Botf73985a2023-12-19 00:14:19 +000012073 if (size) *size = arr->UPB_PRIVATE(size);
Protobuf Team Bot81e54332024-01-11 21:04:07 +000012074 return (google_protobuf_GeneratedCodeInfo_Annotation**)upb_Array_MutableDataPtr(arr);
Eric Salob7d54ac2022-12-29 11:59:42 -080012075 } else {
12076 if (size) *size = 0;
12077 return NULL;
12078 }
Joshua Haberman9abf6e22021-01-13 12:16:25 -080012079}
Eric Salob7d54ac2022-12-29 11:59:42 -080012080UPB_INLINE google_protobuf_GeneratedCodeInfo_Annotation** google_protobuf_GeneratedCodeInfo_resize_annotation(google_protobuf_GeneratedCodeInfo* msg, size_t size, upb_Arena* arena) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +000012081 upb_MiniTableField field = {1, 8, 0, 0, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +000012082 return (google_protobuf_GeneratedCodeInfo_Annotation**)upb_Message_ResizeArrayUninitialized(UPB_UPCAST(msg),
12083 &field, size, arena);
Joshua Haberman9abf6e22021-01-13 12:16:25 -080012084}
Joshua Haberman7ecf43f2022-03-14 13:11:29 -070012085UPB_INLINE struct google_protobuf_GeneratedCodeInfo_Annotation* google_protobuf_GeneratedCodeInfo_add_annotation(google_protobuf_GeneratedCodeInfo* msg, upb_Arena* arena) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +000012086 upb_MiniTableField field = {1, 8, 0, 0, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
Protobuf Team Bota9387b52024-06-12 15:17:52 +000012087 UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__GeneratedCodeInfo__Annotation_msg_init);
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +000012088 upb_Array* arr = upb_Message_GetOrCreateMutableArray(
12089 UPB_UPCAST(msg), &field, arena);
Protobuf Team Bot81e54332024-01-11 21:04:07 +000012090 if (!arr || !UPB_PRIVATE(_upb_Array_ResizeUninitialized)(
Protobuf Team Botf73985a2023-12-19 00:14:19 +000012091 arr, arr->UPB_PRIVATE(size) + 1, arena)) {
Eric Salob7d54ac2022-12-29 11:59:42 -080012092 return NULL;
12093 }
Protobuf Team Bot4ffe0862023-12-06 02:02:36 +000012094 struct google_protobuf_GeneratedCodeInfo_Annotation* sub = (struct google_protobuf_GeneratedCodeInfo_Annotation*)_upb_Message_New(&google__protobuf__GeneratedCodeInfo__Annotation_msg_init, arena);
Eric Salob7d54ac2022-12-29 11:59:42 -080012095 if (!arr || !sub) return NULL;
Protobuf Team Botf73985a2023-12-19 00:14:19 +000012096 UPB_PRIVATE(_upb_Array_Set)
12097 (arr, arr->UPB_PRIVATE(size) - 1, &sub, sizeof(sub));
Joshua Haberman9abf6e22021-01-13 12:16:25 -080012098 return sub;
12099}
12100
12101/* google.protobuf.GeneratedCodeInfo.Annotation */
12102
Joshua Habermanf41049a2022-01-21 14:41:25 -080012103UPB_INLINE google_protobuf_GeneratedCodeInfo_Annotation* google_protobuf_GeneratedCodeInfo_Annotation_new(upb_Arena* arena) {
Protobuf Team Bot4ffe0862023-12-06 02:02:36 +000012104 return (google_protobuf_GeneratedCodeInfo_Annotation*)_upb_Message_New(&google__protobuf__GeneratedCodeInfo__Annotation_msg_init, arena);
Joshua Haberman9abf6e22021-01-13 12:16:25 -080012105}
Joshua Habermanf41049a2022-01-21 14:41:25 -080012106UPB_INLINE google_protobuf_GeneratedCodeInfo_Annotation* google_protobuf_GeneratedCodeInfo_Annotation_parse(const char* buf, size_t size, upb_Arena* arena) {
12107 google_protobuf_GeneratedCodeInfo_Annotation* ret = google_protobuf_GeneratedCodeInfo_Annotation_new(arena);
Joshua Haberman9d578a32021-08-02 15:32:01 -070012108 if (!ret) return NULL;
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +000012109 if (upb_Decode(buf, size, UPB_UPCAST(ret), &google__protobuf__GeneratedCodeInfo__Annotation_msg_init, NULL, 0, arena) !=
12110 kUpb_DecodeStatus_Ok) {
Joshua Haberman9d578a32021-08-02 15:32:01 -070012111 return NULL;
12112 }
12113 return ret;
Joshua Haberman9abf6e22021-01-13 12:16:25 -080012114}
Joshua Habermanf41049a2022-01-21 14:41:25 -080012115UPB_INLINE google_protobuf_GeneratedCodeInfo_Annotation* google_protobuf_GeneratedCodeInfo_Annotation_parse_ex(const char* buf, size_t size,
12116 const upb_ExtensionRegistry* extreg,
12117 int options, upb_Arena* arena) {
12118 google_protobuf_GeneratedCodeInfo_Annotation* ret = google_protobuf_GeneratedCodeInfo_Annotation_new(arena);
12119 if (!ret) return NULL;
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +000012120 if (upb_Decode(buf, size, UPB_UPCAST(ret), &google__protobuf__GeneratedCodeInfo__Annotation_msg_init, extreg, options,
12121 arena) != kUpb_DecodeStatus_Ok) {
Joshua Habermanf41049a2022-01-21 14:41:25 -080012122 return NULL;
12123 }
12124 return ret;
Joshua Haberman9abf6e22021-01-13 12:16:25 -080012125}
Joshua Habermanf41049a2022-01-21 14:41:25 -080012126UPB_INLINE char* google_protobuf_GeneratedCodeInfo_Annotation_serialize(const google_protobuf_GeneratedCodeInfo_Annotation* msg, upb_Arena* arena, size_t* len) {
Joshua Habermand3995ec2022-09-30 16:54:39 -070012127 char* ptr;
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +000012128 (void)upb_Encode(UPB_UPCAST(msg), &google__protobuf__GeneratedCodeInfo__Annotation_msg_init, 0, arena, &ptr, len);
Joshua Habermand3995ec2022-09-30 16:54:39 -070012129 return ptr;
Joshua Habermanf41049a2022-01-21 14:41:25 -080012130}
12131UPB_INLINE char* google_protobuf_GeneratedCodeInfo_Annotation_serialize_ex(const google_protobuf_GeneratedCodeInfo_Annotation* msg, int options,
12132 upb_Arena* arena, size_t* len) {
Joshua Habermand3995ec2022-09-30 16:54:39 -070012133 char* ptr;
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +000012134 (void)upb_Encode(UPB_UPCAST(msg), &google__protobuf__GeneratedCodeInfo__Annotation_msg_init, options, arena, &ptr, len);
Joshua Habermand3995ec2022-09-30 16:54:39 -070012135 return ptr;
12136}
Mike Kruskal3bc50492022-12-01 13:34:12 -080012137UPB_INLINE void google_protobuf_GeneratedCodeInfo_Annotation_clear_path(google_protobuf_GeneratedCodeInfo_Annotation* msg) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +000012138 const upb_MiniTableField field = {1, UPB_SIZE(12, 24), 0, kUpb_NoSub, 5, (int)kUpb_FieldMode_Array | (int)kUpb_LabelFlags_IsPacked | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
Protobuf Team Bot4e90ead2024-01-08 15:46:34 +000012139 upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
Joshua Habermanf41049a2022-01-21 14:41:25 -080012140}
Eric Salob7d54ac2022-12-29 11:59:42 -080012141UPB_INLINE int32_t const* google_protobuf_GeneratedCodeInfo_Annotation_path(const google_protobuf_GeneratedCodeInfo_Annotation* msg, size_t* size) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +000012142 const upb_MiniTableField field = {1, UPB_SIZE(12, 24), 0, kUpb_NoSub, 5, (int)kUpb_FieldMode_Array | (int)kUpb_LabelFlags_IsPacked | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +000012143 const upb_Array* arr = upb_Message_GetArray(UPB_UPCAST(msg), &field);
Eric Salob7d54ac2022-12-29 11:59:42 -080012144 if (arr) {
Protobuf Team Botf73985a2023-12-19 00:14:19 +000012145 if (size) *size = arr->UPB_PRIVATE(size);
Protobuf Team Bot81e54332024-01-11 21:04:07 +000012146 return (int32_t const*)upb_Array_DataPtr(arr);
Eric Salob7d54ac2022-12-29 11:59:42 -080012147 } else {
12148 if (size) *size = 0;
12149 return NULL;
12150 }
Joshua Haberman7ecf43f2022-03-14 13:11:29 -070012151}
Deanna Garciab26afb52023-04-25 13:37:18 -070012152UPB_INLINE const upb_Array* _google_protobuf_GeneratedCodeInfo_Annotation_path_upb_array(const google_protobuf_GeneratedCodeInfo_Annotation* msg, size_t* size) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +000012153 const upb_MiniTableField field = {1, UPB_SIZE(12, 24), 0, kUpb_NoSub, 5, (int)kUpb_FieldMode_Array | (int)kUpb_LabelFlags_IsPacked | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +000012154 const upb_Array* arr = upb_Message_GetArray(UPB_UPCAST(msg), &field);
Deanna Garciab26afb52023-04-25 13:37:18 -070012155 if (size) {
Protobuf Team Botf73985a2023-12-19 00:14:19 +000012156 *size = arr ? arr->UPB_PRIVATE(size) : 0;
Deanna Garciab26afb52023-04-25 13:37:18 -070012157 }
12158 return arr;
12159}
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +000012160UPB_INLINE upb_Array* _google_protobuf_GeneratedCodeInfo_Annotation_path_mutable_upb_array(google_protobuf_GeneratedCodeInfo_Annotation* msg, size_t* size, upb_Arena* arena) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +000012161 const upb_MiniTableField field = {1, UPB_SIZE(12, 24), 0, kUpb_NoSub, 5, (int)kUpb_FieldMode_Array | (int)kUpb_LabelFlags_IsPacked | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +000012162 upb_Array* arr = upb_Message_GetOrCreateMutableArray(UPB_UPCAST(msg),
12163 &field, arena);
Deanna Garciab26afb52023-04-25 13:37:18 -070012164 if (size) {
Protobuf Team Botf73985a2023-12-19 00:14:19 +000012165 *size = arr ? arr->UPB_PRIVATE(size) : 0;
Deanna Garciab26afb52023-04-25 13:37:18 -070012166 }
12167 return arr;
12168}
Mike Kruskal3bc50492022-12-01 13:34:12 -080012169UPB_INLINE void google_protobuf_GeneratedCodeInfo_Annotation_clear_source_file(google_protobuf_GeneratedCodeInfo_Annotation* msg) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +000012170 const upb_MiniTableField field = {2, UPB_SIZE(28, 32), 64, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
Protobuf Team Bot4e90ead2024-01-08 15:46:34 +000012171 upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
Joshua Habermand3995ec2022-09-30 16:54:39 -070012172}
Joshua Habermanf41049a2022-01-21 14:41:25 -080012173UPB_INLINE upb_StringView google_protobuf_GeneratedCodeInfo_Annotation_source_file(const google_protobuf_GeneratedCodeInfo_Annotation* msg) {
Eric Salo8809a112022-11-21 13:01:06 -080012174 upb_StringView default_val = upb_StringView_FromString("");
12175 upb_StringView ret;
Protobuf Team Bot03440ec2024-01-11 23:13:19 +000012176 const upb_MiniTableField field = {2, UPB_SIZE(28, 32), 64, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +000012177 _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field,
12178 &default_val, &ret);
Eric Salo8809a112022-11-21 13:01:06 -080012179 return ret;
Joshua Habermanf41049a2022-01-21 14:41:25 -080012180}
Mike Kruskal3bc50492022-12-01 13:34:12 -080012181UPB_INLINE bool google_protobuf_GeneratedCodeInfo_Annotation_has_source_file(const google_protobuf_GeneratedCodeInfo_Annotation* msg) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +000012182 const upb_MiniTableField field = {2, UPB_SIZE(28, 32), 64, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
Protobuf Team Bot8c1f6352024-01-10 05:18:15 +000012183 return upb_Message_HasBaseField(UPB_UPCAST(msg), &field);
Joshua Haberman7ecf43f2022-03-14 13:11:29 -070012184}
Mike Kruskal3bc50492022-12-01 13:34:12 -080012185UPB_INLINE void google_protobuf_GeneratedCodeInfo_Annotation_clear_begin(google_protobuf_GeneratedCodeInfo_Annotation* msg) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +000012186 const upb_MiniTableField field = {3, UPB_SIZE(16, 12), 65, kUpb_NoSub, 5, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
Protobuf Team Bot4e90ead2024-01-08 15:46:34 +000012187 upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
Joshua Habermand3995ec2022-09-30 16:54:39 -070012188}
Joshua Habermanf41049a2022-01-21 14:41:25 -080012189UPB_INLINE int32_t google_protobuf_GeneratedCodeInfo_Annotation_begin(const google_protobuf_GeneratedCodeInfo_Annotation* msg) {
Eric Salo8809a112022-11-21 13:01:06 -080012190 int32_t default_val = (int32_t)0;
12191 int32_t ret;
Protobuf Team Bot03440ec2024-01-11 23:13:19 +000012192 const upb_MiniTableField field = {3, UPB_SIZE(16, 12), 65, kUpb_NoSub, 5, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +000012193 _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field,
12194 &default_val, &ret);
Eric Salo8809a112022-11-21 13:01:06 -080012195 return ret;
Joshua Habermanf41049a2022-01-21 14:41:25 -080012196}
Mike Kruskal3bc50492022-12-01 13:34:12 -080012197UPB_INLINE bool google_protobuf_GeneratedCodeInfo_Annotation_has_begin(const google_protobuf_GeneratedCodeInfo_Annotation* msg) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +000012198 const upb_MiniTableField field = {3, UPB_SIZE(16, 12), 65, kUpb_NoSub, 5, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
Protobuf Team Bot8c1f6352024-01-10 05:18:15 +000012199 return upb_Message_HasBaseField(UPB_UPCAST(msg), &field);
Joshua Haberman7ecf43f2022-03-14 13:11:29 -070012200}
Mike Kruskal3bc50492022-12-01 13:34:12 -080012201UPB_INLINE void google_protobuf_GeneratedCodeInfo_Annotation_clear_end(google_protobuf_GeneratedCodeInfo_Annotation* msg) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +000012202 const upb_MiniTableField field = {4, UPB_SIZE(20, 16), 66, kUpb_NoSub, 5, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
Protobuf Team Bot4e90ead2024-01-08 15:46:34 +000012203 upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
Joshua Habermand3995ec2022-09-30 16:54:39 -070012204}
Joshua Habermanf41049a2022-01-21 14:41:25 -080012205UPB_INLINE int32_t google_protobuf_GeneratedCodeInfo_Annotation_end(const google_protobuf_GeneratedCodeInfo_Annotation* msg) {
Eric Salo8809a112022-11-21 13:01:06 -080012206 int32_t default_val = (int32_t)0;
12207 int32_t ret;
Protobuf Team Bot03440ec2024-01-11 23:13:19 +000012208 const upb_MiniTableField field = {4, UPB_SIZE(20, 16), 66, kUpb_NoSub, 5, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +000012209 _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field,
12210 &default_val, &ret);
Eric Salo8809a112022-11-21 13:01:06 -080012211 return ret;
Joshua Habermanf41049a2022-01-21 14:41:25 -080012212}
Mike Kruskal3bc50492022-12-01 13:34:12 -080012213UPB_INLINE bool google_protobuf_GeneratedCodeInfo_Annotation_has_end(const google_protobuf_GeneratedCodeInfo_Annotation* msg) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +000012214 const upb_MiniTableField field = {4, UPB_SIZE(20, 16), 66, kUpb_NoSub, 5, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
Protobuf Team Bot8c1f6352024-01-10 05:18:15 +000012215 return upb_Message_HasBaseField(UPB_UPCAST(msg), &field);
Joshua Habermand3995ec2022-09-30 16:54:39 -070012216}
Mike Kruskal3bc50492022-12-01 13:34:12 -080012217UPB_INLINE void google_protobuf_GeneratedCodeInfo_Annotation_clear_semantic(google_protobuf_GeneratedCodeInfo_Annotation* msg) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +000012218 const upb_MiniTableField field = {5, UPB_SIZE(24, 20), 67, 0, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
Protobuf Team Bot4e90ead2024-01-08 15:46:34 +000012219 upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
Joshua Habermand3995ec2022-09-30 16:54:39 -070012220}
12221UPB_INLINE int32_t google_protobuf_GeneratedCodeInfo_Annotation_semantic(const google_protobuf_GeneratedCodeInfo_Annotation* msg) {
Eric Salo8809a112022-11-21 13:01:06 -080012222 int32_t default_val = 0;
12223 int32_t ret;
Protobuf Team Bot03440ec2024-01-11 23:13:19 +000012224 const upb_MiniTableField field = {5, UPB_SIZE(24, 20), 67, 0, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +000012225 _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field,
12226 &default_val, &ret);
Eric Salo8809a112022-11-21 13:01:06 -080012227 return ret;
Joshua Habermand3995ec2022-09-30 16:54:39 -070012228}
Mike Kruskal3bc50492022-12-01 13:34:12 -080012229UPB_INLINE bool google_protobuf_GeneratedCodeInfo_Annotation_has_semantic(const google_protobuf_GeneratedCodeInfo_Annotation* msg) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +000012230 const upb_MiniTableField field = {5, UPB_SIZE(24, 20), 67, 0, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
Protobuf Team Bot8c1f6352024-01-10 05:18:15 +000012231 return upb_Message_HasBaseField(UPB_UPCAST(msg), &field);
Mike Kruskal3bc50492022-12-01 13:34:12 -080012232}
Joshua Haberman9abf6e22021-01-13 12:16:25 -080012233
Eric Salob7d54ac2022-12-29 11:59:42 -080012234UPB_INLINE int32_t* google_protobuf_GeneratedCodeInfo_Annotation_mutable_path(google_protobuf_GeneratedCodeInfo_Annotation* msg, size_t* size) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +000012235 upb_MiniTableField field = {1, UPB_SIZE(12, 24), 0, kUpb_NoSub, 5, (int)kUpb_FieldMode_Array | (int)kUpb_LabelFlags_IsPacked | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +000012236 upb_Array* arr = upb_Message_GetMutableArray(UPB_UPCAST(msg), &field);
Eric Salob7d54ac2022-12-29 11:59:42 -080012237 if (arr) {
Protobuf Team Botf73985a2023-12-19 00:14:19 +000012238 if (size) *size = arr->UPB_PRIVATE(size);
Protobuf Team Bot81e54332024-01-11 21:04:07 +000012239 return (int32_t*)upb_Array_MutableDataPtr(arr);
Eric Salob7d54ac2022-12-29 11:59:42 -080012240 } else {
12241 if (size) *size = 0;
12242 return NULL;
12243 }
Joshua Haberman9abf6e22021-01-13 12:16:25 -080012244}
Eric Salob7d54ac2022-12-29 11:59:42 -080012245UPB_INLINE int32_t* google_protobuf_GeneratedCodeInfo_Annotation_resize_path(google_protobuf_GeneratedCodeInfo_Annotation* msg, size_t size, upb_Arena* arena) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +000012246 upb_MiniTableField field = {1, UPB_SIZE(12, 24), 0, kUpb_NoSub, 5, (int)kUpb_FieldMode_Array | (int)kUpb_LabelFlags_IsPacked | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +000012247 return (int32_t*)upb_Message_ResizeArrayUninitialized(UPB_UPCAST(msg),
12248 &field, size, arena);
Joshua Haberman9abf6e22021-01-13 12:16:25 -080012249}
Joshua Haberman7ecf43f2022-03-14 13:11:29 -070012250UPB_INLINE bool google_protobuf_GeneratedCodeInfo_Annotation_add_path(google_protobuf_GeneratedCodeInfo_Annotation* msg, int32_t val, upb_Arena* arena) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +000012251 upb_MiniTableField field = {1, UPB_SIZE(12, 24), 0, kUpb_NoSub, 5, (int)kUpb_FieldMode_Array | (int)kUpb_LabelFlags_IsPacked | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
Protobuf Team Bot4a8f21e2023-12-21 16:23:10 +000012252 upb_Array* arr = upb_Message_GetOrCreateMutableArray(
12253 UPB_UPCAST(msg), &field, arena);
Protobuf Team Bot81e54332024-01-11 21:04:07 +000012254 if (!arr || !UPB_PRIVATE(_upb_Array_ResizeUninitialized)(
Protobuf Team Botf73985a2023-12-19 00:14:19 +000012255 arr, arr->UPB_PRIVATE(size) + 1, arena)) {
Eric Salob7d54ac2022-12-29 11:59:42 -080012256 return false;
12257 }
Protobuf Team Botf73985a2023-12-19 00:14:19 +000012258 UPB_PRIVATE(_upb_Array_Set)
12259 (arr, arr->UPB_PRIVATE(size) - 1, &val, sizeof(val));
Eric Salob7d54ac2022-12-29 11:59:42 -080012260 return true;
Joshua Haberman9abf6e22021-01-13 12:16:25 -080012261}
Joshua Habermanf41049a2022-01-21 14:41:25 -080012262UPB_INLINE void google_protobuf_GeneratedCodeInfo_Annotation_set_source_file(google_protobuf_GeneratedCodeInfo_Annotation *msg, upb_StringView value) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +000012263 const upb_MiniTableField field = {2, UPB_SIZE(28, 32), 64, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
Protobuf Team Botac32c972024-04-10 03:30:05 +000012264 upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
Mike Kruskal232ecf42023-01-14 00:09:40 -080012265}
12266UPB_INLINE void google_protobuf_GeneratedCodeInfo_Annotation_set_begin(google_protobuf_GeneratedCodeInfo_Annotation *msg, int32_t value) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +000012267 const upb_MiniTableField field = {3, UPB_SIZE(16, 12), 65, kUpb_NoSub, 5, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
Protobuf Team Botac32c972024-04-10 03:30:05 +000012268 upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
Mike Kruskal232ecf42023-01-14 00:09:40 -080012269}
12270UPB_INLINE void google_protobuf_GeneratedCodeInfo_Annotation_set_end(google_protobuf_GeneratedCodeInfo_Annotation *msg, int32_t value) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +000012271 const upb_MiniTableField field = {4, UPB_SIZE(20, 16), 66, kUpb_NoSub, 5, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
Protobuf Team Botac32c972024-04-10 03:30:05 +000012272 upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
Mike Kruskal232ecf42023-01-14 00:09:40 -080012273}
12274UPB_INLINE void google_protobuf_GeneratedCodeInfo_Annotation_set_semantic(google_protobuf_GeneratedCodeInfo_Annotation *msg, int32_t value) {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +000012275 const upb_MiniTableField field = {5, UPB_SIZE(24, 20), 67, 0, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
Protobuf Team Botac32c972024-04-10 03:30:05 +000012276 upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
Joshua Haberman9abf6e22021-01-13 12:16:25 -080012277}
Mike Kruskal232ecf42023-01-14 00:09:40 -080012278
Joshua Habermanf41049a2022-01-21 14:41:25 -080012279/* Max size 32 is google.protobuf.FileOptions */
12280/* Max size 64 is google.protobuf.FileOptions */
Protobuf Team Bot03440ec2024-01-11 23:13:19 +000012281#define _UPB_MAXOPT_SIZE UPB_SIZE(112, 200)
Joshua Habermanf41049a2022-01-21 14:41:25 -080012282
Joshua Haberman9abf6e22021-01-13 12:16:25 -080012283#ifdef __cplusplus
12284} /* extern "C" */
12285#endif
12286
12287
12288#endif /* GOOGLE_PROTOBUF_DESCRIPTOR_PROTO_UPB_H_ */
Mike Kruskal232ecf42023-01-14 00:09:40 -080012289// end:github_only
Eric Salo8809a112022-11-21 13:01:06 -080012290
Protobuf Team Bot7dabac92023-09-07 18:35:50 +000012291typedef enum {
12292 kUpb_Syntax_Proto2 = 2,
12293 kUpb_Syntax_Proto3 = 3,
12294 kUpb_Syntax_Editions = 99
12295} upb_Syntax;
Eric Salo8809a112022-11-21 13:01:06 -080012296
12297// Forward declarations for circular references.
12298typedef struct upb_DefPool upb_DefPool;
12299typedef struct upb_EnumDef upb_EnumDef;
12300typedef struct upb_EnumReservedRange upb_EnumReservedRange;
12301typedef struct upb_EnumValueDef upb_EnumValueDef;
12302typedef struct upb_ExtensionRange upb_ExtensionRange;
12303typedef struct upb_FieldDef upb_FieldDef;
12304typedef struct upb_FileDef upb_FileDef;
12305typedef struct upb_MessageDef upb_MessageDef;
12306typedef struct upb_MessageReservedRange upb_MessageReservedRange;
12307typedef struct upb_MethodDef upb_MethodDef;
12308typedef struct upb_OneofDef upb_OneofDef;
12309typedef struct upb_ServiceDef upb_ServiceDef;
12310
12311// EVERYTHING BELOW THIS LINE IS INTERNAL - DO NOT USE /////////////////////////
12312
12313typedef struct upb_DefBuilder upb_DefBuilder;
12314
12315#endif /* UPB_REFLECTION_COMMON_H_ */
12316
12317#ifndef UPB_REFLECTION_DEF_TYPE_H_
12318#define UPB_REFLECTION_DEF_TYPE_H_
12319
12320
12321// Must be last.
12322
12323// Inside a symtab we store tagged pointers to specific def types.
12324typedef enum {
12325 UPB_DEFTYPE_MASK = 7,
12326
12327 // Only inside symtab table.
12328 UPB_DEFTYPE_EXT = 0,
12329 UPB_DEFTYPE_MSG = 1,
12330 UPB_DEFTYPE_ENUM = 2,
12331 UPB_DEFTYPE_ENUMVAL = 3,
12332 UPB_DEFTYPE_SERVICE = 4,
12333
12334 // Only inside message table.
12335 UPB_DEFTYPE_FIELD = 0,
12336 UPB_DEFTYPE_ONEOF = 1,
Eric Salo8809a112022-11-21 13:01:06 -080012337} upb_deftype_t;
12338
12339#ifdef __cplusplus
12340extern "C" {
12341#endif
12342
12343// Our 3-bit pointer tagging requires all pointers to be multiples of 8.
12344// The arena will always yield 8-byte-aligned addresses, however we put
12345// the defs into arrays. For each element in the array to be 8-byte-aligned,
12346// the sizes of each def type must also be a multiple of 8.
12347//
12348// If any of these asserts fail, we need to add or remove padding on 32-bit
12349// machines (64-bit machines will have 8-byte alignment already due to
12350// pointers, which all of these structs have).
12351UPB_INLINE void _upb_DefType_CheckPadding(size_t size) {
12352 UPB_ASSERT((size & UPB_DEFTYPE_MASK) == 0);
12353}
12354
12355upb_deftype_t _upb_DefType_Type(upb_value v);
12356
12357upb_value _upb_DefType_Pack(const void* ptr, upb_deftype_t type);
12358
12359const void* _upb_DefType_Unpack(upb_value v, upb_deftype_t type);
12360
12361#ifdef __cplusplus
12362} /* extern "C" */
12363#endif
12364
12365
12366#endif /* UPB_REFLECTION_DEF_TYPE_H_ */
12367
12368// Must be last.
12369
12370#ifdef __cplusplus
12371extern "C" {
12372#endif
12373
Jason Lunn67dee292023-07-13 13:15:26 -070012374UPB_API void upb_DefPool_Free(upb_DefPool* s);
Eric Salo8809a112022-11-21 13:01:06 -080012375
Jason Lunn67dee292023-07-13 13:15:26 -070012376UPB_API upb_DefPool* upb_DefPool_New(void);
Eric Salo8809a112022-11-21 13:01:06 -080012377
Protobuf Team Botce9dcc22023-11-03 22:38:26 +000012378UPB_API const UPB_DESC(FeatureSetDefaults) *
12379 upb_DefPool_FeatureSetDefaults(const upb_DefPool* s);
12380
Protobuf Team Botc6b149c2023-11-10 23:37:46 +000012381UPB_API bool upb_DefPool_SetFeatureSetDefaults(upb_DefPool* s,
12382 const char* serialized_defaults,
12383 size_t serialized_len,
12384 upb_Status* status);
12385
Jason Lunn67dee292023-07-13 13:15:26 -070012386UPB_API const upb_MessageDef* upb_DefPool_FindMessageByName(
12387 const upb_DefPool* s, const char* sym);
Eric Salo8809a112022-11-21 13:01:06 -080012388
12389const upb_MessageDef* upb_DefPool_FindMessageByNameWithSize(
12390 const upb_DefPool* s, const char* sym, size_t len);
12391
Jason Lunn67dee292023-07-13 13:15:26 -070012392UPB_API const upb_EnumDef* upb_DefPool_FindEnumByName(const upb_DefPool* s,
12393 const char* sym);
Eric Salo8809a112022-11-21 13:01:06 -080012394
12395const upb_EnumValueDef* upb_DefPool_FindEnumByNameval(const upb_DefPool* s,
12396 const char* sym);
12397
12398const upb_FileDef* upb_DefPool_FindFileByName(const upb_DefPool* s,
12399 const char* name);
12400
12401const upb_FileDef* upb_DefPool_FindFileByNameWithSize(const upb_DefPool* s,
12402 const char* name,
12403 size_t len);
12404
12405const upb_FieldDef* upb_DefPool_FindExtensionByMiniTable(
12406 const upb_DefPool* s, const upb_MiniTableExtension* ext);
12407
Protobuf Team Bot8aad0582023-11-14 23:47:47 +000012408UPB_API const upb_FieldDef* upb_DefPool_FindExtensionByName(const upb_DefPool* s,
Eric Salo8809a112022-11-21 13:01:06 -080012409 const char* sym);
12410
12411const upb_FieldDef* upb_DefPool_FindExtensionByNameWithSize(
12412 const upb_DefPool* s, const char* name, size_t size);
12413
12414const upb_FieldDef* upb_DefPool_FindExtensionByNumber(const upb_DefPool* s,
12415 const upb_MessageDef* m,
12416 int32_t fieldnum);
12417
Protobuf Team Bot312240c2024-03-22 17:47:13 +000012418UPB_API const upb_ServiceDef* upb_DefPool_FindServiceByName(
12419 const upb_DefPool* s, const char* name);
Eric Salo8809a112022-11-21 13:01:06 -080012420
12421const upb_ServiceDef* upb_DefPool_FindServiceByNameWithSize(
12422 const upb_DefPool* s, const char* name, size_t size);
12423
12424const upb_FileDef* upb_DefPool_FindFileContainingSymbol(const upb_DefPool* s,
12425 const char* name);
12426
Jason Lunn67dee292023-07-13 13:15:26 -070012427UPB_API const upb_FileDef* upb_DefPool_AddFile(
12428 upb_DefPool* s, const UPB_DESC(FileDescriptorProto) * file_proto,
12429 upb_Status* status);
Eric Salo8809a112022-11-21 13:01:06 -080012430
Protobuf Team Bot8aad0582023-11-14 23:47:47 +000012431UPB_API const upb_ExtensionRegistry* upb_DefPool_ExtensionRegistry(
Eric Salo8809a112022-11-21 13:01:06 -080012432 const upb_DefPool* s);
12433
12434const upb_FieldDef** upb_DefPool_GetAllExtensions(const upb_DefPool* s,
12435 const upb_MessageDef* m,
12436 size_t* count);
12437
12438#ifdef __cplusplus
12439} /* extern "C" */
12440#endif
12441
12442
12443#endif /* UPB_REFLECTION_DEF_POOL_H_ */
12444
Protobuf Team Bot06310352023-09-26 21:54:58 +000012445// IWYU pragma: private, include "upb/reflection/def.h"
Eric Salo8809a112022-11-21 13:01:06 -080012446
12447#ifndef UPB_REFLECTION_ENUM_DEF_H_
12448#define UPB_REFLECTION_ENUM_DEF_H_
Joshua Habermand3995ec2022-09-30 16:54:39 -070012449
12450
12451// Must be last.
Joshua Haberman9abf6e22021-01-13 12:16:25 -080012452
12453#ifdef __cplusplus
12454extern "C" {
Joshua Habermand3995ec2022-09-30 16:54:39 -070012455#endif
Joshua Haberman9abf6e22021-01-13 12:16:25 -080012456
Eric Salo8809a112022-11-21 13:01:06 -080012457bool upb_EnumDef_CheckNumber(const upb_EnumDef* e, int32_t num);
12458const upb_MessageDef* upb_EnumDef_ContainingType(const upb_EnumDef* e);
12459int32_t upb_EnumDef_Default(const upb_EnumDef* e);
Jason Lunn67dee292023-07-13 13:15:26 -070012460UPB_API const upb_FileDef* upb_EnumDef_File(const upb_EnumDef* e);
Eric Salo8809a112022-11-21 13:01:06 -080012461const upb_EnumValueDef* upb_EnumDef_FindValueByName(const upb_EnumDef* e,
12462 const char* name);
Jason Lunn67dee292023-07-13 13:15:26 -070012463UPB_API const upb_EnumValueDef* upb_EnumDef_FindValueByNameWithSize(
Eric Salo8809a112022-11-21 13:01:06 -080012464 const upb_EnumDef* e, const char* name, size_t size);
Jason Lunn67dee292023-07-13 13:15:26 -070012465UPB_API const upb_EnumValueDef* upb_EnumDef_FindValueByNumber(
12466 const upb_EnumDef* e, int32_t num);
12467UPB_API const char* upb_EnumDef_FullName(const upb_EnumDef* e);
Eric Salo8809a112022-11-21 13:01:06 -080012468bool upb_EnumDef_HasOptions(const upb_EnumDef* e);
12469bool upb_EnumDef_IsClosed(const upb_EnumDef* e);
Protobuf Team Bot5e8d7e52024-03-15 22:28:30 +000012470bool upb_EnumDef_IsSpecifiedAsClosed(const upb_EnumDef* e);
Eric Salo8809a112022-11-21 13:01:06 -080012471
12472// Creates a mini descriptor string for an enum, returns true on success.
12473bool upb_EnumDef_MiniDescriptorEncode(const upb_EnumDef* e, upb_Arena* a,
12474 upb_StringView* out);
12475
12476const char* upb_EnumDef_Name(const upb_EnumDef* e);
Mike Kruskal232ecf42023-01-14 00:09:40 -080012477const UPB_DESC(EnumOptions) * upb_EnumDef_Options(const upb_EnumDef* e);
Protobuf Team Botce9dcc22023-11-03 22:38:26 +000012478const UPB_DESC(FeatureSet) * upb_EnumDef_ResolvedFeatures(const upb_EnumDef* e);
Eric Salo8809a112022-11-21 13:01:06 -080012479
12480upb_StringView upb_EnumDef_ReservedName(const upb_EnumDef* e, int i);
12481int upb_EnumDef_ReservedNameCount(const upb_EnumDef* e);
12482
12483const upb_EnumReservedRange* upb_EnumDef_ReservedRange(const upb_EnumDef* e,
12484 int i);
12485int upb_EnumDef_ReservedRangeCount(const upb_EnumDef* e);
12486
Jason Lunn67dee292023-07-13 13:15:26 -070012487UPB_API const upb_EnumValueDef* upb_EnumDef_Value(const upb_EnumDef* e, int i);
12488UPB_API int upb_EnumDef_ValueCount(const upb_EnumDef* e);
Eric Salo8809a112022-11-21 13:01:06 -080012489
12490#ifdef __cplusplus
12491} /* extern "C" */
12492#endif
12493
12494
12495#endif /* UPB_REFLECTION_ENUM_DEF_H_ */
12496
Protobuf Team Bot06310352023-09-26 21:54:58 +000012497// IWYU pragma: private, include "upb/reflection/def.h"
Eric Salo8809a112022-11-21 13:01:06 -080012498
12499#ifndef UPB_REFLECTION_ENUM_VALUE_DEF_H_
12500#define UPB_REFLECTION_ENUM_VALUE_DEF_H_
12501
12502
12503// Must be last.
12504
12505#ifdef __cplusplus
12506extern "C" {
12507#endif
12508
12509const upb_EnumDef* upb_EnumValueDef_Enum(const upb_EnumValueDef* v);
12510const char* upb_EnumValueDef_FullName(const upb_EnumValueDef* v);
12511bool upb_EnumValueDef_HasOptions(const upb_EnumValueDef* v);
12512uint32_t upb_EnumValueDef_Index(const upb_EnumValueDef* v);
Jason Lunn67dee292023-07-13 13:15:26 -070012513UPB_API const char* upb_EnumValueDef_Name(const upb_EnumValueDef* v);
12514UPB_API int32_t upb_EnumValueDef_Number(const upb_EnumValueDef* v);
Mike Kruskal232ecf42023-01-14 00:09:40 -080012515const UPB_DESC(EnumValueOptions) *
12516 upb_EnumValueDef_Options(const upb_EnumValueDef* v);
Protobuf Team Botce9dcc22023-11-03 22:38:26 +000012517const UPB_DESC(FeatureSet) *
12518 upb_EnumValueDef_ResolvedFeatures(const upb_EnumValueDef* e);
Eric Salo8809a112022-11-21 13:01:06 -080012519
12520#ifdef __cplusplus
12521} /* extern "C" */
12522#endif
12523
12524
12525#endif /* UPB_REFLECTION_ENUM_VALUE_DEF_H_ */
12526
Protobuf Team Bot06310352023-09-26 21:54:58 +000012527// IWYU pragma: private, include "upb/reflection/def.h"
Eric Salo8809a112022-11-21 13:01:06 -080012528
12529#ifndef UPB_REFLECTION_EXTENSION_RANGE_H_
12530#define UPB_REFLECTION_EXTENSION_RANGE_H_
12531
12532
12533// Must be last.
12534
12535#ifdef __cplusplus
12536extern "C" {
12537#endif
12538
12539int32_t upb_ExtensionRange_Start(const upb_ExtensionRange* r);
12540int32_t upb_ExtensionRange_End(const upb_ExtensionRange* r);
12541
12542bool upb_ExtensionRange_HasOptions(const upb_ExtensionRange* r);
Mike Kruskal232ecf42023-01-14 00:09:40 -080012543const UPB_DESC(ExtensionRangeOptions) *
12544 upb_ExtensionRange_Options(const upb_ExtensionRange* r);
Protobuf Team Botce9dcc22023-11-03 22:38:26 +000012545const UPB_DESC(FeatureSet) *
12546 upb_ExtensionRange_ResolvedFeatures(const upb_ExtensionRange* e);
Eric Salo8809a112022-11-21 13:01:06 -080012547
12548#ifdef __cplusplus
12549} /* extern "C" */
12550#endif
12551
12552
12553#endif /* UPB_REFLECTION_EXTENSION_RANGE_H_ */
12554
Protobuf Team Bot06310352023-09-26 21:54:58 +000012555// IWYU pragma: private, include "upb/reflection/def.h"
Eric Salo8809a112022-11-21 13:01:06 -080012556
12557#ifndef UPB_REFLECTION_FIELD_DEF_H_
12558#define UPB_REFLECTION_FIELD_DEF_H_
12559
Protobuf Team Bot4e90ead2024-01-08 15:46:34 +000012560#include <stdint.h>
12561
Eric Salo8809a112022-11-21 13:01:06 -080012562
12563// Must be last.
12564
12565// Maximum field number allowed for FieldDefs.
12566// This is an inherent limit of the protobuf wire format.
12567#define kUpb_MaxFieldNumber ((1 << 29) - 1)
12568
12569#ifdef __cplusplus
12570extern "C" {
12571#endif
12572
12573const upb_OneofDef* upb_FieldDef_ContainingOneof(const upb_FieldDef* f);
Jason Lunn67dee292023-07-13 13:15:26 -070012574UPB_API const upb_MessageDef* upb_FieldDef_ContainingType(
12575 const upb_FieldDef* f);
12576UPB_API upb_CType upb_FieldDef_CType(const upb_FieldDef* f);
12577UPB_API upb_MessageValue upb_FieldDef_Default(const upb_FieldDef* f);
12578UPB_API const upb_EnumDef* upb_FieldDef_EnumSubDef(const upb_FieldDef* f);
Eric Salo8809a112022-11-21 13:01:06 -080012579const upb_MessageDef* upb_FieldDef_ExtensionScope(const upb_FieldDef* f);
Jason Lunn67dee292023-07-13 13:15:26 -070012580UPB_API const upb_FileDef* upb_FieldDef_File(const upb_FieldDef* f);
Eric Salo8809a112022-11-21 13:01:06 -080012581const char* upb_FieldDef_FullName(const upb_FieldDef* f);
12582bool upb_FieldDef_HasDefault(const upb_FieldDef* f);
12583bool upb_FieldDef_HasJsonName(const upb_FieldDef* f);
12584bool upb_FieldDef_HasOptions(const upb_FieldDef* f);
Jason Lunn67dee292023-07-13 13:15:26 -070012585UPB_API bool upb_FieldDef_HasPresence(const upb_FieldDef* f);
Eric Salo8809a112022-11-21 13:01:06 -080012586bool upb_FieldDef_HasSubDef(const upb_FieldDef* f);
12587uint32_t upb_FieldDef_Index(const upb_FieldDef* f);
Protobuf Team Botef020872024-04-24 18:42:18 +000012588UPB_API bool upb_FieldDef_IsEnum(const upb_FieldDef* f);
Eric Salo8809a112022-11-21 13:01:06 -080012589bool upb_FieldDef_IsExtension(const upb_FieldDef* f);
Jason Lunn67dee292023-07-13 13:15:26 -070012590UPB_API bool upb_FieldDef_IsMap(const upb_FieldDef* f);
Eric Salo8809a112022-11-21 13:01:06 -080012591bool upb_FieldDef_IsOptional(const upb_FieldDef* f);
Protobuf Team Botf2c187d2024-01-09 17:58:04 +000012592UPB_API bool upb_FieldDef_IsPacked(const upb_FieldDef* f);
Eric Salo8809a112022-11-21 13:01:06 -080012593bool upb_FieldDef_IsPrimitive(const upb_FieldDef* f);
Jason Lunn67dee292023-07-13 13:15:26 -070012594UPB_API bool upb_FieldDef_IsRepeated(const upb_FieldDef* f);
Eric Salo8809a112022-11-21 13:01:06 -080012595bool upb_FieldDef_IsRequired(const upb_FieldDef* f);
12596bool upb_FieldDef_IsString(const upb_FieldDef* f);
Jason Lunn67dee292023-07-13 13:15:26 -070012597UPB_API bool upb_FieldDef_IsSubMessage(const upb_FieldDef* f);
12598UPB_API const char* upb_FieldDef_JsonName(const upb_FieldDef* f);
12599UPB_API upb_Label upb_FieldDef_Label(const upb_FieldDef* f);
Protobuf Team Botb361c9c2024-03-22 00:27:43 +000012600uint32_t upb_FieldDef_LayoutIndex(const upb_FieldDef* f);
Jason Lunn67dee292023-07-13 13:15:26 -070012601UPB_API const upb_MessageDef* upb_FieldDef_MessageSubDef(const upb_FieldDef* f);
Protobuf Team Botb58bd402023-09-19 15:42:34 +000012602bool _upb_FieldDef_ValidateUtf8(const upb_FieldDef* f);
Protobuf Team Bot8ce5c9f2024-04-05 20:20:09 +000012603bool _upb_FieldDef_IsGroupLike(const upb_FieldDef* f);
Eric Salo8809a112022-11-21 13:01:06 -080012604
12605// Creates a mini descriptor string for a field, returns true on success.
12606bool upb_FieldDef_MiniDescriptorEncode(const upb_FieldDef* f, upb_Arena* a,
12607 upb_StringView* out);
12608
12609const upb_MiniTableField* upb_FieldDef_MiniTable(const upb_FieldDef* f);
Protobuf Team Bot4e90ead2024-01-08 15:46:34 +000012610const upb_MiniTableExtension* upb_FieldDef_MiniTableExtension(
12611 const upb_FieldDef* f);
Jason Lunn67dee292023-07-13 13:15:26 -070012612UPB_API const char* upb_FieldDef_Name(const upb_FieldDef* f);
12613UPB_API uint32_t upb_FieldDef_Number(const upb_FieldDef* f);
Mike Kruskal232ecf42023-01-14 00:09:40 -080012614const UPB_DESC(FieldOptions) * upb_FieldDef_Options(const upb_FieldDef* f);
Protobuf Team Botce9dcc22023-11-03 22:38:26 +000012615const UPB_DESC(FeatureSet) *
12616 upb_FieldDef_ResolvedFeatures(const upb_FieldDef* f);
Jason Lunn67dee292023-07-13 13:15:26 -070012617UPB_API const upb_OneofDef* upb_FieldDef_RealContainingOneof(
12618 const upb_FieldDef* f);
12619UPB_API upb_FieldType upb_FieldDef_Type(const upb_FieldDef* f);
Eric Salo8809a112022-11-21 13:01:06 -080012620
12621#ifdef __cplusplus
12622} /* extern "C" */
12623#endif
12624
12625
12626#endif /* UPB_REFLECTION_FIELD_DEF_H_ */
12627
Protobuf Team Bot06310352023-09-26 21:54:58 +000012628// IWYU pragma: private, include "upb/reflection/def.h"
Eric Salo8809a112022-11-21 13:01:06 -080012629
12630#ifndef UPB_REFLECTION_FILE_DEF_H_
12631#define UPB_REFLECTION_FILE_DEF_H_
12632
12633
12634// Must be last.
12635
12636#ifdef __cplusplus
12637extern "C" {
12638#endif
12639
Protobuf Team Botc6b149c2023-11-10 23:37:46 +000012640UPB_API const char* upb_FileDef_EditionName(int edition);
12641
Eric Salo8809a112022-11-21 13:01:06 -080012642const upb_FileDef* upb_FileDef_Dependency(const upb_FileDef* f, int i);
12643int upb_FileDef_DependencyCount(const upb_FileDef* f);
12644bool upb_FileDef_HasOptions(const upb_FileDef* f);
Jason Lunn67dee292023-07-13 13:15:26 -070012645UPB_API const char* upb_FileDef_Name(const upb_FileDef* f);
Mike Kruskal232ecf42023-01-14 00:09:40 -080012646const UPB_DESC(FileOptions) * upb_FileDef_Options(const upb_FileDef* f);
Protobuf Team Botce9dcc22023-11-03 22:38:26 +000012647const UPB_DESC(FeatureSet) * upb_FileDef_ResolvedFeatures(const upb_FileDef* f);
Eric Salo8809a112022-11-21 13:01:06 -080012648const char* upb_FileDef_Package(const upb_FileDef* f);
Protobuf Team Bot7dabac92023-09-07 18:35:50 +000012649UPB_DESC(Edition) upb_FileDef_Edition(const upb_FileDef* f);
Jason Lunn67dee292023-07-13 13:15:26 -070012650UPB_API const upb_DefPool* upb_FileDef_Pool(const upb_FileDef* f);
Eric Salo8809a112022-11-21 13:01:06 -080012651
12652const upb_FileDef* upb_FileDef_PublicDependency(const upb_FileDef* f, int i);
12653int upb_FileDef_PublicDependencyCount(const upb_FileDef* f);
12654
12655const upb_ServiceDef* upb_FileDef_Service(const upb_FileDef* f, int i);
12656int upb_FileDef_ServiceCount(const upb_FileDef* f);
12657
Jason Lunn67dee292023-07-13 13:15:26 -070012658UPB_API upb_Syntax upb_FileDef_Syntax(const upb_FileDef* f);
Eric Salo8809a112022-11-21 13:01:06 -080012659
12660const upb_EnumDef* upb_FileDef_TopLevelEnum(const upb_FileDef* f, int i);
12661int upb_FileDef_TopLevelEnumCount(const upb_FileDef* f);
12662
12663const upb_FieldDef* upb_FileDef_TopLevelExtension(const upb_FileDef* f, int i);
12664int upb_FileDef_TopLevelExtensionCount(const upb_FileDef* f);
12665
12666const upb_MessageDef* upb_FileDef_TopLevelMessage(const upb_FileDef* f, int i);
12667int upb_FileDef_TopLevelMessageCount(const upb_FileDef* f);
12668
12669const upb_FileDef* upb_FileDef_WeakDependency(const upb_FileDef* f, int i);
12670int upb_FileDef_WeakDependencyCount(const upb_FileDef* f);
12671
Protobuf Team Bot55696ad2024-04-16 14:44:23 +000012672// Returns whether |symbol| is transitively included by |f|
12673bool upb_FileDef_Resolves(const upb_FileDef* f, const char* symbol);
12674
Eric Salo8809a112022-11-21 13:01:06 -080012675#ifdef __cplusplus
12676} /* extern "C" */
12677#endif
12678
12679
12680#endif /* UPB_REFLECTION_FILE_DEF_H_ */
12681
Protobuf Team Bot06310352023-09-26 21:54:58 +000012682// IWYU pragma: private, include "upb/reflection/def.h"
Eric Salo8809a112022-11-21 13:01:06 -080012683
12684#ifndef UPB_REFLECTION_MESSAGE_DEF_H_
12685#define UPB_REFLECTION_MESSAGE_DEF_H_
12686
12687
12688// Must be last.
12689
12690// Well-known field tag numbers for map-entry messages.
12691#define kUpb_MapEntry_KeyFieldNumber 1
12692#define kUpb_MapEntry_ValueFieldNumber 2
12693
12694// Well-known field tag numbers for Any messages.
12695#define kUpb_Any_TypeFieldNumber 1
12696#define kUpb_Any_ValueFieldNumber 2
12697
12698// Well-known field tag numbers for duration messages.
12699#define kUpb_Duration_SecondsFieldNumber 1
12700#define kUpb_Duration_NanosFieldNumber 2
12701
12702// Well-known field tag numbers for timestamp messages.
12703#define kUpb_Timestamp_SecondsFieldNumber 1
12704#define kUpb_Timestamp_NanosFieldNumber 2
12705
12706// All the different kind of well known type messages. For simplicity of check,
12707// number wrappers and string wrappers are grouped together. Make sure the
12708// order and number of these groups are not changed.
12709typedef enum {
12710 kUpb_WellKnown_Unspecified,
12711 kUpb_WellKnown_Any,
12712 kUpb_WellKnown_FieldMask,
12713 kUpb_WellKnown_Duration,
12714 kUpb_WellKnown_Timestamp,
12715
12716 // number wrappers
12717 kUpb_WellKnown_DoubleValue,
12718 kUpb_WellKnown_FloatValue,
12719 kUpb_WellKnown_Int64Value,
12720 kUpb_WellKnown_UInt64Value,
12721 kUpb_WellKnown_Int32Value,
12722 kUpb_WellKnown_UInt32Value,
12723
12724 // string wrappers
12725 kUpb_WellKnown_StringValue,
12726 kUpb_WellKnown_BytesValue,
12727 kUpb_WellKnown_BoolValue,
12728 kUpb_WellKnown_Value,
12729 kUpb_WellKnown_ListValue,
12730 kUpb_WellKnown_Struct,
12731} upb_WellKnown;
12732
12733#ifdef __cplusplus
12734extern "C" {
12735#endif
12736
12737const upb_MessageDef* upb_MessageDef_ContainingType(const upb_MessageDef* m);
12738
12739const upb_ExtensionRange* upb_MessageDef_ExtensionRange(const upb_MessageDef* m,
12740 int i);
12741int upb_MessageDef_ExtensionRangeCount(const upb_MessageDef* m);
12742
Jason Lunn67dee292023-07-13 13:15:26 -070012743UPB_API const upb_FieldDef* upb_MessageDef_Field(const upb_MessageDef* m,
12744 int i);
12745UPB_API int upb_MessageDef_FieldCount(const upb_MessageDef* m);
Eric Salo8809a112022-11-21 13:01:06 -080012746
Jason Lunn67dee292023-07-13 13:15:26 -070012747UPB_API const upb_FileDef* upb_MessageDef_File(const upb_MessageDef* m);
Eric Salo8809a112022-11-21 13:01:06 -080012748
12749// Returns a field by either JSON name or regular proto name.
12750const upb_FieldDef* upb_MessageDef_FindByJsonNameWithSize(
12751 const upb_MessageDef* m, const char* name, size_t size);
12752UPB_INLINE const upb_FieldDef* upb_MessageDef_FindByJsonName(
12753 const upb_MessageDef* m, const char* name) {
12754 return upb_MessageDef_FindByJsonNameWithSize(m, name, strlen(name));
12755}
12756
12757// Lookup of either field or oneof by name. Returns whether either was found.
12758// If the return is true, then the found def will be set, and the non-found
12759// one set to NULL.
Jason Lunn67dee292023-07-13 13:15:26 -070012760UPB_API bool upb_MessageDef_FindByNameWithSize(const upb_MessageDef* m,
12761 const char* name, size_t size,
12762 const upb_FieldDef** f,
12763 const upb_OneofDef** o);
Eric Salo8809a112022-11-21 13:01:06 -080012764UPB_INLINE bool upb_MessageDef_FindByName(const upb_MessageDef* m,
12765 const char* name,
12766 const upb_FieldDef** f,
12767 const upb_OneofDef** o) {
12768 return upb_MessageDef_FindByNameWithSize(m, name, strlen(name), f, o);
12769}
12770
12771const upb_FieldDef* upb_MessageDef_FindFieldByName(const upb_MessageDef* m,
12772 const char* name);
Jason Lunn67dee292023-07-13 13:15:26 -070012773UPB_API const upb_FieldDef* upb_MessageDef_FindFieldByNameWithSize(
Eric Salo8809a112022-11-21 13:01:06 -080012774 const upb_MessageDef* m, const char* name, size_t size);
Jason Lunn67dee292023-07-13 13:15:26 -070012775UPB_API const upb_FieldDef* upb_MessageDef_FindFieldByNumber(
12776 const upb_MessageDef* m, uint32_t i);
Eric Salo8809a112022-11-21 13:01:06 -080012777const upb_OneofDef* upb_MessageDef_FindOneofByName(const upb_MessageDef* m,
12778 const char* name);
Jason Lunn67dee292023-07-13 13:15:26 -070012779UPB_API const upb_OneofDef* upb_MessageDef_FindOneofByNameWithSize(
Eric Salo8809a112022-11-21 13:01:06 -080012780 const upb_MessageDef* m, const char* name, size_t size);
Jason Lunn67dee292023-07-13 13:15:26 -070012781UPB_API const char* upb_MessageDef_FullName(const upb_MessageDef* m);
Eric Salo8809a112022-11-21 13:01:06 -080012782bool upb_MessageDef_HasOptions(const upb_MessageDef* m);
12783bool upb_MessageDef_IsMapEntry(const upb_MessageDef* m);
12784bool upb_MessageDef_IsMessageSet(const upb_MessageDef* m);
12785
12786// Creates a mini descriptor string for a message, returns true on success.
12787bool upb_MessageDef_MiniDescriptorEncode(const upb_MessageDef* m, upb_Arena* a,
12788 upb_StringView* out);
12789
Jason Lunn67dee292023-07-13 13:15:26 -070012790UPB_API const upb_MiniTable* upb_MessageDef_MiniTable(const upb_MessageDef* m);
Eric Salo8809a112022-11-21 13:01:06 -080012791const char* upb_MessageDef_Name(const upb_MessageDef* m);
12792
12793const upb_EnumDef* upb_MessageDef_NestedEnum(const upb_MessageDef* m, int i);
12794const upb_FieldDef* upb_MessageDef_NestedExtension(const upb_MessageDef* m,
12795 int i);
12796const upb_MessageDef* upb_MessageDef_NestedMessage(const upb_MessageDef* m,
12797 int i);
12798
12799int upb_MessageDef_NestedEnumCount(const upb_MessageDef* m);
12800int upb_MessageDef_NestedExtensionCount(const upb_MessageDef* m);
12801int upb_MessageDef_NestedMessageCount(const upb_MessageDef* m);
12802
Jason Lunn67dee292023-07-13 13:15:26 -070012803UPB_API const upb_OneofDef* upb_MessageDef_Oneof(const upb_MessageDef* m,
12804 int i);
12805UPB_API int upb_MessageDef_OneofCount(const upb_MessageDef* m);
Mike Kruskal232ecf42023-01-14 00:09:40 -080012806int upb_MessageDef_RealOneofCount(const upb_MessageDef* m);
Eric Salo8809a112022-11-21 13:01:06 -080012807
Mike Kruskal232ecf42023-01-14 00:09:40 -080012808const UPB_DESC(MessageOptions) *
12809 upb_MessageDef_Options(const upb_MessageDef* m);
Protobuf Team Botce9dcc22023-11-03 22:38:26 +000012810const UPB_DESC(FeatureSet) *
12811 upb_MessageDef_ResolvedFeatures(const upb_MessageDef* m);
Eric Salo8809a112022-11-21 13:01:06 -080012812
12813upb_StringView upb_MessageDef_ReservedName(const upb_MessageDef* m, int i);
12814int upb_MessageDef_ReservedNameCount(const upb_MessageDef* m);
12815
12816const upb_MessageReservedRange* upb_MessageDef_ReservedRange(
12817 const upb_MessageDef* m, int i);
12818int upb_MessageDef_ReservedRangeCount(const upb_MessageDef* m);
12819
Jason Lunn67dee292023-07-13 13:15:26 -070012820UPB_API upb_Syntax upb_MessageDef_Syntax(const upb_MessageDef* m);
12821UPB_API upb_WellKnown upb_MessageDef_WellKnownType(const upb_MessageDef* m);
Eric Salo8809a112022-11-21 13:01:06 -080012822
12823#ifdef __cplusplus
12824} /* extern "C" */
12825#endif
12826
12827
12828#endif /* UPB_REFLECTION_MESSAGE_DEF_H_ */
12829
Protobuf Team Bot06310352023-09-26 21:54:58 +000012830// IWYU pragma: private, include "upb/reflection/def.h"
Eric Salo8809a112022-11-21 13:01:06 -080012831
12832#ifndef UPB_REFLECTION_METHOD_DEF_H_
12833#define UPB_REFLECTION_METHOD_DEF_H_
12834
12835
12836// Must be last.
12837
12838#ifdef __cplusplus
12839extern "C" {
12840#endif
12841
Protobuf Team Bot312240c2024-03-22 17:47:13 +000012842UPB_API bool upb_MethodDef_ClientStreaming(const upb_MethodDef* m);
Eric Salo8809a112022-11-21 13:01:06 -080012843const char* upb_MethodDef_FullName(const upb_MethodDef* m);
12844bool upb_MethodDef_HasOptions(const upb_MethodDef* m);
12845int upb_MethodDef_Index(const upb_MethodDef* m);
Protobuf Team Bot312240c2024-03-22 17:47:13 +000012846UPB_API const upb_MessageDef* upb_MethodDef_InputType(const upb_MethodDef* m);
12847UPB_API const char* upb_MethodDef_Name(const upb_MethodDef* m);
12848UPB_API const UPB_DESC(MethodOptions) *
12849 upb_MethodDef_Options(const upb_MethodDef* m);
Protobuf Team Botce9dcc22023-11-03 22:38:26 +000012850const UPB_DESC(FeatureSet) *
12851 upb_MethodDef_ResolvedFeatures(const upb_MethodDef* m);
Protobuf Team Bot312240c2024-03-22 17:47:13 +000012852UPB_API const upb_MessageDef* upb_MethodDef_OutputType(const upb_MethodDef* m);
12853UPB_API bool upb_MethodDef_ServerStreaming(const upb_MethodDef* m);
12854UPB_API const upb_ServiceDef* upb_MethodDef_Service(const upb_MethodDef* m);
Eric Salo8809a112022-11-21 13:01:06 -080012855
12856#ifdef __cplusplus
12857} /* extern "C" */
12858#endif
12859
12860
12861#endif /* UPB_REFLECTION_METHOD_DEF_H_ */
12862
Protobuf Team Bot06310352023-09-26 21:54:58 +000012863// IWYU pragma: private, include "upb/reflection/def.h"
Eric Salo8809a112022-11-21 13:01:06 -080012864
12865#ifndef UPB_REFLECTION_ONEOF_DEF_H_
12866#define UPB_REFLECTION_ONEOF_DEF_H_
12867
12868
12869// Must be last.
12870
12871#ifdef __cplusplus
12872extern "C" {
12873#endif
12874
Jason Lunn67dee292023-07-13 13:15:26 -070012875UPB_API const upb_MessageDef* upb_OneofDef_ContainingType(
12876 const upb_OneofDef* o);
12877UPB_API const upb_FieldDef* upb_OneofDef_Field(const upb_OneofDef* o, int i);
12878UPB_API int upb_OneofDef_FieldCount(const upb_OneofDef* o);
Eric Salo8809a112022-11-21 13:01:06 -080012879const char* upb_OneofDef_FullName(const upb_OneofDef* o);
12880bool upb_OneofDef_HasOptions(const upb_OneofDef* o);
12881uint32_t upb_OneofDef_Index(const upb_OneofDef* o);
12882bool upb_OneofDef_IsSynthetic(const upb_OneofDef* o);
12883const upb_FieldDef* upb_OneofDef_LookupName(const upb_OneofDef* o,
12884 const char* name);
12885const upb_FieldDef* upb_OneofDef_LookupNameWithSize(const upb_OneofDef* o,
12886 const char* name,
12887 size_t size);
12888const upb_FieldDef* upb_OneofDef_LookupNumber(const upb_OneofDef* o,
12889 uint32_t num);
Jason Lunn67dee292023-07-13 13:15:26 -070012890UPB_API const char* upb_OneofDef_Name(const upb_OneofDef* o);
Eric Salo8809a112022-11-21 13:01:06 -080012891int upb_OneofDef_numfields(const upb_OneofDef* o);
Protobuf Team Botce9dcc22023-11-03 22:38:26 +000012892const UPB_DESC(OneofOptions*) upb_OneofDef_Options(const upb_OneofDef* o);
12893const UPB_DESC(FeatureSet*)
12894 upb_OneofDef_ResolvedFeatures(const upb_OneofDef* o);
Eric Salo8809a112022-11-21 13:01:06 -080012895
12896#ifdef __cplusplus
12897} /* extern "C" */
12898#endif
12899
12900
12901#endif /* UPB_REFLECTION_ONEOF_DEF_H_ */
12902
Protobuf Team Bot06310352023-09-26 21:54:58 +000012903// IWYU pragma: private, include "upb/reflection/def.h"
Eric Salo8809a112022-11-21 13:01:06 -080012904
12905#ifndef UPB_REFLECTION_SERVICE_DEF_H_
12906#define UPB_REFLECTION_SERVICE_DEF_H_
12907
12908
12909// Must be last.
12910
12911#ifdef __cplusplus
12912extern "C" {
12913#endif
12914
Protobuf Team Bot312240c2024-03-22 17:47:13 +000012915UPB_API const upb_FileDef* upb_ServiceDef_File(const upb_ServiceDef* s);
Eric Salo8809a112022-11-21 13:01:06 -080012916const upb_MethodDef* upb_ServiceDef_FindMethodByName(const upb_ServiceDef* s,
12917 const char* name);
Protobuf Team Bot312240c2024-03-22 17:47:13 +000012918UPB_API const char* upb_ServiceDef_FullName(const upb_ServiceDef* s);
Eric Salo8809a112022-11-21 13:01:06 -080012919bool upb_ServiceDef_HasOptions(const upb_ServiceDef* s);
12920int upb_ServiceDef_Index(const upb_ServiceDef* s);
Protobuf Team Bot312240c2024-03-22 17:47:13 +000012921UPB_API const upb_MethodDef* upb_ServiceDef_Method(const upb_ServiceDef* s,
12922 int i);
12923UPB_API int upb_ServiceDef_MethodCount(const upb_ServiceDef* s);
Eric Salo8809a112022-11-21 13:01:06 -080012924const char* upb_ServiceDef_Name(const upb_ServiceDef* s);
Protobuf Team Bot312240c2024-03-22 17:47:13 +000012925UPB_API const UPB_DESC(ServiceOptions) *
Mike Kruskal232ecf42023-01-14 00:09:40 -080012926 upb_ServiceDef_Options(const upb_ServiceDef* s);
Protobuf Team Botce9dcc22023-11-03 22:38:26 +000012927const UPB_DESC(FeatureSet) *
12928 upb_ServiceDef_ResolvedFeatures(const upb_ServiceDef* s);
Eric Salo8809a112022-11-21 13:01:06 -080012929
12930#ifdef __cplusplus
12931} /* extern "C" */
12932#endif
12933
12934
12935#endif /* UPB_REFLECTION_SERVICE_DEF_H_ */
Protobuf Team Botffc56ba2023-09-08 15:29:06 +000012936// IWYU pragma: end_exports
Eric Salo8809a112022-11-21 13:01:06 -080012937
12938#endif /* UPB_REFLECTION_DEF_H_ */
12939
12940// Must be last.
12941
12942#ifdef __cplusplus
12943extern "C" {
12944#endif
12945
12946enum { upb_JsonDecode_IgnoreUnknown = 1 };
12947
Jason Lunn67dee292023-07-13 13:15:26 -070012948UPB_API bool upb_JsonDecode(const char* buf, size_t size, upb_Message* msg,
12949 const upb_MessageDef* m, const upb_DefPool* symtab,
12950 int options, upb_Arena* arena, upb_Status* status);
Eric Salo8809a112022-11-21 13:01:06 -080012951
12952#ifdef __cplusplus
12953} /* extern "C" */
12954#endif
12955
12956
12957#endif /* UPB_JSONDECODE_H_ */
12958
12959#ifndef UPB_LEX_ATOI_H_
12960#define UPB_LEX_ATOI_H_
12961
Adam Cozzette7d5592e2023-08-23 12:15:26 -070012962#include <stdint.h>
12963
Eric Salo8809a112022-11-21 13:01:06 -080012964// Must be last.
12965
12966#ifdef __cplusplus
12967extern "C" {
12968#endif
12969
12970// We use these hand-written routines instead of strto[u]l() because the "long
12971// long" variants aren't in c89. Also our version allows setting a ptr limit.
12972// Return the new position of the pointer after parsing the int, or NULL on
12973// integer overflow.
12974
12975const char* upb_BufToUint64(const char* ptr, const char* end, uint64_t* val);
12976const char* upb_BufToInt64(const char* ptr, const char* end, int64_t* val,
12977 bool* is_neg);
12978
12979#ifdef __cplusplus
12980} /* extern "C" */
12981#endif
12982
12983
12984#endif /* UPB_LEX_ATOI_H_ */
12985
12986#ifndef UPB_LEX_UNICODE_H_
12987#define UPB_LEX_UNICODE_H_
12988
Adam Cozzette7d5592e2023-08-23 12:15:26 -070012989#include <stdint.h>
12990
Eric Salo8809a112022-11-21 13:01:06 -080012991// Must be last.
12992
12993#ifdef __cplusplus
12994extern "C" {
12995#endif
12996
12997// Returns true iff a codepoint is the value for a high surrogate.
12998UPB_INLINE bool upb_Unicode_IsHigh(uint32_t cp) {
12999 return (cp >= 0xd800 && cp <= 0xdbff);
13000}
13001
13002// Returns true iff a codepoint is the value for a low surrogate.
13003UPB_INLINE bool upb_Unicode_IsLow(uint32_t cp) {
13004 return (cp >= 0xdc00 && cp <= 0xdfff);
13005}
13006
13007// Returns the high 16-bit surrogate value for a supplementary codepoint.
13008// Does not sanity-check the input.
13009UPB_INLINE uint16_t upb_Unicode_ToHigh(uint32_t cp) {
13010 return (cp >> 10) + 0xd7c0;
13011}
13012
13013// Returns the low 16-bit surrogate value for a supplementary codepoint.
13014// Does not sanity-check the input.
13015UPB_INLINE uint16_t upb_Unicode_ToLow(uint32_t cp) {
13016 return (cp & 0x3ff) | 0xdc00;
13017}
13018
13019// Returns the 32-bit value corresponding to a pair of 16-bit surrogates.
13020// Does not sanity-check the input.
13021UPB_INLINE uint32_t upb_Unicode_FromPair(uint32_t high, uint32_t low) {
13022 return ((high & 0x3ff) << 10) + (low & 0x3ff) + 0x10000;
13023}
13024
13025// Outputs a codepoint as UTF8.
13026// Returns the number of bytes written (1-4 on success, 0 on error).
13027// Does not sanity-check the input. Specifically does not check for surrogates.
13028int upb_Unicode_ToUTF8(uint32_t cp, char* out);
13029
13030#ifdef __cplusplus
13031} /* extern "C" */
13032#endif
13033
13034
13035#endif /* UPB_LEX_UNICODE_H_ */
13036
13037#ifndef UPB_REFLECTION_MESSAGE_H_
13038#define UPB_REFLECTION_MESSAGE_H_
13039
Protobuf Team Bot473d20d2023-09-15 22:27:16 +000013040#include <stddef.h>
13041
Eric Salo8809a112022-11-21 13:01:06 -080013042
13043// Must be last.
13044
13045#ifdef __cplusplus
13046extern "C" {
13047#endif
13048
Eric Salo3f36a912022-12-05 14:12:25 -080013049// Returns a mutable pointer to a map, array, or submessage value. If the given
13050// arena is non-NULL this will construct a new object if it was not previously
13051// present. May not be called for primitive fields.
Jason Lunn67dee292023-07-13 13:15:26 -070013052UPB_API upb_MutableMessageValue upb_Message_Mutable(upb_Message* msg,
13053 const upb_FieldDef* f,
13054 upb_Arena* a);
Eric Salo8809a112022-11-21 13:01:06 -080013055
Eric Salo3f36a912022-12-05 14:12:25 -080013056// Returns the field that is set in the oneof, or NULL if none are set.
Protobuf Team Bot6cce6222024-05-28 17:15:46 +000013057UPB_API const upb_FieldDef* upb_Message_WhichOneofByDef(const upb_Message* msg,
13058 const upb_OneofDef* o);
Eric Salo8809a112022-11-21 13:01:06 -080013059
Eric Salo3f36a912022-12-05 14:12:25 -080013060// Clear all data and unknown fields.
13061void upb_Message_ClearByDef(upb_Message* msg, const upb_MessageDef* m);
Eric Salo8809a112022-11-21 13:01:06 -080013062
Eric Salo3f36a912022-12-05 14:12:25 -080013063// Clears any field presence and sets the value back to its default.
Jason Lunn67dee292023-07-13 13:15:26 -070013064UPB_API void upb_Message_ClearFieldByDef(upb_Message* msg,
13065 const upb_FieldDef* f);
Eric Salo8809a112022-11-21 13:01:06 -080013066
Eric Salo3f36a912022-12-05 14:12:25 -080013067// May only be called for fields where upb_FieldDef_HasPresence(f) == true.
Jason Lunn67dee292023-07-13 13:15:26 -070013068UPB_API bool upb_Message_HasFieldByDef(const upb_Message* msg,
13069 const upb_FieldDef* f);
Eric Salo8809a112022-11-21 13:01:06 -080013070
Eric Salo3f36a912022-12-05 14:12:25 -080013071// Returns the value in the message associated with this field def.
Jason Lunn67dee292023-07-13 13:15:26 -070013072UPB_API upb_MessageValue upb_Message_GetFieldByDef(const upb_Message* msg,
13073 const upb_FieldDef* f);
Eric Salo3f36a912022-12-05 14:12:25 -080013074
13075// Sets the given field to the given value. For a msg/array/map/string, the
13076// caller must ensure that the target data outlives |msg| (by living either in
13077// the same arena or a different arena that outlives it).
13078//
13079// Returns false if allocation fails.
Jason Lunn67dee292023-07-13 13:15:26 -070013080UPB_API bool upb_Message_SetFieldByDef(upb_Message* msg, const upb_FieldDef* f,
13081 upb_MessageValue val, upb_Arena* a);
Eric Salo3f36a912022-12-05 14:12:25 -080013082
13083// Iterate over present fields.
13084//
13085// size_t iter = kUpb_Message_Begin;
13086// const upb_FieldDef *f;
13087// upb_MessageValue val;
13088// while (upb_Message_Next(msg, m, ext_pool, &f, &val, &iter)) {
13089// process_field(f, val);
13090// }
13091//
13092// If ext_pool is NULL, no extensions will be returned. If the given symtab
13093// returns extensions that don't match what is in this message, those extensions
13094// will be skipped.
Eric Salo8809a112022-11-21 13:01:06 -080013095
13096#define kUpb_Message_Begin -1
Eric Salo3f36a912022-12-05 14:12:25 -080013097
Protobuf Team Bot7e324502024-01-04 18:12:49 +000013098UPB_API bool upb_Message_Next(const upb_Message* msg, const upb_MessageDef* m,
13099 const upb_DefPool* ext_pool,
13100 const upb_FieldDef** f, upb_MessageValue* val,
13101 size_t* iter);
Eric Salo8809a112022-11-21 13:01:06 -080013102
Eric Salo3f36a912022-12-05 14:12:25 -080013103// Clears all unknown field data from this message and all submessages.
Jason Lunn67dee292023-07-13 13:15:26 -070013104UPB_API bool upb_Message_DiscardUnknown(upb_Message* msg,
13105 const upb_MessageDef* m, int maxdepth);
Eric Salo8809a112022-11-21 13:01:06 -080013106
13107#ifdef __cplusplus
13108} /* extern "C" */
13109#endif
13110
13111
13112#endif /* UPB_REFLECTION_MESSAGE_H_ */
13113
13114#ifndef UPB_JSON_ENCODE_H_
13115#define UPB_JSON_ENCODE_H_
13116
13117
13118// Must be last.
13119
13120#ifdef __cplusplus
13121extern "C" {
13122#endif
13123
13124enum {
Protobuf Team Bot986cbb62023-09-19 15:03:51 +000013125 /* When set, emits 0/default values. TODO: proto3 only? */
Eric Salo8809a112022-11-21 13:01:06 -080013126 upb_JsonEncode_EmitDefaults = 1 << 0,
13127
13128 /* When set, use normal (snake_case) field names instead of JSON (camelCase)
13129 names. */
13130 upb_JsonEncode_UseProtoNames = 1 << 1,
13131
13132 /* When set, emits enums as their integer values instead of as their names. */
13133 upb_JsonEncode_FormatEnumsAsIntegers = 1 << 2
13134};
13135
13136/* Encodes the given |msg| to JSON format. The message's reflection is given in
Protobuf Team Botad884532023-09-05 18:31:02 +000013137 * |m|. The DefPool in |ext_pool| is used to find extensions (if NULL,
13138 * extensions will not be printed).
Eric Salo8809a112022-11-21 13:01:06 -080013139 *
13140 * Output is placed in the given buffer, and always NULL-terminated. The output
13141 * size (excluding NULL) is returned. This means that a return value >= |size|
13142 * implies that the output was truncated. (These are the same semantics as
13143 * snprintf()). */
Jason Lunn67dee292023-07-13 13:15:26 -070013144UPB_API size_t upb_JsonEncode(const upb_Message* msg, const upb_MessageDef* m,
13145 const upb_DefPool* ext_pool, int options,
13146 char* buf, size_t size, upb_Status* status);
Eric Salo8809a112022-11-21 13:01:06 -080013147
13148#ifdef __cplusplus
13149} /* extern "C" */
13150#endif
13151
13152
13153#endif /* UPB_JSONENCODE_H_ */
13154
13155#ifndef UPB_LEX_ROUND_TRIP_H_
13156#define UPB_LEX_ROUND_TRIP_H_
13157
13158// Must be last.
13159
13160// Encodes a float or double that is round-trippable, but as short as possible.
13161// These routines are not fully optimal (not guaranteed to be shortest), but are
13162// short-ish and match the implementation that has been used in protobuf since
13163// the beginning.
13164
13165// The given buffer size must be at least kUpb_RoundTripBufferSize.
13166enum { kUpb_RoundTripBufferSize = 32 };
13167
13168#ifdef __cplusplus
13169extern "C" {
13170#endif
13171
13172void _upb_EncodeRoundTripDouble(double val, char* buf, size_t size);
13173void _upb_EncodeRoundTripFloat(float val, char* buf, size_t size);
13174
13175#ifdef __cplusplus
13176} /* extern "C" */
13177#endif
13178
13179
13180#endif /* UPB_LEX_ROUND_TRIP_H_ */
13181
13182#ifndef UPB_PORT_VSNPRINTF_COMPAT_H_
13183#define UPB_PORT_VSNPRINTF_COMPAT_H_
13184
13185// Must be last.
13186
13187UPB_INLINE int _upb_vsnprintf(char* buf, size_t size, const char* fmt,
13188 va_list ap) {
13189#if defined(__MINGW64__) || defined(__MINGW32__) || defined(_MSC_VER)
13190 // The msvc runtime has a non-conforming vsnprintf() that requires the
13191 // following compatibility code to become conformant.
13192 int n = -1;
13193 if (size != 0) n = _vsnprintf_s(buf, size, _TRUNCATE, fmt, ap);
13194 if (n == -1) n = _vscprintf(fmt, ap);
13195 return n;
13196#else
13197 return vsnprintf(buf, size, fmt, ap);
13198#endif
13199}
13200
13201
13202#endif // UPB_PORT_VSNPRINTF_COMPAT_H_
13203
Eric Salodfb71552023-03-22 12:35:09 -070013204#ifndef UPB_PORT_ATOMIC_H_
13205#define UPB_PORT_ATOMIC_H_
13206
13207
13208#ifdef UPB_USE_C11_ATOMICS
13209
Protobuf Team Bot743bf922023-09-14 01:12:11 +000013210// IWYU pragma: begin_exports
Eric Salodfb71552023-03-22 12:35:09 -070013211#include <stdatomic.h>
13212#include <stdbool.h>
Protobuf Team Bot743bf922023-09-14 01:12:11 +000013213// IWYU pragma: end_exports
Eric Salodfb71552023-03-22 12:35:09 -070013214
Deanna Garciac7d979d2023-04-14 17:22:13 -070013215#define upb_Atomic_Init(addr, val) atomic_init(addr, val)
13216#define upb_Atomic_Load(addr, order) atomic_load_explicit(addr, order)
13217#define upb_Atomic_Store(addr, val, order) \
13218 atomic_store_explicit(addr, val, order)
13219#define upb_Atomic_Add(addr, val, order) \
13220 atomic_fetch_add_explicit(addr, val, order)
13221#define upb_Atomic_Sub(addr, val, order) \
Deanna Garciabd6a0cf2023-04-20 10:30:44 -070013222 atomic_fetch_sub_explicit(addr, val, order)
13223#define upb_Atomic_Exchange(addr, val, order) \
13224 atomic_exchange_explicit(addr, val, order)
Deanna Garciac7d979d2023-04-14 17:22:13 -070013225#define upb_Atomic_CompareExchangeStrong(addr, expected, desired, \
13226 success_order, failure_order) \
13227 atomic_compare_exchange_strong_explicit(addr, expected, desired, \
13228 success_order, failure_order)
13229#define upb_Atomic_CompareExchangeWeak(addr, expected, desired, success_order, \
13230 failure_order) \
13231 atomic_compare_exchange_weak_explicit(addr, expected, desired, \
13232 success_order, failure_order)
Eric Salodfb71552023-03-22 12:35:09 -070013233
13234#else // !UPB_USE_C11_ATOMICS
13235
Deanna Garciac7d979d2023-04-14 17:22:13 -070013236#include <string.h>
Eric Salodfb71552023-03-22 12:35:09 -070013237
Deanna Garciac7d979d2023-04-14 17:22:13 -070013238#define upb_Atomic_Init(addr, val) (*addr = val)
13239#define upb_Atomic_Load(addr, order) (*addr)
13240#define upb_Atomic_Store(addr, val, order) (*(addr) = val)
13241#define upb_Atomic_Add(addr, val, order) (*(addr) += val)
13242#define upb_Atomic_Sub(addr, val, order) (*(addr) -= val)
Eric Salodfb71552023-03-22 12:35:09 -070013243
Deanna Garciabd6a0cf2023-04-20 10:30:44 -070013244UPB_INLINE void* _upb_NonAtomic_Exchange(void* addr, void* value) {
13245 void* old;
13246 memcpy(&old, addr, sizeof(value));
13247 memcpy(addr, &value, sizeof(value));
13248 return old;
13249}
13250
13251#define upb_Atomic_Exchange(addr, val, order) _upb_NonAtomic_Exchange(addr, val)
13252
Deanna Garciac7d979d2023-04-14 17:22:13 -070013253// `addr` and `expected` are logically double pointers.
13254UPB_INLINE bool _upb_NonAtomic_CompareExchangeStrongP(void* addr,
13255 void* expected,
13256 void* desired) {
13257 if (memcmp(addr, expected, sizeof(desired)) == 0) {
13258 memcpy(addr, &desired, sizeof(desired));
Eric Salodfb71552023-03-22 12:35:09 -070013259 return true;
13260 } else {
Deanna Garciac7d979d2023-04-14 17:22:13 -070013261 memcpy(expected, addr, sizeof(desired));
Eric Salodfb71552023-03-22 12:35:09 -070013262 return false;
13263 }
13264}
13265
Deanna Garciac7d979d2023-04-14 17:22:13 -070013266#define upb_Atomic_CompareExchangeStrong(addr, expected, desired, \
13267 success_order, failure_order) \
13268 _upb_NonAtomic_CompareExchangeStrongP((void*)addr, (void*)expected, \
13269 (void*)desired)
13270#define upb_Atomic_CompareExchangeWeak(addr, expected, desired, success_order, \
13271 failure_order) \
13272 upb_Atomic_CompareExchangeStrong(addr, expected, desired, 0, 0)
13273
Eric Salodfb71552023-03-22 12:35:09 -070013274#endif
13275
13276
13277#endif // UPB_PORT_ATOMIC_H_
13278
Protobuf Team Bot95d7dc02023-12-13 04:09:17 +000013279#ifndef UPB_MESSAGE_COMPAT_H_
13280#define UPB_MESSAGE_COMPAT_H_
13281
13282#include <stdint.h>
13283
13284
13285// Must be last.
13286
13287// upb does not support mixing minitables from different sources but these
13288// functions are still used by some existing users so for now we make them
13289// available here. This may or may not change in the future so do not add
13290// them to new code.
13291
13292#ifdef __cplusplus
13293extern "C" {
13294#endif
13295
Protobuf Team Bot64441a22024-01-23 23:46:32 +000013296const upb_MiniTableExtension* upb_Message_ExtensionByIndex(
13297 const upb_Message* msg, size_t index);
Protobuf Team Botf2845222023-12-19 04:57:32 +000013298
Protobuf Team Botc13512a2024-01-25 18:53:49 +000013299// Returns the minitable with the given field number, or NULL on failure.
13300const upb_MiniTableExtension* upb_Message_FindExtensionByNumber(
13301 const upb_Message* msg, uint32_t field_number);
Protobuf Team Bot95d7dc02023-12-13 04:09:17 +000013302
13303#ifdef __cplusplus
13304} /* extern "C" */
13305#endif
13306
13307
13308#endif /* UPB_MESSAGE_COMPAT_H_ */
13309
Protobuf Team Bot376ba2f2023-09-29 22:17:43 +000013310// EVERYTHING BELOW THIS LINE IS INTERNAL - DO NOT USE /////////////////////////
13311
Protobuf Team Bot5b343372023-12-19 06:18:53 +000013312#ifndef UPB_MESSAGE_INTERNAL_MAP_SORTER_H_
13313#define UPB_MESSAGE_INTERNAL_MAP_SORTER_H_
Protobuf Team Bot376ba2f2023-09-29 22:17:43 +000013314
13315#include <stdlib.h>
13316
13317
Protobuf Team Botc12c96e2024-01-16 07:41:08 +000013318#ifndef UPB_MESSAGE_INTERNAL_MAP_ENTRY_H_
13319#define UPB_MESSAGE_INTERNAL_MAP_ENTRY_H_
Protobuf Team Bot5b343372023-12-19 06:18:53 +000013320
13321#include <stdint.h>
Protobuf Team Bot376ba2f2023-09-29 22:17:43 +000013322
13323
13324// Map entries aren't actually stored for map fields, they are only used during
Protobuf Team Bot03440ec2024-01-11 23:13:19 +000013325// parsing. (It helps a lot if all map entry messages have the same layout.)
13326// The mini_table layout code will ensure that all map entries have this layout.
Protobuf Team Bot376ba2f2023-09-29 22:17:43 +000013327//
13328// Note that users can and do create map entries directly, which will also use
13329// this layout.
Protobuf Team Bot03440ec2024-01-11 23:13:19 +000013330
Protobuf Team Bot376ba2f2023-09-29 22:17:43 +000013331typedef struct {
Protobuf Team Bot03440ec2024-01-11 23:13:19 +000013332 struct upb_Message message;
Protobuf Team Bot376ba2f2023-09-29 22:17:43 +000013333 // We only need 2 hasbits max, but due to alignment we'll use 8 bytes here,
13334 // and the uint64_t helps make this clear.
13335 uint64_t hasbits;
13336 union {
13337 upb_StringView str; // For str/bytes.
13338 upb_value val; // For all other types.
Protobuf Team Bot03440ec2024-01-11 23:13:19 +000013339 double d[2]; // Padding for 32-bit builds.
Protobuf Team Bot376ba2f2023-09-29 22:17:43 +000013340 } k;
13341 union {
13342 upb_StringView str; // For str/bytes.
13343 upb_value val; // For all other types.
Protobuf Team Bot03440ec2024-01-11 23:13:19 +000013344 double d[2]; // Padding for 32-bit builds.
Protobuf Team Bot376ba2f2023-09-29 22:17:43 +000013345 } v;
Protobuf Team Bot376ba2f2023-09-29 22:17:43 +000013346} upb_MapEntry;
13347
Protobuf Team Botc12c96e2024-01-16 07:41:08 +000013348#endif // UPB_MESSAGE_INTERNAL_MAP_ENTRY_H_
Protobuf Team Bot376ba2f2023-09-29 22:17:43 +000013349
13350// Must be last.
13351
13352#ifdef __cplusplus
13353extern "C" {
13354#endif
13355
13356// _upb_mapsorter sorts maps and provides ordered iteration over the entries.
13357// Since maps can be recursive (map values can be messages which contain other
13358// maps), _upb_mapsorter can contain a stack of maps.
13359
13360typedef struct {
13361 void const** entries;
13362 int size;
13363 int cap;
13364} _upb_mapsorter;
13365
13366typedef struct {
13367 int start;
13368 int pos;
13369 int end;
13370} _upb_sortedmap;
13371
13372UPB_INLINE void _upb_mapsorter_init(_upb_mapsorter* s) {
13373 s->entries = NULL;
13374 s->size = 0;
13375 s->cap = 0;
13376}
13377
13378UPB_INLINE void _upb_mapsorter_destroy(_upb_mapsorter* s) {
Protobuf Team Botddc54062023-12-12 20:03:38 +000013379 if (s->entries) upb_gfree(s->entries);
Protobuf Team Bot376ba2f2023-09-29 22:17:43 +000013380}
13381
Protobuf Team Bot499c7482023-12-30 01:42:17 +000013382UPB_INLINE bool _upb_sortedmap_next(_upb_mapsorter* s,
13383 const struct upb_Map* map,
Protobuf Team Bot376ba2f2023-09-29 22:17:43 +000013384 _upb_sortedmap* sorted, upb_MapEntry* ent) {
13385 if (sorted->pos == sorted->end) return false;
13386 const upb_tabent* tabent = (const upb_tabent*)s->entries[sorted->pos++];
13387 upb_StringView key = upb_tabstrview(tabent->key);
Protobuf Team Bot03440ec2024-01-11 23:13:19 +000013388 _upb_map_fromkey(key, &ent->k, map->key_size);
Protobuf Team Bot376ba2f2023-09-29 22:17:43 +000013389 upb_value val = {tabent->val.val};
Protobuf Team Bot03440ec2024-01-11 23:13:19 +000013390 _upb_map_fromvalue(val, &ent->v, map->val_size);
Protobuf Team Bot376ba2f2023-09-29 22:17:43 +000013391 return true;
13392}
13393
13394UPB_INLINE bool _upb_sortedmap_nextext(_upb_mapsorter* s,
13395 _upb_sortedmap* sorted,
Protobuf Team Botc13512a2024-01-25 18:53:49 +000013396 const upb_Extension** ext) {
Protobuf Team Bot376ba2f2023-09-29 22:17:43 +000013397 if (sorted->pos == sorted->end) return false;
Protobuf Team Botc13512a2024-01-25 18:53:49 +000013398 *ext = (const upb_Extension*)s->entries[sorted->pos++];
Protobuf Team Bot376ba2f2023-09-29 22:17:43 +000013399 return true;
13400}
13401
13402UPB_INLINE void _upb_mapsorter_popmap(_upb_mapsorter* s,
13403 _upb_sortedmap* sorted) {
13404 s->size = sorted->start;
13405}
13406
13407bool _upb_mapsorter_pushmap(_upb_mapsorter* s, upb_FieldType key_type,
Protobuf Team Bot499c7482023-12-30 01:42:17 +000013408 const struct upb_Map* map, _upb_sortedmap* sorted);
Protobuf Team Bot376ba2f2023-09-29 22:17:43 +000013409
Protobuf Team Botc13512a2024-01-25 18:53:49 +000013410bool _upb_mapsorter_pushexts(_upb_mapsorter* s, const upb_Extension* exts,
13411 size_t count, _upb_sortedmap* sorted);
Protobuf Team Bot376ba2f2023-09-29 22:17:43 +000013412
13413#ifdef __cplusplus
13414} /* extern "C" */
13415#endif
13416
13417
Protobuf Team Bot5b343372023-12-19 06:18:53 +000013418#endif /* UPB_MESSAGE_INTERNAL_MAP_SORTER_H_ */
Protobuf Team Bot376ba2f2023-09-29 22:17:43 +000013419
Protobuf Team Botcb8a31e2024-01-02 02:33:01 +000013420#ifndef UPB_BASE_INTERNAL_LOG2_H_
13421#define UPB_BASE_INTERNAL_LOG2_H_
13422
13423// Must be last.
13424
13425#ifdef __cplusplus
13426extern "C" {
13427#endif
13428
13429UPB_INLINE int upb_Log2Ceiling(int x) {
13430 if (x <= 1) return 0;
13431#ifdef __GNUC__
13432 return 32 - __builtin_clz(x - 1);
13433#else
13434 int lg2 = 0;
13435 while ((1 << lg2) < x) lg2++;
13436 return lg2;
13437#endif
13438}
13439
13440UPB_INLINE int upb_Log2CeilingSize(int x) { return 1 << upb_Log2Ceiling(x); }
13441
13442#ifdef __cplusplus
13443} /* extern "C" */
13444#endif
13445
13446
13447#endif /* UPB_BASE_INTERNAL_LOG2_H_ */
13448
Protobuf Team Bot80b5fe42023-12-27 20:08:36 +000013449#ifndef UPB_MESSAGE_COMPARE_H_
13450#define UPB_MESSAGE_COMPARE_H_
13451
Protobuf Team Bote3dcdfd2024-02-09 21:49:54 +000013452#include <stddef.h>
13453
Protobuf Team Bot80b5fe42023-12-27 20:08:36 +000013454
13455// Must be last.
13456
Protobuf Team Bota8543e82024-04-06 01:56:37 +000013457enum {
13458 // If set, upb_Message_IsEqual() will attempt to compare unknown fields.
13459 // By its very nature this comparison is inexact.
13460 kUpb_CompareOption_IncludeUnknownFields = (1 << 0)
13461};
13462
Protobuf Team Bot80b5fe42023-12-27 20:08:36 +000013463#ifdef __cplusplus
13464extern "C" {
13465#endif
13466
Protobuf Team Bote3dcdfd2024-02-09 21:49:54 +000013467// Returns true if no known fields or extensions are set in the message.
13468UPB_API bool upb_Message_IsEmpty(const upb_Message* msg,
13469 const upb_MiniTable* m);
13470
13471UPB_API bool upb_Message_IsEqual(const upb_Message* msg1,
13472 const upb_Message* msg2,
Protobuf Team Botdb9cc392024-03-11 17:27:18 +000013473 const upb_MiniTable* m, int options);
Protobuf Team Bote3dcdfd2024-02-09 21:49:54 +000013474
Protobuf Team Bote3dcdfd2024-02-09 21:49:54 +000013475// If |ctype| is a message then |m| must point to its minitable.
Protobuf Team Botc13512a2024-01-25 18:53:49 +000013476UPB_API_INLINE bool upb_MessageValue_IsEqual(upb_MessageValue val1,
13477 upb_MessageValue val2,
Protobuf Team Bote3dcdfd2024-02-09 21:49:54 +000013478 upb_CType ctype,
Protobuf Team Botdb9cc392024-03-11 17:27:18 +000013479 const upb_MiniTable* m,
13480 int options) {
Protobuf Team Botc13512a2024-01-25 18:53:49 +000013481 switch (ctype) {
13482 case kUpb_CType_Bool:
13483 return val1.bool_val == val2.bool_val;
13484
13485 case kUpb_CType_Float:
13486 case kUpb_CType_Int32:
13487 case kUpb_CType_UInt32:
13488 case kUpb_CType_Enum:
13489 return val1.int32_val == val2.int32_val;
13490
13491 case kUpb_CType_Double:
13492 case kUpb_CType_Int64:
13493 case kUpb_CType_UInt64:
13494 return val1.int64_val == val2.int64_val;
13495
13496 case kUpb_CType_String:
13497 case kUpb_CType_Bytes:
13498 return upb_StringView_IsEqual(val1.str_val, val2.str_val);
13499
Protobuf Team Bote3dcdfd2024-02-09 21:49:54 +000013500 case kUpb_CType_Message:
Protobuf Team Botdb9cc392024-03-11 17:27:18 +000013501 return upb_Message_IsEqual(val1.msg_val, val2.msg_val, m, options);
Protobuf Team Bote3dcdfd2024-02-09 21:49:54 +000013502
13503 default:
13504 UPB_UNREACHABLE();
Protobuf Team Botc13512a2024-01-25 18:53:49 +000013505 return false;
13506 }
13507}
13508
Protobuf Team Bot80b5fe42023-12-27 20:08:36 +000013509#ifdef __cplusplus
13510} /* extern "C" */
13511#endif
13512
13513
13514#endif // UPB_MESSAGE_COMPARE_H_
13515
Protobuf Team Bote3dcdfd2024-02-09 21:49:54 +000013516#ifndef UPB_MESSAGE_INTERNAL_COMPARE_UNKNOWN_H_
13517#define UPB_MESSAGE_INTERNAL_COMPARE_UNKNOWN_H_
13518
13519#include <stddef.h>
13520
13521// Must be last.
13522
13523#ifdef __cplusplus
13524extern "C" {
13525#endif
13526
13527// Returns true if unknown fields from the two messages are equal when sorted
13528// and varints are made canonical.
13529//
13530// This function is discouraged, as the comparison is inherently lossy without
13531// schema data:
13532//
13533// 1. We don't know whether delimited fields are sub-messages. Unknown
13534// sub-messages will therefore not have their fields sorted and varints
13535// canonicalized.
13536// 2. We don't know about oneof/non-repeated fields, which should semantically
13537// discard every value except the last.
13538
13539typedef enum {
13540 kUpb_UnknownCompareResult_Equal = 0,
13541 kUpb_UnknownCompareResult_NotEqual = 1,
13542 kUpb_UnknownCompareResult_OutOfMemory = 2,
13543 kUpb_UnknownCompareResult_MaxDepthExceeded = 3,
13544} upb_UnknownCompareResult;
13545
13546upb_UnknownCompareResult UPB_PRIVATE(_upb_Message_UnknownFieldsAreEqual)(
13547 const char* buf1, size_t size1, const char* buf2, size_t size2,
13548 int max_depth);
13549
13550#ifdef __cplusplus
13551} /* extern "C" */
13552#endif
13553
13554
13555#endif /* UPB_MESSAGE_INTERNAL_COMPARE_UNKNOWN_H_ */
13556
Protobuf Team Bot80b5fe42023-12-27 20:08:36 +000013557#ifndef UPB_MESSAGE_COPY_H_
13558#define UPB_MESSAGE_COPY_H_
13559
13560
13561// Must be last.
13562
13563#ifdef __cplusplus
13564extern "C" {
13565#endif
13566
13567// Deep clones a message using the provided target arena.
13568upb_Message* upb_Message_DeepClone(const upb_Message* msg,
13569 const upb_MiniTable* m, upb_Arena* arena);
13570
13571// Shallow clones a message using the provided target arena.
13572upb_Message* upb_Message_ShallowClone(const upb_Message* msg,
13573 const upb_MiniTable* m, upb_Arena* arena);
13574
13575// Deep clones array contents.
13576upb_Array* upb_Array_DeepClone(const upb_Array* array, upb_CType value_type,
13577 const upb_MiniTable* sub, upb_Arena* arena);
13578
13579// Deep clones map contents.
13580upb_Map* upb_Map_DeepClone(const upb_Map* map, upb_CType key_type,
13581 upb_CType value_type,
13582 const upb_MiniTable* map_entry_table,
13583 upb_Arena* arena);
13584
13585// Deep copies the message from src to dst.
13586bool upb_Message_DeepCopy(upb_Message* dst, const upb_Message* src,
13587 const upb_MiniTable* m, upb_Arena* arena);
13588
13589// Shallow copies the message from src to dst.
13590void upb_Message_ShallowCopy(upb_Message* dst, const upb_Message* src,
13591 const upb_MiniTable* m);
13592
13593#ifdef __cplusplus
13594} /* extern "C" */
13595#endif
13596
13597
13598#endif // UPB_MESSAGE_COPY_H_
13599
Adam Cozzette8059da22023-08-16 07:57:14 -070013600#ifndef UPB_MINI_DESCRIPTOR_INTERNAL_BASE92_H_
13601#define UPB_MINI_DESCRIPTOR_INTERNAL_BASE92_H_
13602
Adam Cozzette7d5592e2023-08-23 12:15:26 -070013603#include <stdint.h>
13604
Adam Cozzette8059da22023-08-16 07:57:14 -070013605
13606// Must be last.
13607
13608#ifdef __cplusplus
13609extern "C" {
13610#endif
13611
13612UPB_INLINE char _upb_ToBase92(int8_t ch) {
13613 extern const char _kUpb_ToBase92[];
13614 UPB_ASSERT(0 <= ch && ch < 92);
13615 return _kUpb_ToBase92[ch];
13616}
13617
13618UPB_INLINE char _upb_FromBase92(uint8_t ch) {
13619 extern const int8_t _kUpb_FromBase92[];
13620 if (' ' > ch || ch > '~') return -1;
13621 return _kUpb_FromBase92[ch - ' '];
13622}
13623
13624UPB_INLINE const char* _upb_Base92_DecodeVarint(const char* ptr,
13625 const char* end, char first_ch,
13626 uint8_t min, uint8_t max,
13627 uint32_t* out_val) {
13628 uint32_t val = 0;
13629 uint32_t shift = 0;
13630 const int bits_per_char =
13631 upb_Log2Ceiling(_upb_FromBase92(max) - _upb_FromBase92(min));
13632 char ch = first_ch;
13633 while (1) {
13634 uint32_t bits = _upb_FromBase92(ch) - _upb_FromBase92(min);
13635 val |= bits << shift;
13636 if (ptr == end || *ptr < min || max < *ptr) {
13637 *out_val = val;
13638 UPB_ASSUME(ptr != NULL);
13639 return ptr;
13640 }
13641 ch = *ptr++;
13642 shift += bits_per_char;
13643 if (shift >= 32) return NULL;
13644 }
13645}
13646
13647#ifdef __cplusplus
13648} /* extern "C" */
13649#endif
13650
13651
13652#endif // UPB_MINI_DESCRIPTOR_INTERNAL_BASE92_H_
13653
Protobuf Team Bot91cfce92023-11-27 21:05:28 +000013654#ifndef UPB_MINI_DESCRIPTOR_INTERNAL_DECODER_H_
13655#define UPB_MINI_DESCRIPTOR_INTERNAL_DECODER_H_
13656
13657
Adam Cozzette8059da22023-08-16 07:57:14 -070013658// Must be last.
13659
13660// upb_MdDecoder: used internally for decoding MiniDescriptors for messages,
13661// extensions, and enums.
13662typedef struct {
13663 const char* end;
13664 upb_Status* status;
13665 jmp_buf err;
13666} upb_MdDecoder;
13667
13668UPB_PRINTF(2, 3)
13669UPB_NORETURN UPB_INLINE void upb_MdDecoder_ErrorJmp(upb_MdDecoder* d,
13670 const char* fmt, ...) {
13671 if (d->status) {
13672 va_list argp;
13673 upb_Status_SetErrorMessage(d->status, "Error building mini table: ");
13674 va_start(argp, fmt);
13675 upb_Status_VAppendErrorFormat(d->status, fmt, argp);
13676 va_end(argp);
13677 }
13678 UPB_LONGJMP(d->err, 1);
13679}
13680
13681UPB_INLINE void upb_MdDecoder_CheckOutOfMemory(upb_MdDecoder* d,
13682 const void* ptr) {
13683 if (!ptr) upb_MdDecoder_ErrorJmp(d, "Out of memory");
13684}
13685
13686UPB_INLINE const char* upb_MdDecoder_DecodeBase92Varint(
13687 upb_MdDecoder* d, const char* ptr, char first_ch, uint8_t min, uint8_t max,
13688 uint32_t* out_val) {
13689 ptr = _upb_Base92_DecodeVarint(ptr, d->end, first_ch, min, max, out_val);
13690 if (!ptr) upb_MdDecoder_ErrorJmp(d, "Overlong varint");
13691 return ptr;
13692}
13693
13694
13695#endif // UPB_MINI_DESCRIPTOR_INTERNAL_DECODER_H_
13696
13697#ifndef UPB_MINI_DESCRIPTOR_INTERNAL_WIRE_CONSTANTS_H_
13698#define UPB_MINI_DESCRIPTOR_INTERNAL_WIRE_CONSTANTS_H_
13699
13700
13701// Must be last.
13702
13703typedef enum {
13704 kUpb_EncodedType_Double = 0,
13705 kUpb_EncodedType_Float = 1,
13706 kUpb_EncodedType_Fixed32 = 2,
13707 kUpb_EncodedType_Fixed64 = 3,
13708 kUpb_EncodedType_SFixed32 = 4,
13709 kUpb_EncodedType_SFixed64 = 5,
13710 kUpb_EncodedType_Int32 = 6,
13711 kUpb_EncodedType_UInt32 = 7,
13712 kUpb_EncodedType_SInt32 = 8,
13713 kUpb_EncodedType_Int64 = 9,
13714 kUpb_EncodedType_UInt64 = 10,
13715 kUpb_EncodedType_SInt64 = 11,
13716 kUpb_EncodedType_OpenEnum = 12,
13717 kUpb_EncodedType_Bool = 13,
13718 kUpb_EncodedType_Bytes = 14,
13719 kUpb_EncodedType_String = 15,
13720 kUpb_EncodedType_Group = 16,
13721 kUpb_EncodedType_Message = 17,
13722 kUpb_EncodedType_ClosedEnum = 18,
13723
13724 kUpb_EncodedType_RepeatedBase = 20,
13725} upb_EncodedType;
13726
13727typedef enum {
13728 kUpb_EncodedFieldModifier_FlipPacked = 1 << 0,
13729 kUpb_EncodedFieldModifier_IsRequired = 1 << 1,
13730 kUpb_EncodedFieldModifier_IsProto3Singular = 1 << 2,
Protobuf Team Botb58bd402023-09-19 15:42:34 +000013731 kUpb_EncodedFieldModifier_FlipValidateUtf8 = 1 << 3,
Adam Cozzette8059da22023-08-16 07:57:14 -070013732} upb_EncodedFieldModifier;
13733
13734enum {
13735 kUpb_EncodedValue_MinField = ' ',
13736 kUpb_EncodedValue_MaxField = 'I',
13737 kUpb_EncodedValue_MinModifier = 'L',
13738 kUpb_EncodedValue_MaxModifier = '[',
13739 kUpb_EncodedValue_End = '^',
13740 kUpb_EncodedValue_MinSkip = '_',
13741 kUpb_EncodedValue_MaxSkip = '~',
13742 kUpb_EncodedValue_OneofSeparator = '~',
13743 kUpb_EncodedValue_FieldSeparator = '|',
13744 kUpb_EncodedValue_MinOneofField = ' ',
13745 kUpb_EncodedValue_MaxOneofField = 'b',
13746 kUpb_EncodedValue_MaxEnumMask = 'A',
13747};
13748
13749enum {
13750 kUpb_EncodedVersion_EnumV1 = '!',
13751 kUpb_EncodedVersion_ExtensionV1 = '#',
13752 kUpb_EncodedVersion_MapV1 = '%',
13753 kUpb_EncodedVersion_MessageV1 = '$',
13754 kUpb_EncodedVersion_MessageSetV1 = '&',
13755};
13756
13757
13758#endif // UPB_MINI_DESCRIPTOR_INTERNAL_WIRE_CONSTANTS_H_
13759
13760#ifndef UPB_MINI_DESCRIPTOR_INTERNAL_MODIFIERS_H_
13761#define UPB_MINI_DESCRIPTOR_INTERNAL_MODIFIERS_H_
13762
13763// Must be last.
13764
13765typedef enum {
13766 kUpb_FieldModifier_IsRepeated = 1 << 0,
13767 kUpb_FieldModifier_IsPacked = 1 << 1,
13768 kUpb_FieldModifier_IsClosedEnum = 1 << 2,
13769 kUpb_FieldModifier_IsProto3Singular = 1 << 3,
13770 kUpb_FieldModifier_IsRequired = 1 << 4,
Protobuf Team Botb58bd402023-09-19 15:42:34 +000013771 kUpb_FieldModifier_ValidateUtf8 = 1 << 5,
Adam Cozzette8059da22023-08-16 07:57:14 -070013772} kUpb_FieldModifier;
13773
Protobuf Team Botb58bd402023-09-19 15:42:34 +000013774// These modifiers are also used on the wire.
Adam Cozzette8059da22023-08-16 07:57:14 -070013775typedef enum {
13776 kUpb_MessageModifier_ValidateUtf8 = 1 << 0,
13777 kUpb_MessageModifier_DefaultIsPacked = 1 << 1,
13778 kUpb_MessageModifier_IsExtendable = 1 << 2,
13779} kUpb_MessageModifier;
13780
13781
13782#endif // UPB_MINI_DESCRIPTOR_INTERNAL_MODIFIERS_H_
13783
Protobuf Team Botc4a7b032023-12-27 00:12:48 +000013784#ifndef UPB_MINI_TABLE_COMPAT_H_
13785#define UPB_MINI_TABLE_COMPAT_H_
13786
13787
13788// Must be last.
13789
13790// upb does not support mixing minitables from different sources but these
13791// functions are still used by some existing users so for now we make them
13792// available here. This may or may not change in the future so do not add
13793// them to new code.
13794
13795#ifdef __cplusplus
13796extern "C" {
13797#endif
13798
13799// Checks if memory layout of src is compatible with dst.
13800bool upb_MiniTable_Compatible(const upb_MiniTable* src,
13801 const upb_MiniTable* dst);
13802
13803typedef enum {
13804 kUpb_MiniTableEquals_NotEqual,
13805 kUpb_MiniTableEquals_Equal,
13806 kUpb_MiniTableEquals_OutOfMemory,
13807} upb_MiniTableEquals_Status;
13808
13809// Checks equality of mini tables originating from different language runtimes.
13810upb_MiniTableEquals_Status upb_MiniTable_Equals(const upb_MiniTable* src,
13811 const upb_MiniTable* dst);
13812
13813#ifdef __cplusplus
13814} /* extern "C" */
13815#endif
13816
13817
13818#endif /* UPB_MINI_TABLE_COMPAT_H_ */
13819
Protobuf Team Botcb8a31e2024-01-02 02:33:01 +000013820#ifndef UPB_HASH_INT_TABLE_H_
13821#define UPB_HASH_INT_TABLE_H_
13822
13823
13824// Must be last.
13825
13826typedef struct {
13827 upb_table t; // For entries that don't fit in the array part.
13828 const upb_tabval* array; // Array part of the table. See const note above.
13829 size_t array_size; // Array part size.
13830 size_t array_count; // Array part number of elements.
13831} upb_inttable;
13832
13833#ifdef __cplusplus
13834extern "C" {
13835#endif
13836
13837// Initialize a table. If memory allocation failed, false is returned and
13838// the table is uninitialized.
13839bool upb_inttable_init(upb_inttable* table, upb_Arena* a);
13840
13841// Returns the number of values in the table.
13842size_t upb_inttable_count(const upb_inttable* t);
13843
13844// Inserts the given key into the hashtable with the given value.
13845// The key must not already exist in the hash table.
13846// The value must not be UINTPTR_MAX.
13847//
13848// If a table resize was required but memory allocation failed, false is
13849// returned and the table is unchanged.
13850bool upb_inttable_insert(upb_inttable* t, uintptr_t key, upb_value val,
13851 upb_Arena* a);
13852
13853// Looks up key in this table, returning "true" if the key was found.
13854// If v is non-NULL, copies the value for this key into *v.
13855bool upb_inttable_lookup(const upb_inttable* t, uintptr_t key, upb_value* v);
13856
13857// Removes an item from the table. Returns true if the remove was successful,
13858// and stores the removed item in *val if non-NULL.
13859bool upb_inttable_remove(upb_inttable* t, uintptr_t key, upb_value* val);
13860
13861// Updates an existing entry in an inttable.
13862// If the entry does not exist, returns false and does nothing.
13863// Unlike insert/remove, this does not invalidate iterators.
13864bool upb_inttable_replace(upb_inttable* t, uintptr_t key, upb_value val);
13865
13866// Optimizes the table for the current set of entries, for both memory use and
13867// lookup time. Client should call this after all entries have been inserted;
13868// inserting more entries is legal, but will likely require a table resize.
13869void upb_inttable_compact(upb_inttable* t, upb_Arena* a);
13870
13871// Iteration over inttable:
13872//
13873// intptr_t iter = UPB_INTTABLE_BEGIN;
13874// uintptr_t key;
13875// upb_value val;
13876// while (upb_inttable_next(t, &key, &val, &iter)) {
13877// // ...
13878// }
13879
13880#define UPB_INTTABLE_BEGIN -1
13881
13882bool upb_inttable_next(const upb_inttable* t, uintptr_t* key, upb_value* val,
13883 intptr_t* iter);
13884void upb_inttable_removeiter(upb_inttable* t, intptr_t* iter);
13885
13886#ifdef __cplusplus
13887} /* extern "C" */
13888#endif
13889
13890
13891#endif /* UPB_HASH_INT_TABLE_H_ */
13892
13893#ifndef UPB_WIRE_INTERNAL_CONSTANTS_H_
13894#define UPB_WIRE_INTERNAL_CONSTANTS_H_
13895
13896#define kUpb_WireFormat_DefaultDepthLimit 100
13897
13898// MessageSet wire format is:
13899// message MessageSet {
13900// repeated group Item = 1 {
13901// required int32 type_id = 2;
13902// required bytes message = 3;
13903// }
13904// }
13905
13906enum {
13907 kUpb_MsgSet_Item = 1,
13908 kUpb_MsgSet_TypeId = 2,
13909 kUpb_MsgSet_Message = 3,
13910};
13911
13912#endif /* UPB_WIRE_INTERNAL_CONSTANTS_H_ */
13913
13914/*
13915 * Internal implementation details of the decoder that are shared between
13916 * decode.c and decode_fast.c.
13917 */
13918
13919#ifndef UPB_WIRE_INTERNAL_DECODER_H_
13920#define UPB_WIRE_INTERNAL_DECODER_H_
13921
13922#include "utf8_range.h"
13923
13924// Must be last.
13925
13926#define DECODE_NOGROUP (uint32_t) - 1
13927
13928typedef struct upb_Decoder {
13929 upb_EpsCopyInputStream input;
13930 const upb_ExtensionRegistry* extreg;
13931 const char* unknown; // Start of unknown data, preserve at buffer flip
13932 upb_Message* unknown_msg; // Pointer to preserve data to
13933 int depth; // Tracks recursion depth to bound stack usage.
13934 uint32_t end_group; // field number of END_GROUP tag, else DECODE_NOGROUP.
13935 uint16_t options;
13936 bool missing_required;
13937 union {
13938 upb_Arena arena;
13939 void* foo[UPB_ARENA_SIZE_HACK];
13940 };
13941 upb_DecodeStatus status;
13942 jmp_buf err;
13943
13944#ifndef NDEBUG
13945 const char* debug_tagstart;
13946 const char* debug_valstart;
13947#endif
13948} upb_Decoder;
13949
13950/* Error function that will abort decoding with longjmp(). We can't declare this
13951 * UPB_NORETURN, even though it is appropriate, because if we do then compilers
13952 * will "helpfully" refuse to tailcall to it
13953 * (see: https://stackoverflow.com/a/55657013), which will defeat a major goal
13954 * of our optimizations. That is also why we must declare it in a separate file,
13955 * otherwise the compiler will see that it calls longjmp() and deduce that it is
13956 * noreturn. */
13957const char* _upb_FastDecoder_ErrorJmp(upb_Decoder* d, int status);
13958
13959extern const uint8_t upb_utf8_offsets[];
13960
13961UPB_INLINE
13962bool _upb_Decoder_VerifyUtf8Inline(const char* ptr, int len) {
13963 return utf8_range_IsValid(ptr, len);
13964}
13965
13966const char* _upb_Decoder_CheckRequired(upb_Decoder* d, const char* ptr,
13967 const upb_Message* msg,
13968 const upb_MiniTable* m);
13969
13970/* x86-64 pointers always have the high 16 bits matching. So we can shift
13971 * left 8 and right 8 without loss of information. */
13972UPB_INLINE intptr_t decode_totable(const upb_MiniTable* tablep) {
13973 return ((intptr_t)tablep << 8) | tablep->UPB_PRIVATE(table_mask);
13974}
13975
13976UPB_INLINE const upb_MiniTable* decode_totablep(intptr_t table) {
13977 return (const upb_MiniTable*)(table >> 8);
13978}
13979
13980const char* _upb_Decoder_IsDoneFallback(upb_EpsCopyInputStream* e,
13981 const char* ptr, int overrun);
13982
13983UPB_INLINE bool _upb_Decoder_IsDone(upb_Decoder* d, const char** ptr) {
13984 return upb_EpsCopyInputStream_IsDoneWithCallback(
13985 &d->input, ptr, &_upb_Decoder_IsDoneFallback);
13986}
13987
13988UPB_INLINE const char* _upb_Decoder_BufferFlipCallback(
13989 upb_EpsCopyInputStream* e, const char* old_end, const char* new_start) {
13990 upb_Decoder* d = (upb_Decoder*)e;
13991 if (!old_end) _upb_FastDecoder_ErrorJmp(d, kUpb_DecodeStatus_Malformed);
13992
13993 if (d->unknown) {
13994 if (!UPB_PRIVATE(_upb_Message_AddUnknown)(
13995 d->unknown_msg, d->unknown, old_end - d->unknown, &d->arena)) {
13996 _upb_FastDecoder_ErrorJmp(d, kUpb_DecodeStatus_OutOfMemory);
13997 }
13998 d->unknown = new_start;
13999 }
14000 return new_start;
14001}
14002
14003#if UPB_FASTTABLE
14004UPB_INLINE
14005const char* _upb_FastDecoder_TagDispatch(upb_Decoder* d, const char* ptr,
14006 upb_Message* msg, intptr_t table,
14007 uint64_t hasbits, uint64_t tag) {
14008 const upb_MiniTable* table_p = decode_totablep(table);
14009 uint8_t mask = table;
14010 uint64_t data;
14011 size_t idx = tag & mask;
14012 UPB_ASSUME((idx & 7) == 0);
14013 idx >>= 3;
14014 data = table_p->UPB_PRIVATE(fasttable)[idx].field_data ^ tag;
14015 UPB_MUSTTAIL return table_p->UPB_PRIVATE(fasttable)[idx].field_parser(
14016 d, ptr, msg, table, hasbits, data);
14017}
14018#endif
14019
14020UPB_INLINE uint32_t _upb_FastDecoder_LoadTag(const char* ptr) {
14021 uint16_t tag;
14022 memcpy(&tag, ptr, 2);
14023 return tag;
14024}
14025
14026
14027#endif /* UPB_WIRE_INTERNAL_DECODER_H_ */
14028
Protobuf Team Botcb8a31e2024-01-02 02:33:01 +000014029#ifndef UPB_WIRE_READER_H_
14030#define UPB_WIRE_READER_H_
14031
14032
14033#ifndef UPB_WIRE_INTERNAL_READER_H_
14034#define UPB_WIRE_INTERNAL_READER_H_
14035
14036// Must be last.
14037
14038#define kUpb_WireReader_WireTypeBits 3
14039#define kUpb_WireReader_WireTypeMask 7
14040
14041typedef struct {
14042 const char* ptr;
14043 uint64_t val;
14044} UPB_PRIVATE(_upb_WireReader_LongVarint);
14045
14046#ifdef __cplusplus
14047extern "C" {
14048#endif
14049
14050UPB_PRIVATE(_upb_WireReader_LongVarint)
14051UPB_PRIVATE(_upb_WireReader_ReadLongVarint)(const char* ptr, uint64_t val);
14052
Protobuf Team Bot1d143b52024-01-25 20:29:43 +000014053UPB_FORCEINLINE const char* UPB_PRIVATE(_upb_WireReader_ReadVarint)(
Protobuf Team Botcb8a31e2024-01-02 02:33:01 +000014054 const char* ptr, uint64_t* val, int maxlen, uint64_t maxval) {
14055 uint64_t byte = (uint8_t)*ptr;
14056 if (UPB_LIKELY((byte & 0x80) == 0)) {
14057 *val = (uint32_t)byte;
14058 return ptr + 1;
14059 }
14060 const char* start = ptr;
14061 UPB_PRIVATE(_upb_WireReader_LongVarint)
14062 res = UPB_PRIVATE(_upb_WireReader_ReadLongVarint)(ptr, byte);
14063 if (!res.ptr || (maxlen < 10 && res.ptr - start > maxlen) ||
14064 res.val > maxval) {
14065 return NULL; // Malformed.
14066 }
14067 *val = res.val;
14068 return res.ptr;
14069}
14070
Protobuf Team Botb3878b52024-02-08 21:50:53 +000014071UPB_API_INLINE uint32_t upb_WireReader_GetFieldNumber(uint32_t tag) {
Protobuf Team Botcb8a31e2024-01-02 02:33:01 +000014072 return tag >> kUpb_WireReader_WireTypeBits;
14073}
14074
Protobuf Team Botb3878b52024-02-08 21:50:53 +000014075UPB_API_INLINE uint8_t upb_WireReader_GetWireType(uint32_t tag) {
Protobuf Team Botcb8a31e2024-01-02 02:33:01 +000014076 return tag & kUpb_WireReader_WireTypeMask;
14077}
14078
14079#ifdef __cplusplus
14080} /* extern "C" */
14081#endif
14082
14083
14084#endif // UPB_WIRE_INTERNAL_READER_H_
14085
14086#ifndef UPB_WIRE_TYPES_H_
14087#define UPB_WIRE_TYPES_H_
14088
14089// A list of types as they are encoded on the wire.
14090typedef enum {
14091 kUpb_WireType_Varint = 0,
14092 kUpb_WireType_64Bit = 1,
14093 kUpb_WireType_Delimited = 2,
14094 kUpb_WireType_StartGroup = 3,
14095 kUpb_WireType_EndGroup = 4,
14096 kUpb_WireType_32Bit = 5
14097} upb_WireType;
14098
14099#endif /* UPB_WIRE_TYPES_H_ */
14100
14101// Must be last.
14102
14103// The upb_WireReader interface is suitable for general-purpose parsing of
14104// protobuf binary wire format. It is designed to be used along with
14105// upb_EpsCopyInputStream for buffering, and all parsing routines in this file
14106// assume that at least kUpb_EpsCopyInputStream_SlopBytes worth of data is
14107// available to read without any bounds checks.
14108
14109#ifdef __cplusplus
14110extern "C" {
14111#endif
14112
14113// Parses a tag into `tag`, and returns a pointer past the end of the tag, or
14114// NULL if there was an error in the tag data.
14115//
14116// REQUIRES: there must be at least 10 bytes of data available at `ptr`.
14117// Bounds checks must be performed before calling this function, preferably
14118// by calling upb_EpsCopyInputStream_IsDone().
Protobuf Team Bot1d143b52024-01-25 20:29:43 +000014119UPB_FORCEINLINE const char* upb_WireReader_ReadTag(const char* ptr,
14120 uint32_t* tag) {
Protobuf Team Botcb8a31e2024-01-02 02:33:01 +000014121 uint64_t val;
14122 ptr = UPB_PRIVATE(_upb_WireReader_ReadVarint)(ptr, &val, 5, UINT32_MAX);
14123 if (!ptr) return NULL;
14124 *tag = val;
14125 return ptr;
14126}
14127
14128// Given a tag, returns the field number.
Protobuf Team Botb3878b52024-02-08 21:50:53 +000014129UPB_API_INLINE uint32_t upb_WireReader_GetFieldNumber(uint32_t tag);
Protobuf Team Botcb8a31e2024-01-02 02:33:01 +000014130
14131// Given a tag, returns the wire type.
Protobuf Team Botb3878b52024-02-08 21:50:53 +000014132UPB_API_INLINE uint8_t upb_WireReader_GetWireType(uint32_t tag);
Protobuf Team Botcb8a31e2024-01-02 02:33:01 +000014133
14134UPB_INLINE const char* upb_WireReader_ReadVarint(const char* ptr,
14135 uint64_t* val) {
14136 return UPB_PRIVATE(_upb_WireReader_ReadVarint)(ptr, val, 10, UINT64_MAX);
14137}
14138
14139// Skips data for a varint, returning a pointer past the end of the varint, or
14140// NULL if there was an error in the varint data.
14141//
14142// REQUIRES: there must be at least 10 bytes of data available at `ptr`.
14143// Bounds checks must be performed before calling this function, preferably
14144// by calling upb_EpsCopyInputStream_IsDone().
14145UPB_INLINE const char* upb_WireReader_SkipVarint(const char* ptr) {
14146 uint64_t val;
14147 return upb_WireReader_ReadVarint(ptr, &val);
14148}
14149
14150// Reads a varint indicating the size of a delimited field into `size`, or
14151// NULL if there was an error in the varint data.
14152//
14153// REQUIRES: there must be at least 10 bytes of data available at `ptr`.
14154// Bounds checks must be performed before calling this function, preferably
14155// by calling upb_EpsCopyInputStream_IsDone().
14156UPB_INLINE const char* upb_WireReader_ReadSize(const char* ptr, int* size) {
14157 uint64_t size64;
14158 ptr = upb_WireReader_ReadVarint(ptr, &size64);
14159 if (!ptr || size64 >= INT32_MAX) return NULL;
14160 *size = size64;
14161 return ptr;
14162}
14163
14164// Reads a fixed32 field, performing byte swapping if necessary.
14165//
14166// REQUIRES: there must be at least 4 bytes of data available at `ptr`.
14167// Bounds checks must be performed before calling this function, preferably
14168// by calling upb_EpsCopyInputStream_IsDone().
14169UPB_INLINE const char* upb_WireReader_ReadFixed32(const char* ptr, void* val) {
14170 uint32_t uval;
14171 memcpy(&uval, ptr, 4);
Protobuf Team Botde5ea1e2024-01-02 04:02:53 +000014172 uval = upb_BigEndian32(uval);
Protobuf Team Botcb8a31e2024-01-02 02:33:01 +000014173 memcpy(val, &uval, 4);
14174 return ptr + 4;
14175}
14176
14177// Reads a fixed64 field, performing byte swapping if necessary.
14178//
14179// REQUIRES: there must be at least 4 bytes of data available at `ptr`.
14180// Bounds checks must be performed before calling this function, preferably
14181// by calling upb_EpsCopyInputStream_IsDone().
14182UPB_INLINE const char* upb_WireReader_ReadFixed64(const char* ptr, void* val) {
14183 uint64_t uval;
14184 memcpy(&uval, ptr, 8);
Protobuf Team Botde5ea1e2024-01-02 04:02:53 +000014185 uval = upb_BigEndian64(uval);
Protobuf Team Botcb8a31e2024-01-02 02:33:01 +000014186 memcpy(val, &uval, 8);
14187 return ptr + 8;
14188}
14189
14190const char* UPB_PRIVATE(_upb_WireReader_SkipGroup)(
14191 const char* ptr, uint32_t tag, int depth_limit,
14192 upb_EpsCopyInputStream* stream);
14193
14194// Skips data for a group, returning a pointer past the end of the group, or
14195// NULL if there was an error parsing the group. The `tag` argument should be
14196// the start group tag that begins the group. The `depth_limit` argument
14197// indicates how many levels of recursion the group is allowed to have before
14198// reporting a parse error (this limit exists to protect against stack
14199// overflow).
14200//
14201// TODO: evaluate how the depth_limit should be specified. Do users need
14202// control over this?
14203UPB_INLINE const char* upb_WireReader_SkipGroup(
14204 const char* ptr, uint32_t tag, upb_EpsCopyInputStream* stream) {
14205 return UPB_PRIVATE(_upb_WireReader_SkipGroup)(ptr, tag, 100, stream);
14206}
14207
14208UPB_INLINE const char* _upb_WireReader_SkipValue(
14209 const char* ptr, uint32_t tag, int depth_limit,
14210 upb_EpsCopyInputStream* stream) {
14211 switch (upb_WireReader_GetWireType(tag)) {
14212 case kUpb_WireType_Varint:
14213 return upb_WireReader_SkipVarint(ptr);
14214 case kUpb_WireType_32Bit:
14215 return ptr + 4;
14216 case kUpb_WireType_64Bit:
14217 return ptr + 8;
14218 case kUpb_WireType_Delimited: {
14219 int size;
14220 ptr = upb_WireReader_ReadSize(ptr, &size);
14221 if (!ptr) return NULL;
14222 ptr += size;
14223 return ptr;
14224 }
14225 case kUpb_WireType_StartGroup:
14226 return UPB_PRIVATE(_upb_WireReader_SkipGroup)(ptr, tag, depth_limit,
14227 stream);
14228 case kUpb_WireType_EndGroup:
14229 return NULL; // Should be handled before now.
14230 default:
14231 return NULL; // Unknown wire type.
14232 }
14233}
14234
14235// Skips data for a wire value of any type, returning a pointer past the end of
14236// the data, or NULL if there was an error parsing the group. The `tag` argument
14237// should be the tag that was just parsed. The `depth_limit` argument indicates
14238// how many levels of recursion a group is allowed to have before reporting a
14239// parse error (this limit exists to protect against stack overflow).
14240//
14241// REQUIRES: there must be at least 10 bytes of data available at `ptr`.
14242// Bounds checks must be performed before calling this function, preferably
14243// by calling upb_EpsCopyInputStream_IsDone().
14244//
14245// TODO: evaluate how the depth_limit should be specified. Do users need
14246// control over this?
14247UPB_INLINE const char* upb_WireReader_SkipValue(
14248 const char* ptr, uint32_t tag, upb_EpsCopyInputStream* stream) {
14249 return _upb_WireReader_SkipValue(ptr, tag, 100, stream);
14250}
14251
14252#ifdef __cplusplus
14253} /* extern "C" */
14254#endif
14255
14256
14257#endif // UPB_WIRE_READER_H_
14258
14259#ifndef UPB_LEX_STRTOD_H_
14260#define UPB_LEX_STRTOD_H_
14261
14262// Must be last.
14263
14264#ifdef __cplusplus
14265extern "C" {
14266#endif
14267
14268double _upb_NoLocaleStrtod(const char *str, char **endptr);
14269
14270#ifdef __cplusplus
14271} /* extern "C" */
14272#endif
14273
14274
14275#endif /* UPB_LEX_STRTOD_H_ */
14276
14277#ifndef UPB_MINI_DESCRIPTOR_INTERNAL_ENCODE_H_
14278#define UPB_MINI_DESCRIPTOR_INTERNAL_ENCODE_H_
14279
14280#include <stdint.h>
14281
14282
14283// Must be last.
14284
14285// If the input buffer has at least this many bytes available, the encoder call
14286// is guaranteed to succeed (as long as field number order is maintained).
14287#define kUpb_MtDataEncoder_MinSize 16
14288
14289typedef struct {
14290 char* end; // Limit of the buffer passed as a parameter.
14291 // Aliased to internal-only members in .cc.
14292 char internal[32];
14293} upb_MtDataEncoder;
14294
14295#ifdef __cplusplus
14296extern "C" {
14297#endif
14298
14299// Encodes field/oneof information for a given message. The sequence of calls
14300// should look like:
14301//
14302// upb_MtDataEncoder e;
14303// char buf[256];
14304// char* ptr = buf;
14305// e.end = ptr + sizeof(buf);
14306// unit64_t msg_mod = ...; // bitwise & of kUpb_MessageModifiers or zero
14307// ptr = upb_MtDataEncoder_StartMessage(&e, ptr, msg_mod);
14308// // Fields *must* be in field number order.
14309// ptr = upb_MtDataEncoder_PutField(&e, ptr, ...);
14310// ptr = upb_MtDataEncoder_PutField(&e, ptr, ...);
14311// ptr = upb_MtDataEncoder_PutField(&e, ptr, ...);
14312//
14313// // If oneofs are present. Oneofs must be encoded after regular fields.
14314// ptr = upb_MiniTable_StartOneof(&e, ptr)
14315// ptr = upb_MiniTable_PutOneofField(&e, ptr, ...);
14316// ptr = upb_MiniTable_PutOneofField(&e, ptr, ...);
14317//
14318// ptr = upb_MiniTable_StartOneof(&e, ptr);
14319// ptr = upb_MiniTable_PutOneofField(&e, ptr, ...);
14320// ptr = upb_MiniTable_PutOneofField(&e, ptr, ...);
14321//
14322// Oneofs must be encoded after all regular fields.
14323char* upb_MtDataEncoder_StartMessage(upb_MtDataEncoder* e, char* ptr,
14324 uint64_t msg_mod);
14325char* upb_MtDataEncoder_PutField(upb_MtDataEncoder* e, char* ptr,
14326 upb_FieldType type, uint32_t field_num,
14327 uint64_t field_mod);
14328char* upb_MtDataEncoder_StartOneof(upb_MtDataEncoder* e, char* ptr);
14329char* upb_MtDataEncoder_PutOneofField(upb_MtDataEncoder* e, char* ptr,
14330 uint32_t field_num);
14331
14332// Encodes the set of values for a given enum. The values must be given in
14333// order (after casting to uint32_t), and repeats are not allowed.
14334char* upb_MtDataEncoder_StartEnum(upb_MtDataEncoder* e, char* ptr);
14335char* upb_MtDataEncoder_PutEnumValue(upb_MtDataEncoder* e, char* ptr,
14336 uint32_t val);
14337char* upb_MtDataEncoder_EndEnum(upb_MtDataEncoder* e, char* ptr);
14338
14339// Encodes an entire mini descriptor for an extension.
14340char* upb_MtDataEncoder_EncodeExtension(upb_MtDataEncoder* e, char* ptr,
14341 upb_FieldType type, uint32_t field_num,
14342 uint64_t field_mod);
14343
14344// Encodes an entire mini descriptor for a map.
14345char* upb_MtDataEncoder_EncodeMap(upb_MtDataEncoder* e, char* ptr,
14346 upb_FieldType key_type,
14347 upb_FieldType value_type, uint64_t key_mod,
14348 uint64_t value_mod);
14349
14350// Encodes an entire mini descriptor for a message set.
14351char* upb_MtDataEncoder_EncodeMessageSet(upb_MtDataEncoder* e, char* ptr);
14352
14353#ifdef __cplusplus
14354} /* extern "C" */
14355#endif
14356
14357
14358#endif /* UPB_MINI_DESCRIPTOR_INTERNAL_ENCODE_H_ */
14359
Eric Salo8809a112022-11-21 13:01:06 -080014360#ifndef UPB_REFLECTION_DEF_POOL_INTERNAL_H_
14361#define UPB_REFLECTION_DEF_POOL_INTERNAL_H_
14362
14363
14364// Must be last.
14365
14366#ifdef __cplusplus
14367extern "C" {
14368#endif
14369
14370upb_Arena* _upb_DefPool_Arena(const upb_DefPool* s);
14371size_t _upb_DefPool_BytesLoaded(const upb_DefPool* s);
14372upb_ExtensionRegistry* _upb_DefPool_ExtReg(const upb_DefPool* s);
14373
14374bool _upb_DefPool_InsertExt(upb_DefPool* s, const upb_MiniTableExtension* ext,
Jakob Buchgraberc0c79b22023-03-20 08:13:52 -070014375 const upb_FieldDef* f);
Eric Salo8809a112022-11-21 13:01:06 -080014376bool _upb_DefPool_InsertSym(upb_DefPool* s, upb_StringView sym, upb_value v,
14377 upb_Status* status);
14378bool _upb_DefPool_LookupSym(const upb_DefPool* s, const char* sym, size_t size,
14379 upb_value* v);
14380
14381void** _upb_DefPool_ScratchData(const upb_DefPool* s);
14382size_t* _upb_DefPool_ScratchSize(const upb_DefPool* s);
Mike Kruskal232ecf42023-01-14 00:09:40 -080014383void _upb_DefPool_SetPlatform(upb_DefPool* s, upb_MiniTablePlatform platform);
Eric Salo8809a112022-11-21 13:01:06 -080014384
14385// For generated code only: loads a generated descriptor.
14386typedef struct _upb_DefPool_Init {
14387 struct _upb_DefPool_Init** deps; // Dependencies of this file.
14388 const upb_MiniTableFile* layout;
14389 const char* filename;
14390 upb_StringView descriptor; // Serialized descriptor.
14391} _upb_DefPool_Init;
14392
14393bool _upb_DefPool_LoadDefInit(upb_DefPool* s, const _upb_DefPool_Init* init);
14394
14395// Should only be directly called by tests. This variant lets us suppress
14396// the use of compiled-in tables, forcing a rebuild of the tables at runtime.
14397bool _upb_DefPool_LoadDefInitEx(upb_DefPool* s, const _upb_DefPool_Init* init,
14398 bool rebuild_minitable);
14399
14400#ifdef __cplusplus
14401} /* extern "C" */
14402#endif
14403
14404
14405#endif /* UPB_REFLECTION_DEF_POOL_INTERNAL_H_ */
14406
Protobuf Team Bot7be2a452023-09-13 16:50:05 +000014407#ifndef UPB_REFLECTION_DEF_BUILDER_INTERNAL_H_
14408#define UPB_REFLECTION_DEF_BUILDER_INTERNAL_H_
14409
14410
Eric Salo8809a112022-11-21 13:01:06 -080014411// Must be last.
14412
14413// We want to copy the options verbatim into the destination options proto.
14414// We use serialize+parse as our deep copy.
Mike Kruskal232ecf42023-01-14 00:09:40 -080014415#define UPB_DEF_SET_OPTIONS(target, desc_type, options_type, proto) \
14416 if (UPB_DESC(desc_type##_has_options)(proto)) { \
14417 size_t size; \
14418 char* pb = UPB_DESC(options_type##_serialize)( \
14419 UPB_DESC(desc_type##_options)(proto), ctx->tmp_arena, &size); \
14420 if (!pb) _upb_DefBuilder_OomErr(ctx); \
14421 target = \
14422 UPB_DESC(options_type##_parse)(pb, size, _upb_DefBuilder_Arena(ctx)); \
14423 if (!target) _upb_DefBuilder_OomErr(ctx); \
14424 } else { \
14425 target = (const UPB_DESC(options_type)*)kUpbDefOptDefault; \
Eric Salo8809a112022-11-21 13:01:06 -080014426 }
14427
14428#ifdef __cplusplus
14429extern "C" {
14430#endif
14431
14432struct upb_DefBuilder {
14433 upb_DefPool* symtab;
Protobuf Team Botce9dcc22023-11-03 22:38:26 +000014434 upb_strtable feature_cache; // Caches features by identity.
14435 UPB_DESC(FeatureSet*) legacy_features; // For computing legacy features.
14436 char* tmp_buf; // Temporary buffer in tmp_arena.
14437 size_t tmp_buf_size; // Size of temporary buffer.
Eric Salo8809a112022-11-21 13:01:06 -080014438 upb_FileDef* file; // File we are building.
14439 upb_Arena* arena; // Allocate defs here.
14440 upb_Arena* tmp_arena; // For temporary allocations.
14441 upb_Status* status; // Record errors here.
14442 const upb_MiniTableFile* layout; // NULL if we should build layouts.
Mike Kruskal232ecf42023-01-14 00:09:40 -080014443 upb_MiniTablePlatform platform; // Platform we are targeting.
Eric Salo8809a112022-11-21 13:01:06 -080014444 int enum_count; // Count of enums built so far.
14445 int msg_count; // Count of messages built so far.
14446 int ext_count; // Count of extensions built so far.
14447 jmp_buf err; // longjmp() on error.
14448};
14449
14450extern const char* kUpbDefOptDefault;
14451
14452// ctx->status has already been set elsewhere so just fail/longjmp()
14453UPB_NORETURN void _upb_DefBuilder_FailJmp(upb_DefBuilder* ctx);
14454
14455UPB_NORETURN void _upb_DefBuilder_Errf(upb_DefBuilder* ctx, const char* fmt,
14456 ...) UPB_PRINTF(2, 3);
14457UPB_NORETURN void _upb_DefBuilder_OomErr(upb_DefBuilder* ctx);
14458
14459const char* _upb_DefBuilder_MakeFullName(upb_DefBuilder* ctx,
14460 const char* prefix,
14461 upb_StringView name);
14462
14463// Given a symbol and the base symbol inside which it is defined,
14464// find the symbol's definition.
14465const void* _upb_DefBuilder_ResolveAny(upb_DefBuilder* ctx,
14466 const char* from_name_dbg,
14467 const char* base, upb_StringView sym,
14468 upb_deftype_t* type);
14469
14470const void* _upb_DefBuilder_Resolve(upb_DefBuilder* ctx,
14471 const char* from_name_dbg, const char* base,
14472 upb_StringView sym, upb_deftype_t type);
14473
14474char _upb_DefBuilder_ParseEscape(upb_DefBuilder* ctx, const upb_FieldDef* f,
14475 const char** src, const char* end);
14476
14477const char* _upb_DefBuilder_FullToShort(const char* fullname);
14478
14479UPB_INLINE void* _upb_DefBuilder_Alloc(upb_DefBuilder* ctx, size_t bytes) {
14480 if (bytes == 0) return NULL;
14481 void* ret = upb_Arena_Malloc(ctx->arena, bytes);
14482 if (!ret) _upb_DefBuilder_OomErr(ctx);
14483 return ret;
14484}
14485
14486// Adds a symbol |v| to the symtab, which must be a def pointer previously
14487// packed with pack_def(). The def's pointer to upb_FileDef* must be set before
14488// adding, so we know which entries to remove if building this file fails.
14489UPB_INLINE void _upb_DefBuilder_Add(upb_DefBuilder* ctx, const char* name,
14490 upb_value v) {
14491 upb_StringView sym = {.data = name, .size = strlen(name)};
14492 bool ok = _upb_DefPool_InsertSym(ctx->symtab, sym, v, ctx->status);
14493 if (!ok) _upb_DefBuilder_FailJmp(ctx);
14494}
14495
14496UPB_INLINE upb_Arena* _upb_DefBuilder_Arena(const upb_DefBuilder* ctx) {
14497 return ctx->arena;
14498}
14499
14500UPB_INLINE upb_FileDef* _upb_DefBuilder_File(const upb_DefBuilder* ctx) {
14501 return ctx->file;
14502}
14503
14504// This version of CheckIdent() is only called by other, faster versions after
14505// they detect a parsing error.
14506void _upb_DefBuilder_CheckIdentSlow(upb_DefBuilder* ctx, upb_StringView name,
14507 bool full);
14508
Eric Salo8809a112022-11-21 13:01:06 -080014509// Verify a full identifier string. This is slightly more complicated than
14510// verifying a relative identifier string because we must track '.' chars.
14511UPB_INLINE void _upb_DefBuilder_CheckIdentFull(upb_DefBuilder* ctx,
14512 upb_StringView name) {
14513 bool good = name.size > 0;
14514 bool start = true;
14515
14516 for (size_t i = 0; i < name.size; i++) {
14517 const char c = name.data[i];
14518 const char d = c | 0x20; // force lowercase
14519 const bool is_alpha = (('a' <= d) & (d <= 'z')) | (c == '_');
14520 const bool is_numer = ('0' <= c) & (c <= '9') & !start;
14521 const bool is_dot = (c == '.') & !start;
14522
14523 good &= is_alpha | is_numer | is_dot;
14524 start = is_dot;
14525 }
14526
14527 if (!good) _upb_DefBuilder_CheckIdentSlow(ctx, name, true);
14528}
14529
Protobuf Team Botce9dcc22023-11-03 22:38:26 +000014530// Returns true if the returned feature set is new and must be populated.
14531bool _upb_DefBuilder_GetOrCreateFeatureSet(upb_DefBuilder* ctx,
14532 const UPB_DESC(FeatureSet*) parent,
14533 upb_StringView key,
14534 UPB_DESC(FeatureSet**) set);
14535
14536const UPB_DESC(FeatureSet*)
14537 _upb_DefBuilder_DoResolveFeatures(upb_DefBuilder* ctx,
14538 const UPB_DESC(FeatureSet*) parent,
14539 const UPB_DESC(FeatureSet*) child,
14540 bool is_implicit);
14541
14542UPB_INLINE const UPB_DESC(FeatureSet*)
14543 _upb_DefBuilder_ResolveFeatures(upb_DefBuilder* ctx,
14544 const UPB_DESC(FeatureSet*) parent,
14545 const UPB_DESC(FeatureSet*) child) {
14546 return _upb_DefBuilder_DoResolveFeatures(ctx, parent, child, false);
14547}
14548
Eric Salo8809a112022-11-21 13:01:06 -080014549#ifdef __cplusplus
14550} /* extern "C" */
14551#endif
14552
14553
14554#endif /* UPB_REFLECTION_DEF_BUILDER_INTERNAL_H_ */
14555
14556#ifndef UPB_REFLECTION_ENUM_DEF_INTERNAL_H_
14557#define UPB_REFLECTION_ENUM_DEF_INTERNAL_H_
14558
14559
14560// Must be last.
14561
14562#ifdef __cplusplus
14563extern "C" {
14564#endif
14565
14566upb_EnumDef* _upb_EnumDef_At(const upb_EnumDef* e, int i);
14567bool _upb_EnumDef_Insert(upb_EnumDef* e, upb_EnumValueDef* v, upb_Arena* a);
14568const upb_MiniTableEnum* _upb_EnumDef_MiniTable(const upb_EnumDef* e);
14569
14570// Allocate and initialize an array of |n| enum defs.
Protobuf Team Botce9dcc22023-11-03 22:38:26 +000014571upb_EnumDef* _upb_EnumDefs_New(upb_DefBuilder* ctx, int n,
14572 const UPB_DESC(EnumDescriptorProto*)
14573 const* protos,
14574 const UPB_DESC(FeatureSet*) parent_features,
14575 const upb_MessageDef* containing_type);
Eric Salo8809a112022-11-21 13:01:06 -080014576
14577#ifdef __cplusplus
14578} /* extern "C" */
14579#endif
14580
14581
14582#endif /* UPB_REFLECTION_ENUM_DEF_INTERNAL_H_ */
14583
14584#ifndef UPB_REFLECTION_ENUM_VALUE_DEF_INTERNAL_H_
14585#define UPB_REFLECTION_ENUM_VALUE_DEF_INTERNAL_H_
14586
14587
14588// Must be last.
14589
14590#ifdef __cplusplus
14591extern "C" {
14592#endif
14593
14594upb_EnumValueDef* _upb_EnumValueDef_At(const upb_EnumValueDef* v, int i);
14595
14596// Allocate and initialize an array of |n| enum value defs owned by |e|.
14597upb_EnumValueDef* _upb_EnumValueDefs_New(
14598 upb_DefBuilder* ctx, const char* prefix, int n,
Protobuf Team Botce9dcc22023-11-03 22:38:26 +000014599 const UPB_DESC(EnumValueDescriptorProto*) const* protos,
14600 const UPB_DESC(FeatureSet*) parent_features, upb_EnumDef* e,
Eric Salo8809a112022-11-21 13:01:06 -080014601 bool* is_sorted);
14602
14603const upb_EnumValueDef** _upb_EnumValueDefs_Sorted(const upb_EnumValueDef* v,
14604 int n, upb_Arena* a);
14605
14606#ifdef __cplusplus
14607} /* extern "C" */
14608#endif
14609
14610
14611#endif /* UPB_REFLECTION_ENUM_VALUE_DEF_INTERNAL_H_ */
14612
14613#ifndef UPB_REFLECTION_FIELD_DEF_INTERNAL_H_
14614#define UPB_REFLECTION_FIELD_DEF_INTERNAL_H_
14615
14616
14617// Must be last.
14618
14619#ifdef __cplusplus
14620extern "C" {
14621#endif
14622
14623upb_FieldDef* _upb_FieldDef_At(const upb_FieldDef* f, int i);
14624
Eric Salo8809a112022-11-21 13:01:06 -080014625bool _upb_FieldDef_IsClosedEnum(const upb_FieldDef* f);
14626bool _upb_FieldDef_IsProto3Optional(const upb_FieldDef* f);
14627int _upb_FieldDef_LayoutIndex(const upb_FieldDef* f);
14628uint64_t _upb_FieldDef_Modifiers(const upb_FieldDef* f);
14629void _upb_FieldDef_Resolve(upb_DefBuilder* ctx, const char* prefix,
14630 upb_FieldDef* f);
Jakob Buchgraberc0c79b22023-03-20 08:13:52 -070014631void _upb_FieldDef_BuildMiniTableExtension(upb_DefBuilder* ctx,
14632 const upb_FieldDef* f);
14633
14634// Allocate and initialize an array of |n| extensions (field defs).
Protobuf Team Botce9dcc22023-11-03 22:38:26 +000014635upb_FieldDef* _upb_Extensions_New(upb_DefBuilder* ctx, int n,
14636 const UPB_DESC(FieldDescriptorProto*)
14637 const* protos,
14638 const UPB_DESC(FeatureSet*) parent_features,
14639 const char* prefix, upb_MessageDef* m);
Eric Salo8809a112022-11-21 13:01:06 -080014640
14641// Allocate and initialize an array of |n| field defs.
Protobuf Team Botce9dcc22023-11-03 22:38:26 +000014642upb_FieldDef* _upb_FieldDefs_New(upb_DefBuilder* ctx, int n,
14643 const UPB_DESC(FieldDescriptorProto*)
14644 const* protos,
14645 const UPB_DESC(FeatureSet*) parent_features,
14646 const char* prefix, upb_MessageDef* m,
14647 bool* is_sorted);
Eric Salo8809a112022-11-21 13:01:06 -080014648
14649// Allocate and return a list of pointers to the |n| field defs in |ff|,
14650// sorted by field number.
14651const upb_FieldDef** _upb_FieldDefs_Sorted(const upb_FieldDef* f, int n,
14652 upb_Arena* a);
14653
14654#ifdef __cplusplus
14655} /* extern "C" */
14656#endif
14657
14658
14659#endif /* UPB_REFLECTION_FIELD_DEF_INTERNAL_H_ */
14660
14661#ifndef UPB_REFLECTION_FILE_DEF_INTERNAL_H_
14662#define UPB_REFLECTION_FILE_DEF_INTERNAL_H_
14663
14664
14665// Must be last.
14666
14667#ifdef __cplusplus
14668extern "C" {
14669#endif
14670
14671const upb_MiniTableExtension* _upb_FileDef_ExtensionMiniTable(
14672 const upb_FileDef* f, int i);
14673const int32_t* _upb_FileDef_PublicDependencyIndexes(const upb_FileDef* f);
14674const int32_t* _upb_FileDef_WeakDependencyIndexes(const upb_FileDef* f);
14675
14676// upb_FileDef_Package() returns "" if f->package is NULL, this does not.
14677const char* _upb_FileDef_RawPackage(const upb_FileDef* f);
14678
14679void _upb_FileDef_Create(upb_DefBuilder* ctx,
Mike Kruskal232ecf42023-01-14 00:09:40 -080014680 const UPB_DESC(FileDescriptorProto) * file_proto);
Eric Salo8809a112022-11-21 13:01:06 -080014681
14682#ifdef __cplusplus
14683} /* extern "C" */
14684#endif
14685
14686
14687#endif /* UPB_REFLECTION_FILE_DEF_INTERNAL_H_ */
14688
14689#ifndef UPB_REFLECTION_MESSAGE_DEF_INTERNAL_H_
14690#define UPB_REFLECTION_MESSAGE_DEF_INTERNAL_H_
14691
14692
14693// Must be last.
14694
14695#ifdef __cplusplus
14696extern "C" {
14697#endif
14698
14699upb_MessageDef* _upb_MessageDef_At(const upb_MessageDef* m, int i);
14700bool _upb_MessageDef_InMessageSet(const upb_MessageDef* m);
14701bool _upb_MessageDef_Insert(upb_MessageDef* m, const char* name, size_t size,
14702 upb_value v, upb_Arena* a);
14703void _upb_MessageDef_InsertField(upb_DefBuilder* ctx, upb_MessageDef* m,
14704 const upb_FieldDef* f);
14705bool _upb_MessageDef_IsValidExtensionNumber(const upb_MessageDef* m, int n);
Jakob Buchgraberc0c79b22023-03-20 08:13:52 -070014706void _upb_MessageDef_CreateMiniTable(upb_DefBuilder* ctx, upb_MessageDef* m);
Eric Salo8809a112022-11-21 13:01:06 -080014707void _upb_MessageDef_LinkMiniTable(upb_DefBuilder* ctx,
14708 const upb_MessageDef* m);
14709void _upb_MessageDef_Resolve(upb_DefBuilder* ctx, upb_MessageDef* m);
14710
14711// Allocate and initialize an array of |n| message defs.
Protobuf Team Botce9dcc22023-11-03 22:38:26 +000014712upb_MessageDef* _upb_MessageDefs_New(upb_DefBuilder* ctx, int n,
14713 const UPB_DESC(DescriptorProto*)
14714 const* protos,
14715 const UPB_DESC(FeatureSet*)
14716 parent_features,
14717 const upb_MessageDef* containing_type);
Eric Salo8809a112022-11-21 13:01:06 -080014718
14719#ifdef __cplusplus
14720} /* extern "C" */
14721#endif
14722
14723
14724#endif /* UPB_REFLECTION_MESSAGE_DEF_INTERNAL_H_ */
14725
14726#ifndef UPB_REFLECTION_SERVICE_DEF_INTERNAL_H_
14727#define UPB_REFLECTION_SERVICE_DEF_INTERNAL_H_
14728
14729
14730// Must be last.
14731
14732#ifdef __cplusplus
14733extern "C" {
14734#endif
14735
14736upb_ServiceDef* _upb_ServiceDef_At(const upb_ServiceDef* s, int i);
14737
14738// Allocate and initialize an array of |n| service defs.
Protobuf Team Botce9dcc22023-11-03 22:38:26 +000014739upb_ServiceDef* _upb_ServiceDefs_New(upb_DefBuilder* ctx, int n,
14740 const UPB_DESC(ServiceDescriptorProto*)
14741 const* protos,
14742 const UPB_DESC(FeatureSet*)
14743 parent_features);
Eric Salo8809a112022-11-21 13:01:06 -080014744
14745#ifdef __cplusplus
14746} /* extern "C" */
14747#endif
14748
14749
14750#endif /* UPB_REFLECTION_SERVICE_DEF_INTERNAL_H_ */
14751
Protobuf Team Botce9dcc22023-11-03 22:38:26 +000014752#ifndef UPB_REFLECTION_UPB_EDITION_DEFAULTS_H_
14753#define UPB_REFLECTION_UPB_EDITION_DEFAULTS_H_
14754
14755// This file contains the serialized FeatureSetDefaults object for
14756// language-independent features and (possibly at some point) for upb-specific
14757// features. This is used for feature resolution under Editions.
14758// NOLINTBEGIN
14759// clang-format off
Protobuf Team Botc12c7322024-05-31 05:25:33 +000014760#define UPB_INTERNAL_UPB_EDITION_DEFAULTS "\n\023\030\204\007\"\000*\014\010\001\020\002\030\002 \003(\0010\002\n\023\030\347\007\"\000*\014\010\002\020\001\030\001 \002(\0010\001\n\023\030\350\007\"\014\010\001\020\001\030\001 \002(\0010\001*\000 \346\007(\350\007"
Protobuf Team Botce9dcc22023-11-03 22:38:26 +000014761// clang-format on
14762// NOLINTEND
14763
14764#endif // UPB_REFLECTION_UPB_EDITION_DEFAULTS_H_
14765
Eric Salo8809a112022-11-21 13:01:06 -080014766#ifndef UPB_REFLECTION_DESC_STATE_INTERNAL_H_
14767#define UPB_REFLECTION_DESC_STATE_INTERNAL_H_
14768
14769
14770// Must be last.
14771
14772// Manages the storage for mini descriptor strings as they are being encoded.
Protobuf Team Bot986cbb62023-09-19 15:03:51 +000014773// TODO: Move some of this state directly into the encoder, maybe.
Eric Salo8809a112022-11-21 13:01:06 -080014774typedef struct {
14775 upb_MtDataEncoder e;
14776 size_t bufsize;
14777 char* buf;
14778 char* ptr;
14779} upb_DescState;
14780
14781#ifdef __cplusplus
14782extern "C" {
14783#endif
14784
14785UPB_INLINE void _upb_DescState_Init(upb_DescState* d) {
14786 d->bufsize = kUpb_MtDataEncoder_MinSize * 2;
14787 d->buf = NULL;
14788 d->ptr = NULL;
14789}
14790
14791bool _upb_DescState_Grow(upb_DescState* d, upb_Arena* a);
14792
14793#ifdef __cplusplus
14794} /* extern "C" */
14795#endif
14796
14797
14798#endif /* UPB_REFLECTION_DESC_STATE_INTERNAL_H_ */
14799
14800#ifndef UPB_REFLECTION_ENUM_RESERVED_RANGE_INTERNAL_H_
14801#define UPB_REFLECTION_ENUM_RESERVED_RANGE_INTERNAL_H_
14802
14803
Protobuf Team Bot06310352023-09-26 21:54:58 +000014804// IWYU pragma: private, include "upb/reflection/def.h"
Eric Salo8809a112022-11-21 13:01:06 -080014805
14806#ifndef UPB_REFLECTION_ENUM_RESERVED_RANGE_H_
14807#define UPB_REFLECTION_ENUM_RESERVED_RANGE_H_
14808
14809
14810// Must be last.
14811
14812#ifdef __cplusplus
14813extern "C" {
14814#endif
14815
14816int32_t upb_EnumReservedRange_Start(const upb_EnumReservedRange* r);
14817int32_t upb_EnumReservedRange_End(const upb_EnumReservedRange* r);
14818
14819#ifdef __cplusplus
14820} /* extern "C" */
14821#endif
14822
14823
14824#endif /* UPB_REFLECTION_ENUM_RESERVED_RANGE_H_ */
14825
14826// Must be last.
14827
14828#ifdef __cplusplus
14829extern "C" {
14830#endif
14831
14832upb_EnumReservedRange* _upb_EnumReservedRange_At(const upb_EnumReservedRange* r,
14833 int i);
14834
14835// Allocate and initialize an array of |n| reserved ranges owned by |e|.
14836upb_EnumReservedRange* _upb_EnumReservedRanges_New(
14837 upb_DefBuilder* ctx, int n,
Protobuf Team Botce9dcc22023-11-03 22:38:26 +000014838 const UPB_DESC(EnumDescriptorProto_EnumReservedRange*) const* protos,
Eric Salo8809a112022-11-21 13:01:06 -080014839 const upb_EnumDef* e);
14840
14841#ifdef __cplusplus
14842} /* extern "C" */
14843#endif
14844
14845
14846#endif /* UPB_REFLECTION_ENUM_RESERVED_RANGE_INTERNAL_H_ */
14847
Protobuf Team Bot7be2a452023-09-13 16:50:05 +000014848#ifndef UPB_REFLECTION_INTERNAL_STRDUP2_H_
14849#define UPB_REFLECTION_INTERNAL_STRDUP2_H_
14850
14851#include <stddef.h>
14852
14853
14854// Must be last.
14855
14856#ifdef __cplusplus
14857extern "C" {
14858#endif
14859
14860// Variant that works with a length-delimited rather than NULL-delimited string,
14861// as supported by strtable.
14862char* upb_strdup2(const char* s, size_t len, upb_Arena* a);
14863
14864#ifdef __cplusplus
14865} /* extern "C" */
14866#endif
14867
14868
14869#endif /* UPB_REFLECTION_INTERNAL_STRDUP2_H_ */
14870
Eric Salo8809a112022-11-21 13:01:06 -080014871#ifndef UPB_REFLECTION_EXTENSION_RANGE_INTERNAL_H_
14872#define UPB_REFLECTION_EXTENSION_RANGE_INTERNAL_H_
14873
14874
14875// Must be last.
14876
14877#ifdef __cplusplus
14878extern "C" {
14879#endif
14880
14881upb_ExtensionRange* _upb_ExtensionRange_At(const upb_ExtensionRange* r, int i);
14882
14883// Allocate and initialize an array of |n| extension ranges owned by |m|.
14884upb_ExtensionRange* _upb_ExtensionRanges_New(
14885 upb_DefBuilder* ctx, int n,
Protobuf Team Botce9dcc22023-11-03 22:38:26 +000014886 const UPB_DESC(DescriptorProto_ExtensionRange*) const* protos,
14887 const UPB_DESC(FeatureSet*) parent_features, const upb_MessageDef* m);
Eric Salo8809a112022-11-21 13:01:06 -080014888
14889#ifdef __cplusplus
14890} /* extern "C" */
14891#endif
14892
14893
14894#endif /* UPB_REFLECTION_EXTENSION_RANGE_INTERNAL_H_ */
14895
14896#ifndef UPB_REFLECTION_ONEOF_DEF_INTERNAL_H_
14897#define UPB_REFLECTION_ONEOF_DEF_INTERNAL_H_
14898
14899
14900// Must be last.
14901
14902#ifdef __cplusplus
14903extern "C" {
14904#endif
14905
14906upb_OneofDef* _upb_OneofDef_At(const upb_OneofDef* o, int i);
Jakob Buchgraberc0c79b22023-03-20 08:13:52 -070014907void _upb_OneofDef_Insert(upb_DefBuilder* ctx, upb_OneofDef* o,
14908 const upb_FieldDef* f, const char* name, size_t size);
Eric Salo8809a112022-11-21 13:01:06 -080014909
14910// Allocate and initialize an array of |n| oneof defs owned by |m|.
Protobuf Team Botce9dcc22023-11-03 22:38:26 +000014911upb_OneofDef* _upb_OneofDefs_New(upb_DefBuilder* ctx, int n,
14912 const UPB_DESC(OneofDescriptorProto*)
14913 const* protos,
14914 const UPB_DESC(FeatureSet*) parent_features,
14915 upb_MessageDef* m);
Eric Salo8809a112022-11-21 13:01:06 -080014916
14917size_t _upb_OneofDefs_Finalize(upb_DefBuilder* ctx, upb_MessageDef* m);
14918
14919#ifdef __cplusplus
14920} /* extern "C" */
14921#endif
14922
14923
14924#endif /* UPB_REFLECTION_ONEOF_DEF_INTERNAL_H_ */
14925
14926#ifndef UPB_REFLECTION_MESSAGE_RESERVED_RANGE_INTERNAL_H_
14927#define UPB_REFLECTION_MESSAGE_RESERVED_RANGE_INTERNAL_H_
14928
14929
Protobuf Team Bot06310352023-09-26 21:54:58 +000014930// IWYU pragma: private, include "upb/reflection/def.h"
Eric Salo8809a112022-11-21 13:01:06 -080014931
14932#ifndef UPB_REFLECTION_MESSAGE_RESERVED_RANGE_H_
14933#define UPB_REFLECTION_MESSAGE_RESERVED_RANGE_H_
14934
14935
14936// Must be last.
14937
14938#ifdef __cplusplus
14939extern "C" {
14940#endif
14941
14942int32_t upb_MessageReservedRange_Start(const upb_MessageReservedRange* r);
14943int32_t upb_MessageReservedRange_End(const upb_MessageReservedRange* r);
14944
14945#ifdef __cplusplus
14946} /* extern "C" */
14947#endif
14948
14949
14950#endif /* UPB_REFLECTION_MESSAGE_RESERVED_RANGE_H_ */
14951
14952// Must be last.
14953
14954#ifdef __cplusplus
14955extern "C" {
14956#endif
14957
14958upb_MessageReservedRange* _upb_MessageReservedRange_At(
14959 const upb_MessageReservedRange* r, int i);
14960
14961// Allocate and initialize an array of |n| reserved ranges owned by |m|.
14962upb_MessageReservedRange* _upb_MessageReservedRanges_New(
14963 upb_DefBuilder* ctx, int n,
Mike Kruskal232ecf42023-01-14 00:09:40 -080014964 const UPB_DESC(DescriptorProto_ReservedRange) * const* protos,
Eric Salo8809a112022-11-21 13:01:06 -080014965 const upb_MessageDef* m);
14966
14967#ifdef __cplusplus
14968} /* extern "C" */
14969#endif
14970
14971
14972#endif /* UPB_REFLECTION_MESSAGE_RESERVED_RANGE_INTERNAL_H_ */
14973
14974#ifndef UPB_REFLECTION_METHOD_DEF_INTERNAL_H_
14975#define UPB_REFLECTION_METHOD_DEF_INTERNAL_H_
14976
14977
14978// Must be last.
14979
14980#ifdef __cplusplus
14981extern "C" {
14982#endif
14983
14984upb_MethodDef* _upb_MethodDef_At(const upb_MethodDef* m, int i);
14985
14986// Allocate and initialize an array of |n| method defs owned by |s|.
Protobuf Team Botce9dcc22023-11-03 22:38:26 +000014987upb_MethodDef* _upb_MethodDefs_New(upb_DefBuilder* ctx, int n,
14988 const UPB_DESC(MethodDescriptorProto*)
14989 const* protos,
14990 const UPB_DESC(FeatureSet*) parent_features,
14991 upb_ServiceDef* s);
Eric Salo8809a112022-11-21 13:01:06 -080014992
14993#ifdef __cplusplus
14994} /* extern "C" */
14995#endif
14996
14997
14998#endif /* UPB_REFLECTION_METHOD_DEF_INTERNAL_H_ */
14999
Eric Salo8809a112022-11-21 13:01:06 -080015000// This should #undef all macros #defined in def.inc
Joshua Haberman9abf6e22021-01-13 12:16:25 -080015001
Joshua Haberman9abf6e22021-01-13 12:16:25 -080015002#undef UPB_SIZE
15003#undef UPB_PTR_AT
Joshua Habermandd69a482021-05-17 22:40:33 -070015004#undef UPB_MAPTYPE_STRING
Eric Salo3f36a912022-12-05 14:12:25 -080015005#undef UPB_EXPORT
Joshua Haberman9abf6e22021-01-13 12:16:25 -080015006#undef UPB_INLINE
Eric Salo3f36a912022-12-05 14:12:25 -080015007#undef UPB_API
15008#undef UPB_API_INLINE
Joshua Haberman9abf6e22021-01-13 12:16:25 -080015009#undef UPB_ALIGN_UP
15010#undef UPB_ALIGN_DOWN
15011#undef UPB_ALIGN_MALLOC
15012#undef UPB_ALIGN_OF
Protobuf Team Bote2785502023-12-21 21:28:36 +000015013#undef UPB_ALIGN_AS
Joshua Habermand3995ec2022-09-30 16:54:39 -070015014#undef UPB_MALLOC_ALIGN
Joshua Habermandd69a482021-05-17 22:40:33 -070015015#undef UPB_LIKELY
15016#undef UPB_UNLIKELY
Joshua Haberman9abf6e22021-01-13 12:16:25 -080015017#undef UPB_FORCEINLINE
15018#undef UPB_NOINLINE
15019#undef UPB_NORETURN
Joshua Habermandd69a482021-05-17 22:40:33 -070015020#undef UPB_PRINTF
Joshua Haberman9abf6e22021-01-13 12:16:25 -080015021#undef UPB_MAX
15022#undef UPB_MIN
15023#undef UPB_UNUSED
15024#undef UPB_ASSUME
15025#undef UPB_ASSERT
15026#undef UPB_UNREACHABLE
Joshua Habermandd69a482021-05-17 22:40:33 -070015027#undef UPB_SETJMP
15028#undef UPB_LONGJMP
15029#undef UPB_PTRADD
15030#undef UPB_MUSTTAIL
15031#undef UPB_FASTTABLE_SUPPORTED
Mike Kruskal232ecf42023-01-14 00:09:40 -080015032#undef UPB_FASTTABLE_MASK
Joshua Habermandd69a482021-05-17 22:40:33 -070015033#undef UPB_FASTTABLE
15034#undef UPB_FASTTABLE_INIT
Joshua Haberman9abf6e22021-01-13 12:16:25 -080015035#undef UPB_POISON_MEMORY_REGION
15036#undef UPB_UNPOISON_MEMORY_REGION
15037#undef UPB_ASAN
Sandy Zhange3b09432023-08-07 09:30:02 -070015038#undef UPB_ASAN_GUARD_SIZE
15039#undef UPB_CLANG_ASAN
Protobuf Team Bot5e8d7e52024-03-15 22:28:30 +000015040#undef UPB_TREAT_CLOSED_ENUMS_LIKE_OPEN
Joshua Habermand3995ec2022-09-30 16:54:39 -070015041#undef UPB_DEPRECATED
15042#undef UPB_GNUC_MIN
Mike Kruskal232ecf42023-01-14 00:09:40 -080015043#undef UPB_DESCRIPTOR_UPB_H_FILENAME
15044#undef UPB_DESC
Protobuf Team Botce9dcc22023-11-03 22:38:26 +000015045#undef UPB_DESC_MINITABLE
Mike Kruskal232ecf42023-01-14 00:09:40 -080015046#undef UPB_IS_GOOGLE3
Eric Salodfb71552023-03-22 12:35:09 -070015047#undef UPB_ATOMIC
15048#undef UPB_USE_C11_ATOMICS
Deanna Garciac7d979d2023-04-14 17:22:13 -070015049#undef UPB_PRIVATE
Protobuf Team Bot07194fc2023-11-30 05:43:03 +000015050#undef UPB_ONLYBITS
Protobuf Team Botbf7ac9f2024-06-04 17:32:11 +000015051#undef UPB_LINKARR_DECLARE
15052#undef UPB_LINKARR_APPEND
15053#undef UPB_LINKARR_START
15054#undef UPB_LINKARR_STOP