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 2319 25.2 %
Date: 2024-05-14 13:00:50 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        2286 : SWIG_TypeCheck(const char *c, swig_type_info *ty) {
     449        2286 :   if (ty) {
     450        2286 :     swig_cast_info *iter = ty->cast;
     451        2749 :     while (iter) {
     452        2749 :       if (strcmp(iter->type->name, c) == 0) {
     453        2286 :         if (iter == ty->cast)
     454             :           return iter;
     455             :         /* Move iter to the top of the linked list */
     456         459 :         iter->prev->next = iter->next;
     457         459 :         if (iter->next)
     458         459 :           iter->next->prev = iter->prev;
     459         459 :         iter->next = ty->cast;
     460         459 :         iter->prev = 0;
     461         459 :         if (ty->cast) ty->cast->prev = iter;
     462         459 :         ty->cast = iter;
     463         459 :         return iter;
     464             :       }
     465         463 :       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         456 : SWIG_TypeNewClientData(swig_type_info *ti, void *clientdata) {
     571         456 :   SWIG_TypeClientData(ti, clientdata);
     572         456 :   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        6384 : SWIG_MangledTypeQueryModule(swig_module_info *start,
     585             :                             swig_module_info *end,
     586             :                 const char *name) {
     587        6384 :   swig_module_info *iter = start;
     588       19152 :   do {
     589       19152 :     if (iter->size) {
     590       19152 :       size_t l = 0;
     591       19152 :       size_t r = iter->size - 1;
     592       73188 :       do {
     593             :   /* since l+r >= 0, we can (>> 1) instead (/ 2) */
     594       73188 :   size_t i = (l + r) >> 1;
     595       73188 :   const char *iname = iter->types[i]->name;
     596       73188 :   if (iname) {
     597       73188 :     int compare = strcmp(name, iname);
     598       73188 :     if (compare == 0) {
     599        4332 :       return iter->types[i];
     600       68856 :     } else if (compare < 0) {
     601       42180 :       if (i) {
     602       37164 :         r = i - 1;
     603             :       } else {
     604             :         break;
     605             :       }
     606       26676 :     } else if (compare > 0) {
     607       26676 :       l = i + 1;
     608             :     }
     609             :   } else {
     610             :     break; /* should never happen */
     611             :   }
     612       63840 :       } while (l <= r);
     613             :     }
     614       14820 :     iter = iter->next;
     615       14820 :   } 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         228 : SWIG_Python_str_FromChar(const char *c)
     839             : {
     840             : #if PY_VERSION_HEX >= 0x03000000
     841         228 :   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         604 :          void end() { if (status) { PyEval_RestoreThread(save); status = false; }}
     994         604 :          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        1368 : SWIG_Python_SetConstant(PyObject *d, const char *name, PyObject *obj) {   
    1173        1368 :   PyDict_SetItemString(d, name, obj);
    1174        1368 :   Py_DECREF(obj);                            
    1175        1368 : }
    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         744 : SWIG_Python_UnpackTuple(PyObject *args, const char *name, Py_ssize_t min, Py_ssize_t max, PyObject **objs)
    1204             : {
    1205         744 :   if (!args) {
    1206         285 :     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         459 :   if (!PyTuple_Check(args)) {
    1215         456 :     if (min <= 1 && max >= 1) {
    1216         456 :       Py_ssize_t i;
    1217         456 :       objs[0] = args;
    1218         456 :       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         738 : SWIG_Py_Void(void)
    1282             : {
    1283         738 :   PyObject *none = Py_None;
    1284           0 :   Py_INCREF(none);
    1285         456 :   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         456 : SwigPyClientData_New(PyObject* obj)
    1320             : {
    1321         456 :   if (!obj) {
    1322             :     return 0;
    1323             :   } else {
    1324         456 :     SwigPyClientData *data = (SwigPyClientData *)malloc(sizeof(SwigPyClientData));
    1325             :     /* the klass element */
    1326         456 :     data->klass = obj;
    1327         456 :     Py_INCREF(data->klass);
    1328             :     /* the newraw method and newargs arguments used to create a new raw instance */
    1329         456 :     if (PyClass_Check(obj)) {
    1330         456 :       data->newraw = 0;
    1331         456 :       data->newargs = obj;
    1332         456 :       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         456 :     data->destroy = PyObject_GetAttrString(data->klass, "__swig_destroy__");
    1346         456 :     if (PyErr_Occurred()) {
    1347           0 :       PyErr_Clear();
    1348           0 :       data->destroy = 0;
    1349             :     }
    1350         456 :     if (data->destroy) {
    1351         456 :       int flags;
    1352         456 :       Py_INCREF(data->destroy);
    1353         456 :       flags = PyCFunction_GET_FLAGS(data->destroy);
    1354         456 :       data->delargs = !(flags & (METH_O));
    1355             :     } else {
    1356           0 :       data->delargs = 0;
    1357             :     }
    1358         456 :     data->implicitconv = 0;
    1359         456 :     data->pytype = 0;
    1360         456 :     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         286 : SwigPyObject_type(void) {
    1506         286 :   static PyTypeObject *SWIG_STATIC_POINTER(type) = SwigPyObject_TypeOnce();
    1507         286 :   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           0 :       const char *name = SWIG_TypePrettyName(ty);
    1570           0 :       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         228 : SwigPyObject_TypeOnce(void) {
    1652         228 :   static char swigobject_doc[] = "Swig object carries a C/C++ instance pointer";
    1653             : 
    1654         228 :   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         228 :   static PyTypeObject swigpyobject_type;
    1699         228 :   static int type_init = 0;
    1700         228 :   if (!type_init) {
    1701         228 :     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         228 :     swigpyobject_type = tmp;
    1770         228 :     type_init = 1;
    1771         228 :     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         228 : SwigPyPacked_type(void) {
    1836         228 :   static PyTypeObject *SWIG_STATIC_POINTER(type) = SwigPyPacked_TypeOnce();
    1837         228 :   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         228 : SwigPyPacked_TypeOnce(void) {
    1858         228 :   static char swigpacked_doc[] = "Swig object carries a C/C++ instance pointer";
    1859         228 :   static PyTypeObject swigpypacked_type;
    1860         228 :   static int type_init = 0;
    1861         228 :   if (!type_init) {
    1862         228 :     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         228 :     swigpypacked_type = tmp;
    1931         228 :     type_init = 1;
    1932         228 :     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         248 : SWIG_This(void)
    1978             : {
    1979         248 :   if (Swig_This_global == NULL)
    1980         228 :     Swig_This_global = SWIG_Python_str_FromChar("this");
    1981         248 :   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         228 : SWIG_Python_TypeCache(void) {
    2441         228 :   static PyObject *SWIG_STATIC_POINTER(cache) = PyDict_New();
    2442         228 :   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             : };
    2841             : 
    2842             : static void CPL_STDCALL
    2843           0 : PythonBindingErrorHandler(CPLErr eclass, CPLErrorNum err_no, const char *msg )
    2844             : {
    2845           0 :   PythonBindingErrorHandlerContext* ctxt = static_cast<
    2846           0 :       PythonBindingErrorHandlerContext*>(CPLGetErrorHandlerUserData());
    2847             : 
    2848             :   /*
    2849             :   ** Generally we want to suppress error reporting if we have exceptions
    2850             :   ** enabled as the error message will be in the exception thrown in
    2851             :   ** Python.
    2852             :   */
    2853             : 
    2854             :   /* If the error class is CE_Fatal, we want to have a message issued
    2855             :      because the CPL support code does an abort() before any exception
    2856             :      can be generated */
    2857           0 :   if (eclass == CE_Fatal ) {
    2858           0 :     CPLCallPreviousHandler(eclass, err_no, msg );
    2859             :   }
    2860             : 
    2861             :   /*
    2862             :   ** We do not want to interfere with non-failure messages since
    2863             :   ** they won't be translated into exceptions.
    2864             :   */
    2865           0 :   else if (eclass != CE_Failure ) {
    2866           0 :     CPLCallPreviousHandler(eclass, err_no, msg );
    2867             :   }
    2868             :   else {
    2869           0 :     ctxt->nLastCode = err_no;
    2870           0 :     if( ctxt->osFailureMsg.empty() ) {
    2871           0 :       ctxt->osFailureMsg = msg;
    2872           0 :       ctxt->osInitialMsg = ctxt->osFailureMsg;
    2873             :     } else {
    2874           0 :       if( ctxt->osFailureMsg.size() < 10000 ) {
    2875           0 :         ctxt->osFailureMsg = std::string(msg) + "\nMay be caused by: " + ctxt->osFailureMsg;
    2876           0 :         ctxt->osInitialMsg = ctxt->osFailureMsg;
    2877             :       }
    2878             :       else
    2879           0 :         ctxt->osFailureMsg = std::string(msg) + "\n[...]\nMay be caused by: " + ctxt->osInitialMsg;
    2880             :     }
    2881             :   }
    2882           0 : }
    2883             : 
    2884             : 
    2885             : 
    2886             : 
    2887             : static
    2888         319 : int GetUseExceptions() {
    2889         319 :   return bUseExceptionsLocal >= 0 ? bUseExceptionsLocal : bUseExceptions;
    2890             : }
    2891             : 
    2892           0 : static int _GetExceptionsLocal()
    2893             : {
    2894           0 :   return bUseExceptionsLocal;
    2895             : }
    2896             : 
    2897           0 : static void _SetExceptionsLocal(int bVal)
    2898             : {
    2899           0 :   bUseExceptionsLocal = bVal;
    2900             : }
    2901             : 
    2902             : static
    2903         274 : void _UseExceptions() {
    2904         274 :   CPLErrorReset();
    2905         274 :   bUserHasSpecifiedIfUsingExceptions = TRUE;
    2906         274 :   if( !bUseExceptions )
    2907             :   {
    2908         225 :     bUseExceptions = 1;
    2909             :   }
    2910             : }
    2911             : 
    2912             : static
    2913           5 : void _DontUseExceptions() {
    2914           5 :   CPLErrorReset();
    2915           5 :   bUserHasSpecifiedIfUsingExceptions = TRUE;
    2916           5 :   if( bUseExceptions )
    2917             :   {
    2918           0 :     bUseExceptions = 0;
    2919             :   }
    2920             : }
    2921             : 
    2922           6 : static int _UserHasSpecifiedIfUsingExceptions()
    2923             : {
    2924           6 :     return bUserHasSpecifiedIfUsingExceptions;
    2925             : }
    2926             : 
    2927             : 
    2928             : 
    2929             : SWIGINTERNINLINE PyObject*
    2930        1377 :   SWIG_From_int  (int value)
    2931             : {
    2932        1377 :   return PyInt_FromLong((long) value);
    2933             : }
    2934             : 
    2935             : 
    2936             : #include <limits.h>
    2937             : #if !defined(SWIG_NO_LLONG_MAX)
    2938             : # if !defined(LLONG_MAX) && defined(__GNUC__) && defined (__LONG_LONG_MAX__)
    2939             : #   define LLONG_MAX __LONG_LONG_MAX__
    2940             : #   define LLONG_MIN (-LLONG_MAX - 1LL)
    2941             : #   define ULLONG_MAX (LLONG_MAX * 2ULL + 1ULL)
    2942             : # endif
    2943             : #endif
    2944             : 
    2945             : 
    2946             : SWIGINTERN int
    2947           3 : SWIG_AsVal_double (PyObject *obj, double *val)
    2948             : {
    2949           3 :   int res = SWIG_TypeError;
    2950           3 :   if (PyFloat_Check(obj)) {
    2951           1 :     if (val) *val = PyFloat_AsDouble(obj);
    2952           1 :     return SWIG_OK;
    2953             : #if PY_VERSION_HEX < 0x03000000
    2954             :   } else if (PyInt_Check(obj)) {
    2955             :     if (val) *val = (double) PyInt_AsLong(obj);
    2956             :     return SWIG_OK;
    2957             : #endif
    2958           2 :   } else if (PyLong_Check(obj)) {
    2959           2 :     double v = PyLong_AsDouble(obj);
    2960           2 :     if (!PyErr_Occurred()) {
    2961           2 :       if (val) *val = v;
    2962           2 :       return SWIG_OK;
    2963             :     } else {
    2964           0 :       PyErr_Clear();
    2965             :     }
    2966             :   }
    2967             : #ifdef SWIG_PYTHON_CAST_MODE
    2968             :   {
    2969             :     int dispatch = 0;
    2970             :     double d = PyFloat_AsDouble(obj);
    2971             :     if (!PyErr_Occurred()) {
    2972             :       if (val) *val = d;
    2973             :       return SWIG_AddCast(SWIG_OK);
    2974             :     } else {
    2975             :       PyErr_Clear();
    2976             :     }
    2977             :     if (!dispatch) {
    2978             :       long v = PyLong_AsLong(obj);
    2979             :       if (!PyErr_Occurred()) {
    2980             :   if (val) *val = v;
    2981             :   return SWIG_AddCast(SWIG_AddCast(SWIG_OK));
    2982             :       } else {
    2983             :   PyErr_Clear();
    2984             :       }
    2985             :     }
    2986             :   }
    2987             : #endif
    2988             :   return res;
    2989             : }
    2990             : 
    2991             : 
    2992             : #include <float.h>
    2993             : 
    2994             : 
    2995             : #include <math.h>
    2996             : 
    2997             : 
    2998             : SWIGINTERNINLINE int
    2999             : SWIG_CanCastAsInteger(double *d, double min, double max) {
    3000             :   double x = *d;
    3001             :   if ((min <= x && x <= max)) {
    3002             :    double fx = floor(x);
    3003             :    double cx = ceil(x);
    3004             :    double rd =  ((x - fx) < 0.5) ? fx : cx; /* simple rint */
    3005             :    if ((errno == EDOM) || (errno == ERANGE)) {
    3006             :      errno = 0;
    3007             :    } else {
    3008             :      double summ, reps, diff;
    3009             :      if (rd < x) {
    3010             :        diff = x - rd;
    3011             :      } else if (rd > x) {
    3012             :        diff = rd - x;
    3013             :      } else {
    3014             :        return 1;
    3015             :      }
    3016             :      summ = rd + x;
    3017             :      reps = diff/summ;
    3018             :      if (reps < 8*DBL_EPSILON) {
    3019             :        *d = rd;
    3020             :        return 1;
    3021             :      }
    3022             :    }
    3023             :   }
    3024             :   return 0;
    3025             : }
    3026             : 
    3027             : 
    3028             : SWIGINTERN int
    3029           4 : SWIG_AsVal_long (PyObject *obj, long* val)
    3030             : {
    3031             : #if PY_VERSION_HEX < 0x03000000
    3032             :   if (PyInt_Check(obj)) {
    3033             :     if (val) *val = PyInt_AsLong(obj);
    3034             :     return SWIG_OK;
    3035             :   } else
    3036             : #endif
    3037           4 :   if (PyLong_Check(obj)) {
    3038           4 :     long v = PyLong_AsLong(obj);
    3039           4 :     if (!PyErr_Occurred()) {
    3040           4 :       if (val) *val = v;
    3041           4 :       return SWIG_OK;
    3042             :     } else {
    3043           0 :       PyErr_Clear();
    3044           0 :       return SWIG_OverflowError;
    3045             :     }
    3046             :   }
    3047             : #ifdef SWIG_PYTHON_CAST_MODE
    3048             :   {
    3049             :     int dispatch = 0;
    3050             :     long v = PyInt_AsLong(obj);
    3051             :     if (!PyErr_Occurred()) {
    3052             :       if (val) *val = v;
    3053             :       return SWIG_AddCast(SWIG_OK);
    3054             :     } else {
    3055             :       PyErr_Clear();
    3056             :     }
    3057             :     if (!dispatch) {
    3058             :       double d;
    3059             :       int res = SWIG_AddCast(SWIG_AsVal_double (obj,&d));
    3060             :       if (SWIG_IsOK(res) && SWIG_CanCastAsInteger(&d, LONG_MIN, LONG_MAX)) {
    3061             :   if (val) *val = (long)(d);
    3062             :   return res;
    3063             :       }
    3064             :     }
    3065             :   }
    3066             : #endif
    3067             :   return SWIG_TypeError;
    3068             : }
    3069             : 
    3070             : 
    3071             : SWIGINTERN int
    3072           4 : SWIG_AsVal_int (PyObject * obj, int *val)
    3073             : {
    3074           4 :   long v;
    3075           8 :   int res = SWIG_AsVal_long (obj, &v);
    3076           4 :   if (SWIG_IsOK(res)) {
    3077           4 :     if ((v < INT_MIN || v > INT_MAX)) {
    3078             :       return SWIG_OverflowError;
    3079             :     } else {
    3080           4 :       if (val) *val = static_cast< int >(v);
    3081             :     }
    3082             :   }  
    3083             :   return res;
    3084             : }
    3085             : 
    3086             : 
    3087             : /* Completely unrelated: just to avoid Coverity warnings */
    3088             : 
    3089             : static int bReturnSame = 1;
    3090             : 
    3091           0 : void NeverCallMePlease() {
    3092           0 :     bReturnSame = 0;
    3093           0 : }
    3094             : 
    3095             : /* Some SWIG code generates dead code, which Coverity warns about */
    3096         302 : template<class T> static T ReturnSame(T x)
    3097             : {
    3098         302 :     if( bReturnSame )
    3099             :         return x;
    3100             :     return 0;
    3101             : }
    3102             : 
    3103          17 : static void pushErrorHandler()
    3104             : {
    3105          17 :     CPLErrorReset();
    3106          17 :     PythonBindingErrorHandlerContext* ctxt = new PythonBindingErrorHandlerContext();
    3107          17 :     CPLPushErrorHandlerEx(PythonBindingErrorHandler, ctxt);
    3108          17 : }
    3109             : 
    3110          17 : static void popErrorHandler()
    3111             : {
    3112          17 :     PythonBindingErrorHandlerContext* ctxt = static_cast<
    3113          17 :       PythonBindingErrorHandlerContext*>(CPLGetErrorHandlerUserData());
    3114          17 :     CPLPopErrorHandler();
    3115          17 :     if( !ctxt->osFailureMsg.empty() )
    3116             :     {
    3117           0 :       CPLErrorSetState(
    3118           0 :           CPLGetLastErrorType() == CE_Failure ? CE_Failure: CE_Warning,
    3119             :           ctxt->nLastCode, ctxt->osFailureMsg.c_str());
    3120             :     }
    3121          17 :     delete ctxt;
    3122          17 : }
    3123             : 
    3124             : 
    3125             : 
    3126             : 
    3127             : /* Return a PyObject* from a NULL terminated C String */
    3128             : static PyObject* GDALPythonObjectFromCStr(const char *pszStr) CPL_UNUSED;
    3129           0 : static PyObject* GDALPythonObjectFromCStr(const char *pszStr)
    3130             : {
    3131           0 :   const unsigned char* pszIter = (const unsigned char*) pszStr;
    3132           0 :   while(*pszIter != 0)
    3133             :   {
    3134           0 :     if (*pszIter > 127)
    3135             :     {
    3136           0 :         PyObject* pyObj = PyUnicode_DecodeUTF8(pszStr, strlen(pszStr), "strict");
    3137           0 :         if (pyObj != NULL && !PyErr_Occurred())
    3138             :             return pyObj;
    3139           0 :         PyErr_Clear();
    3140           0 :         return PyBytes_FromString(pszStr);
    3141             :     }
    3142           0 :     pszIter ++;
    3143             :   }
    3144           0 :   return PyUnicode_FromString(pszStr);
    3145             : }
    3146             : 
    3147             : /* Return a NULL terminated c String from a PyObject */
    3148             : /* Result must be freed with GDALPythonFreeCStr */
    3149             : static char* GDALPythonObjectToCStr(PyObject* pyObject, int* pbToFree) CPL_UNUSED;
    3150           0 : static char* GDALPythonObjectToCStr(PyObject* pyObject, int* pbToFree)
    3151             : {
    3152           0 :   *pbToFree = 0;
    3153           0 :   if (PyUnicode_Check(pyObject))
    3154             :   {
    3155           0 :       char *pszStr;
    3156           0 :       char *pszNewStr;
    3157           0 :       Py_ssize_t nLen;
    3158           0 :       PyObject* pyUTF8Str = PyUnicode_AsUTF8String(pyObject);
    3159           0 :       if( pyUTF8Str == NULL )
    3160             :         return NULL;
    3161           0 :       PyBytes_AsStringAndSize(pyUTF8Str, &pszStr, &nLen);
    3162           0 :       pszNewStr = (char *) malloc(nLen+1);
    3163           0 :       if( pszNewStr == NULL )
    3164             :       {
    3165           0 :           CPLError(CE_Failure, CPLE_OutOfMemory, "Failed to allocate %llu bytes",
    3166             :                    (unsigned long long)(nLen + 1));
    3167           0 :           Py_XDECREF(pyUTF8Str);
    3168           0 :           return NULL;
    3169             :       }
    3170           0 :       memcpy(pszNewStr, pszStr, nLen+1);
    3171           0 :       Py_XDECREF(pyUTF8Str);
    3172           0 :       *pbToFree = 1;
    3173           0 :       return pszNewStr;
    3174             :   }
    3175           0 :   else if( PyBytes_Check(pyObject) )
    3176             :   {
    3177           0 :       char* ret = PyBytes_AsString(pyObject);
    3178             : 
    3179             :       // Check if there are \0 bytes inside the string
    3180           0 :       const Py_ssize_t size = PyBytes_Size(pyObject);
    3181           0 :       for( Py_ssize_t i = 0; i < size; i++ )
    3182             :       {
    3183           0 :           if( ret[i] == 0 )
    3184             :           {
    3185           0 :               CPLError(CE_Failure, CPLE_AppDefined,
    3186             :                        "bytes object cast as string contains a zero-byte.");
    3187           0 :               return NULL;
    3188             :           }
    3189             :       }
    3190             : 
    3191             :       return ret;
    3192             :   }
    3193             :   else
    3194             :   {
    3195           0 :       CPLError(CE_Failure, CPLE_AppDefined,
    3196             :                "Passed object is neither of type string nor bytes");
    3197           0 :       return NULL;
    3198             :   }
    3199             : }
    3200             : 
    3201             : static char * GDALPythonPathToCStr(PyObject* pyObject, int* pbToFree) CPL_UNUSED;
    3202             : static char * GDALPythonPathToCStr(PyObject* pyObject, int* pbToFree)
    3203             : {
    3204             :     PyObject* os = PyImport_ImportModule("os");
    3205             :     if (os == NULL)
    3206             :     {
    3207             :         return NULL;
    3208             :     }
    3209             : 
    3210             :     PyObject* pathLike = PyObject_GetAttrString(os, "PathLike");
    3211             :     if (pathLike == NULL)
    3212             :     {
    3213             :         Py_DECREF(os);
    3214             :         return NULL;
    3215             :     }
    3216             : 
    3217             :     if (!PyObject_IsInstance(pyObject, pathLike))
    3218             :     {
    3219             :         Py_DECREF(pathLike);
    3220             :         Py_DECREF(os);
    3221             :         return NULL;
    3222             :     }
    3223             : 
    3224             :     PyObject* str = PyObject_Str(pyObject);
    3225             :     char* ret = NULL;
    3226             :     if (str != NULL)
    3227             :     {
    3228             :         ret = GDALPythonObjectToCStr(str, pbToFree);
    3229             :         Py_DECREF(str);
    3230             :     }
    3231             : 
    3232             :     Py_DECREF(pathLike);
    3233             :     Py_DECREF(os);
    3234             : 
    3235             :     return ret;
    3236             : }
    3237             : 
    3238             : 
    3239             : static void GDALPythonFreeCStr(void* ptr, int bToFree) CPL_UNUSED;
    3240           0 : static void GDALPythonFreeCStr(void* ptr, int bToFree)
    3241             : {
    3242           0 :    if (bToFree)
    3243           0 :        free(ptr);
    3244             : }
    3245             : 
    3246             : 
    3247             : 
    3248             : 
    3249             : typedef struct {
    3250             :     PyObject *psPyCallback;
    3251             :     PyObject *psPyCallbackData;
    3252             :     int nLastReported;
    3253             : } PyProgressData;
    3254             : 
    3255             : /************************************************************************/
    3256             : /*                          PyProgressProxy()                           */
    3257             : /************************************************************************/
    3258             : 
    3259             : 
    3260             : static int CPL_STDCALL
    3261             : PyProgressProxy( double dfComplete, const char *pszMessage, void *pData ) CPL_UNUSED;
    3262             : 
    3263             : static int CPL_STDCALL
    3264             : PyProgressProxy( double dfComplete, const char *pszMessage, void *pData )
    3265             : 
    3266             : {
    3267             :     PyProgressData *psInfo = (PyProgressData *) pData;
    3268             :     PyObject *psArgs, *psResult;
    3269             :     int      bContinue = TRUE;
    3270             : 
    3271             :     if( dfComplete > 0 && psInfo->nLastReported == (int) (100.0 * dfComplete) )
    3272             :         return TRUE;
    3273             : 
    3274             :     if( psInfo->psPyCallback == NULL || psInfo->psPyCallback == Py_None )
    3275             :         return TRUE;
    3276             : 
    3277             :     psInfo->nLastReported = (int) (100.0 * dfComplete);
    3278             : 
    3279             :     if( pszMessage == NULL )
    3280             :         pszMessage = "";
    3281             : 
    3282             :     SWIG_PYTHON_THREAD_BEGIN_BLOCK;
    3283             : 
    3284             :     if( psInfo->psPyCallbackData == NULL )
    3285             :         psArgs = Py_BuildValue("(dsO)", dfComplete, pszMessage, Py_None );
    3286             :     else
    3287             :         psArgs = Py_BuildValue("(dsO)", dfComplete, pszMessage,
    3288             :                          psInfo->psPyCallbackData );
    3289             : 
    3290             :     psResult = PyObject_CallObject( psInfo->psPyCallback, psArgs);
    3291             :     Py_XDECREF(psArgs);
    3292             : 
    3293             :     if( PyErr_Occurred() != NULL )
    3294             :     {
    3295             :         PyErr_Print();
    3296             :         PyErr_Clear();
    3297             :         SWIG_PYTHON_THREAD_END_BLOCK;
    3298             :         return FALSE;
    3299             :     }
    3300             : 
    3301             :     if( psResult == NULL )
    3302             :     {
    3303             :         SWIG_PYTHON_THREAD_END_BLOCK;
    3304             :         return TRUE;
    3305             :     }
    3306             : 
    3307             :     if( psResult == Py_None )
    3308             :     {
    3309             :         SWIG_PYTHON_THREAD_END_BLOCK;
    3310             :         return TRUE;
    3311             :     }
    3312             : 
    3313             :     if( !PyArg_Parse( psResult, "i", &bContinue ) )
    3314             :     {
    3315             :         PyErr_Clear();
    3316             :         CPLError(CE_Failure, CPLE_AppDefined, "bad progress return value");
    3317             :         Py_XDECREF(psResult);
    3318             :         SWIG_PYTHON_THREAD_END_BLOCK;
    3319             :         return FALSE;
    3320             :     }
    3321             : 
    3322             :     Py_XDECREF(psResult);
    3323             :     SWIG_PYTHON_THREAD_END_BLOCK;
    3324             : 
    3325             :     return bContinue;
    3326             : }
    3327             : 
    3328             : 
    3329             : #include "gdal.h"
    3330             : 
    3331             : 
    3332           5 :   GNMNetworkShadow* CastToNetwork(GDALMajorObjectShadow* base) {
    3333           5 :       return (GNMNetworkShadow*)GNMCastToNetwork((GDALMajorObjectH)base);
    3334             :   }
    3335             : 
    3336             : 
    3337           1 :   GNMGenericNetworkShadow* CastToGenericNetwork(GDALMajorObjectShadow* base) {
    3338           1 :       return (GNMGenericNetworkShadow*)GNMCastToGenericNetwork((GDALMajorObjectH)base);
    3339             :   }
    3340             : 
    3341           0 : SWIGINTERN void delete_GNMNetworkShadow(GNMNetworkShadow *self){
    3342           0 :             if ( GDALDereferenceDataset( self ) <= 0 ) {
    3343           0 :               GDALClose(self);
    3344             :             }
    3345           0 :         }
    3346           3 : SWIGINTERN void GNMNetworkShadow_ReleaseResultSet(GNMNetworkShadow *self,OGRLayerShadow *layer){
    3347           3 :             GDALDatasetReleaseResultSet(self, layer);
    3348           3 :         }
    3349           2 : SWIGINTERN int GNMNetworkShadow_GetVersion(GNMNetworkShadow *self){
    3350           2 :             return GNMGetVersion(self);
    3351             :         }
    3352           2 : SWIGINTERN char const *GNMNetworkShadow_GetName(GNMNetworkShadow *self){
    3353           2 :             return GNMGetName(self);
    3354             :         }
    3355             : 
    3356             : SWIGINTERN swig_type_info*
    3357           0 : SWIG_pchar_descriptor(void)
    3358             : {
    3359           0 :   static int init = 0;
    3360           0 :   static swig_type_info* info = 0;
    3361           0 :   if (!init) {
    3362           0 :     info = SWIG_TypeQuery("_p_char");
    3363           0 :     init = 1;
    3364             :   }
    3365           0 :   return info;
    3366             : }
    3367             : 
    3368             : 
    3369             : SWIGINTERNINLINE PyObject *
    3370           2 : SWIG_FromCharPtrAndSize(const char* carray, size_t size)
    3371             : {
    3372           2 :   if (carray) {
    3373           2 :     if (size > INT_MAX) {
    3374           0 :       swig_type_info* pchar_descriptor = SWIG_pchar_descriptor();
    3375           0 :       return pchar_descriptor ? 
    3376           0 :   SWIG_InternalNewPointerObj(const_cast< char * >(carray), pchar_descriptor, 0) : SWIG_Py_Void();
    3377             :     } else {
    3378             : #if PY_VERSION_HEX >= 0x03000000
    3379             : #if defined(SWIG_PYTHON_STRICT_BYTE_CHAR)
    3380             :       return PyBytes_FromStringAndSize(carray, static_cast< Py_ssize_t >(size));
    3381             : #else
    3382           2 :       return PyUnicode_DecodeUTF8(carray, static_cast< Py_ssize_t >(size), "surrogateescape");
    3383             : #endif
    3384             : #else
    3385             :       return PyString_FromStringAndSize(carray, static_cast< Py_ssize_t >(size));
    3386             : #endif
    3387             :     }
    3388             :   } else {
    3389           0 :     return SWIG_Py_Void();
    3390             :   }
    3391             : }
    3392             : 
    3393             : 
    3394             : SWIGINTERNINLINE PyObject * 
    3395           2 : SWIG_FromCharPtr(const char *cptr)
    3396             : { 
    3397           2 :   return SWIG_FromCharPtrAndSize(cptr, (cptr ? strlen(cptr) : 0));
    3398             : }
    3399             : 
    3400           0 : SWIGINTERN OGRFeatureShadow *GNMNetworkShadow_GetFeatureByGlobalFID(GNMNetworkShadow *self,GIntBig GFID){
    3401           0 :             return GNMGetFeatureByGlobalFID(self, GFID);
    3402             :         }
    3403             : 
    3404             : /************************************************************************/
    3405             : /*                         CSLFromPySequence()                          */
    3406             : /************************************************************************/
    3407           2 : static char **CSLFromPySequence( PyObject *pySeq, int *pbErr )
    3408             : 
    3409             : {
    3410           2 :   *pbErr = FALSE;
    3411             :   /* Check if is a list (and reject strings, that are seen as sequence of characters)  */
    3412           2 :   if ( ! PySequence_Check(pySeq) || PyUnicode_Check(pySeq) ) {
    3413           0 :     PyErr_SetString(PyExc_TypeError,"not a sequence");
    3414           0 :     *pbErr = TRUE;
    3415           0 :     return NULL;
    3416             :   }
    3417             : 
    3418           2 :   Py_ssize_t size = PySequence_Size(pySeq);
    3419           2 :   if( size > (Py_ssize_t)(INT_MAX - 1) ) {
    3420           0 :     PyErr_SetString(PyExc_TypeError, "too big sequence");
    3421           0 :     *pbErr = TRUE;
    3422           0 :     return NULL;
    3423             :   }
    3424           2 :   if( size == 0 ) {
    3425             :     return NULL;
    3426             :   }
    3427           2 :   char** papszRet = (char**) VSICalloc((int)size + 1, sizeof(char*));
    3428           2 :   if( !papszRet ) {
    3429           0 :     PyErr_SetString(PyExc_MemoryError, "cannot allocate temporary buffer");
    3430           0 :     *pbErr = TRUE;
    3431           0 :     return NULL;
    3432             :   }
    3433           5 :   for (int i = 0; i < (int)size; i++) {
    3434           3 :     PyObject* pyObj = PySequence_GetItem(pySeq,i);
    3435           3 :     if (PyUnicode_Check(pyObj))
    3436             :     {
    3437           3 :       char *pszStr;
    3438           3 :       Py_ssize_t nLen;
    3439           3 :       PyObject* pyUTF8Str = PyUnicode_AsUTF8String(pyObj);
    3440           3 :       if( !pyUTF8Str )
    3441             :       {
    3442           0 :         Py_DECREF(pyObj);
    3443           0 :         PyErr_SetString(PyExc_TypeError,"invalid Unicode sequence");
    3444           0 :         CSLDestroy(papszRet);
    3445           0 :         *pbErr = TRUE;
    3446           0 :         return NULL;
    3447             :       }
    3448           3 :       PyBytes_AsStringAndSize(pyUTF8Str, &pszStr, &nLen);
    3449           3 :       papszRet[i] = VSIStrdup(pszStr);
    3450           6 :       Py_XDECREF(pyUTF8Str);
    3451             :     }
    3452           0 :     else if (PyBytes_Check(pyObj))
    3453           0 :       papszRet[i] = VSIStrdup(PyBytes_AsString(pyObj));
    3454             :     else
    3455             :     {
    3456           0 :         Py_DECREF(pyObj);
    3457           0 :         PyErr_SetString(PyExc_TypeError,"sequence must contain strings");
    3458           0 :         CSLDestroy(papszRet);
    3459           0 :         *pbErr = TRUE;
    3460           0 :         return NULL;
    3461             :     }
    3462           3 :     Py_DECREF(pyObj);
    3463           3 :     if( !papszRet[i] )
    3464             :     {
    3465           0 :         PyErr_SetString(PyExc_MemoryError, "cannot allocate temporary buffer");
    3466           0 :         CSLDestroy(papszRet);
    3467           0 :         *pbErr = TRUE;
    3468           0 :         return NULL;
    3469             :     }
    3470             :   }
    3471             :   return papszRet;
    3472             : }
    3473             : 
    3474             : 
    3475           0 : static char **CSLFromPyMapping( PyObject *pyObj, int *pbErr )
    3476             : 
    3477             : {
    3478           0 :     char** retCSL = NULL;
    3479           0 :     Py_ssize_t size = PyMapping_Length( pyObj );
    3480           0 :     if ( size > 0 && size == (int)size) {
    3481           0 :       PyObject *item_list = PyMapping_Items( pyObj );
    3482           0 :       for( int i=0; i<(int)size; i++ ) {
    3483           0 :         PyObject *it = PySequence_GetItem( item_list, i );
    3484             : 
    3485           0 :         PyObject *k, *v;
    3486           0 :         if ( ! PyArg_ParseTuple( it, "OO", &k, &v ) ) {
    3487           0 :           Py_DECREF(it);
    3488           0 :           Py_DECREF(item_list);
    3489           0 :           PyErr_SetString(PyExc_TypeError,"Cannot retrieve key/value");
    3490           0 :           CSLDestroy(retCSL);
    3491           0 :           *pbErr = TRUE;
    3492           0 :           return NULL;
    3493             :         }
    3494             : 
    3495           0 :         PyObject* kStr = PyObject_Str(k);
    3496           0 :         if( PyErr_Occurred() )
    3497             :         {
    3498           0 :             Py_DECREF(it);
    3499           0 :             Py_DECREF(item_list);
    3500           0 :             CSLDestroy(retCSL);
    3501           0 :             *pbErr = TRUE;
    3502           0 :             return NULL;
    3503             :         }
    3504             : 
    3505           0 :         PyObject* vStr;
    3506           0 :         if( PyBytes_Check(v) )
    3507             :         {
    3508           0 :             vStr = v;
    3509           0 :             Py_INCREF(vStr);
    3510             :         }
    3511             :         else
    3512             :         {
    3513           0 :             vStr = PyObject_Str(v);
    3514           0 :             if( PyErr_Occurred() )
    3515             :             {
    3516           0 :                 Py_DECREF(it);
    3517           0 :                 Py_DECREF(kStr);
    3518           0 :                 Py_DECREF(item_list);
    3519           0 :                 CSLDestroy(retCSL);
    3520           0 :                 *pbErr = TRUE;
    3521           0 :                 return NULL;
    3522             :             }
    3523             :         }
    3524             : 
    3525           0 :         int bFreeK, bFreeV;
    3526           0 :         char* pszK = GDALPythonObjectToCStr(kStr, &bFreeK);
    3527           0 :         char* pszV = GDALPythonObjectToCStr(vStr, &bFreeV);
    3528           0 :         if( pszK == NULL || pszV == NULL )
    3529             :         {
    3530           0 :             GDALPythonFreeCStr(pszK, bFreeK);
    3531           0 :             GDALPythonFreeCStr(pszV, bFreeV);
    3532           0 :             Py_DECREF(kStr);
    3533           0 :             Py_DECREF(vStr);
    3534           0 :             Py_DECREF(it);
    3535           0 :             Py_DECREF(item_list);
    3536           0 :             PyErr_SetString(PyExc_TypeError,"Cannot get key/value as string");
    3537           0 :             CSLDestroy(retCSL);
    3538           0 :             *pbErr = TRUE;
    3539           0 :             return NULL;
    3540             :         }
    3541           0 :         retCSL = CSLAddNameValue( retCSL, pszK, pszV );
    3542             : 
    3543           0 :         GDALPythonFreeCStr(pszK, bFreeK);
    3544           0 :         GDALPythonFreeCStr(pszV, bFreeV);
    3545           0 :         Py_DECREF(kStr);
    3546           0 :         Py_DECREF(vStr);
    3547           0 :         Py_DECREF(it);
    3548             :       }
    3549           0 :       Py_DECREF(item_list);
    3550             :     }
    3551           0 :     *pbErr = FALSE;
    3552           0 :     return retCSL;
    3553             : }
    3554             : 
    3555           3 : SWIGINTERN OGRLayerShadow *GNMNetworkShadow_GetPath(GNMNetworkShadow *self,GIntBig nStartFID,GIntBig nEndFID,GNMGraphAlgorithmType eAlgorithm,char **options=0){
    3556           3 :             return GNMGetPath(self, nStartFID, nEndFID, eAlgorithm, options);
    3557             :         }
    3558           0 : SWIGINTERN CPLErr GNMNetworkShadow_DisconnectAll(GNMNetworkShadow *self){
    3559           0 :             return GNMDisconnectAll( self );
    3560             :         }
    3561           0 : SWIGINTERN char const *GNMNetworkShadow_GetProjection(GNMNetworkShadow *self){
    3562           0 :             return GDALGetProjectionRef( self );
    3563             :         }
    3564           0 : SWIGINTERN char const *GNMNetworkShadow_GetProjectionRef(GNMNetworkShadow *self){
    3565           0 :             return GDALGetProjectionRef( self );
    3566             :         }
    3567           0 : SWIGINTERN char **GNMNetworkShadow_GetFileList(GNMNetworkShadow *self){
    3568           0 :             return GDALGetFileList( self );
    3569             :         }
    3570             : 
    3571           0 : static PyObject* CSLToList( char** stringarray, bool *pbErr )
    3572             : {
    3573           0 :   PyObject* res;
    3574           0 :   if ( stringarray == NULL ) {
    3575           0 :     res = Py_None;
    3576           0 :     Py_INCREF( res );
    3577             :   }
    3578             :   else {
    3579           0 :     int len = CSLCount( stringarray );
    3580           0 :     res = PyList_New( len );
    3581           0 :     if( !res ) {
    3582           0 :       *pbErr = true;
    3583           0 :       return res;
    3584             :     }
    3585           0 :     for ( int i = 0; i < len; ++i ) {
    3586           0 :       PyObject *o = GDALPythonObjectFromCStr( stringarray[i] );
    3587           0 :       PyList_SetItem(res, i, o );
    3588             :     }
    3589             :   }
    3590           0 :   *pbErr = false;
    3591           0 :   return res;
    3592             : }
    3593             : 
    3594             : 
    3595             : SWIGINTERN int
    3596           0 : SWIG_AsCharPtrAndSize(PyObject *obj, char** cptr, size_t* psize, int *alloc)
    3597             : {
    3598             : #if PY_VERSION_HEX>=0x03000000
    3599             : #if defined(SWIG_PYTHON_STRICT_BYTE_CHAR)
    3600             :   if (PyBytes_Check(obj))
    3601             : #else
    3602           0 :   if (PyUnicode_Check(obj))
    3603             : #endif
    3604             : #else  
    3605             :   if (PyString_Check(obj))
    3606             : #endif
    3607             :   {
    3608           0 :     char *cstr; Py_ssize_t len;
    3609           0 :     int ret = SWIG_OK;
    3610             : #if PY_VERSION_HEX>=0x03000000
    3611             : #if !defined(SWIG_PYTHON_STRICT_BYTE_CHAR)
    3612           0 :     if (!alloc && cptr) {
    3613             :         /* We can't allow converting without allocation, since the internal
    3614             :            representation of string in Python 3 is UCS-2/UCS-4 but we require
    3615             :            a UTF-8 representation.
    3616             :            TODO(bhy) More detailed explanation */
    3617             :         return SWIG_RuntimeError;
    3618             :     }
    3619           0 :     obj = PyUnicode_AsUTF8String(obj); if (!obj) return SWIG_TypeError;
    3620           0 :     if (!obj)
    3621             :       return SWIG_TypeError;
    3622           0 :     if (alloc)
    3623           0 :       *alloc = SWIG_NEWOBJ;
    3624             : #endif
    3625           0 :     PyBytes_AsStringAndSize(obj, &cstr, &len);
    3626             : #else
    3627             :     PyString_AsStringAndSize(obj, &cstr, &len);
    3628             : #endif
    3629           0 :     if (cptr) {
    3630           0 :       if (alloc) {
    3631           0 :   if (*alloc == SWIG_NEWOBJ) {
    3632           0 :     *cptr = reinterpret_cast< char* >(memcpy(new char[len + 1], cstr, sizeof(char)*(len + 1)));
    3633           0 :     *alloc = SWIG_NEWOBJ;
    3634             :   } else {
    3635           0 :     *cptr = cstr;
    3636           0 :     *alloc = SWIG_OLDOBJ;
    3637             :   }
    3638             :       } else {
    3639             : #if PY_VERSION_HEX>=0x03000000
    3640             : #if defined(SWIG_PYTHON_STRICT_BYTE_CHAR)
    3641             :   *cptr = PyBytes_AsString(obj);
    3642             : #else
    3643             :   assert(0); /* Should never reach here with Unicode strings in Python 3 */
    3644             : #endif
    3645             : #else
    3646             :   *cptr = SWIG_Python_str_AsChar(obj);
    3647             :         if (!*cptr)
    3648             :           ret = SWIG_TypeError;
    3649             : #endif
    3650             :       }
    3651             :     }
    3652           0 :     if (psize) *psize = len + 1;
    3653             : #if PY_VERSION_HEX>=0x03000000 && !defined(SWIG_PYTHON_STRICT_BYTE_CHAR)
    3654           0 :     Py_XDECREF(obj);
    3655             : #endif
    3656           0 :     return ret;
    3657             :   } else {
    3658             : #if defined(SWIG_PYTHON_2_UNICODE)
    3659             : #if defined(SWIG_PYTHON_STRICT_BYTE_CHAR)
    3660             : #error "Cannot use both SWIG_PYTHON_2_UNICODE and SWIG_PYTHON_STRICT_BYTE_CHAR at once"
    3661             : #endif
    3662             : #if PY_VERSION_HEX<0x03000000
    3663             :     if (PyUnicode_Check(obj)) {
    3664             :       char *cstr; Py_ssize_t len;
    3665             :       if (!alloc && cptr) {
    3666             :         return SWIG_RuntimeError;
    3667             :       }
    3668             :       obj = PyUnicode_AsUTF8String(obj); if (!obj) return SWIG_TypeError;
    3669             :       if (!obj)
    3670             :         return SWIG_TypeError;
    3671             :       if (PyString_AsStringAndSize(obj, &cstr, &len) != -1) {
    3672             :         if (cptr) {
    3673             :           if (alloc) *alloc = SWIG_NEWOBJ;
    3674             :           *cptr = reinterpret_cast< char* >(memcpy(new char[len + 1], cstr, sizeof(char)*(len + 1)));
    3675             :         }
    3676             :         if (psize) *psize = len + 1;
    3677             : 
    3678             :         Py_XDECREF(obj);
    3679             :         return SWIG_OK;
    3680             :       } else {
    3681             :         Py_XDECREF(obj);
    3682             :       }
    3683             :     }
    3684             : #endif
    3685             : #endif
    3686             : 
    3687           0 :     swig_type_info* pchar_descriptor = SWIG_pchar_descriptor();
    3688           0 :     if (pchar_descriptor) {
    3689           0 :       void* vptr = 0;
    3690           0 :       if (SWIG_ConvertPtr(obj, &vptr, pchar_descriptor, 0) == SWIG_OK) {
    3691           0 :   if (cptr) *cptr = (char *) vptr;
    3692           0 :   if (psize) *psize = vptr ? (strlen((char *)vptr) + 1) : 0;
    3693           0 :   if (alloc) *alloc = SWIG_OLDOBJ;
    3694           0 :   return SWIG_OK;
    3695             :       }
    3696             :     }
    3697             :   }
    3698             :   return SWIG_TypeError;
    3699             : }
    3700             : 
    3701             : 
    3702             : 
    3703             : 
    3704           0 : SWIGINTERN OGRLayerShadow *GNMNetworkShadow_CreateLayer(GNMNetworkShadow *self,char const *name,OSRSpatialReferenceShadow *srs=NULL,OGRwkbGeometryType geom_type=wkbUnknown,char **options=0){
    3705           0 :             OGRLayerShadow* layer = (OGRLayerShadow*) GDALDatasetCreateLayer( self,
    3706             :                                       name,
    3707             :                                       srs,
    3708             :                                       geom_type,
    3709             :                                       options);
    3710           0 :             return layer;
    3711             :         }
    3712           0 : SWIGINTERN OGRLayerShadow *GNMNetworkShadow_CopyLayer(GNMNetworkShadow *self,OGRLayerShadow *src_layer,char const *new_name,char **options=0){
    3713           0 :             OGRLayerShadow* layer = (OGRLayerShadow*) GDALDatasetCopyLayer( self,
    3714             :                                                       src_layer,
    3715             :                                                       new_name,
    3716             :                                                       options);
    3717           0 :             return layer;
    3718             :         }
    3719           0 : SWIGINTERN OGRErr GNMNetworkShadow_DeleteLayer(GNMNetworkShadow *self,int index){
    3720           0 :             return GDALDatasetDeleteLayer(self, index);
    3721             :         }
    3722             : 
    3723             : 
    3724             : #include "ogr_core.h"
    3725             : static char const *
    3726           0 : OGRErrMessages( int rc ) {
    3727           0 :   switch( rc ) {
    3728             :   case OGRERR_NONE:
    3729             :     return "OGR Error: None";
    3730           0 :   case OGRERR_NOT_ENOUGH_DATA:
    3731           0 :     return "OGR Error: Not enough data to deserialize";
    3732           0 :   case OGRERR_NOT_ENOUGH_MEMORY:
    3733           0 :     return "OGR Error: Not enough memory";
    3734           0 :   case OGRERR_UNSUPPORTED_GEOMETRY_TYPE:
    3735           0 :     return "OGR Error: Unsupported geometry type";
    3736           0 :   case OGRERR_UNSUPPORTED_OPERATION:
    3737           0 :     return "OGR Error: Unsupported operation";
    3738           0 :   case OGRERR_CORRUPT_DATA:
    3739           0 :     return "OGR Error: Corrupt data";
    3740           0 :   case OGRERR_FAILURE:
    3741           0 :     return "OGR Error: General Error";
    3742           0 :   case OGRERR_UNSUPPORTED_SRS:
    3743           0 :     return "OGR Error: Unsupported SRS";
    3744           0 :   case OGRERR_INVALID_HANDLE:
    3745           0 :     return "OGR Error: Invalid handle";
    3746           0 :   case OGRERR_NON_EXISTING_FEATURE:
    3747           0 :     return "OGR Error: Non existing feature";
    3748           0 :   default:
    3749           0 :     return "OGR Error: Unknown";
    3750             :   }
    3751             : }
    3752             : 
    3753           0 : SWIGINTERN int GNMNetworkShadow_GetLayerCount(GNMNetworkShadow *self){
    3754           0 :             return GDALDatasetGetLayerCount(self);
    3755             :         }
    3756           0 : SWIGINTERN OGRLayerShadow *GNMNetworkShadow_GetLayerByIndex(GNMNetworkShadow *self,int index=0){
    3757             :         
    3758           0 :         OGRLayerShadow* layer = (OGRLayerShadow*) GDALDatasetGetLayer(self,
    3759             :                                                                       index);
    3760           0 :             return layer;
    3761             :         }
    3762           0 : SWIGINTERN OGRLayerShadow *GNMNetworkShadow_GetLayerByName(GNMNetworkShadow *self,char const *layer_name){
    3763           0 :             OGRLayerShadow* layer =
    3764           0 :                   (OGRLayerShadow*) GDALDatasetGetLayerByName(self, layer_name);
    3765           0 :             return layer;
    3766             :         }
    3767           0 : SWIGINTERN bool GNMNetworkShadow_TestCapability(GNMNetworkShadow *self,char const *cap){
    3768           0 :             return (GDALDatasetTestCapability(self, cap) > 0);
    3769             :         }
    3770             : 
    3771             : SWIGINTERNINLINE PyObject*
    3772           0 :   SWIG_From_bool  (bool value)
    3773             : {
    3774           0 :   return PyBool_FromLong(value ? 1 : 0);
    3775             : }
    3776             : 
    3777           0 : SWIGINTERN OGRErr GNMNetworkShadow_StartTransaction(GNMNetworkShadow *self,int force=FALSE){
    3778           0 :             return GDALDatasetStartTransaction(self, force);
    3779             :         }
    3780           0 : SWIGINTERN OGRErr GNMNetworkShadow_CommitTransaction(GNMNetworkShadow *self){
    3781           0 :             return GDALDatasetCommitTransaction(self);
    3782             :         }
    3783           0 : SWIGINTERN OGRErr GNMNetworkShadow_RollbackTransaction(GNMNetworkShadow *self){
    3784           0 :             return GDALDatasetRollbackTransaction(self);
    3785             :         }
    3786           0 : SWIGINTERN void delete_GNMGenericNetworkShadow(GNMGenericNetworkShadow *self){
    3787           0 :             if ( GDALDereferenceDataset( self ) <= 0 ) {
    3788           0 :               GDALClose(self);
    3789             :             }
    3790           0 :         }
    3791           0 : SWIGINTERN CPLErr GNMGenericNetworkShadow_ConnectFeatures(GNMGenericNetworkShadow *self,GIntBig nSrcFID,GIntBig nTgtFID,GIntBig nConFID,double dfCost,double dfInvCost,GNMDirection eDir){
    3792           0 :             return GNMConnectFeatures(self, nSrcFID, nTgtFID,
    3793             :                                               nConFID, dfCost, dfInvCost, eDir);
    3794             :         }
    3795           0 : SWIGINTERN CPLErr GNMGenericNetworkShadow_DisconnectFeatures(GNMGenericNetworkShadow *self,GIntBig nSrcFID,GIntBig nTgtFID,GIntBig nConFID){
    3796           0 :             return GNMDisconnectFeatures(self, nSrcFID, nTgtFID,
    3797             :                                                            nConFID);
    3798             :         }
    3799           0 : SWIGINTERN CPLErr GNMGenericNetworkShadow_DisconnectFeaturesWithId(GNMGenericNetworkShadow *self,GIntBig nFID){
    3800           0 :             return GNMDisconnectFeaturesWithId(self, nFID);
    3801             :         }
    3802           0 : SWIGINTERN CPLErr GNMGenericNetworkShadow_ReconnectFeatures(GNMGenericNetworkShadow *self,GIntBig nSrcFID,GIntBig nTgtFID,GIntBig nConFID,double dfCost,double dfInvCost,GNMDirection eDir){
    3803           0 :             return GNMReconnectFeatures(self, nSrcFID, nTgtFID, nConFID, dfCost, dfInvCost, eDir);
    3804             :         }
    3805           0 : SWIGINTERN CPLErr GNMGenericNetworkShadow_CreateRule(GNMGenericNetworkShadow *self,char const *pszRuleStr){
    3806           0 :             return GNMCreateRule(self, pszRuleStr);
    3807             :         }
    3808           0 : SWIGINTERN CPLErr GNMGenericNetworkShadow_DeleteAllRules(GNMGenericNetworkShadow *self){
    3809           0 :             return GNMDeleteAllRules(self);
    3810             :         }
    3811           0 : SWIGINTERN CPLErr GNMGenericNetworkShadow_DeleteRule(GNMGenericNetworkShadow *self,char const *pszRuleStr){
    3812           0 :             return GNMDeleteRule(self, pszRuleStr);
    3813             :         }
    3814           0 : SWIGINTERN char **GNMGenericNetworkShadow_GetRules(GNMGenericNetworkShadow *self){
    3815           0 :             return GNMGetRules(self);
    3816             :         }
    3817           1 : SWIGINTERN CPLErr GNMGenericNetworkShadow_ConnectPointsByLines(GNMGenericNetworkShadow *self,char **papszLayerList,double dfTolerance,double dfCost,double dfInvCost,GNMDirection eDir){
    3818           1 :             return GNMConnectPointsByLines(self, papszLayerList, dfTolerance, dfCost, dfInvCost, eDir);
    3819             :         }
    3820             : 
    3821             : SWIGINTERN int
    3822           0 : SWIG_AsVal_bool (PyObject *obj, bool *val)
    3823             : {
    3824           0 :   int r;
    3825           0 :   if (!PyBool_Check(obj))
    3826             :     return SWIG_ERROR;
    3827           0 :   r = PyObject_IsTrue(obj);
    3828           0 :   if (r == -1)
    3829             :     return SWIG_ERROR;
    3830           0 :   if (val) *val = r ? true : false;
    3831             :   return SWIG_OK;
    3832             : }
    3833             : 
    3834           0 : SWIGINTERN CPLErr GNMGenericNetworkShadow_ChangeBlockState(GNMGenericNetworkShadow *self,GIntBig nFID,bool bIsBlock){
    3835           0 :             return GNMChangeBlockState(self, nFID, bIsBlock);
    3836             :         }
    3837           0 : SWIGINTERN CPLErr GNMGenericNetworkShadow_ChangeAllBlockState(GNMGenericNetworkShadow *self,bool bIsBlock=false){
    3838           0 :             return GNMChangeAllBlockState(self, bIsBlock);
    3839             :         }
    3840             : #ifdef __cplusplus
    3841             : extern "C" {
    3842             : #endif
    3843           0 : SWIGINTERN PyObject *_wrap_GetUseExceptions(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
    3844           0 :   PyObject *resultobj = 0; int bLocalUseExceptionsCode = GetUseExceptions();
    3845           0 :   int result;
    3846             :   
    3847           0 :   if (!SWIG_Python_UnpackTuple(args, "GetUseExceptions", 0, 0, 0)) SWIG_fail;
    3848           0 :   {
    3849             : #ifdef SED_HACKS
    3850           0 :     if( bUseExceptions ) bLocalUseExceptionsCode = FALSE;
    3851             : #endif
    3852           0 :     result = GetUseExceptions();
    3853             :   }
    3854           0 :   resultobj = SWIG_From_int(static_cast< int >(result));
    3855           0 :   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
    3856             :   return resultobj;
    3857           0 : fail:
    3858           0 :   return NULL;
    3859             : }
    3860             : 
    3861             : 
    3862           0 : SWIGINTERN PyObject *_wrap__GetExceptionsLocal(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
    3863           0 :   PyObject *resultobj = 0; int bLocalUseExceptionsCode = GetUseExceptions();
    3864           0 :   int result;
    3865             :   
    3866           0 :   if (!SWIG_Python_UnpackTuple(args, "_GetExceptionsLocal", 0, 0, 0)) SWIG_fail;
    3867           0 :   {
    3868             : #ifdef SED_HACKS
    3869           0 :     if( bUseExceptions ) bLocalUseExceptionsCode = FALSE;
    3870             : #endif
    3871           0 :     {
    3872           0 :       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
    3873           0 :       result = (int)_GetExceptionsLocal();
    3874           0 :       SWIG_PYTHON_THREAD_END_ALLOW;
    3875             :     }
    3876             :   }
    3877           0 :   resultobj = SWIG_From_int(static_cast< int >(result));
    3878           0 :   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
    3879             :   return resultobj;
    3880           0 : fail:
    3881           0 :   return NULL;
    3882             : }
    3883             : 
    3884             : 
    3885           0 : SWIGINTERN PyObject *_wrap__SetExceptionsLocal(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
    3886           0 :   PyObject *resultobj = 0; int bLocalUseExceptionsCode = GetUseExceptions();
    3887           0 :   int arg1 ;
    3888           0 :   int val1 ;
    3889           0 :   int ecode1 = 0 ;
    3890           0 :   PyObject *swig_obj[1] ;
    3891             :   
    3892           0 :   if (!args) SWIG_fail;
    3893           0 :   swig_obj[0] = args;
    3894           0 :   ecode1 = SWIG_AsVal_int(swig_obj[0], &val1);
    3895           0 :   if (!SWIG_IsOK(ecode1)) {
    3896           0 :     SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "_SetExceptionsLocal" "', argument " "1"" of type '" "int""'");
    3897             :   } 
    3898           0 :   arg1 = static_cast< int >(val1);
    3899           0 :   {
    3900             : #ifdef SED_HACKS
    3901           0 :     if( bUseExceptions ) bLocalUseExceptionsCode = FALSE;
    3902             : #endif
    3903           0 :     {
    3904           0 :       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
    3905           0 :       _SetExceptionsLocal(arg1);
    3906           0 :       SWIG_PYTHON_THREAD_END_ALLOW;
    3907             :     }
    3908             :   }
    3909           0 :   resultobj = SWIG_Py_Void();
    3910           0 :   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
    3911             :   return resultobj;
    3912             : fail:
    3913             :   return NULL;
    3914             : }
    3915             : 
    3916             : 
    3917         274 : SWIGINTERN PyObject *_wrap__UseExceptions(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
    3918         274 :   PyObject *resultobj = 0; int bLocalUseExceptionsCode = GetUseExceptions();
    3919             :   
    3920         274 :   if (!SWIG_Python_UnpackTuple(args, "_UseExceptions", 0, 0, 0)) SWIG_fail;
    3921         274 :   {
    3922         274 :     SWIG_PYTHON_THREAD_BEGIN_ALLOW;
    3923         274 :     _UseExceptions();
    3924         274 :     SWIG_PYTHON_THREAD_END_ALLOW;
    3925             :   }
    3926         274 :   resultobj = SWIG_Py_Void();
    3927         274 :   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
    3928             :   return resultobj;
    3929           0 : fail:
    3930           0 :   return NULL;
    3931             : }
    3932             : 
    3933             : 
    3934           5 : SWIGINTERN PyObject *_wrap__DontUseExceptions(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
    3935           5 :   PyObject *resultobj = 0; int bLocalUseExceptionsCode = GetUseExceptions();
    3936             :   
    3937           5 :   if (!SWIG_Python_UnpackTuple(args, "_DontUseExceptions", 0, 0, 0)) SWIG_fail;
    3938           5 :   {
    3939           5 :     SWIG_PYTHON_THREAD_BEGIN_ALLOW;
    3940           5 :     _DontUseExceptions();
    3941           5 :     SWIG_PYTHON_THREAD_END_ALLOW;
    3942             :   }
    3943           5 :   resultobj = SWIG_Py_Void();
    3944           5 :   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
    3945             :   return resultobj;
    3946           0 : fail:
    3947           0 :   return NULL;
    3948             : }
    3949             : 
    3950             : 
    3951           6 : SWIGINTERN PyObject *_wrap__UserHasSpecifiedIfUsingExceptions(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
    3952           6 :   PyObject *resultobj = 0; int bLocalUseExceptionsCode = GetUseExceptions();
    3953           6 :   int result;
    3954             :   
    3955           6 :   if (!SWIG_Python_UnpackTuple(args, "_UserHasSpecifiedIfUsingExceptions", 0, 0, 0)) SWIG_fail;
    3956           6 :   {
    3957             : #ifdef SED_HACKS
    3958           6 :     if( bUseExceptions ) bLocalUseExceptionsCode = FALSE;
    3959             : #endif
    3960           6 :     {
    3961           6 :       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
    3962           6 :       result = (int)_UserHasSpecifiedIfUsingExceptions();
    3963           6 :       SWIG_PYTHON_THREAD_END_ALLOW;
    3964             :     }
    3965             :   }
    3966           6 :   resultobj = SWIG_From_int(static_cast< int >(result));
    3967           6 :   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
    3968             :   return resultobj;
    3969           0 : fail:
    3970           0 :   return NULL;
    3971             : }
    3972             : 
    3973             : 
    3974           5 : SWIGINTERN PyObject *_wrap_CastToNetwork(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
    3975           5 :   PyObject *resultobj = 0; int bLocalUseExceptionsCode = GetUseExceptions();
    3976           5 :   GDALMajorObjectShadow *arg1 = (GDALMajorObjectShadow *) 0 ;
    3977           5 :   void *argp1 = 0 ;
    3978           5 :   int res1 = 0 ;
    3979           5 :   PyObject *swig_obj[1] ;
    3980           5 :   GNMNetworkShadow *result = 0 ;
    3981             :   
    3982           5 :   if (!args) SWIG_fail;
    3983           5 :   swig_obj[0] = args;
    3984           5 :   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_GDALMajorObjectShadow, 0 |  0 );
    3985           5 :   if (!SWIG_IsOK(res1)) {
    3986           0 :     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CastToNetwork" "', argument " "1"" of type '" "GDALMajorObjectShadow *""'"); 
    3987             :   }
    3988           5 :   arg1 = reinterpret_cast< GDALMajorObjectShadow * >(argp1);
    3989           5 :   {
    3990           5 :     const int bLocalUseExceptions = GetUseExceptions();
    3991           5 :     if ( bLocalUseExceptions ) {
    3992           5 :       pushErrorHandler();
    3993             :     }
    3994           5 :     {
    3995           5 :       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
    3996           5 :       result = (GNMNetworkShadow *)CastToNetwork(arg1);
    3997           5 :       SWIG_PYTHON_THREAD_END_ALLOW;
    3998             :     }
    3999           5 :     if ( bLocalUseExceptions ) {
    4000           5 :       popErrorHandler();
    4001             :     }
    4002             : #ifndef SED_HACKS
    4003             :     if ( bLocalUseExceptions ) {
    4004             :       CPLErr eclass = CPLGetLastErrorType();
    4005             :       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
    4006             :         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
    4007             :       }
    4008             :     }
    4009             : #endif
    4010             :   }
    4011           5 :   resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GNMNetworkShadow, 0 |  0 );
    4012           5 :   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
    4013             :   return resultobj;
    4014             : fail:
    4015             :   return NULL;
    4016             : }
    4017             : 
    4018             : 
    4019           1 : SWIGINTERN PyObject *_wrap_CastToGenericNetwork(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
    4020           1 :   PyObject *resultobj = 0; int bLocalUseExceptionsCode = GetUseExceptions();
    4021           1 :   GDALMajorObjectShadow *arg1 = (GDALMajorObjectShadow *) 0 ;
    4022           1 :   void *argp1 = 0 ;
    4023           1 :   int res1 = 0 ;
    4024           1 :   PyObject *swig_obj[1] ;
    4025           1 :   GNMGenericNetworkShadow *result = 0 ;
    4026             :   
    4027           1 :   if (!args) SWIG_fail;
    4028           1 :   swig_obj[0] = args;
    4029           1 :   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_GDALMajorObjectShadow, 0 |  0 );
    4030           1 :   if (!SWIG_IsOK(res1)) {
    4031           0 :     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CastToGenericNetwork" "', argument " "1"" of type '" "GDALMajorObjectShadow *""'"); 
    4032             :   }
    4033           1 :   arg1 = reinterpret_cast< GDALMajorObjectShadow * >(argp1);
    4034           1 :   {
    4035           1 :     const int bLocalUseExceptions = GetUseExceptions();
    4036           1 :     if ( bLocalUseExceptions ) {
    4037           1 :       pushErrorHandler();
    4038             :     }
    4039           1 :     {
    4040           1 :       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
    4041           1 :       result = (GNMGenericNetworkShadow *)CastToGenericNetwork(arg1);
    4042           1 :       SWIG_PYTHON_THREAD_END_ALLOW;
    4043             :     }
    4044           1 :     if ( bLocalUseExceptions ) {
    4045           1 :       popErrorHandler();
    4046             :     }
    4047             : #ifndef SED_HACKS
    4048             :     if ( bLocalUseExceptions ) {
    4049             :       CPLErr eclass = CPLGetLastErrorType();
    4050             :       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
    4051             :         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
    4052             :       }
    4053             :     }
    4054             : #endif
    4055             :   }
    4056           1 :   resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GNMGenericNetworkShadow, 0 |  0 );
    4057           1 :   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
    4058             :   return resultobj;
    4059             : fail:
    4060             :   return NULL;
    4061             : }
    4062             : 
    4063             : 
    4064           0 : SWIGINTERN PyObject *_wrap_delete_Network(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
    4065           0 :   PyObject *resultobj = 0; int bLocalUseExceptionsCode = GetUseExceptions();
    4066           0 :   GNMNetworkShadow *arg1 = (GNMNetworkShadow *) 0 ;
    4067           0 :   void *argp1 = 0 ;
    4068           0 :   int res1 = 0 ;
    4069           0 :   PyObject *swig_obj[1] ;
    4070             :   
    4071           0 :   if (!args) SWIG_fail;
    4072           0 :   swig_obj[0] = args;
    4073           0 :   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_GNMNetworkShadow, SWIG_POINTER_DISOWN |  0 );
    4074           0 :   if (!SWIG_IsOK(res1)) {
    4075           0 :     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_Network" "', argument " "1"" of type '" "GNMNetworkShadow *""'"); 
    4076             :   }
    4077           0 :   arg1 = reinterpret_cast< GNMNetworkShadow * >(argp1);
    4078           0 :   {
    4079           0 :     const int bLocalUseExceptions = GetUseExceptions();
    4080           0 :     if ( bLocalUseExceptions ) {
    4081           0 :       pushErrorHandler();
    4082             :     }
    4083           0 :     {
    4084           0 :       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
    4085           0 :       delete_GNMNetworkShadow(arg1);
    4086           0 :       SWIG_PYTHON_THREAD_END_ALLOW;
    4087             :     }
    4088           0 :     if ( bLocalUseExceptions ) {
    4089           0 :       popErrorHandler();
    4090             :     }
    4091             : #ifndef SED_HACKS
    4092             :     if ( bLocalUseExceptions ) {
    4093             :       CPLErr eclass = CPLGetLastErrorType();
    4094             :       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
    4095             :         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
    4096             :       }
    4097             :     }
    4098             : #endif
    4099             :   }
    4100           0 :   resultobj = SWIG_Py_Void();
    4101           0 :   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
    4102             :   return resultobj;
    4103             : fail:
    4104             :   return NULL;
    4105             : }
    4106             : 
    4107             : 
    4108           3 : SWIGINTERN PyObject *_wrap_Network_ReleaseResultSet(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
    4109           3 :   PyObject *resultobj = 0; int bLocalUseExceptionsCode = GetUseExceptions();
    4110           3 :   GNMNetworkShadow *arg1 = (GNMNetworkShadow *) 0 ;
    4111           3 :   OGRLayerShadow *arg2 = (OGRLayerShadow *) 0 ;
    4112           3 :   void *argp1 = 0 ;
    4113           3 :   int res1 = 0 ;
    4114           3 :   int res2 = 0 ;
    4115           3 :   PyObject *swig_obj[2] ;
    4116             :   
    4117           3 :   if (!SWIG_Python_UnpackTuple(args, "Network_ReleaseResultSet", 2, 2, swig_obj)) SWIG_fail;
    4118           3 :   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_GNMNetworkShadow, 0 |  0 );
    4119           3 :   if (!SWIG_IsOK(res1)) {
    4120           0 :     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Network_ReleaseResultSet" "', argument " "1"" of type '" "GNMNetworkShadow *""'"); 
    4121             :   }
    4122           3 :   arg1 = reinterpret_cast< GNMNetworkShadow * >(argp1);
    4123           3 :   res2 = SWIG_ConvertPtr(swig_obj[1], SWIG_as_voidptrptr(&arg2), SWIGTYPE_p_OGRLayerShadow, SWIG_POINTER_DISOWN |  0 );
    4124           3 :   if (!SWIG_IsOK(res2)) {
    4125           0 :     SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Network_ReleaseResultSet" "', argument " "2"" of type '" "OGRLayerShadow *""'");
    4126             :   }
    4127           3 :   {
    4128           3 :     const int bLocalUseExceptions = GetUseExceptions();
    4129           3 :     if ( bLocalUseExceptions ) {
    4130           3 :       pushErrorHandler();
    4131             :     }
    4132           3 :     {
    4133           3 :       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
    4134           3 :       GNMNetworkShadow_ReleaseResultSet(arg1,arg2);
    4135           3 :       SWIG_PYTHON_THREAD_END_ALLOW;
    4136             :     }
    4137           3 :     if ( bLocalUseExceptions ) {
    4138           3 :       popErrorHandler();
    4139             :     }
    4140             : #ifndef SED_HACKS
    4141             :     if ( bLocalUseExceptions ) {
    4142             :       CPLErr eclass = CPLGetLastErrorType();
    4143             :       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
    4144             :         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
    4145             :       }
    4146             :     }
    4147             : #endif
    4148             :   }
    4149           3 :   resultobj = SWIG_Py_Void();
    4150           3 :   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
    4151             :   return resultobj;
    4152             : fail:
    4153             :   return NULL;
    4154             : }
    4155             : 
    4156             : 
    4157           2 : SWIGINTERN PyObject *_wrap_Network_GetVersion(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
    4158           2 :   PyObject *resultobj = 0; int bLocalUseExceptionsCode = GetUseExceptions();
    4159           2 :   GNMNetworkShadow *arg1 = (GNMNetworkShadow *) 0 ;
    4160           2 :   void *argp1 = 0 ;
    4161           2 :   int res1 = 0 ;
    4162           2 :   PyObject *swig_obj[1] ;
    4163           2 :   int result;
    4164             :   
    4165           2 :   if (!args) SWIG_fail;
    4166           2 :   swig_obj[0] = args;
    4167           2 :   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_GNMNetworkShadow, 0 |  0 );
    4168           2 :   if (!SWIG_IsOK(res1)) {
    4169           0 :     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Network_GetVersion" "', argument " "1"" of type '" "GNMNetworkShadow *""'"); 
    4170             :   }
    4171           2 :   arg1 = reinterpret_cast< GNMNetworkShadow * >(argp1);
    4172           2 :   {
    4173           2 :     const int bLocalUseExceptions = GetUseExceptions();
    4174           2 :     if ( bLocalUseExceptions ) {
    4175           2 :       pushErrorHandler();
    4176             :     }
    4177           2 :     {
    4178           2 :       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
    4179           2 :       result = (int)GNMNetworkShadow_GetVersion(arg1);
    4180           2 :       SWIG_PYTHON_THREAD_END_ALLOW;
    4181             :     }
    4182           2 :     if ( bLocalUseExceptions ) {
    4183           2 :       popErrorHandler();
    4184             :     }
    4185             : #ifndef SED_HACKS
    4186             :     if ( bLocalUseExceptions ) {
    4187             :       CPLErr eclass = CPLGetLastErrorType();
    4188             :       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
    4189             :         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
    4190             :       }
    4191             :     }
    4192             : #endif
    4193             :   }
    4194           2 :   resultobj = SWIG_From_int(static_cast< int >(result));
    4195           2 :   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
    4196             :   return resultobj;
    4197             : fail:
    4198             :   return NULL;
    4199             : }
    4200             : 
    4201             : 
    4202           2 : SWIGINTERN PyObject *_wrap_Network_GetName(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
    4203           2 :   PyObject *resultobj = 0; int bLocalUseExceptionsCode = GetUseExceptions();
    4204           2 :   GNMNetworkShadow *arg1 = (GNMNetworkShadow *) 0 ;
    4205           2 :   void *argp1 = 0 ;
    4206           2 :   int res1 = 0 ;
    4207           2 :   PyObject *swig_obj[1] ;
    4208           2 :   char *result = 0 ;
    4209             :   
    4210           2 :   if (!args) SWIG_fail;
    4211           2 :   swig_obj[0] = args;
    4212           2 :   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_GNMNetworkShadow, 0 |  0 );
    4213           2 :   if (!SWIG_IsOK(res1)) {
    4214           0 :     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Network_GetName" "', argument " "1"" of type '" "GNMNetworkShadow *""'"); 
    4215             :   }
    4216           2 :   arg1 = reinterpret_cast< GNMNetworkShadow * >(argp1);
    4217           2 :   {
    4218           2 :     const int bLocalUseExceptions = GetUseExceptions();
    4219           2 :     if ( bLocalUseExceptions ) {
    4220           2 :       pushErrorHandler();
    4221             :     }
    4222           2 :     {
    4223           2 :       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
    4224           2 :       result = (char *)GNMNetworkShadow_GetName(arg1);
    4225           2 :       SWIG_PYTHON_THREAD_END_ALLOW;
    4226             :     }
    4227           2 :     if ( bLocalUseExceptions ) {
    4228           2 :       popErrorHandler();
    4229             :     }
    4230             : #ifndef SED_HACKS
    4231             :     if ( bLocalUseExceptions ) {
    4232             :       CPLErr eclass = CPLGetLastErrorType();
    4233             :       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
    4234             :         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
    4235             :       }
    4236             :     }
    4237             : #endif
    4238             :   }
    4239           2 :   resultobj = SWIG_FromCharPtr((const char *)result);
    4240           2 :   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
    4241             :   return resultobj;
    4242             : fail:
    4243             :   return NULL;
    4244             : }
    4245             : 
    4246             : 
    4247           0 : SWIGINTERN PyObject *_wrap_Network_GetFeatureByGlobalFID(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
    4248           0 :   PyObject *resultobj = 0; int bLocalUseExceptionsCode = GetUseExceptions();
    4249           0 :   GNMNetworkShadow *arg1 = (GNMNetworkShadow *) 0 ;
    4250           0 :   GIntBig arg2 ;
    4251           0 :   void *argp1 = 0 ;
    4252           0 :   int res1 = 0 ;
    4253           0 :   PyObject *swig_obj[2] ;
    4254           0 :   OGRFeatureShadow *result = 0 ;
    4255             :   
    4256           0 :   if (!SWIG_Python_UnpackTuple(args, "Network_GetFeatureByGlobalFID", 2, 2, swig_obj)) SWIG_fail;
    4257           0 :   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_GNMNetworkShadow, 0 |  0 );
    4258           0 :   if (!SWIG_IsOK(res1)) {
    4259           0 :     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Network_GetFeatureByGlobalFID" "', argument " "1"" of type '" "GNMNetworkShadow *""'"); 
    4260             :   }
    4261           0 :   arg1 = reinterpret_cast< GNMNetworkShadow * >(argp1);
    4262           0 :   {
    4263           0 :     arg2 = (GIntBig)PyLong_AsLongLong(swig_obj[1]);
    4264             :   }
    4265           0 :   {
    4266           0 :     const int bLocalUseExceptions = GetUseExceptions();
    4267           0 :     if ( bLocalUseExceptions ) {
    4268           0 :       pushErrorHandler();
    4269             :     }
    4270           0 :     {
    4271           0 :       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
    4272           0 :       result = (OGRFeatureShadow *)GNMNetworkShadow_GetFeatureByGlobalFID(arg1,arg2);
    4273           0 :       SWIG_PYTHON_THREAD_END_ALLOW;
    4274             :     }
    4275           0 :     if ( bLocalUseExceptions ) {
    4276           0 :       popErrorHandler();
    4277             :     }
    4278             : #ifndef SED_HACKS
    4279             :     if ( bLocalUseExceptions ) {
    4280             :       CPLErr eclass = CPLGetLastErrorType();
    4281             :       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
    4282             :         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
    4283             :       }
    4284             :     }
    4285             : #endif
    4286             :   }
    4287           0 :   resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_OGRFeatureShadow, SWIG_POINTER_OWN |  0 );
    4288           0 :   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
    4289             :   return resultobj;
    4290             : fail:
    4291             :   return NULL;
    4292             : }
    4293             : 
    4294             : 
    4295           3 : SWIGINTERN PyObject *_wrap_Network_GetPath(PyObject *SWIGUNUSEDPARM(self), PyObject *args, PyObject *kwargs) {
    4296           3 :   PyObject *resultobj = 0; int bLocalUseExceptionsCode = GetUseExceptions();
    4297           3 :   GNMNetworkShadow *arg1 = (GNMNetworkShadow *) 0 ;
    4298           3 :   GIntBig arg2 ;
    4299           3 :   GIntBig arg3 ;
    4300           3 :   GNMGraphAlgorithmType arg4 ;
    4301           3 :   char **arg5 = (char **) 0 ;
    4302           3 :   void *argp1 = 0 ;
    4303           3 :   int res1 = 0 ;
    4304           3 :   int val4 ;
    4305           3 :   int ecode4 = 0 ;
    4306           3 :   PyObject * obj0 = 0 ;
    4307           3 :   PyObject * obj1 = 0 ;
    4308           3 :   PyObject * obj2 = 0 ;
    4309           3 :   PyObject * obj3 = 0 ;
    4310           3 :   PyObject * obj4 = 0 ;
    4311           3 :   char * kwnames[] = {
    4312             :     (char *)"self",  (char *)"nStartFID",  (char *)"nEndFID",  (char *)"eAlgorithm",  (char *)"options",  NULL 
    4313             :   };
    4314           3 :   OGRLayerShadow *result = 0 ;
    4315             :   
    4316           3 :   if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOOO|O:Network_GetPath", kwnames, &obj0, &obj1, &obj2, &obj3, &obj4)) SWIG_fail;
    4317           3 :   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GNMNetworkShadow, 0 |  0 );
    4318           3 :   if (!SWIG_IsOK(res1)) {
    4319           0 :     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Network_GetPath" "', argument " "1"" of type '" "GNMNetworkShadow *""'"); 
    4320             :   }
    4321           3 :   arg1 = reinterpret_cast< GNMNetworkShadow * >(argp1);
    4322           3 :   {
    4323           3 :     arg2 = (GIntBig)PyLong_AsLongLong(obj1);
    4324             :   }
    4325           3 :   {
    4326           3 :     arg3 = (GIntBig)PyLong_AsLongLong(obj2);
    4327             :   }
    4328           3 :   ecode4 = SWIG_AsVal_int(obj3, &val4);
    4329           3 :   if (!SWIG_IsOK(ecode4)) {
    4330           0 :     SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "Network_GetPath" "', argument " "4"" of type '" "GNMGraphAlgorithmType""'");
    4331             :   } 
    4332           3 :   arg4 = static_cast< GNMGraphAlgorithmType >(val4);
    4333           3 :   if (obj4) {
    4334           1 :     {
    4335             :       /* %typemap(in) char **dict */
    4336           1 :       arg5 = NULL;
    4337           1 :       if ( PySequence_Check( obj4 ) ) {
    4338           1 :         int bErr = FALSE;
    4339           1 :         arg5 = CSLFromPySequence(obj4, &bErr);
    4340           1 :         if ( bErr )
    4341             :         {
    4342           0 :           SWIG_fail;
    4343             :         }
    4344             :       }
    4345           0 :       else if ( PyMapping_Check( obj4 ) ) {
    4346           0 :         int bErr = FALSE;
    4347           0 :         arg5 = CSLFromPyMapping(obj4, &bErr);
    4348           0 :         if ( bErr )
    4349             :         {
    4350           0 :           SWIG_fail;
    4351             :         }
    4352             :       }
    4353             :       else {
    4354           0 :         PyErr_SetString(PyExc_TypeError,"Argument must be dictionary or sequence of strings");
    4355           0 :         SWIG_fail;
    4356             :       }
    4357             :     }
    4358             :   }
    4359           3 :   {
    4360           3 :     const int bLocalUseExceptions = GetUseExceptions();
    4361           3 :     if ( bLocalUseExceptions ) {
    4362           3 :       pushErrorHandler();
    4363             :     }
    4364           3 :     {
    4365           3 :       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
    4366           3 :       result = (OGRLayerShadow *)GNMNetworkShadow_GetPath(arg1,arg2,arg3,arg4,arg5);
    4367           3 :       SWIG_PYTHON_THREAD_END_ALLOW;
    4368             :     }
    4369           3 :     if ( bLocalUseExceptions ) {
    4370           3 :       popErrorHandler();
    4371             :     }
    4372             : #ifndef SED_HACKS
    4373             :     if ( bLocalUseExceptions ) {
    4374             :       CPLErr eclass = CPLGetLastErrorType();
    4375             :       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
    4376             :         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
    4377             :       }
    4378             :     }
    4379             : #endif
    4380             :   }
    4381           3 :   resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_OGRLayerShadow, SWIG_POINTER_OWN |  0 );
    4382           3 :   {
    4383             :     /* %typemap(freearg) char **dict */
    4384           3 :     CSLDestroy( arg5 );
    4385             :   }
    4386           3 :   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
    4387             :   return resultobj;
    4388           0 : fail:
    4389           0 :   {
    4390             :     /* %typemap(freearg) char **dict */
    4391           0 :     CSLDestroy( arg5 );
    4392             :   }
    4393             :   return NULL;
    4394             : }
    4395             : 
    4396             : 
    4397           0 : SWIGINTERN PyObject *_wrap_Network_DisconnectAll(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
    4398           0 :   PyObject *resultobj = 0; int bLocalUseExceptionsCode = GetUseExceptions();
    4399           0 :   GNMNetworkShadow *arg1 = (GNMNetworkShadow *) 0 ;
    4400           0 :   void *argp1 = 0 ;
    4401           0 :   int res1 = 0 ;
    4402           0 :   PyObject *swig_obj[1] ;
    4403           0 :   CPLErr result;
    4404             :   
    4405           0 :   if (!args) SWIG_fail;
    4406           0 :   swig_obj[0] = args;
    4407           0 :   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_GNMNetworkShadow, 0 |  0 );
    4408           0 :   if (!SWIG_IsOK(res1)) {
    4409           0 :     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Network_DisconnectAll" "', argument " "1"" of type '" "GNMNetworkShadow *""'"); 
    4410             :   }
    4411           0 :   arg1 = reinterpret_cast< GNMNetworkShadow * >(argp1);
    4412           0 :   {
    4413           0 :     const int bLocalUseExceptions = GetUseExceptions();
    4414           0 :     if ( bLocalUseExceptions ) {
    4415           0 :       pushErrorHandler();
    4416             :     }
    4417           0 :     {
    4418           0 :       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
    4419           0 :       result = (CPLErr)GNMNetworkShadow_DisconnectAll(arg1);
    4420           0 :       SWIG_PYTHON_THREAD_END_ALLOW;
    4421             :     }
    4422           0 :     if ( bLocalUseExceptions ) {
    4423           0 :       popErrorHandler();
    4424             :     }
    4425             : #ifndef SED_HACKS
    4426             :     if ( bLocalUseExceptions ) {
    4427             :       CPLErr eclass = CPLGetLastErrorType();
    4428             :       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
    4429             :         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
    4430             :       }
    4431             :     }
    4432             : #endif
    4433             :   }
    4434           0 :   resultobj = SWIG_From_int(static_cast< int >(result));
    4435           0 :   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
    4436             :   return resultobj;
    4437             : fail:
    4438             :   return NULL;
    4439             : }
    4440             : 
    4441             : 
    4442           0 : SWIGINTERN PyObject *_wrap_Network_GetProjection(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
    4443           0 :   PyObject *resultobj = 0; int bLocalUseExceptionsCode = GetUseExceptions();
    4444           0 :   GNMNetworkShadow *arg1 = (GNMNetworkShadow *) 0 ;
    4445           0 :   void *argp1 = 0 ;
    4446           0 :   int res1 = 0 ;
    4447           0 :   PyObject *swig_obj[1] ;
    4448           0 :   char *result = 0 ;
    4449             :   
    4450           0 :   if (!args) SWIG_fail;
    4451           0 :   swig_obj[0] = args;
    4452           0 :   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_GNMNetworkShadow, 0 |  0 );
    4453           0 :   if (!SWIG_IsOK(res1)) {
    4454           0 :     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Network_GetProjection" "', argument " "1"" of type '" "GNMNetworkShadow *""'"); 
    4455             :   }
    4456           0 :   arg1 = reinterpret_cast< GNMNetworkShadow * >(argp1);
    4457           0 :   {
    4458           0 :     const int bLocalUseExceptions = GetUseExceptions();
    4459           0 :     if ( bLocalUseExceptions ) {
    4460           0 :       pushErrorHandler();
    4461             :     }
    4462           0 :     {
    4463           0 :       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
    4464           0 :       result = (char *)GNMNetworkShadow_GetProjection(arg1);
    4465           0 :       SWIG_PYTHON_THREAD_END_ALLOW;
    4466             :     }
    4467           0 :     if ( bLocalUseExceptions ) {
    4468           0 :       popErrorHandler();
    4469             :     }
    4470             : #ifndef SED_HACKS
    4471             :     if ( bLocalUseExceptions ) {
    4472             :       CPLErr eclass = CPLGetLastErrorType();
    4473             :       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
    4474             :         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
    4475             :       }
    4476             :     }
    4477             : #endif
    4478             :   }
    4479           0 :   resultobj = SWIG_FromCharPtr((const char *)result);
    4480           0 :   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
    4481             :   return resultobj;
    4482             : fail:
    4483             :   return NULL;
    4484             : }
    4485             : 
    4486             : 
    4487           0 : SWIGINTERN PyObject *_wrap_Network_GetProjectionRef(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
    4488           0 :   PyObject *resultobj = 0; int bLocalUseExceptionsCode = GetUseExceptions();
    4489           0 :   GNMNetworkShadow *arg1 = (GNMNetworkShadow *) 0 ;
    4490           0 :   void *argp1 = 0 ;
    4491           0 :   int res1 = 0 ;
    4492           0 :   PyObject *swig_obj[1] ;
    4493           0 :   char *result = 0 ;
    4494             :   
    4495           0 :   if (!args) SWIG_fail;
    4496           0 :   swig_obj[0] = args;
    4497           0 :   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_GNMNetworkShadow, 0 |  0 );
    4498           0 :   if (!SWIG_IsOK(res1)) {
    4499           0 :     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Network_GetProjectionRef" "', argument " "1"" of type '" "GNMNetworkShadow *""'"); 
    4500             :   }
    4501           0 :   arg1 = reinterpret_cast< GNMNetworkShadow * >(argp1);
    4502           0 :   {
    4503           0 :     const int bLocalUseExceptions = GetUseExceptions();
    4504           0 :     if ( bLocalUseExceptions ) {
    4505           0 :       pushErrorHandler();
    4506             :     }
    4507           0 :     {
    4508           0 :       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
    4509           0 :       result = (char *)GNMNetworkShadow_GetProjectionRef(arg1);
    4510           0 :       SWIG_PYTHON_THREAD_END_ALLOW;
    4511             :     }
    4512           0 :     if ( bLocalUseExceptions ) {
    4513           0 :       popErrorHandler();
    4514             :     }
    4515             : #ifndef SED_HACKS
    4516             :     if ( bLocalUseExceptions ) {
    4517             :       CPLErr eclass = CPLGetLastErrorType();
    4518             :       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
    4519             :         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
    4520             :       }
    4521             :     }
    4522             : #endif
    4523             :   }
    4524           0 :   resultobj = SWIG_FromCharPtr((const char *)result);
    4525           0 :   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
    4526             :   return resultobj;
    4527             : fail:
    4528             :   return NULL;
    4529             : }
    4530             : 
    4531             : 
    4532           0 : SWIGINTERN PyObject *_wrap_Network_GetFileList(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
    4533           0 :   PyObject *resultobj = 0; int bLocalUseExceptionsCode = GetUseExceptions();
    4534           0 :   GNMNetworkShadow *arg1 = (GNMNetworkShadow *) 0 ;
    4535           0 :   void *argp1 = 0 ;
    4536           0 :   int res1 = 0 ;
    4537           0 :   PyObject *swig_obj[1] ;
    4538           0 :   char **result = 0 ;
    4539             :   
    4540           0 :   if (!args) SWIG_fail;
    4541           0 :   swig_obj[0] = args;
    4542           0 :   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_GNMNetworkShadow, 0 |  0 );
    4543           0 :   if (!SWIG_IsOK(res1)) {
    4544           0 :     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Network_GetFileList" "', argument " "1"" of type '" "GNMNetworkShadow *""'"); 
    4545             :   }
    4546           0 :   arg1 = reinterpret_cast< GNMNetworkShadow * >(argp1);
    4547           0 :   {
    4548           0 :     const int bLocalUseExceptions = GetUseExceptions();
    4549           0 :     if ( bLocalUseExceptions ) {
    4550           0 :       pushErrorHandler();
    4551             :     }
    4552           0 :     {
    4553           0 :       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
    4554           0 :       result = (char **)GNMNetworkShadow_GetFileList(arg1);
    4555           0 :       SWIG_PYTHON_THREAD_END_ALLOW;
    4556             :     }
    4557           0 :     if ( bLocalUseExceptions ) {
    4558           0 :       popErrorHandler();
    4559             :     }
    4560             : #ifndef SED_HACKS
    4561             :     if ( bLocalUseExceptions ) {
    4562             :       CPLErr eclass = CPLGetLastErrorType();
    4563             :       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
    4564             :         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
    4565             :       }
    4566             :     }
    4567             : #endif
    4568             :   }
    4569           0 :   {
    4570             :     /* %typemap(out) char **CSL -> ( string ) */
    4571           0 :     bool bErr = false;
    4572           0 :     resultobj = CSLToList(result, &bErr);
    4573           0 :     CSLDestroy(result);
    4574           0 :     if( bErr ) {
    4575           0 :       SWIG_fail;
    4576             :     }
    4577             :   }
    4578           0 :   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
    4579             :   return resultobj;
    4580             : fail:
    4581             :   return NULL;
    4582             : }
    4583             : 
    4584             : 
    4585           0 : SWIGINTERN PyObject *_wrap_Network_CreateLayer(PyObject *SWIGUNUSEDPARM(self), PyObject *args, PyObject *kwargs) {
    4586           0 :   PyObject *resultobj = 0; int bLocalUseExceptionsCode = GetUseExceptions();
    4587           0 :   GNMNetworkShadow *arg1 = (GNMNetworkShadow *) 0 ;
    4588           0 :   char *arg2 = (char *) 0 ;
    4589           0 :   OSRSpatialReferenceShadow *arg3 = (OSRSpatialReferenceShadow *) NULL ;
    4590           0 :   OGRwkbGeometryType arg4 = (OGRwkbGeometryType) wkbUnknown ;
    4591           0 :   char **arg5 = (char **) 0 ;
    4592           0 :   void *argp1 = 0 ;
    4593           0 :   int res1 = 0 ;
    4594           0 :   int res2 ;
    4595           0 :   char *buf2 = 0 ;
    4596           0 :   int alloc2 = 0 ;
    4597           0 :   void *argp3 = 0 ;
    4598           0 :   int res3 = 0 ;
    4599           0 :   int val4 ;
    4600           0 :   int ecode4 = 0 ;
    4601           0 :   PyObject * obj0 = 0 ;
    4602           0 :   PyObject * obj1 = 0 ;
    4603           0 :   PyObject * obj2 = 0 ;
    4604           0 :   PyObject * obj3 = 0 ;
    4605           0 :   PyObject * obj4 = 0 ;
    4606           0 :   char * kwnames[] = {
    4607             :     (char *)"self",  (char *)"name",  (char *)"srs",  (char *)"geom_type",  (char *)"options",  NULL 
    4608             :   };
    4609           0 :   OGRLayerShadow *result = 0 ;
    4610             :   
    4611           0 :   if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OO|OOO:Network_CreateLayer", kwnames, &obj0, &obj1, &obj2, &obj3, &obj4)) SWIG_fail;
    4612           0 :   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GNMNetworkShadow, 0 |  0 );
    4613           0 :   if (!SWIG_IsOK(res1)) {
    4614           0 :     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Network_CreateLayer" "', argument " "1"" of type '" "GNMNetworkShadow *""'"); 
    4615             :   }
    4616           0 :   arg1 = reinterpret_cast< GNMNetworkShadow * >(argp1);
    4617           0 :   res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2);
    4618           0 :   if (!SWIG_IsOK(res2)) {
    4619           0 :     SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Network_CreateLayer" "', argument " "2"" of type '" "char const *""'");
    4620             :   }
    4621           0 :   arg2 = reinterpret_cast< char * >(buf2);
    4622           0 :   if (obj2) {
    4623           0 :     res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_OSRSpatialReferenceShadow, 0 |  0 );
    4624           0 :     if (!SWIG_IsOK(res3)) {
    4625           0 :       SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "Network_CreateLayer" "', argument " "3"" of type '" "OSRSpatialReferenceShadow *""'"); 
    4626             :     }
    4627           0 :     arg3 = reinterpret_cast< OSRSpatialReferenceShadow * >(argp3);
    4628             :   }
    4629           0 :   if (obj3) {
    4630           0 :     ecode4 = SWIG_AsVal_int(obj3, &val4);
    4631           0 :     if (!SWIG_IsOK(ecode4)) {
    4632           0 :       SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "Network_CreateLayer" "', argument " "4"" of type '" "OGRwkbGeometryType""'");
    4633             :     } 
    4634           0 :     arg4 = static_cast< OGRwkbGeometryType >(val4);
    4635             :   }
    4636           0 :   if (obj4) {
    4637           0 :     {
    4638             :       /* %typemap(in) char **dict */
    4639           0 :       arg5 = NULL;
    4640           0 :       if ( PySequence_Check( obj4 ) ) {
    4641           0 :         int bErr = FALSE;
    4642           0 :         arg5 = CSLFromPySequence(obj4, &bErr);
    4643           0 :         if ( bErr )
    4644             :         {
    4645           0 :           SWIG_fail;
    4646             :         }
    4647             :       }
    4648           0 :       else if ( PyMapping_Check( obj4 ) ) {
    4649           0 :         int bErr = FALSE;
    4650           0 :         arg5 = CSLFromPyMapping(obj4, &bErr);
    4651           0 :         if ( bErr )
    4652             :         {
    4653           0 :           SWIG_fail;
    4654             :         }
    4655             :       }
    4656             :       else {
    4657           0 :         PyErr_SetString(PyExc_TypeError,"Argument must be dictionary or sequence of strings");
    4658           0 :         SWIG_fail;
    4659             :       }
    4660             :     }
    4661             :   }
    4662           0 :   {
    4663           0 :     const int bLocalUseExceptions = GetUseExceptions();
    4664           0 :     if ( bLocalUseExceptions ) {
    4665           0 :       pushErrorHandler();
    4666             :     }
    4667           0 :     {
    4668           0 :       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
    4669           0 :       result = (OGRLayerShadow *)GNMNetworkShadow_CreateLayer(arg1,(char const *)arg2,arg3,arg4,arg5);
    4670           0 :       SWIG_PYTHON_THREAD_END_ALLOW;
    4671             :     }
    4672           0 :     if ( bLocalUseExceptions ) {
    4673           0 :       popErrorHandler();
    4674             :     }
    4675             : #ifndef SED_HACKS
    4676             :     if ( bLocalUseExceptions ) {
    4677             :       CPLErr eclass = CPLGetLastErrorType();
    4678             :       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
    4679             :         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
    4680             :       }
    4681             :     }
    4682             : #endif
    4683             :   }
    4684           0 :   resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_OGRLayerShadow, 0 |  0 );
    4685           0 :   if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
    4686           0 :   {
    4687             :     /* %typemap(freearg) char **dict */
    4688           0 :     CSLDestroy( arg5 );
    4689             :   }
    4690           0 :   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
    4691             :   return resultobj;
    4692           0 : fail:
    4693           0 :   if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
    4694           0 :   {
    4695             :     /* %typemap(freearg) char **dict */
    4696           0 :     CSLDestroy( arg5 );
    4697             :   }
    4698             :   return NULL;
    4699             : }
    4700             : 
    4701             : 
    4702           0 : SWIGINTERN PyObject *_wrap_Network_CopyLayer(PyObject *SWIGUNUSEDPARM(self), PyObject *args, PyObject *kwargs) {
    4703           0 :   PyObject *resultobj = 0; int bLocalUseExceptionsCode = GetUseExceptions();
    4704           0 :   GNMNetworkShadow *arg1 = (GNMNetworkShadow *) 0 ;
    4705           0 :   OGRLayerShadow *arg2 = (OGRLayerShadow *) 0 ;
    4706           0 :   char *arg3 = (char *) 0 ;
    4707           0 :   char **arg4 = (char **) 0 ;
    4708           0 :   void *argp1 = 0 ;
    4709           0 :   int res1 = 0 ;
    4710           0 :   void *argp2 = 0 ;
    4711           0 :   int res2 = 0 ;
    4712           0 :   int res3 ;
    4713           0 :   char *buf3 = 0 ;
    4714           0 :   int alloc3 = 0 ;
    4715           0 :   PyObject * obj0 = 0 ;
    4716           0 :   PyObject * obj1 = 0 ;
    4717           0 :   PyObject * obj2 = 0 ;
    4718           0 :   PyObject * obj3 = 0 ;
    4719           0 :   char * kwnames[] = {
    4720             :     (char *)"self",  (char *)"src_layer",  (char *)"new_name",  (char *)"options",  NULL 
    4721             :   };
    4722           0 :   OGRLayerShadow *result = 0 ;
    4723             :   
    4724           0 :   if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOO|O:Network_CopyLayer", kwnames, &obj0, &obj1, &obj2, &obj3)) SWIG_fail;
    4725           0 :   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GNMNetworkShadow, 0 |  0 );
    4726           0 :   if (!SWIG_IsOK(res1)) {
    4727           0 :     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Network_CopyLayer" "', argument " "1"" of type '" "GNMNetworkShadow *""'"); 
    4728             :   }
    4729           0 :   arg1 = reinterpret_cast< GNMNetworkShadow * >(argp1);
    4730           0 :   res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_OGRLayerShadow, 0 |  0 );
    4731           0 :   if (!SWIG_IsOK(res2)) {
    4732           0 :     SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Network_CopyLayer" "', argument " "2"" of type '" "OGRLayerShadow *""'"); 
    4733             :   }
    4734           0 :   arg2 = reinterpret_cast< OGRLayerShadow * >(argp2);
    4735           0 :   res3 = SWIG_AsCharPtrAndSize(obj2, &buf3, NULL, &alloc3);
    4736           0 :   if (!SWIG_IsOK(res3)) {
    4737           0 :     SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "Network_CopyLayer" "', argument " "3"" of type '" "char const *""'");
    4738             :   }
    4739           0 :   arg3 = reinterpret_cast< char * >(buf3);
    4740           0 :   if (obj3) {
    4741           0 :     {
    4742             :       /* %typemap(in) char **dict */
    4743           0 :       arg4 = NULL;
    4744           0 :       if ( PySequence_Check( obj3 ) ) {
    4745           0 :         int bErr = FALSE;
    4746           0 :         arg4 = CSLFromPySequence(obj3, &bErr);
    4747           0 :         if ( bErr )
    4748             :         {
    4749           0 :           SWIG_fail;
    4750             :         }
    4751             :       }
    4752           0 :       else if ( PyMapping_Check( obj3 ) ) {
    4753           0 :         int bErr = FALSE;
    4754           0 :         arg4 = CSLFromPyMapping(obj3, &bErr);
    4755           0 :         if ( bErr )
    4756             :         {
    4757           0 :           SWIG_fail;
    4758             :         }
    4759             :       }
    4760             :       else {
    4761           0 :         PyErr_SetString(PyExc_TypeError,"Argument must be dictionary or sequence of strings");
    4762           0 :         SWIG_fail;
    4763             :       }
    4764             :     }
    4765             :   }
    4766           0 :   {
    4767           0 :     if (!arg2) {
    4768           0 :       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
    4769             :     }
    4770             :   }
    4771           0 :   {
    4772           0 :     const int bLocalUseExceptions = GetUseExceptions();
    4773           0 :     if ( bLocalUseExceptions ) {
    4774           0 :       pushErrorHandler();
    4775             :     }
    4776           0 :     {
    4777           0 :       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
    4778           0 :       result = (OGRLayerShadow *)GNMNetworkShadow_CopyLayer(arg1,arg2,(char const *)arg3,arg4);
    4779           0 :       SWIG_PYTHON_THREAD_END_ALLOW;
    4780             :     }
    4781           0 :     if ( bLocalUseExceptions ) {
    4782           0 :       popErrorHandler();
    4783             :     }
    4784             : #ifndef SED_HACKS
    4785             :     if ( bLocalUseExceptions ) {
    4786             :       CPLErr eclass = CPLGetLastErrorType();
    4787             :       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
    4788             :         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
    4789             :       }
    4790             :     }
    4791             : #endif
    4792             :   }
    4793           0 :   resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_OGRLayerShadow, 0 |  0 );
    4794           0 :   if (alloc3 == SWIG_NEWOBJ) delete[] buf3;
    4795           0 :   {
    4796             :     /* %typemap(freearg) char **dict */
    4797           0 :     CSLDestroy( arg4 );
    4798             :   }
    4799           0 :   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
    4800             :   return resultobj;
    4801           0 : fail:
    4802           0 :   if (alloc3 == SWIG_NEWOBJ) delete[] buf3;
    4803           0 :   {
    4804             :     /* %typemap(freearg) char **dict */
    4805           0 :     CSLDestroy( arg4 );
    4806             :   }
    4807             :   return NULL;
    4808             : }
    4809             : 
    4810             : 
    4811           0 : SWIGINTERN PyObject *_wrap_Network_DeleteLayer(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
    4812           0 :   PyObject *resultobj = 0; int bLocalUseExceptionsCode = GetUseExceptions();
    4813           0 :   GNMNetworkShadow *arg1 = (GNMNetworkShadow *) 0 ;
    4814           0 :   int arg2 ;
    4815           0 :   void *argp1 = 0 ;
    4816           0 :   int res1 = 0 ;
    4817           0 :   int val2 ;
    4818           0 :   int ecode2 = 0 ;
    4819           0 :   PyObject *swig_obj[2] ;
    4820           0 :   OGRErr result;
    4821             :   
    4822           0 :   if (!SWIG_Python_UnpackTuple(args, "Network_DeleteLayer", 2, 2, swig_obj)) SWIG_fail;
    4823           0 :   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_GNMNetworkShadow, 0 |  0 );
    4824           0 :   if (!SWIG_IsOK(res1)) {
    4825           0 :     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Network_DeleteLayer" "', argument " "1"" of type '" "GNMNetworkShadow *""'"); 
    4826             :   }
    4827           0 :   arg1 = reinterpret_cast< GNMNetworkShadow * >(argp1);
    4828           0 :   ecode2 = SWIG_AsVal_int(swig_obj[1], &val2);
    4829           0 :   if (!SWIG_IsOK(ecode2)) {
    4830           0 :     SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Network_DeleteLayer" "', argument " "2"" of type '" "int""'");
    4831             :   } 
    4832           0 :   arg2 = static_cast< int >(val2);
    4833           0 :   {
    4834           0 :     const int bLocalUseExceptions = GetUseExceptions();
    4835           0 :     if ( bLocalUseExceptions ) {
    4836           0 :       pushErrorHandler();
    4837             :     }
    4838           0 :     {
    4839           0 :       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
    4840           0 :       result = (OGRErr)GNMNetworkShadow_DeleteLayer(arg1,arg2);
    4841           0 :       SWIG_PYTHON_THREAD_END_ALLOW;
    4842             :     }
    4843           0 :     if ( bLocalUseExceptions ) {
    4844           0 :       popErrorHandler();
    4845             :     }
    4846             : #ifndef SED_HACKS
    4847             :     if ( bLocalUseExceptions ) {
    4848             :       CPLErr eclass = CPLGetLastErrorType();
    4849             :       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
    4850             :         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
    4851             :       }
    4852             :     }
    4853             : #endif
    4854             :   }
    4855           0 :   {
    4856             :     /* %typemap(out) OGRErr */
    4857           0 :     if ( result != 0 && GetUseExceptions()) {
    4858           0 :       const char* pszMessage = CPLGetLastErrorMsg();
    4859           0 :       if( pszMessage[0] != '\0' )
    4860           0 :       PyErr_SetString( PyExc_RuntimeError, pszMessage );
    4861             :       else
    4862           0 :       PyErr_SetString( PyExc_RuntimeError, OGRErrMessages(result) );
    4863           0 :       SWIG_fail;
    4864             :     }
    4865             :   }
    4866           0 :   {
    4867             :     /* %typemap(ret) OGRErr */
    4868           0 :     if ( ReturnSame(resultobj == Py_None || resultobj == 0) ) {
    4869           0 :       resultobj = PyInt_FromLong( result );
    4870             :     }
    4871             :   }
    4872           0 :   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
    4873             :   return resultobj;
    4874             : fail:
    4875             :   return NULL;
    4876             : }
    4877             : 
    4878             : 
    4879           0 : SWIGINTERN PyObject *_wrap_Network_GetLayerCount(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
    4880           0 :   PyObject *resultobj = 0; int bLocalUseExceptionsCode = GetUseExceptions();
    4881           0 :   GNMNetworkShadow *arg1 = (GNMNetworkShadow *) 0 ;
    4882           0 :   void *argp1 = 0 ;
    4883           0 :   int res1 = 0 ;
    4884           0 :   PyObject *swig_obj[1] ;
    4885           0 :   int result;
    4886             :   
    4887           0 :   if (!args) SWIG_fail;
    4888           0 :   swig_obj[0] = args;
    4889           0 :   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_GNMNetworkShadow, 0 |  0 );
    4890           0 :   if (!SWIG_IsOK(res1)) {
    4891           0 :     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Network_GetLayerCount" "', argument " "1"" of type '" "GNMNetworkShadow *""'"); 
    4892             :   }
    4893           0 :   arg1 = reinterpret_cast< GNMNetworkShadow * >(argp1);
    4894           0 :   {
    4895           0 :     const int bLocalUseExceptions = GetUseExceptions();
    4896           0 :     if ( bLocalUseExceptions ) {
    4897           0 :       pushErrorHandler();
    4898             :     }
    4899           0 :     {
    4900           0 :       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
    4901           0 :       result = (int)GNMNetworkShadow_GetLayerCount(arg1);
    4902           0 :       SWIG_PYTHON_THREAD_END_ALLOW;
    4903             :     }
    4904           0 :     if ( bLocalUseExceptions ) {
    4905           0 :       popErrorHandler();
    4906             :     }
    4907             : #ifndef SED_HACKS
    4908             :     if ( bLocalUseExceptions ) {
    4909             :       CPLErr eclass = CPLGetLastErrorType();
    4910             :       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
    4911             :         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
    4912             :       }
    4913             :     }
    4914             : #endif
    4915             :   }
    4916           0 :   resultobj = SWIG_From_int(static_cast< int >(result));
    4917           0 :   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
    4918             :   return resultobj;
    4919             : fail:
    4920             :   return NULL;
    4921             : }
    4922             : 
    4923             : 
    4924           0 : SWIGINTERN PyObject *_wrap_Network_GetLayerByIndex(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
    4925           0 :   PyObject *resultobj = 0; int bLocalUseExceptionsCode = GetUseExceptions();
    4926           0 :   GNMNetworkShadow *arg1 = (GNMNetworkShadow *) 0 ;
    4927           0 :   int arg2 = (int) 0 ;
    4928           0 :   void *argp1 = 0 ;
    4929           0 :   int res1 = 0 ;
    4930           0 :   int val2 ;
    4931           0 :   int ecode2 = 0 ;
    4932           0 :   PyObject *swig_obj[2] ;
    4933           0 :   OGRLayerShadow *result = 0 ;
    4934             :   
    4935           0 :   if (!SWIG_Python_UnpackTuple(args, "Network_GetLayerByIndex", 1, 2, swig_obj)) SWIG_fail;
    4936           0 :   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_GNMNetworkShadow, 0 |  0 );
    4937           0 :   if (!SWIG_IsOK(res1)) {
    4938           0 :     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Network_GetLayerByIndex" "', argument " "1"" of type '" "GNMNetworkShadow *""'"); 
    4939             :   }
    4940           0 :   arg1 = reinterpret_cast< GNMNetworkShadow * >(argp1);
    4941           0 :   if (swig_obj[1]) {
    4942           0 :     ecode2 = SWIG_AsVal_int(swig_obj[1], &val2);
    4943           0 :     if (!SWIG_IsOK(ecode2)) {
    4944           0 :       SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Network_GetLayerByIndex" "', argument " "2"" of type '" "int""'");
    4945             :     } 
    4946             :     arg2 = static_cast< int >(val2);
    4947             :   }
    4948           0 :   {
    4949           0 :     const int bLocalUseExceptions = GetUseExceptions();
    4950           0 :     if ( bLocalUseExceptions ) {
    4951           0 :       pushErrorHandler();
    4952             :     }
    4953           0 :     {
    4954           0 :       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
    4955           0 :       result = (OGRLayerShadow *)GNMNetworkShadow_GetLayerByIndex(arg1,arg2);
    4956           0 :       SWIG_PYTHON_THREAD_END_ALLOW;
    4957             :     }
    4958           0 :     if ( bLocalUseExceptions ) {
    4959           0 :       popErrorHandler();
    4960             :     }
    4961             : #ifndef SED_HACKS
    4962             :     if ( bLocalUseExceptions ) {
    4963             :       CPLErr eclass = CPLGetLastErrorType();
    4964             :       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
    4965             :         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
    4966             :       }
    4967             :     }
    4968             : #endif
    4969             :   }
    4970           0 :   resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_OGRLayerShadow, 0 |  0 );
    4971           0 :   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
    4972             :   return resultobj;
    4973             : fail:
    4974             :   return NULL;
    4975             : }
    4976             : 
    4977             : 
    4978           0 : SWIGINTERN PyObject *_wrap_Network_GetLayerByName(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
    4979           0 :   PyObject *resultobj = 0; int bLocalUseExceptionsCode = GetUseExceptions();
    4980           0 :   GNMNetworkShadow *arg1 = (GNMNetworkShadow *) 0 ;
    4981           0 :   char *arg2 = (char *) 0 ;
    4982           0 :   void *argp1 = 0 ;
    4983           0 :   int res1 = 0 ;
    4984           0 :   int res2 ;
    4985           0 :   char *buf2 = 0 ;
    4986           0 :   int alloc2 = 0 ;
    4987           0 :   PyObject *swig_obj[2] ;
    4988           0 :   OGRLayerShadow *result = 0 ;
    4989             :   
    4990           0 :   if (!SWIG_Python_UnpackTuple(args, "Network_GetLayerByName", 2, 2, swig_obj)) SWIG_fail;
    4991           0 :   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_GNMNetworkShadow, 0 |  0 );
    4992           0 :   if (!SWIG_IsOK(res1)) {
    4993           0 :     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Network_GetLayerByName" "', argument " "1"" of type '" "GNMNetworkShadow *""'"); 
    4994             :   }
    4995           0 :   arg1 = reinterpret_cast< GNMNetworkShadow * >(argp1);
    4996           0 :   res2 = SWIG_AsCharPtrAndSize(swig_obj[1], &buf2, NULL, &alloc2);
    4997           0 :   if (!SWIG_IsOK(res2)) {
    4998           0 :     SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Network_GetLayerByName" "', argument " "2"" of type '" "char const *""'");
    4999             :   }
    5000           0 :   arg2 = reinterpret_cast< char * >(buf2);
    5001           0 :   {
    5002           0 :     const int bLocalUseExceptions = GetUseExceptions();
    5003           0 :     if ( bLocalUseExceptions ) {
    5004           0 :       pushErrorHandler();
    5005             :     }
    5006           0 :     {
    5007           0 :       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
    5008           0 :       result = (OGRLayerShadow *)GNMNetworkShadow_GetLayerByName(arg1,(char const *)arg2);
    5009           0 :       SWIG_PYTHON_THREAD_END_ALLOW;
    5010             :     }
    5011           0 :     if ( bLocalUseExceptions ) {
    5012           0 :       popErrorHandler();
    5013             :     }
    5014             : #ifndef SED_HACKS
    5015             :     if ( bLocalUseExceptions ) {
    5016             :       CPLErr eclass = CPLGetLastErrorType();
    5017             :       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
    5018             :         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
    5019             :       }
    5020             :     }
    5021             : #endif
    5022             :   }
    5023           0 :   resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_OGRLayerShadow, 0 |  0 );
    5024           0 :   if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
    5025           0 :   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
    5026             :   return resultobj;
    5027           0 : fail:
    5028           0 :   if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
    5029             :   return NULL;
    5030             : }
    5031             : 
    5032             : 
    5033           0 : SWIGINTERN PyObject *_wrap_Network_TestCapability(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
    5034           0 :   PyObject *resultobj = 0; int bLocalUseExceptionsCode = GetUseExceptions();
    5035           0 :   GNMNetworkShadow *arg1 = (GNMNetworkShadow *) 0 ;
    5036           0 :   char *arg2 = (char *) 0 ;
    5037           0 :   void *argp1 = 0 ;
    5038           0 :   int res1 = 0 ;
    5039           0 :   int res2 ;
    5040           0 :   char *buf2 = 0 ;
    5041           0 :   int alloc2 = 0 ;
    5042           0 :   PyObject *swig_obj[2] ;
    5043           0 :   bool result;
    5044             :   
    5045           0 :   if (!SWIG_Python_UnpackTuple(args, "Network_TestCapability", 2, 2, swig_obj)) SWIG_fail;
    5046           0 :   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_GNMNetworkShadow, 0 |  0 );
    5047           0 :   if (!SWIG_IsOK(res1)) {
    5048           0 :     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Network_TestCapability" "', argument " "1"" of type '" "GNMNetworkShadow *""'"); 
    5049             :   }
    5050           0 :   arg1 = reinterpret_cast< GNMNetworkShadow * >(argp1);
    5051           0 :   res2 = SWIG_AsCharPtrAndSize(swig_obj[1], &buf2, NULL, &alloc2);
    5052           0 :   if (!SWIG_IsOK(res2)) {
    5053           0 :     SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Network_TestCapability" "', argument " "2"" of type '" "char const *""'");
    5054             :   }
    5055           0 :   arg2 = reinterpret_cast< char * >(buf2);
    5056           0 :   {
    5057           0 :     const int bLocalUseExceptions = GetUseExceptions();
    5058           0 :     if ( bLocalUseExceptions ) {
    5059           0 :       pushErrorHandler();
    5060             :     }
    5061           0 :     {
    5062           0 :       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
    5063           0 :       result = (bool)GNMNetworkShadow_TestCapability(arg1,(char const *)arg2);
    5064           0 :       SWIG_PYTHON_THREAD_END_ALLOW;
    5065             :     }
    5066           0 :     if ( bLocalUseExceptions ) {
    5067           0 :       popErrorHandler();
    5068             :     }
    5069             : #ifndef SED_HACKS
    5070             :     if ( bLocalUseExceptions ) {
    5071             :       CPLErr eclass = CPLGetLastErrorType();
    5072             :       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
    5073             :         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
    5074             :       }
    5075             :     }
    5076             : #endif
    5077             :   }
    5078           0 :   resultobj = SWIG_From_bool(static_cast< bool >(result));
    5079           0 :   if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
    5080           0 :   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
    5081             :   return resultobj;
    5082           0 : fail:
    5083           0 :   if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
    5084             :   return NULL;
    5085             : }
    5086             : 
    5087             : 
    5088           0 : SWIGINTERN PyObject *_wrap_Network_StartTransaction(PyObject *SWIGUNUSEDPARM(self), PyObject *args, PyObject *kwargs) {
    5089           0 :   PyObject *resultobj = 0; int bLocalUseExceptionsCode = GetUseExceptions();
    5090           0 :   GNMNetworkShadow *arg1 = (GNMNetworkShadow *) 0 ;
    5091           0 :   int arg2 = (int) FALSE ;
    5092           0 :   void *argp1 = 0 ;
    5093           0 :   int res1 = 0 ;
    5094           0 :   int val2 ;
    5095           0 :   int ecode2 = 0 ;
    5096           0 :   PyObject * obj0 = 0 ;
    5097           0 :   PyObject * obj1 = 0 ;
    5098           0 :   char * kwnames[] = {
    5099             :     (char *)"self",  (char *)"force",  NULL 
    5100             :   };
    5101           0 :   OGRErr result;
    5102             :   
    5103           0 :   if (!PyArg_ParseTupleAndKeywords(args, kwargs, "O|O:Network_StartTransaction", kwnames, &obj0, &obj1)) SWIG_fail;
    5104           0 :   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GNMNetworkShadow, 0 |  0 );
    5105           0 :   if (!SWIG_IsOK(res1)) {
    5106           0 :     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Network_StartTransaction" "', argument " "1"" of type '" "GNMNetworkShadow *""'"); 
    5107             :   }
    5108           0 :   arg1 = reinterpret_cast< GNMNetworkShadow * >(argp1);
    5109           0 :   if (obj1) {
    5110           0 :     ecode2 = SWIG_AsVal_int(obj1, &val2);
    5111           0 :     if (!SWIG_IsOK(ecode2)) {
    5112           0 :       SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Network_StartTransaction" "', argument " "2"" of type '" "int""'");
    5113             :     } 
    5114             :     arg2 = static_cast< int >(val2);
    5115             :   }
    5116           0 :   {
    5117           0 :     const int bLocalUseExceptions = GetUseExceptions();
    5118           0 :     if ( bLocalUseExceptions ) {
    5119           0 :       pushErrorHandler();
    5120             :     }
    5121           0 :     {
    5122           0 :       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
    5123           0 :       result = (OGRErr)GNMNetworkShadow_StartTransaction(arg1,arg2);
    5124           0 :       SWIG_PYTHON_THREAD_END_ALLOW;
    5125             :     }
    5126           0 :     if ( bLocalUseExceptions ) {
    5127           0 :       popErrorHandler();
    5128             :     }
    5129             : #ifndef SED_HACKS
    5130             :     if ( bLocalUseExceptions ) {
    5131             :       CPLErr eclass = CPLGetLastErrorType();
    5132             :       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
    5133             :         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
    5134             :       }
    5135             :     }
    5136             : #endif
    5137             :   }
    5138           0 :   {
    5139             :     /* %typemap(out) OGRErr */
    5140           0 :     if ( result != 0 && GetUseExceptions()) {
    5141           0 :       const char* pszMessage = CPLGetLastErrorMsg();
    5142           0 :       if( pszMessage[0] != '\0' )
    5143           0 :       PyErr_SetString( PyExc_RuntimeError, pszMessage );
    5144             :       else
    5145           0 :       PyErr_SetString( PyExc_RuntimeError, OGRErrMessages(result) );
    5146           0 :       SWIG_fail;
    5147             :     }
    5148             :   }
    5149           0 :   {
    5150             :     /* %typemap(ret) OGRErr */
    5151           0 :     if ( ReturnSame(resultobj == Py_None || resultobj == 0) ) {
    5152           0 :       resultobj = PyInt_FromLong( result );
    5153             :     }
    5154             :   }
    5155           0 :   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
    5156             :   return resultobj;
    5157             : fail:
    5158             :   return NULL;
    5159             : }
    5160             : 
    5161             : 
    5162           0 : SWIGINTERN PyObject *_wrap_Network_CommitTransaction(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
    5163           0 :   PyObject *resultobj = 0; int bLocalUseExceptionsCode = GetUseExceptions();
    5164           0 :   GNMNetworkShadow *arg1 = (GNMNetworkShadow *) 0 ;
    5165           0 :   void *argp1 = 0 ;
    5166           0 :   int res1 = 0 ;
    5167           0 :   PyObject *swig_obj[1] ;
    5168           0 :   OGRErr result;
    5169             :   
    5170           0 :   if (!args) SWIG_fail;
    5171           0 :   swig_obj[0] = args;
    5172           0 :   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_GNMNetworkShadow, 0 |  0 );
    5173           0 :   if (!SWIG_IsOK(res1)) {
    5174           0 :     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Network_CommitTransaction" "', argument " "1"" of type '" "GNMNetworkShadow *""'"); 
    5175             :   }
    5176           0 :   arg1 = reinterpret_cast< GNMNetworkShadow * >(argp1);
    5177           0 :   {
    5178           0 :     const int bLocalUseExceptions = GetUseExceptions();
    5179           0 :     if ( bLocalUseExceptions ) {
    5180           0 :       pushErrorHandler();
    5181             :     }
    5182           0 :     {
    5183           0 :       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
    5184           0 :       result = (OGRErr)GNMNetworkShadow_CommitTransaction(arg1);
    5185           0 :       SWIG_PYTHON_THREAD_END_ALLOW;
    5186             :     }
    5187           0 :     if ( bLocalUseExceptions ) {
    5188           0 :       popErrorHandler();
    5189             :     }
    5190             : #ifndef SED_HACKS
    5191             :     if ( bLocalUseExceptions ) {
    5192             :       CPLErr eclass = CPLGetLastErrorType();
    5193             :       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
    5194             :         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
    5195             :       }
    5196             :     }
    5197             : #endif
    5198             :   }
    5199           0 :   {
    5200             :     /* %typemap(out) OGRErr */
    5201           0 :     if ( result != 0 && GetUseExceptions()) {
    5202           0 :       const char* pszMessage = CPLGetLastErrorMsg();
    5203           0 :       if( pszMessage[0] != '\0' )
    5204           0 :       PyErr_SetString( PyExc_RuntimeError, pszMessage );
    5205             :       else
    5206           0 :       PyErr_SetString( PyExc_RuntimeError, OGRErrMessages(result) );
    5207           0 :       SWIG_fail;
    5208             :     }
    5209             :   }
    5210           0 :   {
    5211             :     /* %typemap(ret) OGRErr */
    5212           0 :     if ( ReturnSame(resultobj == Py_None || resultobj == 0) ) {
    5213           0 :       resultobj = PyInt_FromLong( result );
    5214             :     }
    5215             :   }
    5216           0 :   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
    5217             :   return resultobj;
    5218             : fail:
    5219             :   return NULL;
    5220             : }
    5221             : 
    5222             : 
    5223           0 : SWIGINTERN PyObject *_wrap_Network_RollbackTransaction(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
    5224           0 :   PyObject *resultobj = 0; int bLocalUseExceptionsCode = GetUseExceptions();
    5225           0 :   GNMNetworkShadow *arg1 = (GNMNetworkShadow *) 0 ;
    5226           0 :   void *argp1 = 0 ;
    5227           0 :   int res1 = 0 ;
    5228           0 :   PyObject *swig_obj[1] ;
    5229           0 :   OGRErr result;
    5230             :   
    5231           0 :   if (!args) SWIG_fail;
    5232           0 :   swig_obj[0] = args;
    5233           0 :   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_GNMNetworkShadow, 0 |  0 );
    5234           0 :   if (!SWIG_IsOK(res1)) {
    5235           0 :     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Network_RollbackTransaction" "', argument " "1"" of type '" "GNMNetworkShadow *""'"); 
    5236             :   }
    5237           0 :   arg1 = reinterpret_cast< GNMNetworkShadow * >(argp1);
    5238           0 :   {
    5239           0 :     const int bLocalUseExceptions = GetUseExceptions();
    5240           0 :     if ( bLocalUseExceptions ) {
    5241           0 :       pushErrorHandler();
    5242             :     }
    5243           0 :     {
    5244           0 :       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
    5245           0 :       result = (OGRErr)GNMNetworkShadow_RollbackTransaction(arg1);
    5246           0 :       SWIG_PYTHON_THREAD_END_ALLOW;
    5247             :     }
    5248           0 :     if ( bLocalUseExceptions ) {
    5249           0 :       popErrorHandler();
    5250             :     }
    5251             : #ifndef SED_HACKS
    5252             :     if ( bLocalUseExceptions ) {
    5253             :       CPLErr eclass = CPLGetLastErrorType();
    5254             :       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
    5255             :         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
    5256             :       }
    5257             :     }
    5258             : #endif
    5259             :   }
    5260           0 :   {
    5261             :     /* %typemap(out) OGRErr */
    5262           0 :     if ( result != 0 && GetUseExceptions()) {
    5263           0 :       const char* pszMessage = CPLGetLastErrorMsg();
    5264           0 :       if( pszMessage[0] != '\0' )
    5265           0 :       PyErr_SetString( PyExc_RuntimeError, pszMessage );
    5266             :       else
    5267           0 :       PyErr_SetString( PyExc_RuntimeError, OGRErrMessages(result) );
    5268           0 :       SWIG_fail;
    5269             :     }
    5270             :   }
    5271           0 :   {
    5272             :     /* %typemap(ret) OGRErr */
    5273           0 :     if ( ReturnSame(resultobj == Py_None || resultobj == 0) ) {
    5274           0 :       resultobj = PyInt_FromLong( result );
    5275             :     }
    5276             :   }
    5277           0 :   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
    5278             :   return resultobj;
    5279             : fail:
    5280             :   return NULL;
    5281             : }
    5282             : 
    5283             : 
    5284         228 : SWIGINTERN PyObject *Network_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
    5285         228 :   PyObject *obj;
    5286         228 :   if (!SWIG_Python_UnpackTuple(args, "swigregister", 1, 1, &obj)) return NULL;
    5287         228 :   SWIG_TypeNewClientData(SWIGTYPE_p_GNMNetworkShadow, SWIG_NewClientData(obj));
    5288         228 :   return SWIG_Py_Void();
    5289             : }
    5290             : 
    5291           0 : SWIGINTERN PyObject *_wrap_delete_GenericNetwork(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
    5292           0 :   PyObject *resultobj = 0; int bLocalUseExceptionsCode = GetUseExceptions();
    5293           0 :   GNMGenericNetworkShadow *arg1 = (GNMGenericNetworkShadow *) 0 ;
    5294           0 :   void *argp1 = 0 ;
    5295           0 :   int res1 = 0 ;
    5296           0 :   PyObject *swig_obj[1] ;
    5297             :   
    5298           0 :   if (!args) SWIG_fail;
    5299           0 :   swig_obj[0] = args;
    5300           0 :   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_GNMGenericNetworkShadow, SWIG_POINTER_DISOWN |  0 );
    5301           0 :   if (!SWIG_IsOK(res1)) {
    5302           0 :     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_GenericNetwork" "', argument " "1"" of type '" "GNMGenericNetworkShadow *""'"); 
    5303             :   }
    5304           0 :   arg1 = reinterpret_cast< GNMGenericNetworkShadow * >(argp1);
    5305           0 :   {
    5306           0 :     const int bLocalUseExceptions = GetUseExceptions();
    5307           0 :     if ( bLocalUseExceptions ) {
    5308           0 :       pushErrorHandler();
    5309             :     }
    5310           0 :     {
    5311           0 :       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
    5312           0 :       delete_GNMGenericNetworkShadow(arg1);
    5313           0 :       SWIG_PYTHON_THREAD_END_ALLOW;
    5314             :     }
    5315           0 :     if ( bLocalUseExceptions ) {
    5316           0 :       popErrorHandler();
    5317             :     }
    5318             : #ifndef SED_HACKS
    5319             :     if ( bLocalUseExceptions ) {
    5320             :       CPLErr eclass = CPLGetLastErrorType();
    5321             :       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
    5322             :         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
    5323             :       }
    5324             :     }
    5325             : #endif
    5326             :   }
    5327           0 :   resultobj = SWIG_Py_Void();
    5328           0 :   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
    5329             :   return resultobj;
    5330             : fail:
    5331             :   return NULL;
    5332             : }
    5333             : 
    5334             : 
    5335           0 : SWIGINTERN PyObject *_wrap_GenericNetwork_ConnectFeatures(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
    5336           0 :   PyObject *resultobj = 0; int bLocalUseExceptionsCode = GetUseExceptions();
    5337           0 :   GNMGenericNetworkShadow *arg1 = (GNMGenericNetworkShadow *) 0 ;
    5338           0 :   GIntBig arg2 ;
    5339           0 :   GIntBig arg3 ;
    5340           0 :   GIntBig arg4 ;
    5341           0 :   double arg5 ;
    5342           0 :   double arg6 ;
    5343           0 :   GNMDirection arg7 ;
    5344           0 :   void *argp1 = 0 ;
    5345           0 :   int res1 = 0 ;
    5346           0 :   double val5 ;
    5347           0 :   int ecode5 = 0 ;
    5348           0 :   double val6 ;
    5349           0 :   int ecode6 = 0 ;
    5350           0 :   int val7 ;
    5351           0 :   int ecode7 = 0 ;
    5352           0 :   PyObject *swig_obj[7] ;
    5353           0 :   CPLErr result;
    5354             :   
    5355           0 :   if (!SWIG_Python_UnpackTuple(args, "GenericNetwork_ConnectFeatures", 7, 7, swig_obj)) SWIG_fail;
    5356           0 :   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_GNMGenericNetworkShadow, 0 |  0 );
    5357           0 :   if (!SWIG_IsOK(res1)) {
    5358           0 :     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "GenericNetwork_ConnectFeatures" "', argument " "1"" of type '" "GNMGenericNetworkShadow *""'"); 
    5359             :   }
    5360           0 :   arg1 = reinterpret_cast< GNMGenericNetworkShadow * >(argp1);
    5361           0 :   {
    5362           0 :     arg2 = (GIntBig)PyLong_AsLongLong(swig_obj[1]);
    5363             :   }
    5364           0 :   {
    5365           0 :     arg3 = (GIntBig)PyLong_AsLongLong(swig_obj[2]);
    5366             :   }
    5367           0 :   {
    5368           0 :     arg4 = (GIntBig)PyLong_AsLongLong(swig_obj[3]);
    5369             :   }
    5370           0 :   ecode5 = SWIG_AsVal_double(swig_obj[4], &val5);
    5371           0 :   if (!SWIG_IsOK(ecode5)) {
    5372           0 :     SWIG_exception_fail(SWIG_ArgError(ecode5), "in method '" "GenericNetwork_ConnectFeatures" "', argument " "5"" of type '" "double""'");
    5373             :   } 
    5374           0 :   arg5 = static_cast< double >(val5);
    5375           0 :   ecode6 = SWIG_AsVal_double(swig_obj[5], &val6);
    5376           0 :   if (!SWIG_IsOK(ecode6)) {
    5377           0 :     SWIG_exception_fail(SWIG_ArgError(ecode6), "in method '" "GenericNetwork_ConnectFeatures" "', argument " "6"" of type '" "double""'");
    5378             :   } 
    5379           0 :   arg6 = static_cast< double >(val6);
    5380           0 :   ecode7 = SWIG_AsVal_int(swig_obj[6], &val7);
    5381           0 :   if (!SWIG_IsOK(ecode7)) {
    5382           0 :     SWIG_exception_fail(SWIG_ArgError(ecode7), "in method '" "GenericNetwork_ConnectFeatures" "', argument " "7"" of type '" "GNMDirection""'");
    5383             :   } 
    5384           0 :   arg7 = static_cast< GNMDirection >(val7);
    5385           0 :   {
    5386           0 :     const int bLocalUseExceptions = GetUseExceptions();
    5387           0 :     if ( bLocalUseExceptions ) {
    5388           0 :       pushErrorHandler();
    5389             :     }
    5390           0 :     {
    5391           0 :       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
    5392           0 :       result = (CPLErr)GNMGenericNetworkShadow_ConnectFeatures(arg1,arg2,arg3,arg4,arg5,arg6,arg7);
    5393           0 :       SWIG_PYTHON_THREAD_END_ALLOW;
    5394             :     }
    5395           0 :     if ( bLocalUseExceptions ) {
    5396           0 :       popErrorHandler();
    5397             :     }
    5398             : #ifndef SED_HACKS
    5399             :     if ( bLocalUseExceptions ) {
    5400             :       CPLErr eclass = CPLGetLastErrorType();
    5401             :       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
    5402             :         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
    5403             :       }
    5404             :     }
    5405             : #endif
    5406             :   }
    5407           0 :   resultobj = SWIG_From_int(static_cast< int >(result));
    5408           0 :   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
    5409             :   return resultobj;
    5410             : fail:
    5411             :   return NULL;
    5412             : }
    5413             : 
    5414             : 
    5415           0 : SWIGINTERN PyObject *_wrap_GenericNetwork_DisconnectFeatures(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
    5416           0 :   PyObject *resultobj = 0; int bLocalUseExceptionsCode = GetUseExceptions();
    5417           0 :   GNMGenericNetworkShadow *arg1 = (GNMGenericNetworkShadow *) 0 ;
    5418           0 :   GIntBig arg2 ;
    5419           0 :   GIntBig arg3 ;
    5420           0 :   GIntBig arg4 ;
    5421           0 :   void *argp1 = 0 ;
    5422           0 :   int res1 = 0 ;
    5423           0 :   PyObject *swig_obj[4] ;
    5424           0 :   CPLErr result;
    5425             :   
    5426           0 :   if (!SWIG_Python_UnpackTuple(args, "GenericNetwork_DisconnectFeatures", 4, 4, swig_obj)) SWIG_fail;
    5427           0 :   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_GNMGenericNetworkShadow, 0 |  0 );
    5428           0 :   if (!SWIG_IsOK(res1)) {
    5429           0 :     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "GenericNetwork_DisconnectFeatures" "', argument " "1"" of type '" "GNMGenericNetworkShadow *""'"); 
    5430             :   }
    5431           0 :   arg1 = reinterpret_cast< GNMGenericNetworkShadow * >(argp1);
    5432           0 :   {
    5433           0 :     arg2 = (GIntBig)PyLong_AsLongLong(swig_obj[1]);
    5434             :   }
    5435           0 :   {
    5436           0 :     arg3 = (GIntBig)PyLong_AsLongLong(swig_obj[2]);
    5437             :   }
    5438           0 :   {
    5439           0 :     arg4 = (GIntBig)PyLong_AsLongLong(swig_obj[3]);
    5440             :   }
    5441           0 :   {
    5442           0 :     const int bLocalUseExceptions = GetUseExceptions();
    5443           0 :     if ( bLocalUseExceptions ) {
    5444           0 :       pushErrorHandler();
    5445             :     }
    5446           0 :     {
    5447           0 :       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
    5448           0 :       result = (CPLErr)GNMGenericNetworkShadow_DisconnectFeatures(arg1,arg2,arg3,arg4);
    5449           0 :       SWIG_PYTHON_THREAD_END_ALLOW;
    5450             :     }
    5451           0 :     if ( bLocalUseExceptions ) {
    5452           0 :       popErrorHandler();
    5453             :     }
    5454             : #ifndef SED_HACKS
    5455             :     if ( bLocalUseExceptions ) {
    5456             :       CPLErr eclass = CPLGetLastErrorType();
    5457             :       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
    5458             :         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
    5459             :       }
    5460             :     }
    5461             : #endif
    5462             :   }
    5463           0 :   resultobj = SWIG_From_int(static_cast< int >(result));
    5464           0 :   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
    5465             :   return resultobj;
    5466             : fail:
    5467             :   return NULL;
    5468             : }
    5469             : 
    5470             : 
    5471           0 : SWIGINTERN PyObject *_wrap_GenericNetwork_DisconnectFeaturesWithId(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
    5472           0 :   PyObject *resultobj = 0; int bLocalUseExceptionsCode = GetUseExceptions();
    5473           0 :   GNMGenericNetworkShadow *arg1 = (GNMGenericNetworkShadow *) 0 ;
    5474           0 :   GIntBig arg2 ;
    5475           0 :   void *argp1 = 0 ;
    5476           0 :   int res1 = 0 ;
    5477           0 :   PyObject *swig_obj[2] ;
    5478           0 :   CPLErr result;
    5479             :   
    5480           0 :   if (!SWIG_Python_UnpackTuple(args, "GenericNetwork_DisconnectFeaturesWithId", 2, 2, swig_obj)) SWIG_fail;
    5481           0 :   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_GNMGenericNetworkShadow, 0 |  0 );
    5482           0 :   if (!SWIG_IsOK(res1)) {
    5483           0 :     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "GenericNetwork_DisconnectFeaturesWithId" "', argument " "1"" of type '" "GNMGenericNetworkShadow *""'"); 
    5484             :   }
    5485           0 :   arg1 = reinterpret_cast< GNMGenericNetworkShadow * >(argp1);
    5486           0 :   {
    5487           0 :     arg2 = (GIntBig)PyLong_AsLongLong(swig_obj[1]);
    5488             :   }
    5489           0 :   {
    5490           0 :     const int bLocalUseExceptions = GetUseExceptions();
    5491           0 :     if ( bLocalUseExceptions ) {
    5492           0 :       pushErrorHandler();
    5493             :     }
    5494           0 :     {
    5495           0 :       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
    5496           0 :       result = (CPLErr)GNMGenericNetworkShadow_DisconnectFeaturesWithId(arg1,arg2);
    5497           0 :       SWIG_PYTHON_THREAD_END_ALLOW;
    5498             :     }
    5499           0 :     if ( bLocalUseExceptions ) {
    5500           0 :       popErrorHandler();
    5501             :     }
    5502             : #ifndef SED_HACKS
    5503             :     if ( bLocalUseExceptions ) {
    5504             :       CPLErr eclass = CPLGetLastErrorType();
    5505             :       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
    5506             :         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
    5507             :       }
    5508             :     }
    5509             : #endif
    5510             :   }
    5511           0 :   resultobj = SWIG_From_int(static_cast< int >(result));
    5512           0 :   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
    5513             :   return resultobj;
    5514             : fail:
    5515             :   return NULL;
    5516             : }
    5517             : 
    5518             : 
    5519           0 : SWIGINTERN PyObject *_wrap_GenericNetwork_ReconnectFeatures(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
    5520           0 :   PyObject *resultobj = 0; int bLocalUseExceptionsCode = GetUseExceptions();
    5521           0 :   GNMGenericNetworkShadow *arg1 = (GNMGenericNetworkShadow *) 0 ;
    5522           0 :   GIntBig arg2 ;
    5523           0 :   GIntBig arg3 ;
    5524           0 :   GIntBig arg4 ;
    5525           0 :   double arg5 ;
    5526           0 :   double arg6 ;
    5527           0 :   GNMDirection arg7 ;
    5528           0 :   void *argp1 = 0 ;
    5529           0 :   int res1 = 0 ;
    5530           0 :   double val5 ;
    5531           0 :   int ecode5 = 0 ;
    5532           0 :   double val6 ;
    5533           0 :   int ecode6 = 0 ;
    5534           0 :   int val7 ;
    5535           0 :   int ecode7 = 0 ;
    5536           0 :   PyObject *swig_obj[7] ;
    5537           0 :   CPLErr result;
    5538             :   
    5539           0 :   if (!SWIG_Python_UnpackTuple(args, "GenericNetwork_ReconnectFeatures", 7, 7, swig_obj)) SWIG_fail;
    5540           0 :   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_GNMGenericNetworkShadow, 0 |  0 );
    5541           0 :   if (!SWIG_IsOK(res1)) {
    5542           0 :     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "GenericNetwork_ReconnectFeatures" "', argument " "1"" of type '" "GNMGenericNetworkShadow *""'"); 
    5543             :   }
    5544           0 :   arg1 = reinterpret_cast< GNMGenericNetworkShadow * >(argp1);
    5545           0 :   {
    5546           0 :     arg2 = (GIntBig)PyLong_AsLongLong(swig_obj[1]);
    5547             :   }
    5548           0 :   {
    5549           0 :     arg3 = (GIntBig)PyLong_AsLongLong(swig_obj[2]);
    5550             :   }
    5551           0 :   {
    5552           0 :     arg4 = (GIntBig)PyLong_AsLongLong(swig_obj[3]);
    5553             :   }
    5554           0 :   ecode5 = SWIG_AsVal_double(swig_obj[4], &val5);
    5555           0 :   if (!SWIG_IsOK(ecode5)) {
    5556           0 :     SWIG_exception_fail(SWIG_ArgError(ecode5), "in method '" "GenericNetwork_ReconnectFeatures" "', argument " "5"" of type '" "double""'");
    5557             :   } 
    5558           0 :   arg5 = static_cast< double >(val5);
    5559           0 :   ecode6 = SWIG_AsVal_double(swig_obj[5], &val6);
    5560           0 :   if (!SWIG_IsOK(ecode6)) {
    5561           0 :     SWIG_exception_fail(SWIG_ArgError(ecode6), "in method '" "GenericNetwork_ReconnectFeatures" "', argument " "6"" of type '" "double""'");
    5562             :   } 
    5563           0 :   arg6 = static_cast< double >(val6);
    5564           0 :   ecode7 = SWIG_AsVal_int(swig_obj[6], &val7);
    5565           0 :   if (!SWIG_IsOK(ecode7)) {
    5566           0 :     SWIG_exception_fail(SWIG_ArgError(ecode7), "in method '" "GenericNetwork_ReconnectFeatures" "', argument " "7"" of type '" "GNMDirection""'");
    5567             :   } 
    5568           0 :   arg7 = static_cast< GNMDirection >(val7);
    5569           0 :   {
    5570           0 :     const int bLocalUseExceptions = GetUseExceptions();
    5571           0 :     if ( bLocalUseExceptions ) {
    5572           0 :       pushErrorHandler();
    5573             :     }
    5574           0 :     {
    5575           0 :       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
    5576           0 :       result = (CPLErr)GNMGenericNetworkShadow_ReconnectFeatures(arg1,arg2,arg3,arg4,arg5,arg6,arg7);
    5577           0 :       SWIG_PYTHON_THREAD_END_ALLOW;
    5578             :     }
    5579           0 :     if ( bLocalUseExceptions ) {
    5580           0 :       popErrorHandler();
    5581             :     }
    5582             : #ifndef SED_HACKS
    5583             :     if ( bLocalUseExceptions ) {
    5584             :       CPLErr eclass = CPLGetLastErrorType();
    5585             :       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
    5586             :         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
    5587             :       }
    5588             :     }
    5589             : #endif
    5590             :   }
    5591           0 :   resultobj = SWIG_From_int(static_cast< int >(result));
    5592           0 :   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
    5593             :   return resultobj;
    5594             : fail:
    5595             :   return NULL;
    5596             : }
    5597             : 
    5598             : 
    5599           0 : SWIGINTERN PyObject *_wrap_GenericNetwork_CreateRule(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
    5600           0 :   PyObject *resultobj = 0; int bLocalUseExceptionsCode = GetUseExceptions();
    5601           0 :   GNMGenericNetworkShadow *arg1 = (GNMGenericNetworkShadow *) 0 ;
    5602           0 :   char *arg2 = (char *) 0 ;
    5603           0 :   void *argp1 = 0 ;
    5604           0 :   int res1 = 0 ;
    5605           0 :   int res2 ;
    5606           0 :   char *buf2 = 0 ;
    5607           0 :   int alloc2 = 0 ;
    5608           0 :   PyObject *swig_obj[2] ;
    5609           0 :   CPLErr result;
    5610             :   
    5611           0 :   if (!SWIG_Python_UnpackTuple(args, "GenericNetwork_CreateRule", 2, 2, swig_obj)) SWIG_fail;
    5612           0 :   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_GNMGenericNetworkShadow, 0 |  0 );
    5613           0 :   if (!SWIG_IsOK(res1)) {
    5614           0 :     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "GenericNetwork_CreateRule" "', argument " "1"" of type '" "GNMGenericNetworkShadow *""'"); 
    5615             :   }
    5616           0 :   arg1 = reinterpret_cast< GNMGenericNetworkShadow * >(argp1);
    5617           0 :   res2 = SWIG_AsCharPtrAndSize(swig_obj[1], &buf2, NULL, &alloc2);
    5618           0 :   if (!SWIG_IsOK(res2)) {
    5619           0 :     SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "GenericNetwork_CreateRule" "', argument " "2"" of type '" "char const *""'");
    5620             :   }
    5621           0 :   arg2 = reinterpret_cast< char * >(buf2);
    5622           0 :   {
    5623           0 :     if (!arg2) {
    5624           0 :       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
    5625             :     }
    5626             :   }
    5627           0 :   {
    5628           0 :     const int bLocalUseExceptions = GetUseExceptions();
    5629           0 :     if ( bLocalUseExceptions ) {
    5630           0 :       pushErrorHandler();
    5631             :     }
    5632           0 :     {
    5633           0 :       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
    5634           0 :       result = (CPLErr)GNMGenericNetworkShadow_CreateRule(arg1,(char const *)arg2);
    5635           0 :       SWIG_PYTHON_THREAD_END_ALLOW;
    5636             :     }
    5637           0 :     if ( bLocalUseExceptions ) {
    5638           0 :       popErrorHandler();
    5639             :     }
    5640             : #ifndef SED_HACKS
    5641             :     if ( bLocalUseExceptions ) {
    5642             :       CPLErr eclass = CPLGetLastErrorType();
    5643             :       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
    5644             :         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
    5645             :       }
    5646             :     }
    5647             : #endif
    5648             :   }
    5649           0 :   resultobj = SWIG_From_int(static_cast< int >(result));
    5650           0 :   if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
    5651           0 :   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
    5652             :   return resultobj;
    5653           0 : fail:
    5654           0 :   if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
    5655             :   return NULL;
    5656             : }
    5657             : 
    5658             : 
    5659           0 : SWIGINTERN PyObject *_wrap_GenericNetwork_DeleteAllRules(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
    5660           0 :   PyObject *resultobj = 0; int bLocalUseExceptionsCode = GetUseExceptions();
    5661           0 :   GNMGenericNetworkShadow *arg1 = (GNMGenericNetworkShadow *) 0 ;
    5662           0 :   void *argp1 = 0 ;
    5663           0 :   int res1 = 0 ;
    5664           0 :   PyObject *swig_obj[1] ;
    5665           0 :   CPLErr result;
    5666             :   
    5667           0 :   if (!args) SWIG_fail;
    5668           0 :   swig_obj[0] = args;
    5669           0 :   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_GNMGenericNetworkShadow, 0 |  0 );
    5670           0 :   if (!SWIG_IsOK(res1)) {
    5671           0 :     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "GenericNetwork_DeleteAllRules" "', argument " "1"" of type '" "GNMGenericNetworkShadow *""'"); 
    5672             :   }
    5673           0 :   arg1 = reinterpret_cast< GNMGenericNetworkShadow * >(argp1);
    5674           0 :   {
    5675           0 :     const int bLocalUseExceptions = GetUseExceptions();
    5676           0 :     if ( bLocalUseExceptions ) {
    5677           0 :       pushErrorHandler();
    5678             :     }
    5679           0 :     {
    5680           0 :       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
    5681           0 :       result = (CPLErr)GNMGenericNetworkShadow_DeleteAllRules(arg1);
    5682           0 :       SWIG_PYTHON_THREAD_END_ALLOW;
    5683             :     }
    5684           0 :     if ( bLocalUseExceptions ) {
    5685           0 :       popErrorHandler();
    5686             :     }
    5687             : #ifndef SED_HACKS
    5688             :     if ( bLocalUseExceptions ) {
    5689             :       CPLErr eclass = CPLGetLastErrorType();
    5690             :       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
    5691             :         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
    5692             :       }
    5693             :     }
    5694             : #endif
    5695             :   }
    5696           0 :   resultobj = SWIG_From_int(static_cast< int >(result));
    5697           0 :   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
    5698             :   return resultobj;
    5699             : fail:
    5700             :   return NULL;
    5701             : }
    5702             : 
    5703             : 
    5704           0 : SWIGINTERN PyObject *_wrap_GenericNetwork_DeleteRule(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
    5705           0 :   PyObject *resultobj = 0; int bLocalUseExceptionsCode = GetUseExceptions();
    5706           0 :   GNMGenericNetworkShadow *arg1 = (GNMGenericNetworkShadow *) 0 ;
    5707           0 :   char *arg2 = (char *) 0 ;
    5708           0 :   void *argp1 = 0 ;
    5709           0 :   int res1 = 0 ;
    5710           0 :   int res2 ;
    5711           0 :   char *buf2 = 0 ;
    5712           0 :   int alloc2 = 0 ;
    5713           0 :   PyObject *swig_obj[2] ;
    5714           0 :   CPLErr result;
    5715             :   
    5716           0 :   if (!SWIG_Python_UnpackTuple(args, "GenericNetwork_DeleteRule", 2, 2, swig_obj)) SWIG_fail;
    5717           0 :   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_GNMGenericNetworkShadow, 0 |  0 );
    5718           0 :   if (!SWIG_IsOK(res1)) {
    5719           0 :     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "GenericNetwork_DeleteRule" "', argument " "1"" of type '" "GNMGenericNetworkShadow *""'"); 
    5720             :   }
    5721           0 :   arg1 = reinterpret_cast< GNMGenericNetworkShadow * >(argp1);
    5722           0 :   res2 = SWIG_AsCharPtrAndSize(swig_obj[1], &buf2, NULL, &alloc2);
    5723           0 :   if (!SWIG_IsOK(res2)) {
    5724           0 :     SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "GenericNetwork_DeleteRule" "', argument " "2"" of type '" "char const *""'");
    5725             :   }
    5726           0 :   arg2 = reinterpret_cast< char * >(buf2);
    5727           0 :   {
    5728           0 :     if (!arg2) {
    5729           0 :       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
    5730             :     }
    5731             :   }
    5732           0 :   {
    5733           0 :     const int bLocalUseExceptions = GetUseExceptions();
    5734           0 :     if ( bLocalUseExceptions ) {
    5735           0 :       pushErrorHandler();
    5736             :     }
    5737           0 :     {
    5738           0 :       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
    5739           0 :       result = (CPLErr)GNMGenericNetworkShadow_DeleteRule(arg1,(char const *)arg2);
    5740           0 :       SWIG_PYTHON_THREAD_END_ALLOW;
    5741             :     }
    5742           0 :     if ( bLocalUseExceptions ) {
    5743           0 :       popErrorHandler();
    5744             :     }
    5745             : #ifndef SED_HACKS
    5746             :     if ( bLocalUseExceptions ) {
    5747             :       CPLErr eclass = CPLGetLastErrorType();
    5748             :       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
    5749             :         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
    5750             :       }
    5751             :     }
    5752             : #endif
    5753             :   }
    5754           0 :   resultobj = SWIG_From_int(static_cast< int >(result));
    5755           0 :   if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
    5756           0 :   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
    5757             :   return resultobj;
    5758           0 : fail:
    5759           0 :   if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
    5760             :   return NULL;
    5761             : }
    5762             : 
    5763             : 
    5764           0 : SWIGINTERN PyObject *_wrap_GenericNetwork_GetRules(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
    5765           0 :   PyObject *resultobj = 0; int bLocalUseExceptionsCode = GetUseExceptions();
    5766           0 :   GNMGenericNetworkShadow *arg1 = (GNMGenericNetworkShadow *) 0 ;
    5767           0 :   void *argp1 = 0 ;
    5768           0 :   int res1 = 0 ;
    5769           0 :   PyObject *swig_obj[1] ;
    5770           0 :   char **result = 0 ;
    5771             :   
    5772           0 :   if (!args) SWIG_fail;
    5773           0 :   swig_obj[0] = args;
    5774           0 :   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_GNMGenericNetworkShadow, 0 |  0 );
    5775           0 :   if (!SWIG_IsOK(res1)) {
    5776           0 :     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "GenericNetwork_GetRules" "', argument " "1"" of type '" "GNMGenericNetworkShadow *""'"); 
    5777             :   }
    5778           0 :   arg1 = reinterpret_cast< GNMGenericNetworkShadow * >(argp1);
    5779           0 :   {
    5780           0 :     const int bLocalUseExceptions = GetUseExceptions();
    5781           0 :     if ( bLocalUseExceptions ) {
    5782           0 :       pushErrorHandler();
    5783             :     }
    5784           0 :     {
    5785           0 :       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
    5786           0 :       result = (char **)GNMGenericNetworkShadow_GetRules(arg1);
    5787           0 :       SWIG_PYTHON_THREAD_END_ALLOW;
    5788             :     }
    5789           0 :     if ( bLocalUseExceptions ) {
    5790           0 :       popErrorHandler();
    5791             :     }
    5792             : #ifndef SED_HACKS
    5793             :     if ( bLocalUseExceptions ) {
    5794             :       CPLErr eclass = CPLGetLastErrorType();
    5795             :       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
    5796             :         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
    5797             :       }
    5798             :     }
    5799             : #endif
    5800             :   }
    5801           0 :   {
    5802             :     /* %typemap(out) char **CSL -> ( string ) */
    5803           0 :     bool bErr = false;
    5804           0 :     resultobj = CSLToList(result, &bErr);
    5805           0 :     CSLDestroy(result);
    5806           0 :     if( bErr ) {
    5807           0 :       SWIG_fail;
    5808             :     }
    5809             :   }
    5810           0 :   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
    5811             :   return resultobj;
    5812             : fail:
    5813             :   return NULL;
    5814             : }
    5815             : 
    5816             : 
    5817           1 : SWIGINTERN PyObject *_wrap_GenericNetwork_ConnectPointsByLines(PyObject *SWIGUNUSEDPARM(self), PyObject *args, PyObject *kwargs) {
    5818           1 :   PyObject *resultobj = 0; int bLocalUseExceptionsCode = GetUseExceptions();
    5819           1 :   GNMGenericNetworkShadow *arg1 = (GNMGenericNetworkShadow *) 0 ;
    5820           1 :   char **arg2 = (char **) 0 ;
    5821           1 :   double arg3 ;
    5822           1 :   double arg4 ;
    5823           1 :   double arg5 ;
    5824           1 :   GNMDirection arg6 ;
    5825           1 :   void *argp1 = 0 ;
    5826           1 :   int res1 = 0 ;
    5827           1 :   double val3 ;
    5828           1 :   int ecode3 = 0 ;
    5829           1 :   double val4 ;
    5830           1 :   int ecode4 = 0 ;
    5831           1 :   double val5 ;
    5832           1 :   int ecode5 = 0 ;
    5833           1 :   int val6 ;
    5834           1 :   int ecode6 = 0 ;
    5835           1 :   PyObject * obj0 = 0 ;
    5836           1 :   PyObject * obj1 = 0 ;
    5837           1 :   PyObject * obj2 = 0 ;
    5838           1 :   PyObject * obj3 = 0 ;
    5839           1 :   PyObject * obj4 = 0 ;
    5840           1 :   PyObject * obj5 = 0 ;
    5841           1 :   char * kwnames[] = {
    5842             :     (char *)"self",  (char *)"papszLayerList",  (char *)"dfTolerance",  (char *)"dfCost",  (char *)"dfInvCost",  (char *)"eDir",  NULL 
    5843             :   };
    5844           1 :   CPLErr result;
    5845             :   
    5846           1 :   if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOOOOO:GenericNetwork_ConnectPointsByLines", kwnames, &obj0, &obj1, &obj2, &obj3, &obj4, &obj5)) SWIG_fail;
    5847           1 :   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GNMGenericNetworkShadow, 0 |  0 );
    5848           1 :   if (!SWIG_IsOK(res1)) {
    5849           0 :     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "GenericNetwork_ConnectPointsByLines" "', argument " "1"" of type '" "GNMGenericNetworkShadow *""'"); 
    5850             :   }
    5851           1 :   arg1 = reinterpret_cast< GNMGenericNetworkShadow * >(argp1);
    5852           1 :   {
    5853             :     /* %typemap(in) char **dict */
    5854           1 :     arg2 = NULL;
    5855           1 :     if ( PySequence_Check( obj1 ) ) {
    5856           1 :       int bErr = FALSE;
    5857           1 :       arg2 = CSLFromPySequence(obj1, &bErr);
    5858           1 :       if ( bErr )
    5859             :       {
    5860           0 :         SWIG_fail;
    5861             :       }
    5862             :     }
    5863           0 :     else if ( PyMapping_Check( obj1 ) ) {
    5864           0 :       int bErr = FALSE;
    5865           0 :       arg2 = CSLFromPyMapping(obj1, &bErr);
    5866           0 :       if ( bErr )
    5867             :       {
    5868           0 :         SWIG_fail;
    5869             :       }
    5870             :     }
    5871             :     else {
    5872           0 :       PyErr_SetString(PyExc_TypeError,"Argument must be dictionary or sequence of strings");
    5873           0 :       SWIG_fail;
    5874             :     }
    5875             :   }
    5876           1 :   ecode3 = SWIG_AsVal_double(obj2, &val3);
    5877           1 :   if (!SWIG_IsOK(ecode3)) {
    5878           0 :     SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "GenericNetwork_ConnectPointsByLines" "', argument " "3"" of type '" "double""'");
    5879             :   } 
    5880           1 :   arg3 = static_cast< double >(val3);
    5881           1 :   ecode4 = SWIG_AsVal_double(obj3, &val4);
    5882           1 :   if (!SWIG_IsOK(ecode4)) {
    5883           0 :     SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "GenericNetwork_ConnectPointsByLines" "', argument " "4"" of type '" "double""'");
    5884             :   } 
    5885           1 :   arg4 = static_cast< double >(val4);
    5886           1 :   ecode5 = SWIG_AsVal_double(obj4, &val5);
    5887           1 :   if (!SWIG_IsOK(ecode5)) {
    5888           0 :     SWIG_exception_fail(SWIG_ArgError(ecode5), "in method '" "GenericNetwork_ConnectPointsByLines" "', argument " "5"" of type '" "double""'");
    5889             :   } 
    5890           1 :   arg5 = static_cast< double >(val5);
    5891           1 :   ecode6 = SWIG_AsVal_int(obj5, &val6);
    5892           1 :   if (!SWIG_IsOK(ecode6)) {
    5893           0 :     SWIG_exception_fail(SWIG_ArgError(ecode6), "in method '" "GenericNetwork_ConnectPointsByLines" "', argument " "6"" of type '" "GNMDirection""'");
    5894             :   } 
    5895           1 :   arg6 = static_cast< GNMDirection >(val6);
    5896           1 :   {
    5897           1 :     const int bLocalUseExceptions = GetUseExceptions();
    5898           1 :     if ( bLocalUseExceptions ) {
    5899           1 :       pushErrorHandler();
    5900             :     }
    5901           1 :     {
    5902           1 :       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
    5903           1 :       result = (CPLErr)GNMGenericNetworkShadow_ConnectPointsByLines(arg1,arg2,arg3,arg4,arg5,arg6);
    5904           1 :       SWIG_PYTHON_THREAD_END_ALLOW;
    5905             :     }
    5906           1 :     if ( bLocalUseExceptions ) {
    5907           1 :       popErrorHandler();
    5908             :     }
    5909             : #ifndef SED_HACKS
    5910             :     if ( bLocalUseExceptions ) {
    5911             :       CPLErr eclass = CPLGetLastErrorType();
    5912             :       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
    5913             :         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
    5914             :       }
    5915             :     }
    5916             : #endif
    5917             :   }
    5918           1 :   resultobj = SWIG_From_int(static_cast< int >(result));
    5919           1 :   {
    5920             :     /* %typemap(freearg) char **dict */
    5921           1 :     CSLDestroy( arg2 );
    5922             :   }
    5923           1 :   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
    5924             :   return resultobj;
    5925           0 : fail:
    5926           0 :   {
    5927             :     /* %typemap(freearg) char **dict */
    5928           0 :     CSLDestroy( arg2 );
    5929             :   }
    5930             :   return NULL;
    5931             : }
    5932             : 
    5933             : 
    5934           0 : SWIGINTERN PyObject *_wrap_GenericNetwork_ChangeBlockState(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
    5935           0 :   PyObject *resultobj = 0; int bLocalUseExceptionsCode = GetUseExceptions();
    5936           0 :   GNMGenericNetworkShadow *arg1 = (GNMGenericNetworkShadow *) 0 ;
    5937           0 :   GIntBig arg2 ;
    5938           0 :   bool arg3 ;
    5939           0 :   void *argp1 = 0 ;
    5940           0 :   int res1 = 0 ;
    5941           0 :   bool val3 ;
    5942           0 :   int ecode3 = 0 ;
    5943           0 :   PyObject *swig_obj[3] ;
    5944           0 :   CPLErr result;
    5945             :   
    5946           0 :   if (!SWIG_Python_UnpackTuple(args, "GenericNetwork_ChangeBlockState", 3, 3, swig_obj)) SWIG_fail;
    5947           0 :   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_GNMGenericNetworkShadow, 0 |  0 );
    5948           0 :   if (!SWIG_IsOK(res1)) {
    5949           0 :     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "GenericNetwork_ChangeBlockState" "', argument " "1"" of type '" "GNMGenericNetworkShadow *""'"); 
    5950             :   }
    5951           0 :   arg1 = reinterpret_cast< GNMGenericNetworkShadow * >(argp1);
    5952           0 :   {
    5953           0 :     arg2 = (GIntBig)PyLong_AsLongLong(swig_obj[1]);
    5954             :   }
    5955           0 :   ecode3 = SWIG_AsVal_bool(swig_obj[2], &val3);
    5956           0 :   if (!SWIG_IsOK(ecode3)) {
    5957           0 :     SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "GenericNetwork_ChangeBlockState" "', argument " "3"" of type '" "bool""'");
    5958             :   } 
    5959           0 :   arg3 = static_cast< bool >(val3);
    5960           0 :   {
    5961           0 :     const int bLocalUseExceptions = GetUseExceptions();
    5962           0 :     if ( bLocalUseExceptions ) {
    5963           0 :       pushErrorHandler();
    5964             :     }
    5965           0 :     {
    5966           0 :       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
    5967           0 :       result = (CPLErr)GNMGenericNetworkShadow_ChangeBlockState(arg1,arg2,arg3);
    5968           0 :       SWIG_PYTHON_THREAD_END_ALLOW;
    5969             :     }
    5970           0 :     if ( bLocalUseExceptions ) {
    5971           0 :       popErrorHandler();
    5972             :     }
    5973             : #ifndef SED_HACKS
    5974             :     if ( bLocalUseExceptions ) {
    5975             :       CPLErr eclass = CPLGetLastErrorType();
    5976             :       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
    5977             :         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
    5978             :       }
    5979             :     }
    5980             : #endif
    5981             :   }
    5982           0 :   resultobj = SWIG_From_int(static_cast< int >(result));
    5983           0 :   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
    5984             :   return resultobj;
    5985             : fail:
    5986             :   return NULL;
    5987             : }
    5988             : 
    5989             : 
    5990           0 : SWIGINTERN PyObject *_wrap_GenericNetwork_ChangeAllBlockState(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
    5991           0 :   PyObject *resultobj = 0; int bLocalUseExceptionsCode = GetUseExceptions();
    5992           0 :   GNMGenericNetworkShadow *arg1 = (GNMGenericNetworkShadow *) 0 ;
    5993           0 :   bool arg2 = (bool) false ;
    5994           0 :   void *argp1 = 0 ;
    5995           0 :   int res1 = 0 ;
    5996           0 :   bool val2 ;
    5997           0 :   int ecode2 = 0 ;
    5998           0 :   PyObject *swig_obj[2] ;
    5999           0 :   CPLErr result;
    6000             :   
    6001           0 :   if (!SWIG_Python_UnpackTuple(args, "GenericNetwork_ChangeAllBlockState", 1, 2, swig_obj)) SWIG_fail;
    6002           0 :   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_GNMGenericNetworkShadow, 0 |  0 );
    6003           0 :   if (!SWIG_IsOK(res1)) {
    6004           0 :     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "GenericNetwork_ChangeAllBlockState" "', argument " "1"" of type '" "GNMGenericNetworkShadow *""'"); 
    6005             :   }
    6006           0 :   arg1 = reinterpret_cast< GNMGenericNetworkShadow * >(argp1);
    6007           0 :   if (swig_obj[1]) {
    6008           0 :     ecode2 = SWIG_AsVal_bool(swig_obj[1], &val2);
    6009           0 :     if (!SWIG_IsOK(ecode2)) {
    6010           0 :       SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "GenericNetwork_ChangeAllBlockState" "', argument " "2"" of type '" "bool""'");
    6011             :     } 
    6012             :     arg2 = static_cast< bool >(val2);
    6013             :   }
    6014           0 :   {
    6015           0 :     const int bLocalUseExceptions = GetUseExceptions();
    6016           0 :     if ( bLocalUseExceptions ) {
    6017           0 :       pushErrorHandler();
    6018             :     }
    6019           0 :     {
    6020           0 :       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
    6021           0 :       result = (CPLErr)GNMGenericNetworkShadow_ChangeAllBlockState(arg1,arg2);
    6022           0 :       SWIG_PYTHON_THREAD_END_ALLOW;
    6023             :     }
    6024           0 :     if ( bLocalUseExceptions ) {
    6025           0 :       popErrorHandler();
    6026             :     }
    6027             : #ifndef SED_HACKS
    6028             :     if ( bLocalUseExceptions ) {
    6029             :       CPLErr eclass = CPLGetLastErrorType();
    6030             :       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
    6031             :         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
    6032             :       }
    6033             :     }
    6034             : #endif
    6035             :   }
    6036           0 :   resultobj = SWIG_From_int(static_cast< int >(result));
    6037           0 :   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
    6038             :   return resultobj;
    6039             : fail:
    6040             :   return NULL;
    6041             : }
    6042             : 
    6043             : 
    6044         228 : SWIGINTERN PyObject *GenericNetwork_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
    6045         228 :   PyObject *obj;
    6046         228 :   if (!SWIG_Python_UnpackTuple(args, "swigregister", 1, 1, &obj)) return NULL;
    6047         228 :   SWIG_TypeNewClientData(SWIGTYPE_p_GNMGenericNetworkShadow, SWIG_NewClientData(obj));
    6048         228 :   return SWIG_Py_Void();
    6049             : }
    6050             : 
    6051             : static PyMethodDef SwigMethods[] = {
    6052             :    { "SWIG_PyInstanceMethod_New", SWIG_PyInstanceMethod_New, METH_O, NULL},
    6053             :    { "GetUseExceptions", _wrap_GetUseExceptions, METH_NOARGS, "GetUseExceptions() -> int"},
    6054             :    { "_GetExceptionsLocal", _wrap__GetExceptionsLocal, METH_NOARGS, "_GetExceptionsLocal() -> int"},
    6055             :    { "_SetExceptionsLocal", _wrap__SetExceptionsLocal, METH_O, "_SetExceptionsLocal(int bVal)"},
    6056             :    { "_UseExceptions", _wrap__UseExceptions, METH_NOARGS, "_UseExceptions()"},
    6057             :    { "_DontUseExceptions", _wrap__DontUseExceptions, METH_NOARGS, "_DontUseExceptions()"},
    6058             :    { "_UserHasSpecifiedIfUsingExceptions", _wrap__UserHasSpecifiedIfUsingExceptions, METH_NOARGS, "_UserHasSpecifiedIfUsingExceptions() -> int"},
    6059             :    { "CastToNetwork", _wrap_CastToNetwork, METH_O, "CastToNetwork(MajorObject base) -> Network"},
    6060             :    { "CastToGenericNetwork", _wrap_CastToGenericNetwork, METH_O, "CastToGenericNetwork(MajorObject base) -> GenericNetwork"},
    6061             :    { "delete_Network", _wrap_delete_Network, METH_O, "delete_Network(Network self)"},
    6062             :    { "Network_ReleaseResultSet", _wrap_Network_ReleaseResultSet, METH_VARARGS, "Network_ReleaseResultSet(Network self, Layer layer)"},
    6063             :    { "Network_GetVersion", _wrap_Network_GetVersion, METH_O, "Network_GetVersion(Network self) -> int"},
    6064             :    { "Network_GetName", _wrap_Network_GetName, METH_O, "Network_GetName(Network self) -> char const *"},
    6065             :    { "Network_GetFeatureByGlobalFID", _wrap_Network_GetFeatureByGlobalFID, METH_VARARGS, "Network_GetFeatureByGlobalFID(Network self, GIntBig GFID) -> Feature"},
    6066             :    { "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"},
    6067             :    { "Network_DisconnectAll", _wrap_Network_DisconnectAll, METH_O, "Network_DisconnectAll(Network self) -> CPLErr"},
    6068             :    { "Network_GetProjection", _wrap_Network_GetProjection, METH_O, "Network_GetProjection(Network self) -> char const *"},
    6069             :    { "Network_GetProjectionRef", _wrap_Network_GetProjectionRef, METH_O, "Network_GetProjectionRef(Network self) -> char const *"},
    6070             :    { "Network_GetFileList", _wrap_Network_GetFileList, METH_O, "Network_GetFileList(Network self) -> char **"},
    6071             :    { "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"},
    6072             :    { "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"},
    6073             :    { "Network_DeleteLayer", _wrap_Network_DeleteLayer, METH_VARARGS, "Network_DeleteLayer(Network self, int index) -> OGRErr"},
    6074             :    { "Network_GetLayerCount", _wrap_Network_GetLayerCount, METH_O, "Network_GetLayerCount(Network self) -> int"},
    6075             :    { "Network_GetLayerByIndex", _wrap_Network_GetLayerByIndex, METH_VARARGS, "Network_GetLayerByIndex(Network self, int index=0) -> Layer"},
    6076             :    { "Network_GetLayerByName", _wrap_Network_GetLayerByName, METH_VARARGS, "Network_GetLayerByName(Network self, char const * layer_name) -> Layer"},
    6077             :    { "Network_TestCapability", _wrap_Network_TestCapability, METH_VARARGS, "Network_TestCapability(Network self, char const * cap) -> bool"},
    6078             :    { "Network_StartTransaction", (PyCFunction)(void(*)(void))_wrap_Network_StartTransaction, METH_VARARGS|METH_KEYWORDS, "Network_StartTransaction(Network self, int force=FALSE) -> OGRErr"},
    6079             :    { "Network_CommitTransaction", _wrap_Network_CommitTransaction, METH_O, "Network_CommitTransaction(Network self) -> OGRErr"},
    6080             :    { "Network_RollbackTransaction", _wrap_Network_RollbackTransaction, METH_O, "Network_RollbackTransaction(Network self) -> OGRErr"},
    6081             :    { "Network_swigregister", Network_swigregister, METH_O, NULL},
    6082             :    { "delete_GenericNetwork", _wrap_delete_GenericNetwork, METH_O, "delete_GenericNetwork(GenericNetwork self)"},
    6083             :    { "GenericNetwork_ConnectFeatures", _wrap_GenericNetwork_ConnectFeatures, METH_VARARGS, "GenericNetwork_ConnectFeatures(GenericNetwork self, GIntBig nSrcFID, GIntBig nTgtFID, GIntBig nConFID, double dfCost, double dfInvCost, GNMDirection eDir) -> CPLErr"},
    6084             :    { "GenericNetwork_DisconnectFeatures", _wrap_GenericNetwork_DisconnectFeatures, METH_VARARGS, "GenericNetwork_DisconnectFeatures(GenericNetwork self, GIntBig nSrcFID, GIntBig nTgtFID, GIntBig nConFID) -> CPLErr"},
    6085             :    { "GenericNetwork_DisconnectFeaturesWithId", _wrap_GenericNetwork_DisconnectFeaturesWithId, METH_VARARGS, "GenericNetwork_DisconnectFeaturesWithId(GenericNetwork self, GIntBig nFID) -> CPLErr"},
    6086             :    { "GenericNetwork_ReconnectFeatures", _wrap_GenericNetwork_ReconnectFeatures, METH_VARARGS, "GenericNetwork_ReconnectFeatures(GenericNetwork self, GIntBig nSrcFID, GIntBig nTgtFID, GIntBig nConFID, double dfCost, double dfInvCost, GNMDirection eDir) -> CPLErr"},
    6087             :    { "GenericNetwork_CreateRule", _wrap_GenericNetwork_CreateRule, METH_VARARGS, "GenericNetwork_CreateRule(GenericNetwork self, char const * pszRuleStr) -> CPLErr"},
    6088             :    { "GenericNetwork_DeleteAllRules", _wrap_GenericNetwork_DeleteAllRules, METH_O, "GenericNetwork_DeleteAllRules(GenericNetwork self) -> CPLErr"},
    6089             :    { "GenericNetwork_DeleteRule", _wrap_GenericNetwork_DeleteRule, METH_VARARGS, "GenericNetwork_DeleteRule(GenericNetwork self, char const * pszRuleStr) -> CPLErr"},
    6090             :    { "GenericNetwork_GetRules", _wrap_GenericNetwork_GetRules, METH_O, "GenericNetwork_GetRules(GenericNetwork self) -> char **"},
    6091             :    { "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"},
    6092             :    { "GenericNetwork_ChangeBlockState", _wrap_GenericNetwork_ChangeBlockState, METH_VARARGS, "GenericNetwork_ChangeBlockState(GenericNetwork self, GIntBig nFID, bool bIsBlock) -> CPLErr"},
    6093             :    { "GenericNetwork_ChangeAllBlockState", _wrap_GenericNetwork_ChangeAllBlockState, METH_VARARGS, "GenericNetwork_ChangeAllBlockState(GenericNetwork self, bool bIsBlock=False) -> CPLErr"},
    6094             :    { "GenericNetwork_swigregister", GenericNetwork_swigregister, METH_O, NULL},
    6095             :    { NULL, NULL, 0, NULL }
    6096             : };
    6097             : 
    6098             : static PyMethodDef SwigMethods_proxydocs[] = {
    6099             :    { NULL, NULL, 0, NULL }
    6100             : };
    6101             : 
    6102             : 
    6103             : /* -------- TYPE CONVERSION AND EQUIVALENCE RULES (BEGIN) -------- */
    6104             : 
    6105           0 : static void *_p_OGRLayerShadowTo_p_GDALMajorObjectShadow(void *x, int *SWIGUNUSEDPARM(newmemory)) {
    6106           0 :     return (void *)((GDALMajorObjectShadow *)  ((OGRLayerShadow *) x));
    6107             : }
    6108           2 : static void *_p_GNMNetworkShadowTo_p_GDALMajorObjectShadow(void *x, int *SWIGUNUSEDPARM(newmemory)) {
    6109           2 :     return (void *)((GDALMajorObjectShadow *)  ((GNMNetworkShadow *) x));
    6110             : }
    6111           0 : static void *_p_GNMGenericNetworkShadowTo_p_GDALMajorObjectShadow(void *x, int *SWIGUNUSEDPARM(newmemory)) {
    6112           0 :     return (void *)((GDALMajorObjectShadow *) (GNMNetworkShadow *) ((GNMGenericNetworkShadow *) x));
    6113             : }
    6114           0 : static void *_p_GNMGenericNetworkShadowTo_p_GNMNetworkShadow(void *x, int *SWIGUNUSEDPARM(newmemory)) {
    6115           0 :     return (void *)((GNMNetworkShadow *)  ((GNMGenericNetworkShadow *) x));
    6116             : }
    6117             : static swig_type_info _swigt__p_GDALDatasetShadow = {"_p_GDALDatasetShadow", "GDALDatasetShadow *|OGRDataSourceShadow *", 0, 0, (void*)0, 0};
    6118             : static swig_type_info _swigt__p_GDALDriverShadow = {"_p_GDALDriverShadow", "GDALDriverShadow *|OGRDriverShadow *", 0, 0, (void*)0, 0};
    6119             : static swig_type_info _swigt__p_GDALMajorObjectShadow = {"_p_GDALMajorObjectShadow", "GDALMajorObjectShadow *", 0, 0, (void*)0, 0};
    6120             : static swig_type_info _swigt__p_GIntBig = {"_p_GIntBig", "GIntBig *", 0, 0, (void*)0, 0};
    6121             : static swig_type_info _swigt__p_GNMGenericNetworkShadow = {"_p_GNMGenericNetworkShadow", "GNMGenericNetworkShadow *", 0, 0, (void*)0, 0};
    6122             : static swig_type_info _swigt__p_GNMGraphAlgorithmType = {"_p_GNMGraphAlgorithmType", "enum GNMGraphAlgorithmType *|GNMGraphAlgorithmType *", 0, 0, (void*)0, 0};
    6123             : static swig_type_info _swigt__p_GNMNetworkShadow = {"_p_GNMNetworkShadow", "GNMNetworkShadow *", 0, 0, (void*)0, 0};
    6124             : static swig_type_info _swigt__p_OGRFeatureShadow = {"_p_OGRFeatureShadow", "OGRFeatureShadow *", 0, 0, (void*)0, 0};
    6125             : static swig_type_info _swigt__p_OGRLayerShadow = {"_p_OGRLayerShadow", "OGRLayerShadow *", 0, 0, (void*)0, 0};
    6126             : static swig_type_info _swigt__p_OSRSpatialReferenceShadow = {"_p_OSRSpatialReferenceShadow", "OSRSpatialReferenceShadow *", 0, 0, (void*)0, 0};
    6127             : static swig_type_info _swigt__p_char = {"_p_char", "char *|retStringAndCPLFree *", 0, 0, (void*)0, 0};
    6128             : 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};
    6129             : 
    6130             : static swig_type_info *swig_type_initial[] = {
    6131             :   &_swigt__p_GDALDatasetShadow,
    6132             :   &_swigt__p_GDALDriverShadow,
    6133             :   &_swigt__p_GDALMajorObjectShadow,
    6134             :   &_swigt__p_GIntBig,
    6135             :   &_swigt__p_GNMGenericNetworkShadow,
    6136             :   &_swigt__p_GNMGraphAlgorithmType,
    6137             :   &_swigt__p_GNMNetworkShadow,
    6138             :   &_swigt__p_OGRFeatureShadow,
    6139             :   &_swigt__p_OGRLayerShadow,
    6140             :   &_swigt__p_OSRSpatialReferenceShadow,
    6141             :   &_swigt__p_char,
    6142             :   &_swigt__p_int,
    6143             : };
    6144             : 
    6145             : static swig_cast_info _swigc__p_GDALDatasetShadow[] = {  {&_swigt__p_GDALDatasetShadow, 0, 0, 0},{0, 0, 0, 0}};
    6146             : static swig_cast_info _swigc__p_GDALDriverShadow[] = {  {&_swigt__p_GDALDriverShadow, 0, 0, 0},{0, 0, 0, 0}};
    6147             : 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}};
    6148             : static swig_cast_info _swigc__p_GIntBig[] = {  {&_swigt__p_GIntBig, 0, 0, 0},{0, 0, 0, 0}};
    6149             : static swig_cast_info _swigc__p_GNMGenericNetworkShadow[] = {  {&_swigt__p_GNMGenericNetworkShadow, 0, 0, 0},{0, 0, 0, 0}};
    6150             : static swig_cast_info _swigc__p_GNMGraphAlgorithmType[] = {  {&_swigt__p_GNMGraphAlgorithmType, 0, 0, 0},{0, 0, 0, 0}};
    6151             : 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}};
    6152             : static swig_cast_info _swigc__p_OGRFeatureShadow[] = {  {&_swigt__p_OGRFeatureShadow, 0, 0, 0},{0, 0, 0, 0}};
    6153             : static swig_cast_info _swigc__p_OGRLayerShadow[] = {  {&_swigt__p_OGRLayerShadow, 0, 0, 0},{0, 0, 0, 0}};
    6154             : static swig_cast_info _swigc__p_OSRSpatialReferenceShadow[] = {  {&_swigt__p_OSRSpatialReferenceShadow, 0, 0, 0},{0, 0, 0, 0}};
    6155             : static swig_cast_info _swigc__p_char[] = {  {&_swigt__p_char, 0, 0, 0},{0, 0, 0, 0}};
    6156             : static swig_cast_info _swigc__p_int[] = {  {&_swigt__p_int, 0, 0, 0},{0, 0, 0, 0}};
    6157             : 
    6158             : static swig_cast_info *swig_cast_initial[] = {
    6159             :   _swigc__p_GDALDatasetShadow,
    6160             :   _swigc__p_GDALDriverShadow,
    6161             :   _swigc__p_GDALMajorObjectShadow,
    6162             :   _swigc__p_GIntBig,
    6163             :   _swigc__p_GNMGenericNetworkShadow,
    6164             :   _swigc__p_GNMGraphAlgorithmType,
    6165             :   _swigc__p_GNMNetworkShadow,
    6166             :   _swigc__p_OGRFeatureShadow,
    6167             :   _swigc__p_OGRLayerShadow,
    6168             :   _swigc__p_OSRSpatialReferenceShadow,
    6169             :   _swigc__p_char,
    6170             :   _swigc__p_int,
    6171             : };
    6172             : 
    6173             : 
    6174             : /* -------- TYPE CONVERSION AND EQUIVALENCE RULES (END) -------- */
    6175             : 
    6176             : static swig_const_info swig_const_table[] = {
    6177             : {0, 0, 0, 0.0, 0, 0}};
    6178             : 
    6179             : #ifdef __cplusplus
    6180             : }
    6181             : #endif
    6182             : /* -----------------------------------------------------------------------------
    6183             :  * Type initialization:
    6184             :  * This problem is tough by the requirement that no dynamic
    6185             :  * memory is used. Also, since swig_type_info structures store pointers to
    6186             :  * swig_cast_info structures and swig_cast_info structures store pointers back
    6187             :  * to swig_type_info structures, we need some lookup code at initialization.
    6188             :  * The idea is that swig generates all the structures that are needed.
    6189             :  * The runtime then collects these partially filled structures.
    6190             :  * The SWIG_InitializeModule function takes these initial arrays out of
    6191             :  * swig_module, and does all the lookup, filling in the swig_module.types
    6192             :  * array with the correct data and linking the correct swig_cast_info
    6193             :  * structures together.
    6194             :  *
    6195             :  * The generated swig_type_info structures are assigned statically to an initial
    6196             :  * array. We just loop through that array, and handle each type individually.
    6197             :  * First we lookup if this type has been already loaded, and if so, use the
    6198             :  * loaded structure instead of the generated one. Then we have to fill in the
    6199             :  * cast linked list. The cast data is initially stored in something like a
    6200             :  * two-dimensional array. Each row corresponds to a type (there are the same
    6201             :  * number of rows as there are in the swig_type_initial array). Each entry in
    6202             :  * a column is one of the swig_cast_info structures for that type.
    6203             :  * The cast_initial array is actually an array of arrays, because each row has
    6204             :  * a variable number of columns. So to actually build the cast linked list,
    6205             :  * we find the array of casts associated with the type, and loop through it
    6206             :  * adding the casts to the list. The one last trick we need to do is making
    6207             :  * sure the type pointer in the swig_cast_info struct is correct.
    6208             :  *
    6209             :  * First off, we lookup the cast->type name to see if it is already loaded.
    6210             :  * There are three cases to handle:
    6211             :  *  1) If the cast->type has already been loaded AND the type we are adding
    6212             :  *     casting info to has not been loaded (it is in this module), THEN we
    6213             :  *     replace the cast->type pointer with the type pointer that has already
    6214             :  *     been loaded.
    6215             :  *  2) If BOTH types (the one we are adding casting info to, and the
    6216             :  *     cast->type) are loaded, THEN the cast info has already been loaded by
    6217             :  *     the previous module so we just ignore it.
    6218             :  *  3) Finally, if cast->type has not already been loaded, then we add that
    6219             :  *     swig_cast_info to the linked list (because the cast->type) pointer will
    6220             :  *     be correct.
    6221             :  * ----------------------------------------------------------------------------- */
    6222             : 
    6223             : #ifdef __cplusplus
    6224             : extern "C" {
    6225             : #if 0
    6226             : } /* c-mode */
    6227             : #endif
    6228             : #endif
    6229             : 
    6230             : #if 0
    6231             : #define SWIGRUNTIME_DEBUG
    6232             : #endif
    6233             : 
    6234             : 
    6235             : SWIGRUNTIME void
    6236             : SWIG_InitializeModule(void *clientdata) {
    6237             :   size_t i;
    6238             :   swig_module_info *module_head, *iter;
    6239             :   int init;
    6240             :   
    6241             :   /* check to see if the circular list has been setup, if not, set it up */
    6242             :   if (swig_module.next==0) {
    6243             :     /* Initialize the swig_module */
    6244             :     swig_module.type_initial = swig_type_initial;
    6245             :     swig_module.cast_initial = swig_cast_initial;
    6246             :     swig_module.next = &swig_module;
    6247             :     init = 1;
    6248             :   } else {
    6249             :     init = 0;
    6250             :   }
    6251             :   
    6252             :   /* Try and load any already created modules */
    6253             :   module_head = SWIG_GetModule(clientdata);
    6254             :   if (!module_head) {
    6255             :     /* This is the first module loaded for this interpreter */
    6256             :     /* so set the swig module into the interpreter */
    6257             :     SWIG_SetModule(clientdata, &swig_module);
    6258             :   } else {
    6259             :     /* the interpreter has loaded a SWIG module, but has it loaded this one? */
    6260             :     iter=module_head;
    6261             :     do {
    6262             :       if (iter==&swig_module) {
    6263             :         /* Our module is already in the list, so there's nothing more to do. */
    6264             :         return;
    6265             :       }
    6266             :       iter=iter->next;
    6267             :     } while (iter!= module_head);
    6268             :     
    6269             :     /* otherwise we must add our module into the list */
    6270             :     swig_module.next = module_head->next;
    6271             :     module_head->next = &swig_module;
    6272             :   }
    6273             :   
    6274             :   /* When multiple interpreters are used, a module could have already been initialized in
    6275             :        a different interpreter, but not yet have a pointer in this interpreter.
    6276             :        In this case, we do not want to continue adding types... everything should be
    6277             :        set up already */
    6278             :   if (init == 0) return;
    6279             :   
    6280             :   /* Now work on filling in swig_module.types */
    6281             : #ifdef SWIGRUNTIME_DEBUG
    6282             :   printf("SWIG_InitializeModule: size %lu\n", (unsigned long)swig_module.size);
    6283             : #endif
    6284             :   for (i = 0; i < swig_module.size; ++i) {
    6285             :     swig_type_info *type = 0;
    6286             :     swig_type_info *ret;
    6287             :     swig_cast_info *cast;
    6288             :     
    6289             : #ifdef SWIGRUNTIME_DEBUG
    6290             :     printf("SWIG_InitializeModule: type %lu %s\n", (unsigned long)i, swig_module.type_initial[i]->name);
    6291             : #endif
    6292             :     
    6293             :     /* if there is another module already loaded */
    6294             :     if (swig_module.next != &swig_module) {
    6295             :       type = SWIG_MangledTypeQueryModule(swig_module.next, &swig_module, swig_module.type_initial[i]->name);
    6296             :     }
    6297             :     if (type) {
    6298             :       /* Overwrite clientdata field */
    6299             : #ifdef SWIGRUNTIME_DEBUG
    6300             :       printf("SWIG_InitializeModule: found type %s\n", type->name);
    6301             : #endif
    6302             :       if (swig_module.type_initial[i]->clientdata) {
    6303             :         type->clientdata = swig_module.type_initial[i]->clientdata;
    6304             : #ifdef SWIGRUNTIME_DEBUG
    6305             :         printf("SWIG_InitializeModule: found and overwrite type %s \n", type->name);
    6306             : #endif
    6307             :       }
    6308             :     } else {
    6309             :       type = swig_module.type_initial[i];
    6310             :     }
    6311             :     
    6312             :     /* Insert casting types */
    6313             :     cast = swig_module.cast_initial[i];
    6314             :     while (cast->type) {
    6315             :       /* Don't need to add information already in the list */
    6316             :       ret = 0;
    6317             : #ifdef SWIGRUNTIME_DEBUG
    6318             :       printf("SWIG_InitializeModule: look cast %s\n", cast->type->name);
    6319             : #endif
    6320             :       if (swig_module.next != &swig_module) {
    6321             :         ret = SWIG_MangledTypeQueryModule(swig_module.next, &swig_module, cast->type->name);
    6322             : #ifdef SWIGRUNTIME_DEBUG
    6323             :         if (ret) printf("SWIG_InitializeModule: found cast %s\n", ret->name);
    6324             : #endif
    6325             :       }
    6326             :       if (ret) {
    6327             :         if (type == swig_module.type_initial[i]) {
    6328             : #ifdef SWIGRUNTIME_DEBUG
    6329             :           printf("SWIG_InitializeModule: skip old type %s\n", ret->name);
    6330             : #endif
    6331             :           cast->type = ret;
    6332             :           ret = 0;
    6333             :         } else {
    6334             :           /* Check for casting already in the list */
    6335             :           swig_cast_info *ocast = SWIG_TypeCheck(ret->name, type);
    6336             : #ifdef SWIGRUNTIME_DEBUG
    6337             :           if (ocast) printf("SWIG_InitializeModule: skip old cast %s\n", ret->name);
    6338             : #endif
    6339             :           if (!ocast) ret = 0;
    6340             :         }
    6341             :       }
    6342             :       
    6343             :       if (!ret) {
    6344             : #ifdef SWIGRUNTIME_DEBUG
    6345             :         printf("SWIG_InitializeModule: adding cast %s\n", cast->type->name);
    6346             : #endif
    6347             :         if (type->cast) {
    6348             :           type->cast->prev = cast;
    6349             :           cast->next = type->cast;
    6350             :         }
    6351             :         type->cast = cast;
    6352             :       }
    6353             :       cast++;
    6354             :     }
    6355             :     /* Set entry in modules->types array equal to the type */
    6356             :     swig_module.types[i] = type;
    6357             :   }
    6358             :   swig_module.types[i] = 0;
    6359             :   
    6360             : #ifdef SWIGRUNTIME_DEBUG
    6361             :   printf("**** SWIG_InitializeModule: Cast List ******\n");
    6362             :   for (i = 0; i < swig_module.size; ++i) {
    6363             :     int j = 0;
    6364             :     swig_cast_info *cast = swig_module.cast_initial[i];
    6365             :     printf("SWIG_InitializeModule: type %lu %s\n", (unsigned long)i, swig_module.type_initial[i]->name);
    6366             :     while (cast->type) {
    6367             :       printf("SWIG_InitializeModule: cast type %s\n", cast->type->name);
    6368             :       cast++;
    6369             :       ++j;
    6370             :     }
    6371             :     printf("---- Total casts: %d\n",j);
    6372             :   }
    6373             :   printf("**** SWIG_InitializeModule: Cast List ******\n");
    6374             : #endif
    6375             : }
    6376             : 
    6377             : /* This function will propagate the clientdata field of type to
    6378             : * any new swig_type_info structures that have been added into the list
    6379             : * of equivalent types.  It is like calling
    6380             : * SWIG_TypeClientData(type, clientdata) a second time.
    6381             : */
    6382             : SWIGRUNTIME void
    6383             : SWIG_PropagateClientData(void) {
    6384             :   size_t i;
    6385             :   swig_cast_info *equiv;
    6386             :   static int init_run = 0;
    6387             :   
    6388             :   if (init_run) return;
    6389             :   init_run = 1;
    6390             :   
    6391             :   for (i = 0; i < swig_module.size; i++) {
    6392             :     if (swig_module.types[i]->clientdata) {
    6393             :       equiv = swig_module.types[i]->cast;
    6394             :       while (equiv) {
    6395             :         if (!equiv->converter) {
    6396             :           if (equiv->type && !equiv->type->clientdata)
    6397             :           SWIG_TypeClientData(equiv->type, swig_module.types[i]->clientdata);
    6398             :         }
    6399             :         equiv = equiv->next;
    6400             :       }
    6401             :     }
    6402             :   }
    6403             : }
    6404             : 
    6405             : #ifdef __cplusplus
    6406             : #if 0
    6407             : {
    6408             :   /* c-mode */
    6409             : #endif
    6410             : }
    6411             : #endif
    6412             : 
    6413             : 
    6414             : 
    6415             : #ifdef __cplusplus
    6416             : extern "C" {
    6417             : #endif
    6418             :   
    6419             :   /* Python-specific SWIG API */
    6420             : #define SWIG_newvarlink()                             SWIG_Python_newvarlink()
    6421             : #define SWIG_addvarlink(p, name, get_attr, set_attr)  SWIG_Python_addvarlink(p, name, get_attr, set_attr)
    6422             : #define SWIG_InstallConstants(d, constants)           SWIG_Python_InstallConstants(d, constants)
    6423             :   
    6424             :   /* -----------------------------------------------------------------------------
    6425             :    * global variable support code.
    6426             :    * ----------------------------------------------------------------------------- */
    6427             :   
    6428             :   typedef struct swig_globalvar {
    6429             :     char       *name;                  /* Name of global variable */
    6430             :     PyObject *(*get_attr)(void);       /* Return the current value */
    6431             :     int       (*set_attr)(PyObject *); /* Set the value */
    6432             :     struct swig_globalvar *next;
    6433             :   } swig_globalvar;
    6434             :   
    6435             :   typedef struct swig_varlinkobject {
    6436             :     PyObject_HEAD
    6437             :     swig_globalvar *vars;
    6438             :   } swig_varlinkobject;
    6439             :   
    6440             :   SWIGINTERN PyObject *
    6441             :   swig_varlink_repr(swig_varlinkobject *SWIGUNUSEDPARM(v)) {
    6442             : #if PY_VERSION_HEX >= 0x03000000
    6443             :     return PyUnicode_InternFromString("<Swig global variables>");
    6444             : #else
    6445             :     return PyString_FromString("<Swig global variables>");
    6446             : #endif
    6447             :   }
    6448             :   
    6449             :   SWIGINTERN PyObject *
    6450             :   swig_varlink_str(swig_varlinkobject *v) {
    6451             : #if PY_VERSION_HEX >= 0x03000000
    6452             :     PyObject *str = PyUnicode_InternFromString("(");
    6453             :     PyObject *tail;
    6454             :     PyObject *joined;
    6455             :     swig_globalvar *var;
    6456             :     for (var = v->vars; var; var=var->next) {
    6457             :       tail = PyUnicode_FromString(var->name);
    6458             :       joined = PyUnicode_Concat(str, tail);
    6459             :       Py_DecRef(str);
    6460             :       Py_DecRef(tail);
    6461             :       str = joined;
    6462             :       if (var->next) {
    6463             :         tail = PyUnicode_InternFromString(", ");
    6464             :         joined = PyUnicode_Concat(str, tail);
    6465             :         Py_DecRef(str);
    6466             :         Py_DecRef(tail);
    6467             :         str = joined;
    6468             :       }
    6469             :     }
    6470             :     tail = PyUnicode_InternFromString(")");
    6471             :     joined = PyUnicode_Concat(str, tail);
    6472             :     Py_DecRef(str);
    6473             :     Py_DecRef(tail);
    6474             :     str = joined;
    6475             : #else
    6476             :     PyObject *str = PyString_FromString("(");
    6477             :     swig_globalvar *var;
    6478             :     for (var = v->vars; var; var=var->next) {
    6479             :       PyString_ConcatAndDel(&str,PyString_FromString(var->name));
    6480             :       if (var->next) PyString_ConcatAndDel(&str,PyString_FromString(", "));
    6481             :     }
    6482             :     PyString_ConcatAndDel(&str,PyString_FromString(")"));
    6483             : #endif
    6484             :     return str;
    6485             :   }
    6486             :   
    6487             :   SWIGINTERN void
    6488             :   swig_varlink_dealloc(swig_varlinkobject *v) {
    6489             :     swig_globalvar *var = v->vars;
    6490             :     while (var) {
    6491             :       swig_globalvar *n = var->next;
    6492             :       free(var->name);
    6493             :       free(var);
    6494             :       var = n;
    6495             :     }
    6496             :   }
    6497             :   
    6498             :   SWIGINTERN PyObject *
    6499             :   swig_varlink_getattr(swig_varlinkobject *v, char *n) {
    6500             :     PyObject *res = NULL;
    6501             :     swig_globalvar *var = v->vars;
    6502             :     while (var) {
    6503             :       if (strcmp(var->name,n) == 0) {
    6504             :         res = (*var->get_attr)();
    6505             :         break;
    6506             :       }
    6507             :       var = var->next;
    6508             :     }
    6509             :     if (res == NULL && !PyErr_Occurred()) {
    6510             :       PyErr_Format(PyExc_AttributeError, "Unknown C global variable '%s'", n);
    6511             :     }
    6512             :     return res;
    6513             :   }
    6514             :   
    6515             :   SWIGINTERN int
    6516             :   swig_varlink_setattr(swig_varlinkobject *v, char *n, PyObject *p) {
    6517             :     int res = 1;
    6518             :     swig_globalvar *var = v->vars;
    6519             :     while (var) {
    6520             :       if (strcmp(var->name,n) == 0) {
    6521             :         res = (*var->set_attr)(p);
    6522             :         break;
    6523             :       }
    6524             :       var = var->next;
    6525             :     }
    6526             :     if (res == 1 && !PyErr_Occurred()) {
    6527             :       PyErr_Format(PyExc_AttributeError, "Unknown C global variable '%s'", n);
    6528             :     }
    6529             :     return res;
    6530             :   }
    6531             :   
    6532             :   SWIGINTERN PyTypeObject*
    6533             :   swig_varlink_type(void) {
    6534             :     static char varlink__doc__[] = "Swig var link object";
    6535             :     static PyTypeObject varlink_type;
    6536             :     static int type_init = 0;
    6537             :     if (!type_init) {
    6538             :       const PyTypeObject tmp = {
    6539             : #if PY_VERSION_HEX >= 0x03000000
    6540             :         PyVarObject_HEAD_INIT(NULL, 0)
    6541             : #else
    6542             :         PyObject_HEAD_INIT(NULL)
    6543             :         0,                                  /* ob_size */
    6544             : #endif
    6545             :         "swigvarlink",                      /* tp_name */
    6546             :         sizeof(swig_varlinkobject),         /* tp_basicsize */
    6547             :         0,                                  /* tp_itemsize */
    6548             :         (destructor) swig_varlink_dealloc,  /* tp_dealloc */
    6549             :         0,                                  /* tp_print */
    6550             :         (getattrfunc) swig_varlink_getattr, /* tp_getattr */
    6551             :         (setattrfunc) swig_varlink_setattr, /* tp_setattr */
    6552             :         0,                                  /* tp_compare */
    6553             :         (reprfunc) swig_varlink_repr,       /* tp_repr */
    6554             :         0,                                  /* tp_as_number */
    6555             :         0,                                  /* tp_as_sequence */
    6556             :         0,                                  /* tp_as_mapping */
    6557             :         0,                                  /* tp_hash */
    6558             :         0,                                  /* tp_call */
    6559             :         (reprfunc) swig_varlink_str,        /* tp_str */
    6560             :         0,                                  /* tp_getattro */
    6561             :         0,                                  /* tp_setattro */
    6562             :         0,                                  /* tp_as_buffer */
    6563             :         0,                                  /* tp_flags */
    6564             :         varlink__doc__,                     /* tp_doc */
    6565             :         0,                                  /* tp_traverse */
    6566             :         0,                                  /* tp_clear */
    6567             :         0,                                  /* tp_richcompare */
    6568             :         0,                                  /* tp_weaklistoffset */
    6569             :         0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* tp_iter -> tp_weaklist */
    6570             :         0,                                  /* tp_del */
    6571             :         0,                                  /* tp_version_tag */
    6572             : #if PY_VERSION_HEX >= 0x03040000
    6573             :         0,                                  /* tp_finalize */
    6574             : #endif
    6575             : #ifdef COUNT_ALLOCS
    6576             :         0,                                  /* tp_allocs */
    6577             :         0,                                  /* tp_frees */
    6578             :         0,                                  /* tp_maxalloc */
    6579             :         0,                                  /* tp_prev */
    6580             :         0                                   /* tp_next */
    6581             : #endif
    6582             :       };
    6583             :       varlink_type = tmp;
    6584             :       type_init = 1;
    6585             :       if (PyType_Ready(&varlink_type) < 0)
    6586             :       return NULL;
    6587             :     }
    6588             :     return &varlink_type;
    6589             :   }
    6590             :   
    6591             :   /* Create a variable linking object for use later */
    6592             :   SWIGINTERN PyObject *
    6593             :   SWIG_Python_newvarlink(void) {
    6594             :     swig_varlinkobject *result = PyObject_NEW(swig_varlinkobject, swig_varlink_type());
    6595             :     if (result) {
    6596             :       result->vars = 0;
    6597             :     }
    6598             :     return ((PyObject*) result);
    6599             :   }
    6600             :   
    6601             :   SWIGINTERN void 
    6602             :   SWIG_Python_addvarlink(PyObject *p, const char *name, PyObject *(*get_attr)(void), int (*set_attr)(PyObject *p)) {
    6603             :     swig_varlinkobject *v = (swig_varlinkobject *) p;
    6604             :     swig_globalvar *gv = (swig_globalvar *) malloc(sizeof(swig_globalvar));
    6605             :     if (gv) {
    6606             :       size_t size = strlen(name)+1;
    6607             :       gv->name = (char *)malloc(size);
    6608             :       if (gv->name) {
    6609             :         memcpy(gv->name, name, size);
    6610             :         gv->get_attr = get_attr;
    6611             :         gv->set_attr = set_attr;
    6612             :         gv->next = v->vars;
    6613             :       }
    6614             :     }
    6615             :     v->vars = gv;
    6616             :   }
    6617             :   
    6618             :   SWIGINTERN PyObject *
    6619             :   SWIG_globals(void) {
    6620             :     static PyObject *globals = 0;
    6621             :     if (!globals) {
    6622             :       globals = SWIG_newvarlink();
    6623             :     }
    6624             :     return globals;
    6625             :   }
    6626             :   
    6627             :   /* -----------------------------------------------------------------------------
    6628             :    * constants/methods manipulation
    6629             :    * ----------------------------------------------------------------------------- */
    6630             :   
    6631             :   /* Install Constants */
    6632             :   SWIGINTERN void
    6633         228 :   SWIG_Python_InstallConstants(PyObject *d, swig_const_info constants[]) {
    6634         228 :     PyObject *obj = 0;
    6635         228 :     size_t i;
    6636         228 :     for (i = 0; constants[i].type; ++i) {
    6637           0 :       switch(constants[i].type) {
    6638           0 :       case SWIG_PY_POINTER:
    6639           0 :         obj = SWIG_InternalNewPointerObj(constants[i].pvalue, *(constants[i]).ptype,0);
    6640           0 :         break;
    6641           0 :       case SWIG_PY_BINARY:
    6642           0 :         obj = SWIG_NewPackedObj(constants[i].pvalue, constants[i].lvalue, *(constants[i].ptype));
    6643             :         break;
    6644             :       default:
    6645             :         obj = 0;
    6646             :         break;
    6647             :       }
    6648           0 :       if (obj) {
    6649           0 :         PyDict_SetItemString(d, constants[i].name, obj);
    6650           0 :         Py_DECREF(obj);
    6651             :       }
    6652             :     }
    6653         228 :   }
    6654             :   
    6655             :   /* -----------------------------------------------------------------------------*/
    6656             :   /* Fix SwigMethods to carry the callback ptrs when needed */
    6657             :   /* -----------------------------------------------------------------------------*/
    6658             :   
    6659             :   SWIGINTERN void
    6660         228 :   SWIG_Python_FixMethods(PyMethodDef *methods,
    6661             :     swig_const_info *const_table,
    6662             :     swig_type_info **types,
    6663             :     swig_type_info **types_initial) {
    6664         228 :     size_t i;
    6665       10032 :     for (i = 0; methods[i].ml_name; ++i) {
    6666        9804 :       const char *c = methods[i].ml_doc;
    6667        9804 :       if (!c) continue;
    6668        9120 :       c = strstr(c, "swig_ptr: ");
    6669        9120 :       if (c) {
    6670           0 :         int j;
    6671           0 :         swig_const_info *ci = 0;
    6672           0 :         const char *name = c + 10;
    6673           0 :         for (j = 0; const_table[j].type; ++j) {
    6674           0 :           if (strncmp(const_table[j].name, name, 
    6675             :               strlen(const_table[j].name)) == 0) {
    6676             :             ci = &(const_table[j]);
    6677             :             break;
    6678             :           }
    6679             :         }
    6680           0 :         if (ci) {
    6681        9804 :           void *ptr = (ci->type == SWIG_PY_POINTER) ? ci->pvalue : 0;
    6682           0 :           if (ptr) {
    6683           0 :             size_t shift = (ci->ptype) - types;
    6684           0 :             swig_type_info *ty = types_initial[shift];
    6685           0 :             size_t ldoc = (c - methods[i].ml_doc);
    6686           0 :             size_t lptr = strlen(ty->name)+2*sizeof(void*)+2;
    6687           0 :             char *ndoc = (char*)malloc(ldoc + lptr + 10);
    6688           0 :             if (ndoc) {
    6689           0 :               char *buff = ndoc;
    6690           0 :               memcpy(buff, methods[i].ml_doc, ldoc);
    6691           0 :               buff += ldoc;
    6692           0 :               memcpy(buff, "swig_ptr: ", 10);
    6693           0 :               buff += 10;
    6694           0 :               SWIG_PackVoidPtr(buff, ptr, ty->name, lptr);
    6695           0 :               methods[i].ml_doc = ndoc;
    6696             :             }
    6697             :           }
    6698             :         }
    6699             :       }
    6700             :     }
    6701         228 :   } 
    6702             :   
    6703             :   /* -----------------------------------------------------------------------------
    6704             :    * Method creation and docstring support functions
    6705             :    * ----------------------------------------------------------------------------- */
    6706             :   
    6707             :   /* -----------------------------------------------------------------------------
    6708             :    * Function to find the method definition with the correct docstring for the
    6709             :    * proxy module as opposed to the low-level API
    6710             :    * ----------------------------------------------------------------------------- */
    6711             :   
    6712           0 :   SWIGINTERN PyMethodDef *SWIG_PythonGetProxyDoc(const char *name) {
    6713             :     /* Find the function in the modified method table */
    6714           0 :     size_t offset = 0;
    6715           0 :     int found = 0;
    6716           0 :     while (SwigMethods_proxydocs[offset].ml_meth != NULL) {
    6717           0 :       if (strcmp(SwigMethods_proxydocs[offset].ml_name, name) == 0) {
    6718             :         found = 1;
    6719             :         break;
    6720             :       }
    6721           0 :       offset++;
    6722             :     }
    6723             :     /* Use the copy with the modified docstring if available */
    6724           0 :     return found ? &SwigMethods_proxydocs[offset] : NULL;
    6725             :   }
    6726             :   
    6727             :   /* -----------------------------------------------------------------------------
    6728             :    * Wrapper of PyInstanceMethod_New() used in Python 3
    6729             :    * It is exported to the generated module, used for -fastproxy
    6730             :    * ----------------------------------------------------------------------------- */
    6731             :   
    6732           0 :   SWIGINTERN PyObject *SWIG_PyInstanceMethod_New(PyObject *SWIGUNUSEDPARM(self), PyObject *func) {
    6733           0 :     if (PyCFunction_Check(func)) {
    6734           0 :       PyCFunctionObject *funcobj = (PyCFunctionObject *)func;
    6735           0 :       PyMethodDef *ml = SWIG_PythonGetProxyDoc(funcobj->m_ml->ml_name);
    6736           0 :       if (ml)
    6737           0 :       func = PyCFunction_NewEx(ml, funcobj->m_self, funcobj->m_module);
    6738             :     }
    6739             : #if PY_VERSION_HEX >= 0x03000000
    6740           0 :     return PyInstanceMethod_New(func);
    6741             : #else
    6742             :     return PyMethod_New(func, NULL, NULL);
    6743             : #endif
    6744             :   }
    6745             :   
    6746             :   /* -----------------------------------------------------------------------------
    6747             :    * Wrapper of PyStaticMethod_New()
    6748             :    * It is exported to the generated module, used for -fastproxy
    6749             :    * ----------------------------------------------------------------------------- */
    6750             :   
    6751             :   SWIGINTERN PyObject *SWIG_PyStaticMethod_New(PyObject *SWIGUNUSEDPARM(self), PyObject *func) {
    6752             :     if (PyCFunction_Check(func)) {
    6753             :       PyCFunctionObject *funcobj = (PyCFunctionObject *)func;
    6754             :       PyMethodDef *ml = SWIG_PythonGetProxyDoc(funcobj->m_ml->ml_name);
    6755             :       if (ml)
    6756             :       func = PyCFunction_NewEx(ml, funcobj->m_self, funcobj->m_module);
    6757             :     }
    6758             :     return PyStaticMethod_New(func);
    6759             :   }
    6760             :   
    6761             : #ifdef __cplusplus
    6762             : }
    6763             : #endif
    6764             : 
    6765             : /* -----------------------------------------------------------------------------*
    6766             :  *  Partial Init method
    6767             :  * -----------------------------------------------------------------------------*/
    6768             : 
    6769             : #ifdef __cplusplus
    6770             : extern "C"
    6771             : #endif
    6772             : 
    6773             : SWIGEXPORT 
    6774             : #if PY_VERSION_HEX >= 0x03000000
    6775             : PyObject*
    6776             : #else
    6777             : void
    6778             : #endif
    6779         228 : SWIG_init(void) {
    6780         228 :   PyObject *m, *d, *md, *globals;
    6781             :   
    6782             : #if PY_VERSION_HEX >= 0x03000000
    6783         228 :   static struct PyModuleDef SWIG_module = {
    6784             :     PyModuleDef_HEAD_INIT,
    6785             :     SWIG_name,
    6786             :     NULL,
    6787             :     -1,
    6788             :     SwigMethods,
    6789             :     NULL,
    6790             :     NULL,
    6791             :     NULL,
    6792             :     NULL
    6793             :   };
    6794             : #endif
    6795             :   
    6796             : #if defined(SWIGPYTHON_BUILTIN)
    6797             :   static SwigPyClientData SwigPyObject_clientdata = {
    6798             :     0, 0, 0, 0, 0, 0, 0
    6799             :   };
    6800             :   static PyGetSetDef this_getset_def = {
    6801             :     (char *)"this", &SwigPyBuiltin_ThisClosure, NULL, NULL, NULL
    6802             :   };
    6803             :   static SwigPyGetSet thisown_getset_closure = {
    6804             :     SwigPyObject_own,
    6805             :     SwigPyObject_own
    6806             :   };
    6807             :   static PyGetSetDef thisown_getset_def = {
    6808             :     (char *)"thisown", SwigPyBuiltin_GetterClosure, SwigPyBuiltin_SetterClosure, NULL, &thisown_getset_closure
    6809             :   };
    6810             :   PyTypeObject *builtin_pytype;
    6811             :   int builtin_base_count;
    6812             :   swig_type_info *builtin_basetype;
    6813             :   PyObject *tuple;
    6814             :   PyGetSetDescrObject *static_getset;
    6815             :   PyTypeObject *metatype;
    6816             :   PyTypeObject *swigpyobject;
    6817             :   SwigPyClientData *cd;
    6818             :   PyObject *public_interface, *public_symbol;
    6819             :   PyObject *this_descr;
    6820             :   PyObject *thisown_descr;
    6821             :   PyObject *self = 0;
    6822             :   int i;
    6823             :   
    6824             :   (void)builtin_pytype;
    6825             :   (void)builtin_base_count;
    6826             :   (void)builtin_basetype;
    6827             :   (void)tuple;
    6828             :   (void)static_getset;
    6829             :   (void)self;
    6830             :   
    6831             :   /* Metaclass is used to implement static member variables */
    6832             :   metatype = SwigPyObjectType();
    6833             :   assert(metatype);
    6834             : #endif
    6835             :   
    6836         228 :   (void)globals;
    6837             :   
    6838             :   /* Create singletons now to avoid potential deadlocks with multi-threaded usage after module initialization */
    6839         228 :   SWIG_This();
    6840         228 :   SWIG_Python_TypeCache();
    6841         228 :   SwigPyPacked_type();
    6842             : #ifndef SWIGPYTHON_BUILTIN
    6843         228 :   SwigPyObject_type();
    6844             : #endif
    6845             :   
    6846             :   /* Fix SwigMethods to carry the callback ptrs when needed */
    6847         228 :   SWIG_Python_FixMethods(SwigMethods, swig_const_table, swig_types, swig_type_initial);
    6848             :   
    6849             : #if PY_VERSION_HEX >= 0x03000000
    6850         228 :   m = PyModule_Create(&SWIG_module);
    6851             : #else
    6852             :   m = Py_InitModule(SWIG_name, SwigMethods);
    6853             : #endif
    6854             :   
    6855         228 :   md = d = PyModule_GetDict(m);
    6856         228 :   (void)md;
    6857             :   
    6858         228 :   SWIG_InitializeModule(0);
    6859             :   
    6860             : #ifdef SWIGPYTHON_BUILTIN
    6861             :   swigpyobject = SwigPyObject_TypeOnce();
    6862             :   
    6863             :   SwigPyObject_stype = SWIG_MangledTypeQuery("_p_SwigPyObject");
    6864             :   assert(SwigPyObject_stype);
    6865             :   cd = (SwigPyClientData*) SwigPyObject_stype->clientdata;
    6866             :   if (!cd) {
    6867             :     SwigPyObject_stype->clientdata = &SwigPyObject_clientdata;
    6868             :     SwigPyObject_clientdata.pytype = swigpyobject;
    6869             :   } else if (swigpyobject->tp_basicsize != cd->pytype->tp_basicsize) {
    6870             :     PyErr_SetString(PyExc_RuntimeError, "Import error: attempted to load two incompatible swig-generated modules.");
    6871             : # if PY_VERSION_HEX >= 0x03000000
    6872             :     return NULL;
    6873             : # else
    6874             :     return;
    6875             : # endif
    6876             :   }
    6877             :   
    6878             :   /* All objects have a 'this' attribute */
    6879             :   this_descr = PyDescr_NewGetSet(SwigPyObject_type(), &this_getset_def);
    6880             :   (void)this_descr;
    6881             :   
    6882             :   /* All objects have a 'thisown' attribute */
    6883             :   thisown_descr = PyDescr_NewGetSet(SwigPyObject_type(), &thisown_getset_def);
    6884             :   (void)thisown_descr;
    6885             :   
    6886             :   public_interface = PyList_New(0);
    6887             :   public_symbol = 0;
    6888             :   (void)public_symbol;
    6889             :   
    6890             :   PyDict_SetItemString(md, "__all__", public_interface);
    6891             :   Py_DECREF(public_interface);
    6892             :   for (i = 0; SwigMethods[i].ml_name != NULL; ++i)
    6893             :   SwigPyBuiltin_AddPublicSymbol(public_interface, SwigMethods[i].ml_name);
    6894             :   for (i = 0; swig_const_table[i].name != 0; ++i)
    6895             :   SwigPyBuiltin_AddPublicSymbol(public_interface, swig_const_table[i].name);
    6896             : #endif
    6897             :   
    6898         228 :   SWIG_InstallConstants(d,swig_const_table);
    6899             :   
    6900             :   
    6901             :   
    6902         228 :   if ( OGRGetDriverCount() == 0 ) {
    6903           0 :     OGRRegisterAll();
    6904             :   }
    6905             :   // Will be turned on for GDAL 4.0
    6906             :   // UseExceptions();
    6907             :   
    6908             :   
    6909         228 :   SWIG_Python_SetConstant(d, "GATDijkstraShortestPath",SWIG_From_int(static_cast< int >(GATDijkstraShortestPath)));
    6910         228 :   SWIG_Python_SetConstant(d, "GATKShortestPath",SWIG_From_int(static_cast< int >(GATKShortestPath)));
    6911         228 :   SWIG_Python_SetConstant(d, "GATConnectedComponents",SWIG_From_int(static_cast< int >(GATConnectedComponents)));
    6912         228 :   SWIG_Python_SetConstant(d, "GNM_EDGE_DIR_BOTH",SWIG_From_int(static_cast< int >(0)));
    6913         228 :   SWIG_Python_SetConstant(d, "GNM_EDGE_DIR_SRCTOTGT",SWIG_From_int(static_cast< int >(1)));
    6914         228 :   SWIG_Python_SetConstant(d, "GNM_EDGE_DIR_TGTTOSRC",SWIG_From_int(static_cast< int >(2)));
    6915             :   
    6916             :   /* Initialize threading */
    6917         228 :   SWIG_PYTHON_INITIALIZE_THREADS;
    6918             : #if PY_VERSION_HEX >= 0x03000000
    6919         228 :   return m;
    6920             : #else
    6921             :   return;
    6922             : #endif
    6923             : }
    6924             : 

Generated by: LCOV version 1.14