]> git.saurik.com Git - wxWidgets.git/blob - wxPython/src/libpy.c
Committing in .
[wxWidgets.git] / wxPython / src / libpy.c
1 /* ----------------------------------------------------------------------------
2 * This file was automatically generated by SWIG (http://www.swig.org).
3 * Version 1.3.22
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
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
33 #define SWIG_PackData SWIG_Python_PackData
34 #define SWIG_UnpackData SWIG_Python_UnpackData
35
36
37 /***********************************************************************
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.
43 *
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.
50 ************************************************************************/
51
52 #include <string.h>
53
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
72 #else
73 # define SWIGEXPORT(a) a
74 # define SWIGIMPORT(a) a
75 #endif
76
77 #ifdef SWIG_GLOBAL
78 # define SWIGRUNTIME(a) SWIGEXPORT(a)
79 #else
80 # define SWIGRUNTIME(a) static a
81 #endif
82
83 #ifdef __cplusplus
84 extern "C" {
85 #endif
86
87 typedef void *(*swig_converter_func)(void *);
88 typedef struct swig_type_info *(*swig_dycast_func)(void **);
89
90 typedef struct swig_type_info {
91 const char *name;
92 swig_converter_func converter;
93 const char *str;
94 void *clientdata;
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
102 SWIGIMPORT(swig_type_info *) SWIG_TypeRegister(swig_type_info *);
103 SWIGIMPORT(swig_type_info *) SWIG_TypeCheck(char *c, swig_type_info *);
104 SWIGIMPORT(void *) SWIG_TypeCast(swig_type_info *, void *);
105 SWIGIMPORT(swig_type_info *) SWIG_TypeDynamicCast(swig_type_info *, void **);
106 SWIGIMPORT(const char *) SWIG_TypeName(const swig_type_info *);
107 SWIGIMPORT(swig_type_info *) SWIG_TypeQuery(const char *);
108 SWIGIMPORT(void) SWIG_TypeClientData(swig_type_info *, void *);
109 SWIGIMPORT(char *) SWIG_PackData(char *, void *, int);
110 SWIGIMPORT(char *) SWIG_UnpackData(char *, void *, int);
111
112 #else
113
114 static swig_type_info *swig_type_list = 0;
115
116 /* Register a type mapping with the type-checking */
117 SWIGRUNTIME(swig_type_info *)
118 SWIG_TypeRegister(swig_type_info *ti) {
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 */
125 if (tc->clientdata) ti->clientdata = tc->clientdata;
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 */
140 l1:
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 }
150 if (next) next->prev = head;
151 head->next = next;
152 return ret;
153 }
154
155 /* Check the typename */
156 SWIGRUNTIME(swig_type_info *)
157 SWIG_TypeCheck(char *c, swig_type_info *ty) {
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) {
167 s->next->prev = s->prev;
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;
173 s->prev = ty;
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 */
182 SWIGRUNTIME(void *)
183 SWIG_TypeCast(swig_type_info *ty, void *ptr) {
184 if ((!ty) || (!ty->converter)) return ptr;
185 return (*ty->converter)(ptr);
186 }
187
188 /* Dynamic pointer casting. Down an inheritance hierarchy */
189 SWIGRUNTIME(swig_type_info *)
190 SWIG_TypeDynamicCast(swig_type_info *ty, void **ptr) {
191 swig_type_info *lastty = ty;
192 if (!ty || !ty->dcast) return ty;
193 while (ty && (ty->dcast)) {
194 ty = (*ty->dcast)(ptr);
195 if (ty) lastty = ty;
196 }
197 return lastty;
198 }
199
200 /* Return the name associated with this type */
201 SWIGRUNTIME(const char *)
202 SWIG_TypeName(const swig_type_info *ty) {
203 return ty->name;
204 }
205
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 */
213 static int
214 SWIG_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 */
227 static int
228 SWIG_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
243 /* Search for a swig_type_info structure */
244 SWIGRUNTIME(swig_type_info *)
245 SWIG_TypeQuery(const char *name) {
246 swig_type_info *ty = swig_type_list;
247 while (ty) {
248 if (ty->str && (SWIG_TypeEquiv(ty->str,name))) return ty;
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 */
256 SWIGRUNTIME(void)
257 SWIG_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) {
266 if ((strcmp(tc->name, equiv->name) == 0))
267 SWIG_TypeClientData(tc,clientdata);
268 tc = tc->prev;
269 }
270 }
271 equiv = equiv->next;
272 }
273 }
274
275 /* Pack binary data into a string */
276 SWIGRUNTIME(char *)
277 SWIG_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 */
291 SWIGRUNTIME(char *)
292 SWIG_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
313 #endif
314
315 #ifdef __cplusplus
316 }
317 #endif
318
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
329 #include "Python.h"
330
331 #ifdef __cplusplus
332 extern "C" {
333 #endif
334
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 */
350 typedef 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)
366
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)
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
379 typedef double (*py_objasdbl_conv)(PyObject *obj);
380
381 #ifdef SWIG_NOINCLUDE
382
383 SWIGIMPORT(int) SWIG_Python_ConvertPtr(PyObject *, void **, swig_type_info *, int);
384 SWIGIMPORT(PyObject *) SWIG_Python_NewPointerObj(void *, swig_type_info *,int own);
385 SWIGIMPORT(void *) SWIG_Python_MustGetPtr(PyObject *, swig_type_info *, int, int);
386 SWIGIMPORT(PyObject *) SWIG_Python_newvarlink(void);
387 SWIGIMPORT(void) SWIG_Python_addvarlink(PyObject *, char *, PyObject *(*)(void), int (*)(PyObject *));
388 SWIGIMPORT(int) SWIG_Python_ConvertPacked(PyObject *, void *, int sz, swig_type_info *, int);
389 SWIGIMPORT(PyObject *) SWIG_Python_NewPackedObj(void *, int sz, swig_type_info *);
390 SWIGIMPORT(void) SWIG_Python_InstallConstants(PyObject *d, swig_const_info constants[]);
391
392
393 #else
394
395
396 /* -----------------------------------------------------------------------------
397 * global variable support code.
398 * ----------------------------------------------------------------------------- */
399
400 typedef 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;
405 } swig_globalvar;
406
407 typedef struct swig_varlinkobject {
408 PyObject_HEAD
409 swig_globalvar *vars;
410 } swig_varlinkobject;
411
412 static PyObject *
413 swig_varlink_repr(swig_varlinkobject *v) {
414 v = v;
415 return PyString_FromString("<Global variables>");
416 }
417
418 static int
419 swig_varlink_print(swig_varlinkobject *v, FILE *fp, int flags) {
420 swig_globalvar *var;
421 flags = flags;
422 fprintf(fp,"Global variables { ");
423 for (var = v->vars; var; var=var->next) {
424 fprintf(fp,"%s", var->name);
425 if (var->next) fprintf(fp,", ");
426 }
427 fprintf(fp," }\n");
428 return 0;
429 }
430
431 static PyObject *
432 swig_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)();
437 }
438 var = var->next;
439 }
440 PyErr_SetString(PyExc_NameError,"Unknown C global variable");
441 return NULL;
442 }
443
444 static int
445 swig_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);
450 }
451 var = var->next;
452 }
453 PyErr_SetString(PyExc_NameError,"Unknown C global variable");
454 return 1;
455 }
456
457 statichere PyTypeObject varlinktype = {
458 PyObject_HEAD_INIT(0)
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 */
469 0, /* tp_as_number */
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 */
504 };
505
506 /* Create a variable linking object for use later */
507 SWIGRUNTIME(PyObject *)
508 SWIG_Python_newvarlink(void) {
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;
513 result->vars = 0;
514 result->ob_refcnt = 0;
515 Py_XINCREF((PyObject *) result);
516 return ((PyObject*) result);
517 }
518
519 SWIGRUNTIME(void)
520 SWIG_Python_addvarlink(PyObject *p, char *name, PyObject *(*get_attr)(void), int (*set_attr)(PyObject *p)) {
521 swig_varlinkobject *v;
522 swig_globalvar *gv;
523 v= (swig_varlinkobject *) p;
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;
531 }
532
533 /* Convert a pointer value */
534 SWIGRUNTIME(int)
535 SWIG_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;
546 }
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;
587 }
588 }
589 c++;
590 c = SWIG_UnpackData(c,ptr,sizeof(void *));
591 if (newref) { Py_DECREF(obj); }
592 #endif
593
594 #ifdef SWIG_COBJECT_TYPES
595 cobject:
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);
602 }
603
604 if ((pyobj) && (flags & SWIG_POINTER_DISOWN)) {
605 PyObject *zero = PyInt_FromLong(0);
606 PyObject_SetAttrString(pyobj,(char*)"thisown",zero);
607 Py_DECREF(zero);
608 }
609 return 0;
610
611 type_error:
612 if (flags & SWIG_POINTER_EXCEPTION) {
613 if (ty && c) {
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);
618 } else {
619 PyErr_SetString(PyExc_TypeError,"Expected a pointer");
620 }
621 }
622 return -1;
623 }
624
625 /* Convert a pointer value, signal an exception on a type mismatch */
626 SWIGRUNTIME(void *)
627 SWIG_Python_MustGetPtr(PyObject *obj, swig_type_info *ty, int argnum, int flags) {
628 void *result;
629 SWIG_Python_ConvertPtr(obj, &result, ty, flags | SWIG_POINTER_EXCEPTION);
630 return result;
631 }
632
633 /* Convert a packed value value */
634 SWIGRUNTIME(int)
635 SWIG_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);
641 /* Pointer values must start with leading underscore */
642 if (*c != '_') goto type_error;
643 c++;
644 c = SWIG_UnpackData(c,ptr,sz);
645 if (ty) {
646 tc = SWIG_TypeCheck(c,ty);
647 if (!tc) goto type_error;
648 }
649 return 0;
650
651 type_error:
652
653 if (flags) {
654 if (ty && c) {
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);
659 } else {
660 PyErr_SetString(PyExc_TypeError,"Expected a pointer");
661 }
662 }
663 return -1;
664 }
665
666 /* Create a new pointer object */
667 SWIGRUNTIME(PyObject *)
668 SWIG_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;
673 }
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);
698 }
699 robj = inst;
700 }
701 }
702 return robj;
703 }
704
705 SWIGRUNTIME(PyObject *)
706 SWIG_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 }
715
716 /* Install Constants */
717 SWIGRUNTIME(void)
718 SWIG_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:
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 }
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 }
751 }
752 }
753
754 #endif
755
756 /* Contract support */
757
758 #define SWIG_contract_assert(expr, msg) if (!(expr)) { PyErr_SetString(PyExc_RuntimeError, (char *) msg ); goto fail; } else
759
760 #ifdef __cplusplus
761 }
762 #endif
763
764
765 /* -------- TYPES TABLE (BEGIN) -------- */
766
767 #define SWIGTYPE_p_char swig_types[0]
768 static swig_type_info *swig_types[2];
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"
779
780 /* Auxiliar swig macros */
781
782 #ifdef __cplusplus
783 #define SWIGSTATICINLINE(a) static inline a
784 #define SWIGSTATIC(a) static a
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)
790
791 #ifdef HAVE_NUMERIC_CAST
792 #define swig_numeric_cast(type,a) numeric_cast<type>(a)
793 #else
794 #define swig_numeric_cast(type,a) static_cast<type>(a)
795 #endif
796
797 #else /* C case */
798
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
821
822 #ifdef __cplusplus
823 extern "C" {
824 #endif
825 static PyMethodDef SwigMethods[] = {
826 { NULL, NULL }
827 };
828
829
830 /* -------- TYPE CONVERSION AND EQUIVALENCE RULES (BEGIN) -------- */
831
832 static 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}};
833
834 static swig_type_info *swig_types_initial[] = {
835 _swigt__p_char,
836 0
837 };
838
839
840 /* -------- TYPE CONVERSION AND EQUIVALENCE RULES (END) -------- */
841
842 static swig_const_info swig_const_table[] = {
843 {0}};
844
845 #ifdef __cplusplus
846 }
847 #endif
848
849 #ifdef __cplusplus
850 extern "C"
851 #endif
852 SWIGEXPORT(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