/
swig_example.go
340 lines (272 loc) · 10.3 KB
/
swig_example.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
/* ----------------------------------------------------------------------------
* This file was automatically generated by SWIG (http://www.swig.org).
* Version 3.0.6
*
* This file is not intended to be easily readable and contains a number of
* coding conventions designed to improve portability and efficiency. Do not make
* changes to this file unless you know what you are doing--modify the SWIG
* interface file instead.
* ----------------------------------------------------------------------------- */
// source: swig_example.i
package swig_example
/*
#define intgo swig_intgo
typedef void *swig_voidp;
#include <stdint.h>
typedef long long intgo;
typedef unsigned long long uintgo;
typedef struct { char *p; intgo n; } _gostring_;
typedef struct { void* array; intgo len; intgo cap; } _goslice_;
extern void _wrap_Swig_free_swig_example_00fe93a86ee1a0ea(uintptr_t arg1);
extern void _wrap_delete_Shape_swig_example_00fe93a86ee1a0ea(uintptr_t arg1);
extern void _wrap_Shape_x_set_swig_example_00fe93a86ee1a0ea(uintptr_t arg1, double arg2);
extern double _wrap_Shape_x_get_swig_example_00fe93a86ee1a0ea(uintptr_t arg1);
extern void _wrap_Shape_y_set_swig_example_00fe93a86ee1a0ea(uintptr_t arg1, double arg2);
extern double _wrap_Shape_y_get_swig_example_00fe93a86ee1a0ea(uintptr_t arg1);
extern void _wrap_Shape_move_swig_example_00fe93a86ee1a0ea(uintptr_t arg1, double arg2, double arg3);
extern double _wrap_Shape_area_swig_example_00fe93a86ee1a0ea(uintptr_t arg1);
extern double _wrap_Shape_perimeter_swig_example_00fe93a86ee1a0ea(uintptr_t arg1);
extern void _wrap_Shape_nshapes_set_swig_example_00fe93a86ee1a0ea(swig_intgo arg1);
extern swig_intgo _wrap_Shape_nshapes_get_swig_example_00fe93a86ee1a0ea(void);
extern uintptr_t _wrap_new_Circle_swig_example_00fe93a86ee1a0ea(double arg1);
extern double _wrap_Circle_area_swig_example_00fe93a86ee1a0ea(uintptr_t arg1);
extern double _wrap_Circle_perimeter_swig_example_00fe93a86ee1a0ea(uintptr_t arg1);
extern void _wrap_delete_Circle_swig_example_00fe93a86ee1a0ea(uintptr_t arg1);
extern void _wrap_SetCircle_X_swig_example_00fe93a86ee1a0ea(uintptr_t _swig_base, double arg1);
extern double _wrap_GetCircle_X_swig_example_00fe93a86ee1a0ea(uintptr_t _swig_base);
extern void _wrap_SetCircle_Y_swig_example_00fe93a86ee1a0ea(uintptr_t _swig_base, double arg1);
extern double _wrap_GetCircle_Y_swig_example_00fe93a86ee1a0ea(uintptr_t _swig_base);
extern void _wrap_Circle_move_swig_example_00fe93a86ee1a0ea(uintptr_t _swig_base, double arg1, double arg2);
extern uintptr_t _wrap_new_Square_swig_example_00fe93a86ee1a0ea(double arg1);
extern double _wrap_Square_area_swig_example_00fe93a86ee1a0ea(uintptr_t arg1);
extern double _wrap_Square_perimeter_swig_example_00fe93a86ee1a0ea(uintptr_t arg1);
extern void _wrap_delete_Square_swig_example_00fe93a86ee1a0ea(uintptr_t arg1);
extern void _wrap_SetSquare_X_swig_example_00fe93a86ee1a0ea(uintptr_t _swig_base, double arg1);
extern double _wrap_GetSquare_X_swig_example_00fe93a86ee1a0ea(uintptr_t _swig_base);
extern void _wrap_SetSquare_Y_swig_example_00fe93a86ee1a0ea(uintptr_t _swig_base, double arg1);
extern double _wrap_GetSquare_Y_swig_example_00fe93a86ee1a0ea(uintptr_t _swig_base);
extern void _wrap_Square_move_swig_example_00fe93a86ee1a0ea(uintptr_t _swig_base, double arg1, double arg2);
#undef intgo
*/
import "C"
import "unsafe"
import _ "runtime/cgo"
import "sync"
type _ unsafe.Pointer
var Swig_escape_always_false bool
var Swig_escape_val interface{}
type _swig_fnptr *byte
type _swig_memberptr *byte
type _ sync.Mutex
func Swig_free(arg1 uintptr) {
_swig_i_0 := arg1
C._wrap_Swig_free_swig_example_00fe93a86ee1a0ea(C.uintptr_t(_swig_i_0))
}
type SwigcptrShape uintptr
func (p SwigcptrShape) Swigcptr() uintptr {
return (uintptr)(p)
}
func (p SwigcptrShape) SwigIsShape() {
}
func DeleteShape(arg1 Shape) {
_swig_i_0 := arg1.Swigcptr()
C._wrap_delete_Shape_swig_example_00fe93a86ee1a0ea(C.uintptr_t(_swig_i_0))
}
func (arg1 SwigcptrShape) SetX(arg2 float64) {
_swig_i_0 := arg1
_swig_i_1 := arg2
C._wrap_Shape_x_set_swig_example_00fe93a86ee1a0ea(C.uintptr_t(_swig_i_0), C.double(_swig_i_1))
}
func (arg1 SwigcptrShape) GetX() (_swig_ret float64) {
var swig_r float64
_swig_i_0 := arg1
swig_r = (float64)(C._wrap_Shape_x_get_swig_example_00fe93a86ee1a0ea(C.uintptr_t(_swig_i_0)))
return swig_r
}
func (arg1 SwigcptrShape) SetY(arg2 float64) {
_swig_i_0 := arg1
_swig_i_1 := arg2
C._wrap_Shape_y_set_swig_example_00fe93a86ee1a0ea(C.uintptr_t(_swig_i_0), C.double(_swig_i_1))
}
func (arg1 SwigcptrShape) GetY() (_swig_ret float64) {
var swig_r float64
_swig_i_0 := arg1
swig_r = (float64)(C._wrap_Shape_y_get_swig_example_00fe93a86ee1a0ea(C.uintptr_t(_swig_i_0)))
return swig_r
}
func (arg1 SwigcptrShape) Move(arg2 float64, arg3 float64) {
_swig_i_0 := arg1
_swig_i_1 := arg2
_swig_i_2 := arg3
C._wrap_Shape_move_swig_example_00fe93a86ee1a0ea(C.uintptr_t(_swig_i_0), C.double(_swig_i_1), C.double(_swig_i_2))
}
func (arg1 SwigcptrShape) Area() (_swig_ret float64) {
var swig_r float64
_swig_i_0 := arg1
swig_r = (float64)(C._wrap_Shape_area_swig_example_00fe93a86ee1a0ea(C.uintptr_t(_swig_i_0)))
return swig_r
}
func (arg1 SwigcptrShape) Perimeter() (_swig_ret float64) {
var swig_r float64
_swig_i_0 := arg1
swig_r = (float64)(C._wrap_Shape_perimeter_swig_example_00fe93a86ee1a0ea(C.uintptr_t(_swig_i_0)))
return swig_r
}
func SetShapeNshapes(arg1 int) {
_swig_i_0 := arg1
C._wrap_Shape_nshapes_set_swig_example_00fe93a86ee1a0ea(C.swig_intgo(_swig_i_0))
}
func GetShapeNshapes() (_swig_ret int) {
var swig_r int
swig_r = (int)(C._wrap_Shape_nshapes_get_swig_example_00fe93a86ee1a0ea())
return swig_r
}
type Shape interface {
Swigcptr() uintptr
SwigIsShape()
SetX(arg2 float64)
GetX() (_swig_ret float64)
SetY(arg2 float64)
GetY() (_swig_ret float64)
Move(arg2 float64, arg3 float64)
Area() (_swig_ret float64)
Perimeter() (_swig_ret float64)
}
type SwigcptrCircle uintptr
func (p SwigcptrCircle) Swigcptr() uintptr {
return (uintptr)(p)
}
func (p SwigcptrCircle) SwigIsCircle() {
}
func NewCircle(arg1 float64) (_swig_ret Circle) {
var swig_r Circle
_swig_i_0 := arg1
swig_r = (Circle)(SwigcptrCircle(C._wrap_new_Circle_swig_example_00fe93a86ee1a0ea(C.double(_swig_i_0))))
return swig_r
}
func (arg1 SwigcptrCircle) Area() (_swig_ret float64) {
var swig_r float64
_swig_i_0 := arg1
swig_r = (float64)(C._wrap_Circle_area_swig_example_00fe93a86ee1a0ea(C.uintptr_t(_swig_i_0)))
return swig_r
}
func (arg1 SwigcptrCircle) Perimeter() (_swig_ret float64) {
var swig_r float64
_swig_i_0 := arg1
swig_r = (float64)(C._wrap_Circle_perimeter_swig_example_00fe93a86ee1a0ea(C.uintptr_t(_swig_i_0)))
return swig_r
}
func DeleteCircle(arg1 Circle) {
_swig_i_0 := arg1.Swigcptr()
C._wrap_delete_Circle_swig_example_00fe93a86ee1a0ea(C.uintptr_t(_swig_i_0))
}
func (_swig_base SwigcptrCircle) SetX(arg1 float64) {
_swig_i_0 := arg1
C._wrap_SetCircle_X_swig_example_00fe93a86ee1a0ea(C.uintptr_t(_swig_base), C.double(_swig_i_0))
}
func (_swig_base SwigcptrCircle) GetX() (_swig_ret float64) {
var swig_r float64
swig_r = (float64)(C._wrap_GetCircle_X_swig_example_00fe93a86ee1a0ea(C.uintptr_t(_swig_base)))
return swig_r
}
func (_swig_base SwigcptrCircle) SetY(arg1 float64) {
_swig_i_0 := arg1
C._wrap_SetCircle_Y_swig_example_00fe93a86ee1a0ea(C.uintptr_t(_swig_base), C.double(_swig_i_0))
}
func (_swig_base SwigcptrCircle) GetY() (_swig_ret float64) {
var swig_r float64
swig_r = (float64)(C._wrap_GetCircle_Y_swig_example_00fe93a86ee1a0ea(C.uintptr_t(_swig_base)))
return swig_r
}
func (_swig_base SwigcptrCircle) Move(arg1 float64, arg2 float64) {
_swig_i_0 := arg1
_swig_i_1 := arg2
C._wrap_Circle_move_swig_example_00fe93a86ee1a0ea(C.uintptr_t(_swig_base), C.double(_swig_i_0), C.double(_swig_i_1))
}
func (p SwigcptrCircle) SwigIsShape() {
}
func (p SwigcptrCircle) SwigGetShape() Shape {
return SwigcptrShape(p.Swigcptr())
}
type Circle interface {
Swigcptr() uintptr
SwigIsCircle()
Area() (_swig_ret float64)
Perimeter() (_swig_ret float64)
SetX(arg1 float64)
GetX() (_swig_ret float64)
SetY(arg1 float64)
GetY() (_swig_ret float64)
Move(arg1 float64, arg2 float64)
SwigIsShape()
SwigGetShape() Shape
}
type SwigcptrSquare uintptr
func (p SwigcptrSquare) Swigcptr() uintptr {
return (uintptr)(p)
}
func (p SwigcptrSquare) SwigIsSquare() {
}
func NewSquare(arg1 float64) (_swig_ret Square) {
var swig_r Square
_swig_i_0 := arg1
swig_r = (Square)(SwigcptrSquare(C._wrap_new_Square_swig_example_00fe93a86ee1a0ea(C.double(_swig_i_0))))
return swig_r
}
func (arg1 SwigcptrSquare) Area() (_swig_ret float64) {
var swig_r float64
_swig_i_0 := arg1
swig_r = (float64)(C._wrap_Square_area_swig_example_00fe93a86ee1a0ea(C.uintptr_t(_swig_i_0)))
return swig_r
}
func (arg1 SwigcptrSquare) Perimeter() (_swig_ret float64) {
var swig_r float64
_swig_i_0 := arg1
swig_r = (float64)(C._wrap_Square_perimeter_swig_example_00fe93a86ee1a0ea(C.uintptr_t(_swig_i_0)))
return swig_r
}
func DeleteSquare(arg1 Square) {
_swig_i_0 := arg1.Swigcptr()
C._wrap_delete_Square_swig_example_00fe93a86ee1a0ea(C.uintptr_t(_swig_i_0))
}
func (_swig_base SwigcptrSquare) SetX(arg1 float64) {
_swig_i_0 := arg1
C._wrap_SetSquare_X_swig_example_00fe93a86ee1a0ea(C.uintptr_t(_swig_base), C.double(_swig_i_0))
}
func (_swig_base SwigcptrSquare) GetX() (_swig_ret float64) {
var swig_r float64
swig_r = (float64)(C._wrap_GetSquare_X_swig_example_00fe93a86ee1a0ea(C.uintptr_t(_swig_base)))
return swig_r
}
func (_swig_base SwigcptrSquare) SetY(arg1 float64) {
_swig_i_0 := arg1
C._wrap_SetSquare_Y_swig_example_00fe93a86ee1a0ea(C.uintptr_t(_swig_base), C.double(_swig_i_0))
}
func (_swig_base SwigcptrSquare) GetY() (_swig_ret float64) {
var swig_r float64
swig_r = (float64)(C._wrap_GetSquare_Y_swig_example_00fe93a86ee1a0ea(C.uintptr_t(_swig_base)))
return swig_r
}
func (_swig_base SwigcptrSquare) Move(arg1 float64, arg2 float64) {
_swig_i_0 := arg1
_swig_i_1 := arg2
C._wrap_Square_move_swig_example_00fe93a86ee1a0ea(C.uintptr_t(_swig_base), C.double(_swig_i_0), C.double(_swig_i_1))
}
func (p SwigcptrSquare) SwigIsShape() {
}
func (p SwigcptrSquare) SwigGetShape() Shape {
return SwigcptrShape(p.Swigcptr())
}
type Square interface {
Swigcptr() uintptr
SwigIsSquare()
Area() (_swig_ret float64)
Perimeter() (_swig_ret float64)
SetX(arg1 float64)
GetX() (_swig_ret float64)
SetY(arg1 float64)
GetY() (_swig_ret float64)
Move(arg1 float64, arg2 float64)
SwigIsShape()
SwigGetShape() Shape
}