LCOV - code coverage report
Current view: top level - build-coverage/swig/python/extensions - gnm_wrap.cpp (source / functions) Hit Total Coverage
Test: gdal_filtered.info Lines: 585 2328 25.1 %
Date: 2024-11-21 22:18:42 Functions: 40 109 36.7 %

          Line data    Source code
       1             : /* ----------------------------------------------------------------------------
       2             :  * This file was automatically generated by SWIG (http://www.swig.org).
       3             :  * Version 4.0.1
       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             : #ifndef SWIGPYTHON
      13             : #define SWIGPYTHON
      14             : #define SED_HACKS
      15             : #endif
      16             : 
      17             : #define SWIG_PYTHON_THREADS
      18             : #define SWIG_PYTHON_DIRECTOR_NO_VTABLE
      19             : 
      20             : 
      21             : #ifdef __cplusplus
      22             : /* SwigValueWrapper is described in swig.swg */
      23             : template<typename T> class SwigValueWrapper {
      24             :   struct SwigMovePointer {
      25             :     T *ptr;
      26             :     SwigMovePointer(T *p) : ptr(p) { }
      27             :     ~SwigMovePointer() { delete ptr; }
      28             :     SwigMovePointer& operator=(SwigMovePointer& rhs) { T* oldptr = ptr; ptr = 0; delete oldptr; ptr = rhs.ptr; rhs.ptr = 0; return *this; }
      29             :   } pointer;
      30             :   SwigValueWrapper& operator=(const SwigValueWrapper<T>& rhs);
      31             :   SwigValueWrapper(const SwigValueWrapper<T>& rhs);
      32             : public:
      33             :   SwigValueWrapper() : pointer(0) { }
      34             :   SwigValueWrapper& operator=(const T& t) { SwigMovePointer tmp(new T(t)); pointer = tmp; return *this; }
      35             :   operator T&() const { return *pointer.ptr; }
      36             :   T *operator&() { return pointer.ptr; }
      37             : };
      38             : 
      39             : template <typename T> T SwigValueInit() {
      40             :   return T();
      41             : }
      42             : #endif
      43             : 
      44             : /* -----------------------------------------------------------------------------
      45             :  *  This section contains generic SWIG labels for method/variable
      46             :  *  declarations/attributes, and other compiler dependent labels.
      47             :  * ----------------------------------------------------------------------------- */
      48             : 
      49             : /* template workaround for compilers that cannot correctly implement the C++ standard */
      50             : #ifndef SWIGTEMPLATEDISAMBIGUATOR
      51             : # if defined(__SUNPRO_CC) && (__SUNPRO_CC <= 0x560)
      52             : #  define SWIGTEMPLATEDISAMBIGUATOR template
      53             : # elif defined(__HP_aCC)
      54             : /* Needed even with `aCC -AA' when `aCC -V' reports HP ANSI C++ B3910B A.03.55 */
      55             : /* If we find a maximum version that requires this, the test would be __HP_aCC <= 35500 for A.03.55 */
      56             : #  define SWIGTEMPLATEDISAMBIGUATOR template
      57             : # else
      58             : #  define SWIGTEMPLATEDISAMBIGUATOR
      59             : # endif
      60             : #endif
      61             : 
      62             : /* inline attribute */
      63             : #ifndef SWIGINLINE
      64             : # if defined(__cplusplus) || (defined(__GNUC__) && !defined(__STRICT_ANSI__))
      65             : #   define SWIGINLINE inline
      66             : # else
      67             : #   define SWIGINLINE
      68             : # endif
      69             : #endif
      70             : 
      71             : /* attribute recognised by some compilers to avoid 'unused' warnings */
      72             : #ifndef SWIGUNUSED
      73             : # if defined(__GNUC__)
      74             : #   if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
      75             : #     define SWIGUNUSED __attribute__ ((__unused__))
      76             : #   else
      77             : #     define SWIGUNUSED
      78             : #   endif
      79             : # elif defined(__ICC)
      80             : #   define SWIGUNUSED __attribute__ ((__unused__))
      81             : # else
      82             : #   define SWIGUNUSED
      83             : # endif
      84             : #endif
      85             : 
      86             : #ifndef SWIG_MSC_UNSUPPRESS_4505
      87             : # if defined(_MSC_VER)
      88             : #   pragma warning(disable : 4505) /* unreferenced local function has been removed */
      89             : # endif
      90             : #endif
      91             : 
      92             : #ifndef SWIGUNUSEDPARM
      93             : # ifdef __cplusplus
      94             : #   define SWIGUNUSEDPARM(p)
      95             : # else
      96             : #   define SWIGUNUSEDPARM(p) p SWIGUNUSED
      97             : # endif
      98             : #endif
      99             : 
     100             : /* internal SWIG method */
     101             : #ifndef SWIGINTERN
     102             : # define SWIGINTERN static SWIGUNUSED
     103             : #endif
     104             : 
     105             : /* internal inline SWIG method */
     106             : #ifndef SWIGINTERNINLINE
     107             : # define SWIGINTERNINLINE SWIGINTERN SWIGINLINE
     108             : #endif
     109             : 
     110             : /* exporting methods */
     111             : #if defined(__GNUC__)
     112             : #  if (__GNUC__ >= 4) || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)
     113             : #    ifndef GCC_HASCLASSVISIBILITY
     114             : #      define GCC_HASCLASSVISIBILITY
     115             : #    endif
     116             : #  endif
     117             : #endif
     118             : 
     119             : #ifndef SWIGEXPORT
     120             : # if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__)
     121             : #   if defined(STATIC_LINKED)
     122             : #     define SWIGEXPORT
     123             : #   else
     124             : #     define SWIGEXPORT __declspec(dllexport)
     125             : #   endif
     126             : # else
     127             : #   if defined(__GNUC__) && defined(GCC_HASCLASSVISIBILITY)
     128             : #     define SWIGEXPORT __attribute__ ((visibility("default")))
     129             : #   else
     130             : #     define SWIGEXPORT
     131             : #   endif
     132             : # endif
     133             : #endif
     134             : 
     135             : /* calling conventions for Windows */
     136             : #ifndef SWIGSTDCALL
     137             : # if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__)
     138             : #   define SWIGSTDCALL __stdcall
     139             : # else
     140             : #   define SWIGSTDCALL
     141             : # endif
     142             : #endif
     143             : 
     144             : /* Deal with Microsoft's attempt at deprecating C standard runtime functions */
     145             : #if !defined(SWIG_NO_CRT_SECURE_NO_DEPRECATE) && defined(_MSC_VER) && !defined(_CRT_SECURE_NO_DEPRECATE)
     146             : # define _CRT_SECURE_NO_DEPRECATE
     147             : #endif
     148             : 
     149             : /* Deal with Microsoft's attempt at deprecating methods in the standard C++ library */
     150             : #if !defined(SWIG_NO_SCL_SECURE_NO_DEPRECATE) && defined(_MSC_VER) && !defined(_SCL_SECURE_NO_DEPRECATE)
     151             : # define _SCL_SECURE_NO_DEPRECATE
     152             : #endif
     153             : 
     154             : /* Deal with Apple's deprecated 'AssertMacros.h' from Carbon-framework */
     155             : #if defined(__APPLE__) && !defined(__ASSERT_MACROS_DEFINE_VERSIONS_WITHOUT_UNDERSCORES)
     156             : # define __ASSERT_MACROS_DEFINE_VERSIONS_WITHOUT_UNDERSCORES 0
     157             : #endif
     158             : 
     159             : /* Intel's compiler complains if a variable which was never initialised is
     160             :  * cast to void, which is a common idiom which we use to indicate that we
     161             :  * are aware a variable isn't used.  So we just silence that warning.
     162             :  * See: https://github.com/swig/swig/issues/192 for more discussion.
     163             :  */
     164             : #ifdef __INTEL_COMPILER
     165             : # pragma warning disable 592
     166             : #endif
     167             : 
     168             : 
     169             : #if defined(__GNUC__) && defined(_WIN32) && !defined(SWIG_PYTHON_NO_HYPOT_WORKAROUND)
     170             : /* Workaround for '::hypot' has not been declared', see https://bugs.python.org/issue11566 */
     171             : # include <math.h>
     172             : #endif
     173             : 
     174             : #if defined(_DEBUG) && defined(SWIG_PYTHON_INTERPRETER_NO_DEBUG)
     175             : /* Use debug wrappers with the Python release dll */
     176             : # undef _DEBUG
     177             : # include <Python.h>
     178             : # define _DEBUG 1
     179             : #else
     180             : # include <Python.h>
     181             : #endif
     182             : 
     183             : /* -----------------------------------------------------------------------------
     184             :  * swigrun.swg
     185             :  *
     186             :  * This file contains generic C API SWIG runtime support for pointer
     187             :  * type checking.
     188             :  * ----------------------------------------------------------------------------- */
     189             : 
     190             : /* This should only be incremented when either the layout of swig_type_info changes,
     191             :    or for whatever reason, the runtime changes incompatibly */
     192             : #define SWIG_RUNTIME_VERSION "4"
     193             : 
     194             : /* define SWIG_TYPE_TABLE_NAME as "SWIG_TYPE_TABLE" */
     195             : #ifdef SWIG_TYPE_TABLE
     196             : # define SWIG_QUOTE_STRING(x) #x
     197             : # define SWIG_EXPAND_AND_QUOTE_STRING(x) SWIG_QUOTE_STRING(x)
     198             : # define SWIG_TYPE_TABLE_NAME SWIG_EXPAND_AND_QUOTE_STRING(SWIG_TYPE_TABLE)
     199             : #else
     200             : # define SWIG_TYPE_TABLE_NAME
     201             : #endif
     202             : 
     203             : /*
     204             :   You can use the SWIGRUNTIME and SWIGRUNTIMEINLINE macros for
     205             :   creating a static or dynamic library from the SWIG runtime code.
     206             :   In 99.9% of the cases, SWIG just needs to declare them as 'static'.
     207             : 
     208             :   But only do this if strictly necessary, ie, if you have problems
     209             :   with your compiler or suchlike.
     210             : */
     211             : 
     212             : #ifndef SWIGRUNTIME
     213             : # define SWIGRUNTIME SWIGINTERN
     214             : #endif
     215             : 
     216             : #ifndef SWIGRUNTIMEINLINE
     217             : # define SWIGRUNTIMEINLINE SWIGRUNTIME SWIGINLINE
     218             : #endif
     219             : 
     220             : /*  Generic buffer size */
     221             : #ifndef SWIG_BUFFER_SIZE
     222             : # define SWIG_BUFFER_SIZE 1024
     223             : #endif
     224             : 
     225             : /* Flags for pointer conversions */
     226             : #define SWIG_POINTER_DISOWN        0x1
     227             : #define SWIG_CAST_NEW_MEMORY       0x2
     228             : #define SWIG_POINTER_NO_NULL       0x4
     229             : 
     230             : /* Flags for new pointer objects */
     231             : #define SWIG_POINTER_OWN           0x1
     232             : 
     233             : 
     234             : /*
     235             :    Flags/methods for returning states.
     236             : 
     237             :    The SWIG conversion methods, as ConvertPtr, return an integer
     238             :    that tells if the conversion was successful or not. And if not,
     239             :    an error code can be returned (see swigerrors.swg for the codes).
     240             : 
     241             :    Use the following macros/flags to set or process the returning
     242             :    states.
     243             : 
     244             :    In old versions of SWIG, code such as the following was usually written:
     245             : 
     246             :      if (SWIG_ConvertPtr(obj,vptr,ty.flags) != -1) {
     247             :        // success code
     248             :      } else {
     249             :        //fail code
     250             :      }
     251             : 
     252             :    Now you can be more explicit:
     253             : 
     254             :     int res = SWIG_ConvertPtr(obj,vptr,ty.flags);
     255             :     if (SWIG_IsOK(res)) {
     256             :       // success code
     257             :     } else {
     258             :       // fail code
     259             :     }
     260             : 
     261             :    which is the same really, but now you can also do
     262             : 
     263             :     Type *ptr;
     264             :     int res = SWIG_ConvertPtr(obj,(void **)(&ptr),ty.flags);
     265             :     if (SWIG_IsOK(res)) {
     266             :       // success code
     267             :       if (SWIG_IsNewObj(res) {
     268             :         ...
     269             :   delete *ptr;
     270             :       } else {
     271             :         ...
     272             :       }
     273             :     } else {
     274             :       // fail code
     275             :     }
     276             : 
     277             :    I.e., now SWIG_ConvertPtr can return new objects and you can
     278             :    identify the case and take care of the deallocation. Of course that
     279             :    also requires SWIG_ConvertPtr to return new result values, such as
     280             : 
     281             :       int SWIG_ConvertPtr(obj, ptr,...) {
     282             :         if (<obj is ok>) {
     283             :           if (<need new object>) {
     284             :             *ptr = <ptr to new allocated object>;
     285             :             return SWIG_NEWOBJ;
     286             :           } else {
     287             :             *ptr = <ptr to old object>;
     288             :             return SWIG_OLDOBJ;
     289             :           }
     290             :         } else {
     291             :           return SWIG_BADOBJ;
     292             :         }
     293             :       }
     294             : 
     295             :    Of course, returning the plain '0(success)/-1(fail)' still works, but you can be
     296             :    more explicit by returning SWIG_BADOBJ, SWIG_ERROR or any of the
     297             :    SWIG errors code.
     298             : 
     299             :    Finally, if the SWIG_CASTRANK_MODE is enabled, the result code
     300             :    allows to return the 'cast rank', for example, if you have this
     301             : 
     302             :        int food(double)
     303             :        int fooi(int);
     304             : 
     305             :    and you call
     306             : 
     307             :       food(1)   // cast rank '1'  (1 -> 1.0)
     308             :       fooi(1)   // cast rank '0'
     309             : 
     310             :    just use the SWIG_AddCast()/SWIG_CheckState()
     311             : */
     312             : 
     313             : #define SWIG_OK                    (0)
     314             : #define SWIG_ERROR                 (-1)
     315             : #define SWIG_IsOK(r)               (r >= 0)
     316             : #define SWIG_ArgError(r)           ((r != SWIG_ERROR) ? r : SWIG_TypeError)
     317             : 
     318             : /* The CastRankLimit says how many bits are used for the cast rank */
     319             : #define SWIG_CASTRANKLIMIT         (1 << 8)
     320             : /* The NewMask denotes the object was created (using new/malloc) */
     321             : #define SWIG_NEWOBJMASK            (SWIG_CASTRANKLIMIT  << 1)
     322             : /* The TmpMask is for in/out typemaps that use temporal objects */
     323             : #define SWIG_TMPOBJMASK            (SWIG_NEWOBJMASK << 1)
     324             : /* Simple returning values */
     325             : #define SWIG_BADOBJ                (SWIG_ERROR)
     326             : #define SWIG_OLDOBJ                (SWIG_OK)
     327             : #define SWIG_NEWOBJ                (SWIG_OK | SWIG_NEWOBJMASK)
     328             : #define SWIG_TMPOBJ                (SWIG_OK | SWIG_TMPOBJMASK)
     329             : /* Check, add and del mask methods */
     330             : #define SWIG_AddNewMask(r)         (SWIG_IsOK(r) ? (r | SWIG_NEWOBJMASK) : r)
     331             : #define SWIG_DelNewMask(r)         (SWIG_IsOK(r) ? (r & ~SWIG_NEWOBJMASK) : r)
     332             : #define SWIG_IsNewObj(r)           (SWIG_IsOK(r) && (r & SWIG_NEWOBJMASK))
     333             : #define SWIG_AddTmpMask(r)         (SWIG_IsOK(r) ? (r | SWIG_TMPOBJMASK) : r)
     334             : #define SWIG_DelTmpMask(r)         (SWIG_IsOK(r) ? (r & ~SWIG_TMPOBJMASK) : r)
     335             : #define SWIG_IsTmpObj(r)           (SWIG_IsOK(r) && (r & SWIG_TMPOBJMASK))
     336             : 
     337             : /* Cast-Rank Mode */
     338             : #if defined(SWIG_CASTRANK_MODE)
     339             : #  ifndef SWIG_TypeRank
     340             : #    define SWIG_TypeRank             unsigned long
     341             : #  endif
     342             : #  ifndef SWIG_MAXCASTRANK            /* Default cast allowed */
     343             : #    define SWIG_MAXCASTRANK          (2)
     344             : #  endif
     345             : #  define SWIG_CASTRANKMASK          ((SWIG_CASTRANKLIMIT) -1)
     346             : #  define SWIG_CastRank(r)           (r & SWIG_CASTRANKMASK)
     347             : SWIGINTERNINLINE int SWIG_AddCast(int r) {
     348             :   return SWIG_IsOK(r) ? ((SWIG_CastRank(r) < SWIG_MAXCASTRANK) ? (r + 1) : SWIG_ERROR) : r;
     349             : }
     350             : SWIGINTERNINLINE int SWIG_CheckState(int r) {
     351             :   return SWIG_IsOK(r) ? SWIG_CastRank(r) + 1 : 0;
     352             : }
     353             : #else /* no cast-rank mode */
     354             : #  define SWIG_AddCast(r) (r)
     355             : #  define SWIG_CheckState(r) (SWIG_IsOK(r) ? 1 : 0)
     356             : #endif
     357             : 
     358             : 
     359             : #include <string.h>
     360             : 
     361             : #ifdef __cplusplus
     362             : extern "C" {
     363             : #endif
     364             : 
     365             : typedef void *(*swig_converter_func)(void *, int *);
     366             : typedef struct swig_type_info *(*swig_dycast_func)(void **);
     367             : 
     368             : /* Structure to store information on one type */
     369             : typedef struct swig_type_info {
     370             :   const char             *name;     /* mangled name of this type */
     371             :   const char             *str;      /* human readable name of this type */
     372             :   swig_dycast_func        dcast;    /* dynamic cast function down a hierarchy */
     373             :   struct swig_cast_info  *cast;     /* linked list of types that can cast into this type */
     374             :   void                   *clientdata;   /* language specific type data */
     375             :   int                    owndata;   /* flag if the structure owns the clientdata */
     376             : } swig_type_info;
     377             : 
     378             : /* Structure to store a type and conversion function used for casting */
     379             : typedef struct swig_cast_info {
     380             :   swig_type_info         *type;     /* pointer to type that is equivalent to this type */
     381             :   swig_converter_func     converter;    /* function to cast the void pointers */
     382             :   struct swig_cast_info  *next;     /* pointer to next cast in linked list */
     383             :   struct swig_cast_info  *prev;     /* pointer to the previous cast */
     384             : } swig_cast_info;
     385             : 
     386             : /* Structure used to store module information
     387             :  * Each module generates one structure like this, and the runtime collects
     388             :  * all of these structures and stores them in a circularly linked list.*/
     389             : typedef struct swig_module_info {
     390             :   swig_type_info         **types;   /* Array of pointers to swig_type_info structures that are in this module */
     391             :   size_t                 size;            /* Number of types in this module */
     392             :   struct swig_module_info *next;    /* Pointer to next element in circularly linked list */
     393             :   swig_type_info         **type_initial;  /* Array of initially generated type structures */
     394             :   swig_cast_info         **cast_initial;  /* Array of initially generated casting structures */
     395             :   void                    *clientdata;    /* Language specific module data */
     396             : } swig_module_info;
     397             : 
     398             : /*
     399             :   Compare two type names skipping the space characters, therefore
     400             :   "char*" == "char *" and "Class<int>" == "Class<int >", etc.
     401             : 
     402             :   Return 0 when the two name types are equivalent, as in
     403             :   strncmp, but skipping ' '.
     404             : */
     405             : SWIGRUNTIME int
     406           0 : SWIG_TypeNameComp(const char *f1, const char *l1,
     407             :       const char *f2, const char *l2) {
     408           0 :   for (;(f1 != l1) && (f2 != l2); ++f1, ++f2) {
     409           0 :     while ((*f1 == ' ') && (f1 != l1)) ++f1;
     410           0 :     while ((*f2 == ' ') && (f2 != l2)) ++f2;
     411           0 :     if (*f1 != *f2) return (*f1 > *f2) ? 1 : -1;
     412             :   }
     413           0 :   return (int)((l1 - f1) - (l2 - f2));
     414             : }
     415             : 
     416             : /*
     417             :   Check type equivalence in a name list like <name1>|<name2>|...
     418             :   Return 0 if equal, -1 if nb < tb, 1 if nb > tb
     419             : */
     420             : SWIGRUNTIME int
     421           0 : SWIG_TypeCmp(const char *nb, const char *tb) {
     422           0 :   int equiv = 1;
     423           0 :   const char* te = tb + strlen(tb);
     424           0 :   const char* ne = nb;
     425           0 :   while (equiv != 0 && *ne) {
     426           0 :     for (nb = ne; *ne; ++ne) {
     427           0 :       if (*ne == '|') break;
     428             :     }
     429           0 :     equiv = SWIG_TypeNameComp(nb, ne, tb, te);
     430           0 :     if (*ne) ++ne;
     431             :   }
     432           0 :   return equiv;
     433             : }
     434             : 
     435             : /*
     436             :   Check type equivalence in a name list like <name1>|<name2>|...
     437             :   Return 0 if not equal, 1 if equal
     438             : */
     439             : SWIGRUNTIME int
     440           0 : SWIG_TypeEquiv(const char *nb, const char *tb) {
     441           0 :   return SWIG_TypeCmp(nb, tb) == 0 ? 1 : 0;
     442             : }
     443             : 
     444             : /*
     445             :   Check the typename
     446             : */
     447             : SWIGRUNTIME swig_cast_info *
     448         286 : SWIG_TypeCheck(const char *c, swig_type_info *ty) {
     449         286 :   if (ty) {
     450         286 :     swig_cast_info *iter = ty->cast;
     451         349 :     while (iter) {
     452         349 :       if (strcmp(iter->type->name, c) == 0) {
     453         286 :         if (iter == ty->cast)
     454             :           return iter;
     455             :         /* Move iter to the top of the linked list */
     456          59 :         iter->prev->next = iter->next;
     457          59 :         if (iter->next)
     458          59 :           iter->next->prev = iter->prev;
     459          59 :         iter->next = ty->cast;
     460          59 :         iter->prev = 0;
     461          59 :         if (ty->cast) ty->cast->prev = iter;
     462          59 :         ty->cast = iter;
     463          59 :         return iter;
     464             :       }
     465          63 :       iter = iter->next;
     466             :     }
     467             :   }
     468             :   return 0;
     469             : }
     470             : 
     471             : /*
     472             :   Identical to SWIG_TypeCheck, except strcmp is replaced with a pointer comparison
     473             : */
     474             : SWIGRUNTIME swig_cast_info *
     475             : SWIG_TypeCheckStruct(swig_type_info *from, swig_type_info *ty) {
     476             :   if (ty) {
     477             :     swig_cast_info *iter = ty->cast;
     478             :     while (iter) {
     479             :       if (iter->type == from) {
     480             :         if (iter == ty->cast)
     481             :           return iter;
     482             :         /* Move iter to the top of the linked list */
     483             :         iter->prev->next = iter->next;
     484             :         if (iter->next)
     485             :           iter->next->prev = iter->prev;
     486             :         iter->next = ty->cast;
     487             :         iter->prev = 0;
     488             :         if (ty->cast) ty->cast->prev = iter;
     489             :         ty->cast = iter;
     490             :         return iter;
     491             :       }
     492             :       iter = iter->next;
     493             :     }
     494             :   }
     495             :   return 0;
     496             : }
     497             : 
     498             : /*
     499             :   Cast a pointer up an inheritance hierarchy
     500             : */
     501             : SWIGRUNTIMEINLINE void *
     502           6 : SWIG_TypeCast(swig_cast_info *ty, void *ptr, int *newmemory) {
     503           6 :   return ((!ty) || (!ty->converter)) ? ptr : (*ty->converter)(ptr, newmemory);
     504             : }
     505             : 
     506             : /*
     507             :    Dynamic pointer casting. Down an inheritance hierarchy
     508             : */
     509             : SWIGRUNTIME swig_type_info *
     510             : SWIG_TypeDynamicCast(swig_type_info *ty, void **ptr) {
     511             :   swig_type_info *lastty = ty;
     512             :   if (!ty || !ty->dcast) return ty;
     513             :   while (ty && (ty->dcast)) {
     514             :     ty = (*ty->dcast)(ptr);
     515             :     if (ty) lastty = ty;
     516             :   }
     517             :   return lastty;
     518             : }
     519             : 
     520             : /*
     521             :   Return the name associated with this type
     522             : */
     523             : SWIGRUNTIMEINLINE const char *
     524             : SWIG_TypeName(const swig_type_info *ty) {
     525             :   return ty->name;
     526             : }
     527             : 
     528             : /*
     529             :   Return the pretty name associated with this type,
     530             :   that is an unmangled type name in a form presentable to the user.
     531             : */
     532             : SWIGRUNTIME const char *
     533           0 : SWIG_TypePrettyName(const swig_type_info *type) {
     534             :   /* The "str" field contains the equivalent pretty names of the
     535             :      type, separated by vertical-bar characters.  We choose
     536             :      to print the last name, as it is often (?) the most
     537             :      specific. */
     538           0 :   if (!type) return NULL;
     539           0 :   if (type->str != NULL) {
     540             :     const char *last_name = type->str;
     541             :     const char *s;
     542           0 :     for (s = type->str; *s; s++)
     543           0 :       if (*s == '|') last_name = s+1;
     544             :     return last_name;
     545             :   }
     546             :   else
     547           0 :     return type->name;
     548             : }
     549             : 
     550             : /*
     551             :    Set the clientdata field for a type
     552             : */
     553             : SWIGRUNTIME void
     554             : SWIG_TypeClientData(swig_type_info *ti, void *clientdata) {
     555             :   swig_cast_info *cast = ti->cast;
     556             :   /* if (ti->clientdata == clientdata) return; */
     557             :   ti->clientdata = clientdata;
     558             : 
     559             :   while (cast) {
     560             :     if (!cast->converter) {
     561             :       swig_type_info *tc = cast->type;
     562             :       if (!tc->clientdata) {
     563             :   SWIG_TypeClientData(tc, clientdata);
     564             :       }
     565             :     }
     566             :     cast = cast->next;
     567             :   }
     568             : }
     569             : SWIGRUNTIME void
     570          56 : SWIG_TypeNewClientData(swig_type_info *ti, void *clientdata) {
     571          56 :   SWIG_TypeClientData(ti, clientdata);
     572          56 :   ti->owndata = 1;
     573             : }
     574             : 
     575             : /*
     576             :   Search for a swig_type_info structure only by mangled name
     577             :   Search is a O(log #types)
     578             : 
     579             :   We start searching at module start, and finish searching when start == end.
     580             :   Note: if start == end at the beginning of the function, we go all the way around
     581             :   the circular list.
     582             : */
     583             : SWIGRUNTIME swig_type_info *
     584         784 : SWIG_MangledTypeQueryModule(swig_module_info *start,
     585             :                             swig_module_info *end,
     586             :                 const char *name) {
     587         784 :   swig_module_info *iter = start;
     588        2352 :   do {
     589        2352 :     if (iter->size) {
     590        2352 :       size_t l = 0;
     591        2352 :       size_t r = iter->size - 1;
     592        8988 :       do {
     593             :   /* since l+r >= 0, we can (>> 1) instead (/ 2) */
     594        8988 :   size_t i = (l + r) >> 1;
     595        8988 :   const char *iname = iter->types[i]->name;
     596        8988 :   if (iname) {
     597        8988 :     int compare = strcmp(name, iname);
     598        8988 :     if (compare == 0) {
     599         532 :       return iter->types[i];
     600        8456 :     } else if (compare < 0) {
     601        5180 :       if (i) {
     602        4564 :         r = i - 1;
     603             :       } else {
     604             :         break;
     605             :       }
     606        3276 :     } else if (compare > 0) {
     607        3276 :       l = i + 1;
     608             :     }
     609             :   } else {
     610             :     break; /* should never happen */
     611             :   }
     612        7840 :       } while (l <= r);
     613             :     }
     614        1820 :     iter = iter->next;
     615        1820 :   } while (iter != end);
     616             :   return 0;
     617             : }
     618             : 
     619             : /*
     620             :   Search for a swig_type_info structure for either a mangled name or a human readable name.
     621             :   It first searches the mangled names of the types, which is a O(log #types)
     622             :   If a type is not found it then searches the human readable names, which is O(#types).
     623             : 
     624             :   We start searching at module start, and finish searching when start == end.
     625             :   Note: if start == end at the beginning of the function, we go all the way around
     626             :   the circular list.
     627             : */
     628             : SWIGRUNTIME swig_type_info *
     629           0 : SWIG_TypeQueryModule(swig_module_info *start,
     630             :                      swig_module_info *end,
     631             :          const char *name) {
     632             :   /* STEP 1: Search the name field using binary search */
     633           0 :   swig_type_info *ret = SWIG_MangledTypeQueryModule(start, end, name);
     634           0 :   if (ret) {
     635             :     return ret;
     636             :   } else {
     637             :     /* STEP 2: If the type hasn't been found, do a complete search
     638             :        of the str field (the human readable name) */
     639             :     swig_module_info *iter = start;
     640           0 :     do {
     641           0 :       size_t i = 0;
     642           0 :       for (; i < iter->size; ++i) {
     643           0 :   if (iter->types[i]->str && (SWIG_TypeEquiv(iter->types[i]->str, name)))
     644           0 :     return iter->types[i];
     645             :       }
     646           0 :       iter = iter->next;
     647           0 :     } while (iter != end);
     648             :   }
     649             : 
     650             :   /* neither found a match */
     651             :   return 0;
     652             : }
     653             : 
     654             : /*
     655             :    Pack binary data into a string
     656             : */
     657             : SWIGRUNTIME char *
     658           0 : SWIG_PackData(char *c, void *ptr, size_t sz) {
     659           0 :   static const char hex[17] = "0123456789abcdef";
     660           0 :   const unsigned char *u = (unsigned char *) ptr;
     661           0 :   const unsigned char *eu =  u + sz;
     662           0 :   for (; u != eu; ++u) {
     663           0 :     unsigned char uu = *u;
     664           0 :     *(c++) = hex[(uu & 0xf0) >> 4];
     665           0 :     *(c++) = hex[uu & 0xf];
     666             :   }
     667           0 :   return c;
     668             : }
     669             : 
     670             : /*
     671             :    Unpack binary data from a string
     672             : */
     673             : SWIGRUNTIME const char *
     674             : SWIG_UnpackData(const char *c, void *ptr, size_t sz) {
     675             :   unsigned char *u = (unsigned char *) ptr;
     676             :   const unsigned char *eu = u + sz;
     677             :   for (; u != eu; ++u) {
     678             :     char d = *(c++);
     679             :     unsigned char uu;
     680             :     if ((d >= '0') && (d <= '9'))
     681             :       uu = (unsigned char)((d - '0') << 4);
     682             :     else if ((d >= 'a') && (d <= 'f'))
     683             :       uu = (unsigned char)((d - ('a'-10)) << 4);
     684             :     else
     685             :       return (char *) 0;
     686             :     d = *(c++);
     687             :     if ((d >= '0') && (d <= '9'))
     688             :       uu |= (unsigned char)(d - '0');
     689             :     else if ((d >= 'a') && (d <= 'f'))
     690             :       uu |= (unsigned char)(d - ('a'-10));
     691             :     else
     692             :       return (char *) 0;
     693             :     *u = uu;
     694             :   }
     695             :   return c;
     696             : }
     697             : 
     698             : /*
     699             :    Pack 'void *' into a string buffer.
     700             : */
     701             : SWIGRUNTIME char *
     702           0 : SWIG_PackVoidPtr(char *buff, void *ptr, const char *name, size_t bsz) {
     703           0 :   char *r = buff;
     704           0 :   if ((2*sizeof(void *) + 2) > bsz) return 0;
     705           0 :   *(r++) = '_';
     706           0 :   r = SWIG_PackData(r,&ptr,sizeof(void *));
     707           0 :   if (strlen(name) + 1 > (bsz - (r - buff))) return 0;
     708           0 :   strcpy(r,name);
     709           0 :   return buff;
     710             : }
     711             : 
     712             : SWIGRUNTIME const char *
     713             : SWIG_UnpackVoidPtr(const char *c, void **ptr, const char *name) {
     714             :   if (*c != '_') {
     715             :     if (strcmp(c,"NULL") == 0) {
     716             :       *ptr = (void *) 0;
     717             :       return name;
     718             :     } else {
     719             :       return 0;
     720             :     }
     721             :   }
     722             :   return SWIG_UnpackData(++c,ptr,sizeof(void *));
     723             : }
     724             : 
     725             : SWIGRUNTIME char *
     726           0 : SWIG_PackDataName(char *buff, void *ptr, size_t sz, const char *name, size_t bsz) {
     727           0 :   char *r = buff;
     728           0 :   size_t lname = (name ? strlen(name) : 0);
     729           0 :   if ((2*sz + 2 + lname) > bsz) return 0;
     730           0 :   *(r++) = '_';
     731           0 :   r = SWIG_PackData(r,ptr,sz);
     732           0 :   if (lname) {
     733           0 :     strncpy(r,name,lname+1);
     734             :   } else {
     735           0 :     *r = 0;
     736             :   }
     737             :   return buff;
     738             : }
     739             : 
     740             : SWIGRUNTIME const char *
     741             : SWIG_UnpackDataName(const char *c, void *ptr, size_t sz, const char *name) {
     742             :   if (*c != '_') {
     743             :     if (strcmp(c,"NULL") == 0) {
     744             :       memset(ptr,0,sz);
     745             :       return name;
     746             :     } else {
     747             :       return 0;
     748             :     }
     749             :   }
     750             :   return SWIG_UnpackData(++c,ptr,sz);
     751             : }
     752             : 
     753             : #ifdef __cplusplus
     754             : }
     755             : #endif
     756             : 
     757             : /*  Errors in SWIG */
     758             : #define  SWIG_UnknownError         -1
     759             : #define  SWIG_IOError            -2
     760             : #define  SWIG_RuntimeError       -3
     761             : #define  SWIG_IndexError         -4
     762             : #define  SWIG_TypeError          -5
     763             : #define  SWIG_DivisionByZero     -6
     764             : #define  SWIG_OverflowError      -7
     765             : #define  SWIG_SyntaxError        -8
     766             : #define  SWIG_ValueError         -9
     767             : #define  SWIG_SystemError        -10
     768             : #define  SWIG_AttributeError     -11
     769             : #define  SWIG_MemoryError        -12
     770             : #define  SWIG_NullReferenceError   -13
     771             : 
     772             : 
     773             : 
     774             : /* Compatibility macros for Python 3 */
     775             : #if PY_VERSION_HEX >= 0x03000000
     776             : 
     777             : #define PyClass_Check(obj) PyObject_IsInstance(obj, (PyObject *)&PyType_Type)
     778             : #define PyInt_Check(x) PyLong_Check(x)
     779             : #define PyInt_AsLong(x) PyLong_AsLong(x)
     780             : #define PyInt_FromLong(x) PyLong_FromLong(x)
     781             : #define PyInt_FromSize_t(x) PyLong_FromSize_t(x)
     782             : #define PyString_Check(name) PyBytes_Check(name)
     783             : #define PyString_FromString(x) PyUnicode_FromString(x)
     784             : #define PyString_Format(fmt, args)  PyUnicode_Format(fmt, args)
     785             : #define PyString_AsString(str) PyBytes_AsString(str)
     786             : #define PyString_Size(str) PyBytes_Size(str)  
     787             : #define PyString_InternFromString(key) PyUnicode_InternFromString(key)
     788             : #define Py_TPFLAGS_HAVE_CLASS Py_TPFLAGS_BASETYPE
     789             : #define PyString_AS_STRING(x) PyUnicode_AS_STRING(x)
     790             : #define _PyLong_FromSsize_t(x) PyLong_FromSsize_t(x)
     791             : 
     792             : #endif
     793             : 
     794             : #ifndef Py_TYPE
     795             : #  define Py_TYPE(op) ((op)->ob_type)
     796             : #endif
     797             : 
     798             : /* SWIG APIs for compatibility of both Python 2 & 3 */
     799             : 
     800             : #if PY_VERSION_HEX >= 0x03000000
     801             : #  define SWIG_Python_str_FromFormat PyUnicode_FromFormat
     802             : #else
     803             : #  define SWIG_Python_str_FromFormat PyString_FromFormat
     804             : #endif
     805             : 
     806             : 
     807             : /* Warning: This function will allocate a new string in Python 3,
     808             :  * so please call SWIG_Python_str_DelForPy3(x) to free the space.
     809             :  */
     810             : SWIGINTERN char*
     811             : SWIG_Python_str_AsChar(PyObject *str)
     812             : {
     813             : #if PY_VERSION_HEX >= 0x03000000
     814             :   char *newstr = 0;
     815             :   str = PyUnicode_AsUTF8String(str);
     816             :   if (str) {
     817             :     char *cstr;
     818             :     Py_ssize_t len;
     819             :     PyBytes_AsStringAndSize(str, &cstr, &len);
     820             :     newstr = (char *) malloc(len+1);
     821             :     memcpy(newstr, cstr, len+1);
     822             :     Py_XDECREF(str);
     823             :   }
     824             :   return newstr;
     825             : #else
     826             :   return PyString_AsString(str);
     827             : #endif
     828             : }
     829             : 
     830             : #if PY_VERSION_HEX >= 0x03000000
     831             : #  define SWIG_Python_str_DelForPy3(x) free( (void*) (x) )
     832             : #else
     833             : #  define SWIG_Python_str_DelForPy3(x) 
     834             : #endif
     835             : 
     836             : 
     837             : SWIGINTERN PyObject*
     838          28 : SWIG_Python_str_FromChar(const char *c)
     839             : {
     840             : #if PY_VERSION_HEX >= 0x03000000
     841          28 :   return PyUnicode_FromString(c); 
     842             : #else
     843             :   return PyString_FromString(c);
     844             : #endif
     845             : }
     846             : 
     847             : #ifndef PyObject_DEL
     848             : # define PyObject_DEL PyObject_Del
     849             : #endif
     850             : 
     851             : // SWIGPY_USE_CAPSULE is no longer used within SWIG itself, but some user
     852             : // interface files check for it.
     853             : # define SWIGPY_USE_CAPSULE
     854             : # define SWIGPY_CAPSULE_NAME ("swig_runtime_data" SWIG_RUNTIME_VERSION ".type_pointer_capsule" SWIG_TYPE_TABLE_NAME)
     855             : 
     856             : #if PY_VERSION_HEX < 0x03020000
     857             : #define PyDescr_TYPE(x) (((PyDescrObject *)(x))->d_type)
     858             : #define PyDescr_NAME(x) (((PyDescrObject *)(x))->d_name)
     859             : #define Py_hash_t long
     860             : #endif
     861             : 
     862             : /* -----------------------------------------------------------------------------
     863             :  * error manipulation
     864             :  * ----------------------------------------------------------------------------- */
     865             : 
     866             : SWIGRUNTIME PyObject*
     867           0 : SWIG_Python_ErrorType(int code) {
     868           0 :   PyObject* type = 0;
     869           0 :   switch(code) {
     870           0 :   case SWIG_MemoryError:
     871           0 :     type = PyExc_MemoryError;
     872           0 :     break;
     873           0 :   case SWIG_IOError:
     874           0 :     type = PyExc_IOError;
     875           0 :     break;
     876           0 :   case SWIG_RuntimeError:
     877           0 :     type = PyExc_RuntimeError;
     878           0 :     break;
     879           0 :   case SWIG_IndexError:
     880           0 :     type = PyExc_IndexError;
     881           0 :     break;
     882           0 :   case SWIG_TypeError:
     883           0 :     type = PyExc_TypeError;
     884           0 :     break;
     885           0 :   case SWIG_DivisionByZero:
     886           0 :     type = PyExc_ZeroDivisionError;
     887           0 :     break;
     888           0 :   case SWIG_OverflowError:
     889           0 :     type = PyExc_OverflowError;
     890           0 :     break;
     891           0 :   case SWIG_SyntaxError:
     892           0 :     type = PyExc_SyntaxError;
     893           0 :     break;
     894           0 :   case SWIG_ValueError:
     895           0 :     type = PyExc_ValueError;
     896           0 :     break;
     897           0 :   case SWIG_SystemError:
     898           0 :     type = PyExc_SystemError;
     899           0 :     break;
     900           0 :   case SWIG_AttributeError:
     901           0 :     type = PyExc_AttributeError;
     902           0 :     break;
     903           0 :   default:
     904           0 :     type = PyExc_RuntimeError;
     905             :   }
     906           0 :   return type;
     907             : }
     908             : 
     909             : 
     910             : SWIGRUNTIME void
     911             : SWIG_Python_AddErrorMsg(const char* mesg)
     912             : {
     913             :   PyObject *type = 0;
     914             :   PyObject *value = 0;
     915             :   PyObject *traceback = 0;
     916             : 
     917             :   if (PyErr_Occurred())
     918             :     PyErr_Fetch(&type, &value, &traceback);
     919             :   if (value) {
     920             :     PyObject *old_str = PyObject_Str(value);
     921             :     const char *tmp = SWIG_Python_str_AsChar(old_str);
     922             :     PyErr_Clear();
     923             :     Py_XINCREF(type);
     924             :     if (tmp)
     925             :       PyErr_Format(type, "%s %s", tmp, mesg);
     926             :     else
     927             :       PyErr_Format(type, "%s", mesg);
     928             :     SWIG_Python_str_DelForPy3(tmp);
     929             :     Py_DECREF(old_str);
     930             :     Py_DECREF(value);
     931             :   } else {
     932             :     PyErr_SetString(PyExc_RuntimeError, mesg);
     933             :   }
     934             : }
     935             : 
     936             : SWIGRUNTIME int
     937             : SWIG_Python_TypeErrorOccurred(PyObject *obj)
     938             : {
     939             :   PyObject *error;
     940             :   if (obj)
     941             :     return 0;
     942             :   error = PyErr_Occurred();
     943             :   return error && PyErr_GivenExceptionMatches(error, PyExc_TypeError);
     944             : }
     945             : 
     946             : SWIGRUNTIME void
     947             : SWIG_Python_RaiseOrModifyTypeError(const char *message)
     948             : {
     949             :   if (SWIG_Python_TypeErrorOccurred(NULL)) {
     950             :     /* Use existing TypeError to preserve stacktrace and enhance with given message */
     951             :     PyObject *newvalue;
     952             :     PyObject *type = NULL, *value = NULL, *traceback = NULL;
     953             :     PyErr_Fetch(&type, &value, &traceback);
     954             : #if PY_VERSION_HEX >= 0x03000000
     955             :     newvalue = PyUnicode_FromFormat("%S\nAdditional information:\n%s", value, message);
     956             : #else
     957             :     newvalue = PyString_FromFormat("%s\nAdditional information:\n%s", PyString_AsString(value), message);
     958             : #endif
     959             :     Py_XDECREF(value);
     960             :     PyErr_Restore(type, newvalue, traceback);
     961             :   } else {
     962             :     /* Raise TypeError using given message */
     963             :     PyErr_SetString(PyExc_TypeError, message);
     964             :   }
     965             : }
     966             : 
     967             : #if defined(SWIG_PYTHON_NO_THREADS)
     968             : #  if defined(SWIG_PYTHON_THREADS)
     969             : #    undef SWIG_PYTHON_THREADS
     970             : #  endif
     971             : #endif
     972             : #if defined(SWIG_PYTHON_THREADS) /* Threading support is enabled */
     973             : #  if !defined(SWIG_PYTHON_USE_GIL) && !defined(SWIG_PYTHON_NO_USE_GIL)
     974             : #    define SWIG_PYTHON_USE_GIL
     975             : #  endif
     976             : #  if defined(SWIG_PYTHON_USE_GIL) /* Use PyGILState threads calls */
     977             : #    ifndef SWIG_PYTHON_INITIALIZE_THREADS
     978             : #     define SWIG_PYTHON_INITIALIZE_THREADS  PyEval_InitThreads() 
     979             : #    endif
     980             : #    ifdef __cplusplus /* C++ code */
     981             :        class SWIG_Python_Thread_Block {
     982             :          bool status;
     983             :          PyGILState_STATE state;
     984             :        public:
     985           0 :          void end() { if (status) { PyGILState_Release(state); status = false;} }
     986           0 :          SWIG_Python_Thread_Block() : status(true), state(PyGILState_Ensure()) {}
     987           0 :          ~SWIG_Python_Thread_Block() { end(); }
     988             :        };
     989             :        class SWIG_Python_Thread_Allow {
     990             :          bool status;
     991             :          PyThreadState *save;
     992             :        public:
     993         108 :          void end() { if (status) { PyEval_RestoreThread(save); status = false; }}
     994         108 :          SWIG_Python_Thread_Allow() : status(true), save(PyEval_SaveThread()) {}
     995           0 :          ~SWIG_Python_Thread_Allow() { end(); }
     996             :        };
     997             : #      define SWIG_PYTHON_THREAD_BEGIN_BLOCK   SWIG_Python_Thread_Block _swig_thread_block
     998             : #      define SWIG_PYTHON_THREAD_END_BLOCK     _swig_thread_block.end()
     999             : #      define SWIG_PYTHON_THREAD_BEGIN_ALLOW   SWIG_Python_Thread_Allow _swig_thread_allow
    1000             : #      define SWIG_PYTHON_THREAD_END_ALLOW     _swig_thread_allow.end()
    1001             : #    else /* C code */
    1002             : #      define SWIG_PYTHON_THREAD_BEGIN_BLOCK   PyGILState_STATE _swig_thread_block = PyGILState_Ensure()
    1003             : #      define SWIG_PYTHON_THREAD_END_BLOCK     PyGILState_Release(_swig_thread_block)
    1004             : #      define SWIG_PYTHON_THREAD_BEGIN_ALLOW   PyThreadState *_swig_thread_allow = PyEval_SaveThread()
    1005             : #      define SWIG_PYTHON_THREAD_END_ALLOW     PyEval_RestoreThread(_swig_thread_allow)
    1006             : #    endif
    1007             : #  else /* Old thread way, not implemented, user must provide it */
    1008             : #    if !defined(SWIG_PYTHON_INITIALIZE_THREADS)
    1009             : #      define SWIG_PYTHON_INITIALIZE_THREADS
    1010             : #    endif
    1011             : #    if !defined(SWIG_PYTHON_THREAD_BEGIN_BLOCK)
    1012             : #      define SWIG_PYTHON_THREAD_BEGIN_BLOCK
    1013             : #    endif
    1014             : #    if !defined(SWIG_PYTHON_THREAD_END_BLOCK)
    1015             : #      define SWIG_PYTHON_THREAD_END_BLOCK
    1016             : #    endif
    1017             : #    if !defined(SWIG_PYTHON_THREAD_BEGIN_ALLOW)
    1018             : #      define SWIG_PYTHON_THREAD_BEGIN_ALLOW
    1019             : #    endif
    1020             : #    if !defined(SWIG_PYTHON_THREAD_END_ALLOW)
    1021             : #      define SWIG_PYTHON_THREAD_END_ALLOW
    1022             : #    endif
    1023             : #  endif
    1024             : #else /* No thread support */
    1025             : #  define SWIG_PYTHON_INITIALIZE_THREADS
    1026             : #  define SWIG_PYTHON_THREAD_BEGIN_BLOCK
    1027             : #  define SWIG_PYTHON_THREAD_END_BLOCK
    1028             : #  define SWIG_PYTHON_THREAD_BEGIN_ALLOW
    1029             : #  define SWIG_PYTHON_THREAD_END_ALLOW
    1030             : #endif
    1031             : 
    1032             : /* -----------------------------------------------------------------------------
    1033             :  * Python API portion that goes into the runtime
    1034             :  * ----------------------------------------------------------------------------- */
    1035             : 
    1036             : #ifdef __cplusplus
    1037             : extern "C" {
    1038             : #endif
    1039             : 
    1040             : /* -----------------------------------------------------------------------------
    1041             :  * Constant declarations
    1042             :  * ----------------------------------------------------------------------------- */
    1043             : 
    1044             : /* Constant Types */
    1045             : #define SWIG_PY_POINTER 4
    1046             : #define SWIG_PY_BINARY  5
    1047             : 
    1048             : /* Constant information structure */
    1049             : typedef struct swig_const_info {
    1050             :   int type;
    1051             :   const char *name;
    1052             :   long lvalue;
    1053             :   double dvalue;
    1054             :   void   *pvalue;
    1055             :   swig_type_info **ptype;
    1056             : } swig_const_info;
    1057             : 
    1058             : #ifdef __cplusplus
    1059             : }
    1060             : #endif
    1061             : 
    1062             : 
    1063             : /* -----------------------------------------------------------------------------
    1064             :  * pyrun.swg
    1065             :  *
    1066             :  * This file contains the runtime support for Python modules
    1067             :  * and includes code for managing global variables and pointer
    1068             :  * type checking.
    1069             :  *
    1070             :  * ----------------------------------------------------------------------------- */
    1071             : 
    1072             : #if PY_VERSION_HEX < 0x02070000 /* 2.7.0 */
    1073             : # error "This version of SWIG only supports Python >= 2.7"
    1074             : #endif
    1075             : 
    1076             : #if PY_VERSION_HEX >= 0x03000000 && PY_VERSION_HEX < 0x03020000
    1077             : # error "This version of SWIG only supports Python 3 >= 3.2"
    1078             : #endif
    1079             : 
    1080             : /* Common SWIG API */
    1081             : 
    1082             : /* for raw pointers */
    1083             : #define SWIG_Python_ConvertPtr(obj, pptr, type, flags)  SWIG_Python_ConvertPtrAndOwn(obj, pptr, type, flags, 0)
    1084             : #define SWIG_ConvertPtr(obj, pptr, type, flags)         SWIG_Python_ConvertPtr(obj, pptr, type, flags)
    1085             : #define SWIG_ConvertPtrAndOwn(obj,pptr,type,flags,own)  SWIG_Python_ConvertPtrAndOwn(obj, pptr, type, flags, own)
    1086             : 
    1087             : #ifdef SWIGPYTHON_BUILTIN
    1088             : #define SWIG_NewPointerObj(ptr, type, flags)            SWIG_Python_NewPointerObj(self, ptr, type, flags)
    1089             : #else
    1090             : #define SWIG_NewPointerObj(ptr, type, flags)            SWIG_Python_NewPointerObj(NULL, ptr, type, flags)
    1091             : #endif
    1092             : 
    1093             : #define SWIG_InternalNewPointerObj(ptr, type, flags)  SWIG_Python_NewPointerObj(NULL, ptr, type, flags)
    1094             : 
    1095             : #define SWIG_CheckImplicit(ty)                          SWIG_Python_CheckImplicit(ty) 
    1096             : #define SWIG_AcquirePtr(ptr, src)                       SWIG_Python_AcquirePtr(ptr, src)
    1097             : #define swig_owntype                                    int
    1098             : 
    1099             : /* for raw packed data */
    1100             : #define SWIG_ConvertPacked(obj, ptr, sz, ty)            SWIG_Python_ConvertPacked(obj, ptr, sz, ty)
    1101             : #define SWIG_NewPackedObj(ptr, sz, type)                SWIG_Python_NewPackedObj(ptr, sz, type)
    1102             : 
    1103             : /* for class or struct pointers */
    1104             : #define SWIG_ConvertInstance(obj, pptr, type, flags)    SWIG_ConvertPtr(obj, pptr, type, flags)
    1105             : #define SWIG_NewInstanceObj(ptr, type, flags)           SWIG_NewPointerObj(ptr, type, flags)
    1106             : 
    1107             : /* for C or C++ function pointers */
    1108             : #define SWIG_ConvertFunctionPtr(obj, pptr, type)        SWIG_Python_ConvertFunctionPtr(obj, pptr, type)
    1109             : #define SWIG_NewFunctionPtrObj(ptr, type)               SWIG_Python_NewPointerObj(NULL, ptr, type, 0)
    1110             : 
    1111             : /* for C++ member pointers, ie, member methods */
    1112             : #define SWIG_ConvertMember(obj, ptr, sz, ty)            SWIG_Python_ConvertPacked(obj, ptr, sz, ty)
    1113             : #define SWIG_NewMemberObj(ptr, sz, type)                SWIG_Python_NewPackedObj(ptr, sz, type)
    1114             : 
    1115             : 
    1116             : /* Runtime API */
    1117             : 
    1118             : #define SWIG_GetModule(clientdata)                      SWIG_Python_GetModule(clientdata)
    1119             : #define SWIG_SetModule(clientdata, pointer)             SWIG_Python_SetModule(pointer)
    1120             : #define SWIG_NewClientData(obj)                         SwigPyClientData_New(obj)
    1121             : 
    1122             : #define SWIG_SetErrorObj                                SWIG_Python_SetErrorObj                            
    1123             : #define SWIG_SetErrorMsg                          SWIG_Python_SetErrorMsg          
    1124             : #define SWIG_ErrorType(code)                      SWIG_Python_ErrorType(code)                        
    1125             : #define SWIG_Error(code, msg)               SWIG_Python_SetErrorMsg(SWIG_ErrorType(code), msg) 
    1126             : #define SWIG_fail                           goto fail            
    1127             : 
    1128             : 
    1129             : /* Runtime API implementation */
    1130             : 
    1131             : /* Error manipulation */
    1132             : 
    1133             : SWIGINTERN void 
    1134             : SWIG_Python_SetErrorObj(PyObject *errtype, PyObject *obj) {
    1135             :   SWIG_PYTHON_THREAD_BEGIN_BLOCK; 
    1136             :   PyErr_SetObject(errtype, obj);
    1137             :   Py_DECREF(obj);
    1138             :   SWIG_PYTHON_THREAD_END_BLOCK;
    1139             : }
    1140             : 
    1141             : SWIGINTERN void 
    1142           0 : SWIG_Python_SetErrorMsg(PyObject *errtype, const char *msg) {
    1143           0 :   SWIG_PYTHON_THREAD_BEGIN_BLOCK;
    1144           0 :   PyErr_SetString(errtype, msg);
    1145           0 :   SWIG_PYTHON_THREAD_END_BLOCK;
    1146           0 : }
    1147             : 
    1148             : #define SWIG_Python_Raise(obj, type, desc)  SWIG_Python_SetErrorObj(SWIG_Python_ExceptionType(desc), obj)
    1149             : 
    1150             : /* Set a constant value */
    1151             : 
    1152             : #if defined(SWIGPYTHON_BUILTIN)
    1153             : 
    1154             : SWIGINTERN void
    1155             : SwigPyBuiltin_AddPublicSymbol(PyObject *seq, const char *key) {
    1156             :   PyObject *s = PyString_InternFromString(key);
    1157             :   PyList_Append(seq, s);
    1158             :   Py_DECREF(s);
    1159             : }
    1160             : 
    1161             : SWIGINTERN void
    1162             : SWIG_Python_SetConstant(PyObject *d, PyObject *public_interface, const char *name, PyObject *obj) {   
    1163             :   PyDict_SetItemString(d, name, obj);
    1164             :   Py_DECREF(obj);
    1165             :   if (public_interface)
    1166             :     SwigPyBuiltin_AddPublicSymbol(public_interface, name);
    1167             : }
    1168             : 
    1169             : #else
    1170             : 
    1171             : SWIGINTERN void
    1172         168 : SWIG_Python_SetConstant(PyObject *d, const char *name, PyObject *obj) {   
    1173         168 :   PyDict_SetItemString(d, name, obj);
    1174         168 :   Py_DECREF(obj);                            
    1175         168 : }
    1176             : 
    1177             : #endif
    1178             : 
    1179             : /* Append a value to the result obj */
    1180             : 
    1181             : SWIGINTERN PyObject*
    1182             : SWIG_Python_AppendOutput(PyObject* result, PyObject* obj) {
    1183             :   if (!result) {
    1184             :     result = obj;
    1185             :   } else if (result == Py_None) {
    1186             :     Py_DECREF(result);
    1187             :     result = obj;
    1188             :   } else {
    1189             :     if (!PyList_Check(result)) {
    1190             :       PyObject *o2 = result;
    1191             :       result = PyList_New(1);
    1192             :       PyList_SetItem(result, 0, o2);
    1193             :     }
    1194             :     PyList_Append(result,obj);
    1195             :     Py_DECREF(obj);
    1196             :   }
    1197             :   return result;
    1198             : }
    1199             : 
    1200             : /* Unpack the argument tuple */
    1201             : 
    1202             : SWIGINTERN Py_ssize_t
    1203          96 : SWIG_Python_UnpackTuple(PyObject *args, const char *name, Py_ssize_t min, Py_ssize_t max, PyObject **objs)
    1204             : {
    1205          96 :   if (!args) {
    1206          37 :     if (!min && !max) {
    1207             :       return 1;
    1208             :     } else {
    1209           0 :       PyErr_Format(PyExc_TypeError, "%s expected %s%d arguments, got none", 
    1210             :        name, (min == max ? "" : "at least "), (int)min);
    1211           0 :       return 0;
    1212             :     }
    1213             :   }  
    1214          59 :   if (!PyTuple_Check(args)) {
    1215          56 :     if (min <= 1 && max >= 1) {
    1216          56 :       Py_ssize_t i;
    1217          56 :       objs[0] = args;
    1218          56 :       for (i = 1; i < max; ++i) {
    1219           0 :   objs[i] = 0;
    1220             :       }
    1221             :       return 2;
    1222             :     }
    1223           0 :     PyErr_SetString(PyExc_SystemError, "UnpackTuple() argument list is not a tuple");
    1224           0 :     return 0;
    1225             :   } else {
    1226           3 :     Py_ssize_t l = PyTuple_GET_SIZE(args);
    1227           3 :     if (l < min) {
    1228           0 :       PyErr_Format(PyExc_TypeError, "%s expected %s%d arguments, got %d", 
    1229             :        name, (min == max ? "" : "at least "), (int)min, (int)l);
    1230           0 :       return 0;
    1231           3 :     } else if (l > max) {
    1232           0 :       PyErr_Format(PyExc_TypeError, "%s expected %s%d arguments, got %d", 
    1233             :        name, (min == max ? "" : "at most "), (int)max, (int)l);
    1234           0 :       return 0;
    1235             :     } else {
    1236             :       Py_ssize_t i;
    1237           9 :       for (i = 0; i < l; ++i) {
    1238           6 :   objs[i] = PyTuple_GET_ITEM(args, i);
    1239             :       }
    1240           3 :       for (; l < max; ++l) {
    1241           0 :   objs[l] = 0;
    1242             :       }
    1243           3 :       return i + 1;
    1244             :     }    
    1245             :   }
    1246             : }
    1247             : 
    1248             : /* A functor is a function object with one single object argument */
    1249             : #define SWIG_Python_CallFunctor(functor, obj)         PyObject_CallFunctionObjArgs(functor, obj, NULL);
    1250             : 
    1251             : /*
    1252             :   Helper for static pointer initialization for both C and C++ code, for example
    1253             :   static PyObject *SWIG_STATIC_POINTER(MyVar) = NewSomething(...);
    1254             : */
    1255             : #ifdef __cplusplus
    1256             : #define SWIG_STATIC_POINTER(var)  var
    1257             : #else
    1258             : #define SWIG_STATIC_POINTER(var)  var = 0; if (!var) var
    1259             : #endif
    1260             : 
    1261             : /* -----------------------------------------------------------------------------
    1262             :  * Pointer declarations
    1263             :  * ----------------------------------------------------------------------------- */
    1264             : 
    1265             : /* Flags for new pointer objects */
    1266             : #define SWIG_POINTER_NOSHADOW       (SWIG_POINTER_OWN      << 1)
    1267             : #define SWIG_POINTER_NEW            (SWIG_POINTER_NOSHADOW | SWIG_POINTER_OWN)
    1268             : 
    1269             : #define SWIG_POINTER_IMPLICIT_CONV  (SWIG_POINTER_DISOWN   << 1)
    1270             : 
    1271             : #define SWIG_BUILTIN_TP_INIT      (SWIG_POINTER_OWN << 2)
    1272             : #define SWIG_BUILTIN_INIT     (SWIG_BUILTIN_TP_INIT | SWIG_POINTER_OWN)
    1273             : 
    1274             : #ifdef __cplusplus
    1275             : extern "C" {
    1276             : #endif
    1277             : 
    1278             : /* The python void return value */
    1279             : 
    1280             : SWIGRUNTIMEINLINE PyObject * 
    1281          90 : SWIG_Py_Void(void)
    1282             : {
    1283          90 :   PyObject *none = Py_None;
    1284           0 :   Py_INCREF(none);
    1285          56 :   return none;
    1286             : }
    1287             : 
    1288             : /* SwigPyClientData */
    1289             : 
    1290             : typedef struct {
    1291             :   PyObject *klass;
    1292             :   PyObject *newraw;
    1293             :   PyObject *newargs;
    1294             :   PyObject *destroy;
    1295             :   int delargs;
    1296             :   int implicitconv;
    1297             :   PyTypeObject *pytype;
    1298             : } SwigPyClientData;
    1299             : 
    1300             : SWIGRUNTIMEINLINE int 
    1301             : SWIG_Python_CheckImplicit(swig_type_info *ty)
    1302             : {
    1303             :   SwigPyClientData *data = (SwigPyClientData *)ty->clientdata;
    1304             :   int fail = data ? data->implicitconv : 0;
    1305             :   if (fail)
    1306             :     PyErr_SetString(PyExc_TypeError, "Implicit conversion is prohibited for explicit constructors.");
    1307             :   return fail;
    1308             : }
    1309             : 
    1310             : SWIGRUNTIMEINLINE PyObject *
    1311             : SWIG_Python_ExceptionType(swig_type_info *desc) {
    1312             :   SwigPyClientData *data = desc ? (SwigPyClientData *) desc->clientdata : 0;
    1313             :   PyObject *klass = data ? data->klass : 0;
    1314             :   return (klass ? klass : PyExc_RuntimeError);
    1315             : }
    1316             : 
    1317             : 
    1318             : SWIGRUNTIME SwigPyClientData * 
    1319          56 : SwigPyClientData_New(PyObject* obj)
    1320             : {
    1321          56 :   if (!obj) {
    1322             :     return 0;
    1323             :   } else {
    1324          56 :     SwigPyClientData *data = (SwigPyClientData *)malloc(sizeof(SwigPyClientData));
    1325             :     /* the klass element */
    1326          56 :     data->klass = obj;
    1327          56 :     Py_INCREF(data->klass);
    1328             :     /* the newraw method and newargs arguments used to create a new raw instance */
    1329          56 :     if (PyClass_Check(obj)) {
    1330          56 :       data->newraw = 0;
    1331          56 :       data->newargs = obj;
    1332          56 :       Py_INCREF(obj);
    1333             :     } else {
    1334           0 :       data->newraw = PyObject_GetAttrString(data->klass, "__new__");
    1335           0 :       if (data->newraw) {
    1336           0 :   Py_INCREF(data->newraw);
    1337           0 :   data->newargs = PyTuple_New(1);
    1338           0 :   PyTuple_SetItem(data->newargs, 0, obj);
    1339             :       } else {
    1340           0 :   data->newargs = obj;
    1341             :       }
    1342           0 :       Py_INCREF(data->newargs);
    1343             :     }
    1344             :     /* the destroy method, aka as the C++ delete method */
    1345          56 :     data->destroy = PyObject_GetAttrString(data->klass, "__swig_destroy__");
    1346          56 :     if (PyErr_Occurred()) {
    1347           0 :       PyErr_Clear();
    1348           0 :       data->destroy = 0;
    1349             :     }
    1350          56 :     if (data->destroy) {
    1351          56 :       int flags;
    1352          56 :       Py_INCREF(data->destroy);
    1353          56 :       flags = PyCFunction_GET_FLAGS(data->destroy);
    1354          56 :       data->delargs = !(flags & (METH_O));
    1355             :     } else {
    1356           0 :       data->delargs = 0;
    1357             :     }
    1358          56 :     data->implicitconv = 0;
    1359          56 :     data->pytype = 0;
    1360          56 :     return data;
    1361             :   }
    1362             : }
    1363             : 
    1364             : SWIGRUNTIME void 
    1365           0 : SwigPyClientData_Del(SwigPyClientData *data) {
    1366           0 :   Py_XDECREF(data->newraw);
    1367           0 :   Py_XDECREF(data->newargs);
    1368           0 :   Py_XDECREF(data->destroy);
    1369           0 : }
    1370             : 
    1371             : /* =============== SwigPyObject =====================*/
    1372             : 
    1373             : typedef struct {
    1374             :   PyObject_HEAD
    1375             :   void *ptr;
    1376             :   swig_type_info *ty;
    1377             :   int own;
    1378             :   PyObject *next;
    1379             : #ifdef SWIGPYTHON_BUILTIN
    1380             :   PyObject *dict;
    1381             : #endif
    1382             : } SwigPyObject;
    1383             : 
    1384             : 
    1385             : #ifdef SWIGPYTHON_BUILTIN
    1386             : 
    1387             : SWIGRUNTIME PyObject *
    1388             : SwigPyObject_get___dict__(PyObject *v, PyObject *SWIGUNUSEDPARM(args))
    1389             : {
    1390             :   SwigPyObject *sobj = (SwigPyObject *)v;
    1391             : 
    1392             :   if (!sobj->dict)
    1393             :     sobj->dict = PyDict_New();
    1394             : 
    1395             :   Py_INCREF(sobj->dict);
    1396             :   return sobj->dict;
    1397             : }
    1398             : 
    1399             : #endif
    1400             : 
    1401             : SWIGRUNTIME PyObject *
    1402           0 : SwigPyObject_long(SwigPyObject *v)
    1403             : {
    1404           0 :   return PyLong_FromVoidPtr(v->ptr);
    1405             : }
    1406             : 
    1407             : SWIGRUNTIME PyObject *
    1408             : SwigPyObject_format(const char* fmt, SwigPyObject *v)
    1409             : {
    1410             :   PyObject *res = NULL;
    1411             :   PyObject *args = PyTuple_New(1);
    1412             :   if (args) {
    1413             :     if (PyTuple_SetItem(args, 0, SwigPyObject_long(v)) == 0) {
    1414             :       PyObject *ofmt = SWIG_Python_str_FromChar(fmt);
    1415             :       if (ofmt) {
    1416             : #if PY_VERSION_HEX >= 0x03000000
    1417             :   res = PyUnicode_Format(ofmt,args);
    1418             : #else
    1419             :   res = PyString_Format(ofmt,args);
    1420             : #endif
    1421             :   Py_DECREF(ofmt);
    1422             :       }
    1423             :       Py_DECREF(args);
    1424             :     }
    1425             :   }
    1426             :   return res;
    1427             : }
    1428             : 
    1429             : SWIGRUNTIME PyObject *
    1430             : SwigPyObject_oct(SwigPyObject *v)
    1431             : {
    1432             :   return SwigPyObject_format("%o",v);
    1433             : }
    1434             : 
    1435             : SWIGRUNTIME PyObject *
    1436             : SwigPyObject_hex(SwigPyObject *v)
    1437             : {
    1438             :   return SwigPyObject_format("%x",v);
    1439             : }
    1440             : 
    1441             : SWIGRUNTIME PyObject *
    1442           0 : SwigPyObject_repr(SwigPyObject *v)
    1443             : {
    1444           0 :   const char *name = SWIG_TypePrettyName(v->ty);
    1445           0 :   PyObject *repr = SWIG_Python_str_FromFormat("<Swig Object of type '%s' at %p>", (name ? name : "unknown"), (void *)v);
    1446           0 :   if (v->next) {
    1447           0 :     PyObject *nrep = SwigPyObject_repr((SwigPyObject *)v->next);
    1448             : # if PY_VERSION_HEX >= 0x03000000
    1449           0 :     PyObject *joined = PyUnicode_Concat(repr, nrep);
    1450           0 :     Py_DecRef(repr);
    1451           0 :     Py_DecRef(nrep);
    1452           0 :     repr = joined;
    1453             : # else
    1454             :     PyString_ConcatAndDel(&repr,nrep);
    1455             : # endif
    1456             :   }
    1457           0 :   return repr;  
    1458             : }
    1459             : 
    1460             : /* We need a version taking two PyObject* parameters so it's a valid
    1461             :  * PyCFunction to use in swigobject_methods[]. */
    1462             : SWIGRUNTIME PyObject *
    1463           0 : SwigPyObject_repr2(PyObject *v, PyObject *SWIGUNUSEDPARM(args))
    1464             : {
    1465           0 :   return SwigPyObject_repr((SwigPyObject*)v);
    1466             : }
    1467             : 
    1468             : SWIGRUNTIME int
    1469           0 : SwigPyObject_compare(SwigPyObject *v, SwigPyObject *w)
    1470             : {
    1471           0 :   void *i = v->ptr;
    1472           0 :   void *j = w->ptr;
    1473           0 :   return (i < j) ? -1 : ((i > j) ? 1 : 0);
    1474             : }
    1475             : 
    1476             : /* Added for Python 3.x, would it also be useful for Python 2.x? */
    1477             : SWIGRUNTIME PyObject*
    1478           0 : SwigPyObject_richcompare(SwigPyObject *v, SwigPyObject *w, int op)
    1479             : {
    1480           0 :   PyObject* res;
    1481           0 :   if( op != Py_EQ && op != Py_NE ) {
    1482           0 :     Py_INCREF(Py_NotImplemented);
    1483           0 :     return Py_NotImplemented;
    1484             :   }
    1485           0 :   res = PyBool_FromLong( (SwigPyObject_compare(v, w)==0) == (op == Py_EQ) ? 1 : 0);
    1486           0 :   return res;  
    1487             : }
    1488             : 
    1489             : 
    1490             : SWIGRUNTIME PyTypeObject* SwigPyObject_TypeOnce(void);
    1491             : 
    1492             : #ifdef SWIGPYTHON_BUILTIN
    1493             : static swig_type_info *SwigPyObject_stype = 0;
    1494             : SWIGRUNTIME PyTypeObject*
    1495             : SwigPyObject_type(void) {
    1496             :     SwigPyClientData *cd;
    1497             :     assert(SwigPyObject_stype);
    1498             :     cd = (SwigPyClientData*) SwigPyObject_stype->clientdata;
    1499             :     assert(cd);
    1500             :     assert(cd->pytype);
    1501             :     return cd->pytype;
    1502             : }
    1503             : #else
    1504             : SWIGRUNTIME PyTypeObject*
    1505          86 : SwigPyObject_type(void) {
    1506          86 :   static PyTypeObject *SWIG_STATIC_POINTER(type) = SwigPyObject_TypeOnce();
    1507          86 :   return type;
    1508             : }
    1509             : #endif
    1510             : 
    1511             : SWIGRUNTIMEINLINE int
    1512             : SwigPyObject_Check(PyObject *op) {
    1513             : #ifdef SWIGPYTHON_BUILTIN
    1514             :   PyTypeObject *target_tp = SwigPyObject_type();
    1515             :   if (PyType_IsSubtype(op->ob_type, target_tp))
    1516             :     return 1;
    1517             :   return (strcmp(op->ob_type->tp_name, "SwigPyObject") == 0);
    1518             : #else
    1519             :   return (Py_TYPE(op) == SwigPyObject_type())
    1520             :     || (strcmp(Py_TYPE(op)->tp_name,"SwigPyObject") == 0);
    1521             : #endif
    1522             : }
    1523             : 
    1524             : SWIGRUNTIME PyObject *
    1525             : SwigPyObject_New(void *ptr, swig_type_info *ty, int own);
    1526             : 
    1527             : SWIGRUNTIME void
    1528           9 : SwigPyObject_dealloc(PyObject *v)
    1529             : {
    1530           9 :   SwigPyObject *sobj = (SwigPyObject *) v;
    1531           9 :   PyObject *next = sobj->next;
    1532           9 :   if (sobj->own == SWIG_POINTER_OWN) {
    1533           0 :     swig_type_info *ty = sobj->ty;
    1534           0 :     SwigPyClientData *data = ty ? (SwigPyClientData *) ty->clientdata : 0;
    1535           0 :     PyObject *destroy = data ? data->destroy : 0;
    1536           0 :     if (destroy) {
    1537             :       /* destroy is always a VARARGS method */
    1538           0 :       PyObject *res;
    1539             : 
    1540             :       /* PyObject_CallFunction() has the potential to silently drop
    1541             :          the active exception.  In cases of unnamed temporary
    1542             :          variable or where we just finished iterating over a generator
    1543             :          StopIteration will be active right now, and this needs to
    1544             :          remain true upon return from SwigPyObject_dealloc.  So save
    1545             :          and restore. */
    1546             :       
    1547           0 :       PyObject *type = NULL, *value = NULL, *traceback = NULL;
    1548           0 :       PyErr_Fetch(&type, &value, &traceback);
    1549             : 
    1550           0 :       if (data->delargs) {
    1551             :         /* we need to create a temporary object to carry the destroy operation */
    1552           0 :         PyObject *tmp = SwigPyObject_New(sobj->ptr, ty, 0);
    1553           0 :         res = SWIG_Python_CallFunctor(destroy, tmp);
    1554           0 :         Py_DECREF(tmp);
    1555             :       } else {
    1556           0 :         PyCFunction meth = PyCFunction_GET_FUNCTION(destroy);
    1557           0 :         PyObject *mself = PyCFunction_GET_SELF(destroy);
    1558           0 :         res = ((*meth)(mself, v));
    1559             :       }
    1560           0 :       if (!res)
    1561           0 :         PyErr_WriteUnraisable(destroy);
    1562             : 
    1563           0 :       PyErr_Restore(type, value, traceback);
    1564             : 
    1565           0 :       Py_XDECREF(res);
    1566             :     } 
    1567             : #if !defined(SWIG_PYTHON_SILENT_MEMLEAK)
    1568             :     else {
    1569             :       const char *name = SWIG_TypePrettyName(ty);
    1570             :       printf("swig/python detected a memory leak of type '%s', no destructor found.\n", (name ? name : "unknown"));
    1571             :     }
    1572             : #endif
    1573             :   } 
    1574           9 :   Py_XDECREF(next);
    1575           9 :   PyObject_DEL(v);
    1576           9 : }
    1577             : 
    1578             : SWIGRUNTIME PyObject* 
    1579           0 : SwigPyObject_append(PyObject* v, PyObject* next)
    1580             : {
    1581           0 :   SwigPyObject *sobj = (SwigPyObject *) v;
    1582           0 :   if (!SwigPyObject_Check(next)) {
    1583           0 :     PyErr_SetString(PyExc_TypeError, "Attempt to append a non SwigPyObject");
    1584           0 :     return NULL;
    1585             :   }
    1586           0 :   sobj->next = next;
    1587           0 :   Py_INCREF(next);
    1588           0 :   return SWIG_Py_Void();
    1589             : }
    1590             : 
    1591             : SWIGRUNTIME PyObject* 
    1592           0 : SwigPyObject_next(PyObject* v, PyObject *SWIGUNUSEDPARM(args))
    1593             : {
    1594           0 :   SwigPyObject *sobj = (SwigPyObject *) v;
    1595           0 :   if (sobj->next) {    
    1596           0 :     Py_INCREF(sobj->next);
    1597           0 :     return sobj->next;
    1598             :   } else {
    1599           0 :     return SWIG_Py_Void();
    1600             :   }
    1601             : }
    1602             : 
    1603             : SWIGINTERN PyObject*
    1604           0 : SwigPyObject_disown(PyObject* v, PyObject *SWIGUNUSEDPARM(args))
    1605             : {
    1606           0 :   SwigPyObject *sobj = (SwigPyObject *)v;
    1607           0 :   sobj->own = 0;
    1608           0 :   return SWIG_Py_Void();
    1609             : }
    1610             : 
    1611             : SWIGINTERN PyObject*
    1612           0 : SwigPyObject_acquire(PyObject* v, PyObject *SWIGUNUSEDPARM(args))
    1613             : {
    1614           0 :   SwigPyObject *sobj = (SwigPyObject *)v;
    1615           0 :   sobj->own = SWIG_POINTER_OWN;
    1616           0 :   return SWIG_Py_Void();
    1617             : }
    1618             : 
    1619             : SWIGINTERN PyObject*
    1620           0 : SwigPyObject_own(PyObject *v, PyObject *args)
    1621             : {
    1622           0 :   PyObject *val = 0;
    1623           0 :   if (!PyArg_UnpackTuple(args, "own", 0, 1, &val)) {
    1624             :     return NULL;
    1625             :   } else {
    1626           0 :     SwigPyObject *sobj = (SwigPyObject *)v;
    1627           0 :     PyObject *obj = PyBool_FromLong(sobj->own);
    1628           0 :     if (val) {
    1629           0 :       if (PyObject_IsTrue(val)) {
    1630           0 :         SwigPyObject_acquire(v,args);
    1631             :       } else {
    1632           0 :         SwigPyObject_disown(v,args);
    1633             :       }
    1634             :     } 
    1635           0 :     return obj;
    1636             :   }
    1637             : }
    1638             : 
    1639             : static PyMethodDef
    1640             : swigobject_methods[] = {
    1641             :   {"disown",  SwigPyObject_disown,  METH_NOARGS,  "releases ownership of the pointer"},
    1642             :   {"acquire", SwigPyObject_acquire, METH_NOARGS,  "acquires ownership of the pointer"},
    1643             :   {"own",     SwigPyObject_own,     METH_VARARGS, "returns/sets ownership of the pointer"},
    1644             :   {"append",  SwigPyObject_append,  METH_O,       "appends another 'this' object"},
    1645             :   {"next",    SwigPyObject_next,    METH_NOARGS,  "returns the next 'this' object"},
    1646             :   {"__repr__",SwigPyObject_repr2,   METH_NOARGS,  "returns object representation"},
    1647             :   {0, 0, 0, 0}  
    1648             : };
    1649             : 
    1650             : SWIGRUNTIME PyTypeObject*
    1651          28 : SwigPyObject_TypeOnce(void) {
    1652          28 :   static char swigobject_doc[] = "Swig object carries a C/C++ instance pointer";
    1653             : 
    1654          28 :   static PyNumberMethods SwigPyObject_as_number = {
    1655             :     (binaryfunc)0, /*nb_add*/
    1656             :     (binaryfunc)0, /*nb_subtract*/
    1657             :     (binaryfunc)0, /*nb_multiply*/
    1658             :     /* nb_divide removed in Python 3 */
    1659             : #if PY_VERSION_HEX < 0x03000000
    1660             :     (binaryfunc)0, /*nb_divide*/
    1661             : #endif
    1662             :     (binaryfunc)0, /*nb_remainder*/
    1663             :     (binaryfunc)0, /*nb_divmod*/
    1664             :     (ternaryfunc)0,/*nb_power*/
    1665             :     (unaryfunc)0,  /*nb_negative*/
    1666             :     (unaryfunc)0,  /*nb_positive*/
    1667             :     (unaryfunc)0,  /*nb_absolute*/
    1668             :     (inquiry)0,    /*nb_nonzero*/
    1669             :     0,       /*nb_invert*/
    1670             :     0,       /*nb_lshift*/
    1671             :     0,       /*nb_rshift*/
    1672             :     0,       /*nb_and*/
    1673             :     0,       /*nb_xor*/
    1674             :     0,       /*nb_or*/
    1675             : #if PY_VERSION_HEX < 0x03000000
    1676             :     0,   /*nb_coerce*/
    1677             : #endif
    1678             :     (unaryfunc)SwigPyObject_long, /*nb_int*/
    1679             : #if PY_VERSION_HEX < 0x03000000
    1680             :     (unaryfunc)SwigPyObject_long, /*nb_long*/
    1681             : #else
    1682             :     0, /*nb_reserved*/
    1683             : #endif
    1684             :     (unaryfunc)0,                 /*nb_float*/
    1685             : #if PY_VERSION_HEX < 0x03000000
    1686             :     (unaryfunc)SwigPyObject_oct,  /*nb_oct*/
    1687             :     (unaryfunc)SwigPyObject_hex,  /*nb_hex*/
    1688             : #endif
    1689             : #if PY_VERSION_HEX >= 0x03050000 /* 3.5 */
    1690             :     0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 /* nb_inplace_add -> nb_inplace_matrix_multiply */
    1691             : #elif PY_VERSION_HEX >= 0x03000000 /* 3.0 */
    1692             :     0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 /* nb_inplace_add -> nb_index, nb_inplace_divide removed */
    1693             : #else
    1694             :     0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 /* nb_inplace_add -> nb_index */
    1695             : #endif
    1696             :   };
    1697             : 
    1698          28 :   static PyTypeObject swigpyobject_type;
    1699          28 :   static int type_init = 0;
    1700          28 :   if (!type_init) {
    1701          28 :     const PyTypeObject tmp = {
    1702             : #if PY_VERSION_HEX >= 0x03000000
    1703             :       PyVarObject_HEAD_INIT(NULL, 0)
    1704             : #else
    1705             :       PyObject_HEAD_INIT(NULL)
    1706             :       0,                                    /* ob_size */
    1707             : #endif
    1708             :       "SwigPyObject",                       /* tp_name */
    1709             :       sizeof(SwigPyObject),                 /* tp_basicsize */
    1710             :       0,                                    /* tp_itemsize */
    1711             :       (destructor)SwigPyObject_dealloc,     /* tp_dealloc */
    1712             :       0,                                    /* tp_print */
    1713             :       (getattrfunc)0,                       /* tp_getattr */
    1714             :       (setattrfunc)0,                       /* tp_setattr */
    1715             : #if PY_VERSION_HEX >= 0x03000000
    1716             :       0, /* tp_reserved in 3.0.1, tp_compare in 3.0.0 but not used */
    1717             : #else
    1718             :       (cmpfunc)SwigPyObject_compare,        /* tp_compare */
    1719             : #endif
    1720             :       (reprfunc)SwigPyObject_repr,          /* tp_repr */
    1721             :       &SwigPyObject_as_number,              /* tp_as_number */
    1722             :       0,                                    /* tp_as_sequence */
    1723             :       0,                                    /* tp_as_mapping */
    1724             :       (hashfunc)0,                          /* tp_hash */
    1725             :       (ternaryfunc)0,                       /* tp_call */
    1726             :       0,                                    /* tp_str */
    1727             :       PyObject_GenericGetAttr,              /* tp_getattro */
    1728             :       0,                                    /* tp_setattro */
    1729             :       0,                                    /* tp_as_buffer */
    1730             :       Py_TPFLAGS_DEFAULT,                   /* tp_flags */
    1731             :       swigobject_doc,                       /* tp_doc */
    1732             :       0,                                    /* tp_traverse */
    1733             :       0,                                    /* tp_clear */
    1734             :       (richcmpfunc)SwigPyObject_richcompare,/* tp_richcompare */
    1735             :       0,                                    /* tp_weaklistoffset */
    1736             :       0,                                    /* tp_iter */
    1737             :       0,                                    /* tp_iternext */
    1738             :       swigobject_methods,                   /* tp_methods */
    1739             :       0,                                    /* tp_members */
    1740             :       0,                                    /* tp_getset */
    1741             :       0,                                    /* tp_base */
    1742             :       0,                                    /* tp_dict */
    1743             :       0,                                    /* tp_descr_get */
    1744             :       0,                                    /* tp_descr_set */
    1745             :       0,                                    /* tp_dictoffset */
    1746             :       0,                                    /* tp_init */
    1747             :       0,                                    /* tp_alloc */
    1748             :       0,                                    /* tp_new */
    1749             :       0,                                    /* tp_free */
    1750             :       0,                                    /* tp_is_gc */
    1751             :       0,                                    /* tp_bases */
    1752             :       0,                                    /* tp_mro */
    1753             :       0,                                    /* tp_cache */
    1754             :       0,                                    /* tp_subclasses */
    1755             :       0,                                    /* tp_weaklist */
    1756             :       0,                                    /* tp_del */
    1757             :       0,                                    /* tp_version_tag */
    1758             : #if PY_VERSION_HEX >= 0x03040000
    1759             :       0,                                    /* tp_finalize */
    1760             : #endif
    1761             : #ifdef COUNT_ALLOCS
    1762             :       0,                                    /* tp_allocs */
    1763             :       0,                                    /* tp_frees */
    1764             :       0,                                    /* tp_maxalloc */
    1765             :       0,                                    /* tp_prev */
    1766             :       0                                     /* tp_next */
    1767             : #endif
    1768             :     };
    1769          28 :     swigpyobject_type = tmp;
    1770          28 :     type_init = 1;
    1771          28 :     if (PyType_Ready(&swigpyobject_type) < 0)
    1772           0 :       return NULL;
    1773             :   }
    1774             :   return &swigpyobject_type;
    1775             : }
    1776             : 
    1777             : SWIGRUNTIME PyObject *
    1778           9 : SwigPyObject_New(void *ptr, swig_type_info *ty, int own)
    1779             : {
    1780           9 :   SwigPyObject *sobj = PyObject_NEW(SwigPyObject, SwigPyObject_type());
    1781           9 :   if (sobj) {
    1782           9 :     sobj->ptr  = ptr;
    1783           9 :     sobj->ty   = ty;
    1784           9 :     sobj->own  = own;
    1785           9 :     sobj->next = 0;
    1786             :   }
    1787           9 :   return (PyObject *)sobj;
    1788             : }
    1789             : 
    1790             : /* -----------------------------------------------------------------------------
    1791             :  * Implements a simple Swig Packed type, and use it instead of string
    1792             :  * ----------------------------------------------------------------------------- */
    1793             : 
    1794             : typedef struct {
    1795             :   PyObject_HEAD
    1796             :   void *pack;
    1797             :   swig_type_info *ty;
    1798             :   size_t size;
    1799             : } SwigPyPacked;
    1800             : 
    1801             : SWIGRUNTIME PyObject *
    1802           0 : SwigPyPacked_repr(SwigPyPacked *v)
    1803             : {
    1804           0 :   char result[SWIG_BUFFER_SIZE];
    1805           0 :   if (SWIG_PackDataName(result, v->pack, v->size, 0, sizeof(result))) {
    1806           0 :     return SWIG_Python_str_FromFormat("<Swig Packed at %s%s>", result, v->ty->name);
    1807             :   } else {
    1808           0 :     return SWIG_Python_str_FromFormat("<Swig Packed %s>", v->ty->name);
    1809             :   }  
    1810             : }
    1811             : 
    1812             : SWIGRUNTIME PyObject *
    1813           0 : SwigPyPacked_str(SwigPyPacked *v)
    1814             : {
    1815           0 :   char result[SWIG_BUFFER_SIZE];
    1816           0 :   if (SWIG_PackDataName(result, v->pack, v->size, 0, sizeof(result))){
    1817           0 :     return SWIG_Python_str_FromFormat("%s%s", result, v->ty->name);
    1818             :   } else {
    1819           0 :     return SWIG_Python_str_FromChar(v->ty->name);
    1820             :   }  
    1821             : }
    1822             : 
    1823             : SWIGRUNTIME int
    1824             : SwigPyPacked_compare(SwigPyPacked *v, SwigPyPacked *w)
    1825             : {
    1826             :   size_t i = v->size;
    1827             :   size_t j = w->size;
    1828             :   int s = (i < j) ? -1 : ((i > j) ? 1 : 0);
    1829             :   return s ? s : strncmp((const char *)v->pack, (const char *)w->pack, 2*v->size);
    1830             : }
    1831             : 
    1832             : SWIGRUNTIME PyTypeObject* SwigPyPacked_TypeOnce(void);
    1833             : 
    1834             : SWIGRUNTIME PyTypeObject*
    1835          28 : SwigPyPacked_type(void) {
    1836          28 :   static PyTypeObject *SWIG_STATIC_POINTER(type) = SwigPyPacked_TypeOnce();
    1837          28 :   return type;
    1838             : }
    1839             : 
    1840             : SWIGRUNTIMEINLINE int
    1841             : SwigPyPacked_Check(PyObject *op) {
    1842             :   return ((op)->ob_type == SwigPyPacked_TypeOnce()) 
    1843             :     || (strcmp((op)->ob_type->tp_name,"SwigPyPacked") == 0);
    1844             : }
    1845             : 
    1846             : SWIGRUNTIME void
    1847           0 : SwigPyPacked_dealloc(PyObject *v)
    1848             : {
    1849           0 :   if (SwigPyPacked_Check(v)) {
    1850           0 :     SwigPyPacked *sobj = (SwigPyPacked *) v;
    1851           0 :     free(sobj->pack);
    1852             :   }
    1853           0 :   PyObject_DEL(v);
    1854           0 : }
    1855             : 
    1856             : SWIGRUNTIME PyTypeObject*
    1857          28 : SwigPyPacked_TypeOnce(void) {
    1858          28 :   static char swigpacked_doc[] = "Swig object carries a C/C++ instance pointer";
    1859          28 :   static PyTypeObject swigpypacked_type;
    1860          28 :   static int type_init = 0;
    1861          28 :   if (!type_init) {
    1862          28 :     const PyTypeObject tmp = {
    1863             : #if PY_VERSION_HEX>=0x03000000
    1864             :       PyVarObject_HEAD_INIT(NULL, 0)
    1865             : #else
    1866             :       PyObject_HEAD_INIT(NULL)
    1867             :       0,                                    /* ob_size */
    1868             : #endif
    1869             :       "SwigPyPacked",                       /* tp_name */
    1870             :       sizeof(SwigPyPacked),                 /* tp_basicsize */
    1871             :       0,                                    /* tp_itemsize */
    1872             :       (destructor)SwigPyPacked_dealloc,     /* tp_dealloc */
    1873             :       0,                                    /* tp_print */
    1874             :       (getattrfunc)0,                       /* tp_getattr */
    1875             :       (setattrfunc)0,                       /* tp_setattr */
    1876             : #if PY_VERSION_HEX>=0x03000000
    1877             :       0, /* tp_reserved in 3.0.1 */
    1878             : #else
    1879             :       (cmpfunc)SwigPyPacked_compare,        /* tp_compare */
    1880             : #endif
    1881             :       (reprfunc)SwigPyPacked_repr,          /* tp_repr */
    1882             :       0,                                    /* tp_as_number */
    1883             :       0,                                    /* tp_as_sequence */
    1884             :       0,                                    /* tp_as_mapping */
    1885             :       (hashfunc)0,                          /* tp_hash */
    1886             :       (ternaryfunc)0,                       /* tp_call */
    1887             :       (reprfunc)SwigPyPacked_str,           /* tp_str */
    1888             :       PyObject_GenericGetAttr,              /* tp_getattro */
    1889             :       0,                                    /* tp_setattro */
    1890             :       0,                                    /* tp_as_buffer */
    1891             :       Py_TPFLAGS_DEFAULT,                   /* tp_flags */
    1892             :       swigpacked_doc,                       /* tp_doc */
    1893             :       0,                                    /* tp_traverse */
    1894             :       0,                                    /* tp_clear */
    1895             :       0,                                    /* tp_richcompare */
    1896             :       0,                                    /* tp_weaklistoffset */
    1897             :       0,                                    /* tp_iter */
    1898             :       0,                                    /* tp_iternext */
    1899             :       0,                                    /* tp_methods */
    1900             :       0,                                    /* tp_members */
    1901             :       0,                                    /* tp_getset */
    1902             :       0,                                    /* tp_base */
    1903             :       0,                                    /* tp_dict */
    1904             :       0,                                    /* tp_descr_get */
    1905             :       0,                                    /* tp_descr_set */
    1906             :       0,                                    /* tp_dictoffset */
    1907             :       0,                                    /* tp_init */
    1908             :       0,                                    /* tp_alloc */
    1909             :       0,                                    /* tp_new */
    1910             :       0,                                    /* tp_free */
    1911             :       0,                                    /* tp_is_gc */
    1912             :       0,                                    /* tp_bases */
    1913             :       0,                                    /* tp_mro */
    1914             :       0,                                    /* tp_cache */
    1915             :       0,                                    /* tp_subclasses */
    1916             :       0,                                    /* tp_weaklist */
    1917             :       0,                                    /* tp_del */
    1918             :       0,                                    /* tp_version_tag */
    1919             : #if PY_VERSION_HEX >= 0x03040000
    1920             :       0,                                    /* tp_finalize */
    1921             : #endif
    1922             : #ifdef COUNT_ALLOCS
    1923             :       0,                                    /* tp_allocs */
    1924             :       0,                                    /* tp_frees */
    1925             :       0,                                    /* tp_maxalloc */
    1926             :       0,                                    /* tp_prev */
    1927             :       0                                     /* tp_next */
    1928             : #endif
    1929             :     };
    1930          28 :     swigpypacked_type = tmp;
    1931          28 :     type_init = 1;
    1932          28 :     if (PyType_Ready(&swigpypacked_type) < 0)
    1933           0 :       return NULL;
    1934             :   }
    1935             :   return &swigpypacked_type;
    1936             : }
    1937             : 
    1938             : SWIGRUNTIME PyObject *
    1939           0 : SwigPyPacked_New(void *ptr, size_t size, swig_type_info *ty)
    1940             : {
    1941           0 :   SwigPyPacked *sobj = PyObject_NEW(SwigPyPacked, SwigPyPacked_type());
    1942           0 :   if (sobj) {
    1943           0 :     void *pack = malloc(size);
    1944           0 :     if (pack) {
    1945           0 :       memcpy(pack, ptr, size);
    1946           0 :       sobj->pack = pack;
    1947           0 :       sobj->ty   = ty;
    1948           0 :       sobj->size = size;
    1949             :     } else {
    1950           0 :       PyObject_DEL((PyObject *) sobj);
    1951           0 :       sobj = 0;
    1952             :     }
    1953             :   }
    1954           0 :   return (PyObject *) sobj;
    1955             : }
    1956             : 
    1957             : SWIGRUNTIME swig_type_info *
    1958             : SwigPyPacked_UnpackData(PyObject *obj, void *ptr, size_t size)
    1959             : {
    1960             :   if (SwigPyPacked_Check(obj)) {
    1961             :     SwigPyPacked *sobj = (SwigPyPacked *)obj;
    1962             :     if (sobj->size != size) return 0;
    1963             :     memcpy(ptr, sobj->pack, size);
    1964             :     return sobj->ty;
    1965             :   } else {
    1966             :     return 0;
    1967             :   }
    1968             : }
    1969             : 
    1970             : /* -----------------------------------------------------------------------------
    1971             :  * pointers/data manipulation
    1972             :  * ----------------------------------------------------------------------------- */
    1973             : 
    1974             : static PyObject *Swig_This_global = NULL;
    1975             : 
    1976             : SWIGRUNTIME PyObject *
    1977          48 : SWIG_This(void)
    1978             : {
    1979          48 :   if (Swig_This_global == NULL)
    1980          28 :     Swig_This_global = SWIG_Python_str_FromChar("this");
    1981          48 :   return Swig_This_global;
    1982             : }
    1983             : 
    1984             : /* #define SWIG_PYTHON_SLOW_GETSET_THIS */
    1985             : 
    1986             : /* TODO: I don't know how to implement the fast getset in Python 3 right now */
    1987             : #if PY_VERSION_HEX>=0x03000000
    1988             : #define SWIG_PYTHON_SLOW_GETSET_THIS 
    1989             : #endif
    1990             : 
    1991             : SWIGRUNTIME SwigPyObject *
    1992          20 : SWIG_Python_GetSwigThis(PyObject *pyobj) 
    1993             : {
    1994          20 :   PyObject *obj;
    1995             : 
    1996          20 :   if (SwigPyObject_Check(pyobj))
    1997             :     return (SwigPyObject *) pyobj;
    1998             : 
    1999             : #ifdef SWIGPYTHON_BUILTIN
    2000             :   (void)obj;
    2001             : # ifdef PyWeakref_CheckProxy
    2002             :   if (PyWeakref_CheckProxy(pyobj)) {
    2003             :     pyobj = PyWeakref_GET_OBJECT(pyobj);
    2004             :     if (pyobj && SwigPyObject_Check(pyobj))
    2005             :       return (SwigPyObject*) pyobj;
    2006             :   }
    2007             : # endif
    2008             :   return NULL;
    2009             : #else
    2010             : 
    2011          20 :   obj = 0;
    2012             : 
    2013             : #if !defined(SWIG_PYTHON_SLOW_GETSET_THIS)
    2014             :   if (PyInstance_Check(pyobj)) {
    2015             :     obj = _PyInstance_Lookup(pyobj, SWIG_This());      
    2016             :   } else {
    2017             :     PyObject **dictptr = _PyObject_GetDictPtr(pyobj);
    2018             :     if (dictptr != NULL) {
    2019             :       PyObject *dict = *dictptr;
    2020             :       obj = dict ? PyDict_GetItem(dict, SWIG_This()) : 0;
    2021             :     } else {
    2022             : #ifdef PyWeakref_CheckProxy
    2023             :       if (PyWeakref_CheckProxy(pyobj)) {
    2024             :   PyObject *wobj = PyWeakref_GET_OBJECT(pyobj);
    2025             :   return wobj ? SWIG_Python_GetSwigThis(wobj) : 0;
    2026             :       }
    2027             : #endif
    2028             :       obj = PyObject_GetAttr(pyobj,SWIG_This());
    2029             :       if (obj) {
    2030             :   Py_DECREF(obj);
    2031             :       } else {
    2032             :   if (PyErr_Occurred()) PyErr_Clear();
    2033             :   return 0;
    2034             :       }
    2035             :     }
    2036             :   }
    2037             : #else
    2038          20 :   obj = PyObject_GetAttr(pyobj,SWIG_This());
    2039          20 :   if (obj) {
    2040          20 :     Py_DECREF(obj);
    2041             :   } else {
    2042           0 :     if (PyErr_Occurred()) PyErr_Clear();
    2043           0 :     return 0;
    2044             :   }
    2045             : #endif
    2046          20 :   if (obj && !SwigPyObject_Check(obj)) {
    2047             :     /* a PyObject is called 'this', try to get the 'real this'
    2048             :        SwigPyObject from it */ 
    2049             :     return SWIG_Python_GetSwigThis(obj);
    2050             :   }
    2051             :   return (SwigPyObject *)obj;
    2052             : #endif
    2053             : }
    2054             : 
    2055             : /* Acquire a pointer value */
    2056             : 
    2057             : SWIGRUNTIME int
    2058             : SWIG_Python_AcquirePtr(PyObject *obj, int own) {
    2059             :   if (own == SWIG_POINTER_OWN) {
    2060             :     SwigPyObject *sobj = SWIG_Python_GetSwigThis(obj);
    2061             :     if (sobj) {
    2062             :       int oldown = sobj->own;
    2063             :       sobj->own = own;
    2064             :       return oldown;
    2065             :     }
    2066             :   }
    2067             :   return 0;
    2068             : }
    2069             : 
    2070             : /* Convert a pointer value */
    2071             : 
    2072             : SWIGRUNTIME int
    2073          20 : SWIG_Python_ConvertPtrAndOwn(PyObject *obj, void **ptr, swig_type_info *ty, int flags, int *own) {
    2074          20 :   int res;
    2075          20 :   SwigPyObject *sobj;
    2076          20 :   int implicit_conv = (flags & SWIG_POINTER_IMPLICIT_CONV) != 0;
    2077             : 
    2078          20 :   if (!obj)
    2079             :     return SWIG_ERROR;
    2080          20 :   if (obj == Py_None && !implicit_conv) {
    2081           0 :     if (ptr)
    2082           0 :       *ptr = 0;
    2083           0 :     return (flags & SWIG_POINTER_NO_NULL) ? SWIG_NullReferenceError : SWIG_OK;
    2084             :   }
    2085             : 
    2086          20 :   res = SWIG_ERROR;
    2087             : 
    2088          20 :   sobj = SWIG_Python_GetSwigThis(obj);
    2089          20 :   if (own)
    2090           0 :     *own = 0;
    2091          20 :   while (sobj) {
    2092          20 :     void *vptr = sobj->ptr;
    2093          20 :     if (ty) {
    2094          20 :       swig_type_info *to = sobj->ty;
    2095          20 :       if (to == ty) {
    2096             :         /* no type cast needed */
    2097          14 :         if (ptr) *ptr = vptr;
    2098             :         break;
    2099             :       } else {
    2100           6 :         swig_cast_info *tc = SWIG_TypeCheck(to->name,ty);
    2101           6 :         if (!tc) {
    2102           0 :           sobj = (SwigPyObject *)sobj->next;
    2103             :         } else {
    2104           6 :           if (ptr) {
    2105           6 :             int newmemory = 0;
    2106           6 :             *ptr = SWIG_TypeCast(tc,vptr,&newmemory);
    2107           6 :             if (newmemory == SWIG_CAST_NEW_MEMORY) {
    2108           0 :               assert(own); /* badly formed typemap which will lead to a memory leak - it must set and use own to delete *ptr */
    2109           0 :               if (own)
    2110           0 :                 *own = *own | SWIG_CAST_NEW_MEMORY;
    2111             :             }
    2112             :           }
    2113             :           break;
    2114             :         }
    2115             :       }
    2116             :     } else {
    2117           0 :       if (ptr) *ptr = vptr;
    2118             :       break;
    2119             :     }
    2120             :   }
    2121          20 :   if (sobj) {
    2122          20 :     if (own)
    2123           0 :       *own = *own | sobj->own;
    2124          20 :     if (flags & SWIG_POINTER_DISOWN) {
    2125           3 :       sobj->own = 0;
    2126             :     }
    2127             :     res = SWIG_OK;
    2128             :   } else {
    2129           0 :     if (implicit_conv) {
    2130           0 :       SwigPyClientData *data = ty ? (SwigPyClientData *) ty->clientdata : 0;
    2131           0 :       if (data && !data->implicitconv) {
    2132           0 :         PyObject *klass = data->klass;
    2133           0 :         if (klass) {
    2134           0 :           PyObject *impconv;
    2135           0 :           data->implicitconv = 1; /* avoid recursion and call 'explicit' constructors*/
    2136           0 :           impconv = SWIG_Python_CallFunctor(klass, obj);
    2137           0 :           data->implicitconv = 0;
    2138           0 :           if (PyErr_Occurred()) {
    2139           0 :             PyErr_Clear();
    2140           0 :             impconv = 0;
    2141             :           }
    2142           0 :           if (impconv) {
    2143           0 :             SwigPyObject *iobj = SWIG_Python_GetSwigThis(impconv);
    2144           0 :             if (iobj) {
    2145           0 :               void *vptr;
    2146           0 :               res = SWIG_Python_ConvertPtrAndOwn((PyObject*)iobj, &vptr, ty, 0, 0);
    2147           0 :               if (SWIG_IsOK(res)) {
    2148           0 :                 if (ptr) {
    2149           0 :                   *ptr = vptr;
    2150             :                   /* transfer the ownership to 'ptr' */
    2151           0 :                   iobj->own = 0;
    2152           0 :                   res = SWIG_AddCast(res);
    2153           0 :                   res = SWIG_AddNewMask(res);
    2154             :                 } else {
    2155             :                   res = SWIG_AddCast(res);        
    2156             :                 }
    2157             :               }
    2158             :             }
    2159           0 :             Py_DECREF(impconv);
    2160             :           }
    2161             :         }
    2162             :       }
    2163           0 :       if (!SWIG_IsOK(res) && obj == Py_None) {
    2164           0 :         if (ptr)
    2165           0 :           *ptr = 0;
    2166           0 :         if (PyErr_Occurred())
    2167           0 :           PyErr_Clear();
    2168             :         res = SWIG_OK;
    2169             :       }
    2170             :     }
    2171             :   }
    2172             :   return res;
    2173             : }
    2174             : 
    2175             : /* Convert a function ptr value */
    2176             : 
    2177             : SWIGRUNTIME int
    2178             : SWIG_Python_ConvertFunctionPtr(PyObject *obj, void **ptr, swig_type_info *ty) {
    2179             :   if (!PyCFunction_Check(obj)) {
    2180             :     return SWIG_ConvertPtr(obj, ptr, ty, 0);
    2181             :   } else {
    2182             :     void *vptr = 0;
    2183             :     swig_cast_info *tc;
    2184             : 
    2185             :     /* here we get the method pointer for callbacks */
    2186             :     const char *doc = (((PyCFunctionObject *)obj) -> m_ml -> ml_doc);
    2187             :     const char *desc = doc ? strstr(doc, "swig_ptr: ") : 0;
    2188             :     if (desc)
    2189             :       desc = ty ? SWIG_UnpackVoidPtr(desc + 10, &vptr, ty->name) : 0;
    2190             :     if (!desc)
    2191             :       return SWIG_ERROR;
    2192             :     tc = SWIG_TypeCheck(desc,ty);
    2193             :     if (tc) {
    2194             :       int newmemory = 0;
    2195             :       *ptr = SWIG_TypeCast(tc,vptr,&newmemory);
    2196             :       assert(!newmemory); /* newmemory handling not yet implemented */
    2197             :     } else {
    2198             :       return SWIG_ERROR;
    2199             :     }
    2200             :     return SWIG_OK;
    2201             :   }
    2202             : }
    2203             : 
    2204             : /* Convert a packed pointer value */
    2205             : 
    2206             : SWIGRUNTIME int
    2207             : SWIG_Python_ConvertPacked(PyObject *obj, void *ptr, size_t sz, swig_type_info *ty) {
    2208             :   swig_type_info *to = SwigPyPacked_UnpackData(obj, ptr, sz);
    2209             :   if (!to) return SWIG_ERROR;
    2210             :   if (ty) {
    2211             :     if (to != ty) {
    2212             :       /* check type cast? */
    2213             :       swig_cast_info *tc = SWIG_TypeCheck(to->name,ty);
    2214             :       if (!tc) return SWIG_ERROR;
    2215             :     }
    2216             :   }
    2217             :   return SWIG_OK;
    2218             : }  
    2219             : 
    2220             : /* -----------------------------------------------------------------------------
    2221             :  * Create a new pointer object
    2222             :  * ----------------------------------------------------------------------------- */
    2223             : 
    2224             : /*
    2225             :   Create a new instance object, without calling __init__, and set the
    2226             :   'this' attribute.
    2227             : */
    2228             : 
    2229             : SWIGRUNTIME PyObject* 
    2230             : SWIG_Python_NewShadowInstance(SwigPyClientData *data, PyObject *swig_this)
    2231             : {
    2232             :   PyObject *inst = 0;
    2233             :   PyObject *newraw = data->newraw;
    2234             :   if (newraw) {
    2235             :     inst = PyObject_Call(newraw, data->newargs, NULL);
    2236             :     if (inst) {
    2237             : #if !defined(SWIG_PYTHON_SLOW_GETSET_THIS)
    2238             :       PyObject **dictptr = _PyObject_GetDictPtr(inst);
    2239             :       if (dictptr != NULL) {
    2240             :   PyObject *dict = *dictptr;
    2241             :   if (dict == NULL) {
    2242             :     dict = PyDict_New();
    2243             :     *dictptr = dict;
    2244             :     PyDict_SetItem(dict, SWIG_This(), swig_this);
    2245             :   }
    2246             :       }
    2247             : #else
    2248             :       PyObject *key = SWIG_This();
    2249             :       PyObject_SetAttr(inst, key, swig_this);
    2250             : #endif
    2251             :     }
    2252             :   } else {
    2253             : #if PY_VERSION_HEX >= 0x03000000
    2254             :     PyObject *empty_args = PyTuple_New(0);
    2255             :     if (empty_args) {
    2256             :       PyObject *empty_kwargs = PyDict_New();
    2257             :       if (empty_kwargs) {
    2258             :         inst = ((PyTypeObject *)data->newargs)->tp_new((PyTypeObject *)data->newargs, empty_args, empty_kwargs);
    2259             :         Py_DECREF(empty_kwargs);
    2260             :         if (inst) {
    2261             :           PyObject_SetAttr(inst, SWIG_This(), swig_this);
    2262             :           Py_TYPE(inst)->tp_flags &= ~Py_TPFLAGS_VALID_VERSION_TAG;
    2263             :         }
    2264             :       }
    2265             :       Py_DECREF(empty_args);
    2266             :     }
    2267             : #else
    2268             :     PyObject *dict = PyDict_New();
    2269             :     if (dict) {
    2270             :       PyDict_SetItem(dict, SWIG_This(), swig_this);
    2271             :       inst = PyInstance_NewRaw(data->newargs, dict);
    2272             :       Py_DECREF(dict);
    2273             :     }
    2274             : #endif
    2275             :   }
    2276             :   return inst;
    2277             : }
    2278             : 
    2279             : SWIGRUNTIME void
    2280             : SWIG_Python_SetSwigThis(PyObject *inst, PyObject *swig_this)
    2281             : {
    2282             :  PyObject *dict;
    2283             : #if !defined(SWIG_PYTHON_SLOW_GETSET_THIS)
    2284             :  PyObject **dictptr = _PyObject_GetDictPtr(inst);
    2285             :  if (dictptr != NULL) {
    2286             :    dict = *dictptr;
    2287             :    if (dict == NULL) {
    2288             :      dict = PyDict_New();
    2289             :      *dictptr = dict;
    2290             :    }
    2291             :    PyDict_SetItem(dict, SWIG_This(), swig_this);
    2292             :    return;
    2293             :  }
    2294             : #endif
    2295             :  dict = PyObject_GetAttrString(inst, "__dict__");
    2296             :  PyDict_SetItem(dict, SWIG_This(), swig_this);
    2297             :  Py_DECREF(dict);
    2298             : } 
    2299             : 
    2300             : 
    2301             : SWIGINTERN PyObject *
    2302             : SWIG_Python_InitShadowInstance(PyObject *args) {
    2303             :   PyObject *obj[2];
    2304             :   if (!SWIG_Python_UnpackTuple(args, "swiginit", 2, 2, obj)) {
    2305             :     return NULL;
    2306             :   } else {
    2307             :     SwigPyObject *sthis = SWIG_Python_GetSwigThis(obj[0]);
    2308             :     if (sthis) {
    2309             :       SwigPyObject_append((PyObject*) sthis, obj[1]);
    2310             :     } else {
    2311             :       SWIG_Python_SetSwigThis(obj[0], obj[1]);
    2312             :     }
    2313             :     return SWIG_Py_Void();
    2314             :   }
    2315             : }
    2316             : 
    2317             : /* Create a new pointer object */
    2318             : 
    2319             : SWIGRUNTIME PyObject *
    2320           9 : SWIG_Python_NewPointerObj(PyObject *self, void *ptr, swig_type_info *type, int flags) {
    2321           9 :   SwigPyClientData *clientdata;
    2322           9 :   PyObject * robj;
    2323           9 :   int own;
    2324             : 
    2325           9 :   if (!ptr)
    2326           0 :     return SWIG_Py_Void();
    2327             : 
    2328           9 :   clientdata = type ? (SwigPyClientData *)(type->clientdata) : 0;
    2329           9 :   own = (flags & SWIG_POINTER_OWN) ? SWIG_POINTER_OWN : 0;
    2330           9 :   if (clientdata && clientdata->pytype) {
    2331           0 :     SwigPyObject *newobj;
    2332           0 :     if (flags & SWIG_BUILTIN_TP_INIT) {
    2333           0 :       newobj = (SwigPyObject*) self;
    2334           0 :       if (newobj->ptr) {
    2335           0 :         PyObject *next_self = clientdata->pytype->tp_alloc(clientdata->pytype, 0);
    2336           0 :         while (newobj->next)
    2337             :     newobj = (SwigPyObject *) newobj->next;
    2338           0 :         newobj->next = next_self;
    2339           0 :         newobj = (SwigPyObject *)next_self;
    2340             : #ifdef SWIGPYTHON_BUILTIN
    2341             :         newobj->dict = 0;
    2342             : #endif
    2343             :       }
    2344             :     } else {
    2345           0 :       newobj = PyObject_New(SwigPyObject, clientdata->pytype);
    2346             : #ifdef SWIGPYTHON_BUILTIN
    2347             :       newobj->dict = 0;
    2348             : #endif
    2349             :     }
    2350           0 :     if (newobj) {
    2351           0 :       newobj->ptr = ptr;
    2352           0 :       newobj->ty = type;
    2353           0 :       newobj->own = own;
    2354           0 :       newobj->next = 0;
    2355           0 :       return (PyObject*) newobj;
    2356             :     }
    2357           0 :     return SWIG_Py_Void();
    2358             :   }
    2359             : 
    2360           9 :   assert(!(flags & SWIG_BUILTIN_TP_INIT));
    2361             : 
    2362           9 :   robj = SwigPyObject_New(ptr, type, own);
    2363           9 :   if (robj && clientdata && !(flags & SWIG_POINTER_NOSHADOW)) {
    2364           9 :     PyObject *inst = SWIG_Python_NewShadowInstance(clientdata, robj);
    2365           9 :     Py_DECREF(robj);
    2366             :     robj = inst;
    2367             :   }
    2368             :   return robj;
    2369             : }
    2370             : 
    2371             : /* Create a new packed object */
    2372             : 
    2373             : SWIGRUNTIMEINLINE PyObject *
    2374           0 : SWIG_Python_NewPackedObj(void *ptr, size_t sz, swig_type_info *type) {
    2375           0 :   return ptr ? SwigPyPacked_New((void *) ptr, sz, type) : SWIG_Py_Void();
    2376             : }
    2377             : 
    2378             : /* -----------------------------------------------------------------------------*
    2379             :  *  Get type list 
    2380             :  * -----------------------------------------------------------------------------*/
    2381             : 
    2382             : #ifdef SWIG_LINK_RUNTIME
    2383             : void *SWIG_ReturnGlobalTypeList(void *);
    2384             : #endif
    2385             : 
    2386             : SWIGRUNTIME swig_module_info *
    2387             : SWIG_Python_GetModule(void *SWIGUNUSEDPARM(clientdata)) {
    2388             :   static void *type_pointer = (void *)0;
    2389             :   /* first check if module already created */
    2390             :   if (!type_pointer) {
    2391             : #ifdef SWIG_LINK_RUNTIME
    2392             :     type_pointer = SWIG_ReturnGlobalTypeList((void *)0);
    2393             : #else
    2394             :     type_pointer = PyCapsule_Import(SWIGPY_CAPSULE_NAME, 0);
    2395             :     if (PyErr_Occurred()) {
    2396             :       PyErr_Clear();
    2397             :       type_pointer = (void *)0;
    2398             :     }
    2399             : #endif
    2400             :   }
    2401             :   return (swig_module_info *) type_pointer;
    2402             : }
    2403             : 
    2404             : SWIGRUNTIME void
    2405           0 : SWIG_Python_DestroyModule(PyObject *obj)
    2406             : {
    2407           0 :   swig_module_info *swig_module = (swig_module_info *) PyCapsule_GetPointer(obj, SWIGPY_CAPSULE_NAME);
    2408           0 :   swig_type_info **types = swig_module->types;
    2409           0 :   size_t i;
    2410           0 :   for (i =0; i < swig_module->size; ++i) {
    2411           0 :     swig_type_info *ty = types[i];
    2412           0 :     if (ty->owndata) {
    2413           0 :       SwigPyClientData *data = (SwigPyClientData *) ty->clientdata;
    2414           0 :       if (data) SwigPyClientData_Del(data);
    2415             :     }
    2416             :   }
    2417           0 :   Py_DECREF(SWIG_This());
    2418           0 :   Swig_This_global = NULL;
    2419           0 : }
    2420             : 
    2421             : SWIGRUNTIME void
    2422           0 : SWIG_Python_SetModule(swig_module_info *swig_module) {
    2423             : #if PY_VERSION_HEX >= 0x03000000
    2424             :  /* Add a dummy module object into sys.modules */
    2425           0 :   PyObject *module = PyImport_AddModule("swig_runtime_data" SWIG_RUNTIME_VERSION);
    2426             : #else
    2427             :   static PyMethodDef swig_empty_runtime_method_table[] = { {NULL, NULL, 0, NULL} }; /* Sentinel */
    2428             :   PyObject *module = Py_InitModule("swig_runtime_data" SWIG_RUNTIME_VERSION, swig_empty_runtime_method_table);
    2429             : #endif
    2430           0 :   PyObject *pointer = PyCapsule_New((void *) swig_module, SWIGPY_CAPSULE_NAME, SWIG_Python_DestroyModule);
    2431           0 :   if (pointer && module) {
    2432           0 :     PyModule_AddObject(module, "type_pointer_capsule" SWIG_TYPE_TABLE_NAME, pointer);
    2433             :   } else {
    2434           0 :     Py_XDECREF(pointer);
    2435             :   }
    2436           0 : }
    2437             : 
    2438             : /* The python cached type query */
    2439             : SWIGRUNTIME PyObject *
    2440          28 : SWIG_Python_TypeCache(void) {
    2441          28 :   static PyObject *SWIG_STATIC_POINTER(cache) = PyDict_New();
    2442          28 :   return cache;
    2443             : }
    2444             : 
    2445             : SWIGRUNTIME swig_type_info *
    2446           0 : SWIG_Python_TypeQuery(const char *type)
    2447             : {
    2448           0 :   PyObject *cache = SWIG_Python_TypeCache();
    2449           0 :   PyObject *key = SWIG_Python_str_FromChar(type); 
    2450           0 :   PyObject *obj = PyDict_GetItem(cache, key);
    2451           0 :   swig_type_info *descriptor;
    2452           0 :   if (obj) {
    2453           0 :     descriptor = (swig_type_info *) PyCapsule_GetPointer(obj, NULL);
    2454             :   } else {
    2455           0 :     swig_module_info *swig_module = SWIG_GetModule(0);
    2456           0 :     descriptor = SWIG_TypeQueryModule(swig_module, swig_module, type);
    2457           0 :     if (descriptor) {
    2458           0 :       obj = PyCapsule_New((void*) descriptor, NULL, NULL);
    2459           0 :       PyDict_SetItem(cache, key, obj);
    2460           0 :       Py_DECREF(obj);
    2461             :     }
    2462             :   }
    2463           0 :   Py_DECREF(key);
    2464           0 :   return descriptor;
    2465             : }
    2466             : 
    2467             : /* 
    2468             :    For backward compatibility only
    2469             : */
    2470             : #define SWIG_POINTER_EXCEPTION  0
    2471             : #define SWIG_arg_fail(arg)      SWIG_Python_ArgFail(arg)
    2472             : #define SWIG_MustGetPtr(p, type, argnum, flags)  SWIG_Python_MustGetPtr(p, type, argnum, flags)
    2473             : 
    2474             : SWIGRUNTIME int
    2475             : SWIG_Python_AddErrMesg(const char* mesg, int infront)
    2476             : {  
    2477             :   if (PyErr_Occurred()) {
    2478             :     PyObject *type = 0;
    2479             :     PyObject *value = 0;
    2480             :     PyObject *traceback = 0;
    2481             :     PyErr_Fetch(&type, &value, &traceback);
    2482             :     if (value) {
    2483             :       PyObject *old_str = PyObject_Str(value);
    2484             :       const char *tmp = SWIG_Python_str_AsChar(old_str);
    2485             :       const char *errmesg = tmp ? tmp : "Invalid error message";
    2486             :       Py_XINCREF(type);
    2487             :       PyErr_Clear();
    2488             :       if (infront) {
    2489             :   PyErr_Format(type, "%s %s", mesg, errmesg);
    2490             :       } else {
    2491             :   PyErr_Format(type, "%s %s", errmesg, mesg);
    2492             :       }
    2493             :       SWIG_Python_str_DelForPy3(tmp);
    2494             :       Py_DECREF(old_str);
    2495             :     }
    2496             :     return 1;
    2497             :   } else {
    2498             :     return 0;
    2499             :   }
    2500             : }
    2501             :   
    2502             : SWIGRUNTIME int
    2503             : SWIG_Python_ArgFail(int argnum)
    2504             : {
    2505             :   if (PyErr_Occurred()) {
    2506             :     /* add information about failing argument */
    2507             :     char mesg[256];
    2508             :     PyOS_snprintf(mesg, sizeof(mesg), "argument number %d:", argnum);
    2509             :     return SWIG_Python_AddErrMesg(mesg, 1);
    2510             :   } else {
    2511             :     return 0;
    2512             :   }
    2513             : }
    2514             : 
    2515             : SWIGRUNTIMEINLINE const char *
    2516             : SwigPyObject_GetDesc(PyObject *self)
    2517             : {
    2518             :   SwigPyObject *v = (SwigPyObject *)self;
    2519             :   swig_type_info *ty = v ? v->ty : 0;
    2520             :   return ty ? ty->str : "";
    2521             : }
    2522             : 
    2523             : SWIGRUNTIME void
    2524             : SWIG_Python_TypeError(const char *type, PyObject *obj)
    2525             : {
    2526             :   if (type) {
    2527             : #if defined(SWIG_COBJECT_TYPES)
    2528             :     if (obj && SwigPyObject_Check(obj)) {
    2529             :       const char *otype = (const char *) SwigPyObject_GetDesc(obj);
    2530             :       if (otype) {
    2531             :   PyErr_Format(PyExc_TypeError, "a '%s' is expected, 'SwigPyObject(%s)' is received",
    2532             :          type, otype);
    2533             :   return;
    2534             :       }
    2535             :     } else 
    2536             : #endif      
    2537             :     {
    2538             :       const char *otype = (obj ? obj->ob_type->tp_name : 0); 
    2539             :       if (otype) {
    2540             :   PyObject *str = PyObject_Str(obj);
    2541             :   const char *cstr = str ? SWIG_Python_str_AsChar(str) : 0;
    2542             :   if (cstr) {
    2543             :     PyErr_Format(PyExc_TypeError, "a '%s' is expected, '%s(%s)' is received",
    2544             :            type, otype, cstr);
    2545             :           SWIG_Python_str_DelForPy3(cstr);
    2546             :   } else {
    2547             :     PyErr_Format(PyExc_TypeError, "a '%s' is expected, '%s' is received",
    2548             :            type, otype);
    2549             :   }
    2550             :   Py_XDECREF(str);
    2551             :   return;
    2552             :       }
    2553             :     }   
    2554             :     PyErr_Format(PyExc_TypeError, "a '%s' is expected", type);
    2555             :   } else {
    2556             :     PyErr_Format(PyExc_TypeError, "unexpected type is received");
    2557             :   }
    2558             : }
    2559             : 
    2560             : 
    2561             : /* Convert a pointer value, signal an exception on a type mismatch */
    2562             : SWIGRUNTIME void *
    2563             : SWIG_Python_MustGetPtr(PyObject *obj, swig_type_info *ty, int SWIGUNUSEDPARM(argnum), int flags) {
    2564             :   void *result;
    2565             :   if (SWIG_Python_ConvertPtr(obj, &result, ty, flags) == -1) {
    2566             :     PyErr_Clear();
    2567             : #if SWIG_POINTER_EXCEPTION
    2568             :     if (flags) {
    2569             :       SWIG_Python_TypeError(SWIG_TypePrettyName(ty), obj);
    2570             :       SWIG_Python_ArgFail(argnum);
    2571             :     }
    2572             : #endif
    2573             :   }
    2574             :   return result;
    2575             : }
    2576             : 
    2577             : #ifdef SWIGPYTHON_BUILTIN
    2578             : SWIGRUNTIME int
    2579             : SWIG_Python_NonDynamicSetAttr(PyObject *obj, PyObject *name, PyObject *value) {
    2580             :   PyTypeObject *tp = obj->ob_type;
    2581             :   PyObject *descr;
    2582             :   PyObject *encoded_name;
    2583             :   descrsetfunc f;
    2584             :   int res = -1;
    2585             : 
    2586             : # ifdef Py_USING_UNICODE
    2587             :   if (PyString_Check(name)) {
    2588             :     name = PyUnicode_Decode(PyString_AsString(name), PyString_Size(name), NULL, NULL);
    2589             :     if (!name)
    2590             :       return -1;
    2591             :   } else if (!PyUnicode_Check(name))
    2592             : # else
    2593             :   if (!PyString_Check(name))
    2594             : # endif
    2595             :   {
    2596             :     PyErr_Format(PyExc_TypeError, "attribute name must be string, not '%.200s'", name->ob_type->tp_name);
    2597             :     return -1;
    2598             :   } else {
    2599             :     Py_INCREF(name);
    2600             :   }
    2601             : 
    2602             :   if (!tp->tp_dict) {
    2603             :     if (PyType_Ready(tp) < 0)
    2604             :       goto done;
    2605             :   }
    2606             : 
    2607             :   descr = _PyType_Lookup(tp, name);
    2608             :   f = NULL;
    2609             :   if (descr != NULL)
    2610             :     f = descr->ob_type->tp_descr_set;
    2611             :   if (!f) {
    2612             :     if (PyString_Check(name)) {
    2613             :       encoded_name = name;
    2614             :       Py_INCREF(name);
    2615             :     } else {
    2616             :       encoded_name = PyUnicode_AsUTF8String(name);
    2617             :       if (!encoded_name)
    2618             :         return -1;
    2619             :     }
    2620             :     PyErr_Format(PyExc_AttributeError, "'%.100s' object has no attribute '%.200s'", tp->tp_name, PyString_AsString(encoded_name));
    2621             :     Py_DECREF(encoded_name);
    2622             :   } else {
    2623             :     res = f(descr, obj, value);
    2624             :   }
    2625             :   
    2626             :   done:
    2627             :   Py_DECREF(name);
    2628             :   return res;
    2629             : }
    2630             : #endif
    2631             : 
    2632             : 
    2633             : #ifdef __cplusplus
    2634             : }
    2635             : #endif
    2636             : 
    2637             : 
    2638             : 
    2639             : #define SWIG_exception_fail(code, msg) do { SWIG_Error(code, msg); SWIG_fail; } while(0) 
    2640             : 
    2641             : #define SWIG_contract_assert(expr, msg) if (!(expr)) { SWIG_Error(SWIG_RuntimeError, msg); SWIG_fail; } else 
    2642             : 
    2643             : 
    2644             : 
    2645             : #ifdef __cplusplus
    2646             : extern "C" {
    2647             : #endif
    2648             : 
    2649             : /* Method creation and docstring support functions */
    2650             : 
    2651             : SWIGINTERN PyMethodDef *SWIG_PythonGetProxyDoc(const char *name);
    2652             : SWIGINTERN PyObject *SWIG_PyInstanceMethod_New(PyObject *SWIGUNUSEDPARM(self), PyObject *func);
    2653             : SWIGINTERN PyObject *SWIG_PyStaticMethod_New(PyObject *SWIGUNUSEDPARM(self), PyObject *func);
    2654             : 
    2655             : #ifdef __cplusplus
    2656             : }
    2657             : #endif
    2658             : 
    2659             : 
    2660             :   #define SWIG_exception(code, msg) do { SWIG_Error(code, msg); SWIG_fail;; } while(0) 
    2661             : 
    2662             : 
    2663             : /* -------- TYPES TABLE (BEGIN) -------- */
    2664             : 
    2665             : #define SWIGTYPE_p_GDALDatasetShadow swig_types[0]
    2666             : #define SWIGTYPE_p_GDALDriverShadow swig_types[1]
    2667             : #define SWIGTYPE_p_GDALMajorObjectShadow swig_types[2]
    2668             : #define SWIGTYPE_p_GIntBig swig_types[3]
    2669             : #define SWIGTYPE_p_GNMGenericNetworkShadow swig_types[4]
    2670             : #define SWIGTYPE_p_GNMGraphAlgorithmType swig_types[5]
    2671             : #define SWIGTYPE_p_GNMNetworkShadow swig_types[6]
    2672             : #define SWIGTYPE_p_OGRFeatureShadow swig_types[7]
    2673             : #define SWIGTYPE_p_OGRLayerShadow swig_types[8]
    2674             : #define SWIGTYPE_p_OSRSpatialReferenceShadow swig_types[9]
    2675             : #define SWIGTYPE_p_char swig_types[10]
    2676             : #define SWIGTYPE_p_int swig_types[11]
    2677             : static swig_type_info *swig_types[13];
    2678             : static swig_module_info swig_module = {swig_types, 12, 0, 0, 0, 0};
    2679             : #define SWIG_TypeQuery(name) SWIG_TypeQueryModule(&swig_module, &swig_module, name)
    2680             : #define SWIG_MangledTypeQuery(name) SWIG_MangledTypeQueryModule(&swig_module, &swig_module, name)
    2681             : 
    2682             : /* -------- TYPES TABLE (END) -------- */
    2683             : 
    2684             : #ifdef SWIG_TypeQuery
    2685             : # undef SWIG_TypeQuery
    2686             : #endif
    2687             : #define SWIG_TypeQuery SWIG_Python_TypeQuery
    2688             : 
    2689             : /*-----------------------------------------------
    2690             :               @(target):= _gnm.so
    2691             :   ------------------------------------------------*/
    2692             : #if PY_VERSION_HEX >= 0x03000000
    2693             : #  define SWIG_init    PyInit__gnm
    2694             : 
    2695             : #else
    2696             : #  define SWIG_init    init_gnm
    2697             : 
    2698             : #endif
    2699             : #define SWIG_name    "_gnm"
    2700             : 
    2701             : #define SWIGVERSION 0x040001 
    2702             : #define SWIG_VERSION SWIGVERSION
    2703             : 
    2704             : 
    2705             : #define SWIG_as_voidptr(a) const_cast< void * >(static_cast< const void * >(a)) 
    2706             : #define SWIG_as_voidptrptr(a) ((void)SWIG_as_voidptr(*a),reinterpret_cast< void** >(a)) 
    2707             : 
    2708             : 
    2709             : #include <stdexcept>
    2710             : 
    2711             : 
    2712             : namespace swig {
    2713             :   class SwigPtr_PyObject {
    2714             :   protected:
    2715             :     PyObject *_obj;
    2716             : 
    2717             :   public:
    2718             :     SwigPtr_PyObject() :_obj(0)
    2719             :     {
    2720             :     }
    2721             : 
    2722             :     SwigPtr_PyObject(const SwigPtr_PyObject& item) : _obj(item._obj)
    2723             :     {
    2724             :       SWIG_PYTHON_THREAD_BEGIN_BLOCK;
    2725             :       Py_XINCREF(_obj);      
    2726             :       SWIG_PYTHON_THREAD_END_BLOCK;
    2727             :     }
    2728             :     
    2729             :     SwigPtr_PyObject(PyObject *obj, bool initial_ref = true) :_obj(obj)
    2730             :     {
    2731             :       if (initial_ref) {
    2732             :         SWIG_PYTHON_THREAD_BEGIN_BLOCK;
    2733             :         Py_XINCREF(_obj);
    2734             :         SWIG_PYTHON_THREAD_END_BLOCK;
    2735             :       }
    2736             :     }
    2737             :     
    2738             :     SwigPtr_PyObject & operator=(const SwigPtr_PyObject& item) 
    2739             :     {
    2740             :       SWIG_PYTHON_THREAD_BEGIN_BLOCK;
    2741             :       Py_XINCREF(item._obj);
    2742             :       Py_XDECREF(_obj);
    2743             :       _obj = item._obj;
    2744             :       SWIG_PYTHON_THREAD_END_BLOCK;
    2745             :       return *this;      
    2746             :     }
    2747             :     
    2748             :     ~SwigPtr_PyObject() 
    2749             :     {
    2750             :       SWIG_PYTHON_THREAD_BEGIN_BLOCK;
    2751             :       Py_XDECREF(_obj);
    2752             :       SWIG_PYTHON_THREAD_END_BLOCK;
    2753             :     }
    2754             :     
    2755             :     operator PyObject *() const
    2756             :     {
    2757             :       return _obj;
    2758             :     }
    2759             : 
    2760             :     PyObject *operator->() const
    2761             :     {
    2762             :       return _obj;
    2763             :     }
    2764             :   };
    2765             : }
    2766             : 
    2767             : 
    2768             : namespace swig {
    2769             :   struct SwigVar_PyObject : SwigPtr_PyObject {
    2770             :     SwigVar_PyObject(PyObject* obj = 0) : SwigPtr_PyObject(obj, false) { }
    2771             :     
    2772             :     SwigVar_PyObject & operator = (PyObject* obj)
    2773             :     {
    2774             :       Py_XDECREF(_obj);
    2775             :       _obj = obj;
    2776             :       return *this;      
    2777             :     }
    2778             :   };
    2779             : }
    2780             : 
    2781             : 
    2782             : #include <iostream>
    2783             : using namespace std;
    2784             : 
    2785             : #define CPL_SUPRESS_CPLUSPLUS
    2786             : 
    2787             : #include "gdal.h"
    2788             : #include "ogr_api.h"
    2789             : #include "ogr_core.h"
    2790             : #include "cpl_port.h"
    2791             : #include "cpl_string.h"
    2792             : #include "ogr_srs_api.h"
    2793             : #include "gnm_api.h"
    2794             : 
    2795             : typedef void GDALMajorObjectShadow;
    2796             : typedef void GNMNetworkShadow;
    2797             : typedef void GNMGenericNetworkShadow;
    2798             : 
    2799             : #ifdef DEBUG
    2800             : typedef struct OGRSpatialReferenceHS OSRSpatialReferenceShadow;
    2801             : typedef struct OGRDriverHS OGRDriverShadow;
    2802             : typedef struct OGRDataSourceHS OGRDataSourceShadow;
    2803             : typedef struct OGRLayerHS OGRLayerShadow;
    2804             : typedef struct OGRFeatureHS OGRFeatureShadow;
    2805             : typedef struct OGRFeatureDefnHS OGRFeatureDefnShadow;
    2806             : typedef struct OGRGeometryHS OGRGeometryShadow;
    2807             : typedef struct OGRCoordinateTransformationHS OSRCoordinateTransformationShadow;
    2808             : typedef struct OGRCoordinateTransformationHS OGRCoordinateTransformationShadow;
    2809             : typedef struct OGRFieldDefnHS OGRFieldDefnShadow;
    2810             : #else
    2811             : typedef void OSRSpatialReferenceShadow;
    2812             : typedef void OGRDriverShadow;
    2813             : typedef void OGRDataSourceShadow;
    2814             : typedef void OGRLayerShadow;
    2815             : typedef void OGRFeatureShadow;
    2816             : typedef void OGRFeatureDefnShadow;
    2817             : typedef void OGRGeometryShadow;
    2818             : typedef void OSRCoordinateTransformationShadow;
    2819             : typedef void OGRFieldDefnShadow;
    2820             : #endif
    2821             : typedef struct OGRStyleTableHS OGRStyleTableShadow;
    2822             : typedef struct OGRGeomFieldDefnHS OGRGeomFieldDefnShadow;
    2823             : 
    2824             : 
    2825             : #define MODULE_NAME           "gnm"
    2826             : 
    2827             : 
    2828             : #include "cpl_string.h"
    2829             : #include "cpl_conv.h"
    2830             : 
    2831             : static int bUseExceptions=0;
    2832             : static int bUserHasSpecifiedIfUsingExceptions = FALSE;
    2833             : static thread_local int bUseExceptionsLocal = -1;
    2834             : 
    2835          17 : struct PythonBindingErrorHandlerContext
    2836             : {
    2837             :     std::string     osInitialMsg{};
    2838             :     std::string     osFailureMsg{};
    2839             :     CPLErrorNum     nLastCode = CPLE_None;
    2840             :     bool            bMemoryError = false;
    2841             : };
    2842             : 
    2843             : static void CPL_STDCALL
    2844           0 : PythonBindingErrorHandler(CPLErr eclass, CPLErrorNum err_no, const char *msg )
    2845             : {
    2846           0 :   PythonBindingErrorHandlerContext* ctxt = static_cast<
    2847           0 :       PythonBindingErrorHandlerContext*>(CPLGetErrorHandlerUserData());
    2848             : 
    2849             :   /*
    2850             :   ** Generally we want to suppress error reporting if we have exceptions
    2851             :   ** enabled as the error message will be in the exception thrown in
    2852             :   ** Python.
    2853             :   */
    2854             : 
    2855             :   /* If the error class is CE_Fatal, we want to have a message issued
    2856             :      because the CPL support code does an abort() before any exception
    2857             :      can be generated */
    2858           0 :   if (eclass == CE_Fatal ) {
    2859           0 :     CPLCallPreviousHandler(eclass, err_no, msg );
    2860             :   }
    2861             : 
    2862             :   /*
    2863             :   ** We do not want to interfere with non-failure messages since
    2864             :   ** they won't be translated into exceptions.
    2865             :   */
    2866           0 :   else if (eclass != CE_Failure ) {
    2867           0 :     CPLCallPreviousHandler(eclass, err_no, msg );
    2868             :   }
    2869             :   else {
    2870           0 :     ctxt->nLastCode = err_no;
    2871           0 :     try
    2872             :     {
    2873           0 :         if( ctxt->osFailureMsg.empty() ) {
    2874           0 :           ctxt->osFailureMsg = msg;
    2875           0 :           ctxt->osInitialMsg = ctxt->osFailureMsg;
    2876             :         } else {
    2877           0 :           if( ctxt->osFailureMsg.size() < 10000 ) {
    2878           0 :             std::string osTmp(msg);
    2879           0 :             osTmp += "\nMay be caused by: ";
    2880           0 :             osTmp += ctxt->osFailureMsg;
    2881           0 :             ctxt->osFailureMsg = std::move(osTmp);
    2882           0 :             ctxt->osInitialMsg = ctxt->osFailureMsg;
    2883             :           }
    2884             :           else
    2885             :           {
    2886           0 :             std::string osTmp(msg);
    2887           0 :             osTmp += "\n[...]\nMay be caused by: ";
    2888           0 :             osTmp += ctxt->osInitialMsg;
    2889           0 :             ctxt->osFailureMsg = std::move(osTmp);
    2890             :           }
    2891             :         }
    2892             :     }
    2893           0 :     catch( const std::exception& )
    2894             :     {
    2895           0 :         ctxt->bMemoryError = true;
    2896             :     }
    2897             :   }
    2898           0 : }
    2899             : 
    2900             : 
    2901             : 
    2902             : 
    2903             : static
    2904          71 : int GetUseExceptions() {
    2905          71 :   return bUseExceptionsLocal >= 0 ? bUseExceptionsLocal : bUseExceptions;
    2906             : }
    2907             : 
    2908           0 : static int _GetExceptionsLocal()
    2909             : {
    2910           0 :   return bUseExceptionsLocal;
    2911             : }
    2912             : 
    2913           0 : static void _SetExceptionsLocal(int bVal)
    2914             : {
    2915           0 :   bUseExceptionsLocal = bVal;
    2916             : }
    2917             : 
    2918             : static
    2919          26 : void _UseExceptions() {
    2920          26 :   CPLErrorReset();
    2921          26 :   bUserHasSpecifiedIfUsingExceptions = TRUE;
    2922          26 :   if( !bUseExceptions )
    2923             :   {
    2924          25 :     bUseExceptions = 1;
    2925             :   }
    2926             : }
    2927             : 
    2928             : static
    2929           5 : void _DontUseExceptions() {
    2930           5 :   CPLErrorReset();
    2931           5 :   bUserHasSpecifiedIfUsingExceptions = TRUE;
    2932           5 :   if( bUseExceptions )
    2933             :   {
    2934           0 :     bUseExceptions = 0;
    2935             :   }
    2936             : }
    2937             : 
    2938           6 : static int _UserHasSpecifiedIfUsingExceptions()
    2939             : {
    2940           0 :     return bUserHasSpecifiedIfUsingExceptions || bUseExceptionsLocal >= 0;
    2941             : }
    2942             : 
    2943             : 
    2944             : 
    2945             : SWIGINTERNINLINE PyObject*
    2946         177 :   SWIG_From_int  (int value)
    2947             : {
    2948         177 :   return PyInt_FromLong((long) value);
    2949             : }
    2950             : 
    2951             : 
    2952             : #include <limits.h>
    2953             : #if !defined(SWIG_NO_LLONG_MAX)
    2954             : # if !defined(LLONG_MAX) && defined(__GNUC__) && defined (__LONG_LONG_MAX__)
    2955             : #   define LLONG_MAX __LONG_LONG_MAX__
    2956             : #   define LLONG_MIN (-LLONG_MAX - 1LL)
    2957             : #   define ULLONG_MAX (LLONG_MAX * 2ULL + 1ULL)
    2958             : # endif
    2959             : #endif
    2960             : 
    2961             : 
    2962             : SWIGINTERN int
    2963           3 : SWIG_AsVal_double (PyObject *obj, double *val)
    2964             : {
    2965           3 :   int res = SWIG_TypeError;
    2966           3 :   if (PyFloat_Check(obj)) {
    2967           1 :     if (val) *val = PyFloat_AsDouble(obj);
    2968           1 :     return SWIG_OK;
    2969             : #if PY_VERSION_HEX < 0x03000000
    2970             :   } else if (PyInt_Check(obj)) {
    2971             :     if (val) *val = (double) PyInt_AsLong(obj);
    2972             :     return SWIG_OK;
    2973             : #endif
    2974           2 :   } else if (PyLong_Check(obj)) {
    2975           2 :     double v = PyLong_AsDouble(obj);
    2976           2 :     if (!PyErr_Occurred()) {
    2977           2 :       if (val) *val = v;
    2978           2 :       return SWIG_OK;
    2979             :     } else {
    2980           0 :       PyErr_Clear();
    2981             :     }
    2982             :   }
    2983             : #ifdef SWIG_PYTHON_CAST_MODE
    2984             :   {
    2985             :     int dispatch = 0;
    2986             :     double d = PyFloat_AsDouble(obj);
    2987             :     if (!PyErr_Occurred()) {
    2988             :       if (val) *val = d;
    2989             :       return SWIG_AddCast(SWIG_OK);
    2990             :     } else {
    2991             :       PyErr_Clear();
    2992             :     }
    2993             :     if (!dispatch) {
    2994             :       long v = PyLong_AsLong(obj);
    2995             :       if (!PyErr_Occurred()) {
    2996             :   if (val) *val = v;
    2997             :   return SWIG_AddCast(SWIG_AddCast(SWIG_OK));
    2998             :       } else {
    2999             :   PyErr_Clear();
    3000             :       }
    3001             :     }
    3002             :   }
    3003             : #endif
    3004             :   return res;
    3005             : }
    3006             : 
    3007             : 
    3008             : #include <float.h>
    3009             : 
    3010             : 
    3011             : #include <math.h>
    3012             : 
    3013             : 
    3014             : SWIGINTERNINLINE int
    3015             : SWIG_CanCastAsInteger(double *d, double min, double max) {
    3016             :   double x = *d;
    3017             :   if ((min <= x && x <= max)) {
    3018             :    double fx = floor(x);
    3019             :    double cx = ceil(x);
    3020             :    double rd =  ((x - fx) < 0.5) ? fx : cx; /* simple rint */
    3021             :    if ((errno == EDOM) || (errno == ERANGE)) {
    3022             :      errno = 0;
    3023             :    } else {
    3024             :      double summ, reps, diff;
    3025             :      if (rd < x) {
    3026             :        diff = x - rd;
    3027             :      } else if (rd > x) {
    3028             :        diff = rd - x;
    3029             :      } else {
    3030             :        return 1;
    3031             :      }
    3032             :      summ = rd + x;
    3033             :      reps = diff/summ;
    3034             :      if (reps < 8*DBL_EPSILON) {
    3035             :        *d = rd;
    3036             :        return 1;
    3037             :      }
    3038             :    }
    3039             :   }
    3040             :   return 0;
    3041             : }
    3042             : 
    3043             : 
    3044             : SWIGINTERN int
    3045           4 : SWIG_AsVal_long (PyObject *obj, long* val)
    3046             : {
    3047             : #if PY_VERSION_HEX < 0x03000000
    3048             :   if (PyInt_Check(obj)) {
    3049             :     if (val) *val = PyInt_AsLong(obj);
    3050             :     return SWIG_OK;
    3051             :   } else
    3052             : #endif
    3053           4 :   if (PyLong_Check(obj)) {
    3054           4 :     long v = PyLong_AsLong(obj);
    3055           4 :     if (!PyErr_Occurred()) {
    3056           4 :       if (val) *val = v;
    3057           4 :       return SWIG_OK;
    3058             :     } else {
    3059           0 :       PyErr_Clear();
    3060           0 :       return SWIG_OverflowError;
    3061             :     }
    3062             :   }
    3063             : #ifdef SWIG_PYTHON_CAST_MODE
    3064             :   {
    3065             :     int dispatch = 0;
    3066             :     long v = PyInt_AsLong(obj);
    3067             :     if (!PyErr_Occurred()) {
    3068             :       if (val) *val = v;
    3069             :       return SWIG_AddCast(SWIG_OK);
    3070             :     } else {
    3071             :       PyErr_Clear();
    3072             :     }
    3073             :     if (!dispatch) {
    3074             :       double d;
    3075             :       int res = SWIG_AddCast(SWIG_AsVal_double (obj,&d));
    3076             :       if (SWIG_IsOK(res) && SWIG_CanCastAsInteger(&d, LONG_MIN, LONG_MAX)) {
    3077             :   if (val) *val = (long)(d);
    3078             :   return res;
    3079             :       }
    3080             :     }
    3081             :   }
    3082             : #endif
    3083             :   return SWIG_TypeError;
    3084             : }
    3085             : 
    3086             : 
    3087             : SWIGINTERN int
    3088           4 : SWIG_AsVal_int (PyObject * obj, int *val)
    3089             : {
    3090           4 :   long v;
    3091           8 :   int res = SWIG_AsVal_long (obj, &v);
    3092           4 :   if (SWIG_IsOK(res)) {
    3093           4 :     if ((v < INT_MIN || v > INT_MAX)) {
    3094             :       return SWIG_OverflowError;
    3095             :     } else {
    3096           4 :       if (val) *val = static_cast< int >(v);
    3097             :     }
    3098             :   }  
    3099             :   return res;
    3100             : }
    3101             : 
    3102             : 
    3103             : /* Completely unrelated: just to avoid Coverity warnings */
    3104             : 
    3105             : static int bReturnSame = 1;
    3106             : 
    3107           0 : void NeverCallMePlease() {
    3108           0 :     bReturnSame = 0;
    3109           0 : }
    3110             : 
    3111             : /* Some SWIG code generates dead code, which Coverity warns about */
    3112          60 : template<class T> static T ReturnSame(T x)
    3113             : {
    3114          60 :     if( bReturnSame )
    3115             :         return x;
    3116             :     return 0;
    3117             : }
    3118             : 
    3119          17 : static void pushErrorHandler()
    3120             : {
    3121          17 :     CPLErrorReset();
    3122          17 :     PythonBindingErrorHandlerContext* ctxt = new PythonBindingErrorHandlerContext();
    3123          17 :     CPLPushErrorHandlerEx(PythonBindingErrorHandler, ctxt);
    3124          17 : }
    3125             : 
    3126          17 : static void popErrorHandler()
    3127             : {
    3128          17 :     PythonBindingErrorHandlerContext* ctxt = static_cast<
    3129          17 :       PythonBindingErrorHandlerContext*>(CPLGetErrorHandlerUserData());
    3130          17 :     CPLPopErrorHandler();
    3131          17 :     if( ctxt->bMemoryError )
    3132             :     {
    3133           0 :         CPLErrorSetState(
    3134             :           CE_Failure, CPLE_OutOfMemory, "Out of memory");
    3135             :     }
    3136          17 :     else if( !ctxt->osFailureMsg.empty() )
    3137             :     {
    3138           0 :       CPLErrorSetState(
    3139           0 :           CPLGetLastErrorType() == CE_Failure ? CE_Failure: CE_Warning,
    3140             :           ctxt->nLastCode, ctxt->osFailureMsg.c_str());
    3141             :     }
    3142          17 :     delete ctxt;
    3143          17 : }
    3144             : 
    3145             : 
    3146             : 
    3147             : 
    3148             : /* Return a PyObject* from a NULL terminated C String */
    3149             : static PyObject* GDALPythonObjectFromCStr(const char *pszStr) CPL_UNUSED;
    3150           0 : static PyObject* GDALPythonObjectFromCStr(const char *pszStr)
    3151             : {
    3152           0 :   const unsigned char* pszIter = (const unsigned char*) pszStr;
    3153           0 :   while(*pszIter != 0)
    3154             :   {
    3155           0 :     if (*pszIter > 127)
    3156             :     {
    3157           0 :         PyObject* pyObj = PyUnicode_DecodeUTF8(pszStr, strlen(pszStr), "strict");
    3158           0 :         if (pyObj != NULL && !PyErr_Occurred())
    3159             :             return pyObj;
    3160           0 :         PyErr_Clear();
    3161           0 :         return PyBytes_FromString(pszStr);
    3162             :     }
    3163           0 :     pszIter ++;
    3164             :   }
    3165           0 :   return PyUnicode_FromString(pszStr);
    3166             : }
    3167             : 
    3168             : /* Return a NULL terminated c String from a PyObject */
    3169             : /* Result must be freed with GDALPythonFreeCStr */
    3170             : static char* GDALPythonObjectToCStr(PyObject* pyObject, int* pbToFree) CPL_UNUSED;
    3171           0 : static char* GDALPythonObjectToCStr(PyObject* pyObject, int* pbToFree)
    3172             : {
    3173           0 :   *pbToFree = 0;
    3174           0 :   if (PyUnicode_Check(pyObject))
    3175             :   {
    3176           0 :       char *pszStr;
    3177           0 :       char *pszNewStr;
    3178           0 :       Py_ssize_t nLen;
    3179           0 :       PyObject* pyUTF8Str = PyUnicode_AsUTF8String(pyObject);
    3180           0 :       if( pyUTF8Str == NULL )
    3181             :         return NULL;
    3182           0 :       PyBytes_AsStringAndSize(pyUTF8Str, &pszStr, &nLen);
    3183           0 :       pszNewStr = (char *) malloc(nLen+1);
    3184           0 :       if( pszNewStr == NULL )
    3185             :       {
    3186           0 :           CPLError(CE_Failure, CPLE_OutOfMemory, "Failed to allocate %llu bytes",
    3187             :                    (unsigned long long)(nLen + 1));
    3188           0 :           Py_XDECREF(pyUTF8Str);
    3189           0 :           return NULL;
    3190             :       }
    3191           0 :       memcpy(pszNewStr, pszStr, nLen+1);
    3192           0 :       Py_XDECREF(pyUTF8Str);
    3193           0 :       *pbToFree = 1;
    3194           0 :       return pszNewStr;
    3195             :   }
    3196           0 :   else if( PyBytes_Check(pyObject) )
    3197             :   {
    3198           0 :       char* ret = PyBytes_AsString(pyObject);
    3199             : 
    3200             :       // Check if there are \0 bytes inside the string
    3201           0 :       const Py_ssize_t size = PyBytes_Size(pyObject);
    3202           0 :       for( Py_ssize_t i = 0; i < size; i++ )
    3203             :       {
    3204           0 :           if( ret[i] == 0 )
    3205             :           {
    3206           0 :               CPLError(CE_Failure, CPLE_AppDefined,
    3207             :                        "bytes object cast as string contains a zero-byte.");
    3208           0 :               return NULL;
    3209             :           }
    3210             :       }
    3211             : 
    3212             :       return ret;
    3213             :   }
    3214             :   else
    3215             :   {
    3216           0 :       CPLError(CE_Failure, CPLE_AppDefined,
    3217             :                "Passed object is neither of type string nor bytes");
    3218           0 :       return NULL;
    3219             :   }
    3220             : }
    3221             : 
    3222             : static char * GDALPythonPathToCStr(PyObject* pyObject, int* pbToFree) CPL_UNUSED;
    3223             : static char * GDALPythonPathToCStr(PyObject* pyObject, int* pbToFree)
    3224             : {
    3225             :     PyObject* os = PyImport_ImportModule("os");
    3226             :     if (os == NULL)
    3227             :     {
    3228             :         return NULL;
    3229             :     }
    3230             : 
    3231             :     PyObject* pathLike = PyObject_GetAttrString(os, "PathLike");
    3232             :     if (pathLike == NULL)
    3233             :     {
    3234             :         Py_DECREF(os);
    3235             :         return NULL;
    3236             :     }
    3237             : 
    3238             :     if (!PyObject_IsInstance(pyObject, pathLike))
    3239             :     {
    3240             :         Py_DECREF(pathLike);
    3241             :         Py_DECREF(os);
    3242             :         return NULL;
    3243             :     }
    3244             : 
    3245             :     PyObject* str = PyObject_Str(pyObject);
    3246             :     char* ret = NULL;
    3247             :     if (str != NULL)
    3248             :     {
    3249             :         ret = GDALPythonObjectToCStr(str, pbToFree);
    3250             :         Py_DECREF(str);
    3251             :     }
    3252             : 
    3253             :     Py_DECREF(pathLike);
    3254             :     Py_DECREF(os);
    3255             : 
    3256             :     return ret;
    3257             : }
    3258             : 
    3259             : 
    3260             : static void GDALPythonFreeCStr(void* ptr, int bToFree) CPL_UNUSED;
    3261           0 : static void GDALPythonFreeCStr(void* ptr, int bToFree)
    3262             : {
    3263           0 :    if (bToFree)
    3264           0 :        free(ptr);
    3265             : }
    3266             : 
    3267             : 
    3268             : 
    3269             : 
    3270             : typedef struct {
    3271             :     PyObject *psPyCallback;
    3272             :     PyObject *psPyCallbackData;
    3273             :     int nLastReported;
    3274             : } PyProgressData;
    3275             : 
    3276             : /************************************************************************/
    3277             : /*                          PyProgressProxy()                           */
    3278             : /************************************************************************/
    3279             : 
    3280             : 
    3281             : static int CPL_STDCALL
    3282             : PyProgressProxy( double dfComplete, const char *pszMessage, void *pData ) CPL_UNUSED;
    3283             : 
    3284             : static int CPL_STDCALL
    3285             : PyProgressProxy( double dfComplete, const char *pszMessage, void *pData )
    3286             : 
    3287             : {
    3288             :     PyProgressData *psInfo = (PyProgressData *) pData;
    3289             :     PyObject *psArgs, *psResult;
    3290             :     int      bContinue = TRUE;
    3291             : 
    3292             :     if( dfComplete > 0 && psInfo->nLastReported == (int) (100.0 * dfComplete) )
    3293             :         return TRUE;
    3294             : 
    3295             :     if( psInfo->psPyCallback == NULL || psInfo->psPyCallback == Py_None )
    3296             :         return TRUE;
    3297             : 
    3298             :     psInfo->nLastReported = (int) (100.0 * dfComplete);
    3299             : 
    3300             :     if( pszMessage == NULL )
    3301             :         pszMessage = "";
    3302             : 
    3303             :     SWIG_PYTHON_THREAD_BEGIN_BLOCK;
    3304             : 
    3305             :     if( psInfo->psPyCallbackData == NULL )
    3306             :         psArgs = Py_BuildValue("(dsO)", dfComplete, pszMessage, Py_None );
    3307             :     else
    3308             :         psArgs = Py_BuildValue("(dsO)", dfComplete, pszMessage,
    3309             :                          psInfo->psPyCallbackData );
    3310             : 
    3311             :     psResult = PyObject_CallObject( psInfo->psPyCallback, psArgs);
    3312             :     Py_XDECREF(psArgs);
    3313             : 
    3314             :     if( PyErr_Occurred() != NULL )
    3315             :     {
    3316             :         PyErr_Print();
    3317             :         PyErr_Clear();
    3318             :         SWIG_PYTHON_THREAD_END_BLOCK;
    3319             :         return FALSE;
    3320             :     }
    3321             : 
    3322             :     if( psResult == NULL )
    3323             :     {
    3324             :         SWIG_PYTHON_THREAD_END_BLOCK;
    3325             :         return TRUE;
    3326             :     }
    3327             : 
    3328             :     if( psResult == Py_None )
    3329             :     {
    3330             :         SWIG_PYTHON_THREAD_END_BLOCK;
    3331             :         return TRUE;
    3332             :     }
    3333             : 
    3334             :     if( !PyArg_Parse( psResult, "i", &bContinue ) )
    3335             :     {
    3336             :         PyErr_Clear();
    3337             :         CPLError(CE_Failure, CPLE_AppDefined, "bad progress return value");
    3338             :         Py_XDECREF(psResult);
    3339             :         SWIG_PYTHON_THREAD_END_BLOCK;
    3340             :         return FALSE;
    3341             :     }
    3342             : 
    3343             :     Py_XDECREF(psResult);
    3344             :     SWIG_PYTHON_THREAD_END_BLOCK;
    3345             : 
    3346             :     return bContinue;
    3347             : }
    3348             : 
    3349             : 
    3350             : #include "gdal.h"
    3351             : 
    3352             : 
    3353           5 :   GNMNetworkShadow* CastToNetwork(GDALMajorObjectShadow* base) {
    3354           5 :       return (GNMNetworkShadow*)GNMCastToNetwork((GDALMajorObjectH)base);
    3355             :   }
    3356             : 
    3357             : 
    3358           1 :   GNMGenericNetworkShadow* CastToGenericNetwork(GDALMajorObjectShadow* base) {
    3359           1 :       return (GNMGenericNetworkShadow*)GNMCastToGenericNetwork((GDALMajorObjectH)base);
    3360             :   }
    3361             : 
    3362           0 : SWIGINTERN void delete_GNMNetworkShadow(GNMNetworkShadow *self){
    3363           0 :             if ( GDALDereferenceDataset( self ) <= 0 ) {
    3364           0 :               GDALClose(self);
    3365             :             }
    3366           0 :         }
    3367           3 : SWIGINTERN void GNMNetworkShadow_ReleaseResultSet(GNMNetworkShadow *self,OGRLayerShadow *layer){
    3368           3 :             GDALDatasetReleaseResultSet(self, layer);
    3369           3 :         }
    3370           2 : SWIGINTERN int GNMNetworkShadow_GetVersion(GNMNetworkShadow *self){
    3371           2 :             return GNMGetVersion(self);
    3372             :         }
    3373           2 : SWIGINTERN char const *GNMNetworkShadow_GetName(GNMNetworkShadow *self){
    3374           2 :             return GNMGetName(self);
    3375             :         }
    3376             : 
    3377             : SWIGINTERN swig_type_info*
    3378           0 : SWIG_pchar_descriptor(void)
    3379             : {
    3380           0 :   static int init = 0;
    3381           0 :   static swig_type_info* info = 0;
    3382           0 :   if (!init) {
    3383           0 :     info = SWIG_TypeQuery("_p_char");
    3384           0 :     init = 1;
    3385             :   }
    3386           0 :   return info;
    3387             : }
    3388             : 
    3389             : 
    3390             : SWIGINTERNINLINE PyObject *
    3391           2 : SWIG_FromCharPtrAndSize(const char* carray, size_t size)
    3392             : {
    3393           2 :   if (carray) {
    3394           2 :     if (size > INT_MAX) {
    3395           0 :       swig_type_info* pchar_descriptor = SWIG_pchar_descriptor();
    3396           0 :       return pchar_descriptor ? 
    3397           0 :   SWIG_InternalNewPointerObj(const_cast< char * >(carray), pchar_descriptor, 0) : SWIG_Py_Void();
    3398             :     } else {
    3399             : #if PY_VERSION_HEX >= 0x03000000
    3400             : #if defined(SWIG_PYTHON_STRICT_BYTE_CHAR)
    3401             :       return PyBytes_FromStringAndSize(carray, static_cast< Py_ssize_t >(size));
    3402             : #else
    3403           2 :       return PyUnicode_DecodeUTF8(carray, static_cast< Py_ssize_t >(size), "surrogateescape");
    3404             : #endif
    3405             : #else
    3406             :       return PyString_FromStringAndSize(carray, static_cast< Py_ssize_t >(size));
    3407             : #endif
    3408             :     }
    3409             :   } else {
    3410           0 :     return SWIG_Py_Void();
    3411             :   }
    3412             : }
    3413             : 
    3414             : 
    3415             : SWIGINTERNINLINE PyObject * 
    3416           2 : SWIG_FromCharPtr(const char *cptr)
    3417             : { 
    3418           2 :   return SWIG_FromCharPtrAndSize(cptr, (cptr ? strlen(cptr) : 0));
    3419             : }
    3420             : 
    3421           0 : SWIGINTERN OGRFeatureShadow *GNMNetworkShadow_GetFeatureByGlobalFID(GNMNetworkShadow *self,GIntBig GFID){
    3422           0 :             return GNMGetFeatureByGlobalFID(self, GFID);
    3423             :         }
    3424             : 
    3425             : /************************************************************************/
    3426             : /*                         CSLFromPySequence()                          */
    3427             : /************************************************************************/
    3428           2 : static char **CSLFromPySequence( PyObject *pySeq, int *pbErr )
    3429             : 
    3430             : {
    3431           2 :   *pbErr = FALSE;
    3432             :   /* Check if is a list (and reject strings, that are seen as sequence of characters)  */
    3433           2 :   if ( ! PySequence_Check(pySeq) || PyUnicode_Check(pySeq) ) {
    3434           0 :     PyErr_SetString(PyExc_TypeError,"not a sequence");
    3435           0 :     *pbErr = TRUE;
    3436           0 :     return NULL;
    3437             :   }
    3438             : 
    3439           2 :   Py_ssize_t size = PySequence_Size(pySeq);
    3440           2 :   if( size > (Py_ssize_t)(INT_MAX - 1) ) {
    3441           0 :     PyErr_SetString(PyExc_TypeError, "too big sequence");
    3442           0 :     *pbErr = TRUE;
    3443           0 :     return NULL;
    3444             :   }
    3445           2 :   if( size == 0 ) {
    3446             :     return NULL;
    3447             :   }
    3448           2 :   char** papszRet = (char**) VSICalloc((int)size + 1, sizeof(char*));
    3449           2 :   if( !papszRet ) {
    3450           0 :     PyErr_SetString(PyExc_MemoryError, "cannot allocate temporary buffer");
    3451           0 :     *pbErr = TRUE;
    3452           0 :     return NULL;
    3453             :   }
    3454           5 :   for (int i = 0; i < (int)size; i++) {
    3455           3 :     PyObject* pyObj = PySequence_GetItem(pySeq,i);
    3456           3 :     if (PyUnicode_Check(pyObj))
    3457             :     {
    3458           3 :       char *pszStr;
    3459           3 :       Py_ssize_t nLen;
    3460           3 :       PyObject* pyUTF8Str = PyUnicode_AsUTF8String(pyObj);
    3461           3 :       if( !pyUTF8Str )
    3462             :       {
    3463           0 :         Py_DECREF(pyObj);
    3464           0 :         PyErr_SetString(PyExc_TypeError,"invalid Unicode sequence");
    3465           0 :         CSLDestroy(papszRet);
    3466           0 :         *pbErr = TRUE;
    3467           0 :         return NULL;
    3468             :       }
    3469           3 :       PyBytes_AsStringAndSize(pyUTF8Str, &pszStr, &nLen);
    3470           3 :       papszRet[i] = VSIStrdup(pszStr);
    3471           6 :       Py_XDECREF(pyUTF8Str);
    3472             :     }
    3473           0 :     else if (PyBytes_Check(pyObj))
    3474           0 :       papszRet[i] = VSIStrdup(PyBytes_AsString(pyObj));
    3475             :     else
    3476             :     {
    3477           0 :         Py_DECREF(pyObj);
    3478           0 :         PyErr_SetString(PyExc_TypeError,"sequence must contain strings");
    3479           0 :         CSLDestroy(papszRet);
    3480           0 :         *pbErr = TRUE;
    3481           0 :         return NULL;
    3482             :     }
    3483           3 :     Py_DECREF(pyObj);
    3484           3 :     if( !papszRet[i] )
    3485             :     {
    3486           0 :         PyErr_SetString(PyExc_MemoryError, "cannot allocate temporary buffer");
    3487           0 :         CSLDestroy(papszRet);
    3488           0 :         *pbErr = TRUE;
    3489           0 :         return NULL;
    3490             :     }
    3491             :   }
    3492             :   return papszRet;
    3493             : }
    3494             : 
    3495             : 
    3496           0 : static char **CSLFromPyMapping( PyObject *pyObj, int *pbErr )
    3497             : 
    3498             : {
    3499           0 :     char** retCSL = NULL;
    3500           0 :     Py_ssize_t size = PyMapping_Length( pyObj );
    3501           0 :     if ( size > 0 && size == (int)size) {
    3502           0 :       PyObject *item_list = PyMapping_Items( pyObj );
    3503           0 :       for( int i=0; i<(int)size; i++ ) {
    3504           0 :         PyObject *it = PySequence_GetItem( item_list, i );
    3505             : 
    3506           0 :         PyObject *k, *v;
    3507           0 :         if ( ! PyArg_ParseTuple( it, "OO", &k, &v ) ) {
    3508           0 :           Py_DECREF(it);
    3509           0 :           Py_DECREF(item_list);
    3510           0 :           PyErr_SetString(PyExc_TypeError,"Cannot retrieve key/value");
    3511           0 :           CSLDestroy(retCSL);
    3512           0 :           *pbErr = TRUE;
    3513           0 :           return NULL;
    3514             :         }
    3515             : 
    3516           0 :         PyObject* kStr = PyObject_Str(k);
    3517           0 :         if( PyErr_Occurred() )
    3518             :         {
    3519           0 :             Py_DECREF(it);
    3520           0 :             Py_DECREF(item_list);
    3521           0 :             CSLDestroy(retCSL);
    3522           0 :             *pbErr = TRUE;
    3523           0 :             return NULL;
    3524             :         }
    3525             : 
    3526           0 :         PyObject* vStr;
    3527           0 :         if( PyBytes_Check(v) )
    3528             :         {
    3529           0 :             vStr = v;
    3530           0 :             Py_INCREF(vStr);
    3531             :         }
    3532             :         else
    3533             :         {
    3534           0 :             vStr = PyObject_Str(v);
    3535           0 :             if( PyErr_Occurred() )
    3536             :             {
    3537           0 :                 Py_DECREF(it);
    3538           0 :                 Py_DECREF(kStr);
    3539           0 :                 Py_DECREF(item_list);
    3540           0 :                 CSLDestroy(retCSL);
    3541           0 :                 *pbErr = TRUE;
    3542           0 :                 return NULL;
    3543             :             }
    3544             :         }
    3545             : 
    3546           0 :         int bFreeK, bFreeV;
    3547           0 :         char* pszK = GDALPythonObjectToCStr(kStr, &bFreeK);
    3548           0 :         char* pszV = GDALPythonObjectToCStr(vStr, &bFreeV);
    3549           0 :         if( pszK == NULL || pszV == NULL )
    3550             :         {
    3551           0 :             GDALPythonFreeCStr(pszK, bFreeK);
    3552           0 :             GDALPythonFreeCStr(pszV, bFreeV);
    3553           0 :             Py_DECREF(kStr);
    3554           0 :             Py_DECREF(vStr);
    3555           0 :             Py_DECREF(it);
    3556           0 :             Py_DECREF(item_list);
    3557           0 :             PyErr_SetString(PyExc_TypeError,"Cannot get key/value as string");
    3558           0 :             CSLDestroy(retCSL);
    3559           0 :             *pbErr = TRUE;
    3560           0 :             return NULL;
    3561             :         }
    3562           0 :         retCSL = CSLAddNameValue( retCSL, pszK, pszV );
    3563             : 
    3564           0 :         GDALPythonFreeCStr(pszK, bFreeK);
    3565           0 :         GDALPythonFreeCStr(pszV, bFreeV);
    3566           0 :         Py_DECREF(kStr);
    3567           0 :         Py_DECREF(vStr);
    3568           0 :         Py_DECREF(it);
    3569             :       }
    3570           0 :       Py_DECREF(item_list);
    3571             :     }
    3572           0 :     *pbErr = FALSE;
    3573           0 :     return retCSL;
    3574             : }
    3575             : 
    3576           3 : SWIGINTERN OGRLayerShadow *GNMNetworkShadow_GetPath(GNMNetworkShadow *self,GIntBig nStartFID,GIntBig nEndFID,GNMGraphAlgorithmType eAlgorithm,char **options=0){
    3577           3 :             return GNMGetPath(self, nStartFID, nEndFID, eAlgorithm, options);
    3578             :         }
    3579           0 : SWIGINTERN CPLErr GNMNetworkShadow_DisconnectAll(GNMNetworkShadow *self){
    3580           0 :             return GNMDisconnectAll( self );
    3581             :         }
    3582           0 : SWIGINTERN char const *GNMNetworkShadow_GetProjection(GNMNetworkShadow *self){
    3583           0 :             return GDALGetProjectionRef( self );
    3584             :         }
    3585           0 : SWIGINTERN char const *GNMNetworkShadow_GetProjectionRef(GNMNetworkShadow *self){
    3586           0 :             return GDALGetProjectionRef( self );
    3587             :         }
    3588           0 : SWIGINTERN char **GNMNetworkShadow_GetFileList(GNMNetworkShadow *self){
    3589           0 :             return GDALGetFileList( self );
    3590             :         }
    3591             : 
    3592           0 : static PyObject* CSLToList( char** stringarray, bool *pbErr )
    3593             : {
    3594           0 :   PyObject* res;
    3595           0 :   if ( stringarray == NULL ) {
    3596           0 :     res = Py_None;
    3597           0 :     Py_INCREF( res );
    3598             :   }
    3599             :   else {
    3600           0 :     int len = CSLCount( stringarray );
    3601           0 :     res = PyList_New( len );
    3602           0 :     if( !res ) {
    3603           0 :       *pbErr = true;
    3604           0 :       return res;
    3605             :     }
    3606           0 :     for ( int i = 0; i < len; ++i ) {
    3607           0 :       PyObject *o = GDALPythonObjectFromCStr( stringarray[i] );
    3608           0 :       PyList_SetItem(res, i, o );
    3609             :     }
    3610             :   }
    3611           0 :   *pbErr = false;
    3612           0 :   return res;
    3613             : }
    3614             : 
    3615             : 
    3616             : SWIGINTERN int
    3617           0 : SWIG_AsCharPtrAndSize(PyObject *obj, char** cptr, size_t* psize, int *alloc)
    3618             : {
    3619             : #if PY_VERSION_HEX>=0x03000000
    3620             : #if defined(SWIG_PYTHON_STRICT_BYTE_CHAR)
    3621             :   if (PyBytes_Check(obj))
    3622             : #else
    3623           0 :   if (PyUnicode_Check(obj))
    3624             : #endif
    3625             : #else  
    3626             :   if (PyString_Check(obj))
    3627             : #endif
    3628             :   {
    3629           0 :     char *cstr; Py_ssize_t len;
    3630           0 :     int ret = SWIG_OK;
    3631             : #if PY_VERSION_HEX>=0x03000000
    3632             : #if !defined(SWIG_PYTHON_STRICT_BYTE_CHAR)
    3633           0 :     if (!alloc && cptr) {
    3634             :         /* We can't allow converting without allocation, since the internal
    3635             :            representation of string in Python 3 is UCS-2/UCS-4 but we require
    3636             :            a UTF-8 representation.
    3637             :            TODO(bhy) More detailed explanation */
    3638             :         return SWIG_RuntimeError;
    3639             :     }
    3640           0 :     obj = PyUnicode_AsUTF8String(obj); if (!obj) return SWIG_TypeError;
    3641           0 :     if (!obj)
    3642             :       return SWIG_TypeError;
    3643           0 :     if (alloc)
    3644           0 :       *alloc = SWIG_NEWOBJ;
    3645             : #endif
    3646           0 :     PyBytes_AsStringAndSize(obj, &cstr, &len);
    3647             : #else
    3648             :     PyString_AsStringAndSize(obj, &cstr, &len);
    3649             : #endif
    3650           0 :     if (cptr) {
    3651           0 :       if (alloc) {
    3652           0 :   if (*alloc == SWIG_NEWOBJ) {
    3653           0 :     *cptr = reinterpret_cast< char* >(memcpy(new char[len + 1], cstr, sizeof(char)*(len + 1)));
    3654           0 :     *alloc = SWIG_NEWOBJ;
    3655             :   } else {
    3656           0 :     *cptr = cstr;
    3657           0 :     *alloc = SWIG_OLDOBJ;
    3658             :   }
    3659             :       } else {
    3660             : #if PY_VERSION_HEX>=0x03000000
    3661             : #if defined(SWIG_PYTHON_STRICT_BYTE_CHAR)
    3662             :   *cptr = PyBytes_AsString(obj);
    3663             : #else
    3664             :   assert(0); /* Should never reach here with Unicode strings in Python 3 */
    3665             : #endif
    3666             : #else
    3667             :   *cptr = SWIG_Python_str_AsChar(obj);
    3668             :         if (!*cptr)
    3669             :           ret = SWIG_TypeError;
    3670             : #endif
    3671             :       }
    3672             :     }
    3673           0 :     if (psize) *psize = len + 1;
    3674             : #if PY_VERSION_HEX>=0x03000000 && !defined(SWIG_PYTHON_STRICT_BYTE_CHAR)
    3675           0 :     Py_XDECREF(obj);
    3676             : #endif
    3677           0 :     return ret;
    3678             :   } else {
    3679             : #if defined(SWIG_PYTHON_2_UNICODE)
    3680             : #if defined(SWIG_PYTHON_STRICT_BYTE_CHAR)
    3681             : #error "Cannot use both SWIG_PYTHON_2_UNICODE and SWIG_PYTHON_STRICT_BYTE_CHAR at once"
    3682             : #endif
    3683             : #if PY_VERSION_HEX<0x03000000
    3684             :     if (PyUnicode_Check(obj)) {
    3685             :       char *cstr; Py_ssize_t len;
    3686             :       if (!alloc && cptr) {
    3687             :         return SWIG_RuntimeError;
    3688             :       }
    3689             :       obj = PyUnicode_AsUTF8String(obj); if (!obj) return SWIG_TypeError;
    3690             :       if (!obj)
    3691             :         return SWIG_TypeError;
    3692             :       if (PyString_AsStringAndSize(obj, &cstr, &len) != -1) {
    3693             :         if (cptr) {
    3694             :           if (alloc) *alloc = SWIG_NEWOBJ;
    3695             :           *cptr = reinterpret_cast< char* >(memcpy(new char[len + 1], cstr, sizeof(char)*(len + 1)));
    3696             :         }
    3697             :         if (psize) *psize = len + 1;
    3698             : 
    3699             :         Py_XDECREF(obj);
    3700             :         return SWIG_OK;
    3701             :       } else {
    3702             :         Py_XDECREF(obj);
    3703             :       }
    3704             :     }
    3705             : #endif
    3706             : #endif
    3707             : 
    3708           0 :     swig_type_info* pchar_descriptor = SWIG_pchar_descriptor();
    3709           0 :     if (pchar_descriptor) {
    3710           0 :       void* vptr = 0;
    3711           0 :       if (SWIG_ConvertPtr(obj, &vptr, pchar_descriptor, 0) == SWIG_OK) {
    3712           0 :   if (cptr) *cptr = (char *) vptr;
    3713           0 :   if (psize) *psize = vptr ? (strlen((char *)vptr) + 1) : 0;
    3714           0 :   if (alloc) *alloc = SWIG_OLDOBJ;
    3715           0 :   return SWIG_OK;
    3716             :       }
    3717             :     }
    3718             :   }
    3719             :   return SWIG_TypeError;
    3720             : }
    3721             : 
    3722             : 
    3723             : 
    3724             : 
    3725           0 : SWIGINTERN OGRLayerShadow *GNMNetworkShadow_CreateLayer(GNMNetworkShadow *self,char const *name,OSRSpatialReferenceShadow *srs=NULL,OGRwkbGeometryType geom_type=wkbUnknown,char **options=0){
    3726           0 :             OGRLayerShadow* layer = (OGRLayerShadow*) GDALDatasetCreateLayer( self,
    3727             :                                       name,
    3728             :                                       srs,
    3729             :                                       geom_type,
    3730             :                                       options);
    3731           0 :             return layer;
    3732             :         }
    3733           0 : SWIGINTERN OGRLayerShadow *GNMNetworkShadow_CopyLayer(GNMNetworkShadow *self,OGRLayerShadow *src_layer,char const *new_name,char **options=0){
    3734           0 :             OGRLayerShadow* layer = (OGRLayerShadow*) GDALDatasetCopyLayer( self,
    3735             :                                                       src_layer,
    3736             :                                                       new_name,
    3737             :                                                       options);
    3738           0 :             return layer;
    3739             :         }
    3740           0 : SWIGINTERN OGRErr GNMNetworkShadow_DeleteLayer(GNMNetworkShadow *self,int index){
    3741           0 :             return GDALDatasetDeleteLayer(self, index);
    3742             :         }
    3743             : 
    3744             : 
    3745             : #include "ogr_core.h"
    3746             : static char const *
    3747           0 : OGRErrMessages( int rc ) {
    3748           0 :   switch( rc ) {
    3749             :   case OGRERR_NONE:
    3750             :     return "OGR Error: None";
    3751           0 :   case OGRERR_NOT_ENOUGH_DATA:
    3752           0 :     return "OGR Error: Not enough data to deserialize";
    3753           0 :   case OGRERR_NOT_ENOUGH_MEMORY:
    3754           0 :     return "OGR Error: Not enough memory";
    3755           0 :   case OGRERR_UNSUPPORTED_GEOMETRY_TYPE:
    3756           0 :     return "OGR Error: Unsupported geometry type";
    3757           0 :   case OGRERR_UNSUPPORTED_OPERATION:
    3758           0 :     return "OGR Error: Unsupported operation";
    3759           0 :   case OGRERR_CORRUPT_DATA:
    3760           0 :     return "OGR Error: Corrupt data";
    3761           0 :   case OGRERR_FAILURE:
    3762           0 :     return "OGR Error: General Error";
    3763           0 :   case OGRERR_UNSUPPORTED_SRS:
    3764           0 :     return "OGR Error: Unsupported SRS";
    3765           0 :   case OGRERR_INVALID_HANDLE:
    3766           0 :     return "OGR Error: Invalid handle";
    3767           0 :   case OGRERR_NON_EXISTING_FEATURE:
    3768           0 :     return "OGR Error: Non existing feature";
    3769           0 :   default:
    3770           0 :     return "OGR Error: Unknown";
    3771             :   }
    3772             : }
    3773             : 
    3774           0 : SWIGINTERN int GNMNetworkShadow_GetLayerCount(GNMNetworkShadow *self){
    3775           0 :             return GDALDatasetGetLayerCount(self);
    3776             :         }
    3777           0 : SWIGINTERN OGRLayerShadow *GNMNetworkShadow_GetLayerByIndex(GNMNetworkShadow *self,int index=0){
    3778             :         
    3779           0 :         OGRLayerShadow* layer = (OGRLayerShadow*) GDALDatasetGetLayer(self,
    3780             :                                                                       index);
    3781           0 :             return layer;
    3782             :         }
    3783           0 : SWIGINTERN OGRLayerShadow *GNMNetworkShadow_GetLayerByName(GNMNetworkShadow *self,char const *layer_name){
    3784           0 :             OGRLayerShadow* layer =
    3785           0 :                   (OGRLayerShadow*) GDALDatasetGetLayerByName(self, layer_name);
    3786           0 :             return layer;
    3787             :         }
    3788           0 : SWIGINTERN bool GNMNetworkShadow_TestCapability(GNMNetworkShadow *self,char const *cap){
    3789           0 :             return (GDALDatasetTestCapability(self, cap) > 0);
    3790             :         }
    3791             : 
    3792             : SWIGINTERNINLINE PyObject*
    3793           0 :   SWIG_From_bool  (bool value)
    3794             : {
    3795           0 :   return PyBool_FromLong(value ? 1 : 0);
    3796             : }
    3797             : 
    3798           0 : SWIGINTERN OGRErr GNMNetworkShadow_StartTransaction(GNMNetworkShadow *self,int force=FALSE){
    3799           0 :             return GDALDatasetStartTransaction(self, force);
    3800             :         }
    3801           0 : SWIGINTERN OGRErr GNMNetworkShadow_CommitTransaction(GNMNetworkShadow *self){
    3802           0 :             return GDALDatasetCommitTransaction(self);
    3803             :         }
    3804           0 : SWIGINTERN OGRErr GNMNetworkShadow_RollbackTransaction(GNMNetworkShadow *self){
    3805           0 :             return GDALDatasetRollbackTransaction(self);
    3806             :         }
    3807           0 : SWIGINTERN void delete_GNMGenericNetworkShadow(GNMGenericNetworkShadow *self){
    3808           0 :             if ( GDALDereferenceDataset( self ) <= 0 ) {
    3809           0 :               GDALClose(self);
    3810             :             }
    3811           0 :         }
    3812           0 : SWIGINTERN CPLErr GNMGenericNetworkShadow_ConnectFeatures(GNMGenericNetworkShadow *self,GIntBig nSrcFID,GIntBig nTgtFID,GIntBig nConFID,double dfCost,double dfInvCost,GNMDirection eDir){
    3813           0 :             return GNMConnectFeatures(self, nSrcFID, nTgtFID,
    3814             :                                               nConFID, dfCost, dfInvCost, eDir);
    3815             :         }
    3816           0 : SWIGINTERN CPLErr GNMGenericNetworkShadow_DisconnectFeatures(GNMGenericNetworkShadow *self,GIntBig nSrcFID,GIntBig nTgtFID,GIntBig nConFID){
    3817           0 :             return GNMDisconnectFeatures(self, nSrcFID, nTgtFID,
    3818             :                                                            nConFID);
    3819             :         }
    3820           0 : SWIGINTERN CPLErr GNMGenericNetworkShadow_DisconnectFeaturesWithId(GNMGenericNetworkShadow *self,GIntBig nFID){
    3821           0 :             return GNMDisconnectFeaturesWithId(self, nFID);
    3822             :         }
    3823           0 : SWIGINTERN CPLErr GNMGenericNetworkShadow_ReconnectFeatures(GNMGenericNetworkShadow *self,GIntBig nSrcFID,GIntBig nTgtFID,GIntBig nConFID,double dfCost,double dfInvCost,GNMDirection eDir){
    3824           0 :             return GNMReconnectFeatures(self, nSrcFID, nTgtFID, nConFID, dfCost, dfInvCost, eDir);
    3825             :         }
    3826           0 : SWIGINTERN CPLErr GNMGenericNetworkShadow_CreateRule(GNMGenericNetworkShadow *self,char const *pszRuleStr){
    3827           0 :             return GNMCreateRule(self, pszRuleStr);
    3828             :         }
    3829           0 : SWIGINTERN CPLErr GNMGenericNetworkShadow_DeleteAllRules(GNMGenericNetworkShadow *self){
    3830           0 :             return GNMDeleteAllRules(self);
    3831             :         }
    3832           0 : SWIGINTERN CPLErr GNMGenericNetworkShadow_DeleteRule(GNMGenericNetworkShadow *self,char const *pszRuleStr){
    3833           0 :             return GNMDeleteRule(self, pszRuleStr);
    3834             :         }
    3835           0 : SWIGINTERN char **GNMGenericNetworkShadow_GetRules(GNMGenericNetworkShadow *self){
    3836           0 :             return GNMGetRules(self);
    3837             :         }
    3838           1 : SWIGINTERN CPLErr GNMGenericNetworkShadow_ConnectPointsByLines(GNMGenericNetworkShadow *self,char **papszLayerList,double dfTolerance,double dfCost,double dfInvCost,GNMDirection eDir){
    3839           1 :             return GNMConnectPointsByLines(self, papszLayerList, dfTolerance, dfCost, dfInvCost, eDir);
    3840             :         }
    3841             : 
    3842             : SWIGINTERN int
    3843           0 : SWIG_AsVal_bool (PyObject *obj, bool *val)
    3844             : {
    3845           0 :   int r;
    3846           0 :   if (!PyBool_Check(obj))
    3847             :     return SWIG_ERROR;
    3848           0 :   r = PyObject_IsTrue(obj);
    3849           0 :   if (r == -1)
    3850             :     return SWIG_ERROR;
    3851           0 :   if (val) *val = r ? true : false;
    3852             :   return SWIG_OK;
    3853             : }
    3854             : 
    3855           0 : SWIGINTERN CPLErr GNMGenericNetworkShadow_ChangeBlockState(GNMGenericNetworkShadow *self,GIntBig nFID,bool bIsBlock){
    3856           0 :             return GNMChangeBlockState(self, nFID, bIsBlock);
    3857             :         }
    3858           0 : SWIGINTERN CPLErr GNMGenericNetworkShadow_ChangeAllBlockState(GNMGenericNetworkShadow *self,bool bIsBlock=false){
    3859           0 :             return GNMChangeAllBlockState(self, bIsBlock);
    3860             :         }
    3861             : #ifdef __cplusplus
    3862             : extern "C" {
    3863             : #endif
    3864           0 : SWIGINTERN PyObject *_wrap_GetUseExceptions(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
    3865           0 :   PyObject *resultobj = 0; int bLocalUseExceptionsCode = GetUseExceptions();
    3866           0 :   int result;
    3867             :   
    3868           0 :   if (!SWIG_Python_UnpackTuple(args, "GetUseExceptions", 0, 0, 0)) SWIG_fail;
    3869           0 :   {
    3870             : #ifdef SED_HACKS
    3871           0 :     if( ReturnSame(TRUE) ) bLocalUseExceptionsCode = FALSE;
    3872             : #endif
    3873           0 :     result = GetUseExceptions();
    3874             :   }
    3875           0 :   resultobj = SWIG_From_int(static_cast< int >(result));
    3876           0 :   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
    3877             :   return resultobj;
    3878           0 : fail:
    3879           0 :   return NULL;
    3880             : }
    3881             : 
    3882             : 
    3883           0 : SWIGINTERN PyObject *_wrap__GetExceptionsLocal(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
    3884           0 :   PyObject *resultobj = 0; int bLocalUseExceptionsCode = GetUseExceptions();
    3885           0 :   int result;
    3886             :   
    3887           0 :   if (!SWIG_Python_UnpackTuple(args, "_GetExceptionsLocal", 0, 0, 0)) SWIG_fail;
    3888           0 :   {
    3889             : #ifdef SED_HACKS
    3890           0 :     if( ReturnSame(TRUE) ) bLocalUseExceptionsCode = FALSE;
    3891             : #endif
    3892           0 :     {
    3893           0 :       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
    3894           0 :       result = (int)_GetExceptionsLocal();
    3895           0 :       SWIG_PYTHON_THREAD_END_ALLOW;
    3896             :     }
    3897             :   }
    3898           0 :   resultobj = SWIG_From_int(static_cast< int >(result));
    3899           0 :   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
    3900             :   return resultobj;
    3901           0 : fail:
    3902           0 :   return NULL;
    3903             : }
    3904             : 
    3905             : 
    3906           0 : SWIGINTERN PyObject *_wrap__SetExceptionsLocal(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
    3907           0 :   PyObject *resultobj = 0; int bLocalUseExceptionsCode = GetUseExceptions();
    3908           0 :   int arg1 ;
    3909           0 :   int val1 ;
    3910           0 :   int ecode1 = 0 ;
    3911           0 :   PyObject *swig_obj[1] ;
    3912             :   
    3913           0 :   if (!args) SWIG_fail;
    3914           0 :   swig_obj[0] = args;
    3915           0 :   ecode1 = SWIG_AsVal_int(swig_obj[0], &val1);
    3916           0 :   if (!SWIG_IsOK(ecode1)) {
    3917           0 :     SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "_SetExceptionsLocal" "', argument " "1"" of type '" "int""'");
    3918             :   } 
    3919           0 :   arg1 = static_cast< int >(val1);
    3920           0 :   {
    3921             : #ifdef SED_HACKS
    3922           0 :     if( ReturnSame(TRUE) ) bLocalUseExceptionsCode = FALSE;
    3923             : #endif
    3924           0 :     {
    3925           0 :       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
    3926           0 :       _SetExceptionsLocal(arg1);
    3927           0 :       SWIG_PYTHON_THREAD_END_ALLOW;
    3928             :     }
    3929             :   }
    3930           0 :   resultobj = SWIG_Py_Void();
    3931           0 :   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
    3932             :   return resultobj;
    3933             : fail:
    3934             :   return NULL;
    3935             : }
    3936             : 
    3937             : 
    3938          26 : SWIGINTERN PyObject *_wrap__UseExceptions(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
    3939          26 :   PyObject *resultobj = 0; int bLocalUseExceptionsCode = GetUseExceptions();
    3940             :   
    3941          26 :   if (!SWIG_Python_UnpackTuple(args, "_UseExceptions", 0, 0, 0)) SWIG_fail;
    3942          26 :   {
    3943          26 :     SWIG_PYTHON_THREAD_BEGIN_ALLOW;
    3944          26 :     _UseExceptions();
    3945          26 :     SWIG_PYTHON_THREAD_END_ALLOW;
    3946             :   }
    3947          26 :   resultobj = SWIG_Py_Void();
    3948          26 :   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
    3949             :   return resultobj;
    3950           0 : fail:
    3951           0 :   return NULL;
    3952             : }
    3953             : 
    3954             : 
    3955           5 : SWIGINTERN PyObject *_wrap__DontUseExceptions(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
    3956           5 :   PyObject *resultobj = 0; int bLocalUseExceptionsCode = GetUseExceptions();
    3957             :   
    3958           5 :   if (!SWIG_Python_UnpackTuple(args, "_DontUseExceptions", 0, 0, 0)) SWIG_fail;
    3959           5 :   {
    3960           5 :     SWIG_PYTHON_THREAD_BEGIN_ALLOW;
    3961           5 :     _DontUseExceptions();
    3962           5 :     SWIG_PYTHON_THREAD_END_ALLOW;
    3963             :   }
    3964           5 :   resultobj = SWIG_Py_Void();
    3965           5 :   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
    3966             :   return resultobj;
    3967           0 : fail:
    3968           0 :   return NULL;
    3969             : }
    3970             : 
    3971             : 
    3972           6 : SWIGINTERN PyObject *_wrap__UserHasSpecifiedIfUsingExceptions(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
    3973           6 :   PyObject *resultobj = 0; int bLocalUseExceptionsCode = GetUseExceptions();
    3974           6 :   int result;
    3975             :   
    3976           6 :   if (!SWIG_Python_UnpackTuple(args, "_UserHasSpecifiedIfUsingExceptions", 0, 0, 0)) SWIG_fail;
    3977           6 :   {
    3978             : #ifdef SED_HACKS
    3979           6 :     if( ReturnSame(TRUE) ) bLocalUseExceptionsCode = FALSE;
    3980             : #endif
    3981           6 :     {
    3982           6 :       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
    3983           6 :       result = (int)_UserHasSpecifiedIfUsingExceptions();
    3984           6 :       SWIG_PYTHON_THREAD_END_ALLOW;
    3985             :     }
    3986             :   }
    3987           6 :   resultobj = SWIG_From_int(static_cast< int >(result));
    3988           6 :   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
    3989             :   return resultobj;
    3990           0 : fail:
    3991           0 :   return NULL;
    3992             : }
    3993             : 
    3994             : 
    3995           5 : SWIGINTERN PyObject *_wrap_CastToNetwork(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
    3996           5 :   PyObject *resultobj = 0; int bLocalUseExceptionsCode = GetUseExceptions();
    3997           5 :   GDALMajorObjectShadow *arg1 = (GDALMajorObjectShadow *) 0 ;
    3998           5 :   void *argp1 = 0 ;
    3999           5 :   int res1 = 0 ;
    4000           5 :   PyObject *swig_obj[1] ;
    4001           5 :   GNMNetworkShadow *result = 0 ;
    4002             :   
    4003           5 :   if (!args) SWIG_fail;
    4004           5 :   swig_obj[0] = args;
    4005           5 :   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_GDALMajorObjectShadow, 0 |  0 );
    4006           5 :   if (!SWIG_IsOK(res1)) {
    4007           0 :     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CastToNetwork" "', argument " "1"" of type '" "GDALMajorObjectShadow *""'"); 
    4008             :   }
    4009           5 :   arg1 = reinterpret_cast< GDALMajorObjectShadow * >(argp1);
    4010           5 :   {
    4011           5 :     const int bLocalUseExceptions = GetUseExceptions();
    4012           5 :     if ( bLocalUseExceptions ) {
    4013           5 :       pushErrorHandler();
    4014             :     }
    4015           5 :     {
    4016           5 :       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
    4017           5 :       result = (GNMNetworkShadow *)CastToNetwork(arg1);
    4018           5 :       SWIG_PYTHON_THREAD_END_ALLOW;
    4019             :     }
    4020           5 :     if ( bLocalUseExceptions ) {
    4021           5 :       popErrorHandler();
    4022             :     }
    4023             : #ifndef SED_HACKS
    4024             :     if ( bLocalUseExceptions ) {
    4025             :       CPLErr eclass = CPLGetLastErrorType();
    4026             :       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
    4027             :         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
    4028             :       }
    4029             :     }
    4030             : #endif
    4031             :   }
    4032           5 :   resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GNMNetworkShadow, 0 |  0 );
    4033           5 :   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
    4034             :   return resultobj;
    4035             : fail:
    4036             :   return NULL;
    4037             : }
    4038             : 
    4039             : 
    4040           1 : SWIGINTERN PyObject *_wrap_CastToGenericNetwork(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
    4041           1 :   PyObject *resultobj = 0; int bLocalUseExceptionsCode = GetUseExceptions();
    4042           1 :   GDALMajorObjectShadow *arg1 = (GDALMajorObjectShadow *) 0 ;
    4043           1 :   void *argp1 = 0 ;
    4044           1 :   int res1 = 0 ;
    4045           1 :   PyObject *swig_obj[1] ;
    4046           1 :   GNMGenericNetworkShadow *result = 0 ;
    4047             :   
    4048           1 :   if (!args) SWIG_fail;
    4049           1 :   swig_obj[0] = args;
    4050           1 :   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_GDALMajorObjectShadow, 0 |  0 );
    4051           1 :   if (!SWIG_IsOK(res1)) {
    4052           0 :     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CastToGenericNetwork" "', argument " "1"" of type '" "GDALMajorObjectShadow *""'"); 
    4053             :   }
    4054           1 :   arg1 = reinterpret_cast< GDALMajorObjectShadow * >(argp1);
    4055           1 :   {
    4056           1 :     const int bLocalUseExceptions = GetUseExceptions();
    4057           1 :     if ( bLocalUseExceptions ) {
    4058           1 :       pushErrorHandler();
    4059             :     }
    4060           1 :     {
    4061           1 :       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
    4062           1 :       result = (GNMGenericNetworkShadow *)CastToGenericNetwork(arg1);
    4063           1 :       SWIG_PYTHON_THREAD_END_ALLOW;
    4064             :     }
    4065           1 :     if ( bLocalUseExceptions ) {
    4066           1 :       popErrorHandler();
    4067             :     }
    4068             : #ifndef SED_HACKS
    4069             :     if ( bLocalUseExceptions ) {
    4070             :       CPLErr eclass = CPLGetLastErrorType();
    4071             :       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
    4072             :         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
    4073             :       }
    4074             :     }
    4075             : #endif
    4076             :   }
    4077           1 :   resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GNMGenericNetworkShadow, 0 |  0 );
    4078           1 :   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
    4079             :   return resultobj;
    4080             : fail:
    4081             :   return NULL;
    4082             : }
    4083             : 
    4084             : 
    4085           0 : SWIGINTERN PyObject *_wrap_delete_Network(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
    4086           0 :   PyObject *resultobj = 0; int bLocalUseExceptionsCode = GetUseExceptions();
    4087           0 :   GNMNetworkShadow *arg1 = (GNMNetworkShadow *) 0 ;
    4088           0 :   void *argp1 = 0 ;
    4089           0 :   int res1 = 0 ;
    4090           0 :   PyObject *swig_obj[1] ;
    4091             :   
    4092           0 :   if (!args) SWIG_fail;
    4093           0 :   swig_obj[0] = args;
    4094           0 :   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_GNMNetworkShadow, SWIG_POINTER_DISOWN |  0 );
    4095           0 :   if (!SWIG_IsOK(res1)) {
    4096           0 :     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_Network" "', argument " "1"" of type '" "GNMNetworkShadow *""'"); 
    4097             :   }
    4098           0 :   arg1 = reinterpret_cast< GNMNetworkShadow * >(argp1);
    4099           0 :   {
    4100           0 :     const int bLocalUseExceptions = GetUseExceptions();
    4101           0 :     if ( bLocalUseExceptions ) {
    4102           0 :       pushErrorHandler();
    4103             :     }
    4104           0 :     {
    4105           0 :       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
    4106           0 :       delete_GNMNetworkShadow(arg1);
    4107           0 :       SWIG_PYTHON_THREAD_END_ALLOW;
    4108             :     }
    4109           0 :     if ( bLocalUseExceptions ) {
    4110           0 :       popErrorHandler();
    4111             :     }
    4112             : #ifndef SED_HACKS
    4113             :     if ( bLocalUseExceptions ) {
    4114             :       CPLErr eclass = CPLGetLastErrorType();
    4115             :       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
    4116             :         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
    4117             :       }
    4118             :     }
    4119             : #endif
    4120             :   }
    4121           0 :   resultobj = SWIG_Py_Void();
    4122           0 :   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
    4123             :   return resultobj;
    4124             : fail:
    4125             :   return NULL;
    4126             : }
    4127             : 
    4128             : 
    4129           3 : SWIGINTERN PyObject *_wrap_Network_ReleaseResultSet(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
    4130           3 :   PyObject *resultobj = 0; int bLocalUseExceptionsCode = GetUseExceptions();
    4131           3 :   GNMNetworkShadow *arg1 = (GNMNetworkShadow *) 0 ;
    4132           3 :   OGRLayerShadow *arg2 = (OGRLayerShadow *) 0 ;
    4133           3 :   void *argp1 = 0 ;
    4134           3 :   int res1 = 0 ;
    4135           3 :   int res2 = 0 ;
    4136           3 :   PyObject *swig_obj[2] ;
    4137             :   
    4138           3 :   if (!SWIG_Python_UnpackTuple(args, "Network_ReleaseResultSet", 2, 2, swig_obj)) SWIG_fail;
    4139           3 :   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_GNMNetworkShadow, 0 |  0 );
    4140           3 :   if (!SWIG_IsOK(res1)) {
    4141           0 :     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Network_ReleaseResultSet" "', argument " "1"" of type '" "GNMNetworkShadow *""'"); 
    4142             :   }
    4143           3 :   arg1 = reinterpret_cast< GNMNetworkShadow * >(argp1);
    4144           3 :   res2 = SWIG_ConvertPtr(swig_obj[1], SWIG_as_voidptrptr(&arg2), SWIGTYPE_p_OGRLayerShadow, SWIG_POINTER_DISOWN |  0 );
    4145           3 :   if (!SWIG_IsOK(res2)) {
    4146           0 :     SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Network_ReleaseResultSet" "', argument " "2"" of type '" "OGRLayerShadow *""'");
    4147             :   }
    4148           3 :   {
    4149           3 :     const int bLocalUseExceptions = GetUseExceptions();
    4150           3 :     if ( bLocalUseExceptions ) {
    4151           3 :       pushErrorHandler();
    4152             :     }
    4153           3 :     {
    4154           3 :       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
    4155           3 :       GNMNetworkShadow_ReleaseResultSet(arg1,arg2);
    4156           3 :       SWIG_PYTHON_THREAD_END_ALLOW;
    4157             :     }
    4158           3 :     if ( bLocalUseExceptions ) {
    4159           3 :       popErrorHandler();
    4160             :     }
    4161             : #ifndef SED_HACKS
    4162             :     if ( bLocalUseExceptions ) {
    4163             :       CPLErr eclass = CPLGetLastErrorType();
    4164             :       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
    4165             :         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
    4166             :       }
    4167             :     }
    4168             : #endif
    4169             :   }
    4170           3 :   resultobj = SWIG_Py_Void();
    4171           3 :   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
    4172             :   return resultobj;
    4173             : fail:
    4174             :   return NULL;
    4175             : }
    4176             : 
    4177             : 
    4178           2 : SWIGINTERN PyObject *_wrap_Network_GetVersion(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
    4179           2 :   PyObject *resultobj = 0; int bLocalUseExceptionsCode = GetUseExceptions();
    4180           2 :   GNMNetworkShadow *arg1 = (GNMNetworkShadow *) 0 ;
    4181           2 :   void *argp1 = 0 ;
    4182           2 :   int res1 = 0 ;
    4183           2 :   PyObject *swig_obj[1] ;
    4184           2 :   int result;
    4185             :   
    4186           2 :   if (!args) SWIG_fail;
    4187           2 :   swig_obj[0] = args;
    4188           2 :   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_GNMNetworkShadow, 0 |  0 );
    4189           2 :   if (!SWIG_IsOK(res1)) {
    4190           0 :     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Network_GetVersion" "', argument " "1"" of type '" "GNMNetworkShadow *""'"); 
    4191             :   }
    4192           2 :   arg1 = reinterpret_cast< GNMNetworkShadow * >(argp1);
    4193           2 :   {
    4194           2 :     const int bLocalUseExceptions = GetUseExceptions();
    4195           2 :     if ( bLocalUseExceptions ) {
    4196           2 :       pushErrorHandler();
    4197             :     }
    4198           2 :     {
    4199           2 :       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
    4200           2 :       result = (int)GNMNetworkShadow_GetVersion(arg1);
    4201           2 :       SWIG_PYTHON_THREAD_END_ALLOW;
    4202             :     }
    4203           2 :     if ( bLocalUseExceptions ) {
    4204           2 :       popErrorHandler();
    4205             :     }
    4206             : #ifndef SED_HACKS
    4207             :     if ( bLocalUseExceptions ) {
    4208             :       CPLErr eclass = CPLGetLastErrorType();
    4209             :       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
    4210             :         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
    4211             :       }
    4212             :     }
    4213             : #endif
    4214             :   }
    4215           2 :   resultobj = SWIG_From_int(static_cast< int >(result));
    4216           2 :   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
    4217             :   return resultobj;
    4218             : fail:
    4219             :   return NULL;
    4220             : }
    4221             : 
    4222             : 
    4223           2 : SWIGINTERN PyObject *_wrap_Network_GetName(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
    4224           2 :   PyObject *resultobj = 0; int bLocalUseExceptionsCode = GetUseExceptions();
    4225           2 :   GNMNetworkShadow *arg1 = (GNMNetworkShadow *) 0 ;
    4226           2 :   void *argp1 = 0 ;
    4227           2 :   int res1 = 0 ;
    4228           2 :   PyObject *swig_obj[1] ;
    4229           2 :   char *result = 0 ;
    4230             :   
    4231           2 :   if (!args) SWIG_fail;
    4232           2 :   swig_obj[0] = args;
    4233           2 :   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_GNMNetworkShadow, 0 |  0 );
    4234           2 :   if (!SWIG_IsOK(res1)) {
    4235           0 :     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Network_GetName" "', argument " "1"" of type '" "GNMNetworkShadow *""'"); 
    4236             :   }
    4237           2 :   arg1 = reinterpret_cast< GNMNetworkShadow * >(argp1);
    4238           2 :   {
    4239           2 :     const int bLocalUseExceptions = GetUseExceptions();
    4240           2 :     if ( bLocalUseExceptions ) {
    4241           2 :       pushErrorHandler();
    4242             :     }
    4243           2 :     {
    4244           2 :       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
    4245           2 :       result = (char *)GNMNetworkShadow_GetName(arg1);
    4246           2 :       SWIG_PYTHON_THREAD_END_ALLOW;
    4247             :     }
    4248           2 :     if ( bLocalUseExceptions ) {
    4249           2 :       popErrorHandler();
    4250             :     }
    4251             : #ifndef SED_HACKS
    4252             :     if ( bLocalUseExceptions ) {
    4253             :       CPLErr eclass = CPLGetLastErrorType();
    4254             :       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
    4255             :         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
    4256             :       }
    4257             :     }
    4258             : #endif
    4259             :   }
    4260           2 :   resultobj = SWIG_FromCharPtr((const char *)result);
    4261           2 :   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
    4262             :   return resultobj;
    4263             : fail:
    4264             :   return NULL;
    4265             : }
    4266             : 
    4267             : 
    4268           0 : SWIGINTERN PyObject *_wrap_Network_GetFeatureByGlobalFID(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
    4269           0 :   PyObject *resultobj = 0; int bLocalUseExceptionsCode = GetUseExceptions();
    4270           0 :   GNMNetworkShadow *arg1 = (GNMNetworkShadow *) 0 ;
    4271           0 :   GIntBig arg2 ;
    4272           0 :   void *argp1 = 0 ;
    4273           0 :   int res1 = 0 ;
    4274           0 :   PyObject *swig_obj[2] ;
    4275           0 :   OGRFeatureShadow *result = 0 ;
    4276             :   
    4277           0 :   if (!SWIG_Python_UnpackTuple(args, "Network_GetFeatureByGlobalFID", 2, 2, swig_obj)) SWIG_fail;
    4278           0 :   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_GNMNetworkShadow, 0 |  0 );
    4279           0 :   if (!SWIG_IsOK(res1)) {
    4280           0 :     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Network_GetFeatureByGlobalFID" "', argument " "1"" of type '" "GNMNetworkShadow *""'"); 
    4281             :   }
    4282           0 :   arg1 = reinterpret_cast< GNMNetworkShadow * >(argp1);
    4283           0 :   {
    4284           0 :     arg2 = (GIntBig)PyLong_AsLongLong(swig_obj[1]);
    4285             :   }
    4286           0 :   {
    4287           0 :     const int bLocalUseExceptions = GetUseExceptions();
    4288           0 :     if ( bLocalUseExceptions ) {
    4289           0 :       pushErrorHandler();
    4290             :     }
    4291           0 :     {
    4292           0 :       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
    4293           0 :       result = (OGRFeatureShadow *)GNMNetworkShadow_GetFeatureByGlobalFID(arg1,arg2);
    4294           0 :       SWIG_PYTHON_THREAD_END_ALLOW;
    4295             :     }
    4296           0 :     if ( bLocalUseExceptions ) {
    4297           0 :       popErrorHandler();
    4298             :     }
    4299             : #ifndef SED_HACKS
    4300             :     if ( bLocalUseExceptions ) {
    4301             :       CPLErr eclass = CPLGetLastErrorType();
    4302             :       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
    4303             :         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
    4304             :       }
    4305             :     }
    4306             : #endif
    4307             :   }
    4308           0 :   resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_OGRFeatureShadow, SWIG_POINTER_OWN |  0 );
    4309           0 :   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
    4310             :   return resultobj;
    4311             : fail:
    4312             :   return NULL;
    4313             : }
    4314             : 
    4315             : 
    4316           3 : SWIGINTERN PyObject *_wrap_Network_GetPath(PyObject *SWIGUNUSEDPARM(self), PyObject *args, PyObject *kwargs) {
    4317           3 :   PyObject *resultobj = 0; int bLocalUseExceptionsCode = GetUseExceptions();
    4318           3 :   GNMNetworkShadow *arg1 = (GNMNetworkShadow *) 0 ;
    4319           3 :   GIntBig arg2 ;
    4320           3 :   GIntBig arg3 ;
    4321           3 :   GNMGraphAlgorithmType arg4 ;
    4322           3 :   char **arg5 = (char **) 0 ;
    4323           3 :   void *argp1 = 0 ;
    4324           3 :   int res1 = 0 ;
    4325           3 :   int val4 ;
    4326           3 :   int ecode4 = 0 ;
    4327           3 :   PyObject * obj0 = 0 ;
    4328           3 :   PyObject * obj1 = 0 ;
    4329           3 :   PyObject * obj2 = 0 ;
    4330           3 :   PyObject * obj3 = 0 ;
    4331           3 :   PyObject * obj4 = 0 ;
    4332           3 :   char * kwnames[] = {
    4333             :     (char *)"self",  (char *)"nStartFID",  (char *)"nEndFID",  (char *)"eAlgorithm",  (char *)"options",  NULL 
    4334             :   };
    4335           3 :   OGRLayerShadow *result = 0 ;
    4336             :   
    4337           3 :   if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOOO|O:Network_GetPath", kwnames, &obj0, &obj1, &obj2, &obj3, &obj4)) SWIG_fail;
    4338           3 :   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GNMNetworkShadow, 0 |  0 );
    4339           3 :   if (!SWIG_IsOK(res1)) {
    4340           0 :     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Network_GetPath" "', argument " "1"" of type '" "GNMNetworkShadow *""'"); 
    4341             :   }
    4342           3 :   arg1 = reinterpret_cast< GNMNetworkShadow * >(argp1);
    4343           3 :   {
    4344           3 :     arg2 = (GIntBig)PyLong_AsLongLong(obj1);
    4345             :   }
    4346           3 :   {
    4347           3 :     arg3 = (GIntBig)PyLong_AsLongLong(obj2);
    4348             :   }
    4349           3 :   ecode4 = SWIG_AsVal_int(obj3, &val4);
    4350           3 :   if (!SWIG_IsOK(ecode4)) {
    4351           0 :     SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "Network_GetPath" "', argument " "4"" of type '" "GNMGraphAlgorithmType""'");
    4352             :   } 
    4353           3 :   arg4 = static_cast< GNMGraphAlgorithmType >(val4);
    4354           3 :   if (obj4) {
    4355           1 :     {
    4356             :       /* %typemap(in) char **dict */
    4357           1 :       arg5 = NULL;
    4358           1 :       if ( PySequence_Check( obj4 ) ) {
    4359           1 :         int bErr = FALSE;
    4360           1 :         arg5 = CSLFromPySequence(obj4, &bErr);
    4361           1 :         if ( bErr )
    4362             :         {
    4363           0 :           SWIG_fail;
    4364             :         }
    4365             :       }
    4366           0 :       else if ( PyMapping_Check( obj4 ) ) {
    4367           0 :         int bErr = FALSE;
    4368           0 :         arg5 = CSLFromPyMapping(obj4, &bErr);
    4369           0 :         if ( bErr )
    4370             :         {
    4371           0 :           SWIG_fail;
    4372             :         }
    4373             :       }
    4374             :       else {
    4375           0 :         PyErr_SetString(PyExc_TypeError,"Argument must be dictionary or sequence of strings");
    4376           0 :         SWIG_fail;
    4377             :       }
    4378             :     }
    4379             :   }
    4380           3 :   {
    4381           3 :     const int bLocalUseExceptions = GetUseExceptions();
    4382           3 :     if ( bLocalUseExceptions ) {
    4383           3 :       pushErrorHandler();
    4384             :     }
    4385           3 :     {
    4386           3 :       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
    4387           3 :       result = (OGRLayerShadow *)GNMNetworkShadow_GetPath(arg1,arg2,arg3,arg4,arg5);
    4388           3 :       SWIG_PYTHON_THREAD_END_ALLOW;
    4389             :     }
    4390           3 :     if ( bLocalUseExceptions ) {
    4391           3 :       popErrorHandler();
    4392             :     }
    4393             : #ifndef SED_HACKS
    4394             :     if ( bLocalUseExceptions ) {
    4395             :       CPLErr eclass = CPLGetLastErrorType();
    4396             :       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
    4397             :         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
    4398             :       }
    4399             :     }
    4400             : #endif
    4401             :   }
    4402           3 :   resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_OGRLayerShadow, SWIG_POINTER_OWN |  0 );
    4403           3 :   {
    4404             :     /* %typemap(freearg) char **dict */
    4405           3 :     CSLDestroy( arg5 );
    4406             :   }
    4407           3 :   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
    4408             :   return resultobj;
    4409           0 : fail:
    4410           0 :   {
    4411             :     /* %typemap(freearg) char **dict */
    4412           0 :     CSLDestroy( arg5 );
    4413             :   }
    4414             :   return NULL;
    4415             : }
    4416             : 
    4417             : 
    4418           0 : SWIGINTERN PyObject *_wrap_Network_DisconnectAll(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
    4419           0 :   PyObject *resultobj = 0; int bLocalUseExceptionsCode = GetUseExceptions();
    4420           0 :   GNMNetworkShadow *arg1 = (GNMNetworkShadow *) 0 ;
    4421           0 :   void *argp1 = 0 ;
    4422           0 :   int res1 = 0 ;
    4423           0 :   PyObject *swig_obj[1] ;
    4424           0 :   CPLErr result;
    4425             :   
    4426           0 :   if (!args) SWIG_fail;
    4427           0 :   swig_obj[0] = args;
    4428           0 :   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_GNMNetworkShadow, 0 |  0 );
    4429           0 :   if (!SWIG_IsOK(res1)) {
    4430           0 :     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Network_DisconnectAll" "', argument " "1"" of type '" "GNMNetworkShadow *""'"); 
    4431             :   }
    4432           0 :   arg1 = reinterpret_cast< GNMNetworkShadow * >(argp1);
    4433           0 :   {
    4434           0 :     const int bLocalUseExceptions = GetUseExceptions();
    4435           0 :     if ( bLocalUseExceptions ) {
    4436           0 :       pushErrorHandler();
    4437             :     }
    4438           0 :     {
    4439           0 :       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
    4440           0 :       result = (CPLErr)GNMNetworkShadow_DisconnectAll(arg1);
    4441           0 :       SWIG_PYTHON_THREAD_END_ALLOW;
    4442             :     }
    4443           0 :     if ( bLocalUseExceptions ) {
    4444           0 :       popErrorHandler();
    4445             :     }
    4446             : #ifndef SED_HACKS
    4447             :     if ( bLocalUseExceptions ) {
    4448             :       CPLErr eclass = CPLGetLastErrorType();
    4449             :       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
    4450             :         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
    4451             :       }
    4452             :     }
    4453             : #endif
    4454             :   }
    4455           0 :   resultobj = SWIG_From_int(static_cast< int >(result));
    4456           0 :   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
    4457             :   return resultobj;
    4458             : fail:
    4459             :   return NULL;
    4460             : }
    4461             : 
    4462             : 
    4463           0 : SWIGINTERN PyObject *_wrap_Network_GetProjection(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
    4464           0 :   PyObject *resultobj = 0; int bLocalUseExceptionsCode = GetUseExceptions();
    4465           0 :   GNMNetworkShadow *arg1 = (GNMNetworkShadow *) 0 ;
    4466           0 :   void *argp1 = 0 ;
    4467           0 :   int res1 = 0 ;
    4468           0 :   PyObject *swig_obj[1] ;
    4469           0 :   char *result = 0 ;
    4470             :   
    4471           0 :   if (!args) SWIG_fail;
    4472           0 :   swig_obj[0] = args;
    4473           0 :   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_GNMNetworkShadow, 0 |  0 );
    4474           0 :   if (!SWIG_IsOK(res1)) {
    4475           0 :     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Network_GetProjection" "', argument " "1"" of type '" "GNMNetworkShadow *""'"); 
    4476             :   }
    4477           0 :   arg1 = reinterpret_cast< GNMNetworkShadow * >(argp1);
    4478           0 :   {
    4479           0 :     const int bLocalUseExceptions = GetUseExceptions();
    4480           0 :     if ( bLocalUseExceptions ) {
    4481           0 :       pushErrorHandler();
    4482             :     }
    4483           0 :     {
    4484           0 :       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
    4485           0 :       result = (char *)GNMNetworkShadow_GetProjection(arg1);
    4486           0 :       SWIG_PYTHON_THREAD_END_ALLOW;
    4487             :     }
    4488           0 :     if ( bLocalUseExceptions ) {
    4489           0 :       popErrorHandler();
    4490             :     }
    4491             : #ifndef SED_HACKS
    4492             :     if ( bLocalUseExceptions ) {
    4493             :       CPLErr eclass = CPLGetLastErrorType();
    4494             :       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
    4495             :         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
    4496             :       }
    4497             :     }
    4498             : #endif
    4499             :   }
    4500           0 :   resultobj = SWIG_FromCharPtr((const char *)result);
    4501           0 :   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
    4502             :   return resultobj;
    4503             : fail:
    4504             :   return NULL;
    4505             : }
    4506             : 
    4507             : 
    4508           0 : SWIGINTERN PyObject *_wrap_Network_GetProjectionRef(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
    4509           0 :   PyObject *resultobj = 0; int bLocalUseExceptionsCode = GetUseExceptions();
    4510           0 :   GNMNetworkShadow *arg1 = (GNMNetworkShadow *) 0 ;
    4511           0 :   void *argp1 = 0 ;
    4512           0 :   int res1 = 0 ;
    4513           0 :   PyObject *swig_obj[1] ;
    4514           0 :   char *result = 0 ;
    4515             :   
    4516           0 :   if (!args) SWIG_fail;
    4517           0 :   swig_obj[0] = args;
    4518           0 :   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_GNMNetworkShadow, 0 |  0 );
    4519           0 :   if (!SWIG_IsOK(res1)) {
    4520           0 :     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Network_GetProjectionRef" "', argument " "1"" of type '" "GNMNetworkShadow *""'"); 
    4521             :   }
    4522           0 :   arg1 = reinterpret_cast< GNMNetworkShadow * >(argp1);
    4523           0 :   {
    4524           0 :     const int bLocalUseExceptions = GetUseExceptions();
    4525           0 :     if ( bLocalUseExceptions ) {
    4526           0 :       pushErrorHandler();
    4527             :     }
    4528           0 :     {
    4529           0 :       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
    4530           0 :       result = (char *)GNMNetworkShadow_GetProjectionRef(arg1);
    4531           0 :       SWIG_PYTHON_THREAD_END_ALLOW;
    4532             :     }
    4533           0 :     if ( bLocalUseExceptions ) {
    4534           0 :       popErrorHandler();
    4535             :     }
    4536             : #ifndef SED_HACKS
    4537             :     if ( bLocalUseExceptions ) {
    4538             :       CPLErr eclass = CPLGetLastErrorType();
    4539             :       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
    4540             :         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
    4541             :       }
    4542             :     }
    4543             : #endif
    4544             :   }
    4545           0 :   resultobj = SWIG_FromCharPtr((const char *)result);
    4546           0 :   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
    4547             :   return resultobj;
    4548             : fail:
    4549             :   return NULL;
    4550             : }
    4551             : 
    4552             : 
    4553           0 : SWIGINTERN PyObject *_wrap_Network_GetFileList(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
    4554           0 :   PyObject *resultobj = 0; int bLocalUseExceptionsCode = GetUseExceptions();
    4555           0 :   GNMNetworkShadow *arg1 = (GNMNetworkShadow *) 0 ;
    4556           0 :   void *argp1 = 0 ;
    4557           0 :   int res1 = 0 ;
    4558           0 :   PyObject *swig_obj[1] ;
    4559           0 :   char **result = 0 ;
    4560             :   
    4561           0 :   if (!args) SWIG_fail;
    4562           0 :   swig_obj[0] = args;
    4563           0 :   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_GNMNetworkShadow, 0 |  0 );
    4564           0 :   if (!SWIG_IsOK(res1)) {
    4565           0 :     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Network_GetFileList" "', argument " "1"" of type '" "GNMNetworkShadow *""'"); 
    4566             :   }
    4567           0 :   arg1 = reinterpret_cast< GNMNetworkShadow * >(argp1);
    4568           0 :   {
    4569           0 :     const int bLocalUseExceptions = GetUseExceptions();
    4570           0 :     if ( bLocalUseExceptions ) {
    4571           0 :       pushErrorHandler();
    4572             :     }
    4573           0 :     {
    4574           0 :       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
    4575           0 :       result = (char **)GNMNetworkShadow_GetFileList(arg1);
    4576           0 :       SWIG_PYTHON_THREAD_END_ALLOW;
    4577             :     }
    4578           0 :     if ( bLocalUseExceptions ) {
    4579           0 :       popErrorHandler();
    4580             :     }
    4581             : #ifndef SED_HACKS
    4582             :     if ( bLocalUseExceptions ) {
    4583             :       CPLErr eclass = CPLGetLastErrorType();
    4584             :       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
    4585             :         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
    4586             :       }
    4587             :     }
    4588             : #endif
    4589             :   }
    4590           0 :   {
    4591             :     /* %typemap(out) char **CSL -> ( string ) */
    4592           0 :     bool bErr = false;
    4593           0 :     resultobj = CSLToList(result, &bErr);
    4594           0 :     CSLDestroy(result);
    4595           0 :     if( bErr ) {
    4596           0 :       SWIG_fail;
    4597             :     }
    4598             :   }
    4599           0 :   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
    4600             :   return resultobj;
    4601             : fail:
    4602             :   return NULL;
    4603             : }
    4604             : 
    4605             : 
    4606           0 : SWIGINTERN PyObject *_wrap_Network_CreateLayer(PyObject *SWIGUNUSEDPARM(self), PyObject *args, PyObject *kwargs) {
    4607           0 :   PyObject *resultobj = 0; int bLocalUseExceptionsCode = GetUseExceptions();
    4608           0 :   GNMNetworkShadow *arg1 = (GNMNetworkShadow *) 0 ;
    4609           0 :   char *arg2 = (char *) 0 ;
    4610           0 :   OSRSpatialReferenceShadow *arg3 = (OSRSpatialReferenceShadow *) NULL ;
    4611           0 :   OGRwkbGeometryType arg4 = (OGRwkbGeometryType) wkbUnknown ;
    4612           0 :   char **arg5 = (char **) 0 ;
    4613           0 :   void *argp1 = 0 ;
    4614           0 :   int res1 = 0 ;
    4615           0 :   int res2 ;
    4616           0 :   char *buf2 = 0 ;
    4617           0 :   int alloc2 = 0 ;
    4618           0 :   void *argp3 = 0 ;
    4619           0 :   int res3 = 0 ;
    4620           0 :   int val4 ;
    4621           0 :   int ecode4 = 0 ;
    4622           0 :   PyObject * obj0 = 0 ;
    4623           0 :   PyObject * obj1 = 0 ;
    4624           0 :   PyObject * obj2 = 0 ;
    4625           0 :   PyObject * obj3 = 0 ;
    4626           0 :   PyObject * obj4 = 0 ;
    4627           0 :   char * kwnames[] = {
    4628             :     (char *)"self",  (char *)"name",  (char *)"srs",  (char *)"geom_type",  (char *)"options",  NULL 
    4629             :   };
    4630           0 :   OGRLayerShadow *result = 0 ;
    4631             :   
    4632           0 :   if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OO|OOO:Network_CreateLayer", kwnames, &obj0, &obj1, &obj2, &obj3, &obj4)) SWIG_fail;
    4633           0 :   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GNMNetworkShadow, 0 |  0 );
    4634           0 :   if (!SWIG_IsOK(res1)) {
    4635           0 :     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Network_CreateLayer" "', argument " "1"" of type '" "GNMNetworkShadow *""'"); 
    4636             :   }
    4637           0 :   arg1 = reinterpret_cast< GNMNetworkShadow * >(argp1);
    4638           0 :   res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2);
    4639           0 :   if (!SWIG_IsOK(res2)) {
    4640           0 :     SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Network_CreateLayer" "', argument " "2"" of type '" "char const *""'");
    4641             :   }
    4642           0 :   arg2 = reinterpret_cast< char * >(buf2);
    4643           0 :   if (obj2) {
    4644           0 :     res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_OSRSpatialReferenceShadow, 0 |  0 );
    4645           0 :     if (!SWIG_IsOK(res3)) {
    4646           0 :       SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "Network_CreateLayer" "', argument " "3"" of type '" "OSRSpatialReferenceShadow *""'"); 
    4647             :     }
    4648           0 :     arg3 = reinterpret_cast< OSRSpatialReferenceShadow * >(argp3);
    4649             :   }
    4650           0 :   if (obj3) {
    4651           0 :     ecode4 = SWIG_AsVal_int(obj3, &val4);
    4652           0 :     if (!SWIG_IsOK(ecode4)) {
    4653           0 :       SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "Network_CreateLayer" "', argument " "4"" of type '" "OGRwkbGeometryType""'");
    4654             :     } 
    4655           0 :     arg4 = static_cast< OGRwkbGeometryType >(val4);
    4656             :   }
    4657           0 :   if (obj4) {
    4658           0 :     {
    4659             :       /* %typemap(in) char **dict */
    4660           0 :       arg5 = NULL;
    4661           0 :       if ( PySequence_Check( obj4 ) ) {
    4662           0 :         int bErr = FALSE;
    4663           0 :         arg5 = CSLFromPySequence(obj4, &bErr);
    4664           0 :         if ( bErr )
    4665             :         {
    4666           0 :           SWIG_fail;
    4667             :         }
    4668             :       }
    4669           0 :       else if ( PyMapping_Check( obj4 ) ) {
    4670           0 :         int bErr = FALSE;
    4671           0 :         arg5 = CSLFromPyMapping(obj4, &bErr);
    4672           0 :         if ( bErr )
    4673             :         {
    4674           0 :           SWIG_fail;
    4675             :         }
    4676             :       }
    4677             :       else {
    4678           0 :         PyErr_SetString(PyExc_TypeError,"Argument must be dictionary or sequence of strings");
    4679           0 :         SWIG_fail;
    4680             :       }
    4681             :     }
    4682             :   }
    4683           0 :   {
    4684           0 :     const int bLocalUseExceptions = GetUseExceptions();
    4685           0 :     if ( bLocalUseExceptions ) {
    4686           0 :       pushErrorHandler();
    4687             :     }
    4688           0 :     {
    4689           0 :       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
    4690           0 :       result = (OGRLayerShadow *)GNMNetworkShadow_CreateLayer(arg1,(char const *)arg2,arg3,arg4,arg5);
    4691           0 :       SWIG_PYTHON_THREAD_END_ALLOW;
    4692             :     }
    4693           0 :     if ( bLocalUseExceptions ) {
    4694           0 :       popErrorHandler();
    4695             :     }
    4696             : #ifndef SED_HACKS
    4697             :     if ( bLocalUseExceptions ) {
    4698             :       CPLErr eclass = CPLGetLastErrorType();
    4699             :       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
    4700             :         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
    4701             :       }
    4702             :     }
    4703             : #endif
    4704             :   }
    4705           0 :   resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_OGRLayerShadow, 0 |  0 );
    4706           0 :   if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
    4707           0 :   {
    4708             :     /* %typemap(freearg) char **dict */
    4709           0 :     CSLDestroy( arg5 );
    4710             :   }
    4711           0 :   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
    4712             :   return resultobj;
    4713           0 : fail:
    4714           0 :   if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
    4715           0 :   {
    4716             :     /* %typemap(freearg) char **dict */
    4717           0 :     CSLDestroy( arg5 );
    4718             :   }
    4719             :   return NULL;
    4720             : }
    4721             : 
    4722             : 
    4723           0 : SWIGINTERN PyObject *_wrap_Network_CopyLayer(PyObject *SWIGUNUSEDPARM(self), PyObject *args, PyObject *kwargs) {
    4724           0 :   PyObject *resultobj = 0; int bLocalUseExceptionsCode = GetUseExceptions();
    4725           0 :   GNMNetworkShadow *arg1 = (GNMNetworkShadow *) 0 ;
    4726           0 :   OGRLayerShadow *arg2 = (OGRLayerShadow *) 0 ;
    4727           0 :   char *arg3 = (char *) 0 ;
    4728           0 :   char **arg4 = (char **) 0 ;
    4729           0 :   void *argp1 = 0 ;
    4730           0 :   int res1 = 0 ;
    4731           0 :   void *argp2 = 0 ;
    4732           0 :   int res2 = 0 ;
    4733           0 :   int res3 ;
    4734           0 :   char *buf3 = 0 ;
    4735           0 :   int alloc3 = 0 ;
    4736           0 :   PyObject * obj0 = 0 ;
    4737           0 :   PyObject * obj1 = 0 ;
    4738           0 :   PyObject * obj2 = 0 ;
    4739           0 :   PyObject * obj3 = 0 ;
    4740           0 :   char * kwnames[] = {
    4741             :     (char *)"self",  (char *)"src_layer",  (char *)"new_name",  (char *)"options",  NULL 
    4742             :   };
    4743           0 :   OGRLayerShadow *result = 0 ;
    4744             :   
    4745           0 :   if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOO|O:Network_CopyLayer", kwnames, &obj0, &obj1, &obj2, &obj3)) SWIG_fail;
    4746           0 :   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GNMNetworkShadow, 0 |  0 );
    4747           0 :   if (!SWIG_IsOK(res1)) {
    4748           0 :     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Network_CopyLayer" "', argument " "1"" of type '" "GNMNetworkShadow *""'"); 
    4749             :   }
    4750           0 :   arg1 = reinterpret_cast< GNMNetworkShadow * >(argp1);
    4751           0 :   res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_OGRLayerShadow, 0 |  0 );
    4752           0 :   if (!SWIG_IsOK(res2)) {
    4753           0 :     SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Network_CopyLayer" "', argument " "2"" of type '" "OGRLayerShadow *""'"); 
    4754             :   }
    4755           0 :   arg2 = reinterpret_cast< OGRLayerShadow * >(argp2);
    4756           0 :   res3 = SWIG_AsCharPtrAndSize(obj2, &buf3, NULL, &alloc3);
    4757           0 :   if (!SWIG_IsOK(res3)) {
    4758           0 :     SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "Network_CopyLayer" "', argument " "3"" of type '" "char const *""'");
    4759             :   }
    4760           0 :   arg3 = reinterpret_cast< char * >(buf3);
    4761           0 :   if (obj3) {
    4762           0 :     {
    4763             :       /* %typemap(in) char **dict */
    4764           0 :       arg4 = NULL;
    4765           0 :       if ( PySequence_Check( obj3 ) ) {
    4766           0 :         int bErr = FALSE;
    4767           0 :         arg4 = CSLFromPySequence(obj3, &bErr);
    4768           0 :         if ( bErr )
    4769             :         {
    4770           0 :           SWIG_fail;
    4771             :         }
    4772             :       }
    4773           0 :       else if ( PyMapping_Check( obj3 ) ) {
    4774           0 :         int bErr = FALSE;
    4775           0 :         arg4 = CSLFromPyMapping(obj3, &bErr);
    4776           0 :         if ( bErr )
    4777             :         {
    4778           0 :           SWIG_fail;
    4779             :         }
    4780             :       }
    4781             :       else {
    4782           0 :         PyErr_SetString(PyExc_TypeError,"Argument must be dictionary or sequence of strings");
    4783           0 :         SWIG_fail;
    4784             :       }
    4785             :     }
    4786             :   }
    4787           0 :   {
    4788           0 :     if (!arg2) {
    4789           0 :       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
    4790             :     }
    4791             :   }
    4792           0 :   {
    4793           0 :     const int bLocalUseExceptions = GetUseExceptions();
    4794           0 :     if ( bLocalUseExceptions ) {
    4795           0 :       pushErrorHandler();
    4796             :     }
    4797           0 :     {
    4798           0 :       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
    4799           0 :       result = (OGRLayerShadow *)GNMNetworkShadow_CopyLayer(arg1,arg2,(char const *)arg3,arg4);
    4800           0 :       SWIG_PYTHON_THREAD_END_ALLOW;
    4801             :     }
    4802           0 :     if ( bLocalUseExceptions ) {
    4803           0 :       popErrorHandler();
    4804             :     }
    4805             : #ifndef SED_HACKS
    4806             :     if ( bLocalUseExceptions ) {
    4807             :       CPLErr eclass = CPLGetLastErrorType();
    4808             :       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
    4809             :         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
    4810             :       }
    4811             :     }
    4812             : #endif
    4813             :   }
    4814           0 :   resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_OGRLayerShadow, 0 |  0 );
    4815           0 :   if (alloc3 == SWIG_NEWOBJ) delete[] buf3;
    4816           0 :   {
    4817             :     /* %typemap(freearg) char **dict */
    4818           0 :     CSLDestroy( arg4 );
    4819             :   }
    4820           0 :   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
    4821             :   return resultobj;
    4822           0 : fail:
    4823           0 :   if (alloc3 == SWIG_NEWOBJ) delete[] buf3;
    4824           0 :   {
    4825             :     /* %typemap(freearg) char **dict */
    4826           0 :     CSLDestroy( arg4 );
    4827             :   }
    4828             :   return NULL;
    4829             : }
    4830             : 
    4831             : 
    4832           0 : SWIGINTERN PyObject *_wrap_Network_DeleteLayer(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
    4833           0 :   PyObject *resultobj = 0; int bLocalUseExceptionsCode = GetUseExceptions();
    4834           0 :   GNMNetworkShadow *arg1 = (GNMNetworkShadow *) 0 ;
    4835           0 :   int arg2 ;
    4836           0 :   void *argp1 = 0 ;
    4837           0 :   int res1 = 0 ;
    4838           0 :   int val2 ;
    4839           0 :   int ecode2 = 0 ;
    4840           0 :   PyObject *swig_obj[2] ;
    4841           0 :   OGRErr result;
    4842             :   
    4843           0 :   if (!SWIG_Python_UnpackTuple(args, "Network_DeleteLayer", 2, 2, swig_obj)) SWIG_fail;
    4844           0 :   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_GNMNetworkShadow, 0 |  0 );
    4845           0 :   if (!SWIG_IsOK(res1)) {
    4846           0 :     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Network_DeleteLayer" "', argument " "1"" of type '" "GNMNetworkShadow *""'"); 
    4847             :   }
    4848           0 :   arg1 = reinterpret_cast< GNMNetworkShadow * >(argp1);
    4849           0 :   ecode2 = SWIG_AsVal_int(swig_obj[1], &val2);
    4850           0 :   if (!SWIG_IsOK(ecode2)) {
    4851           0 :     SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Network_DeleteLayer" "', argument " "2"" of type '" "int""'");
    4852             :   } 
    4853           0 :   arg2 = static_cast< int >(val2);
    4854           0 :   {
    4855           0 :     const int bLocalUseExceptions = GetUseExceptions();
    4856           0 :     if ( bLocalUseExceptions ) {
    4857           0 :       pushErrorHandler();
    4858             :     }
    4859           0 :     {
    4860           0 :       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
    4861           0 :       result = (OGRErr)GNMNetworkShadow_DeleteLayer(arg1,arg2);
    4862           0 :       SWIG_PYTHON_THREAD_END_ALLOW;
    4863             :     }
    4864           0 :     if ( bLocalUseExceptions ) {
    4865           0 :       popErrorHandler();
    4866             :     }
    4867             : #ifndef SED_HACKS
    4868             :     if ( bLocalUseExceptions ) {
    4869             :       CPLErr eclass = CPLGetLastErrorType();
    4870             :       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
    4871             :         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
    4872             :       }
    4873             :     }
    4874             : #endif
    4875             :   }
    4876           0 :   {
    4877             :     /* %typemap(out) OGRErr */
    4878           0 :     if ( result != 0 && GetUseExceptions()) {
    4879           0 :       const char* pszMessage = CPLGetLastErrorMsg();
    4880           0 :       if( pszMessage[0] != '\0' )
    4881           0 :       PyErr_SetString( PyExc_RuntimeError, pszMessage );
    4882             :       else
    4883           0 :       PyErr_SetString( PyExc_RuntimeError, OGRErrMessages(result) );
    4884           0 :       SWIG_fail;
    4885             :     }
    4886             :   }
    4887           0 :   {
    4888             :     /* %typemap(ret) OGRErr */
    4889           0 :     if ( ReturnSame(resultobj == Py_None || resultobj == 0) ) {
    4890           0 :       resultobj = PyInt_FromLong( result );
    4891             :     }
    4892             :   }
    4893           0 :   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
    4894             :   return resultobj;
    4895             : fail:
    4896             :   return NULL;
    4897             : }
    4898             : 
    4899             : 
    4900           0 : SWIGINTERN PyObject *_wrap_Network_GetLayerCount(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
    4901           0 :   PyObject *resultobj = 0; int bLocalUseExceptionsCode = GetUseExceptions();
    4902           0 :   GNMNetworkShadow *arg1 = (GNMNetworkShadow *) 0 ;
    4903           0 :   void *argp1 = 0 ;
    4904           0 :   int res1 = 0 ;
    4905           0 :   PyObject *swig_obj[1] ;
    4906           0 :   int result;
    4907             :   
    4908           0 :   if (!args) SWIG_fail;
    4909           0 :   swig_obj[0] = args;
    4910           0 :   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_GNMNetworkShadow, 0 |  0 );
    4911           0 :   if (!SWIG_IsOK(res1)) {
    4912           0 :     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Network_GetLayerCount" "', argument " "1"" of type '" "GNMNetworkShadow *""'"); 
    4913             :   }
    4914           0 :   arg1 = reinterpret_cast< GNMNetworkShadow * >(argp1);
    4915           0 :   {
    4916           0 :     const int bLocalUseExceptions = GetUseExceptions();
    4917           0 :     if ( bLocalUseExceptions ) {
    4918           0 :       pushErrorHandler();
    4919             :     }
    4920           0 :     {
    4921           0 :       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
    4922           0 :       result = (int)GNMNetworkShadow_GetLayerCount(arg1);
    4923           0 :       SWIG_PYTHON_THREAD_END_ALLOW;
    4924             :     }
    4925           0 :     if ( bLocalUseExceptions ) {
    4926           0 :       popErrorHandler();
    4927             :     }
    4928             : #ifndef SED_HACKS
    4929             :     if ( bLocalUseExceptions ) {
    4930             :       CPLErr eclass = CPLGetLastErrorType();
    4931             :       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
    4932             :         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
    4933             :       }
    4934             :     }
    4935             : #endif
    4936             :   }
    4937           0 :   resultobj = SWIG_From_int(static_cast< int >(result));
    4938           0 :   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
    4939             :   return resultobj;
    4940             : fail:
    4941             :   return NULL;
    4942             : }
    4943             : 
    4944             : 
    4945           0 : SWIGINTERN PyObject *_wrap_Network_GetLayerByIndex(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
    4946           0 :   PyObject *resultobj = 0; int bLocalUseExceptionsCode = GetUseExceptions();
    4947           0 :   GNMNetworkShadow *arg1 = (GNMNetworkShadow *) 0 ;
    4948           0 :   int arg2 = (int) 0 ;
    4949           0 :   void *argp1 = 0 ;
    4950           0 :   int res1 = 0 ;
    4951           0 :   int val2 ;
    4952           0 :   int ecode2 = 0 ;
    4953           0 :   PyObject *swig_obj[2] ;
    4954           0 :   OGRLayerShadow *result = 0 ;
    4955             :   
    4956           0 :   if (!SWIG_Python_UnpackTuple(args, "Network_GetLayerByIndex", 1, 2, swig_obj)) SWIG_fail;
    4957           0 :   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_GNMNetworkShadow, 0 |  0 );
    4958           0 :   if (!SWIG_IsOK(res1)) {
    4959           0 :     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Network_GetLayerByIndex" "', argument " "1"" of type '" "GNMNetworkShadow *""'"); 
    4960             :   }
    4961           0 :   arg1 = reinterpret_cast< GNMNetworkShadow * >(argp1);
    4962           0 :   if (swig_obj[1]) {
    4963           0 :     ecode2 = SWIG_AsVal_int(swig_obj[1], &val2);
    4964           0 :     if (!SWIG_IsOK(ecode2)) {
    4965           0 :       SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Network_GetLayerByIndex" "', argument " "2"" of type '" "int""'");
    4966             :     } 
    4967             :     arg2 = static_cast< int >(val2);
    4968             :   }
    4969           0 :   {
    4970           0 :     const int bLocalUseExceptions = GetUseExceptions();
    4971           0 :     if ( bLocalUseExceptions ) {
    4972           0 :       pushErrorHandler();
    4973             :     }
    4974           0 :     {
    4975           0 :       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
    4976           0 :       result = (OGRLayerShadow *)GNMNetworkShadow_GetLayerByIndex(arg1,arg2);
    4977           0 :       SWIG_PYTHON_THREAD_END_ALLOW;
    4978             :     }
    4979           0 :     if ( bLocalUseExceptions ) {
    4980           0 :       popErrorHandler();
    4981             :     }
    4982             : #ifndef SED_HACKS
    4983             :     if ( bLocalUseExceptions ) {
    4984             :       CPLErr eclass = CPLGetLastErrorType();
    4985             :       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
    4986             :         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
    4987             :       }
    4988             :     }
    4989             : #endif
    4990             :   }
    4991           0 :   resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_OGRLayerShadow, 0 |  0 );
    4992           0 :   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
    4993             :   return resultobj;
    4994             : fail:
    4995             :   return NULL;
    4996             : }
    4997             : 
    4998             : 
    4999           0 : SWIGINTERN PyObject *_wrap_Network_GetLayerByName(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
    5000           0 :   PyObject *resultobj = 0; int bLocalUseExceptionsCode = GetUseExceptions();
    5001           0 :   GNMNetworkShadow *arg1 = (GNMNetworkShadow *) 0 ;
    5002           0 :   char *arg2 = (char *) 0 ;
    5003           0 :   void *argp1 = 0 ;
    5004           0 :   int res1 = 0 ;
    5005           0 :   int res2 ;
    5006           0 :   char *buf2 = 0 ;
    5007           0 :   int alloc2 = 0 ;
    5008           0 :   PyObject *swig_obj[2] ;
    5009           0 :   OGRLayerShadow *result = 0 ;
    5010             :   
    5011           0 :   if (!SWIG_Python_UnpackTuple(args, "Network_GetLayerByName", 2, 2, swig_obj)) SWIG_fail;
    5012           0 :   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_GNMNetworkShadow, 0 |  0 );
    5013           0 :   if (!SWIG_IsOK(res1)) {
    5014           0 :     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Network_GetLayerByName" "', argument " "1"" of type '" "GNMNetworkShadow *""'"); 
    5015             :   }
    5016           0 :   arg1 = reinterpret_cast< GNMNetworkShadow * >(argp1);
    5017           0 :   res2 = SWIG_AsCharPtrAndSize(swig_obj[1], &buf2, NULL, &alloc2);
    5018           0 :   if (!SWIG_IsOK(res2)) {
    5019           0 :     SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Network_GetLayerByName" "', argument " "2"" of type '" "char const *""'");
    5020             :   }
    5021           0 :   arg2 = reinterpret_cast< char * >(buf2);
    5022           0 :   {
    5023           0 :     const int bLocalUseExceptions = GetUseExceptions();
    5024           0 :     if ( bLocalUseExceptions ) {
    5025           0 :       pushErrorHandler();
    5026             :     }
    5027           0 :     {
    5028           0 :       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
    5029           0 :       result = (OGRLayerShadow *)GNMNetworkShadow_GetLayerByName(arg1,(char const *)arg2);
    5030           0 :       SWIG_PYTHON_THREAD_END_ALLOW;
    5031             :     }
    5032           0 :     if ( bLocalUseExceptions ) {
    5033           0 :       popErrorHandler();
    5034             :     }
    5035             : #ifndef SED_HACKS
    5036             :     if ( bLocalUseExceptions ) {
    5037             :       CPLErr eclass = CPLGetLastErrorType();
    5038             :       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
    5039             :         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
    5040             :       }
    5041             :     }
    5042             : #endif
    5043             :   }
    5044           0 :   resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_OGRLayerShadow, 0 |  0 );
    5045           0 :   if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
    5046           0 :   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
    5047             :   return resultobj;
    5048           0 : fail:
    5049           0 :   if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
    5050             :   return NULL;
    5051             : }
    5052             : 
    5053             : 
    5054           0 : SWIGINTERN PyObject *_wrap_Network_TestCapability(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
    5055           0 :   PyObject *resultobj = 0; int bLocalUseExceptionsCode = GetUseExceptions();
    5056           0 :   GNMNetworkShadow *arg1 = (GNMNetworkShadow *) 0 ;
    5057           0 :   char *arg2 = (char *) 0 ;
    5058           0 :   void *argp1 = 0 ;
    5059           0 :   int res1 = 0 ;
    5060           0 :   int res2 ;
    5061           0 :   char *buf2 = 0 ;
    5062           0 :   int alloc2 = 0 ;
    5063           0 :   PyObject *swig_obj[2] ;
    5064           0 :   bool result;
    5065             :   
    5066           0 :   if (!SWIG_Python_UnpackTuple(args, "Network_TestCapability", 2, 2, swig_obj)) SWIG_fail;
    5067           0 :   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_GNMNetworkShadow, 0 |  0 );
    5068           0 :   if (!SWIG_IsOK(res1)) {
    5069           0 :     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Network_TestCapability" "', argument " "1"" of type '" "GNMNetworkShadow *""'"); 
    5070             :   }
    5071           0 :   arg1 = reinterpret_cast< GNMNetworkShadow * >(argp1);
    5072           0 :   res2 = SWIG_AsCharPtrAndSize(swig_obj[1], &buf2, NULL, &alloc2);
    5073           0 :   if (!SWIG_IsOK(res2)) {
    5074           0 :     SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Network_TestCapability" "', argument " "2"" of type '" "char const *""'");
    5075             :   }
    5076           0 :   arg2 = reinterpret_cast< char * >(buf2);
    5077           0 :   {
    5078           0 :     const int bLocalUseExceptions = GetUseExceptions();
    5079           0 :     if ( bLocalUseExceptions ) {
    5080           0 :       pushErrorHandler();
    5081             :     }
    5082           0 :     {
    5083           0 :       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
    5084           0 :       result = (bool)GNMNetworkShadow_TestCapability(arg1,(char const *)arg2);
    5085           0 :       SWIG_PYTHON_THREAD_END_ALLOW;
    5086             :     }
    5087           0 :     if ( bLocalUseExceptions ) {
    5088           0 :       popErrorHandler();
    5089             :     }
    5090             : #ifndef SED_HACKS
    5091             :     if ( bLocalUseExceptions ) {
    5092             :       CPLErr eclass = CPLGetLastErrorType();
    5093             :       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
    5094             :         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
    5095             :       }
    5096             :     }
    5097             : #endif
    5098             :   }
    5099           0 :   resultobj = SWIG_From_bool(static_cast< bool >(result));
    5100           0 :   if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
    5101           0 :   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
    5102             :   return resultobj;
    5103           0 : fail:
    5104           0 :   if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
    5105             :   return NULL;
    5106             : }
    5107             : 
    5108             : 
    5109           0 : SWIGINTERN PyObject *_wrap_Network_StartTransaction(PyObject *SWIGUNUSEDPARM(self), PyObject *args, PyObject *kwargs) {
    5110           0 :   PyObject *resultobj = 0; int bLocalUseExceptionsCode = GetUseExceptions();
    5111           0 :   GNMNetworkShadow *arg1 = (GNMNetworkShadow *) 0 ;
    5112           0 :   int arg2 = (int) FALSE ;
    5113           0 :   void *argp1 = 0 ;
    5114           0 :   int res1 = 0 ;
    5115           0 :   int val2 ;
    5116           0 :   int ecode2 = 0 ;
    5117           0 :   PyObject * obj0 = 0 ;
    5118           0 :   PyObject * obj1 = 0 ;
    5119           0 :   char * kwnames[] = {
    5120             :     (char *)"self",  (char *)"force",  NULL 
    5121             :   };
    5122           0 :   OGRErr result;
    5123             :   
    5124           0 :   if (!PyArg_ParseTupleAndKeywords(args, kwargs, "O|O:Network_StartTransaction", kwnames, &obj0, &obj1)) SWIG_fail;
    5125           0 :   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GNMNetworkShadow, 0 |  0 );
    5126           0 :   if (!SWIG_IsOK(res1)) {
    5127           0 :     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Network_StartTransaction" "', argument " "1"" of type '" "GNMNetworkShadow *""'"); 
    5128             :   }
    5129           0 :   arg1 = reinterpret_cast< GNMNetworkShadow * >(argp1);
    5130           0 :   if (obj1) {
    5131           0 :     ecode2 = SWIG_AsVal_int(obj1, &val2);
    5132           0 :     if (!SWIG_IsOK(ecode2)) {
    5133           0 :       SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Network_StartTransaction" "', argument " "2"" of type '" "int""'");
    5134             :     } 
    5135             :     arg2 = static_cast< int >(val2);
    5136             :   }
    5137           0 :   {
    5138           0 :     const int bLocalUseExceptions = GetUseExceptions();
    5139           0 :     if ( bLocalUseExceptions ) {
    5140           0 :       pushErrorHandler();
    5141             :     }
    5142           0 :     {
    5143           0 :       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
    5144           0 :       result = (OGRErr)GNMNetworkShadow_StartTransaction(arg1,arg2);
    5145           0 :       SWIG_PYTHON_THREAD_END_ALLOW;
    5146             :     }
    5147           0 :     if ( bLocalUseExceptions ) {
    5148           0 :       popErrorHandler();
    5149             :     }
    5150             : #ifndef SED_HACKS
    5151             :     if ( bLocalUseExceptions ) {
    5152             :       CPLErr eclass = CPLGetLastErrorType();
    5153             :       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
    5154             :         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
    5155             :       }
    5156             :     }
    5157             : #endif
    5158             :   }
    5159           0 :   {
    5160             :     /* %typemap(out) OGRErr */
    5161           0 :     if ( result != 0 && GetUseExceptions()) {
    5162           0 :       const char* pszMessage = CPLGetLastErrorMsg();
    5163           0 :       if( pszMessage[0] != '\0' )
    5164           0 :       PyErr_SetString( PyExc_RuntimeError, pszMessage );
    5165             :       else
    5166           0 :       PyErr_SetString( PyExc_RuntimeError, OGRErrMessages(result) );
    5167           0 :       SWIG_fail;
    5168             :     }
    5169             :   }
    5170           0 :   {
    5171             :     /* %typemap(ret) OGRErr */
    5172           0 :     if ( ReturnSame(resultobj == Py_None || resultobj == 0) ) {
    5173           0 :       resultobj = PyInt_FromLong( result );
    5174             :     }
    5175             :   }
    5176           0 :   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
    5177             :   return resultobj;
    5178             : fail:
    5179             :   return NULL;
    5180             : }
    5181             : 
    5182             : 
    5183           0 : SWIGINTERN PyObject *_wrap_Network_CommitTransaction(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
    5184           0 :   PyObject *resultobj = 0; int bLocalUseExceptionsCode = GetUseExceptions();
    5185           0 :   GNMNetworkShadow *arg1 = (GNMNetworkShadow *) 0 ;
    5186           0 :   void *argp1 = 0 ;
    5187           0 :   int res1 = 0 ;
    5188           0 :   PyObject *swig_obj[1] ;
    5189           0 :   OGRErr result;
    5190             :   
    5191           0 :   if (!args) SWIG_fail;
    5192           0 :   swig_obj[0] = args;
    5193           0 :   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_GNMNetworkShadow, 0 |  0 );
    5194           0 :   if (!SWIG_IsOK(res1)) {
    5195           0 :     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Network_CommitTransaction" "', argument " "1"" of type '" "GNMNetworkShadow *""'"); 
    5196             :   }
    5197           0 :   arg1 = reinterpret_cast< GNMNetworkShadow * >(argp1);
    5198           0 :   {
    5199           0 :     const int bLocalUseExceptions = GetUseExceptions();
    5200           0 :     if ( bLocalUseExceptions ) {
    5201           0 :       pushErrorHandler();
    5202             :     }
    5203           0 :     {
    5204           0 :       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
    5205           0 :       result = (OGRErr)GNMNetworkShadow_CommitTransaction(arg1);
    5206           0 :       SWIG_PYTHON_THREAD_END_ALLOW;
    5207             :     }
    5208           0 :     if ( bLocalUseExceptions ) {
    5209           0 :       popErrorHandler();
    5210             :     }
    5211             : #ifndef SED_HACKS
    5212             :     if ( bLocalUseExceptions ) {
    5213             :       CPLErr eclass = CPLGetLastErrorType();
    5214             :       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
    5215             :         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
    5216             :       }
    5217             :     }
    5218             : #endif
    5219             :   }
    5220           0 :   {
    5221             :     /* %typemap(out) OGRErr */
    5222           0 :     if ( result != 0 && GetUseExceptions()) {
    5223           0 :       const char* pszMessage = CPLGetLastErrorMsg();
    5224           0 :       if( pszMessage[0] != '\0' )
    5225           0 :       PyErr_SetString( PyExc_RuntimeError, pszMessage );
    5226             :       else
    5227           0 :       PyErr_SetString( PyExc_RuntimeError, OGRErrMessages(result) );
    5228           0 :       SWIG_fail;
    5229             :     }
    5230             :   }
    5231           0 :   {
    5232             :     /* %typemap(ret) OGRErr */
    5233           0 :     if ( ReturnSame(resultobj == Py_None || resultobj == 0) ) {
    5234           0 :       resultobj = PyInt_FromLong( result );
    5235             :     }
    5236             :   }
    5237           0 :   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
    5238             :   return resultobj;
    5239             : fail:
    5240             :   return NULL;
    5241             : }
    5242             : 
    5243             : 
    5244           0 : SWIGINTERN PyObject *_wrap_Network_RollbackTransaction(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
    5245           0 :   PyObject *resultobj = 0; int bLocalUseExceptionsCode = GetUseExceptions();
    5246           0 :   GNMNetworkShadow *arg1 = (GNMNetworkShadow *) 0 ;
    5247           0 :   void *argp1 = 0 ;
    5248           0 :   int res1 = 0 ;
    5249           0 :   PyObject *swig_obj[1] ;
    5250           0 :   OGRErr result;
    5251             :   
    5252           0 :   if (!args) SWIG_fail;
    5253           0 :   swig_obj[0] = args;
    5254           0 :   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_GNMNetworkShadow, 0 |  0 );
    5255           0 :   if (!SWIG_IsOK(res1)) {
    5256           0 :     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Network_RollbackTransaction" "', argument " "1"" of type '" "GNMNetworkShadow *""'"); 
    5257             :   }
    5258           0 :   arg1 = reinterpret_cast< GNMNetworkShadow * >(argp1);
    5259           0 :   {
    5260           0 :     const int bLocalUseExceptions = GetUseExceptions();
    5261           0 :     if ( bLocalUseExceptions ) {
    5262           0 :       pushErrorHandler();
    5263             :     }
    5264           0 :     {
    5265           0 :       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
    5266           0 :       result = (OGRErr)GNMNetworkShadow_RollbackTransaction(arg1);
    5267           0 :       SWIG_PYTHON_THREAD_END_ALLOW;
    5268             :     }
    5269           0 :     if ( bLocalUseExceptions ) {
    5270           0 :       popErrorHandler();
    5271             :     }
    5272             : #ifndef SED_HACKS
    5273             :     if ( bLocalUseExceptions ) {
    5274             :       CPLErr eclass = CPLGetLastErrorType();
    5275             :       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
    5276             :         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
    5277             :       }
    5278             :     }
    5279             : #endif
    5280             :   }
    5281           0 :   {
    5282             :     /* %typemap(out) OGRErr */
    5283           0 :     if ( result != 0 && GetUseExceptions()) {
    5284           0 :       const char* pszMessage = CPLGetLastErrorMsg();
    5285           0 :       if( pszMessage[0] != '\0' )
    5286           0 :       PyErr_SetString( PyExc_RuntimeError, pszMessage );
    5287             :       else
    5288           0 :       PyErr_SetString( PyExc_RuntimeError, OGRErrMessages(result) );
    5289           0 :       SWIG_fail;
    5290             :     }
    5291             :   }
    5292           0 :   {
    5293             :     /* %typemap(ret) OGRErr */
    5294           0 :     if ( ReturnSame(resultobj == Py_None || resultobj == 0) ) {
    5295           0 :       resultobj = PyInt_FromLong( result );
    5296             :     }
    5297             :   }
    5298           0 :   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
    5299             :   return resultobj;
    5300             : fail:
    5301             :   return NULL;
    5302             : }
    5303             : 
    5304             : 
    5305          28 : SWIGINTERN PyObject *Network_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
    5306          28 :   PyObject *obj;
    5307          28 :   if (!SWIG_Python_UnpackTuple(args, "swigregister", 1, 1, &obj)) return NULL;
    5308          28 :   SWIG_TypeNewClientData(SWIGTYPE_p_GNMNetworkShadow, SWIG_NewClientData(obj));
    5309          28 :   return SWIG_Py_Void();
    5310             : }
    5311             : 
    5312           0 : SWIGINTERN PyObject *_wrap_delete_GenericNetwork(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
    5313           0 :   PyObject *resultobj = 0; int bLocalUseExceptionsCode = GetUseExceptions();
    5314           0 :   GNMGenericNetworkShadow *arg1 = (GNMGenericNetworkShadow *) 0 ;
    5315           0 :   void *argp1 = 0 ;
    5316           0 :   int res1 = 0 ;
    5317           0 :   PyObject *swig_obj[1] ;
    5318             :   
    5319           0 :   if (!args) SWIG_fail;
    5320           0 :   swig_obj[0] = args;
    5321           0 :   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_GNMGenericNetworkShadow, SWIG_POINTER_DISOWN |  0 );
    5322           0 :   if (!SWIG_IsOK(res1)) {
    5323           0 :     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_GenericNetwork" "', argument " "1"" of type '" "GNMGenericNetworkShadow *""'"); 
    5324             :   }
    5325           0 :   arg1 = reinterpret_cast< GNMGenericNetworkShadow * >(argp1);
    5326           0 :   {
    5327           0 :     const int bLocalUseExceptions = GetUseExceptions();
    5328           0 :     if ( bLocalUseExceptions ) {
    5329           0 :       pushErrorHandler();
    5330             :     }
    5331           0 :     {
    5332           0 :       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
    5333           0 :       delete_GNMGenericNetworkShadow(arg1);
    5334           0 :       SWIG_PYTHON_THREAD_END_ALLOW;
    5335             :     }
    5336           0 :     if ( bLocalUseExceptions ) {
    5337           0 :       popErrorHandler();
    5338             :     }
    5339             : #ifndef SED_HACKS
    5340             :     if ( bLocalUseExceptions ) {
    5341             :       CPLErr eclass = CPLGetLastErrorType();
    5342             :       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
    5343             :         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
    5344             :       }
    5345             :     }
    5346             : #endif
    5347             :   }
    5348           0 :   resultobj = SWIG_Py_Void();
    5349           0 :   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
    5350             :   return resultobj;
    5351             : fail:
    5352             :   return NULL;
    5353             : }
    5354             : 
    5355             : 
    5356           0 : SWIGINTERN PyObject *_wrap_GenericNetwork_ConnectFeatures(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
    5357           0 :   PyObject *resultobj = 0; int bLocalUseExceptionsCode = GetUseExceptions();
    5358           0 :   GNMGenericNetworkShadow *arg1 = (GNMGenericNetworkShadow *) 0 ;
    5359           0 :   GIntBig arg2 ;
    5360           0 :   GIntBig arg3 ;
    5361           0 :   GIntBig arg4 ;
    5362           0 :   double arg5 ;
    5363           0 :   double arg6 ;
    5364           0 :   GNMDirection arg7 ;
    5365           0 :   void *argp1 = 0 ;
    5366           0 :   int res1 = 0 ;
    5367           0 :   double val5 ;
    5368           0 :   int ecode5 = 0 ;
    5369           0 :   double val6 ;
    5370           0 :   int ecode6 = 0 ;
    5371           0 :   int val7 ;
    5372           0 :   int ecode7 = 0 ;
    5373           0 :   PyObject *swig_obj[7] ;
    5374           0 :   CPLErr result;
    5375             :   
    5376           0 :   if (!SWIG_Python_UnpackTuple(args, "GenericNetwork_ConnectFeatures", 7, 7, swig_obj)) SWIG_fail;
    5377           0 :   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_GNMGenericNetworkShadow, 0 |  0 );
    5378           0 :   if (!SWIG_IsOK(res1)) {
    5379           0 :     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "GenericNetwork_ConnectFeatures" "', argument " "1"" of type '" "GNMGenericNetworkShadow *""'"); 
    5380             :   }
    5381           0 :   arg1 = reinterpret_cast< GNMGenericNetworkShadow * >(argp1);
    5382           0 :   {
    5383           0 :     arg2 = (GIntBig)PyLong_AsLongLong(swig_obj[1]);
    5384             :   }
    5385           0 :   {
    5386           0 :     arg3 = (GIntBig)PyLong_AsLongLong(swig_obj[2]);
    5387             :   }
    5388           0 :   {
    5389           0 :     arg4 = (GIntBig)PyLong_AsLongLong(swig_obj[3]);
    5390             :   }
    5391           0 :   ecode5 = SWIG_AsVal_double(swig_obj[4], &val5);
    5392           0 :   if (!SWIG_IsOK(ecode5)) {
    5393           0 :     SWIG_exception_fail(SWIG_ArgError(ecode5), "in method '" "GenericNetwork_ConnectFeatures" "', argument " "5"" of type '" "double""'");
    5394             :   } 
    5395           0 :   arg5 = static_cast< double >(val5);
    5396           0 :   ecode6 = SWIG_AsVal_double(swig_obj[5], &val6);
    5397           0 :   if (!SWIG_IsOK(ecode6)) {
    5398           0 :     SWIG_exception_fail(SWIG_ArgError(ecode6), "in method '" "GenericNetwork_ConnectFeatures" "', argument " "6"" of type '" "double""'");
    5399             :   } 
    5400           0 :   arg6 = static_cast< double >(val6);
    5401           0 :   ecode7 = SWIG_AsVal_int(swig_obj[6], &val7);
    5402           0 :   if (!SWIG_IsOK(ecode7)) {
    5403           0 :     SWIG_exception_fail(SWIG_ArgError(ecode7), "in method '" "GenericNetwork_ConnectFeatures" "', argument " "7"" of type '" "GNMDirection""'");
    5404             :   } 
    5405           0 :   arg7 = static_cast< GNMDirection >(val7);
    5406           0 :   {
    5407           0 :     const int bLocalUseExceptions = GetUseExceptions();
    5408           0 :     if ( bLocalUseExceptions ) {
    5409           0 :       pushErrorHandler();
    5410             :     }
    5411           0 :     {
    5412           0 :       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
    5413           0 :       result = (CPLErr)GNMGenericNetworkShadow_ConnectFeatures(arg1,arg2,arg3,arg4,arg5,arg6,arg7);
    5414           0 :       SWIG_PYTHON_THREAD_END_ALLOW;
    5415             :     }
    5416           0 :     if ( bLocalUseExceptions ) {
    5417           0 :       popErrorHandler();
    5418             :     }
    5419             : #ifndef SED_HACKS
    5420             :     if ( bLocalUseExceptions ) {
    5421             :       CPLErr eclass = CPLGetLastErrorType();
    5422             :       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
    5423             :         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
    5424             :       }
    5425             :     }
    5426             : #endif
    5427             :   }
    5428           0 :   resultobj = SWIG_From_int(static_cast< int >(result));
    5429           0 :   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
    5430             :   return resultobj;
    5431             : fail:
    5432             :   return NULL;
    5433             : }
    5434             : 
    5435             : 
    5436           0 : SWIGINTERN PyObject *_wrap_GenericNetwork_DisconnectFeatures(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
    5437           0 :   PyObject *resultobj = 0; int bLocalUseExceptionsCode = GetUseExceptions();
    5438           0 :   GNMGenericNetworkShadow *arg1 = (GNMGenericNetworkShadow *) 0 ;
    5439           0 :   GIntBig arg2 ;
    5440           0 :   GIntBig arg3 ;
    5441           0 :   GIntBig arg4 ;
    5442           0 :   void *argp1 = 0 ;
    5443           0 :   int res1 = 0 ;
    5444           0 :   PyObject *swig_obj[4] ;
    5445           0 :   CPLErr result;
    5446             :   
    5447           0 :   if (!SWIG_Python_UnpackTuple(args, "GenericNetwork_DisconnectFeatures", 4, 4, swig_obj)) SWIG_fail;
    5448           0 :   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_GNMGenericNetworkShadow, 0 |  0 );
    5449           0 :   if (!SWIG_IsOK(res1)) {
    5450           0 :     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "GenericNetwork_DisconnectFeatures" "', argument " "1"" of type '" "GNMGenericNetworkShadow *""'"); 
    5451             :   }
    5452           0 :   arg1 = reinterpret_cast< GNMGenericNetworkShadow * >(argp1);
    5453           0 :   {
    5454           0 :     arg2 = (GIntBig)PyLong_AsLongLong(swig_obj[1]);
    5455             :   }
    5456           0 :   {
    5457           0 :     arg3 = (GIntBig)PyLong_AsLongLong(swig_obj[2]);
    5458             :   }
    5459           0 :   {
    5460           0 :     arg4 = (GIntBig)PyLong_AsLongLong(swig_obj[3]);
    5461             :   }
    5462           0 :   {
    5463           0 :     const int bLocalUseExceptions = GetUseExceptions();
    5464           0 :     if ( bLocalUseExceptions ) {
    5465           0 :       pushErrorHandler();
    5466             :     }
    5467           0 :     {
    5468           0 :       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
    5469           0 :       result = (CPLErr)GNMGenericNetworkShadow_DisconnectFeatures(arg1,arg2,arg3,arg4);
    5470           0 :       SWIG_PYTHON_THREAD_END_ALLOW;
    5471             :     }
    5472           0 :     if ( bLocalUseExceptions ) {
    5473           0 :       popErrorHandler();
    5474             :     }
    5475             : #ifndef SED_HACKS
    5476             :     if ( bLocalUseExceptions ) {
    5477             :       CPLErr eclass = CPLGetLastErrorType();
    5478             :       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
    5479             :         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
    5480             :       }
    5481             :     }
    5482             : #endif
    5483             :   }
    5484           0 :   resultobj = SWIG_From_int(static_cast< int >(result));
    5485           0 :   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
    5486             :   return resultobj;
    5487             : fail:
    5488             :   return NULL;
    5489             : }
    5490             : 
    5491             : 
    5492           0 : SWIGINTERN PyObject *_wrap_GenericNetwork_DisconnectFeaturesWithId(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
    5493           0 :   PyObject *resultobj = 0; int bLocalUseExceptionsCode = GetUseExceptions();
    5494           0 :   GNMGenericNetworkShadow *arg1 = (GNMGenericNetworkShadow *) 0 ;
    5495           0 :   GIntBig arg2 ;
    5496           0 :   void *argp1 = 0 ;
    5497           0 :   int res1 = 0 ;
    5498           0 :   PyObject *swig_obj[2] ;
    5499           0 :   CPLErr result;
    5500             :   
    5501           0 :   if (!SWIG_Python_UnpackTuple(args, "GenericNetwork_DisconnectFeaturesWithId", 2, 2, swig_obj)) SWIG_fail;
    5502           0 :   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_GNMGenericNetworkShadow, 0 |  0 );
    5503           0 :   if (!SWIG_IsOK(res1)) {
    5504           0 :     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "GenericNetwork_DisconnectFeaturesWithId" "', argument " "1"" of type '" "GNMGenericNetworkShadow *""'"); 
    5505             :   }
    5506           0 :   arg1 = reinterpret_cast< GNMGenericNetworkShadow * >(argp1);
    5507           0 :   {
    5508           0 :     arg2 = (GIntBig)PyLong_AsLongLong(swig_obj[1]);
    5509             :   }
    5510           0 :   {
    5511           0 :     const int bLocalUseExceptions = GetUseExceptions();
    5512           0 :     if ( bLocalUseExceptions ) {
    5513           0 :       pushErrorHandler();
    5514             :     }
    5515           0 :     {
    5516           0 :       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
    5517           0 :       result = (CPLErr)GNMGenericNetworkShadow_DisconnectFeaturesWithId(arg1,arg2);
    5518           0 :       SWIG_PYTHON_THREAD_END_ALLOW;
    5519             :     }
    5520           0 :     if ( bLocalUseExceptions ) {
    5521           0 :       popErrorHandler();
    5522             :     }
    5523             : #ifndef SED_HACKS
    5524             :     if ( bLocalUseExceptions ) {
    5525             :       CPLErr eclass = CPLGetLastErrorType();
    5526             :       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
    5527             :         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
    5528             :       }
    5529             :     }
    5530             : #endif
    5531             :   }
    5532           0 :   resultobj = SWIG_From_int(static_cast< int >(result));
    5533           0 :   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
    5534             :   return resultobj;
    5535             : fail:
    5536             :   return NULL;
    5537             : }
    5538             : 
    5539             : 
    5540           0 : SWIGINTERN PyObject *_wrap_GenericNetwork_ReconnectFeatures(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
    5541           0 :   PyObject *resultobj = 0; int bLocalUseExceptionsCode = GetUseExceptions();
    5542           0 :   GNMGenericNetworkShadow *arg1 = (GNMGenericNetworkShadow *) 0 ;
    5543           0 :   GIntBig arg2 ;
    5544           0 :   GIntBig arg3 ;
    5545           0 :   GIntBig arg4 ;
    5546           0 :   double arg5 ;
    5547           0 :   double arg6 ;
    5548           0 :   GNMDirection arg7 ;
    5549           0 :   void *argp1 = 0 ;
    5550           0 :   int res1 = 0 ;
    5551           0 :   double val5 ;
    5552           0 :   int ecode5 = 0 ;
    5553           0 :   double val6 ;
    5554           0 :   int ecode6 = 0 ;
    5555           0 :   int val7 ;
    5556           0 :   int ecode7 = 0 ;
    5557           0 :   PyObject *swig_obj[7] ;
    5558           0 :   CPLErr result;
    5559             :   
    5560           0 :   if (!SWIG_Python_UnpackTuple(args, "GenericNetwork_ReconnectFeatures", 7, 7, swig_obj)) SWIG_fail;
    5561           0 :   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_GNMGenericNetworkShadow, 0 |  0 );
    5562           0 :   if (!SWIG_IsOK(res1)) {
    5563           0 :     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "GenericNetwork_ReconnectFeatures" "', argument " "1"" of type '" "GNMGenericNetworkShadow *""'"); 
    5564             :   }
    5565           0 :   arg1 = reinterpret_cast< GNMGenericNetworkShadow * >(argp1);
    5566           0 :   {
    5567           0 :     arg2 = (GIntBig)PyLong_AsLongLong(swig_obj[1]);
    5568             :   }
    5569           0 :   {
    5570           0 :     arg3 = (GIntBig)PyLong_AsLongLong(swig_obj[2]);
    5571             :   }
    5572           0 :   {
    5573           0 :     arg4 = (GIntBig)PyLong_AsLongLong(swig_obj[3]);
    5574             :   }
    5575           0 :   ecode5 = SWIG_AsVal_double(swig_obj[4], &val5);
    5576           0 :   if (!SWIG_IsOK(ecode5)) {
    5577           0 :     SWIG_exception_fail(SWIG_ArgError(ecode5), "in method '" "GenericNetwork_ReconnectFeatures" "', argument " "5"" of type '" "double""'");
    5578             :   } 
    5579           0 :   arg5 = static_cast< double >(val5);
    5580           0 :   ecode6 = SWIG_AsVal_double(swig_obj[5], &val6);
    5581           0 :   if (!SWIG_IsOK(ecode6)) {
    5582           0 :     SWIG_exception_fail(SWIG_ArgError(ecode6), "in method '" "GenericNetwork_ReconnectFeatures" "', argument " "6"" of type '" "double""'");
    5583             :   } 
    5584           0 :   arg6 = static_cast< double >(val6);
    5585           0 :   ecode7 = SWIG_AsVal_int(swig_obj[6], &val7);
    5586           0 :   if (!SWIG_IsOK(ecode7)) {
    5587           0 :     SWIG_exception_fail(SWIG_ArgError(ecode7), "in method '" "GenericNetwork_ReconnectFeatures" "', argument " "7"" of type '" "GNMDirection""'");
    5588             :   } 
    5589           0 :   arg7 = static_cast< GNMDirection >(val7);
    5590           0 :   {
    5591           0 :     const int bLocalUseExceptions = GetUseExceptions();
    5592           0 :     if ( bLocalUseExceptions ) {
    5593           0 :       pushErrorHandler();
    5594             :     }
    5595           0 :     {
    5596           0 :       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
    5597           0 :       result = (CPLErr)GNMGenericNetworkShadow_ReconnectFeatures(arg1,arg2,arg3,arg4,arg5,arg6,arg7);
    5598           0 :       SWIG_PYTHON_THREAD_END_ALLOW;
    5599             :     }
    5600           0 :     if ( bLocalUseExceptions ) {
    5601           0 :       popErrorHandler();
    5602             :     }
    5603             : #ifndef SED_HACKS
    5604             :     if ( bLocalUseExceptions ) {
    5605             :       CPLErr eclass = CPLGetLastErrorType();
    5606             :       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
    5607             :         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
    5608             :       }
    5609             :     }
    5610             : #endif
    5611             :   }
    5612           0 :   resultobj = SWIG_From_int(static_cast< int >(result));
    5613           0 :   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
    5614             :   return resultobj;
    5615             : fail:
    5616             :   return NULL;
    5617             : }
    5618             : 
    5619             : 
    5620           0 : SWIGINTERN PyObject *_wrap_GenericNetwork_CreateRule(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
    5621           0 :   PyObject *resultobj = 0; int bLocalUseExceptionsCode = GetUseExceptions();
    5622           0 :   GNMGenericNetworkShadow *arg1 = (GNMGenericNetworkShadow *) 0 ;
    5623           0 :   char *arg2 = (char *) 0 ;
    5624           0 :   void *argp1 = 0 ;
    5625           0 :   int res1 = 0 ;
    5626           0 :   int res2 ;
    5627           0 :   char *buf2 = 0 ;
    5628           0 :   int alloc2 = 0 ;
    5629           0 :   PyObject *swig_obj[2] ;
    5630           0 :   CPLErr result;
    5631             :   
    5632           0 :   if (!SWIG_Python_UnpackTuple(args, "GenericNetwork_CreateRule", 2, 2, swig_obj)) SWIG_fail;
    5633           0 :   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_GNMGenericNetworkShadow, 0 |  0 );
    5634           0 :   if (!SWIG_IsOK(res1)) {
    5635           0 :     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "GenericNetwork_CreateRule" "', argument " "1"" of type '" "GNMGenericNetworkShadow *""'"); 
    5636             :   }
    5637           0 :   arg1 = reinterpret_cast< GNMGenericNetworkShadow * >(argp1);
    5638           0 :   res2 = SWIG_AsCharPtrAndSize(swig_obj[1], &buf2, NULL, &alloc2);
    5639           0 :   if (!SWIG_IsOK(res2)) {
    5640           0 :     SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "GenericNetwork_CreateRule" "', argument " "2"" of type '" "char const *""'");
    5641             :   }
    5642           0 :   arg2 = reinterpret_cast< char * >(buf2);
    5643           0 :   {
    5644           0 :     if (!arg2) {
    5645           0 :       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
    5646             :     }
    5647             :   }
    5648           0 :   {
    5649           0 :     const int bLocalUseExceptions = GetUseExceptions();
    5650           0 :     if ( bLocalUseExceptions ) {
    5651           0 :       pushErrorHandler();
    5652             :     }
    5653           0 :     {
    5654           0 :       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
    5655           0 :       result = (CPLErr)GNMGenericNetworkShadow_CreateRule(arg1,(char const *)arg2);
    5656           0 :       SWIG_PYTHON_THREAD_END_ALLOW;
    5657             :     }
    5658           0 :     if ( bLocalUseExceptions ) {
    5659           0 :       popErrorHandler();
    5660             :     }
    5661             : #ifndef SED_HACKS
    5662             :     if ( bLocalUseExceptions ) {
    5663             :       CPLErr eclass = CPLGetLastErrorType();
    5664             :       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
    5665             :         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
    5666             :       }
    5667             :     }
    5668             : #endif
    5669             :   }
    5670           0 :   resultobj = SWIG_From_int(static_cast< int >(result));
    5671           0 :   if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
    5672           0 :   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
    5673             :   return resultobj;
    5674           0 : fail:
    5675           0 :   if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
    5676             :   return NULL;
    5677             : }
    5678             : 
    5679             : 
    5680           0 : SWIGINTERN PyObject *_wrap_GenericNetwork_DeleteAllRules(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
    5681           0 :   PyObject *resultobj = 0; int bLocalUseExceptionsCode = GetUseExceptions();
    5682           0 :   GNMGenericNetworkShadow *arg1 = (GNMGenericNetworkShadow *) 0 ;
    5683           0 :   void *argp1 = 0 ;
    5684           0 :   int res1 = 0 ;
    5685           0 :   PyObject *swig_obj[1] ;
    5686           0 :   CPLErr result;
    5687             :   
    5688           0 :   if (!args) SWIG_fail;
    5689           0 :   swig_obj[0] = args;
    5690           0 :   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_GNMGenericNetworkShadow, 0 |  0 );
    5691           0 :   if (!SWIG_IsOK(res1)) {
    5692           0 :     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "GenericNetwork_DeleteAllRules" "', argument " "1"" of type '" "GNMGenericNetworkShadow *""'"); 
    5693             :   }
    5694           0 :   arg1 = reinterpret_cast< GNMGenericNetworkShadow * >(argp1);
    5695           0 :   {
    5696           0 :     const int bLocalUseExceptions = GetUseExceptions();
    5697           0 :     if ( bLocalUseExceptions ) {
    5698           0 :       pushErrorHandler();
    5699             :     }
    5700           0 :     {
    5701           0 :       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
    5702           0 :       result = (CPLErr)GNMGenericNetworkShadow_DeleteAllRules(arg1);
    5703           0 :       SWIG_PYTHON_THREAD_END_ALLOW;
    5704             :     }
    5705           0 :     if ( bLocalUseExceptions ) {
    5706           0 :       popErrorHandler();
    5707             :     }
    5708             : #ifndef SED_HACKS
    5709             :     if ( bLocalUseExceptions ) {
    5710             :       CPLErr eclass = CPLGetLastErrorType();
    5711             :       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
    5712             :         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
    5713             :       }
    5714             :     }
    5715             : #endif
    5716             :   }
    5717           0 :   resultobj = SWIG_From_int(static_cast< int >(result));
    5718           0 :   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
    5719             :   return resultobj;
    5720             : fail:
    5721             :   return NULL;
    5722             : }
    5723             : 
    5724             : 
    5725           0 : SWIGINTERN PyObject *_wrap_GenericNetwork_DeleteRule(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
    5726           0 :   PyObject *resultobj = 0; int bLocalUseExceptionsCode = GetUseExceptions();
    5727           0 :   GNMGenericNetworkShadow *arg1 = (GNMGenericNetworkShadow *) 0 ;
    5728           0 :   char *arg2 = (char *) 0 ;
    5729           0 :   void *argp1 = 0 ;
    5730           0 :   int res1 = 0 ;
    5731           0 :   int res2 ;
    5732           0 :   char *buf2 = 0 ;
    5733           0 :   int alloc2 = 0 ;
    5734           0 :   PyObject *swig_obj[2] ;
    5735           0 :   CPLErr result;
    5736             :   
    5737           0 :   if (!SWIG_Python_UnpackTuple(args, "GenericNetwork_DeleteRule", 2, 2, swig_obj)) SWIG_fail;
    5738           0 :   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_GNMGenericNetworkShadow, 0 |  0 );
    5739           0 :   if (!SWIG_IsOK(res1)) {
    5740           0 :     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "GenericNetwork_DeleteRule" "', argument " "1"" of type '" "GNMGenericNetworkShadow *""'"); 
    5741             :   }
    5742           0 :   arg1 = reinterpret_cast< GNMGenericNetworkShadow * >(argp1);
    5743           0 :   res2 = SWIG_AsCharPtrAndSize(swig_obj[1], &buf2, NULL, &alloc2);
    5744           0 :   if (!SWIG_IsOK(res2)) {
    5745           0 :     SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "GenericNetwork_DeleteRule" "', argument " "2"" of type '" "char const *""'");
    5746             :   }
    5747           0 :   arg2 = reinterpret_cast< char * >(buf2);
    5748           0 :   {
    5749           0 :     if (!arg2) {
    5750           0 :       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
    5751             :     }
    5752             :   }
    5753           0 :   {
    5754           0 :     const int bLocalUseExceptions = GetUseExceptions();
    5755           0 :     if ( bLocalUseExceptions ) {
    5756           0 :       pushErrorHandler();
    5757             :     }
    5758           0 :     {
    5759           0 :       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
    5760           0 :       result = (CPLErr)GNMGenericNetworkShadow_DeleteRule(arg1,(char const *)arg2);
    5761           0 :       SWIG_PYTHON_THREAD_END_ALLOW;
    5762             :     }
    5763           0 :     if ( bLocalUseExceptions ) {
    5764           0 :       popErrorHandler();
    5765             :     }
    5766             : #ifndef SED_HACKS
    5767             :     if ( bLocalUseExceptions ) {
    5768             :       CPLErr eclass = CPLGetLastErrorType();
    5769             :       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
    5770             :         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
    5771             :       }
    5772             :     }
    5773             : #endif
    5774             :   }
    5775           0 :   resultobj = SWIG_From_int(static_cast< int >(result));
    5776           0 :   if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
    5777           0 :   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
    5778             :   return resultobj;
    5779           0 : fail:
    5780           0 :   if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
    5781             :   return NULL;
    5782             : }
    5783             : 
    5784             : 
    5785           0 : SWIGINTERN PyObject *_wrap_GenericNetwork_GetRules(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
    5786           0 :   PyObject *resultobj = 0; int bLocalUseExceptionsCode = GetUseExceptions();
    5787           0 :   GNMGenericNetworkShadow *arg1 = (GNMGenericNetworkShadow *) 0 ;
    5788           0 :   void *argp1 = 0 ;
    5789           0 :   int res1 = 0 ;
    5790           0 :   PyObject *swig_obj[1] ;
    5791           0 :   char **result = 0 ;
    5792             :   
    5793           0 :   if (!args) SWIG_fail;
    5794           0 :   swig_obj[0] = args;
    5795           0 :   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_GNMGenericNetworkShadow, 0 |  0 );
    5796           0 :   if (!SWIG_IsOK(res1)) {
    5797           0 :     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "GenericNetwork_GetRules" "', argument " "1"" of type '" "GNMGenericNetworkShadow *""'"); 
    5798             :   }
    5799           0 :   arg1 = reinterpret_cast< GNMGenericNetworkShadow * >(argp1);
    5800           0 :   {
    5801           0 :     const int bLocalUseExceptions = GetUseExceptions();
    5802           0 :     if ( bLocalUseExceptions ) {
    5803           0 :       pushErrorHandler();
    5804             :     }
    5805           0 :     {
    5806           0 :       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
    5807           0 :       result = (char **)GNMGenericNetworkShadow_GetRules(arg1);
    5808           0 :       SWIG_PYTHON_THREAD_END_ALLOW;
    5809             :     }
    5810           0 :     if ( bLocalUseExceptions ) {
    5811           0 :       popErrorHandler();
    5812             :     }
    5813             : #ifndef SED_HACKS
    5814             :     if ( bLocalUseExceptions ) {
    5815             :       CPLErr eclass = CPLGetLastErrorType();
    5816             :       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
    5817             :         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
    5818             :       }
    5819             :     }
    5820             : #endif
    5821             :   }
    5822           0 :   {
    5823             :     /* %typemap(out) char **CSL -> ( string ) */
    5824           0 :     bool bErr = false;
    5825           0 :     resultobj = CSLToList(result, &bErr);
    5826           0 :     CSLDestroy(result);
    5827           0 :     if( bErr ) {
    5828           0 :       SWIG_fail;
    5829             :     }
    5830             :   }
    5831           0 :   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
    5832             :   return resultobj;
    5833             : fail:
    5834             :   return NULL;
    5835             : }
    5836             : 
    5837             : 
    5838           1 : SWIGINTERN PyObject *_wrap_GenericNetwork_ConnectPointsByLines(PyObject *SWIGUNUSEDPARM(self), PyObject *args, PyObject *kwargs) {
    5839           1 :   PyObject *resultobj = 0; int bLocalUseExceptionsCode = GetUseExceptions();
    5840           1 :   GNMGenericNetworkShadow *arg1 = (GNMGenericNetworkShadow *) 0 ;
    5841           1 :   char **arg2 = (char **) 0 ;
    5842           1 :   double arg3 ;
    5843           1 :   double arg4 ;
    5844           1 :   double arg5 ;
    5845           1 :   GNMDirection arg6 ;
    5846           1 :   void *argp1 = 0 ;
    5847           1 :   int res1 = 0 ;
    5848           1 :   double val3 ;
    5849           1 :   int ecode3 = 0 ;
    5850           1 :   double val4 ;
    5851           1 :   int ecode4 = 0 ;
    5852           1 :   double val5 ;
    5853           1 :   int ecode5 = 0 ;
    5854           1 :   int val6 ;
    5855           1 :   int ecode6 = 0 ;
    5856           1 :   PyObject * obj0 = 0 ;
    5857           1 :   PyObject * obj1 = 0 ;
    5858           1 :   PyObject * obj2 = 0 ;
    5859           1 :   PyObject * obj3 = 0 ;
    5860           1 :   PyObject * obj4 = 0 ;
    5861           1 :   PyObject * obj5 = 0 ;
    5862           1 :   char * kwnames[] = {
    5863             :     (char *)"self",  (char *)"papszLayerList",  (char *)"dfTolerance",  (char *)"dfCost",  (char *)"dfInvCost",  (char *)"eDir",  NULL 
    5864             :   };
    5865           1 :   CPLErr result;
    5866             :   
    5867           1 :   if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOOOOO:GenericNetwork_ConnectPointsByLines", kwnames, &obj0, &obj1, &obj2, &obj3, &obj4, &obj5)) SWIG_fail;
    5868           1 :   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GNMGenericNetworkShadow, 0 |  0 );
    5869           1 :   if (!SWIG_IsOK(res1)) {
    5870           0 :     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "GenericNetwork_ConnectPointsByLines" "', argument " "1"" of type '" "GNMGenericNetworkShadow *""'"); 
    5871             :   }
    5872           1 :   arg1 = reinterpret_cast< GNMGenericNetworkShadow * >(argp1);
    5873           1 :   {
    5874             :     /* %typemap(in) char **dict */
    5875           1 :     arg2 = NULL;
    5876           1 :     if ( PySequence_Check( obj1 ) ) {
    5877           1 :       int bErr = FALSE;
    5878           1 :       arg2 = CSLFromPySequence(obj1, &bErr);
    5879           1 :       if ( bErr )
    5880             :       {
    5881           0 :         SWIG_fail;
    5882             :       }
    5883             :     }
    5884           0 :     else if ( PyMapping_Check( obj1 ) ) {
    5885           0 :       int bErr = FALSE;
    5886           0 :       arg2 = CSLFromPyMapping(obj1, &bErr);
    5887           0 :       if ( bErr )
    5888             :       {
    5889           0 :         SWIG_fail;
    5890             :       }
    5891             :     }
    5892             :     else {
    5893           0 :       PyErr_SetString(PyExc_TypeError,"Argument must be dictionary or sequence of strings");
    5894           0 :       SWIG_fail;
    5895             :     }
    5896             :   }
    5897           1 :   ecode3 = SWIG_AsVal_double(obj2, &val3);
    5898           1 :   if (!SWIG_IsOK(ecode3)) {
    5899           0 :     SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "GenericNetwork_ConnectPointsByLines" "', argument " "3"" of type '" "double""'");
    5900             :   } 
    5901           1 :   arg3 = static_cast< double >(val3);
    5902           1 :   ecode4 = SWIG_AsVal_double(obj3, &val4);
    5903           1 :   if (!SWIG_IsOK(ecode4)) {
    5904           0 :     SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "GenericNetwork_ConnectPointsByLines" "', argument " "4"" of type '" "double""'");
    5905             :   } 
    5906           1 :   arg4 = static_cast< double >(val4);
    5907           1 :   ecode5 = SWIG_AsVal_double(obj4, &val5);
    5908           1 :   if (!SWIG_IsOK(ecode5)) {
    5909           0 :     SWIG_exception_fail(SWIG_ArgError(ecode5), "in method '" "GenericNetwork_ConnectPointsByLines" "', argument " "5"" of type '" "double""'");
    5910             :   } 
    5911           1 :   arg5 = static_cast< double >(val5);
    5912           1 :   ecode6 = SWIG_AsVal_int(obj5, &val6);
    5913           1 :   if (!SWIG_IsOK(ecode6)) {
    5914           0 :     SWIG_exception_fail(SWIG_ArgError(ecode6), "in method '" "GenericNetwork_ConnectPointsByLines" "', argument " "6"" of type '" "GNMDirection""'");
    5915             :   } 
    5916           1 :   arg6 = static_cast< GNMDirection >(val6);
    5917           1 :   {
    5918           1 :     const int bLocalUseExceptions = GetUseExceptions();
    5919           1 :     if ( bLocalUseExceptions ) {
    5920           1 :       pushErrorHandler();
    5921             :     }
    5922           1 :     {
    5923           1 :       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
    5924           1 :       result = (CPLErr)GNMGenericNetworkShadow_ConnectPointsByLines(arg1,arg2,arg3,arg4,arg5,arg6);
    5925           1 :       SWIG_PYTHON_THREAD_END_ALLOW;
    5926             :     }
    5927           1 :     if ( bLocalUseExceptions ) {
    5928           1 :       popErrorHandler();
    5929             :     }
    5930             : #ifndef SED_HACKS
    5931             :     if ( bLocalUseExceptions ) {
    5932             :       CPLErr eclass = CPLGetLastErrorType();
    5933             :       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
    5934             :         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
    5935             :       }
    5936             :     }
    5937             : #endif
    5938             :   }
    5939           1 :   resultobj = SWIG_From_int(static_cast< int >(result));
    5940           1 :   {
    5941             :     /* %typemap(freearg) char **dict */
    5942           1 :     CSLDestroy( arg2 );
    5943             :   }
    5944           1 :   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
    5945             :   return resultobj;
    5946           0 : fail:
    5947           0 :   {
    5948             :     /* %typemap(freearg) char **dict */
    5949           0 :     CSLDestroy( arg2 );
    5950             :   }
    5951             :   return NULL;
    5952             : }
    5953             : 
    5954             : 
    5955           0 : SWIGINTERN PyObject *_wrap_GenericNetwork_ChangeBlockState(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
    5956           0 :   PyObject *resultobj = 0; int bLocalUseExceptionsCode = GetUseExceptions();
    5957           0 :   GNMGenericNetworkShadow *arg1 = (GNMGenericNetworkShadow *) 0 ;
    5958           0 :   GIntBig arg2 ;
    5959           0 :   bool arg3 ;
    5960           0 :   void *argp1 = 0 ;
    5961           0 :   int res1 = 0 ;
    5962           0 :   bool val3 ;
    5963           0 :   int ecode3 = 0 ;
    5964           0 :   PyObject *swig_obj[3] ;
    5965           0 :   CPLErr result;
    5966             :   
    5967           0 :   if (!SWIG_Python_UnpackTuple(args, "GenericNetwork_ChangeBlockState", 3, 3, swig_obj)) SWIG_fail;
    5968           0 :   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_GNMGenericNetworkShadow, 0 |  0 );
    5969           0 :   if (!SWIG_IsOK(res1)) {
    5970           0 :     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "GenericNetwork_ChangeBlockState" "', argument " "1"" of type '" "GNMGenericNetworkShadow *""'"); 
    5971             :   }
    5972           0 :   arg1 = reinterpret_cast< GNMGenericNetworkShadow * >(argp1);
    5973           0 :   {
    5974           0 :     arg2 = (GIntBig)PyLong_AsLongLong(swig_obj[1]);
    5975             :   }
    5976           0 :   ecode3 = SWIG_AsVal_bool(swig_obj[2], &val3);
    5977           0 :   if (!SWIG_IsOK(ecode3)) {
    5978           0 :     SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "GenericNetwork_ChangeBlockState" "', argument " "3"" of type '" "bool""'");
    5979             :   } 
    5980           0 :   arg3 = static_cast< bool >(val3);
    5981           0 :   {
    5982           0 :     const int bLocalUseExceptions = GetUseExceptions();
    5983           0 :     if ( bLocalUseExceptions ) {
    5984           0 :       pushErrorHandler();
    5985             :     }
    5986           0 :     {
    5987           0 :       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
    5988           0 :       result = (CPLErr)GNMGenericNetworkShadow_ChangeBlockState(arg1,arg2,arg3);
    5989           0 :       SWIG_PYTHON_THREAD_END_ALLOW;
    5990             :     }
    5991           0 :     if ( bLocalUseExceptions ) {
    5992           0 :       popErrorHandler();
    5993             :     }
    5994             : #ifndef SED_HACKS
    5995             :     if ( bLocalUseExceptions ) {
    5996             :       CPLErr eclass = CPLGetLastErrorType();
    5997             :       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
    5998             :         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
    5999             :       }
    6000             :     }
    6001             : #endif
    6002             :   }
    6003           0 :   resultobj = SWIG_From_int(static_cast< int >(result));
    6004           0 :   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
    6005             :   return resultobj;
    6006             : fail:
    6007             :   return NULL;
    6008             : }
    6009             : 
    6010             : 
    6011           0 : SWIGINTERN PyObject *_wrap_GenericNetwork_ChangeAllBlockState(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
    6012           0 :   PyObject *resultobj = 0; int bLocalUseExceptionsCode = GetUseExceptions();
    6013           0 :   GNMGenericNetworkShadow *arg1 = (GNMGenericNetworkShadow *) 0 ;
    6014           0 :   bool arg2 = (bool) false ;
    6015           0 :   void *argp1 = 0 ;
    6016           0 :   int res1 = 0 ;
    6017           0 :   bool val2 ;
    6018           0 :   int ecode2 = 0 ;
    6019           0 :   PyObject *swig_obj[2] ;
    6020           0 :   CPLErr result;
    6021             :   
    6022           0 :   if (!SWIG_Python_UnpackTuple(args, "GenericNetwork_ChangeAllBlockState", 1, 2, swig_obj)) SWIG_fail;
    6023           0 :   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_GNMGenericNetworkShadow, 0 |  0 );
    6024           0 :   if (!SWIG_IsOK(res1)) {
    6025           0 :     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "GenericNetwork_ChangeAllBlockState" "', argument " "1"" of type '" "GNMGenericNetworkShadow *""'"); 
    6026             :   }
    6027           0 :   arg1 = reinterpret_cast< GNMGenericNetworkShadow * >(argp1);
    6028           0 :   if (swig_obj[1]) {
    6029           0 :     ecode2 = SWIG_AsVal_bool(swig_obj[1], &val2);
    6030           0 :     if (!SWIG_IsOK(ecode2)) {
    6031           0 :       SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "GenericNetwork_ChangeAllBlockState" "', argument " "2"" of type '" "bool""'");
    6032             :     } 
    6033             :     arg2 = static_cast< bool >(val2);
    6034             :   }
    6035           0 :   {
    6036           0 :     const int bLocalUseExceptions = GetUseExceptions();
    6037           0 :     if ( bLocalUseExceptions ) {
    6038           0 :       pushErrorHandler();
    6039             :     }
    6040           0 :     {
    6041           0 :       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
    6042           0 :       result = (CPLErr)GNMGenericNetworkShadow_ChangeAllBlockState(arg1,arg2);
    6043           0 :       SWIG_PYTHON_THREAD_END_ALLOW;
    6044             :     }
    6045           0 :     if ( bLocalUseExceptions ) {
    6046           0 :       popErrorHandler();
    6047             :     }
    6048             : #ifndef SED_HACKS
    6049             :     if ( bLocalUseExceptions ) {
    6050             :       CPLErr eclass = CPLGetLastErrorType();
    6051             :       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
    6052             :         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
    6053             :       }
    6054             :     }
    6055             : #endif
    6056             :   }
    6057           0 :   resultobj = SWIG_From_int(static_cast< int >(result));
    6058           0 :   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
    6059             :   return resultobj;
    6060             : fail:
    6061             :   return NULL;
    6062             : }
    6063             : 
    6064             : 
    6065          28 : SWIGINTERN PyObject *GenericNetwork_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
    6066          28 :   PyObject *obj;
    6067          28 :   if (!SWIG_Python_UnpackTuple(args, "swigregister", 1, 1, &obj)) return NULL;
    6068          28 :   SWIG_TypeNewClientData(SWIGTYPE_p_GNMGenericNetworkShadow, SWIG_NewClientData(obj));
    6069          28 :   return SWIG_Py_Void();
    6070             : }
    6071             : 
    6072             : static PyMethodDef SwigMethods[] = {
    6073             :    { "SWIG_PyInstanceMethod_New", SWIG_PyInstanceMethod_New, METH_O, NULL},
    6074             :    { "GetUseExceptions", _wrap_GetUseExceptions, METH_NOARGS, "GetUseExceptions() -> int"},
    6075             :    { "_GetExceptionsLocal", _wrap__GetExceptionsLocal, METH_NOARGS, "_GetExceptionsLocal() -> int"},
    6076             :    { "_SetExceptionsLocal", _wrap__SetExceptionsLocal, METH_O, "_SetExceptionsLocal(int bVal)"},
    6077             :    { "_UseExceptions", _wrap__UseExceptions, METH_NOARGS, "_UseExceptions()"},
    6078             :    { "_DontUseExceptions", _wrap__DontUseExceptions, METH_NOARGS, "_DontUseExceptions()"},
    6079             :    { "_UserHasSpecifiedIfUsingExceptions", _wrap__UserHasSpecifiedIfUsingExceptions, METH_NOARGS, "_UserHasSpecifiedIfUsingExceptions() -> int"},
    6080             :    { "CastToNetwork", _wrap_CastToNetwork, METH_O, "CastToNetwork(MajorObject base) -> Network"},
    6081             :    { "CastToGenericNetwork", _wrap_CastToGenericNetwork, METH_O, "CastToGenericNetwork(MajorObject base) -> GenericNetwork"},
    6082             :    { "delete_Network", _wrap_delete_Network, METH_O, "delete_Network(Network self)"},
    6083             :    { "Network_ReleaseResultSet", _wrap_Network_ReleaseResultSet, METH_VARARGS, "Network_ReleaseResultSet(Network self, Layer layer)"},
    6084             :    { "Network_GetVersion", _wrap_Network_GetVersion, METH_O, "Network_GetVersion(Network self) -> int"},
    6085             :    { "Network_GetName", _wrap_Network_GetName, METH_O, "Network_GetName(Network self) -> char const *"},
    6086             :    { "Network_GetFeatureByGlobalFID", _wrap_Network_GetFeatureByGlobalFID, METH_VARARGS, "Network_GetFeatureByGlobalFID(Network self, GIntBig GFID) -> Feature"},
    6087             :    { "Network_GetPath", (PyCFunction)(void(*)(void))_wrap_Network_GetPath, METH_VARARGS|METH_KEYWORDS, "Network_GetPath(Network self, GIntBig nStartFID, GIntBig nEndFID, GNMGraphAlgorithmType eAlgorithm, char ** options=None) -> Layer"},
    6088             :    { "Network_DisconnectAll", _wrap_Network_DisconnectAll, METH_O, "Network_DisconnectAll(Network self) -> CPLErr"},
    6089             :    { "Network_GetProjection", _wrap_Network_GetProjection, METH_O, "Network_GetProjection(Network self) -> char const *"},
    6090             :    { "Network_GetProjectionRef", _wrap_Network_GetProjectionRef, METH_O, "Network_GetProjectionRef(Network self) -> char const *"},
    6091             :    { "Network_GetFileList", _wrap_Network_GetFileList, METH_O, "Network_GetFileList(Network self) -> char **"},
    6092             :    { "Network_CreateLayer", (PyCFunction)(void(*)(void))_wrap_Network_CreateLayer, METH_VARARGS|METH_KEYWORDS, "Network_CreateLayer(Network self, char const * name, SpatialReference srs=None, OGRwkbGeometryType geom_type=wkbUnknown, char ** options=None) -> Layer"},
    6093             :    { "Network_CopyLayer", (PyCFunction)(void(*)(void))_wrap_Network_CopyLayer, METH_VARARGS|METH_KEYWORDS, "Network_CopyLayer(Network self, Layer src_layer, char const * new_name, char ** options=None) -> Layer"},
    6094             :    { "Network_DeleteLayer", _wrap_Network_DeleteLayer, METH_VARARGS, "Network_DeleteLayer(Network self, int index) -> OGRErr"},
    6095             :    { "Network_GetLayerCount", _wrap_Network_GetLayerCount, METH_O, "Network_GetLayerCount(Network self) -> int"},
    6096             :    { "Network_GetLayerByIndex", _wrap_Network_GetLayerByIndex, METH_VARARGS, "Network_GetLayerByIndex(Network self, int index=0) -> Layer"},
    6097             :    { "Network_GetLayerByName", _wrap_Network_GetLayerByName, METH_VARARGS, "Network_GetLayerByName(Network self, char const * layer_name) -> Layer"},
    6098             :    { "Network_TestCapability", _wrap_Network_TestCapability, METH_VARARGS, "Network_TestCapability(Network self, char const * cap) -> bool"},
    6099             :    { "Network_StartTransaction", (PyCFunction)(void(*)(void))_wrap_Network_StartTransaction, METH_VARARGS|METH_KEYWORDS, "Network_StartTransaction(Network self, int force=FALSE) -> OGRErr"},
    6100             :    { "Network_CommitTransaction", _wrap_Network_CommitTransaction, METH_O, "Network_CommitTransaction(Network self) -> OGRErr"},
    6101             :    { "Network_RollbackTransaction", _wrap_Network_RollbackTransaction, METH_O, "Network_RollbackTransaction(Network self) -> OGRErr"},
    6102             :    { "Network_swigregister", Network_swigregister, METH_O, NULL},
    6103             :    { "delete_GenericNetwork", _wrap_delete_GenericNetwork, METH_O, "delete_GenericNetwork(GenericNetwork self)"},
    6104             :    { "GenericNetwork_ConnectFeatures", _wrap_GenericNetwork_ConnectFeatures, METH_VARARGS, "GenericNetwork_ConnectFeatures(GenericNetwork self, GIntBig nSrcFID, GIntBig nTgtFID, GIntBig nConFID, double dfCost, double dfInvCost, GNMDirection eDir) -> CPLErr"},
    6105             :    { "GenericNetwork_DisconnectFeatures", _wrap_GenericNetwork_DisconnectFeatures, METH_VARARGS, "GenericNetwork_DisconnectFeatures(GenericNetwork self, GIntBig nSrcFID, GIntBig nTgtFID, GIntBig nConFID) -> CPLErr"},
    6106             :    { "GenericNetwork_DisconnectFeaturesWithId", _wrap_GenericNetwork_DisconnectFeaturesWithId, METH_VARARGS, "GenericNetwork_DisconnectFeaturesWithId(GenericNetwork self, GIntBig nFID) -> CPLErr"},
    6107             :    { "GenericNetwork_ReconnectFeatures", _wrap_GenericNetwork_ReconnectFeatures, METH_VARARGS, "GenericNetwork_ReconnectFeatures(GenericNetwork self, GIntBig nSrcFID, GIntBig nTgtFID, GIntBig nConFID, double dfCost, double dfInvCost, GNMDirection eDir) -> CPLErr"},
    6108             :    { "GenericNetwork_CreateRule", _wrap_GenericNetwork_CreateRule, METH_VARARGS, "GenericNetwork_CreateRule(GenericNetwork self, char const * pszRuleStr) -> CPLErr"},
    6109             :    { "GenericNetwork_DeleteAllRules", _wrap_GenericNetwork_DeleteAllRules, METH_O, "GenericNetwork_DeleteAllRules(GenericNetwork self) -> CPLErr"},
    6110             :    { "GenericNetwork_DeleteRule", _wrap_GenericNetwork_DeleteRule, METH_VARARGS, "GenericNetwork_DeleteRule(GenericNetwork self, char const * pszRuleStr) -> CPLErr"},
    6111             :    { "GenericNetwork_GetRules", _wrap_GenericNetwork_GetRules, METH_O, "GenericNetwork_GetRules(GenericNetwork self) -> char **"},
    6112             :    { "GenericNetwork_ConnectPointsByLines", (PyCFunction)(void(*)(void))_wrap_GenericNetwork_ConnectPointsByLines, METH_VARARGS|METH_KEYWORDS, "GenericNetwork_ConnectPointsByLines(GenericNetwork self, char ** papszLayerList, double dfTolerance, double dfCost, double dfInvCost, GNMDirection eDir) -> CPLErr"},
    6113             :    { "GenericNetwork_ChangeBlockState", _wrap_GenericNetwork_ChangeBlockState, METH_VARARGS, "GenericNetwork_ChangeBlockState(GenericNetwork self, GIntBig nFID, bool bIsBlock) -> CPLErr"},
    6114             :    { "GenericNetwork_ChangeAllBlockState", _wrap_GenericNetwork_ChangeAllBlockState, METH_VARARGS, "GenericNetwork_ChangeAllBlockState(GenericNetwork self, bool bIsBlock=False) -> CPLErr"},
    6115             :    { "GenericNetwork_swigregister", GenericNetwork_swigregister, METH_O, NULL},
    6116             :    { NULL, NULL, 0, NULL }
    6117             : };
    6118             : 
    6119             : static PyMethodDef SwigMethods_proxydocs[] = {
    6120             :    { NULL, NULL, 0, NULL }
    6121             : };
    6122             : 
    6123             : 
    6124             : /* -------- TYPE CONVERSION AND EQUIVALENCE RULES (BEGIN) -------- */
    6125             : 
    6126           0 : static void *_p_OGRLayerShadowTo_p_GDALMajorObjectShadow(void *x, int *SWIGUNUSEDPARM(newmemory)) {
    6127           0 :     return (void *)((GDALMajorObjectShadow *)  ((OGRLayerShadow *) x));
    6128             : }
    6129           2 : static void *_p_GNMNetworkShadowTo_p_GDALMajorObjectShadow(void *x, int *SWIGUNUSEDPARM(newmemory)) {
    6130           2 :     return (void *)((GDALMajorObjectShadow *)  ((GNMNetworkShadow *) x));
    6131             : }
    6132           0 : static void *_p_GNMGenericNetworkShadowTo_p_GDALMajorObjectShadow(void *x, int *SWIGUNUSEDPARM(newmemory)) {
    6133           0 :     return (void *)((GDALMajorObjectShadow *) (GNMNetworkShadow *) ((GNMGenericNetworkShadow *) x));
    6134             : }
    6135           0 : static void *_p_GNMGenericNetworkShadowTo_p_GNMNetworkShadow(void *x, int *SWIGUNUSEDPARM(newmemory)) {
    6136           0 :     return (void *)((GNMNetworkShadow *)  ((GNMGenericNetworkShadow *) x));
    6137             : }
    6138             : static swig_type_info _swigt__p_GDALDatasetShadow = {"_p_GDALDatasetShadow", "GDALDatasetShadow *|OGRDataSourceShadow *", 0, 0, (void*)0, 0};
    6139             : static swig_type_info _swigt__p_GDALDriverShadow = {"_p_GDALDriverShadow", "GDALDriverShadow *|OGRDriverShadow *", 0, 0, (void*)0, 0};
    6140             : static swig_type_info _swigt__p_GDALMajorObjectShadow = {"_p_GDALMajorObjectShadow", "GDALMajorObjectShadow *", 0, 0, (void*)0, 0};
    6141             : static swig_type_info _swigt__p_GIntBig = {"_p_GIntBig", "GIntBig *", 0, 0, (void*)0, 0};
    6142             : static swig_type_info _swigt__p_GNMGenericNetworkShadow = {"_p_GNMGenericNetworkShadow", "GNMGenericNetworkShadow *", 0, 0, (void*)0, 0};
    6143             : static swig_type_info _swigt__p_GNMGraphAlgorithmType = {"_p_GNMGraphAlgorithmType", "enum GNMGraphAlgorithmType *|GNMGraphAlgorithmType *", 0, 0, (void*)0, 0};
    6144             : static swig_type_info _swigt__p_GNMNetworkShadow = {"_p_GNMNetworkShadow", "GNMNetworkShadow *", 0, 0, (void*)0, 0};
    6145             : static swig_type_info _swigt__p_OGRFeatureShadow = {"_p_OGRFeatureShadow", "OGRFeatureShadow *", 0, 0, (void*)0, 0};
    6146             : static swig_type_info _swigt__p_OGRLayerShadow = {"_p_OGRLayerShadow", "OGRLayerShadow *", 0, 0, (void*)0, 0};
    6147             : static swig_type_info _swigt__p_OSRSpatialReferenceShadow = {"_p_OSRSpatialReferenceShadow", "OSRSpatialReferenceShadow *", 0, 0, (void*)0, 0};
    6148             : static swig_type_info _swigt__p_char = {"_p_char", "char *|retStringAndCPLFree *", 0, 0, (void*)0, 0};
    6149             : static swig_type_info _swigt__p_int = {"_p_int", "OGRFieldType *|OGRFieldDomainType *|OGRFieldSubType *|int *|OSRAxisMappingStrategy *|OGRwkbByteOrder *|CPLErr *|GNMDirection *|OGRAxisOrientation *|OGRJustification *|OGRErr *|OGRwkbGeometryType *|OGRFieldDomainMergePolicy *|OGRFieldDomainSplitPolicy *", 0, 0, (void*)0, 0};
    6150             : 
    6151             : static swig_type_info *swig_type_initial[] = {
    6152             :   &_swigt__p_GDALDatasetShadow,
    6153             :   &_swigt__p_GDALDriverShadow,
    6154             :   &_swigt__p_GDALMajorObjectShadow,
    6155             :   &_swigt__p_GIntBig,
    6156             :   &_swigt__p_GNMGenericNetworkShadow,
    6157             :   &_swigt__p_GNMGraphAlgorithmType,
    6158             :   &_swigt__p_GNMNetworkShadow,
    6159             :   &_swigt__p_OGRFeatureShadow,
    6160             :   &_swigt__p_OGRLayerShadow,
    6161             :   &_swigt__p_OSRSpatialReferenceShadow,
    6162             :   &_swigt__p_char,
    6163             :   &_swigt__p_int,
    6164             : };
    6165             : 
    6166             : static swig_cast_info _swigc__p_GDALDatasetShadow[] = {  {&_swigt__p_GDALDatasetShadow, 0, 0, 0},{0, 0, 0, 0}};
    6167             : static swig_cast_info _swigc__p_GDALDriverShadow[] = {  {&_swigt__p_GDALDriverShadow, 0, 0, 0},{0, 0, 0, 0}};
    6168             : static swig_cast_info _swigc__p_GDALMajorObjectShadow[] = {  {&_swigt__p_GDALMajorObjectShadow, 0, 0, 0},  {&_swigt__p_OGRLayerShadow, _p_OGRLayerShadowTo_p_GDALMajorObjectShadow, 0, 0},  {&_swigt__p_GNMNetworkShadow, _p_GNMNetworkShadowTo_p_GDALMajorObjectShadow, 0, 0},  {&_swigt__p_GNMGenericNetworkShadow, _p_GNMGenericNetworkShadowTo_p_GDALMajorObjectShadow, 0, 0},{0, 0, 0, 0}};
    6169             : static swig_cast_info _swigc__p_GIntBig[] = {  {&_swigt__p_GIntBig, 0, 0, 0},{0, 0, 0, 0}};
    6170             : static swig_cast_info _swigc__p_GNMGenericNetworkShadow[] = {  {&_swigt__p_GNMGenericNetworkShadow, 0, 0, 0},{0, 0, 0, 0}};
    6171             : static swig_cast_info _swigc__p_GNMGraphAlgorithmType[] = {  {&_swigt__p_GNMGraphAlgorithmType, 0, 0, 0},{0, 0, 0, 0}};
    6172             : static swig_cast_info _swigc__p_GNMNetworkShadow[] = {  {&_swigt__p_GNMNetworkShadow, 0, 0, 0},  {&_swigt__p_GNMGenericNetworkShadow, _p_GNMGenericNetworkShadowTo_p_GNMNetworkShadow, 0, 0},{0, 0, 0, 0}};
    6173             : static swig_cast_info _swigc__p_OGRFeatureShadow[] = {  {&_swigt__p_OGRFeatureShadow, 0, 0, 0},{0, 0, 0, 0}};
    6174             : static swig_cast_info _swigc__p_OGRLayerShadow[] = {  {&_swigt__p_OGRLayerShadow, 0, 0, 0},{0, 0, 0, 0}};
    6175             : static swig_cast_info _swigc__p_OSRSpatialReferenceShadow[] = {  {&_swigt__p_OSRSpatialReferenceShadow, 0, 0, 0},{0, 0, 0, 0}};
    6176             : static swig_cast_info _swigc__p_char[] = {  {&_swigt__p_char, 0, 0, 0},{0, 0, 0, 0}};
    6177             : static swig_cast_info _swigc__p_int[] = {  {&_swigt__p_int, 0, 0, 0},{0, 0, 0, 0}};
    6178             : 
    6179             : static swig_cast_info *swig_cast_initial[] = {
    6180             :   _swigc__p_GDALDatasetShadow,
    6181             :   _swigc__p_GDALDriverShadow,
    6182             :   _swigc__p_GDALMajorObjectShadow,
    6183             :   _swigc__p_GIntBig,
    6184             :   _swigc__p_GNMGenericNetworkShadow,
    6185             :   _swigc__p_GNMGraphAlgorithmType,
    6186             :   _swigc__p_GNMNetworkShadow,
    6187             :   _swigc__p_OGRFeatureShadow,
    6188             :   _swigc__p_OGRLayerShadow,
    6189             :   _swigc__p_OSRSpatialReferenceShadow,
    6190             :   _swigc__p_char,
    6191             :   _swigc__p_int,
    6192             : };
    6193             : 
    6194             : 
    6195             : /* -------- TYPE CONVERSION AND EQUIVALENCE RULES (END) -------- */
    6196             : 
    6197             : static swig_const_info swig_const_table[] = {
    6198             : {0, 0, 0, 0.0, 0, 0}};
    6199             : 
    6200             : #ifdef __cplusplus
    6201             : }
    6202             : #endif
    6203             : /* -----------------------------------------------------------------------------
    6204             :  * Type initialization:
    6205             :  * This problem is tough by the requirement that no dynamic
    6206             :  * memory is used. Also, since swig_type_info structures store pointers to
    6207             :  * swig_cast_info structures and swig_cast_info structures store pointers back
    6208             :  * to swig_type_info structures, we need some lookup code at initialization.
    6209             :  * The idea is that swig generates all the structures that are needed.
    6210             :  * The runtime then collects these partially filled structures.
    6211             :  * The SWIG_InitializeModule function takes these initial arrays out of
    6212             :  * swig_module, and does all the lookup, filling in the swig_module.types
    6213             :  * array with the correct data and linking the correct swig_cast_info
    6214             :  * structures together.
    6215             :  *
    6216             :  * The generated swig_type_info structures are assigned statically to an initial
    6217             :  * array. We just loop through that array, and handle each type individually.
    6218             :  * First we lookup if this type has been already loaded, and if so, use the
    6219             :  * loaded structure instead of the generated one. Then we have to fill in the
    6220             :  * cast linked list. The cast data is initially stored in something like a
    6221             :  * two-dimensional array. Each row corresponds to a type (there are the same
    6222             :  * number of rows as there are in the swig_type_initial array). Each entry in
    6223             :  * a column is one of the swig_cast_info structures for that type.
    6224             :  * The cast_initial array is actually an array of arrays, because each row has
    6225             :  * a variable number of columns. So to actually build the cast linked list,
    6226             :  * we find the array of casts associated with the type, and loop through it
    6227             :  * adding the casts to the list. The one last trick we need to do is making
    6228             :  * sure the type pointer in the swig_cast_info struct is correct.
    6229             :  *
    6230             :  * First off, we lookup the cast->type name to see if it is already loaded.
    6231             :  * There are three cases to handle:
    6232             :  *  1) If the cast->type has already been loaded AND the type we are adding
    6233             :  *     casting info to has not been loaded (it is in this module), THEN we
    6234             :  *     replace the cast->type pointer with the type pointer that has already
    6235             :  *     been loaded.
    6236             :  *  2) If BOTH types (the one we are adding casting info to, and the
    6237             :  *     cast->type) are loaded, THEN the cast info has already been loaded by
    6238             :  *     the previous module so we just ignore it.
    6239             :  *  3) Finally, if cast->type has not already been loaded, then we add that
    6240             :  *     swig_cast_info to the linked list (because the cast->type) pointer will
    6241             :  *     be correct.
    6242             :  * ----------------------------------------------------------------------------- */
    6243             : 
    6244             : #ifdef __cplusplus
    6245             : extern "C" {
    6246             : #if 0
    6247             : } /* c-mode */
    6248             : #endif
    6249             : #endif
    6250             : 
    6251             : #if 0
    6252             : #define SWIGRUNTIME_DEBUG
    6253             : #endif
    6254             : 
    6255             : 
    6256             : SWIGRUNTIME void
    6257             : SWIG_InitializeModule(void *clientdata) {
    6258             :   size_t i;
    6259             :   swig_module_info *module_head, *iter;
    6260             :   int init;
    6261             :   
    6262             :   /* check to see if the circular list has been setup, if not, set it up */
    6263             :   if (swig_module.next==0) {
    6264             :     /* Initialize the swig_module */
    6265             :     swig_module.type_initial = swig_type_initial;
    6266             :     swig_module.cast_initial = swig_cast_initial;
    6267             :     swig_module.next = &swig_module;
    6268             :     init = 1;
    6269             :   } else {
    6270             :     init = 0;
    6271             :   }
    6272             :   
    6273             :   /* Try and load any already created modules */
    6274             :   module_head = SWIG_GetModule(clientdata);
    6275             :   if (!module_head) {
    6276             :     /* This is the first module loaded for this interpreter */
    6277             :     /* so set the swig module into the interpreter */
    6278             :     SWIG_SetModule(clientdata, &swig_module);
    6279             :   } else {
    6280             :     /* the interpreter has loaded a SWIG module, but has it loaded this one? */
    6281             :     iter=module_head;
    6282             :     do {
    6283             :       if (iter==&swig_module) {
    6284             :         /* Our module is already in the list, so there's nothing more to do. */
    6285             :         return;
    6286             :       }
    6287             :       iter=iter->next;
    6288             :     } while (iter!= module_head);
    6289             :     
    6290             :     /* otherwise we must add our module into the list */
    6291             :     swig_module.next = module_head->next;
    6292             :     module_head->next = &swig_module;
    6293             :   }
    6294             :   
    6295             :   /* When multiple interpreters are used, a module could have already been initialized in
    6296             :        a different interpreter, but not yet have a pointer in this interpreter.
    6297             :        In this case, we do not want to continue adding types... everything should be
    6298             :        set up already */
    6299             :   if (init == 0) return;
    6300             :   
    6301             :   /* Now work on filling in swig_module.types */
    6302             : #ifdef SWIGRUNTIME_DEBUG
    6303             :   printf("SWIG_InitializeModule: size %lu\n", (unsigned long)swig_module.size);
    6304             : #endif
    6305             :   for (i = 0; i < swig_module.size; ++i) {
    6306             :     swig_type_info *type = 0;
    6307             :     swig_type_info *ret;
    6308             :     swig_cast_info *cast;
    6309             :     
    6310             : #ifdef SWIGRUNTIME_DEBUG
    6311             :     printf("SWIG_InitializeModule: type %lu %s\n", (unsigned long)i, swig_module.type_initial[i]->name);
    6312             : #endif
    6313             :     
    6314             :     /* if there is another module already loaded */
    6315             :     if (swig_module.next != &swig_module) {
    6316             :       type = SWIG_MangledTypeQueryModule(swig_module.next, &swig_module, swig_module.type_initial[i]->name);
    6317             :     }
    6318             :     if (type) {
    6319             :       /* Overwrite clientdata field */
    6320             : #ifdef SWIGRUNTIME_DEBUG
    6321             :       printf("SWIG_InitializeModule: found type %s\n", type->name);
    6322             : #endif
    6323             :       if (swig_module.type_initial[i]->clientdata) {
    6324             :         type->clientdata = swig_module.type_initial[i]->clientdata;
    6325             : #ifdef SWIGRUNTIME_DEBUG
    6326             :         printf("SWIG_InitializeModule: found and overwrite type %s \n", type->name);
    6327             : #endif
    6328             :       }
    6329             :     } else {
    6330             :       type = swig_module.type_initial[i];
    6331             :     }
    6332             :     
    6333             :     /* Insert casting types */
    6334             :     cast = swig_module.cast_initial[i];
    6335             :     while (cast->type) {
    6336             :       /* Don't need to add information already in the list */
    6337             :       ret = 0;
    6338             : #ifdef SWIGRUNTIME_DEBUG
    6339             :       printf("SWIG_InitializeModule: look cast %s\n", cast->type->name);
    6340             : #endif
    6341             :       if (swig_module.next != &swig_module) {
    6342             :         ret = SWIG_MangledTypeQueryModule(swig_module.next, &swig_module, cast->type->name);
    6343             : #ifdef SWIGRUNTIME_DEBUG
    6344             :         if (ret) printf("SWIG_InitializeModule: found cast %s\n", ret->name);
    6345             : #endif
    6346             :       }
    6347             :       if (ret) {
    6348             :         if (type == swig_module.type_initial[i]) {
    6349             : #ifdef SWIGRUNTIME_DEBUG
    6350             :           printf("SWIG_InitializeModule: skip old type %s\n", ret->name);
    6351             : #endif
    6352             :           cast->type = ret;
    6353             :           ret = 0;
    6354             :         } else {
    6355             :           /* Check for casting already in the list */
    6356             :           swig_cast_info *ocast = SWIG_TypeCheck(ret->name, type);
    6357             : #ifdef SWIGRUNTIME_DEBUG
    6358             :           if (ocast) printf("SWIG_InitializeModule: skip old cast %s\n", ret->name);
    6359             : #endif
    6360             :           if (!ocast) ret = 0;
    6361             :         }
    6362             :       }
    6363             :       
    6364             :       if (!ret) {
    6365             : #ifdef SWIGRUNTIME_DEBUG
    6366             :         printf("SWIG_InitializeModule: adding cast %s\n", cast->type->name);
    6367             : #endif
    6368             :         if (type->cast) {
    6369             :           type->cast->prev = cast;
    6370             :           cast->next = type->cast;
    6371             :         }
    6372             :         type->cast = cast;
    6373             :       }
    6374             :       cast++;
    6375             :     }
    6376             :     /* Set entry in modules->types array equal to the type */
    6377             :     swig_module.types[i] = type;
    6378             :   }
    6379             :   swig_module.types[i] = 0;
    6380             :   
    6381             : #ifdef SWIGRUNTIME_DEBUG
    6382             :   printf("**** SWIG_InitializeModule: Cast List ******\n");
    6383             :   for (i = 0; i < swig_module.size; ++i) {
    6384             :     int j = 0;
    6385             :     swig_cast_info *cast = swig_module.cast_initial[i];
    6386             :     printf("SWIG_InitializeModule: type %lu %s\n", (unsigned long)i, swig_module.type_initial[i]->name);
    6387             :     while (cast->type) {
    6388             :       printf("SWIG_InitializeModule: cast type %s\n", cast->type->name);
    6389             :       cast++;
    6390             :       ++j;
    6391             :     }
    6392             :     printf("---- Total casts: %d\n",j);
    6393             :   }
    6394             :   printf("**** SWIG_InitializeModule: Cast List ******\n");
    6395             : #endif
    6396             : }
    6397             : 
    6398             : /* This function will propagate the clientdata field of type to
    6399             : * any new swig_type_info structures that have been added into the list
    6400             : * of equivalent types.  It is like calling
    6401             : * SWIG_TypeClientData(type, clientdata) a second time.
    6402             : */
    6403             : SWIGRUNTIME void
    6404             : SWIG_PropagateClientData(void) {
    6405             :   size_t i;
    6406             :   swig_cast_info *equiv;
    6407             :   static int init_run = 0;
    6408             :   
    6409             :   if (init_run) return;
    6410             :   init_run = 1;
    6411             :   
    6412             :   for (i = 0; i < swig_module.size; i++) {
    6413             :     if (swig_module.types[i]->clientdata) {
    6414             :       equiv = swig_module.types[i]->cast;
    6415             :       while (equiv) {
    6416             :         if (!equiv->converter) {
    6417             :           if (equiv->type && !equiv->type->clientdata)
    6418             :           SWIG_TypeClientData(equiv->type, swig_module.types[i]->clientdata);
    6419             :         }
    6420             :         equiv = equiv->next;
    6421             :       }
    6422             :     }
    6423             :   }
    6424             : }
    6425             : 
    6426             : #ifdef __cplusplus
    6427             : #if 0
    6428             : {
    6429             :   /* c-mode */
    6430             : #endif
    6431             : }
    6432             : #endif
    6433             : 
    6434             : 
    6435             : 
    6436             : #ifdef __cplusplus
    6437             : extern "C" {
    6438             : #endif
    6439             :   
    6440             :   /* Python-specific SWIG API */
    6441             : #define SWIG_newvarlink()                             SWIG_Python_newvarlink()
    6442             : #define SWIG_addvarlink(p, name, get_attr, set_attr)  SWIG_Python_addvarlink(p, name, get_attr, set_attr)
    6443             : #define SWIG_InstallConstants(d, constants)           SWIG_Python_InstallConstants(d, constants)
    6444             :   
    6445             :   /* -----------------------------------------------------------------------------
    6446             :    * global variable support code.
    6447             :    * ----------------------------------------------------------------------------- */
    6448             :   
    6449             :   typedef struct swig_globalvar {
    6450             :     char       *name;                  /* Name of global variable */
    6451             :     PyObject *(*get_attr)(void);       /* Return the current value */
    6452             :     int       (*set_attr)(PyObject *); /* Set the value */
    6453             :     struct swig_globalvar *next;
    6454             :   } swig_globalvar;
    6455             :   
    6456             :   typedef struct swig_varlinkobject {
    6457             :     PyObject_HEAD
    6458             :     swig_globalvar *vars;
    6459             :   } swig_varlinkobject;
    6460             :   
    6461             :   SWIGINTERN PyObject *
    6462             :   swig_varlink_repr(swig_varlinkobject *SWIGUNUSEDPARM(v)) {
    6463             : #if PY_VERSION_HEX >= 0x03000000
    6464             :     return PyUnicode_InternFromString("<Swig global variables>");
    6465             : #else
    6466             :     return PyString_FromString("<Swig global variables>");
    6467             : #endif
    6468             :   }
    6469             :   
    6470             :   SWIGINTERN PyObject *
    6471             :   swig_varlink_str(swig_varlinkobject *v) {
    6472             : #if PY_VERSION_HEX >= 0x03000000
    6473             :     PyObject *str = PyUnicode_InternFromString("(");
    6474             :     PyObject *tail;
    6475             :     PyObject *joined;
    6476             :     swig_globalvar *var;
    6477             :     for (var = v->vars; var; var=var->next) {
    6478             :       tail = PyUnicode_FromString(var->name);
    6479             :       joined = PyUnicode_Concat(str, tail);
    6480             :       Py_DecRef(str);
    6481             :       Py_DecRef(tail);
    6482             :       str = joined;
    6483             :       if (var->next) {
    6484             :         tail = PyUnicode_InternFromString(", ");
    6485             :         joined = PyUnicode_Concat(str, tail);
    6486             :         Py_DecRef(str);
    6487             :         Py_DecRef(tail);
    6488             :         str = joined;
    6489             :       }
    6490             :     }
    6491             :     tail = PyUnicode_InternFromString(")");
    6492             :     joined = PyUnicode_Concat(str, tail);
    6493             :     Py_DecRef(str);
    6494             :     Py_DecRef(tail);
    6495             :     str = joined;
    6496             : #else
    6497             :     PyObject *str = PyString_FromString("(");
    6498             :     swig_globalvar *var;
    6499             :     for (var = v->vars; var; var=var->next) {
    6500             :       PyString_ConcatAndDel(&str,PyString_FromString(var->name));
    6501             :       if (var->next) PyString_ConcatAndDel(&str,PyString_FromString(", "));
    6502             :     }
    6503             :     PyString_ConcatAndDel(&str,PyString_FromString(")"));
    6504             : #endif
    6505             :     return str;
    6506             :   }
    6507             :   
    6508             :   SWIGINTERN void
    6509             :   swig_varlink_dealloc(swig_varlinkobject *v) {
    6510             :     swig_globalvar *var = v->vars;
    6511             :     while (var) {
    6512             :       swig_globalvar *n = var->next;
    6513             :       free(var->name);
    6514             :       free(var);
    6515             :       var = n;
    6516             :     }
    6517             :   }
    6518             :   
    6519             :   SWIGINTERN PyObject *
    6520             :   swig_varlink_getattr(swig_varlinkobject *v, char *n) {
    6521             :     PyObject *res = NULL;
    6522             :     swig_globalvar *var = v->vars;
    6523             :     while (var) {
    6524             :       if (strcmp(var->name,n) == 0) {
    6525             :         res = (*var->get_attr)();
    6526             :         break;
    6527             :       }
    6528             :       var = var->next;
    6529             :     }
    6530             :     if (res == NULL && !PyErr_Occurred()) {
    6531             :       PyErr_Format(PyExc_AttributeError, "Unknown C global variable '%s'", n);
    6532             :     }
    6533             :     return res;
    6534             :   }
    6535             :   
    6536             :   SWIGINTERN int
    6537             :   swig_varlink_setattr(swig_varlinkobject *v, char *n, PyObject *p) {
    6538             :     int res = 1;
    6539             :     swig_globalvar *var = v->vars;
    6540             :     while (var) {
    6541             :       if (strcmp(var->name,n) == 0) {
    6542             :         res = (*var->set_attr)(p);
    6543             :         break;
    6544             :       }
    6545             :       var = var->next;
    6546             :     }
    6547             :     if (res == 1 && !PyErr_Occurred()) {
    6548             :       PyErr_Format(PyExc_AttributeError, "Unknown C global variable '%s'", n);
    6549             :     }
    6550             :     return res;
    6551             :   }
    6552             :   
    6553             :   SWIGINTERN PyTypeObject*
    6554             :   swig_varlink_type(void) {
    6555             :     static char varlink__doc__[] = "Swig var link object";
    6556             :     static PyTypeObject varlink_type;
    6557             :     static int type_init = 0;
    6558             :     if (!type_init) {
    6559             :       const PyTypeObject tmp = {
    6560             : #if PY_VERSION_HEX >= 0x03000000
    6561             :         PyVarObject_HEAD_INIT(NULL, 0)
    6562             : #else
    6563             :         PyObject_HEAD_INIT(NULL)
    6564             :         0,                                  /* ob_size */
    6565             : #endif
    6566             :         "swigvarlink",                      /* tp_name */
    6567             :         sizeof(swig_varlinkobject),         /* tp_basicsize */
    6568             :         0,                                  /* tp_itemsize */
    6569             :         (destructor) swig_varlink_dealloc,  /* tp_dealloc */
    6570             :         0,                                  /* tp_print */
    6571             :         (getattrfunc) swig_varlink_getattr, /* tp_getattr */
    6572             :         (setattrfunc) swig_varlink_setattr, /* tp_setattr */
    6573             :         0,                                  /* tp_compare */
    6574             :         (reprfunc) swig_varlink_repr,       /* tp_repr */
    6575             :         0,                                  /* tp_as_number */
    6576             :         0,                                  /* tp_as_sequence */
    6577             :         0,                                  /* tp_as_mapping */
    6578             :         0,                                  /* tp_hash */
    6579             :         0,                                  /* tp_call */
    6580             :         (reprfunc) swig_varlink_str,        /* tp_str */
    6581             :         0,                                  /* tp_getattro */
    6582             :         0,                                  /* tp_setattro */
    6583             :         0,                                  /* tp_as_buffer */
    6584             :         0,                                  /* tp_flags */
    6585             :         varlink__doc__,                     /* tp_doc */
    6586             :         0,                                  /* tp_traverse */
    6587             :         0,                                  /* tp_clear */
    6588             :         0,                                  /* tp_richcompare */
    6589             :         0,                                  /* tp_weaklistoffset */
    6590             :         0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* tp_iter -> tp_weaklist */
    6591             :         0,                                  /* tp_del */
    6592             :         0,                                  /* tp_version_tag */
    6593             : #if PY_VERSION_HEX >= 0x03040000
    6594             :         0,                                  /* tp_finalize */
    6595             : #endif
    6596             : #ifdef COUNT_ALLOCS
    6597             :         0,                                  /* tp_allocs */
    6598             :         0,                                  /* tp_frees */
    6599             :         0,                                  /* tp_maxalloc */
    6600             :         0,                                  /* tp_prev */
    6601             :         0                                   /* tp_next */
    6602             : #endif
    6603             :       };
    6604             :       varlink_type = tmp;
    6605             :       type_init = 1;
    6606             :       if (PyType_Ready(&varlink_type) < 0)
    6607             :       return NULL;
    6608             :     }
    6609             :     return &varlink_type;
    6610             :   }
    6611             :   
    6612             :   /* Create a variable linking object for use later */
    6613             :   SWIGINTERN PyObject *
    6614             :   SWIG_Python_newvarlink(void) {
    6615             :     swig_varlinkobject *result = PyObject_NEW(swig_varlinkobject, swig_varlink_type());
    6616             :     if (result) {
    6617             :       result->vars = 0;
    6618             :     }
    6619             :     return ((PyObject*) result);
    6620             :   }
    6621             :   
    6622             :   SWIGINTERN void 
    6623             :   SWIG_Python_addvarlink(PyObject *p, const char *name, PyObject *(*get_attr)(void), int (*set_attr)(PyObject *p)) {
    6624             :     swig_varlinkobject *v = (swig_varlinkobject *) p;
    6625             :     swig_globalvar *gv = (swig_globalvar *) malloc(sizeof(swig_globalvar));
    6626             :     if (gv) {
    6627             :       size_t size = strlen(name)+1;
    6628             :       gv->name = (char *)malloc(size);
    6629             :       if (gv->name) {
    6630             :         memcpy(gv->name, name, size);
    6631             :         gv->get_attr = get_attr;
    6632             :         gv->set_attr = set_attr;
    6633             :         gv->next = v->vars;
    6634             :       }
    6635             :     }
    6636             :     v->vars = gv;
    6637             :   }
    6638             :   
    6639             :   SWIGINTERN PyObject *
    6640             :   SWIG_globals(void) {
    6641             :     static PyObject *globals = 0;
    6642             :     if (!globals) {
    6643             :       globals = SWIG_newvarlink();
    6644             :     }
    6645             :     return globals;
    6646             :   }
    6647             :   
    6648             :   /* -----------------------------------------------------------------------------
    6649             :    * constants/methods manipulation
    6650             :    * ----------------------------------------------------------------------------- */
    6651             :   
    6652             :   /* Install Constants */
    6653             :   SWIGINTERN void
    6654          28 :   SWIG_Python_InstallConstants(PyObject *d, swig_const_info constants[]) {
    6655          28 :     PyObject *obj = 0;
    6656          28 :     size_t i;
    6657          28 :     for (i = 0; constants[i].type; ++i) {
    6658           0 :       switch(constants[i].type) {
    6659           0 :       case SWIG_PY_POINTER:
    6660           0 :         obj = SWIG_InternalNewPointerObj(constants[i].pvalue, *(constants[i]).ptype,0);
    6661           0 :         break;
    6662           0 :       case SWIG_PY_BINARY:
    6663           0 :         obj = SWIG_NewPackedObj(constants[i].pvalue, constants[i].lvalue, *(constants[i].ptype));
    6664             :         break;
    6665             :       default:
    6666             :         obj = 0;
    6667             :         break;
    6668             :       }
    6669           0 :       if (obj) {
    6670           0 :         PyDict_SetItemString(d, constants[i].name, obj);
    6671           0 :         Py_DECREF(obj);
    6672             :       }
    6673             :     }
    6674          28 :   }
    6675             :   
    6676             :   /* -----------------------------------------------------------------------------*/
    6677             :   /* Fix SwigMethods to carry the callback ptrs when needed */
    6678             :   /* -----------------------------------------------------------------------------*/
    6679             :   
    6680             :   SWIGINTERN void
    6681          28 :   SWIG_Python_FixMethods(PyMethodDef *methods,
    6682             :     swig_const_info *const_table,
    6683             :     swig_type_info **types,
    6684             :     swig_type_info **types_initial) {
    6685          28 :     size_t i;
    6686        1232 :     for (i = 0; methods[i].ml_name; ++i) {
    6687        1204 :       const char *c = methods[i].ml_doc;
    6688        1204 :       if (!c) continue;
    6689        1120 :       c = strstr(c, "swig_ptr: ");
    6690        1120 :       if (c) {
    6691           0 :         int j;
    6692           0 :         swig_const_info *ci = 0;
    6693           0 :         const char *name = c + 10;
    6694           0 :         for (j = 0; const_table[j].type; ++j) {
    6695           0 :           if (strncmp(const_table[j].name, name, 
    6696             :               strlen(const_table[j].name)) == 0) {
    6697             :             ci = &(const_table[j]);
    6698             :             break;
    6699             :           }
    6700             :         }
    6701           0 :         if (ci) {
    6702        1204 :           void *ptr = (ci->type == SWIG_PY_POINTER) ? ci->pvalue : 0;
    6703           0 :           if (ptr) {
    6704           0 :             size_t shift = (ci->ptype) - types;
    6705           0 :             swig_type_info *ty = types_initial[shift];
    6706           0 :             size_t ldoc = (c - methods[i].ml_doc);
    6707           0 :             size_t lptr = strlen(ty->name)+2*sizeof(void*)+2;
    6708           0 :             char *ndoc = (char*)malloc(ldoc + lptr + 10);
    6709           0 :             if (ndoc) {
    6710           0 :               char *buff = ndoc;
    6711           0 :               memcpy(buff, methods[i].ml_doc, ldoc);
    6712           0 :               buff += ldoc;
    6713           0 :               memcpy(buff, "swig_ptr: ", 10);
    6714           0 :               buff += 10;
    6715           0 :               SWIG_PackVoidPtr(buff, ptr, ty->name, lptr);
    6716           0 :               methods[i].ml_doc = ndoc;
    6717             :             }
    6718             :           }
    6719             :         }
    6720             :       }
    6721             :     }
    6722          28 :   } 
    6723             :   
    6724             :   /* -----------------------------------------------------------------------------
    6725             :    * Method creation and docstring support functions
    6726             :    * ----------------------------------------------------------------------------- */
    6727             :   
    6728             :   /* -----------------------------------------------------------------------------
    6729             :    * Function to find the method definition with the correct docstring for the
    6730             :    * proxy module as opposed to the low-level API
    6731             :    * ----------------------------------------------------------------------------- */
    6732             :   
    6733           0 :   SWIGINTERN PyMethodDef *SWIG_PythonGetProxyDoc(const char *name) {
    6734             :     /* Find the function in the modified method table */
    6735           0 :     size_t offset = 0;
    6736           0 :     int found = 0;
    6737           0 :     while (SwigMethods_proxydocs[offset].ml_meth != NULL) {
    6738           0 :       if (strcmp(SwigMethods_proxydocs[offset].ml_name, name) == 0) {
    6739             :         found = 1;
    6740             :         break;
    6741             :       }
    6742           0 :       offset++;
    6743             :     }
    6744             :     /* Use the copy with the modified docstring if available */
    6745           0 :     return found ? &SwigMethods_proxydocs[offset] : NULL;
    6746             :   }
    6747             :   
    6748             :   /* -----------------------------------------------------------------------------
    6749             :    * Wrapper of PyInstanceMethod_New() used in Python 3
    6750             :    * It is exported to the generated module, used for -fastproxy
    6751             :    * ----------------------------------------------------------------------------- */
    6752             :   
    6753           0 :   SWIGINTERN PyObject *SWIG_PyInstanceMethod_New(PyObject *SWIGUNUSEDPARM(self), PyObject *func) {
    6754           0 :     if (PyCFunction_Check(func)) {
    6755           0 :       PyCFunctionObject *funcobj = (PyCFunctionObject *)func;
    6756           0 :       PyMethodDef *ml = SWIG_PythonGetProxyDoc(funcobj->m_ml->ml_name);
    6757           0 :       if (ml)
    6758           0 :       func = PyCFunction_NewEx(ml, funcobj->m_self, funcobj->m_module);
    6759             :     }
    6760             : #if PY_VERSION_HEX >= 0x03000000
    6761           0 :     return PyInstanceMethod_New(func);
    6762             : #else
    6763             :     return PyMethod_New(func, NULL, NULL);
    6764             : #endif
    6765             :   }
    6766             :   
    6767             :   /* -----------------------------------------------------------------------------
    6768             :    * Wrapper of PyStaticMethod_New()
    6769             :    * It is exported to the generated module, used for -fastproxy
    6770             :    * ----------------------------------------------------------------------------- */
    6771             :   
    6772             :   SWIGINTERN PyObject *SWIG_PyStaticMethod_New(PyObject *SWIGUNUSEDPARM(self), PyObject *func) {
    6773             :     if (PyCFunction_Check(func)) {
    6774             :       PyCFunctionObject *funcobj = (PyCFunctionObject *)func;
    6775             :       PyMethodDef *ml = SWIG_PythonGetProxyDoc(funcobj->m_ml->ml_name);
    6776             :       if (ml)
    6777             :       func = PyCFunction_NewEx(ml, funcobj->m_self, funcobj->m_module);
    6778             :     }
    6779             :     return PyStaticMethod_New(func);
    6780             :   }
    6781             :   
    6782             : #ifdef __cplusplus
    6783             : }
    6784             : #endif
    6785             : 
    6786             : /* -----------------------------------------------------------------------------*
    6787             :  *  Partial Init method
    6788             :  * -----------------------------------------------------------------------------*/
    6789             : 
    6790             : #ifdef __cplusplus
    6791             : extern "C"
    6792             : #endif
    6793             : 
    6794             : SWIGEXPORT 
    6795             : #if PY_VERSION_HEX >= 0x03000000
    6796             : PyObject*
    6797             : #else
    6798             : void
    6799             : #endif
    6800          28 : SWIG_init(void) {
    6801          28 :   PyObject *m, *d, *md, *globals;
    6802             :   
    6803             : #if PY_VERSION_HEX >= 0x03000000
    6804          28 :   static struct PyModuleDef SWIG_module = {
    6805             :     PyModuleDef_HEAD_INIT,
    6806             :     SWIG_name,
    6807             :     NULL,
    6808             :     -1,
    6809             :     SwigMethods,
    6810             :     NULL,
    6811             :     NULL,
    6812             :     NULL,
    6813             :     NULL
    6814             :   };
    6815             : #endif
    6816             :   
    6817             : #if defined(SWIGPYTHON_BUILTIN)
    6818             :   static SwigPyClientData SwigPyObject_clientdata = {
    6819             :     0, 0, 0, 0, 0, 0, 0
    6820             :   };
    6821             :   static PyGetSetDef this_getset_def = {
    6822             :     (char *)"this", &SwigPyBuiltin_ThisClosure, NULL, NULL, NULL
    6823             :   };
    6824             :   static SwigPyGetSet thisown_getset_closure = {
    6825             :     SwigPyObject_own,
    6826             :     SwigPyObject_own
    6827             :   };
    6828             :   static PyGetSetDef thisown_getset_def = {
    6829             :     (char *)"thisown", SwigPyBuiltin_GetterClosure, SwigPyBuiltin_SetterClosure, NULL, &thisown_getset_closure
    6830             :   };
    6831             :   PyTypeObject *builtin_pytype;
    6832             :   int builtin_base_count;
    6833             :   swig_type_info *builtin_basetype;
    6834             :   PyObject *tuple;
    6835             :   PyGetSetDescrObject *static_getset;
    6836             :   PyTypeObject *metatype;
    6837             :   PyTypeObject *swigpyobject;
    6838             :   SwigPyClientData *cd;
    6839             :   PyObject *public_interface, *public_symbol;
    6840             :   PyObject *this_descr;
    6841             :   PyObject *thisown_descr;
    6842             :   PyObject *self = 0;
    6843             :   int i;
    6844             :   
    6845             :   (void)builtin_pytype;
    6846             :   (void)builtin_base_count;
    6847             :   (void)builtin_basetype;
    6848             :   (void)tuple;
    6849             :   (void)static_getset;
    6850             :   (void)self;
    6851             :   
    6852             :   /* Metaclass is used to implement static member variables */
    6853             :   metatype = SwigPyObjectType();
    6854             :   assert(metatype);
    6855             : #endif
    6856             :   
    6857          28 :   (void)globals;
    6858             :   
    6859             :   /* Create singletons now to avoid potential deadlocks with multi-threaded usage after module initialization */
    6860          28 :   SWIG_This();
    6861          28 :   SWIG_Python_TypeCache();
    6862          28 :   SwigPyPacked_type();
    6863             : #ifndef SWIGPYTHON_BUILTIN
    6864          28 :   SwigPyObject_type();
    6865             : #endif
    6866             :   
    6867             :   /* Fix SwigMethods to carry the callback ptrs when needed */
    6868          28 :   SWIG_Python_FixMethods(SwigMethods, swig_const_table, swig_types, swig_type_initial);
    6869             :   
    6870             : #if PY_VERSION_HEX >= 0x03000000
    6871          28 :   m = PyModule_Create(&SWIG_module);
    6872             : #else
    6873             :   m = Py_InitModule(SWIG_name, SwigMethods);
    6874             : #endif
    6875             :   
    6876          28 :   md = d = PyModule_GetDict(m);
    6877          28 :   (void)md;
    6878             :   
    6879          28 :   SWIG_InitializeModule(0);
    6880             :   
    6881             : #ifdef SWIGPYTHON_BUILTIN
    6882             :   swigpyobject = SwigPyObject_TypeOnce();
    6883             :   
    6884             :   SwigPyObject_stype = SWIG_MangledTypeQuery("_p_SwigPyObject");
    6885             :   assert(SwigPyObject_stype);
    6886             :   cd = (SwigPyClientData*) SwigPyObject_stype->clientdata;
    6887             :   if (!cd) {
    6888             :     SwigPyObject_stype->clientdata = &SwigPyObject_clientdata;
    6889             :     SwigPyObject_clientdata.pytype = swigpyobject;
    6890             :   } else if (swigpyobject->tp_basicsize != cd->pytype->tp_basicsize) {
    6891             :     PyErr_SetString(PyExc_RuntimeError, "Import error: attempted to load two incompatible swig-generated modules.");
    6892             : # if PY_VERSION_HEX >= 0x03000000
    6893             :     return NULL;
    6894             : # else
    6895             :     return;
    6896             : # endif
    6897             :   }
    6898             :   
    6899             :   /* All objects have a 'this' attribute */
    6900             :   this_descr = PyDescr_NewGetSet(SwigPyObject_type(), &this_getset_def);
    6901             :   (void)this_descr;
    6902             :   
    6903             :   /* All objects have a 'thisown' attribute */
    6904             :   thisown_descr = PyDescr_NewGetSet(SwigPyObject_type(), &thisown_getset_def);
    6905             :   (void)thisown_descr;
    6906             :   
    6907             :   public_interface = PyList_New(0);
    6908             :   public_symbol = 0;
    6909             :   (void)public_symbol;
    6910             :   
    6911             :   PyDict_SetItemString(md, "__all__", public_interface);
    6912             :   Py_DECREF(public_interface);
    6913             :   for (i = 0; SwigMethods[i].ml_name != NULL; ++i)
    6914             :   SwigPyBuiltin_AddPublicSymbol(public_interface, SwigMethods[i].ml_name);
    6915             :   for (i = 0; swig_const_table[i].name != 0; ++i)
    6916             :   SwigPyBuiltin_AddPublicSymbol(public_interface, swig_const_table[i].name);
    6917             : #endif
    6918             :   
    6919          28 :   SWIG_InstallConstants(d,swig_const_table);
    6920             :   
    6921             :   
    6922             :   
    6923          28 :   if ( OGRGetDriverCount() == 0 ) {
    6924           0 :     OGRRegisterAll();
    6925             :   }
    6926             :   // Will be turned on for GDAL 4.0
    6927             :   // UseExceptions();
    6928             :   
    6929             :   
    6930          28 :   SWIG_Python_SetConstant(d, "GATDijkstraShortestPath",SWIG_From_int(static_cast< int >(GATDijkstraShortestPath)));
    6931          28 :   SWIG_Python_SetConstant(d, "GATKShortestPath",SWIG_From_int(static_cast< int >(GATKShortestPath)));
    6932          28 :   SWIG_Python_SetConstant(d, "GATConnectedComponents",SWIG_From_int(static_cast< int >(GATConnectedComponents)));
    6933          28 :   SWIG_Python_SetConstant(d, "GNM_EDGE_DIR_BOTH",SWIG_From_int(static_cast< int >(0)));
    6934          28 :   SWIG_Python_SetConstant(d, "GNM_EDGE_DIR_SRCTOTGT",SWIG_From_int(static_cast< int >(1)));
    6935          28 :   SWIG_Python_SetConstant(d, "GNM_EDGE_DIR_TGTTOSRC",SWIG_From_int(static_cast< int >(2)));
    6936             :   
    6937             :   /* Initialize threading */
    6938          28 :   SWIG_PYTHON_INITIALIZE_THREADS;
    6939             : #if PY_VERSION_HEX >= 0x03000000
    6940          28 :   return m;
    6941             : #else
    6942             :   return;
    6943             : #endif
    6944             : }
    6945             : 

Generated by: LCOV version 1.14