Bryan Duxbury | c016628 | 2009-02-02 00:48:17 +0000 | [diff] [blame] | 1 | #include <stdbool.h> |
| 2 | #include <ruby.h> |
| 3 | |
| 4 | typedef struct native_proto_method_table { |
| 5 | VALUE (*write_bool)(VALUE, VALUE); |
| 6 | VALUE (*write_byte)(VALUE, VALUE); |
| 7 | VALUE (*write_i16)(VALUE, VALUE); |
| 8 | VALUE (*write_i32)(VALUE, VALUE); |
| 9 | VALUE (*write_i64)(VALUE, VALUE); |
| 10 | VALUE (*write_double)(VALUE, VALUE); |
| 11 | VALUE (*write_string)(VALUE, VALUE); |
| 12 | VALUE (*write_list_begin)(VALUE, VALUE, VALUE); |
| 13 | VALUE (*write_list_end)(VALUE); |
| 14 | VALUE (*write_set_begin)(VALUE, VALUE, VALUE); |
| 15 | VALUE (*write_set_end)(VALUE); |
| 16 | VALUE (*write_map_begin)(VALUE, VALUE, VALUE, VALUE); |
| 17 | VALUE (*write_map_end)(VALUE); |
| 18 | VALUE (*write_struct_begin)(VALUE, VALUE); |
| 19 | VALUE (*write_struct_end)(VALUE); |
| 20 | VALUE (*write_field_begin)(VALUE, VALUE, VALUE, VALUE); |
| 21 | VALUE (*write_field_end)(VALUE); |
| 22 | VALUE (*write_field_stop)(VALUE); |
| 23 | VALUE (*write_message_begin)(VALUE, VALUE, VALUE, VALUE); |
| 24 | VALUE (*write_message_end)(VALUE); |
| 25 | |
| 26 | VALUE (*read_message_begin)(VALUE); |
| 27 | VALUE (*read_message_end)(VALUE); |
| 28 | VALUE (*read_field_begin)(VALUE); |
| 29 | VALUE (*read_field_end)(VALUE); |
| 30 | VALUE (*read_map_begin)(VALUE); |
| 31 | VALUE (*read_map_end)(VALUE); |
| 32 | VALUE (*read_list_begin)(VALUE); |
| 33 | VALUE (*read_list_end)(VALUE); |
| 34 | VALUE (*read_set_begin)(VALUE); |
| 35 | VALUE (*read_set_end)(VALUE); |
| 36 | VALUE (*read_byte)(VALUE); |
| 37 | VALUE (*read_bool)(VALUE); |
| 38 | VALUE (*read_i16)(VALUE); |
| 39 | VALUE (*read_i32)(VALUE); |
| 40 | VALUE (*read_i64)(VALUE); |
| 41 | VALUE (*read_double)(VALUE); |
| 42 | VALUE (*read_string)(VALUE); |
| 43 | VALUE (*read_struct_begin)(VALUE); |
| 44 | VALUE (*read_struct_end)(VALUE); |
| 45 | |
| 46 | } native_proto_method_table; |
| 47 | |
Bryan Duxbury | 1e80d44 | 2009-02-03 18:16:54 +0000 | [diff] [blame] | 48 | void Init_struct(); |