1 /* This file was generated by upbc (the upb compiler) from the input
4 * google/protobuf/wrappers.proto
6 * Do not edit -- your changes will be discarded when the file is
9 #ifndef GOOGLE_PROTOBUF_WRAPPERS_PROTO_UPB_H_
10 #define GOOGLE_PROTOBUF_WRAPPERS_PROTO_UPB_H_
12 #include "upb/generated_util.h"
14 #include "upb/decode.h"
15 #include "upb/encode.h"
17 #include "upb/port_def.inc"
23 struct google_protobuf_DoubleValue;
24 struct google_protobuf_FloatValue;
25 struct google_protobuf_Int64Value;
26 struct google_protobuf_UInt64Value;
27 struct google_protobuf_Int32Value;
28 struct google_protobuf_UInt32Value;
29 struct google_protobuf_BoolValue;
30 struct google_protobuf_StringValue;
31 struct google_protobuf_BytesValue;
32 typedef struct google_protobuf_DoubleValue google_protobuf_DoubleValue;
33 typedef struct google_protobuf_FloatValue google_protobuf_FloatValue;
34 typedef struct google_protobuf_Int64Value google_protobuf_Int64Value;
35 typedef struct google_protobuf_UInt64Value google_protobuf_UInt64Value;
36 typedef struct google_protobuf_Int32Value google_protobuf_Int32Value;
37 typedef struct google_protobuf_UInt32Value google_protobuf_UInt32Value;
38 typedef struct google_protobuf_BoolValue google_protobuf_BoolValue;
39 typedef struct google_protobuf_StringValue google_protobuf_StringValue;
40 typedef struct google_protobuf_BytesValue google_protobuf_BytesValue;
41 extern const upb_msglayout google_protobuf_DoubleValue_msginit;
42 extern const upb_msglayout google_protobuf_FloatValue_msginit;
43 extern const upb_msglayout google_protobuf_Int64Value_msginit;
44 extern const upb_msglayout google_protobuf_UInt64Value_msginit;
45 extern const upb_msglayout google_protobuf_Int32Value_msginit;
46 extern const upb_msglayout google_protobuf_UInt32Value_msginit;
47 extern const upb_msglayout google_protobuf_BoolValue_msginit;
48 extern const upb_msglayout google_protobuf_StringValue_msginit;
49 extern const upb_msglayout google_protobuf_BytesValue_msginit;
52 /* google.protobuf.DoubleValue */
54 UPB_INLINE google_protobuf_DoubleValue *google_protobuf_DoubleValue_new(upb_arena *arena) {
55 return (google_protobuf_DoubleValue *)upb_msg_new(&google_protobuf_DoubleValue_msginit, arena);
57 UPB_INLINE google_protobuf_DoubleValue *google_protobuf_DoubleValue_parse(const char *buf, size_t size,
59 google_protobuf_DoubleValue *ret = google_protobuf_DoubleValue_new(arena);
60 return (ret && upb_decode(buf, size, ret, &google_protobuf_DoubleValue_msginit, arena)) ? ret : NULL;
62 UPB_INLINE char *google_protobuf_DoubleValue_serialize(const google_protobuf_DoubleValue *msg, upb_arena *arena, size_t *len) {
63 return upb_encode(msg, &google_protobuf_DoubleValue_msginit, arena, len);
66 UPB_INLINE double google_protobuf_DoubleValue_value(const google_protobuf_DoubleValue *msg) { return UPB_FIELD_AT(msg, double, UPB_SIZE(0, 0)); }
68 UPB_INLINE void google_protobuf_DoubleValue_set_value(google_protobuf_DoubleValue *msg, double value) {
69 UPB_FIELD_AT(msg, double, UPB_SIZE(0, 0)) = value;
72 /* google.protobuf.FloatValue */
74 UPB_INLINE google_protobuf_FloatValue *google_protobuf_FloatValue_new(upb_arena *arena) {
75 return (google_protobuf_FloatValue *)upb_msg_new(&google_protobuf_FloatValue_msginit, arena);
77 UPB_INLINE google_protobuf_FloatValue *google_protobuf_FloatValue_parse(const char *buf, size_t size,
79 google_protobuf_FloatValue *ret = google_protobuf_FloatValue_new(arena);
80 return (ret && upb_decode(buf, size, ret, &google_protobuf_FloatValue_msginit, arena)) ? ret : NULL;
82 UPB_INLINE char *google_protobuf_FloatValue_serialize(const google_protobuf_FloatValue *msg, upb_arena *arena, size_t *len) {
83 return upb_encode(msg, &google_protobuf_FloatValue_msginit, arena, len);
86 UPB_INLINE float google_protobuf_FloatValue_value(const google_protobuf_FloatValue *msg) { return UPB_FIELD_AT(msg, float, UPB_SIZE(0, 0)); }
88 UPB_INLINE void google_protobuf_FloatValue_set_value(google_protobuf_FloatValue *msg, float value) {
89 UPB_FIELD_AT(msg, float, UPB_SIZE(0, 0)) = value;
92 /* google.protobuf.Int64Value */
94 UPB_INLINE google_protobuf_Int64Value *google_protobuf_Int64Value_new(upb_arena *arena) {
95 return (google_protobuf_Int64Value *)upb_msg_new(&google_protobuf_Int64Value_msginit, arena);
97 UPB_INLINE google_protobuf_Int64Value *google_protobuf_Int64Value_parse(const char *buf, size_t size,
99 google_protobuf_Int64Value *ret = google_protobuf_Int64Value_new(arena);
100 return (ret && upb_decode(buf, size, ret, &google_protobuf_Int64Value_msginit, arena)) ? ret : NULL;
102 UPB_INLINE char *google_protobuf_Int64Value_serialize(const google_protobuf_Int64Value *msg, upb_arena *arena, size_t *len) {
103 return upb_encode(msg, &google_protobuf_Int64Value_msginit, arena, len);
106 UPB_INLINE int64_t google_protobuf_Int64Value_value(const google_protobuf_Int64Value *msg) { return UPB_FIELD_AT(msg, int64_t, UPB_SIZE(0, 0)); }
108 UPB_INLINE void google_protobuf_Int64Value_set_value(google_protobuf_Int64Value *msg, int64_t value) {
109 UPB_FIELD_AT(msg, int64_t, UPB_SIZE(0, 0)) = value;
112 /* google.protobuf.UInt64Value */
114 UPB_INLINE google_protobuf_UInt64Value *google_protobuf_UInt64Value_new(upb_arena *arena) {
115 return (google_protobuf_UInt64Value *)upb_msg_new(&google_protobuf_UInt64Value_msginit, arena);
117 UPB_INLINE google_protobuf_UInt64Value *google_protobuf_UInt64Value_parse(const char *buf, size_t size,
119 google_protobuf_UInt64Value *ret = google_protobuf_UInt64Value_new(arena);
120 return (ret && upb_decode(buf, size, ret, &google_protobuf_UInt64Value_msginit, arena)) ? ret : NULL;
122 UPB_INLINE char *google_protobuf_UInt64Value_serialize(const google_protobuf_UInt64Value *msg, upb_arena *arena, size_t *len) {
123 return upb_encode(msg, &google_protobuf_UInt64Value_msginit, arena, len);
126 UPB_INLINE uint64_t google_protobuf_UInt64Value_value(const google_protobuf_UInt64Value *msg) { return UPB_FIELD_AT(msg, uint64_t, UPB_SIZE(0, 0)); }
128 UPB_INLINE void google_protobuf_UInt64Value_set_value(google_protobuf_UInt64Value *msg, uint64_t value) {
129 UPB_FIELD_AT(msg, uint64_t, UPB_SIZE(0, 0)) = value;
132 /* google.protobuf.Int32Value */
134 UPB_INLINE google_protobuf_Int32Value *google_protobuf_Int32Value_new(upb_arena *arena) {
135 return (google_protobuf_Int32Value *)upb_msg_new(&google_protobuf_Int32Value_msginit, arena);
137 UPB_INLINE google_protobuf_Int32Value *google_protobuf_Int32Value_parse(const char *buf, size_t size,
139 google_protobuf_Int32Value *ret = google_protobuf_Int32Value_new(arena);
140 return (ret && upb_decode(buf, size, ret, &google_protobuf_Int32Value_msginit, arena)) ? ret : NULL;
142 UPB_INLINE char *google_protobuf_Int32Value_serialize(const google_protobuf_Int32Value *msg, upb_arena *arena, size_t *len) {
143 return upb_encode(msg, &google_protobuf_Int32Value_msginit, arena, len);
146 UPB_INLINE int32_t google_protobuf_Int32Value_value(const google_protobuf_Int32Value *msg) { return UPB_FIELD_AT(msg, int32_t, UPB_SIZE(0, 0)); }
148 UPB_INLINE void google_protobuf_Int32Value_set_value(google_protobuf_Int32Value *msg, int32_t value) {
149 UPB_FIELD_AT(msg, int32_t, UPB_SIZE(0, 0)) = value;
152 /* google.protobuf.UInt32Value */
154 UPB_INLINE google_protobuf_UInt32Value *google_protobuf_UInt32Value_new(upb_arena *arena) {
155 return (google_protobuf_UInt32Value *)upb_msg_new(&google_protobuf_UInt32Value_msginit, arena);
157 UPB_INLINE google_protobuf_UInt32Value *google_protobuf_UInt32Value_parse(const char *buf, size_t size,
159 google_protobuf_UInt32Value *ret = google_protobuf_UInt32Value_new(arena);
160 return (ret && upb_decode(buf, size, ret, &google_protobuf_UInt32Value_msginit, arena)) ? ret : NULL;
162 UPB_INLINE char *google_protobuf_UInt32Value_serialize(const google_protobuf_UInt32Value *msg, upb_arena *arena, size_t *len) {
163 return upb_encode(msg, &google_protobuf_UInt32Value_msginit, arena, len);
166 UPB_INLINE uint32_t google_protobuf_UInt32Value_value(const google_protobuf_UInt32Value *msg) { return UPB_FIELD_AT(msg, uint32_t, UPB_SIZE(0, 0)); }
168 UPB_INLINE void google_protobuf_UInt32Value_set_value(google_protobuf_UInt32Value *msg, uint32_t value) {
169 UPB_FIELD_AT(msg, uint32_t, UPB_SIZE(0, 0)) = value;
172 /* google.protobuf.BoolValue */
174 UPB_INLINE google_protobuf_BoolValue *google_protobuf_BoolValue_new(upb_arena *arena) {
175 return (google_protobuf_BoolValue *)upb_msg_new(&google_protobuf_BoolValue_msginit, arena);
177 UPB_INLINE google_protobuf_BoolValue *google_protobuf_BoolValue_parse(const char *buf, size_t size,
179 google_protobuf_BoolValue *ret = google_protobuf_BoolValue_new(arena);
180 return (ret && upb_decode(buf, size, ret, &google_protobuf_BoolValue_msginit, arena)) ? ret : NULL;
182 UPB_INLINE char *google_protobuf_BoolValue_serialize(const google_protobuf_BoolValue *msg, upb_arena *arena, size_t *len) {
183 return upb_encode(msg, &google_protobuf_BoolValue_msginit, arena, len);
186 UPB_INLINE bool google_protobuf_BoolValue_value(const google_protobuf_BoolValue *msg) { return UPB_FIELD_AT(msg, bool, UPB_SIZE(0, 0)); }
188 UPB_INLINE void google_protobuf_BoolValue_set_value(google_protobuf_BoolValue *msg, bool value) {
189 UPB_FIELD_AT(msg, bool, UPB_SIZE(0, 0)) = value;
192 /* google.protobuf.StringValue */
194 UPB_INLINE google_protobuf_StringValue *google_protobuf_StringValue_new(upb_arena *arena) {
195 return (google_protobuf_StringValue *)upb_msg_new(&google_protobuf_StringValue_msginit, arena);
197 UPB_INLINE google_protobuf_StringValue *google_protobuf_StringValue_parse(const char *buf, size_t size,
199 google_protobuf_StringValue *ret = google_protobuf_StringValue_new(arena);
200 return (ret && upb_decode(buf, size, ret, &google_protobuf_StringValue_msginit, arena)) ? ret : NULL;
202 UPB_INLINE char *google_protobuf_StringValue_serialize(const google_protobuf_StringValue *msg, upb_arena *arena, size_t *len) {
203 return upb_encode(msg, &google_protobuf_StringValue_msginit, arena, len);
206 UPB_INLINE upb_strview google_protobuf_StringValue_value(const google_protobuf_StringValue *msg) { return UPB_FIELD_AT(msg, upb_strview, UPB_SIZE(0, 0)); }
208 UPB_INLINE void google_protobuf_StringValue_set_value(google_protobuf_StringValue *msg, upb_strview value) {
209 UPB_FIELD_AT(msg, upb_strview, UPB_SIZE(0, 0)) = value;
212 /* google.protobuf.BytesValue */
214 UPB_INLINE google_protobuf_BytesValue *google_protobuf_BytesValue_new(upb_arena *arena) {
215 return (google_protobuf_BytesValue *)upb_msg_new(&google_protobuf_BytesValue_msginit, arena);
217 UPB_INLINE google_protobuf_BytesValue *google_protobuf_BytesValue_parse(const char *buf, size_t size,
219 google_protobuf_BytesValue *ret = google_protobuf_BytesValue_new(arena);
220 return (ret && upb_decode(buf, size, ret, &google_protobuf_BytesValue_msginit, arena)) ? ret : NULL;
222 UPB_INLINE char *google_protobuf_BytesValue_serialize(const google_protobuf_BytesValue *msg, upb_arena *arena, size_t *len) {
223 return upb_encode(msg, &google_protobuf_BytesValue_msginit, arena, len);
226 UPB_INLINE upb_strview google_protobuf_BytesValue_value(const google_protobuf_BytesValue *msg) { return UPB_FIELD_AT(msg, upb_strview, UPB_SIZE(0, 0)); }
228 UPB_INLINE void google_protobuf_BytesValue_set_value(google_protobuf_BytesValue *msg, upb_strview value) {
229 UPB_FIELD_AT(msg, upb_strview, UPB_SIZE(0, 0)) = value;
236 #include "upb/port_undef.inc"
238 #endif /* GOOGLE_PROTOBUF_WRAPPERS_PROTO_UPB_H_ */