1 /* ----------------------------------------------------------------------------
2  * This file was automatically generated by SWIG (http://www.swig.org).
3  * Version 3.0.12
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 SWIGPERL
13 #define SWIGPERL
14 #endif
15 
16 #define SWIG_CASTRANK_MODE
17 
18 
19 #ifdef __cplusplus
20 /* SwigValueWrapper is described in swig.swg */
21 template<typename T> class SwigValueWrapper {
22   struct SwigMovePointer {
23     T *ptr;
SwigMovePointerSwigValueWrapper::SwigMovePointer24     SwigMovePointer(T *p) : ptr(p) { }
~SwigMovePointerSwigValueWrapper::SwigMovePointer25     ~SwigMovePointer() { delete ptr; }
operator =SwigValueWrapper::SwigMovePointer26     SwigMovePointer& operator=(SwigMovePointer& rhs) { T* oldptr = ptr; ptr = 0; delete oldptr; ptr = rhs.ptr; rhs.ptr = 0; return *this; }
27   } pointer;
28   SwigValueWrapper& operator=(const SwigValueWrapper<T>& rhs);
29   SwigValueWrapper(const SwigValueWrapper<T>& rhs);
30 public:
SwigValueWrapper()31   SwigValueWrapper() : pointer(0) { }
operator =(const T & t)32   SwigValueWrapper& operator=(const T& t) { SwigMovePointer tmp(new T(t)); pointer = tmp; return *this; }
operator T&() const33   operator T&() const { return *pointer.ptr; }
operator &()34   T *operator&() { return pointer.ptr; }
35 };
36 
SwigValueInit()37 template <typename T> T SwigValueInit() {
38   return T();
39 }
40 #endif
41 
42 /* -----------------------------------------------------------------------------
43  *  This section contains generic SWIG labels for method/variable
44  *  declarations/attributes, and other compiler dependent labels.
45  * ----------------------------------------------------------------------------- */
46 
47 /* template workaround for compilers that cannot correctly implement the C++ standard */
48 #ifndef SWIGTEMPLATEDISAMBIGUATOR
49 # if defined(__SUNPRO_CC) && (__SUNPRO_CC <= 0x560)
50 #  define SWIGTEMPLATEDISAMBIGUATOR template
51 # elif defined(__HP_aCC)
52 /* Needed even with `aCC -AA' when `aCC -V' reports HP ANSI C++ B3910B A.03.55 */
53 /* If we find a maximum version that requires this, the test would be __HP_aCC <= 35500 for A.03.55 */
54 #  define SWIGTEMPLATEDISAMBIGUATOR template
55 # else
56 #  define SWIGTEMPLATEDISAMBIGUATOR
57 # endif
58 #endif
59 
60 /* inline attribute */
61 #ifndef SWIGINLINE
62 # if defined(__cplusplus) || (defined(__GNUC__) && !defined(__STRICT_ANSI__))
63 #   define SWIGINLINE inline
64 # else
65 #   define SWIGINLINE
66 # endif
67 #endif
68 
69 /* attribute recognised by some compilers to avoid 'unused' warnings */
70 #ifndef SWIGUNUSED
71 # if defined(__GNUC__)
72 #   if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
73 #     define SWIGUNUSED __attribute__ ((__unused__))
74 #   else
75 #     define SWIGUNUSED
76 #   endif
77 # elif defined(__ICC)
78 #   define SWIGUNUSED __attribute__ ((__unused__))
79 # else
80 #   define SWIGUNUSED
81 # endif
82 #endif
83 
84 #ifndef SWIG_MSC_UNSUPPRESS_4505
85 # if defined(_MSC_VER)
86 #   pragma warning(disable : 4505) /* unreferenced local function has been removed */
87 # endif
88 #endif
89 
90 #ifndef SWIGUNUSEDPARM
91 # ifdef __cplusplus
92 #   define SWIGUNUSEDPARM(p)
93 # else
94 #   define SWIGUNUSEDPARM(p) p SWIGUNUSED
95 # endif
96 #endif
97 
98 /* internal SWIG method */
99 #ifndef SWIGINTERN
100 # define SWIGINTERN static SWIGUNUSED
101 #endif
102 
103 /* internal inline SWIG method */
104 #ifndef SWIGINTERNINLINE
105 # define SWIGINTERNINLINE SWIGINTERN SWIGINLINE
106 #endif
107 
108 /* exporting methods */
109 #if defined(__GNUC__)
110 #  if (__GNUC__ >= 4) || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)
111 #    ifndef GCC_HASCLASSVISIBILITY
112 #      define GCC_HASCLASSVISIBILITY
113 #    endif
114 #  endif
115 #endif
116 
117 #ifndef SWIGEXPORT
118 # if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__)
119 #   if defined(STATIC_LINKED)
120 #     define SWIGEXPORT
121 #   else
122 #     define SWIGEXPORT __declspec(dllexport)
123 #   endif
124 # else
125 #   if defined(__GNUC__) && defined(GCC_HASCLASSVISIBILITY)
126 #     define SWIGEXPORT __attribute__ ((visibility("default")))
127 #   else
128 #     define SWIGEXPORT
129 #   endif
130 # endif
131 #endif
132 
133 /* calling conventions for Windows */
134 #ifndef SWIGSTDCALL
135 # if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__)
136 #   define SWIGSTDCALL __stdcall
137 # else
138 #   define SWIGSTDCALL
139 # endif
140 #endif
141 
142 /* Deal with Microsoft's attempt at deprecating C standard runtime functions */
143 #if !defined(SWIG_NO_CRT_SECURE_NO_DEPRECATE) && defined(_MSC_VER) && !defined(_CRT_SECURE_NO_DEPRECATE)
144 # define _CRT_SECURE_NO_DEPRECATE
145 #endif
146 
147 /* Deal with Microsoft's attempt at deprecating methods in the standard C++ library */
148 #if !defined(SWIG_NO_SCL_SECURE_NO_DEPRECATE) && defined(_MSC_VER) && !defined(_SCL_SECURE_NO_DEPRECATE)
149 # define _SCL_SECURE_NO_DEPRECATE
150 #endif
151 
152 /* Deal with Apple's deprecated 'AssertMacros.h' from Carbon-framework */
153 #if defined(__APPLE__) && !defined(__ASSERT_MACROS_DEFINE_VERSIONS_WITHOUT_UNDERSCORES)
154 # define __ASSERT_MACROS_DEFINE_VERSIONS_WITHOUT_UNDERSCORES 0
155 #endif
156 
157 /* Intel's compiler complains if a variable which was never initialised is
158  * cast to void, which is a common idiom which we use to indicate that we
159  * are aware a variable isn't used.  So we just silence that warning.
160  * See: https://github.com/swig/swig/issues/192 for more discussion.
161  */
162 #ifdef __INTEL_COMPILER
163 # pragma warning disable 592
164 #endif
165 
166 /* -----------------------------------------------------------------------------
167  * swigrun.swg
168  *
169  * This file contains generic C API SWIG runtime support for pointer
170  * type checking.
171  * ----------------------------------------------------------------------------- */
172 
173 /* This should only be incremented when either the layout of swig_type_info changes,
174    or for whatever reason, the runtime changes incompatibly */
175 #define SWIG_RUNTIME_VERSION "4"
176 
177 /* define SWIG_TYPE_TABLE_NAME as "SWIG_TYPE_TABLE" */
178 #ifdef SWIG_TYPE_TABLE
179 # define SWIG_QUOTE_STRING(x) #x
180 # define SWIG_EXPAND_AND_QUOTE_STRING(x) SWIG_QUOTE_STRING(x)
181 # define SWIG_TYPE_TABLE_NAME SWIG_EXPAND_AND_QUOTE_STRING(SWIG_TYPE_TABLE)
182 #else
183 # define SWIG_TYPE_TABLE_NAME
184 #endif
185 
186 /*
187   You can use the SWIGRUNTIME and SWIGRUNTIMEINLINE macros for
188   creating a static or dynamic library from the SWIG runtime code.
189   In 99.9% of the cases, SWIG just needs to declare them as 'static'.
190 
191   But only do this if strictly necessary, ie, if you have problems
192   with your compiler or suchlike.
193 */
194 
195 #ifndef SWIGRUNTIME
196 # define SWIGRUNTIME SWIGINTERN
197 #endif
198 
199 #ifndef SWIGRUNTIMEINLINE
200 # define SWIGRUNTIMEINLINE SWIGRUNTIME SWIGINLINE
201 #endif
202 
203 /*  Generic buffer size */
204 #ifndef SWIG_BUFFER_SIZE
205 # define SWIG_BUFFER_SIZE 1024
206 #endif
207 
208 /* Flags for pointer conversions */
209 #define SWIG_POINTER_DISOWN        0x1
210 #define SWIG_CAST_NEW_MEMORY       0x2
211 
212 /* Flags for new pointer objects */
213 #define SWIG_POINTER_OWN           0x1
214 
215 
216 /*
217    Flags/methods for returning states.
218 
219    The SWIG conversion methods, as ConvertPtr, return an integer
220    that tells if the conversion was successful or not. And if not,
221    an error code can be returned (see swigerrors.swg for the codes).
222 
223    Use the following macros/flags to set or process the returning
224    states.
225 
226    In old versions of SWIG, code such as the following was usually written:
227 
228      if (SWIG_ConvertPtr(obj,vptr,ty.flags) != -1) {
229        // success code
230      } else {
231        //fail code
232      }
233 
234    Now you can be more explicit:
235 
236     int res = SWIG_ConvertPtr(obj,vptr,ty.flags);
237     if (SWIG_IsOK(res)) {
238       // success code
239     } else {
240       // fail code
241     }
242 
243    which is the same really, but now you can also do
244 
245     Type *ptr;
246     int res = SWIG_ConvertPtr(obj,(void **)(&ptr),ty.flags);
247     if (SWIG_IsOK(res)) {
248       // success code
249       if (SWIG_IsNewObj(res) {
250         ...
251 	delete *ptr;
252       } else {
253         ...
254       }
255     } else {
256       // fail code
257     }
258 
259    I.e., now SWIG_ConvertPtr can return new objects and you can
260    identify the case and take care of the deallocation. Of course that
261    also requires SWIG_ConvertPtr to return new result values, such as
262 
263       int SWIG_ConvertPtr(obj, ptr,...) {
264         if (<obj is ok>) {
265           if (<need new object>) {
266             *ptr = <ptr to new allocated object>;
267             return SWIG_NEWOBJ;
268           } else {
269             *ptr = <ptr to old object>;
270             return SWIG_OLDOBJ;
271           }
272         } else {
273           return SWIG_BADOBJ;
274         }
275       }
276 
277    Of course, returning the plain '0(success)/-1(fail)' still works, but you can be
278    more explicit by returning SWIG_BADOBJ, SWIG_ERROR or any of the
279    SWIG errors code.
280 
281    Finally, if the SWIG_CASTRANK_MODE is enabled, the result code
282    allows to return the 'cast rank', for example, if you have this
283 
284        int food(double)
285        int fooi(int);
286 
287    and you call
288 
289       food(1)   // cast rank '1'  (1 -> 1.0)
290       fooi(1)   // cast rank '0'
291 
292    just use the SWIG_AddCast()/SWIG_CheckState()
293 */
294 
295 #define SWIG_OK                    (0)
296 #define SWIG_ERROR                 (-1)
297 #define SWIG_IsOK(r)               (r >= 0)
298 #define SWIG_ArgError(r)           ((r != SWIG_ERROR) ? r : SWIG_TypeError)
299 
300 /* The CastRankLimit says how many bits are used for the cast rank */
301 #define SWIG_CASTRANKLIMIT         (1 << 8)
302 /* The NewMask denotes the object was created (using new/malloc) */
303 #define SWIG_NEWOBJMASK            (SWIG_CASTRANKLIMIT  << 1)
304 /* The TmpMask is for in/out typemaps that use temporal objects */
305 #define SWIG_TMPOBJMASK            (SWIG_NEWOBJMASK << 1)
306 /* Simple returning values */
307 #define SWIG_BADOBJ                (SWIG_ERROR)
308 #define SWIG_OLDOBJ                (SWIG_OK)
309 #define SWIG_NEWOBJ                (SWIG_OK | SWIG_NEWOBJMASK)
310 #define SWIG_TMPOBJ                (SWIG_OK | SWIG_TMPOBJMASK)
311 /* Check, add and del mask methods */
312 #define SWIG_AddNewMask(r)         (SWIG_IsOK(r) ? (r | SWIG_NEWOBJMASK) : r)
313 #define SWIG_DelNewMask(r)         (SWIG_IsOK(r) ? (r & ~SWIG_NEWOBJMASK) : r)
314 #define SWIG_IsNewObj(r)           (SWIG_IsOK(r) && (r & SWIG_NEWOBJMASK))
315 #define SWIG_AddTmpMask(r)         (SWIG_IsOK(r) ? (r | SWIG_TMPOBJMASK) : r)
316 #define SWIG_DelTmpMask(r)         (SWIG_IsOK(r) ? (r & ~SWIG_TMPOBJMASK) : r)
317 #define SWIG_IsTmpObj(r)           (SWIG_IsOK(r) && (r & SWIG_TMPOBJMASK))
318 
319 /* Cast-Rank Mode */
320 #if defined(SWIG_CASTRANK_MODE)
321 #  ifndef SWIG_TypeRank
322 #    define SWIG_TypeRank             unsigned long
323 #  endif
324 #  ifndef SWIG_MAXCASTRANK            /* Default cast allowed */
325 #    define SWIG_MAXCASTRANK          (2)
326 #  endif
327 #  define SWIG_CASTRANKMASK          ((SWIG_CASTRANKLIMIT) -1)
328 #  define SWIG_CastRank(r)           (r & SWIG_CASTRANKMASK)
SWIG_AddCast(int r)329 SWIGINTERNINLINE int SWIG_AddCast(int r) {
330   return SWIG_IsOK(r) ? ((SWIG_CastRank(r) < SWIG_MAXCASTRANK) ? (r + 1) : SWIG_ERROR) : r;
331 }
SWIG_CheckState(int r)332 SWIGINTERNINLINE int SWIG_CheckState(int r) {
333   return SWIG_IsOK(r) ? SWIG_CastRank(r) + 1 : 0;
334 }
335 #else /* no cast-rank mode */
336 #  define SWIG_AddCast(r) (r)
337 #  define SWIG_CheckState(r) (SWIG_IsOK(r) ? 1 : 0)
338 #endif
339 
340 
341 #include <string.h>
342 
343 #ifdef __cplusplus
344 extern "C" {
345 #endif
346 
347 typedef void *(*swig_converter_func)(void *, int *);
348 typedef struct swig_type_info *(*swig_dycast_func)(void **);
349 
350 /* Structure to store information on one type */
351 typedef struct swig_type_info {
352   const char             *name;			/* mangled name of this type */
353   const char             *str;			/* human readable name of this type */
354   swig_dycast_func        dcast;		/* dynamic cast function down a hierarchy */
355   struct swig_cast_info  *cast;			/* linked list of types that can cast into this type */
356   void                   *clientdata;		/* language specific type data */
357   int                    owndata;		/* flag if the structure owns the clientdata */
358 } swig_type_info;
359 
360 /* Structure to store a type and conversion function used for casting */
361 typedef struct swig_cast_info {
362   swig_type_info         *type;			/* pointer to type that is equivalent to this type */
363   swig_converter_func     converter;		/* function to cast the void pointers */
364   struct swig_cast_info  *next;			/* pointer to next cast in linked list */
365   struct swig_cast_info  *prev;			/* pointer to the previous cast */
366 } swig_cast_info;
367 
368 /* Structure used to store module information
369  * Each module generates one structure like this, and the runtime collects
370  * all of these structures and stores them in a circularly linked list.*/
371 typedef struct swig_module_info {
372   swig_type_info         **types;		/* Array of pointers to swig_type_info structures that are in this module */
373   size_t                 size;		        /* Number of types in this module */
374   struct swig_module_info *next;		/* Pointer to next element in circularly linked list */
375   swig_type_info         **type_initial;	/* Array of initially generated type structures */
376   swig_cast_info         **cast_initial;	/* Array of initially generated casting structures */
377   void                    *clientdata;		/* Language specific module data */
378 } swig_module_info;
379 
380 /*
381   Compare two type names skipping the space characters, therefore
382   "char*" == "char *" and "Class<int>" == "Class<int >", etc.
383 
384   Return 0 when the two name types are equivalent, as in
385   strncmp, but skipping ' '.
386 */
387 SWIGRUNTIME int
SWIG_TypeNameComp(const char * f1,const char * l1,const char * f2,const char * l2)388 SWIG_TypeNameComp(const char *f1, const char *l1,
389 		  const char *f2, const char *l2) {
390   for (;(f1 != l1) && (f2 != l2); ++f1, ++f2) {
391     while ((*f1 == ' ') && (f1 != l1)) ++f1;
392     while ((*f2 == ' ') && (f2 != l2)) ++f2;
393     if (*f1 != *f2) return (*f1 > *f2) ? 1 : -1;
394   }
395   return (int)((l1 - f1) - (l2 - f2));
396 }
397 
398 /*
399   Check type equivalence in a name list like <name1>|<name2>|...
400   Return 0 if equal, -1 if nb < tb, 1 if nb > tb
401 */
402 SWIGRUNTIME int
SWIG_TypeCmp(const char * nb,const char * tb)403 SWIG_TypeCmp(const char *nb, const char *tb) {
404   int equiv = 1;
405   const char* te = tb + strlen(tb);
406   const char* ne = nb;
407   while (equiv != 0 && *ne) {
408     for (nb = ne; *ne; ++ne) {
409       if (*ne == '|') break;
410     }
411     equiv = SWIG_TypeNameComp(nb, ne, tb, te);
412     if (*ne) ++ne;
413   }
414   return equiv;
415 }
416 
417 /*
418   Check type equivalence in a name list like <name1>|<name2>|...
419   Return 0 if not equal, 1 if equal
420 */
421 SWIGRUNTIME int
SWIG_TypeEquiv(const char * nb,const char * tb)422 SWIG_TypeEquiv(const char *nb, const char *tb) {
423   return SWIG_TypeCmp(nb, tb) == 0 ? 1 : 0;
424 }
425 
426 /*
427   Check the typename
428 */
429 SWIGRUNTIME swig_cast_info *
SWIG_TypeCheck(const char * c,swig_type_info * ty)430 SWIG_TypeCheck(const char *c, swig_type_info *ty) {
431   if (ty) {
432     swig_cast_info *iter = ty->cast;
433     while (iter) {
434       if (strcmp(iter->type->name, c) == 0) {
435         if (iter == ty->cast)
436           return iter;
437         /* Move iter to the top of the linked list */
438         iter->prev->next = iter->next;
439         if (iter->next)
440           iter->next->prev = iter->prev;
441         iter->next = ty->cast;
442         iter->prev = 0;
443         if (ty->cast) ty->cast->prev = iter;
444         ty->cast = iter;
445         return iter;
446       }
447       iter = iter->next;
448     }
449   }
450   return 0;
451 }
452 
453 /*
454   Identical to SWIG_TypeCheck, except strcmp is replaced with a pointer comparison
455 */
456 SWIGRUNTIME swig_cast_info *
SWIG_TypeCheckStruct(swig_type_info * from,swig_type_info * ty)457 SWIG_TypeCheckStruct(swig_type_info *from, swig_type_info *ty) {
458   if (ty) {
459     swig_cast_info *iter = ty->cast;
460     while (iter) {
461       if (iter->type == from) {
462         if (iter == ty->cast)
463           return iter;
464         /* Move iter to the top of the linked list */
465         iter->prev->next = iter->next;
466         if (iter->next)
467           iter->next->prev = iter->prev;
468         iter->next = ty->cast;
469         iter->prev = 0;
470         if (ty->cast) ty->cast->prev = iter;
471         ty->cast = iter;
472         return iter;
473       }
474       iter = iter->next;
475     }
476   }
477   return 0;
478 }
479 
480 /*
481   Cast a pointer up an inheritance hierarchy
482 */
483 SWIGRUNTIMEINLINE void *
SWIG_TypeCast(swig_cast_info * ty,void * ptr,int * newmemory)484 SWIG_TypeCast(swig_cast_info *ty, void *ptr, int *newmemory) {
485   return ((!ty) || (!ty->converter)) ? ptr : (*ty->converter)(ptr, newmemory);
486 }
487 
488 /*
489    Dynamic pointer casting. Down an inheritance hierarchy
490 */
491 SWIGRUNTIME swig_type_info *
SWIG_TypeDynamicCast(swig_type_info * ty,void ** ptr)492 SWIG_TypeDynamicCast(swig_type_info *ty, void **ptr) {
493   swig_type_info *lastty = ty;
494   if (!ty || !ty->dcast) return ty;
495   while (ty && (ty->dcast)) {
496     ty = (*ty->dcast)(ptr);
497     if (ty) lastty = ty;
498   }
499   return lastty;
500 }
501 
502 /*
503   Return the name associated with this type
504 */
505 SWIGRUNTIMEINLINE const char *
SWIG_TypeName(const swig_type_info * ty)506 SWIG_TypeName(const swig_type_info *ty) {
507   return ty->name;
508 }
509 
510 /*
511   Return the pretty name associated with this type,
512   that is an unmangled type name in a form presentable to the user.
513 */
514 SWIGRUNTIME const char *
SWIG_TypePrettyName(const swig_type_info * type)515 SWIG_TypePrettyName(const swig_type_info *type) {
516   /* The "str" field contains the equivalent pretty names of the
517      type, separated by vertical-bar characters.  We choose
518      to print the last name, as it is often (?) the most
519      specific. */
520   if (!type) return NULL;
521   if (type->str != NULL) {
522     const char *last_name = type->str;
523     const char *s;
524     for (s = type->str; *s; s++)
525       if (*s == '|') last_name = s+1;
526     return last_name;
527   }
528   else
529     return type->name;
530 }
531 
532 /*
533    Set the clientdata field for a type
534 */
535 SWIGRUNTIME void
SWIG_TypeClientData(swig_type_info * ti,void * clientdata)536 SWIG_TypeClientData(swig_type_info *ti, void *clientdata) {
537   swig_cast_info *cast = ti->cast;
538   /* if (ti->clientdata == clientdata) return; */
539   ti->clientdata = clientdata;
540 
541   while (cast) {
542     if (!cast->converter) {
543       swig_type_info *tc = cast->type;
544       if (!tc->clientdata) {
545 	SWIG_TypeClientData(tc, clientdata);
546       }
547     }
548     cast = cast->next;
549   }
550 }
551 SWIGRUNTIME void
SWIG_TypeNewClientData(swig_type_info * ti,void * clientdata)552 SWIG_TypeNewClientData(swig_type_info *ti, void *clientdata) {
553   SWIG_TypeClientData(ti, clientdata);
554   ti->owndata = 1;
555 }
556 
557 /*
558   Search for a swig_type_info structure only by mangled name
559   Search is a O(log #types)
560 
561   We start searching at module start, and finish searching when start == end.
562   Note: if start == end at the beginning of the function, we go all the way around
563   the circular list.
564 */
565 SWIGRUNTIME swig_type_info *
SWIG_MangledTypeQueryModule(swig_module_info * start,swig_module_info * end,const char * name)566 SWIG_MangledTypeQueryModule(swig_module_info *start,
567                             swig_module_info *end,
568 		            const char *name) {
569   swig_module_info *iter = start;
570   do {
571     if (iter->size) {
572       size_t l = 0;
573       size_t r = iter->size - 1;
574       do {
575 	/* since l+r >= 0, we can (>> 1) instead (/ 2) */
576 	size_t i = (l + r) >> 1;
577 	const char *iname = iter->types[i]->name;
578 	if (iname) {
579 	  int compare = strcmp(name, iname);
580 	  if (compare == 0) {
581 	    return iter->types[i];
582 	  } else if (compare < 0) {
583 	    if (i) {
584 	      r = i - 1;
585 	    } else {
586 	      break;
587 	    }
588 	  } else if (compare > 0) {
589 	    l = i + 1;
590 	  }
591 	} else {
592 	  break; /* should never happen */
593 	}
594       } while (l <= r);
595     }
596     iter = iter->next;
597   } while (iter != end);
598   return 0;
599 }
600 
601 /*
602   Search for a swig_type_info structure for either a mangled name or a human readable name.
603   It first searches the mangled names of the types, which is a O(log #types)
604   If a type is not found it then searches the human readable names, which is O(#types).
605 
606   We start searching at module start, and finish searching when start == end.
607   Note: if start == end at the beginning of the function, we go all the way around
608   the circular list.
609 */
610 SWIGRUNTIME swig_type_info *
SWIG_TypeQueryModule(swig_module_info * start,swig_module_info * end,const char * name)611 SWIG_TypeQueryModule(swig_module_info *start,
612                      swig_module_info *end,
613 		     const char *name) {
614   /* STEP 1: Search the name field using binary search */
615   swig_type_info *ret = SWIG_MangledTypeQueryModule(start, end, name);
616   if (ret) {
617     return ret;
618   } else {
619     /* STEP 2: If the type hasn't been found, do a complete search
620        of the str field (the human readable name) */
621     swig_module_info *iter = start;
622     do {
623       size_t i = 0;
624       for (; i < iter->size; ++i) {
625 	if (iter->types[i]->str && (SWIG_TypeEquiv(iter->types[i]->str, name)))
626 	  return iter->types[i];
627       }
628       iter = iter->next;
629     } while (iter != end);
630   }
631 
632   /* neither found a match */
633   return 0;
634 }
635 
636 /*
637    Pack binary data into a string
638 */
639 SWIGRUNTIME char *
SWIG_PackData(char * c,void * ptr,size_t sz)640 SWIG_PackData(char *c, void *ptr, size_t sz) {
641   static const char hex[17] = "0123456789abcdef";
642   const unsigned char *u = (unsigned char *) ptr;
643   const unsigned char *eu =  u + sz;
644   for (; u != eu; ++u) {
645     unsigned char uu = *u;
646     *(c++) = hex[(uu & 0xf0) >> 4];
647     *(c++) = hex[uu & 0xf];
648   }
649   return c;
650 }
651 
652 /*
653    Unpack binary data from a string
654 */
655 SWIGRUNTIME const char *
SWIG_UnpackData(const char * c,void * ptr,size_t sz)656 SWIG_UnpackData(const char *c, void *ptr, size_t sz) {
657   unsigned char *u = (unsigned char *) ptr;
658   const unsigned char *eu = u + sz;
659   for (; u != eu; ++u) {
660     char d = *(c++);
661     unsigned char uu;
662     if ((d >= '0') && (d <= '9'))
663       uu = (unsigned char)((d - '0') << 4);
664     else if ((d >= 'a') && (d <= 'f'))
665       uu = (unsigned char)((d - ('a'-10)) << 4);
666     else
667       return (char *) 0;
668     d = *(c++);
669     if ((d >= '0') && (d <= '9'))
670       uu |= (unsigned char)(d - '0');
671     else if ((d >= 'a') && (d <= 'f'))
672       uu |= (unsigned char)(d - ('a'-10));
673     else
674       return (char *) 0;
675     *u = uu;
676   }
677   return c;
678 }
679 
680 /*
681    Pack 'void *' into a string buffer.
682 */
683 SWIGRUNTIME char *
SWIG_PackVoidPtr(char * buff,void * ptr,const char * name,size_t bsz)684 SWIG_PackVoidPtr(char *buff, void *ptr, const char *name, size_t bsz) {
685   char *r = buff;
686   if ((2*sizeof(void *) + 2) > bsz) return 0;
687   *(r++) = '_';
688   r = SWIG_PackData(r,&ptr,sizeof(void *));
689   if (strlen(name) + 1 > (bsz - (r - buff))) return 0;
690   strcpy(r,name);
691   return buff;
692 }
693 
694 SWIGRUNTIME const char *
SWIG_UnpackVoidPtr(const char * c,void ** ptr,const char * name)695 SWIG_UnpackVoidPtr(const char *c, void **ptr, const char *name) {
696   if (*c != '_') {
697     if (strcmp(c,"NULL") == 0) {
698       *ptr = (void *) 0;
699       return name;
700     } else {
701       return 0;
702     }
703   }
704   return SWIG_UnpackData(++c,ptr,sizeof(void *));
705 }
706 
707 SWIGRUNTIME char *
SWIG_PackDataName(char * buff,void * ptr,size_t sz,const char * name,size_t bsz)708 SWIG_PackDataName(char *buff, void *ptr, size_t sz, const char *name, size_t bsz) {
709   char *r = buff;
710   size_t lname = (name ? strlen(name) : 0);
711   if ((2*sz + 2 + lname) > bsz) return 0;
712   *(r++) = '_';
713   r = SWIG_PackData(r,ptr,sz);
714   if (lname) {
715     strncpy(r,name,lname+1);
716   } else {
717     *r = 0;
718   }
719   return buff;
720 }
721 
722 SWIGRUNTIME const char *
SWIG_UnpackDataName(const char * c,void * ptr,size_t sz,const char * name)723 SWIG_UnpackDataName(const char *c, void *ptr, size_t sz, const char *name) {
724   if (*c != '_') {
725     if (strcmp(c,"NULL") == 0) {
726       memset(ptr,0,sz);
727       return name;
728     } else {
729       return 0;
730     }
731   }
732   return SWIG_UnpackData(++c,ptr,sz);
733 }
734 
735 #ifdef __cplusplus
736 }
737 #endif
738 
739 /*  Errors in SWIG */
740 #define  SWIG_UnknownError    	   -1
741 #define  SWIG_IOError        	   -2
742 #define  SWIG_RuntimeError   	   -3
743 #define  SWIG_IndexError     	   -4
744 #define  SWIG_TypeError      	   -5
745 #define  SWIG_DivisionByZero 	   -6
746 #define  SWIG_OverflowError  	   -7
747 #define  SWIG_SyntaxError    	   -8
748 #define  SWIG_ValueError     	   -9
749 #define  SWIG_SystemError    	   -10
750 #define  SWIG_AttributeError 	   -11
751 #define  SWIG_MemoryError    	   -12
752 #define  SWIG_NullReferenceError   -13
753 
754 
755 
756 #ifdef __cplusplus
757 /* Needed on some windows machines---since MS plays funny games with the header files under C++ */
758 #include <math.h>
759 #include <stdlib.h>
760 extern "C" {
761 #endif
762 #include "EXTERN.h"
763 #include "perl.h"
764 #include "XSUB.h"
765 
766 /* Add in functionality missing in older versions of Perl. Much of this is based on Devel-PPPort on cpan. */
767 
768 /* Add PERL_REVISION, PERL_VERSION, PERL_SUBVERSION if missing */
769 #ifndef PERL_REVISION
770 #  if !defined(__PATCHLEVEL_H_INCLUDED__) && !(defined(PATCHLEVEL) && defined(SUBVERSION))
771 #    define PERL_PATCHLEVEL_H_IMPLICIT
772 #    include <patchlevel.h>
773 #  endif
774 #  if !(defined(PERL_VERSION) || (defined(SUBVERSION) && defined(PATCHLEVEL)))
775 #    include <could_not_find_Perl_patchlevel.h>
776 #  endif
777 #  ifndef PERL_REVISION
778 #    define PERL_REVISION       (5)
779 #    define PERL_VERSION        PATCHLEVEL
780 #    define PERL_SUBVERSION     SUBVERSION
781 #  endif
782 #endif
783 
784 #if defined(WIN32) && defined(PERL_OBJECT) && !defined(PerlIO_exportFILE)
785 #define PerlIO_exportFILE(fh,fl) (FILE*)(fh)
786 #endif
787 
788 #ifndef SvIOK_UV
789 # define SvIOK_UV(sv)       (SvIOK(sv) && (SvUVX(sv) == SvIVX(sv)))
790 #endif
791 
792 #ifndef SvUOK
793 # define SvUOK(sv)           SvIOK_UV(sv)
794 #endif
795 
796 #if ((PERL_VERSION < 4) || ((PERL_VERSION == 4) && (PERL_SUBVERSION <= 5)))
797 #  define PL_sv_undef               sv_undef
798 #  define PL_na	                    na
799 #  define PL_errgv                  errgv
800 #  define PL_sv_no                  sv_no
801 #  define PL_sv_yes                 sv_yes
802 #  define PL_markstack_ptr          markstack_ptr
803 #endif
804 
805 #ifndef IVSIZE
806 #  ifdef LONGSIZE
807 #    define IVSIZE LONGSIZE
808 #  else
809 #    define IVSIZE 4 /* A bold guess, but the best we can make. */
810 #  endif
811 #endif
812 
813 #ifndef INT2PTR
814 #  if (IVSIZE == PTRSIZE) && (UVSIZE == PTRSIZE)
815 #    define PTRV                  UV
816 #    define INT2PTR(any,d)        (any)(d)
817 #  else
818 #    if PTRSIZE == LONGSIZE
819 #      define PTRV                unsigned long
820 #    else
821 #      define PTRV                unsigned
822 #    endif
823 #    define INT2PTR(any,d)        (any)(PTRV)(d)
824 #  endif
825 
826 #  define NUM2PTR(any,d)  (any)(PTRV)(d)
827 #  define PTR2IV(p)       INT2PTR(IV,p)
828 #  define PTR2UV(p)       INT2PTR(UV,p)
829 #  define PTR2NV(p)       NUM2PTR(NV,p)
830 
831 #  if PTRSIZE == LONGSIZE
832 #    define PTR2ul(p)     (unsigned long)(p)
833 #  else
834 #    define PTR2ul(p)     INT2PTR(unsigned long,p)
835 #  endif
836 #endif /* !INT2PTR */
837 
838 #ifndef SvPV_nolen
839 # define SvPV_nolen(x) SvPV(x,PL_na)
840 #endif
841 
842 #ifndef get_sv
843 #  define get_sv perl_get_sv
844 #endif
845 
846 #ifndef ERRSV
847 #  define ERRSV get_sv("@",FALSE)
848 #endif
849 
850 #ifndef pTHX_
851 #define pTHX_
852 #endif
853 
854 #include <string.h>
855 #ifdef __cplusplus
856 }
857 #endif
858 
859 /* -----------------------------------------------------------------------------
860  * error manipulation
861  * ----------------------------------------------------------------------------- */
862 
863 SWIGINTERN const char*
SWIG_Perl_ErrorType(int code)864 SWIG_Perl_ErrorType(int code) {
865   switch(code) {
866   case SWIG_MemoryError:
867     return "MemoryError";
868   case SWIG_IOError:
869     return "IOError";
870   case SWIG_RuntimeError:
871     return "RuntimeError";
872   case SWIG_IndexError:
873     return "IndexError";
874   case SWIG_TypeError:
875     return "TypeError";
876   case SWIG_DivisionByZero:
877     return "ZeroDivisionError";
878   case SWIG_OverflowError:
879     return "OverflowError";
880   case SWIG_SyntaxError:
881     return "SyntaxError";
882   case SWIG_ValueError:
883     return "ValueError";
884   case SWIG_SystemError:
885     return "SystemError";
886   case SWIG_AttributeError:
887     return "AttributeError";
888   default:
889     return "RuntimeError";
890   }
891 }
892 
893 
894 /* -----------------------------------------------------------------------------
895  * perlrun.swg
896  *
897  * This file contains the runtime support for Perl modules
898  * and includes code for managing global variables and pointer
899  * type checking.
900  * ----------------------------------------------------------------------------- */
901 
902 #ifdef PERL_OBJECT
903 #define SWIG_PERL_OBJECT_DECL CPerlObj *SWIGUNUSEDPARM(pPerl),
904 #define SWIG_PERL_OBJECT_CALL pPerl,
905 #else
906 #define SWIG_PERL_OBJECT_DECL
907 #define SWIG_PERL_OBJECT_CALL
908 #endif
909 
910 /* Common SWIG API */
911 
912 /* for raw pointers */
913 #define SWIG_ConvertPtr(obj, pp, type, flags)           SWIG_Perl_ConvertPtr(SWIG_PERL_OBJECT_CALL obj, pp, type, flags)
914 #define SWIG_ConvertPtrAndOwn(obj, pp, type, flags,own) SWIG_Perl_ConvertPtrAndOwn(SWIG_PERL_OBJECT_CALL obj, pp, type, flags, own)
915 #define SWIG_NewPointerObj(p, type, flags)              SWIG_Perl_NewPointerObj(SWIG_PERL_OBJECT_CALL p, type, flags)
916 #define swig_owntype                                    int
917 
918 /* for raw packed data */
919 #define SWIG_ConvertPacked(obj, p, s, type)             SWIG_Perl_ConvertPacked(SWIG_PERL_OBJECT_CALL obj, p, s, type)
920 #define SWIG_NewPackedObj(p, s, type)	                SWIG_Perl_NewPackedObj(SWIG_PERL_OBJECT_CALL p, s, type)
921 
922 /* for class or struct pointers */
923 #define SWIG_ConvertInstance(obj, pptr, type, flags)    SWIG_ConvertPtr(obj, pptr, type, flags)
924 #define SWIG_NewInstanceObj(ptr, type, flags)           SWIG_NewPointerObj(ptr, type, flags)
925 
926 /* for C or C++ function pointers */
927 #define SWIG_ConvertFunctionPtr(obj, pptr, type)        SWIG_ConvertPtr(obj, pptr, type, 0)
928 #define SWIG_NewFunctionPtrObj(ptr, type)               SWIG_NewPointerObj(ptr, type, 0)
929 
930 /* for C++ member pointers, ie, member methods */
931 #define SWIG_ConvertMember(obj, ptr, sz, ty)            SWIG_ConvertPacked(obj, ptr, sz, ty)
932 #define SWIG_NewMemberObj(ptr, sz, type)                SWIG_NewPackedObj(ptr, sz, type)
933 
934 
935 /* Runtime API */
936 
937 #define SWIG_GetModule(clientdata)                      SWIG_Perl_GetModule(clientdata)
938 #define SWIG_SetModule(clientdata, pointer)             SWIG_Perl_SetModule(pointer)
939 
940 
941 /* Error manipulation */
942 
943 #define SWIG_ErrorType(code)                            SWIG_Perl_ErrorType(code)
944 #define SWIG_Error(code, msg)            		sv_setpvf(get_sv("@", GV_ADD), "%s %s", SWIG_ErrorType(code), msg)
945 #define SWIG_fail                        		goto fail
946 
947 /* Perl-specific SWIG API */
948 
949 #define SWIG_MakePtr(sv, ptr, type, flags)              SWIG_Perl_MakePtr(SWIG_PERL_OBJECT_CALL sv, ptr, type, flags)
950 #define SWIG_MakePackedObj(sv, p, s, type)	        SWIG_Perl_MakePackedObj(SWIG_PERL_OBJECT_CALL sv, p, s, type)
951 #define SWIG_SetError(str)                              SWIG_Error(SWIG_RuntimeError, str)
952 
953 
954 #define SWIG_PERL_DECL_ARGS_1(arg1)                     (SWIG_PERL_OBJECT_DECL arg1)
955 #define SWIG_PERL_CALL_ARGS_1(arg1)                     (SWIG_PERL_OBJECT_CALL arg1)
956 #define SWIG_PERL_DECL_ARGS_2(arg1, arg2)               (SWIG_PERL_OBJECT_DECL arg1, arg2)
957 #define SWIG_PERL_CALL_ARGS_2(arg1, arg2)               (SWIG_PERL_OBJECT_CALL arg1, arg2)
958 
959 /* -----------------------------------------------------------------------------
960  * pointers/data manipulation
961  * ----------------------------------------------------------------------------- */
962 
963 /* For backward compatibility only */
964 #define SWIG_POINTER_EXCEPTION  0
965 
966 #ifdef __cplusplus
967 extern "C" {
968 #endif
969 
970 #define SWIG_OWNER   SWIG_POINTER_OWN
971 #define SWIG_SHADOW  SWIG_OWNER << 1
972 
973 #define SWIG_MAYBE_PERL_OBJECT SWIG_PERL_OBJECT_DECL
974 
975 /* SWIG Perl macros */
976 
977 /* Macro to declare an XS function */
978 #ifndef XSPROTO
979 #   define XSPROTO(name) void name(pTHX_ CV* cv)
980 #endif
981 
982 /* Macro to call an XS function */
983 #ifdef PERL_OBJECT
984 #  define SWIG_CALLXS(_name) _name(cv,pPerl)
985 #else
986 #  ifndef MULTIPLICITY
987 #    define SWIG_CALLXS(_name) _name(cv)
988 #  else
989 #    define SWIG_CALLXS(_name) _name(PERL_GET_THX, cv)
990 #  endif
991 #endif
992 
993 #ifdef PERL_OBJECT
994 #define MAGIC_PPERL  CPerlObj *pPerl = (CPerlObj *) this;
995 
996 #ifdef __cplusplus
997 extern "C" {
998 #endif
999 typedef int (CPerlObj::*SwigMagicFunc)(SV *, MAGIC *);
1000 #ifdef __cplusplus
1001 }
1002 #endif
1003 
1004 #define SWIG_MAGIC(a,b) (SV *a, MAGIC *b)
1005 #define SWIGCLASS_STATIC
1006 
1007 #else /* PERL_OBJECT */
1008 
1009 #define MAGIC_PPERL
1010 #define SWIGCLASS_STATIC static SWIGUNUSED
1011 
1012 #ifndef MULTIPLICITY
1013 #define SWIG_MAGIC(a,b) (SV *a, MAGIC *b)
1014 
1015 #ifdef __cplusplus
1016 extern "C" {
1017 #endif
1018 typedef int (*SwigMagicFunc)(SV *, MAGIC *);
1019 #ifdef __cplusplus
1020 }
1021 #endif
1022 
1023 #else /* MULTIPLICITY */
1024 
1025 #define SWIG_MAGIC(a,b) (struct interpreter *interp, SV *a, MAGIC *b)
1026 
1027 #ifdef __cplusplus
1028 extern "C" {
1029 #endif
1030 typedef int (*SwigMagicFunc)(struct interpreter *, SV *, MAGIC *);
1031 #ifdef __cplusplus
1032 }
1033 #endif
1034 
1035 #endif /* MULTIPLICITY */
1036 #endif /* PERL_OBJECT */
1037 
1038 #  ifdef PERL_OBJECT
1039 #    define SWIG_croak_null() SWIG_Perl_croak_null(pPerl)
SWIG_Perl_croak_null(CPerlObj * pPerl)1040 static void SWIGUNUSED SWIG_Perl_croak_null(CPerlObj *pPerl)
1041 #  else
1042 static void SWIGUNUSED SWIG_croak_null()
1043 #  endif
1044 {
1045   SV *err = get_sv("@", GV_ADD);
1046 #  if (PERL_VERSION < 6)
1047   croak("%_", err);
1048 #  else
1049   if (sv_isobject(err))
1050     croak(0);
1051   else
1052     croak("%s", SvPV_nolen(err));
1053 #  endif
1054 }
1055 
1056 
1057 /*
1058    Define how strict is the cast between strings and integers/doubles
1059    when overloading between these types occurs.
1060 
1061    The default is making it as strict as possible by using SWIG_AddCast
1062    when needed.
1063 
1064    You can use -DSWIG_PERL_NO_STRICT_STR2NUM at compilation time to
1065    disable the SWIG_AddCast, making the casting between string and
1066    numbers less strict.
1067 
1068    In the end, we try to solve the overloading between strings and
1069    numerical types in the more natural way, but if you can avoid it,
1070    well, avoid it using %rename, for example.
1071 */
1072 #ifndef SWIG_PERL_NO_STRICT_STR2NUM
1073 # ifndef SWIG_PERL_STRICT_STR2NUM
1074 #  define SWIG_PERL_STRICT_STR2NUM
1075 # endif
1076 #endif
1077 #ifdef SWIG_PERL_STRICT_STR2NUM
1078 /* string takes precedence */
1079 #define SWIG_Str2NumCast(x) SWIG_AddCast(x)
1080 #else
1081 /* number takes precedence */
1082 #define SWIG_Str2NumCast(x) x
1083 #endif
1084 
1085 
1086 
1087 #include <stdlib.h>
1088 
1089 SWIGRUNTIME const char *
SWIG_Perl_TypeProxyName(const swig_type_info * type)1090 SWIG_Perl_TypeProxyName(const swig_type_info *type) {
1091   if (!type) return NULL;
1092   if (type->clientdata != NULL) {
1093     return (const char*) type->clientdata;
1094   }
1095   else {
1096     return type->name;
1097   }
1098 }
1099 
1100 /* Identical to SWIG_TypeCheck, except for strcmp comparison */
1101 SWIGRUNTIME swig_cast_info *
SWIG_TypeProxyCheck(const char * c,swig_type_info * ty)1102 SWIG_TypeProxyCheck(const char *c, swig_type_info *ty) {
1103   if (ty) {
1104     swig_cast_info *iter = ty->cast;
1105     while (iter) {
1106       if (strcmp(SWIG_Perl_TypeProxyName(iter->type), c) == 0) {
1107         if (iter == ty->cast)
1108           return iter;
1109         /* Move iter to the top of the linked list */
1110         iter->prev->next = iter->next;
1111         if (iter->next)
1112           iter->next->prev = iter->prev;
1113         iter->next = ty->cast;
1114         iter->prev = 0;
1115         if (ty->cast) ty->cast->prev = iter;
1116         ty->cast = iter;
1117         return iter;
1118       }
1119       iter = iter->next;
1120     }
1121   }
1122   return 0;
1123 }
1124 
1125 /* Function for getting a pointer value */
1126 
1127 SWIGRUNTIME int
SWIG_Perl_ConvertPtrAndOwn(SWIG_MAYBE_PERL_OBJECT SV * sv,void ** ptr,swig_type_info * _t,int flags,int * own)1128 SWIG_Perl_ConvertPtrAndOwn(SWIG_MAYBE_PERL_OBJECT SV *sv, void **ptr, swig_type_info *_t, int flags, int *own) {
1129   swig_cast_info *tc;
1130   void *voidptr = (void *)0;
1131   SV *tsv = 0;
1132 
1133   if (own)
1134     *own = 0;
1135 
1136   /* If magical, apply more magic */
1137   if (SvGMAGICAL(sv))
1138     mg_get(sv);
1139 
1140   /* Check to see if this is an object */
1141   if (sv_isobject(sv)) {
1142     IV tmp = 0;
1143     tsv = (SV*) SvRV(sv);
1144     if ((SvTYPE(tsv) == SVt_PVHV)) {
1145       MAGIC *mg;
1146       if (SvMAGICAL(tsv)) {
1147         mg = mg_find(tsv,'P');
1148         if (mg) {
1149           sv = mg->mg_obj;
1150           if (sv_isobject(sv)) {
1151 	    tsv = (SV*)SvRV(sv);
1152             tmp = SvIV(tsv);
1153           }
1154         }
1155       } else {
1156         return SWIG_ERROR;
1157       }
1158     } else {
1159       tmp = SvIV(tsv);
1160     }
1161     voidptr = INT2PTR(void *,tmp);
1162   } else if (! SvOK(sv)) {            /* Check for undef */
1163     *(ptr) = (void *) 0;
1164     return SWIG_OK;
1165   } else if (SvTYPE(sv) == SVt_RV) {  /* Check for NULL pointer */
1166     if (!SvROK(sv)) {
1167       /* In Perl 5.12 and later, SVt_RV == SVt_IV, so sv could be a valid integer value.  */
1168       if (SvIOK(sv)) {
1169         return SWIG_ERROR;
1170       } else {
1171         /* NULL pointer (reference to undef). */
1172         *(ptr) = (void *) 0;
1173         return SWIG_OK;
1174       }
1175     } else {
1176       return SWIG_ERROR;
1177     }
1178   } else {                            /* Don't know what it is */
1179     return SWIG_ERROR;
1180   }
1181   if (_t) {
1182     /* Now see if the types match */
1183     char *_c = HvNAME(SvSTASH(SvRV(sv)));
1184     tc = SWIG_TypeProxyCheck(_c,_t);
1185 #ifdef SWIG_DIRECTORS
1186     if (!tc && !sv_derived_from(sv,SWIG_Perl_TypeProxyName(_t))) {
1187 #else
1188     if (!tc) {
1189 #endif
1190       return SWIG_ERROR;
1191     }
1192     {
1193       int newmemory = 0;
1194       *ptr = SWIG_TypeCast(tc,voidptr,&newmemory);
1195       if (newmemory == SWIG_CAST_NEW_MEMORY) {
1196         assert(own); /* badly formed typemap which will lead to a memory leak - it must set and use own to delete *ptr */
1197         if (own)
1198           *own = *own | SWIG_CAST_NEW_MEMORY;
1199       }
1200     }
1201   } else {
1202     *ptr = voidptr;
1203   }
1204 
1205   /*
1206    *  DISOWN implementation: we need a perl guru to check this one.
1207    */
1208   if (tsv && (flags & SWIG_POINTER_DISOWN)) {
1209     /*
1210      *  almost copy paste code from below SWIG_POINTER_OWN setting
1211      */
1212     SV *obj = sv;
1213     HV *stash = SvSTASH(SvRV(obj));
1214     GV *gv = *(GV**)hv_fetch(stash, "OWNER", 5, TRUE);
1215     if (isGV(gv)) {
1216       HV *hv = GvHVn(gv);
1217       /*
1218        * To set ownership (see below), a newSViv(1) entry is added.
1219        * Hence, to remove ownership, we delete the entry.
1220        */
1221       if (hv_exists_ent(hv, obj, 0)) {
1222 	hv_delete_ent(hv, obj, 0, 0);
1223       }
1224     }
1225   }
1226   return SWIG_OK;
1227 }
1228 
1229 SWIGRUNTIME int
1230 SWIG_Perl_ConvertPtr(SWIG_MAYBE_PERL_OBJECT SV *sv, void **ptr, swig_type_info *_t, int flags) {
1231   return SWIG_Perl_ConvertPtrAndOwn(sv, ptr, _t, flags, 0);
1232 }
1233 
1234 SWIGRUNTIME void
1235 SWIG_Perl_MakePtr(SWIG_MAYBE_PERL_OBJECT SV *sv, void *ptr, swig_type_info *t, int flags) {
1236   if (ptr && (flags & (SWIG_SHADOW | SWIG_POINTER_OWN))) {
1237     SV *self;
1238     SV *obj=newSV(0);
1239     HV *hash=newHV();
1240     HV *stash;
1241     sv_setref_pv(obj, SWIG_Perl_TypeProxyName(t), ptr);
1242     stash=SvSTASH(SvRV(obj));
1243     if (flags & SWIG_POINTER_OWN) {
1244       HV *hv;
1245       GV *gv = *(GV**)hv_fetch(stash, "OWNER", 5, TRUE);
1246       if (!isGV(gv))
1247         gv_init(gv, stash, "OWNER", 5, FALSE);
1248       hv=GvHVn(gv);
1249       hv_store_ent(hv, obj, newSViv(1), 0);
1250     }
1251     sv_magic((SV *)hash, (SV *)obj, 'P', Nullch, 0);
1252     SvREFCNT_dec(obj);
1253     self=newRV_noinc((SV *)hash);
1254     sv_setsv(sv, self);
1255     SvREFCNT_dec((SV *)self);
1256     sv_bless(sv, stash);
1257   }
1258   else {
1259     sv_setref_pv(sv, SWIG_Perl_TypeProxyName(t), ptr);
1260   }
1261 }
1262 
1263 SWIGRUNTIMEINLINE SV *
1264 SWIG_Perl_NewPointerObj(SWIG_MAYBE_PERL_OBJECT void *ptr, swig_type_info *t, int flags) {
1265   SV *result = sv_newmortal();
1266   SWIG_MakePtr(result, ptr, t, flags);
1267   return result;
1268 }
1269 
1270 SWIGRUNTIME void
1271 SWIG_Perl_MakePackedObj(SWIG_MAYBE_PERL_OBJECT SV *sv, void *ptr, int sz, swig_type_info *type) {
1272   char result[1024];
1273   char *r = result;
1274   if ((2*sz + 1 + strlen(SWIG_Perl_TypeProxyName(type))) > 1000) return;
1275   *(r++) = '_';
1276   r = SWIG_PackData(r,ptr,sz);
1277   strcpy(r,SWIG_Perl_TypeProxyName(type));
1278   sv_setpv(sv, result);
1279 }
1280 
1281 SWIGRUNTIME SV *
1282 SWIG_Perl_NewPackedObj(SWIG_MAYBE_PERL_OBJECT void *ptr, int sz, swig_type_info *type) {
1283   SV *result = sv_newmortal();
1284   SWIG_Perl_MakePackedObj(result, ptr, sz, type);
1285   return result;
1286 }
1287 
1288 /* Convert a packed value value */
1289 SWIGRUNTIME int
1290 SWIG_Perl_ConvertPacked(SWIG_MAYBE_PERL_OBJECT SV *obj, void *ptr, int sz, swig_type_info *ty) {
1291   swig_cast_info *tc;
1292   const char  *c = 0;
1293 
1294   if ((!obj) || (!SvOK(obj))) return SWIG_ERROR;
1295   c = SvPV_nolen(obj);
1296   /* Pointer values must start with leading underscore */
1297   if (*c != '_') return SWIG_ERROR;
1298   c++;
1299   c = SWIG_UnpackData(c,ptr,sz);
1300   if (ty) {
1301     tc = SWIG_TypeCheck(c,ty);
1302     if (!tc) return SWIG_ERROR;
1303   }
1304   return SWIG_OK;
1305 }
1306 
1307 
1308 /* Macros for low-level exception handling */
1309 #define SWIG_croak(x)    { SWIG_Error(SWIG_RuntimeError, x); SWIG_fail; }
1310 
1311 
1312 typedef XSPROTO(SwigPerlWrapper);
1313 typedef SwigPerlWrapper *SwigPerlWrapperPtr;
1314 
1315 /* Structure for command table */
1316 typedef struct {
1317   const char         *name;
1318   SwigPerlWrapperPtr  wrapper;
1319 } swig_command_info;
1320 
1321 /* Information for constant table */
1322 
1323 #define SWIG_INT     1
1324 #define SWIG_FLOAT   2
1325 #define SWIG_STRING  3
1326 #define SWIG_POINTER 4
1327 #define SWIG_BINARY  5
1328 
1329 /* Constant information structure */
1330 typedef struct swig_constant_info {
1331     int              type;
1332     const char      *name;
1333     long             lvalue;
1334     double           dvalue;
1335     void            *pvalue;
1336     swig_type_info **ptype;
1337 } swig_constant_info;
1338 
1339 
1340 /* Structure for variable table */
1341 typedef struct {
1342   const char   *name;
1343   SwigMagicFunc   set;
1344   SwigMagicFunc   get;
1345   swig_type_info  **type;
1346 } swig_variable_info;
1347 
1348 /* Magic variable code */
1349 #ifndef PERL_OBJECT
1350 # ifdef __cplusplus
1351 #  define swig_create_magic(s,a,b,c) _swig_create_magic(s,const_cast<char*>(a),b,c)
1352 # else
1353 #  define swig_create_magic(s,a,b,c) _swig_create_magic(s,(char*)(a),b,c)
1354 # endif
1355 # ifndef MULTIPLICITY
1356 SWIGRUNTIME void _swig_create_magic(SV *sv, char *name, int (*set)(SV *, MAGIC *), int (*get)(SV *,MAGIC *))
1357 # else
1358 SWIGRUNTIME void _swig_create_magic(SV *sv, char *name, int (*set)(struct interpreter*, SV *, MAGIC *), int (*get)(struct interpreter*, SV *,MAGIC *))
1359 # endif
1360 #else
1361 #  define swig_create_magic(s,a,b,c) _swig_create_magic(pPerl,s,a,b,c)
1362 SWIGRUNTIME void _swig_create_magic(CPerlObj *pPerl, SV *sv, const char *name, int (CPerlObj::*set)(SV *, MAGIC *), int (CPerlObj::*get)(SV *, MAGIC *))
1363 #endif
1364 {
1365   MAGIC *mg;
1366   sv_magic(sv,sv,'U',name,strlen(name));
1367   mg = mg_find(sv,'U');
1368   mg->mg_virtual = (MGVTBL *) malloc(sizeof(MGVTBL));
1369   mg->mg_virtual->svt_get = (SwigMagicFunc) get;
1370   mg->mg_virtual->svt_set = (SwigMagicFunc) set;
1371   mg->mg_virtual->svt_len = 0;
1372   mg->mg_virtual->svt_clear = 0;
1373   mg->mg_virtual->svt_free = 0;
1374 }
1375 
1376 
1377 SWIGRUNTIME swig_module_info *
1378 SWIG_Perl_GetModule(void *SWIGUNUSEDPARM(clientdata)) {
1379   static void *type_pointer = (void *)0;
1380   SV *pointer;
1381 
1382   /* first check if pointer already created */
1383   if (!type_pointer) {
1384     pointer = get_sv("swig_runtime_data::type_pointer" SWIG_RUNTIME_VERSION SWIG_TYPE_TABLE_NAME, FALSE | GV_ADDMULTI);
1385     if (pointer && SvOK(pointer)) {
1386       type_pointer = INT2PTR(swig_type_info **, SvIV(pointer));
1387     }
1388   }
1389 
1390   return (swig_module_info *) type_pointer;
1391 }
1392 
1393 SWIGRUNTIME void
1394 SWIG_Perl_SetModule(swig_module_info *module) {
1395   SV *pointer;
1396 
1397   /* create a new pointer */
1398   pointer = get_sv("swig_runtime_data::type_pointer" SWIG_RUNTIME_VERSION SWIG_TYPE_TABLE_NAME, TRUE | GV_ADDMULTI);
1399   sv_setiv(pointer, PTR2IV(module));
1400 }
1401 
1402 #ifdef __cplusplus
1403 }
1404 #endif
1405 
1406 /* Workaround perl5 global namespace pollution. Note that undefining library
1407  * functions like fopen will not solve the problem on all platforms as fopen
1408  * might be a macro on Windows but not necessarily on other operating systems. */
1409 #ifdef do_open
1410   #undef do_open
1411 #endif
1412 #ifdef do_close
1413   #undef do_close
1414 #endif
1415 #ifdef do_exec
1416   #undef do_exec
1417 #endif
1418 #ifdef scalar
1419   #undef scalar
1420 #endif
1421 #ifdef list
1422   #undef list
1423 #endif
1424 #ifdef apply
1425   #undef apply
1426 #endif
1427 #ifdef convert
1428   #undef convert
1429 #endif
1430 #ifdef Error
1431   #undef Error
1432 #endif
1433 #ifdef form
1434   #undef form
1435 #endif
1436 #ifdef vform
1437   #undef vform
1438 #endif
1439 #ifdef LABEL
1440   #undef LABEL
1441 #endif
1442 #ifdef METHOD
1443   #undef METHOD
1444 #endif
1445 #ifdef Move
1446   #undef Move
1447 #endif
1448 #ifdef yylex
1449   #undef yylex
1450 #endif
1451 #ifdef yyparse
1452   #undef yyparse
1453 #endif
1454 #ifdef yyerror
1455   #undef yyerror
1456 #endif
1457 #ifdef invert
1458   #undef invert
1459 #endif
1460 #ifdef ref
1461   #undef ref
1462 #endif
1463 #ifdef read
1464   #undef read
1465 #endif
1466 #ifdef write
1467   #undef write
1468 #endif
1469 #ifdef eof
1470   #undef eof
1471 #endif
1472 #ifdef close
1473   #undef close
1474 #endif
1475 #ifdef rewind
1476   #undef rewind
1477 #endif
1478 #ifdef free
1479   #undef free
1480 #endif
1481 #ifdef malloc
1482   #undef malloc
1483 #endif
1484 #ifdef calloc
1485   #undef calloc
1486 #endif
1487 #ifdef Stat
1488   #undef Stat
1489 #endif
1490 #ifdef check
1491   #undef check
1492 #endif
1493 #ifdef seekdir
1494   #undef seekdir
1495 #endif
1496 #ifdef open
1497   #undef open
1498 #endif
1499 #ifdef readdir
1500   #undef readdir
1501 #endif
1502 #ifdef bind
1503   #undef bind
1504 #endif
1505 #ifdef access
1506   #undef access
1507 #endif
1508 #ifdef stat
1509   #undef stat
1510 #endif
1511 #ifdef seed
1512   #undef seed
1513 #endif
1514 
1515 #ifdef bool
1516   /* Leave if macro is from C99 stdbool.h */
1517   #ifndef __bool_true_false_are_defined
1518     #undef bool
1519   #endif
1520 #endif
1521 
1522 
1523 
1524 
1525 #define SWIG_exception_fail(code, msg) do { SWIG_Error(code, msg); SWIG_fail; } while(0)
1526 
1527 #define SWIG_contract_assert(expr, msg) if (!(expr)) { SWIG_Error(SWIG_RuntimeError, msg); SWIG_fail; } else
1528 
1529 
1530 
1531   #define SWIG_exception(code, msg) do { SWIG_Error(code, msg); SWIG_fail;; } while(0)
1532 
1533 
1534 /* -------- TYPES TABLE (BEGIN) -------- */
1535 
1536 #define SWIGTYPE_p_GDALMajorObjectShadow swig_types[0]
1537 #define SWIGTYPE_p_GIntBig swig_types[1]
1538 #define SWIGTYPE_p_GNMGenericNetworkShadow swig_types[2]
1539 #define SWIGTYPE_p_GNMGraphAlgorithmType swig_types[3]
1540 #define SWIGTYPE_p_GNMNetworkShadow swig_types[4]
1541 #define SWIGTYPE_p_OGRFeatureShadow swig_types[5]
1542 #define SWIGTYPE_p_OGRLayerShadow swig_types[6]
1543 #define SWIGTYPE_p_OSRSpatialReferenceShadow swig_types[7]
1544 #define SWIGTYPE_p_char swig_types[8]
1545 #define SWIGTYPE_p_int swig_types[9]
1546 static swig_type_info *swig_types[11];
1547 static swig_module_info swig_module = {swig_types, 10, 0, 0, 0, 0};
1548 #define SWIG_TypeQuery(name) SWIG_TypeQueryModule(&swig_module, &swig_module, name)
1549 #define SWIG_MangledTypeQuery(name) SWIG_MangledTypeQueryModule(&swig_module, &swig_module, name)
1550 
1551 /* -------- TYPES TABLE (END) -------- */
1552 
1553 #define SWIG_init    boot_Geo__GNM
1554 
1555 #define SWIG_name   "Geo::GNMc::boot_Geo__GNM"
1556 #define SWIG_prefix "Geo::GNMc::"
1557 
1558 #define SWIGVERSION 0x030012
1559 #define SWIG_VERSION SWIGVERSION
1560 
1561 
1562 #define SWIG_as_voidptr(a) const_cast< void * >(static_cast< const void * >(a))
1563 #define SWIG_as_voidptrptr(a) ((void)SWIG_as_voidptr(*a),reinterpret_cast< void** >(a))
1564 
1565 
1566 #include <stdexcept>
1567 
1568 
1569 #ifdef __cplusplus
1570 extern "C"
1571 #endif
1572 #ifndef PERL_OBJECT
1573 #ifndef MULTIPLICITY
1574 SWIGEXPORT void SWIG_init (CV* cv);
1575 #else
1576 SWIGEXPORT void SWIG_init (pTHXo_ CV* cv);
1577 #endif
1578 #else
1579 SWIGEXPORT void SWIG_init (CV *cv, CPerlObj *);
1580 #endif
1581 
1582 
do_confess(const char * error,int push_to_error_stack)1583     void do_confess(const char *error, int push_to_error_stack) {
1584         SV *sv = newSVpv("", 0);
1585         sv_setpvf(sv, "%s\n", error);
1586         if (push_to_error_stack) {
1587             AV* error_stack = get_av("Geo::GDAL::error", 0);
1588             av_push(error_stack, sv);
1589         } else {
1590             sv = sv_2mortal(sv);
1591         }
1592         dSP;
1593         ENTER;
1594         SAVETMPS;
1595         PUSHMARK(SP);
1596         XPUSHs( sv );
1597         PUTBACK;
1598         call_pv("Carp::confess", G_DISCARD);
1599         /*
1600         confess never returns, so these will not get executed:
1601         FREETMPS;
1602         LEAVE;
1603         */
1604     }
1605     #define OUT_OF_MEMORY "Out of memory."
1606     #define CALL_FAILED "Call failed. Possible reason is an index out of range, mathematical problem, or something else."
1607     #define NEED_DEF "A parameter which must be defined or not empty, is not."
1608     #define WRONG_CLASS "Object has a wrong class."
1609     #define NEED_REF "A parameter which must be a reference, is not."
1610     #define NEED_HASH_REF "A parameter/item which must be a hash reference, is not."
1611     #define NEED_ARRAY_REF "A parameter/item which must be an array reference, is not."
1612     #define NEED_BINARY_DATA "A parameter which must be binary data, is not."
1613     #define NEED_CODE_REF "A parameter which must be an anonymous subroutine, is not."
1614     #define WRONG_ITEM_IN_ARRAY "An item in an array parameter has wrong type."
1615     #define ARRAY_TO_XML_FAILED "An array parameter cannot be converted to an XMLTree."
1616     #define NOT_ENOUGH_ELEMENTS "The supplied array does not have enough elements."
1617 
1618 
1619 #include <iostream>
1620 using namespace std;
1621 
1622 #define CPL_SUPRESS_CPLUSPLUS
1623 
1624 #include "gdal.h"
1625 #include "ogr_api.h"
1626 #include "ogr_core.h"
1627 #include "cpl_port.h"
1628 #include "cpl_string.h"
1629 #include "ogr_srs_api.h"
1630 #include "gnm_api.h"
1631 
1632 typedef void GDALMajorObjectShadow;
1633 typedef void GNMNetworkShadow;
1634 typedef void GNMGenericNetworkShadow;
1635 
1636 #ifdef DEBUG
1637 typedef struct OGRSpatialReferenceHS OSRSpatialReferenceShadow;
1638 #ifndef SWIGPERL
1639 typedef struct OGRDriverHS OGRDriverShadow;
1640 typedef struct OGRDataSourceHS OGRDataSourceShadow;
1641 #endif
1642 typedef struct OGRLayerHS OGRLayerShadow;
1643 typedef struct OGRFeatureHS OGRFeatureShadow;
1644 typedef struct OGRFeatureDefnHS OGRFeatureDefnShadow;
1645 typedef struct OGRGeometryHS OGRGeometryShadow;
1646 typedef struct OGRCoordinateTransformationHS OSRCoordinateTransformationShadow;
1647 typedef struct OGRCoordinateTransformationHS OGRCoordinateTransformationShadow;
1648 typedef struct OGRFieldDefnHS OGRFieldDefnShadow;
1649 #else
1650 typedef void OSRSpatialReferenceShadow;
1651 #ifndef SWIGPERL
1652 typedef void OGRDriverShadow;
1653 typedef void OGRDataSourceShadow;
1654 #endif
1655 typedef void OGRLayerShadow;
1656 typedef void OGRFeatureShadow;
1657 typedef void OGRFeatureDefnShadow;
1658 typedef void OGRGeometryShadow;
1659 typedef void OSRCoordinateTransformationShadow;
1660 typedef void OGRFieldDefnShadow;
1661 #endif
1662 typedef struct OGRStyleTableHS OGRStyleTableShadow;
1663 typedef struct OGRGeomFieldDefnHS OGRGeomFieldDefnShadow;
1664 
1665 
1666 SWIGINTERNINLINE SV *
SWIG_PERL_DECL_ARGS_1(long value)1667 SWIG_From_long  SWIG_PERL_DECL_ARGS_1(long value)
1668 {
1669   SV *sv;
1670   if (IVSIZE >= sizeof(value) || (value >= IV_MIN && value <= IV_MAX))
1671     sv = newSViv(value);
1672   else
1673     sv = newSVpvf("%ld", value);
1674   return sv_2mortal(sv);
1675 }
1676 
1677 
1678 SWIGINTERNINLINE SV *
SWIG_PERL_DECL_ARGS_1(int value)1679 SWIG_From_int  SWIG_PERL_DECL_ARGS_1(int value)
1680 {
1681   return SWIG_From_long  SWIG_PERL_CALL_ARGS_1(value);
1682 }
1683 
1684 
CastToNetwork(GDALMajorObjectShadow * base)1685   GNMNetworkShadow* CastToNetwork(GDALMajorObjectShadow* base) {
1686       return (GNMNetworkShadow*)GNMCastToNetwork((GDALMajorObjectH)base);
1687   }
1688 
1689 
CastToGenericNetwork(GDALMajorObjectShadow * base)1690   GNMGenericNetworkShadow* CastToGenericNetwork(GDALMajorObjectShadow* base) {
1691       return (GNMGenericNetworkShadow*)GNMCastToGenericNetwork((GDALMajorObjectH)base);
1692   }
1693 
delete_GNMNetworkShadow(GNMNetworkShadow * self)1694 SWIGINTERN void delete_GNMNetworkShadow(GNMNetworkShadow *self){
1695             if ( GDALDereferenceDataset( self ) <= 0 ) {
1696               GDALClose(self);
1697             }
1698         }
GNMNetworkShadow_ReleaseResultSet(GNMNetworkShadow * self,OGRLayerShadow * layer)1699 SWIGINTERN void GNMNetworkShadow_ReleaseResultSet(GNMNetworkShadow *self,OGRLayerShadow *layer){
1700             GDALDatasetReleaseResultSet(self, layer);
1701         }
GNMNetworkShadow_GetVersion(GNMNetworkShadow * self)1702 SWIGINTERN int GNMNetworkShadow_GetVersion(GNMNetworkShadow *self){
1703             return GNMGetVersion(self);
1704         }
GNMNetworkShadow_GetName(GNMNetworkShadow * self)1705 SWIGINTERN char const *GNMNetworkShadow_GetName(GNMNetworkShadow *self){
1706             return GNMGetName(self);
1707         }
GNMNetworkShadow_GetFeatureByGlobalFID(GNMNetworkShadow * self,GIntBig GFID)1708 SWIGINTERN OGRFeatureShadow *GNMNetworkShadow_GetFeatureByGlobalFID(GNMNetworkShadow *self,GIntBig GFID){
1709             return GNMGetFeatureByGlobalFID(self, GFID);
1710         }
1711 
1712 #include <limits.h>
1713 #if !defined(SWIG_NO_LLONG_MAX)
1714 # if !defined(LLONG_MAX) && defined(__GNUC__) && defined (__LONG_LONG_MAX__)
1715 #   define LLONG_MAX __LONG_LONG_MAX__
1716 #   define LLONG_MIN (-LLONG_MAX - 1LL)
1717 #   define ULLONG_MAX (LLONG_MAX * 2ULL + 1ULL)
1718 # endif
1719 #endif
1720 
1721 
1722 #include <stdlib.h>
1723 #ifdef _MSC_VER
1724 # ifndef strtoull
1725 #  define strtoull _strtoui64
1726 # endif
1727 # ifndef strtoll
1728 #  define strtoll _strtoi64
1729 # endif
1730 #endif
1731 
1732 
1733 SWIGINTERN int
SWIG_PERL_DECL_ARGS_2(SV * obj,double * val)1734 SWIG_AsVal_double SWIG_PERL_DECL_ARGS_2(SV *obj, double *val)
1735 {
1736   if (SvNIOK(obj)) {
1737     if (val) *val = SvNV(obj);
1738     return SWIG_OK;
1739   } else if (SvIOK(obj)) {
1740     if (val) *val = (double) SvIV(obj);
1741     return SWIG_AddCast(SWIG_OK);
1742   } else {
1743     const char *nptr = SvPV_nolen(obj);
1744     if (nptr) {
1745       char *endptr;
1746       double v;
1747       errno = 0;
1748       v = strtod(nptr, &endptr);
1749       if (errno == ERANGE) {
1750 	errno = 0;
1751 	return SWIG_OverflowError;
1752       } else {
1753 	if (*endptr == '\0') {
1754 	  if (val) *val = v;
1755 	  return SWIG_Str2NumCast(SWIG_OK);
1756 	}
1757       }
1758     }
1759   }
1760   return SWIG_TypeError;
1761 }
1762 
1763 
1764 #include <float.h>
1765 
1766 
1767 #include <math.h>
1768 
1769 
1770 SWIGINTERNINLINE int
SWIG_CanCastAsInteger(double * d,double min,double max)1771 SWIG_CanCastAsInteger(double *d, double min, double max) {
1772   double x = *d;
1773   if ((min <= x && x <= max)) {
1774    double fx = floor(x);
1775    double cx = ceil(x);
1776    double rd =  ((x - fx) < 0.5) ? fx : cx; /* simple rint */
1777    if ((errno == EDOM) || (errno == ERANGE)) {
1778      errno = 0;
1779    } else {
1780      double summ, reps, diff;
1781      if (rd < x) {
1782        diff = x - rd;
1783      } else if (rd > x) {
1784        diff = rd - x;
1785      } else {
1786        return 1;
1787      }
1788      summ = rd + x;
1789      reps = diff/summ;
1790      if (reps < 8*DBL_EPSILON) {
1791        *d = rd;
1792        return 1;
1793      }
1794    }
1795   }
1796   return 0;
1797 }
1798 
1799 
1800 SWIGINTERN int
SWIG_PERL_DECL_ARGS_2(SV * obj,long * val)1801 SWIG_AsVal_long SWIG_PERL_DECL_ARGS_2(SV *obj, long* val)
1802 {
1803   if (SvUOK(obj)) {
1804     UV v = SvUV(obj);
1805     if (UVSIZE < sizeof(*val) || v <= LONG_MAX) {
1806       if (val) *val = v;
1807       return SWIG_OK;
1808     }
1809     return SWIG_OverflowError;
1810   } else if (SvIOK(obj)) {
1811     IV v = SvIV(obj);
1812     if (IVSIZE <= sizeof(*val) || (v >= LONG_MIN && v <= LONG_MAX)) {
1813       if(val) *val = v;
1814       return SWIG_OK;
1815     }
1816     return SWIG_OverflowError;
1817   } else {
1818     int dispatch = 0;
1819     const char *nptr = SvPV_nolen(obj);
1820     if (nptr) {
1821       char *endptr;
1822       long v;
1823       errno = 0;
1824       v = strtol(nptr, &endptr,0);
1825       if (errno == ERANGE) {
1826 	errno = 0;
1827 	return SWIG_OverflowError;
1828       } else {
1829 	if (*endptr == '\0') {
1830 	  if (val) *val = v;
1831 	  return SWIG_Str2NumCast(SWIG_OK);
1832 	}
1833       }
1834     }
1835     if (!dispatch) {
1836       double d;
1837       int res = SWIG_AddCast(SWIG_AsVal_double SWIG_PERL_CALL_ARGS_2(obj,&d));
1838       if (SWIG_IsOK(res) && SWIG_CanCastAsInteger(&d, LONG_MIN, LONG_MAX)) {
1839 	if (val) *val = (long)(d);
1840 	return res;
1841       }
1842     }
1843   }
1844   return SWIG_TypeError;
1845 }
1846 
1847 
1848 SWIGINTERN int
SWIG_PERL_DECL_ARGS_2(SV * obj,int * val)1849 SWIG_AsVal_int SWIG_PERL_DECL_ARGS_2(SV * obj, int *val)
1850 {
1851   long v;
1852   int res = SWIG_AsVal_long SWIG_PERL_CALL_ARGS_2(obj, &v);
1853   if (SWIG_IsOK(res)) {
1854     if ((v < INT_MIN || v > INT_MAX)) {
1855       return SWIG_OverflowError;
1856     } else {
1857       if (val) *val = static_cast< int >(v);
1858     }
1859   }
1860   return res;
1861 }
1862 
1863 
sv_to_utf8_string(SV * sv,U8 ** tmpbuf,bool * safefree=NULL)1864     char *sv_to_utf8_string(SV *sv, U8 **tmpbuf, bool *safefree = NULL) {
1865         /* if tmpbuf is given, only tmpbuf needs to be freed, use Safefree!
1866            if not, ret needs to be freed, if safefree use Safefree else use free! */
1867         char *ret;
1868         if (safefree) *safefree = false;
1869         if (SvOK(sv)) {
1870             STRLEN len;
1871             ret = SvPV(sv, len);
1872             if (!SvUTF8(sv)) {
1873                 if (tmpbuf) {
1874                     *tmpbuf = bytes_to_utf8((const U8*)ret, &len);
1875                     ret = (char *)(*tmpbuf);
1876                 } else {
1877                     ret = (char *)bytes_to_utf8((const U8*)ret, &len);
1878                 }
1879                 if (safefree) *safefree = true;
1880             } else {
1881                 if (!tmpbuf)
1882                     ret = strdup(ret);
1883             }
1884         } else {
1885             ret = (char*)""; /* avoid "Use of uninitialized value in subroutine entry" errors */
1886             if (!tmpbuf)
1887                 ret = strdup(ret);
1888         }
1889         return ret;
1890     }
1891 
GNMNetworkShadow_GetPath(GNMNetworkShadow * self,GIntBig nStartFID,GIntBig nEndFID,GNMGraphAlgorithmType eAlgorithm,char ** options=0)1892 SWIGINTERN OGRLayerShadow *GNMNetworkShadow_GetPath(GNMNetworkShadow *self,GIntBig nStartFID,GIntBig nEndFID,GNMGraphAlgorithmType eAlgorithm,char **options=0){
1893             return GNMGetPath(self, nStartFID, nEndFID, eAlgorithm, options);
1894         }
GNMNetworkShadow_DisconnectAll(GNMNetworkShadow * self)1895 SWIGINTERN CPLErr GNMNetworkShadow_DisconnectAll(GNMNetworkShadow *self){
1896             return GNMDisconnectAll( self );
1897         }
GNMNetworkShadow_GetProjection(GNMNetworkShadow * self)1898 SWIGINTERN char const *GNMNetworkShadow_GetProjection(GNMNetworkShadow *self){
1899             return GDALGetProjectionRef( self );
1900         }
GNMNetworkShadow_GetProjectionRef(GNMNetworkShadow * self)1901 SWIGINTERN char const *GNMNetworkShadow_GetProjectionRef(GNMNetworkShadow *self){
1902             return GDALGetProjectionRef( self );
1903         }
GNMNetworkShadow_GetFileList(GNMNetworkShadow * self)1904 SWIGINTERN char **GNMNetworkShadow_GetFileList(GNMNetworkShadow *self){
1905             return GDALGetFileList( self );
1906         }
1907 
1908 SWIGINTERN swig_type_info*
SWIG_pchar_descriptor(void)1909 SWIG_pchar_descriptor(void)
1910 {
1911   static int init = 0;
1912   static swig_type_info* info = 0;
1913   if (!init) {
1914     info = SWIG_TypeQuery("_p_char");
1915     init = 1;
1916   }
1917   return info;
1918 }
1919 
1920 
1921 SWIGINTERN int
SWIG_AsCharPtrAndSize(SV * obj,char ** cptr,size_t * psize,int * alloc)1922 SWIG_AsCharPtrAndSize(SV *obj, char** cptr, size_t* psize, int *alloc)
1923 {
1924   if (SvMAGICAL(obj)) {
1925      SV *tmp = sv_newmortal();
1926      SvSetSV(tmp, obj);
1927      obj = tmp;
1928   }
1929   if (SvPOK(obj)) {
1930     STRLEN len = 0;
1931     char *cstr = SvPV(obj, len);
1932     size_t size = len + 1;
1933     if (cptr)  {
1934       if (alloc) {
1935 	if (*alloc == SWIG_NEWOBJ) {
1936 	  *cptr = reinterpret_cast< char* >(memcpy(new char[size], cstr, sizeof(char)*(size)));
1937 	} else {
1938 	  *cptr = cstr;
1939 	  *alloc = SWIG_OLDOBJ;
1940 	}
1941       }
1942     }
1943     if (psize) *psize = size;
1944     return SWIG_OK;
1945   } else {
1946     swig_type_info* pchar_descriptor = SWIG_pchar_descriptor();
1947     if (pchar_descriptor) {
1948       char* vptr = 0;
1949       if (SWIG_ConvertPtr(obj, (void**)&vptr, pchar_descriptor, 0) == SWIG_OK) {
1950 	if (cptr) *cptr = vptr;
1951 	if (psize) *psize = vptr ? (strlen(vptr) + 1) : 0;
1952 	if (alloc) *alloc = SWIG_OLDOBJ;
1953 	return SWIG_OK;
1954       }
1955     }
1956   }
1957   return SWIG_TypeError;
1958 }
1959 
1960 
1961 
1962 
GNMNetworkShadow_CreateLayer(GNMNetworkShadow * self,char const * name,OSRSpatialReferenceShadow * srs=NULL,OGRwkbGeometryType geom_type=wkbUnknown,char ** options=0)1963 SWIGINTERN OGRLayerShadow *GNMNetworkShadow_CreateLayer(GNMNetworkShadow *self,char const *name,OSRSpatialReferenceShadow *srs=NULL,OGRwkbGeometryType geom_type=wkbUnknown,char **options=0){
1964             OGRLayerShadow* layer = (OGRLayerShadow*) GDALDatasetCreateLayer( self,
1965                                       name,
1966                                       srs,
1967                                       geom_type,
1968                                       options);
1969             return layer;
1970         }
GNMNetworkShadow_CopyLayer(GNMNetworkShadow * self,OGRLayerShadow * src_layer,char const * new_name,char ** options=0)1971 SWIGINTERN OGRLayerShadow *GNMNetworkShadow_CopyLayer(GNMNetworkShadow *self,OGRLayerShadow *src_layer,char const *new_name,char **options=0){
1972             OGRLayerShadow* layer = (OGRLayerShadow*) GDALDatasetCopyLayer( self,
1973                                                       src_layer,
1974                                                       new_name,
1975                                                       options);
1976             return layer;
1977         }
GNMNetworkShadow_DeleteLayer(GNMNetworkShadow * self,int index)1978 SWIGINTERN OGRErr GNMNetworkShadow_DeleteLayer(GNMNetworkShadow *self,int index){
1979             return GDALDatasetDeleteLayer(self, index);
1980         }
1981 
1982 
1983 #include "ogr_core.h"
1984 static char const *
OGRErrMessages(int rc)1985 OGRErrMessages( int rc ) {
1986   switch( rc ) {
1987   case OGRERR_NONE:
1988     return "OGR Error: None";
1989   case OGRERR_NOT_ENOUGH_DATA:
1990     return "OGR Error: Not enough data to deserialize";
1991   case OGRERR_NOT_ENOUGH_MEMORY:
1992     return "OGR Error: Not enough memory";
1993   case OGRERR_UNSUPPORTED_GEOMETRY_TYPE:
1994     return "OGR Error: Unsupported geometry type";
1995   case OGRERR_UNSUPPORTED_OPERATION:
1996     return "OGR Error: Unsupported operation";
1997   case OGRERR_CORRUPT_DATA:
1998     return "OGR Error: Corrupt data";
1999   case OGRERR_FAILURE:
2000     return "OGR Error: General Error";
2001   case OGRERR_UNSUPPORTED_SRS:
2002     return "OGR Error: Unsupported SRS";
2003   case OGRERR_INVALID_HANDLE:
2004     return "OGR Error: Invalid handle";
2005   case OGRERR_NON_EXISTING_FEATURE:
2006     return "OGR Error: Non existing feature";
2007   default:
2008     return "OGR Error: Unknown";
2009   }
2010 }
2011 
GNMNetworkShadow_GetLayerCount(GNMNetworkShadow * self)2012 SWIGINTERN int GNMNetworkShadow_GetLayerCount(GNMNetworkShadow *self){
2013             return GDALDatasetGetLayerCount(self);
2014         }
GNMNetworkShadow_GetLayerByIndex(GNMNetworkShadow * self,int index=0)2015 SWIGINTERN OGRLayerShadow *GNMNetworkShadow_GetLayerByIndex(GNMNetworkShadow *self,int index=0){
2016 
2017         OGRLayerShadow* layer = (OGRLayerShadow*) GDALDatasetGetLayer(self,
2018                                                                       index);
2019             return layer;
2020         }
GNMNetworkShadow_GetLayerByName(GNMNetworkShadow * self,char const * layer_name)2021 SWIGINTERN OGRLayerShadow *GNMNetworkShadow_GetLayerByName(GNMNetworkShadow *self,char const *layer_name){
2022             OGRLayerShadow* layer =
2023                   (OGRLayerShadow*) GDALDatasetGetLayerByName(self, layer_name);
2024             return layer;
2025         }
GNMNetworkShadow_TestCapability(GNMNetworkShadow * self,char const * cap)2026 SWIGINTERN bool GNMNetworkShadow_TestCapability(GNMNetworkShadow *self,char const *cap){
2027             return (GDALDatasetTestCapability(self, cap) > 0);
2028         }
2029 
2030 SWIGINTERNINLINE SV *
SWIG_PERL_DECL_ARGS_1(bool value)2031 SWIG_From_bool  SWIG_PERL_DECL_ARGS_1(bool value)
2032 {
2033   return boolSV(value);
2034 }
2035 
GNMNetworkShadow_StartTransaction(GNMNetworkShadow * self,int force=FALSE)2036 SWIGINTERN OGRErr GNMNetworkShadow_StartTransaction(GNMNetworkShadow *self,int force=FALSE){
2037             return GDALDatasetStartTransaction(self, force);
2038         }
GNMNetworkShadow_CommitTransaction(GNMNetworkShadow * self)2039 SWIGINTERN OGRErr GNMNetworkShadow_CommitTransaction(GNMNetworkShadow *self){
2040             return GDALDatasetCommitTransaction(self);
2041         }
GNMNetworkShadow_RollbackTransaction(GNMNetworkShadow * self)2042 SWIGINTERN OGRErr GNMNetworkShadow_RollbackTransaction(GNMNetworkShadow *self){
2043             return GDALDatasetRollbackTransaction(self);
2044         }
delete_GNMGenericNetworkShadow(GNMGenericNetworkShadow * self)2045 SWIGINTERN void delete_GNMGenericNetworkShadow(GNMGenericNetworkShadow *self){
2046             if ( GDALDereferenceDataset( self ) <= 0 ) {
2047               GDALClose(self);
2048             }
2049         }
GNMGenericNetworkShadow_ConnectFeatures(GNMGenericNetworkShadow * self,GIntBig nSrcFID,GIntBig nTgtFID,GIntBig nConFID,double dfCost,double dfInvCost,GNMDirection eDir)2050 SWIGINTERN CPLErr GNMGenericNetworkShadow_ConnectFeatures(GNMGenericNetworkShadow *self,GIntBig nSrcFID,GIntBig nTgtFID,GIntBig nConFID,double dfCost,double dfInvCost,GNMDirection eDir){
2051             return GNMConnectFeatures(self, nSrcFID, nTgtFID,
2052                                               nConFID, dfCost, dfInvCost, eDir);
2053         }
GNMGenericNetworkShadow_DisconnectFeatures(GNMGenericNetworkShadow * self,GIntBig nSrcFID,GIntBig nTgtFID,GIntBig nConFID)2054 SWIGINTERN CPLErr GNMGenericNetworkShadow_DisconnectFeatures(GNMGenericNetworkShadow *self,GIntBig nSrcFID,GIntBig nTgtFID,GIntBig nConFID){
2055             return GNMDisconnectFeatures(self, nSrcFID, nTgtFID,
2056                                                            nConFID);
2057         }
GNMGenericNetworkShadow_DisconnectFeaturesWithId(GNMGenericNetworkShadow * self,GIntBig nFID)2058 SWIGINTERN CPLErr GNMGenericNetworkShadow_DisconnectFeaturesWithId(GNMGenericNetworkShadow *self,GIntBig nFID){
2059             return GNMDisconnectFeaturesWithId(self, nFID);
2060         }
GNMGenericNetworkShadow_ReconnectFeatures(GNMGenericNetworkShadow * self,GIntBig nSrcFID,GIntBig nTgtFID,GIntBig nConFID,double dfCost,double dfInvCost,GNMDirection eDir)2061 SWIGINTERN CPLErr GNMGenericNetworkShadow_ReconnectFeatures(GNMGenericNetworkShadow *self,GIntBig nSrcFID,GIntBig nTgtFID,GIntBig nConFID,double dfCost,double dfInvCost,GNMDirection eDir){
2062             return GNMReconnectFeatures(self, nSrcFID, nTgtFID, nConFID, dfCost, dfInvCost, eDir);
2063         }
GNMGenericNetworkShadow_CreateRule(GNMGenericNetworkShadow * self,char const * pszRuleStr)2064 SWIGINTERN CPLErr GNMGenericNetworkShadow_CreateRule(GNMGenericNetworkShadow *self,char const *pszRuleStr){
2065             return GNMCreateRule(self, pszRuleStr);
2066         }
GNMGenericNetworkShadow_DeleteAllRules(GNMGenericNetworkShadow * self)2067 SWIGINTERN CPLErr GNMGenericNetworkShadow_DeleteAllRules(GNMGenericNetworkShadow *self){
2068             return GNMDeleteAllRules(self);
2069         }
GNMGenericNetworkShadow_DeleteRule(GNMGenericNetworkShadow * self,char const * pszRuleStr)2070 SWIGINTERN CPLErr GNMGenericNetworkShadow_DeleteRule(GNMGenericNetworkShadow *self,char const *pszRuleStr){
2071             return GNMDeleteRule(self, pszRuleStr);
2072         }
GNMGenericNetworkShadow_GetRules(GNMGenericNetworkShadow * self)2073 SWIGINTERN char **GNMGenericNetworkShadow_GetRules(GNMGenericNetworkShadow *self){
2074             return GNMGetRules(self);
2075         }
GNMGenericNetworkShadow_ConnectPointsByLines(GNMGenericNetworkShadow * self,char ** papszLayerList,double dfTolerance,double dfCost,double dfInvCost,GNMDirection eDir)2076 SWIGINTERN CPLErr GNMGenericNetworkShadow_ConnectPointsByLines(GNMGenericNetworkShadow *self,char **papszLayerList,double dfTolerance,double dfCost,double dfInvCost,GNMDirection eDir){
2077             return GNMConnectPointsByLines(self, papszLayerList, dfTolerance, dfCost, dfInvCost, eDir);
2078         }
2079 
2080 SWIGINTERN int
SWIG_PERL_DECL_ARGS_2(SV * obj,bool * val)2081 SWIG_AsVal_bool SWIG_PERL_DECL_ARGS_2(SV *obj, bool* val)
2082 {
2083   if (obj == &PL_sv_yes) {
2084     if (val) *val = true;
2085     return SWIG_OK;
2086   } else if (obj == &PL_sv_no) {
2087     if (val) *val = false;
2088     return SWIG_OK;
2089   } else {
2090     if (val) *val = SvTRUE(obj) ? true : false;
2091     return SWIG_AddCast(SWIG_OK);
2092   }
2093 }
2094 
GNMGenericNetworkShadow_ChangeBlockState(GNMGenericNetworkShadow * self,GIntBig nFID,bool bIsBlock)2095 SWIGINTERN CPLErr GNMGenericNetworkShadow_ChangeBlockState(GNMGenericNetworkShadow *self,GIntBig nFID,bool bIsBlock){
2096             return GNMChangeBlockState(self, nFID, bIsBlock);
2097         }
GNMGenericNetworkShadow_ChangeAllBlockState(GNMGenericNetworkShadow * self,bool bIsBlock=false)2098 SWIGINTERN CPLErr GNMGenericNetworkShadow_ChangeAllBlockState(GNMGenericNetworkShadow *self,bool bIsBlock=false){
2099             return GNMChangeAllBlockState(self, bIsBlock);
2100         }
2101 #ifdef __cplusplus
2102 extern "C" {
2103 #endif
2104 
2105 #ifdef PERL_OBJECT
2106 #define MAGIC_CLASS _wrap_Geo__GNM_var::
2107 class _wrap_Geo__GNM_var : public CPerlObj {
2108 public:
2109 #else
2110 #define MAGIC_CLASS
2111 #endif
swig_magic_readonly(pTHX_ SV * SWIGUNUSEDPARM (sv),MAGIC * SWIGUNUSEDPARM (mg))2112 SWIGCLASS_STATIC int swig_magic_readonly(pTHX_ SV *SWIGUNUSEDPARM(sv), MAGIC *SWIGUNUSEDPARM(mg)) {
2113     MAGIC_PPERL
2114     croak("Value is read-only.");
2115     return 0;
2116 }
2117 
2118 
2119 #ifdef PERL_OBJECT
2120 };
2121 #endif
2122 
2123 #ifdef __cplusplus
2124 }
2125 #endif
2126 
2127 #ifdef __cplusplus
2128 extern "C" {
2129 #endif
XS(_wrap_CastToNetwork)2130 XS(_wrap_CastToNetwork) {
2131   {
2132     GDALMajorObjectShadow *arg1 = (GDALMajorObjectShadow *) 0 ;
2133     void *argp1 = 0 ;
2134     int res1 = 0 ;
2135     int argvi = 0;
2136     GNMNetworkShadow *result = 0 ;
2137     dXSARGS;
2138 
2139     if ((items < 1) || (items > 1)) {
2140       SWIG_croak("Usage: CastToNetwork(base);");
2141     }
2142     res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_GDALMajorObjectShadow, 0 |  0 );
2143     if (!SWIG_IsOK(res1)) {
2144       SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CastToNetwork" "', argument " "1"" of type '" "GDALMajorObjectShadow *""'");
2145     }
2146     arg1 = reinterpret_cast< GDALMajorObjectShadow * >(argp1);
2147     {
2148       CPLErrorReset();
2149       result = (GNMNetworkShadow *)CastToNetwork(arg1);
2150       CPLErr eclass = CPLGetLastErrorType();
2151       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
2152         do_confess( CPLGetLastErrorMsg(), 0 );
2153 
2154 
2155 
2156 
2157 
2158       }
2159 
2160 
2161       /*
2162           Make warnings regular Perl warnings. This duplicates the warning
2163           message if DontUseExceptions() is in effect (it is not by default).
2164           */
2165       if ( eclass == CE_Warning ) {
2166         warn( CPLGetLastErrorMsg(), "%s" );
2167       }
2168 
2169 
2170     }
2171     ST(argvi) = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GNMNetworkShadow, 0 | SWIG_SHADOW); argvi++ ;
2172 
2173     XSRETURN(argvi);
2174   fail:
2175 
2176     SWIG_croak_null();
2177   }
2178 }
2179 
2180 
XS(_wrap_CastToGenericNetwork)2181 XS(_wrap_CastToGenericNetwork) {
2182   {
2183     GDALMajorObjectShadow *arg1 = (GDALMajorObjectShadow *) 0 ;
2184     void *argp1 = 0 ;
2185     int res1 = 0 ;
2186     int argvi = 0;
2187     GNMGenericNetworkShadow *result = 0 ;
2188     dXSARGS;
2189 
2190     if ((items < 1) || (items > 1)) {
2191       SWIG_croak("Usage: CastToGenericNetwork(base);");
2192     }
2193     res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_GDALMajorObjectShadow, 0 |  0 );
2194     if (!SWIG_IsOK(res1)) {
2195       SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CastToGenericNetwork" "', argument " "1"" of type '" "GDALMajorObjectShadow *""'");
2196     }
2197     arg1 = reinterpret_cast< GDALMajorObjectShadow * >(argp1);
2198     {
2199       CPLErrorReset();
2200       result = (GNMGenericNetworkShadow *)CastToGenericNetwork(arg1);
2201       CPLErr eclass = CPLGetLastErrorType();
2202       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
2203         do_confess( CPLGetLastErrorMsg(), 0 );
2204 
2205 
2206 
2207 
2208 
2209       }
2210 
2211 
2212       /*
2213           Make warnings regular Perl warnings. This duplicates the warning
2214           message if DontUseExceptions() is in effect (it is not by default).
2215           */
2216       if ( eclass == CE_Warning ) {
2217         warn( CPLGetLastErrorMsg(), "%s" );
2218       }
2219 
2220 
2221     }
2222     ST(argvi) = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GNMGenericNetworkShadow, 0 | SWIG_SHADOW); argvi++ ;
2223 
2224     XSRETURN(argvi);
2225   fail:
2226 
2227     SWIG_croak_null();
2228   }
2229 }
2230 
2231 
XS(_wrap_delete_Network)2232 XS(_wrap_delete_Network) {
2233   {
2234     GNMNetworkShadow *arg1 = (GNMNetworkShadow *) 0 ;
2235     void *argp1 = 0 ;
2236     int res1 = 0 ;
2237     int argvi = 0;
2238     dXSARGS;
2239 
2240     if ((items < 1) || (items > 1)) {
2241       SWIG_croak("Usage: delete_Network(self);");
2242     }
2243     res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_GNMNetworkShadow, SWIG_POINTER_DISOWN |  0 );
2244     if (!SWIG_IsOK(res1)) {
2245       SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_Network" "', argument " "1"" of type '" "GNMNetworkShadow *""'");
2246     }
2247     arg1 = reinterpret_cast< GNMNetworkShadow * >(argp1);
2248     {
2249       CPLErrorReset();
2250       delete_GNMNetworkShadow(arg1);
2251       CPLErr eclass = CPLGetLastErrorType();
2252       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
2253         do_confess( CPLGetLastErrorMsg(), 0 );
2254 
2255 
2256 
2257 
2258 
2259       }
2260 
2261 
2262       /*
2263           Make warnings regular Perl warnings. This duplicates the warning
2264           message if DontUseExceptions() is in effect (it is not by default).
2265           */
2266       if ( eclass == CE_Warning ) {
2267         warn( CPLGetLastErrorMsg(), "%s" );
2268       }
2269 
2270 
2271     }
2272     {
2273       /* %typemap(out) void */
2274     }
2275 
2276     XSRETURN(argvi);
2277   fail:
2278 
2279     SWIG_croak_null();
2280   }
2281 }
2282 
2283 
XS(_wrap_Network__ReleaseResultSet)2284 XS(_wrap_Network__ReleaseResultSet) {
2285   {
2286     GNMNetworkShadow *arg1 = (GNMNetworkShadow *) 0 ;
2287     OGRLayerShadow *arg2 = (OGRLayerShadow *) 0 ;
2288     void *argp1 = 0 ;
2289     int res1 = 0 ;
2290     int res2 = 0 ;
2291     int argvi = 0;
2292     dXSARGS;
2293 
2294     if ((items < 2) || (items > 2)) {
2295       SWIG_croak("Usage: Network__ReleaseResultSet(self,layer);");
2296     }
2297     res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_GNMNetworkShadow, 0 |  0 );
2298     if (!SWIG_IsOK(res1)) {
2299       SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Network__ReleaseResultSet" "', argument " "1"" of type '" "GNMNetworkShadow *""'");
2300     }
2301     arg1 = reinterpret_cast< GNMNetworkShadow * >(argp1);
2302     res2 = SWIG_ConvertPtr(ST(1), SWIG_as_voidptrptr(&arg2), SWIGTYPE_p_OGRLayerShadow, SWIG_POINTER_DISOWN |  0 );
2303     if (!SWIG_IsOK(res2)) {
2304       SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Network__ReleaseResultSet" "', argument " "2"" of type '" "OGRLayerShadow *""'");
2305     }
2306     {
2307       CPLErrorReset();
2308       GNMNetworkShadow_ReleaseResultSet(arg1,arg2);
2309       CPLErr eclass = CPLGetLastErrorType();
2310       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
2311         do_confess( CPLGetLastErrorMsg(), 0 );
2312 
2313 
2314 
2315 
2316 
2317       }
2318 
2319 
2320       /*
2321           Make warnings regular Perl warnings. This duplicates the warning
2322           message if DontUseExceptions() is in effect (it is not by default).
2323           */
2324       if ( eclass == CE_Warning ) {
2325         warn( CPLGetLastErrorMsg(), "%s" );
2326       }
2327 
2328 
2329     }
2330     {
2331       /* %typemap(out) void */
2332     }
2333 
2334 
2335     XSRETURN(argvi);
2336   fail:
2337 
2338 
2339     SWIG_croak_null();
2340   }
2341 }
2342 
2343 
XS(_wrap_Network_GetVersion)2344 XS(_wrap_Network_GetVersion) {
2345   {
2346     GNMNetworkShadow *arg1 = (GNMNetworkShadow *) 0 ;
2347     void *argp1 = 0 ;
2348     int res1 = 0 ;
2349     int argvi = 0;
2350     int result;
2351     dXSARGS;
2352 
2353     if ((items < 1) || (items > 1)) {
2354       SWIG_croak("Usage: Network_GetVersion(self);");
2355     }
2356     res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_GNMNetworkShadow, 0 |  0 );
2357     if (!SWIG_IsOK(res1)) {
2358       SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Network_GetVersion" "', argument " "1"" of type '" "GNMNetworkShadow *""'");
2359     }
2360     arg1 = reinterpret_cast< GNMNetworkShadow * >(argp1);
2361     {
2362       CPLErrorReset();
2363       result = (int)GNMNetworkShadow_GetVersion(arg1);
2364       CPLErr eclass = CPLGetLastErrorType();
2365       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
2366         do_confess( CPLGetLastErrorMsg(), 0 );
2367 
2368 
2369 
2370 
2371 
2372       }
2373 
2374 
2375       /*
2376           Make warnings regular Perl warnings. This duplicates the warning
2377           message if DontUseExceptions() is in effect (it is not by default).
2378           */
2379       if ( eclass == CE_Warning ) {
2380         warn( CPLGetLastErrorMsg(), "%s" );
2381       }
2382 
2383 
2384     }
2385     ST(argvi) = SWIG_From_int  SWIG_PERL_CALL_ARGS_1(static_cast< int >(result)); argvi++ ;
2386 
2387     XSRETURN(argvi);
2388   fail:
2389 
2390     SWIG_croak_null();
2391   }
2392 }
2393 
2394 
XS(_wrap_Network_GetName)2395 XS(_wrap_Network_GetName) {
2396   {
2397     GNMNetworkShadow *arg1 = (GNMNetworkShadow *) 0 ;
2398     void *argp1 = 0 ;
2399     int res1 = 0 ;
2400     int argvi = 0;
2401     char *result = 0 ;
2402     dXSARGS;
2403 
2404     if ((items < 1) || (items > 1)) {
2405       SWIG_croak("Usage: Network_GetName(self);");
2406     }
2407     res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_GNMNetworkShadow, 0 |  0 );
2408     if (!SWIG_IsOK(res1)) {
2409       SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Network_GetName" "', argument " "1"" of type '" "GNMNetworkShadow *""'");
2410     }
2411     arg1 = reinterpret_cast< GNMNetworkShadow * >(argp1);
2412     {
2413       CPLErrorReset();
2414       result = (char *)GNMNetworkShadow_GetName(arg1);
2415       CPLErr eclass = CPLGetLastErrorType();
2416       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
2417         do_confess( CPLGetLastErrorMsg(), 0 );
2418 
2419 
2420 
2421 
2422 
2423       }
2424 
2425 
2426       /*
2427           Make warnings regular Perl warnings. This duplicates the warning
2428           message if DontUseExceptions() is in effect (it is not by default).
2429           */
2430       if ( eclass == CE_Warning ) {
2431         warn( CPLGetLastErrorMsg(), "%s" );
2432       }
2433 
2434 
2435     }
2436     {
2437       /* %typemap(out) const char * */
2438       ST(argvi) = newSVpv(result, 0);
2439       SvUTF8_on(ST(argvi)); /* expecting GDAL to give us UTF-8 */
2440       sv_2mortal(ST(argvi));
2441       argvi++;
2442     }
2443 
2444     XSRETURN(argvi);
2445   fail:
2446 
2447     SWIG_croak_null();
2448   }
2449 }
2450 
2451 
XS(_wrap_Network_GetFeatureByGlobalFID)2452 XS(_wrap_Network_GetFeatureByGlobalFID) {
2453   {
2454     GNMNetworkShadow *arg1 = (GNMNetworkShadow *) 0 ;
2455     GIntBig arg2 ;
2456     void *argp1 = 0 ;
2457     int res1 = 0 ;
2458     int argvi = 0;
2459     OGRFeatureShadow *result = 0 ;
2460     dXSARGS;
2461 
2462     if ((items < 2) || (items > 2)) {
2463       SWIG_croak("Usage: Network_GetFeatureByGlobalFID(self,GFID);");
2464     }
2465     res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_GNMNetworkShadow, 0 |  0 );
2466     if (!SWIG_IsOK(res1)) {
2467       SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Network_GetFeatureByGlobalFID" "', argument " "1"" of type '" "GNMNetworkShadow *""'");
2468     }
2469     arg1 = reinterpret_cast< GNMNetworkShadow * >(argp1);
2470     {
2471       arg2 = CPLAtoGIntBig(SvPV_nolen(ST(1)));
2472     }
2473     {
2474       CPLErrorReset();
2475       result = (OGRFeatureShadow *)GNMNetworkShadow_GetFeatureByGlobalFID(arg1,arg2);
2476       CPLErr eclass = CPLGetLastErrorType();
2477       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
2478         do_confess( CPLGetLastErrorMsg(), 0 );
2479 
2480 
2481 
2482 
2483 
2484       }
2485 
2486 
2487       /*
2488           Make warnings regular Perl warnings. This duplicates the warning
2489           message if DontUseExceptions() is in effect (it is not by default).
2490           */
2491       if ( eclass == CE_Warning ) {
2492         warn( CPLGetLastErrorMsg(), "%s" );
2493       }
2494 
2495 
2496     }
2497     ST(argvi) = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_OGRFeatureShadow, SWIG_OWNER | SWIG_SHADOW); argvi++ ;
2498 
2499     XSRETURN(argvi);
2500   fail:
2501 
2502     SWIG_croak_null();
2503   }
2504 }
2505 
2506 
XS(_wrap_Network_GetPath)2507 XS(_wrap_Network_GetPath) {
2508   {
2509     GNMNetworkShadow *arg1 = (GNMNetworkShadow *) 0 ;
2510     GIntBig arg2 ;
2511     GIntBig arg3 ;
2512     GNMGraphAlgorithmType arg4 ;
2513     char **arg5 = (char **) 0 ;
2514     void *argp1 = 0 ;
2515     int res1 = 0 ;
2516     int val4 ;
2517     int ecode4 = 0 ;
2518     int argvi = 0;
2519     OGRLayerShadow *result = 0 ;
2520     dXSARGS;
2521 
2522     if ((items < 4) || (items > 5)) {
2523       SWIG_croak("Usage: Network_GetPath(self,nStartFID,nEndFID,eAlgorithm,options);");
2524     }
2525     res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_GNMNetworkShadow, 0 |  0 );
2526     if (!SWIG_IsOK(res1)) {
2527       SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Network_GetPath" "', argument " "1"" of type '" "GNMNetworkShadow *""'");
2528     }
2529     arg1 = reinterpret_cast< GNMNetworkShadow * >(argp1);
2530     {
2531       arg2 = CPLAtoGIntBig(SvPV_nolen(ST(1)));
2532     }
2533     {
2534       arg3 = CPLAtoGIntBig(SvPV_nolen(ST(2)));
2535     }
2536     ecode4 = SWIG_AsVal_int SWIG_PERL_CALL_ARGS_2(ST(3), &val4);
2537     if (!SWIG_IsOK(ecode4)) {
2538       SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "Network_GetPath" "', argument " "4"" of type '" "GNMGraphAlgorithmType""'");
2539     }
2540     arg4 = static_cast< GNMGraphAlgorithmType >(val4);
2541     if (items > 4) {
2542       {
2543         /* %typemap(in) char **options */
2544         if (SvOK(ST(4))) {
2545           if (SvROK(ST(4))) {
2546             if (SvTYPE(SvRV(ST(4)))==SVt_PVAV) {
2547               AV *av = (AV*)(SvRV(ST(4)));
2548               for (int i = 0; i < av_len(av)+1; i++) {
2549                 SV *sv = *(av_fetch(av, i, 0));
2550                 bool sf;
2551                 char *tmp = sv_to_utf8_string(sv, NULL, &sf);
2552                 arg5 = CSLAddString(arg5, tmp);
2553                 if (sf) Safefree(tmp); else free(tmp);
2554               }
2555             } else if (SvTYPE(SvRV(ST(4)))==SVt_PVHV) {
2556               HV *hv = (HV*)SvRV(ST(4));
2557               SV *sv;
2558               char *key;
2559               I32 klen;
2560               arg5 = NULL;
2561               hv_iterinit(hv);
2562               while(sv = hv_iternextsv(hv, &key, &klen)) {
2563                 bool sf;
2564                 char *tmp = sv_to_utf8_string(sv, NULL, &sf);
2565                 arg5 = CSLAddNameValue(arg5, key, tmp);
2566                 if (sf) Safefree(tmp); else free(tmp);
2567               }
2568             } else
2569             do_confess(NEED_REF, 1);
2570           } else
2571           do_confess(NEED_REF, 1);
2572         }
2573       }
2574     }
2575     {
2576       CPLErrorReset();
2577       result = (OGRLayerShadow *)GNMNetworkShadow_GetPath(arg1,arg2,arg3,arg4,arg5);
2578       CPLErr eclass = CPLGetLastErrorType();
2579       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
2580         do_confess( CPLGetLastErrorMsg(), 0 );
2581 
2582 
2583 
2584 
2585 
2586       }
2587 
2588 
2589       /*
2590           Make warnings regular Perl warnings. This duplicates the warning
2591           message if DontUseExceptions() is in effect (it is not by default).
2592           */
2593       if ( eclass == CE_Warning ) {
2594         warn( CPLGetLastErrorMsg(), "%s" );
2595       }
2596 
2597 
2598     }
2599     ST(argvi) = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_OGRLayerShadow, SWIG_OWNER | SWIG_SHADOW); argvi++ ;
2600 
2601 
2602     {
2603       /* %typemap(freearg) char **options */
2604       if (arg5) CSLDestroy( arg5 );
2605     }
2606     XSRETURN(argvi);
2607   fail:
2608 
2609 
2610     {
2611       /* %typemap(freearg) char **options */
2612       if (arg5) CSLDestroy( arg5 );
2613     }
2614     SWIG_croak_null();
2615   }
2616 }
2617 
2618 
XS(_wrap_Network_DisconnectAll)2619 XS(_wrap_Network_DisconnectAll) {
2620   {
2621     GNMNetworkShadow *arg1 = (GNMNetworkShadow *) 0 ;
2622     void *argp1 = 0 ;
2623     int res1 = 0 ;
2624     int argvi = 0;
2625     CPLErr result;
2626     dXSARGS;
2627 
2628     if ((items < 1) || (items > 1)) {
2629       SWIG_croak("Usage: Network_DisconnectAll(self);");
2630     }
2631     res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_GNMNetworkShadow, 0 |  0 );
2632     if (!SWIG_IsOK(res1)) {
2633       SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Network_DisconnectAll" "', argument " "1"" of type '" "GNMNetworkShadow *""'");
2634     }
2635     arg1 = reinterpret_cast< GNMNetworkShadow * >(argp1);
2636     {
2637       CPLErrorReset();
2638       result = (CPLErr)GNMNetworkShadow_DisconnectAll(arg1);
2639       CPLErr eclass = CPLGetLastErrorType();
2640       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
2641         do_confess( CPLGetLastErrorMsg(), 0 );
2642 
2643 
2644 
2645 
2646 
2647       }
2648 
2649 
2650       /*
2651           Make warnings regular Perl warnings. This duplicates the warning
2652           message if DontUseExceptions() is in effect (it is not by default).
2653           */
2654       if ( eclass == CE_Warning ) {
2655         warn( CPLGetLastErrorMsg(), "%s" );
2656       }
2657 
2658 
2659     }
2660     {
2661       /* %typemap(out) CPLErr */
2662     }
2663 
2664     XSRETURN(argvi);
2665   fail:
2666 
2667     SWIG_croak_null();
2668   }
2669 }
2670 
2671 
XS(_wrap_Network_GetProjection)2672 XS(_wrap_Network_GetProjection) {
2673   {
2674     GNMNetworkShadow *arg1 = (GNMNetworkShadow *) 0 ;
2675     void *argp1 = 0 ;
2676     int res1 = 0 ;
2677     int argvi = 0;
2678     char *result = 0 ;
2679     dXSARGS;
2680 
2681     if ((items < 1) || (items > 1)) {
2682       SWIG_croak("Usage: Network_GetProjection(self);");
2683     }
2684     res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_GNMNetworkShadow, 0 |  0 );
2685     if (!SWIG_IsOK(res1)) {
2686       SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Network_GetProjection" "', argument " "1"" of type '" "GNMNetworkShadow *""'");
2687     }
2688     arg1 = reinterpret_cast< GNMNetworkShadow * >(argp1);
2689     {
2690       CPLErrorReset();
2691       result = (char *)GNMNetworkShadow_GetProjection(arg1);
2692       CPLErr eclass = CPLGetLastErrorType();
2693       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
2694         do_confess( CPLGetLastErrorMsg(), 0 );
2695 
2696 
2697 
2698 
2699 
2700       }
2701 
2702 
2703       /*
2704           Make warnings regular Perl warnings. This duplicates the warning
2705           message if DontUseExceptions() is in effect (it is not by default).
2706           */
2707       if ( eclass == CE_Warning ) {
2708         warn( CPLGetLastErrorMsg(), "%s" );
2709       }
2710 
2711 
2712     }
2713     {
2714       /* %typemap(out) const char * */
2715       ST(argvi) = newSVpv(result, 0);
2716       SvUTF8_on(ST(argvi)); /* expecting GDAL to give us UTF-8 */
2717       sv_2mortal(ST(argvi));
2718       argvi++;
2719     }
2720 
2721     XSRETURN(argvi);
2722   fail:
2723 
2724     SWIG_croak_null();
2725   }
2726 }
2727 
2728 
XS(_wrap_Network_GetProjectionRef)2729 XS(_wrap_Network_GetProjectionRef) {
2730   {
2731     GNMNetworkShadow *arg1 = (GNMNetworkShadow *) 0 ;
2732     void *argp1 = 0 ;
2733     int res1 = 0 ;
2734     int argvi = 0;
2735     char *result = 0 ;
2736     dXSARGS;
2737 
2738     if ((items < 1) || (items > 1)) {
2739       SWIG_croak("Usage: Network_GetProjectionRef(self);");
2740     }
2741     res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_GNMNetworkShadow, 0 |  0 );
2742     if (!SWIG_IsOK(res1)) {
2743       SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Network_GetProjectionRef" "', argument " "1"" of type '" "GNMNetworkShadow *""'");
2744     }
2745     arg1 = reinterpret_cast< GNMNetworkShadow * >(argp1);
2746     {
2747       CPLErrorReset();
2748       result = (char *)GNMNetworkShadow_GetProjectionRef(arg1);
2749       CPLErr eclass = CPLGetLastErrorType();
2750       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
2751         do_confess( CPLGetLastErrorMsg(), 0 );
2752 
2753 
2754 
2755 
2756 
2757       }
2758 
2759 
2760       /*
2761           Make warnings regular Perl warnings. This duplicates the warning
2762           message if DontUseExceptions() is in effect (it is not by default).
2763           */
2764       if ( eclass == CE_Warning ) {
2765         warn( CPLGetLastErrorMsg(), "%s" );
2766       }
2767 
2768 
2769     }
2770     {
2771       /* %typemap(out) const char * */
2772       ST(argvi) = newSVpv(result, 0);
2773       SvUTF8_on(ST(argvi)); /* expecting GDAL to give us UTF-8 */
2774       sv_2mortal(ST(argvi));
2775       argvi++;
2776     }
2777 
2778     XSRETURN(argvi);
2779   fail:
2780 
2781     SWIG_croak_null();
2782   }
2783 }
2784 
2785 
XS(_wrap_Network_GetFileList)2786 XS(_wrap_Network_GetFileList) {
2787   {
2788     GNMNetworkShadow *arg1 = (GNMNetworkShadow *) 0 ;
2789     void *argp1 = 0 ;
2790     int res1 = 0 ;
2791     int argvi = 0;
2792     char **result = 0 ;
2793     dXSARGS;
2794 
2795     if ((items < 1) || (items > 1)) {
2796       SWIG_croak("Usage: Network_GetFileList(self);");
2797     }
2798     res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_GNMNetworkShadow, 0 |  0 );
2799     if (!SWIG_IsOK(res1)) {
2800       SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Network_GetFileList" "', argument " "1"" of type '" "GNMNetworkShadow *""'");
2801     }
2802     arg1 = reinterpret_cast< GNMNetworkShadow * >(argp1);
2803     {
2804       CPLErrorReset();
2805       result = (char **)GNMNetworkShadow_GetFileList(arg1);
2806       CPLErr eclass = CPLGetLastErrorType();
2807       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
2808         do_confess( CPLGetLastErrorMsg(), 0 );
2809 
2810 
2811 
2812 
2813 
2814       }
2815 
2816 
2817       /*
2818           Make warnings regular Perl warnings. This duplicates the warning
2819           message if DontUseExceptions() is in effect (it is not by default).
2820           */
2821       if ( eclass == CE_Warning ) {
2822         warn( CPLGetLastErrorMsg(), "%s" );
2823       }
2824 
2825 
2826     }
2827     {
2828       /* %typemap(out) char **CSL */
2829       if (GIMME_V == G_ARRAY) {
2830         if (result) {
2831           int n = CSLCount(result);
2832           EXTEND(SP, argvi+n-items+1);
2833           int i;
2834           for (i = 0; result[i]; i++) {
2835             SV *sv = newSVpv(result[i], 0);
2836             SvUTF8_on(sv); /* expecting GDAL to give us UTF-8 */
2837             ST(argvi++) = sv_2mortal(sv);
2838           }
2839           CSLDestroy(result);
2840         }
2841       } else {
2842         AV *av = (AV*)sv_2mortal((SV*)newAV());
2843         if (result) {
2844           int i;
2845           for (i = 0; result[i]; i++) {
2846             SV *sv = newSVpv(result[i], 0);
2847             SvUTF8_on(sv); /* expecting GDAL to give us UTF-8 */
2848             av_push(av, sv);
2849           }
2850           CSLDestroy(result);
2851         }
2852         ST(argvi) = newRV((SV*)av);
2853         sv_2mortal(ST(argvi));
2854         argvi++;
2855       }
2856     }
2857 
2858     XSRETURN(argvi);
2859   fail:
2860 
2861     SWIG_croak_null();
2862   }
2863 }
2864 
2865 
XS(_wrap_Network__CreateLayer)2866 XS(_wrap_Network__CreateLayer) {
2867   {
2868     GNMNetworkShadow *arg1 = (GNMNetworkShadow *) 0 ;
2869     char *arg2 = (char *) 0 ;
2870     OSRSpatialReferenceShadow *arg3 = (OSRSpatialReferenceShadow *) NULL ;
2871     OGRwkbGeometryType arg4 = (OGRwkbGeometryType) wkbUnknown ;
2872     char **arg5 = (char **) 0 ;
2873     void *argp1 = 0 ;
2874     int res1 = 0 ;
2875     int res2 ;
2876     char *buf2 = 0 ;
2877     int alloc2 = 0 ;
2878     void *argp3 = 0 ;
2879     int res3 = 0 ;
2880     int val4 ;
2881     int ecode4 = 0 ;
2882     int argvi = 0;
2883     OGRLayerShadow *result = 0 ;
2884     dXSARGS;
2885 
2886     if ((items < 2) || (items > 5)) {
2887       SWIG_croak("Usage: Network__CreateLayer(self,name,srs,geom_type,options);");
2888     }
2889     res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_GNMNetworkShadow, 0 |  0 );
2890     if (!SWIG_IsOK(res1)) {
2891       SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Network__CreateLayer" "', argument " "1"" of type '" "GNMNetworkShadow *""'");
2892     }
2893     arg1 = reinterpret_cast< GNMNetworkShadow * >(argp1);
2894     res2 = SWIG_AsCharPtrAndSize(ST(1), &buf2, NULL, &alloc2);
2895     if (!SWIG_IsOK(res2)) {
2896       SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Network__CreateLayer" "', argument " "2"" of type '" "char const *""'");
2897     }
2898     arg2 = reinterpret_cast< char * >(buf2);
2899     if (items > 2) {
2900       res3 = SWIG_ConvertPtr(ST(2), &argp3,SWIGTYPE_p_OSRSpatialReferenceShadow, 0 |  0 );
2901       if (!SWIG_IsOK(res3)) {
2902         SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "Network__CreateLayer" "', argument " "3"" of type '" "OSRSpatialReferenceShadow *""'");
2903       }
2904       arg3 = reinterpret_cast< OSRSpatialReferenceShadow * >(argp3);
2905     }
2906     if (items > 3) {
2907       ecode4 = SWIG_AsVal_int SWIG_PERL_CALL_ARGS_2(ST(3), &val4);
2908       if (!SWIG_IsOK(ecode4)) {
2909         SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "Network__CreateLayer" "', argument " "4"" of type '" "OGRwkbGeometryType""'");
2910       }
2911       arg4 = static_cast< OGRwkbGeometryType >(val4);
2912     }
2913     if (items > 4) {
2914       {
2915         /* %typemap(in) char **options */
2916         if (SvOK(ST(4))) {
2917           if (SvROK(ST(4))) {
2918             if (SvTYPE(SvRV(ST(4)))==SVt_PVAV) {
2919               AV *av = (AV*)(SvRV(ST(4)));
2920               for (int i = 0; i < av_len(av)+1; i++) {
2921                 SV *sv = *(av_fetch(av, i, 0));
2922                 bool sf;
2923                 char *tmp = sv_to_utf8_string(sv, NULL, &sf);
2924                 arg5 = CSLAddString(arg5, tmp);
2925                 if (sf) Safefree(tmp); else free(tmp);
2926               }
2927             } else if (SvTYPE(SvRV(ST(4)))==SVt_PVHV) {
2928               HV *hv = (HV*)SvRV(ST(4));
2929               SV *sv;
2930               char *key;
2931               I32 klen;
2932               arg5 = NULL;
2933               hv_iterinit(hv);
2934               while(sv = hv_iternextsv(hv, &key, &klen)) {
2935                 bool sf;
2936                 char *tmp = sv_to_utf8_string(sv, NULL, &sf);
2937                 arg5 = CSLAddNameValue(arg5, key, tmp);
2938                 if (sf) Safefree(tmp); else free(tmp);
2939               }
2940             } else
2941             do_confess(NEED_REF, 1);
2942           } else
2943           do_confess(NEED_REF, 1);
2944         }
2945       }
2946     }
2947     {
2948       CPLErrorReset();
2949       result = (OGRLayerShadow *)GNMNetworkShadow_CreateLayer(arg1,(char const *)arg2,arg3,arg4,arg5);
2950       CPLErr eclass = CPLGetLastErrorType();
2951       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
2952         do_confess( CPLGetLastErrorMsg(), 0 );
2953 
2954 
2955 
2956 
2957 
2958       }
2959 
2960 
2961       /*
2962           Make warnings regular Perl warnings. This duplicates the warning
2963           message if DontUseExceptions() is in effect (it is not by default).
2964           */
2965       if ( eclass == CE_Warning ) {
2966         warn( CPLGetLastErrorMsg(), "%s" );
2967       }
2968 
2969 
2970     }
2971     ST(argvi) = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_OGRLayerShadow, 0 | SWIG_SHADOW); argvi++ ;
2972 
2973     if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
2974 
2975 
2976     {
2977       /* %typemap(freearg) char **options */
2978       if (arg5) CSLDestroy( arg5 );
2979     }
2980     XSRETURN(argvi);
2981   fail:
2982 
2983     if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
2984 
2985 
2986     {
2987       /* %typemap(freearg) char **options */
2988       if (arg5) CSLDestroy( arg5 );
2989     }
2990     SWIG_croak_null();
2991   }
2992 }
2993 
2994 
XS(_wrap_Network_CopyLayer)2995 XS(_wrap_Network_CopyLayer) {
2996   {
2997     GNMNetworkShadow *arg1 = (GNMNetworkShadow *) 0 ;
2998     OGRLayerShadow *arg2 = (OGRLayerShadow *) 0 ;
2999     char *arg3 = (char *) 0 ;
3000     char **arg4 = (char **) 0 ;
3001     void *argp1 = 0 ;
3002     int res1 = 0 ;
3003     void *argp2 = 0 ;
3004     int res2 = 0 ;
3005     int res3 ;
3006     char *buf3 = 0 ;
3007     int alloc3 = 0 ;
3008     int argvi = 0;
3009     OGRLayerShadow *result = 0 ;
3010     dXSARGS;
3011 
3012     if ((items < 3) || (items > 4)) {
3013       SWIG_croak("Usage: Network_CopyLayer(self,src_layer,new_name,options);");
3014     }
3015     res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_GNMNetworkShadow, 0 |  0 );
3016     if (!SWIG_IsOK(res1)) {
3017       SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Network_CopyLayer" "', argument " "1"" of type '" "GNMNetworkShadow *""'");
3018     }
3019     arg1 = reinterpret_cast< GNMNetworkShadow * >(argp1);
3020     res2 = SWIG_ConvertPtr(ST(1), &argp2,SWIGTYPE_p_OGRLayerShadow, 0 |  0 );
3021     if (!SWIG_IsOK(res2)) {
3022       SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Network_CopyLayer" "', argument " "2"" of type '" "OGRLayerShadow *""'");
3023     }
3024     arg2 = reinterpret_cast< OGRLayerShadow * >(argp2);
3025     res3 = SWIG_AsCharPtrAndSize(ST(2), &buf3, NULL, &alloc3);
3026     if (!SWIG_IsOK(res3)) {
3027       SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "Network_CopyLayer" "', argument " "3"" of type '" "char const *""'");
3028     }
3029     arg3 = reinterpret_cast< char * >(buf3);
3030     if (items > 3) {
3031       {
3032         /* %typemap(in) char **options */
3033         if (SvOK(ST(3))) {
3034           if (SvROK(ST(3))) {
3035             if (SvTYPE(SvRV(ST(3)))==SVt_PVAV) {
3036               AV *av = (AV*)(SvRV(ST(3)));
3037               for (int i = 0; i < av_len(av)+1; i++) {
3038                 SV *sv = *(av_fetch(av, i, 0));
3039                 bool sf;
3040                 char *tmp = sv_to_utf8_string(sv, NULL, &sf);
3041                 arg4 = CSLAddString(arg4, tmp);
3042                 if (sf) Safefree(tmp); else free(tmp);
3043               }
3044             } else if (SvTYPE(SvRV(ST(3)))==SVt_PVHV) {
3045               HV *hv = (HV*)SvRV(ST(3));
3046               SV *sv;
3047               char *key;
3048               I32 klen;
3049               arg4 = NULL;
3050               hv_iterinit(hv);
3051               while(sv = hv_iternextsv(hv, &key, &klen)) {
3052                 bool sf;
3053                 char *tmp = sv_to_utf8_string(sv, NULL, &sf);
3054                 arg4 = CSLAddNameValue(arg4, key, tmp);
3055                 if (sf) Safefree(tmp); else free(tmp);
3056               }
3057             } else
3058             do_confess(NEED_REF, 1);
3059           } else
3060           do_confess(NEED_REF, 1);
3061         }
3062       }
3063     }
3064     {
3065       if (!arg2) {
3066         SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
3067       }
3068     }
3069     {
3070       CPLErrorReset();
3071       result = (OGRLayerShadow *)GNMNetworkShadow_CopyLayer(arg1,arg2,(char const *)arg3,arg4);
3072       CPLErr eclass = CPLGetLastErrorType();
3073       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
3074         do_confess( CPLGetLastErrorMsg(), 0 );
3075 
3076 
3077 
3078 
3079 
3080       }
3081 
3082 
3083       /*
3084           Make warnings regular Perl warnings. This duplicates the warning
3085           message if DontUseExceptions() is in effect (it is not by default).
3086           */
3087       if ( eclass == CE_Warning ) {
3088         warn( CPLGetLastErrorMsg(), "%s" );
3089       }
3090 
3091 
3092     }
3093     ST(argvi) = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_OGRLayerShadow, 0 | SWIG_SHADOW); argvi++ ;
3094 
3095 
3096     if (alloc3 == SWIG_NEWOBJ) delete[] buf3;
3097     {
3098       /* %typemap(freearg) char **options */
3099       if (arg4) CSLDestroy( arg4 );
3100     }
3101     XSRETURN(argvi);
3102   fail:
3103 
3104 
3105     if (alloc3 == SWIG_NEWOBJ) delete[] buf3;
3106     {
3107       /* %typemap(freearg) char **options */
3108       if (arg4) CSLDestroy( arg4 );
3109     }
3110     SWIG_croak_null();
3111   }
3112 }
3113 
3114 
XS(_wrap_Network__DeleteLayer)3115 XS(_wrap_Network__DeleteLayer) {
3116   {
3117     GNMNetworkShadow *arg1 = (GNMNetworkShadow *) 0 ;
3118     int arg2 ;
3119     void *argp1 = 0 ;
3120     int res1 = 0 ;
3121     int val2 ;
3122     int ecode2 = 0 ;
3123     int argvi = 0;
3124     OGRErr result;
3125     dXSARGS;
3126 
3127     if ((items < 2) || (items > 2)) {
3128       SWIG_croak("Usage: Network__DeleteLayer(self,index);");
3129     }
3130     res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_GNMNetworkShadow, 0 |  0 );
3131     if (!SWIG_IsOK(res1)) {
3132       SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Network__DeleteLayer" "', argument " "1"" of type '" "GNMNetworkShadow *""'");
3133     }
3134     arg1 = reinterpret_cast< GNMNetworkShadow * >(argp1);
3135     ecode2 = SWIG_AsVal_int SWIG_PERL_CALL_ARGS_2(ST(1), &val2);
3136     if (!SWIG_IsOK(ecode2)) {
3137       SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Network__DeleteLayer" "', argument " "2"" of type '" "int""'");
3138     }
3139     arg2 = static_cast< int >(val2);
3140     {
3141       CPLErrorReset();
3142       result = (OGRErr)GNMNetworkShadow_DeleteLayer(arg1,arg2);
3143       CPLErr eclass = CPLGetLastErrorType();
3144       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
3145         do_confess( CPLGetLastErrorMsg(), 0 );
3146 
3147 
3148 
3149 
3150 
3151       }
3152 
3153 
3154       /*
3155           Make warnings regular Perl warnings. This duplicates the warning
3156           message if DontUseExceptions() is in effect (it is not by default).
3157           */
3158       if ( eclass == CE_Warning ) {
3159         warn( CPLGetLastErrorMsg(), "%s" );
3160       }
3161 
3162 
3163     }
3164     {
3165       /* %typemap(out) OGRErr */
3166       if ( result != 0 ) {
3167         const char *err = CPLGetLastErrorMsg();
3168         if (err and *err) do_confess(err, 0); /* this is usually better */
3169         do_confess( OGRErrMessages(result), 1 );
3170       }
3171     }
3172 
3173 
3174     XSRETURN(argvi);
3175   fail:
3176 
3177 
3178     SWIG_croak_null();
3179   }
3180 }
3181 
3182 
XS(_wrap_Network_GetLayerCount)3183 XS(_wrap_Network_GetLayerCount) {
3184   {
3185     GNMNetworkShadow *arg1 = (GNMNetworkShadow *) 0 ;
3186     void *argp1 = 0 ;
3187     int res1 = 0 ;
3188     int argvi = 0;
3189     int result;
3190     dXSARGS;
3191 
3192     if ((items < 1) || (items > 1)) {
3193       SWIG_croak("Usage: Network_GetLayerCount(self);");
3194     }
3195     res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_GNMNetworkShadow, 0 |  0 );
3196     if (!SWIG_IsOK(res1)) {
3197       SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Network_GetLayerCount" "', argument " "1"" of type '" "GNMNetworkShadow *""'");
3198     }
3199     arg1 = reinterpret_cast< GNMNetworkShadow * >(argp1);
3200     {
3201       CPLErrorReset();
3202       result = (int)GNMNetworkShadow_GetLayerCount(arg1);
3203       CPLErr eclass = CPLGetLastErrorType();
3204       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
3205         do_confess( CPLGetLastErrorMsg(), 0 );
3206 
3207 
3208 
3209 
3210 
3211       }
3212 
3213 
3214       /*
3215           Make warnings regular Perl warnings. This duplicates the warning
3216           message if DontUseExceptions() is in effect (it is not by default).
3217           */
3218       if ( eclass == CE_Warning ) {
3219         warn( CPLGetLastErrorMsg(), "%s" );
3220       }
3221 
3222 
3223     }
3224     ST(argvi) = SWIG_From_int  SWIG_PERL_CALL_ARGS_1(static_cast< int >(result)); argvi++ ;
3225 
3226     XSRETURN(argvi);
3227   fail:
3228 
3229     SWIG_croak_null();
3230   }
3231 }
3232 
3233 
XS(_wrap_Network_GetLayerByIndex)3234 XS(_wrap_Network_GetLayerByIndex) {
3235   {
3236     GNMNetworkShadow *arg1 = (GNMNetworkShadow *) 0 ;
3237     int arg2 = (int) 0 ;
3238     void *argp1 = 0 ;
3239     int res1 = 0 ;
3240     int val2 ;
3241     int ecode2 = 0 ;
3242     int argvi = 0;
3243     OGRLayerShadow *result = 0 ;
3244     dXSARGS;
3245 
3246     if ((items < 1) || (items > 2)) {
3247       SWIG_croak("Usage: Network_GetLayerByIndex(self,index);");
3248     }
3249     res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_GNMNetworkShadow, 0 |  0 );
3250     if (!SWIG_IsOK(res1)) {
3251       SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Network_GetLayerByIndex" "', argument " "1"" of type '" "GNMNetworkShadow *""'");
3252     }
3253     arg1 = reinterpret_cast< GNMNetworkShadow * >(argp1);
3254     if (items > 1) {
3255       ecode2 = SWIG_AsVal_int SWIG_PERL_CALL_ARGS_2(ST(1), &val2);
3256       if (!SWIG_IsOK(ecode2)) {
3257         SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Network_GetLayerByIndex" "', argument " "2"" of type '" "int""'");
3258       }
3259       arg2 = static_cast< int >(val2);
3260     }
3261     {
3262       CPLErrorReset();
3263       result = (OGRLayerShadow *)GNMNetworkShadow_GetLayerByIndex(arg1,arg2);
3264       CPLErr eclass = CPLGetLastErrorType();
3265       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
3266         do_confess( CPLGetLastErrorMsg(), 0 );
3267 
3268 
3269 
3270 
3271 
3272       }
3273 
3274 
3275       /*
3276           Make warnings regular Perl warnings. This duplicates the warning
3277           message if DontUseExceptions() is in effect (it is not by default).
3278           */
3279       if ( eclass == CE_Warning ) {
3280         warn( CPLGetLastErrorMsg(), "%s" );
3281       }
3282 
3283 
3284     }
3285     ST(argvi) = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_OGRLayerShadow, 0 | SWIG_SHADOW); argvi++ ;
3286 
3287 
3288     XSRETURN(argvi);
3289   fail:
3290 
3291 
3292     SWIG_croak_null();
3293   }
3294 }
3295 
3296 
XS(_wrap_Network_GetLayerByName)3297 XS(_wrap_Network_GetLayerByName) {
3298   {
3299     GNMNetworkShadow *arg1 = (GNMNetworkShadow *) 0 ;
3300     char *arg2 = (char *) 0 ;
3301     void *argp1 = 0 ;
3302     int res1 = 0 ;
3303     U8 *tmpbuf2 = NULL ;
3304     int argvi = 0;
3305     OGRLayerShadow *result = 0 ;
3306     dXSARGS;
3307 
3308     if ((items < 2) || (items > 2)) {
3309       SWIG_croak("Usage: Network_GetLayerByName(self,layer_name);");
3310     }
3311     res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_GNMNetworkShadow, 0 |  0 );
3312     if (!SWIG_IsOK(res1)) {
3313       SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Network_GetLayerByName" "', argument " "1"" of type '" "GNMNetworkShadow *""'");
3314     }
3315     arg1 = reinterpret_cast< GNMNetworkShadow * >(argp1);
3316     {
3317       /* %typemap(in,numinputs=1) (const char* layer_name) */
3318       arg2 = sv_to_utf8_string(ST(1), &tmpbuf2);
3319     }
3320     {
3321       CPLErrorReset();
3322       result = (OGRLayerShadow *)GNMNetworkShadow_GetLayerByName(arg1,(char const *)arg2);
3323       CPLErr eclass = CPLGetLastErrorType();
3324       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
3325         do_confess( CPLGetLastErrorMsg(), 0 );
3326 
3327 
3328 
3329 
3330 
3331       }
3332 
3333 
3334       /*
3335           Make warnings regular Perl warnings. This duplicates the warning
3336           message if DontUseExceptions() is in effect (it is not by default).
3337           */
3338       if ( eclass == CE_Warning ) {
3339         warn( CPLGetLastErrorMsg(), "%s" );
3340       }
3341 
3342 
3343     }
3344     ST(argvi) = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_OGRLayerShadow, 0 | SWIG_SHADOW); argvi++ ;
3345 
3346     {
3347       /* %typemap(freearg) (const char* layer_name) */
3348       if (tmpbuf2) Safefree(tmpbuf2);
3349     }
3350     XSRETURN(argvi);
3351   fail:
3352 
3353     {
3354       /* %typemap(freearg) (const char* layer_name) */
3355       if (tmpbuf2) Safefree(tmpbuf2);
3356     }
3357     SWIG_croak_null();
3358   }
3359 }
3360 
3361 
XS(_wrap_Network__TestCapability)3362 XS(_wrap_Network__TestCapability) {
3363   {
3364     GNMNetworkShadow *arg1 = (GNMNetworkShadow *) 0 ;
3365     char *arg2 = (char *) 0 ;
3366     void *argp1 = 0 ;
3367     int res1 = 0 ;
3368     int res2 ;
3369     char *buf2 = 0 ;
3370     int alloc2 = 0 ;
3371     int argvi = 0;
3372     bool result;
3373     dXSARGS;
3374 
3375     if ((items < 2) || (items > 2)) {
3376       SWIG_croak("Usage: Network__TestCapability(self,cap);");
3377     }
3378     res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_GNMNetworkShadow, 0 |  0 );
3379     if (!SWIG_IsOK(res1)) {
3380       SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Network__TestCapability" "', argument " "1"" of type '" "GNMNetworkShadow *""'");
3381     }
3382     arg1 = reinterpret_cast< GNMNetworkShadow * >(argp1);
3383     res2 = SWIG_AsCharPtrAndSize(ST(1), &buf2, NULL, &alloc2);
3384     if (!SWIG_IsOK(res2)) {
3385       SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Network__TestCapability" "', argument " "2"" of type '" "char const *""'");
3386     }
3387     arg2 = reinterpret_cast< char * >(buf2);
3388     {
3389       /* %typemap(check) (const char *cap) */
3390       if (!arg2)
3391       do_confess(NEED_DEF, 1);
3392     }
3393     {
3394       CPLErrorReset();
3395       result = (bool)GNMNetworkShadow_TestCapability(arg1,(char const *)arg2);
3396       CPLErr eclass = CPLGetLastErrorType();
3397       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
3398         do_confess( CPLGetLastErrorMsg(), 0 );
3399 
3400 
3401 
3402 
3403 
3404       }
3405 
3406 
3407       /*
3408           Make warnings regular Perl warnings. This duplicates the warning
3409           message if DontUseExceptions() is in effect (it is not by default).
3410           */
3411       if ( eclass == CE_Warning ) {
3412         warn( CPLGetLastErrorMsg(), "%s" );
3413       }
3414 
3415 
3416     }
3417     ST(argvi) = SWIG_From_bool  SWIG_PERL_CALL_ARGS_1(static_cast< bool >(result)); argvi++ ;
3418 
3419     if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
3420     XSRETURN(argvi);
3421   fail:
3422 
3423     if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
3424     SWIG_croak_null();
3425   }
3426 }
3427 
3428 
XS(_wrap_Network_StartTransaction)3429 XS(_wrap_Network_StartTransaction) {
3430   {
3431     GNMNetworkShadow *arg1 = (GNMNetworkShadow *) 0 ;
3432     int arg2 = (int) FALSE ;
3433     void *argp1 = 0 ;
3434     int res1 = 0 ;
3435     int val2 ;
3436     int ecode2 = 0 ;
3437     int argvi = 0;
3438     OGRErr result;
3439     dXSARGS;
3440 
3441     if ((items < 1) || (items > 2)) {
3442       SWIG_croak("Usage: Network_StartTransaction(self,force);");
3443     }
3444     res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_GNMNetworkShadow, 0 |  0 );
3445     if (!SWIG_IsOK(res1)) {
3446       SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Network_StartTransaction" "', argument " "1"" of type '" "GNMNetworkShadow *""'");
3447     }
3448     arg1 = reinterpret_cast< GNMNetworkShadow * >(argp1);
3449     if (items > 1) {
3450       ecode2 = SWIG_AsVal_int SWIG_PERL_CALL_ARGS_2(ST(1), &val2);
3451       if (!SWIG_IsOK(ecode2)) {
3452         SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Network_StartTransaction" "', argument " "2"" of type '" "int""'");
3453       }
3454       arg2 = static_cast< int >(val2);
3455     }
3456     {
3457       CPLErrorReset();
3458       result = (OGRErr)GNMNetworkShadow_StartTransaction(arg1,arg2);
3459       CPLErr eclass = CPLGetLastErrorType();
3460       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
3461         do_confess( CPLGetLastErrorMsg(), 0 );
3462 
3463 
3464 
3465 
3466 
3467       }
3468 
3469 
3470       /*
3471           Make warnings regular Perl warnings. This duplicates the warning
3472           message if DontUseExceptions() is in effect (it is not by default).
3473           */
3474       if ( eclass == CE_Warning ) {
3475         warn( CPLGetLastErrorMsg(), "%s" );
3476       }
3477 
3478 
3479     }
3480     {
3481       /* %typemap(out) OGRErr */
3482       if ( result != 0 ) {
3483         const char *err = CPLGetLastErrorMsg();
3484         if (err and *err) do_confess(err, 0); /* this is usually better */
3485         do_confess( OGRErrMessages(result), 1 );
3486       }
3487     }
3488 
3489 
3490     XSRETURN(argvi);
3491   fail:
3492 
3493 
3494     SWIG_croak_null();
3495   }
3496 }
3497 
3498 
XS(_wrap_Network_CommitTransaction)3499 XS(_wrap_Network_CommitTransaction) {
3500   {
3501     GNMNetworkShadow *arg1 = (GNMNetworkShadow *) 0 ;
3502     void *argp1 = 0 ;
3503     int res1 = 0 ;
3504     int argvi = 0;
3505     OGRErr result;
3506     dXSARGS;
3507 
3508     if ((items < 1) || (items > 1)) {
3509       SWIG_croak("Usage: Network_CommitTransaction(self);");
3510     }
3511     res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_GNMNetworkShadow, 0 |  0 );
3512     if (!SWIG_IsOK(res1)) {
3513       SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Network_CommitTransaction" "', argument " "1"" of type '" "GNMNetworkShadow *""'");
3514     }
3515     arg1 = reinterpret_cast< GNMNetworkShadow * >(argp1);
3516     {
3517       CPLErrorReset();
3518       result = (OGRErr)GNMNetworkShadow_CommitTransaction(arg1);
3519       CPLErr eclass = CPLGetLastErrorType();
3520       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
3521         do_confess( CPLGetLastErrorMsg(), 0 );
3522 
3523 
3524 
3525 
3526 
3527       }
3528 
3529 
3530       /*
3531           Make warnings regular Perl warnings. This duplicates the warning
3532           message if DontUseExceptions() is in effect (it is not by default).
3533           */
3534       if ( eclass == CE_Warning ) {
3535         warn( CPLGetLastErrorMsg(), "%s" );
3536       }
3537 
3538 
3539     }
3540     {
3541       /* %typemap(out) OGRErr */
3542       if ( result != 0 ) {
3543         const char *err = CPLGetLastErrorMsg();
3544         if (err and *err) do_confess(err, 0); /* this is usually better */
3545         do_confess( OGRErrMessages(result), 1 );
3546       }
3547     }
3548 
3549     XSRETURN(argvi);
3550   fail:
3551 
3552     SWIG_croak_null();
3553   }
3554 }
3555 
3556 
XS(_wrap_Network_RollbackTransaction)3557 XS(_wrap_Network_RollbackTransaction) {
3558   {
3559     GNMNetworkShadow *arg1 = (GNMNetworkShadow *) 0 ;
3560     void *argp1 = 0 ;
3561     int res1 = 0 ;
3562     int argvi = 0;
3563     OGRErr result;
3564     dXSARGS;
3565 
3566     if ((items < 1) || (items > 1)) {
3567       SWIG_croak("Usage: Network_RollbackTransaction(self);");
3568     }
3569     res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_GNMNetworkShadow, 0 |  0 );
3570     if (!SWIG_IsOK(res1)) {
3571       SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Network_RollbackTransaction" "', argument " "1"" of type '" "GNMNetworkShadow *""'");
3572     }
3573     arg1 = reinterpret_cast< GNMNetworkShadow * >(argp1);
3574     {
3575       CPLErrorReset();
3576       result = (OGRErr)GNMNetworkShadow_RollbackTransaction(arg1);
3577       CPLErr eclass = CPLGetLastErrorType();
3578       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
3579         do_confess( CPLGetLastErrorMsg(), 0 );
3580 
3581 
3582 
3583 
3584 
3585       }
3586 
3587 
3588       /*
3589           Make warnings regular Perl warnings. This duplicates the warning
3590           message if DontUseExceptions() is in effect (it is not by default).
3591           */
3592       if ( eclass == CE_Warning ) {
3593         warn( CPLGetLastErrorMsg(), "%s" );
3594       }
3595 
3596 
3597     }
3598     {
3599       /* %typemap(out) OGRErr */
3600       if ( result != 0 ) {
3601         const char *err = CPLGetLastErrorMsg();
3602         if (err and *err) do_confess(err, 0); /* this is usually better */
3603         do_confess( OGRErrMessages(result), 1 );
3604       }
3605     }
3606 
3607     XSRETURN(argvi);
3608   fail:
3609 
3610     SWIG_croak_null();
3611   }
3612 }
3613 
3614 
XS(_wrap_delete_GenericNetwork)3615 XS(_wrap_delete_GenericNetwork) {
3616   {
3617     GNMGenericNetworkShadow *arg1 = (GNMGenericNetworkShadow *) 0 ;
3618     void *argp1 = 0 ;
3619     int res1 = 0 ;
3620     int argvi = 0;
3621     dXSARGS;
3622 
3623     if ((items < 1) || (items > 1)) {
3624       SWIG_croak("Usage: delete_GenericNetwork(self);");
3625     }
3626     res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_GNMGenericNetworkShadow, SWIG_POINTER_DISOWN |  0 );
3627     if (!SWIG_IsOK(res1)) {
3628       SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_GenericNetwork" "', argument " "1"" of type '" "GNMGenericNetworkShadow *""'");
3629     }
3630     arg1 = reinterpret_cast< GNMGenericNetworkShadow * >(argp1);
3631     {
3632       CPLErrorReset();
3633       delete_GNMGenericNetworkShadow(arg1);
3634       CPLErr eclass = CPLGetLastErrorType();
3635       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
3636         do_confess( CPLGetLastErrorMsg(), 0 );
3637 
3638 
3639 
3640 
3641 
3642       }
3643 
3644 
3645       /*
3646           Make warnings regular Perl warnings. This duplicates the warning
3647           message if DontUseExceptions() is in effect (it is not by default).
3648           */
3649       if ( eclass == CE_Warning ) {
3650         warn( CPLGetLastErrorMsg(), "%s" );
3651       }
3652 
3653 
3654     }
3655     {
3656       /* %typemap(out) void */
3657     }
3658 
3659     XSRETURN(argvi);
3660   fail:
3661 
3662     SWIG_croak_null();
3663   }
3664 }
3665 
3666 
XS(_wrap_GenericNetwork_ConnectFeatures)3667 XS(_wrap_GenericNetwork_ConnectFeatures) {
3668   {
3669     GNMGenericNetworkShadow *arg1 = (GNMGenericNetworkShadow *) 0 ;
3670     GIntBig arg2 ;
3671     GIntBig arg3 ;
3672     GIntBig arg4 ;
3673     double arg5 ;
3674     double arg6 ;
3675     GNMDirection arg7 ;
3676     void *argp1 = 0 ;
3677     int res1 = 0 ;
3678     double val5 ;
3679     int ecode5 = 0 ;
3680     double val6 ;
3681     int ecode6 = 0 ;
3682     int val7 ;
3683     int ecode7 = 0 ;
3684     int argvi = 0;
3685     CPLErr result;
3686     dXSARGS;
3687 
3688     if ((items < 7) || (items > 7)) {
3689       SWIG_croak("Usage: GenericNetwork_ConnectFeatures(self,nSrcFID,nTgtFID,nConFID,dfCost,dfInvCost,eDir);");
3690     }
3691     res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_GNMGenericNetworkShadow, 0 |  0 );
3692     if (!SWIG_IsOK(res1)) {
3693       SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "GenericNetwork_ConnectFeatures" "', argument " "1"" of type '" "GNMGenericNetworkShadow *""'");
3694     }
3695     arg1 = reinterpret_cast< GNMGenericNetworkShadow * >(argp1);
3696     {
3697       arg2 = CPLAtoGIntBig(SvPV_nolen(ST(1)));
3698     }
3699     {
3700       arg3 = CPLAtoGIntBig(SvPV_nolen(ST(2)));
3701     }
3702     {
3703       arg4 = CPLAtoGIntBig(SvPV_nolen(ST(3)));
3704     }
3705     ecode5 = SWIG_AsVal_double SWIG_PERL_CALL_ARGS_2(ST(4), &val5);
3706     if (!SWIG_IsOK(ecode5)) {
3707       SWIG_exception_fail(SWIG_ArgError(ecode5), "in method '" "GenericNetwork_ConnectFeatures" "', argument " "5"" of type '" "double""'");
3708     }
3709     arg5 = static_cast< double >(val5);
3710     ecode6 = SWIG_AsVal_double SWIG_PERL_CALL_ARGS_2(ST(5), &val6);
3711     if (!SWIG_IsOK(ecode6)) {
3712       SWIG_exception_fail(SWIG_ArgError(ecode6), "in method '" "GenericNetwork_ConnectFeatures" "', argument " "6"" of type '" "double""'");
3713     }
3714     arg6 = static_cast< double >(val6);
3715     ecode7 = SWIG_AsVal_int SWIG_PERL_CALL_ARGS_2(ST(6), &val7);
3716     if (!SWIG_IsOK(ecode7)) {
3717       SWIG_exception_fail(SWIG_ArgError(ecode7), "in method '" "GenericNetwork_ConnectFeatures" "', argument " "7"" of type '" "GNMDirection""'");
3718     }
3719     arg7 = static_cast< GNMDirection >(val7);
3720     {
3721       CPLErrorReset();
3722       result = (CPLErr)GNMGenericNetworkShadow_ConnectFeatures(arg1,arg2,arg3,arg4,arg5,arg6,arg7);
3723       CPLErr eclass = CPLGetLastErrorType();
3724       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
3725         do_confess( CPLGetLastErrorMsg(), 0 );
3726 
3727 
3728 
3729 
3730 
3731       }
3732 
3733 
3734       /*
3735           Make warnings regular Perl warnings. This duplicates the warning
3736           message if DontUseExceptions() is in effect (it is not by default).
3737           */
3738       if ( eclass == CE_Warning ) {
3739         warn( CPLGetLastErrorMsg(), "%s" );
3740       }
3741 
3742 
3743     }
3744     {
3745       /* %typemap(out) CPLErr */
3746     }
3747 
3748 
3749 
3750 
3751     XSRETURN(argvi);
3752   fail:
3753 
3754 
3755 
3756 
3757     SWIG_croak_null();
3758   }
3759 }
3760 
3761 
XS(_wrap_GenericNetwork_DisconnectFeatures)3762 XS(_wrap_GenericNetwork_DisconnectFeatures) {
3763   {
3764     GNMGenericNetworkShadow *arg1 = (GNMGenericNetworkShadow *) 0 ;
3765     GIntBig arg2 ;
3766     GIntBig arg3 ;
3767     GIntBig arg4 ;
3768     void *argp1 = 0 ;
3769     int res1 = 0 ;
3770     int argvi = 0;
3771     CPLErr result;
3772     dXSARGS;
3773 
3774     if ((items < 4) || (items > 4)) {
3775       SWIG_croak("Usage: GenericNetwork_DisconnectFeatures(self,nSrcFID,nTgtFID,nConFID);");
3776     }
3777     res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_GNMGenericNetworkShadow, 0 |  0 );
3778     if (!SWIG_IsOK(res1)) {
3779       SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "GenericNetwork_DisconnectFeatures" "', argument " "1"" of type '" "GNMGenericNetworkShadow *""'");
3780     }
3781     arg1 = reinterpret_cast< GNMGenericNetworkShadow * >(argp1);
3782     {
3783       arg2 = CPLAtoGIntBig(SvPV_nolen(ST(1)));
3784     }
3785     {
3786       arg3 = CPLAtoGIntBig(SvPV_nolen(ST(2)));
3787     }
3788     {
3789       arg4 = CPLAtoGIntBig(SvPV_nolen(ST(3)));
3790     }
3791     {
3792       CPLErrorReset();
3793       result = (CPLErr)GNMGenericNetworkShadow_DisconnectFeatures(arg1,arg2,arg3,arg4);
3794       CPLErr eclass = CPLGetLastErrorType();
3795       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
3796         do_confess( CPLGetLastErrorMsg(), 0 );
3797 
3798 
3799 
3800 
3801 
3802       }
3803 
3804 
3805       /*
3806           Make warnings regular Perl warnings. This duplicates the warning
3807           message if DontUseExceptions() is in effect (it is not by default).
3808           */
3809       if ( eclass == CE_Warning ) {
3810         warn( CPLGetLastErrorMsg(), "%s" );
3811       }
3812 
3813 
3814     }
3815     {
3816       /* %typemap(out) CPLErr */
3817     }
3818 
3819     XSRETURN(argvi);
3820   fail:
3821 
3822     SWIG_croak_null();
3823   }
3824 }
3825 
3826 
XS(_wrap_GenericNetwork_DisconnectFeaturesWithId)3827 XS(_wrap_GenericNetwork_DisconnectFeaturesWithId) {
3828   {
3829     GNMGenericNetworkShadow *arg1 = (GNMGenericNetworkShadow *) 0 ;
3830     GIntBig arg2 ;
3831     void *argp1 = 0 ;
3832     int res1 = 0 ;
3833     int argvi = 0;
3834     CPLErr result;
3835     dXSARGS;
3836 
3837     if ((items < 2) || (items > 2)) {
3838       SWIG_croak("Usage: GenericNetwork_DisconnectFeaturesWithId(self,nFID);");
3839     }
3840     res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_GNMGenericNetworkShadow, 0 |  0 );
3841     if (!SWIG_IsOK(res1)) {
3842       SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "GenericNetwork_DisconnectFeaturesWithId" "', argument " "1"" of type '" "GNMGenericNetworkShadow *""'");
3843     }
3844     arg1 = reinterpret_cast< GNMGenericNetworkShadow * >(argp1);
3845     {
3846       arg2 = CPLAtoGIntBig(SvPV_nolen(ST(1)));
3847     }
3848     {
3849       CPLErrorReset();
3850       result = (CPLErr)GNMGenericNetworkShadow_DisconnectFeaturesWithId(arg1,arg2);
3851       CPLErr eclass = CPLGetLastErrorType();
3852       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
3853         do_confess( CPLGetLastErrorMsg(), 0 );
3854 
3855 
3856 
3857 
3858 
3859       }
3860 
3861 
3862       /*
3863           Make warnings regular Perl warnings. This duplicates the warning
3864           message if DontUseExceptions() is in effect (it is not by default).
3865           */
3866       if ( eclass == CE_Warning ) {
3867         warn( CPLGetLastErrorMsg(), "%s" );
3868       }
3869 
3870 
3871     }
3872     {
3873       /* %typemap(out) CPLErr */
3874     }
3875 
3876     XSRETURN(argvi);
3877   fail:
3878 
3879     SWIG_croak_null();
3880   }
3881 }
3882 
3883 
XS(_wrap_GenericNetwork_ReconnectFeatures)3884 XS(_wrap_GenericNetwork_ReconnectFeatures) {
3885   {
3886     GNMGenericNetworkShadow *arg1 = (GNMGenericNetworkShadow *) 0 ;
3887     GIntBig arg2 ;
3888     GIntBig arg3 ;
3889     GIntBig arg4 ;
3890     double arg5 ;
3891     double arg6 ;
3892     GNMDirection arg7 ;
3893     void *argp1 = 0 ;
3894     int res1 = 0 ;
3895     double val5 ;
3896     int ecode5 = 0 ;
3897     double val6 ;
3898     int ecode6 = 0 ;
3899     int val7 ;
3900     int ecode7 = 0 ;
3901     int argvi = 0;
3902     CPLErr result;
3903     dXSARGS;
3904 
3905     if ((items < 7) || (items > 7)) {
3906       SWIG_croak("Usage: GenericNetwork_ReconnectFeatures(self,nSrcFID,nTgtFID,nConFID,dfCost,dfInvCost,eDir);");
3907     }
3908     res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_GNMGenericNetworkShadow, 0 |  0 );
3909     if (!SWIG_IsOK(res1)) {
3910       SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "GenericNetwork_ReconnectFeatures" "', argument " "1"" of type '" "GNMGenericNetworkShadow *""'");
3911     }
3912     arg1 = reinterpret_cast< GNMGenericNetworkShadow * >(argp1);
3913     {
3914       arg2 = CPLAtoGIntBig(SvPV_nolen(ST(1)));
3915     }
3916     {
3917       arg3 = CPLAtoGIntBig(SvPV_nolen(ST(2)));
3918     }
3919     {
3920       arg4 = CPLAtoGIntBig(SvPV_nolen(ST(3)));
3921     }
3922     ecode5 = SWIG_AsVal_double SWIG_PERL_CALL_ARGS_2(ST(4), &val5);
3923     if (!SWIG_IsOK(ecode5)) {
3924       SWIG_exception_fail(SWIG_ArgError(ecode5), "in method '" "GenericNetwork_ReconnectFeatures" "', argument " "5"" of type '" "double""'");
3925     }
3926     arg5 = static_cast< double >(val5);
3927     ecode6 = SWIG_AsVal_double SWIG_PERL_CALL_ARGS_2(ST(5), &val6);
3928     if (!SWIG_IsOK(ecode6)) {
3929       SWIG_exception_fail(SWIG_ArgError(ecode6), "in method '" "GenericNetwork_ReconnectFeatures" "', argument " "6"" of type '" "double""'");
3930     }
3931     arg6 = static_cast< double >(val6);
3932     ecode7 = SWIG_AsVal_int SWIG_PERL_CALL_ARGS_2(ST(6), &val7);
3933     if (!SWIG_IsOK(ecode7)) {
3934       SWIG_exception_fail(SWIG_ArgError(ecode7), "in method '" "GenericNetwork_ReconnectFeatures" "', argument " "7"" of type '" "GNMDirection""'");
3935     }
3936     arg7 = static_cast< GNMDirection >(val7);
3937     {
3938       CPLErrorReset();
3939       result = (CPLErr)GNMGenericNetworkShadow_ReconnectFeatures(arg1,arg2,arg3,arg4,arg5,arg6,arg7);
3940       CPLErr eclass = CPLGetLastErrorType();
3941       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
3942         do_confess( CPLGetLastErrorMsg(), 0 );
3943 
3944 
3945 
3946 
3947 
3948       }
3949 
3950 
3951       /*
3952           Make warnings regular Perl warnings. This duplicates the warning
3953           message if DontUseExceptions() is in effect (it is not by default).
3954           */
3955       if ( eclass == CE_Warning ) {
3956         warn( CPLGetLastErrorMsg(), "%s" );
3957       }
3958 
3959 
3960     }
3961     {
3962       /* %typemap(out) CPLErr */
3963     }
3964 
3965 
3966 
3967 
3968     XSRETURN(argvi);
3969   fail:
3970 
3971 
3972 
3973 
3974     SWIG_croak_null();
3975   }
3976 }
3977 
3978 
XS(_wrap_GenericNetwork_CreateRule)3979 XS(_wrap_GenericNetwork_CreateRule) {
3980   {
3981     GNMGenericNetworkShadow *arg1 = (GNMGenericNetworkShadow *) 0 ;
3982     char *arg2 = (char *) 0 ;
3983     void *argp1 = 0 ;
3984     int res1 = 0 ;
3985     int res2 ;
3986     char *buf2 = 0 ;
3987     int alloc2 = 0 ;
3988     int argvi = 0;
3989     CPLErr result;
3990     dXSARGS;
3991 
3992     if ((items < 2) || (items > 2)) {
3993       SWIG_croak("Usage: GenericNetwork_CreateRule(self,pszRuleStr);");
3994     }
3995     res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_GNMGenericNetworkShadow, 0 |  0 );
3996     if (!SWIG_IsOK(res1)) {
3997       SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "GenericNetwork_CreateRule" "', argument " "1"" of type '" "GNMGenericNetworkShadow *""'");
3998     }
3999     arg1 = reinterpret_cast< GNMGenericNetworkShadow * >(argp1);
4000     res2 = SWIG_AsCharPtrAndSize(ST(1), &buf2, NULL, &alloc2);
4001     if (!SWIG_IsOK(res2)) {
4002       SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "GenericNetwork_CreateRule" "', argument " "2"" of type '" "char const *""'");
4003     }
4004     arg2 = reinterpret_cast< char * >(buf2);
4005     {
4006       if (!arg2) {
4007         SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
4008       }
4009     }
4010     {
4011       CPLErrorReset();
4012       result = (CPLErr)GNMGenericNetworkShadow_CreateRule(arg1,(char const *)arg2);
4013       CPLErr eclass = CPLGetLastErrorType();
4014       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
4015         do_confess( CPLGetLastErrorMsg(), 0 );
4016 
4017 
4018 
4019 
4020 
4021       }
4022 
4023 
4024       /*
4025           Make warnings regular Perl warnings. This duplicates the warning
4026           message if DontUseExceptions() is in effect (it is not by default).
4027           */
4028       if ( eclass == CE_Warning ) {
4029         warn( CPLGetLastErrorMsg(), "%s" );
4030       }
4031 
4032 
4033     }
4034     {
4035       /* %typemap(out) CPLErr */
4036     }
4037 
4038     if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
4039     XSRETURN(argvi);
4040   fail:
4041 
4042     if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
4043     SWIG_croak_null();
4044   }
4045 }
4046 
4047 
XS(_wrap_GenericNetwork_DeleteAllRules)4048 XS(_wrap_GenericNetwork_DeleteAllRules) {
4049   {
4050     GNMGenericNetworkShadow *arg1 = (GNMGenericNetworkShadow *) 0 ;
4051     void *argp1 = 0 ;
4052     int res1 = 0 ;
4053     int argvi = 0;
4054     CPLErr result;
4055     dXSARGS;
4056 
4057     if ((items < 1) || (items > 1)) {
4058       SWIG_croak("Usage: GenericNetwork_DeleteAllRules(self);");
4059     }
4060     res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_GNMGenericNetworkShadow, 0 |  0 );
4061     if (!SWIG_IsOK(res1)) {
4062       SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "GenericNetwork_DeleteAllRules" "', argument " "1"" of type '" "GNMGenericNetworkShadow *""'");
4063     }
4064     arg1 = reinterpret_cast< GNMGenericNetworkShadow * >(argp1);
4065     {
4066       CPLErrorReset();
4067       result = (CPLErr)GNMGenericNetworkShadow_DeleteAllRules(arg1);
4068       CPLErr eclass = CPLGetLastErrorType();
4069       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
4070         do_confess( CPLGetLastErrorMsg(), 0 );
4071 
4072 
4073 
4074 
4075 
4076       }
4077 
4078 
4079       /*
4080           Make warnings regular Perl warnings. This duplicates the warning
4081           message if DontUseExceptions() is in effect (it is not by default).
4082           */
4083       if ( eclass == CE_Warning ) {
4084         warn( CPLGetLastErrorMsg(), "%s" );
4085       }
4086 
4087 
4088     }
4089     {
4090       /* %typemap(out) CPLErr */
4091     }
4092 
4093     XSRETURN(argvi);
4094   fail:
4095 
4096     SWIG_croak_null();
4097   }
4098 }
4099 
4100 
XS(_wrap_GenericNetwork_DeleteRule)4101 XS(_wrap_GenericNetwork_DeleteRule) {
4102   {
4103     GNMGenericNetworkShadow *arg1 = (GNMGenericNetworkShadow *) 0 ;
4104     char *arg2 = (char *) 0 ;
4105     void *argp1 = 0 ;
4106     int res1 = 0 ;
4107     int res2 ;
4108     char *buf2 = 0 ;
4109     int alloc2 = 0 ;
4110     int argvi = 0;
4111     CPLErr result;
4112     dXSARGS;
4113 
4114     if ((items < 2) || (items > 2)) {
4115       SWIG_croak("Usage: GenericNetwork_DeleteRule(self,pszRuleStr);");
4116     }
4117     res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_GNMGenericNetworkShadow, 0 |  0 );
4118     if (!SWIG_IsOK(res1)) {
4119       SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "GenericNetwork_DeleteRule" "', argument " "1"" of type '" "GNMGenericNetworkShadow *""'");
4120     }
4121     arg1 = reinterpret_cast< GNMGenericNetworkShadow * >(argp1);
4122     res2 = SWIG_AsCharPtrAndSize(ST(1), &buf2, NULL, &alloc2);
4123     if (!SWIG_IsOK(res2)) {
4124       SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "GenericNetwork_DeleteRule" "', argument " "2"" of type '" "char const *""'");
4125     }
4126     arg2 = reinterpret_cast< char * >(buf2);
4127     {
4128       if (!arg2) {
4129         SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
4130       }
4131     }
4132     {
4133       CPLErrorReset();
4134       result = (CPLErr)GNMGenericNetworkShadow_DeleteRule(arg1,(char const *)arg2);
4135       CPLErr eclass = CPLGetLastErrorType();
4136       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
4137         do_confess( CPLGetLastErrorMsg(), 0 );
4138 
4139 
4140 
4141 
4142 
4143       }
4144 
4145 
4146       /*
4147           Make warnings regular Perl warnings. This duplicates the warning
4148           message if DontUseExceptions() is in effect (it is not by default).
4149           */
4150       if ( eclass == CE_Warning ) {
4151         warn( CPLGetLastErrorMsg(), "%s" );
4152       }
4153 
4154 
4155     }
4156     {
4157       /* %typemap(out) CPLErr */
4158     }
4159 
4160     if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
4161     XSRETURN(argvi);
4162   fail:
4163 
4164     if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
4165     SWIG_croak_null();
4166   }
4167 }
4168 
4169 
XS(_wrap_GenericNetwork_GetRules)4170 XS(_wrap_GenericNetwork_GetRules) {
4171   {
4172     GNMGenericNetworkShadow *arg1 = (GNMGenericNetworkShadow *) 0 ;
4173     void *argp1 = 0 ;
4174     int res1 = 0 ;
4175     int argvi = 0;
4176     char **result = 0 ;
4177     dXSARGS;
4178 
4179     if ((items < 1) || (items > 1)) {
4180       SWIG_croak("Usage: GenericNetwork_GetRules(self);");
4181     }
4182     res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_GNMGenericNetworkShadow, 0 |  0 );
4183     if (!SWIG_IsOK(res1)) {
4184       SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "GenericNetwork_GetRules" "', argument " "1"" of type '" "GNMGenericNetworkShadow *""'");
4185     }
4186     arg1 = reinterpret_cast< GNMGenericNetworkShadow * >(argp1);
4187     {
4188       CPLErrorReset();
4189       result = (char **)GNMGenericNetworkShadow_GetRules(arg1);
4190       CPLErr eclass = CPLGetLastErrorType();
4191       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
4192         do_confess( CPLGetLastErrorMsg(), 0 );
4193 
4194 
4195 
4196 
4197 
4198       }
4199 
4200 
4201       /*
4202           Make warnings regular Perl warnings. This duplicates the warning
4203           message if DontUseExceptions() is in effect (it is not by default).
4204           */
4205       if ( eclass == CE_Warning ) {
4206         warn( CPLGetLastErrorMsg(), "%s" );
4207       }
4208 
4209 
4210     }
4211     {
4212       /* %typemap(out) char **CSL */
4213       if (GIMME_V == G_ARRAY) {
4214         if (result) {
4215           int n = CSLCount(result);
4216           EXTEND(SP, argvi+n-items+1);
4217           int i;
4218           for (i = 0; result[i]; i++) {
4219             SV *sv = newSVpv(result[i], 0);
4220             SvUTF8_on(sv); /* expecting GDAL to give us UTF-8 */
4221             ST(argvi++) = sv_2mortal(sv);
4222           }
4223           CSLDestroy(result);
4224         }
4225       } else {
4226         AV *av = (AV*)sv_2mortal((SV*)newAV());
4227         if (result) {
4228           int i;
4229           for (i = 0; result[i]; i++) {
4230             SV *sv = newSVpv(result[i], 0);
4231             SvUTF8_on(sv); /* expecting GDAL to give us UTF-8 */
4232             av_push(av, sv);
4233           }
4234           CSLDestroy(result);
4235         }
4236         ST(argvi) = newRV((SV*)av);
4237         sv_2mortal(ST(argvi));
4238         argvi++;
4239       }
4240     }
4241 
4242     XSRETURN(argvi);
4243   fail:
4244 
4245     SWIG_croak_null();
4246   }
4247 }
4248 
4249 
XS(_wrap_GenericNetwork_ConnectPointsByLines)4250 XS(_wrap_GenericNetwork_ConnectPointsByLines) {
4251   {
4252     GNMGenericNetworkShadow *arg1 = (GNMGenericNetworkShadow *) 0 ;
4253     char **arg2 = (char **) 0 ;
4254     double arg3 ;
4255     double arg4 ;
4256     double arg5 ;
4257     GNMDirection arg6 ;
4258     void *argp1 = 0 ;
4259     int res1 = 0 ;
4260     double val3 ;
4261     int ecode3 = 0 ;
4262     double val4 ;
4263     int ecode4 = 0 ;
4264     double val5 ;
4265     int ecode5 = 0 ;
4266     int val6 ;
4267     int ecode6 = 0 ;
4268     int argvi = 0;
4269     CPLErr result;
4270     dXSARGS;
4271 
4272     if ((items < 6) || (items > 6)) {
4273       SWIG_croak("Usage: GenericNetwork_ConnectPointsByLines(self,papszLayerList,dfTolerance,dfCost,dfInvCost,eDir);");
4274     }
4275     res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_GNMGenericNetworkShadow, 0 |  0 );
4276     if (!SWIG_IsOK(res1)) {
4277       SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "GenericNetwork_ConnectPointsByLines" "', argument " "1"" of type '" "GNMGenericNetworkShadow *""'");
4278     }
4279     arg1 = reinterpret_cast< GNMGenericNetworkShadow * >(argp1);
4280     {
4281       /* %typemap(in) char **options */
4282       if (SvOK(ST(1))) {
4283         if (SvROK(ST(1))) {
4284           if (SvTYPE(SvRV(ST(1)))==SVt_PVAV) {
4285             AV *av = (AV*)(SvRV(ST(1)));
4286             for (int i = 0; i < av_len(av)+1; i++) {
4287               SV *sv = *(av_fetch(av, i, 0));
4288               bool sf;
4289               char *tmp = sv_to_utf8_string(sv, NULL, &sf);
4290               arg2 = CSLAddString(arg2, tmp);
4291               if (sf) Safefree(tmp); else free(tmp);
4292             }
4293           } else if (SvTYPE(SvRV(ST(1)))==SVt_PVHV) {
4294             HV *hv = (HV*)SvRV(ST(1));
4295             SV *sv;
4296             char *key;
4297             I32 klen;
4298             arg2 = NULL;
4299             hv_iterinit(hv);
4300             while(sv = hv_iternextsv(hv, &key, &klen)) {
4301               bool sf;
4302               char *tmp = sv_to_utf8_string(sv, NULL, &sf);
4303               arg2 = CSLAddNameValue(arg2, key, tmp);
4304               if (sf) Safefree(tmp); else free(tmp);
4305             }
4306           } else
4307           do_confess(NEED_REF, 1);
4308         } else
4309         do_confess(NEED_REF, 1);
4310       }
4311     }
4312     ecode3 = SWIG_AsVal_double SWIG_PERL_CALL_ARGS_2(ST(2), &val3);
4313     if (!SWIG_IsOK(ecode3)) {
4314       SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "GenericNetwork_ConnectPointsByLines" "', argument " "3"" of type '" "double""'");
4315     }
4316     arg3 = static_cast< double >(val3);
4317     ecode4 = SWIG_AsVal_double SWIG_PERL_CALL_ARGS_2(ST(3), &val4);
4318     if (!SWIG_IsOK(ecode4)) {
4319       SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "GenericNetwork_ConnectPointsByLines" "', argument " "4"" of type '" "double""'");
4320     }
4321     arg4 = static_cast< double >(val4);
4322     ecode5 = SWIG_AsVal_double SWIG_PERL_CALL_ARGS_2(ST(4), &val5);
4323     if (!SWIG_IsOK(ecode5)) {
4324       SWIG_exception_fail(SWIG_ArgError(ecode5), "in method '" "GenericNetwork_ConnectPointsByLines" "', argument " "5"" of type '" "double""'");
4325     }
4326     arg5 = static_cast< double >(val5);
4327     ecode6 = SWIG_AsVal_int SWIG_PERL_CALL_ARGS_2(ST(5), &val6);
4328     if (!SWIG_IsOK(ecode6)) {
4329       SWIG_exception_fail(SWIG_ArgError(ecode6), "in method '" "GenericNetwork_ConnectPointsByLines" "', argument " "6"" of type '" "GNMDirection""'");
4330     }
4331     arg6 = static_cast< GNMDirection >(val6);
4332     {
4333       CPLErrorReset();
4334       result = (CPLErr)GNMGenericNetworkShadow_ConnectPointsByLines(arg1,arg2,arg3,arg4,arg5,arg6);
4335       CPLErr eclass = CPLGetLastErrorType();
4336       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
4337         do_confess( CPLGetLastErrorMsg(), 0 );
4338 
4339 
4340 
4341 
4342 
4343       }
4344 
4345 
4346       /*
4347           Make warnings regular Perl warnings. This duplicates the warning
4348           message if DontUseExceptions() is in effect (it is not by default).
4349           */
4350       if ( eclass == CE_Warning ) {
4351         warn( CPLGetLastErrorMsg(), "%s" );
4352       }
4353 
4354 
4355     }
4356     {
4357       /* %typemap(out) CPLErr */
4358     }
4359 
4360     {
4361       /* %typemap(freearg) char **options */
4362       if (arg2) CSLDestroy( arg2 );
4363     }
4364 
4365 
4366 
4367 
4368     XSRETURN(argvi);
4369   fail:
4370 
4371     {
4372       /* %typemap(freearg) char **options */
4373       if (arg2) CSLDestroy( arg2 );
4374     }
4375 
4376 
4377 
4378 
4379     SWIG_croak_null();
4380   }
4381 }
4382 
4383 
XS(_wrap_GenericNetwork_ChangeBlockState)4384 XS(_wrap_GenericNetwork_ChangeBlockState) {
4385   {
4386     GNMGenericNetworkShadow *arg1 = (GNMGenericNetworkShadow *) 0 ;
4387     GIntBig arg2 ;
4388     bool arg3 ;
4389     void *argp1 = 0 ;
4390     int res1 = 0 ;
4391     bool val3 ;
4392     int ecode3 = 0 ;
4393     int argvi = 0;
4394     CPLErr result;
4395     dXSARGS;
4396 
4397     if ((items < 3) || (items > 3)) {
4398       SWIG_croak("Usage: GenericNetwork_ChangeBlockState(self,nFID,bIsBlock);");
4399     }
4400     res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_GNMGenericNetworkShadow, 0 |  0 );
4401     if (!SWIG_IsOK(res1)) {
4402       SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "GenericNetwork_ChangeBlockState" "', argument " "1"" of type '" "GNMGenericNetworkShadow *""'");
4403     }
4404     arg1 = reinterpret_cast< GNMGenericNetworkShadow * >(argp1);
4405     {
4406       arg2 = CPLAtoGIntBig(SvPV_nolen(ST(1)));
4407     }
4408     ecode3 = SWIG_AsVal_bool SWIG_PERL_CALL_ARGS_2(ST(2), &val3);
4409     if (!SWIG_IsOK(ecode3)) {
4410       SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "GenericNetwork_ChangeBlockState" "', argument " "3"" of type '" "bool""'");
4411     }
4412     arg3 = static_cast< bool >(val3);
4413     {
4414       CPLErrorReset();
4415       result = (CPLErr)GNMGenericNetworkShadow_ChangeBlockState(arg1,arg2,arg3);
4416       CPLErr eclass = CPLGetLastErrorType();
4417       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
4418         do_confess( CPLGetLastErrorMsg(), 0 );
4419 
4420 
4421 
4422 
4423 
4424       }
4425 
4426 
4427       /*
4428           Make warnings regular Perl warnings. This duplicates the warning
4429           message if DontUseExceptions() is in effect (it is not by default).
4430           */
4431       if ( eclass == CE_Warning ) {
4432         warn( CPLGetLastErrorMsg(), "%s" );
4433       }
4434 
4435 
4436     }
4437     {
4438       /* %typemap(out) CPLErr */
4439     }
4440 
4441 
4442     XSRETURN(argvi);
4443   fail:
4444 
4445 
4446     SWIG_croak_null();
4447   }
4448 }
4449 
4450 
XS(_wrap_GenericNetwork_ChangeAllBlockState)4451 XS(_wrap_GenericNetwork_ChangeAllBlockState) {
4452   {
4453     GNMGenericNetworkShadow *arg1 = (GNMGenericNetworkShadow *) 0 ;
4454     bool arg2 = (bool) false ;
4455     void *argp1 = 0 ;
4456     int res1 = 0 ;
4457     bool val2 ;
4458     int ecode2 = 0 ;
4459     int argvi = 0;
4460     CPLErr result;
4461     dXSARGS;
4462 
4463     if ((items < 1) || (items > 2)) {
4464       SWIG_croak("Usage: GenericNetwork_ChangeAllBlockState(self,bIsBlock);");
4465     }
4466     res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_GNMGenericNetworkShadow, 0 |  0 );
4467     if (!SWIG_IsOK(res1)) {
4468       SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "GenericNetwork_ChangeAllBlockState" "', argument " "1"" of type '" "GNMGenericNetworkShadow *""'");
4469     }
4470     arg1 = reinterpret_cast< GNMGenericNetworkShadow * >(argp1);
4471     if (items > 1) {
4472       ecode2 = SWIG_AsVal_bool SWIG_PERL_CALL_ARGS_2(ST(1), &val2);
4473       if (!SWIG_IsOK(ecode2)) {
4474         SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "GenericNetwork_ChangeAllBlockState" "', argument " "2"" of type '" "bool""'");
4475       }
4476       arg2 = static_cast< bool >(val2);
4477     }
4478     {
4479       CPLErrorReset();
4480       result = (CPLErr)GNMGenericNetworkShadow_ChangeAllBlockState(arg1,arg2);
4481       CPLErr eclass = CPLGetLastErrorType();
4482       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
4483         do_confess( CPLGetLastErrorMsg(), 0 );
4484 
4485 
4486 
4487 
4488 
4489       }
4490 
4491 
4492       /*
4493           Make warnings regular Perl warnings. This duplicates the warning
4494           message if DontUseExceptions() is in effect (it is not by default).
4495           */
4496       if ( eclass == CE_Warning ) {
4497         warn( CPLGetLastErrorMsg(), "%s" );
4498       }
4499 
4500 
4501     }
4502     {
4503       /* %typemap(out) CPLErr */
4504     }
4505 
4506 
4507     XSRETURN(argvi);
4508   fail:
4509 
4510 
4511     SWIG_croak_null();
4512   }
4513 }
4514 
4515 
4516 
4517 /* -------- TYPE CONVERSION AND EQUIVALENCE RULES (BEGIN) -------- */
4518 
_p_OGRLayerShadowTo_p_GDALMajorObjectShadow(void * x,int * SWIGUNUSEDPARM (newmemory))4519 static void *_p_OGRLayerShadowTo_p_GDALMajorObjectShadow(void *x, int *SWIGUNUSEDPARM(newmemory)) {
4520     return (void *)((GDALMajorObjectShadow *)  ((OGRLayerShadow *) x));
4521 }
_p_GNMNetworkShadowTo_p_GDALMajorObjectShadow(void * x,int * SWIGUNUSEDPARM (newmemory))4522 static void *_p_GNMNetworkShadowTo_p_GDALMajorObjectShadow(void *x, int *SWIGUNUSEDPARM(newmemory)) {
4523     return (void *)((GDALMajorObjectShadow *)  ((GNMNetworkShadow *) x));
4524 }
_p_GNMGenericNetworkShadowTo_p_GDALMajorObjectShadow(void * x,int * SWIGUNUSEDPARM (newmemory))4525 static void *_p_GNMGenericNetworkShadowTo_p_GDALMajorObjectShadow(void *x, int *SWIGUNUSEDPARM(newmemory)) {
4526     return (void *)((GDALMajorObjectShadow *) (GNMNetworkShadow *) ((GNMGenericNetworkShadow *) x));
4527 }
_p_GNMGenericNetworkShadowTo_p_GNMNetworkShadow(void * x,int * SWIGUNUSEDPARM (newmemory))4528 static void *_p_GNMGenericNetworkShadowTo_p_GNMNetworkShadow(void *x, int *SWIGUNUSEDPARM(newmemory)) {
4529     return (void *)((GNMNetworkShadow *)  ((GNMGenericNetworkShadow *) x));
4530 }
4531 static swig_type_info _swigt__p_GDALMajorObjectShadow = {"_p_GDALMajorObjectShadow", "GDALMajorObjectShadow *", 0, 0, (void*)"Geo::GDAL::MajorObject", 0};
4532 static swig_type_info _swigt__p_GIntBig = {"_p_GIntBig", "GIntBig *", 0, 0, (void*)0, 0};
4533 static swig_type_info _swigt__p_GNMGenericNetworkShadow = {"_p_GNMGenericNetworkShadow", "GNMGenericNetworkShadow *", 0, 0, (void*)"Geo::GNM::GenericNetwork", 0};
4534 static swig_type_info _swigt__p_GNMGraphAlgorithmType = {"_p_GNMGraphAlgorithmType", "enum GNMGraphAlgorithmType *|GNMGraphAlgorithmType *", 0, 0, (void*)0, 0};
4535 static swig_type_info _swigt__p_GNMNetworkShadow = {"_p_GNMNetworkShadow", "GNMNetworkShadow *", 0, 0, (void*)"Geo::GNM::Network", 0};
4536 static swig_type_info _swigt__p_OGRFeatureShadow = {"_p_OGRFeatureShadow", "OGRFeatureShadow *", 0, 0, (void*)"Geo::OGR::Feature", 0};
4537 static swig_type_info _swigt__p_OGRLayerShadow = {"_p_OGRLayerShadow", "OGRLayerShadow *", 0, 0, (void*)"Geo::OGR::Layer", 0};
4538 static swig_type_info _swigt__p_OSRSpatialReferenceShadow = {"_p_OSRSpatialReferenceShadow", "OSRSpatialReferenceShadow *", 0, 0, (void*)"Geo::OSR::SpatialReference", 0};
4539 static swig_type_info _swigt__p_char = {"_p_char", "char *|retStringAndCPLFree *", 0, 0, (void*)0, 0};
4540 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};
4541 
4542 static swig_type_info *swig_type_initial[] = {
4543   &_swigt__p_GDALMajorObjectShadow,
4544   &_swigt__p_GIntBig,
4545   &_swigt__p_GNMGenericNetworkShadow,
4546   &_swigt__p_GNMGraphAlgorithmType,
4547   &_swigt__p_GNMNetworkShadow,
4548   &_swigt__p_OGRFeatureShadow,
4549   &_swigt__p_OGRLayerShadow,
4550   &_swigt__p_OSRSpatialReferenceShadow,
4551   &_swigt__p_char,
4552   &_swigt__p_int,
4553 };
4554 
4555 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}};
4556 static swig_cast_info _swigc__p_GIntBig[] = {  {&_swigt__p_GIntBig, 0, 0, 0},{0, 0, 0, 0}};
4557 static swig_cast_info _swigc__p_GNMGenericNetworkShadow[] = {  {&_swigt__p_GNMGenericNetworkShadow, 0, 0, 0},{0, 0, 0, 0}};
4558 static swig_cast_info _swigc__p_GNMGraphAlgorithmType[] = {  {&_swigt__p_GNMGraphAlgorithmType, 0, 0, 0},{0, 0, 0, 0}};
4559 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}};
4560 static swig_cast_info _swigc__p_OGRFeatureShadow[] = {  {&_swigt__p_OGRFeatureShadow, 0, 0, 0},{0, 0, 0, 0}};
4561 static swig_cast_info _swigc__p_OGRLayerShadow[] = {  {&_swigt__p_OGRLayerShadow, 0, 0, 0},{0, 0, 0, 0}};
4562 static swig_cast_info _swigc__p_OSRSpatialReferenceShadow[] = {  {&_swigt__p_OSRSpatialReferenceShadow, 0, 0, 0},{0, 0, 0, 0}};
4563 static swig_cast_info _swigc__p_char[] = {  {&_swigt__p_char, 0, 0, 0},{0, 0, 0, 0}};
4564 static swig_cast_info _swigc__p_int[] = {  {&_swigt__p_int, 0, 0, 0},{0, 0, 0, 0}};
4565 
4566 static swig_cast_info *swig_cast_initial[] = {
4567   _swigc__p_GDALMajorObjectShadow,
4568   _swigc__p_GIntBig,
4569   _swigc__p_GNMGenericNetworkShadow,
4570   _swigc__p_GNMGraphAlgorithmType,
4571   _swigc__p_GNMNetworkShadow,
4572   _swigc__p_OGRFeatureShadow,
4573   _swigc__p_OGRLayerShadow,
4574   _swigc__p_OSRSpatialReferenceShadow,
4575   _swigc__p_char,
4576   _swigc__p_int,
4577 };
4578 
4579 
4580 /* -------- TYPE CONVERSION AND EQUIVALENCE RULES (END) -------- */
4581 
4582 static swig_constant_info swig_constants[] = {
4583 {0,0,0,0,0,0}
4584 };
4585 #ifdef __cplusplus
4586 }
4587 #endif
4588 static swig_variable_info swig_variables[] = {
4589 {0,0,0,0}
4590 };
4591 static swig_command_info swig_commands[] = {
4592 {"Geo::GNMc::CastToNetwork", _wrap_CastToNetwork},
4593 {"Geo::GNMc::CastToGenericNetwork", _wrap_CastToGenericNetwork},
4594 {"Geo::GNMc::delete_Network", _wrap_delete_Network},
4595 {"Geo::GNMc::Network__ReleaseResultSet", _wrap_Network__ReleaseResultSet},
4596 {"Geo::GNMc::Network_GetVersion", _wrap_Network_GetVersion},
4597 {"Geo::GNMc::Network_GetName", _wrap_Network_GetName},
4598 {"Geo::GNMc::Network_GetFeatureByGlobalFID", _wrap_Network_GetFeatureByGlobalFID},
4599 {"Geo::GNMc::Network_GetPath", _wrap_Network_GetPath},
4600 {"Geo::GNMc::Network_DisconnectAll", _wrap_Network_DisconnectAll},
4601 {"Geo::GNMc::Network_GetProjection", _wrap_Network_GetProjection},
4602 {"Geo::GNMc::Network_GetProjectionRef", _wrap_Network_GetProjectionRef},
4603 {"Geo::GNMc::Network_GetFileList", _wrap_Network_GetFileList},
4604 {"Geo::GNMc::Network__CreateLayer", _wrap_Network__CreateLayer},
4605 {"Geo::GNMc::Network_CopyLayer", _wrap_Network_CopyLayer},
4606 {"Geo::GNMc::Network__DeleteLayer", _wrap_Network__DeleteLayer},
4607 {"Geo::GNMc::Network_GetLayerCount", _wrap_Network_GetLayerCount},
4608 {"Geo::GNMc::Network_GetLayerByIndex", _wrap_Network_GetLayerByIndex},
4609 {"Geo::GNMc::Network_GetLayerByName", _wrap_Network_GetLayerByName},
4610 {"Geo::GNMc::Network__TestCapability", _wrap_Network__TestCapability},
4611 {"Geo::GNMc::Network_StartTransaction", _wrap_Network_StartTransaction},
4612 {"Geo::GNMc::Network_CommitTransaction", _wrap_Network_CommitTransaction},
4613 {"Geo::GNMc::Network_RollbackTransaction", _wrap_Network_RollbackTransaction},
4614 {"Geo::GNMc::delete_GenericNetwork", _wrap_delete_GenericNetwork},
4615 {"Geo::GNMc::GenericNetwork_ConnectFeatures", _wrap_GenericNetwork_ConnectFeatures},
4616 {"Geo::GNMc::GenericNetwork_DisconnectFeatures", _wrap_GenericNetwork_DisconnectFeatures},
4617 {"Geo::GNMc::GenericNetwork_DisconnectFeaturesWithId", _wrap_GenericNetwork_DisconnectFeaturesWithId},
4618 {"Geo::GNMc::GenericNetwork_ReconnectFeatures", _wrap_GenericNetwork_ReconnectFeatures},
4619 {"Geo::GNMc::GenericNetwork_CreateRule", _wrap_GenericNetwork_CreateRule},
4620 {"Geo::GNMc::GenericNetwork_DeleteAllRules", _wrap_GenericNetwork_DeleteAllRules},
4621 {"Geo::GNMc::GenericNetwork_DeleteRule", _wrap_GenericNetwork_DeleteRule},
4622 {"Geo::GNMc::GenericNetwork_GetRules", _wrap_GenericNetwork_GetRules},
4623 {"Geo::GNMc::GenericNetwork_ConnectPointsByLines", _wrap_GenericNetwork_ConnectPointsByLines},
4624 {"Geo::GNMc::GenericNetwork_ChangeBlockState", _wrap_GenericNetwork_ChangeBlockState},
4625 {"Geo::GNMc::GenericNetwork_ChangeAllBlockState", _wrap_GenericNetwork_ChangeAllBlockState},
4626 {0,0}
4627 };
4628 /* -----------------------------------------------------------------------------
4629  * Type initialization:
4630  * This problem is tough by the requirement that no dynamic
4631  * memory is used. Also, since swig_type_info structures store pointers to
4632  * swig_cast_info structures and swig_cast_info structures store pointers back
4633  * to swig_type_info structures, we need some lookup code at initialization.
4634  * The idea is that swig generates all the structures that are needed.
4635  * The runtime then collects these partially filled structures.
4636  * The SWIG_InitializeModule function takes these initial arrays out of
4637  * swig_module, and does all the lookup, filling in the swig_module.types
4638  * array with the correct data and linking the correct swig_cast_info
4639  * structures together.
4640  *
4641  * The generated swig_type_info structures are assigned statically to an initial
4642  * array. We just loop through that array, and handle each type individually.
4643  * First we lookup if this type has been already loaded, and if so, use the
4644  * loaded structure instead of the generated one. Then we have to fill in the
4645  * cast linked list. The cast data is initially stored in something like a
4646  * two-dimensional array. Each row corresponds to a type (there are the same
4647  * number of rows as there are in the swig_type_initial array). Each entry in
4648  * a column is one of the swig_cast_info structures for that type.
4649  * The cast_initial array is actually an array of arrays, because each row has
4650  * a variable number of columns. So to actually build the cast linked list,
4651  * we find the array of casts associated with the type, and loop through it
4652  * adding the casts to the list. The one last trick we need to do is making
4653  * sure the type pointer in the swig_cast_info struct is correct.
4654  *
4655  * First off, we lookup the cast->type name to see if it is already loaded.
4656  * There are three cases to handle:
4657  *  1) If the cast->type has already been loaded AND the type we are adding
4658  *     casting info to has not been loaded (it is in this module), THEN we
4659  *     replace the cast->type pointer with the type pointer that has already
4660  *     been loaded.
4661  *  2) If BOTH types (the one we are adding casting info to, and the
4662  *     cast->type) are loaded, THEN the cast info has already been loaded by
4663  *     the previous module so we just ignore it.
4664  *  3) Finally, if cast->type has not already been loaded, then we add that
4665  *     swig_cast_info to the linked list (because the cast->type) pointer will
4666  *     be correct.
4667  * ----------------------------------------------------------------------------- */
4668 
4669 #ifdef __cplusplus
4670 extern "C" {
4671 #if 0
4672 } /* c-mode */
4673 #endif
4674 #endif
4675 
4676 #if 0
4677 #define SWIGRUNTIME_DEBUG
4678 #endif
4679 
4680 
4681 SWIGRUNTIME void
SWIG_InitializeModule(void * clientdata)4682 SWIG_InitializeModule(void *clientdata) {
4683   size_t i;
4684   swig_module_info *module_head, *iter;
4685   int init;
4686 
4687   /* check to see if the circular list has been setup, if not, set it up */
4688   if (swig_module.next==0) {
4689     /* Initialize the swig_module */
4690     swig_module.type_initial = swig_type_initial;
4691     swig_module.cast_initial = swig_cast_initial;
4692     swig_module.next = &swig_module;
4693     init = 1;
4694   } else {
4695     init = 0;
4696   }
4697 
4698   /* Try and load any already created modules */
4699   module_head = SWIG_GetModule(clientdata);
4700   if (!module_head) {
4701     /* This is the first module loaded for this interpreter */
4702     /* so set the swig module into the interpreter */
4703     SWIG_SetModule(clientdata, &swig_module);
4704   } else {
4705     /* the interpreter has loaded a SWIG module, but has it loaded this one? */
4706     iter=module_head;
4707     do {
4708       if (iter==&swig_module) {
4709         /* Our module is already in the list, so there's nothing more to do. */
4710         return;
4711       }
4712       iter=iter->next;
4713     } while (iter!= module_head);
4714 
4715     /* otherwise we must add our module into the list */
4716     swig_module.next = module_head->next;
4717     module_head->next = &swig_module;
4718   }
4719 
4720   /* When multiple interpreters are used, a module could have already been initialized in
4721        a different interpreter, but not yet have a pointer in this interpreter.
4722        In this case, we do not want to continue adding types... everything should be
4723        set up already */
4724   if (init == 0) return;
4725 
4726   /* Now work on filling in swig_module.types */
4727 #ifdef SWIGRUNTIME_DEBUG
4728   printf("SWIG_InitializeModule: size %d\n", swig_module.size);
4729 #endif
4730   for (i = 0; i < swig_module.size; ++i) {
4731     swig_type_info *type = 0;
4732     swig_type_info *ret;
4733     swig_cast_info *cast;
4734 
4735 #ifdef SWIGRUNTIME_DEBUG
4736     printf("SWIG_InitializeModule: type %d %s\n", i, swig_module.type_initial[i]->name);
4737 #endif
4738 
4739     /* if there is another module already loaded */
4740     if (swig_module.next != &swig_module) {
4741       type = SWIG_MangledTypeQueryModule(swig_module.next, &swig_module, swig_module.type_initial[i]->name);
4742     }
4743     if (type) {
4744       /* Overwrite clientdata field */
4745 #ifdef SWIGRUNTIME_DEBUG
4746       printf("SWIG_InitializeModule: found type %s\n", type->name);
4747 #endif
4748       if (swig_module.type_initial[i]->clientdata) {
4749         type->clientdata = swig_module.type_initial[i]->clientdata;
4750 #ifdef SWIGRUNTIME_DEBUG
4751         printf("SWIG_InitializeModule: found and overwrite type %s \n", type->name);
4752 #endif
4753       }
4754     } else {
4755       type = swig_module.type_initial[i];
4756     }
4757 
4758     /* Insert casting types */
4759     cast = swig_module.cast_initial[i];
4760     while (cast->type) {
4761       /* Don't need to add information already in the list */
4762       ret = 0;
4763 #ifdef SWIGRUNTIME_DEBUG
4764       printf("SWIG_InitializeModule: look cast %s\n", cast->type->name);
4765 #endif
4766       if (swig_module.next != &swig_module) {
4767         ret = SWIG_MangledTypeQueryModule(swig_module.next, &swig_module, cast->type->name);
4768 #ifdef SWIGRUNTIME_DEBUG
4769         if (ret) printf("SWIG_InitializeModule: found cast %s\n", ret->name);
4770 #endif
4771       }
4772       if (ret) {
4773         if (type == swig_module.type_initial[i]) {
4774 #ifdef SWIGRUNTIME_DEBUG
4775           printf("SWIG_InitializeModule: skip old type %s\n", ret->name);
4776 #endif
4777           cast->type = ret;
4778           ret = 0;
4779         } else {
4780           /* Check for casting already in the list */
4781           swig_cast_info *ocast = SWIG_TypeCheck(ret->name, type);
4782 #ifdef SWIGRUNTIME_DEBUG
4783           if (ocast) printf("SWIG_InitializeModule: skip old cast %s\n", ret->name);
4784 #endif
4785           if (!ocast) ret = 0;
4786         }
4787       }
4788 
4789       if (!ret) {
4790 #ifdef SWIGRUNTIME_DEBUG
4791         printf("SWIG_InitializeModule: adding cast %s\n", cast->type->name);
4792 #endif
4793         if (type->cast) {
4794           type->cast->prev = cast;
4795           cast->next = type->cast;
4796         }
4797         type->cast = cast;
4798       }
4799       cast++;
4800     }
4801     /* Set entry in modules->types array equal to the type */
4802     swig_module.types[i] = type;
4803   }
4804   swig_module.types[i] = 0;
4805 
4806 #ifdef SWIGRUNTIME_DEBUG
4807   printf("**** SWIG_InitializeModule: Cast List ******\n");
4808   for (i = 0; i < swig_module.size; ++i) {
4809     int j = 0;
4810     swig_cast_info *cast = swig_module.cast_initial[i];
4811     printf("SWIG_InitializeModule: type %d %s\n", i, swig_module.type_initial[i]->name);
4812     while (cast->type) {
4813       printf("SWIG_InitializeModule: cast type %s\n", cast->type->name);
4814       cast++;
4815       ++j;
4816     }
4817     printf("---- Total casts: %d\n",j);
4818   }
4819   printf("**** SWIG_InitializeModule: Cast List ******\n");
4820 #endif
4821 }
4822 
4823 /* This function will propagate the clientdata field of type to
4824 * any new swig_type_info structures that have been added into the list
4825 * of equivalent types.  It is like calling
4826 * SWIG_TypeClientData(type, clientdata) a second time.
4827 */
4828 SWIGRUNTIME void
SWIG_PropagateClientData(void)4829 SWIG_PropagateClientData(void) {
4830   size_t i;
4831   swig_cast_info *equiv;
4832   static int init_run = 0;
4833 
4834   if (init_run) return;
4835   init_run = 1;
4836 
4837   for (i = 0; i < swig_module.size; i++) {
4838     if (swig_module.types[i]->clientdata) {
4839       equiv = swig_module.types[i]->cast;
4840       while (equiv) {
4841         if (!equiv->converter) {
4842           if (equiv->type && !equiv->type->clientdata)
4843           SWIG_TypeClientData(equiv->type, swig_module.types[i]->clientdata);
4844         }
4845         equiv = equiv->next;
4846       }
4847     }
4848   }
4849 }
4850 
4851 #ifdef __cplusplus
4852 #if 0
4853 {
4854   /* c-mode */
4855 #endif
4856 }
4857 #endif
4858 
4859 
4860 
4861 #if defined(__cplusplus) && ! defined(XSPROTO)
4862 extern "C"
4863 #endif
4864 
XS(SWIG_init)4865 XS(SWIG_init) {
4866   dXSARGS;
4867   int i;
4868   (void)items;
4869 
4870   SWIG_InitializeModule(0);
4871 
4872   /* Install commands */
4873   for (i = 0; swig_commands[i].name; i++) {
4874     /* Casts only needed for Perl < 5.10. */
4875 #ifdef __cplusplus
4876     newXS(const_cast<char*>(swig_commands[i].name), swig_commands[i].wrapper, const_cast<char*>(__FILE__));
4877 #else
4878     newXS((char*)swig_commands[i].name, swig_commands[i].wrapper, (char*)__FILE__);
4879 #endif
4880   }
4881 
4882   /* Install variables */
4883   for (i = 0; swig_variables[i].name; i++) {
4884     SV *sv;
4885     sv = get_sv(swig_variables[i].name, TRUE | 0x2 | GV_ADDMULTI);
4886     if (swig_variables[i].type) {
4887       SWIG_MakePtr(sv,(void *)1, *swig_variables[i].type,0);
4888     } else {
4889       sv_setiv(sv,(IV) 0);
4890     }
4891     swig_create_magic(sv, swig_variables[i].name, swig_variables[i].set, swig_variables[i].get);
4892   }
4893 
4894   /* Install constant */
4895   for (i = 0; swig_constants[i].type; i++) {
4896     SV *sv;
4897     sv = get_sv(swig_constants[i].name, TRUE | 0x2 | GV_ADDMULTI);
4898     switch(swig_constants[i].type) {
4899     case SWIG_INT:
4900       sv_setiv(sv, (IV) swig_constants[i].lvalue);
4901       break;
4902     case SWIG_FLOAT:
4903       sv_setnv(sv, (double) swig_constants[i].dvalue);
4904       break;
4905     case SWIG_STRING:
4906       sv_setpv(sv, (const char *) swig_constants[i].pvalue);
4907       break;
4908     case SWIG_POINTER:
4909       SWIG_MakePtr(sv, swig_constants[i].pvalue, *(swig_constants[i].ptype),0);
4910       break;
4911     case SWIG_BINARY:
4912       SWIG_MakePackedObj(sv, swig_constants[i].pvalue, swig_constants[i].lvalue, *(swig_constants[i].ptype));
4913       break;
4914     default:
4915       break;
4916     }
4917     SvREADONLY_on(sv);
4918   }
4919 
4920   /*@SWIG:/home/even/install-swig-3.0.12/share/swig/3.0.12/perl5/perltypemaps.swg,65,%set_constant@*/ do {
4921     SV *sv = get_sv((char*) SWIG_prefix "GATDijkstraShortestPath", TRUE | 0x2 | GV_ADDMULTI);
4922     sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1(static_cast< int >(GATDijkstraShortestPath)));
4923     SvREADONLY_on(sv);
4924   } while(0) /*@SWIG@*/;
4925   /*@SWIG:/home/even/install-swig-3.0.12/share/swig/3.0.12/perl5/perltypemaps.swg,65,%set_constant@*/ do {
4926     SV *sv = get_sv((char*) SWIG_prefix "GATKShortestPath", TRUE | 0x2 | GV_ADDMULTI);
4927     sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1(static_cast< int >(GATKShortestPath)));
4928     SvREADONLY_on(sv);
4929   } while(0) /*@SWIG@*/;
4930   /*@SWIG:/home/even/install-swig-3.0.12/share/swig/3.0.12/perl5/perltypemaps.swg,65,%set_constant@*/ do {
4931     SV *sv = get_sv((char*) SWIG_prefix "GATConnectedComponents", TRUE | 0x2 | GV_ADDMULTI);
4932     sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1(static_cast< int >(GATConnectedComponents)));
4933     SvREADONLY_on(sv);
4934   } while(0) /*@SWIG@*/;
4935   /*@SWIG:/home/even/install-swig-3.0.12/share/swig/3.0.12/perl5/perltypemaps.swg,65,%set_constant@*/ do {
4936     SV *sv = get_sv((char*) SWIG_prefix "GNM_EDGE_DIR_BOTH", TRUE | 0x2 | GV_ADDMULTI);
4937     sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1(static_cast< int >(0)));
4938     SvREADONLY_on(sv);
4939   } while(0) /*@SWIG@*/;
4940   /*@SWIG:/home/even/install-swig-3.0.12/share/swig/3.0.12/perl5/perltypemaps.swg,65,%set_constant@*/ do {
4941     SV *sv = get_sv((char*) SWIG_prefix "GNM_EDGE_DIR_SRCTOTGT", TRUE | 0x2 | GV_ADDMULTI);
4942     sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1(static_cast< int >(1)));
4943     SvREADONLY_on(sv);
4944   } while(0) /*@SWIG@*/;
4945   /*@SWIG:/home/even/install-swig-3.0.12/share/swig/3.0.12/perl5/perltypemaps.swg,65,%set_constant@*/ do {
4946     SV *sv = get_sv((char*) SWIG_prefix "GNM_EDGE_DIR_TGTTOSRC", TRUE | 0x2 | GV_ADDMULTI);
4947     sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1(static_cast< int >(2)));
4948     SvREADONLY_on(sv);
4949   } while(0) /*@SWIG@*/;
4950   SWIG_TypeClientData(SWIGTYPE_p_GNMNetworkShadow, (void*) "Geo::GNM::Network");
4951   SWIG_TypeClientData(SWIGTYPE_p_GNMGenericNetworkShadow, (void*) "Geo::GNM::GenericNetwork");
4952   ST(0) = &PL_sv_yes;
4953   XSRETURN(1);
4954 }
4955 
4956