| 1 | /* ---------------------------------------------------------------------------- |
|---|
| 2 | * This file was automatically generated by SWIG (http://www.swig.org). |
|---|
| 3 | * Version 1.3.21 |
|---|
| 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 | |
|---|
| 13 | #ifdef __cplusplus |
|---|
| 14 | template<class T> class SwigValueWrapper { |
|---|
| 15 | T *tt; |
|---|
| 16 | public: |
|---|
| 17 | SwigValueWrapper() : tt(0) { } |
|---|
| 18 | SwigValueWrapper(const SwigValueWrapper<T>& rhs) : tt(new T(*rhs.tt)) { } |
|---|
| 19 | SwigValueWrapper(const T& t) : tt(new T(t)) { } |
|---|
| 20 | ~SwigValueWrapper() { delete tt; } |
|---|
| 21 | SwigValueWrapper& operator=(const T& t) { delete tt; tt = new T(t); return *this; } |
|---|
| 22 | operator T&() const { return *tt; } |
|---|
| 23 | T *operator&() { return tt; } |
|---|
| 24 | private: |
|---|
| 25 | SwigValueWrapper& operator=(const SwigValueWrapper<T>& rhs); |
|---|
| 26 | }; |
|---|
| 27 | #endif |
|---|
| 28 | |
|---|
| 29 | |
|---|
| 30 | #include "Python.h" |
|---|
| 31 | |
|---|
| 32 | /*************************************************************** -*- c -*- |
|---|
| 33 | * python/precommon.swg |
|---|
| 34 | * |
|---|
| 35 | * Rename all exported symbols from common.swg, to avoid symbol |
|---|
| 36 | * clashes if multiple interpreters are included |
|---|
| 37 | * |
|---|
| 38 | ************************************************************************/ |
|---|
| 39 | |
|---|
| 40 | #define SWIG_TypeRegister SWIG_Python_TypeRegister |
|---|
| 41 | #define SWIG_TypeCheck SWIG_Python_TypeCheck |
|---|
| 42 | #define SWIG_TypeCast SWIG_Python_TypeCast |
|---|
| 43 | #define SWIG_TypeDynamicCast SWIG_Python_TypeDynamicCast |
|---|
| 44 | #define SWIG_TypeName SWIG_Python_TypeName |
|---|
| 45 | #define SWIG_TypeQuery SWIG_Python_TypeQuery |
|---|
| 46 | #define SWIG_TypeClientData SWIG_Python_TypeClientData |
|---|
| 47 | #define SWIG_PackData SWIG_Python_PackData |
|---|
| 48 | #define SWIG_UnpackData SWIG_Python_UnpackData |
|---|
| 49 | |
|---|
| 50 | |
|---|
| 51 | /*********************************************************************** |
|---|
| 52 | * common.swg |
|---|
| 53 | * |
|---|
| 54 | * This file contains generic SWIG runtime support for pointer |
|---|
| 55 | * type checking as well as a few commonly used macros to control |
|---|
| 56 | * external linkage. |
|---|
| 57 | * |
|---|
| 58 | * Author : David Beazley (beazley@cs.uchicago.edu) |
|---|
| 59 | * |
|---|
| 60 | * Copyright (c) 1999-2000, The University of Chicago |
|---|
| 61 | * |
|---|
| 62 | * This file may be freely redistributed without license or fee provided |
|---|
| 63 | * this copyright message remains intact. |
|---|
| 64 | ************************************************************************/ |
|---|
| 65 | |
|---|
| 66 | #include <string.h> |
|---|
| 67 | |
|---|
| 68 | #if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__) |
|---|
| 69 | # if defined(_MSC_VER) || defined(__GNUC__) |
|---|
| 70 | # if defined(STATIC_LINKED) |
|---|
| 71 | # define SWIGEXPORT(a) a |
|---|
| 72 | # define SWIGIMPORT(a) extern a |
|---|
| 73 | # else |
|---|
| 74 | # define SWIGEXPORT(a) __declspec(dllexport) a |
|---|
| 75 | # define SWIGIMPORT(a) extern a |
|---|
| 76 | # endif |
|---|
| 77 | # else |
|---|
| 78 | # if defined(__BORLANDC__) |
|---|
| 79 | # define SWIGEXPORT(a) a _export |
|---|
| 80 | # define SWIGIMPORT(a) a _export |
|---|
| 81 | # else |
|---|
| 82 | # define SWIGEXPORT(a) a |
|---|
| 83 | # define SWIGIMPORT(a) a |
|---|
| 84 | # endif |
|---|
| 85 | # endif |
|---|
| 86 | #else |
|---|
| 87 | # define SWIGEXPORT(a) a |
|---|
| 88 | # define SWIGIMPORT(a) a |
|---|
| 89 | #endif |
|---|
| 90 | |
|---|
| 91 | #ifdef SWIG_GLOBAL |
|---|
| 92 | # define SWIGRUNTIME(a) SWIGEXPORT(a) |
|---|
| 93 | #else |
|---|
| 94 | # define SWIGRUNTIME(a) static a |
|---|
| 95 | #endif |
|---|
| 96 | |
|---|
| 97 | #ifdef __cplusplus |
|---|
| 98 | extern "C" { |
|---|
| 99 | #endif |
|---|
| 100 | |
|---|
| 101 | typedef void *(*swig_converter_func)(void *); |
|---|
| 102 | typedef struct swig_type_info *(*swig_dycast_func)(void **); |
|---|
| 103 | |
|---|
| 104 | typedef struct swig_type_info { |
|---|
| 105 | const char *name; |
|---|
| 106 | swig_converter_func converter; |
|---|
| 107 | const char *str; |
|---|
| 108 | void *clientdata; |
|---|
| 109 | swig_dycast_func dcast; |
|---|
| 110 | struct swig_type_info *next; |
|---|
| 111 | struct swig_type_info *prev; |
|---|
| 112 | } swig_type_info; |
|---|
| 113 | |
|---|
| 114 | #ifdef SWIG_NOINCLUDE |
|---|
| 115 | |
|---|
| 116 | SWIGIMPORT(swig_type_info *) SWIG_TypeRegister(swig_type_info *); |
|---|
| 117 | SWIGIMPORT(swig_type_info *) SWIG_TypeCheck(char *c, swig_type_info *); |
|---|
| 118 | SWIGIMPORT(void *) SWIG_TypeCast(swig_type_info *, void *); |
|---|
| 119 | SWIGIMPORT(swig_type_info *) SWIG_TypeDynamicCast(swig_type_info *, void **); |
|---|
| 120 | SWIGIMPORT(const char *) SWIG_TypeName(const swig_type_info *); |
|---|
| 121 | SWIGIMPORT(swig_type_info *) SWIG_TypeQuery(const char *); |
|---|
| 122 | SWIGIMPORT(void) SWIG_TypeClientData(swig_type_info *, void *); |
|---|
| 123 | SWIGIMPORT(char *) SWIG_PackData(char *, void *, int); |
|---|
| 124 | SWIGIMPORT(char *) SWIG_UnpackData(char *, void *, int); |
|---|
| 125 | |
|---|
| 126 | #else |
|---|
| 127 | |
|---|
| 128 | static swig_type_info *swig_type_list = 0; |
|---|
| 129 | |
|---|
| 130 | /* Register a type mapping with the type-checking */ |
|---|
| 131 | SWIGRUNTIME(swig_type_info *) |
|---|
| 132 | SWIG_TypeRegister(swig_type_info *ti) { |
|---|
| 133 | swig_type_info *tc, *head, *ret, *next; |
|---|
| 134 | /* Check to see if this type has already been registered */ |
|---|
| 135 | tc = swig_type_list; |
|---|
| 136 | while (tc) { |
|---|
| 137 | if (strcmp(tc->name, ti->name) == 0) { |
|---|
| 138 | /* Already exists in the table. Just add additional types to the list */ |
|---|
| 139 | if (tc->clientdata) ti->clientdata = tc->clientdata; |
|---|
| 140 | head = tc; |
|---|
| 141 | next = tc->next; |
|---|
| 142 | goto l1; |
|---|
| 143 | } |
|---|
| 144 | tc = tc->prev; |
|---|
| 145 | } |
|---|
| 146 | head = ti; |
|---|
| 147 | next = 0; |
|---|
| 148 | |
|---|
| 149 | /* Place in list */ |
|---|
| 150 | ti->prev = swig_type_list; |
|---|
| 151 | swig_type_list = ti; |
|---|
| 152 | |
|---|
| 153 | /* Build linked lists */ |
|---|
| 154 | l1: |
|---|
| 155 | ret = head; |
|---|
| 156 | tc = ti + 1; |
|---|
| 157 | /* Patch up the rest of the links */ |
|---|
| 158 | while (tc->name) { |
|---|
| 159 | head->next = tc; |
|---|
| 160 | tc->prev = head; |
|---|
| 161 | head = tc; |
|---|
| 162 | tc++; |
|---|
| 163 | } |
|---|
| 164 | if (next) next->prev = head; |
|---|
| 165 | head->next = next; |
|---|
| 166 | return ret; |
|---|
| 167 | } |
|---|
| 168 | |
|---|
| 169 | /* Check the typename */ |
|---|
| 170 | SWIGRUNTIME(swig_type_info *) |
|---|
| 171 | SWIG_TypeCheck(char *c, swig_type_info *ty) { |
|---|
| 172 | swig_type_info *s; |
|---|
| 173 | if (!ty) return 0; /* Void pointer */ |
|---|
| 174 | s = ty->next; /* First element always just a name */ |
|---|
| 175 | do { |
|---|
| 176 | if (strcmp(s->name,c) == 0) { |
|---|
| 177 | if (s == ty->next) return s; |
|---|
| 178 | /* Move s to the top of the linked list */ |
|---|
| 179 | s->prev->next = s->next; |
|---|
| 180 | if (s->next) { |
|---|
| 181 | s->next->prev = s->prev; |
|---|
| 182 | } |
|---|
| 183 | /* Insert s as second element in the list */ |
|---|
| 184 | s->next = ty->next; |
|---|
| 185 | if (ty->next) ty->next->prev = s; |
|---|
| 186 | ty->next = s; |
|---|
| 187 | s->prev = ty; |
|---|
| 188 | return s; |
|---|
| 189 | } |
|---|
| 190 | s = s->next; |
|---|
| 191 | } while (s && (s != ty->next)); |
|---|
| 192 | return 0; |
|---|
| 193 | } |
|---|
| 194 | |
|---|
| 195 | /* Cast a pointer up an inheritance hierarchy */ |
|---|
| 196 | SWIGRUNTIME(void *) |
|---|
| 197 | SWIG_TypeCast(swig_type_info *ty, void *ptr) { |
|---|
| 198 | if ((!ty) || (!ty->converter)) return ptr; |
|---|
| 199 | return (*ty->converter)(ptr); |
|---|
| 200 | } |
|---|
| 201 | |
|---|
| 202 | /* Dynamic pointer casting. Down an inheritance hierarchy */ |
|---|
| 203 | SWIGRUNTIME(swig_type_info *) |
|---|
| 204 | SWIG_TypeDynamicCast(swig_type_info *ty, void **ptr) { |
|---|
| 205 | swig_type_info *lastty = ty; |
|---|
| 206 | if (!ty || !ty->dcast) return ty; |
|---|
| 207 | while (ty && (ty->dcast)) { |
|---|
| 208 | ty = (*ty->dcast)(ptr); |
|---|
| 209 | if (ty) lastty = ty; |
|---|
| 210 | } |
|---|
| 211 | return lastty; |
|---|
| 212 | } |
|---|
| 213 | |
|---|
| 214 | /* Return the name associated with this type */ |
|---|
| 215 | SWIGRUNTIME(const char *) |
|---|
| 216 | SWIG_TypeName(const swig_type_info *ty) { |
|---|
| 217 | return ty->name; |
|---|
| 218 | } |
|---|
| 219 | |
|---|
| 220 | /* Search for a swig_type_info structure */ |
|---|
| 221 | SWIGRUNTIME(swig_type_info *) |
|---|
| 222 | SWIG_TypeQuery(const char *name) { |
|---|
| 223 | swig_type_info *ty = swig_type_list; |
|---|
| 224 | while (ty) { |
|---|
| 225 | if (ty->str && (strcmp(name,ty->str) == 0)) return ty; |
|---|
| 226 | if (ty->name && (strcmp(name,ty->name) == 0)) return ty; |
|---|
| 227 | ty = ty->prev; |
|---|
| 228 | } |
|---|
| 229 | return 0; |
|---|
| 230 | } |
|---|
| 231 | |
|---|
| 232 | /* Set the clientdata field for a type */ |
|---|
| 233 | SWIGRUNTIME(void) |
|---|
| 234 | SWIG_TypeClientData(swig_type_info *ti, void *clientdata) { |
|---|
| 235 | swig_type_info *tc, *equiv; |
|---|
| 236 | if (ti->clientdata == clientdata) return; |
|---|
| 237 | ti->clientdata = clientdata; |
|---|
| 238 | equiv = ti->next; |
|---|
| 239 | while (equiv) { |
|---|
| 240 | if (!equiv->converter) { |
|---|
| 241 | tc = swig_type_list; |
|---|
| 242 | while (tc) { |
|---|
| 243 | if ((strcmp(tc->name, equiv->name) == 0)) |
|---|
| 244 | SWIG_TypeClientData(tc,clientdata); |
|---|
| 245 | tc = tc->prev; |
|---|
| 246 | } |
|---|
| 247 | } |
|---|
| 248 | equiv = equiv->next; |
|---|
| 249 | } |
|---|
| 250 | } |
|---|
| 251 | |
|---|
| 252 | /* Pack binary data into a string */ |
|---|
| 253 | SWIGRUNTIME(char *) |
|---|
| 254 | SWIG_PackData(char *c, void *ptr, int sz) { |
|---|
| 255 | static char hex[17] = "0123456789abcdef"; |
|---|
| 256 | int i; |
|---|
| 257 | unsigned char *u = (unsigned char *) ptr; |
|---|
| 258 | register unsigned char uu; |
|---|
| 259 | for (i = 0; i < sz; i++,u++) { |
|---|
| 260 | uu = *u; |
|---|
| 261 | *(c++) = hex[(uu & 0xf0) >> 4]; |
|---|
| 262 | *(c++) = hex[uu & 0xf]; |
|---|
| 263 | } |
|---|
| 264 | return c; |
|---|
| 265 | } |
|---|
| 266 | |
|---|
| 267 | /* Unpack binary data from a string */ |
|---|
| 268 | SWIGRUNTIME(char *) |
|---|
| 269 | SWIG_UnpackData(char *c, void *ptr, int sz) { |
|---|
| 270 | register unsigned char uu = 0; |
|---|
| 271 | register int d; |
|---|
| 272 | unsigned char *u = (unsigned char *) ptr; |
|---|
| 273 | int i; |
|---|
| 274 | for (i = 0; i < sz; i++, u++) { |
|---|
| 275 | d = *(c++); |
|---|
| 276 | if ((d >= '0') && (d <= '9')) |
|---|
| 277 | uu = ((d - '0') << 4); |
|---|
| 278 | else if ((d >= 'a') && (d <= 'f')) |
|---|
| 279 | uu = ((d - ('a'-10)) << 4); |
|---|
| 280 | d = *(c++); |
|---|
| 281 | if ((d >= '0') && (d <= '9')) |
|---|
| 282 | uu |= (d - '0'); |
|---|
| 283 | else if ((d >= 'a') && (d <= 'f')) |
|---|
| 284 | uu |= (d - ('a'-10)); |
|---|
| 285 | *u = uu; |
|---|
| 286 | } |
|---|
| 287 | return c; |
|---|
| 288 | } |
|---|
| 289 | |
|---|
| 290 | #endif |
|---|
| 291 | |
|---|
| 292 | #ifdef __cplusplus |
|---|
| 293 | } |
|---|
| 294 | #endif |
|---|
| 295 | |
|---|
| 296 | /*********************************************************************** |
|---|
| 297 | * python.swg |
|---|
| 298 | * |
|---|
| 299 | * This file contains the runtime support for Python modules |
|---|
| 300 | * and includes code for managing global variables and pointer |
|---|
| 301 | * type checking. |
|---|
| 302 | * |
|---|
| 303 | * Author : David Beazley (beazley@cs.uchicago.edu) |
|---|
| 304 | ************************************************************************/ |
|---|
| 305 | |
|---|
| 306 | #include "Python.h" |
|---|
| 307 | |
|---|
| 308 | #ifdef __cplusplus |
|---|
| 309 | extern "C" { |
|---|
| 310 | #endif |
|---|
| 311 | |
|---|
| 312 | #define SWIG_PY_INT 1 |
|---|
| 313 | #define SWIG_PY_FLOAT 2 |
|---|
| 314 | #define SWIG_PY_STRING 3 |
|---|
| 315 | #define SWIG_PY_POINTER 4 |
|---|
| 316 | #define SWIG_PY_BINARY 5 |
|---|
| 317 | |
|---|
| 318 | /* Flags for pointer conversion */ |
|---|
| 319 | |
|---|
| 320 | #define SWIG_POINTER_EXCEPTION 0x1 |
|---|
| 321 | #define SWIG_POINTER_DISOWN 0x2 |
|---|
| 322 | |
|---|
| 323 | /* Exception handling in wrappers */ |
|---|
| 324 | #define SWIG_fail goto fail |
|---|
| 325 | |
|---|
| 326 | /* Constant information structure */ |
|---|
| 327 | typedef struct swig_const_info { |
|---|
| 328 | int type; |
|---|
| 329 | char *name; |
|---|
| 330 | long lvalue; |
|---|
| 331 | double dvalue; |
|---|
| 332 | void *pvalue; |
|---|
| 333 | swig_type_info **ptype; |
|---|
| 334 | } swig_const_info; |
|---|
| 335 | |
|---|
| 336 | /* Common SWIG API */ |
|---|
| 337 | #define SWIG_ConvertPtr(obj, pp, type, flags) \ |
|---|
| 338 | SWIG_Python_ConvertPtr(obj, pp, type, flags) |
|---|
| 339 | #define SWIG_NewPointerObj(p, type, flags) \ |
|---|
| 340 | SWIG_Python_NewPointerObj(p, type, flags) |
|---|
| 341 | #define SWIG_MustGetPtr(p, type, argnum, flags) \ |
|---|
| 342 | SWIG_Python_MustGetPtr(p, type, argnum, flags) |
|---|
| 343 | |
|---|
| 344 | /* Python-specific SWIG API */ |
|---|
| 345 | #define SWIG_newvarlink() \ |
|---|
| 346 | SWIG_Python_newvarlink() |
|---|
| 347 | #define SWIG_addvarlink(p, name, get_attr, set_attr) \ |
|---|
| 348 | SWIG_Python_addvarlink(p, name, get_attr, set_attr) |
|---|
| 349 | #define SWIG_ConvertPacked(obj, ptr, sz, ty, flags) \ |
|---|
| 350 | SWIG_Python_ConvertPacked(obj, ptr, sz, ty, flags) |
|---|
| 351 | #define SWIG_NewPackedObj(ptr, sz, type) \ |
|---|
| 352 | SWIG_Python_NewPackedObj(ptr, sz, type) |
|---|
| 353 | #define SWIG_InstallConstants(d, constants) \ |
|---|
| 354 | SWIG_Python_InstallConstants(d, constants) |
|---|
| 355 | |
|---|
| 356 | #ifdef SWIG_NOINCLUDE |
|---|
| 357 | |
|---|
| 358 | SWIGIMPORT(int) SWIG_Python_ConvertPtr(PyObject *, void **, swig_type_info *, int); |
|---|
| 359 | SWIGIMPORT(PyObject *) SWIG_Python_NewPointerObj(void *, swig_type_info *,int own); |
|---|
| 360 | SWIGIMPORT(void *) SWIG_Python_MustGetPtr(PyObject *, swig_type_info *, int, int); |
|---|
| 361 | SWIGIMPORT(PyObject *) SWIG_Python_newvarlink(void); |
|---|
| 362 | SWIGIMPORT(void) SWIG_Python_addvarlink(PyObject *, char *, PyObject *(*)(void), int (*)(PyObject *)); |
|---|
| 363 | SWIGIMPORT(int) SWIG_Python_ConvertPacked(PyObject *, void *, int sz, swig_type_info *, int); |
|---|
| 364 | SWIGIMPORT(PyObject *) SWIG_Python_NewPackedObj(void *, int sz, swig_type_info *); |
|---|
| 365 | SWIGIMPORT(void) SWIG_Python_InstallConstants(PyObject *d, swig_const_info constants[]); |
|---|
| 366 | |
|---|
| 367 | #else |
|---|
| 368 | |
|---|
| 369 | /* ----------------------------------------------------------------------------- |
|---|
| 370 | * global variable support code. |
|---|
| 371 | * ----------------------------------------------------------------------------- */ |
|---|
| 372 | |
|---|
| 373 | typedef struct swig_globalvar { |
|---|
| 374 | char *name; /* Name of global variable */ |
|---|
| 375 | PyObject *(*get_attr)(void); /* Return the current value */ |
|---|
| 376 | int (*set_attr)(PyObject *); /* Set the value */ |
|---|
| 377 | struct swig_globalvar *next; |
|---|
| 378 | } swig_globalvar; |
|---|
| 379 | |
|---|
| 380 | typedef struct swig_varlinkobject { |
|---|
| 381 | PyObject_HEAD |
|---|
| 382 | swig_globalvar *vars; |
|---|
| 383 | } swig_varlinkobject; |
|---|
| 384 | |
|---|
| 385 | static PyObject * |
|---|
| 386 | swig_varlink_repr(swig_varlinkobject *v) { |
|---|
| 387 | v = v; |
|---|
| 388 | return PyString_FromString("<Global variables>"); |
|---|
| 389 | } |
|---|
| 390 | |
|---|
| 391 | static int |
|---|
| 392 | swig_varlink_print(swig_varlinkobject *v, FILE *fp, int flags) { |
|---|
| 393 | swig_globalvar *var; |
|---|
| 394 | flags = flags; |
|---|
| 395 | fprintf(fp,"Global variables { "); |
|---|
| 396 | for (var = v->vars; var; var=var->next) { |
|---|
| 397 | fprintf(fp,"%s", var->name); |
|---|
| 398 | if (var->next) fprintf(fp,", "); |
|---|
| 399 | } |
|---|
| 400 | fprintf(fp," }\n"); |
|---|
| 401 | return 0; |
|---|
| 402 | } |
|---|
| 403 | |
|---|
| 404 | static PyObject * |
|---|
| 405 | swig_varlink_getattr(swig_varlinkobject *v, char *n) { |
|---|
| 406 | swig_globalvar *var = v->vars; |
|---|
| 407 | while (var) { |
|---|
| 408 | if (strcmp(var->name,n) == 0) { |
|---|
| 409 | return (*var->get_attr)(); |
|---|
| 410 | } |
|---|
| 411 | var = var->next; |
|---|
| 412 | } |
|---|
| 413 | PyErr_SetString(PyExc_NameError,"Unknown C global variable"); |
|---|
| 414 | return NULL; |
|---|
| 415 | } |
|---|
| 416 | |
|---|
| 417 | static int |
|---|
| 418 | swig_varlink_setattr(swig_varlinkobject *v, char *n, PyObject *p) { |
|---|
| 419 | swig_globalvar *var = v->vars; |
|---|
| 420 | while (var) { |
|---|
| 421 | if (strcmp(var->name,n) == 0) { |
|---|
| 422 | return (*var->set_attr)(p); |
|---|
| 423 | } |
|---|
| 424 | var = var->next; |
|---|
| 425 | } |
|---|
| 426 | PyErr_SetString(PyExc_NameError,"Unknown C global variable"); |
|---|
| 427 | return 1; |
|---|
| 428 | } |
|---|
| 429 | |
|---|
| 430 | statichere PyTypeObject varlinktype = { |
|---|
| 431 | PyObject_HEAD_INIT(0) |
|---|
| 432 | 0, |
|---|
| 433 | (char *)"swigvarlink", /* Type name */ |
|---|
| 434 | sizeof(swig_varlinkobject), /* Basic size */ |
|---|
| 435 | 0, /* Itemsize */ |
|---|
| 436 | 0, /* Deallocator */ |
|---|
| 437 | (printfunc) swig_varlink_print, /* Print */ |
|---|
| 438 | (getattrfunc) swig_varlink_getattr, /* get attr */ |
|---|
| 439 | (setattrfunc) swig_varlink_setattr, /* Set attr */ |
|---|
| 440 | 0, /* tp_compare */ |
|---|
| 441 | (reprfunc) swig_varlink_repr, /* tp_repr */ |
|---|
| 442 | 0, /* tp_as_number */ |
|---|
| 443 | 0, /* tp_as_mapping*/ |
|---|
| 444 | 0, /* tp_hash */ |
|---|
| 445 | }; |
|---|
| 446 | |
|---|
| 447 | /* Create a variable linking object for use later */ |
|---|
| 448 | SWIGRUNTIME(PyObject *) |
|---|
| 449 | SWIG_Python_newvarlink(void) { |
|---|
| 450 | swig_varlinkobject *result = 0; |
|---|
| 451 | result = PyMem_NEW(swig_varlinkobject,1); |
|---|
| 452 | varlinktype.ob_type = &PyType_Type; /* Patch varlinktype into a PyType */ |
|---|
| 453 | result->ob_type = &varlinktype; |
|---|
| 454 | result->vars = 0; |
|---|
| 455 | result->ob_refcnt = 0; |
|---|
| 456 | Py_XINCREF((PyObject *) result); |
|---|
| 457 | return ((PyObject*) result); |
|---|
| 458 | } |
|---|
| 459 | |
|---|
| 460 | SWIGRUNTIME(void) |
|---|
| 461 | SWIG_Python_addvarlink(PyObject *p, char *name, PyObject *(*get_attr)(void), int (*set_attr)(PyObject *p)) { |
|---|
| 462 | swig_varlinkobject *v; |
|---|
| 463 | swig_globalvar *gv; |
|---|
| 464 | v= (swig_varlinkobject *) p; |
|---|
| 465 | gv = (swig_globalvar *) malloc(sizeof(swig_globalvar)); |
|---|
| 466 | gv->name = (char *) malloc(strlen(name)+1); |
|---|
| 467 | strcpy(gv->name,name); |
|---|
| 468 | gv->get_attr = get_attr; |
|---|
| 469 | gv->set_attr = set_attr; |
|---|
| 470 | gv->next = v->vars; |
|---|
| 471 | v->vars = gv; |
|---|
| 472 | } |
|---|
| 473 | |
|---|
| 474 | /* Convert a pointer value */ |
|---|
| 475 | SWIGRUNTIME(int) |
|---|
| 476 | SWIG_Python_ConvertPtr(PyObject *obj, void **ptr, swig_type_info *ty, int flags) { |
|---|
| 477 | swig_type_info *tc; |
|---|
| 478 | char *c = 0; |
|---|
| 479 | static PyObject *SWIG_this = 0; |
|---|
| 480 | int newref = 0; |
|---|
| 481 | PyObject *pyobj = 0; |
|---|
| 482 | |
|---|
| 483 | if (!obj) return 0; |
|---|
| 484 | if (obj == Py_None) { |
|---|
| 485 | *ptr = 0; |
|---|
| 486 | return 0; |
|---|
| 487 | } |
|---|
| 488 | #ifdef SWIG_COBJECT_TYPES |
|---|
| 489 | if (!(PyCObject_Check(obj))) { |
|---|
| 490 | if (!SWIG_this) |
|---|
| 491 | SWIG_this = PyString_FromString("this"); |
|---|
| 492 | pyobj = obj; |
|---|
| 493 | obj = PyObject_GetAttr(obj,SWIG_this); |
|---|
| 494 | newref = 1; |
|---|
| 495 | if (!obj) goto type_error; |
|---|
| 496 | if (!PyCObject_Check(obj)) { |
|---|
| 497 | Py_DECREF(obj); |
|---|
| 498 | goto type_error; |
|---|
| 499 | } |
|---|
| 500 | } |
|---|
| 501 | *ptr = PyCObject_AsVoidPtr(obj); |
|---|
| 502 | c = (char *) PyCObject_GetDesc(obj); |
|---|
| 503 | if (newref) Py_DECREF(obj); |
|---|
| 504 | goto cobject; |
|---|
| 505 | #else |
|---|
| 506 | if (!(PyString_Check(obj))) { |
|---|
| 507 | if (!SWIG_this) |
|---|
| 508 | SWIG_this = PyString_FromString("this"); |
|---|
| 509 | pyobj = obj; |
|---|
| 510 | obj = PyObject_GetAttr(obj,SWIG_this); |
|---|
| 511 | newref = 1; |
|---|
| 512 | if (!obj) goto type_error; |
|---|
| 513 | if (!PyString_Check(obj)) { |
|---|
| 514 | Py_DECREF(obj); |
|---|
| 515 | goto type_error; |
|---|
| 516 | } |
|---|
| 517 | } |
|---|
| 518 | c = PyString_AsString(obj); |
|---|
| 519 | /* Pointer values must start with leading underscore */ |
|---|
| 520 | if (*c != '_') { |
|---|
| 521 | *ptr = (void *) 0; |
|---|
| 522 | if (strcmp(c,"NULL") == 0) { |
|---|
| 523 | if (newref) { Py_DECREF(obj); } |
|---|
| 524 | return 0; |
|---|
| 525 | } else { |
|---|
| 526 | if (newref) { Py_DECREF(obj); } |
|---|
| 527 | goto type_error; |
|---|
| 528 | } |
|---|
| 529 | } |
|---|
| 530 | c++; |
|---|
| 531 | c = SWIG_UnpackData(c,ptr,sizeof(void *)); |
|---|
| 532 | if (newref) { Py_DECREF(obj); } |
|---|
| 533 | #endif |
|---|
| 534 | |
|---|
| 535 | #ifdef SWIG_COBJECT_TYPES |
|---|
| 536 | cobject: |
|---|
| 537 | #endif |
|---|
| 538 | |
|---|
| 539 | if (ty) { |
|---|
| 540 | tc = SWIG_TypeCheck(c,ty); |
|---|
| 541 | if (!tc) goto type_error; |
|---|
| 542 | *ptr = SWIG_TypeCast(tc,(void*) *ptr); |
|---|
| 543 | } |
|---|
| 544 | |
|---|
| 545 | if ((pyobj) && (flags & SWIG_POINTER_DISOWN)) { |
|---|
| 546 | PyObject *zero = PyInt_FromLong(0); |
|---|
| 547 | PyObject_SetAttrString(pyobj,(char*)"thisown",zero); |
|---|
| 548 | Py_DECREF(zero); |
|---|
| 549 | } |
|---|
| 550 | return 0; |
|---|
| 551 | |
|---|
| 552 | type_error: |
|---|
| 553 | if (flags & SWIG_POINTER_EXCEPTION) { |
|---|
| 554 | if (ty && c) { |
|---|
| 555 | char *temp = (char *) malloc(64+strlen(ty->name)+strlen(c)); |
|---|
| 556 | sprintf(temp,"Type error. Got %s, expected %s", c, ty->name); |
|---|
| 557 | PyErr_SetString(PyExc_TypeError, temp); |
|---|
| 558 | free((char *) temp); |
|---|
| 559 | } else { |
|---|
| 560 | PyErr_SetString(PyExc_TypeError,"Expected a pointer"); |
|---|
| 561 | } |
|---|
| 562 | } |
|---|
| 563 | return -1; |
|---|
| 564 | } |
|---|
| 565 | |
|---|
| 566 | /* Convert a pointer value, signal an exception on a type mismatch */ |
|---|
| 567 | SWIGRUNTIME(void *) |
|---|
| 568 | SWIG_Python_MustGetPtr(PyObject *obj, swig_type_info *ty, int argnum, int flags) { |
|---|
| 569 | void *result; |
|---|
| 570 | SWIG_Python_ConvertPtr(obj, &result, ty, flags | SWIG_POINTER_EXCEPTION); |
|---|
| 571 | return result; |
|---|
| 572 | } |
|---|
| 573 | |
|---|
| 574 | /* Convert a packed value value */ |
|---|
| 575 | SWIGRUNTIME(int) |
|---|
| 576 | SWIG_Python_ConvertPacked(PyObject *obj, void *ptr, int sz, swig_type_info *ty, int flags) { |
|---|
| 577 | swig_type_info *tc; |
|---|
| 578 | char *c = 0; |
|---|
| 579 | |
|---|
| 580 | if ((!obj) || (!PyString_Check(obj))) goto type_error; |
|---|
| 581 | c = PyString_AsString(obj); |
|---|
| 582 | /* Pointer values must start with leading underscore */ |
|---|
| 583 | if (*c != '_') goto type_error; |
|---|
| 584 | c++; |
|---|
| 585 | c = SWIG_UnpackData(c,ptr,sz); |
|---|
| 586 | if (ty) { |
|---|
| 587 | tc = SWIG_TypeCheck(c,ty); |
|---|
| 588 | if (!tc) goto type_error; |
|---|
| 589 | } |
|---|
| 590 | return 0; |
|---|
| 591 | |
|---|
| 592 | type_error: |
|---|
| 593 | |
|---|
| 594 | if (flags) { |
|---|
| 595 | if (ty && c) { |
|---|
| 596 | char *temp = (char *) malloc(64+strlen(ty->name)+strlen(c)); |
|---|
| 597 | sprintf(temp,"Type error. Got %s, expected %s", c, ty->name); |
|---|
| 598 | PyErr_SetString(PyExc_TypeError, temp); |
|---|
| 599 | free((char *) temp); |
|---|
| 600 | } else { |
|---|
| 601 | PyErr_SetString(PyExc_TypeError,"Expected a pointer"); |
|---|
| 602 | } |
|---|
| 603 | } |
|---|
| 604 | return -1; |
|---|
| 605 | } |
|---|
| 606 | |
|---|
| 607 | /* Create a new pointer object */ |
|---|
| 608 | SWIGRUNTIME(PyObject *) |
|---|
| 609 | SWIG_Python_NewPointerObj(void *ptr, swig_type_info *type, int own) { |
|---|
| 610 | PyObject *robj; |
|---|
| 611 | if (!ptr) { |
|---|
| 612 | Py_INCREF(Py_None); |
|---|
| 613 | return Py_None; |
|---|
| 614 | } |
|---|
| 615 | #ifdef SWIG_COBJECT_TYPES |
|---|
| 616 | robj = PyCObject_FromVoidPtrAndDesc((void *) ptr, (char *) type->name, NULL); |
|---|
| 617 | #else |
|---|
| 618 | { |
|---|
| 619 | char result[1024]; |
|---|
| 620 | char *r = result; |
|---|
| 621 | *(r++) = '_'; |
|---|
| 622 | r = SWIG_PackData(r,&ptr,sizeof(void *)); |
|---|
| 623 | strcpy(r,type->name); |
|---|
| 624 | robj = PyString_FromString(result); |
|---|
| 625 | } |
|---|
| 626 | #endif |
|---|
| 627 | if (!robj || (robj == Py_None)) return robj; |
|---|
| 628 | if (type->clientdata) { |
|---|
| 629 | PyObject *inst; |
|---|
| 630 | PyObject *args = Py_BuildValue((char*)"(O)", robj); |
|---|
| 631 | Py_DECREF(robj); |
|---|
| 632 | inst = PyObject_CallObject((PyObject *) type->clientdata, args); |
|---|
| 633 | Py_DECREF(args); |
|---|
| 634 | if (inst) { |
|---|
| 635 | if (own) { |
|---|
| 636 | PyObject *n = PyInt_FromLong(1); |
|---|
| 637 | PyObject_SetAttrString(inst,(char*)"thisown",n); |
|---|
| 638 | Py_DECREF(n); |
|---|
| 639 | } |
|---|
| 640 | robj = inst; |
|---|
| 641 | } |
|---|
| 642 | } |
|---|
| 643 | return robj; |
|---|
| 644 | } |
|---|
| 645 | |
|---|
| 646 | SWIGRUNTIME(PyObject *) |
|---|
| 647 | SWIG_Python_NewPackedObj(void *ptr, int sz, swig_type_info *type) { |
|---|
| 648 | char result[1024]; |
|---|
| 649 | char *r = result; |
|---|
| 650 | if ((2*sz + 1 + strlen(type->name)) > 1000) return 0; |
|---|
| 651 | *(r++) = '_'; |
|---|
| 652 | r = SWIG_PackData(r,ptr,sz); |
|---|
| 653 | strcpy(r,type->name); |
|---|
| 654 | return PyString_FromString(result); |
|---|
| 655 | } |
|---|
| 656 | |
|---|
| 657 | /* Install Constants */ |
|---|
| 658 | SWIGRUNTIME(void) |
|---|
| 659 | SWIG_Python_InstallConstants(PyObject *d, swig_const_info constants[]) { |
|---|
| 660 | int i; |
|---|
| 661 | PyObject *obj; |
|---|
| 662 | for (i = 0; constants[i].type; i++) { |
|---|
| 663 | switch(constants[i].type) { |
|---|
| 664 | case SWIG_PY_INT: |
|---|
| 665 | obj = PyInt_FromLong(constants[i].lvalue); |
|---|
| 666 | break; |
|---|
| 667 | case SWIG_PY_FLOAT: |
|---|
| 668 | obj = PyFloat_FromDouble(constants[i].dvalue); |
|---|
| 669 | break; |
|---|
| 670 | case SWIG_PY_STRING: |
|---|
| 671 | obj = PyString_FromString((char *) constants[i].pvalue); |
|---|
| 672 | break; |
|---|
| 673 | case SWIG_PY_POINTER: |
|---|
| 674 | obj = SWIG_NewPointerObj(constants[i].pvalue, *(constants[i]).ptype,0); |
|---|
| 675 | break; |
|---|
| 676 | case SWIG_PY_BINARY: |
|---|
| 677 | obj = SWIG_NewPackedObj(constants[i].pvalue, constants[i].lvalue, *(constants[i].ptype)); |
|---|
| 678 | break; |
|---|
| 679 | default: |
|---|
| 680 | obj = 0; |
|---|
| 681 | break; |
|---|
| 682 | } |
|---|
| 683 | if (obj) { |
|---|
| 684 | PyDict_SetItemString(d,constants[i].name,obj); |
|---|
| 685 | Py_DECREF(obj); |
|---|
| 686 | } |
|---|
| 687 | } |
|---|
| 688 | } |
|---|
| 689 | |
|---|
| 690 | #endif |
|---|
| 691 | |
|---|
| 692 | /* Contract support */ |
|---|
| 693 | |
|---|
| 694 | #define SWIG_contract_assert(expr, msg) if (!(expr)) { PyErr_SetString(PyExc_RuntimeError, (char *) msg ); goto fail; } else |
|---|
| 695 | |
|---|
| 696 | #ifdef __cplusplus |
|---|
| 697 | } |
|---|
| 698 | #endif |
|---|
| 699 | |
|---|
| 700 | |
|---|
| 701 | /* -------- TYPES TABLE (BEGIN) -------- */ |
|---|
| 702 | |
|---|
| 703 | #define SWIGTYPE_p_nodeN swig_types[0] |
|---|
| 704 | #define SWIGTYPE_p_NodeStack swig_types[1] |
|---|
| 705 | #define SWIGTYPE_p_Node swig_types[2] |
|---|
| 706 | #define SWIGTYPE_p_IntStack swig_types[3] |
|---|
| 707 | #define SWIGTYPE_p_Cursor swig_types[4] |
|---|
| 708 | #define SWIGTYPE_p_intN swig_types[5] |
|---|
| 709 | #define SWIGTYPE_p_SGFError swig_types[6] |
|---|
| 710 | static swig_type_info *swig_types[8]; |
|---|
| 711 | |
|---|
| 712 | /* -------- TYPES TABLE (END) -------- */ |
|---|
| 713 | |
|---|
| 714 | |
|---|
| 715 | /*----------------------------------------------- |
|---|
| 716 | @(target):= _sgfpars.so |
|---|
| 717 | ------------------------------------------------*/ |
|---|
| 718 | #define SWIG_init init_sgfpars |
|---|
| 719 | |
|---|
| 720 | #define SWIG_name "_sgfpars" |
|---|
| 721 | |
|---|
| 722 | #include "sgfpars.h" |
|---|
| 723 | |
|---|
| 724 | #ifdef __cplusplus |
|---|
| 725 | extern "C" { |
|---|
| 726 | #endif |
|---|
| 727 | static PyObject *_wrap_new_SGFError(PyObject *self, PyObject *args) { |
|---|
| 728 | PyObject *resultobj; |
|---|
| 729 | SGFError *result; |
|---|
| 730 | |
|---|
| 731 | if(!PyArg_ParseTuple(args,(char *)":new_SGFError")) goto fail; |
|---|
| 732 | { |
|---|
| 733 | try { |
|---|
| 734 | result = (SGFError *)new SGFError(); |
|---|
| 735 | |
|---|
| 736 | } catch(SGFError e) { |
|---|
| 737 | SGFError *ecopy = new SGFError(e); |
|---|
| 738 | PyObject *err = SWIG_NewPointerObj(ecopy, SWIGTYPE_p_SGFError, 1); |
|---|
| 739 | PyErr_SetObject((PyObject *) SWIGTYPE_p_SGFError->clientdata, err); |
|---|
| 740 | return NULL; |
|---|
| 741 | } |
|---|
| 742 | } |
|---|
| 743 | resultobj = SWIG_NewPointerObj((void *) result, SWIGTYPE_p_SGFError, 1); |
|---|
| 744 | return resultobj; |
|---|
| 745 | fail: |
|---|
| 746 | return NULL; |
|---|
| 747 | } |
|---|
| 748 | |
|---|
| 749 | |
|---|
| 750 | static PyObject *_wrap_delete_SGFError(PyObject *self, PyObject *args) { |
|---|
| 751 | PyObject *resultobj; |
|---|
| 752 | SGFError *arg1 = (SGFError *) 0 ; |
|---|
| 753 | PyObject * obj0 = 0 ; |
|---|
| 754 | |
|---|
| 755 | if(!PyArg_ParseTuple(args,(char *)"O:delete_SGFError",&obj0)) goto fail; |
|---|
|
|---|