@@ -13,12 +13,16 @@ object Struct {
13
13
type point_s = native.Ptr [struct_point]
14
14
type struct_bigStruct = native.CArray [Byte , native.Nat .Digit [native.Nat ._1, native.Nat .Digit [native.Nat ._1, native.Nat ._2]]]
15
15
type struct_structWithAnonymousStruct = native.CStruct2 [native.CInt , native.CArray [Byte , native.Nat ._8]]
16
+ type enum_struct_op = native.CUnsignedInt
16
17
def setPoints (points : native.Ptr [struct_points], x1 : native.CInt , y1 : native.CInt , x2 : native.CInt , y2 : native.CInt ): Unit = native.extern
17
18
def getPoint (points : native.Ptr [struct_points], pointIndex : enum_pointIndex): native.CInt = native.extern
18
19
def createPoint (): native.Ptr [struct_point] = native.extern
19
20
def getBigStructSize (): native.CInt = native.extern
20
21
def getCharFromAnonymousStruct (s : native.Ptr [struct_structWithAnonymousStruct]): native.CChar = native.extern
21
22
def getIntFromAnonymousStruct (s : native.Ptr [struct_structWithAnonymousStruct]): native.CChar = native.extern
23
+ def struct_test_long (s : native.Ptr [struct_bigStruct], op : enum_struct_op, value : native.CLong ): native.CInt = native.extern
24
+ def struct_test_double (s : native.Ptr [struct_bigStruct], op : enum_struct_op, value : native.CDouble ): native.CInt = native.extern
25
+ def struct_test_point (s : native.Ptr [struct_bigStruct], op : enum_struct_op, value : native.Ptr [struct_point]): native.CInt = native.extern
22
26
}
23
27
24
28
import Struct ._
@@ -28,6 +32,9 @@ object StructEnums {
28
32
final val enum_pointIndex_Y1 : enum_pointIndex = 1 .toUInt
29
33
final val enum_pointIndex_X2 : enum_pointIndex = 2 .toUInt
30
34
final val enum_pointIndex_Y2 : enum_pointIndex = 3 .toUInt
35
+
36
+ final val enum_struct_op_STRUCT_SET : enum_struct_op = 0 .toUInt
37
+ final val enum_struct_op_STRUCT_TEST : enum_struct_op = 1 .toUInt
31
38
}
32
39
33
40
object StructHelpers {
@@ -61,42 +68,42 @@ object StructHelpers {
61
68
def four_= (value : native.CFloat ): Unit = ! (p._1 + 16 ).cast[native.Ptr [native.CFloat ]] = value
62
69
def five : native.CDouble = ! (p._1 + 24 ).cast[native.Ptr [native.CDouble ]]
63
70
def five_= (value : native.CDouble ): Unit = ! (p._1 + 24 ).cast[native.Ptr [native.CDouble ]] = value
64
- def six : native.Ptr [struct_point] = ! (p._1 + 32 ).cast[native.Ptr [native. Ptr [ struct_point] ]]
65
- def six_= (value : native.Ptr [struct_point]): Unit = ! (p._1 + 32 ).cast[native.Ptr [native. Ptr [ struct_point]]] = value
66
- def seven : native.CInt = ! (p._1 + 40 ).cast[native.Ptr [native.CInt ]]
67
- def seven_= (value : native.CInt ): Unit = ! (p._1 + 40 ).cast[native.Ptr [native.CInt ]] = value
68
- def eight : native.CInt = ! (p._1 + 44 ).cast[native.Ptr [native.CInt ]]
69
- def eight_= (value : native.CInt ): Unit = ! (p._1 + 44 ).cast[native.Ptr [native.CInt ]] = value
70
- def nine : native.CInt = ! (p._1 + 48 ).cast[native.Ptr [native.CInt ]]
71
- def nine_= (value : native.CInt ): Unit = ! (p._1 + 48 ).cast[native.Ptr [native.CInt ]] = value
72
- def ten : native.CInt = ! (p._1 + 52 ).cast[native.Ptr [native.CInt ]]
73
- def ten_= (value : native.CInt ): Unit = ! (p._1 + 52 ).cast[native.Ptr [native.CInt ]] = value
74
- def eleven : native.CInt = ! (p._1 + 56 ).cast[native.Ptr [native.CInt ]]
75
- def eleven_= (value : native.CInt ): Unit = ! (p._1 + 56 ).cast[native.Ptr [native.CInt ]] = value
76
- def twelve : native.CInt = ! (p._1 + 60 ).cast[native.Ptr [native.CInt ]]
77
- def twelve_= (value : native.CInt ): Unit = ! (p._1 + 60 ).cast[native.Ptr [native.CInt ]] = value
78
- def thirteen : native.CInt = ! (p._1 + 64 ).cast[native.Ptr [native.CInt ]]
79
- def thirteen_= (value : native.CInt ): Unit = ! (p._1 + 64 ).cast[native.Ptr [native.CInt ]] = value
80
- def fourteen : native.CInt = ! (p._1 + 68 ).cast[native.Ptr [native.CInt ]]
81
- def fourteen_= (value : native.CInt ): Unit = ! (p._1 + 68 ).cast[native.Ptr [native.CInt ]] = value
82
- def fifteen : native.CInt = ! (p._1 + 72 ).cast[native.Ptr [native.CInt ]]
83
- def fifteen_= (value : native.CInt ): Unit = ! (p._1 + 72 ).cast[native.Ptr [native.CInt ]] = value
84
- def sixteen : native.CInt = ! (p._1 + 76 ).cast[native.Ptr [native.CInt ]]
85
- def sixteen_= (value : native.CInt ): Unit = ! (p._1 + 76 ).cast[native.Ptr [native.CInt ]] = value
86
- def seventeen : native.CInt = ! (p._1 + 80 ).cast[native.Ptr [native.CInt ]]
87
- def seventeen_= (value : native.CInt ): Unit = ! (p._1 + 80 ).cast[native.Ptr [native.CInt ]] = value
88
- def eighteen : native.CInt = ! (p._1 + 84 ).cast[native.Ptr [native.CInt ]]
89
- def eighteen_= (value : native.CInt ): Unit = ! (p._1 + 84 ).cast[native.Ptr [native.CInt ]] = value
90
- def nineteen : native.CInt = ! (p._1 + 88 ).cast[native.Ptr [native.CInt ]]
91
- def nineteen_= (value : native.CInt ): Unit = ! (p._1 + 88 ).cast[native.Ptr [native.CInt ]] = value
92
- def twenty : native.CInt = ! (p._1 + 92 ).cast[native.Ptr [native.CInt ]]
93
- def twenty_= (value : native.CInt ): Unit = ! (p._1 + 92 ).cast[native.Ptr [native.CInt ]] = value
94
- def twentyOne : native.CInt = ! (p._1 + 96 ).cast[native.Ptr [native.CInt ]]
95
- def twentyOne_= (value : native.CInt ): Unit = ! (p._1 + 96 ).cast[native.Ptr [native.CInt ]] = value
96
- def twentyTwo : native.CInt = ! (p._1 + 100 ).cast[native.Ptr [native.CInt ]]
97
- def twentyTwo_= (value : native.CInt ): Unit = ! (p._1 + 100 ).cast[native.Ptr [native.CInt ]] = value
98
- def twentyThree : native.CInt = ! (p._1 + 104 ).cast[native.Ptr [native.CInt ]]
99
- def twentyThree_= (value : native.CInt ): Unit = ! (p._1 + 104 ).cast[native.Ptr [native.CInt ]] = value
71
+ def six : native.Ptr [struct_point] = (p._1 + 32 ).cast[native.Ptr [struct_point]]
72
+ def six_= (value : native.Ptr [struct_point]): Unit = ! (p._1 + 32 ).cast[native.Ptr [struct_point]] = ! value
73
+ def seven : native.Ptr [struct_point] = ! (p._1 + 40 ).cast[native.Ptr [native.Ptr [struct_point] ]]
74
+ def seven_= (value : native.Ptr [struct_point] ): Unit = ! (p._1 + 40 ).cast[native.Ptr [native.Ptr [struct_point] ]] = value
75
+ def eight : native.CInt = ! (p._1 + 48 ).cast[native.Ptr [native.CInt ]]
76
+ def eight_= (value : native.CInt ): Unit = ! (p._1 + 48 ).cast[native.Ptr [native.CInt ]] = value
77
+ def nine : native.CInt = ! (p._1 + 52 ).cast[native.Ptr [native.CInt ]]
78
+ def nine_= (value : native.CInt ): Unit = ! (p._1 + 52 ).cast[native.Ptr [native.CInt ]] = value
79
+ def ten : native.CInt = ! (p._1 + 56 ).cast[native.Ptr [native.CInt ]]
80
+ def ten_= (value : native.CInt ): Unit = ! (p._1 + 56 ).cast[native.Ptr [native.CInt ]] = value
81
+ def eleven : native.CInt = ! (p._1 + 60 ).cast[native.Ptr [native.CInt ]]
82
+ def eleven_= (value : native.CInt ): Unit = ! (p._1 + 60 ).cast[native.Ptr [native.CInt ]] = value
83
+ def twelve : native.CInt = ! (p._1 + 64 ).cast[native.Ptr [native.CInt ]]
84
+ def twelve_= (value : native.CInt ): Unit = ! (p._1 + 64 ).cast[native.Ptr [native.CInt ]] = value
85
+ def thirteen : native.CInt = ! (p._1 + 68 ).cast[native.Ptr [native.CInt ]]
86
+ def thirteen_= (value : native.CInt ): Unit = ! (p._1 + 68 ).cast[native.Ptr [native.CInt ]] = value
87
+ def fourteen : native.CInt = ! (p._1 + 72 ).cast[native.Ptr [native.CInt ]]
88
+ def fourteen_= (value : native.CInt ): Unit = ! (p._1 + 72 ).cast[native.Ptr [native.CInt ]] = value
89
+ def fifteen : native.CInt = ! (p._1 + 76 ).cast[native.Ptr [native.CInt ]]
90
+ def fifteen_= (value : native.CInt ): Unit = ! (p._1 + 76 ).cast[native.Ptr [native.CInt ]] = value
91
+ def sixteen : native.CInt = ! (p._1 + 80 ).cast[native.Ptr [native.CInt ]]
92
+ def sixteen_= (value : native.CInt ): Unit = ! (p._1 + 80 ).cast[native.Ptr [native.CInt ]] = value
93
+ def seventeen : native.CInt = ! (p._1 + 84 ).cast[native.Ptr [native.CInt ]]
94
+ def seventeen_= (value : native.CInt ): Unit = ! (p._1 + 84 ).cast[native.Ptr [native.CInt ]] = value
95
+ def eighteen : native.CInt = ! (p._1 + 88 ).cast[native.Ptr [native.CInt ]]
96
+ def eighteen_= (value : native.CInt ): Unit = ! (p._1 + 88 ).cast[native.Ptr [native.CInt ]] = value
97
+ def nineteen : native.CInt = ! (p._1 + 92 ).cast[native.Ptr [native.CInt ]]
98
+ def nineteen_= (value : native.CInt ): Unit = ! (p._1 + 92 ).cast[native.Ptr [native.CInt ]] = value
99
+ def twenty : native.CInt = ! (p._1 + 96 ).cast[native.Ptr [native.CInt ]]
100
+ def twenty_= (value : native.CInt ): Unit = ! (p._1 + 96 ).cast[native.Ptr [native.CInt ]] = value
101
+ def twentyOne : native.CInt = ! (p._1 + 100 ).cast[native.Ptr [native.CInt ]]
102
+ def twentyOne_= (value : native.CInt ): Unit = ! (p._1 + 100 ).cast[native.Ptr [native.CInt ]] = value
103
+ def twentyTwo : native.CInt = ! (p._1 + 104 ).cast[native.Ptr [native.CInt ]]
104
+ def twentyTwo_= (value : native.CInt ): Unit = ! (p._1 + 104 ).cast[native.Ptr [native.CInt ]] = value
105
+ def twentyThree : native.CInt = ! (p._1 + 108 ).cast[native.Ptr [native.CInt ]]
106
+ def twentyThree_= (value : native.CInt ): Unit = ! (p._1 + 108 ).cast[native.Ptr [native.CInt ]] = value
100
107
}
101
108
102
109
def struct_bigStruct ()(implicit z : native.Zone ): native.Ptr [struct_bigStruct] = native.alloc[struct_bigStruct]
0 commit comments