|
5 | 5 | import org.perl6.nqp.sixmodel.SixModelObject;
|
6 | 6 |
|
7 | 7 | public class NativeCallInstance extends SixModelObject {
|
8 |
| - /* Constants. Might be more idiomatic Java to move these to an enum. */ |
9 |
| - public static final byte ARG_VOID = 0; |
10 |
| - public static final byte ARG_CHAR = 2; |
11 |
| - public static final byte ARG_SHORT = 4; |
12 |
| - public static final byte ARG_INT = 6; |
13 |
| - public static final byte ARG_LONG = 8; |
14 |
| - public static final byte ARG_LONGLONG = 10; |
15 |
| - public static final byte ARG_FLOAT = 12; |
16 |
| - public static final byte ARG_DOUBLE = 14; |
17 |
| - public static final byte ARG_ASCIISTR = 16; |
18 |
| - public static final byte ARG_UTF8STR = 18; |
19 |
| - public static final byte ARG_UTF16STR = 20; |
20 |
| - public static final byte ARG_CSTRUCT = 22; |
21 |
| - public static final byte ARG_CARRAY = 24; |
22 |
| - public static final byte ARG_CALLBACK = 26; |
23 |
| - public static final byte ARG_CPOINTER = 28; |
24 |
| - public static final byte ARG_TYPE_MASK = 30; |
25 |
| - |
26 | 8 | /* Flag for whether we should free a string after passing it or not. These
|
27 | 9 | * are going away once the array handling is refactored.*/
|
28 | 10 | public static final byte ARG_NO_FREE_STR = 0;
|
29 | 11 | public static final byte ARG_FREE_STR = 1;
|
30 | 12 | public static final byte ARG_FREE_STR_MASK = 1;
|
31 | 13 |
|
32 | 14 | public Function entry_point;
|
| 15 | + public ArgType[] arg_types; |
| 16 | + public ArgType ret_type; |
| 17 | + |
| 18 | + public enum ArgType { |
| 19 | + VOID, |
| 20 | + CHAR, |
| 21 | + SHORT, |
| 22 | + INT, |
| 23 | + LONG, |
| 24 | + LONGLONG, |
| 25 | + FLOAT, |
| 26 | + DOUBLE, |
| 27 | + ASCIISTR, |
| 28 | + UTF8STR, |
| 29 | + UTF16STR, |
| 30 | + CSTRUCT, |
| 31 | + CARRAY, |
| 32 | + CALLBACK, |
| 33 | + CPOINTER; |
| 34 | + } |
33 | 35 | }
|
0 commit comments