Joshua Haberman | 7ecf43f | 2022-03-14 13:11:29 -0700 | [diff] [blame] | 1 | // Ruby is still using proto3 enum semantics for proto2 |
Protobuf Team Bot | 5e8d7e5 | 2024-03-15 22:28:30 +0000 | [diff] [blame] | 2 | #define UPB_DISABLE_CLOSED_ENUM_CHECKING |
Joshua Haberman | 9abf6e2 | 2021-01-13 12:16:25 -0800 | [diff] [blame] | 3 | /* Amalgamated source file */ |
Joshua Haberman | dd69a48 | 2021-05-17 22:40:33 -0700 | [diff] [blame] | 4 | |
| 5 | /* |
Eric Salo | 8809a11 | 2022-11-21 13:01:06 -0800 | [diff] [blame] | 6 | * This is where we define internal portability macros used across upb. |
Joshua Haberman | dd69a48 | 2021-05-17 22:40:33 -0700 | [diff] [blame] | 7 | * |
Eric Salo | 8809a11 | 2022-11-21 13:01:06 -0800 | [diff] [blame] | 8 | * All of these macros are undef'd in undef.inc to avoid leaking them to users. |
Joshua Haberman | dd69a48 | 2021-05-17 22:40:33 -0700 | [diff] [blame] | 9 | * |
| 10 | * The correct usage is: |
| 11 | * |
Protobuf Team Bot | 0631035 | 2023-09-26 21:54:58 +0000 | [diff] [blame] | 12 | * #include "upb/foobar.h" |
| 13 | * #include "upb/baz.h" |
Joshua Haberman | dd69a48 | 2021-05-17 22:40:33 -0700 | [diff] [blame] | 14 | * |
| 15 | * // MUST be last included header. |
Protobuf Team Bot | 0631035 | 2023-09-26 21:54:58 +0000 | [diff] [blame] | 16 | * #include "upb/port/def.inc" |
Joshua Haberman | dd69a48 | 2021-05-17 22:40:33 -0700 | [diff] [blame] | 17 | * |
| 18 | * // Code for this file. |
| 19 | * // <...> |
| 20 | * |
| 21 | * // Can be omitted for .c files, required for .h. |
Protobuf Team Bot | 0631035 | 2023-09-26 21:54:58 +0000 | [diff] [blame] | 22 | * #include "upb/port/undef.inc" |
Joshua Haberman | dd69a48 | 2021-05-17 22:40:33 -0700 | [diff] [blame] | 23 | * |
| 24 | * This file is private and must not be included by users! |
| 25 | */ |
Joshua Haberman | 9abf6e2 | 2021-01-13 12:16:25 -0800 | [diff] [blame] | 26 | |
| 27 | #if !((defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L) || \ |
Mike Kruskal | fd0b1a5 | 2022-10-14 16:27:22 -0700 | [diff] [blame] | 28 | (defined(__cplusplus) && __cplusplus >= 201402L) || \ |
Joshua Haberman | 9abf6e2 | 2021-01-13 12:16:25 -0800 | [diff] [blame] | 29 | (defined(_MSC_VER) && _MSC_VER >= 1900)) |
Mike Kruskal | fd0b1a5 | 2022-10-14 16:27:22 -0700 | [diff] [blame] | 30 | #error upb requires C99 or C++14 or MSVC >= 2015. |
Joshua Haberman | 9abf6e2 | 2021-01-13 12:16:25 -0800 | [diff] [blame] | 31 | #endif |
| 32 | |
Joshua Haberman | d3995ec | 2022-09-30 16:54:39 -0700 | [diff] [blame] | 33 | // Portable check for GCC minimum version: |
| 34 | // https://gcc.gnu.org/onlinedocs/cpp/Common-Predefined-Macros.html |
| 35 | #if defined(__GNUC__) && defined(__GNUC_MINOR__) && defined(__GNUC_PATCHLEVEL__) |
| 36 | #define UPB_GNUC_MIN(x, y) \ |
| 37 | (__GNUC__ > (x) || __GNUC__ == (x) && __GNUC_MINOR__ >= (y)) |
| 38 | #else |
| 39 | #define UPB_GNUC_MIN(x, y) 0 |
| 40 | #endif |
| 41 | |
| 42 | #include <assert.h> |
| 43 | #include <setjmp.h> |
| 44 | #include <stdbool.h> |
Joshua Haberman | d3995ec | 2022-09-30 16:54:39 -0700 | [diff] [blame] | 45 | #include <stdint.h> |
Eric Salo | 8809a11 | 2022-11-21 13:01:06 -0800 | [diff] [blame] | 46 | #include <stdio.h> |
Joshua Haberman | 9abf6e2 | 2021-01-13 12:16:25 -0800 | [diff] [blame] | 47 | |
Adam Cozzette | 7d5592e | 2023-08-23 12:15:26 -0700 | [diff] [blame] | 48 | #ifndef UINTPTR_MAX |
| 49 | Error, UINTPTR_MAX is undefined |
| 50 | #endif |
| 51 | |
Joshua Haberman | 9abf6e2 | 2021-01-13 12:16:25 -0800 | [diff] [blame] | 52 | #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 Haberman | 9abf6e2 | 2021-01-13 12:16:25 -0800 | [diff] [blame] | 63 | #define UPB_MAPTYPE_STRING 0 |
| 64 | |
Eric Salo | 3f36a91 | 2022-12-05 14:12:25 -0800 | [diff] [blame] | 65 | // 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 Haberman | 9abf6e2 | 2021-01-13 12:16:25 -0800 | [diff] [blame] | 73 | #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 Salo | 3f36a91 | 2022-12-05 14:12:25 -0800 | [diff] [blame] | 81 | #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 Haberman | d3995ec | 2022-09-30 16:54:39 -0700 | [diff] [blame] | 89 | #define UPB_MALLOC_ALIGN 8 |
Joshua Haberman | 9abf6e2 | 2021-01-13 12:16:25 -0800 | [diff] [blame] | 90 | #define UPB_ALIGN_UP(size, align) (((size) + (align) - 1) / (align) * (align)) |
| 91 | #define UPB_ALIGN_DOWN(size, align) ((size) / (align) * (align)) |
Joshua Haberman | d3995ec | 2022-09-30 16:54:39 -0700 | [diff] [blame] | 92 | #define UPB_ALIGN_MALLOC(size) UPB_ALIGN_UP(size, UPB_MALLOC_ALIGN) |
Mike Kruskal | 232ecf4 | 2023-01-14 00:09:40 -0800 | [diff] [blame] | 93 | #ifdef __clang__ |
| 94 | #define UPB_ALIGN_OF(type) _Alignof(type) |
| 95 | #else |
Joshua Haberman | 9abf6e2 | 2021-01-13 12:16:25 -0800 | [diff] [blame] | 96 | #define UPB_ALIGN_OF(type) offsetof (struct { char c; type member; }, member) |
Mike Kruskal | 232ecf4 | 2023-01-14 00:09:40 -0800 | [diff] [blame] | 97 | #endif |
Joshua Haberman | 9abf6e2 | 2021-01-13 12:16:25 -0800 | [diff] [blame] | 98 | |
Protobuf Team Bot | e278550 | 2023-12-21 21:28:36 +0000 | [diff] [blame] | 99 | #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 Salo | 8809a11 | 2022-11-21 13:01:06 -0800 | [diff] [blame] | 106 | // Hints to the compiler about likely/unlikely branches. |
Joshua Haberman | 9abf6e2 | 2021-01-13 12:16:25 -0800 | [diff] [blame] | 107 | #if defined (__GNUC__) || defined(__clang__) |
Eric Salo | 8809a11 | 2022-11-21 13:01:06 -0800 | [diff] [blame] | 108 | #define UPB_LIKELY(x) __builtin_expect((bool)(x), 1) |
| 109 | #define UPB_UNLIKELY(x) __builtin_expect((bool)(x), 0) |
Joshua Haberman | 9abf6e2 | 2021-01-13 12:16:25 -0800 | [diff] [blame] | 110 | #else |
| 111 | #define UPB_LIKELY(x) (x) |
| 112 | #define UPB_UNLIKELY(x) (x) |
| 113 | #endif |
| 114 | |
Eric Salo | 8809a11 | 2022-11-21 13:01:06 -0800 | [diff] [blame] | 115 | // Macros for function attributes on compilers that support them. |
Joshua Haberman | 9abf6e2 | 2021-01-13 12:16:25 -0800 | [diff] [blame] | 116 | #ifdef __GNUC__ |
Protobuf Team Bot | 1d143b5 | 2024-01-25 20:29:43 +0000 | [diff] [blame] | 117 | #define UPB_FORCEINLINE __inline__ __attribute__((always_inline)) static |
Joshua Haberman | 9abf6e2 | 2021-01-13 12:16:25 -0800 | [diff] [blame] | 118 | #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 Bot | 1d143b5 | 2024-01-25 20:29:43 +0000 | [diff] [blame] | 123 | #define UPB_FORCEINLINE static |
Joshua Haberman | 9abf6e2 | 2021-01-13 12:16:25 -0800 | [diff] [blame] | 124 | #define UPB_NORETURN __declspec(noreturn) |
| 125 | #define UPB_PRINTF(str, first_vararg) |
| 126 | #else /* !defined(__GNUC__) */ |
Protobuf Team Bot | 1d143b5 | 2024-01-25 20:29:43 +0000 | [diff] [blame] | 127 | #define UPB_FORCEINLINE static |
Joshua Haberman | 9abf6e2 | 2021-01-13 12:16:25 -0800 | [diff] [blame] | 128 | #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 Salo | 8809a11 | 2022-11-21 13:01:06 -0800 | [diff] [blame] | 138 | // UPB_ASSUME(): in release mode, we tell the compiler to assume this is true. |
Joshua Haberman | 9abf6e2 | 2021-01-13 12:16:25 -0800 | [diff] [blame] | 139 | #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 Salo | 1050599 | 2022-12-12 12:16:36 -0800 | [diff] [blame] | 161 | #elif defined(_MSC_VER) |
| 162 | #define UPB_UNREACHABLE() \ |
| 163 | do { \ |
| 164 | assert(0); \ |
| 165 | __assume(0); \ |
| 166 | } while (0) |
Joshua Haberman | 9abf6e2 | 2021-01-13 12:16:25 -0800 | [diff] [blame] | 167 | #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 Salo | dfb7155 | 2023-03-22 12:35:09 -0700 | [diff] [blame] | 180 | #ifdef __GNUC__ |
| 181 | #define UPB_USE_C11_ATOMICS |
Deanna Garcia | c7d979d | 2023-04-14 17:22:13 -0700 | [diff] [blame] | 182 | #define UPB_ATOMIC(T) _Atomic(T) |
Eric Salo | dfb7155 | 2023-03-22 12:35:09 -0700 | [diff] [blame] | 183 | #else |
Deanna Garcia | c7d979d | 2023-04-14 17:22:13 -0700 | [diff] [blame] | 184 | #define UPB_ATOMIC(T) T |
Eric Salo | dfb7155 | 2023-03-22 12:35:09 -0700 | [diff] [blame] | 185 | #endif |
| 186 | |
Joshua Haberman | dd69a48 | 2021-05-17 22:40:33 -0700 | [diff] [blame] | 187 | /* UPB_PTRADD(ptr, ofs): add pointer while avoiding "NULL + 0" UB */ |
| 188 | #define UPB_PTRADD(ptr, ofs) ((ofs) ? (ptr) + (ofs) : (ptr)) |
| 189 | |
Deanna Garcia | c7d979d | 2023-04-14 17:22:13 -0700 | [diff] [blame] | 190 | #define UPB_PRIVATE(x) x##_dont_copy_me__upb_internal_use_only |
| 191 | |
Protobuf Team Bot | 07194fc | 2023-11-30 05:43:03 +0000 | [diff] [blame] | 192 | #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 Haberman | 9abf6e2 | 2021-01-13 12:16:25 -0800 | [diff] [blame] | 198 | /* Configure whether fasttable is switched on or not. *************************/ |
| 199 | |
Joshua Haberman | dd69a48 | 2021-05-17 22:40:33 -0700 | [diff] [blame] | 200 | #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 Haberman | 9abf6e2 | 2021-01-13 12:16:25 -0800 | [diff] [blame] | 229 | #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 Haberman | dd69a48 | 2021-05-17 22:40:33 -0700 | [diff] [blame] | 239 | #error fasttable is x86-64/ARM64 only and requires GCC or Clang. |
Joshua Haberman | 9abf6e2 | 2021-01-13 12:16:25 -0800 | [diff] [blame] | 240 | #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 Kruskal | 232ecf4 | 2023-01-14 00:09:40 -0800 | [diff] [blame] | 252 | * degrade to non-fasttable if the runtime or platform do not support it. */ |
| 253 | #if !UPB_FASTTABLE |
Joshua Haberman | 9abf6e2 | 2021-01-13 12:16:25 -0800 | [diff] [blame] | 254 | #define UPB_FASTTABLE_INIT(...) |
Mike Kruskal | 232ecf4 | 2023-01-14 00:09:40 -0800 | [diff] [blame] | 255 | #define UPB_FASTTABLE_MASK(mask) -1 |
Joshua Haberman | 9abf6e2 | 2021-01-13 12:16:25 -0800 | [diff] [blame] | 256 | #else |
| 257 | #define UPB_FASTTABLE_INIT(...) __VA_ARGS__ |
Mike Kruskal | 232ecf4 | 2023-01-14 00:09:40 -0800 | [diff] [blame] | 258 | #define UPB_FASTTABLE_MASK(mask) mask |
Joshua Haberman | 9abf6e2 | 2021-01-13 12:16:25 -0800 | [diff] [blame] | 259 | #endif |
| 260 | |
| 261 | #undef UPB_FASTTABLE_SUPPORTED |
| 262 | |
Joshua Haberman | d3995ec | 2022-09-30 16:54:39 -0700 | [diff] [blame] | 263 | /* ASAN poisoning (for arena). |
| 264 | * If using UPB from an interpreted language like Ruby, a build of the |
Joshua Haberman | 488b8b9 | 2022-09-30 18:07:16 -0700 | [diff] [blame] | 265 | * interpreter compiled with ASAN enabled must be used in order to get sane and |
Joshua Haberman | d3995ec | 2022-09-30 16:54:39 -0700 | [diff] [blame] | 266 | * expected behavior. |
| 267 | */ |
Joshua Haberman | 9abf6e2 | 2021-01-13 12:16:25 -0800 | [diff] [blame] | 268 | |
Sandy Zhang | e3b0943 | 2023-08-07 09:30:02 -0700 | [diff] [blame] | 269 | /* 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 Haberman | 9abf6e2 | 2021-01-13 12:16:25 -0800 | [diff] [blame] | 284 | #define UPB_ASAN 1 |
Sandy Zhang | e3b0943 | 2023-08-07 09:30:02 -0700 | [diff] [blame] | 285 | #define UPB_ASAN_GUARD_SIZE 32 |
Joshua Haberman | 9abf6e2 | 2021-01-13 12:16:25 -0800 | [diff] [blame] | 286 | #ifdef __cplusplus |
Adam Cozzette | 7d5592e | 2023-08-23 12:15:26 -0700 | [diff] [blame] | 287 | extern "C" { |
Joshua Haberman | 9abf6e2 | 2021-01-13 12:16:25 -0800 | [diff] [blame] | 288 | #endif |
| 289 | void __asan_poison_memory_region(void const volatile *addr, size_t size); |
| 290 | void __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 Zhang | e3b0943 | 2023-08-07 09:30:02 -0700 | [diff] [blame] | 300 | #define UPB_ASAN_GUARD_SIZE 0 |
Joshua Haberman | 9abf6e2 | 2021-01-13 12:16:25 -0800 | [diff] [blame] | 301 | #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 Haberman | dd69a48 | 2021-05-17 22:40:33 -0700 | [diff] [blame] | 305 | #endif |
| 306 | |
Joshua Haberman | 7ecf43f | 2022-03-14 13:11:29 -0700 | [diff] [blame] | 307 | /* Disable proto2 arena behavior (TEMPORARY) **********************************/ |
| 308 | |
Protobuf Team Bot | 5e8d7e5 | 2024-03-15 22:28:30 +0000 | [diff] [blame] | 309 | #ifdef UPB_DISABLE_CLOSED_ENUM_CHECKING |
| 310 | #define UPB_TREAT_CLOSED_ENUMS_LIKE_OPEN 1 |
Joshua Haberman | 7ecf43f | 2022-03-14 13:11:29 -0700 | [diff] [blame] | 311 | #else |
Protobuf Team Bot | 5e8d7e5 | 2024-03-15 22:28:30 +0000 | [diff] [blame] | 312 | #define UPB_TREAT_CLOSED_ENUMS_LIKE_OPEN 0 |
Joshua Haberman | 7ecf43f | 2022-03-14 13:11:29 -0700 | [diff] [blame] | 313 | #endif |
| 314 | |
Joshua Haberman | d3995ec | 2022-09-30 16:54:39 -0700 | [diff] [blame] | 315 | #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 Haberman | 9abf6e2 | 2021-01-13 12:16:25 -0800 | [diff] [blame] | 329 | |
Mike Kruskal | 232ecf4 | 2023-01-14 00:09:40 -0800 | [diff] [blame] | 330 | // 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 Bot | ce9dcc2 | 2023-11-03 22:38:26 +0000 | [diff] [blame] | 336 | #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 Kruskal | 232ecf4 | 2023-01-14 00:09:40 -0800 | [diff] [blame] | 340 | #else |
| 341 | #define UPB_DESC(sym) google_protobuf_##sym |
Protobuf Team Bot | ce9dcc2 | 2023-11-03 22:38:26 +0000 | [diff] [blame] | 342 | #define UPB_DESC_MINITABLE(sym) &google__protobuf__##sym##_msg_init |
Mike Kruskal | 232ecf4 | 2023-01-14 00:09:40 -0800 | [diff] [blame] | 343 | #endif |
| 344 | |
Protobuf Team Bot | 5d58cb8 | 2024-03-06 19:59:18 +0000 | [diff] [blame] | 345 | |
Protobuf Team Bot | bf7ac9f | 2024-06-04 17:32:11 +0000 | [diff] [blame] | 346 | // 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 Bot | 9f2893a | 2024-06-11 18:26:04 +0000 | [diff] [blame] | 377 | UPB_LINKARR_APPEND(name) type UPB_linkarr_internal_empty_##name[1] |
Protobuf Team Bot | bf7ac9f | 2024-06-04 17:32:11 +0000 | [diff] [blame] | 378 | #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 Bot | bbf5227 | 2024-06-11 23:07:36 +0000 | [diff] [blame] | 385 | __attribute__((retain, used, section("__DATA,__la_" #name))) |
Protobuf Team Bot | bf7ac9f | 2024-06-04 17:32:11 +0000 | [diff] [blame] | 386 | #define UPB_LINKARR_DECLARE(name, type) \ |
| 387 | extern type const __start_linkarr_##name __asm( \ |
Protobuf Team Bot | bbf5227 | 2024-06-11 23:07:36 +0000 | [diff] [blame] | 388 | "section$start$__DATA$__la_" #name); \ |
Protobuf Team Bot | bf7ac9f | 2024-06-04 17:32:11 +0000 | [diff] [blame] | 389 | extern type const __stop_linkarr_##name __asm( \ |
| 390 | "section$end$__DATA$" \ |
Protobuf Team Bot | bbf5227 | 2024-06-11 23:07:36 +0000 | [diff] [blame] | 391 | "__la_" #name); \ |
Protobuf Team Bot | 9f2893a | 2024-06-11 18:26:04 +0000 | [diff] [blame] | 392 | UPB_LINKARR_APPEND(name) type UPB_linkarr_internal_empty_##name[1] |
Protobuf Team Bot | bf7ac9f | 2024-06-04 17:32:11 +0000 | [diff] [blame] | 393 | #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 Salo | 8809a11 | 2022-11-21 13:01:06 -0800 | [diff] [blame] | 422 | #ifndef UPB_BASE_STATUS_H_ |
| 423 | #define UPB_BASE_STATUS_H_ |
| 424 | |
| 425 | #include <stdarg.h> |
Mike Kruskal | 9cf9db8 | 2022-11-04 21:22:31 -0700 | [diff] [blame] | 426 | |
| 427 | // Must be last. |
| 428 | |
Protobuf Team Bot | b931e79 | 2024-01-31 21:16:11 +0000 | [diff] [blame] | 429 | #define _kUpb_Status_MaxMessage 511 |
Eric Salo | 8809a11 | 2022-11-21 13:01:06 -0800 | [diff] [blame] | 430 | |
| 431 | typedef struct { |
| 432 | bool ok; |
| 433 | char msg[_kUpb_Status_MaxMessage]; // Error message; NULL-terminated. |
| 434 | } upb_Status; |
| 435 | |
Mike Kruskal | 9cf9db8 | 2022-11-04 21:22:31 -0700 | [diff] [blame] | 436 | #ifdef __cplusplus |
| 437 | extern "C" { |
| 438 | #endif |
| 439 | |
Eric Salo | 3f36a91 | 2022-12-05 14:12:25 -0800 | [diff] [blame] | 440 | UPB_API const char* upb_Status_ErrorMessage(const upb_Status* status); |
| 441 | UPB_API bool upb_Status_IsOk(const upb_Status* status); |
Mike Kruskal | 9cf9db8 | 2022-11-04 21:22:31 -0700 | [diff] [blame] | 442 | |
Eric Salo | 8809a11 | 2022-11-21 13:01:06 -0800 | [diff] [blame] | 443 | // These are no-op if |status| is NULL. |
Eric Salo | 3f36a91 | 2022-12-05 14:12:25 -0800 | [diff] [blame] | 444 | UPB_API void upb_Status_Clear(upb_Status* status); |
Eric Salo | 8809a11 | 2022-11-21 13:01:06 -0800 | [diff] [blame] | 445 | void upb_Status_SetErrorMessage(upb_Status* status, const char* msg); |
| 446 | void upb_Status_SetErrorFormat(upb_Status* status, const char* fmt, ...) |
| 447 | UPB_PRINTF(2, 3); |
| 448 | void upb_Status_VSetErrorFormat(upb_Status* status, const char* fmt, |
| 449 | va_list args) UPB_PRINTF(2, 0); |
| 450 | void upb_Status_VAppendErrorFormat(upb_Status* status, const char* fmt, |
| 451 | va_list args) UPB_PRINTF(2, 0); |
Mike Kruskal | 9cf9db8 | 2022-11-04 21:22:31 -0700 | [diff] [blame] | 452 | |
| 453 | #ifdef __cplusplus |
| 454 | } /* extern "C" */ |
| 455 | #endif |
| 456 | |
| 457 | |
Eric Salo | 8809a11 | 2022-11-21 13:01:06 -0800 | [diff] [blame] | 458 | #endif /* UPB_BASE_STATUS_H_ */ |
Mike Kruskal | 9cf9db8 | 2022-11-04 21:22:31 -0700 | [diff] [blame] | 459 | |
Protobuf Team Bot | 376ba2f | 2023-09-29 22:17:43 +0000 | [diff] [blame] | 460 | #ifndef UPB_GENERATED_CODE_SUPPORT_H_ |
| 461 | #define UPB_GENERATED_CODE_SUPPORT_H_ |
Joshua Haberman | d3995ec | 2022-09-30 16:54:39 -0700 | [diff] [blame] | 462 | |
Protobuf Team Bot | 376ba2f | 2023-09-29 22:17:43 +0000 | [diff] [blame] | 463 | // IWYU pragma: begin_exports |
Joshua Haberman | 9abf6e2 | 2021-01-13 12:16:25 -0800 | [diff] [blame] | 464 | |
Protobuf Team Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 465 | #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 Bot | 376ba2f | 2023-09-29 22:17:43 +0000 | [diff] [blame] | 486 | #ifndef UPB_MESSAGE_ACCESSORS_H_ |
| 487 | #define UPB_MESSAGE_ACCESSORS_H_ |
Protobuf Team Bot | 473d20d | 2023-09-15 22:27:16 +0000 | [diff] [blame] | 488 | |
Protobuf Team Bot | 54573a4 | 2023-11-21 14:47:34 +0000 | [diff] [blame] | 489 | #ifndef UPB_BASE_STRING_VIEW_H_ |
| 490 | #define UPB_BASE_STRING_VIEW_H_ |
Eric Salo | 8809a11 | 2022-11-21 13:01:06 -0800 | [diff] [blame] | 491 | |
Protobuf Team Bot | 54573a4 | 2023-11-21 14:47:34 +0000 | [diff] [blame] | 492 | #include <string.h> |
Protobuf Team Bot | 376ba2f | 2023-09-29 22:17:43 +0000 | [diff] [blame] | 493 | |
Protobuf Team Bot | 54573a4 | 2023-11-21 14:47:34 +0000 | [diff] [blame] | 494 | // Must be last. |
Protobuf Team Bot | 376ba2f | 2023-09-29 22:17:43 +0000 | [diff] [blame] | 495 | |
Protobuf Team Bot | 54573a4 | 2023-11-21 14:47:34 +0000 | [diff] [blame] | 496 | #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) |
| 503 | typedef struct { |
| 504 | const char* data; |
| 505 | size_t size; |
| 506 | } upb_StringView; |
Protobuf Team Bot | 54573a4 | 2023-11-21 14:47:34 +0000 | [diff] [blame] | 507 | |
| 508 | #ifdef __cplusplus |
| 509 | extern "C" { |
| 510 | #endif |
| 511 | |
| 512 | UPB_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 | |
| 520 | UPB_INLINE upb_StringView upb_StringView_FromString(const char* data) { |
| 521 | return upb_StringView_FromDataAndSize(data, strlen(data)); |
| 522 | } |
| 523 | |
| 524 | UPB_INLINE bool upb_StringView_IsEqual(upb_StringView a, upb_StringView b) { |
Protobuf Team Bot | ddc5406 | 2023-12-12 20:03:38 +0000 | [diff] [blame] | 525 | return (a.size == b.size) && (!a.size || !memcmp(a.data, b.data, a.size)); |
Protobuf Team Bot | 54573a4 | 2023-11-21 14:47:34 +0000 | [diff] [blame] | 526 | } |
| 527 | |
Protobuf Team Bot | 030ab8d | 2023-12-01 19:20:11 +0000 | [diff] [blame] | 528 | // LINT.ThenChange( |
Protobuf Team Bot | fd82df7 | 2024-01-29 20:24:42 +0000 | [diff] [blame] | 529 | // GoogleInternalName1, |
Protobuf Team Bot | 030ab8d | 2023-12-01 19:20:11 +0000 | [diff] [blame] | 530 | // //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 Bot | 54573a4 | 2023-11-21 14:47:34 +0000 | [diff] [blame] | 534 | #ifdef __cplusplus |
| 535 | } /* extern "C" */ |
| 536 | #endif |
| 537 | |
| 538 | |
| 539 | #endif /* UPB_BASE_STRING_VIEW_H_ */ |
Protobuf Team Bot | 376ba2f | 2023-09-29 22:17:43 +0000 | [diff] [blame] | 540 | |
Eric Salo | 8809a11 | 2022-11-21 13:01:06 -0800 | [diff] [blame] | 541 | /* 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 Haberman | dd69a48 | 2021-05-17 22:40:33 -0700 | [diff] [blame] | 546 | * |
Eric Salo | 8809a11 | 2022-11-21 13:01:06 -0800 | [diff] [blame] | 547 | * 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 Haberman | 9abf6e2 | 2021-01-13 12:16:25 -0800 | [diff] [blame] | 552 | |
Mike Kruskal | 9cf9db8 | 2022-11-04 21:22:31 -0700 | [diff] [blame] | 553 | #ifndef UPB_MEM_ARENA_H_ |
| 554 | #define UPB_MEM_ARENA_H_ |
Joshua Haberman | dd69a48 | 2021-05-17 22:40:33 -0700 | [diff] [blame] | 555 | |
Adam Cozzette | 7d5592e | 2023-08-23 12:15:26 -0700 | [diff] [blame] | 556 | #include <stddef.h> |
| 557 | #include <stdint.h> |
Joshua Haberman | 9abf6e2 | 2021-01-13 12:16:25 -0800 | [diff] [blame] | 558 | |
| 559 | |
Mike Kruskal | 9cf9db8 | 2022-11-04 21:22:31 -0700 | [diff] [blame] | 560 | #ifndef UPB_MEM_ALLOC_H_ |
| 561 | #define UPB_MEM_ALLOC_H_ |
Joshua Haberman | d3995ec | 2022-09-30 16:54:39 -0700 | [diff] [blame] | 562 | |
| 563 | // Must be last. |
| 564 | |
Joshua Haberman | 9abf6e2 | 2021-01-13 12:16:25 -0800 | [diff] [blame] | 565 | #ifdef __cplusplus |
| 566 | extern "C" { |
| 567 | #endif |
| 568 | |
Joshua Haberman | d3995ec | 2022-09-30 16:54:39 -0700 | [diff] [blame] | 569 | typedef struct upb_alloc upb_alloc; |
Joshua Haberman | 9abf6e2 | 2021-01-13 12:16:25 -0800 | [diff] [blame] | 570 | |
Joshua Haberman | d3995ec | 2022-09-30 16:54:39 -0700 | [diff] [blame] | 571 | /* 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. */ |
| 575 | typedef 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. */ |
| 584 | struct upb_alloc { |
| 585 | upb_alloc_func* func; |
| 586 | }; |
| 587 | |
| 588 | UPB_INLINE void* upb_malloc(upb_alloc* alloc, size_t size) { |
| 589 | UPB_ASSERT(alloc); |
| 590 | return alloc->func(alloc, NULL, 0, size); |
| 591 | } |
| 592 | |
| 593 | UPB_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 | |
| 599 | UPB_INLINE void upb_free(upb_alloc* alloc, void* ptr) { |
| 600 | UPB_ASSERT(alloc); |
| 601 | alloc->func(alloc, ptr, 0, 0); |
| 602 | } |
| 603 | |
Mike Kruskal | 9cf9db8 | 2022-11-04 21:22:31 -0700 | [diff] [blame] | 604 | // The global allocator used by upb. Uses the standard malloc()/free(). |
Joshua Haberman | d3995ec | 2022-09-30 16:54:39 -0700 | [diff] [blame] | 605 | |
| 606 | extern 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 | |
| 613 | UPB_INLINE void* upb_gmalloc(size_t size) { |
| 614 | return upb_malloc(&upb_alloc_global, size); |
| 615 | } |
| 616 | |
| 617 | UPB_INLINE void* upb_grealloc(void* ptr, size_t oldsize, size_t size) { |
| 618 | return upb_realloc(&upb_alloc_global, ptr, oldsize, size); |
| 619 | } |
| 620 | |
| 621 | UPB_INLINE void upb_gfree(void* ptr) { upb_free(&upb_alloc_global, ptr); } |
| 622 | |
| 623 | #ifdef __cplusplus |
| 624 | } /* extern "C" */ |
| 625 | #endif |
| 626 | |
| 627 | |
Mike Kruskal | 9cf9db8 | 2022-11-04 21:22:31 -0700 | [diff] [blame] | 628 | #endif /* UPB_MEM_ALLOC_H_ */ |
Joshua Haberman | d3995ec | 2022-09-30 16:54:39 -0700 | [diff] [blame] | 629 | |
Protobuf Team Bot | f75fe9e | 2023-12-19 22:41:49 +0000 | [diff] [blame] | 630 | #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 Bot | 6964e2c | 2023-12-21 15:42:16 +0000 | [diff] [blame] | 646 | // LINT.IfChange(upb_Arena) |
Protobuf Team Bot | f75fe9e | 2023-12-19 22:41:49 +0000 | [diff] [blame] | 647 | |
| 648 | struct upb_Arena { |
| 649 | char* UPB_ONLYBITS(ptr); |
| 650 | char* UPB_ONLYBITS(end); |
| 651 | }; |
| 652 | |
Protobuf Team Bot | 6964e2c | 2023-12-21 15:42:16 +0000 | [diff] [blame] | 653 | // LINT.ThenChange(//depot/google3/third_party/upb/bits/typescript/arena.ts:upb_Arena) |
Protobuf Team Bot | f75fe9e | 2023-12-19 22:41:49 +0000 | [diff] [blame] | 654 | |
| 655 | #ifdef __cplusplus |
| 656 | extern "C" { |
| 657 | #endif |
| 658 | |
| 659 | void UPB_PRIVATE(_upb_Arena_SwapIn)(struct upb_Arena* des, |
| 660 | const struct upb_Arena* src); |
| 661 | void UPB_PRIVATE(_upb_Arena_SwapOut)(struct upb_Arena* des, |
| 662 | const struct upb_Arena* src); |
| 663 | |
Protobuf Team Bot | 5640930 | 2024-02-12 16:52:47 +0000 | [diff] [blame] | 664 | // Returns whether |ptr| was allocated directly by |a| (so care must be used |
| 665 | // with fused arenas). |
| 666 | UPB_API bool UPB_ONLYBITS(_upb_Arena_Contains)(const struct upb_Arena* a, |
| 667 | void* ptr); |
| 668 | |
Protobuf Team Bot | f75fe9e | 2023-12-19 22:41:49 +0000 | [diff] [blame] | 669 | UPB_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 Bot | b3878b5 | 2024-02-08 21:50:53 +0000 | [diff] [blame] | 673 | UPB_API_INLINE void* upb_Arena_Malloc(struct upb_Arena* a, size_t size) { |
Protobuf Team Bot | f75fe9e | 2023-12-19 22:41:49 +0000 | [diff] [blame] | 674 | 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 Bot | b3878b5 | 2024-02-08 21:50:53 +0000 | [diff] [blame] | 693 | UPB_API_INLINE void* upb_Arena_Realloc(struct upb_Arena* a, void* ptr, |
| 694 | size_t oldsize, size_t size) { |
Protobuf Team Bot | f75fe9e | 2023-12-19 22:41:49 +0000 | [diff] [blame] | 695 | 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 Bot | b3878b5 | 2024-02-08 21:50:53 +0000 | [diff] [blame] | 710 | void* ret = upb_Arena_Malloc(a, size); |
Protobuf Team Bot | f75fe9e | 2023-12-19 22:41:49 +0000 | [diff] [blame] | 711 | |
| 712 | if (ret && oldsize > 0) { |
| 713 | memcpy(ret, ptr, UPB_MIN(oldsize, size)); |
| 714 | } |
| 715 | |
| 716 | return ret; |
| 717 | } |
| 718 | |
Protobuf Team Bot | b3878b5 | 2024-02-08 21:50:53 +0000 | [diff] [blame] | 719 | UPB_API_INLINE void upb_Arena_ShrinkLast(struct upb_Arena* a, void* ptr, |
| 720 | size_t oldsize, size_t size) { |
Protobuf Team Bot | f75fe9e | 2023-12-19 22:41:49 +0000 | [diff] [blame] | 721 | 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 Haberman | d3995ec | 2022-09-30 16:54:39 -0700 | [diff] [blame] | 737 | // Must be last. |
| 738 | |
Joshua Haberman | d3995ec | 2022-09-30 16:54:39 -0700 | [diff] [blame] | 739 | typedef struct upb_Arena upb_Arena; |
Joshua Haberman | 9abf6e2 | 2021-01-13 12:16:25 -0800 | [diff] [blame] | 740 | |
Eric Salo | 8809a11 | 2022-11-21 13:01:06 -0800 | [diff] [blame] | 741 | #ifdef __cplusplus |
| 742 | extern "C" { |
| 743 | #endif |
| 744 | |
Mike Kruskal | 3bc5049 | 2022-12-01 13:34:12 -0800 | [diff] [blame] | 745 | // 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 Salo | 3f36a91 | 2022-12-05 14:12:25 -0800 | [diff] [blame] | 748 | UPB_API upb_Arena* upb_Arena_Init(void* mem, size_t n, upb_alloc* alloc); |
Mike Kruskal | 3bc5049 | 2022-12-01 13:34:12 -0800 | [diff] [blame] | 749 | |
Eric Salo | 3f36a91 | 2022-12-05 14:12:25 -0800 | [diff] [blame] | 750 | UPB_API void upb_Arena_Free(upb_Arena* a); |
Eric Salo | 3f36a91 | 2022-12-05 14:12:25 -0800 | [diff] [blame] | 751 | UPB_API bool upb_Arena_Fuse(upb_Arena* a, upb_Arena* b); |
| 752 | |
Protobuf Team Bot | 3d597c2 | 2023-12-13 04:04:17 +0000 | [diff] [blame] | 753 | bool upb_Arena_IncRefFor(upb_Arena* a, const void* owner); |
| 754 | void upb_Arena_DecRefFor(upb_Arena* a, const void* owner); |
Protobuf Team Bot | 777d6a9 | 2023-10-06 23:52:49 +0000 | [diff] [blame] | 755 | |
Protobuf Team Bot | a3c33a8 | 2024-02-13 21:14:13 +0000 | [diff] [blame] | 756 | size_t upb_Arena_SpaceAllocated(upb_Arena* a, size_t* fused_count); |
Protobuf Team Bot | 3d597c2 | 2023-12-13 04:04:17 +0000 | [diff] [blame] | 757 | uint32_t upb_Arena_DebugRefCount(upb_Arena* a); |
| 758 | |
Protobuf Team Bot | f75fe9e | 2023-12-19 22:41:49 +0000 | [diff] [blame] | 759 | UPB_API_INLINE upb_Arena* upb_Arena_New(void) { |
| 760 | return upb_Arena_Init(NULL, 0, &upb_alloc_global); |
Joshua Haberman | d3995ec | 2022-09-30 16:54:39 -0700 | [diff] [blame] | 761 | } |
| 762 | |
Protobuf Team Bot | b3878b5 | 2024-02-08 21:50:53 +0000 | [diff] [blame] | 763 | UPB_API_INLINE void* upb_Arena_Malloc(struct upb_Arena* a, size_t size); |
Eric Salo | 8809a11 | 2022-11-21 13:01:06 -0800 | [diff] [blame] | 764 | |
Protobuf Team Bot | f75fe9e | 2023-12-19 22:41:49 +0000 | [diff] [blame] | 765 | UPB_API_INLINE void* upb_Arena_Realloc(upb_Arena* a, void* ptr, size_t oldsize, |
Protobuf Team Bot | b3878b5 | 2024-02-08 21:50:53 +0000 | [diff] [blame] | 766 | size_t size); |
Joshua Haberman | d3995ec | 2022-09-30 16:54:39 -0700 | [diff] [blame] | 767 | |
Joshua Haberman | d3995ec | 2022-09-30 16:54:39 -0700 | [diff] [blame] | 768 | // 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 Salo | 3f36a91 | 2022-12-05 14:12:25 -0800 | [diff] [blame] | 772 | UPB_API_INLINE void upb_Arena_ShrinkLast(upb_Arena* a, void* ptr, |
Protobuf Team Bot | b3878b5 | 2024-02-08 21:50:53 +0000 | [diff] [blame] | 773 | size_t oldsize, size_t size); |
Joshua Haberman | d3995ec | 2022-09-30 16:54:39 -0700 | [diff] [blame] | 774 | |
Protobuf Team Bot | fb08bca | 2024-03-14 15:21:13 +0000 | [diff] [blame] | 775 | #ifdef UPB_TRACING_ENABLED |
| 776 | void 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 Haberman | d3995ec | 2022-09-30 16:54:39 -0700 | [diff] [blame] | 783 | #ifdef __cplusplus |
| 784 | } /* extern "C" */ |
| 785 | #endif |
| 786 | |
| 787 | |
Mike Kruskal | 9cf9db8 | 2022-11-04 21:22:31 -0700 | [diff] [blame] | 788 | #endif /* UPB_MEM_ARENA_H_ */ |
Joshua Haberman | d3995ec | 2022-09-30 16:54:39 -0700 | [diff] [blame] | 789 | |
Protobuf Team Bot | 54573a4 | 2023-11-21 14:47:34 +0000 | [diff] [blame] | 790 | #ifndef UPB_MESSAGE_ARRAY_H_ |
| 791 | #define UPB_MESSAGE_ARRAY_H_ |
| 792 | |
| 793 | #include <stddef.h> |
| 794 | |
| 795 | |
Protobuf Team Bot | 4d3a98c | 2024-05-08 01:37:14 +0000 | [diff] [blame] | 796 | #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. |
| 805 | typedef 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. |
| 820 | typedef 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. |
| 827 | typedef 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 |
| 851 | extern "C" { |
| 852 | #endif |
| 853 | |
| 854 | // Convert from upb_FieldType to upb_CType |
| 855 | UPB_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 | |
| 881 | UPB_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 Bot | 81e5433 | 2024-01-11 21:04:07 +0000 | [diff] [blame] | 899 | #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 |
| 913 | extern "C" { |
| 914 | #endif |
| 915 | |
Protobuf Team Bot | fd82df7 | 2024-01-29 20:24:42 +0000 | [diff] [blame] | 916 | // LINT.IfChange(upb_Array) |
| 917 | |
Protobuf Team Bot | 81e5433 | 2024-01-11 21:04:07 +0000 | [diff] [blame] | 918 | // Our internal representation for repeated fields. |
| 919 | struct 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 Bot | 886a0b1 | 2024-01-26 21:23:01 +0000 | [diff] [blame] | 926 | // Bit #2 contains the frozen/immutable flag. |
Protobuf Team Bot | 81e5433 | 2024-01-11 21:04:07 +0000 | [diff] [blame] | 927 | 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 Bot | 886a0b1 | 2024-01-26 21:23:01 +0000 | [diff] [blame] | 933 | UPB_INLINE void UPB_PRIVATE(_upb_Array_ShallowFreeze)(struct upb_Array* arr) { |
| 934 | arr->UPB_ONLYBITS(data) |= _UPB_ARRAY_MASK_IMM; |
| 935 | } |
| 936 | |
Protobuf Team Bot | b3878b5 | 2024-02-08 21:50:53 +0000 | [diff] [blame] | 937 | UPB_API_INLINE bool upb_Array_IsFrozen(const struct upb_Array* arr) { |
Protobuf Team Bot | 886a0b1 | 2024-01-26 21:23:01 +0000 | [diff] [blame] | 938 | return (arr->UPB_ONLYBITS(data) & _UPB_ARRAY_MASK_IMM) != 0; |
| 939 | } |
| 940 | |
Protobuf Team Bot | 81e5433 | 2024-01-11 21:04:07 +0000 | [diff] [blame] | 941 | UPB_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 | |
| 949 | UPB_INLINE size_t |
| 950 | UPB_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 Bot | b3878b5 | 2024-02-08 21:50:53 +0000 | [diff] [blame] | 956 | UPB_API_INLINE const void* upb_Array_DataPtr(const struct upb_Array* array) { |
Protobuf Team Bot | 81e5433 | 2024-01-11 21:04:07 +0000 | [diff] [blame] | 957 | 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 Bot | b3878b5 | 2024-02-08 21:50:53 +0000 | [diff] [blame] | 961 | UPB_API_INLINE void* upb_Array_MutableDataPtr(struct upb_Array* array) { |
| 962 | return (void*)upb_Array_DataPtr(array); |
Protobuf Team Bot | 81e5433 | 2024-01-11 21:04:07 +0000 | [diff] [blame] | 963 | } |
| 964 | |
| 965 | UPB_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. |
| 983 | bool UPB_PRIVATE(_upb_Array_Realloc)(struct upb_Array* array, size_t min_size, |
| 984 | upb_Arena* arena); |
| 985 | |
Protobuf Team Bot | 4b6de0f | 2024-03-29 19:09:40 +0000 | [diff] [blame] | 986 | UPB_API_INLINE bool upb_Array_Reserve(struct upb_Array* array, size_t size, |
| 987 | upb_Arena* arena) { |
Protobuf Team Bot | b3878b5 | 2024-02-08 21:50:53 +0000 | [diff] [blame] | 988 | UPB_ASSERT(!upb_Array_IsFrozen(array)); |
Protobuf Team Bot | 81e5433 | 2024-01-11 21:04:07 +0000 | [diff] [blame] | 989 | 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. |
| 995 | UPB_INLINE bool UPB_PRIVATE(_upb_Array_ResizeUninitialized)( |
| 996 | struct upb_Array* array, size_t size, upb_Arena* arena) { |
Protobuf Team Bot | b3878b5 | 2024-02-08 21:50:53 +0000 | [diff] [blame] | 997 | UPB_ASSERT(!upb_Array_IsFrozen(array)); |
Protobuf Team Bot | 81e5433 | 2024-01-11 21:04:07 +0000 | [diff] [blame] | 998 | UPB_ASSERT(size <= array->UPB_ONLYBITS(size) || |
| 999 | arena); // Allow NULL arena when shrinking. |
Protobuf Team Bot | 4b6de0f | 2024-03-29 19:09:40 +0000 | [diff] [blame] | 1000 | if (!upb_Array_Reserve(array, size, arena)) return false; |
Protobuf Team Bot | 81e5433 | 2024-01-11 21:04:07 +0000 | [diff] [blame] | 1001 | 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. |
| 1008 | UPB_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 Bot | b3878b5 | 2024-02-08 21:50:53 +0000 | [diff] [blame] | 1011 | UPB_ASSERT(!upb_Array_IsFrozen(array)); |
Protobuf Team Bot | 81e5433 | 2024-01-11 21:04:07 +0000 | [diff] [blame] | 1012 | UPB_ASSERT(i < array->UPB_ONLYBITS(size)); |
| 1013 | UPB_ASSERT(elem_size == 1U << UPB_PRIVATE(_upb_Array_ElemSizeLg2)(array)); |
Protobuf Team Bot | b3878b5 | 2024-02-08 21:50:53 +0000 | [diff] [blame] | 1014 | char* arr_data = (char*)upb_Array_MutableDataPtr(array); |
Protobuf Team Bot | 81e5433 | 2024-01-11 21:04:07 +0000 | [diff] [blame] | 1015 | memcpy(arr_data + (i * elem_size), data, elem_size); |
| 1016 | } |
| 1017 | |
Protobuf Team Bot | b3878b5 | 2024-02-08 21:50:53 +0000 | [diff] [blame] | 1018 | UPB_API_INLINE size_t upb_Array_Size(const struct upb_Array* arr) { |
Protobuf Team Bot | 81e5433 | 2024-01-11 21:04:07 +0000 | [diff] [blame] | 1019 | return arr->UPB_ONLYBITS(size); |
| 1020 | } |
| 1021 | |
Protobuf Team Bot | fd82df7 | 2024-01-29 20:24:42 +0000 | [diff] [blame] | 1022 | // LINT.ThenChange(GoogleInternalName0) |
Protobuf Team Bot | 81e5433 | 2024-01-11 21:04:07 +0000 | [diff] [blame] | 1023 | |
| 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 Bot | 473d20d | 2023-09-15 22:27:16 +0000 | [diff] [blame] | 1035 | // Users should include array.h or map.h instead. |
Protobuf Team Bot | 376ba2f | 2023-09-29 22:17:43 +0000 | [diff] [blame] | 1036 | // IWYU pragma: private, include "upb/message/array.h" |
Protobuf Team Bot | 473d20d | 2023-09-15 22:27:16 +0000 | [diff] [blame] | 1037 | |
| 1038 | #ifndef UPB_MESSAGE_VALUE_H_ |
| 1039 | #define UPB_MESSAGE_VALUE_H_ |
| 1040 | |
| 1041 | #include <stdint.h> |
| 1042 | |
Protobuf Team Bot | 473d20d | 2023-09-15 22:27:16 +0000 | [diff] [blame] | 1043 | |
Protobuf Team Bot | e1253cd | 2024-01-08 23:09:09 +0000 | [diff] [blame] | 1044 | typedef 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 Bot | 473d20d | 2023-09-15 22:27:16 +0000 | [diff] [blame] | 1056 | |
Protobuf Team Bot | e1253cd | 2024-01-08 23:09:09 +0000 | [diff] [blame] | 1057 | // 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 Bot | 7c68721 | 2023-11-14 03:01:42 +0000 | [diff] [blame] | 1063 | |
Protobuf Team Bot | e1253cd | 2024-01-08 23:09:09 +0000 | [diff] [blame] | 1064 | typedef 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 Bot | dcc1f61 | 2023-09-05 21:56:25 +0000 | [diff] [blame] | 1071 | |
Protobuf Team Bot | e1253cd | 2024-01-08 23:09:09 +0000 | [diff] [blame] | 1072 | #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 |
| 1095 | extern "C" { |
| 1096 | #endif |
| 1097 | |
| 1098 | // Return the log2 of the storage size in bytes for a upb_CType |
| 1099 | UPB_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 |
| 1119 | UPB_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) |
| 1155 | struct 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 Bot | b3878b5 | 2024-02-08 21:50:53 +0000 | [diff] [blame] | 1170 | #define kUpb_NoSub ((uint16_t) - 1) |
Protobuf Team Bot | e1253cd | 2024-01-08 23:09:09 +0000 | [diff] [blame] | 1171 | |
| 1172 | typedef 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. |
| 1182 | typedef 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. |
| 1194 | typedef 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 |
| 1208 | extern "C" { |
| 1209 | #endif |
| 1210 | |
| 1211 | UPB_INLINE upb_FieldMode |
| 1212 | UPB_PRIVATE(_upb_MiniTableField_Mode)(const struct upb_MiniTableField* f) { |
| 1213 | return (upb_FieldMode)(f->UPB_ONLYBITS(mode) & kUpb_FieldMode_Mask); |
| 1214 | } |
| 1215 | |
| 1216 | UPB_INLINE upb_FieldRep |
| 1217 | UPB_PRIVATE(_upb_MiniTableField_GetRep)(const struct upb_MiniTableField* f) { |
| 1218 | return (upb_FieldRep)(f->UPB_ONLYBITS(mode) >> kUpb_FieldRep_Shift); |
| 1219 | } |
| 1220 | |
Protobuf Team Bot | b3878b5 | 2024-02-08 21:50:53 +0000 | [diff] [blame] | 1221 | UPB_API_INLINE bool upb_MiniTableField_IsArray( |
Protobuf Team Bot | e1253cd | 2024-01-08 23:09:09 +0000 | [diff] [blame] | 1222 | const struct upb_MiniTableField* f) { |
| 1223 | return UPB_PRIVATE(_upb_MiniTableField_Mode)(f) == kUpb_FieldMode_Array; |
| 1224 | } |
| 1225 | |
Protobuf Team Bot | b3878b5 | 2024-02-08 21:50:53 +0000 | [diff] [blame] | 1226 | UPB_API_INLINE bool upb_MiniTableField_IsMap( |
Protobuf Team Bot | e1253cd | 2024-01-08 23:09:09 +0000 | [diff] [blame] | 1227 | const struct upb_MiniTableField* f) { |
| 1228 | return UPB_PRIVATE(_upb_MiniTableField_Mode)(f) == kUpb_FieldMode_Map; |
| 1229 | } |
| 1230 | |
Protobuf Team Bot | b3878b5 | 2024-02-08 21:50:53 +0000 | [diff] [blame] | 1231 | UPB_API_INLINE bool upb_MiniTableField_IsScalar( |
Protobuf Team Bot | e1253cd | 2024-01-08 23:09:09 +0000 | [diff] [blame] | 1232 | const struct upb_MiniTableField* f) { |
| 1233 | return UPB_PRIVATE(_upb_MiniTableField_Mode)(f) == kUpb_FieldMode_Scalar; |
| 1234 | } |
| 1235 | |
| 1236 | UPB_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 Bot | b3878b5 | 2024-02-08 21:50:53 +0000 | [diff] [blame] | 1241 | UPB_API_INLINE bool upb_MiniTableField_IsExtension( |
Protobuf Team Bot | e1253cd | 2024-01-08 23:09:09 +0000 | [diff] [blame] | 1242 | const struct upb_MiniTableField* f) { |
| 1243 | return (f->UPB_ONLYBITS(mode) & kUpb_LabelFlags_IsExtension) != 0; |
| 1244 | } |
| 1245 | |
Protobuf Team Bot | b3878b5 | 2024-02-08 21:50:53 +0000 | [diff] [blame] | 1246 | UPB_API_INLINE bool upb_MiniTableField_IsPacked( |
Protobuf Team Bot | e1253cd | 2024-01-08 23:09:09 +0000 | [diff] [blame] | 1247 | const struct upb_MiniTableField* f) { |
| 1248 | return (f->UPB_ONLYBITS(mode) & kUpb_LabelFlags_IsPacked) != 0; |
| 1249 | } |
| 1250 | |
Protobuf Team Bot | b3878b5 | 2024-02-08 21:50:53 +0000 | [diff] [blame] | 1251 | UPB_API_INLINE upb_FieldType |
| 1252 | upb_MiniTableField_Type(const struct upb_MiniTableField* f) { |
Protobuf Team Bot | e1253cd | 2024-01-08 23:09:09 +0000 | [diff] [blame] | 1253 | 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 Bot | b3878b5 | 2024-02-08 21:50:53 +0000 | [diff] [blame] | 1262 | UPB_API_INLINE |
| 1263 | upb_CType upb_MiniTableField_CType(const struct upb_MiniTableField* f) { |
| 1264 | return upb_FieldType_CType(upb_MiniTableField_Type(f)); |
Protobuf Team Bot | e1253cd | 2024-01-08 23:09:09 +0000 | [diff] [blame] | 1265 | } |
| 1266 | |
| 1267 | UPB_INLINE bool UPB_PRIVATE(_upb_MiniTableField_HasHasbit)( |
| 1268 | const struct upb_MiniTableField* f) { |
| 1269 | return f->presence > 0; |
| 1270 | } |
| 1271 | |
| 1272 | UPB_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 | |
| 1279 | UPB_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 Bot | b3878b5 | 2024-02-08 21:50:53 +0000 | [diff] [blame] | 1286 | UPB_API_INLINE bool upb_MiniTableField_IsClosedEnum( |
Protobuf Team Bot | e1253cd | 2024-01-08 23:09:09 +0000 | [diff] [blame] | 1287 | const struct upb_MiniTableField* f) { |
| 1288 | return f->UPB_PRIVATE(descriptortype) == kUpb_FieldType_Enum; |
| 1289 | } |
| 1290 | |
Protobuf Team Bot | 8958768 | 2024-02-29 17:19:51 +0000 | [diff] [blame] | 1291 | UPB_API_INLINE bool upb_MiniTableField_IsInOneof( |
Protobuf Team Bot | e1253cd | 2024-01-08 23:09:09 +0000 | [diff] [blame] | 1292 | const struct upb_MiniTableField* f) { |
| 1293 | return f->presence < 0; |
| 1294 | } |
| 1295 | |
Protobuf Team Bot | b3878b5 | 2024-02-08 21:50:53 +0000 | [diff] [blame] | 1296 | UPB_API_INLINE bool upb_MiniTableField_IsSubMessage( |
Protobuf Team Bot | e1253cd | 2024-01-08 23:09:09 +0000 | [diff] [blame] | 1297 | 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 Bot | b3878b5 | 2024-02-08 21:50:53 +0000 | [diff] [blame] | 1302 | UPB_API_INLINE bool upb_MiniTableField_HasPresence( |
Protobuf Team Bot | e1253cd | 2024-01-08 23:09:09 +0000 | [diff] [blame] | 1303 | const struct upb_MiniTableField* f) { |
Protobuf Team Bot | b3878b5 | 2024-02-08 21:50:53 +0000 | [diff] [blame] | 1304 | if (upb_MiniTableField_IsExtension(f)) { |
| 1305 | return upb_MiniTableField_IsScalar(f); |
Protobuf Team Bot | e1253cd | 2024-01-08 23:09:09 +0000 | [diff] [blame] | 1306 | } else { |
| 1307 | return f->presence != 0; |
| 1308 | } |
| 1309 | } |
| 1310 | |
Protobuf Team Bot | b3878b5 | 2024-02-08 21:50:53 +0000 | [diff] [blame] | 1311 | UPB_API_INLINE uint32_t |
| 1312 | upb_MiniTableField_Number(const struct upb_MiniTableField* f) { |
Protobuf Team Bot | e1253cd | 2024-01-08 23:09:09 +0000 | [diff] [blame] | 1313 | return f->UPB_ONLYBITS(number); |
| 1314 | } |
| 1315 | |
| 1316 | UPB_INLINE uint16_t |
| 1317 | UPB_PRIVATE(_upb_MiniTableField_Offset)(const struct upb_MiniTableField* f) { |
| 1318 | return f->UPB_ONLYBITS(offset); |
| 1319 | } |
| 1320 | |
| 1321 | UPB_INLINE size_t UPB_PRIVATE(_upb_MiniTableField_OneofOffset)( |
| 1322 | const struct upb_MiniTableField* f) { |
Protobuf Team Bot | b3878b5 | 2024-02-08 21:50:53 +0000 | [diff] [blame] | 1323 | UPB_ASSERT(upb_MiniTableField_IsInOneof(f)); |
Protobuf Team Bot | e1253cd | 2024-01-08 23:09:09 +0000 | [diff] [blame] | 1324 | return ~(ptrdiff_t)f->presence; |
| 1325 | } |
| 1326 | |
| 1327 | UPB_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 Bot | b3878b5 | 2024-02-08 21:50:53 +0000 | [diff] [blame] | 1331 | UPB_ASSUME(upb_MiniTableField_IsArray(f)); |
Protobuf Team Bot | e1253cd | 2024-01-08 23:09:09 +0000 | [diff] [blame] | 1332 | UPB_ASSUME(f->presence == 0); |
| 1333 | } |
| 1334 | |
| 1335 | UPB_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 Bot | b3878b5 | 2024-02-08 21:50:53 +0000 | [diff] [blame] | 1339 | UPB_ASSUME(upb_MiniTableField_IsMap(f)); |
Protobuf Team Bot | e1253cd | 2024-01-08 23:09:09 +0000 | [diff] [blame] | 1340 | UPB_ASSUME(f->presence == 0); |
| 1341 | } |
| 1342 | |
| 1343 | UPB_INLINE size_t UPB_PRIVATE(_upb_MiniTableField_ElemSizeLg2)( |
| 1344 | const struct upb_MiniTableField* f) { |
Protobuf Team Bot | b3878b5 | 2024-02-08 21:50:53 +0000 | [diff] [blame] | 1345 | const upb_FieldType field_type = upb_MiniTableField_Type(f); |
Protobuf Team Bot | e1253cd | 2024-01-08 23:09:09 +0000 | [diff] [blame] | 1346 | 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 | |
| 1360 | typedef struct upb_MiniTableField upb_MiniTableField; |
| 1361 | |
| 1362 | #ifdef __cplusplus |
| 1363 | extern "C" { |
| 1364 | #endif |
| 1365 | |
Protobuf Team Bot | b3878b5 | 2024-02-08 21:50:53 +0000 | [diff] [blame] | 1366 | UPB_API_INLINE upb_CType upb_MiniTableField_CType(const upb_MiniTableField* f); |
Protobuf Team Bot | e1253cd | 2024-01-08 23:09:09 +0000 | [diff] [blame] | 1367 | |
Protobuf Team Bot | b3878b5 | 2024-02-08 21:50:53 +0000 | [diff] [blame] | 1368 | UPB_API_INLINE bool upb_MiniTableField_HasPresence(const upb_MiniTableField* f); |
Protobuf Team Bot | e1253cd | 2024-01-08 23:09:09 +0000 | [diff] [blame] | 1369 | |
Protobuf Team Bot | b3878b5 | 2024-02-08 21:50:53 +0000 | [diff] [blame] | 1370 | UPB_API_INLINE bool upb_MiniTableField_IsArray(const upb_MiniTableField* f); |
Protobuf Team Bot | e1253cd | 2024-01-08 23:09:09 +0000 | [diff] [blame] | 1371 | |
| 1372 | UPB_API_INLINE bool upb_MiniTableField_IsClosedEnum( |
Protobuf Team Bot | b3878b5 | 2024-02-08 21:50:53 +0000 | [diff] [blame] | 1373 | const upb_MiniTableField* f); |
Protobuf Team Bot | e1253cd | 2024-01-08 23:09:09 +0000 | [diff] [blame] | 1374 | |
Protobuf Team Bot | b3878b5 | 2024-02-08 21:50:53 +0000 | [diff] [blame] | 1375 | UPB_API_INLINE bool upb_MiniTableField_IsExtension(const upb_MiniTableField* f); |
Protobuf Team Bot | e1253cd | 2024-01-08 23:09:09 +0000 | [diff] [blame] | 1376 | |
Protobuf Team Bot | b3878b5 | 2024-02-08 21:50:53 +0000 | [diff] [blame] | 1377 | UPB_API_INLINE bool upb_MiniTableField_IsInOneof(const upb_MiniTableField* f); |
Protobuf Team Bot | e1253cd | 2024-01-08 23:09:09 +0000 | [diff] [blame] | 1378 | |
Protobuf Team Bot | b3878b5 | 2024-02-08 21:50:53 +0000 | [diff] [blame] | 1379 | UPB_API_INLINE bool upb_MiniTableField_IsMap(const upb_MiniTableField* f); |
Protobuf Team Bot | e1253cd | 2024-01-08 23:09:09 +0000 | [diff] [blame] | 1380 | |
Protobuf Team Bot | b3878b5 | 2024-02-08 21:50:53 +0000 | [diff] [blame] | 1381 | UPB_API_INLINE bool upb_MiniTableField_IsPacked(const upb_MiniTableField* f); |
Protobuf Team Bot | e1253cd | 2024-01-08 23:09:09 +0000 | [diff] [blame] | 1382 | |
Protobuf Team Bot | b3878b5 | 2024-02-08 21:50:53 +0000 | [diff] [blame] | 1383 | UPB_API_INLINE bool upb_MiniTableField_IsScalar(const upb_MiniTableField* f); |
Protobuf Team Bot | e1253cd | 2024-01-08 23:09:09 +0000 | [diff] [blame] | 1384 | |
| 1385 | UPB_API_INLINE bool upb_MiniTableField_IsSubMessage( |
Protobuf Team Bot | b3878b5 | 2024-02-08 21:50:53 +0000 | [diff] [blame] | 1386 | const upb_MiniTableField* f); |
Protobuf Team Bot | e1253cd | 2024-01-08 23:09:09 +0000 | [diff] [blame] | 1387 | |
Protobuf Team Bot | b3878b5 | 2024-02-08 21:50:53 +0000 | [diff] [blame] | 1388 | UPB_API_INLINE uint32_t upb_MiniTableField_Number(const upb_MiniTableField* f); |
Protobuf Team Bot | e1253cd | 2024-01-08 23:09:09 +0000 | [diff] [blame] | 1389 | |
| 1390 | UPB_API_INLINE upb_FieldType |
Protobuf Team Bot | b3878b5 | 2024-02-08 21:50:53 +0000 | [diff] [blame] | 1391 | upb_MiniTableField_Type(const upb_MiniTableField* f); |
Protobuf Team Bot | e1253cd | 2024-01-08 23:09:09 +0000 | [diff] [blame] | 1392 | |
| 1393 | #ifdef __cplusplus |
| 1394 | } /* extern "C" */ |
| 1395 | #endif |
| 1396 | |
| 1397 | |
| 1398 | #endif /* UPB_MINI_TABLE_FIELD_H_ */ |
| 1399 | |
Protobuf Team Bot | 886a0b1 | 2024-01-26 21:23:01 +0000 | [diff] [blame] | 1400 | #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 | |
| 1417 | struct 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 |
| 1424 | extern "C" { |
| 1425 | #endif |
| 1426 | |
Protobuf Team Bot | b3878b5 | 2024-02-08 21:50:53 +0000 | [diff] [blame] | 1427 | UPB_API_INLINE bool upb_MiniTableEnum_CheckValue( |
Protobuf Team Bot | 886a0b1 | 2024-01-26 21:23:01 +0000 | [diff] [blame] | 1428 | 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 | |
| 1461 | typedef struct upb_MiniTableEnum upb_MiniTableEnum; |
| 1462 | |
| 1463 | #ifdef __cplusplus |
| 1464 | extern "C" { |
| 1465 | #endif |
| 1466 | |
| 1467 | // Validates enum value against range defined by enum mini table. |
Protobuf Team Bot | b3878b5 | 2024-02-08 21:50:53 +0000 | [diff] [blame] | 1468 | UPB_API_INLINE bool upb_MiniTableEnum_CheckValue(const upb_MiniTableEnum* e, |
| 1469 | uint32_t val); |
Protobuf Team Bot | 886a0b1 | 2024-01-26 21:23:01 +0000 | [diff] [blame] | 1470 | |
| 1471 | #ifdef __cplusplus |
| 1472 | } /* extern "C" */ |
| 1473 | #endif |
| 1474 | |
| 1475 | |
| 1476 | #endif /* UPB_MINI_TABLE_ENUM_H_ */ |
| 1477 | |
Protobuf Team Bot | e1253cd | 2024-01-08 23:09:09 +0000 | [diff] [blame] | 1478 | #ifndef UPB_MINI_TABLE_INTERNAL_MESSAGE_H_ |
| 1479 | #define UPB_MINI_TABLE_INTERNAL_MESSAGE_H_ |
| 1480 | |
Protobuf Team Bot | d1cf09a | 2024-04-19 22:43:34 +0000 | [diff] [blame] | 1481 | #include <stddef.h> |
Protobuf Team Bot | e1253cd | 2024-01-08 23:09:09 +0000 | [diff] [blame] | 1482 | #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 Bot | 532f0c2 | 2024-06-05 03:21:24 +0000 | [diff] [blame] | 1490 | typedef union { |
| 1491 | const struct upb_MiniTable* const* UPB_PRIVATE(submsg); |
| 1492 | const struct upb_MiniTableEnum* UPB_PRIVATE(subenum); |
| 1493 | } upb_MiniTableSubInternal; |
| 1494 | |
Protobuf Team Bot | e1253cd | 2024-01-08 23:09:09 +0000 | [diff] [blame] | 1495 | union upb_MiniTableSub { |
| 1496 | const struct upb_MiniTable* UPB_PRIVATE(submsg); |
| 1497 | const struct upb_MiniTableEnum* UPB_PRIVATE(subenum); |
| 1498 | }; |
| 1499 | |
| 1500 | #ifdef __cplusplus |
| 1501 | extern "C" { |
| 1502 | #endif |
| 1503 | |
Protobuf Team Bot | b3878b5 | 2024-02-08 21:50:53 +0000 | [diff] [blame] | 1504 | UPB_API_INLINE union upb_MiniTableSub upb_MiniTableSub_FromEnum( |
Protobuf Team Bot | e1253cd | 2024-01-08 23:09:09 +0000 | [diff] [blame] | 1505 | const struct upb_MiniTableEnum* subenum) { |
| 1506 | union upb_MiniTableSub out; |
| 1507 | out.UPB_PRIVATE(subenum) = subenum; |
| 1508 | return out; |
| 1509 | } |
| 1510 | |
Protobuf Team Bot | b3878b5 | 2024-02-08 21:50:53 +0000 | [diff] [blame] | 1511 | UPB_API_INLINE union upb_MiniTableSub upb_MiniTableSub_FromMessage( |
Protobuf Team Bot | e1253cd | 2024-01-08 23:09:09 +0000 | [diff] [blame] | 1512 | const struct upb_MiniTable* submsg) { |
| 1513 | union upb_MiniTableSub out; |
| 1514 | out.UPB_PRIVATE(submsg) = submsg; |
| 1515 | return out; |
| 1516 | } |
| 1517 | |
Protobuf Team Bot | b3878b5 | 2024-02-08 21:50:53 +0000 | [diff] [blame] | 1518 | UPB_API_INLINE const struct upb_MiniTableEnum* upb_MiniTableSub_Enum( |
Protobuf Team Bot | e1253cd | 2024-01-08 23:09:09 +0000 | [diff] [blame] | 1519 | const union upb_MiniTableSub sub) { |
| 1520 | return sub.UPB_PRIVATE(subenum); |
| 1521 | } |
| 1522 | |
Protobuf Team Bot | b3878b5 | 2024-02-08 21:50:53 +0000 | [diff] [blame] | 1523 | UPB_API_INLINE const struct upb_MiniTable* upb_MiniTableSub_Message( |
Protobuf Team Bot | e1253cd | 2024-01-08 23:09:09 +0000 | [diff] [blame] | 1524 | 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 | |
| 1537 | struct upb_Decoder; |
Protobuf Team Bot | c12c96e | 2024-01-16 07:41:08 +0000 | [diff] [blame] | 1538 | struct upb_Message; |
Protobuf Team Bot | e1253cd | 2024-01-08 23:09:09 +0000 | [diff] [blame] | 1539 | typedef 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); |
| 1542 | typedef struct { |
| 1543 | uint64_t field_data; |
| 1544 | _upb_FieldParser* field_parser; |
| 1545 | } _upb_FastTable_Entry; |
| 1546 | |
| 1547 | typedef 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) |
| 1564 | struct upb_MiniTable { |
Protobuf Team Bot | 532f0c2 | 2024-06-05 03:21:24 +0000 | [diff] [blame] | 1565 | const upb_MiniTableSubInternal* UPB_PRIVATE(subs); |
Protobuf Team Bot | e1253cd | 2024-01-08 23:09:09 +0000 | [diff] [blame] | 1566 | 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 Bot | ccfab6a | 2024-03-07 20:32:42 +0000 | [diff] [blame] | 1578 | |
Protobuf Team Bot | 5d58cb8 | 2024-03-06 19:59:18 +0000 | [diff] [blame] | 1579 | #ifdef UPB_TRACING_ENABLED |
| 1580 | const char* UPB_PRIVATE(full_name); |
| 1581 | #endif |
Protobuf Team Bot | e1253cd | 2024-01-08 23:09:09 +0000 | [diff] [blame] | 1582 | |
Protobuf Team Bot | 5d58cb8 | 2024-03-06 19:59:18 +0000 | [diff] [blame] | 1583 | #ifdef UPB_FASTTABLE_ENABLED |
Protobuf Team Bot | e1253cd | 2024-01-08 23:09:09 +0000 | [diff] [blame] | 1584 | // 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 Bot | 5d58cb8 | 2024-03-06 19:59:18 +0000 | [diff] [blame] | 1588 | #endif |
Protobuf Team Bot | e1253cd | 2024-01-08 23:09:09 +0000 | [diff] [blame] | 1589 | }; |
| 1590 | // LINT.ThenChange(//depot/google3/third_party/upb/bits/typescript/mini_table.ts) |
| 1591 | |
| 1592 | #ifdef __cplusplus |
| 1593 | extern "C" { |
| 1594 | #endif |
| 1595 | |
Protobuf Team Bot | a9387b5 | 2024-06-12 15:17:52 +0000 | [diff] [blame] | 1596 | UPB_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 Bot | e1253cd | 2024-01-08 23:09:09 +0000 | [diff] [blame] | 1607 | UPB_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 Bot | b3878b5 | 2024-02-08 21:50:53 +0000 | [diff] [blame] | 1613 | UPB_API_INLINE int upb_MiniTable_FieldCount(const struct upb_MiniTable* m) { |
Protobuf Team Bot | e1253cd | 2024-01-08 23:09:09 +0000 | [diff] [blame] | 1614 | return m->UPB_ONLYBITS(field_count); |
| 1615 | } |
| 1616 | |
| 1617 | UPB_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 Bot | b3878b5 | 2024-02-08 21:50:53 +0000 | [diff] [blame] | 1624 | UPB_API_INLINE const struct upb_MiniTableField* upb_MiniTable_GetFieldByIndex( |
| 1625 | const struct upb_MiniTable* m, uint32_t i) { |
Protobuf Team Bot | e1253cd | 2024-01-08 23:09:09 +0000 | [diff] [blame] | 1626 | return &m->UPB_ONLYBITS(fields)[i]; |
| 1627 | } |
| 1628 | |
Protobuf Team Bot | 532f0c2 | 2024-06-05 03:21:24 +0000 | [diff] [blame] | 1629 | UPB_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 Bot | e1253cd | 2024-01-08 23:09:09 +0000 | [diff] [blame] | 1633 | } |
| 1634 | |
Protobuf Team Bot | b3878b5 | 2024-02-08 21:50:53 +0000 | [diff] [blame] | 1635 | UPB_API_INLINE const struct upb_MiniTable* upb_MiniTable_SubMessage( |
Protobuf Team Bot | 886a0b1 | 2024-01-26 21:23:01 +0000 | [diff] [blame] | 1636 | const struct upb_MiniTable* m, const struct upb_MiniTableField* f) { |
Protobuf Team Bot | b3878b5 | 2024-02-08 21:50:53 +0000 | [diff] [blame] | 1637 | if (upb_MiniTableField_CType(f) != kUpb_CType_Message) { |
Protobuf Team Bot | 886a0b1 | 2024-01-26 21:23:01 +0000 | [diff] [blame] | 1638 | return NULL; |
| 1639 | } |
Protobuf Team Bot | 532f0c2 | 2024-06-05 03:21:24 +0000 | [diff] [blame] | 1640 | return UPB_PRIVATE(_upb_MiniTable_GetSubTableByIndex)( |
| 1641 | m, f->UPB_PRIVATE(submsg_index)); |
Protobuf Team Bot | d1cf09a | 2024-04-19 22:43:34 +0000 | [diff] [blame] | 1642 | } |
| 1643 | |
| 1644 | UPB_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 | |
| 1652 | UPB_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 | |
| 1657 | UPB_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 Bot | 886a0b1 | 2024-01-26 21:23:01 +0000 | [diff] [blame] | 1662 | } |
| 1663 | |
Protobuf Team Bot | b3878b5 | 2024-02-08 21:50:53 +0000 | [diff] [blame] | 1664 | UPB_API_INLINE const struct upb_MiniTableEnum* upb_MiniTable_GetSubEnumTable( |
Protobuf Team Bot | e1253cd | 2024-01-08 23:09:09 +0000 | [diff] [blame] | 1665 | const struct upb_MiniTable* m, const struct upb_MiniTableField* f) { |
Protobuf Team Bot | b3878b5 | 2024-02-08 21:50:53 +0000 | [diff] [blame] | 1666 | UPB_ASSERT(upb_MiniTableField_CType(f) == kUpb_CType_Enum); |
Protobuf Team Bot | d1cf09a | 2024-04-19 22:43:34 +0000 | [diff] [blame] | 1667 | return m->UPB_PRIVATE(subs)[f->UPB_PRIVATE(submsg_index)].UPB_PRIVATE( |
| 1668 | subenum); |
Protobuf Team Bot | b3878b5 | 2024-02-08 21:50:53 +0000 | [diff] [blame] | 1669 | } |
| 1670 | |
| 1671 | UPB_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 | |
| 1679 | UPB_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 Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 1687 | // Computes a bitmask in which the |m->required_count| lowest bits are set. |
Protobuf Team Bot | e1253cd | 2024-01-08 23:09:09 +0000 | [diff] [blame] | 1688 | // |
| 1689 | // Sample output: |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 1690 | // RequiredMask(1) => 0b1 (0x1) |
| 1691 | // RequiredMask(5) => 0b11111 (0x1f) |
Protobuf Team Bot | e1253cd | 2024-01-08 23:09:09 +0000 | [diff] [blame] | 1692 | UPB_INLINE uint64_t |
| 1693 | UPB_PRIVATE(_upb_MiniTable_RequiredMask)(const struct upb_MiniTable* m) { |
| 1694 | int n = m->UPB_PRIVATE(required_count); |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 1695 | UPB_ASSERT(0 < n && n <= 64); |
| 1696 | return (1ULL << n) - 1; |
Protobuf Team Bot | e1253cd | 2024-01-08 23:09:09 +0000 | [diff] [blame] | 1697 | } |
| 1698 | |
Protobuf Team Bot | 5d58cb8 | 2024-03-06 19:59:18 +0000 | [diff] [blame] | 1699 | #ifdef UPB_TRACING_ENABLED |
| 1700 | UPB_INLINE const char* upb_MiniTable_FullName( |
| 1701 | const struct upb_MiniTable* mini_table) { |
| 1702 | return mini_table->UPB_PRIVATE(full_name); |
| 1703 | } |
Protobuf Team Bot | ccfab6a | 2024-03-07 20:32:42 +0000 | [diff] [blame] | 1704 | // 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 Bot | 3ee0120 | 2024-03-07 23:27:46 +0000 | [diff] [blame] | 1707 | UPB_INLINE void upb_MiniTable_SetFullName(struct upb_MiniTable* mini_table, |
| 1708 | const char* full_name) { |
Protobuf Team Bot | ccfab6a | 2024-03-07 20:32:42 +0000 | [diff] [blame] | 1709 | mini_table->UPB_PRIVATE(full_name) = full_name; |
| 1710 | } |
Protobuf Team Bot | 5d58cb8 | 2024-03-06 19:59:18 +0000 | [diff] [blame] | 1711 | #endif |
| 1712 | |
Protobuf Team Bot | e1253cd | 2024-01-08 23:09:09 +0000 | [diff] [blame] | 1713 | #ifdef __cplusplus |
| 1714 | } /* extern "C" */ |
| 1715 | #endif |
| 1716 | |
| 1717 | |
| 1718 | #endif /* UPB_MINI_TABLE_INTERNAL_MESSAGE_H_ */ |
| 1719 | |
| 1720 | // Must be last. |
| 1721 | |
| 1722 | typedef struct upb_MiniTable upb_MiniTable; |
| 1723 | |
| 1724 | #ifdef __cplusplus |
| 1725 | extern "C" { |
| 1726 | #endif |
| 1727 | |
| 1728 | UPB_API const upb_MiniTableField* upb_MiniTable_FindFieldByNumber( |
| 1729 | const upb_MiniTable* m, uint32_t number); |
| 1730 | |
| 1731 | UPB_API_INLINE const upb_MiniTableField* upb_MiniTable_GetFieldByIndex( |
Protobuf Team Bot | b3878b5 | 2024-02-08 21:50:53 +0000 | [diff] [blame] | 1732 | const upb_MiniTable* m, uint32_t index); |
Protobuf Team Bot | e1253cd | 2024-01-08 23:09:09 +0000 | [diff] [blame] | 1733 | |
Protobuf Team Bot | b3878b5 | 2024-02-08 21:50:53 +0000 | [diff] [blame] | 1734 | UPB_API_INLINE int upb_MiniTable_FieldCount(const upb_MiniTable* m); |
Protobuf Team Bot | e1253cd | 2024-01-08 23:09:09 +0000 | [diff] [blame] | 1735 | |
Protobuf Team Bot | 886a0b1 | 2024-01-26 21:23:01 +0000 | [diff] [blame] | 1736 | // DEPRECATED: use upb_MiniTable_SubMessage() instead |
Protobuf Team Bot | e1253cd | 2024-01-08 23:09:09 +0000 | [diff] [blame] | 1737 | // Returns the MiniTable for a message field, NULL if the field is unlinked. |
| 1738 | UPB_API_INLINE const upb_MiniTable* upb_MiniTable_GetSubMessageTable( |
Protobuf Team Bot | b3878b5 | 2024-02-08 21:50:53 +0000 | [diff] [blame] | 1739 | const upb_MiniTable* m, const upb_MiniTableField* f); |
Protobuf Team Bot | e1253cd | 2024-01-08 23:09:09 +0000 | [diff] [blame] | 1740 | |
Protobuf Team Bot | d1cf09a | 2024-04-19 22:43:34 +0000 | [diff] [blame] | 1741 | // 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 Bot | 886a0b1 | 2024-01-26 21:23:01 +0000 | [diff] [blame] | 1748 | UPB_API_INLINE const upb_MiniTable* upb_MiniTable_SubMessage( |
Protobuf Team Bot | b3878b5 | 2024-02-08 21:50:53 +0000 | [diff] [blame] | 1749 | const upb_MiniTable* m, const upb_MiniTableField* f); |
Protobuf Team Bot | 886a0b1 | 2024-01-26 21:23:01 +0000 | [diff] [blame] | 1750 | |
Protobuf Team Bot | d1cf09a | 2024-04-19 22:43:34 +0000 | [diff] [blame] | 1751 | // Returns the MiniTable for a map field. The given field must refer to a map. |
| 1752 | UPB_API_INLINE const upb_MiniTable* upb_MiniTable_MapEntrySubMessage( |
| 1753 | const upb_MiniTable* m, const upb_MiniTableField* f); |
| 1754 | |
Protobuf Team Bot | e1253cd | 2024-01-08 23:09:09 +0000 | [diff] [blame] | 1755 | // Returns the MiniTableEnum for a message field, NULL if the field is unlinked. |
| 1756 | UPB_API_INLINE const upb_MiniTableEnum* upb_MiniTable_GetSubEnumTable( |
Protobuf Team Bot | b3878b5 | 2024-02-08 21:50:53 +0000 | [diff] [blame] | 1757 | const upb_MiniTable* m, const upb_MiniTableField* f); |
Protobuf Team Bot | e1253cd | 2024-01-08 23:09:09 +0000 | [diff] [blame] | 1758 | |
| 1759 | // Returns the MiniTableField for the key of a map. |
| 1760 | UPB_API_INLINE const upb_MiniTableField* upb_MiniTable_MapKey( |
Protobuf Team Bot | b3878b5 | 2024-02-08 21:50:53 +0000 | [diff] [blame] | 1761 | const upb_MiniTable* m); |
Protobuf Team Bot | e1253cd | 2024-01-08 23:09:09 +0000 | [diff] [blame] | 1762 | |
| 1763 | // Returns the MiniTableField for the value of a map. |
| 1764 | UPB_API_INLINE const upb_MiniTableField* upb_MiniTable_MapValue( |
Protobuf Team Bot | b3878b5 | 2024-02-08 21:50:53 +0000 | [diff] [blame] | 1765 | const upb_MiniTable* m); |
Protobuf Team Bot | e1253cd | 2024-01-08 23:09:09 +0000 | [diff] [blame] | 1766 | |
| 1767 | // Returns true if this MiniTable field is linked to a MiniTable for the |
| 1768 | // sub-message. |
Protobuf Team Bot | 54f512b | 2024-04-08 18:30:15 +0000 | [diff] [blame] | 1769 | UPB_API_INLINE bool upb_MiniTable_FieldIsLinked(const upb_MiniTable* m, |
| 1770 | const upb_MiniTableField* f); |
Protobuf Team Bot | e1253cd | 2024-01-08 23:09:09 +0000 | [diff] [blame] | 1771 | |
| 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 | // |
| 1782 | const 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. |
| 1790 | bool 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 Bot | 886a0b1 | 2024-01-26 21:23:01 +0000 | [diff] [blame] | 1802 | typedef struct upb_Array upb_Array; |
| 1803 | |
| 1804 | #ifdef __cplusplus |
| 1805 | extern "C" { |
| 1806 | #endif |
| 1807 | |
| 1808 | // Creates a new array on the given arena that holds elements of this type. |
| 1809 | UPB_API upb_Array* upb_Array_New(upb_Arena* a, upb_CType type); |
| 1810 | |
| 1811 | // Returns the number of elements in the array. |
Protobuf Team Bot | b3878b5 | 2024-02-08 21:50:53 +0000 | [diff] [blame] | 1812 | UPB_API_INLINE size_t upb_Array_Size(const upb_Array* arr); |
Protobuf Team Bot | 886a0b1 | 2024-01-26 21:23:01 +0000 | [diff] [blame] | 1813 | |
| 1814 | // Returns the given element, which must be within the array's current size. |
| 1815 | UPB_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. |
| 1819 | UPB_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. |
| 1822 | UPB_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. |
| 1825 | UPB_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. |
| 1830 | UPB_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)` |
| 1837 | UPB_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)` |
| 1843 | UPB_API void upb_Array_Delete(upb_Array* array, size_t i, size_t count); |
| 1844 | |
Protobuf Team Bot | 4b6de0f | 2024-03-29 19:09:40 +0000 | [diff] [blame] | 1845 | // Reserves |size| elements of storage for the array. |
| 1846 | UPB_API_INLINE bool upb_Array_Reserve(struct upb_Array* array, size_t size, |
| 1847 | upb_Arena* arena); |
| 1848 | |
Protobuf Team Bot | 886a0b1 | 2024-01-26 21:23:01 +0000 | [diff] [blame] | 1849 | // Changes the size of a vector. New elements are initialized to NULL/0. |
| 1850 | // Returns false on allocation failure. |
| 1851 | UPB_API bool upb_Array_Resize(upb_Array* array, size_t size, upb_Arena* arena); |
| 1852 | |
| 1853 | // Returns pointer to array data. |
Protobuf Team Bot | b3878b5 | 2024-02-08 21:50:53 +0000 | [diff] [blame] | 1854 | UPB_API_INLINE const void* upb_Array_DataPtr(const upb_Array* arr); |
Protobuf Team Bot | 886a0b1 | 2024-01-26 21:23:01 +0000 | [diff] [blame] | 1855 | |
| 1856 | // Returns mutable pointer to array data. |
Protobuf Team Bot | b3878b5 | 2024-02-08 21:50:53 +0000 | [diff] [blame] | 1857 | UPB_API_INLINE void* upb_Array_MutableDataPtr(upb_Array* arr); |
Protobuf Team Bot | 886a0b1 | 2024-01-26 21:23:01 +0000 | [diff] [blame] | 1858 | |
| 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. |
| 1862 | UPB_API void upb_Array_Freeze(upb_Array* arr, const upb_MiniTable* m); |
| 1863 | |
| 1864 | // Returns whether an array has been frozen. |
Protobuf Team Bot | b3878b5 | 2024-02-08 21:50:53 +0000 | [diff] [blame] | 1865 | UPB_API_INLINE bool upb_Array_IsFrozen(const upb_Array* arr); |
Protobuf Team Bot | 886a0b1 | 2024-01-26 21:23:01 +0000 | [diff] [blame] | 1866 | |
| 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 |
| 1890 | extern "C" { |
| 1891 | #endif |
| 1892 | |
| 1893 | UPB_INLINE bool upb_IsLittleEndian(void) { |
| 1894 | const int x = 1; |
| 1895 | return *(char*)&x == 1; |
| 1896 | } |
| 1897 | |
| 1898 | UPB_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 | |
| 1905 | UPB_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 Bot | 4df6e04 | 2024-01-30 19:27:52 +0000 | [diff] [blame] | 1923 | #include <stddef.h> |
Protobuf Team Bot | 886a0b1 | 2024-01-26 21:23:01 +0000 | [diff] [blame] | 1924 | |
Protobuf Team Bot | e1253cd | 2024-01-08 23:09:09 +0000 | [diff] [blame] | 1925 | |
| 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 Bot | eb31de3 | 2024-05-09 22:09:21 +0000 | [diff] [blame] | 1935 | #include <stddef.h> |
Protobuf Team Bot | e1253cd | 2024-01-08 23:09:09 +0000 | [diff] [blame] | 1936 | #include <stdint.h> |
| 1937 | |
| 1938 | |
| 1939 | // Must be last. |
| 1940 | |
| 1941 | struct 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 |
| 1950 | extern "C" { |
| 1951 | #endif |
| 1952 | |
Protobuf Team Bot | b3878b5 | 2024-02-08 21:50:53 +0000 | [diff] [blame] | 1953 | UPB_API_INLINE upb_CType |
| 1954 | upb_MiniTableExtension_CType(const struct upb_MiniTableExtension* e) { |
| 1955 | return upb_MiniTableField_CType(&e->UPB_PRIVATE(field)); |
Protobuf Team Bot | e1253cd | 2024-01-08 23:09:09 +0000 | [diff] [blame] | 1956 | } |
| 1957 | |
Protobuf Team Bot | b3878b5 | 2024-02-08 21:50:53 +0000 | [diff] [blame] | 1958 | UPB_API_INLINE uint32_t |
| 1959 | upb_MiniTableExtension_Number(const struct upb_MiniTableExtension* e) { |
Protobuf Team Bot | e1253cd | 2024-01-08 23:09:09 +0000 | [diff] [blame] | 1960 | return e->UPB_PRIVATE(field).UPB_ONLYBITS(number); |
| 1961 | } |
| 1962 | |
Protobuf Team Bot | b3878b5 | 2024-02-08 21:50:53 +0000 | [diff] [blame] | 1963 | UPB_API_INLINE const struct upb_MiniTable* upb_MiniTableExtension_GetSubMessage( |
Protobuf Team Bot | e1253cd | 2024-01-08 23:09:09 +0000 | [diff] [blame] | 1964 | const struct upb_MiniTableExtension* e) { |
Protobuf Team Bot | eb31de3 | 2024-05-09 22:09:21 +0000 | [diff] [blame] | 1965 | if (upb_MiniTableExtension_CType(e) != kUpb_CType_Message) { |
| 1966 | return NULL; |
| 1967 | } |
Protobuf Team Bot | b3878b5 | 2024-02-08 21:50:53 +0000 | [diff] [blame] | 1968 | return upb_MiniTableSub_Message(e->UPB_PRIVATE(sub)); |
Protobuf Team Bot | e1253cd | 2024-01-08 23:09:09 +0000 | [diff] [blame] | 1969 | } |
| 1970 | |
Protobuf Team Bot | b3878b5 | 2024-02-08 21:50:53 +0000 | [diff] [blame] | 1971 | UPB_API_INLINE void upb_MiniTableExtension_SetSubMessage( |
Protobuf Team Bot | e1253cd | 2024-01-08 23:09:09 +0000 | [diff] [blame] | 1972 | struct upb_MiniTableExtension* e, const struct upb_MiniTable* m) { |
| 1973 | e->UPB_PRIVATE(sub).UPB_PRIVATE(submsg) = m; |
| 1974 | } |
| 1975 | |
Protobuf Team Bot | 6afb130 | 2024-05-08 02:19:22 +0000 | [diff] [blame] | 1976 | UPB_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 Bot | e1253cd | 2024-01-08 23:09:09 +0000 | [diff] [blame] | 1981 | #ifdef __cplusplus |
| 1982 | } /* extern "C" */ |
| 1983 | #endif |
| 1984 | |
| 1985 | |
| 1986 | #endif /* UPB_MINI_TABLE_INTERNAL_EXTENSION_H_ */ |
| 1987 | |
| 1988 | // Must be last. |
| 1989 | |
| 1990 | typedef struct upb_MiniTableExtension upb_MiniTableExtension; |
| 1991 | |
| 1992 | #ifdef __cplusplus |
| 1993 | extern "C" { |
| 1994 | #endif |
| 1995 | |
Protobuf Team Bot | fe6a601 | 2024-01-18 00:05:28 +0000 | [diff] [blame] | 1996 | UPB_API_INLINE upb_CType |
Protobuf Team Bot | b3878b5 | 2024-02-08 21:50:53 +0000 | [diff] [blame] | 1997 | upb_MiniTableExtension_CType(const upb_MiniTableExtension* e); |
Protobuf Team Bot | e1253cd | 2024-01-08 23:09:09 +0000 | [diff] [blame] | 1998 | |
| 1999 | UPB_API_INLINE uint32_t |
Protobuf Team Bot | b3878b5 | 2024-02-08 21:50:53 +0000 | [diff] [blame] | 2000 | upb_MiniTableExtension_Number(const upb_MiniTableExtension* e); |
Protobuf Team Bot | e1253cd | 2024-01-08 23:09:09 +0000 | [diff] [blame] | 2001 | |
| 2002 | UPB_API_INLINE const upb_MiniTable* upb_MiniTableExtension_GetSubMessage( |
Protobuf Team Bot | b3878b5 | 2024-02-08 21:50:53 +0000 | [diff] [blame] | 2003 | const upb_MiniTableExtension* e); |
Protobuf Team Bot | e1253cd | 2024-01-08 23:09:09 +0000 | [diff] [blame] | 2004 | |
| 2005 | UPB_API_INLINE void upb_MiniTableExtension_SetSubMessage( |
Protobuf Team Bot | b3878b5 | 2024-02-08 21:50:53 +0000 | [diff] [blame] | 2006 | upb_MiniTableExtension* e, const upb_MiniTable* m); |
Protobuf Team Bot | e1253cd | 2024-01-08 23:09:09 +0000 | [diff] [blame] | 2007 | |
| 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 Bot | c13512a | 2024-01-25 18:53:49 +0000 | [diff] [blame] | 2025 | typedef struct { |
Protobuf Team Bot | e1253cd | 2024-01-08 23:09:09 +0000 | [diff] [blame] | 2026 | const upb_MiniTableExtension* ext; |
Protobuf Team Bot | 4df6e04 | 2024-01-30 19:27:52 +0000 | [diff] [blame] | 2027 | upb_MessageValue data; |
Protobuf Team Bot | c13512a | 2024-01-25 18:53:49 +0000 | [diff] [blame] | 2028 | } upb_Extension; |
Protobuf Team Bot | e1253cd | 2024-01-08 23:09:09 +0000 | [diff] [blame] | 2029 | |
| 2030 | #ifdef __cplusplus |
| 2031 | extern "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 Bot | c13512a | 2024-01-25 18:53:49 +0000 | [diff] [blame] | 2037 | upb_Extension* UPB_PRIVATE(_upb_Message_GetOrCreateExtension)( |
Protobuf Team Bot | e1253cd | 2024-01-08 23:09:09 +0000 | [diff] [blame] | 2038 | 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 Bot | c13512a | 2024-01-25 18:53:49 +0000 | [diff] [blame] | 2043 | const upb_Extension* UPB_PRIVATE(_upb_Message_Getexts)( |
Protobuf Team Bot | e1253cd | 2024-01-08 23:09:09 +0000 | [diff] [blame] | 2044 | 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 Bot | c13512a | 2024-01-25 18:53:49 +0000 | [diff] [blame] | 2048 | const upb_Extension* UPB_PRIVATE(_upb_Message_Getext)( |
Protobuf Team Bot | e1253cd | 2024-01-08 23:09:09 +0000 | [diff] [blame] | 2049 | 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 Bot | 499c748 | 2023-12-30 01:42:17 +0000 | [diff] [blame] | 2057 | |
| 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 |
| 2097 | extern "C" { |
| 2098 | #endif |
| 2099 | |
| 2100 | /* upb_value ******************************************************************/ |
| 2101 | |
| 2102 | typedef struct { |
| 2103 | uint64_t val; |
| 2104 | } upb_value; |
| 2105 | |
| 2106 | UPB_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 | |
| 2129 | FUNCS(int32, int32, int32_t, int32_t) |
| 2130 | FUNCS(int64, int64, int64_t, int64_t) |
| 2131 | FUNCS(uint32, uint32, uint32_t, uint32_t) |
| 2132 | FUNCS(uint64, uint64, uint64_t, uint64_t) |
| 2133 | FUNCS(bool, _bool, bool, bool) |
| 2134 | FUNCS(cstr, cstr, char*, uintptr_t) |
| 2135 | FUNCS(uintptr, uptr, uintptr_t, uintptr_t) |
| 2136 | FUNCS(ptr, ptr, void*, uintptr_t) |
| 2137 | FUNCS(constptr, constptr, const void*, uintptr_t) |
| 2138 | |
| 2139 | #undef FUNCS |
| 2140 | |
| 2141 | UPB_INLINE void upb_value_setfloat(upb_value* val, float cval) { |
| 2142 | memcpy(&val->val, &cval, sizeof(cval)); |
| 2143 | } |
| 2144 | |
| 2145 | UPB_INLINE void upb_value_setdouble(upb_value* val, double cval) { |
| 2146 | memcpy(&val->val, &cval, sizeof(cval)); |
| 2147 | } |
| 2148 | |
| 2149 | UPB_INLINE upb_value upb_value_float(float cval) { |
| 2150 | upb_value ret; |
| 2151 | upb_value_setfloat(&ret, cval); |
| 2152 | return ret; |
| 2153 | } |
| 2154 | |
| 2155 | UPB_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. */ |
| 2170 | typedef uintptr_t upb_tabkey; |
| 2171 | |
| 2172 | UPB_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 | |
| 2178 | UPB_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 | |
| 2188 | typedef struct upb_tabval { |
| 2189 | uint64_t val; |
| 2190 | } upb_tabval; |
| 2191 | |
| 2192 | #define UPB_TABVALUE_EMPTY_INIT \ |
| 2193 | { -1 } |
| 2194 | |
| 2195 | /* upb_table ******************************************************************/ |
| 2196 | |
| 2197 | typedef 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 | |
| 2208 | typedef 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 | |
| 2216 | UPB_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 | |
| 2222 | UPB_INLINE bool upb_tabent_isempty(const upb_tabent* e) { return e->key == 0; } |
| 2223 | |
| 2224 | uint32_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 | |
| 2235 | typedef struct { |
| 2236 | upb_table t; |
| 2237 | } upb_strtable; |
| 2238 | |
| 2239 | #ifdef __cplusplus |
| 2240 | extern "C" { |
| 2241 | #endif |
| 2242 | |
| 2243 | // Initialize a table. If memory allocation failed, false is returned and |
| 2244 | // the table is uninitialized. |
| 2245 | bool upb_strtable_init(upb_strtable* table, size_t expected_size, upb_Arena* a); |
| 2246 | |
| 2247 | // Returns the number of values in the table. |
| 2248 | UPB_INLINE size_t upb_strtable_count(const upb_strtable* t) { |
| 2249 | return t->t.count; |
| 2250 | } |
| 2251 | |
| 2252 | void 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. */ |
| 2260 | bool 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. |
| 2265 | bool upb_strtable_lookup2(const upb_strtable* t, const char* key, size_t len, |
| 2266 | upb_value* v); |
| 2267 | |
| 2268 | // For NULL-terminated strings. |
| 2269 | UPB_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. |
| 2276 | bool upb_strtable_remove2(upb_strtable* t, const char* key, size_t len, |
| 2277 | upb_value* val); |
| 2278 | |
| 2279 | UPB_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. |
| 2285 | bool 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 | |
| 2299 | bool upb_strtable_next2(const upb_strtable* t, upb_StringView* key, |
| 2300 | upb_value* val, intptr_t* iter); |
| 2301 | void upb_strtable_removeiter(upb_strtable* t, intptr_t* iter); |
| 2302 | void 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 | |
| 2337 | typedef struct { |
| 2338 | const upb_strtable* t; |
| 2339 | size_t index; |
| 2340 | } upb_strtable_iter; |
| 2341 | |
| 2342 | UPB_INLINE const upb_tabent* str_tabent(const upb_strtable_iter* i) { |
| 2343 | return &i->t->t.entries[i->index]; |
| 2344 | } |
| 2345 | |
| 2346 | void upb_strtable_begin(upb_strtable_iter* i, const upb_strtable* t); |
| 2347 | void upb_strtable_next(upb_strtable_iter* i); |
| 2348 | bool upb_strtable_done(const upb_strtable_iter* i); |
| 2349 | upb_StringView upb_strtable_iter_key(const upb_strtable_iter* i); |
| 2350 | upb_value upb_strtable_iter_value(const upb_strtable_iter* i); |
| 2351 | void upb_strtable_iter_setdone(upb_strtable_iter* i); |
| 2352 | bool 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 | |
| 2364 | typedef 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 | |
| 2372 | struct 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 Bot | 886a0b1 | 2024-01-26 21:23:01 +0000 | [diff] [blame] | 2377 | bool UPB_PRIVATE(is_frozen); |
Protobuf Team Bot | 499c748 | 2023-12-30 01:42:17 +0000 | [diff] [blame] | 2378 | |
| 2379 | upb_strtable table; |
| 2380 | }; |
| 2381 | |
| 2382 | #ifdef __cplusplus |
| 2383 | extern "C" { |
| 2384 | #endif |
| 2385 | |
Protobuf Team Bot | 886a0b1 | 2024-01-26 21:23:01 +0000 | [diff] [blame] | 2386 | UPB_INLINE void UPB_PRIVATE(_upb_Map_ShallowFreeze)(struct upb_Map* map) { |
| 2387 | map->UPB_PRIVATE(is_frozen) = true; |
| 2388 | } |
| 2389 | |
Protobuf Team Bot | b3878b5 | 2024-02-08 21:50:53 +0000 | [diff] [blame] | 2390 | UPB_API_INLINE bool upb_Map_IsFrozen(const struct upb_Map* map) { |
Protobuf Team Bot | 886a0b1 | 2024-01-26 21:23:01 +0000 | [diff] [blame] | 2391 | return map->UPB_PRIVATE(is_frozen); |
| 2392 | } |
| 2393 | |
Protobuf Team Bot | 499c748 | 2023-12-30 01:42:17 +0000 | [diff] [blame] | 2394 | // 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 | |
| 2402 | UPB_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 | |
| 2410 | UPB_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 | |
| 2418 | UPB_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 | |
| 2431 | UPB_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 | |
| 2440 | UPB_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 | |
| 2450 | UPB_INLINE void _upb_Map_Clear(struct upb_Map* map) { |
Protobuf Team Bot | b3878b5 | 2024-02-08 21:50:53 +0000 | [diff] [blame] | 2451 | UPB_ASSERT(!upb_Map_IsFrozen(map)); |
Protobuf Team Bot | 886a0b1 | 2024-01-26 21:23:01 +0000 | [diff] [blame] | 2452 | |
Protobuf Team Bot | 499c748 | 2023-12-30 01:42:17 +0000 | [diff] [blame] | 2453 | upb_strtable_clear(&map->table); |
| 2454 | } |
| 2455 | |
| 2456 | UPB_INLINE bool _upb_Map_Delete(struct upb_Map* map, const void* key, |
| 2457 | size_t key_size, upb_value* val) { |
Protobuf Team Bot | b3878b5 | 2024-02-08 21:50:53 +0000 | [diff] [blame] | 2458 | UPB_ASSERT(!upb_Map_IsFrozen(map)); |
Protobuf Team Bot | 886a0b1 | 2024-01-26 21:23:01 +0000 | [diff] [blame] | 2459 | |
Protobuf Team Bot | 499c748 | 2023-12-30 01:42:17 +0000 | [diff] [blame] | 2460 | upb_StringView k = _upb_map_tokey(key, key_size); |
| 2461 | return upb_strtable_remove2(&map->table, k.data, k.size, val); |
| 2462 | } |
| 2463 | |
| 2464 | UPB_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 | |
| 2475 | UPB_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 Bot | b3878b5 | 2024-02-08 21:50:53 +0000 | [diff] [blame] | 2479 | UPB_ASSERT(!upb_Map_IsFrozen(map)); |
Protobuf Team Bot | 886a0b1 | 2024-01-26 21:23:01 +0000 | [diff] [blame] | 2480 | |
Protobuf Team Bot | 499c748 | 2023-12-30 01:42:17 +0000 | [diff] [blame] | 2481 | 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 | |
| 2497 | UPB_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. |
| 2502 | extern char _upb_Map_CTypeSizeTable[12]; |
| 2503 | |
| 2504 | UPB_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. |
| 2509 | struct 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 Bot | 4ffe086 | 2023-12-06 02:02:36 +0000 | [diff] [blame] | 2517 | |
Protobuf Team Bot | 4df6e04 | 2024-01-30 19:27:52 +0000 | [diff] [blame] | 2518 | /* |
| 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 |
| 2535 | extern "C" { |
| 2536 | #endif |
| 2537 | |
| 2538 | extern const float kUpb_FltInfinity; |
| 2539 | extern const double kUpb_Infinity; |
| 2540 | extern 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 | |
| 2545 | typedef 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 Bot | ccfab6a | 2024-03-07 20:32:42 +0000 | [diff] [blame] | 2568 | #ifdef UPB_TRACING_ENABLED |
Protobuf Team Bot | 51cba7c | 2024-05-06 13:34:40 +0000 | [diff] [blame] | 2569 | UPB_API void upb_Message_LogNewMessage(const upb_MiniTable* m, |
| 2570 | const upb_Arena* arena); |
| 2571 | UPB_API void upb_Message_SetNewMessageTraceHandler( |
| 2572 | void (*handler)(const upb_MiniTable*, const upb_Arena*)); |
| 2573 | #endif // UPB_TRACING_ENABLED |
Protobuf Team Bot | ccfab6a | 2024-03-07 20:32:42 +0000 | [diff] [blame] | 2574 | |
Protobuf Team Bot | 4df6e04 | 2024-01-30 19:27:52 +0000 | [diff] [blame] | 2575 | // Inline version upb_Message_New(), for internal use. |
| 2576 | UPB_INLINE struct upb_Message* _upb_Message_New(const upb_MiniTable* m, |
| 2577 | upb_Arena* a) { |
Protobuf Team Bot | ccfab6a | 2024-03-07 20:32:42 +0000 | [diff] [blame] | 2578 | #ifdef UPB_TRACING_ENABLED |
Protobuf Team Bot | 51cba7c | 2024-05-06 13:34:40 +0000 | [diff] [blame] | 2579 | upb_Message_LogNewMessage(m, a); |
| 2580 | #endif // UPB_TRACING_ENABLED |
| 2581 | |
Protobuf Team Bot | 4df6e04 | 2024-01-30 19:27:52 +0000 | [diff] [blame] | 2582 | 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. |
| 2590 | void _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. |
| 2594 | bool UPB_PRIVATE(_upb_Message_AddUnknown)(struct upb_Message* msg, |
| 2595 | const char* data, size_t len, |
| 2596 | upb_Arena* arena); |
| 2597 | |
| 2598 | bool 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 Bot | 499c748 | 2023-12-30 01:42:17 +0000 | [diff] [blame] | 2608 | #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 Bot | 499c748 | 2023-12-30 01:42:17 +0000 | [diff] [blame] | 2616 | #ifdef __cplusplus |
| 2617 | extern "C" { |
| 2618 | #endif |
| 2619 | |
| 2620 | // Internal-only because empty messages cannot be created by the user. |
Protobuf Team Bot | e1253cd | 2024-01-08 23:09:09 +0000 | [diff] [blame] | 2621 | UPB_INLINE uintptr_t |
Protobuf Team Bot | 499c748 | 2023-12-30 01:42:17 +0000 | [diff] [blame] | 2622 | UPB_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 Bot | b3878b5 | 2024-02-08 21:50:53 +0000 | [diff] [blame] | 2627 | UPB_API_INLINE bool upb_TaggedMessagePtr_IsEmpty(uintptr_t ptr) { |
Protobuf Team Bot | 499c748 | 2023-12-30 01:42:17 +0000 | [diff] [blame] | 2628 | return ptr & 1; |
| 2629 | } |
| 2630 | |
| 2631 | UPB_INLINE struct upb_Message* UPB_PRIVATE(_upb_TaggedMessagePtr_GetMessage)( |
Protobuf Team Bot | e1253cd | 2024-01-08 23:09:09 +0000 | [diff] [blame] | 2632 | uintptr_t ptr) { |
Protobuf Team Bot | 499c748 | 2023-12-30 01:42:17 +0000 | [diff] [blame] | 2633 | return (struct upb_Message*)(ptr & ~(uintptr_t)1); |
| 2634 | } |
| 2635 | |
Protobuf Team Bot | b3878b5 | 2024-02-08 21:50:53 +0000 | [diff] [blame] | 2636 | UPB_API_INLINE struct upb_Message* upb_TaggedMessagePtr_GetNonEmptyMessage( |
| 2637 | uintptr_t ptr) { |
| 2638 | UPB_ASSERT(!upb_TaggedMessagePtr_IsEmpty(ptr)); |
Protobuf Team Bot | 499c748 | 2023-12-30 01:42:17 +0000 | [diff] [blame] | 2639 | return UPB_PRIVATE(_upb_TaggedMessagePtr_GetMessage)(ptr); |
| 2640 | } |
| 2641 | |
| 2642 | UPB_INLINE struct upb_Message* UPB_PRIVATE( |
Protobuf Team Bot | e1253cd | 2024-01-08 23:09:09 +0000 | [diff] [blame] | 2643 | _upb_TaggedMessagePtr_GetEmptyMessage)(uintptr_t ptr) { |
Protobuf Team Bot | b3878b5 | 2024-02-08 21:50:53 +0000 | [diff] [blame] | 2644 | UPB_ASSERT(upb_TaggedMessagePtr_IsEmpty(ptr)); |
Protobuf Team Bot | 499c748 | 2023-12-30 01:42:17 +0000 | [diff] [blame] | 2645 | 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 Bot | c12c96e | 2024-01-16 07:41:08 +0000 | [diff] [blame] | 2655 | #ifndef UPB_MESSAGE_INTERNAL_TYPES_H_ |
| 2656 | #define UPB_MESSAGE_INTERNAL_TYPES_H_ |
| 2657 | |
Protobuf Team Bot | 886a0b1 | 2024-01-26 21:23:01 +0000 | [diff] [blame] | 2658 | #include <stdint.h> |
| 2659 | |
| 2660 | // Must be last. |
| 2661 | |
| 2662 | #define UPB_OPAQUE(x) x##_opaque |
| 2663 | |
Protobuf Team Bot | c12c96e | 2024-01-16 07:41:08 +0000 | [diff] [blame] | 2664 | struct upb_Message { |
| 2665 | union { |
Protobuf Team Bot | 886a0b1 | 2024-01-26 21:23:01 +0000 | [diff] [blame] | 2666 | uintptr_t UPB_OPAQUE(internal); // tagged pointer, low bit == frozen |
Protobuf Team Bot | c12c96e | 2024-01-16 07:41:08 +0000 | [diff] [blame] | 2667 | double d; // Forces same size for 32-bit/64-bit builds |
| 2668 | }; |
| 2669 | }; |
| 2670 | |
Protobuf Team Bot | b3878b5 | 2024-02-08 21:50:53 +0000 | [diff] [blame] | 2671 | #ifdef __cplusplus |
| 2672 | extern "C" { |
| 2673 | #endif |
| 2674 | |
Protobuf Team Bot | 886a0b1 | 2024-01-26 21:23:01 +0000 | [diff] [blame] | 2675 | UPB_INLINE void UPB_PRIVATE(_upb_Message_ShallowFreeze)( |
| 2676 | struct upb_Message* msg) { |
| 2677 | msg->UPB_OPAQUE(internal) |= 1ULL; |
| 2678 | } |
| 2679 | |
Protobuf Team Bot | b3878b5 | 2024-02-08 21:50:53 +0000 | [diff] [blame] | 2680 | UPB_API_INLINE bool upb_Message_IsFrozen(const struct upb_Message* msg) { |
Protobuf Team Bot | 886a0b1 | 2024-01-26 21:23:01 +0000 | [diff] [blame] | 2681 | return (msg->UPB_OPAQUE(internal) & 1ULL) != 0; |
| 2682 | } |
| 2683 | |
| 2684 | UPB_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 | |
| 2690 | UPB_INLINE void UPB_PRIVATE(_upb_Message_SetInternal)( |
| 2691 | struct upb_Message* msg, struct upb_Message_Internal* internal) { |
Protobuf Team Bot | b3878b5 | 2024-02-08 21:50:53 +0000 | [diff] [blame] | 2692 | UPB_ASSERT(!upb_Message_IsFrozen(msg)); |
Protobuf Team Bot | 886a0b1 | 2024-01-26 21:23:01 +0000 | [diff] [blame] | 2693 | msg->UPB_OPAQUE(internal) = (uintptr_t)internal; |
| 2694 | } |
| 2695 | |
Protobuf Team Bot | b3878b5 | 2024-02-08 21:50:53 +0000 | [diff] [blame] | 2696 | #ifdef __cplusplus |
| 2697 | } /* extern "C" */ |
| 2698 | #endif |
| 2699 | |
Protobuf Team Bot | 886a0b1 | 2024-01-26 21:23:01 +0000 | [diff] [blame] | 2700 | #undef UPB_OPAQUE |
| 2701 | |
| 2702 | |
Protobuf Team Bot | c12c96e | 2024-01-16 07:41:08 +0000 | [diff] [blame] | 2703 | #endif /* UPB_MESSAGE_INTERNAL_TYPES_H_ */ |
| 2704 | |
Eric Salo | 8809a11 | 2022-11-21 13:01:06 -0800 | [diff] [blame] | 2705 | // Must be last. |
| 2706 | |
Eric Salo | b7d54ac | 2022-12-29 11:59:42 -0800 | [diff] [blame] | 2707 | #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 Kruskal | 232ecf4 | 2023-01-14 00:09:40 -0800 | [diff] [blame] | 2720 | #if __GNUC__ >= 11 |
Eric Salo | b7d54ac | 2022-12-29 11:59:42 -0800 | [diff] [blame] | 2721 | #pragma GCC diagnostic ignored "-Wstringop-overread" |
| 2722 | #endif |
Mike Kruskal | 232ecf4 | 2023-01-14 00:09:40 -0800 | [diff] [blame] | 2723 | #endif |
Eric Salo | b7d54ac | 2022-12-29 11:59:42 -0800 | [diff] [blame] | 2724 | |
Eric Salo | 8809a11 | 2022-11-21 13:01:06 -0800 | [diff] [blame] | 2725 | #ifdef __cplusplus |
| 2726 | extern "C" { |
| 2727 | #endif |
| 2728 | |
Mike Kruskal | 9d43502 | 2023-07-11 12:45:07 -0700 | [diff] [blame] | 2729 | // LINT.IfChange(presence_logic) |
| 2730 | |
| 2731 | // Hasbit access /////////////////////////////////////////////////////////////// |
| 2732 | |
Protobuf Team Bot | 7713df5 | 2023-12-05 20:16:11 +0000 | [diff] [blame] | 2733 | UPB_INLINE bool UPB_PRIVATE(_upb_Message_GetHasbit)( |
Protobuf Team Bot | 499c748 | 2023-12-30 01:42:17 +0000 | [diff] [blame] | 2734 | const struct upb_Message* msg, const upb_MiniTableField* f) { |
Protobuf Team Bot | a0e8195 | 2023-12-21 14:54:29 +0000 | [diff] [blame] | 2735 | const size_t offset = UPB_PRIVATE(_upb_MiniTableField_HasbitOffset)(f); |
| 2736 | const char mask = UPB_PRIVATE(_upb_MiniTableField_HasbitMask)(f); |
| 2737 | |
Protobuf Team Bot | b8c1a27 | 2023-11-15 17:49:10 +0000 | [diff] [blame] | 2738 | return (*UPB_PTR_AT(msg, offset, const char) & mask) != 0; |
Mike Kruskal | 9d43502 | 2023-07-11 12:45:07 -0700 | [diff] [blame] | 2739 | } |
| 2740 | |
Protobuf Team Bot | 7713df5 | 2023-12-05 20:16:11 +0000 | [diff] [blame] | 2741 | UPB_INLINE void UPB_PRIVATE(_upb_Message_SetHasbit)( |
Protobuf Team Bot | 499c748 | 2023-12-30 01:42:17 +0000 | [diff] [blame] | 2742 | const struct upb_Message* msg, const upb_MiniTableField* f) { |
Protobuf Team Bot | a0e8195 | 2023-12-21 14:54:29 +0000 | [diff] [blame] | 2743 | const size_t offset = UPB_PRIVATE(_upb_MiniTableField_HasbitOffset)(f); |
| 2744 | const char mask = UPB_PRIVATE(_upb_MiniTableField_HasbitMask)(f); |
| 2745 | |
Protobuf Team Bot | b8c1a27 | 2023-11-15 17:49:10 +0000 | [diff] [blame] | 2746 | (*UPB_PTR_AT(msg, offset, char)) |= mask; |
| 2747 | } |
| 2748 | |
Protobuf Team Bot | 7713df5 | 2023-12-05 20:16:11 +0000 | [diff] [blame] | 2749 | UPB_INLINE void UPB_PRIVATE(_upb_Message_ClearHasbit)( |
Protobuf Team Bot | 499c748 | 2023-12-30 01:42:17 +0000 | [diff] [blame] | 2750 | const struct upb_Message* msg, const upb_MiniTableField* f) { |
Protobuf Team Bot | a0e8195 | 2023-12-21 14:54:29 +0000 | [diff] [blame] | 2751 | const size_t offset = UPB_PRIVATE(_upb_MiniTableField_HasbitOffset)(f); |
| 2752 | const char mask = UPB_PRIVATE(_upb_MiniTableField_HasbitMask)(f); |
| 2753 | |
Protobuf Team Bot | b8c1a27 | 2023-11-15 17:49:10 +0000 | [diff] [blame] | 2754 | (*UPB_PTR_AT(msg, offset, char)) &= ~mask; |
| 2755 | } |
| 2756 | |
Mike Kruskal | 9d43502 | 2023-07-11 12:45:07 -0700 | [diff] [blame] | 2757 | // Oneof case access /////////////////////////////////////////////////////////// |
| 2758 | |
Protobuf Team Bot | 7d4ead2 | 2023-12-05 21:25:30 +0000 | [diff] [blame] | 2759 | UPB_INLINE uint32_t* UPB_PRIVATE(_upb_Message_OneofCasePtr)( |
Protobuf Team Bot | 499c748 | 2023-12-30 01:42:17 +0000 | [diff] [blame] | 2760 | struct upb_Message* msg, const upb_MiniTableField* f) { |
Protobuf Team Bot | a0e8195 | 2023-12-21 14:54:29 +0000 | [diff] [blame] | 2761 | return UPB_PTR_AT(msg, UPB_PRIVATE(_upb_MiniTableField_OneofOffset)(f), |
| 2762 | uint32_t); |
Mike Kruskal | 9d43502 | 2023-07-11 12:45:07 -0700 | [diff] [blame] | 2763 | } |
| 2764 | |
Protobuf Team Bot | 7d4ead2 | 2023-12-05 21:25:30 +0000 | [diff] [blame] | 2765 | UPB_INLINE uint32_t UPB_PRIVATE(_upb_Message_GetOneofCase)( |
Protobuf Team Bot | 499c748 | 2023-12-30 01:42:17 +0000 | [diff] [blame] | 2766 | const struct upb_Message* msg, const upb_MiniTableField* f) { |
Protobuf Team Bot | 18d4a76 | 2024-01-02 05:41:47 +0000 | [diff] [blame] | 2767 | const uint32_t* ptr = |
| 2768 | UPB_PRIVATE(_upb_Message_OneofCasePtr)((struct upb_Message*)msg, f); |
| 2769 | |
| 2770 | return *ptr; |
Mike Kruskal | 9d43502 | 2023-07-11 12:45:07 -0700 | [diff] [blame] | 2771 | } |
| 2772 | |
Protobuf Team Bot | 7d4ead2 | 2023-12-05 21:25:30 +0000 | [diff] [blame] | 2773 | UPB_INLINE void UPB_PRIVATE(_upb_Message_SetOneofCase)( |
Protobuf Team Bot | 499c748 | 2023-12-30 01:42:17 +0000 | [diff] [blame] | 2774 | struct upb_Message* msg, const upb_MiniTableField* f) { |
Protobuf Team Bot | 18d4a76 | 2024-01-02 05:41:47 +0000 | [diff] [blame] | 2775 | uint32_t* ptr = UPB_PRIVATE(_upb_Message_OneofCasePtr)(msg, f); |
| 2776 | |
| 2777 | *ptr = upb_MiniTableField_Number(f); |
Protobuf Team Bot | b8c1a27 | 2023-11-15 17:49:10 +0000 | [diff] [blame] | 2778 | } |
| 2779 | |
Protobuf Team Bot | 18d4a76 | 2024-01-02 05:41:47 +0000 | [diff] [blame] | 2780 | // Returns true if the given field is the current oneof case. |
| 2781 | // Does nothing if it is not the current oneof case. |
| 2782 | UPB_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 Bot | b8c1a27 | 2023-11-15 17:49:10 +0000 | [diff] [blame] | 2790 | |
Protobuf Team Bot | 7646fbf | 2024-05-03 19:47:53 +0000 | [diff] [blame] | 2791 | UPB_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 Bot | 6cce622 | 2024-05-28 17:15:46 +0000 | [diff] [blame] | 2797 | UPB_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 Kruskal | 9d43502 | 2023-07-11 12:45:07 -0700 | [diff] [blame] | 2808 | // LINT.ThenChange(GoogleInternalName2) |
Mike Kruskal | 9d43502 | 2023-07-11 12:45:07 -0700 | [diff] [blame] | 2809 | |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 2810 | // Returns false if the message is missing any of its required fields. |
| 2811 | UPB_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 Bot | 9bee747 | 2024-01-10 18:09:23 +0000 | [diff] [blame] | 2819 | UPB_INLINE void* UPB_PRIVATE(_upb_Message_MutableDataPtr)( |
Protobuf Team Bot | 18d4a76 | 2024-01-02 05:41:47 +0000 | [diff] [blame] | 2820 | struct upb_Message* msg, const upb_MiniTableField* f) { |
| 2821 | return (char*)msg + f->UPB_ONLYBITS(offset); |
Eric Salo | 8809a11 | 2022-11-21 13:01:06 -0800 | [diff] [blame] | 2822 | } |
| 2823 | |
Protobuf Team Bot | 9bee747 | 2024-01-10 18:09:23 +0000 | [diff] [blame] | 2824 | UPB_INLINE const void* UPB_PRIVATE(_upb_Message_DataPtr)( |
Protobuf Team Bot | 18d4a76 | 2024-01-02 05:41:47 +0000 | [diff] [blame] | 2825 | const struct upb_Message* msg, const upb_MiniTableField* f) { |
| 2826 | return (const char*)msg + f->UPB_ONLYBITS(offset); |
Eric Salo | 8809a11 | 2022-11-21 13:01:06 -0800 | [diff] [blame] | 2827 | } |
| 2828 | |
Protobuf Team Bot | 7d4ead2 | 2023-12-05 21:25:30 +0000 | [diff] [blame] | 2829 | UPB_INLINE void UPB_PRIVATE(_upb_Message_SetPresence)( |
Protobuf Team Bot | 18d4a76 | 2024-01-02 05:41:47 +0000 | [diff] [blame] | 2830 | 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 Salo | 8809a11 | 2022-11-21 13:01:06 -0800 | [diff] [blame] | 2835 | } |
| 2836 | } |
| 2837 | |
Protobuf Team Bot | ddc5406 | 2023-12-12 20:03:38 +0000 | [diff] [blame] | 2838 | UPB_INLINE void UPB_PRIVATE(_upb_MiniTableField_DataCopy)( |
Protobuf Team Bot | 18d4a76 | 2024-01-02 05:41:47 +0000 | [diff] [blame] | 2839 | const upb_MiniTableField* f, void* to, const void* from) { |
| 2840 | switch (UPB_PRIVATE(_upb_MiniTableField_GetRep)(f)) { |
Eric Salo | 8809a11 | 2022-11-21 13:01:06 -0800 | [diff] [blame] | 2841 | 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 Bot | 18d4a76 | 2024-01-02 05:41:47 +0000 | [diff] [blame] | 2858 | UPB_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 | |
| 2876 | UPB_INLINE void UPB_PRIVATE(_upb_MiniTableField_DataClear)( |
| 2877 | const upb_MiniTableField* f, void* val) { |
| 2878 | const char zero[16] = {0}; |
Protobuf Team Bot | 8203e2f | 2024-05-20 19:23:30 +0000 | [diff] [blame] | 2879 | UPB_PRIVATE(_upb_MiniTableField_DataCopy)(f, val, zero); |
Protobuf Team Bot | 18d4a76 | 2024-01-02 05:41:47 +0000 | [diff] [blame] | 2880 | } |
| 2881 | |
| 2882 | UPB_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 Salo | 8809a11 | 2022-11-21 13:01:06 -0800 | [diff] [blame] | 2888 | // 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 Salo | b598b2d | 2022-12-22 23:14:27 -0800 | [diff] [blame] | 2894 | // // Via struct literals. |
Eric Salo | 8809a11 | 2022-11-21 13:01:06 -0800 | [diff] [blame] | 2895 | // 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 Bot | ac32c97 | 2024-04-10 03:30:05 +0000 | [diff] [blame] | 2898 | // upb_Message_SetBaseField(msg, &field, &value); |
Eric Salo | 8809a11 | 2022-11-21 13:01:06 -0800 | [diff] [blame] | 2899 | // } |
| 2900 | // |
| 2901 | // // Via UPB_ASSUME(). |
Eric Salo | 1050599 | 2022-12-12 12:16:36 -0800 | [diff] [blame] | 2902 | // UPB_INLINE bool upb_Message_SetBool(upb_Message* msg, |
| 2903 | // const upb_MiniTableField* field, |
| 2904 | // bool value, upb_Arena* a) { |
Deanna Garcia | bd6a0cf | 2023-04-20 10:30:44 -0700 | [diff] [blame] | 2905 | // UPB_ASSUME(field->UPB_PRIVATE(descriptortype) == kUpb_FieldType_Bool); |
Protobuf Team Bot | 4216972 | 2023-11-29 03:54:33 +0000 | [diff] [blame] | 2906 | // UPB_ASSUME(UPB_PRIVATE(_upb_MiniTableField_GetRep)(field) == |
| 2907 | // kUpb_FieldRep_1Byte); |
Protobuf Team Bot | 54573a4 | 2023-11-21 14:47:34 +0000 | [diff] [blame] | 2908 | // upb_Message_SetField(msg, field, &value, a); |
Eric Salo | 8809a11 | 2022-11-21 13:01:06 -0800 | [diff] [blame] | 2909 | // } |
| 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 Salo | b598b2d | 2022-12-22 23:14:27 -0800 | [diff] [blame] | 2914 | // about how they read/write the message data, for efficiency. |
Eric Salo | 1050599 | 2022-12-12 12:16:36 -0800 | [diff] [blame] | 2915 | // |
| 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 Salo | 8809a11 | 2022-11-21 13:01:06 -0800 | [diff] [blame] | 2919 | |
Protobuf Team Bot | b3878b5 | 2024-02-08 21:50:53 +0000 | [diff] [blame] | 2920 | UPB_API_INLINE bool upb_Message_HasBaseField(const struct upb_Message* msg, |
| 2921 | const upb_MiniTableField* field) { |
Eric Salo | 1050599 | 2022-12-12 12:16:36 -0800 | [diff] [blame] | 2922 | UPB_ASSERT(upb_MiniTableField_HasPresence(field)); |
| 2923 | UPB_ASSUME(!upb_MiniTableField_IsExtension(field)); |
Protobuf Team Bot | e81cda1 | 2023-11-21 18:23:13 +0000 | [diff] [blame] | 2924 | if (upb_MiniTableField_IsInOneof(field)) { |
Protobuf Team Bot | 7d4ead2 | 2023-12-05 21:25:30 +0000 | [diff] [blame] | 2925 | return UPB_PRIVATE(_upb_Message_GetOneofCase)(msg, field) == |
Protobuf Team Bot | 7bdd38e | 2023-12-01 23:06:45 +0000 | [diff] [blame] | 2926 | upb_MiniTableField_Number(field); |
Eric Salo | 1050599 | 2022-12-12 12:16:36 -0800 | [diff] [blame] | 2927 | } else { |
Protobuf Team Bot | 7713df5 | 2023-12-05 20:16:11 +0000 | [diff] [blame] | 2928 | return UPB_PRIVATE(_upb_Message_GetHasbit)(msg, field); |
Eric Salo | 1050599 | 2022-12-12 12:16:36 -0800 | [diff] [blame] | 2929 | } |
| 2930 | } |
| 2931 | |
Protobuf Team Bot | b3878b5 | 2024-02-08 21:50:53 +0000 | [diff] [blame] | 2932 | UPB_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 Bot | 8c1f635 | 2024-01-10 05:18:15 +0000 | [diff] [blame] | 2936 | } |
| 2937 | |
Protobuf Team Bot | 1d143b5 | 2024-01-25 20:29:43 +0000 | [diff] [blame] | 2938 | UPB_FORCEINLINE void _upb_Message_GetNonExtensionField( |
Protobuf Team Bot | 499c748 | 2023-12-30 01:42:17 +0000 | [diff] [blame] | 2939 | const struct upb_Message* msg, const upb_MiniTableField* field, |
Eric Salo | 8809a11 | 2022-11-21 13:01:06 -0800 | [diff] [blame] | 2940 | const void* default_val, void* val) { |
| 2941 | UPB_ASSUME(!upb_MiniTableField_IsExtension(field)); |
Protobuf Team Bot | e81cda1 | 2023-11-21 18:23:13 +0000 | [diff] [blame] | 2942 | if ((upb_MiniTableField_IsInOneof(field) || |
Protobuf Team Bot | ddc5406 | 2023-12-12 20:03:38 +0000 | [diff] [blame] | 2943 | !UPB_PRIVATE(_upb_MiniTableField_DataIsZero)(field, default_val)) && |
Protobuf Team Bot | b3878b5 | 2024-02-08 21:50:53 +0000 | [diff] [blame] | 2944 | !upb_Message_HasBaseField(msg, field)) { |
Protobuf Team Bot | ddc5406 | 2023-12-12 20:03:38 +0000 | [diff] [blame] | 2945 | UPB_PRIVATE(_upb_MiniTableField_DataCopy)(field, val, default_val); |
Eric Salo | 8809a11 | 2022-11-21 13:01:06 -0800 | [diff] [blame] | 2946 | return; |
| 2947 | } |
Protobuf Team Bot | ddc5406 | 2023-12-12 20:03:38 +0000 | [diff] [blame] | 2948 | UPB_PRIVATE(_upb_MiniTableField_DataCopy) |
Protobuf Team Bot | 9bee747 | 2024-01-10 18:09:23 +0000 | [diff] [blame] | 2949 | (field, val, UPB_PRIVATE(_upb_Message_DataPtr)(msg, field)); |
Eric Salo | 8809a11 | 2022-11-21 13:01:06 -0800 | [diff] [blame] | 2950 | } |
| 2951 | |
Eric Salo | 1050599 | 2022-12-12 12:16:36 -0800 | [diff] [blame] | 2952 | UPB_INLINE void _upb_Message_GetExtensionField( |
Protobuf Team Bot | 499c748 | 2023-12-30 01:42:17 +0000 | [diff] [blame] | 2953 | const struct upb_Message* msg, const upb_MiniTableExtension* mt_ext, |
Eric Salo | 8809a11 | 2022-11-21 13:01:06 -0800 | [diff] [blame] | 2954 | const void* default_val, void* val) { |
Protobuf Team Bot | c13512a | 2024-01-25 18:53:49 +0000 | [diff] [blame] | 2955 | const upb_Extension* ext = UPB_PRIVATE(_upb_Message_Getext)(msg, mt_ext); |
Protobuf Team Bot | ddc5406 | 2023-12-12 20:03:38 +0000 | [diff] [blame] | 2956 | const upb_MiniTableField* f = &mt_ext->UPB_PRIVATE(field); |
| 2957 | UPB_ASSUME(upb_MiniTableField_IsExtension(f)); |
| 2958 | |
Eric Salo | 8809a11 | 2022-11-21 13:01:06 -0800 | [diff] [blame] | 2959 | if (ext) { |
Protobuf Team Bot | ddc5406 | 2023-12-12 20:03:38 +0000 | [diff] [blame] | 2960 | UPB_PRIVATE(_upb_MiniTableField_DataCopy)(f, val, &ext->data); |
Eric Salo | 8809a11 | 2022-11-21 13:01:06 -0800 | [diff] [blame] | 2961 | } else { |
Protobuf Team Bot | ddc5406 | 2023-12-12 20:03:38 +0000 | [diff] [blame] | 2962 | UPB_PRIVATE(_upb_MiniTableField_DataCopy)(f, val, default_val); |
Eric Salo | 8809a11 | 2022-11-21 13:01:06 -0800 | [diff] [blame] | 2963 | } |
| 2964 | } |
| 2965 | |
Protobuf Team Bot | 7646fbf | 2024-05-03 19:47:53 +0000 | [diff] [blame] | 2966 | // 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. |
| 2971 | UPB_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 Bot | ac32c97 | 2024-04-10 03:30:05 +0000 | [diff] [blame] | 2984 | UPB_API_INLINE void upb_Message_SetBaseField(struct upb_Message* msg, |
| 2985 | const upb_MiniTableField* f, |
| 2986 | const void* val) { |
Protobuf Team Bot | b3878b5 | 2024-02-08 21:50:53 +0000 | [diff] [blame] | 2987 | UPB_ASSERT(!upb_Message_IsFrozen(msg)); |
Protobuf Team Bot | ac32c97 | 2024-04-10 03:30:05 +0000 | [diff] [blame] | 2988 | UPB_ASSUME(!upb_MiniTableField_IsExtension(f)); |
| 2989 | UPB_PRIVATE(_upb_Message_SetPresence)(msg, f); |
Protobuf Team Bot | ddc5406 | 2023-12-12 20:03:38 +0000 | [diff] [blame] | 2990 | UPB_PRIVATE(_upb_MiniTableField_DataCopy) |
Protobuf Team Bot | ac32c97 | 2024-04-10 03:30:05 +0000 | [diff] [blame] | 2991 | (f, UPB_PRIVATE(_upb_Message_MutableDataPtr)(msg, f), val); |
Eric Salo | 8809a11 | 2022-11-21 13:01:06 -0800 | [diff] [blame] | 2992 | } |
| 2993 | |
Protobuf Team Bot | ac32c97 | 2024-04-10 03:30:05 +0000 | [diff] [blame] | 2994 | UPB_API_INLINE bool upb_Message_SetExtension(struct upb_Message* msg, |
| 2995 | const upb_MiniTableExtension* e, |
| 2996 | const void* val, upb_Arena* a) { |
Protobuf Team Bot | b3878b5 | 2024-02-08 21:50:53 +0000 | [diff] [blame] | 2997 | UPB_ASSERT(!upb_Message_IsFrozen(msg)); |
Eric Salo | 1050599 | 2022-12-12 12:16:36 -0800 | [diff] [blame] | 2998 | UPB_ASSERT(a); |
Protobuf Team Bot | c13512a | 2024-01-25 18:53:49 +0000 | [diff] [blame] | 2999 | upb_Extension* ext = |
Protobuf Team Bot | ac32c97 | 2024-04-10 03:30:05 +0000 | [diff] [blame] | 3000 | UPB_PRIVATE(_upb_Message_GetOrCreateExtension)(msg, e, a); |
Eric Salo | 8809a11 | 2022-11-21 13:01:06 -0800 | [diff] [blame] | 3001 | if (!ext) return false; |
Protobuf Team Bot | ddc5406 | 2023-12-12 20:03:38 +0000 | [diff] [blame] | 3002 | UPB_PRIVATE(_upb_MiniTableField_DataCopy) |
Protobuf Team Bot | ac32c97 | 2024-04-10 03:30:05 +0000 | [diff] [blame] | 3003 | (&e->UPB_PRIVATE(field), &ext->data, val); |
Eric Salo | 8809a11 | 2022-11-21 13:01:06 -0800 | [diff] [blame] | 3004 | return true; |
| 3005 | } |
| 3006 | |
Protobuf Team Bot | 7646fbf | 2024-05-03 19:47:53 +0000 | [diff] [blame] | 3007 | // 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. |
| 3010 | UPB_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 | |
| 3023 | UPB_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 | |
| 3032 | UPB_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 Bot | 7646fbf | 2024-05-03 19:47:53 +0000 | [diff] [blame] | 3036 | UPB_ASSUME(upb_MiniTableField_IsScalar(f)); |
Protobuf Team Bot | 6afb130 | 2024-05-08 02:19:22 +0000 | [diff] [blame] | 3037 | UPB_ASSUME(UPB_PRIVATE(_upb_MiniTableField_GetRep)(f) == kUpb_FieldRep_1Byte); |
Protobuf Team Bot | 7646fbf | 2024-05-03 19:47:53 +0000 | [diff] [blame] | 3038 | upb_MessageValue def; |
| 3039 | def.bool_val = default_val; |
| 3040 | return upb_Message_GetField(msg, f, def).bool_val; |
| 3041 | } |
| 3042 | |
| 3043 | UPB_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 Bot | 7646fbf | 2024-05-03 19:47:53 +0000 | [diff] [blame] | 3047 | UPB_ASSUME(upb_MiniTableField_IsScalar(f)); |
Protobuf Team Bot | 6afb130 | 2024-05-08 02:19:22 +0000 | [diff] [blame] | 3048 | UPB_ASSUME(UPB_PRIVATE(_upb_MiniTableField_GetRep)(f) == kUpb_FieldRep_8Byte); |
Protobuf Team Bot | 7646fbf | 2024-05-03 19:47:53 +0000 | [diff] [blame] | 3049 | |
| 3050 | upb_MessageValue def; |
| 3051 | def.double_val = default_val; |
| 3052 | return upb_Message_GetField(msg, f, def).double_val; |
| 3053 | } |
| 3054 | |
| 3055 | UPB_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 Bot | 7646fbf | 2024-05-03 19:47:53 +0000 | [diff] [blame] | 3059 | UPB_ASSUME(upb_MiniTableField_IsScalar(f)); |
Protobuf Team Bot | 6afb130 | 2024-05-08 02:19:22 +0000 | [diff] [blame] | 3060 | UPB_ASSUME(UPB_PRIVATE(_upb_MiniTableField_GetRep)(f) == kUpb_FieldRep_4Byte); |
Protobuf Team Bot | 7646fbf | 2024-05-03 19:47:53 +0000 | [diff] [blame] | 3061 | |
| 3062 | upb_MessageValue def; |
| 3063 | def.float_val = default_val; |
| 3064 | return upb_Message_GetField(msg, f, def).float_val; |
| 3065 | } |
| 3066 | |
| 3067 | UPB_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 Bot | 7646fbf | 2024-05-03 19:47:53 +0000 | [diff] [blame] | 3072 | UPB_ASSUME(upb_MiniTableField_IsScalar(f)); |
Protobuf Team Bot | 6afb130 | 2024-05-08 02:19:22 +0000 | [diff] [blame] | 3073 | UPB_ASSUME(UPB_PRIVATE(_upb_MiniTableField_GetRep)(f) == kUpb_FieldRep_4Byte); |
Protobuf Team Bot | 7646fbf | 2024-05-03 19:47:53 +0000 | [diff] [blame] | 3074 | |
| 3075 | upb_MessageValue def; |
| 3076 | def.int32_val = default_val; |
| 3077 | return upb_Message_GetField(msg, f, def).int32_val; |
| 3078 | } |
| 3079 | |
| 3080 | UPB_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 Bot | 7646fbf | 2024-05-03 19:47:53 +0000 | [diff] [blame] | 3084 | UPB_ASSUME(upb_MiniTableField_IsScalar(f)); |
Protobuf Team Bot | 6afb130 | 2024-05-08 02:19:22 +0000 | [diff] [blame] | 3085 | UPB_ASSUME(UPB_PRIVATE(_upb_MiniTableField_GetRep)(f) == kUpb_FieldRep_8Byte); |
Protobuf Team Bot | 7646fbf | 2024-05-03 19:47:53 +0000 | [diff] [blame] | 3086 | |
| 3087 | upb_MessageValue def; |
| 3088 | def.int64_val = default_val; |
| 3089 | return upb_Message_GetField(msg, f, def).int64_val; |
| 3090 | } |
| 3091 | |
| 3092 | UPB_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 | |
| 3104 | UPB_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 Bot | 4d3a98c | 2024-05-08 01:37:14 +0000 | [diff] [blame] | 3114 | UPB_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. |
| 3129 | UPB_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 | |
| 3139 | UPB_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 Bot | 7646fbf | 2024-05-03 19:47:53 +0000 | [diff] [blame] | 3145 | UPB_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 | |
| 3151 | UPB_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 Bot | 4d3a98c | 2024-05-08 01:37:14 +0000 | [diff] [blame] | 3156 | UPB_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 Bot | 7646fbf | 2024-05-03 19:47:53 +0000 | [diff] [blame] | 3161 | UPB_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 | |
| 3178 | UPB_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 | |
| 3195 | UPB_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 | |
| 3209 | UPB_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 | |
| 3229 | UPB_API_INLINE upb_StringView |
| 3230 | upb_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 Bot | 7646fbf | 2024-05-03 19:47:53 +0000 | [diff] [blame] | 3236 | |
| 3237 | upb_MessageValue def; |
| 3238 | def.str_val = default_val; |
| 3239 | return upb_Message_GetField(msg, f, def).str_val; |
| 3240 | } |
| 3241 | |
| 3242 | UPB_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 Bot | 7646fbf | 2024-05-03 19:47:53 +0000 | [diff] [blame] | 3246 | UPB_ASSUME(upb_MiniTableField_IsScalar(f)); |
Protobuf Team Bot | 6afb130 | 2024-05-08 02:19:22 +0000 | [diff] [blame] | 3247 | UPB_ASSUME(UPB_PRIVATE(_upb_MiniTableField_GetRep)(f) == kUpb_FieldRep_4Byte); |
Protobuf Team Bot | 7646fbf | 2024-05-03 19:47:53 +0000 | [diff] [blame] | 3248 | |
| 3249 | upb_MessageValue def; |
| 3250 | def.uint32_val = default_val; |
| 3251 | return upb_Message_GetField(msg, f, def).uint32_val; |
| 3252 | } |
| 3253 | |
| 3254 | UPB_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 Bot | 7646fbf | 2024-05-03 19:47:53 +0000 | [diff] [blame] | 3258 | UPB_ASSUME(upb_MiniTableField_IsScalar(f)); |
Protobuf Team Bot | 6afb130 | 2024-05-08 02:19:22 +0000 | [diff] [blame] | 3259 | UPB_ASSUME(UPB_PRIVATE(_upb_MiniTableField_GetRep)(f) == kUpb_FieldRep_8Byte); |
Protobuf Team Bot | 7646fbf | 2024-05-03 19:47:53 +0000 | [diff] [blame] | 3260 | |
| 3261 | upb_MessageValue def; |
| 3262 | def.uint64_val = default_val; |
| 3263 | return upb_Message_GetField(msg, f, def).uint64_val; |
| 3264 | } |
| 3265 | |
Protobuf Team Bot | 6afb130 | 2024-05-08 02:19:22 +0000 | [diff] [blame] | 3266 | // BaseField Setters /////////////////////////////////////////////////////////// |
| 3267 | |
| 3268 | UPB_API_INLINE void upb_Message_SetBaseFieldBool(struct upb_Message* msg, |
| 3269 | const upb_MiniTableField* f, |
| 3270 | bool value) { |
Protobuf Team Bot | 7646fbf | 2024-05-03 19:47:53 +0000 | [diff] [blame] | 3271 | UPB_ASSUME(upb_MiniTableField_CType(f) == kUpb_CType_Bool); |
Protobuf Team Bot | 7646fbf | 2024-05-03 19:47:53 +0000 | [diff] [blame] | 3272 | UPB_ASSUME(upb_MiniTableField_IsScalar(f)); |
Protobuf Team Bot | 6afb130 | 2024-05-08 02:19:22 +0000 | [diff] [blame] | 3273 | UPB_ASSUME(UPB_PRIVATE(_upb_MiniTableField_GetRep)(f) == kUpb_FieldRep_1Byte); |
| 3274 | upb_Message_SetBaseField(msg, f, &value); |
| 3275 | } |
| 3276 | |
| 3277 | UPB_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 | |
| 3286 | UPB_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 | |
| 3295 | UPB_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 | |
| 3305 | UPB_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 | |
| 3314 | UPB_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 | |
| 3325 | UPB_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 | |
| 3334 | UPB_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 Bot | 7646fbf | 2024-05-03 19:47:53 +0000 | [diff] [blame] | 3341 | } |
| 3342 | |
Protobuf Team Bot | ddc70b0 | 2024-05-11 02:21:06 +0000 | [diff] [blame] | 3343 | UPB_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 Bot | 7646fbf | 2024-05-03 19:47:53 +0000 | [diff] [blame] | 3347 | UPB_ASSERT(upb_MiniTableField_IsClosedEnum(f)); |
| 3348 | UPB_ASSUME(UPB_PRIVATE(_upb_MiniTableField_GetRep)(f) == kUpb_FieldRep_4Byte); |
Protobuf Team Bot | ddc70b0 | 2024-05-11 02:21:06 +0000 | [diff] [blame] | 3349 | UPB_ASSERT( |
| 3350 | upb_MiniTableEnum_CheckValue(upb_MiniTable_GetSubEnumTable(m, f), value)); |
Protobuf Team Bot | 7646fbf | 2024-05-03 19:47:53 +0000 | [diff] [blame] | 3351 | upb_Message_SetBaseField(msg, f, &value); |
| 3352 | } |
| 3353 | |
Protobuf Team Bot | 6afb130 | 2024-05-08 02:19:22 +0000 | [diff] [blame] | 3354 | // Extension Setters /////////////////////////////////////////////////////////// |
| 3355 | |
| 3356 | UPB_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 | |
| 3365 | UPB_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 | |
| 3374 | UPB_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 | |
| 3383 | UPB_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 | |
| 3393 | UPB_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 | |
| 3402 | UPB_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 | |
| 3412 | UPB_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 | |
| 3421 | UPB_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 | |
| 3432 | UPB_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 Bot | 7646fbf | 2024-05-03 19:47:53 +0000 | [diff] [blame] | 3441 | UPB_API_INLINE bool upb_Message_SetDouble(struct upb_Message* msg, |
| 3442 | const upb_MiniTableField* f, |
| 3443 | double value, upb_Arena* a) { |
Protobuf Team Bot | 6afb130 | 2024-05-08 02:19:22 +0000 | [diff] [blame] | 3444 | 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 Bot | 7646fbf | 2024-05-03 19:47:53 +0000 | [diff] [blame] | 3448 | } |
| 3449 | |
| 3450 | UPB_API_INLINE bool upb_Message_SetFloat(struct upb_Message* msg, |
| 3451 | const upb_MiniTableField* f, |
| 3452 | float value, upb_Arena* a) { |
Protobuf Team Bot | 6afb130 | 2024-05-08 02:19:22 +0000 | [diff] [blame] | 3453 | 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 Bot | 7646fbf | 2024-05-03 19:47:53 +0000 | [diff] [blame] | 3457 | } |
| 3458 | |
| 3459 | UPB_API_INLINE bool upb_Message_SetInt32(struct upb_Message* msg, |
| 3460 | const upb_MiniTableField* f, |
| 3461 | int32_t value, upb_Arena* a) { |
Protobuf Team Bot | 6afb130 | 2024-05-08 02:19:22 +0000 | [diff] [blame] | 3462 | 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 Bot | 7646fbf | 2024-05-03 19:47:53 +0000 | [diff] [blame] | 3466 | } |
| 3467 | |
| 3468 | UPB_API_INLINE bool upb_Message_SetInt64(struct upb_Message* msg, |
| 3469 | const upb_MiniTableField* f, |
| 3470 | int64_t value, upb_Arena* a) { |
Protobuf Team Bot | 6afb130 | 2024-05-08 02:19:22 +0000 | [diff] [blame] | 3471 | 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 Bot | 7646fbf | 2024-05-03 19:47:53 +0000 | [diff] [blame] | 3475 | } |
| 3476 | |
Protobuf Team Bot | 4d3a98c | 2024-05-08 01:37:14 +0000 | [diff] [blame] | 3477 | // Sets the value of a message-typed field. The mini_tables of `msg` and |
Protobuf Team Bot | b51dc1b | 2024-05-09 21:34:06 +0000 | [diff] [blame] | 3478 | // `value` must have been linked for this to work correctly. |
Protobuf Team Bot | 4d3a98c | 2024-05-08 01:37:14 +0000 | [diff] [blame] | 3479 | UPB_API_INLINE void upb_Message_SetMessage(struct upb_Message* msg, |
Protobuf Team Bot | 4d3a98c | 2024-05-08 01:37:14 +0000 | [diff] [blame] | 3480 | const upb_MiniTableField* f, |
Protobuf Team Bot | b51dc1b | 2024-05-09 21:34:06 +0000 | [diff] [blame] | 3481 | struct upb_Message* value) { |
Protobuf Team Bot | 4d3a98c | 2024-05-08 01:37:14 +0000 | [diff] [blame] | 3482 | UPB_PRIVATE(_upb_Message_SetTaggedMessagePtr) |
Protobuf Team Bot | b51dc1b | 2024-05-09 21:34:06 +0000 | [diff] [blame] | 3483 | (msg, f, UPB_PRIVATE(_upb_TaggedMessagePtr_Pack)(value, false)); |
Protobuf Team Bot | 4d3a98c | 2024-05-08 01:37:14 +0000 | [diff] [blame] | 3484 | } |
| 3485 | |
Protobuf Team Bot | 7646fbf | 2024-05-03 19:47:53 +0000 | [diff] [blame] | 3486 | // 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. |
| 3490 | UPB_API_INLINE bool upb_Message_SetString(struct upb_Message* msg, |
| 3491 | const upb_MiniTableField* f, |
| 3492 | upb_StringView value, upb_Arena* a) { |
Protobuf Team Bot | 6afb130 | 2024-05-08 02:19:22 +0000 | [diff] [blame] | 3493 | 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 Bot | 7646fbf | 2024-05-03 19:47:53 +0000 | [diff] [blame] | 3497 | } |
| 3498 | |
| 3499 | UPB_API_INLINE bool upb_Message_SetUInt32(struct upb_Message* msg, |
| 3500 | const upb_MiniTableField* f, |
| 3501 | uint32_t value, upb_Arena* a) { |
Protobuf Team Bot | 6afb130 | 2024-05-08 02:19:22 +0000 | [diff] [blame] | 3502 | 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 Bot | 7646fbf | 2024-05-03 19:47:53 +0000 | [diff] [blame] | 3506 | } |
| 3507 | |
| 3508 | UPB_API_INLINE bool upb_Message_SetUInt64(struct upb_Message* msg, |
| 3509 | const upb_MiniTableField* f, |
| 3510 | uint64_t value, upb_Arena* a) { |
Protobuf Team Bot | 6afb130 | 2024-05-08 02:19:22 +0000 | [diff] [blame] | 3511 | 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 Bot | 7646fbf | 2024-05-03 19:47:53 +0000 | [diff] [blame] | 3515 | } |
| 3516 | |
Protobuf Team Bot | b3878b5 | 2024-02-08 21:50:53 +0000 | [diff] [blame] | 3517 | UPB_API_INLINE void upb_Message_Clear(struct upb_Message* msg, |
| 3518 | const upb_MiniTable* m) { |
| 3519 | UPB_ASSERT(!upb_Message_IsFrozen(msg)); |
Protobuf Team Bot | d813cc0 | 2024-04-08 19:12:29 +0000 | [diff] [blame] | 3520 | upb_Message_Internal* in = UPB_PRIVATE(_upb_Message_GetInternal)(msg); |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 3521 | memset(msg, 0, m->UPB_PRIVATE(size)); |
Protobuf Team Bot | d813cc0 | 2024-04-08 19:12:29 +0000 | [diff] [blame] | 3522 | 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 Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 3528 | } |
| 3529 | |
Protobuf Team Bot | b3878b5 | 2024-02-08 21:50:53 +0000 | [diff] [blame] | 3530 | UPB_API_INLINE void upb_Message_ClearBaseField(struct upb_Message* msg, |
| 3531 | const upb_MiniTableField* f) { |
| 3532 | UPB_ASSERT(!upb_Message_IsFrozen(msg)); |
Protobuf Team Bot | 4e90ead | 2024-01-08 15:46:34 +0000 | [diff] [blame] | 3533 | 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 Bot | 9bee747 | 2024-01-10 18:09:23 +0000 | [diff] [blame] | 3542 | (f, UPB_PRIVATE(_upb_Message_MutableDataPtr)(msg, f), zeros); |
Protobuf Team Bot | 4e90ead | 2024-01-08 15:46:34 +0000 | [diff] [blame] | 3543 | } |
| 3544 | |
Protobuf Team Bot | b3878b5 | 2024-02-08 21:50:53 +0000 | [diff] [blame] | 3545 | UPB_API_INLINE void upb_Message_ClearExtension( |
Protobuf Team Bot | 4e90ead | 2024-01-08 15:46:34 +0000 | [diff] [blame] | 3546 | struct upb_Message* msg, const upb_MiniTableExtension* e) { |
Protobuf Team Bot | b3878b5 | 2024-02-08 21:50:53 +0000 | [diff] [blame] | 3547 | UPB_ASSERT(!upb_Message_IsFrozen(msg)); |
Protobuf Team Bot | 886a0b1 | 2024-01-26 21:23:01 +0000 | [diff] [blame] | 3548 | upb_Message_Internal* in = UPB_PRIVATE(_upb_Message_GetInternal)(msg); |
Protobuf Team Bot | 2b79738 | 2023-12-30 23:16:16 +0000 | [diff] [blame] | 3549 | if (!in) return; |
Protobuf Team Bot | c13512a | 2024-01-25 18:53:49 +0000 | [diff] [blame] | 3550 | 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 Salo | 1050599 | 2022-12-12 12:16:36 -0800 | [diff] [blame] | 3552 | if (ext) { |
| 3553 | *ext = *base; |
Protobuf Team Bot | c13512a | 2024-01-25 18:53:49 +0000 | [diff] [blame] | 3554 | in->ext_begin += sizeof(upb_Extension); |
Mike Kruskal | 3bc5049 | 2022-12-01 13:34:12 -0800 | [diff] [blame] | 3555 | } |
| 3556 | } |
| 3557 | |
Protobuf Team Bot | ae17e81 | 2024-05-07 16:59:23 +0000 | [diff] [blame] | 3558 | UPB_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 Bot | 7646fbf | 2024-05-03 19:47:53 +0000 | [diff] [blame] | 3573 | UPB_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 Salo | b7d54ac | 2022-12-29 11:59:42 -0800 | [diff] [blame] | 3580 | } |
Protobuf Team Bot | 7646fbf | 2024-05-03 19:47:53 +0000 | [diff] [blame] | 3581 | return upb_Array_MutableDataPtr(arr); |
Eric Salo | b7d54ac | 2022-12-29 11:59:42 -0800 | [diff] [blame] | 3582 | } |
| 3583 | |
Deanna Garcia | bd6a0cf | 2023-04-20 10:30:44 -0700 | [diff] [blame] | 3584 | #ifdef __cplusplus |
| 3585 | } /* extern "C" */ |
| 3586 | #endif |
| 3587 | |
| 3588 | #if defined(__GNUC__) && !defined(__clang__) |
| 3589 | #pragma GCC diagnostic pop |
| 3590 | #endif |
| 3591 | |
| 3592 | |
Sandy Zhang | e3b0943 | 2023-08-07 09:30:02 -0700 | [diff] [blame] | 3593 | #endif // UPB_MESSAGE_INTERNAL_ACCESSORS_H_ |
Deanna Garcia | bd6a0cf | 2023-04-20 10:30:44 -0700 | [diff] [blame] | 3594 | |
Protobuf Team Bot | 499c748 | 2023-12-30 01:42:17 +0000 | [diff] [blame] | 3595 | #ifndef UPB_MESSAGE_MAP_H_ |
| 3596 | #define UPB_MESSAGE_MAP_H_ |
Protobuf Team Bot | 376ba2f | 2023-09-29 22:17:43 +0000 | [diff] [blame] | 3597 | |
Protobuf Team Bot | 499c748 | 2023-12-30 01:42:17 +0000 | [diff] [blame] | 3598 | #include <stddef.h> |
Protobuf Team Bot | 376ba2f | 2023-09-29 22:17:43 +0000 | [diff] [blame] | 3599 | |
| 3600 | |
| 3601 | // Must be last. |
| 3602 | |
Protobuf Team Bot | 499c748 | 2023-12-30 01:42:17 +0000 | [diff] [blame] | 3603 | typedef struct upb_Map upb_Map; |
Protobuf Team Bot | c9a8b46 | 2023-11-18 01:30:26 +0000 | [diff] [blame] | 3604 | |
Protobuf Team Bot | 376ba2f | 2023-09-29 22:17:43 +0000 | [diff] [blame] | 3605 | #ifdef __cplusplus |
| 3606 | extern "C" { |
| 3607 | #endif |
| 3608 | |
Protobuf Team Bot | 499c748 | 2023-12-30 01:42:17 +0000 | [diff] [blame] | 3609 | // Creates a new map on the given arena with the given key/value size. |
| 3610 | UPB_API upb_Map* upb_Map_New(upb_Arena* a, upb_CType key_type, |
| 3611 | upb_CType value_type); |
Protobuf Team Bot | c9a8b46 | 2023-11-18 01:30:26 +0000 | [diff] [blame] | 3612 | |
Protobuf Team Bot | 499c748 | 2023-12-30 01:42:17 +0000 | [diff] [blame] | 3613 | // Returns the number of entries in the map. |
| 3614 | UPB_API size_t upb_Map_Size(const upb_Map* map); |
Protobuf Team Bot | 376ba2f | 2023-09-29 22:17:43 +0000 | [diff] [blame] | 3615 | |
Protobuf Team Bot | 499c748 | 2023-12-30 01:42:17 +0000 | [diff] [blame] | 3616 | // 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. |
| 3619 | UPB_API bool upb_Map_Get(const upb_Map* map, upb_MessageValue key, |
| 3620 | upb_MessageValue* val); |
| 3621 | |
| 3622 | // Removes all entries in the map. |
| 3623 | UPB_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. |
| 3628 | UPB_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. |
| 3635 | UPB_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 Bot | c9a8b46 | 2023-11-18 01:30:26 +0000 | [diff] [blame] | 3639 | } |
| 3640 | |
Protobuf Team Bot | 499c748 | 2023-12-30 01:42:17 +0000 | [diff] [blame] | 3641 | // 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. |
| 3643 | UPB_API bool upb_Map_Delete(upb_Map* map, upb_MessageValue key, |
| 3644 | upb_MessageValue* val); |
| 3645 | |
Protobuf Team Bot | 499c748 | 2023-12-30 01:42:17 +0000 | [diff] [blame] | 3646 | // 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 Bot | 376ba2f | 2023-09-29 22:17:43 +0000 | [diff] [blame] | 3653 | |
Protobuf Team Bot | b3878b5 | 2024-02-08 21:50:53 +0000 | [diff] [blame] | 3654 | #define kUpb_Map_Begin ((size_t) - 1) |
Protobuf Team Bot | 376ba2f | 2023-09-29 22:17:43 +0000 | [diff] [blame] | 3655 | |
Protobuf Team Bot | 499c748 | 2023-12-30 01:42:17 +0000 | [diff] [blame] | 3656 | // Advances to the next entry. Returns false if no more entries are present. |
| 3657 | // Otherwise returns true and populates both *key and *value. |
| 3658 | UPB_API bool upb_Map_Next(const upb_Map* map, upb_MessageValue* key, |
| 3659 | upb_MessageValue* val, size_t* iter); |
Protobuf Team Bot | 376ba2f | 2023-09-29 22:17:43 +0000 | [diff] [blame] | 3660 | |
Protobuf Team Bot | 499c748 | 2023-12-30 01:42:17 +0000 | [diff] [blame] | 3661 | // Sets the value for the entry pointed to by iter. |
| 3662 | // WARNING: this does not currently work for string values! |
| 3663 | UPB_API void upb_Map_SetEntryValue(upb_Map* map, size_t iter, |
| 3664 | upb_MessageValue val); |
Protobuf Team Bot | 376ba2f | 2023-09-29 22:17:43 +0000 | [diff] [blame] | 3665 | |
Protobuf Team Bot | 499c748 | 2023-12-30 01:42:17 +0000 | [diff] [blame] | 3666 | // DEPRECATED iterator, slated for removal. |
Protobuf Team Bot | 376ba2f | 2023-09-29 22:17:43 +0000 | [diff] [blame] | 3667 | |
Protobuf Team Bot | 499c748 | 2023-12-30 01:42:17 +0000 | [diff] [blame] | 3668 | /* 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 Bot | 376ba2f | 2023-09-29 22:17:43 +0000 | [diff] [blame] | 3676 | |
Protobuf Team Bot | 499c748 | 2023-12-30 01:42:17 +0000 | [diff] [blame] | 3677 | // Advances to the next entry. Returns false if no more entries are present. |
| 3678 | UPB_API bool upb_MapIterator_Next(const upb_Map* map, size_t* iter); |
Protobuf Team Bot | 376ba2f | 2023-09-29 22:17:43 +0000 | [diff] [blame] | 3679 | |
Protobuf Team Bot | 499c748 | 2023-12-30 01:42:17 +0000 | [diff] [blame] | 3680 | // 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). |
| 3683 | UPB_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. |
| 3686 | UPB_API upb_MessageValue upb_MapIterator_Key(const upb_Map* map, size_t iter); |
| 3687 | UPB_API upb_MessageValue upb_MapIterator_Value(const upb_Map* map, size_t iter); |
Protobuf Team Bot | 030ab8d | 2023-12-01 19:20:11 +0000 | [diff] [blame] | 3688 | |
Protobuf Team Bot | 886a0b1 | 2024-01-26 21:23:01 +0000 | [diff] [blame] | 3689 | // 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. |
| 3692 | UPB_API void upb_Map_Freeze(upb_Map* map, const upb_MiniTable* m); |
| 3693 | |
| 3694 | // Returns whether a map has been frozen. |
Protobuf Team Bot | b3878b5 | 2024-02-08 21:50:53 +0000 | [diff] [blame] | 3695 | UPB_API_INLINE bool upb_Map_IsFrozen(const upb_Map* map); |
Protobuf Team Bot | 886a0b1 | 2024-01-26 21:23:01 +0000 | [diff] [blame] | 3696 | |
Protobuf Team Bot | 376ba2f | 2023-09-29 22:17:43 +0000 | [diff] [blame] | 3697 | #ifdef __cplusplus |
| 3698 | } /* extern "C" */ |
| 3699 | #endif |
| 3700 | |
Protobuf Team Bot | 499c748 | 2023-12-30 01:42:17 +0000 | [diff] [blame] | 3701 | |
| 3702 | #endif /* UPB_MESSAGE_MAP_H_ */ |
| 3703 | |
Protobuf Team Bot | 499c748 | 2023-12-30 01:42:17 +0000 | [diff] [blame] | 3704 | // 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 Bot | 499c748 | 2023-12-30 01:42:17 +0000 | [diff] [blame] | 3716 | typedef struct upb_Message upb_Message; |
| 3717 | |
| 3718 | #ifdef __cplusplus |
| 3719 | extern "C" { |
| 3720 | #endif |
| 3721 | |
| 3722 | // Creates a new message with the given mini_table on the given arena. |
| 3723 | UPB_API upb_Message* upb_Message_New(const upb_MiniTable* m, upb_Arena* arena); |
| 3724 | |
| 3725 | // Returns a reference to the message's unknown data. |
| 3726 | const char* upb_Message_GetUnknown(const upb_Message* msg, size_t* len); |
| 3727 | |
| 3728 | // Removes partial unknown data from message. |
| 3729 | void upb_Message_DeleteUnknown(upb_Message* msg, const char* data, size_t len); |
| 3730 | |
| 3731 | // Returns the number of extensions present in this message. |
| 3732 | size_t upb_Message_ExtensionCount(const upb_Message* msg); |
| 3733 | |
Protobuf Team Bot | 886a0b1 | 2024-01-26 21:23:01 +0000 | [diff] [blame] | 3734 | // Mark a message and all of its descendents as frozen/immutable. |
| 3735 | UPB_API void upb_Message_Freeze(upb_Message* msg, const upb_MiniTable* m); |
| 3736 | |
| 3737 | // Returns whether a message has been frozen. |
Protobuf Team Bot | b3878b5 | 2024-02-08 21:50:53 +0000 | [diff] [blame] | 3738 | UPB_API_INLINE bool upb_Message_IsFrozen(const upb_Message* msg); |
Protobuf Team Bot | 886a0b1 | 2024-01-26 21:23:01 +0000 | [diff] [blame] | 3739 | |
Protobuf Team Bot | fb08bca | 2024-03-14 15:21:13 +0000 | [diff] [blame] | 3740 | #ifdef UPB_TRACING_ENABLED |
Protobuf Team Bot | 51cba7c | 2024-05-06 13:34:40 +0000 | [diff] [blame] | 3741 | UPB_API void upb_Message_LogNewMessage(const upb_MiniTable* m, |
| 3742 | const upb_Arena* arena); |
| 3743 | |
| 3744 | UPB_API void upb_Message_SetNewMessageTraceHandler( |
| 3745 | void (*handler)(const upb_MiniTable* m, const upb_Arena* arena)); |
| 3746 | #endif // UPB_TRACING_ENABLED |
Protobuf Team Bot | fb08bca | 2024-03-14 15:21:13 +0000 | [diff] [blame] | 3747 | |
Protobuf Team Bot | 499c748 | 2023-12-30 01:42:17 +0000 | [diff] [blame] | 3748 | #ifdef __cplusplus |
| 3749 | } /* extern "C" */ |
| 3750 | #endif |
| 3751 | |
| 3752 | |
| 3753 | #endif /* UPB_MESSAGE_MESSAGE_H_ */ |
| 3754 | |
Protobuf Team Bot | d1cf09a | 2024-04-19 22:43:34 +0000 | [diff] [blame] | 3755 | #ifndef UPB_MINI_TABLE_TAGGED_PTR_H_ |
| 3756 | #define UPB_MINI_TABLE_TAGGED_PTR_H_ |
| 3757 | |
| 3758 | #include <stdint.h> |
| 3759 | |
| 3760 | |
Protobuf Team Bot | 499c748 | 2023-12-30 01:42:17 +0000 | [diff] [blame] | 3761 | // 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 | |
| 3772 | typedef uintptr_t upb_TaggedMessagePtr; |
| 3773 | |
| 3774 | #ifdef __cplusplus |
| 3775 | extern "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 Bot | b3878b5 | 2024-02-08 21:50:53 +0000 | [diff] [blame] | 3781 | UPB_API_INLINE bool upb_TaggedMessagePtr_IsEmpty(upb_TaggedMessagePtr ptr); |
Protobuf Team Bot | 499c748 | 2023-12-30 01:42:17 +0000 | [diff] [blame] | 3782 | |
Protobuf Team Bot | b3878b5 | 2024-02-08 21:50:53 +0000 | [diff] [blame] | 3783 | UPB_API_INLINE upb_Message* upb_TaggedMessagePtr_GetNonEmptyMessage( |
| 3784 | upb_TaggedMessagePtr ptr); |
Protobuf Team Bot | 499c748 | 2023-12-30 01:42:17 +0000 | [diff] [blame] | 3785 | |
| 3786 | #ifdef __cplusplus |
| 3787 | } /* extern "C" */ |
| 3788 | #endif |
| 3789 | |
| 3790 | |
| 3791 | #endif /* UPB_MINI_TABLE_TAGGED_PTR_H_ */ |
Protobuf Team Bot | 376ba2f | 2023-09-29 22:17:43 +0000 | [diff] [blame] | 3792 | |
Deanna Garcia | bd6a0cf | 2023-04-20 10:30:44 -0700 | [diff] [blame] | 3793 | // Must be last. |
| 3794 | |
| 3795 | #ifdef __cplusplus |
| 3796 | extern "C" { |
| 3797 | #endif |
Eric Salo | 1050599 | 2022-12-12 12:16:36 -0800 | [diff] [blame] | 3798 | |
Protobuf Team Bot | 4e90ead | 2024-01-08 15:46:34 +0000 | [diff] [blame] | 3799 | // 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 Kruskal | 3bc5049 | 2022-12-01 13:34:12 -0800 | [diff] [blame] | 3804 | |
Protobuf Team Bot | b3878b5 | 2024-02-08 21:50:53 +0000 | [diff] [blame] | 3805 | UPB_API_INLINE void upb_Message_Clear(upb_Message* msg, const upb_MiniTable* m); |
Protobuf Team Bot | 4e90ead | 2024-01-08 15:46:34 +0000 | [diff] [blame] | 3806 | |
| 3807 | UPB_API_INLINE void upb_Message_ClearBaseField(upb_Message* msg, |
Protobuf Team Bot | b3878b5 | 2024-02-08 21:50:53 +0000 | [diff] [blame] | 3808 | const upb_MiniTableField* f); |
Protobuf Team Bot | 4e90ead | 2024-01-08 15:46:34 +0000 | [diff] [blame] | 3809 | |
Protobuf Team Bot | b3878b5 | 2024-02-08 21:50:53 +0000 | [diff] [blame] | 3810 | UPB_API_INLINE void upb_Message_ClearExtension(upb_Message* msg, |
| 3811 | const upb_MiniTableExtension* e); |
Jie Luo | f36a5c6 | 2023-05-23 17:56:18 -0700 | [diff] [blame] | 3812 | |
Protobuf Team Bot | ae17e81 | 2024-05-07 16:59:23 +0000 | [diff] [blame] | 3813 | UPB_API_INLINE void upb_Message_ClearOneof(upb_Message* msg, |
| 3814 | const upb_MiniTable* m, |
| 3815 | const upb_MiniTableField* f); |
| 3816 | |
Protobuf Team Bot | 8c1f635 | 2024-01-10 05:18:15 +0000 | [diff] [blame] | 3817 | UPB_API_INLINE bool upb_Message_HasBaseField(const upb_Message* msg, |
Protobuf Team Bot | b3878b5 | 2024-02-08 21:50:53 +0000 | [diff] [blame] | 3818 | const upb_MiniTableField* f); |
Protobuf Team Bot | 8c1f635 | 2024-01-10 05:18:15 +0000 | [diff] [blame] | 3819 | |
| 3820 | UPB_API_INLINE bool upb_Message_HasExtension(const upb_Message* msg, |
Protobuf Team Bot | b3878b5 | 2024-02-08 21:50:53 +0000 | [diff] [blame] | 3821 | const upb_MiniTableExtension* e); |
Eric Salo | 8809a11 | 2022-11-21 13:01:06 -0800 | [diff] [blame] | 3822 | |
Protobuf Team Bot | 7646fbf | 2024-05-03 19:47:53 +0000 | [diff] [blame] | 3823 | UPB_API_INLINE upb_MessageValue |
| 3824 | upb_Message_GetField(const upb_Message* msg, const upb_MiniTableField* f, |
| 3825 | upb_MessageValue default_val); |
Eric Salo | b598b2d | 2022-12-22 23:14:27 -0800 | [diff] [blame] | 3826 | |
Protobuf Team Bot | 4d3a98c | 2024-05-08 01:37:14 +0000 | [diff] [blame] | 3827 | UPB_API_INLINE upb_TaggedMessagePtr upb_Message_GetTaggedMessagePtr( |
| 3828 | const upb_Message* msg, const upb_MiniTableField* field, |
| 3829 | upb_Message* default_val); |
| 3830 | |
Protobuf Team Bot | 7646fbf | 2024-05-03 19:47:53 +0000 | [diff] [blame] | 3831 | UPB_API_INLINE const upb_Array* upb_Message_GetArray( |
| 3832 | const upb_Message* msg, const upb_MiniTableField* f); |
Protobuf Team Bot | 54573a4 | 2023-11-21 14:47:34 +0000 | [diff] [blame] | 3833 | |
Eric Salo | 1050599 | 2022-12-12 12:16:36 -0800 | [diff] [blame] | 3834 | UPB_API_INLINE bool upb_Message_GetBool(const upb_Message* msg, |
Protobuf Team Bot | 7646fbf | 2024-05-03 19:47:53 +0000 | [diff] [blame] | 3835 | const upb_MiniTableField* f, |
| 3836 | bool default_val); |
Eric Salo | 8809a11 | 2022-11-21 13:01:06 -0800 | [diff] [blame] | 3837 | |
Eric Salo | 1050599 | 2022-12-12 12:16:36 -0800 | [diff] [blame] | 3838 | UPB_API_INLINE double upb_Message_GetDouble(const upb_Message* msg, |
| 3839 | const upb_MiniTableField* field, |
Protobuf Team Bot | 7646fbf | 2024-05-03 19:47:53 +0000 | [diff] [blame] | 3840 | double default_val); |
Protobuf Team Bot | 54573a4 | 2023-11-21 14:47:34 +0000 | [diff] [blame] | 3841 | |
Protobuf Team Bot | 7646fbf | 2024-05-03 19:47:53 +0000 | [diff] [blame] | 3842 | UPB_API_INLINE float upb_Message_GetFloat(const upb_Message* msg, |
| 3843 | const upb_MiniTableField* f, |
| 3844 | float default_val); |
Eric Salo | 8809a11 | 2022-11-21 13:01:06 -0800 | [diff] [blame] | 3845 | |
Protobuf Team Bot | 7646fbf | 2024-05-03 19:47:53 +0000 | [diff] [blame] | 3846 | UPB_API_INLINE int32_t upb_Message_GetInt32(const upb_Message* msg, |
| 3847 | const upb_MiniTableField* f, |
| 3848 | int32_t default_val); |
| 3849 | |
| 3850 | UPB_API_INLINE int64_t upb_Message_GetInt64(const upb_Message* msg, |
| 3851 | const upb_MiniTableField* f, |
| 3852 | int64_t default_val); |
| 3853 | |
| 3854 | UPB_API_INLINE const upb_Map* upb_Message_GetMap(const upb_Message* msg, |
| 3855 | const upb_MiniTableField* f); |
| 3856 | |
Protobuf Team Bot | 4d3a98c | 2024-05-08 01:37:14 +0000 | [diff] [blame] | 3857 | UPB_API_INLINE const upb_Message* upb_Message_GetMessage( |
| 3858 | const upb_Message* msg, const upb_MiniTableField* f); |
| 3859 | |
Protobuf Team Bot | 7646fbf | 2024-05-03 19:47:53 +0000 | [diff] [blame] | 3860 | UPB_API_INLINE upb_Array* upb_Message_GetMutableArray( |
| 3861 | upb_Message* msg, const upb_MiniTableField* f); |
| 3862 | |
| 3863 | UPB_API_INLINE upb_Map* upb_Message_GetMutableMap(upb_Message* msg, |
| 3864 | const upb_MiniTableField* f); |
| 3865 | |
Protobuf Team Bot | 4d3a98c | 2024-05-08 01:37:14 +0000 | [diff] [blame] | 3866 | UPB_API_INLINE upb_Message* upb_Message_GetMutableMessage( |
| 3867 | upb_Message* msg, const upb_MiniTableField* f); |
| 3868 | |
Protobuf Team Bot | 7646fbf | 2024-05-03 19:47:53 +0000 | [diff] [blame] | 3869 | UPB_API_INLINE upb_Array* upb_Message_GetOrCreateMutableArray( |
| 3870 | upb_Message* msg, const upb_MiniTableField* f, upb_Arena* arena); |
| 3871 | |
| 3872 | UPB_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 | |
| 3876 | UPB_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 Salo | 8809a11 | 2022-11-21 13:01:06 -0800 | [diff] [blame] | 3879 | |
Eric Salo | 3f36a91 | 2022-12-05 14:12:25 -0800 | [diff] [blame] | 3880 | UPB_API_INLINE upb_StringView |
Eric Salo | 1050599 | 2022-12-12 12:16:36 -0800 | [diff] [blame] | 3881 | upb_Message_GetString(const upb_Message* msg, const upb_MiniTableField* field, |
Protobuf Team Bot | 7646fbf | 2024-05-03 19:47:53 +0000 | [diff] [blame] | 3882 | upb_StringView default_val); |
Protobuf Team Bot | 54573a4 | 2023-11-21 14:47:34 +0000 | [diff] [blame] | 3883 | |
Protobuf Team Bot | 7646fbf | 2024-05-03 19:47:53 +0000 | [diff] [blame] | 3884 | UPB_API_INLINE uint32_t upb_Message_GetUInt32(const upb_Message* msg, |
| 3885 | const upb_MiniTableField* f, |
| 3886 | uint32_t default_val); |
Eric Salo | 8809a11 | 2022-11-21 13:01:06 -0800 | [diff] [blame] | 3887 | |
Protobuf Team Bot | 7646fbf | 2024-05-03 19:47:53 +0000 | [diff] [blame] | 3888 | UPB_API_INLINE uint64_t upb_Message_GetUInt64(const upb_Message* msg, |
| 3889 | const upb_MiniTableField* f, |
| 3890 | uint64_t default_val); |
| 3891 | |
Protobuf Team Bot | 7646fbf | 2024-05-03 19:47:53 +0000 | [diff] [blame] | 3892 | UPB_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 Bot | ddc70b0 | 2024-05-11 02:21:06 +0000 | [diff] [blame] | 3896 | // BaseField Setters /////////////////////////////////////////////////////////// |
| 3897 | |
| 3898 | UPB_API_INLINE void upb_Message_SetBaseField(upb_Message* msg, |
| 3899 | const upb_MiniTableField* f, |
| 3900 | const void* val); |
| 3901 | |
| 3902 | UPB_API_INLINE void upb_Message_SetBaseFieldBool(struct upb_Message* msg, |
| 3903 | const upb_MiniTableField* f, |
| 3904 | bool value); |
| 3905 | |
| 3906 | UPB_API_INLINE void upb_Message_SetBaseFieldDouble(struct upb_Message* msg, |
| 3907 | const upb_MiniTableField* f, |
| 3908 | double value); |
| 3909 | |
| 3910 | UPB_API_INLINE void upb_Message_SetBaseFieldFloat(struct upb_Message* msg, |
| 3911 | const upb_MiniTableField* f, |
| 3912 | float value); |
| 3913 | |
| 3914 | UPB_API_INLINE void upb_Message_SetBaseFieldInt32(struct upb_Message* msg, |
| 3915 | const upb_MiniTableField* f, |
| 3916 | int32_t value); |
| 3917 | |
| 3918 | UPB_API_INLINE void upb_Message_SetBaseFieldInt64(struct upb_Message* msg, |
| 3919 | const upb_MiniTableField* f, |
| 3920 | int64_t value); |
| 3921 | |
| 3922 | UPB_API_INLINE void upb_Message_SetBaseFieldString(struct upb_Message* msg, |
| 3923 | const upb_MiniTableField* f, |
| 3924 | upb_StringView value); |
| 3925 | |
| 3926 | UPB_API_INLINE void upb_Message_SetBaseFieldUInt32(struct upb_Message* msg, |
| 3927 | const upb_MiniTableField* f, |
| 3928 | uint32_t value); |
| 3929 | |
| 3930 | UPB_API_INLINE void upb_Message_SetBaseFieldUInt64(struct upb_Message* msg, |
| 3931 | const upb_MiniTableField* f, |
| 3932 | uint64_t value); |
| 3933 | |
| 3934 | // Extension Setters /////////////////////////////////////////////////////////// |
| 3935 | |
| 3936 | UPB_API_INLINE bool upb_Message_SetExtension(upb_Message* msg, |
| 3937 | const upb_MiniTableExtension* e, |
| 3938 | const void* value, upb_Arena* a); |
| 3939 | |
| 3940 | UPB_API_INLINE bool upb_Message_SetExtensionBool( |
| 3941 | struct upb_Message* msg, const upb_MiniTableExtension* e, bool value, |
| 3942 | upb_Arena* a); |
| 3943 | |
| 3944 | UPB_API_INLINE bool upb_Message_SetExtensionDouble( |
| 3945 | struct upb_Message* msg, const upb_MiniTableExtension* e, double value, |
| 3946 | upb_Arena* a); |
| 3947 | |
| 3948 | UPB_API_INLINE bool upb_Message_SetExtensionFloat( |
| 3949 | struct upb_Message* msg, const upb_MiniTableExtension* e, float value, |
| 3950 | upb_Arena* a); |
| 3951 | |
| 3952 | UPB_API_INLINE bool upb_Message_SetExtensionInt32( |
| 3953 | struct upb_Message* msg, const upb_MiniTableExtension* e, int32_t value, |
| 3954 | upb_Arena* a); |
| 3955 | |
| 3956 | UPB_API_INLINE bool upb_Message_SetExtensionInt64( |
| 3957 | struct upb_Message* msg, const upb_MiniTableExtension* e, int64_t value, |
| 3958 | upb_Arena* a); |
| 3959 | |
| 3960 | UPB_API_INLINE bool upb_Message_SetExtensionString( |
| 3961 | struct upb_Message* msg, const upb_MiniTableExtension* e, |
| 3962 | upb_StringView value, upb_Arena* a); |
| 3963 | |
| 3964 | UPB_API_INLINE bool upb_Message_SetExtensionUInt32( |
| 3965 | struct upb_Message* msg, const upb_MiniTableExtension* e, uint32_t value, |
| 3966 | upb_Arena* a); |
| 3967 | |
| 3968 | UPB_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 | |
| 3974 | UPB_API_INLINE bool upb_Message_SetBool(upb_Message* msg, |
| 3975 | const upb_MiniTableField* f, bool value, |
| 3976 | upb_Arena* a); |
| 3977 | |
Protobuf Team Bot | 7646fbf | 2024-05-03 19:47:53 +0000 | [diff] [blame] | 3978 | UPB_API_INLINE bool upb_Message_SetDouble(upb_Message* msg, |
| 3979 | const upb_MiniTableField* f, |
| 3980 | double value, upb_Arena* a); |
| 3981 | |
| 3982 | UPB_API_INLINE bool upb_Message_SetFloat(upb_Message* msg, |
| 3983 | const upb_MiniTableField* f, |
| 3984 | float value, upb_Arena* a); |
| 3985 | |
| 3986 | UPB_API_INLINE bool upb_Message_SetInt32(upb_Message* msg, |
| 3987 | const upb_MiniTableField* f, |
| 3988 | int32_t value, upb_Arena* a); |
| 3989 | |
| 3990 | UPB_API_INLINE bool upb_Message_SetInt64(upb_Message* msg, |
| 3991 | const upb_MiniTableField* f, |
| 3992 | int64_t value, upb_Arena* a); |
| 3993 | |
Protobuf Team Bot | 4d3a98c | 2024-05-08 01:37:14 +0000 | [diff] [blame] | 3994 | UPB_API_INLINE void upb_Message_SetMessage(upb_Message* msg, |
Protobuf Team Bot | 4d3a98c | 2024-05-08 01:37:14 +0000 | [diff] [blame] | 3995 | const upb_MiniTableField* f, |
Protobuf Team Bot | b51dc1b | 2024-05-09 21:34:06 +0000 | [diff] [blame] | 3996 | upb_Message* value); |
Protobuf Team Bot | 4d3a98c | 2024-05-08 01:37:14 +0000 | [diff] [blame] | 3997 | |
Eric Salo | 1050599 | 2022-12-12 12:16:36 -0800 | [diff] [blame] | 3998 | UPB_API_INLINE bool upb_Message_SetString(upb_Message* msg, |
Protobuf Team Bot | 7646fbf | 2024-05-03 19:47:53 +0000 | [diff] [blame] | 3999 | const upb_MiniTableField* f, |
| 4000 | upb_StringView value, upb_Arena* a); |
| 4001 | |
| 4002 | UPB_API_INLINE bool upb_Message_SetUInt32(upb_Message* msg, |
| 4003 | const upb_MiniTableField* f, |
| 4004 | uint32_t value, upb_Arena* a); |
| 4005 | |
| 4006 | UPB_API_INLINE bool upb_Message_SetUInt64(upb_Message* msg, |
| 4007 | const upb_MiniTableField* f, |
| 4008 | uint64_t value, upb_Arena* a); |
Eric Salo | 8809a11 | 2022-11-21 13:01:06 -0800 | [diff] [blame] | 4009 | |
Protobuf Team Bot | ddc70b0 | 2024-05-11 02:21:06 +0000 | [diff] [blame] | 4010 | //////////////////////////////////////////////////////////////////////////////// |
| 4011 | |
Jie Luo | f36a5c6 | 2023-05-23 17:56:18 -0700 | [diff] [blame] | 4012 | UPB_API_INLINE void* upb_Message_ResizeArrayUninitialized( |
Protobuf Team Bot | 7646fbf | 2024-05-03 19:47:53 +0000 | [diff] [blame] | 4013 | upb_Message* msg, const upb_MiniTableField* f, size_t size, |
| 4014 | upb_Arena* arena); |
Eric Salo | 1050599 | 2022-12-12 12:16:36 -0800 | [diff] [blame] | 4015 | |
Protobuf Team Bot | 7646fbf | 2024-05-03 19:47:53 +0000 | [diff] [blame] | 4016 | UPB_API_INLINE uint32_t upb_Message_WhichOneofFieldNumber( |
| 4017 | const upb_Message* message, const upb_MiniTableField* oneof_field); |
Eric Salo | b598b2d | 2022-12-22 23:14:27 -0800 | [diff] [blame] | 4018 | |
Protobuf Team Bot | 6cce622 | 2024-05-28 17:15:46 +0000 | [diff] [blame] | 4019 | // For a field `f` which is in a oneof, return the field of that |
| 4020 | // oneof that is actually set (or NULL if none). |
| 4021 | UPB_API_INLINE const upb_MiniTableField* upb_Message_WhichOneof( |
| 4022 | const upb_Message* msg, const upb_MiniTable* m, |
| 4023 | const upb_MiniTableField* f); |
| 4024 | |
Eric Salo | b598b2d | 2022-12-22 23:14:27 -0800 | [diff] [blame] | 4025 | // Updates a map entry given an entry message. |
Protobuf Team Bot | 5b34337 | 2023-12-19 06:18:53 +0000 | [diff] [blame] | 4026 | bool 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 Salo | b598b2d | 2022-12-22 23:14:27 -0800 | [diff] [blame] | 4029 | |
Eric Salo | 8809a11 | 2022-11-21 13:01:06 -0800 | [diff] [blame] | 4030 | #ifdef __cplusplus |
| 4031 | } /* extern "C" */ |
| 4032 | #endif |
| 4033 | |
| 4034 | |
| 4035 | #endif // UPB_MESSAGE_ACCESSORS_H_ |
| 4036 | |
Protobuf Team Bot | 376ba2f | 2023-09-29 22:17:43 +0000 | [diff] [blame] | 4037 | // 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 |
| 4046 | extern "C" { |
| 4047 | #endif |
| 4048 | |
| 4049 | // Message map operations, these get the map from the message first. |
| 4050 | |
| 4051 | UPB_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 | |
| 4060 | UPB_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 | |
| 4066 | UPB_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 Kruskal | 9d43502 | 2023-07-11 12:45:07 -0700 | [diff] [blame] | 4086 | #ifndef UPB_MINI_TABLE_DECODE_H_ |
| 4087 | #define UPB_MINI_TABLE_DECODE_H_ |
| 4088 | |
| 4089 | |
Protobuf Team Bot | 4d3a98c | 2024-05-08 01:37:14 +0000 | [diff] [blame] | 4090 | #ifndef UPB_MINI_TABLE_SUB_H_ |
| 4091 | #define UPB_MINI_TABLE_SUB_H_ |
| 4092 | |
| 4093 | |
| 4094 | // Must be last. |
| 4095 | |
| 4096 | typedef union upb_MiniTableSub upb_MiniTableSub; |
| 4097 | |
| 4098 | #ifdef __cplusplus |
| 4099 | extern "C" { |
| 4100 | #endif |
| 4101 | |
| 4102 | // Constructors |
| 4103 | |
| 4104 | UPB_API_INLINE upb_MiniTableSub |
| 4105 | upb_MiniTableSub_FromEnum(const upb_MiniTableEnum* subenum); |
| 4106 | |
| 4107 | UPB_API_INLINE upb_MiniTableSub |
| 4108 | upb_MiniTableSub_FromMessage(const upb_MiniTable* submsg); |
| 4109 | |
| 4110 | // Getters |
| 4111 | |
| 4112 | UPB_API_INLINE const upb_MiniTableEnum* upb_MiniTableSub_Enum( |
| 4113 | upb_MiniTableSub sub); |
| 4114 | |
| 4115 | UPB_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 Kruskal | 9d43502 | 2023-07-11 12:45:07 -0700 | [diff] [blame] | 4125 | // Export the newer headers, for legacy users. New users should include the |
| 4126 | // more specific headers directly. |
| 4127 | // IWYU pragma: begin_exports |
Protobuf Team Bot | 59b938b | 2024-04-08 17:18:48 +0000 | [diff] [blame] | 4128 | |
Mike Kruskal | 9d43502 | 2023-07-11 12:45:07 -0700 | [diff] [blame] | 4129 | #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 |
| 4136 | extern "C" { |
| 4137 | #endif |
| 4138 | |
Protobuf Team Bot | 59b938b | 2024-04-08 17:18:48 +0000 | [diff] [blame] | 4139 | // Builds a upb_MiniTableEnum from an enum mini descriptor. |
| 4140 | // The mini descriptor must be for an enum, not a message. |
| 4141 | UPB_API upb_MiniTableEnum* upb_MiniTableEnum_Build(const char* data, size_t len, |
| 4142 | upb_Arena* arena, |
| 4143 | upb_Status* status); |
Mike Kruskal | 9d43502 | 2023-07-11 12:45:07 -0700 | [diff] [blame] | 4144 | |
| 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 |
| 4167 | extern "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. |
| 4177 | UPB_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. |
| 4184 | UPB_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; |
| 4199 | UPB_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. |
| 4209 | UPB_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 | |
| 4225 | typedef 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 |
| 4233 | extern "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. |
| 4240 | upb_MiniTable* _upb_MiniTable_Build(const char* data, size_t len, |
| 4241 | upb_MiniTablePlatform platform, |
| 4242 | upb_Arena* arena, upb_Status* status); |
| 4243 | |
| 4244 | UPB_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. |
| 4254 | const 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 | |
| 4261 | UPB_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 | |
| 4268 | UPB_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 | |
| 4273 | UPB_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 Bot | 842f56b | 2023-11-29 05:02:57 +0000 | [diff] [blame] | 4276 | upb_MiniTableSub sub = upb_MiniTableSub_FromMessage(NULL); |
Mike Kruskal | 9d43502 | 2023-07-11 12:45:07 -0700 | [diff] [blame] | 4277 | return _upb_MiniTableExtension_Build( |
| 4278 | data, len, extendee, sub, kUpb_MiniTablePlatform_Native, arena, status); |
| 4279 | } |
| 4280 | |
| 4281 | UPB_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 Bot | 842f56b | 2023-11-29 05:02:57 +0000 | [diff] [blame] | 4284 | upb_MiniTableSub sub = upb_MiniTableSub_FromMessage(submsg); |
Mike Kruskal | 9d43502 | 2023-07-11 12:45:07 -0700 | [diff] [blame] | 4285 | return _upb_MiniTableExtension_Build( |
| 4286 | data, len, extendee, sub, kUpb_MiniTablePlatform_Native, arena, status); |
| 4287 | } |
| 4288 | |
| 4289 | UPB_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 Bot | 842f56b | 2023-11-29 05:02:57 +0000 | [diff] [blame] | 4292 | upb_MiniTableSub sub = upb_MiniTableSub_FromEnum(subenum); |
Mike Kruskal | 9d43502 | 2023-07-11 12:45:07 -0700 | [diff] [blame] | 4293 | 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. |
| 4303 | upb_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 Bot | 4eeaa22 | 2023-12-04 05:00:05 +0000 | [diff] [blame] | 4315 | #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 |
| 4322 | extern "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 | |
| 4359 | typedef 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. |
| 4363 | UPB_API upb_ExtensionRegistry* upb_ExtensionRegistry_New(upb_Arena* arena); |
| 4364 | |
| 4365 | UPB_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. |
| 4373 | bool upb_ExtensionRegistry_AddArray(upb_ExtensionRegistry* r, |
| 4374 | const upb_MiniTableExtension** e, |
| 4375 | size_t count); |
| 4376 | |
Protobuf Team Bot | bf7ac9f | 2024-06-04 17:32:11 +0000 | [diff] [blame] | 4377 | #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). |
| 4389 | UPB_API bool upb_ExtensionRegistry_AddAllLinkedExtensions( |
| 4390 | upb_ExtensionRegistry* r); |
| 4391 | |
| 4392 | #endif // UPB_LINKARR_DECLARE |
| 4393 | |
Protobuf Team Bot | 4eeaa22 | 2023-12-04 05:00:05 +0000 | [diff] [blame] | 4394 | // Looks up the extension (if any) defined for message type |t| and field |
| 4395 | // number |num|. Returns the extension if found, otherwise NULL. |
| 4396 | UPB_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 Kruskal | 9d43502 | 2023-07-11 12:45:07 -0700 | [diff] [blame] | 4406 | #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 Kruskal | 9d43502 | 2023-07-11 12:45:07 -0700 | [diff] [blame] | 4413 | // Must be last. |
| 4414 | |
| 4415 | struct upb_MiniTableFile { |
Protobuf Team Bot | 4c74345 | 2023-12-26 22:55:49 +0000 | [diff] [blame] | 4416 | 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 Bot | ff42200 | 2023-11-28 17:31:45 +0000 | [diff] [blame] | 4419 | int UPB_PRIVATE(msg_count); |
| 4420 | int UPB_PRIVATE(enum_count); |
| 4421 | int UPB_PRIVATE(ext_count); |
Mike Kruskal | 9d43502 | 2023-07-11 12:45:07 -0700 | [diff] [blame] | 4422 | }; |
| 4423 | |
Protobuf Team Bot | ff42200 | 2023-11-28 17:31:45 +0000 | [diff] [blame] | 4424 | #ifdef __cplusplus |
| 4425 | extern "C" { |
| 4426 | #endif |
| 4427 | |
Protobuf Team Bot | b3878b5 | 2024-02-08 21:50:53 +0000 | [diff] [blame] | 4428 | UPB_API_INLINE int upb_MiniTableFile_EnumCount( |
Protobuf Team Bot | 4c74345 | 2023-12-26 22:55:49 +0000 | [diff] [blame] | 4429 | const struct upb_MiniTableFile* f) { |
Protobuf Team Bot | ff42200 | 2023-11-28 17:31:45 +0000 | [diff] [blame] | 4430 | return f->UPB_PRIVATE(enum_count); |
| 4431 | } |
| 4432 | |
Protobuf Team Bot | b3878b5 | 2024-02-08 21:50:53 +0000 | [diff] [blame] | 4433 | UPB_API_INLINE int upb_MiniTableFile_ExtensionCount( |
Protobuf Team Bot | 4c74345 | 2023-12-26 22:55:49 +0000 | [diff] [blame] | 4434 | const struct upb_MiniTableFile* f) { |
Protobuf Team Bot | ff42200 | 2023-11-28 17:31:45 +0000 | [diff] [blame] | 4435 | return f->UPB_PRIVATE(ext_count); |
| 4436 | } |
| 4437 | |
Protobuf Team Bot | b3878b5 | 2024-02-08 21:50:53 +0000 | [diff] [blame] | 4438 | UPB_API_INLINE int upb_MiniTableFile_MessageCount( |
Protobuf Team Bot | 4c74345 | 2023-12-26 22:55:49 +0000 | [diff] [blame] | 4439 | const struct upb_MiniTableFile* f) { |
Protobuf Team Bot | ff42200 | 2023-11-28 17:31:45 +0000 | [diff] [blame] | 4440 | return f->UPB_PRIVATE(msg_count); |
| 4441 | } |
| 4442 | |
Protobuf Team Bot | b3878b5 | 2024-02-08 21:50:53 +0000 | [diff] [blame] | 4443 | UPB_API_INLINE const struct upb_MiniTableEnum* upb_MiniTableFile_Enum( |
Protobuf Team Bot | 4c74345 | 2023-12-26 22:55:49 +0000 | [diff] [blame] | 4444 | const struct upb_MiniTableFile* f, int i) { |
Protobuf Team Bot | ff42200 | 2023-11-28 17:31:45 +0000 | [diff] [blame] | 4445 | UPB_ASSERT(i < f->UPB_PRIVATE(enum_count)); |
| 4446 | return f->UPB_PRIVATE(enums)[i]; |
| 4447 | } |
| 4448 | |
Protobuf Team Bot | b3878b5 | 2024-02-08 21:50:53 +0000 | [diff] [blame] | 4449 | UPB_API_INLINE const struct upb_MiniTableExtension* upb_MiniTableFile_Extension( |
| 4450 | const struct upb_MiniTableFile* f, int i) { |
Protobuf Team Bot | ff42200 | 2023-11-28 17:31:45 +0000 | [diff] [blame] | 4451 | UPB_ASSERT(i < f->UPB_PRIVATE(ext_count)); |
| 4452 | return f->UPB_PRIVATE(exts)[i]; |
| 4453 | } |
| 4454 | |
Protobuf Team Bot | b3878b5 | 2024-02-08 21:50:53 +0000 | [diff] [blame] | 4455 | UPB_API_INLINE const struct upb_MiniTable* upb_MiniTableFile_Message( |
Protobuf Team Bot | 4c74345 | 2023-12-26 22:55:49 +0000 | [diff] [blame] | 4456 | const struct upb_MiniTableFile* f, int i) { |
Protobuf Team Bot | ff42200 | 2023-11-28 17:31:45 +0000 | [diff] [blame] | 4457 | 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 Kruskal | 9d43502 | 2023-07-11 12:45:07 -0700 | [diff] [blame] | 4465 | |
| 4466 | #endif /* UPB_MINI_TABLE_INTERNAL_FILE_H_ */ |
| 4467 | |
Protobuf Team Bot | ff42200 | 2023-11-28 17:31:45 +0000 | [diff] [blame] | 4468 | // Must be last. |
| 4469 | |
Protobuf Team Bot | 9b4aff2 | 2023-12-27 21:35:01 +0000 | [diff] [blame] | 4470 | typedef struct upb_MiniTableFile upb_MiniTableFile; |
| 4471 | |
Protobuf Team Bot | ff42200 | 2023-11-28 17:31:45 +0000 | [diff] [blame] | 4472 | #ifdef __cplusplus |
| 4473 | extern "C" { |
| 4474 | #endif |
| 4475 | |
Protobuf Team Bot | 1db9465 | 2023-12-20 02:08:18 +0000 | [diff] [blame] | 4476 | UPB_API_INLINE const upb_MiniTableEnum* upb_MiniTableFile_Enum( |
Protobuf Team Bot | b3878b5 | 2024-02-08 21:50:53 +0000 | [diff] [blame] | 4477 | const upb_MiniTableFile* f, int i); |
Protobuf Team Bot | ff42200 | 2023-11-28 17:31:45 +0000 | [diff] [blame] | 4478 | |
Protobuf Team Bot | b3878b5 | 2024-02-08 21:50:53 +0000 | [diff] [blame] | 4479 | UPB_API_INLINE int upb_MiniTableFile_EnumCount(const upb_MiniTableFile* f); |
Protobuf Team Bot | ff42200 | 2023-11-28 17:31:45 +0000 | [diff] [blame] | 4480 | |
Protobuf Team Bot | 1db9465 | 2023-12-20 02:08:18 +0000 | [diff] [blame] | 4481 | UPB_API_INLINE const upb_MiniTableExtension* upb_MiniTableFile_Extension( |
Protobuf Team Bot | b3878b5 | 2024-02-08 21:50:53 +0000 | [diff] [blame] | 4482 | const upb_MiniTableFile* f, int i); |
Protobuf Team Bot | ff42200 | 2023-11-28 17:31:45 +0000 | [diff] [blame] | 4483 | |
Protobuf Team Bot | b3878b5 | 2024-02-08 21:50:53 +0000 | [diff] [blame] | 4484 | UPB_API_INLINE int upb_MiniTableFile_ExtensionCount(const upb_MiniTableFile* f); |
Protobuf Team Bot | ff42200 | 2023-11-28 17:31:45 +0000 | [diff] [blame] | 4485 | |
Protobuf Team Bot | 1db9465 | 2023-12-20 02:08:18 +0000 | [diff] [blame] | 4486 | UPB_API_INLINE const upb_MiniTable* upb_MiniTableFile_Message( |
Protobuf Team Bot | b3878b5 | 2024-02-08 21:50:53 +0000 | [diff] [blame] | 4487 | const upb_MiniTableFile* f, int i); |
Protobuf Team Bot | ff42200 | 2023-11-28 17:31:45 +0000 | [diff] [blame] | 4488 | |
Protobuf Team Bot | b3878b5 | 2024-02-08 21:50:53 +0000 | [diff] [blame] | 4489 | UPB_API_INLINE int upb_MiniTableFile_MessageCount(const upb_MiniTableFile* f); |
Protobuf Team Bot | ff42200 | 2023-11-28 17:31:45 +0000 | [diff] [blame] | 4490 | |
| 4491 | #ifdef __cplusplus |
| 4492 | } /* extern "C" */ |
| 4493 | #endif |
| 4494 | |
| 4495 | |
Mike Kruskal | 9d43502 | 2023-07-11 12:45:07 -0700 | [diff] [blame] | 4496 | #endif /* UPB_MINI_TABLE_FILE_H_ */ |
| 4497 | |
Mike Kruskal | 9cf9db8 | 2022-11-04 21:22:31 -0700 | [diff] [blame] | 4498 | // upb_decode: parsing into a upb_Message using a upb_MiniTable. |
Joshua Haberman | 9abf6e2 | 2021-01-13 12:16:25 -0800 | [diff] [blame] | 4499 | |
Mike Kruskal | 9cf9db8 | 2022-11-04 21:22:31 -0700 | [diff] [blame] | 4500 | #ifndef UPB_WIRE_DECODE_H_ |
| 4501 | #define UPB_WIRE_DECODE_H_ |
Joshua Haberman | 9abf6e2 | 2021-01-13 12:16:25 -0800 | [diff] [blame] | 4502 | |
Protobuf Team Bot | 743bf92 | 2023-09-14 01:12:11 +0000 | [diff] [blame] | 4503 | #include <stddef.h> |
| 4504 | #include <stdint.h> |
Joshua Haberman | 9abf6e2 | 2021-01-13 12:16:25 -0800 | [diff] [blame] | 4505 | |
Adam Cozzette | 7d5592e | 2023-08-23 12:15:26 -0700 | [diff] [blame] | 4506 | |
Joshua Haberman | d3995ec | 2022-09-30 16:54:39 -0700 | [diff] [blame] | 4507 | // Must be last. |
Joshua Haberman | 9abf6e2 | 2021-01-13 12:16:25 -0800 | [diff] [blame] | 4508 | |
| 4509 | #ifdef __cplusplus |
| 4510 | extern "C" { |
| 4511 | #endif |
| 4512 | |
| 4513 | enum { |
Joshua Haberman | d3995ec | 2022-09-30 16:54:39 -0700 | [diff] [blame] | 4514 | /* 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 Haberman | 9abf6e2 | 2021-01-13 12:16:25 -0800 | [diff] [blame] | 4521 | * |
Joshua Haberman | d3995ec | 2022-09-30 16:54:39 -0700 | [diff] [blame] | 4522 | * 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 Luo | 3560e23 | 2023-06-12 00:33:50 -0700 | [diff] [blame] | 4536 | |
| 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 Bot | 1610bf1 | 2024-01-10 21:45:42 +0000 | [diff] [blame] | 4571 | |
| 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 Haberman | 9abf6e2 | 2021-01-13 12:16:25 -0800 | [diff] [blame] | 4581 | }; |
| 4582 | |
Deanna Garcia | c7d979d | 2023-04-14 17:22:13 -0700 | [diff] [blame] | 4583 | UPB_INLINE uint32_t upb_DecodeOptions_MaxDepth(uint16_t depth) { |
| 4584 | return (uint32_t)depth << 16; |
| 4585 | } |
| 4586 | |
| 4587 | UPB_INLINE uint16_t upb_DecodeOptions_GetMaxDepth(uint32_t options) { |
| 4588 | return options >> 16; |
| 4589 | } |
Joshua Haberman | 9abf6e2 | 2021-01-13 12:16:25 -0800 | [diff] [blame] | 4590 | |
Jakob Buchgraber | c0c79b2 | 2023-03-20 08:13:52 -0700 | [diff] [blame] | 4591 | // Enforce an upper bound on recursion depth. |
| 4592 | UPB_INLINE int upb_Decode_LimitDepth(uint32_t decode_options, uint32_t limit) { |
Deanna Garcia | c7d979d | 2023-04-14 17:22:13 -0700 | [diff] [blame] | 4593 | uint32_t max_depth = upb_DecodeOptions_GetMaxDepth(decode_options); |
Jakob Buchgraber | c0c79b2 | 2023-03-20 08:13:52 -0700 | [diff] [blame] | 4594 | if (max_depth > limit) max_depth = limit; |
Deanna Garcia | c7d979d | 2023-04-14 17:22:13 -0700 | [diff] [blame] | 4595 | return upb_DecodeOptions_MaxDepth(max_depth) | (decode_options & 0xffff); |
Jakob Buchgraber | c0c79b2 | 2023-03-20 08:13:52 -0700 | [diff] [blame] | 4596 | } |
| 4597 | |
Protobuf Team Bot | 762233d | 2024-04-10 13:38:37 +0000 | [diff] [blame] | 4598 | // LINT.IfChange |
Joshua Haberman | d3995ec | 2022-09-30 16:54:39 -0700 | [diff] [blame] | 4599 | typedef enum { |
| 4600 | kUpb_DecodeStatus_Ok = 0, |
Deanna Garcia | bd6a0cf | 2023-04-20 10:30:44 -0700 | [diff] [blame] | 4601 | 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 Haberman | 9abf6e2 | 2021-01-13 12:16:25 -0800 | [diff] [blame] | 4606 | |
Joshua Haberman | d3995ec | 2022-09-30 16:54:39 -0700 | [diff] [blame] | 4607 | // kUpb_DecodeOption_CheckRequired failed (see above), but the parse otherwise |
| 4608 | // succeeded. |
| 4609 | kUpb_DecodeStatus_MissingRequired = 5, |
Jie Luo | 3560e23 | 2023-06-12 00:33:50 -0700 | [diff] [blame] | 4610 | |
| 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 Haberman | d3995ec | 2022-09-30 16:54:39 -0700 | [diff] [blame] | 4615 | } upb_DecodeStatus; |
Protobuf Team Bot | 762233d | 2024-04-10 13:38:37 +0000 | [diff] [blame] | 4616 | // LINT.ThenChange(//depot/google3/third_party/protobuf/rust/upb.rs:decode_status) |
Joshua Haberman | d3995ec | 2022-09-30 16:54:39 -0700 | [diff] [blame] | 4617 | |
Eric Salo | 1050599 | 2022-12-12 12:16:36 -0800 | [diff] [blame] | 4618 | UPB_API upb_DecodeStatus upb_Decode(const char* buf, size_t size, |
Protobuf Team Bot | d86fe39 | 2024-04-03 14:19:48 +0000 | [diff] [blame] | 4619 | upb_Message* msg, const upb_MiniTable* mt, |
Eric Salo | 1050599 | 2022-12-12 12:16:36 -0800 | [diff] [blame] | 4620 | const upb_ExtensionRegistry* extreg, |
| 4621 | int options, upb_Arena* arena); |
Joshua Haberman | 9abf6e2 | 2021-01-13 12:16:25 -0800 | [diff] [blame] | 4622 | |
Protobuf Team Bot | d86fe39 | 2024-04-03 14:19:48 +0000 | [diff] [blame] | 4623 | // 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 Bot | b9bde6a | 2024-04-03 19:25:27 +0000 | [diff] [blame] | 4626 | UPB_API upb_DecodeStatus upb_DecodeLengthPrefixed( |
Protobuf Team Bot | d86fe39 | 2024-04-03 14:19:48 +0000 | [diff] [blame] | 4627 | 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 Bot | 5dfdd85 | 2024-05-17 15:56:35 +0000 | [diff] [blame] | 4631 | // Utility function for wrapper languages to get an error string from a |
| 4632 | // upb_DecodeStatus. |
| 4633 | UPB_API const char* upb_DecodeStatus_String(upb_DecodeStatus status); |
Joshua Haberman | 9abf6e2 | 2021-01-13 12:16:25 -0800 | [diff] [blame] | 4634 | #ifdef __cplusplus |
Joshua Haberman | f41049a | 2022-01-21 14:41:25 -0800 | [diff] [blame] | 4635 | } /* extern "C" */ |
Joshua Haberman | 9abf6e2 | 2021-01-13 12:16:25 -0800 | [diff] [blame] | 4636 | #endif |
| 4637 | |
Joshua Haberman | dd69a48 | 2021-05-17 22:40:33 -0700 | [diff] [blame] | 4638 | |
Mike Kruskal | 9cf9db8 | 2022-11-04 21:22:31 -0700 | [diff] [blame] | 4639 | #endif /* UPB_WIRE_DECODE_H_ */ |
Joshua Haberman | d3995ec | 2022-09-30 16:54:39 -0700 | [diff] [blame] | 4640 | |
Protobuf Team Bot | da56def | 2023-12-26 19:08:52 +0000 | [diff] [blame] | 4641 | // 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 |
| 4653 | extern "C" { |
| 4654 | #endif |
| 4655 | |
| 4656 | enum { |
| 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 Bot | e22539b | 2024-04-08 23:26:12 +0000 | [diff] [blame] | 4665 | // When set, unknown fields are not encoded. |
Protobuf Team Bot | da56def | 2023-12-26 19:08:52 +0000 | [diff] [blame] | 4666 | 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 Bot | 762233d | 2024-04-10 13:38:37 +0000 | [diff] [blame] | 4672 | // LINT.IfChange |
Protobuf Team Bot | da56def | 2023-12-26 19:08:52 +0000 | [diff] [blame] | 4673 | typedef 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 Bot | 762233d | 2024-04-10 13:38:37 +0000 | [diff] [blame] | 4681 | // LINT.ThenChange(//depot/google3/third_party/protobuf/rust/upb.rs:encode_status) |
Protobuf Team Bot | da56def | 2023-12-26 19:08:52 +0000 | [diff] [blame] | 4682 | |
| 4683 | UPB_INLINE uint32_t upb_EncodeOptions_MaxDepth(uint16_t depth) { |
| 4684 | return (uint32_t)depth << 16; |
| 4685 | } |
| 4686 | |
| 4687 | UPB_INLINE uint16_t upb_EncodeOptions_GetMaxDepth(uint32_t options) { |
| 4688 | return options >> 16; |
| 4689 | } |
| 4690 | |
| 4691 | // Enforce an upper bound on recursion depth. |
| 4692 | UPB_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 | |
| 4698 | UPB_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 Bot | d86fe39 | 2024-04-03 14:19:48 +0000 | [diff] [blame] | 4702 | // Encodes the message prepended by a varint of the serialized length. |
Protobuf Team Bot | b9bde6a | 2024-04-03 19:25:27 +0000 | [diff] [blame] | 4703 | UPB_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 Bot | 5dfdd85 | 2024-05-17 15:56:35 +0000 | [diff] [blame] | 4707 | // Utility function for wrapper languages to get an error string from a |
| 4708 | // upb_EncodeStatus. |
| 4709 | UPB_API const char* upb_EncodeStatus_String(upb_EncodeStatus status); |
Protobuf Team Bot | d86fe39 | 2024-04-03 14:19:48 +0000 | [diff] [blame] | 4710 | |
Protobuf Team Bot | da56def | 2023-12-26 19:08:52 +0000 | [diff] [blame] | 4711 | #ifdef __cplusplus |
| 4712 | } /* extern "C" */ |
| 4713 | #endif |
| 4714 | |
| 4715 | |
| 4716 | #endif /* UPB_WIRE_ENCODE_H_ */ |
| 4717 | |
Joshua Haberman | 9abf6e2 | 2021-01-13 12:16:25 -0800 | [diff] [blame] | 4718 | // 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 Bot | de5ea1e | 2024-01-02 04:02:53 +0000 | [diff] [blame] | 4752 | #ifndef UPB_WIRE_INTERNAL_DECODE_FAST_H_ |
| 4753 | #define UPB_WIRE_INTERNAL_DECODE_FAST_H_ |
Joshua Haberman | 9abf6e2 | 2021-01-13 12:16:25 -0800 | [diff] [blame] | 4754 | |
| 4755 | |
Joshua Haberman | d3995ec | 2022-09-30 16:54:39 -0700 | [diff] [blame] | 4756 | // Must be last. |
| 4757 | |
| 4758 | #ifdef __cplusplus |
| 4759 | extern "C" { |
| 4760 | #endif |
| 4761 | |
Joshua Haberman | f41049a | 2022-01-21 14:41:25 -0800 | [diff] [blame] | 4762 | struct upb_Decoder; |
Joshua Haberman | 9abf6e2 | 2021-01-13 12:16:25 -0800 | [diff] [blame] | 4763 | |
| 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 Haberman | d3995ec | 2022-09-30 16:54:39 -0700 | [diff] [blame] | 4766 | const 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 Haberman | 9abf6e2 | 2021-01-13 12:16:25 -0800 | [diff] [blame] | 4770 | |
Joshua Haberman | f41049a | 2022-01-21 14:41:25 -0800 | [diff] [blame] | 4771 | #define UPB_PARSE_PARAMS \ |
| 4772 | struct upb_Decoder *d, const char *ptr, upb_Message *msg, intptr_t table, \ |
Joshua Haberman | 9abf6e2 | 2021-01-13 12:16:25 -0800 | [diff] [blame] | 4773 | uint64_t hasbits, uint64_t data |
| 4774 | |
| 4775 | /* primitive fields ***********************************************************/ |
| 4776 | |
| 4777 | #define F(card, type, valbytes, tagbytes) \ |
Joshua Haberman | f41049a | 2022-01-21 14:41:25 -0800 | [diff] [blame] | 4778 | const char* upb_p##card##type##valbytes##_##tagbytes##bt(UPB_PARSE_PARAMS); |
Joshua Haberman | 9abf6e2 | 2021-01-13 12:16:25 -0800 | [diff] [blame] | 4779 | |
| 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 | |
| 4793 | TAGBYTES(s) |
| 4794 | TAGBYTES(o) |
| 4795 | TAGBYTES(r) |
| 4796 | TAGBYTES(p) |
| 4797 | |
| 4798 | #undef F |
| 4799 | #undef TYPES |
| 4800 | #undef TAGBYTES |
| 4801 | |
| 4802 | /* string fields **************************************************************/ |
| 4803 | |
| 4804 | #define F(card, tagbytes, type) \ |
Joshua Haberman | f41049a | 2022-01-21 14:41:25 -0800 | [diff] [blame] | 4805 | const char* upb_p##card##type##_##tagbytes##bt(UPB_PARSE_PARAMS); \ |
| 4806 | const char* upb_c##card##type##_##tagbytes##bt(UPB_PARSE_PARAMS); |
Joshua Haberman | 9abf6e2 | 2021-01-13 12:16:25 -0800 | [diff] [blame] | 4807 | |
| 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 | |
| 4816 | TAGBYTES(s) |
| 4817 | TAGBYTES(o) |
| 4818 | TAGBYTES(r) |
| 4819 | |
| 4820 | #undef F |
Protobuf Team Bot | de5ea1e | 2024-01-02 04:02:53 +0000 | [diff] [blame] | 4821 | #undef UTF8 |
Joshua Haberman | 9abf6e2 | 2021-01-13 12:16:25 -0800 | [diff] [blame] | 4822 | #undef TAGBYTES |
| 4823 | |
| 4824 | /* sub-message fields *********************************************************/ |
| 4825 | |
| 4826 | #define F(card, tagbytes, size_ceil, ceil_arg) \ |
Joshua Haberman | f41049a | 2022-01-21 14:41:25 -0800 | [diff] [blame] | 4827 | const char* upb_p##card##m_##tagbytes##bt_max##size_ceil##b(UPB_PARSE_PARAMS); |
Joshua Haberman | 9abf6e2 | 2021-01-13 12:16:25 -0800 | [diff] [blame] | 4828 | |
| 4829 | #define SIZES(card, tagbytes) \ |
Joshua Haberman | f41049a | 2022-01-21 14:41:25 -0800 | [diff] [blame] | 4830 | F(card, tagbytes, 64, 64) \ |
Joshua Haberman | 9abf6e2 | 2021-01-13 12:16:25 -0800 | [diff] [blame] | 4831 | 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 Haberman | f41049a | 2022-01-21 14:41:25 -0800 | [diff] [blame] | 4837 | SIZES(card, 1) \ |
Joshua Haberman | 9abf6e2 | 2021-01-13 12:16:25 -0800 | [diff] [blame] | 4838 | SIZES(card, 2) |
| 4839 | |
| 4840 | TAGBYTES(s) |
| 4841 | TAGBYTES(o) |
| 4842 | TAGBYTES(r) |
| 4843 | |
Joshua Haberman | 9abf6e2 | 2021-01-13 12:16:25 -0800 | [diff] [blame] | 4844 | #undef F |
Protobuf Team Bot | de5ea1e | 2024-01-02 04:02:53 +0000 | [diff] [blame] | 4845 | #undef SIZES |
| 4846 | #undef TAGBYTES |
Joshua Haberman | 9abf6e2 | 2021-01-13 12:16:25 -0800 | [diff] [blame] | 4847 | |
| 4848 | #undef UPB_PARSE_PARAMS |
| 4849 | |
Joshua Haberman | d3995ec | 2022-09-30 16:54:39 -0700 | [diff] [blame] | 4850 | #ifdef __cplusplus |
| 4851 | } /* extern "C" */ |
| 4852 | #endif |
| 4853 | |
| 4854 | |
Protobuf Team Bot | de5ea1e | 2024-01-02 04:02:53 +0000 | [diff] [blame] | 4855 | #endif /* UPB_WIRE_INTERNAL_DECODE_FAST_H_ */ |
Mike Kruskal | 9d43502 | 2023-07-11 12:45:07 -0700 | [diff] [blame] | 4856 | // IWYU pragma: end_exports |
| 4857 | |
| 4858 | #endif // UPB_GENERATED_CODE_SUPPORT_H_ |
Protobuf Team Bot | 0cb912c | 2023-09-28 20:14:04 +0000 | [diff] [blame] | 4859 | /* This file was generated by upb_generator from the input file: |
Mike Kruskal | 9d43502 | 2023-07-11 12:45:07 -0700 | [diff] [blame] | 4860 | * |
| 4861 | * google/protobuf/descriptor.proto |
| 4862 | * |
| 4863 | * Do not edit -- your changes will be discarded when the file is |
Protobuf Team Bot | d3b2fc5 | 2024-05-02 17:02:37 +0000 | [diff] [blame] | 4864 | * regenerated. |
| 4865 | * NO CHECKED-IN PROTOBUF GENCODE */ |
Mike Kruskal | 9d43502 | 2023-07-11 12:45:07 -0700 | [diff] [blame] | 4866 | |
Protobuf Team Bot | d11eb71 | 2023-09-15 00:25:33 +0000 | [diff] [blame] | 4867 | #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 |
| 4874 | extern "C" { |
| 4875 | #endif |
| 4876 | |
Protobuf Team Bot | d14a336 | 2023-10-07 23:51:34 +0000 | [diff] [blame] | 4877 | extern const upb_MiniTable google__protobuf__FileDescriptorSet_msg_init; |
Protobuf Team Bot | 532f0c2 | 2024-06-05 03:21:24 +0000 | [diff] [blame] | 4878 | extern const upb_MiniTable* google__protobuf__FileDescriptorSet_msg_init_ptr; |
Protobuf Team Bot | d14a336 | 2023-10-07 23:51:34 +0000 | [diff] [blame] | 4879 | extern const upb_MiniTable google__protobuf__FileDescriptorProto_msg_init; |
Protobuf Team Bot | 532f0c2 | 2024-06-05 03:21:24 +0000 | [diff] [blame] | 4880 | extern const upb_MiniTable* google__protobuf__FileDescriptorProto_msg_init_ptr; |
Protobuf Team Bot | d14a336 | 2023-10-07 23:51:34 +0000 | [diff] [blame] | 4881 | extern const upb_MiniTable google__protobuf__DescriptorProto_msg_init; |
Protobuf Team Bot | 532f0c2 | 2024-06-05 03:21:24 +0000 | [diff] [blame] | 4882 | extern const upb_MiniTable* google__protobuf__DescriptorProto_msg_init_ptr; |
Protobuf Team Bot | d14a336 | 2023-10-07 23:51:34 +0000 | [diff] [blame] | 4883 | extern const upb_MiniTable google__protobuf__DescriptorProto__ExtensionRange_msg_init; |
Protobuf Team Bot | 532f0c2 | 2024-06-05 03:21:24 +0000 | [diff] [blame] | 4884 | extern const upb_MiniTable* google__protobuf__DescriptorProto__ExtensionRange_msg_init_ptr; |
Protobuf Team Bot | d14a336 | 2023-10-07 23:51:34 +0000 | [diff] [blame] | 4885 | extern const upb_MiniTable google__protobuf__DescriptorProto__ReservedRange_msg_init; |
Protobuf Team Bot | 532f0c2 | 2024-06-05 03:21:24 +0000 | [diff] [blame] | 4886 | extern const upb_MiniTable* google__protobuf__DescriptorProto__ReservedRange_msg_init_ptr; |
Protobuf Team Bot | d14a336 | 2023-10-07 23:51:34 +0000 | [diff] [blame] | 4887 | extern const upb_MiniTable google__protobuf__ExtensionRangeOptions_msg_init; |
Protobuf Team Bot | 532f0c2 | 2024-06-05 03:21:24 +0000 | [diff] [blame] | 4888 | extern const upb_MiniTable* google__protobuf__ExtensionRangeOptions_msg_init_ptr; |
Protobuf Team Bot | d14a336 | 2023-10-07 23:51:34 +0000 | [diff] [blame] | 4889 | extern const upb_MiniTable google__protobuf__ExtensionRangeOptions__Declaration_msg_init; |
Protobuf Team Bot | 532f0c2 | 2024-06-05 03:21:24 +0000 | [diff] [blame] | 4890 | extern const upb_MiniTable* google__protobuf__ExtensionRangeOptions__Declaration_msg_init_ptr; |
Protobuf Team Bot | d14a336 | 2023-10-07 23:51:34 +0000 | [diff] [blame] | 4891 | extern const upb_MiniTable google__protobuf__FieldDescriptorProto_msg_init; |
Protobuf Team Bot | 532f0c2 | 2024-06-05 03:21:24 +0000 | [diff] [blame] | 4892 | extern const upb_MiniTable* google__protobuf__FieldDescriptorProto_msg_init_ptr; |
Protobuf Team Bot | d14a336 | 2023-10-07 23:51:34 +0000 | [diff] [blame] | 4893 | extern const upb_MiniTable google__protobuf__OneofDescriptorProto_msg_init; |
Protobuf Team Bot | 532f0c2 | 2024-06-05 03:21:24 +0000 | [diff] [blame] | 4894 | extern const upb_MiniTable* google__protobuf__OneofDescriptorProto_msg_init_ptr; |
Protobuf Team Bot | d14a336 | 2023-10-07 23:51:34 +0000 | [diff] [blame] | 4895 | extern const upb_MiniTable google__protobuf__EnumDescriptorProto_msg_init; |
Protobuf Team Bot | 532f0c2 | 2024-06-05 03:21:24 +0000 | [diff] [blame] | 4896 | extern const upb_MiniTable* google__protobuf__EnumDescriptorProto_msg_init_ptr; |
Protobuf Team Bot | d14a336 | 2023-10-07 23:51:34 +0000 | [diff] [blame] | 4897 | extern const upb_MiniTable google__protobuf__EnumDescriptorProto__EnumReservedRange_msg_init; |
Protobuf Team Bot | 532f0c2 | 2024-06-05 03:21:24 +0000 | [diff] [blame] | 4898 | extern const upb_MiniTable* google__protobuf__EnumDescriptorProto__EnumReservedRange_msg_init_ptr; |
Protobuf Team Bot | d14a336 | 2023-10-07 23:51:34 +0000 | [diff] [blame] | 4899 | extern const upb_MiniTable google__protobuf__EnumValueDescriptorProto_msg_init; |
Protobuf Team Bot | 532f0c2 | 2024-06-05 03:21:24 +0000 | [diff] [blame] | 4900 | extern const upb_MiniTable* google__protobuf__EnumValueDescriptorProto_msg_init_ptr; |
Protobuf Team Bot | d14a336 | 2023-10-07 23:51:34 +0000 | [diff] [blame] | 4901 | extern const upb_MiniTable google__protobuf__ServiceDescriptorProto_msg_init; |
Protobuf Team Bot | 532f0c2 | 2024-06-05 03:21:24 +0000 | [diff] [blame] | 4902 | extern const upb_MiniTable* google__protobuf__ServiceDescriptorProto_msg_init_ptr; |
Protobuf Team Bot | d14a336 | 2023-10-07 23:51:34 +0000 | [diff] [blame] | 4903 | extern const upb_MiniTable google__protobuf__MethodDescriptorProto_msg_init; |
Protobuf Team Bot | 532f0c2 | 2024-06-05 03:21:24 +0000 | [diff] [blame] | 4904 | extern const upb_MiniTable* google__protobuf__MethodDescriptorProto_msg_init_ptr; |
Protobuf Team Bot | d14a336 | 2023-10-07 23:51:34 +0000 | [diff] [blame] | 4905 | extern const upb_MiniTable google__protobuf__FileOptions_msg_init; |
Protobuf Team Bot | 532f0c2 | 2024-06-05 03:21:24 +0000 | [diff] [blame] | 4906 | extern const upb_MiniTable* google__protobuf__FileOptions_msg_init_ptr; |
Protobuf Team Bot | d14a336 | 2023-10-07 23:51:34 +0000 | [diff] [blame] | 4907 | extern const upb_MiniTable google__protobuf__MessageOptions_msg_init; |
Protobuf Team Bot | 532f0c2 | 2024-06-05 03:21:24 +0000 | [diff] [blame] | 4908 | extern const upb_MiniTable* google__protobuf__MessageOptions_msg_init_ptr; |
Protobuf Team Bot | d14a336 | 2023-10-07 23:51:34 +0000 | [diff] [blame] | 4909 | extern const upb_MiniTable google__protobuf__FieldOptions_msg_init; |
Protobuf Team Bot | 532f0c2 | 2024-06-05 03:21:24 +0000 | [diff] [blame] | 4910 | extern const upb_MiniTable* google__protobuf__FieldOptions_msg_init_ptr; |
Protobuf Team Bot | d14a336 | 2023-10-07 23:51:34 +0000 | [diff] [blame] | 4911 | extern const upb_MiniTable google__protobuf__FieldOptions__EditionDefault_msg_init; |
Protobuf Team Bot | 532f0c2 | 2024-06-05 03:21:24 +0000 | [diff] [blame] | 4912 | extern const upb_MiniTable* google__protobuf__FieldOptions__EditionDefault_msg_init_ptr; |
Protobuf Team Bot | 85edb7e | 2024-04-03 02:43:54 +0000 | [diff] [blame] | 4913 | extern const upb_MiniTable google__protobuf__FieldOptions__FeatureSupport_msg_init; |
Protobuf Team Bot | 532f0c2 | 2024-06-05 03:21:24 +0000 | [diff] [blame] | 4914 | extern const upb_MiniTable* google__protobuf__FieldOptions__FeatureSupport_msg_init_ptr; |
Protobuf Team Bot | d14a336 | 2023-10-07 23:51:34 +0000 | [diff] [blame] | 4915 | extern const upb_MiniTable google__protobuf__OneofOptions_msg_init; |
Protobuf Team Bot | 532f0c2 | 2024-06-05 03:21:24 +0000 | [diff] [blame] | 4916 | extern const upb_MiniTable* google__protobuf__OneofOptions_msg_init_ptr; |
Protobuf Team Bot | d14a336 | 2023-10-07 23:51:34 +0000 | [diff] [blame] | 4917 | extern const upb_MiniTable google__protobuf__EnumOptions_msg_init; |
Protobuf Team Bot | 532f0c2 | 2024-06-05 03:21:24 +0000 | [diff] [blame] | 4918 | extern const upb_MiniTable* google__protobuf__EnumOptions_msg_init_ptr; |
Protobuf Team Bot | d14a336 | 2023-10-07 23:51:34 +0000 | [diff] [blame] | 4919 | extern const upb_MiniTable google__protobuf__EnumValueOptions_msg_init; |
Protobuf Team Bot | 532f0c2 | 2024-06-05 03:21:24 +0000 | [diff] [blame] | 4920 | extern const upb_MiniTable* google__protobuf__EnumValueOptions_msg_init_ptr; |
Protobuf Team Bot | d14a336 | 2023-10-07 23:51:34 +0000 | [diff] [blame] | 4921 | extern const upb_MiniTable google__protobuf__ServiceOptions_msg_init; |
Protobuf Team Bot | 532f0c2 | 2024-06-05 03:21:24 +0000 | [diff] [blame] | 4922 | extern const upb_MiniTable* google__protobuf__ServiceOptions_msg_init_ptr; |
Protobuf Team Bot | d14a336 | 2023-10-07 23:51:34 +0000 | [diff] [blame] | 4923 | extern const upb_MiniTable google__protobuf__MethodOptions_msg_init; |
Protobuf Team Bot | 532f0c2 | 2024-06-05 03:21:24 +0000 | [diff] [blame] | 4924 | extern const upb_MiniTable* google__protobuf__MethodOptions_msg_init_ptr; |
Protobuf Team Bot | d14a336 | 2023-10-07 23:51:34 +0000 | [diff] [blame] | 4925 | extern const upb_MiniTable google__protobuf__UninterpretedOption_msg_init; |
Protobuf Team Bot | 532f0c2 | 2024-06-05 03:21:24 +0000 | [diff] [blame] | 4926 | extern const upb_MiniTable* google__protobuf__UninterpretedOption_msg_init_ptr; |
Protobuf Team Bot | d14a336 | 2023-10-07 23:51:34 +0000 | [diff] [blame] | 4927 | extern const upb_MiniTable google__protobuf__UninterpretedOption__NamePart_msg_init; |
Protobuf Team Bot | 532f0c2 | 2024-06-05 03:21:24 +0000 | [diff] [blame] | 4928 | extern const upb_MiniTable* google__protobuf__UninterpretedOption__NamePart_msg_init_ptr; |
Protobuf Team Bot | d14a336 | 2023-10-07 23:51:34 +0000 | [diff] [blame] | 4929 | extern const upb_MiniTable google__protobuf__FeatureSet_msg_init; |
Protobuf Team Bot | 532f0c2 | 2024-06-05 03:21:24 +0000 | [diff] [blame] | 4930 | extern const upb_MiniTable* google__protobuf__FeatureSet_msg_init_ptr; |
Protobuf Team Bot | d14a336 | 2023-10-07 23:51:34 +0000 | [diff] [blame] | 4931 | extern const upb_MiniTable google__protobuf__FeatureSetDefaults_msg_init; |
Protobuf Team Bot | 532f0c2 | 2024-06-05 03:21:24 +0000 | [diff] [blame] | 4932 | extern const upb_MiniTable* google__protobuf__FeatureSetDefaults_msg_init_ptr; |
Protobuf Team Bot | d14a336 | 2023-10-07 23:51:34 +0000 | [diff] [blame] | 4933 | extern const upb_MiniTable google__protobuf__FeatureSetDefaults__FeatureSetEditionDefault_msg_init; |
Protobuf Team Bot | 532f0c2 | 2024-06-05 03:21:24 +0000 | [diff] [blame] | 4934 | extern const upb_MiniTable* google__protobuf__FeatureSetDefaults__FeatureSetEditionDefault_msg_init_ptr; |
Protobuf Team Bot | d14a336 | 2023-10-07 23:51:34 +0000 | [diff] [blame] | 4935 | extern const upb_MiniTable google__protobuf__SourceCodeInfo_msg_init; |
Protobuf Team Bot | 532f0c2 | 2024-06-05 03:21:24 +0000 | [diff] [blame] | 4936 | extern const upb_MiniTable* google__protobuf__SourceCodeInfo_msg_init_ptr; |
Protobuf Team Bot | d14a336 | 2023-10-07 23:51:34 +0000 | [diff] [blame] | 4937 | extern const upb_MiniTable google__protobuf__SourceCodeInfo__Location_msg_init; |
Protobuf Team Bot | 532f0c2 | 2024-06-05 03:21:24 +0000 | [diff] [blame] | 4938 | extern const upb_MiniTable* google__protobuf__SourceCodeInfo__Location_msg_init_ptr; |
Protobuf Team Bot | d14a336 | 2023-10-07 23:51:34 +0000 | [diff] [blame] | 4939 | extern const upb_MiniTable google__protobuf__GeneratedCodeInfo_msg_init; |
Protobuf Team Bot | 532f0c2 | 2024-06-05 03:21:24 +0000 | [diff] [blame] | 4940 | extern const upb_MiniTable* google__protobuf__GeneratedCodeInfo_msg_init_ptr; |
Protobuf Team Bot | d14a336 | 2023-10-07 23:51:34 +0000 | [diff] [blame] | 4941 | extern const upb_MiniTable google__protobuf__GeneratedCodeInfo__Annotation_msg_init; |
Protobuf Team Bot | 532f0c2 | 2024-06-05 03:21:24 +0000 | [diff] [blame] | 4942 | extern const upb_MiniTable* google__protobuf__GeneratedCodeInfo__Annotation_msg_init_ptr; |
Protobuf Team Bot | d11eb71 | 2023-09-15 00:25:33 +0000 | [diff] [blame] | 4943 | |
| 4944 | extern const upb_MiniTableEnum google_protobuf_Edition_enum_init; |
| 4945 | extern const upb_MiniTableEnum google_protobuf_ExtensionRangeOptions_VerificationState_enum_init; |
| 4946 | extern const upb_MiniTableEnum google_protobuf_FeatureSet_EnumType_enum_init; |
| 4947 | extern const upb_MiniTableEnum google_protobuf_FeatureSet_FieldPresence_enum_init; |
| 4948 | extern const upb_MiniTableEnum google_protobuf_FeatureSet_JsonFormat_enum_init; |
| 4949 | extern const upb_MiniTableEnum google_protobuf_FeatureSet_MessageEncoding_enum_init; |
| 4950 | extern const upb_MiniTableEnum google_protobuf_FeatureSet_RepeatedFieldEncoding_enum_init; |
Protobuf Team Bot | 6112795 | 2023-09-26 20:07:33 +0000 | [diff] [blame] | 4951 | extern const upb_MiniTableEnum google_protobuf_FeatureSet_Utf8Validation_enum_init; |
Protobuf Team Bot | d11eb71 | 2023-09-15 00:25:33 +0000 | [diff] [blame] | 4952 | extern const upb_MiniTableEnum google_protobuf_FieldDescriptorProto_Label_enum_init; |
| 4953 | extern const upb_MiniTableEnum google_protobuf_FieldDescriptorProto_Type_enum_init; |
| 4954 | extern const upb_MiniTableEnum google_protobuf_FieldOptions_CType_enum_init; |
| 4955 | extern const upb_MiniTableEnum google_protobuf_FieldOptions_JSType_enum_init; |
| 4956 | extern const upb_MiniTableEnum google_protobuf_FieldOptions_OptionRetention_enum_init; |
| 4957 | extern const upb_MiniTableEnum google_protobuf_FieldOptions_OptionTargetType_enum_init; |
| 4958 | extern const upb_MiniTableEnum google_protobuf_FileOptions_OptimizeMode_enum_init; |
| 4959 | extern const upb_MiniTableEnum google_protobuf_GeneratedCodeInfo_Annotation_Semantic_enum_init; |
| 4960 | extern const upb_MiniTableEnum google_protobuf_MethodOptions_IdempotencyLevel_enum_init; |
| 4961 | extern 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 |
| 4979 | extern "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 | |
| 4990 | enum { |
| 4991 | kUpb_EpsCopyInputStream_NoAliasing = 0, |
| 4992 | kUpb_EpsCopyInputStream_OnPatch = 1, |
| 4993 | kUpb_EpsCopyInputStream_NoDelta = 2 |
| 4994 | }; |
| 4995 | |
| 4996 | typedef 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 Bot | 1d143b5 | 2024-01-25 20:29:43 +0000 | [diff] [blame] | 5000 | int limit; // Submessage limit relative to end |
| 5001 | bool error; // To distinguish between EOF and error. |
Protobuf Team Bot | d11eb71 | 2023-09-15 00:25:33 +0000 | [diff] [blame] | 5002 | 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. |
| 5008 | UPB_INLINE bool upb_EpsCopyInputStream_IsError(upb_EpsCopyInputStream* e) { |
| 5009 | return e->error; |
| 5010 | } |
| 5011 | |
| 5012 | typedef const char* upb_EpsCopyInputStream_BufferFlipCallback( |
| 5013 | upb_EpsCopyInputStream* e, const char* old_end, const char* new_start); |
| 5014 | |
| 5015 | typedef 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. |
| 5021 | UPB_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 | |
| 5042 | typedef 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. |
| 5056 | UPB_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. |
| 5075 | UPB_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 | |
| 5091 | const 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. |
| 5100 | UPB_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). |
| 5114 | UPB_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. |
| 5125 | UPB_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 | |
| 5131 | UPB_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. |
| 5155 | UPB_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. |
| 5171 | UPB_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. |
| 5178 | UPB_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. |
| 5186 | UPB_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. |
| 5200 | UPB_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(). |
| 5215 | UPB_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. |
| 5226 | UPB_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. |
| 5234 | UPB_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. |
| 5249 | UPB_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 | |
| 5268 | UPB_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. |
| 5278 | UPB_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(). |
| 5293 | UPB_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 | |
| 5303 | UPB_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 | |
| 5330 | typedef 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 Bot | 1d143b5 | 2024-01-25 20:29:43 +0000 | [diff] [blame] | 5338 | UPB_FORCEINLINE bool upb_EpsCopyInputStream_TryParseDelimitedFast( |
Protobuf Team Bot | d11eb71 | 2023-09-15 00:25:33 +0000 | [diff] [blame] | 5339 | 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 Bot | d11eb71 | 2023-09-15 00:25:33 +0000 | [diff] [blame] | 5366 | #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 Bot | 0631035 | 2023-09-26 21:54:58 +0000 | [diff] [blame] | 5375 | // IWYU pragma: private, include "upb/reflection/def.h" |
Protobuf Team Bot | d11eb71 | 2023-09-15 00:25:33 +0000 | [diff] [blame] | 5376 | |
| 5377 | #ifndef UPB_REFLECTION_DEF_POOL_H_ |
| 5378 | #define UPB_REFLECTION_DEF_POOL_H_ |
| 5379 | |
| 5380 | |
Protobuf Team Bot | 0631035 | 2023-09-26 21:54:58 +0000 | [diff] [blame] | 5381 | // IWYU pragma: private, include "upb/reflection/def.h" |
Protobuf Team Bot | d11eb71 | 2023-09-15 00:25:33 +0000 | [diff] [blame] | 5382 | |
| 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 Bot | 0cb912c | 2023-09-28 20:14:04 +0000 | [diff] [blame] | 5397 | /* This file was generated by upb_generator from the input file: |
Protobuf Team Bot | d11eb71 | 2023-09-15 00:25:33 +0000 | [diff] [blame] | 5398 | * |
| 5399 | * google/protobuf/descriptor.proto |
| 5400 | * |
| 5401 | * Do not edit -- your changes will be discarded when the file is |
Protobuf Team Bot | d3b2fc5 | 2024-05-02 17:02:37 +0000 | [diff] [blame] | 5402 | * regenerated. |
| 5403 | * NO CHECKED-IN PROTOBUF GENCODE */ |
Protobuf Team Bot | d11eb71 | 2023-09-15 00:25:33 +0000 | [diff] [blame] | 5404 | |
Mike Kruskal | 9d43502 | 2023-07-11 12:45:07 -0700 | [diff] [blame] | 5405 | #ifndef GOOGLE_PROTOBUF_DESCRIPTOR_PROTO_UPB_H_ |
| 5406 | #define GOOGLE_PROTOBUF_DESCRIPTOR_PROTO_UPB_H_ |
Joshua Haberman | d3995ec | 2022-09-30 16:54:39 -0700 | [diff] [blame] | 5407 | |
Protobuf Team Bot | 111d655 | 2023-09-15 21:07:08 +0000 | [diff] [blame] | 5408 | |
| 5409 | |
| 5410 | // Must be last. |
Joshua Haberman | 9abf6e2 | 2021-01-13 12:16:25 -0800 | [diff] [blame] | 5411 | |
| 5412 | #ifdef __cplusplus |
| 5413 | extern "C" { |
| 5414 | #endif |
| 5415 | |
Protobuf Team Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 5416 | typedef struct google_protobuf_FileDescriptorSet { upb_Message UPB_PRIVATE(base); } google_protobuf_FileDescriptorSet; |
| 5417 | typedef struct google_protobuf_FileDescriptorProto { upb_Message UPB_PRIVATE(base); } google_protobuf_FileDescriptorProto; |
| 5418 | typedef struct google_protobuf_DescriptorProto { upb_Message UPB_PRIVATE(base); } google_protobuf_DescriptorProto; |
| 5419 | typedef struct google_protobuf_DescriptorProto_ExtensionRange { upb_Message UPB_PRIVATE(base); } google_protobuf_DescriptorProto_ExtensionRange; |
| 5420 | typedef struct google_protobuf_DescriptorProto_ReservedRange { upb_Message UPB_PRIVATE(base); } google_protobuf_DescriptorProto_ReservedRange; |
| 5421 | typedef struct google_protobuf_ExtensionRangeOptions { upb_Message UPB_PRIVATE(base); } google_protobuf_ExtensionRangeOptions; |
| 5422 | typedef struct google_protobuf_ExtensionRangeOptions_Declaration { upb_Message UPB_PRIVATE(base); } google_protobuf_ExtensionRangeOptions_Declaration; |
| 5423 | typedef struct google_protobuf_FieldDescriptorProto { upb_Message UPB_PRIVATE(base); } google_protobuf_FieldDescriptorProto; |
| 5424 | typedef struct google_protobuf_OneofDescriptorProto { upb_Message UPB_PRIVATE(base); } google_protobuf_OneofDescriptorProto; |
| 5425 | typedef struct google_protobuf_EnumDescriptorProto { upb_Message UPB_PRIVATE(base); } google_protobuf_EnumDescriptorProto; |
| 5426 | typedef struct google_protobuf_EnumDescriptorProto_EnumReservedRange { upb_Message UPB_PRIVATE(base); } google_protobuf_EnumDescriptorProto_EnumReservedRange; |
| 5427 | typedef struct google_protobuf_EnumValueDescriptorProto { upb_Message UPB_PRIVATE(base); } google_protobuf_EnumValueDescriptorProto; |
| 5428 | typedef struct google_protobuf_ServiceDescriptorProto { upb_Message UPB_PRIVATE(base); } google_protobuf_ServiceDescriptorProto; |
| 5429 | typedef struct google_protobuf_MethodDescriptorProto { upb_Message UPB_PRIVATE(base); } google_protobuf_MethodDescriptorProto; |
| 5430 | typedef struct google_protobuf_FileOptions { upb_Message UPB_PRIVATE(base); } google_protobuf_FileOptions; |
| 5431 | typedef struct google_protobuf_MessageOptions { upb_Message UPB_PRIVATE(base); } google_protobuf_MessageOptions; |
| 5432 | typedef struct google_protobuf_FieldOptions { upb_Message UPB_PRIVATE(base); } google_protobuf_FieldOptions; |
| 5433 | typedef struct google_protobuf_FieldOptions_EditionDefault { upb_Message UPB_PRIVATE(base); } google_protobuf_FieldOptions_EditionDefault; |
Protobuf Team Bot | 85edb7e | 2024-04-03 02:43:54 +0000 | [diff] [blame] | 5434 | typedef struct google_protobuf_FieldOptions_FeatureSupport { upb_Message UPB_PRIVATE(base); } google_protobuf_FieldOptions_FeatureSupport; |
Protobuf Team Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 5435 | typedef struct google_protobuf_OneofOptions { upb_Message UPB_PRIVATE(base); } google_protobuf_OneofOptions; |
| 5436 | typedef struct google_protobuf_EnumOptions { upb_Message UPB_PRIVATE(base); } google_protobuf_EnumOptions; |
| 5437 | typedef struct google_protobuf_EnumValueOptions { upb_Message UPB_PRIVATE(base); } google_protobuf_EnumValueOptions; |
| 5438 | typedef struct google_protobuf_ServiceOptions { upb_Message UPB_PRIVATE(base); } google_protobuf_ServiceOptions; |
| 5439 | typedef struct google_protobuf_MethodOptions { upb_Message UPB_PRIVATE(base); } google_protobuf_MethodOptions; |
| 5440 | typedef struct google_protobuf_UninterpretedOption { upb_Message UPB_PRIVATE(base); } google_protobuf_UninterpretedOption; |
| 5441 | typedef struct google_protobuf_UninterpretedOption_NamePart { upb_Message UPB_PRIVATE(base); } google_protobuf_UninterpretedOption_NamePart; |
| 5442 | typedef struct google_protobuf_FeatureSet { upb_Message UPB_PRIVATE(base); } google_protobuf_FeatureSet; |
| 5443 | typedef struct google_protobuf_FeatureSetDefaults { upb_Message UPB_PRIVATE(base); } google_protobuf_FeatureSetDefaults; |
| 5444 | typedef struct google_protobuf_FeatureSetDefaults_FeatureSetEditionDefault { upb_Message UPB_PRIVATE(base); } google_protobuf_FeatureSetDefaults_FeatureSetEditionDefault; |
| 5445 | typedef struct google_protobuf_SourceCodeInfo { upb_Message UPB_PRIVATE(base); } google_protobuf_SourceCodeInfo; |
| 5446 | typedef struct google_protobuf_SourceCodeInfo_Location { upb_Message UPB_PRIVATE(base); } google_protobuf_SourceCodeInfo_Location; |
| 5447 | typedef struct google_protobuf_GeneratedCodeInfo { upb_Message UPB_PRIVATE(base); } google_protobuf_GeneratedCodeInfo; |
| 5448 | typedef struct google_protobuf_GeneratedCodeInfo_Annotation { upb_Message UPB_PRIVATE(base); } google_protobuf_GeneratedCodeInfo_Annotation; |
Joshua Haberman | 9abf6e2 | 2021-01-13 12:16:25 -0800 | [diff] [blame] | 5449 | |
| 5450 | typedef enum { |
Protobuf Team Bot | fa98bb3 | 2023-09-01 18:11:09 +0000 | [diff] [blame] | 5451 | google_protobuf_EDITION_UNKNOWN = 0, |
| 5452 | google_protobuf_EDITION_1_TEST_ONLY = 1, |
| 5453 | google_protobuf_EDITION_2_TEST_ONLY = 2, |
Protobuf Team Bot | 2322a87 | 2024-04-10 17:23:17 +0000 | [diff] [blame] | 5454 | google_protobuf_EDITION_LEGACY = 900, |
Protobuf Team Bot | 6703802 | 2023-10-04 04:14:37 +0000 | [diff] [blame] | 5455 | google_protobuf_EDITION_PROTO2 = 998, |
| 5456 | google_protobuf_EDITION_PROTO3 = 999, |
Protobuf Team Bot | fa98bb3 | 2023-09-01 18:11:09 +0000 | [diff] [blame] | 5457 | google_protobuf_EDITION_2023 = 1000, |
Protobuf Team Bot | 41c8f2a | 2024-01-11 00:10:17 +0000 | [diff] [blame] | 5458 | google_protobuf_EDITION_2024 = 1001, |
Protobuf Team Bot | fa98bb3 | 2023-09-01 18:11:09 +0000 | [diff] [blame] | 5459 | google_protobuf_EDITION_99997_TEST_ONLY = 99997, |
| 5460 | google_protobuf_EDITION_99998_TEST_ONLY = 99998, |
Protobuf Team Bot | de57b67 | 2023-11-30 22:16:47 +0000 | [diff] [blame] | 5461 | google_protobuf_EDITION_99999_TEST_ONLY = 99999, |
| 5462 | google_protobuf_EDITION_MAX = 2147483647 |
Protobuf Team Bot | fa98bb3 | 2023-09-01 18:11:09 +0000 | [diff] [blame] | 5463 | } google_protobuf_Edition; |
| 5464 | |
| 5465 | typedef enum { |
Protobuf Team Bot | 469f027 | 2023-04-21 18:12:45 -0700 | [diff] [blame] | 5466 | google_protobuf_ExtensionRangeOptions_DECLARATION = 0, |
| 5467 | google_protobuf_ExtensionRangeOptions_UNVERIFIED = 1 |
| 5468 | } google_protobuf_ExtensionRangeOptions_VerificationState; |
| 5469 | |
| 5470 | typedef enum { |
Mike Kruskal | 4f9e417 | 2023-06-30 20:14:50 -0700 | [diff] [blame] | 5471 | 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 | |
| 5476 | typedef 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 | |
| 5483 | typedef 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 | |
| 5489 | typedef 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 | |
| 5495 | typedef 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 | |
| 5501 | typedef enum { |
Protobuf Team Bot | 6112795 | 2023-09-26 20:07:33 +0000 | [diff] [blame] | 5502 | google_protobuf_FeatureSet_UTF8_VALIDATION_UNKNOWN = 0, |
Protobuf Team Bot | 5b8b87f | 2023-11-30 05:12:08 +0000 | [diff] [blame] | 5503 | google_protobuf_FeatureSet_VERIFY = 2, |
| 5504 | google_protobuf_FeatureSet_NONE = 3 |
Protobuf Team Bot | 6112795 | 2023-09-26 20:07:33 +0000 | [diff] [blame] | 5505 | } google_protobuf_FeatureSet_Utf8Validation; |
| 5506 | |
| 5507 | typedef enum { |
Mike Kruskal | ccbdaa7 | 2023-02-02 20:42:14 -0800 | [diff] [blame] | 5508 | 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 | |
| 5513 | typedef enum { |
Joshua Haberman | 9abf6e2 | 2021-01-13 12:16:25 -0800 | [diff] [blame] | 5514 | 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 | |
| 5534 | typedef 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 | |
| 5540 | typedef 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 | |
| 5546 | typedef enum { |
Adam Cozzette | 90ff32c | 2023-01-21 15:04:56 -0800 | [diff] [blame] | 5547 | 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 | |
| 5552 | typedef 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 | |
| 5565 | typedef enum { |
Mike Kruskal | ccbdaa7 | 2023-02-02 20:42:14 -0800 | [diff] [blame] | 5566 | 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 Haberman | 9abf6e2 | 2021-01-13 12:16:25 -0800 | [diff] [blame] | 5570 | |
| 5571 | typedef enum { |
Joshua Haberman | d3995ec | 2022-09-30 16:54:39 -0700 | [diff] [blame] | 5572 | 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 Kruskal | ccbdaa7 | 2023-02-02 20:42:14 -0800 | [diff] [blame] | 5577 | typedef 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 Haberman | 9abf6e2 | 2021-01-13 12:16:25 -0800 | [diff] [blame] | 5582 | |
Mike Kruskal | ccbdaa7 | 2023-02-02 20:42:14 -0800 | [diff] [blame] | 5583 | |
Joshua Haberman | f41049a | 2022-01-21 14:41:25 -0800 | [diff] [blame] | 5584 | |
Joshua Haberman | 9abf6e2 | 2021-01-13 12:16:25 -0800 | [diff] [blame] | 5585 | /* google.protobuf.FileDescriptorSet */ |
| 5586 | |
Joshua Haberman | f41049a | 2022-01-21 14:41:25 -0800 | [diff] [blame] | 5587 | UPB_INLINE google_protobuf_FileDescriptorSet* google_protobuf_FileDescriptorSet_new(upb_Arena* arena) { |
Protobuf Team Bot | 4ffe086 | 2023-12-06 02:02:36 +0000 | [diff] [blame] | 5588 | return (google_protobuf_FileDescriptorSet*)_upb_Message_New(&google__protobuf__FileDescriptorSet_msg_init, arena); |
Joshua Haberman | 9abf6e2 | 2021-01-13 12:16:25 -0800 | [diff] [blame] | 5589 | } |
Joshua Haberman | f41049a | 2022-01-21 14:41:25 -0800 | [diff] [blame] | 5590 | UPB_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 Haberman | 9d578a3 | 2021-08-02 15:32:01 -0700 | [diff] [blame] | 5592 | if (!ret) return NULL; |
Protobuf Team Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 5593 | if (upb_Decode(buf, size, UPB_UPCAST(ret), &google__protobuf__FileDescriptorSet_msg_init, NULL, 0, arena) != |
| 5594 | kUpb_DecodeStatus_Ok) { |
Joshua Haberman | 9d578a3 | 2021-08-02 15:32:01 -0700 | [diff] [blame] | 5595 | return NULL; |
| 5596 | } |
| 5597 | return ret; |
Joshua Haberman | 9abf6e2 | 2021-01-13 12:16:25 -0800 | [diff] [blame] | 5598 | } |
Joshua Haberman | f41049a | 2022-01-21 14:41:25 -0800 | [diff] [blame] | 5599 | UPB_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 Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 5604 | if (upb_Decode(buf, size, UPB_UPCAST(ret), &google__protobuf__FileDescriptorSet_msg_init, extreg, options, |
| 5605 | arena) != kUpb_DecodeStatus_Ok) { |
Joshua Haberman | f41049a | 2022-01-21 14:41:25 -0800 | [diff] [blame] | 5606 | return NULL; |
| 5607 | } |
| 5608 | return ret; |
Joshua Haberman | 9abf6e2 | 2021-01-13 12:16:25 -0800 | [diff] [blame] | 5609 | } |
Joshua Haberman | f41049a | 2022-01-21 14:41:25 -0800 | [diff] [blame] | 5610 | UPB_INLINE char* google_protobuf_FileDescriptorSet_serialize(const google_protobuf_FileDescriptorSet* msg, upb_Arena* arena, size_t* len) { |
Joshua Haberman | d3995ec | 2022-09-30 16:54:39 -0700 | [diff] [blame] | 5611 | char* ptr; |
Protobuf Team Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 5612 | (void)upb_Encode(UPB_UPCAST(msg), &google__protobuf__FileDescriptorSet_msg_init, 0, arena, &ptr, len); |
Joshua Haberman | d3995ec | 2022-09-30 16:54:39 -0700 | [diff] [blame] | 5613 | return ptr; |
Joshua Haberman | f41049a | 2022-01-21 14:41:25 -0800 | [diff] [blame] | 5614 | } |
| 5615 | UPB_INLINE char* google_protobuf_FileDescriptorSet_serialize_ex(const google_protobuf_FileDescriptorSet* msg, int options, |
| 5616 | upb_Arena* arena, size_t* len) { |
Joshua Haberman | d3995ec | 2022-09-30 16:54:39 -0700 | [diff] [blame] | 5617 | char* ptr; |
Protobuf Team Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 5618 | (void)upb_Encode(UPB_UPCAST(msg), &google__protobuf__FileDescriptorSet_msg_init, options, arena, &ptr, len); |
Joshua Haberman | d3995ec | 2022-09-30 16:54:39 -0700 | [diff] [blame] | 5619 | return ptr; |
Joshua Haberman | f41049a | 2022-01-21 14:41:25 -0800 | [diff] [blame] | 5620 | } |
Mike Kruskal | 3bc5049 | 2022-12-01 13:34:12 -0800 | [diff] [blame] | 5621 | UPB_INLINE void google_protobuf_FileDescriptorSet_clear_file(google_protobuf_FileDescriptorSet* msg) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 5622 | 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 Bot | 4e90ead | 2024-01-08 15:46:34 +0000 | [diff] [blame] | 5623 | upb_Message_ClearBaseField(UPB_UPCAST(msg), &field); |
Joshua Haberman | d3995ec | 2022-09-30 16:54:39 -0700 | [diff] [blame] | 5624 | } |
Eric Salo | b7d54ac | 2022-12-29 11:59:42 -0800 | [diff] [blame] | 5625 | UPB_INLINE const google_protobuf_FileDescriptorProto* const* google_protobuf_FileDescriptorSet_file(const google_protobuf_FileDescriptorSet* msg, size_t* size) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 5626 | 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 Bot | a9387b5 | 2024-06-12 15:17:52 +0000 | [diff] [blame] | 5627 | UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__FileDescriptorProto_msg_init); |
Protobuf Team Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 5628 | const upb_Array* arr = upb_Message_GetArray(UPB_UPCAST(msg), &field); |
Eric Salo | b7d54ac | 2022-12-29 11:59:42 -0800 | [diff] [blame] | 5629 | if (arr) { |
Protobuf Team Bot | f73985a | 2023-12-19 00:14:19 +0000 | [diff] [blame] | 5630 | if (size) *size = arr->UPB_PRIVATE(size); |
Protobuf Team Bot | 81e5433 | 2024-01-11 21:04:07 +0000 | [diff] [blame] | 5631 | return (const google_protobuf_FileDescriptorProto* const*)upb_Array_DataPtr(arr); |
Eric Salo | b7d54ac | 2022-12-29 11:59:42 -0800 | [diff] [blame] | 5632 | } else { |
| 5633 | if (size) *size = 0; |
| 5634 | return NULL; |
| 5635 | } |
Joshua Haberman | 7ecf43f | 2022-03-14 13:11:29 -0700 | [diff] [blame] | 5636 | } |
Deanna Garcia | b26afb5 | 2023-04-25 13:37:18 -0700 | [diff] [blame] | 5637 | UPB_INLINE const upb_Array* _google_protobuf_FileDescriptorSet_file_upb_array(const google_protobuf_FileDescriptorSet* msg, size_t* size) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 5638 | 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 Bot | a9387b5 | 2024-06-12 15:17:52 +0000 | [diff] [blame] | 5639 | UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__FileDescriptorProto_msg_init); |
Protobuf Team Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 5640 | const upb_Array* arr = upb_Message_GetArray(UPB_UPCAST(msg), &field); |
Deanna Garcia | b26afb5 | 2023-04-25 13:37:18 -0700 | [diff] [blame] | 5641 | if (size) { |
Protobuf Team Bot | f73985a | 2023-12-19 00:14:19 +0000 | [diff] [blame] | 5642 | *size = arr ? arr->UPB_PRIVATE(size) : 0; |
Deanna Garcia | b26afb5 | 2023-04-25 13:37:18 -0700 | [diff] [blame] | 5643 | } |
| 5644 | return arr; |
| 5645 | } |
Protobuf Team Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 5646 | UPB_INLINE upb_Array* _google_protobuf_FileDescriptorSet_file_mutable_upb_array(google_protobuf_FileDescriptorSet* msg, size_t* size, upb_Arena* arena) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 5647 | 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 Bot | a9387b5 | 2024-06-12 15:17:52 +0000 | [diff] [blame] | 5648 | UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__FileDescriptorProto_msg_init); |
Protobuf Team Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 5649 | upb_Array* arr = upb_Message_GetOrCreateMutableArray(UPB_UPCAST(msg), |
| 5650 | &field, arena); |
Deanna Garcia | b26afb5 | 2023-04-25 13:37:18 -0700 | [diff] [blame] | 5651 | if (size) { |
Protobuf Team Bot | f73985a | 2023-12-19 00:14:19 +0000 | [diff] [blame] | 5652 | *size = arr ? arr->UPB_PRIVATE(size) : 0; |
Deanna Garcia | b26afb5 | 2023-04-25 13:37:18 -0700 | [diff] [blame] | 5653 | } |
| 5654 | return arr; |
| 5655 | } |
Joshua Haberman | 9abf6e2 | 2021-01-13 12:16:25 -0800 | [diff] [blame] | 5656 | |
Eric Salo | b7d54ac | 2022-12-29 11:59:42 -0800 | [diff] [blame] | 5657 | UPB_INLINE google_protobuf_FileDescriptorProto** google_protobuf_FileDescriptorSet_mutable_file(google_protobuf_FileDescriptorSet* msg, size_t* size) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 5658 | 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 Bot | a9387b5 | 2024-06-12 15:17:52 +0000 | [diff] [blame] | 5659 | UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__FileDescriptorProto_msg_init); |
Protobuf Team Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 5660 | upb_Array* arr = upb_Message_GetMutableArray(UPB_UPCAST(msg), &field); |
Eric Salo | b7d54ac | 2022-12-29 11:59:42 -0800 | [diff] [blame] | 5661 | if (arr) { |
Protobuf Team Bot | f73985a | 2023-12-19 00:14:19 +0000 | [diff] [blame] | 5662 | if (size) *size = arr->UPB_PRIVATE(size); |
Protobuf Team Bot | 81e5433 | 2024-01-11 21:04:07 +0000 | [diff] [blame] | 5663 | return (google_protobuf_FileDescriptorProto**)upb_Array_MutableDataPtr(arr); |
Eric Salo | b7d54ac | 2022-12-29 11:59:42 -0800 | [diff] [blame] | 5664 | } else { |
| 5665 | if (size) *size = 0; |
| 5666 | return NULL; |
| 5667 | } |
Joshua Haberman | 9abf6e2 | 2021-01-13 12:16:25 -0800 | [diff] [blame] | 5668 | } |
Eric Salo | b7d54ac | 2022-12-29 11:59:42 -0800 | [diff] [blame] | 5669 | UPB_INLINE google_protobuf_FileDescriptorProto** google_protobuf_FileDescriptorSet_resize_file(google_protobuf_FileDescriptorSet* msg, size_t size, upb_Arena* arena) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 5670 | 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 Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 5671 | return (google_protobuf_FileDescriptorProto**)upb_Message_ResizeArrayUninitialized(UPB_UPCAST(msg), |
| 5672 | &field, size, arena); |
Joshua Haberman | 9abf6e2 | 2021-01-13 12:16:25 -0800 | [diff] [blame] | 5673 | } |
Joshua Haberman | 7ecf43f | 2022-03-14 13:11:29 -0700 | [diff] [blame] | 5674 | UPB_INLINE struct google_protobuf_FileDescriptorProto* google_protobuf_FileDescriptorSet_add_file(google_protobuf_FileDescriptorSet* msg, upb_Arena* arena) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 5675 | 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 Bot | a9387b5 | 2024-06-12 15:17:52 +0000 | [diff] [blame] | 5676 | UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__FileDescriptorProto_msg_init); |
Protobuf Team Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 5677 | upb_Array* arr = upb_Message_GetOrCreateMutableArray( |
| 5678 | UPB_UPCAST(msg), &field, arena); |
Protobuf Team Bot | 81e5433 | 2024-01-11 21:04:07 +0000 | [diff] [blame] | 5679 | if (!arr || !UPB_PRIVATE(_upb_Array_ResizeUninitialized)( |
Protobuf Team Bot | f73985a | 2023-12-19 00:14:19 +0000 | [diff] [blame] | 5680 | arr, arr->UPB_PRIVATE(size) + 1, arena)) { |
Eric Salo | b7d54ac | 2022-12-29 11:59:42 -0800 | [diff] [blame] | 5681 | return NULL; |
| 5682 | } |
Protobuf Team Bot | 4ffe086 | 2023-12-06 02:02:36 +0000 | [diff] [blame] | 5683 | struct google_protobuf_FileDescriptorProto* sub = (struct google_protobuf_FileDescriptorProto*)_upb_Message_New(&google__protobuf__FileDescriptorProto_msg_init, arena); |
Eric Salo | b7d54ac | 2022-12-29 11:59:42 -0800 | [diff] [blame] | 5684 | if (!arr || !sub) return NULL; |
Protobuf Team Bot | f73985a | 2023-12-19 00:14:19 +0000 | [diff] [blame] | 5685 | UPB_PRIVATE(_upb_Array_Set) |
| 5686 | (arr, arr->UPB_PRIVATE(size) - 1, &sub, sizeof(sub)); |
Joshua Haberman | 9abf6e2 | 2021-01-13 12:16:25 -0800 | [diff] [blame] | 5687 | return sub; |
| 5688 | } |
| 5689 | |
| 5690 | /* google.protobuf.FileDescriptorProto */ |
| 5691 | |
Joshua Haberman | f41049a | 2022-01-21 14:41:25 -0800 | [diff] [blame] | 5692 | UPB_INLINE google_protobuf_FileDescriptorProto* google_protobuf_FileDescriptorProto_new(upb_Arena* arena) { |
Protobuf Team Bot | 4ffe086 | 2023-12-06 02:02:36 +0000 | [diff] [blame] | 5693 | return (google_protobuf_FileDescriptorProto*)_upb_Message_New(&google__protobuf__FileDescriptorProto_msg_init, arena); |
Joshua Haberman | 9abf6e2 | 2021-01-13 12:16:25 -0800 | [diff] [blame] | 5694 | } |
Joshua Haberman | f41049a | 2022-01-21 14:41:25 -0800 | [diff] [blame] | 5695 | UPB_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 Haberman | 9d578a3 | 2021-08-02 15:32:01 -0700 | [diff] [blame] | 5697 | if (!ret) return NULL; |
Protobuf Team Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 5698 | if (upb_Decode(buf, size, UPB_UPCAST(ret), &google__protobuf__FileDescriptorProto_msg_init, NULL, 0, arena) != |
| 5699 | kUpb_DecodeStatus_Ok) { |
Joshua Haberman | 9d578a3 | 2021-08-02 15:32:01 -0700 | [diff] [blame] | 5700 | return NULL; |
| 5701 | } |
| 5702 | return ret; |
Joshua Haberman | 9abf6e2 | 2021-01-13 12:16:25 -0800 | [diff] [blame] | 5703 | } |
Joshua Haberman | f41049a | 2022-01-21 14:41:25 -0800 | [diff] [blame] | 5704 | UPB_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 Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 5709 | if (upb_Decode(buf, size, UPB_UPCAST(ret), &google__protobuf__FileDescriptorProto_msg_init, extreg, options, |
| 5710 | arena) != kUpb_DecodeStatus_Ok) { |
Joshua Haberman | f41049a | 2022-01-21 14:41:25 -0800 | [diff] [blame] | 5711 | return NULL; |
| 5712 | } |
| 5713 | return ret; |
Joshua Haberman | 9abf6e2 | 2021-01-13 12:16:25 -0800 | [diff] [blame] | 5714 | } |
Joshua Haberman | f41049a | 2022-01-21 14:41:25 -0800 | [diff] [blame] | 5715 | UPB_INLINE char* google_protobuf_FileDescriptorProto_serialize(const google_protobuf_FileDescriptorProto* msg, upb_Arena* arena, size_t* len) { |
Joshua Haberman | d3995ec | 2022-09-30 16:54:39 -0700 | [diff] [blame] | 5716 | char* ptr; |
Protobuf Team Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 5717 | (void)upb_Encode(UPB_UPCAST(msg), &google__protobuf__FileDescriptorProto_msg_init, 0, arena, &ptr, len); |
Joshua Haberman | d3995ec | 2022-09-30 16:54:39 -0700 | [diff] [blame] | 5718 | return ptr; |
Joshua Haberman | f41049a | 2022-01-21 14:41:25 -0800 | [diff] [blame] | 5719 | } |
| 5720 | UPB_INLINE char* google_protobuf_FileDescriptorProto_serialize_ex(const google_protobuf_FileDescriptorProto* msg, int options, |
| 5721 | upb_Arena* arena, size_t* len) { |
Joshua Haberman | d3995ec | 2022-09-30 16:54:39 -0700 | [diff] [blame] | 5722 | char* ptr; |
Protobuf Team Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 5723 | (void)upb_Encode(UPB_UPCAST(msg), &google__protobuf__FileDescriptorProto_msg_init, options, arena, &ptr, len); |
Joshua Haberman | d3995ec | 2022-09-30 16:54:39 -0700 | [diff] [blame] | 5724 | return ptr; |
Joshua Haberman | f41049a | 2022-01-21 14:41:25 -0800 | [diff] [blame] | 5725 | } |
Mike Kruskal | 3bc5049 | 2022-12-01 13:34:12 -0800 | [diff] [blame] | 5726 | UPB_INLINE void google_protobuf_FileDescriptorProto_clear_name(google_protobuf_FileDescriptorProto* msg) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 5727 | 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 Bot | 4e90ead | 2024-01-08 15:46:34 +0000 | [diff] [blame] | 5728 | upb_Message_ClearBaseField(UPB_UPCAST(msg), &field); |
Joshua Haberman | d3995ec | 2022-09-30 16:54:39 -0700 | [diff] [blame] | 5729 | } |
Joshua Haberman | f41049a | 2022-01-21 14:41:25 -0800 | [diff] [blame] | 5730 | UPB_INLINE upb_StringView google_protobuf_FileDescriptorProto_name(const google_protobuf_FileDescriptorProto* msg) { |
Eric Salo | 8809a11 | 2022-11-21 13:01:06 -0800 | [diff] [blame] | 5731 | upb_StringView default_val = upb_StringView_FromString(""); |
| 5732 | upb_StringView ret; |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 5733 | 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 Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 5734 | _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field, |
| 5735 | &default_val, &ret); |
Eric Salo | 8809a11 | 2022-11-21 13:01:06 -0800 | [diff] [blame] | 5736 | return ret; |
Joshua Haberman | f41049a | 2022-01-21 14:41:25 -0800 | [diff] [blame] | 5737 | } |
Mike Kruskal | 3bc5049 | 2022-12-01 13:34:12 -0800 | [diff] [blame] | 5738 | UPB_INLINE bool google_protobuf_FileDescriptorProto_has_name(const google_protobuf_FileDescriptorProto* msg) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 5739 | 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 Bot | 8c1f635 | 2024-01-10 05:18:15 +0000 | [diff] [blame] | 5740 | return upb_Message_HasBaseField(UPB_UPCAST(msg), &field); |
Joshua Haberman | 7ecf43f | 2022-03-14 13:11:29 -0700 | [diff] [blame] | 5741 | } |
Mike Kruskal | 3bc5049 | 2022-12-01 13:34:12 -0800 | [diff] [blame] | 5742 | UPB_INLINE void google_protobuf_FileDescriptorProto_clear_package(google_protobuf_FileDescriptorProto* msg) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 5743 | 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 Bot | 4e90ead | 2024-01-08 15:46:34 +0000 | [diff] [blame] | 5744 | upb_Message_ClearBaseField(UPB_UPCAST(msg), &field); |
Joshua Haberman | d3995ec | 2022-09-30 16:54:39 -0700 | [diff] [blame] | 5745 | } |
Joshua Haberman | f41049a | 2022-01-21 14:41:25 -0800 | [diff] [blame] | 5746 | UPB_INLINE upb_StringView google_protobuf_FileDescriptorProto_package(const google_protobuf_FileDescriptorProto* msg) { |
Eric Salo | 8809a11 | 2022-11-21 13:01:06 -0800 | [diff] [blame] | 5747 | upb_StringView default_val = upb_StringView_FromString(""); |
| 5748 | upb_StringView ret; |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 5749 | 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 Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 5750 | _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field, |
| 5751 | &default_val, &ret); |
Eric Salo | 8809a11 | 2022-11-21 13:01:06 -0800 | [diff] [blame] | 5752 | return ret; |
Joshua Haberman | f41049a | 2022-01-21 14:41:25 -0800 | [diff] [blame] | 5753 | } |
Mike Kruskal | 3bc5049 | 2022-12-01 13:34:12 -0800 | [diff] [blame] | 5754 | UPB_INLINE bool google_protobuf_FileDescriptorProto_has_package(const google_protobuf_FileDescriptorProto* msg) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 5755 | 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 Bot | 8c1f635 | 2024-01-10 05:18:15 +0000 | [diff] [blame] | 5756 | return upb_Message_HasBaseField(UPB_UPCAST(msg), &field); |
Mike Kruskal | 3bc5049 | 2022-12-01 13:34:12 -0800 | [diff] [blame] | 5757 | } |
| 5758 | UPB_INLINE void google_protobuf_FileDescriptorProto_clear_dependency(google_protobuf_FileDescriptorProto* msg) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 5759 | 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 Bot | 4e90ead | 2024-01-08 15:46:34 +0000 | [diff] [blame] | 5760 | upb_Message_ClearBaseField(UPB_UPCAST(msg), &field); |
Joshua Haberman | d3995ec | 2022-09-30 16:54:39 -0700 | [diff] [blame] | 5761 | } |
Eric Salo | b7d54ac | 2022-12-29 11:59:42 -0800 | [diff] [blame] | 5762 | UPB_INLINE upb_StringView const* google_protobuf_FileDescriptorProto_dependency(const google_protobuf_FileDescriptorProto* msg, size_t* size) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 5763 | 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 Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 5764 | const upb_Array* arr = upb_Message_GetArray(UPB_UPCAST(msg), &field); |
Eric Salo | b7d54ac | 2022-12-29 11:59:42 -0800 | [diff] [blame] | 5765 | if (arr) { |
Protobuf Team Bot | f73985a | 2023-12-19 00:14:19 +0000 | [diff] [blame] | 5766 | if (size) *size = arr->UPB_PRIVATE(size); |
Protobuf Team Bot | 81e5433 | 2024-01-11 21:04:07 +0000 | [diff] [blame] | 5767 | return (upb_StringView const*)upb_Array_DataPtr(arr); |
Eric Salo | b7d54ac | 2022-12-29 11:59:42 -0800 | [diff] [blame] | 5768 | } else { |
| 5769 | if (size) *size = 0; |
| 5770 | return NULL; |
| 5771 | } |
Joshua Haberman | 7ecf43f | 2022-03-14 13:11:29 -0700 | [diff] [blame] | 5772 | } |
Deanna Garcia | b26afb5 | 2023-04-25 13:37:18 -0700 | [diff] [blame] | 5773 | UPB_INLINE const upb_Array* _google_protobuf_FileDescriptorProto_dependency_upb_array(const google_protobuf_FileDescriptorProto* msg, size_t* size) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 5774 | 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 Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 5775 | const upb_Array* arr = upb_Message_GetArray(UPB_UPCAST(msg), &field); |
Deanna Garcia | b26afb5 | 2023-04-25 13:37:18 -0700 | [diff] [blame] | 5776 | if (size) { |
Protobuf Team Bot | f73985a | 2023-12-19 00:14:19 +0000 | [diff] [blame] | 5777 | *size = arr ? arr->UPB_PRIVATE(size) : 0; |
Deanna Garcia | b26afb5 | 2023-04-25 13:37:18 -0700 | [diff] [blame] | 5778 | } |
| 5779 | return arr; |
| 5780 | } |
Protobuf Team Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 5781 | UPB_INLINE upb_Array* _google_protobuf_FileDescriptorProto_dependency_mutable_upb_array(google_protobuf_FileDescriptorProto* msg, size_t* size, upb_Arena* arena) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 5782 | 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 Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 5783 | upb_Array* arr = upb_Message_GetOrCreateMutableArray(UPB_UPCAST(msg), |
| 5784 | &field, arena); |
Deanna Garcia | b26afb5 | 2023-04-25 13:37:18 -0700 | [diff] [blame] | 5785 | if (size) { |
Protobuf Team Bot | f73985a | 2023-12-19 00:14:19 +0000 | [diff] [blame] | 5786 | *size = arr ? arr->UPB_PRIVATE(size) : 0; |
Deanna Garcia | b26afb5 | 2023-04-25 13:37:18 -0700 | [diff] [blame] | 5787 | } |
| 5788 | return arr; |
| 5789 | } |
Mike Kruskal | 3bc5049 | 2022-12-01 13:34:12 -0800 | [diff] [blame] | 5790 | UPB_INLINE void google_protobuf_FileDescriptorProto_clear_message_type(google_protobuf_FileDescriptorProto* msg) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 5791 | 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 Bot | 4e90ead | 2024-01-08 15:46:34 +0000 | [diff] [blame] | 5792 | upb_Message_ClearBaseField(UPB_UPCAST(msg), &field); |
Joshua Haberman | 7ecf43f | 2022-03-14 13:11:29 -0700 | [diff] [blame] | 5793 | } |
Eric Salo | b7d54ac | 2022-12-29 11:59:42 -0800 | [diff] [blame] | 5794 | UPB_INLINE const google_protobuf_DescriptorProto* const* google_protobuf_FileDescriptorProto_message_type(const google_protobuf_FileDescriptorProto* msg, size_t* size) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 5795 | 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 Bot | a9387b5 | 2024-06-12 15:17:52 +0000 | [diff] [blame] | 5796 | UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__DescriptorProto_msg_init); |
Protobuf Team Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 5797 | const upb_Array* arr = upb_Message_GetArray(UPB_UPCAST(msg), &field); |
Eric Salo | b7d54ac | 2022-12-29 11:59:42 -0800 | [diff] [blame] | 5798 | if (arr) { |
Protobuf Team Bot | f73985a | 2023-12-19 00:14:19 +0000 | [diff] [blame] | 5799 | if (size) *size = arr->UPB_PRIVATE(size); |
Protobuf Team Bot | 81e5433 | 2024-01-11 21:04:07 +0000 | [diff] [blame] | 5800 | return (const google_protobuf_DescriptorProto* const*)upb_Array_DataPtr(arr); |
Eric Salo | b7d54ac | 2022-12-29 11:59:42 -0800 | [diff] [blame] | 5801 | } else { |
| 5802 | if (size) *size = 0; |
| 5803 | return NULL; |
| 5804 | } |
Joshua Haberman | 7ecf43f | 2022-03-14 13:11:29 -0700 | [diff] [blame] | 5805 | } |
Deanna Garcia | b26afb5 | 2023-04-25 13:37:18 -0700 | [diff] [blame] | 5806 | UPB_INLINE const upb_Array* _google_protobuf_FileDescriptorProto_message_type_upb_array(const google_protobuf_FileDescriptorProto* msg, size_t* size) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 5807 | 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 Bot | a9387b5 | 2024-06-12 15:17:52 +0000 | [diff] [blame] | 5808 | UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__DescriptorProto_msg_init); |
Protobuf Team Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 5809 | const upb_Array* arr = upb_Message_GetArray(UPB_UPCAST(msg), &field); |
Deanna Garcia | b26afb5 | 2023-04-25 13:37:18 -0700 | [diff] [blame] | 5810 | if (size) { |
Protobuf Team Bot | f73985a | 2023-12-19 00:14:19 +0000 | [diff] [blame] | 5811 | *size = arr ? arr->UPB_PRIVATE(size) : 0; |
Deanna Garcia | b26afb5 | 2023-04-25 13:37:18 -0700 | [diff] [blame] | 5812 | } |
| 5813 | return arr; |
| 5814 | } |
Protobuf Team Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 5815 | UPB_INLINE upb_Array* _google_protobuf_FileDescriptorProto_message_type_mutable_upb_array(google_protobuf_FileDescriptorProto* msg, size_t* size, upb_Arena* arena) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 5816 | 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 Bot | a9387b5 | 2024-06-12 15:17:52 +0000 | [diff] [blame] | 5817 | UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__DescriptorProto_msg_init); |
Protobuf Team Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 5818 | upb_Array* arr = upb_Message_GetOrCreateMutableArray(UPB_UPCAST(msg), |
| 5819 | &field, arena); |
Deanna Garcia | b26afb5 | 2023-04-25 13:37:18 -0700 | [diff] [blame] | 5820 | if (size) { |
Protobuf Team Bot | f73985a | 2023-12-19 00:14:19 +0000 | [diff] [blame] | 5821 | *size = arr ? arr->UPB_PRIVATE(size) : 0; |
Deanna Garcia | b26afb5 | 2023-04-25 13:37:18 -0700 | [diff] [blame] | 5822 | } |
| 5823 | return arr; |
| 5824 | } |
Mike Kruskal | 3bc5049 | 2022-12-01 13:34:12 -0800 | [diff] [blame] | 5825 | UPB_INLINE void google_protobuf_FileDescriptorProto_clear_enum_type(google_protobuf_FileDescriptorProto* msg) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 5826 | 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 Bot | 4e90ead | 2024-01-08 15:46:34 +0000 | [diff] [blame] | 5827 | upb_Message_ClearBaseField(UPB_UPCAST(msg), &field); |
Joshua Haberman | 7ecf43f | 2022-03-14 13:11:29 -0700 | [diff] [blame] | 5828 | } |
Eric Salo | b7d54ac | 2022-12-29 11:59:42 -0800 | [diff] [blame] | 5829 | UPB_INLINE const google_protobuf_EnumDescriptorProto* const* google_protobuf_FileDescriptorProto_enum_type(const google_protobuf_FileDescriptorProto* msg, size_t* size) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 5830 | 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 Bot | a9387b5 | 2024-06-12 15:17:52 +0000 | [diff] [blame] | 5831 | UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__EnumDescriptorProto_msg_init); |
Protobuf Team Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 5832 | const upb_Array* arr = upb_Message_GetArray(UPB_UPCAST(msg), &field); |
Eric Salo | b7d54ac | 2022-12-29 11:59:42 -0800 | [diff] [blame] | 5833 | if (arr) { |
Protobuf Team Bot | f73985a | 2023-12-19 00:14:19 +0000 | [diff] [blame] | 5834 | if (size) *size = arr->UPB_PRIVATE(size); |
Protobuf Team Bot | 81e5433 | 2024-01-11 21:04:07 +0000 | [diff] [blame] | 5835 | return (const google_protobuf_EnumDescriptorProto* const*)upb_Array_DataPtr(arr); |
Eric Salo | b7d54ac | 2022-12-29 11:59:42 -0800 | [diff] [blame] | 5836 | } else { |
| 5837 | if (size) *size = 0; |
| 5838 | return NULL; |
| 5839 | } |
Joshua Haberman | 7ecf43f | 2022-03-14 13:11:29 -0700 | [diff] [blame] | 5840 | } |
Deanna Garcia | b26afb5 | 2023-04-25 13:37:18 -0700 | [diff] [blame] | 5841 | UPB_INLINE const upb_Array* _google_protobuf_FileDescriptorProto_enum_type_upb_array(const google_protobuf_FileDescriptorProto* msg, size_t* size) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 5842 | 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 Bot | a9387b5 | 2024-06-12 15:17:52 +0000 | [diff] [blame] | 5843 | UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__EnumDescriptorProto_msg_init); |
Protobuf Team Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 5844 | const upb_Array* arr = upb_Message_GetArray(UPB_UPCAST(msg), &field); |
Deanna Garcia | b26afb5 | 2023-04-25 13:37:18 -0700 | [diff] [blame] | 5845 | if (size) { |
Protobuf Team Bot | f73985a | 2023-12-19 00:14:19 +0000 | [diff] [blame] | 5846 | *size = arr ? arr->UPB_PRIVATE(size) : 0; |
Deanna Garcia | b26afb5 | 2023-04-25 13:37:18 -0700 | [diff] [blame] | 5847 | } |
| 5848 | return arr; |
| 5849 | } |
Protobuf Team Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 5850 | UPB_INLINE upb_Array* _google_protobuf_FileDescriptorProto_enum_type_mutable_upb_array(google_protobuf_FileDescriptorProto* msg, size_t* size, upb_Arena* arena) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 5851 | 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 Bot | a9387b5 | 2024-06-12 15:17:52 +0000 | [diff] [blame] | 5852 | UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__EnumDescriptorProto_msg_init); |
Protobuf Team Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 5853 | upb_Array* arr = upb_Message_GetOrCreateMutableArray(UPB_UPCAST(msg), |
| 5854 | &field, arena); |
Deanna Garcia | b26afb5 | 2023-04-25 13:37:18 -0700 | [diff] [blame] | 5855 | if (size) { |
Protobuf Team Bot | f73985a | 2023-12-19 00:14:19 +0000 | [diff] [blame] | 5856 | *size = arr ? arr->UPB_PRIVATE(size) : 0; |
Deanna Garcia | b26afb5 | 2023-04-25 13:37:18 -0700 | [diff] [blame] | 5857 | } |
| 5858 | return arr; |
| 5859 | } |
Mike Kruskal | 3bc5049 | 2022-12-01 13:34:12 -0800 | [diff] [blame] | 5860 | UPB_INLINE void google_protobuf_FileDescriptorProto_clear_service(google_protobuf_FileDescriptorProto* msg) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 5861 | 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 Bot | 4e90ead | 2024-01-08 15:46:34 +0000 | [diff] [blame] | 5862 | upb_Message_ClearBaseField(UPB_UPCAST(msg), &field); |
Joshua Haberman | 7ecf43f | 2022-03-14 13:11:29 -0700 | [diff] [blame] | 5863 | } |
Eric Salo | b7d54ac | 2022-12-29 11:59:42 -0800 | [diff] [blame] | 5864 | UPB_INLINE const google_protobuf_ServiceDescriptorProto* const* google_protobuf_FileDescriptorProto_service(const google_protobuf_FileDescriptorProto* msg, size_t* size) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 5865 | 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 Bot | a9387b5 | 2024-06-12 15:17:52 +0000 | [diff] [blame] | 5866 | UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__ServiceDescriptorProto_msg_init); |
Protobuf Team Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 5867 | const upb_Array* arr = upb_Message_GetArray(UPB_UPCAST(msg), &field); |
Eric Salo | b7d54ac | 2022-12-29 11:59:42 -0800 | [diff] [blame] | 5868 | if (arr) { |
Protobuf Team Bot | f73985a | 2023-12-19 00:14:19 +0000 | [diff] [blame] | 5869 | if (size) *size = arr->UPB_PRIVATE(size); |
Protobuf Team Bot | 81e5433 | 2024-01-11 21:04:07 +0000 | [diff] [blame] | 5870 | return (const google_protobuf_ServiceDescriptorProto* const*)upb_Array_DataPtr(arr); |
Eric Salo | b7d54ac | 2022-12-29 11:59:42 -0800 | [diff] [blame] | 5871 | } else { |
| 5872 | if (size) *size = 0; |
| 5873 | return NULL; |
| 5874 | } |
Joshua Haberman | 7ecf43f | 2022-03-14 13:11:29 -0700 | [diff] [blame] | 5875 | } |
Deanna Garcia | b26afb5 | 2023-04-25 13:37:18 -0700 | [diff] [blame] | 5876 | UPB_INLINE const upb_Array* _google_protobuf_FileDescriptorProto_service_upb_array(const google_protobuf_FileDescriptorProto* msg, size_t* size) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 5877 | 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 Bot | a9387b5 | 2024-06-12 15:17:52 +0000 | [diff] [blame] | 5878 | UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__ServiceDescriptorProto_msg_init); |
Protobuf Team Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 5879 | const upb_Array* arr = upb_Message_GetArray(UPB_UPCAST(msg), &field); |
Deanna Garcia | b26afb5 | 2023-04-25 13:37:18 -0700 | [diff] [blame] | 5880 | if (size) { |
Protobuf Team Bot | f73985a | 2023-12-19 00:14:19 +0000 | [diff] [blame] | 5881 | *size = arr ? arr->UPB_PRIVATE(size) : 0; |
Deanna Garcia | b26afb5 | 2023-04-25 13:37:18 -0700 | [diff] [blame] | 5882 | } |
| 5883 | return arr; |
| 5884 | } |
Protobuf Team Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 5885 | UPB_INLINE upb_Array* _google_protobuf_FileDescriptorProto_service_mutable_upb_array(google_protobuf_FileDescriptorProto* msg, size_t* size, upb_Arena* arena) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 5886 | 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 Bot | a9387b5 | 2024-06-12 15:17:52 +0000 | [diff] [blame] | 5887 | UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__ServiceDescriptorProto_msg_init); |
Protobuf Team Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 5888 | upb_Array* arr = upb_Message_GetOrCreateMutableArray(UPB_UPCAST(msg), |
| 5889 | &field, arena); |
Deanna Garcia | b26afb5 | 2023-04-25 13:37:18 -0700 | [diff] [blame] | 5890 | if (size) { |
Protobuf Team Bot | f73985a | 2023-12-19 00:14:19 +0000 | [diff] [blame] | 5891 | *size = arr ? arr->UPB_PRIVATE(size) : 0; |
Deanna Garcia | b26afb5 | 2023-04-25 13:37:18 -0700 | [diff] [blame] | 5892 | } |
| 5893 | return arr; |
| 5894 | } |
Mike Kruskal | 3bc5049 | 2022-12-01 13:34:12 -0800 | [diff] [blame] | 5895 | UPB_INLINE void google_protobuf_FileDescriptorProto_clear_extension(google_protobuf_FileDescriptorProto* msg) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 5896 | 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 Bot | 4e90ead | 2024-01-08 15:46:34 +0000 | [diff] [blame] | 5897 | upb_Message_ClearBaseField(UPB_UPCAST(msg), &field); |
Joshua Haberman | 7ecf43f | 2022-03-14 13:11:29 -0700 | [diff] [blame] | 5898 | } |
Eric Salo | b7d54ac | 2022-12-29 11:59:42 -0800 | [diff] [blame] | 5899 | UPB_INLINE const google_protobuf_FieldDescriptorProto* const* google_protobuf_FileDescriptorProto_extension(const google_protobuf_FileDescriptorProto* msg, size_t* size) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 5900 | 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 Bot | a9387b5 | 2024-06-12 15:17:52 +0000 | [diff] [blame] | 5901 | UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__FieldDescriptorProto_msg_init); |
Protobuf Team Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 5902 | const upb_Array* arr = upb_Message_GetArray(UPB_UPCAST(msg), &field); |
Eric Salo | b7d54ac | 2022-12-29 11:59:42 -0800 | [diff] [blame] | 5903 | if (arr) { |
Protobuf Team Bot | f73985a | 2023-12-19 00:14:19 +0000 | [diff] [blame] | 5904 | if (size) *size = arr->UPB_PRIVATE(size); |
Protobuf Team Bot | 81e5433 | 2024-01-11 21:04:07 +0000 | [diff] [blame] | 5905 | return (const google_protobuf_FieldDescriptorProto* const*)upb_Array_DataPtr(arr); |
Eric Salo | b7d54ac | 2022-12-29 11:59:42 -0800 | [diff] [blame] | 5906 | } else { |
| 5907 | if (size) *size = 0; |
| 5908 | return NULL; |
| 5909 | } |
Joshua Haberman | 7ecf43f | 2022-03-14 13:11:29 -0700 | [diff] [blame] | 5910 | } |
Deanna Garcia | b26afb5 | 2023-04-25 13:37:18 -0700 | [diff] [blame] | 5911 | UPB_INLINE const upb_Array* _google_protobuf_FileDescriptorProto_extension_upb_array(const google_protobuf_FileDescriptorProto* msg, size_t* size) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 5912 | 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 Bot | a9387b5 | 2024-06-12 15:17:52 +0000 | [diff] [blame] | 5913 | UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__FieldDescriptorProto_msg_init); |
Protobuf Team Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 5914 | const upb_Array* arr = upb_Message_GetArray(UPB_UPCAST(msg), &field); |
Deanna Garcia | b26afb5 | 2023-04-25 13:37:18 -0700 | [diff] [blame] | 5915 | if (size) { |
Protobuf Team Bot | f73985a | 2023-12-19 00:14:19 +0000 | [diff] [blame] | 5916 | *size = arr ? arr->UPB_PRIVATE(size) : 0; |
Deanna Garcia | b26afb5 | 2023-04-25 13:37:18 -0700 | [diff] [blame] | 5917 | } |
| 5918 | return arr; |
| 5919 | } |
Protobuf Team Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 5920 | UPB_INLINE upb_Array* _google_protobuf_FileDescriptorProto_extension_mutable_upb_array(google_protobuf_FileDescriptorProto* msg, size_t* size, upb_Arena* arena) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 5921 | 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 Bot | a9387b5 | 2024-06-12 15:17:52 +0000 | [diff] [blame] | 5922 | UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__FieldDescriptorProto_msg_init); |
Protobuf Team Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 5923 | upb_Array* arr = upb_Message_GetOrCreateMutableArray(UPB_UPCAST(msg), |
| 5924 | &field, arena); |
Deanna Garcia | b26afb5 | 2023-04-25 13:37:18 -0700 | [diff] [blame] | 5925 | if (size) { |
Protobuf Team Bot | f73985a | 2023-12-19 00:14:19 +0000 | [diff] [blame] | 5926 | *size = arr ? arr->UPB_PRIVATE(size) : 0; |
Deanna Garcia | b26afb5 | 2023-04-25 13:37:18 -0700 | [diff] [blame] | 5927 | } |
| 5928 | return arr; |
| 5929 | } |
Mike Kruskal | 3bc5049 | 2022-12-01 13:34:12 -0800 | [diff] [blame] | 5930 | UPB_INLINE void google_protobuf_FileDescriptorProto_clear_options(google_protobuf_FileDescriptorProto* msg) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 5931 | 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 Bot | 4e90ead | 2024-01-08 15:46:34 +0000 | [diff] [blame] | 5932 | upb_Message_ClearBaseField(UPB_UPCAST(msg), &field); |
Joshua Haberman | d3995ec | 2022-09-30 16:54:39 -0700 | [diff] [blame] | 5933 | } |
Joshua Haberman | f41049a | 2022-01-21 14:41:25 -0800 | [diff] [blame] | 5934 | UPB_INLINE const google_protobuf_FileOptions* google_protobuf_FileDescriptorProto_options(const google_protobuf_FileDescriptorProto* msg) { |
Eric Salo | 8809a11 | 2022-11-21 13:01:06 -0800 | [diff] [blame] | 5935 | const google_protobuf_FileOptions* default_val = NULL; |
| 5936 | const google_protobuf_FileOptions* ret; |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 5937 | 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 Bot | a9387b5 | 2024-06-12 15:17:52 +0000 | [diff] [blame] | 5938 | UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__FileOptions_msg_init); |
Protobuf Team Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 5939 | _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field, |
| 5940 | &default_val, &ret); |
Eric Salo | 8809a11 | 2022-11-21 13:01:06 -0800 | [diff] [blame] | 5941 | return ret; |
Joshua Haberman | f41049a | 2022-01-21 14:41:25 -0800 | [diff] [blame] | 5942 | } |
Mike Kruskal | 3bc5049 | 2022-12-01 13:34:12 -0800 | [diff] [blame] | 5943 | UPB_INLINE bool google_protobuf_FileDescriptorProto_has_options(const google_protobuf_FileDescriptorProto* msg) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 5944 | 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 Bot | 8c1f635 | 2024-01-10 05:18:15 +0000 | [diff] [blame] | 5945 | return upb_Message_HasBaseField(UPB_UPCAST(msg), &field); |
Joshua Haberman | 7ecf43f | 2022-03-14 13:11:29 -0700 | [diff] [blame] | 5946 | } |
Mike Kruskal | 3bc5049 | 2022-12-01 13:34:12 -0800 | [diff] [blame] | 5947 | UPB_INLINE void google_protobuf_FileDescriptorProto_clear_source_code_info(google_protobuf_FileDescriptorProto* msg) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 5948 | 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 Bot | 4e90ead | 2024-01-08 15:46:34 +0000 | [diff] [blame] | 5949 | upb_Message_ClearBaseField(UPB_UPCAST(msg), &field); |
Joshua Haberman | d3995ec | 2022-09-30 16:54:39 -0700 | [diff] [blame] | 5950 | } |
Joshua Haberman | f41049a | 2022-01-21 14:41:25 -0800 | [diff] [blame] | 5951 | UPB_INLINE const google_protobuf_SourceCodeInfo* google_protobuf_FileDescriptorProto_source_code_info(const google_protobuf_FileDescriptorProto* msg) { |
Eric Salo | 8809a11 | 2022-11-21 13:01:06 -0800 | [diff] [blame] | 5952 | const google_protobuf_SourceCodeInfo* default_val = NULL; |
| 5953 | const google_protobuf_SourceCodeInfo* ret; |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 5954 | 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 Bot | a9387b5 | 2024-06-12 15:17:52 +0000 | [diff] [blame] | 5955 | UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__SourceCodeInfo_msg_init); |
Protobuf Team Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 5956 | _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field, |
| 5957 | &default_val, &ret); |
Eric Salo | 8809a11 | 2022-11-21 13:01:06 -0800 | [diff] [blame] | 5958 | return ret; |
Joshua Haberman | d3995ec | 2022-09-30 16:54:39 -0700 | [diff] [blame] | 5959 | } |
Mike Kruskal | 3bc5049 | 2022-12-01 13:34:12 -0800 | [diff] [blame] | 5960 | UPB_INLINE bool google_protobuf_FileDescriptorProto_has_source_code_info(const google_protobuf_FileDescriptorProto* msg) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 5961 | 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 Bot | 8c1f635 | 2024-01-10 05:18:15 +0000 | [diff] [blame] | 5962 | return upb_Message_HasBaseField(UPB_UPCAST(msg), &field); |
Mike Kruskal | 3bc5049 | 2022-12-01 13:34:12 -0800 | [diff] [blame] | 5963 | } |
| 5964 | UPB_INLINE void google_protobuf_FileDescriptorProto_clear_public_dependency(google_protobuf_FileDescriptorProto* msg) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 5965 | 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 Bot | 4e90ead | 2024-01-08 15:46:34 +0000 | [diff] [blame] | 5966 | upb_Message_ClearBaseField(UPB_UPCAST(msg), &field); |
Joshua Haberman | f41049a | 2022-01-21 14:41:25 -0800 | [diff] [blame] | 5967 | } |
Eric Salo | b7d54ac | 2022-12-29 11:59:42 -0800 | [diff] [blame] | 5968 | UPB_INLINE int32_t const* google_protobuf_FileDescriptorProto_public_dependency(const google_protobuf_FileDescriptorProto* msg, size_t* size) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 5969 | 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 Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 5970 | const upb_Array* arr = upb_Message_GetArray(UPB_UPCAST(msg), &field); |
Eric Salo | b7d54ac | 2022-12-29 11:59:42 -0800 | [diff] [blame] | 5971 | if (arr) { |
Protobuf Team Bot | f73985a | 2023-12-19 00:14:19 +0000 | [diff] [blame] | 5972 | if (size) *size = arr->UPB_PRIVATE(size); |
Protobuf Team Bot | 81e5433 | 2024-01-11 21:04:07 +0000 | [diff] [blame] | 5973 | return (int32_t const*)upb_Array_DataPtr(arr); |
Eric Salo | b7d54ac | 2022-12-29 11:59:42 -0800 | [diff] [blame] | 5974 | } else { |
| 5975 | if (size) *size = 0; |
| 5976 | return NULL; |
| 5977 | } |
Joshua Haberman | d3995ec | 2022-09-30 16:54:39 -0700 | [diff] [blame] | 5978 | } |
Deanna Garcia | b26afb5 | 2023-04-25 13:37:18 -0700 | [diff] [blame] | 5979 | UPB_INLINE const upb_Array* _google_protobuf_FileDescriptorProto_public_dependency_upb_array(const google_protobuf_FileDescriptorProto* msg, size_t* size) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 5980 | 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 Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 5981 | const upb_Array* arr = upb_Message_GetArray(UPB_UPCAST(msg), &field); |
Deanna Garcia | b26afb5 | 2023-04-25 13:37:18 -0700 | [diff] [blame] | 5982 | if (size) { |
Protobuf Team Bot | f73985a | 2023-12-19 00:14:19 +0000 | [diff] [blame] | 5983 | *size = arr ? arr->UPB_PRIVATE(size) : 0; |
Deanna Garcia | b26afb5 | 2023-04-25 13:37:18 -0700 | [diff] [blame] | 5984 | } |
| 5985 | return arr; |
| 5986 | } |
Protobuf Team Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 5987 | UPB_INLINE upb_Array* _google_protobuf_FileDescriptorProto_public_dependency_mutable_upb_array(google_protobuf_FileDescriptorProto* msg, size_t* size, upb_Arena* arena) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 5988 | 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 Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 5989 | upb_Array* arr = upb_Message_GetOrCreateMutableArray(UPB_UPCAST(msg), |
| 5990 | &field, arena); |
Deanna Garcia | b26afb5 | 2023-04-25 13:37:18 -0700 | [diff] [blame] | 5991 | if (size) { |
Protobuf Team Bot | f73985a | 2023-12-19 00:14:19 +0000 | [diff] [blame] | 5992 | *size = arr ? arr->UPB_PRIVATE(size) : 0; |
Deanna Garcia | b26afb5 | 2023-04-25 13:37:18 -0700 | [diff] [blame] | 5993 | } |
| 5994 | return arr; |
| 5995 | } |
Mike Kruskal | 3bc5049 | 2022-12-01 13:34:12 -0800 | [diff] [blame] | 5996 | UPB_INLINE void google_protobuf_FileDescriptorProto_clear_weak_dependency(google_protobuf_FileDescriptorProto* msg) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 5997 | 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 Bot | 4e90ead | 2024-01-08 15:46:34 +0000 | [diff] [blame] | 5998 | upb_Message_ClearBaseField(UPB_UPCAST(msg), &field); |
Joshua Haberman | 7ecf43f | 2022-03-14 13:11:29 -0700 | [diff] [blame] | 5999 | } |
Eric Salo | b7d54ac | 2022-12-29 11:59:42 -0800 | [diff] [blame] | 6000 | UPB_INLINE int32_t const* google_protobuf_FileDescriptorProto_weak_dependency(const google_protobuf_FileDescriptorProto* msg, size_t* size) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 6001 | 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 Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 6002 | const upb_Array* arr = upb_Message_GetArray(UPB_UPCAST(msg), &field); |
Eric Salo | b7d54ac | 2022-12-29 11:59:42 -0800 | [diff] [blame] | 6003 | if (arr) { |
Protobuf Team Bot | f73985a | 2023-12-19 00:14:19 +0000 | [diff] [blame] | 6004 | if (size) *size = arr->UPB_PRIVATE(size); |
Protobuf Team Bot | 81e5433 | 2024-01-11 21:04:07 +0000 | [diff] [blame] | 6005 | return (int32_t const*)upb_Array_DataPtr(arr); |
Eric Salo | b7d54ac | 2022-12-29 11:59:42 -0800 | [diff] [blame] | 6006 | } else { |
| 6007 | if (size) *size = 0; |
| 6008 | return NULL; |
| 6009 | } |
Joshua Haberman | 7ecf43f | 2022-03-14 13:11:29 -0700 | [diff] [blame] | 6010 | } |
Deanna Garcia | b26afb5 | 2023-04-25 13:37:18 -0700 | [diff] [blame] | 6011 | UPB_INLINE const upb_Array* _google_protobuf_FileDescriptorProto_weak_dependency_upb_array(const google_protobuf_FileDescriptorProto* msg, size_t* size) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 6012 | 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 Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 6013 | const upb_Array* arr = upb_Message_GetArray(UPB_UPCAST(msg), &field); |
Deanna Garcia | b26afb5 | 2023-04-25 13:37:18 -0700 | [diff] [blame] | 6014 | if (size) { |
Protobuf Team Bot | f73985a | 2023-12-19 00:14:19 +0000 | [diff] [blame] | 6015 | *size = arr ? arr->UPB_PRIVATE(size) : 0; |
Deanna Garcia | b26afb5 | 2023-04-25 13:37:18 -0700 | [diff] [blame] | 6016 | } |
| 6017 | return arr; |
| 6018 | } |
Protobuf Team Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 6019 | UPB_INLINE upb_Array* _google_protobuf_FileDescriptorProto_weak_dependency_mutable_upb_array(google_protobuf_FileDescriptorProto* msg, size_t* size, upb_Arena* arena) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 6020 | 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 Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 6021 | upb_Array* arr = upb_Message_GetOrCreateMutableArray(UPB_UPCAST(msg), |
| 6022 | &field, arena); |
Deanna Garcia | b26afb5 | 2023-04-25 13:37:18 -0700 | [diff] [blame] | 6023 | if (size) { |
Protobuf Team Bot | f73985a | 2023-12-19 00:14:19 +0000 | [diff] [blame] | 6024 | *size = arr ? arr->UPB_PRIVATE(size) : 0; |
Deanna Garcia | b26afb5 | 2023-04-25 13:37:18 -0700 | [diff] [blame] | 6025 | } |
| 6026 | return arr; |
| 6027 | } |
Mike Kruskal | 3bc5049 | 2022-12-01 13:34:12 -0800 | [diff] [blame] | 6028 | UPB_INLINE void google_protobuf_FileDescriptorProto_clear_syntax(google_protobuf_FileDescriptorProto* msg) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 6029 | 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 Bot | 4e90ead | 2024-01-08 15:46:34 +0000 | [diff] [blame] | 6030 | upb_Message_ClearBaseField(UPB_UPCAST(msg), &field); |
Joshua Haberman | d3995ec | 2022-09-30 16:54:39 -0700 | [diff] [blame] | 6031 | } |
Joshua Haberman | f41049a | 2022-01-21 14:41:25 -0800 | [diff] [blame] | 6032 | UPB_INLINE upb_StringView google_protobuf_FileDescriptorProto_syntax(const google_protobuf_FileDescriptorProto* msg) { |
Eric Salo | 8809a11 | 2022-11-21 13:01:06 -0800 | [diff] [blame] | 6033 | upb_StringView default_val = upb_StringView_FromString(""); |
| 6034 | upb_StringView ret; |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 6035 | 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 Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 6036 | _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field, |
| 6037 | &default_val, &ret); |
Eric Salo | 8809a11 | 2022-11-21 13:01:06 -0800 | [diff] [blame] | 6038 | return ret; |
Joshua Haberman | d3995ec | 2022-09-30 16:54:39 -0700 | [diff] [blame] | 6039 | } |
Mike Kruskal | 3bc5049 | 2022-12-01 13:34:12 -0800 | [diff] [blame] | 6040 | UPB_INLINE bool google_protobuf_FileDescriptorProto_has_syntax(const google_protobuf_FileDescriptorProto* msg) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 6041 | 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 Bot | 8c1f635 | 2024-01-10 05:18:15 +0000 | [diff] [blame] | 6042 | return upb_Message_HasBaseField(UPB_UPCAST(msg), &field); |
Joshua Haberman | d3995ec | 2022-09-30 16:54:39 -0700 | [diff] [blame] | 6043 | } |
Mike Kruskal | 3bc5049 | 2022-12-01 13:34:12 -0800 | [diff] [blame] | 6044 | UPB_INLINE void google_protobuf_FileDescriptorProto_clear_edition(google_protobuf_FileDescriptorProto* msg) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 6045 | 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 Bot | 4e90ead | 2024-01-08 15:46:34 +0000 | [diff] [blame] | 6046 | upb_Message_ClearBaseField(UPB_UPCAST(msg), &field); |
Joshua Haberman | d3995ec | 2022-09-30 16:54:39 -0700 | [diff] [blame] | 6047 | } |
Protobuf Team Bot | ab58f8f | 2023-09-26 16:14:19 +0000 | [diff] [blame] | 6048 | UPB_INLINE int32_t google_protobuf_FileDescriptorProto_edition(const google_protobuf_FileDescriptorProto* msg) { |
| 6049 | int32_t default_val = 0; |
| 6050 | int32_t ret; |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 6051 | 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 Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 6052 | _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field, |
| 6053 | &default_val, &ret); |
Eric Salo | 8809a11 | 2022-11-21 13:01:06 -0800 | [diff] [blame] | 6054 | return ret; |
Joshua Haberman | f41049a | 2022-01-21 14:41:25 -0800 | [diff] [blame] | 6055 | } |
Mike Kruskal | 3bc5049 | 2022-12-01 13:34:12 -0800 | [diff] [blame] | 6056 | UPB_INLINE bool google_protobuf_FileDescriptorProto_has_edition(const google_protobuf_FileDescriptorProto* msg) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 6057 | 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 Bot | 8c1f635 | 2024-01-10 05:18:15 +0000 | [diff] [blame] | 6058 | return upb_Message_HasBaseField(UPB_UPCAST(msg), &field); |
Mike Kruskal | 3bc5049 | 2022-12-01 13:34:12 -0800 | [diff] [blame] | 6059 | } |
Joshua Haberman | 9abf6e2 | 2021-01-13 12:16:25 -0800 | [diff] [blame] | 6060 | |
Joshua Haberman | f41049a | 2022-01-21 14:41:25 -0800 | [diff] [blame] | 6061 | UPB_INLINE void google_protobuf_FileDescriptorProto_set_name(google_protobuf_FileDescriptorProto *msg, upb_StringView value) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 6062 | 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 Bot | ac32c97 | 2024-04-10 03:30:05 +0000 | [diff] [blame] | 6063 | upb_Message_SetBaseField((upb_Message *)msg, &field, &value); |
Mike Kruskal | 232ecf4 | 2023-01-14 00:09:40 -0800 | [diff] [blame] | 6064 | } |
| 6065 | UPB_INLINE void google_protobuf_FileDescriptorProto_set_package(google_protobuf_FileDescriptorProto *msg, upb_StringView value) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 6066 | 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 Bot | ac32c97 | 2024-04-10 03:30:05 +0000 | [diff] [blame] | 6067 | upb_Message_SetBaseField((upb_Message *)msg, &field, &value); |
Mike Kruskal | 232ecf4 | 2023-01-14 00:09:40 -0800 | [diff] [blame] | 6068 | } |
| 6069 | UPB_INLINE upb_StringView* google_protobuf_FileDescriptorProto_mutable_dependency(google_protobuf_FileDescriptorProto* msg, size_t* size) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 6070 | 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 Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 6071 | upb_Array* arr = upb_Message_GetMutableArray(UPB_UPCAST(msg), &field); |
Eric Salo | b7d54ac | 2022-12-29 11:59:42 -0800 | [diff] [blame] | 6072 | if (arr) { |
Protobuf Team Bot | f73985a | 2023-12-19 00:14:19 +0000 | [diff] [blame] | 6073 | if (size) *size = arr->UPB_PRIVATE(size); |
Protobuf Team Bot | 81e5433 | 2024-01-11 21:04:07 +0000 | [diff] [blame] | 6074 | return (upb_StringView*)upb_Array_MutableDataPtr(arr); |
Eric Salo | b7d54ac | 2022-12-29 11:59:42 -0800 | [diff] [blame] | 6075 | } else { |
| 6076 | if (size) *size = 0; |
| 6077 | return NULL; |
| 6078 | } |
Joshua Haberman | 9abf6e2 | 2021-01-13 12:16:25 -0800 | [diff] [blame] | 6079 | } |
Eric Salo | b7d54ac | 2022-12-29 11:59:42 -0800 | [diff] [blame] | 6080 | UPB_INLINE upb_StringView* google_protobuf_FileDescriptorProto_resize_dependency(google_protobuf_FileDescriptorProto* msg, size_t size, upb_Arena* arena) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 6081 | 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 Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 6082 | return (upb_StringView*)upb_Message_ResizeArrayUninitialized(UPB_UPCAST(msg), |
| 6083 | &field, size, arena); |
Joshua Haberman | 9abf6e2 | 2021-01-13 12:16:25 -0800 | [diff] [blame] | 6084 | } |
Joshua Haberman | 7ecf43f | 2022-03-14 13:11:29 -0700 | [diff] [blame] | 6085 | UPB_INLINE bool google_protobuf_FileDescriptorProto_add_dependency(google_protobuf_FileDescriptorProto* msg, upb_StringView val, upb_Arena* arena) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 6086 | 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 Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 6087 | upb_Array* arr = upb_Message_GetOrCreateMutableArray( |
| 6088 | UPB_UPCAST(msg), &field, arena); |
Protobuf Team Bot | 81e5433 | 2024-01-11 21:04:07 +0000 | [diff] [blame] | 6089 | if (!arr || !UPB_PRIVATE(_upb_Array_ResizeUninitialized)( |
Protobuf Team Bot | f73985a | 2023-12-19 00:14:19 +0000 | [diff] [blame] | 6090 | arr, arr->UPB_PRIVATE(size) + 1, arena)) { |
Eric Salo | b7d54ac | 2022-12-29 11:59:42 -0800 | [diff] [blame] | 6091 | return false; |
| 6092 | } |
Protobuf Team Bot | f73985a | 2023-12-19 00:14:19 +0000 | [diff] [blame] | 6093 | UPB_PRIVATE(_upb_Array_Set) |
| 6094 | (arr, arr->UPB_PRIVATE(size) - 1, &val, sizeof(val)); |
Eric Salo | b7d54ac | 2022-12-29 11:59:42 -0800 | [diff] [blame] | 6095 | return true; |
Joshua Haberman | 9abf6e2 | 2021-01-13 12:16:25 -0800 | [diff] [blame] | 6096 | } |
Eric Salo | b7d54ac | 2022-12-29 11:59:42 -0800 | [diff] [blame] | 6097 | UPB_INLINE google_protobuf_DescriptorProto** google_protobuf_FileDescriptorProto_mutable_message_type(google_protobuf_FileDescriptorProto* msg, size_t* size) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 6098 | 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 Bot | a9387b5 | 2024-06-12 15:17:52 +0000 | [diff] [blame] | 6099 | UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__DescriptorProto_msg_init); |
Protobuf Team Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 6100 | upb_Array* arr = upb_Message_GetMutableArray(UPB_UPCAST(msg), &field); |
Eric Salo | b7d54ac | 2022-12-29 11:59:42 -0800 | [diff] [blame] | 6101 | if (arr) { |
Protobuf Team Bot | f73985a | 2023-12-19 00:14:19 +0000 | [diff] [blame] | 6102 | if (size) *size = arr->UPB_PRIVATE(size); |
Protobuf Team Bot | 81e5433 | 2024-01-11 21:04:07 +0000 | [diff] [blame] | 6103 | return (google_protobuf_DescriptorProto**)upb_Array_MutableDataPtr(arr); |
Eric Salo | b7d54ac | 2022-12-29 11:59:42 -0800 | [diff] [blame] | 6104 | } else { |
| 6105 | if (size) *size = 0; |
| 6106 | return NULL; |
| 6107 | } |
Joshua Haberman | 9abf6e2 | 2021-01-13 12:16:25 -0800 | [diff] [blame] | 6108 | } |
Eric Salo | b7d54ac | 2022-12-29 11:59:42 -0800 | [diff] [blame] | 6109 | UPB_INLINE google_protobuf_DescriptorProto** google_protobuf_FileDescriptorProto_resize_message_type(google_protobuf_FileDescriptorProto* msg, size_t size, upb_Arena* arena) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 6110 | 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 Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 6111 | return (google_protobuf_DescriptorProto**)upb_Message_ResizeArrayUninitialized(UPB_UPCAST(msg), |
| 6112 | &field, size, arena); |
Joshua Haberman | 9abf6e2 | 2021-01-13 12:16:25 -0800 | [diff] [blame] | 6113 | } |
Joshua Haberman | 7ecf43f | 2022-03-14 13:11:29 -0700 | [diff] [blame] | 6114 | UPB_INLINE struct google_protobuf_DescriptorProto* google_protobuf_FileDescriptorProto_add_message_type(google_protobuf_FileDescriptorProto* msg, upb_Arena* arena) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 6115 | 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 Bot | a9387b5 | 2024-06-12 15:17:52 +0000 | [diff] [blame] | 6116 | UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__DescriptorProto_msg_init); |
Protobuf Team Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 6117 | upb_Array* arr = upb_Message_GetOrCreateMutableArray( |
| 6118 | UPB_UPCAST(msg), &field, arena); |
Protobuf Team Bot | 81e5433 | 2024-01-11 21:04:07 +0000 | [diff] [blame] | 6119 | if (!arr || !UPB_PRIVATE(_upb_Array_ResizeUninitialized)( |
Protobuf Team Bot | f73985a | 2023-12-19 00:14:19 +0000 | [diff] [blame] | 6120 | arr, arr->UPB_PRIVATE(size) + 1, arena)) { |
Eric Salo | b7d54ac | 2022-12-29 11:59:42 -0800 | [diff] [blame] | 6121 | return NULL; |
| 6122 | } |
Protobuf Team Bot | 4ffe086 | 2023-12-06 02:02:36 +0000 | [diff] [blame] | 6123 | struct google_protobuf_DescriptorProto* sub = (struct google_protobuf_DescriptorProto*)_upb_Message_New(&google__protobuf__DescriptorProto_msg_init, arena); |
Eric Salo | b7d54ac | 2022-12-29 11:59:42 -0800 | [diff] [blame] | 6124 | if (!arr || !sub) return NULL; |
Protobuf Team Bot | f73985a | 2023-12-19 00:14:19 +0000 | [diff] [blame] | 6125 | UPB_PRIVATE(_upb_Array_Set) |
| 6126 | (arr, arr->UPB_PRIVATE(size) - 1, &sub, sizeof(sub)); |
Joshua Haberman | 9abf6e2 | 2021-01-13 12:16:25 -0800 | [diff] [blame] | 6127 | return sub; |
| 6128 | } |
Eric Salo | b7d54ac | 2022-12-29 11:59:42 -0800 | [diff] [blame] | 6129 | UPB_INLINE google_protobuf_EnumDescriptorProto** google_protobuf_FileDescriptorProto_mutable_enum_type(google_protobuf_FileDescriptorProto* msg, size_t* size) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 6130 | 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 Bot | a9387b5 | 2024-06-12 15:17:52 +0000 | [diff] [blame] | 6131 | UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__EnumDescriptorProto_msg_init); |
Protobuf Team Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 6132 | upb_Array* arr = upb_Message_GetMutableArray(UPB_UPCAST(msg), &field); |
Eric Salo | b7d54ac | 2022-12-29 11:59:42 -0800 | [diff] [blame] | 6133 | if (arr) { |
Protobuf Team Bot | f73985a | 2023-12-19 00:14:19 +0000 | [diff] [blame] | 6134 | if (size) *size = arr->UPB_PRIVATE(size); |
Protobuf Team Bot | 81e5433 | 2024-01-11 21:04:07 +0000 | [diff] [blame] | 6135 | return (google_protobuf_EnumDescriptorProto**)upb_Array_MutableDataPtr(arr); |
Eric Salo | b7d54ac | 2022-12-29 11:59:42 -0800 | [diff] [blame] | 6136 | } else { |
| 6137 | if (size) *size = 0; |
| 6138 | return NULL; |
| 6139 | } |
Joshua Haberman | 9abf6e2 | 2021-01-13 12:16:25 -0800 | [diff] [blame] | 6140 | } |
Eric Salo | b7d54ac | 2022-12-29 11:59:42 -0800 | [diff] [blame] | 6141 | UPB_INLINE google_protobuf_EnumDescriptorProto** google_protobuf_FileDescriptorProto_resize_enum_type(google_protobuf_FileDescriptorProto* msg, size_t size, upb_Arena* arena) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 6142 | 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 Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 6143 | return (google_protobuf_EnumDescriptorProto**)upb_Message_ResizeArrayUninitialized(UPB_UPCAST(msg), |
| 6144 | &field, size, arena); |
Joshua Haberman | 9abf6e2 | 2021-01-13 12:16:25 -0800 | [diff] [blame] | 6145 | } |
Joshua Haberman | 7ecf43f | 2022-03-14 13:11:29 -0700 | [diff] [blame] | 6146 | UPB_INLINE struct google_protobuf_EnumDescriptorProto* google_protobuf_FileDescriptorProto_add_enum_type(google_protobuf_FileDescriptorProto* msg, upb_Arena* arena) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 6147 | 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 Bot | a9387b5 | 2024-06-12 15:17:52 +0000 | [diff] [blame] | 6148 | UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__EnumDescriptorProto_msg_init); |
Protobuf Team Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 6149 | upb_Array* arr = upb_Message_GetOrCreateMutableArray( |
| 6150 | UPB_UPCAST(msg), &field, arena); |
Protobuf Team Bot | 81e5433 | 2024-01-11 21:04:07 +0000 | [diff] [blame] | 6151 | if (!arr || !UPB_PRIVATE(_upb_Array_ResizeUninitialized)( |
Protobuf Team Bot | f73985a | 2023-12-19 00:14:19 +0000 | [diff] [blame] | 6152 | arr, arr->UPB_PRIVATE(size) + 1, arena)) { |
Eric Salo | b7d54ac | 2022-12-29 11:59:42 -0800 | [diff] [blame] | 6153 | return NULL; |
| 6154 | } |
Protobuf Team Bot | 4ffe086 | 2023-12-06 02:02:36 +0000 | [diff] [blame] | 6155 | struct google_protobuf_EnumDescriptorProto* sub = (struct google_protobuf_EnumDescriptorProto*)_upb_Message_New(&google__protobuf__EnumDescriptorProto_msg_init, arena); |
Eric Salo | b7d54ac | 2022-12-29 11:59:42 -0800 | [diff] [blame] | 6156 | if (!arr || !sub) return NULL; |
Protobuf Team Bot | f73985a | 2023-12-19 00:14:19 +0000 | [diff] [blame] | 6157 | UPB_PRIVATE(_upb_Array_Set) |
| 6158 | (arr, arr->UPB_PRIVATE(size) - 1, &sub, sizeof(sub)); |
Joshua Haberman | 9abf6e2 | 2021-01-13 12:16:25 -0800 | [diff] [blame] | 6159 | return sub; |
| 6160 | } |
Eric Salo | b7d54ac | 2022-12-29 11:59:42 -0800 | [diff] [blame] | 6161 | UPB_INLINE google_protobuf_ServiceDescriptorProto** google_protobuf_FileDescriptorProto_mutable_service(google_protobuf_FileDescriptorProto* msg, size_t* size) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 6162 | 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 Bot | a9387b5 | 2024-06-12 15:17:52 +0000 | [diff] [blame] | 6163 | UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__ServiceDescriptorProto_msg_init); |
Protobuf Team Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 6164 | upb_Array* arr = upb_Message_GetMutableArray(UPB_UPCAST(msg), &field); |
Eric Salo | b7d54ac | 2022-12-29 11:59:42 -0800 | [diff] [blame] | 6165 | if (arr) { |
Protobuf Team Bot | f73985a | 2023-12-19 00:14:19 +0000 | [diff] [blame] | 6166 | if (size) *size = arr->UPB_PRIVATE(size); |
Protobuf Team Bot | 81e5433 | 2024-01-11 21:04:07 +0000 | [diff] [blame] | 6167 | return (google_protobuf_ServiceDescriptorProto**)upb_Array_MutableDataPtr(arr); |
Eric Salo | b7d54ac | 2022-12-29 11:59:42 -0800 | [diff] [blame] | 6168 | } else { |
| 6169 | if (size) *size = 0; |
| 6170 | return NULL; |
| 6171 | } |
Joshua Haberman | 9abf6e2 | 2021-01-13 12:16:25 -0800 | [diff] [blame] | 6172 | } |
Eric Salo | b7d54ac | 2022-12-29 11:59:42 -0800 | [diff] [blame] | 6173 | UPB_INLINE google_protobuf_ServiceDescriptorProto** google_protobuf_FileDescriptorProto_resize_service(google_protobuf_FileDescriptorProto* msg, size_t size, upb_Arena* arena) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 6174 | 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 Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 6175 | return (google_protobuf_ServiceDescriptorProto**)upb_Message_ResizeArrayUninitialized(UPB_UPCAST(msg), |
| 6176 | &field, size, arena); |
Joshua Haberman | 9abf6e2 | 2021-01-13 12:16:25 -0800 | [diff] [blame] | 6177 | } |
Joshua Haberman | 7ecf43f | 2022-03-14 13:11:29 -0700 | [diff] [blame] | 6178 | UPB_INLINE struct google_protobuf_ServiceDescriptorProto* google_protobuf_FileDescriptorProto_add_service(google_protobuf_FileDescriptorProto* msg, upb_Arena* arena) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 6179 | 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 Bot | a9387b5 | 2024-06-12 15:17:52 +0000 | [diff] [blame] | 6180 | UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__ServiceDescriptorProto_msg_init); |
Protobuf Team Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 6181 | upb_Array* arr = upb_Message_GetOrCreateMutableArray( |
| 6182 | UPB_UPCAST(msg), &field, arena); |
Protobuf Team Bot | 81e5433 | 2024-01-11 21:04:07 +0000 | [diff] [blame] | 6183 | if (!arr || !UPB_PRIVATE(_upb_Array_ResizeUninitialized)( |
Protobuf Team Bot | f73985a | 2023-12-19 00:14:19 +0000 | [diff] [blame] | 6184 | arr, arr->UPB_PRIVATE(size) + 1, arena)) { |
Eric Salo | b7d54ac | 2022-12-29 11:59:42 -0800 | [diff] [blame] | 6185 | return NULL; |
| 6186 | } |
Protobuf Team Bot | 4ffe086 | 2023-12-06 02:02:36 +0000 | [diff] [blame] | 6187 | struct google_protobuf_ServiceDescriptorProto* sub = (struct google_protobuf_ServiceDescriptorProto*)_upb_Message_New(&google__protobuf__ServiceDescriptorProto_msg_init, arena); |
Eric Salo | b7d54ac | 2022-12-29 11:59:42 -0800 | [diff] [blame] | 6188 | if (!arr || !sub) return NULL; |
Protobuf Team Bot | f73985a | 2023-12-19 00:14:19 +0000 | [diff] [blame] | 6189 | UPB_PRIVATE(_upb_Array_Set) |
| 6190 | (arr, arr->UPB_PRIVATE(size) - 1, &sub, sizeof(sub)); |
Joshua Haberman | 9abf6e2 | 2021-01-13 12:16:25 -0800 | [diff] [blame] | 6191 | return sub; |
| 6192 | } |
Eric Salo | b7d54ac | 2022-12-29 11:59:42 -0800 | [diff] [blame] | 6193 | UPB_INLINE google_protobuf_FieldDescriptorProto** google_protobuf_FileDescriptorProto_mutable_extension(google_protobuf_FileDescriptorProto* msg, size_t* size) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 6194 | 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 Bot | a9387b5 | 2024-06-12 15:17:52 +0000 | [diff] [blame] | 6195 | UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__FieldDescriptorProto_msg_init); |
Protobuf Team Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 6196 | upb_Array* arr = upb_Message_GetMutableArray(UPB_UPCAST(msg), &field); |
Eric Salo | b7d54ac | 2022-12-29 11:59:42 -0800 | [diff] [blame] | 6197 | if (arr) { |
Protobuf Team Bot | f73985a | 2023-12-19 00:14:19 +0000 | [diff] [blame] | 6198 | if (size) *size = arr->UPB_PRIVATE(size); |
Protobuf Team Bot | 81e5433 | 2024-01-11 21:04:07 +0000 | [diff] [blame] | 6199 | return (google_protobuf_FieldDescriptorProto**)upb_Array_MutableDataPtr(arr); |
Eric Salo | b7d54ac | 2022-12-29 11:59:42 -0800 | [diff] [blame] | 6200 | } else { |
| 6201 | if (size) *size = 0; |
| 6202 | return NULL; |
| 6203 | } |
Joshua Haberman | 9abf6e2 | 2021-01-13 12:16:25 -0800 | [diff] [blame] | 6204 | } |
Eric Salo | b7d54ac | 2022-12-29 11:59:42 -0800 | [diff] [blame] | 6205 | UPB_INLINE google_protobuf_FieldDescriptorProto** google_protobuf_FileDescriptorProto_resize_extension(google_protobuf_FileDescriptorProto* msg, size_t size, upb_Arena* arena) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 6206 | 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 Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 6207 | return (google_protobuf_FieldDescriptorProto**)upb_Message_ResizeArrayUninitialized(UPB_UPCAST(msg), |
| 6208 | &field, size, arena); |
Joshua Haberman | 9abf6e2 | 2021-01-13 12:16:25 -0800 | [diff] [blame] | 6209 | } |
Joshua Haberman | 7ecf43f | 2022-03-14 13:11:29 -0700 | [diff] [blame] | 6210 | UPB_INLINE struct google_protobuf_FieldDescriptorProto* google_protobuf_FileDescriptorProto_add_extension(google_protobuf_FileDescriptorProto* msg, upb_Arena* arena) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 6211 | 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 Bot | a9387b5 | 2024-06-12 15:17:52 +0000 | [diff] [blame] | 6212 | UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__FieldDescriptorProto_msg_init); |
Protobuf Team Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 6213 | upb_Array* arr = upb_Message_GetOrCreateMutableArray( |
| 6214 | UPB_UPCAST(msg), &field, arena); |
Protobuf Team Bot | 81e5433 | 2024-01-11 21:04:07 +0000 | [diff] [blame] | 6215 | if (!arr || !UPB_PRIVATE(_upb_Array_ResizeUninitialized)( |
Protobuf Team Bot | f73985a | 2023-12-19 00:14:19 +0000 | [diff] [blame] | 6216 | arr, arr->UPB_PRIVATE(size) + 1, arena)) { |
Eric Salo | b7d54ac | 2022-12-29 11:59:42 -0800 | [diff] [blame] | 6217 | return NULL; |
| 6218 | } |
Protobuf Team Bot | 4ffe086 | 2023-12-06 02:02:36 +0000 | [diff] [blame] | 6219 | struct google_protobuf_FieldDescriptorProto* sub = (struct google_protobuf_FieldDescriptorProto*)_upb_Message_New(&google__protobuf__FieldDescriptorProto_msg_init, arena); |
Eric Salo | b7d54ac | 2022-12-29 11:59:42 -0800 | [diff] [blame] | 6220 | if (!arr || !sub) return NULL; |
Protobuf Team Bot | f73985a | 2023-12-19 00:14:19 +0000 | [diff] [blame] | 6221 | UPB_PRIVATE(_upb_Array_Set) |
| 6222 | (arr, arr->UPB_PRIVATE(size) - 1, &sub, sizeof(sub)); |
Joshua Haberman | 9abf6e2 | 2021-01-13 12:16:25 -0800 | [diff] [blame] | 6223 | return sub; |
| 6224 | } |
| 6225 | UPB_INLINE void google_protobuf_FileDescriptorProto_set_options(google_protobuf_FileDescriptorProto *msg, google_protobuf_FileOptions* value) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 6226 | 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 Bot | a9387b5 | 2024-06-12 15:17:52 +0000 | [diff] [blame] | 6227 | UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__FileOptions_msg_init); |
Protobuf Team Bot | ac32c97 | 2024-04-10 03:30:05 +0000 | [diff] [blame] | 6228 | upb_Message_SetBaseField((upb_Message *)msg, &field, &value); |
Mike Kruskal | 232ecf4 | 2023-01-14 00:09:40 -0800 | [diff] [blame] | 6229 | } |
| 6230 | UPB_INLINE struct google_protobuf_FileOptions* google_protobuf_FileDescriptorProto_mutable_options(google_protobuf_FileDescriptorProto* msg, upb_Arena* arena) { |
Joshua Haberman | 9abf6e2 | 2021-01-13 12:16:25 -0800 | [diff] [blame] | 6231 | struct google_protobuf_FileOptions* sub = (struct google_protobuf_FileOptions*)google_protobuf_FileDescriptorProto_options(msg); |
| 6232 | if (sub == NULL) { |
Protobuf Team Bot | 4ffe086 | 2023-12-06 02:02:36 +0000 | [diff] [blame] | 6233 | sub = (struct google_protobuf_FileOptions*)_upb_Message_New(&google__protobuf__FileOptions_msg_init, arena); |
Eric Salo | 8809a11 | 2022-11-21 13:01:06 -0800 | [diff] [blame] | 6234 | if (sub) google_protobuf_FileDescriptorProto_set_options(msg, sub); |
Joshua Haberman | 9abf6e2 | 2021-01-13 12:16:25 -0800 | [diff] [blame] | 6235 | } |
| 6236 | return sub; |
| 6237 | } |
| 6238 | UPB_INLINE void google_protobuf_FileDescriptorProto_set_source_code_info(google_protobuf_FileDescriptorProto *msg, google_protobuf_SourceCodeInfo* value) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 6239 | 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 Bot | a9387b5 | 2024-06-12 15:17:52 +0000 | [diff] [blame] | 6240 | UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__SourceCodeInfo_msg_init); |
Protobuf Team Bot | ac32c97 | 2024-04-10 03:30:05 +0000 | [diff] [blame] | 6241 | upb_Message_SetBaseField((upb_Message *)msg, &field, &value); |
Mike Kruskal | 232ecf4 | 2023-01-14 00:09:40 -0800 | [diff] [blame] | 6242 | } |
| 6243 | UPB_INLINE struct google_protobuf_SourceCodeInfo* google_protobuf_FileDescriptorProto_mutable_source_code_info(google_protobuf_FileDescriptorProto* msg, upb_Arena* arena) { |
Joshua Haberman | 9abf6e2 | 2021-01-13 12:16:25 -0800 | [diff] [blame] | 6244 | struct google_protobuf_SourceCodeInfo* sub = (struct google_protobuf_SourceCodeInfo*)google_protobuf_FileDescriptorProto_source_code_info(msg); |
| 6245 | if (sub == NULL) { |
Protobuf Team Bot | 4ffe086 | 2023-12-06 02:02:36 +0000 | [diff] [blame] | 6246 | sub = (struct google_protobuf_SourceCodeInfo*)_upb_Message_New(&google__protobuf__SourceCodeInfo_msg_init, arena); |
Eric Salo | 8809a11 | 2022-11-21 13:01:06 -0800 | [diff] [blame] | 6247 | if (sub) google_protobuf_FileDescriptorProto_set_source_code_info(msg, sub); |
Joshua Haberman | 9abf6e2 | 2021-01-13 12:16:25 -0800 | [diff] [blame] | 6248 | } |
| 6249 | return sub; |
| 6250 | } |
Eric Salo | b7d54ac | 2022-12-29 11:59:42 -0800 | [diff] [blame] | 6251 | UPB_INLINE int32_t* google_protobuf_FileDescriptorProto_mutable_public_dependency(google_protobuf_FileDescriptorProto* msg, size_t* size) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 6252 | 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 Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 6253 | upb_Array* arr = upb_Message_GetMutableArray(UPB_UPCAST(msg), &field); |
Eric Salo | b7d54ac | 2022-12-29 11:59:42 -0800 | [diff] [blame] | 6254 | if (arr) { |
Protobuf Team Bot | f73985a | 2023-12-19 00:14:19 +0000 | [diff] [blame] | 6255 | if (size) *size = arr->UPB_PRIVATE(size); |
Protobuf Team Bot | 81e5433 | 2024-01-11 21:04:07 +0000 | [diff] [blame] | 6256 | return (int32_t*)upb_Array_MutableDataPtr(arr); |
Eric Salo | b7d54ac | 2022-12-29 11:59:42 -0800 | [diff] [blame] | 6257 | } else { |
| 6258 | if (size) *size = 0; |
| 6259 | return NULL; |
| 6260 | } |
Joshua Haberman | 9abf6e2 | 2021-01-13 12:16:25 -0800 | [diff] [blame] | 6261 | } |
Eric Salo | b7d54ac | 2022-12-29 11:59:42 -0800 | [diff] [blame] | 6262 | UPB_INLINE int32_t* google_protobuf_FileDescriptorProto_resize_public_dependency(google_protobuf_FileDescriptorProto* msg, size_t size, upb_Arena* arena) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 6263 | 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 Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 6264 | return (int32_t*)upb_Message_ResizeArrayUninitialized(UPB_UPCAST(msg), |
| 6265 | &field, size, arena); |
Joshua Haberman | 9abf6e2 | 2021-01-13 12:16:25 -0800 | [diff] [blame] | 6266 | } |
Joshua Haberman | 7ecf43f | 2022-03-14 13:11:29 -0700 | [diff] [blame] | 6267 | UPB_INLINE bool google_protobuf_FileDescriptorProto_add_public_dependency(google_protobuf_FileDescriptorProto* msg, int32_t val, upb_Arena* arena) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 6268 | 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 Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 6269 | upb_Array* arr = upb_Message_GetOrCreateMutableArray( |
| 6270 | UPB_UPCAST(msg), &field, arena); |
Protobuf Team Bot | 81e5433 | 2024-01-11 21:04:07 +0000 | [diff] [blame] | 6271 | if (!arr || !UPB_PRIVATE(_upb_Array_ResizeUninitialized)( |
Protobuf Team Bot | f73985a | 2023-12-19 00:14:19 +0000 | [diff] [blame] | 6272 | arr, arr->UPB_PRIVATE(size) + 1, arena)) { |
Eric Salo | b7d54ac | 2022-12-29 11:59:42 -0800 | [diff] [blame] | 6273 | return false; |
| 6274 | } |
Protobuf Team Bot | f73985a | 2023-12-19 00:14:19 +0000 | [diff] [blame] | 6275 | UPB_PRIVATE(_upb_Array_Set) |
| 6276 | (arr, arr->UPB_PRIVATE(size) - 1, &val, sizeof(val)); |
Eric Salo | b7d54ac | 2022-12-29 11:59:42 -0800 | [diff] [blame] | 6277 | return true; |
Joshua Haberman | 9abf6e2 | 2021-01-13 12:16:25 -0800 | [diff] [blame] | 6278 | } |
Eric Salo | b7d54ac | 2022-12-29 11:59:42 -0800 | [diff] [blame] | 6279 | UPB_INLINE int32_t* google_protobuf_FileDescriptorProto_mutable_weak_dependency(google_protobuf_FileDescriptorProto* msg, size_t* size) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 6280 | 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 Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 6281 | upb_Array* arr = upb_Message_GetMutableArray(UPB_UPCAST(msg), &field); |
Eric Salo | b7d54ac | 2022-12-29 11:59:42 -0800 | [diff] [blame] | 6282 | if (arr) { |
Protobuf Team Bot | f73985a | 2023-12-19 00:14:19 +0000 | [diff] [blame] | 6283 | if (size) *size = arr->UPB_PRIVATE(size); |
Protobuf Team Bot | 81e5433 | 2024-01-11 21:04:07 +0000 | [diff] [blame] | 6284 | return (int32_t*)upb_Array_MutableDataPtr(arr); |
Eric Salo | b7d54ac | 2022-12-29 11:59:42 -0800 | [diff] [blame] | 6285 | } else { |
| 6286 | if (size) *size = 0; |
| 6287 | return NULL; |
| 6288 | } |
Joshua Haberman | 9abf6e2 | 2021-01-13 12:16:25 -0800 | [diff] [blame] | 6289 | } |
Eric Salo | b7d54ac | 2022-12-29 11:59:42 -0800 | [diff] [blame] | 6290 | UPB_INLINE int32_t* google_protobuf_FileDescriptorProto_resize_weak_dependency(google_protobuf_FileDescriptorProto* msg, size_t size, upb_Arena* arena) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 6291 | 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 Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 6292 | return (int32_t*)upb_Message_ResizeArrayUninitialized(UPB_UPCAST(msg), |
| 6293 | &field, size, arena); |
Joshua Haberman | 9abf6e2 | 2021-01-13 12:16:25 -0800 | [diff] [blame] | 6294 | } |
Joshua Haberman | 7ecf43f | 2022-03-14 13:11:29 -0700 | [diff] [blame] | 6295 | UPB_INLINE bool google_protobuf_FileDescriptorProto_add_weak_dependency(google_protobuf_FileDescriptorProto* msg, int32_t val, upb_Arena* arena) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 6296 | 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 Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 6297 | upb_Array* arr = upb_Message_GetOrCreateMutableArray( |
| 6298 | UPB_UPCAST(msg), &field, arena); |
Protobuf Team Bot | 81e5433 | 2024-01-11 21:04:07 +0000 | [diff] [blame] | 6299 | if (!arr || !UPB_PRIVATE(_upb_Array_ResizeUninitialized)( |
Protobuf Team Bot | f73985a | 2023-12-19 00:14:19 +0000 | [diff] [blame] | 6300 | arr, arr->UPB_PRIVATE(size) + 1, arena)) { |
Eric Salo | b7d54ac | 2022-12-29 11:59:42 -0800 | [diff] [blame] | 6301 | return false; |
| 6302 | } |
Protobuf Team Bot | f73985a | 2023-12-19 00:14:19 +0000 | [diff] [blame] | 6303 | UPB_PRIVATE(_upb_Array_Set) |
| 6304 | (arr, arr->UPB_PRIVATE(size) - 1, &val, sizeof(val)); |
Eric Salo | b7d54ac | 2022-12-29 11:59:42 -0800 | [diff] [blame] | 6305 | return true; |
Joshua Haberman | 9abf6e2 | 2021-01-13 12:16:25 -0800 | [diff] [blame] | 6306 | } |
Joshua Haberman | f41049a | 2022-01-21 14:41:25 -0800 | [diff] [blame] | 6307 | UPB_INLINE void google_protobuf_FileDescriptorProto_set_syntax(google_protobuf_FileDescriptorProto *msg, upb_StringView value) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 6308 | 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 Bot | ac32c97 | 2024-04-10 03:30:05 +0000 | [diff] [blame] | 6309 | upb_Message_SetBaseField((upb_Message *)msg, &field, &value); |
Mike Kruskal | 232ecf4 | 2023-01-14 00:09:40 -0800 | [diff] [blame] | 6310 | } |
Protobuf Team Bot | ab58f8f | 2023-09-26 16:14:19 +0000 | [diff] [blame] | 6311 | UPB_INLINE void google_protobuf_FileDescriptorProto_set_edition(google_protobuf_FileDescriptorProto *msg, int32_t value) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 6312 | 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 Bot | ac32c97 | 2024-04-10 03:30:05 +0000 | [diff] [blame] | 6313 | upb_Message_SetBaseField((upb_Message *)msg, &field, &value); |
Joshua Haberman | d3995ec | 2022-09-30 16:54:39 -0700 | [diff] [blame] | 6314 | } |
Mike Kruskal | 232ecf4 | 2023-01-14 00:09:40 -0800 | [diff] [blame] | 6315 | |
Joshua Haberman | 9abf6e2 | 2021-01-13 12:16:25 -0800 | [diff] [blame] | 6316 | /* google.protobuf.DescriptorProto */ |
| 6317 | |
Joshua Haberman | f41049a | 2022-01-21 14:41:25 -0800 | [diff] [blame] | 6318 | UPB_INLINE google_protobuf_DescriptorProto* google_protobuf_DescriptorProto_new(upb_Arena* arena) { |
Protobuf Team Bot | 4ffe086 | 2023-12-06 02:02:36 +0000 | [diff] [blame] | 6319 | return (google_protobuf_DescriptorProto*)_upb_Message_New(&google__protobuf__DescriptorProto_msg_init, arena); |
Joshua Haberman | 9abf6e2 | 2021-01-13 12:16:25 -0800 | [diff] [blame] | 6320 | } |
Joshua Haberman | f41049a | 2022-01-21 14:41:25 -0800 | [diff] [blame] | 6321 | UPB_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 Haberman | 9d578a3 | 2021-08-02 15:32:01 -0700 | [diff] [blame] | 6323 | if (!ret) return NULL; |
Protobuf Team Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 6324 | if (upb_Decode(buf, size, UPB_UPCAST(ret), &google__protobuf__DescriptorProto_msg_init, NULL, 0, arena) != |
| 6325 | kUpb_DecodeStatus_Ok) { |
Joshua Haberman | 9d578a3 | 2021-08-02 15:32:01 -0700 | [diff] [blame] | 6326 | return NULL; |
| 6327 | } |
| 6328 | return ret; |
Joshua Haberman | 9abf6e2 | 2021-01-13 12:16:25 -0800 | [diff] [blame] | 6329 | } |
Joshua Haberman | f41049a | 2022-01-21 14:41:25 -0800 | [diff] [blame] | 6330 | UPB_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 Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 6335 | if (upb_Decode(buf, size, UPB_UPCAST(ret), &google__protobuf__DescriptorProto_msg_init, extreg, options, |
| 6336 | arena) != kUpb_DecodeStatus_Ok) { |
Joshua Haberman | f41049a | 2022-01-21 14:41:25 -0800 | [diff] [blame] | 6337 | return NULL; |
| 6338 | } |
| 6339 | return ret; |
Joshua Haberman | 9abf6e2 | 2021-01-13 12:16:25 -0800 | [diff] [blame] | 6340 | } |
Joshua Haberman | f41049a | 2022-01-21 14:41:25 -0800 | [diff] [blame] | 6341 | UPB_INLINE char* google_protobuf_DescriptorProto_serialize(const google_protobuf_DescriptorProto* msg, upb_Arena* arena, size_t* len) { |
Joshua Haberman | d3995ec | 2022-09-30 16:54:39 -0700 | [diff] [blame] | 6342 | char* ptr; |
Protobuf Team Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 6343 | (void)upb_Encode(UPB_UPCAST(msg), &google__protobuf__DescriptorProto_msg_init, 0, arena, &ptr, len); |
Joshua Haberman | d3995ec | 2022-09-30 16:54:39 -0700 | [diff] [blame] | 6344 | return ptr; |
Joshua Haberman | f41049a | 2022-01-21 14:41:25 -0800 | [diff] [blame] | 6345 | } |
| 6346 | UPB_INLINE char* google_protobuf_DescriptorProto_serialize_ex(const google_protobuf_DescriptorProto* msg, int options, |
| 6347 | upb_Arena* arena, size_t* len) { |
Joshua Haberman | d3995ec | 2022-09-30 16:54:39 -0700 | [diff] [blame] | 6348 | char* ptr; |
Protobuf Team Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 6349 | (void)upb_Encode(UPB_UPCAST(msg), &google__protobuf__DescriptorProto_msg_init, options, arena, &ptr, len); |
Joshua Haberman | d3995ec | 2022-09-30 16:54:39 -0700 | [diff] [blame] | 6350 | return ptr; |
Joshua Haberman | f41049a | 2022-01-21 14:41:25 -0800 | [diff] [blame] | 6351 | } |
Mike Kruskal | 3bc5049 | 2022-12-01 13:34:12 -0800 | [diff] [blame] | 6352 | UPB_INLINE void google_protobuf_DescriptorProto_clear_name(google_protobuf_DescriptorProto* msg) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 6353 | 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 Bot | 4e90ead | 2024-01-08 15:46:34 +0000 | [diff] [blame] | 6354 | upb_Message_ClearBaseField(UPB_UPCAST(msg), &field); |
Joshua Haberman | d3995ec | 2022-09-30 16:54:39 -0700 | [diff] [blame] | 6355 | } |
Joshua Haberman | f41049a | 2022-01-21 14:41:25 -0800 | [diff] [blame] | 6356 | UPB_INLINE upb_StringView google_protobuf_DescriptorProto_name(const google_protobuf_DescriptorProto* msg) { |
Eric Salo | 8809a11 | 2022-11-21 13:01:06 -0800 | [diff] [blame] | 6357 | upb_StringView default_val = upb_StringView_FromString(""); |
| 6358 | upb_StringView ret; |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 6359 | 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 Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 6360 | _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field, |
| 6361 | &default_val, &ret); |
Eric Salo | 8809a11 | 2022-11-21 13:01:06 -0800 | [diff] [blame] | 6362 | return ret; |
Joshua Haberman | f41049a | 2022-01-21 14:41:25 -0800 | [diff] [blame] | 6363 | } |
Mike Kruskal | 3bc5049 | 2022-12-01 13:34:12 -0800 | [diff] [blame] | 6364 | UPB_INLINE bool google_protobuf_DescriptorProto_has_name(const google_protobuf_DescriptorProto* msg) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 6365 | 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 Bot | 8c1f635 | 2024-01-10 05:18:15 +0000 | [diff] [blame] | 6366 | return upb_Message_HasBaseField(UPB_UPCAST(msg), &field); |
Joshua Haberman | d3995ec | 2022-09-30 16:54:39 -0700 | [diff] [blame] | 6367 | } |
Mike Kruskal | 3bc5049 | 2022-12-01 13:34:12 -0800 | [diff] [blame] | 6368 | UPB_INLINE void google_protobuf_DescriptorProto_clear_field(google_protobuf_DescriptorProto* msg) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 6369 | 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 Bot | 4e90ead | 2024-01-08 15:46:34 +0000 | [diff] [blame] | 6370 | upb_Message_ClearBaseField(UPB_UPCAST(msg), &field); |
Joshua Haberman | 7ecf43f | 2022-03-14 13:11:29 -0700 | [diff] [blame] | 6371 | } |
Eric Salo | b7d54ac | 2022-12-29 11:59:42 -0800 | [diff] [blame] | 6372 | UPB_INLINE const google_protobuf_FieldDescriptorProto* const* google_protobuf_DescriptorProto_field(const google_protobuf_DescriptorProto* msg, size_t* size) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 6373 | 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 Bot | a9387b5 | 2024-06-12 15:17:52 +0000 | [diff] [blame] | 6374 | UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__FieldDescriptorProto_msg_init); |
Protobuf Team Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 6375 | const upb_Array* arr = upb_Message_GetArray(UPB_UPCAST(msg), &field); |
Eric Salo | b7d54ac | 2022-12-29 11:59:42 -0800 | [diff] [blame] | 6376 | if (arr) { |
Protobuf Team Bot | f73985a | 2023-12-19 00:14:19 +0000 | [diff] [blame] | 6377 | if (size) *size = arr->UPB_PRIVATE(size); |
Protobuf Team Bot | 81e5433 | 2024-01-11 21:04:07 +0000 | [diff] [blame] | 6378 | return (const google_protobuf_FieldDescriptorProto* const*)upb_Array_DataPtr(arr); |
Eric Salo | b7d54ac | 2022-12-29 11:59:42 -0800 | [diff] [blame] | 6379 | } else { |
| 6380 | if (size) *size = 0; |
| 6381 | return NULL; |
| 6382 | } |
Joshua Haberman | 7ecf43f | 2022-03-14 13:11:29 -0700 | [diff] [blame] | 6383 | } |
Deanna Garcia | b26afb5 | 2023-04-25 13:37:18 -0700 | [diff] [blame] | 6384 | UPB_INLINE const upb_Array* _google_protobuf_DescriptorProto_field_upb_array(const google_protobuf_DescriptorProto* msg, size_t* size) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 6385 | 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 Bot | a9387b5 | 2024-06-12 15:17:52 +0000 | [diff] [blame] | 6386 | UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__FieldDescriptorProto_msg_init); |
Protobuf Team Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 6387 | const upb_Array* arr = upb_Message_GetArray(UPB_UPCAST(msg), &field); |
Deanna Garcia | b26afb5 | 2023-04-25 13:37:18 -0700 | [diff] [blame] | 6388 | if (size) { |
Protobuf Team Bot | f73985a | 2023-12-19 00:14:19 +0000 | [diff] [blame] | 6389 | *size = arr ? arr->UPB_PRIVATE(size) : 0; |
Deanna Garcia | b26afb5 | 2023-04-25 13:37:18 -0700 | [diff] [blame] | 6390 | } |
| 6391 | return arr; |
| 6392 | } |
Protobuf Team Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 6393 | UPB_INLINE upb_Array* _google_protobuf_DescriptorProto_field_mutable_upb_array(google_protobuf_DescriptorProto* msg, size_t* size, upb_Arena* arena) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 6394 | 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 Bot | a9387b5 | 2024-06-12 15:17:52 +0000 | [diff] [blame] | 6395 | UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__FieldDescriptorProto_msg_init); |
Protobuf Team Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 6396 | upb_Array* arr = upb_Message_GetOrCreateMutableArray(UPB_UPCAST(msg), |
| 6397 | &field, arena); |
Deanna Garcia | b26afb5 | 2023-04-25 13:37:18 -0700 | [diff] [blame] | 6398 | if (size) { |
Protobuf Team Bot | f73985a | 2023-12-19 00:14:19 +0000 | [diff] [blame] | 6399 | *size = arr ? arr->UPB_PRIVATE(size) : 0; |
Deanna Garcia | b26afb5 | 2023-04-25 13:37:18 -0700 | [diff] [blame] | 6400 | } |
| 6401 | return arr; |
| 6402 | } |
Mike Kruskal | 3bc5049 | 2022-12-01 13:34:12 -0800 | [diff] [blame] | 6403 | UPB_INLINE void google_protobuf_DescriptorProto_clear_nested_type(google_protobuf_DescriptorProto* msg) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 6404 | 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 Bot | 4e90ead | 2024-01-08 15:46:34 +0000 | [diff] [blame] | 6405 | upb_Message_ClearBaseField(UPB_UPCAST(msg), &field); |
Joshua Haberman | 7ecf43f | 2022-03-14 13:11:29 -0700 | [diff] [blame] | 6406 | } |
Eric Salo | b7d54ac | 2022-12-29 11:59:42 -0800 | [diff] [blame] | 6407 | UPB_INLINE const google_protobuf_DescriptorProto* const* google_protobuf_DescriptorProto_nested_type(const google_protobuf_DescriptorProto* msg, size_t* size) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 6408 | 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 Bot | a9387b5 | 2024-06-12 15:17:52 +0000 | [diff] [blame] | 6409 | UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__DescriptorProto_msg_init); |
Protobuf Team Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 6410 | const upb_Array* arr = upb_Message_GetArray(UPB_UPCAST(msg), &field); |
Eric Salo | b7d54ac | 2022-12-29 11:59:42 -0800 | [diff] [blame] | 6411 | if (arr) { |
Protobuf Team Bot | f73985a | 2023-12-19 00:14:19 +0000 | [diff] [blame] | 6412 | if (size) *size = arr->UPB_PRIVATE(size); |
Protobuf Team Bot | 81e5433 | 2024-01-11 21:04:07 +0000 | [diff] [blame] | 6413 | return (const google_protobuf_DescriptorProto* const*)upb_Array_DataPtr(arr); |
Eric Salo | b7d54ac | 2022-12-29 11:59:42 -0800 | [diff] [blame] | 6414 | } else { |
| 6415 | if (size) *size = 0; |
| 6416 | return NULL; |
| 6417 | } |
Joshua Haberman | 7ecf43f | 2022-03-14 13:11:29 -0700 | [diff] [blame] | 6418 | } |
Deanna Garcia | b26afb5 | 2023-04-25 13:37:18 -0700 | [diff] [blame] | 6419 | UPB_INLINE const upb_Array* _google_protobuf_DescriptorProto_nested_type_upb_array(const google_protobuf_DescriptorProto* msg, size_t* size) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 6420 | 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 Bot | a9387b5 | 2024-06-12 15:17:52 +0000 | [diff] [blame] | 6421 | UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__DescriptorProto_msg_init); |
Protobuf Team Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 6422 | const upb_Array* arr = upb_Message_GetArray(UPB_UPCAST(msg), &field); |
Deanna Garcia | b26afb5 | 2023-04-25 13:37:18 -0700 | [diff] [blame] | 6423 | if (size) { |
Protobuf Team Bot | f73985a | 2023-12-19 00:14:19 +0000 | [diff] [blame] | 6424 | *size = arr ? arr->UPB_PRIVATE(size) : 0; |
Deanna Garcia | b26afb5 | 2023-04-25 13:37:18 -0700 | [diff] [blame] | 6425 | } |
| 6426 | return arr; |
| 6427 | } |
Protobuf Team Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 6428 | UPB_INLINE upb_Array* _google_protobuf_DescriptorProto_nested_type_mutable_upb_array(google_protobuf_DescriptorProto* msg, size_t* size, upb_Arena* arena) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 6429 | 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 Bot | a9387b5 | 2024-06-12 15:17:52 +0000 | [diff] [blame] | 6430 | UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__DescriptorProto_msg_init); |
Protobuf Team Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 6431 | upb_Array* arr = upb_Message_GetOrCreateMutableArray(UPB_UPCAST(msg), |
| 6432 | &field, arena); |
Deanna Garcia | b26afb5 | 2023-04-25 13:37:18 -0700 | [diff] [blame] | 6433 | if (size) { |
Protobuf Team Bot | f73985a | 2023-12-19 00:14:19 +0000 | [diff] [blame] | 6434 | *size = arr ? arr->UPB_PRIVATE(size) : 0; |
Deanna Garcia | b26afb5 | 2023-04-25 13:37:18 -0700 | [diff] [blame] | 6435 | } |
| 6436 | return arr; |
| 6437 | } |
Mike Kruskal | 3bc5049 | 2022-12-01 13:34:12 -0800 | [diff] [blame] | 6438 | UPB_INLINE void google_protobuf_DescriptorProto_clear_enum_type(google_protobuf_DescriptorProto* msg) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 6439 | 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 Bot | 4e90ead | 2024-01-08 15:46:34 +0000 | [diff] [blame] | 6440 | upb_Message_ClearBaseField(UPB_UPCAST(msg), &field); |
Joshua Haberman | 7ecf43f | 2022-03-14 13:11:29 -0700 | [diff] [blame] | 6441 | } |
Eric Salo | b7d54ac | 2022-12-29 11:59:42 -0800 | [diff] [blame] | 6442 | UPB_INLINE const google_protobuf_EnumDescriptorProto* const* google_protobuf_DescriptorProto_enum_type(const google_protobuf_DescriptorProto* msg, size_t* size) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 6443 | 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 Bot | a9387b5 | 2024-06-12 15:17:52 +0000 | [diff] [blame] | 6444 | UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__EnumDescriptorProto_msg_init); |
Protobuf Team Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 6445 | const upb_Array* arr = upb_Message_GetArray(UPB_UPCAST(msg), &field); |
Eric Salo | b7d54ac | 2022-12-29 11:59:42 -0800 | [diff] [blame] | 6446 | if (arr) { |
Protobuf Team Bot | f73985a | 2023-12-19 00:14:19 +0000 | [diff] [blame] | 6447 | if (size) *size = arr->UPB_PRIVATE(size); |
Protobuf Team Bot | 81e5433 | 2024-01-11 21:04:07 +0000 | [diff] [blame] | 6448 | return (const google_protobuf_EnumDescriptorProto* const*)upb_Array_DataPtr(arr); |
Eric Salo | b7d54ac | 2022-12-29 11:59:42 -0800 | [diff] [blame] | 6449 | } else { |
| 6450 | if (size) *size = 0; |
| 6451 | return NULL; |
| 6452 | } |
Joshua Haberman | 7ecf43f | 2022-03-14 13:11:29 -0700 | [diff] [blame] | 6453 | } |
Deanna Garcia | b26afb5 | 2023-04-25 13:37:18 -0700 | [diff] [blame] | 6454 | UPB_INLINE const upb_Array* _google_protobuf_DescriptorProto_enum_type_upb_array(const google_protobuf_DescriptorProto* msg, size_t* size) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 6455 | 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 Bot | a9387b5 | 2024-06-12 15:17:52 +0000 | [diff] [blame] | 6456 | UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__EnumDescriptorProto_msg_init); |
Protobuf Team Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 6457 | const upb_Array* arr = upb_Message_GetArray(UPB_UPCAST(msg), &field); |
Deanna Garcia | b26afb5 | 2023-04-25 13:37:18 -0700 | [diff] [blame] | 6458 | if (size) { |
Protobuf Team Bot | f73985a | 2023-12-19 00:14:19 +0000 | [diff] [blame] | 6459 | *size = arr ? arr->UPB_PRIVATE(size) : 0; |
Deanna Garcia | b26afb5 | 2023-04-25 13:37:18 -0700 | [diff] [blame] | 6460 | } |
| 6461 | return arr; |
| 6462 | } |
Protobuf Team Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 6463 | UPB_INLINE upb_Array* _google_protobuf_DescriptorProto_enum_type_mutable_upb_array(google_protobuf_DescriptorProto* msg, size_t* size, upb_Arena* arena) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 6464 | 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 Bot | a9387b5 | 2024-06-12 15:17:52 +0000 | [diff] [blame] | 6465 | UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__EnumDescriptorProto_msg_init); |
Protobuf Team Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 6466 | upb_Array* arr = upb_Message_GetOrCreateMutableArray(UPB_UPCAST(msg), |
| 6467 | &field, arena); |
Deanna Garcia | b26afb5 | 2023-04-25 13:37:18 -0700 | [diff] [blame] | 6468 | if (size) { |
Protobuf Team Bot | f73985a | 2023-12-19 00:14:19 +0000 | [diff] [blame] | 6469 | *size = arr ? arr->UPB_PRIVATE(size) : 0; |
Deanna Garcia | b26afb5 | 2023-04-25 13:37:18 -0700 | [diff] [blame] | 6470 | } |
| 6471 | return arr; |
| 6472 | } |
Mike Kruskal | 3bc5049 | 2022-12-01 13:34:12 -0800 | [diff] [blame] | 6473 | UPB_INLINE void google_protobuf_DescriptorProto_clear_extension_range(google_protobuf_DescriptorProto* msg) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 6474 | 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 Bot | 4e90ead | 2024-01-08 15:46:34 +0000 | [diff] [blame] | 6475 | upb_Message_ClearBaseField(UPB_UPCAST(msg), &field); |
Joshua Haberman | 7ecf43f | 2022-03-14 13:11:29 -0700 | [diff] [blame] | 6476 | } |
Eric Salo | b7d54ac | 2022-12-29 11:59:42 -0800 | [diff] [blame] | 6477 | UPB_INLINE const google_protobuf_DescriptorProto_ExtensionRange* const* google_protobuf_DescriptorProto_extension_range(const google_protobuf_DescriptorProto* msg, size_t* size) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 6478 | 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 Bot | a9387b5 | 2024-06-12 15:17:52 +0000 | [diff] [blame] | 6479 | UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__DescriptorProto__ExtensionRange_msg_init); |
Protobuf Team Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 6480 | const upb_Array* arr = upb_Message_GetArray(UPB_UPCAST(msg), &field); |
Eric Salo | b7d54ac | 2022-12-29 11:59:42 -0800 | [diff] [blame] | 6481 | if (arr) { |
Protobuf Team Bot | f73985a | 2023-12-19 00:14:19 +0000 | [diff] [blame] | 6482 | if (size) *size = arr->UPB_PRIVATE(size); |
Protobuf Team Bot | 81e5433 | 2024-01-11 21:04:07 +0000 | [diff] [blame] | 6483 | return (const google_protobuf_DescriptorProto_ExtensionRange* const*)upb_Array_DataPtr(arr); |
Eric Salo | b7d54ac | 2022-12-29 11:59:42 -0800 | [diff] [blame] | 6484 | } else { |
| 6485 | if (size) *size = 0; |
| 6486 | return NULL; |
| 6487 | } |
Joshua Haberman | 7ecf43f | 2022-03-14 13:11:29 -0700 | [diff] [blame] | 6488 | } |
Deanna Garcia | b26afb5 | 2023-04-25 13:37:18 -0700 | [diff] [blame] | 6489 | UPB_INLINE const upb_Array* _google_protobuf_DescriptorProto_extension_range_upb_array(const google_protobuf_DescriptorProto* msg, size_t* size) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 6490 | 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 Bot | a9387b5 | 2024-06-12 15:17:52 +0000 | [diff] [blame] | 6491 | UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__DescriptorProto__ExtensionRange_msg_init); |
Protobuf Team Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 6492 | const upb_Array* arr = upb_Message_GetArray(UPB_UPCAST(msg), &field); |
Deanna Garcia | b26afb5 | 2023-04-25 13:37:18 -0700 | [diff] [blame] | 6493 | if (size) { |
Protobuf Team Bot | f73985a | 2023-12-19 00:14:19 +0000 | [diff] [blame] | 6494 | *size = arr ? arr->UPB_PRIVATE(size) : 0; |
Deanna Garcia | b26afb5 | 2023-04-25 13:37:18 -0700 | [diff] [blame] | 6495 | } |
| 6496 | return arr; |
| 6497 | } |
Protobuf Team Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 6498 | UPB_INLINE upb_Array* _google_protobuf_DescriptorProto_extension_range_mutable_upb_array(google_protobuf_DescriptorProto* msg, size_t* size, upb_Arena* arena) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 6499 | 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 Bot | a9387b5 | 2024-06-12 15:17:52 +0000 | [diff] [blame] | 6500 | UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__DescriptorProto__ExtensionRange_msg_init); |
Protobuf Team Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 6501 | upb_Array* arr = upb_Message_GetOrCreateMutableArray(UPB_UPCAST(msg), |
| 6502 | &field, arena); |
Deanna Garcia | b26afb5 | 2023-04-25 13:37:18 -0700 | [diff] [blame] | 6503 | if (size) { |
Protobuf Team Bot | f73985a | 2023-12-19 00:14:19 +0000 | [diff] [blame] | 6504 | *size = arr ? arr->UPB_PRIVATE(size) : 0; |
Deanna Garcia | b26afb5 | 2023-04-25 13:37:18 -0700 | [diff] [blame] | 6505 | } |
| 6506 | return arr; |
| 6507 | } |
Mike Kruskal | 3bc5049 | 2022-12-01 13:34:12 -0800 | [diff] [blame] | 6508 | UPB_INLINE void google_protobuf_DescriptorProto_clear_extension(google_protobuf_DescriptorProto* msg) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 6509 | 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 Bot | 4e90ead | 2024-01-08 15:46:34 +0000 | [diff] [blame] | 6510 | upb_Message_ClearBaseField(UPB_UPCAST(msg), &field); |
Joshua Haberman | 7ecf43f | 2022-03-14 13:11:29 -0700 | [diff] [blame] | 6511 | } |
Eric Salo | b7d54ac | 2022-12-29 11:59:42 -0800 | [diff] [blame] | 6512 | UPB_INLINE const google_protobuf_FieldDescriptorProto* const* google_protobuf_DescriptorProto_extension(const google_protobuf_DescriptorProto* msg, size_t* size) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 6513 | 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 Bot | a9387b5 | 2024-06-12 15:17:52 +0000 | [diff] [blame] | 6514 | UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__FieldDescriptorProto_msg_init); |
Protobuf Team Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 6515 | const upb_Array* arr = upb_Message_GetArray(UPB_UPCAST(msg), &field); |
Eric Salo | b7d54ac | 2022-12-29 11:59:42 -0800 | [diff] [blame] | 6516 | if (arr) { |
Protobuf Team Bot | f73985a | 2023-12-19 00:14:19 +0000 | [diff] [blame] | 6517 | if (size) *size = arr->UPB_PRIVATE(size); |
Protobuf Team Bot | 81e5433 | 2024-01-11 21:04:07 +0000 | [diff] [blame] | 6518 | return (const google_protobuf_FieldDescriptorProto* const*)upb_Array_DataPtr(arr); |
Eric Salo | b7d54ac | 2022-12-29 11:59:42 -0800 | [diff] [blame] | 6519 | } else { |
| 6520 | if (size) *size = 0; |
| 6521 | return NULL; |
| 6522 | } |
Joshua Haberman | 7ecf43f | 2022-03-14 13:11:29 -0700 | [diff] [blame] | 6523 | } |
Deanna Garcia | b26afb5 | 2023-04-25 13:37:18 -0700 | [diff] [blame] | 6524 | UPB_INLINE const upb_Array* _google_protobuf_DescriptorProto_extension_upb_array(const google_protobuf_DescriptorProto* msg, size_t* size) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 6525 | 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 Bot | a9387b5 | 2024-06-12 15:17:52 +0000 | [diff] [blame] | 6526 | UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__FieldDescriptorProto_msg_init); |
Protobuf Team Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 6527 | const upb_Array* arr = upb_Message_GetArray(UPB_UPCAST(msg), &field); |
Deanna Garcia | b26afb5 | 2023-04-25 13:37:18 -0700 | [diff] [blame] | 6528 | if (size) { |
Protobuf Team Bot | f73985a | 2023-12-19 00:14:19 +0000 | [diff] [blame] | 6529 | *size = arr ? arr->UPB_PRIVATE(size) : 0; |
Deanna Garcia | b26afb5 | 2023-04-25 13:37:18 -0700 | [diff] [blame] | 6530 | } |
| 6531 | return arr; |
| 6532 | } |
Protobuf Team Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 6533 | UPB_INLINE upb_Array* _google_protobuf_DescriptorProto_extension_mutable_upb_array(google_protobuf_DescriptorProto* msg, size_t* size, upb_Arena* arena) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 6534 | 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 Bot | a9387b5 | 2024-06-12 15:17:52 +0000 | [diff] [blame] | 6535 | UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__FieldDescriptorProto_msg_init); |
Protobuf Team Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 6536 | upb_Array* arr = upb_Message_GetOrCreateMutableArray(UPB_UPCAST(msg), |
| 6537 | &field, arena); |
Deanna Garcia | b26afb5 | 2023-04-25 13:37:18 -0700 | [diff] [blame] | 6538 | if (size) { |
Protobuf Team Bot | f73985a | 2023-12-19 00:14:19 +0000 | [diff] [blame] | 6539 | *size = arr ? arr->UPB_PRIVATE(size) : 0; |
Deanna Garcia | b26afb5 | 2023-04-25 13:37:18 -0700 | [diff] [blame] | 6540 | } |
| 6541 | return arr; |
| 6542 | } |
Mike Kruskal | 3bc5049 | 2022-12-01 13:34:12 -0800 | [diff] [blame] | 6543 | UPB_INLINE void google_protobuf_DescriptorProto_clear_options(google_protobuf_DescriptorProto* msg) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 6544 | 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 Bot | 4e90ead | 2024-01-08 15:46:34 +0000 | [diff] [blame] | 6545 | upb_Message_ClearBaseField(UPB_UPCAST(msg), &field); |
Joshua Haberman | d3995ec | 2022-09-30 16:54:39 -0700 | [diff] [blame] | 6546 | } |
Joshua Haberman | f41049a | 2022-01-21 14:41:25 -0800 | [diff] [blame] | 6547 | UPB_INLINE const google_protobuf_MessageOptions* google_protobuf_DescriptorProto_options(const google_protobuf_DescriptorProto* msg) { |
Eric Salo | 8809a11 | 2022-11-21 13:01:06 -0800 | [diff] [blame] | 6548 | const google_protobuf_MessageOptions* default_val = NULL; |
| 6549 | const google_protobuf_MessageOptions* ret; |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 6550 | 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 Bot | a9387b5 | 2024-06-12 15:17:52 +0000 | [diff] [blame] | 6551 | UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__MessageOptions_msg_init); |
Protobuf Team Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 6552 | _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field, |
| 6553 | &default_val, &ret); |
Eric Salo | 8809a11 | 2022-11-21 13:01:06 -0800 | [diff] [blame] | 6554 | return ret; |
Joshua Haberman | f41049a | 2022-01-21 14:41:25 -0800 | [diff] [blame] | 6555 | } |
Mike Kruskal | 3bc5049 | 2022-12-01 13:34:12 -0800 | [diff] [blame] | 6556 | UPB_INLINE bool google_protobuf_DescriptorProto_has_options(const google_protobuf_DescriptorProto* msg) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 6557 | 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 Bot | 8c1f635 | 2024-01-10 05:18:15 +0000 | [diff] [blame] | 6558 | return upb_Message_HasBaseField(UPB_UPCAST(msg), &field); |
Joshua Haberman | 7ecf43f | 2022-03-14 13:11:29 -0700 | [diff] [blame] | 6559 | } |
Mike Kruskal | 3bc5049 | 2022-12-01 13:34:12 -0800 | [diff] [blame] | 6560 | UPB_INLINE void google_protobuf_DescriptorProto_clear_oneof_decl(google_protobuf_DescriptorProto* msg) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 6561 | 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 Bot | 4e90ead | 2024-01-08 15:46:34 +0000 | [diff] [blame] | 6562 | upb_Message_ClearBaseField(UPB_UPCAST(msg), &field); |
Joshua Haberman | d3995ec | 2022-09-30 16:54:39 -0700 | [diff] [blame] | 6563 | } |
Eric Salo | b7d54ac | 2022-12-29 11:59:42 -0800 | [diff] [blame] | 6564 | UPB_INLINE const google_protobuf_OneofDescriptorProto* const* google_protobuf_DescriptorProto_oneof_decl(const google_protobuf_DescriptorProto* msg, size_t* size) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 6565 | 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 Bot | a9387b5 | 2024-06-12 15:17:52 +0000 | [diff] [blame] | 6566 | UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__OneofDescriptorProto_msg_init); |
Protobuf Team Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 6567 | const upb_Array* arr = upb_Message_GetArray(UPB_UPCAST(msg), &field); |
Eric Salo | b7d54ac | 2022-12-29 11:59:42 -0800 | [diff] [blame] | 6568 | if (arr) { |
Protobuf Team Bot | f73985a | 2023-12-19 00:14:19 +0000 | [diff] [blame] | 6569 | if (size) *size = arr->UPB_PRIVATE(size); |
Protobuf Team Bot | 81e5433 | 2024-01-11 21:04:07 +0000 | [diff] [blame] | 6570 | return (const google_protobuf_OneofDescriptorProto* const*)upb_Array_DataPtr(arr); |
Eric Salo | b7d54ac | 2022-12-29 11:59:42 -0800 | [diff] [blame] | 6571 | } else { |
| 6572 | if (size) *size = 0; |
| 6573 | return NULL; |
| 6574 | } |
Joshua Haberman | 7ecf43f | 2022-03-14 13:11:29 -0700 | [diff] [blame] | 6575 | } |
Deanna Garcia | b26afb5 | 2023-04-25 13:37:18 -0700 | [diff] [blame] | 6576 | UPB_INLINE const upb_Array* _google_protobuf_DescriptorProto_oneof_decl_upb_array(const google_protobuf_DescriptorProto* msg, size_t* size) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 6577 | 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 Bot | a9387b5 | 2024-06-12 15:17:52 +0000 | [diff] [blame] | 6578 | UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__OneofDescriptorProto_msg_init); |
Protobuf Team Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 6579 | const upb_Array* arr = upb_Message_GetArray(UPB_UPCAST(msg), &field); |
Deanna Garcia | b26afb5 | 2023-04-25 13:37:18 -0700 | [diff] [blame] | 6580 | if (size) { |
Protobuf Team Bot | f73985a | 2023-12-19 00:14:19 +0000 | [diff] [blame] | 6581 | *size = arr ? arr->UPB_PRIVATE(size) : 0; |
Deanna Garcia | b26afb5 | 2023-04-25 13:37:18 -0700 | [diff] [blame] | 6582 | } |
| 6583 | return arr; |
| 6584 | } |
Protobuf Team Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 6585 | UPB_INLINE upb_Array* _google_protobuf_DescriptorProto_oneof_decl_mutable_upb_array(google_protobuf_DescriptorProto* msg, size_t* size, upb_Arena* arena) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 6586 | 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 Bot | a9387b5 | 2024-06-12 15:17:52 +0000 | [diff] [blame] | 6587 | UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__OneofDescriptorProto_msg_init); |
Protobuf Team Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 6588 | upb_Array* arr = upb_Message_GetOrCreateMutableArray(UPB_UPCAST(msg), |
| 6589 | &field, arena); |
Deanna Garcia | b26afb5 | 2023-04-25 13:37:18 -0700 | [diff] [blame] | 6590 | if (size) { |
Protobuf Team Bot | f73985a | 2023-12-19 00:14:19 +0000 | [diff] [blame] | 6591 | *size = arr ? arr->UPB_PRIVATE(size) : 0; |
Deanna Garcia | b26afb5 | 2023-04-25 13:37:18 -0700 | [diff] [blame] | 6592 | } |
| 6593 | return arr; |
| 6594 | } |
Mike Kruskal | 3bc5049 | 2022-12-01 13:34:12 -0800 | [diff] [blame] | 6595 | UPB_INLINE void google_protobuf_DescriptorProto_clear_reserved_range(google_protobuf_DescriptorProto* msg) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 6596 | 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 Bot | 4e90ead | 2024-01-08 15:46:34 +0000 | [diff] [blame] | 6597 | upb_Message_ClearBaseField(UPB_UPCAST(msg), &field); |
Joshua Haberman | d3995ec | 2022-09-30 16:54:39 -0700 | [diff] [blame] | 6598 | } |
Eric Salo | b7d54ac | 2022-12-29 11:59:42 -0800 | [diff] [blame] | 6599 | UPB_INLINE const google_protobuf_DescriptorProto_ReservedRange* const* google_protobuf_DescriptorProto_reserved_range(const google_protobuf_DescriptorProto* msg, size_t* size) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 6600 | 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 Bot | a9387b5 | 2024-06-12 15:17:52 +0000 | [diff] [blame] | 6601 | UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__DescriptorProto__ReservedRange_msg_init); |
Protobuf Team Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 6602 | const upb_Array* arr = upb_Message_GetArray(UPB_UPCAST(msg), &field); |
Eric Salo | b7d54ac | 2022-12-29 11:59:42 -0800 | [diff] [blame] | 6603 | if (arr) { |
Protobuf Team Bot | f73985a | 2023-12-19 00:14:19 +0000 | [diff] [blame] | 6604 | if (size) *size = arr->UPB_PRIVATE(size); |
Protobuf Team Bot | 81e5433 | 2024-01-11 21:04:07 +0000 | [diff] [blame] | 6605 | return (const google_protobuf_DescriptorProto_ReservedRange* const*)upb_Array_DataPtr(arr); |
Eric Salo | b7d54ac | 2022-12-29 11:59:42 -0800 | [diff] [blame] | 6606 | } else { |
| 6607 | if (size) *size = 0; |
| 6608 | return NULL; |
| 6609 | } |
Joshua Haberman | 7ecf43f | 2022-03-14 13:11:29 -0700 | [diff] [blame] | 6610 | } |
Deanna Garcia | b26afb5 | 2023-04-25 13:37:18 -0700 | [diff] [blame] | 6611 | UPB_INLINE const upb_Array* _google_protobuf_DescriptorProto_reserved_range_upb_array(const google_protobuf_DescriptorProto* msg, size_t* size) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 6612 | 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 Bot | a9387b5 | 2024-06-12 15:17:52 +0000 | [diff] [blame] | 6613 | UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__DescriptorProto__ReservedRange_msg_init); |
Protobuf Team Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 6614 | const upb_Array* arr = upb_Message_GetArray(UPB_UPCAST(msg), &field); |
Deanna Garcia | b26afb5 | 2023-04-25 13:37:18 -0700 | [diff] [blame] | 6615 | if (size) { |
Protobuf Team Bot | f73985a | 2023-12-19 00:14:19 +0000 | [diff] [blame] | 6616 | *size = arr ? arr->UPB_PRIVATE(size) : 0; |
Deanna Garcia | b26afb5 | 2023-04-25 13:37:18 -0700 | [diff] [blame] | 6617 | } |
| 6618 | return arr; |
| 6619 | } |
Protobuf Team Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 6620 | UPB_INLINE upb_Array* _google_protobuf_DescriptorProto_reserved_range_mutable_upb_array(google_protobuf_DescriptorProto* msg, size_t* size, upb_Arena* arena) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 6621 | 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 Bot | a9387b5 | 2024-06-12 15:17:52 +0000 | [diff] [blame] | 6622 | UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__DescriptorProto__ReservedRange_msg_init); |
Protobuf Team Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 6623 | upb_Array* arr = upb_Message_GetOrCreateMutableArray(UPB_UPCAST(msg), |
| 6624 | &field, arena); |
Deanna Garcia | b26afb5 | 2023-04-25 13:37:18 -0700 | [diff] [blame] | 6625 | if (size) { |
Protobuf Team Bot | f73985a | 2023-12-19 00:14:19 +0000 | [diff] [blame] | 6626 | *size = arr ? arr->UPB_PRIVATE(size) : 0; |
Deanna Garcia | b26afb5 | 2023-04-25 13:37:18 -0700 | [diff] [blame] | 6627 | } |
| 6628 | return arr; |
| 6629 | } |
Mike Kruskal | 3bc5049 | 2022-12-01 13:34:12 -0800 | [diff] [blame] | 6630 | UPB_INLINE void google_protobuf_DescriptorProto_clear_reserved_name(google_protobuf_DescriptorProto* msg) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 6631 | 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 Bot | 4e90ead | 2024-01-08 15:46:34 +0000 | [diff] [blame] | 6632 | upb_Message_ClearBaseField(UPB_UPCAST(msg), &field); |
Joshua Haberman | d3995ec | 2022-09-30 16:54:39 -0700 | [diff] [blame] | 6633 | } |
Eric Salo | b7d54ac | 2022-12-29 11:59:42 -0800 | [diff] [blame] | 6634 | UPB_INLINE upb_StringView const* google_protobuf_DescriptorProto_reserved_name(const google_protobuf_DescriptorProto* msg, size_t* size) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 6635 | 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 Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 6636 | const upb_Array* arr = upb_Message_GetArray(UPB_UPCAST(msg), &field); |
Eric Salo | b7d54ac | 2022-12-29 11:59:42 -0800 | [diff] [blame] | 6637 | if (arr) { |
Protobuf Team Bot | f73985a | 2023-12-19 00:14:19 +0000 | [diff] [blame] | 6638 | if (size) *size = arr->UPB_PRIVATE(size); |
Protobuf Team Bot | 81e5433 | 2024-01-11 21:04:07 +0000 | [diff] [blame] | 6639 | return (upb_StringView const*)upb_Array_DataPtr(arr); |
Eric Salo | b7d54ac | 2022-12-29 11:59:42 -0800 | [diff] [blame] | 6640 | } else { |
| 6641 | if (size) *size = 0; |
| 6642 | return NULL; |
| 6643 | } |
Joshua Haberman | 7ecf43f | 2022-03-14 13:11:29 -0700 | [diff] [blame] | 6644 | } |
Deanna Garcia | b26afb5 | 2023-04-25 13:37:18 -0700 | [diff] [blame] | 6645 | UPB_INLINE const upb_Array* _google_protobuf_DescriptorProto_reserved_name_upb_array(const google_protobuf_DescriptorProto* msg, size_t* size) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 6646 | 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 Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 6647 | const upb_Array* arr = upb_Message_GetArray(UPB_UPCAST(msg), &field); |
Deanna Garcia | b26afb5 | 2023-04-25 13:37:18 -0700 | [diff] [blame] | 6648 | if (size) { |
Protobuf Team Bot | f73985a | 2023-12-19 00:14:19 +0000 | [diff] [blame] | 6649 | *size = arr ? arr->UPB_PRIVATE(size) : 0; |
Deanna Garcia | b26afb5 | 2023-04-25 13:37:18 -0700 | [diff] [blame] | 6650 | } |
| 6651 | return arr; |
| 6652 | } |
Protobuf Team Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 6653 | UPB_INLINE upb_Array* _google_protobuf_DescriptorProto_reserved_name_mutable_upb_array(google_protobuf_DescriptorProto* msg, size_t* size, upb_Arena* arena) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 6654 | 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 Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 6655 | upb_Array* arr = upb_Message_GetOrCreateMutableArray(UPB_UPCAST(msg), |
| 6656 | &field, arena); |
Deanna Garcia | b26afb5 | 2023-04-25 13:37:18 -0700 | [diff] [blame] | 6657 | if (size) { |
Protobuf Team Bot | f73985a | 2023-12-19 00:14:19 +0000 | [diff] [blame] | 6658 | *size = arr ? arr->UPB_PRIVATE(size) : 0; |
Deanna Garcia | b26afb5 | 2023-04-25 13:37:18 -0700 | [diff] [blame] | 6659 | } |
| 6660 | return arr; |
| 6661 | } |
Joshua Haberman | 9abf6e2 | 2021-01-13 12:16:25 -0800 | [diff] [blame] | 6662 | |
Joshua Haberman | f41049a | 2022-01-21 14:41:25 -0800 | [diff] [blame] | 6663 | UPB_INLINE void google_protobuf_DescriptorProto_set_name(google_protobuf_DescriptorProto *msg, upb_StringView value) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 6664 | 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 Bot | ac32c97 | 2024-04-10 03:30:05 +0000 | [diff] [blame] | 6665 | upb_Message_SetBaseField((upb_Message *)msg, &field, &value); |
Mike Kruskal | 232ecf4 | 2023-01-14 00:09:40 -0800 | [diff] [blame] | 6666 | } |
| 6667 | UPB_INLINE google_protobuf_FieldDescriptorProto** google_protobuf_DescriptorProto_mutable_field(google_protobuf_DescriptorProto* msg, size_t* size) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 6668 | 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 Bot | a9387b5 | 2024-06-12 15:17:52 +0000 | [diff] [blame] | 6669 | UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__FieldDescriptorProto_msg_init); |
Protobuf Team Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 6670 | upb_Array* arr = upb_Message_GetMutableArray(UPB_UPCAST(msg), &field); |
Eric Salo | b7d54ac | 2022-12-29 11:59:42 -0800 | [diff] [blame] | 6671 | if (arr) { |
Protobuf Team Bot | f73985a | 2023-12-19 00:14:19 +0000 | [diff] [blame] | 6672 | if (size) *size = arr->UPB_PRIVATE(size); |
Protobuf Team Bot | 81e5433 | 2024-01-11 21:04:07 +0000 | [diff] [blame] | 6673 | return (google_protobuf_FieldDescriptorProto**)upb_Array_MutableDataPtr(arr); |
Eric Salo | b7d54ac | 2022-12-29 11:59:42 -0800 | [diff] [blame] | 6674 | } else { |
| 6675 | if (size) *size = 0; |
| 6676 | return NULL; |
| 6677 | } |
Joshua Haberman | 9abf6e2 | 2021-01-13 12:16:25 -0800 | [diff] [blame] | 6678 | } |
Eric Salo | b7d54ac | 2022-12-29 11:59:42 -0800 | [diff] [blame] | 6679 | UPB_INLINE google_protobuf_FieldDescriptorProto** google_protobuf_DescriptorProto_resize_field(google_protobuf_DescriptorProto* msg, size_t size, upb_Arena* arena) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 6680 | 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 Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 6681 | return (google_protobuf_FieldDescriptorProto**)upb_Message_ResizeArrayUninitialized(UPB_UPCAST(msg), |
| 6682 | &field, size, arena); |
Joshua Haberman | 9abf6e2 | 2021-01-13 12:16:25 -0800 | [diff] [blame] | 6683 | } |
Joshua Haberman | 7ecf43f | 2022-03-14 13:11:29 -0700 | [diff] [blame] | 6684 | UPB_INLINE struct google_protobuf_FieldDescriptorProto* google_protobuf_DescriptorProto_add_field(google_protobuf_DescriptorProto* msg, upb_Arena* arena) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 6685 | 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 Bot | a9387b5 | 2024-06-12 15:17:52 +0000 | [diff] [blame] | 6686 | UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__FieldDescriptorProto_msg_init); |
Protobuf Team Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 6687 | upb_Array* arr = upb_Message_GetOrCreateMutableArray( |
| 6688 | UPB_UPCAST(msg), &field, arena); |
Protobuf Team Bot | 81e5433 | 2024-01-11 21:04:07 +0000 | [diff] [blame] | 6689 | if (!arr || !UPB_PRIVATE(_upb_Array_ResizeUninitialized)( |
Protobuf Team Bot | f73985a | 2023-12-19 00:14:19 +0000 | [diff] [blame] | 6690 | arr, arr->UPB_PRIVATE(size) + 1, arena)) { |
Eric Salo | b7d54ac | 2022-12-29 11:59:42 -0800 | [diff] [blame] | 6691 | return NULL; |
| 6692 | } |
Protobuf Team Bot | 4ffe086 | 2023-12-06 02:02:36 +0000 | [diff] [blame] | 6693 | struct google_protobuf_FieldDescriptorProto* sub = (struct google_protobuf_FieldDescriptorProto*)_upb_Message_New(&google__protobuf__FieldDescriptorProto_msg_init, arena); |
Eric Salo | b7d54ac | 2022-12-29 11:59:42 -0800 | [diff] [blame] | 6694 | if (!arr || !sub) return NULL; |
Protobuf Team Bot | f73985a | 2023-12-19 00:14:19 +0000 | [diff] [blame] | 6695 | UPB_PRIVATE(_upb_Array_Set) |
| 6696 | (arr, arr->UPB_PRIVATE(size) - 1, &sub, sizeof(sub)); |
Joshua Haberman | 9abf6e2 | 2021-01-13 12:16:25 -0800 | [diff] [blame] | 6697 | return sub; |
| 6698 | } |
Eric Salo | b7d54ac | 2022-12-29 11:59:42 -0800 | [diff] [blame] | 6699 | UPB_INLINE google_protobuf_DescriptorProto** google_protobuf_DescriptorProto_mutable_nested_type(google_protobuf_DescriptorProto* msg, size_t* size) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 6700 | 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 Bot | a9387b5 | 2024-06-12 15:17:52 +0000 | [diff] [blame] | 6701 | UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__DescriptorProto_msg_init); |
Protobuf Team Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 6702 | upb_Array* arr = upb_Message_GetMutableArray(UPB_UPCAST(msg), &field); |
Eric Salo | b7d54ac | 2022-12-29 11:59:42 -0800 | [diff] [blame] | 6703 | if (arr) { |
Protobuf Team Bot | f73985a | 2023-12-19 00:14:19 +0000 | [diff] [blame] | 6704 | if (size) *size = arr->UPB_PRIVATE(size); |
Protobuf Team Bot | 81e5433 | 2024-01-11 21:04:07 +0000 | [diff] [blame] | 6705 | return (google_protobuf_DescriptorProto**)upb_Array_MutableDataPtr(arr); |
Eric Salo | b7d54ac | 2022-12-29 11:59:42 -0800 | [diff] [blame] | 6706 | } else { |
| 6707 | if (size) *size = 0; |
| 6708 | return NULL; |
| 6709 | } |
Joshua Haberman | 9abf6e2 | 2021-01-13 12:16:25 -0800 | [diff] [blame] | 6710 | } |
Eric Salo | b7d54ac | 2022-12-29 11:59:42 -0800 | [diff] [blame] | 6711 | UPB_INLINE google_protobuf_DescriptorProto** google_protobuf_DescriptorProto_resize_nested_type(google_protobuf_DescriptorProto* msg, size_t size, upb_Arena* arena) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 6712 | 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 Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 6713 | return (google_protobuf_DescriptorProto**)upb_Message_ResizeArrayUninitialized(UPB_UPCAST(msg), |
| 6714 | &field, size, arena); |
Joshua Haberman | 9abf6e2 | 2021-01-13 12:16:25 -0800 | [diff] [blame] | 6715 | } |
Joshua Haberman | 7ecf43f | 2022-03-14 13:11:29 -0700 | [diff] [blame] | 6716 | UPB_INLINE struct google_protobuf_DescriptorProto* google_protobuf_DescriptorProto_add_nested_type(google_protobuf_DescriptorProto* msg, upb_Arena* arena) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 6717 | 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 Bot | a9387b5 | 2024-06-12 15:17:52 +0000 | [diff] [blame] | 6718 | UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__DescriptorProto_msg_init); |
Protobuf Team Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 6719 | upb_Array* arr = upb_Message_GetOrCreateMutableArray( |
| 6720 | UPB_UPCAST(msg), &field, arena); |
Protobuf Team Bot | 81e5433 | 2024-01-11 21:04:07 +0000 | [diff] [blame] | 6721 | if (!arr || !UPB_PRIVATE(_upb_Array_ResizeUninitialized)( |
Protobuf Team Bot | f73985a | 2023-12-19 00:14:19 +0000 | [diff] [blame] | 6722 | arr, arr->UPB_PRIVATE(size) + 1, arena)) { |
Eric Salo | b7d54ac | 2022-12-29 11:59:42 -0800 | [diff] [blame] | 6723 | return NULL; |
| 6724 | } |
Protobuf Team Bot | 4ffe086 | 2023-12-06 02:02:36 +0000 | [diff] [blame] | 6725 | struct google_protobuf_DescriptorProto* sub = (struct google_protobuf_DescriptorProto*)_upb_Message_New(&google__protobuf__DescriptorProto_msg_init, arena); |
Eric Salo | b7d54ac | 2022-12-29 11:59:42 -0800 | [diff] [blame] | 6726 | if (!arr || !sub) return NULL; |
Protobuf Team Bot | f73985a | 2023-12-19 00:14:19 +0000 | [diff] [blame] | 6727 | UPB_PRIVATE(_upb_Array_Set) |
| 6728 | (arr, arr->UPB_PRIVATE(size) - 1, &sub, sizeof(sub)); |
Joshua Haberman | 9abf6e2 | 2021-01-13 12:16:25 -0800 | [diff] [blame] | 6729 | return sub; |
| 6730 | } |
Eric Salo | b7d54ac | 2022-12-29 11:59:42 -0800 | [diff] [blame] | 6731 | UPB_INLINE google_protobuf_EnumDescriptorProto** google_protobuf_DescriptorProto_mutable_enum_type(google_protobuf_DescriptorProto* msg, size_t* size) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 6732 | 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 Bot | a9387b5 | 2024-06-12 15:17:52 +0000 | [diff] [blame] | 6733 | UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__EnumDescriptorProto_msg_init); |
Protobuf Team Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 6734 | upb_Array* arr = upb_Message_GetMutableArray(UPB_UPCAST(msg), &field); |
Eric Salo | b7d54ac | 2022-12-29 11:59:42 -0800 | [diff] [blame] | 6735 | if (arr) { |
Protobuf Team Bot | f73985a | 2023-12-19 00:14:19 +0000 | [diff] [blame] | 6736 | if (size) *size = arr->UPB_PRIVATE(size); |
Protobuf Team Bot | 81e5433 | 2024-01-11 21:04:07 +0000 | [diff] [blame] | 6737 | return (google_protobuf_EnumDescriptorProto**)upb_Array_MutableDataPtr(arr); |
Eric Salo | b7d54ac | 2022-12-29 11:59:42 -0800 | [diff] [blame] | 6738 | } else { |
| 6739 | if (size) *size = 0; |
| 6740 | return NULL; |
| 6741 | } |
Joshua Haberman | 9abf6e2 | 2021-01-13 12:16:25 -0800 | [diff] [blame] | 6742 | } |
Eric Salo | b7d54ac | 2022-12-29 11:59:42 -0800 | [diff] [blame] | 6743 | UPB_INLINE google_protobuf_EnumDescriptorProto** google_protobuf_DescriptorProto_resize_enum_type(google_protobuf_DescriptorProto* msg, size_t size, upb_Arena* arena) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 6744 | 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 Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 6745 | return (google_protobuf_EnumDescriptorProto**)upb_Message_ResizeArrayUninitialized(UPB_UPCAST(msg), |
| 6746 | &field, size, arena); |
Joshua Haberman | 9abf6e2 | 2021-01-13 12:16:25 -0800 | [diff] [blame] | 6747 | } |
Joshua Haberman | 7ecf43f | 2022-03-14 13:11:29 -0700 | [diff] [blame] | 6748 | UPB_INLINE struct google_protobuf_EnumDescriptorProto* google_protobuf_DescriptorProto_add_enum_type(google_protobuf_DescriptorProto* msg, upb_Arena* arena) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 6749 | 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 Bot | a9387b5 | 2024-06-12 15:17:52 +0000 | [diff] [blame] | 6750 | UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__EnumDescriptorProto_msg_init); |
Protobuf Team Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 6751 | upb_Array* arr = upb_Message_GetOrCreateMutableArray( |
| 6752 | UPB_UPCAST(msg), &field, arena); |
Protobuf Team Bot | 81e5433 | 2024-01-11 21:04:07 +0000 | [diff] [blame] | 6753 | if (!arr || !UPB_PRIVATE(_upb_Array_ResizeUninitialized)( |
Protobuf Team Bot | f73985a | 2023-12-19 00:14:19 +0000 | [diff] [blame] | 6754 | arr, arr->UPB_PRIVATE(size) + 1, arena)) { |
Eric Salo | b7d54ac | 2022-12-29 11:59:42 -0800 | [diff] [blame] | 6755 | return NULL; |
| 6756 | } |
Protobuf Team Bot | 4ffe086 | 2023-12-06 02:02:36 +0000 | [diff] [blame] | 6757 | struct google_protobuf_EnumDescriptorProto* sub = (struct google_protobuf_EnumDescriptorProto*)_upb_Message_New(&google__protobuf__EnumDescriptorProto_msg_init, arena); |
Eric Salo | b7d54ac | 2022-12-29 11:59:42 -0800 | [diff] [blame] | 6758 | if (!arr || !sub) return NULL; |
Protobuf Team Bot | f73985a | 2023-12-19 00:14:19 +0000 | [diff] [blame] | 6759 | UPB_PRIVATE(_upb_Array_Set) |
| 6760 | (arr, arr->UPB_PRIVATE(size) - 1, &sub, sizeof(sub)); |
Joshua Haberman | 9abf6e2 | 2021-01-13 12:16:25 -0800 | [diff] [blame] | 6761 | return sub; |
| 6762 | } |
Eric Salo | b7d54ac | 2022-12-29 11:59:42 -0800 | [diff] [blame] | 6763 | UPB_INLINE google_protobuf_DescriptorProto_ExtensionRange** google_protobuf_DescriptorProto_mutable_extension_range(google_protobuf_DescriptorProto* msg, size_t* size) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 6764 | 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 Bot | a9387b5 | 2024-06-12 15:17:52 +0000 | [diff] [blame] | 6765 | UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__DescriptorProto__ExtensionRange_msg_init); |
Protobuf Team Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 6766 | upb_Array* arr = upb_Message_GetMutableArray(UPB_UPCAST(msg), &field); |
Eric Salo | b7d54ac | 2022-12-29 11:59:42 -0800 | [diff] [blame] | 6767 | if (arr) { |
Protobuf Team Bot | f73985a | 2023-12-19 00:14:19 +0000 | [diff] [blame] | 6768 | if (size) *size = arr->UPB_PRIVATE(size); |
Protobuf Team Bot | 81e5433 | 2024-01-11 21:04:07 +0000 | [diff] [blame] | 6769 | return (google_protobuf_DescriptorProto_ExtensionRange**)upb_Array_MutableDataPtr(arr); |
Eric Salo | b7d54ac | 2022-12-29 11:59:42 -0800 | [diff] [blame] | 6770 | } else { |
| 6771 | if (size) *size = 0; |
| 6772 | return NULL; |
| 6773 | } |
Joshua Haberman | 9abf6e2 | 2021-01-13 12:16:25 -0800 | [diff] [blame] | 6774 | } |
Eric Salo | b7d54ac | 2022-12-29 11:59:42 -0800 | [diff] [blame] | 6775 | UPB_INLINE google_protobuf_DescriptorProto_ExtensionRange** google_protobuf_DescriptorProto_resize_extension_range(google_protobuf_DescriptorProto* msg, size_t size, upb_Arena* arena) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 6776 | 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 Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 6777 | return (google_protobuf_DescriptorProto_ExtensionRange**)upb_Message_ResizeArrayUninitialized(UPB_UPCAST(msg), |
| 6778 | &field, size, arena); |
Joshua Haberman | 9abf6e2 | 2021-01-13 12:16:25 -0800 | [diff] [blame] | 6779 | } |
Joshua Haberman | 7ecf43f | 2022-03-14 13:11:29 -0700 | [diff] [blame] | 6780 | UPB_INLINE struct google_protobuf_DescriptorProto_ExtensionRange* google_protobuf_DescriptorProto_add_extension_range(google_protobuf_DescriptorProto* msg, upb_Arena* arena) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 6781 | 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 Bot | a9387b5 | 2024-06-12 15:17:52 +0000 | [diff] [blame] | 6782 | UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__DescriptorProto__ExtensionRange_msg_init); |
Protobuf Team Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 6783 | upb_Array* arr = upb_Message_GetOrCreateMutableArray( |
| 6784 | UPB_UPCAST(msg), &field, arena); |
Protobuf Team Bot | 81e5433 | 2024-01-11 21:04:07 +0000 | [diff] [blame] | 6785 | if (!arr || !UPB_PRIVATE(_upb_Array_ResizeUninitialized)( |
Protobuf Team Bot | f73985a | 2023-12-19 00:14:19 +0000 | [diff] [blame] | 6786 | arr, arr->UPB_PRIVATE(size) + 1, arena)) { |
Eric Salo | b7d54ac | 2022-12-29 11:59:42 -0800 | [diff] [blame] | 6787 | return NULL; |
| 6788 | } |
Protobuf Team Bot | 4ffe086 | 2023-12-06 02:02:36 +0000 | [diff] [blame] | 6789 | struct google_protobuf_DescriptorProto_ExtensionRange* sub = (struct google_protobuf_DescriptorProto_ExtensionRange*)_upb_Message_New(&google__protobuf__DescriptorProto__ExtensionRange_msg_init, arena); |
Eric Salo | b7d54ac | 2022-12-29 11:59:42 -0800 | [diff] [blame] | 6790 | if (!arr || !sub) return NULL; |
Protobuf Team Bot | f73985a | 2023-12-19 00:14:19 +0000 | [diff] [blame] | 6791 | UPB_PRIVATE(_upb_Array_Set) |
| 6792 | (arr, arr->UPB_PRIVATE(size) - 1, &sub, sizeof(sub)); |
Joshua Haberman | 9abf6e2 | 2021-01-13 12:16:25 -0800 | [diff] [blame] | 6793 | return sub; |
| 6794 | } |
Eric Salo | b7d54ac | 2022-12-29 11:59:42 -0800 | [diff] [blame] | 6795 | UPB_INLINE google_protobuf_FieldDescriptorProto** google_protobuf_DescriptorProto_mutable_extension(google_protobuf_DescriptorProto* msg, size_t* size) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 6796 | 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 Bot | a9387b5 | 2024-06-12 15:17:52 +0000 | [diff] [blame] | 6797 | UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__FieldDescriptorProto_msg_init); |
Protobuf Team Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 6798 | upb_Array* arr = upb_Message_GetMutableArray(UPB_UPCAST(msg), &field); |
Eric Salo | b7d54ac | 2022-12-29 11:59:42 -0800 | [diff] [blame] | 6799 | if (arr) { |
Protobuf Team Bot | f73985a | 2023-12-19 00:14:19 +0000 | [diff] [blame] | 6800 | if (size) *size = arr->UPB_PRIVATE(size); |
Protobuf Team Bot | 81e5433 | 2024-01-11 21:04:07 +0000 | [diff] [blame] | 6801 | return (google_protobuf_FieldDescriptorProto**)upb_Array_MutableDataPtr(arr); |
Eric Salo | b7d54ac | 2022-12-29 11:59:42 -0800 | [diff] [blame] | 6802 | } else { |
| 6803 | if (size) *size = 0; |
| 6804 | return NULL; |
| 6805 | } |
Joshua Haberman | 9abf6e2 | 2021-01-13 12:16:25 -0800 | [diff] [blame] | 6806 | } |
Eric Salo | b7d54ac | 2022-12-29 11:59:42 -0800 | [diff] [blame] | 6807 | UPB_INLINE google_protobuf_FieldDescriptorProto** google_protobuf_DescriptorProto_resize_extension(google_protobuf_DescriptorProto* msg, size_t size, upb_Arena* arena) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 6808 | 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 Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 6809 | return (google_protobuf_FieldDescriptorProto**)upb_Message_ResizeArrayUninitialized(UPB_UPCAST(msg), |
| 6810 | &field, size, arena); |
Joshua Haberman | 9abf6e2 | 2021-01-13 12:16:25 -0800 | [diff] [blame] | 6811 | } |
Joshua Haberman | 7ecf43f | 2022-03-14 13:11:29 -0700 | [diff] [blame] | 6812 | UPB_INLINE struct google_protobuf_FieldDescriptorProto* google_protobuf_DescriptorProto_add_extension(google_protobuf_DescriptorProto* msg, upb_Arena* arena) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 6813 | 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 Bot | a9387b5 | 2024-06-12 15:17:52 +0000 | [diff] [blame] | 6814 | UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__FieldDescriptorProto_msg_init); |
Protobuf Team Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 6815 | upb_Array* arr = upb_Message_GetOrCreateMutableArray( |
| 6816 | UPB_UPCAST(msg), &field, arena); |
Protobuf Team Bot | 81e5433 | 2024-01-11 21:04:07 +0000 | [diff] [blame] | 6817 | if (!arr || !UPB_PRIVATE(_upb_Array_ResizeUninitialized)( |
Protobuf Team Bot | f73985a | 2023-12-19 00:14:19 +0000 | [diff] [blame] | 6818 | arr, arr->UPB_PRIVATE(size) + 1, arena)) { |
Eric Salo | b7d54ac | 2022-12-29 11:59:42 -0800 | [diff] [blame] | 6819 | return NULL; |
| 6820 | } |
Protobuf Team Bot | 4ffe086 | 2023-12-06 02:02:36 +0000 | [diff] [blame] | 6821 | struct google_protobuf_FieldDescriptorProto* sub = (struct google_protobuf_FieldDescriptorProto*)_upb_Message_New(&google__protobuf__FieldDescriptorProto_msg_init, arena); |
Eric Salo | b7d54ac | 2022-12-29 11:59:42 -0800 | [diff] [blame] | 6822 | if (!arr || !sub) return NULL; |
Protobuf Team Bot | f73985a | 2023-12-19 00:14:19 +0000 | [diff] [blame] | 6823 | UPB_PRIVATE(_upb_Array_Set) |
| 6824 | (arr, arr->UPB_PRIVATE(size) - 1, &sub, sizeof(sub)); |
Joshua Haberman | 9abf6e2 | 2021-01-13 12:16:25 -0800 | [diff] [blame] | 6825 | return sub; |
| 6826 | } |
| 6827 | UPB_INLINE void google_protobuf_DescriptorProto_set_options(google_protobuf_DescriptorProto *msg, google_protobuf_MessageOptions* value) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 6828 | 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 Bot | a9387b5 | 2024-06-12 15:17:52 +0000 | [diff] [blame] | 6829 | UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__MessageOptions_msg_init); |
Protobuf Team Bot | ac32c97 | 2024-04-10 03:30:05 +0000 | [diff] [blame] | 6830 | upb_Message_SetBaseField((upb_Message *)msg, &field, &value); |
Mike Kruskal | 232ecf4 | 2023-01-14 00:09:40 -0800 | [diff] [blame] | 6831 | } |
| 6832 | UPB_INLINE struct google_protobuf_MessageOptions* google_protobuf_DescriptorProto_mutable_options(google_protobuf_DescriptorProto* msg, upb_Arena* arena) { |
Joshua Haberman | 9abf6e2 | 2021-01-13 12:16:25 -0800 | [diff] [blame] | 6833 | struct google_protobuf_MessageOptions* sub = (struct google_protobuf_MessageOptions*)google_protobuf_DescriptorProto_options(msg); |
| 6834 | if (sub == NULL) { |
Protobuf Team Bot | 4ffe086 | 2023-12-06 02:02:36 +0000 | [diff] [blame] | 6835 | sub = (struct google_protobuf_MessageOptions*)_upb_Message_New(&google__protobuf__MessageOptions_msg_init, arena); |
Eric Salo | 8809a11 | 2022-11-21 13:01:06 -0800 | [diff] [blame] | 6836 | if (sub) google_protobuf_DescriptorProto_set_options(msg, sub); |
Joshua Haberman | 9abf6e2 | 2021-01-13 12:16:25 -0800 | [diff] [blame] | 6837 | } |
| 6838 | return sub; |
| 6839 | } |
Eric Salo | b7d54ac | 2022-12-29 11:59:42 -0800 | [diff] [blame] | 6840 | UPB_INLINE google_protobuf_OneofDescriptorProto** google_protobuf_DescriptorProto_mutable_oneof_decl(google_protobuf_DescriptorProto* msg, size_t* size) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 6841 | 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 Bot | a9387b5 | 2024-06-12 15:17:52 +0000 | [diff] [blame] | 6842 | UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__OneofDescriptorProto_msg_init); |
Protobuf Team Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 6843 | upb_Array* arr = upb_Message_GetMutableArray(UPB_UPCAST(msg), &field); |
Eric Salo | b7d54ac | 2022-12-29 11:59:42 -0800 | [diff] [blame] | 6844 | if (arr) { |
Protobuf Team Bot | f73985a | 2023-12-19 00:14:19 +0000 | [diff] [blame] | 6845 | if (size) *size = arr->UPB_PRIVATE(size); |
Protobuf Team Bot | 81e5433 | 2024-01-11 21:04:07 +0000 | [diff] [blame] | 6846 | return (google_protobuf_OneofDescriptorProto**)upb_Array_MutableDataPtr(arr); |
Eric Salo | b7d54ac | 2022-12-29 11:59:42 -0800 | [diff] [blame] | 6847 | } else { |
| 6848 | if (size) *size = 0; |
| 6849 | return NULL; |
| 6850 | } |
Joshua Haberman | 9abf6e2 | 2021-01-13 12:16:25 -0800 | [diff] [blame] | 6851 | } |
Eric Salo | b7d54ac | 2022-12-29 11:59:42 -0800 | [diff] [blame] | 6852 | UPB_INLINE google_protobuf_OneofDescriptorProto** google_protobuf_DescriptorProto_resize_oneof_decl(google_protobuf_DescriptorProto* msg, size_t size, upb_Arena* arena) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 6853 | 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 Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 6854 | return (google_protobuf_OneofDescriptorProto**)upb_Message_ResizeArrayUninitialized(UPB_UPCAST(msg), |
| 6855 | &field, size, arena); |
Joshua Haberman | 9abf6e2 | 2021-01-13 12:16:25 -0800 | [diff] [blame] | 6856 | } |
Joshua Haberman | 7ecf43f | 2022-03-14 13:11:29 -0700 | [diff] [blame] | 6857 | UPB_INLINE struct google_protobuf_OneofDescriptorProto* google_protobuf_DescriptorProto_add_oneof_decl(google_protobuf_DescriptorProto* msg, upb_Arena* arena) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 6858 | 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 Bot | a9387b5 | 2024-06-12 15:17:52 +0000 | [diff] [blame] | 6859 | UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__OneofDescriptorProto_msg_init); |
Protobuf Team Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 6860 | upb_Array* arr = upb_Message_GetOrCreateMutableArray( |
| 6861 | UPB_UPCAST(msg), &field, arena); |
Protobuf Team Bot | 81e5433 | 2024-01-11 21:04:07 +0000 | [diff] [blame] | 6862 | if (!arr || !UPB_PRIVATE(_upb_Array_ResizeUninitialized)( |
Protobuf Team Bot | f73985a | 2023-12-19 00:14:19 +0000 | [diff] [blame] | 6863 | arr, arr->UPB_PRIVATE(size) + 1, arena)) { |
Eric Salo | b7d54ac | 2022-12-29 11:59:42 -0800 | [diff] [blame] | 6864 | return NULL; |
| 6865 | } |
Protobuf Team Bot | 4ffe086 | 2023-12-06 02:02:36 +0000 | [diff] [blame] | 6866 | struct google_protobuf_OneofDescriptorProto* sub = (struct google_protobuf_OneofDescriptorProto*)_upb_Message_New(&google__protobuf__OneofDescriptorProto_msg_init, arena); |
Eric Salo | b7d54ac | 2022-12-29 11:59:42 -0800 | [diff] [blame] | 6867 | if (!arr || !sub) return NULL; |
Protobuf Team Bot | f73985a | 2023-12-19 00:14:19 +0000 | [diff] [blame] | 6868 | UPB_PRIVATE(_upb_Array_Set) |
| 6869 | (arr, arr->UPB_PRIVATE(size) - 1, &sub, sizeof(sub)); |
Joshua Haberman | 9abf6e2 | 2021-01-13 12:16:25 -0800 | [diff] [blame] | 6870 | return sub; |
| 6871 | } |
Eric Salo | b7d54ac | 2022-12-29 11:59:42 -0800 | [diff] [blame] | 6872 | UPB_INLINE google_protobuf_DescriptorProto_ReservedRange** google_protobuf_DescriptorProto_mutable_reserved_range(google_protobuf_DescriptorProto* msg, size_t* size) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 6873 | 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 Bot | a9387b5 | 2024-06-12 15:17:52 +0000 | [diff] [blame] | 6874 | UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__DescriptorProto__ReservedRange_msg_init); |
Protobuf Team Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 6875 | upb_Array* arr = upb_Message_GetMutableArray(UPB_UPCAST(msg), &field); |
Eric Salo | b7d54ac | 2022-12-29 11:59:42 -0800 | [diff] [blame] | 6876 | if (arr) { |
Protobuf Team Bot | f73985a | 2023-12-19 00:14:19 +0000 | [diff] [blame] | 6877 | if (size) *size = arr->UPB_PRIVATE(size); |
Protobuf Team Bot | 81e5433 | 2024-01-11 21:04:07 +0000 | [diff] [blame] | 6878 | return (google_protobuf_DescriptorProto_ReservedRange**)upb_Array_MutableDataPtr(arr); |
Eric Salo | b7d54ac | 2022-12-29 11:59:42 -0800 | [diff] [blame] | 6879 | } else { |
| 6880 | if (size) *size = 0; |
| 6881 | return NULL; |
| 6882 | } |
Joshua Haberman | 9abf6e2 | 2021-01-13 12:16:25 -0800 | [diff] [blame] | 6883 | } |
Eric Salo | b7d54ac | 2022-12-29 11:59:42 -0800 | [diff] [blame] | 6884 | UPB_INLINE google_protobuf_DescriptorProto_ReservedRange** google_protobuf_DescriptorProto_resize_reserved_range(google_protobuf_DescriptorProto* msg, size_t size, upb_Arena* arena) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 6885 | 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 Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 6886 | return (google_protobuf_DescriptorProto_ReservedRange**)upb_Message_ResizeArrayUninitialized(UPB_UPCAST(msg), |
| 6887 | &field, size, arena); |
Joshua Haberman | 9abf6e2 | 2021-01-13 12:16:25 -0800 | [diff] [blame] | 6888 | } |
Joshua Haberman | 7ecf43f | 2022-03-14 13:11:29 -0700 | [diff] [blame] | 6889 | UPB_INLINE struct google_protobuf_DescriptorProto_ReservedRange* google_protobuf_DescriptorProto_add_reserved_range(google_protobuf_DescriptorProto* msg, upb_Arena* arena) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 6890 | 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 Bot | a9387b5 | 2024-06-12 15:17:52 +0000 | [diff] [blame] | 6891 | UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__DescriptorProto__ReservedRange_msg_init); |
Protobuf Team Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 6892 | upb_Array* arr = upb_Message_GetOrCreateMutableArray( |
| 6893 | UPB_UPCAST(msg), &field, arena); |
Protobuf Team Bot | 81e5433 | 2024-01-11 21:04:07 +0000 | [diff] [blame] | 6894 | if (!arr || !UPB_PRIVATE(_upb_Array_ResizeUninitialized)( |
Protobuf Team Bot | f73985a | 2023-12-19 00:14:19 +0000 | [diff] [blame] | 6895 | arr, arr->UPB_PRIVATE(size) + 1, arena)) { |
Eric Salo | b7d54ac | 2022-12-29 11:59:42 -0800 | [diff] [blame] | 6896 | return NULL; |
| 6897 | } |
Protobuf Team Bot | 4ffe086 | 2023-12-06 02:02:36 +0000 | [diff] [blame] | 6898 | struct google_protobuf_DescriptorProto_ReservedRange* sub = (struct google_protobuf_DescriptorProto_ReservedRange*)_upb_Message_New(&google__protobuf__DescriptorProto__ReservedRange_msg_init, arena); |
Eric Salo | b7d54ac | 2022-12-29 11:59:42 -0800 | [diff] [blame] | 6899 | if (!arr || !sub) return NULL; |
Protobuf Team Bot | f73985a | 2023-12-19 00:14:19 +0000 | [diff] [blame] | 6900 | UPB_PRIVATE(_upb_Array_Set) |
| 6901 | (arr, arr->UPB_PRIVATE(size) - 1, &sub, sizeof(sub)); |
Joshua Haberman | 9abf6e2 | 2021-01-13 12:16:25 -0800 | [diff] [blame] | 6902 | return sub; |
| 6903 | } |
Eric Salo | b7d54ac | 2022-12-29 11:59:42 -0800 | [diff] [blame] | 6904 | UPB_INLINE upb_StringView* google_protobuf_DescriptorProto_mutable_reserved_name(google_protobuf_DescriptorProto* msg, size_t* size) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 6905 | 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 Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 6906 | upb_Array* arr = upb_Message_GetMutableArray(UPB_UPCAST(msg), &field); |
Eric Salo | b7d54ac | 2022-12-29 11:59:42 -0800 | [diff] [blame] | 6907 | if (arr) { |
Protobuf Team Bot | f73985a | 2023-12-19 00:14:19 +0000 | [diff] [blame] | 6908 | if (size) *size = arr->UPB_PRIVATE(size); |
Protobuf Team Bot | 81e5433 | 2024-01-11 21:04:07 +0000 | [diff] [blame] | 6909 | return (upb_StringView*)upb_Array_MutableDataPtr(arr); |
Eric Salo | b7d54ac | 2022-12-29 11:59:42 -0800 | [diff] [blame] | 6910 | } else { |
| 6911 | if (size) *size = 0; |
| 6912 | return NULL; |
| 6913 | } |
Joshua Haberman | 9abf6e2 | 2021-01-13 12:16:25 -0800 | [diff] [blame] | 6914 | } |
Eric Salo | b7d54ac | 2022-12-29 11:59:42 -0800 | [diff] [blame] | 6915 | UPB_INLINE upb_StringView* google_protobuf_DescriptorProto_resize_reserved_name(google_protobuf_DescriptorProto* msg, size_t size, upb_Arena* arena) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 6916 | 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 Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 6917 | return (upb_StringView*)upb_Message_ResizeArrayUninitialized(UPB_UPCAST(msg), |
| 6918 | &field, size, arena); |
Joshua Haberman | 9abf6e2 | 2021-01-13 12:16:25 -0800 | [diff] [blame] | 6919 | } |
Joshua Haberman | 7ecf43f | 2022-03-14 13:11:29 -0700 | [diff] [blame] | 6920 | UPB_INLINE bool google_protobuf_DescriptorProto_add_reserved_name(google_protobuf_DescriptorProto* msg, upb_StringView val, upb_Arena* arena) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 6921 | 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 Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 6922 | upb_Array* arr = upb_Message_GetOrCreateMutableArray( |
| 6923 | UPB_UPCAST(msg), &field, arena); |
Protobuf Team Bot | 81e5433 | 2024-01-11 21:04:07 +0000 | [diff] [blame] | 6924 | if (!arr || !UPB_PRIVATE(_upb_Array_ResizeUninitialized)( |
Protobuf Team Bot | f73985a | 2023-12-19 00:14:19 +0000 | [diff] [blame] | 6925 | arr, arr->UPB_PRIVATE(size) + 1, arena)) { |
Eric Salo | b7d54ac | 2022-12-29 11:59:42 -0800 | [diff] [blame] | 6926 | return false; |
| 6927 | } |
Protobuf Team Bot | f73985a | 2023-12-19 00:14:19 +0000 | [diff] [blame] | 6928 | UPB_PRIVATE(_upb_Array_Set) |
| 6929 | (arr, arr->UPB_PRIVATE(size) - 1, &val, sizeof(val)); |
Eric Salo | b7d54ac | 2022-12-29 11:59:42 -0800 | [diff] [blame] | 6930 | return true; |
Joshua Haberman | 9abf6e2 | 2021-01-13 12:16:25 -0800 | [diff] [blame] | 6931 | } |
| 6932 | |
| 6933 | /* google.protobuf.DescriptorProto.ExtensionRange */ |
| 6934 | |
Joshua Haberman | f41049a | 2022-01-21 14:41:25 -0800 | [diff] [blame] | 6935 | UPB_INLINE google_protobuf_DescriptorProto_ExtensionRange* google_protobuf_DescriptorProto_ExtensionRange_new(upb_Arena* arena) { |
Protobuf Team Bot | 4ffe086 | 2023-12-06 02:02:36 +0000 | [diff] [blame] | 6936 | return (google_protobuf_DescriptorProto_ExtensionRange*)_upb_Message_New(&google__protobuf__DescriptorProto__ExtensionRange_msg_init, arena); |
Joshua Haberman | 9abf6e2 | 2021-01-13 12:16:25 -0800 | [diff] [blame] | 6937 | } |
Joshua Haberman | f41049a | 2022-01-21 14:41:25 -0800 | [diff] [blame] | 6938 | UPB_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 Haberman | 9d578a3 | 2021-08-02 15:32:01 -0700 | [diff] [blame] | 6940 | if (!ret) return NULL; |
Protobuf Team Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 6941 | if (upb_Decode(buf, size, UPB_UPCAST(ret), &google__protobuf__DescriptorProto__ExtensionRange_msg_init, NULL, 0, arena) != |
| 6942 | kUpb_DecodeStatus_Ok) { |
Joshua Haberman | 9d578a3 | 2021-08-02 15:32:01 -0700 | [diff] [blame] | 6943 | return NULL; |
| 6944 | } |
| 6945 | return ret; |
Joshua Haberman | 9abf6e2 | 2021-01-13 12:16:25 -0800 | [diff] [blame] | 6946 | } |
Joshua Haberman | f41049a | 2022-01-21 14:41:25 -0800 | [diff] [blame] | 6947 | UPB_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 Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 6952 | if (upb_Decode(buf, size, UPB_UPCAST(ret), &google__protobuf__DescriptorProto__ExtensionRange_msg_init, extreg, options, |
| 6953 | arena) != kUpb_DecodeStatus_Ok) { |
Joshua Haberman | f41049a | 2022-01-21 14:41:25 -0800 | [diff] [blame] | 6954 | return NULL; |
| 6955 | } |
| 6956 | return ret; |
Joshua Haberman | 9abf6e2 | 2021-01-13 12:16:25 -0800 | [diff] [blame] | 6957 | } |
Joshua Haberman | f41049a | 2022-01-21 14:41:25 -0800 | [diff] [blame] | 6958 | UPB_INLINE char* google_protobuf_DescriptorProto_ExtensionRange_serialize(const google_protobuf_DescriptorProto_ExtensionRange* msg, upb_Arena* arena, size_t* len) { |
Joshua Haberman | d3995ec | 2022-09-30 16:54:39 -0700 | [diff] [blame] | 6959 | char* ptr; |
Protobuf Team Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 6960 | (void)upb_Encode(UPB_UPCAST(msg), &google__protobuf__DescriptorProto__ExtensionRange_msg_init, 0, arena, &ptr, len); |
Joshua Haberman | d3995ec | 2022-09-30 16:54:39 -0700 | [diff] [blame] | 6961 | return ptr; |
Joshua Haberman | f41049a | 2022-01-21 14:41:25 -0800 | [diff] [blame] | 6962 | } |
| 6963 | UPB_INLINE char* google_protobuf_DescriptorProto_ExtensionRange_serialize_ex(const google_protobuf_DescriptorProto_ExtensionRange* msg, int options, |
| 6964 | upb_Arena* arena, size_t* len) { |
Joshua Haberman | d3995ec | 2022-09-30 16:54:39 -0700 | [diff] [blame] | 6965 | char* ptr; |
Protobuf Team Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 6966 | (void)upb_Encode(UPB_UPCAST(msg), &google__protobuf__DescriptorProto__ExtensionRange_msg_init, options, arena, &ptr, len); |
Joshua Haberman | d3995ec | 2022-09-30 16:54:39 -0700 | [diff] [blame] | 6967 | return ptr; |
Joshua Haberman | f41049a | 2022-01-21 14:41:25 -0800 | [diff] [blame] | 6968 | } |
Mike Kruskal | 3bc5049 | 2022-12-01 13:34:12 -0800 | [diff] [blame] | 6969 | UPB_INLINE void google_protobuf_DescriptorProto_ExtensionRange_clear_start(google_protobuf_DescriptorProto_ExtensionRange* msg) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 6970 | const upb_MiniTableField field = {1, 12, 64, kUpb_NoSub, 5, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; |
Protobuf Team Bot | 4e90ead | 2024-01-08 15:46:34 +0000 | [diff] [blame] | 6971 | upb_Message_ClearBaseField(UPB_UPCAST(msg), &field); |
Joshua Haberman | d3995ec | 2022-09-30 16:54:39 -0700 | [diff] [blame] | 6972 | } |
Joshua Haberman | f41049a | 2022-01-21 14:41:25 -0800 | [diff] [blame] | 6973 | UPB_INLINE int32_t google_protobuf_DescriptorProto_ExtensionRange_start(const google_protobuf_DescriptorProto_ExtensionRange* msg) { |
Eric Salo | 8809a11 | 2022-11-21 13:01:06 -0800 | [diff] [blame] | 6974 | int32_t default_val = (int32_t)0; |
| 6975 | int32_t ret; |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 6976 | const upb_MiniTableField field = {1, 12, 64, kUpb_NoSub, 5, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; |
Protobuf Team Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 6977 | _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field, |
| 6978 | &default_val, &ret); |
Eric Salo | 8809a11 | 2022-11-21 13:01:06 -0800 | [diff] [blame] | 6979 | return ret; |
Joshua Haberman | f41049a | 2022-01-21 14:41:25 -0800 | [diff] [blame] | 6980 | } |
Mike Kruskal | 3bc5049 | 2022-12-01 13:34:12 -0800 | [diff] [blame] | 6981 | UPB_INLINE bool google_protobuf_DescriptorProto_ExtensionRange_has_start(const google_protobuf_DescriptorProto_ExtensionRange* msg) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 6982 | const upb_MiniTableField field = {1, 12, 64, kUpb_NoSub, 5, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; |
Protobuf Team Bot | 8c1f635 | 2024-01-10 05:18:15 +0000 | [diff] [blame] | 6983 | return upb_Message_HasBaseField(UPB_UPCAST(msg), &field); |
Joshua Haberman | 7ecf43f | 2022-03-14 13:11:29 -0700 | [diff] [blame] | 6984 | } |
Mike Kruskal | 3bc5049 | 2022-12-01 13:34:12 -0800 | [diff] [blame] | 6985 | UPB_INLINE void google_protobuf_DescriptorProto_ExtensionRange_clear_end(google_protobuf_DescriptorProto_ExtensionRange* msg) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 6986 | const upb_MiniTableField field = {2, 16, 65, kUpb_NoSub, 5, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; |
Protobuf Team Bot | 4e90ead | 2024-01-08 15:46:34 +0000 | [diff] [blame] | 6987 | upb_Message_ClearBaseField(UPB_UPCAST(msg), &field); |
Joshua Haberman | d3995ec | 2022-09-30 16:54:39 -0700 | [diff] [blame] | 6988 | } |
Joshua Haberman | f41049a | 2022-01-21 14:41:25 -0800 | [diff] [blame] | 6989 | UPB_INLINE int32_t google_protobuf_DescriptorProto_ExtensionRange_end(const google_protobuf_DescriptorProto_ExtensionRange* msg) { |
Eric Salo | 8809a11 | 2022-11-21 13:01:06 -0800 | [diff] [blame] | 6990 | int32_t default_val = (int32_t)0; |
| 6991 | int32_t ret; |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 6992 | const upb_MiniTableField field = {2, 16, 65, kUpb_NoSub, 5, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; |
Protobuf Team Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 6993 | _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field, |
| 6994 | &default_val, &ret); |
Eric Salo | 8809a11 | 2022-11-21 13:01:06 -0800 | [diff] [blame] | 6995 | return ret; |
Joshua Haberman | f41049a | 2022-01-21 14:41:25 -0800 | [diff] [blame] | 6996 | } |
Mike Kruskal | 3bc5049 | 2022-12-01 13:34:12 -0800 | [diff] [blame] | 6997 | UPB_INLINE bool google_protobuf_DescriptorProto_ExtensionRange_has_end(const google_protobuf_DescriptorProto_ExtensionRange* msg) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 6998 | const upb_MiniTableField field = {2, 16, 65, kUpb_NoSub, 5, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; |
Protobuf Team Bot | 8c1f635 | 2024-01-10 05:18:15 +0000 | [diff] [blame] | 6999 | return upb_Message_HasBaseField(UPB_UPCAST(msg), &field); |
Joshua Haberman | 7ecf43f | 2022-03-14 13:11:29 -0700 | [diff] [blame] | 7000 | } |
Mike Kruskal | 3bc5049 | 2022-12-01 13:34:12 -0800 | [diff] [blame] | 7001 | UPB_INLINE void google_protobuf_DescriptorProto_ExtensionRange_clear_options(google_protobuf_DescriptorProto_ExtensionRange* msg) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 7002 | 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 Bot | 4e90ead | 2024-01-08 15:46:34 +0000 | [diff] [blame] | 7003 | upb_Message_ClearBaseField(UPB_UPCAST(msg), &field); |
Joshua Haberman | d3995ec | 2022-09-30 16:54:39 -0700 | [diff] [blame] | 7004 | } |
Joshua Haberman | f41049a | 2022-01-21 14:41:25 -0800 | [diff] [blame] | 7005 | UPB_INLINE const google_protobuf_ExtensionRangeOptions* google_protobuf_DescriptorProto_ExtensionRange_options(const google_protobuf_DescriptorProto_ExtensionRange* msg) { |
Eric Salo | 8809a11 | 2022-11-21 13:01:06 -0800 | [diff] [blame] | 7006 | const google_protobuf_ExtensionRangeOptions* default_val = NULL; |
| 7007 | const google_protobuf_ExtensionRangeOptions* ret; |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 7008 | 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 Bot | a9387b5 | 2024-06-12 15:17:52 +0000 | [diff] [blame] | 7009 | UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__ExtensionRangeOptions_msg_init); |
Protobuf Team Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 7010 | _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field, |
| 7011 | &default_val, &ret); |
Eric Salo | 8809a11 | 2022-11-21 13:01:06 -0800 | [diff] [blame] | 7012 | return ret; |
Joshua Haberman | f41049a | 2022-01-21 14:41:25 -0800 | [diff] [blame] | 7013 | } |
Mike Kruskal | 3bc5049 | 2022-12-01 13:34:12 -0800 | [diff] [blame] | 7014 | UPB_INLINE bool google_protobuf_DescriptorProto_ExtensionRange_has_options(const google_protobuf_DescriptorProto_ExtensionRange* msg) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 7015 | 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 Bot | 8c1f635 | 2024-01-10 05:18:15 +0000 | [diff] [blame] | 7016 | return upb_Message_HasBaseField(UPB_UPCAST(msg), &field); |
Mike Kruskal | 3bc5049 | 2022-12-01 13:34:12 -0800 | [diff] [blame] | 7017 | } |
Joshua Haberman | 9abf6e2 | 2021-01-13 12:16:25 -0800 | [diff] [blame] | 7018 | |
| 7019 | UPB_INLINE void google_protobuf_DescriptorProto_ExtensionRange_set_start(google_protobuf_DescriptorProto_ExtensionRange *msg, int32_t value) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 7020 | const upb_MiniTableField field = {1, 12, 64, kUpb_NoSub, 5, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; |
Protobuf Team Bot | ac32c97 | 2024-04-10 03:30:05 +0000 | [diff] [blame] | 7021 | upb_Message_SetBaseField((upb_Message *)msg, &field, &value); |
Mike Kruskal | 232ecf4 | 2023-01-14 00:09:40 -0800 | [diff] [blame] | 7022 | } |
| 7023 | UPB_INLINE void google_protobuf_DescriptorProto_ExtensionRange_set_end(google_protobuf_DescriptorProto_ExtensionRange *msg, int32_t value) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 7024 | const upb_MiniTableField field = {2, 16, 65, kUpb_NoSub, 5, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; |
Protobuf Team Bot | ac32c97 | 2024-04-10 03:30:05 +0000 | [diff] [blame] | 7025 | upb_Message_SetBaseField((upb_Message *)msg, &field, &value); |
Mike Kruskal | 232ecf4 | 2023-01-14 00:09:40 -0800 | [diff] [blame] | 7026 | } |
| 7027 | UPB_INLINE void google_protobuf_DescriptorProto_ExtensionRange_set_options(google_protobuf_DescriptorProto_ExtensionRange *msg, google_protobuf_ExtensionRangeOptions* value) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 7028 | 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 Bot | a9387b5 | 2024-06-12 15:17:52 +0000 | [diff] [blame] | 7029 | UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__ExtensionRangeOptions_msg_init); |
Protobuf Team Bot | ac32c97 | 2024-04-10 03:30:05 +0000 | [diff] [blame] | 7030 | upb_Message_SetBaseField((upb_Message *)msg, &field, &value); |
Mike Kruskal | 232ecf4 | 2023-01-14 00:09:40 -0800 | [diff] [blame] | 7031 | } |
| 7032 | UPB_INLINE struct google_protobuf_ExtensionRangeOptions* google_protobuf_DescriptorProto_ExtensionRange_mutable_options(google_protobuf_DescriptorProto_ExtensionRange* msg, upb_Arena* arena) { |
Joshua Haberman | 9abf6e2 | 2021-01-13 12:16:25 -0800 | [diff] [blame] | 7033 | struct google_protobuf_ExtensionRangeOptions* sub = (struct google_protobuf_ExtensionRangeOptions*)google_protobuf_DescriptorProto_ExtensionRange_options(msg); |
| 7034 | if (sub == NULL) { |
Protobuf Team Bot | 4ffe086 | 2023-12-06 02:02:36 +0000 | [diff] [blame] | 7035 | sub = (struct google_protobuf_ExtensionRangeOptions*)_upb_Message_New(&google__protobuf__ExtensionRangeOptions_msg_init, arena); |
Eric Salo | 8809a11 | 2022-11-21 13:01:06 -0800 | [diff] [blame] | 7036 | if (sub) google_protobuf_DescriptorProto_ExtensionRange_set_options(msg, sub); |
Joshua Haberman | 9abf6e2 | 2021-01-13 12:16:25 -0800 | [diff] [blame] | 7037 | } |
| 7038 | return sub; |
| 7039 | } |
| 7040 | |
| 7041 | /* google.protobuf.DescriptorProto.ReservedRange */ |
| 7042 | |
Joshua Haberman | f41049a | 2022-01-21 14:41:25 -0800 | [diff] [blame] | 7043 | UPB_INLINE google_protobuf_DescriptorProto_ReservedRange* google_protobuf_DescriptorProto_ReservedRange_new(upb_Arena* arena) { |
Protobuf Team Bot | 4ffe086 | 2023-12-06 02:02:36 +0000 | [diff] [blame] | 7044 | return (google_protobuf_DescriptorProto_ReservedRange*)_upb_Message_New(&google__protobuf__DescriptorProto__ReservedRange_msg_init, arena); |
Joshua Haberman | 9abf6e2 | 2021-01-13 12:16:25 -0800 | [diff] [blame] | 7045 | } |
Joshua Haberman | f41049a | 2022-01-21 14:41:25 -0800 | [diff] [blame] | 7046 | UPB_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 Haberman | 9d578a3 | 2021-08-02 15:32:01 -0700 | [diff] [blame] | 7048 | if (!ret) return NULL; |
Protobuf Team Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 7049 | if (upb_Decode(buf, size, UPB_UPCAST(ret), &google__protobuf__DescriptorProto__ReservedRange_msg_init, NULL, 0, arena) != |
| 7050 | kUpb_DecodeStatus_Ok) { |
Joshua Haberman | 9d578a3 | 2021-08-02 15:32:01 -0700 | [diff] [blame] | 7051 | return NULL; |
| 7052 | } |
| 7053 | return ret; |
Joshua Haberman | 9abf6e2 | 2021-01-13 12:16:25 -0800 | [diff] [blame] | 7054 | } |
Joshua Haberman | f41049a | 2022-01-21 14:41:25 -0800 | [diff] [blame] | 7055 | UPB_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 Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 7060 | if (upb_Decode(buf, size, UPB_UPCAST(ret), &google__protobuf__DescriptorProto__ReservedRange_msg_init, extreg, options, |
| 7061 | arena) != kUpb_DecodeStatus_Ok) { |
Joshua Haberman | f41049a | 2022-01-21 14:41:25 -0800 | [diff] [blame] | 7062 | return NULL; |
| 7063 | } |
| 7064 | return ret; |
Joshua Haberman | 9abf6e2 | 2021-01-13 12:16:25 -0800 | [diff] [blame] | 7065 | } |
Joshua Haberman | f41049a | 2022-01-21 14:41:25 -0800 | [diff] [blame] | 7066 | UPB_INLINE char* google_protobuf_DescriptorProto_ReservedRange_serialize(const google_protobuf_DescriptorProto_ReservedRange* msg, upb_Arena* arena, size_t* len) { |
Joshua Haberman | d3995ec | 2022-09-30 16:54:39 -0700 | [diff] [blame] | 7067 | char* ptr; |
Protobuf Team Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 7068 | (void)upb_Encode(UPB_UPCAST(msg), &google__protobuf__DescriptorProto__ReservedRange_msg_init, 0, arena, &ptr, len); |
Joshua Haberman | d3995ec | 2022-09-30 16:54:39 -0700 | [diff] [blame] | 7069 | return ptr; |
Joshua Haberman | f41049a | 2022-01-21 14:41:25 -0800 | [diff] [blame] | 7070 | } |
| 7071 | UPB_INLINE char* google_protobuf_DescriptorProto_ReservedRange_serialize_ex(const google_protobuf_DescriptorProto_ReservedRange* msg, int options, |
| 7072 | upb_Arena* arena, size_t* len) { |
Joshua Haberman | d3995ec | 2022-09-30 16:54:39 -0700 | [diff] [blame] | 7073 | char* ptr; |
Protobuf Team Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 7074 | (void)upb_Encode(UPB_UPCAST(msg), &google__protobuf__DescriptorProto__ReservedRange_msg_init, options, arena, &ptr, len); |
Joshua Haberman | d3995ec | 2022-09-30 16:54:39 -0700 | [diff] [blame] | 7075 | return ptr; |
Joshua Haberman | f41049a | 2022-01-21 14:41:25 -0800 | [diff] [blame] | 7076 | } |
Mike Kruskal | 3bc5049 | 2022-12-01 13:34:12 -0800 | [diff] [blame] | 7077 | UPB_INLINE void google_protobuf_DescriptorProto_ReservedRange_clear_start(google_protobuf_DescriptorProto_ReservedRange* msg) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 7078 | const upb_MiniTableField field = {1, 12, 64, kUpb_NoSub, 5, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; |
Protobuf Team Bot | 4e90ead | 2024-01-08 15:46:34 +0000 | [diff] [blame] | 7079 | upb_Message_ClearBaseField(UPB_UPCAST(msg), &field); |
Joshua Haberman | d3995ec | 2022-09-30 16:54:39 -0700 | [diff] [blame] | 7080 | } |
Joshua Haberman | f41049a | 2022-01-21 14:41:25 -0800 | [diff] [blame] | 7081 | UPB_INLINE int32_t google_protobuf_DescriptorProto_ReservedRange_start(const google_protobuf_DescriptorProto_ReservedRange* msg) { |
Eric Salo | 8809a11 | 2022-11-21 13:01:06 -0800 | [diff] [blame] | 7082 | int32_t default_val = (int32_t)0; |
| 7083 | int32_t ret; |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 7084 | const upb_MiniTableField field = {1, 12, 64, kUpb_NoSub, 5, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; |
Protobuf Team Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 7085 | _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field, |
| 7086 | &default_val, &ret); |
Eric Salo | 8809a11 | 2022-11-21 13:01:06 -0800 | [diff] [blame] | 7087 | return ret; |
Joshua Haberman | f41049a | 2022-01-21 14:41:25 -0800 | [diff] [blame] | 7088 | } |
Mike Kruskal | 3bc5049 | 2022-12-01 13:34:12 -0800 | [diff] [blame] | 7089 | UPB_INLINE bool google_protobuf_DescriptorProto_ReservedRange_has_start(const google_protobuf_DescriptorProto_ReservedRange* msg) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 7090 | const upb_MiniTableField field = {1, 12, 64, kUpb_NoSub, 5, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; |
Protobuf Team Bot | 8c1f635 | 2024-01-10 05:18:15 +0000 | [diff] [blame] | 7091 | return upb_Message_HasBaseField(UPB_UPCAST(msg), &field); |
Joshua Haberman | 7ecf43f | 2022-03-14 13:11:29 -0700 | [diff] [blame] | 7092 | } |
Mike Kruskal | 3bc5049 | 2022-12-01 13:34:12 -0800 | [diff] [blame] | 7093 | UPB_INLINE void google_protobuf_DescriptorProto_ReservedRange_clear_end(google_protobuf_DescriptorProto_ReservedRange* msg) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 7094 | const upb_MiniTableField field = {2, 16, 65, kUpb_NoSub, 5, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; |
Protobuf Team Bot | 4e90ead | 2024-01-08 15:46:34 +0000 | [diff] [blame] | 7095 | upb_Message_ClearBaseField(UPB_UPCAST(msg), &field); |
Joshua Haberman | d3995ec | 2022-09-30 16:54:39 -0700 | [diff] [blame] | 7096 | } |
Joshua Haberman | f41049a | 2022-01-21 14:41:25 -0800 | [diff] [blame] | 7097 | UPB_INLINE int32_t google_protobuf_DescriptorProto_ReservedRange_end(const google_protobuf_DescriptorProto_ReservedRange* msg) { |
Eric Salo | 8809a11 | 2022-11-21 13:01:06 -0800 | [diff] [blame] | 7098 | int32_t default_val = (int32_t)0; |
| 7099 | int32_t ret; |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 7100 | const upb_MiniTableField field = {2, 16, 65, kUpb_NoSub, 5, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; |
Protobuf Team Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 7101 | _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field, |
| 7102 | &default_val, &ret); |
Eric Salo | 8809a11 | 2022-11-21 13:01:06 -0800 | [diff] [blame] | 7103 | return ret; |
Joshua Haberman | f41049a | 2022-01-21 14:41:25 -0800 | [diff] [blame] | 7104 | } |
Mike Kruskal | 3bc5049 | 2022-12-01 13:34:12 -0800 | [diff] [blame] | 7105 | UPB_INLINE bool google_protobuf_DescriptorProto_ReservedRange_has_end(const google_protobuf_DescriptorProto_ReservedRange* msg) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 7106 | const upb_MiniTableField field = {2, 16, 65, kUpb_NoSub, 5, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; |
Protobuf Team Bot | 8c1f635 | 2024-01-10 05:18:15 +0000 | [diff] [blame] | 7107 | return upb_Message_HasBaseField(UPB_UPCAST(msg), &field); |
Mike Kruskal | 3bc5049 | 2022-12-01 13:34:12 -0800 | [diff] [blame] | 7108 | } |
Joshua Haberman | 9abf6e2 | 2021-01-13 12:16:25 -0800 | [diff] [blame] | 7109 | |
| 7110 | UPB_INLINE void google_protobuf_DescriptorProto_ReservedRange_set_start(google_protobuf_DescriptorProto_ReservedRange *msg, int32_t value) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 7111 | const upb_MiniTableField field = {1, 12, 64, kUpb_NoSub, 5, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; |
Protobuf Team Bot | ac32c97 | 2024-04-10 03:30:05 +0000 | [diff] [blame] | 7112 | upb_Message_SetBaseField((upb_Message *)msg, &field, &value); |
Mike Kruskal | 232ecf4 | 2023-01-14 00:09:40 -0800 | [diff] [blame] | 7113 | } |
| 7114 | UPB_INLINE void google_protobuf_DescriptorProto_ReservedRange_set_end(google_protobuf_DescriptorProto_ReservedRange *msg, int32_t value) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 7115 | const upb_MiniTableField field = {2, 16, 65, kUpb_NoSub, 5, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; |
Protobuf Team Bot | ac32c97 | 2024-04-10 03:30:05 +0000 | [diff] [blame] | 7116 | upb_Message_SetBaseField((upb_Message *)msg, &field, &value); |
Joshua Haberman | 9abf6e2 | 2021-01-13 12:16:25 -0800 | [diff] [blame] | 7117 | } |
Mike Kruskal | 232ecf4 | 2023-01-14 00:09:40 -0800 | [diff] [blame] | 7118 | |
Joshua Haberman | 9abf6e2 | 2021-01-13 12:16:25 -0800 | [diff] [blame] | 7119 | /* google.protobuf.ExtensionRangeOptions */ |
| 7120 | |
Joshua Haberman | f41049a | 2022-01-21 14:41:25 -0800 | [diff] [blame] | 7121 | UPB_INLINE google_protobuf_ExtensionRangeOptions* google_protobuf_ExtensionRangeOptions_new(upb_Arena* arena) { |
Protobuf Team Bot | 4ffe086 | 2023-12-06 02:02:36 +0000 | [diff] [blame] | 7122 | return (google_protobuf_ExtensionRangeOptions*)_upb_Message_New(&google__protobuf__ExtensionRangeOptions_msg_init, arena); |
Joshua Haberman | 9abf6e2 | 2021-01-13 12:16:25 -0800 | [diff] [blame] | 7123 | } |
Joshua Haberman | f41049a | 2022-01-21 14:41:25 -0800 | [diff] [blame] | 7124 | UPB_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 Haberman | 9d578a3 | 2021-08-02 15:32:01 -0700 | [diff] [blame] | 7126 | if (!ret) return NULL; |
Protobuf Team Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 7127 | if (upb_Decode(buf, size, UPB_UPCAST(ret), &google__protobuf__ExtensionRangeOptions_msg_init, NULL, 0, arena) != |
| 7128 | kUpb_DecodeStatus_Ok) { |
Joshua Haberman | 9d578a3 | 2021-08-02 15:32:01 -0700 | [diff] [blame] | 7129 | return NULL; |
| 7130 | } |
| 7131 | return ret; |
Joshua Haberman | 9abf6e2 | 2021-01-13 12:16:25 -0800 | [diff] [blame] | 7132 | } |
Joshua Haberman | f41049a | 2022-01-21 14:41:25 -0800 | [diff] [blame] | 7133 | UPB_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 Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 7138 | if (upb_Decode(buf, size, UPB_UPCAST(ret), &google__protobuf__ExtensionRangeOptions_msg_init, extreg, options, |
| 7139 | arena) != kUpb_DecodeStatus_Ok) { |
Joshua Haberman | f41049a | 2022-01-21 14:41:25 -0800 | [diff] [blame] | 7140 | return NULL; |
| 7141 | } |
| 7142 | return ret; |
Joshua Haberman | 9abf6e2 | 2021-01-13 12:16:25 -0800 | [diff] [blame] | 7143 | } |
Joshua Haberman | f41049a | 2022-01-21 14:41:25 -0800 | [diff] [blame] | 7144 | UPB_INLINE char* google_protobuf_ExtensionRangeOptions_serialize(const google_protobuf_ExtensionRangeOptions* msg, upb_Arena* arena, size_t* len) { |
Joshua Haberman | d3995ec | 2022-09-30 16:54:39 -0700 | [diff] [blame] | 7145 | char* ptr; |
Protobuf Team Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 7146 | (void)upb_Encode(UPB_UPCAST(msg), &google__protobuf__ExtensionRangeOptions_msg_init, 0, arena, &ptr, len); |
Joshua Haberman | d3995ec | 2022-09-30 16:54:39 -0700 | [diff] [blame] | 7147 | return ptr; |
Joshua Haberman | f41049a | 2022-01-21 14:41:25 -0800 | [diff] [blame] | 7148 | } |
| 7149 | UPB_INLINE char* google_protobuf_ExtensionRangeOptions_serialize_ex(const google_protobuf_ExtensionRangeOptions* msg, int options, |
| 7150 | upb_Arena* arena, size_t* len) { |
Joshua Haberman | d3995ec | 2022-09-30 16:54:39 -0700 | [diff] [blame] | 7151 | char* ptr; |
Protobuf Team Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 7152 | (void)upb_Encode(UPB_UPCAST(msg), &google__protobuf__ExtensionRangeOptions_msg_init, options, arena, &ptr, len); |
Joshua Haberman | d3995ec | 2022-09-30 16:54:39 -0700 | [diff] [blame] | 7153 | return ptr; |
Joshua Haberman | f41049a | 2022-01-21 14:41:25 -0800 | [diff] [blame] | 7154 | } |
Mike Kruskal | 145900f | 2023-03-27 09:55:52 -0700 | [diff] [blame] | 7155 | UPB_INLINE void google_protobuf_ExtensionRangeOptions_clear_declaration(google_protobuf_ExtensionRangeOptions* msg) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 7156 | 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 Bot | 4e90ead | 2024-01-08 15:46:34 +0000 | [diff] [blame] | 7157 | upb_Message_ClearBaseField(UPB_UPCAST(msg), &field); |
Mike Kruskal | 145900f | 2023-03-27 09:55:52 -0700 | [diff] [blame] | 7158 | } |
| 7159 | UPB_INLINE const google_protobuf_ExtensionRangeOptions_Declaration* const* google_protobuf_ExtensionRangeOptions_declaration(const google_protobuf_ExtensionRangeOptions* msg, size_t* size) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 7160 | 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 Bot | a9387b5 | 2024-06-12 15:17:52 +0000 | [diff] [blame] | 7161 | UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__ExtensionRangeOptions__Declaration_msg_init); |
Protobuf Team Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 7162 | const upb_Array* arr = upb_Message_GetArray(UPB_UPCAST(msg), &field); |
Mike Kruskal | 145900f | 2023-03-27 09:55:52 -0700 | [diff] [blame] | 7163 | if (arr) { |
Protobuf Team Bot | f73985a | 2023-12-19 00:14:19 +0000 | [diff] [blame] | 7164 | if (size) *size = arr->UPB_PRIVATE(size); |
Protobuf Team Bot | 81e5433 | 2024-01-11 21:04:07 +0000 | [diff] [blame] | 7165 | return (const google_protobuf_ExtensionRangeOptions_Declaration* const*)upb_Array_DataPtr(arr); |
Mike Kruskal | 145900f | 2023-03-27 09:55:52 -0700 | [diff] [blame] | 7166 | } else { |
| 7167 | if (size) *size = 0; |
| 7168 | return NULL; |
| 7169 | } |
| 7170 | } |
Deanna Garcia | b26afb5 | 2023-04-25 13:37:18 -0700 | [diff] [blame] | 7171 | UPB_INLINE const upb_Array* _google_protobuf_ExtensionRangeOptions_declaration_upb_array(const google_protobuf_ExtensionRangeOptions* msg, size_t* size) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 7172 | 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 Bot | a9387b5 | 2024-06-12 15:17:52 +0000 | [diff] [blame] | 7173 | UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__ExtensionRangeOptions__Declaration_msg_init); |
Protobuf Team Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 7174 | const upb_Array* arr = upb_Message_GetArray(UPB_UPCAST(msg), &field); |
Deanna Garcia | b26afb5 | 2023-04-25 13:37:18 -0700 | [diff] [blame] | 7175 | if (size) { |
Protobuf Team Bot | f73985a | 2023-12-19 00:14:19 +0000 | [diff] [blame] | 7176 | *size = arr ? arr->UPB_PRIVATE(size) : 0; |
Deanna Garcia | b26afb5 | 2023-04-25 13:37:18 -0700 | [diff] [blame] | 7177 | } |
| 7178 | return arr; |
| 7179 | } |
Protobuf Team Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 7180 | UPB_INLINE upb_Array* _google_protobuf_ExtensionRangeOptions_declaration_mutable_upb_array(google_protobuf_ExtensionRangeOptions* msg, size_t* size, upb_Arena* arena) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 7181 | 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 Bot | a9387b5 | 2024-06-12 15:17:52 +0000 | [diff] [blame] | 7182 | UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__ExtensionRangeOptions__Declaration_msg_init); |
Protobuf Team Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 7183 | upb_Array* arr = upb_Message_GetOrCreateMutableArray(UPB_UPCAST(msg), |
| 7184 | &field, arena); |
Deanna Garcia | b26afb5 | 2023-04-25 13:37:18 -0700 | [diff] [blame] | 7185 | if (size) { |
Protobuf Team Bot | f73985a | 2023-12-19 00:14:19 +0000 | [diff] [blame] | 7186 | *size = arr ? arr->UPB_PRIVATE(size) : 0; |
Deanna Garcia | b26afb5 | 2023-04-25 13:37:18 -0700 | [diff] [blame] | 7187 | } |
| 7188 | return arr; |
| 7189 | } |
Protobuf Team Bot | 469f027 | 2023-04-21 18:12:45 -0700 | [diff] [blame] | 7190 | UPB_INLINE void google_protobuf_ExtensionRangeOptions_clear_verification(google_protobuf_ExtensionRangeOptions* msg) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 7191 | 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 Bot | 4e90ead | 2024-01-08 15:46:34 +0000 | [diff] [blame] | 7192 | upb_Message_ClearBaseField(UPB_UPCAST(msg), &field); |
Protobuf Team Bot | 469f027 | 2023-04-21 18:12:45 -0700 | [diff] [blame] | 7193 | } |
| 7194 | UPB_INLINE int32_t google_protobuf_ExtensionRangeOptions_verification(const google_protobuf_ExtensionRangeOptions* msg) { |
| 7195 | int32_t default_val = 1; |
| 7196 | int32_t ret; |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 7197 | 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 Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 7198 | _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field, |
| 7199 | &default_val, &ret); |
Protobuf Team Bot | 469f027 | 2023-04-21 18:12:45 -0700 | [diff] [blame] | 7200 | return ret; |
| 7201 | } |
| 7202 | UPB_INLINE bool google_protobuf_ExtensionRangeOptions_has_verification(const google_protobuf_ExtensionRangeOptions* msg) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 7203 | 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 Bot | 8c1f635 | 2024-01-10 05:18:15 +0000 | [diff] [blame] | 7204 | return upb_Message_HasBaseField(UPB_UPCAST(msg), &field); |
Mike Kruskal | 4f9e417 | 2023-06-30 20:14:50 -0700 | [diff] [blame] | 7205 | } |
| 7206 | UPB_INLINE void google_protobuf_ExtensionRangeOptions_clear_features(google_protobuf_ExtensionRangeOptions* msg) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 7207 | 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 Bot | 4e90ead | 2024-01-08 15:46:34 +0000 | [diff] [blame] | 7208 | upb_Message_ClearBaseField(UPB_UPCAST(msg), &field); |
Mike Kruskal | 4f9e417 | 2023-06-30 20:14:50 -0700 | [diff] [blame] | 7209 | } |
| 7210 | UPB_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 Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 7213 | 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 Bot | a9387b5 | 2024-06-12 15:17:52 +0000 | [diff] [blame] | 7214 | UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__FeatureSet_msg_init); |
Protobuf Team Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 7215 | _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field, |
| 7216 | &default_val, &ret); |
Mike Kruskal | 4f9e417 | 2023-06-30 20:14:50 -0700 | [diff] [blame] | 7217 | return ret; |
| 7218 | } |
| 7219 | UPB_INLINE bool google_protobuf_ExtensionRangeOptions_has_features(const google_protobuf_ExtensionRangeOptions* msg) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 7220 | 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 Bot | 8c1f635 | 2024-01-10 05:18:15 +0000 | [diff] [blame] | 7221 | return upb_Message_HasBaseField(UPB_UPCAST(msg), &field); |
Protobuf Team Bot | 469f027 | 2023-04-21 18:12:45 -0700 | [diff] [blame] | 7222 | } |
Mike Kruskal | 3bc5049 | 2022-12-01 13:34:12 -0800 | [diff] [blame] | 7223 | UPB_INLINE void google_protobuf_ExtensionRangeOptions_clear_uninterpreted_option(google_protobuf_ExtensionRangeOptions* msg) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 7224 | 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 Bot | 4e90ead | 2024-01-08 15:46:34 +0000 | [diff] [blame] | 7225 | upb_Message_ClearBaseField(UPB_UPCAST(msg), &field); |
Joshua Haberman | d3995ec | 2022-09-30 16:54:39 -0700 | [diff] [blame] | 7226 | } |
Eric Salo | b7d54ac | 2022-12-29 11:59:42 -0800 | [diff] [blame] | 7227 | UPB_INLINE const google_protobuf_UninterpretedOption* const* google_protobuf_ExtensionRangeOptions_uninterpreted_option(const google_protobuf_ExtensionRangeOptions* msg, size_t* size) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 7228 | 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 Bot | a9387b5 | 2024-06-12 15:17:52 +0000 | [diff] [blame] | 7229 | UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__UninterpretedOption_msg_init); |
Protobuf Team Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 7230 | const upb_Array* arr = upb_Message_GetArray(UPB_UPCAST(msg), &field); |
Eric Salo | b7d54ac | 2022-12-29 11:59:42 -0800 | [diff] [blame] | 7231 | if (arr) { |
Protobuf Team Bot | f73985a | 2023-12-19 00:14:19 +0000 | [diff] [blame] | 7232 | if (size) *size = arr->UPB_PRIVATE(size); |
Protobuf Team Bot | 81e5433 | 2024-01-11 21:04:07 +0000 | [diff] [blame] | 7233 | return (const google_protobuf_UninterpretedOption* const*)upb_Array_DataPtr(arr); |
Eric Salo | b7d54ac | 2022-12-29 11:59:42 -0800 | [diff] [blame] | 7234 | } else { |
| 7235 | if (size) *size = 0; |
| 7236 | return NULL; |
| 7237 | } |
Joshua Haberman | 7ecf43f | 2022-03-14 13:11:29 -0700 | [diff] [blame] | 7238 | } |
Deanna Garcia | b26afb5 | 2023-04-25 13:37:18 -0700 | [diff] [blame] | 7239 | UPB_INLINE const upb_Array* _google_protobuf_ExtensionRangeOptions_uninterpreted_option_upb_array(const google_protobuf_ExtensionRangeOptions* msg, size_t* size) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 7240 | 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 Bot | a9387b5 | 2024-06-12 15:17:52 +0000 | [diff] [blame] | 7241 | UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__UninterpretedOption_msg_init); |
Protobuf Team Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 7242 | const upb_Array* arr = upb_Message_GetArray(UPB_UPCAST(msg), &field); |
Deanna Garcia | b26afb5 | 2023-04-25 13:37:18 -0700 | [diff] [blame] | 7243 | if (size) { |
Protobuf Team Bot | f73985a | 2023-12-19 00:14:19 +0000 | [diff] [blame] | 7244 | *size = arr ? arr->UPB_PRIVATE(size) : 0; |
Deanna Garcia | b26afb5 | 2023-04-25 13:37:18 -0700 | [diff] [blame] | 7245 | } |
| 7246 | return arr; |
| 7247 | } |
Protobuf Team Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 7248 | UPB_INLINE upb_Array* _google_protobuf_ExtensionRangeOptions_uninterpreted_option_mutable_upb_array(google_protobuf_ExtensionRangeOptions* msg, size_t* size, upb_Arena* arena) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 7249 | 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 Bot | a9387b5 | 2024-06-12 15:17:52 +0000 | [diff] [blame] | 7250 | UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__UninterpretedOption_msg_init); |
Protobuf Team Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 7251 | upb_Array* arr = upb_Message_GetOrCreateMutableArray(UPB_UPCAST(msg), |
| 7252 | &field, arena); |
Deanna Garcia | b26afb5 | 2023-04-25 13:37:18 -0700 | [diff] [blame] | 7253 | if (size) { |
Protobuf Team Bot | f73985a | 2023-12-19 00:14:19 +0000 | [diff] [blame] | 7254 | *size = arr ? arr->UPB_PRIVATE(size) : 0; |
Deanna Garcia | b26afb5 | 2023-04-25 13:37:18 -0700 | [diff] [blame] | 7255 | } |
| 7256 | return arr; |
| 7257 | } |
Joshua Haberman | 9abf6e2 | 2021-01-13 12:16:25 -0800 | [diff] [blame] | 7258 | |
Mike Kruskal | 145900f | 2023-03-27 09:55:52 -0700 | [diff] [blame] | 7259 | UPB_INLINE google_protobuf_ExtensionRangeOptions_Declaration** google_protobuf_ExtensionRangeOptions_mutable_declaration(google_protobuf_ExtensionRangeOptions* msg, size_t* size) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 7260 | 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 Bot | a9387b5 | 2024-06-12 15:17:52 +0000 | [diff] [blame] | 7261 | UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__ExtensionRangeOptions__Declaration_msg_init); |
Protobuf Team Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 7262 | upb_Array* arr = upb_Message_GetMutableArray(UPB_UPCAST(msg), &field); |
Mike Kruskal | 145900f | 2023-03-27 09:55:52 -0700 | [diff] [blame] | 7263 | if (arr) { |
Protobuf Team Bot | f73985a | 2023-12-19 00:14:19 +0000 | [diff] [blame] | 7264 | if (size) *size = arr->UPB_PRIVATE(size); |
Protobuf Team Bot | 81e5433 | 2024-01-11 21:04:07 +0000 | [diff] [blame] | 7265 | return (google_protobuf_ExtensionRangeOptions_Declaration**)upb_Array_MutableDataPtr(arr); |
Mike Kruskal | 145900f | 2023-03-27 09:55:52 -0700 | [diff] [blame] | 7266 | } else { |
| 7267 | if (size) *size = 0; |
| 7268 | return NULL; |
| 7269 | } |
| 7270 | } |
| 7271 | UPB_INLINE google_protobuf_ExtensionRangeOptions_Declaration** google_protobuf_ExtensionRangeOptions_resize_declaration(google_protobuf_ExtensionRangeOptions* msg, size_t size, upb_Arena* arena) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 7272 | 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 Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 7273 | return (google_protobuf_ExtensionRangeOptions_Declaration**)upb_Message_ResizeArrayUninitialized(UPB_UPCAST(msg), |
| 7274 | &field, size, arena); |
Mike Kruskal | 145900f | 2023-03-27 09:55:52 -0700 | [diff] [blame] | 7275 | } |
| 7276 | UPB_INLINE struct google_protobuf_ExtensionRangeOptions_Declaration* google_protobuf_ExtensionRangeOptions_add_declaration(google_protobuf_ExtensionRangeOptions* msg, upb_Arena* arena) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 7277 | 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 Bot | a9387b5 | 2024-06-12 15:17:52 +0000 | [diff] [blame] | 7278 | UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__ExtensionRangeOptions__Declaration_msg_init); |
Protobuf Team Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 7279 | upb_Array* arr = upb_Message_GetOrCreateMutableArray( |
| 7280 | UPB_UPCAST(msg), &field, arena); |
Protobuf Team Bot | 81e5433 | 2024-01-11 21:04:07 +0000 | [diff] [blame] | 7281 | if (!arr || !UPB_PRIVATE(_upb_Array_ResizeUninitialized)( |
Protobuf Team Bot | f73985a | 2023-12-19 00:14:19 +0000 | [diff] [blame] | 7282 | arr, arr->UPB_PRIVATE(size) + 1, arena)) { |
Mike Kruskal | 145900f | 2023-03-27 09:55:52 -0700 | [diff] [blame] | 7283 | return NULL; |
| 7284 | } |
Protobuf Team Bot | 4ffe086 | 2023-12-06 02:02:36 +0000 | [diff] [blame] | 7285 | struct google_protobuf_ExtensionRangeOptions_Declaration* sub = (struct google_protobuf_ExtensionRangeOptions_Declaration*)_upb_Message_New(&google__protobuf__ExtensionRangeOptions__Declaration_msg_init, arena); |
Mike Kruskal | 145900f | 2023-03-27 09:55:52 -0700 | [diff] [blame] | 7286 | if (!arr || !sub) return NULL; |
Protobuf Team Bot | f73985a | 2023-12-19 00:14:19 +0000 | [diff] [blame] | 7287 | UPB_PRIVATE(_upb_Array_Set) |
| 7288 | (arr, arr->UPB_PRIVATE(size) - 1, &sub, sizeof(sub)); |
Mike Kruskal | 145900f | 2023-03-27 09:55:52 -0700 | [diff] [blame] | 7289 | return sub; |
| 7290 | } |
Protobuf Team Bot | 469f027 | 2023-04-21 18:12:45 -0700 | [diff] [blame] | 7291 | UPB_INLINE void google_protobuf_ExtensionRangeOptions_set_verification(google_protobuf_ExtensionRangeOptions *msg, int32_t value) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 7292 | 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 Bot | ac32c97 | 2024-04-10 03:30:05 +0000 | [diff] [blame] | 7293 | upb_Message_SetBaseField((upb_Message *)msg, &field, &value); |
Protobuf Team Bot | 469f027 | 2023-04-21 18:12:45 -0700 | [diff] [blame] | 7294 | } |
Mike Kruskal | 4f9e417 | 2023-06-30 20:14:50 -0700 | [diff] [blame] | 7295 | UPB_INLINE void google_protobuf_ExtensionRangeOptions_set_features(google_protobuf_ExtensionRangeOptions *msg, google_protobuf_FeatureSet* value) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 7296 | 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 Bot | a9387b5 | 2024-06-12 15:17:52 +0000 | [diff] [blame] | 7297 | UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__FeatureSet_msg_init); |
Protobuf Team Bot | ac32c97 | 2024-04-10 03:30:05 +0000 | [diff] [blame] | 7298 | upb_Message_SetBaseField((upb_Message *)msg, &field, &value); |
Mike Kruskal | 4f9e417 | 2023-06-30 20:14:50 -0700 | [diff] [blame] | 7299 | } |
| 7300 | UPB_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 Bot | 4ffe086 | 2023-12-06 02:02:36 +0000 | [diff] [blame] | 7303 | sub = (struct google_protobuf_FeatureSet*)_upb_Message_New(&google__protobuf__FeatureSet_msg_init, arena); |
Mike Kruskal | 4f9e417 | 2023-06-30 20:14:50 -0700 | [diff] [blame] | 7304 | if (sub) google_protobuf_ExtensionRangeOptions_set_features(msg, sub); |
| 7305 | } |
| 7306 | return sub; |
| 7307 | } |
Eric Salo | b7d54ac | 2022-12-29 11:59:42 -0800 | [diff] [blame] | 7308 | UPB_INLINE google_protobuf_UninterpretedOption** google_protobuf_ExtensionRangeOptions_mutable_uninterpreted_option(google_protobuf_ExtensionRangeOptions* msg, size_t* size) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 7309 | 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 Bot | a9387b5 | 2024-06-12 15:17:52 +0000 | [diff] [blame] | 7310 | UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__UninterpretedOption_msg_init); |
Protobuf Team Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 7311 | upb_Array* arr = upb_Message_GetMutableArray(UPB_UPCAST(msg), &field); |
Eric Salo | b7d54ac | 2022-12-29 11:59:42 -0800 | [diff] [blame] | 7312 | if (arr) { |
Protobuf Team Bot | f73985a | 2023-12-19 00:14:19 +0000 | [diff] [blame] | 7313 | if (size) *size = arr->UPB_PRIVATE(size); |
Protobuf Team Bot | 81e5433 | 2024-01-11 21:04:07 +0000 | [diff] [blame] | 7314 | return (google_protobuf_UninterpretedOption**)upb_Array_MutableDataPtr(arr); |
Eric Salo | b7d54ac | 2022-12-29 11:59:42 -0800 | [diff] [blame] | 7315 | } else { |
| 7316 | if (size) *size = 0; |
| 7317 | return NULL; |
| 7318 | } |
Joshua Haberman | 9abf6e2 | 2021-01-13 12:16:25 -0800 | [diff] [blame] | 7319 | } |
Eric Salo | b7d54ac | 2022-12-29 11:59:42 -0800 | [diff] [blame] | 7320 | UPB_INLINE google_protobuf_UninterpretedOption** google_protobuf_ExtensionRangeOptions_resize_uninterpreted_option(google_protobuf_ExtensionRangeOptions* msg, size_t size, upb_Arena* arena) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 7321 | 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 Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 7322 | return (google_protobuf_UninterpretedOption**)upb_Message_ResizeArrayUninitialized(UPB_UPCAST(msg), |
| 7323 | &field, size, arena); |
Joshua Haberman | 9abf6e2 | 2021-01-13 12:16:25 -0800 | [diff] [blame] | 7324 | } |
Joshua Haberman | 7ecf43f | 2022-03-14 13:11:29 -0700 | [diff] [blame] | 7325 | UPB_INLINE struct google_protobuf_UninterpretedOption* google_protobuf_ExtensionRangeOptions_add_uninterpreted_option(google_protobuf_ExtensionRangeOptions* msg, upb_Arena* arena) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 7326 | 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 Bot | a9387b5 | 2024-06-12 15:17:52 +0000 | [diff] [blame] | 7327 | UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__UninterpretedOption_msg_init); |
Protobuf Team Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 7328 | upb_Array* arr = upb_Message_GetOrCreateMutableArray( |
| 7329 | UPB_UPCAST(msg), &field, arena); |
Protobuf Team Bot | 81e5433 | 2024-01-11 21:04:07 +0000 | [diff] [blame] | 7330 | if (!arr || !UPB_PRIVATE(_upb_Array_ResizeUninitialized)( |
Protobuf Team Bot | f73985a | 2023-12-19 00:14:19 +0000 | [diff] [blame] | 7331 | arr, arr->UPB_PRIVATE(size) + 1, arena)) { |
Eric Salo | b7d54ac | 2022-12-29 11:59:42 -0800 | [diff] [blame] | 7332 | return NULL; |
| 7333 | } |
Protobuf Team Bot | 4ffe086 | 2023-12-06 02:02:36 +0000 | [diff] [blame] | 7334 | struct google_protobuf_UninterpretedOption* sub = (struct google_protobuf_UninterpretedOption*)_upb_Message_New(&google__protobuf__UninterpretedOption_msg_init, arena); |
Eric Salo | b7d54ac | 2022-12-29 11:59:42 -0800 | [diff] [blame] | 7335 | if (!arr || !sub) return NULL; |
Protobuf Team Bot | f73985a | 2023-12-19 00:14:19 +0000 | [diff] [blame] | 7336 | UPB_PRIVATE(_upb_Array_Set) |
| 7337 | (arr, arr->UPB_PRIVATE(size) - 1, &sub, sizeof(sub)); |
Joshua Haberman | 9abf6e2 | 2021-01-13 12:16:25 -0800 | [diff] [blame] | 7338 | return sub; |
| 7339 | } |
| 7340 | |
Mike Kruskal | 145900f | 2023-03-27 09:55:52 -0700 | [diff] [blame] | 7341 | /* google.protobuf.ExtensionRangeOptions.Declaration */ |
| 7342 | |
| 7343 | UPB_INLINE google_protobuf_ExtensionRangeOptions_Declaration* google_protobuf_ExtensionRangeOptions_Declaration_new(upb_Arena* arena) { |
Protobuf Team Bot | 4ffe086 | 2023-12-06 02:02:36 +0000 | [diff] [blame] | 7344 | return (google_protobuf_ExtensionRangeOptions_Declaration*)_upb_Message_New(&google__protobuf__ExtensionRangeOptions__Declaration_msg_init, arena); |
Mike Kruskal | 145900f | 2023-03-27 09:55:52 -0700 | [diff] [blame] | 7345 | } |
| 7346 | UPB_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 Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 7349 | if (upb_Decode(buf, size, UPB_UPCAST(ret), &google__protobuf__ExtensionRangeOptions__Declaration_msg_init, NULL, 0, arena) != |
| 7350 | kUpb_DecodeStatus_Ok) { |
Mike Kruskal | 145900f | 2023-03-27 09:55:52 -0700 | [diff] [blame] | 7351 | return NULL; |
| 7352 | } |
| 7353 | return ret; |
| 7354 | } |
| 7355 | UPB_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 Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 7360 | if (upb_Decode(buf, size, UPB_UPCAST(ret), &google__protobuf__ExtensionRangeOptions__Declaration_msg_init, extreg, options, |
| 7361 | arena) != kUpb_DecodeStatus_Ok) { |
Mike Kruskal | 145900f | 2023-03-27 09:55:52 -0700 | [diff] [blame] | 7362 | return NULL; |
| 7363 | } |
| 7364 | return ret; |
| 7365 | } |
| 7366 | UPB_INLINE char* google_protobuf_ExtensionRangeOptions_Declaration_serialize(const google_protobuf_ExtensionRangeOptions_Declaration* msg, upb_Arena* arena, size_t* len) { |
| 7367 | char* ptr; |
Protobuf Team Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 7368 | (void)upb_Encode(UPB_UPCAST(msg), &google__protobuf__ExtensionRangeOptions__Declaration_msg_init, 0, arena, &ptr, len); |
Mike Kruskal | 145900f | 2023-03-27 09:55:52 -0700 | [diff] [blame] | 7369 | return ptr; |
| 7370 | } |
| 7371 | UPB_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 Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 7374 | (void)upb_Encode(UPB_UPCAST(msg), &google__protobuf__ExtensionRangeOptions__Declaration_msg_init, options, arena, &ptr, len); |
Mike Kruskal | 145900f | 2023-03-27 09:55:52 -0700 | [diff] [blame] | 7375 | return ptr; |
| 7376 | } |
| 7377 | UPB_INLINE void google_protobuf_ExtensionRangeOptions_Declaration_clear_number(google_protobuf_ExtensionRangeOptions_Declaration* msg) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 7378 | const upb_MiniTableField field = {1, 12, 64, kUpb_NoSub, 5, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; |
Protobuf Team Bot | 4e90ead | 2024-01-08 15:46:34 +0000 | [diff] [blame] | 7379 | upb_Message_ClearBaseField(UPB_UPCAST(msg), &field); |
Mike Kruskal | 145900f | 2023-03-27 09:55:52 -0700 | [diff] [blame] | 7380 | } |
| 7381 | UPB_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 Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 7384 | const upb_MiniTableField field = {1, 12, 64, kUpb_NoSub, 5, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; |
Protobuf Team Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 7385 | _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field, |
| 7386 | &default_val, &ret); |
Mike Kruskal | 145900f | 2023-03-27 09:55:52 -0700 | [diff] [blame] | 7387 | return ret; |
| 7388 | } |
| 7389 | UPB_INLINE bool google_protobuf_ExtensionRangeOptions_Declaration_has_number(const google_protobuf_ExtensionRangeOptions_Declaration* msg) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 7390 | const upb_MiniTableField field = {1, 12, 64, kUpb_NoSub, 5, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; |
Protobuf Team Bot | 8c1f635 | 2024-01-10 05:18:15 +0000 | [diff] [blame] | 7391 | return upb_Message_HasBaseField(UPB_UPCAST(msg), &field); |
Mike Kruskal | 145900f | 2023-03-27 09:55:52 -0700 | [diff] [blame] | 7392 | } |
| 7393 | UPB_INLINE void google_protobuf_ExtensionRangeOptions_Declaration_clear_full_name(google_protobuf_ExtensionRangeOptions_Declaration* msg) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 7394 | 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 Bot | 4e90ead | 2024-01-08 15:46:34 +0000 | [diff] [blame] | 7395 | upb_Message_ClearBaseField(UPB_UPCAST(msg), &field); |
Mike Kruskal | 145900f | 2023-03-27 09:55:52 -0700 | [diff] [blame] | 7396 | } |
| 7397 | UPB_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 Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 7400 | 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 Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 7401 | _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field, |
| 7402 | &default_val, &ret); |
Mike Kruskal | 145900f | 2023-03-27 09:55:52 -0700 | [diff] [blame] | 7403 | return ret; |
| 7404 | } |
| 7405 | UPB_INLINE bool google_protobuf_ExtensionRangeOptions_Declaration_has_full_name(const google_protobuf_ExtensionRangeOptions_Declaration* msg) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 7406 | 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 Bot | 8c1f635 | 2024-01-10 05:18:15 +0000 | [diff] [blame] | 7407 | return upb_Message_HasBaseField(UPB_UPCAST(msg), &field); |
Mike Kruskal | 145900f | 2023-03-27 09:55:52 -0700 | [diff] [blame] | 7408 | } |
| 7409 | UPB_INLINE void google_protobuf_ExtensionRangeOptions_Declaration_clear_type(google_protobuf_ExtensionRangeOptions_Declaration* msg) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 7410 | 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 Bot | 4e90ead | 2024-01-08 15:46:34 +0000 | [diff] [blame] | 7411 | upb_Message_ClearBaseField(UPB_UPCAST(msg), &field); |
Mike Kruskal | 145900f | 2023-03-27 09:55:52 -0700 | [diff] [blame] | 7412 | } |
| 7413 | UPB_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 Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 7416 | 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 Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 7417 | _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field, |
| 7418 | &default_val, &ret); |
Mike Kruskal | 145900f | 2023-03-27 09:55:52 -0700 | [diff] [blame] | 7419 | return ret; |
| 7420 | } |
| 7421 | UPB_INLINE bool google_protobuf_ExtensionRangeOptions_Declaration_has_type(const google_protobuf_ExtensionRangeOptions_Declaration* msg) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 7422 | 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 Bot | 8c1f635 | 2024-01-10 05:18:15 +0000 | [diff] [blame] | 7423 | return upb_Message_HasBaseField(UPB_UPCAST(msg), &field); |
Mike Kruskal | 145900f | 2023-03-27 09:55:52 -0700 | [diff] [blame] | 7424 | } |
Protobuf Team Bot | 41287bd | 2023-04-10 18:57:14 -0700 | [diff] [blame] | 7425 | UPB_INLINE void google_protobuf_ExtensionRangeOptions_Declaration_clear_reserved(google_protobuf_ExtensionRangeOptions_Declaration* msg) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 7426 | const upb_MiniTableField field = {5, 16, 67, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; |
Protobuf Team Bot | 4e90ead | 2024-01-08 15:46:34 +0000 | [diff] [blame] | 7427 | upb_Message_ClearBaseField(UPB_UPCAST(msg), &field); |
Protobuf Team Bot | 41287bd | 2023-04-10 18:57:14 -0700 | [diff] [blame] | 7428 | } |
| 7429 | UPB_INLINE bool google_protobuf_ExtensionRangeOptions_Declaration_reserved(const google_protobuf_ExtensionRangeOptions_Declaration* msg) { |
| 7430 | bool default_val = false; |
| 7431 | bool ret; |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 7432 | const upb_MiniTableField field = {5, 16, 67, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; |
Protobuf Team Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 7433 | _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field, |
| 7434 | &default_val, &ret); |
Protobuf Team Bot | 41287bd | 2023-04-10 18:57:14 -0700 | [diff] [blame] | 7435 | return ret; |
| 7436 | } |
| 7437 | UPB_INLINE bool google_protobuf_ExtensionRangeOptions_Declaration_has_reserved(const google_protobuf_ExtensionRangeOptions_Declaration* msg) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 7438 | const upb_MiniTableField field = {5, 16, 67, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; |
Protobuf Team Bot | 8c1f635 | 2024-01-10 05:18:15 +0000 | [diff] [blame] | 7439 | return upb_Message_HasBaseField(UPB_UPCAST(msg), &field); |
Protobuf Team Bot | 41287bd | 2023-04-10 18:57:14 -0700 | [diff] [blame] | 7440 | } |
Protobuf Team Bot | 469f027 | 2023-04-21 18:12:45 -0700 | [diff] [blame] | 7441 | UPB_INLINE void google_protobuf_ExtensionRangeOptions_Declaration_clear_repeated(google_protobuf_ExtensionRangeOptions_Declaration* msg) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 7442 | const upb_MiniTableField field = {6, 17, 68, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; |
Protobuf Team Bot | 4e90ead | 2024-01-08 15:46:34 +0000 | [diff] [blame] | 7443 | upb_Message_ClearBaseField(UPB_UPCAST(msg), &field); |
Protobuf Team Bot | 469f027 | 2023-04-21 18:12:45 -0700 | [diff] [blame] | 7444 | } |
| 7445 | UPB_INLINE bool google_protobuf_ExtensionRangeOptions_Declaration_repeated(const google_protobuf_ExtensionRangeOptions_Declaration* msg) { |
| 7446 | bool default_val = false; |
| 7447 | bool ret; |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 7448 | const upb_MiniTableField field = {6, 17, 68, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; |
Protobuf Team Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 7449 | _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field, |
| 7450 | &default_val, &ret); |
Protobuf Team Bot | 469f027 | 2023-04-21 18:12:45 -0700 | [diff] [blame] | 7451 | return ret; |
| 7452 | } |
| 7453 | UPB_INLINE bool google_protobuf_ExtensionRangeOptions_Declaration_has_repeated(const google_protobuf_ExtensionRangeOptions_Declaration* msg) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 7454 | const upb_MiniTableField field = {6, 17, 68, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; |
Protobuf Team Bot | 8c1f635 | 2024-01-10 05:18:15 +0000 | [diff] [blame] | 7455 | return upb_Message_HasBaseField(UPB_UPCAST(msg), &field); |
Protobuf Team Bot | 469f027 | 2023-04-21 18:12:45 -0700 | [diff] [blame] | 7456 | } |
Mike Kruskal | 145900f | 2023-03-27 09:55:52 -0700 | [diff] [blame] | 7457 | |
| 7458 | UPB_INLINE void google_protobuf_ExtensionRangeOptions_Declaration_set_number(google_protobuf_ExtensionRangeOptions_Declaration *msg, int32_t value) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 7459 | const upb_MiniTableField field = {1, 12, 64, kUpb_NoSub, 5, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; |
Protobuf Team Bot | ac32c97 | 2024-04-10 03:30:05 +0000 | [diff] [blame] | 7460 | upb_Message_SetBaseField((upb_Message *)msg, &field, &value); |
Mike Kruskal | 145900f | 2023-03-27 09:55:52 -0700 | [diff] [blame] | 7461 | } |
| 7462 | UPB_INLINE void google_protobuf_ExtensionRangeOptions_Declaration_set_full_name(google_protobuf_ExtensionRangeOptions_Declaration *msg, upb_StringView value) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 7463 | 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 Bot | ac32c97 | 2024-04-10 03:30:05 +0000 | [diff] [blame] | 7464 | upb_Message_SetBaseField((upb_Message *)msg, &field, &value); |
Mike Kruskal | 145900f | 2023-03-27 09:55:52 -0700 | [diff] [blame] | 7465 | } |
| 7466 | UPB_INLINE void google_protobuf_ExtensionRangeOptions_Declaration_set_type(google_protobuf_ExtensionRangeOptions_Declaration *msg, upb_StringView value) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 7467 | 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 Bot | ac32c97 | 2024-04-10 03:30:05 +0000 | [diff] [blame] | 7468 | upb_Message_SetBaseField((upb_Message *)msg, &field, &value); |
Mike Kruskal | 145900f | 2023-03-27 09:55:52 -0700 | [diff] [blame] | 7469 | } |
Protobuf Team Bot | 41287bd | 2023-04-10 18:57:14 -0700 | [diff] [blame] | 7470 | UPB_INLINE void google_protobuf_ExtensionRangeOptions_Declaration_set_reserved(google_protobuf_ExtensionRangeOptions_Declaration *msg, bool value) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 7471 | const upb_MiniTableField field = {5, 16, 67, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; |
Protobuf Team Bot | ac32c97 | 2024-04-10 03:30:05 +0000 | [diff] [blame] | 7472 | upb_Message_SetBaseField((upb_Message *)msg, &field, &value); |
Protobuf Team Bot | 41287bd | 2023-04-10 18:57:14 -0700 | [diff] [blame] | 7473 | } |
Protobuf Team Bot | 469f027 | 2023-04-21 18:12:45 -0700 | [diff] [blame] | 7474 | UPB_INLINE void google_protobuf_ExtensionRangeOptions_Declaration_set_repeated(google_protobuf_ExtensionRangeOptions_Declaration *msg, bool value) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 7475 | const upb_MiniTableField field = {6, 17, 68, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; |
Protobuf Team Bot | ac32c97 | 2024-04-10 03:30:05 +0000 | [diff] [blame] | 7476 | upb_Message_SetBaseField((upb_Message *)msg, &field, &value); |
Protobuf Team Bot | 469f027 | 2023-04-21 18:12:45 -0700 | [diff] [blame] | 7477 | } |
Mike Kruskal | 145900f | 2023-03-27 09:55:52 -0700 | [diff] [blame] | 7478 | |
Joshua Haberman | 9abf6e2 | 2021-01-13 12:16:25 -0800 | [diff] [blame] | 7479 | /* google.protobuf.FieldDescriptorProto */ |
| 7480 | |
Joshua Haberman | f41049a | 2022-01-21 14:41:25 -0800 | [diff] [blame] | 7481 | UPB_INLINE google_protobuf_FieldDescriptorProto* google_protobuf_FieldDescriptorProto_new(upb_Arena* arena) { |
Protobuf Team Bot | 4ffe086 | 2023-12-06 02:02:36 +0000 | [diff] [blame] | 7482 | return (google_protobuf_FieldDescriptorProto*)_upb_Message_New(&google__protobuf__FieldDescriptorProto_msg_init, arena); |
Joshua Haberman | 9abf6e2 | 2021-01-13 12:16:25 -0800 | [diff] [blame] | 7483 | } |
Joshua Haberman | f41049a | 2022-01-21 14:41:25 -0800 | [diff] [blame] | 7484 | UPB_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 Haberman | 9d578a3 | 2021-08-02 15:32:01 -0700 | [diff] [blame] | 7486 | if (!ret) return NULL; |
Protobuf Team Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 7487 | if (upb_Decode(buf, size, UPB_UPCAST(ret), &google__protobuf__FieldDescriptorProto_msg_init, NULL, 0, arena) != |
| 7488 | kUpb_DecodeStatus_Ok) { |
Joshua Haberman | 9d578a3 | 2021-08-02 15:32:01 -0700 | [diff] [blame] | 7489 | return NULL; |
| 7490 | } |
| 7491 | return ret; |
Joshua Haberman | 9abf6e2 | 2021-01-13 12:16:25 -0800 | [diff] [blame] | 7492 | } |
Joshua Haberman | f41049a | 2022-01-21 14:41:25 -0800 | [diff] [blame] | 7493 | UPB_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 Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 7498 | if (upb_Decode(buf, size, UPB_UPCAST(ret), &google__protobuf__FieldDescriptorProto_msg_init, extreg, options, |
| 7499 | arena) != kUpb_DecodeStatus_Ok) { |
Joshua Haberman | f41049a | 2022-01-21 14:41:25 -0800 | [diff] [blame] | 7500 | return NULL; |
| 7501 | } |
| 7502 | return ret; |
Joshua Haberman | 9abf6e2 | 2021-01-13 12:16:25 -0800 | [diff] [blame] | 7503 | } |
Joshua Haberman | f41049a | 2022-01-21 14:41:25 -0800 | [diff] [blame] | 7504 | UPB_INLINE char* google_protobuf_FieldDescriptorProto_serialize(const google_protobuf_FieldDescriptorProto* msg, upb_Arena* arena, size_t* len) { |
Joshua Haberman | d3995ec | 2022-09-30 16:54:39 -0700 | [diff] [blame] | 7505 | char* ptr; |
Protobuf Team Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 7506 | (void)upb_Encode(UPB_UPCAST(msg), &google__protobuf__FieldDescriptorProto_msg_init, 0, arena, &ptr, len); |
Joshua Haberman | d3995ec | 2022-09-30 16:54:39 -0700 | [diff] [blame] | 7507 | return ptr; |
Joshua Haberman | f41049a | 2022-01-21 14:41:25 -0800 | [diff] [blame] | 7508 | } |
| 7509 | UPB_INLINE char* google_protobuf_FieldDescriptorProto_serialize_ex(const google_protobuf_FieldDescriptorProto* msg, int options, |
| 7510 | upb_Arena* arena, size_t* len) { |
Joshua Haberman | d3995ec | 2022-09-30 16:54:39 -0700 | [diff] [blame] | 7511 | char* ptr; |
Protobuf Team Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 7512 | (void)upb_Encode(UPB_UPCAST(msg), &google__protobuf__FieldDescriptorProto_msg_init, options, arena, &ptr, len); |
Joshua Haberman | d3995ec | 2022-09-30 16:54:39 -0700 | [diff] [blame] | 7513 | return ptr; |
Joshua Haberman | f41049a | 2022-01-21 14:41:25 -0800 | [diff] [blame] | 7514 | } |
Mike Kruskal | 3bc5049 | 2022-12-01 13:34:12 -0800 | [diff] [blame] | 7515 | UPB_INLINE void google_protobuf_FieldDescriptorProto_clear_name(google_protobuf_FieldDescriptorProto* msg) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 7516 | 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 Bot | 4e90ead | 2024-01-08 15:46:34 +0000 | [diff] [blame] | 7517 | upb_Message_ClearBaseField(UPB_UPCAST(msg), &field); |
Joshua Haberman | d3995ec | 2022-09-30 16:54:39 -0700 | [diff] [blame] | 7518 | } |
Joshua Haberman | f41049a | 2022-01-21 14:41:25 -0800 | [diff] [blame] | 7519 | UPB_INLINE upb_StringView google_protobuf_FieldDescriptorProto_name(const google_protobuf_FieldDescriptorProto* msg) { |
Eric Salo | 8809a11 | 2022-11-21 13:01:06 -0800 | [diff] [blame] | 7520 | upb_StringView default_val = upb_StringView_FromString(""); |
| 7521 | upb_StringView ret; |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 7522 | 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 Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 7523 | _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field, |
| 7524 | &default_val, &ret); |
Eric Salo | 8809a11 | 2022-11-21 13:01:06 -0800 | [diff] [blame] | 7525 | return ret; |
Joshua Haberman | 9abf6e2 | 2021-01-13 12:16:25 -0800 | [diff] [blame] | 7526 | } |
Mike Kruskal | 3bc5049 | 2022-12-01 13:34:12 -0800 | [diff] [blame] | 7527 | UPB_INLINE bool google_protobuf_FieldDescriptorProto_has_name(const google_protobuf_FieldDescriptorProto* msg) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 7528 | 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 Bot | 8c1f635 | 2024-01-10 05:18:15 +0000 | [diff] [blame] | 7529 | return upb_Message_HasBaseField(UPB_UPCAST(msg), &field); |
Joshua Haberman | 7ecf43f | 2022-03-14 13:11:29 -0700 | [diff] [blame] | 7530 | } |
Mike Kruskal | 3bc5049 | 2022-12-01 13:34:12 -0800 | [diff] [blame] | 7531 | UPB_INLINE void google_protobuf_FieldDescriptorProto_clear_extendee(google_protobuf_FieldDescriptorProto* msg) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 7532 | 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 Bot | 4e90ead | 2024-01-08 15:46:34 +0000 | [diff] [blame] | 7533 | upb_Message_ClearBaseField(UPB_UPCAST(msg), &field); |
Joshua Haberman | d3995ec | 2022-09-30 16:54:39 -0700 | [diff] [blame] | 7534 | } |
Joshua Haberman | f41049a | 2022-01-21 14:41:25 -0800 | [diff] [blame] | 7535 | UPB_INLINE upb_StringView google_protobuf_FieldDescriptorProto_extendee(const google_protobuf_FieldDescriptorProto* msg) { |
Eric Salo | 8809a11 | 2022-11-21 13:01:06 -0800 | [diff] [blame] | 7536 | upb_StringView default_val = upb_StringView_FromString(""); |
| 7537 | upb_StringView ret; |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 7538 | 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 Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 7539 | _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field, |
| 7540 | &default_val, &ret); |
Eric Salo | 8809a11 | 2022-11-21 13:01:06 -0800 | [diff] [blame] | 7541 | return ret; |
Joshua Haberman | f41049a | 2022-01-21 14:41:25 -0800 | [diff] [blame] | 7542 | } |
Mike Kruskal | 3bc5049 | 2022-12-01 13:34:12 -0800 | [diff] [blame] | 7543 | UPB_INLINE bool google_protobuf_FieldDescriptorProto_has_extendee(const google_protobuf_FieldDescriptorProto* msg) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 7544 | 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 Bot | 8c1f635 | 2024-01-10 05:18:15 +0000 | [diff] [blame] | 7545 | return upb_Message_HasBaseField(UPB_UPCAST(msg), &field); |
Joshua Haberman | 7ecf43f | 2022-03-14 13:11:29 -0700 | [diff] [blame] | 7546 | } |
Mike Kruskal | 3bc5049 | 2022-12-01 13:34:12 -0800 | [diff] [blame] | 7547 | UPB_INLINE void google_protobuf_FieldDescriptorProto_clear_number(google_protobuf_FieldDescriptorProto* msg) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 7548 | const upb_MiniTableField field = {3, 12, 66, kUpb_NoSub, 5, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; |
Protobuf Team Bot | 4e90ead | 2024-01-08 15:46:34 +0000 | [diff] [blame] | 7549 | upb_Message_ClearBaseField(UPB_UPCAST(msg), &field); |
Joshua Haberman | d3995ec | 2022-09-30 16:54:39 -0700 | [diff] [blame] | 7550 | } |
Joshua Haberman | f41049a | 2022-01-21 14:41:25 -0800 | [diff] [blame] | 7551 | UPB_INLINE int32_t google_protobuf_FieldDescriptorProto_number(const google_protobuf_FieldDescriptorProto* msg) { |
Eric Salo | 8809a11 | 2022-11-21 13:01:06 -0800 | [diff] [blame] | 7552 | int32_t default_val = (int32_t)0; |
| 7553 | int32_t ret; |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 7554 | const upb_MiniTableField field = {3, 12, 66, kUpb_NoSub, 5, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; |
Protobuf Team Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 7555 | _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field, |
| 7556 | &default_val, &ret); |
Eric Salo | 8809a11 | 2022-11-21 13:01:06 -0800 | [diff] [blame] | 7557 | return ret; |
Joshua Haberman | f41049a | 2022-01-21 14:41:25 -0800 | [diff] [blame] | 7558 | } |
Mike Kruskal | 3bc5049 | 2022-12-01 13:34:12 -0800 | [diff] [blame] | 7559 | UPB_INLINE bool google_protobuf_FieldDescriptorProto_has_number(const google_protobuf_FieldDescriptorProto* msg) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 7560 | const upb_MiniTableField field = {3, 12, 66, kUpb_NoSub, 5, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; |
Protobuf Team Bot | 8c1f635 | 2024-01-10 05:18:15 +0000 | [diff] [blame] | 7561 | return upb_Message_HasBaseField(UPB_UPCAST(msg), &field); |
Joshua Haberman | 7ecf43f | 2022-03-14 13:11:29 -0700 | [diff] [blame] | 7562 | } |
Mike Kruskal | 3bc5049 | 2022-12-01 13:34:12 -0800 | [diff] [blame] | 7563 | UPB_INLINE void google_protobuf_FieldDescriptorProto_clear_label(google_protobuf_FieldDescriptorProto* msg) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 7564 | const upb_MiniTableField field = {4, 16, 67, 1, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; |
Protobuf Team Bot | 4e90ead | 2024-01-08 15:46:34 +0000 | [diff] [blame] | 7565 | upb_Message_ClearBaseField(UPB_UPCAST(msg), &field); |
Joshua Haberman | d3995ec | 2022-09-30 16:54:39 -0700 | [diff] [blame] | 7566 | } |
Joshua Haberman | f41049a | 2022-01-21 14:41:25 -0800 | [diff] [blame] | 7567 | UPB_INLINE int32_t google_protobuf_FieldDescriptorProto_label(const google_protobuf_FieldDescriptorProto* msg) { |
Eric Salo | 8809a11 | 2022-11-21 13:01:06 -0800 | [diff] [blame] | 7568 | int32_t default_val = 1; |
| 7569 | int32_t ret; |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 7570 | const upb_MiniTableField field = {4, 16, 67, 1, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; |
Protobuf Team Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 7571 | _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field, |
| 7572 | &default_val, &ret); |
Eric Salo | 8809a11 | 2022-11-21 13:01:06 -0800 | [diff] [blame] | 7573 | return ret; |
Joshua Haberman | f41049a | 2022-01-21 14:41:25 -0800 | [diff] [blame] | 7574 | } |
Mike Kruskal | 3bc5049 | 2022-12-01 13:34:12 -0800 | [diff] [blame] | 7575 | UPB_INLINE bool google_protobuf_FieldDescriptorProto_has_label(const google_protobuf_FieldDescriptorProto* msg) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 7576 | const upb_MiniTableField field = {4, 16, 67, 1, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; |
Protobuf Team Bot | 8c1f635 | 2024-01-10 05:18:15 +0000 | [diff] [blame] | 7577 | return upb_Message_HasBaseField(UPB_UPCAST(msg), &field); |
Joshua Haberman | 7ecf43f | 2022-03-14 13:11:29 -0700 | [diff] [blame] | 7578 | } |
Mike Kruskal | 3bc5049 | 2022-12-01 13:34:12 -0800 | [diff] [blame] | 7579 | UPB_INLINE void google_protobuf_FieldDescriptorProto_clear_type(google_protobuf_FieldDescriptorProto* msg) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 7580 | const upb_MiniTableField field = {5, 20, 68, 2, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; |
Protobuf Team Bot | 4e90ead | 2024-01-08 15:46:34 +0000 | [diff] [blame] | 7581 | upb_Message_ClearBaseField(UPB_UPCAST(msg), &field); |
Joshua Haberman | d3995ec | 2022-09-30 16:54:39 -0700 | [diff] [blame] | 7582 | } |
Joshua Haberman | f41049a | 2022-01-21 14:41:25 -0800 | [diff] [blame] | 7583 | UPB_INLINE int32_t google_protobuf_FieldDescriptorProto_type(const google_protobuf_FieldDescriptorProto* msg) { |
Eric Salo | 8809a11 | 2022-11-21 13:01:06 -0800 | [diff] [blame] | 7584 | int32_t default_val = 1; |
| 7585 | int32_t ret; |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 7586 | const upb_MiniTableField field = {5, 20, 68, 2, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; |
Protobuf Team Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 7587 | _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field, |
| 7588 | &default_val, &ret); |
Eric Salo | 8809a11 | 2022-11-21 13:01:06 -0800 | [diff] [blame] | 7589 | return ret; |
Joshua Haberman | f41049a | 2022-01-21 14:41:25 -0800 | [diff] [blame] | 7590 | } |
Mike Kruskal | 3bc5049 | 2022-12-01 13:34:12 -0800 | [diff] [blame] | 7591 | UPB_INLINE bool google_protobuf_FieldDescriptorProto_has_type(const google_protobuf_FieldDescriptorProto* msg) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 7592 | const upb_MiniTableField field = {5, 20, 68, 2, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; |
Protobuf Team Bot | 8c1f635 | 2024-01-10 05:18:15 +0000 | [diff] [blame] | 7593 | return upb_Message_HasBaseField(UPB_UPCAST(msg), &field); |
Joshua Haberman | 7ecf43f | 2022-03-14 13:11:29 -0700 | [diff] [blame] | 7594 | } |
Mike Kruskal | 3bc5049 | 2022-12-01 13:34:12 -0800 | [diff] [blame] | 7595 | UPB_INLINE void google_protobuf_FieldDescriptorProto_clear_type_name(google_protobuf_FieldDescriptorProto* msg) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 7596 | 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 Bot | 4e90ead | 2024-01-08 15:46:34 +0000 | [diff] [blame] | 7597 | upb_Message_ClearBaseField(UPB_UPCAST(msg), &field); |
Joshua Haberman | d3995ec | 2022-09-30 16:54:39 -0700 | [diff] [blame] | 7598 | } |
Joshua Haberman | f41049a | 2022-01-21 14:41:25 -0800 | [diff] [blame] | 7599 | UPB_INLINE upb_StringView google_protobuf_FieldDescriptorProto_type_name(const google_protobuf_FieldDescriptorProto* msg) { |
Eric Salo | 8809a11 | 2022-11-21 13:01:06 -0800 | [diff] [blame] | 7600 | upb_StringView default_val = upb_StringView_FromString(""); |
| 7601 | upb_StringView ret; |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 7602 | 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 Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 7603 | _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field, |
| 7604 | &default_val, &ret); |
Eric Salo | 8809a11 | 2022-11-21 13:01:06 -0800 | [diff] [blame] | 7605 | return ret; |
Joshua Haberman | f41049a | 2022-01-21 14:41:25 -0800 | [diff] [blame] | 7606 | } |
Mike Kruskal | 3bc5049 | 2022-12-01 13:34:12 -0800 | [diff] [blame] | 7607 | UPB_INLINE bool google_protobuf_FieldDescriptorProto_has_type_name(const google_protobuf_FieldDescriptorProto* msg) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 7608 | 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 Bot | 8c1f635 | 2024-01-10 05:18:15 +0000 | [diff] [blame] | 7609 | return upb_Message_HasBaseField(UPB_UPCAST(msg), &field); |
Joshua Haberman | 7ecf43f | 2022-03-14 13:11:29 -0700 | [diff] [blame] | 7610 | } |
Mike Kruskal | 3bc5049 | 2022-12-01 13:34:12 -0800 | [diff] [blame] | 7611 | UPB_INLINE void google_protobuf_FieldDescriptorProto_clear_default_value(google_protobuf_FieldDescriptorProto* msg) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 7612 | 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 Bot | 4e90ead | 2024-01-08 15:46:34 +0000 | [diff] [blame] | 7613 | upb_Message_ClearBaseField(UPB_UPCAST(msg), &field); |
Joshua Haberman | d3995ec | 2022-09-30 16:54:39 -0700 | [diff] [blame] | 7614 | } |
Joshua Haberman | f41049a | 2022-01-21 14:41:25 -0800 | [diff] [blame] | 7615 | UPB_INLINE upb_StringView google_protobuf_FieldDescriptorProto_default_value(const google_protobuf_FieldDescriptorProto* msg) { |
Eric Salo | 8809a11 | 2022-11-21 13:01:06 -0800 | [diff] [blame] | 7616 | upb_StringView default_val = upb_StringView_FromString(""); |
| 7617 | upb_StringView ret; |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 7618 | 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 Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 7619 | _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field, |
| 7620 | &default_val, &ret); |
Eric Salo | 8809a11 | 2022-11-21 13:01:06 -0800 | [diff] [blame] | 7621 | return ret; |
Joshua Haberman | f41049a | 2022-01-21 14:41:25 -0800 | [diff] [blame] | 7622 | } |
Mike Kruskal | 3bc5049 | 2022-12-01 13:34:12 -0800 | [diff] [blame] | 7623 | UPB_INLINE bool google_protobuf_FieldDescriptorProto_has_default_value(const google_protobuf_FieldDescriptorProto* msg) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 7624 | 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 Bot | 8c1f635 | 2024-01-10 05:18:15 +0000 | [diff] [blame] | 7625 | return upb_Message_HasBaseField(UPB_UPCAST(msg), &field); |
Joshua Haberman | 7ecf43f | 2022-03-14 13:11:29 -0700 | [diff] [blame] | 7626 | } |
Mike Kruskal | 3bc5049 | 2022-12-01 13:34:12 -0800 | [diff] [blame] | 7627 | UPB_INLINE void google_protobuf_FieldDescriptorProto_clear_options(google_protobuf_FieldDescriptorProto* msg) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 7628 | 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 Bot | 4e90ead | 2024-01-08 15:46:34 +0000 | [diff] [blame] | 7629 | upb_Message_ClearBaseField(UPB_UPCAST(msg), &field); |
Joshua Haberman | d3995ec | 2022-09-30 16:54:39 -0700 | [diff] [blame] | 7630 | } |
Joshua Haberman | f41049a | 2022-01-21 14:41:25 -0800 | [diff] [blame] | 7631 | UPB_INLINE const google_protobuf_FieldOptions* google_protobuf_FieldDescriptorProto_options(const google_protobuf_FieldDescriptorProto* msg) { |
Eric Salo | 8809a11 | 2022-11-21 13:01:06 -0800 | [diff] [blame] | 7632 | const google_protobuf_FieldOptions* default_val = NULL; |
| 7633 | const google_protobuf_FieldOptions* ret; |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 7634 | 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 Bot | a9387b5 | 2024-06-12 15:17:52 +0000 | [diff] [blame] | 7635 | UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__FieldOptions_msg_init); |
Protobuf Team Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 7636 | _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field, |
| 7637 | &default_val, &ret); |
Eric Salo | 8809a11 | 2022-11-21 13:01:06 -0800 | [diff] [blame] | 7638 | return ret; |
Joshua Haberman | f41049a | 2022-01-21 14:41:25 -0800 | [diff] [blame] | 7639 | } |
Mike Kruskal | 3bc5049 | 2022-12-01 13:34:12 -0800 | [diff] [blame] | 7640 | UPB_INLINE bool google_protobuf_FieldDescriptorProto_has_options(const google_protobuf_FieldDescriptorProto* msg) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 7641 | 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 Bot | 8c1f635 | 2024-01-10 05:18:15 +0000 | [diff] [blame] | 7642 | return upb_Message_HasBaseField(UPB_UPCAST(msg), &field); |
Joshua Haberman | 7ecf43f | 2022-03-14 13:11:29 -0700 | [diff] [blame] | 7643 | } |
Mike Kruskal | 3bc5049 | 2022-12-01 13:34:12 -0800 | [diff] [blame] | 7644 | UPB_INLINE void google_protobuf_FieldDescriptorProto_clear_oneof_index(google_protobuf_FieldDescriptorProto* msg) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 7645 | 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 Bot | 4e90ead | 2024-01-08 15:46:34 +0000 | [diff] [blame] | 7646 | upb_Message_ClearBaseField(UPB_UPCAST(msg), &field); |
Joshua Haberman | d3995ec | 2022-09-30 16:54:39 -0700 | [diff] [blame] | 7647 | } |
Joshua Haberman | f41049a | 2022-01-21 14:41:25 -0800 | [diff] [blame] | 7648 | UPB_INLINE int32_t google_protobuf_FieldDescriptorProto_oneof_index(const google_protobuf_FieldDescriptorProto* msg) { |
Eric Salo | 8809a11 | 2022-11-21 13:01:06 -0800 | [diff] [blame] | 7649 | int32_t default_val = (int32_t)0; |
| 7650 | int32_t ret; |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 7651 | 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 Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 7652 | _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field, |
| 7653 | &default_val, &ret); |
Eric Salo | 8809a11 | 2022-11-21 13:01:06 -0800 | [diff] [blame] | 7654 | return ret; |
Joshua Haberman | f41049a | 2022-01-21 14:41:25 -0800 | [diff] [blame] | 7655 | } |
Mike Kruskal | 3bc5049 | 2022-12-01 13:34:12 -0800 | [diff] [blame] | 7656 | UPB_INLINE bool google_protobuf_FieldDescriptorProto_has_oneof_index(const google_protobuf_FieldDescriptorProto* msg) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 7657 | 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 Bot | 8c1f635 | 2024-01-10 05:18:15 +0000 | [diff] [blame] | 7658 | return upb_Message_HasBaseField(UPB_UPCAST(msg), &field); |
Joshua Haberman | 7ecf43f | 2022-03-14 13:11:29 -0700 | [diff] [blame] | 7659 | } |
Mike Kruskal | 3bc5049 | 2022-12-01 13:34:12 -0800 | [diff] [blame] | 7660 | UPB_INLINE void google_protobuf_FieldDescriptorProto_clear_json_name(google_protobuf_FieldDescriptorProto* msg) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 7661 | 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 Bot | 4e90ead | 2024-01-08 15:46:34 +0000 | [diff] [blame] | 7662 | upb_Message_ClearBaseField(UPB_UPCAST(msg), &field); |
Joshua Haberman | d3995ec | 2022-09-30 16:54:39 -0700 | [diff] [blame] | 7663 | } |
Joshua Haberman | f41049a | 2022-01-21 14:41:25 -0800 | [diff] [blame] | 7664 | UPB_INLINE upb_StringView google_protobuf_FieldDescriptorProto_json_name(const google_protobuf_FieldDescriptorProto* msg) { |
Eric Salo | 8809a11 | 2022-11-21 13:01:06 -0800 | [diff] [blame] | 7665 | upb_StringView default_val = upb_StringView_FromString(""); |
| 7666 | upb_StringView ret; |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 7667 | 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 Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 7668 | _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field, |
| 7669 | &default_val, &ret); |
Eric Salo | 8809a11 | 2022-11-21 13:01:06 -0800 | [diff] [blame] | 7670 | return ret; |
Joshua Haberman | f41049a | 2022-01-21 14:41:25 -0800 | [diff] [blame] | 7671 | } |
Mike Kruskal | 3bc5049 | 2022-12-01 13:34:12 -0800 | [diff] [blame] | 7672 | UPB_INLINE bool google_protobuf_FieldDescriptorProto_has_json_name(const google_protobuf_FieldDescriptorProto* msg) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 7673 | 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 Bot | 8c1f635 | 2024-01-10 05:18:15 +0000 | [diff] [blame] | 7674 | return upb_Message_HasBaseField(UPB_UPCAST(msg), &field); |
Joshua Haberman | 7ecf43f | 2022-03-14 13:11:29 -0700 | [diff] [blame] | 7675 | } |
Mike Kruskal | 3bc5049 | 2022-12-01 13:34:12 -0800 | [diff] [blame] | 7676 | UPB_INLINE void google_protobuf_FieldDescriptorProto_clear_proto3_optional(google_protobuf_FieldDescriptorProto* msg) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 7677 | 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 Bot | 4e90ead | 2024-01-08 15:46:34 +0000 | [diff] [blame] | 7678 | upb_Message_ClearBaseField(UPB_UPCAST(msg), &field); |
Joshua Haberman | d3995ec | 2022-09-30 16:54:39 -0700 | [diff] [blame] | 7679 | } |
Joshua Haberman | f41049a | 2022-01-21 14:41:25 -0800 | [diff] [blame] | 7680 | UPB_INLINE bool google_protobuf_FieldDescriptorProto_proto3_optional(const google_protobuf_FieldDescriptorProto* msg) { |
Eric Salo | 8809a11 | 2022-11-21 13:01:06 -0800 | [diff] [blame] | 7681 | bool default_val = false; |
| 7682 | bool ret; |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 7683 | 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 Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 7684 | _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field, |
| 7685 | &default_val, &ret); |
Eric Salo | 8809a11 | 2022-11-21 13:01:06 -0800 | [diff] [blame] | 7686 | return ret; |
Joshua Haberman | f41049a | 2022-01-21 14:41:25 -0800 | [diff] [blame] | 7687 | } |
Mike Kruskal | 3bc5049 | 2022-12-01 13:34:12 -0800 | [diff] [blame] | 7688 | UPB_INLINE bool google_protobuf_FieldDescriptorProto_has_proto3_optional(const google_protobuf_FieldDescriptorProto* msg) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 7689 | 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 Bot | 8c1f635 | 2024-01-10 05:18:15 +0000 | [diff] [blame] | 7690 | return upb_Message_HasBaseField(UPB_UPCAST(msg), &field); |
Mike Kruskal | 3bc5049 | 2022-12-01 13:34:12 -0800 | [diff] [blame] | 7691 | } |
Joshua Haberman | f41049a | 2022-01-21 14:41:25 -0800 | [diff] [blame] | 7692 | |
| 7693 | UPB_INLINE void google_protobuf_FieldDescriptorProto_set_name(google_protobuf_FieldDescriptorProto *msg, upb_StringView value) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 7694 | 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 Bot | ac32c97 | 2024-04-10 03:30:05 +0000 | [diff] [blame] | 7695 | upb_Message_SetBaseField((upb_Message *)msg, &field, &value); |
Mike Kruskal | 232ecf4 | 2023-01-14 00:09:40 -0800 | [diff] [blame] | 7696 | } |
| 7697 | UPB_INLINE void google_protobuf_FieldDescriptorProto_set_extendee(google_protobuf_FieldDescriptorProto *msg, upb_StringView value) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 7698 | 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 Bot | ac32c97 | 2024-04-10 03:30:05 +0000 | [diff] [blame] | 7699 | upb_Message_SetBaseField((upb_Message *)msg, &field, &value); |
Mike Kruskal | 232ecf4 | 2023-01-14 00:09:40 -0800 | [diff] [blame] | 7700 | } |
| 7701 | UPB_INLINE void google_protobuf_FieldDescriptorProto_set_number(google_protobuf_FieldDescriptorProto *msg, int32_t value) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 7702 | const upb_MiniTableField field = {3, 12, 66, kUpb_NoSub, 5, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; |
Protobuf Team Bot | ac32c97 | 2024-04-10 03:30:05 +0000 | [diff] [blame] | 7703 | upb_Message_SetBaseField((upb_Message *)msg, &field, &value); |
Mike Kruskal | 232ecf4 | 2023-01-14 00:09:40 -0800 | [diff] [blame] | 7704 | } |
| 7705 | UPB_INLINE void google_protobuf_FieldDescriptorProto_set_label(google_protobuf_FieldDescriptorProto *msg, int32_t value) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 7706 | const upb_MiniTableField field = {4, 16, 67, 1, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; |
Protobuf Team Bot | ac32c97 | 2024-04-10 03:30:05 +0000 | [diff] [blame] | 7707 | upb_Message_SetBaseField((upb_Message *)msg, &field, &value); |
Mike Kruskal | 232ecf4 | 2023-01-14 00:09:40 -0800 | [diff] [blame] | 7708 | } |
| 7709 | UPB_INLINE void google_protobuf_FieldDescriptorProto_set_type(google_protobuf_FieldDescriptorProto *msg, int32_t value) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 7710 | const upb_MiniTableField field = {5, 20, 68, 2, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; |
Protobuf Team Bot | ac32c97 | 2024-04-10 03:30:05 +0000 | [diff] [blame] | 7711 | upb_Message_SetBaseField((upb_Message *)msg, &field, &value); |
Mike Kruskal | 232ecf4 | 2023-01-14 00:09:40 -0800 | [diff] [blame] | 7712 | } |
| 7713 | UPB_INLINE void google_protobuf_FieldDescriptorProto_set_type_name(google_protobuf_FieldDescriptorProto *msg, upb_StringView value) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 7714 | 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 Bot | ac32c97 | 2024-04-10 03:30:05 +0000 | [diff] [blame] | 7715 | upb_Message_SetBaseField((upb_Message *)msg, &field, &value); |
Mike Kruskal | 232ecf4 | 2023-01-14 00:09:40 -0800 | [diff] [blame] | 7716 | } |
| 7717 | UPB_INLINE void google_protobuf_FieldDescriptorProto_set_default_value(google_protobuf_FieldDescriptorProto *msg, upb_StringView value) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 7718 | 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 Bot | ac32c97 | 2024-04-10 03:30:05 +0000 | [diff] [blame] | 7719 | upb_Message_SetBaseField((upb_Message *)msg, &field, &value); |
Mike Kruskal | 232ecf4 | 2023-01-14 00:09:40 -0800 | [diff] [blame] | 7720 | } |
| 7721 | UPB_INLINE void google_protobuf_FieldDescriptorProto_set_options(google_protobuf_FieldDescriptorProto *msg, google_protobuf_FieldOptions* value) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 7722 | 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 Bot | a9387b5 | 2024-06-12 15:17:52 +0000 | [diff] [blame] | 7723 | UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__FieldOptions_msg_init); |
Protobuf Team Bot | ac32c97 | 2024-04-10 03:30:05 +0000 | [diff] [blame] | 7724 | upb_Message_SetBaseField((upb_Message *)msg, &field, &value); |
Mike Kruskal | 232ecf4 | 2023-01-14 00:09:40 -0800 | [diff] [blame] | 7725 | } |
| 7726 | UPB_INLINE struct google_protobuf_FieldOptions* google_protobuf_FieldDescriptorProto_mutable_options(google_protobuf_FieldDescriptorProto* msg, upb_Arena* arena) { |
Joshua Haberman | 9abf6e2 | 2021-01-13 12:16:25 -0800 | [diff] [blame] | 7727 | struct google_protobuf_FieldOptions* sub = (struct google_protobuf_FieldOptions*)google_protobuf_FieldDescriptorProto_options(msg); |
| 7728 | if (sub == NULL) { |
Protobuf Team Bot | 4ffe086 | 2023-12-06 02:02:36 +0000 | [diff] [blame] | 7729 | sub = (struct google_protobuf_FieldOptions*)_upb_Message_New(&google__protobuf__FieldOptions_msg_init, arena); |
Eric Salo | 8809a11 | 2022-11-21 13:01:06 -0800 | [diff] [blame] | 7730 | if (sub) google_protobuf_FieldDescriptorProto_set_options(msg, sub); |
Joshua Haberman | 9abf6e2 | 2021-01-13 12:16:25 -0800 | [diff] [blame] | 7731 | } |
| 7732 | return sub; |
| 7733 | } |
| 7734 | UPB_INLINE void google_protobuf_FieldDescriptorProto_set_oneof_index(google_protobuf_FieldDescriptorProto *msg, int32_t value) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 7735 | 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 Bot | ac32c97 | 2024-04-10 03:30:05 +0000 | [diff] [blame] | 7736 | upb_Message_SetBaseField((upb_Message *)msg, &field, &value); |
Mike Kruskal | 232ecf4 | 2023-01-14 00:09:40 -0800 | [diff] [blame] | 7737 | } |
| 7738 | UPB_INLINE void google_protobuf_FieldDescriptorProto_set_json_name(google_protobuf_FieldDescriptorProto *msg, upb_StringView value) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 7739 | const upb_MiniTableField field = {10, UPB_SIZE(68, 104), 73, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; |
Protobuf Team Bot | ac32c97 | 2024-04-10 03:30:05 +0000 | [diff] [blame] | 7740 | upb_Message_SetBaseField((upb_Message *)msg, &field, &value); |
Mike Kruskal | 232ecf4 | 2023-01-14 00:09:40 -0800 | [diff] [blame] | 7741 | } |
| 7742 | UPB_INLINE void google_protobuf_FieldDescriptorProto_set_proto3_optional(google_protobuf_FieldDescriptorProto *msg, bool value) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 7743 | 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 Bot | ac32c97 | 2024-04-10 03:30:05 +0000 | [diff] [blame] | 7744 | upb_Message_SetBaseField((upb_Message *)msg, &field, &value); |
Joshua Haberman | 9abf6e2 | 2021-01-13 12:16:25 -0800 | [diff] [blame] | 7745 | } |
Mike Kruskal | 232ecf4 | 2023-01-14 00:09:40 -0800 | [diff] [blame] | 7746 | |
Joshua Haberman | 9abf6e2 | 2021-01-13 12:16:25 -0800 | [diff] [blame] | 7747 | /* google.protobuf.OneofDescriptorProto */ |
| 7748 | |
Joshua Haberman | f41049a | 2022-01-21 14:41:25 -0800 | [diff] [blame] | 7749 | UPB_INLINE google_protobuf_OneofDescriptorProto* google_protobuf_OneofDescriptorProto_new(upb_Arena* arena) { |
Protobuf Team Bot | 4ffe086 | 2023-12-06 02:02:36 +0000 | [diff] [blame] | 7750 | return (google_protobuf_OneofDescriptorProto*)_upb_Message_New(&google__protobuf__OneofDescriptorProto_msg_init, arena); |
Joshua Haberman | 9abf6e2 | 2021-01-13 12:16:25 -0800 | [diff] [blame] | 7751 | } |
Joshua Haberman | f41049a | 2022-01-21 14:41:25 -0800 | [diff] [blame] | 7752 | UPB_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 Haberman | 9d578a3 | 2021-08-02 15:32:01 -0700 | [diff] [blame] | 7754 | if (!ret) return NULL; |
Protobuf Team Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 7755 | if (upb_Decode(buf, size, UPB_UPCAST(ret), &google__protobuf__OneofDescriptorProto_msg_init, NULL, 0, arena) != |
| 7756 | kUpb_DecodeStatus_Ok) { |
Joshua Haberman | 9d578a3 | 2021-08-02 15:32:01 -0700 | [diff] [blame] | 7757 | return NULL; |
| 7758 | } |
| 7759 | return ret; |
Joshua Haberman | 9abf6e2 | 2021-01-13 12:16:25 -0800 | [diff] [blame] | 7760 | } |
Joshua Haberman | f41049a | 2022-01-21 14:41:25 -0800 | [diff] [blame] | 7761 | UPB_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 Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 7766 | if (upb_Decode(buf, size, UPB_UPCAST(ret), &google__protobuf__OneofDescriptorProto_msg_init, extreg, options, |
| 7767 | arena) != kUpb_DecodeStatus_Ok) { |
Joshua Haberman | f41049a | 2022-01-21 14:41:25 -0800 | [diff] [blame] | 7768 | return NULL; |
| 7769 | } |
| 7770 | return ret; |
| 7771 | } |
| 7772 | UPB_INLINE char* google_protobuf_OneofDescriptorProto_serialize(const google_protobuf_OneofDescriptorProto* msg, upb_Arena* arena, size_t* len) { |
Joshua Haberman | d3995ec | 2022-09-30 16:54:39 -0700 | [diff] [blame] | 7773 | char* ptr; |
Protobuf Team Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 7774 | (void)upb_Encode(UPB_UPCAST(msg), &google__protobuf__OneofDescriptorProto_msg_init, 0, arena, &ptr, len); |
Joshua Haberman | d3995ec | 2022-09-30 16:54:39 -0700 | [diff] [blame] | 7775 | return ptr; |
Joshua Haberman | f41049a | 2022-01-21 14:41:25 -0800 | [diff] [blame] | 7776 | } |
| 7777 | UPB_INLINE char* google_protobuf_OneofDescriptorProto_serialize_ex(const google_protobuf_OneofDescriptorProto* msg, int options, |
| 7778 | upb_Arena* arena, size_t* len) { |
Joshua Haberman | d3995ec | 2022-09-30 16:54:39 -0700 | [diff] [blame] | 7779 | char* ptr; |
Protobuf Team Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 7780 | (void)upb_Encode(UPB_UPCAST(msg), &google__protobuf__OneofDescriptorProto_msg_init, options, arena, &ptr, len); |
Joshua Haberman | d3995ec | 2022-09-30 16:54:39 -0700 | [diff] [blame] | 7781 | return ptr; |
Joshua Haberman | f41049a | 2022-01-21 14:41:25 -0800 | [diff] [blame] | 7782 | } |
Mike Kruskal | 3bc5049 | 2022-12-01 13:34:12 -0800 | [diff] [blame] | 7783 | UPB_INLINE void google_protobuf_OneofDescriptorProto_clear_name(google_protobuf_OneofDescriptorProto* msg) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 7784 | 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 Bot | 4e90ead | 2024-01-08 15:46:34 +0000 | [diff] [blame] | 7785 | upb_Message_ClearBaseField(UPB_UPCAST(msg), &field); |
Joshua Haberman | d3995ec | 2022-09-30 16:54:39 -0700 | [diff] [blame] | 7786 | } |
Joshua Haberman | f41049a | 2022-01-21 14:41:25 -0800 | [diff] [blame] | 7787 | UPB_INLINE upb_StringView google_protobuf_OneofDescriptorProto_name(const google_protobuf_OneofDescriptorProto* msg) { |
Eric Salo | 8809a11 | 2022-11-21 13:01:06 -0800 | [diff] [blame] | 7788 | upb_StringView default_val = upb_StringView_FromString(""); |
| 7789 | upb_StringView ret; |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 7790 | 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 Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 7791 | _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field, |
| 7792 | &default_val, &ret); |
Eric Salo | 8809a11 | 2022-11-21 13:01:06 -0800 | [diff] [blame] | 7793 | return ret; |
Joshua Haberman | f41049a | 2022-01-21 14:41:25 -0800 | [diff] [blame] | 7794 | } |
Mike Kruskal | 3bc5049 | 2022-12-01 13:34:12 -0800 | [diff] [blame] | 7795 | UPB_INLINE bool google_protobuf_OneofDescriptorProto_has_name(const google_protobuf_OneofDescriptorProto* msg) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 7796 | 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 Bot | 8c1f635 | 2024-01-10 05:18:15 +0000 | [diff] [blame] | 7797 | return upb_Message_HasBaseField(UPB_UPCAST(msg), &field); |
Joshua Haberman | 7ecf43f | 2022-03-14 13:11:29 -0700 | [diff] [blame] | 7798 | } |
Mike Kruskal | 3bc5049 | 2022-12-01 13:34:12 -0800 | [diff] [blame] | 7799 | UPB_INLINE void google_protobuf_OneofDescriptorProto_clear_options(google_protobuf_OneofDescriptorProto* msg) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 7800 | 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 Bot | 4e90ead | 2024-01-08 15:46:34 +0000 | [diff] [blame] | 7801 | upb_Message_ClearBaseField(UPB_UPCAST(msg), &field); |
Joshua Haberman | d3995ec | 2022-09-30 16:54:39 -0700 | [diff] [blame] | 7802 | } |
Joshua Haberman | f41049a | 2022-01-21 14:41:25 -0800 | [diff] [blame] | 7803 | UPB_INLINE const google_protobuf_OneofOptions* google_protobuf_OneofDescriptorProto_options(const google_protobuf_OneofDescriptorProto* msg) { |
Eric Salo | 8809a11 | 2022-11-21 13:01:06 -0800 | [diff] [blame] | 7804 | const google_protobuf_OneofOptions* default_val = NULL; |
| 7805 | const google_protobuf_OneofOptions* ret; |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 7806 | 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 Bot | a9387b5 | 2024-06-12 15:17:52 +0000 | [diff] [blame] | 7807 | UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__OneofOptions_msg_init); |
Protobuf Team Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 7808 | _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field, |
| 7809 | &default_val, &ret); |
Eric Salo | 8809a11 | 2022-11-21 13:01:06 -0800 | [diff] [blame] | 7810 | return ret; |
Joshua Haberman | 9abf6e2 | 2021-01-13 12:16:25 -0800 | [diff] [blame] | 7811 | } |
Mike Kruskal | 3bc5049 | 2022-12-01 13:34:12 -0800 | [diff] [blame] | 7812 | UPB_INLINE bool google_protobuf_OneofDescriptorProto_has_options(const google_protobuf_OneofDescriptorProto* msg) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 7813 | 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 Bot | 8c1f635 | 2024-01-10 05:18:15 +0000 | [diff] [blame] | 7814 | return upb_Message_HasBaseField(UPB_UPCAST(msg), &field); |
Mike Kruskal | 3bc5049 | 2022-12-01 13:34:12 -0800 | [diff] [blame] | 7815 | } |
Joshua Haberman | 9abf6e2 | 2021-01-13 12:16:25 -0800 | [diff] [blame] | 7816 | |
Joshua Haberman | f41049a | 2022-01-21 14:41:25 -0800 | [diff] [blame] | 7817 | UPB_INLINE void google_protobuf_OneofDescriptorProto_set_name(google_protobuf_OneofDescriptorProto *msg, upb_StringView value) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 7818 | 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 Bot | ac32c97 | 2024-04-10 03:30:05 +0000 | [diff] [blame] | 7819 | upb_Message_SetBaseField((upb_Message *)msg, &field, &value); |
Mike Kruskal | 232ecf4 | 2023-01-14 00:09:40 -0800 | [diff] [blame] | 7820 | } |
| 7821 | UPB_INLINE void google_protobuf_OneofDescriptorProto_set_options(google_protobuf_OneofDescriptorProto *msg, google_protobuf_OneofOptions* value) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 7822 | 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 Bot | a9387b5 | 2024-06-12 15:17:52 +0000 | [diff] [blame] | 7823 | UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__OneofOptions_msg_init); |
Protobuf Team Bot | ac32c97 | 2024-04-10 03:30:05 +0000 | [diff] [blame] | 7824 | upb_Message_SetBaseField((upb_Message *)msg, &field, &value); |
Mike Kruskal | 232ecf4 | 2023-01-14 00:09:40 -0800 | [diff] [blame] | 7825 | } |
| 7826 | UPB_INLINE struct google_protobuf_OneofOptions* google_protobuf_OneofDescriptorProto_mutable_options(google_protobuf_OneofDescriptorProto* msg, upb_Arena* arena) { |
Joshua Haberman | 9abf6e2 | 2021-01-13 12:16:25 -0800 | [diff] [blame] | 7827 | struct google_protobuf_OneofOptions* sub = (struct google_protobuf_OneofOptions*)google_protobuf_OneofDescriptorProto_options(msg); |
| 7828 | if (sub == NULL) { |
Protobuf Team Bot | 4ffe086 | 2023-12-06 02:02:36 +0000 | [diff] [blame] | 7829 | sub = (struct google_protobuf_OneofOptions*)_upb_Message_New(&google__protobuf__OneofOptions_msg_init, arena); |
Eric Salo | 8809a11 | 2022-11-21 13:01:06 -0800 | [diff] [blame] | 7830 | if (sub) google_protobuf_OneofDescriptorProto_set_options(msg, sub); |
Joshua Haberman | 9abf6e2 | 2021-01-13 12:16:25 -0800 | [diff] [blame] | 7831 | } |
| 7832 | return sub; |
| 7833 | } |
| 7834 | |
| 7835 | /* google.protobuf.EnumDescriptorProto */ |
| 7836 | |
Joshua Haberman | f41049a | 2022-01-21 14:41:25 -0800 | [diff] [blame] | 7837 | UPB_INLINE google_protobuf_EnumDescriptorProto* google_protobuf_EnumDescriptorProto_new(upb_Arena* arena) { |
Protobuf Team Bot | 4ffe086 | 2023-12-06 02:02:36 +0000 | [diff] [blame] | 7838 | return (google_protobuf_EnumDescriptorProto*)_upb_Message_New(&google__protobuf__EnumDescriptorProto_msg_init, arena); |
Joshua Haberman | 9abf6e2 | 2021-01-13 12:16:25 -0800 | [diff] [blame] | 7839 | } |
Joshua Haberman | f41049a | 2022-01-21 14:41:25 -0800 | [diff] [blame] | 7840 | UPB_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 Haberman | 9d578a3 | 2021-08-02 15:32:01 -0700 | [diff] [blame] | 7842 | if (!ret) return NULL; |
Protobuf Team Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 7843 | if (upb_Decode(buf, size, UPB_UPCAST(ret), &google__protobuf__EnumDescriptorProto_msg_init, NULL, 0, arena) != |
| 7844 | kUpb_DecodeStatus_Ok) { |
Joshua Haberman | 9d578a3 | 2021-08-02 15:32:01 -0700 | [diff] [blame] | 7845 | return NULL; |
| 7846 | } |
| 7847 | return ret; |
Joshua Haberman | 9abf6e2 | 2021-01-13 12:16:25 -0800 | [diff] [blame] | 7848 | } |
Joshua Haberman | f41049a | 2022-01-21 14:41:25 -0800 | [diff] [blame] | 7849 | UPB_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 Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 7854 | if (upb_Decode(buf, size, UPB_UPCAST(ret), &google__protobuf__EnumDescriptorProto_msg_init, extreg, options, |
| 7855 | arena) != kUpb_DecodeStatus_Ok) { |
Joshua Haberman | f41049a | 2022-01-21 14:41:25 -0800 | [diff] [blame] | 7856 | return NULL; |
| 7857 | } |
| 7858 | return ret; |
Joshua Haberman | 9abf6e2 | 2021-01-13 12:16:25 -0800 | [diff] [blame] | 7859 | } |
Joshua Haberman | f41049a | 2022-01-21 14:41:25 -0800 | [diff] [blame] | 7860 | UPB_INLINE char* google_protobuf_EnumDescriptorProto_serialize(const google_protobuf_EnumDescriptorProto* msg, upb_Arena* arena, size_t* len) { |
Joshua Haberman | d3995ec | 2022-09-30 16:54:39 -0700 | [diff] [blame] | 7861 | char* ptr; |
Protobuf Team Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 7862 | (void)upb_Encode(UPB_UPCAST(msg), &google__protobuf__EnumDescriptorProto_msg_init, 0, arena, &ptr, len); |
Joshua Haberman | d3995ec | 2022-09-30 16:54:39 -0700 | [diff] [blame] | 7863 | return ptr; |
Joshua Haberman | f41049a | 2022-01-21 14:41:25 -0800 | [diff] [blame] | 7864 | } |
| 7865 | UPB_INLINE char* google_protobuf_EnumDescriptorProto_serialize_ex(const google_protobuf_EnumDescriptorProto* msg, int options, |
| 7866 | upb_Arena* arena, size_t* len) { |
Joshua Haberman | d3995ec | 2022-09-30 16:54:39 -0700 | [diff] [blame] | 7867 | char* ptr; |
Protobuf Team Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 7868 | (void)upb_Encode(UPB_UPCAST(msg), &google__protobuf__EnumDescriptorProto_msg_init, options, arena, &ptr, len); |
Joshua Haberman | d3995ec | 2022-09-30 16:54:39 -0700 | [diff] [blame] | 7869 | return ptr; |
Joshua Haberman | f41049a | 2022-01-21 14:41:25 -0800 | [diff] [blame] | 7870 | } |
Mike Kruskal | 3bc5049 | 2022-12-01 13:34:12 -0800 | [diff] [blame] | 7871 | UPB_INLINE void google_protobuf_EnumDescriptorProto_clear_name(google_protobuf_EnumDescriptorProto* msg) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 7872 | 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 Bot | 4e90ead | 2024-01-08 15:46:34 +0000 | [diff] [blame] | 7873 | upb_Message_ClearBaseField(UPB_UPCAST(msg), &field); |
Joshua Haberman | d3995ec | 2022-09-30 16:54:39 -0700 | [diff] [blame] | 7874 | } |
Joshua Haberman | f41049a | 2022-01-21 14:41:25 -0800 | [diff] [blame] | 7875 | UPB_INLINE upb_StringView google_protobuf_EnumDescriptorProto_name(const google_protobuf_EnumDescriptorProto* msg) { |
Eric Salo | 8809a11 | 2022-11-21 13:01:06 -0800 | [diff] [blame] | 7876 | upb_StringView default_val = upb_StringView_FromString(""); |
| 7877 | upb_StringView ret; |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 7878 | 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 Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 7879 | _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field, |
| 7880 | &default_val, &ret); |
Eric Salo | 8809a11 | 2022-11-21 13:01:06 -0800 | [diff] [blame] | 7881 | return ret; |
Joshua Haberman | f41049a | 2022-01-21 14:41:25 -0800 | [diff] [blame] | 7882 | } |
Mike Kruskal | 3bc5049 | 2022-12-01 13:34:12 -0800 | [diff] [blame] | 7883 | UPB_INLINE bool google_protobuf_EnumDescriptorProto_has_name(const google_protobuf_EnumDescriptorProto* msg) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 7884 | 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 Bot | 8c1f635 | 2024-01-10 05:18:15 +0000 | [diff] [blame] | 7885 | return upb_Message_HasBaseField(UPB_UPCAST(msg), &field); |
Joshua Haberman | d3995ec | 2022-09-30 16:54:39 -0700 | [diff] [blame] | 7886 | } |
Mike Kruskal | 3bc5049 | 2022-12-01 13:34:12 -0800 | [diff] [blame] | 7887 | UPB_INLINE void google_protobuf_EnumDescriptorProto_clear_value(google_protobuf_EnumDescriptorProto* msg) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 7888 | 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 Bot | 4e90ead | 2024-01-08 15:46:34 +0000 | [diff] [blame] | 7889 | upb_Message_ClearBaseField(UPB_UPCAST(msg), &field); |
Joshua Haberman | 7ecf43f | 2022-03-14 13:11:29 -0700 | [diff] [blame] | 7890 | } |
Eric Salo | b7d54ac | 2022-12-29 11:59:42 -0800 | [diff] [blame] | 7891 | UPB_INLINE const google_protobuf_EnumValueDescriptorProto* const* google_protobuf_EnumDescriptorProto_value(const google_protobuf_EnumDescriptorProto* msg, size_t* size) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 7892 | 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 Bot | a9387b5 | 2024-06-12 15:17:52 +0000 | [diff] [blame] | 7893 | UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__EnumValueDescriptorProto_msg_init); |
Protobuf Team Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 7894 | const upb_Array* arr = upb_Message_GetArray(UPB_UPCAST(msg), &field); |
Eric Salo | b7d54ac | 2022-12-29 11:59:42 -0800 | [diff] [blame] | 7895 | if (arr) { |
Protobuf Team Bot | f73985a | 2023-12-19 00:14:19 +0000 | [diff] [blame] | 7896 | if (size) *size = arr->UPB_PRIVATE(size); |
Protobuf Team Bot | 81e5433 | 2024-01-11 21:04:07 +0000 | [diff] [blame] | 7897 | return (const google_protobuf_EnumValueDescriptorProto* const*)upb_Array_DataPtr(arr); |
Eric Salo | b7d54ac | 2022-12-29 11:59:42 -0800 | [diff] [blame] | 7898 | } else { |
| 7899 | if (size) *size = 0; |
| 7900 | return NULL; |
| 7901 | } |
Joshua Haberman | 7ecf43f | 2022-03-14 13:11:29 -0700 | [diff] [blame] | 7902 | } |
Deanna Garcia | b26afb5 | 2023-04-25 13:37:18 -0700 | [diff] [blame] | 7903 | UPB_INLINE const upb_Array* _google_protobuf_EnumDescriptorProto_value_upb_array(const google_protobuf_EnumDescriptorProto* msg, size_t* size) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 7904 | 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 Bot | a9387b5 | 2024-06-12 15:17:52 +0000 | [diff] [blame] | 7905 | UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__EnumValueDescriptorProto_msg_init); |
Protobuf Team Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 7906 | const upb_Array* arr = upb_Message_GetArray(UPB_UPCAST(msg), &field); |
Deanna Garcia | b26afb5 | 2023-04-25 13:37:18 -0700 | [diff] [blame] | 7907 | if (size) { |
Protobuf Team Bot | f73985a | 2023-12-19 00:14:19 +0000 | [diff] [blame] | 7908 | *size = arr ? arr->UPB_PRIVATE(size) : 0; |
Deanna Garcia | b26afb5 | 2023-04-25 13:37:18 -0700 | [diff] [blame] | 7909 | } |
| 7910 | return arr; |
| 7911 | } |
Protobuf Team Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 7912 | UPB_INLINE upb_Array* _google_protobuf_EnumDescriptorProto_value_mutable_upb_array(google_protobuf_EnumDescriptorProto* msg, size_t* size, upb_Arena* arena) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 7913 | 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 Bot | a9387b5 | 2024-06-12 15:17:52 +0000 | [diff] [blame] | 7914 | UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__EnumValueDescriptorProto_msg_init); |
Protobuf Team Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 7915 | upb_Array* arr = upb_Message_GetOrCreateMutableArray(UPB_UPCAST(msg), |
| 7916 | &field, arena); |
Deanna Garcia | b26afb5 | 2023-04-25 13:37:18 -0700 | [diff] [blame] | 7917 | if (size) { |
Protobuf Team Bot | f73985a | 2023-12-19 00:14:19 +0000 | [diff] [blame] | 7918 | *size = arr ? arr->UPB_PRIVATE(size) : 0; |
Deanna Garcia | b26afb5 | 2023-04-25 13:37:18 -0700 | [diff] [blame] | 7919 | } |
| 7920 | return arr; |
| 7921 | } |
Mike Kruskal | 3bc5049 | 2022-12-01 13:34:12 -0800 | [diff] [blame] | 7922 | UPB_INLINE void google_protobuf_EnumDescriptorProto_clear_options(google_protobuf_EnumDescriptorProto* msg) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 7923 | 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 Bot | 4e90ead | 2024-01-08 15:46:34 +0000 | [diff] [blame] | 7924 | upb_Message_ClearBaseField(UPB_UPCAST(msg), &field); |
Joshua Haberman | d3995ec | 2022-09-30 16:54:39 -0700 | [diff] [blame] | 7925 | } |
Joshua Haberman | f41049a | 2022-01-21 14:41:25 -0800 | [diff] [blame] | 7926 | UPB_INLINE const google_protobuf_EnumOptions* google_protobuf_EnumDescriptorProto_options(const google_protobuf_EnumDescriptorProto* msg) { |
Eric Salo | 8809a11 | 2022-11-21 13:01:06 -0800 | [diff] [blame] | 7927 | const google_protobuf_EnumOptions* default_val = NULL; |
| 7928 | const google_protobuf_EnumOptions* ret; |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 7929 | 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 Bot | a9387b5 | 2024-06-12 15:17:52 +0000 | [diff] [blame] | 7930 | UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__EnumOptions_msg_init); |
Protobuf Team Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 7931 | _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field, |
| 7932 | &default_val, &ret); |
Eric Salo | 8809a11 | 2022-11-21 13:01:06 -0800 | [diff] [blame] | 7933 | return ret; |
Joshua Haberman | f41049a | 2022-01-21 14:41:25 -0800 | [diff] [blame] | 7934 | } |
Mike Kruskal | 3bc5049 | 2022-12-01 13:34:12 -0800 | [diff] [blame] | 7935 | UPB_INLINE bool google_protobuf_EnumDescriptorProto_has_options(const google_protobuf_EnumDescriptorProto* msg) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 7936 | 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 Bot | 8c1f635 | 2024-01-10 05:18:15 +0000 | [diff] [blame] | 7937 | return upb_Message_HasBaseField(UPB_UPCAST(msg), &field); |
Joshua Haberman | 7ecf43f | 2022-03-14 13:11:29 -0700 | [diff] [blame] | 7938 | } |
Mike Kruskal | 3bc5049 | 2022-12-01 13:34:12 -0800 | [diff] [blame] | 7939 | UPB_INLINE void google_protobuf_EnumDescriptorProto_clear_reserved_range(google_protobuf_EnumDescriptorProto* msg) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 7940 | 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 Bot | 4e90ead | 2024-01-08 15:46:34 +0000 | [diff] [blame] | 7941 | upb_Message_ClearBaseField(UPB_UPCAST(msg), &field); |
Joshua Haberman | d3995ec | 2022-09-30 16:54:39 -0700 | [diff] [blame] | 7942 | } |
Eric Salo | b7d54ac | 2022-12-29 11:59:42 -0800 | [diff] [blame] | 7943 | UPB_INLINE const google_protobuf_EnumDescriptorProto_EnumReservedRange* const* google_protobuf_EnumDescriptorProto_reserved_range(const google_protobuf_EnumDescriptorProto* msg, size_t* size) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 7944 | 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 Bot | a9387b5 | 2024-06-12 15:17:52 +0000 | [diff] [blame] | 7945 | UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__EnumDescriptorProto__EnumReservedRange_msg_init); |
Protobuf Team Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 7946 | const upb_Array* arr = upb_Message_GetArray(UPB_UPCAST(msg), &field); |
Eric Salo | b7d54ac | 2022-12-29 11:59:42 -0800 | [diff] [blame] | 7947 | if (arr) { |
Protobuf Team Bot | f73985a | 2023-12-19 00:14:19 +0000 | [diff] [blame] | 7948 | if (size) *size = arr->UPB_PRIVATE(size); |
Protobuf Team Bot | 81e5433 | 2024-01-11 21:04:07 +0000 | [diff] [blame] | 7949 | return (const google_protobuf_EnumDescriptorProto_EnumReservedRange* const*)upb_Array_DataPtr(arr); |
Eric Salo | b7d54ac | 2022-12-29 11:59:42 -0800 | [diff] [blame] | 7950 | } else { |
| 7951 | if (size) *size = 0; |
| 7952 | return NULL; |
| 7953 | } |
Joshua Haberman | 7ecf43f | 2022-03-14 13:11:29 -0700 | [diff] [blame] | 7954 | } |
Deanna Garcia | b26afb5 | 2023-04-25 13:37:18 -0700 | [diff] [blame] | 7955 | UPB_INLINE const upb_Array* _google_protobuf_EnumDescriptorProto_reserved_range_upb_array(const google_protobuf_EnumDescriptorProto* msg, size_t* size) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 7956 | 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 Bot | a9387b5 | 2024-06-12 15:17:52 +0000 | [diff] [blame] | 7957 | UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__EnumDescriptorProto__EnumReservedRange_msg_init); |
Protobuf Team Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 7958 | const upb_Array* arr = upb_Message_GetArray(UPB_UPCAST(msg), &field); |
Deanna Garcia | b26afb5 | 2023-04-25 13:37:18 -0700 | [diff] [blame] | 7959 | if (size) { |
Protobuf Team Bot | f73985a | 2023-12-19 00:14:19 +0000 | [diff] [blame] | 7960 | *size = arr ? arr->UPB_PRIVATE(size) : 0; |
Deanna Garcia | b26afb5 | 2023-04-25 13:37:18 -0700 | [diff] [blame] | 7961 | } |
| 7962 | return arr; |
| 7963 | } |
Protobuf Team Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 7964 | UPB_INLINE upb_Array* _google_protobuf_EnumDescriptorProto_reserved_range_mutable_upb_array(google_protobuf_EnumDescriptorProto* msg, size_t* size, upb_Arena* arena) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 7965 | 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 Bot | a9387b5 | 2024-06-12 15:17:52 +0000 | [diff] [blame] | 7966 | UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__EnumDescriptorProto__EnumReservedRange_msg_init); |
Protobuf Team Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 7967 | upb_Array* arr = upb_Message_GetOrCreateMutableArray(UPB_UPCAST(msg), |
| 7968 | &field, arena); |
Deanna Garcia | b26afb5 | 2023-04-25 13:37:18 -0700 | [diff] [blame] | 7969 | if (size) { |
Protobuf Team Bot | f73985a | 2023-12-19 00:14:19 +0000 | [diff] [blame] | 7970 | *size = arr ? arr->UPB_PRIVATE(size) : 0; |
Deanna Garcia | b26afb5 | 2023-04-25 13:37:18 -0700 | [diff] [blame] | 7971 | } |
| 7972 | return arr; |
| 7973 | } |
Mike Kruskal | 3bc5049 | 2022-12-01 13:34:12 -0800 | [diff] [blame] | 7974 | UPB_INLINE void google_protobuf_EnumDescriptorProto_clear_reserved_name(google_protobuf_EnumDescriptorProto* msg) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 7975 | 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 Bot | 4e90ead | 2024-01-08 15:46:34 +0000 | [diff] [blame] | 7976 | upb_Message_ClearBaseField(UPB_UPCAST(msg), &field); |
Joshua Haberman | d3995ec | 2022-09-30 16:54:39 -0700 | [diff] [blame] | 7977 | } |
Eric Salo | b7d54ac | 2022-12-29 11:59:42 -0800 | [diff] [blame] | 7978 | UPB_INLINE upb_StringView const* google_protobuf_EnumDescriptorProto_reserved_name(const google_protobuf_EnumDescriptorProto* msg, size_t* size) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 7979 | 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 Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 7980 | const upb_Array* arr = upb_Message_GetArray(UPB_UPCAST(msg), &field); |
Eric Salo | b7d54ac | 2022-12-29 11:59:42 -0800 | [diff] [blame] | 7981 | if (arr) { |
Protobuf Team Bot | f73985a | 2023-12-19 00:14:19 +0000 | [diff] [blame] | 7982 | if (size) *size = arr->UPB_PRIVATE(size); |
Protobuf Team Bot | 81e5433 | 2024-01-11 21:04:07 +0000 | [diff] [blame] | 7983 | return (upb_StringView const*)upb_Array_DataPtr(arr); |
Eric Salo | b7d54ac | 2022-12-29 11:59:42 -0800 | [diff] [blame] | 7984 | } else { |
| 7985 | if (size) *size = 0; |
| 7986 | return NULL; |
| 7987 | } |
Joshua Haberman | 7ecf43f | 2022-03-14 13:11:29 -0700 | [diff] [blame] | 7988 | } |
Deanna Garcia | b26afb5 | 2023-04-25 13:37:18 -0700 | [diff] [blame] | 7989 | UPB_INLINE const upb_Array* _google_protobuf_EnumDescriptorProto_reserved_name_upb_array(const google_protobuf_EnumDescriptorProto* msg, size_t* size) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 7990 | 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 Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 7991 | const upb_Array* arr = upb_Message_GetArray(UPB_UPCAST(msg), &field); |
Deanna Garcia | b26afb5 | 2023-04-25 13:37:18 -0700 | [diff] [blame] | 7992 | if (size) { |
Protobuf Team Bot | f73985a | 2023-12-19 00:14:19 +0000 | [diff] [blame] | 7993 | *size = arr ? arr->UPB_PRIVATE(size) : 0; |
Deanna Garcia | b26afb5 | 2023-04-25 13:37:18 -0700 | [diff] [blame] | 7994 | } |
| 7995 | return arr; |
| 7996 | } |
Protobuf Team Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 7997 | UPB_INLINE upb_Array* _google_protobuf_EnumDescriptorProto_reserved_name_mutable_upb_array(google_protobuf_EnumDescriptorProto* msg, size_t* size, upb_Arena* arena) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 7998 | 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 Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 7999 | upb_Array* arr = upb_Message_GetOrCreateMutableArray(UPB_UPCAST(msg), |
| 8000 | &field, arena); |
Deanna Garcia | b26afb5 | 2023-04-25 13:37:18 -0700 | [diff] [blame] | 8001 | if (size) { |
Protobuf Team Bot | f73985a | 2023-12-19 00:14:19 +0000 | [diff] [blame] | 8002 | *size = arr ? arr->UPB_PRIVATE(size) : 0; |
Deanna Garcia | b26afb5 | 2023-04-25 13:37:18 -0700 | [diff] [blame] | 8003 | } |
| 8004 | return arr; |
| 8005 | } |
Joshua Haberman | 9abf6e2 | 2021-01-13 12:16:25 -0800 | [diff] [blame] | 8006 | |
Joshua Haberman | f41049a | 2022-01-21 14:41:25 -0800 | [diff] [blame] | 8007 | UPB_INLINE void google_protobuf_EnumDescriptorProto_set_name(google_protobuf_EnumDescriptorProto *msg, upb_StringView value) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 8008 | 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 Bot | ac32c97 | 2024-04-10 03:30:05 +0000 | [diff] [blame] | 8009 | upb_Message_SetBaseField((upb_Message *)msg, &field, &value); |
Mike Kruskal | 232ecf4 | 2023-01-14 00:09:40 -0800 | [diff] [blame] | 8010 | } |
| 8011 | UPB_INLINE google_protobuf_EnumValueDescriptorProto** google_protobuf_EnumDescriptorProto_mutable_value(google_protobuf_EnumDescriptorProto* msg, size_t* size) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 8012 | 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 Bot | a9387b5 | 2024-06-12 15:17:52 +0000 | [diff] [blame] | 8013 | UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__EnumValueDescriptorProto_msg_init); |
Protobuf Team Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 8014 | upb_Array* arr = upb_Message_GetMutableArray(UPB_UPCAST(msg), &field); |
Eric Salo | b7d54ac | 2022-12-29 11:59:42 -0800 | [diff] [blame] | 8015 | if (arr) { |
Protobuf Team Bot | f73985a | 2023-12-19 00:14:19 +0000 | [diff] [blame] | 8016 | if (size) *size = arr->UPB_PRIVATE(size); |
Protobuf Team Bot | 81e5433 | 2024-01-11 21:04:07 +0000 | [diff] [blame] | 8017 | return (google_protobuf_EnumValueDescriptorProto**)upb_Array_MutableDataPtr(arr); |
Eric Salo | b7d54ac | 2022-12-29 11:59:42 -0800 | [diff] [blame] | 8018 | } else { |
| 8019 | if (size) *size = 0; |
| 8020 | return NULL; |
| 8021 | } |
Joshua Haberman | 9abf6e2 | 2021-01-13 12:16:25 -0800 | [diff] [blame] | 8022 | } |
Eric Salo | b7d54ac | 2022-12-29 11:59:42 -0800 | [diff] [blame] | 8023 | UPB_INLINE google_protobuf_EnumValueDescriptorProto** google_protobuf_EnumDescriptorProto_resize_value(google_protobuf_EnumDescriptorProto* msg, size_t size, upb_Arena* arena) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 8024 | 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 Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 8025 | return (google_protobuf_EnumValueDescriptorProto**)upb_Message_ResizeArrayUninitialized(UPB_UPCAST(msg), |
| 8026 | &field, size, arena); |
Joshua Haberman | 9abf6e2 | 2021-01-13 12:16:25 -0800 | [diff] [blame] | 8027 | } |
Joshua Haberman | 7ecf43f | 2022-03-14 13:11:29 -0700 | [diff] [blame] | 8028 | UPB_INLINE struct google_protobuf_EnumValueDescriptorProto* google_protobuf_EnumDescriptorProto_add_value(google_protobuf_EnumDescriptorProto* msg, upb_Arena* arena) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 8029 | 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 Bot | a9387b5 | 2024-06-12 15:17:52 +0000 | [diff] [blame] | 8030 | UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__EnumValueDescriptorProto_msg_init); |
Protobuf Team Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 8031 | upb_Array* arr = upb_Message_GetOrCreateMutableArray( |
| 8032 | UPB_UPCAST(msg), &field, arena); |
Protobuf Team Bot | 81e5433 | 2024-01-11 21:04:07 +0000 | [diff] [blame] | 8033 | if (!arr || !UPB_PRIVATE(_upb_Array_ResizeUninitialized)( |
Protobuf Team Bot | f73985a | 2023-12-19 00:14:19 +0000 | [diff] [blame] | 8034 | arr, arr->UPB_PRIVATE(size) + 1, arena)) { |
Eric Salo | b7d54ac | 2022-12-29 11:59:42 -0800 | [diff] [blame] | 8035 | return NULL; |
| 8036 | } |
Protobuf Team Bot | 4ffe086 | 2023-12-06 02:02:36 +0000 | [diff] [blame] | 8037 | struct google_protobuf_EnumValueDescriptorProto* sub = (struct google_protobuf_EnumValueDescriptorProto*)_upb_Message_New(&google__protobuf__EnumValueDescriptorProto_msg_init, arena); |
Eric Salo | b7d54ac | 2022-12-29 11:59:42 -0800 | [diff] [blame] | 8038 | if (!arr || !sub) return NULL; |
Protobuf Team Bot | f73985a | 2023-12-19 00:14:19 +0000 | [diff] [blame] | 8039 | UPB_PRIVATE(_upb_Array_Set) |
| 8040 | (arr, arr->UPB_PRIVATE(size) - 1, &sub, sizeof(sub)); |
Joshua Haberman | 9abf6e2 | 2021-01-13 12:16:25 -0800 | [diff] [blame] | 8041 | return sub; |
| 8042 | } |
| 8043 | UPB_INLINE void google_protobuf_EnumDescriptorProto_set_options(google_protobuf_EnumDescriptorProto *msg, google_protobuf_EnumOptions* value) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 8044 | 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 Bot | a9387b5 | 2024-06-12 15:17:52 +0000 | [diff] [blame] | 8045 | UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__EnumOptions_msg_init); |
Protobuf Team Bot | ac32c97 | 2024-04-10 03:30:05 +0000 | [diff] [blame] | 8046 | upb_Message_SetBaseField((upb_Message *)msg, &field, &value); |
Mike Kruskal | 232ecf4 | 2023-01-14 00:09:40 -0800 | [diff] [blame] | 8047 | } |
| 8048 | UPB_INLINE struct google_protobuf_EnumOptions* google_protobuf_EnumDescriptorProto_mutable_options(google_protobuf_EnumDescriptorProto* msg, upb_Arena* arena) { |
Joshua Haberman | 9abf6e2 | 2021-01-13 12:16:25 -0800 | [diff] [blame] | 8049 | struct google_protobuf_EnumOptions* sub = (struct google_protobuf_EnumOptions*)google_protobuf_EnumDescriptorProto_options(msg); |
| 8050 | if (sub == NULL) { |
Protobuf Team Bot | 4ffe086 | 2023-12-06 02:02:36 +0000 | [diff] [blame] | 8051 | sub = (struct google_protobuf_EnumOptions*)_upb_Message_New(&google__protobuf__EnumOptions_msg_init, arena); |
Eric Salo | 8809a11 | 2022-11-21 13:01:06 -0800 | [diff] [blame] | 8052 | if (sub) google_protobuf_EnumDescriptorProto_set_options(msg, sub); |
Joshua Haberman | 9abf6e2 | 2021-01-13 12:16:25 -0800 | [diff] [blame] | 8053 | } |
| 8054 | return sub; |
| 8055 | } |
Eric Salo | b7d54ac | 2022-12-29 11:59:42 -0800 | [diff] [blame] | 8056 | UPB_INLINE google_protobuf_EnumDescriptorProto_EnumReservedRange** google_protobuf_EnumDescriptorProto_mutable_reserved_range(google_protobuf_EnumDescriptorProto* msg, size_t* size) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 8057 | 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 Bot | a9387b5 | 2024-06-12 15:17:52 +0000 | [diff] [blame] | 8058 | UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__EnumDescriptorProto__EnumReservedRange_msg_init); |
Protobuf Team Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 8059 | upb_Array* arr = upb_Message_GetMutableArray(UPB_UPCAST(msg), &field); |
Eric Salo | b7d54ac | 2022-12-29 11:59:42 -0800 | [diff] [blame] | 8060 | if (arr) { |
Protobuf Team Bot | f73985a | 2023-12-19 00:14:19 +0000 | [diff] [blame] | 8061 | if (size) *size = arr->UPB_PRIVATE(size); |
Protobuf Team Bot | 81e5433 | 2024-01-11 21:04:07 +0000 | [diff] [blame] | 8062 | return (google_protobuf_EnumDescriptorProto_EnumReservedRange**)upb_Array_MutableDataPtr(arr); |
Eric Salo | b7d54ac | 2022-12-29 11:59:42 -0800 | [diff] [blame] | 8063 | } else { |
| 8064 | if (size) *size = 0; |
| 8065 | return NULL; |
| 8066 | } |
Joshua Haberman | 9abf6e2 | 2021-01-13 12:16:25 -0800 | [diff] [blame] | 8067 | } |
Eric Salo | b7d54ac | 2022-12-29 11:59:42 -0800 | [diff] [blame] | 8068 | UPB_INLINE google_protobuf_EnumDescriptorProto_EnumReservedRange** google_protobuf_EnumDescriptorProto_resize_reserved_range(google_protobuf_EnumDescriptorProto* msg, size_t size, upb_Arena* arena) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 8069 | 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 Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 8070 | return (google_protobuf_EnumDescriptorProto_EnumReservedRange**)upb_Message_ResizeArrayUninitialized(UPB_UPCAST(msg), |
| 8071 | &field, size, arena); |
Joshua Haberman | 9abf6e2 | 2021-01-13 12:16:25 -0800 | [diff] [blame] | 8072 | } |
Joshua Haberman | 7ecf43f | 2022-03-14 13:11:29 -0700 | [diff] [blame] | 8073 | UPB_INLINE struct google_protobuf_EnumDescriptorProto_EnumReservedRange* google_protobuf_EnumDescriptorProto_add_reserved_range(google_protobuf_EnumDescriptorProto* msg, upb_Arena* arena) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 8074 | 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 Bot | a9387b5 | 2024-06-12 15:17:52 +0000 | [diff] [blame] | 8075 | UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__EnumDescriptorProto__EnumReservedRange_msg_init); |
Protobuf Team Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 8076 | upb_Array* arr = upb_Message_GetOrCreateMutableArray( |
| 8077 | UPB_UPCAST(msg), &field, arena); |
Protobuf Team Bot | 81e5433 | 2024-01-11 21:04:07 +0000 | [diff] [blame] | 8078 | if (!arr || !UPB_PRIVATE(_upb_Array_ResizeUninitialized)( |
Protobuf Team Bot | f73985a | 2023-12-19 00:14:19 +0000 | [diff] [blame] | 8079 | arr, arr->UPB_PRIVATE(size) + 1, arena)) { |
Eric Salo | b7d54ac | 2022-12-29 11:59:42 -0800 | [diff] [blame] | 8080 | return NULL; |
| 8081 | } |
Protobuf Team Bot | 4ffe086 | 2023-12-06 02:02:36 +0000 | [diff] [blame] | 8082 | struct google_protobuf_EnumDescriptorProto_EnumReservedRange* sub = (struct google_protobuf_EnumDescriptorProto_EnumReservedRange*)_upb_Message_New(&google__protobuf__EnumDescriptorProto__EnumReservedRange_msg_init, arena); |
Eric Salo | b7d54ac | 2022-12-29 11:59:42 -0800 | [diff] [blame] | 8083 | if (!arr || !sub) return NULL; |
Protobuf Team Bot | f73985a | 2023-12-19 00:14:19 +0000 | [diff] [blame] | 8084 | UPB_PRIVATE(_upb_Array_Set) |
| 8085 | (arr, arr->UPB_PRIVATE(size) - 1, &sub, sizeof(sub)); |
Joshua Haberman | 9abf6e2 | 2021-01-13 12:16:25 -0800 | [diff] [blame] | 8086 | return sub; |
| 8087 | } |
Eric Salo | b7d54ac | 2022-12-29 11:59:42 -0800 | [diff] [blame] | 8088 | UPB_INLINE upb_StringView* google_protobuf_EnumDescriptorProto_mutable_reserved_name(google_protobuf_EnumDescriptorProto* msg, size_t* size) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 8089 | 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 Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 8090 | upb_Array* arr = upb_Message_GetMutableArray(UPB_UPCAST(msg), &field); |
Eric Salo | b7d54ac | 2022-12-29 11:59:42 -0800 | [diff] [blame] | 8091 | if (arr) { |
Protobuf Team Bot | f73985a | 2023-12-19 00:14:19 +0000 | [diff] [blame] | 8092 | if (size) *size = arr->UPB_PRIVATE(size); |
Protobuf Team Bot | 81e5433 | 2024-01-11 21:04:07 +0000 | [diff] [blame] | 8093 | return (upb_StringView*)upb_Array_MutableDataPtr(arr); |
Eric Salo | b7d54ac | 2022-12-29 11:59:42 -0800 | [diff] [blame] | 8094 | } else { |
| 8095 | if (size) *size = 0; |
| 8096 | return NULL; |
| 8097 | } |
Joshua Haberman | 9abf6e2 | 2021-01-13 12:16:25 -0800 | [diff] [blame] | 8098 | } |
Eric Salo | b7d54ac | 2022-12-29 11:59:42 -0800 | [diff] [blame] | 8099 | UPB_INLINE upb_StringView* google_protobuf_EnumDescriptorProto_resize_reserved_name(google_protobuf_EnumDescriptorProto* msg, size_t size, upb_Arena* arena) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 8100 | 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 Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 8101 | return (upb_StringView*)upb_Message_ResizeArrayUninitialized(UPB_UPCAST(msg), |
| 8102 | &field, size, arena); |
Joshua Haberman | 9abf6e2 | 2021-01-13 12:16:25 -0800 | [diff] [blame] | 8103 | } |
Joshua Haberman | 7ecf43f | 2022-03-14 13:11:29 -0700 | [diff] [blame] | 8104 | UPB_INLINE bool google_protobuf_EnumDescriptorProto_add_reserved_name(google_protobuf_EnumDescriptorProto* msg, upb_StringView val, upb_Arena* arena) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 8105 | 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 Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 8106 | upb_Array* arr = upb_Message_GetOrCreateMutableArray( |
| 8107 | UPB_UPCAST(msg), &field, arena); |
Protobuf Team Bot | 81e5433 | 2024-01-11 21:04:07 +0000 | [diff] [blame] | 8108 | if (!arr || !UPB_PRIVATE(_upb_Array_ResizeUninitialized)( |
Protobuf Team Bot | f73985a | 2023-12-19 00:14:19 +0000 | [diff] [blame] | 8109 | arr, arr->UPB_PRIVATE(size) + 1, arena)) { |
Eric Salo | b7d54ac | 2022-12-29 11:59:42 -0800 | [diff] [blame] | 8110 | return false; |
| 8111 | } |
Protobuf Team Bot | f73985a | 2023-12-19 00:14:19 +0000 | [diff] [blame] | 8112 | UPB_PRIVATE(_upb_Array_Set) |
| 8113 | (arr, arr->UPB_PRIVATE(size) - 1, &val, sizeof(val)); |
Eric Salo | b7d54ac | 2022-12-29 11:59:42 -0800 | [diff] [blame] | 8114 | return true; |
Joshua Haberman | 9abf6e2 | 2021-01-13 12:16:25 -0800 | [diff] [blame] | 8115 | } |
| 8116 | |
| 8117 | /* google.protobuf.EnumDescriptorProto.EnumReservedRange */ |
| 8118 | |
Joshua Haberman | f41049a | 2022-01-21 14:41:25 -0800 | [diff] [blame] | 8119 | UPB_INLINE google_protobuf_EnumDescriptorProto_EnumReservedRange* google_protobuf_EnumDescriptorProto_EnumReservedRange_new(upb_Arena* arena) { |
Protobuf Team Bot | 4ffe086 | 2023-12-06 02:02:36 +0000 | [diff] [blame] | 8120 | return (google_protobuf_EnumDescriptorProto_EnumReservedRange*)_upb_Message_New(&google__protobuf__EnumDescriptorProto__EnumReservedRange_msg_init, arena); |
Joshua Haberman | 9abf6e2 | 2021-01-13 12:16:25 -0800 | [diff] [blame] | 8121 | } |
Joshua Haberman | f41049a | 2022-01-21 14:41:25 -0800 | [diff] [blame] | 8122 | UPB_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 Haberman | 9d578a3 | 2021-08-02 15:32:01 -0700 | [diff] [blame] | 8124 | if (!ret) return NULL; |
Protobuf Team Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 8125 | if (upb_Decode(buf, size, UPB_UPCAST(ret), &google__protobuf__EnumDescriptorProto__EnumReservedRange_msg_init, NULL, 0, arena) != |
| 8126 | kUpb_DecodeStatus_Ok) { |
Joshua Haberman | 9d578a3 | 2021-08-02 15:32:01 -0700 | [diff] [blame] | 8127 | return NULL; |
| 8128 | } |
| 8129 | return ret; |
Joshua Haberman | 9abf6e2 | 2021-01-13 12:16:25 -0800 | [diff] [blame] | 8130 | } |
Joshua Haberman | f41049a | 2022-01-21 14:41:25 -0800 | [diff] [blame] | 8131 | UPB_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 Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 8136 | if (upb_Decode(buf, size, UPB_UPCAST(ret), &google__protobuf__EnumDescriptorProto__EnumReservedRange_msg_init, extreg, options, |
| 8137 | arena) != kUpb_DecodeStatus_Ok) { |
Joshua Haberman | f41049a | 2022-01-21 14:41:25 -0800 | [diff] [blame] | 8138 | return NULL; |
| 8139 | } |
| 8140 | return ret; |
Joshua Haberman | 9abf6e2 | 2021-01-13 12:16:25 -0800 | [diff] [blame] | 8141 | } |
Joshua Haberman | f41049a | 2022-01-21 14:41:25 -0800 | [diff] [blame] | 8142 | UPB_INLINE char* google_protobuf_EnumDescriptorProto_EnumReservedRange_serialize(const google_protobuf_EnumDescriptorProto_EnumReservedRange* msg, upb_Arena* arena, size_t* len) { |
Joshua Haberman | d3995ec | 2022-09-30 16:54:39 -0700 | [diff] [blame] | 8143 | char* ptr; |
Protobuf Team Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 8144 | (void)upb_Encode(UPB_UPCAST(msg), &google__protobuf__EnumDescriptorProto__EnumReservedRange_msg_init, 0, arena, &ptr, len); |
Joshua Haberman | d3995ec | 2022-09-30 16:54:39 -0700 | [diff] [blame] | 8145 | return ptr; |
Joshua Haberman | f41049a | 2022-01-21 14:41:25 -0800 | [diff] [blame] | 8146 | } |
| 8147 | UPB_INLINE char* google_protobuf_EnumDescriptorProto_EnumReservedRange_serialize_ex(const google_protobuf_EnumDescriptorProto_EnumReservedRange* msg, int options, |
| 8148 | upb_Arena* arena, size_t* len) { |
Joshua Haberman | d3995ec | 2022-09-30 16:54:39 -0700 | [diff] [blame] | 8149 | char* ptr; |
Protobuf Team Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 8150 | (void)upb_Encode(UPB_UPCAST(msg), &google__protobuf__EnumDescriptorProto__EnumReservedRange_msg_init, options, arena, &ptr, len); |
Joshua Haberman | d3995ec | 2022-09-30 16:54:39 -0700 | [diff] [blame] | 8151 | return ptr; |
Joshua Haberman | f41049a | 2022-01-21 14:41:25 -0800 | [diff] [blame] | 8152 | } |
Mike Kruskal | 3bc5049 | 2022-12-01 13:34:12 -0800 | [diff] [blame] | 8153 | UPB_INLINE void google_protobuf_EnumDescriptorProto_EnumReservedRange_clear_start(google_protobuf_EnumDescriptorProto_EnumReservedRange* msg) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 8154 | const upb_MiniTableField field = {1, 12, 64, kUpb_NoSub, 5, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; |
Protobuf Team Bot | 4e90ead | 2024-01-08 15:46:34 +0000 | [diff] [blame] | 8155 | upb_Message_ClearBaseField(UPB_UPCAST(msg), &field); |
Joshua Haberman | d3995ec | 2022-09-30 16:54:39 -0700 | [diff] [blame] | 8156 | } |
Joshua Haberman | f41049a | 2022-01-21 14:41:25 -0800 | [diff] [blame] | 8157 | UPB_INLINE int32_t google_protobuf_EnumDescriptorProto_EnumReservedRange_start(const google_protobuf_EnumDescriptorProto_EnumReservedRange* msg) { |
Eric Salo | 8809a11 | 2022-11-21 13:01:06 -0800 | [diff] [blame] | 8158 | int32_t default_val = (int32_t)0; |
| 8159 | int32_t ret; |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 8160 | const upb_MiniTableField field = {1, 12, 64, kUpb_NoSub, 5, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; |
Protobuf Team Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 8161 | _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field, |
| 8162 | &default_val, &ret); |
Eric Salo | 8809a11 | 2022-11-21 13:01:06 -0800 | [diff] [blame] | 8163 | return ret; |
Joshua Haberman | f41049a | 2022-01-21 14:41:25 -0800 | [diff] [blame] | 8164 | } |
Mike Kruskal | 3bc5049 | 2022-12-01 13:34:12 -0800 | [diff] [blame] | 8165 | UPB_INLINE bool google_protobuf_EnumDescriptorProto_EnumReservedRange_has_start(const google_protobuf_EnumDescriptorProto_EnumReservedRange* msg) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 8166 | const upb_MiniTableField field = {1, 12, 64, kUpb_NoSub, 5, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; |
Protobuf Team Bot | 8c1f635 | 2024-01-10 05:18:15 +0000 | [diff] [blame] | 8167 | return upb_Message_HasBaseField(UPB_UPCAST(msg), &field); |
Joshua Haberman | 7ecf43f | 2022-03-14 13:11:29 -0700 | [diff] [blame] | 8168 | } |
Mike Kruskal | 3bc5049 | 2022-12-01 13:34:12 -0800 | [diff] [blame] | 8169 | UPB_INLINE void google_protobuf_EnumDescriptorProto_EnumReservedRange_clear_end(google_protobuf_EnumDescriptorProto_EnumReservedRange* msg) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 8170 | const upb_MiniTableField field = {2, 16, 65, kUpb_NoSub, 5, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; |
Protobuf Team Bot | 4e90ead | 2024-01-08 15:46:34 +0000 | [diff] [blame] | 8171 | upb_Message_ClearBaseField(UPB_UPCAST(msg), &field); |
Joshua Haberman | d3995ec | 2022-09-30 16:54:39 -0700 | [diff] [blame] | 8172 | } |
Joshua Haberman | f41049a | 2022-01-21 14:41:25 -0800 | [diff] [blame] | 8173 | UPB_INLINE int32_t google_protobuf_EnumDescriptorProto_EnumReservedRange_end(const google_protobuf_EnumDescriptorProto_EnumReservedRange* msg) { |
Eric Salo | 8809a11 | 2022-11-21 13:01:06 -0800 | [diff] [blame] | 8174 | int32_t default_val = (int32_t)0; |
| 8175 | int32_t ret; |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 8176 | const upb_MiniTableField field = {2, 16, 65, kUpb_NoSub, 5, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; |
Protobuf Team Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 8177 | _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field, |
| 8178 | &default_val, &ret); |
Eric Salo | 8809a11 | 2022-11-21 13:01:06 -0800 | [diff] [blame] | 8179 | return ret; |
Joshua Haberman | f41049a | 2022-01-21 14:41:25 -0800 | [diff] [blame] | 8180 | } |
Mike Kruskal | 3bc5049 | 2022-12-01 13:34:12 -0800 | [diff] [blame] | 8181 | UPB_INLINE bool google_protobuf_EnumDescriptorProto_EnumReservedRange_has_end(const google_protobuf_EnumDescriptorProto_EnumReservedRange* msg) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 8182 | const upb_MiniTableField field = {2, 16, 65, kUpb_NoSub, 5, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; |
Protobuf Team Bot | 8c1f635 | 2024-01-10 05:18:15 +0000 | [diff] [blame] | 8183 | return upb_Message_HasBaseField(UPB_UPCAST(msg), &field); |
Mike Kruskal | 3bc5049 | 2022-12-01 13:34:12 -0800 | [diff] [blame] | 8184 | } |
Joshua Haberman | 9abf6e2 | 2021-01-13 12:16:25 -0800 | [diff] [blame] | 8185 | |
| 8186 | UPB_INLINE void google_protobuf_EnumDescriptorProto_EnumReservedRange_set_start(google_protobuf_EnumDescriptorProto_EnumReservedRange *msg, int32_t value) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 8187 | const upb_MiniTableField field = {1, 12, 64, kUpb_NoSub, 5, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; |
Protobuf Team Bot | ac32c97 | 2024-04-10 03:30:05 +0000 | [diff] [blame] | 8188 | upb_Message_SetBaseField((upb_Message *)msg, &field, &value); |
Mike Kruskal | 232ecf4 | 2023-01-14 00:09:40 -0800 | [diff] [blame] | 8189 | } |
| 8190 | UPB_INLINE void google_protobuf_EnumDescriptorProto_EnumReservedRange_set_end(google_protobuf_EnumDescriptorProto_EnumReservedRange *msg, int32_t value) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 8191 | const upb_MiniTableField field = {2, 16, 65, kUpb_NoSub, 5, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; |
Protobuf Team Bot | ac32c97 | 2024-04-10 03:30:05 +0000 | [diff] [blame] | 8192 | upb_Message_SetBaseField((upb_Message *)msg, &field, &value); |
Joshua Haberman | 9abf6e2 | 2021-01-13 12:16:25 -0800 | [diff] [blame] | 8193 | } |
Mike Kruskal | 232ecf4 | 2023-01-14 00:09:40 -0800 | [diff] [blame] | 8194 | |
Joshua Haberman | 9abf6e2 | 2021-01-13 12:16:25 -0800 | [diff] [blame] | 8195 | /* google.protobuf.EnumValueDescriptorProto */ |
| 8196 | |
Joshua Haberman | f41049a | 2022-01-21 14:41:25 -0800 | [diff] [blame] | 8197 | UPB_INLINE google_protobuf_EnumValueDescriptorProto* google_protobuf_EnumValueDescriptorProto_new(upb_Arena* arena) { |
Protobuf Team Bot | 4ffe086 | 2023-12-06 02:02:36 +0000 | [diff] [blame] | 8198 | return (google_protobuf_EnumValueDescriptorProto*)_upb_Message_New(&google__protobuf__EnumValueDescriptorProto_msg_init, arena); |
Joshua Haberman | 9abf6e2 | 2021-01-13 12:16:25 -0800 | [diff] [blame] | 8199 | } |
Joshua Haberman | f41049a | 2022-01-21 14:41:25 -0800 | [diff] [blame] | 8200 | UPB_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 Haberman | 9d578a3 | 2021-08-02 15:32:01 -0700 | [diff] [blame] | 8202 | if (!ret) return NULL; |
Protobuf Team Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 8203 | if (upb_Decode(buf, size, UPB_UPCAST(ret), &google__protobuf__EnumValueDescriptorProto_msg_init, NULL, 0, arena) != |
| 8204 | kUpb_DecodeStatus_Ok) { |
Joshua Haberman | 9d578a3 | 2021-08-02 15:32:01 -0700 | [diff] [blame] | 8205 | return NULL; |
| 8206 | } |
| 8207 | return ret; |
Joshua Haberman | 9abf6e2 | 2021-01-13 12:16:25 -0800 | [diff] [blame] | 8208 | } |
Joshua Haberman | f41049a | 2022-01-21 14:41:25 -0800 | [diff] [blame] | 8209 | UPB_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 Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 8214 | if (upb_Decode(buf, size, UPB_UPCAST(ret), &google__protobuf__EnumValueDescriptorProto_msg_init, extreg, options, |
| 8215 | arena) != kUpb_DecodeStatus_Ok) { |
Joshua Haberman | f41049a | 2022-01-21 14:41:25 -0800 | [diff] [blame] | 8216 | return NULL; |
| 8217 | } |
| 8218 | return ret; |
| 8219 | } |
| 8220 | UPB_INLINE char* google_protobuf_EnumValueDescriptorProto_serialize(const google_protobuf_EnumValueDescriptorProto* msg, upb_Arena* arena, size_t* len) { |
Joshua Haberman | d3995ec | 2022-09-30 16:54:39 -0700 | [diff] [blame] | 8221 | char* ptr; |
Protobuf Team Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 8222 | (void)upb_Encode(UPB_UPCAST(msg), &google__protobuf__EnumValueDescriptorProto_msg_init, 0, arena, &ptr, len); |
Joshua Haberman | d3995ec | 2022-09-30 16:54:39 -0700 | [diff] [blame] | 8223 | return ptr; |
Joshua Haberman | f41049a | 2022-01-21 14:41:25 -0800 | [diff] [blame] | 8224 | } |
| 8225 | UPB_INLINE char* google_protobuf_EnumValueDescriptorProto_serialize_ex(const google_protobuf_EnumValueDescriptorProto* msg, int options, |
| 8226 | upb_Arena* arena, size_t* len) { |
Joshua Haberman | d3995ec | 2022-09-30 16:54:39 -0700 | [diff] [blame] | 8227 | char* ptr; |
Protobuf Team Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 8228 | (void)upb_Encode(UPB_UPCAST(msg), &google__protobuf__EnumValueDescriptorProto_msg_init, options, arena, &ptr, len); |
Joshua Haberman | d3995ec | 2022-09-30 16:54:39 -0700 | [diff] [blame] | 8229 | return ptr; |
Joshua Haberman | f41049a | 2022-01-21 14:41:25 -0800 | [diff] [blame] | 8230 | } |
Mike Kruskal | 3bc5049 | 2022-12-01 13:34:12 -0800 | [diff] [blame] | 8231 | UPB_INLINE void google_protobuf_EnumValueDescriptorProto_clear_name(google_protobuf_EnumValueDescriptorProto* msg) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 8232 | 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 Bot | 4e90ead | 2024-01-08 15:46:34 +0000 | [diff] [blame] | 8233 | upb_Message_ClearBaseField(UPB_UPCAST(msg), &field); |
Joshua Haberman | d3995ec | 2022-09-30 16:54:39 -0700 | [diff] [blame] | 8234 | } |
Joshua Haberman | f41049a | 2022-01-21 14:41:25 -0800 | [diff] [blame] | 8235 | UPB_INLINE upb_StringView google_protobuf_EnumValueDescriptorProto_name(const google_protobuf_EnumValueDescriptorProto* msg) { |
Eric Salo | 8809a11 | 2022-11-21 13:01:06 -0800 | [diff] [blame] | 8236 | upb_StringView default_val = upb_StringView_FromString(""); |
| 8237 | upb_StringView ret; |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 8238 | 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 Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 8239 | _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field, |
| 8240 | &default_val, &ret); |
Eric Salo | 8809a11 | 2022-11-21 13:01:06 -0800 | [diff] [blame] | 8241 | return ret; |
Joshua Haberman | f41049a | 2022-01-21 14:41:25 -0800 | [diff] [blame] | 8242 | } |
Mike Kruskal | 3bc5049 | 2022-12-01 13:34:12 -0800 | [diff] [blame] | 8243 | UPB_INLINE bool google_protobuf_EnumValueDescriptorProto_has_name(const google_protobuf_EnumValueDescriptorProto* msg) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 8244 | 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 Bot | 8c1f635 | 2024-01-10 05:18:15 +0000 | [diff] [blame] | 8245 | return upb_Message_HasBaseField(UPB_UPCAST(msg), &field); |
Joshua Haberman | 7ecf43f | 2022-03-14 13:11:29 -0700 | [diff] [blame] | 8246 | } |
Mike Kruskal | 3bc5049 | 2022-12-01 13:34:12 -0800 | [diff] [blame] | 8247 | UPB_INLINE void google_protobuf_EnumValueDescriptorProto_clear_number(google_protobuf_EnumValueDescriptorProto* msg) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 8248 | const upb_MiniTableField field = {2, 12, 65, kUpb_NoSub, 5, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; |
Protobuf Team Bot | 4e90ead | 2024-01-08 15:46:34 +0000 | [diff] [blame] | 8249 | upb_Message_ClearBaseField(UPB_UPCAST(msg), &field); |
Joshua Haberman | d3995ec | 2022-09-30 16:54:39 -0700 | [diff] [blame] | 8250 | } |
Joshua Haberman | f41049a | 2022-01-21 14:41:25 -0800 | [diff] [blame] | 8251 | UPB_INLINE int32_t google_protobuf_EnumValueDescriptorProto_number(const google_protobuf_EnumValueDescriptorProto* msg) { |
Eric Salo | 8809a11 | 2022-11-21 13:01:06 -0800 | [diff] [blame] | 8252 | int32_t default_val = (int32_t)0; |
| 8253 | int32_t ret; |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 8254 | const upb_MiniTableField field = {2, 12, 65, kUpb_NoSub, 5, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; |
Protobuf Team Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 8255 | _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field, |
| 8256 | &default_val, &ret); |
Eric Salo | 8809a11 | 2022-11-21 13:01:06 -0800 | [diff] [blame] | 8257 | return ret; |
Joshua Haberman | f41049a | 2022-01-21 14:41:25 -0800 | [diff] [blame] | 8258 | } |
Mike Kruskal | 3bc5049 | 2022-12-01 13:34:12 -0800 | [diff] [blame] | 8259 | UPB_INLINE bool google_protobuf_EnumValueDescriptorProto_has_number(const google_protobuf_EnumValueDescriptorProto* msg) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 8260 | const upb_MiniTableField field = {2, 12, 65, kUpb_NoSub, 5, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; |
Protobuf Team Bot | 8c1f635 | 2024-01-10 05:18:15 +0000 | [diff] [blame] | 8261 | return upb_Message_HasBaseField(UPB_UPCAST(msg), &field); |
Joshua Haberman | 7ecf43f | 2022-03-14 13:11:29 -0700 | [diff] [blame] | 8262 | } |
Mike Kruskal | 3bc5049 | 2022-12-01 13:34:12 -0800 | [diff] [blame] | 8263 | UPB_INLINE void google_protobuf_EnumValueDescriptorProto_clear_options(google_protobuf_EnumValueDescriptorProto* msg) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 8264 | 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 Bot | 4e90ead | 2024-01-08 15:46:34 +0000 | [diff] [blame] | 8265 | upb_Message_ClearBaseField(UPB_UPCAST(msg), &field); |
Joshua Haberman | d3995ec | 2022-09-30 16:54:39 -0700 | [diff] [blame] | 8266 | } |
Joshua Haberman | f41049a | 2022-01-21 14:41:25 -0800 | [diff] [blame] | 8267 | UPB_INLINE const google_protobuf_EnumValueOptions* google_protobuf_EnumValueDescriptorProto_options(const google_protobuf_EnumValueDescriptorProto* msg) { |
Eric Salo | 8809a11 | 2022-11-21 13:01:06 -0800 | [diff] [blame] | 8268 | const google_protobuf_EnumValueOptions* default_val = NULL; |
| 8269 | const google_protobuf_EnumValueOptions* ret; |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 8270 | 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 Bot | a9387b5 | 2024-06-12 15:17:52 +0000 | [diff] [blame] | 8271 | UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__EnumValueOptions_msg_init); |
Protobuf Team Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 8272 | _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field, |
| 8273 | &default_val, &ret); |
Eric Salo | 8809a11 | 2022-11-21 13:01:06 -0800 | [diff] [blame] | 8274 | return ret; |
Joshua Haberman | 9abf6e2 | 2021-01-13 12:16:25 -0800 | [diff] [blame] | 8275 | } |
Mike Kruskal | 3bc5049 | 2022-12-01 13:34:12 -0800 | [diff] [blame] | 8276 | UPB_INLINE bool google_protobuf_EnumValueDescriptorProto_has_options(const google_protobuf_EnumValueDescriptorProto* msg) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 8277 | 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 Bot | 8c1f635 | 2024-01-10 05:18:15 +0000 | [diff] [blame] | 8278 | return upb_Message_HasBaseField(UPB_UPCAST(msg), &field); |
Mike Kruskal | 3bc5049 | 2022-12-01 13:34:12 -0800 | [diff] [blame] | 8279 | } |
Joshua Haberman | 9abf6e2 | 2021-01-13 12:16:25 -0800 | [diff] [blame] | 8280 | |
Joshua Haberman | f41049a | 2022-01-21 14:41:25 -0800 | [diff] [blame] | 8281 | UPB_INLINE void google_protobuf_EnumValueDescriptorProto_set_name(google_protobuf_EnumValueDescriptorProto *msg, upb_StringView value) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 8282 | 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 Bot | ac32c97 | 2024-04-10 03:30:05 +0000 | [diff] [blame] | 8283 | upb_Message_SetBaseField((upb_Message *)msg, &field, &value); |
Mike Kruskal | 232ecf4 | 2023-01-14 00:09:40 -0800 | [diff] [blame] | 8284 | } |
| 8285 | UPB_INLINE void google_protobuf_EnumValueDescriptorProto_set_number(google_protobuf_EnumValueDescriptorProto *msg, int32_t value) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 8286 | const upb_MiniTableField field = {2, 12, 65, kUpb_NoSub, 5, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; |
Protobuf Team Bot | ac32c97 | 2024-04-10 03:30:05 +0000 | [diff] [blame] | 8287 | upb_Message_SetBaseField((upb_Message *)msg, &field, &value); |
Mike Kruskal | 232ecf4 | 2023-01-14 00:09:40 -0800 | [diff] [blame] | 8288 | } |
| 8289 | UPB_INLINE void google_protobuf_EnumValueDescriptorProto_set_options(google_protobuf_EnumValueDescriptorProto *msg, google_protobuf_EnumValueOptions* value) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 8290 | 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 Bot | a9387b5 | 2024-06-12 15:17:52 +0000 | [diff] [blame] | 8291 | UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__EnumValueOptions_msg_init); |
Protobuf Team Bot | ac32c97 | 2024-04-10 03:30:05 +0000 | [diff] [blame] | 8292 | upb_Message_SetBaseField((upb_Message *)msg, &field, &value); |
Mike Kruskal | 232ecf4 | 2023-01-14 00:09:40 -0800 | [diff] [blame] | 8293 | } |
| 8294 | UPB_INLINE struct google_protobuf_EnumValueOptions* google_protobuf_EnumValueDescriptorProto_mutable_options(google_protobuf_EnumValueDescriptorProto* msg, upb_Arena* arena) { |
Joshua Haberman | 9abf6e2 | 2021-01-13 12:16:25 -0800 | [diff] [blame] | 8295 | struct google_protobuf_EnumValueOptions* sub = (struct google_protobuf_EnumValueOptions*)google_protobuf_EnumValueDescriptorProto_options(msg); |
| 8296 | if (sub == NULL) { |
Protobuf Team Bot | 4ffe086 | 2023-12-06 02:02:36 +0000 | [diff] [blame] | 8297 | sub = (struct google_protobuf_EnumValueOptions*)_upb_Message_New(&google__protobuf__EnumValueOptions_msg_init, arena); |
Eric Salo | 8809a11 | 2022-11-21 13:01:06 -0800 | [diff] [blame] | 8298 | if (sub) google_protobuf_EnumValueDescriptorProto_set_options(msg, sub); |
Joshua Haberman | 9abf6e2 | 2021-01-13 12:16:25 -0800 | [diff] [blame] | 8299 | } |
| 8300 | return sub; |
| 8301 | } |
| 8302 | |
| 8303 | /* google.protobuf.ServiceDescriptorProto */ |
| 8304 | |
Joshua Haberman | f41049a | 2022-01-21 14:41:25 -0800 | [diff] [blame] | 8305 | UPB_INLINE google_protobuf_ServiceDescriptorProto* google_protobuf_ServiceDescriptorProto_new(upb_Arena* arena) { |
Protobuf Team Bot | 4ffe086 | 2023-12-06 02:02:36 +0000 | [diff] [blame] | 8306 | return (google_protobuf_ServiceDescriptorProto*)_upb_Message_New(&google__protobuf__ServiceDescriptorProto_msg_init, arena); |
Joshua Haberman | 9abf6e2 | 2021-01-13 12:16:25 -0800 | [diff] [blame] | 8307 | } |
Joshua Haberman | f41049a | 2022-01-21 14:41:25 -0800 | [diff] [blame] | 8308 | UPB_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 Haberman | 9d578a3 | 2021-08-02 15:32:01 -0700 | [diff] [blame] | 8310 | if (!ret) return NULL; |
Protobuf Team Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 8311 | if (upb_Decode(buf, size, UPB_UPCAST(ret), &google__protobuf__ServiceDescriptorProto_msg_init, NULL, 0, arena) != |
| 8312 | kUpb_DecodeStatus_Ok) { |
Joshua Haberman | 9d578a3 | 2021-08-02 15:32:01 -0700 | [diff] [blame] | 8313 | return NULL; |
| 8314 | } |
| 8315 | return ret; |
Joshua Haberman | 9abf6e2 | 2021-01-13 12:16:25 -0800 | [diff] [blame] | 8316 | } |
Joshua Haberman | f41049a | 2022-01-21 14:41:25 -0800 | [diff] [blame] | 8317 | UPB_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 Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 8322 | if (upb_Decode(buf, size, UPB_UPCAST(ret), &google__protobuf__ServiceDescriptorProto_msg_init, extreg, options, |
| 8323 | arena) != kUpb_DecodeStatus_Ok) { |
Joshua Haberman | f41049a | 2022-01-21 14:41:25 -0800 | [diff] [blame] | 8324 | return NULL; |
| 8325 | } |
| 8326 | return ret; |
Joshua Haberman | 9abf6e2 | 2021-01-13 12:16:25 -0800 | [diff] [blame] | 8327 | } |
Joshua Haberman | f41049a | 2022-01-21 14:41:25 -0800 | [diff] [blame] | 8328 | UPB_INLINE char* google_protobuf_ServiceDescriptorProto_serialize(const google_protobuf_ServiceDescriptorProto* msg, upb_Arena* arena, size_t* len) { |
Joshua Haberman | d3995ec | 2022-09-30 16:54:39 -0700 | [diff] [blame] | 8329 | char* ptr; |
Protobuf Team Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 8330 | (void)upb_Encode(UPB_UPCAST(msg), &google__protobuf__ServiceDescriptorProto_msg_init, 0, arena, &ptr, len); |
Joshua Haberman | d3995ec | 2022-09-30 16:54:39 -0700 | [diff] [blame] | 8331 | return ptr; |
Joshua Haberman | f41049a | 2022-01-21 14:41:25 -0800 | [diff] [blame] | 8332 | } |
| 8333 | UPB_INLINE char* google_protobuf_ServiceDescriptorProto_serialize_ex(const google_protobuf_ServiceDescriptorProto* msg, int options, |
| 8334 | upb_Arena* arena, size_t* len) { |
Joshua Haberman | d3995ec | 2022-09-30 16:54:39 -0700 | [diff] [blame] | 8335 | char* ptr; |
Protobuf Team Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 8336 | (void)upb_Encode(UPB_UPCAST(msg), &google__protobuf__ServiceDescriptorProto_msg_init, options, arena, &ptr, len); |
Joshua Haberman | d3995ec | 2022-09-30 16:54:39 -0700 | [diff] [blame] | 8337 | return ptr; |
Joshua Haberman | f41049a | 2022-01-21 14:41:25 -0800 | [diff] [blame] | 8338 | } |
Mike Kruskal | 3bc5049 | 2022-12-01 13:34:12 -0800 | [diff] [blame] | 8339 | UPB_INLINE void google_protobuf_ServiceDescriptorProto_clear_name(google_protobuf_ServiceDescriptorProto* msg) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 8340 | 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 Bot | 4e90ead | 2024-01-08 15:46:34 +0000 | [diff] [blame] | 8341 | upb_Message_ClearBaseField(UPB_UPCAST(msg), &field); |
Joshua Haberman | d3995ec | 2022-09-30 16:54:39 -0700 | [diff] [blame] | 8342 | } |
Joshua Haberman | f41049a | 2022-01-21 14:41:25 -0800 | [diff] [blame] | 8343 | UPB_INLINE upb_StringView google_protobuf_ServiceDescriptorProto_name(const google_protobuf_ServiceDescriptorProto* msg) { |
Eric Salo | 8809a11 | 2022-11-21 13:01:06 -0800 | [diff] [blame] | 8344 | upb_StringView default_val = upb_StringView_FromString(""); |
| 8345 | upb_StringView ret; |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 8346 | 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 Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 8347 | _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field, |
| 8348 | &default_val, &ret); |
Eric Salo | 8809a11 | 2022-11-21 13:01:06 -0800 | [diff] [blame] | 8349 | return ret; |
Joshua Haberman | f41049a | 2022-01-21 14:41:25 -0800 | [diff] [blame] | 8350 | } |
Mike Kruskal | 3bc5049 | 2022-12-01 13:34:12 -0800 | [diff] [blame] | 8351 | UPB_INLINE bool google_protobuf_ServiceDescriptorProto_has_name(const google_protobuf_ServiceDescriptorProto* msg) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 8352 | const upb_MiniTableField field = {1, UPB_SIZE(20, 16), 64, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; |
Protobuf Team Bot | 8c1f635 | 2024-01-10 05:18:15 +0000 | [diff] [blame] | 8353 | return upb_Message_HasBaseField(UPB_UPCAST(msg), &field); |
Joshua Haberman | d3995ec | 2022-09-30 16:54:39 -0700 | [diff] [blame] | 8354 | } |
Mike Kruskal | 3bc5049 | 2022-12-01 13:34:12 -0800 | [diff] [blame] | 8355 | UPB_INLINE void google_protobuf_ServiceDescriptorProto_clear_method(google_protobuf_ServiceDescriptorProto* msg) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 8356 | 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 Bot | 4e90ead | 2024-01-08 15:46:34 +0000 | [diff] [blame] | 8357 | upb_Message_ClearBaseField(UPB_UPCAST(msg), &field); |
Joshua Haberman | 7ecf43f | 2022-03-14 13:11:29 -0700 | [diff] [blame] | 8358 | } |
Eric Salo | b7d54ac | 2022-12-29 11:59:42 -0800 | [diff] [blame] | 8359 | UPB_INLINE const google_protobuf_MethodDescriptorProto* const* google_protobuf_ServiceDescriptorProto_method(const google_protobuf_ServiceDescriptorProto* msg, size_t* size) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 8360 | 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 Bot | a9387b5 | 2024-06-12 15:17:52 +0000 | [diff] [blame] | 8361 | UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__MethodDescriptorProto_msg_init); |
Protobuf Team Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 8362 | const upb_Array* arr = upb_Message_GetArray(UPB_UPCAST(msg), &field); |
Eric Salo | b7d54ac | 2022-12-29 11:59:42 -0800 | [diff] [blame] | 8363 | if (arr) { |
Protobuf Team Bot | f73985a | 2023-12-19 00:14:19 +0000 | [diff] [blame] | 8364 | if (size) *size = arr->UPB_PRIVATE(size); |
Protobuf Team Bot | 81e5433 | 2024-01-11 21:04:07 +0000 | [diff] [blame] | 8365 | return (const google_protobuf_MethodDescriptorProto* const*)upb_Array_DataPtr(arr); |
Eric Salo | b7d54ac | 2022-12-29 11:59:42 -0800 | [diff] [blame] | 8366 | } else { |
| 8367 | if (size) *size = 0; |
| 8368 | return NULL; |
| 8369 | } |
Joshua Haberman | 7ecf43f | 2022-03-14 13:11:29 -0700 | [diff] [blame] | 8370 | } |
Deanna Garcia | b26afb5 | 2023-04-25 13:37:18 -0700 | [diff] [blame] | 8371 | UPB_INLINE const upb_Array* _google_protobuf_ServiceDescriptorProto_method_upb_array(const google_protobuf_ServiceDescriptorProto* msg, size_t* size) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 8372 | 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 Bot | a9387b5 | 2024-06-12 15:17:52 +0000 | [diff] [blame] | 8373 | UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__MethodDescriptorProto_msg_init); |
Protobuf Team Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 8374 | const upb_Array* arr = upb_Message_GetArray(UPB_UPCAST(msg), &field); |
Deanna Garcia | b26afb5 | 2023-04-25 13:37:18 -0700 | [diff] [blame] | 8375 | if (size) { |
Protobuf Team Bot | f73985a | 2023-12-19 00:14:19 +0000 | [diff] [blame] | 8376 | *size = arr ? arr->UPB_PRIVATE(size) : 0; |
Deanna Garcia | b26afb5 | 2023-04-25 13:37:18 -0700 | [diff] [blame] | 8377 | } |
| 8378 | return arr; |
| 8379 | } |
Protobuf Team Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 8380 | UPB_INLINE upb_Array* _google_protobuf_ServiceDescriptorProto_method_mutable_upb_array(google_protobuf_ServiceDescriptorProto* msg, size_t* size, upb_Arena* arena) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 8381 | 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 Bot | a9387b5 | 2024-06-12 15:17:52 +0000 | [diff] [blame] | 8382 | UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__MethodDescriptorProto_msg_init); |
Protobuf Team Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 8383 | upb_Array* arr = upb_Message_GetOrCreateMutableArray(UPB_UPCAST(msg), |
| 8384 | &field, arena); |
Deanna Garcia | b26afb5 | 2023-04-25 13:37:18 -0700 | [diff] [blame] | 8385 | if (size) { |
Protobuf Team Bot | f73985a | 2023-12-19 00:14:19 +0000 | [diff] [blame] | 8386 | *size = arr ? arr->UPB_PRIVATE(size) : 0; |
Deanna Garcia | b26afb5 | 2023-04-25 13:37:18 -0700 | [diff] [blame] | 8387 | } |
| 8388 | return arr; |
| 8389 | } |
Mike Kruskal | 3bc5049 | 2022-12-01 13:34:12 -0800 | [diff] [blame] | 8390 | UPB_INLINE void google_protobuf_ServiceDescriptorProto_clear_options(google_protobuf_ServiceDescriptorProto* msg) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 8391 | 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 Bot | 4e90ead | 2024-01-08 15:46:34 +0000 | [diff] [blame] | 8392 | upb_Message_ClearBaseField(UPB_UPCAST(msg), &field); |
Joshua Haberman | d3995ec | 2022-09-30 16:54:39 -0700 | [diff] [blame] | 8393 | } |
Joshua Haberman | f41049a | 2022-01-21 14:41:25 -0800 | [diff] [blame] | 8394 | UPB_INLINE const google_protobuf_ServiceOptions* google_protobuf_ServiceDescriptorProto_options(const google_protobuf_ServiceDescriptorProto* msg) { |
Eric Salo | 8809a11 | 2022-11-21 13:01:06 -0800 | [diff] [blame] | 8395 | const google_protobuf_ServiceOptions* default_val = NULL; |
| 8396 | const google_protobuf_ServiceOptions* ret; |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 8397 | 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 Bot | a9387b5 | 2024-06-12 15:17:52 +0000 | [diff] [blame] | 8398 | UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__ServiceOptions_msg_init); |
Protobuf Team Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 8399 | _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field, |
| 8400 | &default_val, &ret); |
Eric Salo | 8809a11 | 2022-11-21 13:01:06 -0800 | [diff] [blame] | 8401 | return ret; |
Joshua Haberman | f41049a | 2022-01-21 14:41:25 -0800 | [diff] [blame] | 8402 | } |
Mike Kruskal | 3bc5049 | 2022-12-01 13:34:12 -0800 | [diff] [blame] | 8403 | UPB_INLINE bool google_protobuf_ServiceDescriptorProto_has_options(const google_protobuf_ServiceDescriptorProto* msg) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 8404 | 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 Bot | 8c1f635 | 2024-01-10 05:18:15 +0000 | [diff] [blame] | 8405 | return upb_Message_HasBaseField(UPB_UPCAST(msg), &field); |
Mike Kruskal | 3bc5049 | 2022-12-01 13:34:12 -0800 | [diff] [blame] | 8406 | } |
Joshua Haberman | 9abf6e2 | 2021-01-13 12:16:25 -0800 | [diff] [blame] | 8407 | |
Joshua Haberman | f41049a | 2022-01-21 14:41:25 -0800 | [diff] [blame] | 8408 | UPB_INLINE void google_protobuf_ServiceDescriptorProto_set_name(google_protobuf_ServiceDescriptorProto *msg, upb_StringView value) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 8409 | 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 Bot | ac32c97 | 2024-04-10 03:30:05 +0000 | [diff] [blame] | 8410 | upb_Message_SetBaseField((upb_Message *)msg, &field, &value); |
Mike Kruskal | 232ecf4 | 2023-01-14 00:09:40 -0800 | [diff] [blame] | 8411 | } |
| 8412 | UPB_INLINE google_protobuf_MethodDescriptorProto** google_protobuf_ServiceDescriptorProto_mutable_method(google_protobuf_ServiceDescriptorProto* msg, size_t* size) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 8413 | 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 Bot | a9387b5 | 2024-06-12 15:17:52 +0000 | [diff] [blame] | 8414 | UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__MethodDescriptorProto_msg_init); |
Protobuf Team Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 8415 | upb_Array* arr = upb_Message_GetMutableArray(UPB_UPCAST(msg), &field); |
Eric Salo | b7d54ac | 2022-12-29 11:59:42 -0800 | [diff] [blame] | 8416 | if (arr) { |
Protobuf Team Bot | f73985a | 2023-12-19 00:14:19 +0000 | [diff] [blame] | 8417 | if (size) *size = arr->UPB_PRIVATE(size); |
Protobuf Team Bot | 81e5433 | 2024-01-11 21:04:07 +0000 | [diff] [blame] | 8418 | return (google_protobuf_MethodDescriptorProto**)upb_Array_MutableDataPtr(arr); |
Eric Salo | b7d54ac | 2022-12-29 11:59:42 -0800 | [diff] [blame] | 8419 | } else { |
| 8420 | if (size) *size = 0; |
| 8421 | return NULL; |
| 8422 | } |
Joshua Haberman | 9abf6e2 | 2021-01-13 12:16:25 -0800 | [diff] [blame] | 8423 | } |
Eric Salo | b7d54ac | 2022-12-29 11:59:42 -0800 | [diff] [blame] | 8424 | UPB_INLINE google_protobuf_MethodDescriptorProto** google_protobuf_ServiceDescriptorProto_resize_method(google_protobuf_ServiceDescriptorProto* msg, size_t size, upb_Arena* arena) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 8425 | 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 Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 8426 | return (google_protobuf_MethodDescriptorProto**)upb_Message_ResizeArrayUninitialized(UPB_UPCAST(msg), |
| 8427 | &field, size, arena); |
Joshua Haberman | 9abf6e2 | 2021-01-13 12:16:25 -0800 | [diff] [blame] | 8428 | } |
Joshua Haberman | 7ecf43f | 2022-03-14 13:11:29 -0700 | [diff] [blame] | 8429 | UPB_INLINE struct google_protobuf_MethodDescriptorProto* google_protobuf_ServiceDescriptorProto_add_method(google_protobuf_ServiceDescriptorProto* msg, upb_Arena* arena) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 8430 | 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 Bot | a9387b5 | 2024-06-12 15:17:52 +0000 | [diff] [blame] | 8431 | UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__MethodDescriptorProto_msg_init); |
Protobuf Team Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 8432 | upb_Array* arr = upb_Message_GetOrCreateMutableArray( |
| 8433 | UPB_UPCAST(msg), &field, arena); |
Protobuf Team Bot | 81e5433 | 2024-01-11 21:04:07 +0000 | [diff] [blame] | 8434 | if (!arr || !UPB_PRIVATE(_upb_Array_ResizeUninitialized)( |
Protobuf Team Bot | f73985a | 2023-12-19 00:14:19 +0000 | [diff] [blame] | 8435 | arr, arr->UPB_PRIVATE(size) + 1, arena)) { |
Eric Salo | b7d54ac | 2022-12-29 11:59:42 -0800 | [diff] [blame] | 8436 | return NULL; |
| 8437 | } |
Protobuf Team Bot | 4ffe086 | 2023-12-06 02:02:36 +0000 | [diff] [blame] | 8438 | struct google_protobuf_MethodDescriptorProto* sub = (struct google_protobuf_MethodDescriptorProto*)_upb_Message_New(&google__protobuf__MethodDescriptorProto_msg_init, arena); |
Eric Salo | b7d54ac | 2022-12-29 11:59:42 -0800 | [diff] [blame] | 8439 | if (!arr || !sub) return NULL; |
Protobuf Team Bot | f73985a | 2023-12-19 00:14:19 +0000 | [diff] [blame] | 8440 | UPB_PRIVATE(_upb_Array_Set) |
| 8441 | (arr, arr->UPB_PRIVATE(size) - 1, &sub, sizeof(sub)); |
Joshua Haberman | 9abf6e2 | 2021-01-13 12:16:25 -0800 | [diff] [blame] | 8442 | return sub; |
| 8443 | } |
| 8444 | UPB_INLINE void google_protobuf_ServiceDescriptorProto_set_options(google_protobuf_ServiceDescriptorProto *msg, google_protobuf_ServiceOptions* value) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 8445 | 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 Bot | a9387b5 | 2024-06-12 15:17:52 +0000 | [diff] [blame] | 8446 | UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__ServiceOptions_msg_init); |
Protobuf Team Bot | ac32c97 | 2024-04-10 03:30:05 +0000 | [diff] [blame] | 8447 | upb_Message_SetBaseField((upb_Message *)msg, &field, &value); |
Mike Kruskal | 232ecf4 | 2023-01-14 00:09:40 -0800 | [diff] [blame] | 8448 | } |
| 8449 | UPB_INLINE struct google_protobuf_ServiceOptions* google_protobuf_ServiceDescriptorProto_mutable_options(google_protobuf_ServiceDescriptorProto* msg, upb_Arena* arena) { |
Joshua Haberman | 9abf6e2 | 2021-01-13 12:16:25 -0800 | [diff] [blame] | 8450 | struct google_protobuf_ServiceOptions* sub = (struct google_protobuf_ServiceOptions*)google_protobuf_ServiceDescriptorProto_options(msg); |
| 8451 | if (sub == NULL) { |
Protobuf Team Bot | 4ffe086 | 2023-12-06 02:02:36 +0000 | [diff] [blame] | 8452 | sub = (struct google_protobuf_ServiceOptions*)_upb_Message_New(&google__protobuf__ServiceOptions_msg_init, arena); |
Eric Salo | 8809a11 | 2022-11-21 13:01:06 -0800 | [diff] [blame] | 8453 | if (sub) google_protobuf_ServiceDescriptorProto_set_options(msg, sub); |
Joshua Haberman | 9abf6e2 | 2021-01-13 12:16:25 -0800 | [diff] [blame] | 8454 | } |
| 8455 | return sub; |
| 8456 | } |
| 8457 | |
| 8458 | /* google.protobuf.MethodDescriptorProto */ |
| 8459 | |
Joshua Haberman | f41049a | 2022-01-21 14:41:25 -0800 | [diff] [blame] | 8460 | UPB_INLINE google_protobuf_MethodDescriptorProto* google_protobuf_MethodDescriptorProto_new(upb_Arena* arena) { |
Protobuf Team Bot | 4ffe086 | 2023-12-06 02:02:36 +0000 | [diff] [blame] | 8461 | return (google_protobuf_MethodDescriptorProto*)_upb_Message_New(&google__protobuf__MethodDescriptorProto_msg_init, arena); |
Joshua Haberman | 9abf6e2 | 2021-01-13 12:16:25 -0800 | [diff] [blame] | 8462 | } |
Joshua Haberman | f41049a | 2022-01-21 14:41:25 -0800 | [diff] [blame] | 8463 | UPB_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 Haberman | 9d578a3 | 2021-08-02 15:32:01 -0700 | [diff] [blame] | 8465 | if (!ret) return NULL; |
Protobuf Team Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 8466 | if (upb_Decode(buf, size, UPB_UPCAST(ret), &google__protobuf__MethodDescriptorProto_msg_init, NULL, 0, arena) != |
| 8467 | kUpb_DecodeStatus_Ok) { |
Joshua Haberman | 9d578a3 | 2021-08-02 15:32:01 -0700 | [diff] [blame] | 8468 | return NULL; |
| 8469 | } |
| 8470 | return ret; |
Joshua Haberman | 9abf6e2 | 2021-01-13 12:16:25 -0800 | [diff] [blame] | 8471 | } |
Joshua Haberman | f41049a | 2022-01-21 14:41:25 -0800 | [diff] [blame] | 8472 | UPB_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 Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 8477 | if (upb_Decode(buf, size, UPB_UPCAST(ret), &google__protobuf__MethodDescriptorProto_msg_init, extreg, options, |
| 8478 | arena) != kUpb_DecodeStatus_Ok) { |
Joshua Haberman | f41049a | 2022-01-21 14:41:25 -0800 | [diff] [blame] | 8479 | return NULL; |
| 8480 | } |
| 8481 | return ret; |
Joshua Haberman | 9abf6e2 | 2021-01-13 12:16:25 -0800 | [diff] [blame] | 8482 | } |
Joshua Haberman | f41049a | 2022-01-21 14:41:25 -0800 | [diff] [blame] | 8483 | UPB_INLINE char* google_protobuf_MethodDescriptorProto_serialize(const google_protobuf_MethodDescriptorProto* msg, upb_Arena* arena, size_t* len) { |
Joshua Haberman | d3995ec | 2022-09-30 16:54:39 -0700 | [diff] [blame] | 8484 | char* ptr; |
Protobuf Team Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 8485 | (void)upb_Encode(UPB_UPCAST(msg), &google__protobuf__MethodDescriptorProto_msg_init, 0, arena, &ptr, len); |
Joshua Haberman | d3995ec | 2022-09-30 16:54:39 -0700 | [diff] [blame] | 8486 | return ptr; |
Joshua Haberman | f41049a | 2022-01-21 14:41:25 -0800 | [diff] [blame] | 8487 | } |
| 8488 | UPB_INLINE char* google_protobuf_MethodDescriptorProto_serialize_ex(const google_protobuf_MethodDescriptorProto* msg, int options, |
| 8489 | upb_Arena* arena, size_t* len) { |
Joshua Haberman | d3995ec | 2022-09-30 16:54:39 -0700 | [diff] [blame] | 8490 | char* ptr; |
Protobuf Team Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 8491 | (void)upb_Encode(UPB_UPCAST(msg), &google__protobuf__MethodDescriptorProto_msg_init, options, arena, &ptr, len); |
Joshua Haberman | d3995ec | 2022-09-30 16:54:39 -0700 | [diff] [blame] | 8492 | return ptr; |
Joshua Haberman | f41049a | 2022-01-21 14:41:25 -0800 | [diff] [blame] | 8493 | } |
Mike Kruskal | 3bc5049 | 2022-12-01 13:34:12 -0800 | [diff] [blame] | 8494 | UPB_INLINE void google_protobuf_MethodDescriptorProto_clear_name(google_protobuf_MethodDescriptorProto* msg) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 8495 | 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 Bot | 4e90ead | 2024-01-08 15:46:34 +0000 | [diff] [blame] | 8496 | upb_Message_ClearBaseField(UPB_UPCAST(msg), &field); |
Joshua Haberman | d3995ec | 2022-09-30 16:54:39 -0700 | [diff] [blame] | 8497 | } |
Joshua Haberman | f41049a | 2022-01-21 14:41:25 -0800 | [diff] [blame] | 8498 | UPB_INLINE upb_StringView google_protobuf_MethodDescriptorProto_name(const google_protobuf_MethodDescriptorProto* msg) { |
Eric Salo | 8809a11 | 2022-11-21 13:01:06 -0800 | [diff] [blame] | 8499 | upb_StringView default_val = upb_StringView_FromString(""); |
| 8500 | upb_StringView ret; |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 8501 | 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 Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 8502 | _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field, |
| 8503 | &default_val, &ret); |
Eric Salo | 8809a11 | 2022-11-21 13:01:06 -0800 | [diff] [blame] | 8504 | return ret; |
Joshua Haberman | f41049a | 2022-01-21 14:41:25 -0800 | [diff] [blame] | 8505 | } |
Mike Kruskal | 3bc5049 | 2022-12-01 13:34:12 -0800 | [diff] [blame] | 8506 | UPB_INLINE bool google_protobuf_MethodDescriptorProto_has_name(const google_protobuf_MethodDescriptorProto* msg) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 8507 | 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 Bot | 8c1f635 | 2024-01-10 05:18:15 +0000 | [diff] [blame] | 8508 | return upb_Message_HasBaseField(UPB_UPCAST(msg), &field); |
Joshua Haberman | 7ecf43f | 2022-03-14 13:11:29 -0700 | [diff] [blame] | 8509 | } |
Mike Kruskal | 3bc5049 | 2022-12-01 13:34:12 -0800 | [diff] [blame] | 8510 | UPB_INLINE void google_protobuf_MethodDescriptorProto_clear_input_type(google_protobuf_MethodDescriptorProto* msg) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 8511 | 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 Bot | 4e90ead | 2024-01-08 15:46:34 +0000 | [diff] [blame] | 8512 | upb_Message_ClearBaseField(UPB_UPCAST(msg), &field); |
Joshua Haberman | d3995ec | 2022-09-30 16:54:39 -0700 | [diff] [blame] | 8513 | } |
Joshua Haberman | f41049a | 2022-01-21 14:41:25 -0800 | [diff] [blame] | 8514 | UPB_INLINE upb_StringView google_protobuf_MethodDescriptorProto_input_type(const google_protobuf_MethodDescriptorProto* msg) { |
Eric Salo | 8809a11 | 2022-11-21 13:01:06 -0800 | [diff] [blame] | 8515 | upb_StringView default_val = upb_StringView_FromString(""); |
| 8516 | upb_StringView ret; |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 8517 | 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 Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 8518 | _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field, |
| 8519 | &default_val, &ret); |
Eric Salo | 8809a11 | 2022-11-21 13:01:06 -0800 | [diff] [blame] | 8520 | return ret; |
Joshua Haberman | f41049a | 2022-01-21 14:41:25 -0800 | [diff] [blame] | 8521 | } |
Mike Kruskal | 3bc5049 | 2022-12-01 13:34:12 -0800 | [diff] [blame] | 8522 | UPB_INLINE bool google_protobuf_MethodDescriptorProto_has_input_type(const google_protobuf_MethodDescriptorProto* msg) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 8523 | 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 Bot | 8c1f635 | 2024-01-10 05:18:15 +0000 | [diff] [blame] | 8524 | return upb_Message_HasBaseField(UPB_UPCAST(msg), &field); |
Joshua Haberman | 7ecf43f | 2022-03-14 13:11:29 -0700 | [diff] [blame] | 8525 | } |
Mike Kruskal | 3bc5049 | 2022-12-01 13:34:12 -0800 | [diff] [blame] | 8526 | UPB_INLINE void google_protobuf_MethodDescriptorProto_clear_output_type(google_protobuf_MethodDescriptorProto* msg) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 8527 | 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 Bot | 4e90ead | 2024-01-08 15:46:34 +0000 | [diff] [blame] | 8528 | upb_Message_ClearBaseField(UPB_UPCAST(msg), &field); |
Joshua Haberman | d3995ec | 2022-09-30 16:54:39 -0700 | [diff] [blame] | 8529 | } |
Joshua Haberman | f41049a | 2022-01-21 14:41:25 -0800 | [diff] [blame] | 8530 | UPB_INLINE upb_StringView google_protobuf_MethodDescriptorProto_output_type(const google_protobuf_MethodDescriptorProto* msg) { |
Eric Salo | 8809a11 | 2022-11-21 13:01:06 -0800 | [diff] [blame] | 8531 | upb_StringView default_val = upb_StringView_FromString(""); |
| 8532 | upb_StringView ret; |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 8533 | 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 Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 8534 | _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field, |
| 8535 | &default_val, &ret); |
Eric Salo | 8809a11 | 2022-11-21 13:01:06 -0800 | [diff] [blame] | 8536 | return ret; |
Joshua Haberman | f41049a | 2022-01-21 14:41:25 -0800 | [diff] [blame] | 8537 | } |
Mike Kruskal | 3bc5049 | 2022-12-01 13:34:12 -0800 | [diff] [blame] | 8538 | UPB_INLINE bool google_protobuf_MethodDescriptorProto_has_output_type(const google_protobuf_MethodDescriptorProto* msg) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 8539 | 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 Bot | 8c1f635 | 2024-01-10 05:18:15 +0000 | [diff] [blame] | 8540 | return upb_Message_HasBaseField(UPB_UPCAST(msg), &field); |
Joshua Haberman | 7ecf43f | 2022-03-14 13:11:29 -0700 | [diff] [blame] | 8541 | } |
Mike Kruskal | 3bc5049 | 2022-12-01 13:34:12 -0800 | [diff] [blame] | 8542 | UPB_INLINE void google_protobuf_MethodDescriptorProto_clear_options(google_protobuf_MethodDescriptorProto* msg) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 8543 | 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 Bot | 4e90ead | 2024-01-08 15:46:34 +0000 | [diff] [blame] | 8544 | upb_Message_ClearBaseField(UPB_UPCAST(msg), &field); |
Joshua Haberman | d3995ec | 2022-09-30 16:54:39 -0700 | [diff] [blame] | 8545 | } |
Joshua Haberman | f41049a | 2022-01-21 14:41:25 -0800 | [diff] [blame] | 8546 | UPB_INLINE const google_protobuf_MethodOptions* google_protobuf_MethodDescriptorProto_options(const google_protobuf_MethodDescriptorProto* msg) { |
Eric Salo | 8809a11 | 2022-11-21 13:01:06 -0800 | [diff] [blame] | 8547 | const google_protobuf_MethodOptions* default_val = NULL; |
| 8548 | const google_protobuf_MethodOptions* ret; |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 8549 | 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 Bot | a9387b5 | 2024-06-12 15:17:52 +0000 | [diff] [blame] | 8550 | UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__MethodOptions_msg_init); |
Protobuf Team Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 8551 | _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field, |
| 8552 | &default_val, &ret); |
Eric Salo | 8809a11 | 2022-11-21 13:01:06 -0800 | [diff] [blame] | 8553 | return ret; |
Joshua Haberman | f41049a | 2022-01-21 14:41:25 -0800 | [diff] [blame] | 8554 | } |
Mike Kruskal | 3bc5049 | 2022-12-01 13:34:12 -0800 | [diff] [blame] | 8555 | UPB_INLINE bool google_protobuf_MethodDescriptorProto_has_options(const google_protobuf_MethodDescriptorProto* msg) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 8556 | 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 Bot | 8c1f635 | 2024-01-10 05:18:15 +0000 | [diff] [blame] | 8557 | return upb_Message_HasBaseField(UPB_UPCAST(msg), &field); |
Joshua Haberman | 7ecf43f | 2022-03-14 13:11:29 -0700 | [diff] [blame] | 8558 | } |
Mike Kruskal | 3bc5049 | 2022-12-01 13:34:12 -0800 | [diff] [blame] | 8559 | UPB_INLINE void google_protobuf_MethodDescriptorProto_clear_client_streaming(google_protobuf_MethodDescriptorProto* msg) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 8560 | 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 Bot | 4e90ead | 2024-01-08 15:46:34 +0000 | [diff] [blame] | 8561 | upb_Message_ClearBaseField(UPB_UPCAST(msg), &field); |
Joshua Haberman | d3995ec | 2022-09-30 16:54:39 -0700 | [diff] [blame] | 8562 | } |
Joshua Haberman | f41049a | 2022-01-21 14:41:25 -0800 | [diff] [blame] | 8563 | UPB_INLINE bool google_protobuf_MethodDescriptorProto_client_streaming(const google_protobuf_MethodDescriptorProto* msg) { |
Eric Salo | 8809a11 | 2022-11-21 13:01:06 -0800 | [diff] [blame] | 8564 | bool default_val = false; |
| 8565 | bool ret; |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 8566 | 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 Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 8567 | _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field, |
| 8568 | &default_val, &ret); |
Eric Salo | 8809a11 | 2022-11-21 13:01:06 -0800 | [diff] [blame] | 8569 | return ret; |
Joshua Haberman | f41049a | 2022-01-21 14:41:25 -0800 | [diff] [blame] | 8570 | } |
Mike Kruskal | 3bc5049 | 2022-12-01 13:34:12 -0800 | [diff] [blame] | 8571 | UPB_INLINE bool google_protobuf_MethodDescriptorProto_has_client_streaming(const google_protobuf_MethodDescriptorProto* msg) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 8572 | 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 Bot | 8c1f635 | 2024-01-10 05:18:15 +0000 | [diff] [blame] | 8573 | return upb_Message_HasBaseField(UPB_UPCAST(msg), &field); |
Joshua Haberman | 7ecf43f | 2022-03-14 13:11:29 -0700 | [diff] [blame] | 8574 | } |
Mike Kruskal | 3bc5049 | 2022-12-01 13:34:12 -0800 | [diff] [blame] | 8575 | UPB_INLINE void google_protobuf_MethodDescriptorProto_clear_server_streaming(google_protobuf_MethodDescriptorProto* msg) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 8576 | 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 Bot | 4e90ead | 2024-01-08 15:46:34 +0000 | [diff] [blame] | 8577 | upb_Message_ClearBaseField(UPB_UPCAST(msg), &field); |
Joshua Haberman | d3995ec | 2022-09-30 16:54:39 -0700 | [diff] [blame] | 8578 | } |
Joshua Haberman | f41049a | 2022-01-21 14:41:25 -0800 | [diff] [blame] | 8579 | UPB_INLINE bool google_protobuf_MethodDescriptorProto_server_streaming(const google_protobuf_MethodDescriptorProto* msg) { |
Eric Salo | 8809a11 | 2022-11-21 13:01:06 -0800 | [diff] [blame] | 8580 | bool default_val = false; |
| 8581 | bool ret; |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 8582 | 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 Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 8583 | _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field, |
| 8584 | &default_val, &ret); |
Eric Salo | 8809a11 | 2022-11-21 13:01:06 -0800 | [diff] [blame] | 8585 | return ret; |
Joshua Haberman | f41049a | 2022-01-21 14:41:25 -0800 | [diff] [blame] | 8586 | } |
Mike Kruskal | 3bc5049 | 2022-12-01 13:34:12 -0800 | [diff] [blame] | 8587 | UPB_INLINE bool google_protobuf_MethodDescriptorProto_has_server_streaming(const google_protobuf_MethodDescriptorProto* msg) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 8588 | 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 Bot | 8c1f635 | 2024-01-10 05:18:15 +0000 | [diff] [blame] | 8589 | return upb_Message_HasBaseField(UPB_UPCAST(msg), &field); |
Mike Kruskal | 3bc5049 | 2022-12-01 13:34:12 -0800 | [diff] [blame] | 8590 | } |
Joshua Haberman | 9abf6e2 | 2021-01-13 12:16:25 -0800 | [diff] [blame] | 8591 | |
Joshua Haberman | f41049a | 2022-01-21 14:41:25 -0800 | [diff] [blame] | 8592 | UPB_INLINE void google_protobuf_MethodDescriptorProto_set_name(google_protobuf_MethodDescriptorProto *msg, upb_StringView value) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 8593 | 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 Bot | ac32c97 | 2024-04-10 03:30:05 +0000 | [diff] [blame] | 8594 | upb_Message_SetBaseField((upb_Message *)msg, &field, &value); |
Mike Kruskal | 232ecf4 | 2023-01-14 00:09:40 -0800 | [diff] [blame] | 8595 | } |
| 8596 | UPB_INLINE void google_protobuf_MethodDescriptorProto_set_input_type(google_protobuf_MethodDescriptorProto *msg, upb_StringView value) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 8597 | 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 Bot | ac32c97 | 2024-04-10 03:30:05 +0000 | [diff] [blame] | 8598 | upb_Message_SetBaseField((upb_Message *)msg, &field, &value); |
Mike Kruskal | 232ecf4 | 2023-01-14 00:09:40 -0800 | [diff] [blame] | 8599 | } |
| 8600 | UPB_INLINE void google_protobuf_MethodDescriptorProto_set_output_type(google_protobuf_MethodDescriptorProto *msg, upb_StringView value) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 8601 | 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 Bot | ac32c97 | 2024-04-10 03:30:05 +0000 | [diff] [blame] | 8602 | upb_Message_SetBaseField((upb_Message *)msg, &field, &value); |
Mike Kruskal | 232ecf4 | 2023-01-14 00:09:40 -0800 | [diff] [blame] | 8603 | } |
| 8604 | UPB_INLINE void google_protobuf_MethodDescriptorProto_set_options(google_protobuf_MethodDescriptorProto *msg, google_protobuf_MethodOptions* value) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 8605 | 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 Bot | a9387b5 | 2024-06-12 15:17:52 +0000 | [diff] [blame] | 8606 | UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__MethodOptions_msg_init); |
Protobuf Team Bot | ac32c97 | 2024-04-10 03:30:05 +0000 | [diff] [blame] | 8607 | upb_Message_SetBaseField((upb_Message *)msg, &field, &value); |
Mike Kruskal | 232ecf4 | 2023-01-14 00:09:40 -0800 | [diff] [blame] | 8608 | } |
| 8609 | UPB_INLINE struct google_protobuf_MethodOptions* google_protobuf_MethodDescriptorProto_mutable_options(google_protobuf_MethodDescriptorProto* msg, upb_Arena* arena) { |
Joshua Haberman | 9abf6e2 | 2021-01-13 12:16:25 -0800 | [diff] [blame] | 8610 | struct google_protobuf_MethodOptions* sub = (struct google_protobuf_MethodOptions*)google_protobuf_MethodDescriptorProto_options(msg); |
| 8611 | if (sub == NULL) { |
Protobuf Team Bot | 4ffe086 | 2023-12-06 02:02:36 +0000 | [diff] [blame] | 8612 | sub = (struct google_protobuf_MethodOptions*)_upb_Message_New(&google__protobuf__MethodOptions_msg_init, arena); |
Eric Salo | 8809a11 | 2022-11-21 13:01:06 -0800 | [diff] [blame] | 8613 | if (sub) google_protobuf_MethodDescriptorProto_set_options(msg, sub); |
Joshua Haberman | 9abf6e2 | 2021-01-13 12:16:25 -0800 | [diff] [blame] | 8614 | } |
| 8615 | return sub; |
| 8616 | } |
| 8617 | UPB_INLINE void google_protobuf_MethodDescriptorProto_set_client_streaming(google_protobuf_MethodDescriptorProto *msg, bool value) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 8618 | 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 Bot | ac32c97 | 2024-04-10 03:30:05 +0000 | [diff] [blame] | 8619 | upb_Message_SetBaseField((upb_Message *)msg, &field, &value); |
Mike Kruskal | 232ecf4 | 2023-01-14 00:09:40 -0800 | [diff] [blame] | 8620 | } |
| 8621 | UPB_INLINE void google_protobuf_MethodDescriptorProto_set_server_streaming(google_protobuf_MethodDescriptorProto *msg, bool value) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 8622 | 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 Bot | ac32c97 | 2024-04-10 03:30:05 +0000 | [diff] [blame] | 8623 | upb_Message_SetBaseField((upb_Message *)msg, &field, &value); |
Joshua Haberman | 9abf6e2 | 2021-01-13 12:16:25 -0800 | [diff] [blame] | 8624 | } |
Mike Kruskal | 232ecf4 | 2023-01-14 00:09:40 -0800 | [diff] [blame] | 8625 | |
Joshua Haberman | 9abf6e2 | 2021-01-13 12:16:25 -0800 | [diff] [blame] | 8626 | /* google.protobuf.FileOptions */ |
| 8627 | |
Joshua Haberman | f41049a | 2022-01-21 14:41:25 -0800 | [diff] [blame] | 8628 | UPB_INLINE google_protobuf_FileOptions* google_protobuf_FileOptions_new(upb_Arena* arena) { |
Protobuf Team Bot | 4ffe086 | 2023-12-06 02:02:36 +0000 | [diff] [blame] | 8629 | return (google_protobuf_FileOptions*)_upb_Message_New(&google__protobuf__FileOptions_msg_init, arena); |
Joshua Haberman | 9abf6e2 | 2021-01-13 12:16:25 -0800 | [diff] [blame] | 8630 | } |
Joshua Haberman | f41049a | 2022-01-21 14:41:25 -0800 | [diff] [blame] | 8631 | UPB_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 Haberman | 9d578a3 | 2021-08-02 15:32:01 -0700 | [diff] [blame] | 8633 | if (!ret) return NULL; |
Protobuf Team Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 8634 | if (upb_Decode(buf, size, UPB_UPCAST(ret), &google__protobuf__FileOptions_msg_init, NULL, 0, arena) != |
| 8635 | kUpb_DecodeStatus_Ok) { |
Joshua Haberman | 9d578a3 | 2021-08-02 15:32:01 -0700 | [diff] [blame] | 8636 | return NULL; |
| 8637 | } |
| 8638 | return ret; |
Joshua Haberman | 9abf6e2 | 2021-01-13 12:16:25 -0800 | [diff] [blame] | 8639 | } |
Joshua Haberman | f41049a | 2022-01-21 14:41:25 -0800 | [diff] [blame] | 8640 | UPB_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 Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 8645 | if (upb_Decode(buf, size, UPB_UPCAST(ret), &google__protobuf__FileOptions_msg_init, extreg, options, |
| 8646 | arena) != kUpb_DecodeStatus_Ok) { |
Joshua Haberman | f41049a | 2022-01-21 14:41:25 -0800 | [diff] [blame] | 8647 | return NULL; |
| 8648 | } |
| 8649 | return ret; |
Joshua Haberman | 9abf6e2 | 2021-01-13 12:16:25 -0800 | [diff] [blame] | 8650 | } |
Joshua Haberman | f41049a | 2022-01-21 14:41:25 -0800 | [diff] [blame] | 8651 | UPB_INLINE char* google_protobuf_FileOptions_serialize(const google_protobuf_FileOptions* msg, upb_Arena* arena, size_t* len) { |
Joshua Haberman | d3995ec | 2022-09-30 16:54:39 -0700 | [diff] [blame] | 8652 | char* ptr; |
Protobuf Team Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 8653 | (void)upb_Encode(UPB_UPCAST(msg), &google__protobuf__FileOptions_msg_init, 0, arena, &ptr, len); |
Joshua Haberman | d3995ec | 2022-09-30 16:54:39 -0700 | [diff] [blame] | 8654 | return ptr; |
Joshua Haberman | f41049a | 2022-01-21 14:41:25 -0800 | [diff] [blame] | 8655 | } |
| 8656 | UPB_INLINE char* google_protobuf_FileOptions_serialize_ex(const google_protobuf_FileOptions* msg, int options, |
| 8657 | upb_Arena* arena, size_t* len) { |
Joshua Haberman | d3995ec | 2022-09-30 16:54:39 -0700 | [diff] [blame] | 8658 | char* ptr; |
Protobuf Team Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 8659 | (void)upb_Encode(UPB_UPCAST(msg), &google__protobuf__FileOptions_msg_init, options, arena, &ptr, len); |
Joshua Haberman | d3995ec | 2022-09-30 16:54:39 -0700 | [diff] [blame] | 8660 | return ptr; |
Joshua Haberman | f41049a | 2022-01-21 14:41:25 -0800 | [diff] [blame] | 8661 | } |
Mike Kruskal | 3bc5049 | 2022-12-01 13:34:12 -0800 | [diff] [blame] | 8662 | UPB_INLINE void google_protobuf_FileOptions_clear_java_package(google_protobuf_FileOptions* msg) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 8663 | 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 Bot | 4e90ead | 2024-01-08 15:46:34 +0000 | [diff] [blame] | 8664 | upb_Message_ClearBaseField(UPB_UPCAST(msg), &field); |
Joshua Haberman | d3995ec | 2022-09-30 16:54:39 -0700 | [diff] [blame] | 8665 | } |
Joshua Haberman | f41049a | 2022-01-21 14:41:25 -0800 | [diff] [blame] | 8666 | UPB_INLINE upb_StringView google_protobuf_FileOptions_java_package(const google_protobuf_FileOptions* msg) { |
Eric Salo | 8809a11 | 2022-11-21 13:01:06 -0800 | [diff] [blame] | 8667 | upb_StringView default_val = upb_StringView_FromString(""); |
| 8668 | upb_StringView ret; |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 8669 | 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 Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 8670 | _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field, |
| 8671 | &default_val, &ret); |
Eric Salo | 8809a11 | 2022-11-21 13:01:06 -0800 | [diff] [blame] | 8672 | return ret; |
Joshua Haberman | f41049a | 2022-01-21 14:41:25 -0800 | [diff] [blame] | 8673 | } |
Mike Kruskal | 3bc5049 | 2022-12-01 13:34:12 -0800 | [diff] [blame] | 8674 | UPB_INLINE bool google_protobuf_FileOptions_has_java_package(const google_protobuf_FileOptions* msg) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 8675 | 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 Bot | 8c1f635 | 2024-01-10 05:18:15 +0000 | [diff] [blame] | 8676 | return upb_Message_HasBaseField(UPB_UPCAST(msg), &field); |
Joshua Haberman | 7ecf43f | 2022-03-14 13:11:29 -0700 | [diff] [blame] | 8677 | } |
Mike Kruskal | 3bc5049 | 2022-12-01 13:34:12 -0800 | [diff] [blame] | 8678 | UPB_INLINE void google_protobuf_FileOptions_clear_java_outer_classname(google_protobuf_FileOptions* msg) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 8679 | 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 Bot | 4e90ead | 2024-01-08 15:46:34 +0000 | [diff] [blame] | 8680 | upb_Message_ClearBaseField(UPB_UPCAST(msg), &field); |
Joshua Haberman | d3995ec | 2022-09-30 16:54:39 -0700 | [diff] [blame] | 8681 | } |
Joshua Haberman | f41049a | 2022-01-21 14:41:25 -0800 | [diff] [blame] | 8682 | UPB_INLINE upb_StringView google_protobuf_FileOptions_java_outer_classname(const google_protobuf_FileOptions* msg) { |
Eric Salo | 8809a11 | 2022-11-21 13:01:06 -0800 | [diff] [blame] | 8683 | upb_StringView default_val = upb_StringView_FromString(""); |
| 8684 | upb_StringView ret; |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 8685 | 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 Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 8686 | _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field, |
| 8687 | &default_val, &ret); |
Eric Salo | 8809a11 | 2022-11-21 13:01:06 -0800 | [diff] [blame] | 8688 | return ret; |
Joshua Haberman | f41049a | 2022-01-21 14:41:25 -0800 | [diff] [blame] | 8689 | } |
Mike Kruskal | 3bc5049 | 2022-12-01 13:34:12 -0800 | [diff] [blame] | 8690 | UPB_INLINE bool google_protobuf_FileOptions_has_java_outer_classname(const google_protobuf_FileOptions* msg) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 8691 | 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 Bot | 8c1f635 | 2024-01-10 05:18:15 +0000 | [diff] [blame] | 8692 | return upb_Message_HasBaseField(UPB_UPCAST(msg), &field); |
Joshua Haberman | 7ecf43f | 2022-03-14 13:11:29 -0700 | [diff] [blame] | 8693 | } |
Mike Kruskal | 3bc5049 | 2022-12-01 13:34:12 -0800 | [diff] [blame] | 8694 | UPB_INLINE void google_protobuf_FileOptions_clear_optimize_for(google_protobuf_FileOptions* msg) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 8695 | const upb_MiniTableField field = {9, 12, 66, 2, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; |
Protobuf Team Bot | 4e90ead | 2024-01-08 15:46:34 +0000 | [diff] [blame] | 8696 | upb_Message_ClearBaseField(UPB_UPCAST(msg), &field); |
Joshua Haberman | d3995ec | 2022-09-30 16:54:39 -0700 | [diff] [blame] | 8697 | } |
Joshua Haberman | f41049a | 2022-01-21 14:41:25 -0800 | [diff] [blame] | 8698 | UPB_INLINE int32_t google_protobuf_FileOptions_optimize_for(const google_protobuf_FileOptions* msg) { |
Eric Salo | 8809a11 | 2022-11-21 13:01:06 -0800 | [diff] [blame] | 8699 | int32_t default_val = 1; |
| 8700 | int32_t ret; |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 8701 | const upb_MiniTableField field = {9, 12, 66, 2, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; |
Protobuf Team Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 8702 | _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field, |
| 8703 | &default_val, &ret); |
Eric Salo | 8809a11 | 2022-11-21 13:01:06 -0800 | [diff] [blame] | 8704 | return ret; |
Joshua Haberman | f41049a | 2022-01-21 14:41:25 -0800 | [diff] [blame] | 8705 | } |
Mike Kruskal | 3bc5049 | 2022-12-01 13:34:12 -0800 | [diff] [blame] | 8706 | UPB_INLINE bool google_protobuf_FileOptions_has_optimize_for(const google_protobuf_FileOptions* msg) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 8707 | const upb_MiniTableField field = {9, 12, 66, 2, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; |
Protobuf Team Bot | 8c1f635 | 2024-01-10 05:18:15 +0000 | [diff] [blame] | 8708 | return upb_Message_HasBaseField(UPB_UPCAST(msg), &field); |
Joshua Haberman | 7ecf43f | 2022-03-14 13:11:29 -0700 | [diff] [blame] | 8709 | } |
Mike Kruskal | 3bc5049 | 2022-12-01 13:34:12 -0800 | [diff] [blame] | 8710 | UPB_INLINE void google_protobuf_FileOptions_clear_java_multiple_files(google_protobuf_FileOptions* msg) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 8711 | const upb_MiniTableField field = {10, 16, 67, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; |
Protobuf Team Bot | 4e90ead | 2024-01-08 15:46:34 +0000 | [diff] [blame] | 8712 | upb_Message_ClearBaseField(UPB_UPCAST(msg), &field); |
Joshua Haberman | d3995ec | 2022-09-30 16:54:39 -0700 | [diff] [blame] | 8713 | } |
Joshua Haberman | f41049a | 2022-01-21 14:41:25 -0800 | [diff] [blame] | 8714 | UPB_INLINE bool google_protobuf_FileOptions_java_multiple_files(const google_protobuf_FileOptions* msg) { |
Eric Salo | 8809a11 | 2022-11-21 13:01:06 -0800 | [diff] [blame] | 8715 | bool default_val = false; |
| 8716 | bool ret; |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 8717 | const upb_MiniTableField field = {10, 16, 67, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; |
Protobuf Team Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 8718 | _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field, |
| 8719 | &default_val, &ret); |
Eric Salo | 8809a11 | 2022-11-21 13:01:06 -0800 | [diff] [blame] | 8720 | return ret; |
Joshua Haberman | f41049a | 2022-01-21 14:41:25 -0800 | [diff] [blame] | 8721 | } |
Mike Kruskal | 3bc5049 | 2022-12-01 13:34:12 -0800 | [diff] [blame] | 8722 | UPB_INLINE bool google_protobuf_FileOptions_has_java_multiple_files(const google_protobuf_FileOptions* msg) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 8723 | const upb_MiniTableField field = {10, 16, 67, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; |
Protobuf Team Bot | 8c1f635 | 2024-01-10 05:18:15 +0000 | [diff] [blame] | 8724 | return upb_Message_HasBaseField(UPB_UPCAST(msg), &field); |
Joshua Haberman | 7ecf43f | 2022-03-14 13:11:29 -0700 | [diff] [blame] | 8725 | } |
Mike Kruskal | 3bc5049 | 2022-12-01 13:34:12 -0800 | [diff] [blame] | 8726 | UPB_INLINE void google_protobuf_FileOptions_clear_go_package(google_protobuf_FileOptions* msg) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 8727 | 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 Bot | 4e90ead | 2024-01-08 15:46:34 +0000 | [diff] [blame] | 8728 | upb_Message_ClearBaseField(UPB_UPCAST(msg), &field); |
Joshua Haberman | d3995ec | 2022-09-30 16:54:39 -0700 | [diff] [blame] | 8729 | } |
Joshua Haberman | f41049a | 2022-01-21 14:41:25 -0800 | [diff] [blame] | 8730 | UPB_INLINE upb_StringView google_protobuf_FileOptions_go_package(const google_protobuf_FileOptions* msg) { |
Eric Salo | 8809a11 | 2022-11-21 13:01:06 -0800 | [diff] [blame] | 8731 | upb_StringView default_val = upb_StringView_FromString(""); |
| 8732 | upb_StringView ret; |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 8733 | 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 Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 8734 | _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field, |
| 8735 | &default_val, &ret); |
Eric Salo | 8809a11 | 2022-11-21 13:01:06 -0800 | [diff] [blame] | 8736 | return ret; |
Joshua Haberman | f41049a | 2022-01-21 14:41:25 -0800 | [diff] [blame] | 8737 | } |
Mike Kruskal | 3bc5049 | 2022-12-01 13:34:12 -0800 | [diff] [blame] | 8738 | UPB_INLINE bool google_protobuf_FileOptions_has_go_package(const google_protobuf_FileOptions* msg) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 8739 | 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 Bot | 8c1f635 | 2024-01-10 05:18:15 +0000 | [diff] [blame] | 8740 | return upb_Message_HasBaseField(UPB_UPCAST(msg), &field); |
Joshua Haberman | 7ecf43f | 2022-03-14 13:11:29 -0700 | [diff] [blame] | 8741 | } |
Mike Kruskal | 3bc5049 | 2022-12-01 13:34:12 -0800 | [diff] [blame] | 8742 | UPB_INLINE void google_protobuf_FileOptions_clear_cc_generic_services(google_protobuf_FileOptions* msg) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 8743 | const upb_MiniTableField field = {16, 17, 69, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; |
Protobuf Team Bot | 4e90ead | 2024-01-08 15:46:34 +0000 | [diff] [blame] | 8744 | upb_Message_ClearBaseField(UPB_UPCAST(msg), &field); |
Joshua Haberman | d3995ec | 2022-09-30 16:54:39 -0700 | [diff] [blame] | 8745 | } |
Joshua Haberman | f41049a | 2022-01-21 14:41:25 -0800 | [diff] [blame] | 8746 | UPB_INLINE bool google_protobuf_FileOptions_cc_generic_services(const google_protobuf_FileOptions* msg) { |
Eric Salo | 8809a11 | 2022-11-21 13:01:06 -0800 | [diff] [blame] | 8747 | bool default_val = false; |
| 8748 | bool ret; |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 8749 | const upb_MiniTableField field = {16, 17, 69, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; |
Protobuf Team Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 8750 | _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field, |
| 8751 | &default_val, &ret); |
Eric Salo | 8809a11 | 2022-11-21 13:01:06 -0800 | [diff] [blame] | 8752 | return ret; |
Joshua Haberman | f41049a | 2022-01-21 14:41:25 -0800 | [diff] [blame] | 8753 | } |
Mike Kruskal | 3bc5049 | 2022-12-01 13:34:12 -0800 | [diff] [blame] | 8754 | UPB_INLINE bool google_protobuf_FileOptions_has_cc_generic_services(const google_protobuf_FileOptions* msg) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 8755 | const upb_MiniTableField field = {16, 17, 69, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; |
Protobuf Team Bot | 8c1f635 | 2024-01-10 05:18:15 +0000 | [diff] [blame] | 8756 | return upb_Message_HasBaseField(UPB_UPCAST(msg), &field); |
Joshua Haberman | 7ecf43f | 2022-03-14 13:11:29 -0700 | [diff] [blame] | 8757 | } |
Mike Kruskal | 3bc5049 | 2022-12-01 13:34:12 -0800 | [diff] [blame] | 8758 | UPB_INLINE void google_protobuf_FileOptions_clear_java_generic_services(google_protobuf_FileOptions* msg) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 8759 | const upb_MiniTableField field = {17, 18, 70, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; |
Protobuf Team Bot | 4e90ead | 2024-01-08 15:46:34 +0000 | [diff] [blame] | 8760 | upb_Message_ClearBaseField(UPB_UPCAST(msg), &field); |
Joshua Haberman | d3995ec | 2022-09-30 16:54:39 -0700 | [diff] [blame] | 8761 | } |
Joshua Haberman | f41049a | 2022-01-21 14:41:25 -0800 | [diff] [blame] | 8762 | UPB_INLINE bool google_protobuf_FileOptions_java_generic_services(const google_protobuf_FileOptions* msg) { |
Eric Salo | 8809a11 | 2022-11-21 13:01:06 -0800 | [diff] [blame] | 8763 | bool default_val = false; |
| 8764 | bool ret; |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 8765 | const upb_MiniTableField field = {17, 18, 70, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; |
Protobuf Team Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 8766 | _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field, |
| 8767 | &default_val, &ret); |
Eric Salo | 8809a11 | 2022-11-21 13:01:06 -0800 | [diff] [blame] | 8768 | return ret; |
Joshua Haberman | f41049a | 2022-01-21 14:41:25 -0800 | [diff] [blame] | 8769 | } |
Mike Kruskal | 3bc5049 | 2022-12-01 13:34:12 -0800 | [diff] [blame] | 8770 | UPB_INLINE bool google_protobuf_FileOptions_has_java_generic_services(const google_protobuf_FileOptions* msg) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 8771 | const upb_MiniTableField field = {17, 18, 70, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; |
Protobuf Team Bot | 8c1f635 | 2024-01-10 05:18:15 +0000 | [diff] [blame] | 8772 | return upb_Message_HasBaseField(UPB_UPCAST(msg), &field); |
Joshua Haberman | 7ecf43f | 2022-03-14 13:11:29 -0700 | [diff] [blame] | 8773 | } |
Mike Kruskal | 3bc5049 | 2022-12-01 13:34:12 -0800 | [diff] [blame] | 8774 | UPB_INLINE void google_protobuf_FileOptions_clear_py_generic_services(google_protobuf_FileOptions* msg) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 8775 | const upb_MiniTableField field = {18, 19, 71, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; |
Protobuf Team Bot | 4e90ead | 2024-01-08 15:46:34 +0000 | [diff] [blame] | 8776 | upb_Message_ClearBaseField(UPB_UPCAST(msg), &field); |
Joshua Haberman | d3995ec | 2022-09-30 16:54:39 -0700 | [diff] [blame] | 8777 | } |
Joshua Haberman | f41049a | 2022-01-21 14:41:25 -0800 | [diff] [blame] | 8778 | UPB_INLINE bool google_protobuf_FileOptions_py_generic_services(const google_protobuf_FileOptions* msg) { |
Eric Salo | 8809a11 | 2022-11-21 13:01:06 -0800 | [diff] [blame] | 8779 | bool default_val = false; |
| 8780 | bool ret; |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 8781 | const upb_MiniTableField field = {18, 19, 71, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; |
Protobuf Team Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 8782 | _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field, |
| 8783 | &default_val, &ret); |
Eric Salo | 8809a11 | 2022-11-21 13:01:06 -0800 | [diff] [blame] | 8784 | return ret; |
Joshua Haberman | f41049a | 2022-01-21 14:41:25 -0800 | [diff] [blame] | 8785 | } |
Mike Kruskal | 3bc5049 | 2022-12-01 13:34:12 -0800 | [diff] [blame] | 8786 | UPB_INLINE bool google_protobuf_FileOptions_has_py_generic_services(const google_protobuf_FileOptions* msg) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 8787 | const upb_MiniTableField field = {18, 19, 71, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; |
Protobuf Team Bot | 8c1f635 | 2024-01-10 05:18:15 +0000 | [diff] [blame] | 8788 | return upb_Message_HasBaseField(UPB_UPCAST(msg), &field); |
Joshua Haberman | 7ecf43f | 2022-03-14 13:11:29 -0700 | [diff] [blame] | 8789 | } |
Mike Kruskal | 3bc5049 | 2022-12-01 13:34:12 -0800 | [diff] [blame] | 8790 | UPB_INLINE void google_protobuf_FileOptions_clear_java_generate_equals_and_hash(google_protobuf_FileOptions* msg) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 8791 | const upb_MiniTableField field = {20, 20, 72, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; |
Protobuf Team Bot | 4e90ead | 2024-01-08 15:46:34 +0000 | [diff] [blame] | 8792 | upb_Message_ClearBaseField(UPB_UPCAST(msg), &field); |
Joshua Haberman | d3995ec | 2022-09-30 16:54:39 -0700 | [diff] [blame] | 8793 | } |
Joshua Haberman | f41049a | 2022-01-21 14:41:25 -0800 | [diff] [blame] | 8794 | UPB_INLINE bool google_protobuf_FileOptions_java_generate_equals_and_hash(const google_protobuf_FileOptions* msg) { |
Eric Salo | 8809a11 | 2022-11-21 13:01:06 -0800 | [diff] [blame] | 8795 | bool default_val = false; |
| 8796 | bool ret; |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 8797 | const upb_MiniTableField field = {20, 20, 72, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; |
Protobuf Team Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 8798 | _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field, |
| 8799 | &default_val, &ret); |
Eric Salo | 8809a11 | 2022-11-21 13:01:06 -0800 | [diff] [blame] | 8800 | return ret; |
Joshua Haberman | f41049a | 2022-01-21 14:41:25 -0800 | [diff] [blame] | 8801 | } |
Mike Kruskal | 3bc5049 | 2022-12-01 13:34:12 -0800 | [diff] [blame] | 8802 | UPB_INLINE bool google_protobuf_FileOptions_has_java_generate_equals_and_hash(const google_protobuf_FileOptions* msg) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 8803 | const upb_MiniTableField field = {20, 20, 72, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; |
Protobuf Team Bot | 8c1f635 | 2024-01-10 05:18:15 +0000 | [diff] [blame] | 8804 | return upb_Message_HasBaseField(UPB_UPCAST(msg), &field); |
Joshua Haberman | 7ecf43f | 2022-03-14 13:11:29 -0700 | [diff] [blame] | 8805 | } |
Mike Kruskal | 3bc5049 | 2022-12-01 13:34:12 -0800 | [diff] [blame] | 8806 | UPB_INLINE void google_protobuf_FileOptions_clear_deprecated(google_protobuf_FileOptions* msg) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 8807 | const upb_MiniTableField field = {23, 21, 73, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; |
Protobuf Team Bot | 4e90ead | 2024-01-08 15:46:34 +0000 | [diff] [blame] | 8808 | upb_Message_ClearBaseField(UPB_UPCAST(msg), &field); |
Joshua Haberman | d3995ec | 2022-09-30 16:54:39 -0700 | [diff] [blame] | 8809 | } |
Joshua Haberman | f41049a | 2022-01-21 14:41:25 -0800 | [diff] [blame] | 8810 | UPB_INLINE bool google_protobuf_FileOptions_deprecated(const google_protobuf_FileOptions* msg) { |
Eric Salo | 8809a11 | 2022-11-21 13:01:06 -0800 | [diff] [blame] | 8811 | bool default_val = false; |
| 8812 | bool ret; |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 8813 | const upb_MiniTableField field = {23, 21, 73, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; |
Protobuf Team Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 8814 | _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field, |
| 8815 | &default_val, &ret); |
Eric Salo | 8809a11 | 2022-11-21 13:01:06 -0800 | [diff] [blame] | 8816 | return ret; |
Joshua Haberman | f41049a | 2022-01-21 14:41:25 -0800 | [diff] [blame] | 8817 | } |
Mike Kruskal | 3bc5049 | 2022-12-01 13:34:12 -0800 | [diff] [blame] | 8818 | UPB_INLINE bool google_protobuf_FileOptions_has_deprecated(const google_protobuf_FileOptions* msg) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 8819 | const upb_MiniTableField field = {23, 21, 73, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; |
Protobuf Team Bot | 8c1f635 | 2024-01-10 05:18:15 +0000 | [diff] [blame] | 8820 | return upb_Message_HasBaseField(UPB_UPCAST(msg), &field); |
Joshua Haberman | 7ecf43f | 2022-03-14 13:11:29 -0700 | [diff] [blame] | 8821 | } |
Mike Kruskal | 3bc5049 | 2022-12-01 13:34:12 -0800 | [diff] [blame] | 8822 | UPB_INLINE void google_protobuf_FileOptions_clear_java_string_check_utf8(google_protobuf_FileOptions* msg) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 8823 | const upb_MiniTableField field = {27, 22, 74, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; |
Protobuf Team Bot | 4e90ead | 2024-01-08 15:46:34 +0000 | [diff] [blame] | 8824 | upb_Message_ClearBaseField(UPB_UPCAST(msg), &field); |
Joshua Haberman | d3995ec | 2022-09-30 16:54:39 -0700 | [diff] [blame] | 8825 | } |
Joshua Haberman | f41049a | 2022-01-21 14:41:25 -0800 | [diff] [blame] | 8826 | UPB_INLINE bool google_protobuf_FileOptions_java_string_check_utf8(const google_protobuf_FileOptions* msg) { |
Eric Salo | 8809a11 | 2022-11-21 13:01:06 -0800 | [diff] [blame] | 8827 | bool default_val = false; |
| 8828 | bool ret; |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 8829 | const upb_MiniTableField field = {27, 22, 74, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; |
Protobuf Team Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 8830 | _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field, |
| 8831 | &default_val, &ret); |
Eric Salo | 8809a11 | 2022-11-21 13:01:06 -0800 | [diff] [blame] | 8832 | return ret; |
Joshua Haberman | f41049a | 2022-01-21 14:41:25 -0800 | [diff] [blame] | 8833 | } |
Mike Kruskal | 3bc5049 | 2022-12-01 13:34:12 -0800 | [diff] [blame] | 8834 | UPB_INLINE bool google_protobuf_FileOptions_has_java_string_check_utf8(const google_protobuf_FileOptions* msg) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 8835 | const upb_MiniTableField field = {27, 22, 74, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; |
Protobuf Team Bot | 8c1f635 | 2024-01-10 05:18:15 +0000 | [diff] [blame] | 8836 | return upb_Message_HasBaseField(UPB_UPCAST(msg), &field); |
Joshua Haberman | 7ecf43f | 2022-03-14 13:11:29 -0700 | [diff] [blame] | 8837 | } |
Mike Kruskal | 3bc5049 | 2022-12-01 13:34:12 -0800 | [diff] [blame] | 8838 | UPB_INLINE void google_protobuf_FileOptions_clear_cc_enable_arenas(google_protobuf_FileOptions* msg) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 8839 | const upb_MiniTableField field = {31, 23, 75, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; |
Protobuf Team Bot | 4e90ead | 2024-01-08 15:46:34 +0000 | [diff] [blame] | 8840 | upb_Message_ClearBaseField(UPB_UPCAST(msg), &field); |
Joshua Haberman | d3995ec | 2022-09-30 16:54:39 -0700 | [diff] [blame] | 8841 | } |
Joshua Haberman | f41049a | 2022-01-21 14:41:25 -0800 | [diff] [blame] | 8842 | UPB_INLINE bool google_protobuf_FileOptions_cc_enable_arenas(const google_protobuf_FileOptions* msg) { |
Eric Salo | 8809a11 | 2022-11-21 13:01:06 -0800 | [diff] [blame] | 8843 | bool default_val = true; |
| 8844 | bool ret; |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 8845 | const upb_MiniTableField field = {31, 23, 75, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; |
Protobuf Team Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 8846 | _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field, |
| 8847 | &default_val, &ret); |
Eric Salo | 8809a11 | 2022-11-21 13:01:06 -0800 | [diff] [blame] | 8848 | return ret; |
Joshua Haberman | f41049a | 2022-01-21 14:41:25 -0800 | [diff] [blame] | 8849 | } |
Mike Kruskal | 3bc5049 | 2022-12-01 13:34:12 -0800 | [diff] [blame] | 8850 | UPB_INLINE bool google_protobuf_FileOptions_has_cc_enable_arenas(const google_protobuf_FileOptions* msg) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 8851 | const upb_MiniTableField field = {31, 23, 75, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; |
Protobuf Team Bot | 8c1f635 | 2024-01-10 05:18:15 +0000 | [diff] [blame] | 8852 | return upb_Message_HasBaseField(UPB_UPCAST(msg), &field); |
Joshua Haberman | 7ecf43f | 2022-03-14 13:11:29 -0700 | [diff] [blame] | 8853 | } |
Mike Kruskal | 3bc5049 | 2022-12-01 13:34:12 -0800 | [diff] [blame] | 8854 | UPB_INLINE void google_protobuf_FileOptions_clear_objc_class_prefix(google_protobuf_FileOptions* msg) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 8855 | 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 Bot | 4e90ead | 2024-01-08 15:46:34 +0000 | [diff] [blame] | 8856 | upb_Message_ClearBaseField(UPB_UPCAST(msg), &field); |
Joshua Haberman | d3995ec | 2022-09-30 16:54:39 -0700 | [diff] [blame] | 8857 | } |
Joshua Haberman | f41049a | 2022-01-21 14:41:25 -0800 | [diff] [blame] | 8858 | UPB_INLINE upb_StringView google_protobuf_FileOptions_objc_class_prefix(const google_protobuf_FileOptions* msg) { |
Eric Salo | 8809a11 | 2022-11-21 13:01:06 -0800 | [diff] [blame] | 8859 | upb_StringView default_val = upb_StringView_FromString(""); |
| 8860 | upb_StringView ret; |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 8861 | 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 Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 8862 | _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field, |
| 8863 | &default_val, &ret); |
Eric Salo | 8809a11 | 2022-11-21 13:01:06 -0800 | [diff] [blame] | 8864 | return ret; |
Joshua Haberman | f41049a | 2022-01-21 14:41:25 -0800 | [diff] [blame] | 8865 | } |
Mike Kruskal | 3bc5049 | 2022-12-01 13:34:12 -0800 | [diff] [blame] | 8866 | UPB_INLINE bool google_protobuf_FileOptions_has_objc_class_prefix(const google_protobuf_FileOptions* msg) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 8867 | 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 Bot | 8c1f635 | 2024-01-10 05:18:15 +0000 | [diff] [blame] | 8868 | return upb_Message_HasBaseField(UPB_UPCAST(msg), &field); |
Joshua Haberman | 7ecf43f | 2022-03-14 13:11:29 -0700 | [diff] [blame] | 8869 | } |
Mike Kruskal | 3bc5049 | 2022-12-01 13:34:12 -0800 | [diff] [blame] | 8870 | UPB_INLINE void google_protobuf_FileOptions_clear_csharp_namespace(google_protobuf_FileOptions* msg) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 8871 | 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 Bot | 4e90ead | 2024-01-08 15:46:34 +0000 | [diff] [blame] | 8872 | upb_Message_ClearBaseField(UPB_UPCAST(msg), &field); |
Joshua Haberman | d3995ec | 2022-09-30 16:54:39 -0700 | [diff] [blame] | 8873 | } |
Joshua Haberman | f41049a | 2022-01-21 14:41:25 -0800 | [diff] [blame] | 8874 | UPB_INLINE upb_StringView google_protobuf_FileOptions_csharp_namespace(const google_protobuf_FileOptions* msg) { |
Eric Salo | 8809a11 | 2022-11-21 13:01:06 -0800 | [diff] [blame] | 8875 | upb_StringView default_val = upb_StringView_FromString(""); |
| 8876 | upb_StringView ret; |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 8877 | 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 Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 8878 | _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field, |
| 8879 | &default_val, &ret); |
Eric Salo | 8809a11 | 2022-11-21 13:01:06 -0800 | [diff] [blame] | 8880 | return ret; |
Joshua Haberman | f41049a | 2022-01-21 14:41:25 -0800 | [diff] [blame] | 8881 | } |
Mike Kruskal | 3bc5049 | 2022-12-01 13:34:12 -0800 | [diff] [blame] | 8882 | UPB_INLINE bool google_protobuf_FileOptions_has_csharp_namespace(const google_protobuf_FileOptions* msg) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 8883 | 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 Bot | 8c1f635 | 2024-01-10 05:18:15 +0000 | [diff] [blame] | 8884 | return upb_Message_HasBaseField(UPB_UPCAST(msg), &field); |
Joshua Haberman | 7ecf43f | 2022-03-14 13:11:29 -0700 | [diff] [blame] | 8885 | } |
Mike Kruskal | 3bc5049 | 2022-12-01 13:34:12 -0800 | [diff] [blame] | 8886 | UPB_INLINE void google_protobuf_FileOptions_clear_swift_prefix(google_protobuf_FileOptions* msg) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 8887 | 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 Bot | 4e90ead | 2024-01-08 15:46:34 +0000 | [diff] [blame] | 8888 | upb_Message_ClearBaseField(UPB_UPCAST(msg), &field); |
Joshua Haberman | d3995ec | 2022-09-30 16:54:39 -0700 | [diff] [blame] | 8889 | } |
Joshua Haberman | f41049a | 2022-01-21 14:41:25 -0800 | [diff] [blame] | 8890 | UPB_INLINE upb_StringView google_protobuf_FileOptions_swift_prefix(const google_protobuf_FileOptions* msg) { |
Eric Salo | 8809a11 | 2022-11-21 13:01:06 -0800 | [diff] [blame] | 8891 | upb_StringView default_val = upb_StringView_FromString(""); |
| 8892 | upb_StringView ret; |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 8893 | 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 Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 8894 | _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field, |
| 8895 | &default_val, &ret); |
Eric Salo | 8809a11 | 2022-11-21 13:01:06 -0800 | [diff] [blame] | 8896 | return ret; |
Joshua Haberman | f41049a | 2022-01-21 14:41:25 -0800 | [diff] [blame] | 8897 | } |
Mike Kruskal | 3bc5049 | 2022-12-01 13:34:12 -0800 | [diff] [blame] | 8898 | UPB_INLINE bool google_protobuf_FileOptions_has_swift_prefix(const google_protobuf_FileOptions* msg) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 8899 | 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 Bot | 8c1f635 | 2024-01-10 05:18:15 +0000 | [diff] [blame] | 8900 | return upb_Message_HasBaseField(UPB_UPCAST(msg), &field); |
Joshua Haberman | 7ecf43f | 2022-03-14 13:11:29 -0700 | [diff] [blame] | 8901 | } |
Mike Kruskal | 3bc5049 | 2022-12-01 13:34:12 -0800 | [diff] [blame] | 8902 | UPB_INLINE void google_protobuf_FileOptions_clear_php_class_prefix(google_protobuf_FileOptions* msg) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 8903 | 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 Bot | 4e90ead | 2024-01-08 15:46:34 +0000 | [diff] [blame] | 8904 | upb_Message_ClearBaseField(UPB_UPCAST(msg), &field); |
Joshua Haberman | d3995ec | 2022-09-30 16:54:39 -0700 | [diff] [blame] | 8905 | } |
Joshua Haberman | f41049a | 2022-01-21 14:41:25 -0800 | [diff] [blame] | 8906 | UPB_INLINE upb_StringView google_protobuf_FileOptions_php_class_prefix(const google_protobuf_FileOptions* msg) { |
Eric Salo | 8809a11 | 2022-11-21 13:01:06 -0800 | [diff] [blame] | 8907 | upb_StringView default_val = upb_StringView_FromString(""); |
| 8908 | upb_StringView ret; |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 8909 | 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 Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 8910 | _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field, |
| 8911 | &default_val, &ret); |
Eric Salo | 8809a11 | 2022-11-21 13:01:06 -0800 | [diff] [blame] | 8912 | return ret; |
Joshua Haberman | f41049a | 2022-01-21 14:41:25 -0800 | [diff] [blame] | 8913 | } |
Mike Kruskal | 3bc5049 | 2022-12-01 13:34:12 -0800 | [diff] [blame] | 8914 | UPB_INLINE bool google_protobuf_FileOptions_has_php_class_prefix(const google_protobuf_FileOptions* msg) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 8915 | 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 Bot | 8c1f635 | 2024-01-10 05:18:15 +0000 | [diff] [blame] | 8916 | return upb_Message_HasBaseField(UPB_UPCAST(msg), &field); |
Joshua Haberman | 7ecf43f | 2022-03-14 13:11:29 -0700 | [diff] [blame] | 8917 | } |
Mike Kruskal | 3bc5049 | 2022-12-01 13:34:12 -0800 | [diff] [blame] | 8918 | UPB_INLINE void google_protobuf_FileOptions_clear_php_namespace(google_protobuf_FileOptions* msg) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 8919 | 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 Bot | 4e90ead | 2024-01-08 15:46:34 +0000 | [diff] [blame] | 8920 | upb_Message_ClearBaseField(UPB_UPCAST(msg), &field); |
Joshua Haberman | d3995ec | 2022-09-30 16:54:39 -0700 | [diff] [blame] | 8921 | } |
Joshua Haberman | f41049a | 2022-01-21 14:41:25 -0800 | [diff] [blame] | 8922 | UPB_INLINE upb_StringView google_protobuf_FileOptions_php_namespace(const google_protobuf_FileOptions* msg) { |
Eric Salo | 8809a11 | 2022-11-21 13:01:06 -0800 | [diff] [blame] | 8923 | upb_StringView default_val = upb_StringView_FromString(""); |
| 8924 | upb_StringView ret; |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 8925 | 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 Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 8926 | _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field, |
| 8927 | &default_val, &ret); |
Eric Salo | 8809a11 | 2022-11-21 13:01:06 -0800 | [diff] [blame] | 8928 | return ret; |
Joshua Haberman | f41049a | 2022-01-21 14:41:25 -0800 | [diff] [blame] | 8929 | } |
Mike Kruskal | 3bc5049 | 2022-12-01 13:34:12 -0800 | [diff] [blame] | 8930 | UPB_INLINE bool google_protobuf_FileOptions_has_php_namespace(const google_protobuf_FileOptions* msg) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 8931 | 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 Bot | 8c1f635 | 2024-01-10 05:18:15 +0000 | [diff] [blame] | 8932 | return upb_Message_HasBaseField(UPB_UPCAST(msg), &field); |
Joshua Haberman | 7ecf43f | 2022-03-14 13:11:29 -0700 | [diff] [blame] | 8933 | } |
Mike Kruskal | 3bc5049 | 2022-12-01 13:34:12 -0800 | [diff] [blame] | 8934 | UPB_INLINE void google_protobuf_FileOptions_clear_php_metadata_namespace(google_protobuf_FileOptions* msg) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 8935 | 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 Bot | 4e90ead | 2024-01-08 15:46:34 +0000 | [diff] [blame] | 8936 | upb_Message_ClearBaseField(UPB_UPCAST(msg), &field); |
Joshua Haberman | d3995ec | 2022-09-30 16:54:39 -0700 | [diff] [blame] | 8937 | } |
Joshua Haberman | f41049a | 2022-01-21 14:41:25 -0800 | [diff] [blame] | 8938 | UPB_INLINE upb_StringView google_protobuf_FileOptions_php_metadata_namespace(const google_protobuf_FileOptions* msg) { |
Eric Salo | 8809a11 | 2022-11-21 13:01:06 -0800 | [diff] [blame] | 8939 | upb_StringView default_val = upb_StringView_FromString(""); |
| 8940 | upb_StringView ret; |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 8941 | 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 Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 8942 | _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field, |
| 8943 | &default_val, &ret); |
Eric Salo | 8809a11 | 2022-11-21 13:01:06 -0800 | [diff] [blame] | 8944 | return ret; |
Joshua Haberman | f41049a | 2022-01-21 14:41:25 -0800 | [diff] [blame] | 8945 | } |
Mike Kruskal | 3bc5049 | 2022-12-01 13:34:12 -0800 | [diff] [blame] | 8946 | UPB_INLINE bool google_protobuf_FileOptions_has_php_metadata_namespace(const google_protobuf_FileOptions* msg) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 8947 | 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 Bot | 8c1f635 | 2024-01-10 05:18:15 +0000 | [diff] [blame] | 8948 | return upb_Message_HasBaseField(UPB_UPCAST(msg), &field); |
Joshua Haberman | 7ecf43f | 2022-03-14 13:11:29 -0700 | [diff] [blame] | 8949 | } |
Mike Kruskal | 3bc5049 | 2022-12-01 13:34:12 -0800 | [diff] [blame] | 8950 | UPB_INLINE void google_protobuf_FileOptions_clear_ruby_package(google_protobuf_FileOptions* msg) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 8951 | 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 Bot | 4e90ead | 2024-01-08 15:46:34 +0000 | [diff] [blame] | 8952 | upb_Message_ClearBaseField(UPB_UPCAST(msg), &field); |
Joshua Haberman | d3995ec | 2022-09-30 16:54:39 -0700 | [diff] [blame] | 8953 | } |
Joshua Haberman | f41049a | 2022-01-21 14:41:25 -0800 | [diff] [blame] | 8954 | UPB_INLINE upb_StringView google_protobuf_FileOptions_ruby_package(const google_protobuf_FileOptions* msg) { |
Eric Salo | 8809a11 | 2022-11-21 13:01:06 -0800 | [diff] [blame] | 8955 | upb_StringView default_val = upb_StringView_FromString(""); |
| 8956 | upb_StringView ret; |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 8957 | 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 Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 8958 | _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field, |
| 8959 | &default_val, &ret); |
Eric Salo | 8809a11 | 2022-11-21 13:01:06 -0800 | [diff] [blame] | 8960 | return ret; |
Joshua Haberman | f41049a | 2022-01-21 14:41:25 -0800 | [diff] [blame] | 8961 | } |
Mike Kruskal | 3bc5049 | 2022-12-01 13:34:12 -0800 | [diff] [blame] | 8962 | UPB_INLINE bool google_protobuf_FileOptions_has_ruby_package(const google_protobuf_FileOptions* msg) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 8963 | 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 Bot | 8c1f635 | 2024-01-10 05:18:15 +0000 | [diff] [blame] | 8964 | return upb_Message_HasBaseField(UPB_UPCAST(msg), &field); |
Mike Kruskal | 4f9e417 | 2023-06-30 20:14:50 -0700 | [diff] [blame] | 8965 | } |
| 8966 | UPB_INLINE void google_protobuf_FileOptions_clear_features(google_protobuf_FileOptions* msg) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 8967 | 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 Bot | 4e90ead | 2024-01-08 15:46:34 +0000 | [diff] [blame] | 8968 | upb_Message_ClearBaseField(UPB_UPCAST(msg), &field); |
Mike Kruskal | 4f9e417 | 2023-06-30 20:14:50 -0700 | [diff] [blame] | 8969 | } |
| 8970 | UPB_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 Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 8973 | 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 Bot | a9387b5 | 2024-06-12 15:17:52 +0000 | [diff] [blame] | 8974 | UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__FeatureSet_msg_init); |
Protobuf Team Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 8975 | _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field, |
| 8976 | &default_val, &ret); |
Mike Kruskal | 4f9e417 | 2023-06-30 20:14:50 -0700 | [diff] [blame] | 8977 | return ret; |
| 8978 | } |
| 8979 | UPB_INLINE bool google_protobuf_FileOptions_has_features(const google_protobuf_FileOptions* msg) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 8980 | 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 Bot | 8c1f635 | 2024-01-10 05:18:15 +0000 | [diff] [blame] | 8981 | return upb_Message_HasBaseField(UPB_UPCAST(msg), &field); |
Joshua Haberman | 7ecf43f | 2022-03-14 13:11:29 -0700 | [diff] [blame] | 8982 | } |
Mike Kruskal | 3bc5049 | 2022-12-01 13:34:12 -0800 | [diff] [blame] | 8983 | UPB_INLINE void google_protobuf_FileOptions_clear_uninterpreted_option(google_protobuf_FileOptions* msg) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 8984 | 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 Bot | 4e90ead | 2024-01-08 15:46:34 +0000 | [diff] [blame] | 8985 | upb_Message_ClearBaseField(UPB_UPCAST(msg), &field); |
Joshua Haberman | d3995ec | 2022-09-30 16:54:39 -0700 | [diff] [blame] | 8986 | } |
Eric Salo | b7d54ac | 2022-12-29 11:59:42 -0800 | [diff] [blame] | 8987 | UPB_INLINE const google_protobuf_UninterpretedOption* const* google_protobuf_FileOptions_uninterpreted_option(const google_protobuf_FileOptions* msg, size_t* size) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 8988 | 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 Bot | a9387b5 | 2024-06-12 15:17:52 +0000 | [diff] [blame] | 8989 | UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__UninterpretedOption_msg_init); |
Protobuf Team Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 8990 | const upb_Array* arr = upb_Message_GetArray(UPB_UPCAST(msg), &field); |
Eric Salo | b7d54ac | 2022-12-29 11:59:42 -0800 | [diff] [blame] | 8991 | if (arr) { |
Protobuf Team Bot | f73985a | 2023-12-19 00:14:19 +0000 | [diff] [blame] | 8992 | if (size) *size = arr->UPB_PRIVATE(size); |
Protobuf Team Bot | 81e5433 | 2024-01-11 21:04:07 +0000 | [diff] [blame] | 8993 | return (const google_protobuf_UninterpretedOption* const*)upb_Array_DataPtr(arr); |
Eric Salo | b7d54ac | 2022-12-29 11:59:42 -0800 | [diff] [blame] | 8994 | } else { |
| 8995 | if (size) *size = 0; |
| 8996 | return NULL; |
| 8997 | } |
Joshua Haberman | 7ecf43f | 2022-03-14 13:11:29 -0700 | [diff] [blame] | 8998 | } |
Deanna Garcia | b26afb5 | 2023-04-25 13:37:18 -0700 | [diff] [blame] | 8999 | UPB_INLINE const upb_Array* _google_protobuf_FileOptions_uninterpreted_option_upb_array(const google_protobuf_FileOptions* msg, size_t* size) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 9000 | 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 Bot | a9387b5 | 2024-06-12 15:17:52 +0000 | [diff] [blame] | 9001 | UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__UninterpretedOption_msg_init); |
Protobuf Team Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 9002 | const upb_Array* arr = upb_Message_GetArray(UPB_UPCAST(msg), &field); |
Deanna Garcia | b26afb5 | 2023-04-25 13:37:18 -0700 | [diff] [blame] | 9003 | if (size) { |
Protobuf Team Bot | f73985a | 2023-12-19 00:14:19 +0000 | [diff] [blame] | 9004 | *size = arr ? arr->UPB_PRIVATE(size) : 0; |
Deanna Garcia | b26afb5 | 2023-04-25 13:37:18 -0700 | [diff] [blame] | 9005 | } |
| 9006 | return arr; |
| 9007 | } |
Protobuf Team Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 9008 | UPB_INLINE upb_Array* _google_protobuf_FileOptions_uninterpreted_option_mutable_upb_array(google_protobuf_FileOptions* msg, size_t* size, upb_Arena* arena) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 9009 | 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 Bot | a9387b5 | 2024-06-12 15:17:52 +0000 | [diff] [blame] | 9010 | UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__UninterpretedOption_msg_init); |
Protobuf Team Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 9011 | upb_Array* arr = upb_Message_GetOrCreateMutableArray(UPB_UPCAST(msg), |
| 9012 | &field, arena); |
Deanna Garcia | b26afb5 | 2023-04-25 13:37:18 -0700 | [diff] [blame] | 9013 | if (size) { |
Protobuf Team Bot | f73985a | 2023-12-19 00:14:19 +0000 | [diff] [blame] | 9014 | *size = arr ? arr->UPB_PRIVATE(size) : 0; |
Deanna Garcia | b26afb5 | 2023-04-25 13:37:18 -0700 | [diff] [blame] | 9015 | } |
| 9016 | return arr; |
| 9017 | } |
Joshua Haberman | 9abf6e2 | 2021-01-13 12:16:25 -0800 | [diff] [blame] | 9018 | |
Joshua Haberman | f41049a | 2022-01-21 14:41:25 -0800 | [diff] [blame] | 9019 | UPB_INLINE void google_protobuf_FileOptions_set_java_package(google_protobuf_FileOptions *msg, upb_StringView value) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 9020 | 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 Bot | ac32c97 | 2024-04-10 03:30:05 +0000 | [diff] [blame] | 9021 | upb_Message_SetBaseField((upb_Message *)msg, &field, &value); |
Mike Kruskal | 232ecf4 | 2023-01-14 00:09:40 -0800 | [diff] [blame] | 9022 | } |
| 9023 | UPB_INLINE void google_protobuf_FileOptions_set_java_outer_classname(google_protobuf_FileOptions *msg, upb_StringView value) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 9024 | 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 Bot | ac32c97 | 2024-04-10 03:30:05 +0000 | [diff] [blame] | 9025 | upb_Message_SetBaseField((upb_Message *)msg, &field, &value); |
Mike Kruskal | 232ecf4 | 2023-01-14 00:09:40 -0800 | [diff] [blame] | 9026 | } |
| 9027 | UPB_INLINE void google_protobuf_FileOptions_set_optimize_for(google_protobuf_FileOptions *msg, int32_t value) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 9028 | const upb_MiniTableField field = {9, 12, 66, 2, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; |
Protobuf Team Bot | ac32c97 | 2024-04-10 03:30:05 +0000 | [diff] [blame] | 9029 | upb_Message_SetBaseField((upb_Message *)msg, &field, &value); |
Mike Kruskal | 232ecf4 | 2023-01-14 00:09:40 -0800 | [diff] [blame] | 9030 | } |
| 9031 | UPB_INLINE void google_protobuf_FileOptions_set_java_multiple_files(google_protobuf_FileOptions *msg, bool value) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 9032 | const upb_MiniTableField field = {10, 16, 67, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; |
Protobuf Team Bot | ac32c97 | 2024-04-10 03:30:05 +0000 | [diff] [blame] | 9033 | upb_Message_SetBaseField((upb_Message *)msg, &field, &value); |
Mike Kruskal | 232ecf4 | 2023-01-14 00:09:40 -0800 | [diff] [blame] | 9034 | } |
| 9035 | UPB_INLINE void google_protobuf_FileOptions_set_go_package(google_protobuf_FileOptions *msg, upb_StringView value) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 9036 | 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 Bot | ac32c97 | 2024-04-10 03:30:05 +0000 | [diff] [blame] | 9037 | upb_Message_SetBaseField((upb_Message *)msg, &field, &value); |
Mike Kruskal | 232ecf4 | 2023-01-14 00:09:40 -0800 | [diff] [blame] | 9038 | } |
| 9039 | UPB_INLINE void google_protobuf_FileOptions_set_cc_generic_services(google_protobuf_FileOptions *msg, bool value) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 9040 | const upb_MiniTableField field = {16, 17, 69, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; |
Protobuf Team Bot | ac32c97 | 2024-04-10 03:30:05 +0000 | [diff] [blame] | 9041 | upb_Message_SetBaseField((upb_Message *)msg, &field, &value); |
Mike Kruskal | 232ecf4 | 2023-01-14 00:09:40 -0800 | [diff] [blame] | 9042 | } |
| 9043 | UPB_INLINE void google_protobuf_FileOptions_set_java_generic_services(google_protobuf_FileOptions *msg, bool value) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 9044 | const upb_MiniTableField field = {17, 18, 70, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; |
Protobuf Team Bot | ac32c97 | 2024-04-10 03:30:05 +0000 | [diff] [blame] | 9045 | upb_Message_SetBaseField((upb_Message *)msg, &field, &value); |
Mike Kruskal | 232ecf4 | 2023-01-14 00:09:40 -0800 | [diff] [blame] | 9046 | } |
| 9047 | UPB_INLINE void google_protobuf_FileOptions_set_py_generic_services(google_protobuf_FileOptions *msg, bool value) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 9048 | const upb_MiniTableField field = {18, 19, 71, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; |
Protobuf Team Bot | ac32c97 | 2024-04-10 03:30:05 +0000 | [diff] [blame] | 9049 | upb_Message_SetBaseField((upb_Message *)msg, &field, &value); |
Mike Kruskal | 232ecf4 | 2023-01-14 00:09:40 -0800 | [diff] [blame] | 9050 | } |
| 9051 | UPB_INLINE void google_protobuf_FileOptions_set_java_generate_equals_and_hash(google_protobuf_FileOptions *msg, bool value) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 9052 | const upb_MiniTableField field = {20, 20, 72, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; |
Protobuf Team Bot | ac32c97 | 2024-04-10 03:30:05 +0000 | [diff] [blame] | 9053 | upb_Message_SetBaseField((upb_Message *)msg, &field, &value); |
Mike Kruskal | 232ecf4 | 2023-01-14 00:09:40 -0800 | [diff] [blame] | 9054 | } |
| 9055 | UPB_INLINE void google_protobuf_FileOptions_set_deprecated(google_protobuf_FileOptions *msg, bool value) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 9056 | const upb_MiniTableField field = {23, 21, 73, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; |
Protobuf Team Bot | ac32c97 | 2024-04-10 03:30:05 +0000 | [diff] [blame] | 9057 | upb_Message_SetBaseField((upb_Message *)msg, &field, &value); |
Mike Kruskal | 232ecf4 | 2023-01-14 00:09:40 -0800 | [diff] [blame] | 9058 | } |
| 9059 | UPB_INLINE void google_protobuf_FileOptions_set_java_string_check_utf8(google_protobuf_FileOptions *msg, bool value) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 9060 | const upb_MiniTableField field = {27, 22, 74, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; |
Protobuf Team Bot | ac32c97 | 2024-04-10 03:30:05 +0000 | [diff] [blame] | 9061 | upb_Message_SetBaseField((upb_Message *)msg, &field, &value); |
Mike Kruskal | 232ecf4 | 2023-01-14 00:09:40 -0800 | [diff] [blame] | 9062 | } |
| 9063 | UPB_INLINE void google_protobuf_FileOptions_set_cc_enable_arenas(google_protobuf_FileOptions *msg, bool value) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 9064 | const upb_MiniTableField field = {31, 23, 75, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; |
Protobuf Team Bot | ac32c97 | 2024-04-10 03:30:05 +0000 | [diff] [blame] | 9065 | upb_Message_SetBaseField((upb_Message *)msg, &field, &value); |
Mike Kruskal | 232ecf4 | 2023-01-14 00:09:40 -0800 | [diff] [blame] | 9066 | } |
| 9067 | UPB_INLINE void google_protobuf_FileOptions_set_objc_class_prefix(google_protobuf_FileOptions *msg, upb_StringView value) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 9068 | 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 Bot | ac32c97 | 2024-04-10 03:30:05 +0000 | [diff] [blame] | 9069 | upb_Message_SetBaseField((upb_Message *)msg, &field, &value); |
Mike Kruskal | 232ecf4 | 2023-01-14 00:09:40 -0800 | [diff] [blame] | 9070 | } |
| 9071 | UPB_INLINE void google_protobuf_FileOptions_set_csharp_namespace(google_protobuf_FileOptions *msg, upb_StringView value) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 9072 | 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 Bot | ac32c97 | 2024-04-10 03:30:05 +0000 | [diff] [blame] | 9073 | upb_Message_SetBaseField((upb_Message *)msg, &field, &value); |
Mike Kruskal | 232ecf4 | 2023-01-14 00:09:40 -0800 | [diff] [blame] | 9074 | } |
| 9075 | UPB_INLINE void google_protobuf_FileOptions_set_swift_prefix(google_protobuf_FileOptions *msg, upb_StringView value) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 9076 | 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 Bot | ac32c97 | 2024-04-10 03:30:05 +0000 | [diff] [blame] | 9077 | upb_Message_SetBaseField((upb_Message *)msg, &field, &value); |
Mike Kruskal | 232ecf4 | 2023-01-14 00:09:40 -0800 | [diff] [blame] | 9078 | } |
| 9079 | UPB_INLINE void google_protobuf_FileOptions_set_php_class_prefix(google_protobuf_FileOptions *msg, upb_StringView value) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 9080 | 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 Bot | ac32c97 | 2024-04-10 03:30:05 +0000 | [diff] [blame] | 9081 | upb_Message_SetBaseField((upb_Message *)msg, &field, &value); |
Mike Kruskal | 232ecf4 | 2023-01-14 00:09:40 -0800 | [diff] [blame] | 9082 | } |
| 9083 | UPB_INLINE void google_protobuf_FileOptions_set_php_namespace(google_protobuf_FileOptions *msg, upb_StringView value) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 9084 | 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 Bot | ac32c97 | 2024-04-10 03:30:05 +0000 | [diff] [blame] | 9085 | upb_Message_SetBaseField((upb_Message *)msg, &field, &value); |
Mike Kruskal | 232ecf4 | 2023-01-14 00:09:40 -0800 | [diff] [blame] | 9086 | } |
| 9087 | UPB_INLINE void google_protobuf_FileOptions_set_php_metadata_namespace(google_protobuf_FileOptions *msg, upb_StringView value) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 9088 | 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 Bot | ac32c97 | 2024-04-10 03:30:05 +0000 | [diff] [blame] | 9089 | upb_Message_SetBaseField((upb_Message *)msg, &field, &value); |
Mike Kruskal | 232ecf4 | 2023-01-14 00:09:40 -0800 | [diff] [blame] | 9090 | } |
| 9091 | UPB_INLINE void google_protobuf_FileOptions_set_ruby_package(google_protobuf_FileOptions *msg, upb_StringView value) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 9092 | 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 Bot | ac32c97 | 2024-04-10 03:30:05 +0000 | [diff] [blame] | 9093 | upb_Message_SetBaseField((upb_Message *)msg, &field, &value); |
Mike Kruskal | 232ecf4 | 2023-01-14 00:09:40 -0800 | [diff] [blame] | 9094 | } |
Mike Kruskal | 4f9e417 | 2023-06-30 20:14:50 -0700 | [diff] [blame] | 9095 | UPB_INLINE void google_protobuf_FileOptions_set_features(google_protobuf_FileOptions *msg, google_protobuf_FeatureSet* value) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 9096 | 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 Bot | a9387b5 | 2024-06-12 15:17:52 +0000 | [diff] [blame] | 9097 | UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__FeatureSet_msg_init); |
Protobuf Team Bot | ac32c97 | 2024-04-10 03:30:05 +0000 | [diff] [blame] | 9098 | upb_Message_SetBaseField((upb_Message *)msg, &field, &value); |
Mike Kruskal | 4f9e417 | 2023-06-30 20:14:50 -0700 | [diff] [blame] | 9099 | } |
| 9100 | UPB_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 Bot | 4ffe086 | 2023-12-06 02:02:36 +0000 | [diff] [blame] | 9103 | sub = (struct google_protobuf_FeatureSet*)_upb_Message_New(&google__protobuf__FeatureSet_msg_init, arena); |
Mike Kruskal | 4f9e417 | 2023-06-30 20:14:50 -0700 | [diff] [blame] | 9104 | if (sub) google_protobuf_FileOptions_set_features(msg, sub); |
| 9105 | } |
| 9106 | return sub; |
| 9107 | } |
Mike Kruskal | 232ecf4 | 2023-01-14 00:09:40 -0800 | [diff] [blame] | 9108 | UPB_INLINE google_protobuf_UninterpretedOption** google_protobuf_FileOptions_mutable_uninterpreted_option(google_protobuf_FileOptions* msg, size_t* size) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 9109 | 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 Bot | a9387b5 | 2024-06-12 15:17:52 +0000 | [diff] [blame] | 9110 | UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__UninterpretedOption_msg_init); |
Protobuf Team Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 9111 | upb_Array* arr = upb_Message_GetMutableArray(UPB_UPCAST(msg), &field); |
Eric Salo | b7d54ac | 2022-12-29 11:59:42 -0800 | [diff] [blame] | 9112 | if (arr) { |
Protobuf Team Bot | f73985a | 2023-12-19 00:14:19 +0000 | [diff] [blame] | 9113 | if (size) *size = arr->UPB_PRIVATE(size); |
Protobuf Team Bot | 81e5433 | 2024-01-11 21:04:07 +0000 | [diff] [blame] | 9114 | return (google_protobuf_UninterpretedOption**)upb_Array_MutableDataPtr(arr); |
Eric Salo | b7d54ac | 2022-12-29 11:59:42 -0800 | [diff] [blame] | 9115 | } else { |
| 9116 | if (size) *size = 0; |
| 9117 | return NULL; |
| 9118 | } |
Joshua Haberman | 9abf6e2 | 2021-01-13 12:16:25 -0800 | [diff] [blame] | 9119 | } |
Eric Salo | b7d54ac | 2022-12-29 11:59:42 -0800 | [diff] [blame] | 9120 | UPB_INLINE google_protobuf_UninterpretedOption** google_protobuf_FileOptions_resize_uninterpreted_option(google_protobuf_FileOptions* msg, size_t size, upb_Arena* arena) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 9121 | 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 Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 9122 | return (google_protobuf_UninterpretedOption**)upb_Message_ResizeArrayUninitialized(UPB_UPCAST(msg), |
| 9123 | &field, size, arena); |
Joshua Haberman | 9abf6e2 | 2021-01-13 12:16:25 -0800 | [diff] [blame] | 9124 | } |
Joshua Haberman | 7ecf43f | 2022-03-14 13:11:29 -0700 | [diff] [blame] | 9125 | UPB_INLINE struct google_protobuf_UninterpretedOption* google_protobuf_FileOptions_add_uninterpreted_option(google_protobuf_FileOptions* msg, upb_Arena* arena) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 9126 | 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 Bot | a9387b5 | 2024-06-12 15:17:52 +0000 | [diff] [blame] | 9127 | UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__UninterpretedOption_msg_init); |
Protobuf Team Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 9128 | upb_Array* arr = upb_Message_GetOrCreateMutableArray( |
| 9129 | UPB_UPCAST(msg), &field, arena); |
Protobuf Team Bot | 81e5433 | 2024-01-11 21:04:07 +0000 | [diff] [blame] | 9130 | if (!arr || !UPB_PRIVATE(_upb_Array_ResizeUninitialized)( |
Protobuf Team Bot | f73985a | 2023-12-19 00:14:19 +0000 | [diff] [blame] | 9131 | arr, arr->UPB_PRIVATE(size) + 1, arena)) { |
Eric Salo | b7d54ac | 2022-12-29 11:59:42 -0800 | [diff] [blame] | 9132 | return NULL; |
| 9133 | } |
Protobuf Team Bot | 4ffe086 | 2023-12-06 02:02:36 +0000 | [diff] [blame] | 9134 | struct google_protobuf_UninterpretedOption* sub = (struct google_protobuf_UninterpretedOption*)_upb_Message_New(&google__protobuf__UninterpretedOption_msg_init, arena); |
Eric Salo | b7d54ac | 2022-12-29 11:59:42 -0800 | [diff] [blame] | 9135 | if (!arr || !sub) return NULL; |
Protobuf Team Bot | f73985a | 2023-12-19 00:14:19 +0000 | [diff] [blame] | 9136 | UPB_PRIVATE(_upb_Array_Set) |
| 9137 | (arr, arr->UPB_PRIVATE(size) - 1, &sub, sizeof(sub)); |
Joshua Haberman | 9abf6e2 | 2021-01-13 12:16:25 -0800 | [diff] [blame] | 9138 | return sub; |
| 9139 | } |
| 9140 | |
| 9141 | /* google.protobuf.MessageOptions */ |
| 9142 | |
Joshua Haberman | f41049a | 2022-01-21 14:41:25 -0800 | [diff] [blame] | 9143 | UPB_INLINE google_protobuf_MessageOptions* google_protobuf_MessageOptions_new(upb_Arena* arena) { |
Protobuf Team Bot | 4ffe086 | 2023-12-06 02:02:36 +0000 | [diff] [blame] | 9144 | return (google_protobuf_MessageOptions*)_upb_Message_New(&google__protobuf__MessageOptions_msg_init, arena); |
Joshua Haberman | 9abf6e2 | 2021-01-13 12:16:25 -0800 | [diff] [blame] | 9145 | } |
Joshua Haberman | f41049a | 2022-01-21 14:41:25 -0800 | [diff] [blame] | 9146 | UPB_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 Haberman | 9d578a3 | 2021-08-02 15:32:01 -0700 | [diff] [blame] | 9148 | if (!ret) return NULL; |
Protobuf Team Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 9149 | if (upb_Decode(buf, size, UPB_UPCAST(ret), &google__protobuf__MessageOptions_msg_init, NULL, 0, arena) != |
| 9150 | kUpb_DecodeStatus_Ok) { |
Joshua Haberman | 9d578a3 | 2021-08-02 15:32:01 -0700 | [diff] [blame] | 9151 | return NULL; |
| 9152 | } |
| 9153 | return ret; |
Joshua Haberman | 9abf6e2 | 2021-01-13 12:16:25 -0800 | [diff] [blame] | 9154 | } |
Joshua Haberman | f41049a | 2022-01-21 14:41:25 -0800 | [diff] [blame] | 9155 | UPB_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 Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 9160 | if (upb_Decode(buf, size, UPB_UPCAST(ret), &google__protobuf__MessageOptions_msg_init, extreg, options, |
| 9161 | arena) != kUpb_DecodeStatus_Ok) { |
Joshua Haberman | f41049a | 2022-01-21 14:41:25 -0800 | [diff] [blame] | 9162 | return NULL; |
| 9163 | } |
| 9164 | return ret; |
Joshua Haberman | 9abf6e2 | 2021-01-13 12:16:25 -0800 | [diff] [blame] | 9165 | } |
Joshua Haberman | f41049a | 2022-01-21 14:41:25 -0800 | [diff] [blame] | 9166 | UPB_INLINE char* google_protobuf_MessageOptions_serialize(const google_protobuf_MessageOptions* msg, upb_Arena* arena, size_t* len) { |
Joshua Haberman | d3995ec | 2022-09-30 16:54:39 -0700 | [diff] [blame] | 9167 | char* ptr; |
Protobuf Team Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 9168 | (void)upb_Encode(UPB_UPCAST(msg), &google__protobuf__MessageOptions_msg_init, 0, arena, &ptr, len); |
Joshua Haberman | d3995ec | 2022-09-30 16:54:39 -0700 | [diff] [blame] | 9169 | return ptr; |
Joshua Haberman | f41049a | 2022-01-21 14:41:25 -0800 | [diff] [blame] | 9170 | } |
| 9171 | UPB_INLINE char* google_protobuf_MessageOptions_serialize_ex(const google_protobuf_MessageOptions* msg, int options, |
| 9172 | upb_Arena* arena, size_t* len) { |
Joshua Haberman | d3995ec | 2022-09-30 16:54:39 -0700 | [diff] [blame] | 9173 | char* ptr; |
Protobuf Team Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 9174 | (void)upb_Encode(UPB_UPCAST(msg), &google__protobuf__MessageOptions_msg_init, options, arena, &ptr, len); |
Joshua Haberman | d3995ec | 2022-09-30 16:54:39 -0700 | [diff] [blame] | 9175 | return ptr; |
Joshua Haberman | f41049a | 2022-01-21 14:41:25 -0800 | [diff] [blame] | 9176 | } |
Mike Kruskal | 3bc5049 | 2022-12-01 13:34:12 -0800 | [diff] [blame] | 9177 | UPB_INLINE void google_protobuf_MessageOptions_clear_message_set_wire_format(google_protobuf_MessageOptions* msg) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 9178 | const upb_MiniTableField field = {1, 9, 64, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; |
Protobuf Team Bot | 4e90ead | 2024-01-08 15:46:34 +0000 | [diff] [blame] | 9179 | upb_Message_ClearBaseField(UPB_UPCAST(msg), &field); |
Joshua Haberman | d3995ec | 2022-09-30 16:54:39 -0700 | [diff] [blame] | 9180 | } |
Joshua Haberman | f41049a | 2022-01-21 14:41:25 -0800 | [diff] [blame] | 9181 | UPB_INLINE bool google_protobuf_MessageOptions_message_set_wire_format(const google_protobuf_MessageOptions* msg) { |
Eric Salo | 8809a11 | 2022-11-21 13:01:06 -0800 | [diff] [blame] | 9182 | bool default_val = false; |
| 9183 | bool ret; |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 9184 | const upb_MiniTableField field = {1, 9, 64, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; |
Protobuf Team Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 9185 | _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field, |
| 9186 | &default_val, &ret); |
Eric Salo | 8809a11 | 2022-11-21 13:01:06 -0800 | [diff] [blame] | 9187 | return ret; |
Joshua Haberman | f41049a | 2022-01-21 14:41:25 -0800 | [diff] [blame] | 9188 | } |
Mike Kruskal | 3bc5049 | 2022-12-01 13:34:12 -0800 | [diff] [blame] | 9189 | UPB_INLINE bool google_protobuf_MessageOptions_has_message_set_wire_format(const google_protobuf_MessageOptions* msg) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 9190 | const upb_MiniTableField field = {1, 9, 64, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; |
Protobuf Team Bot | 8c1f635 | 2024-01-10 05:18:15 +0000 | [diff] [blame] | 9191 | return upb_Message_HasBaseField(UPB_UPCAST(msg), &field); |
Joshua Haberman | 7ecf43f | 2022-03-14 13:11:29 -0700 | [diff] [blame] | 9192 | } |
Mike Kruskal | 3bc5049 | 2022-12-01 13:34:12 -0800 | [diff] [blame] | 9193 | UPB_INLINE void google_protobuf_MessageOptions_clear_no_standard_descriptor_accessor(google_protobuf_MessageOptions* msg) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 9194 | const upb_MiniTableField field = {2, 10, 65, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; |
Protobuf Team Bot | 4e90ead | 2024-01-08 15:46:34 +0000 | [diff] [blame] | 9195 | upb_Message_ClearBaseField(UPB_UPCAST(msg), &field); |
Joshua Haberman | d3995ec | 2022-09-30 16:54:39 -0700 | [diff] [blame] | 9196 | } |
Joshua Haberman | f41049a | 2022-01-21 14:41:25 -0800 | [diff] [blame] | 9197 | UPB_INLINE bool google_protobuf_MessageOptions_no_standard_descriptor_accessor(const google_protobuf_MessageOptions* msg) { |
Eric Salo | 8809a11 | 2022-11-21 13:01:06 -0800 | [diff] [blame] | 9198 | bool default_val = false; |
| 9199 | bool ret; |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 9200 | const upb_MiniTableField field = {2, 10, 65, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; |
Protobuf Team Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 9201 | _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field, |
| 9202 | &default_val, &ret); |
Eric Salo | 8809a11 | 2022-11-21 13:01:06 -0800 | [diff] [blame] | 9203 | return ret; |
Joshua Haberman | f41049a | 2022-01-21 14:41:25 -0800 | [diff] [blame] | 9204 | } |
Mike Kruskal | 3bc5049 | 2022-12-01 13:34:12 -0800 | [diff] [blame] | 9205 | UPB_INLINE bool google_protobuf_MessageOptions_has_no_standard_descriptor_accessor(const google_protobuf_MessageOptions* msg) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 9206 | const upb_MiniTableField field = {2, 10, 65, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; |
Protobuf Team Bot | 8c1f635 | 2024-01-10 05:18:15 +0000 | [diff] [blame] | 9207 | return upb_Message_HasBaseField(UPB_UPCAST(msg), &field); |
Joshua Haberman | 7ecf43f | 2022-03-14 13:11:29 -0700 | [diff] [blame] | 9208 | } |
Mike Kruskal | 3bc5049 | 2022-12-01 13:34:12 -0800 | [diff] [blame] | 9209 | UPB_INLINE void google_protobuf_MessageOptions_clear_deprecated(google_protobuf_MessageOptions* msg) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 9210 | const upb_MiniTableField field = {3, 11, 66, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; |
Protobuf Team Bot | 4e90ead | 2024-01-08 15:46:34 +0000 | [diff] [blame] | 9211 | upb_Message_ClearBaseField(UPB_UPCAST(msg), &field); |
Joshua Haberman | d3995ec | 2022-09-30 16:54:39 -0700 | [diff] [blame] | 9212 | } |
Joshua Haberman | f41049a | 2022-01-21 14:41:25 -0800 | [diff] [blame] | 9213 | UPB_INLINE bool google_protobuf_MessageOptions_deprecated(const google_protobuf_MessageOptions* msg) { |
Eric Salo | 8809a11 | 2022-11-21 13:01:06 -0800 | [diff] [blame] | 9214 | bool default_val = false; |
| 9215 | bool ret; |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 9216 | const upb_MiniTableField field = {3, 11, 66, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; |
Protobuf Team Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 9217 | _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field, |
| 9218 | &default_val, &ret); |
Eric Salo | 8809a11 | 2022-11-21 13:01:06 -0800 | [diff] [blame] | 9219 | return ret; |
Joshua Haberman | f41049a | 2022-01-21 14:41:25 -0800 | [diff] [blame] | 9220 | } |
Mike Kruskal | 3bc5049 | 2022-12-01 13:34:12 -0800 | [diff] [blame] | 9221 | UPB_INLINE bool google_protobuf_MessageOptions_has_deprecated(const google_protobuf_MessageOptions* msg) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 9222 | const upb_MiniTableField field = {3, 11, 66, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; |
Protobuf Team Bot | 8c1f635 | 2024-01-10 05:18:15 +0000 | [diff] [blame] | 9223 | return upb_Message_HasBaseField(UPB_UPCAST(msg), &field); |
Joshua Haberman | 7ecf43f | 2022-03-14 13:11:29 -0700 | [diff] [blame] | 9224 | } |
Mike Kruskal | 3bc5049 | 2022-12-01 13:34:12 -0800 | [diff] [blame] | 9225 | UPB_INLINE void google_protobuf_MessageOptions_clear_map_entry(google_protobuf_MessageOptions* msg) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 9226 | const upb_MiniTableField field = {7, 12, 67, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; |
Protobuf Team Bot | 4e90ead | 2024-01-08 15:46:34 +0000 | [diff] [blame] | 9227 | upb_Message_ClearBaseField(UPB_UPCAST(msg), &field); |
Joshua Haberman | d3995ec | 2022-09-30 16:54:39 -0700 | [diff] [blame] | 9228 | } |
Joshua Haberman | f41049a | 2022-01-21 14:41:25 -0800 | [diff] [blame] | 9229 | UPB_INLINE bool google_protobuf_MessageOptions_map_entry(const google_protobuf_MessageOptions* msg) { |
Eric Salo | 8809a11 | 2022-11-21 13:01:06 -0800 | [diff] [blame] | 9230 | bool default_val = false; |
| 9231 | bool ret; |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 9232 | const upb_MiniTableField field = {7, 12, 67, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; |
Protobuf Team Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 9233 | _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field, |
| 9234 | &default_val, &ret); |
Eric Salo | 8809a11 | 2022-11-21 13:01:06 -0800 | [diff] [blame] | 9235 | return ret; |
Joshua Haberman | f41049a | 2022-01-21 14:41:25 -0800 | [diff] [blame] | 9236 | } |
Mike Kruskal | 3bc5049 | 2022-12-01 13:34:12 -0800 | [diff] [blame] | 9237 | UPB_INLINE bool google_protobuf_MessageOptions_has_map_entry(const google_protobuf_MessageOptions* msg) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 9238 | const upb_MiniTableField field = {7, 12, 67, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; |
Protobuf Team Bot | 8c1f635 | 2024-01-10 05:18:15 +0000 | [diff] [blame] | 9239 | return upb_Message_HasBaseField(UPB_UPCAST(msg), &field); |
Joshua Haberman | 7ecf43f | 2022-03-14 13:11:29 -0700 | [diff] [blame] | 9240 | } |
Mike Kruskal | 6b87d6f | 2022-12-14 10:36:53 -0800 | [diff] [blame] | 9241 | UPB_INLINE void google_protobuf_MessageOptions_clear_deprecated_legacy_json_field_conflicts(google_protobuf_MessageOptions* msg) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 9242 | const upb_MiniTableField field = {11, 13, 68, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; |
Protobuf Team Bot | 4e90ead | 2024-01-08 15:46:34 +0000 | [diff] [blame] | 9243 | upb_Message_ClearBaseField(UPB_UPCAST(msg), &field); |
Mike Kruskal | 6b87d6f | 2022-12-14 10:36:53 -0800 | [diff] [blame] | 9244 | } |
| 9245 | UPB_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 Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 9248 | const upb_MiniTableField field = {11, 13, 68, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; |
Protobuf Team Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 9249 | _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field, |
| 9250 | &default_val, &ret); |
Mike Kruskal | 6b87d6f | 2022-12-14 10:36:53 -0800 | [diff] [blame] | 9251 | return ret; |
| 9252 | } |
| 9253 | UPB_INLINE bool google_protobuf_MessageOptions_has_deprecated_legacy_json_field_conflicts(const google_protobuf_MessageOptions* msg) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 9254 | const upb_MiniTableField field = {11, 13, 68, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; |
Protobuf Team Bot | 8c1f635 | 2024-01-10 05:18:15 +0000 | [diff] [blame] | 9255 | return upb_Message_HasBaseField(UPB_UPCAST(msg), &field); |
Mike Kruskal | 6b87d6f | 2022-12-14 10:36:53 -0800 | [diff] [blame] | 9256 | } |
Mike Kruskal | 4f9e417 | 2023-06-30 20:14:50 -0700 | [diff] [blame] | 9257 | UPB_INLINE void google_protobuf_MessageOptions_clear_features(google_protobuf_MessageOptions* msg) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 9258 | 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 Bot | 4e90ead | 2024-01-08 15:46:34 +0000 | [diff] [blame] | 9259 | upb_Message_ClearBaseField(UPB_UPCAST(msg), &field); |
Mike Kruskal | 4f9e417 | 2023-06-30 20:14:50 -0700 | [diff] [blame] | 9260 | } |
| 9261 | UPB_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 Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 9264 | 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 Bot | a9387b5 | 2024-06-12 15:17:52 +0000 | [diff] [blame] | 9265 | UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__FeatureSet_msg_init); |
Protobuf Team Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 9266 | _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field, |
| 9267 | &default_val, &ret); |
Mike Kruskal | 4f9e417 | 2023-06-30 20:14:50 -0700 | [diff] [blame] | 9268 | return ret; |
| 9269 | } |
| 9270 | UPB_INLINE bool google_protobuf_MessageOptions_has_features(const google_protobuf_MessageOptions* msg) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 9271 | 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 Bot | 8c1f635 | 2024-01-10 05:18:15 +0000 | [diff] [blame] | 9272 | return upb_Message_HasBaseField(UPB_UPCAST(msg), &field); |
Mike Kruskal | 4f9e417 | 2023-06-30 20:14:50 -0700 | [diff] [blame] | 9273 | } |
Mike Kruskal | 3bc5049 | 2022-12-01 13:34:12 -0800 | [diff] [blame] | 9274 | UPB_INLINE void google_protobuf_MessageOptions_clear_uninterpreted_option(google_protobuf_MessageOptions* msg) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 9275 | 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 Bot | 4e90ead | 2024-01-08 15:46:34 +0000 | [diff] [blame] | 9276 | upb_Message_ClearBaseField(UPB_UPCAST(msg), &field); |
Joshua Haberman | d3995ec | 2022-09-30 16:54:39 -0700 | [diff] [blame] | 9277 | } |
Eric Salo | b7d54ac | 2022-12-29 11:59:42 -0800 | [diff] [blame] | 9278 | UPB_INLINE const google_protobuf_UninterpretedOption* const* google_protobuf_MessageOptions_uninterpreted_option(const google_protobuf_MessageOptions* msg, size_t* size) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 9279 | 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 Bot | a9387b5 | 2024-06-12 15:17:52 +0000 | [diff] [blame] | 9280 | UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__UninterpretedOption_msg_init); |
Protobuf Team Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 9281 | const upb_Array* arr = upb_Message_GetArray(UPB_UPCAST(msg), &field); |
Eric Salo | b7d54ac | 2022-12-29 11:59:42 -0800 | [diff] [blame] | 9282 | if (arr) { |
Protobuf Team Bot | f73985a | 2023-12-19 00:14:19 +0000 | [diff] [blame] | 9283 | if (size) *size = arr->UPB_PRIVATE(size); |
Protobuf Team Bot | 81e5433 | 2024-01-11 21:04:07 +0000 | [diff] [blame] | 9284 | return (const google_protobuf_UninterpretedOption* const*)upb_Array_DataPtr(arr); |
Eric Salo | b7d54ac | 2022-12-29 11:59:42 -0800 | [diff] [blame] | 9285 | } else { |
| 9286 | if (size) *size = 0; |
| 9287 | return NULL; |
| 9288 | } |
Joshua Haberman | 7ecf43f | 2022-03-14 13:11:29 -0700 | [diff] [blame] | 9289 | } |
Deanna Garcia | b26afb5 | 2023-04-25 13:37:18 -0700 | [diff] [blame] | 9290 | UPB_INLINE const upb_Array* _google_protobuf_MessageOptions_uninterpreted_option_upb_array(const google_protobuf_MessageOptions* msg, size_t* size) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 9291 | 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 Bot | a9387b5 | 2024-06-12 15:17:52 +0000 | [diff] [blame] | 9292 | UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__UninterpretedOption_msg_init); |
Protobuf Team Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 9293 | const upb_Array* arr = upb_Message_GetArray(UPB_UPCAST(msg), &field); |
Deanna Garcia | b26afb5 | 2023-04-25 13:37:18 -0700 | [diff] [blame] | 9294 | if (size) { |
Protobuf Team Bot | f73985a | 2023-12-19 00:14:19 +0000 | [diff] [blame] | 9295 | *size = arr ? arr->UPB_PRIVATE(size) : 0; |
Deanna Garcia | b26afb5 | 2023-04-25 13:37:18 -0700 | [diff] [blame] | 9296 | } |
| 9297 | return arr; |
| 9298 | } |
Protobuf Team Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 9299 | UPB_INLINE upb_Array* _google_protobuf_MessageOptions_uninterpreted_option_mutable_upb_array(google_protobuf_MessageOptions* msg, size_t* size, upb_Arena* arena) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 9300 | 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 Bot | a9387b5 | 2024-06-12 15:17:52 +0000 | [diff] [blame] | 9301 | UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__UninterpretedOption_msg_init); |
Protobuf Team Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 9302 | upb_Array* arr = upb_Message_GetOrCreateMutableArray(UPB_UPCAST(msg), |
| 9303 | &field, arena); |
Deanna Garcia | b26afb5 | 2023-04-25 13:37:18 -0700 | [diff] [blame] | 9304 | if (size) { |
Protobuf Team Bot | f73985a | 2023-12-19 00:14:19 +0000 | [diff] [blame] | 9305 | *size = arr ? arr->UPB_PRIVATE(size) : 0; |
Deanna Garcia | b26afb5 | 2023-04-25 13:37:18 -0700 | [diff] [blame] | 9306 | } |
| 9307 | return arr; |
| 9308 | } |
Joshua Haberman | 9abf6e2 | 2021-01-13 12:16:25 -0800 | [diff] [blame] | 9309 | |
| 9310 | UPB_INLINE void google_protobuf_MessageOptions_set_message_set_wire_format(google_protobuf_MessageOptions *msg, bool value) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 9311 | const upb_MiniTableField field = {1, 9, 64, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; |
Protobuf Team Bot | ac32c97 | 2024-04-10 03:30:05 +0000 | [diff] [blame] | 9312 | upb_Message_SetBaseField((upb_Message *)msg, &field, &value); |
Mike Kruskal | 232ecf4 | 2023-01-14 00:09:40 -0800 | [diff] [blame] | 9313 | } |
| 9314 | UPB_INLINE void google_protobuf_MessageOptions_set_no_standard_descriptor_accessor(google_protobuf_MessageOptions *msg, bool value) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 9315 | const upb_MiniTableField field = {2, 10, 65, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; |
Protobuf Team Bot | ac32c97 | 2024-04-10 03:30:05 +0000 | [diff] [blame] | 9316 | upb_Message_SetBaseField((upb_Message *)msg, &field, &value); |
Mike Kruskal | 232ecf4 | 2023-01-14 00:09:40 -0800 | [diff] [blame] | 9317 | } |
| 9318 | UPB_INLINE void google_protobuf_MessageOptions_set_deprecated(google_protobuf_MessageOptions *msg, bool value) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 9319 | const upb_MiniTableField field = {3, 11, 66, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; |
Protobuf Team Bot | ac32c97 | 2024-04-10 03:30:05 +0000 | [diff] [blame] | 9320 | upb_Message_SetBaseField((upb_Message *)msg, &field, &value); |
Mike Kruskal | 232ecf4 | 2023-01-14 00:09:40 -0800 | [diff] [blame] | 9321 | } |
| 9322 | UPB_INLINE void google_protobuf_MessageOptions_set_map_entry(google_protobuf_MessageOptions *msg, bool value) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 9323 | const upb_MiniTableField field = {7, 12, 67, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; |
Protobuf Team Bot | ac32c97 | 2024-04-10 03:30:05 +0000 | [diff] [blame] | 9324 | upb_Message_SetBaseField((upb_Message *)msg, &field, &value); |
Mike Kruskal | 232ecf4 | 2023-01-14 00:09:40 -0800 | [diff] [blame] | 9325 | } |
| 9326 | UPB_INLINE void google_protobuf_MessageOptions_set_deprecated_legacy_json_field_conflicts(google_protobuf_MessageOptions *msg, bool value) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 9327 | const upb_MiniTableField field = {11, 13, 68, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; |
Protobuf Team Bot | ac32c97 | 2024-04-10 03:30:05 +0000 | [diff] [blame] | 9328 | upb_Message_SetBaseField((upb_Message *)msg, &field, &value); |
Mike Kruskal | 232ecf4 | 2023-01-14 00:09:40 -0800 | [diff] [blame] | 9329 | } |
Mike Kruskal | 4f9e417 | 2023-06-30 20:14:50 -0700 | [diff] [blame] | 9330 | UPB_INLINE void google_protobuf_MessageOptions_set_features(google_protobuf_MessageOptions *msg, google_protobuf_FeatureSet* value) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 9331 | 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 Bot | a9387b5 | 2024-06-12 15:17:52 +0000 | [diff] [blame] | 9332 | UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__FeatureSet_msg_init); |
Protobuf Team Bot | ac32c97 | 2024-04-10 03:30:05 +0000 | [diff] [blame] | 9333 | upb_Message_SetBaseField((upb_Message *)msg, &field, &value); |
Mike Kruskal | 4f9e417 | 2023-06-30 20:14:50 -0700 | [diff] [blame] | 9334 | } |
| 9335 | UPB_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 Bot | 4ffe086 | 2023-12-06 02:02:36 +0000 | [diff] [blame] | 9338 | sub = (struct google_protobuf_FeatureSet*)_upb_Message_New(&google__protobuf__FeatureSet_msg_init, arena); |
Mike Kruskal | 4f9e417 | 2023-06-30 20:14:50 -0700 | [diff] [blame] | 9339 | if (sub) google_protobuf_MessageOptions_set_features(msg, sub); |
| 9340 | } |
| 9341 | return sub; |
| 9342 | } |
Mike Kruskal | 232ecf4 | 2023-01-14 00:09:40 -0800 | [diff] [blame] | 9343 | UPB_INLINE google_protobuf_UninterpretedOption** google_protobuf_MessageOptions_mutable_uninterpreted_option(google_protobuf_MessageOptions* msg, size_t* size) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 9344 | 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 Bot | a9387b5 | 2024-06-12 15:17:52 +0000 | [diff] [blame] | 9345 | UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__UninterpretedOption_msg_init); |
Protobuf Team Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 9346 | upb_Array* arr = upb_Message_GetMutableArray(UPB_UPCAST(msg), &field); |
Eric Salo | b7d54ac | 2022-12-29 11:59:42 -0800 | [diff] [blame] | 9347 | if (arr) { |
Protobuf Team Bot | f73985a | 2023-12-19 00:14:19 +0000 | [diff] [blame] | 9348 | if (size) *size = arr->UPB_PRIVATE(size); |
Protobuf Team Bot | 81e5433 | 2024-01-11 21:04:07 +0000 | [diff] [blame] | 9349 | return (google_protobuf_UninterpretedOption**)upb_Array_MutableDataPtr(arr); |
Eric Salo | b7d54ac | 2022-12-29 11:59:42 -0800 | [diff] [blame] | 9350 | } else { |
| 9351 | if (size) *size = 0; |
| 9352 | return NULL; |
| 9353 | } |
Joshua Haberman | 9abf6e2 | 2021-01-13 12:16:25 -0800 | [diff] [blame] | 9354 | } |
Eric Salo | b7d54ac | 2022-12-29 11:59:42 -0800 | [diff] [blame] | 9355 | UPB_INLINE google_protobuf_UninterpretedOption** google_protobuf_MessageOptions_resize_uninterpreted_option(google_protobuf_MessageOptions* msg, size_t size, upb_Arena* arena) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 9356 | 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 Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 9357 | return (google_protobuf_UninterpretedOption**)upb_Message_ResizeArrayUninitialized(UPB_UPCAST(msg), |
| 9358 | &field, size, arena); |
Joshua Haberman | 9abf6e2 | 2021-01-13 12:16:25 -0800 | [diff] [blame] | 9359 | } |
Joshua Haberman | 7ecf43f | 2022-03-14 13:11:29 -0700 | [diff] [blame] | 9360 | UPB_INLINE struct google_protobuf_UninterpretedOption* google_protobuf_MessageOptions_add_uninterpreted_option(google_protobuf_MessageOptions* msg, upb_Arena* arena) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 9361 | 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 Bot | a9387b5 | 2024-06-12 15:17:52 +0000 | [diff] [blame] | 9362 | UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__UninterpretedOption_msg_init); |
Protobuf Team Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 9363 | upb_Array* arr = upb_Message_GetOrCreateMutableArray( |
| 9364 | UPB_UPCAST(msg), &field, arena); |
Protobuf Team Bot | 81e5433 | 2024-01-11 21:04:07 +0000 | [diff] [blame] | 9365 | if (!arr || !UPB_PRIVATE(_upb_Array_ResizeUninitialized)( |
Protobuf Team Bot | f73985a | 2023-12-19 00:14:19 +0000 | [diff] [blame] | 9366 | arr, arr->UPB_PRIVATE(size) + 1, arena)) { |
Eric Salo | b7d54ac | 2022-12-29 11:59:42 -0800 | [diff] [blame] | 9367 | return NULL; |
| 9368 | } |
Protobuf Team Bot | 4ffe086 | 2023-12-06 02:02:36 +0000 | [diff] [blame] | 9369 | struct google_protobuf_UninterpretedOption* sub = (struct google_protobuf_UninterpretedOption*)_upb_Message_New(&google__protobuf__UninterpretedOption_msg_init, arena); |
Eric Salo | b7d54ac | 2022-12-29 11:59:42 -0800 | [diff] [blame] | 9370 | if (!arr || !sub) return NULL; |
Protobuf Team Bot | f73985a | 2023-12-19 00:14:19 +0000 | [diff] [blame] | 9371 | UPB_PRIVATE(_upb_Array_Set) |
| 9372 | (arr, arr->UPB_PRIVATE(size) - 1, &sub, sizeof(sub)); |
Joshua Haberman | 9abf6e2 | 2021-01-13 12:16:25 -0800 | [diff] [blame] | 9373 | return sub; |
| 9374 | } |
| 9375 | |
| 9376 | /* google.protobuf.FieldOptions */ |
| 9377 | |
Joshua Haberman | f41049a | 2022-01-21 14:41:25 -0800 | [diff] [blame] | 9378 | UPB_INLINE google_protobuf_FieldOptions* google_protobuf_FieldOptions_new(upb_Arena* arena) { |
Protobuf Team Bot | 4ffe086 | 2023-12-06 02:02:36 +0000 | [diff] [blame] | 9379 | return (google_protobuf_FieldOptions*)_upb_Message_New(&google__protobuf__FieldOptions_msg_init, arena); |
Joshua Haberman | 9abf6e2 | 2021-01-13 12:16:25 -0800 | [diff] [blame] | 9380 | } |
Joshua Haberman | f41049a | 2022-01-21 14:41:25 -0800 | [diff] [blame] | 9381 | UPB_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 Haberman | 9d578a3 | 2021-08-02 15:32:01 -0700 | [diff] [blame] | 9383 | if (!ret) return NULL; |
Protobuf Team Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 9384 | if (upb_Decode(buf, size, UPB_UPCAST(ret), &google__protobuf__FieldOptions_msg_init, NULL, 0, arena) != |
| 9385 | kUpb_DecodeStatus_Ok) { |
Joshua Haberman | 9d578a3 | 2021-08-02 15:32:01 -0700 | [diff] [blame] | 9386 | return NULL; |
| 9387 | } |
| 9388 | return ret; |
Joshua Haberman | 9abf6e2 | 2021-01-13 12:16:25 -0800 | [diff] [blame] | 9389 | } |
Joshua Haberman | f41049a | 2022-01-21 14:41:25 -0800 | [diff] [blame] | 9390 | UPB_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 Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 9395 | if (upb_Decode(buf, size, UPB_UPCAST(ret), &google__protobuf__FieldOptions_msg_init, extreg, options, |
| 9396 | arena) != kUpb_DecodeStatus_Ok) { |
Joshua Haberman | f41049a | 2022-01-21 14:41:25 -0800 | [diff] [blame] | 9397 | return NULL; |
| 9398 | } |
| 9399 | return ret; |
Joshua Haberman | 9abf6e2 | 2021-01-13 12:16:25 -0800 | [diff] [blame] | 9400 | } |
Joshua Haberman | f41049a | 2022-01-21 14:41:25 -0800 | [diff] [blame] | 9401 | UPB_INLINE char* google_protobuf_FieldOptions_serialize(const google_protobuf_FieldOptions* msg, upb_Arena* arena, size_t* len) { |
Joshua Haberman | d3995ec | 2022-09-30 16:54:39 -0700 | [diff] [blame] | 9402 | char* ptr; |
Protobuf Team Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 9403 | (void)upb_Encode(UPB_UPCAST(msg), &google__protobuf__FieldOptions_msg_init, 0, arena, &ptr, len); |
Joshua Haberman | d3995ec | 2022-09-30 16:54:39 -0700 | [diff] [blame] | 9404 | return ptr; |
Joshua Haberman | f41049a | 2022-01-21 14:41:25 -0800 | [diff] [blame] | 9405 | } |
| 9406 | UPB_INLINE char* google_protobuf_FieldOptions_serialize_ex(const google_protobuf_FieldOptions* msg, int options, |
| 9407 | upb_Arena* arena, size_t* len) { |
Joshua Haberman | d3995ec | 2022-09-30 16:54:39 -0700 | [diff] [blame] | 9408 | char* ptr; |
Protobuf Team Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 9409 | (void)upb_Encode(UPB_UPCAST(msg), &google__protobuf__FieldOptions_msg_init, options, arena, &ptr, len); |
Joshua Haberman | d3995ec | 2022-09-30 16:54:39 -0700 | [diff] [blame] | 9410 | return ptr; |
Joshua Haberman | f41049a | 2022-01-21 14:41:25 -0800 | [diff] [blame] | 9411 | } |
Mike Kruskal | 3bc5049 | 2022-12-01 13:34:12 -0800 | [diff] [blame] | 9412 | UPB_INLINE void google_protobuf_FieldOptions_clear_ctype(google_protobuf_FieldOptions* msg) { |
Protobuf Team Bot | 85edb7e | 2024-04-03 02:43:54 +0000 | [diff] [blame] | 9413 | const upb_MiniTableField field = {1, 12, 64, 4, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; |
Protobuf Team Bot | 4e90ead | 2024-01-08 15:46:34 +0000 | [diff] [blame] | 9414 | upb_Message_ClearBaseField(UPB_UPCAST(msg), &field); |
Joshua Haberman | d3995ec | 2022-09-30 16:54:39 -0700 | [diff] [blame] | 9415 | } |
Joshua Haberman | f41049a | 2022-01-21 14:41:25 -0800 | [diff] [blame] | 9416 | UPB_INLINE int32_t google_protobuf_FieldOptions_ctype(const google_protobuf_FieldOptions* msg) { |
Eric Salo | 8809a11 | 2022-11-21 13:01:06 -0800 | [diff] [blame] | 9417 | int32_t default_val = 0; |
| 9418 | int32_t ret; |
Protobuf Team Bot | 85edb7e | 2024-04-03 02:43:54 +0000 | [diff] [blame] | 9419 | const upb_MiniTableField field = {1, 12, 64, 4, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; |
Protobuf Team Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 9420 | _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field, |
| 9421 | &default_val, &ret); |
Eric Salo | 8809a11 | 2022-11-21 13:01:06 -0800 | [diff] [blame] | 9422 | return ret; |
Joshua Haberman | f41049a | 2022-01-21 14:41:25 -0800 | [diff] [blame] | 9423 | } |
Mike Kruskal | 3bc5049 | 2022-12-01 13:34:12 -0800 | [diff] [blame] | 9424 | UPB_INLINE bool google_protobuf_FieldOptions_has_ctype(const google_protobuf_FieldOptions* msg) { |
Protobuf Team Bot | 85edb7e | 2024-04-03 02:43:54 +0000 | [diff] [blame] | 9425 | const upb_MiniTableField field = {1, 12, 64, 4, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; |
Protobuf Team Bot | 8c1f635 | 2024-01-10 05:18:15 +0000 | [diff] [blame] | 9426 | return upb_Message_HasBaseField(UPB_UPCAST(msg), &field); |
Joshua Haberman | 7ecf43f | 2022-03-14 13:11:29 -0700 | [diff] [blame] | 9427 | } |
Mike Kruskal | 3bc5049 | 2022-12-01 13:34:12 -0800 | [diff] [blame] | 9428 | UPB_INLINE void google_protobuf_FieldOptions_clear_packed(google_protobuf_FieldOptions* msg) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 9429 | const upb_MiniTableField field = {2, 16, 65, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; |
Protobuf Team Bot | 4e90ead | 2024-01-08 15:46:34 +0000 | [diff] [blame] | 9430 | upb_Message_ClearBaseField(UPB_UPCAST(msg), &field); |
Joshua Haberman | d3995ec | 2022-09-30 16:54:39 -0700 | [diff] [blame] | 9431 | } |
Joshua Haberman | f41049a | 2022-01-21 14:41:25 -0800 | [diff] [blame] | 9432 | UPB_INLINE bool google_protobuf_FieldOptions_packed(const google_protobuf_FieldOptions* msg) { |
Eric Salo | 8809a11 | 2022-11-21 13:01:06 -0800 | [diff] [blame] | 9433 | bool default_val = false; |
| 9434 | bool ret; |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 9435 | const upb_MiniTableField field = {2, 16, 65, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; |
Protobuf Team Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 9436 | _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field, |
| 9437 | &default_val, &ret); |
Eric Salo | 8809a11 | 2022-11-21 13:01:06 -0800 | [diff] [blame] | 9438 | return ret; |
Joshua Haberman | f41049a | 2022-01-21 14:41:25 -0800 | [diff] [blame] | 9439 | } |
Mike Kruskal | 3bc5049 | 2022-12-01 13:34:12 -0800 | [diff] [blame] | 9440 | UPB_INLINE bool google_protobuf_FieldOptions_has_packed(const google_protobuf_FieldOptions* msg) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 9441 | const upb_MiniTableField field = {2, 16, 65, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; |
Protobuf Team Bot | 8c1f635 | 2024-01-10 05:18:15 +0000 | [diff] [blame] | 9442 | return upb_Message_HasBaseField(UPB_UPCAST(msg), &field); |
Joshua Haberman | 7ecf43f | 2022-03-14 13:11:29 -0700 | [diff] [blame] | 9443 | } |
Mike Kruskal | 3bc5049 | 2022-12-01 13:34:12 -0800 | [diff] [blame] | 9444 | UPB_INLINE void google_protobuf_FieldOptions_clear_deprecated(google_protobuf_FieldOptions* msg) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 9445 | const upb_MiniTableField field = {3, 17, 66, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; |
Protobuf Team Bot | 4e90ead | 2024-01-08 15:46:34 +0000 | [diff] [blame] | 9446 | upb_Message_ClearBaseField(UPB_UPCAST(msg), &field); |
Joshua Haberman | d3995ec | 2022-09-30 16:54:39 -0700 | [diff] [blame] | 9447 | } |
Joshua Haberman | f41049a | 2022-01-21 14:41:25 -0800 | [diff] [blame] | 9448 | UPB_INLINE bool google_protobuf_FieldOptions_deprecated(const google_protobuf_FieldOptions* msg) { |
Eric Salo | 8809a11 | 2022-11-21 13:01:06 -0800 | [diff] [blame] | 9449 | bool default_val = false; |
| 9450 | bool ret; |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 9451 | const upb_MiniTableField field = {3, 17, 66, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; |
Protobuf Team Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 9452 | _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field, |
| 9453 | &default_val, &ret); |
Eric Salo | 8809a11 | 2022-11-21 13:01:06 -0800 | [diff] [blame] | 9454 | return ret; |
Joshua Haberman | f41049a | 2022-01-21 14:41:25 -0800 | [diff] [blame] | 9455 | } |
Mike Kruskal | 3bc5049 | 2022-12-01 13:34:12 -0800 | [diff] [blame] | 9456 | UPB_INLINE bool google_protobuf_FieldOptions_has_deprecated(const google_protobuf_FieldOptions* msg) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 9457 | const upb_MiniTableField field = {3, 17, 66, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; |
Protobuf Team Bot | 8c1f635 | 2024-01-10 05:18:15 +0000 | [diff] [blame] | 9458 | return upb_Message_HasBaseField(UPB_UPCAST(msg), &field); |
Joshua Haberman | 7ecf43f | 2022-03-14 13:11:29 -0700 | [diff] [blame] | 9459 | } |
Mike Kruskal | 3bc5049 | 2022-12-01 13:34:12 -0800 | [diff] [blame] | 9460 | UPB_INLINE void google_protobuf_FieldOptions_clear_lazy(google_protobuf_FieldOptions* msg) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 9461 | const upb_MiniTableField field = {5, 18, 67, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; |
Protobuf Team Bot | 4e90ead | 2024-01-08 15:46:34 +0000 | [diff] [blame] | 9462 | upb_Message_ClearBaseField(UPB_UPCAST(msg), &field); |
Joshua Haberman | d3995ec | 2022-09-30 16:54:39 -0700 | [diff] [blame] | 9463 | } |
Joshua Haberman | f41049a | 2022-01-21 14:41:25 -0800 | [diff] [blame] | 9464 | UPB_INLINE bool google_protobuf_FieldOptions_lazy(const google_protobuf_FieldOptions* msg) { |
Eric Salo | 8809a11 | 2022-11-21 13:01:06 -0800 | [diff] [blame] | 9465 | bool default_val = false; |
| 9466 | bool ret; |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 9467 | const upb_MiniTableField field = {5, 18, 67, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; |
Protobuf Team Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 9468 | _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field, |
| 9469 | &default_val, &ret); |
Eric Salo | 8809a11 | 2022-11-21 13:01:06 -0800 | [diff] [blame] | 9470 | return ret; |
Joshua Haberman | f41049a | 2022-01-21 14:41:25 -0800 | [diff] [blame] | 9471 | } |
Mike Kruskal | 3bc5049 | 2022-12-01 13:34:12 -0800 | [diff] [blame] | 9472 | UPB_INLINE bool google_protobuf_FieldOptions_has_lazy(const google_protobuf_FieldOptions* msg) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 9473 | const upb_MiniTableField field = {5, 18, 67, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; |
Protobuf Team Bot | 8c1f635 | 2024-01-10 05:18:15 +0000 | [diff] [blame] | 9474 | return upb_Message_HasBaseField(UPB_UPCAST(msg), &field); |
Joshua Haberman | 7ecf43f | 2022-03-14 13:11:29 -0700 | [diff] [blame] | 9475 | } |
Mike Kruskal | 3bc5049 | 2022-12-01 13:34:12 -0800 | [diff] [blame] | 9476 | UPB_INLINE void google_protobuf_FieldOptions_clear_jstype(google_protobuf_FieldOptions* msg) { |
Protobuf Team Bot | 85edb7e | 2024-04-03 02:43:54 +0000 | [diff] [blame] | 9477 | const upb_MiniTableField field = {6, 20, 68, 5, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; |
Protobuf Team Bot | 4e90ead | 2024-01-08 15:46:34 +0000 | [diff] [blame] | 9478 | upb_Message_ClearBaseField(UPB_UPCAST(msg), &field); |
Joshua Haberman | d3995ec | 2022-09-30 16:54:39 -0700 | [diff] [blame] | 9479 | } |
Joshua Haberman | f41049a | 2022-01-21 14:41:25 -0800 | [diff] [blame] | 9480 | UPB_INLINE int32_t google_protobuf_FieldOptions_jstype(const google_protobuf_FieldOptions* msg) { |
Eric Salo | 8809a11 | 2022-11-21 13:01:06 -0800 | [diff] [blame] | 9481 | int32_t default_val = 0; |
| 9482 | int32_t ret; |
Protobuf Team Bot | 85edb7e | 2024-04-03 02:43:54 +0000 | [diff] [blame] | 9483 | const upb_MiniTableField field = {6, 20, 68, 5, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; |
Protobuf Team Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 9484 | _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field, |
| 9485 | &default_val, &ret); |
Eric Salo | 8809a11 | 2022-11-21 13:01:06 -0800 | [diff] [blame] | 9486 | return ret; |
Joshua Haberman | f41049a | 2022-01-21 14:41:25 -0800 | [diff] [blame] | 9487 | } |
Mike Kruskal | 3bc5049 | 2022-12-01 13:34:12 -0800 | [diff] [blame] | 9488 | UPB_INLINE bool google_protobuf_FieldOptions_has_jstype(const google_protobuf_FieldOptions* msg) { |
Protobuf Team Bot | 85edb7e | 2024-04-03 02:43:54 +0000 | [diff] [blame] | 9489 | const upb_MiniTableField field = {6, 20, 68, 5, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; |
Protobuf Team Bot | 8c1f635 | 2024-01-10 05:18:15 +0000 | [diff] [blame] | 9490 | return upb_Message_HasBaseField(UPB_UPCAST(msg), &field); |
Joshua Haberman | 7ecf43f | 2022-03-14 13:11:29 -0700 | [diff] [blame] | 9491 | } |
Mike Kruskal | 3bc5049 | 2022-12-01 13:34:12 -0800 | [diff] [blame] | 9492 | UPB_INLINE void google_protobuf_FieldOptions_clear_weak(google_protobuf_FieldOptions* msg) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 9493 | const upb_MiniTableField field = {10, 24, 69, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; |
Protobuf Team Bot | 4e90ead | 2024-01-08 15:46:34 +0000 | [diff] [blame] | 9494 | upb_Message_ClearBaseField(UPB_UPCAST(msg), &field); |
Joshua Haberman | d3995ec | 2022-09-30 16:54:39 -0700 | [diff] [blame] | 9495 | } |
Joshua Haberman | f41049a | 2022-01-21 14:41:25 -0800 | [diff] [blame] | 9496 | UPB_INLINE bool google_protobuf_FieldOptions_weak(const google_protobuf_FieldOptions* msg) { |
Eric Salo | 8809a11 | 2022-11-21 13:01:06 -0800 | [diff] [blame] | 9497 | bool default_val = false; |
| 9498 | bool ret; |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 9499 | const upb_MiniTableField field = {10, 24, 69, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; |
Protobuf Team Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 9500 | _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field, |
| 9501 | &default_val, &ret); |
Eric Salo | 8809a11 | 2022-11-21 13:01:06 -0800 | [diff] [blame] | 9502 | return ret; |
Joshua Haberman | f41049a | 2022-01-21 14:41:25 -0800 | [diff] [blame] | 9503 | } |
Mike Kruskal | 3bc5049 | 2022-12-01 13:34:12 -0800 | [diff] [blame] | 9504 | UPB_INLINE bool google_protobuf_FieldOptions_has_weak(const google_protobuf_FieldOptions* msg) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 9505 | const upb_MiniTableField field = {10, 24, 69, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; |
Protobuf Team Bot | 8c1f635 | 2024-01-10 05:18:15 +0000 | [diff] [blame] | 9506 | return upb_Message_HasBaseField(UPB_UPCAST(msg), &field); |
Joshua Haberman | 7ecf43f | 2022-03-14 13:11:29 -0700 | [diff] [blame] | 9507 | } |
Mike Kruskal | 3bc5049 | 2022-12-01 13:34:12 -0800 | [diff] [blame] | 9508 | UPB_INLINE void google_protobuf_FieldOptions_clear_unverified_lazy(google_protobuf_FieldOptions* msg) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 9509 | const upb_MiniTableField field = {15, 25, 70, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; |
Protobuf Team Bot | 4e90ead | 2024-01-08 15:46:34 +0000 | [diff] [blame] | 9510 | upb_Message_ClearBaseField(UPB_UPCAST(msg), &field); |
Joshua Haberman | d3995ec | 2022-09-30 16:54:39 -0700 | [diff] [blame] | 9511 | } |
Joshua Haberman | 7ecf43f | 2022-03-14 13:11:29 -0700 | [diff] [blame] | 9512 | UPB_INLINE bool google_protobuf_FieldOptions_unverified_lazy(const google_protobuf_FieldOptions* msg) { |
Eric Salo | 8809a11 | 2022-11-21 13:01:06 -0800 | [diff] [blame] | 9513 | bool default_val = false; |
| 9514 | bool ret; |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 9515 | const upb_MiniTableField field = {15, 25, 70, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; |
Protobuf Team Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 9516 | _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field, |
| 9517 | &default_val, &ret); |
Eric Salo | 8809a11 | 2022-11-21 13:01:06 -0800 | [diff] [blame] | 9518 | return ret; |
Joshua Haberman | 7ecf43f | 2022-03-14 13:11:29 -0700 | [diff] [blame] | 9519 | } |
Mike Kruskal | 3bc5049 | 2022-12-01 13:34:12 -0800 | [diff] [blame] | 9520 | UPB_INLINE bool google_protobuf_FieldOptions_has_unverified_lazy(const google_protobuf_FieldOptions* msg) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 9521 | const upb_MiniTableField field = {15, 25, 70, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; |
Protobuf Team Bot | 8c1f635 | 2024-01-10 05:18:15 +0000 | [diff] [blame] | 9522 | return upb_Message_HasBaseField(UPB_UPCAST(msg), &field); |
Joshua Haberman | 7ecf43f | 2022-03-14 13:11:29 -0700 | [diff] [blame] | 9523 | } |
Protobuf Team Bot | 9238c48 | 2022-12-16 20:01:55 -0800 | [diff] [blame] | 9524 | UPB_INLINE void google_protobuf_FieldOptions_clear_debug_redact(google_protobuf_FieldOptions* msg) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 9525 | const upb_MiniTableField field = {16, 26, 71, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; |
Protobuf Team Bot | 4e90ead | 2024-01-08 15:46:34 +0000 | [diff] [blame] | 9526 | upb_Message_ClearBaseField(UPB_UPCAST(msg), &field); |
Protobuf Team Bot | 9238c48 | 2022-12-16 20:01:55 -0800 | [diff] [blame] | 9527 | } |
| 9528 | UPB_INLINE bool google_protobuf_FieldOptions_debug_redact(const google_protobuf_FieldOptions* msg) { |
| 9529 | bool default_val = false; |
| 9530 | bool ret; |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 9531 | const upb_MiniTableField field = {16, 26, 71, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; |
Protobuf Team Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 9532 | _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field, |
| 9533 | &default_val, &ret); |
Protobuf Team Bot | 9238c48 | 2022-12-16 20:01:55 -0800 | [diff] [blame] | 9534 | return ret; |
| 9535 | } |
| 9536 | UPB_INLINE bool google_protobuf_FieldOptions_has_debug_redact(const google_protobuf_FieldOptions* msg) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 9537 | const upb_MiniTableField field = {16, 26, 71, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; |
Protobuf Team Bot | 8c1f635 | 2024-01-10 05:18:15 +0000 | [diff] [blame] | 9538 | return upb_Message_HasBaseField(UPB_UPCAST(msg), &field); |
Protobuf Team Bot | 9238c48 | 2022-12-16 20:01:55 -0800 | [diff] [blame] | 9539 | } |
Adam Cozzette | 5a56837 | 2023-01-24 20:35:59 -0800 | [diff] [blame] | 9540 | UPB_INLINE void google_protobuf_FieldOptions_clear_retention(google_protobuf_FieldOptions* msg) { |
Protobuf Team Bot | 85edb7e | 2024-04-03 02:43:54 +0000 | [diff] [blame] | 9541 | const upb_MiniTableField field = {17, 28, 72, 6, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; |
Protobuf Team Bot | 4e90ead | 2024-01-08 15:46:34 +0000 | [diff] [blame] | 9542 | upb_Message_ClearBaseField(UPB_UPCAST(msg), &field); |
Adam Cozzette | 5a56837 | 2023-01-24 20:35:59 -0800 | [diff] [blame] | 9543 | } |
| 9544 | UPB_INLINE int32_t google_protobuf_FieldOptions_retention(const google_protobuf_FieldOptions* msg) { |
| 9545 | int32_t default_val = 0; |
| 9546 | int32_t ret; |
Protobuf Team Bot | 85edb7e | 2024-04-03 02:43:54 +0000 | [diff] [blame] | 9547 | const upb_MiniTableField field = {17, 28, 72, 6, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; |
Protobuf Team Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 9548 | _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field, |
| 9549 | &default_val, &ret); |
Adam Cozzette | 5a56837 | 2023-01-24 20:35:59 -0800 | [diff] [blame] | 9550 | return ret; |
| 9551 | } |
| 9552 | UPB_INLINE bool google_protobuf_FieldOptions_has_retention(const google_protobuf_FieldOptions* msg) { |
Protobuf Team Bot | 85edb7e | 2024-04-03 02:43:54 +0000 | [diff] [blame] | 9553 | const upb_MiniTableField field = {17, 28, 72, 6, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; |
Protobuf Team Bot | 8c1f635 | 2024-01-10 05:18:15 +0000 | [diff] [blame] | 9554 | return upb_Message_HasBaseField(UPB_UPCAST(msg), &field); |
Adam Cozzette | 5a56837 | 2023-01-24 20:35:59 -0800 | [diff] [blame] | 9555 | } |
Mike Kruskal | 0c12139 | 2023-03-18 00:05:41 -0700 | [diff] [blame] | 9556 | UPB_INLINE void google_protobuf_FieldOptions_clear_targets(google_protobuf_FieldOptions* msg) { |
Protobuf Team Bot | 85edb7e | 2024-04-03 02:43:54 +0000 | [diff] [blame] | 9557 | 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 Bot | 4e90ead | 2024-01-08 15:46:34 +0000 | [diff] [blame] | 9558 | upb_Message_ClearBaseField(UPB_UPCAST(msg), &field); |
Adam Cozzette | 5a56837 | 2023-01-24 20:35:59 -0800 | [diff] [blame] | 9559 | } |
Mike Kruskal | 0c12139 | 2023-03-18 00:05:41 -0700 | [diff] [blame] | 9560 | UPB_INLINE int32_t const* google_protobuf_FieldOptions_targets(const google_protobuf_FieldOptions* msg, size_t* size) { |
Protobuf Team Bot | 85edb7e | 2024-04-03 02:43:54 +0000 | [diff] [blame] | 9561 | 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 Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 9562 | const upb_Array* arr = upb_Message_GetArray(UPB_UPCAST(msg), &field); |
Mike Kruskal | 0c12139 | 2023-03-18 00:05:41 -0700 | [diff] [blame] | 9563 | if (arr) { |
Protobuf Team Bot | f73985a | 2023-12-19 00:14:19 +0000 | [diff] [blame] | 9564 | if (size) *size = arr->UPB_PRIVATE(size); |
Protobuf Team Bot | 81e5433 | 2024-01-11 21:04:07 +0000 | [diff] [blame] | 9565 | return (int32_t const*)upb_Array_DataPtr(arr); |
Mike Kruskal | 0c12139 | 2023-03-18 00:05:41 -0700 | [diff] [blame] | 9566 | } else { |
| 9567 | if (size) *size = 0; |
| 9568 | return NULL; |
| 9569 | } |
Adam Cozzette | 5a56837 | 2023-01-24 20:35:59 -0800 | [diff] [blame] | 9570 | } |
Deanna Garcia | b26afb5 | 2023-04-25 13:37:18 -0700 | [diff] [blame] | 9571 | UPB_INLINE const upb_Array* _google_protobuf_FieldOptions_targets_upb_array(const google_protobuf_FieldOptions* msg, size_t* size) { |
Protobuf Team Bot | 85edb7e | 2024-04-03 02:43:54 +0000 | [diff] [blame] | 9572 | 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 Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 9573 | const upb_Array* arr = upb_Message_GetArray(UPB_UPCAST(msg), &field); |
Deanna Garcia | b26afb5 | 2023-04-25 13:37:18 -0700 | [diff] [blame] | 9574 | if (size) { |
Protobuf Team Bot | f73985a | 2023-12-19 00:14:19 +0000 | [diff] [blame] | 9575 | *size = arr ? arr->UPB_PRIVATE(size) : 0; |
Deanna Garcia | b26afb5 | 2023-04-25 13:37:18 -0700 | [diff] [blame] | 9576 | } |
| 9577 | return arr; |
| 9578 | } |
Protobuf Team Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 9579 | UPB_INLINE upb_Array* _google_protobuf_FieldOptions_targets_mutable_upb_array(google_protobuf_FieldOptions* msg, size_t* size, upb_Arena* arena) { |
Protobuf Team Bot | 85edb7e | 2024-04-03 02:43:54 +0000 | [diff] [blame] | 9580 | 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 Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 9581 | upb_Array* arr = upb_Message_GetOrCreateMutableArray(UPB_UPCAST(msg), |
| 9582 | &field, arena); |
Deanna Garcia | b26afb5 | 2023-04-25 13:37:18 -0700 | [diff] [blame] | 9583 | if (size) { |
Protobuf Team Bot | f73985a | 2023-12-19 00:14:19 +0000 | [diff] [blame] | 9584 | *size = arr ? arr->UPB_PRIVATE(size) : 0; |
Deanna Garcia | b26afb5 | 2023-04-25 13:37:18 -0700 | [diff] [blame] | 9585 | } |
| 9586 | return arr; |
| 9587 | } |
Mike Kruskal | 4f9e417 | 2023-06-30 20:14:50 -0700 | [diff] [blame] | 9588 | UPB_INLINE void google_protobuf_FieldOptions_clear_edition_defaults(google_protobuf_FieldOptions* msg) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 9589 | 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 Bot | 4e90ead | 2024-01-08 15:46:34 +0000 | [diff] [blame] | 9590 | upb_Message_ClearBaseField(UPB_UPCAST(msg), &field); |
Mike Kruskal | 4f9e417 | 2023-06-30 20:14:50 -0700 | [diff] [blame] | 9591 | } |
| 9592 | UPB_INLINE const google_protobuf_FieldOptions_EditionDefault* const* google_protobuf_FieldOptions_edition_defaults(const google_protobuf_FieldOptions* msg, size_t* size) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 9593 | 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 Bot | a9387b5 | 2024-06-12 15:17:52 +0000 | [diff] [blame] | 9594 | UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__FieldOptions__EditionDefault_msg_init); |
Protobuf Team Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 9595 | const upb_Array* arr = upb_Message_GetArray(UPB_UPCAST(msg), &field); |
Mike Kruskal | 4f9e417 | 2023-06-30 20:14:50 -0700 | [diff] [blame] | 9596 | if (arr) { |
Protobuf Team Bot | f73985a | 2023-12-19 00:14:19 +0000 | [diff] [blame] | 9597 | if (size) *size = arr->UPB_PRIVATE(size); |
Protobuf Team Bot | 81e5433 | 2024-01-11 21:04:07 +0000 | [diff] [blame] | 9598 | return (const google_protobuf_FieldOptions_EditionDefault* const*)upb_Array_DataPtr(arr); |
Mike Kruskal | 4f9e417 | 2023-06-30 20:14:50 -0700 | [diff] [blame] | 9599 | } else { |
| 9600 | if (size) *size = 0; |
| 9601 | return NULL; |
| 9602 | } |
| 9603 | } |
| 9604 | UPB_INLINE const upb_Array* _google_protobuf_FieldOptions_edition_defaults_upb_array(const google_protobuf_FieldOptions* msg, size_t* size) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 9605 | 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 Bot | a9387b5 | 2024-06-12 15:17:52 +0000 | [diff] [blame] | 9606 | UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__FieldOptions__EditionDefault_msg_init); |
Protobuf Team Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 9607 | const upb_Array* arr = upb_Message_GetArray(UPB_UPCAST(msg), &field); |
Mike Kruskal | 4f9e417 | 2023-06-30 20:14:50 -0700 | [diff] [blame] | 9608 | if (size) { |
Protobuf Team Bot | f73985a | 2023-12-19 00:14:19 +0000 | [diff] [blame] | 9609 | *size = arr ? arr->UPB_PRIVATE(size) : 0; |
Mike Kruskal | 4f9e417 | 2023-06-30 20:14:50 -0700 | [diff] [blame] | 9610 | } |
| 9611 | return arr; |
| 9612 | } |
Protobuf Team Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 9613 | UPB_INLINE upb_Array* _google_protobuf_FieldOptions_edition_defaults_mutable_upb_array(google_protobuf_FieldOptions* msg, size_t* size, upb_Arena* arena) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 9614 | 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 Bot | a9387b5 | 2024-06-12 15:17:52 +0000 | [diff] [blame] | 9615 | UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__FieldOptions__EditionDefault_msg_init); |
Protobuf Team Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 9616 | upb_Array* arr = upb_Message_GetOrCreateMutableArray(UPB_UPCAST(msg), |
| 9617 | &field, arena); |
Mike Kruskal | 4f9e417 | 2023-06-30 20:14:50 -0700 | [diff] [blame] | 9618 | if (size) { |
Protobuf Team Bot | f73985a | 2023-12-19 00:14:19 +0000 | [diff] [blame] | 9619 | *size = arr ? arr->UPB_PRIVATE(size) : 0; |
Mike Kruskal | 4f9e417 | 2023-06-30 20:14:50 -0700 | [diff] [blame] | 9620 | } |
| 9621 | return arr; |
| 9622 | } |
Mike Kruskal | 4f9e417 | 2023-06-30 20:14:50 -0700 | [diff] [blame] | 9623 | UPB_INLINE void google_protobuf_FieldOptions_clear_features(google_protobuf_FieldOptions* msg) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 9624 | 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 Bot | 4e90ead | 2024-01-08 15:46:34 +0000 | [diff] [blame] | 9625 | upb_Message_ClearBaseField(UPB_UPCAST(msg), &field); |
Mike Kruskal | 4f9e417 | 2023-06-30 20:14:50 -0700 | [diff] [blame] | 9626 | } |
| 9627 | UPB_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 Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 9630 | 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 Bot | a9387b5 | 2024-06-12 15:17:52 +0000 | [diff] [blame] | 9631 | UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__FeatureSet_msg_init); |
Protobuf Team Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 9632 | _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field, |
| 9633 | &default_val, &ret); |
Mike Kruskal | 4f9e417 | 2023-06-30 20:14:50 -0700 | [diff] [blame] | 9634 | return ret; |
| 9635 | } |
| 9636 | UPB_INLINE bool google_protobuf_FieldOptions_has_features(const google_protobuf_FieldOptions* msg) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 9637 | 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 Bot | 8c1f635 | 2024-01-10 05:18:15 +0000 | [diff] [blame] | 9638 | return upb_Message_HasBaseField(UPB_UPCAST(msg), &field); |
Mike Kruskal | 4f9e417 | 2023-06-30 20:14:50 -0700 | [diff] [blame] | 9639 | } |
Protobuf Team Bot | 85edb7e | 2024-04-03 02:43:54 +0000 | [diff] [blame] | 9640 | UPB_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 | } |
| 9644 | UPB_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 Bot | a9387b5 | 2024-06-12 15:17:52 +0000 | [diff] [blame] | 9648 | UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__FieldOptions__FeatureSupport_msg_init); |
Protobuf Team Bot | 85edb7e | 2024-04-03 02:43:54 +0000 | [diff] [blame] | 9649 | _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field, |
| 9650 | &default_val, &ret); |
| 9651 | return ret; |
| 9652 | } |
| 9653 | UPB_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 Kruskal | 3bc5049 | 2022-12-01 13:34:12 -0800 | [diff] [blame] | 9657 | UPB_INLINE void google_protobuf_FieldOptions_clear_uninterpreted_option(google_protobuf_FieldOptions* msg) { |
Protobuf Team Bot | 85edb7e | 2024-04-03 02:43:54 +0000 | [diff] [blame] | 9658 | 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 Bot | 4e90ead | 2024-01-08 15:46:34 +0000 | [diff] [blame] | 9659 | upb_Message_ClearBaseField(UPB_UPCAST(msg), &field); |
Joshua Haberman | d3995ec | 2022-09-30 16:54:39 -0700 | [diff] [blame] | 9660 | } |
Eric Salo | b7d54ac | 2022-12-29 11:59:42 -0800 | [diff] [blame] | 9661 | UPB_INLINE const google_protobuf_UninterpretedOption* const* google_protobuf_FieldOptions_uninterpreted_option(const google_protobuf_FieldOptions* msg, size_t* size) { |
Protobuf Team Bot | 85edb7e | 2024-04-03 02:43:54 +0000 | [diff] [blame] | 9662 | 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 Bot | a9387b5 | 2024-06-12 15:17:52 +0000 | [diff] [blame] | 9663 | UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__UninterpretedOption_msg_init); |
Protobuf Team Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 9664 | const upb_Array* arr = upb_Message_GetArray(UPB_UPCAST(msg), &field); |
Eric Salo | b7d54ac | 2022-12-29 11:59:42 -0800 | [diff] [blame] | 9665 | if (arr) { |
Protobuf Team Bot | f73985a | 2023-12-19 00:14:19 +0000 | [diff] [blame] | 9666 | if (size) *size = arr->UPB_PRIVATE(size); |
Protobuf Team Bot | 81e5433 | 2024-01-11 21:04:07 +0000 | [diff] [blame] | 9667 | return (const google_protobuf_UninterpretedOption* const*)upb_Array_DataPtr(arr); |
Eric Salo | b7d54ac | 2022-12-29 11:59:42 -0800 | [diff] [blame] | 9668 | } else { |
| 9669 | if (size) *size = 0; |
| 9670 | return NULL; |
| 9671 | } |
Joshua Haberman | 7ecf43f | 2022-03-14 13:11:29 -0700 | [diff] [blame] | 9672 | } |
Deanna Garcia | b26afb5 | 2023-04-25 13:37:18 -0700 | [diff] [blame] | 9673 | UPB_INLINE const upb_Array* _google_protobuf_FieldOptions_uninterpreted_option_upb_array(const google_protobuf_FieldOptions* msg, size_t* size) { |
Protobuf Team Bot | 85edb7e | 2024-04-03 02:43:54 +0000 | [diff] [blame] | 9674 | 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 Bot | a9387b5 | 2024-06-12 15:17:52 +0000 | [diff] [blame] | 9675 | UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__UninterpretedOption_msg_init); |
Protobuf Team Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 9676 | const upb_Array* arr = upb_Message_GetArray(UPB_UPCAST(msg), &field); |
Deanna Garcia | b26afb5 | 2023-04-25 13:37:18 -0700 | [diff] [blame] | 9677 | if (size) { |
Protobuf Team Bot | f73985a | 2023-12-19 00:14:19 +0000 | [diff] [blame] | 9678 | *size = arr ? arr->UPB_PRIVATE(size) : 0; |
Deanna Garcia | b26afb5 | 2023-04-25 13:37:18 -0700 | [diff] [blame] | 9679 | } |
| 9680 | return arr; |
| 9681 | } |
Protobuf Team Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 9682 | UPB_INLINE upb_Array* _google_protobuf_FieldOptions_uninterpreted_option_mutable_upb_array(google_protobuf_FieldOptions* msg, size_t* size, upb_Arena* arena) { |
Protobuf Team Bot | 85edb7e | 2024-04-03 02:43:54 +0000 | [diff] [blame] | 9683 | 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 Bot | a9387b5 | 2024-06-12 15:17:52 +0000 | [diff] [blame] | 9684 | UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__UninterpretedOption_msg_init); |
Protobuf Team Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 9685 | upb_Array* arr = upb_Message_GetOrCreateMutableArray(UPB_UPCAST(msg), |
| 9686 | &field, arena); |
Deanna Garcia | b26afb5 | 2023-04-25 13:37:18 -0700 | [diff] [blame] | 9687 | if (size) { |
Protobuf Team Bot | f73985a | 2023-12-19 00:14:19 +0000 | [diff] [blame] | 9688 | *size = arr ? arr->UPB_PRIVATE(size) : 0; |
Deanna Garcia | b26afb5 | 2023-04-25 13:37:18 -0700 | [diff] [blame] | 9689 | } |
| 9690 | return arr; |
| 9691 | } |
Joshua Haberman | 9abf6e2 | 2021-01-13 12:16:25 -0800 | [diff] [blame] | 9692 | |
| 9693 | UPB_INLINE void google_protobuf_FieldOptions_set_ctype(google_protobuf_FieldOptions *msg, int32_t value) { |
Protobuf Team Bot | 85edb7e | 2024-04-03 02:43:54 +0000 | [diff] [blame] | 9694 | const upb_MiniTableField field = {1, 12, 64, 4, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; |
Protobuf Team Bot | ac32c97 | 2024-04-10 03:30:05 +0000 | [diff] [blame] | 9695 | upb_Message_SetBaseField((upb_Message *)msg, &field, &value); |
Mike Kruskal | 232ecf4 | 2023-01-14 00:09:40 -0800 | [diff] [blame] | 9696 | } |
| 9697 | UPB_INLINE void google_protobuf_FieldOptions_set_packed(google_protobuf_FieldOptions *msg, bool value) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 9698 | const upb_MiniTableField field = {2, 16, 65, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; |
Protobuf Team Bot | ac32c97 | 2024-04-10 03:30:05 +0000 | [diff] [blame] | 9699 | upb_Message_SetBaseField((upb_Message *)msg, &field, &value); |
Mike Kruskal | 232ecf4 | 2023-01-14 00:09:40 -0800 | [diff] [blame] | 9700 | } |
| 9701 | UPB_INLINE void google_protobuf_FieldOptions_set_deprecated(google_protobuf_FieldOptions *msg, bool value) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 9702 | const upb_MiniTableField field = {3, 17, 66, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; |
Protobuf Team Bot | ac32c97 | 2024-04-10 03:30:05 +0000 | [diff] [blame] | 9703 | upb_Message_SetBaseField((upb_Message *)msg, &field, &value); |
Mike Kruskal | 232ecf4 | 2023-01-14 00:09:40 -0800 | [diff] [blame] | 9704 | } |
| 9705 | UPB_INLINE void google_protobuf_FieldOptions_set_lazy(google_protobuf_FieldOptions *msg, bool value) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 9706 | const upb_MiniTableField field = {5, 18, 67, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; |
Protobuf Team Bot | ac32c97 | 2024-04-10 03:30:05 +0000 | [diff] [blame] | 9707 | upb_Message_SetBaseField((upb_Message *)msg, &field, &value); |
Mike Kruskal | 232ecf4 | 2023-01-14 00:09:40 -0800 | [diff] [blame] | 9708 | } |
| 9709 | UPB_INLINE void google_protobuf_FieldOptions_set_jstype(google_protobuf_FieldOptions *msg, int32_t value) { |
Protobuf Team Bot | 85edb7e | 2024-04-03 02:43:54 +0000 | [diff] [blame] | 9710 | const upb_MiniTableField field = {6, 20, 68, 5, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; |
Protobuf Team Bot | ac32c97 | 2024-04-10 03:30:05 +0000 | [diff] [blame] | 9711 | upb_Message_SetBaseField((upb_Message *)msg, &field, &value); |
Mike Kruskal | 232ecf4 | 2023-01-14 00:09:40 -0800 | [diff] [blame] | 9712 | } |
| 9713 | UPB_INLINE void google_protobuf_FieldOptions_set_weak(google_protobuf_FieldOptions *msg, bool value) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 9714 | const upb_MiniTableField field = {10, 24, 69, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; |
Protobuf Team Bot | ac32c97 | 2024-04-10 03:30:05 +0000 | [diff] [blame] | 9715 | upb_Message_SetBaseField((upb_Message *)msg, &field, &value); |
Mike Kruskal | 232ecf4 | 2023-01-14 00:09:40 -0800 | [diff] [blame] | 9716 | } |
| 9717 | UPB_INLINE void google_protobuf_FieldOptions_set_unverified_lazy(google_protobuf_FieldOptions *msg, bool value) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 9718 | const upb_MiniTableField field = {15, 25, 70, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; |
Protobuf Team Bot | ac32c97 | 2024-04-10 03:30:05 +0000 | [diff] [blame] | 9719 | upb_Message_SetBaseField((upb_Message *)msg, &field, &value); |
Mike Kruskal | 232ecf4 | 2023-01-14 00:09:40 -0800 | [diff] [blame] | 9720 | } |
| 9721 | UPB_INLINE void google_protobuf_FieldOptions_set_debug_redact(google_protobuf_FieldOptions *msg, bool value) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 9722 | const upb_MiniTableField field = {16, 26, 71, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; |
Protobuf Team Bot | ac32c97 | 2024-04-10 03:30:05 +0000 | [diff] [blame] | 9723 | upb_Message_SetBaseField((upb_Message *)msg, &field, &value); |
Mike Kruskal | 232ecf4 | 2023-01-14 00:09:40 -0800 | [diff] [blame] | 9724 | } |
Adam Cozzette | 5a56837 | 2023-01-24 20:35:59 -0800 | [diff] [blame] | 9725 | UPB_INLINE void google_protobuf_FieldOptions_set_retention(google_protobuf_FieldOptions *msg, int32_t value) { |
Protobuf Team Bot | 85edb7e | 2024-04-03 02:43:54 +0000 | [diff] [blame] | 9726 | const upb_MiniTableField field = {17, 28, 72, 6, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; |
Protobuf Team Bot | ac32c97 | 2024-04-10 03:30:05 +0000 | [diff] [blame] | 9727 | upb_Message_SetBaseField((upb_Message *)msg, &field, &value); |
Adam Cozzette | 5a56837 | 2023-01-24 20:35:59 -0800 | [diff] [blame] | 9728 | } |
Mike Kruskal | 0c12139 | 2023-03-18 00:05:41 -0700 | [diff] [blame] | 9729 | UPB_INLINE int32_t* google_protobuf_FieldOptions_mutable_targets(google_protobuf_FieldOptions* msg, size_t* size) { |
Protobuf Team Bot | 85edb7e | 2024-04-03 02:43:54 +0000 | [diff] [blame] | 9730 | 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 Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 9731 | upb_Array* arr = upb_Message_GetMutableArray(UPB_UPCAST(msg), &field); |
Mike Kruskal | 0c12139 | 2023-03-18 00:05:41 -0700 | [diff] [blame] | 9732 | if (arr) { |
Protobuf Team Bot | f73985a | 2023-12-19 00:14:19 +0000 | [diff] [blame] | 9733 | if (size) *size = arr->UPB_PRIVATE(size); |
Protobuf Team Bot | 81e5433 | 2024-01-11 21:04:07 +0000 | [diff] [blame] | 9734 | return (int32_t*)upb_Array_MutableDataPtr(arr); |
Mike Kruskal | 0c12139 | 2023-03-18 00:05:41 -0700 | [diff] [blame] | 9735 | } else { |
| 9736 | if (size) *size = 0; |
| 9737 | return NULL; |
| 9738 | } |
| 9739 | } |
| 9740 | UPB_INLINE int32_t* google_protobuf_FieldOptions_resize_targets(google_protobuf_FieldOptions* msg, size_t size, upb_Arena* arena) { |
Protobuf Team Bot | 85edb7e | 2024-04-03 02:43:54 +0000 | [diff] [blame] | 9741 | 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 Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 9742 | return (int32_t*)upb_Message_ResizeArrayUninitialized(UPB_UPCAST(msg), |
| 9743 | &field, size, arena); |
Mike Kruskal | 0c12139 | 2023-03-18 00:05:41 -0700 | [diff] [blame] | 9744 | } |
| 9745 | UPB_INLINE bool google_protobuf_FieldOptions_add_targets(google_protobuf_FieldOptions* msg, int32_t val, upb_Arena* arena) { |
Protobuf Team Bot | 85edb7e | 2024-04-03 02:43:54 +0000 | [diff] [blame] | 9746 | 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 Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 9747 | upb_Array* arr = upb_Message_GetOrCreateMutableArray( |
| 9748 | UPB_UPCAST(msg), &field, arena); |
Protobuf Team Bot | 81e5433 | 2024-01-11 21:04:07 +0000 | [diff] [blame] | 9749 | if (!arr || !UPB_PRIVATE(_upb_Array_ResizeUninitialized)( |
Protobuf Team Bot | f73985a | 2023-12-19 00:14:19 +0000 | [diff] [blame] | 9750 | arr, arr->UPB_PRIVATE(size) + 1, arena)) { |
Mike Kruskal | 0c12139 | 2023-03-18 00:05:41 -0700 | [diff] [blame] | 9751 | return false; |
| 9752 | } |
Protobuf Team Bot | f73985a | 2023-12-19 00:14:19 +0000 | [diff] [blame] | 9753 | UPB_PRIVATE(_upb_Array_Set) |
| 9754 | (arr, arr->UPB_PRIVATE(size) - 1, &val, sizeof(val)); |
Mike Kruskal | 0c12139 | 2023-03-18 00:05:41 -0700 | [diff] [blame] | 9755 | return true; |
Adam Cozzette | 5a56837 | 2023-01-24 20:35:59 -0800 | [diff] [blame] | 9756 | } |
Mike Kruskal | 4f9e417 | 2023-06-30 20:14:50 -0700 | [diff] [blame] | 9757 | UPB_INLINE google_protobuf_FieldOptions_EditionDefault** google_protobuf_FieldOptions_mutable_edition_defaults(google_protobuf_FieldOptions* msg, size_t* size) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 9758 | 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 Bot | a9387b5 | 2024-06-12 15:17:52 +0000 | [diff] [blame] | 9759 | UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__FieldOptions__EditionDefault_msg_init); |
Protobuf Team Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 9760 | upb_Array* arr = upb_Message_GetMutableArray(UPB_UPCAST(msg), &field); |
Mike Kruskal | 4f9e417 | 2023-06-30 20:14:50 -0700 | [diff] [blame] | 9761 | if (arr) { |
Protobuf Team Bot | f73985a | 2023-12-19 00:14:19 +0000 | [diff] [blame] | 9762 | if (size) *size = arr->UPB_PRIVATE(size); |
Protobuf Team Bot | 81e5433 | 2024-01-11 21:04:07 +0000 | [diff] [blame] | 9763 | return (google_protobuf_FieldOptions_EditionDefault**)upb_Array_MutableDataPtr(arr); |
Mike Kruskal | 4f9e417 | 2023-06-30 20:14:50 -0700 | [diff] [blame] | 9764 | } else { |
| 9765 | if (size) *size = 0; |
| 9766 | return NULL; |
| 9767 | } |
| 9768 | } |
| 9769 | UPB_INLINE google_protobuf_FieldOptions_EditionDefault** google_protobuf_FieldOptions_resize_edition_defaults(google_protobuf_FieldOptions* msg, size_t size, upb_Arena* arena) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 9770 | 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 Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 9771 | return (google_protobuf_FieldOptions_EditionDefault**)upb_Message_ResizeArrayUninitialized(UPB_UPCAST(msg), |
| 9772 | &field, size, arena); |
Mike Kruskal | 4f9e417 | 2023-06-30 20:14:50 -0700 | [diff] [blame] | 9773 | } |
| 9774 | UPB_INLINE struct google_protobuf_FieldOptions_EditionDefault* google_protobuf_FieldOptions_add_edition_defaults(google_protobuf_FieldOptions* msg, upb_Arena* arena) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 9775 | 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 Bot | a9387b5 | 2024-06-12 15:17:52 +0000 | [diff] [blame] | 9776 | UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__FieldOptions__EditionDefault_msg_init); |
Protobuf Team Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 9777 | upb_Array* arr = upb_Message_GetOrCreateMutableArray( |
| 9778 | UPB_UPCAST(msg), &field, arena); |
Protobuf Team Bot | 81e5433 | 2024-01-11 21:04:07 +0000 | [diff] [blame] | 9779 | if (!arr || !UPB_PRIVATE(_upb_Array_ResizeUninitialized)( |
Protobuf Team Bot | f73985a | 2023-12-19 00:14:19 +0000 | [diff] [blame] | 9780 | arr, arr->UPB_PRIVATE(size) + 1, arena)) { |
Mike Kruskal | 4f9e417 | 2023-06-30 20:14:50 -0700 | [diff] [blame] | 9781 | return NULL; |
| 9782 | } |
Protobuf Team Bot | 4ffe086 | 2023-12-06 02:02:36 +0000 | [diff] [blame] | 9783 | struct google_protobuf_FieldOptions_EditionDefault* sub = (struct google_protobuf_FieldOptions_EditionDefault*)_upb_Message_New(&google__protobuf__FieldOptions__EditionDefault_msg_init, arena); |
Mike Kruskal | 4f9e417 | 2023-06-30 20:14:50 -0700 | [diff] [blame] | 9784 | if (!arr || !sub) return NULL; |
Protobuf Team Bot | f73985a | 2023-12-19 00:14:19 +0000 | [diff] [blame] | 9785 | UPB_PRIVATE(_upb_Array_Set) |
| 9786 | (arr, arr->UPB_PRIVATE(size) - 1, &sub, sizeof(sub)); |
Mike Kruskal | 4f9e417 | 2023-06-30 20:14:50 -0700 | [diff] [blame] | 9787 | return sub; |
| 9788 | } |
| 9789 | UPB_INLINE void google_protobuf_FieldOptions_set_features(google_protobuf_FieldOptions *msg, google_protobuf_FeatureSet* value) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 9790 | 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 Bot | a9387b5 | 2024-06-12 15:17:52 +0000 | [diff] [blame] | 9791 | UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__FeatureSet_msg_init); |
Protobuf Team Bot | ac32c97 | 2024-04-10 03:30:05 +0000 | [diff] [blame] | 9792 | upb_Message_SetBaseField((upb_Message *)msg, &field, &value); |
Mike Kruskal | 4f9e417 | 2023-06-30 20:14:50 -0700 | [diff] [blame] | 9793 | } |
| 9794 | UPB_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 Bot | 4ffe086 | 2023-12-06 02:02:36 +0000 | [diff] [blame] | 9797 | sub = (struct google_protobuf_FeatureSet*)_upb_Message_New(&google__protobuf__FeatureSet_msg_init, arena); |
Mike Kruskal | 4f9e417 | 2023-06-30 20:14:50 -0700 | [diff] [blame] | 9798 | if (sub) google_protobuf_FieldOptions_set_features(msg, sub); |
| 9799 | } |
| 9800 | return sub; |
| 9801 | } |
Protobuf Team Bot | 85edb7e | 2024-04-03 02:43:54 +0000 | [diff] [blame] | 9802 | UPB_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 Bot | a9387b5 | 2024-06-12 15:17:52 +0000 | [diff] [blame] | 9804 | UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__FieldOptions__FeatureSupport_msg_init); |
Protobuf Team Bot | ac32c97 | 2024-04-10 03:30:05 +0000 | [diff] [blame] | 9805 | upb_Message_SetBaseField((upb_Message *)msg, &field, &value); |
Protobuf Team Bot | 85edb7e | 2024-04-03 02:43:54 +0000 | [diff] [blame] | 9806 | } |
| 9807 | UPB_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 Kruskal | 232ecf4 | 2023-01-14 00:09:40 -0800 | [diff] [blame] | 9815 | UPB_INLINE google_protobuf_UninterpretedOption** google_protobuf_FieldOptions_mutable_uninterpreted_option(google_protobuf_FieldOptions* msg, size_t* size) { |
Protobuf Team Bot | 85edb7e | 2024-04-03 02:43:54 +0000 | [diff] [blame] | 9816 | 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 Bot | a9387b5 | 2024-06-12 15:17:52 +0000 | [diff] [blame] | 9817 | UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__UninterpretedOption_msg_init); |
Protobuf Team Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 9818 | upb_Array* arr = upb_Message_GetMutableArray(UPB_UPCAST(msg), &field); |
Eric Salo | b7d54ac | 2022-12-29 11:59:42 -0800 | [diff] [blame] | 9819 | if (arr) { |
Protobuf Team Bot | f73985a | 2023-12-19 00:14:19 +0000 | [diff] [blame] | 9820 | if (size) *size = arr->UPB_PRIVATE(size); |
Protobuf Team Bot | 81e5433 | 2024-01-11 21:04:07 +0000 | [diff] [blame] | 9821 | return (google_protobuf_UninterpretedOption**)upb_Array_MutableDataPtr(arr); |
Eric Salo | b7d54ac | 2022-12-29 11:59:42 -0800 | [diff] [blame] | 9822 | } else { |
| 9823 | if (size) *size = 0; |
| 9824 | return NULL; |
| 9825 | } |
Joshua Haberman | 9abf6e2 | 2021-01-13 12:16:25 -0800 | [diff] [blame] | 9826 | } |
Eric Salo | b7d54ac | 2022-12-29 11:59:42 -0800 | [diff] [blame] | 9827 | UPB_INLINE google_protobuf_UninterpretedOption** google_protobuf_FieldOptions_resize_uninterpreted_option(google_protobuf_FieldOptions* msg, size_t size, upb_Arena* arena) { |
Protobuf Team Bot | 85edb7e | 2024-04-03 02:43:54 +0000 | [diff] [blame] | 9828 | 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 Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 9829 | return (google_protobuf_UninterpretedOption**)upb_Message_ResizeArrayUninitialized(UPB_UPCAST(msg), |
| 9830 | &field, size, arena); |
Joshua Haberman | 7ecf43f | 2022-03-14 13:11:29 -0700 | [diff] [blame] | 9831 | } |
| 9832 | UPB_INLINE struct google_protobuf_UninterpretedOption* google_protobuf_FieldOptions_add_uninterpreted_option(google_protobuf_FieldOptions* msg, upb_Arena* arena) { |
Protobuf Team Bot | 85edb7e | 2024-04-03 02:43:54 +0000 | [diff] [blame] | 9833 | 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 Bot | a9387b5 | 2024-06-12 15:17:52 +0000 | [diff] [blame] | 9834 | UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__UninterpretedOption_msg_init); |
Protobuf Team Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 9835 | upb_Array* arr = upb_Message_GetOrCreateMutableArray( |
| 9836 | UPB_UPCAST(msg), &field, arena); |
Protobuf Team Bot | 81e5433 | 2024-01-11 21:04:07 +0000 | [diff] [blame] | 9837 | if (!arr || !UPB_PRIVATE(_upb_Array_ResizeUninitialized)( |
Protobuf Team Bot | f73985a | 2023-12-19 00:14:19 +0000 | [diff] [blame] | 9838 | arr, arr->UPB_PRIVATE(size) + 1, arena)) { |
Eric Salo | b7d54ac | 2022-12-29 11:59:42 -0800 | [diff] [blame] | 9839 | return NULL; |
| 9840 | } |
Protobuf Team Bot | 4ffe086 | 2023-12-06 02:02:36 +0000 | [diff] [blame] | 9841 | struct google_protobuf_UninterpretedOption* sub = (struct google_protobuf_UninterpretedOption*)_upb_Message_New(&google__protobuf__UninterpretedOption_msg_init, arena); |
Eric Salo | b7d54ac | 2022-12-29 11:59:42 -0800 | [diff] [blame] | 9842 | if (!arr || !sub) return NULL; |
Protobuf Team Bot | f73985a | 2023-12-19 00:14:19 +0000 | [diff] [blame] | 9843 | UPB_PRIVATE(_upb_Array_Set) |
| 9844 | (arr, arr->UPB_PRIVATE(size) - 1, &sub, sizeof(sub)); |
Joshua Haberman | 9abf6e2 | 2021-01-13 12:16:25 -0800 | [diff] [blame] | 9845 | return sub; |
| 9846 | } |
| 9847 | |
Mike Kruskal | 4f9e417 | 2023-06-30 20:14:50 -0700 | [diff] [blame] | 9848 | /* google.protobuf.FieldOptions.EditionDefault */ |
| 9849 | |
| 9850 | UPB_INLINE google_protobuf_FieldOptions_EditionDefault* google_protobuf_FieldOptions_EditionDefault_new(upb_Arena* arena) { |
Protobuf Team Bot | 4ffe086 | 2023-12-06 02:02:36 +0000 | [diff] [blame] | 9851 | return (google_protobuf_FieldOptions_EditionDefault*)_upb_Message_New(&google__protobuf__FieldOptions__EditionDefault_msg_init, arena); |
Mike Kruskal | 4f9e417 | 2023-06-30 20:14:50 -0700 | [diff] [blame] | 9852 | } |
| 9853 | UPB_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 Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 9856 | if (upb_Decode(buf, size, UPB_UPCAST(ret), &google__protobuf__FieldOptions__EditionDefault_msg_init, NULL, 0, arena) != |
| 9857 | kUpb_DecodeStatus_Ok) { |
Mike Kruskal | 4f9e417 | 2023-06-30 20:14:50 -0700 | [diff] [blame] | 9858 | return NULL; |
| 9859 | } |
| 9860 | return ret; |
| 9861 | } |
| 9862 | UPB_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 Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 9867 | if (upb_Decode(buf, size, UPB_UPCAST(ret), &google__protobuf__FieldOptions__EditionDefault_msg_init, extreg, options, |
| 9868 | arena) != kUpb_DecodeStatus_Ok) { |
Mike Kruskal | 4f9e417 | 2023-06-30 20:14:50 -0700 | [diff] [blame] | 9869 | return NULL; |
| 9870 | } |
| 9871 | return ret; |
| 9872 | } |
| 9873 | UPB_INLINE char* google_protobuf_FieldOptions_EditionDefault_serialize(const google_protobuf_FieldOptions_EditionDefault* msg, upb_Arena* arena, size_t* len) { |
| 9874 | char* ptr; |
Protobuf Team Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 9875 | (void)upb_Encode(UPB_UPCAST(msg), &google__protobuf__FieldOptions__EditionDefault_msg_init, 0, arena, &ptr, len); |
Mike Kruskal | 4f9e417 | 2023-06-30 20:14:50 -0700 | [diff] [blame] | 9876 | return ptr; |
| 9877 | } |
| 9878 | UPB_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 Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 9881 | (void)upb_Encode(UPB_UPCAST(msg), &google__protobuf__FieldOptions__EditionDefault_msg_init, options, arena, &ptr, len); |
Mike Kruskal | 4f9e417 | 2023-06-30 20:14:50 -0700 | [diff] [blame] | 9882 | return ptr; |
| 9883 | } |
Mike Kruskal | 4f9e417 | 2023-06-30 20:14:50 -0700 | [diff] [blame] | 9884 | UPB_INLINE void google_protobuf_FieldOptions_EditionDefault_clear_value(google_protobuf_FieldOptions_EditionDefault* msg) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 9885 | 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 Bot | 4e90ead | 2024-01-08 15:46:34 +0000 | [diff] [blame] | 9886 | upb_Message_ClearBaseField(UPB_UPCAST(msg), &field); |
Mike Kruskal | 4f9e417 | 2023-06-30 20:14:50 -0700 | [diff] [blame] | 9887 | } |
| 9888 | UPB_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 Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 9891 | 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 Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 9892 | _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field, |
| 9893 | &default_val, &ret); |
Mike Kruskal | 4f9e417 | 2023-06-30 20:14:50 -0700 | [diff] [blame] | 9894 | return ret; |
| 9895 | } |
| 9896 | UPB_INLINE bool google_protobuf_FieldOptions_EditionDefault_has_value(const google_protobuf_FieldOptions_EditionDefault* msg) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 9897 | 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 Bot | 8c1f635 | 2024-01-10 05:18:15 +0000 | [diff] [blame] | 9898 | return upb_Message_HasBaseField(UPB_UPCAST(msg), &field); |
Protobuf Team Bot | fa98bb3 | 2023-09-01 18:11:09 +0000 | [diff] [blame] | 9899 | } |
Protobuf Team Bot | ab58f8f | 2023-09-26 16:14:19 +0000 | [diff] [blame] | 9900 | UPB_INLINE void google_protobuf_FieldOptions_EditionDefault_clear_edition(google_protobuf_FieldOptions_EditionDefault* msg) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 9901 | const upb_MiniTableField field = {3, 12, 65, 0, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; |
Protobuf Team Bot | 4e90ead | 2024-01-08 15:46:34 +0000 | [diff] [blame] | 9902 | upb_Message_ClearBaseField(UPB_UPCAST(msg), &field); |
Protobuf Team Bot | fa98bb3 | 2023-09-01 18:11:09 +0000 | [diff] [blame] | 9903 | } |
Protobuf Team Bot | ab58f8f | 2023-09-26 16:14:19 +0000 | [diff] [blame] | 9904 | UPB_INLINE int32_t google_protobuf_FieldOptions_EditionDefault_edition(const google_protobuf_FieldOptions_EditionDefault* msg) { |
Protobuf Team Bot | fa98bb3 | 2023-09-01 18:11:09 +0000 | [diff] [blame] | 9905 | int32_t default_val = 0; |
| 9906 | int32_t ret; |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 9907 | const upb_MiniTableField field = {3, 12, 65, 0, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; |
Protobuf Team Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 9908 | _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field, |
| 9909 | &default_val, &ret); |
Protobuf Team Bot | fa98bb3 | 2023-09-01 18:11:09 +0000 | [diff] [blame] | 9910 | return ret; |
| 9911 | } |
Protobuf Team Bot | ab58f8f | 2023-09-26 16:14:19 +0000 | [diff] [blame] | 9912 | UPB_INLINE bool google_protobuf_FieldOptions_EditionDefault_has_edition(const google_protobuf_FieldOptions_EditionDefault* msg) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 9913 | const upb_MiniTableField field = {3, 12, 65, 0, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; |
Protobuf Team Bot | 8c1f635 | 2024-01-10 05:18:15 +0000 | [diff] [blame] | 9914 | return upb_Message_HasBaseField(UPB_UPCAST(msg), &field); |
Mike Kruskal | 4f9e417 | 2023-06-30 20:14:50 -0700 | [diff] [blame] | 9915 | } |
| 9916 | |
Mike Kruskal | 4f9e417 | 2023-06-30 20:14:50 -0700 | [diff] [blame] | 9917 | UPB_INLINE void google_protobuf_FieldOptions_EditionDefault_set_value(google_protobuf_FieldOptions_EditionDefault *msg, upb_StringView value) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 9918 | 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 Bot | ac32c97 | 2024-04-10 03:30:05 +0000 | [diff] [blame] | 9919 | upb_Message_SetBaseField((upb_Message *)msg, &field, &value); |
Protobuf Team Bot | fa98bb3 | 2023-09-01 18:11:09 +0000 | [diff] [blame] | 9920 | } |
Protobuf Team Bot | ab58f8f | 2023-09-26 16:14:19 +0000 | [diff] [blame] | 9921 | UPB_INLINE void google_protobuf_FieldOptions_EditionDefault_set_edition(google_protobuf_FieldOptions_EditionDefault *msg, int32_t value) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 9922 | const upb_MiniTableField field = {3, 12, 65, 0, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; |
Protobuf Team Bot | ac32c97 | 2024-04-10 03:30:05 +0000 | [diff] [blame] | 9923 | upb_Message_SetBaseField((upb_Message *)msg, &field, &value); |
Mike Kruskal | 4f9e417 | 2023-06-30 20:14:50 -0700 | [diff] [blame] | 9924 | } |
| 9925 | |
Protobuf Team Bot | 85edb7e | 2024-04-03 02:43:54 +0000 | [diff] [blame] | 9926 | /* google.protobuf.FieldOptions.FeatureSupport */ |
| 9927 | |
| 9928 | UPB_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 | } |
| 9931 | UPB_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 | } |
| 9940 | UPB_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 | } |
| 9951 | UPB_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 | } |
| 9956 | UPB_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 | } |
| 9962 | UPB_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 | } |
| 9966 | UPB_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 | } |
| 9974 | UPB_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 | } |
| 9978 | UPB_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 | } |
| 9982 | UPB_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 | } |
| 9990 | UPB_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 | } |
| 9994 | UPB_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 | } |
| 9998 | UPB_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 | } |
| 10006 | UPB_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 | } |
| 10010 | UPB_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 | } |
| 10014 | UPB_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 | } |
| 10022 | UPB_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 | |
| 10027 | UPB_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 Bot | ac32c97 | 2024-04-10 03:30:05 +0000 | [diff] [blame] | 10029 | upb_Message_SetBaseField((upb_Message *)msg, &field, &value); |
Protobuf Team Bot | 85edb7e | 2024-04-03 02:43:54 +0000 | [diff] [blame] | 10030 | } |
| 10031 | UPB_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 Bot | ac32c97 | 2024-04-10 03:30:05 +0000 | [diff] [blame] | 10033 | upb_Message_SetBaseField((upb_Message *)msg, &field, &value); |
Protobuf Team Bot | 85edb7e | 2024-04-03 02:43:54 +0000 | [diff] [blame] | 10034 | } |
| 10035 | UPB_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 Bot | ac32c97 | 2024-04-10 03:30:05 +0000 | [diff] [blame] | 10037 | upb_Message_SetBaseField((upb_Message *)msg, &field, &value); |
Protobuf Team Bot | 85edb7e | 2024-04-03 02:43:54 +0000 | [diff] [blame] | 10038 | } |
| 10039 | UPB_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 Bot | ac32c97 | 2024-04-10 03:30:05 +0000 | [diff] [blame] | 10041 | upb_Message_SetBaseField((upb_Message *)msg, &field, &value); |
Protobuf Team Bot | 85edb7e | 2024-04-03 02:43:54 +0000 | [diff] [blame] | 10042 | } |
| 10043 | |
Joshua Haberman | 9abf6e2 | 2021-01-13 12:16:25 -0800 | [diff] [blame] | 10044 | /* google.protobuf.OneofOptions */ |
| 10045 | |
Joshua Haberman | f41049a | 2022-01-21 14:41:25 -0800 | [diff] [blame] | 10046 | UPB_INLINE google_protobuf_OneofOptions* google_protobuf_OneofOptions_new(upb_Arena* arena) { |
Protobuf Team Bot | 4ffe086 | 2023-12-06 02:02:36 +0000 | [diff] [blame] | 10047 | return (google_protobuf_OneofOptions*)_upb_Message_New(&google__protobuf__OneofOptions_msg_init, arena); |
Joshua Haberman | 9abf6e2 | 2021-01-13 12:16:25 -0800 | [diff] [blame] | 10048 | } |
Joshua Haberman | f41049a | 2022-01-21 14:41:25 -0800 | [diff] [blame] | 10049 | UPB_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 Haberman | 9d578a3 | 2021-08-02 15:32:01 -0700 | [diff] [blame] | 10051 | if (!ret) return NULL; |
Protobuf Team Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 10052 | if (upb_Decode(buf, size, UPB_UPCAST(ret), &google__protobuf__OneofOptions_msg_init, NULL, 0, arena) != |
| 10053 | kUpb_DecodeStatus_Ok) { |
Joshua Haberman | 9d578a3 | 2021-08-02 15:32:01 -0700 | [diff] [blame] | 10054 | return NULL; |
| 10055 | } |
| 10056 | return ret; |
Joshua Haberman | 9abf6e2 | 2021-01-13 12:16:25 -0800 | [diff] [blame] | 10057 | } |
Joshua Haberman | f41049a | 2022-01-21 14:41:25 -0800 | [diff] [blame] | 10058 | UPB_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 Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 10063 | if (upb_Decode(buf, size, UPB_UPCAST(ret), &google__protobuf__OneofOptions_msg_init, extreg, options, |
| 10064 | arena) != kUpb_DecodeStatus_Ok) { |
Joshua Haberman | f41049a | 2022-01-21 14:41:25 -0800 | [diff] [blame] | 10065 | return NULL; |
| 10066 | } |
| 10067 | return ret; |
Joshua Haberman | 9abf6e2 | 2021-01-13 12:16:25 -0800 | [diff] [blame] | 10068 | } |
Joshua Haberman | f41049a | 2022-01-21 14:41:25 -0800 | [diff] [blame] | 10069 | UPB_INLINE char* google_protobuf_OneofOptions_serialize(const google_protobuf_OneofOptions* msg, upb_Arena* arena, size_t* len) { |
Joshua Haberman | d3995ec | 2022-09-30 16:54:39 -0700 | [diff] [blame] | 10070 | char* ptr; |
Protobuf Team Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 10071 | (void)upb_Encode(UPB_UPCAST(msg), &google__protobuf__OneofOptions_msg_init, 0, arena, &ptr, len); |
Joshua Haberman | d3995ec | 2022-09-30 16:54:39 -0700 | [diff] [blame] | 10072 | return ptr; |
Joshua Haberman | f41049a | 2022-01-21 14:41:25 -0800 | [diff] [blame] | 10073 | } |
| 10074 | UPB_INLINE char* google_protobuf_OneofOptions_serialize_ex(const google_protobuf_OneofOptions* msg, int options, |
| 10075 | upb_Arena* arena, size_t* len) { |
Joshua Haberman | d3995ec | 2022-09-30 16:54:39 -0700 | [diff] [blame] | 10076 | char* ptr; |
Protobuf Team Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 10077 | (void)upb_Encode(UPB_UPCAST(msg), &google__protobuf__OneofOptions_msg_init, options, arena, &ptr, len); |
Joshua Haberman | d3995ec | 2022-09-30 16:54:39 -0700 | [diff] [blame] | 10078 | return ptr; |
Joshua Haberman | f41049a | 2022-01-21 14:41:25 -0800 | [diff] [blame] | 10079 | } |
Mike Kruskal | 4f9e417 | 2023-06-30 20:14:50 -0700 | [diff] [blame] | 10080 | UPB_INLINE void google_protobuf_OneofOptions_clear_features(google_protobuf_OneofOptions* msg) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 10081 | 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 Bot | 4e90ead | 2024-01-08 15:46:34 +0000 | [diff] [blame] | 10082 | upb_Message_ClearBaseField(UPB_UPCAST(msg), &field); |
Mike Kruskal | 4f9e417 | 2023-06-30 20:14:50 -0700 | [diff] [blame] | 10083 | } |
| 10084 | UPB_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 Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 10087 | 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 Bot | a9387b5 | 2024-06-12 15:17:52 +0000 | [diff] [blame] | 10088 | UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__FeatureSet_msg_init); |
Protobuf Team Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 10089 | _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field, |
| 10090 | &default_val, &ret); |
Mike Kruskal | 4f9e417 | 2023-06-30 20:14:50 -0700 | [diff] [blame] | 10091 | return ret; |
| 10092 | } |
| 10093 | UPB_INLINE bool google_protobuf_OneofOptions_has_features(const google_protobuf_OneofOptions* msg) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 10094 | 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 Bot | 8c1f635 | 2024-01-10 05:18:15 +0000 | [diff] [blame] | 10095 | return upb_Message_HasBaseField(UPB_UPCAST(msg), &field); |
Mike Kruskal | 4f9e417 | 2023-06-30 20:14:50 -0700 | [diff] [blame] | 10096 | } |
Mike Kruskal | 3bc5049 | 2022-12-01 13:34:12 -0800 | [diff] [blame] | 10097 | UPB_INLINE void google_protobuf_OneofOptions_clear_uninterpreted_option(google_protobuf_OneofOptions* msg) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 10098 | 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 Bot | 4e90ead | 2024-01-08 15:46:34 +0000 | [diff] [blame] | 10099 | upb_Message_ClearBaseField(UPB_UPCAST(msg), &field); |
Joshua Haberman | d3995ec | 2022-09-30 16:54:39 -0700 | [diff] [blame] | 10100 | } |
Eric Salo | b7d54ac | 2022-12-29 11:59:42 -0800 | [diff] [blame] | 10101 | UPB_INLINE const google_protobuf_UninterpretedOption* const* google_protobuf_OneofOptions_uninterpreted_option(const google_protobuf_OneofOptions* msg, size_t* size) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 10102 | 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 Bot | a9387b5 | 2024-06-12 15:17:52 +0000 | [diff] [blame] | 10103 | UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__UninterpretedOption_msg_init); |
Protobuf Team Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 10104 | const upb_Array* arr = upb_Message_GetArray(UPB_UPCAST(msg), &field); |
Eric Salo | b7d54ac | 2022-12-29 11:59:42 -0800 | [diff] [blame] | 10105 | if (arr) { |
Protobuf Team Bot | f73985a | 2023-12-19 00:14:19 +0000 | [diff] [blame] | 10106 | if (size) *size = arr->UPB_PRIVATE(size); |
Protobuf Team Bot | 81e5433 | 2024-01-11 21:04:07 +0000 | [diff] [blame] | 10107 | return (const google_protobuf_UninterpretedOption* const*)upb_Array_DataPtr(arr); |
Eric Salo | b7d54ac | 2022-12-29 11:59:42 -0800 | [diff] [blame] | 10108 | } else { |
| 10109 | if (size) *size = 0; |
| 10110 | return NULL; |
| 10111 | } |
Joshua Haberman | 7ecf43f | 2022-03-14 13:11:29 -0700 | [diff] [blame] | 10112 | } |
Deanna Garcia | b26afb5 | 2023-04-25 13:37:18 -0700 | [diff] [blame] | 10113 | UPB_INLINE const upb_Array* _google_protobuf_OneofOptions_uninterpreted_option_upb_array(const google_protobuf_OneofOptions* msg, size_t* size) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 10114 | 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 Bot | a9387b5 | 2024-06-12 15:17:52 +0000 | [diff] [blame] | 10115 | UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__UninterpretedOption_msg_init); |
Protobuf Team Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 10116 | const upb_Array* arr = upb_Message_GetArray(UPB_UPCAST(msg), &field); |
Deanna Garcia | b26afb5 | 2023-04-25 13:37:18 -0700 | [diff] [blame] | 10117 | if (size) { |
Protobuf Team Bot | f73985a | 2023-12-19 00:14:19 +0000 | [diff] [blame] | 10118 | *size = arr ? arr->UPB_PRIVATE(size) : 0; |
Deanna Garcia | b26afb5 | 2023-04-25 13:37:18 -0700 | [diff] [blame] | 10119 | } |
| 10120 | return arr; |
| 10121 | } |
Protobuf Team Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 10122 | UPB_INLINE upb_Array* _google_protobuf_OneofOptions_uninterpreted_option_mutable_upb_array(google_protobuf_OneofOptions* msg, size_t* size, upb_Arena* arena) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 10123 | 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 Bot | a9387b5 | 2024-06-12 15:17:52 +0000 | [diff] [blame] | 10124 | UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__UninterpretedOption_msg_init); |
Protobuf Team Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 10125 | upb_Array* arr = upb_Message_GetOrCreateMutableArray(UPB_UPCAST(msg), |
| 10126 | &field, arena); |
Deanna Garcia | b26afb5 | 2023-04-25 13:37:18 -0700 | [diff] [blame] | 10127 | if (size) { |
Protobuf Team Bot | f73985a | 2023-12-19 00:14:19 +0000 | [diff] [blame] | 10128 | *size = arr ? arr->UPB_PRIVATE(size) : 0; |
Deanna Garcia | b26afb5 | 2023-04-25 13:37:18 -0700 | [diff] [blame] | 10129 | } |
| 10130 | return arr; |
| 10131 | } |
Joshua Haberman | 9abf6e2 | 2021-01-13 12:16:25 -0800 | [diff] [blame] | 10132 | |
Mike Kruskal | 4f9e417 | 2023-06-30 20:14:50 -0700 | [diff] [blame] | 10133 | UPB_INLINE void google_protobuf_OneofOptions_set_features(google_protobuf_OneofOptions *msg, google_protobuf_FeatureSet* value) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 10134 | 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 Bot | a9387b5 | 2024-06-12 15:17:52 +0000 | [diff] [blame] | 10135 | UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__FeatureSet_msg_init); |
Protobuf Team Bot | ac32c97 | 2024-04-10 03:30:05 +0000 | [diff] [blame] | 10136 | upb_Message_SetBaseField((upb_Message *)msg, &field, &value); |
Mike Kruskal | 4f9e417 | 2023-06-30 20:14:50 -0700 | [diff] [blame] | 10137 | } |
| 10138 | UPB_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 Bot | 4ffe086 | 2023-12-06 02:02:36 +0000 | [diff] [blame] | 10141 | sub = (struct google_protobuf_FeatureSet*)_upb_Message_New(&google__protobuf__FeatureSet_msg_init, arena); |
Mike Kruskal | 4f9e417 | 2023-06-30 20:14:50 -0700 | [diff] [blame] | 10142 | if (sub) google_protobuf_OneofOptions_set_features(msg, sub); |
| 10143 | } |
| 10144 | return sub; |
| 10145 | } |
Eric Salo | b7d54ac | 2022-12-29 11:59:42 -0800 | [diff] [blame] | 10146 | UPB_INLINE google_protobuf_UninterpretedOption** google_protobuf_OneofOptions_mutable_uninterpreted_option(google_protobuf_OneofOptions* msg, size_t* size) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 10147 | 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 Bot | a9387b5 | 2024-06-12 15:17:52 +0000 | [diff] [blame] | 10148 | UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__UninterpretedOption_msg_init); |
Protobuf Team Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 10149 | upb_Array* arr = upb_Message_GetMutableArray(UPB_UPCAST(msg), &field); |
Eric Salo | b7d54ac | 2022-12-29 11:59:42 -0800 | [diff] [blame] | 10150 | if (arr) { |
Protobuf Team Bot | f73985a | 2023-12-19 00:14:19 +0000 | [diff] [blame] | 10151 | if (size) *size = arr->UPB_PRIVATE(size); |
Protobuf Team Bot | 81e5433 | 2024-01-11 21:04:07 +0000 | [diff] [blame] | 10152 | return (google_protobuf_UninterpretedOption**)upb_Array_MutableDataPtr(arr); |
Eric Salo | b7d54ac | 2022-12-29 11:59:42 -0800 | [diff] [blame] | 10153 | } else { |
| 10154 | if (size) *size = 0; |
| 10155 | return NULL; |
| 10156 | } |
Joshua Haberman | 9abf6e2 | 2021-01-13 12:16:25 -0800 | [diff] [blame] | 10157 | } |
Eric Salo | b7d54ac | 2022-12-29 11:59:42 -0800 | [diff] [blame] | 10158 | UPB_INLINE google_protobuf_UninterpretedOption** google_protobuf_OneofOptions_resize_uninterpreted_option(google_protobuf_OneofOptions* msg, size_t size, upb_Arena* arena) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 10159 | 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 Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 10160 | return (google_protobuf_UninterpretedOption**)upb_Message_ResizeArrayUninitialized(UPB_UPCAST(msg), |
| 10161 | &field, size, arena); |
Joshua Haberman | 9abf6e2 | 2021-01-13 12:16:25 -0800 | [diff] [blame] | 10162 | } |
Joshua Haberman | 7ecf43f | 2022-03-14 13:11:29 -0700 | [diff] [blame] | 10163 | UPB_INLINE struct google_protobuf_UninterpretedOption* google_protobuf_OneofOptions_add_uninterpreted_option(google_protobuf_OneofOptions* msg, upb_Arena* arena) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 10164 | 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 Bot | a9387b5 | 2024-06-12 15:17:52 +0000 | [diff] [blame] | 10165 | UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__UninterpretedOption_msg_init); |
Protobuf Team Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 10166 | upb_Array* arr = upb_Message_GetOrCreateMutableArray( |
| 10167 | UPB_UPCAST(msg), &field, arena); |
Protobuf Team Bot | 81e5433 | 2024-01-11 21:04:07 +0000 | [diff] [blame] | 10168 | if (!arr || !UPB_PRIVATE(_upb_Array_ResizeUninitialized)( |
Protobuf Team Bot | f73985a | 2023-12-19 00:14:19 +0000 | [diff] [blame] | 10169 | arr, arr->UPB_PRIVATE(size) + 1, arena)) { |
Eric Salo | b7d54ac | 2022-12-29 11:59:42 -0800 | [diff] [blame] | 10170 | return NULL; |
| 10171 | } |
Protobuf Team Bot | 4ffe086 | 2023-12-06 02:02:36 +0000 | [diff] [blame] | 10172 | struct google_protobuf_UninterpretedOption* sub = (struct google_protobuf_UninterpretedOption*)_upb_Message_New(&google__protobuf__UninterpretedOption_msg_init, arena); |
Eric Salo | b7d54ac | 2022-12-29 11:59:42 -0800 | [diff] [blame] | 10173 | if (!arr || !sub) return NULL; |
Protobuf Team Bot | f73985a | 2023-12-19 00:14:19 +0000 | [diff] [blame] | 10174 | UPB_PRIVATE(_upb_Array_Set) |
| 10175 | (arr, arr->UPB_PRIVATE(size) - 1, &sub, sizeof(sub)); |
Joshua Haberman | 9abf6e2 | 2021-01-13 12:16:25 -0800 | [diff] [blame] | 10176 | return sub; |
| 10177 | } |
| 10178 | |
| 10179 | /* google.protobuf.EnumOptions */ |
| 10180 | |
Joshua Haberman | f41049a | 2022-01-21 14:41:25 -0800 | [diff] [blame] | 10181 | UPB_INLINE google_protobuf_EnumOptions* google_protobuf_EnumOptions_new(upb_Arena* arena) { |
Protobuf Team Bot | 4ffe086 | 2023-12-06 02:02:36 +0000 | [diff] [blame] | 10182 | return (google_protobuf_EnumOptions*)_upb_Message_New(&google__protobuf__EnumOptions_msg_init, arena); |
Joshua Haberman | 9abf6e2 | 2021-01-13 12:16:25 -0800 | [diff] [blame] | 10183 | } |
Joshua Haberman | f41049a | 2022-01-21 14:41:25 -0800 | [diff] [blame] | 10184 | UPB_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 Haberman | 9d578a3 | 2021-08-02 15:32:01 -0700 | [diff] [blame] | 10186 | if (!ret) return NULL; |
Protobuf Team Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 10187 | if (upb_Decode(buf, size, UPB_UPCAST(ret), &google__protobuf__EnumOptions_msg_init, NULL, 0, arena) != |
| 10188 | kUpb_DecodeStatus_Ok) { |
Joshua Haberman | 9d578a3 | 2021-08-02 15:32:01 -0700 | [diff] [blame] | 10189 | return NULL; |
| 10190 | } |
| 10191 | return ret; |
Joshua Haberman | 9abf6e2 | 2021-01-13 12:16:25 -0800 | [diff] [blame] | 10192 | } |
Joshua Haberman | f41049a | 2022-01-21 14:41:25 -0800 | [diff] [blame] | 10193 | UPB_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 Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 10198 | if (upb_Decode(buf, size, UPB_UPCAST(ret), &google__protobuf__EnumOptions_msg_init, extreg, options, |
| 10199 | arena) != kUpb_DecodeStatus_Ok) { |
Joshua Haberman | f41049a | 2022-01-21 14:41:25 -0800 | [diff] [blame] | 10200 | return NULL; |
| 10201 | } |
| 10202 | return ret; |
Joshua Haberman | 9abf6e2 | 2021-01-13 12:16:25 -0800 | [diff] [blame] | 10203 | } |
Joshua Haberman | f41049a | 2022-01-21 14:41:25 -0800 | [diff] [blame] | 10204 | UPB_INLINE char* google_protobuf_EnumOptions_serialize(const google_protobuf_EnumOptions* msg, upb_Arena* arena, size_t* len) { |
Joshua Haberman | d3995ec | 2022-09-30 16:54:39 -0700 | [diff] [blame] | 10205 | char* ptr; |
Protobuf Team Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 10206 | (void)upb_Encode(UPB_UPCAST(msg), &google__protobuf__EnumOptions_msg_init, 0, arena, &ptr, len); |
Joshua Haberman | d3995ec | 2022-09-30 16:54:39 -0700 | [diff] [blame] | 10207 | return ptr; |
Joshua Haberman | f41049a | 2022-01-21 14:41:25 -0800 | [diff] [blame] | 10208 | } |
| 10209 | UPB_INLINE char* google_protobuf_EnumOptions_serialize_ex(const google_protobuf_EnumOptions* msg, int options, |
| 10210 | upb_Arena* arena, size_t* len) { |
Joshua Haberman | d3995ec | 2022-09-30 16:54:39 -0700 | [diff] [blame] | 10211 | char* ptr; |
Protobuf Team Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 10212 | (void)upb_Encode(UPB_UPCAST(msg), &google__protobuf__EnumOptions_msg_init, options, arena, &ptr, len); |
Joshua Haberman | d3995ec | 2022-09-30 16:54:39 -0700 | [diff] [blame] | 10213 | return ptr; |
Joshua Haberman | f41049a | 2022-01-21 14:41:25 -0800 | [diff] [blame] | 10214 | } |
Mike Kruskal | 3bc5049 | 2022-12-01 13:34:12 -0800 | [diff] [blame] | 10215 | UPB_INLINE void google_protobuf_EnumOptions_clear_allow_alias(google_protobuf_EnumOptions* msg) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 10216 | const upb_MiniTableField field = {2, 9, 64, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; |
Protobuf Team Bot | 4e90ead | 2024-01-08 15:46:34 +0000 | [diff] [blame] | 10217 | upb_Message_ClearBaseField(UPB_UPCAST(msg), &field); |
Joshua Haberman | d3995ec | 2022-09-30 16:54:39 -0700 | [diff] [blame] | 10218 | } |
Joshua Haberman | f41049a | 2022-01-21 14:41:25 -0800 | [diff] [blame] | 10219 | UPB_INLINE bool google_protobuf_EnumOptions_allow_alias(const google_protobuf_EnumOptions* msg) { |
Eric Salo | 8809a11 | 2022-11-21 13:01:06 -0800 | [diff] [blame] | 10220 | bool default_val = false; |
| 10221 | bool ret; |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 10222 | const upb_MiniTableField field = {2, 9, 64, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; |
Protobuf Team Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 10223 | _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field, |
| 10224 | &default_val, &ret); |
Eric Salo | 8809a11 | 2022-11-21 13:01:06 -0800 | [diff] [blame] | 10225 | return ret; |
Joshua Haberman | f41049a | 2022-01-21 14:41:25 -0800 | [diff] [blame] | 10226 | } |
Mike Kruskal | 3bc5049 | 2022-12-01 13:34:12 -0800 | [diff] [blame] | 10227 | UPB_INLINE bool google_protobuf_EnumOptions_has_allow_alias(const google_protobuf_EnumOptions* msg) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 10228 | const upb_MiniTableField field = {2, 9, 64, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; |
Protobuf Team Bot | 8c1f635 | 2024-01-10 05:18:15 +0000 | [diff] [blame] | 10229 | return upb_Message_HasBaseField(UPB_UPCAST(msg), &field); |
Joshua Haberman | 7ecf43f | 2022-03-14 13:11:29 -0700 | [diff] [blame] | 10230 | } |
Mike Kruskal | 3bc5049 | 2022-12-01 13:34:12 -0800 | [diff] [blame] | 10231 | UPB_INLINE void google_protobuf_EnumOptions_clear_deprecated(google_protobuf_EnumOptions* msg) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 10232 | const upb_MiniTableField field = {3, 10, 65, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; |
Protobuf Team Bot | 4e90ead | 2024-01-08 15:46:34 +0000 | [diff] [blame] | 10233 | upb_Message_ClearBaseField(UPB_UPCAST(msg), &field); |
Joshua Haberman | d3995ec | 2022-09-30 16:54:39 -0700 | [diff] [blame] | 10234 | } |
Joshua Haberman | f41049a | 2022-01-21 14:41:25 -0800 | [diff] [blame] | 10235 | UPB_INLINE bool google_protobuf_EnumOptions_deprecated(const google_protobuf_EnumOptions* msg) { |
Eric Salo | 8809a11 | 2022-11-21 13:01:06 -0800 | [diff] [blame] | 10236 | bool default_val = false; |
| 10237 | bool ret; |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 10238 | const upb_MiniTableField field = {3, 10, 65, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; |
Protobuf Team Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 10239 | _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field, |
| 10240 | &default_val, &ret); |
Eric Salo | 8809a11 | 2022-11-21 13:01:06 -0800 | [diff] [blame] | 10241 | return ret; |
Joshua Haberman | f41049a | 2022-01-21 14:41:25 -0800 | [diff] [blame] | 10242 | } |
Mike Kruskal | 3bc5049 | 2022-12-01 13:34:12 -0800 | [diff] [blame] | 10243 | UPB_INLINE bool google_protobuf_EnumOptions_has_deprecated(const google_protobuf_EnumOptions* msg) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 10244 | const upb_MiniTableField field = {3, 10, 65, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; |
Protobuf Team Bot | 8c1f635 | 2024-01-10 05:18:15 +0000 | [diff] [blame] | 10245 | return upb_Message_HasBaseField(UPB_UPCAST(msg), &field); |
Joshua Haberman | 7ecf43f | 2022-03-14 13:11:29 -0700 | [diff] [blame] | 10246 | } |
Mike Kruskal | 6b87d6f | 2022-12-14 10:36:53 -0800 | [diff] [blame] | 10247 | UPB_INLINE void google_protobuf_EnumOptions_clear_deprecated_legacy_json_field_conflicts(google_protobuf_EnumOptions* msg) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 10248 | const upb_MiniTableField field = {6, 11, 66, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; |
Protobuf Team Bot | 4e90ead | 2024-01-08 15:46:34 +0000 | [diff] [blame] | 10249 | upb_Message_ClearBaseField(UPB_UPCAST(msg), &field); |
Mike Kruskal | 6b87d6f | 2022-12-14 10:36:53 -0800 | [diff] [blame] | 10250 | } |
| 10251 | UPB_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 Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 10254 | const upb_MiniTableField field = {6, 11, 66, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; |
Protobuf Team Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 10255 | _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field, |
| 10256 | &default_val, &ret); |
Mike Kruskal | 6b87d6f | 2022-12-14 10:36:53 -0800 | [diff] [blame] | 10257 | return ret; |
| 10258 | } |
| 10259 | UPB_INLINE bool google_protobuf_EnumOptions_has_deprecated_legacy_json_field_conflicts(const google_protobuf_EnumOptions* msg) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 10260 | const upb_MiniTableField field = {6, 11, 66, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; |
Protobuf Team Bot | 8c1f635 | 2024-01-10 05:18:15 +0000 | [diff] [blame] | 10261 | return upb_Message_HasBaseField(UPB_UPCAST(msg), &field); |
Mike Kruskal | 6b87d6f | 2022-12-14 10:36:53 -0800 | [diff] [blame] | 10262 | } |
Mike Kruskal | 4f9e417 | 2023-06-30 20:14:50 -0700 | [diff] [blame] | 10263 | UPB_INLINE void google_protobuf_EnumOptions_clear_features(google_protobuf_EnumOptions* msg) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 10264 | 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 Bot | 4e90ead | 2024-01-08 15:46:34 +0000 | [diff] [blame] | 10265 | upb_Message_ClearBaseField(UPB_UPCAST(msg), &field); |
Mike Kruskal | 4f9e417 | 2023-06-30 20:14:50 -0700 | [diff] [blame] | 10266 | } |
| 10267 | UPB_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 Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 10270 | 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 Bot | a9387b5 | 2024-06-12 15:17:52 +0000 | [diff] [blame] | 10271 | UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__FeatureSet_msg_init); |
Protobuf Team Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 10272 | _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field, |
| 10273 | &default_val, &ret); |
Mike Kruskal | 4f9e417 | 2023-06-30 20:14:50 -0700 | [diff] [blame] | 10274 | return ret; |
| 10275 | } |
| 10276 | UPB_INLINE bool google_protobuf_EnumOptions_has_features(const google_protobuf_EnumOptions* msg) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 10277 | 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 Bot | 8c1f635 | 2024-01-10 05:18:15 +0000 | [diff] [blame] | 10278 | return upb_Message_HasBaseField(UPB_UPCAST(msg), &field); |
Mike Kruskal | 4f9e417 | 2023-06-30 20:14:50 -0700 | [diff] [blame] | 10279 | } |
Mike Kruskal | 3bc5049 | 2022-12-01 13:34:12 -0800 | [diff] [blame] | 10280 | UPB_INLINE void google_protobuf_EnumOptions_clear_uninterpreted_option(google_protobuf_EnumOptions* msg) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 10281 | 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 Bot | 4e90ead | 2024-01-08 15:46:34 +0000 | [diff] [blame] | 10282 | upb_Message_ClearBaseField(UPB_UPCAST(msg), &field); |
Joshua Haberman | d3995ec | 2022-09-30 16:54:39 -0700 | [diff] [blame] | 10283 | } |
Eric Salo | b7d54ac | 2022-12-29 11:59:42 -0800 | [diff] [blame] | 10284 | UPB_INLINE const google_protobuf_UninterpretedOption* const* google_protobuf_EnumOptions_uninterpreted_option(const google_protobuf_EnumOptions* msg, size_t* size) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 10285 | 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 Bot | a9387b5 | 2024-06-12 15:17:52 +0000 | [diff] [blame] | 10286 | UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__UninterpretedOption_msg_init); |
Protobuf Team Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 10287 | const upb_Array* arr = upb_Message_GetArray(UPB_UPCAST(msg), &field); |
Eric Salo | b7d54ac | 2022-12-29 11:59:42 -0800 | [diff] [blame] | 10288 | if (arr) { |
Protobuf Team Bot | f73985a | 2023-12-19 00:14:19 +0000 | [diff] [blame] | 10289 | if (size) *size = arr->UPB_PRIVATE(size); |
Protobuf Team Bot | 81e5433 | 2024-01-11 21:04:07 +0000 | [diff] [blame] | 10290 | return (const google_protobuf_UninterpretedOption* const*)upb_Array_DataPtr(arr); |
Eric Salo | b7d54ac | 2022-12-29 11:59:42 -0800 | [diff] [blame] | 10291 | } else { |
| 10292 | if (size) *size = 0; |
| 10293 | return NULL; |
| 10294 | } |
Joshua Haberman | 7ecf43f | 2022-03-14 13:11:29 -0700 | [diff] [blame] | 10295 | } |
Deanna Garcia | b26afb5 | 2023-04-25 13:37:18 -0700 | [diff] [blame] | 10296 | UPB_INLINE const upb_Array* _google_protobuf_EnumOptions_uninterpreted_option_upb_array(const google_protobuf_EnumOptions* msg, size_t* size) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 10297 | 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 Bot | a9387b5 | 2024-06-12 15:17:52 +0000 | [diff] [blame] | 10298 | UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__UninterpretedOption_msg_init); |
Protobuf Team Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 10299 | const upb_Array* arr = upb_Message_GetArray(UPB_UPCAST(msg), &field); |
Deanna Garcia | b26afb5 | 2023-04-25 13:37:18 -0700 | [diff] [blame] | 10300 | if (size) { |
Protobuf Team Bot | f73985a | 2023-12-19 00:14:19 +0000 | [diff] [blame] | 10301 | *size = arr ? arr->UPB_PRIVATE(size) : 0; |
Deanna Garcia | b26afb5 | 2023-04-25 13:37:18 -0700 | [diff] [blame] | 10302 | } |
| 10303 | return arr; |
| 10304 | } |
Protobuf Team Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 10305 | UPB_INLINE upb_Array* _google_protobuf_EnumOptions_uninterpreted_option_mutable_upb_array(google_protobuf_EnumOptions* msg, size_t* size, upb_Arena* arena) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 10306 | 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 Bot | a9387b5 | 2024-06-12 15:17:52 +0000 | [diff] [blame] | 10307 | UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__UninterpretedOption_msg_init); |
Protobuf Team Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 10308 | upb_Array* arr = upb_Message_GetOrCreateMutableArray(UPB_UPCAST(msg), |
| 10309 | &field, arena); |
Deanna Garcia | b26afb5 | 2023-04-25 13:37:18 -0700 | [diff] [blame] | 10310 | if (size) { |
Protobuf Team Bot | f73985a | 2023-12-19 00:14:19 +0000 | [diff] [blame] | 10311 | *size = arr ? arr->UPB_PRIVATE(size) : 0; |
Deanna Garcia | b26afb5 | 2023-04-25 13:37:18 -0700 | [diff] [blame] | 10312 | } |
| 10313 | return arr; |
| 10314 | } |
Joshua Haberman | 9abf6e2 | 2021-01-13 12:16:25 -0800 | [diff] [blame] | 10315 | |
| 10316 | UPB_INLINE void google_protobuf_EnumOptions_set_allow_alias(google_protobuf_EnumOptions *msg, bool value) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 10317 | const upb_MiniTableField field = {2, 9, 64, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; |
Protobuf Team Bot | ac32c97 | 2024-04-10 03:30:05 +0000 | [diff] [blame] | 10318 | upb_Message_SetBaseField((upb_Message *)msg, &field, &value); |
Mike Kruskal | 232ecf4 | 2023-01-14 00:09:40 -0800 | [diff] [blame] | 10319 | } |
| 10320 | UPB_INLINE void google_protobuf_EnumOptions_set_deprecated(google_protobuf_EnumOptions *msg, bool value) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 10321 | const upb_MiniTableField field = {3, 10, 65, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; |
Protobuf Team Bot | ac32c97 | 2024-04-10 03:30:05 +0000 | [diff] [blame] | 10322 | upb_Message_SetBaseField((upb_Message *)msg, &field, &value); |
Mike Kruskal | 232ecf4 | 2023-01-14 00:09:40 -0800 | [diff] [blame] | 10323 | } |
| 10324 | UPB_INLINE void google_protobuf_EnumOptions_set_deprecated_legacy_json_field_conflicts(google_protobuf_EnumOptions *msg, bool value) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 10325 | const upb_MiniTableField field = {6, 11, 66, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; |
Protobuf Team Bot | ac32c97 | 2024-04-10 03:30:05 +0000 | [diff] [blame] | 10326 | upb_Message_SetBaseField((upb_Message *)msg, &field, &value); |
Mike Kruskal | 232ecf4 | 2023-01-14 00:09:40 -0800 | [diff] [blame] | 10327 | } |
Mike Kruskal | 4f9e417 | 2023-06-30 20:14:50 -0700 | [diff] [blame] | 10328 | UPB_INLINE void google_protobuf_EnumOptions_set_features(google_protobuf_EnumOptions *msg, google_protobuf_FeatureSet* value) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 10329 | 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 Bot | a9387b5 | 2024-06-12 15:17:52 +0000 | [diff] [blame] | 10330 | UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__FeatureSet_msg_init); |
Protobuf Team Bot | ac32c97 | 2024-04-10 03:30:05 +0000 | [diff] [blame] | 10331 | upb_Message_SetBaseField((upb_Message *)msg, &field, &value); |
Mike Kruskal | 4f9e417 | 2023-06-30 20:14:50 -0700 | [diff] [blame] | 10332 | } |
| 10333 | UPB_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 Bot | 4ffe086 | 2023-12-06 02:02:36 +0000 | [diff] [blame] | 10336 | sub = (struct google_protobuf_FeatureSet*)_upb_Message_New(&google__protobuf__FeatureSet_msg_init, arena); |
Mike Kruskal | 4f9e417 | 2023-06-30 20:14:50 -0700 | [diff] [blame] | 10337 | if (sub) google_protobuf_EnumOptions_set_features(msg, sub); |
| 10338 | } |
| 10339 | return sub; |
| 10340 | } |
Mike Kruskal | 232ecf4 | 2023-01-14 00:09:40 -0800 | [diff] [blame] | 10341 | UPB_INLINE google_protobuf_UninterpretedOption** google_protobuf_EnumOptions_mutable_uninterpreted_option(google_protobuf_EnumOptions* msg, size_t* size) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 10342 | 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 Bot | a9387b5 | 2024-06-12 15:17:52 +0000 | [diff] [blame] | 10343 | UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__UninterpretedOption_msg_init); |
Protobuf Team Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 10344 | upb_Array* arr = upb_Message_GetMutableArray(UPB_UPCAST(msg), &field); |
Eric Salo | b7d54ac | 2022-12-29 11:59:42 -0800 | [diff] [blame] | 10345 | if (arr) { |
Protobuf Team Bot | f73985a | 2023-12-19 00:14:19 +0000 | [diff] [blame] | 10346 | if (size) *size = arr->UPB_PRIVATE(size); |
Protobuf Team Bot | 81e5433 | 2024-01-11 21:04:07 +0000 | [diff] [blame] | 10347 | return (google_protobuf_UninterpretedOption**)upb_Array_MutableDataPtr(arr); |
Eric Salo | b7d54ac | 2022-12-29 11:59:42 -0800 | [diff] [blame] | 10348 | } else { |
| 10349 | if (size) *size = 0; |
| 10350 | return NULL; |
| 10351 | } |
Joshua Haberman | 9abf6e2 | 2021-01-13 12:16:25 -0800 | [diff] [blame] | 10352 | } |
Eric Salo | b7d54ac | 2022-12-29 11:59:42 -0800 | [diff] [blame] | 10353 | UPB_INLINE google_protobuf_UninterpretedOption** google_protobuf_EnumOptions_resize_uninterpreted_option(google_protobuf_EnumOptions* msg, size_t size, upb_Arena* arena) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 10354 | 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 Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 10355 | return (google_protobuf_UninterpretedOption**)upb_Message_ResizeArrayUninitialized(UPB_UPCAST(msg), |
| 10356 | &field, size, arena); |
Joshua Haberman | 9abf6e2 | 2021-01-13 12:16:25 -0800 | [diff] [blame] | 10357 | } |
Joshua Haberman | 7ecf43f | 2022-03-14 13:11:29 -0700 | [diff] [blame] | 10358 | UPB_INLINE struct google_protobuf_UninterpretedOption* google_protobuf_EnumOptions_add_uninterpreted_option(google_protobuf_EnumOptions* msg, upb_Arena* arena) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 10359 | 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 Bot | a9387b5 | 2024-06-12 15:17:52 +0000 | [diff] [blame] | 10360 | UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__UninterpretedOption_msg_init); |
Protobuf Team Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 10361 | upb_Array* arr = upb_Message_GetOrCreateMutableArray( |
| 10362 | UPB_UPCAST(msg), &field, arena); |
Protobuf Team Bot | 81e5433 | 2024-01-11 21:04:07 +0000 | [diff] [blame] | 10363 | if (!arr || !UPB_PRIVATE(_upb_Array_ResizeUninitialized)( |
Protobuf Team Bot | f73985a | 2023-12-19 00:14:19 +0000 | [diff] [blame] | 10364 | arr, arr->UPB_PRIVATE(size) + 1, arena)) { |
Eric Salo | b7d54ac | 2022-12-29 11:59:42 -0800 | [diff] [blame] | 10365 | return NULL; |
| 10366 | } |
Protobuf Team Bot | 4ffe086 | 2023-12-06 02:02:36 +0000 | [diff] [blame] | 10367 | struct google_protobuf_UninterpretedOption* sub = (struct google_protobuf_UninterpretedOption*)_upb_Message_New(&google__protobuf__UninterpretedOption_msg_init, arena); |
Eric Salo | b7d54ac | 2022-12-29 11:59:42 -0800 | [diff] [blame] | 10368 | if (!arr || !sub) return NULL; |
Protobuf Team Bot | f73985a | 2023-12-19 00:14:19 +0000 | [diff] [blame] | 10369 | UPB_PRIVATE(_upb_Array_Set) |
| 10370 | (arr, arr->UPB_PRIVATE(size) - 1, &sub, sizeof(sub)); |
Joshua Haberman | 9abf6e2 | 2021-01-13 12:16:25 -0800 | [diff] [blame] | 10371 | return sub; |
| 10372 | } |
| 10373 | |
| 10374 | /* google.protobuf.EnumValueOptions */ |
| 10375 | |
Joshua Haberman | f41049a | 2022-01-21 14:41:25 -0800 | [diff] [blame] | 10376 | UPB_INLINE google_protobuf_EnumValueOptions* google_protobuf_EnumValueOptions_new(upb_Arena* arena) { |
Protobuf Team Bot | 4ffe086 | 2023-12-06 02:02:36 +0000 | [diff] [blame] | 10377 | return (google_protobuf_EnumValueOptions*)_upb_Message_New(&google__protobuf__EnumValueOptions_msg_init, arena); |
Joshua Haberman | 9abf6e2 | 2021-01-13 12:16:25 -0800 | [diff] [blame] | 10378 | } |
Joshua Haberman | f41049a | 2022-01-21 14:41:25 -0800 | [diff] [blame] | 10379 | UPB_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 Haberman | 9d578a3 | 2021-08-02 15:32:01 -0700 | [diff] [blame] | 10381 | if (!ret) return NULL; |
Protobuf Team Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 10382 | if (upb_Decode(buf, size, UPB_UPCAST(ret), &google__protobuf__EnumValueOptions_msg_init, NULL, 0, arena) != |
| 10383 | kUpb_DecodeStatus_Ok) { |
Joshua Haberman | 9d578a3 | 2021-08-02 15:32:01 -0700 | [diff] [blame] | 10384 | return NULL; |
| 10385 | } |
| 10386 | return ret; |
Joshua Haberman | 9abf6e2 | 2021-01-13 12:16:25 -0800 | [diff] [blame] | 10387 | } |
Joshua Haberman | f41049a | 2022-01-21 14:41:25 -0800 | [diff] [blame] | 10388 | UPB_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 Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 10393 | if (upb_Decode(buf, size, UPB_UPCAST(ret), &google__protobuf__EnumValueOptions_msg_init, extreg, options, |
| 10394 | arena) != kUpb_DecodeStatus_Ok) { |
Joshua Haberman | f41049a | 2022-01-21 14:41:25 -0800 | [diff] [blame] | 10395 | return NULL; |
| 10396 | } |
| 10397 | return ret; |
Joshua Haberman | 9abf6e2 | 2021-01-13 12:16:25 -0800 | [diff] [blame] | 10398 | } |
Joshua Haberman | f41049a | 2022-01-21 14:41:25 -0800 | [diff] [blame] | 10399 | UPB_INLINE char* google_protobuf_EnumValueOptions_serialize(const google_protobuf_EnumValueOptions* msg, upb_Arena* arena, size_t* len) { |
Joshua Haberman | d3995ec | 2022-09-30 16:54:39 -0700 | [diff] [blame] | 10400 | char* ptr; |
Protobuf Team Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 10401 | (void)upb_Encode(UPB_UPCAST(msg), &google__protobuf__EnumValueOptions_msg_init, 0, arena, &ptr, len); |
Joshua Haberman | d3995ec | 2022-09-30 16:54:39 -0700 | [diff] [blame] | 10402 | return ptr; |
Joshua Haberman | f41049a | 2022-01-21 14:41:25 -0800 | [diff] [blame] | 10403 | } |
| 10404 | UPB_INLINE char* google_protobuf_EnumValueOptions_serialize_ex(const google_protobuf_EnumValueOptions* msg, int options, |
| 10405 | upb_Arena* arena, size_t* len) { |
Joshua Haberman | d3995ec | 2022-09-30 16:54:39 -0700 | [diff] [blame] | 10406 | char* ptr; |
Protobuf Team Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 10407 | (void)upb_Encode(UPB_UPCAST(msg), &google__protobuf__EnumValueOptions_msg_init, options, arena, &ptr, len); |
Joshua Haberman | d3995ec | 2022-09-30 16:54:39 -0700 | [diff] [blame] | 10408 | return ptr; |
Joshua Haberman | f41049a | 2022-01-21 14:41:25 -0800 | [diff] [blame] | 10409 | } |
Mike Kruskal | 3bc5049 | 2022-12-01 13:34:12 -0800 | [diff] [blame] | 10410 | UPB_INLINE void google_protobuf_EnumValueOptions_clear_deprecated(google_protobuf_EnumValueOptions* msg) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 10411 | const upb_MiniTableField field = {1, 9, 64, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; |
Protobuf Team Bot | 4e90ead | 2024-01-08 15:46:34 +0000 | [diff] [blame] | 10412 | upb_Message_ClearBaseField(UPB_UPCAST(msg), &field); |
Joshua Haberman | d3995ec | 2022-09-30 16:54:39 -0700 | [diff] [blame] | 10413 | } |
Joshua Haberman | f41049a | 2022-01-21 14:41:25 -0800 | [diff] [blame] | 10414 | UPB_INLINE bool google_protobuf_EnumValueOptions_deprecated(const google_protobuf_EnumValueOptions* msg) { |
Eric Salo | 8809a11 | 2022-11-21 13:01:06 -0800 | [diff] [blame] | 10415 | bool default_val = false; |
| 10416 | bool ret; |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 10417 | const upb_MiniTableField field = {1, 9, 64, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; |
Protobuf Team Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 10418 | _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field, |
| 10419 | &default_val, &ret); |
Eric Salo | 8809a11 | 2022-11-21 13:01:06 -0800 | [diff] [blame] | 10420 | return ret; |
Joshua Haberman | f41049a | 2022-01-21 14:41:25 -0800 | [diff] [blame] | 10421 | } |
Mike Kruskal | 3bc5049 | 2022-12-01 13:34:12 -0800 | [diff] [blame] | 10422 | UPB_INLINE bool google_protobuf_EnumValueOptions_has_deprecated(const google_protobuf_EnumValueOptions* msg) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 10423 | const upb_MiniTableField field = {1, 9, 64, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; |
Protobuf Team Bot | 8c1f635 | 2024-01-10 05:18:15 +0000 | [diff] [blame] | 10424 | return upb_Message_HasBaseField(UPB_UPCAST(msg), &field); |
Joshua Haberman | 7ecf43f | 2022-03-14 13:11:29 -0700 | [diff] [blame] | 10425 | } |
Mike Kruskal | 4f9e417 | 2023-06-30 20:14:50 -0700 | [diff] [blame] | 10426 | UPB_INLINE void google_protobuf_EnumValueOptions_clear_features(google_protobuf_EnumValueOptions* msg) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 10427 | 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 Bot | 4e90ead | 2024-01-08 15:46:34 +0000 | [diff] [blame] | 10428 | upb_Message_ClearBaseField(UPB_UPCAST(msg), &field); |
Mike Kruskal | 4f9e417 | 2023-06-30 20:14:50 -0700 | [diff] [blame] | 10429 | } |
| 10430 | UPB_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 Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 10433 | 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 Bot | a9387b5 | 2024-06-12 15:17:52 +0000 | [diff] [blame] | 10434 | UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__FeatureSet_msg_init); |
Protobuf Team Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 10435 | _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field, |
| 10436 | &default_val, &ret); |
Mike Kruskal | 4f9e417 | 2023-06-30 20:14:50 -0700 | [diff] [blame] | 10437 | return ret; |
| 10438 | } |
| 10439 | UPB_INLINE bool google_protobuf_EnumValueOptions_has_features(const google_protobuf_EnumValueOptions* msg) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 10440 | 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 Bot | 8c1f635 | 2024-01-10 05:18:15 +0000 | [diff] [blame] | 10441 | return upb_Message_HasBaseField(UPB_UPCAST(msg), &field); |
Mike Kruskal | 4f9e417 | 2023-06-30 20:14:50 -0700 | [diff] [blame] | 10442 | } |
Mike Kruskal | 12e0f1d | 2023-05-31 15:40:54 -0700 | [diff] [blame] | 10443 | UPB_INLINE void google_protobuf_EnumValueOptions_clear_debug_redact(google_protobuf_EnumValueOptions* msg) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 10444 | 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 Bot | 4e90ead | 2024-01-08 15:46:34 +0000 | [diff] [blame] | 10445 | upb_Message_ClearBaseField(UPB_UPCAST(msg), &field); |
Mike Kruskal | 12e0f1d | 2023-05-31 15:40:54 -0700 | [diff] [blame] | 10446 | } |
| 10447 | UPB_INLINE bool google_protobuf_EnumValueOptions_debug_redact(const google_protobuf_EnumValueOptions* msg) { |
| 10448 | bool default_val = false; |
| 10449 | bool ret; |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 10450 | 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 Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 10451 | _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field, |
| 10452 | &default_val, &ret); |
Mike Kruskal | 12e0f1d | 2023-05-31 15:40:54 -0700 | [diff] [blame] | 10453 | return ret; |
| 10454 | } |
| 10455 | UPB_INLINE bool google_protobuf_EnumValueOptions_has_debug_redact(const google_protobuf_EnumValueOptions* msg) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 10456 | 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 Bot | 8c1f635 | 2024-01-10 05:18:15 +0000 | [diff] [blame] | 10457 | return upb_Message_HasBaseField(UPB_UPCAST(msg), &field); |
Mike Kruskal | 12e0f1d | 2023-05-31 15:40:54 -0700 | [diff] [blame] | 10458 | } |
Protobuf Team Bot | 2e9c0a7 | 2024-05-21 23:17:21 +0000 | [diff] [blame] | 10459 | UPB_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 | } |
| 10463 | UPB_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 Bot | a9387b5 | 2024-06-12 15:17:52 +0000 | [diff] [blame] | 10467 | UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__FieldOptions__FeatureSupport_msg_init); |
Protobuf Team Bot | 2e9c0a7 | 2024-05-21 23:17:21 +0000 | [diff] [blame] | 10468 | _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field, |
| 10469 | &default_val, &ret); |
| 10470 | return ret; |
| 10471 | } |
| 10472 | UPB_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 Kruskal | 3bc5049 | 2022-12-01 13:34:12 -0800 | [diff] [blame] | 10476 | UPB_INLINE void google_protobuf_EnumValueOptions_clear_uninterpreted_option(google_protobuf_EnumValueOptions* msg) { |
Protobuf Team Bot | 2e9c0a7 | 2024-05-21 23:17:21 +0000 | [diff] [blame] | 10477 | 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 Bot | 4e90ead | 2024-01-08 15:46:34 +0000 | [diff] [blame] | 10478 | upb_Message_ClearBaseField(UPB_UPCAST(msg), &field); |
Joshua Haberman | d3995ec | 2022-09-30 16:54:39 -0700 | [diff] [blame] | 10479 | } |
Eric Salo | b7d54ac | 2022-12-29 11:59:42 -0800 | [diff] [blame] | 10480 | UPB_INLINE const google_protobuf_UninterpretedOption* const* google_protobuf_EnumValueOptions_uninterpreted_option(const google_protobuf_EnumValueOptions* msg, size_t* size) { |
Protobuf Team Bot | 2e9c0a7 | 2024-05-21 23:17:21 +0000 | [diff] [blame] | 10481 | 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 Bot | a9387b5 | 2024-06-12 15:17:52 +0000 | [diff] [blame] | 10482 | UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__UninterpretedOption_msg_init); |
Protobuf Team Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 10483 | const upb_Array* arr = upb_Message_GetArray(UPB_UPCAST(msg), &field); |
Eric Salo | b7d54ac | 2022-12-29 11:59:42 -0800 | [diff] [blame] | 10484 | if (arr) { |
Protobuf Team Bot | f73985a | 2023-12-19 00:14:19 +0000 | [diff] [blame] | 10485 | if (size) *size = arr->UPB_PRIVATE(size); |
Protobuf Team Bot | 81e5433 | 2024-01-11 21:04:07 +0000 | [diff] [blame] | 10486 | return (const google_protobuf_UninterpretedOption* const*)upb_Array_DataPtr(arr); |
Eric Salo | b7d54ac | 2022-12-29 11:59:42 -0800 | [diff] [blame] | 10487 | } else { |
| 10488 | if (size) *size = 0; |
| 10489 | return NULL; |
| 10490 | } |
Joshua Haberman | 7ecf43f | 2022-03-14 13:11:29 -0700 | [diff] [blame] | 10491 | } |
Deanna Garcia | b26afb5 | 2023-04-25 13:37:18 -0700 | [diff] [blame] | 10492 | UPB_INLINE const upb_Array* _google_protobuf_EnumValueOptions_uninterpreted_option_upb_array(const google_protobuf_EnumValueOptions* msg, size_t* size) { |
Protobuf Team Bot | 2e9c0a7 | 2024-05-21 23:17:21 +0000 | [diff] [blame] | 10493 | 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 Bot | a9387b5 | 2024-06-12 15:17:52 +0000 | [diff] [blame] | 10494 | UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__UninterpretedOption_msg_init); |
Protobuf Team Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 10495 | const upb_Array* arr = upb_Message_GetArray(UPB_UPCAST(msg), &field); |
Deanna Garcia | b26afb5 | 2023-04-25 13:37:18 -0700 | [diff] [blame] | 10496 | if (size) { |
Protobuf Team Bot | f73985a | 2023-12-19 00:14:19 +0000 | [diff] [blame] | 10497 | *size = arr ? arr->UPB_PRIVATE(size) : 0; |
Deanna Garcia | b26afb5 | 2023-04-25 13:37:18 -0700 | [diff] [blame] | 10498 | } |
| 10499 | return arr; |
| 10500 | } |
Protobuf Team Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 10501 | UPB_INLINE upb_Array* _google_protobuf_EnumValueOptions_uninterpreted_option_mutable_upb_array(google_protobuf_EnumValueOptions* msg, size_t* size, upb_Arena* arena) { |
Protobuf Team Bot | 2e9c0a7 | 2024-05-21 23:17:21 +0000 | [diff] [blame] | 10502 | 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 Bot | a9387b5 | 2024-06-12 15:17:52 +0000 | [diff] [blame] | 10503 | UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__UninterpretedOption_msg_init); |
Protobuf Team Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 10504 | upb_Array* arr = upb_Message_GetOrCreateMutableArray(UPB_UPCAST(msg), |
| 10505 | &field, arena); |
Deanna Garcia | b26afb5 | 2023-04-25 13:37:18 -0700 | [diff] [blame] | 10506 | if (size) { |
Protobuf Team Bot | f73985a | 2023-12-19 00:14:19 +0000 | [diff] [blame] | 10507 | *size = arr ? arr->UPB_PRIVATE(size) : 0; |
Deanna Garcia | b26afb5 | 2023-04-25 13:37:18 -0700 | [diff] [blame] | 10508 | } |
| 10509 | return arr; |
| 10510 | } |
Joshua Haberman | 9abf6e2 | 2021-01-13 12:16:25 -0800 | [diff] [blame] | 10511 | |
| 10512 | UPB_INLINE void google_protobuf_EnumValueOptions_set_deprecated(google_protobuf_EnumValueOptions *msg, bool value) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 10513 | const upb_MiniTableField field = {1, 9, 64, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; |
Protobuf Team Bot | ac32c97 | 2024-04-10 03:30:05 +0000 | [diff] [blame] | 10514 | upb_Message_SetBaseField((upb_Message *)msg, &field, &value); |
Mike Kruskal | 232ecf4 | 2023-01-14 00:09:40 -0800 | [diff] [blame] | 10515 | } |
Mike Kruskal | 4f9e417 | 2023-06-30 20:14:50 -0700 | [diff] [blame] | 10516 | UPB_INLINE void google_protobuf_EnumValueOptions_set_features(google_protobuf_EnumValueOptions *msg, google_protobuf_FeatureSet* value) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 10517 | 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 Bot | a9387b5 | 2024-06-12 15:17:52 +0000 | [diff] [blame] | 10518 | UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__FeatureSet_msg_init); |
Protobuf Team Bot | ac32c97 | 2024-04-10 03:30:05 +0000 | [diff] [blame] | 10519 | upb_Message_SetBaseField((upb_Message *)msg, &field, &value); |
Mike Kruskal | 4f9e417 | 2023-06-30 20:14:50 -0700 | [diff] [blame] | 10520 | } |
| 10521 | UPB_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 Bot | 4ffe086 | 2023-12-06 02:02:36 +0000 | [diff] [blame] | 10524 | sub = (struct google_protobuf_FeatureSet*)_upb_Message_New(&google__protobuf__FeatureSet_msg_init, arena); |
Mike Kruskal | 4f9e417 | 2023-06-30 20:14:50 -0700 | [diff] [blame] | 10525 | if (sub) google_protobuf_EnumValueOptions_set_features(msg, sub); |
| 10526 | } |
| 10527 | return sub; |
| 10528 | } |
Mike Kruskal | 12e0f1d | 2023-05-31 15:40:54 -0700 | [diff] [blame] | 10529 | UPB_INLINE void google_protobuf_EnumValueOptions_set_debug_redact(google_protobuf_EnumValueOptions *msg, bool value) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 10530 | 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 Bot | ac32c97 | 2024-04-10 03:30:05 +0000 | [diff] [blame] | 10531 | upb_Message_SetBaseField((upb_Message *)msg, &field, &value); |
Mike Kruskal | 12e0f1d | 2023-05-31 15:40:54 -0700 | [diff] [blame] | 10532 | } |
Protobuf Team Bot | 2e9c0a7 | 2024-05-21 23:17:21 +0000 | [diff] [blame] | 10533 | UPB_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 Bot | a9387b5 | 2024-06-12 15:17:52 +0000 | [diff] [blame] | 10535 | UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__FieldOptions__FeatureSupport_msg_init); |
Protobuf Team Bot | 2e9c0a7 | 2024-05-21 23:17:21 +0000 | [diff] [blame] | 10536 | upb_Message_SetBaseField((upb_Message *)msg, &field, &value); |
| 10537 | } |
| 10538 | UPB_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 Kruskal | 232ecf4 | 2023-01-14 00:09:40 -0800 | [diff] [blame] | 10546 | UPB_INLINE google_protobuf_UninterpretedOption** google_protobuf_EnumValueOptions_mutable_uninterpreted_option(google_protobuf_EnumValueOptions* msg, size_t* size) { |
Protobuf Team Bot | 2e9c0a7 | 2024-05-21 23:17:21 +0000 | [diff] [blame] | 10547 | 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 Bot | a9387b5 | 2024-06-12 15:17:52 +0000 | [diff] [blame] | 10548 | UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__UninterpretedOption_msg_init); |
Protobuf Team Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 10549 | upb_Array* arr = upb_Message_GetMutableArray(UPB_UPCAST(msg), &field); |
Eric Salo | b7d54ac | 2022-12-29 11:59:42 -0800 | [diff] [blame] | 10550 | if (arr) { |
Protobuf Team Bot | f73985a | 2023-12-19 00:14:19 +0000 | [diff] [blame] | 10551 | if (size) *size = arr->UPB_PRIVATE(size); |
Protobuf Team Bot | 81e5433 | 2024-01-11 21:04:07 +0000 | [diff] [blame] | 10552 | return (google_protobuf_UninterpretedOption**)upb_Array_MutableDataPtr(arr); |
Eric Salo | b7d54ac | 2022-12-29 11:59:42 -0800 | [diff] [blame] | 10553 | } else { |
| 10554 | if (size) *size = 0; |
| 10555 | return NULL; |
| 10556 | } |
Joshua Haberman | 9abf6e2 | 2021-01-13 12:16:25 -0800 | [diff] [blame] | 10557 | } |
Eric Salo | b7d54ac | 2022-12-29 11:59:42 -0800 | [diff] [blame] | 10558 | UPB_INLINE google_protobuf_UninterpretedOption** google_protobuf_EnumValueOptions_resize_uninterpreted_option(google_protobuf_EnumValueOptions* msg, size_t size, upb_Arena* arena) { |
Protobuf Team Bot | 2e9c0a7 | 2024-05-21 23:17:21 +0000 | [diff] [blame] | 10559 | 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 Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 10560 | return (google_protobuf_UninterpretedOption**)upb_Message_ResizeArrayUninitialized(UPB_UPCAST(msg), |
| 10561 | &field, size, arena); |
Joshua Haberman | 9abf6e2 | 2021-01-13 12:16:25 -0800 | [diff] [blame] | 10562 | } |
Joshua Haberman | 7ecf43f | 2022-03-14 13:11:29 -0700 | [diff] [blame] | 10563 | UPB_INLINE struct google_protobuf_UninterpretedOption* google_protobuf_EnumValueOptions_add_uninterpreted_option(google_protobuf_EnumValueOptions* msg, upb_Arena* arena) { |
Protobuf Team Bot | 2e9c0a7 | 2024-05-21 23:17:21 +0000 | [diff] [blame] | 10564 | 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 Bot | a9387b5 | 2024-06-12 15:17:52 +0000 | [diff] [blame] | 10565 | UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__UninterpretedOption_msg_init); |
Protobuf Team Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 10566 | upb_Array* arr = upb_Message_GetOrCreateMutableArray( |
| 10567 | UPB_UPCAST(msg), &field, arena); |
Protobuf Team Bot | 81e5433 | 2024-01-11 21:04:07 +0000 | [diff] [blame] | 10568 | if (!arr || !UPB_PRIVATE(_upb_Array_ResizeUninitialized)( |
Protobuf Team Bot | f73985a | 2023-12-19 00:14:19 +0000 | [diff] [blame] | 10569 | arr, arr->UPB_PRIVATE(size) + 1, arena)) { |
Eric Salo | b7d54ac | 2022-12-29 11:59:42 -0800 | [diff] [blame] | 10570 | return NULL; |
| 10571 | } |
Protobuf Team Bot | 4ffe086 | 2023-12-06 02:02:36 +0000 | [diff] [blame] | 10572 | struct google_protobuf_UninterpretedOption* sub = (struct google_protobuf_UninterpretedOption*)_upb_Message_New(&google__protobuf__UninterpretedOption_msg_init, arena); |
Eric Salo | b7d54ac | 2022-12-29 11:59:42 -0800 | [diff] [blame] | 10573 | if (!arr || !sub) return NULL; |
Protobuf Team Bot | f73985a | 2023-12-19 00:14:19 +0000 | [diff] [blame] | 10574 | UPB_PRIVATE(_upb_Array_Set) |
| 10575 | (arr, arr->UPB_PRIVATE(size) - 1, &sub, sizeof(sub)); |
Joshua Haberman | 9abf6e2 | 2021-01-13 12:16:25 -0800 | [diff] [blame] | 10576 | return sub; |
| 10577 | } |
| 10578 | |
| 10579 | /* google.protobuf.ServiceOptions */ |
| 10580 | |
Joshua Haberman | f41049a | 2022-01-21 14:41:25 -0800 | [diff] [blame] | 10581 | UPB_INLINE google_protobuf_ServiceOptions* google_protobuf_ServiceOptions_new(upb_Arena* arena) { |
Protobuf Team Bot | 4ffe086 | 2023-12-06 02:02:36 +0000 | [diff] [blame] | 10582 | return (google_protobuf_ServiceOptions*)_upb_Message_New(&google__protobuf__ServiceOptions_msg_init, arena); |
Joshua Haberman | 9abf6e2 | 2021-01-13 12:16:25 -0800 | [diff] [blame] | 10583 | } |
Joshua Haberman | f41049a | 2022-01-21 14:41:25 -0800 | [diff] [blame] | 10584 | UPB_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 Haberman | 9d578a3 | 2021-08-02 15:32:01 -0700 | [diff] [blame] | 10586 | if (!ret) return NULL; |
Protobuf Team Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 10587 | if (upb_Decode(buf, size, UPB_UPCAST(ret), &google__protobuf__ServiceOptions_msg_init, NULL, 0, arena) != |
| 10588 | kUpb_DecodeStatus_Ok) { |
Joshua Haberman | 9d578a3 | 2021-08-02 15:32:01 -0700 | [diff] [blame] | 10589 | return NULL; |
| 10590 | } |
| 10591 | return ret; |
Joshua Haberman | 9abf6e2 | 2021-01-13 12:16:25 -0800 | [diff] [blame] | 10592 | } |
Joshua Haberman | f41049a | 2022-01-21 14:41:25 -0800 | [diff] [blame] | 10593 | UPB_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 Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 10598 | if (upb_Decode(buf, size, UPB_UPCAST(ret), &google__protobuf__ServiceOptions_msg_init, extreg, options, |
| 10599 | arena) != kUpb_DecodeStatus_Ok) { |
Joshua Haberman | f41049a | 2022-01-21 14:41:25 -0800 | [diff] [blame] | 10600 | return NULL; |
| 10601 | } |
| 10602 | return ret; |
Joshua Haberman | 9abf6e2 | 2021-01-13 12:16:25 -0800 | [diff] [blame] | 10603 | } |
Joshua Haberman | f41049a | 2022-01-21 14:41:25 -0800 | [diff] [blame] | 10604 | UPB_INLINE char* google_protobuf_ServiceOptions_serialize(const google_protobuf_ServiceOptions* msg, upb_Arena* arena, size_t* len) { |
Joshua Haberman | d3995ec | 2022-09-30 16:54:39 -0700 | [diff] [blame] | 10605 | char* ptr; |
Protobuf Team Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 10606 | (void)upb_Encode(UPB_UPCAST(msg), &google__protobuf__ServiceOptions_msg_init, 0, arena, &ptr, len); |
Joshua Haberman | d3995ec | 2022-09-30 16:54:39 -0700 | [diff] [blame] | 10607 | return ptr; |
Joshua Haberman | f41049a | 2022-01-21 14:41:25 -0800 | [diff] [blame] | 10608 | } |
| 10609 | UPB_INLINE char* google_protobuf_ServiceOptions_serialize_ex(const google_protobuf_ServiceOptions* msg, int options, |
| 10610 | upb_Arena* arena, size_t* len) { |
Joshua Haberman | d3995ec | 2022-09-30 16:54:39 -0700 | [diff] [blame] | 10611 | char* ptr; |
Protobuf Team Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 10612 | (void)upb_Encode(UPB_UPCAST(msg), &google__protobuf__ServiceOptions_msg_init, options, arena, &ptr, len); |
Joshua Haberman | d3995ec | 2022-09-30 16:54:39 -0700 | [diff] [blame] | 10613 | return ptr; |
Joshua Haberman | f41049a | 2022-01-21 14:41:25 -0800 | [diff] [blame] | 10614 | } |
Mike Kruskal | 3bc5049 | 2022-12-01 13:34:12 -0800 | [diff] [blame] | 10615 | UPB_INLINE void google_protobuf_ServiceOptions_clear_deprecated(google_protobuf_ServiceOptions* msg) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 10616 | const upb_MiniTableField field = {33, 9, 64, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; |
Protobuf Team Bot | 4e90ead | 2024-01-08 15:46:34 +0000 | [diff] [blame] | 10617 | upb_Message_ClearBaseField(UPB_UPCAST(msg), &field); |
Joshua Haberman | d3995ec | 2022-09-30 16:54:39 -0700 | [diff] [blame] | 10618 | } |
Joshua Haberman | f41049a | 2022-01-21 14:41:25 -0800 | [diff] [blame] | 10619 | UPB_INLINE bool google_protobuf_ServiceOptions_deprecated(const google_protobuf_ServiceOptions* msg) { |
Eric Salo | 8809a11 | 2022-11-21 13:01:06 -0800 | [diff] [blame] | 10620 | bool default_val = false; |
| 10621 | bool ret; |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 10622 | const upb_MiniTableField field = {33, 9, 64, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; |
Protobuf Team Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 10623 | _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field, |
| 10624 | &default_val, &ret); |
Eric Salo | 8809a11 | 2022-11-21 13:01:06 -0800 | [diff] [blame] | 10625 | return ret; |
Joshua Haberman | f41049a | 2022-01-21 14:41:25 -0800 | [diff] [blame] | 10626 | } |
Mike Kruskal | 3bc5049 | 2022-12-01 13:34:12 -0800 | [diff] [blame] | 10627 | UPB_INLINE bool google_protobuf_ServiceOptions_has_deprecated(const google_protobuf_ServiceOptions* msg) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 10628 | const upb_MiniTableField field = {33, 9, 64, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; |
Protobuf Team Bot | 8c1f635 | 2024-01-10 05:18:15 +0000 | [diff] [blame] | 10629 | return upb_Message_HasBaseField(UPB_UPCAST(msg), &field); |
Joshua Haberman | 7ecf43f | 2022-03-14 13:11:29 -0700 | [diff] [blame] | 10630 | } |
Mike Kruskal | 4f9e417 | 2023-06-30 20:14:50 -0700 | [diff] [blame] | 10631 | UPB_INLINE void google_protobuf_ServiceOptions_clear_features(google_protobuf_ServiceOptions* msg) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 10632 | 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 Bot | 4e90ead | 2024-01-08 15:46:34 +0000 | [diff] [blame] | 10633 | upb_Message_ClearBaseField(UPB_UPCAST(msg), &field); |
Mike Kruskal | 4f9e417 | 2023-06-30 20:14:50 -0700 | [diff] [blame] | 10634 | } |
| 10635 | UPB_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 Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 10638 | 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 Bot | a9387b5 | 2024-06-12 15:17:52 +0000 | [diff] [blame] | 10639 | UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__FeatureSet_msg_init); |
Protobuf Team Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 10640 | _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field, |
| 10641 | &default_val, &ret); |
Mike Kruskal | 4f9e417 | 2023-06-30 20:14:50 -0700 | [diff] [blame] | 10642 | return ret; |
| 10643 | } |
| 10644 | UPB_INLINE bool google_protobuf_ServiceOptions_has_features(const google_protobuf_ServiceOptions* msg) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 10645 | 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 Bot | 8c1f635 | 2024-01-10 05:18:15 +0000 | [diff] [blame] | 10646 | return upb_Message_HasBaseField(UPB_UPCAST(msg), &field); |
Mike Kruskal | 4f9e417 | 2023-06-30 20:14:50 -0700 | [diff] [blame] | 10647 | } |
Mike Kruskal | 3bc5049 | 2022-12-01 13:34:12 -0800 | [diff] [blame] | 10648 | UPB_INLINE void google_protobuf_ServiceOptions_clear_uninterpreted_option(google_protobuf_ServiceOptions* msg) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 10649 | 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 Bot | 4e90ead | 2024-01-08 15:46:34 +0000 | [diff] [blame] | 10650 | upb_Message_ClearBaseField(UPB_UPCAST(msg), &field); |
Joshua Haberman | d3995ec | 2022-09-30 16:54:39 -0700 | [diff] [blame] | 10651 | } |
Eric Salo | b7d54ac | 2022-12-29 11:59:42 -0800 | [diff] [blame] | 10652 | UPB_INLINE const google_protobuf_UninterpretedOption* const* google_protobuf_ServiceOptions_uninterpreted_option(const google_protobuf_ServiceOptions* msg, size_t* size) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 10653 | 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 Bot | a9387b5 | 2024-06-12 15:17:52 +0000 | [diff] [blame] | 10654 | UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__UninterpretedOption_msg_init); |
Protobuf Team Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 10655 | const upb_Array* arr = upb_Message_GetArray(UPB_UPCAST(msg), &field); |
Eric Salo | b7d54ac | 2022-12-29 11:59:42 -0800 | [diff] [blame] | 10656 | if (arr) { |
Protobuf Team Bot | f73985a | 2023-12-19 00:14:19 +0000 | [diff] [blame] | 10657 | if (size) *size = arr->UPB_PRIVATE(size); |
Protobuf Team Bot | 81e5433 | 2024-01-11 21:04:07 +0000 | [diff] [blame] | 10658 | return (const google_protobuf_UninterpretedOption* const*)upb_Array_DataPtr(arr); |
Eric Salo | b7d54ac | 2022-12-29 11:59:42 -0800 | [diff] [blame] | 10659 | } else { |
| 10660 | if (size) *size = 0; |
| 10661 | return NULL; |
| 10662 | } |
Joshua Haberman | 7ecf43f | 2022-03-14 13:11:29 -0700 | [diff] [blame] | 10663 | } |
Deanna Garcia | b26afb5 | 2023-04-25 13:37:18 -0700 | [diff] [blame] | 10664 | UPB_INLINE const upb_Array* _google_protobuf_ServiceOptions_uninterpreted_option_upb_array(const google_protobuf_ServiceOptions* msg, size_t* size) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 10665 | 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 Bot | a9387b5 | 2024-06-12 15:17:52 +0000 | [diff] [blame] | 10666 | UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__UninterpretedOption_msg_init); |
Protobuf Team Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 10667 | const upb_Array* arr = upb_Message_GetArray(UPB_UPCAST(msg), &field); |
Deanna Garcia | b26afb5 | 2023-04-25 13:37:18 -0700 | [diff] [blame] | 10668 | if (size) { |
Protobuf Team Bot | f73985a | 2023-12-19 00:14:19 +0000 | [diff] [blame] | 10669 | *size = arr ? arr->UPB_PRIVATE(size) : 0; |
Deanna Garcia | b26afb5 | 2023-04-25 13:37:18 -0700 | [diff] [blame] | 10670 | } |
| 10671 | return arr; |
| 10672 | } |
Protobuf Team Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 10673 | UPB_INLINE upb_Array* _google_protobuf_ServiceOptions_uninterpreted_option_mutable_upb_array(google_protobuf_ServiceOptions* msg, size_t* size, upb_Arena* arena) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 10674 | 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 Bot | a9387b5 | 2024-06-12 15:17:52 +0000 | [diff] [blame] | 10675 | UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__UninterpretedOption_msg_init); |
Protobuf Team Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 10676 | upb_Array* arr = upb_Message_GetOrCreateMutableArray(UPB_UPCAST(msg), |
| 10677 | &field, arena); |
Deanna Garcia | b26afb5 | 2023-04-25 13:37:18 -0700 | [diff] [blame] | 10678 | if (size) { |
Protobuf Team Bot | f73985a | 2023-12-19 00:14:19 +0000 | [diff] [blame] | 10679 | *size = arr ? arr->UPB_PRIVATE(size) : 0; |
Deanna Garcia | b26afb5 | 2023-04-25 13:37:18 -0700 | [diff] [blame] | 10680 | } |
| 10681 | return arr; |
| 10682 | } |
Joshua Haberman | 9abf6e2 | 2021-01-13 12:16:25 -0800 | [diff] [blame] | 10683 | |
| 10684 | UPB_INLINE void google_protobuf_ServiceOptions_set_deprecated(google_protobuf_ServiceOptions *msg, bool value) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 10685 | const upb_MiniTableField field = {33, 9, 64, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; |
Protobuf Team Bot | ac32c97 | 2024-04-10 03:30:05 +0000 | [diff] [blame] | 10686 | upb_Message_SetBaseField((upb_Message *)msg, &field, &value); |
Mike Kruskal | 232ecf4 | 2023-01-14 00:09:40 -0800 | [diff] [blame] | 10687 | } |
Mike Kruskal | 4f9e417 | 2023-06-30 20:14:50 -0700 | [diff] [blame] | 10688 | UPB_INLINE void google_protobuf_ServiceOptions_set_features(google_protobuf_ServiceOptions *msg, google_protobuf_FeatureSet* value) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 10689 | 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 Bot | a9387b5 | 2024-06-12 15:17:52 +0000 | [diff] [blame] | 10690 | UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__FeatureSet_msg_init); |
Protobuf Team Bot | ac32c97 | 2024-04-10 03:30:05 +0000 | [diff] [blame] | 10691 | upb_Message_SetBaseField((upb_Message *)msg, &field, &value); |
Mike Kruskal | 4f9e417 | 2023-06-30 20:14:50 -0700 | [diff] [blame] | 10692 | } |
| 10693 | UPB_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 Bot | 4ffe086 | 2023-12-06 02:02:36 +0000 | [diff] [blame] | 10696 | sub = (struct google_protobuf_FeatureSet*)_upb_Message_New(&google__protobuf__FeatureSet_msg_init, arena); |
Mike Kruskal | 4f9e417 | 2023-06-30 20:14:50 -0700 | [diff] [blame] | 10697 | if (sub) google_protobuf_ServiceOptions_set_features(msg, sub); |
| 10698 | } |
| 10699 | return sub; |
| 10700 | } |
Mike Kruskal | 232ecf4 | 2023-01-14 00:09:40 -0800 | [diff] [blame] | 10701 | UPB_INLINE google_protobuf_UninterpretedOption** google_protobuf_ServiceOptions_mutable_uninterpreted_option(google_protobuf_ServiceOptions* msg, size_t* size) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 10702 | 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 Bot | a9387b5 | 2024-06-12 15:17:52 +0000 | [diff] [blame] | 10703 | UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__UninterpretedOption_msg_init); |
Protobuf Team Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 10704 | upb_Array* arr = upb_Message_GetMutableArray(UPB_UPCAST(msg), &field); |
Eric Salo | b7d54ac | 2022-12-29 11:59:42 -0800 | [diff] [blame] | 10705 | if (arr) { |
Protobuf Team Bot | f73985a | 2023-12-19 00:14:19 +0000 | [diff] [blame] | 10706 | if (size) *size = arr->UPB_PRIVATE(size); |
Protobuf Team Bot | 81e5433 | 2024-01-11 21:04:07 +0000 | [diff] [blame] | 10707 | return (google_protobuf_UninterpretedOption**)upb_Array_MutableDataPtr(arr); |
Eric Salo | b7d54ac | 2022-12-29 11:59:42 -0800 | [diff] [blame] | 10708 | } else { |
| 10709 | if (size) *size = 0; |
| 10710 | return NULL; |
| 10711 | } |
Joshua Haberman | 9abf6e2 | 2021-01-13 12:16:25 -0800 | [diff] [blame] | 10712 | } |
Eric Salo | b7d54ac | 2022-12-29 11:59:42 -0800 | [diff] [blame] | 10713 | UPB_INLINE google_protobuf_UninterpretedOption** google_protobuf_ServiceOptions_resize_uninterpreted_option(google_protobuf_ServiceOptions* msg, size_t size, upb_Arena* arena) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 10714 | 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 Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 10715 | return (google_protobuf_UninterpretedOption**)upb_Message_ResizeArrayUninitialized(UPB_UPCAST(msg), |
| 10716 | &field, size, arena); |
Joshua Haberman | 9abf6e2 | 2021-01-13 12:16:25 -0800 | [diff] [blame] | 10717 | } |
Joshua Haberman | 7ecf43f | 2022-03-14 13:11:29 -0700 | [diff] [blame] | 10718 | UPB_INLINE struct google_protobuf_UninterpretedOption* google_protobuf_ServiceOptions_add_uninterpreted_option(google_protobuf_ServiceOptions* msg, upb_Arena* arena) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 10719 | 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 Bot | a9387b5 | 2024-06-12 15:17:52 +0000 | [diff] [blame] | 10720 | UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__UninterpretedOption_msg_init); |
Protobuf Team Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 10721 | upb_Array* arr = upb_Message_GetOrCreateMutableArray( |
| 10722 | UPB_UPCAST(msg), &field, arena); |
Protobuf Team Bot | 81e5433 | 2024-01-11 21:04:07 +0000 | [diff] [blame] | 10723 | if (!arr || !UPB_PRIVATE(_upb_Array_ResizeUninitialized)( |
Protobuf Team Bot | f73985a | 2023-12-19 00:14:19 +0000 | [diff] [blame] | 10724 | arr, arr->UPB_PRIVATE(size) + 1, arena)) { |
Eric Salo | b7d54ac | 2022-12-29 11:59:42 -0800 | [diff] [blame] | 10725 | return NULL; |
| 10726 | } |
Protobuf Team Bot | 4ffe086 | 2023-12-06 02:02:36 +0000 | [diff] [blame] | 10727 | struct google_protobuf_UninterpretedOption* sub = (struct google_protobuf_UninterpretedOption*)_upb_Message_New(&google__protobuf__UninterpretedOption_msg_init, arena); |
Eric Salo | b7d54ac | 2022-12-29 11:59:42 -0800 | [diff] [blame] | 10728 | if (!arr || !sub) return NULL; |
Protobuf Team Bot | f73985a | 2023-12-19 00:14:19 +0000 | [diff] [blame] | 10729 | UPB_PRIVATE(_upb_Array_Set) |
| 10730 | (arr, arr->UPB_PRIVATE(size) - 1, &sub, sizeof(sub)); |
Joshua Haberman | 9abf6e2 | 2021-01-13 12:16:25 -0800 | [diff] [blame] | 10731 | return sub; |
| 10732 | } |
| 10733 | |
| 10734 | /* google.protobuf.MethodOptions */ |
| 10735 | |
Joshua Haberman | f41049a | 2022-01-21 14:41:25 -0800 | [diff] [blame] | 10736 | UPB_INLINE google_protobuf_MethodOptions* google_protobuf_MethodOptions_new(upb_Arena* arena) { |
Protobuf Team Bot | 4ffe086 | 2023-12-06 02:02:36 +0000 | [diff] [blame] | 10737 | return (google_protobuf_MethodOptions*)_upb_Message_New(&google__protobuf__MethodOptions_msg_init, arena); |
Joshua Haberman | 9abf6e2 | 2021-01-13 12:16:25 -0800 | [diff] [blame] | 10738 | } |
Joshua Haberman | f41049a | 2022-01-21 14:41:25 -0800 | [diff] [blame] | 10739 | UPB_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 Haberman | 9d578a3 | 2021-08-02 15:32:01 -0700 | [diff] [blame] | 10741 | if (!ret) return NULL; |
Protobuf Team Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 10742 | if (upb_Decode(buf, size, UPB_UPCAST(ret), &google__protobuf__MethodOptions_msg_init, NULL, 0, arena) != |
| 10743 | kUpb_DecodeStatus_Ok) { |
Joshua Haberman | 9d578a3 | 2021-08-02 15:32:01 -0700 | [diff] [blame] | 10744 | return NULL; |
| 10745 | } |
| 10746 | return ret; |
Joshua Haberman | 9abf6e2 | 2021-01-13 12:16:25 -0800 | [diff] [blame] | 10747 | } |
Joshua Haberman | f41049a | 2022-01-21 14:41:25 -0800 | [diff] [blame] | 10748 | UPB_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 Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 10753 | if (upb_Decode(buf, size, UPB_UPCAST(ret), &google__protobuf__MethodOptions_msg_init, extreg, options, |
| 10754 | arena) != kUpb_DecodeStatus_Ok) { |
Joshua Haberman | f41049a | 2022-01-21 14:41:25 -0800 | [diff] [blame] | 10755 | return NULL; |
| 10756 | } |
| 10757 | return ret; |
Joshua Haberman | 9abf6e2 | 2021-01-13 12:16:25 -0800 | [diff] [blame] | 10758 | } |
Joshua Haberman | f41049a | 2022-01-21 14:41:25 -0800 | [diff] [blame] | 10759 | UPB_INLINE char* google_protobuf_MethodOptions_serialize(const google_protobuf_MethodOptions* msg, upb_Arena* arena, size_t* len) { |
Joshua Haberman | d3995ec | 2022-09-30 16:54:39 -0700 | [diff] [blame] | 10760 | char* ptr; |
Protobuf Team Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 10761 | (void)upb_Encode(UPB_UPCAST(msg), &google__protobuf__MethodOptions_msg_init, 0, arena, &ptr, len); |
Joshua Haberman | d3995ec | 2022-09-30 16:54:39 -0700 | [diff] [blame] | 10762 | return ptr; |
Joshua Haberman | f41049a | 2022-01-21 14:41:25 -0800 | [diff] [blame] | 10763 | } |
| 10764 | UPB_INLINE char* google_protobuf_MethodOptions_serialize_ex(const google_protobuf_MethodOptions* msg, int options, |
| 10765 | upb_Arena* arena, size_t* len) { |
Joshua Haberman | d3995ec | 2022-09-30 16:54:39 -0700 | [diff] [blame] | 10766 | char* ptr; |
Protobuf Team Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 10767 | (void)upb_Encode(UPB_UPCAST(msg), &google__protobuf__MethodOptions_msg_init, options, arena, &ptr, len); |
Joshua Haberman | d3995ec | 2022-09-30 16:54:39 -0700 | [diff] [blame] | 10768 | return ptr; |
Joshua Haberman | f41049a | 2022-01-21 14:41:25 -0800 | [diff] [blame] | 10769 | } |
Mike Kruskal | 3bc5049 | 2022-12-01 13:34:12 -0800 | [diff] [blame] | 10770 | UPB_INLINE void google_protobuf_MethodOptions_clear_deprecated(google_protobuf_MethodOptions* msg) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 10771 | const upb_MiniTableField field = {33, 9, 64, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; |
Protobuf Team Bot | 4e90ead | 2024-01-08 15:46:34 +0000 | [diff] [blame] | 10772 | upb_Message_ClearBaseField(UPB_UPCAST(msg), &field); |
Joshua Haberman | d3995ec | 2022-09-30 16:54:39 -0700 | [diff] [blame] | 10773 | } |
Joshua Haberman | f41049a | 2022-01-21 14:41:25 -0800 | [diff] [blame] | 10774 | UPB_INLINE bool google_protobuf_MethodOptions_deprecated(const google_protobuf_MethodOptions* msg) { |
Eric Salo | 8809a11 | 2022-11-21 13:01:06 -0800 | [diff] [blame] | 10775 | bool default_val = false; |
| 10776 | bool ret; |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 10777 | const upb_MiniTableField field = {33, 9, 64, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; |
Protobuf Team Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 10778 | _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field, |
| 10779 | &default_val, &ret); |
Eric Salo | 8809a11 | 2022-11-21 13:01:06 -0800 | [diff] [blame] | 10780 | return ret; |
Joshua Haberman | f41049a | 2022-01-21 14:41:25 -0800 | [diff] [blame] | 10781 | } |
Mike Kruskal | 3bc5049 | 2022-12-01 13:34:12 -0800 | [diff] [blame] | 10782 | UPB_INLINE bool google_protobuf_MethodOptions_has_deprecated(const google_protobuf_MethodOptions* msg) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 10783 | const upb_MiniTableField field = {33, 9, 64, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; |
Protobuf Team Bot | 8c1f635 | 2024-01-10 05:18:15 +0000 | [diff] [blame] | 10784 | return upb_Message_HasBaseField(UPB_UPCAST(msg), &field); |
Joshua Haberman | 7ecf43f | 2022-03-14 13:11:29 -0700 | [diff] [blame] | 10785 | } |
Mike Kruskal | 3bc5049 | 2022-12-01 13:34:12 -0800 | [diff] [blame] | 10786 | UPB_INLINE void google_protobuf_MethodOptions_clear_idempotency_level(google_protobuf_MethodOptions* msg) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 10787 | const upb_MiniTableField field = {34, 12, 65, 2, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; |
Protobuf Team Bot | 4e90ead | 2024-01-08 15:46:34 +0000 | [diff] [blame] | 10788 | upb_Message_ClearBaseField(UPB_UPCAST(msg), &field); |
Joshua Haberman | d3995ec | 2022-09-30 16:54:39 -0700 | [diff] [blame] | 10789 | } |
Joshua Haberman | f41049a | 2022-01-21 14:41:25 -0800 | [diff] [blame] | 10790 | UPB_INLINE int32_t google_protobuf_MethodOptions_idempotency_level(const google_protobuf_MethodOptions* msg) { |
Eric Salo | 8809a11 | 2022-11-21 13:01:06 -0800 | [diff] [blame] | 10791 | int32_t default_val = 0; |
| 10792 | int32_t ret; |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 10793 | const upb_MiniTableField field = {34, 12, 65, 2, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; |
Protobuf Team Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 10794 | _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field, |
| 10795 | &default_val, &ret); |
Eric Salo | 8809a11 | 2022-11-21 13:01:06 -0800 | [diff] [blame] | 10796 | return ret; |
Joshua Haberman | f41049a | 2022-01-21 14:41:25 -0800 | [diff] [blame] | 10797 | } |
Mike Kruskal | 3bc5049 | 2022-12-01 13:34:12 -0800 | [diff] [blame] | 10798 | UPB_INLINE bool google_protobuf_MethodOptions_has_idempotency_level(const google_protobuf_MethodOptions* msg) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 10799 | const upb_MiniTableField field = {34, 12, 65, 2, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; |
Protobuf Team Bot | 8c1f635 | 2024-01-10 05:18:15 +0000 | [diff] [blame] | 10800 | return upb_Message_HasBaseField(UPB_UPCAST(msg), &field); |
Mike Kruskal | 4f9e417 | 2023-06-30 20:14:50 -0700 | [diff] [blame] | 10801 | } |
| 10802 | UPB_INLINE void google_protobuf_MethodOptions_clear_features(google_protobuf_MethodOptions* msg) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 10803 | 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 Bot | 4e90ead | 2024-01-08 15:46:34 +0000 | [diff] [blame] | 10804 | upb_Message_ClearBaseField(UPB_UPCAST(msg), &field); |
Mike Kruskal | 4f9e417 | 2023-06-30 20:14:50 -0700 | [diff] [blame] | 10805 | } |
| 10806 | UPB_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 Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 10809 | 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 Bot | a9387b5 | 2024-06-12 15:17:52 +0000 | [diff] [blame] | 10810 | UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__FeatureSet_msg_init); |
Protobuf Team Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 10811 | _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field, |
| 10812 | &default_val, &ret); |
Mike Kruskal | 4f9e417 | 2023-06-30 20:14:50 -0700 | [diff] [blame] | 10813 | return ret; |
| 10814 | } |
| 10815 | UPB_INLINE bool google_protobuf_MethodOptions_has_features(const google_protobuf_MethodOptions* msg) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 10816 | 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 Bot | 8c1f635 | 2024-01-10 05:18:15 +0000 | [diff] [blame] | 10817 | return upb_Message_HasBaseField(UPB_UPCAST(msg), &field); |
Joshua Haberman | d3995ec | 2022-09-30 16:54:39 -0700 | [diff] [blame] | 10818 | } |
Mike Kruskal | 3bc5049 | 2022-12-01 13:34:12 -0800 | [diff] [blame] | 10819 | UPB_INLINE void google_protobuf_MethodOptions_clear_uninterpreted_option(google_protobuf_MethodOptions* msg) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 10820 | 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 Bot | 4e90ead | 2024-01-08 15:46:34 +0000 | [diff] [blame] | 10821 | upb_Message_ClearBaseField(UPB_UPCAST(msg), &field); |
Joshua Haberman | 7ecf43f | 2022-03-14 13:11:29 -0700 | [diff] [blame] | 10822 | } |
Eric Salo | b7d54ac | 2022-12-29 11:59:42 -0800 | [diff] [blame] | 10823 | UPB_INLINE const google_protobuf_UninterpretedOption* const* google_protobuf_MethodOptions_uninterpreted_option(const google_protobuf_MethodOptions* msg, size_t* size) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 10824 | 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 Bot | a9387b5 | 2024-06-12 15:17:52 +0000 | [diff] [blame] | 10825 | UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__UninterpretedOption_msg_init); |
Protobuf Team Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 10826 | const upb_Array* arr = upb_Message_GetArray(UPB_UPCAST(msg), &field); |
Eric Salo | b7d54ac | 2022-12-29 11:59:42 -0800 | [diff] [blame] | 10827 | if (arr) { |
Protobuf Team Bot | f73985a | 2023-12-19 00:14:19 +0000 | [diff] [blame] | 10828 | if (size) *size = arr->UPB_PRIVATE(size); |
Protobuf Team Bot | 81e5433 | 2024-01-11 21:04:07 +0000 | [diff] [blame] | 10829 | return (const google_protobuf_UninterpretedOption* const*)upb_Array_DataPtr(arr); |
Eric Salo | b7d54ac | 2022-12-29 11:59:42 -0800 | [diff] [blame] | 10830 | } else { |
| 10831 | if (size) *size = 0; |
| 10832 | return NULL; |
| 10833 | } |
Joshua Haberman | 7ecf43f | 2022-03-14 13:11:29 -0700 | [diff] [blame] | 10834 | } |
Deanna Garcia | b26afb5 | 2023-04-25 13:37:18 -0700 | [diff] [blame] | 10835 | UPB_INLINE const upb_Array* _google_protobuf_MethodOptions_uninterpreted_option_upb_array(const google_protobuf_MethodOptions* msg, size_t* size) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 10836 | 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 Bot | a9387b5 | 2024-06-12 15:17:52 +0000 | [diff] [blame] | 10837 | UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__UninterpretedOption_msg_init); |
Protobuf Team Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 10838 | const upb_Array* arr = upb_Message_GetArray(UPB_UPCAST(msg), &field); |
Deanna Garcia | b26afb5 | 2023-04-25 13:37:18 -0700 | [diff] [blame] | 10839 | if (size) { |
Protobuf Team Bot | f73985a | 2023-12-19 00:14:19 +0000 | [diff] [blame] | 10840 | *size = arr ? arr->UPB_PRIVATE(size) : 0; |
Deanna Garcia | b26afb5 | 2023-04-25 13:37:18 -0700 | [diff] [blame] | 10841 | } |
| 10842 | return arr; |
| 10843 | } |
Protobuf Team Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 10844 | UPB_INLINE upb_Array* _google_protobuf_MethodOptions_uninterpreted_option_mutable_upb_array(google_protobuf_MethodOptions* msg, size_t* size, upb_Arena* arena) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 10845 | 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 Bot | a9387b5 | 2024-06-12 15:17:52 +0000 | [diff] [blame] | 10846 | UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__UninterpretedOption_msg_init); |
Protobuf Team Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 10847 | upb_Array* arr = upb_Message_GetOrCreateMutableArray(UPB_UPCAST(msg), |
| 10848 | &field, arena); |
Deanna Garcia | b26afb5 | 2023-04-25 13:37:18 -0700 | [diff] [blame] | 10849 | if (size) { |
Protobuf Team Bot | f73985a | 2023-12-19 00:14:19 +0000 | [diff] [blame] | 10850 | *size = arr ? arr->UPB_PRIVATE(size) : 0; |
Deanna Garcia | b26afb5 | 2023-04-25 13:37:18 -0700 | [diff] [blame] | 10851 | } |
| 10852 | return arr; |
| 10853 | } |
Joshua Haberman | 9abf6e2 | 2021-01-13 12:16:25 -0800 | [diff] [blame] | 10854 | |
| 10855 | UPB_INLINE void google_protobuf_MethodOptions_set_deprecated(google_protobuf_MethodOptions *msg, bool value) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 10856 | const upb_MiniTableField field = {33, 9, 64, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; |
Protobuf Team Bot | ac32c97 | 2024-04-10 03:30:05 +0000 | [diff] [blame] | 10857 | upb_Message_SetBaseField((upb_Message *)msg, &field, &value); |
Mike Kruskal | 232ecf4 | 2023-01-14 00:09:40 -0800 | [diff] [blame] | 10858 | } |
| 10859 | UPB_INLINE void google_protobuf_MethodOptions_set_idempotency_level(google_protobuf_MethodOptions *msg, int32_t value) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 10860 | const upb_MiniTableField field = {34, 12, 65, 2, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; |
Protobuf Team Bot | ac32c97 | 2024-04-10 03:30:05 +0000 | [diff] [blame] | 10861 | upb_Message_SetBaseField((upb_Message *)msg, &field, &value); |
Mike Kruskal | 232ecf4 | 2023-01-14 00:09:40 -0800 | [diff] [blame] | 10862 | } |
Mike Kruskal | 4f9e417 | 2023-06-30 20:14:50 -0700 | [diff] [blame] | 10863 | UPB_INLINE void google_protobuf_MethodOptions_set_features(google_protobuf_MethodOptions *msg, google_protobuf_FeatureSet* value) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 10864 | 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 Bot | a9387b5 | 2024-06-12 15:17:52 +0000 | [diff] [blame] | 10865 | UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__FeatureSet_msg_init); |
Protobuf Team Bot | ac32c97 | 2024-04-10 03:30:05 +0000 | [diff] [blame] | 10866 | upb_Message_SetBaseField((upb_Message *)msg, &field, &value); |
Mike Kruskal | 4f9e417 | 2023-06-30 20:14:50 -0700 | [diff] [blame] | 10867 | } |
| 10868 | UPB_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 Bot | 4ffe086 | 2023-12-06 02:02:36 +0000 | [diff] [blame] | 10871 | sub = (struct google_protobuf_FeatureSet*)_upb_Message_New(&google__protobuf__FeatureSet_msg_init, arena); |
Mike Kruskal | 4f9e417 | 2023-06-30 20:14:50 -0700 | [diff] [blame] | 10872 | if (sub) google_protobuf_MethodOptions_set_features(msg, sub); |
| 10873 | } |
| 10874 | return sub; |
| 10875 | } |
Mike Kruskal | 232ecf4 | 2023-01-14 00:09:40 -0800 | [diff] [blame] | 10876 | UPB_INLINE google_protobuf_UninterpretedOption** google_protobuf_MethodOptions_mutable_uninterpreted_option(google_protobuf_MethodOptions* msg, size_t* size) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 10877 | 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 Bot | a9387b5 | 2024-06-12 15:17:52 +0000 | [diff] [blame] | 10878 | UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__UninterpretedOption_msg_init); |
Protobuf Team Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 10879 | upb_Array* arr = upb_Message_GetMutableArray(UPB_UPCAST(msg), &field); |
Eric Salo | b7d54ac | 2022-12-29 11:59:42 -0800 | [diff] [blame] | 10880 | if (arr) { |
Protobuf Team Bot | f73985a | 2023-12-19 00:14:19 +0000 | [diff] [blame] | 10881 | if (size) *size = arr->UPB_PRIVATE(size); |
Protobuf Team Bot | 81e5433 | 2024-01-11 21:04:07 +0000 | [diff] [blame] | 10882 | return (google_protobuf_UninterpretedOption**)upb_Array_MutableDataPtr(arr); |
Eric Salo | b7d54ac | 2022-12-29 11:59:42 -0800 | [diff] [blame] | 10883 | } else { |
| 10884 | if (size) *size = 0; |
| 10885 | return NULL; |
| 10886 | } |
Joshua Haberman | 9abf6e2 | 2021-01-13 12:16:25 -0800 | [diff] [blame] | 10887 | } |
Eric Salo | b7d54ac | 2022-12-29 11:59:42 -0800 | [diff] [blame] | 10888 | UPB_INLINE google_protobuf_UninterpretedOption** google_protobuf_MethodOptions_resize_uninterpreted_option(google_protobuf_MethodOptions* msg, size_t size, upb_Arena* arena) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 10889 | 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 Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 10890 | return (google_protobuf_UninterpretedOption**)upb_Message_ResizeArrayUninitialized(UPB_UPCAST(msg), |
| 10891 | &field, size, arena); |
Joshua Haberman | 9abf6e2 | 2021-01-13 12:16:25 -0800 | [diff] [blame] | 10892 | } |
Joshua Haberman | 7ecf43f | 2022-03-14 13:11:29 -0700 | [diff] [blame] | 10893 | UPB_INLINE struct google_protobuf_UninterpretedOption* google_protobuf_MethodOptions_add_uninterpreted_option(google_protobuf_MethodOptions* msg, upb_Arena* arena) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 10894 | 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 Bot | a9387b5 | 2024-06-12 15:17:52 +0000 | [diff] [blame] | 10895 | UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__UninterpretedOption_msg_init); |
Protobuf Team Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 10896 | upb_Array* arr = upb_Message_GetOrCreateMutableArray( |
| 10897 | UPB_UPCAST(msg), &field, arena); |
Protobuf Team Bot | 81e5433 | 2024-01-11 21:04:07 +0000 | [diff] [blame] | 10898 | if (!arr || !UPB_PRIVATE(_upb_Array_ResizeUninitialized)( |
Protobuf Team Bot | f73985a | 2023-12-19 00:14:19 +0000 | [diff] [blame] | 10899 | arr, arr->UPB_PRIVATE(size) + 1, arena)) { |
Eric Salo | b7d54ac | 2022-12-29 11:59:42 -0800 | [diff] [blame] | 10900 | return NULL; |
| 10901 | } |
Protobuf Team Bot | 4ffe086 | 2023-12-06 02:02:36 +0000 | [diff] [blame] | 10902 | struct google_protobuf_UninterpretedOption* sub = (struct google_protobuf_UninterpretedOption*)_upb_Message_New(&google__protobuf__UninterpretedOption_msg_init, arena); |
Eric Salo | b7d54ac | 2022-12-29 11:59:42 -0800 | [diff] [blame] | 10903 | if (!arr || !sub) return NULL; |
Protobuf Team Bot | f73985a | 2023-12-19 00:14:19 +0000 | [diff] [blame] | 10904 | UPB_PRIVATE(_upb_Array_Set) |
| 10905 | (arr, arr->UPB_PRIVATE(size) - 1, &sub, sizeof(sub)); |
Joshua Haberman | 9abf6e2 | 2021-01-13 12:16:25 -0800 | [diff] [blame] | 10906 | return sub; |
| 10907 | } |
| 10908 | |
| 10909 | /* google.protobuf.UninterpretedOption */ |
| 10910 | |
Joshua Haberman | f41049a | 2022-01-21 14:41:25 -0800 | [diff] [blame] | 10911 | UPB_INLINE google_protobuf_UninterpretedOption* google_protobuf_UninterpretedOption_new(upb_Arena* arena) { |
Protobuf Team Bot | 4ffe086 | 2023-12-06 02:02:36 +0000 | [diff] [blame] | 10912 | return (google_protobuf_UninterpretedOption*)_upb_Message_New(&google__protobuf__UninterpretedOption_msg_init, arena); |
Joshua Haberman | 9abf6e2 | 2021-01-13 12:16:25 -0800 | [diff] [blame] | 10913 | } |
Joshua Haberman | f41049a | 2022-01-21 14:41:25 -0800 | [diff] [blame] | 10914 | UPB_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 Haberman | 9d578a3 | 2021-08-02 15:32:01 -0700 | [diff] [blame] | 10916 | if (!ret) return NULL; |
Protobuf Team Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 10917 | if (upb_Decode(buf, size, UPB_UPCAST(ret), &google__protobuf__UninterpretedOption_msg_init, NULL, 0, arena) != |
| 10918 | kUpb_DecodeStatus_Ok) { |
Joshua Haberman | 9d578a3 | 2021-08-02 15:32:01 -0700 | [diff] [blame] | 10919 | return NULL; |
| 10920 | } |
| 10921 | return ret; |
Joshua Haberman | 9abf6e2 | 2021-01-13 12:16:25 -0800 | [diff] [blame] | 10922 | } |
Joshua Haberman | f41049a | 2022-01-21 14:41:25 -0800 | [diff] [blame] | 10923 | UPB_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 Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 10928 | if (upb_Decode(buf, size, UPB_UPCAST(ret), &google__protobuf__UninterpretedOption_msg_init, extreg, options, |
| 10929 | arena) != kUpb_DecodeStatus_Ok) { |
Joshua Haberman | f41049a | 2022-01-21 14:41:25 -0800 | [diff] [blame] | 10930 | return NULL; |
| 10931 | } |
| 10932 | return ret; |
Joshua Haberman | 9abf6e2 | 2021-01-13 12:16:25 -0800 | [diff] [blame] | 10933 | } |
Joshua Haberman | f41049a | 2022-01-21 14:41:25 -0800 | [diff] [blame] | 10934 | UPB_INLINE char* google_protobuf_UninterpretedOption_serialize(const google_protobuf_UninterpretedOption* msg, upb_Arena* arena, size_t* len) { |
Joshua Haberman | d3995ec | 2022-09-30 16:54:39 -0700 | [diff] [blame] | 10935 | char* ptr; |
Protobuf Team Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 10936 | (void)upb_Encode(UPB_UPCAST(msg), &google__protobuf__UninterpretedOption_msg_init, 0, arena, &ptr, len); |
Joshua Haberman | d3995ec | 2022-09-30 16:54:39 -0700 | [diff] [blame] | 10937 | return ptr; |
Joshua Haberman | f41049a | 2022-01-21 14:41:25 -0800 | [diff] [blame] | 10938 | } |
| 10939 | UPB_INLINE char* google_protobuf_UninterpretedOption_serialize_ex(const google_protobuf_UninterpretedOption* msg, int options, |
| 10940 | upb_Arena* arena, size_t* len) { |
Joshua Haberman | d3995ec | 2022-09-30 16:54:39 -0700 | [diff] [blame] | 10941 | char* ptr; |
Protobuf Team Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 10942 | (void)upb_Encode(UPB_UPCAST(msg), &google__protobuf__UninterpretedOption_msg_init, options, arena, &ptr, len); |
Joshua Haberman | d3995ec | 2022-09-30 16:54:39 -0700 | [diff] [blame] | 10943 | return ptr; |
Joshua Haberman | f41049a | 2022-01-21 14:41:25 -0800 | [diff] [blame] | 10944 | } |
Mike Kruskal | 3bc5049 | 2022-12-01 13:34:12 -0800 | [diff] [blame] | 10945 | UPB_INLINE void google_protobuf_UninterpretedOption_clear_name(google_protobuf_UninterpretedOption* msg) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 10946 | 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 Bot | 4e90ead | 2024-01-08 15:46:34 +0000 | [diff] [blame] | 10947 | upb_Message_ClearBaseField(UPB_UPCAST(msg), &field); |
Joshua Haberman | 7ecf43f | 2022-03-14 13:11:29 -0700 | [diff] [blame] | 10948 | } |
Eric Salo | b7d54ac | 2022-12-29 11:59:42 -0800 | [diff] [blame] | 10949 | UPB_INLINE const google_protobuf_UninterpretedOption_NamePart* const* google_protobuf_UninterpretedOption_name(const google_protobuf_UninterpretedOption* msg, size_t* size) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 10950 | 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 Bot | a9387b5 | 2024-06-12 15:17:52 +0000 | [diff] [blame] | 10951 | UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__UninterpretedOption__NamePart_msg_init); |
Protobuf Team Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 10952 | const upb_Array* arr = upb_Message_GetArray(UPB_UPCAST(msg), &field); |
Eric Salo | b7d54ac | 2022-12-29 11:59:42 -0800 | [diff] [blame] | 10953 | if (arr) { |
Protobuf Team Bot | f73985a | 2023-12-19 00:14:19 +0000 | [diff] [blame] | 10954 | if (size) *size = arr->UPB_PRIVATE(size); |
Protobuf Team Bot | 81e5433 | 2024-01-11 21:04:07 +0000 | [diff] [blame] | 10955 | return (const google_protobuf_UninterpretedOption_NamePart* const*)upb_Array_DataPtr(arr); |
Eric Salo | b7d54ac | 2022-12-29 11:59:42 -0800 | [diff] [blame] | 10956 | } else { |
| 10957 | if (size) *size = 0; |
| 10958 | return NULL; |
| 10959 | } |
Joshua Haberman | 7ecf43f | 2022-03-14 13:11:29 -0700 | [diff] [blame] | 10960 | } |
Deanna Garcia | b26afb5 | 2023-04-25 13:37:18 -0700 | [diff] [blame] | 10961 | UPB_INLINE const upb_Array* _google_protobuf_UninterpretedOption_name_upb_array(const google_protobuf_UninterpretedOption* msg, size_t* size) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 10962 | 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 Bot | a9387b5 | 2024-06-12 15:17:52 +0000 | [diff] [blame] | 10963 | UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__UninterpretedOption__NamePart_msg_init); |
Protobuf Team Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 10964 | const upb_Array* arr = upb_Message_GetArray(UPB_UPCAST(msg), &field); |
Deanna Garcia | b26afb5 | 2023-04-25 13:37:18 -0700 | [diff] [blame] | 10965 | if (size) { |
Protobuf Team Bot | f73985a | 2023-12-19 00:14:19 +0000 | [diff] [blame] | 10966 | *size = arr ? arr->UPB_PRIVATE(size) : 0; |
Deanna Garcia | b26afb5 | 2023-04-25 13:37:18 -0700 | [diff] [blame] | 10967 | } |
| 10968 | return arr; |
| 10969 | } |
Protobuf Team Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 10970 | UPB_INLINE upb_Array* _google_protobuf_UninterpretedOption_name_mutable_upb_array(google_protobuf_UninterpretedOption* msg, size_t* size, upb_Arena* arena) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 10971 | 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 Bot | a9387b5 | 2024-06-12 15:17:52 +0000 | [diff] [blame] | 10972 | UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__UninterpretedOption__NamePart_msg_init); |
Protobuf Team Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 10973 | upb_Array* arr = upb_Message_GetOrCreateMutableArray(UPB_UPCAST(msg), |
| 10974 | &field, arena); |
Deanna Garcia | b26afb5 | 2023-04-25 13:37:18 -0700 | [diff] [blame] | 10975 | if (size) { |
Protobuf Team Bot | f73985a | 2023-12-19 00:14:19 +0000 | [diff] [blame] | 10976 | *size = arr ? arr->UPB_PRIVATE(size) : 0; |
Deanna Garcia | b26afb5 | 2023-04-25 13:37:18 -0700 | [diff] [blame] | 10977 | } |
| 10978 | return arr; |
| 10979 | } |
Mike Kruskal | 3bc5049 | 2022-12-01 13:34:12 -0800 | [diff] [blame] | 10980 | UPB_INLINE void google_protobuf_UninterpretedOption_clear_identifier_value(google_protobuf_UninterpretedOption* msg) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 10981 | 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 Bot | 4e90ead | 2024-01-08 15:46:34 +0000 | [diff] [blame] | 10982 | upb_Message_ClearBaseField(UPB_UPCAST(msg), &field); |
Joshua Haberman | d3995ec | 2022-09-30 16:54:39 -0700 | [diff] [blame] | 10983 | } |
Joshua Haberman | f41049a | 2022-01-21 14:41:25 -0800 | [diff] [blame] | 10984 | UPB_INLINE upb_StringView google_protobuf_UninterpretedOption_identifier_value(const google_protobuf_UninterpretedOption* msg) { |
Eric Salo | 8809a11 | 2022-11-21 13:01:06 -0800 | [diff] [blame] | 10985 | upb_StringView default_val = upb_StringView_FromString(""); |
| 10986 | upb_StringView ret; |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 10987 | 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 Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 10988 | _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field, |
| 10989 | &default_val, &ret); |
Eric Salo | 8809a11 | 2022-11-21 13:01:06 -0800 | [diff] [blame] | 10990 | return ret; |
Joshua Haberman | f41049a | 2022-01-21 14:41:25 -0800 | [diff] [blame] | 10991 | } |
Mike Kruskal | 3bc5049 | 2022-12-01 13:34:12 -0800 | [diff] [blame] | 10992 | UPB_INLINE bool google_protobuf_UninterpretedOption_has_identifier_value(const google_protobuf_UninterpretedOption* msg) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 10993 | 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 Bot | 8c1f635 | 2024-01-10 05:18:15 +0000 | [diff] [blame] | 10994 | return upb_Message_HasBaseField(UPB_UPCAST(msg), &field); |
Joshua Haberman | 7ecf43f | 2022-03-14 13:11:29 -0700 | [diff] [blame] | 10995 | } |
Mike Kruskal | 3bc5049 | 2022-12-01 13:34:12 -0800 | [diff] [blame] | 10996 | UPB_INLINE void google_protobuf_UninterpretedOption_clear_positive_int_value(google_protobuf_UninterpretedOption* msg) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 10997 | 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 Bot | 4e90ead | 2024-01-08 15:46:34 +0000 | [diff] [blame] | 10998 | upb_Message_ClearBaseField(UPB_UPCAST(msg), &field); |
Joshua Haberman | d3995ec | 2022-09-30 16:54:39 -0700 | [diff] [blame] | 10999 | } |
Joshua Haberman | f41049a | 2022-01-21 14:41:25 -0800 | [diff] [blame] | 11000 | UPB_INLINE uint64_t google_protobuf_UninterpretedOption_positive_int_value(const google_protobuf_UninterpretedOption* msg) { |
Eric Salo | 8809a11 | 2022-11-21 13:01:06 -0800 | [diff] [blame] | 11001 | uint64_t default_val = (uint64_t)0ull; |
| 11002 | uint64_t ret; |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 11003 | 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 Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 11004 | _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field, |
| 11005 | &default_val, &ret); |
Eric Salo | 8809a11 | 2022-11-21 13:01:06 -0800 | [diff] [blame] | 11006 | return ret; |
Joshua Haberman | f41049a | 2022-01-21 14:41:25 -0800 | [diff] [blame] | 11007 | } |
Mike Kruskal | 3bc5049 | 2022-12-01 13:34:12 -0800 | [diff] [blame] | 11008 | UPB_INLINE bool google_protobuf_UninterpretedOption_has_positive_int_value(const google_protobuf_UninterpretedOption* msg) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 11009 | 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 Bot | 8c1f635 | 2024-01-10 05:18:15 +0000 | [diff] [blame] | 11010 | return upb_Message_HasBaseField(UPB_UPCAST(msg), &field); |
Joshua Haberman | 7ecf43f | 2022-03-14 13:11:29 -0700 | [diff] [blame] | 11011 | } |
Mike Kruskal | 3bc5049 | 2022-12-01 13:34:12 -0800 | [diff] [blame] | 11012 | UPB_INLINE void google_protobuf_UninterpretedOption_clear_negative_int_value(google_protobuf_UninterpretedOption* msg) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 11013 | 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 Bot | 4e90ead | 2024-01-08 15:46:34 +0000 | [diff] [blame] | 11014 | upb_Message_ClearBaseField(UPB_UPCAST(msg), &field); |
Joshua Haberman | d3995ec | 2022-09-30 16:54:39 -0700 | [diff] [blame] | 11015 | } |
Joshua Haberman | f41049a | 2022-01-21 14:41:25 -0800 | [diff] [blame] | 11016 | UPB_INLINE int64_t google_protobuf_UninterpretedOption_negative_int_value(const google_protobuf_UninterpretedOption* msg) { |
Eric Salo | 8809a11 | 2022-11-21 13:01:06 -0800 | [diff] [blame] | 11017 | int64_t default_val = (int64_t)0ll; |
| 11018 | int64_t ret; |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 11019 | 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 Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 11020 | _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field, |
| 11021 | &default_val, &ret); |
Eric Salo | 8809a11 | 2022-11-21 13:01:06 -0800 | [diff] [blame] | 11022 | return ret; |
Joshua Haberman | f41049a | 2022-01-21 14:41:25 -0800 | [diff] [blame] | 11023 | } |
Mike Kruskal | 3bc5049 | 2022-12-01 13:34:12 -0800 | [diff] [blame] | 11024 | UPB_INLINE bool google_protobuf_UninterpretedOption_has_negative_int_value(const google_protobuf_UninterpretedOption* msg) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 11025 | 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 Bot | 8c1f635 | 2024-01-10 05:18:15 +0000 | [diff] [blame] | 11026 | return upb_Message_HasBaseField(UPB_UPCAST(msg), &field); |
Joshua Haberman | 7ecf43f | 2022-03-14 13:11:29 -0700 | [diff] [blame] | 11027 | } |
Mike Kruskal | 3bc5049 | 2022-12-01 13:34:12 -0800 | [diff] [blame] | 11028 | UPB_INLINE void google_protobuf_UninterpretedOption_clear_double_value(google_protobuf_UninterpretedOption* msg) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 11029 | 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 Bot | 4e90ead | 2024-01-08 15:46:34 +0000 | [diff] [blame] | 11030 | upb_Message_ClearBaseField(UPB_UPCAST(msg), &field); |
Joshua Haberman | d3995ec | 2022-09-30 16:54:39 -0700 | [diff] [blame] | 11031 | } |
Joshua Haberman | f41049a | 2022-01-21 14:41:25 -0800 | [diff] [blame] | 11032 | UPB_INLINE double google_protobuf_UninterpretedOption_double_value(const google_protobuf_UninterpretedOption* msg) { |
Eric Salo | 8809a11 | 2022-11-21 13:01:06 -0800 | [diff] [blame] | 11033 | double default_val = 0; |
| 11034 | double ret; |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 11035 | 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 Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 11036 | _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field, |
| 11037 | &default_val, &ret); |
Eric Salo | 8809a11 | 2022-11-21 13:01:06 -0800 | [diff] [blame] | 11038 | return ret; |
Joshua Haberman | f41049a | 2022-01-21 14:41:25 -0800 | [diff] [blame] | 11039 | } |
Mike Kruskal | 3bc5049 | 2022-12-01 13:34:12 -0800 | [diff] [blame] | 11040 | UPB_INLINE bool google_protobuf_UninterpretedOption_has_double_value(const google_protobuf_UninterpretedOption* msg) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 11041 | 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 Bot | 8c1f635 | 2024-01-10 05:18:15 +0000 | [diff] [blame] | 11042 | return upb_Message_HasBaseField(UPB_UPCAST(msg), &field); |
Joshua Haberman | 7ecf43f | 2022-03-14 13:11:29 -0700 | [diff] [blame] | 11043 | } |
Mike Kruskal | 3bc5049 | 2022-12-01 13:34:12 -0800 | [diff] [blame] | 11044 | UPB_INLINE void google_protobuf_UninterpretedOption_clear_string_value(google_protobuf_UninterpretedOption* msg) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 11045 | 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 Bot | 4e90ead | 2024-01-08 15:46:34 +0000 | [diff] [blame] | 11046 | upb_Message_ClearBaseField(UPB_UPCAST(msg), &field); |
Joshua Haberman | d3995ec | 2022-09-30 16:54:39 -0700 | [diff] [blame] | 11047 | } |
Joshua Haberman | f41049a | 2022-01-21 14:41:25 -0800 | [diff] [blame] | 11048 | UPB_INLINE upb_StringView google_protobuf_UninterpretedOption_string_value(const google_protobuf_UninterpretedOption* msg) { |
Eric Salo | 8809a11 | 2022-11-21 13:01:06 -0800 | [diff] [blame] | 11049 | upb_StringView default_val = upb_StringView_FromString(""); |
| 11050 | upb_StringView ret; |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 11051 | 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 Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 11052 | _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field, |
| 11053 | &default_val, &ret); |
Eric Salo | 8809a11 | 2022-11-21 13:01:06 -0800 | [diff] [blame] | 11054 | return ret; |
Joshua Haberman | f41049a | 2022-01-21 14:41:25 -0800 | [diff] [blame] | 11055 | } |
Mike Kruskal | 3bc5049 | 2022-12-01 13:34:12 -0800 | [diff] [blame] | 11056 | UPB_INLINE bool google_protobuf_UninterpretedOption_has_string_value(const google_protobuf_UninterpretedOption* msg) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 11057 | 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 Bot | 8c1f635 | 2024-01-10 05:18:15 +0000 | [diff] [blame] | 11058 | return upb_Message_HasBaseField(UPB_UPCAST(msg), &field); |
Joshua Haberman | 7ecf43f | 2022-03-14 13:11:29 -0700 | [diff] [blame] | 11059 | } |
Mike Kruskal | 3bc5049 | 2022-12-01 13:34:12 -0800 | [diff] [blame] | 11060 | UPB_INLINE void google_protobuf_UninterpretedOption_clear_aggregate_value(google_protobuf_UninterpretedOption* msg) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 11061 | 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 Bot | 4e90ead | 2024-01-08 15:46:34 +0000 | [diff] [blame] | 11062 | upb_Message_ClearBaseField(UPB_UPCAST(msg), &field); |
Joshua Haberman | d3995ec | 2022-09-30 16:54:39 -0700 | [diff] [blame] | 11063 | } |
Joshua Haberman | f41049a | 2022-01-21 14:41:25 -0800 | [diff] [blame] | 11064 | UPB_INLINE upb_StringView google_protobuf_UninterpretedOption_aggregate_value(const google_protobuf_UninterpretedOption* msg) { |
Eric Salo | 8809a11 | 2022-11-21 13:01:06 -0800 | [diff] [blame] | 11065 | upb_StringView default_val = upb_StringView_FromString(""); |
| 11066 | upb_StringView ret; |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 11067 | 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 Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 11068 | _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field, |
| 11069 | &default_val, &ret); |
Eric Salo | 8809a11 | 2022-11-21 13:01:06 -0800 | [diff] [blame] | 11070 | return ret; |
Joshua Haberman | f41049a | 2022-01-21 14:41:25 -0800 | [diff] [blame] | 11071 | } |
Mike Kruskal | 3bc5049 | 2022-12-01 13:34:12 -0800 | [diff] [blame] | 11072 | UPB_INLINE bool google_protobuf_UninterpretedOption_has_aggregate_value(const google_protobuf_UninterpretedOption* msg) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 11073 | 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 Bot | 8c1f635 | 2024-01-10 05:18:15 +0000 | [diff] [blame] | 11074 | return upb_Message_HasBaseField(UPB_UPCAST(msg), &field); |
Mike Kruskal | 3bc5049 | 2022-12-01 13:34:12 -0800 | [diff] [blame] | 11075 | } |
Joshua Haberman | 9abf6e2 | 2021-01-13 12:16:25 -0800 | [diff] [blame] | 11076 | |
Eric Salo | b7d54ac | 2022-12-29 11:59:42 -0800 | [diff] [blame] | 11077 | UPB_INLINE google_protobuf_UninterpretedOption_NamePart** google_protobuf_UninterpretedOption_mutable_name(google_protobuf_UninterpretedOption* msg, size_t* size) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 11078 | 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 Bot | a9387b5 | 2024-06-12 15:17:52 +0000 | [diff] [blame] | 11079 | UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__UninterpretedOption__NamePart_msg_init); |
Protobuf Team Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 11080 | upb_Array* arr = upb_Message_GetMutableArray(UPB_UPCAST(msg), &field); |
Eric Salo | b7d54ac | 2022-12-29 11:59:42 -0800 | [diff] [blame] | 11081 | if (arr) { |
Protobuf Team Bot | f73985a | 2023-12-19 00:14:19 +0000 | [diff] [blame] | 11082 | if (size) *size = arr->UPB_PRIVATE(size); |
Protobuf Team Bot | 81e5433 | 2024-01-11 21:04:07 +0000 | [diff] [blame] | 11083 | return (google_protobuf_UninterpretedOption_NamePart**)upb_Array_MutableDataPtr(arr); |
Eric Salo | b7d54ac | 2022-12-29 11:59:42 -0800 | [diff] [blame] | 11084 | } else { |
| 11085 | if (size) *size = 0; |
| 11086 | return NULL; |
| 11087 | } |
Joshua Haberman | 9abf6e2 | 2021-01-13 12:16:25 -0800 | [diff] [blame] | 11088 | } |
Eric Salo | b7d54ac | 2022-12-29 11:59:42 -0800 | [diff] [blame] | 11089 | UPB_INLINE google_protobuf_UninterpretedOption_NamePart** google_protobuf_UninterpretedOption_resize_name(google_protobuf_UninterpretedOption* msg, size_t size, upb_Arena* arena) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 11090 | 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 Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 11091 | return (google_protobuf_UninterpretedOption_NamePart**)upb_Message_ResizeArrayUninitialized(UPB_UPCAST(msg), |
| 11092 | &field, size, arena); |
Joshua Haberman | 9abf6e2 | 2021-01-13 12:16:25 -0800 | [diff] [blame] | 11093 | } |
Joshua Haberman | 7ecf43f | 2022-03-14 13:11:29 -0700 | [diff] [blame] | 11094 | UPB_INLINE struct google_protobuf_UninterpretedOption_NamePart* google_protobuf_UninterpretedOption_add_name(google_protobuf_UninterpretedOption* msg, upb_Arena* arena) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 11095 | 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 Bot | a9387b5 | 2024-06-12 15:17:52 +0000 | [diff] [blame] | 11096 | UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__UninterpretedOption__NamePart_msg_init); |
Protobuf Team Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 11097 | upb_Array* arr = upb_Message_GetOrCreateMutableArray( |
| 11098 | UPB_UPCAST(msg), &field, arena); |
Protobuf Team Bot | 81e5433 | 2024-01-11 21:04:07 +0000 | [diff] [blame] | 11099 | if (!arr || !UPB_PRIVATE(_upb_Array_ResizeUninitialized)( |
Protobuf Team Bot | f73985a | 2023-12-19 00:14:19 +0000 | [diff] [blame] | 11100 | arr, arr->UPB_PRIVATE(size) + 1, arena)) { |
Eric Salo | b7d54ac | 2022-12-29 11:59:42 -0800 | [diff] [blame] | 11101 | return NULL; |
| 11102 | } |
Protobuf Team Bot | 4ffe086 | 2023-12-06 02:02:36 +0000 | [diff] [blame] | 11103 | struct google_protobuf_UninterpretedOption_NamePart* sub = (struct google_protobuf_UninterpretedOption_NamePart*)_upb_Message_New(&google__protobuf__UninterpretedOption__NamePart_msg_init, arena); |
Eric Salo | b7d54ac | 2022-12-29 11:59:42 -0800 | [diff] [blame] | 11104 | if (!arr || !sub) return NULL; |
Protobuf Team Bot | f73985a | 2023-12-19 00:14:19 +0000 | [diff] [blame] | 11105 | UPB_PRIVATE(_upb_Array_Set) |
| 11106 | (arr, arr->UPB_PRIVATE(size) - 1, &sub, sizeof(sub)); |
Joshua Haberman | 9abf6e2 | 2021-01-13 12:16:25 -0800 | [diff] [blame] | 11107 | return sub; |
| 11108 | } |
Joshua Haberman | f41049a | 2022-01-21 14:41:25 -0800 | [diff] [blame] | 11109 | UPB_INLINE void google_protobuf_UninterpretedOption_set_identifier_value(google_protobuf_UninterpretedOption *msg, upb_StringView value) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 11110 | 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 Bot | ac32c97 | 2024-04-10 03:30:05 +0000 | [diff] [blame] | 11111 | upb_Message_SetBaseField((upb_Message *)msg, &field, &value); |
Mike Kruskal | 232ecf4 | 2023-01-14 00:09:40 -0800 | [diff] [blame] | 11112 | } |
| 11113 | UPB_INLINE void google_protobuf_UninterpretedOption_set_positive_int_value(google_protobuf_UninterpretedOption *msg, uint64_t value) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 11114 | 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 Bot | ac32c97 | 2024-04-10 03:30:05 +0000 | [diff] [blame] | 11115 | upb_Message_SetBaseField((upb_Message *)msg, &field, &value); |
Mike Kruskal | 232ecf4 | 2023-01-14 00:09:40 -0800 | [diff] [blame] | 11116 | } |
| 11117 | UPB_INLINE void google_protobuf_UninterpretedOption_set_negative_int_value(google_protobuf_UninterpretedOption *msg, int64_t value) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 11118 | 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 Bot | ac32c97 | 2024-04-10 03:30:05 +0000 | [diff] [blame] | 11119 | upb_Message_SetBaseField((upb_Message *)msg, &field, &value); |
Mike Kruskal | 232ecf4 | 2023-01-14 00:09:40 -0800 | [diff] [blame] | 11120 | } |
| 11121 | UPB_INLINE void google_protobuf_UninterpretedOption_set_double_value(google_protobuf_UninterpretedOption *msg, double value) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 11122 | 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 Bot | ac32c97 | 2024-04-10 03:30:05 +0000 | [diff] [blame] | 11123 | upb_Message_SetBaseField((upb_Message *)msg, &field, &value); |
Mike Kruskal | 232ecf4 | 2023-01-14 00:09:40 -0800 | [diff] [blame] | 11124 | } |
| 11125 | UPB_INLINE void google_protobuf_UninterpretedOption_set_string_value(google_protobuf_UninterpretedOption *msg, upb_StringView value) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 11126 | 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 Bot | ac32c97 | 2024-04-10 03:30:05 +0000 | [diff] [blame] | 11127 | upb_Message_SetBaseField((upb_Message *)msg, &field, &value); |
Mike Kruskal | 232ecf4 | 2023-01-14 00:09:40 -0800 | [diff] [blame] | 11128 | } |
| 11129 | UPB_INLINE void google_protobuf_UninterpretedOption_set_aggregate_value(google_protobuf_UninterpretedOption *msg, upb_StringView value) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 11130 | 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 Bot | ac32c97 | 2024-04-10 03:30:05 +0000 | [diff] [blame] | 11131 | upb_Message_SetBaseField((upb_Message *)msg, &field, &value); |
Joshua Haberman | 9abf6e2 | 2021-01-13 12:16:25 -0800 | [diff] [blame] | 11132 | } |
Mike Kruskal | 232ecf4 | 2023-01-14 00:09:40 -0800 | [diff] [blame] | 11133 | |
Joshua Haberman | 9abf6e2 | 2021-01-13 12:16:25 -0800 | [diff] [blame] | 11134 | /* google.protobuf.UninterpretedOption.NamePart */ |
| 11135 | |
Joshua Haberman | f41049a | 2022-01-21 14:41:25 -0800 | [diff] [blame] | 11136 | UPB_INLINE google_protobuf_UninterpretedOption_NamePart* google_protobuf_UninterpretedOption_NamePart_new(upb_Arena* arena) { |
Protobuf Team Bot | 4ffe086 | 2023-12-06 02:02:36 +0000 | [diff] [blame] | 11137 | return (google_protobuf_UninterpretedOption_NamePart*)_upb_Message_New(&google__protobuf__UninterpretedOption__NamePart_msg_init, arena); |
Joshua Haberman | 9abf6e2 | 2021-01-13 12:16:25 -0800 | [diff] [blame] | 11138 | } |
Joshua Haberman | f41049a | 2022-01-21 14:41:25 -0800 | [diff] [blame] | 11139 | UPB_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 Haberman | 9d578a3 | 2021-08-02 15:32:01 -0700 | [diff] [blame] | 11141 | if (!ret) return NULL; |
Protobuf Team Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 11142 | if (upb_Decode(buf, size, UPB_UPCAST(ret), &google__protobuf__UninterpretedOption__NamePart_msg_init, NULL, 0, arena) != |
| 11143 | kUpb_DecodeStatus_Ok) { |
Joshua Haberman | 9d578a3 | 2021-08-02 15:32:01 -0700 | [diff] [blame] | 11144 | return NULL; |
| 11145 | } |
| 11146 | return ret; |
Joshua Haberman | 9abf6e2 | 2021-01-13 12:16:25 -0800 | [diff] [blame] | 11147 | } |
Joshua Haberman | f41049a | 2022-01-21 14:41:25 -0800 | [diff] [blame] | 11148 | UPB_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 Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 11153 | if (upb_Decode(buf, size, UPB_UPCAST(ret), &google__protobuf__UninterpretedOption__NamePart_msg_init, extreg, options, |
| 11154 | arena) != kUpb_DecodeStatus_Ok) { |
Joshua Haberman | f41049a | 2022-01-21 14:41:25 -0800 | [diff] [blame] | 11155 | return NULL; |
| 11156 | } |
| 11157 | return ret; |
| 11158 | } |
| 11159 | UPB_INLINE char* google_protobuf_UninterpretedOption_NamePart_serialize(const google_protobuf_UninterpretedOption_NamePart* msg, upb_Arena* arena, size_t* len) { |
Joshua Haberman | d3995ec | 2022-09-30 16:54:39 -0700 | [diff] [blame] | 11160 | char* ptr; |
Protobuf Team Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 11161 | (void)upb_Encode(UPB_UPCAST(msg), &google__protobuf__UninterpretedOption__NamePart_msg_init, 0, arena, &ptr, len); |
Joshua Haberman | d3995ec | 2022-09-30 16:54:39 -0700 | [diff] [blame] | 11162 | return ptr; |
Joshua Haberman | f41049a | 2022-01-21 14:41:25 -0800 | [diff] [blame] | 11163 | } |
| 11164 | UPB_INLINE char* google_protobuf_UninterpretedOption_NamePart_serialize_ex(const google_protobuf_UninterpretedOption_NamePart* msg, int options, |
| 11165 | upb_Arena* arena, size_t* len) { |
Joshua Haberman | d3995ec | 2022-09-30 16:54:39 -0700 | [diff] [blame] | 11166 | char* ptr; |
Protobuf Team Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 11167 | (void)upb_Encode(UPB_UPCAST(msg), &google__protobuf__UninterpretedOption__NamePart_msg_init, options, arena, &ptr, len); |
Joshua Haberman | d3995ec | 2022-09-30 16:54:39 -0700 | [diff] [blame] | 11168 | return ptr; |
Joshua Haberman | f41049a | 2022-01-21 14:41:25 -0800 | [diff] [blame] | 11169 | } |
Mike Kruskal | 3bc5049 | 2022-12-01 13:34:12 -0800 | [diff] [blame] | 11170 | UPB_INLINE void google_protobuf_UninterpretedOption_NamePart_clear_name_part(google_protobuf_UninterpretedOption_NamePart* msg) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 11171 | 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 Bot | 4e90ead | 2024-01-08 15:46:34 +0000 | [diff] [blame] | 11172 | upb_Message_ClearBaseField(UPB_UPCAST(msg), &field); |
Joshua Haberman | d3995ec | 2022-09-30 16:54:39 -0700 | [diff] [blame] | 11173 | } |
Joshua Haberman | f41049a | 2022-01-21 14:41:25 -0800 | [diff] [blame] | 11174 | UPB_INLINE upb_StringView google_protobuf_UninterpretedOption_NamePart_name_part(const google_protobuf_UninterpretedOption_NamePart* msg) { |
Eric Salo | 8809a11 | 2022-11-21 13:01:06 -0800 | [diff] [blame] | 11175 | upb_StringView default_val = upb_StringView_FromString(""); |
| 11176 | upb_StringView ret; |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 11177 | 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 Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 11178 | _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field, |
| 11179 | &default_val, &ret); |
Eric Salo | 8809a11 | 2022-11-21 13:01:06 -0800 | [diff] [blame] | 11180 | return ret; |
Joshua Haberman | f41049a | 2022-01-21 14:41:25 -0800 | [diff] [blame] | 11181 | } |
Mike Kruskal | 3bc5049 | 2022-12-01 13:34:12 -0800 | [diff] [blame] | 11182 | UPB_INLINE bool google_protobuf_UninterpretedOption_NamePart_has_name_part(const google_protobuf_UninterpretedOption_NamePart* msg) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 11183 | 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 Bot | 8c1f635 | 2024-01-10 05:18:15 +0000 | [diff] [blame] | 11184 | return upb_Message_HasBaseField(UPB_UPCAST(msg), &field); |
Joshua Haberman | 7ecf43f | 2022-03-14 13:11:29 -0700 | [diff] [blame] | 11185 | } |
Mike Kruskal | 3bc5049 | 2022-12-01 13:34:12 -0800 | [diff] [blame] | 11186 | UPB_INLINE void google_protobuf_UninterpretedOption_NamePart_clear_is_extension(google_protobuf_UninterpretedOption_NamePart* msg) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 11187 | const upb_MiniTableField field = {2, 9, 65, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; |
Protobuf Team Bot | 4e90ead | 2024-01-08 15:46:34 +0000 | [diff] [blame] | 11188 | upb_Message_ClearBaseField(UPB_UPCAST(msg), &field); |
Joshua Haberman | d3995ec | 2022-09-30 16:54:39 -0700 | [diff] [blame] | 11189 | } |
Joshua Haberman | f41049a | 2022-01-21 14:41:25 -0800 | [diff] [blame] | 11190 | UPB_INLINE bool google_protobuf_UninterpretedOption_NamePart_is_extension(const google_protobuf_UninterpretedOption_NamePart* msg) { |
Eric Salo | 8809a11 | 2022-11-21 13:01:06 -0800 | [diff] [blame] | 11191 | bool default_val = false; |
| 11192 | bool ret; |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 11193 | const upb_MiniTableField field = {2, 9, 65, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; |
Protobuf Team Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 11194 | _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field, |
| 11195 | &default_val, &ret); |
Eric Salo | 8809a11 | 2022-11-21 13:01:06 -0800 | [diff] [blame] | 11196 | return ret; |
Joshua Haberman | 9abf6e2 | 2021-01-13 12:16:25 -0800 | [diff] [blame] | 11197 | } |
Mike Kruskal | 3bc5049 | 2022-12-01 13:34:12 -0800 | [diff] [blame] | 11198 | UPB_INLINE bool google_protobuf_UninterpretedOption_NamePart_has_is_extension(const google_protobuf_UninterpretedOption_NamePart* msg) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 11199 | const upb_MiniTableField field = {2, 9, 65, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; |
Protobuf Team Bot | 8c1f635 | 2024-01-10 05:18:15 +0000 | [diff] [blame] | 11200 | return upb_Message_HasBaseField(UPB_UPCAST(msg), &field); |
Mike Kruskal | 3bc5049 | 2022-12-01 13:34:12 -0800 | [diff] [blame] | 11201 | } |
Joshua Haberman | 9abf6e2 | 2021-01-13 12:16:25 -0800 | [diff] [blame] | 11202 | |
Joshua Haberman | f41049a | 2022-01-21 14:41:25 -0800 | [diff] [blame] | 11203 | UPB_INLINE void google_protobuf_UninterpretedOption_NamePart_set_name_part(google_protobuf_UninterpretedOption_NamePart *msg, upb_StringView value) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 11204 | 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 Bot | ac32c97 | 2024-04-10 03:30:05 +0000 | [diff] [blame] | 11205 | upb_Message_SetBaseField((upb_Message *)msg, &field, &value); |
Mike Kruskal | 232ecf4 | 2023-01-14 00:09:40 -0800 | [diff] [blame] | 11206 | } |
| 11207 | UPB_INLINE void google_protobuf_UninterpretedOption_NamePart_set_is_extension(google_protobuf_UninterpretedOption_NamePart *msg, bool value) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 11208 | const upb_MiniTableField field = {2, 9, 65, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; |
Protobuf Team Bot | ac32c97 | 2024-04-10 03:30:05 +0000 | [diff] [blame] | 11209 | upb_Message_SetBaseField((upb_Message *)msg, &field, &value); |
Joshua Haberman | 9abf6e2 | 2021-01-13 12:16:25 -0800 | [diff] [blame] | 11210 | } |
Mike Kruskal | 232ecf4 | 2023-01-14 00:09:40 -0800 | [diff] [blame] | 11211 | |
Mike Kruskal | 4f9e417 | 2023-06-30 20:14:50 -0700 | [diff] [blame] | 11212 | /* google.protobuf.FeatureSet */ |
| 11213 | |
| 11214 | UPB_INLINE google_protobuf_FeatureSet* google_protobuf_FeatureSet_new(upb_Arena* arena) { |
Protobuf Team Bot | 4ffe086 | 2023-12-06 02:02:36 +0000 | [diff] [blame] | 11215 | return (google_protobuf_FeatureSet*)_upb_Message_New(&google__protobuf__FeatureSet_msg_init, arena); |
Mike Kruskal | 4f9e417 | 2023-06-30 20:14:50 -0700 | [diff] [blame] | 11216 | } |
| 11217 | UPB_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 Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 11220 | if (upb_Decode(buf, size, UPB_UPCAST(ret), &google__protobuf__FeatureSet_msg_init, NULL, 0, arena) != |
| 11221 | kUpb_DecodeStatus_Ok) { |
Mike Kruskal | 4f9e417 | 2023-06-30 20:14:50 -0700 | [diff] [blame] | 11222 | return NULL; |
| 11223 | } |
| 11224 | return ret; |
| 11225 | } |
| 11226 | UPB_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 Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 11231 | if (upb_Decode(buf, size, UPB_UPCAST(ret), &google__protobuf__FeatureSet_msg_init, extreg, options, |
| 11232 | arena) != kUpb_DecodeStatus_Ok) { |
Mike Kruskal | 4f9e417 | 2023-06-30 20:14:50 -0700 | [diff] [blame] | 11233 | return NULL; |
| 11234 | } |
| 11235 | return ret; |
| 11236 | } |
| 11237 | UPB_INLINE char* google_protobuf_FeatureSet_serialize(const google_protobuf_FeatureSet* msg, upb_Arena* arena, size_t* len) { |
| 11238 | char* ptr; |
Protobuf Team Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 11239 | (void)upb_Encode(UPB_UPCAST(msg), &google__protobuf__FeatureSet_msg_init, 0, arena, &ptr, len); |
Mike Kruskal | 4f9e417 | 2023-06-30 20:14:50 -0700 | [diff] [blame] | 11240 | return ptr; |
| 11241 | } |
| 11242 | UPB_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 Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 11245 | (void)upb_Encode(UPB_UPCAST(msg), &google__protobuf__FeatureSet_msg_init, options, arena, &ptr, len); |
Mike Kruskal | 4f9e417 | 2023-06-30 20:14:50 -0700 | [diff] [blame] | 11246 | return ptr; |
| 11247 | } |
| 11248 | UPB_INLINE void google_protobuf_FeatureSet_clear_field_presence(google_protobuf_FeatureSet* msg) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 11249 | const upb_MiniTableField field = {1, 12, 64, 0, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; |
Protobuf Team Bot | 4e90ead | 2024-01-08 15:46:34 +0000 | [diff] [blame] | 11250 | upb_Message_ClearBaseField(UPB_UPCAST(msg), &field); |
Mike Kruskal | 4f9e417 | 2023-06-30 20:14:50 -0700 | [diff] [blame] | 11251 | } |
| 11252 | UPB_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 Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 11255 | const upb_MiniTableField field = {1, 12, 64, 0, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; |
Protobuf Team Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 11256 | _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field, |
| 11257 | &default_val, &ret); |
Mike Kruskal | 4f9e417 | 2023-06-30 20:14:50 -0700 | [diff] [blame] | 11258 | return ret; |
| 11259 | } |
| 11260 | UPB_INLINE bool google_protobuf_FeatureSet_has_field_presence(const google_protobuf_FeatureSet* msg) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 11261 | const upb_MiniTableField field = {1, 12, 64, 0, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; |
Protobuf Team Bot | 8c1f635 | 2024-01-10 05:18:15 +0000 | [diff] [blame] | 11262 | return upb_Message_HasBaseField(UPB_UPCAST(msg), &field); |
Mike Kruskal | 4f9e417 | 2023-06-30 20:14:50 -0700 | [diff] [blame] | 11263 | } |
| 11264 | UPB_INLINE void google_protobuf_FeatureSet_clear_enum_type(google_protobuf_FeatureSet* msg) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 11265 | const upb_MiniTableField field = {2, 16, 65, 1, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; |
Protobuf Team Bot | 4e90ead | 2024-01-08 15:46:34 +0000 | [diff] [blame] | 11266 | upb_Message_ClearBaseField(UPB_UPCAST(msg), &field); |
Mike Kruskal | 4f9e417 | 2023-06-30 20:14:50 -0700 | [diff] [blame] | 11267 | } |
| 11268 | UPB_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 Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 11271 | const upb_MiniTableField field = {2, 16, 65, 1, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; |
Protobuf Team Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 11272 | _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field, |
| 11273 | &default_val, &ret); |
Mike Kruskal | 4f9e417 | 2023-06-30 20:14:50 -0700 | [diff] [blame] | 11274 | return ret; |
| 11275 | } |
| 11276 | UPB_INLINE bool google_protobuf_FeatureSet_has_enum_type(const google_protobuf_FeatureSet* msg) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 11277 | const upb_MiniTableField field = {2, 16, 65, 1, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; |
Protobuf Team Bot | 8c1f635 | 2024-01-10 05:18:15 +0000 | [diff] [blame] | 11278 | return upb_Message_HasBaseField(UPB_UPCAST(msg), &field); |
Mike Kruskal | 4f9e417 | 2023-06-30 20:14:50 -0700 | [diff] [blame] | 11279 | } |
| 11280 | UPB_INLINE void google_protobuf_FeatureSet_clear_repeated_field_encoding(google_protobuf_FeatureSet* msg) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 11281 | const upb_MiniTableField field = {3, 20, 66, 2, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; |
Protobuf Team Bot | 4e90ead | 2024-01-08 15:46:34 +0000 | [diff] [blame] | 11282 | upb_Message_ClearBaseField(UPB_UPCAST(msg), &field); |
Mike Kruskal | 4f9e417 | 2023-06-30 20:14:50 -0700 | [diff] [blame] | 11283 | } |
| 11284 | UPB_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 Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 11287 | const upb_MiniTableField field = {3, 20, 66, 2, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; |
Protobuf Team Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 11288 | _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field, |
| 11289 | &default_val, &ret); |
Mike Kruskal | 4f9e417 | 2023-06-30 20:14:50 -0700 | [diff] [blame] | 11290 | return ret; |
| 11291 | } |
| 11292 | UPB_INLINE bool google_protobuf_FeatureSet_has_repeated_field_encoding(const google_protobuf_FeatureSet* msg) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 11293 | const upb_MiniTableField field = {3, 20, 66, 2, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; |
Protobuf Team Bot | 8c1f635 | 2024-01-10 05:18:15 +0000 | [diff] [blame] | 11294 | return upb_Message_HasBaseField(UPB_UPCAST(msg), &field); |
Mike Kruskal | 4f9e417 | 2023-06-30 20:14:50 -0700 | [diff] [blame] | 11295 | } |
Protobuf Team Bot | 6112795 | 2023-09-26 20:07:33 +0000 | [diff] [blame] | 11296 | UPB_INLINE void google_protobuf_FeatureSet_clear_utf8_validation(google_protobuf_FeatureSet* msg) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 11297 | const upb_MiniTableField field = {4, 24, 67, 3, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; |
Protobuf Team Bot | 4e90ead | 2024-01-08 15:46:34 +0000 | [diff] [blame] | 11298 | upb_Message_ClearBaseField(UPB_UPCAST(msg), &field); |
Protobuf Team Bot | 6112795 | 2023-09-26 20:07:33 +0000 | [diff] [blame] | 11299 | } |
| 11300 | UPB_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 Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 11303 | const upb_MiniTableField field = {4, 24, 67, 3, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; |
Protobuf Team Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 11304 | _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field, |
| 11305 | &default_val, &ret); |
Protobuf Team Bot | 6112795 | 2023-09-26 20:07:33 +0000 | [diff] [blame] | 11306 | return ret; |
| 11307 | } |
| 11308 | UPB_INLINE bool google_protobuf_FeatureSet_has_utf8_validation(const google_protobuf_FeatureSet* msg) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 11309 | const upb_MiniTableField field = {4, 24, 67, 3, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; |
Protobuf Team Bot | 8c1f635 | 2024-01-10 05:18:15 +0000 | [diff] [blame] | 11310 | return upb_Message_HasBaseField(UPB_UPCAST(msg), &field); |
Protobuf Team Bot | 6112795 | 2023-09-26 20:07:33 +0000 | [diff] [blame] | 11311 | } |
Mike Kruskal | 4f9e417 | 2023-06-30 20:14:50 -0700 | [diff] [blame] | 11312 | UPB_INLINE void google_protobuf_FeatureSet_clear_message_encoding(google_protobuf_FeatureSet* msg) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 11313 | const upb_MiniTableField field = {5, 28, 68, 4, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; |
Protobuf Team Bot | 4e90ead | 2024-01-08 15:46:34 +0000 | [diff] [blame] | 11314 | upb_Message_ClearBaseField(UPB_UPCAST(msg), &field); |
Mike Kruskal | 4f9e417 | 2023-06-30 20:14:50 -0700 | [diff] [blame] | 11315 | } |
| 11316 | UPB_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 Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 11319 | const upb_MiniTableField field = {5, 28, 68, 4, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; |
Protobuf Team Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 11320 | _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field, |
| 11321 | &default_val, &ret); |
Mike Kruskal | 4f9e417 | 2023-06-30 20:14:50 -0700 | [diff] [blame] | 11322 | return ret; |
| 11323 | } |
| 11324 | UPB_INLINE bool google_protobuf_FeatureSet_has_message_encoding(const google_protobuf_FeatureSet* msg) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 11325 | const upb_MiniTableField field = {5, 28, 68, 4, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; |
Protobuf Team Bot | 8c1f635 | 2024-01-10 05:18:15 +0000 | [diff] [blame] | 11326 | return upb_Message_HasBaseField(UPB_UPCAST(msg), &field); |
Mike Kruskal | 4f9e417 | 2023-06-30 20:14:50 -0700 | [diff] [blame] | 11327 | } |
| 11328 | UPB_INLINE void google_protobuf_FeatureSet_clear_json_format(google_protobuf_FeatureSet* msg) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 11329 | const upb_MiniTableField field = {6, 32, 69, 5, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; |
Protobuf Team Bot | 4e90ead | 2024-01-08 15:46:34 +0000 | [diff] [blame] | 11330 | upb_Message_ClearBaseField(UPB_UPCAST(msg), &field); |
Mike Kruskal | 4f9e417 | 2023-06-30 20:14:50 -0700 | [diff] [blame] | 11331 | } |
| 11332 | UPB_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 Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 11335 | const upb_MiniTableField field = {6, 32, 69, 5, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; |
Protobuf Team Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 11336 | _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field, |
| 11337 | &default_val, &ret); |
Mike Kruskal | 4f9e417 | 2023-06-30 20:14:50 -0700 | [diff] [blame] | 11338 | return ret; |
| 11339 | } |
| 11340 | UPB_INLINE bool google_protobuf_FeatureSet_has_json_format(const google_protobuf_FeatureSet* msg) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 11341 | const upb_MiniTableField field = {6, 32, 69, 5, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; |
Protobuf Team Bot | 8c1f635 | 2024-01-10 05:18:15 +0000 | [diff] [blame] | 11342 | return upb_Message_HasBaseField(UPB_UPCAST(msg), &field); |
Mike Kruskal | 4f9e417 | 2023-06-30 20:14:50 -0700 | [diff] [blame] | 11343 | } |
| 11344 | |
| 11345 | UPB_INLINE void google_protobuf_FeatureSet_set_field_presence(google_protobuf_FeatureSet *msg, int32_t value) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 11346 | const upb_MiniTableField field = {1, 12, 64, 0, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; |
Protobuf Team Bot | ac32c97 | 2024-04-10 03:30:05 +0000 | [diff] [blame] | 11347 | upb_Message_SetBaseField((upb_Message *)msg, &field, &value); |
Mike Kruskal | 4f9e417 | 2023-06-30 20:14:50 -0700 | [diff] [blame] | 11348 | } |
| 11349 | UPB_INLINE void google_protobuf_FeatureSet_set_enum_type(google_protobuf_FeatureSet *msg, int32_t value) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 11350 | const upb_MiniTableField field = {2, 16, 65, 1, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; |
Protobuf Team Bot | ac32c97 | 2024-04-10 03:30:05 +0000 | [diff] [blame] | 11351 | upb_Message_SetBaseField((upb_Message *)msg, &field, &value); |
Mike Kruskal | 4f9e417 | 2023-06-30 20:14:50 -0700 | [diff] [blame] | 11352 | } |
| 11353 | UPB_INLINE void google_protobuf_FeatureSet_set_repeated_field_encoding(google_protobuf_FeatureSet *msg, int32_t value) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 11354 | const upb_MiniTableField field = {3, 20, 66, 2, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; |
Protobuf Team Bot | ac32c97 | 2024-04-10 03:30:05 +0000 | [diff] [blame] | 11355 | upb_Message_SetBaseField((upb_Message *)msg, &field, &value); |
Mike Kruskal | 4f9e417 | 2023-06-30 20:14:50 -0700 | [diff] [blame] | 11356 | } |
Protobuf Team Bot | 6112795 | 2023-09-26 20:07:33 +0000 | [diff] [blame] | 11357 | UPB_INLINE void google_protobuf_FeatureSet_set_utf8_validation(google_protobuf_FeatureSet *msg, int32_t value) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 11358 | const upb_MiniTableField field = {4, 24, 67, 3, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; |
Protobuf Team Bot | ac32c97 | 2024-04-10 03:30:05 +0000 | [diff] [blame] | 11359 | upb_Message_SetBaseField((upb_Message *)msg, &field, &value); |
Protobuf Team Bot | 6112795 | 2023-09-26 20:07:33 +0000 | [diff] [blame] | 11360 | } |
Mike Kruskal | 4f9e417 | 2023-06-30 20:14:50 -0700 | [diff] [blame] | 11361 | UPB_INLINE void google_protobuf_FeatureSet_set_message_encoding(google_protobuf_FeatureSet *msg, int32_t value) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 11362 | const upb_MiniTableField field = {5, 28, 68, 4, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; |
Protobuf Team Bot | ac32c97 | 2024-04-10 03:30:05 +0000 | [diff] [blame] | 11363 | upb_Message_SetBaseField((upb_Message *)msg, &field, &value); |
Mike Kruskal | 4f9e417 | 2023-06-30 20:14:50 -0700 | [diff] [blame] | 11364 | } |
| 11365 | UPB_INLINE void google_protobuf_FeatureSet_set_json_format(google_protobuf_FeatureSet *msg, int32_t value) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 11366 | const upb_MiniTableField field = {6, 32, 69, 5, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; |
Protobuf Team Bot | ac32c97 | 2024-04-10 03:30:05 +0000 | [diff] [blame] | 11367 | upb_Message_SetBaseField((upb_Message *)msg, &field, &value); |
Mike Kruskal | 4f9e417 | 2023-06-30 20:14:50 -0700 | [diff] [blame] | 11368 | } |
| 11369 | |
Mike Kruskal | ba96470 | 2023-08-22 17:37:48 -0700 | [diff] [blame] | 11370 | /* google.protobuf.FeatureSetDefaults */ |
| 11371 | |
| 11372 | UPB_INLINE google_protobuf_FeatureSetDefaults* google_protobuf_FeatureSetDefaults_new(upb_Arena* arena) { |
Protobuf Team Bot | 4ffe086 | 2023-12-06 02:02:36 +0000 | [diff] [blame] | 11373 | return (google_protobuf_FeatureSetDefaults*)_upb_Message_New(&google__protobuf__FeatureSetDefaults_msg_init, arena); |
Mike Kruskal | ba96470 | 2023-08-22 17:37:48 -0700 | [diff] [blame] | 11374 | } |
| 11375 | UPB_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 Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 11378 | if (upb_Decode(buf, size, UPB_UPCAST(ret), &google__protobuf__FeatureSetDefaults_msg_init, NULL, 0, arena) != |
| 11379 | kUpb_DecodeStatus_Ok) { |
Mike Kruskal | ba96470 | 2023-08-22 17:37:48 -0700 | [diff] [blame] | 11380 | return NULL; |
| 11381 | } |
| 11382 | return ret; |
| 11383 | } |
| 11384 | UPB_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 Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 11389 | if (upb_Decode(buf, size, UPB_UPCAST(ret), &google__protobuf__FeatureSetDefaults_msg_init, extreg, options, |
| 11390 | arena) != kUpb_DecodeStatus_Ok) { |
Mike Kruskal | ba96470 | 2023-08-22 17:37:48 -0700 | [diff] [blame] | 11391 | return NULL; |
| 11392 | } |
| 11393 | return ret; |
| 11394 | } |
| 11395 | UPB_INLINE char* google_protobuf_FeatureSetDefaults_serialize(const google_protobuf_FeatureSetDefaults* msg, upb_Arena* arena, size_t* len) { |
| 11396 | char* ptr; |
Protobuf Team Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 11397 | (void)upb_Encode(UPB_UPCAST(msg), &google__protobuf__FeatureSetDefaults_msg_init, 0, arena, &ptr, len); |
Mike Kruskal | ba96470 | 2023-08-22 17:37:48 -0700 | [diff] [blame] | 11398 | return ptr; |
| 11399 | } |
| 11400 | UPB_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 Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 11403 | (void)upb_Encode(UPB_UPCAST(msg), &google__protobuf__FeatureSetDefaults_msg_init, options, arena, &ptr, len); |
Mike Kruskal | ba96470 | 2023-08-22 17:37:48 -0700 | [diff] [blame] | 11404 | return ptr; |
| 11405 | } |
| 11406 | UPB_INLINE void google_protobuf_FeatureSetDefaults_clear_defaults(google_protobuf_FeatureSetDefaults* msg) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 11407 | 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 Bot | 4e90ead | 2024-01-08 15:46:34 +0000 | [diff] [blame] | 11408 | upb_Message_ClearBaseField(UPB_UPCAST(msg), &field); |
Mike Kruskal | ba96470 | 2023-08-22 17:37:48 -0700 | [diff] [blame] | 11409 | } |
| 11410 | UPB_INLINE const google_protobuf_FeatureSetDefaults_FeatureSetEditionDefault* const* google_protobuf_FeatureSetDefaults_defaults(const google_protobuf_FeatureSetDefaults* msg, size_t* size) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 11411 | 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 Bot | a9387b5 | 2024-06-12 15:17:52 +0000 | [diff] [blame] | 11412 | UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__FeatureSetDefaults__FeatureSetEditionDefault_msg_init); |
Protobuf Team Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 11413 | const upb_Array* arr = upb_Message_GetArray(UPB_UPCAST(msg), &field); |
Mike Kruskal | ba96470 | 2023-08-22 17:37:48 -0700 | [diff] [blame] | 11414 | if (arr) { |
Protobuf Team Bot | f73985a | 2023-12-19 00:14:19 +0000 | [diff] [blame] | 11415 | if (size) *size = arr->UPB_PRIVATE(size); |
Protobuf Team Bot | 81e5433 | 2024-01-11 21:04:07 +0000 | [diff] [blame] | 11416 | return (const google_protobuf_FeatureSetDefaults_FeatureSetEditionDefault* const*)upb_Array_DataPtr(arr); |
Mike Kruskal | ba96470 | 2023-08-22 17:37:48 -0700 | [diff] [blame] | 11417 | } else { |
| 11418 | if (size) *size = 0; |
| 11419 | return NULL; |
| 11420 | } |
| 11421 | } |
| 11422 | UPB_INLINE const upb_Array* _google_protobuf_FeatureSetDefaults_defaults_upb_array(const google_protobuf_FeatureSetDefaults* msg, size_t* size) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 11423 | 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 Bot | a9387b5 | 2024-06-12 15:17:52 +0000 | [diff] [blame] | 11424 | UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__FeatureSetDefaults__FeatureSetEditionDefault_msg_init); |
Protobuf Team Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 11425 | const upb_Array* arr = upb_Message_GetArray(UPB_UPCAST(msg), &field); |
Mike Kruskal | ba96470 | 2023-08-22 17:37:48 -0700 | [diff] [blame] | 11426 | if (size) { |
Protobuf Team Bot | f73985a | 2023-12-19 00:14:19 +0000 | [diff] [blame] | 11427 | *size = arr ? arr->UPB_PRIVATE(size) : 0; |
Mike Kruskal | ba96470 | 2023-08-22 17:37:48 -0700 | [diff] [blame] | 11428 | } |
| 11429 | return arr; |
| 11430 | } |
Protobuf Team Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 11431 | UPB_INLINE upb_Array* _google_protobuf_FeatureSetDefaults_defaults_mutable_upb_array(google_protobuf_FeatureSetDefaults* msg, size_t* size, upb_Arena* arena) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 11432 | 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 Bot | a9387b5 | 2024-06-12 15:17:52 +0000 | [diff] [blame] | 11433 | UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__FeatureSetDefaults__FeatureSetEditionDefault_msg_init); |
Protobuf Team Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 11434 | upb_Array* arr = upb_Message_GetOrCreateMutableArray(UPB_UPCAST(msg), |
| 11435 | &field, arena); |
Mike Kruskal | ba96470 | 2023-08-22 17:37:48 -0700 | [diff] [blame] | 11436 | if (size) { |
Protobuf Team Bot | f73985a | 2023-12-19 00:14:19 +0000 | [diff] [blame] | 11437 | *size = arr ? arr->UPB_PRIVATE(size) : 0; |
Mike Kruskal | ba96470 | 2023-08-22 17:37:48 -0700 | [diff] [blame] | 11438 | } |
| 11439 | return arr; |
| 11440 | } |
Mike Kruskal | ba96470 | 2023-08-22 17:37:48 -0700 | [diff] [blame] | 11441 | UPB_INLINE void google_protobuf_FeatureSetDefaults_clear_minimum_edition(google_protobuf_FeatureSetDefaults* msg) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 11442 | 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 Bot | 4e90ead | 2024-01-08 15:46:34 +0000 | [diff] [blame] | 11443 | upb_Message_ClearBaseField(UPB_UPCAST(msg), &field); |
Mike Kruskal | ba96470 | 2023-08-22 17:37:48 -0700 | [diff] [blame] | 11444 | } |
Protobuf Team Bot | ab58f8f | 2023-09-26 16:14:19 +0000 | [diff] [blame] | 11445 | UPB_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 Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 11448 | 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 Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 11449 | _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field, |
| 11450 | &default_val, &ret); |
Mike Kruskal | ba96470 | 2023-08-22 17:37:48 -0700 | [diff] [blame] | 11451 | return ret; |
| 11452 | } |
| 11453 | UPB_INLINE bool google_protobuf_FeatureSetDefaults_has_minimum_edition(const google_protobuf_FeatureSetDefaults* msg) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 11454 | 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 Bot | 8c1f635 | 2024-01-10 05:18:15 +0000 | [diff] [blame] | 11455 | return upb_Message_HasBaseField(UPB_UPCAST(msg), &field); |
Mike Kruskal | ba96470 | 2023-08-22 17:37:48 -0700 | [diff] [blame] | 11456 | } |
| 11457 | UPB_INLINE void google_protobuf_FeatureSetDefaults_clear_maximum_edition(google_protobuf_FeatureSetDefaults* msg) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 11458 | 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 Bot | 4e90ead | 2024-01-08 15:46:34 +0000 | [diff] [blame] | 11459 | upb_Message_ClearBaseField(UPB_UPCAST(msg), &field); |
Mike Kruskal | ba96470 | 2023-08-22 17:37:48 -0700 | [diff] [blame] | 11460 | } |
Protobuf Team Bot | ab58f8f | 2023-09-26 16:14:19 +0000 | [diff] [blame] | 11461 | UPB_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 Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 11464 | 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 Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 11465 | _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field, |
| 11466 | &default_val, &ret); |
Mike Kruskal | ba96470 | 2023-08-22 17:37:48 -0700 | [diff] [blame] | 11467 | return ret; |
| 11468 | } |
| 11469 | UPB_INLINE bool google_protobuf_FeatureSetDefaults_has_maximum_edition(const google_protobuf_FeatureSetDefaults* msg) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 11470 | 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 Bot | 8c1f635 | 2024-01-10 05:18:15 +0000 | [diff] [blame] | 11471 | return upb_Message_HasBaseField(UPB_UPCAST(msg), &field); |
Mike Kruskal | ba96470 | 2023-08-22 17:37:48 -0700 | [diff] [blame] | 11472 | } |
| 11473 | |
| 11474 | UPB_INLINE google_protobuf_FeatureSetDefaults_FeatureSetEditionDefault** google_protobuf_FeatureSetDefaults_mutable_defaults(google_protobuf_FeatureSetDefaults* msg, size_t* size) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 11475 | 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 Bot | a9387b5 | 2024-06-12 15:17:52 +0000 | [diff] [blame] | 11476 | UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__FeatureSetDefaults__FeatureSetEditionDefault_msg_init); |
Protobuf Team Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 11477 | upb_Array* arr = upb_Message_GetMutableArray(UPB_UPCAST(msg), &field); |
Mike Kruskal | ba96470 | 2023-08-22 17:37:48 -0700 | [diff] [blame] | 11478 | if (arr) { |
Protobuf Team Bot | f73985a | 2023-12-19 00:14:19 +0000 | [diff] [blame] | 11479 | if (size) *size = arr->UPB_PRIVATE(size); |
Protobuf Team Bot | 81e5433 | 2024-01-11 21:04:07 +0000 | [diff] [blame] | 11480 | return (google_protobuf_FeatureSetDefaults_FeatureSetEditionDefault**)upb_Array_MutableDataPtr(arr); |
Mike Kruskal | ba96470 | 2023-08-22 17:37:48 -0700 | [diff] [blame] | 11481 | } else { |
| 11482 | if (size) *size = 0; |
| 11483 | return NULL; |
| 11484 | } |
| 11485 | } |
| 11486 | UPB_INLINE google_protobuf_FeatureSetDefaults_FeatureSetEditionDefault** google_protobuf_FeatureSetDefaults_resize_defaults(google_protobuf_FeatureSetDefaults* msg, size_t size, upb_Arena* arena) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 11487 | 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 Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 11488 | return (google_protobuf_FeatureSetDefaults_FeatureSetEditionDefault**)upb_Message_ResizeArrayUninitialized(UPB_UPCAST(msg), |
| 11489 | &field, size, arena); |
Mike Kruskal | ba96470 | 2023-08-22 17:37:48 -0700 | [diff] [blame] | 11490 | } |
| 11491 | UPB_INLINE struct google_protobuf_FeatureSetDefaults_FeatureSetEditionDefault* google_protobuf_FeatureSetDefaults_add_defaults(google_protobuf_FeatureSetDefaults* msg, upb_Arena* arena) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 11492 | 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 Bot | a9387b5 | 2024-06-12 15:17:52 +0000 | [diff] [blame] | 11493 | UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__FeatureSetDefaults__FeatureSetEditionDefault_msg_init); |
Protobuf Team Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 11494 | upb_Array* arr = upb_Message_GetOrCreateMutableArray( |
| 11495 | UPB_UPCAST(msg), &field, arena); |
Protobuf Team Bot | 81e5433 | 2024-01-11 21:04:07 +0000 | [diff] [blame] | 11496 | if (!arr || !UPB_PRIVATE(_upb_Array_ResizeUninitialized)( |
Protobuf Team Bot | f73985a | 2023-12-19 00:14:19 +0000 | [diff] [blame] | 11497 | arr, arr->UPB_PRIVATE(size) + 1, arena)) { |
Mike Kruskal | ba96470 | 2023-08-22 17:37:48 -0700 | [diff] [blame] | 11498 | return NULL; |
| 11499 | } |
Protobuf Team Bot | 4ffe086 | 2023-12-06 02:02:36 +0000 | [diff] [blame] | 11500 | struct google_protobuf_FeatureSetDefaults_FeatureSetEditionDefault* sub = (struct google_protobuf_FeatureSetDefaults_FeatureSetEditionDefault*)_upb_Message_New(&google__protobuf__FeatureSetDefaults__FeatureSetEditionDefault_msg_init, arena); |
Mike Kruskal | ba96470 | 2023-08-22 17:37:48 -0700 | [diff] [blame] | 11501 | if (!arr || !sub) return NULL; |
Protobuf Team Bot | f73985a | 2023-12-19 00:14:19 +0000 | [diff] [blame] | 11502 | UPB_PRIVATE(_upb_Array_Set) |
| 11503 | (arr, arr->UPB_PRIVATE(size) - 1, &sub, sizeof(sub)); |
Mike Kruskal | ba96470 | 2023-08-22 17:37:48 -0700 | [diff] [blame] | 11504 | return sub; |
| 11505 | } |
Protobuf Team Bot | ab58f8f | 2023-09-26 16:14:19 +0000 | [diff] [blame] | 11506 | UPB_INLINE void google_protobuf_FeatureSetDefaults_set_minimum_edition(google_protobuf_FeatureSetDefaults *msg, int32_t value) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 11507 | 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 Bot | ac32c97 | 2024-04-10 03:30:05 +0000 | [diff] [blame] | 11508 | upb_Message_SetBaseField((upb_Message *)msg, &field, &value); |
Mike Kruskal | ba96470 | 2023-08-22 17:37:48 -0700 | [diff] [blame] | 11509 | } |
Protobuf Team Bot | ab58f8f | 2023-09-26 16:14:19 +0000 | [diff] [blame] | 11510 | UPB_INLINE void google_protobuf_FeatureSetDefaults_set_maximum_edition(google_protobuf_FeatureSetDefaults *msg, int32_t value) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 11511 | 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 Bot | ac32c97 | 2024-04-10 03:30:05 +0000 | [diff] [blame] | 11512 | upb_Message_SetBaseField((upb_Message *)msg, &field, &value); |
Mike Kruskal | ba96470 | 2023-08-22 17:37:48 -0700 | [diff] [blame] | 11513 | } |
| 11514 | |
| 11515 | /* google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault */ |
| 11516 | |
| 11517 | UPB_INLINE google_protobuf_FeatureSetDefaults_FeatureSetEditionDefault* google_protobuf_FeatureSetDefaults_FeatureSetEditionDefault_new(upb_Arena* arena) { |
Protobuf Team Bot | 4ffe086 | 2023-12-06 02:02:36 +0000 | [diff] [blame] | 11518 | return (google_protobuf_FeatureSetDefaults_FeatureSetEditionDefault*)_upb_Message_New(&google__protobuf__FeatureSetDefaults__FeatureSetEditionDefault_msg_init, arena); |
Mike Kruskal | ba96470 | 2023-08-22 17:37:48 -0700 | [diff] [blame] | 11519 | } |
| 11520 | UPB_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 Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 11523 | if (upb_Decode(buf, size, UPB_UPCAST(ret), &google__protobuf__FeatureSetDefaults__FeatureSetEditionDefault_msg_init, NULL, 0, arena) != |
| 11524 | kUpb_DecodeStatus_Ok) { |
Mike Kruskal | ba96470 | 2023-08-22 17:37:48 -0700 | [diff] [blame] | 11525 | return NULL; |
| 11526 | } |
| 11527 | return ret; |
| 11528 | } |
| 11529 | UPB_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 Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 11534 | if (upb_Decode(buf, size, UPB_UPCAST(ret), &google__protobuf__FeatureSetDefaults__FeatureSetEditionDefault_msg_init, extreg, options, |
| 11535 | arena) != kUpb_DecodeStatus_Ok) { |
Mike Kruskal | ba96470 | 2023-08-22 17:37:48 -0700 | [diff] [blame] | 11536 | return NULL; |
| 11537 | } |
| 11538 | return ret; |
| 11539 | } |
| 11540 | UPB_INLINE char* google_protobuf_FeatureSetDefaults_FeatureSetEditionDefault_serialize(const google_protobuf_FeatureSetDefaults_FeatureSetEditionDefault* msg, upb_Arena* arena, size_t* len) { |
| 11541 | char* ptr; |
Protobuf Team Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 11542 | (void)upb_Encode(UPB_UPCAST(msg), &google__protobuf__FeatureSetDefaults__FeatureSetEditionDefault_msg_init, 0, arena, &ptr, len); |
Mike Kruskal | ba96470 | 2023-08-22 17:37:48 -0700 | [diff] [blame] | 11543 | return ptr; |
| 11544 | } |
| 11545 | UPB_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 Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 11548 | (void)upb_Encode(UPB_UPCAST(msg), &google__protobuf__FeatureSetDefaults__FeatureSetEditionDefault_msg_init, options, arena, &ptr, len); |
Mike Kruskal | ba96470 | 2023-08-22 17:37:48 -0700 | [diff] [blame] | 11549 | return ptr; |
| 11550 | } |
Protobuf Team Bot | ab58f8f | 2023-09-26 16:14:19 +0000 | [diff] [blame] | 11551 | UPB_INLINE void google_protobuf_FeatureSetDefaults_FeatureSetEditionDefault_clear_edition(google_protobuf_FeatureSetDefaults_FeatureSetEditionDefault* msg) { |
Protobuf Team Bot | 6afdd5a | 2024-04-17 22:09:39 +0000 | [diff] [blame] | 11552 | const upb_MiniTableField field = {3, 12, 64, 2, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; |
Protobuf Team Bot | 4e90ead | 2024-01-08 15:46:34 +0000 | [diff] [blame] | 11553 | upb_Message_ClearBaseField(UPB_UPCAST(msg), &field); |
Protobuf Team Bot | fa98bb3 | 2023-09-01 18:11:09 +0000 | [diff] [blame] | 11554 | } |
Protobuf Team Bot | ab58f8f | 2023-09-26 16:14:19 +0000 | [diff] [blame] | 11555 | UPB_INLINE int32_t google_protobuf_FeatureSetDefaults_FeatureSetEditionDefault_edition(const google_protobuf_FeatureSetDefaults_FeatureSetEditionDefault* msg) { |
Protobuf Team Bot | fa98bb3 | 2023-09-01 18:11:09 +0000 | [diff] [blame] | 11556 | int32_t default_val = 0; |
| 11557 | int32_t ret; |
Protobuf Team Bot | 6afdd5a | 2024-04-17 22:09:39 +0000 | [diff] [blame] | 11558 | const upb_MiniTableField field = {3, 12, 64, 2, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; |
Protobuf Team Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 11559 | _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field, |
| 11560 | &default_val, &ret); |
Protobuf Team Bot | fa98bb3 | 2023-09-01 18:11:09 +0000 | [diff] [blame] | 11561 | return ret; |
| 11562 | } |
Protobuf Team Bot | ab58f8f | 2023-09-26 16:14:19 +0000 | [diff] [blame] | 11563 | UPB_INLINE bool google_protobuf_FeatureSetDefaults_FeatureSetEditionDefault_has_edition(const google_protobuf_FeatureSetDefaults_FeatureSetEditionDefault* msg) { |
Protobuf Team Bot | 6afdd5a | 2024-04-17 22:09:39 +0000 | [diff] [blame] | 11564 | const upb_MiniTableField field = {3, 12, 64, 2, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; |
Protobuf Team Bot | 85edb7e | 2024-04-03 02:43:54 +0000 | [diff] [blame] | 11565 | return upb_Message_HasBaseField(UPB_UPCAST(msg), &field); |
| 11566 | } |
| 11567 | UPB_INLINE void google_protobuf_FeatureSetDefaults_FeatureSetEditionDefault_clear_overridable_features(google_protobuf_FeatureSetDefaults_FeatureSetEditionDefault* msg) { |
Protobuf Team Bot | 6afdd5a | 2024-04-17 22:09:39 +0000 | [diff] [blame] | 11568 | 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 Bot | 85edb7e | 2024-04-03 02:43:54 +0000 | [diff] [blame] | 11569 | upb_Message_ClearBaseField(UPB_UPCAST(msg), &field); |
| 11570 | } |
| 11571 | UPB_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 Bot | 6afdd5a | 2024-04-17 22:09:39 +0000 | [diff] [blame] | 11574 | 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 Bot | a9387b5 | 2024-06-12 15:17:52 +0000 | [diff] [blame] | 11575 | UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__FeatureSet_msg_init); |
Protobuf Team Bot | 85edb7e | 2024-04-03 02:43:54 +0000 | [diff] [blame] | 11576 | _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field, |
| 11577 | &default_val, &ret); |
| 11578 | return ret; |
| 11579 | } |
| 11580 | UPB_INLINE bool google_protobuf_FeatureSetDefaults_FeatureSetEditionDefault_has_overridable_features(const google_protobuf_FeatureSetDefaults_FeatureSetEditionDefault* msg) { |
Protobuf Team Bot | 6afdd5a | 2024-04-17 22:09:39 +0000 | [diff] [blame] | 11581 | 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 Bot | 85edb7e | 2024-04-03 02:43:54 +0000 | [diff] [blame] | 11582 | return upb_Message_HasBaseField(UPB_UPCAST(msg), &field); |
| 11583 | } |
| 11584 | UPB_INLINE void google_protobuf_FeatureSetDefaults_FeatureSetEditionDefault_clear_fixed_features(google_protobuf_FeatureSetDefaults_FeatureSetEditionDefault* msg) { |
Protobuf Team Bot | 6afdd5a | 2024-04-17 22:09:39 +0000 | [diff] [blame] | 11585 | 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 Bot | 85edb7e | 2024-04-03 02:43:54 +0000 | [diff] [blame] | 11586 | upb_Message_ClearBaseField(UPB_UPCAST(msg), &field); |
| 11587 | } |
| 11588 | UPB_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 Bot | 6afdd5a | 2024-04-17 22:09:39 +0000 | [diff] [blame] | 11591 | 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 Bot | a9387b5 | 2024-06-12 15:17:52 +0000 | [diff] [blame] | 11592 | UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__FeatureSet_msg_init); |
Protobuf Team Bot | 85edb7e | 2024-04-03 02:43:54 +0000 | [diff] [blame] | 11593 | _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field, |
| 11594 | &default_val, &ret); |
| 11595 | return ret; |
| 11596 | } |
| 11597 | UPB_INLINE bool google_protobuf_FeatureSetDefaults_FeatureSetEditionDefault_has_fixed_features(const google_protobuf_FeatureSetDefaults_FeatureSetEditionDefault* msg) { |
Protobuf Team Bot | 6afdd5a | 2024-04-17 22:09:39 +0000 | [diff] [blame] | 11598 | 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 Bot | 8c1f635 | 2024-01-10 05:18:15 +0000 | [diff] [blame] | 11599 | return upb_Message_HasBaseField(UPB_UPCAST(msg), &field); |
Protobuf Team Bot | fa98bb3 | 2023-09-01 18:11:09 +0000 | [diff] [blame] | 11600 | } |
Mike Kruskal | ba96470 | 2023-08-22 17:37:48 -0700 | [diff] [blame] | 11601 | |
Protobuf Team Bot | ab58f8f | 2023-09-26 16:14:19 +0000 | [diff] [blame] | 11602 | UPB_INLINE void google_protobuf_FeatureSetDefaults_FeatureSetEditionDefault_set_edition(google_protobuf_FeatureSetDefaults_FeatureSetEditionDefault *msg, int32_t value) { |
Protobuf Team Bot | 6afdd5a | 2024-04-17 22:09:39 +0000 | [diff] [blame] | 11603 | const upb_MiniTableField field = {3, 12, 64, 2, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; |
Protobuf Team Bot | ac32c97 | 2024-04-10 03:30:05 +0000 | [diff] [blame] | 11604 | upb_Message_SetBaseField((upb_Message *)msg, &field, &value); |
Protobuf Team Bot | fa98bb3 | 2023-09-01 18:11:09 +0000 | [diff] [blame] | 11605 | } |
Protobuf Team Bot | 85edb7e | 2024-04-03 02:43:54 +0000 | [diff] [blame] | 11606 | UPB_INLINE void google_protobuf_FeatureSetDefaults_FeatureSetEditionDefault_set_overridable_features(google_protobuf_FeatureSetDefaults_FeatureSetEditionDefault *msg, google_protobuf_FeatureSet* value) { |
Protobuf Team Bot | 6afdd5a | 2024-04-17 22:09:39 +0000 | [diff] [blame] | 11607 | 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 Bot | a9387b5 | 2024-06-12 15:17:52 +0000 | [diff] [blame] | 11608 | UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__FeatureSet_msg_init); |
Protobuf Team Bot | ac32c97 | 2024-04-10 03:30:05 +0000 | [diff] [blame] | 11609 | upb_Message_SetBaseField((upb_Message *)msg, &field, &value); |
Protobuf Team Bot | 85edb7e | 2024-04-03 02:43:54 +0000 | [diff] [blame] | 11610 | } |
| 11611 | UPB_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 | } |
| 11619 | UPB_INLINE void google_protobuf_FeatureSetDefaults_FeatureSetEditionDefault_set_fixed_features(google_protobuf_FeatureSetDefaults_FeatureSetEditionDefault *msg, google_protobuf_FeatureSet* value) { |
Protobuf Team Bot | 6afdd5a | 2024-04-17 22:09:39 +0000 | [diff] [blame] | 11620 | 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 Bot | a9387b5 | 2024-06-12 15:17:52 +0000 | [diff] [blame] | 11621 | UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__FeatureSet_msg_init); |
Protobuf Team Bot | ac32c97 | 2024-04-10 03:30:05 +0000 | [diff] [blame] | 11622 | upb_Message_SetBaseField((upb_Message *)msg, &field, &value); |
Protobuf Team Bot | 85edb7e | 2024-04-03 02:43:54 +0000 | [diff] [blame] | 11623 | } |
| 11624 | UPB_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 Kruskal | ba96470 | 2023-08-22 17:37:48 -0700 | [diff] [blame] | 11632 | |
Joshua Haberman | 9abf6e2 | 2021-01-13 12:16:25 -0800 | [diff] [blame] | 11633 | /* google.protobuf.SourceCodeInfo */ |
| 11634 | |
Joshua Haberman | f41049a | 2022-01-21 14:41:25 -0800 | [diff] [blame] | 11635 | UPB_INLINE google_protobuf_SourceCodeInfo* google_protobuf_SourceCodeInfo_new(upb_Arena* arena) { |
Protobuf Team Bot | 4ffe086 | 2023-12-06 02:02:36 +0000 | [diff] [blame] | 11636 | return (google_protobuf_SourceCodeInfo*)_upb_Message_New(&google__protobuf__SourceCodeInfo_msg_init, arena); |
Joshua Haberman | 9abf6e2 | 2021-01-13 12:16:25 -0800 | [diff] [blame] | 11637 | } |
Joshua Haberman | f41049a | 2022-01-21 14:41:25 -0800 | [diff] [blame] | 11638 | UPB_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 Haberman | 9d578a3 | 2021-08-02 15:32:01 -0700 | [diff] [blame] | 11640 | if (!ret) return NULL; |
Protobuf Team Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 11641 | if (upb_Decode(buf, size, UPB_UPCAST(ret), &google__protobuf__SourceCodeInfo_msg_init, NULL, 0, arena) != |
| 11642 | kUpb_DecodeStatus_Ok) { |
Joshua Haberman | 9d578a3 | 2021-08-02 15:32:01 -0700 | [diff] [blame] | 11643 | return NULL; |
| 11644 | } |
| 11645 | return ret; |
Joshua Haberman | 9abf6e2 | 2021-01-13 12:16:25 -0800 | [diff] [blame] | 11646 | } |
Joshua Haberman | f41049a | 2022-01-21 14:41:25 -0800 | [diff] [blame] | 11647 | UPB_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 Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 11652 | if (upb_Decode(buf, size, UPB_UPCAST(ret), &google__protobuf__SourceCodeInfo_msg_init, extreg, options, |
| 11653 | arena) != kUpb_DecodeStatus_Ok) { |
Joshua Haberman | f41049a | 2022-01-21 14:41:25 -0800 | [diff] [blame] | 11654 | return NULL; |
| 11655 | } |
| 11656 | return ret; |
Joshua Haberman | 9abf6e2 | 2021-01-13 12:16:25 -0800 | [diff] [blame] | 11657 | } |
Joshua Haberman | f41049a | 2022-01-21 14:41:25 -0800 | [diff] [blame] | 11658 | UPB_INLINE char* google_protobuf_SourceCodeInfo_serialize(const google_protobuf_SourceCodeInfo* msg, upb_Arena* arena, size_t* len) { |
Joshua Haberman | d3995ec | 2022-09-30 16:54:39 -0700 | [diff] [blame] | 11659 | char* ptr; |
Protobuf Team Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 11660 | (void)upb_Encode(UPB_UPCAST(msg), &google__protobuf__SourceCodeInfo_msg_init, 0, arena, &ptr, len); |
Joshua Haberman | d3995ec | 2022-09-30 16:54:39 -0700 | [diff] [blame] | 11661 | return ptr; |
Joshua Haberman | f41049a | 2022-01-21 14:41:25 -0800 | [diff] [blame] | 11662 | } |
| 11663 | UPB_INLINE char* google_protobuf_SourceCodeInfo_serialize_ex(const google_protobuf_SourceCodeInfo* msg, int options, |
| 11664 | upb_Arena* arena, size_t* len) { |
Joshua Haberman | d3995ec | 2022-09-30 16:54:39 -0700 | [diff] [blame] | 11665 | char* ptr; |
Protobuf Team Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 11666 | (void)upb_Encode(UPB_UPCAST(msg), &google__protobuf__SourceCodeInfo_msg_init, options, arena, &ptr, len); |
Joshua Haberman | d3995ec | 2022-09-30 16:54:39 -0700 | [diff] [blame] | 11667 | return ptr; |
Joshua Haberman | f41049a | 2022-01-21 14:41:25 -0800 | [diff] [blame] | 11668 | } |
Mike Kruskal | 3bc5049 | 2022-12-01 13:34:12 -0800 | [diff] [blame] | 11669 | UPB_INLINE void google_protobuf_SourceCodeInfo_clear_location(google_protobuf_SourceCodeInfo* msg) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 11670 | 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 Bot | 4e90ead | 2024-01-08 15:46:34 +0000 | [diff] [blame] | 11671 | upb_Message_ClearBaseField(UPB_UPCAST(msg), &field); |
Joshua Haberman | d3995ec | 2022-09-30 16:54:39 -0700 | [diff] [blame] | 11672 | } |
Eric Salo | b7d54ac | 2022-12-29 11:59:42 -0800 | [diff] [blame] | 11673 | UPB_INLINE const google_protobuf_SourceCodeInfo_Location* const* google_protobuf_SourceCodeInfo_location(const google_protobuf_SourceCodeInfo* msg, size_t* size) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 11674 | 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 Bot | a9387b5 | 2024-06-12 15:17:52 +0000 | [diff] [blame] | 11675 | UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__SourceCodeInfo__Location_msg_init); |
Protobuf Team Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 11676 | const upb_Array* arr = upb_Message_GetArray(UPB_UPCAST(msg), &field); |
Eric Salo | b7d54ac | 2022-12-29 11:59:42 -0800 | [diff] [blame] | 11677 | if (arr) { |
Protobuf Team Bot | f73985a | 2023-12-19 00:14:19 +0000 | [diff] [blame] | 11678 | if (size) *size = arr->UPB_PRIVATE(size); |
Protobuf Team Bot | 81e5433 | 2024-01-11 21:04:07 +0000 | [diff] [blame] | 11679 | return (const google_protobuf_SourceCodeInfo_Location* const*)upb_Array_DataPtr(arr); |
Eric Salo | b7d54ac | 2022-12-29 11:59:42 -0800 | [diff] [blame] | 11680 | } else { |
| 11681 | if (size) *size = 0; |
| 11682 | return NULL; |
| 11683 | } |
Joshua Haberman | 7ecf43f | 2022-03-14 13:11:29 -0700 | [diff] [blame] | 11684 | } |
Deanna Garcia | b26afb5 | 2023-04-25 13:37:18 -0700 | [diff] [blame] | 11685 | UPB_INLINE const upb_Array* _google_protobuf_SourceCodeInfo_location_upb_array(const google_protobuf_SourceCodeInfo* msg, size_t* size) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 11686 | 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 Bot | a9387b5 | 2024-06-12 15:17:52 +0000 | [diff] [blame] | 11687 | UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__SourceCodeInfo__Location_msg_init); |
Protobuf Team Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 11688 | const upb_Array* arr = upb_Message_GetArray(UPB_UPCAST(msg), &field); |
Deanna Garcia | b26afb5 | 2023-04-25 13:37:18 -0700 | [diff] [blame] | 11689 | if (size) { |
Protobuf Team Bot | f73985a | 2023-12-19 00:14:19 +0000 | [diff] [blame] | 11690 | *size = arr ? arr->UPB_PRIVATE(size) : 0; |
Deanna Garcia | b26afb5 | 2023-04-25 13:37:18 -0700 | [diff] [blame] | 11691 | } |
| 11692 | return arr; |
| 11693 | } |
Protobuf Team Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 11694 | UPB_INLINE upb_Array* _google_protobuf_SourceCodeInfo_location_mutable_upb_array(google_protobuf_SourceCodeInfo* msg, size_t* size, upb_Arena* arena) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 11695 | 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 Bot | a9387b5 | 2024-06-12 15:17:52 +0000 | [diff] [blame] | 11696 | UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__SourceCodeInfo__Location_msg_init); |
Protobuf Team Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 11697 | upb_Array* arr = upb_Message_GetOrCreateMutableArray(UPB_UPCAST(msg), |
| 11698 | &field, arena); |
Deanna Garcia | b26afb5 | 2023-04-25 13:37:18 -0700 | [diff] [blame] | 11699 | if (size) { |
Protobuf Team Bot | f73985a | 2023-12-19 00:14:19 +0000 | [diff] [blame] | 11700 | *size = arr ? arr->UPB_PRIVATE(size) : 0; |
Deanna Garcia | b26afb5 | 2023-04-25 13:37:18 -0700 | [diff] [blame] | 11701 | } |
| 11702 | return arr; |
| 11703 | } |
Joshua Haberman | 9abf6e2 | 2021-01-13 12:16:25 -0800 | [diff] [blame] | 11704 | |
Eric Salo | b7d54ac | 2022-12-29 11:59:42 -0800 | [diff] [blame] | 11705 | UPB_INLINE google_protobuf_SourceCodeInfo_Location** google_protobuf_SourceCodeInfo_mutable_location(google_protobuf_SourceCodeInfo* msg, size_t* size) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 11706 | 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 Bot | a9387b5 | 2024-06-12 15:17:52 +0000 | [diff] [blame] | 11707 | UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__SourceCodeInfo__Location_msg_init); |
Protobuf Team Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 11708 | upb_Array* arr = upb_Message_GetMutableArray(UPB_UPCAST(msg), &field); |
Eric Salo | b7d54ac | 2022-12-29 11:59:42 -0800 | [diff] [blame] | 11709 | if (arr) { |
Protobuf Team Bot | f73985a | 2023-12-19 00:14:19 +0000 | [diff] [blame] | 11710 | if (size) *size = arr->UPB_PRIVATE(size); |
Protobuf Team Bot | 81e5433 | 2024-01-11 21:04:07 +0000 | [diff] [blame] | 11711 | return (google_protobuf_SourceCodeInfo_Location**)upb_Array_MutableDataPtr(arr); |
Eric Salo | b7d54ac | 2022-12-29 11:59:42 -0800 | [diff] [blame] | 11712 | } else { |
| 11713 | if (size) *size = 0; |
| 11714 | return NULL; |
| 11715 | } |
Joshua Haberman | 9abf6e2 | 2021-01-13 12:16:25 -0800 | [diff] [blame] | 11716 | } |
Eric Salo | b7d54ac | 2022-12-29 11:59:42 -0800 | [diff] [blame] | 11717 | UPB_INLINE google_protobuf_SourceCodeInfo_Location** google_protobuf_SourceCodeInfo_resize_location(google_protobuf_SourceCodeInfo* msg, size_t size, upb_Arena* arena) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 11718 | 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 Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 11719 | return (google_protobuf_SourceCodeInfo_Location**)upb_Message_ResizeArrayUninitialized(UPB_UPCAST(msg), |
| 11720 | &field, size, arena); |
Joshua Haberman | 9abf6e2 | 2021-01-13 12:16:25 -0800 | [diff] [blame] | 11721 | } |
Joshua Haberman | 7ecf43f | 2022-03-14 13:11:29 -0700 | [diff] [blame] | 11722 | UPB_INLINE struct google_protobuf_SourceCodeInfo_Location* google_protobuf_SourceCodeInfo_add_location(google_protobuf_SourceCodeInfo* msg, upb_Arena* arena) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 11723 | 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 Bot | a9387b5 | 2024-06-12 15:17:52 +0000 | [diff] [blame] | 11724 | UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__SourceCodeInfo__Location_msg_init); |
Protobuf Team Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 11725 | upb_Array* arr = upb_Message_GetOrCreateMutableArray( |
| 11726 | UPB_UPCAST(msg), &field, arena); |
Protobuf Team Bot | 81e5433 | 2024-01-11 21:04:07 +0000 | [diff] [blame] | 11727 | if (!arr || !UPB_PRIVATE(_upb_Array_ResizeUninitialized)( |
Protobuf Team Bot | f73985a | 2023-12-19 00:14:19 +0000 | [diff] [blame] | 11728 | arr, arr->UPB_PRIVATE(size) + 1, arena)) { |
Eric Salo | b7d54ac | 2022-12-29 11:59:42 -0800 | [diff] [blame] | 11729 | return NULL; |
| 11730 | } |
Protobuf Team Bot | 4ffe086 | 2023-12-06 02:02:36 +0000 | [diff] [blame] | 11731 | struct google_protobuf_SourceCodeInfo_Location* sub = (struct google_protobuf_SourceCodeInfo_Location*)_upb_Message_New(&google__protobuf__SourceCodeInfo__Location_msg_init, arena); |
Eric Salo | b7d54ac | 2022-12-29 11:59:42 -0800 | [diff] [blame] | 11732 | if (!arr || !sub) return NULL; |
Protobuf Team Bot | f73985a | 2023-12-19 00:14:19 +0000 | [diff] [blame] | 11733 | UPB_PRIVATE(_upb_Array_Set) |
| 11734 | (arr, arr->UPB_PRIVATE(size) - 1, &sub, sizeof(sub)); |
Joshua Haberman | 9abf6e2 | 2021-01-13 12:16:25 -0800 | [diff] [blame] | 11735 | return sub; |
| 11736 | } |
| 11737 | |
| 11738 | /* google.protobuf.SourceCodeInfo.Location */ |
| 11739 | |
Joshua Haberman | f41049a | 2022-01-21 14:41:25 -0800 | [diff] [blame] | 11740 | UPB_INLINE google_protobuf_SourceCodeInfo_Location* google_protobuf_SourceCodeInfo_Location_new(upb_Arena* arena) { |
Protobuf Team Bot | 4ffe086 | 2023-12-06 02:02:36 +0000 | [diff] [blame] | 11741 | return (google_protobuf_SourceCodeInfo_Location*)_upb_Message_New(&google__protobuf__SourceCodeInfo__Location_msg_init, arena); |
Joshua Haberman | 9abf6e2 | 2021-01-13 12:16:25 -0800 | [diff] [blame] | 11742 | } |
Joshua Haberman | f41049a | 2022-01-21 14:41:25 -0800 | [diff] [blame] | 11743 | UPB_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 Haberman | 9d578a3 | 2021-08-02 15:32:01 -0700 | [diff] [blame] | 11745 | if (!ret) return NULL; |
Protobuf Team Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 11746 | if (upb_Decode(buf, size, UPB_UPCAST(ret), &google__protobuf__SourceCodeInfo__Location_msg_init, NULL, 0, arena) != |
| 11747 | kUpb_DecodeStatus_Ok) { |
Joshua Haberman | 9d578a3 | 2021-08-02 15:32:01 -0700 | [diff] [blame] | 11748 | return NULL; |
| 11749 | } |
| 11750 | return ret; |
Joshua Haberman | 9abf6e2 | 2021-01-13 12:16:25 -0800 | [diff] [blame] | 11751 | } |
Joshua Haberman | f41049a | 2022-01-21 14:41:25 -0800 | [diff] [blame] | 11752 | UPB_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 Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 11757 | if (upb_Decode(buf, size, UPB_UPCAST(ret), &google__protobuf__SourceCodeInfo__Location_msg_init, extreg, options, |
| 11758 | arena) != kUpb_DecodeStatus_Ok) { |
Joshua Haberman | f41049a | 2022-01-21 14:41:25 -0800 | [diff] [blame] | 11759 | return NULL; |
| 11760 | } |
| 11761 | return ret; |
Joshua Haberman | 9abf6e2 | 2021-01-13 12:16:25 -0800 | [diff] [blame] | 11762 | } |
Joshua Haberman | f41049a | 2022-01-21 14:41:25 -0800 | [diff] [blame] | 11763 | UPB_INLINE char* google_protobuf_SourceCodeInfo_Location_serialize(const google_protobuf_SourceCodeInfo_Location* msg, upb_Arena* arena, size_t* len) { |
Joshua Haberman | d3995ec | 2022-09-30 16:54:39 -0700 | [diff] [blame] | 11764 | char* ptr; |
Protobuf Team Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 11765 | (void)upb_Encode(UPB_UPCAST(msg), &google__protobuf__SourceCodeInfo__Location_msg_init, 0, arena, &ptr, len); |
Joshua Haberman | d3995ec | 2022-09-30 16:54:39 -0700 | [diff] [blame] | 11766 | return ptr; |
Joshua Haberman | f41049a | 2022-01-21 14:41:25 -0800 | [diff] [blame] | 11767 | } |
| 11768 | UPB_INLINE char* google_protobuf_SourceCodeInfo_Location_serialize_ex(const google_protobuf_SourceCodeInfo_Location* msg, int options, |
| 11769 | upb_Arena* arena, size_t* len) { |
Joshua Haberman | d3995ec | 2022-09-30 16:54:39 -0700 | [diff] [blame] | 11770 | char* ptr; |
Protobuf Team Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 11771 | (void)upb_Encode(UPB_UPCAST(msg), &google__protobuf__SourceCodeInfo__Location_msg_init, options, arena, &ptr, len); |
Joshua Haberman | d3995ec | 2022-09-30 16:54:39 -0700 | [diff] [blame] | 11772 | return ptr; |
| 11773 | } |
Mike Kruskal | 3bc5049 | 2022-12-01 13:34:12 -0800 | [diff] [blame] | 11774 | UPB_INLINE void google_protobuf_SourceCodeInfo_Location_clear_path(google_protobuf_SourceCodeInfo_Location* msg) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 11775 | 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 Bot | 4e90ead | 2024-01-08 15:46:34 +0000 | [diff] [blame] | 11776 | upb_Message_ClearBaseField(UPB_UPCAST(msg), &field); |
Joshua Haberman | f41049a | 2022-01-21 14:41:25 -0800 | [diff] [blame] | 11777 | } |
Eric Salo | b7d54ac | 2022-12-29 11:59:42 -0800 | [diff] [blame] | 11778 | UPB_INLINE int32_t const* google_protobuf_SourceCodeInfo_Location_path(const google_protobuf_SourceCodeInfo_Location* msg, size_t* size) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 11779 | 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 Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 11780 | const upb_Array* arr = upb_Message_GetArray(UPB_UPCAST(msg), &field); |
Eric Salo | b7d54ac | 2022-12-29 11:59:42 -0800 | [diff] [blame] | 11781 | if (arr) { |
Protobuf Team Bot | f73985a | 2023-12-19 00:14:19 +0000 | [diff] [blame] | 11782 | if (size) *size = arr->UPB_PRIVATE(size); |
Protobuf Team Bot | 81e5433 | 2024-01-11 21:04:07 +0000 | [diff] [blame] | 11783 | return (int32_t const*)upb_Array_DataPtr(arr); |
Eric Salo | b7d54ac | 2022-12-29 11:59:42 -0800 | [diff] [blame] | 11784 | } else { |
| 11785 | if (size) *size = 0; |
| 11786 | return NULL; |
| 11787 | } |
Joshua Haberman | d3995ec | 2022-09-30 16:54:39 -0700 | [diff] [blame] | 11788 | } |
Deanna Garcia | b26afb5 | 2023-04-25 13:37:18 -0700 | [diff] [blame] | 11789 | UPB_INLINE const upb_Array* _google_protobuf_SourceCodeInfo_Location_path_upb_array(const google_protobuf_SourceCodeInfo_Location* msg, size_t* size) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 11790 | 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 Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 11791 | const upb_Array* arr = upb_Message_GetArray(UPB_UPCAST(msg), &field); |
Deanna Garcia | b26afb5 | 2023-04-25 13:37:18 -0700 | [diff] [blame] | 11792 | if (size) { |
Protobuf Team Bot | f73985a | 2023-12-19 00:14:19 +0000 | [diff] [blame] | 11793 | *size = arr ? arr->UPB_PRIVATE(size) : 0; |
Deanna Garcia | b26afb5 | 2023-04-25 13:37:18 -0700 | [diff] [blame] | 11794 | } |
| 11795 | return arr; |
| 11796 | } |
Protobuf Team Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 11797 | UPB_INLINE upb_Array* _google_protobuf_SourceCodeInfo_Location_path_mutable_upb_array(google_protobuf_SourceCodeInfo_Location* msg, size_t* size, upb_Arena* arena) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 11798 | 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 Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 11799 | upb_Array* arr = upb_Message_GetOrCreateMutableArray(UPB_UPCAST(msg), |
| 11800 | &field, arena); |
Deanna Garcia | b26afb5 | 2023-04-25 13:37:18 -0700 | [diff] [blame] | 11801 | if (size) { |
Protobuf Team Bot | f73985a | 2023-12-19 00:14:19 +0000 | [diff] [blame] | 11802 | *size = arr ? arr->UPB_PRIVATE(size) : 0; |
Deanna Garcia | b26afb5 | 2023-04-25 13:37:18 -0700 | [diff] [blame] | 11803 | } |
| 11804 | return arr; |
| 11805 | } |
Mike Kruskal | 3bc5049 | 2022-12-01 13:34:12 -0800 | [diff] [blame] | 11806 | UPB_INLINE void google_protobuf_SourceCodeInfo_Location_clear_span(google_protobuf_SourceCodeInfo_Location* msg) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 11807 | 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 Bot | 4e90ead | 2024-01-08 15:46:34 +0000 | [diff] [blame] | 11808 | upb_Message_ClearBaseField(UPB_UPCAST(msg), &field); |
Joshua Haberman | 7ecf43f | 2022-03-14 13:11:29 -0700 | [diff] [blame] | 11809 | } |
Eric Salo | b7d54ac | 2022-12-29 11:59:42 -0800 | [diff] [blame] | 11810 | UPB_INLINE int32_t const* google_protobuf_SourceCodeInfo_Location_span(const google_protobuf_SourceCodeInfo_Location* msg, size_t* size) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 11811 | 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 Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 11812 | const upb_Array* arr = upb_Message_GetArray(UPB_UPCAST(msg), &field); |
Eric Salo | b7d54ac | 2022-12-29 11:59:42 -0800 | [diff] [blame] | 11813 | if (arr) { |
Protobuf Team Bot | f73985a | 2023-12-19 00:14:19 +0000 | [diff] [blame] | 11814 | if (size) *size = arr->UPB_PRIVATE(size); |
Protobuf Team Bot | 81e5433 | 2024-01-11 21:04:07 +0000 | [diff] [blame] | 11815 | return (int32_t const*)upb_Array_DataPtr(arr); |
Eric Salo | b7d54ac | 2022-12-29 11:59:42 -0800 | [diff] [blame] | 11816 | } else { |
| 11817 | if (size) *size = 0; |
| 11818 | return NULL; |
| 11819 | } |
Joshua Haberman | 7ecf43f | 2022-03-14 13:11:29 -0700 | [diff] [blame] | 11820 | } |
Deanna Garcia | b26afb5 | 2023-04-25 13:37:18 -0700 | [diff] [blame] | 11821 | UPB_INLINE const upb_Array* _google_protobuf_SourceCodeInfo_Location_span_upb_array(const google_protobuf_SourceCodeInfo_Location* msg, size_t* size) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 11822 | 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 Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 11823 | const upb_Array* arr = upb_Message_GetArray(UPB_UPCAST(msg), &field); |
Deanna Garcia | b26afb5 | 2023-04-25 13:37:18 -0700 | [diff] [blame] | 11824 | if (size) { |
Protobuf Team Bot | f73985a | 2023-12-19 00:14:19 +0000 | [diff] [blame] | 11825 | *size = arr ? arr->UPB_PRIVATE(size) : 0; |
Deanna Garcia | b26afb5 | 2023-04-25 13:37:18 -0700 | [diff] [blame] | 11826 | } |
| 11827 | return arr; |
| 11828 | } |
Protobuf Team Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 11829 | UPB_INLINE upb_Array* _google_protobuf_SourceCodeInfo_Location_span_mutable_upb_array(google_protobuf_SourceCodeInfo_Location* msg, size_t* size, upb_Arena* arena) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 11830 | 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 Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 11831 | upb_Array* arr = upb_Message_GetOrCreateMutableArray(UPB_UPCAST(msg), |
| 11832 | &field, arena); |
Deanna Garcia | b26afb5 | 2023-04-25 13:37:18 -0700 | [diff] [blame] | 11833 | if (size) { |
Protobuf Team Bot | f73985a | 2023-12-19 00:14:19 +0000 | [diff] [blame] | 11834 | *size = arr ? arr->UPB_PRIVATE(size) : 0; |
Deanna Garcia | b26afb5 | 2023-04-25 13:37:18 -0700 | [diff] [blame] | 11835 | } |
| 11836 | return arr; |
| 11837 | } |
Mike Kruskal | 3bc5049 | 2022-12-01 13:34:12 -0800 | [diff] [blame] | 11838 | UPB_INLINE void google_protobuf_SourceCodeInfo_Location_clear_leading_comments(google_protobuf_SourceCodeInfo_Location* msg) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 11839 | 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 Bot | 4e90ead | 2024-01-08 15:46:34 +0000 | [diff] [blame] | 11840 | upb_Message_ClearBaseField(UPB_UPCAST(msg), &field); |
Joshua Haberman | d3995ec | 2022-09-30 16:54:39 -0700 | [diff] [blame] | 11841 | } |
Joshua Haberman | f41049a | 2022-01-21 14:41:25 -0800 | [diff] [blame] | 11842 | UPB_INLINE upb_StringView google_protobuf_SourceCodeInfo_Location_leading_comments(const google_protobuf_SourceCodeInfo_Location* msg) { |
Eric Salo | 8809a11 | 2022-11-21 13:01:06 -0800 | [diff] [blame] | 11843 | upb_StringView default_val = upb_StringView_FromString(""); |
| 11844 | upb_StringView ret; |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 11845 | 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 Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 11846 | _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field, |
| 11847 | &default_val, &ret); |
Eric Salo | 8809a11 | 2022-11-21 13:01:06 -0800 | [diff] [blame] | 11848 | return ret; |
Joshua Haberman | f41049a | 2022-01-21 14:41:25 -0800 | [diff] [blame] | 11849 | } |
Mike Kruskal | 3bc5049 | 2022-12-01 13:34:12 -0800 | [diff] [blame] | 11850 | UPB_INLINE bool google_protobuf_SourceCodeInfo_Location_has_leading_comments(const google_protobuf_SourceCodeInfo_Location* msg) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 11851 | 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 Bot | 8c1f635 | 2024-01-10 05:18:15 +0000 | [diff] [blame] | 11852 | return upb_Message_HasBaseField(UPB_UPCAST(msg), &field); |
Joshua Haberman | 7ecf43f | 2022-03-14 13:11:29 -0700 | [diff] [blame] | 11853 | } |
Mike Kruskal | 3bc5049 | 2022-12-01 13:34:12 -0800 | [diff] [blame] | 11854 | UPB_INLINE void google_protobuf_SourceCodeInfo_Location_clear_trailing_comments(google_protobuf_SourceCodeInfo_Location* msg) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 11855 | 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 Bot | 4e90ead | 2024-01-08 15:46:34 +0000 | [diff] [blame] | 11856 | upb_Message_ClearBaseField(UPB_UPCAST(msg), &field); |
Joshua Haberman | d3995ec | 2022-09-30 16:54:39 -0700 | [diff] [blame] | 11857 | } |
Joshua Haberman | f41049a | 2022-01-21 14:41:25 -0800 | [diff] [blame] | 11858 | UPB_INLINE upb_StringView google_protobuf_SourceCodeInfo_Location_trailing_comments(const google_protobuf_SourceCodeInfo_Location* msg) { |
Eric Salo | 8809a11 | 2022-11-21 13:01:06 -0800 | [diff] [blame] | 11859 | upb_StringView default_val = upb_StringView_FromString(""); |
| 11860 | upb_StringView ret; |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 11861 | 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 Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 11862 | _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field, |
| 11863 | &default_val, &ret); |
Eric Salo | 8809a11 | 2022-11-21 13:01:06 -0800 | [diff] [blame] | 11864 | return ret; |
Joshua Haberman | d3995ec | 2022-09-30 16:54:39 -0700 | [diff] [blame] | 11865 | } |
Mike Kruskal | 3bc5049 | 2022-12-01 13:34:12 -0800 | [diff] [blame] | 11866 | UPB_INLINE bool google_protobuf_SourceCodeInfo_Location_has_trailing_comments(const google_protobuf_SourceCodeInfo_Location* msg) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 11867 | 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 Bot | 8c1f635 | 2024-01-10 05:18:15 +0000 | [diff] [blame] | 11868 | return upb_Message_HasBaseField(UPB_UPCAST(msg), &field); |
Mike Kruskal | 3bc5049 | 2022-12-01 13:34:12 -0800 | [diff] [blame] | 11869 | } |
| 11870 | UPB_INLINE void google_protobuf_SourceCodeInfo_Location_clear_leading_detached_comments(google_protobuf_SourceCodeInfo_Location* msg) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 11871 | 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 Bot | 4e90ead | 2024-01-08 15:46:34 +0000 | [diff] [blame] | 11872 | upb_Message_ClearBaseField(UPB_UPCAST(msg), &field); |
Joshua Haberman | f41049a | 2022-01-21 14:41:25 -0800 | [diff] [blame] | 11873 | } |
Eric Salo | b7d54ac | 2022-12-29 11:59:42 -0800 | [diff] [blame] | 11874 | UPB_INLINE upb_StringView const* google_protobuf_SourceCodeInfo_Location_leading_detached_comments(const google_protobuf_SourceCodeInfo_Location* msg, size_t* size) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 11875 | 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 Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 11876 | const upb_Array* arr = upb_Message_GetArray(UPB_UPCAST(msg), &field); |
Eric Salo | b7d54ac | 2022-12-29 11:59:42 -0800 | [diff] [blame] | 11877 | if (arr) { |
Protobuf Team Bot | f73985a | 2023-12-19 00:14:19 +0000 | [diff] [blame] | 11878 | if (size) *size = arr->UPB_PRIVATE(size); |
Protobuf Team Bot | 81e5433 | 2024-01-11 21:04:07 +0000 | [diff] [blame] | 11879 | return (upb_StringView const*)upb_Array_DataPtr(arr); |
Eric Salo | b7d54ac | 2022-12-29 11:59:42 -0800 | [diff] [blame] | 11880 | } else { |
| 11881 | if (size) *size = 0; |
| 11882 | return NULL; |
| 11883 | } |
Joshua Haberman | 7ecf43f | 2022-03-14 13:11:29 -0700 | [diff] [blame] | 11884 | } |
Deanna Garcia | b26afb5 | 2023-04-25 13:37:18 -0700 | [diff] [blame] | 11885 | UPB_INLINE const upb_Array* _google_protobuf_SourceCodeInfo_Location_leading_detached_comments_upb_array(const google_protobuf_SourceCodeInfo_Location* msg, size_t* size) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 11886 | 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 Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 11887 | const upb_Array* arr = upb_Message_GetArray(UPB_UPCAST(msg), &field); |
Deanna Garcia | b26afb5 | 2023-04-25 13:37:18 -0700 | [diff] [blame] | 11888 | if (size) { |
Protobuf Team Bot | f73985a | 2023-12-19 00:14:19 +0000 | [diff] [blame] | 11889 | *size = arr ? arr->UPB_PRIVATE(size) : 0; |
Deanna Garcia | b26afb5 | 2023-04-25 13:37:18 -0700 | [diff] [blame] | 11890 | } |
| 11891 | return arr; |
| 11892 | } |
Protobuf Team Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 11893 | UPB_INLINE upb_Array* _google_protobuf_SourceCodeInfo_Location_leading_detached_comments_mutable_upb_array(google_protobuf_SourceCodeInfo_Location* msg, size_t* size, upb_Arena* arena) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 11894 | 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 Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 11895 | upb_Array* arr = upb_Message_GetOrCreateMutableArray(UPB_UPCAST(msg), |
| 11896 | &field, arena); |
Deanna Garcia | b26afb5 | 2023-04-25 13:37:18 -0700 | [diff] [blame] | 11897 | if (size) { |
Protobuf Team Bot | f73985a | 2023-12-19 00:14:19 +0000 | [diff] [blame] | 11898 | *size = arr ? arr->UPB_PRIVATE(size) : 0; |
Deanna Garcia | b26afb5 | 2023-04-25 13:37:18 -0700 | [diff] [blame] | 11899 | } |
| 11900 | return arr; |
| 11901 | } |
Joshua Haberman | 9abf6e2 | 2021-01-13 12:16:25 -0800 | [diff] [blame] | 11902 | |
Eric Salo | b7d54ac | 2022-12-29 11:59:42 -0800 | [diff] [blame] | 11903 | UPB_INLINE int32_t* google_protobuf_SourceCodeInfo_Location_mutable_path(google_protobuf_SourceCodeInfo_Location* msg, size_t* size) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 11904 | 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 Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 11905 | upb_Array* arr = upb_Message_GetMutableArray(UPB_UPCAST(msg), &field); |
Eric Salo | b7d54ac | 2022-12-29 11:59:42 -0800 | [diff] [blame] | 11906 | if (arr) { |
Protobuf Team Bot | f73985a | 2023-12-19 00:14:19 +0000 | [diff] [blame] | 11907 | if (size) *size = arr->UPB_PRIVATE(size); |
Protobuf Team Bot | 81e5433 | 2024-01-11 21:04:07 +0000 | [diff] [blame] | 11908 | return (int32_t*)upb_Array_MutableDataPtr(arr); |
Eric Salo | b7d54ac | 2022-12-29 11:59:42 -0800 | [diff] [blame] | 11909 | } else { |
| 11910 | if (size) *size = 0; |
| 11911 | return NULL; |
| 11912 | } |
Joshua Haberman | 9abf6e2 | 2021-01-13 12:16:25 -0800 | [diff] [blame] | 11913 | } |
Eric Salo | b7d54ac | 2022-12-29 11:59:42 -0800 | [diff] [blame] | 11914 | UPB_INLINE int32_t* google_protobuf_SourceCodeInfo_Location_resize_path(google_protobuf_SourceCodeInfo_Location* msg, size_t size, upb_Arena* arena) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 11915 | 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 Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 11916 | return (int32_t*)upb_Message_ResizeArrayUninitialized(UPB_UPCAST(msg), |
| 11917 | &field, size, arena); |
Joshua Haberman | 9abf6e2 | 2021-01-13 12:16:25 -0800 | [diff] [blame] | 11918 | } |
Joshua Haberman | 7ecf43f | 2022-03-14 13:11:29 -0700 | [diff] [blame] | 11919 | UPB_INLINE bool google_protobuf_SourceCodeInfo_Location_add_path(google_protobuf_SourceCodeInfo_Location* msg, int32_t val, upb_Arena* arena) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 11920 | 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 Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 11921 | upb_Array* arr = upb_Message_GetOrCreateMutableArray( |
| 11922 | UPB_UPCAST(msg), &field, arena); |
Protobuf Team Bot | 81e5433 | 2024-01-11 21:04:07 +0000 | [diff] [blame] | 11923 | if (!arr || !UPB_PRIVATE(_upb_Array_ResizeUninitialized)( |
Protobuf Team Bot | f73985a | 2023-12-19 00:14:19 +0000 | [diff] [blame] | 11924 | arr, arr->UPB_PRIVATE(size) + 1, arena)) { |
Eric Salo | b7d54ac | 2022-12-29 11:59:42 -0800 | [diff] [blame] | 11925 | return false; |
| 11926 | } |
Protobuf Team Bot | f73985a | 2023-12-19 00:14:19 +0000 | [diff] [blame] | 11927 | UPB_PRIVATE(_upb_Array_Set) |
| 11928 | (arr, arr->UPB_PRIVATE(size) - 1, &val, sizeof(val)); |
Eric Salo | b7d54ac | 2022-12-29 11:59:42 -0800 | [diff] [blame] | 11929 | return true; |
Joshua Haberman | 9abf6e2 | 2021-01-13 12:16:25 -0800 | [diff] [blame] | 11930 | } |
Eric Salo | b7d54ac | 2022-12-29 11:59:42 -0800 | [diff] [blame] | 11931 | UPB_INLINE int32_t* google_protobuf_SourceCodeInfo_Location_mutable_span(google_protobuf_SourceCodeInfo_Location* msg, size_t* size) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 11932 | 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 Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 11933 | upb_Array* arr = upb_Message_GetMutableArray(UPB_UPCAST(msg), &field); |
Eric Salo | b7d54ac | 2022-12-29 11:59:42 -0800 | [diff] [blame] | 11934 | if (arr) { |
Protobuf Team Bot | f73985a | 2023-12-19 00:14:19 +0000 | [diff] [blame] | 11935 | if (size) *size = arr->UPB_PRIVATE(size); |
Protobuf Team Bot | 81e5433 | 2024-01-11 21:04:07 +0000 | [diff] [blame] | 11936 | return (int32_t*)upb_Array_MutableDataPtr(arr); |
Eric Salo | b7d54ac | 2022-12-29 11:59:42 -0800 | [diff] [blame] | 11937 | } else { |
| 11938 | if (size) *size = 0; |
| 11939 | return NULL; |
| 11940 | } |
Joshua Haberman | 9abf6e2 | 2021-01-13 12:16:25 -0800 | [diff] [blame] | 11941 | } |
Eric Salo | b7d54ac | 2022-12-29 11:59:42 -0800 | [diff] [blame] | 11942 | UPB_INLINE int32_t* google_protobuf_SourceCodeInfo_Location_resize_span(google_protobuf_SourceCodeInfo_Location* msg, size_t size, upb_Arena* arena) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 11943 | 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 Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 11944 | return (int32_t*)upb_Message_ResizeArrayUninitialized(UPB_UPCAST(msg), |
| 11945 | &field, size, arena); |
Joshua Haberman | 9abf6e2 | 2021-01-13 12:16:25 -0800 | [diff] [blame] | 11946 | } |
Joshua Haberman | 7ecf43f | 2022-03-14 13:11:29 -0700 | [diff] [blame] | 11947 | UPB_INLINE bool google_protobuf_SourceCodeInfo_Location_add_span(google_protobuf_SourceCodeInfo_Location* msg, int32_t val, upb_Arena* arena) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 11948 | 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 Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 11949 | upb_Array* arr = upb_Message_GetOrCreateMutableArray( |
| 11950 | UPB_UPCAST(msg), &field, arena); |
Protobuf Team Bot | 81e5433 | 2024-01-11 21:04:07 +0000 | [diff] [blame] | 11951 | if (!arr || !UPB_PRIVATE(_upb_Array_ResizeUninitialized)( |
Protobuf Team Bot | f73985a | 2023-12-19 00:14:19 +0000 | [diff] [blame] | 11952 | arr, arr->UPB_PRIVATE(size) + 1, arena)) { |
Eric Salo | b7d54ac | 2022-12-29 11:59:42 -0800 | [diff] [blame] | 11953 | return false; |
| 11954 | } |
Protobuf Team Bot | f73985a | 2023-12-19 00:14:19 +0000 | [diff] [blame] | 11955 | UPB_PRIVATE(_upb_Array_Set) |
| 11956 | (arr, arr->UPB_PRIVATE(size) - 1, &val, sizeof(val)); |
Eric Salo | b7d54ac | 2022-12-29 11:59:42 -0800 | [diff] [blame] | 11957 | return true; |
Joshua Haberman | 9abf6e2 | 2021-01-13 12:16:25 -0800 | [diff] [blame] | 11958 | } |
Joshua Haberman | f41049a | 2022-01-21 14:41:25 -0800 | [diff] [blame] | 11959 | UPB_INLINE void google_protobuf_SourceCodeInfo_Location_set_leading_comments(google_protobuf_SourceCodeInfo_Location *msg, upb_StringView value) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 11960 | 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 Bot | ac32c97 | 2024-04-10 03:30:05 +0000 | [diff] [blame] | 11961 | upb_Message_SetBaseField((upb_Message *)msg, &field, &value); |
Mike Kruskal | 232ecf4 | 2023-01-14 00:09:40 -0800 | [diff] [blame] | 11962 | } |
| 11963 | UPB_INLINE void google_protobuf_SourceCodeInfo_Location_set_trailing_comments(google_protobuf_SourceCodeInfo_Location *msg, upb_StringView value) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 11964 | 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 Bot | ac32c97 | 2024-04-10 03:30:05 +0000 | [diff] [blame] | 11965 | upb_Message_SetBaseField((upb_Message *)msg, &field, &value); |
Mike Kruskal | 232ecf4 | 2023-01-14 00:09:40 -0800 | [diff] [blame] | 11966 | } |
| 11967 | UPB_INLINE upb_StringView* google_protobuf_SourceCodeInfo_Location_mutable_leading_detached_comments(google_protobuf_SourceCodeInfo_Location* msg, size_t* size) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 11968 | 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 Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 11969 | upb_Array* arr = upb_Message_GetMutableArray(UPB_UPCAST(msg), &field); |
Eric Salo | b7d54ac | 2022-12-29 11:59:42 -0800 | [diff] [blame] | 11970 | if (arr) { |
Protobuf Team Bot | f73985a | 2023-12-19 00:14:19 +0000 | [diff] [blame] | 11971 | if (size) *size = arr->UPB_PRIVATE(size); |
Protobuf Team Bot | 81e5433 | 2024-01-11 21:04:07 +0000 | [diff] [blame] | 11972 | return (upb_StringView*)upb_Array_MutableDataPtr(arr); |
Eric Salo | b7d54ac | 2022-12-29 11:59:42 -0800 | [diff] [blame] | 11973 | } else { |
| 11974 | if (size) *size = 0; |
| 11975 | return NULL; |
| 11976 | } |
Joshua Haberman | 9abf6e2 | 2021-01-13 12:16:25 -0800 | [diff] [blame] | 11977 | } |
Eric Salo | b7d54ac | 2022-12-29 11:59:42 -0800 | [diff] [blame] | 11978 | UPB_INLINE upb_StringView* google_protobuf_SourceCodeInfo_Location_resize_leading_detached_comments(google_protobuf_SourceCodeInfo_Location* msg, size_t size, upb_Arena* arena) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 11979 | 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 Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 11980 | return (upb_StringView*)upb_Message_ResizeArrayUninitialized(UPB_UPCAST(msg), |
| 11981 | &field, size, arena); |
Joshua Haberman | 9abf6e2 | 2021-01-13 12:16:25 -0800 | [diff] [blame] | 11982 | } |
Joshua Haberman | 7ecf43f | 2022-03-14 13:11:29 -0700 | [diff] [blame] | 11983 | UPB_INLINE bool google_protobuf_SourceCodeInfo_Location_add_leading_detached_comments(google_protobuf_SourceCodeInfo_Location* msg, upb_StringView val, upb_Arena* arena) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 11984 | 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 Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 11985 | upb_Array* arr = upb_Message_GetOrCreateMutableArray( |
| 11986 | UPB_UPCAST(msg), &field, arena); |
Protobuf Team Bot | 81e5433 | 2024-01-11 21:04:07 +0000 | [diff] [blame] | 11987 | if (!arr || !UPB_PRIVATE(_upb_Array_ResizeUninitialized)( |
Protobuf Team Bot | f73985a | 2023-12-19 00:14:19 +0000 | [diff] [blame] | 11988 | arr, arr->UPB_PRIVATE(size) + 1, arena)) { |
Eric Salo | b7d54ac | 2022-12-29 11:59:42 -0800 | [diff] [blame] | 11989 | return false; |
| 11990 | } |
Protobuf Team Bot | f73985a | 2023-12-19 00:14:19 +0000 | [diff] [blame] | 11991 | UPB_PRIVATE(_upb_Array_Set) |
| 11992 | (arr, arr->UPB_PRIVATE(size) - 1, &val, sizeof(val)); |
Eric Salo | b7d54ac | 2022-12-29 11:59:42 -0800 | [diff] [blame] | 11993 | return true; |
Joshua Haberman | 9abf6e2 | 2021-01-13 12:16:25 -0800 | [diff] [blame] | 11994 | } |
| 11995 | |
| 11996 | /* google.protobuf.GeneratedCodeInfo */ |
| 11997 | |
Joshua Haberman | f41049a | 2022-01-21 14:41:25 -0800 | [diff] [blame] | 11998 | UPB_INLINE google_protobuf_GeneratedCodeInfo* google_protobuf_GeneratedCodeInfo_new(upb_Arena* arena) { |
Protobuf Team Bot | 4ffe086 | 2023-12-06 02:02:36 +0000 | [diff] [blame] | 11999 | return (google_protobuf_GeneratedCodeInfo*)_upb_Message_New(&google__protobuf__GeneratedCodeInfo_msg_init, arena); |
Joshua Haberman | 9abf6e2 | 2021-01-13 12:16:25 -0800 | [diff] [blame] | 12000 | } |
Joshua Haberman | f41049a | 2022-01-21 14:41:25 -0800 | [diff] [blame] | 12001 | UPB_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 Haberman | 9d578a3 | 2021-08-02 15:32:01 -0700 | [diff] [blame] | 12003 | if (!ret) return NULL; |
Protobuf Team Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 12004 | if (upb_Decode(buf, size, UPB_UPCAST(ret), &google__protobuf__GeneratedCodeInfo_msg_init, NULL, 0, arena) != |
| 12005 | kUpb_DecodeStatus_Ok) { |
Joshua Haberman | 9d578a3 | 2021-08-02 15:32:01 -0700 | [diff] [blame] | 12006 | return NULL; |
| 12007 | } |
| 12008 | return ret; |
Joshua Haberman | 9abf6e2 | 2021-01-13 12:16:25 -0800 | [diff] [blame] | 12009 | } |
Joshua Haberman | f41049a | 2022-01-21 14:41:25 -0800 | [diff] [blame] | 12010 | UPB_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 Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 12015 | if (upb_Decode(buf, size, UPB_UPCAST(ret), &google__protobuf__GeneratedCodeInfo_msg_init, extreg, options, |
| 12016 | arena) != kUpb_DecodeStatus_Ok) { |
Joshua Haberman | f41049a | 2022-01-21 14:41:25 -0800 | [diff] [blame] | 12017 | return NULL; |
| 12018 | } |
| 12019 | return ret; |
Joshua Haberman | 9abf6e2 | 2021-01-13 12:16:25 -0800 | [diff] [blame] | 12020 | } |
Joshua Haberman | f41049a | 2022-01-21 14:41:25 -0800 | [diff] [blame] | 12021 | UPB_INLINE char* google_protobuf_GeneratedCodeInfo_serialize(const google_protobuf_GeneratedCodeInfo* msg, upb_Arena* arena, size_t* len) { |
Joshua Haberman | d3995ec | 2022-09-30 16:54:39 -0700 | [diff] [blame] | 12022 | char* ptr; |
Protobuf Team Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 12023 | (void)upb_Encode(UPB_UPCAST(msg), &google__protobuf__GeneratedCodeInfo_msg_init, 0, arena, &ptr, len); |
Joshua Haberman | d3995ec | 2022-09-30 16:54:39 -0700 | [diff] [blame] | 12024 | return ptr; |
Joshua Haberman | f41049a | 2022-01-21 14:41:25 -0800 | [diff] [blame] | 12025 | } |
| 12026 | UPB_INLINE char* google_protobuf_GeneratedCodeInfo_serialize_ex(const google_protobuf_GeneratedCodeInfo* msg, int options, |
| 12027 | upb_Arena* arena, size_t* len) { |
Joshua Haberman | d3995ec | 2022-09-30 16:54:39 -0700 | [diff] [blame] | 12028 | char* ptr; |
Protobuf Team Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 12029 | (void)upb_Encode(UPB_UPCAST(msg), &google__protobuf__GeneratedCodeInfo_msg_init, options, arena, &ptr, len); |
Joshua Haberman | d3995ec | 2022-09-30 16:54:39 -0700 | [diff] [blame] | 12030 | return ptr; |
Joshua Haberman | f41049a | 2022-01-21 14:41:25 -0800 | [diff] [blame] | 12031 | } |
Mike Kruskal | 3bc5049 | 2022-12-01 13:34:12 -0800 | [diff] [blame] | 12032 | UPB_INLINE void google_protobuf_GeneratedCodeInfo_clear_annotation(google_protobuf_GeneratedCodeInfo* msg) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 12033 | 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 Bot | 4e90ead | 2024-01-08 15:46:34 +0000 | [diff] [blame] | 12034 | upb_Message_ClearBaseField(UPB_UPCAST(msg), &field); |
Joshua Haberman | d3995ec | 2022-09-30 16:54:39 -0700 | [diff] [blame] | 12035 | } |
Eric Salo | b7d54ac | 2022-12-29 11:59:42 -0800 | [diff] [blame] | 12036 | UPB_INLINE const google_protobuf_GeneratedCodeInfo_Annotation* const* google_protobuf_GeneratedCodeInfo_annotation(const google_protobuf_GeneratedCodeInfo* msg, size_t* size) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 12037 | 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 Bot | a9387b5 | 2024-06-12 15:17:52 +0000 | [diff] [blame] | 12038 | UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__GeneratedCodeInfo__Annotation_msg_init); |
Protobuf Team Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 12039 | const upb_Array* arr = upb_Message_GetArray(UPB_UPCAST(msg), &field); |
Eric Salo | b7d54ac | 2022-12-29 11:59:42 -0800 | [diff] [blame] | 12040 | if (arr) { |
Protobuf Team Bot | f73985a | 2023-12-19 00:14:19 +0000 | [diff] [blame] | 12041 | if (size) *size = arr->UPB_PRIVATE(size); |
Protobuf Team Bot | 81e5433 | 2024-01-11 21:04:07 +0000 | [diff] [blame] | 12042 | return (const google_protobuf_GeneratedCodeInfo_Annotation* const*)upb_Array_DataPtr(arr); |
Eric Salo | b7d54ac | 2022-12-29 11:59:42 -0800 | [diff] [blame] | 12043 | } else { |
| 12044 | if (size) *size = 0; |
| 12045 | return NULL; |
| 12046 | } |
Joshua Haberman | 7ecf43f | 2022-03-14 13:11:29 -0700 | [diff] [blame] | 12047 | } |
Deanna Garcia | b26afb5 | 2023-04-25 13:37:18 -0700 | [diff] [blame] | 12048 | UPB_INLINE const upb_Array* _google_protobuf_GeneratedCodeInfo_annotation_upb_array(const google_protobuf_GeneratedCodeInfo* msg, size_t* size) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 12049 | 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 Bot | a9387b5 | 2024-06-12 15:17:52 +0000 | [diff] [blame] | 12050 | UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__GeneratedCodeInfo__Annotation_msg_init); |
Protobuf Team Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 12051 | const upb_Array* arr = upb_Message_GetArray(UPB_UPCAST(msg), &field); |
Deanna Garcia | b26afb5 | 2023-04-25 13:37:18 -0700 | [diff] [blame] | 12052 | if (size) { |
Protobuf Team Bot | f73985a | 2023-12-19 00:14:19 +0000 | [diff] [blame] | 12053 | *size = arr ? arr->UPB_PRIVATE(size) : 0; |
Deanna Garcia | b26afb5 | 2023-04-25 13:37:18 -0700 | [diff] [blame] | 12054 | } |
| 12055 | return arr; |
| 12056 | } |
Protobuf Team Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 12057 | UPB_INLINE upb_Array* _google_protobuf_GeneratedCodeInfo_annotation_mutable_upb_array(google_protobuf_GeneratedCodeInfo* msg, size_t* size, upb_Arena* arena) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 12058 | 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 Bot | a9387b5 | 2024-06-12 15:17:52 +0000 | [diff] [blame] | 12059 | UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__GeneratedCodeInfo__Annotation_msg_init); |
Protobuf Team Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 12060 | upb_Array* arr = upb_Message_GetOrCreateMutableArray(UPB_UPCAST(msg), |
| 12061 | &field, arena); |
Deanna Garcia | b26afb5 | 2023-04-25 13:37:18 -0700 | [diff] [blame] | 12062 | if (size) { |
Protobuf Team Bot | f73985a | 2023-12-19 00:14:19 +0000 | [diff] [blame] | 12063 | *size = arr ? arr->UPB_PRIVATE(size) : 0; |
Deanna Garcia | b26afb5 | 2023-04-25 13:37:18 -0700 | [diff] [blame] | 12064 | } |
| 12065 | return arr; |
| 12066 | } |
Joshua Haberman | 9abf6e2 | 2021-01-13 12:16:25 -0800 | [diff] [blame] | 12067 | |
Eric Salo | b7d54ac | 2022-12-29 11:59:42 -0800 | [diff] [blame] | 12068 | UPB_INLINE google_protobuf_GeneratedCodeInfo_Annotation** google_protobuf_GeneratedCodeInfo_mutable_annotation(google_protobuf_GeneratedCodeInfo* msg, size_t* size) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 12069 | 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 Bot | a9387b5 | 2024-06-12 15:17:52 +0000 | [diff] [blame] | 12070 | UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__GeneratedCodeInfo__Annotation_msg_init); |
Protobuf Team Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 12071 | upb_Array* arr = upb_Message_GetMutableArray(UPB_UPCAST(msg), &field); |
Eric Salo | b7d54ac | 2022-12-29 11:59:42 -0800 | [diff] [blame] | 12072 | if (arr) { |
Protobuf Team Bot | f73985a | 2023-12-19 00:14:19 +0000 | [diff] [blame] | 12073 | if (size) *size = arr->UPB_PRIVATE(size); |
Protobuf Team Bot | 81e5433 | 2024-01-11 21:04:07 +0000 | [diff] [blame] | 12074 | return (google_protobuf_GeneratedCodeInfo_Annotation**)upb_Array_MutableDataPtr(arr); |
Eric Salo | b7d54ac | 2022-12-29 11:59:42 -0800 | [diff] [blame] | 12075 | } else { |
| 12076 | if (size) *size = 0; |
| 12077 | return NULL; |
| 12078 | } |
Joshua Haberman | 9abf6e2 | 2021-01-13 12:16:25 -0800 | [diff] [blame] | 12079 | } |
Eric Salo | b7d54ac | 2022-12-29 11:59:42 -0800 | [diff] [blame] | 12080 | UPB_INLINE google_protobuf_GeneratedCodeInfo_Annotation** google_protobuf_GeneratedCodeInfo_resize_annotation(google_protobuf_GeneratedCodeInfo* msg, size_t size, upb_Arena* arena) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 12081 | 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 Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 12082 | return (google_protobuf_GeneratedCodeInfo_Annotation**)upb_Message_ResizeArrayUninitialized(UPB_UPCAST(msg), |
| 12083 | &field, size, arena); |
Joshua Haberman | 9abf6e2 | 2021-01-13 12:16:25 -0800 | [diff] [blame] | 12084 | } |
Joshua Haberman | 7ecf43f | 2022-03-14 13:11:29 -0700 | [diff] [blame] | 12085 | UPB_INLINE struct google_protobuf_GeneratedCodeInfo_Annotation* google_protobuf_GeneratedCodeInfo_add_annotation(google_protobuf_GeneratedCodeInfo* msg, upb_Arena* arena) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 12086 | 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 Bot | a9387b5 | 2024-06-12 15:17:52 +0000 | [diff] [blame] | 12087 | UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__GeneratedCodeInfo__Annotation_msg_init); |
Protobuf Team Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 12088 | upb_Array* arr = upb_Message_GetOrCreateMutableArray( |
| 12089 | UPB_UPCAST(msg), &field, arena); |
Protobuf Team Bot | 81e5433 | 2024-01-11 21:04:07 +0000 | [diff] [blame] | 12090 | if (!arr || !UPB_PRIVATE(_upb_Array_ResizeUninitialized)( |
Protobuf Team Bot | f73985a | 2023-12-19 00:14:19 +0000 | [diff] [blame] | 12091 | arr, arr->UPB_PRIVATE(size) + 1, arena)) { |
Eric Salo | b7d54ac | 2022-12-29 11:59:42 -0800 | [diff] [blame] | 12092 | return NULL; |
| 12093 | } |
Protobuf Team Bot | 4ffe086 | 2023-12-06 02:02:36 +0000 | [diff] [blame] | 12094 | struct google_protobuf_GeneratedCodeInfo_Annotation* sub = (struct google_protobuf_GeneratedCodeInfo_Annotation*)_upb_Message_New(&google__protobuf__GeneratedCodeInfo__Annotation_msg_init, arena); |
Eric Salo | b7d54ac | 2022-12-29 11:59:42 -0800 | [diff] [blame] | 12095 | if (!arr || !sub) return NULL; |
Protobuf Team Bot | f73985a | 2023-12-19 00:14:19 +0000 | [diff] [blame] | 12096 | UPB_PRIVATE(_upb_Array_Set) |
| 12097 | (arr, arr->UPB_PRIVATE(size) - 1, &sub, sizeof(sub)); |
Joshua Haberman | 9abf6e2 | 2021-01-13 12:16:25 -0800 | [diff] [blame] | 12098 | return sub; |
| 12099 | } |
| 12100 | |
| 12101 | /* google.protobuf.GeneratedCodeInfo.Annotation */ |
| 12102 | |
Joshua Haberman | f41049a | 2022-01-21 14:41:25 -0800 | [diff] [blame] | 12103 | UPB_INLINE google_protobuf_GeneratedCodeInfo_Annotation* google_protobuf_GeneratedCodeInfo_Annotation_new(upb_Arena* arena) { |
Protobuf Team Bot | 4ffe086 | 2023-12-06 02:02:36 +0000 | [diff] [blame] | 12104 | return (google_protobuf_GeneratedCodeInfo_Annotation*)_upb_Message_New(&google__protobuf__GeneratedCodeInfo__Annotation_msg_init, arena); |
Joshua Haberman | 9abf6e2 | 2021-01-13 12:16:25 -0800 | [diff] [blame] | 12105 | } |
Joshua Haberman | f41049a | 2022-01-21 14:41:25 -0800 | [diff] [blame] | 12106 | UPB_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 Haberman | 9d578a3 | 2021-08-02 15:32:01 -0700 | [diff] [blame] | 12108 | if (!ret) return NULL; |
Protobuf Team Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 12109 | if (upb_Decode(buf, size, UPB_UPCAST(ret), &google__protobuf__GeneratedCodeInfo__Annotation_msg_init, NULL, 0, arena) != |
| 12110 | kUpb_DecodeStatus_Ok) { |
Joshua Haberman | 9d578a3 | 2021-08-02 15:32:01 -0700 | [diff] [blame] | 12111 | return NULL; |
| 12112 | } |
| 12113 | return ret; |
Joshua Haberman | 9abf6e2 | 2021-01-13 12:16:25 -0800 | [diff] [blame] | 12114 | } |
Joshua Haberman | f41049a | 2022-01-21 14:41:25 -0800 | [diff] [blame] | 12115 | UPB_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 Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 12120 | if (upb_Decode(buf, size, UPB_UPCAST(ret), &google__protobuf__GeneratedCodeInfo__Annotation_msg_init, extreg, options, |
| 12121 | arena) != kUpb_DecodeStatus_Ok) { |
Joshua Haberman | f41049a | 2022-01-21 14:41:25 -0800 | [diff] [blame] | 12122 | return NULL; |
| 12123 | } |
| 12124 | return ret; |
Joshua Haberman | 9abf6e2 | 2021-01-13 12:16:25 -0800 | [diff] [blame] | 12125 | } |
Joshua Haberman | f41049a | 2022-01-21 14:41:25 -0800 | [diff] [blame] | 12126 | UPB_INLINE char* google_protobuf_GeneratedCodeInfo_Annotation_serialize(const google_protobuf_GeneratedCodeInfo_Annotation* msg, upb_Arena* arena, size_t* len) { |
Joshua Haberman | d3995ec | 2022-09-30 16:54:39 -0700 | [diff] [blame] | 12127 | char* ptr; |
Protobuf Team Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 12128 | (void)upb_Encode(UPB_UPCAST(msg), &google__protobuf__GeneratedCodeInfo__Annotation_msg_init, 0, arena, &ptr, len); |
Joshua Haberman | d3995ec | 2022-09-30 16:54:39 -0700 | [diff] [blame] | 12129 | return ptr; |
Joshua Haberman | f41049a | 2022-01-21 14:41:25 -0800 | [diff] [blame] | 12130 | } |
| 12131 | UPB_INLINE char* google_protobuf_GeneratedCodeInfo_Annotation_serialize_ex(const google_protobuf_GeneratedCodeInfo_Annotation* msg, int options, |
| 12132 | upb_Arena* arena, size_t* len) { |
Joshua Haberman | d3995ec | 2022-09-30 16:54:39 -0700 | [diff] [blame] | 12133 | char* ptr; |
Protobuf Team Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 12134 | (void)upb_Encode(UPB_UPCAST(msg), &google__protobuf__GeneratedCodeInfo__Annotation_msg_init, options, arena, &ptr, len); |
Joshua Haberman | d3995ec | 2022-09-30 16:54:39 -0700 | [diff] [blame] | 12135 | return ptr; |
| 12136 | } |
Mike Kruskal | 3bc5049 | 2022-12-01 13:34:12 -0800 | [diff] [blame] | 12137 | UPB_INLINE void google_protobuf_GeneratedCodeInfo_Annotation_clear_path(google_protobuf_GeneratedCodeInfo_Annotation* msg) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 12138 | 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 Bot | 4e90ead | 2024-01-08 15:46:34 +0000 | [diff] [blame] | 12139 | upb_Message_ClearBaseField(UPB_UPCAST(msg), &field); |
Joshua Haberman | f41049a | 2022-01-21 14:41:25 -0800 | [diff] [blame] | 12140 | } |
Eric Salo | b7d54ac | 2022-12-29 11:59:42 -0800 | [diff] [blame] | 12141 | UPB_INLINE int32_t const* google_protobuf_GeneratedCodeInfo_Annotation_path(const google_protobuf_GeneratedCodeInfo_Annotation* msg, size_t* size) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 12142 | 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 Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 12143 | const upb_Array* arr = upb_Message_GetArray(UPB_UPCAST(msg), &field); |
Eric Salo | b7d54ac | 2022-12-29 11:59:42 -0800 | [diff] [blame] | 12144 | if (arr) { |
Protobuf Team Bot | f73985a | 2023-12-19 00:14:19 +0000 | [diff] [blame] | 12145 | if (size) *size = arr->UPB_PRIVATE(size); |
Protobuf Team Bot | 81e5433 | 2024-01-11 21:04:07 +0000 | [diff] [blame] | 12146 | return (int32_t const*)upb_Array_DataPtr(arr); |
Eric Salo | b7d54ac | 2022-12-29 11:59:42 -0800 | [diff] [blame] | 12147 | } else { |
| 12148 | if (size) *size = 0; |
| 12149 | return NULL; |
| 12150 | } |
Joshua Haberman | 7ecf43f | 2022-03-14 13:11:29 -0700 | [diff] [blame] | 12151 | } |
Deanna Garcia | b26afb5 | 2023-04-25 13:37:18 -0700 | [diff] [blame] | 12152 | UPB_INLINE const upb_Array* _google_protobuf_GeneratedCodeInfo_Annotation_path_upb_array(const google_protobuf_GeneratedCodeInfo_Annotation* msg, size_t* size) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 12153 | 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 Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 12154 | const upb_Array* arr = upb_Message_GetArray(UPB_UPCAST(msg), &field); |
Deanna Garcia | b26afb5 | 2023-04-25 13:37:18 -0700 | [diff] [blame] | 12155 | if (size) { |
Protobuf Team Bot | f73985a | 2023-12-19 00:14:19 +0000 | [diff] [blame] | 12156 | *size = arr ? arr->UPB_PRIVATE(size) : 0; |
Deanna Garcia | b26afb5 | 2023-04-25 13:37:18 -0700 | [diff] [blame] | 12157 | } |
| 12158 | return arr; |
| 12159 | } |
Protobuf Team Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 12160 | UPB_INLINE upb_Array* _google_protobuf_GeneratedCodeInfo_Annotation_path_mutable_upb_array(google_protobuf_GeneratedCodeInfo_Annotation* msg, size_t* size, upb_Arena* arena) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 12161 | 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 Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 12162 | upb_Array* arr = upb_Message_GetOrCreateMutableArray(UPB_UPCAST(msg), |
| 12163 | &field, arena); |
Deanna Garcia | b26afb5 | 2023-04-25 13:37:18 -0700 | [diff] [blame] | 12164 | if (size) { |
Protobuf Team Bot | f73985a | 2023-12-19 00:14:19 +0000 | [diff] [blame] | 12165 | *size = arr ? arr->UPB_PRIVATE(size) : 0; |
Deanna Garcia | b26afb5 | 2023-04-25 13:37:18 -0700 | [diff] [blame] | 12166 | } |
| 12167 | return arr; |
| 12168 | } |
Mike Kruskal | 3bc5049 | 2022-12-01 13:34:12 -0800 | [diff] [blame] | 12169 | UPB_INLINE void google_protobuf_GeneratedCodeInfo_Annotation_clear_source_file(google_protobuf_GeneratedCodeInfo_Annotation* msg) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 12170 | 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 Bot | 4e90ead | 2024-01-08 15:46:34 +0000 | [diff] [blame] | 12171 | upb_Message_ClearBaseField(UPB_UPCAST(msg), &field); |
Joshua Haberman | d3995ec | 2022-09-30 16:54:39 -0700 | [diff] [blame] | 12172 | } |
Joshua Haberman | f41049a | 2022-01-21 14:41:25 -0800 | [diff] [blame] | 12173 | UPB_INLINE upb_StringView google_protobuf_GeneratedCodeInfo_Annotation_source_file(const google_protobuf_GeneratedCodeInfo_Annotation* msg) { |
Eric Salo | 8809a11 | 2022-11-21 13:01:06 -0800 | [diff] [blame] | 12174 | upb_StringView default_val = upb_StringView_FromString(""); |
| 12175 | upb_StringView ret; |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 12176 | 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 Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 12177 | _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field, |
| 12178 | &default_val, &ret); |
Eric Salo | 8809a11 | 2022-11-21 13:01:06 -0800 | [diff] [blame] | 12179 | return ret; |
Joshua Haberman | f41049a | 2022-01-21 14:41:25 -0800 | [diff] [blame] | 12180 | } |
Mike Kruskal | 3bc5049 | 2022-12-01 13:34:12 -0800 | [diff] [blame] | 12181 | UPB_INLINE bool google_protobuf_GeneratedCodeInfo_Annotation_has_source_file(const google_protobuf_GeneratedCodeInfo_Annotation* msg) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 12182 | 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 Bot | 8c1f635 | 2024-01-10 05:18:15 +0000 | [diff] [blame] | 12183 | return upb_Message_HasBaseField(UPB_UPCAST(msg), &field); |
Joshua Haberman | 7ecf43f | 2022-03-14 13:11:29 -0700 | [diff] [blame] | 12184 | } |
Mike Kruskal | 3bc5049 | 2022-12-01 13:34:12 -0800 | [diff] [blame] | 12185 | UPB_INLINE void google_protobuf_GeneratedCodeInfo_Annotation_clear_begin(google_protobuf_GeneratedCodeInfo_Annotation* msg) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 12186 | 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 Bot | 4e90ead | 2024-01-08 15:46:34 +0000 | [diff] [blame] | 12187 | upb_Message_ClearBaseField(UPB_UPCAST(msg), &field); |
Joshua Haberman | d3995ec | 2022-09-30 16:54:39 -0700 | [diff] [blame] | 12188 | } |
Joshua Haberman | f41049a | 2022-01-21 14:41:25 -0800 | [diff] [blame] | 12189 | UPB_INLINE int32_t google_protobuf_GeneratedCodeInfo_Annotation_begin(const google_protobuf_GeneratedCodeInfo_Annotation* msg) { |
Eric Salo | 8809a11 | 2022-11-21 13:01:06 -0800 | [diff] [blame] | 12190 | int32_t default_val = (int32_t)0; |
| 12191 | int32_t ret; |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 12192 | 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 Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 12193 | _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field, |
| 12194 | &default_val, &ret); |
Eric Salo | 8809a11 | 2022-11-21 13:01:06 -0800 | [diff] [blame] | 12195 | return ret; |
Joshua Haberman | f41049a | 2022-01-21 14:41:25 -0800 | [diff] [blame] | 12196 | } |
Mike Kruskal | 3bc5049 | 2022-12-01 13:34:12 -0800 | [diff] [blame] | 12197 | UPB_INLINE bool google_protobuf_GeneratedCodeInfo_Annotation_has_begin(const google_protobuf_GeneratedCodeInfo_Annotation* msg) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 12198 | 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 Bot | 8c1f635 | 2024-01-10 05:18:15 +0000 | [diff] [blame] | 12199 | return upb_Message_HasBaseField(UPB_UPCAST(msg), &field); |
Joshua Haberman | 7ecf43f | 2022-03-14 13:11:29 -0700 | [diff] [blame] | 12200 | } |
Mike Kruskal | 3bc5049 | 2022-12-01 13:34:12 -0800 | [diff] [blame] | 12201 | UPB_INLINE void google_protobuf_GeneratedCodeInfo_Annotation_clear_end(google_protobuf_GeneratedCodeInfo_Annotation* msg) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 12202 | 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 Bot | 4e90ead | 2024-01-08 15:46:34 +0000 | [diff] [blame] | 12203 | upb_Message_ClearBaseField(UPB_UPCAST(msg), &field); |
Joshua Haberman | d3995ec | 2022-09-30 16:54:39 -0700 | [diff] [blame] | 12204 | } |
Joshua Haberman | f41049a | 2022-01-21 14:41:25 -0800 | [diff] [blame] | 12205 | UPB_INLINE int32_t google_protobuf_GeneratedCodeInfo_Annotation_end(const google_protobuf_GeneratedCodeInfo_Annotation* msg) { |
Eric Salo | 8809a11 | 2022-11-21 13:01:06 -0800 | [diff] [blame] | 12206 | int32_t default_val = (int32_t)0; |
| 12207 | int32_t ret; |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 12208 | 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 Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 12209 | _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field, |
| 12210 | &default_val, &ret); |
Eric Salo | 8809a11 | 2022-11-21 13:01:06 -0800 | [diff] [blame] | 12211 | return ret; |
Joshua Haberman | f41049a | 2022-01-21 14:41:25 -0800 | [diff] [blame] | 12212 | } |
Mike Kruskal | 3bc5049 | 2022-12-01 13:34:12 -0800 | [diff] [blame] | 12213 | UPB_INLINE bool google_protobuf_GeneratedCodeInfo_Annotation_has_end(const google_protobuf_GeneratedCodeInfo_Annotation* msg) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 12214 | 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 Bot | 8c1f635 | 2024-01-10 05:18:15 +0000 | [diff] [blame] | 12215 | return upb_Message_HasBaseField(UPB_UPCAST(msg), &field); |
Joshua Haberman | d3995ec | 2022-09-30 16:54:39 -0700 | [diff] [blame] | 12216 | } |
Mike Kruskal | 3bc5049 | 2022-12-01 13:34:12 -0800 | [diff] [blame] | 12217 | UPB_INLINE void google_protobuf_GeneratedCodeInfo_Annotation_clear_semantic(google_protobuf_GeneratedCodeInfo_Annotation* msg) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 12218 | 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 Bot | 4e90ead | 2024-01-08 15:46:34 +0000 | [diff] [blame] | 12219 | upb_Message_ClearBaseField(UPB_UPCAST(msg), &field); |
Joshua Haberman | d3995ec | 2022-09-30 16:54:39 -0700 | [diff] [blame] | 12220 | } |
| 12221 | UPB_INLINE int32_t google_protobuf_GeneratedCodeInfo_Annotation_semantic(const google_protobuf_GeneratedCodeInfo_Annotation* msg) { |
Eric Salo | 8809a11 | 2022-11-21 13:01:06 -0800 | [diff] [blame] | 12222 | int32_t default_val = 0; |
| 12223 | int32_t ret; |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 12224 | 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 Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 12225 | _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field, |
| 12226 | &default_val, &ret); |
Eric Salo | 8809a11 | 2022-11-21 13:01:06 -0800 | [diff] [blame] | 12227 | return ret; |
Joshua Haberman | d3995ec | 2022-09-30 16:54:39 -0700 | [diff] [blame] | 12228 | } |
Mike Kruskal | 3bc5049 | 2022-12-01 13:34:12 -0800 | [diff] [blame] | 12229 | UPB_INLINE bool google_protobuf_GeneratedCodeInfo_Annotation_has_semantic(const google_protobuf_GeneratedCodeInfo_Annotation* msg) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 12230 | 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 Bot | 8c1f635 | 2024-01-10 05:18:15 +0000 | [diff] [blame] | 12231 | return upb_Message_HasBaseField(UPB_UPCAST(msg), &field); |
Mike Kruskal | 3bc5049 | 2022-12-01 13:34:12 -0800 | [diff] [blame] | 12232 | } |
Joshua Haberman | 9abf6e2 | 2021-01-13 12:16:25 -0800 | [diff] [blame] | 12233 | |
Eric Salo | b7d54ac | 2022-12-29 11:59:42 -0800 | [diff] [blame] | 12234 | UPB_INLINE int32_t* google_protobuf_GeneratedCodeInfo_Annotation_mutable_path(google_protobuf_GeneratedCodeInfo_Annotation* msg, size_t* size) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 12235 | 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 Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 12236 | upb_Array* arr = upb_Message_GetMutableArray(UPB_UPCAST(msg), &field); |
Eric Salo | b7d54ac | 2022-12-29 11:59:42 -0800 | [diff] [blame] | 12237 | if (arr) { |
Protobuf Team Bot | f73985a | 2023-12-19 00:14:19 +0000 | [diff] [blame] | 12238 | if (size) *size = arr->UPB_PRIVATE(size); |
Protobuf Team Bot | 81e5433 | 2024-01-11 21:04:07 +0000 | [diff] [blame] | 12239 | return (int32_t*)upb_Array_MutableDataPtr(arr); |
Eric Salo | b7d54ac | 2022-12-29 11:59:42 -0800 | [diff] [blame] | 12240 | } else { |
| 12241 | if (size) *size = 0; |
| 12242 | return NULL; |
| 12243 | } |
Joshua Haberman | 9abf6e2 | 2021-01-13 12:16:25 -0800 | [diff] [blame] | 12244 | } |
Eric Salo | b7d54ac | 2022-12-29 11:59:42 -0800 | [diff] [blame] | 12245 | UPB_INLINE int32_t* google_protobuf_GeneratedCodeInfo_Annotation_resize_path(google_protobuf_GeneratedCodeInfo_Annotation* msg, size_t size, upb_Arena* arena) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 12246 | 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 Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 12247 | return (int32_t*)upb_Message_ResizeArrayUninitialized(UPB_UPCAST(msg), |
| 12248 | &field, size, arena); |
Joshua Haberman | 9abf6e2 | 2021-01-13 12:16:25 -0800 | [diff] [blame] | 12249 | } |
Joshua Haberman | 7ecf43f | 2022-03-14 13:11:29 -0700 | [diff] [blame] | 12250 | UPB_INLINE bool google_protobuf_GeneratedCodeInfo_Annotation_add_path(google_protobuf_GeneratedCodeInfo_Annotation* msg, int32_t val, upb_Arena* arena) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 12251 | 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 Bot | 4a8f21e | 2023-12-21 16:23:10 +0000 | [diff] [blame] | 12252 | upb_Array* arr = upb_Message_GetOrCreateMutableArray( |
| 12253 | UPB_UPCAST(msg), &field, arena); |
Protobuf Team Bot | 81e5433 | 2024-01-11 21:04:07 +0000 | [diff] [blame] | 12254 | if (!arr || !UPB_PRIVATE(_upb_Array_ResizeUninitialized)( |
Protobuf Team Bot | f73985a | 2023-12-19 00:14:19 +0000 | [diff] [blame] | 12255 | arr, arr->UPB_PRIVATE(size) + 1, arena)) { |
Eric Salo | b7d54ac | 2022-12-29 11:59:42 -0800 | [diff] [blame] | 12256 | return false; |
| 12257 | } |
Protobuf Team Bot | f73985a | 2023-12-19 00:14:19 +0000 | [diff] [blame] | 12258 | UPB_PRIVATE(_upb_Array_Set) |
| 12259 | (arr, arr->UPB_PRIVATE(size) - 1, &val, sizeof(val)); |
Eric Salo | b7d54ac | 2022-12-29 11:59:42 -0800 | [diff] [blame] | 12260 | return true; |
Joshua Haberman | 9abf6e2 | 2021-01-13 12:16:25 -0800 | [diff] [blame] | 12261 | } |
Joshua Haberman | f41049a | 2022-01-21 14:41:25 -0800 | [diff] [blame] | 12262 | UPB_INLINE void google_protobuf_GeneratedCodeInfo_Annotation_set_source_file(google_protobuf_GeneratedCodeInfo_Annotation *msg, upb_StringView value) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 12263 | 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 Bot | ac32c97 | 2024-04-10 03:30:05 +0000 | [diff] [blame] | 12264 | upb_Message_SetBaseField((upb_Message *)msg, &field, &value); |
Mike Kruskal | 232ecf4 | 2023-01-14 00:09:40 -0800 | [diff] [blame] | 12265 | } |
| 12266 | UPB_INLINE void google_protobuf_GeneratedCodeInfo_Annotation_set_begin(google_protobuf_GeneratedCodeInfo_Annotation *msg, int32_t value) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 12267 | 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 Bot | ac32c97 | 2024-04-10 03:30:05 +0000 | [diff] [blame] | 12268 | upb_Message_SetBaseField((upb_Message *)msg, &field, &value); |
Mike Kruskal | 232ecf4 | 2023-01-14 00:09:40 -0800 | [diff] [blame] | 12269 | } |
| 12270 | UPB_INLINE void google_protobuf_GeneratedCodeInfo_Annotation_set_end(google_protobuf_GeneratedCodeInfo_Annotation *msg, int32_t value) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 12271 | 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 Bot | ac32c97 | 2024-04-10 03:30:05 +0000 | [diff] [blame] | 12272 | upb_Message_SetBaseField((upb_Message *)msg, &field, &value); |
Mike Kruskal | 232ecf4 | 2023-01-14 00:09:40 -0800 | [diff] [blame] | 12273 | } |
| 12274 | UPB_INLINE void google_protobuf_GeneratedCodeInfo_Annotation_set_semantic(google_protobuf_GeneratedCodeInfo_Annotation *msg, int32_t value) { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 12275 | 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 Bot | ac32c97 | 2024-04-10 03:30:05 +0000 | [diff] [blame] | 12276 | upb_Message_SetBaseField((upb_Message *)msg, &field, &value); |
Joshua Haberman | 9abf6e2 | 2021-01-13 12:16:25 -0800 | [diff] [blame] | 12277 | } |
Mike Kruskal | 232ecf4 | 2023-01-14 00:09:40 -0800 | [diff] [blame] | 12278 | |
Joshua Haberman | f41049a | 2022-01-21 14:41:25 -0800 | [diff] [blame] | 12279 | /* Max size 32 is google.protobuf.FileOptions */ |
| 12280 | /* Max size 64 is google.protobuf.FileOptions */ |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 12281 | #define _UPB_MAXOPT_SIZE UPB_SIZE(112, 200) |
Joshua Haberman | f41049a | 2022-01-21 14:41:25 -0800 | [diff] [blame] | 12282 | |
Joshua Haberman | 9abf6e2 | 2021-01-13 12:16:25 -0800 | [diff] [blame] | 12283 | #ifdef __cplusplus |
| 12284 | } /* extern "C" */ |
| 12285 | #endif |
| 12286 | |
| 12287 | |
| 12288 | #endif /* GOOGLE_PROTOBUF_DESCRIPTOR_PROTO_UPB_H_ */ |
Mike Kruskal | 232ecf4 | 2023-01-14 00:09:40 -0800 | [diff] [blame] | 12289 | // end:github_only |
Eric Salo | 8809a11 | 2022-11-21 13:01:06 -0800 | [diff] [blame] | 12290 | |
Protobuf Team Bot | 7dabac9 | 2023-09-07 18:35:50 +0000 | [diff] [blame] | 12291 | typedef enum { |
| 12292 | kUpb_Syntax_Proto2 = 2, |
| 12293 | kUpb_Syntax_Proto3 = 3, |
| 12294 | kUpb_Syntax_Editions = 99 |
| 12295 | } upb_Syntax; |
Eric Salo | 8809a11 | 2022-11-21 13:01:06 -0800 | [diff] [blame] | 12296 | |
| 12297 | // Forward declarations for circular references. |
| 12298 | typedef struct upb_DefPool upb_DefPool; |
| 12299 | typedef struct upb_EnumDef upb_EnumDef; |
| 12300 | typedef struct upb_EnumReservedRange upb_EnumReservedRange; |
| 12301 | typedef struct upb_EnumValueDef upb_EnumValueDef; |
| 12302 | typedef struct upb_ExtensionRange upb_ExtensionRange; |
| 12303 | typedef struct upb_FieldDef upb_FieldDef; |
| 12304 | typedef struct upb_FileDef upb_FileDef; |
| 12305 | typedef struct upb_MessageDef upb_MessageDef; |
| 12306 | typedef struct upb_MessageReservedRange upb_MessageReservedRange; |
| 12307 | typedef struct upb_MethodDef upb_MethodDef; |
| 12308 | typedef struct upb_OneofDef upb_OneofDef; |
| 12309 | typedef struct upb_ServiceDef upb_ServiceDef; |
| 12310 | |
| 12311 | // EVERYTHING BELOW THIS LINE IS INTERNAL - DO NOT USE ///////////////////////// |
| 12312 | |
| 12313 | typedef 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. |
| 12324 | typedef 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 Salo | 8809a11 | 2022-11-21 13:01:06 -0800 | [diff] [blame] | 12337 | } upb_deftype_t; |
| 12338 | |
| 12339 | #ifdef __cplusplus |
| 12340 | extern "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). |
| 12351 | UPB_INLINE void _upb_DefType_CheckPadding(size_t size) { |
| 12352 | UPB_ASSERT((size & UPB_DEFTYPE_MASK) == 0); |
| 12353 | } |
| 12354 | |
| 12355 | upb_deftype_t _upb_DefType_Type(upb_value v); |
| 12356 | |
| 12357 | upb_value _upb_DefType_Pack(const void* ptr, upb_deftype_t type); |
| 12358 | |
| 12359 | const 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 |
| 12371 | extern "C" { |
| 12372 | #endif |
| 12373 | |
Jason Lunn | 67dee29 | 2023-07-13 13:15:26 -0700 | [diff] [blame] | 12374 | UPB_API void upb_DefPool_Free(upb_DefPool* s); |
Eric Salo | 8809a11 | 2022-11-21 13:01:06 -0800 | [diff] [blame] | 12375 | |
Jason Lunn | 67dee29 | 2023-07-13 13:15:26 -0700 | [diff] [blame] | 12376 | UPB_API upb_DefPool* upb_DefPool_New(void); |
Eric Salo | 8809a11 | 2022-11-21 13:01:06 -0800 | [diff] [blame] | 12377 | |
Protobuf Team Bot | ce9dcc2 | 2023-11-03 22:38:26 +0000 | [diff] [blame] | 12378 | UPB_API const UPB_DESC(FeatureSetDefaults) * |
| 12379 | upb_DefPool_FeatureSetDefaults(const upb_DefPool* s); |
| 12380 | |
Protobuf Team Bot | c6b149c | 2023-11-10 23:37:46 +0000 | [diff] [blame] | 12381 | UPB_API bool upb_DefPool_SetFeatureSetDefaults(upb_DefPool* s, |
| 12382 | const char* serialized_defaults, |
| 12383 | size_t serialized_len, |
| 12384 | upb_Status* status); |
| 12385 | |
Jason Lunn | 67dee29 | 2023-07-13 13:15:26 -0700 | [diff] [blame] | 12386 | UPB_API const upb_MessageDef* upb_DefPool_FindMessageByName( |
| 12387 | const upb_DefPool* s, const char* sym); |
Eric Salo | 8809a11 | 2022-11-21 13:01:06 -0800 | [diff] [blame] | 12388 | |
| 12389 | const upb_MessageDef* upb_DefPool_FindMessageByNameWithSize( |
| 12390 | const upb_DefPool* s, const char* sym, size_t len); |
| 12391 | |
Jason Lunn | 67dee29 | 2023-07-13 13:15:26 -0700 | [diff] [blame] | 12392 | UPB_API const upb_EnumDef* upb_DefPool_FindEnumByName(const upb_DefPool* s, |
| 12393 | const char* sym); |
Eric Salo | 8809a11 | 2022-11-21 13:01:06 -0800 | [diff] [blame] | 12394 | |
| 12395 | const upb_EnumValueDef* upb_DefPool_FindEnumByNameval(const upb_DefPool* s, |
| 12396 | const char* sym); |
| 12397 | |
| 12398 | const upb_FileDef* upb_DefPool_FindFileByName(const upb_DefPool* s, |
| 12399 | const char* name); |
| 12400 | |
| 12401 | const upb_FileDef* upb_DefPool_FindFileByNameWithSize(const upb_DefPool* s, |
| 12402 | const char* name, |
| 12403 | size_t len); |
| 12404 | |
| 12405 | const upb_FieldDef* upb_DefPool_FindExtensionByMiniTable( |
| 12406 | const upb_DefPool* s, const upb_MiniTableExtension* ext); |
| 12407 | |
Protobuf Team Bot | 8aad058 | 2023-11-14 23:47:47 +0000 | [diff] [blame] | 12408 | UPB_API const upb_FieldDef* upb_DefPool_FindExtensionByName(const upb_DefPool* s, |
Eric Salo | 8809a11 | 2022-11-21 13:01:06 -0800 | [diff] [blame] | 12409 | const char* sym); |
| 12410 | |
| 12411 | const upb_FieldDef* upb_DefPool_FindExtensionByNameWithSize( |
| 12412 | const upb_DefPool* s, const char* name, size_t size); |
| 12413 | |
| 12414 | const upb_FieldDef* upb_DefPool_FindExtensionByNumber(const upb_DefPool* s, |
| 12415 | const upb_MessageDef* m, |
| 12416 | int32_t fieldnum); |
| 12417 | |
Protobuf Team Bot | 312240c | 2024-03-22 17:47:13 +0000 | [diff] [blame] | 12418 | UPB_API const upb_ServiceDef* upb_DefPool_FindServiceByName( |
| 12419 | const upb_DefPool* s, const char* name); |
Eric Salo | 8809a11 | 2022-11-21 13:01:06 -0800 | [diff] [blame] | 12420 | |
| 12421 | const upb_ServiceDef* upb_DefPool_FindServiceByNameWithSize( |
| 12422 | const upb_DefPool* s, const char* name, size_t size); |
| 12423 | |
| 12424 | const upb_FileDef* upb_DefPool_FindFileContainingSymbol(const upb_DefPool* s, |
| 12425 | const char* name); |
| 12426 | |
Jason Lunn | 67dee29 | 2023-07-13 13:15:26 -0700 | [diff] [blame] | 12427 | UPB_API const upb_FileDef* upb_DefPool_AddFile( |
| 12428 | upb_DefPool* s, const UPB_DESC(FileDescriptorProto) * file_proto, |
| 12429 | upb_Status* status); |
Eric Salo | 8809a11 | 2022-11-21 13:01:06 -0800 | [diff] [blame] | 12430 | |
Protobuf Team Bot | 8aad058 | 2023-11-14 23:47:47 +0000 | [diff] [blame] | 12431 | UPB_API const upb_ExtensionRegistry* upb_DefPool_ExtensionRegistry( |
Eric Salo | 8809a11 | 2022-11-21 13:01:06 -0800 | [diff] [blame] | 12432 | const upb_DefPool* s); |
| 12433 | |
| 12434 | const 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 Bot | 0631035 | 2023-09-26 21:54:58 +0000 | [diff] [blame] | 12445 | // IWYU pragma: private, include "upb/reflection/def.h" |
Eric Salo | 8809a11 | 2022-11-21 13:01:06 -0800 | [diff] [blame] | 12446 | |
| 12447 | #ifndef UPB_REFLECTION_ENUM_DEF_H_ |
| 12448 | #define UPB_REFLECTION_ENUM_DEF_H_ |
Joshua Haberman | d3995ec | 2022-09-30 16:54:39 -0700 | [diff] [blame] | 12449 | |
| 12450 | |
| 12451 | // Must be last. |
Joshua Haberman | 9abf6e2 | 2021-01-13 12:16:25 -0800 | [diff] [blame] | 12452 | |
| 12453 | #ifdef __cplusplus |
| 12454 | extern "C" { |
Joshua Haberman | d3995ec | 2022-09-30 16:54:39 -0700 | [diff] [blame] | 12455 | #endif |
Joshua Haberman | 9abf6e2 | 2021-01-13 12:16:25 -0800 | [diff] [blame] | 12456 | |
Eric Salo | 8809a11 | 2022-11-21 13:01:06 -0800 | [diff] [blame] | 12457 | bool upb_EnumDef_CheckNumber(const upb_EnumDef* e, int32_t num); |
| 12458 | const upb_MessageDef* upb_EnumDef_ContainingType(const upb_EnumDef* e); |
| 12459 | int32_t upb_EnumDef_Default(const upb_EnumDef* e); |
Jason Lunn | 67dee29 | 2023-07-13 13:15:26 -0700 | [diff] [blame] | 12460 | UPB_API const upb_FileDef* upb_EnumDef_File(const upb_EnumDef* e); |
Eric Salo | 8809a11 | 2022-11-21 13:01:06 -0800 | [diff] [blame] | 12461 | const upb_EnumValueDef* upb_EnumDef_FindValueByName(const upb_EnumDef* e, |
| 12462 | const char* name); |
Jason Lunn | 67dee29 | 2023-07-13 13:15:26 -0700 | [diff] [blame] | 12463 | UPB_API const upb_EnumValueDef* upb_EnumDef_FindValueByNameWithSize( |
Eric Salo | 8809a11 | 2022-11-21 13:01:06 -0800 | [diff] [blame] | 12464 | const upb_EnumDef* e, const char* name, size_t size); |
Jason Lunn | 67dee29 | 2023-07-13 13:15:26 -0700 | [diff] [blame] | 12465 | UPB_API const upb_EnumValueDef* upb_EnumDef_FindValueByNumber( |
| 12466 | const upb_EnumDef* e, int32_t num); |
| 12467 | UPB_API const char* upb_EnumDef_FullName(const upb_EnumDef* e); |
Eric Salo | 8809a11 | 2022-11-21 13:01:06 -0800 | [diff] [blame] | 12468 | bool upb_EnumDef_HasOptions(const upb_EnumDef* e); |
| 12469 | bool upb_EnumDef_IsClosed(const upb_EnumDef* e); |
Protobuf Team Bot | 5e8d7e5 | 2024-03-15 22:28:30 +0000 | [diff] [blame] | 12470 | bool upb_EnumDef_IsSpecifiedAsClosed(const upb_EnumDef* e); |
Eric Salo | 8809a11 | 2022-11-21 13:01:06 -0800 | [diff] [blame] | 12471 | |
| 12472 | // Creates a mini descriptor string for an enum, returns true on success. |
| 12473 | bool upb_EnumDef_MiniDescriptorEncode(const upb_EnumDef* e, upb_Arena* a, |
| 12474 | upb_StringView* out); |
| 12475 | |
| 12476 | const char* upb_EnumDef_Name(const upb_EnumDef* e); |
Mike Kruskal | 232ecf4 | 2023-01-14 00:09:40 -0800 | [diff] [blame] | 12477 | const UPB_DESC(EnumOptions) * upb_EnumDef_Options(const upb_EnumDef* e); |
Protobuf Team Bot | ce9dcc2 | 2023-11-03 22:38:26 +0000 | [diff] [blame] | 12478 | const UPB_DESC(FeatureSet) * upb_EnumDef_ResolvedFeatures(const upb_EnumDef* e); |
Eric Salo | 8809a11 | 2022-11-21 13:01:06 -0800 | [diff] [blame] | 12479 | |
| 12480 | upb_StringView upb_EnumDef_ReservedName(const upb_EnumDef* e, int i); |
| 12481 | int upb_EnumDef_ReservedNameCount(const upb_EnumDef* e); |
| 12482 | |
| 12483 | const upb_EnumReservedRange* upb_EnumDef_ReservedRange(const upb_EnumDef* e, |
| 12484 | int i); |
| 12485 | int upb_EnumDef_ReservedRangeCount(const upb_EnumDef* e); |
| 12486 | |
Jason Lunn | 67dee29 | 2023-07-13 13:15:26 -0700 | [diff] [blame] | 12487 | UPB_API const upb_EnumValueDef* upb_EnumDef_Value(const upb_EnumDef* e, int i); |
| 12488 | UPB_API int upb_EnumDef_ValueCount(const upb_EnumDef* e); |
Eric Salo | 8809a11 | 2022-11-21 13:01:06 -0800 | [diff] [blame] | 12489 | |
| 12490 | #ifdef __cplusplus |
| 12491 | } /* extern "C" */ |
| 12492 | #endif |
| 12493 | |
| 12494 | |
| 12495 | #endif /* UPB_REFLECTION_ENUM_DEF_H_ */ |
| 12496 | |
Protobuf Team Bot | 0631035 | 2023-09-26 21:54:58 +0000 | [diff] [blame] | 12497 | // IWYU pragma: private, include "upb/reflection/def.h" |
Eric Salo | 8809a11 | 2022-11-21 13:01:06 -0800 | [diff] [blame] | 12498 | |
| 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 |
| 12506 | extern "C" { |
| 12507 | #endif |
| 12508 | |
| 12509 | const upb_EnumDef* upb_EnumValueDef_Enum(const upb_EnumValueDef* v); |
| 12510 | const char* upb_EnumValueDef_FullName(const upb_EnumValueDef* v); |
| 12511 | bool upb_EnumValueDef_HasOptions(const upb_EnumValueDef* v); |
| 12512 | uint32_t upb_EnumValueDef_Index(const upb_EnumValueDef* v); |
Jason Lunn | 67dee29 | 2023-07-13 13:15:26 -0700 | [diff] [blame] | 12513 | UPB_API const char* upb_EnumValueDef_Name(const upb_EnumValueDef* v); |
| 12514 | UPB_API int32_t upb_EnumValueDef_Number(const upb_EnumValueDef* v); |
Mike Kruskal | 232ecf4 | 2023-01-14 00:09:40 -0800 | [diff] [blame] | 12515 | const UPB_DESC(EnumValueOptions) * |
| 12516 | upb_EnumValueDef_Options(const upb_EnumValueDef* v); |
Protobuf Team Bot | ce9dcc2 | 2023-11-03 22:38:26 +0000 | [diff] [blame] | 12517 | const UPB_DESC(FeatureSet) * |
| 12518 | upb_EnumValueDef_ResolvedFeatures(const upb_EnumValueDef* e); |
Eric Salo | 8809a11 | 2022-11-21 13:01:06 -0800 | [diff] [blame] | 12519 | |
| 12520 | #ifdef __cplusplus |
| 12521 | } /* extern "C" */ |
| 12522 | #endif |
| 12523 | |
| 12524 | |
| 12525 | #endif /* UPB_REFLECTION_ENUM_VALUE_DEF_H_ */ |
| 12526 | |
Protobuf Team Bot | 0631035 | 2023-09-26 21:54:58 +0000 | [diff] [blame] | 12527 | // IWYU pragma: private, include "upb/reflection/def.h" |
Eric Salo | 8809a11 | 2022-11-21 13:01:06 -0800 | [diff] [blame] | 12528 | |
| 12529 | #ifndef UPB_REFLECTION_EXTENSION_RANGE_H_ |
| 12530 | #define UPB_REFLECTION_EXTENSION_RANGE_H_ |
| 12531 | |
| 12532 | |
| 12533 | // Must be last. |
| 12534 | |
| 12535 | #ifdef __cplusplus |
| 12536 | extern "C" { |
| 12537 | #endif |
| 12538 | |
| 12539 | int32_t upb_ExtensionRange_Start(const upb_ExtensionRange* r); |
| 12540 | int32_t upb_ExtensionRange_End(const upb_ExtensionRange* r); |
| 12541 | |
| 12542 | bool upb_ExtensionRange_HasOptions(const upb_ExtensionRange* r); |
Mike Kruskal | 232ecf4 | 2023-01-14 00:09:40 -0800 | [diff] [blame] | 12543 | const UPB_DESC(ExtensionRangeOptions) * |
| 12544 | upb_ExtensionRange_Options(const upb_ExtensionRange* r); |
Protobuf Team Bot | ce9dcc2 | 2023-11-03 22:38:26 +0000 | [diff] [blame] | 12545 | const UPB_DESC(FeatureSet) * |
| 12546 | upb_ExtensionRange_ResolvedFeatures(const upb_ExtensionRange* e); |
Eric Salo | 8809a11 | 2022-11-21 13:01:06 -0800 | [diff] [blame] | 12547 | |
| 12548 | #ifdef __cplusplus |
| 12549 | } /* extern "C" */ |
| 12550 | #endif |
| 12551 | |
| 12552 | |
| 12553 | #endif /* UPB_REFLECTION_EXTENSION_RANGE_H_ */ |
| 12554 | |
Protobuf Team Bot | 0631035 | 2023-09-26 21:54:58 +0000 | [diff] [blame] | 12555 | // IWYU pragma: private, include "upb/reflection/def.h" |
Eric Salo | 8809a11 | 2022-11-21 13:01:06 -0800 | [diff] [blame] | 12556 | |
| 12557 | #ifndef UPB_REFLECTION_FIELD_DEF_H_ |
| 12558 | #define UPB_REFLECTION_FIELD_DEF_H_ |
| 12559 | |
Protobuf Team Bot | 4e90ead | 2024-01-08 15:46:34 +0000 | [diff] [blame] | 12560 | #include <stdint.h> |
| 12561 | |
Eric Salo | 8809a11 | 2022-11-21 13:01:06 -0800 | [diff] [blame] | 12562 | |
| 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 |
| 12570 | extern "C" { |
| 12571 | #endif |
| 12572 | |
| 12573 | const upb_OneofDef* upb_FieldDef_ContainingOneof(const upb_FieldDef* f); |
Jason Lunn | 67dee29 | 2023-07-13 13:15:26 -0700 | [diff] [blame] | 12574 | UPB_API const upb_MessageDef* upb_FieldDef_ContainingType( |
| 12575 | const upb_FieldDef* f); |
| 12576 | UPB_API upb_CType upb_FieldDef_CType(const upb_FieldDef* f); |
| 12577 | UPB_API upb_MessageValue upb_FieldDef_Default(const upb_FieldDef* f); |
| 12578 | UPB_API const upb_EnumDef* upb_FieldDef_EnumSubDef(const upb_FieldDef* f); |
Eric Salo | 8809a11 | 2022-11-21 13:01:06 -0800 | [diff] [blame] | 12579 | const upb_MessageDef* upb_FieldDef_ExtensionScope(const upb_FieldDef* f); |
Jason Lunn | 67dee29 | 2023-07-13 13:15:26 -0700 | [diff] [blame] | 12580 | UPB_API const upb_FileDef* upb_FieldDef_File(const upb_FieldDef* f); |
Eric Salo | 8809a11 | 2022-11-21 13:01:06 -0800 | [diff] [blame] | 12581 | const char* upb_FieldDef_FullName(const upb_FieldDef* f); |
| 12582 | bool upb_FieldDef_HasDefault(const upb_FieldDef* f); |
| 12583 | bool upb_FieldDef_HasJsonName(const upb_FieldDef* f); |
| 12584 | bool upb_FieldDef_HasOptions(const upb_FieldDef* f); |
Jason Lunn | 67dee29 | 2023-07-13 13:15:26 -0700 | [diff] [blame] | 12585 | UPB_API bool upb_FieldDef_HasPresence(const upb_FieldDef* f); |
Eric Salo | 8809a11 | 2022-11-21 13:01:06 -0800 | [diff] [blame] | 12586 | bool upb_FieldDef_HasSubDef(const upb_FieldDef* f); |
| 12587 | uint32_t upb_FieldDef_Index(const upb_FieldDef* f); |
Protobuf Team Bot | ef02087 | 2024-04-24 18:42:18 +0000 | [diff] [blame] | 12588 | UPB_API bool upb_FieldDef_IsEnum(const upb_FieldDef* f); |
Eric Salo | 8809a11 | 2022-11-21 13:01:06 -0800 | [diff] [blame] | 12589 | bool upb_FieldDef_IsExtension(const upb_FieldDef* f); |
Jason Lunn | 67dee29 | 2023-07-13 13:15:26 -0700 | [diff] [blame] | 12590 | UPB_API bool upb_FieldDef_IsMap(const upb_FieldDef* f); |
Eric Salo | 8809a11 | 2022-11-21 13:01:06 -0800 | [diff] [blame] | 12591 | bool upb_FieldDef_IsOptional(const upb_FieldDef* f); |
Protobuf Team Bot | f2c187d | 2024-01-09 17:58:04 +0000 | [diff] [blame] | 12592 | UPB_API bool upb_FieldDef_IsPacked(const upb_FieldDef* f); |
Eric Salo | 8809a11 | 2022-11-21 13:01:06 -0800 | [diff] [blame] | 12593 | bool upb_FieldDef_IsPrimitive(const upb_FieldDef* f); |
Jason Lunn | 67dee29 | 2023-07-13 13:15:26 -0700 | [diff] [blame] | 12594 | UPB_API bool upb_FieldDef_IsRepeated(const upb_FieldDef* f); |
Eric Salo | 8809a11 | 2022-11-21 13:01:06 -0800 | [diff] [blame] | 12595 | bool upb_FieldDef_IsRequired(const upb_FieldDef* f); |
| 12596 | bool upb_FieldDef_IsString(const upb_FieldDef* f); |
Jason Lunn | 67dee29 | 2023-07-13 13:15:26 -0700 | [diff] [blame] | 12597 | UPB_API bool upb_FieldDef_IsSubMessage(const upb_FieldDef* f); |
| 12598 | UPB_API const char* upb_FieldDef_JsonName(const upb_FieldDef* f); |
| 12599 | UPB_API upb_Label upb_FieldDef_Label(const upb_FieldDef* f); |
Protobuf Team Bot | b361c9c | 2024-03-22 00:27:43 +0000 | [diff] [blame] | 12600 | uint32_t upb_FieldDef_LayoutIndex(const upb_FieldDef* f); |
Jason Lunn | 67dee29 | 2023-07-13 13:15:26 -0700 | [diff] [blame] | 12601 | UPB_API const upb_MessageDef* upb_FieldDef_MessageSubDef(const upb_FieldDef* f); |
Protobuf Team Bot | b58bd40 | 2023-09-19 15:42:34 +0000 | [diff] [blame] | 12602 | bool _upb_FieldDef_ValidateUtf8(const upb_FieldDef* f); |
Protobuf Team Bot | 8ce5c9f | 2024-04-05 20:20:09 +0000 | [diff] [blame] | 12603 | bool _upb_FieldDef_IsGroupLike(const upb_FieldDef* f); |
Eric Salo | 8809a11 | 2022-11-21 13:01:06 -0800 | [diff] [blame] | 12604 | |
| 12605 | // Creates a mini descriptor string for a field, returns true on success. |
| 12606 | bool upb_FieldDef_MiniDescriptorEncode(const upb_FieldDef* f, upb_Arena* a, |
| 12607 | upb_StringView* out); |
| 12608 | |
| 12609 | const upb_MiniTableField* upb_FieldDef_MiniTable(const upb_FieldDef* f); |
Protobuf Team Bot | 4e90ead | 2024-01-08 15:46:34 +0000 | [diff] [blame] | 12610 | const upb_MiniTableExtension* upb_FieldDef_MiniTableExtension( |
| 12611 | const upb_FieldDef* f); |
Jason Lunn | 67dee29 | 2023-07-13 13:15:26 -0700 | [diff] [blame] | 12612 | UPB_API const char* upb_FieldDef_Name(const upb_FieldDef* f); |
| 12613 | UPB_API uint32_t upb_FieldDef_Number(const upb_FieldDef* f); |
Mike Kruskal | 232ecf4 | 2023-01-14 00:09:40 -0800 | [diff] [blame] | 12614 | const UPB_DESC(FieldOptions) * upb_FieldDef_Options(const upb_FieldDef* f); |
Protobuf Team Bot | ce9dcc2 | 2023-11-03 22:38:26 +0000 | [diff] [blame] | 12615 | const UPB_DESC(FeatureSet) * |
| 12616 | upb_FieldDef_ResolvedFeatures(const upb_FieldDef* f); |
Jason Lunn | 67dee29 | 2023-07-13 13:15:26 -0700 | [diff] [blame] | 12617 | UPB_API const upb_OneofDef* upb_FieldDef_RealContainingOneof( |
| 12618 | const upb_FieldDef* f); |
| 12619 | UPB_API upb_FieldType upb_FieldDef_Type(const upb_FieldDef* f); |
Eric Salo | 8809a11 | 2022-11-21 13:01:06 -0800 | [diff] [blame] | 12620 | |
| 12621 | #ifdef __cplusplus |
| 12622 | } /* extern "C" */ |
| 12623 | #endif |
| 12624 | |
| 12625 | |
| 12626 | #endif /* UPB_REFLECTION_FIELD_DEF_H_ */ |
| 12627 | |
Protobuf Team Bot | 0631035 | 2023-09-26 21:54:58 +0000 | [diff] [blame] | 12628 | // IWYU pragma: private, include "upb/reflection/def.h" |
Eric Salo | 8809a11 | 2022-11-21 13:01:06 -0800 | [diff] [blame] | 12629 | |
| 12630 | #ifndef UPB_REFLECTION_FILE_DEF_H_ |
| 12631 | #define UPB_REFLECTION_FILE_DEF_H_ |
| 12632 | |
| 12633 | |
| 12634 | // Must be last. |
| 12635 | |
| 12636 | #ifdef __cplusplus |
| 12637 | extern "C" { |
| 12638 | #endif |
| 12639 | |
Protobuf Team Bot | c6b149c | 2023-11-10 23:37:46 +0000 | [diff] [blame] | 12640 | UPB_API const char* upb_FileDef_EditionName(int edition); |
| 12641 | |
Eric Salo | 8809a11 | 2022-11-21 13:01:06 -0800 | [diff] [blame] | 12642 | const upb_FileDef* upb_FileDef_Dependency(const upb_FileDef* f, int i); |
| 12643 | int upb_FileDef_DependencyCount(const upb_FileDef* f); |
| 12644 | bool upb_FileDef_HasOptions(const upb_FileDef* f); |
Jason Lunn | 67dee29 | 2023-07-13 13:15:26 -0700 | [diff] [blame] | 12645 | UPB_API const char* upb_FileDef_Name(const upb_FileDef* f); |
Mike Kruskal | 232ecf4 | 2023-01-14 00:09:40 -0800 | [diff] [blame] | 12646 | const UPB_DESC(FileOptions) * upb_FileDef_Options(const upb_FileDef* f); |
Protobuf Team Bot | ce9dcc2 | 2023-11-03 22:38:26 +0000 | [diff] [blame] | 12647 | const UPB_DESC(FeatureSet) * upb_FileDef_ResolvedFeatures(const upb_FileDef* f); |
Eric Salo | 8809a11 | 2022-11-21 13:01:06 -0800 | [diff] [blame] | 12648 | const char* upb_FileDef_Package(const upb_FileDef* f); |
Protobuf Team Bot | 7dabac9 | 2023-09-07 18:35:50 +0000 | [diff] [blame] | 12649 | UPB_DESC(Edition) upb_FileDef_Edition(const upb_FileDef* f); |
Jason Lunn | 67dee29 | 2023-07-13 13:15:26 -0700 | [diff] [blame] | 12650 | UPB_API const upb_DefPool* upb_FileDef_Pool(const upb_FileDef* f); |
Eric Salo | 8809a11 | 2022-11-21 13:01:06 -0800 | [diff] [blame] | 12651 | |
| 12652 | const upb_FileDef* upb_FileDef_PublicDependency(const upb_FileDef* f, int i); |
| 12653 | int upb_FileDef_PublicDependencyCount(const upb_FileDef* f); |
| 12654 | |
| 12655 | const upb_ServiceDef* upb_FileDef_Service(const upb_FileDef* f, int i); |
| 12656 | int upb_FileDef_ServiceCount(const upb_FileDef* f); |
| 12657 | |
Jason Lunn | 67dee29 | 2023-07-13 13:15:26 -0700 | [diff] [blame] | 12658 | UPB_API upb_Syntax upb_FileDef_Syntax(const upb_FileDef* f); |
Eric Salo | 8809a11 | 2022-11-21 13:01:06 -0800 | [diff] [blame] | 12659 | |
| 12660 | const upb_EnumDef* upb_FileDef_TopLevelEnum(const upb_FileDef* f, int i); |
| 12661 | int upb_FileDef_TopLevelEnumCount(const upb_FileDef* f); |
| 12662 | |
| 12663 | const upb_FieldDef* upb_FileDef_TopLevelExtension(const upb_FileDef* f, int i); |
| 12664 | int upb_FileDef_TopLevelExtensionCount(const upb_FileDef* f); |
| 12665 | |
| 12666 | const upb_MessageDef* upb_FileDef_TopLevelMessage(const upb_FileDef* f, int i); |
| 12667 | int upb_FileDef_TopLevelMessageCount(const upb_FileDef* f); |
| 12668 | |
| 12669 | const upb_FileDef* upb_FileDef_WeakDependency(const upb_FileDef* f, int i); |
| 12670 | int upb_FileDef_WeakDependencyCount(const upb_FileDef* f); |
| 12671 | |
Protobuf Team Bot | 55696ad | 2024-04-16 14:44:23 +0000 | [diff] [blame] | 12672 | // Returns whether |symbol| is transitively included by |f| |
| 12673 | bool upb_FileDef_Resolves(const upb_FileDef* f, const char* symbol); |
| 12674 | |
Eric Salo | 8809a11 | 2022-11-21 13:01:06 -0800 | [diff] [blame] | 12675 | #ifdef __cplusplus |
| 12676 | } /* extern "C" */ |
| 12677 | #endif |
| 12678 | |
| 12679 | |
| 12680 | #endif /* UPB_REFLECTION_FILE_DEF_H_ */ |
| 12681 | |
Protobuf Team Bot | 0631035 | 2023-09-26 21:54:58 +0000 | [diff] [blame] | 12682 | // IWYU pragma: private, include "upb/reflection/def.h" |
Eric Salo | 8809a11 | 2022-11-21 13:01:06 -0800 | [diff] [blame] | 12683 | |
| 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. |
| 12709 | typedef 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 |
| 12734 | extern "C" { |
| 12735 | #endif |
| 12736 | |
| 12737 | const upb_MessageDef* upb_MessageDef_ContainingType(const upb_MessageDef* m); |
| 12738 | |
| 12739 | const upb_ExtensionRange* upb_MessageDef_ExtensionRange(const upb_MessageDef* m, |
| 12740 | int i); |
| 12741 | int upb_MessageDef_ExtensionRangeCount(const upb_MessageDef* m); |
| 12742 | |
Jason Lunn | 67dee29 | 2023-07-13 13:15:26 -0700 | [diff] [blame] | 12743 | UPB_API const upb_FieldDef* upb_MessageDef_Field(const upb_MessageDef* m, |
| 12744 | int i); |
| 12745 | UPB_API int upb_MessageDef_FieldCount(const upb_MessageDef* m); |
Eric Salo | 8809a11 | 2022-11-21 13:01:06 -0800 | [diff] [blame] | 12746 | |
Jason Lunn | 67dee29 | 2023-07-13 13:15:26 -0700 | [diff] [blame] | 12747 | UPB_API const upb_FileDef* upb_MessageDef_File(const upb_MessageDef* m); |
Eric Salo | 8809a11 | 2022-11-21 13:01:06 -0800 | [diff] [blame] | 12748 | |
| 12749 | // Returns a field by either JSON name or regular proto name. |
| 12750 | const upb_FieldDef* upb_MessageDef_FindByJsonNameWithSize( |
| 12751 | const upb_MessageDef* m, const char* name, size_t size); |
| 12752 | UPB_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 Lunn | 67dee29 | 2023-07-13 13:15:26 -0700 | [diff] [blame] | 12760 | UPB_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 Salo | 8809a11 | 2022-11-21 13:01:06 -0800 | [diff] [blame] | 12764 | UPB_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 | |
| 12771 | const upb_FieldDef* upb_MessageDef_FindFieldByName(const upb_MessageDef* m, |
| 12772 | const char* name); |
Jason Lunn | 67dee29 | 2023-07-13 13:15:26 -0700 | [diff] [blame] | 12773 | UPB_API const upb_FieldDef* upb_MessageDef_FindFieldByNameWithSize( |
Eric Salo | 8809a11 | 2022-11-21 13:01:06 -0800 | [diff] [blame] | 12774 | const upb_MessageDef* m, const char* name, size_t size); |
Jason Lunn | 67dee29 | 2023-07-13 13:15:26 -0700 | [diff] [blame] | 12775 | UPB_API const upb_FieldDef* upb_MessageDef_FindFieldByNumber( |
| 12776 | const upb_MessageDef* m, uint32_t i); |
Eric Salo | 8809a11 | 2022-11-21 13:01:06 -0800 | [diff] [blame] | 12777 | const upb_OneofDef* upb_MessageDef_FindOneofByName(const upb_MessageDef* m, |
| 12778 | const char* name); |
Jason Lunn | 67dee29 | 2023-07-13 13:15:26 -0700 | [diff] [blame] | 12779 | UPB_API const upb_OneofDef* upb_MessageDef_FindOneofByNameWithSize( |
Eric Salo | 8809a11 | 2022-11-21 13:01:06 -0800 | [diff] [blame] | 12780 | const upb_MessageDef* m, const char* name, size_t size); |
Jason Lunn | 67dee29 | 2023-07-13 13:15:26 -0700 | [diff] [blame] | 12781 | UPB_API const char* upb_MessageDef_FullName(const upb_MessageDef* m); |
Eric Salo | 8809a11 | 2022-11-21 13:01:06 -0800 | [diff] [blame] | 12782 | bool upb_MessageDef_HasOptions(const upb_MessageDef* m); |
| 12783 | bool upb_MessageDef_IsMapEntry(const upb_MessageDef* m); |
| 12784 | bool upb_MessageDef_IsMessageSet(const upb_MessageDef* m); |
| 12785 | |
| 12786 | // Creates a mini descriptor string for a message, returns true on success. |
| 12787 | bool upb_MessageDef_MiniDescriptorEncode(const upb_MessageDef* m, upb_Arena* a, |
| 12788 | upb_StringView* out); |
| 12789 | |
Jason Lunn | 67dee29 | 2023-07-13 13:15:26 -0700 | [diff] [blame] | 12790 | UPB_API const upb_MiniTable* upb_MessageDef_MiniTable(const upb_MessageDef* m); |
Eric Salo | 8809a11 | 2022-11-21 13:01:06 -0800 | [diff] [blame] | 12791 | const char* upb_MessageDef_Name(const upb_MessageDef* m); |
| 12792 | |
| 12793 | const upb_EnumDef* upb_MessageDef_NestedEnum(const upb_MessageDef* m, int i); |
| 12794 | const upb_FieldDef* upb_MessageDef_NestedExtension(const upb_MessageDef* m, |
| 12795 | int i); |
| 12796 | const upb_MessageDef* upb_MessageDef_NestedMessage(const upb_MessageDef* m, |
| 12797 | int i); |
| 12798 | |
| 12799 | int upb_MessageDef_NestedEnumCount(const upb_MessageDef* m); |
| 12800 | int upb_MessageDef_NestedExtensionCount(const upb_MessageDef* m); |
| 12801 | int upb_MessageDef_NestedMessageCount(const upb_MessageDef* m); |
| 12802 | |
Jason Lunn | 67dee29 | 2023-07-13 13:15:26 -0700 | [diff] [blame] | 12803 | UPB_API const upb_OneofDef* upb_MessageDef_Oneof(const upb_MessageDef* m, |
| 12804 | int i); |
| 12805 | UPB_API int upb_MessageDef_OneofCount(const upb_MessageDef* m); |
Mike Kruskal | 232ecf4 | 2023-01-14 00:09:40 -0800 | [diff] [blame] | 12806 | int upb_MessageDef_RealOneofCount(const upb_MessageDef* m); |
Eric Salo | 8809a11 | 2022-11-21 13:01:06 -0800 | [diff] [blame] | 12807 | |
Mike Kruskal | 232ecf4 | 2023-01-14 00:09:40 -0800 | [diff] [blame] | 12808 | const UPB_DESC(MessageOptions) * |
| 12809 | upb_MessageDef_Options(const upb_MessageDef* m); |
Protobuf Team Bot | ce9dcc2 | 2023-11-03 22:38:26 +0000 | [diff] [blame] | 12810 | const UPB_DESC(FeatureSet) * |
| 12811 | upb_MessageDef_ResolvedFeatures(const upb_MessageDef* m); |
Eric Salo | 8809a11 | 2022-11-21 13:01:06 -0800 | [diff] [blame] | 12812 | |
| 12813 | upb_StringView upb_MessageDef_ReservedName(const upb_MessageDef* m, int i); |
| 12814 | int upb_MessageDef_ReservedNameCount(const upb_MessageDef* m); |
| 12815 | |
| 12816 | const upb_MessageReservedRange* upb_MessageDef_ReservedRange( |
| 12817 | const upb_MessageDef* m, int i); |
| 12818 | int upb_MessageDef_ReservedRangeCount(const upb_MessageDef* m); |
| 12819 | |
Jason Lunn | 67dee29 | 2023-07-13 13:15:26 -0700 | [diff] [blame] | 12820 | UPB_API upb_Syntax upb_MessageDef_Syntax(const upb_MessageDef* m); |
| 12821 | UPB_API upb_WellKnown upb_MessageDef_WellKnownType(const upb_MessageDef* m); |
Eric Salo | 8809a11 | 2022-11-21 13:01:06 -0800 | [diff] [blame] | 12822 | |
| 12823 | #ifdef __cplusplus |
| 12824 | } /* extern "C" */ |
| 12825 | #endif |
| 12826 | |
| 12827 | |
| 12828 | #endif /* UPB_REFLECTION_MESSAGE_DEF_H_ */ |
| 12829 | |
Protobuf Team Bot | 0631035 | 2023-09-26 21:54:58 +0000 | [diff] [blame] | 12830 | // IWYU pragma: private, include "upb/reflection/def.h" |
Eric Salo | 8809a11 | 2022-11-21 13:01:06 -0800 | [diff] [blame] | 12831 | |
| 12832 | #ifndef UPB_REFLECTION_METHOD_DEF_H_ |
| 12833 | #define UPB_REFLECTION_METHOD_DEF_H_ |
| 12834 | |
| 12835 | |
| 12836 | // Must be last. |
| 12837 | |
| 12838 | #ifdef __cplusplus |
| 12839 | extern "C" { |
| 12840 | #endif |
| 12841 | |
Protobuf Team Bot | 312240c | 2024-03-22 17:47:13 +0000 | [diff] [blame] | 12842 | UPB_API bool upb_MethodDef_ClientStreaming(const upb_MethodDef* m); |
Eric Salo | 8809a11 | 2022-11-21 13:01:06 -0800 | [diff] [blame] | 12843 | const char* upb_MethodDef_FullName(const upb_MethodDef* m); |
| 12844 | bool upb_MethodDef_HasOptions(const upb_MethodDef* m); |
| 12845 | int upb_MethodDef_Index(const upb_MethodDef* m); |
Protobuf Team Bot | 312240c | 2024-03-22 17:47:13 +0000 | [diff] [blame] | 12846 | UPB_API const upb_MessageDef* upb_MethodDef_InputType(const upb_MethodDef* m); |
| 12847 | UPB_API const char* upb_MethodDef_Name(const upb_MethodDef* m); |
| 12848 | UPB_API const UPB_DESC(MethodOptions) * |
| 12849 | upb_MethodDef_Options(const upb_MethodDef* m); |
Protobuf Team Bot | ce9dcc2 | 2023-11-03 22:38:26 +0000 | [diff] [blame] | 12850 | const UPB_DESC(FeatureSet) * |
| 12851 | upb_MethodDef_ResolvedFeatures(const upb_MethodDef* m); |
Protobuf Team Bot | 312240c | 2024-03-22 17:47:13 +0000 | [diff] [blame] | 12852 | UPB_API const upb_MessageDef* upb_MethodDef_OutputType(const upb_MethodDef* m); |
| 12853 | UPB_API bool upb_MethodDef_ServerStreaming(const upb_MethodDef* m); |
| 12854 | UPB_API const upb_ServiceDef* upb_MethodDef_Service(const upb_MethodDef* m); |
Eric Salo | 8809a11 | 2022-11-21 13:01:06 -0800 | [diff] [blame] | 12855 | |
| 12856 | #ifdef __cplusplus |
| 12857 | } /* extern "C" */ |
| 12858 | #endif |
| 12859 | |
| 12860 | |
| 12861 | #endif /* UPB_REFLECTION_METHOD_DEF_H_ */ |
| 12862 | |
Protobuf Team Bot | 0631035 | 2023-09-26 21:54:58 +0000 | [diff] [blame] | 12863 | // IWYU pragma: private, include "upb/reflection/def.h" |
Eric Salo | 8809a11 | 2022-11-21 13:01:06 -0800 | [diff] [blame] | 12864 | |
| 12865 | #ifndef UPB_REFLECTION_ONEOF_DEF_H_ |
| 12866 | #define UPB_REFLECTION_ONEOF_DEF_H_ |
| 12867 | |
| 12868 | |
| 12869 | // Must be last. |
| 12870 | |
| 12871 | #ifdef __cplusplus |
| 12872 | extern "C" { |
| 12873 | #endif |
| 12874 | |
Jason Lunn | 67dee29 | 2023-07-13 13:15:26 -0700 | [diff] [blame] | 12875 | UPB_API const upb_MessageDef* upb_OneofDef_ContainingType( |
| 12876 | const upb_OneofDef* o); |
| 12877 | UPB_API const upb_FieldDef* upb_OneofDef_Field(const upb_OneofDef* o, int i); |
| 12878 | UPB_API int upb_OneofDef_FieldCount(const upb_OneofDef* o); |
Eric Salo | 8809a11 | 2022-11-21 13:01:06 -0800 | [diff] [blame] | 12879 | const char* upb_OneofDef_FullName(const upb_OneofDef* o); |
| 12880 | bool upb_OneofDef_HasOptions(const upb_OneofDef* o); |
| 12881 | uint32_t upb_OneofDef_Index(const upb_OneofDef* o); |
| 12882 | bool upb_OneofDef_IsSynthetic(const upb_OneofDef* o); |
| 12883 | const upb_FieldDef* upb_OneofDef_LookupName(const upb_OneofDef* o, |
| 12884 | const char* name); |
| 12885 | const upb_FieldDef* upb_OneofDef_LookupNameWithSize(const upb_OneofDef* o, |
| 12886 | const char* name, |
| 12887 | size_t size); |
| 12888 | const upb_FieldDef* upb_OneofDef_LookupNumber(const upb_OneofDef* o, |
| 12889 | uint32_t num); |
Jason Lunn | 67dee29 | 2023-07-13 13:15:26 -0700 | [diff] [blame] | 12890 | UPB_API const char* upb_OneofDef_Name(const upb_OneofDef* o); |
Eric Salo | 8809a11 | 2022-11-21 13:01:06 -0800 | [diff] [blame] | 12891 | int upb_OneofDef_numfields(const upb_OneofDef* o); |
Protobuf Team Bot | ce9dcc2 | 2023-11-03 22:38:26 +0000 | [diff] [blame] | 12892 | const UPB_DESC(OneofOptions*) upb_OneofDef_Options(const upb_OneofDef* o); |
| 12893 | const UPB_DESC(FeatureSet*) |
| 12894 | upb_OneofDef_ResolvedFeatures(const upb_OneofDef* o); |
Eric Salo | 8809a11 | 2022-11-21 13:01:06 -0800 | [diff] [blame] | 12895 | |
| 12896 | #ifdef __cplusplus |
| 12897 | } /* extern "C" */ |
| 12898 | #endif |
| 12899 | |
| 12900 | |
| 12901 | #endif /* UPB_REFLECTION_ONEOF_DEF_H_ */ |
| 12902 | |
Protobuf Team Bot | 0631035 | 2023-09-26 21:54:58 +0000 | [diff] [blame] | 12903 | // IWYU pragma: private, include "upb/reflection/def.h" |
Eric Salo | 8809a11 | 2022-11-21 13:01:06 -0800 | [diff] [blame] | 12904 | |
| 12905 | #ifndef UPB_REFLECTION_SERVICE_DEF_H_ |
| 12906 | #define UPB_REFLECTION_SERVICE_DEF_H_ |
| 12907 | |
| 12908 | |
| 12909 | // Must be last. |
| 12910 | |
| 12911 | #ifdef __cplusplus |
| 12912 | extern "C" { |
| 12913 | #endif |
| 12914 | |
Protobuf Team Bot | 312240c | 2024-03-22 17:47:13 +0000 | [diff] [blame] | 12915 | UPB_API const upb_FileDef* upb_ServiceDef_File(const upb_ServiceDef* s); |
Eric Salo | 8809a11 | 2022-11-21 13:01:06 -0800 | [diff] [blame] | 12916 | const upb_MethodDef* upb_ServiceDef_FindMethodByName(const upb_ServiceDef* s, |
| 12917 | const char* name); |
Protobuf Team Bot | 312240c | 2024-03-22 17:47:13 +0000 | [diff] [blame] | 12918 | UPB_API const char* upb_ServiceDef_FullName(const upb_ServiceDef* s); |
Eric Salo | 8809a11 | 2022-11-21 13:01:06 -0800 | [diff] [blame] | 12919 | bool upb_ServiceDef_HasOptions(const upb_ServiceDef* s); |
| 12920 | int upb_ServiceDef_Index(const upb_ServiceDef* s); |
Protobuf Team Bot | 312240c | 2024-03-22 17:47:13 +0000 | [diff] [blame] | 12921 | UPB_API const upb_MethodDef* upb_ServiceDef_Method(const upb_ServiceDef* s, |
| 12922 | int i); |
| 12923 | UPB_API int upb_ServiceDef_MethodCount(const upb_ServiceDef* s); |
Eric Salo | 8809a11 | 2022-11-21 13:01:06 -0800 | [diff] [blame] | 12924 | const char* upb_ServiceDef_Name(const upb_ServiceDef* s); |
Protobuf Team Bot | 312240c | 2024-03-22 17:47:13 +0000 | [diff] [blame] | 12925 | UPB_API const UPB_DESC(ServiceOptions) * |
Mike Kruskal | 232ecf4 | 2023-01-14 00:09:40 -0800 | [diff] [blame] | 12926 | upb_ServiceDef_Options(const upb_ServiceDef* s); |
Protobuf Team Bot | ce9dcc2 | 2023-11-03 22:38:26 +0000 | [diff] [blame] | 12927 | const UPB_DESC(FeatureSet) * |
| 12928 | upb_ServiceDef_ResolvedFeatures(const upb_ServiceDef* s); |
Eric Salo | 8809a11 | 2022-11-21 13:01:06 -0800 | [diff] [blame] | 12929 | |
| 12930 | #ifdef __cplusplus |
| 12931 | } /* extern "C" */ |
| 12932 | #endif |
| 12933 | |
| 12934 | |
| 12935 | #endif /* UPB_REFLECTION_SERVICE_DEF_H_ */ |
Protobuf Team Bot | ffc56ba | 2023-09-08 15:29:06 +0000 | [diff] [blame] | 12936 | // IWYU pragma: end_exports |
Eric Salo | 8809a11 | 2022-11-21 13:01:06 -0800 | [diff] [blame] | 12937 | |
| 12938 | #endif /* UPB_REFLECTION_DEF_H_ */ |
| 12939 | |
| 12940 | // Must be last. |
| 12941 | |
| 12942 | #ifdef __cplusplus |
| 12943 | extern "C" { |
| 12944 | #endif |
| 12945 | |
| 12946 | enum { upb_JsonDecode_IgnoreUnknown = 1 }; |
| 12947 | |
Jason Lunn | 67dee29 | 2023-07-13 13:15:26 -0700 | [diff] [blame] | 12948 | UPB_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 Salo | 8809a11 | 2022-11-21 13:01:06 -0800 | [diff] [blame] | 12951 | |
| 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 Cozzette | 7d5592e | 2023-08-23 12:15:26 -0700 | [diff] [blame] | 12962 | #include <stdint.h> |
| 12963 | |
Eric Salo | 8809a11 | 2022-11-21 13:01:06 -0800 | [diff] [blame] | 12964 | // Must be last. |
| 12965 | |
| 12966 | #ifdef __cplusplus |
| 12967 | extern "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 | |
| 12975 | const char* upb_BufToUint64(const char* ptr, const char* end, uint64_t* val); |
| 12976 | const 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 Cozzette | 7d5592e | 2023-08-23 12:15:26 -0700 | [diff] [blame] | 12989 | #include <stdint.h> |
| 12990 | |
Eric Salo | 8809a11 | 2022-11-21 13:01:06 -0800 | [diff] [blame] | 12991 | // Must be last. |
| 12992 | |
| 12993 | #ifdef __cplusplus |
| 12994 | extern "C" { |
| 12995 | #endif |
| 12996 | |
| 12997 | // Returns true iff a codepoint is the value for a high surrogate. |
| 12998 | UPB_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. |
| 13003 | UPB_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. |
| 13009 | UPB_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. |
| 13015 | UPB_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. |
| 13021 | UPB_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. |
| 13028 | int 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 Bot | 473d20d | 2023-09-15 22:27:16 +0000 | [diff] [blame] | 13040 | #include <stddef.h> |
| 13041 | |
Eric Salo | 8809a11 | 2022-11-21 13:01:06 -0800 | [diff] [blame] | 13042 | |
| 13043 | // Must be last. |
| 13044 | |
| 13045 | #ifdef __cplusplus |
| 13046 | extern "C" { |
| 13047 | #endif |
| 13048 | |
Eric Salo | 3f36a91 | 2022-12-05 14:12:25 -0800 | [diff] [blame] | 13049 | // 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 Lunn | 67dee29 | 2023-07-13 13:15:26 -0700 | [diff] [blame] | 13052 | UPB_API upb_MutableMessageValue upb_Message_Mutable(upb_Message* msg, |
| 13053 | const upb_FieldDef* f, |
| 13054 | upb_Arena* a); |
Eric Salo | 8809a11 | 2022-11-21 13:01:06 -0800 | [diff] [blame] | 13055 | |
Eric Salo | 3f36a91 | 2022-12-05 14:12:25 -0800 | [diff] [blame] | 13056 | // Returns the field that is set in the oneof, or NULL if none are set. |
Protobuf Team Bot | 6cce622 | 2024-05-28 17:15:46 +0000 | [diff] [blame] | 13057 | UPB_API const upb_FieldDef* upb_Message_WhichOneofByDef(const upb_Message* msg, |
| 13058 | const upb_OneofDef* o); |
Eric Salo | 8809a11 | 2022-11-21 13:01:06 -0800 | [diff] [blame] | 13059 | |
Eric Salo | 3f36a91 | 2022-12-05 14:12:25 -0800 | [diff] [blame] | 13060 | // Clear all data and unknown fields. |
| 13061 | void upb_Message_ClearByDef(upb_Message* msg, const upb_MessageDef* m); |
Eric Salo | 8809a11 | 2022-11-21 13:01:06 -0800 | [diff] [blame] | 13062 | |
Eric Salo | 3f36a91 | 2022-12-05 14:12:25 -0800 | [diff] [blame] | 13063 | // Clears any field presence and sets the value back to its default. |
Jason Lunn | 67dee29 | 2023-07-13 13:15:26 -0700 | [diff] [blame] | 13064 | UPB_API void upb_Message_ClearFieldByDef(upb_Message* msg, |
| 13065 | const upb_FieldDef* f); |
Eric Salo | 8809a11 | 2022-11-21 13:01:06 -0800 | [diff] [blame] | 13066 | |
Eric Salo | 3f36a91 | 2022-12-05 14:12:25 -0800 | [diff] [blame] | 13067 | // May only be called for fields where upb_FieldDef_HasPresence(f) == true. |
Jason Lunn | 67dee29 | 2023-07-13 13:15:26 -0700 | [diff] [blame] | 13068 | UPB_API bool upb_Message_HasFieldByDef(const upb_Message* msg, |
| 13069 | const upb_FieldDef* f); |
Eric Salo | 8809a11 | 2022-11-21 13:01:06 -0800 | [diff] [blame] | 13070 | |
Eric Salo | 3f36a91 | 2022-12-05 14:12:25 -0800 | [diff] [blame] | 13071 | // Returns the value in the message associated with this field def. |
Jason Lunn | 67dee29 | 2023-07-13 13:15:26 -0700 | [diff] [blame] | 13072 | UPB_API upb_MessageValue upb_Message_GetFieldByDef(const upb_Message* msg, |
| 13073 | const upb_FieldDef* f); |
Eric Salo | 3f36a91 | 2022-12-05 14:12:25 -0800 | [diff] [blame] | 13074 | |
| 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 Lunn | 67dee29 | 2023-07-13 13:15:26 -0700 | [diff] [blame] | 13080 | UPB_API bool upb_Message_SetFieldByDef(upb_Message* msg, const upb_FieldDef* f, |
| 13081 | upb_MessageValue val, upb_Arena* a); |
Eric Salo | 3f36a91 | 2022-12-05 14:12:25 -0800 | [diff] [blame] | 13082 | |
| 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 Salo | 8809a11 | 2022-11-21 13:01:06 -0800 | [diff] [blame] | 13095 | |
| 13096 | #define kUpb_Message_Begin -1 |
Eric Salo | 3f36a91 | 2022-12-05 14:12:25 -0800 | [diff] [blame] | 13097 | |
Protobuf Team Bot | 7e32450 | 2024-01-04 18:12:49 +0000 | [diff] [blame] | 13098 | UPB_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 Salo | 8809a11 | 2022-11-21 13:01:06 -0800 | [diff] [blame] | 13102 | |
Eric Salo | 3f36a91 | 2022-12-05 14:12:25 -0800 | [diff] [blame] | 13103 | // Clears all unknown field data from this message and all submessages. |
Jason Lunn | 67dee29 | 2023-07-13 13:15:26 -0700 | [diff] [blame] | 13104 | UPB_API bool upb_Message_DiscardUnknown(upb_Message* msg, |
| 13105 | const upb_MessageDef* m, int maxdepth); |
Eric Salo | 8809a11 | 2022-11-21 13:01:06 -0800 | [diff] [blame] | 13106 | |
| 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 |
| 13121 | extern "C" { |
| 13122 | #endif |
| 13123 | |
| 13124 | enum { |
Protobuf Team Bot | 986cbb6 | 2023-09-19 15:03:51 +0000 | [diff] [blame] | 13125 | /* When set, emits 0/default values. TODO: proto3 only? */ |
Eric Salo | 8809a11 | 2022-11-21 13:01:06 -0800 | [diff] [blame] | 13126 | 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 Bot | ad88453 | 2023-09-05 18:31:02 +0000 | [diff] [blame] | 13137 | * |m|. The DefPool in |ext_pool| is used to find extensions (if NULL, |
| 13138 | * extensions will not be printed). |
Eric Salo | 8809a11 | 2022-11-21 13:01:06 -0800 | [diff] [blame] | 13139 | * |
| 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 Lunn | 67dee29 | 2023-07-13 13:15:26 -0700 | [diff] [blame] | 13144 | UPB_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 Salo | 8809a11 | 2022-11-21 13:01:06 -0800 | [diff] [blame] | 13147 | |
| 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. |
| 13166 | enum { kUpb_RoundTripBufferSize = 32 }; |
| 13167 | |
| 13168 | #ifdef __cplusplus |
| 13169 | extern "C" { |
| 13170 | #endif |
| 13171 | |
| 13172 | void _upb_EncodeRoundTripDouble(double val, char* buf, size_t size); |
| 13173 | void _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 | |
| 13187 | UPB_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 Salo | dfb7155 | 2023-03-22 12:35:09 -0700 | [diff] [blame] | 13204 | #ifndef UPB_PORT_ATOMIC_H_ |
| 13205 | #define UPB_PORT_ATOMIC_H_ |
| 13206 | |
| 13207 | |
| 13208 | #ifdef UPB_USE_C11_ATOMICS |
| 13209 | |
Protobuf Team Bot | 743bf92 | 2023-09-14 01:12:11 +0000 | [diff] [blame] | 13210 | // IWYU pragma: begin_exports |
Eric Salo | dfb7155 | 2023-03-22 12:35:09 -0700 | [diff] [blame] | 13211 | #include <stdatomic.h> |
| 13212 | #include <stdbool.h> |
Protobuf Team Bot | 743bf92 | 2023-09-14 01:12:11 +0000 | [diff] [blame] | 13213 | // IWYU pragma: end_exports |
Eric Salo | dfb7155 | 2023-03-22 12:35:09 -0700 | [diff] [blame] | 13214 | |
Deanna Garcia | c7d979d | 2023-04-14 17:22:13 -0700 | [diff] [blame] | 13215 | #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 Garcia | bd6a0cf | 2023-04-20 10:30:44 -0700 | [diff] [blame] | 13222 | atomic_fetch_sub_explicit(addr, val, order) |
| 13223 | #define upb_Atomic_Exchange(addr, val, order) \ |
| 13224 | atomic_exchange_explicit(addr, val, order) |
Deanna Garcia | c7d979d | 2023-04-14 17:22:13 -0700 | [diff] [blame] | 13225 | #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 Salo | dfb7155 | 2023-03-22 12:35:09 -0700 | [diff] [blame] | 13233 | |
| 13234 | #else // !UPB_USE_C11_ATOMICS |
| 13235 | |
Deanna Garcia | c7d979d | 2023-04-14 17:22:13 -0700 | [diff] [blame] | 13236 | #include <string.h> |
Eric Salo | dfb7155 | 2023-03-22 12:35:09 -0700 | [diff] [blame] | 13237 | |
Deanna Garcia | c7d979d | 2023-04-14 17:22:13 -0700 | [diff] [blame] | 13238 | #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 Salo | dfb7155 | 2023-03-22 12:35:09 -0700 | [diff] [blame] | 13243 | |
Deanna Garcia | bd6a0cf | 2023-04-20 10:30:44 -0700 | [diff] [blame] | 13244 | UPB_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 Garcia | c7d979d | 2023-04-14 17:22:13 -0700 | [diff] [blame] | 13253 | // `addr` and `expected` are logically double pointers. |
| 13254 | UPB_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 Salo | dfb7155 | 2023-03-22 12:35:09 -0700 | [diff] [blame] | 13259 | return true; |
| 13260 | } else { |
Deanna Garcia | c7d979d | 2023-04-14 17:22:13 -0700 | [diff] [blame] | 13261 | memcpy(expected, addr, sizeof(desired)); |
Eric Salo | dfb7155 | 2023-03-22 12:35:09 -0700 | [diff] [blame] | 13262 | return false; |
| 13263 | } |
| 13264 | } |
| 13265 | |
Deanna Garcia | c7d979d | 2023-04-14 17:22:13 -0700 | [diff] [blame] | 13266 | #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 Salo | dfb7155 | 2023-03-22 12:35:09 -0700 | [diff] [blame] | 13274 | #endif |
| 13275 | |
| 13276 | |
| 13277 | #endif // UPB_PORT_ATOMIC_H_ |
| 13278 | |
Protobuf Team Bot | 95d7dc0 | 2023-12-13 04:09:17 +0000 | [diff] [blame] | 13279 | #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 |
| 13293 | extern "C" { |
| 13294 | #endif |
| 13295 | |
Protobuf Team Bot | 64441a2 | 2024-01-23 23:46:32 +0000 | [diff] [blame] | 13296 | const upb_MiniTableExtension* upb_Message_ExtensionByIndex( |
| 13297 | const upb_Message* msg, size_t index); |
Protobuf Team Bot | f284522 | 2023-12-19 04:57:32 +0000 | [diff] [blame] | 13298 | |
Protobuf Team Bot | c13512a | 2024-01-25 18:53:49 +0000 | [diff] [blame] | 13299 | // Returns the minitable with the given field number, or NULL on failure. |
| 13300 | const upb_MiniTableExtension* upb_Message_FindExtensionByNumber( |
| 13301 | const upb_Message* msg, uint32_t field_number); |
Protobuf Team Bot | 95d7dc0 | 2023-12-13 04:09:17 +0000 | [diff] [blame] | 13302 | |
| 13303 | #ifdef __cplusplus |
| 13304 | } /* extern "C" */ |
| 13305 | #endif |
| 13306 | |
| 13307 | |
| 13308 | #endif /* UPB_MESSAGE_COMPAT_H_ */ |
| 13309 | |
Protobuf Team Bot | 376ba2f | 2023-09-29 22:17:43 +0000 | [diff] [blame] | 13310 | // EVERYTHING BELOW THIS LINE IS INTERNAL - DO NOT USE ///////////////////////// |
| 13311 | |
Protobuf Team Bot | 5b34337 | 2023-12-19 06:18:53 +0000 | [diff] [blame] | 13312 | #ifndef UPB_MESSAGE_INTERNAL_MAP_SORTER_H_ |
| 13313 | #define UPB_MESSAGE_INTERNAL_MAP_SORTER_H_ |
Protobuf Team Bot | 376ba2f | 2023-09-29 22:17:43 +0000 | [diff] [blame] | 13314 | |
| 13315 | #include <stdlib.h> |
| 13316 | |
| 13317 | |
Protobuf Team Bot | c12c96e | 2024-01-16 07:41:08 +0000 | [diff] [blame] | 13318 | #ifndef UPB_MESSAGE_INTERNAL_MAP_ENTRY_H_ |
| 13319 | #define UPB_MESSAGE_INTERNAL_MAP_ENTRY_H_ |
Protobuf Team Bot | 5b34337 | 2023-12-19 06:18:53 +0000 | [diff] [blame] | 13320 | |
| 13321 | #include <stdint.h> |
Protobuf Team Bot | 376ba2f | 2023-09-29 22:17:43 +0000 | [diff] [blame] | 13322 | |
| 13323 | |
| 13324 | // Map entries aren't actually stored for map fields, they are only used during |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 13325 | // 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 Bot | 376ba2f | 2023-09-29 22:17:43 +0000 | [diff] [blame] | 13327 | // |
| 13328 | // Note that users can and do create map entries directly, which will also use |
| 13329 | // this layout. |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 13330 | |
Protobuf Team Bot | 376ba2f | 2023-09-29 22:17:43 +0000 | [diff] [blame] | 13331 | typedef struct { |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 13332 | struct upb_Message message; |
Protobuf Team Bot | 376ba2f | 2023-09-29 22:17:43 +0000 | [diff] [blame] | 13333 | // 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 Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 13339 | double d[2]; // Padding for 32-bit builds. |
Protobuf Team Bot | 376ba2f | 2023-09-29 22:17:43 +0000 | [diff] [blame] | 13340 | } k; |
| 13341 | union { |
| 13342 | upb_StringView str; // For str/bytes. |
| 13343 | upb_value val; // For all other types. |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 13344 | double d[2]; // Padding for 32-bit builds. |
Protobuf Team Bot | 376ba2f | 2023-09-29 22:17:43 +0000 | [diff] [blame] | 13345 | } v; |
Protobuf Team Bot | 376ba2f | 2023-09-29 22:17:43 +0000 | [diff] [blame] | 13346 | } upb_MapEntry; |
| 13347 | |
Protobuf Team Bot | c12c96e | 2024-01-16 07:41:08 +0000 | [diff] [blame] | 13348 | #endif // UPB_MESSAGE_INTERNAL_MAP_ENTRY_H_ |
Protobuf Team Bot | 376ba2f | 2023-09-29 22:17:43 +0000 | [diff] [blame] | 13349 | |
| 13350 | // Must be last. |
| 13351 | |
| 13352 | #ifdef __cplusplus |
| 13353 | extern "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 | |
| 13360 | typedef struct { |
| 13361 | void const** entries; |
| 13362 | int size; |
| 13363 | int cap; |
| 13364 | } _upb_mapsorter; |
| 13365 | |
| 13366 | typedef struct { |
| 13367 | int start; |
| 13368 | int pos; |
| 13369 | int end; |
| 13370 | } _upb_sortedmap; |
| 13371 | |
| 13372 | UPB_INLINE void _upb_mapsorter_init(_upb_mapsorter* s) { |
| 13373 | s->entries = NULL; |
| 13374 | s->size = 0; |
| 13375 | s->cap = 0; |
| 13376 | } |
| 13377 | |
| 13378 | UPB_INLINE void _upb_mapsorter_destroy(_upb_mapsorter* s) { |
Protobuf Team Bot | ddc5406 | 2023-12-12 20:03:38 +0000 | [diff] [blame] | 13379 | if (s->entries) upb_gfree(s->entries); |
Protobuf Team Bot | 376ba2f | 2023-09-29 22:17:43 +0000 | [diff] [blame] | 13380 | } |
| 13381 | |
Protobuf Team Bot | 499c748 | 2023-12-30 01:42:17 +0000 | [diff] [blame] | 13382 | UPB_INLINE bool _upb_sortedmap_next(_upb_mapsorter* s, |
| 13383 | const struct upb_Map* map, |
Protobuf Team Bot | 376ba2f | 2023-09-29 22:17:43 +0000 | [diff] [blame] | 13384 | _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 Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 13388 | _upb_map_fromkey(key, &ent->k, map->key_size); |
Protobuf Team Bot | 376ba2f | 2023-09-29 22:17:43 +0000 | [diff] [blame] | 13389 | upb_value val = {tabent->val.val}; |
Protobuf Team Bot | 03440ec | 2024-01-11 23:13:19 +0000 | [diff] [blame] | 13390 | _upb_map_fromvalue(val, &ent->v, map->val_size); |
Protobuf Team Bot | 376ba2f | 2023-09-29 22:17:43 +0000 | [diff] [blame] | 13391 | return true; |
| 13392 | } |
| 13393 | |
| 13394 | UPB_INLINE bool _upb_sortedmap_nextext(_upb_mapsorter* s, |
| 13395 | _upb_sortedmap* sorted, |
Protobuf Team Bot | c13512a | 2024-01-25 18:53:49 +0000 | [diff] [blame] | 13396 | const upb_Extension** ext) { |
Protobuf Team Bot | 376ba2f | 2023-09-29 22:17:43 +0000 | [diff] [blame] | 13397 | if (sorted->pos == sorted->end) return false; |
Protobuf Team Bot | c13512a | 2024-01-25 18:53:49 +0000 | [diff] [blame] | 13398 | *ext = (const upb_Extension*)s->entries[sorted->pos++]; |
Protobuf Team Bot | 376ba2f | 2023-09-29 22:17:43 +0000 | [diff] [blame] | 13399 | return true; |
| 13400 | } |
| 13401 | |
| 13402 | UPB_INLINE void _upb_mapsorter_popmap(_upb_mapsorter* s, |
| 13403 | _upb_sortedmap* sorted) { |
| 13404 | s->size = sorted->start; |
| 13405 | } |
| 13406 | |
| 13407 | bool _upb_mapsorter_pushmap(_upb_mapsorter* s, upb_FieldType key_type, |
Protobuf Team Bot | 499c748 | 2023-12-30 01:42:17 +0000 | [diff] [blame] | 13408 | const struct upb_Map* map, _upb_sortedmap* sorted); |
Protobuf Team Bot | 376ba2f | 2023-09-29 22:17:43 +0000 | [diff] [blame] | 13409 | |
Protobuf Team Bot | c13512a | 2024-01-25 18:53:49 +0000 | [diff] [blame] | 13410 | bool _upb_mapsorter_pushexts(_upb_mapsorter* s, const upb_Extension* exts, |
| 13411 | size_t count, _upb_sortedmap* sorted); |
Protobuf Team Bot | 376ba2f | 2023-09-29 22:17:43 +0000 | [diff] [blame] | 13412 | |
| 13413 | #ifdef __cplusplus |
| 13414 | } /* extern "C" */ |
| 13415 | #endif |
| 13416 | |
| 13417 | |
Protobuf Team Bot | 5b34337 | 2023-12-19 06:18:53 +0000 | [diff] [blame] | 13418 | #endif /* UPB_MESSAGE_INTERNAL_MAP_SORTER_H_ */ |
Protobuf Team Bot | 376ba2f | 2023-09-29 22:17:43 +0000 | [diff] [blame] | 13419 | |
Protobuf Team Bot | cb8a31e | 2024-01-02 02:33:01 +0000 | [diff] [blame] | 13420 | #ifndef UPB_BASE_INTERNAL_LOG2_H_ |
| 13421 | #define UPB_BASE_INTERNAL_LOG2_H_ |
| 13422 | |
| 13423 | // Must be last. |
| 13424 | |
| 13425 | #ifdef __cplusplus |
| 13426 | extern "C" { |
| 13427 | #endif |
| 13428 | |
| 13429 | UPB_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 | |
| 13440 | UPB_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 Bot | 80b5fe4 | 2023-12-27 20:08:36 +0000 | [diff] [blame] | 13449 | #ifndef UPB_MESSAGE_COMPARE_H_ |
| 13450 | #define UPB_MESSAGE_COMPARE_H_ |
| 13451 | |
Protobuf Team Bot | e3dcdfd | 2024-02-09 21:49:54 +0000 | [diff] [blame] | 13452 | #include <stddef.h> |
| 13453 | |
Protobuf Team Bot | 80b5fe4 | 2023-12-27 20:08:36 +0000 | [diff] [blame] | 13454 | |
| 13455 | // Must be last. |
| 13456 | |
Protobuf Team Bot | a8543e8 | 2024-04-06 01:56:37 +0000 | [diff] [blame] | 13457 | enum { |
| 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 Bot | 80b5fe4 | 2023-12-27 20:08:36 +0000 | [diff] [blame] | 13463 | #ifdef __cplusplus |
| 13464 | extern "C" { |
| 13465 | #endif |
| 13466 | |
Protobuf Team Bot | e3dcdfd | 2024-02-09 21:49:54 +0000 | [diff] [blame] | 13467 | // Returns true if no known fields or extensions are set in the message. |
| 13468 | UPB_API bool upb_Message_IsEmpty(const upb_Message* msg, |
| 13469 | const upb_MiniTable* m); |
| 13470 | |
| 13471 | UPB_API bool upb_Message_IsEqual(const upb_Message* msg1, |
| 13472 | const upb_Message* msg2, |
Protobuf Team Bot | db9cc39 | 2024-03-11 17:27:18 +0000 | [diff] [blame] | 13473 | const upb_MiniTable* m, int options); |
Protobuf Team Bot | e3dcdfd | 2024-02-09 21:49:54 +0000 | [diff] [blame] | 13474 | |
Protobuf Team Bot | e3dcdfd | 2024-02-09 21:49:54 +0000 | [diff] [blame] | 13475 | // If |ctype| is a message then |m| must point to its minitable. |
Protobuf Team Bot | c13512a | 2024-01-25 18:53:49 +0000 | [diff] [blame] | 13476 | UPB_API_INLINE bool upb_MessageValue_IsEqual(upb_MessageValue val1, |
| 13477 | upb_MessageValue val2, |
Protobuf Team Bot | e3dcdfd | 2024-02-09 21:49:54 +0000 | [diff] [blame] | 13478 | upb_CType ctype, |
Protobuf Team Bot | db9cc39 | 2024-03-11 17:27:18 +0000 | [diff] [blame] | 13479 | const upb_MiniTable* m, |
| 13480 | int options) { |
Protobuf Team Bot | c13512a | 2024-01-25 18:53:49 +0000 | [diff] [blame] | 13481 | 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 Bot | e3dcdfd | 2024-02-09 21:49:54 +0000 | [diff] [blame] | 13500 | case kUpb_CType_Message: |
Protobuf Team Bot | db9cc39 | 2024-03-11 17:27:18 +0000 | [diff] [blame] | 13501 | return upb_Message_IsEqual(val1.msg_val, val2.msg_val, m, options); |
Protobuf Team Bot | e3dcdfd | 2024-02-09 21:49:54 +0000 | [diff] [blame] | 13502 | |
| 13503 | default: |
| 13504 | UPB_UNREACHABLE(); |
Protobuf Team Bot | c13512a | 2024-01-25 18:53:49 +0000 | [diff] [blame] | 13505 | return false; |
| 13506 | } |
| 13507 | } |
| 13508 | |
Protobuf Team Bot | 80b5fe4 | 2023-12-27 20:08:36 +0000 | [diff] [blame] | 13509 | #ifdef __cplusplus |
| 13510 | } /* extern "C" */ |
| 13511 | #endif |
| 13512 | |
| 13513 | |
| 13514 | #endif // UPB_MESSAGE_COMPARE_H_ |
| 13515 | |
Protobuf Team Bot | e3dcdfd | 2024-02-09 21:49:54 +0000 | [diff] [blame] | 13516 | #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 |
| 13524 | extern "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 | |
| 13539 | typedef 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 | |
| 13546 | upb_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 Bot | 80b5fe4 | 2023-12-27 20:08:36 +0000 | [diff] [blame] | 13557 | #ifndef UPB_MESSAGE_COPY_H_ |
| 13558 | #define UPB_MESSAGE_COPY_H_ |
| 13559 | |
| 13560 | |
| 13561 | // Must be last. |
| 13562 | |
| 13563 | #ifdef __cplusplus |
| 13564 | extern "C" { |
| 13565 | #endif |
| 13566 | |
| 13567 | // Deep clones a message using the provided target arena. |
| 13568 | upb_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. |
| 13572 | upb_Message* upb_Message_ShallowClone(const upb_Message* msg, |
| 13573 | const upb_MiniTable* m, upb_Arena* arena); |
| 13574 | |
| 13575 | // Deep clones array contents. |
| 13576 | upb_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. |
| 13580 | upb_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. |
| 13586 | bool 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. |
| 13590 | void 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 Cozzette | 8059da2 | 2023-08-16 07:57:14 -0700 | [diff] [blame] | 13600 | #ifndef UPB_MINI_DESCRIPTOR_INTERNAL_BASE92_H_ |
| 13601 | #define UPB_MINI_DESCRIPTOR_INTERNAL_BASE92_H_ |
| 13602 | |
Adam Cozzette | 7d5592e | 2023-08-23 12:15:26 -0700 | [diff] [blame] | 13603 | #include <stdint.h> |
| 13604 | |
Adam Cozzette | 8059da2 | 2023-08-16 07:57:14 -0700 | [diff] [blame] | 13605 | |
| 13606 | // Must be last. |
| 13607 | |
| 13608 | #ifdef __cplusplus |
| 13609 | extern "C" { |
| 13610 | #endif |
| 13611 | |
| 13612 | UPB_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 | |
| 13618 | UPB_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 | |
| 13624 | UPB_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 Bot | 91cfce9 | 2023-11-27 21:05:28 +0000 | [diff] [blame] | 13654 | #ifndef UPB_MINI_DESCRIPTOR_INTERNAL_DECODER_H_ |
| 13655 | #define UPB_MINI_DESCRIPTOR_INTERNAL_DECODER_H_ |
| 13656 | |
| 13657 | |
Adam Cozzette | 8059da2 | 2023-08-16 07:57:14 -0700 | [diff] [blame] | 13658 | // Must be last. |
| 13659 | |
| 13660 | // upb_MdDecoder: used internally for decoding MiniDescriptors for messages, |
| 13661 | // extensions, and enums. |
| 13662 | typedef struct { |
| 13663 | const char* end; |
| 13664 | upb_Status* status; |
| 13665 | jmp_buf err; |
| 13666 | } upb_MdDecoder; |
| 13667 | |
| 13668 | UPB_PRINTF(2, 3) |
| 13669 | UPB_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 | |
| 13681 | UPB_INLINE void upb_MdDecoder_CheckOutOfMemory(upb_MdDecoder* d, |
| 13682 | const void* ptr) { |
| 13683 | if (!ptr) upb_MdDecoder_ErrorJmp(d, "Out of memory"); |
| 13684 | } |
| 13685 | |
| 13686 | UPB_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 | |
| 13703 | typedef 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 | |
| 13727 | typedef enum { |
| 13728 | kUpb_EncodedFieldModifier_FlipPacked = 1 << 0, |
| 13729 | kUpb_EncodedFieldModifier_IsRequired = 1 << 1, |
| 13730 | kUpb_EncodedFieldModifier_IsProto3Singular = 1 << 2, |
Protobuf Team Bot | b58bd40 | 2023-09-19 15:42:34 +0000 | [diff] [blame] | 13731 | kUpb_EncodedFieldModifier_FlipValidateUtf8 = 1 << 3, |
Adam Cozzette | 8059da2 | 2023-08-16 07:57:14 -0700 | [diff] [blame] | 13732 | } upb_EncodedFieldModifier; |
| 13733 | |
| 13734 | enum { |
| 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 | |
| 13749 | enum { |
| 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 | |
| 13765 | typedef 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 Bot | b58bd40 | 2023-09-19 15:42:34 +0000 | [diff] [blame] | 13771 | kUpb_FieldModifier_ValidateUtf8 = 1 << 5, |
Adam Cozzette | 8059da2 | 2023-08-16 07:57:14 -0700 | [diff] [blame] | 13772 | } kUpb_FieldModifier; |
| 13773 | |
Protobuf Team Bot | b58bd40 | 2023-09-19 15:42:34 +0000 | [diff] [blame] | 13774 | // These modifiers are also used on the wire. |
Adam Cozzette | 8059da2 | 2023-08-16 07:57:14 -0700 | [diff] [blame] | 13775 | typedef 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 Bot | c4a7b03 | 2023-12-27 00:12:48 +0000 | [diff] [blame] | 13784 | #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 |
| 13796 | extern "C" { |
| 13797 | #endif |
| 13798 | |
| 13799 | // Checks if memory layout of src is compatible with dst. |
| 13800 | bool upb_MiniTable_Compatible(const upb_MiniTable* src, |
| 13801 | const upb_MiniTable* dst); |
| 13802 | |
| 13803 | typedef 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. |
| 13810 | upb_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 Bot | cb8a31e | 2024-01-02 02:33:01 +0000 | [diff] [blame] | 13820 | #ifndef UPB_HASH_INT_TABLE_H_ |
| 13821 | #define UPB_HASH_INT_TABLE_H_ |
| 13822 | |
| 13823 | |
| 13824 | // Must be last. |
| 13825 | |
| 13826 | typedef 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 |
| 13834 | extern "C" { |
| 13835 | #endif |
| 13836 | |
| 13837 | // Initialize a table. If memory allocation failed, false is returned and |
| 13838 | // the table is uninitialized. |
| 13839 | bool upb_inttable_init(upb_inttable* table, upb_Arena* a); |
| 13840 | |
| 13841 | // Returns the number of values in the table. |
| 13842 | size_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. |
| 13850 | bool 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. |
| 13855 | bool 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. |
| 13859 | bool 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. |
| 13864 | bool 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. |
| 13869 | void 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 | |
| 13882 | bool upb_inttable_next(const upb_inttable* t, uintptr_t* key, upb_value* val, |
| 13883 | intptr_t* iter); |
| 13884 | void 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 | |
| 13906 | enum { |
| 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 | |
| 13928 | typedef 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. */ |
| 13957 | const char* _upb_FastDecoder_ErrorJmp(upb_Decoder* d, int status); |
| 13958 | |
| 13959 | extern const uint8_t upb_utf8_offsets[]; |
| 13960 | |
| 13961 | UPB_INLINE |
| 13962 | bool _upb_Decoder_VerifyUtf8Inline(const char* ptr, int len) { |
| 13963 | return utf8_range_IsValid(ptr, len); |
| 13964 | } |
| 13965 | |
| 13966 | const 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. */ |
| 13972 | UPB_INLINE intptr_t decode_totable(const upb_MiniTable* tablep) { |
| 13973 | return ((intptr_t)tablep << 8) | tablep->UPB_PRIVATE(table_mask); |
| 13974 | } |
| 13975 | |
| 13976 | UPB_INLINE const upb_MiniTable* decode_totablep(intptr_t table) { |
| 13977 | return (const upb_MiniTable*)(table >> 8); |
| 13978 | } |
| 13979 | |
| 13980 | const char* _upb_Decoder_IsDoneFallback(upb_EpsCopyInputStream* e, |
| 13981 | const char* ptr, int overrun); |
| 13982 | |
| 13983 | UPB_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 | |
| 13988 | UPB_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 |
| 14004 | UPB_INLINE |
| 14005 | const 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 | |
| 14020 | UPB_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 Bot | cb8a31e | 2024-01-02 02:33:01 +0000 | [diff] [blame] | 14029 | #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 | |
| 14041 | typedef struct { |
| 14042 | const char* ptr; |
| 14043 | uint64_t val; |
| 14044 | } UPB_PRIVATE(_upb_WireReader_LongVarint); |
| 14045 | |
| 14046 | #ifdef __cplusplus |
| 14047 | extern "C" { |
| 14048 | #endif |
| 14049 | |
| 14050 | UPB_PRIVATE(_upb_WireReader_LongVarint) |
| 14051 | UPB_PRIVATE(_upb_WireReader_ReadLongVarint)(const char* ptr, uint64_t val); |
| 14052 | |
Protobuf Team Bot | 1d143b5 | 2024-01-25 20:29:43 +0000 | [diff] [blame] | 14053 | UPB_FORCEINLINE const char* UPB_PRIVATE(_upb_WireReader_ReadVarint)( |
Protobuf Team Bot | cb8a31e | 2024-01-02 02:33:01 +0000 | [diff] [blame] | 14054 | 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 Bot | b3878b5 | 2024-02-08 21:50:53 +0000 | [diff] [blame] | 14071 | UPB_API_INLINE uint32_t upb_WireReader_GetFieldNumber(uint32_t tag) { |
Protobuf Team Bot | cb8a31e | 2024-01-02 02:33:01 +0000 | [diff] [blame] | 14072 | return tag >> kUpb_WireReader_WireTypeBits; |
| 14073 | } |
| 14074 | |
Protobuf Team Bot | b3878b5 | 2024-02-08 21:50:53 +0000 | [diff] [blame] | 14075 | UPB_API_INLINE uint8_t upb_WireReader_GetWireType(uint32_t tag) { |
Protobuf Team Bot | cb8a31e | 2024-01-02 02:33:01 +0000 | [diff] [blame] | 14076 | 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. |
| 14090 | typedef 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 |
| 14110 | extern "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 Bot | 1d143b5 | 2024-01-25 20:29:43 +0000 | [diff] [blame] | 14119 | UPB_FORCEINLINE const char* upb_WireReader_ReadTag(const char* ptr, |
| 14120 | uint32_t* tag) { |
Protobuf Team Bot | cb8a31e | 2024-01-02 02:33:01 +0000 | [diff] [blame] | 14121 | 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 Bot | b3878b5 | 2024-02-08 21:50:53 +0000 | [diff] [blame] | 14129 | UPB_API_INLINE uint32_t upb_WireReader_GetFieldNumber(uint32_t tag); |
Protobuf Team Bot | cb8a31e | 2024-01-02 02:33:01 +0000 | [diff] [blame] | 14130 | |
| 14131 | // Given a tag, returns the wire type. |
Protobuf Team Bot | b3878b5 | 2024-02-08 21:50:53 +0000 | [diff] [blame] | 14132 | UPB_API_INLINE uint8_t upb_WireReader_GetWireType(uint32_t tag); |
Protobuf Team Bot | cb8a31e | 2024-01-02 02:33:01 +0000 | [diff] [blame] | 14133 | |
| 14134 | UPB_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(). |
| 14145 | UPB_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(). |
| 14156 | UPB_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(). |
| 14169 | UPB_INLINE const char* upb_WireReader_ReadFixed32(const char* ptr, void* val) { |
| 14170 | uint32_t uval; |
| 14171 | memcpy(&uval, ptr, 4); |
Protobuf Team Bot | de5ea1e | 2024-01-02 04:02:53 +0000 | [diff] [blame] | 14172 | uval = upb_BigEndian32(uval); |
Protobuf Team Bot | cb8a31e | 2024-01-02 02:33:01 +0000 | [diff] [blame] | 14173 | 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(). |
| 14182 | UPB_INLINE const char* upb_WireReader_ReadFixed64(const char* ptr, void* val) { |
| 14183 | uint64_t uval; |
| 14184 | memcpy(&uval, ptr, 8); |
Protobuf Team Bot | de5ea1e | 2024-01-02 04:02:53 +0000 | [diff] [blame] | 14185 | uval = upb_BigEndian64(uval); |
Protobuf Team Bot | cb8a31e | 2024-01-02 02:33:01 +0000 | [diff] [blame] | 14186 | memcpy(val, &uval, 8); |
| 14187 | return ptr + 8; |
| 14188 | } |
| 14189 | |
| 14190 | const 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? |
| 14203 | UPB_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 | |
| 14208 | UPB_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? |
| 14247 | UPB_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 |
| 14265 | extern "C" { |
| 14266 | #endif |
| 14267 | |
| 14268 | double _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 | |
| 14289 | typedef 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 |
| 14296 | extern "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. |
| 14323 | char* upb_MtDataEncoder_StartMessage(upb_MtDataEncoder* e, char* ptr, |
| 14324 | uint64_t msg_mod); |
| 14325 | char* upb_MtDataEncoder_PutField(upb_MtDataEncoder* e, char* ptr, |
| 14326 | upb_FieldType type, uint32_t field_num, |
| 14327 | uint64_t field_mod); |
| 14328 | char* upb_MtDataEncoder_StartOneof(upb_MtDataEncoder* e, char* ptr); |
| 14329 | char* 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. |
| 14334 | char* upb_MtDataEncoder_StartEnum(upb_MtDataEncoder* e, char* ptr); |
| 14335 | char* upb_MtDataEncoder_PutEnumValue(upb_MtDataEncoder* e, char* ptr, |
| 14336 | uint32_t val); |
| 14337 | char* upb_MtDataEncoder_EndEnum(upb_MtDataEncoder* e, char* ptr); |
| 14338 | |
| 14339 | // Encodes an entire mini descriptor for an extension. |
| 14340 | char* 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. |
| 14345 | char* 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. |
| 14351 | char* 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 Salo | 8809a11 | 2022-11-21 13:01:06 -0800 | [diff] [blame] | 14360 | #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 |
| 14367 | extern "C" { |
| 14368 | #endif |
| 14369 | |
| 14370 | upb_Arena* _upb_DefPool_Arena(const upb_DefPool* s); |
| 14371 | size_t _upb_DefPool_BytesLoaded(const upb_DefPool* s); |
| 14372 | upb_ExtensionRegistry* _upb_DefPool_ExtReg(const upb_DefPool* s); |
| 14373 | |
| 14374 | bool _upb_DefPool_InsertExt(upb_DefPool* s, const upb_MiniTableExtension* ext, |
Jakob Buchgraber | c0c79b2 | 2023-03-20 08:13:52 -0700 | [diff] [blame] | 14375 | const upb_FieldDef* f); |
Eric Salo | 8809a11 | 2022-11-21 13:01:06 -0800 | [diff] [blame] | 14376 | bool _upb_DefPool_InsertSym(upb_DefPool* s, upb_StringView sym, upb_value v, |
| 14377 | upb_Status* status); |
| 14378 | bool _upb_DefPool_LookupSym(const upb_DefPool* s, const char* sym, size_t size, |
| 14379 | upb_value* v); |
| 14380 | |
| 14381 | void** _upb_DefPool_ScratchData(const upb_DefPool* s); |
| 14382 | size_t* _upb_DefPool_ScratchSize(const upb_DefPool* s); |
Mike Kruskal | 232ecf4 | 2023-01-14 00:09:40 -0800 | [diff] [blame] | 14383 | void _upb_DefPool_SetPlatform(upb_DefPool* s, upb_MiniTablePlatform platform); |
Eric Salo | 8809a11 | 2022-11-21 13:01:06 -0800 | [diff] [blame] | 14384 | |
| 14385 | // For generated code only: loads a generated descriptor. |
| 14386 | typedef 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 | |
| 14393 | bool _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. |
| 14397 | bool _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 Bot | 7be2a45 | 2023-09-13 16:50:05 +0000 | [diff] [blame] | 14407 | #ifndef UPB_REFLECTION_DEF_BUILDER_INTERNAL_H_ |
| 14408 | #define UPB_REFLECTION_DEF_BUILDER_INTERNAL_H_ |
| 14409 | |
| 14410 | |
Eric Salo | 8809a11 | 2022-11-21 13:01:06 -0800 | [diff] [blame] | 14411 | // 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 Kruskal | 232ecf4 | 2023-01-14 00:09:40 -0800 | [diff] [blame] | 14415 | #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 Salo | 8809a11 | 2022-11-21 13:01:06 -0800 | [diff] [blame] | 14426 | } |
| 14427 | |
| 14428 | #ifdef __cplusplus |
| 14429 | extern "C" { |
| 14430 | #endif |
| 14431 | |
| 14432 | struct upb_DefBuilder { |
| 14433 | upb_DefPool* symtab; |
Protobuf Team Bot | ce9dcc2 | 2023-11-03 22:38:26 +0000 | [diff] [blame] | 14434 | 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 Salo | 8809a11 | 2022-11-21 13:01:06 -0800 | [diff] [blame] | 14438 | 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 Kruskal | 232ecf4 | 2023-01-14 00:09:40 -0800 | [diff] [blame] | 14443 | upb_MiniTablePlatform platform; // Platform we are targeting. |
Eric Salo | 8809a11 | 2022-11-21 13:01:06 -0800 | [diff] [blame] | 14444 | 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 | |
| 14450 | extern const char* kUpbDefOptDefault; |
| 14451 | |
| 14452 | // ctx->status has already been set elsewhere so just fail/longjmp() |
| 14453 | UPB_NORETURN void _upb_DefBuilder_FailJmp(upb_DefBuilder* ctx); |
| 14454 | |
| 14455 | UPB_NORETURN void _upb_DefBuilder_Errf(upb_DefBuilder* ctx, const char* fmt, |
| 14456 | ...) UPB_PRINTF(2, 3); |
| 14457 | UPB_NORETURN void _upb_DefBuilder_OomErr(upb_DefBuilder* ctx); |
| 14458 | |
| 14459 | const 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. |
| 14465 | const 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 | |
| 14470 | const 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 | |
| 14474 | char _upb_DefBuilder_ParseEscape(upb_DefBuilder* ctx, const upb_FieldDef* f, |
| 14475 | const char** src, const char* end); |
| 14476 | |
| 14477 | const char* _upb_DefBuilder_FullToShort(const char* fullname); |
| 14478 | |
| 14479 | UPB_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. |
| 14489 | UPB_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 | |
| 14496 | UPB_INLINE upb_Arena* _upb_DefBuilder_Arena(const upb_DefBuilder* ctx) { |
| 14497 | return ctx->arena; |
| 14498 | } |
| 14499 | |
| 14500 | UPB_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. |
| 14506 | void _upb_DefBuilder_CheckIdentSlow(upb_DefBuilder* ctx, upb_StringView name, |
| 14507 | bool full); |
| 14508 | |
Eric Salo | 8809a11 | 2022-11-21 13:01:06 -0800 | [diff] [blame] | 14509 | // Verify a full identifier string. This is slightly more complicated than |
| 14510 | // verifying a relative identifier string because we must track '.' chars. |
| 14511 | UPB_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 Bot | ce9dcc2 | 2023-11-03 22:38:26 +0000 | [diff] [blame] | 14530 | // Returns true if the returned feature set is new and must be populated. |
| 14531 | bool _upb_DefBuilder_GetOrCreateFeatureSet(upb_DefBuilder* ctx, |
| 14532 | const UPB_DESC(FeatureSet*) parent, |
| 14533 | upb_StringView key, |
| 14534 | UPB_DESC(FeatureSet**) set); |
| 14535 | |
| 14536 | const 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 | |
| 14542 | UPB_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 Salo | 8809a11 | 2022-11-21 13:01:06 -0800 | [diff] [blame] | 14549 | #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 |
| 14563 | extern "C" { |
| 14564 | #endif |
| 14565 | |
| 14566 | upb_EnumDef* _upb_EnumDef_At(const upb_EnumDef* e, int i); |
| 14567 | bool _upb_EnumDef_Insert(upb_EnumDef* e, upb_EnumValueDef* v, upb_Arena* a); |
| 14568 | const upb_MiniTableEnum* _upb_EnumDef_MiniTable(const upb_EnumDef* e); |
| 14569 | |
| 14570 | // Allocate and initialize an array of |n| enum defs. |
Protobuf Team Bot | ce9dcc2 | 2023-11-03 22:38:26 +0000 | [diff] [blame] | 14571 | upb_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 Salo | 8809a11 | 2022-11-21 13:01:06 -0800 | [diff] [blame] | 14576 | |
| 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 |
| 14591 | extern "C" { |
| 14592 | #endif |
| 14593 | |
| 14594 | upb_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|. |
| 14597 | upb_EnumValueDef* _upb_EnumValueDefs_New( |
| 14598 | upb_DefBuilder* ctx, const char* prefix, int n, |
Protobuf Team Bot | ce9dcc2 | 2023-11-03 22:38:26 +0000 | [diff] [blame] | 14599 | const UPB_DESC(EnumValueDescriptorProto*) const* protos, |
| 14600 | const UPB_DESC(FeatureSet*) parent_features, upb_EnumDef* e, |
Eric Salo | 8809a11 | 2022-11-21 13:01:06 -0800 | [diff] [blame] | 14601 | bool* is_sorted); |
| 14602 | |
| 14603 | const 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 |
| 14620 | extern "C" { |
| 14621 | #endif |
| 14622 | |
| 14623 | upb_FieldDef* _upb_FieldDef_At(const upb_FieldDef* f, int i); |
| 14624 | |
Eric Salo | 8809a11 | 2022-11-21 13:01:06 -0800 | [diff] [blame] | 14625 | bool _upb_FieldDef_IsClosedEnum(const upb_FieldDef* f); |
| 14626 | bool _upb_FieldDef_IsProto3Optional(const upb_FieldDef* f); |
| 14627 | int _upb_FieldDef_LayoutIndex(const upb_FieldDef* f); |
| 14628 | uint64_t _upb_FieldDef_Modifiers(const upb_FieldDef* f); |
| 14629 | void _upb_FieldDef_Resolve(upb_DefBuilder* ctx, const char* prefix, |
| 14630 | upb_FieldDef* f); |
Jakob Buchgraber | c0c79b2 | 2023-03-20 08:13:52 -0700 | [diff] [blame] | 14631 | void _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 Bot | ce9dcc2 | 2023-11-03 22:38:26 +0000 | [diff] [blame] | 14635 | upb_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 Salo | 8809a11 | 2022-11-21 13:01:06 -0800 | [diff] [blame] | 14640 | |
| 14641 | // Allocate and initialize an array of |n| field defs. |
Protobuf Team Bot | ce9dcc2 | 2023-11-03 22:38:26 +0000 | [diff] [blame] | 14642 | upb_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 Salo | 8809a11 | 2022-11-21 13:01:06 -0800 | [diff] [blame] | 14648 | |
| 14649 | // Allocate and return a list of pointers to the |n| field defs in |ff|, |
| 14650 | // sorted by field number. |
| 14651 | const 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 |
| 14668 | extern "C" { |
| 14669 | #endif |
| 14670 | |
| 14671 | const upb_MiniTableExtension* _upb_FileDef_ExtensionMiniTable( |
| 14672 | const upb_FileDef* f, int i); |
| 14673 | const int32_t* _upb_FileDef_PublicDependencyIndexes(const upb_FileDef* f); |
| 14674 | const int32_t* _upb_FileDef_WeakDependencyIndexes(const upb_FileDef* f); |
| 14675 | |
| 14676 | // upb_FileDef_Package() returns "" if f->package is NULL, this does not. |
| 14677 | const char* _upb_FileDef_RawPackage(const upb_FileDef* f); |
| 14678 | |
| 14679 | void _upb_FileDef_Create(upb_DefBuilder* ctx, |
Mike Kruskal | 232ecf4 | 2023-01-14 00:09:40 -0800 | [diff] [blame] | 14680 | const UPB_DESC(FileDescriptorProto) * file_proto); |
Eric Salo | 8809a11 | 2022-11-21 13:01:06 -0800 | [diff] [blame] | 14681 | |
| 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 |
| 14696 | extern "C" { |
| 14697 | #endif |
| 14698 | |
| 14699 | upb_MessageDef* _upb_MessageDef_At(const upb_MessageDef* m, int i); |
| 14700 | bool _upb_MessageDef_InMessageSet(const upb_MessageDef* m); |
| 14701 | bool _upb_MessageDef_Insert(upb_MessageDef* m, const char* name, size_t size, |
| 14702 | upb_value v, upb_Arena* a); |
| 14703 | void _upb_MessageDef_InsertField(upb_DefBuilder* ctx, upb_MessageDef* m, |
| 14704 | const upb_FieldDef* f); |
| 14705 | bool _upb_MessageDef_IsValidExtensionNumber(const upb_MessageDef* m, int n); |
Jakob Buchgraber | c0c79b2 | 2023-03-20 08:13:52 -0700 | [diff] [blame] | 14706 | void _upb_MessageDef_CreateMiniTable(upb_DefBuilder* ctx, upb_MessageDef* m); |
Eric Salo | 8809a11 | 2022-11-21 13:01:06 -0800 | [diff] [blame] | 14707 | void _upb_MessageDef_LinkMiniTable(upb_DefBuilder* ctx, |
| 14708 | const upb_MessageDef* m); |
| 14709 | void _upb_MessageDef_Resolve(upb_DefBuilder* ctx, upb_MessageDef* m); |
| 14710 | |
| 14711 | // Allocate and initialize an array of |n| message defs. |
Protobuf Team Bot | ce9dcc2 | 2023-11-03 22:38:26 +0000 | [diff] [blame] | 14712 | upb_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 Salo | 8809a11 | 2022-11-21 13:01:06 -0800 | [diff] [blame] | 14718 | |
| 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 |
| 14733 | extern "C" { |
| 14734 | #endif |
| 14735 | |
| 14736 | upb_ServiceDef* _upb_ServiceDef_At(const upb_ServiceDef* s, int i); |
| 14737 | |
| 14738 | // Allocate and initialize an array of |n| service defs. |
Protobuf Team Bot | ce9dcc2 | 2023-11-03 22:38:26 +0000 | [diff] [blame] | 14739 | upb_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 Salo | 8809a11 | 2022-11-21 13:01:06 -0800 | [diff] [blame] | 14744 | |
| 14745 | #ifdef __cplusplus |
| 14746 | } /* extern "C" */ |
| 14747 | #endif |
| 14748 | |
| 14749 | |
| 14750 | #endif /* UPB_REFLECTION_SERVICE_DEF_INTERNAL_H_ */ |
| 14751 | |
Protobuf Team Bot | ce9dcc2 | 2023-11-03 22:38:26 +0000 | [diff] [blame] | 14752 | #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 Bot | c12c732 | 2024-05-31 05:25:33 +0000 | [diff] [blame] | 14760 | #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 Bot | ce9dcc2 | 2023-11-03 22:38:26 +0000 | [diff] [blame] | 14761 | // clang-format on |
| 14762 | // NOLINTEND |
| 14763 | |
| 14764 | #endif // UPB_REFLECTION_UPB_EDITION_DEFAULTS_H_ |
| 14765 | |
Eric Salo | 8809a11 | 2022-11-21 13:01:06 -0800 | [diff] [blame] | 14766 | #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 Bot | 986cbb6 | 2023-09-19 15:03:51 +0000 | [diff] [blame] | 14773 | // TODO: Move some of this state directly into the encoder, maybe. |
Eric Salo | 8809a11 | 2022-11-21 13:01:06 -0800 | [diff] [blame] | 14774 | typedef struct { |
| 14775 | upb_MtDataEncoder e; |
| 14776 | size_t bufsize; |
| 14777 | char* buf; |
| 14778 | char* ptr; |
| 14779 | } upb_DescState; |
| 14780 | |
| 14781 | #ifdef __cplusplus |
| 14782 | extern "C" { |
| 14783 | #endif |
| 14784 | |
| 14785 | UPB_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 | |
| 14791 | bool _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 Bot | 0631035 | 2023-09-26 21:54:58 +0000 | [diff] [blame] | 14804 | // IWYU pragma: private, include "upb/reflection/def.h" |
Eric Salo | 8809a11 | 2022-11-21 13:01:06 -0800 | [diff] [blame] | 14805 | |
| 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 |
| 14813 | extern "C" { |
| 14814 | #endif |
| 14815 | |
| 14816 | int32_t upb_EnumReservedRange_Start(const upb_EnumReservedRange* r); |
| 14817 | int32_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 |
| 14829 | extern "C" { |
| 14830 | #endif |
| 14831 | |
| 14832 | upb_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|. |
| 14836 | upb_EnumReservedRange* _upb_EnumReservedRanges_New( |
| 14837 | upb_DefBuilder* ctx, int n, |
Protobuf Team Bot | ce9dcc2 | 2023-11-03 22:38:26 +0000 | [diff] [blame] | 14838 | const UPB_DESC(EnumDescriptorProto_EnumReservedRange*) const* protos, |
Eric Salo | 8809a11 | 2022-11-21 13:01:06 -0800 | [diff] [blame] | 14839 | 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 Bot | 7be2a45 | 2023-09-13 16:50:05 +0000 | [diff] [blame] | 14848 | #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 |
| 14857 | extern "C" { |
| 14858 | #endif |
| 14859 | |
| 14860 | // Variant that works with a length-delimited rather than NULL-delimited string, |
| 14861 | // as supported by strtable. |
| 14862 | char* 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 Salo | 8809a11 | 2022-11-21 13:01:06 -0800 | [diff] [blame] | 14871 | #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 |
| 14878 | extern "C" { |
| 14879 | #endif |
| 14880 | |
| 14881 | upb_ExtensionRange* _upb_ExtensionRange_At(const upb_ExtensionRange* r, int i); |
| 14882 | |
| 14883 | // Allocate and initialize an array of |n| extension ranges owned by |m|. |
| 14884 | upb_ExtensionRange* _upb_ExtensionRanges_New( |
| 14885 | upb_DefBuilder* ctx, int n, |
Protobuf Team Bot | ce9dcc2 | 2023-11-03 22:38:26 +0000 | [diff] [blame] | 14886 | const UPB_DESC(DescriptorProto_ExtensionRange*) const* protos, |
| 14887 | const UPB_DESC(FeatureSet*) parent_features, const upb_MessageDef* m); |
Eric Salo | 8809a11 | 2022-11-21 13:01:06 -0800 | [diff] [blame] | 14888 | |
| 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 |
| 14903 | extern "C" { |
| 14904 | #endif |
| 14905 | |
| 14906 | upb_OneofDef* _upb_OneofDef_At(const upb_OneofDef* o, int i); |
Jakob Buchgraber | c0c79b2 | 2023-03-20 08:13:52 -0700 | [diff] [blame] | 14907 | void _upb_OneofDef_Insert(upb_DefBuilder* ctx, upb_OneofDef* o, |
| 14908 | const upb_FieldDef* f, const char* name, size_t size); |
Eric Salo | 8809a11 | 2022-11-21 13:01:06 -0800 | [diff] [blame] | 14909 | |
| 14910 | // Allocate and initialize an array of |n| oneof defs owned by |m|. |
Protobuf Team Bot | ce9dcc2 | 2023-11-03 22:38:26 +0000 | [diff] [blame] | 14911 | upb_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 Salo | 8809a11 | 2022-11-21 13:01:06 -0800 | [diff] [blame] | 14916 | |
| 14917 | size_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 Bot | 0631035 | 2023-09-26 21:54:58 +0000 | [diff] [blame] | 14930 | // IWYU pragma: private, include "upb/reflection/def.h" |
Eric Salo | 8809a11 | 2022-11-21 13:01:06 -0800 | [diff] [blame] | 14931 | |
| 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 |
| 14939 | extern "C" { |
| 14940 | #endif |
| 14941 | |
| 14942 | int32_t upb_MessageReservedRange_Start(const upb_MessageReservedRange* r); |
| 14943 | int32_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 |
| 14955 | extern "C" { |
| 14956 | #endif |
| 14957 | |
| 14958 | upb_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|. |
| 14962 | upb_MessageReservedRange* _upb_MessageReservedRanges_New( |
| 14963 | upb_DefBuilder* ctx, int n, |
Mike Kruskal | 232ecf4 | 2023-01-14 00:09:40 -0800 | [diff] [blame] | 14964 | const UPB_DESC(DescriptorProto_ReservedRange) * const* protos, |
Eric Salo | 8809a11 | 2022-11-21 13:01:06 -0800 | [diff] [blame] | 14965 | 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 |
| 14981 | extern "C" { |
| 14982 | #endif |
| 14983 | |
| 14984 | upb_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 Bot | ce9dcc2 | 2023-11-03 22:38:26 +0000 | [diff] [blame] | 14987 | upb_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 Salo | 8809a11 | 2022-11-21 13:01:06 -0800 | [diff] [blame] | 14992 | |
| 14993 | #ifdef __cplusplus |
| 14994 | } /* extern "C" */ |
| 14995 | #endif |
| 14996 | |
| 14997 | |
| 14998 | #endif /* UPB_REFLECTION_METHOD_DEF_INTERNAL_H_ */ |
| 14999 | |
Eric Salo | 8809a11 | 2022-11-21 13:01:06 -0800 | [diff] [blame] | 15000 | // This should #undef all macros #defined in def.inc |
Joshua Haberman | 9abf6e2 | 2021-01-13 12:16:25 -0800 | [diff] [blame] | 15001 | |
Joshua Haberman | 9abf6e2 | 2021-01-13 12:16:25 -0800 | [diff] [blame] | 15002 | #undef UPB_SIZE |
| 15003 | #undef UPB_PTR_AT |
Joshua Haberman | dd69a48 | 2021-05-17 22:40:33 -0700 | [diff] [blame] | 15004 | #undef UPB_MAPTYPE_STRING |
Eric Salo | 3f36a91 | 2022-12-05 14:12:25 -0800 | [diff] [blame] | 15005 | #undef UPB_EXPORT |
Joshua Haberman | 9abf6e2 | 2021-01-13 12:16:25 -0800 | [diff] [blame] | 15006 | #undef UPB_INLINE |
Eric Salo | 3f36a91 | 2022-12-05 14:12:25 -0800 | [diff] [blame] | 15007 | #undef UPB_API |
| 15008 | #undef UPB_API_INLINE |
Joshua Haberman | 9abf6e2 | 2021-01-13 12:16:25 -0800 | [diff] [blame] | 15009 | #undef UPB_ALIGN_UP |
| 15010 | #undef UPB_ALIGN_DOWN |
| 15011 | #undef UPB_ALIGN_MALLOC |
| 15012 | #undef UPB_ALIGN_OF |
Protobuf Team Bot | e278550 | 2023-12-21 21:28:36 +0000 | [diff] [blame] | 15013 | #undef UPB_ALIGN_AS |
Joshua Haberman | d3995ec | 2022-09-30 16:54:39 -0700 | [diff] [blame] | 15014 | #undef UPB_MALLOC_ALIGN |
Joshua Haberman | dd69a48 | 2021-05-17 22:40:33 -0700 | [diff] [blame] | 15015 | #undef UPB_LIKELY |
| 15016 | #undef UPB_UNLIKELY |
Joshua Haberman | 9abf6e2 | 2021-01-13 12:16:25 -0800 | [diff] [blame] | 15017 | #undef UPB_FORCEINLINE |
| 15018 | #undef UPB_NOINLINE |
| 15019 | #undef UPB_NORETURN |
Joshua Haberman | dd69a48 | 2021-05-17 22:40:33 -0700 | [diff] [blame] | 15020 | #undef UPB_PRINTF |
Joshua Haberman | 9abf6e2 | 2021-01-13 12:16:25 -0800 | [diff] [blame] | 15021 | #undef UPB_MAX |
| 15022 | #undef UPB_MIN |
| 15023 | #undef UPB_UNUSED |
| 15024 | #undef UPB_ASSUME |
| 15025 | #undef UPB_ASSERT |
| 15026 | #undef UPB_UNREACHABLE |
Joshua Haberman | dd69a48 | 2021-05-17 22:40:33 -0700 | [diff] [blame] | 15027 | #undef UPB_SETJMP |
| 15028 | #undef UPB_LONGJMP |
| 15029 | #undef UPB_PTRADD |
| 15030 | #undef UPB_MUSTTAIL |
| 15031 | #undef UPB_FASTTABLE_SUPPORTED |
Mike Kruskal | 232ecf4 | 2023-01-14 00:09:40 -0800 | [diff] [blame] | 15032 | #undef UPB_FASTTABLE_MASK |
Joshua Haberman | dd69a48 | 2021-05-17 22:40:33 -0700 | [diff] [blame] | 15033 | #undef UPB_FASTTABLE |
| 15034 | #undef UPB_FASTTABLE_INIT |
Joshua Haberman | 9abf6e2 | 2021-01-13 12:16:25 -0800 | [diff] [blame] | 15035 | #undef UPB_POISON_MEMORY_REGION |
| 15036 | #undef UPB_UNPOISON_MEMORY_REGION |
| 15037 | #undef UPB_ASAN |
Sandy Zhang | e3b0943 | 2023-08-07 09:30:02 -0700 | [diff] [blame] | 15038 | #undef UPB_ASAN_GUARD_SIZE |
| 15039 | #undef UPB_CLANG_ASAN |
Protobuf Team Bot | 5e8d7e5 | 2024-03-15 22:28:30 +0000 | [diff] [blame] | 15040 | #undef UPB_TREAT_CLOSED_ENUMS_LIKE_OPEN |
Joshua Haberman | d3995ec | 2022-09-30 16:54:39 -0700 | [diff] [blame] | 15041 | #undef UPB_DEPRECATED |
| 15042 | #undef UPB_GNUC_MIN |
Mike Kruskal | 232ecf4 | 2023-01-14 00:09:40 -0800 | [diff] [blame] | 15043 | #undef UPB_DESCRIPTOR_UPB_H_FILENAME |
| 15044 | #undef UPB_DESC |
Protobuf Team Bot | ce9dcc2 | 2023-11-03 22:38:26 +0000 | [diff] [blame] | 15045 | #undef UPB_DESC_MINITABLE |
Mike Kruskal | 232ecf4 | 2023-01-14 00:09:40 -0800 | [diff] [blame] | 15046 | #undef UPB_IS_GOOGLE3 |
Eric Salo | dfb7155 | 2023-03-22 12:35:09 -0700 | [diff] [blame] | 15047 | #undef UPB_ATOMIC |
| 15048 | #undef UPB_USE_C11_ATOMICS |
Deanna Garcia | c7d979d | 2023-04-14 17:22:13 -0700 | [diff] [blame] | 15049 | #undef UPB_PRIVATE |
Protobuf Team Bot | 07194fc | 2023-11-30 05:43:03 +0000 | [diff] [blame] | 15050 | #undef UPB_ONLYBITS |
Protobuf Team Bot | bf7ac9f | 2024-06-04 17:32:11 +0000 | [diff] [blame] | 15051 | #undef UPB_LINKARR_DECLARE |
| 15052 | #undef UPB_LINKARR_APPEND |
| 15053 | #undef UPB_LINKARR_START |
| 15054 | #undef UPB_LINKARR_STOP |