| 1 |
|
|---|
| 2 |
|
|---|
| 3 |
|
|---|
| 4 |
|
|---|
| 5 |
|
|---|
| 6 |
|
|---|
| 7 |
|
|---|
| 8 |
|
|---|
| 9 |
|
|---|
| 10 |
|
|---|
| 11 |
#define SWIGPYTHON |
|---|
| 12 |
|
|---|
| 13 |
#ifdef __cplusplus |
|---|
| 14 |
template<class T> class SwigValueWrapper { |
|---|
| 15 |
T *tt; |
|---|
| 16 |
public: |
|---|
| 17 |
inline SwigValueWrapper() : tt(0) { } |
|---|
| 18 |
inline ~SwigValueWrapper() { if (tt) delete tt; } |
|---|
| 19 |
inline SwigValueWrapper& operator=(const T& t) { tt = new T(t); return *this; } |
|---|
| 20 |
inline operator T&() const { return *tt; } |
|---|
| 21 |
inline T *operator&() { return tt; } |
|---|
| 22 |
}; |
|---|
| 23 |
#endif |
|---|
| 24 |
|
|---|
| 25 |
|
|---|
| 26 |
#include "Python.h" |
|---|
| 27 |
|
|---|
| 28 |
|
|---|
| 29 |
|
|---|
| 30 |
|
|---|
| 31 |
|
|---|
| 32 |
|
|---|
| 33 |
|
|---|
| 34 |
|
|---|
| 35 |
|
|---|
| 36 |
|
|---|
| 37 |
|
|---|
| 38 |
|
|---|
| 39 |
|
|---|
| 40 |
|
|---|
| 41 |
|
|---|
| 42 |
|
|---|
| 43 |
#include <string.h> |
|---|
| 44 |
|
|---|
| 45 |
#if defined(_WIN32) || defined(__WIN32__) |
|---|
| 46 |
# if defined(_MSC_VER) |
|---|
| 47 |
# if defined(STATIC_LINKED) |
|---|
| 48 |
# define SWIGEXPORT(a) a |
|---|
| 49 |
# define SWIGIMPORT(a) extern a |
|---|
| 50 |
# else |
|---|
| 51 |
# define SWIGEXPORT(a) __declspec(dllexport) a |
|---|
| 52 |
# define SWIGIMPORT(a) extern a |
|---|
| 53 |
# endif |
|---|
| 54 |
# else |
|---|
| 55 |
# if defined(__BORLANDC__) |
|---|
| 56 |
# define SWIGEXPORT(a) a _export |
|---|
| 57 |
# define SWIGIMPORT(a) a _export |
|---|
| 58 |
# else |
|---|
| 59 |
# define SWIGEXPORT(a) a |
|---|
| 60 |
# define SWIGIMPORT(a) a |
|---|
| 61 |
# endif |
|---|
| 62 |
# endif |
|---|
| 63 |
#else |
|---|
| 64 |
# define SWIGEXPORT(a) a |
|---|
| 65 |
# define SWIGIMPORT(a) a |
|---|
| 66 |
#endif |
|---|
| 67 |
|
|---|
| 68 |
#ifdef SWIG_GLOBAL |
|---|
| 69 |
#define SWIGRUNTIME(a) SWIGEXPORT(a) |
|---|
| 70 |
#else |
|---|
| 71 |
#define SWIGRUNTIME(a) static a |
|---|
| 72 |
#endif |
|---|
| 73 |
|
|---|
| 74 |
#ifdef __cplusplus |
|---|
| 75 |
extern "C" { |
|---|
| 76 |
#endif |
|---|
| 77 |
|
|---|
| 78 |
typedef void *(*swig_converter_func)(void *); |
|---|
| 79 |
typedef struct swig_type_info *(*swig_dycast_func)(void **); |
|---|
| 80 |
|
|---|
| 81 |
typedef struct swig_type_info { |
|---|
| 82 |
const char *name; |
|---|
| 83 |
swig_converter_func converter; |
|---|
| 84 |
const char *str; |
|---|
| 85 |
void *clientdata; |
|---|
| 86 |
swig_dycast_func dcast; |
|---|
| 87 |
struct swig_type_info *next; |
|---|
| 88 |
struct swig_type_info *prev; |
|---|
| 89 |
} swig_type_info; |
|---|
| 90 |
|
|---|
| 91 |
#ifdef SWIG_NOINCLUDE |
|---|
| 92 |
|
|---|
| 93 |
SWIGIMPORT(swig_type_info *) SWIG_TypeRegister(swig_type_info *); |
|---|
| 94 |
SWIGIMPORT(swig_type_info *) SWIG_TypeCheck(char *c, swig_type_info *); |
|---|
| 95 |
SWIGIMPORT(void *) SWIG_TypeCast(swig_type_info *, void *); |
|---|
| 96 |
SWIGIMPORT(swig_type_info *) SWIG_TypeDynamicCast(swig_type_info *, void **); |
|---|
| 97 |
SWIGIMPORT(const char *) SWIG_TypeName(const swig_type_info *); |
|---|
| 98 |
SWIGIMPORT(swig_type_info *) SWIG_TypeQuery(const char *); |
|---|
| 99 |
SWIGIMPORT(void) SWIG_TypeClientData(swig_type_info *, void *); |
|---|
| 100 |
|
|---|
| 101 |
#else |
|---|
| 102 |
|
|---|
| 103 |
static swig_type_info *swig_type_list = 0; |
|---|
| 104 |
|
|---|
| 105 |
|
|---|
| 106 |
SWIGRUNTIME(swig_type_info *) |
|---|
| 107 |
SWIG_TypeRegister(swig_type_info *ti) |
|---|
| 108 |
{ |
|---|
| 109 |
swig_type_info *tc, *head, *ret, *next; |
|---|
| 110 |
|
|---|
| 111 |
tc = swig_type_list; |
|---|
| 112 |
while (tc) { |
|---|
| 113 |
if (strcmp(tc->name, ti->name) == 0) { |
|---|
| 114 |
|
|---|
| 115 |
if (tc->clientdata) ti->clientdata = tc->clientdata; |
|---|
| 116 |
head = tc; |
|---|
| 117 |
next = tc->next; |
|---|
| 118 |
goto l1; |
|---|
| 119 |
} |
|---|
| 120 |
tc = tc->prev; |
|---|
| 121 |
} |
|---|
| 122 |
head = ti; |
|---|
| 123 |
next = 0; |
|---|
| 124 |
|
|---|
| 125 |
|
|---|
| 126 |
ti->prev = swig_type_list; |
|---|
| 127 |
swig_type_list = ti; |
|---|
| 128 |
|
|---|
| 129 |
|
|---|
| 130 |
l1: |
|---|
| 131 |
ret = head; |
|---|
| 132 |
tc = ti + 1; |
|---|
| 133 |
|
|---|
| 134 |
while (tc->name) { |
|---|
| 135 |
head->next = tc; |
|---|
| 136 |
tc->prev = head; |
|---|
| 137 |
head = tc; |
|---|
| 138 |
tc++; |
|---|
| 139 |
} |
|---|
| 140 |
if (next) next->prev = head; |
|---|
| 141 |
head->next = next; |
|---|
| 142 |
return ret; |
|---|
| 143 |
} |
|---|
| 144 |
|
|---|
| 145 |
|
|---|
| 146 |
SWIGRUNTIME(swig_type_info *) |
|---|
| 147 |
SWIG_TypeCheck(char *c, swig_type_info *ty) |
|---|
| 148 |
{ |
|---|
| 149 |
swig_type_info *s; |
|---|
| 150 |
if (!ty) return 0; |
|---|
| 151 |
s = ty->next; |
|---|
| 152 |
do { |
|---|
| 153 |
if (strcmp(s->name,c) == 0) { |
|---|
| 154 |
if (s == ty->next) return s; |
|---|
| 155 |
|
|---|
| 156 |
s->prev->next = s->next; |
|---|
| 157 |
if (s->next) { |
|---|
| 158 |
s->next->prev = s->prev; |
|---|
| 159 |
} |
|---|
| 160 |
|
|---|
| 161 |
s->next = ty->next; |
|---|
| 162 |
if (ty->next) ty->next->prev = s; |
|---|
| 163 |
ty->next = s; |
|---|
| 164 |
s->prev = ty; |
|---|
| 165 |
return s; |
|---|
| 166 |
} |
|---|
| 167 |
s = s->next; |
|---|
| 168 |
} while (s && (s != ty->next)); |
|---|
| 169 |
return 0; |
|---|
| 170 |
} |
|---|
| 171 |
|
|---|
| 172 |
|
|---|
| 173 |
SWIGRUNTIME(void *) |
|---|
| 174 |
SWIG_TypeCast(swig_type_info *ty, void *ptr) |
|---|
| 175 |
{ |
|---|
| 176 |
if ((!ty) || (!ty->converter)) return ptr; |
|---|
| 177 |
return (*ty->converter)(ptr); |
|---|
| 178 |
} |
|---|
| 179 |
|
|---|
| 180 |
|
|---|
| 181 |
SWIGRUNTIME(swig_type_info *) |
|---|
| 182 |
SWIG_TypeDynamicCast(swig_type_info *ty, void **ptr) |
|---|
| 183 |
{ |
|---|
| 184 |
swig_type_info *lastty = ty; |
|---|
| 185 |
if (!ty || !ty->dcast) return ty; |
|---|
| 186 |
while (ty && (ty->dcast)) { |
|---|
| 187 |
ty = (*ty->dcast)(ptr); |
|---|
| 188 |
if (ty) lastty = ty; |
|---|
| 189 |
} |
|---|
| 190 |
return lastty; |
|---|
| 191 |
} |
|---|
| 192 |
|
|---|
| 193 |
|
|---|
| 194 |
SWIGRUNTIME(const char *) |
|---|
| 195 |
SWIG_TypeName(const swig_type_info *ty) { |
|---|
| 196 |
return ty->name; |
|---|
| 197 |
} |
|---|
| 198 |
|
|---|
| 199 |
|
|---|
| 200 |
SWIGRUNTIME(swig_type_info *) |
|---|
| 201 |
SWIG_TypeQuery(const char *name) { |
|---|
| 202 |
swig_type_info *ty = swig_type_list; |
|---|
| 203 |
while (ty) { |
|---|
| 204 |
if (ty->str && (strcmp(name,ty->str) == 0)) return ty; |
|---|
| 205 |
if (ty->name && (strcmp(name,ty->name) == 0)) return ty; |
|---|
| 206 |
ty = ty->prev; |
|---|
| 207 |
} |
|---|
| 208 |
return 0; |
|---|
| 209 |
} |
|---|
| 210 |
|
|---|
| 211 |
|
|---|
| 212 |
SWIGRUNTIME(void) |
|---|
| 213 |
SWIG_TypeClientData(swig_type_info *ti, void *clientdata) { |
|---|
| 214 |
swig_type_info *tc, *equiv; |
|---|
| 215 |
if (ti->clientdata == clientdata) return; |
|---|
| 216 |
ti->clientdata = clientdata; |
|---|
| 217 |
equiv = ti->next; |
|---|
| 218 |
while (equiv) { |
|---|
| 219 |
if (!equiv->converter) { |
|---|
| 220 |
tc = swig_type_list; |
|---|
| 221 |
while (tc) { |
|---|
| 222 |
if ((strcmp(tc->name, equiv->name) == 0)) |
|---|
| 223 |
SWIG_TypeClientData(tc,clientdata); |
|---|
| 224 |
tc = tc->prev; |
|---|
| 225 |
} |
|---|
| 226 |
} |
|---|
| 227 |
equiv = equiv->next; |
|---|
| 228 |
} |
|---|
| 229 |
} |
|---|
| 230 |
#endif |
|---|
| 231 |
|
|---|
| 232 |
#ifdef __cplusplus |
|---|
| 233 |
} |
|---|
| 234 |
|
|---|
| 235 |
#endif |
|---|
| 236 |
|
|---|
| 237 |
|
|---|
| 238 |
|
|---|
| 239 |
|
|---|
| 240 |
|
|---|
| 241 |
|
|---|
| 242 |
|
|---|
| 243 |
|
|---|
| 244 |
|
|---|
| 245 |
|
|---|
| 246 |
|
|---|
| 247 |
#include "Python.h" |
|---|
| 248 |
|
|---|
| 249 |
#ifdef __cplusplus |
|---|
| 250 |
extern "C" { |
|---|
| 251 |
#endif |
|---|
| 252 |
|
|---|
| 253 |
#define SWIG_PY_INT 1 |
|---|
| 254 |
#define SWIG_PY_FLOAT 2 |
|---|
| 255 |
#define SWIG_PY_STRING 3 |
|---|
| 256 |
#define SWIG_PY_POINTER 4 |
|---|
| 257 |
#define SWIG_PY_BINARY 5 |
|---|
| 258 |
|
|---|
| 259 |
|
|---|
| 260 |
|
|---|
| 261 |
#define SWIG_POINTER_EXCEPTION 0x1 |
|---|
| 262 |
#define SWIG_POINTER_DISOWN 0x2 |
|---|
| 263 |
|
|---|
| 264 |
|
|---|
| 265 |
#define SWIG_fail goto fail |
|---|
| 266 |
|
|---|
| 267 |
|
|---|
| 268 |
typedef struct swig_const_info { |
|---|
| 269 |
int type; |
|---|
| 270 |
char *name; |
|---|
| 271 |
long lvalue; |
|---|
| 272 |
double dvalue; |
|---|
| 273 |
void *pvalue; |
|---|
| 274 |
swig_type_info **ptype; |
|---|
| 275 |
} swig_const_info; |
|---|
| 276 |
|
|---|
| 277 |
#ifdef SWIG_NOINCLUDE |
|---|
| 278 |
|
|---|
| 279 |
SWIGEXPORT(PyObject *) SWIG_newvarlink(void); |
|---|
| 280 |
SWIGEXPORT(void) SWIG_addvarlink(PyObject *, char *, PyObject *(*)(void), int (*)(PyObject *)); |
|---|
| 281 |
SWIGEXPORT(int) SWIG_ConvertPtr(PyObject *, void **, swig_type_info *, int); |
|---|
| 282 |
SWIGEXPORT(int) SWIG_ConvertPacked(PyObject *, void *, int sz, swig_type_info *, int); |
|---|
| 283 |
SWIGEXPORT(char *) SWIG_PackData(char *c, void *, int); |
|---|
| 284 |
SWIGEXPORT(char *) SWIG_UnpackData(char *c, void *, int); |
|---|
| 285 |
SWIGEXPORT(PyObject *) SWIG_NewPointerObj(void *, swig_type_info *,int own); |
|---|
| 286 |
SWIGEXPORT(PyObject *) SWIG_NewPackedObj(void *, int sz, swig_type_info *); |
|---|
| 287 |
SWIGEXPORT(void) SWIG_InstallConstants(PyObject *d, swig_const_info constants[]); |
|---|
| 288 |
#else |
|---|
| 289 |
|
|---|
| 290 |
|
|---|
| 291 |
|
|---|
| 292 |
|
|---|
| 293 |
|
|---|
| 294 |
typedef struct swig_globalvar { |
|---|
| 295 |
char *name; |
|---|
| 296 |
PyObject *(*get_attr)(void); |
|---|
| 297 |
int (*set_attr)(PyObject *); |
|---|
| 298 |
struct swig_globalvar *next; |
|---|
| 299 |
} swig_globalvar; |
|---|
| 300 |
|
|---|
| 301 |
typedef struct swig_varlinkobject { |
|---|
| 302 |
PyObject_HEAD |
|---|
| 303 |
swig_globalvar *vars; |
|---|
| 304 |
} swig_varlinkobject; |
|---|
| 305 |
|
|---|
| 306 |
static PyObject * |
|---|
| 307 |
swig_varlink_repr(swig_varlinkobject *v) { |
|---|
| 308 |
v = v; |
|---|
| 309 |
return PyString_FromString("<Global variables>"); |
|---|
| 310 |
} |
|---|
| 311 |
|
|---|
| 312 |
static int |
|---|
| 313 |
swig_varlink_print(swig_varlinkobject *v, FILE *fp, int flags) { |
|---|
| 314 |
swig_globalvar *var; |
|---|
| 315 |
flags = flags; |
|---|
| 316 |
fprintf(fp,"Global variables { "); |
|---|
| 317 |
for (var = v->vars; var; var=var->next) { |
|---|
| 318 |
fprintf(fp,"%s", var->name); |
|---|
| 319 |
if (var->next) fprintf(fp,", "); |
|---|
| 320 |
} |
|---|
| 321 |
fprintf(fp," }\n"); |
|---|
| 322 |
return 0; |
|---|
| 323 |
} |
|---|
| 324 |
|
|---|
| 325 |
static PyObject * |
|---|
| 326 |
swig_varlink_getattr(swig_varlinkobject *v, char *n) { |
|---|
| 327 |
swig_globalvar *var = v->vars; |
|---|
| 328 |
while (var) { |
|---|
| 329 |
if (strcmp(var->name,n) == 0) { |
|---|
| 330 |
return (*var->get_attr)(); |
|---|
| 331 |
} |
|---|
| 332 |
var = var->next; |
|---|
| 333 |
} |
|---|
| 334 |
PyErr_SetString(PyExc_NameError,"Unknown C global variable"); |
|---|
| 335 |
return NULL; |
|---|
| 336 |
} |
|---|
| 337 |
|
|---|
| 338 |
static int |
|---|
| 339 |
swig_varlink_setattr(swig_varlinkobject *v, char *n, PyObject *p) { |
|---|
| 340 |
swig_globalvar *var = v->vars; |
|---|
| 341 |
while (var) { |
|---|
| 342 |
if (strcmp(var->name,n) == 0) { |
|---|
| 343 |
return (*var->set_attr)(p); |
|---|
| 344 |
} |
|---|
| 345 |
var = var->next; |
|---|
| 346 |
} |
|---|
| 347 |
PyErr_SetString(PyExc_NameError,"Unknown C global variable"); |
|---|
| 348 |
return 1; |
|---|
| 349 |
} |
|---|
| 350 |
|
|---|
| 351 |
statichere PyTypeObject varlinktype = { |
|---|
| 352 |
PyObject_HEAD_INIT(0) |
|---|
| 353 |
0, |
|---|
| 354 |
(char *)"swigvarlink", |
|---|
| 355 |
sizeof(swig_varlinkobject), |
|---|
| 356 |
0, |
|---|
| 357 |
0, |
|---|
| 358 |
(printfunc) swig_varlink_print, |
|---|
| 359 |
(getattrfunc) swig_varlink_getattr, |
|---|
| 360 |
(setattrfunc) swig_varlink_setattr, |
|---|
| 361 |
0, |
|---|
| 362 |
(reprfunc) swig_varlink_repr, |
|---|
| 363 |
0, |
|---|
| 364 |
0, |
|---|
| 365 |
0, |
|---|
| 366 |
}; |
|---|
| 367 |
|
|---|
| 368 |
|
|---|
| 369 |
SWIGRUNTIME(PyObject *) |
|---|
| 370 |
SWIG_newvarlink(void) { |
|---|
| 371 |
swig_varlinkobject *result = 0; |
|---|
| 372 |
result = PyMem_NEW(swig_varlinkobject,1); |
|---|
| 373 |
varlinktype.ob_type = &PyType_Type; |
|---|
| 374 |
result->ob_type = &varlinktype; |
|---|
| 375 |
result->vars = 0; |
|---|
| 376 |
result->ob_refcnt = 0; |
|---|
| 377 |
Py_XINCREF((PyObject *) result); |
|---|
| 378 |
return ((PyObject*) result); |
|---|
| 379 |
} |
|---|
| 380 |
|
|---|
| 381 |
SWIGRUNTIME(void) |
|---|
| 382 |
SWIG_addvarlink(PyObject *p, char *name, |
|---|
| 383 |
PyObject *(*get_attr)(void), int (*set_attr)(PyObject *p)) { |
|---|
| 384 |
swig_varlinkobject *v; |
|---|
| 385 |
swig_globalvar *gv; |
|---|
| 386 |
v= (swig_varlinkobject *) p; |
|---|
| 387 |
gv = (swig_globalvar *) malloc(sizeof(swig_globalvar)); |
|---|
| 388 |
gv->name = (char *) malloc(strlen(name)+1); |
|---|
| 389 |
strcpy(gv->name,name); |
|---|
| 390 |
gv->get_attr = get_attr; |
|---|
| 391 |
gv->set_attr = set_attr; |
|---|
| 392 |
gv->next = v->vars; |
|---|
| 393 |
v->vars = gv; |
|---|
| 394 |
} |
|---|
| 395 |
|
|---|
| 396 |
|
|---|
| 397 |
SWIGRUNTIME(char *) |
|---|
| 398 |
SWIG_PackData(char *c, void *ptr, int sz) { |
|---|
| 399 |
static char hex[17] = "0123456789abcdef"; |
|---|
| 400 |
int i; |
|---|
| 401 |
unsigned char *u = (unsigned char *) ptr; |
|---|
| 402 |
register unsigned char uu; |
|---|
| 403 |
for (i = 0; i < sz; i++,u++) { |
|---|
| 404 |
uu = *u; |
|---|
| 405 |
*(c++) = hex[(uu & 0xf0) >> 4]; |
|---|
| 406 |
*(c++) = hex[uu & 0xf]; |
|---|
| 407 |
} |
|---|
| 408 |
return c; |
|---|
| 409 |
} |
|---|
| 410 |
|
|---|
| 411 |
|
|---|
| 412 |
SWIGRUNTIME(char *) |
|---|
| 413 |
SWIG_UnpackData(char *c, void *ptr, int sz) { |
|---|
| 414 |
register unsigned char uu = 0; |
|---|
| 415 |
register int d; |
|---|
| 416 |
unsigned char *u = (unsigned char *) ptr; |
|---|
| 417 |
int i; |
|---|
| 418 |
for (i = 0; i < sz; i++, u++) { |
|---|
| 419 |
d = *(c++); |
|---|
| 420 |
if ((d >= '0') && (d <= '9')) |
|---|
| 421 |
uu = ((d - '0') << 4); |
|---|
| 422 |
else if ((d >= 'a') && (d <= 'f')) |
|---|
| 423 |
uu = ((d - ('a'-10)) << 4); |
|---|
| 424 |
d = *(c++); |
|---|
| 425 |
if ((d >= '0') && (d <= '9')) |
|---|
| 426 |
uu |= (d - '0'); |
|---|
| 427 |
else if ((d >= 'a') && (d <= 'f')) |
|---|
| 428 |
uu |= (d - ('a'-10)); |
|---|
| 429 |
*u = uu; |
|---|
| 430 |
} |
|---|
| 431 |
return c; |
|---|
| 432 |
} |
|---|
| 433 |
|
|---|
| 434 |
|
|---|
| 435 |
SWIGRUNTIME(int) |
|---|
| 436 |
SWIG_ConvertPtr(PyObject *obj, void **ptr, swig_type_info *ty, int flags) { |
|---|
| 437 |
swig_type_info *tc; |
|---|
| 438 |
char *c; |
|---|
| 439 |
static PyObject *SWIG_this = 0; |
|---|
| 440 |
int newref = 0; |
|---|
| 441 |
PyObject *pyobj = 0; |
|---|
| 442 |
|
|---|
| 443 |
if (!obj) return 0; |
|---|
| 444 |
if (obj == Py_None) { |
|---|
| 445 |
*ptr = 0; |
|---|
| 446 |
return 0; |
|---|
| 447 |
} |
|---|
| 448 |
#ifdef SWIG_COBJECT_TYPES |
|---|
| 449 |
if (!(PyCObject_Check(obj))) { |
|---|
| 450 |
if (!SWIG_this) |
|---|
| 451 |
SWIG_this = PyString_FromString("this"); |
|---|
| 452 |
pyobj = obj; |
|---|
| 453 |
obj = PyObject_GetAttr(obj,SWIG_this); |
|---|
| 454 |
newref = 1; |
|---|
| 455 |
if (!obj) goto type_error; |
|---|
| 456 |
if (!PyCObject_Check(obj)) { |
|---|
| 457 |
Py_DECREF(obj); |
|---|
| 458 |
goto type_error; |
|---|
| 459 |
} |
|---|
| 460 |
} |
|---|
| 461 |
*ptr = PyCObject_AsVoidPtr(obj); |
|---|
| 462 |
c = (char *) PyCObject_GetDesc(obj); |
|---|
| 463 |
if (newref) Py_DECREF(obj); |
|---|
| 464 |
goto cobject; |
|---|
| 465 |
#else |
|---|
| 466 |
if (!(PyString_Check(obj))) { |
|---|
| 467 |
if (!SWIG_this) |
|---|
| 468 |
SWIG_this = PyString_FromString("this"); |
|---|
| 469 |
pyobj = obj; |
|---|
| 470 |
obj = PyObject_GetAttr(obj,SWIG_this); |
|---|
| 471 |
newref = 1; |
|---|
| 472 |
if (!obj) goto type_error; |
|---|
| 473 |
if (!PyString_Check(obj)) { |
|---|
| 474 |
Py_DECREF(obj); |
|---|
| 475 |
goto type_error; |
|---|
| 476 |
} |
|---|
| 477 |
} |
|---|
| 478 |
c = PyString_AsString(obj); |
|---|
| 479 |
|
|---|
| 480 |
if (*c != '_') { |
|---|
| 481 |
*ptr = (void *) 0; |
|---|
| 482 |
if (strcmp(c,"NULL") == 0) { |
|---|
| 483 |
if (newref) { Py_DECREF(obj); } |
|---|
| 484 |
return 0; |
|---|
| 485 |
} else { |
|---|
| 486 |
if (newref) { Py_DECREF(obj); } |
|---|
| 487 |
goto type_error; |
|---|
| 488 |
} |
|---|
| 489 |
} |
|---|
| 490 |
c++; |
|---|
| 491 |
c = SWIG_UnpackData(c,ptr,sizeof(void *)); |
|---|
| 492 |
if (newref) { Py_DECREF(obj); } |
|---|
| 493 |
#endif |
|---|
| 494 |
|
|---|
| 495 |
#ifdef SWIG_COBJECT_TYPES |
|---|
| 496 |
cobject: |
|---|
| 497 |
#endif |
|---|
| 498 |
|
|---|
| 499 |
if (ty) { |
|---|
| 500 |
tc = SWIG_TypeCheck(c,ty); |
|---|
| 501 |
if (!tc) goto type_error; |
|---|
| 502 |
*ptr = SWIG_TypeCast(tc,(void*) *ptr); |
|---|
| 503 |
} |
|---|
| 504 |
|
|---|
| 505 |
if ((pyobj) && (flags & SWIG_POINTER_DISOWN)) { |
|---|
| 506 |
PyObject *zero = PyInt_FromLong(0); |
|---|
| 507 |
PyObject_SetAttrString(pyobj,(char*)"thisown",zero); |
|---|
| 508 |
Py_DECREF(zero); |
|---|
| 509 |
} |
|---|
| 510 |
return 0; |
|---|
| 511 |
|
|---|
| 512 |
type_error: |
|---|
| 513 |
if (flags & SWIG_POINTER_EXCEPTION) { |
|---|
| 514 |
if (ty) { |
|---|
| 515 |
char *temp = (char *) malloc(64+strlen(ty->name)); |
|---|
| 516 |
sprintf(temp,"Type error. Expected %s", ty->name); |
|---|
| 517 |
PyErr_SetString(PyExc_TypeError, temp); |
|---|
| 518 |
free((char *) temp); |
|---|
| 519 |
} else { |
|---|
| 520 |
PyErr_SetString(PyExc_TypeError,"Expected a pointer"); |
|---|
| 521 |
} |
|---|
| 522 |
} |
|---|
| 523 |
return -1; |
|---|
| 524 |
} |
|---|
| 525 |
|
|---|
| 526 |
|
|---|
| 527 |
SWIGRUNTIME(int) |
|---|
| 528 |
SWIG_ConvertPacked(PyObject *obj, void *ptr, int sz, swig_type_info *ty, int flags) { |
|---|
| 529 |
swig_type_info *tc; |
|---|
| 530 |
char *c; |
|---|
| 531 |
|
|---|
| 532 |
if ((!obj) || (!PyString_Check(obj))) goto type_error; |
|---|
| 533 |
c = PyString_AsString(obj); |
|---|
| 534 |
|
|---|
| 535 |
if (*c != '_') goto type_error; |
|---|
| 536 |
c++; |
|---|
| 537 |
c = SWIG_UnpackData(c,ptr,sz); |
|---|
| 538 |
if (ty) { |
|---|
| 539 |
tc = SWIG_TypeCheck(c,ty); |
|---|
| 540 |
if (!tc) goto type_error; |
|---|
| 541 |
} |
|---|
| 542 |
return 0; |
|---|
| 543 |
|
|---|
| 544 |
type_error: |
|---|
| 545 |
|
|---|
| 546 |
if (flags) { |
|---|
| 547 |
if (ty) { |
|---|
| 548 |
char *temp = (char *) malloc(64+strlen(ty->name)); |
|---|
| 549 |
sprintf(temp,"Type error. Expected %s", ty->name); |
|---|
| 550 |
PyErr_SetString(PyExc_TypeError, temp); |
|---|
| 551 |
free((char *) temp); |
|---|
| 552 |
} else { |
|---|
| 553 |
PyErr_SetString(PyExc_TypeError,"Expected a pointer"); |
|---|
| 554 |
} |
|---|
| 555 |
} |
|---|
| 556 |
return -1; |
|---|
| 557 |
} |
|---|
| 558 |
|
|---|
| 559 |
|
|---|
| 560 |
SWIGRUNTIME(PyObject *) |
|---|
| 561 |
SWIG_NewPointerObj(void *ptr, swig_type_info *type, int own) { |
|---|
| 562 |
PyObject *robj; |
|---|
| 563 |
if (!ptr) { |
|---|
| 564 |
Py_INCREF(Py_None); |
|---|
| 565 |
return Py_None; |
|---|
| 566 |
} |
|---|
| 567 |
#ifdef SWIG_COBJECT_TYPES |
|---|
| 568 |
robj = PyCObject_FromVoidPtrAndDesc((void *) ptr, (char *) type->name, NULL); |
|---|
| 569 |
#else |
|---|
| 570 |
{ |
|---|
| 571 |
char result[1024]; |
|---|
| 572 |
char *r = result; |
|---|
| 573 |
*(r++) = '_'; |
|---|
| 574 |
r = SWIG_PackData(r,&ptr,sizeof(void *)); |
|---|
| 575 |
strcpy(r,type->name); |
|---|
| 576 |
robj = PyString_FromString(result); |
|---|
| 577 |
} |
|---|
| 578 |
#endif |
|---|
| 579 |
if (!robj || (robj == Py_None)) return robj; |
|---|
| 580 |
if (type->clientdata) { |
|---|
| 581 |
PyObject *inst; |
|---|
| 582 |
PyObject *args = Py_BuildValue((char*)"(O)", robj); |
|---|
| 583 |
Py_DECREF(robj); |
|---|
| 584 |
inst = PyObject_CallObject((PyObject *) type->clientdata, args); |
|---|
| 585 |
Py_DECREF(args); |
|---|
| 586 |
if (inst) { |
|---|
| 587 |
if (own) { |
|---|
| 588 |
PyObject *n = PyInt_FromLong(1); |
|---|
| 589 |
PyObject_SetAttrString(inst,(char*)"thisown",n); |
|---|
| 590 |
Py_DECREF(n); |
|---|
| 591 |
} |
|---|
| 592 |
robj = inst; |
|---|
| 593 |
} |
|---|
| 594 |
} |
|---|
| 595 |
return robj; |
|---|
| 596 |
} |
|---|
| 597 |
|
|---|
| 598 |
SWIGRUNTIME(PyObject *) |
|---|
| 599 |
SWIG_NewPackedObj(void *ptr, int sz, swig_type_info *type) { |
|---|
| 600 |
char result[1024]; |
|---|
| 601 |
char *r = result; |
|---|
| 602 |
if ((2*sz + 1 + strlen(type->name)) > 1000) return 0; |
|---|
| 603 |
*(r++) = '_'; |
|---|
| 604 |
r = SWIG_PackData(r,ptr,sz); |
|---|
| 605 |
strcpy(r,type->name); |
|---|
| 606 |
return PyString_FromString(result); |
|---|
| 607 |
} |
|---|
| 608 |
|
|---|
| 609 |
|
|---|
| 610 |
SWIGRUNTIME(void) |
|---|
| 611 |
SWIG_InstallConstants(PyObject *d, swig_const_info constants[]) { |
|---|
| 612 |
int i; |
|---|
| 613 |
PyObject *obj; |
|---|
| 614 |
for (i = 0; constants[i].type; i++) { |
|---|
| 615 |
switch(constants[i].type) { |
|---|
| 616 |
case SWIG_PY_INT: |
|---|
| 617 |
obj = PyInt_FromLong(constants[i].lvalue); |
|---|
| 618 |
break; |
|---|
| 619 |
case SWIG_PY_FLOAT: |
|---|
| 620 |
obj = PyFloat_FromDouble(constants[i].dvalue); |
|---|
| 621 |
break; |
|---|
| 622 |
case SWIG_PY_STRING: |
|---|
| 623 |
obj = PyString_FromString((char *) constants[i].pvalue); |
|---|
| 624 |
break; |
|---|
| 625 |
case SWIG_PY_POINTER: |
|---|
| 626 |
obj = SWIG_NewPointerObj(constants[i].pvalue, *(constants[i]).ptype,0); |
|---|
| 627 |
break; |
|---|
| 628 |
case SWIG_PY_BINARY: |
|---|
| 629 |
obj = SWIG_NewPackedObj(constants[i].pvalue, constants[i].lvalue, *(constants[i].ptype)); |
|---|
| 630 |
break; |
|---|
| 631 |
default: |
|---|
| 632 |
obj = 0; |
|---|
| 633 |
break; |
|---|
| 634 |
} |
|---|
| 635 |
if (obj) { |
|---|
| 636 |
PyDict_SetItemString(d,constants[i].name,obj); |
|---|
| 637 |
Py_DECREF(obj); |
|---|
| 638 |
} |
|---|
| 639 |
} |
|---|
| 640 |
} |
|---|
| 641 |
|
|---|
| 642 |
#endif |
|---|
| 643 |
|
|---|
| 644 |
#ifdef __cplusplus |
|---|
| 645 |
} |
|---|
| 646 |
#endif |
|---|
| 647 |
|
|---|
| 648 |
|
|---|
| 649 |
|
|---|
| 650 |
|
|---|
| 651 |
|
|---|
| 652 |
|
|---|
| 653 |
|
|---|
| 654 |
|
|---|
| 655 |
|
|---|
| 656 |
|
|---|
| 657 |
#define SWIGTYPE_p_nodeN swig_types[0] |
|---|
| 658 |
#define SWIGTYPE_p_NodeStack swig_types[1] |
|---|
| 659 |
#define SWIGTYPE_p_Node swig_types[2] |
|---|
| 660 |
#define SWIGTYPE_p_IntStack swig_types[3] |
|---|
| 661 |
#define SWIGTYPE_p_Cursor swig_types[4] |
|---|
| 662 |
#define SWIGTYPE_p_intN swig_types[5] |
|---|
| 663 |
#define SWIGTYPE_p_SGFError swig_types[6] |
|---|
| 664 |
static swig_type_info *swig_types[8]; |
|---|
| 665 |
|
|---|
| 666 |
|
|---|
| 667 |
|
|---|
| 668 |
|
|---|
| 669 |
|
|---|
| 670 |
|
|---|
| 671 |
|
|---|
| 672 |
#define SWIG_init init_sgfpars |
|---|
| 673 |
|
|---|
| 674 |
#define SWIG_name "_sgfpars" |
|---|
| 675 |
|
|---|
| 676 |
#include "sgfpars.h" |
|---|
| 677 |
|
|---|
| 678 |
#ifdef __cplusplus |
|---|
| 679 |
extern "C" { |
|---|
| 680 |
#endif |
|---|
| 681 |
static PyObject *_wrap_new_SGFError(PyObject *self, PyObject *args) { |
|---|
| 682 |
PyObject *resultobj; |
|---|
| 683 |
SGFError *result; |
|---|
| 684 |
|
|---|
| 685 |
if(!PyArg_ParseTuple(args,(char *)":new_SGFError")) goto fail; |
|---|
| 686 |
{ |
|---|
| 687 |
try { |
|---|
| 688 |
result = (SGFError *)new SGFError(); |
|---|
| 689 |
|
|---|
| 690 |
}catch(SGFError e) { |
|---|
| 691 |
SGFError *ecopy = new SGFError(e); |
|---|
| 692 |
PyObject *err = SWIG_NewPointerObj(ecopy, SWIGTYPE_p_SGFError, 1); |
|---|
| 693 |
PyErr_SetObject((PyObject *) SWIGTYPE_p_SGFError->clientdata, err); |
|---|
| 694 |
return NULL; |
|---|
| 695 |
} |
|---|
| 696 |
} |
|---|
| 697 |
resultobj = SWIG_NewPointerObj((void *) result, SWIGTYPE_p_SGFError, 1); |
|---|
| 698 |
return resultobj; |
|---|
| 699 |
fail: |
|---|
| 700 |
return NULL; |
|---|
| 701 |
} |
|---|
| 702 |
|
|---|
| 703 |
|
|---|
| 704 |
static PyObject *_wrap_delete_SGFError(PyObject *self, PyObject *args) { |
|---|
| 705 |
PyObject *resultobj; |
|---|
| 706 |
SGFError *arg1 = (SGFError *) 0 ; |
|---|
| 707 |
PyObject * obj0 = 0 ; |
|---|
| 708 |
|
|---|
| 709 |
if(!PyArg_ParseTuple(args,(char *)"O:delete_SGFError",&obj0)) goto fail; |
|---|
| 710 |
if ((SWIG_ConvertPtr(obj0,(void **) &arg1, SWIGTYPE_p_SGFError,SWIG_POINTER_EXCEPTION | 0 )) == -1) SWIG_fail; |
|---|
| 711 |
{ |
|---|
| 712 |
try { |
|---|
| 713 |
delete arg1; |
|---|
| 714 |
|
|---|
| 715 |
}catch(SGFError e) { |
|---|
| 716 |
SGFError *ecopy = new SGFError(e); |
|---|
| 717 |
PyObject *err = SWIG_NewPointerObj(ecopy, SWIGTYPE_p_SGFError, 1); |
|---|
| 718 |
PyErr_SetObject((PyObject *) SWIGTYPE_p_SGFError->clientdata, err); |
|---|
| 719 |
return NULL; |
|---|
| 720 |
} |
|---|
| 721 |
} |
|---|
| 722 |
Py_INCREF(Py_None); resultobj = Py_None; |
|---|
| 723 |
return resultobj; |
|---|
| 724 |
fail: |
|---|
| 725 |
return NULL; |
|---|
| 726 |
} |
|---|
| 727 |
|
|---|
| 728 |
|
|---|
| 729 |
static PyObject * SGFError_swigregister(PyObject *self, PyObject *args) { |
|---|
| 730 |
PyObject *obj; |
|---|
| 731 |
if (!PyArg_ParseTuple(args,(char*)"O", &obj)) return NULL; |
|---|
| 732 |
SWIG_TypeClientData(SWIGTYPE_p_SGFError, obj); |
|---|
| 733 |
Py_INCREF(obj); |
|---|
| 734 |
return Py_BuildValue((char *)""); |
|---|
| 735 |
} |
|---|
| 736 |
static PyObject *_wrap_SGFescape(PyObject *self, PyObject *args) { |
|---|
| 737 |
PyObject *resultobj; |
|---|
| 738 |
char *arg1 ; |
|---|
| 739 |
char *result; |
|---|
| 740 |
|
|---|
| 741 |
if(!PyArg_ParseTuple(args,(char *)"s:SGFescape",&arg1)) goto fail; |
|---|
| 742 |
{ |
|---|
| 743 |
try { |
|---|
| 744 |
result = (char *)SGFescape(arg1); |
|---|
| 745 |
|
|---|
| 746 |
}catch(SGFError e) { |
|---|
| 747 |
SGFError *ecopy = new SGFError(e); |
|---|
| 748 |
PyObject *err = SWIG_NewPointerObj(ecopy, SWIGTYPE_p_SGFError, 1); |
|---|
| 749 |
PyErr_SetObject((PyObject *) SWIGTYPE_p_SGFError->clientdata, err); |
|---|
| 750 |
return NULL; |
|---|
| 751 |
} |
|---|
| 752 |
} |
|---|
| 753 |
resultobj = result ? PyString_FromString(result) : Py_BuildValue((char*)""); |
|---|
| 754 |
return resultobj; |
|---|
| 755 |
fail: |
|---|
| 756 |
return NULL; |
|---|
| 757 |
} |
|---|
| 758 |
|
|---|
| 759 |
|
|---|
| 760 |
static PyObject *_wrap_Node_previous_set(PyObject *self, PyObject *args) { |
|---|
| 761 |
PyObject *resultobj; |
|---|
| 762 |
Node *arg1 = (Node *) 0 ; |
|---|
| 763 |
Node *arg2 = (Node *) 0 ; |
|---|
| 764 |
PyObject * obj0 = 0 ; |
|---|
| 765 |
PyObject * obj1 = 0 ; |
|---|
| 766 |
|
|---|
| 767 |
if(!PyArg_ParseTuple(args,(char *)"OO:Node_previous_set",&obj0,&obj1)) goto fail; |
|---|
| 768 |
if ((SWIG_ConvertPtr(obj0,(void **) &arg1, SWIGTYPE_p_Node,SWIG_POINTER_EXCEPTION | 0 )) == -1) SWIG_fail; |
|---|
| 769 |
if ((SWIG_ConvertPtr(obj1,(void **) &arg2, SWIGTYPE_p_Node,SWIG_POINTER_EXCEPTION | SWIG_POINTER_DISOWN )) == -1) SWIG_fail; |
|---|
| 770 |
if (arg1) (arg1)->previous = arg2; |
|---|
| 771 |
|
|---|
| 772 |
Py_INCREF(Py_None); resultobj = Py_None; |
|---|
| 773 |
return resultobj; |
|---|
| 774 |
fail: |
|---|
| 775 |
return NULL; |
|---|
| 776 |
} |
|---|
| 777 |
|
|---|
| 778 |
|
|---|
| 779 |
static PyObject *_wrap_Node_previous_get(PyObject *self, PyObject *args) { |
|---|
| 780 |
PyObject *resultobj; |
|---|
| 781 |
Node *arg1 = (Node *) 0 ; |
|---|
| 782 |
Node *result; |
|---|
| 783 |
PyObject * obj0 = 0 ; |
|---|
| 784 |
|
|---|
| 785 |
if(!PyArg_ParseTuple(args,(char *)"O:Node_previous_get",&obj0)) goto fail; |
|---|
| 786 |
if ((SWIG_ConvertPtr(obj0,(void **) &arg1, SWIGTYPE_p_Node,SWIG_POINTER_EXCEPTION | 0 )) == -1) SWIG_fail; |
|---|
| 787 |
result = (Node *) ((arg1)->previous); |
|---|
| 788 |
|
|---|
| 789 |
resultobj = SWIG_NewPointerObj((void *) result, SWIGTYPE_p_Node, 0); |
|---|
| 790 |
return resultobj; |
|---|
| 791 |
fail: |
|---|
| 792 |
return NULL; |
|---|
| 793 |
} |
|---|
| 794 |
|
|---|
| 795 |
|
|---|
| 796 |
static PyObject *_wrap_Node_next_set(PyObject *self, PyObject *args) { |
|---|
| 797 |
PyObject *resultobj; |
|---|
| 798 |
Node *arg1 = (Node *) 0 ; |
|---|
| 799 |
Node *arg2 = (Node *) 0 ; |
|---|
| 800 |
PyObject * obj0 = 0 ; |
|---|
| 801 |
PyObject * obj1 = 0 ; |
|---|
| 802 |
|
|---|
| 803 |
if(!PyArg_ParseTuple(args,(char *)"OO:Node_next_set",&obj0,&obj1)) goto fail; |
|---|
| 804 |
if ((SWIG_ConvertPtr(obj0,(void **) &arg1, SWIGTYPE_p_Node,SWIG_POINTER_EXCEPTION | 0 )) == -1) SWIG_fail; |
|---|
| 805 |
if ((SWIG_ConvertPtr(obj1,(void **) &arg2, SWIGTYPE_p_Node,SWIG_POINTER_EXCEPTION | SWIG_POINTER_DISOWN )) == -1) SWIG_fail; |
|---|
| 806 |
if (arg1) (arg1)->next = arg2; |
|---|
| 807 |
|
|---|
| 808 |
Py_INCREF(Py_None); resultobj = Py_None; |
|---|
| 809 |
return resultobj; |
|---|
| 810 |
fail: |
|---|
| 811 |
return NULL; |
|---|
| 812 |
} |
|---|
| 813 |
|
|---|
| 814 |
|
|---|
| 815 |
static PyObject *_wrap_Node_next_get(PyObject *self, PyObject *args) { |
|---|
| 816 |
PyObject *resultobj; |
|---|
| 817 |
Node *arg1 = (Node *) 0 ; |
|---|
| 818 |
Node *result; |
|---|
| 819 |
PyObject * obj0 = 0 ; |
|---|
| 820 |
|
|---|
| 821 |
if(!PyArg_ParseTuple(args,(char *)"O:Node_next_get",&obj0)) goto fail; |
|---|
| 822 |
if ((SWIG_ConvertPtr(obj0,(void **) &arg1, SWIGTYPE_p_Node,SWIG_POINTER_EXCEPTION | 0 )) == -1) SWIG_fail; |
|---|
| 823 |
result = (Node *) ((arg1)->next); |
|---|
| 824 |
|
|---|
| 825 |
resultobj = SWIG_NewPointerObj((void *) result, SWIGTYPE_p_Node, 0); |
|---|
| 826 |
return resultobj; |
|---|
| 827 |
fail: |
|---|
| 828 |
return NULL; |
|---|
| 829 |
} |
|---|
| 830 |
|
|---|
| 831 |
|
|---|
| 832 |
static PyObject *_wrap_Node_up_set(PyObject *self, PyObject *args) { |
|---|
| 833 |
PyObject *resultobj; |
|---|
| 834 |
Node *arg1 = (Node *) 0 ; |
|---|
| 835 |
Node *arg2 = (Node *) 0 ; |
|---|
| 836 |
PyObject * obj0 = 0 ; |
|---|
| 837 |
PyObject * obj1 = 0 ; |
|---|
| 838 |
|
|---|
| 839 |
if(!PyArg_ParseTuple(args,(char *)"OO:Node_up_set",&obj0,&obj1)) goto fail; |
|---|
| 840 |
if ((SWIG_ConvertPtr(obj0,(void **) &arg1, SWIGTYPE_p_Node,SWIG_POINTER_EXCEPTION | 0 )) == -1) SWIG_fail; |
|---|
| 841 |
if ((SWIG_ConvertPtr(obj1,(void **) &arg2, SWIGTYPE_p_Node,SWIG_POINTER_EXCEPTION | SWIG_POINTER_DISOWN )) == -1) SWIG_fail; |
|---|
| 842 |
if (arg1) (arg1)->up = arg2; |
|---|
| 843 |
|
|---|
| 844 |
Py_INCREF(Py_None); resultobj = Py_None; |
|---|
| 845 |
return resultobj; |
|---|
| 846 |
fail: |
|---|
| 847 |
return NULL; |
|---|
| 848 |
} |
|---|
| 849 |
|
|---|
| 850 |
|
|---|
| 851 |
static PyObject *_wrap_Node_up_get(PyObject *self, PyObject *args) { |
|---|
| 852 |
PyObject *resultobj; |
|---|
| 853 |
Node *arg1 = (Node *) 0 ; |
|---|
| 854 |
Node *result; |
|---|
| 855 |
PyObject * obj0 = 0 ; |
|---|
| 856 |
|
|---|
| 857 |
if(!PyArg_ParseTuple(args,(char *)"O:Node_up_get",&obj0)) goto fail; |
|---|
| 858 |
if ((SWIG_ConvertPtr(obj0,(void **) &arg1, SWIGTYPE_p_Node,SWIG_POINTER_EXCEPTION | 0 )) == -1) SWIG_fail; |
|---|
| 859 |
result = (Node *) ((arg1)->up); |
|---|
| 860 |
|
|---|
| 861 |
resultobj = SWIG_NewPointerObj((void *) result, SWIGTYPE_p_Node, 0); |
|---|
| 862 |
return resultobj; |
|---|
| 863 |
fail: |
|---|
| 864 |
return NULL; |
|---|
| 865 |
} |
|---|
| 866 |
|
|---|
| 867 |
|
|---|
| 868 |
static PyObject *_wrap_Node_down_set(PyObject *self, PyObject *args) { |
|---|
| 869 |
PyObject *resultobj; |
|---|
| 870 |
Node *arg1 = (Node *) 0 ; |
|---|
| 871 |
Node *arg2 = (Node *) 0 ; |
|---|
| 872 |
PyObject * obj0 = 0 ; |
|---|
| 873 |
PyObject * obj1 = 0 ; |
|---|
| 874 |
|
|---|
| 875 |
if(!PyArg_ParseTuple(args,(char *)"OO:Node_down_set",&obj0,&obj1)) goto fail; |
|---|
| 876 |
if ((SWIG_ConvertPtr(obj0,(void **) &arg1, SWIGTYPE_p_Node,SWIG_POINTER_EXCEPTION | 0 )) == -1) SWIG_fail; |
|---|
| 877 |
if ((SWIG_ConvertPtr(obj1,(void **) &arg2, SWIGTYPE_p_Node,SWIG_POINTER_EXCEPTION | SWIG_POINTER_DISOWN )) == -1) SWIG_fail; |
|---|
| 878 |
if (arg1) (arg1)->down = arg2; |
|---|
| 879 |
|
|---|
| 880 |
Py_INCREF(Py_None); resultobj = Py_None; |
|---|
| 881 |
return resultobj; |
|---|
| 882 |
fail: |
|---|
| 883 |
return NULL; |
|---|
| 884 |
} |
|---|
| 885 |
|
|---|
| 886 |
|
|---|
| 887 |
static PyObject *_wrap_Node_down_get(PyObject *self, PyObject *args) { |
|---|
| 888 |
PyObject *resultobj; |
|---|
| 889 |
Node *arg1 = (Node *) 0 ; |
|---|
| 890 |
Node *result; |
|---|
| 891 |
PyObject * obj0 = 0 ; |
|---|
| 892 |
|
|---|
| 893 |
if(!PyArg_ParseTuple(args,(char *)"O:Node_down_get",&obj0)) goto fail; |
|---|
| 894 |
if ((SWIG_ConvertPtr(obj0,(void **) &arg1, SWIGTYPE_p_Node,SWIG_POINTER_EXCEPTION | 0 )) == -1) SWIG_fail; |
|---|
| 895 |
result = (Node *) ((arg1)->down); |
|---|
| 896 |
|
|---|
| 897 |
resultobj = SWIG_NewPointerObj((void *) result, SWIGTYPE_p_Node, 0); |
|---|
| 898 |
return resultobj; |
|---|
| 899 |
fail: |
|---|
| 900 |
return NULL; |
|---|
| 901 |
} |
|---|
| 902 |
|
|---|
| 903 |
|
|---|
| 904 |
static PyObject *_wrap_Node_numChildren_set(PyObject *self, PyObject *args) { |
|---|
| 905 |
PyObject *resultobj; |
|---|
| 906 |
Node *arg1 = (Node *) 0 ; |
|---|
| 907 |
int arg2 ; |
|---|
| 908 |
PyObject * obj0 = 0 ; |
|---|
| 909 |
|
|---|
| 910 |
if(!PyArg_ParseTuple(args,(char *)"Oi:Node_numChildren_set",&obj0,&arg2)) goto fail; |
|---|
| 911 |
if ((SWIG_ConvertPtr(obj0,(void **) &arg1, SWIGTYPE_p_Node,SWIG_POINTER_EXCEPTION | 0 )) == -1) SWIG_fail; |
|---|
| 912 |
if (arg1) (arg1)->numChildren = arg2; |
|---|
| 913 |
|
|---|
| 914 |
Py_INCREF(Py_None); resultobj = Py_None; |
|---|
| 915 |
return resultobj; |
|---|
| 916 |
fail: |
|---|
| 917 |
return NULL; |
|---|
| 918 |
} |
|---|
| 919 |
|
|---|
| 920 |
|
|---|
| 921 |
static PyObject *_wrap_Node_numChildren_get(PyObject *self, PyObject *args) { |
|---|
| 922 |
PyObject *resultobj; |
|---|
| 923 |
Node *arg1 = (Node *) 0 ; |
|---|
| 924 |
int result; |
|---|
| 925 |
PyObject * obj0 = 0 ; |
|---|
| 926 |
|
|---|
| 927 |
if(!PyArg_ParseTuple(args,(char *)"O:Node_numChildren_get",&obj0)) goto fail; |
|---|
| 928 |
if ((SWIG_ConvertPtr(obj0,(void **) &arg1, SWIGTYPE_p_Node,SWIG_POINTER_EXCEPTION | 0 )) == -1) SWIG_fail; |
|---|
| 929 |
result = (int) ((arg1)->numChildren); |
|---|
| 930 |
|
|---|
| 931 |
resultobj = PyInt_FromLong((long)result); |
|---|
| 932 |
return resultobj; |
|---|
| 933 |
fail: |
|---|
| 934 |
return NULL; |
|---|
| 935 |
} |
|---|
| 936 |
|
|---|
| 937 |
|
|---|
| 938 |
static PyObject *_wrap_Node_level_set(PyObject *self, PyObject *args) { |
|---|
|
|---|