google-protobuf 3.11.4 → 3.12.0.rc.1
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of google-protobuf might be problematic. Click here for more details.
- checksums.yaml +4 -4
- data/ext/google/protobuf_c/defs.c +96 -8
- data/ext/google/protobuf_c/encode_decode.c +16 -14
- data/ext/google/protobuf_c/extconf.rb +0 -0
- data/ext/google/protobuf_c/map.c +20 -46
- data/ext/google/protobuf_c/message.c +20 -11
- data/ext/google/protobuf_c/protobuf.h +1 -0
- data/ext/google/protobuf_c/storage.c +72 -23
- data/ext/google/protobuf_c/upb.c +1810 -1282
- data/ext/google/protobuf_c/upb.h +1031 -1339
- data/lib/google/protobuf/well_known_types.rb +0 -0
- data/tests/basic.rb +66 -48
- data/tests/generated_code_test.rb +0 -0
- data/tests/stress.rb +0 -0
- metadata +17 -11
data/ext/google/protobuf_c/upb.h
CHANGED
@@ -21,9 +21,7 @@
|
|
21
21
|
*
|
22
22
|
* This file is private and must not be included by users!
|
23
23
|
*/
|
24
|
-
#
|
25
|
-
#error must include stdint.h first
|
26
|
-
#endif
|
24
|
+
#include <stdint.h>
|
27
25
|
|
28
26
|
#if UINTPTR_MAX == 0xffffffff
|
29
27
|
#define UPB_SIZE(size32, size64) size32
|
@@ -31,17 +29,21 @@
|
|
31
29
|
#define UPB_SIZE(size32, size64) size64
|
32
30
|
#endif
|
33
31
|
|
34
|
-
|
35
|
-
|
32
|
+
/* If we always read/write as a consistent type to each address, this shouldn't
|
33
|
+
* violate aliasing.
|
34
|
+
*/
|
35
|
+
#define UPB_PTR_AT(msg, ofs, type) ((type*)((char*)(msg) + (ofs)))
|
36
36
|
|
37
37
|
#define UPB_READ_ONEOF(msg, fieldtype, offset, case_offset, case_val, default) \
|
38
|
-
|
39
|
-
?
|
38
|
+
*UPB_PTR_AT(msg, case_offset, int) == case_val \
|
39
|
+
? *UPB_PTR_AT(msg, offset, fieldtype) \
|
40
40
|
: default
|
41
41
|
|
42
42
|
#define UPB_WRITE_ONEOF(msg, fieldtype, offset, value, case_offset, case_val) \
|
43
|
-
|
44
|
-
|
43
|
+
*UPB_PTR_AT(msg, case_offset, int) = case_val; \
|
44
|
+
*UPB_PTR_AT(msg, offset, fieldtype) = value;
|
45
|
+
|
46
|
+
#define UPB_MAPTYPE_STRING 0
|
45
47
|
|
46
48
|
/* UPB_INLINE: inline if possible, emit standalone code if required. */
|
47
49
|
#ifdef __cplusplus
|
@@ -115,7 +117,7 @@ int msvc_vsnprintf(char* s, size_t n, const char* format, va_list arg);
|
|
115
117
|
#ifdef __cplusplus
|
116
118
|
#if __cplusplus >= 201103L || defined(__GXX_EXPERIMENTAL_CXX0X__) || \
|
117
119
|
(defined(_MSC_VER) && _MSC_VER >= 1900)
|
118
|
-
|
120
|
+
/* C++11 is present */
|
119
121
|
#else
|
120
122
|
#error upb requires C++11 for C++ support
|
121
123
|
#endif
|
@@ -126,6 +128,18 @@ int msvc_vsnprintf(char* s, size_t n, const char* format, va_list arg);
|
|
126
128
|
|
127
129
|
#define UPB_UNUSED(var) (void)var
|
128
130
|
|
131
|
+
/* UPB_ASSUME(): in release mode, we tell the compiler to assume this is true.
|
132
|
+
*/
|
133
|
+
#ifdef NDEBUG
|
134
|
+
#ifdef __GNUC__
|
135
|
+
#define UPB_ASSUME(expr) if (!(expr)) __builtin_unreachable()
|
136
|
+
#else
|
137
|
+
#define UPB_ASSUME(expr) do {} if (false && (expr))
|
138
|
+
#endif
|
139
|
+
#else
|
140
|
+
#define UPB_ASSUME(expr) assert(expr)
|
141
|
+
#endif
|
142
|
+
|
129
143
|
/* UPB_ASSERT(): in release mode, we use the expression without letting it be
|
130
144
|
* evaluated. This prevents "unused variable" warnings. */
|
131
145
|
#ifdef NDEBUG
|
@@ -152,10 +166,51 @@ int msvc_vsnprintf(char* s, size_t n, const char* format, va_list arg);
|
|
152
166
|
#define UPB_INFINITY (1.0 / 0.0)
|
153
167
|
#endif
|
154
168
|
/*
|
155
|
-
**
|
169
|
+
** upb_decode: parsing into a upb_msg using a upb_msglayout.
|
170
|
+
*/
|
171
|
+
|
172
|
+
#ifndef UPB_DECODE_H_
|
173
|
+
#define UPB_DECODE_H_
|
174
|
+
|
175
|
+
/*
|
176
|
+
** Our memory representation for parsing tables and messages themselves.
|
177
|
+
** Functions in this file are used by generated code and possibly reflection.
|
156
178
|
**
|
157
|
-
**
|
158
|
-
|
179
|
+
** The definitions in this file are internal to upb.
|
180
|
+
**/
|
181
|
+
|
182
|
+
#ifndef UPB_MSG_H_
|
183
|
+
#define UPB_MSG_H_
|
184
|
+
|
185
|
+
#include <stdint.h>
|
186
|
+
#include <string.h>
|
187
|
+
|
188
|
+
/*
|
189
|
+
** upb_table
|
190
|
+
**
|
191
|
+
** This header is INTERNAL-ONLY! Its interfaces are not public or stable!
|
192
|
+
** This file defines very fast int->upb_value (inttable) and string->upb_value
|
193
|
+
** (strtable) hash tables.
|
194
|
+
**
|
195
|
+
** The table uses chained scatter with Brent's variation (inspired by the Lua
|
196
|
+
** implementation of hash tables). The hash function for strings is Austin
|
197
|
+
** Appleby's "MurmurHash."
|
198
|
+
**
|
199
|
+
** The inttable uses uintptr_t as its key, which guarantees it can be used to
|
200
|
+
** store pointers or integers of at least 32 bits (upb isn't really useful on
|
201
|
+
** systems where sizeof(void*) < 4).
|
202
|
+
**
|
203
|
+
** The table must be homogenous (all values of the same type). In debug
|
204
|
+
** mode, we check this on insert and lookup.
|
205
|
+
*/
|
206
|
+
|
207
|
+
#ifndef UPB_TABLE_H_
|
208
|
+
#define UPB_TABLE_H_
|
209
|
+
|
210
|
+
#include <stdint.h>
|
211
|
+
#include <string.h>
|
212
|
+
/*
|
213
|
+
** This file contains shared definitions that are widely used across upb.
|
159
214
|
*/
|
160
215
|
|
161
216
|
#ifndef UPB_H_
|
@@ -168,23 +223,13 @@ int msvc_vsnprintf(char* s, size_t n, const char* format, va_list arg);
|
|
168
223
|
#include <stdint.h>
|
169
224
|
#include <string.h>
|
170
225
|
|
226
|
+
|
171
227
|
#ifdef __cplusplus
|
172
|
-
|
173
|
-
namespace upb {
|
174
|
-
class Arena;
|
175
|
-
class Status;
|
176
|
-
template <int N> class InlinedArena;
|
177
|
-
}
|
228
|
+
extern "C" {
|
178
229
|
#endif
|
179
230
|
|
180
|
-
|
181
231
|
/* upb_status *****************************************************************/
|
182
232
|
|
183
|
-
/* upb_status represents a success or failure status and error message.
|
184
|
-
* It owns no resources and allocates no memory, so it should work
|
185
|
-
* even in OOM situations. */
|
186
|
-
|
187
|
-
/* The maximum length of an error message before it will get truncated. */
|
188
233
|
#define UPB_STATUS_MAX_MESSAGE 127
|
189
234
|
|
190
235
|
typedef struct {
|
@@ -192,59 +237,15 @@ typedef struct {
|
|
192
237
|
char msg[UPB_STATUS_MAX_MESSAGE]; /* Error message; NULL-terminated. */
|
193
238
|
} upb_status;
|
194
239
|
|
195
|
-
#ifdef __cplusplus
|
196
|
-
extern "C" {
|
197
|
-
#endif
|
198
|
-
|
199
240
|
const char *upb_status_errmsg(const upb_status *status);
|
200
241
|
bool upb_ok(const upb_status *status);
|
201
242
|
|
202
|
-
/*
|
203
|
-
* to support use cases where the function's caller does not care about the
|
204
|
-
* status message. */
|
243
|
+
/* These are no-op if |status| is NULL. */
|
205
244
|
void upb_status_clear(upb_status *status);
|
206
245
|
void upb_status_seterrmsg(upb_status *status, const char *msg);
|
207
246
|
void upb_status_seterrf(upb_status *status, const char *fmt, ...);
|
208
247
|
void upb_status_vseterrf(upb_status *status, const char *fmt, va_list args);
|
209
248
|
|
210
|
-
UPB_INLINE void upb_status_setoom(upb_status *status) {
|
211
|
-
upb_status_seterrmsg(status, "out of memory");
|
212
|
-
}
|
213
|
-
|
214
|
-
#ifdef __cplusplus
|
215
|
-
} /* extern "C" */
|
216
|
-
|
217
|
-
class upb::Status {
|
218
|
-
public:
|
219
|
-
Status() { upb_status_clear(&status_); }
|
220
|
-
|
221
|
-
upb_status* ptr() { return &status_; }
|
222
|
-
|
223
|
-
/* Returns true if there is no error. */
|
224
|
-
bool ok() const { return upb_ok(&status_); }
|
225
|
-
|
226
|
-
/* Guaranteed to be NULL-terminated. */
|
227
|
-
const char *error_message() const { return upb_status_errmsg(&status_); }
|
228
|
-
|
229
|
-
/* The error message will be truncated if it is longer than
|
230
|
-
* UPB_STATUS_MAX_MESSAGE-4. */
|
231
|
-
void SetErrorMessage(const char *msg) { upb_status_seterrmsg(&status_, msg); }
|
232
|
-
void SetFormattedErrorMessage(const char *fmt, ...) {
|
233
|
-
va_list args;
|
234
|
-
va_start(args, fmt);
|
235
|
-
upb_status_vseterrf(&status_, fmt, args);
|
236
|
-
va_end(args);
|
237
|
-
}
|
238
|
-
|
239
|
-
/* Resets the status to a successful state with no message. */
|
240
|
-
void Clear() { upb_status_clear(&status_); }
|
241
|
-
|
242
|
-
private:
|
243
|
-
upb_status status_;
|
244
|
-
};
|
245
|
-
|
246
|
-
#endif /* __cplusplus */
|
247
|
-
|
248
249
|
/** upb_strview ************************************************************/
|
249
250
|
|
250
251
|
typedef struct {
|
@@ -311,16 +312,8 @@ UPB_INLINE void upb_free(upb_alloc *alloc, void *ptr) {
|
|
311
312
|
|
312
313
|
/* The global allocator used by upb. Uses the standard malloc()/free(). */
|
313
314
|
|
314
|
-
#ifdef __cplusplus
|
315
|
-
extern "C" {
|
316
|
-
#endif
|
317
|
-
|
318
315
|
extern upb_alloc upb_alloc_global;
|
319
316
|
|
320
|
-
#ifdef __cplusplus
|
321
|
-
} /* extern "C" */
|
322
|
-
#endif
|
323
|
-
|
324
317
|
/* Functions that hard-code the global malloc.
|
325
318
|
*
|
326
319
|
* We still get benefit because we can put custom logic into our global
|
@@ -357,9 +350,18 @@ typedef void upb_cleanup_func(void *ud);
|
|
357
350
|
struct upb_arena;
|
358
351
|
typedef struct upb_arena upb_arena;
|
359
352
|
|
360
|
-
|
361
|
-
|
362
|
-
|
353
|
+
typedef struct {
|
354
|
+
/* We implement the allocator interface.
|
355
|
+
* This must be the first member of upb_arena! */
|
356
|
+
upb_alloc alloc;
|
357
|
+
|
358
|
+
char *ptr, *end;
|
359
|
+
} _upb_arena_head;
|
360
|
+
|
361
|
+
UPB_INLINE size_t _upb_arena_alignup(size_t size) {
|
362
|
+
const size_t maxalign = 16;
|
363
|
+
return ((size + maxalign - 1) / maxalign) * maxalign;
|
364
|
+
}
|
363
365
|
|
364
366
|
/* Creates an arena from the given initial block (if any -- n may be 0).
|
365
367
|
* Additional blocks will be allocated from |alloc|. If |alloc| is NULL, this
|
@@ -368,82 +370,35 @@ upb_arena *upb_arena_init(void *mem, size_t n, upb_alloc *alloc);
|
|
368
370
|
void upb_arena_free(upb_arena *a);
|
369
371
|
bool upb_arena_addcleanup(upb_arena *a, void *ud, upb_cleanup_func *func);
|
370
372
|
size_t upb_arena_bytesallocated(const upb_arena *a);
|
373
|
+
void *_upb_arena_slowmalloc(upb_arena *a, size_t size);
|
371
374
|
|
372
375
|
UPB_INLINE upb_alloc *upb_arena_alloc(upb_arena *a) { return (upb_alloc*)a; }
|
373
376
|
|
374
|
-
/* Convenience wrappers around upb_alloc functions. */
|
375
|
-
|
376
377
|
UPB_INLINE void *upb_arena_malloc(upb_arena *a, size_t size) {
|
377
|
-
|
378
|
+
_upb_arena_head *h = (_upb_arena_head*)a;
|
379
|
+
size = _upb_arena_alignup(size);
|
380
|
+
if (UPB_LIKELY((size_t)(h->end - h->ptr) >= size)) {
|
381
|
+
void* ret = h->ptr;
|
382
|
+
h->ptr += size;
|
383
|
+
return ret;
|
384
|
+
} else {
|
385
|
+
return _upb_arena_slowmalloc(a, size);
|
386
|
+
}
|
378
387
|
}
|
379
388
|
|
380
389
|
UPB_INLINE void *upb_arena_realloc(upb_arena *a, void *ptr, size_t oldsize,
|
381
390
|
size_t size) {
|
382
|
-
|
391
|
+
if (oldsize == 0) {
|
392
|
+
return upb_arena_malloc(a, size);
|
393
|
+
} else {
|
394
|
+
return upb_realloc(upb_arena_alloc(a), ptr, oldsize, size);
|
395
|
+
}
|
383
396
|
}
|
384
397
|
|
385
398
|
UPB_INLINE upb_arena *upb_arena_new(void) {
|
386
399
|
return upb_arena_init(NULL, 0, &upb_alloc_global);
|
387
400
|
}
|
388
401
|
|
389
|
-
#ifdef __cplusplus
|
390
|
-
} /* extern "C" */
|
391
|
-
|
392
|
-
class upb::Arena {
|
393
|
-
public:
|
394
|
-
/* A simple arena with no initial memory block and the default allocator. */
|
395
|
-
Arena() : ptr_(upb_arena_new(), upb_arena_free) {}
|
396
|
-
|
397
|
-
upb_arena* ptr() { return ptr_.get(); }
|
398
|
-
|
399
|
-
/* Allows this arena to be used as a generic allocator.
|
400
|
-
*
|
401
|
-
* The arena does not need free() calls so when using Arena as an allocator
|
402
|
-
* it is safe to skip them. However they are no-ops so there is no harm in
|
403
|
-
* calling free() either. */
|
404
|
-
upb_alloc *allocator() { return upb_arena_alloc(ptr_.get()); }
|
405
|
-
|
406
|
-
/* Add a cleanup function to run when the arena is destroyed.
|
407
|
-
* Returns false on out-of-memory. */
|
408
|
-
bool AddCleanup(void *ud, upb_cleanup_func* func) {
|
409
|
-
return upb_arena_addcleanup(ptr_.get(), ud, func);
|
410
|
-
}
|
411
|
-
|
412
|
-
/* Total number of bytes that have been allocated. It is undefined what
|
413
|
-
* Realloc() does to &arena_ counter. */
|
414
|
-
size_t BytesAllocated() const { return upb_arena_bytesallocated(ptr_.get()); }
|
415
|
-
|
416
|
-
private:
|
417
|
-
std::unique_ptr<upb_arena, decltype(&upb_arena_free)> ptr_;
|
418
|
-
};
|
419
|
-
|
420
|
-
#endif
|
421
|
-
|
422
|
-
/* upb::InlinedArena **********************************************************/
|
423
|
-
|
424
|
-
/* upb::InlinedArena seeds the arenas with a predefined amount of memory. No
|
425
|
-
* heap memory will be allocated until the initial block is exceeded.
|
426
|
-
*
|
427
|
-
* These types only exist in C++ */
|
428
|
-
|
429
|
-
#ifdef __cplusplus
|
430
|
-
|
431
|
-
template <int N> class upb::InlinedArena : public upb::Arena {
|
432
|
-
public:
|
433
|
-
InlinedArena() : ptr_(upb_arena_new(&initial_block_, N, &upb_alloc_global)) {}
|
434
|
-
|
435
|
-
upb_arena* ptr() { return ptr_.get(); }
|
436
|
-
|
437
|
-
private:
|
438
|
-
InlinedArena(const InlinedArena*) = delete;
|
439
|
-
InlinedArena& operator=(const InlinedArena*) = delete;
|
440
|
-
|
441
|
-
std::unique_ptr<upb_arena, decltype(&upb_arena_free)> ptr_;
|
442
|
-
char initial_block_[N];
|
443
|
-
};
|
444
|
-
|
445
|
-
#endif /* __cplusplus */
|
446
|
-
|
447
402
|
/* Constants ******************************************************************/
|
448
403
|
|
449
404
|
/* Generic function type. */
|
@@ -463,21 +418,17 @@ typedef enum {
|
|
463
418
|
* types defined in descriptor.proto, which gives INT32 and SINT32 separate
|
464
419
|
* types (we distinguish the two with the "integer encoding" enum below). */
|
465
420
|
typedef enum {
|
466
|
-
/* Types stored in 1 byte. */
|
467
421
|
UPB_TYPE_BOOL = 1,
|
468
|
-
/* Types stored in 4 bytes. */
|
469
422
|
UPB_TYPE_FLOAT = 2,
|
470
423
|
UPB_TYPE_INT32 = 3,
|
471
424
|
UPB_TYPE_UINT32 = 4,
|
472
425
|
UPB_TYPE_ENUM = 5, /* Enum values are int32. */
|
473
|
-
|
474
|
-
|
475
|
-
|
476
|
-
|
477
|
-
|
478
|
-
|
479
|
-
UPB_TYPE_INT64 = 10,
|
480
|
-
UPB_TYPE_UINT64 = 11
|
426
|
+
UPB_TYPE_MESSAGE = 6,
|
427
|
+
UPB_TYPE_DOUBLE = 7,
|
428
|
+
UPB_TYPE_INT64 = 8,
|
429
|
+
UPB_TYPE_UINT64 = 9,
|
430
|
+
UPB_TYPE_STRING = 10,
|
431
|
+
UPB_TYPE_BYTES = 11
|
481
432
|
} upb_fieldtype_t;
|
482
433
|
|
483
434
|
/* The repeated-ness of each field; this matches descriptor.proto. */
|
@@ -489,6 +440,7 @@ typedef enum {
|
|
489
440
|
|
490
441
|
/* Descriptor types, as defined in descriptor.proto. */
|
491
442
|
typedef enum {
|
443
|
+
/* Old (long) names. TODO(haberman): remove */
|
492
444
|
UPB_DESCRIPTOR_TYPE_DOUBLE = 1,
|
493
445
|
UPB_DESCRIPTOR_TYPE_FLOAT = 2,
|
494
446
|
UPB_DESCRIPTOR_TYPE_INT64 = 3,
|
@@ -506,145 +458,36 @@ typedef enum {
|
|
506
458
|
UPB_DESCRIPTOR_TYPE_SFIXED32 = 15,
|
507
459
|
UPB_DESCRIPTOR_TYPE_SFIXED64 = 16,
|
508
460
|
UPB_DESCRIPTOR_TYPE_SINT32 = 17,
|
509
|
-
UPB_DESCRIPTOR_TYPE_SINT64 = 18
|
461
|
+
UPB_DESCRIPTOR_TYPE_SINT64 = 18,
|
462
|
+
|
463
|
+
UPB_DTYPE_DOUBLE = 1,
|
464
|
+
UPB_DTYPE_FLOAT = 2,
|
465
|
+
UPB_DTYPE_INT64 = 3,
|
466
|
+
UPB_DTYPE_UINT64 = 4,
|
467
|
+
UPB_DTYPE_INT32 = 5,
|
468
|
+
UPB_DTYPE_FIXED64 = 6,
|
469
|
+
UPB_DTYPE_FIXED32 = 7,
|
470
|
+
UPB_DTYPE_BOOL = 8,
|
471
|
+
UPB_DTYPE_STRING = 9,
|
472
|
+
UPB_DTYPE_GROUP = 10,
|
473
|
+
UPB_DTYPE_MESSAGE = 11,
|
474
|
+
UPB_DTYPE_BYTES = 12,
|
475
|
+
UPB_DTYPE_UINT32 = 13,
|
476
|
+
UPB_DTYPE_ENUM = 14,
|
477
|
+
UPB_DTYPE_SFIXED32 = 15,
|
478
|
+
UPB_DTYPE_SFIXED64 = 16,
|
479
|
+
UPB_DTYPE_SINT32 = 17,
|
480
|
+
UPB_DTYPE_SINT64 = 18
|
510
481
|
} upb_descriptortype_t;
|
511
482
|
|
512
|
-
|
513
|
-
|
514
|
-
|
515
|
-
#endif /* UPB_H_ */
|
516
|
-
/*
|
517
|
-
** upb_decode: parsing into a upb_msg using a upb_msglayout.
|
518
|
-
*/
|
519
|
-
|
520
|
-
#ifndef UPB_DECODE_H_
|
521
|
-
#define UPB_DECODE_H_
|
522
|
-
|
523
|
-
/*
|
524
|
-
** Data structures for message tables, used for parsing and serialization.
|
525
|
-
** This are much lighter-weight than full reflection, but they are do not
|
526
|
-
** have enough information to convert to text format, JSON, etc.
|
527
|
-
**
|
528
|
-
** The definitions in this file are internal to upb.
|
529
|
-
**/
|
530
|
-
|
531
|
-
#ifndef UPB_MSG_H_
|
532
|
-
#define UPB_MSG_H_
|
533
|
-
|
534
|
-
#include <stdint.h>
|
535
|
-
#include <string.h>
|
536
|
-
|
537
|
-
#ifdef __cplusplus
|
538
|
-
extern "C" {
|
539
|
-
#endif
|
540
|
-
|
541
|
-
typedef void upb_msg;
|
542
|
-
|
543
|
-
/** upb_msglayout *************************************************************/
|
544
|
-
|
545
|
-
/* upb_msglayout represents the memory layout of a given upb_msgdef. The
|
546
|
-
* members are public so generated code can initialize them, but users MUST NOT
|
547
|
-
* read or write any of its members. */
|
548
|
-
|
549
|
-
typedef struct {
|
550
|
-
uint32_t number;
|
551
|
-
uint16_t offset;
|
552
|
-
int16_t presence; /* If >0, hasbit_index+1. If <0, oneof_index+1. */
|
553
|
-
uint16_t submsg_index; /* undefined if descriptortype != MESSAGE or GROUP. */
|
554
|
-
uint8_t descriptortype;
|
555
|
-
uint8_t label;
|
556
|
-
} upb_msglayout_field;
|
557
|
-
|
558
|
-
typedef struct upb_msglayout {
|
559
|
-
const struct upb_msglayout *const* submsgs;
|
560
|
-
const upb_msglayout_field *fields;
|
561
|
-
/* Must be aligned to sizeof(void*). Doesn't include internal members like
|
562
|
-
* unknown fields, extension dict, pointer to msglayout, etc. */
|
563
|
-
uint16_t size;
|
564
|
-
uint16_t field_count;
|
565
|
-
bool extendable;
|
566
|
-
} upb_msglayout;
|
567
|
-
|
568
|
-
/** Message internal representation *******************************************/
|
569
|
-
|
570
|
-
/* Our internal representation for repeated fields. */
|
571
|
-
typedef struct {
|
572
|
-
void *data; /* Each element is element_size. */
|
573
|
-
size_t len; /* Measured in elements. */
|
574
|
-
size_t size; /* Measured in elements. */
|
575
|
-
} upb_array;
|
576
|
-
|
577
|
-
upb_msg *upb_msg_new(const upb_msglayout *l, upb_arena *a);
|
578
|
-
upb_msg *upb_msg_new(const upb_msglayout *l, upb_arena *a);
|
483
|
+
#define UPB_MAP_BEGIN -1
|
579
484
|
|
580
|
-
void upb_msg_addunknown(upb_msg *msg, const char *data, size_t len,
|
581
|
-
upb_arena *arena);
|
582
|
-
const char *upb_msg_getunknown(const upb_msg *msg, size_t *len);
|
583
|
-
|
584
|
-
upb_array *upb_array_new(upb_arena *a);
|
585
|
-
|
586
|
-
#ifdef __cplusplus
|
587
|
-
} /* extern "C" */
|
588
|
-
#endif
|
589
|
-
|
590
|
-
#endif /* UPB_MSG_H_ */
|
591
|
-
|
592
|
-
#ifdef __cplusplus
|
593
|
-
extern "C" {
|
594
|
-
#endif
|
595
|
-
|
596
|
-
bool upb_decode(const char *buf, size_t size, upb_msg *msg,
|
597
|
-
const upb_msglayout *l, upb_arena *arena);
|
598
|
-
|
599
|
-
#ifdef __cplusplus
|
600
|
-
} /* extern "C" */
|
601
|
-
#endif
|
602
|
-
|
603
|
-
#endif /* UPB_DECODE_H_ */
|
604
|
-
/*
|
605
|
-
** upb_encode: parsing into a upb_msg using a upb_msglayout.
|
606
|
-
*/
|
607
|
-
|
608
|
-
#ifndef UPB_ENCODE_H_
|
609
|
-
#define UPB_ENCODE_H_
|
610
|
-
|
611
|
-
|
612
|
-
#ifdef __cplusplus
|
613
|
-
extern "C" {
|
614
|
-
#endif
|
615
|
-
|
616
|
-
char *upb_encode(const void *msg, const upb_msglayout *l, upb_arena *arena,
|
617
|
-
size_t *size);
|
618
485
|
|
619
486
|
#ifdef __cplusplus
|
620
487
|
} /* extern "C" */
|
621
488
|
#endif
|
622
489
|
|
623
|
-
#endif /*
|
624
|
-
/*
|
625
|
-
** upb_table
|
626
|
-
**
|
627
|
-
** This header is INTERNAL-ONLY! Its interfaces are not public or stable!
|
628
|
-
** This file defines very fast int->upb_value (inttable) and string->upb_value
|
629
|
-
** (strtable) hash tables.
|
630
|
-
**
|
631
|
-
** The table uses chained scatter with Brent's variation (inspired by the Lua
|
632
|
-
** implementation of hash tables). The hash function for strings is Austin
|
633
|
-
** Appleby's "MurmurHash."
|
634
|
-
**
|
635
|
-
** The inttable uses uintptr_t as its key, which guarantees it can be used to
|
636
|
-
** store pointers or integers of at least 32 bits (upb isn't really useful on
|
637
|
-
** systems where sizeof(void*) < 4).
|
638
|
-
**
|
639
|
-
** The table must be homogenous (all values of the same type). In debug
|
640
|
-
** mode, we check this on insert and lookup.
|
641
|
-
*/
|
642
|
-
|
643
|
-
#ifndef UPB_TABLE_H_
|
644
|
-
#define UPB_TABLE_H_
|
645
|
-
|
646
|
-
#include <stdint.h>
|
647
|
-
#include <string.h>
|
490
|
+
#endif /* UPB_H_ */
|
648
491
|
|
649
492
|
|
650
493
|
#ifdef __cplusplus
|
@@ -673,19 +516,8 @@ typedef enum {
|
|
673
516
|
|
674
517
|
typedef struct {
|
675
518
|
uint64_t val;
|
676
|
-
#ifndef NDEBUG
|
677
|
-
/* In debug mode we carry the value type around also so we can check accesses
|
678
|
-
* to be sure the right member is being read. */
|
679
|
-
upb_ctype_t ctype;
|
680
|
-
#endif
|
681
519
|
} upb_value;
|
682
520
|
|
683
|
-
#ifdef NDEBUG
|
684
|
-
#define SET_TYPE(dest, val) UPB_UNUSED(val)
|
685
|
-
#else
|
686
|
-
#define SET_TYPE(dest, val) dest = val
|
687
|
-
#endif
|
688
|
-
|
689
521
|
/* Like strdup(), which isn't always available since it's not ANSI C. */
|
690
522
|
char *upb_strdup(const char *s, upb_alloc *a);
|
691
523
|
/* Variant that works with a length-delimited rather than NULL-delimited string,
|
@@ -696,15 +528,13 @@ UPB_INLINE char *upb_gstrdup(const char *s) {
|
|
696
528
|
return upb_strdup(s, &upb_alloc_global);
|
697
529
|
}
|
698
530
|
|
699
|
-
UPB_INLINE void _upb_value_setval(upb_value *v, uint64_t val
|
700
|
-
upb_ctype_t ctype) {
|
531
|
+
UPB_INLINE void _upb_value_setval(upb_value *v, uint64_t val) {
|
701
532
|
v->val = val;
|
702
|
-
SET_TYPE(v->ctype, ctype);
|
703
533
|
}
|
704
534
|
|
705
|
-
UPB_INLINE upb_value _upb_value_val(uint64_t val
|
535
|
+
UPB_INLINE upb_value _upb_value_val(uint64_t val) {
|
706
536
|
upb_value ret;
|
707
|
-
_upb_value_setval(&ret, val
|
537
|
+
_upb_value_setval(&ret, val);
|
708
538
|
return ret;
|
709
539
|
}
|
710
540
|
|
@@ -719,7 +549,6 @@ UPB_INLINE upb_value _upb_value_val(uint64_t val, upb_ctype_t ctype) {
|
|
719
549
|
#define FUNCS(name, membername, type_t, converter, proto_type) \
|
720
550
|
UPB_INLINE void upb_value_set ## name(upb_value *val, type_t cval) { \
|
721
551
|
val->val = (converter)cval; \
|
722
|
-
SET_TYPE(val->ctype, proto_type); \
|
723
552
|
} \
|
724
553
|
UPB_INLINE upb_value upb_value_ ## name(type_t val) { \
|
725
554
|
upb_value ret; \
|
@@ -727,7 +556,6 @@ UPB_INLINE upb_value _upb_value_val(uint64_t val, upb_ctype_t ctype) {
|
|
727
556
|
return ret; \
|
728
557
|
} \
|
729
558
|
UPB_INLINE type_t upb_value_get ## name(upb_value val) { \
|
730
|
-
UPB_ASSERT_DEBUGVAR(val.ctype == proto_type); \
|
731
559
|
return (type_t)(converter)val.val; \
|
732
560
|
}
|
733
561
|
|
@@ -745,12 +573,10 @@ FUNCS(fptr, fptr, upb_func*, uintptr_t, UPB_CTYPE_FPTR)
|
|
745
573
|
|
746
574
|
UPB_INLINE void upb_value_setfloat(upb_value *val, float cval) {
|
747
575
|
memcpy(&val->val, &cval, sizeof(cval));
|
748
|
-
SET_TYPE(val->ctype, UPB_CTYPE_FLOAT);
|
749
576
|
}
|
750
577
|
|
751
578
|
UPB_INLINE void upb_value_setdouble(upb_value *val, double cval) {
|
752
579
|
memcpy(&val->val, &cval, sizeof(cval));
|
753
|
-
SET_TYPE(val->ctype, UPB_CTYPE_DOUBLE);
|
754
580
|
}
|
755
581
|
|
756
582
|
UPB_INLINE upb_value upb_value_float(float cval) {
|
@@ -794,7 +620,6 @@ typedef struct {
|
|
794
620
|
|
795
621
|
#define UPB_TABVALUE_EMPTY_INIT {-1}
|
796
622
|
|
797
|
-
|
798
623
|
/* upb_table ******************************************************************/
|
799
624
|
|
800
625
|
typedef struct _upb_tabent {
|
@@ -811,7 +636,6 @@ typedef struct _upb_tabent {
|
|
811
636
|
typedef struct {
|
812
637
|
size_t count; /* Number of entries in the hash part. */
|
813
638
|
size_t mask; /* Mask to turn hash value -> bucket. */
|
814
|
-
upb_ctype_t ctype; /* Type of all values. */
|
815
639
|
uint8_t size_lg2; /* Size of the hashtable part is 2^size_lg2 entries. */
|
816
640
|
|
817
641
|
/* Hash table entries.
|
@@ -821,17 +645,6 @@ typedef struct {
|
|
821
645
|
* initialize const hash tables. Then we cast away const when we have to.
|
822
646
|
*/
|
823
647
|
const upb_tabent *entries;
|
824
|
-
|
825
|
-
#ifndef NDEBUG
|
826
|
-
/* This table's allocator. We make the user pass it in to every relevant
|
827
|
-
* function and only use this to check it in debug mode. We do this solely
|
828
|
-
* to keep upb_table as small as possible. This might seem slightly paranoid
|
829
|
-
* but the plan is to use upb_table for all map fields and extension sets in
|
830
|
-
* a forthcoming message representation, so there could be a lot of these.
|
831
|
-
* If this turns out to be too annoying later, we can change it (since this
|
832
|
-
* is an internal-only header file). */
|
833
|
-
upb_alloc *alloc;
|
834
|
-
#endif
|
835
648
|
} upb_table;
|
836
649
|
|
837
650
|
typedef struct {
|
@@ -845,12 +658,6 @@ typedef struct {
|
|
845
658
|
size_t array_count; /* Array part number of elements. */
|
846
659
|
} upb_inttable;
|
847
660
|
|
848
|
-
#define UPB_INTTABLE_INIT(count, mask, ctype, size_lg2, ent, a, asize, acount) \
|
849
|
-
{UPB_TABLE_INIT(count, mask, ctype, size_lg2, ent), a, asize, acount}
|
850
|
-
|
851
|
-
#define UPB_EMPTY_INTTABLE_INIT(ctype) \
|
852
|
-
UPB_INTTABLE_INIT(0, 0, ctype, 0, NULL, NULL, 0, 0)
|
853
|
-
|
854
661
|
#define UPB_ARRAY_EMPTYENT -1
|
855
662
|
|
856
663
|
UPB_INLINE size_t upb_table_size(const upb_table *t) {
|
@@ -919,6 +726,7 @@ upb_inttable *upb_inttable_pack(const upb_inttable *t, void *p, size_t *ofs,
|
|
919
726
|
size_t size);
|
920
727
|
upb_strtable *upb_strtable_pack(const upb_strtable *t, void *p, size_t *ofs,
|
921
728
|
size_t size);
|
729
|
+
void upb_strtable_clear(upb_strtable *t);
|
922
730
|
|
923
731
|
/* Inserts the given key into the hashtable with the given value. The key must
|
924
732
|
* not already exist in the hash table. For string tables, the key must be
|
@@ -1020,7 +828,7 @@ UPB_INLINE bool upb_inttable_lookup32(const upb_inttable *t, uint32_t key,
|
|
1020
828
|
if (key < t->array_size) {
|
1021
829
|
upb_tabval arrval = t->array[key];
|
1022
830
|
if (upb_arrhas(arrval)) {
|
1023
|
-
_upb_value_setval(v, arrval.val
|
831
|
+
_upb_value_setval(v, arrval.val);
|
1024
832
|
return true;
|
1025
833
|
} else {
|
1026
834
|
return false;
|
@@ -1030,7 +838,7 @@ UPB_INLINE bool upb_inttable_lookup32(const upb_inttable *t, uint32_t key,
|
|
1030
838
|
if (t->t.entries == NULL) return false;
|
1031
839
|
for (e = upb_getentry(&t->t, upb_inthash(key)); true; e = e->next) {
|
1032
840
|
if ((uint32_t)e->key == key) {
|
1033
|
-
_upb_value_setval(v, e->val.val
|
841
|
+
_upb_value_setval(v, e->val.val);
|
1034
842
|
return true;
|
1035
843
|
}
|
1036
844
|
if (e->next == NULL) return false;
|
@@ -1084,8 +892,7 @@ typedef struct {
|
|
1084
892
|
void upb_strtable_begin(upb_strtable_iter *i, const upb_strtable *t);
|
1085
893
|
void upb_strtable_next(upb_strtable_iter *i);
|
1086
894
|
bool upb_strtable_done(const upb_strtable_iter *i);
|
1087
|
-
|
1088
|
-
size_t upb_strtable_iter_keylength(const upb_strtable_iter *i);
|
895
|
+
upb_strview upb_strtable_iter_key(const upb_strtable_iter *i);
|
1089
896
|
upb_value upb_strtable_iter_value(const upb_strtable_iter *i);
|
1090
897
|
void upb_strtable_iter_setdone(upb_strtable_iter *i);
|
1091
898
|
bool upb_strtable_iter_isequal(const upb_strtable_iter *i1,
|
@@ -1109,6 +916,10 @@ typedef struct {
|
|
1109
916
|
bool array_part;
|
1110
917
|
} upb_inttable_iter;
|
1111
918
|
|
919
|
+
UPB_INLINE const upb_tabent *str_tabent(const upb_strtable_iter *i) {
|
920
|
+
return &i->t->t.entries[i->index];
|
921
|
+
}
|
922
|
+
|
1112
923
|
void upb_inttable_begin(upb_inttable_iter *i, const upb_inttable *t);
|
1113
924
|
void upb_inttable_next(upb_inttable_iter *i);
|
1114
925
|
bool upb_inttable_done(const upb_inttable_iter *i);
|
@@ -1125,36 +936,140 @@ bool upb_inttable_iter_isequal(const upb_inttable_iter *i1,
|
|
1125
936
|
|
1126
937
|
|
1127
938
|
#endif /* UPB_TABLE_H_ */
|
1128
|
-
/* This file was generated by upbc (the upb compiler) from the input
|
1129
|
-
* file:
|
1130
|
-
*
|
1131
|
-
* google/protobuf/descriptor.proto
|
1132
|
-
*
|
1133
|
-
* Do not edit -- your changes will be discarded when the file is
|
1134
|
-
* regenerated. */
|
1135
939
|
|
1136
|
-
#ifndef GOOGLE_PROTOBUF_DESCRIPTOR_PROTO_UPB_H_
|
1137
|
-
#define GOOGLE_PROTOBUF_DESCRIPTOR_PROTO_UPB_H_
|
1138
940
|
|
1139
|
-
|
1140
|
-
|
1141
|
-
|
1142
|
-
*/
|
941
|
+
#ifdef __cplusplus
|
942
|
+
extern "C" {
|
943
|
+
#endif
|
1143
944
|
|
1144
|
-
#
|
1145
|
-
#define UPB_GENERATED_UTIL_H_
|
945
|
+
#define PTR_AT(msg, ofs, type) (type*)((const char*)msg + ofs)
|
1146
946
|
|
1147
|
-
|
947
|
+
typedef void upb_msg;
|
1148
948
|
|
949
|
+
/** upb_msglayout *************************************************************/
|
1149
950
|
|
1150
|
-
|
951
|
+
/* upb_msglayout represents the memory layout of a given upb_msgdef. The
|
952
|
+
* members are public so generated code can initialize them, but users MUST NOT
|
953
|
+
* read or write any of its members. */
|
954
|
+
|
955
|
+
/* These aren't real labels according to descriptor.proto, but in the table we
|
956
|
+
* use these for map/packed fields instead of UPB_LABEL_REPEATED. */
|
957
|
+
enum {
|
958
|
+
_UPB_LABEL_MAP = 4,
|
959
|
+
_UPB_LABEL_PACKED = 7 /* Low 3 bits are common with UPB_LABEL_REPEATED. */
|
960
|
+
};
|
961
|
+
|
962
|
+
typedef struct {
|
963
|
+
uint32_t number;
|
964
|
+
uint16_t offset;
|
965
|
+
int16_t presence; /* If >0, hasbit_index. If <0, -oneof_index. */
|
966
|
+
uint16_t submsg_index; /* undefined if descriptortype != MESSAGE or GROUP. */
|
967
|
+
uint8_t descriptortype;
|
968
|
+
uint8_t label;
|
969
|
+
} upb_msglayout_field;
|
970
|
+
|
971
|
+
typedef struct upb_msglayout {
|
972
|
+
const struct upb_msglayout *const* submsgs;
|
973
|
+
const upb_msglayout_field *fields;
|
974
|
+
/* Must be aligned to sizeof(void*). Doesn't include internal members like
|
975
|
+
* unknown fields, extension dict, pointer to msglayout, etc. */
|
976
|
+
uint16_t size;
|
977
|
+
uint16_t field_count;
|
978
|
+
bool extendable;
|
979
|
+
} upb_msglayout;
|
980
|
+
|
981
|
+
/** upb_msg *******************************************************************/
|
982
|
+
|
983
|
+
/* Internal members of a upb_msg. We can change this without breaking binary
|
984
|
+
* compatibility. We put these before the user's data. The user's upb_msg*
|
985
|
+
* points after the upb_msg_internal. */
|
986
|
+
|
987
|
+
/* Used when a message is not extendable. */
|
988
|
+
typedef struct {
|
989
|
+
char *unknown;
|
990
|
+
size_t unknown_len;
|
991
|
+
size_t unknown_size;
|
992
|
+
} upb_msg_internal;
|
993
|
+
|
994
|
+
/* Used when a message is extendable. */
|
995
|
+
typedef struct {
|
996
|
+
upb_inttable *extdict;
|
997
|
+
upb_msg_internal base;
|
998
|
+
} upb_msg_internal_withext;
|
999
|
+
|
1000
|
+
/* Maps upb_fieldtype_t -> memory size. */
|
1001
|
+
extern char _upb_fieldtype_to_size[12];
|
1002
|
+
|
1003
|
+
/* Creates a new messages with the given layout on the given arena. */
|
1004
|
+
upb_msg *_upb_msg_new(const upb_msglayout *l, upb_arena *a);
|
1005
|
+
|
1006
|
+
/* Adds unknown data (serialized protobuf data) to the given message. The data
|
1007
|
+
* is copied into the message instance. */
|
1008
|
+
bool _upb_msg_addunknown(upb_msg *msg, const char *data, size_t len,
|
1009
|
+
upb_arena *arena);
|
1010
|
+
|
1011
|
+
/* Returns a reference to the message's unknown data. */
|
1012
|
+
const char *upb_msg_getunknown(const upb_msg *msg, size_t *len);
|
1013
|
+
|
1014
|
+
UPB_INLINE bool _upb_has_field(const void *msg, size_t idx) {
|
1015
|
+
return (*PTR_AT(msg, idx / 8, const char) & (1 << (idx % 8))) != 0;
|
1016
|
+
}
|
1017
|
+
|
1018
|
+
UPB_INLINE bool _upb_sethas(const void *msg, size_t idx) {
|
1019
|
+
return (*PTR_AT(msg, idx / 8, char)) |= (char)(1 << (idx % 8));
|
1020
|
+
}
|
1021
|
+
|
1022
|
+
UPB_INLINE bool _upb_clearhas(const void *msg, size_t idx) {
|
1023
|
+
return (*PTR_AT(msg, idx / 8, char)) &= (char)(~(1 << (idx % 8)));
|
1024
|
+
}
|
1025
|
+
|
1026
|
+
UPB_INLINE bool _upb_has_oneof_field(const void *msg, size_t case_ofs, int32_t num) {
|
1027
|
+
return *PTR_AT(msg, case_ofs, int32_t) == num;
|
1028
|
+
}
|
1029
|
+
|
1030
|
+
UPB_INLINE bool _upb_has_submsg_nohasbit(const void *msg, size_t ofs) {
|
1031
|
+
return *PTR_AT(msg, ofs, const void*) != NULL;
|
1032
|
+
}
|
1033
|
+
|
1034
|
+
UPB_INLINE bool _upb_isrepeated(const upb_msglayout_field *field) {
|
1035
|
+
return (field->label & 3) == UPB_LABEL_REPEATED;
|
1036
|
+
}
|
1037
|
+
|
1038
|
+
/** upb_array *****************************************************************/
|
1039
|
+
|
1040
|
+
/* Our internal representation for repeated fields. */
|
1041
|
+
typedef struct {
|
1042
|
+
uintptr_t data; /* Tagged ptr: low 3 bits of ptr are lg2(elem size). */
|
1043
|
+
size_t len; /* Measured in elements. */
|
1044
|
+
size_t size; /* Measured in elements. */
|
1045
|
+
} upb_array;
|
1046
|
+
|
1047
|
+
UPB_INLINE const void *_upb_array_constptr(const upb_array *arr) {
|
1048
|
+
return (void*)(arr->data & ~(uintptr_t)7);
|
1049
|
+
}
|
1050
|
+
|
1051
|
+
UPB_INLINE void *_upb_array_ptr(upb_array *arr) {
|
1052
|
+
return (void*)_upb_array_constptr(arr);
|
1053
|
+
}
|
1054
|
+
|
1055
|
+
/* Creates a new array on the given arena. */
|
1056
|
+
upb_array *_upb_array_new(upb_arena *a, upb_fieldtype_t type);
|
1057
|
+
|
1058
|
+
/* Resizes the capacity of the array to be at least min_size. */
|
1059
|
+
bool _upb_array_realloc(upb_array *arr, size_t min_size, upb_arena *arena);
|
1060
|
+
|
1061
|
+
/* Fallback functions for when the accessors require a resize. */
|
1062
|
+
void *_upb_array_resize_fallback(upb_array **arr_ptr, size_t size,
|
1063
|
+
upb_fieldtype_t type, upb_arena *arena);
|
1064
|
+
bool _upb_array_append_fallback(upb_array **arr_ptr, const void *value,
|
1065
|
+
upb_fieldtype_t type, upb_arena *arena);
|
1151
1066
|
|
1152
1067
|
UPB_INLINE const void *_upb_array_accessor(const void *msg, size_t ofs,
|
1153
1068
|
size_t *size) {
|
1154
1069
|
const upb_array *arr = *PTR_AT(msg, ofs, const upb_array*);
|
1155
1070
|
if (arr) {
|
1156
1071
|
if (size) *size = arr->len;
|
1157
|
-
return arr
|
1072
|
+
return _upb_array_constptr(arr);
|
1158
1073
|
} else {
|
1159
1074
|
if (size) *size = 0;
|
1160
1075
|
return NULL;
|
@@ -1166,78 +1081,295 @@ UPB_INLINE void *_upb_array_mutable_accessor(void *msg, size_t ofs,
|
|
1166
1081
|
upb_array *arr = *PTR_AT(msg, ofs, upb_array*);
|
1167
1082
|
if (arr) {
|
1168
1083
|
if (size) *size = arr->len;
|
1169
|
-
return arr
|
1084
|
+
return _upb_array_ptr(arr);
|
1170
1085
|
} else {
|
1171
1086
|
if (size) *size = 0;
|
1172
1087
|
return NULL;
|
1173
1088
|
}
|
1174
1089
|
}
|
1175
1090
|
|
1176
|
-
/* TODO(haberman): this is a mess. It will improve when upb_array no longer
|
1177
|
-
* carries reflective state (type, elem_size). */
|
1178
1091
|
UPB_INLINE void *_upb_array_resize_accessor(void *msg, size_t ofs, size_t size,
|
1179
|
-
size_t elem_size,
|
1180
1092
|
upb_fieldtype_t type,
|
1181
1093
|
upb_arena *arena) {
|
1182
|
-
upb_array
|
1183
|
-
|
1184
|
-
if (!arr) {
|
1185
|
-
|
1186
|
-
if (!arr) return NULL;
|
1187
|
-
*PTR_AT(msg, ofs, upb_array*) = arr;
|
1188
|
-
}
|
1189
|
-
|
1190
|
-
if (size > arr->size) {
|
1191
|
-
size_t new_size = UPB_MAX(arr->size, 4);
|
1192
|
-
size_t old_bytes = arr->size * elem_size;
|
1193
|
-
size_t new_bytes;
|
1194
|
-
while (new_size < size) new_size *= 2;
|
1195
|
-
new_bytes = new_size * elem_size;
|
1196
|
-
arr->data = upb_arena_realloc(arena, arr->data, old_bytes, new_bytes);
|
1197
|
-
if (!arr->data) {
|
1198
|
-
return NULL;
|
1199
|
-
}
|
1200
|
-
arr->size = new_size;
|
1094
|
+
upb_array **arr_ptr = PTR_AT(msg, ofs, upb_array*);
|
1095
|
+
upb_array *arr = *arr_ptr;
|
1096
|
+
if (!arr || arr->size < size) {
|
1097
|
+
return _upb_array_resize_fallback(arr_ptr, size, type, arena);
|
1201
1098
|
}
|
1202
|
-
|
1203
1099
|
arr->len = size;
|
1204
|
-
return arr
|
1100
|
+
return _upb_array_ptr(arr);
|
1205
1101
|
}
|
1206
1102
|
|
1103
|
+
|
1207
1104
|
UPB_INLINE bool _upb_array_append_accessor(void *msg, size_t ofs,
|
1208
1105
|
size_t elem_size,
|
1209
1106
|
upb_fieldtype_t type,
|
1210
1107
|
const void *value,
|
1211
1108
|
upb_arena *arena) {
|
1212
|
-
upb_array
|
1213
|
-
|
1214
|
-
void
|
1215
|
-
|
1216
|
-
|
1217
|
-
|
1109
|
+
upb_array **arr_ptr = PTR_AT(msg, ofs, upb_array*);
|
1110
|
+
upb_array *arr = *arr_ptr;
|
1111
|
+
void* ptr;
|
1112
|
+
if (!arr || arr->len == arr->size) {
|
1113
|
+
return _upb_array_append_fallback(arr_ptr, value, type, arena);
|
1114
|
+
}
|
1115
|
+
ptr = _upb_array_ptr(arr);
|
1116
|
+
memcpy(PTR_AT(ptr, arr->len * elem_size, char), value, elem_size);
|
1117
|
+
arr->len++;
|
1218
1118
|
return true;
|
1219
1119
|
}
|
1220
1120
|
|
1221
|
-
|
1222
|
-
|
1121
|
+
/** upb_map *******************************************************************/
|
1122
|
+
|
1123
|
+
/* Right now we use strmaps for everything. We'll likely want to use
|
1124
|
+
* integer-specific maps for integer-keyed maps.*/
|
1125
|
+
typedef struct {
|
1126
|
+
/* Size of key and val, based on the map type. Strings are represented as '0'
|
1127
|
+
* because they must be handled specially. */
|
1128
|
+
char key_size;
|
1129
|
+
char val_size;
|
1130
|
+
|
1131
|
+
upb_strtable table;
|
1132
|
+
} upb_map;
|
1133
|
+
|
1134
|
+
/* Map entries aren't actually stored, they are only used during parsing. For
|
1135
|
+
* parsing, it helps a lot if all map entry messages have the same layout.
|
1136
|
+
* The compiler and def.c must ensure that all map entries have this layout. */
|
1137
|
+
typedef struct {
|
1138
|
+
upb_msg_internal internal;
|
1139
|
+
union {
|
1140
|
+
upb_strview str; /* For str/bytes. */
|
1141
|
+
upb_value val; /* For all other types. */
|
1142
|
+
} k;
|
1143
|
+
union {
|
1144
|
+
upb_strview str; /* For str/bytes. */
|
1145
|
+
upb_value val; /* For all other types. */
|
1146
|
+
} v;
|
1147
|
+
} upb_map_entry;
|
1148
|
+
|
1149
|
+
/* Creates a new map on the given arena with this key/value type. */
|
1150
|
+
upb_map *_upb_map_new(upb_arena *a, size_t key_size, size_t value_size);
|
1151
|
+
|
1152
|
+
/* Converting between internal table representation and user values.
|
1153
|
+
*
|
1154
|
+
* _upb_map_tokey() and _upb_map_fromkey() are inverses.
|
1155
|
+
* _upb_map_tovalue() and _upb_map_fromvalue() are inverses.
|
1156
|
+
*
|
1157
|
+
* These functions account for the fact that strings are treated differently
|
1158
|
+
* from other types when stored in a map.
|
1159
|
+
*/
|
1160
|
+
|
1161
|
+
UPB_INLINE upb_strview _upb_map_tokey(const void *key, size_t size) {
|
1162
|
+
if (size == UPB_MAPTYPE_STRING) {
|
1163
|
+
return *(upb_strview*)key;
|
1164
|
+
} else {
|
1165
|
+
return upb_strview_make((const char*)key, size);
|
1166
|
+
}
|
1223
1167
|
}
|
1224
1168
|
|
1225
|
-
UPB_INLINE
|
1226
|
-
|
1169
|
+
UPB_INLINE void _upb_map_fromkey(upb_strview key, void* out, size_t size) {
|
1170
|
+
if (size == UPB_MAPTYPE_STRING) {
|
1171
|
+
memcpy(out, &key, sizeof(key));
|
1172
|
+
} else {
|
1173
|
+
memcpy(out, key.data, size);
|
1174
|
+
}
|
1227
1175
|
}
|
1228
1176
|
|
1229
|
-
UPB_INLINE
|
1230
|
-
|
1177
|
+
UPB_INLINE upb_value _upb_map_tovalue(const void *val, size_t size,
|
1178
|
+
upb_arena *a) {
|
1179
|
+
upb_value ret = {0};
|
1180
|
+
if (size == UPB_MAPTYPE_STRING) {
|
1181
|
+
upb_strview *strp = (upb_strview*)upb_arena_malloc(a, sizeof(*strp));
|
1182
|
+
*strp = *(upb_strview*)val;
|
1183
|
+
memcpy(&ret, &strp, sizeof(strp));
|
1184
|
+
} else {
|
1185
|
+
memcpy(&ret, val, size);
|
1186
|
+
}
|
1187
|
+
return ret;
|
1231
1188
|
}
|
1232
1189
|
|
1233
|
-
UPB_INLINE
|
1234
|
-
|
1190
|
+
UPB_INLINE void _upb_map_fromvalue(upb_value val, void* out, size_t size) {
|
1191
|
+
if (size == UPB_MAPTYPE_STRING) {
|
1192
|
+
const upb_strview *strp = (const upb_strview*)upb_value_getptr(val);
|
1193
|
+
memcpy(out, strp, sizeof(upb_strview));
|
1194
|
+
} else {
|
1195
|
+
memcpy(out, &val, size);
|
1196
|
+
}
|
1197
|
+
}
|
1198
|
+
|
1199
|
+
/* Map operations, shared by reflection and generated code. */
|
1200
|
+
|
1201
|
+
UPB_INLINE size_t _upb_map_size(const upb_map *map) {
|
1202
|
+
return map->table.t.count;
|
1203
|
+
}
|
1204
|
+
|
1205
|
+
UPB_INLINE bool _upb_map_get(const upb_map *map, const void *key,
|
1206
|
+
size_t key_size, void *val, size_t val_size) {
|
1207
|
+
upb_value tabval;
|
1208
|
+
upb_strview k = _upb_map_tokey(key, key_size);
|
1209
|
+
bool ret = upb_strtable_lookup2(&map->table, k.data, k.size, &tabval);
|
1210
|
+
if (ret) {
|
1211
|
+
_upb_map_fromvalue(tabval, val, val_size);
|
1212
|
+
}
|
1213
|
+
return ret;
|
1214
|
+
}
|
1215
|
+
|
1216
|
+
UPB_INLINE void* _upb_map_next(const upb_map *map, size_t *iter) {
|
1217
|
+
upb_strtable_iter it;
|
1218
|
+
it.t = &map->table;
|
1219
|
+
it.index = *iter;
|
1220
|
+
upb_strtable_next(&it);
|
1221
|
+
if (upb_strtable_done(&it)) return NULL;
|
1222
|
+
*iter = it.index;
|
1223
|
+
return (void*)str_tabent(&it);
|
1224
|
+
}
|
1225
|
+
|
1226
|
+
UPB_INLINE bool _upb_map_set(upb_map *map, const void *key, size_t key_size,
|
1227
|
+
void *val, size_t val_size, upb_arena *arena) {
|
1228
|
+
upb_strview strkey = _upb_map_tokey(key, key_size);
|
1229
|
+
upb_value tabval = _upb_map_tovalue(val, val_size, arena);
|
1230
|
+
upb_alloc *a = upb_arena_alloc(arena);
|
1231
|
+
|
1232
|
+
/* TODO(haberman): add overwrite operation to minimize number of lookups. */
|
1233
|
+
upb_strtable_remove3(&map->table, strkey.data, strkey.size, NULL, a);
|
1234
|
+
return upb_strtable_insert3(&map->table, strkey.data, strkey.size, tabval, a);
|
1235
|
+
}
|
1236
|
+
|
1237
|
+
UPB_INLINE bool _upb_map_delete(upb_map *map, const void *key, size_t key_size) {
|
1238
|
+
upb_strview k = _upb_map_tokey(key, key_size);
|
1239
|
+
return upb_strtable_remove3(&map->table, k.data, k.size, NULL, NULL);
|
1240
|
+
}
|
1241
|
+
|
1242
|
+
UPB_INLINE void _upb_map_clear(upb_map *map) {
|
1243
|
+
upb_strtable_clear(&map->table);
|
1244
|
+
}
|
1245
|
+
|
1246
|
+
/* Message map operations, these get the map from the message first. */
|
1247
|
+
|
1248
|
+
UPB_INLINE size_t _upb_msg_map_size(const upb_msg *msg, size_t ofs) {
|
1249
|
+
upb_map *map = *UPB_PTR_AT(msg, ofs, upb_map *);
|
1250
|
+
return map ? _upb_map_size(map) : 0;
|
1251
|
+
}
|
1252
|
+
|
1253
|
+
UPB_INLINE bool _upb_msg_map_get(const upb_msg *msg, size_t ofs,
|
1254
|
+
const void *key, size_t key_size, void *val,
|
1255
|
+
size_t val_size) {
|
1256
|
+
upb_map *map = *UPB_PTR_AT(msg, ofs, upb_map *);
|
1257
|
+
if (!map) return false;
|
1258
|
+
return _upb_map_get(map, key, key_size, val, val_size);
|
1259
|
+
}
|
1260
|
+
|
1261
|
+
UPB_INLINE void *_upb_msg_map_next(const upb_msg *msg, size_t ofs,
|
1262
|
+
size_t *iter) {
|
1263
|
+
upb_map *map = *UPB_PTR_AT(msg, ofs, upb_map *);
|
1264
|
+
if (!map) return NULL;
|
1265
|
+
return _upb_map_next(map, iter);
|
1266
|
+
}
|
1267
|
+
|
1268
|
+
UPB_INLINE bool _upb_msg_map_set(upb_msg *msg, size_t ofs, const void *key,
|
1269
|
+
size_t key_size, void *val, size_t val_size,
|
1270
|
+
upb_arena *arena) {
|
1271
|
+
upb_map **map = PTR_AT(msg, ofs, upb_map *);
|
1272
|
+
if (!*map) {
|
1273
|
+
*map = _upb_map_new(arena, key_size, val_size);
|
1274
|
+
}
|
1275
|
+
return _upb_map_set(*map, key, key_size, val, val_size, arena);
|
1276
|
+
}
|
1277
|
+
|
1278
|
+
UPB_INLINE bool _upb_msg_map_delete(upb_msg *msg, size_t ofs, const void *key,
|
1279
|
+
size_t key_size) {
|
1280
|
+
upb_map *map = *UPB_PTR_AT(msg, ofs, upb_map *);
|
1281
|
+
if (!map) return false;
|
1282
|
+
return _upb_map_delete(map, key, key_size);
|
1283
|
+
}
|
1284
|
+
|
1285
|
+
UPB_INLINE void _upb_msg_map_clear(upb_msg *msg, size_t ofs) {
|
1286
|
+
upb_map *map = *UPB_PTR_AT(msg, ofs, upb_map *);
|
1287
|
+
if (!map) return;
|
1288
|
+
_upb_map_clear(map);
|
1289
|
+
}
|
1290
|
+
|
1291
|
+
/* Accessing map key/value from a pointer, used by generated code only. */
|
1292
|
+
|
1293
|
+
UPB_INLINE void _upb_msg_map_key(const void* msg, void* key, size_t size) {
|
1294
|
+
const upb_tabent *ent = (const upb_tabent*)msg;
|
1295
|
+
uint32_t u32len;
|
1296
|
+
upb_strview k;
|
1297
|
+
k.data = upb_tabstr(ent->key, &u32len);
|
1298
|
+
k.size = u32len;
|
1299
|
+
_upb_map_fromkey(k, key, size);
|
1300
|
+
}
|
1301
|
+
|
1302
|
+
UPB_INLINE void _upb_msg_map_value(const void* msg, void* val, size_t size) {
|
1303
|
+
const upb_tabent *ent = (const upb_tabent*)msg;
|
1304
|
+
upb_value v;
|
1305
|
+
_upb_value_setval(&v, ent->val.val);
|
1306
|
+
_upb_map_fromvalue(v, val, size);
|
1307
|
+
}
|
1308
|
+
|
1309
|
+
UPB_INLINE void _upb_msg_map_set_value(void* msg, const void* val, size_t size) {
|
1310
|
+
upb_tabent *ent = (upb_tabent*)msg;
|
1311
|
+
/* This is like _upb_map_tovalue() except the entry already exists so we can
|
1312
|
+
* reuse the allocated upb_strview for string fields. */
|
1313
|
+
if (size == UPB_MAPTYPE_STRING) {
|
1314
|
+
upb_strview *strp = (upb_strview*)ent->val.val;
|
1315
|
+
memcpy(strp, val, sizeof(*strp));
|
1316
|
+
} else {
|
1317
|
+
memcpy(&ent->val.val, val, size);
|
1318
|
+
}
|
1235
1319
|
}
|
1236
1320
|
|
1237
1321
|
#undef PTR_AT
|
1238
1322
|
|
1323
|
+
#ifdef __cplusplus
|
1324
|
+
} /* extern "C" */
|
1325
|
+
#endif
|
1326
|
+
|
1327
|
+
|
1328
|
+
#endif /* UPB_MSG_H_ */
|
1329
|
+
|
1330
|
+
#ifdef __cplusplus
|
1331
|
+
extern "C" {
|
1332
|
+
#endif
|
1333
|
+
|
1334
|
+
bool upb_decode(const char *buf, size_t size, upb_msg *msg,
|
1335
|
+
const upb_msglayout *l, upb_arena *arena);
|
1336
|
+
|
1337
|
+
#ifdef __cplusplus
|
1338
|
+
} /* extern "C" */
|
1339
|
+
#endif
|
1340
|
+
|
1341
|
+
#endif /* UPB_DECODE_H_ */
|
1342
|
+
/*
|
1343
|
+
** upb_encode: parsing into a upb_msg using a upb_msglayout.
|
1344
|
+
*/
|
1345
|
+
|
1346
|
+
#ifndef UPB_ENCODE_H_
|
1347
|
+
#define UPB_ENCODE_H_
|
1348
|
+
|
1349
|
+
|
1350
|
+
#ifdef __cplusplus
|
1351
|
+
extern "C" {
|
1352
|
+
#endif
|
1353
|
+
|
1354
|
+
char *upb_encode(const void *msg, const upb_msglayout *l, upb_arena *arena,
|
1355
|
+
size_t *size);
|
1356
|
+
|
1357
|
+
#ifdef __cplusplus
|
1358
|
+
} /* extern "C" */
|
1359
|
+
#endif
|
1360
|
+
|
1361
|
+
#endif /* UPB_ENCODE_H_ */
|
1362
|
+
/* This file was generated by upbc (the upb compiler) from the input
|
1363
|
+
* file:
|
1364
|
+
*
|
1365
|
+
* google/protobuf/descriptor.proto
|
1366
|
+
*
|
1367
|
+
* Do not edit -- your changes will be discarded when the file is
|
1368
|
+
* regenerated. */
|
1369
|
+
|
1370
|
+
#ifndef GOOGLE_PROTOBUF_DESCRIPTOR_PROTO_UPB_H_
|
1371
|
+
#define GOOGLE_PROTOBUF_DESCRIPTOR_PROTO_UPB_H_
|
1239
1372
|
|
1240
|
-
#endif /* UPB_GENERATED_UTIL_H_ */
|
1241
1373
|
|
1242
1374
|
|
1243
1375
|
#ifdef __cplusplus
|
@@ -1381,7 +1513,7 @@ typedef enum {
|
|
1381
1513
|
/* google.protobuf.FileDescriptorSet */
|
1382
1514
|
|
1383
1515
|
UPB_INLINE google_protobuf_FileDescriptorSet *google_protobuf_FileDescriptorSet_new(upb_arena *arena) {
|
1384
|
-
return (google_protobuf_FileDescriptorSet *)
|
1516
|
+
return (google_protobuf_FileDescriptorSet *)_upb_msg_new(&google_protobuf_FileDescriptorSet_msginit, arena);
|
1385
1517
|
}
|
1386
1518
|
UPB_INLINE google_protobuf_FileDescriptorSet *google_protobuf_FileDescriptorSet_parse(const char *buf, size_t size,
|
1387
1519
|
upb_arena *arena) {
|
@@ -1392,16 +1524,17 @@ UPB_INLINE char *google_protobuf_FileDescriptorSet_serialize(const google_protob
|
|
1392
1524
|
return upb_encode(msg, &google_protobuf_FileDescriptorSet_msginit, arena, len);
|
1393
1525
|
}
|
1394
1526
|
|
1527
|
+
UPB_INLINE bool google_protobuf_FileDescriptorSet_has_file(const google_protobuf_FileDescriptorSet *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(0, 0)); }
|
1395
1528
|
UPB_INLINE const google_protobuf_FileDescriptorProto* const* google_protobuf_FileDescriptorSet_file(const google_protobuf_FileDescriptorSet *msg, size_t *len) { return (const google_protobuf_FileDescriptorProto* const*)_upb_array_accessor(msg, UPB_SIZE(0, 0), len); }
|
1396
1529
|
|
1397
1530
|
UPB_INLINE google_protobuf_FileDescriptorProto** google_protobuf_FileDescriptorSet_mutable_file(google_protobuf_FileDescriptorSet *msg, size_t *len) {
|
1398
1531
|
return (google_protobuf_FileDescriptorProto**)_upb_array_mutable_accessor(msg, UPB_SIZE(0, 0), len);
|
1399
1532
|
}
|
1400
1533
|
UPB_INLINE google_protobuf_FileDescriptorProto** google_protobuf_FileDescriptorSet_resize_file(google_protobuf_FileDescriptorSet *msg, size_t len, upb_arena *arena) {
|
1401
|
-
return (google_protobuf_FileDescriptorProto**)_upb_array_resize_accessor(msg, UPB_SIZE(0, 0), len,
|
1534
|
+
return (google_protobuf_FileDescriptorProto**)_upb_array_resize_accessor(msg, UPB_SIZE(0, 0), len, UPB_TYPE_MESSAGE, arena);
|
1402
1535
|
}
|
1403
1536
|
UPB_INLINE struct google_protobuf_FileDescriptorProto* google_protobuf_FileDescriptorSet_add_file(google_protobuf_FileDescriptorSet *msg, upb_arena *arena) {
|
1404
|
-
struct google_protobuf_FileDescriptorProto* sub = (struct google_protobuf_FileDescriptorProto*)
|
1537
|
+
struct google_protobuf_FileDescriptorProto* sub = (struct google_protobuf_FileDescriptorProto*)_upb_msg_new(&google_protobuf_FileDescriptorProto_msginit, arena);
|
1405
1538
|
bool ok = _upb_array_append_accessor(
|
1406
1539
|
msg, UPB_SIZE(0, 0), UPB_SIZE(4, 8), UPB_TYPE_MESSAGE, &sub, arena);
|
1407
1540
|
if (!ok) return NULL;
|
@@ -1411,7 +1544,7 @@ UPB_INLINE struct google_protobuf_FileDescriptorProto* google_protobuf_FileDescr
|
|
1411
1544
|
/* google.protobuf.FileDescriptorProto */
|
1412
1545
|
|
1413
1546
|
UPB_INLINE google_protobuf_FileDescriptorProto *google_protobuf_FileDescriptorProto_new(upb_arena *arena) {
|
1414
|
-
return (google_protobuf_FileDescriptorProto *)
|
1547
|
+
return (google_protobuf_FileDescriptorProto *)_upb_msg_new(&google_protobuf_FileDescriptorProto_msginit, arena);
|
1415
1548
|
}
|
1416
1549
|
UPB_INLINE google_protobuf_FileDescriptorProto *google_protobuf_FileDescriptorProto_parse(const char *buf, size_t size,
|
1417
1550
|
upb_arena *arena) {
|
@@ -1423,49 +1556,53 @@ UPB_INLINE char *google_protobuf_FileDescriptorProto_serialize(const google_prot
|
|
1423
1556
|
}
|
1424
1557
|
|
1425
1558
|
UPB_INLINE bool google_protobuf_FileDescriptorProto_has_name(const google_protobuf_FileDescriptorProto *msg) { return _upb_has_field(msg, 1); }
|
1426
|
-
UPB_INLINE upb_strview google_protobuf_FileDescriptorProto_name(const google_protobuf_FileDescriptorProto *msg) { return
|
1559
|
+
UPB_INLINE upb_strview google_protobuf_FileDescriptorProto_name(const google_protobuf_FileDescriptorProto *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_strview); }
|
1427
1560
|
UPB_INLINE bool google_protobuf_FileDescriptorProto_has_package(const google_protobuf_FileDescriptorProto *msg) { return _upb_has_field(msg, 2); }
|
1428
|
-
UPB_INLINE upb_strview google_protobuf_FileDescriptorProto_package(const google_protobuf_FileDescriptorProto *msg) { return
|
1561
|
+
UPB_INLINE upb_strview google_protobuf_FileDescriptorProto_package(const google_protobuf_FileDescriptorProto *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(12, 24), upb_strview); }
|
1429
1562
|
UPB_INLINE upb_strview const* google_protobuf_FileDescriptorProto_dependency(const google_protobuf_FileDescriptorProto *msg, size_t *len) { return (upb_strview const*)_upb_array_accessor(msg, UPB_SIZE(36, 72), len); }
|
1563
|
+
UPB_INLINE bool google_protobuf_FileDescriptorProto_has_message_type(const google_protobuf_FileDescriptorProto *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(40, 80)); }
|
1430
1564
|
UPB_INLINE const google_protobuf_DescriptorProto* const* google_protobuf_FileDescriptorProto_message_type(const google_protobuf_FileDescriptorProto *msg, size_t *len) { return (const google_protobuf_DescriptorProto* const*)_upb_array_accessor(msg, UPB_SIZE(40, 80), len); }
|
1565
|
+
UPB_INLINE bool google_protobuf_FileDescriptorProto_has_enum_type(const google_protobuf_FileDescriptorProto *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(44, 88)); }
|
1431
1566
|
UPB_INLINE const google_protobuf_EnumDescriptorProto* const* google_protobuf_FileDescriptorProto_enum_type(const google_protobuf_FileDescriptorProto *msg, size_t *len) { return (const google_protobuf_EnumDescriptorProto* const*)_upb_array_accessor(msg, UPB_SIZE(44, 88), len); }
|
1567
|
+
UPB_INLINE bool google_protobuf_FileDescriptorProto_has_service(const google_protobuf_FileDescriptorProto *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(48, 96)); }
|
1432
1568
|
UPB_INLINE const google_protobuf_ServiceDescriptorProto* const* google_protobuf_FileDescriptorProto_service(const google_protobuf_FileDescriptorProto *msg, size_t *len) { return (const google_protobuf_ServiceDescriptorProto* const*)_upb_array_accessor(msg, UPB_SIZE(48, 96), len); }
|
1569
|
+
UPB_INLINE bool google_protobuf_FileDescriptorProto_has_extension(const google_protobuf_FileDescriptorProto *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(52, 104)); }
|
1433
1570
|
UPB_INLINE const google_protobuf_FieldDescriptorProto* const* google_protobuf_FileDescriptorProto_extension(const google_protobuf_FileDescriptorProto *msg, size_t *len) { return (const google_protobuf_FieldDescriptorProto* const*)_upb_array_accessor(msg, UPB_SIZE(52, 104), len); }
|
1434
1571
|
UPB_INLINE bool google_protobuf_FileDescriptorProto_has_options(const google_protobuf_FileDescriptorProto *msg) { return _upb_has_field(msg, 4); }
|
1435
|
-
UPB_INLINE const google_protobuf_FileOptions* google_protobuf_FileDescriptorProto_options(const google_protobuf_FileDescriptorProto *msg) { return
|
1572
|
+
UPB_INLINE const google_protobuf_FileOptions* google_protobuf_FileDescriptorProto_options(const google_protobuf_FileDescriptorProto *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(28, 56), const google_protobuf_FileOptions*); }
|
1436
1573
|
UPB_INLINE bool google_protobuf_FileDescriptorProto_has_source_code_info(const google_protobuf_FileDescriptorProto *msg) { return _upb_has_field(msg, 5); }
|
1437
|
-
UPB_INLINE const google_protobuf_SourceCodeInfo* google_protobuf_FileDescriptorProto_source_code_info(const google_protobuf_FileDescriptorProto *msg) { return
|
1574
|
+
UPB_INLINE const google_protobuf_SourceCodeInfo* google_protobuf_FileDescriptorProto_source_code_info(const google_protobuf_FileDescriptorProto *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(32, 64), const google_protobuf_SourceCodeInfo*); }
|
1438
1575
|
UPB_INLINE int32_t const* google_protobuf_FileDescriptorProto_public_dependency(const google_protobuf_FileDescriptorProto *msg, size_t *len) { return (int32_t const*)_upb_array_accessor(msg, UPB_SIZE(56, 112), len); }
|
1439
1576
|
UPB_INLINE int32_t const* google_protobuf_FileDescriptorProto_weak_dependency(const google_protobuf_FileDescriptorProto *msg, size_t *len) { return (int32_t const*)_upb_array_accessor(msg, UPB_SIZE(60, 120), len); }
|
1440
1577
|
UPB_INLINE bool google_protobuf_FileDescriptorProto_has_syntax(const google_protobuf_FileDescriptorProto *msg) { return _upb_has_field(msg, 3); }
|
1441
|
-
UPB_INLINE upb_strview google_protobuf_FileDescriptorProto_syntax(const google_protobuf_FileDescriptorProto *msg) { return
|
1578
|
+
UPB_INLINE upb_strview google_protobuf_FileDescriptorProto_syntax(const google_protobuf_FileDescriptorProto *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(20, 40), upb_strview); }
|
1442
1579
|
|
1443
1580
|
UPB_INLINE void google_protobuf_FileDescriptorProto_set_name(google_protobuf_FileDescriptorProto *msg, upb_strview value) {
|
1444
1581
|
_upb_sethas(msg, 1);
|
1445
|
-
|
1582
|
+
*UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_strview) = value;
|
1446
1583
|
}
|
1447
1584
|
UPB_INLINE void google_protobuf_FileDescriptorProto_set_package(google_protobuf_FileDescriptorProto *msg, upb_strview value) {
|
1448
1585
|
_upb_sethas(msg, 2);
|
1449
|
-
|
1586
|
+
*UPB_PTR_AT(msg, UPB_SIZE(12, 24), upb_strview) = value;
|
1450
1587
|
}
|
1451
1588
|
UPB_INLINE upb_strview* google_protobuf_FileDescriptorProto_mutable_dependency(google_protobuf_FileDescriptorProto *msg, size_t *len) {
|
1452
1589
|
return (upb_strview*)_upb_array_mutable_accessor(msg, UPB_SIZE(36, 72), len);
|
1453
1590
|
}
|
1454
1591
|
UPB_INLINE upb_strview* google_protobuf_FileDescriptorProto_resize_dependency(google_protobuf_FileDescriptorProto *msg, size_t len, upb_arena *arena) {
|
1455
|
-
return (upb_strview*)_upb_array_resize_accessor(msg, UPB_SIZE(36, 72), len,
|
1592
|
+
return (upb_strview*)_upb_array_resize_accessor(msg, UPB_SIZE(36, 72), len, UPB_TYPE_STRING, arena);
|
1456
1593
|
}
|
1457
1594
|
UPB_INLINE bool google_protobuf_FileDescriptorProto_add_dependency(google_protobuf_FileDescriptorProto *msg, upb_strview val, upb_arena *arena) {
|
1458
|
-
return _upb_array_append_accessor(
|
1459
|
-
|
1595
|
+
return _upb_array_append_accessor(msg, UPB_SIZE(36, 72), UPB_SIZE(8, 16), UPB_TYPE_STRING, &val,
|
1596
|
+
arena);
|
1460
1597
|
}
|
1461
1598
|
UPB_INLINE google_protobuf_DescriptorProto** google_protobuf_FileDescriptorProto_mutable_message_type(google_protobuf_FileDescriptorProto *msg, size_t *len) {
|
1462
1599
|
return (google_protobuf_DescriptorProto**)_upb_array_mutable_accessor(msg, UPB_SIZE(40, 80), len);
|
1463
1600
|
}
|
1464
1601
|
UPB_INLINE google_protobuf_DescriptorProto** google_protobuf_FileDescriptorProto_resize_message_type(google_protobuf_FileDescriptorProto *msg, size_t len, upb_arena *arena) {
|
1465
|
-
return (google_protobuf_DescriptorProto**)_upb_array_resize_accessor(msg, UPB_SIZE(40, 80), len,
|
1602
|
+
return (google_protobuf_DescriptorProto**)_upb_array_resize_accessor(msg, UPB_SIZE(40, 80), len, UPB_TYPE_MESSAGE, arena);
|
1466
1603
|
}
|
1467
1604
|
UPB_INLINE struct google_protobuf_DescriptorProto* google_protobuf_FileDescriptorProto_add_message_type(google_protobuf_FileDescriptorProto *msg, upb_arena *arena) {
|
1468
|
-
struct google_protobuf_DescriptorProto* sub = (struct google_protobuf_DescriptorProto*)
|
1605
|
+
struct google_protobuf_DescriptorProto* sub = (struct google_protobuf_DescriptorProto*)_upb_msg_new(&google_protobuf_DescriptorProto_msginit, arena);
|
1469
1606
|
bool ok = _upb_array_append_accessor(
|
1470
1607
|
msg, UPB_SIZE(40, 80), UPB_SIZE(4, 8), UPB_TYPE_MESSAGE, &sub, arena);
|
1471
1608
|
if (!ok) return NULL;
|
@@ -1475,10 +1612,10 @@ UPB_INLINE google_protobuf_EnumDescriptorProto** google_protobuf_FileDescriptorP
|
|
1475
1612
|
return (google_protobuf_EnumDescriptorProto**)_upb_array_mutable_accessor(msg, UPB_SIZE(44, 88), len);
|
1476
1613
|
}
|
1477
1614
|
UPB_INLINE google_protobuf_EnumDescriptorProto** google_protobuf_FileDescriptorProto_resize_enum_type(google_protobuf_FileDescriptorProto *msg, size_t len, upb_arena *arena) {
|
1478
|
-
return (google_protobuf_EnumDescriptorProto**)_upb_array_resize_accessor(msg, UPB_SIZE(44, 88), len,
|
1615
|
+
return (google_protobuf_EnumDescriptorProto**)_upb_array_resize_accessor(msg, UPB_SIZE(44, 88), len, UPB_TYPE_MESSAGE, arena);
|
1479
1616
|
}
|
1480
1617
|
UPB_INLINE struct google_protobuf_EnumDescriptorProto* google_protobuf_FileDescriptorProto_add_enum_type(google_protobuf_FileDescriptorProto *msg, upb_arena *arena) {
|
1481
|
-
struct google_protobuf_EnumDescriptorProto* sub = (struct google_protobuf_EnumDescriptorProto*)
|
1618
|
+
struct google_protobuf_EnumDescriptorProto* sub = (struct google_protobuf_EnumDescriptorProto*)_upb_msg_new(&google_protobuf_EnumDescriptorProto_msginit, arena);
|
1482
1619
|
bool ok = _upb_array_append_accessor(
|
1483
1620
|
msg, UPB_SIZE(44, 88), UPB_SIZE(4, 8), UPB_TYPE_MESSAGE, &sub, arena);
|
1484
1621
|
if (!ok) return NULL;
|
@@ -1488,10 +1625,10 @@ UPB_INLINE google_protobuf_ServiceDescriptorProto** google_protobuf_FileDescript
|
|
1488
1625
|
return (google_protobuf_ServiceDescriptorProto**)_upb_array_mutable_accessor(msg, UPB_SIZE(48, 96), len);
|
1489
1626
|
}
|
1490
1627
|
UPB_INLINE google_protobuf_ServiceDescriptorProto** google_protobuf_FileDescriptorProto_resize_service(google_protobuf_FileDescriptorProto *msg, size_t len, upb_arena *arena) {
|
1491
|
-
return (google_protobuf_ServiceDescriptorProto**)_upb_array_resize_accessor(msg, UPB_SIZE(48, 96), len,
|
1628
|
+
return (google_protobuf_ServiceDescriptorProto**)_upb_array_resize_accessor(msg, UPB_SIZE(48, 96), len, UPB_TYPE_MESSAGE, arena);
|
1492
1629
|
}
|
1493
1630
|
UPB_INLINE struct google_protobuf_ServiceDescriptorProto* google_protobuf_FileDescriptorProto_add_service(google_protobuf_FileDescriptorProto *msg, upb_arena *arena) {
|
1494
|
-
struct google_protobuf_ServiceDescriptorProto* sub = (struct google_protobuf_ServiceDescriptorProto*)
|
1631
|
+
struct google_protobuf_ServiceDescriptorProto* sub = (struct google_protobuf_ServiceDescriptorProto*)_upb_msg_new(&google_protobuf_ServiceDescriptorProto_msginit, arena);
|
1495
1632
|
bool ok = _upb_array_append_accessor(
|
1496
1633
|
msg, UPB_SIZE(48, 96), UPB_SIZE(4, 8), UPB_TYPE_MESSAGE, &sub, arena);
|
1497
1634
|
if (!ok) return NULL;
|
@@ -1501,10 +1638,10 @@ UPB_INLINE google_protobuf_FieldDescriptorProto** google_protobuf_FileDescriptor
|
|
1501
1638
|
return (google_protobuf_FieldDescriptorProto**)_upb_array_mutable_accessor(msg, UPB_SIZE(52, 104), len);
|
1502
1639
|
}
|
1503
1640
|
UPB_INLINE google_protobuf_FieldDescriptorProto** google_protobuf_FileDescriptorProto_resize_extension(google_protobuf_FileDescriptorProto *msg, size_t len, upb_arena *arena) {
|
1504
|
-
return (google_protobuf_FieldDescriptorProto**)_upb_array_resize_accessor(msg, UPB_SIZE(52, 104), len,
|
1641
|
+
return (google_protobuf_FieldDescriptorProto**)_upb_array_resize_accessor(msg, UPB_SIZE(52, 104), len, UPB_TYPE_MESSAGE, arena);
|
1505
1642
|
}
|
1506
1643
|
UPB_INLINE struct google_protobuf_FieldDescriptorProto* google_protobuf_FileDescriptorProto_add_extension(google_protobuf_FileDescriptorProto *msg, upb_arena *arena) {
|
1507
|
-
struct google_protobuf_FieldDescriptorProto* sub = (struct google_protobuf_FieldDescriptorProto*)
|
1644
|
+
struct google_protobuf_FieldDescriptorProto* sub = (struct google_protobuf_FieldDescriptorProto*)_upb_msg_new(&google_protobuf_FieldDescriptorProto_msginit, arena);
|
1508
1645
|
bool ok = _upb_array_append_accessor(
|
1509
1646
|
msg, UPB_SIZE(52, 104), UPB_SIZE(4, 8), UPB_TYPE_MESSAGE, &sub, arena);
|
1510
1647
|
if (!ok) return NULL;
|
@@ -1512,12 +1649,12 @@ UPB_INLINE struct google_protobuf_FieldDescriptorProto* google_protobuf_FileDesc
|
|
1512
1649
|
}
|
1513
1650
|
UPB_INLINE void google_protobuf_FileDescriptorProto_set_options(google_protobuf_FileDescriptorProto *msg, google_protobuf_FileOptions* value) {
|
1514
1651
|
_upb_sethas(msg, 4);
|
1515
|
-
|
1652
|
+
*UPB_PTR_AT(msg, UPB_SIZE(28, 56), google_protobuf_FileOptions*) = value;
|
1516
1653
|
}
|
1517
1654
|
UPB_INLINE struct google_protobuf_FileOptions* google_protobuf_FileDescriptorProto_mutable_options(google_protobuf_FileDescriptorProto *msg, upb_arena *arena) {
|
1518
1655
|
struct google_protobuf_FileOptions* sub = (struct google_protobuf_FileOptions*)google_protobuf_FileDescriptorProto_options(msg);
|
1519
1656
|
if (sub == NULL) {
|
1520
|
-
sub = (struct google_protobuf_FileOptions*)
|
1657
|
+
sub = (struct google_protobuf_FileOptions*)_upb_msg_new(&google_protobuf_FileOptions_msginit, arena);
|
1521
1658
|
if (!sub) return NULL;
|
1522
1659
|
google_protobuf_FileDescriptorProto_set_options(msg, sub);
|
1523
1660
|
}
|
@@ -1525,12 +1662,12 @@ UPB_INLINE struct google_protobuf_FileOptions* google_protobuf_FileDescriptorPro
|
|
1525
1662
|
}
|
1526
1663
|
UPB_INLINE void google_protobuf_FileDescriptorProto_set_source_code_info(google_protobuf_FileDescriptorProto *msg, google_protobuf_SourceCodeInfo* value) {
|
1527
1664
|
_upb_sethas(msg, 5);
|
1528
|
-
|
1665
|
+
*UPB_PTR_AT(msg, UPB_SIZE(32, 64), google_protobuf_SourceCodeInfo*) = value;
|
1529
1666
|
}
|
1530
1667
|
UPB_INLINE struct google_protobuf_SourceCodeInfo* google_protobuf_FileDescriptorProto_mutable_source_code_info(google_protobuf_FileDescriptorProto *msg, upb_arena *arena) {
|
1531
1668
|
struct google_protobuf_SourceCodeInfo* sub = (struct google_protobuf_SourceCodeInfo*)google_protobuf_FileDescriptorProto_source_code_info(msg);
|
1532
1669
|
if (sub == NULL) {
|
1533
|
-
sub = (struct google_protobuf_SourceCodeInfo*)
|
1670
|
+
sub = (struct google_protobuf_SourceCodeInfo*)_upb_msg_new(&google_protobuf_SourceCodeInfo_msginit, arena);
|
1534
1671
|
if (!sub) return NULL;
|
1535
1672
|
google_protobuf_FileDescriptorProto_set_source_code_info(msg, sub);
|
1536
1673
|
}
|
@@ -1540,31 +1677,31 @@ UPB_INLINE int32_t* google_protobuf_FileDescriptorProto_mutable_public_dependenc
|
|
1540
1677
|
return (int32_t*)_upb_array_mutable_accessor(msg, UPB_SIZE(56, 112), len);
|
1541
1678
|
}
|
1542
1679
|
UPB_INLINE int32_t* google_protobuf_FileDescriptorProto_resize_public_dependency(google_protobuf_FileDescriptorProto *msg, size_t len, upb_arena *arena) {
|
1543
|
-
return (int32_t*)_upb_array_resize_accessor(msg, UPB_SIZE(56, 112), len,
|
1680
|
+
return (int32_t*)_upb_array_resize_accessor(msg, UPB_SIZE(56, 112), len, UPB_TYPE_INT32, arena);
|
1544
1681
|
}
|
1545
1682
|
UPB_INLINE bool google_protobuf_FileDescriptorProto_add_public_dependency(google_protobuf_FileDescriptorProto *msg, int32_t val, upb_arena *arena) {
|
1546
|
-
return _upb_array_append_accessor(
|
1547
|
-
|
1683
|
+
return _upb_array_append_accessor(msg, UPB_SIZE(56, 112), UPB_SIZE(4, 4), UPB_TYPE_INT32, &val,
|
1684
|
+
arena);
|
1548
1685
|
}
|
1549
1686
|
UPB_INLINE int32_t* google_protobuf_FileDescriptorProto_mutable_weak_dependency(google_protobuf_FileDescriptorProto *msg, size_t *len) {
|
1550
1687
|
return (int32_t*)_upb_array_mutable_accessor(msg, UPB_SIZE(60, 120), len);
|
1551
1688
|
}
|
1552
1689
|
UPB_INLINE int32_t* google_protobuf_FileDescriptorProto_resize_weak_dependency(google_protobuf_FileDescriptorProto *msg, size_t len, upb_arena *arena) {
|
1553
|
-
return (int32_t*)_upb_array_resize_accessor(msg, UPB_SIZE(60, 120), len,
|
1690
|
+
return (int32_t*)_upb_array_resize_accessor(msg, UPB_SIZE(60, 120), len, UPB_TYPE_INT32, arena);
|
1554
1691
|
}
|
1555
1692
|
UPB_INLINE bool google_protobuf_FileDescriptorProto_add_weak_dependency(google_protobuf_FileDescriptorProto *msg, int32_t val, upb_arena *arena) {
|
1556
|
-
return _upb_array_append_accessor(
|
1557
|
-
|
1693
|
+
return _upb_array_append_accessor(msg, UPB_SIZE(60, 120), UPB_SIZE(4, 4), UPB_TYPE_INT32, &val,
|
1694
|
+
arena);
|
1558
1695
|
}
|
1559
1696
|
UPB_INLINE void google_protobuf_FileDescriptorProto_set_syntax(google_protobuf_FileDescriptorProto *msg, upb_strview value) {
|
1560
1697
|
_upb_sethas(msg, 3);
|
1561
|
-
|
1698
|
+
*UPB_PTR_AT(msg, UPB_SIZE(20, 40), upb_strview) = value;
|
1562
1699
|
}
|
1563
1700
|
|
1564
1701
|
/* google.protobuf.DescriptorProto */
|
1565
1702
|
|
1566
1703
|
UPB_INLINE google_protobuf_DescriptorProto *google_protobuf_DescriptorProto_new(upb_arena *arena) {
|
1567
|
-
return (google_protobuf_DescriptorProto *)
|
1704
|
+
return (google_protobuf_DescriptorProto *)_upb_msg_new(&google_protobuf_DescriptorProto_msginit, arena);
|
1568
1705
|
}
|
1569
1706
|
UPB_INLINE google_protobuf_DescriptorProto *google_protobuf_DescriptorProto_parse(const char *buf, size_t size,
|
1570
1707
|
upb_arena *arena) {
|
@@ -1576,30 +1713,37 @@ UPB_INLINE char *google_protobuf_DescriptorProto_serialize(const google_protobuf
|
|
1576
1713
|
}
|
1577
1714
|
|
1578
1715
|
UPB_INLINE bool google_protobuf_DescriptorProto_has_name(const google_protobuf_DescriptorProto *msg) { return _upb_has_field(msg, 1); }
|
1579
|
-
UPB_INLINE upb_strview google_protobuf_DescriptorProto_name(const google_protobuf_DescriptorProto *msg) { return
|
1716
|
+
UPB_INLINE upb_strview google_protobuf_DescriptorProto_name(const google_protobuf_DescriptorProto *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_strview); }
|
1717
|
+
UPB_INLINE bool google_protobuf_DescriptorProto_has_field(const google_protobuf_DescriptorProto *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(16, 32)); }
|
1580
1718
|
UPB_INLINE const google_protobuf_FieldDescriptorProto* const* google_protobuf_DescriptorProto_field(const google_protobuf_DescriptorProto *msg, size_t *len) { return (const google_protobuf_FieldDescriptorProto* const*)_upb_array_accessor(msg, UPB_SIZE(16, 32), len); }
|
1719
|
+
UPB_INLINE bool google_protobuf_DescriptorProto_has_nested_type(const google_protobuf_DescriptorProto *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(20, 40)); }
|
1581
1720
|
UPB_INLINE const google_protobuf_DescriptorProto* const* google_protobuf_DescriptorProto_nested_type(const google_protobuf_DescriptorProto *msg, size_t *len) { return (const google_protobuf_DescriptorProto* const*)_upb_array_accessor(msg, UPB_SIZE(20, 40), len); }
|
1721
|
+
UPB_INLINE bool google_protobuf_DescriptorProto_has_enum_type(const google_protobuf_DescriptorProto *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(24, 48)); }
|
1582
1722
|
UPB_INLINE const google_protobuf_EnumDescriptorProto* const* google_protobuf_DescriptorProto_enum_type(const google_protobuf_DescriptorProto *msg, size_t *len) { return (const google_protobuf_EnumDescriptorProto* const*)_upb_array_accessor(msg, UPB_SIZE(24, 48), len); }
|
1723
|
+
UPB_INLINE bool google_protobuf_DescriptorProto_has_extension_range(const google_protobuf_DescriptorProto *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(28, 56)); }
|
1583
1724
|
UPB_INLINE const google_protobuf_DescriptorProto_ExtensionRange* const* google_protobuf_DescriptorProto_extension_range(const google_protobuf_DescriptorProto *msg, size_t *len) { return (const google_protobuf_DescriptorProto_ExtensionRange* const*)_upb_array_accessor(msg, UPB_SIZE(28, 56), len); }
|
1725
|
+
UPB_INLINE bool google_protobuf_DescriptorProto_has_extension(const google_protobuf_DescriptorProto *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(32, 64)); }
|
1584
1726
|
UPB_INLINE const google_protobuf_FieldDescriptorProto* const* google_protobuf_DescriptorProto_extension(const google_protobuf_DescriptorProto *msg, size_t *len) { return (const google_protobuf_FieldDescriptorProto* const*)_upb_array_accessor(msg, UPB_SIZE(32, 64), len); }
|
1585
1727
|
UPB_INLINE bool google_protobuf_DescriptorProto_has_options(const google_protobuf_DescriptorProto *msg) { return _upb_has_field(msg, 2); }
|
1586
|
-
UPB_INLINE const google_protobuf_MessageOptions* google_protobuf_DescriptorProto_options(const google_protobuf_DescriptorProto *msg) { return
|
1728
|
+
UPB_INLINE const google_protobuf_MessageOptions* google_protobuf_DescriptorProto_options(const google_protobuf_DescriptorProto *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(12, 24), const google_protobuf_MessageOptions*); }
|
1729
|
+
UPB_INLINE bool google_protobuf_DescriptorProto_has_oneof_decl(const google_protobuf_DescriptorProto *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(36, 72)); }
|
1587
1730
|
UPB_INLINE const google_protobuf_OneofDescriptorProto* const* google_protobuf_DescriptorProto_oneof_decl(const google_protobuf_DescriptorProto *msg, size_t *len) { return (const google_protobuf_OneofDescriptorProto* const*)_upb_array_accessor(msg, UPB_SIZE(36, 72), len); }
|
1731
|
+
UPB_INLINE bool google_protobuf_DescriptorProto_has_reserved_range(const google_protobuf_DescriptorProto *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(40, 80)); }
|
1588
1732
|
UPB_INLINE const google_protobuf_DescriptorProto_ReservedRange* const* google_protobuf_DescriptorProto_reserved_range(const google_protobuf_DescriptorProto *msg, size_t *len) { return (const google_protobuf_DescriptorProto_ReservedRange* const*)_upb_array_accessor(msg, UPB_SIZE(40, 80), len); }
|
1589
1733
|
UPB_INLINE upb_strview const* google_protobuf_DescriptorProto_reserved_name(const google_protobuf_DescriptorProto *msg, size_t *len) { return (upb_strview const*)_upb_array_accessor(msg, UPB_SIZE(44, 88), len); }
|
1590
1734
|
|
1591
1735
|
UPB_INLINE void google_protobuf_DescriptorProto_set_name(google_protobuf_DescriptorProto *msg, upb_strview value) {
|
1592
1736
|
_upb_sethas(msg, 1);
|
1593
|
-
|
1737
|
+
*UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_strview) = value;
|
1594
1738
|
}
|
1595
1739
|
UPB_INLINE google_protobuf_FieldDescriptorProto** google_protobuf_DescriptorProto_mutable_field(google_protobuf_DescriptorProto *msg, size_t *len) {
|
1596
1740
|
return (google_protobuf_FieldDescriptorProto**)_upb_array_mutable_accessor(msg, UPB_SIZE(16, 32), len);
|
1597
1741
|
}
|
1598
1742
|
UPB_INLINE google_protobuf_FieldDescriptorProto** google_protobuf_DescriptorProto_resize_field(google_protobuf_DescriptorProto *msg, size_t len, upb_arena *arena) {
|
1599
|
-
return (google_protobuf_FieldDescriptorProto**)_upb_array_resize_accessor(msg, UPB_SIZE(16, 32), len,
|
1743
|
+
return (google_protobuf_FieldDescriptorProto**)_upb_array_resize_accessor(msg, UPB_SIZE(16, 32), len, UPB_TYPE_MESSAGE, arena);
|
1600
1744
|
}
|
1601
1745
|
UPB_INLINE struct google_protobuf_FieldDescriptorProto* google_protobuf_DescriptorProto_add_field(google_protobuf_DescriptorProto *msg, upb_arena *arena) {
|
1602
|
-
struct google_protobuf_FieldDescriptorProto* sub = (struct google_protobuf_FieldDescriptorProto*)
|
1746
|
+
struct google_protobuf_FieldDescriptorProto* sub = (struct google_protobuf_FieldDescriptorProto*)_upb_msg_new(&google_protobuf_FieldDescriptorProto_msginit, arena);
|
1603
1747
|
bool ok = _upb_array_append_accessor(
|
1604
1748
|
msg, UPB_SIZE(16, 32), UPB_SIZE(4, 8), UPB_TYPE_MESSAGE, &sub, arena);
|
1605
1749
|
if (!ok) return NULL;
|
@@ -1609,10 +1753,10 @@ UPB_INLINE google_protobuf_DescriptorProto** google_protobuf_DescriptorProto_mut
|
|
1609
1753
|
return (google_protobuf_DescriptorProto**)_upb_array_mutable_accessor(msg, UPB_SIZE(20, 40), len);
|
1610
1754
|
}
|
1611
1755
|
UPB_INLINE google_protobuf_DescriptorProto** google_protobuf_DescriptorProto_resize_nested_type(google_protobuf_DescriptorProto *msg, size_t len, upb_arena *arena) {
|
1612
|
-
return (google_protobuf_DescriptorProto**)_upb_array_resize_accessor(msg, UPB_SIZE(20, 40), len,
|
1756
|
+
return (google_protobuf_DescriptorProto**)_upb_array_resize_accessor(msg, UPB_SIZE(20, 40), len, UPB_TYPE_MESSAGE, arena);
|
1613
1757
|
}
|
1614
1758
|
UPB_INLINE struct google_protobuf_DescriptorProto* google_protobuf_DescriptorProto_add_nested_type(google_protobuf_DescriptorProto *msg, upb_arena *arena) {
|
1615
|
-
struct google_protobuf_DescriptorProto* sub = (struct google_protobuf_DescriptorProto*)
|
1759
|
+
struct google_protobuf_DescriptorProto* sub = (struct google_protobuf_DescriptorProto*)_upb_msg_new(&google_protobuf_DescriptorProto_msginit, arena);
|
1616
1760
|
bool ok = _upb_array_append_accessor(
|
1617
1761
|
msg, UPB_SIZE(20, 40), UPB_SIZE(4, 8), UPB_TYPE_MESSAGE, &sub, arena);
|
1618
1762
|
if (!ok) return NULL;
|
@@ -1622,10 +1766,10 @@ UPB_INLINE google_protobuf_EnumDescriptorProto** google_protobuf_DescriptorProto
|
|
1622
1766
|
return (google_protobuf_EnumDescriptorProto**)_upb_array_mutable_accessor(msg, UPB_SIZE(24, 48), len);
|
1623
1767
|
}
|
1624
1768
|
UPB_INLINE google_protobuf_EnumDescriptorProto** google_protobuf_DescriptorProto_resize_enum_type(google_protobuf_DescriptorProto *msg, size_t len, upb_arena *arena) {
|
1625
|
-
return (google_protobuf_EnumDescriptorProto**)_upb_array_resize_accessor(msg, UPB_SIZE(24, 48), len,
|
1769
|
+
return (google_protobuf_EnumDescriptorProto**)_upb_array_resize_accessor(msg, UPB_SIZE(24, 48), len, UPB_TYPE_MESSAGE, arena);
|
1626
1770
|
}
|
1627
1771
|
UPB_INLINE struct google_protobuf_EnumDescriptorProto* google_protobuf_DescriptorProto_add_enum_type(google_protobuf_DescriptorProto *msg, upb_arena *arena) {
|
1628
|
-
struct google_protobuf_EnumDescriptorProto* sub = (struct google_protobuf_EnumDescriptorProto*)
|
1772
|
+
struct google_protobuf_EnumDescriptorProto* sub = (struct google_protobuf_EnumDescriptorProto*)_upb_msg_new(&google_protobuf_EnumDescriptorProto_msginit, arena);
|
1629
1773
|
bool ok = _upb_array_append_accessor(
|
1630
1774
|
msg, UPB_SIZE(24, 48), UPB_SIZE(4, 8), UPB_TYPE_MESSAGE, &sub, arena);
|
1631
1775
|
if (!ok) return NULL;
|
@@ -1635,10 +1779,10 @@ UPB_INLINE google_protobuf_DescriptorProto_ExtensionRange** google_protobuf_Desc
|
|
1635
1779
|
return (google_protobuf_DescriptorProto_ExtensionRange**)_upb_array_mutable_accessor(msg, UPB_SIZE(28, 56), len);
|
1636
1780
|
}
|
1637
1781
|
UPB_INLINE google_protobuf_DescriptorProto_ExtensionRange** google_protobuf_DescriptorProto_resize_extension_range(google_protobuf_DescriptorProto *msg, size_t len, upb_arena *arena) {
|
1638
|
-
return (google_protobuf_DescriptorProto_ExtensionRange**)_upb_array_resize_accessor(msg, UPB_SIZE(28, 56), len,
|
1782
|
+
return (google_protobuf_DescriptorProto_ExtensionRange**)_upb_array_resize_accessor(msg, UPB_SIZE(28, 56), len, UPB_TYPE_MESSAGE, arena);
|
1639
1783
|
}
|
1640
1784
|
UPB_INLINE struct google_protobuf_DescriptorProto_ExtensionRange* google_protobuf_DescriptorProto_add_extension_range(google_protobuf_DescriptorProto *msg, upb_arena *arena) {
|
1641
|
-
struct google_protobuf_DescriptorProto_ExtensionRange* sub = (struct google_protobuf_DescriptorProto_ExtensionRange*)
|
1785
|
+
struct google_protobuf_DescriptorProto_ExtensionRange* sub = (struct google_protobuf_DescriptorProto_ExtensionRange*)_upb_msg_new(&google_protobuf_DescriptorProto_ExtensionRange_msginit, arena);
|
1642
1786
|
bool ok = _upb_array_append_accessor(
|
1643
1787
|
msg, UPB_SIZE(28, 56), UPB_SIZE(4, 8), UPB_TYPE_MESSAGE, &sub, arena);
|
1644
1788
|
if (!ok) return NULL;
|
@@ -1648,10 +1792,10 @@ UPB_INLINE google_protobuf_FieldDescriptorProto** google_protobuf_DescriptorProt
|
|
1648
1792
|
return (google_protobuf_FieldDescriptorProto**)_upb_array_mutable_accessor(msg, UPB_SIZE(32, 64), len);
|
1649
1793
|
}
|
1650
1794
|
UPB_INLINE google_protobuf_FieldDescriptorProto** google_protobuf_DescriptorProto_resize_extension(google_protobuf_DescriptorProto *msg, size_t len, upb_arena *arena) {
|
1651
|
-
return (google_protobuf_FieldDescriptorProto**)_upb_array_resize_accessor(msg, UPB_SIZE(32, 64), len,
|
1795
|
+
return (google_protobuf_FieldDescriptorProto**)_upb_array_resize_accessor(msg, UPB_SIZE(32, 64), len, UPB_TYPE_MESSAGE, arena);
|
1652
1796
|
}
|
1653
1797
|
UPB_INLINE struct google_protobuf_FieldDescriptorProto* google_protobuf_DescriptorProto_add_extension(google_protobuf_DescriptorProto *msg, upb_arena *arena) {
|
1654
|
-
struct google_protobuf_FieldDescriptorProto* sub = (struct google_protobuf_FieldDescriptorProto*)
|
1798
|
+
struct google_protobuf_FieldDescriptorProto* sub = (struct google_protobuf_FieldDescriptorProto*)_upb_msg_new(&google_protobuf_FieldDescriptorProto_msginit, arena);
|
1655
1799
|
bool ok = _upb_array_append_accessor(
|
1656
1800
|
msg, UPB_SIZE(32, 64), UPB_SIZE(4, 8), UPB_TYPE_MESSAGE, &sub, arena);
|
1657
1801
|
if (!ok) return NULL;
|
@@ -1659,12 +1803,12 @@ UPB_INLINE struct google_protobuf_FieldDescriptorProto* google_protobuf_Descript
|
|
1659
1803
|
}
|
1660
1804
|
UPB_INLINE void google_protobuf_DescriptorProto_set_options(google_protobuf_DescriptorProto *msg, google_protobuf_MessageOptions* value) {
|
1661
1805
|
_upb_sethas(msg, 2);
|
1662
|
-
|
1806
|
+
*UPB_PTR_AT(msg, UPB_SIZE(12, 24), google_protobuf_MessageOptions*) = value;
|
1663
1807
|
}
|
1664
1808
|
UPB_INLINE struct google_protobuf_MessageOptions* google_protobuf_DescriptorProto_mutable_options(google_protobuf_DescriptorProto *msg, upb_arena *arena) {
|
1665
1809
|
struct google_protobuf_MessageOptions* sub = (struct google_protobuf_MessageOptions*)google_protobuf_DescriptorProto_options(msg);
|
1666
1810
|
if (sub == NULL) {
|
1667
|
-
sub = (struct google_protobuf_MessageOptions*)
|
1811
|
+
sub = (struct google_protobuf_MessageOptions*)_upb_msg_new(&google_protobuf_MessageOptions_msginit, arena);
|
1668
1812
|
if (!sub) return NULL;
|
1669
1813
|
google_protobuf_DescriptorProto_set_options(msg, sub);
|
1670
1814
|
}
|
@@ -1674,10 +1818,10 @@ UPB_INLINE google_protobuf_OneofDescriptorProto** google_protobuf_DescriptorProt
|
|
1674
1818
|
return (google_protobuf_OneofDescriptorProto**)_upb_array_mutable_accessor(msg, UPB_SIZE(36, 72), len);
|
1675
1819
|
}
|
1676
1820
|
UPB_INLINE google_protobuf_OneofDescriptorProto** google_protobuf_DescriptorProto_resize_oneof_decl(google_protobuf_DescriptorProto *msg, size_t len, upb_arena *arena) {
|
1677
|
-
return (google_protobuf_OneofDescriptorProto**)_upb_array_resize_accessor(msg, UPB_SIZE(36, 72), len,
|
1821
|
+
return (google_protobuf_OneofDescriptorProto**)_upb_array_resize_accessor(msg, UPB_SIZE(36, 72), len, UPB_TYPE_MESSAGE, arena);
|
1678
1822
|
}
|
1679
1823
|
UPB_INLINE struct google_protobuf_OneofDescriptorProto* google_protobuf_DescriptorProto_add_oneof_decl(google_protobuf_DescriptorProto *msg, upb_arena *arena) {
|
1680
|
-
struct google_protobuf_OneofDescriptorProto* sub = (struct google_protobuf_OneofDescriptorProto*)
|
1824
|
+
struct google_protobuf_OneofDescriptorProto* sub = (struct google_protobuf_OneofDescriptorProto*)_upb_msg_new(&google_protobuf_OneofDescriptorProto_msginit, arena);
|
1681
1825
|
bool ok = _upb_array_append_accessor(
|
1682
1826
|
msg, UPB_SIZE(36, 72), UPB_SIZE(4, 8), UPB_TYPE_MESSAGE, &sub, arena);
|
1683
1827
|
if (!ok) return NULL;
|
@@ -1687,10 +1831,10 @@ UPB_INLINE google_protobuf_DescriptorProto_ReservedRange** google_protobuf_Descr
|
|
1687
1831
|
return (google_protobuf_DescriptorProto_ReservedRange**)_upb_array_mutable_accessor(msg, UPB_SIZE(40, 80), len);
|
1688
1832
|
}
|
1689
1833
|
UPB_INLINE google_protobuf_DescriptorProto_ReservedRange** google_protobuf_DescriptorProto_resize_reserved_range(google_protobuf_DescriptorProto *msg, size_t len, upb_arena *arena) {
|
1690
|
-
return (google_protobuf_DescriptorProto_ReservedRange**)_upb_array_resize_accessor(msg, UPB_SIZE(40, 80), len,
|
1834
|
+
return (google_protobuf_DescriptorProto_ReservedRange**)_upb_array_resize_accessor(msg, UPB_SIZE(40, 80), len, UPB_TYPE_MESSAGE, arena);
|
1691
1835
|
}
|
1692
1836
|
UPB_INLINE struct google_protobuf_DescriptorProto_ReservedRange* google_protobuf_DescriptorProto_add_reserved_range(google_protobuf_DescriptorProto *msg, upb_arena *arena) {
|
1693
|
-
struct google_protobuf_DescriptorProto_ReservedRange* sub = (struct google_protobuf_DescriptorProto_ReservedRange*)
|
1837
|
+
struct google_protobuf_DescriptorProto_ReservedRange* sub = (struct google_protobuf_DescriptorProto_ReservedRange*)_upb_msg_new(&google_protobuf_DescriptorProto_ReservedRange_msginit, arena);
|
1694
1838
|
bool ok = _upb_array_append_accessor(
|
1695
1839
|
msg, UPB_SIZE(40, 80), UPB_SIZE(4, 8), UPB_TYPE_MESSAGE, &sub, arena);
|
1696
1840
|
if (!ok) return NULL;
|
@@ -1700,17 +1844,17 @@ UPB_INLINE upb_strview* google_protobuf_DescriptorProto_mutable_reserved_name(go
|
|
1700
1844
|
return (upb_strview*)_upb_array_mutable_accessor(msg, UPB_SIZE(44, 88), len);
|
1701
1845
|
}
|
1702
1846
|
UPB_INLINE upb_strview* google_protobuf_DescriptorProto_resize_reserved_name(google_protobuf_DescriptorProto *msg, size_t len, upb_arena *arena) {
|
1703
|
-
return (upb_strview*)_upb_array_resize_accessor(msg, UPB_SIZE(44, 88), len,
|
1847
|
+
return (upb_strview*)_upb_array_resize_accessor(msg, UPB_SIZE(44, 88), len, UPB_TYPE_STRING, arena);
|
1704
1848
|
}
|
1705
1849
|
UPB_INLINE bool google_protobuf_DescriptorProto_add_reserved_name(google_protobuf_DescriptorProto *msg, upb_strview val, upb_arena *arena) {
|
1706
|
-
return _upb_array_append_accessor(
|
1707
|
-
|
1850
|
+
return _upb_array_append_accessor(msg, UPB_SIZE(44, 88), UPB_SIZE(8, 16), UPB_TYPE_STRING, &val,
|
1851
|
+
arena);
|
1708
1852
|
}
|
1709
1853
|
|
1710
1854
|
/* google.protobuf.DescriptorProto.ExtensionRange */
|
1711
1855
|
|
1712
1856
|
UPB_INLINE google_protobuf_DescriptorProto_ExtensionRange *google_protobuf_DescriptorProto_ExtensionRange_new(upb_arena *arena) {
|
1713
|
-
return (google_protobuf_DescriptorProto_ExtensionRange *)
|
1857
|
+
return (google_protobuf_DescriptorProto_ExtensionRange *)_upb_msg_new(&google_protobuf_DescriptorProto_ExtensionRange_msginit, arena);
|
1714
1858
|
}
|
1715
1859
|
UPB_INLINE google_protobuf_DescriptorProto_ExtensionRange *google_protobuf_DescriptorProto_ExtensionRange_parse(const char *buf, size_t size,
|
1716
1860
|
upb_arena *arena) {
|
@@ -1722,28 +1866,28 @@ UPB_INLINE char *google_protobuf_DescriptorProto_ExtensionRange_serialize(const
|
|
1722
1866
|
}
|
1723
1867
|
|
1724
1868
|
UPB_INLINE bool google_protobuf_DescriptorProto_ExtensionRange_has_start(const google_protobuf_DescriptorProto_ExtensionRange *msg) { return _upb_has_field(msg, 1); }
|
1725
|
-
UPB_INLINE int32_t google_protobuf_DescriptorProto_ExtensionRange_start(const google_protobuf_DescriptorProto_ExtensionRange *msg) { return
|
1869
|
+
UPB_INLINE int32_t google_protobuf_DescriptorProto_ExtensionRange_start(const google_protobuf_DescriptorProto_ExtensionRange *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(4, 4), int32_t); }
|
1726
1870
|
UPB_INLINE bool google_protobuf_DescriptorProto_ExtensionRange_has_end(const google_protobuf_DescriptorProto_ExtensionRange *msg) { return _upb_has_field(msg, 2); }
|
1727
|
-
UPB_INLINE int32_t google_protobuf_DescriptorProto_ExtensionRange_end(const google_protobuf_DescriptorProto_ExtensionRange *msg) { return
|
1871
|
+
UPB_INLINE int32_t google_protobuf_DescriptorProto_ExtensionRange_end(const google_protobuf_DescriptorProto_ExtensionRange *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(8, 8), int32_t); }
|
1728
1872
|
UPB_INLINE bool google_protobuf_DescriptorProto_ExtensionRange_has_options(const google_protobuf_DescriptorProto_ExtensionRange *msg) { return _upb_has_field(msg, 3); }
|
1729
|
-
UPB_INLINE const google_protobuf_ExtensionRangeOptions* google_protobuf_DescriptorProto_ExtensionRange_options(const google_protobuf_DescriptorProto_ExtensionRange *msg) { return
|
1873
|
+
UPB_INLINE const google_protobuf_ExtensionRangeOptions* google_protobuf_DescriptorProto_ExtensionRange_options(const google_protobuf_DescriptorProto_ExtensionRange *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(12, 16), const google_protobuf_ExtensionRangeOptions*); }
|
1730
1874
|
|
1731
1875
|
UPB_INLINE void google_protobuf_DescriptorProto_ExtensionRange_set_start(google_protobuf_DescriptorProto_ExtensionRange *msg, int32_t value) {
|
1732
1876
|
_upb_sethas(msg, 1);
|
1733
|
-
|
1877
|
+
*UPB_PTR_AT(msg, UPB_SIZE(4, 4), int32_t) = value;
|
1734
1878
|
}
|
1735
1879
|
UPB_INLINE void google_protobuf_DescriptorProto_ExtensionRange_set_end(google_protobuf_DescriptorProto_ExtensionRange *msg, int32_t value) {
|
1736
1880
|
_upb_sethas(msg, 2);
|
1737
|
-
|
1881
|
+
*UPB_PTR_AT(msg, UPB_SIZE(8, 8), int32_t) = value;
|
1738
1882
|
}
|
1739
1883
|
UPB_INLINE void google_protobuf_DescriptorProto_ExtensionRange_set_options(google_protobuf_DescriptorProto_ExtensionRange *msg, google_protobuf_ExtensionRangeOptions* value) {
|
1740
1884
|
_upb_sethas(msg, 3);
|
1741
|
-
|
1885
|
+
*UPB_PTR_AT(msg, UPB_SIZE(12, 16), google_protobuf_ExtensionRangeOptions*) = value;
|
1742
1886
|
}
|
1743
1887
|
UPB_INLINE struct google_protobuf_ExtensionRangeOptions* google_protobuf_DescriptorProto_ExtensionRange_mutable_options(google_protobuf_DescriptorProto_ExtensionRange *msg, upb_arena *arena) {
|
1744
1888
|
struct google_protobuf_ExtensionRangeOptions* sub = (struct google_protobuf_ExtensionRangeOptions*)google_protobuf_DescriptorProto_ExtensionRange_options(msg);
|
1745
1889
|
if (sub == NULL) {
|
1746
|
-
sub = (struct google_protobuf_ExtensionRangeOptions*)
|
1890
|
+
sub = (struct google_protobuf_ExtensionRangeOptions*)_upb_msg_new(&google_protobuf_ExtensionRangeOptions_msginit, arena);
|
1747
1891
|
if (!sub) return NULL;
|
1748
1892
|
google_protobuf_DescriptorProto_ExtensionRange_set_options(msg, sub);
|
1749
1893
|
}
|
@@ -1753,7 +1897,7 @@ UPB_INLINE struct google_protobuf_ExtensionRangeOptions* google_protobuf_Descrip
|
|
1753
1897
|
/* google.protobuf.DescriptorProto.ReservedRange */
|
1754
1898
|
|
1755
1899
|
UPB_INLINE google_protobuf_DescriptorProto_ReservedRange *google_protobuf_DescriptorProto_ReservedRange_new(upb_arena *arena) {
|
1756
|
-
return (google_protobuf_DescriptorProto_ReservedRange *)
|
1900
|
+
return (google_protobuf_DescriptorProto_ReservedRange *)_upb_msg_new(&google_protobuf_DescriptorProto_ReservedRange_msginit, arena);
|
1757
1901
|
}
|
1758
1902
|
UPB_INLINE google_protobuf_DescriptorProto_ReservedRange *google_protobuf_DescriptorProto_ReservedRange_parse(const char *buf, size_t size,
|
1759
1903
|
upb_arena *arena) {
|
@@ -1765,23 +1909,23 @@ UPB_INLINE char *google_protobuf_DescriptorProto_ReservedRange_serialize(const g
|
|
1765
1909
|
}
|
1766
1910
|
|
1767
1911
|
UPB_INLINE bool google_protobuf_DescriptorProto_ReservedRange_has_start(const google_protobuf_DescriptorProto_ReservedRange *msg) { return _upb_has_field(msg, 1); }
|
1768
|
-
UPB_INLINE int32_t google_protobuf_DescriptorProto_ReservedRange_start(const google_protobuf_DescriptorProto_ReservedRange *msg) { return
|
1912
|
+
UPB_INLINE int32_t google_protobuf_DescriptorProto_ReservedRange_start(const google_protobuf_DescriptorProto_ReservedRange *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(4, 4), int32_t); }
|
1769
1913
|
UPB_INLINE bool google_protobuf_DescriptorProto_ReservedRange_has_end(const google_protobuf_DescriptorProto_ReservedRange *msg) { return _upb_has_field(msg, 2); }
|
1770
|
-
UPB_INLINE int32_t google_protobuf_DescriptorProto_ReservedRange_end(const google_protobuf_DescriptorProto_ReservedRange *msg) { return
|
1914
|
+
UPB_INLINE int32_t google_protobuf_DescriptorProto_ReservedRange_end(const google_protobuf_DescriptorProto_ReservedRange *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(8, 8), int32_t); }
|
1771
1915
|
|
1772
1916
|
UPB_INLINE void google_protobuf_DescriptorProto_ReservedRange_set_start(google_protobuf_DescriptorProto_ReservedRange *msg, int32_t value) {
|
1773
1917
|
_upb_sethas(msg, 1);
|
1774
|
-
|
1918
|
+
*UPB_PTR_AT(msg, UPB_SIZE(4, 4), int32_t) = value;
|
1775
1919
|
}
|
1776
1920
|
UPB_INLINE void google_protobuf_DescriptorProto_ReservedRange_set_end(google_protobuf_DescriptorProto_ReservedRange *msg, int32_t value) {
|
1777
1921
|
_upb_sethas(msg, 2);
|
1778
|
-
|
1922
|
+
*UPB_PTR_AT(msg, UPB_SIZE(8, 8), int32_t) = value;
|
1779
1923
|
}
|
1780
1924
|
|
1781
1925
|
/* google.protobuf.ExtensionRangeOptions */
|
1782
1926
|
|
1783
1927
|
UPB_INLINE google_protobuf_ExtensionRangeOptions *google_protobuf_ExtensionRangeOptions_new(upb_arena *arena) {
|
1784
|
-
return (google_protobuf_ExtensionRangeOptions *)
|
1928
|
+
return (google_protobuf_ExtensionRangeOptions *)_upb_msg_new(&google_protobuf_ExtensionRangeOptions_msginit, arena);
|
1785
1929
|
}
|
1786
1930
|
UPB_INLINE google_protobuf_ExtensionRangeOptions *google_protobuf_ExtensionRangeOptions_parse(const char *buf, size_t size,
|
1787
1931
|
upb_arena *arena) {
|
@@ -1792,16 +1936,17 @@ UPB_INLINE char *google_protobuf_ExtensionRangeOptions_serialize(const google_pr
|
|
1792
1936
|
return upb_encode(msg, &google_protobuf_ExtensionRangeOptions_msginit, arena, len);
|
1793
1937
|
}
|
1794
1938
|
|
1939
|
+
UPB_INLINE bool google_protobuf_ExtensionRangeOptions_has_uninterpreted_option(const google_protobuf_ExtensionRangeOptions *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(0, 0)); }
|
1795
1940
|
UPB_INLINE const google_protobuf_UninterpretedOption* const* google_protobuf_ExtensionRangeOptions_uninterpreted_option(const google_protobuf_ExtensionRangeOptions *msg, size_t *len) { return (const google_protobuf_UninterpretedOption* const*)_upb_array_accessor(msg, UPB_SIZE(0, 0), len); }
|
1796
1941
|
|
1797
1942
|
UPB_INLINE google_protobuf_UninterpretedOption** google_protobuf_ExtensionRangeOptions_mutable_uninterpreted_option(google_protobuf_ExtensionRangeOptions *msg, size_t *len) {
|
1798
1943
|
return (google_protobuf_UninterpretedOption**)_upb_array_mutable_accessor(msg, UPB_SIZE(0, 0), len);
|
1799
1944
|
}
|
1800
1945
|
UPB_INLINE google_protobuf_UninterpretedOption** google_protobuf_ExtensionRangeOptions_resize_uninterpreted_option(google_protobuf_ExtensionRangeOptions *msg, size_t len, upb_arena *arena) {
|
1801
|
-
return (google_protobuf_UninterpretedOption**)_upb_array_resize_accessor(msg, UPB_SIZE(0, 0), len,
|
1946
|
+
return (google_protobuf_UninterpretedOption**)_upb_array_resize_accessor(msg, UPB_SIZE(0, 0), len, UPB_TYPE_MESSAGE, arena);
|
1802
1947
|
}
|
1803
1948
|
UPB_INLINE struct google_protobuf_UninterpretedOption* google_protobuf_ExtensionRangeOptions_add_uninterpreted_option(google_protobuf_ExtensionRangeOptions *msg, upb_arena *arena) {
|
1804
|
-
struct google_protobuf_UninterpretedOption* sub = (struct google_protobuf_UninterpretedOption*)
|
1949
|
+
struct google_protobuf_UninterpretedOption* sub = (struct google_protobuf_UninterpretedOption*)_upb_msg_new(&google_protobuf_UninterpretedOption_msginit, arena);
|
1805
1950
|
bool ok = _upb_array_append_accessor(
|
1806
1951
|
msg, UPB_SIZE(0, 0), UPB_SIZE(4, 8), UPB_TYPE_MESSAGE, &sub, arena);
|
1807
1952
|
if (!ok) return NULL;
|
@@ -1811,7 +1956,7 @@ UPB_INLINE struct google_protobuf_UninterpretedOption* google_protobuf_Extension
|
|
1811
1956
|
/* google.protobuf.FieldDescriptorProto */
|
1812
1957
|
|
1813
1958
|
UPB_INLINE google_protobuf_FieldDescriptorProto *google_protobuf_FieldDescriptorProto_new(upb_arena *arena) {
|
1814
|
-
return (google_protobuf_FieldDescriptorProto *)
|
1959
|
+
return (google_protobuf_FieldDescriptorProto *)_upb_msg_new(&google_protobuf_FieldDescriptorProto_msginit, arena);
|
1815
1960
|
}
|
1816
1961
|
UPB_INLINE google_protobuf_FieldDescriptorProto *google_protobuf_FieldDescriptorProto_parse(const char *buf, size_t size,
|
1817
1962
|
upb_arena *arena) {
|
@@ -1822,63 +1967,65 @@ UPB_INLINE char *google_protobuf_FieldDescriptorProto_serialize(const google_pro
|
|
1822
1967
|
return upb_encode(msg, &google_protobuf_FieldDescriptorProto_msginit, arena, len);
|
1823
1968
|
}
|
1824
1969
|
|
1825
|
-
UPB_INLINE bool google_protobuf_FieldDescriptorProto_has_name(const google_protobuf_FieldDescriptorProto *msg) { return _upb_has_field(msg,
|
1826
|
-
UPB_INLINE upb_strview google_protobuf_FieldDescriptorProto_name(const google_protobuf_FieldDescriptorProto *msg) { return
|
1827
|
-
UPB_INLINE bool google_protobuf_FieldDescriptorProto_has_extendee(const google_protobuf_FieldDescriptorProto *msg) { return _upb_has_field(msg,
|
1828
|
-
UPB_INLINE upb_strview google_protobuf_FieldDescriptorProto_extendee(const google_protobuf_FieldDescriptorProto *msg) { return
|
1970
|
+
UPB_INLINE bool google_protobuf_FieldDescriptorProto_has_name(const google_protobuf_FieldDescriptorProto *msg) { return _upb_has_field(msg, 6); }
|
1971
|
+
UPB_INLINE upb_strview google_protobuf_FieldDescriptorProto_name(const google_protobuf_FieldDescriptorProto *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(36, 40), upb_strview); }
|
1972
|
+
UPB_INLINE bool google_protobuf_FieldDescriptorProto_has_extendee(const google_protobuf_FieldDescriptorProto *msg) { return _upb_has_field(msg, 7); }
|
1973
|
+
UPB_INLINE upb_strview google_protobuf_FieldDescriptorProto_extendee(const google_protobuf_FieldDescriptorProto *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(44, 56), upb_strview); }
|
1829
1974
|
UPB_INLINE bool google_protobuf_FieldDescriptorProto_has_number(const google_protobuf_FieldDescriptorProto *msg) { return _upb_has_field(msg, 3); }
|
1830
|
-
UPB_INLINE int32_t google_protobuf_FieldDescriptorProto_number(const google_protobuf_FieldDescriptorProto *msg) { return
|
1975
|
+
UPB_INLINE int32_t google_protobuf_FieldDescriptorProto_number(const google_protobuf_FieldDescriptorProto *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(24, 24), int32_t); }
|
1831
1976
|
UPB_INLINE bool google_protobuf_FieldDescriptorProto_has_label(const google_protobuf_FieldDescriptorProto *msg) { return _upb_has_field(msg, 1); }
|
1832
|
-
UPB_INLINE int32_t google_protobuf_FieldDescriptorProto_label(const google_protobuf_FieldDescriptorProto *msg) { return
|
1977
|
+
UPB_INLINE int32_t google_protobuf_FieldDescriptorProto_label(const google_protobuf_FieldDescriptorProto *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(8, 8), int32_t); }
|
1833
1978
|
UPB_INLINE bool google_protobuf_FieldDescriptorProto_has_type(const google_protobuf_FieldDescriptorProto *msg) { return _upb_has_field(msg, 2); }
|
1834
|
-
UPB_INLINE int32_t google_protobuf_FieldDescriptorProto_type(const google_protobuf_FieldDescriptorProto *msg) { return
|
1835
|
-
UPB_INLINE bool google_protobuf_FieldDescriptorProto_has_type_name(const google_protobuf_FieldDescriptorProto *msg) { return _upb_has_field(msg,
|
1836
|
-
UPB_INLINE upb_strview google_protobuf_FieldDescriptorProto_type_name(const google_protobuf_FieldDescriptorProto *msg) { return
|
1837
|
-
UPB_INLINE bool google_protobuf_FieldDescriptorProto_has_default_value(const google_protobuf_FieldDescriptorProto *msg) { return _upb_has_field(msg,
|
1838
|
-
UPB_INLINE upb_strview google_protobuf_FieldDescriptorProto_default_value(const google_protobuf_FieldDescriptorProto *msg) { return
|
1839
|
-
UPB_INLINE bool google_protobuf_FieldDescriptorProto_has_options(const google_protobuf_FieldDescriptorProto *msg) { return _upb_has_field(msg,
|
1840
|
-
UPB_INLINE const google_protobuf_FieldOptions* google_protobuf_FieldDescriptorProto_options(const google_protobuf_FieldDescriptorProto *msg) { return
|
1979
|
+
UPB_INLINE int32_t google_protobuf_FieldDescriptorProto_type(const google_protobuf_FieldDescriptorProto *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(16, 16), int32_t); }
|
1980
|
+
UPB_INLINE bool google_protobuf_FieldDescriptorProto_has_type_name(const google_protobuf_FieldDescriptorProto *msg) { return _upb_has_field(msg, 8); }
|
1981
|
+
UPB_INLINE upb_strview google_protobuf_FieldDescriptorProto_type_name(const google_protobuf_FieldDescriptorProto *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(52, 72), upb_strview); }
|
1982
|
+
UPB_INLINE bool google_protobuf_FieldDescriptorProto_has_default_value(const google_protobuf_FieldDescriptorProto *msg) { return _upb_has_field(msg, 9); }
|
1983
|
+
UPB_INLINE upb_strview google_protobuf_FieldDescriptorProto_default_value(const google_protobuf_FieldDescriptorProto *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(60, 88), upb_strview); }
|
1984
|
+
UPB_INLINE bool google_protobuf_FieldDescriptorProto_has_options(const google_protobuf_FieldDescriptorProto *msg) { return _upb_has_field(msg, 11); }
|
1985
|
+
UPB_INLINE const google_protobuf_FieldOptions* google_protobuf_FieldDescriptorProto_options(const google_protobuf_FieldDescriptorProto *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(76, 120), const google_protobuf_FieldOptions*); }
|
1841
1986
|
UPB_INLINE bool google_protobuf_FieldDescriptorProto_has_oneof_index(const google_protobuf_FieldDescriptorProto *msg) { return _upb_has_field(msg, 4); }
|
1842
|
-
UPB_INLINE int32_t google_protobuf_FieldDescriptorProto_oneof_index(const google_protobuf_FieldDescriptorProto *msg) { return
|
1843
|
-
UPB_INLINE bool google_protobuf_FieldDescriptorProto_has_json_name(const google_protobuf_FieldDescriptorProto *msg) { return _upb_has_field(msg,
|
1844
|
-
UPB_INLINE upb_strview google_protobuf_FieldDescriptorProto_json_name(const google_protobuf_FieldDescriptorProto *msg) { return
|
1987
|
+
UPB_INLINE int32_t google_protobuf_FieldDescriptorProto_oneof_index(const google_protobuf_FieldDescriptorProto *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(28, 28), int32_t); }
|
1988
|
+
UPB_INLINE bool google_protobuf_FieldDescriptorProto_has_json_name(const google_protobuf_FieldDescriptorProto *msg) { return _upb_has_field(msg, 10); }
|
1989
|
+
UPB_INLINE upb_strview google_protobuf_FieldDescriptorProto_json_name(const google_protobuf_FieldDescriptorProto *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(68, 104), upb_strview); }
|
1990
|
+
UPB_INLINE bool google_protobuf_FieldDescriptorProto_has_proto3_optional(const google_protobuf_FieldDescriptorProto *msg) { return _upb_has_field(msg, 5); }
|
1991
|
+
UPB_INLINE bool google_protobuf_FieldDescriptorProto_proto3_optional(const google_protobuf_FieldDescriptorProto *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(32, 32), bool); }
|
1845
1992
|
|
1846
1993
|
UPB_INLINE void google_protobuf_FieldDescriptorProto_set_name(google_protobuf_FieldDescriptorProto *msg, upb_strview value) {
|
1847
|
-
_upb_sethas(msg,
|
1848
|
-
|
1994
|
+
_upb_sethas(msg, 6);
|
1995
|
+
*UPB_PTR_AT(msg, UPB_SIZE(36, 40), upb_strview) = value;
|
1849
1996
|
}
|
1850
1997
|
UPB_INLINE void google_protobuf_FieldDescriptorProto_set_extendee(google_protobuf_FieldDescriptorProto *msg, upb_strview value) {
|
1851
|
-
_upb_sethas(msg,
|
1852
|
-
|
1998
|
+
_upb_sethas(msg, 7);
|
1999
|
+
*UPB_PTR_AT(msg, UPB_SIZE(44, 56), upb_strview) = value;
|
1853
2000
|
}
|
1854
2001
|
UPB_INLINE void google_protobuf_FieldDescriptorProto_set_number(google_protobuf_FieldDescriptorProto *msg, int32_t value) {
|
1855
2002
|
_upb_sethas(msg, 3);
|
1856
|
-
|
2003
|
+
*UPB_PTR_AT(msg, UPB_SIZE(24, 24), int32_t) = value;
|
1857
2004
|
}
|
1858
2005
|
UPB_INLINE void google_protobuf_FieldDescriptorProto_set_label(google_protobuf_FieldDescriptorProto *msg, int32_t value) {
|
1859
2006
|
_upb_sethas(msg, 1);
|
1860
|
-
|
2007
|
+
*UPB_PTR_AT(msg, UPB_SIZE(8, 8), int32_t) = value;
|
1861
2008
|
}
|
1862
2009
|
UPB_INLINE void google_protobuf_FieldDescriptorProto_set_type(google_protobuf_FieldDescriptorProto *msg, int32_t value) {
|
1863
2010
|
_upb_sethas(msg, 2);
|
1864
|
-
|
2011
|
+
*UPB_PTR_AT(msg, UPB_SIZE(16, 16), int32_t) = value;
|
1865
2012
|
}
|
1866
2013
|
UPB_INLINE void google_protobuf_FieldDescriptorProto_set_type_name(google_protobuf_FieldDescriptorProto *msg, upb_strview value) {
|
1867
|
-
_upb_sethas(msg,
|
1868
|
-
|
2014
|
+
_upb_sethas(msg, 8);
|
2015
|
+
*UPB_PTR_AT(msg, UPB_SIZE(52, 72), upb_strview) = value;
|
1869
2016
|
}
|
1870
2017
|
UPB_INLINE void google_protobuf_FieldDescriptorProto_set_default_value(google_protobuf_FieldDescriptorProto *msg, upb_strview value) {
|
1871
|
-
_upb_sethas(msg,
|
1872
|
-
|
2018
|
+
_upb_sethas(msg, 9);
|
2019
|
+
*UPB_PTR_AT(msg, UPB_SIZE(60, 88), upb_strview) = value;
|
1873
2020
|
}
|
1874
2021
|
UPB_INLINE void google_protobuf_FieldDescriptorProto_set_options(google_protobuf_FieldDescriptorProto *msg, google_protobuf_FieldOptions* value) {
|
1875
|
-
_upb_sethas(msg,
|
1876
|
-
|
2022
|
+
_upb_sethas(msg, 11);
|
2023
|
+
*UPB_PTR_AT(msg, UPB_SIZE(76, 120), google_protobuf_FieldOptions*) = value;
|
1877
2024
|
}
|
1878
2025
|
UPB_INLINE struct google_protobuf_FieldOptions* google_protobuf_FieldDescriptorProto_mutable_options(google_protobuf_FieldDescriptorProto *msg, upb_arena *arena) {
|
1879
2026
|
struct google_protobuf_FieldOptions* sub = (struct google_protobuf_FieldOptions*)google_protobuf_FieldDescriptorProto_options(msg);
|
1880
2027
|
if (sub == NULL) {
|
1881
|
-
sub = (struct google_protobuf_FieldOptions*)
|
2028
|
+
sub = (struct google_protobuf_FieldOptions*)_upb_msg_new(&google_protobuf_FieldOptions_msginit, arena);
|
1882
2029
|
if (!sub) return NULL;
|
1883
2030
|
google_protobuf_FieldDescriptorProto_set_options(msg, sub);
|
1884
2031
|
}
|
@@ -1886,17 +2033,21 @@ UPB_INLINE struct google_protobuf_FieldOptions* google_protobuf_FieldDescriptorP
|
|
1886
2033
|
}
|
1887
2034
|
UPB_INLINE void google_protobuf_FieldDescriptorProto_set_oneof_index(google_protobuf_FieldDescriptorProto *msg, int32_t value) {
|
1888
2035
|
_upb_sethas(msg, 4);
|
1889
|
-
|
2036
|
+
*UPB_PTR_AT(msg, UPB_SIZE(28, 28), int32_t) = value;
|
1890
2037
|
}
|
1891
2038
|
UPB_INLINE void google_protobuf_FieldDescriptorProto_set_json_name(google_protobuf_FieldDescriptorProto *msg, upb_strview value) {
|
1892
|
-
_upb_sethas(msg,
|
1893
|
-
|
2039
|
+
_upb_sethas(msg, 10);
|
2040
|
+
*UPB_PTR_AT(msg, UPB_SIZE(68, 104), upb_strview) = value;
|
2041
|
+
}
|
2042
|
+
UPB_INLINE void google_protobuf_FieldDescriptorProto_set_proto3_optional(google_protobuf_FieldDescriptorProto *msg, bool value) {
|
2043
|
+
_upb_sethas(msg, 5);
|
2044
|
+
*UPB_PTR_AT(msg, UPB_SIZE(32, 32), bool) = value;
|
1894
2045
|
}
|
1895
2046
|
|
1896
2047
|
/* google.protobuf.OneofDescriptorProto */
|
1897
2048
|
|
1898
2049
|
UPB_INLINE google_protobuf_OneofDescriptorProto *google_protobuf_OneofDescriptorProto_new(upb_arena *arena) {
|
1899
|
-
return (google_protobuf_OneofDescriptorProto *)
|
2050
|
+
return (google_protobuf_OneofDescriptorProto *)_upb_msg_new(&google_protobuf_OneofDescriptorProto_msginit, arena);
|
1900
2051
|
}
|
1901
2052
|
UPB_INLINE google_protobuf_OneofDescriptorProto *google_protobuf_OneofDescriptorProto_parse(const char *buf, size_t size,
|
1902
2053
|
upb_arena *arena) {
|
@@ -1908,22 +2059,22 @@ UPB_INLINE char *google_protobuf_OneofDescriptorProto_serialize(const google_pro
|
|
1908
2059
|
}
|
1909
2060
|
|
1910
2061
|
UPB_INLINE bool google_protobuf_OneofDescriptorProto_has_name(const google_protobuf_OneofDescriptorProto *msg) { return _upb_has_field(msg, 1); }
|
1911
|
-
UPB_INLINE upb_strview google_protobuf_OneofDescriptorProto_name(const google_protobuf_OneofDescriptorProto *msg) { return
|
2062
|
+
UPB_INLINE upb_strview google_protobuf_OneofDescriptorProto_name(const google_protobuf_OneofDescriptorProto *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_strview); }
|
1912
2063
|
UPB_INLINE bool google_protobuf_OneofDescriptorProto_has_options(const google_protobuf_OneofDescriptorProto *msg) { return _upb_has_field(msg, 2); }
|
1913
|
-
UPB_INLINE const google_protobuf_OneofOptions* google_protobuf_OneofDescriptorProto_options(const google_protobuf_OneofDescriptorProto *msg) { return
|
2064
|
+
UPB_INLINE const google_protobuf_OneofOptions* google_protobuf_OneofDescriptorProto_options(const google_protobuf_OneofDescriptorProto *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(12, 24), const google_protobuf_OneofOptions*); }
|
1914
2065
|
|
1915
2066
|
UPB_INLINE void google_protobuf_OneofDescriptorProto_set_name(google_protobuf_OneofDescriptorProto *msg, upb_strview value) {
|
1916
2067
|
_upb_sethas(msg, 1);
|
1917
|
-
|
2068
|
+
*UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_strview) = value;
|
1918
2069
|
}
|
1919
2070
|
UPB_INLINE void google_protobuf_OneofDescriptorProto_set_options(google_protobuf_OneofDescriptorProto *msg, google_protobuf_OneofOptions* value) {
|
1920
2071
|
_upb_sethas(msg, 2);
|
1921
|
-
|
2072
|
+
*UPB_PTR_AT(msg, UPB_SIZE(12, 24), google_protobuf_OneofOptions*) = value;
|
1922
2073
|
}
|
1923
2074
|
UPB_INLINE struct google_protobuf_OneofOptions* google_protobuf_OneofDescriptorProto_mutable_options(google_protobuf_OneofDescriptorProto *msg, upb_arena *arena) {
|
1924
2075
|
struct google_protobuf_OneofOptions* sub = (struct google_protobuf_OneofOptions*)google_protobuf_OneofDescriptorProto_options(msg);
|
1925
2076
|
if (sub == NULL) {
|
1926
|
-
sub = (struct google_protobuf_OneofOptions*)
|
2077
|
+
sub = (struct google_protobuf_OneofOptions*)_upb_msg_new(&google_protobuf_OneofOptions_msginit, arena);
|
1927
2078
|
if (!sub) return NULL;
|
1928
2079
|
google_protobuf_OneofDescriptorProto_set_options(msg, sub);
|
1929
2080
|
}
|
@@ -1933,7 +2084,7 @@ UPB_INLINE struct google_protobuf_OneofOptions* google_protobuf_OneofDescriptorP
|
|
1933
2084
|
/* google.protobuf.EnumDescriptorProto */
|
1934
2085
|
|
1935
2086
|
UPB_INLINE google_protobuf_EnumDescriptorProto *google_protobuf_EnumDescriptorProto_new(upb_arena *arena) {
|
1936
|
-
return (google_protobuf_EnumDescriptorProto *)
|
2087
|
+
return (google_protobuf_EnumDescriptorProto *)_upb_msg_new(&google_protobuf_EnumDescriptorProto_msginit, arena);
|
1937
2088
|
}
|
1938
2089
|
UPB_INLINE google_protobuf_EnumDescriptorProto *google_protobuf_EnumDescriptorProto_parse(const char *buf, size_t size,
|
1939
2090
|
upb_arena *arena) {
|
@@ -1945,25 +2096,27 @@ UPB_INLINE char *google_protobuf_EnumDescriptorProto_serialize(const google_prot
|
|
1945
2096
|
}
|
1946
2097
|
|
1947
2098
|
UPB_INLINE bool google_protobuf_EnumDescriptorProto_has_name(const google_protobuf_EnumDescriptorProto *msg) { return _upb_has_field(msg, 1); }
|
1948
|
-
UPB_INLINE upb_strview google_protobuf_EnumDescriptorProto_name(const google_protobuf_EnumDescriptorProto *msg) { return
|
2099
|
+
UPB_INLINE upb_strview google_protobuf_EnumDescriptorProto_name(const google_protobuf_EnumDescriptorProto *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_strview); }
|
2100
|
+
UPB_INLINE bool google_protobuf_EnumDescriptorProto_has_value(const google_protobuf_EnumDescriptorProto *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(16, 32)); }
|
1949
2101
|
UPB_INLINE const google_protobuf_EnumValueDescriptorProto* const* google_protobuf_EnumDescriptorProto_value(const google_protobuf_EnumDescriptorProto *msg, size_t *len) { return (const google_protobuf_EnumValueDescriptorProto* const*)_upb_array_accessor(msg, UPB_SIZE(16, 32), len); }
|
1950
2102
|
UPB_INLINE bool google_protobuf_EnumDescriptorProto_has_options(const google_protobuf_EnumDescriptorProto *msg) { return _upb_has_field(msg, 2); }
|
1951
|
-
UPB_INLINE const google_protobuf_EnumOptions* google_protobuf_EnumDescriptorProto_options(const google_protobuf_EnumDescriptorProto *msg) { return
|
2103
|
+
UPB_INLINE const google_protobuf_EnumOptions* google_protobuf_EnumDescriptorProto_options(const google_protobuf_EnumDescriptorProto *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(12, 24), const google_protobuf_EnumOptions*); }
|
2104
|
+
UPB_INLINE bool google_protobuf_EnumDescriptorProto_has_reserved_range(const google_protobuf_EnumDescriptorProto *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(20, 40)); }
|
1952
2105
|
UPB_INLINE const google_protobuf_EnumDescriptorProto_EnumReservedRange* const* google_protobuf_EnumDescriptorProto_reserved_range(const google_protobuf_EnumDescriptorProto *msg, size_t *len) { return (const google_protobuf_EnumDescriptorProto_EnumReservedRange* const*)_upb_array_accessor(msg, UPB_SIZE(20, 40), len); }
|
1953
2106
|
UPB_INLINE upb_strview const* google_protobuf_EnumDescriptorProto_reserved_name(const google_protobuf_EnumDescriptorProto *msg, size_t *len) { return (upb_strview const*)_upb_array_accessor(msg, UPB_SIZE(24, 48), len); }
|
1954
2107
|
|
1955
2108
|
UPB_INLINE void google_protobuf_EnumDescriptorProto_set_name(google_protobuf_EnumDescriptorProto *msg, upb_strview value) {
|
1956
2109
|
_upb_sethas(msg, 1);
|
1957
|
-
|
2110
|
+
*UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_strview) = value;
|
1958
2111
|
}
|
1959
2112
|
UPB_INLINE google_protobuf_EnumValueDescriptorProto** google_protobuf_EnumDescriptorProto_mutable_value(google_protobuf_EnumDescriptorProto *msg, size_t *len) {
|
1960
2113
|
return (google_protobuf_EnumValueDescriptorProto**)_upb_array_mutable_accessor(msg, UPB_SIZE(16, 32), len);
|
1961
2114
|
}
|
1962
2115
|
UPB_INLINE google_protobuf_EnumValueDescriptorProto** google_protobuf_EnumDescriptorProto_resize_value(google_protobuf_EnumDescriptorProto *msg, size_t len, upb_arena *arena) {
|
1963
|
-
return (google_protobuf_EnumValueDescriptorProto**)_upb_array_resize_accessor(msg, UPB_SIZE(16, 32), len,
|
2116
|
+
return (google_protobuf_EnumValueDescriptorProto**)_upb_array_resize_accessor(msg, UPB_SIZE(16, 32), len, UPB_TYPE_MESSAGE, arena);
|
1964
2117
|
}
|
1965
2118
|
UPB_INLINE struct google_protobuf_EnumValueDescriptorProto* google_protobuf_EnumDescriptorProto_add_value(google_protobuf_EnumDescriptorProto *msg, upb_arena *arena) {
|
1966
|
-
struct google_protobuf_EnumValueDescriptorProto* sub = (struct google_protobuf_EnumValueDescriptorProto*)
|
2119
|
+
struct google_protobuf_EnumValueDescriptorProto* sub = (struct google_protobuf_EnumValueDescriptorProto*)_upb_msg_new(&google_protobuf_EnumValueDescriptorProto_msginit, arena);
|
1967
2120
|
bool ok = _upb_array_append_accessor(
|
1968
2121
|
msg, UPB_SIZE(16, 32), UPB_SIZE(4, 8), UPB_TYPE_MESSAGE, &sub, arena);
|
1969
2122
|
if (!ok) return NULL;
|
@@ -1971,12 +2124,12 @@ UPB_INLINE struct google_protobuf_EnumValueDescriptorProto* google_protobuf_Enum
|
|
1971
2124
|
}
|
1972
2125
|
UPB_INLINE void google_protobuf_EnumDescriptorProto_set_options(google_protobuf_EnumDescriptorProto *msg, google_protobuf_EnumOptions* value) {
|
1973
2126
|
_upb_sethas(msg, 2);
|
1974
|
-
|
2127
|
+
*UPB_PTR_AT(msg, UPB_SIZE(12, 24), google_protobuf_EnumOptions*) = value;
|
1975
2128
|
}
|
1976
2129
|
UPB_INLINE struct google_protobuf_EnumOptions* google_protobuf_EnumDescriptorProto_mutable_options(google_protobuf_EnumDescriptorProto *msg, upb_arena *arena) {
|
1977
2130
|
struct google_protobuf_EnumOptions* sub = (struct google_protobuf_EnumOptions*)google_protobuf_EnumDescriptorProto_options(msg);
|
1978
2131
|
if (sub == NULL) {
|
1979
|
-
sub = (struct google_protobuf_EnumOptions*)
|
2132
|
+
sub = (struct google_protobuf_EnumOptions*)_upb_msg_new(&google_protobuf_EnumOptions_msginit, arena);
|
1980
2133
|
if (!sub) return NULL;
|
1981
2134
|
google_protobuf_EnumDescriptorProto_set_options(msg, sub);
|
1982
2135
|
}
|
@@ -1986,10 +2139,10 @@ UPB_INLINE google_protobuf_EnumDescriptorProto_EnumReservedRange** google_protob
|
|
1986
2139
|
return (google_protobuf_EnumDescriptorProto_EnumReservedRange**)_upb_array_mutable_accessor(msg, UPB_SIZE(20, 40), len);
|
1987
2140
|
}
|
1988
2141
|
UPB_INLINE google_protobuf_EnumDescriptorProto_EnumReservedRange** google_protobuf_EnumDescriptorProto_resize_reserved_range(google_protobuf_EnumDescriptorProto *msg, size_t len, upb_arena *arena) {
|
1989
|
-
return (google_protobuf_EnumDescriptorProto_EnumReservedRange**)_upb_array_resize_accessor(msg, UPB_SIZE(20, 40), len,
|
2142
|
+
return (google_protobuf_EnumDescriptorProto_EnumReservedRange**)_upb_array_resize_accessor(msg, UPB_SIZE(20, 40), len, UPB_TYPE_MESSAGE, arena);
|
1990
2143
|
}
|
1991
2144
|
UPB_INLINE struct google_protobuf_EnumDescriptorProto_EnumReservedRange* google_protobuf_EnumDescriptorProto_add_reserved_range(google_protobuf_EnumDescriptorProto *msg, upb_arena *arena) {
|
1992
|
-
struct google_protobuf_EnumDescriptorProto_EnumReservedRange* sub = (struct google_protobuf_EnumDescriptorProto_EnumReservedRange*)
|
2145
|
+
struct google_protobuf_EnumDescriptorProto_EnumReservedRange* sub = (struct google_protobuf_EnumDescriptorProto_EnumReservedRange*)_upb_msg_new(&google_protobuf_EnumDescriptorProto_EnumReservedRange_msginit, arena);
|
1993
2146
|
bool ok = _upb_array_append_accessor(
|
1994
2147
|
msg, UPB_SIZE(20, 40), UPB_SIZE(4, 8), UPB_TYPE_MESSAGE, &sub, arena);
|
1995
2148
|
if (!ok) return NULL;
|
@@ -1999,17 +2152,17 @@ UPB_INLINE upb_strview* google_protobuf_EnumDescriptorProto_mutable_reserved_nam
|
|
1999
2152
|
return (upb_strview*)_upb_array_mutable_accessor(msg, UPB_SIZE(24, 48), len);
|
2000
2153
|
}
|
2001
2154
|
UPB_INLINE upb_strview* google_protobuf_EnumDescriptorProto_resize_reserved_name(google_protobuf_EnumDescriptorProto *msg, size_t len, upb_arena *arena) {
|
2002
|
-
return (upb_strview*)_upb_array_resize_accessor(msg, UPB_SIZE(24, 48), len,
|
2155
|
+
return (upb_strview*)_upb_array_resize_accessor(msg, UPB_SIZE(24, 48), len, UPB_TYPE_STRING, arena);
|
2003
2156
|
}
|
2004
2157
|
UPB_INLINE bool google_protobuf_EnumDescriptorProto_add_reserved_name(google_protobuf_EnumDescriptorProto *msg, upb_strview val, upb_arena *arena) {
|
2005
|
-
return _upb_array_append_accessor(
|
2006
|
-
|
2158
|
+
return _upb_array_append_accessor(msg, UPB_SIZE(24, 48), UPB_SIZE(8, 16), UPB_TYPE_STRING, &val,
|
2159
|
+
arena);
|
2007
2160
|
}
|
2008
2161
|
|
2009
2162
|
/* google.protobuf.EnumDescriptorProto.EnumReservedRange */
|
2010
2163
|
|
2011
2164
|
UPB_INLINE google_protobuf_EnumDescriptorProto_EnumReservedRange *google_protobuf_EnumDescriptorProto_EnumReservedRange_new(upb_arena *arena) {
|
2012
|
-
return (google_protobuf_EnumDescriptorProto_EnumReservedRange *)
|
2165
|
+
return (google_protobuf_EnumDescriptorProto_EnumReservedRange *)_upb_msg_new(&google_protobuf_EnumDescriptorProto_EnumReservedRange_msginit, arena);
|
2013
2166
|
}
|
2014
2167
|
UPB_INLINE google_protobuf_EnumDescriptorProto_EnumReservedRange *google_protobuf_EnumDescriptorProto_EnumReservedRange_parse(const char *buf, size_t size,
|
2015
2168
|
upb_arena *arena) {
|
@@ -2021,23 +2174,23 @@ UPB_INLINE char *google_protobuf_EnumDescriptorProto_EnumReservedRange_serialize
|
|
2021
2174
|
}
|
2022
2175
|
|
2023
2176
|
UPB_INLINE bool google_protobuf_EnumDescriptorProto_EnumReservedRange_has_start(const google_protobuf_EnumDescriptorProto_EnumReservedRange *msg) { return _upb_has_field(msg, 1); }
|
2024
|
-
UPB_INLINE int32_t google_protobuf_EnumDescriptorProto_EnumReservedRange_start(const google_protobuf_EnumDescriptorProto_EnumReservedRange *msg) { return
|
2177
|
+
UPB_INLINE int32_t google_protobuf_EnumDescriptorProto_EnumReservedRange_start(const google_protobuf_EnumDescriptorProto_EnumReservedRange *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(4, 4), int32_t); }
|
2025
2178
|
UPB_INLINE bool google_protobuf_EnumDescriptorProto_EnumReservedRange_has_end(const google_protobuf_EnumDescriptorProto_EnumReservedRange *msg) { return _upb_has_field(msg, 2); }
|
2026
|
-
UPB_INLINE int32_t google_protobuf_EnumDescriptorProto_EnumReservedRange_end(const google_protobuf_EnumDescriptorProto_EnumReservedRange *msg) { return
|
2179
|
+
UPB_INLINE int32_t google_protobuf_EnumDescriptorProto_EnumReservedRange_end(const google_protobuf_EnumDescriptorProto_EnumReservedRange *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(8, 8), int32_t); }
|
2027
2180
|
|
2028
2181
|
UPB_INLINE void google_protobuf_EnumDescriptorProto_EnumReservedRange_set_start(google_protobuf_EnumDescriptorProto_EnumReservedRange *msg, int32_t value) {
|
2029
2182
|
_upb_sethas(msg, 1);
|
2030
|
-
|
2183
|
+
*UPB_PTR_AT(msg, UPB_SIZE(4, 4), int32_t) = value;
|
2031
2184
|
}
|
2032
2185
|
UPB_INLINE void google_protobuf_EnumDescriptorProto_EnumReservedRange_set_end(google_protobuf_EnumDescriptorProto_EnumReservedRange *msg, int32_t value) {
|
2033
2186
|
_upb_sethas(msg, 2);
|
2034
|
-
|
2187
|
+
*UPB_PTR_AT(msg, UPB_SIZE(8, 8), int32_t) = value;
|
2035
2188
|
}
|
2036
2189
|
|
2037
2190
|
/* google.protobuf.EnumValueDescriptorProto */
|
2038
2191
|
|
2039
2192
|
UPB_INLINE google_protobuf_EnumValueDescriptorProto *google_protobuf_EnumValueDescriptorProto_new(upb_arena *arena) {
|
2040
|
-
return (google_protobuf_EnumValueDescriptorProto *)
|
2193
|
+
return (google_protobuf_EnumValueDescriptorProto *)_upb_msg_new(&google_protobuf_EnumValueDescriptorProto_msginit, arena);
|
2041
2194
|
}
|
2042
2195
|
UPB_INLINE google_protobuf_EnumValueDescriptorProto *google_protobuf_EnumValueDescriptorProto_parse(const char *buf, size_t size,
|
2043
2196
|
upb_arena *arena) {
|
@@ -2049,28 +2202,28 @@ UPB_INLINE char *google_protobuf_EnumValueDescriptorProto_serialize(const google
|
|
2049
2202
|
}
|
2050
2203
|
|
2051
2204
|
UPB_INLINE bool google_protobuf_EnumValueDescriptorProto_has_name(const google_protobuf_EnumValueDescriptorProto *msg) { return _upb_has_field(msg, 2); }
|
2052
|
-
UPB_INLINE upb_strview google_protobuf_EnumValueDescriptorProto_name(const google_protobuf_EnumValueDescriptorProto *msg) { return
|
2205
|
+
UPB_INLINE upb_strview google_protobuf_EnumValueDescriptorProto_name(const google_protobuf_EnumValueDescriptorProto *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(8, 8), upb_strview); }
|
2053
2206
|
UPB_INLINE bool google_protobuf_EnumValueDescriptorProto_has_number(const google_protobuf_EnumValueDescriptorProto *msg) { return _upb_has_field(msg, 1); }
|
2054
|
-
UPB_INLINE int32_t google_protobuf_EnumValueDescriptorProto_number(const google_protobuf_EnumValueDescriptorProto *msg) { return
|
2207
|
+
UPB_INLINE int32_t google_protobuf_EnumValueDescriptorProto_number(const google_protobuf_EnumValueDescriptorProto *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(4, 4), int32_t); }
|
2055
2208
|
UPB_INLINE bool google_protobuf_EnumValueDescriptorProto_has_options(const google_protobuf_EnumValueDescriptorProto *msg) { return _upb_has_field(msg, 3); }
|
2056
|
-
UPB_INLINE const google_protobuf_EnumValueOptions* google_protobuf_EnumValueDescriptorProto_options(const google_protobuf_EnumValueDescriptorProto *msg) { return
|
2209
|
+
UPB_INLINE const google_protobuf_EnumValueOptions* google_protobuf_EnumValueDescriptorProto_options(const google_protobuf_EnumValueDescriptorProto *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(16, 24), const google_protobuf_EnumValueOptions*); }
|
2057
2210
|
|
2058
2211
|
UPB_INLINE void google_protobuf_EnumValueDescriptorProto_set_name(google_protobuf_EnumValueDescriptorProto *msg, upb_strview value) {
|
2059
2212
|
_upb_sethas(msg, 2);
|
2060
|
-
|
2213
|
+
*UPB_PTR_AT(msg, UPB_SIZE(8, 8), upb_strview) = value;
|
2061
2214
|
}
|
2062
2215
|
UPB_INLINE void google_protobuf_EnumValueDescriptorProto_set_number(google_protobuf_EnumValueDescriptorProto *msg, int32_t value) {
|
2063
2216
|
_upb_sethas(msg, 1);
|
2064
|
-
|
2217
|
+
*UPB_PTR_AT(msg, UPB_SIZE(4, 4), int32_t) = value;
|
2065
2218
|
}
|
2066
2219
|
UPB_INLINE void google_protobuf_EnumValueDescriptorProto_set_options(google_protobuf_EnumValueDescriptorProto *msg, google_protobuf_EnumValueOptions* value) {
|
2067
2220
|
_upb_sethas(msg, 3);
|
2068
|
-
|
2221
|
+
*UPB_PTR_AT(msg, UPB_SIZE(16, 24), google_protobuf_EnumValueOptions*) = value;
|
2069
2222
|
}
|
2070
2223
|
UPB_INLINE struct google_protobuf_EnumValueOptions* google_protobuf_EnumValueDescriptorProto_mutable_options(google_protobuf_EnumValueDescriptorProto *msg, upb_arena *arena) {
|
2071
2224
|
struct google_protobuf_EnumValueOptions* sub = (struct google_protobuf_EnumValueOptions*)google_protobuf_EnumValueDescriptorProto_options(msg);
|
2072
2225
|
if (sub == NULL) {
|
2073
|
-
sub = (struct google_protobuf_EnumValueOptions*)
|
2226
|
+
sub = (struct google_protobuf_EnumValueOptions*)_upb_msg_new(&google_protobuf_EnumValueOptions_msginit, arena);
|
2074
2227
|
if (!sub) return NULL;
|
2075
2228
|
google_protobuf_EnumValueDescriptorProto_set_options(msg, sub);
|
2076
2229
|
}
|
@@ -2080,7 +2233,7 @@ UPB_INLINE struct google_protobuf_EnumValueOptions* google_protobuf_EnumValueDes
|
|
2080
2233
|
/* google.protobuf.ServiceDescriptorProto */
|
2081
2234
|
|
2082
2235
|
UPB_INLINE google_protobuf_ServiceDescriptorProto *google_protobuf_ServiceDescriptorProto_new(upb_arena *arena) {
|
2083
|
-
return (google_protobuf_ServiceDescriptorProto *)
|
2236
|
+
return (google_protobuf_ServiceDescriptorProto *)_upb_msg_new(&google_protobuf_ServiceDescriptorProto_msginit, arena);
|
2084
2237
|
}
|
2085
2238
|
UPB_INLINE google_protobuf_ServiceDescriptorProto *google_protobuf_ServiceDescriptorProto_parse(const char *buf, size_t size,
|
2086
2239
|
upb_arena *arena) {
|
@@ -2092,23 +2245,24 @@ UPB_INLINE char *google_protobuf_ServiceDescriptorProto_serialize(const google_p
|
|
2092
2245
|
}
|
2093
2246
|
|
2094
2247
|
UPB_INLINE bool google_protobuf_ServiceDescriptorProto_has_name(const google_protobuf_ServiceDescriptorProto *msg) { return _upb_has_field(msg, 1); }
|
2095
|
-
UPB_INLINE upb_strview google_protobuf_ServiceDescriptorProto_name(const google_protobuf_ServiceDescriptorProto *msg) { return
|
2248
|
+
UPB_INLINE upb_strview google_protobuf_ServiceDescriptorProto_name(const google_protobuf_ServiceDescriptorProto *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_strview); }
|
2249
|
+
UPB_INLINE bool google_protobuf_ServiceDescriptorProto_has_method(const google_protobuf_ServiceDescriptorProto *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(16, 32)); }
|
2096
2250
|
UPB_INLINE const google_protobuf_MethodDescriptorProto* const* google_protobuf_ServiceDescriptorProto_method(const google_protobuf_ServiceDescriptorProto *msg, size_t *len) { return (const google_protobuf_MethodDescriptorProto* const*)_upb_array_accessor(msg, UPB_SIZE(16, 32), len); }
|
2097
2251
|
UPB_INLINE bool google_protobuf_ServiceDescriptorProto_has_options(const google_protobuf_ServiceDescriptorProto *msg) { return _upb_has_field(msg, 2); }
|
2098
|
-
UPB_INLINE const google_protobuf_ServiceOptions* google_protobuf_ServiceDescriptorProto_options(const google_protobuf_ServiceDescriptorProto *msg) { return
|
2252
|
+
UPB_INLINE const google_protobuf_ServiceOptions* google_protobuf_ServiceDescriptorProto_options(const google_protobuf_ServiceDescriptorProto *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(12, 24), const google_protobuf_ServiceOptions*); }
|
2099
2253
|
|
2100
2254
|
UPB_INLINE void google_protobuf_ServiceDescriptorProto_set_name(google_protobuf_ServiceDescriptorProto *msg, upb_strview value) {
|
2101
2255
|
_upb_sethas(msg, 1);
|
2102
|
-
|
2256
|
+
*UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_strview) = value;
|
2103
2257
|
}
|
2104
2258
|
UPB_INLINE google_protobuf_MethodDescriptorProto** google_protobuf_ServiceDescriptorProto_mutable_method(google_protobuf_ServiceDescriptorProto *msg, size_t *len) {
|
2105
2259
|
return (google_protobuf_MethodDescriptorProto**)_upb_array_mutable_accessor(msg, UPB_SIZE(16, 32), len);
|
2106
2260
|
}
|
2107
2261
|
UPB_INLINE google_protobuf_MethodDescriptorProto** google_protobuf_ServiceDescriptorProto_resize_method(google_protobuf_ServiceDescriptorProto *msg, size_t len, upb_arena *arena) {
|
2108
|
-
return (google_protobuf_MethodDescriptorProto**)_upb_array_resize_accessor(msg, UPB_SIZE(16, 32), len,
|
2262
|
+
return (google_protobuf_MethodDescriptorProto**)_upb_array_resize_accessor(msg, UPB_SIZE(16, 32), len, UPB_TYPE_MESSAGE, arena);
|
2109
2263
|
}
|
2110
2264
|
UPB_INLINE struct google_protobuf_MethodDescriptorProto* google_protobuf_ServiceDescriptorProto_add_method(google_protobuf_ServiceDescriptorProto *msg, upb_arena *arena) {
|
2111
|
-
struct google_protobuf_MethodDescriptorProto* sub = (struct google_protobuf_MethodDescriptorProto*)
|
2265
|
+
struct google_protobuf_MethodDescriptorProto* sub = (struct google_protobuf_MethodDescriptorProto*)_upb_msg_new(&google_protobuf_MethodDescriptorProto_msginit, arena);
|
2112
2266
|
bool ok = _upb_array_append_accessor(
|
2113
2267
|
msg, UPB_SIZE(16, 32), UPB_SIZE(4, 8), UPB_TYPE_MESSAGE, &sub, arena);
|
2114
2268
|
if (!ok) return NULL;
|
@@ -2116,12 +2270,12 @@ UPB_INLINE struct google_protobuf_MethodDescriptorProto* google_protobuf_Service
|
|
2116
2270
|
}
|
2117
2271
|
UPB_INLINE void google_protobuf_ServiceDescriptorProto_set_options(google_protobuf_ServiceDescriptorProto *msg, google_protobuf_ServiceOptions* value) {
|
2118
2272
|
_upb_sethas(msg, 2);
|
2119
|
-
|
2273
|
+
*UPB_PTR_AT(msg, UPB_SIZE(12, 24), google_protobuf_ServiceOptions*) = value;
|
2120
2274
|
}
|
2121
2275
|
UPB_INLINE struct google_protobuf_ServiceOptions* google_protobuf_ServiceDescriptorProto_mutable_options(google_protobuf_ServiceDescriptorProto *msg, upb_arena *arena) {
|
2122
2276
|
struct google_protobuf_ServiceOptions* sub = (struct google_protobuf_ServiceOptions*)google_protobuf_ServiceDescriptorProto_options(msg);
|
2123
2277
|
if (sub == NULL) {
|
2124
|
-
sub = (struct google_protobuf_ServiceOptions*)
|
2278
|
+
sub = (struct google_protobuf_ServiceOptions*)_upb_msg_new(&google_protobuf_ServiceOptions_msginit, arena);
|
2125
2279
|
if (!sub) return NULL;
|
2126
2280
|
google_protobuf_ServiceDescriptorProto_set_options(msg, sub);
|
2127
2281
|
}
|
@@ -2131,7 +2285,7 @@ UPB_INLINE struct google_protobuf_ServiceOptions* google_protobuf_ServiceDescrip
|
|
2131
2285
|
/* google.protobuf.MethodDescriptorProto */
|
2132
2286
|
|
2133
2287
|
UPB_INLINE google_protobuf_MethodDescriptorProto *google_protobuf_MethodDescriptorProto_new(upb_arena *arena) {
|
2134
|
-
return (google_protobuf_MethodDescriptorProto *)
|
2288
|
+
return (google_protobuf_MethodDescriptorProto *)_upb_msg_new(&google_protobuf_MethodDescriptorProto_msginit, arena);
|
2135
2289
|
}
|
2136
2290
|
UPB_INLINE google_protobuf_MethodDescriptorProto *google_protobuf_MethodDescriptorProto_parse(const char *buf, size_t size,
|
2137
2291
|
upb_arena *arena) {
|
@@ -2143,38 +2297,38 @@ UPB_INLINE char *google_protobuf_MethodDescriptorProto_serialize(const google_pr
|
|
2143
2297
|
}
|
2144
2298
|
|
2145
2299
|
UPB_INLINE bool google_protobuf_MethodDescriptorProto_has_name(const google_protobuf_MethodDescriptorProto *msg) { return _upb_has_field(msg, 3); }
|
2146
|
-
UPB_INLINE upb_strview google_protobuf_MethodDescriptorProto_name(const google_protobuf_MethodDescriptorProto *msg) { return
|
2300
|
+
UPB_INLINE upb_strview google_protobuf_MethodDescriptorProto_name(const google_protobuf_MethodDescriptorProto *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_strview); }
|
2147
2301
|
UPB_INLINE bool google_protobuf_MethodDescriptorProto_has_input_type(const google_protobuf_MethodDescriptorProto *msg) { return _upb_has_field(msg, 4); }
|
2148
|
-
UPB_INLINE upb_strview google_protobuf_MethodDescriptorProto_input_type(const google_protobuf_MethodDescriptorProto *msg) { return
|
2302
|
+
UPB_INLINE upb_strview google_protobuf_MethodDescriptorProto_input_type(const google_protobuf_MethodDescriptorProto *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(12, 24), upb_strview); }
|
2149
2303
|
UPB_INLINE bool google_protobuf_MethodDescriptorProto_has_output_type(const google_protobuf_MethodDescriptorProto *msg) { return _upb_has_field(msg, 5); }
|
2150
|
-
UPB_INLINE upb_strview google_protobuf_MethodDescriptorProto_output_type(const google_protobuf_MethodDescriptorProto *msg) { return
|
2304
|
+
UPB_INLINE upb_strview google_protobuf_MethodDescriptorProto_output_type(const google_protobuf_MethodDescriptorProto *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(20, 40), upb_strview); }
|
2151
2305
|
UPB_INLINE bool google_protobuf_MethodDescriptorProto_has_options(const google_protobuf_MethodDescriptorProto *msg) { return _upb_has_field(msg, 6); }
|
2152
|
-
UPB_INLINE const google_protobuf_MethodOptions* google_protobuf_MethodDescriptorProto_options(const google_protobuf_MethodDescriptorProto *msg) { return
|
2306
|
+
UPB_INLINE const google_protobuf_MethodOptions* google_protobuf_MethodDescriptorProto_options(const google_protobuf_MethodDescriptorProto *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(28, 56), const google_protobuf_MethodOptions*); }
|
2153
2307
|
UPB_INLINE bool google_protobuf_MethodDescriptorProto_has_client_streaming(const google_protobuf_MethodDescriptorProto *msg) { return _upb_has_field(msg, 1); }
|
2154
|
-
UPB_INLINE bool google_protobuf_MethodDescriptorProto_client_streaming(const google_protobuf_MethodDescriptorProto *msg) { return
|
2308
|
+
UPB_INLINE bool google_protobuf_MethodDescriptorProto_client_streaming(const google_protobuf_MethodDescriptorProto *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(1, 1), bool); }
|
2155
2309
|
UPB_INLINE bool google_protobuf_MethodDescriptorProto_has_server_streaming(const google_protobuf_MethodDescriptorProto *msg) { return _upb_has_field(msg, 2); }
|
2156
|
-
UPB_INLINE bool google_protobuf_MethodDescriptorProto_server_streaming(const google_protobuf_MethodDescriptorProto *msg) { return
|
2310
|
+
UPB_INLINE bool google_protobuf_MethodDescriptorProto_server_streaming(const google_protobuf_MethodDescriptorProto *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(2, 2), bool); }
|
2157
2311
|
|
2158
2312
|
UPB_INLINE void google_protobuf_MethodDescriptorProto_set_name(google_protobuf_MethodDescriptorProto *msg, upb_strview value) {
|
2159
2313
|
_upb_sethas(msg, 3);
|
2160
|
-
|
2314
|
+
*UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_strview) = value;
|
2161
2315
|
}
|
2162
2316
|
UPB_INLINE void google_protobuf_MethodDescriptorProto_set_input_type(google_protobuf_MethodDescriptorProto *msg, upb_strview value) {
|
2163
2317
|
_upb_sethas(msg, 4);
|
2164
|
-
|
2318
|
+
*UPB_PTR_AT(msg, UPB_SIZE(12, 24), upb_strview) = value;
|
2165
2319
|
}
|
2166
2320
|
UPB_INLINE void google_protobuf_MethodDescriptorProto_set_output_type(google_protobuf_MethodDescriptorProto *msg, upb_strview value) {
|
2167
2321
|
_upb_sethas(msg, 5);
|
2168
|
-
|
2322
|
+
*UPB_PTR_AT(msg, UPB_SIZE(20, 40), upb_strview) = value;
|
2169
2323
|
}
|
2170
2324
|
UPB_INLINE void google_protobuf_MethodDescriptorProto_set_options(google_protobuf_MethodDescriptorProto *msg, google_protobuf_MethodOptions* value) {
|
2171
2325
|
_upb_sethas(msg, 6);
|
2172
|
-
|
2326
|
+
*UPB_PTR_AT(msg, UPB_SIZE(28, 56), google_protobuf_MethodOptions*) = value;
|
2173
2327
|
}
|
2174
2328
|
UPB_INLINE struct google_protobuf_MethodOptions* google_protobuf_MethodDescriptorProto_mutable_options(google_protobuf_MethodDescriptorProto *msg, upb_arena *arena) {
|
2175
2329
|
struct google_protobuf_MethodOptions* sub = (struct google_protobuf_MethodOptions*)google_protobuf_MethodDescriptorProto_options(msg);
|
2176
2330
|
if (sub == NULL) {
|
2177
|
-
sub = (struct google_protobuf_MethodOptions*)
|
2331
|
+
sub = (struct google_protobuf_MethodOptions*)_upb_msg_new(&google_protobuf_MethodOptions_msginit, arena);
|
2178
2332
|
if (!sub) return NULL;
|
2179
2333
|
google_protobuf_MethodDescriptorProto_set_options(msg, sub);
|
2180
2334
|
}
|
@@ -2182,17 +2336,17 @@ UPB_INLINE struct google_protobuf_MethodOptions* google_protobuf_MethodDescripto
|
|
2182
2336
|
}
|
2183
2337
|
UPB_INLINE void google_protobuf_MethodDescriptorProto_set_client_streaming(google_protobuf_MethodDescriptorProto *msg, bool value) {
|
2184
2338
|
_upb_sethas(msg, 1);
|
2185
|
-
|
2339
|
+
*UPB_PTR_AT(msg, UPB_SIZE(1, 1), bool) = value;
|
2186
2340
|
}
|
2187
2341
|
UPB_INLINE void google_protobuf_MethodDescriptorProto_set_server_streaming(google_protobuf_MethodDescriptorProto *msg, bool value) {
|
2188
2342
|
_upb_sethas(msg, 2);
|
2189
|
-
|
2343
|
+
*UPB_PTR_AT(msg, UPB_SIZE(2, 2), bool) = value;
|
2190
2344
|
}
|
2191
2345
|
|
2192
2346
|
/* google.protobuf.FileOptions */
|
2193
2347
|
|
2194
2348
|
UPB_INLINE google_protobuf_FileOptions *google_protobuf_FileOptions_new(upb_arena *arena) {
|
2195
|
-
return (google_protobuf_FileOptions *)
|
2349
|
+
return (google_protobuf_FileOptions *)_upb_msg_new(&google_protobuf_FileOptions_msginit, arena);
|
2196
2350
|
}
|
2197
2351
|
UPB_INLINE google_protobuf_FileOptions *google_protobuf_FileOptions_parse(const char *buf, size_t size,
|
2198
2352
|
upb_arena *arena) {
|
@@ -2204,135 +2358,136 @@ UPB_INLINE char *google_protobuf_FileOptions_serialize(const google_protobuf_Fil
|
|
2204
2358
|
}
|
2205
2359
|
|
2206
2360
|
UPB_INLINE bool google_protobuf_FileOptions_has_java_package(const google_protobuf_FileOptions *msg) { return _upb_has_field(msg, 11); }
|
2207
|
-
UPB_INLINE upb_strview google_protobuf_FileOptions_java_package(const google_protobuf_FileOptions *msg) { return
|
2361
|
+
UPB_INLINE upb_strview google_protobuf_FileOptions_java_package(const google_protobuf_FileOptions *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(28, 32), upb_strview); }
|
2208
2362
|
UPB_INLINE bool google_protobuf_FileOptions_has_java_outer_classname(const google_protobuf_FileOptions *msg) { return _upb_has_field(msg, 12); }
|
2209
|
-
UPB_INLINE upb_strview google_protobuf_FileOptions_java_outer_classname(const google_protobuf_FileOptions *msg) { return
|
2363
|
+
UPB_INLINE upb_strview google_protobuf_FileOptions_java_outer_classname(const google_protobuf_FileOptions *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(36, 48), upb_strview); }
|
2210
2364
|
UPB_INLINE bool google_protobuf_FileOptions_has_optimize_for(const google_protobuf_FileOptions *msg) { return _upb_has_field(msg, 1); }
|
2211
|
-
UPB_INLINE int32_t google_protobuf_FileOptions_optimize_for(const google_protobuf_FileOptions *msg) { return
|
2365
|
+
UPB_INLINE int32_t google_protobuf_FileOptions_optimize_for(const google_protobuf_FileOptions *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(8, 8), int32_t); }
|
2212
2366
|
UPB_INLINE bool google_protobuf_FileOptions_has_java_multiple_files(const google_protobuf_FileOptions *msg) { return _upb_has_field(msg, 2); }
|
2213
|
-
UPB_INLINE bool google_protobuf_FileOptions_java_multiple_files(const google_protobuf_FileOptions *msg) { return
|
2367
|
+
UPB_INLINE bool google_protobuf_FileOptions_java_multiple_files(const google_protobuf_FileOptions *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(16, 16), bool); }
|
2214
2368
|
UPB_INLINE bool google_protobuf_FileOptions_has_go_package(const google_protobuf_FileOptions *msg) { return _upb_has_field(msg, 13); }
|
2215
|
-
UPB_INLINE upb_strview google_protobuf_FileOptions_go_package(const google_protobuf_FileOptions *msg) { return
|
2369
|
+
UPB_INLINE upb_strview google_protobuf_FileOptions_go_package(const google_protobuf_FileOptions *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(44, 64), upb_strview); }
|
2216
2370
|
UPB_INLINE bool google_protobuf_FileOptions_has_cc_generic_services(const google_protobuf_FileOptions *msg) { return _upb_has_field(msg, 3); }
|
2217
|
-
UPB_INLINE bool google_protobuf_FileOptions_cc_generic_services(const google_protobuf_FileOptions *msg) { return
|
2371
|
+
UPB_INLINE bool google_protobuf_FileOptions_cc_generic_services(const google_protobuf_FileOptions *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(17, 17), bool); }
|
2218
2372
|
UPB_INLINE bool google_protobuf_FileOptions_has_java_generic_services(const google_protobuf_FileOptions *msg) { return _upb_has_field(msg, 4); }
|
2219
|
-
UPB_INLINE bool google_protobuf_FileOptions_java_generic_services(const google_protobuf_FileOptions *msg) { return
|
2373
|
+
UPB_INLINE bool google_protobuf_FileOptions_java_generic_services(const google_protobuf_FileOptions *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(18, 18), bool); }
|
2220
2374
|
UPB_INLINE bool google_protobuf_FileOptions_has_py_generic_services(const google_protobuf_FileOptions *msg) { return _upb_has_field(msg, 5); }
|
2221
|
-
UPB_INLINE bool google_protobuf_FileOptions_py_generic_services(const google_protobuf_FileOptions *msg) { return
|
2375
|
+
UPB_INLINE bool google_protobuf_FileOptions_py_generic_services(const google_protobuf_FileOptions *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(19, 19), bool); }
|
2222
2376
|
UPB_INLINE bool google_protobuf_FileOptions_has_java_generate_equals_and_hash(const google_protobuf_FileOptions *msg) { return _upb_has_field(msg, 6); }
|
2223
|
-
UPB_INLINE bool google_protobuf_FileOptions_java_generate_equals_and_hash(const google_protobuf_FileOptions *msg) { return
|
2377
|
+
UPB_INLINE bool google_protobuf_FileOptions_java_generate_equals_and_hash(const google_protobuf_FileOptions *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(20, 20), bool); }
|
2224
2378
|
UPB_INLINE bool google_protobuf_FileOptions_has_deprecated(const google_protobuf_FileOptions *msg) { return _upb_has_field(msg, 7); }
|
2225
|
-
UPB_INLINE bool google_protobuf_FileOptions_deprecated(const google_protobuf_FileOptions *msg) { return
|
2379
|
+
UPB_INLINE bool google_protobuf_FileOptions_deprecated(const google_protobuf_FileOptions *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(21, 21), bool); }
|
2226
2380
|
UPB_INLINE bool google_protobuf_FileOptions_has_java_string_check_utf8(const google_protobuf_FileOptions *msg) { return _upb_has_field(msg, 8); }
|
2227
|
-
UPB_INLINE bool google_protobuf_FileOptions_java_string_check_utf8(const google_protobuf_FileOptions *msg) { return
|
2381
|
+
UPB_INLINE bool google_protobuf_FileOptions_java_string_check_utf8(const google_protobuf_FileOptions *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(22, 22), bool); }
|
2228
2382
|
UPB_INLINE bool google_protobuf_FileOptions_has_cc_enable_arenas(const google_protobuf_FileOptions *msg) { return _upb_has_field(msg, 9); }
|
2229
|
-
UPB_INLINE bool google_protobuf_FileOptions_cc_enable_arenas(const google_protobuf_FileOptions *msg) { return
|
2383
|
+
UPB_INLINE bool google_protobuf_FileOptions_cc_enable_arenas(const google_protobuf_FileOptions *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(23, 23), bool); }
|
2230
2384
|
UPB_INLINE bool google_protobuf_FileOptions_has_objc_class_prefix(const google_protobuf_FileOptions *msg) { return _upb_has_field(msg, 14); }
|
2231
|
-
UPB_INLINE upb_strview google_protobuf_FileOptions_objc_class_prefix(const google_protobuf_FileOptions *msg) { return
|
2385
|
+
UPB_INLINE upb_strview google_protobuf_FileOptions_objc_class_prefix(const google_protobuf_FileOptions *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(52, 80), upb_strview); }
|
2232
2386
|
UPB_INLINE bool google_protobuf_FileOptions_has_csharp_namespace(const google_protobuf_FileOptions *msg) { return _upb_has_field(msg, 15); }
|
2233
|
-
UPB_INLINE upb_strview google_protobuf_FileOptions_csharp_namespace(const google_protobuf_FileOptions *msg) { return
|
2387
|
+
UPB_INLINE upb_strview google_protobuf_FileOptions_csharp_namespace(const google_protobuf_FileOptions *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(60, 96), upb_strview); }
|
2234
2388
|
UPB_INLINE bool google_protobuf_FileOptions_has_swift_prefix(const google_protobuf_FileOptions *msg) { return _upb_has_field(msg, 16); }
|
2235
|
-
UPB_INLINE upb_strview google_protobuf_FileOptions_swift_prefix(const google_protobuf_FileOptions *msg) { return
|
2389
|
+
UPB_INLINE upb_strview google_protobuf_FileOptions_swift_prefix(const google_protobuf_FileOptions *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(68, 112), upb_strview); }
|
2236
2390
|
UPB_INLINE bool google_protobuf_FileOptions_has_php_class_prefix(const google_protobuf_FileOptions *msg) { return _upb_has_field(msg, 17); }
|
2237
|
-
UPB_INLINE upb_strview google_protobuf_FileOptions_php_class_prefix(const google_protobuf_FileOptions *msg) { return
|
2391
|
+
UPB_INLINE upb_strview google_protobuf_FileOptions_php_class_prefix(const google_protobuf_FileOptions *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(76, 128), upb_strview); }
|
2238
2392
|
UPB_INLINE bool google_protobuf_FileOptions_has_php_namespace(const google_protobuf_FileOptions *msg) { return _upb_has_field(msg, 18); }
|
2239
|
-
UPB_INLINE upb_strview google_protobuf_FileOptions_php_namespace(const google_protobuf_FileOptions *msg) { return
|
2393
|
+
UPB_INLINE upb_strview google_protobuf_FileOptions_php_namespace(const google_protobuf_FileOptions *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(84, 144), upb_strview); }
|
2240
2394
|
UPB_INLINE bool google_protobuf_FileOptions_has_php_generic_services(const google_protobuf_FileOptions *msg) { return _upb_has_field(msg, 10); }
|
2241
|
-
UPB_INLINE bool google_protobuf_FileOptions_php_generic_services(const google_protobuf_FileOptions *msg) { return
|
2395
|
+
UPB_INLINE bool google_protobuf_FileOptions_php_generic_services(const google_protobuf_FileOptions *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(24, 24), bool); }
|
2242
2396
|
UPB_INLINE bool google_protobuf_FileOptions_has_php_metadata_namespace(const google_protobuf_FileOptions *msg) { return _upb_has_field(msg, 19); }
|
2243
|
-
UPB_INLINE upb_strview google_protobuf_FileOptions_php_metadata_namespace(const google_protobuf_FileOptions *msg) { return
|
2397
|
+
UPB_INLINE upb_strview google_protobuf_FileOptions_php_metadata_namespace(const google_protobuf_FileOptions *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(92, 160), upb_strview); }
|
2244
2398
|
UPB_INLINE bool google_protobuf_FileOptions_has_ruby_package(const google_protobuf_FileOptions *msg) { return _upb_has_field(msg, 20); }
|
2245
|
-
UPB_INLINE upb_strview google_protobuf_FileOptions_ruby_package(const google_protobuf_FileOptions *msg) { return
|
2399
|
+
UPB_INLINE upb_strview google_protobuf_FileOptions_ruby_package(const google_protobuf_FileOptions *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(100, 176), upb_strview); }
|
2400
|
+
UPB_INLINE bool google_protobuf_FileOptions_has_uninterpreted_option(const google_protobuf_FileOptions *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(108, 192)); }
|
2246
2401
|
UPB_INLINE const google_protobuf_UninterpretedOption* const* google_protobuf_FileOptions_uninterpreted_option(const google_protobuf_FileOptions *msg, size_t *len) { return (const google_protobuf_UninterpretedOption* const*)_upb_array_accessor(msg, UPB_SIZE(108, 192), len); }
|
2247
2402
|
|
2248
2403
|
UPB_INLINE void google_protobuf_FileOptions_set_java_package(google_protobuf_FileOptions *msg, upb_strview value) {
|
2249
2404
|
_upb_sethas(msg, 11);
|
2250
|
-
|
2405
|
+
*UPB_PTR_AT(msg, UPB_SIZE(28, 32), upb_strview) = value;
|
2251
2406
|
}
|
2252
2407
|
UPB_INLINE void google_protobuf_FileOptions_set_java_outer_classname(google_protobuf_FileOptions *msg, upb_strview value) {
|
2253
2408
|
_upb_sethas(msg, 12);
|
2254
|
-
|
2409
|
+
*UPB_PTR_AT(msg, UPB_SIZE(36, 48), upb_strview) = value;
|
2255
2410
|
}
|
2256
2411
|
UPB_INLINE void google_protobuf_FileOptions_set_optimize_for(google_protobuf_FileOptions *msg, int32_t value) {
|
2257
2412
|
_upb_sethas(msg, 1);
|
2258
|
-
|
2413
|
+
*UPB_PTR_AT(msg, UPB_SIZE(8, 8), int32_t) = value;
|
2259
2414
|
}
|
2260
2415
|
UPB_INLINE void google_protobuf_FileOptions_set_java_multiple_files(google_protobuf_FileOptions *msg, bool value) {
|
2261
2416
|
_upb_sethas(msg, 2);
|
2262
|
-
|
2417
|
+
*UPB_PTR_AT(msg, UPB_SIZE(16, 16), bool) = value;
|
2263
2418
|
}
|
2264
2419
|
UPB_INLINE void google_protobuf_FileOptions_set_go_package(google_protobuf_FileOptions *msg, upb_strview value) {
|
2265
2420
|
_upb_sethas(msg, 13);
|
2266
|
-
|
2421
|
+
*UPB_PTR_AT(msg, UPB_SIZE(44, 64), upb_strview) = value;
|
2267
2422
|
}
|
2268
2423
|
UPB_INLINE void google_protobuf_FileOptions_set_cc_generic_services(google_protobuf_FileOptions *msg, bool value) {
|
2269
2424
|
_upb_sethas(msg, 3);
|
2270
|
-
|
2425
|
+
*UPB_PTR_AT(msg, UPB_SIZE(17, 17), bool) = value;
|
2271
2426
|
}
|
2272
2427
|
UPB_INLINE void google_protobuf_FileOptions_set_java_generic_services(google_protobuf_FileOptions *msg, bool value) {
|
2273
2428
|
_upb_sethas(msg, 4);
|
2274
|
-
|
2429
|
+
*UPB_PTR_AT(msg, UPB_SIZE(18, 18), bool) = value;
|
2275
2430
|
}
|
2276
2431
|
UPB_INLINE void google_protobuf_FileOptions_set_py_generic_services(google_protobuf_FileOptions *msg, bool value) {
|
2277
2432
|
_upb_sethas(msg, 5);
|
2278
|
-
|
2433
|
+
*UPB_PTR_AT(msg, UPB_SIZE(19, 19), bool) = value;
|
2279
2434
|
}
|
2280
2435
|
UPB_INLINE void google_protobuf_FileOptions_set_java_generate_equals_and_hash(google_protobuf_FileOptions *msg, bool value) {
|
2281
2436
|
_upb_sethas(msg, 6);
|
2282
|
-
|
2437
|
+
*UPB_PTR_AT(msg, UPB_SIZE(20, 20), bool) = value;
|
2283
2438
|
}
|
2284
2439
|
UPB_INLINE void google_protobuf_FileOptions_set_deprecated(google_protobuf_FileOptions *msg, bool value) {
|
2285
2440
|
_upb_sethas(msg, 7);
|
2286
|
-
|
2441
|
+
*UPB_PTR_AT(msg, UPB_SIZE(21, 21), bool) = value;
|
2287
2442
|
}
|
2288
2443
|
UPB_INLINE void google_protobuf_FileOptions_set_java_string_check_utf8(google_protobuf_FileOptions *msg, bool value) {
|
2289
2444
|
_upb_sethas(msg, 8);
|
2290
|
-
|
2445
|
+
*UPB_PTR_AT(msg, UPB_SIZE(22, 22), bool) = value;
|
2291
2446
|
}
|
2292
2447
|
UPB_INLINE void google_protobuf_FileOptions_set_cc_enable_arenas(google_protobuf_FileOptions *msg, bool value) {
|
2293
2448
|
_upb_sethas(msg, 9);
|
2294
|
-
|
2449
|
+
*UPB_PTR_AT(msg, UPB_SIZE(23, 23), bool) = value;
|
2295
2450
|
}
|
2296
2451
|
UPB_INLINE void google_protobuf_FileOptions_set_objc_class_prefix(google_protobuf_FileOptions *msg, upb_strview value) {
|
2297
2452
|
_upb_sethas(msg, 14);
|
2298
|
-
|
2453
|
+
*UPB_PTR_AT(msg, UPB_SIZE(52, 80), upb_strview) = value;
|
2299
2454
|
}
|
2300
2455
|
UPB_INLINE void google_protobuf_FileOptions_set_csharp_namespace(google_protobuf_FileOptions *msg, upb_strview value) {
|
2301
2456
|
_upb_sethas(msg, 15);
|
2302
|
-
|
2457
|
+
*UPB_PTR_AT(msg, UPB_SIZE(60, 96), upb_strview) = value;
|
2303
2458
|
}
|
2304
2459
|
UPB_INLINE void google_protobuf_FileOptions_set_swift_prefix(google_protobuf_FileOptions *msg, upb_strview value) {
|
2305
2460
|
_upb_sethas(msg, 16);
|
2306
|
-
|
2461
|
+
*UPB_PTR_AT(msg, UPB_SIZE(68, 112), upb_strview) = value;
|
2307
2462
|
}
|
2308
2463
|
UPB_INLINE void google_protobuf_FileOptions_set_php_class_prefix(google_protobuf_FileOptions *msg, upb_strview value) {
|
2309
2464
|
_upb_sethas(msg, 17);
|
2310
|
-
|
2465
|
+
*UPB_PTR_AT(msg, UPB_SIZE(76, 128), upb_strview) = value;
|
2311
2466
|
}
|
2312
2467
|
UPB_INLINE void google_protobuf_FileOptions_set_php_namespace(google_protobuf_FileOptions *msg, upb_strview value) {
|
2313
2468
|
_upb_sethas(msg, 18);
|
2314
|
-
|
2469
|
+
*UPB_PTR_AT(msg, UPB_SIZE(84, 144), upb_strview) = value;
|
2315
2470
|
}
|
2316
2471
|
UPB_INLINE void google_protobuf_FileOptions_set_php_generic_services(google_protobuf_FileOptions *msg, bool value) {
|
2317
2472
|
_upb_sethas(msg, 10);
|
2318
|
-
|
2473
|
+
*UPB_PTR_AT(msg, UPB_SIZE(24, 24), bool) = value;
|
2319
2474
|
}
|
2320
2475
|
UPB_INLINE void google_protobuf_FileOptions_set_php_metadata_namespace(google_protobuf_FileOptions *msg, upb_strview value) {
|
2321
2476
|
_upb_sethas(msg, 19);
|
2322
|
-
|
2477
|
+
*UPB_PTR_AT(msg, UPB_SIZE(92, 160), upb_strview) = value;
|
2323
2478
|
}
|
2324
2479
|
UPB_INLINE void google_protobuf_FileOptions_set_ruby_package(google_protobuf_FileOptions *msg, upb_strview value) {
|
2325
2480
|
_upb_sethas(msg, 20);
|
2326
|
-
|
2481
|
+
*UPB_PTR_AT(msg, UPB_SIZE(100, 176), upb_strview) = value;
|
2327
2482
|
}
|
2328
2483
|
UPB_INLINE google_protobuf_UninterpretedOption** google_protobuf_FileOptions_mutable_uninterpreted_option(google_protobuf_FileOptions *msg, size_t *len) {
|
2329
2484
|
return (google_protobuf_UninterpretedOption**)_upb_array_mutable_accessor(msg, UPB_SIZE(108, 192), len);
|
2330
2485
|
}
|
2331
2486
|
UPB_INLINE google_protobuf_UninterpretedOption** google_protobuf_FileOptions_resize_uninterpreted_option(google_protobuf_FileOptions *msg, size_t len, upb_arena *arena) {
|
2332
|
-
return (google_protobuf_UninterpretedOption**)_upb_array_resize_accessor(msg, UPB_SIZE(108, 192), len,
|
2487
|
+
return (google_protobuf_UninterpretedOption**)_upb_array_resize_accessor(msg, UPB_SIZE(108, 192), len, UPB_TYPE_MESSAGE, arena);
|
2333
2488
|
}
|
2334
2489
|
UPB_INLINE struct google_protobuf_UninterpretedOption* google_protobuf_FileOptions_add_uninterpreted_option(google_protobuf_FileOptions *msg, upb_arena *arena) {
|
2335
|
-
struct google_protobuf_UninterpretedOption* sub = (struct google_protobuf_UninterpretedOption*)
|
2490
|
+
struct google_protobuf_UninterpretedOption* sub = (struct google_protobuf_UninterpretedOption*)_upb_msg_new(&google_protobuf_UninterpretedOption_msginit, arena);
|
2336
2491
|
bool ok = _upb_array_append_accessor(
|
2337
2492
|
msg, UPB_SIZE(108, 192), UPB_SIZE(4, 8), UPB_TYPE_MESSAGE, &sub, arena);
|
2338
2493
|
if (!ok) return NULL;
|
@@ -2342,7 +2497,7 @@ UPB_INLINE struct google_protobuf_UninterpretedOption* google_protobuf_FileOptio
|
|
2342
2497
|
/* google.protobuf.MessageOptions */
|
2343
2498
|
|
2344
2499
|
UPB_INLINE google_protobuf_MessageOptions *google_protobuf_MessageOptions_new(upb_arena *arena) {
|
2345
|
-
return (google_protobuf_MessageOptions *)
|
2500
|
+
return (google_protobuf_MessageOptions *)_upb_msg_new(&google_protobuf_MessageOptions_msginit, arena);
|
2346
2501
|
}
|
2347
2502
|
UPB_INLINE google_protobuf_MessageOptions *google_protobuf_MessageOptions_parse(const char *buf, size_t size,
|
2348
2503
|
upb_arena *arena) {
|
@@ -2354,39 +2509,40 @@ UPB_INLINE char *google_protobuf_MessageOptions_serialize(const google_protobuf_
|
|
2354
2509
|
}
|
2355
2510
|
|
2356
2511
|
UPB_INLINE bool google_protobuf_MessageOptions_has_message_set_wire_format(const google_protobuf_MessageOptions *msg) { return _upb_has_field(msg, 1); }
|
2357
|
-
UPB_INLINE bool google_protobuf_MessageOptions_message_set_wire_format(const google_protobuf_MessageOptions *msg) { return
|
2512
|
+
UPB_INLINE bool google_protobuf_MessageOptions_message_set_wire_format(const google_protobuf_MessageOptions *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(1, 1), bool); }
|
2358
2513
|
UPB_INLINE bool google_protobuf_MessageOptions_has_no_standard_descriptor_accessor(const google_protobuf_MessageOptions *msg) { return _upb_has_field(msg, 2); }
|
2359
|
-
UPB_INLINE bool google_protobuf_MessageOptions_no_standard_descriptor_accessor(const google_protobuf_MessageOptions *msg) { return
|
2514
|
+
UPB_INLINE bool google_protobuf_MessageOptions_no_standard_descriptor_accessor(const google_protobuf_MessageOptions *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(2, 2), bool); }
|
2360
2515
|
UPB_INLINE bool google_protobuf_MessageOptions_has_deprecated(const google_protobuf_MessageOptions *msg) { return _upb_has_field(msg, 3); }
|
2361
|
-
UPB_INLINE bool google_protobuf_MessageOptions_deprecated(const google_protobuf_MessageOptions *msg) { return
|
2516
|
+
UPB_INLINE bool google_protobuf_MessageOptions_deprecated(const google_protobuf_MessageOptions *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(3, 3), bool); }
|
2362
2517
|
UPB_INLINE bool google_protobuf_MessageOptions_has_map_entry(const google_protobuf_MessageOptions *msg) { return _upb_has_field(msg, 4); }
|
2363
|
-
UPB_INLINE bool google_protobuf_MessageOptions_map_entry(const google_protobuf_MessageOptions *msg) { return
|
2518
|
+
UPB_INLINE bool google_protobuf_MessageOptions_map_entry(const google_protobuf_MessageOptions *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(4, 4), bool); }
|
2519
|
+
UPB_INLINE bool google_protobuf_MessageOptions_has_uninterpreted_option(const google_protobuf_MessageOptions *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(8, 8)); }
|
2364
2520
|
UPB_INLINE const google_protobuf_UninterpretedOption* const* google_protobuf_MessageOptions_uninterpreted_option(const google_protobuf_MessageOptions *msg, size_t *len) { return (const google_protobuf_UninterpretedOption* const*)_upb_array_accessor(msg, UPB_SIZE(8, 8), len); }
|
2365
2521
|
|
2366
2522
|
UPB_INLINE void google_protobuf_MessageOptions_set_message_set_wire_format(google_protobuf_MessageOptions *msg, bool value) {
|
2367
2523
|
_upb_sethas(msg, 1);
|
2368
|
-
|
2524
|
+
*UPB_PTR_AT(msg, UPB_SIZE(1, 1), bool) = value;
|
2369
2525
|
}
|
2370
2526
|
UPB_INLINE void google_protobuf_MessageOptions_set_no_standard_descriptor_accessor(google_protobuf_MessageOptions *msg, bool value) {
|
2371
2527
|
_upb_sethas(msg, 2);
|
2372
|
-
|
2528
|
+
*UPB_PTR_AT(msg, UPB_SIZE(2, 2), bool) = value;
|
2373
2529
|
}
|
2374
2530
|
UPB_INLINE void google_protobuf_MessageOptions_set_deprecated(google_protobuf_MessageOptions *msg, bool value) {
|
2375
2531
|
_upb_sethas(msg, 3);
|
2376
|
-
|
2532
|
+
*UPB_PTR_AT(msg, UPB_SIZE(3, 3), bool) = value;
|
2377
2533
|
}
|
2378
2534
|
UPB_INLINE void google_protobuf_MessageOptions_set_map_entry(google_protobuf_MessageOptions *msg, bool value) {
|
2379
2535
|
_upb_sethas(msg, 4);
|
2380
|
-
|
2536
|
+
*UPB_PTR_AT(msg, UPB_SIZE(4, 4), bool) = value;
|
2381
2537
|
}
|
2382
2538
|
UPB_INLINE google_protobuf_UninterpretedOption** google_protobuf_MessageOptions_mutable_uninterpreted_option(google_protobuf_MessageOptions *msg, size_t *len) {
|
2383
2539
|
return (google_protobuf_UninterpretedOption**)_upb_array_mutable_accessor(msg, UPB_SIZE(8, 8), len);
|
2384
2540
|
}
|
2385
2541
|
UPB_INLINE google_protobuf_UninterpretedOption** google_protobuf_MessageOptions_resize_uninterpreted_option(google_protobuf_MessageOptions *msg, size_t len, upb_arena *arena) {
|
2386
|
-
return (google_protobuf_UninterpretedOption**)_upb_array_resize_accessor(msg, UPB_SIZE(8, 8), len,
|
2542
|
+
return (google_protobuf_UninterpretedOption**)_upb_array_resize_accessor(msg, UPB_SIZE(8, 8), len, UPB_TYPE_MESSAGE, arena);
|
2387
2543
|
}
|
2388
2544
|
UPB_INLINE struct google_protobuf_UninterpretedOption* google_protobuf_MessageOptions_add_uninterpreted_option(google_protobuf_MessageOptions *msg, upb_arena *arena) {
|
2389
|
-
struct google_protobuf_UninterpretedOption* sub = (struct google_protobuf_UninterpretedOption*)
|
2545
|
+
struct google_protobuf_UninterpretedOption* sub = (struct google_protobuf_UninterpretedOption*)_upb_msg_new(&google_protobuf_UninterpretedOption_msginit, arena);
|
2390
2546
|
bool ok = _upb_array_append_accessor(
|
2391
2547
|
msg, UPB_SIZE(8, 8), UPB_SIZE(4, 8), UPB_TYPE_MESSAGE, &sub, arena);
|
2392
2548
|
if (!ok) return NULL;
|
@@ -2396,7 +2552,7 @@ UPB_INLINE struct google_protobuf_UninterpretedOption* google_protobuf_MessageOp
|
|
2396
2552
|
/* google.protobuf.FieldOptions */
|
2397
2553
|
|
2398
2554
|
UPB_INLINE google_protobuf_FieldOptions *google_protobuf_FieldOptions_new(upb_arena *arena) {
|
2399
|
-
return (google_protobuf_FieldOptions *)
|
2555
|
+
return (google_protobuf_FieldOptions *)_upb_msg_new(&google_protobuf_FieldOptions_msginit, arena);
|
2400
2556
|
}
|
2401
2557
|
UPB_INLINE google_protobuf_FieldOptions *google_protobuf_FieldOptions_parse(const char *buf, size_t size,
|
2402
2558
|
upb_arena *arena) {
|
@@ -2408,51 +2564,52 @@ UPB_INLINE char *google_protobuf_FieldOptions_serialize(const google_protobuf_Fi
|
|
2408
2564
|
}
|
2409
2565
|
|
2410
2566
|
UPB_INLINE bool google_protobuf_FieldOptions_has_ctype(const google_protobuf_FieldOptions *msg) { return _upb_has_field(msg, 1); }
|
2411
|
-
UPB_INLINE int32_t google_protobuf_FieldOptions_ctype(const google_protobuf_FieldOptions *msg) { return
|
2567
|
+
UPB_INLINE int32_t google_protobuf_FieldOptions_ctype(const google_protobuf_FieldOptions *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(8, 8), int32_t); }
|
2412
2568
|
UPB_INLINE bool google_protobuf_FieldOptions_has_packed(const google_protobuf_FieldOptions *msg) { return _upb_has_field(msg, 3); }
|
2413
|
-
UPB_INLINE bool google_protobuf_FieldOptions_packed(const google_protobuf_FieldOptions *msg) { return
|
2569
|
+
UPB_INLINE bool google_protobuf_FieldOptions_packed(const google_protobuf_FieldOptions *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(24, 24), bool); }
|
2414
2570
|
UPB_INLINE bool google_protobuf_FieldOptions_has_deprecated(const google_protobuf_FieldOptions *msg) { return _upb_has_field(msg, 4); }
|
2415
|
-
UPB_INLINE bool google_protobuf_FieldOptions_deprecated(const google_protobuf_FieldOptions *msg) { return
|
2571
|
+
UPB_INLINE bool google_protobuf_FieldOptions_deprecated(const google_protobuf_FieldOptions *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(25, 25), bool); }
|
2416
2572
|
UPB_INLINE bool google_protobuf_FieldOptions_has_lazy(const google_protobuf_FieldOptions *msg) { return _upb_has_field(msg, 5); }
|
2417
|
-
UPB_INLINE bool google_protobuf_FieldOptions_lazy(const google_protobuf_FieldOptions *msg) { return
|
2573
|
+
UPB_INLINE bool google_protobuf_FieldOptions_lazy(const google_protobuf_FieldOptions *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(26, 26), bool); }
|
2418
2574
|
UPB_INLINE bool google_protobuf_FieldOptions_has_jstype(const google_protobuf_FieldOptions *msg) { return _upb_has_field(msg, 2); }
|
2419
|
-
UPB_INLINE int32_t google_protobuf_FieldOptions_jstype(const google_protobuf_FieldOptions *msg) { return
|
2575
|
+
UPB_INLINE int32_t google_protobuf_FieldOptions_jstype(const google_protobuf_FieldOptions *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(16, 16), int32_t); }
|
2420
2576
|
UPB_INLINE bool google_protobuf_FieldOptions_has_weak(const google_protobuf_FieldOptions *msg) { return _upb_has_field(msg, 6); }
|
2421
|
-
UPB_INLINE bool google_protobuf_FieldOptions_weak(const google_protobuf_FieldOptions *msg) { return
|
2577
|
+
UPB_INLINE bool google_protobuf_FieldOptions_weak(const google_protobuf_FieldOptions *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(27, 27), bool); }
|
2578
|
+
UPB_INLINE bool google_protobuf_FieldOptions_has_uninterpreted_option(const google_protobuf_FieldOptions *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(28, 32)); }
|
2422
2579
|
UPB_INLINE const google_protobuf_UninterpretedOption* const* google_protobuf_FieldOptions_uninterpreted_option(const google_protobuf_FieldOptions *msg, size_t *len) { return (const google_protobuf_UninterpretedOption* const*)_upb_array_accessor(msg, UPB_SIZE(28, 32), len); }
|
2423
2580
|
|
2424
2581
|
UPB_INLINE void google_protobuf_FieldOptions_set_ctype(google_protobuf_FieldOptions *msg, int32_t value) {
|
2425
2582
|
_upb_sethas(msg, 1);
|
2426
|
-
|
2583
|
+
*UPB_PTR_AT(msg, UPB_SIZE(8, 8), int32_t) = value;
|
2427
2584
|
}
|
2428
2585
|
UPB_INLINE void google_protobuf_FieldOptions_set_packed(google_protobuf_FieldOptions *msg, bool value) {
|
2429
2586
|
_upb_sethas(msg, 3);
|
2430
|
-
|
2587
|
+
*UPB_PTR_AT(msg, UPB_SIZE(24, 24), bool) = value;
|
2431
2588
|
}
|
2432
2589
|
UPB_INLINE void google_protobuf_FieldOptions_set_deprecated(google_protobuf_FieldOptions *msg, bool value) {
|
2433
2590
|
_upb_sethas(msg, 4);
|
2434
|
-
|
2591
|
+
*UPB_PTR_AT(msg, UPB_SIZE(25, 25), bool) = value;
|
2435
2592
|
}
|
2436
2593
|
UPB_INLINE void google_protobuf_FieldOptions_set_lazy(google_protobuf_FieldOptions *msg, bool value) {
|
2437
2594
|
_upb_sethas(msg, 5);
|
2438
|
-
|
2595
|
+
*UPB_PTR_AT(msg, UPB_SIZE(26, 26), bool) = value;
|
2439
2596
|
}
|
2440
2597
|
UPB_INLINE void google_protobuf_FieldOptions_set_jstype(google_protobuf_FieldOptions *msg, int32_t value) {
|
2441
2598
|
_upb_sethas(msg, 2);
|
2442
|
-
|
2599
|
+
*UPB_PTR_AT(msg, UPB_SIZE(16, 16), int32_t) = value;
|
2443
2600
|
}
|
2444
2601
|
UPB_INLINE void google_protobuf_FieldOptions_set_weak(google_protobuf_FieldOptions *msg, bool value) {
|
2445
2602
|
_upb_sethas(msg, 6);
|
2446
|
-
|
2603
|
+
*UPB_PTR_AT(msg, UPB_SIZE(27, 27), bool) = value;
|
2447
2604
|
}
|
2448
2605
|
UPB_INLINE google_protobuf_UninterpretedOption** google_protobuf_FieldOptions_mutable_uninterpreted_option(google_protobuf_FieldOptions *msg, size_t *len) {
|
2449
2606
|
return (google_protobuf_UninterpretedOption**)_upb_array_mutable_accessor(msg, UPB_SIZE(28, 32), len);
|
2450
2607
|
}
|
2451
2608
|
UPB_INLINE google_protobuf_UninterpretedOption** google_protobuf_FieldOptions_resize_uninterpreted_option(google_protobuf_FieldOptions *msg, size_t len, upb_arena *arena) {
|
2452
|
-
return (google_protobuf_UninterpretedOption**)_upb_array_resize_accessor(msg, UPB_SIZE(28, 32), len,
|
2609
|
+
return (google_protobuf_UninterpretedOption**)_upb_array_resize_accessor(msg, UPB_SIZE(28, 32), len, UPB_TYPE_MESSAGE, arena);
|
2453
2610
|
}
|
2454
2611
|
UPB_INLINE struct google_protobuf_UninterpretedOption* google_protobuf_FieldOptions_add_uninterpreted_option(google_protobuf_FieldOptions *msg, upb_arena *arena) {
|
2455
|
-
struct google_protobuf_UninterpretedOption* sub = (struct google_protobuf_UninterpretedOption*)
|
2612
|
+
struct google_protobuf_UninterpretedOption* sub = (struct google_protobuf_UninterpretedOption*)_upb_msg_new(&google_protobuf_UninterpretedOption_msginit, arena);
|
2456
2613
|
bool ok = _upb_array_append_accessor(
|
2457
2614
|
msg, UPB_SIZE(28, 32), UPB_SIZE(4, 8), UPB_TYPE_MESSAGE, &sub, arena);
|
2458
2615
|
if (!ok) return NULL;
|
@@ -2462,7 +2619,7 @@ UPB_INLINE struct google_protobuf_UninterpretedOption* google_protobuf_FieldOpti
|
|
2462
2619
|
/* google.protobuf.OneofOptions */
|
2463
2620
|
|
2464
2621
|
UPB_INLINE google_protobuf_OneofOptions *google_protobuf_OneofOptions_new(upb_arena *arena) {
|
2465
|
-
return (google_protobuf_OneofOptions *)
|
2622
|
+
return (google_protobuf_OneofOptions *)_upb_msg_new(&google_protobuf_OneofOptions_msginit, arena);
|
2466
2623
|
}
|
2467
2624
|
UPB_INLINE google_protobuf_OneofOptions *google_protobuf_OneofOptions_parse(const char *buf, size_t size,
|
2468
2625
|
upb_arena *arena) {
|
@@ -2473,16 +2630,17 @@ UPB_INLINE char *google_protobuf_OneofOptions_serialize(const google_protobuf_On
|
|
2473
2630
|
return upb_encode(msg, &google_protobuf_OneofOptions_msginit, arena, len);
|
2474
2631
|
}
|
2475
2632
|
|
2633
|
+
UPB_INLINE bool google_protobuf_OneofOptions_has_uninterpreted_option(const google_protobuf_OneofOptions *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(0, 0)); }
|
2476
2634
|
UPB_INLINE const google_protobuf_UninterpretedOption* const* google_protobuf_OneofOptions_uninterpreted_option(const google_protobuf_OneofOptions *msg, size_t *len) { return (const google_protobuf_UninterpretedOption* const*)_upb_array_accessor(msg, UPB_SIZE(0, 0), len); }
|
2477
2635
|
|
2478
2636
|
UPB_INLINE google_protobuf_UninterpretedOption** google_protobuf_OneofOptions_mutable_uninterpreted_option(google_protobuf_OneofOptions *msg, size_t *len) {
|
2479
2637
|
return (google_protobuf_UninterpretedOption**)_upb_array_mutable_accessor(msg, UPB_SIZE(0, 0), len);
|
2480
2638
|
}
|
2481
2639
|
UPB_INLINE google_protobuf_UninterpretedOption** google_protobuf_OneofOptions_resize_uninterpreted_option(google_protobuf_OneofOptions *msg, size_t len, upb_arena *arena) {
|
2482
|
-
return (google_protobuf_UninterpretedOption**)_upb_array_resize_accessor(msg, UPB_SIZE(0, 0), len,
|
2640
|
+
return (google_protobuf_UninterpretedOption**)_upb_array_resize_accessor(msg, UPB_SIZE(0, 0), len, UPB_TYPE_MESSAGE, arena);
|
2483
2641
|
}
|
2484
2642
|
UPB_INLINE struct google_protobuf_UninterpretedOption* google_protobuf_OneofOptions_add_uninterpreted_option(google_protobuf_OneofOptions *msg, upb_arena *arena) {
|
2485
|
-
struct google_protobuf_UninterpretedOption* sub = (struct google_protobuf_UninterpretedOption*)
|
2643
|
+
struct google_protobuf_UninterpretedOption* sub = (struct google_protobuf_UninterpretedOption*)_upb_msg_new(&google_protobuf_UninterpretedOption_msginit, arena);
|
2486
2644
|
bool ok = _upb_array_append_accessor(
|
2487
2645
|
msg, UPB_SIZE(0, 0), UPB_SIZE(4, 8), UPB_TYPE_MESSAGE, &sub, arena);
|
2488
2646
|
if (!ok) return NULL;
|
@@ -2492,7 +2650,7 @@ UPB_INLINE struct google_protobuf_UninterpretedOption* google_protobuf_OneofOpti
|
|
2492
2650
|
/* google.protobuf.EnumOptions */
|
2493
2651
|
|
2494
2652
|
UPB_INLINE google_protobuf_EnumOptions *google_protobuf_EnumOptions_new(upb_arena *arena) {
|
2495
|
-
return (google_protobuf_EnumOptions *)
|
2653
|
+
return (google_protobuf_EnumOptions *)_upb_msg_new(&google_protobuf_EnumOptions_msginit, arena);
|
2496
2654
|
}
|
2497
2655
|
UPB_INLINE google_protobuf_EnumOptions *google_protobuf_EnumOptions_parse(const char *buf, size_t size,
|
2498
2656
|
upb_arena *arena) {
|
@@ -2504,27 +2662,28 @@ UPB_INLINE char *google_protobuf_EnumOptions_serialize(const google_protobuf_Enu
|
|
2504
2662
|
}
|
2505
2663
|
|
2506
2664
|
UPB_INLINE bool google_protobuf_EnumOptions_has_allow_alias(const google_protobuf_EnumOptions *msg) { return _upb_has_field(msg, 1); }
|
2507
|
-
UPB_INLINE bool google_protobuf_EnumOptions_allow_alias(const google_protobuf_EnumOptions *msg) { return
|
2665
|
+
UPB_INLINE bool google_protobuf_EnumOptions_allow_alias(const google_protobuf_EnumOptions *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(1, 1), bool); }
|
2508
2666
|
UPB_INLINE bool google_protobuf_EnumOptions_has_deprecated(const google_protobuf_EnumOptions *msg) { return _upb_has_field(msg, 2); }
|
2509
|
-
UPB_INLINE bool google_protobuf_EnumOptions_deprecated(const google_protobuf_EnumOptions *msg) { return
|
2667
|
+
UPB_INLINE bool google_protobuf_EnumOptions_deprecated(const google_protobuf_EnumOptions *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(2, 2), bool); }
|
2668
|
+
UPB_INLINE bool google_protobuf_EnumOptions_has_uninterpreted_option(const google_protobuf_EnumOptions *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(4, 8)); }
|
2510
2669
|
UPB_INLINE const google_protobuf_UninterpretedOption* const* google_protobuf_EnumOptions_uninterpreted_option(const google_protobuf_EnumOptions *msg, size_t *len) { return (const google_protobuf_UninterpretedOption* const*)_upb_array_accessor(msg, UPB_SIZE(4, 8), len); }
|
2511
2670
|
|
2512
2671
|
UPB_INLINE void google_protobuf_EnumOptions_set_allow_alias(google_protobuf_EnumOptions *msg, bool value) {
|
2513
2672
|
_upb_sethas(msg, 1);
|
2514
|
-
|
2673
|
+
*UPB_PTR_AT(msg, UPB_SIZE(1, 1), bool) = value;
|
2515
2674
|
}
|
2516
2675
|
UPB_INLINE void google_protobuf_EnumOptions_set_deprecated(google_protobuf_EnumOptions *msg, bool value) {
|
2517
2676
|
_upb_sethas(msg, 2);
|
2518
|
-
|
2677
|
+
*UPB_PTR_AT(msg, UPB_SIZE(2, 2), bool) = value;
|
2519
2678
|
}
|
2520
2679
|
UPB_INLINE google_protobuf_UninterpretedOption** google_protobuf_EnumOptions_mutable_uninterpreted_option(google_protobuf_EnumOptions *msg, size_t *len) {
|
2521
2680
|
return (google_protobuf_UninterpretedOption**)_upb_array_mutable_accessor(msg, UPB_SIZE(4, 8), len);
|
2522
2681
|
}
|
2523
2682
|
UPB_INLINE google_protobuf_UninterpretedOption** google_protobuf_EnumOptions_resize_uninterpreted_option(google_protobuf_EnumOptions *msg, size_t len, upb_arena *arena) {
|
2524
|
-
return (google_protobuf_UninterpretedOption**)_upb_array_resize_accessor(msg, UPB_SIZE(4, 8), len,
|
2683
|
+
return (google_protobuf_UninterpretedOption**)_upb_array_resize_accessor(msg, UPB_SIZE(4, 8), len, UPB_TYPE_MESSAGE, arena);
|
2525
2684
|
}
|
2526
2685
|
UPB_INLINE struct google_protobuf_UninterpretedOption* google_protobuf_EnumOptions_add_uninterpreted_option(google_protobuf_EnumOptions *msg, upb_arena *arena) {
|
2527
|
-
struct google_protobuf_UninterpretedOption* sub = (struct google_protobuf_UninterpretedOption*)
|
2686
|
+
struct google_protobuf_UninterpretedOption* sub = (struct google_protobuf_UninterpretedOption*)_upb_msg_new(&google_protobuf_UninterpretedOption_msginit, arena);
|
2528
2687
|
bool ok = _upb_array_append_accessor(
|
2529
2688
|
msg, UPB_SIZE(4, 8), UPB_SIZE(4, 8), UPB_TYPE_MESSAGE, &sub, arena);
|
2530
2689
|
if (!ok) return NULL;
|
@@ -2534,7 +2693,7 @@ UPB_INLINE struct google_protobuf_UninterpretedOption* google_protobuf_EnumOptio
|
|
2534
2693
|
/* google.protobuf.EnumValueOptions */
|
2535
2694
|
|
2536
2695
|
UPB_INLINE google_protobuf_EnumValueOptions *google_protobuf_EnumValueOptions_new(upb_arena *arena) {
|
2537
|
-
return (google_protobuf_EnumValueOptions *)
|
2696
|
+
return (google_protobuf_EnumValueOptions *)_upb_msg_new(&google_protobuf_EnumValueOptions_msginit, arena);
|
2538
2697
|
}
|
2539
2698
|
UPB_INLINE google_protobuf_EnumValueOptions *google_protobuf_EnumValueOptions_parse(const char *buf, size_t size,
|
2540
2699
|
upb_arena *arena) {
|
@@ -2546,21 +2705,22 @@ UPB_INLINE char *google_protobuf_EnumValueOptions_serialize(const google_protobu
|
|
2546
2705
|
}
|
2547
2706
|
|
2548
2707
|
UPB_INLINE bool google_protobuf_EnumValueOptions_has_deprecated(const google_protobuf_EnumValueOptions *msg) { return _upb_has_field(msg, 1); }
|
2549
|
-
UPB_INLINE bool google_protobuf_EnumValueOptions_deprecated(const google_protobuf_EnumValueOptions *msg) { return
|
2708
|
+
UPB_INLINE bool google_protobuf_EnumValueOptions_deprecated(const google_protobuf_EnumValueOptions *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(1, 1), bool); }
|
2709
|
+
UPB_INLINE bool google_protobuf_EnumValueOptions_has_uninterpreted_option(const google_protobuf_EnumValueOptions *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(4, 8)); }
|
2550
2710
|
UPB_INLINE const google_protobuf_UninterpretedOption* const* google_protobuf_EnumValueOptions_uninterpreted_option(const google_protobuf_EnumValueOptions *msg, size_t *len) { return (const google_protobuf_UninterpretedOption* const*)_upb_array_accessor(msg, UPB_SIZE(4, 8), len); }
|
2551
2711
|
|
2552
2712
|
UPB_INLINE void google_protobuf_EnumValueOptions_set_deprecated(google_protobuf_EnumValueOptions *msg, bool value) {
|
2553
2713
|
_upb_sethas(msg, 1);
|
2554
|
-
|
2714
|
+
*UPB_PTR_AT(msg, UPB_SIZE(1, 1), bool) = value;
|
2555
2715
|
}
|
2556
2716
|
UPB_INLINE google_protobuf_UninterpretedOption** google_protobuf_EnumValueOptions_mutable_uninterpreted_option(google_protobuf_EnumValueOptions *msg, size_t *len) {
|
2557
2717
|
return (google_protobuf_UninterpretedOption**)_upb_array_mutable_accessor(msg, UPB_SIZE(4, 8), len);
|
2558
2718
|
}
|
2559
2719
|
UPB_INLINE google_protobuf_UninterpretedOption** google_protobuf_EnumValueOptions_resize_uninterpreted_option(google_protobuf_EnumValueOptions *msg, size_t len, upb_arena *arena) {
|
2560
|
-
return (google_protobuf_UninterpretedOption**)_upb_array_resize_accessor(msg, UPB_SIZE(4, 8), len,
|
2720
|
+
return (google_protobuf_UninterpretedOption**)_upb_array_resize_accessor(msg, UPB_SIZE(4, 8), len, UPB_TYPE_MESSAGE, arena);
|
2561
2721
|
}
|
2562
2722
|
UPB_INLINE struct google_protobuf_UninterpretedOption* google_protobuf_EnumValueOptions_add_uninterpreted_option(google_protobuf_EnumValueOptions *msg, upb_arena *arena) {
|
2563
|
-
struct google_protobuf_UninterpretedOption* sub = (struct google_protobuf_UninterpretedOption*)
|
2723
|
+
struct google_protobuf_UninterpretedOption* sub = (struct google_protobuf_UninterpretedOption*)_upb_msg_new(&google_protobuf_UninterpretedOption_msginit, arena);
|
2564
2724
|
bool ok = _upb_array_append_accessor(
|
2565
2725
|
msg, UPB_SIZE(4, 8), UPB_SIZE(4, 8), UPB_TYPE_MESSAGE, &sub, arena);
|
2566
2726
|
if (!ok) return NULL;
|
@@ -2570,7 +2730,7 @@ UPB_INLINE struct google_protobuf_UninterpretedOption* google_protobuf_EnumValue
|
|
2570
2730
|
/* google.protobuf.ServiceOptions */
|
2571
2731
|
|
2572
2732
|
UPB_INLINE google_protobuf_ServiceOptions *google_protobuf_ServiceOptions_new(upb_arena *arena) {
|
2573
|
-
return (google_protobuf_ServiceOptions *)
|
2733
|
+
return (google_protobuf_ServiceOptions *)_upb_msg_new(&google_protobuf_ServiceOptions_msginit, arena);
|
2574
2734
|
}
|
2575
2735
|
UPB_INLINE google_protobuf_ServiceOptions *google_protobuf_ServiceOptions_parse(const char *buf, size_t size,
|
2576
2736
|
upb_arena *arena) {
|
@@ -2582,21 +2742,22 @@ UPB_INLINE char *google_protobuf_ServiceOptions_serialize(const google_protobuf_
|
|
2582
2742
|
}
|
2583
2743
|
|
2584
2744
|
UPB_INLINE bool google_protobuf_ServiceOptions_has_deprecated(const google_protobuf_ServiceOptions *msg) { return _upb_has_field(msg, 1); }
|
2585
|
-
UPB_INLINE bool google_protobuf_ServiceOptions_deprecated(const google_protobuf_ServiceOptions *msg) { return
|
2745
|
+
UPB_INLINE bool google_protobuf_ServiceOptions_deprecated(const google_protobuf_ServiceOptions *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(1, 1), bool); }
|
2746
|
+
UPB_INLINE bool google_protobuf_ServiceOptions_has_uninterpreted_option(const google_protobuf_ServiceOptions *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(4, 8)); }
|
2586
2747
|
UPB_INLINE const google_protobuf_UninterpretedOption* const* google_protobuf_ServiceOptions_uninterpreted_option(const google_protobuf_ServiceOptions *msg, size_t *len) { return (const google_protobuf_UninterpretedOption* const*)_upb_array_accessor(msg, UPB_SIZE(4, 8), len); }
|
2587
2748
|
|
2588
2749
|
UPB_INLINE void google_protobuf_ServiceOptions_set_deprecated(google_protobuf_ServiceOptions *msg, bool value) {
|
2589
2750
|
_upb_sethas(msg, 1);
|
2590
|
-
|
2751
|
+
*UPB_PTR_AT(msg, UPB_SIZE(1, 1), bool) = value;
|
2591
2752
|
}
|
2592
2753
|
UPB_INLINE google_protobuf_UninterpretedOption** google_protobuf_ServiceOptions_mutable_uninterpreted_option(google_protobuf_ServiceOptions *msg, size_t *len) {
|
2593
2754
|
return (google_protobuf_UninterpretedOption**)_upb_array_mutable_accessor(msg, UPB_SIZE(4, 8), len);
|
2594
2755
|
}
|
2595
2756
|
UPB_INLINE google_protobuf_UninterpretedOption** google_protobuf_ServiceOptions_resize_uninterpreted_option(google_protobuf_ServiceOptions *msg, size_t len, upb_arena *arena) {
|
2596
|
-
return (google_protobuf_UninterpretedOption**)_upb_array_resize_accessor(msg, UPB_SIZE(4, 8), len,
|
2757
|
+
return (google_protobuf_UninterpretedOption**)_upb_array_resize_accessor(msg, UPB_SIZE(4, 8), len, UPB_TYPE_MESSAGE, arena);
|
2597
2758
|
}
|
2598
2759
|
UPB_INLINE struct google_protobuf_UninterpretedOption* google_protobuf_ServiceOptions_add_uninterpreted_option(google_protobuf_ServiceOptions *msg, upb_arena *arena) {
|
2599
|
-
struct google_protobuf_UninterpretedOption* sub = (struct google_protobuf_UninterpretedOption*)
|
2760
|
+
struct google_protobuf_UninterpretedOption* sub = (struct google_protobuf_UninterpretedOption*)_upb_msg_new(&google_protobuf_UninterpretedOption_msginit, arena);
|
2600
2761
|
bool ok = _upb_array_append_accessor(
|
2601
2762
|
msg, UPB_SIZE(4, 8), UPB_SIZE(4, 8), UPB_TYPE_MESSAGE, &sub, arena);
|
2602
2763
|
if (!ok) return NULL;
|
@@ -2606,7 +2767,7 @@ UPB_INLINE struct google_protobuf_UninterpretedOption* google_protobuf_ServiceOp
|
|
2606
2767
|
/* google.protobuf.MethodOptions */
|
2607
2768
|
|
2608
2769
|
UPB_INLINE google_protobuf_MethodOptions *google_protobuf_MethodOptions_new(upb_arena *arena) {
|
2609
|
-
return (google_protobuf_MethodOptions *)
|
2770
|
+
return (google_protobuf_MethodOptions *)_upb_msg_new(&google_protobuf_MethodOptions_msginit, arena);
|
2610
2771
|
}
|
2611
2772
|
UPB_INLINE google_protobuf_MethodOptions *google_protobuf_MethodOptions_parse(const char *buf, size_t size,
|
2612
2773
|
upb_arena *arena) {
|
@@ -2618,27 +2779,28 @@ UPB_INLINE char *google_protobuf_MethodOptions_serialize(const google_protobuf_M
|
|
2618
2779
|
}
|
2619
2780
|
|
2620
2781
|
UPB_INLINE bool google_protobuf_MethodOptions_has_deprecated(const google_protobuf_MethodOptions *msg) { return _upb_has_field(msg, 2); }
|
2621
|
-
UPB_INLINE bool google_protobuf_MethodOptions_deprecated(const google_protobuf_MethodOptions *msg) { return
|
2782
|
+
UPB_INLINE bool google_protobuf_MethodOptions_deprecated(const google_protobuf_MethodOptions *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(16, 16), bool); }
|
2622
2783
|
UPB_INLINE bool google_protobuf_MethodOptions_has_idempotency_level(const google_protobuf_MethodOptions *msg) { return _upb_has_field(msg, 1); }
|
2623
|
-
UPB_INLINE int32_t google_protobuf_MethodOptions_idempotency_level(const google_protobuf_MethodOptions *msg) { return
|
2784
|
+
UPB_INLINE int32_t google_protobuf_MethodOptions_idempotency_level(const google_protobuf_MethodOptions *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(8, 8), int32_t); }
|
2785
|
+
UPB_INLINE bool google_protobuf_MethodOptions_has_uninterpreted_option(const google_protobuf_MethodOptions *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(20, 24)); }
|
2624
2786
|
UPB_INLINE const google_protobuf_UninterpretedOption* const* google_protobuf_MethodOptions_uninterpreted_option(const google_protobuf_MethodOptions *msg, size_t *len) { return (const google_protobuf_UninterpretedOption* const*)_upb_array_accessor(msg, UPB_SIZE(20, 24), len); }
|
2625
2787
|
|
2626
2788
|
UPB_INLINE void google_protobuf_MethodOptions_set_deprecated(google_protobuf_MethodOptions *msg, bool value) {
|
2627
2789
|
_upb_sethas(msg, 2);
|
2628
|
-
|
2790
|
+
*UPB_PTR_AT(msg, UPB_SIZE(16, 16), bool) = value;
|
2629
2791
|
}
|
2630
2792
|
UPB_INLINE void google_protobuf_MethodOptions_set_idempotency_level(google_protobuf_MethodOptions *msg, int32_t value) {
|
2631
2793
|
_upb_sethas(msg, 1);
|
2632
|
-
|
2794
|
+
*UPB_PTR_AT(msg, UPB_SIZE(8, 8), int32_t) = value;
|
2633
2795
|
}
|
2634
2796
|
UPB_INLINE google_protobuf_UninterpretedOption** google_protobuf_MethodOptions_mutable_uninterpreted_option(google_protobuf_MethodOptions *msg, size_t *len) {
|
2635
2797
|
return (google_protobuf_UninterpretedOption**)_upb_array_mutable_accessor(msg, UPB_SIZE(20, 24), len);
|
2636
2798
|
}
|
2637
2799
|
UPB_INLINE google_protobuf_UninterpretedOption** google_protobuf_MethodOptions_resize_uninterpreted_option(google_protobuf_MethodOptions *msg, size_t len, upb_arena *arena) {
|
2638
|
-
return (google_protobuf_UninterpretedOption**)_upb_array_resize_accessor(msg, UPB_SIZE(20, 24), len,
|
2800
|
+
return (google_protobuf_UninterpretedOption**)_upb_array_resize_accessor(msg, UPB_SIZE(20, 24), len, UPB_TYPE_MESSAGE, arena);
|
2639
2801
|
}
|
2640
2802
|
UPB_INLINE struct google_protobuf_UninterpretedOption* google_protobuf_MethodOptions_add_uninterpreted_option(google_protobuf_MethodOptions *msg, upb_arena *arena) {
|
2641
|
-
struct google_protobuf_UninterpretedOption* sub = (struct google_protobuf_UninterpretedOption*)
|
2803
|
+
struct google_protobuf_UninterpretedOption* sub = (struct google_protobuf_UninterpretedOption*)_upb_msg_new(&google_protobuf_UninterpretedOption_msginit, arena);
|
2642
2804
|
bool ok = _upb_array_append_accessor(
|
2643
2805
|
msg, UPB_SIZE(20, 24), UPB_SIZE(4, 8), UPB_TYPE_MESSAGE, &sub, arena);
|
2644
2806
|
if (!ok) return NULL;
|
@@ -2648,7 +2810,7 @@ UPB_INLINE struct google_protobuf_UninterpretedOption* google_protobuf_MethodOpt
|
|
2648
2810
|
/* google.protobuf.UninterpretedOption */
|
2649
2811
|
|
2650
2812
|
UPB_INLINE google_protobuf_UninterpretedOption *google_protobuf_UninterpretedOption_new(upb_arena *arena) {
|
2651
|
-
return (google_protobuf_UninterpretedOption *)
|
2813
|
+
return (google_protobuf_UninterpretedOption *)_upb_msg_new(&google_protobuf_UninterpretedOption_msginit, arena);
|
2652
2814
|
}
|
2653
2815
|
UPB_INLINE google_protobuf_UninterpretedOption *google_protobuf_UninterpretedOption_parse(const char *buf, size_t size,
|
2654
2816
|
upb_arena *arena) {
|
@@ -2659,28 +2821,29 @@ UPB_INLINE char *google_protobuf_UninterpretedOption_serialize(const google_prot
|
|
2659
2821
|
return upb_encode(msg, &google_protobuf_UninterpretedOption_msginit, arena, len);
|
2660
2822
|
}
|
2661
2823
|
|
2824
|
+
UPB_INLINE bool google_protobuf_UninterpretedOption_has_name(const google_protobuf_UninterpretedOption *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(56, 80)); }
|
2662
2825
|
UPB_INLINE const google_protobuf_UninterpretedOption_NamePart* const* google_protobuf_UninterpretedOption_name(const google_protobuf_UninterpretedOption *msg, size_t *len) { return (const google_protobuf_UninterpretedOption_NamePart* const*)_upb_array_accessor(msg, UPB_SIZE(56, 80), len); }
|
2663
2826
|
UPB_INLINE bool google_protobuf_UninterpretedOption_has_identifier_value(const google_protobuf_UninterpretedOption *msg) { return _upb_has_field(msg, 4); }
|
2664
|
-
UPB_INLINE upb_strview google_protobuf_UninterpretedOption_identifier_value(const google_protobuf_UninterpretedOption *msg) { return
|
2827
|
+
UPB_INLINE upb_strview google_protobuf_UninterpretedOption_identifier_value(const google_protobuf_UninterpretedOption *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(32, 32), upb_strview); }
|
2665
2828
|
UPB_INLINE bool google_protobuf_UninterpretedOption_has_positive_int_value(const google_protobuf_UninterpretedOption *msg) { return _upb_has_field(msg, 1); }
|
2666
|
-
UPB_INLINE uint64_t google_protobuf_UninterpretedOption_positive_int_value(const google_protobuf_UninterpretedOption *msg) { return
|
2829
|
+
UPB_INLINE uint64_t google_protobuf_UninterpretedOption_positive_int_value(const google_protobuf_UninterpretedOption *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(8, 8), uint64_t); }
|
2667
2830
|
UPB_INLINE bool google_protobuf_UninterpretedOption_has_negative_int_value(const google_protobuf_UninterpretedOption *msg) { return _upb_has_field(msg, 2); }
|
2668
|
-
UPB_INLINE int64_t google_protobuf_UninterpretedOption_negative_int_value(const google_protobuf_UninterpretedOption *msg) { return
|
2831
|
+
UPB_INLINE int64_t google_protobuf_UninterpretedOption_negative_int_value(const google_protobuf_UninterpretedOption *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(16, 16), int64_t); }
|
2669
2832
|
UPB_INLINE bool google_protobuf_UninterpretedOption_has_double_value(const google_protobuf_UninterpretedOption *msg) { return _upb_has_field(msg, 3); }
|
2670
|
-
UPB_INLINE double google_protobuf_UninterpretedOption_double_value(const google_protobuf_UninterpretedOption *msg) { return
|
2833
|
+
UPB_INLINE double google_protobuf_UninterpretedOption_double_value(const google_protobuf_UninterpretedOption *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(24, 24), double); }
|
2671
2834
|
UPB_INLINE bool google_protobuf_UninterpretedOption_has_string_value(const google_protobuf_UninterpretedOption *msg) { return _upb_has_field(msg, 5); }
|
2672
|
-
UPB_INLINE upb_strview google_protobuf_UninterpretedOption_string_value(const google_protobuf_UninterpretedOption *msg) { return
|
2835
|
+
UPB_INLINE upb_strview google_protobuf_UninterpretedOption_string_value(const google_protobuf_UninterpretedOption *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(40, 48), upb_strview); }
|
2673
2836
|
UPB_INLINE bool google_protobuf_UninterpretedOption_has_aggregate_value(const google_protobuf_UninterpretedOption *msg) { return _upb_has_field(msg, 6); }
|
2674
|
-
UPB_INLINE upb_strview google_protobuf_UninterpretedOption_aggregate_value(const google_protobuf_UninterpretedOption *msg) { return
|
2837
|
+
UPB_INLINE upb_strview google_protobuf_UninterpretedOption_aggregate_value(const google_protobuf_UninterpretedOption *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(48, 64), upb_strview); }
|
2675
2838
|
|
2676
2839
|
UPB_INLINE google_protobuf_UninterpretedOption_NamePart** google_protobuf_UninterpretedOption_mutable_name(google_protobuf_UninterpretedOption *msg, size_t *len) {
|
2677
2840
|
return (google_protobuf_UninterpretedOption_NamePart**)_upb_array_mutable_accessor(msg, UPB_SIZE(56, 80), len);
|
2678
2841
|
}
|
2679
2842
|
UPB_INLINE google_protobuf_UninterpretedOption_NamePart** google_protobuf_UninterpretedOption_resize_name(google_protobuf_UninterpretedOption *msg, size_t len, upb_arena *arena) {
|
2680
|
-
return (google_protobuf_UninterpretedOption_NamePart**)_upb_array_resize_accessor(msg, UPB_SIZE(56, 80), len,
|
2843
|
+
return (google_protobuf_UninterpretedOption_NamePart**)_upb_array_resize_accessor(msg, UPB_SIZE(56, 80), len, UPB_TYPE_MESSAGE, arena);
|
2681
2844
|
}
|
2682
2845
|
UPB_INLINE struct google_protobuf_UninterpretedOption_NamePart* google_protobuf_UninterpretedOption_add_name(google_protobuf_UninterpretedOption *msg, upb_arena *arena) {
|
2683
|
-
struct google_protobuf_UninterpretedOption_NamePart* sub = (struct google_protobuf_UninterpretedOption_NamePart*)
|
2846
|
+
struct google_protobuf_UninterpretedOption_NamePart* sub = (struct google_protobuf_UninterpretedOption_NamePart*)_upb_msg_new(&google_protobuf_UninterpretedOption_NamePart_msginit, arena);
|
2684
2847
|
bool ok = _upb_array_append_accessor(
|
2685
2848
|
msg, UPB_SIZE(56, 80), UPB_SIZE(4, 8), UPB_TYPE_MESSAGE, &sub, arena);
|
2686
2849
|
if (!ok) return NULL;
|
@@ -2688,33 +2851,33 @@ UPB_INLINE struct google_protobuf_UninterpretedOption_NamePart* google_protobuf_
|
|
2688
2851
|
}
|
2689
2852
|
UPB_INLINE void google_protobuf_UninterpretedOption_set_identifier_value(google_protobuf_UninterpretedOption *msg, upb_strview value) {
|
2690
2853
|
_upb_sethas(msg, 4);
|
2691
|
-
|
2854
|
+
*UPB_PTR_AT(msg, UPB_SIZE(32, 32), upb_strview) = value;
|
2692
2855
|
}
|
2693
2856
|
UPB_INLINE void google_protobuf_UninterpretedOption_set_positive_int_value(google_protobuf_UninterpretedOption *msg, uint64_t value) {
|
2694
2857
|
_upb_sethas(msg, 1);
|
2695
|
-
|
2858
|
+
*UPB_PTR_AT(msg, UPB_SIZE(8, 8), uint64_t) = value;
|
2696
2859
|
}
|
2697
2860
|
UPB_INLINE void google_protobuf_UninterpretedOption_set_negative_int_value(google_protobuf_UninterpretedOption *msg, int64_t value) {
|
2698
2861
|
_upb_sethas(msg, 2);
|
2699
|
-
|
2862
|
+
*UPB_PTR_AT(msg, UPB_SIZE(16, 16), int64_t) = value;
|
2700
2863
|
}
|
2701
2864
|
UPB_INLINE void google_protobuf_UninterpretedOption_set_double_value(google_protobuf_UninterpretedOption *msg, double value) {
|
2702
2865
|
_upb_sethas(msg, 3);
|
2703
|
-
|
2866
|
+
*UPB_PTR_AT(msg, UPB_SIZE(24, 24), double) = value;
|
2704
2867
|
}
|
2705
2868
|
UPB_INLINE void google_protobuf_UninterpretedOption_set_string_value(google_protobuf_UninterpretedOption *msg, upb_strview value) {
|
2706
2869
|
_upb_sethas(msg, 5);
|
2707
|
-
|
2870
|
+
*UPB_PTR_AT(msg, UPB_SIZE(40, 48), upb_strview) = value;
|
2708
2871
|
}
|
2709
2872
|
UPB_INLINE void google_protobuf_UninterpretedOption_set_aggregate_value(google_protobuf_UninterpretedOption *msg, upb_strview value) {
|
2710
2873
|
_upb_sethas(msg, 6);
|
2711
|
-
|
2874
|
+
*UPB_PTR_AT(msg, UPB_SIZE(48, 64), upb_strview) = value;
|
2712
2875
|
}
|
2713
2876
|
|
2714
2877
|
/* google.protobuf.UninterpretedOption.NamePart */
|
2715
2878
|
|
2716
2879
|
UPB_INLINE google_protobuf_UninterpretedOption_NamePart *google_protobuf_UninterpretedOption_NamePart_new(upb_arena *arena) {
|
2717
|
-
return (google_protobuf_UninterpretedOption_NamePart *)
|
2880
|
+
return (google_protobuf_UninterpretedOption_NamePart *)_upb_msg_new(&google_protobuf_UninterpretedOption_NamePart_msginit, arena);
|
2718
2881
|
}
|
2719
2882
|
UPB_INLINE google_protobuf_UninterpretedOption_NamePart *google_protobuf_UninterpretedOption_NamePart_parse(const char *buf, size_t size,
|
2720
2883
|
upb_arena *arena) {
|
@@ -2726,23 +2889,23 @@ UPB_INLINE char *google_protobuf_UninterpretedOption_NamePart_serialize(const go
|
|
2726
2889
|
}
|
2727
2890
|
|
2728
2891
|
UPB_INLINE bool google_protobuf_UninterpretedOption_NamePart_has_name_part(const google_protobuf_UninterpretedOption_NamePart *msg) { return _upb_has_field(msg, 2); }
|
2729
|
-
UPB_INLINE upb_strview google_protobuf_UninterpretedOption_NamePart_name_part(const google_protobuf_UninterpretedOption_NamePart *msg) { return
|
2892
|
+
UPB_INLINE upb_strview google_protobuf_UninterpretedOption_NamePart_name_part(const google_protobuf_UninterpretedOption_NamePart *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_strview); }
|
2730
2893
|
UPB_INLINE bool google_protobuf_UninterpretedOption_NamePart_has_is_extension(const google_protobuf_UninterpretedOption_NamePart *msg) { return _upb_has_field(msg, 1); }
|
2731
|
-
UPB_INLINE bool google_protobuf_UninterpretedOption_NamePart_is_extension(const google_protobuf_UninterpretedOption_NamePart *msg) { return
|
2894
|
+
UPB_INLINE bool google_protobuf_UninterpretedOption_NamePart_is_extension(const google_protobuf_UninterpretedOption_NamePart *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(1, 1), bool); }
|
2732
2895
|
|
2733
2896
|
UPB_INLINE void google_protobuf_UninterpretedOption_NamePart_set_name_part(google_protobuf_UninterpretedOption_NamePart *msg, upb_strview value) {
|
2734
2897
|
_upb_sethas(msg, 2);
|
2735
|
-
|
2898
|
+
*UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_strview) = value;
|
2736
2899
|
}
|
2737
2900
|
UPB_INLINE void google_protobuf_UninterpretedOption_NamePart_set_is_extension(google_protobuf_UninterpretedOption_NamePart *msg, bool value) {
|
2738
2901
|
_upb_sethas(msg, 1);
|
2739
|
-
|
2902
|
+
*UPB_PTR_AT(msg, UPB_SIZE(1, 1), bool) = value;
|
2740
2903
|
}
|
2741
2904
|
|
2742
2905
|
/* google.protobuf.SourceCodeInfo */
|
2743
2906
|
|
2744
2907
|
UPB_INLINE google_protobuf_SourceCodeInfo *google_protobuf_SourceCodeInfo_new(upb_arena *arena) {
|
2745
|
-
return (google_protobuf_SourceCodeInfo *)
|
2908
|
+
return (google_protobuf_SourceCodeInfo *)_upb_msg_new(&google_protobuf_SourceCodeInfo_msginit, arena);
|
2746
2909
|
}
|
2747
2910
|
UPB_INLINE google_protobuf_SourceCodeInfo *google_protobuf_SourceCodeInfo_parse(const char *buf, size_t size,
|
2748
2911
|
upb_arena *arena) {
|
@@ -2753,16 +2916,17 @@ UPB_INLINE char *google_protobuf_SourceCodeInfo_serialize(const google_protobuf_
|
|
2753
2916
|
return upb_encode(msg, &google_protobuf_SourceCodeInfo_msginit, arena, len);
|
2754
2917
|
}
|
2755
2918
|
|
2919
|
+
UPB_INLINE bool google_protobuf_SourceCodeInfo_has_location(const google_protobuf_SourceCodeInfo *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(0, 0)); }
|
2756
2920
|
UPB_INLINE const google_protobuf_SourceCodeInfo_Location* const* google_protobuf_SourceCodeInfo_location(const google_protobuf_SourceCodeInfo *msg, size_t *len) { return (const google_protobuf_SourceCodeInfo_Location* const*)_upb_array_accessor(msg, UPB_SIZE(0, 0), len); }
|
2757
2921
|
|
2758
2922
|
UPB_INLINE google_protobuf_SourceCodeInfo_Location** google_protobuf_SourceCodeInfo_mutable_location(google_protobuf_SourceCodeInfo *msg, size_t *len) {
|
2759
2923
|
return (google_protobuf_SourceCodeInfo_Location**)_upb_array_mutable_accessor(msg, UPB_SIZE(0, 0), len);
|
2760
2924
|
}
|
2761
2925
|
UPB_INLINE google_protobuf_SourceCodeInfo_Location** google_protobuf_SourceCodeInfo_resize_location(google_protobuf_SourceCodeInfo *msg, size_t len, upb_arena *arena) {
|
2762
|
-
return (google_protobuf_SourceCodeInfo_Location**)_upb_array_resize_accessor(msg, UPB_SIZE(0, 0), len,
|
2926
|
+
return (google_protobuf_SourceCodeInfo_Location**)_upb_array_resize_accessor(msg, UPB_SIZE(0, 0), len, UPB_TYPE_MESSAGE, arena);
|
2763
2927
|
}
|
2764
2928
|
UPB_INLINE struct google_protobuf_SourceCodeInfo_Location* google_protobuf_SourceCodeInfo_add_location(google_protobuf_SourceCodeInfo *msg, upb_arena *arena) {
|
2765
|
-
struct google_protobuf_SourceCodeInfo_Location* sub = (struct google_protobuf_SourceCodeInfo_Location*)
|
2929
|
+
struct google_protobuf_SourceCodeInfo_Location* sub = (struct google_protobuf_SourceCodeInfo_Location*)_upb_msg_new(&google_protobuf_SourceCodeInfo_Location_msginit, arena);
|
2766
2930
|
bool ok = _upb_array_append_accessor(
|
2767
2931
|
msg, UPB_SIZE(0, 0), UPB_SIZE(4, 8), UPB_TYPE_MESSAGE, &sub, arena);
|
2768
2932
|
if (!ok) return NULL;
|
@@ -2772,7 +2936,7 @@ UPB_INLINE struct google_protobuf_SourceCodeInfo_Location* google_protobuf_Sourc
|
|
2772
2936
|
/* google.protobuf.SourceCodeInfo.Location */
|
2773
2937
|
|
2774
2938
|
UPB_INLINE google_protobuf_SourceCodeInfo_Location *google_protobuf_SourceCodeInfo_Location_new(upb_arena *arena) {
|
2775
|
-
return (google_protobuf_SourceCodeInfo_Location *)
|
2939
|
+
return (google_protobuf_SourceCodeInfo_Location *)_upb_msg_new(&google_protobuf_SourceCodeInfo_Location_msginit, arena);
|
2776
2940
|
}
|
2777
2941
|
UPB_INLINE google_protobuf_SourceCodeInfo_Location *google_protobuf_SourceCodeInfo_Location_parse(const char *buf, size_t size,
|
2778
2942
|
upb_arena *arena) {
|
@@ -2786,54 +2950,54 @@ UPB_INLINE char *google_protobuf_SourceCodeInfo_Location_serialize(const google_
|
|
2786
2950
|
UPB_INLINE int32_t const* google_protobuf_SourceCodeInfo_Location_path(const google_protobuf_SourceCodeInfo_Location *msg, size_t *len) { return (int32_t const*)_upb_array_accessor(msg, UPB_SIZE(20, 40), len); }
|
2787
2951
|
UPB_INLINE int32_t const* google_protobuf_SourceCodeInfo_Location_span(const google_protobuf_SourceCodeInfo_Location *msg, size_t *len) { return (int32_t const*)_upb_array_accessor(msg, UPB_SIZE(24, 48), len); }
|
2788
2952
|
UPB_INLINE bool google_protobuf_SourceCodeInfo_Location_has_leading_comments(const google_protobuf_SourceCodeInfo_Location *msg) { return _upb_has_field(msg, 1); }
|
2789
|
-
UPB_INLINE upb_strview google_protobuf_SourceCodeInfo_Location_leading_comments(const google_protobuf_SourceCodeInfo_Location *msg) { return
|
2953
|
+
UPB_INLINE upb_strview google_protobuf_SourceCodeInfo_Location_leading_comments(const google_protobuf_SourceCodeInfo_Location *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_strview); }
|
2790
2954
|
UPB_INLINE bool google_protobuf_SourceCodeInfo_Location_has_trailing_comments(const google_protobuf_SourceCodeInfo_Location *msg) { return _upb_has_field(msg, 2); }
|
2791
|
-
UPB_INLINE upb_strview google_protobuf_SourceCodeInfo_Location_trailing_comments(const google_protobuf_SourceCodeInfo_Location *msg) { return
|
2955
|
+
UPB_INLINE upb_strview google_protobuf_SourceCodeInfo_Location_trailing_comments(const google_protobuf_SourceCodeInfo_Location *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(12, 24), upb_strview); }
|
2792
2956
|
UPB_INLINE upb_strview const* google_protobuf_SourceCodeInfo_Location_leading_detached_comments(const google_protobuf_SourceCodeInfo_Location *msg, size_t *len) { return (upb_strview const*)_upb_array_accessor(msg, UPB_SIZE(28, 56), len); }
|
2793
2957
|
|
2794
2958
|
UPB_INLINE int32_t* google_protobuf_SourceCodeInfo_Location_mutable_path(google_protobuf_SourceCodeInfo_Location *msg, size_t *len) {
|
2795
2959
|
return (int32_t*)_upb_array_mutable_accessor(msg, UPB_SIZE(20, 40), len);
|
2796
2960
|
}
|
2797
2961
|
UPB_INLINE int32_t* google_protobuf_SourceCodeInfo_Location_resize_path(google_protobuf_SourceCodeInfo_Location *msg, size_t len, upb_arena *arena) {
|
2798
|
-
return (int32_t*)_upb_array_resize_accessor(msg, UPB_SIZE(20, 40), len,
|
2962
|
+
return (int32_t*)_upb_array_resize_accessor(msg, UPB_SIZE(20, 40), len, UPB_TYPE_INT32, arena);
|
2799
2963
|
}
|
2800
2964
|
UPB_INLINE bool google_protobuf_SourceCodeInfo_Location_add_path(google_protobuf_SourceCodeInfo_Location *msg, int32_t val, upb_arena *arena) {
|
2801
|
-
return _upb_array_append_accessor(
|
2802
|
-
|
2965
|
+
return _upb_array_append_accessor(msg, UPB_SIZE(20, 40), UPB_SIZE(4, 4), UPB_TYPE_INT32, &val,
|
2966
|
+
arena);
|
2803
2967
|
}
|
2804
2968
|
UPB_INLINE int32_t* google_protobuf_SourceCodeInfo_Location_mutable_span(google_protobuf_SourceCodeInfo_Location *msg, size_t *len) {
|
2805
2969
|
return (int32_t*)_upb_array_mutable_accessor(msg, UPB_SIZE(24, 48), len);
|
2806
2970
|
}
|
2807
2971
|
UPB_INLINE int32_t* google_protobuf_SourceCodeInfo_Location_resize_span(google_protobuf_SourceCodeInfo_Location *msg, size_t len, upb_arena *arena) {
|
2808
|
-
return (int32_t*)_upb_array_resize_accessor(msg, UPB_SIZE(24, 48), len,
|
2972
|
+
return (int32_t*)_upb_array_resize_accessor(msg, UPB_SIZE(24, 48), len, UPB_TYPE_INT32, arena);
|
2809
2973
|
}
|
2810
2974
|
UPB_INLINE bool google_protobuf_SourceCodeInfo_Location_add_span(google_protobuf_SourceCodeInfo_Location *msg, int32_t val, upb_arena *arena) {
|
2811
|
-
return _upb_array_append_accessor(
|
2812
|
-
|
2975
|
+
return _upb_array_append_accessor(msg, UPB_SIZE(24, 48), UPB_SIZE(4, 4), UPB_TYPE_INT32, &val,
|
2976
|
+
arena);
|
2813
2977
|
}
|
2814
2978
|
UPB_INLINE void google_protobuf_SourceCodeInfo_Location_set_leading_comments(google_protobuf_SourceCodeInfo_Location *msg, upb_strview value) {
|
2815
2979
|
_upb_sethas(msg, 1);
|
2816
|
-
|
2980
|
+
*UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_strview) = value;
|
2817
2981
|
}
|
2818
2982
|
UPB_INLINE void google_protobuf_SourceCodeInfo_Location_set_trailing_comments(google_protobuf_SourceCodeInfo_Location *msg, upb_strview value) {
|
2819
2983
|
_upb_sethas(msg, 2);
|
2820
|
-
|
2984
|
+
*UPB_PTR_AT(msg, UPB_SIZE(12, 24), upb_strview) = value;
|
2821
2985
|
}
|
2822
2986
|
UPB_INLINE upb_strview* google_protobuf_SourceCodeInfo_Location_mutable_leading_detached_comments(google_protobuf_SourceCodeInfo_Location *msg, size_t *len) {
|
2823
2987
|
return (upb_strview*)_upb_array_mutable_accessor(msg, UPB_SIZE(28, 56), len);
|
2824
2988
|
}
|
2825
2989
|
UPB_INLINE upb_strview* google_protobuf_SourceCodeInfo_Location_resize_leading_detached_comments(google_protobuf_SourceCodeInfo_Location *msg, size_t len, upb_arena *arena) {
|
2826
|
-
return (upb_strview*)_upb_array_resize_accessor(msg, UPB_SIZE(28, 56), len,
|
2990
|
+
return (upb_strview*)_upb_array_resize_accessor(msg, UPB_SIZE(28, 56), len, UPB_TYPE_STRING, arena);
|
2827
2991
|
}
|
2828
2992
|
UPB_INLINE bool google_protobuf_SourceCodeInfo_Location_add_leading_detached_comments(google_protobuf_SourceCodeInfo_Location *msg, upb_strview val, upb_arena *arena) {
|
2829
|
-
return _upb_array_append_accessor(
|
2830
|
-
|
2993
|
+
return _upb_array_append_accessor(msg, UPB_SIZE(28, 56), UPB_SIZE(8, 16), UPB_TYPE_STRING, &val,
|
2994
|
+
arena);
|
2831
2995
|
}
|
2832
2996
|
|
2833
2997
|
/* google.protobuf.GeneratedCodeInfo */
|
2834
2998
|
|
2835
2999
|
UPB_INLINE google_protobuf_GeneratedCodeInfo *google_protobuf_GeneratedCodeInfo_new(upb_arena *arena) {
|
2836
|
-
return (google_protobuf_GeneratedCodeInfo *)
|
3000
|
+
return (google_protobuf_GeneratedCodeInfo *)_upb_msg_new(&google_protobuf_GeneratedCodeInfo_msginit, arena);
|
2837
3001
|
}
|
2838
3002
|
UPB_INLINE google_protobuf_GeneratedCodeInfo *google_protobuf_GeneratedCodeInfo_parse(const char *buf, size_t size,
|
2839
3003
|
upb_arena *arena) {
|
@@ -2844,16 +3008,17 @@ UPB_INLINE char *google_protobuf_GeneratedCodeInfo_serialize(const google_protob
|
|
2844
3008
|
return upb_encode(msg, &google_protobuf_GeneratedCodeInfo_msginit, arena, len);
|
2845
3009
|
}
|
2846
3010
|
|
3011
|
+
UPB_INLINE bool google_protobuf_GeneratedCodeInfo_has_annotation(const google_protobuf_GeneratedCodeInfo *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(0, 0)); }
|
2847
3012
|
UPB_INLINE const google_protobuf_GeneratedCodeInfo_Annotation* const* google_protobuf_GeneratedCodeInfo_annotation(const google_protobuf_GeneratedCodeInfo *msg, size_t *len) { return (const google_protobuf_GeneratedCodeInfo_Annotation* const*)_upb_array_accessor(msg, UPB_SIZE(0, 0), len); }
|
2848
3013
|
|
2849
3014
|
UPB_INLINE google_protobuf_GeneratedCodeInfo_Annotation** google_protobuf_GeneratedCodeInfo_mutable_annotation(google_protobuf_GeneratedCodeInfo *msg, size_t *len) {
|
2850
3015
|
return (google_protobuf_GeneratedCodeInfo_Annotation**)_upb_array_mutable_accessor(msg, UPB_SIZE(0, 0), len);
|
2851
3016
|
}
|
2852
3017
|
UPB_INLINE google_protobuf_GeneratedCodeInfo_Annotation** google_protobuf_GeneratedCodeInfo_resize_annotation(google_protobuf_GeneratedCodeInfo *msg, size_t len, upb_arena *arena) {
|
2853
|
-
return (google_protobuf_GeneratedCodeInfo_Annotation**)_upb_array_resize_accessor(msg, UPB_SIZE(0, 0), len,
|
3018
|
+
return (google_protobuf_GeneratedCodeInfo_Annotation**)_upb_array_resize_accessor(msg, UPB_SIZE(0, 0), len, UPB_TYPE_MESSAGE, arena);
|
2854
3019
|
}
|
2855
3020
|
UPB_INLINE struct google_protobuf_GeneratedCodeInfo_Annotation* google_protobuf_GeneratedCodeInfo_add_annotation(google_protobuf_GeneratedCodeInfo *msg, upb_arena *arena) {
|
2856
|
-
struct google_protobuf_GeneratedCodeInfo_Annotation* sub = (struct google_protobuf_GeneratedCodeInfo_Annotation*)
|
3021
|
+
struct google_protobuf_GeneratedCodeInfo_Annotation* sub = (struct google_protobuf_GeneratedCodeInfo_Annotation*)_upb_msg_new(&google_protobuf_GeneratedCodeInfo_Annotation_msginit, arena);
|
2857
3022
|
bool ok = _upb_array_append_accessor(
|
2858
3023
|
msg, UPB_SIZE(0, 0), UPB_SIZE(4, 8), UPB_TYPE_MESSAGE, &sub, arena);
|
2859
3024
|
if (!ok) return NULL;
|
@@ -2863,7 +3028,7 @@ UPB_INLINE struct google_protobuf_GeneratedCodeInfo_Annotation* google_protobuf_
|
|
2863
3028
|
/* google.protobuf.GeneratedCodeInfo.Annotation */
|
2864
3029
|
|
2865
3030
|
UPB_INLINE google_protobuf_GeneratedCodeInfo_Annotation *google_protobuf_GeneratedCodeInfo_Annotation_new(upb_arena *arena) {
|
2866
|
-
return (google_protobuf_GeneratedCodeInfo_Annotation *)
|
3031
|
+
return (google_protobuf_GeneratedCodeInfo_Annotation *)_upb_msg_new(&google_protobuf_GeneratedCodeInfo_Annotation_msginit, arena);
|
2867
3032
|
}
|
2868
3033
|
UPB_INLINE google_protobuf_GeneratedCodeInfo_Annotation *google_protobuf_GeneratedCodeInfo_Annotation_parse(const char *buf, size_t size,
|
2869
3034
|
upb_arena *arena) {
|
@@ -2876,33 +3041,33 @@ UPB_INLINE char *google_protobuf_GeneratedCodeInfo_Annotation_serialize(const go
|
|
2876
3041
|
|
2877
3042
|
UPB_INLINE int32_t const* google_protobuf_GeneratedCodeInfo_Annotation_path(const google_protobuf_GeneratedCodeInfo_Annotation *msg, size_t *len) { return (int32_t const*)_upb_array_accessor(msg, UPB_SIZE(20, 32), len); }
|
2878
3043
|
UPB_INLINE bool google_protobuf_GeneratedCodeInfo_Annotation_has_source_file(const google_protobuf_GeneratedCodeInfo_Annotation *msg) { return _upb_has_field(msg, 3); }
|
2879
|
-
UPB_INLINE upb_strview google_protobuf_GeneratedCodeInfo_Annotation_source_file(const google_protobuf_GeneratedCodeInfo_Annotation *msg) { return
|
3044
|
+
UPB_INLINE upb_strview google_protobuf_GeneratedCodeInfo_Annotation_source_file(const google_protobuf_GeneratedCodeInfo_Annotation *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(12, 16), upb_strview); }
|
2880
3045
|
UPB_INLINE bool google_protobuf_GeneratedCodeInfo_Annotation_has_begin(const google_protobuf_GeneratedCodeInfo_Annotation *msg) { return _upb_has_field(msg, 1); }
|
2881
|
-
UPB_INLINE int32_t google_protobuf_GeneratedCodeInfo_Annotation_begin(const google_protobuf_GeneratedCodeInfo_Annotation *msg) { return
|
3046
|
+
UPB_INLINE int32_t google_protobuf_GeneratedCodeInfo_Annotation_begin(const google_protobuf_GeneratedCodeInfo_Annotation *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(4, 4), int32_t); }
|
2882
3047
|
UPB_INLINE bool google_protobuf_GeneratedCodeInfo_Annotation_has_end(const google_protobuf_GeneratedCodeInfo_Annotation *msg) { return _upb_has_field(msg, 2); }
|
2883
|
-
UPB_INLINE int32_t google_protobuf_GeneratedCodeInfo_Annotation_end(const google_protobuf_GeneratedCodeInfo_Annotation *msg) { return
|
3048
|
+
UPB_INLINE int32_t google_protobuf_GeneratedCodeInfo_Annotation_end(const google_protobuf_GeneratedCodeInfo_Annotation *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(8, 8), int32_t); }
|
2884
3049
|
|
2885
3050
|
UPB_INLINE int32_t* google_protobuf_GeneratedCodeInfo_Annotation_mutable_path(google_protobuf_GeneratedCodeInfo_Annotation *msg, size_t *len) {
|
2886
3051
|
return (int32_t*)_upb_array_mutable_accessor(msg, UPB_SIZE(20, 32), len);
|
2887
3052
|
}
|
2888
3053
|
UPB_INLINE int32_t* google_protobuf_GeneratedCodeInfo_Annotation_resize_path(google_protobuf_GeneratedCodeInfo_Annotation *msg, size_t len, upb_arena *arena) {
|
2889
|
-
return (int32_t*)_upb_array_resize_accessor(msg, UPB_SIZE(20, 32), len,
|
3054
|
+
return (int32_t*)_upb_array_resize_accessor(msg, UPB_SIZE(20, 32), len, UPB_TYPE_INT32, arena);
|
2890
3055
|
}
|
2891
3056
|
UPB_INLINE bool google_protobuf_GeneratedCodeInfo_Annotation_add_path(google_protobuf_GeneratedCodeInfo_Annotation *msg, int32_t val, upb_arena *arena) {
|
2892
|
-
return _upb_array_append_accessor(
|
2893
|
-
|
3057
|
+
return _upb_array_append_accessor(msg, UPB_SIZE(20, 32), UPB_SIZE(4, 4), UPB_TYPE_INT32, &val,
|
3058
|
+
arena);
|
2894
3059
|
}
|
2895
3060
|
UPB_INLINE void google_protobuf_GeneratedCodeInfo_Annotation_set_source_file(google_protobuf_GeneratedCodeInfo_Annotation *msg, upb_strview value) {
|
2896
3061
|
_upb_sethas(msg, 3);
|
2897
|
-
|
3062
|
+
*UPB_PTR_AT(msg, UPB_SIZE(12, 16), upb_strview) = value;
|
2898
3063
|
}
|
2899
3064
|
UPB_INLINE void google_protobuf_GeneratedCodeInfo_Annotation_set_begin(google_protobuf_GeneratedCodeInfo_Annotation *msg, int32_t value) {
|
2900
3065
|
_upb_sethas(msg, 1);
|
2901
|
-
|
3066
|
+
*UPB_PTR_AT(msg, UPB_SIZE(4, 4), int32_t) = value;
|
2902
3067
|
}
|
2903
3068
|
UPB_INLINE void google_protobuf_GeneratedCodeInfo_Annotation_set_end(google_protobuf_GeneratedCodeInfo_Annotation *msg, int32_t value) {
|
2904
3069
|
_upb_sethas(msg, 2);
|
2905
|
-
|
3070
|
+
*UPB_PTR_AT(msg, UPB_SIZE(8, 8), int32_t) = value;
|
2906
3071
|
}
|
2907
3072
|
|
2908
3073
|
#ifdef __cplusplus
|
@@ -2915,38 +3080,23 @@ UPB_INLINE void google_protobuf_GeneratedCodeInfo_Annotation_set_end(google_prot
|
|
2915
3080
|
** Defs are upb's internal representation of the constructs that can appear
|
2916
3081
|
** in a .proto file:
|
2917
3082
|
**
|
2918
|
-
** -
|
2919
|
-
** -
|
2920
|
-
** -
|
2921
|
-
** -
|
2922
|
-
** -
|
3083
|
+
** - upb_msgdef: describes a "message" construct.
|
3084
|
+
** - upb_fielddef: describes a message field.
|
3085
|
+
** - upb_filedef: describes a .proto file and its defs.
|
3086
|
+
** - upb_enumdef: describes an enum.
|
3087
|
+
** - upb_oneofdef: describes a oneof.
|
2923
3088
|
**
|
2924
3089
|
** TODO: definitions of services.
|
2925
|
-
**
|
2926
|
-
** This is a mixed C/C++ interface that offers a full API to both languages.
|
2927
|
-
** See the top-level README for more information.
|
2928
3090
|
*/
|
2929
3091
|
|
2930
3092
|
#ifndef UPB_DEF_H_
|
2931
3093
|
#define UPB_DEF_H_
|
2932
3094
|
|
2933
3095
|
|
2934
|
-
#ifdef __cplusplus
|
2935
|
-
#include <cstring>
|
2936
|
-
#include <memory>
|
2937
|
-
#include <string>
|
2938
|
-
#include <vector>
|
2939
|
-
|
2940
|
-
namespace upb {
|
2941
|
-
class EnumDefPtr;
|
2942
|
-
class FieldDefPtr;
|
2943
|
-
class FileDefPtr;
|
2944
|
-
class MessageDefPtr;
|
2945
|
-
class OneofDefPtr;
|
2946
|
-
class SymbolTable;
|
2947
|
-
}
|
2948
|
-
#endif
|
2949
3096
|
|
3097
|
+
#ifdef __cplusplus
|
3098
|
+
extern "C" {
|
3099
|
+
#endif /* __cplusplus */
|
2950
3100
|
|
2951
3101
|
struct upb_enumdef;
|
2952
3102
|
typedef struct upb_enumdef upb_enumdef;
|
@@ -2998,22 +3148,20 @@ typedef enum {
|
|
2998
3148
|
* protobuf wire format. */
|
2999
3149
|
#define UPB_MAX_FIELDNUMBER ((1 << 29) - 1)
|
3000
3150
|
|
3001
|
-
#ifdef __cplusplus
|
3002
|
-
extern "C" {
|
3003
|
-
#endif
|
3004
|
-
|
3005
3151
|
const char *upb_fielddef_fullname(const upb_fielddef *f);
|
3006
3152
|
upb_fieldtype_t upb_fielddef_type(const upb_fielddef *f);
|
3007
3153
|
upb_descriptortype_t upb_fielddef_descriptortype(const upb_fielddef *f);
|
3008
3154
|
upb_label_t upb_fielddef_label(const upb_fielddef *f);
|
3009
3155
|
uint32_t upb_fielddef_number(const upb_fielddef *f);
|
3010
3156
|
const char *upb_fielddef_name(const upb_fielddef *f);
|
3157
|
+
const char *upb_fielddef_jsonname(const upb_fielddef *f);
|
3011
3158
|
bool upb_fielddef_isextension(const upb_fielddef *f);
|
3012
3159
|
bool upb_fielddef_lazy(const upb_fielddef *f);
|
3013
3160
|
bool upb_fielddef_packed(const upb_fielddef *f);
|
3014
|
-
|
3161
|
+
const upb_filedef *upb_fielddef_file(const upb_fielddef *f);
|
3015
3162
|
const upb_msgdef *upb_fielddef_containingtype(const upb_fielddef *f);
|
3016
3163
|
const upb_oneofdef *upb_fielddef_containingoneof(const upb_fielddef *f);
|
3164
|
+
const upb_oneofdef *upb_fielddef_realcontainingoneof(const upb_fielddef *f);
|
3017
3165
|
uint32_t upb_fielddef_index(const upb_fielddef *f);
|
3018
3166
|
bool upb_fielddef_issubmsg(const upb_fielddef *f);
|
3019
3167
|
bool upb_fielddef_isstring(const upb_fielddef *f);
|
@@ -3032,155 +3180,20 @@ bool upb_fielddef_hassubdef(const upb_fielddef *f);
|
|
3032
3180
|
bool upb_fielddef_haspresence(const upb_fielddef *f);
|
3033
3181
|
const upb_msgdef *upb_fielddef_msgsubdef(const upb_fielddef *f);
|
3034
3182
|
const upb_enumdef *upb_fielddef_enumsubdef(const upb_fielddef *f);
|
3183
|
+
const upb_msglayout_field *upb_fielddef_layout(const upb_fielddef *f);
|
3035
3184
|
|
3036
3185
|
/* Internal only. */
|
3037
3186
|
uint32_t upb_fielddef_selectorbase(const upb_fielddef *f);
|
3038
3187
|
|
3039
|
-
#ifdef __cplusplus
|
3040
|
-
} /* extern "C" */
|
3041
|
-
|
3042
|
-
/* A upb_fielddef describes a single field in a message. It is most often
|
3043
|
-
* found as a part of a upb_msgdef, but can also stand alone to represent
|
3044
|
-
* an extension. */
|
3045
|
-
class upb::FieldDefPtr {
|
3046
|
-
public:
|
3047
|
-
FieldDefPtr() : ptr_(nullptr) {}
|
3048
|
-
explicit FieldDefPtr(const upb_fielddef *ptr) : ptr_(ptr) {}
|
3049
|
-
|
3050
|
-
const upb_fielddef* ptr() const { return ptr_; }
|
3051
|
-
explicit operator bool() const { return ptr_ != nullptr; }
|
3052
|
-
|
3053
|
-
typedef upb_fieldtype_t Type;
|
3054
|
-
typedef upb_label_t Label;
|
3055
|
-
typedef upb_descriptortype_t DescriptorType;
|
3056
|
-
|
3057
|
-
const char* full_name() const { return upb_fielddef_fullname(ptr_); }
|
3058
|
-
|
3059
|
-
Type type() const { return upb_fielddef_type(ptr_); }
|
3060
|
-
Label label() const { return upb_fielddef_label(ptr_); }
|
3061
|
-
const char* name() const { return upb_fielddef_name(ptr_); }
|
3062
|
-
uint32_t number() const { return upb_fielddef_number(ptr_); }
|
3063
|
-
bool is_extension() const { return upb_fielddef_isextension(ptr_); }
|
3064
|
-
|
3065
|
-
/* Copies the JSON name for this field into the given buffer. Returns the
|
3066
|
-
* actual size of the JSON name, including the NULL terminator. If the
|
3067
|
-
* return value is 0, the JSON name is unset. If the return value is
|
3068
|
-
* greater than len, the JSON name was truncated. The buffer is always
|
3069
|
-
* NULL-terminated if len > 0.
|
3070
|
-
*
|
3071
|
-
* The JSON name always defaults to a camelCased version of the regular
|
3072
|
-
* name. However if the regular name is unset, the JSON name will be unset
|
3073
|
-
* also.
|
3074
|
-
*/
|
3075
|
-
size_t GetJsonName(char *buf, size_t len) const {
|
3076
|
-
return upb_fielddef_getjsonname(ptr_, buf, len);
|
3077
|
-
}
|
3078
|
-
|
3079
|
-
/* Convenience version of the above function which copies the JSON name
|
3080
|
-
* into the given string, returning false if the name is not set. */
|
3081
|
-
template <class T>
|
3082
|
-
bool GetJsonName(T* str) {
|
3083
|
-
str->resize(GetJsonName(NULL, 0));
|
3084
|
-
GetJsonName(&(*str)[0], str->size());
|
3085
|
-
return str->size() > 0;
|
3086
|
-
}
|
3087
|
-
|
3088
|
-
/* For UPB_TYPE_MESSAGE fields only where is_tag_delimited() == false,
|
3089
|
-
* indicates whether this field should have lazy parsing handlers that yield
|
3090
|
-
* the unparsed string for the submessage.
|
3091
|
-
*
|
3092
|
-
* TODO(haberman): I think we want to move this into a FieldOptions container
|
3093
|
-
* when we add support for custom options (the FieldOptions struct will
|
3094
|
-
* contain both regular FieldOptions like "lazy" *and* custom options). */
|
3095
|
-
bool lazy() const { return upb_fielddef_lazy(ptr_); }
|
3096
|
-
|
3097
|
-
/* For non-string, non-submessage fields, this indicates whether binary
|
3098
|
-
* protobufs are encoded in packed or non-packed format.
|
3099
|
-
*
|
3100
|
-
* TODO(haberman): see note above about putting options like this into a
|
3101
|
-
* FieldOptions container. */
|
3102
|
-
bool packed() const { return upb_fielddef_packed(ptr_); }
|
3103
|
-
|
3104
|
-
/* An integer that can be used as an index into an array of fields for
|
3105
|
-
* whatever message this field belongs to. Guaranteed to be less than
|
3106
|
-
* f->containing_type()->field_count(). May only be accessed once the def has
|
3107
|
-
* been finalized. */
|
3108
|
-
uint32_t index() const { return upb_fielddef_index(ptr_); }
|
3109
|
-
|
3110
|
-
/* The MessageDef to which this field belongs.
|
3111
|
-
*
|
3112
|
-
* If this field has been added to a MessageDef, that message can be retrieved
|
3113
|
-
* directly (this is always the case for frozen FieldDefs).
|
3114
|
-
*
|
3115
|
-
* If the field has not yet been added to a MessageDef, you can set the name
|
3116
|
-
* of the containing type symbolically instead. This is mostly useful for
|
3117
|
-
* extensions, where the extension is declared separately from the message. */
|
3118
|
-
MessageDefPtr containing_type() const;
|
3119
|
-
|
3120
|
-
/* The OneofDef to which this field belongs, or NULL if this field is not part
|
3121
|
-
* of a oneof. */
|
3122
|
-
OneofDefPtr containing_oneof() const;
|
3123
|
-
|
3124
|
-
/* The field's type according to the enum in descriptor.proto. This is not
|
3125
|
-
* the same as UPB_TYPE_*, because it distinguishes between (for example)
|
3126
|
-
* INT32 and SINT32, whereas our "type" enum does not. This return of
|
3127
|
-
* descriptor_type() is a function of type(), integer_format(), and
|
3128
|
-
* is_tag_delimited(). */
|
3129
|
-
DescriptorType descriptor_type() const {
|
3130
|
-
return upb_fielddef_descriptortype(ptr_);
|
3131
|
-
}
|
3132
|
-
|
3133
|
-
/* Convenient field type tests. */
|
3134
|
-
bool IsSubMessage() const { return upb_fielddef_issubmsg(ptr_); }
|
3135
|
-
bool IsString() const { return upb_fielddef_isstring(ptr_); }
|
3136
|
-
bool IsSequence() const { return upb_fielddef_isseq(ptr_); }
|
3137
|
-
bool IsPrimitive() const { return upb_fielddef_isprimitive(ptr_); }
|
3138
|
-
bool IsMap() const { return upb_fielddef_ismap(ptr_); }
|
3139
|
-
|
3140
|
-
/* Returns the non-string default value for this fielddef, which may either
|
3141
|
-
* be something the client set explicitly or the "default default" (0 for
|
3142
|
-
* numbers, empty for strings). The field's type indicates the type of the
|
3143
|
-
* returned value, except for enum fields that are still mutable.
|
3144
|
-
*
|
3145
|
-
* Requires that the given function matches the field's current type. */
|
3146
|
-
int64_t default_int64() const { return upb_fielddef_defaultint64(ptr_); }
|
3147
|
-
int32_t default_int32() const { return upb_fielddef_defaultint32(ptr_); }
|
3148
|
-
uint64_t default_uint64() const { return upb_fielddef_defaultuint64(ptr_); }
|
3149
|
-
uint32_t default_uint32() const { return upb_fielddef_defaultuint32(ptr_); }
|
3150
|
-
bool default_bool() const { return upb_fielddef_defaultbool(ptr_); }
|
3151
|
-
float default_float() const { return upb_fielddef_defaultfloat(ptr_); }
|
3152
|
-
double default_double() const { return upb_fielddef_defaultdouble(ptr_); }
|
3153
|
-
|
3154
|
-
/* The resulting string is always NULL-terminated. If non-NULL, the length
|
3155
|
-
* will be stored in *len. */
|
3156
|
-
const char *default_string(size_t * len) const {
|
3157
|
-
return upb_fielddef_defaultstr(ptr_, len);
|
3158
|
-
}
|
3159
|
-
|
3160
|
-
/* Returns the enum or submessage def for this field, if any. The field's
|
3161
|
-
* type must match (ie. you may only call enum_subdef() for fields where
|
3162
|
-
* type() == UPB_TYPE_ENUM). */
|
3163
|
-
EnumDefPtr enum_subdef() const;
|
3164
|
-
MessageDefPtr message_subdef() const;
|
3165
|
-
|
3166
|
-
private:
|
3167
|
-
const upb_fielddef *ptr_;
|
3168
|
-
};
|
3169
|
-
|
3170
|
-
#endif /* __cplusplus */
|
3171
|
-
|
3172
3188
|
/* upb_oneofdef ***************************************************************/
|
3173
3189
|
|
3174
|
-
#ifdef __cplusplus
|
3175
|
-
extern "C" {
|
3176
|
-
#endif
|
3177
|
-
|
3178
3190
|
typedef upb_inttable_iter upb_oneof_iter;
|
3179
3191
|
|
3180
3192
|
const char *upb_oneofdef_name(const upb_oneofdef *o);
|
3181
3193
|
const upb_msgdef *upb_oneofdef_containingtype(const upb_oneofdef *o);
|
3182
3194
|
int upb_oneofdef_numfields(const upb_oneofdef *o);
|
3183
3195
|
uint32_t upb_oneofdef_index(const upb_oneofdef *o);
|
3196
|
+
bool upb_oneofdef_issynthetic(const upb_oneofdef *o);
|
3184
3197
|
|
3185
3198
|
/* Oneof lookups:
|
3186
3199
|
* - ntof: look up a field by name.
|
@@ -3207,92 +3220,6 @@ void upb_oneof_iter_setdone(upb_oneof_iter *iter);
|
|
3207
3220
|
bool upb_oneof_iter_isequal(const upb_oneof_iter *iter1,
|
3208
3221
|
const upb_oneof_iter *iter2);
|
3209
3222
|
|
3210
|
-
#ifdef __cplusplus
|
3211
|
-
} /* extern "C" */
|
3212
|
-
|
3213
|
-
/* Class that represents a oneof. */
|
3214
|
-
class upb::OneofDefPtr {
|
3215
|
-
public:
|
3216
|
-
OneofDefPtr() : ptr_(nullptr) {}
|
3217
|
-
explicit OneofDefPtr(const upb_oneofdef *ptr) : ptr_(ptr) {}
|
3218
|
-
|
3219
|
-
const upb_oneofdef* ptr() const { return ptr_; }
|
3220
|
-
explicit operator bool() { return ptr_ != nullptr; }
|
3221
|
-
|
3222
|
-
/* Returns the MessageDef that owns this OneofDef. */
|
3223
|
-
MessageDefPtr containing_type() const;
|
3224
|
-
|
3225
|
-
/* Returns the name of this oneof. This is the name used to look up the oneof
|
3226
|
-
* by name once added to a message def. */
|
3227
|
-
const char* name() const { return upb_oneofdef_name(ptr_); }
|
3228
|
-
|
3229
|
-
/* Returns the number of fields currently defined in the oneof. */
|
3230
|
-
int field_count() const { return upb_oneofdef_numfields(ptr_); }
|
3231
|
-
|
3232
|
-
/* Looks up by name. */
|
3233
|
-
FieldDefPtr FindFieldByName(const char *name, size_t len) const {
|
3234
|
-
return FieldDefPtr(upb_oneofdef_ntof(ptr_, name, len));
|
3235
|
-
}
|
3236
|
-
FieldDefPtr FindFieldByName(const char* name) const {
|
3237
|
-
return FieldDefPtr(upb_oneofdef_ntofz(ptr_, name));
|
3238
|
-
}
|
3239
|
-
|
3240
|
-
template <class T>
|
3241
|
-
FieldDefPtr FindFieldByName(const T& str) const {
|
3242
|
-
return FindFieldByName(str.c_str(), str.size());
|
3243
|
-
}
|
3244
|
-
|
3245
|
-
/* Looks up by tag number. */
|
3246
|
-
FieldDefPtr FindFieldByNumber(uint32_t num) const {
|
3247
|
-
return FieldDefPtr(upb_oneofdef_itof(ptr_, num));
|
3248
|
-
}
|
3249
|
-
|
3250
|
-
class const_iterator
|
3251
|
-
: public std::iterator<std::forward_iterator_tag, FieldDefPtr> {
|
3252
|
-
public:
|
3253
|
-
void operator++() { upb_oneof_next(&iter_); }
|
3254
|
-
|
3255
|
-
FieldDefPtr operator*() const {
|
3256
|
-
return FieldDefPtr(upb_oneof_iter_field(&iter_));
|
3257
|
-
}
|
3258
|
-
|
3259
|
-
bool operator!=(const const_iterator& other) const {
|
3260
|
-
return !upb_oneof_iter_isequal(&iter_, &other.iter_);
|
3261
|
-
}
|
3262
|
-
|
3263
|
-
bool operator==(const const_iterator& other) const {
|
3264
|
-
return upb_oneof_iter_isequal(&iter_, &other.iter_);
|
3265
|
-
}
|
3266
|
-
|
3267
|
-
private:
|
3268
|
-
friend class OneofDefPtr;
|
3269
|
-
|
3270
|
-
const_iterator() {}
|
3271
|
-
explicit const_iterator(OneofDefPtr o) {
|
3272
|
-
upb_oneof_begin(&iter_, o.ptr());
|
3273
|
-
}
|
3274
|
-
static const_iterator end() {
|
3275
|
-
const_iterator iter;
|
3276
|
-
upb_oneof_iter_setdone(&iter.iter_);
|
3277
|
-
return iter;
|
3278
|
-
}
|
3279
|
-
|
3280
|
-
upb_oneof_iter iter_;
|
3281
|
-
};
|
3282
|
-
|
3283
|
-
const_iterator begin() const { return const_iterator(*this); }
|
3284
|
-
const_iterator end() const { return const_iterator::end(); }
|
3285
|
-
|
3286
|
-
private:
|
3287
|
-
const upb_oneofdef *ptr_;
|
3288
|
-
};
|
3289
|
-
|
3290
|
-
inline upb::OneofDefPtr upb::FieldDefPtr::containing_oneof() const {
|
3291
|
-
return OneofDefPtr(upb_fielddef_containingoneof(ptr_));
|
3292
|
-
}
|
3293
|
-
|
3294
|
-
#endif /* __cplusplus */
|
3295
|
-
|
3296
3223
|
/* upb_msgdef *****************************************************************/
|
3297
3224
|
|
3298
3225
|
typedef upb_inttable_iter upb_msg_field_iter;
|
@@ -3314,26 +3241,23 @@ typedef upb_strtable_iter upb_msg_oneof_iter;
|
|
3314
3241
|
#define UPB_TIMESTAMP_SECONDS 1
|
3315
3242
|
#define UPB_TIMESTAMP_NANOS 2
|
3316
3243
|
|
3317
|
-
#ifdef __cplusplus
|
3318
|
-
extern "C" {
|
3319
|
-
#endif
|
3320
|
-
|
3321
3244
|
const char *upb_msgdef_fullname(const upb_msgdef *m);
|
3322
3245
|
const upb_filedef *upb_msgdef_file(const upb_msgdef *m);
|
3323
3246
|
const char *upb_msgdef_name(const upb_msgdef *m);
|
3247
|
+
int upb_msgdef_numfields(const upb_msgdef *m);
|
3324
3248
|
int upb_msgdef_numoneofs(const upb_msgdef *m);
|
3249
|
+
int upb_msgdef_numrealoneofs(const upb_msgdef *m);
|
3325
3250
|
upb_syntax_t upb_msgdef_syntax(const upb_msgdef *m);
|
3326
3251
|
bool upb_msgdef_mapentry(const upb_msgdef *m);
|
3327
3252
|
upb_wellknowntype_t upb_msgdef_wellknowntype(const upb_msgdef *m);
|
3328
3253
|
bool upb_msgdef_isnumberwrapper(const upb_msgdef *m);
|
3329
|
-
bool upb_msgdef_setsyntax(upb_msgdef *m, upb_syntax_t syntax);
|
3330
3254
|
const upb_fielddef *upb_msgdef_itof(const upb_msgdef *m, uint32_t i);
|
3331
3255
|
const upb_fielddef *upb_msgdef_ntof(const upb_msgdef *m, const char *name,
|
3332
3256
|
size_t len);
|
3333
3257
|
const upb_oneofdef *upb_msgdef_ntoo(const upb_msgdef *m, const char *name,
|
3334
3258
|
size_t len);
|
3335
|
-
|
3336
|
-
|
3259
|
+
const upb_msglayout *upb_msgdef_layout(const upb_msgdef *m);
|
3260
|
+
const upb_fielddef *_upb_msgdef_field(const upb_msgdef *m, int i);
|
3337
3261
|
|
3338
3262
|
UPB_INLINE const upb_oneofdef *upb_msgdef_ntooz(const upb_msgdef *m,
|
3339
3263
|
const char *name) {
|
@@ -3361,6 +3285,10 @@ UPB_INLINE bool upb_msgdef_lookupnamez(const upb_msgdef *m, const char *name,
|
|
3361
3285
|
return upb_msgdef_lookupname(m, name, strlen(name), f, o);
|
3362
3286
|
}
|
3363
3287
|
|
3288
|
+
/* Returns a field by either JSON name or regular proto name. */
|
3289
|
+
const upb_fielddef *upb_msgdef_lookupjsonname(const upb_msgdef *m,
|
3290
|
+
const char *name, size_t len);
|
3291
|
+
|
3364
3292
|
/* Iteration over fields and oneofs. For example:
|
3365
3293
|
*
|
3366
3294
|
* upb_msg_field_iter i;
|
@@ -3392,194 +3320,6 @@ void upb_msg_oneof_iter_setdone(upb_msg_oneof_iter * iter);
|
|
3392
3320
|
bool upb_msg_oneof_iter_isequal(const upb_msg_oneof_iter *iter1,
|
3393
3321
|
const upb_msg_oneof_iter *iter2);
|
3394
3322
|
|
3395
|
-
#ifdef __cplusplus
|
3396
|
-
} /* extern "C" */
|
3397
|
-
|
3398
|
-
/* Structure that describes a single .proto message type. */
|
3399
|
-
class upb::MessageDefPtr {
|
3400
|
-
public:
|
3401
|
-
MessageDefPtr() : ptr_(nullptr) {}
|
3402
|
-
explicit MessageDefPtr(const upb_msgdef *ptr) : ptr_(ptr) {}
|
3403
|
-
|
3404
|
-
const upb_msgdef *ptr() const { return ptr_; }
|
3405
|
-
explicit operator bool() const { return ptr_ != nullptr; }
|
3406
|
-
|
3407
|
-
const char* full_name() const { return upb_msgdef_fullname(ptr_); }
|
3408
|
-
const char* name() const { return upb_msgdef_name(ptr_); }
|
3409
|
-
|
3410
|
-
/* The number of fields that belong to the MessageDef. */
|
3411
|
-
int field_count() const { return upb_msgdef_numfields(ptr_); }
|
3412
|
-
|
3413
|
-
/* The number of oneofs that belong to the MessageDef. */
|
3414
|
-
int oneof_count() const { return upb_msgdef_numoneofs(ptr_); }
|
3415
|
-
|
3416
|
-
upb_syntax_t syntax() const { return upb_msgdef_syntax(ptr_); }
|
3417
|
-
|
3418
|
-
/* These return null pointers if the field is not found. */
|
3419
|
-
FieldDefPtr FindFieldByNumber(uint32_t number) const {
|
3420
|
-
return FieldDefPtr(upb_msgdef_itof(ptr_, number));
|
3421
|
-
}
|
3422
|
-
FieldDefPtr FindFieldByName(const char* name, size_t len) const {
|
3423
|
-
return FieldDefPtr(upb_msgdef_ntof(ptr_, name, len));
|
3424
|
-
}
|
3425
|
-
FieldDefPtr FindFieldByName(const char *name) const {
|
3426
|
-
return FieldDefPtr(upb_msgdef_ntofz(ptr_, name));
|
3427
|
-
}
|
3428
|
-
|
3429
|
-
template <class T>
|
3430
|
-
FieldDefPtr FindFieldByName(const T& str) const {
|
3431
|
-
return FindFieldByName(str.c_str(), str.size());
|
3432
|
-
}
|
3433
|
-
|
3434
|
-
OneofDefPtr FindOneofByName(const char* name, size_t len) const {
|
3435
|
-
return OneofDefPtr(upb_msgdef_ntoo(ptr_, name, len));
|
3436
|
-
}
|
3437
|
-
|
3438
|
-
OneofDefPtr FindOneofByName(const char *name) const {
|
3439
|
-
return OneofDefPtr(upb_msgdef_ntooz(ptr_, name));
|
3440
|
-
}
|
3441
|
-
|
3442
|
-
template <class T>
|
3443
|
-
OneofDefPtr FindOneofByName(const T &str) const {
|
3444
|
-
return FindOneofByName(str.c_str(), str.size());
|
3445
|
-
}
|
3446
|
-
|
3447
|
-
/* Is this message a map entry? */
|
3448
|
-
bool mapentry() const { return upb_msgdef_mapentry(ptr_); }
|
3449
|
-
|
3450
|
-
/* Return the type of well known type message. UPB_WELLKNOWN_UNSPECIFIED for
|
3451
|
-
* non-well-known message. */
|
3452
|
-
upb_wellknowntype_t wellknowntype() const {
|
3453
|
-
return upb_msgdef_wellknowntype(ptr_);
|
3454
|
-
}
|
3455
|
-
|
3456
|
-
/* Whether is a number wrapper. */
|
3457
|
-
bool isnumberwrapper() const { return upb_msgdef_isnumberwrapper(ptr_); }
|
3458
|
-
|
3459
|
-
/* Iteration over fields. The order is undefined. */
|
3460
|
-
class const_field_iterator
|
3461
|
-
: public std::iterator<std::forward_iterator_tag, FieldDefPtr> {
|
3462
|
-
public:
|
3463
|
-
void operator++() { upb_msg_field_next(&iter_); }
|
3464
|
-
|
3465
|
-
FieldDefPtr operator*() const {
|
3466
|
-
return FieldDefPtr(upb_msg_iter_field(&iter_));
|
3467
|
-
}
|
3468
|
-
|
3469
|
-
bool operator!=(const const_field_iterator &other) const {
|
3470
|
-
return !upb_msg_field_iter_isequal(&iter_, &other.iter_);
|
3471
|
-
}
|
3472
|
-
|
3473
|
-
bool operator==(const const_field_iterator &other) const {
|
3474
|
-
return upb_msg_field_iter_isequal(&iter_, &other.iter_);
|
3475
|
-
}
|
3476
|
-
|
3477
|
-
private:
|
3478
|
-
friend class MessageDefPtr;
|
3479
|
-
|
3480
|
-
explicit const_field_iterator() {}
|
3481
|
-
|
3482
|
-
explicit const_field_iterator(MessageDefPtr msg) {
|
3483
|
-
upb_msg_field_begin(&iter_, msg.ptr());
|
3484
|
-
}
|
3485
|
-
|
3486
|
-
static const_field_iterator end() {
|
3487
|
-
const_field_iterator iter;
|
3488
|
-
upb_msg_field_iter_setdone(&iter.iter_);
|
3489
|
-
return iter;
|
3490
|
-
}
|
3491
|
-
|
3492
|
-
upb_msg_field_iter iter_;
|
3493
|
-
};
|
3494
|
-
|
3495
|
-
/* Iteration over oneofs. The order is undefined. */
|
3496
|
-
class const_oneof_iterator
|
3497
|
-
: public std::iterator<std::forward_iterator_tag, OneofDefPtr> {
|
3498
|
-
public:
|
3499
|
-
|
3500
|
-
void operator++() { upb_msg_oneof_next(&iter_); }
|
3501
|
-
|
3502
|
-
OneofDefPtr operator*() const {
|
3503
|
-
return OneofDefPtr(upb_msg_iter_oneof(&iter_));
|
3504
|
-
}
|
3505
|
-
|
3506
|
-
bool operator!=(const const_oneof_iterator& other) const {
|
3507
|
-
return !upb_msg_oneof_iter_isequal(&iter_, &other.iter_);
|
3508
|
-
}
|
3509
|
-
|
3510
|
-
bool operator==(const const_oneof_iterator &other) const {
|
3511
|
-
return upb_msg_oneof_iter_isequal(&iter_, &other.iter_);
|
3512
|
-
}
|
3513
|
-
|
3514
|
-
private:
|
3515
|
-
friend class MessageDefPtr;
|
3516
|
-
|
3517
|
-
const_oneof_iterator() {}
|
3518
|
-
|
3519
|
-
explicit const_oneof_iterator(MessageDefPtr msg) {
|
3520
|
-
upb_msg_oneof_begin(&iter_, msg.ptr());
|
3521
|
-
}
|
3522
|
-
|
3523
|
-
static const_oneof_iterator end() {
|
3524
|
-
const_oneof_iterator iter;
|
3525
|
-
upb_msg_oneof_iter_setdone(&iter.iter_);
|
3526
|
-
return iter;
|
3527
|
-
}
|
3528
|
-
|
3529
|
-
upb_msg_oneof_iter iter_;
|
3530
|
-
};
|
3531
|
-
|
3532
|
-
class ConstFieldAccessor {
|
3533
|
-
public:
|
3534
|
-
explicit ConstFieldAccessor(const upb_msgdef* md) : md_(md) {}
|
3535
|
-
const_field_iterator begin() { return MessageDefPtr(md_).field_begin(); }
|
3536
|
-
const_field_iterator end() { return MessageDefPtr(md_).field_end(); }
|
3537
|
-
private:
|
3538
|
-
const upb_msgdef* md_;
|
3539
|
-
};
|
3540
|
-
|
3541
|
-
class ConstOneofAccessor {
|
3542
|
-
public:
|
3543
|
-
explicit ConstOneofAccessor(const upb_msgdef* md) : md_(md) {}
|
3544
|
-
const_oneof_iterator begin() { return MessageDefPtr(md_).oneof_begin(); }
|
3545
|
-
const_oneof_iterator end() { return MessageDefPtr(md_).oneof_end(); }
|
3546
|
-
private:
|
3547
|
-
const upb_msgdef* md_;
|
3548
|
-
};
|
3549
|
-
|
3550
|
-
const_field_iterator field_begin() const {
|
3551
|
-
return const_field_iterator(*this);
|
3552
|
-
}
|
3553
|
-
|
3554
|
-
const_field_iterator field_end() const { return const_field_iterator::end(); }
|
3555
|
-
|
3556
|
-
const_oneof_iterator oneof_begin() const {
|
3557
|
-
return const_oneof_iterator(*this);
|
3558
|
-
}
|
3559
|
-
|
3560
|
-
const_oneof_iterator oneof_end() const { return const_oneof_iterator::end(); }
|
3561
|
-
|
3562
|
-
ConstFieldAccessor fields() const { return ConstFieldAccessor(ptr()); }
|
3563
|
-
ConstOneofAccessor oneofs() const { return ConstOneofAccessor(ptr()); }
|
3564
|
-
|
3565
|
-
private:
|
3566
|
-
const upb_msgdef* ptr_;
|
3567
|
-
};
|
3568
|
-
|
3569
|
-
inline upb::MessageDefPtr upb::FieldDefPtr::message_subdef() const {
|
3570
|
-
return MessageDefPtr(upb_fielddef_msgsubdef(ptr_));
|
3571
|
-
}
|
3572
|
-
|
3573
|
-
inline upb::MessageDefPtr upb::FieldDefPtr::containing_type() const {
|
3574
|
-
return MessageDefPtr(upb_fielddef_containingtype(ptr_));
|
3575
|
-
}
|
3576
|
-
|
3577
|
-
inline upb::MessageDefPtr upb::OneofDefPtr::containing_type() const {
|
3578
|
-
return MessageDefPtr(upb_oneofdef_containingtype(ptr_));
|
3579
|
-
}
|
3580
|
-
|
3581
|
-
#endif /* __cplusplus */
|
3582
|
-
|
3583
3323
|
/* upb_enumdef ****************************************************************/
|
3584
3324
|
|
3585
3325
|
typedef upb_strtable_iter upb_enum_iter;
|
@@ -3614,75 +3354,8 @@ bool upb_enum_done(upb_enum_iter *iter);
|
|
3614
3354
|
const char *upb_enum_iter_name(upb_enum_iter *iter);
|
3615
3355
|
int32_t upb_enum_iter_number(upb_enum_iter *iter);
|
3616
3356
|
|
3617
|
-
#ifdef __cplusplus
|
3618
|
-
|
3619
|
-
class upb::EnumDefPtr {
|
3620
|
-
public:
|
3621
|
-
EnumDefPtr() : ptr_(nullptr) {}
|
3622
|
-
explicit EnumDefPtr(const upb_enumdef* ptr) : ptr_(ptr) {}
|
3623
|
-
|
3624
|
-
const upb_enumdef* ptr() const { return ptr_; }
|
3625
|
-
explicit operator bool() const { return ptr_ != nullptr; }
|
3626
|
-
|
3627
|
-
const char* full_name() const { return upb_enumdef_fullname(ptr_); }
|
3628
|
-
const char* name() const { return upb_enumdef_name(ptr_); }
|
3629
|
-
|
3630
|
-
/* The value that is used as the default when no field default is specified.
|
3631
|
-
* If not set explicitly, the first value that was added will be used.
|
3632
|
-
* The default value must be a member of the enum.
|
3633
|
-
* Requires that value_count() > 0. */
|
3634
|
-
int32_t default_value() const { return upb_enumdef_default(ptr_); }
|
3635
|
-
|
3636
|
-
/* Returns the number of values currently defined in the enum. Note that
|
3637
|
-
* multiple names can refer to the same number, so this may be greater than
|
3638
|
-
* the total number of unique numbers. */
|
3639
|
-
int value_count() const { return upb_enumdef_numvals(ptr_); }
|
3640
|
-
|
3641
|
-
/* Lookups from name to integer, returning true if found. */
|
3642
|
-
bool FindValueByName(const char *name, int32_t *num) const {
|
3643
|
-
return upb_enumdef_ntoiz(ptr_, name, num);
|
3644
|
-
}
|
3645
|
-
|
3646
|
-
/* Finds the name corresponding to the given number, or NULL if none was
|
3647
|
-
* found. If more than one name corresponds to this number, returns the
|
3648
|
-
* first one that was added. */
|
3649
|
-
const char *FindValueByNumber(int32_t num) const {
|
3650
|
-
return upb_enumdef_iton(ptr_, num);
|
3651
|
-
}
|
3652
|
-
|
3653
|
-
/* Iteration over name/value pairs. The order is undefined.
|
3654
|
-
* Adding an enum val invalidates any iterators.
|
3655
|
-
*
|
3656
|
-
* TODO: make compatible with range-for, with elements as pairs? */
|
3657
|
-
class Iterator {
|
3658
|
-
public:
|
3659
|
-
explicit Iterator(EnumDefPtr e) { upb_enum_begin(&iter_, e.ptr()); }
|
3660
|
-
|
3661
|
-
int32_t number() { return upb_enum_iter_number(&iter_); }
|
3662
|
-
const char *name() { return upb_enum_iter_name(&iter_); }
|
3663
|
-
bool Done() { return upb_enum_done(&iter_); }
|
3664
|
-
void Next() { return upb_enum_next(&iter_); }
|
3665
|
-
|
3666
|
-
private:
|
3667
|
-
upb_enum_iter iter_;
|
3668
|
-
};
|
3669
|
-
|
3670
|
-
private:
|
3671
|
-
const upb_enumdef *ptr_;
|
3672
|
-
};
|
3673
|
-
|
3674
|
-
inline upb::EnumDefPtr upb::FieldDefPtr::enum_subdef() const {
|
3675
|
-
return EnumDefPtr(upb_fielddef_enumsubdef(ptr_));
|
3676
|
-
}
|
3677
|
-
|
3678
|
-
#endif /* __cplusplus */
|
3679
|
-
|
3680
3357
|
/* upb_filedef ****************************************************************/
|
3681
3358
|
|
3682
|
-
#ifdef __cplusplus
|
3683
|
-
extern "C" {
|
3684
|
-
#endif
|
3685
|
-
|
3686
3359
|
const char *upb_filedef_name(const upb_filedef *f);
|
3687
3360
|
const char *upb_filedef_package(const upb_filedef *f);
|
3688
3361
|
const char *upb_filedef_phpprefix(const upb_filedef *f);
|
@@ -3695,57 +3368,8 @@ const upb_filedef *upb_filedef_dep(const upb_filedef *f, int i);
|
|
3695
3368
|
const upb_msgdef *upb_filedef_msg(const upb_filedef *f, int i);
|
3696
3369
|
const upb_enumdef *upb_filedef_enum(const upb_filedef *f, int i);
|
3697
3370
|
|
3698
|
-
#ifdef __cplusplus
|
3699
|
-
} /* extern "C" */
|
3700
|
-
|
3701
|
-
/* Class that represents a .proto file with some things defined in it.
|
3702
|
-
*
|
3703
|
-
* Many users won't care about FileDefs, but they are necessary if you want to
|
3704
|
-
* read the values of file-level options. */
|
3705
|
-
class upb::FileDefPtr {
|
3706
|
-
public:
|
3707
|
-
explicit FileDefPtr(const upb_filedef *ptr) : ptr_(ptr) {}
|
3708
|
-
|
3709
|
-
const upb_filedef* ptr() const { return ptr_; }
|
3710
|
-
explicit operator bool() const { return ptr_ != nullptr; }
|
3711
|
-
|
3712
|
-
/* Get/set name of the file (eg. "foo/bar.proto"). */
|
3713
|
-
const char* name() const { return upb_filedef_name(ptr_); }
|
3714
|
-
|
3715
|
-
/* Package name for definitions inside the file (eg. "foo.bar"). */
|
3716
|
-
const char* package() const { return upb_filedef_package(ptr_); }
|
3717
|
-
|
3718
|
-
/* Sets the php class prefix which is prepended to all php generated classes
|
3719
|
-
* from this .proto. Default is empty. */
|
3720
|
-
const char* phpprefix() const { return upb_filedef_phpprefix(ptr_); }
|
3721
|
-
|
3722
|
-
/* Use this option to change the namespace of php generated classes. Default
|
3723
|
-
* is empty. When this option is empty, the package name will be used for
|
3724
|
-
* determining the namespace. */
|
3725
|
-
const char* phpnamespace() const { return upb_filedef_phpnamespace(ptr_); }
|
3726
|
-
|
3727
|
-
/* Syntax for the file. Defaults to proto2. */
|
3728
|
-
upb_syntax_t syntax() const { return upb_filedef_syntax(ptr_); }
|
3729
|
-
|
3730
|
-
/* Get the list of dependencies from the file. These are returned in the
|
3731
|
-
* order that they were added to the FileDefPtr. */
|
3732
|
-
int dependency_count() const { return upb_filedef_depcount(ptr_); }
|
3733
|
-
const FileDefPtr dependency(int index) const {
|
3734
|
-
return FileDefPtr(upb_filedef_dep(ptr_, index));
|
3735
|
-
}
|
3736
|
-
|
3737
|
-
private:
|
3738
|
-
const upb_filedef* ptr_;
|
3739
|
-
};
|
3740
|
-
|
3741
|
-
#endif /* __cplusplus */
|
3742
|
-
|
3743
3371
|
/* upb_symtab *****************************************************************/
|
3744
3372
|
|
3745
|
-
#ifdef __cplusplus
|
3746
|
-
extern "C" {
|
3747
|
-
#endif
|
3748
|
-
|
3749
3373
|
upb_symtab *upb_symtab_new(void);
|
3750
3374
|
void upb_symtab_free(upb_symtab* s);
|
3751
3375
|
const upb_msgdef *upb_symtab_lookupmsg(const upb_symtab *s, const char *sym);
|
@@ -3760,107 +3384,171 @@ const upb_filedef *upb_symtab_addfile(
|
|
3760
3384
|
|
3761
3385
|
/* For generated code only: loads a generated descriptor. */
|
3762
3386
|
typedef struct upb_def_init {
|
3763
|
-
struct upb_def_init **deps;
|
3387
|
+
struct upb_def_init **deps; /* Dependencies of this file. */
|
3388
|
+
const upb_msglayout **layouts; /* Pre-order layouts of all messages. */
|
3764
3389
|
const char *filename;
|
3765
|
-
upb_strview descriptor;
|
3390
|
+
upb_strview descriptor; /* Serialized descriptor. */
|
3766
3391
|
} upb_def_init;
|
3767
3392
|
|
3768
3393
|
bool _upb_symtab_loaddefinit(upb_symtab *s, const upb_def_init *init);
|
3769
3394
|
|
3395
|
+
|
3770
3396
|
#ifdef __cplusplus
|
3771
3397
|
} /* extern "C" */
|
3398
|
+
#endif /* __cplusplus */
|
3772
3399
|
|
3773
|
-
/*
|
3774
|
-
class upb::SymbolTable {
|
3775
|
-
public:
|
3776
|
-
SymbolTable() : ptr_(upb_symtab_new(), upb_symtab_free) {}
|
3777
|
-
explicit SymbolTable(upb_symtab* s) : ptr_(s, upb_symtab_free) {}
|
3400
|
+
#endif /* UPB_DEF_H_ */
|
3778
3401
|
|
3779
|
-
|
3780
|
-
|
3402
|
+
#ifndef UPB_REFLECTION_H_
|
3403
|
+
#define UPB_REFLECTION_H_
|
3781
3404
|
|
3782
|
-
/* Finds an entry in the symbol table with this exact name. If not found,
|
3783
|
-
* returns NULL. */
|
3784
|
-
MessageDefPtr LookupMessage(const char *sym) const {
|
3785
|
-
return MessageDefPtr(upb_symtab_lookupmsg(ptr_.get(), sym));
|
3786
|
-
}
|
3787
3405
|
|
3788
|
-
EnumDefPtr LookupEnum(const char *sym) const {
|
3789
|
-
return EnumDefPtr(upb_symtab_lookupenum(ptr_.get(), sym));
|
3790
|
-
}
|
3791
3406
|
|
3792
|
-
|
3793
|
-
|
3794
|
-
|
3407
|
+
typedef union {
|
3408
|
+
bool bool_val;
|
3409
|
+
float float_val;
|
3410
|
+
double double_val;
|
3411
|
+
int32_t int32_val;
|
3412
|
+
int64_t int64_val;
|
3413
|
+
uint32_t uint32_val;
|
3414
|
+
uint64_t uint64_val;
|
3415
|
+
const upb_map* map_val;
|
3416
|
+
const upb_msg* msg_val;
|
3417
|
+
const upb_array* array_val;
|
3418
|
+
upb_strview str_val;
|
3419
|
+
} upb_msgval;
|
3795
3420
|
|
3796
|
-
|
3421
|
+
typedef union {
|
3422
|
+
upb_map* map;
|
3423
|
+
upb_msg* msg;
|
3424
|
+
upb_array* array;
|
3425
|
+
} upb_mutmsgval;
|
3797
3426
|
|
3798
|
-
|
3799
|
-
FileDefPtr AddFile(const google_protobuf_FileDescriptorProto *file_proto,
|
3800
|
-
Status *status) {
|
3801
|
-
return FileDefPtr(
|
3802
|
-
upb_symtab_addfile(ptr_.get(), file_proto, status->ptr()));
|
3803
|
-
}
|
3427
|
+
/** upb_msg *******************************************************************/
|
3804
3428
|
|
3805
|
-
|
3806
|
-
|
3807
|
-
};
|
3429
|
+
/* Creates a new message of the given type in the given arena. */
|
3430
|
+
upb_msg *upb_msg_new(const upb_msgdef *m, upb_arena *a);
|
3808
3431
|
|
3809
|
-
|
3810
|
-
|
3811
|
-
return str.c_str();
|
3812
|
-
}
|
3432
|
+
/* Returns the value associated with this field. */
|
3433
|
+
upb_msgval upb_msg_get(const upb_msg *msg, const upb_fielddef *f);
|
3813
3434
|
|
3814
|
-
|
3435
|
+
/* Returns a mutable pointer to a map, array, or submessage value. If the given
|
3436
|
+
* arena is non-NULL this will construct a new object if it was not previously
|
3437
|
+
* present. May not be called for primitive fields. */
|
3438
|
+
upb_mutmsgval upb_msg_mutable(upb_msg *msg, const upb_fielddef *f, upb_arena *a);
|
3815
3439
|
|
3440
|
+
/* May only be called for fields where upb_fielddef_haspresence(f) == true. */
|
3441
|
+
bool upb_msg_has(const upb_msg *msg, const upb_fielddef *f);
|
3816
3442
|
|
3817
|
-
|
3443
|
+
/* Returns whether any field is set in the oneof. */
|
3444
|
+
bool upb_msg_hasoneof(const upb_msg *msg, const upb_oneofdef *o);
|
3445
|
+
|
3446
|
+
/* Sets the given field to the given value. For a msg/array/map/string, the
|
3447
|
+
* value must be in the same arena. */
|
3448
|
+
void upb_msg_set(upb_msg *msg, const upb_fielddef *f, upb_msgval val,
|
3449
|
+
upb_arena *a);
|
3818
3450
|
|
3451
|
+
/* Clears any field presence and sets the value back to its default. */
|
3452
|
+
void upb_msg_clearfield(upb_msg *msg, const upb_fielddef *f);
|
3819
3453
|
|
3820
|
-
|
3821
|
-
|
3454
|
+
/* Iterate over present fields.
|
3455
|
+
*
|
3456
|
+
* size_t iter = UPB_MSG_BEGIN;
|
3457
|
+
* const upb_fielddef *f;
|
3458
|
+
* upb_msgval val;
|
3459
|
+
* while (upb_msg_next(msg, m, ext_pool, &f, &val, &iter)) {
|
3460
|
+
* process_field(f, val);
|
3461
|
+
* }
|
3462
|
+
*
|
3463
|
+
* If ext_pool is NULL, no extensions will be returned. If the given symtab
|
3464
|
+
* returns extensions that don't match what is in this message, those extensions
|
3465
|
+
* will be skipped.
|
3466
|
+
*/
|
3822
3467
|
|
3823
|
-
|
3468
|
+
#define UPB_MSG_BEGIN -1
|
3469
|
+
bool upb_msg_next(const upb_msg *msg, const upb_msgdef *m,
|
3470
|
+
const upb_symtab *ext_pool, const upb_fielddef **f,
|
3471
|
+
upb_msgval *val, size_t *iter);
|
3824
3472
|
|
3825
|
-
|
3826
|
-
|
3473
|
+
/* Adds unknown data (serialized protobuf data) to the given message. The data
|
3474
|
+
* is copied into the message instance. */
|
3475
|
+
void upb_msg_addunknown(upb_msg *msg, const char *data, size_t len,
|
3476
|
+
upb_arena *arena);
|
3827
3477
|
|
3828
|
-
|
3829
|
-
|
3830
|
-
#endif
|
3478
|
+
/* Returns a reference to the message's unknown data. */
|
3479
|
+
const char *upb_msg_getunknown(const upb_msg *msg, size_t *len);
|
3831
3480
|
|
3832
|
-
|
3833
|
-
* upb_visitorplan objects. These are the objects necessary to represent,
|
3834
|
-
* populate, and and visit upb_msg objects.
|
3835
|
-
*
|
3836
|
-
* These caches are all populated by upb_msgdef, and lazily created on demand.
|
3837
|
-
*/
|
3481
|
+
/** upb_array *****************************************************************/
|
3838
3482
|
|
3839
|
-
/* Creates
|
3840
|
-
*
|
3841
|
-
upb_msgfactory *upb_msgfactory_new(const upb_symtab *symtab);
|
3842
|
-
void upb_msgfactory_free(upb_msgfactory *f);
|
3483
|
+
/* Creates a new array on the given arena that holds elements of this type. */
|
3484
|
+
upb_array *upb_array_new(upb_arena *a, upb_fieldtype_t type);
|
3843
3485
|
|
3844
|
-
|
3486
|
+
/* Returns the size of the array. */
|
3487
|
+
size_t upb_array_size(const upb_array *arr);
|
3845
3488
|
|
3846
|
-
/*
|
3847
|
-
*
|
3848
|
-
|
3849
|
-
|
3850
|
-
|
3489
|
+
/* Returns the given element, which must be within the array's current size. */
|
3490
|
+
upb_msgval upb_array_get(const upb_array *arr, size_t i);
|
3491
|
+
|
3492
|
+
/* Sets the given element, which must be within the array's current size. */
|
3493
|
+
void upb_array_set(upb_array *arr, size_t i, upb_msgval val);
|
3494
|
+
|
3495
|
+
/* Appends an element to the array. Returns false on allocation failure. */
|
3496
|
+
bool upb_array_append(upb_array *array, upb_msgval val, upb_arena *arena);
|
3497
|
+
|
3498
|
+
/* Changes the size of a vector. New elements are initialized to empty/0.
|
3499
|
+
* Returns false on allocation failure. */
|
3500
|
+
bool upb_array_resize(upb_array *array, size_t size, upb_arena *arena);
|
3501
|
+
|
3502
|
+
/** upb_map *******************************************************************/
|
3503
|
+
|
3504
|
+
/* Creates a new map on the given arena with the given key/value size. */
|
3505
|
+
upb_map *upb_map_new(upb_arena *a, upb_fieldtype_t key_type,
|
3506
|
+
upb_fieldtype_t value_type);
|
3507
|
+
|
3508
|
+
/* Returns the number of entries in the map. */
|
3509
|
+
size_t upb_map_size(const upb_map *map);
|
3510
|
+
|
3511
|
+
/* Stores a value for the given key into |*val| (or the zero value if the key is
|
3512
|
+
* not present). Returns whether the key was present. The |val| pointer may be
|
3513
|
+
* NULL, in which case the function tests whether the given key is present. */
|
3514
|
+
bool upb_map_get(const upb_map *map, upb_msgval key, upb_msgval *val);
|
3515
|
+
|
3516
|
+
/* Removes all entries in the map. */
|
3517
|
+
void upb_map_clear(upb_map *map);
|
3518
|
+
|
3519
|
+
/* Sets the given key to the given value. Returns true if this was a new key in
|
3520
|
+
* the map, or false if an existing key was replaced. */
|
3521
|
+
bool upb_map_set(upb_map *map, upb_msgval key, upb_msgval val,
|
3522
|
+
upb_arena *arena);
|
3523
|
+
|
3524
|
+
/* Deletes this key from the table. Returns true if the key was present. */
|
3525
|
+
bool upb_map_delete(upb_map *map, upb_msgval key);
|
3526
|
+
|
3527
|
+
/* Map iteration:
|
3851
3528
|
*
|
3852
|
-
*
|
3529
|
+
* size_t iter = UPB_MAP_BEGIN;
|
3530
|
+
* while (upb_mapiter_next(map, &iter)) {
|
3531
|
+
* upb_msgval key = upb_mapiter_key(map, iter);
|
3532
|
+
* upb_msgval val = upb_mapiter_value(map, iter);
|
3853
3533
|
*
|
3854
|
-
*
|
3855
|
-
*
|
3856
|
-
|
3857
|
-
|
3534
|
+
* // If mutating is desired.
|
3535
|
+
* upb_mapiter_setvalue(map, iter, value2);
|
3536
|
+
* }
|
3537
|
+
*/
|
3538
|
+
|
3539
|
+
/* Advances to the next entry. Returns false if no more entries are present. */
|
3540
|
+
bool upb_mapiter_next(const upb_map *map, size_t *iter);
|
3541
|
+
|
3542
|
+
/* Returns the key and value for this entry of the map. */
|
3543
|
+
upb_msgval upb_mapiter_key(const upb_map *map, size_t iter);
|
3544
|
+
upb_msgval upb_mapiter_value(const upb_map *map, size_t iter);
|
3545
|
+
|
3546
|
+
/* Sets the value for this entry. The iterator must not be done, and the
|
3547
|
+
* iterator must not have been initialized const. */
|
3548
|
+
void upb_mapiter_setvalue(upb_map *map, size_t iter, upb_msgval value);
|
3858
3549
|
|
3859
|
-
#ifdef __cplusplus
|
3860
|
-
} /* extern "C" */
|
3861
|
-
#endif
|
3862
3550
|
|
3863
|
-
#endif /*
|
3551
|
+
#endif /* UPB_REFLECTION_H_ */
|
3864
3552
|
/*
|
3865
3553
|
** upb::Handlers (upb_handlers)
|
3866
3554
|
**
|
@@ -5693,15 +5381,16 @@ UPB_INLINE bool upb_sink_startsubmsg(upb_sink s, upb_selector_t sel,
|
|
5693
5381
|
return sub->closure ? true : false;
|
5694
5382
|
}
|
5695
5383
|
|
5696
|
-
UPB_INLINE bool upb_sink_endsubmsg(upb_sink s,
|
5384
|
+
UPB_INLINE bool upb_sink_endsubmsg(upb_sink s, upb_sink sub,
|
5385
|
+
upb_selector_t sel) {
|
5697
5386
|
typedef upb_endfield_handlerfunc func;
|
5698
5387
|
func *endsubmsg;
|
5699
5388
|
const void *hd;
|
5700
5389
|
if (!s.handlers) return true;
|
5701
5390
|
endsubmsg = (func*)upb_handlers_gethandler(s.handlers, sel, &hd);
|
5702
5391
|
|
5703
|
-
if (!endsubmsg) return
|
5704
|
-
return endsubmsg(
|
5392
|
+
if (!endsubmsg) return true;
|
5393
|
+
return endsubmsg(sub.closure, hd);
|
5705
5394
|
}
|
5706
5395
|
|
5707
5396
|
#ifdef __cplusplus
|
@@ -5867,8 +5556,8 @@ class upb::Sink {
|
|
5867
5556
|
return ret;
|
5868
5557
|
}
|
5869
5558
|
|
5870
|
-
bool EndSubMessage(HandlersPtr::Selector s) {
|
5871
|
-
return upb_sink_endsubmsg(sink_, s);
|
5559
|
+
bool EndSubMessage(HandlersPtr::Selector s, Sink sub) {
|
5560
|
+
return upb_sink_endsubmsg(sink_, sub.sink_, s);
|
5872
5561
|
}
|
5873
5562
|
|
5874
5563
|
/* For repeated fields of any type, the sequence of values must be wrapped in
|
@@ -6567,21 +6256,22 @@ extern "C" {
|
|
6567
6256
|
* descriptor type (upb_descriptortype_t). */
|
6568
6257
|
extern const uint8_t upb_pb_native_wire_types[];
|
6569
6258
|
|
6570
|
-
UPB_INLINE uint64_t byteswap64(uint64_t val)
|
6571
|
-
|
6572
|
-
return (
|
6573
|
-
| (
|
6574
|
-
| (
|
6575
|
-
| (
|
6576
|
-
| (
|
6577
|
-
| (
|
6578
|
-
| (
|
6579
|
-
| (
|
6259
|
+
UPB_INLINE uint64_t byteswap64(uint64_t val) {
|
6260
|
+
uint64_t byte = 0xff;
|
6261
|
+
return (val & (byte << 56) >> 56)
|
6262
|
+
| (val & (byte << 48) >> 40)
|
6263
|
+
| (val & (byte << 40) >> 24)
|
6264
|
+
| (val & (byte << 32) >> 8)
|
6265
|
+
| (val & (byte << 24) << 8)
|
6266
|
+
| (val & (byte << 16) << 24)
|
6267
|
+
| (val & (byte << 8) << 40)
|
6268
|
+
| (val & (byte << 0) << 56);
|
6580
6269
|
}
|
6581
6270
|
|
6582
6271
|
/* Zig-zag encoding/decoding **************************************************/
|
6583
6272
|
|
6584
|
-
UPB_INLINE int32_t upb_zzdec_32(
|
6273
|
+
UPB_INLINE int32_t upb_zzdec_32(uint64_t _n) {
|
6274
|
+
uint32_t n = (uint32_t)_n;
|
6585
6275
|
return (n >> 1) ^ -(int32_t)(n & 1);
|
6586
6276
|
}
|
6587
6277
|
UPB_INLINE int64_t upb_zzdec_64(uint64_t n) {
|
@@ -7064,8 +6754,9 @@ class upb::json::PrinterPtr {
|
|
7064
6754
|
#endif /* UPB_JSON_TYPED_PRINTER_H_ */
|
7065
6755
|
/* See port_def.inc. This should #undef all macros #defined there. */
|
7066
6756
|
|
6757
|
+
#undef UPB_MAPTYPE_STRING
|
7067
6758
|
#undef UPB_SIZE
|
7068
|
-
#undef
|
6759
|
+
#undef UPB_PTR_AT
|
7069
6760
|
#undef UPB_READ_ONEOF
|
7070
6761
|
#undef UPB_WRITE_ONEOF
|
7071
6762
|
#undef UPB_INLINE
|
@@ -7075,6 +6766,7 @@ class upb::json::PrinterPtr {
|
|
7075
6766
|
#undef UPB_MAX
|
7076
6767
|
#undef UPB_MIN
|
7077
6768
|
#undef UPB_UNUSED
|
6769
|
+
#undef UPB_ASSUME
|
7078
6770
|
#undef UPB_ASSERT
|
7079
6771
|
#undef UPB_ASSERT_DEBUGVAR
|
7080
6772
|
#undef UPB_UNREACHABLE
|