sidan-gin 0.1.2__py3-none-any.whl → 0.1.5__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of sidan-gin might be problematic. Click here for more details.

Files changed (36) hide show
  1. sidan_gin/python_signing_module/.git +1 -0
  2. sidan_gin/python_signing_module/.gitignore +11 -0
  3. sidan_gin/python_signing_module/.vscode/settings.json +32 -0
  4. sidan_gin/python_signing_module/Cargo.lock +1914 -0
  5. sidan_gin/python_signing_module/Cargo.toml +14 -0
  6. sidan_gin/python_signing_module/README.md +2 -0
  7. sidan_gin/python_signing_module/__init__.py +1 -0
  8. sidan_gin/python_signing_module/build.rs +9 -0
  9. sidan_gin/python_signing_module/build.sh +9 -0
  10. sidan_gin/python_signing_module/src/CardanoSigner.py +70 -0
  11. sidan_gin/python_signing_module/src/_CardanoSigner.cpython-311-x86_64-linux-gnu.so +0 -0
  12. sidan_gin/python_signing_module/src/__init__.py +0 -0
  13. sidan_gin/python_signing_module/src/build/lib.linux-x86_64-cpython-311/_CardanoSigner.cpython-311-x86_64-linux-gnu.so +0 -0
  14. sidan_gin/python_signing_module/src/build/temp.linux-x86_64-cpython-311/signer.o +0 -0
  15. sidan_gin/python_signing_module/src/build/temp.linux-x86_64-cpython-311/signer_wrap.o +0 -0
  16. sidan_gin/python_signing_module/src/cxx.h +1149 -0
  17. sidan_gin/python_signing_module/src/lib.rs +57 -0
  18. sidan_gin/python_signing_module/src/lib.rs.h +403 -0
  19. sidan_gin/python_signing_module/src/libsigner.a +0 -0
  20. sidan_gin/python_signing_module/src/setup.py +16 -0
  21. sidan_gin/python_signing_module/src/signer.cpp +73 -0
  22. sidan_gin/python_signing_module/src/signer.h +37 -0
  23. sidan_gin/python_signing_module/src/signer.i +16 -0
  24. sidan_gin/python_signing_module/src/signer_wrap.cxx +4092 -0
  25. sidan_gin/wallet/__init__.py +1 -1
  26. sidan_gin/wallet/cli.py +13 -0
  27. sidan_gin/wallet/derivation_indices.py +30 -0
  28. sidan_gin/wallet/mnemonic.py +24 -0
  29. sidan_gin/wallet/root_key.py +24 -0
  30. sidan_gin/wallet/wallet.py +48 -40
  31. sidan_gin-0.1.5.dist-info/METADATA +63 -0
  32. sidan_gin-0.1.5.dist-info/RECORD +47 -0
  33. sidan_gin-0.1.2.dist-info/METADATA +0 -34
  34. sidan_gin-0.1.2.dist-info/RECORD +0 -19
  35. {sidan_gin-0.1.2.dist-info → sidan_gin-0.1.5.dist-info}/LICENSE +0 -0
  36. {sidan_gin-0.1.2.dist-info → sidan_gin-0.1.5.dist-info}/WHEEL +0 -0
@@ -0,0 +1,4092 @@
1
+ /* ----------------------------------------------------------------------------
2
+ * This file was automatically generated by SWIG (https://www.swig.org).
3
+ * Version 4.2.0
4
+ *
5
+ * Do not make changes to this file unless you know what you are doing - modify
6
+ * the SWIG interface file instead.
7
+ * ----------------------------------------------------------------------------- */
8
+
9
+
10
+ #define SWIG_VERSION 0x040200
11
+ #define SWIGPYTHON
12
+ #define SWIG_PYTHON_DIRECTOR_NO_VTABLE
13
+
14
+ /* -----------------------------------------------------------------------------
15
+ * This section contains generic SWIG labels for method/variable
16
+ * declarations/attributes, and other compiler dependent labels.
17
+ * ----------------------------------------------------------------------------- */
18
+
19
+ /* template workaround for compilers that cannot correctly implement the C++ standard */
20
+ #ifndef SWIGTEMPLATEDISAMBIGUATOR
21
+ # if defined(__SUNPRO_CC) && (__SUNPRO_CC <= 0x560)
22
+ # define SWIGTEMPLATEDISAMBIGUATOR template
23
+ # elif defined(__HP_aCC)
24
+ /* Needed even with `aCC -AA' when `aCC -V' reports HP ANSI C++ B3910B A.03.55 */
25
+ /* If we find a maximum version that requires this, the test would be __HP_aCC <= 35500 for A.03.55 */
26
+ # define SWIGTEMPLATEDISAMBIGUATOR template
27
+ # else
28
+ # define SWIGTEMPLATEDISAMBIGUATOR
29
+ # endif
30
+ #endif
31
+
32
+ /* inline attribute */
33
+ #ifndef SWIGINLINE
34
+ # if defined(__cplusplus) || (defined(__GNUC__) && !defined(__STRICT_ANSI__))
35
+ # define SWIGINLINE inline
36
+ # else
37
+ # define SWIGINLINE
38
+ # endif
39
+ #endif
40
+
41
+ /* attribute recognised by some compilers to avoid 'unused' warnings */
42
+ #ifndef SWIGUNUSED
43
+ # if defined(__GNUC__)
44
+ # if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
45
+ # define SWIGUNUSED __attribute__ ((__unused__))
46
+ # else
47
+ # define SWIGUNUSED
48
+ # endif
49
+ # elif defined(__ICC)
50
+ # define SWIGUNUSED __attribute__ ((__unused__))
51
+ # else
52
+ # define SWIGUNUSED
53
+ # endif
54
+ #endif
55
+
56
+ #ifndef SWIG_MSC_UNSUPPRESS_4505
57
+ # if defined(_MSC_VER)
58
+ # pragma warning(disable : 4505) /* unreferenced local function has been removed */
59
+ # endif
60
+ #endif
61
+
62
+ #ifndef SWIGUNUSEDPARM
63
+ # ifdef __cplusplus
64
+ # define SWIGUNUSEDPARM(p)
65
+ # else
66
+ # define SWIGUNUSEDPARM(p) p SWIGUNUSED
67
+ # endif
68
+ #endif
69
+
70
+ /* internal SWIG method */
71
+ #ifndef SWIGINTERN
72
+ # define SWIGINTERN static SWIGUNUSED
73
+ #endif
74
+
75
+ /* internal inline SWIG method */
76
+ #ifndef SWIGINTERNINLINE
77
+ # define SWIGINTERNINLINE SWIGINTERN SWIGINLINE
78
+ #endif
79
+
80
+ /* exporting methods */
81
+ #if defined(__GNUC__)
82
+ # if (__GNUC__ >= 4) || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)
83
+ # ifndef GCC_HASCLASSVISIBILITY
84
+ # define GCC_HASCLASSVISIBILITY
85
+ # endif
86
+ # endif
87
+ #endif
88
+
89
+ #ifndef SWIGEXPORT
90
+ # if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__)
91
+ # if defined(STATIC_LINKED)
92
+ # define SWIGEXPORT
93
+ # else
94
+ # define SWIGEXPORT __declspec(dllexport)
95
+ # endif
96
+ # else
97
+ # if defined(__GNUC__) && defined(GCC_HASCLASSVISIBILITY)
98
+ # define SWIGEXPORT __attribute__ ((visibility("default")))
99
+ # else
100
+ # define SWIGEXPORT
101
+ # endif
102
+ # endif
103
+ #endif
104
+
105
+ /* calling conventions for Windows */
106
+ #ifndef SWIGSTDCALL
107
+ # if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__)
108
+ # define SWIGSTDCALL __stdcall
109
+ # else
110
+ # define SWIGSTDCALL
111
+ # endif
112
+ #endif
113
+
114
+ /* Deal with Microsoft's attempt at deprecating C standard runtime functions */
115
+ #if !defined(SWIG_NO_CRT_SECURE_NO_DEPRECATE) && defined(_MSC_VER) && !defined(_CRT_SECURE_NO_DEPRECATE)
116
+ # define _CRT_SECURE_NO_DEPRECATE
117
+ #endif
118
+
119
+ /* Deal with Microsoft's attempt at deprecating methods in the standard C++ library */
120
+ #if !defined(SWIG_NO_SCL_SECURE_NO_DEPRECATE) && defined(_MSC_VER) && !defined(_SCL_SECURE_NO_DEPRECATE)
121
+ # define _SCL_SECURE_NO_DEPRECATE
122
+ #endif
123
+
124
+ /* Deal with Apple's deprecated 'AssertMacros.h' from Carbon-framework */
125
+ #if defined(__APPLE__) && !defined(__ASSERT_MACROS_DEFINE_VERSIONS_WITHOUT_UNDERSCORES)
126
+ # define __ASSERT_MACROS_DEFINE_VERSIONS_WITHOUT_UNDERSCORES 0
127
+ #endif
128
+
129
+ /* Intel's compiler complains if a variable which was never initialised is
130
+ * cast to void, which is a common idiom which we use to indicate that we
131
+ * are aware a variable isn't used. So we just silence that warning.
132
+ * See: https://github.com/swig/swig/issues/192 for more discussion.
133
+ */
134
+ #ifdef __INTEL_COMPILER
135
+ # pragma warning disable 592
136
+ #endif
137
+
138
+ #if __cplusplus >=201103L
139
+ # define SWIG_NULLPTR nullptr
140
+ #else
141
+ # define SWIG_NULLPTR NULL
142
+ #endif
143
+
144
+
145
+ #if defined(__GNUC__) && defined(_WIN32) && !defined(SWIG_PYTHON_NO_HYPOT_WORKAROUND)
146
+ /* Workaround for '::hypot' has not been declared', see https://bugs.python.org/issue11566 */
147
+ # include <math.h>
148
+ #endif
149
+
150
+ #if !defined(PY_SSIZE_T_CLEAN) && !defined(SWIG_NO_PY_SSIZE_T_CLEAN)
151
+ #define PY_SSIZE_T_CLEAN
152
+ #endif
153
+
154
+ #if __GNUC__ >= 7
155
+ #pragma GCC diagnostic push
156
+ #if defined(__cplusplus) && __cplusplus >=201703L
157
+ #pragma GCC diagnostic ignored "-Wregister" /* For python-2.7 headers that use register */
158
+ #endif
159
+ #endif
160
+
161
+ #if defined(_DEBUG) && defined(SWIG_PYTHON_INTERPRETER_NO_DEBUG)
162
+ /* Use debug wrappers with the Python release dll */
163
+
164
+ #if defined(_MSC_VER) && _MSC_VER >= 1929
165
+ /* Workaround compilation errors when redefining _DEBUG in MSVC 2019 version 16.10 and later
166
+ * See https://github.com/swig/swig/issues/2090 */
167
+ # include <corecrt.h>
168
+ #endif
169
+
170
+ # undef _DEBUG
171
+ # include <Python.h>
172
+ # define _DEBUG 1
173
+ #else
174
+ # include <Python.h>
175
+ #endif
176
+
177
+ #if __GNUC__ >= 7
178
+ #pragma GCC diagnostic pop
179
+ #endif
180
+
181
+ #include <stdio.h>
182
+
183
+ /* -----------------------------------------------------------------------------
184
+ * swigrun.swg
185
+ *
186
+ * This file contains generic C API SWIG runtime support for pointer
187
+ * type checking.
188
+ * ----------------------------------------------------------------------------- */
189
+
190
+ /* This should only be incremented when either the layout of swig_type_info changes,
191
+ or for whatever reason, the runtime changes incompatibly */
192
+ #define SWIG_RUNTIME_VERSION "4"
193
+
194
+ /* define SWIG_TYPE_TABLE_NAME as "SWIG_TYPE_TABLE" */
195
+ #ifdef SWIG_TYPE_TABLE
196
+ # define SWIG_QUOTE_STRING(x) #x
197
+ # define SWIG_EXPAND_AND_QUOTE_STRING(x) SWIG_QUOTE_STRING(x)
198
+ # define SWIG_TYPE_TABLE_NAME SWIG_EXPAND_AND_QUOTE_STRING(SWIG_TYPE_TABLE)
199
+ #else
200
+ # define SWIG_TYPE_TABLE_NAME
201
+ #endif
202
+
203
+ /*
204
+ You can use the SWIGRUNTIME and SWIGRUNTIMEINLINE macros for
205
+ creating a static or dynamic library from the SWIG runtime code.
206
+ In 99.9% of the cases, SWIG just needs to declare them as 'static'.
207
+
208
+ But only do this if strictly necessary, ie, if you have problems
209
+ with your compiler or suchlike.
210
+ */
211
+
212
+ #ifndef SWIGRUNTIME
213
+ # define SWIGRUNTIME SWIGINTERN
214
+ #endif
215
+
216
+ #ifndef SWIGRUNTIMEINLINE
217
+ # define SWIGRUNTIMEINLINE SWIGRUNTIME SWIGINLINE
218
+ #endif
219
+
220
+ /* Generic buffer size */
221
+ #ifndef SWIG_BUFFER_SIZE
222
+ # define SWIG_BUFFER_SIZE 1024
223
+ #endif
224
+
225
+ /* Flags for pointer conversions */
226
+ #define SWIG_POINTER_DISOWN 0x1
227
+ #define SWIG_CAST_NEW_MEMORY 0x2
228
+ #define SWIG_POINTER_NO_NULL 0x4
229
+ #define SWIG_POINTER_CLEAR 0x8
230
+ #define SWIG_POINTER_RELEASE (SWIG_POINTER_CLEAR | SWIG_POINTER_DISOWN)
231
+
232
+ /* Flags for new pointer objects */
233
+ #define SWIG_POINTER_OWN 0x1
234
+
235
+
236
+ /*
237
+ Flags/methods for returning states.
238
+
239
+ The SWIG conversion methods, as ConvertPtr, return an integer
240
+ that tells if the conversion was successful or not. And if not,
241
+ an error code can be returned (see swigerrors.swg for the codes).
242
+
243
+ Use the following macros/flags to set or process the returning
244
+ states.
245
+
246
+ In old versions of SWIG, code such as the following was usually written:
247
+
248
+ if (SWIG_ConvertPtr(obj,vptr,ty.flags) != -1) {
249
+ // success code
250
+ } else {
251
+ //fail code
252
+ }
253
+
254
+ Now you can be more explicit:
255
+
256
+ int res = SWIG_ConvertPtr(obj,vptr,ty.flags);
257
+ if (SWIG_IsOK(res)) {
258
+ // success code
259
+ } else {
260
+ // fail code
261
+ }
262
+
263
+ which is the same really, but now you can also do
264
+
265
+ Type *ptr;
266
+ int res = SWIG_ConvertPtr(obj,(void **)(&ptr),ty.flags);
267
+ if (SWIG_IsOK(res)) {
268
+ // success code
269
+ if (SWIG_IsNewObj(res) {
270
+ ...
271
+ delete *ptr;
272
+ } else {
273
+ ...
274
+ }
275
+ } else {
276
+ // fail code
277
+ }
278
+
279
+ I.e., now SWIG_ConvertPtr can return new objects and you can
280
+ identify the case and take care of the deallocation. Of course that
281
+ also requires SWIG_ConvertPtr to return new result values, such as
282
+
283
+ int SWIG_ConvertPtr(obj, ptr,...) {
284
+ if (<obj is ok>) {
285
+ if (<need new object>) {
286
+ *ptr = <ptr to new allocated object>;
287
+ return SWIG_NEWOBJ;
288
+ } else {
289
+ *ptr = <ptr to old object>;
290
+ return SWIG_OLDOBJ;
291
+ }
292
+ } else {
293
+ return SWIG_BADOBJ;
294
+ }
295
+ }
296
+
297
+ Of course, returning the plain '0(success)/-1(fail)' still works, but you can be
298
+ more explicit by returning SWIG_BADOBJ, SWIG_ERROR or any of the
299
+ SWIG errors code.
300
+
301
+ Finally, if the SWIG_CASTRANK_MODE is enabled, the result code
302
+ allows returning the 'cast rank', for example, if you have this
303
+
304
+ int food(double)
305
+ int fooi(int);
306
+
307
+ and you call
308
+
309
+ food(1) // cast rank '1' (1 -> 1.0)
310
+ fooi(1) // cast rank '0'
311
+
312
+ just use the SWIG_AddCast()/SWIG_CheckState()
313
+ */
314
+
315
+ #define SWIG_OK (0)
316
+ /* Runtime errors are < 0 */
317
+ #define SWIG_ERROR (-1)
318
+ /* Errors in range -1 to -99 are in swigerrors.swg (errors for all languages including those not using the runtime) */
319
+ /* Errors in range -100 to -199 are language specific errors defined in *errors.swg */
320
+ /* Errors < -200 are generic runtime specific errors */
321
+ #define SWIG_ERROR_RELEASE_NOT_OWNED (-200)
322
+
323
+ #define SWIG_IsOK(r) (r >= 0)
324
+ #define SWIG_ArgError(r) ((r != SWIG_ERROR) ? r : SWIG_TypeError)
325
+
326
+ /* The CastRankLimit says how many bits are used for the cast rank */
327
+ #define SWIG_CASTRANKLIMIT (1 << 8)
328
+ /* The NewMask denotes the object was created (using new/malloc) */
329
+ #define SWIG_NEWOBJMASK (SWIG_CASTRANKLIMIT << 1)
330
+ /* The TmpMask is for in/out typemaps that use temporary objects */
331
+ #define SWIG_TMPOBJMASK (SWIG_NEWOBJMASK << 1)
332
+ /* Simple returning values */
333
+ #define SWIG_BADOBJ (SWIG_ERROR)
334
+ #define SWIG_OLDOBJ (SWIG_OK)
335
+ #define SWIG_NEWOBJ (SWIG_OK | SWIG_NEWOBJMASK)
336
+ #define SWIG_TMPOBJ (SWIG_OK | SWIG_TMPOBJMASK)
337
+ /* Check, add and del object mask methods */
338
+ #define SWIG_AddNewMask(r) (SWIG_IsOK(r) ? (r | SWIG_NEWOBJMASK) : r)
339
+ #define SWIG_DelNewMask(r) (SWIG_IsOK(r) ? (r & ~SWIG_NEWOBJMASK) : r)
340
+ #define SWIG_IsNewObj(r) (SWIG_IsOK(r) && (r & SWIG_NEWOBJMASK))
341
+ #define SWIG_AddTmpMask(r) (SWIG_IsOK(r) ? (r | SWIG_TMPOBJMASK) : r)
342
+ #define SWIG_DelTmpMask(r) (SWIG_IsOK(r) ? (r & ~SWIG_TMPOBJMASK) : r)
343
+ #define SWIG_IsTmpObj(r) (SWIG_IsOK(r) && (r & SWIG_TMPOBJMASK))
344
+
345
+ /* Cast-Rank Mode */
346
+ #if defined(SWIG_CASTRANK_MODE)
347
+ # ifndef SWIG_TypeRank
348
+ # define SWIG_TypeRank unsigned long
349
+ # endif
350
+ # ifndef SWIG_MAXCASTRANK /* Default cast allowed */
351
+ # define SWIG_MAXCASTRANK (2)
352
+ # endif
353
+ # define SWIG_CASTRANKMASK ((SWIG_CASTRANKLIMIT) -1)
354
+ # define SWIG_CastRank(r) (r & SWIG_CASTRANKMASK)
355
+ SWIGINTERNINLINE int SWIG_AddCast(int r) {
356
+ return SWIG_IsOK(r) ? ((SWIG_CastRank(r) < SWIG_MAXCASTRANK) ? (r + 1) : SWIG_ERROR) : r;
357
+ }
358
+ SWIGINTERNINLINE int SWIG_CheckState(int r) {
359
+ return SWIG_IsOK(r) ? SWIG_CastRank(r) + 1 : 0;
360
+ }
361
+ #else /* no cast-rank mode */
362
+ # define SWIG_AddCast(r) (r)
363
+ # define SWIG_CheckState(r) (SWIG_IsOK(r) ? 1 : 0)
364
+ #endif
365
+
366
+ /* C99 and C++11 should provide snprintf, but define SWIG_NO_SNPRINTF
367
+ * if you're missing it.
368
+ */
369
+ #if ((defined __STDC_VERSION__ && __STDC_VERSION__ >= 199901L) || \
370
+ (defined __cplusplus && __cplusplus >= 201103L) || \
371
+ defined SWIG_HAVE_SNPRINTF) && \
372
+ !defined SWIG_NO_SNPRINTF
373
+ # define SWIG_snprintf(O,S,F,A) snprintf(O,S,F,A)
374
+ # define SWIG_snprintf2(O,S,F,A,B) snprintf(O,S,F,A,B)
375
+ #else
376
+ /* Fallback versions ignore the buffer size, but most of our uses either have a
377
+ * fixed maximum possible size or dynamically allocate a buffer that's large
378
+ * enough.
379
+ */
380
+ # define SWIG_snprintf(O,S,F,A) sprintf(O,F,A)
381
+ # define SWIG_snprintf2(O,S,F,A,B) sprintf(O,F,A,B)
382
+ #endif
383
+
384
+ #include <string.h>
385
+
386
+ #ifdef __cplusplus
387
+ extern "C" {
388
+ #endif
389
+
390
+ typedef void *(*swig_converter_func)(void *, int *);
391
+ typedef struct swig_type_info *(*swig_dycast_func)(void **);
392
+
393
+ /* Structure to store information on one type */
394
+ typedef struct swig_type_info {
395
+ const char *name; /* mangled name of this type */
396
+ const char *str; /* human readable name of this type */
397
+ swig_dycast_func dcast; /* dynamic cast function down a hierarchy */
398
+ struct swig_cast_info *cast; /* linked list of types that can cast into this type */
399
+ void *clientdata; /* language specific type data */
400
+ int owndata; /* flag if the structure owns the clientdata */
401
+ } swig_type_info;
402
+
403
+ /* Structure to store a type and conversion function used for casting */
404
+ typedef struct swig_cast_info {
405
+ swig_type_info *type; /* pointer to type that is equivalent to this type */
406
+ swig_converter_func converter; /* function to cast the void pointers */
407
+ struct swig_cast_info *next; /* pointer to next cast in linked list */
408
+ struct swig_cast_info *prev; /* pointer to the previous cast */
409
+ } swig_cast_info;
410
+
411
+ /* Structure used to store module information
412
+ * Each module generates one structure like this, and the runtime collects
413
+ * all of these structures and stores them in a circularly linked list.*/
414
+ typedef struct swig_module_info {
415
+ swig_type_info **types; /* Array of pointers to swig_type_info structures that are in this module */
416
+ size_t size; /* Number of types in this module */
417
+ struct swig_module_info *next; /* Pointer to next element in circularly linked list */
418
+ swig_type_info **type_initial; /* Array of initially generated type structures */
419
+ swig_cast_info **cast_initial; /* Array of initially generated casting structures */
420
+ void *clientdata; /* Language specific module data */
421
+ } swig_module_info;
422
+
423
+ /*
424
+ Compare two type names skipping the space characters, therefore
425
+ "char*" == "char *" and "Class<int>" == "Class<int >", etc.
426
+
427
+ Return 0 when the two name types are equivalent, as in
428
+ strncmp, but skipping ' '.
429
+ */
430
+ SWIGRUNTIME int
431
+ SWIG_TypeNameComp(const char *f1, const char *l1,
432
+ const char *f2, const char *l2) {
433
+ for (;(f1 != l1) && (f2 != l2); ++f1, ++f2) {
434
+ while ((*f1 == ' ') && (f1 != l1)) ++f1;
435
+ while ((*f2 == ' ') && (f2 != l2)) ++f2;
436
+ if (*f1 != *f2) return (*f1 > *f2) ? 1 : -1;
437
+ }
438
+ return (int)((l1 - f1) - (l2 - f2));
439
+ }
440
+
441
+ /*
442
+ Check type equivalence in a name list like <name1>|<name2>|...
443
+ Return 0 if equal, -1 if nb < tb, 1 if nb > tb
444
+ */
445
+ SWIGRUNTIME int
446
+ SWIG_TypeCmp(const char *nb, const char *tb) {
447
+ int equiv = 1;
448
+ const char* te = tb + strlen(tb);
449
+ const char* ne = nb;
450
+ while (equiv != 0 && *ne) {
451
+ for (nb = ne; *ne; ++ne) {
452
+ if (*ne == '|') break;
453
+ }
454
+ equiv = SWIG_TypeNameComp(nb, ne, tb, te);
455
+ if (*ne) ++ne;
456
+ }
457
+ return equiv;
458
+ }
459
+
460
+ /*
461
+ Check type equivalence in a name list like <name1>|<name2>|...
462
+ Return 0 if not equal, 1 if equal
463
+ */
464
+ SWIGRUNTIME int
465
+ SWIG_TypeEquiv(const char *nb, const char *tb) {
466
+ return SWIG_TypeCmp(nb, tb) == 0 ? 1 : 0;
467
+ }
468
+
469
+ /*
470
+ Check the typename
471
+ */
472
+ SWIGRUNTIME swig_cast_info *
473
+ SWIG_TypeCheck(const char *c, swig_type_info *ty) {
474
+ if (ty) {
475
+ swig_cast_info *iter = ty->cast;
476
+ while (iter) {
477
+ if (strcmp(iter->type->name, c) == 0) {
478
+ if (iter == ty->cast)
479
+ return iter;
480
+ /* Move iter to the top of the linked list */
481
+ iter->prev->next = iter->next;
482
+ if (iter->next)
483
+ iter->next->prev = iter->prev;
484
+ iter->next = ty->cast;
485
+ iter->prev = 0;
486
+ if (ty->cast) ty->cast->prev = iter;
487
+ ty->cast = iter;
488
+ return iter;
489
+ }
490
+ iter = iter->next;
491
+ }
492
+ }
493
+ return 0;
494
+ }
495
+
496
+ /*
497
+ Identical to SWIG_TypeCheck, except strcmp is replaced with a pointer comparison
498
+ */
499
+ SWIGRUNTIME swig_cast_info *
500
+ SWIG_TypeCheckStruct(const swig_type_info *from, swig_type_info *ty) {
501
+ if (ty) {
502
+ swig_cast_info *iter = ty->cast;
503
+ while (iter) {
504
+ if (iter->type == from) {
505
+ if (iter == ty->cast)
506
+ return iter;
507
+ /* Move iter to the top of the linked list */
508
+ iter->prev->next = iter->next;
509
+ if (iter->next)
510
+ iter->next->prev = iter->prev;
511
+ iter->next = ty->cast;
512
+ iter->prev = 0;
513
+ if (ty->cast) ty->cast->prev = iter;
514
+ ty->cast = iter;
515
+ return iter;
516
+ }
517
+ iter = iter->next;
518
+ }
519
+ }
520
+ return 0;
521
+ }
522
+
523
+ /*
524
+ Cast a pointer up an inheritance hierarchy
525
+ */
526
+ SWIGRUNTIMEINLINE void *
527
+ SWIG_TypeCast(swig_cast_info *ty, void *ptr, int *newmemory) {
528
+ return ((!ty) || (!ty->converter)) ? ptr : (*ty->converter)(ptr, newmemory);
529
+ }
530
+
531
+ /*
532
+ Dynamic pointer casting. Down an inheritance hierarchy
533
+ */
534
+ SWIGRUNTIME swig_type_info *
535
+ SWIG_TypeDynamicCast(swig_type_info *ty, void **ptr) {
536
+ swig_type_info *lastty = ty;
537
+ if (!ty || !ty->dcast) return ty;
538
+ while (ty && (ty->dcast)) {
539
+ ty = (*ty->dcast)(ptr);
540
+ if (ty) lastty = ty;
541
+ }
542
+ return lastty;
543
+ }
544
+
545
+ /*
546
+ Return the name associated with this type
547
+ */
548
+ SWIGRUNTIMEINLINE const char *
549
+ SWIG_TypeName(const swig_type_info *ty) {
550
+ return ty->name;
551
+ }
552
+
553
+ /*
554
+ Return the pretty name associated with this type,
555
+ that is an unmangled type name in a form presentable to the user.
556
+ */
557
+ SWIGRUNTIME const char *
558
+ SWIG_TypePrettyName(const swig_type_info *type) {
559
+ /* The "str" field contains the equivalent pretty names of the
560
+ type, separated by vertical-bar characters. Choose the last
561
+ name. It should be the most specific; a fully resolved name
562
+ but not necessarily with default template parameters expanded. */
563
+ if (!type) return NULL;
564
+ if (type->str != NULL) {
565
+ const char *last_name = type->str;
566
+ const char *s;
567
+ for (s = type->str; *s; s++)
568
+ if (*s == '|') last_name = s+1;
569
+ return last_name;
570
+ }
571
+ else
572
+ return type->name;
573
+ }
574
+
575
+ /*
576
+ Set the clientdata field for a type
577
+ */
578
+ SWIGRUNTIME void
579
+ SWIG_TypeClientData(swig_type_info *ti, void *clientdata) {
580
+ swig_cast_info *cast = ti->cast;
581
+ /* if (ti->clientdata == clientdata) return; */
582
+ ti->clientdata = clientdata;
583
+
584
+ while (cast) {
585
+ if (!cast->converter) {
586
+ swig_type_info *tc = cast->type;
587
+ if (!tc->clientdata) {
588
+ SWIG_TypeClientData(tc, clientdata);
589
+ }
590
+ }
591
+ cast = cast->next;
592
+ }
593
+ }
594
+ SWIGRUNTIME void
595
+ SWIG_TypeNewClientData(swig_type_info *ti, void *clientdata) {
596
+ SWIG_TypeClientData(ti, clientdata);
597
+ ti->owndata = 1;
598
+ }
599
+
600
+ /*
601
+ Search for a swig_type_info structure only by mangled name
602
+ Search is a O(log #types)
603
+
604
+ We start searching at module start, and finish searching when start == end.
605
+ Note: if start == end at the beginning of the function, we go all the way around
606
+ the circular list.
607
+ */
608
+ SWIGRUNTIME swig_type_info *
609
+ SWIG_MangledTypeQueryModule(swig_module_info *start,
610
+ swig_module_info *end,
611
+ const char *name) {
612
+ swig_module_info *iter = start;
613
+ do {
614
+ if (iter->size) {
615
+ size_t l = 0;
616
+ size_t r = iter->size - 1;
617
+ do {
618
+ /* since l+r >= 0, we can (>> 1) instead (/ 2) */
619
+ size_t i = (l + r) >> 1;
620
+ const char *iname = iter->types[i]->name;
621
+ if (iname) {
622
+ int compare = strcmp(name, iname);
623
+ if (compare == 0) {
624
+ return iter->types[i];
625
+ } else if (compare < 0) {
626
+ if (i) {
627
+ r = i - 1;
628
+ } else {
629
+ break;
630
+ }
631
+ } else if (compare > 0) {
632
+ l = i + 1;
633
+ }
634
+ } else {
635
+ break; /* should never happen */
636
+ }
637
+ } while (l <= r);
638
+ }
639
+ iter = iter->next;
640
+ } while (iter != end);
641
+ return 0;
642
+ }
643
+
644
+ /*
645
+ Search for a swig_type_info structure for either a mangled name or a human readable name.
646
+ It first searches the mangled names of the types, which is a O(log #types)
647
+ If a type is not found it then searches the human readable names, which is O(#types).
648
+
649
+ We start searching at module start, and finish searching when start == end.
650
+ Note: if start == end at the beginning of the function, we go all the way around
651
+ the circular list.
652
+ */
653
+ SWIGRUNTIME swig_type_info *
654
+ SWIG_TypeQueryModule(swig_module_info *start,
655
+ swig_module_info *end,
656
+ const char *name) {
657
+ /* STEP 1: Search the name field using binary search */
658
+ swig_type_info *ret = SWIG_MangledTypeQueryModule(start, end, name);
659
+ if (ret) {
660
+ return ret;
661
+ } else {
662
+ /* STEP 2: If the type hasn't been found, do a complete search
663
+ of the str field (the human readable name) */
664
+ swig_module_info *iter = start;
665
+ do {
666
+ size_t i = 0;
667
+ for (; i < iter->size; ++i) {
668
+ if (iter->types[i]->str && (SWIG_TypeEquiv(iter->types[i]->str, name)))
669
+ return iter->types[i];
670
+ }
671
+ iter = iter->next;
672
+ } while (iter != end);
673
+ }
674
+
675
+ /* neither found a match */
676
+ return 0;
677
+ }
678
+
679
+ /*
680
+ Pack binary data into a string
681
+ */
682
+ SWIGRUNTIME char *
683
+ SWIG_PackData(char *c, void *ptr, size_t sz) {
684
+ static const char hex[17] = "0123456789abcdef";
685
+ const unsigned char *u = (unsigned char *) ptr;
686
+ const unsigned char *eu = u + sz;
687
+ for (; u != eu; ++u) {
688
+ unsigned char uu = *u;
689
+ *(c++) = hex[(uu & 0xf0) >> 4];
690
+ *(c++) = hex[uu & 0xf];
691
+ }
692
+ return c;
693
+ }
694
+
695
+ /*
696
+ Unpack binary data from a string
697
+ */
698
+ SWIGRUNTIME const char *
699
+ SWIG_UnpackData(const char *c, void *ptr, size_t sz) {
700
+ unsigned char *u = (unsigned char *) ptr;
701
+ const unsigned char *eu = u + sz;
702
+ for (; u != eu; ++u) {
703
+ char d = *(c++);
704
+ unsigned char uu;
705
+ if ((d >= '0') && (d <= '9'))
706
+ uu = (unsigned char)((d - '0') << 4);
707
+ else if ((d >= 'a') && (d <= 'f'))
708
+ uu = (unsigned char)((d - ('a'-10)) << 4);
709
+ else
710
+ return (char *) 0;
711
+ d = *(c++);
712
+ if ((d >= '0') && (d <= '9'))
713
+ uu |= (unsigned char)(d - '0');
714
+ else if ((d >= 'a') && (d <= 'f'))
715
+ uu |= (unsigned char)(d - ('a'-10));
716
+ else
717
+ return (char *) 0;
718
+ *u = uu;
719
+ }
720
+ return c;
721
+ }
722
+
723
+ /*
724
+ Pack 'void *' into a string buffer.
725
+ */
726
+ SWIGRUNTIME char *
727
+ SWIG_PackVoidPtr(char *buff, void *ptr, const char *name, size_t bsz) {
728
+ char *r = buff;
729
+ if ((2*sizeof(void *) + 2) > bsz) return 0;
730
+ *(r++) = '_';
731
+ r = SWIG_PackData(r,&ptr,sizeof(void *));
732
+ if (strlen(name) + 1 > (bsz - (r - buff))) return 0;
733
+ strcpy(r,name);
734
+ return buff;
735
+ }
736
+
737
+ SWIGRUNTIME const char *
738
+ SWIG_UnpackVoidPtr(const char *c, void **ptr, const char *name) {
739
+ if (*c != '_') {
740
+ if (strcmp(c,"NULL") == 0) {
741
+ *ptr = (void *) 0;
742
+ return name;
743
+ } else {
744
+ return 0;
745
+ }
746
+ }
747
+ return SWIG_UnpackData(++c,ptr,sizeof(void *));
748
+ }
749
+
750
+ SWIGRUNTIME char *
751
+ SWIG_PackDataName(char *buff, void *ptr, size_t sz, const char *name, size_t bsz) {
752
+ char *r = buff;
753
+ size_t lname = (name ? strlen(name) : 0);
754
+ if ((2*sz + 2 + lname) > bsz) return 0;
755
+ *(r++) = '_';
756
+ r = SWIG_PackData(r,ptr,sz);
757
+ if (lname) {
758
+ strncpy(r,name,lname+1);
759
+ } else {
760
+ *r = 0;
761
+ }
762
+ return buff;
763
+ }
764
+
765
+ SWIGRUNTIME const char *
766
+ SWIG_UnpackDataName(const char *c, void *ptr, size_t sz, const char *name) {
767
+ if (*c != '_') {
768
+ if (strcmp(c,"NULL") == 0) {
769
+ memset(ptr,0,sz);
770
+ return name;
771
+ } else {
772
+ return 0;
773
+ }
774
+ }
775
+ return SWIG_UnpackData(++c,ptr,sz);
776
+ }
777
+
778
+ #ifdef __cplusplus
779
+ }
780
+ #endif
781
+
782
+ /* SWIG Errors applicable to all language modules, values are reserved from -1 to -99 */
783
+ #define SWIG_UnknownError -1
784
+ #define SWIG_IOError -2
785
+ #define SWIG_RuntimeError -3
786
+ #define SWIG_IndexError -4
787
+ #define SWIG_TypeError -5
788
+ #define SWIG_DivisionByZero -6
789
+ #define SWIG_OverflowError -7
790
+ #define SWIG_SyntaxError -8
791
+ #define SWIG_ValueError -9
792
+ #define SWIG_SystemError -10
793
+ #define SWIG_AttributeError -11
794
+ #define SWIG_MemoryError -12
795
+ #define SWIG_NullReferenceError -13
796
+
797
+
798
+ /* Compatibility macros for Python 3 */
799
+ #if PY_VERSION_HEX >= 0x03000000
800
+
801
+ #define PyClass_Check(obj) PyObject_IsInstance(obj, (PyObject *)&PyType_Type)
802
+ #define PyInt_Check(x) PyLong_Check(x)
803
+ #define PyInt_AsLong(x) PyLong_AsLong(x)
804
+ #define PyInt_FromLong(x) PyLong_FromLong(x)
805
+ #define PyInt_FromSize_t(x) PyLong_FromSize_t(x)
806
+ #define PyString_Check(name) PyBytes_Check(name)
807
+ #define PyString_FromString(x) PyUnicode_FromString(x)
808
+ #define PyString_Format(fmt, args) PyUnicode_Format(fmt, args)
809
+ #define PyString_AsString(str) PyBytes_AsString(str)
810
+ #define PyString_Size(str) PyBytes_Size(str)
811
+ #define PyString_InternFromString(key) PyUnicode_InternFromString(key)
812
+ #define Py_TPFLAGS_HAVE_CLASS Py_TPFLAGS_BASETYPE
813
+ #define _PyLong_FromSsize_t(x) PyLong_FromSsize_t(x)
814
+
815
+ #endif
816
+
817
+ #ifndef Py_TYPE
818
+ # define Py_TYPE(op) ((op)->ob_type)
819
+ #endif
820
+
821
+ /* SWIG APIs for compatibility of both Python 2 & 3 */
822
+
823
+ #if PY_VERSION_HEX >= 0x03000000
824
+ # define SWIG_Python_str_FromFormat PyUnicode_FromFormat
825
+ #else
826
+ # define SWIG_Python_str_FromFormat PyString_FromFormat
827
+ #endif
828
+
829
+
830
+ /* Wrapper around PyUnicode_AsUTF8AndSize - call Py_XDECREF on the returned pbytes when finished with the returned string */
831
+ SWIGINTERN const char *
832
+ SWIG_PyUnicode_AsUTF8AndSize(PyObject *str, Py_ssize_t *psize, PyObject **pbytes)
833
+ {
834
+ #if PY_VERSION_HEX >= 0x03030000
835
+ # if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 >= 0x030A0000
836
+ *pbytes = NULL;
837
+ return PyUnicode_AsUTF8AndSize(str, psize);
838
+ # else
839
+ *pbytes = PyUnicode_AsUTF8String(str);
840
+ const char *chars = *pbytes ? PyBytes_AsString(*pbytes) : NULL;
841
+ if (chars && psize)
842
+ *psize = PyBytes_Size(*pbytes);
843
+ return chars;
844
+ # endif
845
+ #else
846
+ char *chars = NULL;
847
+ *pbytes = NULL;
848
+ PyString_AsStringAndSize(str, &chars, psize);
849
+ return chars;
850
+ #endif
851
+ }
852
+
853
+ SWIGINTERN PyObject*
854
+ SWIG_Python_str_FromChar(const char *c)
855
+ {
856
+ #if PY_VERSION_HEX >= 0x03000000
857
+ return PyUnicode_FromString(c);
858
+ #else
859
+ return PyString_FromString(c);
860
+ #endif
861
+ }
862
+
863
+ #ifndef PyObject_DEL
864
+ # define PyObject_DEL PyObject_Del
865
+ #endif
866
+
867
+ /* SWIGPY_USE_CAPSULE is no longer used within SWIG itself, but some user interface files check for it. */
868
+ # define SWIGPY_USE_CAPSULE
869
+ #ifdef SWIGPYTHON_BUILTIN
870
+ # define SWIGPY_CAPSULE_ATTR_NAME "type_pointer_capsule_builtin" SWIG_TYPE_TABLE_NAME
871
+ #else
872
+ # define SWIGPY_CAPSULE_ATTR_NAME "type_pointer_capsule" SWIG_TYPE_TABLE_NAME
873
+ #endif
874
+ # define SWIGPY_CAPSULE_NAME ("swig_runtime_data" SWIG_RUNTIME_VERSION "." SWIGPY_CAPSULE_ATTR_NAME)
875
+
876
+ #if PY_VERSION_HEX < 0x03020000
877
+ #define PyDescr_TYPE(x) (((PyDescrObject *)(x))->d_type)
878
+ #define PyDescr_NAME(x) (((PyDescrObject *)(x))->d_name)
879
+ #define Py_hash_t long
880
+ #endif
881
+
882
+ #ifdef Py_LIMITED_API
883
+ # define PyTuple_GET_ITEM PyTuple_GetItem
884
+ /* Note that PyTuple_SetItem() has different semantics from PyTuple_SET_ITEM as it decref's the original tuple item, so in general they cannot be used
885
+ interchangeably. However in SWIG-generated code PyTuple_SET_ITEM is only used with newly initialized tuples without any items and for them this does work. */
886
+ # define PyTuple_SET_ITEM PyTuple_SetItem
887
+ # define PyTuple_GET_SIZE PyTuple_Size
888
+ # define PyCFunction_GET_FLAGS PyCFunction_GetFlags
889
+ # define PyCFunction_GET_FUNCTION PyCFunction_GetFunction
890
+ # define PyCFunction_GET_SELF PyCFunction_GetSelf
891
+ # define PyList_GET_ITEM PyList_GetItem
892
+ # define PyList_SET_ITEM PyList_SetItem
893
+ # define PySliceObject PyObject
894
+ #endif
895
+
896
+ /* -----------------------------------------------------------------------------
897
+ * error manipulation
898
+ * ----------------------------------------------------------------------------- */
899
+
900
+ SWIGRUNTIME PyObject*
901
+ SWIG_Python_ErrorType(int code) {
902
+ PyObject* type = 0;
903
+ switch(code) {
904
+ case SWIG_MemoryError:
905
+ type = PyExc_MemoryError;
906
+ break;
907
+ case SWIG_IOError:
908
+ type = PyExc_IOError;
909
+ break;
910
+ case SWIG_RuntimeError:
911
+ type = PyExc_RuntimeError;
912
+ break;
913
+ case SWIG_IndexError:
914
+ type = PyExc_IndexError;
915
+ break;
916
+ case SWIG_TypeError:
917
+ type = PyExc_TypeError;
918
+ break;
919
+ case SWIG_DivisionByZero:
920
+ type = PyExc_ZeroDivisionError;
921
+ break;
922
+ case SWIG_OverflowError:
923
+ type = PyExc_OverflowError;
924
+ break;
925
+ case SWIG_SyntaxError:
926
+ type = PyExc_SyntaxError;
927
+ break;
928
+ case SWIG_ValueError:
929
+ type = PyExc_ValueError;
930
+ break;
931
+ case SWIG_SystemError:
932
+ type = PyExc_SystemError;
933
+ break;
934
+ case SWIG_AttributeError:
935
+ type = PyExc_AttributeError;
936
+ break;
937
+ default:
938
+ type = PyExc_RuntimeError;
939
+ }
940
+ return type;
941
+ }
942
+
943
+
944
+ SWIGRUNTIME void
945
+ SWIG_Python_AddErrorMsg(const char* mesg)
946
+ {
947
+ PyObject *type = 0;
948
+ PyObject *value = 0;
949
+ PyObject *traceback = 0;
950
+
951
+ if (PyErr_Occurred())
952
+ PyErr_Fetch(&type, &value, &traceback);
953
+ if (value) {
954
+ PyObject *old_str = PyObject_Str(value);
955
+ PyObject *bytes = NULL;
956
+ const char *tmp = SWIG_PyUnicode_AsUTF8AndSize(old_str, NULL, &bytes);
957
+ PyErr_Clear();
958
+ Py_XINCREF(type);
959
+ if (tmp)
960
+ PyErr_Format(type, "%s %s", tmp, mesg);
961
+ else
962
+ PyErr_Format(type, "%s", mesg);
963
+ Py_XDECREF(bytes);
964
+ Py_DECREF(old_str);
965
+ Py_DECREF(value);
966
+ } else {
967
+ PyErr_SetString(PyExc_RuntimeError, mesg);
968
+ }
969
+ }
970
+
971
+ SWIGRUNTIME int
972
+ SWIG_Python_TypeErrorOccurred(PyObject *obj)
973
+ {
974
+ PyObject *error;
975
+ if (obj)
976
+ return 0;
977
+ error = PyErr_Occurred();
978
+ return error && PyErr_GivenExceptionMatches(error, PyExc_TypeError);
979
+ }
980
+
981
+ SWIGRUNTIME void
982
+ SWIG_Python_RaiseOrModifyTypeError(const char *message)
983
+ {
984
+ if (SWIG_Python_TypeErrorOccurred(NULL)) {
985
+ /* Use existing TypeError to preserve stacktrace and enhance with given message */
986
+ PyObject *newvalue;
987
+ PyObject *type = NULL, *value = NULL, *traceback = NULL;
988
+ PyErr_Fetch(&type, &value, &traceback);
989
+ #if PY_VERSION_HEX >= 0x03000000
990
+ newvalue = PyUnicode_FromFormat("%S\nAdditional information:\n%s", value, message);
991
+ #else
992
+ newvalue = PyString_FromFormat("%s\nAdditional information:\n%s", PyString_AsString(value), message);
993
+ #endif
994
+ if (newvalue) {
995
+ Py_XDECREF(value);
996
+ PyErr_Restore(type, newvalue, traceback);
997
+ } else {
998
+ PyErr_Restore(type, value, traceback);
999
+ }
1000
+ } else {
1001
+ /* Raise TypeError using given message */
1002
+ PyErr_SetString(PyExc_TypeError, message);
1003
+ }
1004
+ }
1005
+
1006
+ #if defined(SWIG_PYTHON_NO_THREADS)
1007
+ # if defined(SWIG_PYTHON_THREADS)
1008
+ # undef SWIG_PYTHON_THREADS
1009
+ # endif
1010
+ #endif
1011
+ #if defined(SWIG_PYTHON_THREADS) /* Threading support is enabled */
1012
+ # if !defined(SWIG_PYTHON_USE_GIL) && !defined(SWIG_PYTHON_NO_USE_GIL)
1013
+ # define SWIG_PYTHON_USE_GIL
1014
+ # endif
1015
+ # if defined(SWIG_PYTHON_USE_GIL) /* Use PyGILState threads calls */
1016
+ # if !defined(SWIG_PYTHON_INITIALIZE_THREADS)
1017
+ # if PY_VERSION_HEX < 0x03070000
1018
+ # define SWIG_PYTHON_INITIALIZE_THREADS PyEval_InitThreads()
1019
+ # else
1020
+ # define SWIG_PYTHON_INITIALIZE_THREADS
1021
+ # endif
1022
+ # endif
1023
+ # ifdef __cplusplus /* C++ code */
1024
+ class SWIG_Python_Thread_Block {
1025
+ bool status;
1026
+ PyGILState_STATE state;
1027
+ public:
1028
+ void end() { if (status) { PyGILState_Release(state); status = false;} }
1029
+ SWIG_Python_Thread_Block() : status(true), state(PyGILState_Ensure()) {}
1030
+ ~SWIG_Python_Thread_Block() { end(); }
1031
+ };
1032
+ class SWIG_Python_Thread_Allow {
1033
+ bool status;
1034
+ PyThreadState *save;
1035
+ public:
1036
+ void end() { if (status) { status = false; PyEval_RestoreThread(save); }}
1037
+ SWIG_Python_Thread_Allow() : status(true), save(PyEval_SaveThread()) {}
1038
+ ~SWIG_Python_Thread_Allow() { end(); }
1039
+ };
1040
+ # define SWIG_PYTHON_THREAD_BEGIN_BLOCK SWIG_Python_Thread_Block _swig_thread_block
1041
+ # define SWIG_PYTHON_THREAD_END_BLOCK _swig_thread_block.end()
1042
+ # define SWIG_PYTHON_THREAD_BEGIN_ALLOW SWIG_Python_Thread_Allow _swig_thread_allow
1043
+ # define SWIG_PYTHON_THREAD_END_ALLOW _swig_thread_allow.end()
1044
+ # else /* C code */
1045
+ # define SWIG_PYTHON_THREAD_BEGIN_BLOCK PyGILState_STATE _swig_thread_block = PyGILState_Ensure()
1046
+ # define SWIG_PYTHON_THREAD_END_BLOCK PyGILState_Release(_swig_thread_block)
1047
+ # define SWIG_PYTHON_THREAD_BEGIN_ALLOW PyThreadState *_swig_thread_allow = PyEval_SaveThread()
1048
+ # define SWIG_PYTHON_THREAD_END_ALLOW PyEval_RestoreThread(_swig_thread_allow)
1049
+ # endif
1050
+ # else /* Old thread way, not implemented, user must provide it */
1051
+ # if !defined(SWIG_PYTHON_INITIALIZE_THREADS)
1052
+ # define SWIG_PYTHON_INITIALIZE_THREADS
1053
+ # endif
1054
+ # if !defined(SWIG_PYTHON_THREAD_BEGIN_BLOCK)
1055
+ # define SWIG_PYTHON_THREAD_BEGIN_BLOCK
1056
+ # endif
1057
+ # if !defined(SWIG_PYTHON_THREAD_END_BLOCK)
1058
+ # define SWIG_PYTHON_THREAD_END_BLOCK
1059
+ # endif
1060
+ # if !defined(SWIG_PYTHON_THREAD_BEGIN_ALLOW)
1061
+ # define SWIG_PYTHON_THREAD_BEGIN_ALLOW
1062
+ # endif
1063
+ # if !defined(SWIG_PYTHON_THREAD_END_ALLOW)
1064
+ # define SWIG_PYTHON_THREAD_END_ALLOW
1065
+ # endif
1066
+ # endif
1067
+ #else /* No thread support */
1068
+ # define SWIG_PYTHON_INITIALIZE_THREADS
1069
+ # define SWIG_PYTHON_THREAD_BEGIN_BLOCK
1070
+ # define SWIG_PYTHON_THREAD_END_BLOCK
1071
+ # define SWIG_PYTHON_THREAD_BEGIN_ALLOW
1072
+ # define SWIG_PYTHON_THREAD_END_ALLOW
1073
+ #endif
1074
+
1075
+ /* -----------------------------------------------------------------------------
1076
+ * Python API portion that goes into the runtime
1077
+ * ----------------------------------------------------------------------------- */
1078
+
1079
+ #ifdef __cplusplus
1080
+ extern "C" {
1081
+ #endif
1082
+
1083
+ /* -----------------------------------------------------------------------------
1084
+ * Constant declarations
1085
+ * ----------------------------------------------------------------------------- */
1086
+
1087
+ /* Constant Types */
1088
+ #define SWIG_PY_POINTER 4
1089
+ #define SWIG_PY_BINARY 5
1090
+
1091
+ /* Constant information structure */
1092
+ typedef struct swig_const_info {
1093
+ int type;
1094
+ const char *name;
1095
+ long lvalue;
1096
+ double dvalue;
1097
+ void *pvalue;
1098
+ swig_type_info **ptype;
1099
+ } swig_const_info;
1100
+
1101
+ #ifdef __cplusplus
1102
+ }
1103
+ #endif
1104
+
1105
+
1106
+ /* -----------------------------------------------------------------------------
1107
+ * pyrun.swg
1108
+ *
1109
+ * This file contains the runtime support for Python modules
1110
+ * and includes code for managing global variables and pointer
1111
+ * type checking.
1112
+ *
1113
+ * ----------------------------------------------------------------------------- */
1114
+
1115
+ #if PY_VERSION_HEX < 0x02070000 /* 2.7.0 */
1116
+ # error "This version of SWIG only supports Python >= 2.7"
1117
+ #endif
1118
+
1119
+ #if PY_VERSION_HEX >= 0x03000000 && PY_VERSION_HEX < 0x03030000
1120
+ # error "This version of SWIG only supports Python 3 >= 3.3"
1121
+ #endif
1122
+
1123
+ /* Common SWIG API */
1124
+
1125
+ /* for raw pointers */
1126
+ #define SWIG_Python_ConvertPtr(obj, pptr, type, flags) SWIG_Python_ConvertPtrAndOwn(obj, pptr, type, flags, 0)
1127
+ #define SWIG_ConvertPtr(obj, pptr, type, flags) SWIG_Python_ConvertPtr(obj, pptr, type, flags)
1128
+ #define SWIG_ConvertPtrAndOwn(obj,pptr,type,flags,own) SWIG_Python_ConvertPtrAndOwn(obj, pptr, type, flags, own)
1129
+
1130
+ #ifdef SWIGPYTHON_BUILTIN
1131
+ #define SWIG_NewPointerObj(ptr, type, flags) SWIG_Python_NewPointerObj(self, ptr, type, flags)
1132
+ #else
1133
+ #define SWIG_NewPointerObj(ptr, type, flags) SWIG_Python_NewPointerObj(NULL, ptr, type, flags)
1134
+ #endif
1135
+
1136
+ #define SWIG_InternalNewPointerObj(ptr, type, flags) SWIG_Python_NewPointerObj(NULL, ptr, type, flags)
1137
+
1138
+ #define SWIG_CheckImplicit(ty) SWIG_Python_CheckImplicit(ty)
1139
+ #define SWIG_AcquirePtr(ptr, src) SWIG_Python_AcquirePtr(ptr, src)
1140
+ #define swig_owntype int
1141
+
1142
+ /* for raw packed data */
1143
+ #define SWIG_ConvertPacked(obj, ptr, sz, ty) SWIG_Python_ConvertPacked(obj, ptr, sz, ty)
1144
+ #define SWIG_NewPackedObj(ptr, sz, type) SWIG_Python_NewPackedObj(ptr, sz, type)
1145
+
1146
+ /* for class or struct pointers */
1147
+ #define SWIG_ConvertInstance(obj, pptr, type, flags) SWIG_ConvertPtr(obj, pptr, type, flags)
1148
+ #define SWIG_NewInstanceObj(ptr, type, flags) SWIG_NewPointerObj(ptr, type, flags)
1149
+
1150
+ /* for C or C++ function pointers */
1151
+ #define SWIG_ConvertFunctionPtr(obj, pptr, type) SWIG_Python_ConvertFunctionPtr(obj, pptr, type)
1152
+ #define SWIG_NewFunctionPtrObj(ptr, type) SWIG_Python_NewPointerObj(NULL, ptr, type, 0)
1153
+
1154
+ /* for C++ member pointers, ie, member methods */
1155
+ #define SWIG_ConvertMember(obj, ptr, sz, ty) SWIG_Python_ConvertPacked(obj, ptr, sz, ty)
1156
+ #define SWIG_NewMemberObj(ptr, sz, type) SWIG_Python_NewPackedObj(ptr, sz, type)
1157
+
1158
+
1159
+ /* Runtime API */
1160
+
1161
+ #define SWIG_GetModule(clientdata) SWIG_Python_GetModule(clientdata)
1162
+ #define SWIG_SetModule(clientdata, pointer) SWIG_Python_SetModule(pointer)
1163
+ #define SWIG_NewClientData(obj) SwigPyClientData_New(obj)
1164
+
1165
+ #define SWIG_SetErrorObj SWIG_Python_SetErrorObj
1166
+ #define SWIG_SetErrorMsg SWIG_Python_SetErrorMsg
1167
+ #define SWIG_ErrorType(code) SWIG_Python_ErrorType(code)
1168
+ #define SWIG_Error(code, msg) SWIG_Python_SetErrorMsg(SWIG_ErrorType(code), msg)
1169
+ #define SWIG_fail goto fail
1170
+
1171
+
1172
+ /* Runtime API implementation */
1173
+
1174
+ /* Error manipulation */
1175
+
1176
+ SWIGINTERN void
1177
+ SWIG_Python_SetErrorObj(PyObject *errtype, PyObject *obj) {
1178
+ SWIG_PYTHON_THREAD_BEGIN_BLOCK;
1179
+ PyErr_SetObject(errtype, obj);
1180
+ Py_DECREF(obj);
1181
+ SWIG_PYTHON_THREAD_END_BLOCK;
1182
+ }
1183
+
1184
+ SWIGINTERN void
1185
+ SWIG_Python_SetErrorMsg(PyObject *errtype, const char *msg) {
1186
+ SWIG_PYTHON_THREAD_BEGIN_BLOCK;
1187
+ PyErr_SetString(errtype, msg);
1188
+ SWIG_PYTHON_THREAD_END_BLOCK;
1189
+ }
1190
+
1191
+ #define SWIG_Python_Raise(obj, type, desc) SWIG_Python_SetErrorObj(SWIG_Python_ExceptionType(desc), obj)
1192
+
1193
+ /* Set a constant value */
1194
+
1195
+ #if defined(SWIGPYTHON_BUILTIN)
1196
+
1197
+ SWIGINTERN void
1198
+ SwigPyBuiltin_AddPublicSymbol(PyObject *seq, const char *key) {
1199
+ PyObject *s = PyString_InternFromString(key);
1200
+ PyList_Append(seq, s);
1201
+ Py_DECREF(s);
1202
+ }
1203
+
1204
+ SWIGINTERN void
1205
+ SWIG_Python_SetConstant(PyObject *d, PyObject *public_interface, const char *name, PyObject *obj) {
1206
+ PyDict_SetItemString(d, name, obj);
1207
+ Py_DECREF(obj);
1208
+ if (public_interface)
1209
+ SwigPyBuiltin_AddPublicSymbol(public_interface, name);
1210
+ }
1211
+
1212
+ #else
1213
+
1214
+ SWIGINTERN void
1215
+ SWIG_Python_SetConstant(PyObject *d, const char *name, PyObject *obj) {
1216
+ PyDict_SetItemString(d, name, obj);
1217
+ Py_DECREF(obj);
1218
+ }
1219
+
1220
+ #endif
1221
+
1222
+ /* Append a value to the result obj */
1223
+
1224
+ SWIGINTERN PyObject*
1225
+ SWIG_Python_AppendOutput(PyObject* result, PyObject* obj) {
1226
+ if (!result) {
1227
+ result = obj;
1228
+ } else if (result == Py_None) {
1229
+ Py_DECREF(result);
1230
+ result = obj;
1231
+ } else {
1232
+ if (!PyList_Check(result)) {
1233
+ PyObject *o2 = result;
1234
+ result = PyList_New(1);
1235
+ if (result) {
1236
+ PyList_SET_ITEM(result, 0, o2);
1237
+ } else {
1238
+ Py_DECREF(obj);
1239
+ return o2;
1240
+ }
1241
+ }
1242
+ PyList_Append(result,obj);
1243
+ Py_DECREF(obj);
1244
+ }
1245
+ return result;
1246
+ }
1247
+
1248
+ /* Unpack the argument tuple */
1249
+
1250
+ SWIGINTERN Py_ssize_t
1251
+ SWIG_Python_UnpackTuple(PyObject *args, const char *name, Py_ssize_t min, Py_ssize_t max, PyObject **objs)
1252
+ {
1253
+ if (!args) {
1254
+ if (!min && !max) {
1255
+ return 1;
1256
+ } else {
1257
+ PyErr_Format(PyExc_TypeError, "%s expected %s%d arguments, got none",
1258
+ name, (min == max ? "" : "at least "), (int)min);
1259
+ return 0;
1260
+ }
1261
+ }
1262
+ if (!PyTuple_Check(args)) {
1263
+ if (min <= 1 && max >= 1) {
1264
+ Py_ssize_t i;
1265
+ objs[0] = args;
1266
+ for (i = 1; i < max; ++i) {
1267
+ objs[i] = 0;
1268
+ }
1269
+ return 2;
1270
+ }
1271
+ PyErr_SetString(PyExc_SystemError, "UnpackTuple() argument list is not a tuple");
1272
+ return 0;
1273
+ } else {
1274
+ Py_ssize_t l = PyTuple_GET_SIZE(args);
1275
+ if (l < min) {
1276
+ PyErr_Format(PyExc_TypeError, "%s expected %s%d arguments, got %d",
1277
+ name, (min == max ? "" : "at least "), (int)min, (int)l);
1278
+ return 0;
1279
+ } else if (l > max) {
1280
+ PyErr_Format(PyExc_TypeError, "%s expected %s%d arguments, got %d",
1281
+ name, (min == max ? "" : "at most "), (int)max, (int)l);
1282
+ return 0;
1283
+ } else {
1284
+ Py_ssize_t i;
1285
+ for (i = 0; i < l; ++i) {
1286
+ objs[i] = PyTuple_GET_ITEM(args, i);
1287
+ }
1288
+ for (; l < max; ++l) {
1289
+ objs[l] = 0;
1290
+ }
1291
+ return i + 1;
1292
+ }
1293
+ }
1294
+ }
1295
+
1296
+ SWIGINTERN int
1297
+ SWIG_Python_CheckNoKeywords(PyObject *kwargs, const char *name) {
1298
+ int no_kwargs = 1;
1299
+ if (kwargs) {
1300
+ assert(PyDict_Check(kwargs));
1301
+ if (PyDict_Size(kwargs) > 0) {
1302
+ PyErr_Format(PyExc_TypeError, "%s() does not take keyword arguments", name);
1303
+ no_kwargs = 0;
1304
+ }
1305
+ }
1306
+ return no_kwargs;
1307
+ }
1308
+
1309
+ /* A functor is a function object with one single object argument */
1310
+ #define SWIG_Python_CallFunctor(functor, obj) PyObject_CallFunctionObjArgs(functor, obj, NULL);
1311
+
1312
+ /*
1313
+ Helper for static pointer initialization for both C and C++ code, for example
1314
+ static PyObject *SWIG_STATIC_POINTER(MyVar) = NewSomething(...);
1315
+ */
1316
+ #ifdef __cplusplus
1317
+ #define SWIG_STATIC_POINTER(var) var
1318
+ #else
1319
+ #define SWIG_STATIC_POINTER(var) var = 0; if (!var) var
1320
+ #endif
1321
+
1322
+ #ifdef __cplusplus
1323
+ extern "C" {
1324
+ #endif
1325
+
1326
+ /* Python-specific SWIG API */
1327
+ #define SWIG_newvarlink() SWIG_Python_newvarlink()
1328
+ #define SWIG_addvarlink(p, name, get_attr, set_attr) SWIG_Python_addvarlink(p, name, get_attr, set_attr)
1329
+ #define SWIG_InstallConstants(d, constants) SWIG_Python_InstallConstants(d, constants)
1330
+
1331
+ /* -----------------------------------------------------------------------------
1332
+ * global variable support code.
1333
+ * ----------------------------------------------------------------------------- */
1334
+
1335
+ typedef struct swig_globalvar {
1336
+ char *name; /* Name of global variable */
1337
+ PyObject *(*get_attr)(void); /* Return the current value */
1338
+ int (*set_attr)(PyObject *); /* Set the value */
1339
+ struct swig_globalvar *next;
1340
+ } swig_globalvar;
1341
+
1342
+ typedef struct swig_varlinkobject {
1343
+ PyObject_HEAD
1344
+ swig_globalvar *vars;
1345
+ } swig_varlinkobject;
1346
+
1347
+ SWIGINTERN PyObject *
1348
+ swig_varlink_repr(PyObject *SWIGUNUSEDPARM(v)) {
1349
+ #if PY_VERSION_HEX >= 0x03000000
1350
+ return PyUnicode_InternFromString("<Swig global variables>");
1351
+ #else
1352
+ return PyString_FromString("<Swig global variables>");
1353
+ #endif
1354
+ }
1355
+
1356
+ SWIGINTERN PyObject *
1357
+ swig_varlink_str(PyObject *o) {
1358
+ swig_varlinkobject *v = (swig_varlinkobject *) o;
1359
+ #if PY_VERSION_HEX >= 0x03000000
1360
+ PyObject *str = PyUnicode_InternFromString("(");
1361
+ PyObject *tail;
1362
+ PyObject *joined;
1363
+ swig_globalvar *var;
1364
+ for (var = v->vars; var; var=var->next) {
1365
+ tail = PyUnicode_FromString(var->name);
1366
+ joined = PyUnicode_Concat(str, tail);
1367
+ Py_DecRef(str);
1368
+ Py_DecRef(tail);
1369
+ str = joined;
1370
+ if (var->next) {
1371
+ tail = PyUnicode_InternFromString(", ");
1372
+ joined = PyUnicode_Concat(str, tail);
1373
+ Py_DecRef(str);
1374
+ Py_DecRef(tail);
1375
+ str = joined;
1376
+ }
1377
+ }
1378
+ tail = PyUnicode_InternFromString(")");
1379
+ joined = PyUnicode_Concat(str, tail);
1380
+ Py_DecRef(str);
1381
+ Py_DecRef(tail);
1382
+ str = joined;
1383
+ #else
1384
+ PyObject *str = PyString_FromString("(");
1385
+ swig_globalvar *var;
1386
+ for (var = v->vars; var; var=var->next) {
1387
+ PyString_ConcatAndDel(&str,PyString_FromString(var->name));
1388
+ if (var->next) PyString_ConcatAndDel(&str,PyString_FromString(", "));
1389
+ }
1390
+ PyString_ConcatAndDel(&str,PyString_FromString(")"));
1391
+ #endif
1392
+ return str;
1393
+ }
1394
+
1395
+ SWIGINTERN void
1396
+ swig_varlink_dealloc(PyObject *o) {
1397
+ swig_varlinkobject *v = (swig_varlinkobject *) o;
1398
+ swig_globalvar *var = v->vars;
1399
+ while (var) {
1400
+ swig_globalvar *n = var->next;
1401
+ free(var->name);
1402
+ free(var);
1403
+ var = n;
1404
+ }
1405
+ }
1406
+
1407
+ SWIGINTERN PyObject *
1408
+ swig_varlink_getattr(PyObject *o, char *n) {
1409
+ swig_varlinkobject *v = (swig_varlinkobject *) o;
1410
+ PyObject *res = NULL;
1411
+ swig_globalvar *var = v->vars;
1412
+ while (var) {
1413
+ if (strcmp(var->name,n) == 0) {
1414
+ res = (*var->get_attr)();
1415
+ break;
1416
+ }
1417
+ var = var->next;
1418
+ }
1419
+ if (res == NULL && !PyErr_Occurred()) {
1420
+ PyErr_Format(PyExc_AttributeError, "Unknown C global variable '%s'", n);
1421
+ }
1422
+ return res;
1423
+ }
1424
+
1425
+ SWIGINTERN int
1426
+ swig_varlink_setattr(PyObject *o, char *n, PyObject *p) {
1427
+ swig_varlinkobject *v = (swig_varlinkobject *) o;
1428
+ int res = 1;
1429
+ swig_globalvar *var = v->vars;
1430
+ while (var) {
1431
+ if (strcmp(var->name,n) == 0) {
1432
+ res = (*var->set_attr)(p);
1433
+ break;
1434
+ }
1435
+ var = var->next;
1436
+ }
1437
+ if (res == 1 && !PyErr_Occurred()) {
1438
+ PyErr_Format(PyExc_AttributeError, "Unknown C global variable '%s'", n);
1439
+ }
1440
+ return res;
1441
+ }
1442
+
1443
+ SWIGINTERN PyTypeObject*
1444
+ swig_varlink_type(void) {
1445
+ static char varlink__doc__[] = "Swig var link object";
1446
+ #ifndef Py_LIMITED_API
1447
+ static PyTypeObject varlink_type;
1448
+ static int type_init = 0;
1449
+ if (!type_init) {
1450
+ const PyTypeObject tmp = {
1451
+ #if PY_VERSION_HEX >= 0x03000000
1452
+ PyVarObject_HEAD_INIT(NULL, 0)
1453
+ #else
1454
+ PyObject_HEAD_INIT(NULL)
1455
+ 0, /* ob_size */
1456
+ #endif
1457
+ "swigvarlink", /* tp_name */
1458
+ sizeof(swig_varlinkobject), /* tp_basicsize */
1459
+ 0, /* tp_itemsize */
1460
+ (destructor) swig_varlink_dealloc, /* tp_dealloc */
1461
+ #if PY_VERSION_HEX < 0x030800b4
1462
+ (printfunc)0, /*tp_print*/
1463
+ #else
1464
+ (Py_ssize_t)0, /*tp_vectorcall_offset*/
1465
+ #endif
1466
+ (getattrfunc) swig_varlink_getattr, /* tp_getattr */
1467
+ (setattrfunc) swig_varlink_setattr, /* tp_setattr */
1468
+ 0, /* tp_compare */
1469
+ (reprfunc) swig_varlink_repr, /* tp_repr */
1470
+ 0, /* tp_as_number */
1471
+ 0, /* tp_as_sequence */
1472
+ 0, /* tp_as_mapping */
1473
+ 0, /* tp_hash */
1474
+ 0, /* tp_call */
1475
+ (reprfunc) swig_varlink_str, /* tp_str */
1476
+ 0, /* tp_getattro */
1477
+ 0, /* tp_setattro */
1478
+ 0, /* tp_as_buffer */
1479
+ 0, /* tp_flags */
1480
+ varlink__doc__, /* tp_doc */
1481
+ 0, /* tp_traverse */
1482
+ 0, /* tp_clear */
1483
+ 0, /* tp_richcompare */
1484
+ 0, /* tp_weaklistoffset */
1485
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* tp_iter -> tp_weaklist */
1486
+ 0, /* tp_del */
1487
+ 0, /* tp_version_tag */
1488
+ #if PY_VERSION_HEX >= 0x03040000
1489
+ 0, /* tp_finalize */
1490
+ #endif
1491
+ #if PY_VERSION_HEX >= 0x03080000
1492
+ 0, /* tp_vectorcall */
1493
+ #endif
1494
+ #if (PY_VERSION_HEX >= 0x03080000) && (PY_VERSION_HEX < 0x03090000)
1495
+ 0, /* tp_print */
1496
+ #endif
1497
+ #if PY_VERSION_HEX >= 0x030C0000
1498
+ 0, /* tp_watched */
1499
+ #endif
1500
+ #ifdef COUNT_ALLOCS
1501
+ 0, /* tp_allocs */
1502
+ 0, /* tp_frees */
1503
+ 0, /* tp_maxalloc */
1504
+ 0, /* tp_prev */
1505
+ 0 /* tp_next */
1506
+ #endif
1507
+ };
1508
+ varlink_type = tmp;
1509
+ type_init = 1;
1510
+ if (PyType_Ready(&varlink_type) < 0)
1511
+ return NULL;
1512
+ }
1513
+ return &varlink_type;
1514
+ #else
1515
+ PyType_Slot slots[] = {
1516
+ { Py_tp_dealloc, (void *)swig_varlink_dealloc },
1517
+ { Py_tp_repr, (void *)swig_varlink_repr },
1518
+ { Py_tp_getattr, (void *)swig_varlink_getattr },
1519
+ { Py_tp_setattr, (void *)swig_varlink_setattr },
1520
+ { Py_tp_str, (void *)swig_varlink_str },
1521
+ { Py_tp_doc, (void *)varlink__doc__ },
1522
+ { 0, NULL }
1523
+ };
1524
+ PyType_Spec spec = {
1525
+ "swigvarlink",
1526
+ sizeof(swig_varlinkobject),
1527
+ 0,
1528
+ Py_TPFLAGS_DEFAULT,
1529
+ slots
1530
+ };
1531
+ return (PyTypeObject *)PyType_FromSpec(&spec);
1532
+ #endif
1533
+ }
1534
+
1535
+ /* Create a variable linking object for use later */
1536
+ SWIGINTERN PyObject *
1537
+ SWIG_Python_newvarlink(void) {
1538
+ swig_varlinkobject *result = PyObject_New(swig_varlinkobject, swig_varlink_type());
1539
+ if (result) {
1540
+ result->vars = 0;
1541
+ }
1542
+ return ((PyObject*) result);
1543
+ }
1544
+
1545
+ SWIGINTERN void
1546
+ SWIG_Python_addvarlink(PyObject *p, const char *name, PyObject *(*get_attr)(void), int (*set_attr)(PyObject *p)) {
1547
+ swig_varlinkobject *v = (swig_varlinkobject *) p;
1548
+ swig_globalvar *gv = (swig_globalvar *) malloc(sizeof(swig_globalvar));
1549
+ if (gv) {
1550
+ size_t size = strlen(name)+1;
1551
+ gv->name = (char *)malloc(size);
1552
+ if (gv->name) {
1553
+ memcpy(gv->name, name, size);
1554
+ gv->get_attr = get_attr;
1555
+ gv->set_attr = set_attr;
1556
+ gv->next = v->vars;
1557
+ }
1558
+ }
1559
+ v->vars = gv;
1560
+ }
1561
+
1562
+
1563
+ static PyObject *Swig_Globals_global = NULL;
1564
+
1565
+ SWIGINTERN PyObject *
1566
+ SWIG_globals(void) {
1567
+ if (Swig_Globals_global == NULL) {
1568
+ Swig_Globals_global = SWIG_newvarlink();
1569
+ }
1570
+ return Swig_Globals_global;
1571
+ }
1572
+
1573
+ #ifdef __cplusplus
1574
+ }
1575
+ #endif
1576
+
1577
+ /* -----------------------------------------------------------------------------
1578
+ * Pointer declarations
1579
+ * ----------------------------------------------------------------------------- */
1580
+
1581
+ /* Flags for new pointer objects */
1582
+ #define SWIG_POINTER_NOSHADOW (SWIG_POINTER_OWN << 1)
1583
+ #define SWIG_POINTER_NEW (SWIG_POINTER_NOSHADOW | SWIG_POINTER_OWN)
1584
+
1585
+ #define SWIG_POINTER_IMPLICIT_CONV (SWIG_POINTER_DISOWN << 1)
1586
+
1587
+ #define SWIG_BUILTIN_TP_INIT (SWIG_POINTER_OWN << 2)
1588
+ #define SWIG_BUILTIN_INIT (SWIG_BUILTIN_TP_INIT | SWIG_POINTER_OWN)
1589
+
1590
+ #ifdef __cplusplus
1591
+ extern "C" {
1592
+ #endif
1593
+
1594
+ /* The python void return value */
1595
+
1596
+ SWIGRUNTIMEINLINE PyObject *
1597
+ SWIG_Py_Void(void)
1598
+ {
1599
+ PyObject *none = Py_None;
1600
+ Py_INCREF(none);
1601
+ return none;
1602
+ }
1603
+
1604
+ /* SwigPyClientData */
1605
+
1606
+ typedef struct {
1607
+ PyObject *klass;
1608
+ PyObject *newraw;
1609
+ PyObject *newargs;
1610
+ PyObject *destroy;
1611
+ int delargs;
1612
+ int implicitconv;
1613
+ PyTypeObject *pytype;
1614
+ } SwigPyClientData;
1615
+
1616
+ SWIGRUNTIMEINLINE int
1617
+ SWIG_Python_CheckImplicit(swig_type_info *ty)
1618
+ {
1619
+ SwigPyClientData *data = (SwigPyClientData *)ty->clientdata;
1620
+ int fail = data ? data->implicitconv : 0;
1621
+ if (fail)
1622
+ PyErr_SetString(PyExc_TypeError, "Implicit conversion is prohibited for explicit constructors.");
1623
+ return fail;
1624
+ }
1625
+
1626
+ SWIGRUNTIMEINLINE PyObject *
1627
+ SWIG_Python_ExceptionType(swig_type_info *desc) {
1628
+ SwigPyClientData *data = desc ? (SwigPyClientData *) desc->clientdata : 0;
1629
+ PyObject *klass = data ? data->klass : 0;
1630
+ return (klass ? klass : PyExc_RuntimeError);
1631
+ }
1632
+
1633
+
1634
+ SWIGRUNTIME SwigPyClientData *
1635
+ SwigPyClientData_New(PyObject* obj)
1636
+ {
1637
+ if (!obj) {
1638
+ return 0;
1639
+ } else {
1640
+ SwigPyClientData *data = (SwigPyClientData *)malloc(sizeof(SwigPyClientData));
1641
+ /* the klass element */
1642
+ data->klass = obj;
1643
+ Py_INCREF(data->klass);
1644
+ /* the newraw method and newargs arguments used to create a new raw instance */
1645
+ if (PyClass_Check(obj)) {
1646
+ data->newraw = 0;
1647
+ Py_INCREF(obj);
1648
+ data->newargs = obj;
1649
+ } else {
1650
+ data->newraw = PyObject_GetAttrString(data->klass, "__new__");
1651
+ if (data->newraw) {
1652
+ data->newargs = PyTuple_New(1);
1653
+ if (data->newargs) {
1654
+ Py_INCREF(obj);
1655
+ PyTuple_SET_ITEM(data->newargs, 0, obj);
1656
+ } else {
1657
+ Py_DECREF(data->newraw);
1658
+ Py_DECREF(data->klass);
1659
+ free(data);
1660
+ return 0;
1661
+ }
1662
+ } else {
1663
+ Py_INCREF(obj);
1664
+ data->newargs = obj;
1665
+ }
1666
+ }
1667
+ /* the destroy method, aka as the C++ delete method */
1668
+ data->destroy = PyObject_GetAttrString(data->klass, "__swig_destroy__");
1669
+ if (PyErr_Occurred()) {
1670
+ PyErr_Clear();
1671
+ data->destroy = 0;
1672
+ }
1673
+ if (data->destroy) {
1674
+ data->delargs = !(PyCFunction_GET_FLAGS(data->destroy) & METH_O);
1675
+ } else {
1676
+ data->delargs = 0;
1677
+ }
1678
+ data->implicitconv = 0;
1679
+ data->pytype = 0;
1680
+ return data;
1681
+ }
1682
+ }
1683
+
1684
+ SWIGRUNTIME void
1685
+ SwigPyClientData_Del(SwigPyClientData *data)
1686
+ {
1687
+ Py_XDECREF(data->klass);
1688
+ Py_XDECREF(data->newraw);
1689
+ Py_XDECREF(data->newargs);
1690
+ Py_XDECREF(data->destroy);
1691
+ free(data);
1692
+ }
1693
+
1694
+ /* =============== SwigPyObject =====================*/
1695
+
1696
+ typedef struct {
1697
+ PyObject_HEAD
1698
+ void *ptr;
1699
+ swig_type_info *ty;
1700
+ int own;
1701
+ PyObject *next;
1702
+ #ifdef SWIGPYTHON_BUILTIN
1703
+ PyObject *dict;
1704
+ #endif
1705
+ } SwigPyObject;
1706
+
1707
+
1708
+ #ifdef SWIGPYTHON_BUILTIN
1709
+
1710
+ SWIGRUNTIME PyObject *
1711
+ SwigPyObject_get___dict__(PyObject *v, PyObject *SWIGUNUSEDPARM(args))
1712
+ {
1713
+ SwigPyObject *sobj = (SwigPyObject *)v;
1714
+
1715
+ if (!sobj->dict)
1716
+ sobj->dict = PyDict_New();
1717
+
1718
+ Py_XINCREF(sobj->dict);
1719
+ return sobj->dict;
1720
+ }
1721
+
1722
+ #endif
1723
+
1724
+ SWIGRUNTIME PyObject *
1725
+ SwigPyObject_long(SwigPyObject *v)
1726
+ {
1727
+ return PyLong_FromVoidPtr(v->ptr);
1728
+ }
1729
+
1730
+ SWIGRUNTIME PyObject *
1731
+ SwigPyObject_format(const char* fmt, SwigPyObject *v)
1732
+ {
1733
+ PyObject *res = NULL;
1734
+ PyObject *args = PyTuple_New(1);
1735
+ if (args) {
1736
+ PyObject *val = SwigPyObject_long(v);
1737
+ if (val) {
1738
+ PyObject *ofmt;
1739
+ PyTuple_SET_ITEM(args, 0, val);
1740
+ ofmt = SWIG_Python_str_FromChar(fmt);
1741
+ if (ofmt) {
1742
+ #if PY_VERSION_HEX >= 0x03000000
1743
+ res = PyUnicode_Format(ofmt,args);
1744
+ #else
1745
+ res = PyString_Format(ofmt,args);
1746
+ #endif
1747
+ Py_DECREF(ofmt);
1748
+ }
1749
+ }
1750
+ Py_DECREF(args);
1751
+ }
1752
+ return res;
1753
+ }
1754
+
1755
+ SWIGRUNTIME PyObject *
1756
+ SwigPyObject_oct(SwigPyObject *v)
1757
+ {
1758
+ return SwigPyObject_format("%o",v);
1759
+ }
1760
+
1761
+ SWIGRUNTIME PyObject *
1762
+ SwigPyObject_hex(SwigPyObject *v)
1763
+ {
1764
+ return SwigPyObject_format("%x",v);
1765
+ }
1766
+
1767
+ SWIGRUNTIME PyObject *
1768
+ SwigPyObject_repr(SwigPyObject *v)
1769
+ {
1770
+ const char *name = SWIG_TypePrettyName(v->ty);
1771
+ PyObject *repr = SWIG_Python_str_FromFormat("<Swig Object of type '%s' at %p>", (name ? name : "unknown"), (void *)v);
1772
+ if (repr && v->next) {
1773
+ PyObject *nrep = SwigPyObject_repr((SwigPyObject *)v->next);
1774
+ if (nrep) {
1775
+ # if PY_VERSION_HEX >= 0x03000000
1776
+ PyObject *joined = PyUnicode_Concat(repr, nrep);
1777
+ Py_DecRef(repr);
1778
+ Py_DecRef(nrep);
1779
+ repr = joined;
1780
+ # else
1781
+ PyString_ConcatAndDel(&repr,nrep);
1782
+ # endif
1783
+ } else {
1784
+ Py_DecRef(repr);
1785
+ repr = NULL;
1786
+ }
1787
+ }
1788
+ return repr;
1789
+ }
1790
+
1791
+ /* We need a version taking two PyObject* parameters so it's a valid
1792
+ * PyCFunction to use in swigobject_methods[]. */
1793
+ SWIGRUNTIME PyObject *
1794
+ SwigPyObject_repr2(PyObject *v, PyObject *SWIGUNUSEDPARM(args))
1795
+ {
1796
+ return SwigPyObject_repr((SwigPyObject*)v);
1797
+ }
1798
+
1799
+ SWIGRUNTIME int
1800
+ SwigPyObject_compare(SwigPyObject *v, SwigPyObject *w)
1801
+ {
1802
+ void *i = v->ptr;
1803
+ void *j = w->ptr;
1804
+ return (i < j) ? -1 : ((i > j) ? 1 : 0);
1805
+ }
1806
+
1807
+ /* Added for Python 3.x, would it also be useful for Python 2.x? */
1808
+ SWIGRUNTIME PyObject*
1809
+ SwigPyObject_richcompare(SwigPyObject *v, SwigPyObject *w, int op)
1810
+ {
1811
+ PyObject* res = NULL;
1812
+ if (!PyErr_Occurred()) {
1813
+ if (op != Py_EQ && op != Py_NE) {
1814
+ Py_INCREF(Py_NotImplemented);
1815
+ return Py_NotImplemented;
1816
+ }
1817
+ res = PyBool_FromLong( (SwigPyObject_compare(v, w)==0) == (op == Py_EQ) ? 1 : 0);
1818
+ }
1819
+ return res;
1820
+ }
1821
+
1822
+
1823
+ SWIGRUNTIME PyTypeObject* SwigPyObject_TypeOnce(void);
1824
+
1825
+ #ifdef SWIGPYTHON_BUILTIN
1826
+ static swig_type_info *SwigPyObject_stype = 0;
1827
+ SWIGRUNTIME PyTypeObject*
1828
+ SwigPyObject_type(void) {
1829
+ SwigPyClientData *cd;
1830
+ assert(SwigPyObject_stype);
1831
+ cd = (SwigPyClientData*) SwigPyObject_stype->clientdata;
1832
+ assert(cd);
1833
+ assert(cd->pytype);
1834
+ return cd->pytype;
1835
+ }
1836
+ #else
1837
+ SWIGRUNTIME PyTypeObject*
1838
+ SwigPyObject_type(void) {
1839
+ static PyTypeObject *SWIG_STATIC_POINTER(type) = SwigPyObject_TypeOnce();
1840
+ return type;
1841
+ }
1842
+ #endif
1843
+
1844
+ SWIGRUNTIMEINLINE int
1845
+ SwigPyObject_Check(PyObject *op) {
1846
+ PyTypeObject *target_tp = SwigPyObject_type();
1847
+ PyTypeObject *op_type = Py_TYPE(op);
1848
+ #ifdef SWIGPYTHON_BUILTIN
1849
+ if (PyType_IsSubtype(op_type, target_tp))
1850
+ return 1;
1851
+ return (strcmp(op_type->tp_name, "SwigPyObject") == 0);
1852
+ #else
1853
+ if (op_type == target_tp)
1854
+ return 1;
1855
+ # ifdef Py_LIMITED_API
1856
+ int cmp;
1857
+ PyObject *tp_name = PyObject_GetAttrString((PyObject *)op_type, "__name__");
1858
+ if (!tp_name)
1859
+ return 0;
1860
+ cmp = PyUnicode_CompareWithASCIIString(tp_name, "SwigPyObject");
1861
+ Py_DECREF(tp_name);
1862
+ return cmp == 0;
1863
+ # else
1864
+ return (strcmp(op_type->tp_name, "SwigPyObject") == 0);
1865
+ # endif
1866
+ #endif
1867
+ }
1868
+
1869
+ SWIGRUNTIME PyObject *
1870
+ SwigPyObject_New(void *ptr, swig_type_info *ty, int own);
1871
+
1872
+ static PyObject* Swig_Capsule_global = NULL;
1873
+
1874
+ SWIGRUNTIME void
1875
+ SwigPyObject_dealloc(PyObject *v)
1876
+ {
1877
+ SwigPyObject *sobj = (SwigPyObject *) v;
1878
+ PyObject *next = sobj->next;
1879
+ if (sobj->own == SWIG_POINTER_OWN) {
1880
+ swig_type_info *ty = sobj->ty;
1881
+ SwigPyClientData *data = ty ? (SwigPyClientData *) ty->clientdata : 0;
1882
+ PyObject *destroy = data ? data->destroy : 0;
1883
+ if (destroy) {
1884
+ /* destroy is always a VARARGS method */
1885
+ PyObject *res;
1886
+
1887
+ /* PyObject_CallFunction() has the potential to silently drop
1888
+ the active exception. In cases of unnamed temporary
1889
+ variable or where we just finished iterating over a generator
1890
+ StopIteration will be active right now, and this needs to
1891
+ remain true upon return from SwigPyObject_dealloc. So save
1892
+ and restore. */
1893
+
1894
+ PyObject *type = NULL, *value = NULL, *traceback = NULL;
1895
+ PyErr_Fetch(&type, &value, &traceback);
1896
+
1897
+ if (data->delargs) {
1898
+ /* we need to create a temporary object to carry the destroy operation */
1899
+ PyObject *tmp = SwigPyObject_New(sobj->ptr, ty, 0);
1900
+ if (tmp) {
1901
+ res = SWIG_Python_CallFunctor(destroy, tmp);
1902
+ } else {
1903
+ res = 0;
1904
+ }
1905
+ Py_XDECREF(tmp);
1906
+ } else {
1907
+ PyCFunction meth = PyCFunction_GET_FUNCTION(destroy);
1908
+ PyObject *mself = PyCFunction_GET_SELF(destroy);
1909
+ res = ((*meth)(mself, v));
1910
+ }
1911
+ if (!res)
1912
+ PyErr_WriteUnraisable(destroy);
1913
+
1914
+ PyErr_Restore(type, value, traceback);
1915
+
1916
+ Py_XDECREF(res);
1917
+ }
1918
+ #if !defined(SWIG_PYTHON_SILENT_MEMLEAK)
1919
+ else {
1920
+ const char *name = SWIG_TypePrettyName(ty);
1921
+ printf("swig/python detected a memory leak of type '%s', no destructor found.\n", (name ? name : "unknown"));
1922
+ }
1923
+ #endif
1924
+ Py_XDECREF(Swig_Capsule_global);
1925
+ }
1926
+ Py_XDECREF(next);
1927
+ #ifdef SWIGPYTHON_BUILTIN
1928
+ Py_XDECREF(sobj->dict);
1929
+ #endif
1930
+ PyObject_DEL(v);
1931
+ }
1932
+
1933
+ SWIGRUNTIME PyObject*
1934
+ SwigPyObject_append(PyObject* v, PyObject* next)
1935
+ {
1936
+ SwigPyObject *sobj = (SwigPyObject *) v;
1937
+ if (!SwigPyObject_Check(next)) {
1938
+ PyErr_SetString(PyExc_TypeError, "Attempt to append a non SwigPyObject");
1939
+ return NULL;
1940
+ }
1941
+ ((SwigPyObject *)next)->next = sobj->next;
1942
+ sobj->next = next;
1943
+ Py_INCREF(next);
1944
+ return SWIG_Py_Void();
1945
+ }
1946
+
1947
+ SWIGRUNTIME PyObject*
1948
+ SwigPyObject_next(PyObject* v, PyObject *SWIGUNUSEDPARM(args))
1949
+ {
1950
+ SwigPyObject *sobj = (SwigPyObject *) v;
1951
+ if (sobj->next) {
1952
+ Py_INCREF(sobj->next);
1953
+ return sobj->next;
1954
+ } else {
1955
+ return SWIG_Py_Void();
1956
+ }
1957
+ }
1958
+
1959
+ SWIGINTERN PyObject*
1960
+ SwigPyObject_disown(PyObject* v, PyObject *SWIGUNUSEDPARM(args))
1961
+ {
1962
+ SwigPyObject *sobj = (SwigPyObject *)v;
1963
+ sobj->own = 0;
1964
+ return SWIG_Py_Void();
1965
+ }
1966
+
1967
+ SWIGINTERN PyObject*
1968
+ SwigPyObject_acquire(PyObject* v, PyObject *SWIGUNUSEDPARM(args))
1969
+ {
1970
+ SwigPyObject *sobj = (SwigPyObject *)v;
1971
+ sobj->own = SWIG_POINTER_OWN;
1972
+ return SWIG_Py_Void();
1973
+ }
1974
+
1975
+ SWIGINTERN PyObject*
1976
+ SwigPyObject_own(PyObject *v, PyObject *args)
1977
+ {
1978
+ PyObject *val = 0;
1979
+ if (!PyArg_UnpackTuple(args, "own", 0, 1, &val)) {
1980
+ return NULL;
1981
+ } else {
1982
+ SwigPyObject *sobj = (SwigPyObject *)v;
1983
+ PyObject *obj = PyBool_FromLong(sobj->own);
1984
+ if (val) {
1985
+ if (PyObject_IsTrue(val)) {
1986
+ Py_DECREF(SwigPyObject_acquire(v,args));
1987
+ } else {
1988
+ Py_DECREF(SwigPyObject_disown(v,args));
1989
+ }
1990
+ }
1991
+ return obj;
1992
+ }
1993
+ }
1994
+
1995
+ static PyMethodDef
1996
+ swigobject_methods[] = {
1997
+ {"disown", SwigPyObject_disown, METH_NOARGS, "releases ownership of the pointer"},
1998
+ {"acquire", SwigPyObject_acquire, METH_NOARGS, "acquires ownership of the pointer"},
1999
+ {"own", SwigPyObject_own, METH_VARARGS, "returns/sets ownership of the pointer"},
2000
+ {"append", SwigPyObject_append, METH_O, "appends another 'this' object"},
2001
+ {"next", SwigPyObject_next, METH_NOARGS, "returns the next 'this' object"},
2002
+ {"__repr__",SwigPyObject_repr2, METH_NOARGS, "returns object representation"},
2003
+ {0, 0, 0, 0}
2004
+ };
2005
+
2006
+ SWIGRUNTIME PyTypeObject*
2007
+ SwigPyObject_TypeOnce(void) {
2008
+ static char swigobject_doc[] = "Swig object carries a C/C++ instance pointer";
2009
+ #ifndef Py_LIMITED_API
2010
+ static PyNumberMethods SwigPyObject_as_number = {
2011
+ (binaryfunc)0, /*nb_add*/
2012
+ (binaryfunc)0, /*nb_subtract*/
2013
+ (binaryfunc)0, /*nb_multiply*/
2014
+ /* nb_divide removed in Python 3 */
2015
+ #if PY_VERSION_HEX < 0x03000000
2016
+ (binaryfunc)0, /*nb_divide*/
2017
+ #endif
2018
+ (binaryfunc)0, /*nb_remainder*/
2019
+ (binaryfunc)0, /*nb_divmod*/
2020
+ (ternaryfunc)0,/*nb_power*/
2021
+ (unaryfunc)0, /*nb_negative*/
2022
+ (unaryfunc)0, /*nb_positive*/
2023
+ (unaryfunc)0, /*nb_absolute*/
2024
+ (inquiry)0, /*nb_nonzero*/
2025
+ 0, /*nb_invert*/
2026
+ 0, /*nb_lshift*/
2027
+ 0, /*nb_rshift*/
2028
+ 0, /*nb_and*/
2029
+ 0, /*nb_xor*/
2030
+ 0, /*nb_or*/
2031
+ #if PY_VERSION_HEX < 0x03000000
2032
+ 0, /*nb_coerce*/
2033
+ #endif
2034
+ (unaryfunc)SwigPyObject_long, /*nb_int*/
2035
+ #if PY_VERSION_HEX < 0x03000000
2036
+ (unaryfunc)SwigPyObject_long, /*nb_long*/
2037
+ #else
2038
+ 0, /*nb_reserved*/
2039
+ #endif
2040
+ (unaryfunc)0, /*nb_float*/
2041
+ #if PY_VERSION_HEX < 0x03000000
2042
+ (unaryfunc)SwigPyObject_oct, /*nb_oct*/
2043
+ (unaryfunc)SwigPyObject_hex, /*nb_hex*/
2044
+ #endif
2045
+ #if PY_VERSION_HEX >= 0x03050000 /* 3.5 */
2046
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 /* nb_inplace_add -> nb_inplace_matrix_multiply */
2047
+ #elif PY_VERSION_HEX >= 0x03000000 /* 3.0 */
2048
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 /* nb_inplace_add -> nb_index, nb_inplace_divide removed */
2049
+ #else
2050
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 /* nb_inplace_add -> nb_index */
2051
+ #endif
2052
+ };
2053
+
2054
+ static PyTypeObject swigpyobject_type;
2055
+ static int type_init = 0;
2056
+ if (!type_init) {
2057
+ const PyTypeObject tmp = {
2058
+ #if PY_VERSION_HEX >= 0x03000000
2059
+ PyVarObject_HEAD_INIT(NULL, 0)
2060
+ #else
2061
+ PyObject_HEAD_INIT(NULL)
2062
+ 0, /* ob_size */
2063
+ #endif
2064
+ "SwigPyObject", /* tp_name */
2065
+ sizeof(SwigPyObject), /* tp_basicsize */
2066
+ 0, /* tp_itemsize */
2067
+ (destructor)SwigPyObject_dealloc, /* tp_dealloc */
2068
+ #if PY_VERSION_HEX < 0x030800b4
2069
+ (printfunc)0, /*tp_print*/
2070
+ #else
2071
+ (Py_ssize_t)0, /*tp_vectorcall_offset*/
2072
+ #endif
2073
+ (getattrfunc)0, /* tp_getattr */
2074
+ (setattrfunc)0, /* tp_setattr */
2075
+ #if PY_VERSION_HEX >= 0x03000000
2076
+ 0, /* tp_reserved in 3.0.1, tp_compare in 3.0.0 but not used */
2077
+ #else
2078
+ (cmpfunc)SwigPyObject_compare, /* tp_compare */
2079
+ #endif
2080
+ (reprfunc)SwigPyObject_repr, /* tp_repr */
2081
+ &SwigPyObject_as_number, /* tp_as_number */
2082
+ 0, /* tp_as_sequence */
2083
+ 0, /* tp_as_mapping */
2084
+ (hashfunc)0, /* tp_hash */
2085
+ (ternaryfunc)0, /* tp_call */
2086
+ 0, /* tp_str */
2087
+ PyObject_GenericGetAttr, /* tp_getattro */
2088
+ 0, /* tp_setattro */
2089
+ 0, /* tp_as_buffer */
2090
+ Py_TPFLAGS_DEFAULT, /* tp_flags */
2091
+ swigobject_doc, /* tp_doc */
2092
+ 0, /* tp_traverse */
2093
+ 0, /* tp_clear */
2094
+ (richcmpfunc)SwigPyObject_richcompare,/* tp_richcompare */
2095
+ 0, /* tp_weaklistoffset */
2096
+ 0, /* tp_iter */
2097
+ 0, /* tp_iternext */
2098
+ swigobject_methods, /* tp_methods */
2099
+ 0, /* tp_members */
2100
+ 0, /* tp_getset */
2101
+ 0, /* tp_base */
2102
+ 0, /* tp_dict */
2103
+ 0, /* tp_descr_get */
2104
+ 0, /* tp_descr_set */
2105
+ 0, /* tp_dictoffset */
2106
+ 0, /* tp_init */
2107
+ 0, /* tp_alloc */
2108
+ 0, /* tp_new */
2109
+ 0, /* tp_free */
2110
+ 0, /* tp_is_gc */
2111
+ 0, /* tp_bases */
2112
+ 0, /* tp_mro */
2113
+ 0, /* tp_cache */
2114
+ 0, /* tp_subclasses */
2115
+ 0, /* tp_weaklist */
2116
+ 0, /* tp_del */
2117
+ 0, /* tp_version_tag */
2118
+ #if PY_VERSION_HEX >= 0x03040000
2119
+ 0, /* tp_finalize */
2120
+ #endif
2121
+ #if PY_VERSION_HEX >= 0x03080000
2122
+ 0, /* tp_vectorcall */
2123
+ #endif
2124
+ #if (PY_VERSION_HEX >= 0x03080000) && (PY_VERSION_HEX < 0x03090000)
2125
+ 0, /* tp_print */
2126
+ #endif
2127
+ #if PY_VERSION_HEX >= 0x030C0000
2128
+ 0, /* tp_watched */
2129
+ #endif
2130
+ #ifdef COUNT_ALLOCS
2131
+ 0, /* tp_allocs */
2132
+ 0, /* tp_frees */
2133
+ 0, /* tp_maxalloc */
2134
+ 0, /* tp_prev */
2135
+ 0 /* tp_next */
2136
+ #endif
2137
+ };
2138
+ swigpyobject_type = tmp;
2139
+ type_init = 1;
2140
+ if (PyType_Ready(&swigpyobject_type) != 0)
2141
+ return NULL;
2142
+ }
2143
+ return &swigpyobject_type;
2144
+ #else
2145
+ PyType_Slot slots[] = {
2146
+ { Py_tp_dealloc, (void *)SwigPyObject_dealloc },
2147
+ { Py_tp_repr, (void *)SwigPyObject_repr },
2148
+ { Py_tp_getattro, (void *)PyObject_GenericGetAttr },
2149
+ { Py_tp_doc, (void *)swigobject_doc },
2150
+ { Py_tp_richcompare, (void *)SwigPyObject_richcompare },
2151
+ { Py_tp_methods, (void *)swigobject_methods },
2152
+ { Py_nb_int, (void *)SwigPyObject_long },
2153
+ { 0, NULL }
2154
+ };
2155
+ PyType_Spec spec = {
2156
+ "SwigPyObject",
2157
+ sizeof(SwigPyObject),
2158
+ 0,
2159
+ Py_TPFLAGS_DEFAULT,
2160
+ slots
2161
+ };
2162
+ return (PyTypeObject *)PyType_FromSpec(&spec);
2163
+ #endif
2164
+ }
2165
+
2166
+ SWIGRUNTIME PyObject *
2167
+ SwigPyObject_New(void *ptr, swig_type_info *ty, int own)
2168
+ {
2169
+ SwigPyObject *sobj = PyObject_New(SwigPyObject, SwigPyObject_type());
2170
+ if (sobj) {
2171
+ sobj->ptr = ptr;
2172
+ sobj->ty = ty;
2173
+ sobj->own = own;
2174
+ sobj->next = 0;
2175
+ #ifdef SWIGPYTHON_BUILTIN
2176
+ sobj->dict = 0;
2177
+ #endif
2178
+ if (own == SWIG_POINTER_OWN) {
2179
+ /* Obtain a reference to the Python capsule wrapping the module information, so that the
2180
+ * module information is correctly destroyed after all SWIG python objects have been freed
2181
+ * by the GC (and corresponding destructors invoked) */
2182
+ Py_XINCREF(Swig_Capsule_global);
2183
+ }
2184
+ }
2185
+ return (PyObject *)sobj;
2186
+ }
2187
+
2188
+ /* -----------------------------------------------------------------------------
2189
+ * Implements a simple Swig Packed type, and use it instead of string
2190
+ * ----------------------------------------------------------------------------- */
2191
+
2192
+ typedef struct {
2193
+ PyObject_HEAD
2194
+ void *pack;
2195
+ swig_type_info *ty;
2196
+ size_t size;
2197
+ } SwigPyPacked;
2198
+
2199
+ SWIGRUNTIME PyObject *
2200
+ SwigPyPacked_repr(SwigPyPacked *v)
2201
+ {
2202
+ char result[SWIG_BUFFER_SIZE];
2203
+ if (SWIG_PackDataName(result, v->pack, v->size, 0, sizeof(result))) {
2204
+ return SWIG_Python_str_FromFormat("<Swig Packed at %s%s>", result, v->ty->name);
2205
+ } else {
2206
+ return SWIG_Python_str_FromFormat("<Swig Packed %s>", v->ty->name);
2207
+ }
2208
+ }
2209
+
2210
+ SWIGRUNTIME PyObject *
2211
+ SwigPyPacked_str(SwigPyPacked *v)
2212
+ {
2213
+ char result[SWIG_BUFFER_SIZE];
2214
+ if (SWIG_PackDataName(result, v->pack, v->size, 0, sizeof(result))){
2215
+ return SWIG_Python_str_FromFormat("%s%s", result, v->ty->name);
2216
+ } else {
2217
+ return SWIG_Python_str_FromChar(v->ty->name);
2218
+ }
2219
+ }
2220
+
2221
+ SWIGRUNTIME int
2222
+ SwigPyPacked_compare(SwigPyPacked *v, SwigPyPacked *w)
2223
+ {
2224
+ size_t i = v->size;
2225
+ size_t j = w->size;
2226
+ int s = (i < j) ? -1 : ((i > j) ? 1 : 0);
2227
+ return s ? s : strncmp((const char *)v->pack, (const char *)w->pack, 2*v->size);
2228
+ }
2229
+
2230
+ SWIGRUNTIME PyTypeObject* SwigPyPacked_TypeOnce(void);
2231
+
2232
+ SWIGRUNTIME PyTypeObject*
2233
+ SwigPyPacked_type(void) {
2234
+ static PyTypeObject *SWIG_STATIC_POINTER(type) = SwigPyPacked_TypeOnce();
2235
+ return type;
2236
+ }
2237
+
2238
+ SWIGRUNTIMEINLINE int
2239
+ SwigPyPacked_Check(PyObject *op) {
2240
+ PyTypeObject* op_type = Py_TYPE(op);
2241
+ if (op_type == SwigPyPacked_TypeOnce())
2242
+ return 1;
2243
+ #ifdef Py_LIMITED_API
2244
+ int cmp;
2245
+ PyObject *tp_name = PyObject_GetAttrString((PyObject *)op_type, "__name__");
2246
+ if (!tp_name)
2247
+ return 0;
2248
+ cmp = PyUnicode_CompareWithASCIIString(tp_name, "SwigPyPacked");
2249
+ Py_DECREF(tp_name);
2250
+ return cmp == 0;
2251
+ #else
2252
+ return (strcmp(op_type->tp_name, "SwigPyPacked") == 0);
2253
+ #endif
2254
+ }
2255
+
2256
+ SWIGRUNTIME void
2257
+ SwigPyPacked_dealloc(PyObject *v)
2258
+ {
2259
+ if (SwigPyPacked_Check(v)) {
2260
+ SwigPyPacked *sobj = (SwigPyPacked *) v;
2261
+ free(sobj->pack);
2262
+ }
2263
+ PyObject_DEL(v);
2264
+ }
2265
+
2266
+ SWIGRUNTIME PyTypeObject*
2267
+ SwigPyPacked_TypeOnce(void) {
2268
+ static char swigpacked_doc[] = "Swig object carries a C/C++ instance pointer";
2269
+ #ifndef Py_LIMITED_API
2270
+ static PyTypeObject swigpypacked_type;
2271
+ static int type_init = 0;
2272
+ if (!type_init) {
2273
+ const PyTypeObject tmp = {
2274
+ #if PY_VERSION_HEX>=0x03000000
2275
+ PyVarObject_HEAD_INIT(NULL, 0)
2276
+ #else
2277
+ PyObject_HEAD_INIT(NULL)
2278
+ 0, /* ob_size */
2279
+ #endif
2280
+ "SwigPyPacked", /* tp_name */
2281
+ sizeof(SwigPyPacked), /* tp_basicsize */
2282
+ 0, /* tp_itemsize */
2283
+ (destructor)SwigPyPacked_dealloc, /* tp_dealloc */
2284
+ #if PY_VERSION_HEX < 0x030800b4
2285
+ (printfunc)0, /*tp_print*/
2286
+ #else
2287
+ (Py_ssize_t)0, /*tp_vectorcall_offset*/
2288
+ #endif
2289
+ (getattrfunc)0, /* tp_getattr */
2290
+ (setattrfunc)0, /* tp_setattr */
2291
+ #if PY_VERSION_HEX>=0x03000000
2292
+ 0, /* tp_reserved in 3.0.1 */
2293
+ #else
2294
+ (cmpfunc)SwigPyPacked_compare, /* tp_compare */
2295
+ #endif
2296
+ (reprfunc)SwigPyPacked_repr, /* tp_repr */
2297
+ 0, /* tp_as_number */
2298
+ 0, /* tp_as_sequence */
2299
+ 0, /* tp_as_mapping */
2300
+ (hashfunc)0, /* tp_hash */
2301
+ (ternaryfunc)0, /* tp_call */
2302
+ (reprfunc)SwigPyPacked_str, /* tp_str */
2303
+ PyObject_GenericGetAttr, /* tp_getattro */
2304
+ 0, /* tp_setattro */
2305
+ 0, /* tp_as_buffer */
2306
+ Py_TPFLAGS_DEFAULT, /* tp_flags */
2307
+ swigpacked_doc, /* tp_doc */
2308
+ 0, /* tp_traverse */
2309
+ 0, /* tp_clear */
2310
+ 0, /* tp_richcompare */
2311
+ 0, /* tp_weaklistoffset */
2312
+ 0, /* tp_iter */
2313
+ 0, /* tp_iternext */
2314
+ 0, /* tp_methods */
2315
+ 0, /* tp_members */
2316
+ 0, /* tp_getset */
2317
+ 0, /* tp_base */
2318
+ 0, /* tp_dict */
2319
+ 0, /* tp_descr_get */
2320
+ 0, /* tp_descr_set */
2321
+ 0, /* tp_dictoffset */
2322
+ 0, /* tp_init */
2323
+ 0, /* tp_alloc */
2324
+ 0, /* tp_new */
2325
+ 0, /* tp_free */
2326
+ 0, /* tp_is_gc */
2327
+ 0, /* tp_bases */
2328
+ 0, /* tp_mro */
2329
+ 0, /* tp_cache */
2330
+ 0, /* tp_subclasses */
2331
+ 0, /* tp_weaklist */
2332
+ 0, /* tp_del */
2333
+ 0, /* tp_version_tag */
2334
+ #if PY_VERSION_HEX >= 0x03040000
2335
+ 0, /* tp_finalize */
2336
+ #endif
2337
+ #if PY_VERSION_HEX >= 0x03080000
2338
+ 0, /* tp_vectorcall */
2339
+ #endif
2340
+ #if (PY_VERSION_HEX >= 0x03080000) && (PY_VERSION_HEX < 0x03090000)
2341
+ 0, /* tp_print */
2342
+ #endif
2343
+ #if PY_VERSION_HEX >= 0x030C0000
2344
+ 0, /* tp_watched */
2345
+ #endif
2346
+ #ifdef COUNT_ALLOCS
2347
+ 0, /* tp_allocs */
2348
+ 0, /* tp_frees */
2349
+ 0, /* tp_maxalloc */
2350
+ 0, /* tp_prev */
2351
+ 0 /* tp_next */
2352
+ #endif
2353
+ };
2354
+ swigpypacked_type = tmp;
2355
+ type_init = 1;
2356
+ if (PyType_Ready(&swigpypacked_type) != 0)
2357
+ return NULL;
2358
+ }
2359
+ return &swigpypacked_type;
2360
+ #else
2361
+ PyType_Slot slots[] = {
2362
+ { Py_tp_dealloc, (void *)SwigPyPacked_dealloc },
2363
+ { Py_tp_repr, (void *)SwigPyPacked_repr },
2364
+ { Py_tp_str, (void *)SwigPyPacked_str },
2365
+ { Py_tp_getattro, (void *)PyObject_GenericGetAttr },
2366
+ { Py_tp_doc, (void *)swigpacked_doc },
2367
+ { 0, NULL }
2368
+ };
2369
+ PyType_Spec spec = {
2370
+ "SwigPyPacked",
2371
+ sizeof(SwigPyPacked),
2372
+ 0,
2373
+ Py_TPFLAGS_DEFAULT,
2374
+ slots
2375
+ };
2376
+ return (PyTypeObject *)PyType_FromSpec(&spec);
2377
+ #endif
2378
+ }
2379
+
2380
+ SWIGRUNTIME PyObject *
2381
+ SwigPyPacked_New(void *ptr, size_t size, swig_type_info *ty)
2382
+ {
2383
+ SwigPyPacked *sobj = PyObject_New(SwigPyPacked, SwigPyPacked_type());
2384
+ if (sobj) {
2385
+ void *pack = malloc(size);
2386
+ if (pack) {
2387
+ memcpy(pack, ptr, size);
2388
+ sobj->pack = pack;
2389
+ sobj->ty = ty;
2390
+ sobj->size = size;
2391
+ } else {
2392
+ PyObject_DEL((PyObject *) sobj);
2393
+ sobj = 0;
2394
+ }
2395
+ }
2396
+ return (PyObject *) sobj;
2397
+ }
2398
+
2399
+ SWIGRUNTIME swig_type_info *
2400
+ SwigPyPacked_UnpackData(PyObject *obj, void *ptr, size_t size)
2401
+ {
2402
+ if (SwigPyPacked_Check(obj)) {
2403
+ SwigPyPacked *sobj = (SwigPyPacked *)obj;
2404
+ if (sobj->size != size) return 0;
2405
+ memcpy(ptr, sobj->pack, size);
2406
+ return sobj->ty;
2407
+ } else {
2408
+ return 0;
2409
+ }
2410
+ }
2411
+
2412
+ /* -----------------------------------------------------------------------------
2413
+ * pointers/data manipulation
2414
+ * ----------------------------------------------------------------------------- */
2415
+
2416
+ static PyObject *Swig_This_global = NULL;
2417
+
2418
+ SWIGRUNTIME PyObject *
2419
+ SWIG_This(void)
2420
+ {
2421
+ if (Swig_This_global == NULL)
2422
+ Swig_This_global = SWIG_Python_str_FromChar("this");
2423
+ return Swig_This_global;
2424
+ }
2425
+
2426
+ /* #define SWIG_PYTHON_SLOW_GETSET_THIS */
2427
+
2428
+ /* TODO: I don't know how to implement the fast getset in Python 3 right now */
2429
+ #if PY_VERSION_HEX>=0x03000000
2430
+ #define SWIG_PYTHON_SLOW_GETSET_THIS
2431
+ #endif
2432
+
2433
+ SWIGRUNTIME SwigPyObject *
2434
+ SWIG_Python_GetSwigThis(PyObject *pyobj)
2435
+ {
2436
+ PyObject *obj;
2437
+
2438
+ if (SwigPyObject_Check(pyobj))
2439
+ return (SwigPyObject *) pyobj;
2440
+
2441
+ #ifdef SWIGPYTHON_BUILTIN
2442
+ (void)obj;
2443
+ # ifdef PyWeakref_CheckProxy
2444
+ if (PyWeakref_CheckProxy(pyobj)) {
2445
+ pyobj = PyWeakref_GET_OBJECT(pyobj);
2446
+ if (pyobj && SwigPyObject_Check(pyobj))
2447
+ return (SwigPyObject*) pyobj;
2448
+ }
2449
+ # endif
2450
+ return NULL;
2451
+ #else
2452
+
2453
+ obj = 0;
2454
+
2455
+ #if !defined(SWIG_PYTHON_SLOW_GETSET_THIS)
2456
+ if (PyInstance_Check(pyobj)) {
2457
+ obj = _PyInstance_Lookup(pyobj, SWIG_This());
2458
+ } else {
2459
+ PyObject **dictptr = _PyObject_GetDictPtr(pyobj);
2460
+ if (dictptr != NULL) {
2461
+ PyObject *dict = *dictptr;
2462
+ obj = dict ? PyDict_GetItem(dict, SWIG_This()) : 0;
2463
+ } else {
2464
+ #ifdef PyWeakref_CheckProxy
2465
+ if (PyWeakref_CheckProxy(pyobj)) {
2466
+ PyObject *wobj = PyWeakref_GET_OBJECT(pyobj);
2467
+ return wobj ? SWIG_Python_GetSwigThis(wobj) : 0;
2468
+ }
2469
+ #endif
2470
+ obj = PyObject_GetAttr(pyobj,SWIG_This());
2471
+ if (obj) {
2472
+ Py_DECREF(obj);
2473
+ } else {
2474
+ if (PyErr_Occurred()) PyErr_Clear();
2475
+ return 0;
2476
+ }
2477
+ }
2478
+ }
2479
+ #else
2480
+ obj = PyObject_GetAttr(pyobj,SWIG_This());
2481
+ if (obj) {
2482
+ Py_DECREF(obj);
2483
+ } else {
2484
+ if (PyErr_Occurred()) PyErr_Clear();
2485
+ return 0;
2486
+ }
2487
+ #endif
2488
+ if (obj && !SwigPyObject_Check(obj)) {
2489
+ /* a PyObject is called 'this', try to get the 'real this'
2490
+ SwigPyObject from it */
2491
+ return SWIG_Python_GetSwigThis(obj);
2492
+ }
2493
+ return (SwigPyObject *)obj;
2494
+ #endif
2495
+ }
2496
+
2497
+ /* Acquire a pointer value */
2498
+
2499
+ SWIGRUNTIME int
2500
+ SWIG_Python_AcquirePtr(PyObject *obj, int own) {
2501
+ if (own == SWIG_POINTER_OWN) {
2502
+ SwigPyObject *sobj = SWIG_Python_GetSwigThis(obj);
2503
+ if (sobj) {
2504
+ int oldown = sobj->own;
2505
+ sobj->own = own;
2506
+ return oldown;
2507
+ }
2508
+ }
2509
+ return 0;
2510
+ }
2511
+
2512
+ /* Convert a pointer value */
2513
+
2514
+ SWIGRUNTIME int
2515
+ SWIG_Python_ConvertPtrAndOwn(PyObject *obj, void **ptr, swig_type_info *ty, int flags, int *own) {
2516
+ int res;
2517
+ SwigPyObject *sobj;
2518
+ int implicit_conv = (flags & SWIG_POINTER_IMPLICIT_CONV) != 0;
2519
+
2520
+ if (!obj)
2521
+ return SWIG_ERROR;
2522
+ if (obj == Py_None && !implicit_conv) {
2523
+ if (ptr)
2524
+ *ptr = 0;
2525
+ return (flags & SWIG_POINTER_NO_NULL) ? SWIG_NullReferenceError : SWIG_OK;
2526
+ }
2527
+
2528
+ res = SWIG_ERROR;
2529
+
2530
+ sobj = SWIG_Python_GetSwigThis(obj);
2531
+ if (own)
2532
+ *own = 0;
2533
+ while (sobj) {
2534
+ void *vptr = sobj->ptr;
2535
+ if (ty) {
2536
+ swig_type_info *to = sobj->ty;
2537
+ if (to == ty) {
2538
+ /* no type cast needed */
2539
+ if (ptr) *ptr = vptr;
2540
+ break;
2541
+ } else {
2542
+ swig_cast_info *tc = SWIG_TypeCheck(to->name,ty);
2543
+ if (!tc) {
2544
+ sobj = (SwigPyObject *)sobj->next;
2545
+ } else {
2546
+ if (ptr) {
2547
+ int newmemory = 0;
2548
+ *ptr = SWIG_TypeCast(tc,vptr,&newmemory);
2549
+ if (newmemory == SWIG_CAST_NEW_MEMORY) {
2550
+ assert(own); /* badly formed typemap which will lead to a memory leak - it must set and use own to delete *ptr */
2551
+ if (own)
2552
+ *own = *own | SWIG_CAST_NEW_MEMORY;
2553
+ }
2554
+ }
2555
+ break;
2556
+ }
2557
+ }
2558
+ } else {
2559
+ if (ptr) *ptr = vptr;
2560
+ break;
2561
+ }
2562
+ }
2563
+ if (sobj) {
2564
+ if (((flags & SWIG_POINTER_RELEASE) == SWIG_POINTER_RELEASE) && !sobj->own) {
2565
+ res = SWIG_ERROR_RELEASE_NOT_OWNED;
2566
+ } else {
2567
+ if (own)
2568
+ *own = *own | sobj->own;
2569
+ if (flags & SWIG_POINTER_DISOWN) {
2570
+ sobj->own = 0;
2571
+ }
2572
+ if (flags & SWIG_POINTER_CLEAR) {
2573
+ sobj->ptr = 0;
2574
+ }
2575
+ res = SWIG_OK;
2576
+ }
2577
+ } else {
2578
+ if (implicit_conv) {
2579
+ SwigPyClientData *data = ty ? (SwigPyClientData *) ty->clientdata : 0;
2580
+ if (data && !data->implicitconv) {
2581
+ PyObject *klass = data->klass;
2582
+ if (klass) {
2583
+ PyObject *impconv;
2584
+ data->implicitconv = 1; /* avoid recursion and call 'explicit' constructors*/
2585
+ impconv = SWIG_Python_CallFunctor(klass, obj);
2586
+ data->implicitconv = 0;
2587
+ if (PyErr_Occurred()) {
2588
+ PyErr_Clear();
2589
+ impconv = 0;
2590
+ }
2591
+ if (impconv) {
2592
+ SwigPyObject *iobj = SWIG_Python_GetSwigThis(impconv);
2593
+ if (iobj) {
2594
+ void *vptr;
2595
+ res = SWIG_Python_ConvertPtrAndOwn((PyObject*)iobj, &vptr, ty, 0, 0);
2596
+ if (SWIG_IsOK(res)) {
2597
+ if (ptr) {
2598
+ *ptr = vptr;
2599
+ /* transfer the ownership to 'ptr' */
2600
+ iobj->own = 0;
2601
+ res = SWIG_AddCast(res);
2602
+ res = SWIG_AddNewMask(res);
2603
+ } else {
2604
+ res = SWIG_AddCast(res);
2605
+ }
2606
+ }
2607
+ }
2608
+ Py_DECREF(impconv);
2609
+ }
2610
+ }
2611
+ }
2612
+ if (!SWIG_IsOK(res) && obj == Py_None) {
2613
+ if (ptr)
2614
+ *ptr = 0;
2615
+ if (PyErr_Occurred())
2616
+ PyErr_Clear();
2617
+ res = SWIG_OK;
2618
+ }
2619
+ }
2620
+ }
2621
+ return res;
2622
+ }
2623
+
2624
+ /* Convert a function ptr value */
2625
+
2626
+ SWIGRUNTIME int
2627
+ SWIG_Python_ConvertFunctionPtr(PyObject *obj, void **ptr, swig_type_info *ty) {
2628
+ if (!PyCFunction_Check(obj)) {
2629
+ return SWIG_ConvertPtr(obj, ptr, ty, 0);
2630
+ } else {
2631
+ void *vptr = 0;
2632
+ swig_cast_info *tc;
2633
+
2634
+ /* here we get the method pointer for callbacks */
2635
+ #ifndef Py_LIMITED_API
2636
+ const char *doc = (((PyCFunctionObject *)obj) -> m_ml -> ml_doc);
2637
+ #else
2638
+ PyObject* pystr_doc = PyObject_GetAttrString(obj, "__doc__");
2639
+ PyObject *bytes = NULL;
2640
+ const char *doc = pystr_doc ? SWIG_PyUnicode_AsUTF8AndSize(pystr_doc, NULL, &bytes) : 0;
2641
+ #endif
2642
+ const char *desc = doc ? strstr(doc, "swig_ptr: ") : 0;
2643
+ if (desc)
2644
+ desc = ty ? SWIG_UnpackVoidPtr(desc + 10, &vptr, ty->name) : 0;
2645
+ #ifdef Py_LIMITED_API
2646
+ Py_XDECREF(bytes);
2647
+ Py_XDECREF(pystr_doc);
2648
+ #endif
2649
+ if (!desc)
2650
+ return SWIG_ERROR;
2651
+ tc = SWIG_TypeCheck(desc,ty);
2652
+ if (tc) {
2653
+ int newmemory = 0;
2654
+ *ptr = SWIG_TypeCast(tc,vptr,&newmemory);
2655
+ assert(!newmemory); /* newmemory handling not yet implemented */
2656
+ } else {
2657
+ return SWIG_ERROR;
2658
+ }
2659
+ return SWIG_OK;
2660
+ }
2661
+ }
2662
+
2663
+ /* Convert a packed pointer value */
2664
+
2665
+ SWIGRUNTIME int
2666
+ SWIG_Python_ConvertPacked(PyObject *obj, void *ptr, size_t sz, swig_type_info *ty) {
2667
+ swig_type_info *to = SwigPyPacked_UnpackData(obj, ptr, sz);
2668
+ if (!to) return SWIG_ERROR;
2669
+ if (ty) {
2670
+ if (to != ty) {
2671
+ /* check type cast? */
2672
+ swig_cast_info *tc = SWIG_TypeCheck(to->name,ty);
2673
+ if (!tc) return SWIG_ERROR;
2674
+ }
2675
+ }
2676
+ return SWIG_OK;
2677
+ }
2678
+
2679
+ /* -----------------------------------------------------------------------------
2680
+ * Create a new pointer object
2681
+ * ----------------------------------------------------------------------------- */
2682
+
2683
+ /*
2684
+ Create a new instance object, without calling __init__, and set the
2685
+ 'this' attribute.
2686
+ */
2687
+
2688
+ SWIGRUNTIME PyObject*
2689
+ SWIG_Python_NewShadowInstance(SwigPyClientData *data, PyObject *swig_this)
2690
+ {
2691
+ PyObject *inst = 0;
2692
+ PyObject *newraw = data->newraw;
2693
+ if (newraw) {
2694
+ inst = PyObject_Call(newraw, data->newargs, NULL);
2695
+ if (inst) {
2696
+ #if !defined(SWIG_PYTHON_SLOW_GETSET_THIS)
2697
+ PyObject **dictptr = _PyObject_GetDictPtr(inst);
2698
+ if (dictptr != NULL) {
2699
+ PyObject *dict = *dictptr;
2700
+ if (dict == NULL) {
2701
+ dict = PyDict_New();
2702
+ *dictptr = dict;
2703
+ }
2704
+ if (dict) {
2705
+ PyDict_SetItem(dict, SWIG_This(), swig_this);
2706
+ } else{
2707
+ Py_DECREF(inst);
2708
+ inst = 0;
2709
+ }
2710
+ }
2711
+ #else
2712
+ if (PyObject_SetAttr(inst, SWIG_This(), swig_this) == -1) {
2713
+ Py_DECREF(inst);
2714
+ inst = 0;
2715
+ }
2716
+ #endif
2717
+ }
2718
+ } else {
2719
+ #if PY_VERSION_HEX >= 0x03000000
2720
+ PyObject *empty_args = PyTuple_New(0);
2721
+ if (empty_args) {
2722
+ PyObject *empty_kwargs = PyDict_New();
2723
+ if (empty_kwargs) {
2724
+ #ifndef Py_LIMITED_API
2725
+ newfunc newfn = ((PyTypeObject *)data->newargs)->tp_new;
2726
+ #else
2727
+ newfunc newfn = (newfunc)PyType_GetSlot((PyTypeObject *)data->newargs, Py_tp_new);
2728
+ #endif
2729
+ inst = newfn((PyTypeObject *)data->newargs, empty_args, empty_kwargs);
2730
+ Py_DECREF(empty_kwargs);
2731
+ if (inst) {
2732
+ if (PyObject_SetAttr(inst, SWIG_This(), swig_this) == -1) {
2733
+ Py_DECREF(inst);
2734
+ inst = 0;
2735
+ } else {
2736
+ PyType_Modified(Py_TYPE(inst));
2737
+ }
2738
+ }
2739
+ }
2740
+ Py_DECREF(empty_args);
2741
+ }
2742
+ #else
2743
+ PyObject *dict = PyDict_New();
2744
+ if (dict) {
2745
+ PyDict_SetItem(dict, SWIG_This(), swig_this);
2746
+ inst = PyInstance_NewRaw(data->newargs, dict);
2747
+ Py_DECREF(dict);
2748
+ }
2749
+ #endif
2750
+ }
2751
+ return inst;
2752
+ }
2753
+
2754
+ SWIGRUNTIME int
2755
+ SWIG_Python_SetSwigThis(PyObject *inst, PyObject *swig_this)
2756
+ {
2757
+ #if !defined(SWIG_PYTHON_SLOW_GETSET_THIS)
2758
+ PyObject **dictptr = _PyObject_GetDictPtr(inst);
2759
+ if (dictptr != NULL) {
2760
+ PyObject *dict = *dictptr;
2761
+ if (dict == NULL) {
2762
+ dict = PyDict_New();
2763
+ *dictptr = dict;
2764
+ }
2765
+ if (dict) {
2766
+ return PyDict_SetItem(dict, SWIG_This(), swig_this);
2767
+ } else{
2768
+ return -1;
2769
+ }
2770
+ }
2771
+ #endif
2772
+ return PyObject_SetAttr(inst, SWIG_This(), swig_this);
2773
+ }
2774
+
2775
+
2776
+ SWIGINTERN PyObject *
2777
+ SWIG_Python_InitShadowInstance(PyObject *args) {
2778
+ PyObject *obj[2];
2779
+ if (!SWIG_Python_UnpackTuple(args, "swiginit", 2, 2, obj)) {
2780
+ return NULL;
2781
+ } else {
2782
+ SwigPyObject *sthis = SWIG_Python_GetSwigThis(obj[0]);
2783
+ if (sthis) {
2784
+ Py_DECREF(SwigPyObject_append((PyObject*) sthis, obj[1]));
2785
+ } else {
2786
+ if (SWIG_Python_SetSwigThis(obj[0], obj[1]) != 0)
2787
+ return NULL;
2788
+ }
2789
+ return SWIG_Py_Void();
2790
+ }
2791
+ }
2792
+
2793
+ /* Create a new pointer object */
2794
+
2795
+ SWIGRUNTIME PyObject *
2796
+ SWIG_Python_NewPointerObj(PyObject *self, void *ptr, swig_type_info *type, int flags) {
2797
+ SwigPyClientData *clientdata;
2798
+ PyObject * robj;
2799
+ int own;
2800
+
2801
+ if (!ptr)
2802
+ return SWIG_Py_Void();
2803
+
2804
+ clientdata = type ? (SwigPyClientData *)(type->clientdata) : 0;
2805
+ own = (flags & SWIG_POINTER_OWN) ? SWIG_POINTER_OWN : 0;
2806
+ if (clientdata && clientdata->pytype) {
2807
+ SwigPyObject *newobj;
2808
+ if (flags & SWIG_BUILTIN_TP_INIT) {
2809
+ newobj = (SwigPyObject*) self;
2810
+ if (newobj->ptr) {
2811
+ #ifndef Py_LIMITED_API
2812
+ allocfunc alloc = clientdata->pytype->tp_alloc;
2813
+ #else
2814
+ allocfunc alloc = (allocfunc)PyType_GetSlot(clientdata->pytype, Py_tp_alloc);
2815
+ #endif
2816
+ PyObject *next_self = alloc(clientdata->pytype, 0);
2817
+ while (newobj->next)
2818
+ newobj = (SwigPyObject *) newobj->next;
2819
+ newobj->next = next_self;
2820
+ newobj = (SwigPyObject *)next_self;
2821
+ #ifdef SWIGPYTHON_BUILTIN
2822
+ newobj->dict = 0;
2823
+ #endif
2824
+ }
2825
+ } else {
2826
+ newobj = PyObject_New(SwigPyObject, clientdata->pytype);
2827
+ #ifdef SWIGPYTHON_BUILTIN
2828
+ if (newobj) {
2829
+ newobj->dict = 0;
2830
+ }
2831
+ #endif
2832
+ }
2833
+ if (newobj) {
2834
+ newobj->ptr = ptr;
2835
+ newobj->ty = type;
2836
+ newobj->own = own;
2837
+ newobj->next = 0;
2838
+ return (PyObject*) newobj;
2839
+ }
2840
+ return SWIG_Py_Void();
2841
+ }
2842
+
2843
+ assert(!(flags & SWIG_BUILTIN_TP_INIT));
2844
+
2845
+ robj = SwigPyObject_New(ptr, type, own);
2846
+ if (robj && clientdata && !(flags & SWIG_POINTER_NOSHADOW)) {
2847
+ PyObject *inst = SWIG_Python_NewShadowInstance(clientdata, robj);
2848
+ Py_DECREF(robj);
2849
+ robj = inst;
2850
+ }
2851
+ return robj;
2852
+ }
2853
+
2854
+ /* Create a new packed object */
2855
+
2856
+ SWIGRUNTIMEINLINE PyObject *
2857
+ SWIG_Python_NewPackedObj(void *ptr, size_t sz, swig_type_info *type) {
2858
+ return ptr ? SwigPyPacked_New((void *) ptr, sz, type) : SWIG_Py_Void();
2859
+ }
2860
+
2861
+ /* -----------------------------------------------------------------------------*
2862
+ * Get type list
2863
+ * -----------------------------------------------------------------------------*/
2864
+
2865
+ #ifdef SWIG_LINK_RUNTIME
2866
+ void *SWIG_ReturnGlobalTypeList(void *);
2867
+ #endif
2868
+
2869
+ static PyObject *Swig_TypeCache_global = NULL;
2870
+
2871
+ /* The python cached type query */
2872
+ SWIGRUNTIME PyObject *
2873
+ SWIG_Python_TypeCache(void) {
2874
+ if (Swig_TypeCache_global == NULL) {
2875
+ Swig_TypeCache_global = PyDict_New();
2876
+ }
2877
+ return Swig_TypeCache_global;
2878
+ }
2879
+
2880
+ SWIGRUNTIME swig_module_info *
2881
+ SWIG_Python_GetModule(void *SWIGUNUSEDPARM(clientdata)) {
2882
+ #ifdef SWIG_LINK_RUNTIME
2883
+ static void *type_pointer = (void *)0;
2884
+ /* first check if module already created */
2885
+ if (!type_pointer) {
2886
+ type_pointer = SWIG_ReturnGlobalTypeList((void *)0);
2887
+ }
2888
+ #else
2889
+ void *type_pointer = PyCapsule_Import(SWIGPY_CAPSULE_NAME, 0);
2890
+ if (PyErr_Occurred()) {
2891
+ PyErr_Clear();
2892
+ type_pointer = (void *)0;
2893
+ }
2894
+ #endif
2895
+ return (swig_module_info *) type_pointer;
2896
+ }
2897
+
2898
+
2899
+ static int interpreter_counter = 0; /* how many (sub-)interpreters are using swig_module's types */
2900
+
2901
+ SWIGRUNTIME void
2902
+ SWIG_Python_DestroyModule(PyObject *obj)
2903
+ {
2904
+ swig_module_info *swig_module = (swig_module_info *) PyCapsule_GetPointer(obj, SWIGPY_CAPSULE_NAME);
2905
+ swig_type_info **types = swig_module->types;
2906
+ size_t i;
2907
+ if (--interpreter_counter != 0) /* another sub-interpreter may still be using the swig_module's types */
2908
+ return;
2909
+ for (i =0; i < swig_module->size; ++i) {
2910
+ swig_type_info *ty = types[i];
2911
+ if (ty->owndata) {
2912
+ SwigPyClientData *data = (SwigPyClientData *) ty->clientdata;
2913
+ ty->clientdata = 0;
2914
+ if (data) SwigPyClientData_Del(data);
2915
+ }
2916
+ }
2917
+ Py_DECREF(SWIG_This());
2918
+ Swig_This_global = NULL;
2919
+ Py_DECREF(SWIG_globals());
2920
+ Swig_Globals_global = NULL;
2921
+ Py_DECREF(SWIG_Python_TypeCache());
2922
+ Swig_TypeCache_global = NULL;
2923
+ Swig_Capsule_global = NULL;
2924
+ }
2925
+
2926
+ SWIGRUNTIME void
2927
+ SWIG_Python_SetModule(swig_module_info *swig_module) {
2928
+ #if PY_VERSION_HEX >= 0x03000000
2929
+ /* Add a dummy module object into sys.modules */
2930
+ PyObject *module = PyImport_AddModule("swig_runtime_data" SWIG_RUNTIME_VERSION);
2931
+ #else
2932
+ static PyMethodDef swig_empty_runtime_method_table[] = { {NULL, NULL, 0, NULL} }; /* Sentinel */
2933
+ PyObject *module = Py_InitModule("swig_runtime_data" SWIG_RUNTIME_VERSION, swig_empty_runtime_method_table);
2934
+ #endif
2935
+ PyObject *pointer = PyCapsule_New((void *) swig_module, SWIGPY_CAPSULE_NAME, SWIG_Python_DestroyModule);
2936
+ if (pointer && module) {
2937
+ if (PyModule_AddObject(module, SWIGPY_CAPSULE_ATTR_NAME, pointer) == 0) {
2938
+ ++interpreter_counter;
2939
+ Swig_Capsule_global = pointer;
2940
+ } else {
2941
+ Py_DECREF(pointer);
2942
+ }
2943
+ } else {
2944
+ Py_XDECREF(pointer);
2945
+ }
2946
+ }
2947
+
2948
+ SWIGRUNTIME swig_type_info *
2949
+ SWIG_Python_TypeQuery(const char *type)
2950
+ {
2951
+ PyObject *cache = SWIG_Python_TypeCache();
2952
+ PyObject *key = SWIG_Python_str_FromChar(type);
2953
+ PyObject *obj = PyDict_GetItem(cache, key);
2954
+ swig_type_info *descriptor;
2955
+ if (obj) {
2956
+ descriptor = (swig_type_info *) PyCapsule_GetPointer(obj, NULL);
2957
+ } else {
2958
+ swig_module_info *swig_module = SWIG_GetModule(0);
2959
+ descriptor = SWIG_TypeQueryModule(swig_module, swig_module, type);
2960
+ if (descriptor) {
2961
+ obj = PyCapsule_New((void*) descriptor, NULL, NULL);
2962
+ if (obj) {
2963
+ PyDict_SetItem(cache, key, obj);
2964
+ Py_DECREF(obj);
2965
+ }
2966
+ }
2967
+ }
2968
+ Py_DECREF(key);
2969
+ return descriptor;
2970
+ }
2971
+
2972
+ /*
2973
+ For backward compatibility only
2974
+ */
2975
+ #define SWIG_POINTER_EXCEPTION 0
2976
+ #define SWIG_arg_fail(arg) SWIG_Python_ArgFail(arg)
2977
+ #define SWIG_MustGetPtr(p, type, argnum, flags) SWIG_Python_MustGetPtr(p, type, argnum, flags)
2978
+
2979
+ SWIGRUNTIME int
2980
+ SWIG_Python_AddErrMesg(const char* mesg, int infront)
2981
+ {
2982
+ if (PyErr_Occurred()) {
2983
+ PyObject *type = 0;
2984
+ PyObject *value = 0;
2985
+ PyObject *traceback = 0;
2986
+ PyErr_Fetch(&type, &value, &traceback);
2987
+ if (value) {
2988
+ PyObject *old_str = PyObject_Str(value);
2989
+ PyObject *bytes = NULL;
2990
+ const char *tmp = SWIG_PyUnicode_AsUTF8AndSize(old_str, NULL, &bytes);
2991
+ const char *errmesg = tmp ? tmp : "Invalid error message";
2992
+ Py_XINCREF(type);
2993
+ PyErr_Clear();
2994
+ if (infront) {
2995
+ PyErr_Format(type, "%s %s", mesg, errmesg);
2996
+ } else {
2997
+ PyErr_Format(type, "%s %s", errmesg, mesg);
2998
+ }
2999
+ Py_XDECREF(bytes);
3000
+ Py_DECREF(old_str);
3001
+ }
3002
+ return 1;
3003
+ } else {
3004
+ return 0;
3005
+ }
3006
+ }
3007
+
3008
+ SWIGRUNTIME int
3009
+ SWIG_Python_ArgFail(int argnum)
3010
+ {
3011
+ if (PyErr_Occurred()) {
3012
+ /* add information about failing argument */
3013
+ char mesg[256];
3014
+ PyOS_snprintf(mesg, sizeof(mesg), "argument number %d:", argnum);
3015
+ return SWIG_Python_AddErrMesg(mesg, 1);
3016
+ } else {
3017
+ return 0;
3018
+ }
3019
+ }
3020
+
3021
+ SWIGRUNTIMEINLINE const char *
3022
+ SwigPyObject_GetDesc(PyObject *self)
3023
+ {
3024
+ SwigPyObject *v = (SwigPyObject *)self;
3025
+ swig_type_info *ty = v ? v->ty : 0;
3026
+ return ty ? ty->str : "";
3027
+ }
3028
+
3029
+ SWIGRUNTIME void
3030
+ SWIG_Python_TypeError(const char *type, PyObject *obj)
3031
+ {
3032
+ if (type) {
3033
+ #if defined(SWIG_COBJECT_TYPES)
3034
+ if (obj && SwigPyObject_Check(obj)) {
3035
+ const char *otype = (const char *) SwigPyObject_GetDesc(obj);
3036
+ if (otype) {
3037
+ PyErr_Format(PyExc_TypeError, "a '%s' is expected, 'SwigPyObject(%s)' is received",
3038
+ type, otype);
3039
+ return;
3040
+ }
3041
+ } else
3042
+ #endif
3043
+ {
3044
+ #ifndef Py_LIMITED_API
3045
+ /* tp_name is not accessible */
3046
+ const char *otype = (obj ? obj->ob_type->tp_name : 0);
3047
+ if (otype) {
3048
+ PyObject *str = PyObject_Str(obj);
3049
+ PyObject *bytes = NULL;
3050
+ const char *cstr = str ? SWIG_PyUnicode_AsUTF8AndSize(str, NULL, &bytes) : 0;
3051
+ if (cstr) {
3052
+ PyErr_Format(PyExc_TypeError, "a '%s' is expected, '%s(%s)' is received",
3053
+ type, otype, cstr);
3054
+ } else {
3055
+ PyErr_Format(PyExc_TypeError, "a '%s' is expected, '%s' is received",
3056
+ type, otype);
3057
+ }
3058
+ Py_XDECREF(bytes);
3059
+ Py_XDECREF(str);
3060
+ return;
3061
+ }
3062
+ #endif
3063
+ }
3064
+ PyErr_Format(PyExc_TypeError, "a '%s' is expected", type);
3065
+ } else {
3066
+ PyErr_Format(PyExc_TypeError, "unexpected type is received");
3067
+ }
3068
+ }
3069
+
3070
+
3071
+ /* Convert a pointer value, signal an exception on a type mismatch */
3072
+ SWIGRUNTIME void *
3073
+ SWIG_Python_MustGetPtr(PyObject *obj, swig_type_info *ty, int SWIGUNUSEDPARM(argnum), int flags) {
3074
+ void *result;
3075
+ if (SWIG_Python_ConvertPtr(obj, &result, ty, flags) == -1) {
3076
+ PyErr_Clear();
3077
+ }
3078
+ return result;
3079
+ }
3080
+
3081
+ #ifdef SWIGPYTHON_BUILTIN
3082
+ SWIGRUNTIME int
3083
+ SWIG_Python_NonDynamicSetAttr(PyObject *obj, PyObject *name, PyObject *value) {
3084
+ PyTypeObject *tp = obj->ob_type;
3085
+ PyObject *descr;
3086
+ PyObject *encoded_name;
3087
+ descrsetfunc f;
3088
+ int res = -1;
3089
+
3090
+ # ifdef Py_USING_UNICODE
3091
+ if (PyString_Check(name)) {
3092
+ name = PyUnicode_Decode(PyString_AsString(name), PyString_Size(name), NULL, NULL);
3093
+ if (!name)
3094
+ return -1;
3095
+ } else if (!PyUnicode_Check(name))
3096
+ # else
3097
+ if (!PyString_Check(name))
3098
+ # endif
3099
+ {
3100
+ PyErr_Format(PyExc_TypeError, "attribute name must be string, not '%.200s'", name->ob_type->tp_name);
3101
+ return -1;
3102
+ } else {
3103
+ Py_INCREF(name);
3104
+ }
3105
+
3106
+ if (!tp->tp_dict) {
3107
+ if (PyType_Ready(tp) != 0)
3108
+ goto done;
3109
+ }
3110
+
3111
+ descr = _PyType_Lookup(tp, name);
3112
+ f = NULL;
3113
+ if (descr != NULL)
3114
+ f = descr->ob_type->tp_descr_set;
3115
+ if (!f) {
3116
+ if (PyString_Check(name)) {
3117
+ encoded_name = name;
3118
+ Py_INCREF(name);
3119
+ } else {
3120
+ encoded_name = PyUnicode_AsUTF8String(name);
3121
+ if (!encoded_name)
3122
+ goto done;
3123
+ }
3124
+ PyErr_Format(PyExc_AttributeError, "'%.100s' object has no attribute '%.200s'", tp->tp_name, PyString_AsString(encoded_name));
3125
+ Py_DECREF(encoded_name);
3126
+ } else {
3127
+ res = f(descr, obj, value);
3128
+ }
3129
+
3130
+ done:
3131
+ Py_DECREF(name);
3132
+ return res;
3133
+ }
3134
+ #endif
3135
+
3136
+
3137
+ #ifdef __cplusplus
3138
+ }
3139
+ #endif
3140
+
3141
+
3142
+
3143
+ #define SWIG_exception_fail(code, msg) do { SWIG_Error(code, msg); SWIG_fail; } while(0)
3144
+
3145
+ #define SWIG_contract_assert(expr, msg) do { if (!(expr)) { SWIG_Error(SWIG_RuntimeError, msg); SWIG_fail; } } while (0)
3146
+
3147
+
3148
+
3149
+ /* -------- TYPES TABLE (BEGIN) -------- */
3150
+
3151
+ #define SWIGTYPE_p_char swig_types[0]
3152
+ static swig_type_info *swig_types[2];
3153
+ static swig_module_info swig_module = {swig_types, 1, 0, 0, 0, 0};
3154
+ #define SWIG_TypeQuery(name) SWIG_TypeQueryModule(&swig_module, &swig_module, name)
3155
+ #define SWIG_MangledTypeQuery(name) SWIG_MangledTypeQueryModule(&swig_module, &swig_module, name)
3156
+
3157
+ /* -------- TYPES TABLE (END) -------- */
3158
+
3159
+ #ifdef SWIG_TypeQuery
3160
+ # undef SWIG_TypeQuery
3161
+ #endif
3162
+ #define SWIG_TypeQuery SWIG_Python_TypeQuery
3163
+
3164
+ /*-----------------------------------------------
3165
+ @(target):= _CardanoSigner.so
3166
+ ------------------------------------------------*/
3167
+ #if PY_VERSION_HEX >= 0x03000000
3168
+ # define SWIG_init PyInit__CardanoSigner
3169
+
3170
+ #else
3171
+ # define SWIG_init init_CardanoSigner
3172
+
3173
+ #endif
3174
+ #define SWIG_name "_CardanoSigner"
3175
+
3176
+ #ifdef __cplusplus
3177
+ #include <utility>
3178
+ /* SwigValueWrapper is described in swig.swg */
3179
+ template<typename T> class SwigValueWrapper {
3180
+ struct SwigSmartPointer {
3181
+ T *ptr;
3182
+ SwigSmartPointer(T *p) : ptr(p) { }
3183
+ ~SwigSmartPointer() { delete ptr; }
3184
+ SwigSmartPointer& operator=(SwigSmartPointer& rhs) { T* oldptr = ptr; ptr = 0; delete oldptr; ptr = rhs.ptr; rhs.ptr = 0; return *this; }
3185
+ void reset(T *p) { T* oldptr = ptr; ptr = 0; delete oldptr; ptr = p; }
3186
+ } pointer;
3187
+ SwigValueWrapper& operator=(const SwigValueWrapper<T>& rhs);
3188
+ SwigValueWrapper(const SwigValueWrapper<T>& rhs);
3189
+ public:
3190
+ SwigValueWrapper() : pointer(0) { }
3191
+ SwigValueWrapper& operator=(const T& t) { SwigSmartPointer tmp(new T(t)); pointer = tmp; return *this; }
3192
+ #if __cplusplus >=201103L
3193
+ SwigValueWrapper& operator=(T&& t) { SwigSmartPointer tmp(new T(std::move(t))); pointer = tmp; return *this; }
3194
+ operator T&&() const { return std::move(*pointer.ptr); }
3195
+ #else
3196
+ operator T&() const { return *pointer.ptr; }
3197
+ #endif
3198
+ T *operator&() const { return pointer.ptr; }
3199
+ static void reset(SwigValueWrapper& t, T *p) { t.pointer.reset(p); }
3200
+ };
3201
+
3202
+ /*
3203
+ * SwigValueInit() is a generic initialisation solution as the following approach:
3204
+ *
3205
+ * T c_result = T();
3206
+ *
3207
+ * doesn't compile for all types for example:
3208
+ *
3209
+ * unsigned int c_result = unsigned int();
3210
+ */
3211
+ template <typename T> T SwigValueInit() {
3212
+ return T();
3213
+ }
3214
+
3215
+ #if __cplusplus >=201103L
3216
+ # define SWIG_STD_MOVE(OBJ) std::move(OBJ)
3217
+ #else
3218
+ # define SWIG_STD_MOVE(OBJ) OBJ
3219
+ #endif
3220
+
3221
+ #endif
3222
+
3223
+
3224
+ #define SWIG_as_voidptr(a) const_cast< void * >(static_cast< const void * >(a))
3225
+ #define SWIG_as_voidptrptr(a) ((void)SWIG_as_voidptr(*a),reinterpret_cast< void** >(a))
3226
+
3227
+
3228
+ #include <stdexcept>
3229
+
3230
+
3231
+ namespace swig {
3232
+ class SwigPtr_PyObject {
3233
+ protected:
3234
+ PyObject *_obj;
3235
+
3236
+ public:
3237
+ SwigPtr_PyObject() :_obj(0)
3238
+ {
3239
+ }
3240
+
3241
+ SwigPtr_PyObject(const SwigPtr_PyObject& item) : _obj(item._obj)
3242
+ {
3243
+ SWIG_PYTHON_THREAD_BEGIN_BLOCK;
3244
+ Py_XINCREF(_obj);
3245
+ SWIG_PYTHON_THREAD_END_BLOCK;
3246
+ }
3247
+
3248
+ SwigPtr_PyObject(PyObject *obj, bool initial_ref = true) :_obj(obj)
3249
+ {
3250
+ if (initial_ref) {
3251
+ SWIG_PYTHON_THREAD_BEGIN_BLOCK;
3252
+ Py_XINCREF(_obj);
3253
+ SWIG_PYTHON_THREAD_END_BLOCK;
3254
+ }
3255
+ }
3256
+
3257
+ SwigPtr_PyObject & operator=(const SwigPtr_PyObject& item)
3258
+ {
3259
+ SWIG_PYTHON_THREAD_BEGIN_BLOCK;
3260
+ Py_XINCREF(item._obj);
3261
+ Py_XDECREF(_obj);
3262
+ _obj = item._obj;
3263
+ SWIG_PYTHON_THREAD_END_BLOCK;
3264
+ return *this;
3265
+ }
3266
+
3267
+ ~SwigPtr_PyObject()
3268
+ {
3269
+ SWIG_PYTHON_THREAD_BEGIN_BLOCK;
3270
+ Py_XDECREF(_obj);
3271
+ SWIG_PYTHON_THREAD_END_BLOCK;
3272
+ }
3273
+
3274
+ operator PyObject *() const
3275
+ {
3276
+ return _obj;
3277
+ }
3278
+
3279
+ PyObject *operator->() const
3280
+ {
3281
+ return _obj;
3282
+ }
3283
+ };
3284
+ }
3285
+
3286
+
3287
+ namespace swig {
3288
+ struct SwigVar_PyObject : SwigPtr_PyObject {
3289
+ SwigVar_PyObject(PyObject* obj = 0) : SwigPtr_PyObject(obj, false) { }
3290
+
3291
+ SwigVar_PyObject & operator = (PyObject* obj)
3292
+ {
3293
+ Py_XDECREF(_obj);
3294
+ _obj = obj;
3295
+ return *this;
3296
+ }
3297
+ };
3298
+ }
3299
+
3300
+
3301
+ #include <string>
3302
+
3303
+
3304
+ #define SWIG_FILE_WITH_INIT
3305
+ #include "lib.rs.h"
3306
+ #include "signer.h"
3307
+ #include <string>
3308
+
3309
+
3310
+ SWIGINTERN swig_type_info*
3311
+ SWIG_pchar_descriptor(void)
3312
+ {
3313
+ static int init = 0;
3314
+ static swig_type_info* info = 0;
3315
+ if (!init) {
3316
+ info = SWIG_TypeQuery("_p_char");
3317
+ init = 1;
3318
+ }
3319
+ return info;
3320
+ }
3321
+
3322
+
3323
+ /* Return string from Python obj. NOTE: obj must remain in scope in order
3324
+ to use the returned cptr (but only when alloc is set to SWIG_OLDOBJ) */
3325
+ SWIGINTERN int
3326
+ SWIG_AsCharPtrAndSize(PyObject *obj, char **cptr, size_t *psize, int *alloc)
3327
+ {
3328
+ #if PY_VERSION_HEX>=0x03000000
3329
+ #if defined(SWIG_PYTHON_STRICT_BYTE_CHAR)
3330
+ if (PyBytes_Check(obj))
3331
+ #else
3332
+ if (PyUnicode_Check(obj))
3333
+ #endif
3334
+ #else
3335
+ if (PyString_Check(obj))
3336
+ #endif
3337
+ {
3338
+ char *cstr; Py_ssize_t len;
3339
+ PyObject *bytes = NULL;
3340
+ int ret = SWIG_OK;
3341
+ if (alloc)
3342
+ *alloc = SWIG_OLDOBJ;
3343
+ #if PY_VERSION_HEX>=0x03000000 && defined(SWIG_PYTHON_STRICT_BYTE_CHAR)
3344
+ if (PyBytes_AsStringAndSize(obj, &cstr, &len) == -1)
3345
+ return SWIG_TypeError;
3346
+ #else
3347
+ cstr = (char *)SWIG_PyUnicode_AsUTF8AndSize(obj, &len, &bytes);
3348
+ if (!cstr)
3349
+ return SWIG_TypeError;
3350
+ /* The returned string is only duplicated if the char * returned is not owned and memory managed by obj */
3351
+ if (bytes && cptr) {
3352
+ if (alloc) {
3353
+ cstr = reinterpret_cast< char* >(memcpy(new char[len + 1], cstr, sizeof(char)*(len + 1)));
3354
+ *alloc = SWIG_NEWOBJ;
3355
+ } else {
3356
+ /* alloc must be set in order to clean up allocated memory */
3357
+ return SWIG_RuntimeError;
3358
+ }
3359
+ }
3360
+ #endif
3361
+ if (cptr) *cptr = cstr;
3362
+ if (psize) *psize = len + 1;
3363
+ Py_XDECREF(bytes);
3364
+ return ret;
3365
+ } else {
3366
+ #if defined(SWIG_PYTHON_2_UNICODE)
3367
+ #if defined(SWIG_PYTHON_STRICT_BYTE_CHAR)
3368
+ #error "Cannot use both SWIG_PYTHON_2_UNICODE and SWIG_PYTHON_STRICT_BYTE_CHAR at once"
3369
+ #endif
3370
+ #if PY_VERSION_HEX<0x03000000
3371
+ if (PyUnicode_Check(obj)) {
3372
+ char *cstr; Py_ssize_t len;
3373
+ if (!alloc && cptr) {
3374
+ return SWIG_RuntimeError;
3375
+ }
3376
+ obj = PyUnicode_AsUTF8String(obj);
3377
+ if (!obj)
3378
+ return SWIG_TypeError;
3379
+ if (PyString_AsStringAndSize(obj, &cstr, &len) != -1) {
3380
+ if (cptr) {
3381
+ if (alloc) *alloc = SWIG_NEWOBJ;
3382
+ *cptr = reinterpret_cast< char* >(memcpy(new char[len + 1], cstr, sizeof(char)*(len + 1)));
3383
+ }
3384
+ if (psize) *psize = len + 1;
3385
+
3386
+ Py_XDECREF(obj);
3387
+ return SWIG_OK;
3388
+ } else {
3389
+ Py_XDECREF(obj);
3390
+ }
3391
+ }
3392
+ #endif
3393
+ #endif
3394
+
3395
+ swig_type_info* pchar_descriptor = SWIG_pchar_descriptor();
3396
+ if (pchar_descriptor) {
3397
+ void* vptr = 0;
3398
+ if (SWIG_ConvertPtr(obj, &vptr, pchar_descriptor, 0) == SWIG_OK) {
3399
+ if (cptr) *cptr = (char *) vptr;
3400
+ if (psize) *psize = vptr ? (strlen((char *)vptr) + 1) : 0;
3401
+ if (alloc) *alloc = SWIG_OLDOBJ;
3402
+ return SWIG_OK;
3403
+ }
3404
+ }
3405
+ }
3406
+ return SWIG_TypeError;
3407
+ }
3408
+
3409
+
3410
+ SWIGINTERN int
3411
+ SWIG_AsPtr_std_string (PyObject * obj, std::string **val)
3412
+ {
3413
+ char* buf = 0 ; size_t size = 0; int alloc = SWIG_OLDOBJ;
3414
+ if (SWIG_IsOK((SWIG_AsCharPtrAndSize(obj, &buf, &size, &alloc)))) {
3415
+ if (buf) {
3416
+ if (val) *val = new std::string(buf, size - 1);
3417
+ if (alloc == SWIG_NEWOBJ) delete[] buf;
3418
+ return SWIG_NEWOBJ;
3419
+ } else {
3420
+ if (val) *val = 0;
3421
+ return SWIG_OLDOBJ;
3422
+ }
3423
+ } else {
3424
+ static int init = 0;
3425
+ static swig_type_info* descriptor = 0;
3426
+ if (!init) {
3427
+ descriptor = SWIG_TypeQuery("std::string" " *");
3428
+ init = 1;
3429
+ }
3430
+ if (descriptor) {
3431
+ std::string *vptr;
3432
+ int res = SWIG_ConvertPtr(obj, (void**)&vptr, descriptor, 0);
3433
+ if (SWIG_IsOK(res) && val) *val = vptr;
3434
+ return res;
3435
+ }
3436
+ }
3437
+ return SWIG_ERROR;
3438
+ }
3439
+
3440
+
3441
+ SWIGINTERNINLINE PyObject *
3442
+ SWIG_FromCharPtrAndSize(const char* carray, size_t size)
3443
+ {
3444
+ if (carray) {
3445
+ if (size > INT_MAX) {
3446
+ swig_type_info* pchar_descriptor = SWIG_pchar_descriptor();
3447
+ return pchar_descriptor ?
3448
+ SWIG_InternalNewPointerObj(const_cast< char * >(carray), pchar_descriptor, 0) : SWIG_Py_Void();
3449
+ } else {
3450
+ #if PY_VERSION_HEX >= 0x03000000
3451
+ #if defined(SWIG_PYTHON_STRICT_BYTE_CHAR)
3452
+ return PyBytes_FromStringAndSize(carray, static_cast< Py_ssize_t >(size));
3453
+ #else
3454
+ return PyUnicode_DecodeUTF8(carray, static_cast< Py_ssize_t >(size), "surrogateescape");
3455
+ #endif
3456
+ #else
3457
+ return PyString_FromStringAndSize(carray, static_cast< Py_ssize_t >(size));
3458
+ #endif
3459
+ }
3460
+ } else {
3461
+ return SWIG_Py_Void();
3462
+ }
3463
+ }
3464
+
3465
+
3466
+ SWIGINTERNINLINE PyObject *
3467
+ SWIG_From_std_string (const std::string& s)
3468
+ {
3469
+ return SWIG_FromCharPtrAndSize(s.data(), s.size());
3470
+ }
3471
+
3472
+ #ifdef __cplusplus
3473
+ extern "C" {
3474
+ #endif
3475
+ SWIGINTERN PyObject *_wrap_sign_mnemonic(PyObject *self, PyObject *args) {
3476
+ PyObject *resultobj = 0;
3477
+ std::string arg1 ;
3478
+ std::string arg2 ;
3479
+ std::string arg3 ;
3480
+ PyObject *swig_obj[3] ;
3481
+ std::string result;
3482
+
3483
+ (void)self;
3484
+ if (!SWIG_Python_UnpackTuple(args, "sign_mnemonic", 3, 3, swig_obj)) SWIG_fail;
3485
+ {
3486
+ std::string *ptr = (std::string *)0;
3487
+ int res = SWIG_AsPtr_std_string(swig_obj[0], &ptr);
3488
+ if (!SWIG_IsOK(res) || !ptr) {
3489
+ SWIG_exception_fail(SWIG_ArgError((ptr ? res : SWIG_TypeError)), "in method '" "sign_mnemonic" "', argument " "1"" of type '" "std::string""'");
3490
+ }
3491
+ arg1 = *ptr;
3492
+ if (SWIG_IsNewObj(res)) delete ptr;
3493
+ }
3494
+ {
3495
+ std::string *ptr = (std::string *)0;
3496
+ int res = SWIG_AsPtr_std_string(swig_obj[1], &ptr);
3497
+ if (!SWIG_IsOK(res) || !ptr) {
3498
+ SWIG_exception_fail(SWIG_ArgError((ptr ? res : SWIG_TypeError)), "in method '" "sign_mnemonic" "', argument " "2"" of type '" "std::string""'");
3499
+ }
3500
+ arg2 = *ptr;
3501
+ if (SWIG_IsNewObj(res)) delete ptr;
3502
+ }
3503
+ {
3504
+ std::string *ptr = (std::string *)0;
3505
+ int res = SWIG_AsPtr_std_string(swig_obj[2], &ptr);
3506
+ if (!SWIG_IsOK(res) || !ptr) {
3507
+ SWIG_exception_fail(SWIG_ArgError((ptr ? res : SWIG_TypeError)), "in method '" "sign_mnemonic" "', argument " "3"" of type '" "std::string""'");
3508
+ }
3509
+ arg3 = *ptr;
3510
+ if (SWIG_IsNewObj(res)) delete ptr;
3511
+ }
3512
+ result = sign_mnemonic(SWIG_STD_MOVE(arg1),SWIG_STD_MOVE(arg2),SWIG_STD_MOVE(arg3));
3513
+ resultobj = SWIG_From_std_string(static_cast< std::string >(result));
3514
+ return resultobj;
3515
+ fail:
3516
+ return NULL;
3517
+ }
3518
+
3519
+
3520
+ SWIGINTERN PyObject *_wrap_sign_bech32(PyObject *self, PyObject *args) {
3521
+ PyObject *resultobj = 0;
3522
+ std::string arg1 ;
3523
+ std::string arg2 ;
3524
+ std::string arg3 ;
3525
+ PyObject *swig_obj[3] ;
3526
+ std::string result;
3527
+
3528
+ (void)self;
3529
+ if (!SWIG_Python_UnpackTuple(args, "sign_bech32", 3, 3, swig_obj)) SWIG_fail;
3530
+ {
3531
+ std::string *ptr = (std::string *)0;
3532
+ int res = SWIG_AsPtr_std_string(swig_obj[0], &ptr);
3533
+ if (!SWIG_IsOK(res) || !ptr) {
3534
+ SWIG_exception_fail(SWIG_ArgError((ptr ? res : SWIG_TypeError)), "in method '" "sign_bech32" "', argument " "1"" of type '" "std::string""'");
3535
+ }
3536
+ arg1 = *ptr;
3537
+ if (SWIG_IsNewObj(res)) delete ptr;
3538
+ }
3539
+ {
3540
+ std::string *ptr = (std::string *)0;
3541
+ int res = SWIG_AsPtr_std_string(swig_obj[1], &ptr);
3542
+ if (!SWIG_IsOK(res) || !ptr) {
3543
+ SWIG_exception_fail(SWIG_ArgError((ptr ? res : SWIG_TypeError)), "in method '" "sign_bech32" "', argument " "2"" of type '" "std::string""'");
3544
+ }
3545
+ arg2 = *ptr;
3546
+ if (SWIG_IsNewObj(res)) delete ptr;
3547
+ }
3548
+ {
3549
+ std::string *ptr = (std::string *)0;
3550
+ int res = SWIG_AsPtr_std_string(swig_obj[2], &ptr);
3551
+ if (!SWIG_IsOK(res) || !ptr) {
3552
+ SWIG_exception_fail(SWIG_ArgError((ptr ? res : SWIG_TypeError)), "in method '" "sign_bech32" "', argument " "3"" of type '" "std::string""'");
3553
+ }
3554
+ arg3 = *ptr;
3555
+ if (SWIG_IsNewObj(res)) delete ptr;
3556
+ }
3557
+ result = sign_bech32(SWIG_STD_MOVE(arg1),SWIG_STD_MOVE(arg2),SWIG_STD_MOVE(arg3));
3558
+ resultobj = SWIG_From_std_string(static_cast< std::string >(result));
3559
+ return resultobj;
3560
+ fail:
3561
+ return NULL;
3562
+ }
3563
+
3564
+
3565
+ SWIGINTERN PyObject *_wrap_sign_cli(PyObject *self, PyObject *args) {
3566
+ PyObject *resultobj = 0;
3567
+ std::string arg1 ;
3568
+ std::string arg2 ;
3569
+ PyObject *swig_obj[2] ;
3570
+ std::string result;
3571
+
3572
+ (void)self;
3573
+ if (!SWIG_Python_UnpackTuple(args, "sign_cli", 2, 2, swig_obj)) SWIG_fail;
3574
+ {
3575
+ std::string *ptr = (std::string *)0;
3576
+ int res = SWIG_AsPtr_std_string(swig_obj[0], &ptr);
3577
+ if (!SWIG_IsOK(res) || !ptr) {
3578
+ SWIG_exception_fail(SWIG_ArgError((ptr ? res : SWIG_TypeError)), "in method '" "sign_cli" "', argument " "1"" of type '" "std::string""'");
3579
+ }
3580
+ arg1 = *ptr;
3581
+ if (SWIG_IsNewObj(res)) delete ptr;
3582
+ }
3583
+ {
3584
+ std::string *ptr = (std::string *)0;
3585
+ int res = SWIG_AsPtr_std_string(swig_obj[1], &ptr);
3586
+ if (!SWIG_IsOK(res) || !ptr) {
3587
+ SWIG_exception_fail(SWIG_ArgError((ptr ? res : SWIG_TypeError)), "in method '" "sign_cli" "', argument " "2"" of type '" "std::string""'");
3588
+ }
3589
+ arg2 = *ptr;
3590
+ if (SWIG_IsNewObj(res)) delete ptr;
3591
+ }
3592
+ result = sign_cli(SWIG_STD_MOVE(arg1),SWIG_STD_MOVE(arg2));
3593
+ resultobj = SWIG_From_std_string(static_cast< std::string >(result));
3594
+ return resultobj;
3595
+ fail:
3596
+ return NULL;
3597
+ }
3598
+
3599
+
3600
+ static PyMethodDef SwigMethods[] = {
3601
+ { "sign_mnemonic", _wrap_sign_mnemonic, METH_VARARGS, NULL},
3602
+ { "sign_bech32", _wrap_sign_bech32, METH_VARARGS, NULL},
3603
+ { "sign_cli", _wrap_sign_cli, METH_VARARGS, NULL},
3604
+ { NULL, NULL, 0, NULL }
3605
+ };
3606
+
3607
+
3608
+ /* -------- TYPE CONVERSION AND EQUIVALENCE RULES (BEGIN) -------- */
3609
+
3610
+ static swig_type_info _swigt__p_char = {"_p_char", "char *", 0, 0, (void*)0, 0};
3611
+
3612
+ static swig_type_info *swig_type_initial[] = {
3613
+ &_swigt__p_char,
3614
+ };
3615
+
3616
+ static swig_cast_info _swigc__p_char[] = { {&_swigt__p_char, 0, 0, 0},{0, 0, 0, 0}};
3617
+
3618
+ static swig_cast_info *swig_cast_initial[] = {
3619
+ _swigc__p_char,
3620
+ };
3621
+
3622
+
3623
+ /* -------- TYPE CONVERSION AND EQUIVALENCE RULES (END) -------- */
3624
+
3625
+ static swig_const_info swig_const_table[] = {
3626
+ {0, 0, 0, 0.0, 0, 0}};
3627
+
3628
+ #ifdef __cplusplus
3629
+ }
3630
+ #endif
3631
+ /* -----------------------------------------------------------------------------
3632
+ * Type initialization:
3633
+ * This problem is tough by the requirement that no dynamic
3634
+ * memory is used. Also, since swig_type_info structures store pointers to
3635
+ * swig_cast_info structures and swig_cast_info structures store pointers back
3636
+ * to swig_type_info structures, we need some lookup code at initialization.
3637
+ * The idea is that swig generates all the structures that are needed.
3638
+ * The runtime then collects these partially filled structures.
3639
+ * The SWIG_InitializeModule function takes these initial arrays out of
3640
+ * swig_module, and does all the lookup, filling in the swig_module.types
3641
+ * array with the correct data and linking the correct swig_cast_info
3642
+ * structures together.
3643
+ *
3644
+ * The generated swig_type_info structures are assigned statically to an initial
3645
+ * array. We just loop through that array, and handle each type individually.
3646
+ * First we lookup if this type has been already loaded, and if so, use the
3647
+ * loaded structure instead of the generated one. Then we have to fill in the
3648
+ * cast linked list. The cast data is initially stored in something like a
3649
+ * two-dimensional array. Each row corresponds to a type (there are the same
3650
+ * number of rows as there are in the swig_type_initial array). Each entry in
3651
+ * a column is one of the swig_cast_info structures for that type.
3652
+ * The cast_initial array is actually an array of arrays, because each row has
3653
+ * a variable number of columns. So to actually build the cast linked list,
3654
+ * we find the array of casts associated with the type, and loop through it
3655
+ * adding the casts to the list. The one last trick we need to do is making
3656
+ * sure the type pointer in the swig_cast_info struct is correct.
3657
+ *
3658
+ * First off, we lookup the cast->type name to see if it is already loaded.
3659
+ * There are three cases to handle:
3660
+ * 1) If the cast->type has already been loaded AND the type we are adding
3661
+ * casting info to has not been loaded (it is in this module), THEN we
3662
+ * replace the cast->type pointer with the type pointer that has already
3663
+ * been loaded.
3664
+ * 2) If BOTH types (the one we are adding casting info to, and the
3665
+ * cast->type) are loaded, THEN the cast info has already been loaded by
3666
+ * the previous module so we just ignore it.
3667
+ * 3) Finally, if cast->type has not already been loaded, then we add that
3668
+ * swig_cast_info to the linked list (because the cast->type) pointer will
3669
+ * be correct.
3670
+ * ----------------------------------------------------------------------------- */
3671
+
3672
+ #ifdef __cplusplus
3673
+ extern "C" {
3674
+ #if 0
3675
+ } /* c-mode */
3676
+ #endif
3677
+ #endif
3678
+
3679
+ #if 0
3680
+ #define SWIGRUNTIME_DEBUG
3681
+ #endif
3682
+
3683
+ #ifndef SWIG_INIT_CLIENT_DATA_TYPE
3684
+ #define SWIG_INIT_CLIENT_DATA_TYPE void *
3685
+ #endif
3686
+
3687
+ SWIGRUNTIME void
3688
+ SWIG_InitializeModule(SWIG_INIT_CLIENT_DATA_TYPE clientdata) {
3689
+ size_t i;
3690
+ swig_module_info *module_head, *iter;
3691
+ int init;
3692
+
3693
+ /* check to see if the circular list has been setup, if not, set it up */
3694
+ if (swig_module.next==0) {
3695
+ /* Initialize the swig_module */
3696
+ swig_module.type_initial = swig_type_initial;
3697
+ swig_module.cast_initial = swig_cast_initial;
3698
+ swig_module.next = &swig_module;
3699
+ init = 1;
3700
+ } else {
3701
+ init = 0;
3702
+ }
3703
+
3704
+ /* Try and load any already created modules */
3705
+ module_head = SWIG_GetModule(clientdata);
3706
+ if (!module_head) {
3707
+ /* This is the first module loaded for this interpreter */
3708
+ /* so set the swig module into the interpreter */
3709
+ SWIG_SetModule(clientdata, &swig_module);
3710
+ } else {
3711
+ /* the interpreter has loaded a SWIG module, but has it loaded this one? */
3712
+ iter=module_head;
3713
+ do {
3714
+ if (iter==&swig_module) {
3715
+ /* Our module is already in the list, so there's nothing more to do. */
3716
+ return;
3717
+ }
3718
+ iter=iter->next;
3719
+ } while (iter!= module_head);
3720
+
3721
+ /* otherwise we must add our module into the list */
3722
+ swig_module.next = module_head->next;
3723
+ module_head->next = &swig_module;
3724
+ }
3725
+
3726
+ /* When multiple interpreters are used, a module could have already been initialized in
3727
+ a different interpreter, but not yet have a pointer in this interpreter.
3728
+ In this case, we do not want to continue adding types... everything should be
3729
+ set up already */
3730
+ if (init == 0) return;
3731
+
3732
+ /* Now work on filling in swig_module.types */
3733
+ #ifdef SWIGRUNTIME_DEBUG
3734
+ printf("SWIG_InitializeModule: size %lu\n", (unsigned long)swig_module.size);
3735
+ #endif
3736
+ for (i = 0; i < swig_module.size; ++i) {
3737
+ swig_type_info *type = 0;
3738
+ swig_type_info *ret;
3739
+ swig_cast_info *cast;
3740
+
3741
+ #ifdef SWIGRUNTIME_DEBUG
3742
+ printf("SWIG_InitializeModule: type %lu %s\n", (unsigned long)i, swig_module.type_initial[i]->name);
3743
+ #endif
3744
+
3745
+ /* if there is another module already loaded */
3746
+ if (swig_module.next != &swig_module) {
3747
+ type = SWIG_MangledTypeQueryModule(swig_module.next, &swig_module, swig_module.type_initial[i]->name);
3748
+ }
3749
+ if (type) {
3750
+ /* Overwrite clientdata field */
3751
+ #ifdef SWIGRUNTIME_DEBUG
3752
+ printf("SWIG_InitializeModule: found type %s\n", type->name);
3753
+ #endif
3754
+ if (swig_module.type_initial[i]->clientdata) {
3755
+ type->clientdata = swig_module.type_initial[i]->clientdata;
3756
+ #ifdef SWIGRUNTIME_DEBUG
3757
+ printf("SWIG_InitializeModule: found and overwrite type %s \n", type->name);
3758
+ #endif
3759
+ }
3760
+ } else {
3761
+ type = swig_module.type_initial[i];
3762
+ }
3763
+
3764
+ /* Insert casting types */
3765
+ cast = swig_module.cast_initial[i];
3766
+ while (cast->type) {
3767
+ /* Don't need to add information already in the list */
3768
+ ret = 0;
3769
+ #ifdef SWIGRUNTIME_DEBUG
3770
+ printf("SWIG_InitializeModule: look cast %s\n", cast->type->name);
3771
+ #endif
3772
+ if (swig_module.next != &swig_module) {
3773
+ ret = SWIG_MangledTypeQueryModule(swig_module.next, &swig_module, cast->type->name);
3774
+ #ifdef SWIGRUNTIME_DEBUG
3775
+ if (ret) printf("SWIG_InitializeModule: found cast %s\n", ret->name);
3776
+ #endif
3777
+ }
3778
+ if (ret) {
3779
+ if (type == swig_module.type_initial[i]) {
3780
+ #ifdef SWIGRUNTIME_DEBUG
3781
+ printf("SWIG_InitializeModule: skip old type %s\n", ret->name);
3782
+ #endif
3783
+ cast->type = ret;
3784
+ ret = 0;
3785
+ } else {
3786
+ /* Check for casting already in the list */
3787
+ swig_cast_info *ocast = SWIG_TypeCheck(ret->name, type);
3788
+ #ifdef SWIGRUNTIME_DEBUG
3789
+ if (ocast) printf("SWIG_InitializeModule: skip old cast %s\n", ret->name);
3790
+ #endif
3791
+ if (!ocast) ret = 0;
3792
+ }
3793
+ }
3794
+
3795
+ if (!ret) {
3796
+ #ifdef SWIGRUNTIME_DEBUG
3797
+ printf("SWIG_InitializeModule: adding cast %s\n", cast->type->name);
3798
+ #endif
3799
+ if (type->cast) {
3800
+ type->cast->prev = cast;
3801
+ cast->next = type->cast;
3802
+ }
3803
+ type->cast = cast;
3804
+ }
3805
+ cast++;
3806
+ }
3807
+ /* Set entry in modules->types array equal to the type */
3808
+ swig_module.types[i] = type;
3809
+ }
3810
+ swig_module.types[i] = 0;
3811
+
3812
+ #ifdef SWIGRUNTIME_DEBUG
3813
+ printf("**** SWIG_InitializeModule: Cast List ******\n");
3814
+ for (i = 0; i < swig_module.size; ++i) {
3815
+ int j = 0;
3816
+ swig_cast_info *cast = swig_module.cast_initial[i];
3817
+ printf("SWIG_InitializeModule: type %lu %s\n", (unsigned long)i, swig_module.type_initial[i]->name);
3818
+ while (cast->type) {
3819
+ printf("SWIG_InitializeModule: cast type %s\n", cast->type->name);
3820
+ cast++;
3821
+ ++j;
3822
+ }
3823
+ printf("---- Total casts: %d\n",j);
3824
+ }
3825
+ printf("**** SWIG_InitializeModule: Cast List ******\n");
3826
+ #endif
3827
+ }
3828
+
3829
+ /* This function will propagate the clientdata field of type to
3830
+ * any new swig_type_info structures that have been added into the list
3831
+ * of equivalent types. It is like calling
3832
+ * SWIG_TypeClientData(type, clientdata) a second time.
3833
+ */
3834
+ SWIGRUNTIME void
3835
+ SWIG_PropagateClientData(void) {
3836
+ size_t i;
3837
+ swig_cast_info *equiv;
3838
+ static int init_run = 0;
3839
+
3840
+ if (init_run) return;
3841
+ init_run = 1;
3842
+
3843
+ for (i = 0; i < swig_module.size; i++) {
3844
+ if (swig_module.types[i]->clientdata) {
3845
+ equiv = swig_module.types[i]->cast;
3846
+ while (equiv) {
3847
+ if (!equiv->converter) {
3848
+ if (equiv->type && !equiv->type->clientdata)
3849
+ SWIG_TypeClientData(equiv->type, swig_module.types[i]->clientdata);
3850
+ }
3851
+ equiv = equiv->next;
3852
+ }
3853
+ }
3854
+ }
3855
+ }
3856
+
3857
+ #ifdef __cplusplus
3858
+ #if 0
3859
+ {
3860
+ /* c-mode */
3861
+ #endif
3862
+ }
3863
+ #endif
3864
+
3865
+
3866
+
3867
+ #ifdef __cplusplus
3868
+ extern "C" {
3869
+ #endif
3870
+
3871
+ /* -----------------------------------------------------------------------------
3872
+ * constants/methods manipulation
3873
+ * ----------------------------------------------------------------------------- */
3874
+
3875
+ /* Install Constants */
3876
+ SWIGINTERN void
3877
+ SWIG_Python_InstallConstants(PyObject *d, swig_const_info constants[]) {
3878
+ PyObject *obj = 0;
3879
+ size_t i;
3880
+ for (i = 0; constants[i].type; ++i) {
3881
+ switch(constants[i].type) {
3882
+ case SWIG_PY_POINTER:
3883
+ obj = SWIG_InternalNewPointerObj(constants[i].pvalue, *(constants[i]).ptype,0);
3884
+ break;
3885
+ case SWIG_PY_BINARY:
3886
+ obj = SWIG_NewPackedObj(constants[i].pvalue, constants[i].lvalue, *(constants[i].ptype));
3887
+ break;
3888
+ default:
3889
+ obj = 0;
3890
+ break;
3891
+ }
3892
+ if (obj) {
3893
+ PyDict_SetItemString(d, constants[i].name, obj);
3894
+ Py_DECREF(obj);
3895
+ }
3896
+ }
3897
+ }
3898
+
3899
+ /* -----------------------------------------------------------------------------
3900
+ * Patch %callback methods' docstrings to hold the callback ptrs
3901
+ * -----------------------------------------------------------------------------*/
3902
+
3903
+ SWIGINTERN void
3904
+ SWIG_Python_FixMethods(PyMethodDef *methods, const swig_const_info *const_table, swig_type_info **types, swig_type_info **types_initial) {
3905
+ size_t i;
3906
+ for (i = 0; methods[i].ml_name; ++i) {
3907
+ const char *c = methods[i].ml_doc;
3908
+ if (!c) continue;
3909
+ c = strstr(c, "swig_ptr: ");
3910
+ if (c) {
3911
+ int j;
3912
+ const swig_const_info *ci = 0;
3913
+ const char *name = c + 10;
3914
+ for (j = 0; const_table[j].type; ++j) {
3915
+ if (strncmp(const_table[j].name, name,
3916
+ strlen(const_table[j].name)) == 0) {
3917
+ ci = &(const_table[j]);
3918
+ break;
3919
+ }
3920
+ }
3921
+ if (ci) {
3922
+ void *ptr = (ci->type == SWIG_PY_POINTER) ? ci->pvalue : 0;
3923
+ if (ptr) {
3924
+ size_t shift = (ci->ptype) - types;
3925
+ swig_type_info *ty = types_initial[shift];
3926
+ size_t ldoc = (c - methods[i].ml_doc);
3927
+ size_t lptr = strlen(ty->name)+2*sizeof(void*)+2;
3928
+ char *ndoc = (char*)malloc(ldoc + lptr + 10);
3929
+ if (ndoc) {
3930
+ char *buff = ndoc;
3931
+ memcpy(buff, methods[i].ml_doc, ldoc);
3932
+ buff += ldoc;
3933
+ memcpy(buff, "swig_ptr: ", 10);
3934
+ buff += 10;
3935
+ SWIG_PackVoidPtr(buff, ptr, ty->name, lptr);
3936
+ methods[i].ml_doc = ndoc;
3937
+ }
3938
+ }
3939
+ }
3940
+ }
3941
+ }
3942
+ }
3943
+
3944
+ #ifdef __cplusplus
3945
+ }
3946
+ #endif
3947
+
3948
+
3949
+
3950
+
3951
+ /* -----------------------------------------------------------------------------*
3952
+ * Partial Init method
3953
+ * -----------------------------------------------------------------------------*/
3954
+
3955
+ #ifdef __cplusplus
3956
+ extern "C"
3957
+ #endif
3958
+
3959
+ SWIGEXPORT
3960
+ #if PY_VERSION_HEX >= 0x03000000
3961
+ PyObject*
3962
+ #else
3963
+ void
3964
+ #endif
3965
+ SWIG_init(void) {
3966
+ PyObject *m, *d, *md, *globals;
3967
+
3968
+ #if PY_VERSION_HEX >= 0x03000000
3969
+ static struct PyModuleDef SWIG_module = {
3970
+ PyModuleDef_HEAD_INIT,
3971
+ SWIG_name,
3972
+ NULL,
3973
+ -1,
3974
+ SwigMethods,
3975
+ NULL,
3976
+ NULL,
3977
+ NULL,
3978
+ NULL
3979
+ };
3980
+ #endif
3981
+
3982
+ #if defined(SWIGPYTHON_BUILTIN)
3983
+ static SwigPyClientData SwigPyObject_clientdata = {
3984
+ 0, 0, 0, 0, 0, 0, 0
3985
+ };
3986
+ static PyGetSetDef this_getset_def = {
3987
+ (char *)"this", &SwigPyBuiltin_ThisClosure, NULL, NULL, NULL
3988
+ };
3989
+ static SwigPyGetSet thisown_getset_closure = {
3990
+ SwigPyObject_own,
3991
+ SwigPyObject_own
3992
+ };
3993
+ static PyGetSetDef thisown_getset_def = {
3994
+ (char *)"thisown", SwigPyBuiltin_GetterClosure, SwigPyBuiltin_SetterClosure, NULL, &thisown_getset_closure
3995
+ };
3996
+ PyTypeObject *builtin_pytype;
3997
+ int builtin_base_count;
3998
+ swig_type_info *builtin_basetype;
3999
+ PyObject *tuple;
4000
+ PyGetSetDescrObject *static_getset;
4001
+ PyTypeObject *metatype;
4002
+ PyTypeObject *swigpyobject;
4003
+ SwigPyClientData *cd;
4004
+ PyObject *public_interface, *public_symbol;
4005
+ PyObject *this_descr;
4006
+ PyObject *thisown_descr;
4007
+ PyObject *self = 0;
4008
+ int i;
4009
+
4010
+ (void)builtin_pytype;
4011
+ (void)builtin_base_count;
4012
+ (void)builtin_basetype;
4013
+ (void)tuple;
4014
+ (void)static_getset;
4015
+ (void)self;
4016
+
4017
+ /* Metaclass is used to implement static member variables */
4018
+ metatype = SwigPyObjectType();
4019
+ assert(metatype);
4020
+ #endif
4021
+
4022
+ (void)globals;
4023
+
4024
+ /* Create singletons now to avoid potential deadlocks with multi-threaded usage after module initialization */
4025
+ SWIG_This();
4026
+ SWIG_Python_TypeCache();
4027
+ SwigPyPacked_type();
4028
+ #ifndef SWIGPYTHON_BUILTIN
4029
+ SwigPyObject_type();
4030
+ #endif
4031
+
4032
+ /* Fix SwigMethods to carry the callback ptrs when needed */
4033
+ SWIG_Python_FixMethods(SwigMethods, swig_const_table, swig_types, swig_type_initial);
4034
+
4035
+ #if PY_VERSION_HEX >= 0x03000000
4036
+ m = PyModule_Create(&SWIG_module);
4037
+ #else
4038
+ m = Py_InitModule(SWIG_name, SwigMethods);
4039
+ #endif
4040
+
4041
+ md = d = PyModule_GetDict(m);
4042
+ (void)md;
4043
+
4044
+ SWIG_InitializeModule(0);
4045
+
4046
+ #ifdef SWIGPYTHON_BUILTIN
4047
+ swigpyobject = SwigPyObject_TypeOnce();
4048
+
4049
+ SwigPyObject_stype = SWIG_MangledTypeQuery("_p_SwigPyObject");
4050
+ assert(SwigPyObject_stype);
4051
+ cd = (SwigPyClientData*) SwigPyObject_stype->clientdata;
4052
+ if (!cd) {
4053
+ SwigPyObject_stype->clientdata = &SwigPyObject_clientdata;
4054
+ SwigPyObject_clientdata.pytype = swigpyobject;
4055
+ } else if (swigpyobject->tp_basicsize != cd->pytype->tp_basicsize) {
4056
+ PyErr_SetString(PyExc_RuntimeError, "Import error: attempted to load two incompatible swig-generated modules.");
4057
+ # if PY_VERSION_HEX >= 0x03000000
4058
+ return NULL;
4059
+ # else
4060
+ return;
4061
+ # endif
4062
+ }
4063
+
4064
+ /* All objects have a 'this' attribute */
4065
+ this_descr = PyDescr_NewGetSet(SwigPyObject_type(), &this_getset_def);
4066
+ (void)this_descr;
4067
+
4068
+ /* All objects have a 'thisown' attribute */
4069
+ thisown_descr = PyDescr_NewGetSet(SwigPyObject_type(), &thisown_getset_def);
4070
+ (void)thisown_descr;
4071
+
4072
+ public_interface = PyList_New(0);
4073
+ public_symbol = 0;
4074
+ (void)public_symbol;
4075
+
4076
+ PyDict_SetItemString(md, "__all__", public_interface);
4077
+ Py_DECREF(public_interface);
4078
+ for (i = 0; SwigMethods[i].ml_name != NULL; ++i)
4079
+ SwigPyBuiltin_AddPublicSymbol(public_interface, SwigMethods[i].ml_name);
4080
+ for (i = 0; swig_const_table[i].name != 0; ++i)
4081
+ SwigPyBuiltin_AddPublicSymbol(public_interface, swig_const_table[i].name);
4082
+ #endif
4083
+
4084
+ SWIG_InstallConstants(d,swig_const_table);
4085
+
4086
+ #if PY_VERSION_HEX >= 0x03000000
4087
+ return m;
4088
+ #else
4089
+ return;
4090
+ #endif
4091
+ }
4092
+