OLD | NEW |
1 // Protocol Buffers - Google's data interchange format | 1 // Protocol Buffers - Google's data interchange format |
2 // Copyright 2014 Google Inc. All rights reserved. | 2 // Copyright 2014 Google Inc. All rights reserved. |
3 // https://developers.google.com/protocol-buffers/ | 3 // https://developers.google.com/protocol-buffers/ |
4 // | 4 // |
5 // Redistribution and use in source and binary forms, with or without | 5 // Redistribution and use in source and binary forms, with or without |
6 // modification, are permitted provided that the following conditions are | 6 // modification, are permitted provided that the following conditions are |
7 // met: | 7 // met: |
8 // | 8 // |
9 // * Redistributions of source code must retain the above copyright | 9 // * Redistributions of source code must retain the above copyright |
10 // notice, this list of conditions and the following disclaimer. | 10 // notice, this list of conditions and the following disclaimer. |
(...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
159 extern VALUE cFieldDescriptor; | 159 extern VALUE cFieldDescriptor; |
160 extern VALUE cEnumDescriptor; | 160 extern VALUE cEnumDescriptor; |
161 extern VALUE cMessageBuilderContext; | 161 extern VALUE cMessageBuilderContext; |
162 extern VALUE cOneofBuilderContext; | 162 extern VALUE cOneofBuilderContext; |
163 extern VALUE cEnumBuilderContext; | 163 extern VALUE cEnumBuilderContext; |
164 extern VALUE cBuilder; | 164 extern VALUE cBuilder; |
165 | 165 |
166 extern VALUE cError; | 166 extern VALUE cError; |
167 extern VALUE cParseError; | 167 extern VALUE cParseError; |
168 | 168 |
| 169 extern VALUE map_parse_frames; |
| 170 |
169 // We forward-declare all of the Ruby method implementations here because we | 171 // We forward-declare all of the Ruby method implementations here because we |
170 // sometimes call the methods directly across .c files, rather than going | 172 // sometimes call the methods directly across .c files, rather than going |
171 // through Ruby's method dispatching (e.g. during message parse). It's cleaner | 173 // through Ruby's method dispatching (e.g. during message parse). It's cleaner |
172 // to keep the list of object methods together than to split them between | 174 // to keep the list of object methods together than to split them between |
173 // static-in-file definitions and header declarations. | 175 // static-in-file definitions and header declarations. |
174 | 176 |
175 void DescriptorPool_mark(void* _self); | 177 void DescriptorPool_mark(void* _self); |
176 void DescriptorPool_free(void* _self); | 178 void DescriptorPool_free(void* _self); |
177 VALUE DescriptorPool_alloc(VALUE klass); | 179 VALUE DescriptorPool_alloc(VALUE klass); |
178 void DescriptorPool_register(VALUE module); | 180 void DescriptorPool_register(VALUE module); |
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
306 uint32_t case_number); | 308 uint32_t case_number); |
307 VALUE native_slot_get(upb_fieldtype_t type, | 309 VALUE native_slot_get(upb_fieldtype_t type, |
308 VALUE type_class, | 310 VALUE type_class, |
309 const void* memory); | 311 const void* memory); |
310 void native_slot_init(upb_fieldtype_t type, void* memory); | 312 void native_slot_init(upb_fieldtype_t type, void* memory); |
311 void native_slot_mark(upb_fieldtype_t type, void* memory); | 313 void native_slot_mark(upb_fieldtype_t type, void* memory); |
312 void native_slot_dup(upb_fieldtype_t type, void* to, void* from); | 314 void native_slot_dup(upb_fieldtype_t type, void* to, void* from); |
313 void native_slot_deep_copy(upb_fieldtype_t type, void* to, void* from); | 315 void native_slot_deep_copy(upb_fieldtype_t type, void* to, void* from); |
314 bool native_slot_eq(upb_fieldtype_t type, void* mem1, void* mem2); | 316 bool native_slot_eq(upb_fieldtype_t type, void* mem1, void* mem2); |
315 | 317 |
316 void native_slot_validate_string_encoding(upb_fieldtype_t type, VALUE value); | 318 VALUE native_slot_encode_and_freeze_string(upb_fieldtype_t type, VALUE value); |
317 void native_slot_check_int_range_precision(upb_fieldtype_t type, VALUE value); | 319 void native_slot_check_int_range_precision(upb_fieldtype_t type, VALUE value); |
318 | 320 |
319 extern rb_encoding* kRubyStringUtf8Encoding; | 321 extern rb_encoding* kRubyStringUtf8Encoding; |
320 extern rb_encoding* kRubyStringASCIIEncoding; | 322 extern rb_encoding* kRubyStringASCIIEncoding; |
321 extern rb_encoding* kRubyString8bitEncoding; | 323 extern rb_encoding* kRubyString8bitEncoding; |
322 | 324 |
323 VALUE field_type_class(const upb_fielddef* field); | 325 VALUE field_type_class(const upb_fielddef* field); |
324 | 326 |
325 #define MAP_KEY_FIELD 1 | 327 #define MAP_KEY_FIELD 1 |
326 #define MAP_VALUE_FIELD 2 | 328 #define MAP_VALUE_FIELD 2 |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
359 void RepeatedField_register(VALUE module); | 361 void RepeatedField_register(VALUE module); |
360 | 362 |
361 extern const rb_data_type_t RepeatedField_type; | 363 extern const rb_data_type_t RepeatedField_type; |
362 extern VALUE cRepeatedField; | 364 extern VALUE cRepeatedField; |
363 | 365 |
364 RepeatedField* ruby_to_RepeatedField(VALUE value); | 366 RepeatedField* ruby_to_RepeatedField(VALUE value); |
365 | 367 |
366 VALUE RepeatedField_each(VALUE _self); | 368 VALUE RepeatedField_each(VALUE _self); |
367 VALUE RepeatedField_index(int argc, VALUE* argv, VALUE _self); | 369 VALUE RepeatedField_index(int argc, VALUE* argv, VALUE _self); |
368 void* RepeatedField_index_native(VALUE _self, int index); | 370 void* RepeatedField_index_native(VALUE _self, int index); |
| 371 int RepeatedField_size(VALUE _self); |
369 VALUE RepeatedField_index_set(VALUE _self, VALUE _index, VALUE val); | 372 VALUE RepeatedField_index_set(VALUE _self, VALUE _index, VALUE val); |
370 void RepeatedField_reserve(RepeatedField* self, int new_size); | 373 void RepeatedField_reserve(RepeatedField* self, int new_size); |
371 VALUE RepeatedField_push(VALUE _self, VALUE val); | 374 VALUE RepeatedField_push(VALUE _self, VALUE val); |
372 void RepeatedField_push_native(VALUE _self, void* data); | 375 void RepeatedField_push_native(VALUE _self, void* data); |
373 VALUE RepeatedField_pop_one(VALUE _self); | 376 VALUE RepeatedField_pop_one(VALUE _self); |
374 VALUE RepeatedField_insert(int argc, VALUE* argv, VALUE _self); | 377 VALUE RepeatedField_insert(int argc, VALUE* argv, VALUE _self); |
375 VALUE RepeatedField_replace(VALUE _self, VALUE list); | 378 VALUE RepeatedField_replace(VALUE _self, VALUE list); |
376 VALUE RepeatedField_clear(VALUE _self); | 379 VALUE RepeatedField_clear(VALUE _self); |
377 VALUE RepeatedField_length(VALUE _self); | 380 VALUE RepeatedField_length(VALUE _self); |
378 VALUE RepeatedField_dup(VALUE _self); | 381 VALUE RepeatedField_dup(VALUE _self); |
(...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
529 | 532 |
530 #define CHECK_UPB(code, msg) do { \ | 533 #define CHECK_UPB(code, msg) do { \ |
531 upb_status status = UPB_STATUS_INIT; \ | 534 upb_status status = UPB_STATUS_INIT; \ |
532 code; \ | 535 code; \ |
533 check_upb_status(&status, msg); \ | 536 check_upb_status(&status, msg); \ |
534 } while (0) | 537 } while (0) |
535 | 538 |
536 extern ID descriptor_instancevar_interned; | 539 extern ID descriptor_instancevar_interned; |
537 | 540 |
538 #endif // __GOOGLE_PROTOBUF_RUBY_PROTOBUF_H__ | 541 #endif // __GOOGLE_PROTOBUF_RUBY_PROTOBUF_H__ |
OLD | NEW |