google-protobuf 3.7.0 → 3.16.0

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.

Files changed (37) hide show
  1. checksums.yaml +4 -4
  2. data/ext/google/protobuf_c/convert.c +349 -0
  3. data/ext/google/protobuf_c/convert.h +72 -0
  4. data/ext/google/protobuf_c/defs.c +1555 -1228
  5. data/ext/google/protobuf_c/defs.h +107 -0
  6. data/ext/google/protobuf_c/extconf.rb +4 -7
  7. data/ext/google/protobuf_c/map.c +310 -470
  8. data/ext/google/protobuf_c/map.h +66 -0
  9. data/ext/google/protobuf_c/message.c +931 -346
  10. data/ext/google/protobuf_c/message.h +101 -0
  11. data/ext/google/protobuf_c/protobuf.c +384 -51
  12. data/ext/google/protobuf_c/protobuf.h +44 -544
  13. data/ext/google/protobuf_c/repeated_field.c +311 -308
  14. data/ext/google/protobuf_c/repeated_field.h +62 -0
  15. data/ext/google/protobuf_c/ruby-upb.c +8914 -0
  16. data/ext/google/protobuf_c/ruby-upb.h +4452 -0
  17. data/ext/google/protobuf_c/third_party/wyhash/wyhash.h +145 -0
  18. data/lib/google/protobuf/any_pb.rb +1 -1
  19. data/lib/google/protobuf/api_pb.rb +3 -3
  20. data/lib/google/protobuf/duration_pb.rb +1 -1
  21. data/lib/google/protobuf/empty_pb.rb +1 -1
  22. data/lib/google/protobuf/field_mask_pb.rb +1 -1
  23. data/lib/google/protobuf/source_context_pb.rb +1 -1
  24. data/lib/google/protobuf/struct_pb.rb +4 -4
  25. data/lib/google/protobuf/timestamp_pb.rb +1 -1
  26. data/lib/google/protobuf/type_pb.rb +8 -8
  27. data/lib/google/protobuf/well_known_types.rb +8 -2
  28. data/lib/google/protobuf/wrappers_pb.rb +9 -9
  29. data/lib/google/protobuf.rb +70 -0
  30. data/tests/basic.rb +315 -72
  31. data/tests/generated_code_test.rb +0 -0
  32. data/tests/stress.rb +0 -0
  33. metadata +27 -16
  34. data/ext/google/protobuf_c/encode_decode.c +0 -1574
  35. data/ext/google/protobuf_c/storage.c +0 -1019
  36. data/ext/google/protobuf_c/upb.c +0 -17318
  37. data/ext/google/protobuf_c/upb.h +0 -9755
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: ccf067952a9422bea3dc504041dd23154129f98f88edf9e67e67d7cdbb6ce23c
4
- data.tar.gz: bd608b44e34348a66d1040480ad5a8e61664649c8b2158b38eb006e7662f993e
3
+ metadata.gz: 92bce6793f49890e0a5bf68cc233de1e6fea67d72f3ca7f335bee1bcb81061a3
4
+ data.tar.gz: '008e84cf532d86eb4ee6bb4a913be6d75fdffd18190759acf57ef0133e33989b'
5
5
  SHA512:
6
- metadata.gz: 0711aff149212f90045fece5a507918cd1fb5d61abaa0556928c21fc69e7fe968e55d26c0123cba986005d5e28f79c655bfff02e02723d42b36d71f37a27ff13
7
- data.tar.gz: 2077de0e04653c161e5389ab0e450bcd63dcdb054a62dd9cb33a16df1e755a3cec82eca57190bd93a45774b66feb6faf457c1fe5b0dbeadac9f3bdaddc4cea82
6
+ metadata.gz: 7869abdbcc35d74152ed52fae04a763bd866a8b04cd2eb212f07ba37cf83bb92ac2fdaa4a06d4aa9dcf55c6ac6d13e0ecb0be3fc724947f5233a84e12180263d
7
+ data.tar.gz: 1d735c91494688d289c57852f7d7b4e015394851bad5fa7ddaf4ba3f5f6dd0395fd8b549c0bf5106ad370a7d324b876b66f3fe94fad8f0d4d2945d3f68d3aaed
@@ -0,0 +1,349 @@
1
+ // Protocol Buffers - Google's data interchange format
2
+ // Copyright 2008 Google Inc. All rights reserved.
3
+ // https://developers.google.com/protocol-buffers/
4
+ //
5
+ // Redistribution and use in source and binary forms, with or without
6
+ // modification, are permitted provided that the following conditions are
7
+ // met:
8
+ //
9
+ // * Redistributions of source code must retain the above copyright
10
+ // notice, this list of conditions and the following disclaimer.
11
+ // * Redistributions in binary form must reproduce the above
12
+ // copyright notice, this list of conditions and the following disclaimer
13
+ // in the documentation and/or other materials provided with the
14
+ // distribution.
15
+ // * Neither the name of Google Inc. nor the names of its
16
+ // contributors may be used to endorse or promote products derived from
17
+ // this software without specific prior written permission.
18
+ //
19
+ // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
20
+ // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
21
+ // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
22
+ // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
23
+ // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
24
+ // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
25
+ // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
26
+ // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
27
+ // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
28
+ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
29
+ // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
30
+
31
+ // -----------------------------------------------------------------------------
32
+ // Ruby <-> upb data conversion functions.
33
+ //
34
+ // This file Also contains a few other assorted algorithms on upb_msgval.
35
+ //
36
+ // None of the algorithms in this file require any access to the internal
37
+ // representation of Ruby or upb objects.
38
+ // -----------------------------------------------------------------------------
39
+
40
+ #include "convert.h"
41
+
42
+ #include "message.h"
43
+ #include "protobuf.h"
44
+ #include "third_party/wyhash/wyhash.h"
45
+
46
+ static upb_strview Convert_StringData(VALUE str, upb_arena *arena) {
47
+ upb_strview ret;
48
+ if (arena) {
49
+ char *ptr = upb_arena_malloc(arena, RSTRING_LEN(str));
50
+ memcpy(ptr, RSTRING_PTR(str), RSTRING_LEN(str));
51
+ ret.data = ptr;
52
+ } else {
53
+ // Data is only needed temporarily (within map lookup).
54
+ ret.data = RSTRING_PTR(str);
55
+ }
56
+ ret.size = RSTRING_LEN(str);
57
+ return ret;
58
+ }
59
+
60
+ static bool is_ruby_num(VALUE value) {
61
+ return (TYPE(value) == T_FLOAT ||
62
+ TYPE(value) == T_FIXNUM ||
63
+ TYPE(value) == T_BIGNUM);
64
+ }
65
+
66
+ static void Convert_CheckInt(const char* name, upb_fieldtype_t type,
67
+ VALUE val) {
68
+ if (!is_ruby_num(val)) {
69
+ rb_raise(cTypeError,
70
+ "Expected number type for integral field '%s' (given %s).", name,
71
+ rb_class2name(CLASS_OF(val)));
72
+ }
73
+
74
+ // NUM2{INT,UINT,LL,ULL} macros do the appropriate range checks on upper
75
+ // bound; we just need to do precision checks (i.e., disallow rounding) and
76
+ // check for < 0 on unsigned types.
77
+ if (TYPE(val) == T_FLOAT) {
78
+ double dbl_val = NUM2DBL(val);
79
+ if (floor(dbl_val) != dbl_val) {
80
+ rb_raise(rb_eRangeError,
81
+ "Non-integral floating point value assigned to integer field "
82
+ "'%s' (given %s).",
83
+ name, rb_class2name(CLASS_OF(val)));
84
+ }
85
+ }
86
+ if (type == UPB_TYPE_UINT32 || type == UPB_TYPE_UINT64) {
87
+ if (NUM2DBL(val) < 0) {
88
+ rb_raise(
89
+ rb_eRangeError,
90
+ "Assigning negative value to unsigned integer field '%s' (given %s).",
91
+ name, rb_class2name(CLASS_OF(val)));
92
+ }
93
+ }
94
+ }
95
+
96
+ static int32_t Convert_ToEnum(VALUE value, const char* name,
97
+ const upb_enumdef* e) {
98
+ int32_t val;
99
+
100
+ switch (TYPE(value)) {
101
+ case T_FLOAT:
102
+ case T_FIXNUM:
103
+ case T_BIGNUM:
104
+ Convert_CheckInt(name, UPB_TYPE_INT32, value);
105
+ val = NUM2INT(value);
106
+ break;
107
+ case T_STRING:
108
+ if (!upb_enumdef_ntoi(e, RSTRING_PTR(value), RSTRING_LEN(value), &val)) {
109
+ goto unknownval;
110
+ }
111
+ break;
112
+ case T_SYMBOL:
113
+ if (!upb_enumdef_ntoiz(e, rb_id2name(SYM2ID(value)), &val)) {
114
+ goto unknownval;
115
+ }
116
+ break;
117
+ default:
118
+ rb_raise(cTypeError,
119
+ "Expected number or symbol type for enum field '%s'.", name);
120
+ }
121
+
122
+ return val;
123
+
124
+ unknownval:
125
+ rb_raise(rb_eRangeError, "Unknown symbol value for enum field '%s'.", name);
126
+ }
127
+
128
+ upb_msgval Convert_RubyToUpb(VALUE value, const char* name, TypeInfo type_info,
129
+ upb_arena* arena) {
130
+ upb_msgval ret;
131
+
132
+ switch (type_info.type) {
133
+ case UPB_TYPE_FLOAT:
134
+ if (!is_ruby_num(value)) {
135
+ rb_raise(cTypeError, "Expected number type for float field '%s' (given %s).",
136
+ name, rb_class2name(CLASS_OF(value)));
137
+ }
138
+ ret.float_val = NUM2DBL(value);
139
+ break;
140
+ case UPB_TYPE_DOUBLE:
141
+ if (!is_ruby_num(value)) {
142
+ rb_raise(cTypeError, "Expected number type for double field '%s' (given %s).",
143
+ name, rb_class2name(CLASS_OF(value)));
144
+ }
145
+ ret.double_val = NUM2DBL(value);
146
+ break;
147
+ case UPB_TYPE_BOOL: {
148
+ if (value == Qtrue) {
149
+ ret.bool_val = 1;
150
+ } else if (value == Qfalse) {
151
+ ret.bool_val = 0;
152
+ } else {
153
+ rb_raise(cTypeError, "Invalid argument for boolean field '%s' (given %s).",
154
+ name, rb_class2name(CLASS_OF(value)));
155
+ }
156
+ break;
157
+ }
158
+ case UPB_TYPE_STRING: {
159
+ VALUE utf8 = rb_enc_from_encoding(rb_utf8_encoding());
160
+ if (CLASS_OF(value) == rb_cSymbol) {
161
+ value = rb_funcall(value, rb_intern("to_s"), 0);
162
+ } else if (CLASS_OF(value) != rb_cString) {
163
+ rb_raise(cTypeError, "Invalid argument for string field '%s' (given %s).",
164
+ name, rb_class2name(CLASS_OF(value)));
165
+ }
166
+
167
+ if (rb_obj_encoding(value) != utf8) {
168
+ // Note: this will not duplicate underlying string data unless necessary.
169
+ value = rb_str_encode(value, utf8, 0, Qnil);
170
+
171
+ if (rb_enc_str_coderange(value) == ENC_CODERANGE_BROKEN) {
172
+ rb_raise(rb_eEncodingError, "String is invalid UTF-8");
173
+ }
174
+ }
175
+
176
+ ret.str_val = Convert_StringData(value, arena);
177
+ break;
178
+ }
179
+ case UPB_TYPE_BYTES: {
180
+ VALUE bytes = rb_enc_from_encoding(rb_ascii8bit_encoding());
181
+ if (CLASS_OF(value) != rb_cString) {
182
+ rb_raise(cTypeError, "Invalid argument for bytes field '%s' (given %s).",
183
+ name, rb_class2name(CLASS_OF(value)));
184
+ }
185
+
186
+ if (rb_obj_encoding(value) != bytes) {
187
+ // Note: this will not duplicate underlying string data unless necessary.
188
+ // TODO(haberman): is this really necessary to get raw bytes?
189
+ value = rb_str_encode(value, bytes, 0, Qnil);
190
+ }
191
+
192
+ ret.str_val = Convert_StringData(value, arena);
193
+ break;
194
+ }
195
+ case UPB_TYPE_MESSAGE:
196
+ ret.msg_val =
197
+ Message_GetUpbMessage(value, type_info.def.msgdef, name, arena);
198
+ break;
199
+ case UPB_TYPE_ENUM:
200
+ ret.int32_val = Convert_ToEnum(value, name, type_info.def.enumdef);
201
+ break;
202
+ case UPB_TYPE_INT32:
203
+ case UPB_TYPE_INT64:
204
+ case UPB_TYPE_UINT32:
205
+ case UPB_TYPE_UINT64:
206
+ Convert_CheckInt(name, type_info.type, value);
207
+ switch (type_info.type) {
208
+ case UPB_TYPE_INT32:
209
+ ret.int32_val = NUM2INT(value);
210
+ break;
211
+ case UPB_TYPE_INT64:
212
+ ret.int64_val = NUM2LL(value);
213
+ break;
214
+ case UPB_TYPE_UINT32:
215
+ ret.uint32_val = NUM2UINT(value);
216
+ break;
217
+ case UPB_TYPE_UINT64:
218
+ ret.uint64_val = NUM2ULL(value);
219
+ break;
220
+ default:
221
+ break;
222
+ }
223
+ break;
224
+ default:
225
+ break;
226
+ }
227
+
228
+ return ret;
229
+ }
230
+
231
+ VALUE Convert_UpbToRuby(upb_msgval upb_val, TypeInfo type_info, VALUE arena) {
232
+ switch (type_info.type) {
233
+ case UPB_TYPE_FLOAT:
234
+ return DBL2NUM(upb_val.float_val);
235
+ case UPB_TYPE_DOUBLE:
236
+ return DBL2NUM(upb_val.double_val);
237
+ case UPB_TYPE_BOOL:
238
+ return upb_val.bool_val ? Qtrue : Qfalse;
239
+ case UPB_TYPE_INT32:
240
+ return INT2NUM(upb_val.int32_val);
241
+ case UPB_TYPE_INT64:
242
+ return LL2NUM(upb_val.int64_val);
243
+ case UPB_TYPE_UINT32:
244
+ return UINT2NUM(upb_val.uint32_val);
245
+ case UPB_TYPE_UINT64:
246
+ return ULL2NUM(upb_val.int64_val);
247
+ case UPB_TYPE_ENUM: {
248
+ const char* name =
249
+ upb_enumdef_iton(type_info.def.enumdef, upb_val.int32_val);
250
+ if (name) {
251
+ return ID2SYM(rb_intern(name));
252
+ } else {
253
+ return INT2NUM(upb_val.int32_val);
254
+ }
255
+ }
256
+ case UPB_TYPE_STRING: {
257
+ VALUE str_rb = rb_str_new(upb_val.str_val.data, upb_val.str_val.size);
258
+ rb_enc_associate(str_rb, rb_utf8_encoding());
259
+ rb_obj_freeze(str_rb);
260
+ return str_rb;
261
+ }
262
+ case UPB_TYPE_BYTES: {
263
+ VALUE str_rb = rb_str_new(upb_val.str_val.data, upb_val.str_val.size);
264
+ rb_enc_associate(str_rb, rb_ascii8bit_encoding());
265
+ rb_obj_freeze(str_rb);
266
+ return str_rb;
267
+ }
268
+ case UPB_TYPE_MESSAGE:
269
+ return Message_GetRubyWrapper((upb_msg*)upb_val.msg_val,
270
+ type_info.def.msgdef, arena);
271
+ default:
272
+ rb_raise(rb_eRuntimeError, "Convert_UpbToRuby(): Unexpected type %d",
273
+ (int)type_info.type);
274
+ }
275
+ }
276
+
277
+ upb_msgval Msgval_DeepCopy(upb_msgval msgval, TypeInfo type_info,
278
+ upb_arena* arena) {
279
+ upb_msgval new_msgval;
280
+
281
+ switch (type_info.type) {
282
+ default:
283
+ memcpy(&new_msgval, &msgval, sizeof(msgval));
284
+ break;
285
+ case UPB_TYPE_STRING:
286
+ case UPB_TYPE_BYTES: {
287
+ size_t n = msgval.str_val.size;
288
+ char *mem = upb_arena_malloc(arena, n);
289
+ new_msgval.str_val.data = mem;
290
+ new_msgval.str_val.size = n;
291
+ memcpy(mem, msgval.str_val.data, n);
292
+ break;
293
+ }
294
+ case UPB_TYPE_MESSAGE:
295
+ new_msgval.msg_val =
296
+ Message_deep_copy(msgval.msg_val, type_info.def.msgdef, arena);
297
+ break;
298
+ }
299
+
300
+ return new_msgval;
301
+ }
302
+
303
+ bool Msgval_IsEqual(upb_msgval val1, upb_msgval val2, TypeInfo type_info) {
304
+ switch (type_info.type) {
305
+ case UPB_TYPE_BOOL:
306
+ return memcmp(&val1, &val2, 1) == 0;
307
+ case UPB_TYPE_FLOAT:
308
+ case UPB_TYPE_INT32:
309
+ case UPB_TYPE_UINT32:
310
+ case UPB_TYPE_ENUM:
311
+ return memcmp(&val1, &val2, 4) == 0;
312
+ case UPB_TYPE_DOUBLE:
313
+ case UPB_TYPE_INT64:
314
+ case UPB_TYPE_UINT64:
315
+ return memcmp(&val1, &val2, 8) == 0;
316
+ case UPB_TYPE_STRING:
317
+ case UPB_TYPE_BYTES:
318
+ return val1.str_val.size == val2.str_val.size &&
319
+ memcmp(val1.str_val.data, val2.str_val.data,
320
+ val1.str_val.size) == 0;
321
+ case UPB_TYPE_MESSAGE:
322
+ return Message_Equal(val1.msg_val, val2.msg_val, type_info.def.msgdef);
323
+ default:
324
+ rb_raise(rb_eRuntimeError, "Internal error, unexpected type");
325
+ }
326
+ }
327
+
328
+ uint64_t Msgval_GetHash(upb_msgval val, TypeInfo type_info, uint64_t seed) {
329
+ switch (type_info.type) {
330
+ case UPB_TYPE_BOOL:
331
+ return wyhash(&val, 1, seed, _wyp);
332
+ case UPB_TYPE_FLOAT:
333
+ case UPB_TYPE_INT32:
334
+ case UPB_TYPE_UINT32:
335
+ case UPB_TYPE_ENUM:
336
+ return wyhash(&val, 4, seed, _wyp);
337
+ case UPB_TYPE_DOUBLE:
338
+ case UPB_TYPE_INT64:
339
+ case UPB_TYPE_UINT64:
340
+ return wyhash(&val, 8, seed, _wyp);
341
+ case UPB_TYPE_STRING:
342
+ case UPB_TYPE_BYTES:
343
+ return wyhash(val.str_val.data, val.str_val.size, seed, _wyp);
344
+ case UPB_TYPE_MESSAGE:
345
+ return Message_Hash(val.msg_val, type_info.def.msgdef, seed);
346
+ default:
347
+ rb_raise(rb_eRuntimeError, "Internal error, unexpected type");
348
+ }
349
+ }
@@ -0,0 +1,72 @@
1
+ // Protocol Buffers - Google's data interchange format
2
+ // Copyright 2008 Google Inc. All rights reserved.
3
+ // https://developers.google.com/protocol-buffers/
4
+ //
5
+ // Redistribution and use in source and binary forms, with or without
6
+ // modification, are permitted provided that the following conditions are
7
+ // met:
8
+ //
9
+ // * Redistributions of source code must retain the above copyright
10
+ // notice, this list of conditions and the following disclaimer.
11
+ // * Redistributions in binary form must reproduce the above
12
+ // copyright notice, this list of conditions and the following disclaimer
13
+ // in the documentation and/or other materials provided with the
14
+ // distribution.
15
+ // * Neither the name of Google Inc. nor the names of its
16
+ // contributors may be used to endorse or promote products derived from
17
+ // this software without specific prior written permission.
18
+ //
19
+ // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
20
+ // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
21
+ // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
22
+ // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
23
+ // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
24
+ // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
25
+ // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
26
+ // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
27
+ // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
28
+ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
29
+ // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
30
+
31
+ #ifndef RUBY_PROTOBUF_CONVERT_H_
32
+ #define RUBY_PROTOBUF_CONVERT_H_
33
+
34
+ #include <ruby/ruby.h>
35
+
36
+ #include "protobuf.h"
37
+ #include "ruby-upb.h"
38
+
39
+ // Converts |ruby_val| to a upb_msgval according to |type_info|.
40
+ //
41
+ // The |arena| parameter indicates the lifetime of the container where this
42
+ // value will be assigned. It is used as follows:
43
+ // - If type is string or bytes, the string data will be copied into |arena|.
44
+ // - If type is message, and we need to auto-construct a message due to implicit
45
+ // conversions (eg. Time -> Google::Protobuf::Timestamp), the new message
46
+ // will be created in |arena|.
47
+ // - If type is message and the Ruby value is a message instance, we will fuse
48
+ // the message's arena into |arena|, to ensure that this message outlives the
49
+ // container.
50
+ upb_msgval Convert_RubyToUpb(VALUE ruby_val, const char *name,
51
+ TypeInfo type_info, upb_arena *arena);
52
+
53
+ // Converts |upb_val| to a Ruby VALUE according to |type_info|. This may involve
54
+ // creating a Ruby wrapper object.
55
+ //
56
+ // The |arena| parameter indicates the arena that owns the lifetime of
57
+ // |upb_val|. Any Ruby wrapper object that is created will reference |arena|
58
+ // and ensure it outlives the wrapper.
59
+ VALUE Convert_UpbToRuby(upb_msgval upb_val, TypeInfo type_info, VALUE arena);
60
+
61
+ // Creates a deep copy of |msgval| in |arena|.
62
+ upb_msgval Msgval_DeepCopy(upb_msgval msgval, TypeInfo type_info,
63
+ upb_arena *arena);
64
+
65
+ // Returns true if |val1| and |val2| are equal. Their type is given by
66
+ // |type_info|.
67
+ bool Msgval_IsEqual(upb_msgval val1, upb_msgval val2, TypeInfo type_info);
68
+
69
+ // Returns a hash value for the given upb_msgval.
70
+ uint64_t Msgval_GetHash(upb_msgval val, TypeInfo type_info, uint64_t seed);
71
+
72
+ #endif // RUBY_PROTOBUF_CONVERT_H_