1 /* ----------------------------------------------------------------------------
2 * This file was automatically generated by SWIG (http://www.swig.org).
3 * Version 1.3.25
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 *
14 * This section contains generic SWIG labels for method/variable
15 * declarations/attributes, and other compiler dependent labels.
16 *
17 ************************************************************************/
18
19 /* template workaround for compilers that cannot correctly implement the C++ standard */
20 #ifndef SWIGTEMPLATEDISAMBIGUATOR
21 # if defined(__SUNPRO_CC) && (__SUNPRO_CC <= 0x560)
22 # define SWIGTEMPLATEDISAMBIGUATOR template
23 # else
24 # define SWIGTEMPLATEDISAMBIGUATOR
25 # endif
26 #endif
27
28 /* inline attribute */
29 #ifndef SWIGINLINE
30 # if defined(__cplusplus) || (defined(__GNUC__) && !defined(__STRICT_ANSI__))
31 # define SWIGINLINE inline
32 # else
33 # define SWIGINLINE
34 # endif
35 #endif
36
37 /* attribute recognised by some compilers to avoid 'unused' warnings */
38 #ifndef SWIGUNUSED
39 # if defined(__GNUC__) || defined(__ICC)
40 # define SWIGUNUSED __attribute__ ((unused))
41 # else
42 # define SWIGUNUSED
43 # endif
44 #endif
45
46 /* internal SWIG method */
47 #ifndef SWIGINTERN
48 # define SWIGINTERN static SWIGUNUSED
49 #endif
50
51 /* internal inline SWIG method */
52 #ifndef SWIGINTERNINLINE
53 # define SWIGINTERNINLINE SWIGINTERN SWIGINLINE
54 #endif
55
56 /* exporting methods for Windows DLLs */
57 #ifndef SWIGEXPORT
58 # if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__)
59 # if defined(STATIC_LINKED)
60 # define SWIGEXPORT
61 # else
62 # define SWIGEXPORT __declspec(dllexport)
63 # endif
64 # else
65 # define SWIGEXPORT
66 # endif
67 #endif
68
69 /* calling conventions for Windows */
70 #ifndef SWIGSTDCALL
71 # if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__)
72 # define SWIGSTDCALL __stdcall
73 # else
74 # define SWIGSTDCALL
75 # endif
76 #endif
77
78
79
80 #include <Python.h>
81
82 /***********************************************************************
83 * swigrun.swg
84 *
85 * This file contains generic CAPI SWIG runtime support for pointer
86 * type checking.
87 *
88 ************************************************************************/
89
90 /* This should only be incremented when either the layout of swig_type_info changes,
91 or for whatever reason, the runtime changes incompatibly */
92 #define SWIG_RUNTIME_VERSION "2"
93
94 /* define SWIG_TYPE_TABLE_NAME as "SWIG_TYPE_TABLE" */
95 #ifdef SWIG_TYPE_TABLE
96 # define SWIG_QUOTE_STRING(x) #x
97 # define SWIG_EXPAND_AND_QUOTE_STRING(x) SWIG_QUOTE_STRING(x)
98 # define SWIG_TYPE_TABLE_NAME SWIG_EXPAND_AND_QUOTE_STRING(SWIG_TYPE_TABLE)
99 #else
100 # define SWIG_TYPE_TABLE_NAME
101 #endif
102
103 /*
104 You can use the SWIGRUNTIME and SWIGRUNTIMEINLINE macros for
105 creating a static or dynamic library from the swig runtime code.
106 In 99.9% of the cases, swig just needs to declare them as 'static'.
107
108 But only do this if is strictly necessary, ie, if you have problems
109 with your compiler or so.
110 */
111
112 #ifndef SWIGRUNTIME
113 # define SWIGRUNTIME SWIGINTERN
114 #endif
115
116 #ifndef SWIGRUNTIMEINLINE
117 # define SWIGRUNTIMEINLINE SWIGRUNTIME SWIGINLINE
118 #endif
119
120 #include <string.h>
121
122 #ifdef __cplusplus
123 extern "C" {
124 #endif
125
126 typedef void *(*swig_converter_func)(void *);
127 typedef struct swig_type_info *(*swig_dycast_func)(void **);
128
129 /* Structure to store inforomation on one type */
130 typedef struct swig_type_info {
131 const char *name; /* mangled name of this type */
132 const char *str; /* human readable name of this type */
133 swig_dycast_func dcast; /* dynamic cast function down a hierarchy */
134 struct swig_cast_info *cast; /* linked list of types that can cast into this type */
135 void *clientdata; /* language specific type data */
136 } swig_type_info;
137
138 /* Structure to store a type and conversion function used for casting */
139 typedef struct swig_cast_info {
140 swig_type_info *type; /* pointer to type that is equivalent to this type */
141 swig_converter_func converter; /* function to cast the void pointers */
142 struct swig_cast_info *next; /* pointer to next cast in linked list */
143 struct swig_cast_info *prev; /* pointer to the previous cast */
144 } swig_cast_info;
145
146 /* Structure used to store module information
147 * Each module generates one structure like this, and the runtime collects
148 * all of these structures and stores them in a circularly linked list.*/
149 typedef struct swig_module_info {
150 swig_type_info **types; /* Array of pointers to swig_type_info structures that are in this module */
151 size_t size; /* Number of types in this module */
152 struct swig_module_info *next; /* Pointer to next element in circularly linked list */
153 swig_type_info **type_initial; /* Array of initially generated type structures */
154 swig_cast_info **cast_initial; /* Array of initially generated casting structures */
155 void *clientdata; /* Language specific module data */
156 } swig_module_info;
157
158
159 /*
160 Compare two type names skipping the space characters, therefore
161 "char*" == "char *" and "Class<int>" == "Class<int >", etc.
162
163 Return 0 when the two name types are equivalent, as in
164 strncmp, but skipping ' '.
165 */
166 SWIGRUNTIME int
SWIG_TypeNameComp(const char * f1,const char * l1,const char * f2,const char * l2)167 SWIG_TypeNameComp(const char *f1, const char *l1,
168 const char *f2, const char *l2) {
169 for (;(f1 != l1) && (f2 != l2); ++f1, ++f2) {
170 while ((*f1 == ' ') && (f1 != l1)) ++f1;
171 while ((*f2 == ' ') && (f2 != l2)) ++f2;
172 if (*f1 != *f2) return (int)(*f1 - *f2);
173 }
174 return (l1 - f1) - (l2 - f2);
175 }
176
177 /*
178 Check type equivalence in a name list like <name1>|<name2>|...
179 Return 0 if not equal, 1 if equal
180 */
181 SWIGRUNTIME int
SWIG_TypeEquiv(const char * nb,const char * tb)182 SWIG_TypeEquiv(const char *nb, const char *tb) {
183 int equiv = 0;
184 const char* te = tb + strlen(tb);
185 const char* ne = nb;
186 while (!equiv && *ne) {
187 for (nb = ne; *ne; ++ne) {
188 if (*ne == '|') break;
189 }
190 equiv = (SWIG_TypeNameComp(nb, ne, tb, te) == 0) ? 1 : 0;
191 if (*ne) ++ne;
192 }
193 return equiv;
194 }
195
196 /*
197 Check type equivalence in a name list like <name1>|<name2>|...
198 Return 0 if equal, -1 if nb < tb, 1 if nb > tb
199 */
200 SWIGRUNTIME int
SWIG_TypeCompare(const char * nb,const char * tb)201 SWIG_TypeCompare(const char *nb, const char *tb) {
202 int equiv = 0;
203 const char* te = tb + strlen(tb);
204 const char* ne = nb;
205 while (!equiv && *ne) {
206 for (nb = ne; *ne; ++ne) {
207 if (*ne == '|') break;
208 }
209 equiv = (SWIG_TypeNameComp(nb, ne, tb, te) == 0) ? 1 : 0;
210 if (*ne) ++ne;
211 }
212 return equiv;
213 }
214
215
216 /* think of this as a c++ template<> or a scheme macro */
217 #define SWIG_TypeCheck_Template(comparison, ty) \
218 if (ty) { \
219 swig_cast_info *iter = ty->cast; \
220 while (iter) { \
221 if (comparison) { \
222 if (iter == ty->cast) return iter; \
223 /* Move iter to the top of the linked list */ \
224 iter->prev->next = iter->next; \
225 if (iter->next) \
226 iter->next->prev = iter->prev; \
227 iter->next = ty->cast; \
228 iter->prev = 0; \
229 if (ty->cast) ty->cast->prev = iter; \
230 ty->cast = iter; \
231 return iter; \
232 } \
233 iter = iter->next; \
234 } \
235 } \
236 return 0
237
238 /*
239 Check the typename
240 */
241 SWIGRUNTIME swig_cast_info *
SWIG_TypeCheck(const char * c,swig_type_info * ty)242 SWIG_TypeCheck(const char *c, swig_type_info *ty) {
243 SWIG_TypeCheck_Template(strcmp(iter->type->name, c) == 0, ty);
244 }
245
246 /* Same as previous function, except strcmp is replaced with a pointer comparison */
247 SWIGRUNTIME swig_cast_info *
SWIG_TypeCheckStruct(swig_type_info * from,swig_type_info * into)248 SWIG_TypeCheckStruct(swig_type_info *from, swig_type_info *into) {
249 SWIG_TypeCheck_Template(iter->type == from, into);
250 }
251
252 /*
253 Cast a pointer up an inheritance hierarchy
254 */
255 SWIGRUNTIMEINLINE void *
SWIG_TypeCast(swig_cast_info * ty,void * ptr)256 SWIG_TypeCast(swig_cast_info *ty, void *ptr) {
257 return ((!ty) || (!ty->converter)) ? ptr : (*ty->converter)(ptr);
258 }
259
260 /*
261 Dynamic pointer casting. Down an inheritance hierarchy
262 */
263 SWIGRUNTIME swig_type_info *
SWIG_TypeDynamicCast(swig_type_info * ty,void ** ptr)264 SWIG_TypeDynamicCast(swig_type_info *ty, void **ptr) {
265 swig_type_info *lastty = ty;
266 if (!ty || !ty->dcast) return ty;
267 while (ty && (ty->dcast)) {
268 ty = (*ty->dcast)(ptr);
269 if (ty) lastty = ty;
270 }
271 return lastty;
272 }
273
274 /*
275 Return the name associated with this type
276 */
277 SWIGRUNTIMEINLINE const char *
SWIG_TypeName(const swig_type_info * ty)278 SWIG_TypeName(const swig_type_info *ty) {
279 return ty->name;
280 }
281
282 /*
283 Return the pretty name associated with this type,
284 that is an unmangled type name in a form presentable to the user.
285 */
286 SWIGRUNTIME const char *
SWIG_TypePrettyName(const swig_type_info * type)287 SWIG_TypePrettyName(const swig_type_info *type) {
288 /* The "str" field contains the equivalent pretty names of the
289 type, separated by vertical-bar characters. We choose
290 to print the last name, as it is often (?) the most
291 specific. */
292 if (type->str != NULL) {
293 const char *last_name = type->str;
294 const char *s;
295 for (s = type->str; *s; s++)
296 if (*s == '|') last_name = s+1;
297 return last_name;
298 }
299 else
300 return type->name;
301 }
302
303 /*
304 Set the clientdata field for a type
305 */
306 SWIGRUNTIME void
SWIG_TypeClientData(swig_type_info * ti,void * clientdata)307 SWIG_TypeClientData(swig_type_info *ti, void *clientdata) {
308 if (!ti->clientdata) {
309 swig_cast_info *cast = ti->cast;
310 /* if (ti->clientdata == clientdata) return; */
311 ti->clientdata = clientdata;
312
313 while (cast) {
314 if (!cast->converter)
315 SWIG_TypeClientData(cast->type, clientdata);
316 cast = cast->next;
317 }
318 }
319 }
320
321 /*
322 Search for a swig_type_info structure only by mangled name
323 Search is a O(log #types)
324
325 We start searching at module start, and finish searching when start == end.
326 Note: if start == end at the beginning of the function, we go all the way around
327 the circular list.
328 */
329 SWIGRUNTIME swig_type_info *
SWIG_MangledTypeQueryModule(swig_module_info * start,swig_module_info * end,const char * name)330 SWIG_MangledTypeQueryModule(swig_module_info *start,
331 swig_module_info *end,
332 const char *name) {
333 swig_module_info *iter = start;
334 do {
335 if (iter->size) {
336 register size_t l = 0;
337 register size_t r = iter->size - 1;
338 do {
339 /* since l+r >= 0, we can (>> 1) instead (/ 2) */
340 register size_t i = (l + r) >> 1;
341 const char *iname = iter->types[i]->name;
342 if (iname) {
343 register int compare = strcmp(name, iname);
344 if (compare == 0) {
345 return iter->types[i];
346 } else if (compare < 0) {
347 if (i) {
348 r = i - 1;
349 } else {
350 break;
351 }
352 } else if (compare > 0) {
353 l = i + 1;
354 }
355 } else {
356 break; /* should never happen */
357 }
358 } while (l <= r);
359 }
360 iter = iter->next;
361 } while (iter != end);
362 return 0;
363 }
364
365 /*
366 Search for a swig_type_info structure for either a mangled name or a human readable name.
367 It first searches the mangled names of the types, which is a O(log #types)
368 If a type is not found it then searches the human readable names, which is O(#types).
369
370 We start searching at module start, and finish searching when start == end.
371 Note: if start == end at the beginning of the function, we go all the way around
372 the circular list.
373 */
374 SWIGRUNTIME swig_type_info *
SWIG_TypeQueryModule(swig_module_info * start,swig_module_info * end,const char * name)375 SWIG_TypeQueryModule(swig_module_info *start,
376 swig_module_info *end,
377 const char *name) {
378 /* STEP 1: Search the name field using binary search */
379 swig_type_info *ret = SWIG_MangledTypeQueryModule(start, end, name);
380 if (ret) {
381 return ret;
382 } else {
383 /* STEP 2: If the type hasn't been found, do a complete search
384 of the str field (the human readable name) */
385 swig_module_info *iter = start;
386 do {
387 register size_t i = 0;
388 for (; i < iter->size; ++i) {
389 if (iter->types[i]->str && (SWIG_TypeEquiv(iter->types[i]->str, name)))
390 return iter->types[i];
391 }
392 iter = iter->next;
393 } while (iter != end);
394 }
395
396 /* neither found a match */
397 return 0;
398 }
399
400
401 /*
402 Pack binary data into a string
403 */
404 SWIGRUNTIME char *
SWIG_PackData(char * c,void * ptr,size_t sz)405 SWIG_PackData(char *c, void *ptr, size_t sz) {
406 static const char hex[17] = "0123456789abcdef";
407 register const unsigned char *u = (unsigned char *) ptr;
408 register const unsigned char *eu = u + sz;
409 for (; u != eu; ++u) {
410 register unsigned char uu = *u;
411 *(c++) = hex[(uu & 0xf0) >> 4];
412 *(c++) = hex[uu & 0xf];
413 }
414 return c;
415 }
416
417 /*
418 Unpack binary data from a string
419 */
420 SWIGRUNTIME const char *
SWIG_UnpackData(const char * c,void * ptr,size_t sz)421 SWIG_UnpackData(const char *c, void *ptr, size_t sz) {
422 register unsigned char *u = (unsigned char *) ptr;
423 register const unsigned char *eu = u + sz;
424 for (; u != eu; ++u) {
425 register char d = *(c++);
426 register unsigned char uu = 0;
427 if ((d >= '0') && (d <= '9'))
428 uu = ((d - '0') << 4);
429 else if ((d >= 'a') && (d <= 'f'))
430 uu = ((d - ('a'-10)) << 4);
431 else
432 return (char *) 0;
433 d = *(c++);
434 if ((d >= '0') && (d <= '9'))
435 uu |= (d - '0');
436 else if ((d >= 'a') && (d <= 'f'))
437 uu |= (d - ('a'-10));
438 else
439 return (char *) 0;
440 *u = uu;
441 }
442 return c;
443 }
444
445 /*
446 Pack 'void *' into a string buffer.
447 */
448 SWIGRUNTIME char *
SWIG_PackVoidPtr(char * buff,void * ptr,const char * name,size_t bsz)449 SWIG_PackVoidPtr(char *buff, void *ptr, const char *name, size_t bsz) {
450 char *r = buff;
451 if ((2*sizeof(void *) + 2) > bsz) return 0;
452 *(r++) = '_';
453 r = SWIG_PackData(r,&ptr,sizeof(void *));
454 if (strlen(name) + 1 > (bsz - (r - buff))) return 0;
455 strcpy(r,name);
456 return buff;
457 }
458
459 SWIGRUNTIME const char *
SWIG_UnpackVoidPtr(const char * c,void ** ptr,const char * name)460 SWIG_UnpackVoidPtr(const char *c, void **ptr, const char *name) {
461 if (*c != '_') {
462 if (strcmp(c,"NULL") == 0) {
463 *ptr = (void *) 0;
464 return name;
465 } else {
466 return 0;
467 }
468 }
469 return SWIG_UnpackData(++c,ptr,sizeof(void *));
470 }
471
472 SWIGRUNTIME char *
SWIG_PackDataName(char * buff,void * ptr,size_t sz,const char * name,size_t bsz)473 SWIG_PackDataName(char *buff, void *ptr, size_t sz, const char *name, size_t bsz) {
474 char *r = buff;
475 size_t lname = (name ? strlen(name) : 0);
476 if ((2*sz + 2 + lname) > bsz) return 0;
477 *(r++) = '_';
478 r = SWIG_PackData(r,ptr,sz);
479 if (lname) {
480 strncpy(r,name,lname+1);
481 } else {
482 *r = 0;
483 }
484 return buff;
485 }
486
487 SWIGRUNTIME const char *
SWIG_UnpackDataName(const char * c,void * ptr,size_t sz,const char * name)488 SWIG_UnpackDataName(const char *c, void *ptr, size_t sz, const char *name) {
489 if (*c != '_') {
490 if (strcmp(c,"NULL") == 0) {
491 memset(ptr,0,sz);
492 return name;
493 } else {
494 return 0;
495 }
496 }
497 return SWIG_UnpackData(++c,ptr,sz);
498 }
499
500 #ifdef __cplusplus
501 }
502 #endif
503
504 /* -----------------------------------------------------------------------------
505 * SWIG API. Portion that goes into the runtime
506 * ----------------------------------------------------------------------------- */
507
508 #ifdef __cplusplus
509 extern "C" {
510 #endif
511
512 /* -----------------------------------------------------------------------------
513 * for internal method declarations
514 * ----------------------------------------------------------------------------- */
515
516 #ifndef SWIGINTERN
517 # define SWIGINTERN static SWIGUNUSED
518 #endif
519
520 #ifndef SWIGINTERNINLINE
521 # define SWIGINTERNINLINE SWIGINTERN SWIGINLINE
522 #endif
523
524 /*
525 Exception handling in wrappers
526 */
527 #define SWIG_fail goto fail
528 #define SWIG_arg_fail(arg) SWIG_Python_ArgFail(arg)
529 #define SWIG_append_errmsg(msg) SWIG_Python_AddErrMesg(msg,0)
530 #define SWIG_preppend_errmsg(msg) SWIG_Python_AddErrMesg(msg,1)
531 #define SWIG_type_error(type,obj) SWIG_Python_TypeError(type,obj)
532 #define SWIG_null_ref(type) SWIG_Python_NullRef(type)
533
534 /*
535 Contract support
536 */
537 #define SWIG_contract_assert(expr, msg) \
538 if (!(expr)) { PyErr_SetString(PyExc_RuntimeError, (char *) msg ); goto fail; } else
539
540 /* -----------------------------------------------------------------------------
541 * Constant declarations
542 * ----------------------------------------------------------------------------- */
543
544 /* Constant Types */
545 #define SWIG_PY_INT 1
546 #define SWIG_PY_FLOAT 2
547 #define SWIG_PY_STRING 3
548 #define SWIG_PY_POINTER 4
549 #define SWIG_PY_BINARY 5
550
551 /* Constant information structure */
552 typedef struct swig_const_info {
553 int type;
554 char *name;
555 long lvalue;
556 double dvalue;
557 void *pvalue;
558 swig_type_info **ptype;
559 } swig_const_info;
560
561
562 /* -----------------------------------------------------------------------------
563 * Alloc. memory flags
564 * ----------------------------------------------------------------------------- */
565 #define SWIG_OLDOBJ 1
566 #define SWIG_NEWOBJ SWIG_OLDOBJ + 1
567 #define SWIG_PYSTR SWIG_NEWOBJ + 1
568
569 #ifdef __cplusplus
570 }
571 #endif
572
573
574 /***********************************************************************
575 * pyrun.swg
576 *
577 * This file contains the runtime support for Python modules
578 * and includes code for managing global variables and pointer
579 * type checking.
580 *
581 * Author : David Beazley (beazley@cs.uchicago.edu)
582 ************************************************************************/
583
584 /* Common SWIG API */
585 #define SWIG_ConvertPtr(obj, pp, type, flags) SWIG_Python_ConvertPtr(obj, pp, type, flags)
586 #define SWIG_NewPointerObj(p, type, flags) SWIG_Python_NewPointerObj(p, type, flags)
587 #define SWIG_MustGetPtr(p, type, argnum, flags) SWIG_Python_MustGetPtr(p, type, argnum, flags)
588
589
590 /* Python-specific SWIG API */
591 #define SWIG_ConvertPacked(obj, ptr, sz, ty, flags) SWIG_Python_ConvertPacked(obj, ptr, sz, ty, flags)
592 #define SWIG_NewPackedObj(ptr, sz, type) SWIG_Python_NewPackedObj(ptr, sz, type)
593
594 /* Runtime API */
595 #define SWIG_GetModule(clientdata) SWIG_Python_GetModule()
596 #define SWIG_SetModule(clientdata, pointer) SWIG_Python_SetModule(pointer)
597
598 /* -----------------------------------------------------------------------------
599 * Pointer declarations
600 * ----------------------------------------------------------------------------- */
601 /*
602 Use SWIG_NO_COBJECT_TYPES to force the use of strings to represent
603 C/C++ pointers in the python side. Very useful for debugging, but
604 not always safe.
605 */
606 #if !defined(SWIG_NO_COBJECT_TYPES) && !defined(SWIG_COBJECT_TYPES)
607 # define SWIG_COBJECT_TYPES
608 #endif
609
610 /* Flags for pointer conversion */
611 #define SWIG_POINTER_EXCEPTION 0x1
612 #define SWIG_POINTER_DISOWN 0x2
613
614
615 /* Add PyOS_snprintf for old Pythons */
616 #if PY_VERSION_HEX < 0x02020000
617 #define PyOS_snprintf snprintf
618 #endif
619
620 #ifdef __cplusplus
621 extern "C" {
622 #endif
623
624 /* -----------------------------------------------------------------------------
625 * Create a new pointer string
626 * ----------------------------------------------------------------------------- */
627 #ifndef SWIG_BUFFER_SIZE
628 #define SWIG_BUFFER_SIZE 1024
629 #endif
630
631 #if defined(SWIG_COBJECT_TYPES)
632 #if !defined(SWIG_COBJECT_PYTHON)
633 /* -----------------------------------------------------------------------------
634 * Implements a simple Swig Object type, and use it instead of PyCObject
635 * ----------------------------------------------------------------------------- */
636
637 typedef struct {
638 PyObject_HEAD
639 void *ptr;
640 const char *desc;
641 } PySwigObject;
642
643 /* Declarations for objects of type PySwigObject */
644
645 SWIGRUNTIME int
PySwigObject_print(PySwigObject * v,FILE * fp,int flags)646 PySwigObject_print(PySwigObject *v, FILE *fp, int flags)
647 {
648 char result[SWIG_BUFFER_SIZE];
649 flags = flags;
650 if (SWIG_PackVoidPtr(result, v->ptr, v->desc, sizeof(result))) {
651 fputs("<Swig Object at ", fp); fputs(result, fp); fputs(">", fp);
652 return 0;
653 } else {
654 return 1;
655 }
656 }
657
658 SWIGRUNTIME PyObject *
PySwigObject_repr(PySwigObject * v)659 PySwigObject_repr(PySwigObject *v)
660 {
661 char result[SWIG_BUFFER_SIZE];
662 return SWIG_PackVoidPtr(result, v->ptr, v->desc, sizeof(result)) ?
663 PyString_FromFormat("<Swig Object at %s>", result) : 0;
664 }
665
666 SWIGRUNTIME PyObject *
PySwigObject_str(PySwigObject * v)667 PySwigObject_str(PySwigObject *v)
668 {
669 char result[SWIG_BUFFER_SIZE];
670 return SWIG_PackVoidPtr(result, v->ptr, v->desc, sizeof(result)) ?
671 PyString_FromString(result) : 0;
672 }
673
674 SWIGRUNTIME PyObject *
PySwigObject_long(PySwigObject * v)675 PySwigObject_long(PySwigObject *v)
676 {
677 return PyLong_FromVoidPtr(v->ptr);
678 }
679
680 SWIGRUNTIME PyObject *
PySwigObject_format(const char * fmt,PySwigObject * v)681 PySwigObject_format(const char* fmt, PySwigObject *v)
682 {
683 PyObject *res = NULL;
684 PyObject *args = PyTuple_New(1);
685 if (args && (PyTuple_SetItem(args, 0, PySwigObject_long(v)) == 0)) {
686 PyObject *ofmt = PyString_FromString(fmt);
687 if (ofmt) {
688 res = PyString_Format(ofmt,args);
689 Py_DECREF(ofmt);
690 }
691 Py_DECREF(args);
692 }
693 return res;
694 }
695
696 SWIGRUNTIME PyObject *
PySwigObject_oct(PySwigObject * v)697 PySwigObject_oct(PySwigObject *v)
698 {
699 return PySwigObject_format("%o",v);
700 }
701
702 SWIGRUNTIME PyObject *
PySwigObject_hex(PySwigObject * v)703 PySwigObject_hex(PySwigObject *v)
704 {
705 return PySwigObject_format("%x",v);
706 }
707
708 SWIGRUNTIME int
PySwigObject_compare(PySwigObject * v,PySwigObject * w)709 PySwigObject_compare(PySwigObject *v, PySwigObject *w)
710 {
711 int c = strcmp(v->desc, w->desc);
712 if (c) {
713 return (c > 0) ? 1 : -1;
714 } else {
715 void *i = v->ptr;
716 void *j = w->ptr;
717 return (i < j) ? -1 : ((i > j) ? 1 : 0);
718 }
719 }
720
721 SWIGRUNTIME void
PySwigObject_dealloc(PySwigObject * self)722 PySwigObject_dealloc(PySwigObject *self)
723 {
724 PyObject_DEL(self);
725 }
726
727 SWIGRUNTIME PyTypeObject*
PySwigObject_type(void)728 PySwigObject_type(void) {
729 static char pyswigobject_type__doc__[] =
730 "Swig object carries a C/C++ instance pointer";
731
732 static PyNumberMethods PySwigObject_as_number = {
733 (binaryfunc)0, /*nb_add*/
734 (binaryfunc)0, /*nb_subtract*/
735 (binaryfunc)0, /*nb_multiply*/
736 (binaryfunc)0, /*nb_divide*/
737 (binaryfunc)0, /*nb_remainder*/
738 (binaryfunc)0, /*nb_divmod*/
739 (ternaryfunc)0,/*nb_power*/
740 (unaryfunc)0, /*nb_negative*/
741 (unaryfunc)0, /*nb_positive*/
742 (unaryfunc)0, /*nb_absolute*/
743 (inquiry)0, /*nb_nonzero*/
744 0, /*nb_invert*/
745 0, /*nb_lshift*/
746 0, /*nb_rshift*/
747 0, /*nb_and*/
748 0, /*nb_xor*/
749 0, /*nb_or*/
750 (coercion)0, /*nb_coerce*/
751 (unaryfunc)PySwigObject_long, /*nb_int*/
752 (unaryfunc)PySwigObject_long, /*nb_long*/
753 (unaryfunc)0, /*nb_float*/
754 (unaryfunc)PySwigObject_oct, /*nb_oct*/
755 (unaryfunc)PySwigObject_hex, /*nb_hex*/
756 #if PY_VERSION_HEX >= 0x02000000
757 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 /* nb_inplace_add -> nb_inplace_true_divide */
758 #endif
759 };
760
761 static PyTypeObject pyswigobject_type
762 #if !defined(__cplusplus)
763 ;
764 static int type_init = 0;
765 if (!type_init) {
766 PyTypeObject tmp
767 #endif
768 = {
769 PyObject_HEAD_INIT(&PyType_Type)
770 0, /*ob_size*/
771 (char *)"PySwigObject", /*tp_name*/
772 sizeof(PySwigObject), /*tp_basicsize*/
773 0, /*tp_itemsize*/
774 /* methods */
775 (destructor)PySwigObject_dealloc, /*tp_dealloc*/
776 (printfunc)PySwigObject_print, /*tp_print*/
777 (getattrfunc)0, /*tp_getattr*/
778 (setattrfunc)0, /*tp_setattr*/
779 (cmpfunc)PySwigObject_compare, /*tp_compare*/
780 (reprfunc)PySwigObject_repr, /*tp_repr*/
781 &PySwigObject_as_number, /*tp_as_number*/
782 0, /*tp_as_sequence*/
783 0, /*tp_as_mapping*/
784 (hashfunc)0, /*tp_hash*/
785 (ternaryfunc)0, /*tp_call*/
786 (reprfunc)PySwigObject_str, /*tp_str*/
787 /* Space for future expansion */
788 0,0,0,0,
789 pyswigobject_type__doc__, /* Documentation string */
790 #if PY_VERSION_HEX >= 0x02000000
791 0, /* tp_traverse */
792 0, /* tp_clear */
793 #endif
794 #if PY_VERSION_HEX >= 0x02010000
795 0, /* tp_richcompare */
796 0, /* tp_weaklistoffset */
797 #endif
798 #if PY_VERSION_HEX >= 0x02020000
799 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* tp_iter -> tp_weaklist */
800 #endif
801 #if PY_VERSION_HEX >= 0x02030000
802 0, /* tp_del */
803 #endif
804 #ifdef COUNT_ALLOCS
805 0,0,0,0 /* tp_alloc -> tp_next */
806 #endif
807 };
808 #if !defined(__cplusplus)
809 pyswigobject_type = tmp;
810 type_init = 1;
811 }
812 #endif
813 return &pyswigobject_type;
814 }
815
816 SWIGRUNTIME PyObject *
PySwigObject_FromVoidPtrAndDesc(void * ptr,const char * desc)817 PySwigObject_FromVoidPtrAndDesc(void *ptr, const char *desc)
818 {
819 PySwigObject *self = PyObject_NEW(PySwigObject, PySwigObject_type());
820 if (self) {
821 self->ptr = ptr;
822 self->desc = desc;
823 }
824 return (PyObject *)self;
825 }
826
827 SWIGRUNTIMEINLINE void *
PySwigObject_AsVoidPtr(PyObject * self)828 PySwigObject_AsVoidPtr(PyObject *self)
829 {
830 return ((PySwigObject *)self)->ptr;
831 }
832
833 SWIGRUNTIMEINLINE const char *
PySwigObject_GetDesc(PyObject * self)834 PySwigObject_GetDesc(PyObject *self)
835 {
836 return ((PySwigObject *)self)->desc;
837 }
838
839 SWIGRUNTIMEINLINE int
PySwigObject_Check(PyObject * op)840 PySwigObject_Check(PyObject *op) {
841 return ((op)->ob_type == PySwigObject_type())
842 || (strcmp((op)->ob_type->tp_name,"PySwigObject") == 0);
843 }
844
845 /* -----------------------------------------------------------------------------
846 * Implements a simple Swig Packed type, and use it instead of string
847 * ----------------------------------------------------------------------------- */
848
849 typedef struct {
850 PyObject_HEAD
851 void *pack;
852 const char *desc;
853 size_t size;
854 } PySwigPacked;
855
856 SWIGRUNTIME int
PySwigPacked_print(PySwigPacked * v,FILE * fp,int flags)857 PySwigPacked_print(PySwigPacked *v, FILE *fp, int flags)
858 {
859 char result[SWIG_BUFFER_SIZE];
860 flags = flags;
861 fputs("<Swig Packed ", fp);
862 if (SWIG_PackDataName(result, v->pack, v->size, 0, sizeof(result))) {
863 fputs("at ", fp);
864 fputs(result, fp);
865 }
866 fputs(v->desc,fp);
867 fputs(">", fp);
868 return 0;
869 }
870
871 SWIGRUNTIME PyObject *
PySwigPacked_repr(PySwigPacked * v)872 PySwigPacked_repr(PySwigPacked *v)
873 {
874 char result[SWIG_BUFFER_SIZE];
875 if (SWIG_PackDataName(result, v->pack, v->size, 0, sizeof(result))) {
876 return PyString_FromFormat("<Swig Packed at %s%s>", result, v->desc);
877 } else {
878 return PyString_FromFormat("<Swig Packed %s>", v->desc);
879 }
880 }
881
882 SWIGRUNTIME PyObject *
PySwigPacked_str(PySwigPacked * v)883 PySwigPacked_str(PySwigPacked *v)
884 {
885 char result[SWIG_BUFFER_SIZE];
886 if (SWIG_PackDataName(result, v->pack, v->size, 0, sizeof(result))){
887 return PyString_FromFormat("%s%s", result, v->desc);
888 } else {
889 return PyString_FromFormat("%s", v->desc);
890 }
891 }
892
893 SWIGRUNTIME int
PySwigPacked_compare(PySwigPacked * v,PySwigPacked * w)894 PySwigPacked_compare(PySwigPacked *v, PySwigPacked *w)
895 {
896 int c = strcmp(v->desc, w->desc);
897 if (c) {
898 return (c > 0) ? 1 : -1;
899 } else {
900 size_t i = v->size;
901 size_t j = w->size;
902 int s = (i < j) ? -1 : ((i > j) ? 1 : 0);
903 return s ? s : strncmp((char *)v->pack, (char *)w->pack, 2*v->size);
904 }
905 }
906
907 SWIGRUNTIME void
PySwigPacked_dealloc(PySwigPacked * self)908 PySwigPacked_dealloc(PySwigPacked *self)
909 {
910 free(self->pack);
911 PyObject_DEL(self);
912 }
913
914 SWIGRUNTIME PyTypeObject*
PySwigPacked_type(void)915 PySwigPacked_type(void) {
916 static char pyswigpacked_type__doc__[] =
917 "Swig object carries a C/C++ instance pointer";
918 static PyTypeObject pyswigpacked_type
919 #if !defined(__cplusplus)
920 ;
921 static int type_init = 0;
922 if (!type_init) {
923 PyTypeObject tmp
924 #endif
925 = {
926 PyObject_HEAD_INIT(&PyType_Type)
927 0, /*ob_size*/
928 (char *)"PySwigPacked", /*tp_name*/
929 sizeof(PySwigPacked), /*tp_basicsize*/
930 0, /*tp_itemsize*/
931 /* methods */
932 (destructor)PySwigPacked_dealloc, /*tp_dealloc*/
933 (printfunc)PySwigPacked_print, /*tp_print*/
934 (getattrfunc)0, /*tp_getattr*/
935 (setattrfunc)0, /*tp_setattr*/
936 (cmpfunc)PySwigPacked_compare, /*tp_compare*/
937 (reprfunc)PySwigPacked_repr, /*tp_repr*/
938 0, /*tp_as_number*/
939 0, /*tp_as_sequence*/
940 0, /*tp_as_mapping*/
941 (hashfunc)0, /*tp_hash*/
942 (ternaryfunc)0, /*tp_call*/
943 (reprfunc)PySwigPacked_str, /*tp_str*/
944 /* Space for future expansion */
945 0,0,0,0,
946 pyswigpacked_type__doc__, /* Documentation string */
947 #if PY_VERSION_HEX >= 0x02000000
948 0, /* tp_traverse */
949 0, /* tp_clear */
950 #endif
951 #if PY_VERSION_HEX >= 0x02010000
952 0, /* tp_richcompare */
953 0, /* tp_weaklistoffset */
954 #endif
955 #if PY_VERSION_HEX >= 0x02020000
956 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* tp_iter -> tp_weaklist */
957 #endif
958 #if PY_VERSION_HEX >= 0x02030000
959 0, /* tp_del */
960 #endif
961 #ifdef COUNT_ALLOCS
962 0,0,0,0 /* tp_alloc -> tp_next */
963 #endif
964 };
965 #if !defined(__cplusplus)
966 pyswigpacked_type = tmp;
967 type_init = 1;
968 }
969 #endif
970 return &pyswigpacked_type;
971 }
972
973 SWIGRUNTIME PyObject *
PySwigPacked_FromDataAndDesc(void * ptr,size_t size,const char * desc)974 PySwigPacked_FromDataAndDesc(void *ptr, size_t size, const char *desc)
975 {
976 PySwigPacked *self = PyObject_NEW(PySwigPacked, PySwigPacked_type());
977 if (self == NULL) {
978 return NULL;
979 } else {
980 void *pack = malloc(size);
981 if (pack) {
982 memcpy(pack, ptr, size);
983 self->pack = pack;
984 self->desc = desc;
985 self->size = size;
986 return (PyObject *) self;
987 }
988 return NULL;
989 }
990 }
991
992 SWIGRUNTIMEINLINE const char *
PySwigPacked_UnpackData(PyObject * obj,void * ptr,size_t size)993 PySwigPacked_UnpackData(PyObject *obj, void *ptr, size_t size)
994 {
995 PySwigPacked *self = (PySwigPacked *)obj;
996 if (self->size != size) return 0;
997 memcpy(ptr, self->pack, size);
998 return self->desc;
999 }
1000
1001 SWIGRUNTIMEINLINE const char *
PySwigPacked_GetDesc(PyObject * self)1002 PySwigPacked_GetDesc(PyObject *self)
1003 {
1004 return ((PySwigPacked *)self)->desc;
1005 }
1006
1007 SWIGRUNTIMEINLINE int
PySwigPacked_Check(PyObject * op)1008 PySwigPacked_Check(PyObject *op) {
1009 return ((op)->ob_type == PySwigPacked_type())
1010 || (strcmp((op)->ob_type->tp_name,"PySwigPacked") == 0);
1011 }
1012
1013 #else
1014 /* -----------------------------------------------------------------------------
1015 * Use the old Python PyCObject instead of PySwigObject
1016 * ----------------------------------------------------------------------------- */
1017
1018 #define PySwigObject_GetDesc(obj) PyCObject_GetDesc(obj)
1019 #define PySwigObject_Check(obj) PyCObject_Check(obj)
1020 #define PySwigObject_AsVoidPtr(obj) PyCObject_AsVoidPtr(obj)
1021 #define PySwigObject_FromVoidPtrAndDesc(p, d) PyCObject_FromVoidPtrAndDesc(p, d, NULL)
1022
1023 #endif
1024
1025 #endif
1026
1027 /* -----------------------------------------------------------------------------
1028 * errors manipulation
1029 * ----------------------------------------------------------------------------- */
1030
1031 SWIGRUNTIME void
SWIG_Python_TypeError(const char * type,PyObject * obj)1032 SWIG_Python_TypeError(const char *type, PyObject *obj)
1033 {
1034 if (type) {
1035 #if defined(SWIG_COBJECT_TYPES)
1036 if (obj && PySwigObject_Check(obj)) {
1037 const char *otype = (const char *) PySwigObject_GetDesc(obj);
1038 if (otype) {
1039 PyErr_Format(PyExc_TypeError, "a '%s' is expected, 'PySwigObject(%s)' is received",
1040 type, otype);
1041 return;
1042 }
1043 } else
1044 #endif
1045 {
1046 const char *otype = (obj ? obj->ob_type->tp_name : 0);
1047 if (otype) {
1048 PyObject *str = PyObject_Str(obj);
1049 const char *cstr = str ? PyString_AsString(str) : 0;
1050 if (cstr) {
1051 PyErr_Format(PyExc_TypeError, "a '%s' is expected, '%s(%s)' is received",
1052 type, otype, cstr);
1053 } else {
1054 PyErr_Format(PyExc_TypeError, "a '%s' is expected, '%s' is received",
1055 type, otype);
1056 }
1057 Py_XDECREF(str);
1058 return;
1059 }
1060 }
1061 PyErr_Format(PyExc_TypeError, "a '%s' is expected", type);
1062 } else {
1063 PyErr_Format(PyExc_TypeError, "unexpected type is received");
1064 }
1065 }
1066
1067 SWIGRUNTIMEINLINE void
SWIG_Python_NullRef(const char * type)1068 SWIG_Python_NullRef(const char *type)
1069 {
1070 if (type) {
1071 PyErr_Format(PyExc_TypeError, "null reference of type '%s' was received",type);
1072 } else {
1073 PyErr_Format(PyExc_TypeError, "null reference was received");
1074 }
1075 }
1076
1077 SWIGRUNTIME int
SWIG_Python_AddErrMesg(const char * mesg,int infront)1078 SWIG_Python_AddErrMesg(const char* mesg, int infront)
1079 {
1080 if (PyErr_Occurred()) {
1081 PyObject *type = 0;
1082 PyObject *value = 0;
1083 PyObject *traceback = 0;
1084 PyErr_Fetch(&type, &value, &traceback);
1085 if (value) {
1086 PyObject *old_str = PyObject_Str(value);
1087 Py_XINCREF(type);
1088 PyErr_Clear();
1089 if (infront) {
1090 PyErr_Format(type, "%s %s", mesg, PyString_AsString(old_str));
1091 } else {
1092 PyErr_Format(type, "%s %s", PyString_AsString(old_str), mesg);
1093 }
1094 Py_DECREF(old_str);
1095 }
1096 return 1;
1097 } else {
1098 return 0;
1099 }
1100 }
1101
1102 SWIGRUNTIME int
SWIG_Python_ArgFail(int argnum)1103 SWIG_Python_ArgFail(int argnum)
1104 {
1105 if (PyErr_Occurred()) {
1106 /* add information about failing argument */
1107 char mesg[256];
1108 PyOS_snprintf(mesg, sizeof(mesg), "argument number %d:", argnum);
1109 return SWIG_Python_AddErrMesg(mesg, 1);
1110 } else {
1111 return 0;
1112 }
1113 }
1114
1115
1116 /* -----------------------------------------------------------------------------
1117 * pointers/data manipulation
1118 * ----------------------------------------------------------------------------- */
1119
1120 /* Convert a pointer value */
1121 SWIGRUNTIME int
SWIG_Python_ConvertPtr(PyObject * obj,void ** ptr,swig_type_info * ty,int flags)1122 SWIG_Python_ConvertPtr(PyObject *obj, void **ptr, swig_type_info *ty, int flags) {
1123 swig_cast_info *tc;
1124 const char *c = 0;
1125 static PyObject *SWIG_this = 0;
1126 int newref = 0;
1127 PyObject *pyobj = 0;
1128 void *vptr;
1129
1130 if (!obj) return 0;
1131 if (obj == Py_None) {
1132 *ptr = 0;
1133 return 0;
1134 }
1135
1136 #ifdef SWIG_COBJECT_TYPES
1137 if (!(PySwigObject_Check(obj))) {
1138 if (!SWIG_this)
1139 SWIG_this = PyString_FromString("this");
1140 pyobj = obj;
1141 obj = PyObject_GetAttr(obj,SWIG_this);
1142 newref = 1;
1143 if (!obj) goto type_error;
1144 if (!PySwigObject_Check(obj)) {
1145 Py_DECREF(obj);
1146 goto type_error;
1147 }
1148 }
1149 vptr = PySwigObject_AsVoidPtr(obj);
1150 c = (const char *) PySwigObject_GetDesc(obj);
1151 if (newref) { Py_DECREF(obj); }
1152 goto type_check;
1153 #else
1154 if (!(PyString_Check(obj))) {
1155 if (!SWIG_this)
1156 SWIG_this = PyString_FromString("this");
1157 pyobj = obj;
1158 obj = PyObject_GetAttr(obj,SWIG_this);
1159 newref = 1;
1160 if (!obj) goto type_error;
1161 if (!PyString_Check(obj)) {
1162 Py_DECREF(obj);
1163 goto type_error;
1164 }
1165 }
1166 c = PyString_AS_STRING(obj);
1167 /* Pointer values must start with leading underscore */
1168 c = SWIG_UnpackVoidPtr(c, &vptr, ty->name);
1169 if (newref) { Py_DECREF(obj); }
1170 if (!c) goto type_error;
1171 #endif
1172
1173 type_check:
1174 if (ty) {
1175 tc = SWIG_TypeCheck(c,ty);
1176 if (!tc) goto type_error;
1177 *ptr = SWIG_TypeCast(tc,vptr);
1178 } else {
1179 *ptr = vptr;
1180 }
1181 if ((pyobj) && (flags & SWIG_POINTER_DISOWN)) {
1182 PyObject_SetAttrString(pyobj,(char*)"thisown",Py_False);
1183 }
1184 return 0;
1185
1186 type_error:
1187 PyErr_Clear();
1188 if (pyobj && !obj) {
1189 obj = pyobj;
1190 if (PyCFunction_Check(obj)) {
1191 /* here we get the method pointer for callbacks */
1192 char *doc = (((PyCFunctionObject *)obj) -> m_ml -> ml_doc);
1193 c = doc ? strstr(doc, "swig_ptr: ") : 0;
1194 if (c) {
1195 c = ty ? SWIG_UnpackVoidPtr(c + 10, &vptr, ty->name) : 0;
1196 if (!c) goto type_error;
1197 goto type_check;
1198 }
1199 }
1200 }
1201 if (flags & SWIG_POINTER_EXCEPTION) {
1202 if (ty) {
1203 SWIG_Python_TypeError(SWIG_TypePrettyName(ty), obj);
1204 } else {
1205 SWIG_Python_TypeError("C/C++ pointer", obj);
1206 }
1207 }
1208 return -1;
1209 }
1210
1211 /* Convert a pointer value, signal an exception on a type mismatch */
1212 SWIGRUNTIME void *
SWIG_Python_MustGetPtr(PyObject * obj,swig_type_info * ty,int argnum,int flags)1213 SWIG_Python_MustGetPtr(PyObject *obj, swig_type_info *ty, int argnum, int flags) {
1214 void *result;
1215 if (SWIG_Python_ConvertPtr(obj, &result, ty, flags) == -1) {
1216 PyErr_Clear();
1217 if (flags & SWIG_POINTER_EXCEPTION) {
1218 SWIG_Python_TypeError(SWIG_TypePrettyName(ty), obj);
1219 SWIG_Python_ArgFail(argnum);
1220 }
1221 }
1222 return result;
1223 }
1224
1225 /* Convert a packed value value */
1226 SWIGRUNTIME int
SWIG_Python_ConvertPacked(PyObject * obj,void * ptr,size_t sz,swig_type_info * ty,int flags)1227 SWIG_Python_ConvertPacked(PyObject *obj, void *ptr, size_t sz, swig_type_info *ty, int flags) {
1228 swig_cast_info *tc;
1229 const char *c = 0;
1230
1231 #if defined(SWIG_COBJECT_TYPES) && !defined(SWIG_COBJECT_PYTHON)
1232 c = PySwigPacked_UnpackData(obj, ptr, sz);
1233 #else
1234 if ((!obj) || (!PyString_Check(obj))) goto type_error;
1235 c = PyString_AS_STRING(obj);
1236 /* Pointer values must start with leading underscore */
1237 c = SWIG_UnpackDataName(c, ptr, sz, ty->name);
1238 #endif
1239 if (!c) goto type_error;
1240 if (ty) {
1241 tc = SWIG_TypeCheck(c,ty);
1242 if (!tc) goto type_error;
1243 }
1244 return 0;
1245
1246 type_error:
1247 PyErr_Clear();
1248 if (flags & SWIG_POINTER_EXCEPTION) {
1249 if (ty) {
1250 SWIG_Python_TypeError(SWIG_TypePrettyName(ty), obj);
1251 } else {
1252 SWIG_Python_TypeError("C/C++ packed data", obj);
1253 }
1254 }
1255 return -1;
1256 }
1257
1258 /* Create a new array object */
1259 SWIGRUNTIME PyObject *
SWIG_Python_NewPointerObj(void * ptr,swig_type_info * type,int own)1260 SWIG_Python_NewPointerObj(void *ptr, swig_type_info *type, int own) {
1261 PyObject *robj = 0;
1262 if (!type) {
1263 if (!PyErr_Occurred()) {
1264 PyErr_Format(PyExc_TypeError, "Swig: null type passed to NewPointerObj");
1265 }
1266 return robj;
1267 }
1268 if (!ptr) {
1269 Py_INCREF(Py_None);
1270 return Py_None;
1271 }
1272 #ifdef SWIG_COBJECT_TYPES
1273 robj = PySwigObject_FromVoidPtrAndDesc((void *) ptr, (char *)type->name);
1274 #else
1275 {
1276 char result[SWIG_BUFFER_SIZE];
1277 robj = SWIG_PackVoidPtr(result, ptr, type->name, sizeof(result)) ?
1278 PyString_FromString(result) : 0;
1279 }
1280 #endif
1281 if (!robj || (robj == Py_None)) return robj;
1282 if (type->clientdata) {
1283 PyObject *inst;
1284 PyObject *args = Py_BuildValue((char*)"(O)", robj);
1285 Py_DECREF(robj);
1286 inst = PyObject_CallObject((PyObject *) type->clientdata, args);
1287 Py_DECREF(args);
1288 if (inst) {
1289 if (own) {
1290 PyObject_SetAttrString(inst,(char*)"thisown",Py_True);
1291 }
1292 robj = inst;
1293 }
1294 }
1295 return robj;
1296 }
1297
1298 SWIGRUNTIME PyObject *
SWIG_Python_NewPackedObj(void * ptr,size_t sz,swig_type_info * type)1299 SWIG_Python_NewPackedObj(void *ptr, size_t sz, swig_type_info *type) {
1300 PyObject *robj = 0;
1301 if (!ptr) {
1302 Py_INCREF(Py_None);
1303 return Py_None;
1304 }
1305 #if defined(SWIG_COBJECT_TYPES) && !defined(SWIG_COBJECT_PYTHON)
1306 robj = PySwigPacked_FromDataAndDesc((void *) ptr, sz, (char *)type->name);
1307 #else
1308 {
1309 char result[SWIG_BUFFER_SIZE];
1310 robj = SWIG_PackDataName(result, ptr, sz, type->name, sizeof(result)) ?
1311 PyString_FromString(result) : 0;
1312 }
1313 #endif
1314 return robj;
1315 }
1316
1317 /* -----------------------------------------------------------------------------*
1318 * Get type list
1319 * -----------------------------------------------------------------------------*/
1320
1321 #ifdef SWIG_LINK_RUNTIME
1322 void *SWIG_ReturnGlobalTypeList(void *);
1323 #endif
1324
1325 SWIGRUNTIME swig_module_info *
SWIG_Python_GetModule(void)1326 SWIG_Python_GetModule(void) {
1327 static void *type_pointer = (void *)0;
1328 /* first check if module already created */
1329 if (!type_pointer) {
1330 #ifdef SWIG_LINK_RUNTIME
1331 type_pointer = SWIG_ReturnGlobalTypeList((void *)0);
1332 #else
1333 type_pointer = PyCObject_Import((char*)"swig_runtime_data" SWIG_RUNTIME_VERSION,
1334 (char*)"type_pointer" SWIG_TYPE_TABLE_NAME);
1335 if (PyErr_Occurred()) {
1336 PyErr_Clear();
1337 type_pointer = (void *)0;
1338 }
1339 }
1340 #endif
1341 return (swig_module_info *) type_pointer;
1342 }
1343
1344 SWIGRUNTIME void
1345 SWIG_Python_SetModule(swig_module_info *swig_module) {
1346 static PyMethodDef swig_empty_runtime_method_table[] = { {NULL, NULL, 0, NULL} };/* Sentinel */
1347
1348 PyObject *module = Py_InitModule((char*)"swig_runtime_data" SWIG_RUNTIME_VERSION,
1349 swig_empty_runtime_method_table);
1350 PyObject *pointer = PyCObject_FromVoidPtr((void *) swig_module, NULL);
1351 if (pointer && module) {
1352 PyModule_AddObject(module, (char*)"type_pointer" SWIG_TYPE_TABLE_NAME, pointer);
1353 }
1354 }
1355
1356 #ifdef __cplusplus
1357 }
1358 #endif
1359
1360
1361 /* -------- TYPES TABLE (BEGIN) -------- */
1362
1363 #define SWIGTYPE_p_Vgrid swig_types[0]
1364 #define SWIGTYPE_p_char swig_types[1]
1365 #define SWIGTYPE_p_double swig_types[2]
1366 #define SWIGTYPE_p_p_Vgrid swig_types[3]
1367 #define SWIGTYPE_ptrdiff_t swig_types[4]
1368 #define SWIGTYPE_size_t swig_types[5]
1369 static swig_type_info *swig_types[6];
1370 static swig_module_info swig_module = {swig_types, 6, 0, 0, 0, 0};
1371 #define SWIG_TypeQuery(name) SWIG_TypeQueryModule(&swig_module, &swig_module, name)
1372 #define SWIG_MangledTypeQuery(name) SWIG_MangledTypeQueryModule(&swig_module, &swig_module, name)
1373
1374 /* -------- TYPES TABLE (END) -------- */
1375
1376
1377 /*-----------------------------------------------
1378 @(target):= _vgrid.so
1379 ------------------------------------------------*/
1380 #define SWIG_init init_vgrid
1381
1382 #define SWIG_name "_vgrid"
1383
1384 #include "routines.h"
1385 #include "apbs/vgrid.h"
1386
1387
null_array()1388 double *null_array(){
1389 return NULL;
1390 }
1391
1392
1393 #include <limits.h>
1394
1395
1396 SWIGINTERN int
SWIG_CheckLongInRange(long value,long min_value,long max_value,const char * errmsg)1397 SWIG_CheckLongInRange(long value, long min_value, long max_value,
1398 const char *errmsg)
1399 {
1400 if (value < min_value) {
1401 if (errmsg) {
1402 PyErr_Format(PyExc_OverflowError,
1403 "value %ld is less than '%s' minimum %ld",
1404 value, errmsg, min_value);
1405 }
1406 return 0;
1407 } else if (value > max_value) {
1408 if (errmsg) {
1409 PyErr_Format(PyExc_OverflowError,
1410 "value %ld is greater than '%s' maximum %ld",
1411 value, errmsg, max_value);
1412 }
1413 return 0;
1414 }
1415 return 1;
1416 }
1417
1418
1419 SWIGINTERN int
SWIG_AsVal_long(PyObject * obj,long * val)1420 SWIG_AsVal_long(PyObject * obj, long* val)
1421 {
1422 if (PyInt_Check(obj)) {
1423 if (val) *val = PyInt_AS_LONG(obj);
1424 return 1;
1425 }
1426 if (PyLong_Check(obj)) {
1427 long v = PyLong_AsLong(obj);
1428 if (!PyErr_Occurred()) {
1429 if (val) *val = v;
1430 return 1;
1431 } else {
1432 if (!val) PyErr_Clear();
1433 return 0;
1434 }
1435 }
1436 if (val) {
1437 SWIG_type_error("long", obj);
1438 }
1439 return 0;
1440 }
1441
1442
1443 #if INT_MAX != LONG_MAX
1444 SWIGINTERN int
SWIG_AsVal_int(PyObject * obj,int * val)1445 SWIG_AsVal_int(PyObject *obj, int *val)
1446 {
1447 const char* errmsg = val ? "int" : (char*)0;
1448 long v;
1449 if (SWIG_AsVal_long(obj, &v)) {
1450 if (SWIG_CheckLongInRange(v, INT_MIN,INT_MAX, errmsg)) {
1451 if (val) *val = (int)(v);
1452 return 1;
1453 } else {
1454 return 0;
1455 }
1456 } else {
1457 PyErr_Clear();
1458 }
1459 if (val) {
1460 SWIG_type_error(errmsg, obj);
1461 }
1462 return 0;
1463 }
1464 #else
1465 SWIGINTERNINLINE int
SWIG_AsVal_int(PyObject * obj,int * val)1466 SWIG_AsVal_int(PyObject *obj, int *val)
1467 {
1468 return SWIG_AsVal_long(obj,(long*)val);
1469 }
1470 #endif
1471
1472
1473 SWIGINTERNINLINE int
SWIG_As_int(PyObject * obj)1474 SWIG_As_int(PyObject* obj)
1475 {
1476 int v;
1477 if (!SWIG_AsVal_int(obj, &v)) {
1478 /*
1479 this is needed to make valgrind/purify happier.
1480 */
1481 memset((void*)&v, 0, sizeof(int));
1482 }
1483 return v;
1484 }
1485
1486
1487 SWIGINTERNINLINE int
SWIG_Check_int(PyObject * obj)1488 SWIG_Check_int(PyObject* obj)
1489 {
1490 return SWIG_AsVal_int(obj, (int*)0);
1491 }
1492
1493
1494 /*@/usr/local/share/swig/1.3.25/python/pymacros.swg,66,SWIG_define@*/
1495 #define SWIG_From_int PyInt_FromLong
1496 /*@@*/
1497
1498
1499 SWIGINTERN int
SWIG_AsVal_double(PyObject * obj,double * val)1500 SWIG_AsVal_double(PyObject *obj, double *val)
1501 {
1502 if (PyFloat_Check(obj)) {
1503 if (val) *val = PyFloat_AS_DOUBLE(obj);
1504 return 1;
1505 }
1506 if (PyInt_Check(obj)) {
1507 if (val) *val = PyInt_AS_LONG(obj);
1508 return 1;
1509 }
1510 if (PyLong_Check(obj)) {
1511 double v = PyLong_AsDouble(obj);
1512 if (!PyErr_Occurred()) {
1513 if (val) *val = v;
1514 return 1;
1515 } else {
1516 if (!val) PyErr_Clear();
1517 return 0;
1518 }
1519 }
1520 if (val) {
1521 SWIG_type_error("double", obj);
1522 }
1523 return 0;
1524 }
1525
1526
1527 SWIGINTERNINLINE double
SWIG_As_double(PyObject * obj)1528 SWIG_As_double(PyObject* obj)
1529 {
1530 double v;
1531 if (!SWIG_AsVal_double(obj, &v)) {
1532 /*
1533 this is needed to make valgrind/purify happier.
1534 */
1535 memset((void*)&v, 0, sizeof(double));
1536 }
1537 return v;
1538 }
1539
1540
1541 SWIGINTERNINLINE int
SWIG_Check_double(PyObject * obj)1542 SWIG_Check_double(PyObject* obj)
1543 {
1544 return SWIG_AsVal_double(obj, (double*)0);
1545 }
1546
1547
1548 /*@/usr/local/share/swig/1.3.25/python/pymacros.swg,66,SWIG_define@*/
1549 #define SWIG_From_double PyFloat_FromDouble
1550 /*@@*/
1551
1552
delete_vgrid(Vgrid * thee)1553 void delete_vgrid(Vgrid *thee){
1554 if (thee != VNULL) {
1555 Vmem_free(thee->mem, (thee->nx*thee->ny*thee->nz), sizeof(double),
1556 (void **)&(thee->data));
1557 Vmem_free(VNULL, 1, sizeof(Vgrid), (void **)&thee);
1558 thee = VNULL;
1559 }
1560 }
1561
1562 int Vgrid_ctor2(Vgrid *,int,int,int,double,double,double,double,double,double,double *);
1563 void Vgrid_dtor(Vgrid **);
1564 void Vgrid_dtor2(Vgrid *);
1565 void Vgrid_writeUHBD(Vgrid *,char const *,char const *,char const *,char const *,char *,double *);
1566
1567 /* returns SWIG_OLDOBJ if the input is a raw char*, SWIG_PYSTR if is a PyString */
1568 SWIGINTERN int
SWIG_AsCharPtrAndSize(PyObject * obj,char ** cptr,size_t * psize)1569 SWIG_AsCharPtrAndSize(PyObject *obj, char** cptr, size_t* psize)
1570 {
1571 static swig_type_info* pchar_info = 0;
1572 char* vptr = 0;
1573 if (!pchar_info) pchar_info = SWIG_TypeQuery("char *");
1574 if (SWIG_ConvertPtr(obj, (void**)&vptr, pchar_info, 0) != -1) {
1575 if (cptr) *cptr = vptr;
1576 if (psize) *psize = vptr ? (strlen(vptr) + 1) : 0;
1577 return SWIG_OLDOBJ;
1578 } else {
1579 PyErr_Clear();
1580 if (PyString_Check(obj)) {
1581 if (cptr) {
1582 *cptr = PyString_AS_STRING(obj);
1583 if (psize) {
1584 *psize = PyString_GET_SIZE(obj) + 1;
1585 }
1586 }
1587 return SWIG_PYSTR;
1588 }
1589 }
1590 if (cptr) {
1591 SWIG_type_error("char *", obj);
1592 }
1593 return 0;
1594 }
1595
1596
1597 SWIGINTERNINLINE int
SWIG_AsCharPtr(PyObject * obj,char ** val)1598 SWIG_AsCharPtr(PyObject *obj, char **val)
1599 {
1600 if (SWIG_AsCharPtrAndSize(obj, val, (size_t*)(0))) {
1601 return 1;
1602 }
1603 if (val) {
1604 PyErr_Clear();
1605 SWIG_type_error("char *", obj);
1606 }
1607 return 0;
1608 }
1609
1610 void Vgrid_writeDX(Vgrid *,char const *,char const *,char const *,char const *,char *,double *);
1611 int Vgrid_readDX(Vgrid *,char const *,char const *,char const *,char const *);
1612 void startVio();
1613 int Vgrid_value(Vgrid *,double [3],double *);
1614
1615 SWIGINTERN PyObject*
t_output_helper(PyObject * target,PyObject * o)1616 t_output_helper(PyObject* target, PyObject* o) {
1617 if (!target) {
1618 target = o;
1619 } else if (target == Py_None) {
1620 Py_DECREF(target);
1621 target = o;
1622 } else {
1623 if (!PyList_Check(target)) {
1624 PyObject *o2 = target;
1625 target = PyList_New(1);
1626 PyList_SetItem(target, 0, o2);
1627 }
1628 PyList_Append(target,o);
1629 Py_DECREF(o);
1630 }
1631 return target;
1632 }
1633
1634
1635 int Vgrid_curvature(Vgrid *,double [3],int,double *);
1636 int Vgrid_gradient(Vgrid *,double [3],double [3]);
1637 Vgrid *Vgrid_ctor(int,int,int,double,double,double,double,double,double,double *);
1638 #ifdef __cplusplus
1639 extern "C" {
1640 #endif
_wrap_null_array(PyObject * self,PyObject * args)1641 static PyObject *_wrap_null_array(PyObject *self, PyObject *args) {
1642 PyObject *resultobj = NULL;
1643 double *result;
1644
1645 if(!PyArg_ParseTuple(args,(char *)":null_array")) goto fail;
1646 result = (double *)null_array();
1647
1648 resultobj = SWIG_NewPointerObj((void*)(result), SWIGTYPE_p_double, 0);
1649 return resultobj;
1650 fail:
1651 return NULL;
1652 }
1653
1654
_wrap_new_Vgrid(PyObject * self,PyObject * args)1655 static PyObject *_wrap_new_Vgrid(PyObject *self, PyObject *args) {
1656 PyObject *resultobj = NULL;
1657 Vgrid *result;
1658
1659 if(!PyArg_ParseTuple(args,(char *)":new_Vgrid")) goto fail;
1660 result = (Vgrid *)(Vgrid *) calloc(1, sizeof(Vgrid));
1661
1662 resultobj = SWIG_NewPointerObj((void*)(result), SWIGTYPE_p_Vgrid, 1);
1663 return resultobj;
1664 fail:
1665 return NULL;
1666 }
1667
1668
_wrap_delete_Vgrid(PyObject * self,PyObject * args)1669 static PyObject *_wrap_delete_Vgrid(PyObject *self, PyObject *args) {
1670 PyObject *resultobj = NULL;
1671 Vgrid *arg1 = (Vgrid *) 0 ;
1672 PyObject * obj0 = 0 ;
1673
1674 if(!PyArg_ParseTuple(args,(char *)"O:delete_Vgrid",&obj0)) goto fail;
1675 SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_Vgrid, SWIG_POINTER_EXCEPTION | 0);
1676 if (SWIG_arg_fail(1)) SWIG_fail;
1677 free((char *) arg1);
1678
1679 Py_INCREF(Py_None); resultobj = Py_None;
1680 return resultobj;
1681 fail:
1682 return NULL;
1683 }
1684
1685
_wrap_Vgrid_nx_set(PyObject * self,PyObject * args)1686 static PyObject *_wrap_Vgrid_nx_set(PyObject *self, PyObject *args) {
1687 PyObject *resultobj = NULL;
1688 Vgrid *arg1 = (Vgrid *) 0 ;
1689 int arg2 ;
1690 PyObject * obj0 = 0 ;
1691 PyObject * obj1 = 0 ;
1692
1693 if(!PyArg_ParseTuple(args,(char *)"OO:Vgrid_nx_set",&obj0,&obj1)) goto fail;
1694 SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_Vgrid, SWIG_POINTER_EXCEPTION | 0);
1695 if (SWIG_arg_fail(1)) SWIG_fail;
1696 {
1697 arg2 = (int)(SWIG_As_int(obj1));
1698 if (SWIG_arg_fail(2)) SWIG_fail;
1699 }
1700 if (arg1) (arg1)->nx = arg2;
1701
1702 Py_INCREF(Py_None); resultobj = Py_None;
1703 return resultobj;
1704 fail:
1705 return NULL;
1706 }
1707
1708
_wrap_Vgrid_nx_get(PyObject * self,PyObject * args)1709 static PyObject *_wrap_Vgrid_nx_get(PyObject *self, PyObject *args) {
1710 PyObject *resultobj = NULL;
1711 Vgrid *arg1 = (Vgrid *) 0 ;
1712 int result;
1713 PyObject * obj0 = 0 ;
1714
1715 if(!PyArg_ParseTuple(args,(char *)"O:Vgrid_nx_get",&obj0)) goto fail;
1716 SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_Vgrid, SWIG_POINTER_EXCEPTION | 0);
1717 if (SWIG_arg_fail(1)) SWIG_fail;
1718 result = (int) ((arg1)->nx);
1719
1720 {
1721 resultobj = SWIG_From_int((int)(result));
1722 }
1723 return resultobj;
1724 fail:
1725 return NULL;
1726 }
1727
1728
_wrap_Vgrid_ny_set(PyObject * self,PyObject * args)1729 static PyObject *_wrap_Vgrid_ny_set(PyObject *self, PyObject *args) {
1730 PyObject *resultobj = NULL;
1731 Vgrid *arg1 = (Vgrid *) 0 ;
1732 int arg2 ;
1733 PyObject * obj0 = 0 ;
1734 PyObject * obj1 = 0 ;
1735
1736 if(!PyArg_ParseTuple(args,(char *)"OO:Vgrid_ny_set",&obj0,&obj1)) goto fail;
1737 SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_Vgrid, SWIG_POINTER_EXCEPTION | 0);
1738 if (SWIG_arg_fail(1)) SWIG_fail;
1739 {
1740 arg2 = (int)(SWIG_As_int(obj1));
1741 if (SWIG_arg_fail(2)) SWIG_fail;
1742 }
1743 if (arg1) (arg1)->ny = arg2;
1744
1745 Py_INCREF(Py_None); resultobj = Py_None;
1746 return resultobj;
1747 fail:
1748 return NULL;
1749 }
1750
1751
_wrap_Vgrid_ny_get(PyObject * self,PyObject * args)1752 static PyObject *_wrap_Vgrid_ny_get(PyObject *self, PyObject *args) {
1753 PyObject *resultobj = NULL;
1754 Vgrid *arg1 = (Vgrid *) 0 ;
1755 int result;
1756 PyObject * obj0 = 0 ;
1757
1758 if(!PyArg_ParseTuple(args,(char *)"O:Vgrid_ny_get",&obj0)) goto fail;
1759 SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_Vgrid, SWIG_POINTER_EXCEPTION | 0);
1760 if (SWIG_arg_fail(1)) SWIG_fail;
1761 result = (int) ((arg1)->ny);
1762
1763 {
1764 resultobj = SWIG_From_int((int)(result));
1765 }
1766 return resultobj;
1767 fail:
1768 return NULL;
1769 }
1770
1771
_wrap_Vgrid_nz_set(PyObject * self,PyObject * args)1772 static PyObject *_wrap_Vgrid_nz_set(PyObject *self, PyObject *args) {
1773 PyObject *resultobj = NULL;
1774 Vgrid *arg1 = (Vgrid *) 0 ;
1775 int arg2 ;
1776 PyObject * obj0 = 0 ;
1777 PyObject * obj1 = 0 ;
1778
1779 if(!PyArg_ParseTuple(args,(char *)"OO:Vgrid_nz_set",&obj0,&obj1)) goto fail;
1780 SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_Vgrid, SWIG_POINTER_EXCEPTION | 0);
1781 if (SWIG_arg_fail(1)) SWIG_fail;
1782 {
1783 arg2 = (int)(SWIG_As_int(obj1));
1784 if (SWIG_arg_fail(2)) SWIG_fail;
1785 }
1786 if (arg1) (arg1)->nz = arg2;
1787
1788 Py_INCREF(Py_None); resultobj = Py_None;
1789 return resultobj;
1790 fail:
1791 return NULL;
1792 }
1793
1794
_wrap_Vgrid_nz_get(PyObject * self,PyObject * args)1795 static PyObject *_wrap_Vgrid_nz_get(PyObject *self, PyObject *args) {
1796 PyObject *resultobj = NULL;
1797 Vgrid *arg1 = (Vgrid *) 0 ;
1798 int result;
1799 PyObject * obj0 = 0 ;
1800
1801 if(!PyArg_ParseTuple(args,(char *)"O:Vgrid_nz_get",&obj0)) goto fail;
1802 SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_Vgrid, SWIG_POINTER_EXCEPTION | 0);
1803 if (SWIG_arg_fail(1)) SWIG_fail;
1804 result = (int) ((arg1)->nz);
1805
1806 {
1807 resultobj = SWIG_From_int((int)(result));
1808 }
1809 return resultobj;
1810 fail:
1811 return NULL;
1812 }
1813
1814
_wrap_Vgrid_hx_set(PyObject * self,PyObject * args)1815 static PyObject *_wrap_Vgrid_hx_set(PyObject *self, PyObject *args) {
1816 PyObject *resultobj = NULL;
1817 Vgrid *arg1 = (Vgrid *) 0 ;
1818 double arg2 ;
1819 PyObject * obj0 = 0 ;
1820 PyObject * obj1 = 0 ;
1821
1822 if(!PyArg_ParseTuple(args,(char *)"OO:Vgrid_hx_set",&obj0,&obj1)) goto fail;
1823 SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_Vgrid, SWIG_POINTER_EXCEPTION | 0);
1824 if (SWIG_arg_fail(1)) SWIG_fail;
1825 {
1826 arg2 = (double)(SWIG_As_double(obj1));
1827 if (SWIG_arg_fail(2)) SWIG_fail;
1828 }
1829 if (arg1) (arg1)->hx = arg2;
1830
1831 Py_INCREF(Py_None); resultobj = Py_None;
1832 return resultobj;
1833 fail:
1834 return NULL;
1835 }
1836
1837
_wrap_Vgrid_hx_get(PyObject * self,PyObject * args)1838 static PyObject *_wrap_Vgrid_hx_get(PyObject *self, PyObject *args) {
1839 PyObject *resultobj = NULL;
1840 Vgrid *arg1 = (Vgrid *) 0 ;
1841 double result;
1842 PyObject * obj0 = 0 ;
1843
1844 if(!PyArg_ParseTuple(args,(char *)"O:Vgrid_hx_get",&obj0)) goto fail;
1845 SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_Vgrid, SWIG_POINTER_EXCEPTION | 0);
1846 if (SWIG_arg_fail(1)) SWIG_fail;
1847 result = (double) ((arg1)->hx);
1848
1849 {
1850 resultobj = SWIG_From_double((double)(result));
1851 }
1852 return resultobj;
1853 fail:
1854 return NULL;
1855 }
1856
1857
_wrap_Vgrid_hy_set(PyObject * self,PyObject * args)1858 static PyObject *_wrap_Vgrid_hy_set(PyObject *self, PyObject *args) {
1859 PyObject *resultobj = NULL;
1860 Vgrid *arg1 = (Vgrid *) 0 ;
1861 double arg2 ;
1862 PyObject * obj0 = 0 ;
1863 PyObject * obj1 = 0 ;
1864
1865 if(!PyArg_ParseTuple(args,(char *)"OO:Vgrid_hy_set",&obj0,&obj1)) goto fail;
1866 SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_Vgrid, SWIG_POINTER_EXCEPTION | 0);
1867 if (SWIG_arg_fail(1)) SWIG_fail;
1868 {
1869 arg2 = (double)(SWIG_As_double(obj1));
1870 if (SWIG_arg_fail(2)) SWIG_fail;
1871 }
1872 if (arg1) (arg1)->hy = arg2;
1873
1874 Py_INCREF(Py_None); resultobj = Py_None;
1875 return resultobj;
1876 fail:
1877 return NULL;
1878 }
1879
1880
_wrap_Vgrid_hy_get(PyObject * self,PyObject * args)1881 static PyObject *_wrap_Vgrid_hy_get(PyObject *self, PyObject *args) {
1882 PyObject *resultobj = NULL;
1883 Vgrid *arg1 = (Vgrid *) 0 ;
1884 double result;
1885 PyObject * obj0 = 0 ;
1886
1887 if(!PyArg_ParseTuple(args,(char *)"O:Vgrid_hy_get",&obj0)) goto fail;
1888 SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_Vgrid, SWIG_POINTER_EXCEPTION | 0);
1889 if (SWIG_arg_fail(1)) SWIG_fail;
1890 result = (double) ((arg1)->hy);
1891
1892 {
1893 resultobj = SWIG_From_double((double)(result));
1894 }
1895 return resultobj;
1896 fail:
1897 return NULL;
1898 }
1899
1900
_wrap_Vgrid_hzed_set(PyObject * self,PyObject * args)1901 static PyObject *_wrap_Vgrid_hzed_set(PyObject *self, PyObject *args) {
1902 PyObject *resultobj = NULL;
1903 Vgrid *arg1 = (Vgrid *) 0 ;
1904 double arg2 ;
1905 PyObject * obj0 = 0 ;
1906 PyObject * obj1 = 0 ;
1907
1908 if(!PyArg_ParseTuple(args,(char *)"OO:Vgrid_hzed_set",&obj0,&obj1)) goto fail;
1909 SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_Vgrid, SWIG_POINTER_EXCEPTION | 0);
1910 if (SWIG_arg_fail(1)) SWIG_fail;
1911 {
1912 arg2 = (double)(SWIG_As_double(obj1));
1913 if (SWIG_arg_fail(2)) SWIG_fail;
1914 }
1915 if (arg1) (arg1)->hzed = arg2;
1916
1917 Py_INCREF(Py_None); resultobj = Py_None;
1918 return resultobj;
1919 fail:
1920 return NULL;
1921 }
1922
1923
_wrap_Vgrid_hzed_get(PyObject * self,PyObject * args)1924 static PyObject *_wrap_Vgrid_hzed_get(PyObject *self, PyObject *args) {
1925 PyObject *resultobj = NULL;
1926 Vgrid *arg1 = (Vgrid *) 0 ;
1927 double result;
1928 PyObject * obj0 = 0 ;
1929
1930 if(!PyArg_ParseTuple(args,(char *)"O:Vgrid_hzed_get",&obj0)) goto fail;
1931 SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_Vgrid, SWIG_POINTER_EXCEPTION | 0);
1932 if (SWIG_arg_fail(1)) SWIG_fail;
1933 result = (double) ((arg1)->hzed);
1934
1935 {
1936 resultobj = SWIG_From_double((double)(result));
1937 }
1938 return resultobj;
1939 fail:
1940 return NULL;
1941 }
1942
1943
_wrap_Vgrid_xmin_set(PyObject * self,PyObject * args)1944 static PyObject *_wrap_Vgrid_xmin_set(PyObject *self, PyObject *args) {
1945 PyObject *resultobj = NULL;
1946 Vgrid *arg1 = (Vgrid *) 0 ;
1947 double arg2 ;
1948 PyObject * obj0 = 0 ;
1949 PyObject * obj1 = 0 ;
1950
1951 if(!PyArg_ParseTuple(args,(char *)"OO:Vgrid_xmin_set",&obj0,&obj1)) goto fail;
1952 SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_Vgrid, SWIG_POINTER_EXCEPTION | 0);
1953 if (SWIG_arg_fail(1)) SWIG_fail;
1954 {
1955 arg2 = (double)(SWIG_As_double(obj1));
1956 if (SWIG_arg_fail(2)) SWIG_fail;
1957 }
1958 if (arg1) (arg1)->xmin = arg2;
1959
1960 Py_INCREF(Py_None); resultobj = Py_None;
1961 return resultobj;
1962 fail:
1963 return NULL;
1964 }
1965
1966
_wrap_Vgrid_xmin_get(PyObject * self,PyObject * args)1967 static PyObject *_wrap_Vgrid_xmin_get(PyObject *self, PyObject *args) {
1968 PyObject *resultobj = NULL;
1969 Vgrid *arg1 = (Vgrid *) 0 ;
1970 double result;
1971 PyObject * obj0 = 0 ;
1972
1973 if(!PyArg_ParseTuple(args,(char *)"O:Vgrid_xmin_get",&obj0)) goto fail;
1974 SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_Vgrid, SWIG_POINTER_EXCEPTION | 0);
1975 if (SWIG_arg_fail(1)) SWIG_fail;
1976 result = (double) ((arg1)->xmin);
1977
1978 {
1979 resultobj = SWIG_From_double((double)(result));
1980 }
1981 return resultobj;
1982 fail:
1983 return NULL;
1984 }
1985
1986
_wrap_Vgrid_ymin_set(PyObject * self,PyObject * args)1987 static PyObject *_wrap_Vgrid_ymin_set(PyObject *self, PyObject *args) {
1988 PyObject *resultobj = NULL;
1989 Vgrid *arg1 = (Vgrid *) 0 ;
1990 double arg2 ;
1991 PyObject * obj0 = 0 ;
1992 PyObject * obj1 = 0 ;
1993
1994 if(!PyArg_ParseTuple(args,(char *)"OO:Vgrid_ymin_set",&obj0,&obj1)) goto fail;
1995 SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_Vgrid, SWIG_POINTER_EXCEPTION | 0);
1996 if (SWIG_arg_fail(1)) SWIG_fail;
1997 {
1998 arg2 = (double)(SWIG_As_double(obj1));
1999 if (SWIG_arg_fail(2)) SWIG_fail;
2000 }
2001 if (arg1) (arg1)->ymin = arg2;
2002
2003 Py_INCREF(Py_None); resultobj = Py_None;
2004 return resultobj;
2005 fail:
2006 return NULL;
2007 }
2008
2009
_wrap_Vgrid_ymin_get(PyObject * self,PyObject * args)2010 static PyObject *_wrap_Vgrid_ymin_get(PyObject *self, PyObject *args) {
2011 PyObject *resultobj = NULL;
2012 Vgrid *arg1 = (Vgrid *) 0 ;
2013 double result;
2014 PyObject * obj0 = 0 ;
2015
2016 if(!PyArg_ParseTuple(args,(char *)"O:Vgrid_ymin_get",&obj0)) goto fail;
2017 SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_Vgrid, SWIG_POINTER_EXCEPTION | 0);
2018 if (SWIG_arg_fail(1)) SWIG_fail;
2019 result = (double) ((arg1)->ymin);
2020
2021 {
2022 resultobj = SWIG_From_double((double)(result));
2023 }
2024 return resultobj;
2025 fail:
2026 return NULL;
2027 }
2028
2029
_wrap_Vgrid_zmin_set(PyObject * self,PyObject * args)2030 static PyObject *_wrap_Vgrid_zmin_set(PyObject *self, PyObject *args) {
2031 PyObject *resultobj = NULL;
2032 Vgrid *arg1 = (Vgrid *) 0 ;
2033 double arg2 ;
2034 PyObject * obj0 = 0 ;
2035 PyObject * obj1 = 0 ;
2036
2037 if(!PyArg_ParseTuple(args,(char *)"OO:Vgrid_zmin_set",&obj0,&obj1)) goto fail;
2038 SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_Vgrid, SWIG_POINTER_EXCEPTION | 0);
2039 if (SWIG_arg_fail(1)) SWIG_fail;
2040 {
2041 arg2 = (double)(SWIG_As_double(obj1));
2042 if (SWIG_arg_fail(2)) SWIG_fail;
2043 }
2044 if (arg1) (arg1)->zmin = arg2;
2045
2046 Py_INCREF(Py_None); resultobj = Py_None;
2047 return resultobj;
2048 fail:
2049 return NULL;
2050 }
2051
2052
_wrap_Vgrid_zmin_get(PyObject * self,PyObject * args)2053 static PyObject *_wrap_Vgrid_zmin_get(PyObject *self, PyObject *args) {
2054 PyObject *resultobj = NULL;
2055 Vgrid *arg1 = (Vgrid *) 0 ;
2056 double result;
2057 PyObject * obj0 = 0 ;
2058
2059 if(!PyArg_ParseTuple(args,(char *)"O:Vgrid_zmin_get",&obj0)) goto fail;
2060 SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_Vgrid, SWIG_POINTER_EXCEPTION | 0);
2061 if (SWIG_arg_fail(1)) SWIG_fail;
2062 result = (double) ((arg1)->zmin);
2063
2064 {
2065 resultobj = SWIG_From_double((double)(result));
2066 }
2067 return resultobj;
2068 fail:
2069 return NULL;
2070 }
2071
2072
_wrap_Vgrid_data_set(PyObject * self,PyObject * args)2073 static PyObject *_wrap_Vgrid_data_set(PyObject *self, PyObject *args) {
2074 PyObject *resultobj = NULL;
2075 Vgrid *arg1 = (Vgrid *) 0 ;
2076 double *arg2 = (double *) 0 ;
2077 PyObject * obj0 = 0 ;
2078 PyObject * obj1 = 0 ;
2079
2080 if(!PyArg_ParseTuple(args,(char *)"OO:Vgrid_data_set",&obj0,&obj1)) goto fail;
2081 SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_Vgrid, SWIG_POINTER_EXCEPTION | 0);
2082 if (SWIG_arg_fail(1)) SWIG_fail;
2083 SWIG_Python_ConvertPtr(obj1, (void **)&arg2, SWIGTYPE_p_double, SWIG_POINTER_EXCEPTION | SWIG_POINTER_DISOWN);
2084 if (SWIG_arg_fail(2)) SWIG_fail;
2085 if (arg1) (arg1)->data = arg2;
2086
2087 Py_INCREF(Py_None); resultobj = Py_None;
2088 return resultobj;
2089 fail:
2090 return NULL;
2091 }
2092
2093
_wrap_Vgrid_data_get(PyObject * self,PyObject * args)2094 static PyObject *_wrap_Vgrid_data_get(PyObject *self, PyObject *args) {
2095 PyObject *resultobj = NULL;
2096 Vgrid *arg1 = (Vgrid *) 0 ;
2097 double *result;
2098 PyObject * obj0 = 0 ;
2099
2100 if(!PyArg_ParseTuple(args,(char *)"O:Vgrid_data_get",&obj0)) goto fail;
2101 SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_Vgrid, SWIG_POINTER_EXCEPTION | 0);
2102 if (SWIG_arg_fail(1)) SWIG_fail;
2103 result = (double *) ((arg1)->data);
2104
2105 resultobj = SWIG_NewPointerObj((void*)(result), SWIGTYPE_p_double, 0);
2106 return resultobj;
2107 fail:
2108 return NULL;
2109 }
2110
2111
Vgrid_swigregister(PyObject * self,PyObject * args)2112 static PyObject * Vgrid_swigregister(PyObject *self, PyObject *args) {
2113 PyObject *obj;
2114 if (!PyArg_ParseTuple(args,(char*)"O", &obj)) return NULL;
2115 SWIG_TypeClientData(SWIGTYPE_p_Vgrid, obj);
2116 Py_INCREF(obj);
2117 return Py_BuildValue((char *)"");
2118 }
_wrap_delete_vgrid(PyObject * self,PyObject * args)2119 static PyObject *_wrap_delete_vgrid(PyObject *self, PyObject *args) {
2120 PyObject *resultobj = NULL;
2121 Vgrid *arg1 = (Vgrid *) 0 ;
2122 PyObject * obj0 = 0 ;
2123
2124 if(!PyArg_ParseTuple(args,(char *)"O:delete_vgrid",&obj0)) goto fail;
2125 SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_Vgrid, SWIG_POINTER_EXCEPTION | 0);
2126 if (SWIG_arg_fail(1)) SWIG_fail;
2127 delete_vgrid(arg1);
2128
2129 Py_INCREF(Py_None); resultobj = Py_None;
2130 return resultobj;
2131 fail:
2132 return NULL;
2133 }
2134
2135
_wrap_Vgrid_ctor2(PyObject * self,PyObject * args)2136 static PyObject *_wrap_Vgrid_ctor2(PyObject *self, PyObject *args) {
2137 PyObject *resultobj = NULL;
2138 Vgrid *arg1 = (Vgrid *) 0 ;
2139 int arg2 ;
2140 int arg3 ;
2141 int arg4 ;
2142 double arg5 ;
2143 double arg6 ;
2144 double arg7 ;
2145 double arg8 ;
2146 double arg9 ;
2147 double arg10 ;
2148 double *arg11 = (double *) 0 ;
2149 int result;
2150 PyObject * obj0 = 0 ;
2151 PyObject * obj1 = 0 ;
2152 PyObject * obj2 = 0 ;
2153 PyObject * obj3 = 0 ;
2154 PyObject * obj4 = 0 ;
2155 PyObject * obj5 = 0 ;
2156 PyObject * obj6 = 0 ;
2157 PyObject * obj7 = 0 ;
2158 PyObject * obj8 = 0 ;
2159 PyObject * obj9 = 0 ;
2160 PyObject * obj10 = 0 ;
2161
2162 if(!PyArg_ParseTuple(args,(char *)"OOOOOOOOOOO:Vgrid_ctor2",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5,&obj6,&obj7,&obj8,&obj9,&obj10)) goto fail;
2163 SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_Vgrid, SWIG_POINTER_EXCEPTION | 0);
2164 if (SWIG_arg_fail(1)) SWIG_fail;
2165 {
2166 arg2 = (int)(SWIG_As_int(obj1));
2167 if (SWIG_arg_fail(2)) SWIG_fail;
2168 }
2169 {
2170 arg3 = (int)(SWIG_As_int(obj2));
2171 if (SWIG_arg_fail(3)) SWIG_fail;
2172 }
2173 {
2174 arg4 = (int)(SWIG_As_int(obj3));
2175 if (SWIG_arg_fail(4)) SWIG_fail;
2176 }
2177 {
2178 arg5 = (double)(SWIG_As_double(obj4));
2179 if (SWIG_arg_fail(5)) SWIG_fail;
2180 }
2181 {
2182 arg6 = (double)(SWIG_As_double(obj5));
2183 if (SWIG_arg_fail(6)) SWIG_fail;
2184 }
2185 {
2186 arg7 = (double)(SWIG_As_double(obj6));
2187 if (SWIG_arg_fail(7)) SWIG_fail;
2188 }
2189 {
2190 arg8 = (double)(SWIG_As_double(obj7));
2191 if (SWIG_arg_fail(8)) SWIG_fail;
2192 }
2193 {
2194 arg9 = (double)(SWIG_As_double(obj8));
2195 if (SWIG_arg_fail(9)) SWIG_fail;
2196 }
2197 {
2198 arg10 = (double)(SWIG_As_double(obj9));
2199 if (SWIG_arg_fail(10)) SWIG_fail;
2200 }
2201 SWIG_Python_ConvertPtr(obj10, (void **)&arg11, SWIGTYPE_p_double, SWIG_POINTER_EXCEPTION | 0);
2202 if (SWIG_arg_fail(11)) SWIG_fail;
2203 result = (int)Vgrid_ctor2(arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9,arg10,arg11);
2204
2205 {
2206 resultobj = SWIG_From_int((int)(result));
2207 }
2208 return resultobj;
2209 fail:
2210 return NULL;
2211 }
2212
2213
_wrap_Vgrid_dtor(PyObject * self,PyObject * args)2214 static PyObject *_wrap_Vgrid_dtor(PyObject *self, PyObject *args) {
2215 PyObject *resultobj = NULL;
2216 Vgrid **arg1 = (Vgrid **) 0 ;
2217 PyObject * obj0 = 0 ;
2218
2219 if(!PyArg_ParseTuple(args,(char *)"O:Vgrid_dtor",&obj0)) goto fail;
2220 SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_p_Vgrid, SWIG_POINTER_EXCEPTION | 0);
2221 if (SWIG_arg_fail(1)) SWIG_fail;
2222 Vgrid_dtor(arg1);
2223
2224 Py_INCREF(Py_None); resultobj = Py_None;
2225 return resultobj;
2226 fail:
2227 return NULL;
2228 }
2229
2230
_wrap_Vgrid_dtor2(PyObject * self,PyObject * args)2231 static PyObject *_wrap_Vgrid_dtor2(PyObject *self, PyObject *args) {
2232 PyObject *resultobj = NULL;
2233 Vgrid *arg1 = (Vgrid *) 0 ;
2234 PyObject * obj0 = 0 ;
2235
2236 if(!PyArg_ParseTuple(args,(char *)"O:Vgrid_dtor2",&obj0)) goto fail;
2237 SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_Vgrid, SWIG_POINTER_EXCEPTION | 0);
2238 if (SWIG_arg_fail(1)) SWIG_fail;
2239 Vgrid_dtor2(arg1);
2240
2241 Py_INCREF(Py_None); resultobj = Py_None;
2242 return resultobj;
2243 fail:
2244 return NULL;
2245 }
2246
2247
_wrap_Vgrid_writeUHBD(PyObject * self,PyObject * args)2248 static PyObject *_wrap_Vgrid_writeUHBD(PyObject *self, PyObject *args) {
2249 PyObject *resultobj = NULL;
2250 Vgrid *arg1 = (Vgrid *) 0 ;
2251 char *arg2 = (char *) 0 ;
2252 char *arg3 = (char *) 0 ;
2253 char *arg4 = (char *) 0 ;
2254 char *arg5 = (char *) 0 ;
2255 char *arg6 = (char *) 0 ;
2256 double *arg7 = (double *) 0 ;
2257 PyObject * obj0 = 0 ;
2258 PyObject * obj1 = 0 ;
2259 PyObject * obj2 = 0 ;
2260 PyObject * obj3 = 0 ;
2261 PyObject * obj4 = 0 ;
2262 PyObject * obj5 = 0 ;
2263 PyObject * obj6 = 0 ;
2264
2265 if(!PyArg_ParseTuple(args,(char *)"OOOOOOO:Vgrid_writeUHBD",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5,&obj6)) goto fail;
2266 SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_Vgrid, SWIG_POINTER_EXCEPTION | 0);
2267 if (SWIG_arg_fail(1)) SWIG_fail;
2268 if (!SWIG_AsCharPtr(obj1, (char**)&arg2)) {
2269 SWIG_arg_fail(2);SWIG_fail;
2270 }
2271 if (!SWIG_AsCharPtr(obj2, (char**)&arg3)) {
2272 SWIG_arg_fail(3);SWIG_fail;
2273 }
2274 if (!SWIG_AsCharPtr(obj3, (char**)&arg4)) {
2275 SWIG_arg_fail(4);SWIG_fail;
2276 }
2277 if (!SWIG_AsCharPtr(obj4, (char**)&arg5)) {
2278 SWIG_arg_fail(5);SWIG_fail;
2279 }
2280 if (!SWIG_AsCharPtr(obj5, (char**)&arg6)) {
2281 SWIG_arg_fail(6);SWIG_fail;
2282 }
2283 SWIG_Python_ConvertPtr(obj6, (void **)&arg7, SWIGTYPE_p_double, SWIG_POINTER_EXCEPTION | 0);
2284 if (SWIG_arg_fail(7)) SWIG_fail;
2285 Vgrid_writeUHBD(arg1,(char const *)arg2,(char const *)arg3,(char const *)arg4,(char const *)arg5,arg6,arg7);
2286
2287 Py_INCREF(Py_None); resultobj = Py_None;
2288 return resultobj;
2289 fail:
2290 return NULL;
2291 }
2292
2293
_wrap_Vgrid_writeDX(PyObject * self,PyObject * args)2294 static PyObject *_wrap_Vgrid_writeDX(PyObject *self, PyObject *args) {
2295 PyObject *resultobj = NULL;
2296 Vgrid *arg1 = (Vgrid *) 0 ;
2297 char *arg2 = (char *) 0 ;
2298 char *arg3 = (char *) 0 ;
2299 char *arg4 = (char *) 0 ;
2300 char *arg5 = (char *) 0 ;
2301 char *arg6 = (char *) 0 ;
2302 double *arg7 = (double *) 0 ;
2303 PyObject * obj0 = 0 ;
2304 PyObject * obj1 = 0 ;
2305 PyObject * obj2 = 0 ;
2306 PyObject * obj3 = 0 ;
2307 PyObject * obj4 = 0 ;
2308 PyObject * obj5 = 0 ;
2309 PyObject * obj6 = 0 ;
2310
2311 if(!PyArg_ParseTuple(args,(char *)"OOOOOOO:Vgrid_writeDX",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5,&obj6)) goto fail;
2312 SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_Vgrid, SWIG_POINTER_EXCEPTION | 0);
2313 if (SWIG_arg_fail(1)) SWIG_fail;
2314 if (!SWIG_AsCharPtr(obj1, (char**)&arg2)) {
2315 SWIG_arg_fail(2);SWIG_fail;
2316 }
2317 if (!SWIG_AsCharPtr(obj2, (char**)&arg3)) {
2318 SWIG_arg_fail(3);SWIG_fail;
2319 }
2320 if (!SWIG_AsCharPtr(obj3, (char**)&arg4)) {
2321 SWIG_arg_fail(4);SWIG_fail;
2322 }
2323 if (!SWIG_AsCharPtr(obj4, (char**)&arg5)) {
2324 SWIG_arg_fail(5);SWIG_fail;
2325 }
2326 if (!SWIG_AsCharPtr(obj5, (char**)&arg6)) {
2327 SWIG_arg_fail(6);SWIG_fail;
2328 }
2329 SWIG_Python_ConvertPtr(obj6, (void **)&arg7, SWIGTYPE_p_double, SWIG_POINTER_EXCEPTION | 0);
2330 if (SWIG_arg_fail(7)) SWIG_fail;
2331 Vgrid_writeDX(arg1,(char const *)arg2,(char const *)arg3,(char const *)arg4,(char const *)arg5,arg6,arg7);
2332
2333 Py_INCREF(Py_None); resultobj = Py_None;
2334 return resultobj;
2335 fail:
2336 return NULL;
2337 }
2338
2339
_wrap_Vgrid_readDX(PyObject * self,PyObject * args)2340 static PyObject *_wrap_Vgrid_readDX(PyObject *self, PyObject *args) {
2341 PyObject *resultobj = NULL;
2342 Vgrid *arg1 = (Vgrid *) 0 ;
2343 char *arg2 = (char *) 0 ;
2344 char *arg3 = (char *) 0 ;
2345 char *arg4 = (char *) 0 ;
2346 char *arg5 = (char *) 0 ;
2347 int result;
2348 PyObject * obj0 = 0 ;
2349 PyObject * obj1 = 0 ;
2350 PyObject * obj2 = 0 ;
2351 PyObject * obj3 = 0 ;
2352 PyObject * obj4 = 0 ;
2353
2354 if(!PyArg_ParseTuple(args,(char *)"OOOOO:Vgrid_readDX",&obj0,&obj1,&obj2,&obj3,&obj4)) goto fail;
2355 SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_Vgrid, SWIG_POINTER_EXCEPTION | 0);
2356 if (SWIG_arg_fail(1)) SWIG_fail;
2357 if (!SWIG_AsCharPtr(obj1, (char**)&arg2)) {
2358 SWIG_arg_fail(2);SWIG_fail;
2359 }
2360 if (!SWIG_AsCharPtr(obj2, (char**)&arg3)) {
2361 SWIG_arg_fail(3);SWIG_fail;
2362 }
2363 if (!SWIG_AsCharPtr(obj3, (char**)&arg4)) {
2364 SWIG_arg_fail(4);SWIG_fail;
2365 }
2366 if (!SWIG_AsCharPtr(obj4, (char**)&arg5)) {
2367 SWIG_arg_fail(5);SWIG_fail;
2368 }
2369 result = (int)Vgrid_readDX(arg1,(char const *)arg2,(char const *)arg3,(char const *)arg4,(char const *)arg5);
2370
2371 {
2372 resultobj = SWIG_From_int((int)(result));
2373 }
2374 return resultobj;
2375 fail:
2376 return NULL;
2377 }
2378
2379
_wrap_startVio(PyObject * self,PyObject * args)2380 static PyObject *_wrap_startVio(PyObject *self, PyObject *args) {
2381 PyObject *resultobj = NULL;
2382
2383 if(!PyArg_ParseTuple(args,(char *)":startVio")) goto fail;
2384 startVio();
2385
2386 Py_INCREF(Py_None); resultobj = Py_None;
2387 return resultobj;
2388 fail:
2389 return NULL;
2390 }
2391
2392
_wrap_Vgrid_value(PyObject * self,PyObject * args)2393 static PyObject *_wrap_Vgrid_value(PyObject *self, PyObject *args) {
2394 PyObject *resultobj = NULL;
2395 Vgrid *arg1 = (Vgrid *) 0 ;
2396 double *arg2 ;
2397 double *arg3 = (double *) 0 ;
2398 int result;
2399 double temp3 ;
2400 int res3 = 0 ;
2401 PyObject * obj0 = 0 ;
2402 PyObject * obj1 = 0 ;
2403 PyObject * obj2 = 0 ;
2404
2405 if(!PyArg_ParseTuple(args,(char *)"OOO:Vgrid_value",&obj0,&obj1,&obj2)) goto fail;
2406 SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_Vgrid, SWIG_POINTER_EXCEPTION | 0);
2407 if (SWIG_arg_fail(1)) SWIG_fail;
2408 {
2409 /* Check if is a list */
2410 if (PyList_Check(obj1)) {
2411 int size = PyList_Size(obj1);
2412 int i = 0;
2413 arg2 = (double *) malloc((size+1)*sizeof(double));
2414 for (i = 0; i < size; i++) {
2415 PyObject *o = PyList_GetItem(obj1,i);
2416 if (PyFloat_Check(o))
2417 arg2[i] = PyFloat_AsDouble(PyList_GetItem(obj1,i));
2418 else {
2419 PyErr_SetString(PyExc_TypeError,"list must contain floats");
2420 free(arg2);
2421 return NULL;
2422 }
2423 }
2424 arg2[i] = 0;
2425 } else {
2426 PyErr_SetString(PyExc_TypeError,"not a list");
2427 return NULL;
2428 }
2429 }
2430 {
2431 if (!(SWIG_ConvertPtr(obj2,(void **)(&arg3),SWIGTYPE_p_double,0) != -1)) {
2432 temp3 = SWIG_As_double(obj2);
2433 if (SWIG_arg_fail(3)) SWIG_fail;
2434 arg3 = &temp3;
2435 res3 = SWIG_NEWOBJ;
2436 }
2437 }
2438 result = (int)Vgrid_value(arg1,arg2,arg3);
2439
2440 {
2441 resultobj = SWIG_From_int((int)(result));
2442 }
2443 resultobj = t_output_helper(resultobj, ((res3 == SWIG_NEWOBJ) ?
2444 SWIG_From_double((*arg3)) : SWIG_NewPointerObj((void*)(arg3), SWIGTYPE_p_double, 0)));
2445 return resultobj;
2446 fail:
2447 return NULL;
2448 }
2449
2450
_wrap_Vgrid_curvature(PyObject * self,PyObject * args)2451 static PyObject *_wrap_Vgrid_curvature(PyObject *self, PyObject *args) {
2452 PyObject *resultobj = NULL;
2453 Vgrid *arg1 = (Vgrid *) 0 ;
2454 double *arg2 ;
2455 int arg3 ;
2456 double *arg4 = (double *) 0 ;
2457 int result;
2458 PyObject * obj0 = 0 ;
2459 PyObject * obj1 = 0 ;
2460 PyObject * obj2 = 0 ;
2461 PyObject * obj3 = 0 ;
2462
2463 if(!PyArg_ParseTuple(args,(char *)"OOOO:Vgrid_curvature",&obj0,&obj1,&obj2,&obj3)) goto fail;
2464 SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_Vgrid, SWIG_POINTER_EXCEPTION | 0);
2465 if (SWIG_arg_fail(1)) SWIG_fail;
2466 {
2467 /* Check if is a list */
2468 if (PyList_Check(obj1)) {
2469 int size = PyList_Size(obj1);
2470 int i = 0;
2471 arg2 = (double *) malloc((size+1)*sizeof(double));
2472 for (i = 0; i < size; i++) {
2473 PyObject *o = PyList_GetItem(obj1,i);
2474 if (PyFloat_Check(o))
2475 arg2[i] = PyFloat_AsDouble(PyList_GetItem(obj1,i));
2476 else {
2477 PyErr_SetString(PyExc_TypeError,"list must contain floats");
2478 free(arg2);
2479 return NULL;
2480 }
2481 }
2482 arg2[i] = 0;
2483 } else {
2484 PyErr_SetString(PyExc_TypeError,"not a list");
2485 return NULL;
2486 }
2487 }
2488 {
2489 arg3 = (int)(SWIG_As_int(obj2));
2490 if (SWIG_arg_fail(3)) SWIG_fail;
2491 }
2492 {
2493 if (PyList_Check(obj3)) {
2494 int size = PyList_Size(obj3);
2495 int i = 0;
2496 arg4 = (double *) malloc((size+1)*sizeof(double));
2497 for (i = 0; i < size; i++) {
2498 PyObject *o = PyList_GetItem(obj3,i);
2499 if (PyFloat_Check(o))
2500 arg4[i] = PyFloat_AsDouble(PyList_GetItem(obj3,i));
2501 else {
2502 PyErr_SetString(PyExc_TypeError,"list must contain floats");
2503 free(arg4);
2504 return NULL;
2505 }
2506 }
2507 arg4[i] = 0;
2508 } else {
2509 PyErr_SetString(PyExc_TypeError,"not a list");
2510 return NULL;
2511 }
2512 }
2513 result = (int)Vgrid_curvature(arg1,arg2,arg3,arg4);
2514
2515 {
2516 resultobj = SWIG_From_int((int)(result));
2517 }
2518 return resultobj;
2519 fail:
2520 return NULL;
2521 }
2522
2523
_wrap_Vgrid_gradient(PyObject * self,PyObject * args)2524 static PyObject *_wrap_Vgrid_gradient(PyObject *self, PyObject *args) {
2525 PyObject *resultobj = NULL;
2526 Vgrid *arg1 = (Vgrid *) 0 ;
2527 double *arg2 ;
2528 double *arg3 ;
2529 int result;
2530 PyObject * obj0 = 0 ;
2531 PyObject * obj1 = 0 ;
2532 PyObject * obj2 = 0 ;
2533
2534 if(!PyArg_ParseTuple(args,(char *)"OOO:Vgrid_gradient",&obj0,&obj1,&obj2)) goto fail;
2535 SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_Vgrid, SWIG_POINTER_EXCEPTION | 0);
2536 if (SWIG_arg_fail(1)) SWIG_fail;
2537 {
2538 /* Check if is a list */
2539 if (PyList_Check(obj1)) {
2540 int size = PyList_Size(obj1);
2541 int i = 0;
2542 arg2 = (double *) malloc((size+1)*sizeof(double));
2543 for (i = 0; i < size; i++) {
2544 PyObject *o = PyList_GetItem(obj1,i);
2545 if (PyFloat_Check(o))
2546 arg2[i] = PyFloat_AsDouble(PyList_GetItem(obj1,i));
2547 else {
2548 PyErr_SetString(PyExc_TypeError,"list must contain floats");
2549 free(arg2);
2550 return NULL;
2551 }
2552 }
2553 arg2[i] = 0;
2554 } else {
2555 PyErr_SetString(PyExc_TypeError,"not a list");
2556 return NULL;
2557 }
2558 }
2559 {
2560 /* Check if is a list */
2561 if (PyList_Check(obj2)) {
2562 int size = PyList_Size(obj2);
2563 int i = 0;
2564 arg3 = (double *) malloc((size+1)*sizeof(double));
2565 for (i = 0; i < size; i++) {
2566 PyObject *o = PyList_GetItem(obj2,i);
2567 if (PyFloat_Check(o))
2568 arg3[i] = PyFloat_AsDouble(PyList_GetItem(obj2,i));
2569 else {
2570 PyErr_SetString(PyExc_TypeError,"list must contain floats");
2571 free(arg3);
2572 return NULL;
2573 }
2574 }
2575 arg3[i] = 0;
2576 } else {
2577 PyErr_SetString(PyExc_TypeError,"not a list");
2578 return NULL;
2579 }
2580 }
2581 result = (int)Vgrid_gradient(arg1,arg2,arg3);
2582
2583 {
2584 resultobj = SWIG_From_int((int)(result));
2585 }
2586 return resultobj;
2587 fail:
2588 return NULL;
2589 }
2590
2591
_wrap_Vgrid_ctor(PyObject * self,PyObject * args)2592 static PyObject *_wrap_Vgrid_ctor(PyObject *self, PyObject *args) {
2593 PyObject *resultobj = NULL;
2594 int arg1 ;
2595 int arg2 ;
2596 int arg3 ;
2597 double arg4 ;
2598 double arg5 ;
2599 double arg6 ;
2600 double arg7 ;
2601 double arg8 ;
2602 double arg9 ;
2603 double *arg10 = (double *) 0 ;
2604 Vgrid *result;
2605 PyObject * obj0 = 0 ;
2606 PyObject * obj1 = 0 ;
2607 PyObject * obj2 = 0 ;
2608 PyObject * obj3 = 0 ;
2609 PyObject * obj4 = 0 ;
2610 PyObject * obj5 = 0 ;
2611 PyObject * obj6 = 0 ;
2612 PyObject * obj7 = 0 ;
2613 PyObject * obj8 = 0 ;
2614 PyObject * obj9 = 0 ;
2615
2616 if(!PyArg_ParseTuple(args,(char *)"OOOOOOOOOO:Vgrid_ctor",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5,&obj6,&obj7,&obj8,&obj9)) goto fail;
2617 {
2618 arg1 = (int)(SWIG_As_int(obj0));
2619 if (SWIG_arg_fail(1)) SWIG_fail;
2620 }
2621 {
2622 arg2 = (int)(SWIG_As_int(obj1));
2623 if (SWIG_arg_fail(2)) SWIG_fail;
2624 }
2625 {
2626 arg3 = (int)(SWIG_As_int(obj2));
2627 if (SWIG_arg_fail(3)) SWIG_fail;
2628 }
2629 {
2630 arg4 = (double)(SWIG_As_double(obj3));
2631 if (SWIG_arg_fail(4)) SWIG_fail;
2632 }
2633 {
2634 arg5 = (double)(SWIG_As_double(obj4));
2635 if (SWIG_arg_fail(5)) SWIG_fail;
2636 }
2637 {
2638 arg6 = (double)(SWIG_As_double(obj5));
2639 if (SWIG_arg_fail(6)) SWIG_fail;
2640 }
2641 {
2642 arg7 = (double)(SWIG_As_double(obj6));
2643 if (SWIG_arg_fail(7)) SWIG_fail;
2644 }
2645 {
2646 arg8 = (double)(SWIG_As_double(obj7));
2647 if (SWIG_arg_fail(8)) SWIG_fail;
2648 }
2649 {
2650 arg9 = (double)(SWIG_As_double(obj8));
2651 if (SWIG_arg_fail(9)) SWIG_fail;
2652 }
2653 {
2654 if (PyList_Check(obj9)) {
2655 int size = PyList_Size(obj9);
2656 int i = 0;
2657 arg10 = (double *) malloc((size+1)*sizeof(double));
2658 for (i = 0; i < size; i++) {
2659 PyObject *o = PyList_GetItem(obj9,i);
2660 if (PyFloat_Check(o))
2661 arg10[i] = PyFloat_AsDouble(PyList_GetItem(obj9,i));
2662 else {
2663 PyErr_SetString(PyExc_TypeError,"list must contain floats");
2664 free(arg10);
2665 return NULL;
2666 }
2667 }
2668 arg10[i] = 0;
2669 } else {
2670 PyErr_SetString(PyExc_TypeError,"not a list");
2671 return NULL;
2672 }
2673 }
2674 result = (Vgrid *)Vgrid_ctor(arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9,arg10);
2675
2676 resultobj = SWIG_NewPointerObj((void*)(result), SWIGTYPE_p_Vgrid, 0);
2677 return resultobj;
2678 fail:
2679 return NULL;
2680 }
2681
2682
2683 static PyMethodDef SwigMethods[] = {
2684 { (char *)"null_array", _wrap_null_array, METH_VARARGS, NULL},
2685 { (char *)"new_Vgrid", _wrap_new_Vgrid, METH_VARARGS, NULL},
2686 { (char *)"delete_Vgrid", _wrap_delete_Vgrid, METH_VARARGS, NULL},
2687 { (char *)"Vgrid_nx_set", _wrap_Vgrid_nx_set, METH_VARARGS, NULL},
2688 { (char *)"Vgrid_nx_get", _wrap_Vgrid_nx_get, METH_VARARGS, NULL},
2689 { (char *)"Vgrid_ny_set", _wrap_Vgrid_ny_set, METH_VARARGS, NULL},
2690 { (char *)"Vgrid_ny_get", _wrap_Vgrid_ny_get, METH_VARARGS, NULL},
2691 { (char *)"Vgrid_nz_set", _wrap_Vgrid_nz_set, METH_VARARGS, NULL},
2692 { (char *)"Vgrid_nz_get", _wrap_Vgrid_nz_get, METH_VARARGS, NULL},
2693 { (char *)"Vgrid_hx_set", _wrap_Vgrid_hx_set, METH_VARARGS, NULL},
2694 { (char *)"Vgrid_hx_get", _wrap_Vgrid_hx_get, METH_VARARGS, NULL},
2695 { (char *)"Vgrid_hy_set", _wrap_Vgrid_hy_set, METH_VARARGS, NULL},
2696 { (char *)"Vgrid_hy_get", _wrap_Vgrid_hy_get, METH_VARARGS, NULL},
2697 { (char *)"Vgrid_hzed_set", _wrap_Vgrid_hzed_set, METH_VARARGS, NULL},
2698 { (char *)"Vgrid_hzed_get", _wrap_Vgrid_hzed_get, METH_VARARGS, NULL},
2699 { (char *)"Vgrid_xmin_set", _wrap_Vgrid_xmin_set, METH_VARARGS, NULL},
2700 { (char *)"Vgrid_xmin_get", _wrap_Vgrid_xmin_get, METH_VARARGS, NULL},
2701 { (char *)"Vgrid_ymin_set", _wrap_Vgrid_ymin_set, METH_VARARGS, NULL},
2702 { (char *)"Vgrid_ymin_get", _wrap_Vgrid_ymin_get, METH_VARARGS, NULL},
2703 { (char *)"Vgrid_zmin_set", _wrap_Vgrid_zmin_set, METH_VARARGS, NULL},
2704 { (char *)"Vgrid_zmin_get", _wrap_Vgrid_zmin_get, METH_VARARGS, NULL},
2705 { (char *)"Vgrid_data_set", _wrap_Vgrid_data_set, METH_VARARGS, NULL},
2706 { (char *)"Vgrid_data_get", _wrap_Vgrid_data_get, METH_VARARGS, NULL},
2707 { (char *)"Vgrid_swigregister", Vgrid_swigregister, METH_VARARGS, NULL},
2708 { (char *)"delete_vgrid", _wrap_delete_vgrid, METH_VARARGS, NULL},
2709 { (char *)"Vgrid_ctor2", _wrap_Vgrid_ctor2, METH_VARARGS, NULL},
2710 { (char *)"Vgrid_dtor", _wrap_Vgrid_dtor, METH_VARARGS, NULL},
2711 { (char *)"Vgrid_dtor2", _wrap_Vgrid_dtor2, METH_VARARGS, NULL},
2712 { (char *)"Vgrid_writeUHBD", _wrap_Vgrid_writeUHBD, METH_VARARGS, NULL},
2713 { (char *)"Vgrid_writeDX", _wrap_Vgrid_writeDX, METH_VARARGS, NULL},
2714 { (char *)"Vgrid_readDX", _wrap_Vgrid_readDX, METH_VARARGS, NULL},
2715 { (char *)"startVio", _wrap_startVio, METH_VARARGS, NULL},
2716 { (char *)"Vgrid_value", _wrap_Vgrid_value, METH_VARARGS, NULL},
2717 { (char *)"Vgrid_curvature", _wrap_Vgrid_curvature, METH_VARARGS, NULL},
2718 { (char *)"Vgrid_gradient", _wrap_Vgrid_gradient, METH_VARARGS, NULL},
2719 { (char *)"Vgrid_ctor", _wrap_Vgrid_ctor, METH_VARARGS, NULL},
2720 { NULL, NULL, 0, NULL }
2721 };
2722
2723
2724 /* -------- TYPE CONVERSION AND EQUIVALENCE RULES (BEGIN) -------- */
2725
2726 static swig_type_info _swigt__p_Vgrid = {"_p_Vgrid", "Vgrid *", 0, 0, 0};
2727 static swig_type_info _swigt__p_char = {"_p_char", "char *", 0, 0, 0};
2728 static swig_type_info _swigt__p_double = {"_p_double", "double *", 0, 0, 0};
2729 static swig_type_info _swigt__p_p_Vgrid = {"_p_p_Vgrid", "Vgrid **", 0, 0, 0};
2730 static swig_type_info _swigt__ptrdiff_t = {"_ptrdiff_t", "ptrdiff_t", 0, 0, 0};
2731 static swig_type_info _swigt__size_t = {"_size_t", "size_t", 0, 0, 0};
2732
2733 static swig_type_info *swig_type_initial[] = {
2734 &_swigt__p_Vgrid,
2735 &_swigt__p_char,
2736 &_swigt__p_double,
2737 &_swigt__p_p_Vgrid,
2738 &_swigt__ptrdiff_t,
2739 &_swigt__size_t,
2740 };
2741
2742 static swig_cast_info _swigc__p_Vgrid[] = { {&_swigt__p_Vgrid, 0, 0, 0},{0, 0, 0, 0}};
2743 static swig_cast_info _swigc__p_char[] = { {&_swigt__p_char, 0, 0, 0},{0, 0, 0, 0}};
2744 static swig_cast_info _swigc__p_double[] = { {&_swigt__p_double, 0, 0, 0},{0, 0, 0, 0}};
2745 static swig_cast_info _swigc__p_p_Vgrid[] = { {&_swigt__p_p_Vgrid, 0, 0, 0},{0, 0, 0, 0}};
2746 static swig_cast_info _swigc__ptrdiff_t[] = { {&_swigt__ptrdiff_t, 0, 0, 0},{0, 0, 0, 0}};
2747 static swig_cast_info _swigc__size_t[] = { {&_swigt__size_t, 0, 0, 0},{0, 0, 0, 0}};
2748
2749 static swig_cast_info *swig_cast_initial[] = {
2750 _swigc__p_Vgrid,
2751 _swigc__p_char,
2752 _swigc__p_double,
2753 _swigc__p_p_Vgrid,
2754 _swigc__ptrdiff_t,
2755 _swigc__size_t,
2756 };
2757
2758
2759 /* -------- TYPE CONVERSION AND EQUIVALENCE RULES (END) -------- */
2760
2761 static swig_const_info swig_const_table[] = {
2762 {0, 0, 0, 0.0, 0, 0}};
2763
2764 #ifdef __cplusplus
2765 }
2766 #endif
2767 /*************************************************************************
2768 * Type initialization:
2769 * This problem is tough by the requirement that no dynamic
2770 * memory is used. Also, since swig_type_info structures store pointers to
2771 * swig_cast_info structures and swig_cast_info structures store pointers back
2772 * to swig_type_info structures, we need some lookup code at initialization.
2773 * The idea is that swig generates all the structures that are needed.
2774 * The runtime then collects these partially filled structures.
2775 * The SWIG_InitializeModule function takes these initial arrays out of
2776 * swig_module, and does all the lookup, filling in the swig_module.types
2777 * array with the correct data and linking the correct swig_cast_info
2778 * structures together.
2779
2780 * The generated swig_type_info structures are assigned staticly to an initial
2781 * array. We just loop though that array, and handle each type individually.
2782 * First we lookup if this type has been already loaded, and if so, use the
2783 * loaded structure instead of the generated one. Then we have to fill in the
2784 * cast linked list. The cast data is initially stored in something like a
2785 * two-dimensional array. Each row corresponds to a type (there are the same
2786 * number of rows as there are in the swig_type_initial array). Each entry in
2787 * a column is one of the swig_cast_info structures for that type.
2788 * The cast_initial array is actually an array of arrays, because each row has
2789 * a variable number of columns. So to actually build the cast linked list,
2790 * we find the array of casts associated with the type, and loop through it
2791 * adding the casts to the list. The one last trick we need to do is making
2792 * sure the type pointer in the swig_cast_info struct is correct.
2793
2794 * First off, we lookup the cast->type name to see if it is already loaded.
2795 * There are three cases to handle:
2796 * 1) If the cast->type has already been loaded AND the type we are adding
2797 * casting info to has not been loaded (it is in this module), THEN we
2798 * replace the cast->type pointer with the type pointer that has already
2799 * been loaded.
2800 * 2) If BOTH types (the one we are adding casting info to, and the
2801 * cast->type) are loaded, THEN the cast info has already been loaded by
2802 * the previous module so we just ignore it.
2803 * 3) Finally, if cast->type has not already been loaded, then we add that
2804 * swig_cast_info to the linked list (because the cast->type) pointer will
2805 * be correct.
2806 **/
2807
2808 #ifdef __cplusplus
2809 extern "C" {
2810 #endif
2811
2812 SWIGRUNTIME void
SWIG_InitializeModule(void * clientdata)2813 SWIG_InitializeModule(void *clientdata) {
2814 swig_type_info *type, *ret;
2815 swig_cast_info *cast;
2816 size_t i;
2817 swig_module_info *module_head;
2818 static int init_run = 0;
2819
2820 clientdata = clientdata;
2821
2822 if (init_run) return;
2823 init_run = 1;
2824
2825 /* Initialize the swig_module */
2826 swig_module.type_initial = swig_type_initial;
2827 swig_module.cast_initial = swig_cast_initial;
2828
2829 /* Try and load any already created modules */
2830 module_head = SWIG_GetModule(clientdata);
2831 if (module_head) {
2832 swig_module.next = module_head->next;
2833 module_head->next = &swig_module;
2834 } else {
2835 /* This is the first module loaded */
2836 swig_module.next = &swig_module;
2837 SWIG_SetModule(clientdata, &swig_module);
2838 }
2839
2840 /* Now work on filling in swig_module.types */
2841 for (i = 0; i < swig_module.size; ++i) {
2842 type = 0;
2843
2844 /* if there is another module already loaded */
2845 if (swig_module.next != &swig_module) {
2846 type = SWIG_MangledTypeQueryModule(swig_module.next, &swig_module, swig_module.type_initial[i]->name);
2847 }
2848 if (type) {
2849 /* Overwrite clientdata field */
2850 if (swig_module.type_initial[i]->clientdata) type->clientdata = swig_module.type_initial[i]->clientdata;
2851 } else {
2852 type = swig_module.type_initial[i];
2853 }
2854
2855 /* Insert casting types */
2856 cast = swig_module.cast_initial[i];
2857 while (cast->type) {
2858 /* Don't need to add information already in the list */
2859 ret = 0;
2860 if (swig_module.next != &swig_module) {
2861 ret = SWIG_MangledTypeQueryModule(swig_module.next, &swig_module, cast->type->name);
2862 }
2863 if (ret && type == swig_module.type_initial[i]) {
2864 cast->type = ret;
2865 ret = 0;
2866 }
2867
2868 if (!ret) {
2869 if (type->cast) {
2870 type->cast->prev = cast;
2871 cast->next = type->cast;
2872 }
2873 type->cast = cast;
2874 }
2875
2876 cast++;
2877 }
2878
2879 /* Set entry in modules->types array equal to the type */
2880 swig_module.types[i] = type;
2881 }
2882 }
2883
2884 /* This function will propagate the clientdata field of type to
2885 * any new swig_type_info structures that have been added into the list
2886 * of equivalent types. It is like calling
2887 * SWIG_TypeClientData(type, clientdata) a second time.
2888 */
2889 SWIGRUNTIME void
SWIG_PropagateClientData(void)2890 SWIG_PropagateClientData(void) {
2891 size_t i;
2892 swig_cast_info *equiv;
2893 static int init_run = 0;
2894
2895 if (init_run) return;
2896 init_run = 1;
2897
2898 for (i = 0; i < swig_module.size; i++) {
2899 if (swig_module.types[i]->clientdata) {
2900 equiv = swig_module.types[i]->cast;
2901 while (equiv) {
2902 if (!equiv->converter) {
2903 if (equiv->type && !equiv->type->clientdata)
2904 SWIG_TypeClientData(equiv->type, swig_module.types[i]->clientdata);
2905 }
2906 equiv = equiv->next;
2907 }
2908 }
2909 }
2910 }
2911
2912 #ifdef __cplusplus
2913 }
2914 #endif
2915
2916
2917
2918 #ifdef __cplusplus
2919 extern "C" {
2920 #endif
2921
2922 /* Python-specific SWIG API */
2923 #define SWIG_newvarlink() SWIG_Python_newvarlink()
2924 #define SWIG_addvarlink(p, name, get_attr, set_attr) SWIG_Python_addvarlink(p, name, get_attr, set_attr)
2925 #define SWIG_InstallConstants(d, constants) SWIG_Python_InstallConstants(d, constants)
2926
2927 /* -----------------------------------------------------------------------------
2928 * global variable support code.
2929 * ----------------------------------------------------------------------------- */
2930
2931 typedef struct swig_globalvar {
2932 char *name; /* Name of global variable */
2933 PyObject *(*get_attr)(void); /* Return the current value */
2934 int (*set_attr)(PyObject *); /* Set the value */
2935 struct swig_globalvar *next;
2936 } swig_globalvar;
2937
2938 typedef struct swig_varlinkobject {
2939 PyObject_HEAD
2940 swig_globalvar *vars;
2941 } swig_varlinkobject;
2942
2943 SWIGINTERN PyObject *
swig_varlink_repr(swig_varlinkobject * v)2944 swig_varlink_repr(swig_varlinkobject *v) {
2945 v = v;
2946 return PyString_FromString("<Swig global variables>");
2947 }
2948
2949 SWIGINTERN int
swig_varlink_print(swig_varlinkobject * v,FILE * fp,int flags)2950 swig_varlink_print(swig_varlinkobject *v, FILE *fp, int flags) {
2951 swig_globalvar *var;
2952 flags = flags;
2953 fprintf(fp,"Swig global variables { ");
2954 for (var = v->vars; var; var=var->next) {
2955 fprintf(fp,"%s", var->name);
2956 if (var->next) fprintf(fp,", ");
2957 }
2958 fprintf(fp," }\n");
2959 return 0;
2960 }
2961
2962 SWIGINTERN PyObject *
swig_varlink_getattr(swig_varlinkobject * v,char * n)2963 swig_varlink_getattr(swig_varlinkobject *v, char *n) {
2964 swig_globalvar *var = v->vars;
2965 while (var) {
2966 if (strcmp(var->name,n) == 0) {
2967 return (*var->get_attr)();
2968 }
2969 var = var->next;
2970 }
2971 PyErr_SetString(PyExc_NameError,"Unknown C global variable");
2972 return NULL;
2973 }
2974
2975 SWIGINTERN int
swig_varlink_setattr(swig_varlinkobject * v,char * n,PyObject * p)2976 swig_varlink_setattr(swig_varlinkobject *v, char *n, PyObject *p) {
2977 swig_globalvar *var = v->vars;
2978 while (var) {
2979 if (strcmp(var->name,n) == 0) {
2980 return (*var->set_attr)(p);
2981 }
2982 var = var->next;
2983 }
2984 PyErr_SetString(PyExc_NameError,"Unknown C global variable");
2985 return 1;
2986 }
2987
2988 SWIGINTERN PyTypeObject*
swig_varlink_type(void)2989 swig_varlink_type(void) {
2990 static char varlink__doc__[] = "Swig var link object";
2991 static PyTypeObject varlink_type
2992 #if !defined(__cplusplus)
2993 ;
2994 static int type_init = 0;
2995 if (!type_init) {
2996 PyTypeObject tmp
2997 #endif
2998 = {
2999 PyObject_HEAD_INIT(&PyType_Type)
3000 0, /* Number of items in variable part (ob_size) */
3001 (char *)"swigvarlink", /* Type name (tp_name) */
3002 sizeof(swig_varlinkobject), /* Basic size (tp_basicsize) */
3003 0, /* Itemsize (tp_itemsize) */
3004 0, /* Deallocator (tp_dealloc) */
3005 (printfunc) swig_varlink_print, /* Print (tp_print) */
3006 (getattrfunc) swig_varlink_getattr, /* get attr (tp_getattr) */
3007 (setattrfunc) swig_varlink_setattr, /* Set attr (tp_setattr) */
3008 0, /* tp_compare */
3009 (reprfunc) swig_varlink_repr, /* tp_repr */
3010 0, /* tp_as_number */
3011 0, /* tp_as_sequence */
3012 0, /* tp_as_mapping */
3013 0, /* tp_hash */
3014 0, /* tp_call */
3015 0, /* tp_str */
3016 0, /* tp_getattro */
3017 0, /* tp_setattro */
3018 0, /* tp_as_buffer */
3019 0, /* tp_flags */
3020 varlink__doc__, /* tp_doc */
3021 #if PY_VERSION_HEX >= 0x02000000
3022 0, /* tp_traverse */
3023 0, /* tp_clear */
3024 #endif
3025 #if PY_VERSION_HEX >= 0x02010000
3026 0, /* tp_richcompare */
3027 0, /* tp_weaklistoffset */
3028 #endif
3029 #if PY_VERSION_HEX >= 0x02020000
3030 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* tp_iter -> tp_weaklist */
3031 #endif
3032 #if PY_VERSION_HEX >= 0x02030000
3033 0, /* tp_del */
3034 #endif
3035 #ifdef COUNT_ALLOCS
3036 0,0,0,0 /* tp_alloc -> tp_next */
3037 #endif
3038 };
3039 #if !defined(__cplusplus)
3040 varlink_type = tmp;
3041 type_init = 1;
3042 }
3043 #endif
3044 return &varlink_type;
3045 }
3046
3047 /* Create a variable linking object for use later */
3048 SWIGINTERN PyObject *
SWIG_Python_newvarlink(void)3049 SWIG_Python_newvarlink(void) {
3050 swig_varlinkobject *result = PyObject_NEW(swig_varlinkobject, swig_varlink_type());
3051 if (result) {
3052 result->vars = 0;
3053 }
3054 return ((PyObject*) result);
3055 }
3056
3057 SWIGINTERN void
SWIG_Python_addvarlink(PyObject * p,char * name,PyObject * (* get_attr)(void),int (* set_attr)(PyObject * p))3058 SWIG_Python_addvarlink(PyObject *p, char *name, PyObject *(*get_attr)(void), int (*set_attr)(PyObject *p)) {
3059 swig_varlinkobject *v = (swig_varlinkobject *) p;
3060 swig_globalvar *gv = (swig_globalvar *) malloc(sizeof(swig_globalvar));
3061 if (gv) {
3062 size_t size = strlen(name)+1;
3063 gv->name = (char *)malloc(size);
3064 if (gv->name) {
3065 strncpy(gv->name,name,size);
3066 gv->get_attr = get_attr;
3067 gv->set_attr = set_attr;
3068 gv->next = v->vars;
3069 }
3070 }
3071 v->vars = gv;
3072 }
3073
3074 /* -----------------------------------------------------------------------------
3075 * constants/methods manipulation
3076 * ----------------------------------------------------------------------------- */
3077
3078 /* Install Constants */
3079 SWIGINTERN void
SWIG_Python_InstallConstants(PyObject * d,swig_const_info constants[])3080 SWIG_Python_InstallConstants(PyObject *d, swig_const_info constants[]) {
3081 PyObject *obj = 0;
3082 size_t i;
3083 for (i = 0; constants[i].type; ++i) {
3084 switch(constants[i].type) {
3085 case SWIG_PY_INT:
3086 obj = PyInt_FromLong(constants[i].lvalue);
3087 break;
3088 case SWIG_PY_FLOAT:
3089 obj = PyFloat_FromDouble(constants[i].dvalue);
3090 break;
3091 case SWIG_PY_STRING:
3092 if (constants[i].pvalue) {
3093 obj = PyString_FromString((char *) constants[i].pvalue);
3094 } else {
3095 Py_INCREF(Py_None);
3096 obj = Py_None;
3097 }
3098 break;
3099 case SWIG_PY_POINTER:
3100 obj = SWIG_NewPointerObj(constants[i].pvalue, *(constants[i]).ptype,0);
3101 break;
3102 case SWIG_PY_BINARY:
3103 obj = SWIG_NewPackedObj(constants[i].pvalue, constants[i].lvalue, *(constants[i].ptype));
3104 break;
3105 default:
3106 obj = 0;
3107 break;
3108 }
3109 if (obj) {
3110 PyDict_SetItemString(d,constants[i].name,obj);
3111 Py_DECREF(obj);
3112 }
3113 }
3114 }
3115
3116 /* -----------------------------------------------------------------------------*/
3117 /* Fix SwigMethods to carry the callback ptrs when needed */
3118 /* -----------------------------------------------------------------------------*/
3119
3120 SWIGINTERN void
SWIG_Python_FixMethods(PyMethodDef * methods,swig_const_info * const_table,swig_type_info ** types,swig_type_info ** types_initial)3121 SWIG_Python_FixMethods(PyMethodDef *methods,
3122 swig_const_info *const_table,
3123 swig_type_info **types,
3124 swig_type_info **types_initial) {
3125 size_t i;
3126 for (i = 0; methods[i].ml_name; ++i) {
3127 char *c = methods[i].ml_doc;
3128 if (c && (c = strstr(c, "swig_ptr: "))) {
3129 int j;
3130 swig_const_info *ci = 0;
3131 char *name = c + 10;
3132 for (j = 0; const_table[j].type; ++j) {
3133 if (strncmp(const_table[j].name, name,
3134 strlen(const_table[j].name)) == 0) {
3135 ci = &(const_table[j]);
3136 break;
3137 }
3138 }
3139 if (ci) {
3140 size_t shift = (ci->ptype) - types;
3141 swig_type_info *ty = types_initial[shift];
3142 size_t ldoc = (c - methods[i].ml_doc);
3143 size_t lptr = strlen(ty->name)+2*sizeof(void*)+2;
3144 char *ndoc = (char*)malloc(ldoc + lptr + 10);
3145 if (ndoc) {
3146 char *buff = ndoc;
3147 void *ptr = (ci->type == SWIG_PY_POINTER) ? ci->pvalue : 0;
3148 if (ptr) {
3149 strncpy(buff, methods[i].ml_doc, ldoc);
3150 buff += ldoc;
3151 strncpy(buff, "swig_ptr: ", 10);
3152 buff += 10;
3153 SWIG_PackVoidPtr(buff, ptr, ty->name, lptr);
3154 methods[i].ml_doc = ndoc;
3155 }
3156 }
3157 }
3158 }
3159 }
3160 }
3161
3162 /* -----------------------------------------------------------------------------*
3163 * Initialize type list
3164 * -----------------------------------------------------------------------------*/
3165
3166 #if PY_MAJOR_VERSION < 2
3167 /* PyModule_AddObject function was introduced in Python 2.0. The following function
3168 is copied out of Python/modsupport.c in python version 2.3.4 */
3169 SWIGINTERN int
PyModule_AddObject(PyObject * m,char * name,PyObject * o)3170 PyModule_AddObject(PyObject *m, char *name, PyObject *o)
3171 {
3172 PyObject *dict;
3173 if (!PyModule_Check(m)) {
3174 PyErr_SetString(PyExc_TypeError,
3175 "PyModule_AddObject() needs module as first arg");
3176 return -1;
3177 }
3178 if (!o) {
3179 PyErr_SetString(PyExc_TypeError,
3180 "PyModule_AddObject() needs non-NULL value");
3181 return -1;
3182 }
3183
3184 dict = PyModule_GetDict(m);
3185 if (dict == NULL) {
3186 /* Internal error -- modules must have a dict! */
3187 PyErr_Format(PyExc_SystemError, "module '%s' has no __dict__",
3188 PyModule_GetName(m));
3189 return -1;
3190 }
3191 if (PyDict_SetItemString(dict, name, o))
3192 return -1;
3193 Py_DECREF(o);
3194 return 0;
3195 }
3196 #endif
3197
3198 #ifdef __cplusplus
3199 }
3200 #endif
3201
3202 /* -----------------------------------------------------------------------------*
3203 * Partial Init method
3204 * -----------------------------------------------------------------------------*/
3205
3206 #ifdef __cplusplus
3207 extern "C"
3208 #endif
SWIG_init(void)3209 SWIGEXPORT void SWIG_init(void) {
3210 static PyObject *SWIG_globals = 0;
3211 PyObject *m, *d;
3212 if (!SWIG_globals) SWIG_globals = SWIG_newvarlink();
3213
3214 /* Fix SwigMethods to carry the callback ptrs when needed */
3215 SWIG_Python_FixMethods(SwigMethods, swig_const_table, swig_types, swig_type_initial);
3216
3217 m = Py_InitModule((char *) SWIG_name, SwigMethods);
3218 d = PyModule_GetDict(m);
3219
3220 SWIG_InitializeModule(0);
3221 SWIG_InstallConstants(d,swig_const_table);
3222
3223 }
3224
3225