~ubuntu-branches/ubuntu/maverick/freecad/maverick

« back to all changes in this revision

Viewing changes to src/Base/swigpyrun_1.3.36.h

  • Committer: Bazaar Package Importer
  • Author(s): Teemu Ikonen
  • Date: 2009-07-16 18:37:41 UTC
  • Revision ID: james.westby@ubuntu.com-20090716183741-oww9kcxqrk991i1n
Tags: upstream-0.8.2237
ImportĀ upstreamĀ versionĀ 0.8.2237

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* ----------------------------------------------------------------------------
 
2
 * This file was automatically generated by SWIG (http://www.swig.org).
 
3
 * Version 1.3.36
 
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
/* -----------------------------------------------------------------------------
 
12
 *  This section contains generic SWIG labels for method/variable
 
13
 *  declarations/attributes, and other compiler dependent labels.
 
14
 * ----------------------------------------------------------------------------- */
 
15
 
 
16
/* template workaround for compilers that cannot correctly implement the C++ standard */
 
17
#ifndef SWIGTEMPLATEDISAMBIGUATOR
 
18
# if defined(__SUNPRO_CC) && (__SUNPRO_CC <= 0x560)
 
19
#  define SWIGTEMPLATEDISAMBIGUATOR template
 
20
# elif defined(__HP_aCC)
 
21
/* Needed even with `aCC -AA' when `aCC -V' reports HP ANSI C++ B3910B A.03.55 */
 
22
/* If we find a maximum version that requires this, the test would be __HP_aCC <= 35500 for A.03.55 */
 
23
#  define SWIGTEMPLATEDISAMBIGUATOR template
 
24
# else
 
25
#  define SWIGTEMPLATEDISAMBIGUATOR
 
26
# endif
 
27
#endif
 
28
 
 
29
/* inline attribute */
 
30
#ifndef SWIGINLINE
 
31
# if defined(__cplusplus) || (defined(__GNUC__) && !defined(__STRICT_ANSI__))
 
32
#   define SWIGINLINE inline
 
33
# else
 
34
#   define SWIGINLINE
 
35
# endif
 
36
#endif
 
37
 
 
38
/* attribute recognised by some compilers to avoid 'unused' warnings */
 
39
#ifndef SWIGUNUSED
 
40
# if defined(__GNUC__)
 
41
#   if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
 
42
#     define SWIGUNUSED __attribute__ ((__unused__)) 
 
43
#   else
 
44
#     define SWIGUNUSED
 
45
#   endif
 
46
# elif defined(__ICC)
 
47
#   define SWIGUNUSED __attribute__ ((__unused__)) 
 
48
# else
 
49
#   define SWIGUNUSED 
 
50
# endif
 
51
#endif
 
52
 
 
53
#ifndef SWIG_MSC_UNSUPPRESS_4505
 
54
# if defined(_MSC_VER)
 
55
#   pragma warning(disable : 4505) /* unreferenced local function has been removed */
 
56
# endif 
 
57
#endif
 
58
 
 
59
#ifndef SWIGUNUSEDPARM
 
60
# ifdef __cplusplus
 
61
#   define SWIGUNUSEDPARM(p)
 
62
# else
 
63
#   define SWIGUNUSEDPARM(p) p SWIGUNUSED 
 
64
# endif
 
65
#endif
 
66
 
 
67
/* internal SWIG method */
 
68
#ifndef SWIGINTERN
 
69
# define SWIGINTERN static SWIGUNUSED
 
70
#endif
 
71
 
 
72
/* internal inline SWIG method */
 
73
#ifndef SWIGINTERNINLINE
 
74
# define SWIGINTERNINLINE SWIGINTERN SWIGINLINE
 
75
#endif
 
76
 
 
77
/* exporting methods */
 
78
#if (__GNUC__ >= 4) || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)
 
79
#  ifndef GCC_HASCLASSVISIBILITY
 
80
#    define GCC_HASCLASSVISIBILITY
 
81
#  endif
 
82
#endif
 
83
 
 
84
#ifndef SWIGEXPORT
 
85
# if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__)
 
86
#   if defined(STATIC_LINKED)
 
87
#     define SWIGEXPORT
 
88
#   else
 
89
#     define SWIGEXPORT __declspec(dllexport)
 
90
#   endif
 
91
# else
 
92
#   if defined(__GNUC__) && defined(GCC_HASCLASSVISIBILITY)
 
93
#     define SWIGEXPORT __attribute__ ((visibility("default")))
 
94
#   else
 
95
#     define SWIGEXPORT
 
96
#   endif
 
97
# endif
 
98
#endif
 
99
 
 
100
/* calling conventions for Windows */
 
101
#ifndef SWIGSTDCALL
 
102
# if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__)
 
103
#   define SWIGSTDCALL __stdcall
 
104
# else
 
105
#   define SWIGSTDCALL
 
106
# endif 
 
107
#endif
 
108
 
 
109
/* Deal with Microsoft's attempt at deprecating C standard runtime functions */
 
110
#if !defined(SWIG_NO_CRT_SECURE_NO_DEPRECATE) && defined(_MSC_VER) && !defined(_CRT_SECURE_NO_DEPRECATE)
 
111
# define _CRT_SECURE_NO_DEPRECATE
 
112
#endif
 
113
 
 
114
/* Deal with Microsoft's attempt at deprecating methods in the standard C++ library */
 
115
#if !defined(SWIG_NO_SCL_SECURE_NO_DEPRECATE) && defined(_MSC_VER) && !defined(_SCL_SECURE_NO_DEPRECATE)
 
116
# define _SCL_SECURE_NO_DEPRECATE
 
117
#endif
 
118
 
 
119
/*  Errors in SWIG */
 
120
#define  SWIG_UnknownError         -1 
 
121
#define  SWIG_IOError              -2 
 
122
#define  SWIG_RuntimeError         -3 
 
123
#define  SWIG_IndexError           -4 
 
124
#define  SWIG_TypeError            -5 
 
125
#define  SWIG_DivisionByZero       -6 
 
126
#define  SWIG_OverflowError        -7 
 
127
#define  SWIG_SyntaxError          -8 
 
128
#define  SWIG_ValueError           -9 
 
129
#define  SWIG_SystemError          -10
 
130
#define  SWIG_AttributeError       -11
 
131
#define  SWIG_MemoryError          -12 
 
132
#define  SWIG_NullReferenceError   -13
 
133
 
 
134
 
 
135
/*  Errors in SWIG */
 
136
#define  SWIG_UnknownError         -1 
 
137
#define  SWIG_IOError              -2 
 
138
#define  SWIG_RuntimeError         -3 
 
139
#define  SWIG_IndexError           -4 
 
140
#define  SWIG_TypeError            -5 
 
141
#define  SWIG_DivisionByZero       -6 
 
142
#define  SWIG_OverflowError        -7 
 
143
#define  SWIG_SyntaxError          -8 
 
144
#define  SWIG_ValueError           -9 
 
145
#define  SWIG_SystemError          -10
 
146
#define  SWIG_AttributeError       -11
 
147
#define  SWIG_MemoryError          -12 
 
148
#define  SWIG_NullReferenceError   -13
 
149
 
 
150
 
 
151
/* -----------------------------------------------------------------------------
 
152
 * swigrun.swg
 
153
 *
 
154
 * This file contains generic CAPI SWIG runtime support for pointer
 
155
 * type checking.
 
156
 * ----------------------------------------------------------------------------- */
 
157
 
 
158
/* This should only be incremented when either the layout of swig_type_info changes,
 
159
   or for whatever reason, the runtime changes incompatibly */
 
160
#define SWIG_RUNTIME_VERSION "4"
 
161
 
 
162
/* define SWIG_TYPE_TABLE_NAME as "SWIG_TYPE_TABLE" */
 
163
#ifdef SWIG_TYPE_TABLE
 
164
# define SWIG_QUOTE_STRING(x) #x
 
165
# define SWIG_EXPAND_AND_QUOTE_STRING(x) SWIG_QUOTE_STRING(x)
 
166
# define SWIG_TYPE_TABLE_NAME SWIG_EXPAND_AND_QUOTE_STRING(SWIG_TYPE_TABLE)
 
167
#else
 
168
# define SWIG_TYPE_TABLE_NAME
 
169
#endif
 
170
 
 
171
/*
 
172
  You can use the SWIGRUNTIME and SWIGRUNTIMEINLINE macros for
 
173
  creating a static or dynamic library from the swig runtime code.
 
174
  In 99.9% of the cases, swig just needs to declare them as 'static'.
 
175
  
 
176
  But only do this if is strictly necessary, ie, if you have problems
 
177
  with your compiler or so.
 
178
*/
 
179
 
 
180
#ifndef SWIGRUNTIME
 
181
# define SWIGRUNTIME SWIGINTERN
 
182
#endif
 
183
 
 
184
#ifndef SWIGRUNTIMEINLINE
 
185
# define SWIGRUNTIMEINLINE SWIGRUNTIME SWIGINLINE
 
186
#endif
 
187
 
 
188
/*  Generic buffer size */
 
189
#ifndef SWIG_BUFFER_SIZE
 
190
# define SWIG_BUFFER_SIZE 1024
 
191
#endif
 
192
 
 
193
/* Flags for pointer conversions */
 
194
#define SWIG_POINTER_DISOWN        0x1
 
195
#define SWIG_CAST_NEW_MEMORY       0x2
 
196
 
 
197
/* Flags for new pointer objects */
 
198
#define SWIG_POINTER_OWN           0x1
 
199
 
 
200
 
 
201
/* 
 
202
   Flags/methods for returning states.
 
203
   
 
204
   The swig conversion methods, as ConvertPtr, return and integer 
 
205
   that tells if the conversion was successful or not. And if not,
 
206
   an error code can be returned (see swigerrors.swg for the codes).
 
207
   
 
208
   Use the following macros/flags to set or process the returning
 
209
   states.
 
210
   
 
211
   In old swig versions, you usually write code as:
 
212
 
 
213
     if (SWIG_ConvertPtr(obj,vptr,ty.flags) != -1) {
 
214
       // success code
 
215
     } else {
 
216
       //fail code
 
217
     }
 
218
 
 
219
   Now you can be more explicit as:
 
220
 
 
221
    int res = SWIG_ConvertPtr(obj,vptr,ty.flags);
 
222
    if (SWIG_IsOK(res)) {
 
223
      // success code
 
224
    } else {
 
225
      // fail code
 
226
    }
 
227
 
 
228
   that seems to be the same, but now you can also do
 
229
 
 
230
    Type *ptr;
 
231
    int res = SWIG_ConvertPtr(obj,(void **)(&ptr),ty.flags);
 
232
    if (SWIG_IsOK(res)) {
 
233
      // success code
 
234
      if (SWIG_IsNewObj(res) {
 
235
        ...
 
236
        delete *ptr;
 
237
      } else {
 
238
        ...
 
239
      }
 
240
    } else {
 
241
      // fail code
 
242
    }
 
243
    
 
244
   I.e., now SWIG_ConvertPtr can return new objects and you can
 
245
   identify the case and take care of the deallocation. Of course that
 
246
   requires also to SWIG_ConvertPtr to return new result values, as
 
247
 
 
248
      int SWIG_ConvertPtr(obj, ptr,...) {         
 
249
        if (<obj is ok>) {                             
 
250
          if (<need new object>) {                     
 
251
            *ptr = <ptr to new allocated object>; 
 
252
            return SWIG_NEWOBJ;                
 
253
          } else {                                     
 
254
            *ptr = <ptr to old object>;        
 
255
            return SWIG_OLDOBJ;                
 
256
          }                                    
 
257
        } else {                                       
 
258
          return SWIG_BADOBJ;                  
 
259
        }                                              
 
260
      }
 
261
 
 
262
   Of course, returning the plain '0(success)/-1(fail)' still works, but you can be
 
263
   more explicit by returning SWIG_BADOBJ, SWIG_ERROR or any of the
 
264
   swig errors code.
 
265
 
 
266
   Finally, if the SWIG_CASTRANK_MODE is enabled, the result code
 
267
   allows to return the 'cast rank', for example, if you have this
 
268
 
 
269
       int food(double)
 
270
       int fooi(int);
 
271
 
 
272
   and you call
 
273
 
 
274
      food(1)   // cast rank '1'  (1 -> 1.0)
 
275
      fooi(1)   // cast rank '0'
 
276
 
 
277
   just use the SWIG_AddCast()/SWIG_CheckState()
 
278
 
 
279
 
 
280
 */
 
281
#define SWIG_OK                    (0) 
 
282
#define SWIG_ERROR                 (-1)
 
283
#define SWIG_IsOK(r)               (r >= 0)
 
284
#define SWIG_ArgError(r)           ((r != SWIG_ERROR) ? r : SWIG_TypeError)  
 
285
 
 
286
/* The CastRankLimit says how many bits are used for the cast rank */
 
287
#define SWIG_CASTRANKLIMIT         (1 << 8)
 
288
/* The NewMask denotes the object was created (using new/malloc) */
 
289
#define SWIG_NEWOBJMASK            (SWIG_CASTRANKLIMIT  << 1)
 
290
/* The TmpMask is for in/out typemaps that use temporal objects */
 
291
#define SWIG_TMPOBJMASK            (SWIG_NEWOBJMASK << 1)
 
292
/* Simple returning values */
 
293
#define SWIG_BADOBJ                (SWIG_ERROR)
 
294
#define SWIG_OLDOBJ                (SWIG_OK)
 
295
#define SWIG_NEWOBJ                (SWIG_OK | SWIG_NEWOBJMASK)
 
296
#define SWIG_TMPOBJ                (SWIG_OK | SWIG_TMPOBJMASK)
 
297
/* Check, add and del mask methods */
 
298
#define SWIG_AddNewMask(r)         (SWIG_IsOK(r) ? (r | SWIG_NEWOBJMASK) : r)
 
299
#define SWIG_DelNewMask(r)         (SWIG_IsOK(r) ? (r & ~SWIG_NEWOBJMASK) : r)
 
300
#define SWIG_IsNewObj(r)           (SWIG_IsOK(r) && (r & SWIG_NEWOBJMASK))
 
301
#define SWIG_AddTmpMask(r)         (SWIG_IsOK(r) ? (r | SWIG_TMPOBJMASK) : r)
 
302
#define SWIG_DelTmpMask(r)         (SWIG_IsOK(r) ? (r & ~SWIG_TMPOBJMASK) : r)
 
303
#define SWIG_IsTmpObj(r)           (SWIG_IsOK(r) && (r & SWIG_TMPOBJMASK))
 
304
 
 
305
 
 
306
/* Cast-Rank Mode */
 
307
#if defined(SWIG_CASTRANK_MODE)
 
308
#  ifndef SWIG_TypeRank
 
309
#    define SWIG_TypeRank             unsigned long
 
310
#  endif
 
311
#  ifndef SWIG_MAXCASTRANK            /* Default cast allowed */
 
312
#    define SWIG_MAXCASTRANK          (2)
 
313
#  endif
 
314
#  define SWIG_CASTRANKMASK          ((SWIG_CASTRANKLIMIT) -1)
 
315
#  define SWIG_CastRank(r)           (r & SWIG_CASTRANKMASK)
 
316
SWIGINTERNINLINE int SWIG_AddCast(int r) { 
 
317
  return SWIG_IsOK(r) ? ((SWIG_CastRank(r) < SWIG_MAXCASTRANK) ? (r + 1) : SWIG_ERROR) : r;
 
318
}
 
319
SWIGINTERNINLINE int SWIG_CheckState(int r) { 
 
320
  return SWIG_IsOK(r) ? SWIG_CastRank(r) + 1 : 0; 
 
321
}
 
322
#else /* no cast-rank mode */
 
323
#  define SWIG_AddCast
 
324
#  define SWIG_CheckState(r) (SWIG_IsOK(r) ? 1 : 0)
 
325
#endif
 
326
 
 
327
 
 
328
 
 
329
 
 
330
#include <string.h>
 
331
 
 
332
#ifdef __cplusplus
 
333
extern "C" {
 
334
#endif
 
335
 
 
336
typedef void *(*swig_converter_func)(void *, int *);
 
337
typedef struct swig_type_info *(*swig_dycast_func)(void **);
 
338
 
 
339
/* Structure to store information on one type */
 
340
typedef struct swig_type_info {
 
341
  const char             *name;                 /* mangled name of this type */
 
342
  const char             *str;                  /* human readable name of this type */
 
343
  swig_dycast_func        dcast;                /* dynamic cast function down a hierarchy */
 
344
  struct swig_cast_info  *cast;                 /* linked list of types that can cast into this type */
 
345
  void                   *clientdata;           /* language specific type data */
 
346
  int                    owndata;               /* flag if the structure owns the clientdata */
 
347
} swig_type_info;
 
348
 
 
349
/* Structure to store a type and conversion function used for casting */
 
350
typedef struct swig_cast_info {
 
351
  swig_type_info         *type;                 /* pointer to type that is equivalent to this type */
 
352
  swig_converter_func     converter;            /* function to cast the void pointers */
 
353
  struct swig_cast_info  *next;                 /* pointer to next cast in linked list */
 
354
  struct swig_cast_info  *prev;                 /* pointer to the previous cast */
 
355
} swig_cast_info;
 
356
 
 
357
/* Structure used to store module information
 
358
 * Each module generates one structure like this, and the runtime collects
 
359
 * all of these structures and stores them in a circularly linked list.*/
 
360
typedef struct swig_module_info {
 
361
  swig_type_info         **types;               /* Array of pointers to swig_type_info structures that are in this module */
 
362
  size_t                 size;                  /* Number of types in this module */
 
363
  struct swig_module_info *next;                /* Pointer to next element in circularly linked list */
 
364
  swig_type_info         **type_initial;        /* Array of initially generated type structures */
 
365
  swig_cast_info         **cast_initial;        /* Array of initially generated casting structures */
 
366
  void                    *clientdata;          /* Language specific module data */
 
367
} swig_module_info;
 
368
 
 
369
/* 
 
370
  Compare two type names skipping the space characters, therefore
 
371
  "char*" == "char *" and "Class<int>" == "Class<int >", etc.
 
372
 
 
373
  Return 0 when the two name types are equivalent, as in
 
374
  strncmp, but skipping ' '.
 
375
*/
 
376
SWIGRUNTIME int
 
377
SWIG_TypeNameComp(const char *f1, const char *l1,
 
378
                  const char *f2, const char *l2) {
 
379
  for (;(f1 != l1) && (f2 != l2); ++f1, ++f2) {
 
380
    while ((*f1 == ' ') && (f1 != l1)) ++f1;
 
381
    while ((*f2 == ' ') && (f2 != l2)) ++f2;
 
382
    if (*f1 != *f2) return (*f1 > *f2) ? 1 : -1;
 
383
  }
 
384
  return (int)((l1 - f1) - (l2 - f2));
 
385
}
 
386
 
 
387
/*
 
388
  Check type equivalence in a name list like <name1>|<name2>|...
 
389
  Return 0 if not equal, 1 if equal
 
390
*/
 
391
SWIGRUNTIME int
 
392
SWIG_TypeEquiv(const char *nb, const char *tb) {
 
393
  int equiv = 0;
 
394
  const char* te = tb + strlen(tb);
 
395
  const char* ne = nb;
 
396
  while (!equiv && *ne) {
 
397
    for (nb = ne; *ne; ++ne) {
 
398
      if (*ne == '|') break;
 
399
    }
 
400
    equiv = (SWIG_TypeNameComp(nb, ne, tb, te) == 0) ? 1 : 0;
 
401
    if (*ne) ++ne;
 
402
  }
 
403
  return equiv;
 
404
}
 
405
 
 
406
/*
 
407
  Check type equivalence in a name list like <name1>|<name2>|...
 
408
  Return 0 if equal, -1 if nb < tb, 1 if nb > tb
 
409
*/
 
410
SWIGRUNTIME int
 
411
SWIG_TypeCompare(const char *nb, const char *tb) {
 
412
  int equiv = 0;
 
413
  const char* te = tb + strlen(tb);
 
414
  const char* ne = nb;
 
415
  while (!equiv && *ne) {
 
416
    for (nb = ne; *ne; ++ne) {
 
417
      if (*ne == '|') break;
 
418
    }
 
419
    equiv = (SWIG_TypeNameComp(nb, ne, tb, te) == 0) ? 1 : 0;
 
420
    if (*ne) ++ne;
 
421
  }
 
422
  return equiv;
 
423
}
 
424
 
 
425
 
 
426
/* think of this as a c++ template<> or a scheme macro */
 
427
#define SWIG_TypeCheck_Template(comparison, ty)         \
 
428
  if (ty) {                                             \
 
429
    swig_cast_info *iter = ty->cast;                    \
 
430
    while (iter) {                                      \
 
431
      if (comparison) {                                 \
 
432
        if (iter == ty->cast) return iter;              \
 
433
        /* Move iter to the top of the linked list */   \
 
434
        iter->prev->next = iter->next;                  \
 
435
        if (iter->next)                                 \
 
436
          iter->next->prev = iter->prev;                \
 
437
        iter->next = ty->cast;                          \
 
438
        iter->prev = 0;                                 \
 
439
        if (ty->cast) ty->cast->prev = iter;            \
 
440
        ty->cast = iter;                                \
 
441
        return iter;                                    \
 
442
      }                                                 \
 
443
      iter = iter->next;                                \
 
444
    }                                                   \
 
445
  }                                                     \
 
446
  return 0
 
447
 
 
448
/*
 
449
  Check the typename
 
450
*/
 
451
SWIGRUNTIME swig_cast_info *
 
452
SWIG_TypeCheck(const char *c, swig_type_info *ty) {
 
453
  SWIG_TypeCheck_Template(strcmp(iter->type->name, c) == 0, ty);
 
454
}
 
455
 
 
456
/* Same as previous function, except strcmp is replaced with a pointer comparison */
 
457
SWIGRUNTIME swig_cast_info *
 
458
SWIG_TypeCheckStruct(swig_type_info *from, swig_type_info *into) {
 
459
  SWIG_TypeCheck_Template(iter->type == from, into);
 
460
}
 
461
 
 
462
/*
 
463
  Cast a pointer up an inheritance hierarchy
 
464
*/
 
465
SWIGRUNTIMEINLINE void *
 
466
SWIG_TypeCast(swig_cast_info *ty, void *ptr, int *newmemory) {
 
467
  return ((!ty) || (!ty->converter)) ? ptr : (*ty->converter)(ptr, newmemory);
 
468
}
 
469
 
 
470
/* 
 
471
   Dynamic pointer casting. Down an inheritance hierarchy
 
472
*/
 
473
SWIGRUNTIME swig_type_info *
 
474
SWIG_TypeDynamicCast(swig_type_info *ty, void **ptr) {
 
475
  swig_type_info *lastty = ty;
 
476
  if (!ty || !ty->dcast) return ty;
 
477
  while (ty && (ty->dcast)) {
 
478
    ty = (*ty->dcast)(ptr);
 
479
    if (ty) lastty = ty;
 
480
  }
 
481
  return lastty;
 
482
}
 
483
 
 
484
/*
 
485
  Return the name associated with this type
 
486
*/
 
487
SWIGRUNTIMEINLINE const char *
 
488
SWIG_TypeName(const swig_type_info *ty) {
 
489
  return ty->name;
 
490
}
 
491
 
 
492
/*
 
493
  Return the pretty name associated with this type,
 
494
  that is an unmangled type name in a form presentable to the user.
 
495
*/
 
496
SWIGRUNTIME const char *
 
497
SWIG_TypePrettyName(const swig_type_info *type) {
 
498
  /* The "str" field contains the equivalent pretty names of the
 
499
     type, separated by vertical-bar characters.  We choose
 
500
     to print the last name, as it is often (?) the most
 
501
     specific. */
 
502
  if (!type) return NULL;
 
503
  if (type->str != NULL) {
 
504
    const char *last_name = type->str;
 
505
    const char *s;
 
506
    for (s = type->str; *s; s++)
 
507
      if (*s == '|') last_name = s+1;
 
508
    return last_name;
 
509
  }
 
510
  else
 
511
    return type->name;
 
512
}
 
513
 
 
514
/* 
 
515
   Set the clientdata field for a type
 
516
*/
 
517
SWIGRUNTIME void
 
518
SWIG_TypeClientData(swig_type_info *ti, void *clientdata) {
 
519
  swig_cast_info *cast = ti->cast;
 
520
  /* if (ti->clientdata == clientdata) return; */
 
521
  ti->clientdata = clientdata;
 
522
  
 
523
  while (cast) {
 
524
    if (!cast->converter) {
 
525
      swig_type_info *tc = cast->type;
 
526
      if (!tc->clientdata) {
 
527
        SWIG_TypeClientData(tc, clientdata);
 
528
      }
 
529
    }    
 
530
    cast = cast->next;
 
531
  }
 
532
}
 
533
SWIGRUNTIME void
 
534
SWIG_TypeNewClientData(swig_type_info *ti, void *clientdata) {
 
535
  SWIG_TypeClientData(ti, clientdata);
 
536
  ti->owndata = 1;
 
537
}
 
538
  
 
539
/*
 
540
  Search for a swig_type_info structure only by mangled name
 
541
  Search is a O(log #types)
 
542
  
 
543
  We start searching at module start, and finish searching when start == end.  
 
544
  Note: if start == end at the beginning of the function, we go all the way around
 
545
  the circular list.
 
546
*/
 
547
SWIGRUNTIME swig_type_info *
 
548
SWIG_MangledTypeQueryModule(swig_module_info *start, 
 
549
                            swig_module_info *end, 
 
550
                            const char *name) {
 
551
  swig_module_info *iter = start;
 
552
  do {
 
553
    if (iter->size) {
 
554
      register size_t l = 0;
 
555
      register size_t r = iter->size - 1;
 
556
      do {
 
557
        /* since l+r >= 0, we can (>> 1) instead (/ 2) */
 
558
        register size_t i = (l + r) >> 1; 
 
559
        const char *iname = iter->types[i]->name;
 
560
        if (iname) {
 
561
          register int compare = strcmp(name, iname);
 
562
          if (compare == 0) {       
 
563
            return iter->types[i];
 
564
          } else if (compare < 0) {
 
565
            if (i) {
 
566
              r = i - 1;
 
567
            } else {
 
568
              break;
 
569
            }
 
570
          } else if (compare > 0) {
 
571
            l = i + 1;
 
572
          }
 
573
        } else {
 
574
          break; /* should never happen */
 
575
        }
 
576
      } while (l <= r);
 
577
    }
 
578
    iter = iter->next;
 
579
  } while (iter != end);
 
580
  return 0;
 
581
}
 
582
 
 
583
/*
 
584
  Search for a swig_type_info structure for either a mangled name or a human readable name.
 
585
  It first searches the mangled names of the types, which is a O(log #types)
 
586
  If a type is not found it then searches the human readable names, which is O(#types).
 
587
  
 
588
  We start searching at module start, and finish searching when start == end.  
 
589
  Note: if start == end at the beginning of the function, we go all the way around
 
590
  the circular list.
 
591
*/
 
592
SWIGRUNTIME swig_type_info *
 
593
SWIG_TypeQueryModule(swig_module_info *start, 
 
594
                     swig_module_info *end, 
 
595
                     const char *name) {
 
596
  /* STEP 1: Search the name field using binary search */
 
597
  swig_type_info *ret = SWIG_MangledTypeQueryModule(start, end, name);
 
598
  if (ret) {
 
599
    return ret;
 
600
  } else {
 
601
    /* STEP 2: If the type hasn't been found, do a complete search
 
602
       of the str field (the human readable name) */
 
603
    swig_module_info *iter = start;
 
604
    do {
 
605
      register size_t i = 0;
 
606
      for (; i < iter->size; ++i) {
 
607
        if (iter->types[i]->str && (SWIG_TypeEquiv(iter->types[i]->str, name)))
 
608
          return iter->types[i];
 
609
      }
 
610
      iter = iter->next;
 
611
    } while (iter != end);
 
612
  }
 
613
  
 
614
  /* neither found a match */
 
615
  return 0;
 
616
}
 
617
 
 
618
/* 
 
619
   Pack binary data into a string
 
620
*/
 
621
SWIGRUNTIME char *
 
622
SWIG_PackData(char *c, void *ptr, size_t sz) {
 
623
  static const char hex[17] = "0123456789abcdef";
 
624
  register const unsigned char *u = (unsigned char *) ptr;
 
625
  register const unsigned char *eu =  u + sz;
 
626
  for (; u != eu; ++u) {
 
627
    register unsigned char uu = *u;
 
628
    *(c++) = hex[(uu & 0xf0) >> 4];
 
629
    *(c++) = hex[uu & 0xf];
 
630
  }
 
631
  return c;
 
632
}
 
633
 
 
634
/* 
 
635
   Unpack binary data from a string
 
636
*/
 
637
SWIGRUNTIME const char *
 
638
SWIG_UnpackData(const char *c, void *ptr, size_t sz) {
 
639
  register unsigned char *u = (unsigned char *) ptr;
 
640
  register const unsigned char *eu = u + sz;
 
641
  for (; u != eu; ++u) {
 
642
    register char d = *(c++);
 
643
    register unsigned char uu;
 
644
    if ((d >= '0') && (d <= '9'))
 
645
      uu = ((d - '0') << 4);
 
646
    else if ((d >= 'a') && (d <= 'f'))
 
647
      uu = ((d - ('a'-10)) << 4);
 
648
    else 
 
649
      return (char *) 0;
 
650
    d = *(c++);
 
651
    if ((d >= '0') && (d <= '9'))
 
652
      uu |= (d - '0');
 
653
    else if ((d >= 'a') && (d <= 'f'))
 
654
      uu |= (d - ('a'-10));
 
655
    else 
 
656
      return (char *) 0;
 
657
    *u = uu;
 
658
  }
 
659
  return c;
 
660
}
 
661
 
 
662
/* 
 
663
   Pack 'void *' into a string buffer.
 
664
*/
 
665
SWIGRUNTIME char *
 
666
SWIG_PackVoidPtr(char *buff, void *ptr, const char *name, size_t bsz) {
 
667
  char *r = buff;
 
668
  if ((2*sizeof(void *) + 2) > bsz) return 0;
 
669
  *(r++) = '_';
 
670
  r = SWIG_PackData(r,&ptr,sizeof(void *));
 
671
  if (strlen(name) + 1 > (bsz - (r - buff))) return 0;
 
672
  strcpy(r,name);
 
673
  return buff;
 
674
}
 
675
 
 
676
SWIGRUNTIME const char *
 
677
SWIG_UnpackVoidPtr(const char *c, void **ptr, const char *name) {
 
678
  if (*c != '_') {
 
679
    if (strcmp(c,"NULL") == 0) {
 
680
      *ptr = (void *) 0;
 
681
      return name;
 
682
    } else {
 
683
      return 0;
 
684
    }
 
685
  }
 
686
  return SWIG_UnpackData(++c,ptr,sizeof(void *));
 
687
}
 
688
 
 
689
SWIGRUNTIME char *
 
690
SWIG_PackDataName(char *buff, void *ptr, size_t sz, const char *name, size_t bsz) {
 
691
  char *r = buff;
 
692
  size_t lname = (name ? strlen(name) : 0);
 
693
  if ((2*sz + 2 + lname) > bsz) return 0;
 
694
  *(r++) = '_';
 
695
  r = SWIG_PackData(r,ptr,sz);
 
696
  if (lname) {
 
697
    strncpy(r,name,lname+1);
 
698
  } else {
 
699
    *r = 0;
 
700
  }
 
701
  return buff;
 
702
}
 
703
 
 
704
SWIGRUNTIME const char *
 
705
SWIG_UnpackDataName(const char *c, void *ptr, size_t sz, const char *name) {
 
706
  if (*c != '_') {
 
707
    if (strcmp(c,"NULL") == 0) {
 
708
      memset(ptr,0,sz);
 
709
      return name;
 
710
    } else {
 
711
      return 0;
 
712
    }
 
713
  }
 
714
  return SWIG_UnpackData(++c,ptr,sz);
 
715
}
 
716
 
 
717
#ifdef __cplusplus
 
718
}
 
719
#endif
 
720
 
 
721
/* Add PyOS_snprintf for old Pythons */
 
722
#if PY_VERSION_HEX < 0x02020000
 
723
# if defined(_MSC_VER) || defined(__BORLANDC__) || defined(_WATCOM)
 
724
#  define PyOS_snprintf _snprintf
 
725
# else
 
726
#  define PyOS_snprintf snprintf
 
727
# endif
 
728
#endif
 
729
 
 
730
/* A crude PyString_FromFormat implementation for old Pythons */
 
731
#if PY_VERSION_HEX < 0x02020000
 
732
 
 
733
#ifndef SWIG_PYBUFFER_SIZE
 
734
# define SWIG_PYBUFFER_SIZE 1024
 
735
#endif
 
736
 
 
737
static PyObject *
 
738
PyString_FromFormat(const char *fmt, ...) {
 
739
  va_list ap;
 
740
  char buf[SWIG_PYBUFFER_SIZE * 2];
 
741
  int res;
 
742
  va_start(ap, fmt);
 
743
  res = vsnprintf(buf, sizeof(buf), fmt, ap);
 
744
  va_end(ap);
 
745
  return (res < 0 || res >= (int)sizeof(buf)) ? 0 : PyString_FromString(buf);
 
746
}
 
747
#endif
 
748
 
 
749
/* Add PyObject_Del for old Pythons */
 
750
#if PY_VERSION_HEX < 0x01060000
 
751
# define PyObject_Del(op) PyMem_DEL((op))
 
752
#endif
 
753
#ifndef PyObject_DEL
 
754
# define PyObject_DEL PyObject_Del
 
755
#endif
 
756
 
 
757
/* A crude PyExc_StopIteration exception for old Pythons */
 
758
#if PY_VERSION_HEX < 0x02020000
 
759
# ifndef PyExc_StopIteration
 
760
#  define PyExc_StopIteration PyExc_RuntimeError
 
761
# endif
 
762
# ifndef PyObject_GenericGetAttr
 
763
#  define PyObject_GenericGetAttr 0
 
764
# endif
 
765
#endif
 
766
/* Py_NotImplemented is defined in 2.1 and up. */
 
767
#if PY_VERSION_HEX < 0x02010000
 
768
# ifndef Py_NotImplemented
 
769
#  define Py_NotImplemented PyExc_RuntimeError
 
770
# endif
 
771
#endif
 
772
 
 
773
 
 
774
/* A crude PyString_AsStringAndSize implementation for old Pythons */
 
775
#if PY_VERSION_HEX < 0x02010000
 
776
# ifndef PyString_AsStringAndSize
 
777
#  define PyString_AsStringAndSize(obj, s, len) {*s = PyString_AsString(obj); *len = *s ? strlen(*s) : 0;}
 
778
# endif
 
779
#endif
 
780
 
 
781
/* PySequence_Size for old Pythons */
 
782
#if PY_VERSION_HEX < 0x02000000
 
783
# ifndef PySequence_Size
 
784
#  define PySequence_Size PySequence_Length
 
785
# endif
 
786
#endif
 
787
 
 
788
 
 
789
/* PyBool_FromLong for old Pythons */
 
790
#if PY_VERSION_HEX < 0x02030000
 
791
static
 
792
PyObject *PyBool_FromLong(long ok)
 
793
{
 
794
  PyObject *result = ok ? Py_True : Py_False;
 
795
  Py_INCREF(result);
 
796
  return result;
 
797
}
 
798
#endif
 
799
 
 
800
/* Py_ssize_t for old Pythons */
 
801
/* This code is as recommended by: */
 
802
/* http://www.python.org/dev/peps/pep-0353/#conversion-guidelines */
 
803
#if PY_VERSION_HEX < 0x02050000 && !defined(PY_SSIZE_T_MIN)
 
804
typedef int Py_ssize_t;
 
805
# define PY_SSIZE_T_MAX INT_MAX
 
806
# define PY_SSIZE_T_MIN INT_MIN
 
807
#endif
 
808
/* -----------------------------------------------------------------------------
 
809
 * error manipulation
 
810
 * ----------------------------------------------------------------------------- */
 
811
 
 
812
SWIGRUNTIME PyObject*
 
813
SWIG_Python_ErrorType(int code) {
 
814
  PyObject* type = 0;
 
815
  switch(code) {
 
816
  case SWIG_MemoryError:
 
817
    type = PyExc_MemoryError;
 
818
    break;
 
819
  case SWIG_IOError:
 
820
    type = PyExc_IOError;
 
821
    break;
 
822
  case SWIG_RuntimeError:
 
823
    type = PyExc_RuntimeError;
 
824
    break;
 
825
  case SWIG_IndexError:
 
826
    type = PyExc_IndexError;
 
827
    break;
 
828
  case SWIG_TypeError:
 
829
    type = PyExc_TypeError;
 
830
    break;
 
831
  case SWIG_DivisionByZero:
 
832
    type = PyExc_ZeroDivisionError;
 
833
    break;
 
834
  case SWIG_OverflowError:
 
835
    type = PyExc_OverflowError;
 
836
    break;
 
837
  case SWIG_SyntaxError:
 
838
    type = PyExc_SyntaxError;
 
839
    break;
 
840
  case SWIG_ValueError:
 
841
    type = PyExc_ValueError;
 
842
    break;
 
843
  case SWIG_SystemError:
 
844
    type = PyExc_SystemError;
 
845
    break;
 
846
  case SWIG_AttributeError:
 
847
    type = PyExc_AttributeError;
 
848
    break;
 
849
  default:
 
850
    type = PyExc_RuntimeError;
 
851
  }
 
852
  return type;
 
853
}
 
854
 
 
855
 
 
856
SWIGRUNTIME void
 
857
SWIG_Python_AddErrorMsg(const char* mesg)
 
858
{
 
859
  PyObject *type = 0;
 
860
  PyObject *value = 0;
 
861
  PyObject *traceback = 0;
 
862
 
 
863
  if (PyErr_Occurred()) PyErr_Fetch(&type, &value, &traceback);
 
864
  if (value) {
 
865
    PyObject *old_str = PyObject_Str(value);
 
866
    PyErr_Clear();
 
867
    Py_XINCREF(type);
 
868
    PyErr_Format(type, "%s %s", PyString_AsString(old_str), mesg);
 
869
    Py_DECREF(old_str);
 
870
    Py_DECREF(value);
 
871
  } else {
 
872
    PyErr_SetString(PyExc_RuntimeError, mesg);
 
873
  }
 
874
}
 
875
 
 
876
 
 
877
#if defined(SWIG_PYTHON_NO_THREADS)
 
878
#  if defined(SWIG_PYTHON_THREADS)
 
879
#    undef SWIG_PYTHON_THREADS
 
880
#  endif
 
881
#endif
 
882
#if defined(SWIG_PYTHON_THREADS) /* Threading support is enabled */
 
883
#  if !defined(SWIG_PYTHON_USE_GIL) && !defined(SWIG_PYTHON_NO_USE_GIL)
 
884
#    if (PY_VERSION_HEX >= 0x02030000) /* For 2.3 or later, use the PyGILState calls */
 
885
#      define SWIG_PYTHON_USE_GIL
 
886
#    endif
 
887
#  endif
 
888
#  if defined(SWIG_PYTHON_USE_GIL) /* Use PyGILState threads calls */
 
889
#    ifndef SWIG_PYTHON_INITIALIZE_THREADS
 
890
#     define SWIG_PYTHON_INITIALIZE_THREADS  PyEval_InitThreads() 
 
891
#    endif
 
892
#    ifdef __cplusplus /* C++ code */
 
893
       class SWIG_Python_Thread_Block {
 
894
         bool status;
 
895
         PyGILState_STATE state;
 
896
       public:
 
897
         void end() { if (status) { PyGILState_Release(state); status = false;} }
 
898
         SWIG_Python_Thread_Block() : status(true), state(PyGILState_Ensure()) {}
 
899
         ~SWIG_Python_Thread_Block() { end(); }
 
900
       };
 
901
       class SWIG_Python_Thread_Allow {
 
902
         bool status;
 
903
         PyThreadState *save;
 
904
       public:
 
905
         void end() { if (status) { PyEval_RestoreThread(save); status = false; }}
 
906
         SWIG_Python_Thread_Allow() : status(true), save(PyEval_SaveThread()) {}
 
907
         ~SWIG_Python_Thread_Allow() { end(); }
 
908
       };
 
909
#      define SWIG_PYTHON_THREAD_BEGIN_BLOCK   SWIG_Python_Thread_Block _swig_thread_block
 
910
#      define SWIG_PYTHON_THREAD_END_BLOCK     _swig_thread_block.end()
 
911
#      define SWIG_PYTHON_THREAD_BEGIN_ALLOW   SWIG_Python_Thread_Allow _swig_thread_allow
 
912
#      define SWIG_PYTHON_THREAD_END_ALLOW     _swig_thread_allow.end()
 
913
#    else /* C code */
 
914
#      define SWIG_PYTHON_THREAD_BEGIN_BLOCK   PyGILState_STATE _swig_thread_block = PyGILState_Ensure()
 
915
#      define SWIG_PYTHON_THREAD_END_BLOCK     PyGILState_Release(_swig_thread_block)
 
916
#      define SWIG_PYTHON_THREAD_BEGIN_ALLOW   PyThreadState *_swig_thread_allow = PyEval_SaveThread()
 
917
#      define SWIG_PYTHON_THREAD_END_ALLOW     PyEval_RestoreThread(_swig_thread_allow)
 
918
#    endif
 
919
#  else /* Old thread way, not implemented, user must provide it */
 
920
#    if !defined(SWIG_PYTHON_INITIALIZE_THREADS)
 
921
#      define SWIG_PYTHON_INITIALIZE_THREADS
 
922
#    endif
 
923
#    if !defined(SWIG_PYTHON_THREAD_BEGIN_BLOCK)
 
924
#      define SWIG_PYTHON_THREAD_BEGIN_BLOCK
 
925
#    endif
 
926
#    if !defined(SWIG_PYTHON_THREAD_END_BLOCK)
 
927
#      define SWIG_PYTHON_THREAD_END_BLOCK
 
928
#    endif
 
929
#    if !defined(SWIG_PYTHON_THREAD_BEGIN_ALLOW)
 
930
#      define SWIG_PYTHON_THREAD_BEGIN_ALLOW
 
931
#    endif
 
932
#    if !defined(SWIG_PYTHON_THREAD_END_ALLOW)
 
933
#      define SWIG_PYTHON_THREAD_END_ALLOW
 
934
#    endif
 
935
#  endif
 
936
#else /* No thread support */
 
937
#  define SWIG_PYTHON_INITIALIZE_THREADS
 
938
#  define SWIG_PYTHON_THREAD_BEGIN_BLOCK
 
939
#  define SWIG_PYTHON_THREAD_END_BLOCK
 
940
#  define SWIG_PYTHON_THREAD_BEGIN_ALLOW
 
941
#  define SWIG_PYTHON_THREAD_END_ALLOW
 
942
#endif
 
943
/* -----------------------------------------------------------------------------
 
944
 * Python API portion that goes into the runtime
 
945
 * ----------------------------------------------------------------------------- */
 
946
 
 
947
#ifdef __cplusplus
 
948
extern "C" {
 
949
#if 0
 
950
} /* cc-mode */
 
951
#endif
 
952
#endif
 
953
 
 
954
/* -----------------------------------------------------------------------------
 
955
 * Constant declarations
 
956
 * ----------------------------------------------------------------------------- */
 
957
 
 
958
/* Constant Types */
 
959
#define SWIG_PY_POINTER 4
 
960
#define SWIG_PY_BINARY  5
 
961
 
 
962
/* Constant information structure */
 
963
typedef struct swig_const_info {
 
964
  int type;
 
965
  char *name;
 
966
  long lvalue;
 
967
  double dvalue;
 
968
  void   *pvalue;
 
969
  swig_type_info **ptype;
 
970
} swig_const_info;
 
971
 
 
972
#ifdef __cplusplus
 
973
#if 0
 
974
{ /* cc-mode */
 
975
#endif
 
976
}
 
977
#endif
 
978
 
 
979
/* -----------------------------------------------------------------------------
 
980
 * See the LICENSE file for information on copyright, usage and redistribution
 
981
 * of SWIG, and the README file for authors - http://www.swig.org/release.html.
 
982
 *
 
983
 * pyrun.swg
 
984
 *
 
985
 * This file contains the runtime support for Python modules
 
986
 * and includes code for managing global variables and pointer
 
987
 * type checking.
 
988
 *
 
989
 * ----------------------------------------------------------------------------- */
 
990
 
 
991
/* Common SWIG API */
 
992
 
 
993
/* for raw pointers */
 
994
#define SWIG_Python_ConvertPtr(obj, pptr, type, flags)  SWIG_Python_ConvertPtrAndOwn(obj, pptr, type, flags, 0)
 
995
#define SWIG_ConvertPtr(obj, pptr, type, flags)         SWIG_Python_ConvertPtr(obj, pptr, type, flags)
 
996
#define SWIG_ConvertPtrAndOwn(obj,pptr,type,flags,own)  SWIG_Python_ConvertPtrAndOwn(obj, pptr, type, flags, own)
 
997
#define SWIG_NewPointerObj(ptr, type, flags)            SWIG_Python_NewPointerObj(ptr, type, flags)
 
998
#define SWIG_CheckImplicit(ty)                          SWIG_Python_CheckImplicit(ty) 
 
999
#define SWIG_AcquirePtr(ptr, src)                       SWIG_Python_AcquirePtr(ptr, src)
 
1000
#define swig_owntype                                    int
 
1001
 
 
1002
/* for raw packed data */
 
1003
#define SWIG_ConvertPacked(obj, ptr, sz, ty)            SWIG_Python_ConvertPacked(obj, ptr, sz, ty)
 
1004
#define SWIG_NewPackedObj(ptr, sz, type)                SWIG_Python_NewPackedObj(ptr, sz, type)
 
1005
 
 
1006
/* for class or struct pointers */
 
1007
#define SWIG_ConvertInstance(obj, pptr, type, flags)    SWIG_ConvertPtr(obj, pptr, type, flags)
 
1008
#define SWIG_NewInstanceObj(ptr, type, flags)           SWIG_NewPointerObj(ptr, type, flags)
 
1009
 
 
1010
/* for C or C++ function pointers */
 
1011
#define SWIG_ConvertFunctionPtr(obj, pptr, type)        SWIG_Python_ConvertFunctionPtr(obj, pptr, type)
 
1012
#define SWIG_NewFunctionPtrObj(ptr, type)               SWIG_Python_NewPointerObj(ptr, type, 0)
 
1013
 
 
1014
/* for C++ member pointers, ie, member methods */
 
1015
#define SWIG_ConvertMember(obj, ptr, sz, ty)            SWIG_Python_ConvertPacked(obj, ptr, sz, ty)
 
1016
#define SWIG_NewMemberObj(ptr, sz, type)                SWIG_Python_NewPackedObj(ptr, sz, type)
 
1017
 
 
1018
 
 
1019
/* Runtime API */
 
1020
 
 
1021
#define SWIG_GetModule(clientdata)                      SWIG_Python_GetModule()
 
1022
#define SWIG_SetModule(clientdata, pointer)             SWIG_Python_SetModule(pointer)
 
1023
#define SWIG_NewClientData(obj)                         PySwigClientData_New(obj)
 
1024
 
 
1025
#define SWIG_SetErrorObj                                SWIG_Python_SetErrorObj                            
 
1026
#define SWIG_SetErrorMsg                                SWIG_Python_SetErrorMsg                            
 
1027
#define SWIG_ErrorType(code)                            SWIG_Python_ErrorType(code)                        
 
1028
#define SWIG_Error(code, msg)                           SWIG_Python_SetErrorMsg(SWIG_ErrorType(code), msg) 
 
1029
#define SWIG_fail                                       goto fail                                          
 
1030
 
 
1031
 
 
1032
/* Runtime API implementation */
 
1033
 
 
1034
/* Error manipulation */
 
1035
 
 
1036
SWIGINTERN void 
 
1037
SWIG_Python_SetErrorObj(PyObject *errtype, PyObject *obj) {
 
1038
  SWIG_PYTHON_THREAD_BEGIN_BLOCK; 
 
1039
  PyErr_SetObject(errtype, obj);
 
1040
  Py_DECREF(obj);
 
1041
  SWIG_PYTHON_THREAD_END_BLOCK;
 
1042
}
 
1043
 
 
1044
SWIGINTERN void 
 
1045
SWIG_Python_SetErrorMsg(PyObject *errtype, const char *msg) {
 
1046
  SWIG_PYTHON_THREAD_BEGIN_BLOCK;
 
1047
  PyErr_SetString(errtype, (char *) msg);
 
1048
  SWIG_PYTHON_THREAD_END_BLOCK;
 
1049
}
 
1050
 
 
1051
#define SWIG_Python_Raise(obj, type, desc)  SWIG_Python_SetErrorObj(SWIG_Python_ExceptionType(desc), obj)
 
1052
 
 
1053
/* Set a constant value */
 
1054
 
 
1055
SWIGINTERN void
 
1056
SWIG_Python_SetConstant(PyObject *d, const char *name, PyObject *obj) {   
 
1057
  PyDict_SetItemString(d, (char*) name, obj);
 
1058
  Py_DECREF(obj);                            
 
1059
}
 
1060
 
 
1061
/* Append a value to the result obj */
 
1062
 
 
1063
SWIGINTERN PyObject*
 
1064
SWIG_Python_AppendOutput(PyObject* result, PyObject* obj) {
 
1065
#if !defined(SWIG_PYTHON_OUTPUT_TUPLE)
 
1066
  if (!result) {
 
1067
    result = obj;
 
1068
  } else if (result == Py_None) {
 
1069
    Py_DECREF(result);
 
1070
    result = obj;
 
1071
  } else {
 
1072
    if (!PyList_Check(result)) {
 
1073
      PyObject *o2 = result;
 
1074
      result = PyList_New(1);
 
1075
      PyList_SetItem(result, 0, o2);
 
1076
    }
 
1077
    PyList_Append(result,obj);
 
1078
    Py_DECREF(obj);
 
1079
  }
 
1080
  return result;
 
1081
#else
 
1082
  PyObject*   o2;
 
1083
  PyObject*   o3;
 
1084
  if (!result) {
 
1085
    result = obj;
 
1086
  } else if (result == Py_None) {
 
1087
    Py_DECREF(result);
 
1088
    result = obj;
 
1089
  } else {
 
1090
    if (!PyTuple_Check(result)) {
 
1091
      o2 = result;
 
1092
      result = PyTuple_New(1);
 
1093
      PyTuple_SET_ITEM(result, 0, o2);
 
1094
    }
 
1095
    o3 = PyTuple_New(1);
 
1096
    PyTuple_SET_ITEM(o3, 0, obj);
 
1097
    o2 = result;
 
1098
    result = PySequence_Concat(o2, o3);
 
1099
    Py_DECREF(o2);
 
1100
    Py_DECREF(o3);
 
1101
  }
 
1102
  return result;
 
1103
#endif
 
1104
}
 
1105
 
 
1106
/* Unpack the argument tuple */
 
1107
 
 
1108
SWIGINTERN int
 
1109
SWIG_Python_UnpackTuple(PyObject *args, const char *name, Py_ssize_t min, Py_ssize_t max, PyObject **objs)
 
1110
{
 
1111
  if (!args) {
 
1112
    if (!min && !max) {
 
1113
      return 1;
 
1114
    } else {
 
1115
      PyErr_Format(PyExc_TypeError, "%s expected %s%d arguments, got none", 
 
1116
                   name, (min == max ? "" : "at least "), (int)min);
 
1117
      return 0;
 
1118
    }
 
1119
  }  
 
1120
  if (!PyTuple_Check(args)) {
 
1121
    PyErr_SetString(PyExc_SystemError, "UnpackTuple() argument list is not a tuple");
 
1122
    return 0;
 
1123
  } else {
 
1124
    register Py_ssize_t l = PyTuple_GET_SIZE(args);
 
1125
    if (l < min) {
 
1126
      PyErr_Format(PyExc_TypeError, "%s expected %s%d arguments, got %d", 
 
1127
                   name, (min == max ? "" : "at least "), (int)min, (int)l);
 
1128
      return 0;
 
1129
    } else if (l > max) {
 
1130
      PyErr_Format(PyExc_TypeError, "%s expected %s%d arguments, got %d", 
 
1131
                   name, (min == max ? "" : "at most "), (int)max, (int)l);
 
1132
      return 0;
 
1133
    } else {
 
1134
      register int i;
 
1135
      for (i = 0; i < l; ++i) {
 
1136
        objs[i] = PyTuple_GET_ITEM(args, i);
 
1137
      }
 
1138
      for (; l < max; ++l) {
 
1139
        objs[l] = 0;
 
1140
      }
 
1141
      return i + 1;
 
1142
    }    
 
1143
  }
 
1144
}
 
1145
 
 
1146
/* A functor is a function object with one single object argument */
 
1147
#if PY_VERSION_HEX >= 0x02020000
 
1148
#define SWIG_Python_CallFunctor(functor, obj)           PyObject_CallFunctionObjArgs(functor, obj, NULL);
 
1149
#else
 
1150
#define SWIG_Python_CallFunctor(functor, obj)           PyObject_CallFunction(functor, "O", obj);
 
1151
#endif
 
1152
 
 
1153
/*
 
1154
  Helper for static pointer initialization for both C and C++ code, for example
 
1155
  static PyObject *SWIG_STATIC_POINTER(MyVar) = NewSomething(...);
 
1156
*/
 
1157
#ifdef __cplusplus
 
1158
#define SWIG_STATIC_POINTER(var)  var
 
1159
#else
 
1160
#define SWIG_STATIC_POINTER(var)  var = 0; if (!var) var
 
1161
#endif
 
1162
 
 
1163
/* -----------------------------------------------------------------------------
 
1164
 * Pointer declarations
 
1165
 * ----------------------------------------------------------------------------- */
 
1166
 
 
1167
/* Flags for new pointer objects */
 
1168
#define SWIG_POINTER_NOSHADOW       (SWIG_POINTER_OWN      << 1)
 
1169
#define SWIG_POINTER_NEW            (SWIG_POINTER_NOSHADOW | SWIG_POINTER_OWN)
 
1170
 
 
1171
#define SWIG_POINTER_IMPLICIT_CONV  (SWIG_POINTER_DISOWN   << 1)
 
1172
 
 
1173
#ifdef __cplusplus
 
1174
extern "C" {
 
1175
#if 0
 
1176
} /* cc-mode */
 
1177
#endif
 
1178
#endif
 
1179
 
 
1180
/*  How to access Py_None */
 
1181
#if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__)
 
1182
#  ifndef SWIG_PYTHON_NO_BUILD_NONE
 
1183
#    ifndef SWIG_PYTHON_BUILD_NONE
 
1184
#      define SWIG_PYTHON_BUILD_NONE
 
1185
#    endif
 
1186
#  endif
 
1187
#endif
 
1188
 
 
1189
#ifdef SWIG_PYTHON_BUILD_NONE
 
1190
#  ifdef Py_None
 
1191
#   undef Py_None
 
1192
#   define Py_None SWIG_Py_None()
 
1193
#  endif
 
1194
SWIGRUNTIMEINLINE PyObject * 
 
1195
_SWIG_Py_None(void)
 
1196
{
 
1197
  PyObject *none = Py_BuildValue((char*)"");
 
1198
  Py_DECREF(none);
 
1199
  return none;
 
1200
}
 
1201
SWIGRUNTIME PyObject * 
 
1202
SWIG_Py_None(void)
 
1203
{
 
1204
  static PyObject *SWIG_STATIC_POINTER(none) = _SWIG_Py_None();
 
1205
  return none;
 
1206
}
 
1207
#endif
 
1208
 
 
1209
/* The python void return value */
 
1210
 
 
1211
SWIGRUNTIMEINLINE PyObject * 
 
1212
SWIG_Py_Void(void)
 
1213
{
 
1214
  PyObject *none = Py_None;
 
1215
  Py_INCREF(none);
 
1216
  return none;
 
1217
}
 
1218
 
 
1219
/* PySwigClientData */
 
1220
 
 
1221
typedef struct {
 
1222
  PyObject *klass;
 
1223
  PyObject *newraw;
 
1224
  PyObject *newargs;
 
1225
  PyObject *destroy;
 
1226
  int delargs;
 
1227
  int implicitconv;
 
1228
} PySwigClientData;
 
1229
 
 
1230
SWIGRUNTIMEINLINE int 
 
1231
SWIG_Python_CheckImplicit(swig_type_info *ty)
 
1232
{
 
1233
  PySwigClientData *data = (PySwigClientData *)ty->clientdata;
 
1234
  return data ? data->implicitconv : 0;
 
1235
}
 
1236
 
 
1237
SWIGRUNTIMEINLINE PyObject *
 
1238
SWIG_Python_ExceptionType(swig_type_info *desc) {
 
1239
  PySwigClientData *data = desc ? (PySwigClientData *) desc->clientdata : 0;
 
1240
  PyObject *klass = data ? data->klass : 0;
 
1241
  return (klass ? klass : PyExc_RuntimeError);
 
1242
}
 
1243
 
 
1244
 
 
1245
SWIGRUNTIME PySwigClientData * 
 
1246
PySwigClientData_New(PyObject* obj)
 
1247
{
 
1248
  if (!obj) {
 
1249
    return 0;
 
1250
  } else {
 
1251
    PySwigClientData *data = (PySwigClientData *)malloc(sizeof(PySwigClientData));
 
1252
    /* the klass element */
 
1253
    data->klass = obj;
 
1254
    Py_INCREF(data->klass);
 
1255
    /* the newraw method and newargs arguments used to create a new raw instance */
 
1256
    if (PyClass_Check(obj)) {
 
1257
      data->newraw = 0;
 
1258
      data->newargs = obj;
 
1259
      Py_INCREF(obj);
 
1260
    } else {
 
1261
#if (PY_VERSION_HEX < 0x02020000)
 
1262
      data->newraw = 0;
 
1263
#else
 
1264
      data->newraw = PyObject_GetAttrString(data->klass, (char *)"__new__");
 
1265
#endif
 
1266
      if (data->newraw) {
 
1267
        Py_INCREF(data->newraw);
 
1268
        data->newargs = PyTuple_New(1);
 
1269
        PyTuple_SetItem(data->newargs, 0, obj);
 
1270
      } else {
 
1271
        data->newargs = obj;
 
1272
      }
 
1273
      Py_INCREF(data->newargs);
 
1274
    }
 
1275
    /* the destroy method, aka as the C++ delete method */
 
1276
    data->destroy = PyObject_GetAttrString(data->klass, (char *)"__swig_destroy__");
 
1277
    if (PyErr_Occurred()) {
 
1278
      PyErr_Clear();
 
1279
      data->destroy = 0;
 
1280
    }
 
1281
    if (data->destroy) {
 
1282
      int flags;
 
1283
      Py_INCREF(data->destroy);
 
1284
      flags = PyCFunction_GET_FLAGS(data->destroy);
 
1285
#ifdef METH_O
 
1286
      data->delargs = !(flags & (METH_O));
 
1287
#else
 
1288
      data->delargs = 0;
 
1289
#endif
 
1290
    } else {
 
1291
      data->delargs = 0;
 
1292
    }
 
1293
    data->implicitconv = 0;
 
1294
    return data;
 
1295
  }
 
1296
}
 
1297
 
 
1298
SWIGRUNTIME void 
 
1299
PySwigClientData_Del(PySwigClientData* data)
 
1300
{
 
1301
  Py_XDECREF(data->newraw);
 
1302
  Py_XDECREF(data->newargs);
 
1303
  Py_XDECREF(data->destroy);
 
1304
}
 
1305
 
 
1306
/* =============== PySwigObject =====================*/
 
1307
 
 
1308
typedef struct {
 
1309
  PyObject_HEAD
 
1310
  void *ptr;
 
1311
  swig_type_info *ty;
 
1312
  int own;
 
1313
  PyObject *next;
 
1314
} PySwigObject;
 
1315
 
 
1316
SWIGRUNTIME PyObject *
 
1317
PySwigObject_long(PySwigObject *v)
 
1318
{
 
1319
  return PyLong_FromVoidPtr(v->ptr);
 
1320
}
 
1321
 
 
1322
SWIGRUNTIME PyObject *
 
1323
PySwigObject_format(const char* fmt, PySwigObject *v)
 
1324
{
 
1325
  PyObject *res = NULL;
 
1326
  PyObject *args = PyTuple_New(1);
 
1327
  if (args) {
 
1328
    if (PyTuple_SetItem(args, 0, PySwigObject_long(v)) == 0) {
 
1329
      PyObject *ofmt = PyString_FromString(fmt);
 
1330
      if (ofmt) {
 
1331
        res = PyString_Format(ofmt,args);
 
1332
        Py_DECREF(ofmt);
 
1333
      }
 
1334
      Py_DECREF(args);
 
1335
    }
 
1336
  }
 
1337
  return res;
 
1338
}
 
1339
 
 
1340
SWIGRUNTIME PyObject *
 
1341
PySwigObject_oct(PySwigObject *v)
 
1342
{
 
1343
  return PySwigObject_format("%o",v);
 
1344
}
 
1345
 
 
1346
SWIGRUNTIME PyObject *
 
1347
PySwigObject_hex(PySwigObject *v)
 
1348
{
 
1349
  return PySwigObject_format("%x",v);
 
1350
}
 
1351
 
 
1352
SWIGRUNTIME PyObject *
 
1353
#ifdef METH_NOARGS
 
1354
PySwigObject_repr(PySwigObject *v)
 
1355
#else
 
1356
PySwigObject_repr(PySwigObject *v, PyObject *args)
 
1357
#endif
 
1358
{
 
1359
  const char *name = SWIG_TypePrettyName(v->ty);
 
1360
  PyObject *hex = PySwigObject_hex(v);    
 
1361
  PyObject *repr = PyString_FromFormat("<Swig Object of type '%s' at 0x%s>", name, PyString_AsString(hex));
 
1362
  Py_DECREF(hex);
 
1363
  if (v->next) {
 
1364
#ifdef METH_NOARGS
 
1365
    PyObject *nrep = PySwigObject_repr((PySwigObject *)v->next);
 
1366
#else
 
1367
    PyObject *nrep = PySwigObject_repr((PySwigObject *)v->next, args);
 
1368
#endif
 
1369
    PyString_ConcatAndDel(&repr,nrep);
 
1370
  }
 
1371
  return repr;  
 
1372
}
 
1373
 
 
1374
SWIGRUNTIME int
 
1375
PySwigObject_print(PySwigObject *v, FILE *fp, int SWIGUNUSEDPARM(flags))
 
1376
{
 
1377
#ifdef METH_NOARGS
 
1378
  PyObject *repr = PySwigObject_repr(v);
 
1379
#else
 
1380
  PyObject *repr = PySwigObject_repr(v, NULL);
 
1381
#endif
 
1382
  if (repr) {
 
1383
    fputs(PyString_AsString(repr), fp);
 
1384
    Py_DECREF(repr);
 
1385
    return 0; 
 
1386
  } else {
 
1387
    return 1; 
 
1388
  }
 
1389
}
 
1390
 
 
1391
SWIGRUNTIME PyObject *
 
1392
PySwigObject_str(PySwigObject *v)
 
1393
{
 
1394
  char result[SWIG_BUFFER_SIZE];
 
1395
  return SWIG_PackVoidPtr(result, v->ptr, v->ty->name, sizeof(result)) ?
 
1396
    PyString_FromString(result) : 0;
 
1397
}
 
1398
 
 
1399
SWIGRUNTIME int
 
1400
PySwigObject_compare(PySwigObject *v, PySwigObject *w)
 
1401
{
 
1402
  void *i = v->ptr;
 
1403
  void *j = w->ptr;
 
1404
  return (i < j) ? -1 : ((i > j) ? 1 : 0);
 
1405
}
 
1406
 
 
1407
SWIGRUNTIME PyTypeObject* _PySwigObject_type(void);
 
1408
 
 
1409
SWIGRUNTIME PyTypeObject*
 
1410
PySwigObject_type(void) {
 
1411
  static PyTypeObject *SWIG_STATIC_POINTER(type) = _PySwigObject_type();
 
1412
  return type;
 
1413
}
 
1414
 
 
1415
SWIGRUNTIMEINLINE int
 
1416
PySwigObject_Check(PyObject *op) {
 
1417
  return ((op)->ob_type == PySwigObject_type())
 
1418
    || (strcmp((op)->ob_type->tp_name,"PySwigObject") == 0);
 
1419
}
 
1420
 
 
1421
SWIGRUNTIME PyObject *
 
1422
PySwigObject_New(void *ptr, swig_type_info *ty, int own);
 
1423
 
 
1424
SWIGRUNTIME void
 
1425
PySwigObject_dealloc(PyObject *v)
 
1426
{
 
1427
  PySwigObject *sobj = (PySwigObject *) v;
 
1428
  PyObject *next = sobj->next;
 
1429
  if (sobj->own == SWIG_POINTER_OWN) {
 
1430
    swig_type_info *ty = sobj->ty;
 
1431
    PySwigClientData *data = ty ? (PySwigClientData *) ty->clientdata : 0;
 
1432
    PyObject *destroy = data ? data->destroy : 0;
 
1433
    if (destroy) {
 
1434
      /* destroy is always a VARARGS method */
 
1435
      PyObject *res;
 
1436
      if (data->delargs) {
 
1437
        /* we need to create a temporal object to carry the destroy operation */
 
1438
        PyObject *tmp = PySwigObject_New(sobj->ptr, ty, 0);
 
1439
        res = SWIG_Python_CallFunctor(destroy, tmp);
 
1440
        Py_DECREF(tmp);
 
1441
      } else {
 
1442
        PyCFunction meth = PyCFunction_GET_FUNCTION(destroy);
 
1443
        PyObject *mself = PyCFunction_GET_SELF(destroy);
 
1444
        res = ((*meth)(mself, v));
 
1445
      }
 
1446
      Py_XDECREF(res);
 
1447
    } 
 
1448
#if !defined(SWIG_PYTHON_SILENT_MEMLEAK)
 
1449
    else {
 
1450
      const char *name = SWIG_TypePrettyName(ty);
 
1451
      printf("swig/python detected a memory leak of type '%s', no destructor found.\n", (name ? name : "unknown"));
 
1452
    }
 
1453
#endif
 
1454
  } 
 
1455
  Py_XDECREF(next);
 
1456
  PyObject_DEL(v);
 
1457
}
 
1458
 
 
1459
SWIGRUNTIME PyObject* 
 
1460
PySwigObject_append(PyObject* v, PyObject* next)
 
1461
{
 
1462
  PySwigObject *sobj = (PySwigObject *) v;
 
1463
#ifndef METH_O
 
1464
  PyObject *tmp = 0;
 
1465
  if (!PyArg_ParseTuple(next,(char *)"O:append", &tmp)) return NULL;
 
1466
  next = tmp;
 
1467
#endif
 
1468
  if (!PySwigObject_Check(next)) {
 
1469
    return NULL;
 
1470
  }
 
1471
  sobj->next = next;
 
1472
  Py_INCREF(next);
 
1473
  return SWIG_Py_Void();
 
1474
}
 
1475
 
 
1476
SWIGRUNTIME PyObject* 
 
1477
#ifdef METH_NOARGS
 
1478
PySwigObject_next(PyObject* v)
 
1479
#else
 
1480
PySwigObject_next(PyObject* v, PyObject *SWIGUNUSEDPARM(args))
 
1481
#endif
 
1482
{
 
1483
  PySwigObject *sobj = (PySwigObject *) v;
 
1484
  if (sobj->next) {    
 
1485
    Py_INCREF(sobj->next);
 
1486
    return sobj->next;
 
1487
  } else {
 
1488
    return SWIG_Py_Void();
 
1489
  }
 
1490
}
 
1491
 
 
1492
SWIGINTERN PyObject*
 
1493
#ifdef METH_NOARGS
 
1494
PySwigObject_disown(PyObject *v)
 
1495
#else
 
1496
PySwigObject_disown(PyObject* v, PyObject *SWIGUNUSEDPARM(args))
 
1497
#endif
 
1498
{
 
1499
  PySwigObject *sobj = (PySwigObject *)v;
 
1500
  sobj->own = 0;
 
1501
  return SWIG_Py_Void();
 
1502
}
 
1503
 
 
1504
SWIGINTERN PyObject*
 
1505
#ifdef METH_NOARGS
 
1506
PySwigObject_acquire(PyObject *v)
 
1507
#else
 
1508
PySwigObject_acquire(PyObject* v, PyObject *SWIGUNUSEDPARM(args))
 
1509
#endif
 
1510
{
 
1511
  PySwigObject *sobj = (PySwigObject *)v;
 
1512
  sobj->own = SWIG_POINTER_OWN;
 
1513
  return SWIG_Py_Void();
 
1514
}
 
1515
 
 
1516
SWIGINTERN PyObject*
 
1517
PySwigObject_own(PyObject *v, PyObject *args)
 
1518
{
 
1519
  PyObject *val = 0;
 
1520
#if (PY_VERSION_HEX < 0x02020000)
 
1521
  if (!PyArg_ParseTuple(args,(char *)"|O:own",&val))
 
1522
#else
 
1523
  if (!PyArg_UnpackTuple(args, (char *)"own", 0, 1, &val)) 
 
1524
#endif
 
1525
    {
 
1526
      return NULL;
 
1527
    } 
 
1528
  else
 
1529
    {
 
1530
      PySwigObject *sobj = (PySwigObject *)v;
 
1531
      PyObject *obj = PyBool_FromLong(sobj->own);
 
1532
      if (val) {
 
1533
#ifdef METH_NOARGS
 
1534
        if (PyObject_IsTrue(val)) {
 
1535
          PySwigObject_acquire(v);
 
1536
        } else {
 
1537
          PySwigObject_disown(v);
 
1538
        }
 
1539
#else
 
1540
        if (PyObject_IsTrue(val)) {
 
1541
          PySwigObject_acquire(v,args);
 
1542
        } else {
 
1543
          PySwigObject_disown(v,args);
 
1544
        }
 
1545
#endif
 
1546
      } 
 
1547
      return obj;
 
1548
    }
 
1549
}
 
1550
 
 
1551
#ifdef METH_O
 
1552
static PyMethodDef
 
1553
swigobject_methods[] = {
 
1554
  {(char *)"disown",  (PyCFunction)PySwigObject_disown,  METH_NOARGS,  (char *)"releases ownership of the pointer"},
 
1555
  {(char *)"acquire", (PyCFunction)PySwigObject_acquire, METH_NOARGS,  (char *)"aquires ownership of the pointer"},
 
1556
  {(char *)"own",     (PyCFunction)PySwigObject_own,     METH_VARARGS, (char *)"returns/sets ownership of the pointer"},
 
1557
  {(char *)"append",  (PyCFunction)PySwigObject_append,  METH_O,       (char *)"appends another 'this' object"},
 
1558
  {(char *)"next",    (PyCFunction)PySwigObject_next,    METH_NOARGS,  (char *)"returns the next 'this' object"},
 
1559
  {(char *)"__repr__",(PyCFunction)PySwigObject_repr,    METH_NOARGS,  (char *)"returns object representation"},
 
1560
  {0, 0, 0, 0}  
 
1561
};
 
1562
#else
 
1563
static PyMethodDef
 
1564
swigobject_methods[] = {
 
1565
  {(char *)"disown",  (PyCFunction)PySwigObject_disown,  METH_VARARGS,  (char *)"releases ownership of the pointer"},
 
1566
  {(char *)"acquire", (PyCFunction)PySwigObject_acquire, METH_VARARGS,  (char *)"aquires ownership of the pointer"},
 
1567
  {(char *)"own",     (PyCFunction)PySwigObject_own,     METH_VARARGS,  (char *)"returns/sets ownership of the pointer"},
 
1568
  {(char *)"append",  (PyCFunction)PySwigObject_append,  METH_VARARGS,  (char *)"appends another 'this' object"},
 
1569
  {(char *)"next",    (PyCFunction)PySwigObject_next,    METH_VARARGS,  (char *)"returns the next 'this' object"},
 
1570
  {(char *)"__repr__",(PyCFunction)PySwigObject_repr,   METH_VARARGS,  (char *)"returns object representation"},
 
1571
  {0, 0, 0, 0}  
 
1572
};
 
1573
#endif
 
1574
 
 
1575
#if PY_VERSION_HEX < 0x02020000
 
1576
SWIGINTERN PyObject *
 
1577
PySwigObject_getattr(PySwigObject *sobj,char *name)
 
1578
{
 
1579
  return Py_FindMethod(swigobject_methods, (PyObject *)sobj, name);
 
1580
}
 
1581
#endif
 
1582
 
 
1583
SWIGRUNTIME PyTypeObject*
 
1584
_PySwigObject_type(void) {
 
1585
  static char swigobject_doc[] = "Swig object carries a C/C++ instance pointer";
 
1586
  
 
1587
  static PyNumberMethods PySwigObject_as_number = {
 
1588
    (binaryfunc)0, /*nb_add*/
 
1589
    (binaryfunc)0, /*nb_subtract*/
 
1590
    (binaryfunc)0, /*nb_multiply*/
 
1591
    (binaryfunc)0, /*nb_divide*/
 
1592
    (binaryfunc)0, /*nb_remainder*/
 
1593
    (binaryfunc)0, /*nb_divmod*/
 
1594
    (ternaryfunc)0,/*nb_power*/
 
1595
    (unaryfunc)0,  /*nb_negative*/
 
1596
    (unaryfunc)0,  /*nb_positive*/
 
1597
    (unaryfunc)0,  /*nb_absolute*/
 
1598
    (inquiry)0,    /*nb_nonzero*/
 
1599
    0,             /*nb_invert*/
 
1600
    0,             /*nb_lshift*/
 
1601
    0,             /*nb_rshift*/
 
1602
    0,             /*nb_and*/
 
1603
    0,             /*nb_xor*/
 
1604
    0,             /*nb_or*/
 
1605
    (coercion)0,   /*nb_coerce*/
 
1606
    (unaryfunc)PySwigObject_long, /*nb_int*/
 
1607
    (unaryfunc)PySwigObject_long, /*nb_long*/
 
1608
    (unaryfunc)0,                 /*nb_float*/
 
1609
    (unaryfunc)PySwigObject_oct,  /*nb_oct*/
 
1610
    (unaryfunc)PySwigObject_hex,  /*nb_hex*/
 
1611
#if PY_VERSION_HEX >= 0x02050000 /* 2.5.0 */
 
1612
    0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 /* nb_inplace_add -> nb_index */
 
1613
#elif PY_VERSION_HEX >= 0x02020000 /* 2.2.0 */
 
1614
    0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 /* nb_inplace_add -> nb_inplace_true_divide */
 
1615
#elif PY_VERSION_HEX >= 0x02000000 /* 2.0.0 */
 
1616
    0,0,0,0,0,0,0,0,0,0,0 /* nb_inplace_add -> nb_inplace_or */
 
1617
#endif
 
1618
  };
 
1619
 
 
1620
  static PyTypeObject pyswigobject_type;  
 
1621
  static int type_init = 0;
 
1622
  if (!type_init) {
 
1623
    const PyTypeObject tmp
 
1624
      = {
 
1625
        PyObject_HEAD_INIT(NULL)
 
1626
        0,                                  /* ob_size */
 
1627
        (char *)"PySwigObject",             /* tp_name */
 
1628
        sizeof(PySwigObject),               /* tp_basicsize */
 
1629
        0,                                  /* tp_itemsize */
 
1630
        (destructor)PySwigObject_dealloc,   /* tp_dealloc */
 
1631
        (printfunc)PySwigObject_print,      /* tp_print */
 
1632
#if PY_VERSION_HEX < 0x02020000
 
1633
        (getattrfunc)PySwigObject_getattr,  /* tp_getattr */ 
 
1634
#else
 
1635
        (getattrfunc)0,                     /* tp_getattr */ 
 
1636
#endif
 
1637
        (setattrfunc)0,                     /* tp_setattr */ 
 
1638
        (cmpfunc)PySwigObject_compare,      /* tp_compare */ 
 
1639
        (reprfunc)PySwigObject_repr,        /* tp_repr */    
 
1640
        &PySwigObject_as_number,            /* tp_as_number */
 
1641
        0,                                  /* tp_as_sequence */
 
1642
        0,                                  /* tp_as_mapping */
 
1643
        (hashfunc)0,                        /* tp_hash */
 
1644
        (ternaryfunc)0,                     /* tp_call */
 
1645
        (reprfunc)PySwigObject_str,         /* tp_str */
 
1646
        PyObject_GenericGetAttr,            /* tp_getattro */
 
1647
        0,                                  /* tp_setattro */
 
1648
        0,                                  /* tp_as_buffer */
 
1649
        Py_TPFLAGS_DEFAULT,                 /* tp_flags */
 
1650
        swigobject_doc,                     /* tp_doc */        
 
1651
        0,                                  /* tp_traverse */
 
1652
        0,                                  /* tp_clear */
 
1653
        0,                                  /* tp_richcompare */
 
1654
        0,                                  /* tp_weaklistoffset */
 
1655
#if PY_VERSION_HEX >= 0x02020000
 
1656
        0,                                  /* tp_iter */
 
1657
        0,                                  /* tp_iternext */
 
1658
        swigobject_methods,                 /* tp_methods */ 
 
1659
        0,                                  /* tp_members */
 
1660
        0,                                  /* tp_getset */             
 
1661
        0,                                  /* tp_base */               
 
1662
        0,                                  /* tp_dict */               
 
1663
        0,                                  /* tp_descr_get */          
 
1664
        0,                                  /* tp_descr_set */          
 
1665
        0,                                  /* tp_dictoffset */         
 
1666
        0,                                  /* tp_init */               
 
1667
        0,                                  /* tp_alloc */              
 
1668
        0,                                  /* tp_new */                
 
1669
        0,                                  /* tp_free */          
 
1670
        0,                                  /* tp_is_gc */  
 
1671
        0,                                  /* tp_bases */   
 
1672
        0,                                  /* tp_mro */
 
1673
        0,                                  /* tp_cache */   
 
1674
        0,                                  /* tp_subclasses */
 
1675
        0,                                  /* tp_weaklist */
 
1676
#endif
 
1677
#if PY_VERSION_HEX >= 0x02030000
 
1678
        0,                                  /* tp_del */
 
1679
#endif
 
1680
#ifdef COUNT_ALLOCS
 
1681
        0,0,0,0                             /* tp_alloc -> tp_next */
 
1682
#endif
 
1683
      };
 
1684
    pyswigobject_type = tmp;
 
1685
    pyswigobject_type.ob_type = &PyType_Type;
 
1686
    type_init = 1;
 
1687
  }
 
1688
  return &pyswigobject_type;
 
1689
}
 
1690
 
 
1691
SWIGRUNTIME PyObject *
 
1692
PySwigObject_New(void *ptr, swig_type_info *ty, int own)
 
1693
{
 
1694
  PySwigObject *sobj = PyObject_NEW(PySwigObject, PySwigObject_type());
 
1695
  if (sobj) {
 
1696
    sobj->ptr  = ptr;
 
1697
    sobj->ty   = ty;
 
1698
    sobj->own  = own;
 
1699
    sobj->next = 0;
 
1700
  }
 
1701
  return (PyObject *)sobj;
 
1702
}
 
1703
 
 
1704
/* -----------------------------------------------------------------------------
 
1705
 * Implements a simple Swig Packed type, and use it instead of string
 
1706
 * ----------------------------------------------------------------------------- */
 
1707
 
 
1708
typedef struct {
 
1709
  PyObject_HEAD
 
1710
  void *pack;
 
1711
  swig_type_info *ty;
 
1712
  size_t size;
 
1713
} PySwigPacked;
 
1714
 
 
1715
SWIGRUNTIME int
 
1716
PySwigPacked_print(PySwigPacked *v, FILE *fp, int SWIGUNUSEDPARM(flags))
 
1717
{
 
1718
  char result[SWIG_BUFFER_SIZE];
 
1719
  fputs("<Swig Packed ", fp); 
 
1720
  if (SWIG_PackDataName(result, v->pack, v->size, 0, sizeof(result))) {
 
1721
    fputs("at ", fp); 
 
1722
    fputs(result, fp); 
 
1723
  }
 
1724
  fputs(v->ty->name,fp); 
 
1725
  fputs(">", fp);
 
1726
  return 0; 
 
1727
}
 
1728
  
 
1729
SWIGRUNTIME PyObject *
 
1730
PySwigPacked_repr(PySwigPacked *v)
 
1731
{
 
1732
  char result[SWIG_BUFFER_SIZE];
 
1733
  if (SWIG_PackDataName(result, v->pack, v->size, 0, sizeof(result))) {
 
1734
    return PyString_FromFormat("<Swig Packed at %s%s>", result, v->ty->name);
 
1735
  } else {
 
1736
    return PyString_FromFormat("<Swig Packed %s>", v->ty->name);
 
1737
  }  
 
1738
}
 
1739
 
 
1740
SWIGRUNTIME PyObject *
 
1741
PySwigPacked_str(PySwigPacked *v)
 
1742
{
 
1743
  char result[SWIG_BUFFER_SIZE];
 
1744
  if (SWIG_PackDataName(result, v->pack, v->size, 0, sizeof(result))){
 
1745
    return PyString_FromFormat("%s%s", result, v->ty->name);
 
1746
  } else {
 
1747
    return PyString_FromString(v->ty->name);
 
1748
  }  
 
1749
}
 
1750
 
 
1751
SWIGRUNTIME int
 
1752
PySwigPacked_compare(PySwigPacked *v, PySwigPacked *w)
 
1753
{
 
1754
  size_t i = v->size;
 
1755
  size_t j = w->size;
 
1756
  int s = (i < j) ? -1 : ((i > j) ? 1 : 0);
 
1757
  return s ? s : strncmp((char *)v->pack, (char *)w->pack, 2*v->size);
 
1758
}
 
1759
 
 
1760
SWIGRUNTIME PyTypeObject* _PySwigPacked_type(void);
 
1761
 
 
1762
SWIGRUNTIME PyTypeObject*
 
1763
PySwigPacked_type(void) {
 
1764
  static PyTypeObject *SWIG_STATIC_POINTER(type) = _PySwigPacked_type();
 
1765
  return type;
 
1766
}
 
1767
 
 
1768
SWIGRUNTIMEINLINE int
 
1769
PySwigPacked_Check(PyObject *op) {
 
1770
  return ((op)->ob_type == _PySwigPacked_type()) 
 
1771
    || (strcmp((op)->ob_type->tp_name,"PySwigPacked") == 0);
 
1772
}
 
1773
 
 
1774
SWIGRUNTIME void
 
1775
PySwigPacked_dealloc(PyObject *v)
 
1776
{
 
1777
  if (PySwigPacked_Check(v)) {
 
1778
    PySwigPacked *sobj = (PySwigPacked *) v;
 
1779
    free(sobj->pack);
 
1780
  }
 
1781
  PyObject_DEL(v);
 
1782
}
 
1783
 
 
1784
SWIGRUNTIME PyTypeObject*
 
1785
_PySwigPacked_type(void) {
 
1786
  static char swigpacked_doc[] = "Swig object carries a C/C++ instance pointer";
 
1787
  static PyTypeObject pyswigpacked_type;
 
1788
  static int type_init = 0;  
 
1789
  if (!type_init) {
 
1790
    const PyTypeObject tmp
 
1791
      = {
 
1792
        PyObject_HEAD_INIT(NULL)
 
1793
        0,                                  /* ob_size */       
 
1794
        (char *)"PySwigPacked",             /* tp_name */       
 
1795
        sizeof(PySwigPacked),               /* tp_basicsize */  
 
1796
        0,                                  /* tp_itemsize */   
 
1797
        (destructor)PySwigPacked_dealloc,   /* tp_dealloc */    
 
1798
        (printfunc)PySwigPacked_print,      /* tp_print */      
 
1799
        (getattrfunc)0,                     /* tp_getattr */    
 
1800
        (setattrfunc)0,                     /* tp_setattr */    
 
1801
        (cmpfunc)PySwigPacked_compare,      /* tp_compare */    
 
1802
        (reprfunc)PySwigPacked_repr,        /* tp_repr */       
 
1803
        0,                                  /* tp_as_number */  
 
1804
        0,                                  /* tp_as_sequence */
 
1805
        0,                                  /* tp_as_mapping */ 
 
1806
        (hashfunc)0,                        /* tp_hash */       
 
1807
        (ternaryfunc)0,                     /* tp_call */       
 
1808
        (reprfunc)PySwigPacked_str,         /* tp_str */        
 
1809
        PyObject_GenericGetAttr,            /* tp_getattro */
 
1810
        0,                                  /* tp_setattro */
 
1811
        0,                                  /* tp_as_buffer */
 
1812
        Py_TPFLAGS_DEFAULT,                 /* tp_flags */
 
1813
        swigpacked_doc,                     /* tp_doc */
 
1814
        0,                                  /* tp_traverse */
 
1815
        0,                                  /* tp_clear */
 
1816
        0,                                  /* tp_richcompare */
 
1817
        0,                                  /* tp_weaklistoffset */
 
1818
#if PY_VERSION_HEX >= 0x02020000
 
1819
        0,                                  /* tp_iter */
 
1820
        0,                                  /* tp_iternext */
 
1821
        0,                                  /* tp_methods */ 
 
1822
        0,                                  /* tp_members */
 
1823
        0,                                  /* tp_getset */             
 
1824
        0,                                  /* tp_base */               
 
1825
        0,                                  /* tp_dict */               
 
1826
        0,                                  /* tp_descr_get */          
 
1827
        0,                                  /* tp_descr_set */          
 
1828
        0,                                  /* tp_dictoffset */         
 
1829
        0,                                  /* tp_init */               
 
1830
        0,                                  /* tp_alloc */              
 
1831
        0,                                  /* tp_new */                
 
1832
        0,                                  /* tp_free */          
 
1833
        0,                                  /* tp_is_gc */  
 
1834
        0,                                  /* tp_bases */   
 
1835
        0,                                  /* tp_mro */
 
1836
        0,                                  /* tp_cache */   
 
1837
        0,                                  /* tp_subclasses */
 
1838
        0,                                  /* tp_weaklist */
 
1839
#endif
 
1840
#if PY_VERSION_HEX >= 0x02030000
 
1841
        0,                                  /* tp_del */
 
1842
#endif
 
1843
#ifdef COUNT_ALLOCS
 
1844
        0,0,0,0                             /* tp_alloc -> tp_next */
 
1845
#endif
 
1846
      };
 
1847
    pyswigpacked_type = tmp;
 
1848
    pyswigpacked_type.ob_type = &PyType_Type;
 
1849
    type_init = 1;
 
1850
  }
 
1851
  return &pyswigpacked_type;
 
1852
}
 
1853
 
 
1854
SWIGRUNTIME PyObject *
 
1855
PySwigPacked_New(void *ptr, size_t size, swig_type_info *ty)
 
1856
{
 
1857
  PySwigPacked *sobj = PyObject_NEW(PySwigPacked, PySwigPacked_type());
 
1858
  if (sobj) {
 
1859
    void *pack = malloc(size);
 
1860
    if (pack) {
 
1861
      memcpy(pack, ptr, size);
 
1862
      sobj->pack = pack;
 
1863
      sobj->ty   = ty;
 
1864
      sobj->size = size;
 
1865
    } else {
 
1866
      PyObject_DEL((PyObject *) sobj);
 
1867
      sobj = 0;
 
1868
    }
 
1869
  }
 
1870
  return (PyObject *) sobj;
 
1871
}
 
1872
 
 
1873
SWIGRUNTIME swig_type_info *
 
1874
PySwigPacked_UnpackData(PyObject *obj, void *ptr, size_t size)
 
1875
{
 
1876
  if (PySwigPacked_Check(obj)) {
 
1877
    PySwigPacked *sobj = (PySwigPacked *)obj;
 
1878
    if (sobj->size != size) return 0;
 
1879
    memcpy(ptr, sobj->pack, size);
 
1880
    return sobj->ty;
 
1881
  } else {
 
1882
    return 0;
 
1883
  }
 
1884
}
 
1885
 
 
1886
/* -----------------------------------------------------------------------------
 
1887
 * pointers/data manipulation
 
1888
 * ----------------------------------------------------------------------------- */
 
1889
 
 
1890
SWIGRUNTIMEINLINE PyObject *
 
1891
_SWIG_This(void)
 
1892
{
 
1893
  return PyString_FromString("this");
 
1894
}
 
1895
 
 
1896
SWIGRUNTIME PyObject *
 
1897
SWIG_This(void)
 
1898
{
 
1899
  static PyObject *SWIG_STATIC_POINTER(swig_this) = _SWIG_This();
 
1900
  return swig_this;
 
1901
}
 
1902
 
 
1903
/* #define SWIG_PYTHON_SLOW_GETSET_THIS */
 
1904
 
 
1905
SWIGRUNTIME PySwigObject *
 
1906
SWIG_Python_GetSwigThis(PyObject *pyobj) 
 
1907
{
 
1908
  if (PySwigObject_Check(pyobj)) {
 
1909
    return (PySwigObject *) pyobj;
 
1910
  } else {
 
1911
    PyObject *obj = 0;
 
1912
#if (!defined(SWIG_PYTHON_SLOW_GETSET_THIS) && (PY_VERSION_HEX >= 0x02030000))
 
1913
    if (PyInstance_Check(pyobj)) {
 
1914
      obj = _PyInstance_Lookup(pyobj, SWIG_This());      
 
1915
    } else {
 
1916
      PyObject **dictptr = _PyObject_GetDictPtr(pyobj);
 
1917
      if (dictptr != NULL) {
 
1918
        PyObject *dict = *dictptr;
 
1919
        obj = dict ? PyDict_GetItem(dict, SWIG_This()) : 0;
 
1920
      } else {
 
1921
#ifdef PyWeakref_CheckProxy
 
1922
        if (PyWeakref_CheckProxy(pyobj)) {
 
1923
          PyObject *wobj = PyWeakref_GET_OBJECT(pyobj);
 
1924
          return wobj ? SWIG_Python_GetSwigThis(wobj) : 0;
 
1925
        }
 
1926
#endif
 
1927
        obj = PyObject_GetAttr(pyobj,SWIG_This());
 
1928
        if (obj) {
 
1929
          Py_DECREF(obj);
 
1930
        } else {
 
1931
          if (PyErr_Occurred()) PyErr_Clear();
 
1932
          return 0;
 
1933
        }
 
1934
      }
 
1935
    }
 
1936
#else
 
1937
    obj = PyObject_GetAttr(pyobj,SWIG_This());
 
1938
    if (obj) {
 
1939
      Py_DECREF(obj);
 
1940
    } else {
 
1941
      if (PyErr_Occurred()) PyErr_Clear();
 
1942
      return 0;
 
1943
    }
 
1944
#endif
 
1945
    if (obj && !PySwigObject_Check(obj)) {
 
1946
      /* a PyObject is called 'this', try to get the 'real this'
 
1947
         PySwigObject from it */ 
 
1948
      return SWIG_Python_GetSwigThis(obj);
 
1949
    }
 
1950
    return (PySwigObject *)obj;
 
1951
  }
 
1952
}
 
1953
 
 
1954
/* Acquire a pointer value */
 
1955
 
 
1956
SWIGRUNTIME int
 
1957
SWIG_Python_AcquirePtr(PyObject *obj, int own) {
 
1958
  if (own == SWIG_POINTER_OWN) {
 
1959
    PySwigObject *sobj = SWIG_Python_GetSwigThis(obj);
 
1960
    if (sobj) {
 
1961
      int oldown = sobj->own;
 
1962
      sobj->own = own;
 
1963
      return oldown;
 
1964
    }
 
1965
  }
 
1966
  return 0;
 
1967
}
 
1968
 
 
1969
/* Convert a pointer value */
 
1970
 
 
1971
SWIGRUNTIME int
 
1972
SWIG_Python_ConvertPtrAndOwn(PyObject *obj, void **ptr, swig_type_info *ty, int flags, int *own) {
 
1973
  if (!obj) return SWIG_ERROR;
 
1974
  if (obj == Py_None) {
 
1975
    if (ptr) *ptr = 0;
 
1976
    return SWIG_OK;
 
1977
  } else {
 
1978
    PySwigObject *sobj = SWIG_Python_GetSwigThis(obj);
 
1979
    if (own)
 
1980
      *own = 0;
 
1981
    while (sobj) {
 
1982
      void *vptr = sobj->ptr;
 
1983
      if (ty) {
 
1984
        swig_type_info *to = sobj->ty;
 
1985
        if (to == ty) {
 
1986
          /* no type cast needed */
 
1987
          if (ptr) *ptr = vptr;
 
1988
          break;
 
1989
        } else {
 
1990
          swig_cast_info *tc = SWIG_TypeCheck(to->name,ty);
 
1991
          if (!tc) {
 
1992
            sobj = (PySwigObject *)sobj->next;
 
1993
          } else {
 
1994
            if (ptr) {
 
1995
              int newmemory = 0;
 
1996
              *ptr = SWIG_TypeCast(tc,vptr,&newmemory);
 
1997
              if (newmemory == SWIG_CAST_NEW_MEMORY) {
 
1998
                assert(own);
 
1999
                if (own)
 
2000
                  *own = *own | SWIG_CAST_NEW_MEMORY;
 
2001
              }
 
2002
            }
 
2003
            break;
 
2004
          }
 
2005
        }
 
2006
      } else {
 
2007
        if (ptr) *ptr = vptr;
 
2008
        break;
 
2009
      }
 
2010
    }
 
2011
    if (sobj) {
 
2012
      if (own)
 
2013
        *own = *own | sobj->own;
 
2014
      if (flags & SWIG_POINTER_DISOWN) {
 
2015
        sobj->own = 0;
 
2016
      }
 
2017
      return SWIG_OK;
 
2018
    } else {
 
2019
      int res = SWIG_ERROR;
 
2020
      if (flags & SWIG_POINTER_IMPLICIT_CONV) {
 
2021
        PySwigClientData *data = ty ? (PySwigClientData *) ty->clientdata : 0;
 
2022
        if (data && !data->implicitconv) {
 
2023
          PyObject *klass = data->klass;
 
2024
          if (klass) {
 
2025
            PyObject *impconv;
 
2026
            data->implicitconv = 1; /* avoid recursion and call 'explicit' constructors*/
 
2027
            impconv = SWIG_Python_CallFunctor(klass, obj);
 
2028
            data->implicitconv = 0;
 
2029
            if (PyErr_Occurred()) {
 
2030
              PyErr_Clear();
 
2031
              impconv = 0;
 
2032
            }
 
2033
            if (impconv) {
 
2034
              PySwigObject *iobj = SWIG_Python_GetSwigThis(impconv);
 
2035
              if (iobj) {
 
2036
                void *vptr;
 
2037
                res = SWIG_Python_ConvertPtrAndOwn((PyObject*)iobj, &vptr, ty, 0, 0);
 
2038
                if (SWIG_IsOK(res)) {
 
2039
                  if (ptr) {
 
2040
                    *ptr = vptr;
 
2041
                    /* transfer the ownership to 'ptr' */
 
2042
                    iobj->own = 0;
 
2043
                    res = SWIG_AddCast(res);
 
2044
                    res = SWIG_AddNewMask(res);
 
2045
                  } else {
 
2046
                    res = SWIG_AddCast(res);                
 
2047
                  }
 
2048
                }
 
2049
              }
 
2050
              Py_DECREF(impconv);
 
2051
            }
 
2052
          }
 
2053
        }
 
2054
      }
 
2055
      return res;
 
2056
    }
 
2057
  }
 
2058
}
 
2059
 
 
2060
/* Convert a function ptr value */
 
2061
 
 
2062
SWIGRUNTIME int
 
2063
SWIG_Python_ConvertFunctionPtr(PyObject *obj, void **ptr, swig_type_info *ty) {
 
2064
  if (!PyCFunction_Check(obj)) {
 
2065
    return SWIG_ConvertPtr(obj, ptr, ty, 0);
 
2066
  } else {
 
2067
    void *vptr = 0;
 
2068
    
 
2069
    /* here we get the method pointer for callbacks */
 
2070
    const char *doc = (((PyCFunctionObject *)obj) -> m_ml -> ml_doc);
 
2071
    const char *desc = doc ? strstr(doc, "swig_ptr: ") : 0;
 
2072
    if (desc) {
 
2073
      desc = ty ? SWIG_UnpackVoidPtr(desc + 10, &vptr, ty->name) : 0;
 
2074
      if (!desc) return SWIG_ERROR;
 
2075
    }
 
2076
    if (ty) {
 
2077
      swig_cast_info *tc = SWIG_TypeCheck(desc,ty);
 
2078
      if (tc) {
 
2079
        int newmemory = 0;
 
2080
        *ptr = SWIG_TypeCast(tc,vptr,&newmemory);
 
2081
        assert(!newmemory); /* newmemory handling not yet implemented */
 
2082
      } else {
 
2083
        return SWIG_ERROR;
 
2084
      }
 
2085
    } else {
 
2086
      *ptr = vptr;
 
2087
    }
 
2088
    return SWIG_OK;
 
2089
  }
 
2090
}
 
2091
 
 
2092
/* Convert a packed value value */
 
2093
 
 
2094
SWIGRUNTIME int
 
2095
SWIG_Python_ConvertPacked(PyObject *obj, void *ptr, size_t sz, swig_type_info *ty) {
 
2096
  swig_type_info *to = PySwigPacked_UnpackData(obj, ptr, sz);
 
2097
  if (!to) return SWIG_ERROR;
 
2098
  if (ty) {
 
2099
    if (to != ty) {
 
2100
      /* check type cast? */
 
2101
      swig_cast_info *tc = SWIG_TypeCheck(to->name,ty);
 
2102
      if (!tc) return SWIG_ERROR;
 
2103
    }
 
2104
  }
 
2105
  return SWIG_OK;
 
2106
}  
 
2107
 
 
2108
/* -----------------------------------------------------------------------------
 
2109
 * Create a new pointer object
 
2110
 * ----------------------------------------------------------------------------- */
 
2111
 
 
2112
/*
 
2113
  Create a new instance object, whitout calling __init__, and set the
 
2114
  'this' attribute.
 
2115
*/
 
2116
 
 
2117
SWIGRUNTIME PyObject* 
 
2118
SWIG_Python_NewShadowInstance(PySwigClientData *data, PyObject *swig_this)
 
2119
{
 
2120
#if (PY_VERSION_HEX >= 0x02020000)
 
2121
  PyObject *inst = 0;
 
2122
  PyObject *newraw = data->newraw;
 
2123
  if (newraw) {
 
2124
    inst = PyObject_Call(newraw, data->newargs, NULL);
 
2125
    if (inst) {
 
2126
#if !defined(SWIG_PYTHON_SLOW_GETSET_THIS)
 
2127
      PyObject **dictptr = _PyObject_GetDictPtr(inst);
 
2128
      if (dictptr != NULL) {
 
2129
        PyObject *dict = *dictptr;
 
2130
        if (dict == NULL) {
 
2131
          dict = PyDict_New();
 
2132
          *dictptr = dict;
 
2133
          PyDict_SetItem(dict, SWIG_This(), swig_this);
 
2134
        }
 
2135
      }
 
2136
#else
 
2137
      PyObject *key = SWIG_This();
 
2138
      PyObject_SetAttr(inst, key, swig_this);
 
2139
#endif
 
2140
    }
 
2141
  } else {
 
2142
    PyObject *dict = PyDict_New();
 
2143
    PyDict_SetItem(dict, SWIG_This(), swig_this);
 
2144
    inst = PyInstance_NewRaw(data->newargs, dict);
 
2145
    Py_DECREF(dict);
 
2146
  }
 
2147
  return inst;
 
2148
#else
 
2149
#if (PY_VERSION_HEX >= 0x02010000)
 
2150
  PyObject *inst;
 
2151
  PyObject *dict = PyDict_New();
 
2152
  PyDict_SetItem(dict, SWIG_This(), swig_this);
 
2153
  inst = PyInstance_NewRaw(data->newargs, dict);
 
2154
  Py_DECREF(dict);
 
2155
  return (PyObject *) inst;
 
2156
#else
 
2157
  PyInstanceObject *inst = PyObject_NEW(PyInstanceObject, &PyInstance_Type);
 
2158
  if (inst == NULL) {
 
2159
    return NULL;
 
2160
  }
 
2161
  inst->in_class = (PyClassObject *)data->newargs;
 
2162
  Py_INCREF(inst->in_class);
 
2163
  inst->in_dict = PyDict_New();
 
2164
  if (inst->in_dict == NULL) {
 
2165
    Py_DECREF(inst);
 
2166
    return NULL;
 
2167
  }
 
2168
#ifdef Py_TPFLAGS_HAVE_WEAKREFS
 
2169
  inst->in_weakreflist = NULL;
 
2170
#endif
 
2171
#ifdef Py_TPFLAGS_GC
 
2172
  PyObject_GC_Init(inst);
 
2173
#endif
 
2174
  PyDict_SetItem(inst->in_dict, SWIG_This(), swig_this);
 
2175
  return (PyObject *) inst;
 
2176
#endif
 
2177
#endif
 
2178
}
 
2179
 
 
2180
SWIGRUNTIME void
 
2181
SWIG_Python_SetSwigThis(PyObject *inst, PyObject *swig_this)
 
2182
{
 
2183
 PyObject *dict;
 
2184
#if (PY_VERSION_HEX >= 0x02020000) && !defined(SWIG_PYTHON_SLOW_GETSET_THIS)
 
2185
 PyObject **dictptr = _PyObject_GetDictPtr(inst);
 
2186
 if (dictptr != NULL) {
 
2187
   dict = *dictptr;
 
2188
   if (dict == NULL) {
 
2189
     dict = PyDict_New();
 
2190
     *dictptr = dict;
 
2191
   }
 
2192
   PyDict_SetItem(dict, SWIG_This(), swig_this);
 
2193
   return;
 
2194
 }
 
2195
#endif
 
2196
 dict = PyObject_GetAttrString(inst, (char*)"__dict__");
 
2197
 PyDict_SetItem(dict, SWIG_This(), swig_this);
 
2198
 Py_DECREF(dict);
 
2199
 
2200
 
 
2201
 
 
2202
SWIGINTERN PyObject *
 
2203
SWIG_Python_InitShadowInstance(PyObject *args) {
 
2204
  PyObject *obj[2];
 
2205
  if (!SWIG_Python_UnpackTuple(args,(char*)"swiginit", 2, 2, obj)) {
 
2206
    return NULL;
 
2207
  } else {
 
2208
    PySwigObject *sthis = SWIG_Python_GetSwigThis(obj[0]);
 
2209
    if (sthis) {
 
2210
      PySwigObject_append((PyObject*) sthis, obj[1]);
 
2211
    } else {
 
2212
      SWIG_Python_SetSwigThis(obj[0], obj[1]);
 
2213
    }
 
2214
    return SWIG_Py_Void();
 
2215
  }
 
2216
}
 
2217
 
 
2218
/* Create a new pointer object */
 
2219
 
 
2220
SWIGRUNTIME PyObject *
 
2221
SWIG_Python_NewPointerObj(void *ptr, swig_type_info *type, int flags) {
 
2222
  if (!ptr) {
 
2223
    return SWIG_Py_Void();
 
2224
  } else {
 
2225
    int own = (flags & SWIG_POINTER_OWN) ? SWIG_POINTER_OWN : 0;
 
2226
    PyObject *robj = PySwigObject_New(ptr, type, own);
 
2227
    PySwigClientData *clientdata = type ? (PySwigClientData *)(type->clientdata) : 0;
 
2228
    if (clientdata && !(flags & SWIG_POINTER_NOSHADOW)) {
 
2229
      PyObject *inst = SWIG_Python_NewShadowInstance(clientdata, robj);
 
2230
      if (inst) {
 
2231
        Py_DECREF(robj);
 
2232
        robj = inst;
 
2233
      }
 
2234
    }
 
2235
    return robj;
 
2236
  }
 
2237
}
 
2238
 
 
2239
/* Create a new packed object */
 
2240
 
 
2241
SWIGRUNTIMEINLINE PyObject *
 
2242
SWIG_Python_NewPackedObj(void *ptr, size_t sz, swig_type_info *type) {
 
2243
  return ptr ? PySwigPacked_New((void *) ptr, sz, type) : SWIG_Py_Void();
 
2244
}
 
2245
 
 
2246
/* -----------------------------------------------------------------------------*
 
2247
 *  Get type list 
 
2248
 * -----------------------------------------------------------------------------*/
 
2249
 
 
2250
#ifdef SWIG_LINK_RUNTIME
 
2251
void *SWIG_ReturnGlobalTypeList(void *);
 
2252
#endif
 
2253
 
 
2254
SWIGRUNTIME swig_module_info *
 
2255
SWIG_Python_GetModule(void) {
 
2256
  static void *type_pointer = (void *)0;
 
2257
  /* first check if module already created */
 
2258
  if (!type_pointer) {
 
2259
#ifdef SWIG_LINK_RUNTIME
 
2260
    type_pointer = SWIG_ReturnGlobalTypeList((void *)0);
 
2261
#else
 
2262
    type_pointer = PyCObject_Import((char*)"swig_runtime_data" SWIG_RUNTIME_VERSION,
 
2263
                                    (char*)"type_pointer" SWIG_TYPE_TABLE_NAME);
 
2264
    if (PyErr_Occurred()) {
 
2265
      PyErr_Clear();
 
2266
      type_pointer = (void *)0;
 
2267
    }
 
2268
#endif
 
2269
  }
 
2270
  return (swig_module_info *) type_pointer;
 
2271
}
 
2272
 
 
2273
#if PY_MAJOR_VERSION < 2
 
2274
/* PyModule_AddObject function was introduced in Python 2.0.  The following function
 
2275
   is copied out of Python/modsupport.c in python version 2.3.4 */
 
2276
SWIGINTERN int
 
2277
PyModule_AddObject(PyObject *m, char *name, PyObject *o)
 
2278
{
 
2279
  PyObject *dict;
 
2280
  if (!PyModule_Check(m)) {
 
2281
    PyErr_SetString(PyExc_TypeError,
 
2282
                    "PyModule_AddObject() needs module as first arg");
 
2283
    return SWIG_ERROR;
 
2284
  }
 
2285
  if (!o) {
 
2286
    PyErr_SetString(PyExc_TypeError,
 
2287
                    "PyModule_AddObject() needs non-NULL value");
 
2288
    return SWIG_ERROR;
 
2289
  }
 
2290
  
 
2291
  dict = PyModule_GetDict(m);
 
2292
  if (dict == NULL) {
 
2293
    /* Internal error -- modules must have a dict! */
 
2294
    PyErr_Format(PyExc_SystemError, "module '%s' has no __dict__",
 
2295
                 PyModule_GetName(m));
 
2296
    return SWIG_ERROR;
 
2297
  }
 
2298
  if (PyDict_SetItemString(dict, name, o))
 
2299
    return SWIG_ERROR;
 
2300
  Py_DECREF(o);
 
2301
  return SWIG_OK;
 
2302
}
 
2303
#endif
 
2304
 
 
2305
SWIGRUNTIME void
 
2306
SWIG_Python_DestroyModule(void *vptr)
 
2307
{
 
2308
  swig_module_info *swig_module = (swig_module_info *) vptr;
 
2309
  swig_type_info **types = swig_module->types;
 
2310
  size_t i;
 
2311
  for (i =0; i < swig_module->size; ++i) {
 
2312
    swig_type_info *ty = types[i];
 
2313
    if (ty->owndata) {
 
2314
      PySwigClientData *data = (PySwigClientData *) ty->clientdata;
 
2315
      if (data) PySwigClientData_Del(data);
 
2316
    }
 
2317
  }
 
2318
  Py_DECREF(SWIG_This());
 
2319
}
 
2320
 
 
2321
SWIGRUNTIME void
 
2322
SWIG_Python_SetModule(swig_module_info *swig_module) {
 
2323
  static PyMethodDef swig_empty_runtime_method_table[] = { {NULL, NULL, 0, NULL} };/* Sentinel */
 
2324
 
 
2325
  PyObject *module = Py_InitModule((char*)"swig_runtime_data" SWIG_RUNTIME_VERSION,
 
2326
                                   swig_empty_runtime_method_table);
 
2327
  PyObject *pointer = PyCObject_FromVoidPtr((void *) swig_module, SWIG_Python_DestroyModule);
 
2328
  if (pointer && module) {
 
2329
    PyModule_AddObject(module, (char*)"type_pointer" SWIG_TYPE_TABLE_NAME, pointer);
 
2330
  } else {
 
2331
    Py_XDECREF(pointer);
 
2332
  }
 
2333
}
 
2334
 
 
2335
/* The python cached type query */
 
2336
SWIGRUNTIME PyObject *
 
2337
SWIG_Python_TypeCache(void) {
 
2338
  static PyObject *SWIG_STATIC_POINTER(cache) = PyDict_New();
 
2339
  return cache;
 
2340
}
 
2341
 
 
2342
SWIGRUNTIME swig_type_info *
 
2343
SWIG_Python_TypeQuery(const char *type)
 
2344
{
 
2345
  PyObject *cache = SWIG_Python_TypeCache();
 
2346
  PyObject *key = PyString_FromString(type); 
 
2347
  PyObject *obj = PyDict_GetItem(cache, key);
 
2348
  swig_type_info *descriptor;
 
2349
  if (obj) {
 
2350
    descriptor = (swig_type_info *) PyCObject_AsVoidPtr(obj);
 
2351
  } else {
 
2352
    swig_module_info *swig_module = SWIG_Python_GetModule();
 
2353
    descriptor = SWIG_TypeQueryModule(swig_module, swig_module, type);
 
2354
    if (descriptor) {
 
2355
      obj = PyCObject_FromVoidPtr(descriptor, NULL);
 
2356
      PyDict_SetItem(cache, key, obj);
 
2357
      Py_DECREF(obj);
 
2358
    }
 
2359
  }
 
2360
  Py_DECREF(key);
 
2361
  return descriptor;
 
2362
}
 
2363
 
 
2364
/* 
 
2365
   For backward compatibility only
 
2366
*/
 
2367
#define SWIG_POINTER_EXCEPTION  0
 
2368
#define SWIG_arg_fail(arg)      SWIG_Python_ArgFail(arg)
 
2369
#define SWIG_MustGetPtr(p, type, argnum, flags)  SWIG_Python_MustGetPtr(p, type, argnum, flags)
 
2370
 
 
2371
SWIGRUNTIME int
 
2372
SWIG_Python_AddErrMesg(const char* mesg, int infront)
 
2373
{
 
2374
  if (PyErr_Occurred()) {
 
2375
    PyObject *type = 0;
 
2376
    PyObject *value = 0;
 
2377
    PyObject *traceback = 0;
 
2378
    PyErr_Fetch(&type, &value, &traceback);
 
2379
    if (value) {
 
2380
      PyObject *old_str = PyObject_Str(value);
 
2381
      Py_XINCREF(type);
 
2382
      PyErr_Clear();
 
2383
      if (infront) {
 
2384
        PyErr_Format(type, "%s %s", mesg, PyString_AsString(old_str));
 
2385
      } else {
 
2386
        PyErr_Format(type, "%s %s", PyString_AsString(old_str), mesg);
 
2387
      }
 
2388
      Py_DECREF(old_str);
 
2389
    }
 
2390
    return 1;
 
2391
  } else {
 
2392
    return 0;
 
2393
  }
 
2394
}
 
2395
  
 
2396
SWIGRUNTIME int
 
2397
SWIG_Python_ArgFail(int argnum)
 
2398
{
 
2399
  if (PyErr_Occurred()) {
 
2400
    /* add information about failing argument */
 
2401
    char mesg[256];
 
2402
    PyOS_snprintf(mesg, sizeof(mesg), "argument number %d:", argnum);
 
2403
    return SWIG_Python_AddErrMesg(mesg, 1);
 
2404
  } else {
 
2405
    return 0;
 
2406
  }
 
2407
}
 
2408
 
 
2409
SWIGRUNTIMEINLINE const char *
 
2410
PySwigObject_GetDesc(PyObject *self)
 
2411
{
 
2412
  PySwigObject *v = (PySwigObject *)self;
 
2413
  swig_type_info *ty = v ? v->ty : 0;
 
2414
  return ty ? ty->str : (char*)"";
 
2415
}
 
2416
 
 
2417
SWIGRUNTIME void
 
2418
SWIG_Python_TypeError(const char *type, PyObject *obj)
 
2419
{
 
2420
  if (type) {
 
2421
#if defined(SWIG_COBJECT_TYPES)
 
2422
    if (obj && PySwigObject_Check(obj)) {
 
2423
      const char *otype = (const char *) PySwigObject_GetDesc(obj);
 
2424
      if (otype) {
 
2425
        PyErr_Format(PyExc_TypeError, "a '%s' is expected, 'PySwigObject(%s)' is received",
 
2426
                     type, otype);
 
2427
        return;
 
2428
      }
 
2429
    } else 
 
2430
#endif      
 
2431
    {
 
2432
      const char *otype = (obj ? obj->ob_type->tp_name : 0); 
 
2433
      if (otype) {
 
2434
        PyObject *str = PyObject_Str(obj);
 
2435
        const char *cstr = str ? PyString_AsString(str) : 0;
 
2436
        if (cstr) {
 
2437
          PyErr_Format(PyExc_TypeError, "a '%s' is expected, '%s(%s)' is received",
 
2438
                       type, otype, cstr);
 
2439
        } else {
 
2440
          PyErr_Format(PyExc_TypeError, "a '%s' is expected, '%s' is received",
 
2441
                       type, otype);
 
2442
        }
 
2443
        Py_XDECREF(str);
 
2444
        return;
 
2445
      }
 
2446
    }   
 
2447
    PyErr_Format(PyExc_TypeError, "a '%s' is expected", type);
 
2448
  } else {
 
2449
    PyErr_Format(PyExc_TypeError, "unexpected type is received");
 
2450
  }
 
2451
}
 
2452
 
 
2453
 
 
2454
/* Convert a pointer value, signal an exception on a type mismatch */
 
2455
SWIGRUNTIME void *
 
2456
SWIG_Python_MustGetPtr(PyObject *obj, swig_type_info *ty, int argnum, int flags) {
 
2457
  void *result;
 
2458
  if (SWIG_Python_ConvertPtr(obj, &result, ty, flags) == -1) {
 
2459
    PyErr_Clear();
 
2460
    if (flags & SWIG_POINTER_EXCEPTION) {
 
2461
      SWIG_Python_TypeError(SWIG_TypePrettyName(ty), obj);
 
2462
      SWIG_Python_ArgFail(argnum);
 
2463
    }
 
2464
  }
 
2465
  return result;
 
2466
}
 
2467
 
 
2468
 
 
2469
#ifdef __cplusplus
 
2470
#if 0
 
2471
{ /* cc-mode */
 
2472
#endif
 
2473
}
 
2474
#endif
 
2475
/* -----------------------------------------------------------------------------*
 
2476
   Standard SWIG API for use inside user code.
 
2477
 
 
2478
   Don't include this file directly, run the command
 
2479
   swig -python -external-runtime
 
2480
   Also, read the Modules chapter of the SWIG Manual.
 
2481
 
 
2482
 * -----------------------------------------------------------------------------*/
 
2483
 
 
2484
#ifdef SWIG_MODULE_CLIENTDATA_TYPE
 
2485
 
 
2486
SWIGRUNTIMEINLINE swig_type_info *
 
2487
SWIG_TypeQuery(SWIG_MODULE_CLIENTDATA_TYPE clientdata, const char *name) {
 
2488
  swig_module_info *module = SWIG_GetModule(clientdata);
 
2489
  return SWIG_TypeQueryModule(module, module, name);
 
2490
}
 
2491
 
 
2492
SWIGRUNTIMEINLINE swig_type_info *
 
2493
SWIG_MangledTypeQuery(SWIG_MODULE_CLIENTDATA_TYPE clientdata, const char *name) {
 
2494
  swig_module_info *module = SWIG_GetModule(clientdata);
 
2495
  return SWIG_MangledTypeQueryModule(module, module, name);
 
2496
}
 
2497
 
 
2498
#else
 
2499
 
 
2500
SWIGRUNTIMEINLINE swig_type_info *
 
2501
SWIG_TypeQuery(const char *name) {
 
2502
  swig_module_info *module = SWIG_GetModule(NULL);
 
2503
  return SWIG_TypeQueryModule(module, module, name);
 
2504
}
 
2505
 
 
2506
SWIGRUNTIMEINLINE swig_type_info *
 
2507
SWIG_MangledTypeQuery(const char *name) {
 
2508
  swig_module_info *module = SWIG_GetModule(NULL);
 
2509
  return SWIG_MangledTypeQueryModule(module, module, name);
 
2510
}
 
2511
 
 
2512
#endif