root/swish-python/swish_wrap.c

Revision 1677, 92.5 kB (checked in by augur, 3 years ago)

Initial revision

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
Line 
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 #include "Python.h"
14
15 /*************************************************************** -*- c -*-
16  * python/precommon.swg
17  *
18  * Rename all exported symbols from common.swg, to avoid symbol
19  * clashes if multiple interpreters are included
20  *
21  ************************************************************************/
22
23 #define SWIG_TypeRegister    SWIG_Python_TypeRegister
24 #define SWIG_TypeCheck       SWIG_Python_TypeCheck
25 #define SWIG_TypeCast        SWIG_Python_TypeCast
26 #define SWIG_TypeDynamicCast SWIG_Python_TypeDynamicCast
27 #define SWIG_TypeName        SWIG_Python_TypeName
28 #define SWIG_TypePrettyName  SWIG_Python_TypePrettyName
29 #define SWIG_TypeQuery       SWIG_Python_TypeQuery
30 #define SWIG_TypeClientData  SWIG_Python_TypeClientData
31 #define SWIG_PackData        SWIG_Python_PackData
32 #define SWIG_UnpackData      SWIG_Python_UnpackData
33
34
35 /***********************************************************************
36  * common.swg
37  *
38  *     This file contains generic SWIG runtime support for pointer
39  *     type checking as well as a few commonly used macros to control
40  *     external linkage.
41  *
42  * Author : David Beazley (beazley@cs.uchicago.edu)
43  *
44  * Copyright (c) 1999-2000, The University of Chicago
45  *
46  * This file may be freely redistributed without license or fee provided
47  * this copyright message remains intact.
48  ************************************************************************/
49
50 #include <string.h>
51
52 #if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__)
53 if defined(_MSC_VER) || defined(__GNUC__)
54 #    if defined(STATIC_LINKED)
55 #      define SWIGEXPORT(a) a
56 #      define SWIGIMPORT(a) extern a
57 #    else
58 #      define SWIGEXPORT(a) __declspec(dllexport) a
59 #      define SWIGIMPORT(a) extern a
60 #    endif
61 else
62 #    if defined(__BORLANDC__)
63 #      define SWIGEXPORT(a) a _export
64 #      define SWIGIMPORT(a) a _export
65 #    else
66 #      define SWIGEXPORT(a) a
67 #      define SWIGIMPORT(a) a
68 #    endif
69 endif
70 #else
71 define SWIGEXPORT(a) a
72 define SWIGIMPORT(a) a
73 #endif
74
75 #ifdef SWIG_GLOBAL
76 define SWIGRUNTIME(a) SWIGEXPORT(a)
77 #else
78 define SWIGRUNTIME(a) static a
79 #endif
80
81 #ifdef __cplusplus
82 extern "C" {
83 #endif
84
85 typedef void *(*swig_converter_func)(void *);
86 typedef struct swig_type_info *(*swig_dycast_func)(void **);
87
88 typedef struct swig_type_info {
89   const char             *name;
90   swig_converter_func     converter;
91   const char             *str;
92   void                   *clientdata;
93   swig_dycast_func        dcast;
94   struct swig_type_info  *next;
95   struct swig_type_info  *prev;
96 } swig_type_info;
97
98 #ifdef SWIG_NOINCLUDE
99
100 SWIGIMPORT(swig_type_info *) SWIG_TypeRegister(swig_type_info *);
101 SWIGIMPORT(swig_type_info *) SWIG_TypeCheck(char *c, swig_type_info *);
102 SWIGIMPORT(void *)           SWIG_TypeCast(swig_type_info *, void *);
103 SWIGIMPORT(swig_type_info *) SWIG_TypeDynamicCast(swig_type_info *, void **);
104 SWIGIMPORT(const char *)     SWIG_TypeName(const swig_type_info *);
105 SWIGIMPORT(const char *)     SWIG_TypePrettyName(const swig_type_info *);
106 SWIGIMPORT(swig_type_info *) SWIG_TypeQuery(const char *);
107 SWIGIMPORT(void) SWIG_TypeClientData(swig_type_info *, void *);
108 SWIGIMPORT(char *)           SWIG_PackData(char *, void *, int);
109 SWIGIMPORT(char *)           SWIG_UnpackData(char *, void *, int);
110
111 #else
112
113 static swig_type_info *swig_type_list = 0;
114 static swig_type_info **swig_type_list_handle = &swig_type_list;
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_handle;
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_handle;
137   *swig_type_list_handle = 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 /* Return the pretty name associated with this type,
207    that is an unmangled type name in a form presentable to the user.
208 */
209 SWIGRUNTIME(const char *)
210 SWIG_TypePrettyName(const swig_type_info *type) {
211   /* The "str" field contains the equivalent pretty names of the
212      type, separated by vertical-bar characters.  We choose
213      to print the last name, as it is often (?) the most
214      specific. */
215   if (type->str != NULL) {
216     const char *last_name = type->str;
217     const char *s;
218     for (s = type->str; *s; s++)
219       if (*s == '|') last_name = s+1;
220     return last_name;
221   }
222   else
223     return type->name;
224 }
225
226 /*
227    Compare two type names skipping the space characters, therefore
228    "char*" == "char *" and "Class<int>" == "Class<int >", etc.
229
230    Return 0 when the two name types are equivalent, as in
231    strncmp, but skipping ' '.
232 */
233 static int
234 SWIG_TypeNameComp(const char *f1, const char *l1,
235                   const char *f2, const char *l2) {
236   for (;(f1 != l1) && (f2 != l2); ++f1, ++f2) {
237     while ((*f1 == ' ') && (f1 != l1)) ++f1;
238     while ((*f2 == ' ') && (f2 != l2)) ++f2;
239     if (*f1 != *f2) return *f1 - *f2;
240   }
241   return (l1 - f1) - (l2 - f2);
242 }
243
244 /*
245   Check type equivalence in a name list like <name1>|<name2>|...
246 */
247 static int
248 SWIG_TypeEquiv(const char *nb, const char *tb) {
249   int equiv = 0;
250   const char* te = tb + strlen(tb);
251   const char* ne = nb;
252   while (!equiv && *ne) {
253     for (nb = ne; *ne; ++ne) {
254       if (*ne == '|') break;
255     }
256     equiv = SWIG_TypeNameComp(nb, ne, tb, te) == 0;
257     if (*ne) ++ne;
258   }
259   return equiv;
260 }
261  
262
263 /* Search for a swig_type_info structure */
264 SWIGRUNTIME(swig_type_info *)
265 SWIG_TypeQuery(const char *name) {
266   swig_type_info *ty = *swig_type_list_handle;
267   while (ty) {
268     if (ty->str && (SWIG_TypeEquiv(ty->str,name))) return ty;
269     if (ty->name && (strcmp(name,ty->name) == 0)) return ty;
270     ty = ty->prev;
271   }
272   return 0;
273 }
274
275 /* Set the clientdata field for a type */
276 SWIGRUNTIME(void)
277 SWIG_TypeClientData(swig_type_info *ti, void *clientdata) {
278   swig_type_info *tc, *equiv;
279   if (ti->clientdata == clientdata) return;
280   ti->clientdata = clientdata;
281   equiv = ti->next;
282   while (equiv) {
283     if (!equiv->converter) {
284       tc = *swig_type_list_handle;
285       while (tc) {
286         if ((strcmp(tc->name, equiv->name) == 0))
287           SWIG_TypeClientData(tc,clientdata);
288         tc = tc->prev;
289       }
290     }
291     equiv = equiv->next;
292   }
293 }
294
295 /* Pack binary data into a string */
296 SWIGRUNTIME(char *)
297 SWIG_PackData(char *c, void *ptr, int sz) {
298   static char hex[17] = "0123456789abcdef";
299   unsigned char *u = (unsigned char *) ptr;
300   const unsigned char *eu =  u + sz;
301   register unsigned char uu;
302   for (; u != eu; ++u) {
303     uu = *u;
304     *(c++) = hex[(uu & 0xf0) >> 4];
305     *(c++) = hex[uu & 0xf];
306   }
307   return c;
308 }
309
310 /* Unpack binary data from a string */
311 SWIGRUNTIME(char *)
312 SWIG_UnpackData(char *c, void *ptr, int sz) {
313   register unsigned char uu = 0;
314   register int d;
315   unsigned char *u = (unsigned char *) ptr;
316   const unsigned char *eu =  u + sz;
317   for (; u != eu; ++u) {
318     d = *(c++);
319     if ((d >= '0') && (d <= '9'))
320       uu = ((d - '0') << 4);
321     else if ((d >= 'a') && (d <= 'f'))
322       uu = ((d - ('a'-10)) << 4);
323     d = *(c++);
324     if ((d >= '0') && (d <= '9'))
325       uu |= (d - '0');
326     else if ((d >= 'a') && (d <= 'f'))
327       uu |= (d - ('a'-10));
328     *u = uu;
329   }
330   return c;
331 }
332
333 #endif
334
335 #ifdef __cplusplus
336 }
337 #endif
338
339 /***********************************************************************
340  * pyrun.swg
341  *
342  *     This file contains the runtime support for Python modules
343  *     and includes code for managing global variables and pointer
344  *     type checking.
345  *
346  * Author : David Beazley (beazley@cs.uchicago.edu)
347  ************************************************************************/
348
349 #ifdef __cplusplus
350 extern "C" {
351 #endif
352
353 #define SWIG_PY_INT     1
354 #define SWIG_PY_FLOAT   2
355 #define SWIG_PY_STRING  3
356 #define SWIG_PY_POINTER 4
357 #define SWIG_PY_BINARY  5
358
359 /* Flags for pointer conversion */
360
361 #define SWIG_POINTER_EXCEPTION     0x1
362 #define SWIG_POINTER_DISOWN        0x2
363
364 /* Exception handling in wrappers */
365 #define SWIG_fail   goto fail
366
367 /* Constant information structure */
368 typedef struct swig_const_info {
369     int type;
370     char *name;
371     long lvalue;
372     double dvalue;
373     void   *pvalue;
374     swig_type_info **ptype;
375 } swig_const_info;
376
377 /* Common SWIG API */
378 #define SWIG_ConvertPtr(obj, pp, type, flags) \
379   SWIG_Python_ConvertPtr(obj, pp, type, flags)
380 #define SWIG_NewPointerObj(p, type, flags) \
381   SWIG_Python_NewPointerObj(p, type, flags)
382 #define SWIG_MustGetPtr(p, type, argnum, flags) \
383   SWIG_Python_MustGetPtr(p, type, argnum, flags)
384  
385 /* Python-specific SWIG API */
386 #define SWIG_newvarlink() \
387   SWIG_Python_newvarlink()
388 #define SWIG_addvarlink(p, name, get_attr, set_attr) \
389   SWIG_Python_addvarlink(p, name, get_attr, set_attr)
390 #define SWIG_ConvertPacked(obj, ptr, sz, ty, flags) \
391   SWIG_Python_ConvertPacked(obj, ptr, sz, ty, flags)
392 #define SWIG_NewPackedObj(ptr, sz, type) \
393   SWIG_Python_NewPackedObj(ptr, sz, type)
394 #define SWIG_InstallConstants(d, constants) \
395   SWIG_Python_InstallConstants(d, constants)
396
397 typedef double (*py_objasdbl_conv)(PyObject *obj);
398
399 #ifdef SWIG_NOINCLUDE
400
401 SWIGIMPORT(int) SWIG_Python_ConvertPtr(PyObject *, void **, swig_type_info *, int);
402 SWIGIMPORT(PyObject *) SWIG_Python_NewPointerObj(void *, swig_type_info *,int own);
403 SWIGIMPORT(void *)            SWIG_Python_MustGetPtr(PyObject *, swig_type_info *, int, int);
404 SWIGIMPORT(PyObject *)        SWIG_Python_newvarlink(void);
405 SWIGIMPORT(void) SWIG_Python_addvarlink(PyObject *, char *, PyObject *(*)(void), int (*)(PyObject *));
406 SWIGIMPORT(int) SWIG_Python_ConvertPacked(PyObject *, void *, int sz, swig_type_info *, int);
407 SWIGIMPORT(PyObject *) SWIG_Python_NewPackedObj(void *, int sz, swig_type_info *);
408 SWIGIMPORT(void)              SWIG_Python_InstallConstants(PyObject *d, swig_const_info constants[]);
409
410
411 #else
412
413
414 /* -----------------------------------------------------------------------------
415  * global variable support code.
416  * ----------------------------------------------------------------------------- */
417
418 typedef struct swig_globalvar {   
419   char       *name;                  /* Name of global variable */
420   PyObject *(*get_attr)(void);       /* Return the current value */
421   int       (*set_attr)(PyObject *); /* Set the value */
422   struct swig_globalvar *next;
423 } swig_globalvar;
424
425 typedef struct swig_varlinkobject {
426   PyObject_HEAD
427   swig_globalvar *vars;
428 } swig_varlinkobject;
429
430 static PyObject *
431 swig_varlink_repr(swig_varlinkobject *v) {
432   v = v;
433   return PyString_FromString("<Global variables>");
434 }
435
436 static int
437 swig_varlink_print(swig_varlinkobject *v, FILE *fp, int flags) {
438   swig_globalvar  *var;
439   flags = flags;
440   fprintf(fp,"Global variables { ");
441   for (var = v->vars; var; var=var->next) {
442     fprintf(fp,"%s", var->name);
443     if (var->next) fprintf(fp,", ");
444   }
445   fprintf(fp," }\n");
446   return 0;
447 }
448
449 static PyObject *
450 swig_varlink_getattr(swig_varlinkobject *v, char *n) {
451   swig_globalvar *var = v->vars;
452   while (var) {
453     if (strcmp(var->name,n) == 0) {
454       return (*var->get_attr)();
455     }
456     var = var->next;
457   }
458   PyErr_SetString(PyExc_NameError,"Unknown C global variable");
459   return NULL;
460 }
461
462 static int
463 swig_varlink_setattr(swig_varlinkobject *v, char *n, PyObject *p) {
464   swig_globalvar *var = v->vars;
465   while (var) {
466     if (strcmp(var->name,n) == 0) {
467       return (*var->set_attr)(p);
468     }
469     var = var->next;
470   }
471   PyErr_SetString(PyExc_NameError,"Unknown C global variable");
472   return 1;
473 }
474
475 statichere PyTypeObject varlinktype = {
476   PyObject_HEAD_INIT(0)             
477   0,                                  /* Number of items in variable part (ob_size) */
478   (char *)"swigvarlink",              /* Type name (tp_name) */
479   sizeof(swig_varlinkobject),         /* Basic size (tp_basicsize) */
480   0,                                  /* Itemsize (tp_itemsize) */
481   0,                                  /* Deallocator (tp_dealloc) */
482   (printfunc) swig_varlink_print,     /* Print (tp_print) */
483   (getattrfunc) swig_varlink_getattr, /* get attr (tp_getattr) */
484   (setattrfunc) swig_varlink_setattr, /* Set attr (tp_setattr) */
485   0,                                  /* tp_compare */
486   (reprfunc) swig_varlink_repr,       /* tp_repr */
487   0,                                  /* tp_as_number */
488   0,                                  /* tp_as_sequence */
489   0,                                  /* tp_as_mapping */
490   0,                                  /* tp_hash */
491   0,                                  /* tp_call */
492   0,                                  /* tp_str */
493   0,                                  /* tp_getattro */
494   0,                                  /* tp_setattro */
495   0,                                  /* tp_as_buffer */
496   0,                                  /* tp_flags */
497   0,                                  /* tp_doc */
498   0,                                  /* tp_traverse */
499   0,                                  /* tp_clear */
500   0,                                  /* tp_richcompare */
501   0,                                  /* tp_weaklistoffset */
502 #if PY_VERSION_HEX >= 0x02020000
503   0,                                  /* tp_iter */
504   0,                                  /* tp_iternext */
505   0,                                  /* tp_methods */
506   0,                                  /* tp_members */
507   0,                                  /* tp_getset */
508   0,                                  /* tp_base */
509   0,                                  /* tp_dict */
510   0,                                  /* tp_descr_get */
511   0,                                  /* tp_descr_set */
512   0,                                  /* tp_dictoffset */
513   0,                                  /* tp_init */
514   0,                                  /* tp_alloc */
515   0,                                  /* tp_new */
516   0,                                  /* tp_free */
517   0,                                  /* tp_is_gc */
518   0,                                  /* tp_bases */
519   0,                                  /* tp_mro */
520   0,                                  /* tp_cache */
521   0,                                  /* tp_subclasses */
522   0,                                  /* tp_weaklist */
523 #endif
524 #if PY_VERSION_HEX >= 0x02030200
525   0,                                  /* tp_del */
526 #endif
527 #ifdef COUNT_ALLOCS
528   /* these must be last */
529   0,                                  /* tp_alloc */
530   0,                                  /* tp_free */
531   0,                                  /* tp_maxalloc */
532   0,                                  /*  tp_next */
533 #endif
534 };
535
536 /* Create a variable linking object for use later */
537 SWIGRUNTIME(PyObject *)
538 SWIG_Python_newvarlink(void) {
539   swig_varlinkobject *result = 0;
540   result = PyMem_NEW(swig_varlinkobject,1);
541   varlinktype.ob_type = &PyType_Type;    /* Patch varlinktype into a PyType */
542   result->ob_type = &varlinktype;
543   result->vars = 0;
544   result->ob_refcnt = 0;
545   Py_XINCREF((PyObject *) result);
546   return ((PyObject*) result);
547 }
548
549 SWIGRUNTIME(void)
550 SWIG_Python_addvarlink(PyObject *p, char *name, PyObject *(*get_attr)(void), int (*set_attr)(PyObject *p)) {
551   swig_varlinkobject *v;
552   swig_globalvar *gv;
553   v= (swig_varlinkobject *) p;
554   gv = (swig_globalvar *) malloc(sizeof(swig_globalvar));
555   gv->name = (char *) malloc(strlen(name)+1);
556   strcpy(gv->name,name);
557   gv->get_attr = get_attr;
558   gv->set_attr = set_attr;
559   gv->next = v->vars;
560   v->vars = gv;
561 }
562
563 /* Convert a pointer value */
564 SWIGRUNTIME(int)
565 SWIG_Python_ConvertPtr(PyObject *obj, void **ptr, swig_type_info *ty, int flags) {
566   swig_type_info *tc;
567   char  *c = 0;
568   static PyObject *SWIG_this = 0;
569   int    newref = 0;
570   PyObject  *pyobj = 0;
571
572   if (!obj) return 0;
573   if (obj == Py_None) {
574     *ptr = 0;
575     return 0;
576   }
577 #ifdef SWIG_COBJECT_TYPES
578   if (!(PyCObject_Check(obj))) {
579     if (!SWIG_this)
580       SWIG_this = PyString_FromString("this");
581     pyobj = obj;
582     obj = PyObject_GetAttr(obj,SWIG_this);
583     newref = 1;
584     if (!obj) goto type_error;
585     if (!PyCObject_Check(obj)) {
586       Py_DECREF(obj);
587       goto type_error;
588     }
589   } 
590   *ptr = PyCObject_AsVoidPtr(obj);
591   c = (char *) PyCObject_GetDesc(obj);
592   if (newref) Py_DECREF(obj);
593   goto cobject;
594 #else
595   if (!(PyString_Check(obj))) {
596     if (!SWIG_this)
597       SWIG_this = PyString_FromString("this");
598     pyobj = obj;
599     obj = PyObject_GetAttr(obj,SWIG_this);
600     newref = 1;
601     if (!obj) goto type_error;
602     if (!PyString_Check(obj)) {
603       Py_DECREF(obj);
604       goto type_error;
605     }
606   }
607   c = PyString_AS_STRING(obj);
608   /* Pointer values must start with leading underscore */
609   if (*c != '_') {
610     *ptr = (void *) 0;
611     if (strcmp(c,"NULL") == 0) {
612       if (newref) { Py_DECREF(obj); }
613       return 0;
614     } else {
615       if (newref) { Py_DECREF(obj); }
616       goto type_error;
617     }
618   }
619   c++;
620   c = SWIG_UnpackData(c,ptr,sizeof(void *));
621   if (newref) { Py_DECREF(obj); }
622 #endif
623
624 #ifdef SWIG_COBJECT_TYPES
625 cobject:
626 #endif
627
628   if (ty) {
629     tc = SWIG_TypeCheck(c,ty);
630     if (!tc) goto type_error;
631     *ptr = SWIG_TypeCast(tc,(void*) *ptr);
632   }
633
634   if ((pyobj) && (flags & SWIG_POINTER_DISOWN)) {
635     PyObject_SetAttrString(pyobj,(char*)"thisown",Py_False);
636   }
637   return 0;
638
639 type_error:
640   PyErr_Clear();
641   if (flags & SWIG_POINTER_EXCEPTION) {
642     if (ty && c) {
643       PyErr_Format(PyExc_TypeError,
644                    "Type error. Got %s, expected %s",
645                    c, ty->name);
646     } else {
647       PyErr_SetString(PyExc_TypeError,"Expected a pointer");
648     }
649   }
650   return -1;
651 }
652
653 /* Convert a pointer value, signal an exception on a type mismatch */
654 SWIGRUNTIME(void *)
655 SWIG_Python_MustGetPtr(PyObject *obj, swig_type_info *ty, int argnum, int flags) {
656   void *result;
657   SWIG_Python_ConvertPtr(obj, &result, ty, flags | SWIG_POINTER_EXCEPTION);
658   return result;
659 }
660
661 /* Convert a packed value value */
662 SWIGRUNTIME(int)
663 SWIG_Python_ConvertPacked(PyObject *obj, void *ptr, int sz, swig_type_info *ty, int flags) {
664   swig_type_info *tc;
665   char  *c = 0;
666
667   if ((!obj) || (!PyString_Check(obj))) goto type_error;
668   c = PyString_AS_STRING(obj);
669   /* Pointer values must start with leading underscore */
670   if (*c != '_') goto type_error;
671   c++;
672   c = SWIG_UnpackData(c,ptr,sz);
673   if (ty) {
674     tc = SWIG_TypeCheck(c,ty);
675     if (!tc) goto type_error;
676   }
677   return 0;
678
679 type_error:
680
681   if (flags) {
682     if (ty && c) {
683       PyErr_Format(PyExc_TypeError,
684                    "Type error. Got %s, expected %s",
685                    c, ty->name);
686     } else {
687       PyErr_SetString(PyExc_TypeError,"Expected a pointer");
688     }
689   }
690   return -1;
691 }
692
693 /* Create a new pointer object */
694 SWIGRUNTIME(PyObject *)
695 SWIG_Python_NewPointerObj(void *ptr, swig_type_info *type, int own) {
696   PyObject *robj;
697   if (!ptr) {
698     Py_INCREF(Py_None);
699     return Py_None;
700   }
701 #ifdef SWIG_COBJECT_TYPES
702   robj = PyCObject_FromVoidPtrAndDesc((void *) ptr, (char *) type->name, NULL);
703 #else
704   {
705     char result[1024];
706     char *r = result;
707     *(r++) = '_';
708     r = SWIG_PackData(r,&ptr,sizeof(void *));
709     strcpy(r,type->name);
710     robj = PyString_FromString(result);
711   }
712 #endif
713   if (!robj || (robj == Py_None)) return robj;
714   if (type->clientdata) {
715     PyObject *inst;
716     PyObject *args = Py_BuildValue((char*)"(O)", robj);
717     Py_DECREF(robj);
718     inst = PyObject_CallObject((PyObject *) type->clientdata, args);
719     Py_DECREF(args);
720     if (inst) {
721       if (own) {
722         PyObject_SetAttrString(inst,(char*)"thisown",Py_True);
723       }
724       robj = inst;
725     }
726   }
727   return robj;
728 }
729
730 SWIGRUNTIME(PyObject *)
731 SWIG_Python_NewPackedObj(void *ptr, int sz, swig_type_info *type) {
732   char result[1024];
733   char *r = result;
734   if ((2*sz + 1 + strlen(type->name)) > 1000) return 0;
735   *(r++) = '_';
736   r = SWIG_PackData(r,ptr,sz);
737   strcpy(r,type->name);
738   return PyString_FromString(result);
739 }
740
741 /* Install Constants */
742 SWIGRUNTIME(void)
743 SWIG_Python_InstallConstants(PyObject *d, swig_const_info constants[]) {
744   int i;
745   PyObject *obj;
746   for (i = 0; constants[i].type; i++) {
747     switch(constants[i].type) {
748     case SWIG_PY_INT:
749       obj = PyInt_FromLong(constants[i].lvalue);
750       break;
751     case SWIG_PY_FLOAT:
752       obj = PyFloat_FromDouble(constants[i].dvalue);
753       break;
754     case SWIG_PY_STRING:
755       if (constants[i].pvalue) {
756         obj = PyString_FromString((char *) constants[i].pvalue);
757       } else {
758         Py_INCREF(Py_None);
759         obj = Py_None;
760       }
761       break;
762     case SWIG_PY_POINTER:
763       obj = SWIG_NewPointerObj(constants[i].pvalue, *(constants[i]).ptype,0);
764       break;
765     case SWIG_PY_BINARY:
766       obj = SWIG_NewPackedObj(constants[i].pvalue, constants[i].lvalue, *(constants[i].ptype));
767       break;
768     default:
769       obj = 0;
770       break;
771     }
772     if (obj) {
773       PyDict_SetItemString(d,constants[i].name,obj);
774       Py_DECREF(obj);
775     }
776   }
777 }
778
779 #endif
780
781 /* Contract support */
782
783 #define SWIG_contract_assert(expr, msg) if (!(expr)) { PyErr_SetString(PyExc_RuntimeError, (char *) msg ); goto fail; } else
784
785 #ifdef __cplusplus
786 }
787 #endif
788
789
790 /* -------- TYPES TABLE (BEGIN) -------- */
791
792 #define  SWIGTYPE_SW_SEARCH swig_types[0]
793 #define  SWIGTYPE_SW_HANDLE swig_types[1]
794 #define  SWIGTYPE_p_time_t swig_types[2]
795 #define  SWIGTYPE_p_SWISH_HEADER_TYPE swig_types[3]
796 #define  SWIGTYPE_p_void swig_types[4]
797 #define  SWIGTYPE_p_p_char swig_types[5]
798 #define  SWIGTYPE_p_char swig_types[6]
799 #define  SWIGTYPE_SW_RESULTS swig_types[7]
800 #define  SWIGTYPE_p_u_PropValue1 swig_types[8]
801 #define  SWIGTYPE_p_FILE swig_types[9]
802 #define  SWIGTYPE_p_PropValue swig_types[10]
803 #define  SWIGTYPE_SW_RESULT swig_types[11]
804 #define  SWIGTYPE_SW_FUZZYWORD swig_types[12]
805 #define  SWIGTYPE_p_SWISH_HEADER_VALUE swig_types[13]
806 static swig_type_info *swig_types[15];
807
808 /* -------- TYPES TABLE (END) -------- */
809
810
811 /*-----------------------------------------------
812               @(target):= _swish.so
813   ------------------------------------------------*/
814 #define SWIG_init    init_swish
815
816 #define SWIG_name    "_swish"
817
818 /* Auxiliar swig  macros that appear in the header */
819
820 #define SWIG_OLDOBJ  1
821 #define SWIG_NEWOBJ  SWIG_OLDOBJ + 1
822 #define SWIG_PYSTR   SWIG_NEWOBJ + 1
823
824 #ifdef __cplusplus
825 #define SWIGSTATICINLINE(a) static inline a
826 #define SWIGSTATIC(a) static a
827 #define swig_new_array(size,Type) (new Type[(size)])
828 #define swig_delete(cptr) delete cptr
829 #define swig_delete_array(cptr) delete[] cptr
830 #define swig_const_cast(a,Type) const_cast<Type >(a)
831 #define swig_static_cast(a,Type) static_cast<Type >(a)
832 #define swig_reinterpret_cast(a,Type) reinterpret_cast<Type >(a)
833 #define swig_new_copy(ptr,Type) (new Type(*ptr))
834 #define swig_numeric_cast(a,Type) static_cast<Type >(a)
835
836 #else /* C case */
837
838 #define SWIGSTATICINLINE(a) static a
839 #define SWIGSTATIC(a) static a
840 #define swig_new_array(size,Type) ((Type*) malloc((size)*sizeof(Type)))
841 #define swig_delete(cptr) free((char*)cptr)
842 #define swig_delete_array(cptr) free((char*)cptr)
843 #define swig_const_cast(a,Type) (Type)(a)
844 #define swig_static_cast(a,Type) (Type)(a)
845 #define swig_reinterpret_cast(a,Type) (Type)(a)
846 #define swig_numeric_cast(a,Type) (Type)(a)
847 #define swig_new_copy(ptr,Type)  ((Type*)memcpy(malloc(sizeof(Type)),ptr,sizeof(Type)))
848
849 #endif /* __cplusplus */
850
851
852 /*@/usr/share/swig1.3/python/pymacros.swg,63,SWIG_define@*/
853 #define SWIG_From_signed_SS_char PyInt_FromLong
854 /*@@*/
855 /*@/usr/share/swig1.3/python/pymacros.swg,63,SWIG_define@*/
856 #define SWIG_From_unsigned_SS_char PyInt_FromLong
857 /*@@*/
858 /*@/usr/share/swig1.3/python/pymacros.swg,63,SWIG_define@*/
859 #define SWIG_From_short PyInt_FromLong
860 /*@@*/
861 /*@/usr/share/swig1.3/python/pymacros.swg,63,SWIG_define@*/
862 #define SWIG_From_unsigned_SS_short PyInt_FromLong
863 /*@@*/
864 /*@/usr/share/swig1.3/python/pymacros.swg,63,SWIG_define@*/
865 #define SWIG_From_int PyInt_FromLong
866 /*@@*/
867 /*@/usr/share/swig1.3/python/pymacros.swg,63,SWIG_define@*/
868 #define SWIG_From_long PyInt_FromLong
869 /*@@*/
870 /*@/usr/share/swig1.3/python/pymacros.swg,63,SWIG_define@*/
871 #define SWIG_From_float PyFloat_FromDouble
872 /*@@*/
873 /*@/usr/share/swig1.3/python/pymacros.swg,63,SWIG_define@*/
874 #define SWIG_From_double PyFloat_FromDouble
875 /*@@*/
876
877
878     #include "/usr/include/swish-e.h"
879
880
881 /* returns SWIG_OLDOBJ if the input is a raw char*, SWIG_PYSTR if is a PyString */
882 SWIGSTATIC(int)
883 SWIG_AsCharPtrAndSize(PyObject *obj, char** cptr, size_t* psize)
884 {
885   static swig_type_info* pchar_info = 0;
886   char* vptr = 0;
887   if (!pchar_info) pchar_info = SWIG_TypeQuery("char *");
888   if (SWIG_ConvertPtr(obj, (void**)&vptr, pchar_info, 0) != -1) {
889     if (cptr) *cptr = vptr;
890     if (psize) *psize = vptr ? (strlen(vptr) + 1) : 0;
891     return SWIG_OLDOBJ;