| 30 |
ashish |
1 |
/*
|
|
|
2 |
* Licensed to the Apache Software Foundation (ASF) under one
|
|
|
3 |
* or more contributor license agreements. See the NOTICE file
|
|
|
4 |
* distributed with this work for additional information
|
|
|
5 |
* regarding copyright ownership. The ASF licenses this file
|
|
|
6 |
* to you under the Apache License, Version 2.0 (the
|
|
|
7 |
* "License"); you may not use this file except in compliance
|
|
|
8 |
* with the License. You may obtain a copy of the License at
|
|
|
9 |
*
|
|
|
10 |
* http://www.apache.org/licenses/LICENSE-2.0
|
|
|
11 |
*
|
|
|
12 |
* Unless required by applicable law or agreed to in writing,
|
|
|
13 |
* software distributed under the License is distributed on an
|
|
|
14 |
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
|
|
15 |
* KIND, either express or implied. See the License for the
|
|
|
16 |
* specific language governing permissions and limitations
|
|
|
17 |
* under the License.
|
|
|
18 |
*/
|
|
|
19 |
|
|
|
20 |
#include <stdbool.h>
|
|
|
21 |
#include <ruby.h>
|
|
|
22 |
|
|
|
23 |
typedef struct native_proto_method_table {
|
|
|
24 |
VALUE (*write_bool)(VALUE, VALUE);
|
|
|
25 |
VALUE (*write_byte)(VALUE, VALUE);
|
|
|
26 |
VALUE (*write_i16)(VALUE, VALUE);
|
|
|
27 |
VALUE (*write_i32)(VALUE, VALUE);
|
|
|
28 |
VALUE (*write_i64)(VALUE, VALUE);
|
|
|
29 |
VALUE (*write_double)(VALUE, VALUE);
|
|
|
30 |
VALUE (*write_string)(VALUE, VALUE);
|
|
|
31 |
VALUE (*write_list_begin)(VALUE, VALUE, VALUE);
|
|
|
32 |
VALUE (*write_list_end)(VALUE);
|
|
|
33 |
VALUE (*write_set_begin)(VALUE, VALUE, VALUE);
|
|
|
34 |
VALUE (*write_set_end)(VALUE);
|
|
|
35 |
VALUE (*write_map_begin)(VALUE, VALUE, VALUE, VALUE);
|
|
|
36 |
VALUE (*write_map_end)(VALUE);
|
|
|
37 |
VALUE (*write_struct_begin)(VALUE, VALUE);
|
|
|
38 |
VALUE (*write_struct_end)(VALUE);
|
|
|
39 |
VALUE (*write_field_begin)(VALUE, VALUE, VALUE, VALUE);
|
|
|
40 |
VALUE (*write_field_end)(VALUE);
|
|
|
41 |
VALUE (*write_field_stop)(VALUE);
|
|
|
42 |
VALUE (*write_message_begin)(VALUE, VALUE, VALUE, VALUE);
|
|
|
43 |
VALUE (*write_message_end)(VALUE);
|
|
|
44 |
|
|
|
45 |
VALUE (*read_message_begin)(VALUE);
|
|
|
46 |
VALUE (*read_message_end)(VALUE);
|
|
|
47 |
VALUE (*read_field_begin)(VALUE);
|
|
|
48 |
VALUE (*read_field_end)(VALUE);
|
|
|
49 |
VALUE (*read_map_begin)(VALUE);
|
|
|
50 |
VALUE (*read_map_end)(VALUE);
|
|
|
51 |
VALUE (*read_list_begin)(VALUE);
|
|
|
52 |
VALUE (*read_list_end)(VALUE);
|
|
|
53 |
VALUE (*read_set_begin)(VALUE);
|
|
|
54 |
VALUE (*read_set_end)(VALUE);
|
|
|
55 |
VALUE (*read_byte)(VALUE);
|
|
|
56 |
VALUE (*read_bool)(VALUE);
|
|
|
57 |
VALUE (*read_i16)(VALUE);
|
|
|
58 |
VALUE (*read_i32)(VALUE);
|
|
|
59 |
VALUE (*read_i64)(VALUE);
|
|
|
60 |
VALUE (*read_double)(VALUE);
|
|
|
61 |
VALUE (*read_string)(VALUE);
|
|
|
62 |
VALUE (*read_struct_begin)(VALUE);
|
|
|
63 |
VALUE (*read_struct_end)(VALUE);
|
|
|
64 |
|
|
|
65 |
} native_proto_method_table;
|
|
|
66 |
|
|
|
67 |
void Init_struct();
|