Philip Howard | 567ee00 | 2013-03-27 22:22:00 +0000 | [diff] [blame] | 1 | /* ---------------------------------------------------------------------------- |
| 2 | * This file was automatically generated by SWIG (http://www.swig.org). |
| 3 | * Version 2.0.7 |
| 4 | * |
| 5 | * This file is not intended to be easily readable and contains a number of |
| 6 | * coding conventions designed to improve portability and efficiency. Do not make |
| 7 | * changes to this file unless you know what you are doing--modify the SWIG |
| 8 | * interface file instead. |
| 9 | * ----------------------------------------------------------------------------- */ |
| 10 | |
| 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 (__GNUC__ >= 4) || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4) |
| 82 | # ifndef GCC_HASCLASSVISIBILITY |
| 83 | # define GCC_HASCLASSVISIBILITY |
| 84 | # endif |
| 85 | #endif |
| 86 | |
| 87 | #ifndef SWIGEXPORT |
| 88 | # if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__) |
| 89 | # if defined(STATIC_LINKED) |
| 90 | # define SWIGEXPORT |
| 91 | # else |
| 92 | # define SWIGEXPORT __declspec(dllexport) |
| 93 | # endif |
| 94 | # else |
| 95 | # if defined(__GNUC__) && defined(GCC_HASCLASSVISIBILITY) |
| 96 | # define SWIGEXPORT __attribute__ ((visibility("default"))) |
| 97 | # else |
| 98 | # define SWIGEXPORT |
| 99 | # endif |
| 100 | # endif |
| 101 | #endif |
| 102 | |
| 103 | /* calling conventions for Windows */ |
| 104 | #ifndef SWIGSTDCALL |
| 105 | # if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__) |
| 106 | # define SWIGSTDCALL __stdcall |
| 107 | # else |
| 108 | # define SWIGSTDCALL |
| 109 | # endif |
| 110 | #endif |
| 111 | |
| 112 | /* Deal with Microsoft's attempt at deprecating C standard runtime functions */ |
| 113 | #if !defined(SWIG_NO_CRT_SECURE_NO_DEPRECATE) && defined(_MSC_VER) && !defined(_CRT_SECURE_NO_DEPRECATE) |
| 114 | # define _CRT_SECURE_NO_DEPRECATE |
| 115 | #endif |
| 116 | |
| 117 | /* Deal with Microsoft's attempt at deprecating methods in the standard C++ library */ |
| 118 | #if !defined(SWIG_NO_SCL_SECURE_NO_DEPRECATE) && defined(_MSC_VER) && !defined(_SCL_SECURE_NO_DEPRECATE) |
| 119 | # define _SCL_SECURE_NO_DEPRECATE |
| 120 | #endif |
| 121 | |
| 122 | |
| 123 | |
| 124 | /* Python.h has to appear first */ |
| 125 | #include <Python.h> |
| 126 | |
| 127 | /* ----------------------------------------------------------------------------- |
| 128 | * swigrun.swg |
| 129 | * |
| 130 | * This file contains generic C API SWIG runtime support for pointer |
| 131 | * type checking. |
| 132 | * ----------------------------------------------------------------------------- */ |
| 133 | |
| 134 | /* This should only be incremented when either the layout of swig_type_info changes, |
| 135 | or for whatever reason, the runtime changes incompatibly */ |
| 136 | #define SWIG_RUNTIME_VERSION "4" |
| 137 | |
| 138 | /* define SWIG_TYPE_TABLE_NAME as "SWIG_TYPE_TABLE" */ |
| 139 | #ifdef SWIG_TYPE_TABLE |
| 140 | # define SWIG_QUOTE_STRING(x) #x |
| 141 | # define SWIG_EXPAND_AND_QUOTE_STRING(x) SWIG_QUOTE_STRING(x) |
| 142 | # define SWIG_TYPE_TABLE_NAME SWIG_EXPAND_AND_QUOTE_STRING(SWIG_TYPE_TABLE) |
| 143 | #else |
| 144 | # define SWIG_TYPE_TABLE_NAME |
| 145 | #endif |
| 146 | |
| 147 | /* |
| 148 | You can use the SWIGRUNTIME and SWIGRUNTIMEINLINE macros for |
| 149 | creating a static or dynamic library from the SWIG runtime code. |
| 150 | In 99.9% of the cases, SWIG just needs to declare them as 'static'. |
| 151 | |
| 152 | But only do this if strictly necessary, ie, if you have problems |
| 153 | with your compiler or suchlike. |
| 154 | */ |
| 155 | |
| 156 | #ifndef SWIGRUNTIME |
| 157 | # define SWIGRUNTIME SWIGINTERN |
| 158 | #endif |
| 159 | |
| 160 | #ifndef SWIGRUNTIMEINLINE |
| 161 | # define SWIGRUNTIMEINLINE SWIGRUNTIME SWIGINLINE |
| 162 | #endif |
| 163 | |
| 164 | /* Generic buffer size */ |
| 165 | #ifndef SWIG_BUFFER_SIZE |
| 166 | # define SWIG_BUFFER_SIZE 1024 |
| 167 | #endif |
| 168 | |
| 169 | /* Flags for pointer conversions */ |
| 170 | #define SWIG_POINTER_DISOWN 0x1 |
| 171 | #define SWIG_CAST_NEW_MEMORY 0x2 |
| 172 | |
| 173 | /* Flags for new pointer objects */ |
| 174 | #define SWIG_POINTER_OWN 0x1 |
| 175 | |
| 176 | |
| 177 | /* |
| 178 | Flags/methods for returning states. |
| 179 | |
| 180 | The SWIG conversion methods, as ConvertPtr, return an integer |
| 181 | that tells if the conversion was successful or not. And if not, |
| 182 | an error code can be returned (see swigerrors.swg for the codes). |
| 183 | |
| 184 | Use the following macros/flags to set or process the returning |
| 185 | states. |
| 186 | |
| 187 | In old versions of SWIG, code such as the following was usually written: |
| 188 | |
| 189 | if (SWIG_ConvertPtr(obj,vptr,ty.flags) != -1) { |
| 190 | // success code |
| 191 | } else { |
| 192 | //fail code |
| 193 | } |
| 194 | |
| 195 | Now you can be more explicit: |
| 196 | |
| 197 | int res = SWIG_ConvertPtr(obj,vptr,ty.flags); |
| 198 | if (SWIG_IsOK(res)) { |
| 199 | // success code |
| 200 | } else { |
| 201 | // fail code |
| 202 | } |
| 203 | |
| 204 | which is the same really, but now you can also do |
| 205 | |
| 206 | Type *ptr; |
| 207 | int res = SWIG_ConvertPtr(obj,(void **)(&ptr),ty.flags); |
| 208 | if (SWIG_IsOK(res)) { |
| 209 | // success code |
| 210 | if (SWIG_IsNewObj(res) { |
| 211 | ... |
| 212 | delete *ptr; |
| 213 | } else { |
| 214 | ... |
| 215 | } |
| 216 | } else { |
| 217 | // fail code |
| 218 | } |
| 219 | |
| 220 | I.e., now SWIG_ConvertPtr can return new objects and you can |
| 221 | identify the case and take care of the deallocation. Of course that |
| 222 | also requires SWIG_ConvertPtr to return new result values, such as |
| 223 | |
| 224 | int SWIG_ConvertPtr(obj, ptr,...) { |
| 225 | if (<obj is ok>) { |
| 226 | if (<need new object>) { |
| 227 | *ptr = <ptr to new allocated object>; |
| 228 | return SWIG_NEWOBJ; |
| 229 | } else { |
| 230 | *ptr = <ptr to old object>; |
| 231 | return SWIG_OLDOBJ; |
| 232 | } |
| 233 | } else { |
| 234 | return SWIG_BADOBJ; |
| 235 | } |
| 236 | } |
| 237 | |
| 238 | Of course, returning the plain '0(success)/-1(fail)' still works, but you can be |
| 239 | more explicit by returning SWIG_BADOBJ, SWIG_ERROR or any of the |
| 240 | SWIG errors code. |
| 241 | |
| 242 | Finally, if the SWIG_CASTRANK_MODE is enabled, the result code |
| 243 | allows to return the 'cast rank', for example, if you have this |
| 244 | |
| 245 | int food(double) |
| 246 | int fooi(int); |
| 247 | |
| 248 | and you call |
| 249 | |
| 250 | food(1) // cast rank '1' (1 -> 1.0) |
| 251 | fooi(1) // cast rank '0' |
| 252 | |
| 253 | just use the SWIG_AddCast()/SWIG_CheckState() |
| 254 | */ |
| 255 | |
| 256 | #define SWIG_OK (0) |
| 257 | #define SWIG_ERROR (-1) |
| 258 | #define SWIG_IsOK(r) (r >= 0) |
| 259 | #define SWIG_ArgError(r) ((r != SWIG_ERROR) ? r : SWIG_TypeError) |
| 260 | |
| 261 | /* The CastRankLimit says how many bits are used for the cast rank */ |
| 262 | #define SWIG_CASTRANKLIMIT (1 << 8) |
| 263 | /* The NewMask denotes the object was created (using new/malloc) */ |
| 264 | #define SWIG_NEWOBJMASK (SWIG_CASTRANKLIMIT << 1) |
| 265 | /* The TmpMask is for in/out typemaps that use temporal objects */ |
| 266 | #define SWIG_TMPOBJMASK (SWIG_NEWOBJMASK << 1) |
| 267 | /* Simple returning values */ |
| 268 | #define SWIG_BADOBJ (SWIG_ERROR) |
| 269 | #define SWIG_OLDOBJ (SWIG_OK) |
| 270 | #define SWIG_NEWOBJ (SWIG_OK | SWIG_NEWOBJMASK) |
| 271 | #define SWIG_TMPOBJ (SWIG_OK | SWIG_TMPOBJMASK) |
| 272 | /* Check, add and del mask methods */ |
| 273 | #define SWIG_AddNewMask(r) (SWIG_IsOK(r) ? (r | SWIG_NEWOBJMASK) : r) |
| 274 | #define SWIG_DelNewMask(r) (SWIG_IsOK(r) ? (r & ~SWIG_NEWOBJMASK) : r) |
| 275 | #define SWIG_IsNewObj(r) (SWIG_IsOK(r) && (r & SWIG_NEWOBJMASK)) |
| 276 | #define SWIG_AddTmpMask(r) (SWIG_IsOK(r) ? (r | SWIG_TMPOBJMASK) : r) |
| 277 | #define SWIG_DelTmpMask(r) (SWIG_IsOK(r) ? (r & ~SWIG_TMPOBJMASK) : r) |
| 278 | #define SWIG_IsTmpObj(r) (SWIG_IsOK(r) && (r & SWIG_TMPOBJMASK)) |
| 279 | |
| 280 | /* Cast-Rank Mode */ |
| 281 | #if defined(SWIG_CASTRANK_MODE) |
| 282 | # ifndef SWIG_TypeRank |
| 283 | # define SWIG_TypeRank unsigned long |
| 284 | # endif |
| 285 | # ifndef SWIG_MAXCASTRANK /* Default cast allowed */ |
| 286 | # define SWIG_MAXCASTRANK (2) |
| 287 | # endif |
| 288 | # define SWIG_CASTRANKMASK ((SWIG_CASTRANKLIMIT) -1) |
| 289 | # define SWIG_CastRank(r) (r & SWIG_CASTRANKMASK) |
| 290 | SWIGINTERNINLINE int SWIG_AddCast(int r) { |
| 291 | return SWIG_IsOK(r) ? ((SWIG_CastRank(r) < SWIG_MAXCASTRANK) ? (r + 1) : SWIG_ERROR) : r; |
| 292 | } |
| 293 | SWIGINTERNINLINE int SWIG_CheckState(int r) { |
| 294 | return SWIG_IsOK(r) ? SWIG_CastRank(r) + 1 : 0; |
| 295 | } |
| 296 | #else /* no cast-rank mode */ |
| 297 | # define SWIG_AddCast |
| 298 | # define SWIG_CheckState(r) (SWIG_IsOK(r) ? 1 : 0) |
| 299 | #endif |
| 300 | |
| 301 | |
| 302 | #include <string.h> |
| 303 | |
| 304 | #ifdef __cplusplus |
| 305 | extern "C" { |
| 306 | #endif |
| 307 | |
| 308 | typedef void *(*swig_converter_func)(void *, int *); |
| 309 | typedef struct swig_type_info *(*swig_dycast_func)(void **); |
| 310 | |
| 311 | /* Structure to store information on one type */ |
| 312 | typedef struct swig_type_info { |
| 313 | const char *name; /* mangled name of this type */ |
| 314 | const char *str; /* human readable name of this type */ |
| 315 | swig_dycast_func dcast; /* dynamic cast function down a hierarchy */ |
| 316 | struct swig_cast_info *cast; /* linked list of types that can cast into this type */ |
| 317 | void *clientdata; /* language specific type data */ |
| 318 | int owndata; /* flag if the structure owns the clientdata */ |
| 319 | } swig_type_info; |
| 320 | |
| 321 | /* Structure to store a type and conversion function used for casting */ |
| 322 | typedef struct swig_cast_info { |
| 323 | swig_type_info *type; /* pointer to type that is equivalent to this type */ |
| 324 | swig_converter_func converter; /* function to cast the void pointers */ |
| 325 | struct swig_cast_info *next; /* pointer to next cast in linked list */ |
| 326 | struct swig_cast_info *prev; /* pointer to the previous cast */ |
| 327 | } swig_cast_info; |
| 328 | |
| 329 | /* Structure used to store module information |
| 330 | * Each module generates one structure like this, and the runtime collects |
| 331 | * all of these structures and stores them in a circularly linked list.*/ |
| 332 | typedef struct swig_module_info { |
| 333 | swig_type_info **types; /* Array of pointers to swig_type_info structures that are in this module */ |
| 334 | size_t size; /* Number of types in this module */ |
| 335 | struct swig_module_info *next; /* Pointer to next element in circularly linked list */ |
| 336 | swig_type_info **type_initial; /* Array of initially generated type structures */ |
| 337 | swig_cast_info **cast_initial; /* Array of initially generated casting structures */ |
| 338 | void *clientdata; /* Language specific module data */ |
| 339 | } swig_module_info; |
| 340 | |
| 341 | /* |
| 342 | Compare two type names skipping the space characters, therefore |
| 343 | "char*" == "char *" and "Class<int>" == "Class<int >", etc. |
| 344 | |
| 345 | Return 0 when the two name types are equivalent, as in |
| 346 | strncmp, but skipping ' '. |
| 347 | */ |
| 348 | SWIGRUNTIME int |
| 349 | SWIG_TypeNameComp(const char *f1, const char *l1, |
| 350 | const char *f2, const char *l2) { |
| 351 | for (;(f1 != l1) && (f2 != l2); ++f1, ++f2) { |
| 352 | while ((*f1 == ' ') && (f1 != l1)) ++f1; |
| 353 | while ((*f2 == ' ') && (f2 != l2)) ++f2; |
| 354 | if (*f1 != *f2) return (*f1 > *f2) ? 1 : -1; |
| 355 | } |
| 356 | return (int)((l1 - f1) - (l2 - f2)); |
| 357 | } |
| 358 | |
| 359 | /* |
| 360 | Check type equivalence in a name list like <name1>|<name2>|... |
| 361 | Return 0 if not equal, 1 if equal |
| 362 | */ |
| 363 | SWIGRUNTIME int |
| 364 | SWIG_TypeEquiv(const char *nb, const char *tb) { |
| 365 | int equiv = 0; |
| 366 | const char* te = tb + strlen(tb); |
| 367 | const char* ne = nb; |
| 368 | while (!equiv && *ne) { |
| 369 | for (nb = ne; *ne; ++ne) { |
| 370 | if (*ne == '|') break; |
| 371 | } |
| 372 | equiv = (SWIG_TypeNameComp(nb, ne, tb, te) == 0) ? 1 : 0; |
| 373 | if (*ne) ++ne; |
| 374 | } |
| 375 | return equiv; |
| 376 | } |
| 377 | |
| 378 | /* |
| 379 | Check type equivalence in a name list like <name1>|<name2>|... |
| 380 | Return 0 if equal, -1 if nb < tb, 1 if nb > tb |
| 381 | */ |
| 382 | SWIGRUNTIME int |
| 383 | SWIG_TypeCompare(const char *nb, const char *tb) { |
| 384 | int equiv = 0; |
| 385 | const char* te = tb + strlen(tb); |
| 386 | const char* ne = nb; |
| 387 | while (!equiv && *ne) { |
| 388 | for (nb = ne; *ne; ++ne) { |
| 389 | if (*ne == '|') break; |
| 390 | } |
| 391 | equiv = (SWIG_TypeNameComp(nb, ne, tb, te) == 0) ? 1 : 0; |
| 392 | if (*ne) ++ne; |
| 393 | } |
| 394 | return equiv; |
| 395 | } |
| 396 | |
| 397 | |
| 398 | /* |
| 399 | Check the typename |
| 400 | */ |
| 401 | SWIGRUNTIME swig_cast_info * |
| 402 | SWIG_TypeCheck(const char *c, swig_type_info *ty) { |
| 403 | if (ty) { |
| 404 | swig_cast_info *iter = ty->cast; |
| 405 | while (iter) { |
| 406 | if (strcmp(iter->type->name, c) == 0) { |
| 407 | if (iter == ty->cast) |
| 408 | return iter; |
| 409 | /* Move iter to the top of the linked list */ |
| 410 | iter->prev->next = iter->next; |
| 411 | if (iter->next) |
| 412 | iter->next->prev = iter->prev; |
| 413 | iter->next = ty->cast; |
| 414 | iter->prev = 0; |
| 415 | if (ty->cast) ty->cast->prev = iter; |
| 416 | ty->cast = iter; |
| 417 | return iter; |
| 418 | } |
| 419 | iter = iter->next; |
| 420 | } |
| 421 | } |
| 422 | return 0; |
| 423 | } |
| 424 | |
| 425 | /* |
| 426 | Identical to SWIG_TypeCheck, except strcmp is replaced with a pointer comparison |
| 427 | */ |
| 428 | SWIGRUNTIME swig_cast_info * |
| 429 | SWIG_TypeCheckStruct(swig_type_info *from, swig_type_info *ty) { |
| 430 | if (ty) { |
| 431 | swig_cast_info *iter = ty->cast; |
| 432 | while (iter) { |
| 433 | if (iter->type == from) { |
| 434 | if (iter == ty->cast) |
| 435 | return iter; |
| 436 | /* Move iter to the top of the linked list */ |
| 437 | iter->prev->next = iter->next; |
| 438 | if (iter->next) |
| 439 | iter->next->prev = iter->prev; |
| 440 | iter->next = ty->cast; |
| 441 | iter->prev = 0; |
| 442 | if (ty->cast) ty->cast->prev = iter; |
| 443 | ty->cast = iter; |
| 444 | return iter; |
| 445 | } |
| 446 | iter = iter->next; |
| 447 | } |
| 448 | } |
| 449 | return 0; |
| 450 | } |
| 451 | |
| 452 | /* |
| 453 | Cast a pointer up an inheritance hierarchy |
| 454 | */ |
| 455 | SWIGRUNTIMEINLINE void * |
| 456 | SWIG_TypeCast(swig_cast_info *ty, void *ptr, int *newmemory) { |
| 457 | return ((!ty) || (!ty->converter)) ? ptr : (*ty->converter)(ptr, newmemory); |
| 458 | } |
| 459 | |
| 460 | /* |
| 461 | Dynamic pointer casting. Down an inheritance hierarchy |
| 462 | */ |
| 463 | SWIGRUNTIME swig_type_info * |
| 464 | SWIG_TypeDynamicCast(swig_type_info *ty, void **ptr) { |
| 465 | swig_type_info *lastty = ty; |
| 466 | if (!ty || !ty->dcast) return ty; |
| 467 | while (ty && (ty->dcast)) { |
| 468 | ty = (*ty->dcast)(ptr); |
| 469 | if (ty) lastty = ty; |
| 470 | } |
| 471 | return lastty; |
| 472 | } |
| 473 | |
| 474 | /* |
| 475 | Return the name associated with this type |
| 476 | */ |
| 477 | SWIGRUNTIMEINLINE const char * |
| 478 | SWIG_TypeName(const swig_type_info *ty) { |
| 479 | return ty->name; |
| 480 | } |
| 481 | |
| 482 | /* |
| 483 | Return the pretty name associated with this type, |
| 484 | that is an unmangled type name in a form presentable to the user. |
| 485 | */ |
| 486 | SWIGRUNTIME const char * |
| 487 | SWIG_TypePrettyName(const swig_type_info *type) { |
| 488 | /* The "str" field contains the equivalent pretty names of the |
| 489 | type, separated by vertical-bar characters. We choose |
| 490 | to print the last name, as it is often (?) the most |
| 491 | specific. */ |
| 492 | if (!type) return NULL; |
| 493 | if (type->str != NULL) { |
| 494 | const char *last_name = type->str; |
| 495 | const char *s; |
| 496 | for (s = type->str; *s; s++) |
| 497 | if (*s == '|') last_name = s+1; |
| 498 | return last_name; |
| 499 | } |
| 500 | else |
| 501 | return type->name; |
| 502 | } |
| 503 | |
| 504 | /* |
| 505 | Set the clientdata field for a type |
| 506 | */ |
| 507 | SWIGRUNTIME void |
| 508 | SWIG_TypeClientData(swig_type_info *ti, void *clientdata) { |
| 509 | swig_cast_info *cast = ti->cast; |
| 510 | /* if (ti->clientdata == clientdata) return; */ |
| 511 | ti->clientdata = clientdata; |
| 512 | |
| 513 | while (cast) { |
| 514 | if (!cast->converter) { |
| 515 | swig_type_info *tc = cast->type; |
| 516 | if (!tc->clientdata) { |
| 517 | SWIG_TypeClientData(tc, clientdata); |
| 518 | } |
| 519 | } |
| 520 | cast = cast->next; |
| 521 | } |
| 522 | } |
| 523 | SWIGRUNTIME void |
| 524 | SWIG_TypeNewClientData(swig_type_info *ti, void *clientdata) { |
| 525 | SWIG_TypeClientData(ti, clientdata); |
| 526 | ti->owndata = 1; |
| 527 | } |
| 528 | |
| 529 | /* |
| 530 | Search for a swig_type_info structure only by mangled name |
| 531 | Search is a O(log #types) |
| 532 | |
| 533 | We start searching at module start, and finish searching when start == end. |
| 534 | Note: if start == end at the beginning of the function, we go all the way around |
| 535 | the circular list. |
| 536 | */ |
| 537 | SWIGRUNTIME swig_type_info * |
| 538 | SWIG_MangledTypeQueryModule(swig_module_info *start, |
| 539 | swig_module_info *end, |
| 540 | const char *name) { |
| 541 | swig_module_info *iter = start; |
| 542 | do { |
| 543 | if (iter->size) { |
| 544 | register size_t l = 0; |
| 545 | register size_t r = iter->size - 1; |
| 546 | do { |
| 547 | /* since l+r >= 0, we can (>> 1) instead (/ 2) */ |
| 548 | register size_t i = (l + r) >> 1; |
| 549 | const char *iname = iter->types[i]->name; |
| 550 | if (iname) { |
| 551 | register int compare = strcmp(name, iname); |
| 552 | if (compare == 0) { |
| 553 | return iter->types[i]; |
| 554 | } else if (compare < 0) { |
| 555 | if (i) { |
| 556 | r = i - 1; |
| 557 | } else { |
| 558 | break; |
| 559 | } |
| 560 | } else if (compare > 0) { |
| 561 | l = i + 1; |
| 562 | } |
| 563 | } else { |
| 564 | break; /* should never happen */ |
| 565 | } |
| 566 | } while (l <= r); |
| 567 | } |
| 568 | iter = iter->next; |
| 569 | } while (iter != end); |
| 570 | return 0; |
| 571 | } |
| 572 | |
| 573 | /* |
| 574 | Search for a swig_type_info structure for either a mangled name or a human readable name. |
| 575 | It first searches the mangled names of the types, which is a O(log #types) |
| 576 | If a type is not found it then searches the human readable names, which is O(#types). |
| 577 | |
| 578 | We start searching at module start, and finish searching when start == end. |
| 579 | Note: if start == end at the beginning of the function, we go all the way around |
| 580 | the circular list. |
| 581 | */ |
| 582 | SWIGRUNTIME swig_type_info * |
| 583 | SWIG_TypeQueryModule(swig_module_info *start, |
| 584 | swig_module_info *end, |
| 585 | const char *name) { |
| 586 | /* STEP 1: Search the name field using binary search */ |
| 587 | swig_type_info *ret = SWIG_MangledTypeQueryModule(start, end, name); |
| 588 | if (ret) { |
| 589 | return ret; |
| 590 | } else { |
| 591 | /* STEP 2: If the type hasn't been found, do a complete search |
| 592 | of the str field (the human readable name) */ |
| 593 | swig_module_info *iter = start; |
| 594 | do { |
| 595 | register size_t i = 0; |
| 596 | for (; i < iter->size; ++i) { |
| 597 | if (iter->types[i]->str && (SWIG_TypeEquiv(iter->types[i]->str, name))) |
| 598 | return iter->types[i]; |
| 599 | } |
| 600 | iter = iter->next; |
| 601 | } while (iter != end); |
| 602 | } |
| 603 | |
| 604 | /* neither found a match */ |
| 605 | return 0; |
| 606 | } |
| 607 | |
| 608 | /* |
| 609 | Pack binary data into a string |
| 610 | */ |
| 611 | SWIGRUNTIME char * |
| 612 | SWIG_PackData(char *c, void *ptr, size_t sz) { |
| 613 | static const char hex[17] = "0123456789abcdef"; |
| 614 | register const unsigned char *u = (unsigned char *) ptr; |
| 615 | register const unsigned char *eu = u + sz; |
| 616 | for (; u != eu; ++u) { |
| 617 | register unsigned char uu = *u; |
| 618 | *(c++) = hex[(uu & 0xf0) >> 4]; |
| 619 | *(c++) = hex[uu & 0xf]; |
| 620 | } |
| 621 | return c; |
| 622 | } |
| 623 | |
| 624 | /* |
| 625 | Unpack binary data from a string |
| 626 | */ |
| 627 | SWIGRUNTIME const char * |
| 628 | SWIG_UnpackData(const char *c, void *ptr, size_t sz) { |
| 629 | register unsigned char *u = (unsigned char *) ptr; |
| 630 | register const unsigned char *eu = u + sz; |
| 631 | for (; u != eu; ++u) { |
| 632 | register char d = *(c++); |
| 633 | register unsigned char uu; |
| 634 | if ((d >= '0') && (d <= '9')) |
| 635 | uu = ((d - '0') << 4); |
| 636 | else if ((d >= 'a') && (d <= 'f')) |
| 637 | uu = ((d - ('a'-10)) << 4); |
| 638 | else |
| 639 | return (char *) 0; |
| 640 | d = *(c++); |
| 641 | if ((d >= '0') && (d <= '9')) |
| 642 | uu |= (d - '0'); |
| 643 | else if ((d >= 'a') && (d <= 'f')) |
| 644 | uu |= (d - ('a'-10)); |
| 645 | else |
| 646 | return (char *) 0; |
| 647 | *u = uu; |
| 648 | } |
| 649 | return c; |
| 650 | } |
| 651 | |
| 652 | /* |
| 653 | Pack 'void *' into a string buffer. |
| 654 | */ |
| 655 | SWIGRUNTIME char * |
| 656 | SWIG_PackVoidPtr(char *buff, void *ptr, const char *name, size_t bsz) { |
| 657 | char *r = buff; |
| 658 | if ((2*sizeof(void *) + 2) > bsz) return 0; |
| 659 | *(r++) = '_'; |
| 660 | r = SWIG_PackData(r,&ptr,sizeof(void *)); |
| 661 | if (strlen(name) + 1 > (bsz - (r - buff))) return 0; |
| 662 | strcpy(r,name); |
| 663 | return buff; |
| 664 | } |
| 665 | |
| 666 | SWIGRUNTIME const char * |
| 667 | SWIG_UnpackVoidPtr(const char *c, void **ptr, const char *name) { |
| 668 | if (*c != '_') { |
| 669 | if (strcmp(c,"NULL") == 0) { |
| 670 | *ptr = (void *) 0; |
| 671 | return name; |
| 672 | } else { |
| 673 | return 0; |
| 674 | } |
| 675 | } |
| 676 | return SWIG_UnpackData(++c,ptr,sizeof(void *)); |
| 677 | } |
| 678 | |
| 679 | SWIGRUNTIME char * |
| 680 | SWIG_PackDataName(char *buff, void *ptr, size_t sz, const char *name, size_t bsz) { |
| 681 | char *r = buff; |
| 682 | size_t lname = (name ? strlen(name) : 0); |
| 683 | if ((2*sz + 2 + lname) > bsz) return 0; |
| 684 | *(r++) = '_'; |
| 685 | r = SWIG_PackData(r,ptr,sz); |
| 686 | if (lname) { |
| 687 | strncpy(r,name,lname+1); |
| 688 | } else { |
| 689 | *r = 0; |
| 690 | } |
| 691 | return buff; |
| 692 | } |
| 693 | |
| 694 | SWIGRUNTIME const char * |
| 695 | SWIG_UnpackDataName(const char *c, void *ptr, size_t sz, const char *name) { |
| 696 | if (*c != '_') { |
| 697 | if (strcmp(c,"NULL") == 0) { |
| 698 | memset(ptr,0,sz); |
| 699 | return name; |
| 700 | } else { |
| 701 | return 0; |
| 702 | } |
| 703 | } |
| 704 | return SWIG_UnpackData(++c,ptr,sz); |
| 705 | } |
| 706 | |
| 707 | #ifdef __cplusplus |
| 708 | } |
| 709 | #endif |
| 710 | |
| 711 | /* Errors in SWIG */ |
| 712 | #define SWIG_UnknownError -1 |
| 713 | #define SWIG_IOError -2 |
| 714 | #define SWIG_RuntimeError -3 |
| 715 | #define SWIG_IndexError -4 |
| 716 | #define SWIG_TypeError -5 |
| 717 | #define SWIG_DivisionByZero -6 |
| 718 | #define SWIG_OverflowError -7 |
| 719 | #define SWIG_SyntaxError -8 |
| 720 | #define SWIG_ValueError -9 |
| 721 | #define SWIG_SystemError -10 |
| 722 | #define SWIG_AttributeError -11 |
| 723 | #define SWIG_MemoryError -12 |
| 724 | #define SWIG_NullReferenceError -13 |
| 725 | |
| 726 | |
| 727 | |
| 728 | /* Compatibility macros for Python 3 */ |
| 729 | #if PY_VERSION_HEX >= 0x03000000 |
| 730 | |
| 731 | #define PyClass_Check(obj) PyObject_IsInstance(obj, (PyObject *)&PyType_Type) |
| 732 | #define PyInt_Check(x) PyLong_Check(x) |
| 733 | #define PyInt_AsLong(x) PyLong_AsLong(x) |
| 734 | #define PyInt_FromLong(x) PyLong_FromLong(x) |
| 735 | #define PyInt_FromSize_t(x) PyLong_FromSize_t(x) |
| 736 | #define PyString_Check(name) PyBytes_Check(name) |
| 737 | #define PyString_FromString(x) PyUnicode_FromString(x) |
| 738 | #define PyString_Format(fmt, args) PyUnicode_Format(fmt, args) |
| 739 | #define PyString_AsString(str) PyBytes_AsString(str) |
| 740 | #define PyString_Size(str) PyBytes_Size(str) |
| 741 | #define PyString_InternFromString(key) PyUnicode_InternFromString(key) |
| 742 | #define Py_TPFLAGS_HAVE_CLASS Py_TPFLAGS_BASETYPE |
| 743 | #define PyString_AS_STRING(x) PyUnicode_AS_STRING(x) |
| 744 | #define _PyLong_FromSsize_t(x) PyLong_FromSsize_t(x) |
| 745 | |
| 746 | #endif |
| 747 | |
| 748 | #ifndef Py_TYPE |
| 749 | # define Py_TYPE(op) ((op)->ob_type) |
| 750 | #endif |
| 751 | |
| 752 | /* SWIG APIs for compatibility of both Python 2 & 3 */ |
| 753 | |
| 754 | #if PY_VERSION_HEX >= 0x03000000 |
| 755 | # define SWIG_Python_str_FromFormat PyUnicode_FromFormat |
| 756 | #else |
| 757 | # define SWIG_Python_str_FromFormat PyString_FromFormat |
| 758 | #endif |
| 759 | |
| 760 | |
| 761 | /* Warning: This function will allocate a new string in Python 3, |
| 762 | * so please call SWIG_Python_str_DelForPy3(x) to free the space. |
| 763 | */ |
| 764 | SWIGINTERN char* |
| 765 | SWIG_Python_str_AsChar(PyObject *str) |
| 766 | { |
| 767 | #if PY_VERSION_HEX >= 0x03000000 |
| 768 | char *cstr; |
| 769 | char *newstr; |
| 770 | Py_ssize_t len; |
| 771 | str = PyUnicode_AsUTF8String(str); |
| 772 | PyBytes_AsStringAndSize(str, &cstr, &len); |
| 773 | newstr = (char *) malloc(len+1); |
| 774 | memcpy(newstr, cstr, len+1); |
| 775 | Py_XDECREF(str); |
| 776 | return newstr; |
| 777 | #else |
| 778 | return PyString_AsString(str); |
| 779 | #endif |
| 780 | } |
| 781 | |
| 782 | #if PY_VERSION_HEX >= 0x03000000 |
| 783 | # define SWIG_Python_str_DelForPy3(x) free( (void*) (x) ) |
| 784 | #else |
| 785 | # define SWIG_Python_str_DelForPy3(x) |
| 786 | #endif |
| 787 | |
| 788 | |
| 789 | SWIGINTERN PyObject* |
| 790 | SWIG_Python_str_FromChar(const char *c) |
| 791 | { |
| 792 | #if PY_VERSION_HEX >= 0x03000000 |
| 793 | return PyUnicode_FromString(c); |
| 794 | #else |
| 795 | return PyString_FromString(c); |
| 796 | #endif |
| 797 | } |
| 798 | |
| 799 | /* Add PyOS_snprintf for old Pythons */ |
| 800 | #if PY_VERSION_HEX < 0x02020000 |
| 801 | # if defined(_MSC_VER) || defined(__BORLANDC__) || defined(_WATCOM) |
| 802 | # define PyOS_snprintf _snprintf |
| 803 | # else |
| 804 | # define PyOS_snprintf snprintf |
| 805 | # endif |
| 806 | #endif |
| 807 | |
| 808 | /* A crude PyString_FromFormat implementation for old Pythons */ |
| 809 | #if PY_VERSION_HEX < 0x02020000 |
| 810 | |
| 811 | #ifndef SWIG_PYBUFFER_SIZE |
| 812 | # define SWIG_PYBUFFER_SIZE 1024 |
| 813 | #endif |
| 814 | |
| 815 | static PyObject * |
| 816 | PyString_FromFormat(const char *fmt, ...) { |
| 817 | va_list ap; |
| 818 | char buf[SWIG_PYBUFFER_SIZE * 2]; |
| 819 | int res; |
| 820 | va_start(ap, fmt); |
| 821 | res = vsnprintf(buf, sizeof(buf), fmt, ap); |
| 822 | va_end(ap); |
| 823 | return (res < 0 || res >= (int)sizeof(buf)) ? 0 : PyString_FromString(buf); |
| 824 | } |
| 825 | #endif |
| 826 | |
| 827 | /* Add PyObject_Del for old Pythons */ |
| 828 | #if PY_VERSION_HEX < 0x01060000 |
| 829 | # define PyObject_Del(op) PyMem_DEL((op)) |
| 830 | #endif |
| 831 | #ifndef PyObject_DEL |
| 832 | # define PyObject_DEL PyObject_Del |
| 833 | #endif |
| 834 | |
| 835 | /* A crude PyExc_StopIteration exception for old Pythons */ |
| 836 | #if PY_VERSION_HEX < 0x02020000 |
| 837 | # ifndef PyExc_StopIteration |
| 838 | # define PyExc_StopIteration PyExc_RuntimeError |
| 839 | # endif |
| 840 | # ifndef PyObject_GenericGetAttr |
| 841 | # define PyObject_GenericGetAttr 0 |
| 842 | # endif |
| 843 | #endif |
| 844 | |
| 845 | /* Py_NotImplemented is defined in 2.1 and up. */ |
| 846 | #if PY_VERSION_HEX < 0x02010000 |
| 847 | # ifndef Py_NotImplemented |
| 848 | # define Py_NotImplemented PyExc_RuntimeError |
| 849 | # endif |
| 850 | #endif |
| 851 | |
| 852 | /* A crude PyString_AsStringAndSize implementation for old Pythons */ |
| 853 | #if PY_VERSION_HEX < 0x02010000 |
| 854 | # ifndef PyString_AsStringAndSize |
| 855 | # define PyString_AsStringAndSize(obj, s, len) {*s = PyString_AsString(obj); *len = *s ? strlen(*s) : 0;} |
| 856 | # endif |
| 857 | #endif |
| 858 | |
| 859 | /* PySequence_Size for old Pythons */ |
| 860 | #if PY_VERSION_HEX < 0x02000000 |
| 861 | # ifndef PySequence_Size |
| 862 | # define PySequence_Size PySequence_Length |
| 863 | # endif |
| 864 | #endif |
| 865 | |
| 866 | /* PyBool_FromLong for old Pythons */ |
| 867 | #if PY_VERSION_HEX < 0x02030000 |
| 868 | static |
| 869 | PyObject *PyBool_FromLong(long ok) |
| 870 | { |
| 871 | PyObject *result = ok ? Py_True : Py_False; |
| 872 | Py_INCREF(result); |
| 873 | return result; |
| 874 | } |
| 875 | #endif |
| 876 | |
| 877 | /* Py_ssize_t for old Pythons */ |
| 878 | /* This code is as recommended by: */ |
| 879 | /* http://www.python.org/dev/peps/pep-0353/#conversion-guidelines */ |
| 880 | #if PY_VERSION_HEX < 0x02050000 && !defined(PY_SSIZE_T_MIN) |
| 881 | typedef int Py_ssize_t; |
| 882 | # define PY_SSIZE_T_MAX INT_MAX |
| 883 | # define PY_SSIZE_T_MIN INT_MIN |
| 884 | typedef inquiry lenfunc; |
| 885 | typedef intargfunc ssizeargfunc; |
| 886 | typedef intintargfunc ssizessizeargfunc; |
| 887 | typedef intobjargproc ssizeobjargproc; |
| 888 | typedef intintobjargproc ssizessizeobjargproc; |
| 889 | typedef getreadbufferproc readbufferproc; |
| 890 | typedef getwritebufferproc writebufferproc; |
| 891 | typedef getsegcountproc segcountproc; |
| 892 | typedef getcharbufferproc charbufferproc; |
| 893 | static long PyNumber_AsSsize_t (PyObject *x, void *SWIGUNUSEDPARM(exc)) |
| 894 | { |
| 895 | long result = 0; |
| 896 | PyObject *i = PyNumber_Int(x); |
| 897 | if (i) { |
| 898 | result = PyInt_AsLong(i); |
| 899 | Py_DECREF(i); |
| 900 | } |
| 901 | return result; |
| 902 | } |
| 903 | #endif |
| 904 | |
| 905 | #if PY_VERSION_HEX < 0x02040000 |
| 906 | #define Py_VISIT(op) \ |
| 907 | do { \ |
| 908 | if (op) { \ |
| 909 | int vret = visit((op), arg); \ |
| 910 | if (vret) \ |
| 911 | return vret; \ |
| 912 | } \ |
| 913 | } while (0) |
| 914 | #endif |
| 915 | |
| 916 | #if PY_VERSION_HEX < 0x02030000 |
| 917 | typedef struct { |
| 918 | PyTypeObject type; |
| 919 | PyNumberMethods as_number; |
| 920 | PyMappingMethods as_mapping; |
| 921 | PySequenceMethods as_sequence; |
| 922 | PyBufferProcs as_buffer; |
| 923 | PyObject *name, *slots; |
| 924 | } PyHeapTypeObject; |
| 925 | #endif |
| 926 | |
| 927 | #if PY_VERSION_HEX < 0x02030000 |
| 928 | typedef destructor freefunc; |
| 929 | #endif |
| 930 | |
| 931 | #if ((PY_MAJOR_VERSION == 2 && PY_MINOR_VERSION > 6) || \ |
| 932 | (PY_MAJOR_VERSION == 3 && PY_MINOR_VERSION > 0) || \ |
| 933 | (PY_MAJOR_VERSION > 3)) |
| 934 | # define SWIGPY_USE_CAPSULE |
| 935 | # define SWIGPY_CAPSULE_NAME ((char*)"swig_runtime_data" SWIG_RUNTIME_VERSION ".type_pointer_capsule" SWIG_TYPE_TABLE_NAME) |
| 936 | #endif |
| 937 | |
| 938 | #if PY_VERSION_HEX < 0x03020000 |
| 939 | #define PyDescr_TYPE(x) (((PyDescrObject *)(x))->d_type) |
| 940 | #define PyDescr_NAME(x) (((PyDescrObject *)(x))->d_name) |
| 941 | #endif |
| 942 | |
| 943 | /* ----------------------------------------------------------------------------- |
| 944 | * error manipulation |
| 945 | * ----------------------------------------------------------------------------- */ |
| 946 | |
| 947 | SWIGRUNTIME PyObject* |
| 948 | SWIG_Python_ErrorType(int code) { |
| 949 | PyObject* type = 0; |
| 950 | switch(code) { |
| 951 | case SWIG_MemoryError: |
| 952 | type = PyExc_MemoryError; |
| 953 | break; |
| 954 | case SWIG_IOError: |
| 955 | type = PyExc_IOError; |
| 956 | break; |
| 957 | case SWIG_RuntimeError: |
| 958 | type = PyExc_RuntimeError; |
| 959 | break; |
| 960 | case SWIG_IndexError: |
| 961 | type = PyExc_IndexError; |
| 962 | break; |
| 963 | case SWIG_TypeError: |
| 964 | type = PyExc_TypeError; |
| 965 | break; |
| 966 | case SWIG_DivisionByZero: |
| 967 | type = PyExc_ZeroDivisionError; |
| 968 | break; |
| 969 | case SWIG_OverflowError: |
| 970 | type = PyExc_OverflowError; |
| 971 | break; |
| 972 | case SWIG_SyntaxError: |
| 973 | type = PyExc_SyntaxError; |
| 974 | break; |
| 975 | case SWIG_ValueError: |
| 976 | type = PyExc_ValueError; |
| 977 | break; |
| 978 | case SWIG_SystemError: |
| 979 | type = PyExc_SystemError; |
| 980 | break; |
| 981 | case SWIG_AttributeError: |
| 982 | type = PyExc_AttributeError; |
| 983 | break; |
| 984 | default: |
| 985 | type = PyExc_RuntimeError; |
| 986 | } |
| 987 | return type; |
| 988 | } |
| 989 | |
| 990 | |
| 991 | SWIGRUNTIME void |
| 992 | SWIG_Python_AddErrorMsg(const char* mesg) |
| 993 | { |
| 994 | PyObject *type = 0; |
| 995 | PyObject *value = 0; |
| 996 | PyObject *traceback = 0; |
| 997 | |
| 998 | if (PyErr_Occurred()) PyErr_Fetch(&type, &value, &traceback); |
| 999 | if (value) { |
| 1000 | char *tmp; |
| 1001 | PyObject *old_str = PyObject_Str(value); |
| 1002 | PyErr_Clear(); |
| 1003 | Py_XINCREF(type); |
| 1004 | |
| 1005 | PyErr_Format(type, "%s %s", tmp = SWIG_Python_str_AsChar(old_str), mesg); |
| 1006 | SWIG_Python_str_DelForPy3(tmp); |
| 1007 | Py_DECREF(old_str); |
| 1008 | Py_DECREF(value); |
| 1009 | } else { |
| 1010 | PyErr_SetString(PyExc_RuntimeError, mesg); |
| 1011 | } |
| 1012 | } |
| 1013 | |
| 1014 | #if defined(SWIG_PYTHON_NO_THREADS) |
| 1015 | # if defined(SWIG_PYTHON_THREADS) |
| 1016 | # undef SWIG_PYTHON_THREADS |
| 1017 | # endif |
| 1018 | #endif |
| 1019 | #if defined(SWIG_PYTHON_THREADS) /* Threading support is enabled */ |
| 1020 | # if !defined(SWIG_PYTHON_USE_GIL) && !defined(SWIG_PYTHON_NO_USE_GIL) |
| 1021 | # if (PY_VERSION_HEX >= 0x02030000) /* For 2.3 or later, use the PyGILState calls */ |
| 1022 | # define SWIG_PYTHON_USE_GIL |
| 1023 | # endif |
| 1024 | # endif |
| 1025 | # if defined(SWIG_PYTHON_USE_GIL) /* Use PyGILState threads calls */ |
| 1026 | # ifndef SWIG_PYTHON_INITIALIZE_THREADS |
| 1027 | # define SWIG_PYTHON_INITIALIZE_THREADS PyEval_InitThreads() |
| 1028 | # endif |
| 1029 | # ifdef __cplusplus /* C++ code */ |
| 1030 | class SWIG_Python_Thread_Block { |
| 1031 | bool status; |
| 1032 | PyGILState_STATE state; |
| 1033 | public: |
| 1034 | void end() { if (status) { PyGILState_Release(state); status = false;} } |
| 1035 | SWIG_Python_Thread_Block() : status(true), state(PyGILState_Ensure()) {} |
| 1036 | ~SWIG_Python_Thread_Block() { end(); } |
| 1037 | }; |
| 1038 | class SWIG_Python_Thread_Allow { |
| 1039 | bool status; |
| 1040 | PyThreadState *save; |
| 1041 | public: |
| 1042 | void end() { if (status) { PyEval_RestoreThread(save); status = false; }} |
| 1043 | SWIG_Python_Thread_Allow() : status(true), save(PyEval_SaveThread()) {} |
| 1044 | ~SWIG_Python_Thread_Allow() { end(); } |
| 1045 | }; |
| 1046 | # define SWIG_PYTHON_THREAD_BEGIN_BLOCK SWIG_Python_Thread_Block _swig_thread_block |
| 1047 | # define SWIG_PYTHON_THREAD_END_BLOCK _swig_thread_block.end() |
| 1048 | # define SWIG_PYTHON_THREAD_BEGIN_ALLOW SWIG_Python_Thread_Allow _swig_thread_allow |
| 1049 | # define SWIG_PYTHON_THREAD_END_ALLOW _swig_thread_allow.end() |
| 1050 | # else /* C code */ |
| 1051 | # define SWIG_PYTHON_THREAD_BEGIN_BLOCK PyGILState_STATE _swig_thread_block = PyGILState_Ensure() |
| 1052 | # define SWIG_PYTHON_THREAD_END_BLOCK PyGILState_Release(_swig_thread_block) |
| 1053 | # define SWIG_PYTHON_THREAD_BEGIN_ALLOW PyThreadState *_swig_thread_allow = PyEval_SaveThread() |
| 1054 | # define SWIG_PYTHON_THREAD_END_ALLOW PyEval_RestoreThread(_swig_thread_allow) |
| 1055 | # endif |
| 1056 | # else /* Old thread way, not implemented, user must provide it */ |
| 1057 | # if !defined(SWIG_PYTHON_INITIALIZE_THREADS) |
| 1058 | # define SWIG_PYTHON_INITIALIZE_THREADS |
| 1059 | # endif |
| 1060 | # if !defined(SWIG_PYTHON_THREAD_BEGIN_BLOCK) |
| 1061 | # define SWIG_PYTHON_THREAD_BEGIN_BLOCK |
| 1062 | # endif |
| 1063 | # if !defined(SWIG_PYTHON_THREAD_END_BLOCK) |
| 1064 | # define SWIG_PYTHON_THREAD_END_BLOCK |
| 1065 | # endif |
| 1066 | # if !defined(SWIG_PYTHON_THREAD_BEGIN_ALLOW) |
| 1067 | # define SWIG_PYTHON_THREAD_BEGIN_ALLOW |
| 1068 | # endif |
| 1069 | # if !defined(SWIG_PYTHON_THREAD_END_ALLOW) |
| 1070 | # define SWIG_PYTHON_THREAD_END_ALLOW |
| 1071 | # endif |
| 1072 | # endif |
| 1073 | #else /* No thread support */ |
| 1074 | # define SWIG_PYTHON_INITIALIZE_THREADS |
| 1075 | # define SWIG_PYTHON_THREAD_BEGIN_BLOCK |
| 1076 | # define SWIG_PYTHON_THREAD_END_BLOCK |
| 1077 | # define SWIG_PYTHON_THREAD_BEGIN_ALLOW |
| 1078 | # define SWIG_PYTHON_THREAD_END_ALLOW |
| 1079 | #endif |
| 1080 | |
| 1081 | /* ----------------------------------------------------------------------------- |
| 1082 | * Python API portion that goes into the runtime |
| 1083 | * ----------------------------------------------------------------------------- */ |
| 1084 | |
| 1085 | #ifdef __cplusplus |
| 1086 | extern "C" { |
| 1087 | #endif |
| 1088 | |
| 1089 | /* ----------------------------------------------------------------------------- |
| 1090 | * Constant declarations |
| 1091 | * ----------------------------------------------------------------------------- */ |
| 1092 | |
| 1093 | /* Constant Types */ |
| 1094 | #define SWIG_PY_POINTER 4 |
| 1095 | #define SWIG_PY_BINARY 5 |
| 1096 | |
| 1097 | /* Constant information structure */ |
| 1098 | typedef struct swig_const_info { |
| 1099 | int type; |
| 1100 | char *name; |
| 1101 | long lvalue; |
| 1102 | double dvalue; |
| 1103 | void *pvalue; |
| 1104 | swig_type_info **ptype; |
| 1105 | } swig_const_info; |
| 1106 | |
| 1107 | |
| 1108 | /* ----------------------------------------------------------------------------- |
| 1109 | * Wrapper of PyInstanceMethod_New() used in Python 3 |
| 1110 | * It is exported to the generated module, used for -fastproxy |
| 1111 | * ----------------------------------------------------------------------------- */ |
| 1112 | #if PY_VERSION_HEX >= 0x03000000 |
| 1113 | SWIGRUNTIME PyObject* SWIG_PyInstanceMethod_New(PyObject *SWIGUNUSEDPARM(self), PyObject *func) |
| 1114 | { |
| 1115 | return PyInstanceMethod_New(func); |
| 1116 | } |
| 1117 | #else |
| 1118 | SWIGRUNTIME PyObject* SWIG_PyInstanceMethod_New(PyObject *SWIGUNUSEDPARM(self), PyObject *SWIGUNUSEDPARM(func)) |
| 1119 | { |
| 1120 | return NULL; |
| 1121 | } |
| 1122 | #endif |
| 1123 | |
| 1124 | #ifdef __cplusplus |
| 1125 | } |
| 1126 | #endif |
| 1127 | |
| 1128 | |
| 1129 | /* ----------------------------------------------------------------------------- |
| 1130 | * pyrun.swg |
| 1131 | * |
| 1132 | * This file contains the runtime support for Python modules |
| 1133 | * and includes code for managing global variables and pointer |
| 1134 | * type checking. |
| 1135 | * |
| 1136 | * ----------------------------------------------------------------------------- */ |
| 1137 | |
| 1138 | /* Common SWIG API */ |
| 1139 | |
| 1140 | /* for raw pointers */ |
| 1141 | #define SWIG_Python_ConvertPtr(obj, pptr, type, flags) SWIG_Python_ConvertPtrAndOwn(obj, pptr, type, flags, 0) |
| 1142 | #define SWIG_ConvertPtr(obj, pptr, type, flags) SWIG_Python_ConvertPtr(obj, pptr, type, flags) |
| 1143 | #define SWIG_ConvertPtrAndOwn(obj,pptr,type,flags,own) SWIG_Python_ConvertPtrAndOwn(obj, pptr, type, flags, own) |
| 1144 | |
| 1145 | #ifdef SWIGPYTHON_BUILTIN |
| 1146 | #define SWIG_NewPointerObj(ptr, type, flags) SWIG_Python_NewPointerObj(self, ptr, type, flags) |
| 1147 | #else |
| 1148 | #define SWIG_NewPointerObj(ptr, type, flags) SWIG_Python_NewPointerObj(NULL, ptr, type, flags) |
| 1149 | #endif |
| 1150 | |
| 1151 | #define SWIG_InternalNewPointerObj(ptr, type, flags) SWIG_Python_NewPointerObj(NULL, ptr, type, flags) |
| 1152 | |
| 1153 | #define SWIG_CheckImplicit(ty) SWIG_Python_CheckImplicit(ty) |
| 1154 | #define SWIG_AcquirePtr(ptr, src) SWIG_Python_AcquirePtr(ptr, src) |
| 1155 | #define swig_owntype int |
| 1156 | |
| 1157 | /* for raw packed data */ |
| 1158 | #define SWIG_ConvertPacked(obj, ptr, sz, ty) SWIG_Python_ConvertPacked(obj, ptr, sz, ty) |
| 1159 | #define SWIG_NewPackedObj(ptr, sz, type) SWIG_Python_NewPackedObj(ptr, sz, type) |
| 1160 | |
| 1161 | /* for class or struct pointers */ |
| 1162 | #define SWIG_ConvertInstance(obj, pptr, type, flags) SWIG_ConvertPtr(obj, pptr, type, flags) |
| 1163 | #define SWIG_NewInstanceObj(ptr, type, flags) SWIG_NewPointerObj(ptr, type, flags) |
| 1164 | |
| 1165 | /* for C or C++ function pointers */ |
| 1166 | #define SWIG_ConvertFunctionPtr(obj, pptr, type) SWIG_Python_ConvertFunctionPtr(obj, pptr, type) |
| 1167 | #define SWIG_NewFunctionPtrObj(ptr, type) SWIG_Python_NewPointerObj(NULL, ptr, type, 0) |
| 1168 | |
| 1169 | /* for C++ member pointers, ie, member methods */ |
| 1170 | #define SWIG_ConvertMember(obj, ptr, sz, ty) SWIG_Python_ConvertPacked(obj, ptr, sz, ty) |
| 1171 | #define SWIG_NewMemberObj(ptr, sz, type) SWIG_Python_NewPackedObj(ptr, sz, type) |
| 1172 | |
| 1173 | |
| 1174 | /* Runtime API */ |
| 1175 | |
| 1176 | #define SWIG_GetModule(clientdata) SWIG_Python_GetModule() |
| 1177 | #define SWIG_SetModule(clientdata, pointer) SWIG_Python_SetModule(pointer) |
| 1178 | #define SWIG_NewClientData(obj) SwigPyClientData_New(obj) |
| 1179 | |
| 1180 | #define SWIG_SetErrorObj SWIG_Python_SetErrorObj |
| 1181 | #define SWIG_SetErrorMsg SWIG_Python_SetErrorMsg |
| 1182 | #define SWIG_ErrorType(code) SWIG_Python_ErrorType(code) |
| 1183 | #define SWIG_Error(code, msg) SWIG_Python_SetErrorMsg(SWIG_ErrorType(code), msg) |
| 1184 | #define SWIG_fail goto fail |
| 1185 | |
| 1186 | |
| 1187 | /* Runtime API implementation */ |
| 1188 | |
| 1189 | /* Error manipulation */ |
| 1190 | |
| 1191 | SWIGINTERN void |
| 1192 | SWIG_Python_SetErrorObj(PyObject *errtype, PyObject *obj) { |
| 1193 | SWIG_PYTHON_THREAD_BEGIN_BLOCK; |
| 1194 | PyErr_SetObject(errtype, obj); |
| 1195 | Py_DECREF(obj); |
| 1196 | SWIG_PYTHON_THREAD_END_BLOCK; |
| 1197 | } |
| 1198 | |
| 1199 | SWIGINTERN void |
| 1200 | SWIG_Python_SetErrorMsg(PyObject *errtype, const char *msg) { |
| 1201 | SWIG_PYTHON_THREAD_BEGIN_BLOCK; |
| 1202 | PyErr_SetString(errtype, msg); |
| 1203 | SWIG_PYTHON_THREAD_END_BLOCK; |
| 1204 | } |
| 1205 | |
| 1206 | #define SWIG_Python_Raise(obj, type, desc) SWIG_Python_SetErrorObj(SWIG_Python_ExceptionType(desc), obj) |
| 1207 | |
| 1208 | /* Set a constant value */ |
| 1209 | |
| 1210 | #if defined(SWIGPYTHON_BUILTIN) |
| 1211 | |
| 1212 | SWIGINTERN void |
| 1213 | SwigPyBuiltin_AddPublicSymbol(PyObject *seq, const char *key) { |
| 1214 | PyObject *s = PyString_InternFromString(key); |
| 1215 | PyList_Append(seq, s); |
| 1216 | Py_DECREF(s); |
| 1217 | } |
| 1218 | |
| 1219 | SWIGINTERN void |
| 1220 | SWIG_Python_SetConstant(PyObject *d, PyObject *public_interface, const char *name, PyObject *obj) { |
| 1221 | #if PY_VERSION_HEX < 0x02030000 |
| 1222 | PyDict_SetItemString(d, (char *)name, obj); |
| 1223 | #else |
| 1224 | PyDict_SetItemString(d, name, obj); |
| 1225 | #endif |
| 1226 | Py_DECREF(obj); |
| 1227 | if (public_interface) |
| 1228 | SwigPyBuiltin_AddPublicSymbol(public_interface, name); |
| 1229 | } |
| 1230 | |
| 1231 | #else |
| 1232 | |
| 1233 | SWIGINTERN void |
| 1234 | SWIG_Python_SetConstant(PyObject *d, const char *name, PyObject *obj) { |
| 1235 | #if PY_VERSION_HEX < 0x02030000 |
| 1236 | PyDict_SetItemString(d, (char *)name, obj); |
| 1237 | #else |
| 1238 | PyDict_SetItemString(d, name, obj); |
| 1239 | #endif |
| 1240 | Py_DECREF(obj); |
| 1241 | } |
| 1242 | |
| 1243 | #endif |
| 1244 | |
| 1245 | /* Append a value to the result obj */ |
| 1246 | |
| 1247 | SWIGINTERN PyObject* |
| 1248 | SWIG_Python_AppendOutput(PyObject* result, PyObject* obj) { |
| 1249 | #if !defined(SWIG_PYTHON_OUTPUT_TUPLE) |
| 1250 | if (!result) { |
| 1251 | result = obj; |
| 1252 | } else if (result == Py_None) { |
| 1253 | Py_DECREF(result); |
| 1254 | result = obj; |
| 1255 | } else { |
| 1256 | if (!PyList_Check(result)) { |
| 1257 | PyObject *o2 = result; |
| 1258 | result = PyList_New(1); |
| 1259 | PyList_SetItem(result, 0, o2); |
| 1260 | } |
| 1261 | PyList_Append(result,obj); |
| 1262 | Py_DECREF(obj); |
| 1263 | } |
| 1264 | return result; |
| 1265 | #else |
| 1266 | PyObject* o2; |
| 1267 | PyObject* o3; |
| 1268 | if (!result) { |
| 1269 | result = obj; |
| 1270 | } else if (result == Py_None) { |
| 1271 | Py_DECREF(result); |
| 1272 | result = obj; |
| 1273 | } else { |
| 1274 | if (!PyTuple_Check(result)) { |
| 1275 | o2 = result; |
| 1276 | result = PyTuple_New(1); |
| 1277 | PyTuple_SET_ITEM(result, 0, o2); |
| 1278 | } |
| 1279 | o3 = PyTuple_New(1); |
| 1280 | PyTuple_SET_ITEM(o3, 0, obj); |
| 1281 | o2 = result; |
| 1282 | result = PySequence_Concat(o2, o3); |
| 1283 | Py_DECREF(o2); |
| 1284 | Py_DECREF(o3); |
| 1285 | } |
| 1286 | return result; |
| 1287 | #endif |
| 1288 | } |
| 1289 | |
| 1290 | /* Unpack the argument tuple */ |
| 1291 | |
| 1292 | SWIGINTERN int |
| 1293 | SWIG_Python_UnpackTuple(PyObject *args, const char *name, Py_ssize_t min, Py_ssize_t max, PyObject **objs) |
| 1294 | { |
| 1295 | if (!args) { |
| 1296 | if (!min && !max) { |
| 1297 | return 1; |
| 1298 | } else { |
| 1299 | PyErr_Format(PyExc_TypeError, "%s expected %s%d arguments, got none", |
| 1300 | name, (min == max ? "" : "at least "), (int)min); |
| 1301 | return 0; |
| 1302 | } |
| 1303 | } |
| 1304 | if (!PyTuple_Check(args)) { |
| 1305 | if (min <= 1 && max >= 1) { |
| 1306 | register int i; |
| 1307 | objs[0] = args; |
| 1308 | for (i = 1; i < max; ++i) { |
| 1309 | objs[i] = 0; |
| 1310 | } |
| 1311 | return 2; |
| 1312 | } |
| 1313 | PyErr_SetString(PyExc_SystemError, "UnpackTuple() argument list is not a tuple"); |
| 1314 | return 0; |
| 1315 | } else { |
| 1316 | register Py_ssize_t l = PyTuple_GET_SIZE(args); |
| 1317 | if (l < min) { |
| 1318 | PyErr_Format(PyExc_TypeError, "%s expected %s%d arguments, got %d", |
| 1319 | name, (min == max ? "" : "at least "), (int)min, (int)l); |
| 1320 | return 0; |
| 1321 | } else if (l > max) { |
| 1322 | PyErr_Format(PyExc_TypeError, "%s expected %s%d arguments, got %d", |
| 1323 | name, (min == max ? "" : "at most "), (int)max, (int)l); |
| 1324 | return 0; |
| 1325 | } else { |
| 1326 | register int i; |
| 1327 | for (i = 0; i < l; ++i) { |
| 1328 | objs[i] = PyTuple_GET_ITEM(args, i); |
| 1329 | } |
| 1330 | for (; l < max; ++l) { |
| 1331 | objs[l] = 0; |
| 1332 | } |
| 1333 | return i + 1; |
| 1334 | } |
| 1335 | } |
| 1336 | } |
| 1337 | |
| 1338 | /* A functor is a function object with one single object argument */ |
| 1339 | #if PY_VERSION_HEX >= 0x02020000 |
| 1340 | #define SWIG_Python_CallFunctor(functor, obj) PyObject_CallFunctionObjArgs(functor, obj, NULL); |
| 1341 | #else |
| 1342 | #define SWIG_Python_CallFunctor(functor, obj) PyObject_CallFunction(functor, "O", obj); |
| 1343 | #endif |
| 1344 | |
| 1345 | /* |
| 1346 | Helper for static pointer initialization for both C and C++ code, for example |
| 1347 | static PyObject *SWIG_STATIC_POINTER(MyVar) = NewSomething(...); |
| 1348 | */ |
| 1349 | #ifdef __cplusplus |
| 1350 | #define SWIG_STATIC_POINTER(var) var |
| 1351 | #else |
| 1352 | #define SWIG_STATIC_POINTER(var) var = 0; if (!var) var |
| 1353 | #endif |
| 1354 | |
| 1355 | /* ----------------------------------------------------------------------------- |
| 1356 | * Pointer declarations |
| 1357 | * ----------------------------------------------------------------------------- */ |
| 1358 | |
| 1359 | /* Flags for new pointer objects */ |
| 1360 | #define SWIG_POINTER_NOSHADOW (SWIG_POINTER_OWN << 1) |
| 1361 | #define SWIG_POINTER_NEW (SWIG_POINTER_NOSHADOW | SWIG_POINTER_OWN) |
| 1362 | |
| 1363 | #define SWIG_POINTER_IMPLICIT_CONV (SWIG_POINTER_DISOWN << 1) |
| 1364 | |
| 1365 | #define SWIG_BUILTIN_TP_INIT (SWIG_POINTER_OWN << 2) |
| 1366 | #define SWIG_BUILTIN_INIT (SWIG_BUILTIN_TP_INIT | SWIG_POINTER_OWN) |
| 1367 | |
| 1368 | #ifdef __cplusplus |
| 1369 | extern "C" { |
| 1370 | #endif |
| 1371 | |
| 1372 | /* How to access Py_None */ |
| 1373 | #if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__) |
| 1374 | # ifndef SWIG_PYTHON_NO_BUILD_NONE |
| 1375 | # ifndef SWIG_PYTHON_BUILD_NONE |
| 1376 | # define SWIG_PYTHON_BUILD_NONE |
| 1377 | # endif |
| 1378 | # endif |
| 1379 | #endif |
| 1380 | |
| 1381 | #ifdef SWIG_PYTHON_BUILD_NONE |
| 1382 | # ifdef Py_None |
| 1383 | # undef Py_None |
| 1384 | # define Py_None SWIG_Py_None() |
| 1385 | # endif |
| 1386 | SWIGRUNTIMEINLINE PyObject * |
| 1387 | _SWIG_Py_None(void) |
| 1388 | { |
| 1389 | PyObject *none = Py_BuildValue((char*)""); |
| 1390 | Py_DECREF(none); |
| 1391 | return none; |
| 1392 | } |
| 1393 | SWIGRUNTIME PyObject * |
| 1394 | SWIG_Py_None(void) |
| 1395 | { |
| 1396 | static PyObject *SWIG_STATIC_POINTER(none) = _SWIG_Py_None(); |
| 1397 | return none; |
| 1398 | } |
| 1399 | #endif |
| 1400 | |
| 1401 | /* The python void return value */ |
| 1402 | |
| 1403 | SWIGRUNTIMEINLINE PyObject * |
| 1404 | SWIG_Py_Void(void) |
| 1405 | { |
| 1406 | PyObject *none = Py_None; |
| 1407 | Py_INCREF(none); |
| 1408 | return none; |
| 1409 | } |
| 1410 | |
| 1411 | /* SwigPyClientData */ |
| 1412 | |
| 1413 | typedef struct { |
| 1414 | PyObject *klass; |
| 1415 | PyObject *newraw; |
| 1416 | PyObject *newargs; |
| 1417 | PyObject *destroy; |
| 1418 | int delargs; |
| 1419 | int implicitconv; |
| 1420 | PyTypeObject *pytype; |
| 1421 | } SwigPyClientData; |
| 1422 | |
| 1423 | SWIGRUNTIMEINLINE int |
| 1424 | SWIG_Python_CheckImplicit(swig_type_info *ty) |
| 1425 | { |
| 1426 | SwigPyClientData *data = (SwigPyClientData *)ty->clientdata; |
| 1427 | return data ? data->implicitconv : 0; |
| 1428 | } |
| 1429 | |
| 1430 | SWIGRUNTIMEINLINE PyObject * |
| 1431 | SWIG_Python_ExceptionType(swig_type_info *desc) { |
| 1432 | SwigPyClientData *data = desc ? (SwigPyClientData *) desc->clientdata : 0; |
| 1433 | PyObject *klass = data ? data->klass : 0; |
| 1434 | return (klass ? klass : PyExc_RuntimeError); |
| 1435 | } |
| 1436 | |
| 1437 | |
| 1438 | SWIGRUNTIME SwigPyClientData * |
| 1439 | SwigPyClientData_New(PyObject* obj) |
| 1440 | { |
| 1441 | if (!obj) { |
| 1442 | return 0; |
| 1443 | } else { |
| 1444 | SwigPyClientData *data = (SwigPyClientData *)malloc(sizeof(SwigPyClientData)); |
| 1445 | /* the klass element */ |
| 1446 | data->klass = obj; |
| 1447 | Py_INCREF(data->klass); |
| 1448 | /* the newraw method and newargs arguments used to create a new raw instance */ |
| 1449 | if (PyClass_Check(obj)) { |
| 1450 | data->newraw = 0; |
| 1451 | data->newargs = obj; |
| 1452 | Py_INCREF(obj); |
| 1453 | } else { |
| 1454 | #if (PY_VERSION_HEX < 0x02020000) |
| 1455 | data->newraw = 0; |
| 1456 | #else |
| 1457 | data->newraw = PyObject_GetAttrString(data->klass, (char *)"__new__"); |
| 1458 | #endif |
| 1459 | if (data->newraw) { |
| 1460 | Py_INCREF(data->newraw); |
| 1461 | data->newargs = PyTuple_New(1); |
| 1462 | PyTuple_SetItem(data->newargs, 0, obj); |
| 1463 | } else { |
| 1464 | data->newargs = obj; |
| 1465 | } |
| 1466 | Py_INCREF(data->newargs); |
| 1467 | } |
| 1468 | /* the destroy method, aka as the C++ delete method */ |
| 1469 | data->destroy = PyObject_GetAttrString(data->klass, (char *)"__swig_destroy__"); |
| 1470 | if (PyErr_Occurred()) { |
| 1471 | PyErr_Clear(); |
| 1472 | data->destroy = 0; |
| 1473 | } |
| 1474 | if (data->destroy) { |
| 1475 | int flags; |
| 1476 | Py_INCREF(data->destroy); |
| 1477 | flags = PyCFunction_GET_FLAGS(data->destroy); |
| 1478 | #ifdef METH_O |
| 1479 | data->delargs = !(flags & (METH_O)); |
| 1480 | #else |
| 1481 | data->delargs = 0; |
| 1482 | #endif |
| 1483 | } else { |
| 1484 | data->delargs = 0; |
| 1485 | } |
| 1486 | data->implicitconv = 0; |
| 1487 | data->pytype = 0; |
| 1488 | return data; |
| 1489 | } |
| 1490 | } |
| 1491 | |
| 1492 | SWIGRUNTIME void |
| 1493 | SwigPyClientData_Del(SwigPyClientData *data) { |
| 1494 | Py_XDECREF(data->newraw); |
| 1495 | Py_XDECREF(data->newargs); |
| 1496 | Py_XDECREF(data->destroy); |
| 1497 | } |
| 1498 | |
| 1499 | /* =============== SwigPyObject =====================*/ |
| 1500 | |
| 1501 | typedef struct { |
| 1502 | PyObject_HEAD |
| 1503 | void *ptr; |
| 1504 | swig_type_info *ty; |
| 1505 | int own; |
| 1506 | PyObject *next; |
| 1507 | #ifdef SWIGPYTHON_BUILTIN |
| 1508 | PyObject *dict; |
| 1509 | #endif |
| 1510 | } SwigPyObject; |
| 1511 | |
| 1512 | SWIGRUNTIME PyObject * |
| 1513 | SwigPyObject_long(SwigPyObject *v) |
| 1514 | { |
| 1515 | return PyLong_FromVoidPtr(v->ptr); |
| 1516 | } |
| 1517 | |
| 1518 | SWIGRUNTIME PyObject * |
| 1519 | SwigPyObject_format(const char* fmt, SwigPyObject *v) |
| 1520 | { |
| 1521 | PyObject *res = NULL; |
| 1522 | PyObject *args = PyTuple_New(1); |
| 1523 | if (args) { |
| 1524 | if (PyTuple_SetItem(args, 0, SwigPyObject_long(v)) == 0) { |
| 1525 | PyObject *ofmt = SWIG_Python_str_FromChar(fmt); |
| 1526 | if (ofmt) { |
| 1527 | #if PY_VERSION_HEX >= 0x03000000 |
| 1528 | res = PyUnicode_Format(ofmt,args); |
| 1529 | #else |
| 1530 | res = PyString_Format(ofmt,args); |
| 1531 | #endif |
| 1532 | Py_DECREF(ofmt); |
| 1533 | } |
| 1534 | Py_DECREF(args); |
| 1535 | } |
| 1536 | } |
| 1537 | return res; |
| 1538 | } |
| 1539 | |
| 1540 | SWIGRUNTIME PyObject * |
| 1541 | SwigPyObject_oct(SwigPyObject *v) |
| 1542 | { |
| 1543 | return SwigPyObject_format("%o",v); |
| 1544 | } |
| 1545 | |
| 1546 | SWIGRUNTIME PyObject * |
| 1547 | SwigPyObject_hex(SwigPyObject *v) |
| 1548 | { |
| 1549 | return SwigPyObject_format("%x",v); |
| 1550 | } |
| 1551 | |
| 1552 | SWIGRUNTIME PyObject * |
| 1553 | #ifdef METH_NOARGS |
| 1554 | SwigPyObject_repr(SwigPyObject *v) |
| 1555 | #else |
| 1556 | SwigPyObject_repr(SwigPyObject *v, PyObject *args) |
| 1557 | #endif |
| 1558 | { |
| 1559 | const char *name = SWIG_TypePrettyName(v->ty); |
| 1560 | PyObject *repr = SWIG_Python_str_FromFormat("<Swig Object of type '%s' at %p>", (name ? name : "unknown"), (void *)v); |
| 1561 | if (v->next) { |
| 1562 | # ifdef METH_NOARGS |
| 1563 | PyObject *nrep = SwigPyObject_repr((SwigPyObject *)v->next); |
| 1564 | # else |
| 1565 | PyObject *nrep = SwigPyObject_repr((SwigPyObject *)v->next, args); |
| 1566 | # endif |
| 1567 | # if PY_VERSION_HEX >= 0x03000000 |
| 1568 | PyObject *joined = PyUnicode_Concat(repr, nrep); |
| 1569 | Py_DecRef(repr); |
| 1570 | Py_DecRef(nrep); |
| 1571 | repr = joined; |
| 1572 | # else |
| 1573 | PyString_ConcatAndDel(&repr,nrep); |
| 1574 | # endif |
| 1575 | } |
| 1576 | return repr; |
| 1577 | } |
| 1578 | |
| 1579 | SWIGRUNTIME int |
| 1580 | SwigPyObject_print(SwigPyObject *v, FILE *fp, int SWIGUNUSEDPARM(flags)) |
| 1581 | { |
| 1582 | char *str; |
| 1583 | #ifdef METH_NOARGS |
| 1584 | PyObject *repr = SwigPyObject_repr(v); |
| 1585 | #else |
| 1586 | PyObject *repr = SwigPyObject_repr(v, NULL); |
| 1587 | #endif |
| 1588 | if (repr) { |
| 1589 | str = SWIG_Python_str_AsChar(repr); |
| 1590 | fputs(str, fp); |
| 1591 | SWIG_Python_str_DelForPy3(str); |
| 1592 | Py_DECREF(repr); |
| 1593 | return 0; |
| 1594 | } else { |
| 1595 | return 1; |
| 1596 | } |
| 1597 | } |
| 1598 | |
| 1599 | SWIGRUNTIME PyObject * |
| 1600 | SwigPyObject_str(SwigPyObject *v) |
| 1601 | { |
| 1602 | char result[SWIG_BUFFER_SIZE]; |
| 1603 | return SWIG_PackVoidPtr(result, v->ptr, v->ty->name, sizeof(result)) ? |
| 1604 | SWIG_Python_str_FromChar(result) : 0; |
| 1605 | } |
| 1606 | |
| 1607 | SWIGRUNTIME int |
| 1608 | SwigPyObject_compare(SwigPyObject *v, SwigPyObject *w) |
| 1609 | { |
| 1610 | void *i = v->ptr; |
| 1611 | void *j = w->ptr; |
| 1612 | return (i < j) ? -1 : ((i > j) ? 1 : 0); |
| 1613 | } |
| 1614 | |
| 1615 | /* Added for Python 3.x, would it also be useful for Python 2.x? */ |
| 1616 | SWIGRUNTIME PyObject* |
| 1617 | SwigPyObject_richcompare(SwigPyObject *v, SwigPyObject *w, int op) |
| 1618 | { |
| 1619 | PyObject* res; |
| 1620 | if( op != Py_EQ && op != Py_NE ) { |
| 1621 | Py_INCREF(Py_NotImplemented); |
| 1622 | return Py_NotImplemented; |
| 1623 | } |
| 1624 | res = PyBool_FromLong( (SwigPyObject_compare(v, w)==0) == (op == Py_EQ) ? 1 : 0); |
| 1625 | return res; |
| 1626 | } |
| 1627 | |
| 1628 | |
| 1629 | SWIGRUNTIME PyTypeObject* SwigPyObject_TypeOnce(void); |
| 1630 | |
| 1631 | #ifdef SWIGPYTHON_BUILTIN |
| 1632 | static swig_type_info *SwigPyObject_stype = 0; |
| 1633 | SWIGRUNTIME PyTypeObject* |
| 1634 | SwigPyObject_type(void) { |
| 1635 | SwigPyClientData *cd; |
| 1636 | assert(SwigPyObject_stype); |
| 1637 | cd = (SwigPyClientData*) SwigPyObject_stype->clientdata; |
| 1638 | assert(cd); |
| 1639 | assert(cd->pytype); |
| 1640 | return cd->pytype; |
| 1641 | } |
| 1642 | #else |
| 1643 | SWIGRUNTIME PyTypeObject* |
| 1644 | SwigPyObject_type(void) { |
| 1645 | static PyTypeObject *SWIG_STATIC_POINTER(type) = SwigPyObject_TypeOnce(); |
| 1646 | return type; |
| 1647 | } |
| 1648 | #endif |
| 1649 | |
| 1650 | SWIGRUNTIMEINLINE int |
| 1651 | SwigPyObject_Check(PyObject *op) { |
| 1652 | #ifdef SWIGPYTHON_BUILTIN |
| 1653 | PyTypeObject *target_tp = SwigPyObject_type(); |
| 1654 | if (PyType_IsSubtype(op->ob_type, target_tp)) |
| 1655 | return 1; |
| 1656 | return (strcmp(op->ob_type->tp_name, "SwigPyObject") == 0); |
| 1657 | #else |
| 1658 | return (Py_TYPE(op) == SwigPyObject_type()) |
| 1659 | || (strcmp(Py_TYPE(op)->tp_name,"SwigPyObject") == 0); |
| 1660 | #endif |
| 1661 | } |
| 1662 | |
| 1663 | SWIGRUNTIME PyObject * |
| 1664 | SwigPyObject_New(void *ptr, swig_type_info *ty, int own); |
| 1665 | |
| 1666 | SWIGRUNTIME void |
| 1667 | SwigPyObject_dealloc(PyObject *v) |
| 1668 | { |
| 1669 | SwigPyObject *sobj = (SwigPyObject *) v; |
| 1670 | PyObject *next = sobj->next; |
| 1671 | if (sobj->own == SWIG_POINTER_OWN) { |
| 1672 | swig_type_info *ty = sobj->ty; |
| 1673 | SwigPyClientData *data = ty ? (SwigPyClientData *) ty->clientdata : 0; |
| 1674 | PyObject *destroy = data ? data->destroy : 0; |
| 1675 | if (destroy) { |
| 1676 | /* destroy is always a VARARGS method */ |
| 1677 | PyObject *res; |
| 1678 | if (data->delargs) { |
| 1679 | /* we need to create a temporary object to carry the destroy operation */ |
| 1680 | PyObject *tmp = SwigPyObject_New(sobj->ptr, ty, 0); |
| 1681 | res = SWIG_Python_CallFunctor(destroy, tmp); |
| 1682 | Py_DECREF(tmp); |
| 1683 | } else { |
| 1684 | PyCFunction meth = PyCFunction_GET_FUNCTION(destroy); |
| 1685 | PyObject *mself = PyCFunction_GET_SELF(destroy); |
| 1686 | res = ((*meth)(mself, v)); |
| 1687 | } |
| 1688 | Py_XDECREF(res); |
| 1689 | } |
| 1690 | #if !defined(SWIG_PYTHON_SILENT_MEMLEAK) |
| 1691 | else { |
| 1692 | const char *name = SWIG_TypePrettyName(ty); |
| 1693 | printf("swig/python detected a memory leak of type '%s', no destructor found.\n", (name ? name : "unknown")); |
| 1694 | } |
| 1695 | #endif |
| 1696 | } |
| 1697 | Py_XDECREF(next); |
| 1698 | PyObject_DEL(v); |
| 1699 | } |
| 1700 | |
| 1701 | SWIGRUNTIME PyObject* |
| 1702 | SwigPyObject_append(PyObject* v, PyObject* next) |
| 1703 | { |
| 1704 | SwigPyObject *sobj = (SwigPyObject *) v; |
| 1705 | #ifndef METH_O |
| 1706 | PyObject *tmp = 0; |
| 1707 | if (!PyArg_ParseTuple(next,(char *)"O:append", &tmp)) return NULL; |
| 1708 | next = tmp; |
| 1709 | #endif |
| 1710 | if (!SwigPyObject_Check(next)) { |
| 1711 | return NULL; |
| 1712 | } |
| 1713 | sobj->next = next; |
| 1714 | Py_INCREF(next); |
| 1715 | return SWIG_Py_Void(); |
| 1716 | } |
| 1717 | |
| 1718 | SWIGRUNTIME PyObject* |
| 1719 | #ifdef METH_NOARGS |
| 1720 | SwigPyObject_next(PyObject* v) |
| 1721 | #else |
| 1722 | SwigPyObject_next(PyObject* v, PyObject *SWIGUNUSEDPARM(args)) |
| 1723 | #endif |
| 1724 | { |
| 1725 | SwigPyObject *sobj = (SwigPyObject *) v; |
| 1726 | if (sobj->next) { |
| 1727 | Py_INCREF(sobj->next); |
| 1728 | return sobj->next; |
| 1729 | } else { |
| 1730 | return SWIG_Py_Void(); |
| 1731 | } |
| 1732 | } |
| 1733 | |
| 1734 | SWIGINTERN PyObject* |
| 1735 | #ifdef METH_NOARGS |
| 1736 | SwigPyObject_disown(PyObject *v) |
| 1737 | #else |
| 1738 | SwigPyObject_disown(PyObject* v, PyObject *SWIGUNUSEDPARM(args)) |
| 1739 | #endif |
| 1740 | { |
| 1741 | SwigPyObject *sobj = (SwigPyObject *)v; |
| 1742 | sobj->own = 0; |
| 1743 | return SWIG_Py_Void(); |
| 1744 | } |
| 1745 | |
| 1746 | SWIGINTERN PyObject* |
| 1747 | #ifdef METH_NOARGS |
| 1748 | SwigPyObject_acquire(PyObject *v) |
| 1749 | #else |
| 1750 | SwigPyObject_acquire(PyObject* v, PyObject *SWIGUNUSEDPARM(args)) |
| 1751 | #endif |
| 1752 | { |
| 1753 | SwigPyObject *sobj = (SwigPyObject *)v; |
| 1754 | sobj->own = SWIG_POINTER_OWN; |
| 1755 | return SWIG_Py_Void(); |
| 1756 | } |
| 1757 | |
| 1758 | SWIGINTERN PyObject* |
| 1759 | SwigPyObject_own(PyObject *v, PyObject *args) |
| 1760 | { |
| 1761 | PyObject *val = 0; |
| 1762 | #if (PY_VERSION_HEX < 0x02020000) |
| 1763 | if (!PyArg_ParseTuple(args,(char *)"|O:own",&val)) |
| 1764 | #elif (PY_VERSION_HEX < 0x02050000) |
| 1765 | if (!PyArg_UnpackTuple(args, (char *)"own", 0, 1, &val)) |
| 1766 | #else |
| 1767 | if (!PyArg_UnpackTuple(args, "own", 0, 1, &val)) |
| 1768 | #endif |
| 1769 | { |
| 1770 | return NULL; |
| 1771 | } |
| 1772 | else |
| 1773 | { |
| 1774 | SwigPyObject *sobj = (SwigPyObject *)v; |
| 1775 | PyObject *obj = PyBool_FromLong(sobj->own); |
| 1776 | if (val) { |
| 1777 | #ifdef METH_NOARGS |
| 1778 | if (PyObject_IsTrue(val)) { |
| 1779 | SwigPyObject_acquire(v); |
| 1780 | } else { |
| 1781 | SwigPyObject_disown(v); |
| 1782 | } |
| 1783 | #else |
| 1784 | if (PyObject_IsTrue(val)) { |
| 1785 | SwigPyObject_acquire(v,args); |
| 1786 | } else { |
| 1787 | SwigPyObject_disown(v,args); |
| 1788 | } |
| 1789 | #endif |
| 1790 | } |
| 1791 | return obj; |
| 1792 | } |
| 1793 | } |
| 1794 | |
| 1795 | #ifdef METH_O |
| 1796 | static PyMethodDef |
| 1797 | swigobject_methods[] = { |
| 1798 | {(char *)"disown", (PyCFunction)SwigPyObject_disown, METH_NOARGS, (char *)"releases ownership of the pointer"}, |
| 1799 | {(char *)"acquire", (PyCFunction)SwigPyObject_acquire, METH_NOARGS, (char *)"aquires ownership of the pointer"}, |
| 1800 | {(char *)"own", (PyCFunction)SwigPyObject_own, METH_VARARGS, (char *)"returns/sets ownership of the pointer"}, |
| 1801 | {(char *)"append", (PyCFunction)SwigPyObject_append, METH_O, (char *)"appends another 'this' object"}, |
| 1802 | {(char *)"next", (PyCFunction)SwigPyObject_next, METH_NOARGS, (char *)"returns the next 'this' object"}, |
| 1803 | {(char *)"__repr__",(PyCFunction)SwigPyObject_repr, METH_NOARGS, (char *)"returns object representation"}, |
| 1804 | {0, 0, 0, 0} |
| 1805 | }; |
| 1806 | #else |
| 1807 | static PyMethodDef |
| 1808 | swigobject_methods[] = { |
| 1809 | {(char *)"disown", (PyCFunction)SwigPyObject_disown, METH_VARARGS, (char *)"releases ownership of the pointer"}, |
| 1810 | {(char *)"acquire", (PyCFunction)SwigPyObject_acquire, METH_VARARGS, (char *)"aquires ownership of the pointer"}, |
| 1811 | {(char *)"own", (PyCFunction)SwigPyObject_own, METH_VARARGS, (char *)"returns/sets ownership of the pointer"}, |
| 1812 | {(char *)"append", (PyCFunction)SwigPyObject_append, METH_VARARGS, (char *)"appends another 'this' object"}, |
| 1813 | {(char *)"next", (PyCFunction)SwigPyObject_next, METH_VARARGS, (char *)"returns the next 'this' object"}, |
| 1814 | {(char *)"__repr__",(PyCFunction)SwigPyObject_repr, METH_VARARGS, (char *)"returns object representation"}, |
| 1815 | {0, 0, 0, 0} |
| 1816 | }; |
| 1817 | #endif |
| 1818 | |
| 1819 | #if PY_VERSION_HEX < 0x02020000 |
| 1820 | SWIGINTERN PyObject * |
| 1821 | SwigPyObject_getattr(SwigPyObject *sobj,char *name) |
| 1822 | { |
| 1823 | return Py_FindMethod(swigobject_methods, (PyObject *)sobj, name); |
| 1824 | } |
| 1825 | #endif |
| 1826 | |
| 1827 | SWIGRUNTIME PyTypeObject* |
| 1828 | SwigPyObject_TypeOnce(void) { |
| 1829 | static char swigobject_doc[] = "Swig object carries a C/C++ instance pointer"; |
| 1830 | |
| 1831 | static PyNumberMethods SwigPyObject_as_number = { |
| 1832 | (binaryfunc)0, /*nb_add*/ |
| 1833 | (binaryfunc)0, /*nb_subtract*/ |
| 1834 | (binaryfunc)0, /*nb_multiply*/ |
| 1835 | /* nb_divide removed in Python 3 */ |
| 1836 | #if PY_VERSION_HEX < 0x03000000 |
| 1837 | (binaryfunc)0, /*nb_divide*/ |
| 1838 | #endif |
| 1839 | (binaryfunc)0, /*nb_remainder*/ |
| 1840 | (binaryfunc)0, /*nb_divmod*/ |
| 1841 | (ternaryfunc)0,/*nb_power*/ |
| 1842 | (unaryfunc)0, /*nb_negative*/ |
| 1843 | (unaryfunc)0, /*nb_positive*/ |
| 1844 | (unaryfunc)0, /*nb_absolute*/ |
| 1845 | (inquiry)0, /*nb_nonzero*/ |
| 1846 | 0, /*nb_invert*/ |
| 1847 | 0, /*nb_lshift*/ |
| 1848 | 0, /*nb_rshift*/ |
| 1849 | 0, /*nb_and*/ |
| 1850 | 0, /*nb_xor*/ |
| 1851 | 0, /*nb_or*/ |
| 1852 | #if PY_VERSION_HEX < 0x03000000 |
| 1853 | 0, /*nb_coerce*/ |
| 1854 | #endif |
| 1855 | (unaryfunc)SwigPyObject_long, /*nb_int*/ |
| 1856 | #if PY_VERSION_HEX < 0x03000000 |
| 1857 | (unaryfunc)SwigPyObject_long, /*nb_long*/ |
| 1858 | #else |
| 1859 | 0, /*nb_reserved*/ |
| 1860 | #endif |
| 1861 | (unaryfunc)0, /*nb_float*/ |
| 1862 | #if PY_VERSION_HEX < 0x03000000 |
| 1863 | (unaryfunc)SwigPyObject_oct, /*nb_oct*/ |
| 1864 | (unaryfunc)SwigPyObject_hex, /*nb_hex*/ |
| 1865 | #endif |
| 1866 | #if PY_VERSION_HEX >= 0x03000000 /* 3.0 */ |
| 1867 | 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 /* nb_inplace_add -> nb_index, nb_inplace_divide removed */ |
| 1868 | #elif PY_VERSION_HEX >= 0x02050000 /* 2.5.0 */ |
| 1869 | 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 /* nb_inplace_add -> nb_index */ |
| 1870 | #elif PY_VERSION_HEX >= 0x02020000 /* 2.2.0 */ |
| 1871 | 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 /* nb_inplace_add -> nb_inplace_true_divide */ |
| 1872 | #elif PY_VERSION_HEX >= 0x02000000 /* 2.0.0 */ |
| 1873 | 0,0,0,0,0,0,0,0,0,0,0 /* nb_inplace_add -> nb_inplace_or */ |
| 1874 | #endif |
| 1875 | }; |
| 1876 | |
| 1877 | static PyTypeObject swigpyobject_type; |
| 1878 | static int type_init = 0; |
| 1879 | if (!type_init) { |
| 1880 | const PyTypeObject tmp = { |
| 1881 | /* PyObject header changed in Python 3 */ |
| 1882 | #if PY_VERSION_HEX >= 0x03000000 |
| 1883 | PyVarObject_HEAD_INIT(NULL, 0) |
| 1884 | #else |
| 1885 | PyObject_HEAD_INIT(NULL) |
| 1886 | 0, /* ob_size */ |
| 1887 | #endif |
| 1888 | (char *)"SwigPyObject", /* tp_name */ |
| 1889 | sizeof(SwigPyObject), /* tp_basicsize */ |
| 1890 | 0, /* tp_itemsize */ |
| 1891 | (destructor)SwigPyObject_dealloc, /* tp_dealloc */ |
| 1892 | (printfunc)SwigPyObject_print, /* tp_print */ |
| 1893 | #if PY_VERSION_HEX < 0x02020000 |
| 1894 | (getattrfunc)SwigPyObject_getattr, /* tp_getattr */ |
| 1895 | #else |
| 1896 | (getattrfunc)0, /* tp_getattr */ |
| 1897 | #endif |
| 1898 | (setattrfunc)0, /* tp_setattr */ |
| 1899 | #if PY_VERSION_HEX >= 0x03000000 |
| 1900 | 0, /* tp_reserved in 3.0.1, tp_compare in 3.0.0 but not used */ |
| 1901 | #else |
| 1902 | (cmpfunc)SwigPyObject_compare, /* tp_compare */ |
| 1903 | #endif |
| 1904 | (reprfunc)SwigPyObject_repr, /* tp_repr */ |
| 1905 | &SwigPyObject_as_number, /* tp_as_number */ |
| 1906 | 0, /* tp_as_sequence */ |
| 1907 | 0, /* tp_as_mapping */ |
| 1908 | (hashfunc)0, /* tp_hash */ |
| 1909 | (ternaryfunc)0, /* tp_call */ |
| 1910 | (reprfunc)SwigPyObject_str, /* tp_str */ |
| 1911 | PyObject_GenericGetAttr, /* tp_getattro */ |
| 1912 | 0, /* tp_setattro */ |
| 1913 | 0, /* tp_as_buffer */ |
| 1914 | Py_TPFLAGS_DEFAULT, /* tp_flags */ |
| 1915 | swigobject_doc, /* tp_doc */ |
| 1916 | 0, /* tp_traverse */ |
| 1917 | 0, /* tp_clear */ |
| 1918 | (richcmpfunc)SwigPyObject_richcompare,/* tp_richcompare */ |
| 1919 | 0, /* tp_weaklistoffset */ |
| 1920 | #if PY_VERSION_HEX >= 0x02020000 |
| 1921 | 0, /* tp_iter */ |
| 1922 | 0, /* tp_iternext */ |
| 1923 | swigobject_methods, /* tp_methods */ |
| 1924 | 0, /* tp_members */ |
| 1925 | 0, /* tp_getset */ |
| 1926 | 0, /* tp_base */ |
| 1927 | 0, /* tp_dict */ |
| 1928 | 0, /* tp_descr_get */ |
| 1929 | 0, /* tp_descr_set */ |
| 1930 | 0, /* tp_dictoffset */ |
| 1931 | 0, /* tp_init */ |
| 1932 | 0, /* tp_alloc */ |
| 1933 | 0, /* tp_new */ |
| 1934 | 0, /* tp_free */ |
| 1935 | 0, /* tp_is_gc */ |
| 1936 | 0, /* tp_bases */ |
| 1937 | 0, /* tp_mro */ |
| 1938 | 0, /* tp_cache */ |
| 1939 | 0, /* tp_subclasses */ |
| 1940 | 0, /* tp_weaklist */ |
| 1941 | #endif |
| 1942 | #if PY_VERSION_HEX >= 0x02030000 |
| 1943 | 0, /* tp_del */ |
| 1944 | #endif |
| 1945 | #if PY_VERSION_HEX >= 0x02060000 |
| 1946 | 0, /* tp_version */ |
| 1947 | #endif |
| 1948 | #ifdef COUNT_ALLOCS |
| 1949 | 0,0,0,0 /* tp_alloc -> tp_next */ |
| 1950 | #endif |
| 1951 | }; |
| 1952 | swigpyobject_type = tmp; |
| 1953 | type_init = 1; |
| 1954 | #if PY_VERSION_HEX < 0x02020000 |
| 1955 | swigpyobject_type.ob_type = &PyType_Type; |
| 1956 | #else |
| 1957 | if (PyType_Ready(&swigpyobject_type) < 0) |
| 1958 | return NULL; |
| 1959 | #endif |
| 1960 | } |
| 1961 | return &swigpyobject_type; |
| 1962 | } |
| 1963 | |
| 1964 | SWIGRUNTIME PyObject * |
| 1965 | SwigPyObject_New(void *ptr, swig_type_info *ty, int own) |
| 1966 | { |
| 1967 | SwigPyObject *sobj = PyObject_NEW(SwigPyObject, SwigPyObject_type()); |
| 1968 | if (sobj) { |
| 1969 | sobj->ptr = ptr; |
| 1970 | sobj->ty = ty; |
| 1971 | sobj->own = own; |
| 1972 | sobj->next = 0; |
| 1973 | } |
| 1974 | return (PyObject *)sobj; |
| 1975 | } |
| 1976 | |
| 1977 | /* ----------------------------------------------------------------------------- |
| 1978 | * Implements a simple Swig Packed type, and use it instead of string |
| 1979 | * ----------------------------------------------------------------------------- */ |
| 1980 | |
| 1981 | typedef struct { |
| 1982 | PyObject_HEAD |
| 1983 | void *pack; |
| 1984 | swig_type_info *ty; |
| 1985 | size_t size; |
| 1986 | } SwigPyPacked; |
| 1987 | |
| 1988 | SWIGRUNTIME int |
| 1989 | SwigPyPacked_print(SwigPyPacked *v, FILE *fp, int SWIGUNUSEDPARM(flags)) |
| 1990 | { |
| 1991 | char result[SWIG_BUFFER_SIZE]; |
| 1992 | fputs("<Swig Packed ", fp); |
| 1993 | if (SWIG_PackDataName(result, v->pack, v->size, 0, sizeof(result))) { |
| 1994 | fputs("at ", fp); |
| 1995 | fputs(result, fp); |
| 1996 | } |
| 1997 | fputs(v->ty->name,fp); |
| 1998 | fputs(">", fp); |
| 1999 | return 0; |
| 2000 | } |
| 2001 | |
| 2002 | SWIGRUNTIME PyObject * |
| 2003 | SwigPyPacked_repr(SwigPyPacked *v) |
| 2004 | { |
| 2005 | char result[SWIG_BUFFER_SIZE]; |
| 2006 | if (SWIG_PackDataName(result, v->pack, v->size, 0, sizeof(result))) { |
| 2007 | return SWIG_Python_str_FromFormat("<Swig Packed at %s%s>", result, v->ty->name); |
| 2008 | } else { |
| 2009 | return SWIG_Python_str_FromFormat("<Swig Packed %s>", v->ty->name); |
| 2010 | } |
| 2011 | } |
| 2012 | |
| 2013 | SWIGRUNTIME PyObject * |
| 2014 | SwigPyPacked_str(SwigPyPacked *v) |
| 2015 | { |
| 2016 | char result[SWIG_BUFFER_SIZE]; |
| 2017 | if (SWIG_PackDataName(result, v->pack, v->size, 0, sizeof(result))){ |
| 2018 | return SWIG_Python_str_FromFormat("%s%s", result, v->ty->name); |
| 2019 | } else { |
| 2020 | return SWIG_Python_str_FromChar(v->ty->name); |
| 2021 | } |
| 2022 | } |
| 2023 | |
| 2024 | SWIGRUNTIME int |
| 2025 | SwigPyPacked_compare(SwigPyPacked *v, SwigPyPacked *w) |
| 2026 | { |
| 2027 | size_t i = v->size; |
| 2028 | size_t j = w->size; |
| 2029 | int s = (i < j) ? -1 : ((i > j) ? 1 : 0); |
| 2030 | return s ? s : strncmp((char *)v->pack, (char *)w->pack, 2*v->size); |
| 2031 | } |
| 2032 | |
| 2033 | SWIGRUNTIME PyTypeObject* SwigPyPacked_TypeOnce(void); |
| 2034 | |
| 2035 | SWIGRUNTIME PyTypeObject* |
| 2036 | SwigPyPacked_type(void) { |
| 2037 | static PyTypeObject *SWIG_STATIC_POINTER(type) = SwigPyPacked_TypeOnce(); |
| 2038 | return type; |
| 2039 | } |
| 2040 | |
| 2041 | SWIGRUNTIMEINLINE int |
| 2042 | SwigPyPacked_Check(PyObject *op) { |
| 2043 | return ((op)->ob_type == SwigPyPacked_TypeOnce()) |
| 2044 | || (strcmp((op)->ob_type->tp_name,"SwigPyPacked") == 0); |
| 2045 | } |
| 2046 | |
| 2047 | SWIGRUNTIME void |
| 2048 | SwigPyPacked_dealloc(PyObject *v) |
| 2049 | { |
| 2050 | if (SwigPyPacked_Check(v)) { |
| 2051 | SwigPyPacked *sobj = (SwigPyPacked *) v; |
| 2052 | free(sobj->pack); |
| 2053 | } |
| 2054 | PyObject_DEL(v); |
| 2055 | } |
| 2056 | |
| 2057 | SWIGRUNTIME PyTypeObject* |
| 2058 | SwigPyPacked_TypeOnce(void) { |
| 2059 | static char swigpacked_doc[] = "Swig object carries a C/C++ instance pointer"; |
| 2060 | static PyTypeObject swigpypacked_type; |
| 2061 | static int type_init = 0; |
| 2062 | if (!type_init) { |
| 2063 | const PyTypeObject tmp = { |
| 2064 | /* PyObject header changed in Python 3 */ |
| 2065 | #if PY_VERSION_HEX>=0x03000000 |
| 2066 | PyVarObject_HEAD_INIT(NULL, 0) |
| 2067 | #else |
| 2068 | PyObject_HEAD_INIT(NULL) |
| 2069 | 0, /* ob_size */ |
| 2070 | #endif |
| 2071 | (char *)"SwigPyPacked", /* tp_name */ |
| 2072 | sizeof(SwigPyPacked), /* tp_basicsize */ |
| 2073 | 0, /* tp_itemsize */ |
| 2074 | (destructor)SwigPyPacked_dealloc, /* tp_dealloc */ |
| 2075 | (printfunc)SwigPyPacked_print, /* tp_print */ |
| 2076 | (getattrfunc)0, /* tp_getattr */ |
| 2077 | (setattrfunc)0, /* tp_setattr */ |
| 2078 | #if PY_VERSION_HEX>=0x03000000 |
| 2079 | 0, /* tp_reserved in 3.0.1 */ |
| 2080 | #else |
| 2081 | (cmpfunc)SwigPyPacked_compare, /* tp_compare */ |
| 2082 | #endif |
| 2083 | (reprfunc)SwigPyPacked_repr, /* tp_repr */ |
| 2084 | 0, /* tp_as_number */ |
| 2085 | 0, /* tp_as_sequence */ |
| 2086 | 0, /* tp_as_mapping */ |
| 2087 | (hashfunc)0, /* tp_hash */ |
| 2088 | (ternaryfunc)0, /* tp_call */ |
| 2089 | (reprfunc)SwigPyPacked_str, /* tp_str */ |
| 2090 | PyObject_GenericGetAttr, /* tp_getattro */ |
| 2091 | 0, /* tp_setattro */ |
| 2092 | 0, /* tp_as_buffer */ |
| 2093 | Py_TPFLAGS_DEFAULT, /* tp_flags */ |
| 2094 | swigpacked_doc, /* tp_doc */ |
| 2095 | 0, /* tp_traverse */ |
| 2096 | 0, /* tp_clear */ |
| 2097 | 0, /* tp_richcompare */ |
| 2098 | 0, /* tp_weaklistoffset */ |
| 2099 | #if PY_VERSION_HEX >= 0x02020000 |
| 2100 | 0, /* tp_iter */ |
| 2101 | 0, /* tp_iternext */ |
| 2102 | 0, /* tp_methods */ |
| 2103 | 0, /* tp_members */ |
| 2104 | 0, /* tp_getset */ |
| 2105 | 0, /* tp_base */ |
| 2106 | 0, /* tp_dict */ |
| 2107 | 0, /* tp_descr_get */ |
| 2108 | 0, /* tp_descr_set */ |
| 2109 | 0, /* tp_dictoffset */ |
| 2110 | 0, /* tp_init */ |
| 2111 | 0, /* tp_alloc */ |
| 2112 | 0, /* tp_new */ |
| 2113 | 0, /* tp_free */ |
| 2114 | 0, /* tp_is_gc */ |
| 2115 | 0, /* tp_bases */ |
| 2116 | 0, /* tp_mro */ |
| 2117 | 0, /* tp_cache */ |
| 2118 | 0, /* tp_subclasses */ |
| 2119 | 0, /* tp_weaklist */ |
| 2120 | #endif |
| 2121 | #if PY_VERSION_HEX >= 0x02030000 |
| 2122 | 0, /* tp_del */ |
| 2123 | #endif |
| 2124 | #if PY_VERSION_HEX >= 0x02060000 |
| 2125 | 0, /* tp_version */ |
| 2126 | #endif |
| 2127 | #ifdef COUNT_ALLOCS |
| 2128 | 0,0,0,0 /* tp_alloc -> tp_next */ |
| 2129 | #endif |
| 2130 | }; |
| 2131 | swigpypacked_type = tmp; |
| 2132 | type_init = 1; |
| 2133 | #if PY_VERSION_HEX < 0x02020000 |
| 2134 | swigpypacked_type.ob_type = &PyType_Type; |
| 2135 | #else |
| 2136 | if (PyType_Ready(&swigpypacked_type) < 0) |
| 2137 | return NULL; |
| 2138 | #endif |
| 2139 | } |
| 2140 | return &swigpypacked_type; |
| 2141 | } |
| 2142 | |
| 2143 | SWIGRUNTIME PyObject * |
| 2144 | SwigPyPacked_New(void *ptr, size_t size, swig_type_info *ty) |
| 2145 | { |
| 2146 | SwigPyPacked *sobj = PyObject_NEW(SwigPyPacked, SwigPyPacked_type()); |
| 2147 | if (sobj) { |
| 2148 | void *pack = malloc(size); |
| 2149 | if (pack) { |
| 2150 | memcpy(pack, ptr, size); |
| 2151 | sobj->pack = pack; |
| 2152 | sobj->ty = ty; |
| 2153 | sobj->size = size; |
| 2154 | } else { |
| 2155 | PyObject_DEL((PyObject *) sobj); |
| 2156 | sobj = 0; |
| 2157 | } |
| 2158 | } |
| 2159 | return (PyObject *) sobj; |
| 2160 | } |
| 2161 | |
| 2162 | SWIGRUNTIME swig_type_info * |
| 2163 | SwigPyPacked_UnpackData(PyObject *obj, void *ptr, size_t size) |
| 2164 | { |
| 2165 | if (SwigPyPacked_Check(obj)) { |
| 2166 | SwigPyPacked *sobj = (SwigPyPacked *)obj; |
| 2167 | if (sobj->size != size) return 0; |
| 2168 | memcpy(ptr, sobj->pack, size); |
| 2169 | return sobj->ty; |
| 2170 | } else { |
| 2171 | return 0; |
| 2172 | } |
| 2173 | } |
| 2174 | |
| 2175 | /* ----------------------------------------------------------------------------- |
| 2176 | * pointers/data manipulation |
| 2177 | * ----------------------------------------------------------------------------- */ |
| 2178 | |
| 2179 | SWIGRUNTIMEINLINE PyObject * |
| 2180 | _SWIG_This(void) |
| 2181 | { |
| 2182 | return SWIG_Python_str_FromChar("this"); |
| 2183 | } |
| 2184 | |
| 2185 | static PyObject *swig_this = NULL; |
| 2186 | |
| 2187 | SWIGRUNTIME PyObject * |
| 2188 | SWIG_This(void) |
| 2189 | { |
| 2190 | if (swig_this == NULL) |
| 2191 | swig_this = _SWIG_This(); |
| 2192 | return swig_this; |
| 2193 | } |
| 2194 | |
| 2195 | /* #define SWIG_PYTHON_SLOW_GETSET_THIS */ |
| 2196 | |
| 2197 | /* TODO: I don't know how to implement the fast getset in Python 3 right now */ |
| 2198 | #if PY_VERSION_HEX>=0x03000000 |
| 2199 | #define SWIG_PYTHON_SLOW_GETSET_THIS |
| 2200 | #endif |
| 2201 | |
| 2202 | SWIGRUNTIME SwigPyObject * |
| 2203 | SWIG_Python_GetSwigThis(PyObject *pyobj) |
| 2204 | { |
| 2205 | PyObject *obj; |
| 2206 | |
| 2207 | if (SwigPyObject_Check(pyobj)) |
| 2208 | return (SwigPyObject *) pyobj; |
| 2209 | |
| 2210 | #ifdef SWIGPYTHON_BUILTIN |
| 2211 | (void)obj; |
| 2212 | # ifdef PyWeakref_CheckProxy |
| 2213 | if (PyWeakref_CheckProxy(pyobj)) { |
| 2214 | pyobj = PyWeakref_GET_OBJECT(pyobj); |
| 2215 | if (pyobj && SwigPyObject_Check(pyobj)) |
| 2216 | return (SwigPyObject*) pyobj; |
| 2217 | } |
| 2218 | # endif |
| 2219 | return NULL; |
| 2220 | #else |
| 2221 | |
| 2222 | obj = 0; |
| 2223 | |
| 2224 | #if (!defined(SWIG_PYTHON_SLOW_GETSET_THIS) && (PY_VERSION_HEX >= 0x02030000)) |
| 2225 | if (PyInstance_Check(pyobj)) { |
| 2226 | obj = _PyInstance_Lookup(pyobj, SWIG_This()); |
| 2227 | } else { |
| 2228 | PyObject **dictptr = _PyObject_GetDictPtr(pyobj); |
| 2229 | if (dictptr != NULL) { |
| 2230 | PyObject *dict = *dictptr; |
| 2231 | obj = dict ? PyDict_GetItem(dict, SWIG_This()) : 0; |
| 2232 | } else { |
| 2233 | #ifdef PyWeakref_CheckProxy |
| 2234 | if (PyWeakref_CheckProxy(pyobj)) { |
| 2235 | PyObject *wobj = PyWeakref_GET_OBJECT(pyobj); |
| 2236 | return wobj ? SWIG_Python_GetSwigThis(wobj) : 0; |
| 2237 | } |
| 2238 | #endif |
| 2239 | obj = PyObject_GetAttr(pyobj,SWIG_This()); |
| 2240 | if (obj) { |
| 2241 | Py_DECREF(obj); |
| 2242 | } else { |
| 2243 | if (PyErr_Occurred()) PyErr_Clear(); |
| 2244 | return 0; |
| 2245 | } |
| 2246 | } |
| 2247 | } |
| 2248 | #else |
| 2249 | obj = PyObject_GetAttr(pyobj,SWIG_This()); |
| 2250 | if (obj) { |
| 2251 | Py_DECREF(obj); |
| 2252 | } else { |
| 2253 | if (PyErr_Occurred()) PyErr_Clear(); |
| 2254 | return 0; |
| 2255 | } |
| 2256 | #endif |
| 2257 | if (obj && !SwigPyObject_Check(obj)) { |
| 2258 | /* a PyObject is called 'this', try to get the 'real this' |
| 2259 | SwigPyObject from it */ |
| 2260 | return SWIG_Python_GetSwigThis(obj); |
| 2261 | } |
| 2262 | return (SwigPyObject *)obj; |
| 2263 | #endif |
| 2264 | } |
| 2265 | |
| 2266 | /* Acquire a pointer value */ |
| 2267 | |
| 2268 | SWIGRUNTIME int |
| 2269 | SWIG_Python_AcquirePtr(PyObject *obj, int own) { |
| 2270 | if (own == SWIG_POINTER_OWN) { |
| 2271 | SwigPyObject *sobj = SWIG_Python_GetSwigThis(obj); |
| 2272 | if (sobj) { |
| 2273 | int oldown = sobj->own; |
| 2274 | sobj->own = own; |
| 2275 | return oldown; |
| 2276 | } |
| 2277 | } |
| 2278 | return 0; |
| 2279 | } |
| 2280 | |
| 2281 | /* Convert a pointer value */ |
| 2282 | |
| 2283 | SWIGRUNTIME int |
| 2284 | SWIG_Python_ConvertPtrAndOwn(PyObject *obj, void **ptr, swig_type_info *ty, int flags, int *own) { |
| 2285 | int res; |
| 2286 | SwigPyObject *sobj; |
| 2287 | |
| 2288 | if (!obj) |
| 2289 | return SWIG_ERROR; |
| 2290 | if (obj == Py_None) { |
| 2291 | if (ptr) |
| 2292 | *ptr = 0; |
| 2293 | return SWIG_OK; |
| 2294 | } |
| 2295 | |
| 2296 | res = SWIG_ERROR; |
| 2297 | |
| 2298 | sobj = SWIG_Python_GetSwigThis(obj); |
| 2299 | if (own) |
| 2300 | *own = 0; |
| 2301 | while (sobj) { |
| 2302 | void *vptr = sobj->ptr; |
| 2303 | if (ty) { |
| 2304 | swig_type_info *to = sobj->ty; |
| 2305 | if (to == ty) { |
| 2306 | /* no type cast needed */ |
| 2307 | if (ptr) *ptr = vptr; |
| 2308 | break; |
| 2309 | } else { |
| 2310 | swig_cast_info *tc = SWIG_TypeCheck(to->name,ty); |
| 2311 | if (!tc) { |
| 2312 | sobj = (SwigPyObject *)sobj->next; |
| 2313 | } else { |
| 2314 | if (ptr) { |
| 2315 | int newmemory = 0; |
| 2316 | *ptr = SWIG_TypeCast(tc,vptr,&newmemory); |
| 2317 | if (newmemory == SWIG_CAST_NEW_MEMORY) { |
| 2318 | assert(own); /* badly formed typemap which will lead to a memory leak - it must set and use own to delete *ptr */ |
| 2319 | if (own) |
| 2320 | *own = *own | SWIG_CAST_NEW_MEMORY; |
| 2321 | } |
| 2322 | } |
| 2323 | break; |
| 2324 | } |
| 2325 | } |
| 2326 | } else { |
| 2327 | if (ptr) *ptr = vptr; |
| 2328 | break; |
| 2329 | } |
| 2330 | } |
| 2331 | if (sobj) { |
| 2332 | if (own) |
| 2333 | *own = *own | sobj->own; |
| 2334 | if (flags & SWIG_POINTER_DISOWN) { |
| 2335 | sobj->own = 0; |
| 2336 | } |
| 2337 | res = SWIG_OK; |
| 2338 | } else { |
| 2339 | if (flags & SWIG_POINTER_IMPLICIT_CONV) { |
| 2340 | SwigPyClientData *data = ty ? (SwigPyClientData *) ty->clientdata : 0; |
| 2341 | if (data && !data->implicitconv) { |
| 2342 | PyObject *klass = data->klass; |
| 2343 | if (klass) { |
| 2344 | PyObject *impconv; |
| 2345 | data->implicitconv = 1; /* avoid recursion and call 'explicit' constructors*/ |
| 2346 | impconv = SWIG_Python_CallFunctor(klass, obj); |
| 2347 | data->implicitconv = 0; |
| 2348 | if (PyErr_Occurred()) { |
| 2349 | PyErr_Clear(); |
| 2350 | impconv = 0; |
| 2351 | } |
| 2352 | if (impconv) { |
| 2353 | SwigPyObject *iobj = SWIG_Python_GetSwigThis(impconv); |
| 2354 | if (iobj) { |
| 2355 | void *vptr; |
| 2356 | res = SWIG_Python_ConvertPtrAndOwn((PyObject*)iobj, &vptr, ty, 0, 0); |
| 2357 | if (SWIG_IsOK(res)) { |
| 2358 | if (ptr) { |
| 2359 | *ptr = vptr; |
| 2360 | /* transfer the ownership to 'ptr' */ |
| 2361 | iobj->own = 0; |
| 2362 | res = SWIG_AddCast(res); |
| 2363 | res = SWIG_AddNewMask(res); |
| 2364 | } else { |
| 2365 | res = SWIG_AddCast(res); |
| 2366 | } |
| 2367 | } |
| 2368 | } |
| 2369 | Py_DECREF(impconv); |
| 2370 | } |
| 2371 | } |
| 2372 | } |
| 2373 | } |
| 2374 | } |
| 2375 | return res; |
| 2376 | } |
| 2377 | |
| 2378 | /* Convert a function ptr value */ |
| 2379 | |
| 2380 | SWIGRUNTIME int |
| 2381 | SWIG_Python_ConvertFunctionPtr(PyObject *obj, void **ptr, swig_type_info *ty) { |
| 2382 | if (!PyCFunction_Check(obj)) { |
| 2383 | return SWIG_ConvertPtr(obj, ptr, ty, 0); |
| 2384 | } else { |
| 2385 | void *vptr = 0; |
| 2386 | |
| 2387 | /* here we get the method pointer for callbacks */ |
| 2388 | const char *doc = (((PyCFunctionObject *)obj) -> m_ml -> ml_doc); |
| 2389 | const char *desc = doc ? strstr(doc, "swig_ptr: ") : 0; |
| 2390 | if (desc) |
| 2391 | desc = ty ? SWIG_UnpackVoidPtr(desc + 10, &vptr, ty->name) : 0; |
| 2392 | if (!desc) |
| 2393 | return SWIG_ERROR; |
| 2394 | if (ty) { |
| 2395 | swig_cast_info *tc = SWIG_TypeCheck(desc,ty); |
| 2396 | if (tc) { |
| 2397 | int newmemory = 0; |
| 2398 | *ptr = SWIG_TypeCast(tc,vptr,&newmemory); |
| 2399 | assert(!newmemory); /* newmemory handling not yet implemented */ |
| 2400 | } else { |
| 2401 | return SWIG_ERROR; |
| 2402 | } |
| 2403 | } else { |
| 2404 | *ptr = vptr; |
| 2405 | } |
| 2406 | return SWIG_OK; |
| 2407 | } |
| 2408 | } |
| 2409 | |
| 2410 | /* Convert a packed value value */ |
| 2411 | |
| 2412 | SWIGRUNTIME int |
| 2413 | SWIG_Python_ConvertPacked(PyObject *obj, void *ptr, size_t sz, swig_type_info *ty) { |
| 2414 | swig_type_info *to = SwigPyPacked_UnpackData(obj, ptr, sz); |
| 2415 | if (!to) return SWIG_ERROR; |
| 2416 | if (ty) { |
| 2417 | if (to != ty) { |
| 2418 | /* check type cast? */ |
| 2419 | swig_cast_info *tc = SWIG_TypeCheck(to->name,ty); |
| 2420 | if (!tc) return SWIG_ERROR; |
| 2421 | } |
| 2422 | } |
| 2423 | return SWIG_OK; |
| 2424 | } |
| 2425 | |
| 2426 | /* ----------------------------------------------------------------------------- |
| 2427 | * Create a new pointer object |
| 2428 | * ----------------------------------------------------------------------------- */ |
| 2429 | |
| 2430 | /* |
| 2431 | Create a new instance object, without calling __init__, and set the |
| 2432 | 'this' attribute. |
| 2433 | */ |
| 2434 | |
| 2435 | SWIGRUNTIME PyObject* |
| 2436 | SWIG_Python_NewShadowInstance(SwigPyClientData *data, PyObject *swig_this) |
| 2437 | { |
| 2438 | #if (PY_VERSION_HEX >= 0x02020000) |
| 2439 | PyObject *inst = 0; |
| 2440 | PyObject *newraw = data->newraw; |
| 2441 | if (newraw) { |
| 2442 | inst = PyObject_Call(newraw, data->newargs, NULL); |
| 2443 | if (inst) { |
| 2444 | #if !defined(SWIG_PYTHON_SLOW_GETSET_THIS) |
| 2445 | PyObject **dictptr = _PyObject_GetDictPtr(inst); |
| 2446 | if (dictptr != NULL) { |
| 2447 | PyObject *dict = *dictptr; |
| 2448 | if (dict == NULL) { |
| 2449 | dict = PyDict_New(); |
| 2450 | *dictptr = dict; |
| 2451 | PyDict_SetItem(dict, SWIG_This(), swig_this); |
| 2452 | } |
| 2453 | } |
| 2454 | #else |
| 2455 | PyObject *key = SWIG_This(); |
| 2456 | PyObject_SetAttr(inst, key, swig_this); |
| 2457 | #endif |
| 2458 | } |
| 2459 | } else { |
| 2460 | #if PY_VERSION_HEX >= 0x03000000 |
| 2461 | inst = PyBaseObject_Type.tp_new((PyTypeObject*) data->newargs, Py_None, Py_None); |
| 2462 | PyObject_SetAttr(inst, SWIG_This(), swig_this); |
| 2463 | Py_TYPE(inst)->tp_flags &= ~Py_TPFLAGS_VALID_VERSION_TAG; |
| 2464 | #else |
| 2465 | PyObject *dict = PyDict_New(); |
| 2466 | PyDict_SetItem(dict, SWIG_This(), swig_this); |
| 2467 | inst = PyInstance_NewRaw(data->newargs, dict); |
| 2468 | Py_DECREF(dict); |
| 2469 | #endif |
| 2470 | } |
| 2471 | return inst; |
| 2472 | #else |
| 2473 | #if (PY_VERSION_HEX >= 0x02010000) |
| 2474 | PyObject *inst; |
| 2475 | PyObject *dict = PyDict_New(); |
| 2476 | PyDict_SetItem(dict, SWIG_This(), swig_this); |
| 2477 | inst = PyInstance_NewRaw(data->newargs, dict); |
| 2478 | Py_DECREF(dict); |
| 2479 | return (PyObject *) inst; |
| 2480 | #else |
| 2481 | PyInstanceObject *inst = PyObject_NEW(PyInstanceObject, &PyInstance_Type); |
| 2482 | if (inst == NULL) { |
| 2483 | return NULL; |
| 2484 | } |
| 2485 | inst->in_class = (PyClassObject *)data->newargs; |
| 2486 | Py_INCREF(inst->in_class); |
| 2487 | inst->in_dict = PyDict_New(); |
| 2488 | if (inst->in_dict == NULL) { |
| 2489 | Py_DECREF(inst); |
| 2490 | return NULL; |
| 2491 | } |
| 2492 | #ifdef Py_TPFLAGS_HAVE_WEAKREFS |
| 2493 | inst->in_weakreflist = NULL; |
| 2494 | #endif |
| 2495 | #ifdef Py_TPFLAGS_GC |
| 2496 | PyObject_GC_Init(inst); |
| 2497 | #endif |
| 2498 | PyDict_SetItem(inst->in_dict, SWIG_This(), swig_this); |
| 2499 | return (PyObject *) inst; |
| 2500 | #endif |
| 2501 | #endif |
| 2502 | } |
| 2503 | |
| 2504 | SWIGRUNTIME void |
| 2505 | SWIG_Python_SetSwigThis(PyObject *inst, PyObject *swig_this) |
| 2506 | { |
| 2507 | PyObject *dict; |
| 2508 | #if (PY_VERSION_HEX >= 0x02020000) && !defined(SWIG_PYTHON_SLOW_GETSET_THIS) |
| 2509 | PyObject **dictptr = _PyObject_GetDictPtr(inst); |
| 2510 | if (dictptr != NULL) { |
| 2511 | dict = *dictptr; |
| 2512 | if (dict == NULL) { |
| 2513 | dict = PyDict_New(); |
| 2514 | *dictptr = dict; |
| 2515 | } |
| 2516 | PyDict_SetItem(dict, SWIG_This(), swig_this); |
| 2517 | return; |
| 2518 | } |
| 2519 | #endif |
| 2520 | dict = PyObject_GetAttrString(inst, (char*)"__dict__"); |
| 2521 | PyDict_SetItem(dict, SWIG_This(), swig_this); |
| 2522 | Py_DECREF(dict); |
| 2523 | } |
| 2524 | |
| 2525 | |
| 2526 | SWIGINTERN PyObject * |
| 2527 | SWIG_Python_InitShadowInstance(PyObject *args) { |
| 2528 | PyObject *obj[2]; |
| 2529 | if (!SWIG_Python_UnpackTuple(args, "swiginit", 2, 2, obj)) { |
| 2530 | return NULL; |
| 2531 | } else { |
| 2532 | SwigPyObject *sthis = SWIG_Python_GetSwigThis(obj[0]); |
| 2533 | if (sthis) { |
| 2534 | SwigPyObject_append((PyObject*) sthis, obj[1]); |
| 2535 | } else { |
| 2536 | SWIG_Python_SetSwigThis(obj[0], obj[1]); |
| 2537 | } |
| 2538 | return SWIG_Py_Void(); |
| 2539 | } |
| 2540 | } |
| 2541 | |
| 2542 | /* Create a new pointer object */ |
| 2543 | |
| 2544 | SWIGRUNTIME PyObject * |
| 2545 | SWIG_Python_NewPointerObj(PyObject *self, void *ptr, swig_type_info *type, int flags) { |
| 2546 | SwigPyClientData *clientdata; |
| 2547 | PyObject * robj; |
| 2548 | int own; |
| 2549 | |
| 2550 | if (!ptr) |
| 2551 | return SWIG_Py_Void(); |
| 2552 | |
| 2553 | clientdata = type ? (SwigPyClientData *)(type->clientdata) : 0; |
| 2554 | own = (flags & SWIG_POINTER_OWN) ? SWIG_POINTER_OWN : 0; |
| 2555 | if (clientdata && clientdata->pytype) { |
| 2556 | SwigPyObject *newobj; |
| 2557 | if (flags & SWIG_BUILTIN_TP_INIT) { |
| 2558 | newobj = (SwigPyObject*) self; |
| 2559 | if (newobj->ptr) { |
| 2560 | PyObject *next_self = clientdata->pytype->tp_alloc(clientdata->pytype, 0); |
| 2561 | while (newobj->next) |
| 2562 | newobj = (SwigPyObject *) newobj->next; |
| 2563 | newobj->next = next_self; |
| 2564 | newobj = (SwigPyObject *)next_self; |
| 2565 | } |
| 2566 | } else { |
| 2567 | newobj = PyObject_New(SwigPyObject, clientdata->pytype); |
| 2568 | } |
| 2569 | if (newobj) { |
| 2570 | newobj->ptr = ptr; |
| 2571 | newobj->ty = type; |
| 2572 | newobj->own = own; |
| 2573 | newobj->next = 0; |
| 2574 | #ifdef SWIGPYTHON_BUILTIN |
| 2575 | newobj->dict = 0; |
| 2576 | #endif |
| 2577 | return (PyObject*) newobj; |
| 2578 | } |
| 2579 | return SWIG_Py_Void(); |
| 2580 | } |
| 2581 | |
| 2582 | assert(!(flags & SWIG_BUILTIN_TP_INIT)); |
| 2583 | |
| 2584 | robj = SwigPyObject_New(ptr, type, own); |
| 2585 | if (clientdata && !(flags & SWIG_POINTER_NOSHADOW)) { |
| 2586 | PyObject *inst = SWIG_Python_NewShadowInstance(clientdata, robj); |
| 2587 | if (inst) { |
| 2588 | Py_DECREF(robj); |
| 2589 | robj = inst; |
| 2590 | } |
| 2591 | } |
| 2592 | return robj; |
| 2593 | } |
| 2594 | |
| 2595 | /* Create a new packed object */ |
| 2596 | |
| 2597 | SWIGRUNTIMEINLINE PyObject * |
| 2598 | SWIG_Python_NewPackedObj(void *ptr, size_t sz, swig_type_info *type) { |
| 2599 | return ptr ? SwigPyPacked_New((void *) ptr, sz, type) : SWIG_Py_Void(); |
| 2600 | } |
| 2601 | |
| 2602 | /* -----------------------------------------------------------------------------* |
| 2603 | * Get type list |
| 2604 | * -----------------------------------------------------------------------------*/ |
| 2605 | |
| 2606 | #ifdef SWIG_LINK_RUNTIME |
| 2607 | void *SWIG_ReturnGlobalTypeList(void *); |
| 2608 | #endif |
| 2609 | |
| 2610 | SWIGRUNTIME swig_module_info * |
| 2611 | SWIG_Python_GetModule(void) { |
| 2612 | static void *type_pointer = (void *)0; |
| 2613 | /* first check if module already created */ |
| 2614 | if (!type_pointer) { |
| 2615 | #ifdef SWIG_LINK_RUNTIME |
| 2616 | type_pointer = SWIG_ReturnGlobalTypeList((void *)0); |
| 2617 | #else |
| 2618 | # ifdef SWIGPY_USE_CAPSULE |
| 2619 | type_pointer = PyCapsule_Import(SWIGPY_CAPSULE_NAME, 0); |
| 2620 | # else |
| 2621 | type_pointer = PyCObject_Import((char*)"swig_runtime_data" SWIG_RUNTIME_VERSION, |
| 2622 | (char*)"type_pointer" SWIG_TYPE_TABLE_NAME); |
| 2623 | # endif |
| 2624 | if (PyErr_Occurred()) { |
| 2625 | PyErr_Clear(); |
| 2626 | type_pointer = (void *)0; |
| 2627 | } |
| 2628 | #endif |
| 2629 | } |
| 2630 | return (swig_module_info *) type_pointer; |
| 2631 | } |
| 2632 | |
| 2633 | #if PY_MAJOR_VERSION < 2 |
| 2634 | /* PyModule_AddObject function was introduced in Python 2.0. The following function |
| 2635 | is copied out of Python/modsupport.c in python version 2.3.4 */ |
| 2636 | SWIGINTERN int |
| 2637 | PyModule_AddObject(PyObject *m, char *name, PyObject *o) |
| 2638 | { |
| 2639 | PyObject *dict; |
| 2640 | if (!PyModule_Check(m)) { |
| 2641 | PyErr_SetString(PyExc_TypeError, |
| 2642 | "PyModule_AddObject() needs module as first arg"); |
| 2643 | return SWIG_ERROR; |
| 2644 | } |
| 2645 | if (!o) { |
| 2646 | PyErr_SetString(PyExc_TypeError, |
| 2647 | "PyModule_AddObject() needs non-NULL value"); |
| 2648 | return SWIG_ERROR; |
| 2649 | } |
| 2650 | |
| 2651 | dict = PyModule_GetDict(m); |
| 2652 | if (dict == NULL) { |
| 2653 | /* Internal error -- modules must have a dict! */ |
| 2654 | PyErr_Format(PyExc_SystemError, "module '%s' has no __dict__", |
| 2655 | PyModule_GetName(m)); |
| 2656 | return SWIG_ERROR; |
| 2657 | } |
| 2658 | if (PyDict_SetItemString(dict, name, o)) |
| 2659 | return SWIG_ERROR; |
| 2660 | Py_DECREF(o); |
| 2661 | return SWIG_OK; |
| 2662 | } |
| 2663 | #endif |
| 2664 | |
| 2665 | SWIGRUNTIME void |
| 2666 | #ifdef SWIGPY_USE_CAPSULE |
| 2667 | SWIG_Python_DestroyModule(PyObject *obj) |
| 2668 | #else |
| 2669 | SWIG_Python_DestroyModule(void *vptr) |
| 2670 | #endif |
| 2671 | { |
| 2672 | #ifdef SWIGPY_USE_CAPSULE |
| 2673 | swig_module_info *swig_module = (swig_module_info *) PyCapsule_GetPointer(obj, SWIGPY_CAPSULE_NAME); |
| 2674 | #else |
| 2675 | swig_module_info *swig_module = (swig_module_info *) vptr; |
| 2676 | #endif |
| 2677 | swig_type_info **types = swig_module->types; |
| 2678 | size_t i; |
| 2679 | for (i =0; i < swig_module->size; ++i) { |
| 2680 | swig_type_info *ty = types[i]; |
| 2681 | if (ty->owndata) { |
| 2682 | SwigPyClientData *data = (SwigPyClientData *) ty->clientdata; |
| 2683 | if (data) SwigPyClientData_Del(data); |
| 2684 | } |
| 2685 | } |
| 2686 | Py_DECREF(SWIG_This()); |
| 2687 | swig_this = NULL; |
| 2688 | } |
| 2689 | |
| 2690 | SWIGRUNTIME void |
| 2691 | SWIG_Python_SetModule(swig_module_info *swig_module) { |
| 2692 | #if PY_VERSION_HEX >= 0x03000000 |
| 2693 | /* Add a dummy module object into sys.modules */ |
| 2694 | PyObject *module = PyImport_AddModule((char*)"swig_runtime_data" SWIG_RUNTIME_VERSION); |
| 2695 | #else |
| 2696 | static PyMethodDef swig_empty_runtime_method_table[] = { {NULL, NULL, 0, NULL} }; /* Sentinel */ |
| 2697 | PyObject *module = Py_InitModule((char*)"swig_runtime_data" SWIG_RUNTIME_VERSION, swig_empty_runtime_method_table); |
| 2698 | #endif |
| 2699 | #ifdef SWIGPY_USE_CAPSULE |
| 2700 | PyObject *pointer = PyCapsule_New((void *) swig_module, SWIGPY_CAPSULE_NAME, SWIG_Python_DestroyModule); |
| 2701 | if (pointer && module) { |
| 2702 | PyModule_AddObject(module, (char*)"type_pointer_capsule" SWIG_TYPE_TABLE_NAME, pointer); |
| 2703 | } else { |
| 2704 | Py_XDECREF(pointer); |
| 2705 | } |
| 2706 | #else |
| 2707 | PyObject *pointer = PyCObject_FromVoidPtr((void *) swig_module, SWIG_Python_DestroyModule); |
| 2708 | if (pointer && module) { |
| 2709 | PyModule_AddObject(module, (char*)"type_pointer" SWIG_TYPE_TABLE_NAME, pointer); |
| 2710 | } else { |
| 2711 | Py_XDECREF(pointer); |
| 2712 | } |
| 2713 | #endif |
| 2714 | } |
| 2715 | |
| 2716 | /* The python cached type query */ |
| 2717 | SWIGRUNTIME PyObject * |
| 2718 | SWIG_Python_TypeCache(void) { |
| 2719 | static PyObject *SWIG_STATIC_POINTER(cache) = PyDict_New(); |
| 2720 | return cache; |
| 2721 | } |
| 2722 | |
| 2723 | SWIGRUNTIME swig_type_info * |
| 2724 | SWIG_Python_TypeQuery(const char *type) |
| 2725 | { |
| 2726 | PyObject *cache = SWIG_Python_TypeCache(); |
| 2727 | PyObject *key = SWIG_Python_str_FromChar(type); |
| 2728 | PyObject *obj = PyDict_GetItem(cache, key); |
| 2729 | swig_type_info *descriptor; |
| 2730 | if (obj) { |
| 2731 | #ifdef SWIGPY_USE_CAPSULE |
| 2732 | descriptor = (swig_type_info *) PyCapsule_GetPointer(obj, NULL); |
| 2733 | #else |
| 2734 | descriptor = (swig_type_info *) PyCObject_AsVoidPtr(obj); |
| 2735 | #endif |
| 2736 | } else { |
| 2737 | swig_module_info *swig_module = SWIG_Python_GetModule(); |
| 2738 | descriptor = SWIG_TypeQueryModule(swig_module, swig_module, type); |
| 2739 | if (descriptor) { |
| 2740 | #ifdef SWIGPY_USE_CAPSULE |
| 2741 | obj = PyCapsule_New((void*) descriptor, NULL, NULL); |
| 2742 | #else |
| 2743 | obj = PyCObject_FromVoidPtr(descriptor, NULL); |
| 2744 | #endif |
| 2745 | PyDict_SetItem(cache, key, obj); |
| 2746 | Py_DECREF(obj); |
| 2747 | } |
| 2748 | } |
| 2749 | Py_DECREF(key); |
| 2750 | return descriptor; |
| 2751 | } |
| 2752 | |
| 2753 | /* |
| 2754 | For backward compatibility only |
| 2755 | */ |
| 2756 | #define SWIG_POINTER_EXCEPTION 0 |
| 2757 | #define SWIG_arg_fail(arg) SWIG_Python_ArgFail(arg) |
| 2758 | #define SWIG_MustGetPtr(p, type, argnum, flags) SWIG_Python_MustGetPtr(p, type, argnum, flags) |
| 2759 | |
| 2760 | SWIGRUNTIME int |
| 2761 | SWIG_Python_AddErrMesg(const char* mesg, int infront) |
| 2762 | { |
| 2763 | if (PyErr_Occurred()) { |
| 2764 | PyObject *type = 0; |
| 2765 | PyObject *value = 0; |
| 2766 | PyObject *traceback = 0; |
| 2767 | PyErr_Fetch(&type, &value, &traceback); |
| 2768 | if (value) { |
| 2769 | char *tmp; |
| 2770 | PyObject *old_str = PyObject_Str(value); |
| 2771 | Py_XINCREF(type); |
| 2772 | PyErr_Clear(); |
| 2773 | if (infront) { |
| 2774 | PyErr_Format(type, "%s %s", mesg, tmp = SWIG_Python_str_AsChar(old_str)); |
| 2775 | } else { |
| 2776 | PyErr_Format(type, "%s %s", tmp = SWIG_Python_str_AsChar(old_str), mesg); |
| 2777 | } |
| 2778 | SWIG_Python_str_DelForPy3(tmp); |
| 2779 | Py_DECREF(old_str); |
| 2780 | } |
| 2781 | return 1; |
| 2782 | } else { |
| 2783 | return 0; |
| 2784 | } |
| 2785 | } |
| 2786 | |
| 2787 | SWIGRUNTIME int |
| 2788 | SWIG_Python_ArgFail(int argnum) |
| 2789 | { |
| 2790 | if (PyErr_Occurred()) { |
| 2791 | /* add information about failing argument */ |
| 2792 | char mesg[256]; |
| 2793 | PyOS_snprintf(mesg, sizeof(mesg), "argument number %d:", argnum); |
| 2794 | return SWIG_Python_AddErrMesg(mesg, 1); |
| 2795 | } else { |
| 2796 | return 0; |
| 2797 | } |
| 2798 | } |
| 2799 | |
| 2800 | SWIGRUNTIMEINLINE const char * |
| 2801 | SwigPyObject_GetDesc(PyObject *self) |
| 2802 | { |
| 2803 | SwigPyObject *v = (SwigPyObject *)self; |
| 2804 | swig_type_info *ty = v ? v->ty : 0; |
| 2805 | return ty ? ty->str : ""; |
| 2806 | } |
| 2807 | |
| 2808 | SWIGRUNTIME void |
| 2809 | SWIG_Python_TypeError(const char *type, PyObject *obj) |
| 2810 | { |
| 2811 | if (type) { |
| 2812 | #if defined(SWIG_COBJECT_TYPES) |
| 2813 | if (obj && SwigPyObject_Check(obj)) { |
| 2814 | const char *otype = (const char *) SwigPyObject_GetDesc(obj); |
| 2815 | if (otype) { |
| 2816 | PyErr_Format(PyExc_TypeError, "a '%s' is expected, 'SwigPyObject(%s)' is received", |
| 2817 | type, otype); |
| 2818 | return; |
| 2819 | } |
| 2820 | } else |
| 2821 | #endif |
| 2822 | { |
| 2823 | const char *otype = (obj ? obj->ob_type->tp_name : 0); |
| 2824 | if (otype) { |
| 2825 | PyObject *str = PyObject_Str(obj); |
| 2826 | const char *cstr = str ? SWIG_Python_str_AsChar(str) : 0; |
| 2827 | if (cstr) { |
| 2828 | PyErr_Format(PyExc_TypeError, "a '%s' is expected, '%s(%s)' is received", |
| 2829 | type, otype, cstr); |
| 2830 | SWIG_Python_str_DelForPy3(cstr); |
| 2831 | } else { |
| 2832 | PyErr_Format(PyExc_TypeError, "a '%s' is expected, '%s' is received", |
| 2833 | type, otype); |
| 2834 | } |
| 2835 | Py_XDECREF(str); |
| 2836 | return; |
| 2837 | } |
| 2838 | } |
| 2839 | PyErr_Format(PyExc_TypeError, "a '%s' is expected", type); |
| 2840 | } else { |
| 2841 | PyErr_Format(PyExc_TypeError, "unexpected type is received"); |
| 2842 | } |
| 2843 | } |
| 2844 | |
| 2845 | |
| 2846 | /* Convert a pointer value, signal an exception on a type mismatch */ |
| 2847 | SWIGRUNTIME void * |
| 2848 | SWIG_Python_MustGetPtr(PyObject *obj, swig_type_info *ty, int SWIGUNUSEDPARM(argnum), int flags) { |
| 2849 | void *result; |
| 2850 | if (SWIG_Python_ConvertPtr(obj, &result, ty, flags) == -1) { |
| 2851 | PyErr_Clear(); |
| 2852 | #if SWIG_POINTER_EXCEPTION |
| 2853 | if (flags) { |
| 2854 | SWIG_Python_TypeError(SWIG_TypePrettyName(ty), obj); |
| 2855 | SWIG_Python_ArgFail(argnum); |
| 2856 | } |
| 2857 | #endif |
| 2858 | } |
| 2859 | return result; |
| 2860 | } |
| 2861 | |
| 2862 | #ifdef SWIGPYTHON_BUILTIN |
| 2863 | SWIGRUNTIME int |
| 2864 | SWIG_Python_NonDynamicSetAttr(PyObject *obj, PyObject *name, PyObject *value) { |
| 2865 | PyTypeObject *tp = obj->ob_type; |
| 2866 | PyObject *descr; |
| 2867 | PyObject *encoded_name; |
| 2868 | descrsetfunc f; |
| 2869 | int res; |
| 2870 | |
| 2871 | # ifdef Py_USING_UNICODE |
| 2872 | if (PyString_Check(name)) { |
| 2873 | name = PyUnicode_Decode(PyString_AsString(name), PyString_Size(name), NULL, NULL); |
| 2874 | if (!name) |
| 2875 | return -1; |
| 2876 | } else if (!PyUnicode_Check(name)) |
| 2877 | # else |
| 2878 | if (!PyString_Check(name)) |
| 2879 | # endif |
| 2880 | { |
| 2881 | PyErr_Format(PyExc_TypeError, "attribute name must be string, not '%.200s'", name->ob_type->tp_name); |
| 2882 | return -1; |
| 2883 | } else { |
| 2884 | Py_INCREF(name); |
| 2885 | } |
| 2886 | |
| 2887 | if (!tp->tp_dict) { |
| 2888 | if (PyType_Ready(tp) < 0) |
| 2889 | goto done; |
| 2890 | } |
| 2891 | |
| 2892 | res = -1; |
| 2893 | descr = _PyType_Lookup(tp, name); |
| 2894 | f = NULL; |
| 2895 | if (descr != NULL) |
| 2896 | f = descr->ob_type->tp_descr_set; |
| 2897 | if (!f) { |
| 2898 | if (PyString_Check(name)) { |
| 2899 | encoded_name = name; |
| 2900 | Py_INCREF(name); |
| 2901 | } else { |
| 2902 | encoded_name = PyUnicode_AsUTF8String(name); |
| 2903 | } |
| 2904 | PyErr_Format(PyExc_AttributeError, "'%.100s' object has no attribute '%.200s'", tp->tp_name, PyString_AsString(encoded_name)); |
| 2905 | Py_DECREF(encoded_name); |
| 2906 | } else { |
| 2907 | res = f(descr, obj, value); |
| 2908 | } |
| 2909 | |
| 2910 | done: |
| 2911 | Py_DECREF(name); |
| 2912 | return res; |
| 2913 | } |
| 2914 | #endif |
| 2915 | |
| 2916 | |
| 2917 | #ifdef __cplusplus |
| 2918 | } |
| 2919 | #endif |
| 2920 | |
| 2921 | |
| 2922 | |
| 2923 | #define SWIG_exception_fail(code, msg) do { SWIG_Error(code, msg); SWIG_fail; } while(0) |
| 2924 | |
| 2925 | #define SWIG_contract_assert(expr, msg) if (!(expr)) { SWIG_Error(SWIG_RuntimeError, msg); SWIG_fail; } else |
| 2926 | |
| 2927 | |
| 2928 | |
| 2929 | /* -------- TYPES TABLE (BEGIN) -------- */ |
| 2930 | |
| 2931 | #define SWIGTYPE_p_char swig_types[0] |
| 2932 | #define SWIGTYPE_p_f_int_int__int swig_types[1] |
| 2933 | #define SWIGTYPE_p_f_p_void__p_void swig_types[2] |
| 2934 | #define SWIGTYPE_p_f_void__void swig_types[3] |
| 2935 | #define SWIGTYPE_p_unsigned_char swig_types[4] |
| 2936 | static swig_type_info *swig_types[6]; |
| 2937 | static swig_module_info swig_module = {swig_types, 5, 0, 0, 0, 0}; |
| 2938 | #define SWIG_TypeQuery(name) SWIG_TypeQueryModule(&swig_module, &swig_module, name) |
| 2939 | #define SWIG_MangledTypeQuery(name) SWIG_MangledTypeQueryModule(&swig_module, &swig_module, name) |
| 2940 | |
| 2941 | /* -------- TYPES TABLE (END) -------- */ |
| 2942 | |
| 2943 | #if (PY_VERSION_HEX <= 0x02000000) |
| 2944 | # if !defined(SWIG_PYTHON_CLASSIC) |
| 2945 | # error "This python version requires swig to be run with the '-classic' option" |
| 2946 | # endif |
| 2947 | #endif |
| 2948 | |
| 2949 | /*----------------------------------------------- |
| 2950 | @(target):= _wiringpi.so |
| 2951 | ------------------------------------------------*/ |
| 2952 | #if PY_VERSION_HEX >= 0x03000000 |
| 2953 | # define SWIG_init PyInit__wiringpi |
| 2954 | |
| 2955 | #else |
| 2956 | # define SWIG_init init_wiringpi |
| 2957 | |
| 2958 | #endif |
| 2959 | #define SWIG_name "_wiringpi" |
| 2960 | |
| 2961 | #define SWIGVERSION 0x020007 |
| 2962 | #define SWIG_VERSION SWIGVERSION |
| 2963 | |
| 2964 | |
| 2965 | #define SWIG_as_voidptr(a) (void *)((const void *)(a)) |
| 2966 | #define SWIG_as_voidptrptr(a) ((void)SWIG_as_voidptr(*a),(void**)(a)) |
| 2967 | |
| 2968 | |
| 2969 | #include "WiringPi/wiringPi/ds1302.h", |
| 2970 | #include "WiringPi/wiringPi/gertboard.h", |
| 2971 | #include "WiringPi/wiringPi/lcd.h", |
| 2972 | #include "WiringPi/wiringPi/mcp23008.h", |
| 2973 | #include "WiringPi/wiringPi/mcp23017.h", |
| 2974 | #include "WiringPi/wiringPi/mcp23s08.h", |
| 2975 | #include "WiringPi/wiringPi/mcp23s17.h", |
| 2976 | #include "WiringPi/wiringPi/mcp23x0817.h", |
| 2977 | #include "WiringPi/wiringPi/mcp23x08.h", |
| 2978 | #include "WiringPi/wiringPi/piFace.h", |
| 2979 | #include "WiringPi/wiringPi/piNes.h", |
| 2980 | #include "WiringPi/wiringPi/softPwm.h", |
| 2981 | #include "WiringPi/wiringPi/softServo.h", |
| 2982 | #include "WiringPi/wiringPi/softTone.h", |
| 2983 | #include "WiringPi/wiringPi/sr595.h", |
| 2984 | #include "WiringPi/wiringPi/wiringPi.h", |
| 2985 | #include "WiringPi/wiringPi/wiringPiI2C.h", |
| 2986 | #include "WiringPi/wiringPi/wiringPiSPI.h", |
| 2987 | #include "WiringPi/wiringPi/wiringSerial.h", |
| 2988 | #include "WiringPi/wiringPi/wiringShift.h" |
| 2989 | |
| 2990 | |
| 2991 | SWIGINTERNINLINE PyObject* |
| 2992 | SWIG_From_int (int value) |
| 2993 | { |
| 2994 | return PyInt_FromLong((long) value); |
| 2995 | } |
| 2996 | |
| 2997 | |
| 2998 | #include <limits.h> |
| 2999 | #if !defined(SWIG_NO_LLONG_MAX) |
| 3000 | # if !defined(LLONG_MAX) && defined(__GNUC__) && defined (__LONG_LONG_MAX__) |
| 3001 | # define LLONG_MAX __LONG_LONG_MAX__ |
| 3002 | # define LLONG_MIN (-LLONG_MAX - 1LL) |
| 3003 | # define ULLONG_MAX (LLONG_MAX * 2ULL + 1ULL) |
| 3004 | # endif |
| 3005 | #endif |
| 3006 | |
| 3007 | |
| 3008 | SWIGINTERN int |
| 3009 | SWIG_AsVal_double (PyObject *obj, double *val) |
| 3010 | { |
| 3011 | int res = SWIG_TypeError; |
| 3012 | if (PyFloat_Check(obj)) { |
| 3013 | if (val) *val = PyFloat_AsDouble(obj); |
| 3014 | return SWIG_OK; |
| 3015 | } else if (PyInt_Check(obj)) { |
| 3016 | if (val) *val = PyInt_AsLong(obj); |
| 3017 | return SWIG_OK; |
| 3018 | } else if (PyLong_Check(obj)) { |
| 3019 | double v = PyLong_AsDouble(obj); |
| 3020 | if (!PyErr_Occurred()) { |
| 3021 | if (val) *val = v; |
| 3022 | return SWIG_OK; |
| 3023 | } else { |
| 3024 | PyErr_Clear(); |
| 3025 | } |
| 3026 | } |
| 3027 | #ifdef SWIG_PYTHON_CAST_MODE |
| 3028 | { |
| 3029 | int dispatch = 0; |
| 3030 | double d = PyFloat_AsDouble(obj); |
| 3031 | if (!PyErr_Occurred()) { |
| 3032 | if (val) *val = d; |
| 3033 | return SWIG_AddCast(SWIG_OK); |
| 3034 | } else { |
| 3035 | PyErr_Clear(); |
| 3036 | } |
| 3037 | if (!dispatch) { |
| 3038 | long v = PyLong_AsLong(obj); |
| 3039 | if (!PyErr_Occurred()) { |
| 3040 | if (val) *val = v; |
| 3041 | return SWIG_AddCast(SWIG_AddCast(SWIG_OK)); |
| 3042 | } else { |
| 3043 | PyErr_Clear(); |
| 3044 | } |
| 3045 | } |
| 3046 | } |
| 3047 | #endif |
| 3048 | return res; |
| 3049 | } |
| 3050 | |
| 3051 | |
| 3052 | #include <float.h> |
| 3053 | |
| 3054 | |
| 3055 | #include <math.h> |
| 3056 | |
| 3057 | |
| 3058 | SWIGINTERNINLINE int |
| 3059 | SWIG_CanCastAsInteger(double *d, double min, double max) { |
| 3060 | double x = *d; |
| 3061 | if ((min <= x && x <= max)) { |
| 3062 | double fx = floor(x); |
| 3063 | double cx = ceil(x); |
| 3064 | double rd = ((x - fx) < 0.5) ? fx : cx; /* simple rint */ |
| 3065 | if ((errno == EDOM) || (errno == ERANGE)) { |
| 3066 | errno = 0; |
| 3067 | } else { |
| 3068 | double summ, reps, diff; |
| 3069 | if (rd < x) { |
| 3070 | diff = x - rd; |
| 3071 | } else if (rd > x) { |
| 3072 | diff = rd - x; |
| 3073 | } else { |
| 3074 | return 1; |
| 3075 | } |
| 3076 | summ = rd + x; |
| 3077 | reps = diff/summ; |
| 3078 | if (reps < 8*DBL_EPSILON) { |
| 3079 | *d = rd; |
| 3080 | return 1; |
| 3081 | } |
| 3082 | } |
| 3083 | } |
| 3084 | return 0; |
| 3085 | } |
| 3086 | |
| 3087 | |
| 3088 | SWIGINTERN int |
| 3089 | SWIG_AsVal_long (PyObject *obj, long* val) |
| 3090 | { |
| 3091 | if (PyInt_Check(obj)) { |
| 3092 | if (val) *val = PyInt_AsLong(obj); |
| 3093 | return SWIG_OK; |
| 3094 | } else if (PyLong_Check(obj)) { |
| 3095 | long v = PyLong_AsLong(obj); |
| 3096 | if (!PyErr_Occurred()) { |
| 3097 | if (val) *val = v; |
| 3098 | return SWIG_OK; |
| 3099 | } else { |
| 3100 | PyErr_Clear(); |
| 3101 | } |
| 3102 | } |
| 3103 | #ifdef SWIG_PYTHON_CAST_MODE |
| 3104 | { |
| 3105 | int dispatch = 0; |
| 3106 | long v = PyInt_AsLong(obj); |
| 3107 | if (!PyErr_Occurred()) { |
| 3108 | if (val) *val = v; |
| 3109 | return SWIG_AddCast(SWIG_OK); |
| 3110 | } else { |
| 3111 | PyErr_Clear(); |
| 3112 | } |
| 3113 | if (!dispatch) { |
| 3114 | double d; |
| 3115 | int res = SWIG_AddCast(SWIG_AsVal_double (obj,&d)); |
| 3116 | if (SWIG_IsOK(res) && SWIG_CanCastAsInteger(&d, LONG_MIN, LONG_MAX)) { |
| 3117 | if (val) *val = (long)(d); |
| 3118 | return res; |
| 3119 | } |
| 3120 | } |
| 3121 | } |
| 3122 | #endif |
| 3123 | return SWIG_TypeError; |
| 3124 | } |
| 3125 | |
| 3126 | |
| 3127 | SWIGINTERN int |
| 3128 | SWIG_AsVal_int (PyObject * obj, int *val) |
| 3129 | { |
| 3130 | long v; |
| 3131 | int res = SWIG_AsVal_long (obj, &v); |
| 3132 | if (SWIG_IsOK(res)) { |
| 3133 | if ((v < INT_MIN || v > INT_MAX)) { |
| 3134 | return SWIG_OverflowError; |
| 3135 | } else { |
| 3136 | if (val) *val = (int)(v); |
| 3137 | } |
| 3138 | } |
| 3139 | return res; |
| 3140 | } |
| 3141 | |
| 3142 | |
| 3143 | SWIGINTERN int |
| 3144 | SWIG_AsVal_unsigned_SS_long (PyObject *obj, unsigned long *val) |
| 3145 | { |
| 3146 | if (PyInt_Check(obj)) { |
| 3147 | long v = PyInt_AsLong(obj); |
| 3148 | if (v >= 0) { |
| 3149 | if (val) *val = v; |
| 3150 | return SWIG_OK; |
| 3151 | } else { |
| 3152 | return SWIG_OverflowError; |
| 3153 | } |
| 3154 | } else if (PyLong_Check(obj)) { |
| 3155 | unsigned long v = PyLong_AsUnsignedLong(obj); |
| 3156 | if (!PyErr_Occurred()) { |
| 3157 | if (val) *val = v; |
| 3158 | return SWIG_OK; |
| 3159 | } else { |
| 3160 | PyErr_Clear(); |
| 3161 | } |
| 3162 | } |
| 3163 | #ifdef SWIG_PYTHON_CAST_MODE |
| 3164 | { |
| 3165 | int dispatch = 0; |
| 3166 | unsigned long v = PyLong_AsUnsignedLong(obj); |
| 3167 | if (!PyErr_Occurred()) { |
| 3168 | if (val) *val = v; |
| 3169 | return SWIG_AddCast(SWIG_OK); |
| 3170 | } else { |
| 3171 | PyErr_Clear(); |
| 3172 | } |
| 3173 | if (!dispatch) { |
| 3174 | double d; |
| 3175 | int res = SWIG_AddCast(SWIG_AsVal_double (obj,&d)); |
| 3176 | if (SWIG_IsOK(res) && SWIG_CanCastAsInteger(&d, 0, ULONG_MAX)) { |
| 3177 | if (val) *val = (unsigned long)(d); |
| 3178 | return res; |
| 3179 | } |
| 3180 | } |
| 3181 | } |
| 3182 | #endif |
| 3183 | return SWIG_TypeError; |
| 3184 | } |
| 3185 | |
| 3186 | |
| 3187 | SWIGINTERN int |
| 3188 | SWIG_AsVal_unsigned_SS_int (PyObject * obj, unsigned int *val) |
| 3189 | { |
| 3190 | unsigned long v; |
| 3191 | int res = SWIG_AsVal_unsigned_SS_long (obj, &v); |
| 3192 | if (SWIG_IsOK(res)) { |
| 3193 | if ((v > UINT_MAX)) { |
| 3194 | return SWIG_OverflowError; |
| 3195 | } else { |
| 3196 | if (val) *val = (unsigned int)(v); |
| 3197 | } |
| 3198 | } |
| 3199 | return res; |
| 3200 | } |
| 3201 | |
| 3202 | |
| 3203 | SWIGINTERNINLINE PyObject* |
| 3204 | SWIG_From_unsigned_SS_int (unsigned int value) |
| 3205 | { |
| 3206 | return PyInt_FromSize_t((size_t) value); |
| 3207 | } |
| 3208 | |
| 3209 | |
| 3210 | SWIGINTERN swig_type_info* |
| 3211 | SWIG_pchar_descriptor(void) |
| 3212 | { |
| 3213 | static int init = 0; |
| 3214 | static swig_type_info* info = 0; |
| 3215 | if (!init) { |
| 3216 | info = SWIG_TypeQuery("_p_char"); |
| 3217 | init = 1; |
| 3218 | } |
| 3219 | return info; |
| 3220 | } |
| 3221 | |
| 3222 | |
| 3223 | SWIGINTERN int |
| 3224 | SWIG_AsCharPtrAndSize(PyObject *obj, char** cptr, size_t* psize, int *alloc) |
| 3225 | { |
| 3226 | #if PY_VERSION_HEX>=0x03000000 |
| 3227 | if (PyUnicode_Check(obj)) |
| 3228 | #else |
| 3229 | if (PyString_Check(obj)) |
| 3230 | #endif |
| 3231 | { |
| 3232 | char *cstr; Py_ssize_t len; |
| 3233 | #if PY_VERSION_HEX>=0x03000000 |
| 3234 | if (!alloc && cptr) { |
| 3235 | /* We can't allow converting without allocation, since the internal |
| 3236 | representation of string in Python 3 is UCS-2/UCS-4 but we require |
| 3237 | a UTF-8 representation. |
| 3238 | TODO(bhy) More detailed explanation */ |
| 3239 | return SWIG_RuntimeError; |
| 3240 | } |
| 3241 | obj = PyUnicode_AsUTF8String(obj); |
| 3242 | PyBytes_AsStringAndSize(obj, &cstr, &len); |
| 3243 | if(alloc) *alloc = SWIG_NEWOBJ; |
| 3244 | #else |
| 3245 | PyString_AsStringAndSize(obj, &cstr, &len); |
| 3246 | #endif |
| 3247 | if (cptr) { |
| 3248 | if (alloc) { |
| 3249 | /* |
| 3250 | In python the user should not be able to modify the inner |
| 3251 | string representation. To warranty that, if you define |
| 3252 | SWIG_PYTHON_SAFE_CSTRINGS, a new/copy of the python string |
| 3253 | buffer is always returned. |
| 3254 | |
| 3255 | The default behavior is just to return the pointer value, |
| 3256 | so, be careful. |
| 3257 | */ |
| 3258 | #if defined(SWIG_PYTHON_SAFE_CSTRINGS) |
| 3259 | if (*alloc != SWIG_OLDOBJ) |
| 3260 | #else |
| 3261 | if (*alloc == SWIG_NEWOBJ) |
| 3262 | #endif |
| 3263 | { |
| 3264 | *cptr = (char *)memcpy((char *)malloc((len + 1)*sizeof(char)), cstr, sizeof(char)*(len + 1)); |
| 3265 | *alloc = SWIG_NEWOBJ; |
| 3266 | } |
| 3267 | else { |
| 3268 | *cptr = cstr; |
| 3269 | *alloc = SWIG_OLDOBJ; |
| 3270 | } |
| 3271 | } else { |
| 3272 | #if PY_VERSION_HEX>=0x03000000 |
| 3273 | assert(0); /* Should never reach here in Python 3 */ |
| 3274 | #endif |
| 3275 | *cptr = SWIG_Python_str_AsChar(obj); |
| 3276 | } |
| 3277 | } |
| 3278 | if (psize) *psize = len + 1; |
| 3279 | #if PY_VERSION_HEX>=0x03000000 |
| 3280 | Py_XDECREF(obj); |
| 3281 | #endif |
| 3282 | return SWIG_OK; |
| 3283 | } else { |
| 3284 | swig_type_info* pchar_descriptor = SWIG_pchar_descriptor(); |
| 3285 | if (pchar_descriptor) { |
| 3286 | void* vptr = 0; |
| 3287 | if (SWIG_ConvertPtr(obj, &vptr, pchar_descriptor, 0) == SWIG_OK) { |
| 3288 | if (cptr) *cptr = (char *) vptr; |
| 3289 | if (psize) *psize = vptr ? (strlen((char *)vptr) + 1) : 0; |
| 3290 | if (alloc) *alloc = SWIG_OLDOBJ; |
| 3291 | return SWIG_OK; |
| 3292 | } |
| 3293 | } |
| 3294 | } |
| 3295 | return SWIG_TypeError; |
| 3296 | } |
| 3297 | |
| 3298 | |
| 3299 | |
| 3300 | |
| 3301 | |
| 3302 | SWIGINTERN int |
| 3303 | SWIG_AsVal_unsigned_SS_char (PyObject * obj, unsigned char *val) |
| 3304 | { |
| 3305 | unsigned long v; |
| 3306 | int res = SWIG_AsVal_unsigned_SS_long (obj, &v); |
| 3307 | if (SWIG_IsOK(res)) { |
| 3308 | if ((v > UCHAR_MAX)) { |
| 3309 | return SWIG_OverflowError; |
| 3310 | } else { |
| 3311 | if (val) *val = (unsigned char)(v); |
| 3312 | } |
| 3313 | } |
| 3314 | return res; |
| 3315 | } |
| 3316 | |
| 3317 | |
| 3318 | #define SWIG_From_long PyLong_FromLong |
| 3319 | |
| 3320 | |
| 3321 | SWIGINTERNINLINE PyObject* |
| 3322 | SWIG_From_unsigned_SS_long (unsigned long value) |
| 3323 | { |
| 3324 | return (value > LONG_MAX) ? |
| 3325 | PyLong_FromUnsignedLong(value) : PyLong_FromLong((long)(value)); |
| 3326 | } |
| 3327 | |
| 3328 | |
| 3329 | SWIGINTERNINLINE PyObject * |
| 3330 | SWIG_From_unsigned_SS_char (unsigned char value) |
| 3331 | { |
| 3332 | return SWIG_From_unsigned_SS_long (value); |
| 3333 | } |
| 3334 | |
| 3335 | #ifdef __cplusplus |
| 3336 | extern "C" { |
| 3337 | #endif |
| 3338 | SWIGINTERN PyObject *_wrap_wiringPiSetup(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { |
| 3339 | PyObject *resultobj = 0; |
| 3340 | int result; |
| 3341 | |
| 3342 | if (!PyArg_ParseTuple(args,(char *)":wiringPiSetup")) SWIG_fail; |
| 3343 | result = (int)wiringPiSetup(); |
| 3344 | resultobj = SWIG_From_int((int)(result)); |
| 3345 | return resultobj; |
| 3346 | fail: |
| 3347 | return NULL; |
| 3348 | } |
| 3349 | |
| 3350 | |
| 3351 | SWIGINTERN PyObject *_wrap_wiringPiSetupSys(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { |
| 3352 | PyObject *resultobj = 0; |
| 3353 | int result; |
| 3354 | |
| 3355 | if (!PyArg_ParseTuple(args,(char *)":wiringPiSetupSys")) SWIG_fail; |
| 3356 | result = (int)wiringPiSetupSys(); |
| 3357 | resultobj = SWIG_From_int((int)(result)); |
| 3358 | return resultobj; |
| 3359 | fail: |
| 3360 | return NULL; |
| 3361 | } |
| 3362 | |
| 3363 | |
| 3364 | SWIGINTERN PyObject *_wrap_wiringPiSetupGpio(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { |
| 3365 | PyObject *resultobj = 0; |
| 3366 | int result; |
| 3367 | |
| 3368 | if (!PyArg_ParseTuple(args,(char *)":wiringPiSetupGpio")) SWIG_fail; |
| 3369 | result = (int)wiringPiSetupGpio(); |
| 3370 | resultobj = SWIG_From_int((int)(result)); |
| 3371 | return resultobj; |
| 3372 | fail: |
| 3373 | return NULL; |
| 3374 | } |
| 3375 | |
| 3376 | |
| 3377 | SWIGINTERN PyObject *_wrap_piFaceSetup(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { |
| 3378 | PyObject *resultobj = 0; |
| 3379 | int arg1 ; |
| 3380 | int val1 ; |
| 3381 | int ecode1 = 0 ; |
| 3382 | PyObject * obj0 = 0 ; |
| 3383 | int result; |
| 3384 | |
| 3385 | if (!PyArg_ParseTuple(args,(char *)"O:piFaceSetup",&obj0)) SWIG_fail; |
| 3386 | ecode1 = SWIG_AsVal_int(obj0, &val1); |
| 3387 | if (!SWIG_IsOK(ecode1)) { |
| 3388 | SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "piFaceSetup" "', argument " "1"" of type '" "int""'"); |
| 3389 | } |
| 3390 | arg1 = (int)(val1); |
| 3391 | result = (int)piFaceSetup(arg1); |
| 3392 | resultobj = SWIG_From_int((int)(result)); |
| 3393 | return resultobj; |
| 3394 | fail: |
| 3395 | return NULL; |
| 3396 | } |
| 3397 | |
| 3398 | |
| 3399 | SWIGINTERN PyObject *_wrap_piBoardRev(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { |
| 3400 | PyObject *resultobj = 0; |
| 3401 | int result; |
| 3402 | |
| 3403 | if (!PyArg_ParseTuple(args,(char *)":piBoardRev")) SWIG_fail; |
| 3404 | result = (int)piBoardRev(); |
| 3405 | resultobj = SWIG_From_int((int)(result)); |
| 3406 | return resultobj; |
| 3407 | fail: |
| 3408 | return NULL; |
| 3409 | } |
| 3410 | |
| 3411 | |
| 3412 | SWIGINTERN PyObject *_wrap_wpiPinToGpio(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { |
| 3413 | PyObject *resultobj = 0; |
| 3414 | int arg1 ; |
| 3415 | int val1 ; |
| 3416 | int ecode1 = 0 ; |
| 3417 | PyObject * obj0 = 0 ; |
| 3418 | int result; |
| 3419 | |
| 3420 | if (!PyArg_ParseTuple(args,(char *)"O:wpiPinToGpio",&obj0)) SWIG_fail; |
| 3421 | ecode1 = SWIG_AsVal_int(obj0, &val1); |
| 3422 | if (!SWIG_IsOK(ecode1)) { |
| 3423 | SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "wpiPinToGpio" "', argument " "1"" of type '" "int""'"); |
| 3424 | } |
| 3425 | arg1 = (int)(val1); |
| 3426 | result = (int)wpiPinToGpio(arg1); |
| 3427 | resultobj = SWIG_From_int((int)(result)); |
| 3428 | return resultobj; |
| 3429 | fail: |
| 3430 | return NULL; |
| 3431 | } |
| 3432 | |
| 3433 | |
| 3434 | SWIGINTERN PyObject *_wrap_pinMode(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { |
| 3435 | PyObject *resultobj = 0; |
| 3436 | int arg1 ; |
| 3437 | int arg2 ; |
| 3438 | int val1 ; |
| 3439 | int ecode1 = 0 ; |
| 3440 | int val2 ; |
| 3441 | int ecode2 = 0 ; |
| 3442 | PyObject * obj0 = 0 ; |
| 3443 | PyObject * obj1 = 0 ; |
| 3444 | |
| 3445 | if (!PyArg_ParseTuple(args,(char *)"OO:pinMode",&obj0,&obj1)) SWIG_fail; |
| 3446 | ecode1 = SWIG_AsVal_int(obj0, &val1); |
| 3447 | if (!SWIG_IsOK(ecode1)) { |
| 3448 | SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "pinMode" "', argument " "1"" of type '" "int""'"); |
| 3449 | } |
| 3450 | arg1 = (int)(val1); |
| 3451 | ecode2 = SWIG_AsVal_int(obj1, &val2); |
| 3452 | if (!SWIG_IsOK(ecode2)) { |
| 3453 | SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "pinMode" "', argument " "2"" of type '" "int""'"); |
| 3454 | } |
| 3455 | arg2 = (int)(val2); |
| 3456 | pinMode(arg1,arg2); |
| 3457 | resultobj = SWIG_Py_Void(); |
| 3458 | return resultobj; |
| 3459 | fail: |
| 3460 | return NULL; |
| 3461 | } |
| 3462 | |
| 3463 | |
| 3464 | SWIGINTERN PyObject *_wrap_getAlt(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { |
| 3465 | PyObject *resultobj = 0; |
| 3466 | int arg1 ; |
| 3467 | int val1 ; |
| 3468 | int ecode1 = 0 ; |
| 3469 | PyObject * obj0 = 0 ; |
| 3470 | int result; |
| 3471 | |
| 3472 | if (!PyArg_ParseTuple(args,(char *)"O:getAlt",&obj0)) SWIG_fail; |
| 3473 | ecode1 = SWIG_AsVal_int(obj0, &val1); |
| 3474 | if (!SWIG_IsOK(ecode1)) { |
| 3475 | SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "getAlt" "', argument " "1"" of type '" "int""'"); |
| 3476 | } |
| 3477 | arg1 = (int)(val1); |
| 3478 | result = (int)getAlt(arg1); |
| 3479 | resultobj = SWIG_From_int((int)(result)); |
| 3480 | return resultobj; |
| 3481 | fail: |
| 3482 | return NULL; |
| 3483 | } |
| 3484 | |
| 3485 | |
| 3486 | SWIGINTERN PyObject *_wrap_pullUpDnControl(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { |
| 3487 | PyObject *resultobj = 0; |
| 3488 | int arg1 ; |
| 3489 | int arg2 ; |
| 3490 | int val1 ; |
| 3491 | int ecode1 = 0 ; |
| 3492 | int val2 ; |
| 3493 | int ecode2 = 0 ; |
| 3494 | PyObject * obj0 = 0 ; |
| 3495 | PyObject * obj1 = 0 ; |
| 3496 | |
| 3497 | if (!PyArg_ParseTuple(args,(char *)"OO:pullUpDnControl",&obj0,&obj1)) SWIG_fail; |
| 3498 | ecode1 = SWIG_AsVal_int(obj0, &val1); |
| 3499 | if (!SWIG_IsOK(ecode1)) { |
| 3500 | SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "pullUpDnControl" "', argument " "1"" of type '" "int""'"); |
| 3501 | } |
| 3502 | arg1 = (int)(val1); |
| 3503 | ecode2 = SWIG_AsVal_int(obj1, &val2); |
| 3504 | if (!SWIG_IsOK(ecode2)) { |
| 3505 | SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "pullUpDnControl" "', argument " "2"" of type '" "int""'"); |
| 3506 | } |
| 3507 | arg2 = (int)(val2); |
| 3508 | pullUpDnControl(arg1,arg2); |
| 3509 | resultobj = SWIG_Py_Void(); |
| 3510 | return resultobj; |
| 3511 | fail: |
| 3512 | return NULL; |
| 3513 | } |
| 3514 | |
| 3515 | |
| 3516 | SWIGINTERN PyObject *_wrap_digitalWrite(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { |
| 3517 | PyObject *resultobj = 0; |
| 3518 | int arg1 ; |
| 3519 | int arg2 ; |
| 3520 | int val1 ; |
| 3521 | int ecode1 = 0 ; |
| 3522 | int val2 ; |
| 3523 | int ecode2 = 0 ; |
| 3524 | PyObject * obj0 = 0 ; |
| 3525 | PyObject * obj1 = 0 ; |
| 3526 | |
| 3527 | if (!PyArg_ParseTuple(args,(char *)"OO:digitalWrite",&obj0,&obj1)) SWIG_fail; |
| 3528 | ecode1 = SWIG_AsVal_int(obj0, &val1); |
| 3529 | if (!SWIG_IsOK(ecode1)) { |
| 3530 | SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "digitalWrite" "', argument " "1"" of type '" "int""'"); |
| 3531 | } |
| 3532 | arg1 = (int)(val1); |
| 3533 | ecode2 = SWIG_AsVal_int(obj1, &val2); |
| 3534 | if (!SWIG_IsOK(ecode2)) { |
| 3535 | SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "digitalWrite" "', argument " "2"" of type '" "int""'"); |
| 3536 | } |
| 3537 | arg2 = (int)(val2); |
| 3538 | digitalWrite(arg1,arg2); |
| 3539 | resultobj = SWIG_Py_Void(); |
| 3540 | return resultobj; |
| 3541 | fail: |
| 3542 | return NULL; |
| 3543 | } |
| 3544 | |
| 3545 | |
| 3546 | SWIGINTERN PyObject *_wrap_digitalWriteByte(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { |
| 3547 | PyObject *resultobj = 0; |
| 3548 | int arg1 ; |
| 3549 | int val1 ; |
| 3550 | int ecode1 = 0 ; |
| 3551 | PyObject * obj0 = 0 ; |
| 3552 | |
| 3553 | if (!PyArg_ParseTuple(args,(char *)"O:digitalWriteByte",&obj0)) SWIG_fail; |
| 3554 | ecode1 = SWIG_AsVal_int(obj0, &val1); |
| 3555 | if (!SWIG_IsOK(ecode1)) { |
| 3556 | SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "digitalWriteByte" "', argument " "1"" of type '" "int""'"); |
| 3557 | } |
| 3558 | arg1 = (int)(val1); |
| 3559 | digitalWriteByte(arg1); |
| 3560 | resultobj = SWIG_Py_Void(); |
| 3561 | return resultobj; |
| 3562 | fail: |
| 3563 | return NULL; |
| 3564 | } |
| 3565 | |
| 3566 | |
| 3567 | SWIGINTERN PyObject *_wrap_gpioClockSet(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { |
| 3568 | PyObject *resultobj = 0; |
| 3569 | int arg1 ; |
| 3570 | int arg2 ; |
| 3571 | int val1 ; |
| 3572 | int ecode1 = 0 ; |
| 3573 | int val2 ; |
| 3574 | int ecode2 = 0 ; |
| 3575 | PyObject * obj0 = 0 ; |
| 3576 | PyObject * obj1 = 0 ; |
| 3577 | |
| 3578 | if (!PyArg_ParseTuple(args,(char *)"OO:gpioClockSet",&obj0,&obj1)) SWIG_fail; |
| 3579 | ecode1 = SWIG_AsVal_int(obj0, &val1); |
| 3580 | if (!SWIG_IsOK(ecode1)) { |
| 3581 | SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "gpioClockSet" "', argument " "1"" of type '" "int""'"); |
| 3582 | } |
| 3583 | arg1 = (int)(val1); |
| 3584 | ecode2 = SWIG_AsVal_int(obj1, &val2); |
| 3585 | if (!SWIG_IsOK(ecode2)) { |
| 3586 | SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "gpioClockSet" "', argument " "2"" of type '" "int""'"); |
| 3587 | } |
| 3588 | arg2 = (int)(val2); |
| 3589 | gpioClockSet(arg1,arg2); |
| 3590 | resultobj = SWIG_Py_Void(); |
| 3591 | return resultobj; |
| 3592 | fail: |
| 3593 | return NULL; |
| 3594 | } |
| 3595 | |
| 3596 | |
| 3597 | SWIGINTERN PyObject *_wrap_pwmWrite(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { |
| 3598 | PyObject *resultobj = 0; |
| 3599 | int arg1 ; |
| 3600 | int arg2 ; |
| 3601 | int val1 ; |
| 3602 | int ecode1 = 0 ; |
| 3603 | int val2 ; |
| 3604 | int ecode2 = 0 ; |
| 3605 | PyObject * obj0 = 0 ; |
| 3606 | PyObject * obj1 = 0 ; |
| 3607 | |
| 3608 | if (!PyArg_ParseTuple(args,(char *)"OO:pwmWrite",&obj0,&obj1)) SWIG_fail; |
| 3609 | ecode1 = SWIG_AsVal_int(obj0, &val1); |
| 3610 | if (!SWIG_IsOK(ecode1)) { |
| 3611 | SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "pwmWrite" "', argument " "1"" of type '" "int""'"); |
| 3612 | } |
| 3613 | arg1 = (int)(val1); |
| 3614 | ecode2 = SWIG_AsVal_int(obj1, &val2); |
| 3615 | if (!SWIG_IsOK(ecode2)) { |
| 3616 | SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "pwmWrite" "', argument " "2"" of type '" "int""'"); |
| 3617 | } |
| 3618 | arg2 = (int)(val2); |
| 3619 | pwmWrite(arg1,arg2); |
| 3620 | resultobj = SWIG_Py_Void(); |
| 3621 | return resultobj; |
| 3622 | fail: |
| 3623 | return NULL; |
| 3624 | } |
| 3625 | |
| 3626 | |
| 3627 | SWIGINTERN PyObject *_wrap_setPadDrive(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { |
| 3628 | PyObject *resultobj = 0; |
| 3629 | int arg1 ; |
| 3630 | int arg2 ; |
| 3631 | int val1 ; |
| 3632 | int ecode1 = 0 ; |
| 3633 | int val2 ; |
| 3634 | int ecode2 = 0 ; |
| 3635 | PyObject * obj0 = 0 ; |
| 3636 | PyObject * obj1 = 0 ; |
| 3637 | |
| 3638 | if (!PyArg_ParseTuple(args,(char *)"OO:setPadDrive",&obj0,&obj1)) SWIG_fail; |
| 3639 | ecode1 = SWIG_AsVal_int(obj0, &val1); |
| 3640 | if (!SWIG_IsOK(ecode1)) { |
| 3641 | SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "setPadDrive" "', argument " "1"" of type '" "int""'"); |
| 3642 | } |
| 3643 | arg1 = (int)(val1); |
| 3644 | ecode2 = SWIG_AsVal_int(obj1, &val2); |
| 3645 | if (!SWIG_IsOK(ecode2)) { |
| 3646 | SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "setPadDrive" "', argument " "2"" of type '" "int""'"); |
| 3647 | } |
| 3648 | arg2 = (int)(val2); |
| 3649 | setPadDrive(arg1,arg2); |
| 3650 | resultobj = SWIG_Py_Void(); |
| 3651 | return resultobj; |
| 3652 | fail: |
| 3653 | return NULL; |
| 3654 | } |
| 3655 | |
| 3656 | |
| 3657 | SWIGINTERN PyObject *_wrap_digitalRead(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { |
| 3658 | PyObject *resultobj = 0; |
| 3659 | int arg1 ; |
| 3660 | int val1 ; |
| 3661 | int ecode1 = 0 ; |
| 3662 | PyObject * obj0 = 0 ; |
| 3663 | int result; |
| 3664 | |
| 3665 | if (!PyArg_ParseTuple(args,(char *)"O:digitalRead",&obj0)) SWIG_fail; |
| 3666 | ecode1 = SWIG_AsVal_int(obj0, &val1); |
| 3667 | if (!SWIG_IsOK(ecode1)) { |
| 3668 | SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "digitalRead" "', argument " "1"" of type '" "int""'"); |
| 3669 | } |
| 3670 | arg1 = (int)(val1); |
| 3671 | result = (int)digitalRead(arg1); |
| 3672 | resultobj = SWIG_From_int((int)(result)); |
| 3673 | return resultobj; |
| 3674 | fail: |
| 3675 | return NULL; |
| 3676 | } |
| 3677 | |
| 3678 | |
| 3679 | SWIGINTERN PyObject *_wrap_pwmSetMode(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { |
| 3680 | PyObject *resultobj = 0; |
| 3681 | int arg1 ; |
| 3682 | int val1 ; |
| 3683 | int ecode1 = 0 ; |
| 3684 | PyObject * obj0 = 0 ; |
| 3685 | |
| 3686 | if (!PyArg_ParseTuple(args,(char *)"O:pwmSetMode",&obj0)) SWIG_fail; |
| 3687 | ecode1 = SWIG_AsVal_int(obj0, &val1); |
| 3688 | if (!SWIG_IsOK(ecode1)) { |
| 3689 | SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "pwmSetMode" "', argument " "1"" of type '" "int""'"); |
| 3690 | } |
| 3691 | arg1 = (int)(val1); |
| 3692 | pwmSetMode(arg1); |
| 3693 | resultobj = SWIG_Py_Void(); |
| 3694 | return resultobj; |
| 3695 | fail: |
| 3696 | return NULL; |
| 3697 | } |
| 3698 | |
| 3699 | |
| 3700 | SWIGINTERN PyObject *_wrap_pwmSetRange(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { |
| 3701 | PyObject *resultobj = 0; |
| 3702 | unsigned int arg1 ; |
| 3703 | unsigned int val1 ; |
| 3704 | int ecode1 = 0 ; |
| 3705 | PyObject * obj0 = 0 ; |
| 3706 | |
| 3707 | if (!PyArg_ParseTuple(args,(char *)"O:pwmSetRange",&obj0)) SWIG_fail; |
| 3708 | ecode1 = SWIG_AsVal_unsigned_SS_int(obj0, &val1); |
| 3709 | if (!SWIG_IsOK(ecode1)) { |
| 3710 | SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "pwmSetRange" "', argument " "1"" of type '" "unsigned int""'"); |
| 3711 | } |
| 3712 | arg1 = (unsigned int)(val1); |
| 3713 | pwmSetRange(arg1); |
| 3714 | resultobj = SWIG_Py_Void(); |
| 3715 | return resultobj; |
| 3716 | fail: |
| 3717 | return NULL; |
| 3718 | } |
| 3719 | |
| 3720 | |
| 3721 | SWIGINTERN PyObject *_wrap_pwmSetClock(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { |
| 3722 | PyObject *resultobj = 0; |
| 3723 | int arg1 ; |
| 3724 | int val1 ; |
| 3725 | int ecode1 = 0 ; |
| 3726 | PyObject * obj0 = 0 ; |
| 3727 | |
| 3728 | if (!PyArg_ParseTuple(args,(char *)"O:pwmSetClock",&obj0)) SWIG_fail; |
| 3729 | ecode1 = SWIG_AsVal_int(obj0, &val1); |
| 3730 | if (!SWIG_IsOK(ecode1)) { |
| 3731 | SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "pwmSetClock" "', argument " "1"" of type '" "int""'"); |
| 3732 | } |
| 3733 | arg1 = (int)(val1); |
| 3734 | pwmSetClock(arg1); |
| 3735 | resultobj = SWIG_Py_Void(); |
| 3736 | return resultobj; |
| 3737 | fail: |
| 3738 | return NULL; |
| 3739 | } |
| 3740 | |
| 3741 | |
| 3742 | SWIGINTERN int Swig_var_waitForInterrupt_set(PyObject *_val) { |
| 3743 | { |
| 3744 | int res = SWIG_ConvertFunctionPtr(_val, (void**)(&waitForInterrupt), SWIGTYPE_p_f_int_int__int); |
| 3745 | if (!SWIG_IsOK(res)) { |
| 3746 | SWIG_exception_fail(SWIG_ArgError(res), "in variable '""waitForInterrupt""' of type '""int (*)(int,int)""'"); |
| 3747 | } |
| 3748 | } |
| 3749 | return 0; |
| 3750 | fail: |
| 3751 | return 1; |
| 3752 | } |
| 3753 | |
| 3754 | |
| 3755 | SWIGINTERN PyObject *Swig_var_waitForInterrupt_get(void) { |
| 3756 | PyObject *pyobj = 0; |
| 3757 | |
| 3758 | pyobj = SWIG_NewFunctionPtrObj((void *)(waitForInterrupt), SWIGTYPE_p_f_int_int__int); |
| 3759 | return pyobj; |
| 3760 | } |
| 3761 | |
| 3762 | |
| 3763 | SWIGINTERN PyObject *_wrap_wiringPiISR(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { |
| 3764 | PyObject *resultobj = 0; |
| 3765 | int arg1 ; |
| 3766 | int arg2 ; |
| 3767 | void (*arg3)(void) = (void (*)(void)) 0 ; |
| 3768 | int val1 ; |
| 3769 | int ecode1 = 0 ; |
| 3770 | int val2 ; |
| 3771 | int ecode2 = 0 ; |
| 3772 | PyObject * obj0 = 0 ; |
| 3773 | PyObject * obj1 = 0 ; |
| 3774 | PyObject * obj2 = 0 ; |
| 3775 | int result; |
| 3776 | |
| 3777 | if (!PyArg_ParseTuple(args,(char *)"OOO:wiringPiISR",&obj0,&obj1,&obj2)) SWIG_fail; |
| 3778 | ecode1 = SWIG_AsVal_int(obj0, &val1); |
| 3779 | if (!SWIG_IsOK(ecode1)) { |
| 3780 | SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "wiringPiISR" "', argument " "1"" of type '" "int""'"); |
| 3781 | } |
| 3782 | arg1 = (int)(val1); |
| 3783 | ecode2 = SWIG_AsVal_int(obj1, &val2); |
| 3784 | if (!SWIG_IsOK(ecode2)) { |
| 3785 | SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "wiringPiISR" "', argument " "2"" of type '" "int""'"); |
| 3786 | } |
| 3787 | arg2 = (int)(val2); |
| 3788 | { |
| 3789 | int res = SWIG_ConvertFunctionPtr(obj2, (void**)(&arg3), SWIGTYPE_p_f_void__void); |
| 3790 | if (!SWIG_IsOK(res)) { |
| 3791 | SWIG_exception_fail(SWIG_ArgError(res), "in method '" "wiringPiISR" "', argument " "3"" of type '" "void (*)(void)""'"); |
| 3792 | } |
| 3793 | } |
| 3794 | result = (int)wiringPiISR(arg1,arg2,arg3); |
| 3795 | resultobj = SWIG_From_int((int)(result)); |
| 3796 | return resultobj; |
| 3797 | fail: |
| 3798 | return NULL; |
| 3799 | } |
| 3800 | |
| 3801 | |
| 3802 | SWIGINTERN PyObject *_wrap_piThreadCreate(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { |
| 3803 | PyObject *resultobj = 0; |
| 3804 | void *(*arg1)(void *) = (void *(*)(void *)) 0 ; |
| 3805 | PyObject * obj0 = 0 ; |
| 3806 | int result; |
| 3807 | |
| 3808 | if (!PyArg_ParseTuple(args,(char *)"O:piThreadCreate",&obj0)) SWIG_fail; |
| 3809 | { |
| 3810 | int res = SWIG_ConvertFunctionPtr(obj0, (void**)(&arg1), SWIGTYPE_p_f_p_void__p_void); |
| 3811 | if (!SWIG_IsOK(res)) { |
| 3812 | SWIG_exception_fail(SWIG_ArgError(res), "in method '" "piThreadCreate" "', argument " "1"" of type '" "void *(*)(void *)""'"); |
| 3813 | } |
| 3814 | } |
| 3815 | result = (int)piThreadCreate(arg1); |
| 3816 | resultobj = SWIG_From_int((int)(result)); |
| 3817 | return resultobj; |
| 3818 | fail: |
| 3819 | return NULL; |
| 3820 | } |
| 3821 | |
| 3822 | |
| 3823 | SWIGINTERN PyObject *_wrap_piLock(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { |
| 3824 | PyObject *resultobj = 0; |
| 3825 | int arg1 ; |
| 3826 | int val1 ; |
| 3827 | int ecode1 = 0 ; |
| 3828 | PyObject * obj0 = 0 ; |
| 3829 | |
| 3830 | if (!PyArg_ParseTuple(args,(char *)"O:piLock",&obj0)) SWIG_fail; |
| 3831 | ecode1 = SWIG_AsVal_int(obj0, &val1); |
| 3832 | if (!SWIG_IsOK(ecode1)) { |
| 3833 | SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "piLock" "', argument " "1"" of type '" "int""'"); |
| 3834 | } |
| 3835 | arg1 = (int)(val1); |
| 3836 | piLock(arg1); |
| 3837 | resultobj = SWIG_Py_Void(); |
| 3838 | return resultobj; |
| 3839 | fail: |
| 3840 | return NULL; |
| 3841 | } |
| 3842 | |
| 3843 | |
| 3844 | SWIGINTERN PyObject *_wrap_piUnlock(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { |
| 3845 | PyObject *resultobj = 0; |
| 3846 | int arg1 ; |
| 3847 | int val1 ; |
| 3848 | int ecode1 = 0 ; |
| 3849 | PyObject * obj0 = 0 ; |
| 3850 | |
| 3851 | if (!PyArg_ParseTuple(args,(char *)"O:piUnlock",&obj0)) SWIG_fail; |
| 3852 | ecode1 = SWIG_AsVal_int(obj0, &val1); |
| 3853 | if (!SWIG_IsOK(ecode1)) { |
| 3854 | SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "piUnlock" "', argument " "1"" of type '" "int""'"); |
| 3855 | } |
| 3856 | arg1 = (int)(val1); |
| 3857 | piUnlock(arg1); |
| 3858 | resultobj = SWIG_Py_Void(); |
| 3859 | return resultobj; |
| 3860 | fail: |
| 3861 | return NULL; |
| 3862 | } |
| 3863 | |
| 3864 | |
| 3865 | SWIGINTERN PyObject *_wrap_delay(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { |
| 3866 | PyObject *resultobj = 0; |
| 3867 | unsigned int arg1 ; |
| 3868 | unsigned int val1 ; |
| 3869 | int ecode1 = 0 ; |
| 3870 | PyObject * obj0 = 0 ; |
| 3871 | |
| 3872 | if (!PyArg_ParseTuple(args,(char *)"O:delay",&obj0)) SWIG_fail; |
| 3873 | ecode1 = SWIG_AsVal_unsigned_SS_int(obj0, &val1); |
| 3874 | if (!SWIG_IsOK(ecode1)) { |
| 3875 | SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "delay" "', argument " "1"" of type '" "unsigned int""'"); |
| 3876 | } |
| 3877 | arg1 = (unsigned int)(val1); |
| 3878 | delay(arg1); |
| 3879 | resultobj = SWIG_Py_Void(); |
| 3880 | return resultobj; |
| 3881 | fail: |
| 3882 | return NULL; |
| 3883 | } |
| 3884 | |
| 3885 | |
| 3886 | SWIGINTERN PyObject *_wrap_delayMicroseconds(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { |
| 3887 | PyObject *resultobj = 0; |
| 3888 | unsigned int arg1 ; |
| 3889 | unsigned int val1 ; |
| 3890 | int ecode1 = 0 ; |
| 3891 | PyObject * obj0 = 0 ; |
| 3892 | |
| 3893 | if (!PyArg_ParseTuple(args,(char *)"O:delayMicroseconds",&obj0)) SWIG_fail; |
| 3894 | ecode1 = SWIG_AsVal_unsigned_SS_int(obj0, &val1); |
| 3895 | if (!SWIG_IsOK(ecode1)) { |
| 3896 | SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "delayMicroseconds" "', argument " "1"" of type '" "unsigned int""'"); |
| 3897 | } |
| 3898 | arg1 = (unsigned int)(val1); |
| 3899 | delayMicroseconds(arg1); |
| 3900 | resultobj = SWIG_Py_Void(); |
| 3901 | return resultobj; |
| 3902 | fail: |
| 3903 | return NULL; |
| 3904 | } |
| 3905 | |
| 3906 | |
| 3907 | SWIGINTERN PyObject *_wrap_millis(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { |
| 3908 | PyObject *resultobj = 0; |
| 3909 | unsigned int result; |
| 3910 | |
| 3911 | if (!PyArg_ParseTuple(args,(char *)":millis")) SWIG_fail; |
| 3912 | result = (unsigned int)millis(); |
| 3913 | resultobj = SWIG_From_unsigned_SS_int((unsigned int)(result)); |
| 3914 | return resultobj; |
| 3915 | fail: |
| 3916 | return NULL; |
| 3917 | } |
| 3918 | |
| 3919 | |
| 3920 | SWIGINTERN PyObject *_wrap_micros(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { |
| 3921 | PyObject *resultobj = 0; |
| 3922 | unsigned int result; |
| 3923 | |
| 3924 | if (!PyArg_ParseTuple(args,(char *)":micros")) SWIG_fail; |
| 3925 | result = (unsigned int)micros(); |
| 3926 | resultobj = SWIG_From_unsigned_SS_int((unsigned int)(result)); |
| 3927 | return resultobj; |
| 3928 | fail: |
| 3929 | return NULL; |
| 3930 | } |
| 3931 | |
| 3932 | |
| 3933 | SWIGINTERN PyObject *_wrap_serialOpen(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { |
| 3934 | PyObject *resultobj = 0; |
| 3935 | char *arg1 = (char *) 0 ; |
| 3936 | int arg2 ; |
| 3937 | int res1 ; |
| 3938 | char *buf1 = 0 ; |
| 3939 | int alloc1 = 0 ; |
| 3940 | int val2 ; |
| 3941 | int ecode2 = 0 ; |
| 3942 | PyObject * obj0 = 0 ; |
| 3943 | PyObject * obj1 = 0 ; |
| 3944 | int result; |
| 3945 | |
| 3946 | if (!PyArg_ParseTuple(args,(char *)"OO:serialOpen",&obj0,&obj1)) SWIG_fail; |
| 3947 | res1 = SWIG_AsCharPtrAndSize(obj0, &buf1, NULL, &alloc1); |
| 3948 | if (!SWIG_IsOK(res1)) { |
| 3949 | SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "serialOpen" "', argument " "1"" of type '" "char *""'"); |
| 3950 | } |
| 3951 | arg1 = (char *)(buf1); |
| 3952 | ecode2 = SWIG_AsVal_int(obj1, &val2); |
| 3953 | if (!SWIG_IsOK(ecode2)) { |
| 3954 | SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "serialOpen" "', argument " "2"" of type '" "int""'"); |
| 3955 | } |
| 3956 | arg2 = (int)(val2); |
| 3957 | result = (int)serialOpen(arg1,arg2); |
| 3958 | resultobj = SWIG_From_int((int)(result)); |
| 3959 | if (alloc1 == SWIG_NEWOBJ) free((char*)buf1); |
| 3960 | return resultobj; |
| 3961 | fail: |
| 3962 | if (alloc1 == SWIG_NEWOBJ) free((char*)buf1); |
| 3963 | return NULL; |
| 3964 | } |
| 3965 | |
| 3966 | |
| 3967 | SWIGINTERN PyObject *_wrap_serialClose(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { |
| 3968 | PyObject *resultobj = 0; |
| 3969 | int arg1 ; |
| 3970 | int val1 ; |
| 3971 | int ecode1 = 0 ; |
| 3972 | PyObject * obj0 = 0 ; |
| 3973 | |
| 3974 | if (!PyArg_ParseTuple(args,(char *)"O:serialClose",&obj0)) SWIG_fail; |
| 3975 | ecode1 = SWIG_AsVal_int(obj0, &val1); |
| 3976 | if (!SWIG_IsOK(ecode1)) { |
| 3977 | SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "serialClose" "', argument " "1"" of type '" "int""'"); |
| 3978 | } |
| 3979 | arg1 = (int)(val1); |
| 3980 | serialClose(arg1); |
| 3981 | resultobj = SWIG_Py_Void(); |
| 3982 | return resultobj; |
| 3983 | fail: |
| 3984 | return NULL; |
| 3985 | } |
| 3986 | |
| 3987 | |
| 3988 | SWIGINTERN PyObject *_wrap_serialFlush(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { |
| 3989 | PyObject *resultobj = 0; |
| 3990 | int arg1 ; |
| 3991 | int val1 ; |
| 3992 | int ecode1 = 0 ; |
| 3993 | PyObject * obj0 = 0 ; |
| 3994 | |
| 3995 | if (!PyArg_ParseTuple(args,(char *)"O:serialFlush",&obj0)) SWIG_fail; |
| 3996 | ecode1 = SWIG_AsVal_int(obj0, &val1); |
| 3997 | if (!SWIG_IsOK(ecode1)) { |
| 3998 | SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "serialFlush" "', argument " "1"" of type '" "int""'"); |
| 3999 | } |
| 4000 | arg1 = (int)(val1); |
| 4001 | serialFlush(arg1); |
| 4002 | resultobj = SWIG_Py_Void(); |
| 4003 | return resultobj; |
| 4004 | fail: |
| 4005 | return NULL; |
| 4006 | } |
| 4007 | |
| 4008 | |
| 4009 | SWIGINTERN PyObject *_wrap_serialPutchar(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { |
| 4010 | PyObject *resultobj = 0; |
| 4011 | int arg1 ; |
| 4012 | unsigned char arg2 ; |
| 4013 | int val1 ; |
| 4014 | int ecode1 = 0 ; |
| 4015 | unsigned char val2 ; |
| 4016 | int ecode2 = 0 ; |
| 4017 | PyObject * obj0 = 0 ; |
| 4018 | PyObject * obj1 = 0 ; |
| 4019 | |
| 4020 | if (!PyArg_ParseTuple(args,(char *)"OO:serialPutchar",&obj0,&obj1)) SWIG_fail; |
| 4021 | ecode1 = SWIG_AsVal_int(obj0, &val1); |
| 4022 | if (!SWIG_IsOK(ecode1)) { |
| 4023 | SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "serialPutchar" "', argument " "1"" of type '" "int""'"); |
| 4024 | } |
| 4025 | arg1 = (int)(val1); |
| 4026 | ecode2 = SWIG_AsVal_unsigned_SS_char(obj1, &val2); |
| 4027 | if (!SWIG_IsOK(ecode2)) { |
| 4028 | SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "serialPutchar" "', argument " "2"" of type '" "unsigned char""'"); |
| 4029 | } |
| 4030 | arg2 = (unsigned char)(val2); |
| 4031 | serialPutchar(arg1,arg2); |
| 4032 | resultobj = SWIG_Py_Void(); |
| 4033 | return resultobj; |
| 4034 | fail: |
| 4035 | return NULL; |
| 4036 | } |
| 4037 | |
| 4038 | |
| 4039 | SWIGINTERN PyObject *_wrap_serialPuts(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { |
| 4040 | PyObject *resultobj = 0; |
| 4041 | int arg1 ; |
| 4042 | char *arg2 = (char *) 0 ; |
| 4043 | int val1 ; |
| 4044 | int ecode1 = 0 ; |
| 4045 | int res2 ; |
| 4046 | char *buf2 = 0 ; |
| 4047 | int alloc2 = 0 ; |
| 4048 | PyObject * obj0 = 0 ; |
| 4049 | PyObject * obj1 = 0 ; |
| 4050 | |
| 4051 | if (!PyArg_ParseTuple(args,(char *)"OO:serialPuts",&obj0,&obj1)) SWIG_fail; |
| 4052 | ecode1 = SWIG_AsVal_int(obj0, &val1); |
| 4053 | if (!SWIG_IsOK(ecode1)) { |
| 4054 | SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "serialPuts" "', argument " "1"" of type '" "int""'"); |
| 4055 | } |
| 4056 | arg1 = (int)(val1); |
| 4057 | res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2); |
| 4058 | if (!SWIG_IsOK(res2)) { |
| 4059 | SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "serialPuts" "', argument " "2"" of type '" "char *""'"); |
| 4060 | } |
| 4061 | arg2 = (char *)(buf2); |
| 4062 | serialPuts(arg1,arg2); |
| 4063 | resultobj = SWIG_Py_Void(); |
| 4064 | if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); |
| 4065 | return resultobj; |
| 4066 | fail: |
| 4067 | if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); |
| 4068 | return NULL; |
| 4069 | } |
| 4070 | |
| 4071 | |
| 4072 | SWIGINTERN PyObject *_wrap_serialPrintf__varargs__(PyObject *SWIGUNUSEDPARM(self), PyObject *args, PyObject *varargs) { |
| 4073 | PyObject *resultobj = 0; |
| 4074 | int arg1 ; |
| 4075 | char *arg2 = (char *) 0 ; |
| 4076 | void *arg3 = 0 ; |
| 4077 | int val1 ; |
| 4078 | int ecode1 = 0 ; |
| 4079 | int res2 ; |
| 4080 | char *buf2 = 0 ; |
| 4081 | int alloc2 = 0 ; |
| 4082 | PyObject * obj0 = 0 ; |
| 4083 | PyObject * obj1 = 0 ; |
| 4084 | |
| 4085 | if (!PyArg_ParseTuple(args,(char *)"OO:serialPrintf",&obj0,&obj1)) SWIG_fail; |
| 4086 | ecode1 = SWIG_AsVal_int(obj0, &val1); |
| 4087 | if (!SWIG_IsOK(ecode1)) { |
| 4088 | SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "serialPrintf" "', argument " "1"" of type '" "int""'"); |
| 4089 | } |
| 4090 | arg1 = (int)(val1); |
| 4091 | res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2); |
| 4092 | if (!SWIG_IsOK(res2)) { |
| 4093 | SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "serialPrintf" "', argument " "2"" of type '" "char *""'"); |
| 4094 | } |
| 4095 | arg2 = (char *)(buf2); |
| 4096 | serialPrintf(arg1,arg2,arg3); |
| 4097 | resultobj = SWIG_Py_Void(); |
| 4098 | if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); |
| 4099 | return resultobj; |
| 4100 | fail: |
| 4101 | if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); |
| 4102 | return NULL; |
| 4103 | } |
| 4104 | |
| 4105 | |
| 4106 | SWIGINTERN PyObject *_wrap_serialPrintf(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { |
| 4107 | PyObject *resultobj; |
| 4108 | PyObject *varargs; |
| 4109 | PyObject *newargs; |
| 4110 | |
| 4111 | newargs = PyTuple_GetSlice(args,0,2); |
| 4112 | varargs = PyTuple_GetSlice(args,2,PyTuple_Size(args)+1); |
| 4113 | resultobj = _wrap_serialPrintf__varargs__(NULL,newargs,varargs); |
| 4114 | Py_XDECREF(newargs); |
| 4115 | Py_XDECREF(varargs); |
| 4116 | return resultobj; |
| 4117 | } |
| 4118 | |
| 4119 | |
| 4120 | SWIGINTERN PyObject *_wrap_serialDataAvail(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { |
| 4121 | PyObject *resultobj = 0; |
| 4122 | int arg1 ; |
| 4123 | int val1 ; |
| 4124 | int ecode1 = 0 ; |
| 4125 | PyObject * obj0 = 0 ; |
| 4126 | int result; |
| 4127 | |
| 4128 | if (!PyArg_ParseTuple(args,(char *)"O:serialDataAvail",&obj0)) SWIG_fail; |
| 4129 | ecode1 = SWIG_AsVal_int(obj0, &val1); |
| 4130 | if (!SWIG_IsOK(ecode1)) { |
| 4131 | SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "serialDataAvail" "', argument " "1"" of type '" "int""'"); |
| 4132 | } |
| 4133 | arg1 = (int)(val1); |
| 4134 | result = (int)serialDataAvail(arg1); |
| 4135 | resultobj = SWIG_From_int((int)(result)); |
| 4136 | return resultobj; |
| 4137 | fail: |
| 4138 | return NULL; |
| 4139 | } |
| 4140 | |
| 4141 | |
| 4142 | SWIGINTERN PyObject *_wrap_serialGetchar(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { |
| 4143 | PyObject *resultobj = 0; |
| 4144 | int arg1 ; |
| 4145 | int val1 ; |
| 4146 | int ecode1 = 0 ; |
| 4147 | PyObject * obj0 = 0 ; |
| 4148 | int result; |
| 4149 | |
| 4150 | if (!PyArg_ParseTuple(args,(char *)"O:serialGetchar",&obj0)) SWIG_fail; |
| 4151 | ecode1 = SWIG_AsVal_int(obj0, &val1); |
| 4152 | if (!SWIG_IsOK(ecode1)) { |
| 4153 | SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "serialGetchar" "', argument " "1"" of type '" "int""'"); |
| 4154 | } |
| 4155 | arg1 = (int)(val1); |
| 4156 | result = (int)serialGetchar(arg1); |
| 4157 | resultobj = SWIG_From_int((int)(result)); |
| 4158 | return resultobj; |
| 4159 | fail: |
| 4160 | return NULL; |
| 4161 | } |
| 4162 | |
| 4163 | |
| 4164 | SWIGINTERN PyObject *_wrap_shiftOut(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { |
| 4165 | PyObject *resultobj = 0; |
| 4166 | uint8_t arg1 ; |
| 4167 | uint8_t arg2 ; |
| 4168 | uint8_t arg3 ; |
| 4169 | uint8_t arg4 ; |
| 4170 | unsigned char val1 ; |
| 4171 | int ecode1 = 0 ; |
| 4172 | unsigned char val2 ; |
| 4173 | int ecode2 = 0 ; |
| 4174 | unsigned char val3 ; |
| 4175 | int ecode3 = 0 ; |
| 4176 | unsigned char val4 ; |
| 4177 | int ecode4 = 0 ; |
| 4178 | PyObject * obj0 = 0 ; |
| 4179 | PyObject * obj1 = 0 ; |
| 4180 | PyObject * obj2 = 0 ; |
| 4181 | PyObject * obj3 = 0 ; |
| 4182 | |
| 4183 | if (!PyArg_ParseTuple(args,(char *)"OOOO:shiftOut",&obj0,&obj1,&obj2,&obj3)) SWIG_fail; |
| 4184 | ecode1 = SWIG_AsVal_unsigned_SS_char(obj0, &val1); |
| 4185 | if (!SWIG_IsOK(ecode1)) { |
| 4186 | SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "shiftOut" "', argument " "1"" of type '" "uint8_t""'"); |
| 4187 | } |
| 4188 | arg1 = (uint8_t)(val1); |
| 4189 | ecode2 = SWIG_AsVal_unsigned_SS_char(obj1, &val2); |
| 4190 | if (!SWIG_IsOK(ecode2)) { |
| 4191 | SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "shiftOut" "', argument " "2"" of type '" "uint8_t""'"); |
| 4192 | } |
| 4193 | arg2 = (uint8_t)(val2); |
| 4194 | ecode3 = SWIG_AsVal_unsigned_SS_char(obj2, &val3); |
| 4195 | if (!SWIG_IsOK(ecode3)) { |
| 4196 | SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "shiftOut" "', argument " "3"" of type '" "uint8_t""'"); |
| 4197 | } |
| 4198 | arg3 = (uint8_t)(val3); |
| 4199 | ecode4 = SWIG_AsVal_unsigned_SS_char(obj3, &val4); |
| 4200 | if (!SWIG_IsOK(ecode4)) { |
| 4201 | SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "shiftOut" "', argument " "4"" of type '" "uint8_t""'"); |
| 4202 | } |
| 4203 | arg4 = (uint8_t)(val4); |
| 4204 | shiftOut(arg1,arg2,arg3,arg4); |
| 4205 | resultobj = SWIG_Py_Void(); |
| 4206 | return resultobj; |
| 4207 | fail: |
| 4208 | return NULL; |
| 4209 | } |
| 4210 | |
| 4211 | |
| 4212 | SWIGINTERN PyObject *_wrap_shiftIn(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { |
| 4213 | PyObject *resultobj = 0; |
| 4214 | uint8_t arg1 ; |
| 4215 | uint8_t arg2 ; |
| 4216 | uint8_t arg3 ; |
| 4217 | unsigned char val1 ; |
| 4218 | int ecode1 = 0 ; |
| 4219 | unsigned char val2 ; |
| 4220 | int ecode2 = 0 ; |
| 4221 | unsigned char val3 ; |
| 4222 | int ecode3 = 0 ; |
| 4223 | PyObject * obj0 = 0 ; |
| 4224 | PyObject * obj1 = 0 ; |
| 4225 | PyObject * obj2 = 0 ; |
| 4226 | uint8_t result; |
| 4227 | |
| 4228 | if (!PyArg_ParseTuple(args,(char *)"OOO:shiftIn",&obj0,&obj1,&obj2)) SWIG_fail; |
| 4229 | ecode1 = SWIG_AsVal_unsigned_SS_char(obj0, &val1); |
| 4230 | if (!SWIG_IsOK(ecode1)) { |
| 4231 | SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "shiftIn" "', argument " "1"" of type '" "uint8_t""'"); |
| 4232 | } |
| 4233 | arg1 = (uint8_t)(val1); |
| 4234 | ecode2 = SWIG_AsVal_unsigned_SS_char(obj1, &val2); |
| 4235 | if (!SWIG_IsOK(ecode2)) { |
| 4236 | SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "shiftIn" "', argument " "2"" of type '" "uint8_t""'"); |
| 4237 | } |
| 4238 | arg2 = (uint8_t)(val2); |
| 4239 | ecode3 = SWIG_AsVal_unsigned_SS_char(obj2, &val3); |
| 4240 | if (!SWIG_IsOK(ecode3)) { |
| 4241 | SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "shiftIn" "', argument " "3"" of type '" "uint8_t""'"); |
| 4242 | } |
| 4243 | arg3 = (uint8_t)(val3); |
| 4244 | result = shiftIn(arg1,arg2,arg3); |
| 4245 | resultobj = SWIG_From_unsigned_SS_char((unsigned char)(result)); |
| 4246 | return resultobj; |
| 4247 | fail: |
| 4248 | return NULL; |
| 4249 | } |
| 4250 | |
| 4251 | |
| 4252 | SWIGINTERN PyObject *_wrap_wiringPiSPIGetFd(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { |
| 4253 | PyObject *resultobj = 0; |
| 4254 | int arg1 ; |
| 4255 | int val1 ; |
| 4256 | int ecode1 = 0 ; |
| 4257 | PyObject * obj0 = 0 ; |
| 4258 | int result; |
| 4259 | |
| 4260 | if (!PyArg_ParseTuple(args,(char *)"O:wiringPiSPIGetFd",&obj0)) SWIG_fail; |
| 4261 | ecode1 = SWIG_AsVal_int(obj0, &val1); |
| 4262 | if (!SWIG_IsOK(ecode1)) { |
| 4263 | SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "wiringPiSPIGetFd" "', argument " "1"" of type '" "int""'"); |
| 4264 | } |
| 4265 | arg1 = (int)(val1); |
| 4266 | result = (int)wiringPiSPIGetFd(arg1); |
| 4267 | resultobj = SWIG_From_int((int)(result)); |
| 4268 | return resultobj; |
| 4269 | fail: |
| 4270 | return NULL; |
| 4271 | } |
| 4272 | |
| 4273 | |
| 4274 | SWIGINTERN PyObject *_wrap_wiringPiSPIDataRW(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { |
| 4275 | PyObject *resultobj = 0; |
| 4276 | int arg1 ; |
| 4277 | unsigned char *arg2 = (unsigned char *) 0 ; |
| 4278 | int arg3 ; |
| 4279 | int val1 ; |
| 4280 | int ecode1 = 0 ; |
| 4281 | PyObject * obj0 = 0 ; |
| 4282 | PyObject * obj1 = 0 ; |
| 4283 | int result; |
| 4284 | |
| 4285 | if (!PyArg_ParseTuple(args,(char *)"OO:wiringPiSPIDataRW",&obj0,&obj1)) SWIG_fail; |
| 4286 | ecode1 = SWIG_AsVal_int(obj0, &val1); |
| 4287 | if (!SWIG_IsOK(ecode1)) { |
| 4288 | SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "wiringPiSPIDataRW" "', argument " "1"" of type '" "int""'"); |
| 4289 | } |
| 4290 | arg1 = (int)(val1); |
| 4291 | { |
| 4292 | arg2 = (unsigned char *) PyString_AsString(obj1); |
| 4293 | arg3 = PyString_Size(obj1); |
| 4294 | } |
| 4295 | result = (int)wiringPiSPIDataRW(arg1,arg2,arg3); |
| 4296 | resultobj = SWIG_From_int((int)(result)); |
| 4297 | return resultobj; |
| 4298 | fail: |
| 4299 | return NULL; |
| 4300 | } |
| 4301 | |
| 4302 | |
| 4303 | SWIGINTERN PyObject *_wrap_wiringPiSPISetup(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { |
| 4304 | PyObject *resultobj = 0; |
| 4305 | int arg1 ; |
| 4306 | int arg2 ; |
| 4307 | int val1 ; |
| 4308 | int ecode1 = 0 ; |
| 4309 | int val2 ; |
| 4310 | int ecode2 = 0 ; |
| 4311 | PyObject * obj0 = 0 ; |
| 4312 | PyObject * obj1 = 0 ; |
| 4313 | int result; |
| 4314 | |
| 4315 | if (!PyArg_ParseTuple(args,(char *)"OO:wiringPiSPISetup",&obj0,&obj1)) SWIG_fail; |
| 4316 | ecode1 = SWIG_AsVal_int(obj0, &val1); |
| 4317 | if (!SWIG_IsOK(ecode1)) { |
| 4318 | SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "wiringPiSPISetup" "', argument " "1"" of type '" "int""'"); |
| 4319 | } |
| 4320 | arg1 = (int)(val1); |
| 4321 | ecode2 = SWIG_AsVal_int(obj1, &val2); |
| 4322 | if (!SWIG_IsOK(ecode2)) { |
| 4323 | SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "wiringPiSPISetup" "', argument " "2"" of type '" "int""'"); |
| 4324 | } |
| 4325 | arg2 = (int)(val2); |
| 4326 | result = (int)wiringPiSPISetup(arg1,arg2); |
| 4327 | resultobj = SWIG_From_int((int)(result)); |
| 4328 | return resultobj; |
| 4329 | fail: |
| 4330 | return NULL; |
| 4331 | } |
| 4332 | |
| 4333 | |
| 4334 | SWIGINTERN PyObject *_wrap_wiringPiI2CRead(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { |
| 4335 | PyObject *resultobj = 0; |
| 4336 | int arg1 ; |
| 4337 | int val1 ; |
| 4338 | int ecode1 = 0 ; |
| 4339 | PyObject * obj0 = 0 ; |
| 4340 | int result; |
| 4341 | |
| 4342 | if (!PyArg_ParseTuple(args,(char *)"O:wiringPiI2CRead",&obj0)) SWIG_fail; |
| 4343 | ecode1 = SWIG_AsVal_int(obj0, &val1); |
| 4344 | if (!SWIG_IsOK(ecode1)) { |
| 4345 | SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "wiringPiI2CRead" "', argument " "1"" of type '" "int""'"); |
| 4346 | } |
| 4347 | arg1 = (int)(val1); |
| 4348 | result = (int)wiringPiI2CRead(arg1); |
| 4349 | resultobj = SWIG_From_int((int)(result)); |
| 4350 | return resultobj; |
| 4351 | fail: |
| 4352 | return NULL; |
| 4353 | } |
| 4354 | |
| 4355 | |
| 4356 | SWIGINTERN PyObject *_wrap_wiringPiI2CReadReg8(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { |
| 4357 | PyObject *resultobj = 0; |
| 4358 | int arg1 ; |
| 4359 | int arg2 ; |
| 4360 | int val1 ; |
| 4361 | int ecode1 = 0 ; |
| 4362 | int val2 ; |
| 4363 | int ecode2 = 0 ; |
| 4364 | PyObject * obj0 = 0 ; |
| 4365 | PyObject * obj1 = 0 ; |
| 4366 | int result; |
| 4367 | |
| 4368 | if (!PyArg_ParseTuple(args,(char *)"OO:wiringPiI2CReadReg8",&obj0,&obj1)) SWIG_fail; |
| 4369 | ecode1 = SWIG_AsVal_int(obj0, &val1); |
| 4370 | if (!SWIG_IsOK(ecode1)) { |
| 4371 | SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "wiringPiI2CReadReg8" "', argument " "1"" of type '" "int""'"); |
| 4372 | } |
| 4373 | arg1 = (int)(val1); |
| 4374 | ecode2 = SWIG_AsVal_int(obj1, &val2); |
| 4375 | if (!SWIG_IsOK(ecode2)) { |
| 4376 | SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "wiringPiI2CReadReg8" "', argument " "2"" of type '" "int""'"); |
| 4377 | } |
| 4378 | arg2 = (int)(val2); |
| 4379 | result = (int)wiringPiI2CReadReg8(arg1,arg2); |
| 4380 | resultobj = SWIG_From_int((int)(result)); |
| 4381 | return resultobj; |
| 4382 | fail: |
| 4383 | return NULL; |
| 4384 | } |
| 4385 | |
| 4386 | |
| 4387 | SWIGINTERN PyObject *_wrap_wiringPiI2CReadReg16(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { |
| 4388 | PyObject *resultobj = 0; |
| 4389 | int arg1 ; |
| 4390 | int arg2 ; |
| 4391 | int val1 ; |
| 4392 | int ecode1 = 0 ; |
| 4393 | int val2 ; |
| 4394 | int ecode2 = 0 ; |
| 4395 | PyObject * obj0 = 0 ; |
| 4396 | PyObject * obj1 = 0 ; |
| 4397 | int result; |
| 4398 | |
| 4399 | if (!PyArg_ParseTuple(args,(char *)"OO:wiringPiI2CReadReg16",&obj0,&obj1)) SWIG_fail; |
| 4400 | ecode1 = SWIG_AsVal_int(obj0, &val1); |
| 4401 | if (!SWIG_IsOK(ecode1)) { |
| 4402 | SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "wiringPiI2CReadReg16" "', argument " "1"" of type '" "int""'"); |
| 4403 | } |
| 4404 | arg1 = (int)(val1); |
| 4405 | ecode2 = SWIG_AsVal_int(obj1, &val2); |
| 4406 | if (!SWIG_IsOK(ecode2)) { |
| 4407 | SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "wiringPiI2CReadReg16" "', argument " "2"" of type '" "int""'"); |
| 4408 | } |
| 4409 | arg2 = (int)(val2); |
| 4410 | result = (int)wiringPiI2CReadReg16(arg1,arg2); |
| 4411 | resultobj = SWIG_From_int((int)(result)); |
| 4412 | return resultobj; |
| 4413 | fail: |
| 4414 | return NULL; |
| 4415 | } |
| 4416 | |
| 4417 | |
| 4418 | SWIGINTERN PyObject *_wrap_wiringPiI2CWrite(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { |
| 4419 | PyObject *resultobj = 0; |
| 4420 | int arg1 ; |
| 4421 | int arg2 ; |
| 4422 | int val1 ; |
| 4423 | int ecode1 = 0 ; |
| 4424 | int val2 ; |
| 4425 | int ecode2 = 0 ; |
| 4426 | PyObject * obj0 = 0 ; |
| 4427 | PyObject * obj1 = 0 ; |
| 4428 | int result; |
| 4429 | |
| 4430 | if (!PyArg_ParseTuple(args,(char *)"OO:wiringPiI2CWrite",&obj0,&obj1)) SWIG_fail; |
| 4431 | ecode1 = SWIG_AsVal_int(obj0, &val1); |
| 4432 | if (!SWIG_IsOK(ecode1)) { |
| 4433 | SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "wiringPiI2CWrite" "', argument " "1"" of type '" "int""'"); |
| 4434 | } |
| 4435 | arg1 = (int)(val1); |
| 4436 | ecode2 = SWIG_AsVal_int(obj1, &val2); |
| 4437 | if (!SWIG_IsOK(ecode2)) { |
| 4438 | SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "wiringPiI2CWrite" "', argument " "2"" of type '" "int""'"); |
| 4439 | } |
| 4440 | arg2 = (int)(val2); |
| 4441 | result = (int)wiringPiI2CWrite(arg1,arg2); |
| 4442 | resultobj = SWIG_From_int((int)(result)); |
| 4443 | return resultobj; |
| 4444 | fail: |
| 4445 | return NULL; |
| 4446 | } |
| 4447 | |
| 4448 | |
| 4449 | SWIGINTERN PyObject *_wrap_wiringPiI2CWriteReg8(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { |
| 4450 | PyObject *resultobj = 0; |
| 4451 | int arg1 ; |
| 4452 | int arg2 ; |
| 4453 | int arg3 ; |
| 4454 | int val1 ; |
| 4455 | int ecode1 = 0 ; |
| 4456 | int val2 ; |
| 4457 | int ecode2 = 0 ; |
| 4458 | int val3 ; |
| 4459 | int ecode3 = 0 ; |
| 4460 | PyObject * obj0 = 0 ; |
| 4461 | PyObject * obj1 = 0 ; |
| 4462 | PyObject * obj2 = 0 ; |
| 4463 | int result; |
| 4464 | |
| 4465 | if (!PyArg_ParseTuple(args,(char *)"OOO:wiringPiI2CWriteReg8",&obj0,&obj1,&obj2)) SWIG_fail; |
| 4466 | ecode1 = SWIG_AsVal_int(obj0, &val1); |
| 4467 | if (!SWIG_IsOK(ecode1)) { |
| 4468 | SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "wiringPiI2CWriteReg8" "', argument " "1"" of type '" "int""'"); |
| 4469 | } |
| 4470 | arg1 = (int)(val1); |
| 4471 | ecode2 = SWIG_AsVal_int(obj1, &val2); |
| 4472 | if (!SWIG_IsOK(ecode2)) { |
| 4473 | SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "wiringPiI2CWriteReg8" "', argument " "2"" of type '" "int""'"); |
| 4474 | } |
| 4475 | arg2 = (int)(val2); |
| 4476 | ecode3 = SWIG_AsVal_int(obj2, &val3); |
| 4477 | if (!SWIG_IsOK(ecode3)) { |
| 4478 | SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "wiringPiI2CWriteReg8" "', argument " "3"" of type '" "int""'"); |
| 4479 | } |
| 4480 | arg3 = (int)(val3); |
| 4481 | result = (int)wiringPiI2CWriteReg8(arg1,arg2,arg3); |
| 4482 | resultobj = SWIG_From_int((int)(result)); |
| 4483 | return resultobj; |
| 4484 | fail: |
| 4485 | return NULL; |
| 4486 | } |
| 4487 | |
| 4488 | |
| 4489 | SWIGINTERN PyObject *_wrap_wiringPiI2CWriteReg16(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { |
| 4490 | PyObject *resultobj = 0; |
| 4491 | int arg1 ; |
| 4492 | int arg2 ; |
| 4493 | int arg3 ; |
| 4494 | int val1 ; |
| 4495 | int ecode1 = 0 ; |
| 4496 | int val2 ; |
| 4497 | int ecode2 = 0 ; |
| 4498 | int val3 ; |
| 4499 | int ecode3 = 0 ; |
| 4500 | PyObject * obj0 = 0 ; |
| 4501 | PyObject * obj1 = 0 ; |
| 4502 | PyObject * obj2 = 0 ; |
| 4503 | int result; |
| 4504 | |
| 4505 | if (!PyArg_ParseTuple(args,(char *)"OOO:wiringPiI2CWriteReg16",&obj0,&obj1,&obj2)) SWIG_fail; |
| 4506 | ecode1 = SWIG_AsVal_int(obj0, &val1); |
| 4507 | if (!SWIG_IsOK(ecode1)) { |
| 4508 | SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "wiringPiI2CWriteReg16" "', argument " "1"" of type '" "int""'"); |
| 4509 | } |
| 4510 | arg1 = (int)(val1); |
| 4511 | ecode2 = SWIG_AsVal_int(obj1, &val2); |
| 4512 | if (!SWIG_IsOK(ecode2)) { |
| 4513 | SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "wiringPiI2CWriteReg16" "', argument " "2"" of type '" "int""'"); |
| 4514 | } |
| 4515 | arg2 = (int)(val2); |
| 4516 | ecode3 = SWIG_AsVal_int(obj2, &val3); |
| 4517 | if (!SWIG_IsOK(ecode3)) { |
| 4518 | SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "wiringPiI2CWriteReg16" "', argument " "3"" of type '" "int""'"); |
| 4519 | } |
| 4520 | arg3 = (int)(val3); |
| 4521 | result = (int)wiringPiI2CWriteReg16(arg1,arg2,arg3); |
| 4522 | resultobj = SWIG_From_int((int)(result)); |
| 4523 | return resultobj; |
| 4524 | fail: |
| 4525 | return NULL; |
| 4526 | } |
| 4527 | |
| 4528 | |
| 4529 | SWIGINTERN PyObject *_wrap_softToneCreate(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { |
| 4530 | PyObject *resultobj = 0; |
| 4531 | int arg1 ; |
| 4532 | int val1 ; |
| 4533 | int ecode1 = 0 ; |
| 4534 | PyObject * obj0 = 0 ; |
| 4535 | int result; |
| 4536 | |
| 4537 | if (!PyArg_ParseTuple(args,(char *)"O:softToneCreate",&obj0)) SWIG_fail; |
| 4538 | ecode1 = SWIG_AsVal_int(obj0, &val1); |
| 4539 | if (!SWIG_IsOK(ecode1)) { |
| 4540 | SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "softToneCreate" "', argument " "1"" of type '" "int""'"); |
| 4541 | } |
| 4542 | arg1 = (int)(val1); |
| 4543 | result = (int)softToneCreate(arg1); |
| 4544 | resultobj = SWIG_From_int((int)(result)); |
| 4545 | return resultobj; |
| 4546 | fail: |
| 4547 | return NULL; |
| 4548 | } |
| 4549 | |
| 4550 | |
| 4551 | SWIGINTERN PyObject *_wrap_softToneWrite(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { |
| 4552 | PyObject *resultobj = 0; |
| 4553 | int arg1 ; |
| 4554 | int arg2 ; |
| 4555 | int val1 ; |
| 4556 | int ecode1 = 0 ; |
| 4557 | int val2 ; |
| 4558 | int ecode2 = 0 ; |
| 4559 | PyObject * obj0 = 0 ; |
| 4560 | PyObject * obj1 = 0 ; |
| 4561 | |
| 4562 | if (!PyArg_ParseTuple(args,(char *)"OO:softToneWrite",&obj0,&obj1)) SWIG_fail; |
| 4563 | ecode1 = SWIG_AsVal_int(obj0, &val1); |
| 4564 | if (!SWIG_IsOK(ecode1)) { |
| 4565 | SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "softToneWrite" "', argument " "1"" of type '" "int""'"); |
| 4566 | } |
| 4567 | arg1 = (int)(val1); |
| 4568 | ecode2 = SWIG_AsVal_int(obj1, &val2); |
| 4569 | if (!SWIG_IsOK(ecode2)) { |
| 4570 | SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "softToneWrite" "', argument " "2"" of type '" "int""'"); |
| 4571 | } |
| 4572 | arg2 = (int)(val2); |
| 4573 | softToneWrite(arg1,arg2); |
| 4574 | resultobj = SWIG_Py_Void(); |
| 4575 | return resultobj; |
| 4576 | fail: |
| 4577 | return NULL; |
| 4578 | } |
| 4579 | |
| 4580 | |
| 4581 | SWIGINTERN PyObject *_wrap_softServoWrite(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { |
| 4582 | PyObject *resultobj = 0; |
| 4583 | int arg1 ; |
| 4584 | int arg2 ; |
| 4585 | int val1 ; |
| 4586 | int ecode1 = 0 ; |
| 4587 | int val2 ; |
| 4588 | int ecode2 = 0 ; |
| 4589 | PyObject * obj0 = 0 ; |
| 4590 | PyObject * obj1 = 0 ; |
| 4591 | |
| 4592 | if (!PyArg_ParseTuple(args,(char *)"OO:softServoWrite",&obj0,&obj1)) SWIG_fail; |
| 4593 | ecode1 = SWIG_AsVal_int(obj0, &val1); |
| 4594 | if (!SWIG_IsOK(ecode1)) { |
| 4595 | SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "softServoWrite" "', argument " "1"" of type '" "int""'"); |
| 4596 | } |
| 4597 | arg1 = (int)(val1); |
| 4598 | ecode2 = SWIG_AsVal_int(obj1, &val2); |
| 4599 | if (!SWIG_IsOK(ecode2)) { |
| 4600 | SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "softServoWrite" "', argument " "2"" of type '" "int""'"); |
| 4601 | } |
| 4602 | arg2 = (int)(val2); |
| 4603 | softServoWrite(arg1,arg2); |
| 4604 | resultobj = SWIG_Py_Void(); |
| 4605 | return resultobj; |
| 4606 | fail: |
| 4607 | return NULL; |
| 4608 | } |
| 4609 | |
| 4610 | |
| 4611 | SWIGINTERN PyObject *_wrap_softServoSetup(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { |
| 4612 | PyObject *resultobj = 0; |
| 4613 | int arg1 ; |
| 4614 | int arg2 ; |
| 4615 | int arg3 ; |
| 4616 | int arg4 ; |
| 4617 | int arg5 ; |
| 4618 | int arg6 ; |
| 4619 | int arg7 ; |
| 4620 | int arg8 ; |
| 4621 | int val1 ; |
| 4622 | int ecode1 = 0 ; |
| 4623 | int val2 ; |
| 4624 | int ecode2 = 0 ; |
| 4625 | int val3 ; |
| 4626 | int ecode3 = 0 ; |
| 4627 | int val4 ; |
| 4628 | int ecode4 = 0 ; |
| 4629 | int val5 ; |
| 4630 | int ecode5 = 0 ; |
| 4631 | int val6 ; |
| 4632 | int ecode6 = 0 ; |
| 4633 | int val7 ; |
| 4634 | int ecode7 = 0 ; |
| 4635 | int val8 ; |
| 4636 | int ecode8 = 0 ; |
| 4637 | PyObject * obj0 = 0 ; |
| 4638 | PyObject * obj1 = 0 ; |
| 4639 | PyObject * obj2 = 0 ; |
| 4640 | PyObject * obj3 = 0 ; |
| 4641 | PyObject * obj4 = 0 ; |
| 4642 | PyObject * obj5 = 0 ; |
| 4643 | PyObject * obj6 = 0 ; |
| 4644 | PyObject * obj7 = 0 ; |
| 4645 | int result; |
| 4646 | |
| 4647 | if (!PyArg_ParseTuple(args,(char *)"OOOOOOOO:softServoSetup",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5,&obj6,&obj7)) SWIG_fail; |
| 4648 | ecode1 = SWIG_AsVal_int(obj0, &val1); |
| 4649 | if (!SWIG_IsOK(ecode1)) { |
| 4650 | SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "softServoSetup" "', argument " "1"" of type '" "int""'"); |
| 4651 | } |
| 4652 | arg1 = (int)(val1); |
| 4653 | ecode2 = SWIG_AsVal_int(obj1, &val2); |
| 4654 | if (!SWIG_IsOK(ecode2)) { |
| 4655 | SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "softServoSetup" "', argument " "2"" of type '" "int""'"); |
| 4656 | } |
| 4657 | arg2 = (int)(val2); |
| 4658 | ecode3 = SWIG_AsVal_int(obj2, &val3); |
| 4659 | if (!SWIG_IsOK(ecode3)) { |
| 4660 | SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "softServoSetup" "', argument " "3"" of type '" "int""'"); |
| 4661 | } |
| 4662 | arg3 = (int)(val3); |
| 4663 | ecode4 = SWIG_AsVal_int(obj3, &val4); |
| 4664 | if (!SWIG_IsOK(ecode4)) { |
| 4665 | SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "softServoSetup" "', argument " "4"" of type '" "int""'"); |
| 4666 | } |
| 4667 | arg4 = (int)(val4); |
| 4668 | ecode5 = SWIG_AsVal_int(obj4, &val5); |
| 4669 | if (!SWIG_IsOK(ecode5)) { |
| 4670 | SWIG_exception_fail(SWIG_ArgError(ecode5), "in method '" "softServoSetup" "', argument " "5"" of type '" "int""'"); |
| 4671 | } |
| 4672 | arg5 = (int)(val5); |
| 4673 | ecode6 = SWIG_AsVal_int(obj5, &val6); |
| 4674 | if (!SWIG_IsOK(ecode6)) { |
| 4675 | SWIG_exception_fail(SWIG_ArgError(ecode6), "in method '" "softServoSetup" "', argument " "6"" of type '" "int""'"); |
| 4676 | } |
| 4677 | arg6 = (int)(val6); |
| 4678 | ecode7 = SWIG_AsVal_int(obj6, &val7); |
| 4679 | if (!SWIG_IsOK(ecode7)) { |
| 4680 | SWIG_exception_fail(SWIG_ArgError(ecode7), "in method '" "softServoSetup" "', argument " "7"" of type '" "int""'"); |
| 4681 | } |
| 4682 | arg7 = (int)(val7); |
| 4683 | ecode8 = SWIG_AsVal_int(obj7, &val8); |
| 4684 | if (!SWIG_IsOK(ecode8)) { |
| 4685 | SWIG_exception_fail(SWIG_ArgError(ecode8), "in method '" "softServoSetup" "', argument " "8"" of type '" "int""'"); |
| 4686 | } |
| 4687 | arg8 = (int)(val8); |
| 4688 | result = (int)softServoSetup(arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8); |
| 4689 | resultobj = SWIG_From_int((int)(result)); |
| 4690 | return resultobj; |
| 4691 | fail: |
| 4692 | return NULL; |
| 4693 | } |
| 4694 | |
| 4695 | |
| 4696 | SWIGINTERN PyObject *_wrap_softPwmCreate(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { |
| 4697 | PyObject *resultobj = 0; |
| 4698 | int arg1 ; |
| 4699 | int arg2 ; |
| 4700 | int arg3 ; |
| 4701 | int val1 ; |
| 4702 | int ecode1 = 0 ; |
| 4703 | int val2 ; |
| 4704 | int ecode2 = 0 ; |
| 4705 | int val3 ; |
| 4706 | int ecode3 = 0 ; |
| 4707 | PyObject * obj0 = 0 ; |
| 4708 | PyObject * obj1 = 0 ; |
| 4709 | PyObject * obj2 = 0 ; |
| 4710 | int result; |
| 4711 | |
| 4712 | if (!PyArg_ParseTuple(args,(char *)"OOO:softPwmCreate",&obj0,&obj1,&obj2)) SWIG_fail; |
| 4713 | ecode1 = SWIG_AsVal_int(obj0, &val1); |
| 4714 | if (!SWIG_IsOK(ecode1)) { |
| 4715 | SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "softPwmCreate" "', argument " "1"" of type '" "int""'"); |
| 4716 | } |
| 4717 | arg1 = (int)(val1); |
| 4718 | ecode2 = SWIG_AsVal_int(obj1, &val2); |
| 4719 | if (!SWIG_IsOK(ecode2)) { |
| 4720 | SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "softPwmCreate" "', argument " "2"" of type '" "int""'"); |
| 4721 | } |
| 4722 | arg2 = (int)(val2); |
| 4723 | ecode3 = SWIG_AsVal_int(obj2, &val3); |
| 4724 | if (!SWIG_IsOK(ecode3)) { |
| 4725 | SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "softPwmCreate" "', argument " "3"" of type '" "int""'"); |
| 4726 | } |
| 4727 | arg3 = (int)(val3); |
| 4728 | result = (int)softPwmCreate(arg1,arg2,arg3); |
| 4729 | resultobj = SWIG_From_int((int)(result)); |
| 4730 | return resultobj; |
| 4731 | fail: |
| 4732 | return NULL; |
| 4733 | } |
| 4734 | |
| 4735 | |
| 4736 | SWIGINTERN PyObject *_wrap_softPwmWrite(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { |
| 4737 | PyObject *resultobj = 0; |
| 4738 | int arg1 ; |
| 4739 | int arg2 ; |
| 4740 | int val1 ; |
| 4741 | int ecode1 = 0 ; |
| 4742 | int val2 ; |
| 4743 | int ecode2 = 0 ; |
| 4744 | PyObject * obj0 = 0 ; |
| 4745 | PyObject * obj1 = 0 ; |
| 4746 | |
| 4747 | if (!PyArg_ParseTuple(args,(char *)"OO:softPwmWrite",&obj0,&obj1)) SWIG_fail; |
| 4748 | ecode1 = SWIG_AsVal_int(obj0, &val1); |
| 4749 | if (!SWIG_IsOK(ecode1)) { |
| 4750 | SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "softPwmWrite" "', argument " "1"" of type '" "int""'"); |
| 4751 | } |
| 4752 | arg1 = (int)(val1); |
| 4753 | ecode2 = SWIG_AsVal_int(obj1, &val2); |
| 4754 | if (!SWIG_IsOK(ecode2)) { |
| 4755 | SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "softPwmWrite" "', argument " "2"" of type '" "int""'"); |
| 4756 | } |
| 4757 | arg2 = (int)(val2); |
| 4758 | softPwmWrite(arg1,arg2); |
| 4759 | resultobj = SWIG_Py_Void(); |
| 4760 | return resultobj; |
| 4761 | fail: |
| 4762 | return NULL; |
| 4763 | } |
| 4764 | |
| 4765 | |
| 4766 | SWIGINTERN PyObject *_wrap_mcp23s17Setup(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { |
| 4767 | PyObject *resultobj = 0; |
| 4768 | int arg1 ; |
| 4769 | int arg2 ; |
| 4770 | int arg3 ; |
| 4771 | int val1 ; |
| 4772 | int ecode1 = 0 ; |
| 4773 | int val2 ; |
| 4774 | int ecode2 = 0 ; |
| 4775 | int val3 ; |
| 4776 | int ecode3 = 0 ; |
| 4777 | PyObject * obj0 = 0 ; |
| 4778 | PyObject * obj1 = 0 ; |
| 4779 | PyObject * obj2 = 0 ; |
| 4780 | int result; |
| 4781 | |
| 4782 | if (!PyArg_ParseTuple(args,(char *)"OOO:mcp23s17Setup",&obj0,&obj1,&obj2)) SWIG_fail; |
| 4783 | ecode1 = SWIG_AsVal_int(obj0, &val1); |
| 4784 | if (!SWIG_IsOK(ecode1)) { |
| 4785 | SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "mcp23s17Setup" "', argument " "1"" of type '" "int""'"); |
| 4786 | } |
| 4787 | arg1 = (int)(val1); |
| 4788 | ecode2 = SWIG_AsVal_int(obj1, &val2); |
| 4789 | if (!SWIG_IsOK(ecode2)) { |
| 4790 | SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "mcp23s17Setup" "', argument " "2"" of type '" "int""'"); |
| 4791 | } |
| 4792 | arg2 = (int)(val2); |
| 4793 | ecode3 = SWIG_AsVal_int(obj2, &val3); |
| 4794 | if (!SWIG_IsOK(ecode3)) { |
| 4795 | SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "mcp23s17Setup" "', argument " "3"" of type '" "int""'"); |
| 4796 | } |
| 4797 | arg3 = (int)(val3); |
| 4798 | result = (int)mcp23s17Setup(arg1,arg2,arg3); |
| 4799 | resultobj = SWIG_From_int((int)(result)); |
| 4800 | return resultobj; |
| 4801 | fail: |
| 4802 | return NULL; |
| 4803 | } |
| 4804 | |
| 4805 | |
| 4806 | SWIGINTERN PyObject *_wrap_mcp23017Setup(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { |
| 4807 | PyObject *resultobj = 0; |
| 4808 | int arg1 ; |
| 4809 | int arg2 ; |
| 4810 | int val1 ; |
| 4811 | int ecode1 = 0 ; |
| 4812 | int val2 ; |
| 4813 | int ecode2 = 0 ; |
| 4814 | PyObject * obj0 = 0 ; |
| 4815 | PyObject * obj1 = 0 ; |
| 4816 | int result; |
| 4817 | |
| 4818 | if (!PyArg_ParseTuple(args,(char *)"OO:mcp23017Setup",&obj0,&obj1)) SWIG_fail; |
| 4819 | ecode1 = SWIG_AsVal_int(obj0, &val1); |
| 4820 | if (!SWIG_IsOK(ecode1)) { |
| 4821 | SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "mcp23017Setup" "', argument " "1"" of type '" "int""'"); |
| 4822 | } |
| 4823 | arg1 = (int)(val1); |
| 4824 | ecode2 = SWIG_AsVal_int(obj1, &val2); |
| 4825 | if (!SWIG_IsOK(ecode2)) { |
| 4826 | SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "mcp23017Setup" "', argument " "2"" of type '" "int""'"); |
| 4827 | } |
| 4828 | arg2 = (int)(val2); |
| 4829 | result = (int)mcp23017Setup(arg1,arg2); |
| 4830 | resultobj = SWIG_From_int((int)(result)); |
| 4831 | return resultobj; |
| 4832 | fail: |
| 4833 | return NULL; |
| 4834 | } |
| 4835 | |
| 4836 | |
| 4837 | SWIGINTERN PyObject *_wrap_mcp23s08Setup(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { |
| 4838 | PyObject *resultobj = 0; |
| 4839 | int arg1 ; |
| 4840 | int arg2 ; |
| 4841 | int arg3 ; |
| 4842 | int val1 ; |
| 4843 | int ecode1 = 0 ; |
| 4844 | int val2 ; |
| 4845 | int ecode2 = 0 ; |
| 4846 | int val3 ; |
| 4847 | int ecode3 = 0 ; |
| 4848 | PyObject * obj0 = 0 ; |
| 4849 | PyObject * obj1 = 0 ; |
| 4850 | PyObject * obj2 = 0 ; |
| 4851 | int result; |
| 4852 | |
| 4853 | if (!PyArg_ParseTuple(args,(char *)"OOO:mcp23s08Setup",&obj0,&obj1,&obj2)) SWIG_fail; |
| 4854 | ecode1 = SWIG_AsVal_int(obj0, &val1); |
| 4855 | if (!SWIG_IsOK(ecode1)) { |
| 4856 | SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "mcp23s08Setup" "', argument " "1"" of type '" "int""'"); |
| 4857 | } |
| 4858 | arg1 = (int)(val1); |
| 4859 | ecode2 = SWIG_AsVal_int(obj1, &val2); |
| 4860 | if (!SWIG_IsOK(ecode2)) { |
| 4861 | SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "mcp23s08Setup" "', argument " "2"" of type '" "int""'"); |
| 4862 | } |
| 4863 | arg2 = (int)(val2); |
| 4864 | ecode3 = SWIG_AsVal_int(obj2, &val3); |
| 4865 | if (!SWIG_IsOK(ecode3)) { |
| 4866 | SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "mcp23s08Setup" "', argument " "3"" of type '" "int""'"); |
| 4867 | } |
| 4868 | arg3 = (int)(val3); |
| 4869 | result = (int)mcp23s08Setup(arg1,arg2,arg3); |
| 4870 | resultobj = SWIG_From_int((int)(result)); |
| 4871 | return resultobj; |
| 4872 | fail: |
| 4873 | return NULL; |
| 4874 | } |
| 4875 | |
| 4876 | |
| 4877 | SWIGINTERN PyObject *_wrap_mcp23008Setup(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { |
| 4878 | PyObject *resultobj = 0; |
| 4879 | int arg1 ; |
| 4880 | int arg2 ; |
| 4881 | int val1 ; |
| 4882 | int ecode1 = 0 ; |
| 4883 | int val2 ; |
| 4884 | int ecode2 = 0 ; |
| 4885 | PyObject * obj0 = 0 ; |
| 4886 | PyObject * obj1 = 0 ; |
| 4887 | int result; |
| 4888 | |
| 4889 | if (!PyArg_ParseTuple(args,(char *)"OO:mcp23008Setup",&obj0,&obj1)) SWIG_fail; |
| 4890 | ecode1 = SWIG_AsVal_int(obj0, &val1); |
| 4891 | if (!SWIG_IsOK(ecode1)) { |
| 4892 | SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "mcp23008Setup" "', argument " "1"" of type '" "int""'"); |
| 4893 | } |
| 4894 | arg1 = (int)(val1); |
| 4895 | ecode2 = SWIG_AsVal_int(obj1, &val2); |
| 4896 | if (!SWIG_IsOK(ecode2)) { |
| 4897 | SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "mcp23008Setup" "', argument " "2"" of type '" "int""'"); |
| 4898 | } |
| 4899 | arg2 = (int)(val2); |
| 4900 | result = (int)mcp23008Setup(arg1,arg2); |
| 4901 | resultobj = SWIG_From_int((int)(result)); |
| 4902 | return resultobj; |
| 4903 | fail: |
| 4904 | return NULL; |
| 4905 | } |
| 4906 | |
| 4907 | |
| 4908 | SWIGINTERN PyObject *_wrap_sr595Setup(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { |
| 4909 | PyObject *resultobj = 0; |
| 4910 | int arg1 ; |
| 4911 | int arg2 ; |
| 4912 | int arg3 ; |
| 4913 | int arg4 ; |
| 4914 | int arg5 ; |
| 4915 | int val1 ; |
| 4916 | int ecode1 = 0 ; |
| 4917 | int val2 ; |
| 4918 | int ecode2 = 0 ; |
| 4919 | int val3 ; |
| 4920 | int ecode3 = 0 ; |
| 4921 | int val4 ; |
| 4922 | int ecode4 = 0 ; |
| 4923 | int val5 ; |
| 4924 | int ecode5 = 0 ; |
| 4925 | PyObject * obj0 = 0 ; |
| 4926 | PyObject * obj1 = 0 ; |
| 4927 | PyObject * obj2 = 0 ; |
| 4928 | PyObject * obj3 = 0 ; |
| 4929 | PyObject * obj4 = 0 ; |
| 4930 | int result; |
| 4931 | |
| 4932 | if (!PyArg_ParseTuple(args,(char *)"OOOOO:sr595Setup",&obj0,&obj1,&obj2,&obj3,&obj4)) SWIG_fail; |
| 4933 | ecode1 = SWIG_AsVal_int(obj0, &val1); |
| 4934 | if (!SWIG_IsOK(ecode1)) { |
| 4935 | SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "sr595Setup" "', argument " "1"" of type '" "int""'"); |
| 4936 | } |
| 4937 | arg1 = (int)(val1); |
| 4938 | ecode2 = SWIG_AsVal_int(obj1, &val2); |
| 4939 | if (!SWIG_IsOK(ecode2)) { |
| 4940 | SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "sr595Setup" "', argument " "2"" of type '" "int""'"); |
| 4941 | } |
| 4942 | arg2 = (int)(val2); |
| 4943 | ecode3 = SWIG_AsVal_int(obj2, &val3); |
| 4944 | if (!SWIG_IsOK(ecode3)) { |
| 4945 | SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "sr595Setup" "', argument " "3"" of type '" "int""'"); |
| 4946 | } |
| 4947 | arg3 = (int)(val3); |
| 4948 | ecode4 = SWIG_AsVal_int(obj3, &val4); |
| 4949 | if (!SWIG_IsOK(ecode4)) { |
| 4950 | SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "sr595Setup" "', argument " "4"" of type '" "int""'"); |
| 4951 | } |
| 4952 | arg4 = (int)(val4); |
| 4953 | ecode5 = SWIG_AsVal_int(obj4, &val5); |
| 4954 | if (!SWIG_IsOK(ecode5)) { |
| 4955 | SWIG_exception_fail(SWIG_ArgError(ecode5), "in method '" "sr595Setup" "', argument " "5"" of type '" "int""'"); |
| 4956 | } |
| 4957 | arg5 = (int)(val5); |
| 4958 | result = (int)sr595Setup(arg1,arg2,arg3,arg4,arg5); |
| 4959 | resultobj = SWIG_From_int((int)(result)); |
| 4960 | return resultobj; |
| 4961 | fail: |
| 4962 | return NULL; |
| 4963 | } |
| 4964 | |
| 4965 | |
| 4966 | static PyMethodDef SwigMethods[] = { |
| 4967 | { (char *)"SWIG_PyInstanceMethod_New", (PyCFunction)SWIG_PyInstanceMethod_New, METH_O, NULL}, |
| 4968 | { (char *)"wiringPiSetup", _wrap_wiringPiSetup, METH_VARARGS, NULL}, |
| 4969 | { (char *)"wiringPiSetupSys", _wrap_wiringPiSetupSys, METH_VARARGS, NULL}, |
| 4970 | { (char *)"wiringPiSetupGpio", _wrap_wiringPiSetupGpio, METH_VARARGS, NULL}, |
| 4971 | { (char *)"piFaceSetup", _wrap_piFaceSetup, METH_VARARGS, NULL}, |
| 4972 | { (char *)"piBoardRev", _wrap_piBoardRev, METH_VARARGS, NULL}, |
| 4973 | { (char *)"wpiPinToGpio", _wrap_wpiPinToGpio, METH_VARARGS, NULL}, |
| 4974 | { (char *)"pinMode", _wrap_pinMode, METH_VARARGS, NULL}, |
| 4975 | { (char *)"getAlt", _wrap_getAlt, METH_VARARGS, NULL}, |
| 4976 | { (char *)"pullUpDnControl", _wrap_pullUpDnControl, METH_VARARGS, NULL}, |
| 4977 | { (char *)"digitalWrite", _wrap_digitalWrite, METH_VARARGS, NULL}, |
| 4978 | { (char *)"digitalWriteByte", _wrap_digitalWriteByte, METH_VARARGS, NULL}, |
| 4979 | { (char *)"gpioClockSet", _wrap_gpioClockSet, METH_VARARGS, NULL}, |
| 4980 | { (char *)"pwmWrite", _wrap_pwmWrite, METH_VARARGS, NULL}, |
| 4981 | { (char *)"setPadDrive", _wrap_setPadDrive, METH_VARARGS, NULL}, |
| 4982 | { (char *)"digitalRead", _wrap_digitalRead, METH_VARARGS, NULL}, |
| 4983 | { (char *)"pwmSetMode", _wrap_pwmSetMode, METH_VARARGS, NULL}, |
| 4984 | { (char *)"pwmSetRange", _wrap_pwmSetRange, METH_VARARGS, NULL}, |
| 4985 | { (char *)"pwmSetClock", _wrap_pwmSetClock, METH_VARARGS, NULL}, |
| 4986 | { (char *)"wiringPiISR", _wrap_wiringPiISR, METH_VARARGS, NULL}, |
| 4987 | { (char *)"piThreadCreate", _wrap_piThreadCreate, METH_VARARGS, NULL}, |
| 4988 | { (char *)"piLock", _wrap_piLock, METH_VARARGS, NULL}, |
| 4989 | { (char *)"piUnlock", _wrap_piUnlock, METH_VARARGS, NULL}, |
| 4990 | { (char *)"delay", _wrap_delay, METH_VARARGS, NULL}, |
| 4991 | { (char *)"delayMicroseconds", _wrap_delayMicroseconds, METH_VARARGS, NULL}, |
| 4992 | { (char *)"millis", _wrap_millis, METH_VARARGS, NULL}, |
| 4993 | { (char *)"micros", _wrap_micros, METH_VARARGS, NULL}, |
| 4994 | { (char *)"serialOpen", _wrap_serialOpen, METH_VARARGS, NULL}, |
| 4995 | { (char *)"serialClose", _wrap_serialClose, METH_VARARGS, NULL}, |
| 4996 | { (char *)"serialFlush", _wrap_serialFlush, METH_VARARGS, NULL}, |
| 4997 | { (char *)"serialPutchar", _wrap_serialPutchar, METH_VARARGS, NULL}, |
| 4998 | { (char *)"serialPuts", _wrap_serialPuts, METH_VARARGS, NULL}, |
| 4999 | { (char *)"serialPrintf", _wrap_serialPrintf, METH_VARARGS, NULL}, |
| 5000 | { (char *)"serialDataAvail", _wrap_serialDataAvail, METH_VARARGS, NULL}, |
| 5001 | { (char *)"serialGetchar", _wrap_serialGetchar, METH_VARARGS, NULL}, |
| 5002 | { (char *)"shiftOut", _wrap_shiftOut, METH_VARARGS, NULL}, |
| 5003 | { (char *)"shiftIn", _wrap_shiftIn, METH_VARARGS, NULL}, |
| 5004 | { (char *)"wiringPiSPIGetFd", _wrap_wiringPiSPIGetFd, METH_VARARGS, NULL}, |
| 5005 | { (char *)"wiringPiSPIDataRW", _wrap_wiringPiSPIDataRW, METH_VARARGS, NULL}, |
| 5006 | { (char *)"wiringPiSPISetup", _wrap_wiringPiSPISetup, METH_VARARGS, NULL}, |
| 5007 | { (char *)"wiringPiI2CRead", _wrap_wiringPiI2CRead, METH_VARARGS, NULL}, |
| 5008 | { (char *)"wiringPiI2CReadReg8", _wrap_wiringPiI2CReadReg8, METH_VARARGS, NULL}, |
| 5009 | { (char *)"wiringPiI2CReadReg16", _wrap_wiringPiI2CReadReg16, METH_VARARGS, NULL}, |
| 5010 | { (char *)"wiringPiI2CWrite", _wrap_wiringPiI2CWrite, METH_VARARGS, NULL}, |
| 5011 | { (char *)"wiringPiI2CWriteReg8", _wrap_wiringPiI2CWriteReg8, METH_VARARGS, NULL}, |
| 5012 | { (char *)"wiringPiI2CWriteReg16", _wrap_wiringPiI2CWriteReg16, METH_VARARGS, NULL}, |
| 5013 | { (char *)"softToneCreate", _wrap_softToneCreate, METH_VARARGS, NULL}, |
| 5014 | { (char *)"softToneWrite", _wrap_softToneWrite, METH_VARARGS, NULL}, |
| 5015 | { (char *)"softServoWrite", _wrap_softServoWrite, METH_VARARGS, NULL}, |
| 5016 | { (char *)"softServoSetup", _wrap_softServoSetup, METH_VARARGS, NULL}, |
| 5017 | { (char *)"softPwmCreate", _wrap_softPwmCreate, METH_VARARGS, NULL}, |
| 5018 | { (char *)"softPwmWrite", _wrap_softPwmWrite, METH_VARARGS, NULL}, |
| 5019 | { (char *)"mcp23s17Setup", _wrap_mcp23s17Setup, METH_VARARGS, NULL}, |
| 5020 | { (char *)"mcp23017Setup", _wrap_mcp23017Setup, METH_VARARGS, NULL}, |
| 5021 | { (char *)"mcp23s08Setup", _wrap_mcp23s08Setup, METH_VARARGS, NULL}, |
| 5022 | { (char *)"mcp23008Setup", _wrap_mcp23008Setup, METH_VARARGS, NULL}, |
| 5023 | { (char *)"sr595Setup", _wrap_sr595Setup, METH_VARARGS, NULL}, |
| 5024 | { NULL, NULL, 0, NULL } |
| 5025 | }; |
| 5026 | |
| 5027 | |
| 5028 | /* -------- TYPE CONVERSION AND EQUIVALENCE RULES (BEGIN) -------- */ |
| 5029 | |
| 5030 | static swig_type_info _swigt__p_char = {"_p_char", "char *", 0, 0, (void*)0, 0}; |
| 5031 | static swig_type_info _swigt__p_f_int_int__int = {"_p_f_int_int__int", "int (*)(int,int)", 0, 0, (void*)0, 0}; |
| 5032 | static swig_type_info _swigt__p_f_p_void__p_void = {"_p_f_p_void__p_void", "void *(*)(void *)", 0, 0, (void*)0, 0}; |
| 5033 | static swig_type_info _swigt__p_f_void__void = {"_p_f_void__void", "void (*)(void)", 0, 0, (void*)0, 0}; |
| 5034 | static swig_type_info _swigt__p_unsigned_char = {"_p_unsigned_char", "unsigned char *", 0, 0, (void*)0, 0}; |
| 5035 | |
| 5036 | static swig_type_info *swig_type_initial[] = { |
| 5037 | &_swigt__p_char, |
| 5038 | &_swigt__p_f_int_int__int, |
| 5039 | &_swigt__p_f_p_void__p_void, |
| 5040 | &_swigt__p_f_void__void, |
| 5041 | &_swigt__p_unsigned_char, |
| 5042 | }; |
| 5043 | |
| 5044 | static swig_cast_info _swigc__p_char[] = { {&_swigt__p_char, 0, 0, 0},{0, 0, 0, 0}}; |
| 5045 | static swig_cast_info _swigc__p_f_int_int__int[] = { {&_swigt__p_f_int_int__int, 0, 0, 0},{0, 0, 0, 0}}; |
| 5046 | static swig_cast_info _swigc__p_f_p_void__p_void[] = { {&_swigt__p_f_p_void__p_void, 0, 0, 0},{0, 0, 0, 0}}; |
| 5047 | static swig_cast_info _swigc__p_f_void__void[] = { {&_swigt__p_f_void__void, 0, 0, 0},{0, 0, 0, 0}}; |
| 5048 | static swig_cast_info _swigc__p_unsigned_char[] = { {&_swigt__p_unsigned_char, 0, 0, 0},{0, 0, 0, 0}}; |
| 5049 | |
| 5050 | static swig_cast_info *swig_cast_initial[] = { |
| 5051 | _swigc__p_char, |
| 5052 | _swigc__p_f_int_int__int, |
| 5053 | _swigc__p_f_p_void__p_void, |
| 5054 | _swigc__p_f_void__void, |
| 5055 | _swigc__p_unsigned_char, |
| 5056 | }; |
| 5057 | |
| 5058 | |
| 5059 | /* -------- TYPE CONVERSION AND EQUIVALENCE RULES (END) -------- */ |
| 5060 | |
| 5061 | static swig_const_info swig_const_table[] = { |
| 5062 | {0, 0, 0, 0.0, 0, 0}}; |
| 5063 | |
| 5064 | #ifdef __cplusplus |
| 5065 | } |
| 5066 | #endif |
| 5067 | /* ----------------------------------------------------------------------------- |
| 5068 | * Type initialization: |
| 5069 | * This problem is tough by the requirement that no dynamic |
| 5070 | * memory is used. Also, since swig_type_info structures store pointers to |
| 5071 | * swig_cast_info structures and swig_cast_info structures store pointers back |
| 5072 | * to swig_type_info structures, we need some lookup code at initialization. |
| 5073 | * The idea is that swig generates all the structures that are needed. |
| 5074 | * The runtime then collects these partially filled structures. |
| 5075 | * The SWIG_InitializeModule function takes these initial arrays out of |
| 5076 | * swig_module, and does all the lookup, filling in the swig_module.types |
| 5077 | * array with the correct data and linking the correct swig_cast_info |
| 5078 | * structures together. |
| 5079 | * |
| 5080 | * The generated swig_type_info structures are assigned staticly to an initial |
| 5081 | * array. We just loop through that array, and handle each type individually. |
| 5082 | * First we lookup if this type has been already loaded, and if so, use the |
| 5083 | * loaded structure instead of the generated one. Then we have to fill in the |
| 5084 | * cast linked list. The cast data is initially stored in something like a |
| 5085 | * two-dimensional array. Each row corresponds to a type (there are the same |
| 5086 | * number of rows as there are in the swig_type_initial array). Each entry in |
| 5087 | * a column is one of the swig_cast_info structures for that type. |
| 5088 | * The cast_initial array is actually an array of arrays, because each row has |
| 5089 | * a variable number of columns. So to actually build the cast linked list, |
| 5090 | * we find the array of casts associated with the type, and loop through it |
| 5091 | * adding the casts to the list. The one last trick we need to do is making |
| 5092 | * sure the type pointer in the swig_cast_info struct is correct. |
| 5093 | * |
| 5094 | * First off, we lookup the cast->type name to see if it is already loaded. |
| 5095 | * There are three cases to handle: |
| 5096 | * 1) If the cast->type has already been loaded AND the type we are adding |
| 5097 | * casting info to has not been loaded (it is in this module), THEN we |
| 5098 | * replace the cast->type pointer with the type pointer that has already |
| 5099 | * been loaded. |
| 5100 | * 2) If BOTH types (the one we are adding casting info to, and the |
| 5101 | * cast->type) are loaded, THEN the cast info has already been loaded by |
| 5102 | * the previous module so we just ignore it. |
| 5103 | * 3) Finally, if cast->type has not already been loaded, then we add that |
| 5104 | * swig_cast_info to the linked list (because the cast->type) pointer will |
| 5105 | * be correct. |
| 5106 | * ----------------------------------------------------------------------------- */ |
| 5107 | |
| 5108 | #ifdef __cplusplus |
| 5109 | extern "C" { |
| 5110 | #if 0 |
| 5111 | } /* c-mode */ |
| 5112 | #endif |
| 5113 | #endif |
| 5114 | |
| 5115 | #if 0 |
| 5116 | #define SWIGRUNTIME_DEBUG |
| 5117 | #endif |
| 5118 | |
| 5119 | |
| 5120 | SWIGRUNTIME void |
| 5121 | SWIG_InitializeModule(void *clientdata) { |
| 5122 | size_t i; |
| 5123 | swig_module_info *module_head, *iter; |
| 5124 | int found, init; |
| 5125 | |
| 5126 | clientdata = clientdata; |
| 5127 | |
| 5128 | /* check to see if the circular list has been setup, if not, set it up */ |
| 5129 | if (swig_module.next==0) { |
| 5130 | /* Initialize the swig_module */ |
| 5131 | swig_module.type_initial = swig_type_initial; |
| 5132 | swig_module.cast_initial = swig_cast_initial; |
| 5133 | swig_module.next = &swig_module; |
| 5134 | init = 1; |
| 5135 | } else { |
| 5136 | init = 0; |
| 5137 | } |
| 5138 | |
| 5139 | /* Try and load any already created modules */ |
| 5140 | module_head = SWIG_GetModule(clientdata); |
| 5141 | if (!module_head) { |
| 5142 | /* This is the first module loaded for this interpreter */ |
| 5143 | /* so set the swig module into the interpreter */ |
| 5144 | SWIG_SetModule(clientdata, &swig_module); |
| 5145 | module_head = &swig_module; |
| 5146 | } else { |
| 5147 | /* the interpreter has loaded a SWIG module, but has it loaded this one? */ |
| 5148 | found=0; |
| 5149 | iter=module_head; |
| 5150 | do { |
| 5151 | if (iter==&swig_module) { |
| 5152 | found=1; |
| 5153 | break; |
| 5154 | } |
| 5155 | iter=iter->next; |
| 5156 | } while (iter!= module_head); |
| 5157 | |
| 5158 | /* if the is found in the list, then all is done and we may leave */ |
| 5159 | if (found) return; |
| 5160 | /* otherwise we must add out module into the list */ |
| 5161 | swig_module.next = module_head->next; |
| 5162 | module_head->next = &swig_module; |
| 5163 | } |
| 5164 | |
| 5165 | /* When multiple interpeters are used, a module could have already been initialized in |
| 5166 | a different interpreter, but not yet have a pointer in this interpreter. |
| 5167 | In this case, we do not want to continue adding types... everything should be |
| 5168 | set up already */ |
| 5169 | if (init == 0) return; |
| 5170 | |
| 5171 | /* Now work on filling in swig_module.types */ |
| 5172 | #ifdef SWIGRUNTIME_DEBUG |
| 5173 | printf("SWIG_InitializeModule: size %d\n", swig_module.size); |
| 5174 | #endif |
| 5175 | for (i = 0; i < swig_module.size; ++i) { |
| 5176 | swig_type_info *type = 0; |
| 5177 | swig_type_info *ret; |
| 5178 | swig_cast_info *cast; |
| 5179 | |
| 5180 | #ifdef SWIGRUNTIME_DEBUG |
| 5181 | printf("SWIG_InitializeModule: type %d %s\n", i, swig_module.type_initial[i]->name); |
| 5182 | #endif |
| 5183 | |
| 5184 | /* if there is another module already loaded */ |
| 5185 | if (swig_module.next != &swig_module) { |
| 5186 | type = SWIG_MangledTypeQueryModule(swig_module.next, &swig_module, swig_module.type_initial[i]->name); |
| 5187 | } |
| 5188 | if (type) { |
| 5189 | /* Overwrite clientdata field */ |
| 5190 | #ifdef SWIGRUNTIME_DEBUG |
| 5191 | printf("SWIG_InitializeModule: found type %s\n", type->name); |
| 5192 | #endif |
| 5193 | if (swig_module.type_initial[i]->clientdata) { |
| 5194 | type->clientdata = swig_module.type_initial[i]->clientdata; |
| 5195 | #ifdef SWIGRUNTIME_DEBUG |
| 5196 | printf("SWIG_InitializeModule: found and overwrite type %s \n", type->name); |
| 5197 | #endif |
| 5198 | } |
| 5199 | } else { |
| 5200 | type = swig_module.type_initial[i]; |
| 5201 | } |
| 5202 | |
| 5203 | /* Insert casting types */ |
| 5204 | cast = swig_module.cast_initial[i]; |
| 5205 | while (cast->type) { |
| 5206 | /* Don't need to add information already in the list */ |
| 5207 | ret = 0; |
| 5208 | #ifdef SWIGRUNTIME_DEBUG |
| 5209 | printf("SWIG_InitializeModule: look cast %s\n", cast->type->name); |
| 5210 | #endif |
| 5211 | if (swig_module.next != &swig_module) { |
| 5212 | ret = SWIG_MangledTypeQueryModule(swig_module.next, &swig_module, cast->type->name); |
| 5213 | #ifdef SWIGRUNTIME_DEBUG |
| 5214 | if (ret) printf("SWIG_InitializeModule: found cast %s\n", ret->name); |
| 5215 | #endif |
| 5216 | } |
| 5217 | if (ret) { |
| 5218 | if (type == swig_module.type_initial[i]) { |
| 5219 | #ifdef SWIGRUNTIME_DEBUG |
| 5220 | printf("SWIG_InitializeModule: skip old type %s\n", ret->name); |
| 5221 | #endif |
| 5222 | cast->type = ret; |
| 5223 | ret = 0; |
| 5224 | } else { |
| 5225 | /* Check for casting already in the list */ |
| 5226 | swig_cast_info *ocast = SWIG_TypeCheck(ret->name, type); |
| 5227 | #ifdef SWIGRUNTIME_DEBUG |
| 5228 | if (ocast) printf("SWIG_InitializeModule: skip old cast %s\n", ret->name); |
| 5229 | #endif |
| 5230 | if (!ocast) ret = 0; |
| 5231 | } |
| 5232 | } |
| 5233 | |
| 5234 | if (!ret) { |
| 5235 | #ifdef SWIGRUNTIME_DEBUG |
| 5236 | printf("SWIG_InitializeModule: adding cast %s\n", cast->type->name); |
| 5237 | #endif |
| 5238 | if (type->cast) { |
| 5239 | type->cast->prev = cast; |
| 5240 | cast->next = type->cast; |
| 5241 | } |
| 5242 | type->cast = cast; |
| 5243 | } |
| 5244 | cast++; |
| 5245 | } |
| 5246 | /* Set entry in modules->types array equal to the type */ |
| 5247 | swig_module.types[i] = type; |
| 5248 | } |
| 5249 | swig_module.types[i] = 0; |
| 5250 | |
| 5251 | #ifdef SWIGRUNTIME_DEBUG |
| 5252 | printf("**** SWIG_InitializeModule: Cast List ******\n"); |
| 5253 | for (i = 0; i < swig_module.size; ++i) { |
| 5254 | int j = 0; |
| 5255 | swig_cast_info *cast = swig_module.cast_initial[i]; |
| 5256 | printf("SWIG_InitializeModule: type %d %s\n", i, swig_module.type_initial[i]->name); |
| 5257 | while (cast->type) { |
| 5258 | printf("SWIG_InitializeModule: cast type %s\n", cast->type->name); |
| 5259 | cast++; |
| 5260 | ++j; |
| 5261 | } |
| 5262 | printf("---- Total casts: %d\n",j); |
| 5263 | } |
| 5264 | printf("**** SWIG_InitializeModule: Cast List ******\n"); |
| 5265 | #endif |
| 5266 | } |
| 5267 | |
| 5268 | /* This function will propagate the clientdata field of type to |
| 5269 | * any new swig_type_info structures that have been added into the list |
| 5270 | * of equivalent types. It is like calling |
| 5271 | * SWIG_TypeClientData(type, clientdata) a second time. |
| 5272 | */ |
| 5273 | SWIGRUNTIME void |
| 5274 | SWIG_PropagateClientData(void) { |
| 5275 | size_t i; |
| 5276 | swig_cast_info *equiv; |
| 5277 | static int init_run = 0; |
| 5278 | |
| 5279 | if (init_run) return; |
| 5280 | init_run = 1; |
| 5281 | |
| 5282 | for (i = 0; i < swig_module.size; i++) { |
| 5283 | if (swig_module.types[i]->clientdata) { |
| 5284 | equiv = swig_module.types[i]->cast; |
| 5285 | while (equiv) { |
| 5286 | if (!equiv->converter) { |
| 5287 | if (equiv->type && !equiv->type->clientdata) |
| 5288 | SWIG_TypeClientData(equiv->type, swig_module.types[i]->clientdata); |
| 5289 | } |
| 5290 | equiv = equiv->next; |
| 5291 | } |
| 5292 | } |
| 5293 | } |
| 5294 | } |
| 5295 | |
| 5296 | #ifdef __cplusplus |
| 5297 | #if 0 |
| 5298 | { |
| 5299 | /* c-mode */ |
| 5300 | #endif |
| 5301 | } |
| 5302 | #endif |
| 5303 | |
| 5304 | |
| 5305 | |
| 5306 | #ifdef __cplusplus |
| 5307 | extern "C" { |
| 5308 | #endif |
| 5309 | |
| 5310 | /* Python-specific SWIG API */ |
| 5311 | #define SWIG_newvarlink() SWIG_Python_newvarlink() |
| 5312 | #define SWIG_addvarlink(p, name, get_attr, set_attr) SWIG_Python_addvarlink(p, name, get_attr, set_attr) |
| 5313 | #define SWIG_InstallConstants(d, constants) SWIG_Python_InstallConstants(d, constants) |
| 5314 | |
| 5315 | /* ----------------------------------------------------------------------------- |
| 5316 | * global variable support code. |
| 5317 | * ----------------------------------------------------------------------------- */ |
| 5318 | |
| 5319 | typedef struct swig_globalvar { |
| 5320 | char *name; /* Name of global variable */ |
| 5321 | PyObject *(*get_attr)(void); /* Return the current value */ |
| 5322 | int (*set_attr)(PyObject *); /* Set the value */ |
| 5323 | struct swig_globalvar *next; |
| 5324 | } swig_globalvar; |
| 5325 | |
| 5326 | typedef struct swig_varlinkobject { |
| 5327 | PyObject_HEAD |
| 5328 | swig_globalvar *vars; |
| 5329 | } swig_varlinkobject; |
| 5330 | |
| 5331 | SWIGINTERN PyObject * |
| 5332 | swig_varlink_repr(swig_varlinkobject *SWIGUNUSEDPARM(v)) { |
| 5333 | #if PY_VERSION_HEX >= 0x03000000 |
| 5334 | return PyUnicode_InternFromString("<Swig global variables>"); |
| 5335 | #else |
| 5336 | return PyString_FromString("<Swig global variables>"); |
| 5337 | #endif |
| 5338 | } |
| 5339 | |
| 5340 | SWIGINTERN PyObject * |
| 5341 | swig_varlink_str(swig_varlinkobject *v) { |
| 5342 | #if PY_VERSION_HEX >= 0x03000000 |
| 5343 | PyObject *str = PyUnicode_InternFromString("("); |
| 5344 | PyObject *tail; |
| 5345 | PyObject *joined; |
| 5346 | swig_globalvar *var; |
| 5347 | for (var = v->vars; var; var=var->next) { |
| 5348 | tail = PyUnicode_FromString(var->name); |
| 5349 | joined = PyUnicode_Concat(str, tail); |
| 5350 | Py_DecRef(str); |
| 5351 | Py_DecRef(tail); |
| 5352 | str = joined; |
| 5353 | if (var->next) { |
| 5354 | tail = PyUnicode_InternFromString(", "); |
| 5355 | joined = PyUnicode_Concat(str, tail); |
| 5356 | Py_DecRef(str); |
| 5357 | Py_DecRef(tail); |
| 5358 | str = joined; |
| 5359 | } |
| 5360 | } |
| 5361 | tail = PyUnicode_InternFromString(")"); |
| 5362 | joined = PyUnicode_Concat(str, tail); |
| 5363 | Py_DecRef(str); |
| 5364 | Py_DecRef(tail); |
| 5365 | str = joined; |
| 5366 | #else |
| 5367 | PyObject *str = PyString_FromString("("); |
| 5368 | swig_globalvar *var; |
| 5369 | for (var = v->vars; var; var=var->next) { |
| 5370 | PyString_ConcatAndDel(&str,PyString_FromString(var->name)); |
| 5371 | if (var->next) PyString_ConcatAndDel(&str,PyString_FromString(", ")); |
| 5372 | } |
| 5373 | PyString_ConcatAndDel(&str,PyString_FromString(")")); |
| 5374 | #endif |
| 5375 | return str; |
| 5376 | } |
| 5377 | |
| 5378 | SWIGINTERN int |
| 5379 | swig_varlink_print(swig_varlinkobject *v, FILE *fp, int SWIGUNUSEDPARM(flags)) { |
| 5380 | char *tmp; |
| 5381 | PyObject *str = swig_varlink_str(v); |
| 5382 | fprintf(fp,"Swig global variables "); |
| 5383 | fprintf(fp,"%s\n", tmp = SWIG_Python_str_AsChar(str)); |
| 5384 | SWIG_Python_str_DelForPy3(tmp); |
| 5385 | Py_DECREF(str); |
| 5386 | return 0; |
| 5387 | } |
| 5388 | |
| 5389 | SWIGINTERN void |
| 5390 | swig_varlink_dealloc(swig_varlinkobject *v) { |
| 5391 | swig_globalvar *var = v->vars; |
| 5392 | while (var) { |
| 5393 | swig_globalvar *n = var->next; |
| 5394 | free(var->name); |
| 5395 | free(var); |
| 5396 | var = n; |
| 5397 | } |
| 5398 | } |
| 5399 | |
| 5400 | SWIGINTERN PyObject * |
| 5401 | swig_varlink_getattr(swig_varlinkobject *v, char *n) { |
| 5402 | PyObject *res = NULL; |
| 5403 | swig_globalvar *var = v->vars; |
| 5404 | while (var) { |
| 5405 | if (strcmp(var->name,n) == 0) { |
| 5406 | res = (*var->get_attr)(); |
| 5407 | break; |
| 5408 | } |
| 5409 | var = var->next; |
| 5410 | } |
| 5411 | if (res == NULL && !PyErr_Occurred()) { |
| 5412 | PyErr_SetString(PyExc_NameError,"Unknown C global variable"); |
| 5413 | } |
| 5414 | return res; |
| 5415 | } |
| 5416 | |
| 5417 | SWIGINTERN int |
| 5418 | swig_varlink_setattr(swig_varlinkobject *v, char *n, PyObject *p) { |
| 5419 | int res = 1; |
| 5420 | swig_globalvar *var = v->vars; |
| 5421 | while (var) { |
| 5422 | if (strcmp(var->name,n) == 0) { |
| 5423 | res = (*var->set_attr)(p); |
| 5424 | break; |
| 5425 | } |
| 5426 | var = var->next; |
| 5427 | } |
| 5428 | if (res == 1 && !PyErr_Occurred()) { |
| 5429 | PyErr_SetString(PyExc_NameError,"Unknown C global variable"); |
| 5430 | } |
| 5431 | return res; |
| 5432 | } |
| 5433 | |
| 5434 | SWIGINTERN PyTypeObject* |
| 5435 | swig_varlink_type(void) { |
| 5436 | static char varlink__doc__[] = "Swig var link object"; |
| 5437 | static PyTypeObject varlink_type; |
| 5438 | static int type_init = 0; |
| 5439 | if (!type_init) { |
| 5440 | const PyTypeObject tmp = { |
| 5441 | /* PyObject header changed in Python 3 */ |
| 5442 | #if PY_VERSION_HEX >= 0x03000000 |
| 5443 | PyVarObject_HEAD_INIT(NULL, 0) |
| 5444 | #else |
| 5445 | PyObject_HEAD_INIT(NULL) |
| 5446 | 0, /* ob_size */ |
| 5447 | #endif |
| 5448 | (char *)"swigvarlink", /* tp_name */ |
| 5449 | sizeof(swig_varlinkobject), /* tp_basicsize */ |
| 5450 | 0, /* tp_itemsize */ |
| 5451 | (destructor) swig_varlink_dealloc, /* tp_dealloc */ |
| 5452 | (printfunc) swig_varlink_print, /* tp_print */ |
| 5453 | (getattrfunc) swig_varlink_getattr, /* tp_getattr */ |
| 5454 | (setattrfunc) swig_varlink_setattr, /* tp_setattr */ |
| 5455 | 0, /* tp_compare */ |
| 5456 | (reprfunc) swig_varlink_repr, /* tp_repr */ |
| 5457 | 0, /* tp_as_number */ |
| 5458 | 0, /* tp_as_sequence */ |
| 5459 | 0, /* tp_as_mapping */ |
| 5460 | 0, /* tp_hash */ |
| 5461 | 0, /* tp_call */ |
| 5462 | (reprfunc) swig_varlink_str, /* tp_str */ |
| 5463 | 0, /* tp_getattro */ |
| 5464 | 0, /* tp_setattro */ |
| 5465 | 0, /* tp_as_buffer */ |
| 5466 | 0, /* tp_flags */ |
| 5467 | varlink__doc__, /* tp_doc */ |
| 5468 | 0, /* tp_traverse */ |
| 5469 | 0, /* tp_clear */ |
| 5470 | 0, /* tp_richcompare */ |
| 5471 | 0, /* tp_weaklistoffset */ |
| 5472 | #if PY_VERSION_HEX >= 0x02020000 |
| 5473 | 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* tp_iter -> tp_weaklist */ |
| 5474 | #endif |
| 5475 | #if PY_VERSION_HEX >= 0x02030000 |
| 5476 | 0, /* tp_del */ |
| 5477 | #endif |
| 5478 | #if PY_VERSION_HEX >= 0x02060000 |
| 5479 | 0, /* tp_version */ |
| 5480 | #endif |
| 5481 | #ifdef COUNT_ALLOCS |
| 5482 | 0,0,0,0 /* tp_alloc -> tp_next */ |
| 5483 | #endif |
| 5484 | }; |
| 5485 | varlink_type = tmp; |
| 5486 | type_init = 1; |
| 5487 | #if PY_VERSION_HEX < 0x02020000 |
| 5488 | varlink_type.ob_type = &PyType_Type; |
| 5489 | #else |
| 5490 | if (PyType_Ready(&varlink_type) < 0) |
| 5491 | return NULL; |
| 5492 | #endif |
| 5493 | } |
| 5494 | return &varlink_type; |
| 5495 | } |
| 5496 | |
| 5497 | /* Create a variable linking object for use later */ |
| 5498 | SWIGINTERN PyObject * |
| 5499 | SWIG_Python_newvarlink(void) { |
| 5500 | swig_varlinkobject *result = PyObject_NEW(swig_varlinkobject, swig_varlink_type()); |
| 5501 | if (result) { |
| 5502 | result->vars = 0; |
| 5503 | } |
| 5504 | return ((PyObject*) result); |
| 5505 | } |
| 5506 | |
| 5507 | SWIGINTERN void |
| 5508 | SWIG_Python_addvarlink(PyObject *p, char *name, PyObject *(*get_attr)(void), int (*set_attr)(PyObject *p)) { |
| 5509 | swig_varlinkobject *v = (swig_varlinkobject *) p; |
| 5510 | swig_globalvar *gv = (swig_globalvar *) malloc(sizeof(swig_globalvar)); |
| 5511 | if (gv) { |
| 5512 | size_t size = strlen(name)+1; |
| 5513 | gv->name = (char *)malloc(size); |
| 5514 | if (gv->name) { |
| 5515 | strncpy(gv->name,name,size); |
| 5516 | gv->get_attr = get_attr; |
| 5517 | gv->set_attr = set_attr; |
| 5518 | gv->next = v->vars; |
| 5519 | } |
| 5520 | } |
| 5521 | v->vars = gv; |
| 5522 | } |
| 5523 | |
| 5524 | SWIGINTERN PyObject * |
| 5525 | SWIG_globals(void) { |
| 5526 | static PyObject *_SWIG_globals = 0; |
| 5527 | if (!_SWIG_globals) _SWIG_globals = SWIG_newvarlink(); |
| 5528 | return _SWIG_globals; |
| 5529 | } |
| 5530 | |
| 5531 | /* ----------------------------------------------------------------------------- |
| 5532 | * constants/methods manipulation |
| 5533 | * ----------------------------------------------------------------------------- */ |
| 5534 | |
| 5535 | /* Install Constants */ |
| 5536 | SWIGINTERN void |
| 5537 | SWIG_Python_InstallConstants(PyObject *d, swig_const_info constants[]) { |
| 5538 | PyObject *obj = 0; |
| 5539 | size_t i; |
| 5540 | for (i = 0; constants[i].type; ++i) { |
| 5541 | switch(constants[i].type) { |
| 5542 | case SWIG_PY_POINTER: |
| 5543 | obj = SWIG_InternalNewPointerObj(constants[i].pvalue, *(constants[i]).ptype,0); |
| 5544 | break; |
| 5545 | case SWIG_PY_BINARY: |
| 5546 | obj = SWIG_NewPackedObj(constants[i].pvalue, constants[i].lvalue, *(constants[i].ptype)); |
| 5547 | break; |
| 5548 | default: |
| 5549 | obj = 0; |
| 5550 | break; |
| 5551 | } |
| 5552 | if (obj) { |
| 5553 | PyDict_SetItemString(d, constants[i].name, obj); |
| 5554 | Py_DECREF(obj); |
| 5555 | } |
| 5556 | } |
| 5557 | } |
| 5558 | |
| 5559 | /* -----------------------------------------------------------------------------*/ |
| 5560 | /* Fix SwigMethods to carry the callback ptrs when needed */ |
| 5561 | /* -----------------------------------------------------------------------------*/ |
| 5562 | |
| 5563 | SWIGINTERN void |
| 5564 | SWIG_Python_FixMethods(PyMethodDef *methods, |
| 5565 | swig_const_info *const_table, |
| 5566 | swig_type_info **types, |
| 5567 | swig_type_info **types_initial) { |
| 5568 | size_t i; |
| 5569 | for (i = 0; methods[i].ml_name; ++i) { |
| 5570 | const char *c = methods[i].ml_doc; |
| 5571 | if (c && (c = strstr(c, "swig_ptr: "))) { |
| 5572 | int j; |
| 5573 | swig_const_info *ci = 0; |
| 5574 | const char *name = c + 10; |
| 5575 | for (j = 0; const_table[j].type; ++j) { |
| 5576 | if (strncmp(const_table[j].name, name, |
| 5577 | strlen(const_table[j].name)) == 0) { |
| 5578 | ci = &(const_table[j]); |
| 5579 | break; |
| 5580 | } |
| 5581 | } |
| 5582 | if (ci) { |
| 5583 | void *ptr = (ci->type == SWIG_PY_POINTER) ? ci->pvalue : 0; |
| 5584 | if (ptr) { |
| 5585 | size_t shift = (ci->ptype) - types; |
| 5586 | swig_type_info *ty = types_initial[shift]; |
| 5587 | size_t ldoc = (c - methods[i].ml_doc); |
| 5588 | size_t lptr = strlen(ty->name)+2*sizeof(void*)+2; |
| 5589 | char *ndoc = (char*)malloc(ldoc + lptr + 10); |
| 5590 | if (ndoc) { |
| 5591 | char *buff = ndoc; |
| 5592 | strncpy(buff, methods[i].ml_doc, ldoc); |
| 5593 | buff += ldoc; |
| 5594 | strncpy(buff, "swig_ptr: ", 10); |
| 5595 | buff += 10; |
| 5596 | SWIG_PackVoidPtr(buff, ptr, ty->name, lptr); |
| 5597 | methods[i].ml_doc = ndoc; |
| 5598 | } |
| 5599 | } |
| 5600 | } |
| 5601 | } |
| 5602 | } |
| 5603 | } |
| 5604 | |
| 5605 | #ifdef __cplusplus |
| 5606 | } |
| 5607 | #endif |
| 5608 | |
| 5609 | /* -----------------------------------------------------------------------------* |
| 5610 | * Partial Init method |
| 5611 | * -----------------------------------------------------------------------------*/ |
| 5612 | |
| 5613 | #ifdef __cplusplus |
| 5614 | extern "C" |
| 5615 | #endif |
| 5616 | |
| 5617 | SWIGEXPORT |
| 5618 | #if PY_VERSION_HEX >= 0x03000000 |
| 5619 | PyObject* |
| 5620 | #else |
| 5621 | void |
| 5622 | #endif |
| 5623 | SWIG_init(void) { |
| 5624 | PyObject *m, *d, *md; |
| 5625 | #if PY_VERSION_HEX >= 0x03000000 |
| 5626 | static struct PyModuleDef SWIG_module = { |
| 5627 | # if PY_VERSION_HEX >= 0x03020000 |
| 5628 | PyModuleDef_HEAD_INIT, |
| 5629 | # else |
| 5630 | { |
| 5631 | PyObject_HEAD_INIT(NULL) |
| 5632 | NULL, /* m_init */ |
| 5633 | 0, /* m_index */ |
| 5634 | NULL, /* m_copy */ |
| 5635 | }, |
| 5636 | # endif |
| 5637 | (char *) SWIG_name, |
| 5638 | NULL, |
| 5639 | -1, |
| 5640 | SwigMethods, |
| 5641 | NULL, |
| 5642 | NULL, |
| 5643 | NULL, |
| 5644 | NULL |
| 5645 | }; |
| 5646 | #endif |
| 5647 | |
| 5648 | #if defined(SWIGPYTHON_BUILTIN) |
| 5649 | static SwigPyClientData SwigPyObject_clientdata = { |
| 5650 | 0, 0, 0, 0, 0, 0, 0 |
| 5651 | }; |
| 5652 | static PyGetSetDef this_getset_def = { |
| 5653 | (char *)"this", &SwigPyBuiltin_ThisClosure, NULL, NULL, NULL |
| 5654 | }; |
| 5655 | static SwigPyGetSet thisown_getset_closure = { |
| 5656 | (PyCFunction) SwigPyObject_own, |
| 5657 | (PyCFunction) SwigPyObject_own |
| 5658 | }; |
| 5659 | static PyGetSetDef thisown_getset_def = { |
| 5660 | (char *)"thisown", SwigPyBuiltin_GetterClosure, SwigPyBuiltin_SetterClosure, NULL, &thisown_getset_closure |
| 5661 | }; |
| 5662 | PyObject *metatype_args; |
| 5663 | PyTypeObject *builtin_pytype; |
| 5664 | int builtin_base_count; |
| 5665 | swig_type_info *builtin_basetype; |
| 5666 | PyObject *tuple; |
| 5667 | PyGetSetDescrObject *static_getset; |
| 5668 | PyTypeObject *metatype; |
| 5669 | SwigPyClientData *cd; |
| 5670 | PyObject *public_interface, *public_symbol; |
| 5671 | PyObject *this_descr; |
| 5672 | PyObject *thisown_descr; |
| 5673 | int i; |
| 5674 | |
| 5675 | (void)builtin_pytype; |
| 5676 | (void)builtin_base_count; |
| 5677 | (void)builtin_basetype; |
| 5678 | (void)tuple; |
| 5679 | (void)static_getset; |
| 5680 | |
| 5681 | /* metatype is used to implement static member variables. */ |
| 5682 | metatype_args = Py_BuildValue("(s(O){})", "SwigPyObjectType", &PyType_Type); |
| 5683 | assert(metatype_args); |
| 5684 | metatype = (PyTypeObject *) PyType_Type.tp_call((PyObject *) &PyType_Type, metatype_args, NULL); |
| 5685 | assert(metatype); |
| 5686 | Py_DECREF(metatype_args); |
| 5687 | metatype->tp_setattro = (setattrofunc) &SwigPyObjectType_setattro; |
| 5688 | assert(PyType_Ready(metatype) >= 0); |
| 5689 | #endif |
| 5690 | |
| 5691 | /* Fix SwigMethods to carry the callback ptrs when needed */ |
| 5692 | SWIG_Python_FixMethods(SwigMethods, swig_const_table, swig_types, swig_type_initial); |
| 5693 | |
| 5694 | #if PY_VERSION_HEX >= 0x03000000 |
| 5695 | m = PyModule_Create(&SWIG_module); |
| 5696 | #else |
| 5697 | m = Py_InitModule((char *) SWIG_name, SwigMethods); |
| 5698 | #endif |
| 5699 | md = d = PyModule_GetDict(m); |
| 5700 | |
| 5701 | SWIG_InitializeModule(0); |
| 5702 | |
| 5703 | #ifdef SWIGPYTHON_BUILTIN |
| 5704 | SwigPyObject_stype = SWIG_MangledTypeQuery("_p_SwigPyObject"); |
| 5705 | assert(SwigPyObject_stype); |
| 5706 | cd = (SwigPyClientData*) SwigPyObject_stype->clientdata; |
| 5707 | if (!cd) { |
| 5708 | SwigPyObject_stype->clientdata = &SwigPyObject_clientdata; |
| 5709 | SwigPyObject_clientdata.pytype = SwigPyObject_TypeOnce(); |
| 5710 | } else if (SwigPyObject_TypeOnce()->tp_basicsize != cd->pytype->tp_basicsize) { |
| 5711 | PyErr_SetString(PyExc_RuntimeError, "Import error: attempted to load two incompatible swig-generated modules."); |
| 5712 | # if PY_VERSION_HEX >= 0x03000000 |
| 5713 | return NULL; |
| 5714 | # else |
| 5715 | return; |
| 5716 | # endif |
| 5717 | } |
| 5718 | |
| 5719 | /* All objects have a 'this' attribute */ |
| 5720 | this_descr = PyDescr_NewGetSet(SwigPyObject_type(), &this_getset_def); |
| 5721 | (void)this_descr; |
| 5722 | |
| 5723 | /* All objects have a 'thisown' attribute */ |
| 5724 | thisown_descr = PyDescr_NewGetSet(SwigPyObject_type(), &thisown_getset_def); |
| 5725 | (void)thisown_descr; |
| 5726 | |
| 5727 | public_interface = PyList_New(0); |
| 5728 | public_symbol = 0; |
| 5729 | (void)public_symbol; |
| 5730 | |
| 5731 | PyDict_SetItemString(md, "__all__", public_interface); |
| 5732 | Py_DECREF(public_interface); |
| 5733 | for (i = 0; SwigMethods[i].ml_name != NULL; ++i) |
| 5734 | SwigPyBuiltin_AddPublicSymbol(public_interface, SwigMethods[i].ml_name); |
| 5735 | for (i = 0; swig_const_table[i].name != 0; ++i) |
| 5736 | SwigPyBuiltin_AddPublicSymbol(public_interface, swig_const_table[i].name); |
| 5737 | #endif |
| 5738 | |
| 5739 | SWIG_InstallConstants(d,swig_const_table); |
| 5740 | |
| 5741 | PyDict_SetItemString(md,(char*)"cvar", SWIG_globals()); |
| 5742 | SWIG_addvarlink(SWIG_globals(),(char*)"waitForInterrupt",Swig_var_waitForInterrupt_get, Swig_var_waitForInterrupt_set); |
| 5743 | #if PY_VERSION_HEX >= 0x03000000 |
| 5744 | return m; |
| 5745 | #else |
| 5746 | return; |
| 5747 | #endif |
| 5748 | } |
| 5749 | |