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