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