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_CPLErrorHandler swig_types[0]
1537 #define SWIGTYPE_p_CPLXMLNode swig_types[1]
1538 #define SWIGTYPE_p_FILE swig_types[2]
1539 #define SWIGTYPE_p_GByte swig_types[3]
1540 #define SWIGTYPE_p_GDALAsyncReaderShadow swig_types[4]
1541 #define SWIGTYPE_p_GDALAttributeHS swig_types[5]
1542 #define SWIGTYPE_p_GDALBuildVRTOptions swig_types[6]
1543 #define SWIGTYPE_p_GDALColorEntry swig_types[7]
1544 #define SWIGTYPE_p_GDALColorTableShadow swig_types[8]
1545 #define SWIGTYPE_p_GDALDEMProcessingOptions swig_types[9]
1546 #define SWIGTYPE_p_GDALDatasetShadow swig_types[10]
1547 #define SWIGTYPE_p_GDALDimensionHS swig_types[11]
1548 #define SWIGTYPE_p_GDALDriverShadow swig_types[12]
1549 #define SWIGTYPE_p_GDALEDTComponentHS swig_types[13]
1550 #define SWIGTYPE_p_GDALExtendedDataTypeClass swig_types[14]
1551 #define SWIGTYPE_p_GDALExtendedDataTypeHS swig_types[15]
1552 #define SWIGTYPE_p_GDALGridOptions swig_types[16]
1553 #define SWIGTYPE_p_GDALGroupHS swig_types[17]
1554 #define SWIGTYPE_p_GDALInfoOptions swig_types[18]
1555 #define SWIGTYPE_p_GDALMDArrayHS swig_types[19]
1556 #define SWIGTYPE_p_GDALMajorObjectShadow swig_types[20]
1557 #define SWIGTYPE_p_GDALMultiDimInfoOptions swig_types[21]
1558 #define SWIGTYPE_p_GDALMultiDimTranslateOptions swig_types[22]
1559 #define SWIGTYPE_p_GDALNearblackOptions swig_types[23]
1560 #define SWIGTYPE_p_GDALProgressFunc swig_types[24]
1561 #define SWIGTYPE_p_GDALRasterAttributeTableShadow swig_types[25]
1562 #define SWIGTYPE_p_GDALRasterBandShadow swig_types[26]
1563 #define SWIGTYPE_p_GDALRasterizeOptions swig_types[27]
1564 #define SWIGTYPE_p_GDALTransformerInfoShadow swig_types[28]
1565 #define SWIGTYPE_p_GDALTranslateOptions swig_types[29]
1566 #define SWIGTYPE_p_GDALVectorTranslateOptions swig_types[30]
1567 #define SWIGTYPE_p_GDALViewshedMode swig_types[31]
1568 #define SWIGTYPE_p_GDALViewshedOutputType swig_types[32]
1569 #define SWIGTYPE_p_GDALWarpAppOptions swig_types[33]
1570 #define SWIGTYPE_p_GDAL_GCP swig_types[34]
1571 #define SWIGTYPE_p_GIntBig swig_types[35]
1572 #define SWIGTYPE_p_GUIntBig swig_types[36]
1573 #define SWIGTYPE_p_OGRFeatureShadow swig_types[37]
1574 #define SWIGTYPE_p_OGRFieldDomainShadow swig_types[38]
1575 #define SWIGTYPE_p_OGRGeometryShadow swig_types[39]
1576 #define SWIGTYPE_p_OGRLayerShadow swig_types[40]
1577 #define SWIGTYPE_p_OGRStyleTableShadow swig_types[41]
1578 #define SWIGTYPE_p_OSRSpatialReferenceShadow swig_types[42]
1579 #define SWIGTYPE_p_Statistics swig_types[43]
1580 #define SWIGTYPE_p_VSILFILE swig_types[44]
1581 #define SWIGTYPE_p_VSIStatBufL swig_types[45]
1582 #define SWIGTYPE_p_VSIWriteFunction swig_types[46]
1583 #define SWIGTYPE_p_char swig_types[47]
1584 #define SWIGTYPE_p_double swig_types[48]
1585 #define SWIGTYPE_p_f_double_p_q_const__char_p_void__int swig_types[49]
1586 #define SWIGTYPE_p_int swig_types[50]
1587 #define SWIGTYPE_p_p_GDALDatasetShadow swig_types[51]
1588 #define SWIGTYPE_p_p_GDALRasterBandShadow swig_types[52]
1589 #define SWIGTYPE_p_p_GDAL_GCP swig_types[53]
1590 #define SWIGTYPE_p_p_GUIntBig swig_types[54]
1591 #define SWIGTYPE_p_p_char swig_types[55]
1592 static swig_type_info *swig_types[57];
1593 static swig_module_info swig_module = {swig_types, 56, 0, 0, 0, 0};
1594 #define SWIG_TypeQuery(name) SWIG_TypeQueryModule(&swig_module, &swig_module, name)
1595 #define SWIG_MangledTypeQuery(name) SWIG_MangledTypeQueryModule(&swig_module, &swig_module, name)
1596 
1597 /* -------- TYPES TABLE (END) -------- */
1598 
1599 #define SWIG_init    boot_Geo__GDAL
1600 
1601 #define SWIG_name   "Geo::GDALc::boot_Geo__GDAL"
1602 #define SWIG_prefix "Geo::GDALc::"
1603 
1604 #define SWIGVERSION 0x030012
1605 #define SWIG_VERSION SWIGVERSION
1606 
1607 
1608 #define SWIG_as_voidptr(a) const_cast< void * >(static_cast< const void * >(a))
1609 #define SWIG_as_voidptrptr(a) ((void)SWIG_as_voidptr(*a),reinterpret_cast< void** >(a))
1610 
1611 
1612 #include <stdexcept>
1613 
1614 
1615 #ifdef __cplusplus
1616 extern "C"
1617 #endif
1618 #ifndef PERL_OBJECT
1619 #ifndef MULTIPLICITY
1620 SWIGEXPORT void SWIG_init (CV* cv);
1621 #else
1622 SWIGEXPORT void SWIG_init (pTHXo_ CV* cv);
1623 #endif
1624 #else
1625 SWIGEXPORT void SWIG_init (CV *cv, CPerlObj *);
1626 #endif
1627 
1628 
1629 #include <iostream>
1630 #include <vector>
1631 using namespace std;
1632 
1633 #define CPL_SUPRESS_CPLUSPLUS
1634 #include "cpl_port.h"
1635 #include "cpl_string.h"
1636 #include "cpl_multiproc.h"
1637 #include "cpl_http.h"
1638 #include "cpl_vsi_error.h"
1639 
1640 #include "gdal.h"
1641 #include "gdal_alg.h"
1642 #include "gdalwarper.h"
1643 #include "ogr_srs_api.h"
1644 
1645 typedef void GDALMajorObjectShadow;
1646 typedef void GDALDriverShadow;
1647 typedef void GDALDatasetShadow;
1648 typedef void GDALRasterBandShadow;
1649 typedef void GDALColorTableShadow;
1650 typedef void GDALRasterAttributeTableShadow;
1651 typedef void GDALTransformerInfoShadow;
1652 typedef void GDALAsyncReaderShadow;
1653 
1654 typedef GDALExtendedDataTypeHS GDALExtendedDataTypeHS;
1655 typedef GDALEDTComponentHS GDALEDTComponentHS;
1656 typedef GDALGroupHS GDALGroupHS;
1657 typedef GDALMDArrayHS GDALMDArrayHS;
1658 typedef GDALAttributeHS GDALAttributeHS;
1659 typedef GDALDimensionHS GDALDimensionHS;
1660 
1661 
1662 
1663 #ifdef DEBUG
1664 typedef struct OGRSpatialReferenceHS OSRSpatialReferenceShadow;
1665 typedef struct OGRLayerHS OGRLayerShadow;
1666 typedef struct OGRFeatureHS OGRFeatureShadow;
1667 typedef struct OGRGeometryHS OGRGeometryShadow;
1668 #else
1669 typedef void OSRSpatialReferenceShadow;
1670 typedef void OGRLayerShadow;
1671 typedef void OGRFeatureShadow;
1672 typedef void OGRGeometryShadow;
1673 #endif
1674 
1675 typedef struct OGRStyleTableHS OGRStyleTableShadow;
1676 typedef struct OGRFieldDomainHS OGRFieldDomainShadow;
1677 
1678 
1679 /* use this to not return the int returned by GDAL */
1680 typedef int RETURN_NONE;
1681 /* return value that is used for VSI methods that return -1 on error (and set errno) */
1682 typedef int VSI_RETVAL;
1683 
1684 
1685     #ifndef SWIG
1686     typedef struct
1687     {
1688         SV *fct;
1689         SV *data;
1690     } SavedEnv;
1691     #endif
callback_d_cp_vp(double d,const char * cp,void * vp)1692     int callback_d_cp_vp(double d, const char *cp, void *vp)
1693     {
1694         int count, ret;
1695         SavedEnv *env_ptr = (SavedEnv *)vp;
1696         dSP;
1697         ENTER;
1698         SAVETMPS;
1699         PUSHMARK(SP);
1700         XPUSHs(sv_2mortal(newSVnv(d)));
1701         XPUSHs(sv_2mortal(newSVpv(cp, 0)));
1702         if (env_ptr->data)
1703             XPUSHs(env_ptr->data);
1704         PUTBACK;
1705         count = call_sv(env_ptr->fct, G_SCALAR);
1706         SPAGAIN;
1707         if (count != 1) {
1708             fprintf(stderr, "The callback must return only one value.\n");
1709             return 0; /* interrupt */
1710         }
1711         ret = POPi;
1712         PUTBACK;
1713         FREETMPS;
1714         LEAVE;
1715         return ret;
1716     }
1717     #ifndef SWIG
1718     static SV *VSIStdoutSetRedirectionFct = &PL_sv_undef;
1719     #endif
callback_fwrite(const void * ptr,size_t size,size_t nmemb,FILE * stream)1720     size_t callback_fwrite(const void *ptr, size_t size, size_t nmemb,
1721                            FILE *stream)
1722     {
1723         dSP;
1724         ENTER;
1725         SAVETMPS;
1726         PUSHMARK(SP);
1727         XPUSHs(sv_2mortal(newSVpv((const char*)ptr, size*nmemb)));
1728         PUTBACK;
1729         call_sv(VSIStdoutSetRedirectionFct, G_DISCARD);
1730         FREETMPS;
1731         LEAVE;
1732         return size*nmemb;
1733     }
1734 
1735 
do_confess(const char * error,int push_to_error_stack)1736     void do_confess(const char *error, int push_to_error_stack) {
1737         SV *sv = newSVpv("", 0);
1738         sv_setpvf(sv, "%s\n", error);
1739         if (push_to_error_stack) {
1740             AV* error_stack = get_av("Geo::GDAL::error", 0);
1741             av_push(error_stack, sv);
1742         } else {
1743             sv = sv_2mortal(sv);
1744         }
1745         dSP;
1746         ENTER;
1747         SAVETMPS;
1748         PUSHMARK(SP);
1749         XPUSHs( sv );
1750         PUTBACK;
1751         call_pv("Carp::confess", G_DISCARD);
1752         /*
1753         confess never returns, so these will not get executed:
1754         FREETMPS;
1755         LEAVE;
1756         */
1757     }
1758     #define OUT_OF_MEMORY "Out of memory."
1759     #define CALL_FAILED "Call failed. Possible reason is an index out of range, mathematical problem, or something else."
1760     #define NEED_DEF "A parameter which must be defined or not empty, is not."
1761     #define WRONG_CLASS "Object has a wrong class."
1762     #define NEED_REF "A parameter which must be a reference, is not."
1763     #define NEED_HASH_REF "A parameter/item which must be a hash reference, is not."
1764     #define NEED_ARRAY_REF "A parameter/item which must be an array reference, is not."
1765     #define NEED_BINARY_DATA "A parameter which must be binary data, is not."
1766     #define NEED_CODE_REF "A parameter which must be an anonymous subroutine, is not."
1767     #define WRONG_ITEM_IN_ARRAY "An item in an array parameter has wrong type."
1768     #define ARRAY_TO_XML_FAILED "An array parameter cannot be converted to an XMLTree."
1769     #define NOT_ENOUGH_ELEMENTS "The supplied array does not have enough elements."
1770 
1771 
VeryQuietErrorHandler(CPLErr eclass,int code,const char * msg)1772 void VeryQuietErrorHandler(CPLErr eclass, int code, const char *msg ) {
1773   /* If the error class is CE_Fatal, we want to have a message issued
1774      because the CPL support code does an abort() before any exception
1775      can be generated */
1776 #if defined(SWIGPERL)
1777     AV* error_stack = get_av("Geo::GDAL::error", 0);
1778     SV *error = newSVpv(msg, 0);
1779     av_push(error_stack, error);
1780 #endif
1781   if (eclass == CE_Fatal ) {
1782     CPLDefaultErrorHandler(eclass, code, msg );
1783   }
1784 }
1785 
1786 
UseExceptions()1787 void UseExceptions() {
1788   CPLSetErrorHandler( (CPLErrorHandler) VeryQuietErrorHandler );
1789 }
1790 
DontUseExceptions()1791 void DontUseExceptions() {
1792   CPLSetErrorHandler( CPLDefaultErrorHandler );
1793 }
1794 
1795 
NVClassify(int comparison,double nv,AV * classifier,const char ** error)1796   double NVClassify(int comparison, double nv, AV* classifier, const char **error) {
1797      /* recursive, return nv < classifier[0] ? classifier[1] : classifier[2]
1798         sets error if there are not three values in the classifier,
1799         first is not a number, or second or third are not a number of arrayref
1800      */
1801      SV** f = av_fetch(classifier, 0, 0);
1802      SV** s = av_fetch(classifier, 1, 0);
1803      SV** t = av_fetch(classifier, 2, 0);
1804      if (f && (SvNOK(*f) || SvIOK(*f))) {
1805          switch(comparison) {
1806          case 0: /* lt */
1807          if (nv < SvNV(*f))
1808              t = s;
1809          break;
1810          case 1: /* lte */
1811          if (nv <= SvNV(*f))
1812              t = s;
1813          break;
1814          case 2: /* gt */
1815          if (nv > SvNV(*f))
1816              t = s;
1817          break;
1818          case 3: /* gte */
1819          if (nv >= SvNV(*f))
1820              t = s;
1821          break;
1822          }
1823          if (t && (SvNOK(*t) || SvIOK(*t)))
1824              return SvNV(*t);
1825          else if (t && SvROK(*t) && (SvTYPE(SvRV(*t)) == SVt_PVAV))
1826              return NVClassify(comparison, nv, (AV*)(SvRV(*t)), error);
1827          else
1828              *error = "The decision in a classifier must be a number or a reference to a classifier.";
1829      } else
1830          *error = "The first value in a classifier must be a number.";
1831      return 0;
1832   }
IVClassify(int comparison,int64_t k,AV * classifier,const char ** error)1833   int64_t IVClassify(int comparison, int64_t k, AV* classifier, const char **error) {
1834      /* recursive, return k < classifier[0] ? classifier[1] : classifier[2]
1835         sets error if there are not three values in the classifier,
1836         first is not a number, or second or third are not a number of arrayref
1837      */
1838      SV** f = av_fetch(classifier, 0, 0);
1839      SV** s = av_fetch(classifier, 1, 0);
1840      SV** t = av_fetch(classifier, 2, 0);
1841      if (f && (SvNOK(*f) || SvIOK(*f))) {
1842          switch(comparison) {
1843          case 0: /* lt */
1844          if (k < SvNV(*f))
1845              t = s;
1846          break;
1847          case 1: /* lte */
1848          if (k <= SvNV(*f))
1849              t = s;
1850          break;
1851          case 2: /* gt */
1852          if (k > SvNV(*f))
1853              t = s;
1854          break;
1855          case 3: /* gte */
1856          if (k >= SvNV(*f))
1857              t = s;
1858          break;
1859          }
1860          if (t && (SvNOK(*t) || SvIOK(*t)))
1861              return SvNV(*t);
1862          else if (t && SvROK(*t) && (SvTYPE(SvRV(*t)) == SVt_PVAV))
1863              return IVClassify(comparison, k, (AV*)(SvRV(*t)), error);
1864          else
1865              *error = "The decision in a classifier must be a number or a reference to a classifier.";
1866      } else
1867          *error = "The first value in a classifier must be a number.";
1868      return 0;
1869   }
NVClass(int comparison,double nv,AV * classifier,int * klass,const char ** error)1870   void NVClass(int comparison, double nv, AV* classifier, int *klass, const char **error) {
1871      /* recursive, return in klass nv < classifier[0] ? classifier[1] : classifier[2]
1872         sets error if there are not three values in the classifier,
1873         first is not a number, or second or third are not a number of arrayref
1874      */
1875      SV** f = av_fetch(classifier, 0, 0);
1876      SV** s = av_fetch(classifier, 1, 0);
1877      SV** t = av_fetch(classifier, 2, 0);
1878      if (f && (SvNOK(*f) || SvIOK(*f))) {
1879          ++*klass;
1880          switch(comparison) {
1881          case 0: /* lt */
1882          if (nv < SvNV(*f))
1883              --*klass;
1884              t = s;
1885          break;
1886          case 1: /* lte */
1887          if (nv <= SvNV(*f))
1888              --*klass;
1889              t = s;
1890          break;
1891          case 2: /* gt */
1892          if (nv > SvNV(*f))
1893              --*klass;
1894              t = s;
1895          break;
1896          case 3: /* gte */
1897          if (nv >= SvNV(*f))
1898              --*klass;
1899              t = s;
1900          break;
1901          }
1902          if (t && (SvNOK(*t) || SvIOK(*t)))
1903              return;
1904          else if (t && SvROK(*t) && (SvTYPE(SvRV(*t)) == SVt_PVAV))
1905              NVClass(comparison, nv, (AV*)(SvRV(*t)), klass, error);
1906          else
1907              *error = "The decision in a classifier must be a number or a reference to a classifier.";
1908      } else
1909          *error = "The first value in a classifier must be a number.";
1910   }
to_array_classifier(SV * classifier,int * comparison,const char ** error)1911   AV* to_array_classifier(SV* classifier, int* comparison, const char **error) {
1912       if (SvROK(classifier) && (SvTYPE(SvRV(classifier)) == SVt_PVAV)) {
1913           SV** f = av_fetch((AV*)SvRV(classifier), 0, 0);
1914           SV** s = av_fetch((AV*)SvRV(classifier), 1, 0);
1915           if (f && SvPOK(*f)) {
1916               char *c = SvPV_nolen(*f);
1917               if (strcmp(c, "<") == 0)
1918                   *comparison = 0;
1919               else if (strcmp(c, "<=") == 0)
1920                   *comparison = 1;
1921               else if (strcmp(c, ">") == 0)
1922                   *comparison = 2;
1923               else if (strcmp(c, ">=") == 0)
1924                   *comparison = 3;
1925               else {
1926                   *error = "The first element in classifier object must be a comparison.";
1927                   return NULL;
1928               }
1929           }
1930           if (s && SvROK(*s) && (SvTYPE(SvRV(*s)) == SVt_PVAV))
1931               return (AV*)SvRV(*s);
1932           else
1933               *error = "The second element in classifier object must be an array reference.";
1934       } else
1935           *error = NEED_ARRAY_REF;
1936       return NULL;
1937   }
1938 
1939 
1940 typedef char retStringAndCPLFree;
1941 
1942 
Debug(const char * msg_class,const char * message)1943   void Debug( const char *msg_class, const char *message ) {
1944     CPLDebug( msg_class, "%s", message );
1945   }
1946 
1947 
1948 SWIGINTERN swig_type_info*
SWIG_pchar_descriptor(void)1949 SWIG_pchar_descriptor(void)
1950 {
1951   static int init = 0;
1952   static swig_type_info* info = 0;
1953   if (!init) {
1954     info = SWIG_TypeQuery("_p_char");
1955     init = 1;
1956   }
1957   return info;
1958 }
1959 
1960 
1961 SWIGINTERN int
SWIG_AsCharPtrAndSize(SV * obj,char ** cptr,size_t * psize,int * alloc)1962 SWIG_AsCharPtrAndSize(SV *obj, char** cptr, size_t* psize, int *alloc)
1963 {
1964   if (SvMAGICAL(obj)) {
1965      SV *tmp = sv_newmortal();
1966      SvSetSV(tmp, obj);
1967      obj = tmp;
1968   }
1969   if (SvPOK(obj)) {
1970     STRLEN len = 0;
1971     char *cstr = SvPV(obj, len);
1972     size_t size = len + 1;
1973     if (cptr)  {
1974       if (alloc) {
1975 	if (*alloc == SWIG_NEWOBJ) {
1976 	  *cptr = reinterpret_cast< char* >(memcpy(new char[size], cstr, sizeof(char)*(size)));
1977 	} else {
1978 	  *cptr = cstr;
1979 	  *alloc = SWIG_OLDOBJ;
1980 	}
1981       }
1982     }
1983     if (psize) *psize = size;
1984     return SWIG_OK;
1985   } else {
1986     swig_type_info* pchar_descriptor = SWIG_pchar_descriptor();
1987     if (pchar_descriptor) {
1988       char* vptr = 0;
1989       if (SWIG_ConvertPtr(obj, (void**)&vptr, pchar_descriptor, 0) == SWIG_OK) {
1990 	if (cptr) *cptr = vptr;
1991 	if (psize) *psize = vptr ? (strlen(vptr) + 1) : 0;
1992 	if (alloc) *alloc = SWIG_OLDOBJ;
1993 	return SWIG_OK;
1994       }
1995     }
1996   }
1997   return SWIG_TypeError;
1998 }
1999 
2000 
2001 
2002 
2003 
SetErrorHandler(CPLErrorHandler pfnErrorHandler=NULL,void * user_data=NULL)2004   CPLErr SetErrorHandler( CPLErrorHandler pfnErrorHandler = NULL, void* user_data = NULL )
2005   {
2006     if( pfnErrorHandler == NULL )
2007     {
2008         pfnErrorHandler = CPLDefaultErrorHandler;
2009     }
2010 
2011     CPLSetErrorHandlerEx( pfnErrorHandler, user_data );
2012 
2013     return CE_None;
2014   }
2015 
2016 
2017 #include <limits.h>
2018 #if !defined(SWIG_NO_LLONG_MAX)
2019 # if !defined(LLONG_MAX) && defined(__GNUC__) && defined (__LONG_LONG_MAX__)
2020 #   define LLONG_MAX __LONG_LONG_MAX__
2021 #   define LLONG_MIN (-LLONG_MAX - 1LL)
2022 #   define ULLONG_MAX (LLONG_MAX * 2ULL + 1ULL)
2023 # endif
2024 #endif
2025 
2026 
2027 #include <stdlib.h>
2028 #ifdef _MSC_VER
2029 # ifndef strtoull
2030 #  define strtoull _strtoui64
2031 # endif
2032 # ifndef strtoll
2033 #  define strtoll _strtoi64
2034 # endif
2035 #endif
2036 
2037 
2038 SWIGINTERN int
SWIG_PERL_DECL_ARGS_2(SV * obj,double * val)2039 SWIG_AsVal_double SWIG_PERL_DECL_ARGS_2(SV *obj, double *val)
2040 {
2041   if (SvNIOK(obj)) {
2042     if (val) *val = SvNV(obj);
2043     return SWIG_OK;
2044   } else if (SvIOK(obj)) {
2045     if (val) *val = (double) SvIV(obj);
2046     return SWIG_AddCast(SWIG_OK);
2047   } else {
2048     const char *nptr = SvPV_nolen(obj);
2049     if (nptr) {
2050       char *endptr;
2051       double v;
2052       errno = 0;
2053       v = strtod(nptr, &endptr);
2054       if (errno == ERANGE) {
2055 	errno = 0;
2056 	return SWIG_OverflowError;
2057       } else {
2058 	if (*endptr == '\0') {
2059 	  if (val) *val = v;
2060 	  return SWIG_Str2NumCast(SWIG_OK);
2061 	}
2062       }
2063     }
2064   }
2065   return SWIG_TypeError;
2066 }
2067 
2068 
2069 #include <float.h>
2070 
2071 
2072 #include <math.h>
2073 
2074 
2075 SWIGINTERNINLINE int
SWIG_CanCastAsInteger(double * d,double min,double max)2076 SWIG_CanCastAsInteger(double *d, double min, double max) {
2077   double x = *d;
2078   if ((min <= x && x <= max)) {
2079    double fx = floor(x);
2080    double cx = ceil(x);
2081    double rd =  ((x - fx) < 0.5) ? fx : cx; /* simple rint */
2082    if ((errno == EDOM) || (errno == ERANGE)) {
2083      errno = 0;
2084    } else {
2085      double summ, reps, diff;
2086      if (rd < x) {
2087        diff = x - rd;
2088      } else if (rd > x) {
2089        diff = rd - x;
2090      } else {
2091        return 1;
2092      }
2093      summ = rd + x;
2094      reps = diff/summ;
2095      if (reps < 8*DBL_EPSILON) {
2096        *d = rd;
2097        return 1;
2098      }
2099    }
2100   }
2101   return 0;
2102 }
2103 
2104 
2105 SWIGINTERN int
SWIG_PERL_DECL_ARGS_2(SV * obj,long * val)2106 SWIG_AsVal_long SWIG_PERL_DECL_ARGS_2(SV *obj, long* val)
2107 {
2108   if (SvUOK(obj)) {
2109     UV v = SvUV(obj);
2110     if (UVSIZE < sizeof(*val) || v <= LONG_MAX) {
2111       if (val) *val = v;
2112       return SWIG_OK;
2113     }
2114     return SWIG_OverflowError;
2115   } else if (SvIOK(obj)) {
2116     IV v = SvIV(obj);
2117     if (IVSIZE <= sizeof(*val) || (v >= LONG_MIN && v <= LONG_MAX)) {
2118       if(val) *val = v;
2119       return SWIG_OK;
2120     }
2121     return SWIG_OverflowError;
2122   } else {
2123     int dispatch = 0;
2124     const char *nptr = SvPV_nolen(obj);
2125     if (nptr) {
2126       char *endptr;
2127       long v;
2128       errno = 0;
2129       v = strtol(nptr, &endptr,0);
2130       if (errno == ERANGE) {
2131 	errno = 0;
2132 	return SWIG_OverflowError;
2133       } else {
2134 	if (*endptr == '\0') {
2135 	  if (val) *val = v;
2136 	  return SWIG_Str2NumCast(SWIG_OK);
2137 	}
2138       }
2139     }
2140     if (!dispatch) {
2141       double d;
2142       int res = SWIG_AddCast(SWIG_AsVal_double SWIG_PERL_CALL_ARGS_2(obj,&d));
2143       if (SWIG_IsOK(res) && SWIG_CanCastAsInteger(&d, LONG_MIN, LONG_MAX)) {
2144 	if (val) *val = (long)(d);
2145 	return res;
2146       }
2147     }
2148   }
2149   return SWIG_TypeError;
2150 }
2151 
2152 
2153 SWIGINTERN int
SWIG_PERL_DECL_ARGS_2(SV * obj,int * val)2154 SWIG_AsVal_int SWIG_PERL_DECL_ARGS_2(SV * obj, int *val)
2155 {
2156   long v;
2157   int res = SWIG_AsVal_long SWIG_PERL_CALL_ARGS_2(obj, &v);
2158   if (SWIG_IsOK(res)) {
2159     if ((v < INT_MIN || v > INT_MAX)) {
2160       return SWIG_OverflowError;
2161     } else {
2162       if (val) *val = static_cast< int >(v);
2163     }
2164   }
2165   return res;
2166 }
2167 
2168 
PushErrorHandler(char const * pszCallbackName=NULL)2169   CPLErr PushErrorHandler( char const * pszCallbackName = NULL ) {
2170     CPLErrorHandler pfnHandler = NULL;
2171     if( pszCallbackName == NULL || EQUAL(pszCallbackName,"CPLQuietErrorHandler") )
2172       pfnHandler = CPLQuietErrorHandler;
2173     else if( EQUAL(pszCallbackName,"CPLDefaultErrorHandler") )
2174       pfnHandler = CPLDefaultErrorHandler;
2175     else if( EQUAL(pszCallbackName,"CPLLoggingErrorHandler") )
2176       pfnHandler = CPLLoggingErrorHandler;
2177 
2178     if ( pfnHandler == NULL )
2179       return CE_Fatal;
2180 
2181     CPLPushErrorHandler( pfnHandler );
2182 
2183     return CE_None;
2184   }
2185 
2186 
Error(CPLErr msg_class=CE_Failure,int err_code=0,const char * msg="error")2187   void Error( CPLErr msg_class = CE_Failure, int err_code = 0, const char* msg = "error" ) {
2188     CPLError( msg_class, err_code, "%s", msg );
2189   }
2190 
2191 
EscapeString(int len,char * bin_string,int scheme=CPLES_SQL)2192 retStringAndCPLFree* EscapeString(int len, char *bin_string , int scheme=CPLES_SQL) {
2193     return CPLEscapeString(bin_string, len, scheme);
2194 }
2195 
2196 
2197 SWIGINTERNINLINE SV *
SWIG_PERL_DECL_ARGS_1(long value)2198 SWIG_From_long  SWIG_PERL_DECL_ARGS_1(long value)
2199 {
2200   SV *sv;
2201   if (IVSIZE >= sizeof(value) || (value >= IV_MIN && value <= IV_MAX))
2202     sv = newSViv(value);
2203   else
2204     sv = newSVpvf("%ld", value);
2205   return sv_2mortal(sv);
2206 }
2207 
2208 
2209 SWIGINTERNINLINE SV *
SWIG_PERL_DECL_ARGS_1(int value)2210 SWIG_From_int  SWIG_PERL_DECL_ARGS_1(int value)
2211 {
2212   return SWIG_From_long  SWIG_PERL_CALL_ARGS_1(value);
2213 }
2214 
2215 
2216 SWIGINTERNINLINE SV *
SWIG_PERL_DECL_ARGS_1(unsigned long value)2217 SWIG_From_unsigned_SS_long  SWIG_PERL_DECL_ARGS_1(unsigned long value)
2218 {
2219   SV *sv;
2220   if (UVSIZE >= sizeof(value) || value <= UV_MAX)
2221     sv = newSVuv(value);
2222   else
2223     sv = newSVpvf("%lu", value);
2224   return sv_2mortal(sv);
2225 }
2226 
2227 
2228 SWIGINTERNINLINE SV *
SWIG_PERL_DECL_ARGS_1(unsigned int value)2229 SWIG_From_unsigned_SS_int  SWIG_PERL_DECL_ARGS_1(unsigned int value)
2230 {
2231   return SWIG_From_unsigned_SS_long  SWIG_PERL_CALL_ARGS_1(value);
2232 }
2233 
2234 
sv_to_utf8_string(SV * sv,U8 ** tmpbuf,bool * safefree=NULL)2235     char *sv_to_utf8_string(SV *sv, U8 **tmpbuf, bool *safefree = NULL) {
2236         /* if tmpbuf is given, only tmpbuf needs to be freed, use Safefree!
2237            if not, ret needs to be freed, if safefree use Safefree else use free! */
2238         char *ret;
2239         if (safefree) *safefree = false;
2240         if (SvOK(sv)) {
2241             STRLEN len;
2242             ret = SvPV(sv, len);
2243             if (!SvUTF8(sv)) {
2244                 if (tmpbuf) {
2245                     *tmpbuf = bytes_to_utf8((const U8*)ret, &len);
2246                     ret = (char *)(*tmpbuf);
2247                 } else {
2248                     ret = (char *)bytes_to_utf8((const U8*)ret, &len);
2249                 }
2250                 if (safefree) *safefree = true;
2251             } else {
2252                 if (!tmpbuf)
2253                     ret = strdup(ret);
2254             }
2255         } else {
2256             ret = (char*)""; /* avoid "Use of uninitialized value in subroutine entry" errors */
2257             if (!tmpbuf)
2258                 ret = strdup(ret);
2259         }
2260         return ret;
2261     }
2262 
2263 
wrapper_VSIReadDirEx(const char * utf8_path,int nMaxFiles=0)2264 char **wrapper_VSIReadDirEx( const char * utf8_path, int nMaxFiles = 0 )
2265 {
2266     return VSIReadDirEx(utf8_path, nMaxFiles);
2267 }
2268 
2269 
wrapper_CPLGetConfigOption(const char * pszKey,const char * pszDefault=NULL)2270 const char *wrapper_CPLGetConfigOption( const char * pszKey, const char * pszDefault = NULL )
2271 {
2272     return CPLGetConfigOption( pszKey, pszDefault );
2273 }
2274 
2275 
wrapper_VSIFileFromMemBuffer(const char * utf8_path,int nBytes,const GByte * pabyData)2276 void wrapper_VSIFileFromMemBuffer( const char* utf8_path, int nBytes, const GByte *pabyData)
2277 {
2278     GByte* pabyDataDup = (GByte*)VSIMalloc(nBytes);
2279     if (pabyDataDup == NULL)
2280             return;
2281     memcpy(pabyDataDup, pabyData, nBytes);
2282     VSIFCloseL(VSIFileFromMemBuffer(utf8_path, (GByte*) pabyDataDup, nBytes, TRUE));
2283 }
2284 
2285 
2286 
wrapper_VSIUnlinkBatch(char ** files)2287 bool wrapper_VSIUnlinkBatch(char** files)
2288 {
2289     int* success = VSIUnlinkBatch(files);
2290     if( !success )
2291         return false;
2292     int bRet = true;
2293     for( int i = 0; files && files[i]; i++ )
2294     {
2295         if( !success[i] ) {
2296             bRet = false;
2297             break;
2298         }
2299     }
2300     VSIFree(success);
2301     return bRet;
2302 }
2303 
2304 
2305 SWIGINTERNINLINE SV *
SWIG_PERL_DECL_ARGS_1(bool value)2306 SWIG_From_bool  SWIG_PERL_DECL_ARGS_1(bool value)
2307 {
2308   return boolSV(value);
2309 }
2310 
2311 
wrapper_HasThreadSupport()2312 int wrapper_HasThreadSupport()
2313 {
2314     return strcmp(CPLGetThreadingModel(), "stub") != 0;
2315 }
2316 
2317 
wrapper_VSIGetSignedURL(const char * utf8_path,char ** options=NULL)2318 retStringAndCPLFree* wrapper_VSIGetSignedURL(const char * utf8_path, char** options = NULL )
2319 {
2320     return VSIGetSignedURL( utf8_path, options );
2321 }
2322 
2323 
wrapper_VSIFOpenL(const char * utf8_path,const char * pszMode)2324 VSILFILE   *wrapper_VSIFOpenL( const char *utf8_path, const char *pszMode )
2325 {
2326     if (!pszMode) /* would lead to segfault */
2327         pszMode = "r";
2328     return VSIFOpenL( utf8_path, pszMode );
2329 }
2330 
2331 
wrapper_VSIFOpenExL(const char * utf8_path,const char * pszMode,int bSetError=FALSE,char ** options=NULL)2332 VSILFILE   *wrapper_VSIFOpenExL( const char *utf8_path, const char *pszMode, int bSetError = FALSE, char** options = NULL )
2333 {
2334     if (!pszMode) /* would lead to segfault */
2335         pszMode = "r";
2336     return VSIFOpenEx2L( utf8_path, pszMode, bSetError, options );
2337 }
2338 
2339 
2340 SWIGINTERN int
SWIG_PERL_DECL_ARGS_2(SV * obj,unsigned long * val)2341 SWIG_AsVal_unsigned_SS_long SWIG_PERL_DECL_ARGS_2(SV *obj, unsigned long *val)
2342 {
2343   if (SvUOK(obj)) {
2344     UV v = SvUV(obj);
2345     if (UVSIZE <= sizeof(*val) || v <= ULONG_MAX) {
2346       if (val) *val = v;
2347       return SWIG_OK;
2348     }
2349     return SWIG_OverflowError;
2350   } else if (SvIOK(obj)) {
2351     IV v = SvIV(obj);
2352     if (v >= 0 && (IVSIZE <= sizeof(*val) || v <= ULONG_MAX)) {
2353       if (val) *val = v;
2354       return SWIG_OK;
2355     }
2356     return SWIG_OverflowError;
2357   } else {
2358     int dispatch = 0;
2359     const char *nptr = SvPV_nolen(obj);
2360     if (nptr) {
2361       char *endptr;
2362       unsigned long v;
2363       errno = 0;
2364       v = strtoul(nptr, &endptr,0);
2365       if (errno == ERANGE) {
2366 	errno = 0;
2367 	return SWIG_OverflowError;
2368       } else {
2369 	if (*endptr == '\0') {
2370 	  if (val) *val = v;
2371 	  return SWIG_Str2NumCast(SWIG_OK);
2372 	}
2373       }
2374     }
2375     if (!dispatch) {
2376       double d;
2377       int res = SWIG_AddCast(SWIG_AsVal_double SWIG_PERL_CALL_ARGS_2(obj,&d));
2378       if (SWIG_IsOK(res) && SWIG_CanCastAsInteger(&d, 0, ULONG_MAX)) {
2379 	if (val) *val = (unsigned long)(d);
2380 	return res;
2381       }
2382     }
2383   }
2384   return SWIG_TypeError;
2385 }
2386 
2387 
2388 #if defined(LLONG_MAX) && !defined(SWIG_LONG_LONG_AVAILABLE)
2389 #  define SWIG_LONG_LONG_AVAILABLE
2390 #endif
2391 
2392 
2393 #ifdef SWIG_LONG_LONG_AVAILABLE
2394 SWIGINTERN int
SWIG_PERL_DECL_ARGS_2(SV * obj,unsigned long long * val)2395 SWIG_AsVal_unsigned_SS_long_SS_long SWIG_PERL_DECL_ARGS_2(SV *obj, unsigned long long *val)
2396 {
2397   if (SvUOK(obj)) {
2398     /* pretty sure this should be conditional on
2399      * (UVSIZE <= sizeof(*val) || v <= ULLONG_MAX) */
2400     if (val) *val = SvUV(obj);
2401     return SWIG_OK;
2402   } else  if (SvIOK(obj)) {
2403     IV v = SvIV(obj);
2404     if (v >= 0 && (IVSIZE <= sizeof(*val) || v <= ULLONG_MAX)) {
2405       if (val) *val = v;
2406       return SWIG_OK;
2407     } else {
2408       return SWIG_OverflowError;
2409     }
2410   } else {
2411     int dispatch = 0;
2412     const char *nptr = SvPV_nolen(obj);
2413     if (nptr) {
2414       char *endptr;
2415       unsigned long long v;
2416       errno = 0;
2417       v = strtoull(nptr, &endptr,0);
2418       if (errno == ERANGE) {
2419 	errno = 0;
2420 	return SWIG_OverflowError;
2421       } else {
2422 	if (*endptr == '\0') {
2423 	  if (val) *val = v;
2424 	  return SWIG_Str2NumCast(SWIG_OK);
2425 	}
2426       }
2427     }
2428     if (!dispatch) {
2429       const double mant_max = 1LL << DBL_MANT_DIG;
2430       double d;
2431       int res = SWIG_AddCast(SWIG_AsVal_double SWIG_PERL_CALL_ARGS_2(obj,&d));
2432       if (SWIG_IsOK(res) && SWIG_CanCastAsInteger(&d, 0, mant_max)) {
2433 	if (val) *val = (unsigned long long)(d);
2434 	return res;
2435       }
2436     }
2437   }
2438   return SWIG_TypeError;
2439 }
2440 #endif
2441 
2442 
2443 SWIGINTERNINLINE int
SWIG_PERL_DECL_ARGS_2(SV * obj,size_t * val)2444 SWIG_AsVal_size_t SWIG_PERL_DECL_ARGS_2(SV * obj, size_t *val)
2445 {
2446   int res = SWIG_TypeError;
2447 #ifdef SWIG_LONG_LONG_AVAILABLE
2448   if (sizeof(size_t) <= sizeof(unsigned long)) {
2449 #endif
2450     unsigned long v;
2451     res = SWIG_AsVal_unsigned_SS_long SWIG_PERL_CALL_ARGS_2(obj, val ? &v : 0);
2452     if (SWIG_IsOK(res) && val) *val = static_cast< size_t >(v);
2453 #ifdef SWIG_LONG_LONG_AVAILABLE
2454   } else if (sizeof(size_t) <= sizeof(unsigned long long)) {
2455     unsigned long long v;
2456     res = SWIG_AsVal_unsigned_SS_long_SS_long SWIG_PERL_CALL_ARGS_2(obj, val ? &v : 0);
2457     if (SWIG_IsOK(res) && val) *val = static_cast< size_t >(v);
2458   }
2459 #endif
2460   return res;
2461 }
2462 
2463 
2464 #include <stdio.h>
2465 #if defined(_MSC_VER) || defined(__BORLANDC__) || defined(_WATCOM)
2466 # ifndef snprintf
2467 #  define snprintf _snprintf
2468 # endif
2469 #endif
2470 
2471 
2472 #ifdef SWIG_LONG_LONG_AVAILABLE
2473 SWIGINTERNINLINE SV *
SWIG_PERL_DECL_ARGS_1(unsigned long long value)2474 SWIG_From_unsigned_SS_long_SS_long  SWIG_PERL_DECL_ARGS_1(unsigned long long value)
2475 {
2476   SV *sv;
2477   if (UVSIZE >= sizeof(value) || value <= UV_MAX)
2478     sv = newSVuv((UV)(value));
2479   else {
2480     //sv = newSVpvf("%llu", value); doesn't work in non 64bit Perl
2481     char temp[256];
2482     sprintf(temp, "%llu", value);
2483     sv = newSVpv(temp, 0);
2484   }
2485   return sv_2mortal(sv);
2486 }
2487 #endif
2488 
2489 
2490 SWIGINTERNINLINE SV *
SWIG_PERL_DECL_ARGS_1(size_t value)2491 SWIG_From_size_t  SWIG_PERL_DECL_ARGS_1(size_t value)
2492 {
2493 #ifdef SWIG_LONG_LONG_AVAILABLE
2494   if (sizeof(size_t) <= sizeof(unsigned long)) {
2495 #endif
2496     return SWIG_From_unsigned_SS_long  SWIG_PERL_CALL_ARGS_1(static_cast< unsigned long >(value));
2497 #ifdef SWIG_LONG_LONG_AVAILABLE
2498   } else {
2499     /* assume sizeof(size_t) <= sizeof(unsigned long long) */
2500     return SWIG_From_unsigned_SS_long_SS_long  SWIG_PERL_CALL_ARGS_1(static_cast< unsigned long long >(value));
2501   }
2502 #endif
2503 }
2504 
2505 
VSIStdoutUnsetRedirection()2506 void VSIStdoutUnsetRedirection()
2507 {
2508     VSIStdoutSetRedirection( fwrite, stdout );
2509 }
2510 
GDALMajorObjectShadow_GetDescription(GDALMajorObjectShadow * self)2511 SWIGINTERN char const *GDALMajorObjectShadow_GetDescription(GDALMajorObjectShadow *self){
2512     return GDALGetDescription( self );
2513   }
GDALMajorObjectShadow_SetDescription(GDALMajorObjectShadow * self,char const * pszNewDesc)2514 SWIGINTERN void GDALMajorObjectShadow_SetDescription(GDALMajorObjectShadow *self,char const *pszNewDesc){
2515     GDALSetDescription( self, pszNewDesc );
2516   }
GDALMajorObjectShadow_GetMetadataDomainList(GDALMajorObjectShadow * self)2517 SWIGINTERN char **GDALMajorObjectShadow_GetMetadataDomainList(GDALMajorObjectShadow *self){
2518     return GDALGetMetadataDomainList( self );
2519   }
GDALMajorObjectShadow_GetMetadata_Dict(GDALMajorObjectShadow * self,char const * pszDomain="")2520 SWIGINTERN char **GDALMajorObjectShadow_GetMetadata_Dict(GDALMajorObjectShadow *self,char const *pszDomain=""){
2521     return GDALGetMetadata( self, pszDomain );
2522   }
GDALMajorObjectShadow_SetMetadata__SWIG_0(GDALMajorObjectShadow * self,char ** papszMetadata,char const * pszDomain="")2523 SWIGINTERN CPLErr GDALMajorObjectShadow_SetMetadata__SWIG_0(GDALMajorObjectShadow *self,char **papszMetadata,char const *pszDomain=""){
2524     return GDALSetMetadata( self, papszMetadata, pszDomain );
2525   }
GDALMajorObjectShadow_SetMetadata__SWIG_1(GDALMajorObjectShadow * self,char * pszMetadataString,char const * pszDomain="")2526 SWIGINTERN CPLErr GDALMajorObjectShadow_SetMetadata__SWIG_1(GDALMajorObjectShadow *self,char *pszMetadataString,char const *pszDomain=""){
2527     char *tmpList[2];
2528     tmpList[0] = pszMetadataString;
2529     tmpList[1] = 0;
2530     return GDALSetMetadata( self, tmpList, pszDomain );
2531   }
GDALMajorObjectShadow_GetMetadataItem(GDALMajorObjectShadow * self,char const * pszName,char const * pszDomain="")2532 SWIGINTERN char const *GDALMajorObjectShadow_GetMetadataItem(GDALMajorObjectShadow *self,char const *pszName,char const *pszDomain=""){
2533     return GDALGetMetadataItem( self, pszName, pszDomain);
2534   }
GDALMajorObjectShadow_SetMetadataItem(GDALMajorObjectShadow * self,char const * pszName,char const * pszValue,char const * pszDomain="")2535 SWIGINTERN CPLErr GDALMajorObjectShadow_SetMetadataItem(GDALMajorObjectShadow *self,char const *pszName,char const *pszValue,char const *pszDomain=""){
2536     return GDALSetMetadataItem( self, pszName, pszValue, pszDomain);
2537   }
GDALDriverShadow_Create(GDALDriverShadow * self,char const * utf8_path,int xsize,int ysize,int bands=1,GDALDataType eType=GDT_Byte,char ** options=0)2538 SWIGINTERN GDALDatasetShadow *GDALDriverShadow_Create(GDALDriverShadow *self,char const *utf8_path,int xsize,int ysize,int bands=1,GDALDataType eType=GDT_Byte,char **options=0){
2539 
2540     GDALDatasetShadow* ds = (GDALDatasetShadow*) GDALCreate(    self,
2541                                                                 utf8_path,
2542                                                                 xsize,
2543                                                                 ysize,
2544                                                                 bands,
2545                                                                 eType,
2546                                                                 options );
2547     return ds;
2548   }
GDALDriverShadow_CreateMultiDimensional(GDALDriverShadow * self,char const * utf8_path,char ** root_group_options=0,char ** options=0)2549 SWIGINTERN GDALDatasetShadow *GDALDriverShadow_CreateMultiDimensional(GDALDriverShadow *self,char const *utf8_path,char **root_group_options=0,char **options=0){
2550 
2551     GDALDatasetShadow* ds = (GDALDatasetShadow*) GDALCreateMultiDimensional(    self,
2552                                                                 utf8_path,
2553                                                                 root_group_options,
2554                                                                 options );
2555     return ds;
2556   }
GDALDriverShadow_CreateCopy(GDALDriverShadow * self,char const * utf8_path,GDALDatasetShadow * src,int strict=1,char ** options=0,GDALProgressFunc callback=NULL,void * callback_data=NULL)2557 SWIGINTERN GDALDatasetShadow *GDALDriverShadow_CreateCopy(GDALDriverShadow *self,char const *utf8_path,GDALDatasetShadow *src,int strict=1,char **options=0,GDALProgressFunc callback=NULL,void *callback_data=NULL){
2558 
2559     GDALDatasetShadow *ds = (GDALDatasetShadow*) GDALCreateCopy(    self,
2560                                                                     utf8_path,
2561                                                                     src,
2562                                                                     strict,
2563                                                                     options,
2564                                                                     callback,
2565                                                                     callback_data );
2566     return ds;
2567   }
GDALDriverShadow_Delete(GDALDriverShadow * self,char const * utf8_path)2568 SWIGINTERN CPLErr GDALDriverShadow_Delete(GDALDriverShadow *self,char const *utf8_path){
2569     return GDALDeleteDataset( self, utf8_path );
2570   }
GDALDriverShadow_Rename(GDALDriverShadow * self,char const * newName,char const * oldName)2571 SWIGINTERN CPLErr GDALDriverShadow_Rename(GDALDriverShadow *self,char const *newName,char const *oldName){
2572     return GDALRenameDataset( self, newName, oldName );
2573   }
GDALDriverShadow_CopyFiles(GDALDriverShadow * self,char const * newName,char const * oldName)2574 SWIGINTERN CPLErr GDALDriverShadow_CopyFiles(GDALDriverShadow *self,char const *newName,char const *oldName){
2575     return GDALCopyDatasetFiles( self, newName, oldName );
2576   }
GDALDriverShadow_Register(GDALDriverShadow * self)2577 SWIGINTERN int GDALDriverShadow_Register(GDALDriverShadow *self){
2578     return GDALRegisterDriver( self );
2579   }
GDALDriverShadow_Deregister(GDALDriverShadow * self)2580 SWIGINTERN void GDALDriverShadow_Deregister(GDALDriverShadow *self){
2581     GDALDeregisterDriver( self );
2582   }
2583 
GDALDriverShadow_ShortName_get(GDALDriverShadow * h)2584 char const *GDALDriverShadow_ShortName_get( GDALDriverShadow *h ) {
2585   return GDALGetDriverShortName( h );
2586 }
GDALDriverShadow_LongName_get(GDALDriverShadow * h)2587 char const *GDALDriverShadow_LongName_get( GDALDriverShadow *h ) {
2588   return GDALGetDriverLongName( h );
2589 }
GDALDriverShadow_HelpTopic_get(GDALDriverShadow * h)2590 char const *GDALDriverShadow_HelpTopic_get( GDALDriverShadow *h ) {
2591   return GDALGetDriverHelpTopic( h );
2592 }
2593 
2594 
2595 SWIGINTERNINLINE SV *
SWIG_PERL_DECL_ARGS_1(double value)2596 SWIG_From_double  SWIG_PERL_DECL_ARGS_1(double value)
2597 {
2598   return sv_2mortal(newSVnv(value));
2599 }
2600 
2601 
2602 SWIGINTERNINLINE SV *
SWIG_FromCharPtrAndSize(const char * carray,size_t size)2603 SWIG_FromCharPtrAndSize(const char* carray, size_t size)
2604 {
2605   SV *obj = sv_newmortal();
2606   if (carray) {
2607     sv_setpvn(obj, carray, size);
2608   } else {
2609     sv_setsv(obj, &PL_sv_undef);
2610   }
2611   return obj;
2612 }
2613 
2614 
2615 SWIGINTERNINLINE SV *
SWIG_FromCharPtr(const char * cptr)2616 SWIG_FromCharPtr(const char *cptr)
2617 {
2618   return SWIG_FromCharPtrAndSize(cptr, (cptr ? strlen(cptr) : 0));
2619 }
2620 
new_GDAL_GCP(double x=0.0,double y=0.0,double z=0.0,double pixel=0.0,double line=0.0,char const * info="",char const * id="")2621 SWIGINTERN GDAL_GCP *new_GDAL_GCP(double x=0.0,double y=0.0,double z=0.0,double pixel=0.0,double line=0.0,char const *info="",char const *id=""){
2622 
2623     GDAL_GCP *self = (GDAL_GCP*) CPLMalloc( sizeof( GDAL_GCP ) );
2624     self->dfGCPX = x;
2625     self->dfGCPY = y;
2626     self->dfGCPZ = z;
2627     self->dfGCPPixel = pixel;
2628     self->dfGCPLine = line;
2629     self->pszInfo =  CPLStrdup( (info == 0) ? "" : info );
2630     self->pszId = CPLStrdup( (id==0)? "" : id );
2631     return self;
2632   }
delete_GDAL_GCP(GDAL_GCP * self)2633 SWIGINTERN void delete_GDAL_GCP(GDAL_GCP *self){
2634     if ( self->pszInfo )
2635       CPLFree( self->pszInfo );
2636     if ( self->pszId )
2637       CPLFree( self->pszId );
2638     CPLFree( self );
2639   }
2640 
2641 
GDAL_GCP_GCPX_get(GDAL_GCP * gcp)2642 double GDAL_GCP_GCPX_get( GDAL_GCP *gcp ) {
2643   return gcp->dfGCPX;
2644 }
GDAL_GCP_GCPX_set(GDAL_GCP * gcp,double dfGCPX)2645 void GDAL_GCP_GCPX_set( GDAL_GCP *gcp, double dfGCPX ) {
2646   gcp->dfGCPX = dfGCPX;
2647 }
GDAL_GCP_GCPY_get(GDAL_GCP * gcp)2648 double GDAL_GCP_GCPY_get( GDAL_GCP *gcp ) {
2649   return gcp->dfGCPY;
2650 }
GDAL_GCP_GCPY_set(GDAL_GCP * gcp,double dfGCPY)2651 void GDAL_GCP_GCPY_set( GDAL_GCP *gcp, double dfGCPY ) {
2652   gcp->dfGCPY = dfGCPY;
2653 }
GDAL_GCP_GCPZ_get(GDAL_GCP * gcp)2654 double GDAL_GCP_GCPZ_get( GDAL_GCP *gcp ) {
2655   return gcp->dfGCPZ;
2656 }
GDAL_GCP_GCPZ_set(GDAL_GCP * gcp,double dfGCPZ)2657 void GDAL_GCP_GCPZ_set( GDAL_GCP *gcp, double dfGCPZ ) {
2658   gcp->dfGCPZ = dfGCPZ;
2659 }
GDAL_GCP_GCPPixel_get(GDAL_GCP * gcp)2660 double GDAL_GCP_GCPPixel_get( GDAL_GCP *gcp ) {
2661   return gcp->dfGCPPixel;
2662 }
GDAL_GCP_GCPPixel_set(GDAL_GCP * gcp,double dfGCPPixel)2663 void GDAL_GCP_GCPPixel_set( GDAL_GCP *gcp, double dfGCPPixel ) {
2664   gcp->dfGCPPixel = dfGCPPixel;
2665 }
GDAL_GCP_GCPLine_get(GDAL_GCP * gcp)2666 double GDAL_GCP_GCPLine_get( GDAL_GCP *gcp ) {
2667   return gcp->dfGCPLine;
2668 }
GDAL_GCP_GCPLine_set(GDAL_GCP * gcp,double dfGCPLine)2669 void GDAL_GCP_GCPLine_set( GDAL_GCP *gcp, double dfGCPLine ) {
2670   gcp->dfGCPLine = dfGCPLine;
2671 }
GDAL_GCP_Info_get(GDAL_GCP * gcp)2672 const char * GDAL_GCP_Info_get( GDAL_GCP *gcp ) {
2673   return gcp->pszInfo;
2674 }
GDAL_GCP_Info_set(GDAL_GCP * gcp,const char * pszInfo)2675 void GDAL_GCP_Info_set( GDAL_GCP *gcp, const char * pszInfo ) {
2676   if ( gcp->pszInfo )
2677     CPLFree( gcp->pszInfo );
2678   gcp->pszInfo = CPLStrdup(pszInfo);
2679 }
GDAL_GCP_Id_get(GDAL_GCP * gcp)2680 const char * GDAL_GCP_Id_get( GDAL_GCP *gcp ) {
2681   return gcp->pszId;
2682 }
GDAL_GCP_Id_set(GDAL_GCP * gcp,const char * pszId)2683 void GDAL_GCP_Id_set( GDAL_GCP *gcp, const char * pszId ) {
2684   if ( gcp->pszId )
2685     CPLFree( gcp->pszId );
2686   gcp->pszId = CPLStrdup(pszId);
2687 }
2688 
2689 
2690     static SV *
CreateArrayFromDoubleArray(double * first,unsigned int size)2691         CreateArrayFromDoubleArray( double *first, unsigned int size ) {
2692         AV *av = (AV*)sv_2mortal((SV*)newAV());
2693         for( unsigned int i=0; i<size; i++ ) {
2694             av_store(av,i,newSVnv(*first));
2695             ++first;
2696         }
2697         return sv_2mortal(newRV((SV*)av));
2698     }
2699 
2700 
2701 /* Returned size is in bytes or 0 if an error occurred. */
2702 static
ComputeDatasetRasterIOSize(int buf_xsize,int buf_ysize,int nPixelSize,int nBands,int * bandMap,int nBandMapArrayLength,GIntBig nPixelSpace,GIntBig nLineSpace,GIntBig nBandSpace,int bSpacingShouldBeMultipleOfPixelSize)2703 GIntBig ComputeDatasetRasterIOSize (int buf_xsize, int buf_ysize, int nPixelSize,
2704                                 int nBands, int* bandMap, int nBandMapArrayLength,
2705                                 GIntBig nPixelSpace, GIntBig nLineSpace, GIntBig nBandSpace,
2706                                 int bSpacingShouldBeMultipleOfPixelSize )
2707 {
2708     if (buf_xsize <= 0 || buf_ysize <= 0)
2709     {
2710         CPLError(CE_Failure, CPLE_IllegalArg, "Illegal values for buffer size");
2711         return 0;
2712     }
2713 
2714     if (nPixelSpace < 0 || nLineSpace < 0 || nBandSpace < 0)
2715     {
2716         CPLError(CE_Failure, CPLE_IllegalArg, "Illegal values for space arguments");
2717         return 0;
2718     }
2719 
2720     if (nPixelSize == 0)
2721     {
2722         CPLError(CE_Failure, CPLE_IllegalArg, "Illegal value for data type");
2723         return 0;
2724     }
2725 
2726     if( nPixelSpace == 0 )
2727         nPixelSpace = nPixelSize;
2728     else if ( bSpacingShouldBeMultipleOfPixelSize && (nPixelSpace % nPixelSize) != 0 )
2729     {
2730         CPLError(CE_Failure, CPLE_IllegalArg, "nPixelSpace should be a multiple of nPixelSize");
2731         return 0;
2732     }
2733 
2734     if( nLineSpace == 0 )
2735     {
2736         nLineSpace = nPixelSpace * buf_xsize;
2737     }
2738     else if ( bSpacingShouldBeMultipleOfPixelSize && (nLineSpace % nPixelSize) != 0 )
2739     {
2740         CPLError(CE_Failure, CPLE_IllegalArg, "nLineSpace should be a multiple of nPixelSize");
2741         return 0;
2742     }
2743 
2744     if( nBandSpace == 0 )
2745     {
2746         nBandSpace = nLineSpace * buf_ysize;
2747     }
2748     else if ( bSpacingShouldBeMultipleOfPixelSize && (nBandSpace % nPixelSize) != 0 )
2749     {
2750         CPLError(CE_Failure, CPLE_IllegalArg, "nLineSpace should be a multiple of nPixelSize");
2751         return 0;
2752     }
2753 
2754     if (nBands <= 0 || (bandMap != NULL && nBands > nBandMapArrayLength))
2755     {
2756         CPLError(CE_Failure, CPLE_IllegalArg, "Invalid band count");
2757         return 0;
2758     }
2759 
2760     GIntBig nRet = (GIntBig)(buf_ysize - 1) * nLineSpace + (GIntBig)(buf_xsize - 1) * nPixelSpace + (GIntBig)(nBands - 1) * nBandSpace + nPixelSize;
2761 #if SIZEOF_VOIDP == 4
2762     if (nRet > INT_MAX)
2763     {
2764         CPLError(CE_Failure, CPLE_IllegalArg, "Integer overflow");
2765         return 0;
2766     }
2767 #endif
2768 
2769     return nRet;
2770 }
2771 
2772 
2773 static
DSReadRaster_internal(GDALDatasetShadow * obj,int xoff,int yoff,int xsize,int ysize,int buf_xsize,int buf_ysize,GDALDataType buf_type,GIntBig * buf_size,char ** buf,int band_list,int * pband_list,GIntBig pixel_space,GIntBig line_space,GIntBig band_space,GDALRasterIOExtraArg * psExtraArg)2774 CPLErr DSReadRaster_internal( GDALDatasetShadow *obj,
2775                             int xoff, int yoff, int xsize, int ysize,
2776                             int buf_xsize, int buf_ysize,
2777                             GDALDataType buf_type,
2778                             GIntBig *buf_size, char **buf,
2779                             int band_list, int *pband_list,
2780                             GIntBig pixel_space, GIntBig line_space, GIntBig band_space,
2781                             GDALRasterIOExtraArg* psExtraArg)
2782 {
2783   CPLErr result;
2784 
2785   *buf_size = ComputeDatasetRasterIOSize (buf_xsize, buf_ysize, GDALGetDataTypeSize( buf_type ) / 8,
2786                                           band_list ? band_list : GDALGetRasterCount(obj), pband_list, band_list,
2787                                           pixel_space, line_space, band_space, FALSE);
2788   if (*buf_size == 0)
2789   {
2790       *buf = 0;
2791       return CE_Failure;
2792   }
2793 
2794   *buf = (char*) malloc( *buf_size );
2795   if (*buf)
2796   {
2797     result = GDALDatasetRasterIOEx(obj, GF_Read, xoff, yoff, xsize, ysize,
2798                                     (void*) *buf, buf_xsize, buf_ysize, buf_type,
2799                                     band_list, pband_list, pixel_space, line_space, band_space,
2800                                     psExtraArg );
2801     if ( result != CE_None ) {
2802         free( *buf );
2803         *buf = 0;
2804         *buf_size = 0;
2805     }
2806   }
2807   else
2808   {
2809     CPLError(CE_Failure, CPLE_OutOfMemory, "Not enough memory to allocate " CPL_FRMT_GIB " bytes", *buf_size);
2810     result = CE_Failure;
2811     *buf = 0;
2812     *buf_size = 0;
2813   }
2814   return result;
2815 }
2816 
2817 
2818 typedef struct
2819 {
2820     GDALAsyncReaderH  hAsyncReader;
2821     void             *pyObject;
2822 } GDALAsyncReaderWrapper;
2823 
2824 typedef void* GDALAsyncReaderWrapperH;
2825 
AsyncReaderWrapperGetReader(GDALAsyncReaderWrapperH hWrapper)2826 static GDALAsyncReaderH AsyncReaderWrapperGetReader(GDALAsyncReaderWrapperH hWrapper)
2827 {
2828     GDALAsyncReaderWrapper* psWrapper = (GDALAsyncReaderWrapper*)hWrapper;
2829     if (psWrapper->hAsyncReader == NULL)
2830     {
2831         CPLError(CE_Failure, CPLE_AppDefined, "AsyncReader object is defunct");
2832     }
2833     return psWrapper->hAsyncReader;
2834 }
2835 
2836 #if defined(SWIGPYTHON)
AsyncReaderWrapperGetPyObject(GDALAsyncReaderWrapperH hWrapper)2837 static void* AsyncReaderWrapperGetPyObject(GDALAsyncReaderWrapperH hWrapper)
2838 {
2839     GDALAsyncReaderWrapper* psWrapper = (GDALAsyncReaderWrapper*)hWrapper;
2840     return psWrapper->pyObject;
2841 }
2842 #endif
2843 
DeleteAsyncReaderWrapper(GDALAsyncReaderWrapperH hWrapper)2844 static void DeleteAsyncReaderWrapper(GDALAsyncReaderWrapperH hWrapper)
2845 {
2846     GDALAsyncReaderWrapper* psWrapper = (GDALAsyncReaderWrapper*)hWrapper;
2847     if (psWrapper->hAsyncReader != NULL)
2848     {
2849         CPLError(CE_Failure, CPLE_AppDefined,
2850                  "Native AsyncReader object will leak. EndAsyncReader() should have been called before");
2851     }
2852     CPLFree(psWrapper);
2853 }
2854 
2855 
delete_GDALAsyncReaderShadow(GDALAsyncReaderShadow * self)2856 SWIGINTERN void delete_GDALAsyncReaderShadow(GDALAsyncReaderShadow *self){
2857         DeleteAsyncReaderWrapper(self);
2858     }
GDALAsyncReaderShadow_GetNextUpdatedRegion(GDALAsyncReaderShadow * self,double timeout,int * xoff,int * yoff,int * buf_xsize,int * buf_ysize)2859 SWIGINTERN GDALAsyncStatusType GDALAsyncReaderShadow_GetNextUpdatedRegion(GDALAsyncReaderShadow *self,double timeout,int *xoff,int *yoff,int *buf_xsize,int *buf_ysize){
2860         GDALAsyncReaderH hReader = AsyncReaderWrapperGetReader(self);
2861         if (hReader == NULL)
2862         {
2863             *xoff = 0;
2864             *yoff = 0;
2865             *buf_xsize = 0;
2866             *buf_ysize = 0;
2867             return GARIO_ERROR;
2868         }
2869         return GDALARGetNextUpdatedRegion(hReader, timeout, xoff, yoff, buf_xsize, buf_ysize );
2870     }
GDALAsyncReaderShadow_LockBuffer(GDALAsyncReaderShadow * self,double timeout)2871 SWIGINTERN int GDALAsyncReaderShadow_LockBuffer(GDALAsyncReaderShadow *self,double timeout){
2872         GDALAsyncReaderH hReader = AsyncReaderWrapperGetReader(self);
2873         if (hReader == NULL)
2874         {
2875             return 0;
2876         }
2877         return GDALARLockBuffer(hReader,timeout);
2878     }
GDALAsyncReaderShadow_UnlockBuffer(GDALAsyncReaderShadow * self)2879 SWIGINTERN void GDALAsyncReaderShadow_UnlockBuffer(GDALAsyncReaderShadow *self){
2880         GDALAsyncReaderH hReader = AsyncReaderWrapperGetReader(self);
2881         if (hReader == NULL)
2882         {
2883             return;
2884         }
2885         GDALARUnlockBuffer(hReader);
2886     }
delete_GDALDatasetShadow(GDALDatasetShadow * self)2887 SWIGINTERN void delete_GDALDatasetShadow(GDALDatasetShadow *self){
2888     if ( GDALDereferenceDataset( self ) <= 0 ) {
2889       GDALClose(self);
2890     }
2891   }
GDALDatasetShadow_GetDriver(GDALDatasetShadow * self)2892 SWIGINTERN GDALDriverShadow *GDALDatasetShadow_GetDriver(GDALDatasetShadow *self){
2893     return (GDALDriverShadow*) GDALGetDatasetDriver( self );
2894   }
GDALDatasetShadow_GetRasterBand(GDALDatasetShadow * self,int nBand)2895 SWIGINTERN GDALRasterBandShadow *GDALDatasetShadow_GetRasterBand(GDALDatasetShadow *self,int nBand){
2896     return (GDALRasterBandShadow*) GDALGetRasterBand( self, nBand );
2897   }
GDALDatasetShadow_GetRootGroup(GDALDatasetShadow * self)2898 SWIGINTERN GDALGroupHS *GDALDatasetShadow_GetRootGroup(GDALDatasetShadow *self){
2899     return GDALDatasetGetRootGroup(self);
2900   }
GDALDatasetShadow_GetProjection(GDALDatasetShadow * self)2901 SWIGINTERN char const *GDALDatasetShadow_GetProjection(GDALDatasetShadow *self){
2902     return GDALGetProjectionRef( self );
2903   }
GDALDatasetShadow_GetProjectionRef(GDALDatasetShadow * self)2904 SWIGINTERN char const *GDALDatasetShadow_GetProjectionRef(GDALDatasetShadow *self){
2905     return GDALGetProjectionRef( self );
2906   }
GDALDatasetShadow_GetSpatialRef(GDALDatasetShadow * self)2907 SWIGINTERN OSRSpatialReferenceShadow *GDALDatasetShadow_GetSpatialRef(GDALDatasetShadow *self){
2908     OGRSpatialReferenceH ref = GDALGetSpatialRef(self);
2909     if( ref )
2910        ref = OSRClone( ref );
2911     return (OSRSpatialReferenceShadow*) ref;
2912   }
GDALDatasetShadow_SetProjection(GDALDatasetShadow * self,char const * prj)2913 SWIGINTERN CPLErr GDALDatasetShadow_SetProjection(GDALDatasetShadow *self,char const *prj){
2914     return GDALSetProjection( self, prj );
2915   }
GDALDatasetShadow_SetSpatialRef(GDALDatasetShadow * self,OSRSpatialReferenceShadow * srs)2916 SWIGINTERN CPLErr GDALDatasetShadow_SetSpatialRef(GDALDatasetShadow *self,OSRSpatialReferenceShadow *srs){
2917      return GDALSetSpatialRef( self, (OGRSpatialReferenceH)srs );
2918   }
GDALDatasetShadow_GetGeoTransform(GDALDatasetShadow * self,double argout[6])2919 SWIGINTERN void GDALDatasetShadow_GetGeoTransform(GDALDatasetShadow *self,double argout[6]){
2920     if ( GDALGetGeoTransform( self, argout ) != CE_None ) {
2921       argout[0] = 0.0;
2922       argout[1] = 1.0;
2923       argout[2] = 0.0;
2924       argout[3] = 0.0;
2925       argout[4] = 0.0;
2926       argout[5] = 1.0;
2927     }
2928   }
GDALDatasetShadow_SetGeoTransform(GDALDatasetShadow * self,double argin[6])2929 SWIGINTERN CPLErr GDALDatasetShadow_SetGeoTransform(GDALDatasetShadow *self,double argin[6]){
2930     return GDALSetGeoTransform( self, argin );
2931   }
GDALDatasetShadow_BuildOverviews(GDALDatasetShadow * self,char const * resampling="NEAREST",int overviewlist=0,int * pOverviews=0,GDALProgressFunc callback=NULL,void * callback_data=NULL)2932 SWIGINTERN int GDALDatasetShadow_BuildOverviews(GDALDatasetShadow *self,char const *resampling="NEAREST",int overviewlist=0,int *pOverviews=0,GDALProgressFunc callback=NULL,void *callback_data=NULL){
2933 
2934     return GDALBuildOverviews(  self,
2935                                 resampling ? resampling : "NEAREST",
2936                                 overviewlist,
2937                                 pOverviews,
2938                                 0,
2939                                 0,
2940                                 callback,
2941                                 callback_data);
2942   }
GDALDatasetShadow_GetGCPCount(GDALDatasetShadow * self)2943 SWIGINTERN int GDALDatasetShadow_GetGCPCount(GDALDatasetShadow *self){
2944     return GDALGetGCPCount( self );
2945   }
GDALDatasetShadow_GetGCPProjection(GDALDatasetShadow * self)2946 SWIGINTERN char const *GDALDatasetShadow_GetGCPProjection(GDALDatasetShadow *self){
2947     return GDALGetGCPProjection( self );
2948   }
GDALDatasetShadow_GetGCPSpatialRef(GDALDatasetShadow * self)2949 SWIGINTERN OSRSpatialReferenceShadow *GDALDatasetShadow_GetGCPSpatialRef(GDALDatasetShadow *self){
2950     OGRSpatialReferenceH ref = GDALGetGCPSpatialRef(self);
2951     if( ref )
2952        ref = OSRClone( ref );
2953     return (OSRSpatialReferenceShadow*) ref;
2954   }
GDALDatasetShadow_GetGCPs(GDALDatasetShadow * self,int * nGCPs,GDAL_GCP const ** pGCPs)2955 SWIGINTERN void GDALDatasetShadow_GetGCPs(GDALDatasetShadow *self,int *nGCPs,GDAL_GCP const **pGCPs){
2956     *nGCPs = GDALGetGCPCount( self );
2957     *pGCPs = GDALGetGCPs( self );
2958   }
GDALDatasetShadow_SetGCPs(GDALDatasetShadow * self,int nGCPs,GDAL_GCP const * pGCPs,char const * pszGCPProjection)2959 SWIGINTERN CPLErr GDALDatasetShadow_SetGCPs(GDALDatasetShadow *self,int nGCPs,GDAL_GCP const *pGCPs,char const *pszGCPProjection){
2960     return GDALSetGCPs( self, nGCPs, pGCPs, pszGCPProjection );
2961   }
GDALDatasetShadow_SetGCPs2(GDALDatasetShadow * self,int nGCPs,GDAL_GCP const * pGCPs,OSRSpatialReferenceShadow * hSRS)2962 SWIGINTERN CPLErr GDALDatasetShadow_SetGCPs2(GDALDatasetShadow *self,int nGCPs,GDAL_GCP const *pGCPs,OSRSpatialReferenceShadow *hSRS){
2963     return GDALSetGCPs2( self, nGCPs, pGCPs, (OGRSpatialReferenceH)hSRS );
2964   }
GDALDatasetShadow_FlushCache(GDALDatasetShadow * self)2965 SWIGINTERN void GDALDatasetShadow_FlushCache(GDALDatasetShadow *self){
2966     GDALFlushCache( self );
2967   }
GDALDatasetShadow_AddBand(GDALDatasetShadow * self,GDALDataType datatype=GDT_Byte,char ** options=0)2968 SWIGINTERN CPLErr GDALDatasetShadow_AddBand(GDALDatasetShadow *self,GDALDataType datatype=GDT_Byte,char **options=0){
2969     return GDALAddBand( self, datatype, options );
2970   }
GDALDatasetShadow_CreateMaskBand(GDALDatasetShadow * self,int nFlags)2971 SWIGINTERN CPLErr GDALDatasetShadow_CreateMaskBand(GDALDatasetShadow *self,int nFlags){
2972       return GDALCreateDatasetMaskBand( self, nFlags );
2973   }
GDALDatasetShadow_GetFileList(GDALDatasetShadow * self)2974 SWIGINTERN char **GDALDatasetShadow_GetFileList(GDALDatasetShadow *self){
2975     return GDALGetFileList( self );
2976   }
GDALDatasetShadow_WriteRaster(GDALDatasetShadow * self,int xoff,int yoff,int xsize,int ysize,GIntBig buf_len,char * buf_string,int * buf_xsize=0,int * buf_ysize=0,GDALDataType * buf_type=0,int band_list=0,int * pband_list=0,GIntBig * buf_pixel_space=0,GIntBig * buf_line_space=0,GIntBig * buf_band_space=0)2977 SWIGINTERN CPLErr GDALDatasetShadow_WriteRaster(GDALDatasetShadow *self,int xoff,int yoff,int xsize,int ysize,GIntBig buf_len,char *buf_string,int *buf_xsize=0,int *buf_ysize=0,GDALDataType *buf_type=0,int band_list=0,int *pband_list=0,GIntBig *buf_pixel_space=0,GIntBig *buf_line_space=0,GIntBig *buf_band_space=0){
2978     CPLErr eErr;
2979     int nxsize = (buf_xsize==0) ? xsize : *buf_xsize;
2980     int nysize = (buf_ysize==0) ? ysize : *buf_ysize;
2981     GDALDataType ntype;
2982     if ( buf_type != 0 ) {
2983       ntype = (GDALDataType) *buf_type;
2984     } else {
2985       int lastband = GDALGetRasterCount( self );
2986       if (lastband <= 0)
2987         return CE_Failure;
2988       ntype = GDALGetRasterDataType( GDALGetRasterBand( self, lastband ) );
2989     }
2990 
2991     GIntBig pixel_space = (buf_pixel_space == 0) ? 0 : *buf_pixel_space;
2992     GIntBig line_space = (buf_line_space == 0) ? 0 : *buf_line_space;
2993     GIntBig band_space = (buf_band_space == 0) ? 0 : *buf_band_space;
2994 
2995     GIntBig min_buffer_size =
2996       ComputeDatasetRasterIOSize (nxsize, nysize, GDALGetDataTypeSize( ntype ) / 8,
2997                                   band_list ? band_list : GDALGetRasterCount(self), pband_list, band_list,
2998                                   pixel_space, line_space, band_space, FALSE);
2999     if (min_buffer_size == 0)
3000         return CE_Failure;
3001 
3002     if ( buf_len < min_buffer_size )
3003     {
3004         CPLError(CE_Failure, CPLE_AppDefined, "Buffer too small");
3005         return CE_Failure;
3006     }
3007 
3008     GDALRasterIOExtraArg* psExtraArg = NULL;
3009 
3010     eErr = GDALDatasetRasterIOEx( self, GF_Write, xoff, yoff, xsize, ysize,
3011                                   (void*) buf_string, nxsize, nysize, ntype,
3012                                   band_list, pband_list, pixel_space, line_space, band_space, psExtraArg );
3013 
3014     return eErr;
3015   }
GDALDatasetShadow_ReadRaster(GDALDatasetShadow * self,int xoff,int yoff,int xsize,int ysize,GIntBig * buf_len,char ** buf,int * buf_xsize=0,int * buf_ysize=0,GDALDataType * buf_type=0,int band_list=0,int * pband_list=0,GIntBig * buf_pixel_space=0,GIntBig * buf_line_space=0,GIntBig * buf_band_space=0,GDALRIOResampleAlg resample_alg=GRIORA_NearestNeighbour,GDALProgressFunc callback=NULL,void * callback_data=NULL)3016 SWIGINTERN CPLErr GDALDatasetShadow_ReadRaster(GDALDatasetShadow *self,int xoff,int yoff,int xsize,int ysize,GIntBig *buf_len,char **buf,int *buf_xsize=0,int *buf_ysize=0,GDALDataType *buf_type=0,int band_list=0,int *pband_list=0,GIntBig *buf_pixel_space=0,GIntBig *buf_line_space=0,GIntBig *buf_band_space=0,GDALRIOResampleAlg resample_alg=GRIORA_NearestNeighbour,GDALProgressFunc callback=NULL,void *callback_data=NULL){
3017     CPLErr eErr;
3018     int nxsize = (buf_xsize==0) ? xsize : *buf_xsize;
3019     int nysize = (buf_ysize==0) ? ysize : *buf_ysize;
3020     GDALDataType ntype;
3021     if ( buf_type != 0 ) {
3022       ntype = (GDALDataType) *buf_type;
3023     } else {
3024       int lastband = GDALGetRasterCount( self );
3025       if (lastband <= 0)
3026         return CE_Failure;
3027       ntype = GDALGetRasterDataType( GDALGetRasterBand( self, lastband ) );
3028     }
3029 
3030     GDALRasterIOExtraArg sExtraArg;
3031     INIT_RASTERIO_EXTRA_ARG(sExtraArg);
3032     sExtraArg.eResampleAlg = resample_alg;
3033     sExtraArg.pfnProgress = callback;
3034     sExtraArg.pProgressData = callback_data;
3035 
3036     GIntBig pixel_space = (buf_pixel_space == 0) ? 0 : *buf_pixel_space;
3037     GIntBig line_space = (buf_line_space == 0) ? 0 : *buf_line_space;
3038     GIntBig band_space = (buf_band_space == 0) ? 0 : *buf_band_space;
3039 
3040     eErr = DSReadRaster_internal( self, xoff, yoff, xsize, ysize,
3041                                 nxsize, nysize, ntype,
3042                                 buf_len, buf,
3043                                 band_list, pband_list,
3044                                 pixel_space, line_space, band_space, &sExtraArg);
3045 
3046     return eErr;
3047 }
GDALDatasetShadow_AdviseRead(GDALDatasetShadow * self,int xoff,int yoff,int xsize,int ysize,int * buf_xsize=0,int * buf_ysize=0,GDALDataType * buf_type=0,int band_list=0,int * pband_list=0,char ** options=NULL)3048 SWIGINTERN CPLErr GDALDatasetShadow_AdviseRead(GDALDatasetShadow *self,int xoff,int yoff,int xsize,int ysize,int *buf_xsize=0,int *buf_ysize=0,GDALDataType *buf_type=0,int band_list=0,int *pband_list=0,char **options=NULL){
3049     int nxsize = (buf_xsize==0) ? xsize : *buf_xsize;
3050     int nysize = (buf_ysize==0) ? ysize : *buf_ysize;
3051     GDALDataType ntype;
3052     if ( buf_type != 0 ) {
3053       ntype = (GDALDataType) *buf_type;
3054     } else {
3055       int lastband = GDALGetRasterCount( self );
3056       if (lastband <= 0)
3057         return CE_Failure;
3058       ntype = GDALGetRasterDataType( GDALGetRasterBand( self, lastband ) );
3059     }
3060     return GDALDatasetAdviseRead(self, xoff, yoff, xsize, ysize,
3061                                  nxsize, nysize, ntype,
3062                                  band_list, pband_list, options);
3063 }
GDALDatasetShadow_CreateLayer(GDALDatasetShadow * self,char const * name,OSRSpatialReferenceShadow * srs=NULL,OGRwkbGeometryType geom_type=wkbUnknown,char ** options=0)3064 SWIGINTERN OGRLayerShadow *GDALDatasetShadow_CreateLayer(GDALDatasetShadow *self,char const *name,OSRSpatialReferenceShadow *srs=NULL,OGRwkbGeometryType geom_type=wkbUnknown,char **options=0){
3065     OGRLayerShadow* layer = (OGRLayerShadow*) GDALDatasetCreateLayer( self,
3066                                   name,
3067                                   srs,
3068                                   geom_type,
3069                                   options);
3070     return layer;
3071   }
GDALDatasetShadow_CopyLayer(GDALDatasetShadow * self,OGRLayerShadow * src_layer,char const * new_name,char ** options=0)3072 SWIGINTERN OGRLayerShadow *GDALDatasetShadow_CopyLayer(GDALDatasetShadow *self,OGRLayerShadow *src_layer,char const *new_name,char **options=0){
3073     OGRLayerShadow* layer = (OGRLayerShadow*) GDALDatasetCopyLayer( self,
3074                                                       src_layer,
3075                                                       new_name,
3076                                                       options);
3077     return layer;
3078   }
GDALDatasetShadow_DeleteLayer(GDALDatasetShadow * self,int index)3079 SWIGINTERN OGRErr GDALDatasetShadow_DeleteLayer(GDALDatasetShadow *self,int index){
3080     return GDALDatasetDeleteLayer(self, index);
3081   }
3082 
3083 
3084 #include "ogr_core.h"
3085 static char const *
OGRErrMessages(int rc)3086 OGRErrMessages( int rc ) {
3087   switch( rc ) {
3088   case OGRERR_NONE:
3089     return "OGR Error: None";
3090   case OGRERR_NOT_ENOUGH_DATA:
3091     return "OGR Error: Not enough data to deserialize";
3092   case OGRERR_NOT_ENOUGH_MEMORY:
3093     return "OGR Error: Not enough memory";
3094   case OGRERR_UNSUPPORTED_GEOMETRY_TYPE:
3095     return "OGR Error: Unsupported geometry type";
3096   case OGRERR_UNSUPPORTED_OPERATION:
3097     return "OGR Error: Unsupported operation";
3098   case OGRERR_CORRUPT_DATA:
3099     return "OGR Error: Corrupt data";
3100   case OGRERR_FAILURE:
3101     return "OGR Error: General Error";
3102   case OGRERR_UNSUPPORTED_SRS:
3103     return "OGR Error: Unsupported SRS";
3104   case OGRERR_INVALID_HANDLE:
3105     return "OGR Error: Invalid handle";
3106   case OGRERR_NON_EXISTING_FEATURE:
3107     return "OGR Error: Non existing feature";
3108   default:
3109     return "OGR Error: Unknown";
3110   }
3111 }
3112 
GDALDatasetShadow_GetLayerCount(GDALDatasetShadow * self)3113 SWIGINTERN int GDALDatasetShadow_GetLayerCount(GDALDatasetShadow *self){
3114     return GDALDatasetGetLayerCount(self);
3115   }
GDALDatasetShadow_GetLayerByIndex(GDALDatasetShadow * self,int index=0)3116 SWIGINTERN OGRLayerShadow *GDALDatasetShadow_GetLayerByIndex(GDALDatasetShadow *self,int index=0){
3117 
3118     OGRLayerShadow* layer = (OGRLayerShadow*) GDALDatasetGetLayer(self, index);
3119     return layer;
3120   }
GDALDatasetShadow_GetLayerByName(GDALDatasetShadow * self,char const * layer_name)3121 SWIGINTERN OGRLayerShadow *GDALDatasetShadow_GetLayerByName(GDALDatasetShadow *self,char const *layer_name){
3122     OGRLayerShadow* layer = (OGRLayerShadow*) GDALDatasetGetLayerByName(self, layer_name);
3123     return layer;
3124   }
GDALDatasetShadow_ResetReading(GDALDatasetShadow * self)3125 SWIGINTERN void GDALDatasetShadow_ResetReading(GDALDatasetShadow *self){
3126     GDALDatasetResetReading( self );
3127   }
GDALDatasetShadow_GetNextFeature(GDALDatasetShadow * self)3128 SWIGINTERN OGRFeatureShadow *GDALDatasetShadow_GetNextFeature(GDALDatasetShadow *self){
3129     return GDALDatasetGetNextFeature( self, NULL, NULL, NULL, NULL );
3130   }
GDALDatasetShadow_TestCapability(GDALDatasetShadow * self,char const * cap)3131 SWIGINTERN bool GDALDatasetShadow_TestCapability(GDALDatasetShadow *self,char const *cap){
3132     return (GDALDatasetTestCapability(self, cap) > 0);
3133   }
GDALDatasetShadow_ExecuteSQL(GDALDatasetShadow * self,char const * statement,OGRGeometryShadow * spatialFilter=NULL,char const * dialect="")3134 SWIGINTERN OGRLayerShadow *GDALDatasetShadow_ExecuteSQL(GDALDatasetShadow *self,char const *statement,OGRGeometryShadow *spatialFilter=NULL,char const *dialect=""){
3135     OGRLayerShadow* layer = (OGRLayerShadow*) GDALDatasetExecuteSQL(self,
3136                                                       statement,
3137                                                       spatialFilter,
3138                                                       dialect);
3139     return layer;
3140   }
GDALDatasetShadow_ReleaseResultSet(GDALDatasetShadow * self,OGRLayerShadow * layer)3141 SWIGINTERN void GDALDatasetShadow_ReleaseResultSet(GDALDatasetShadow *self,OGRLayerShadow *layer){
3142     GDALDatasetReleaseResultSet(self, layer);
3143   }
GDALDatasetShadow_GetStyleTable(GDALDatasetShadow * self)3144 SWIGINTERN OGRStyleTableShadow *GDALDatasetShadow_GetStyleTable(GDALDatasetShadow *self){
3145     return (OGRStyleTableShadow*) GDALDatasetGetStyleTable(self);
3146   }
GDALDatasetShadow_SetStyleTable(GDALDatasetShadow * self,OGRStyleTableShadow * table)3147 SWIGINTERN void GDALDatasetShadow_SetStyleTable(GDALDatasetShadow *self,OGRStyleTableShadow *table){
3148     if( table != NULL )
3149         GDALDatasetSetStyleTable(self, (OGRStyleTableH) table);
3150   }
GDALDatasetShadow_AbortSQL(GDALDatasetShadow * self)3151 SWIGINTERN OGRErr GDALDatasetShadow_AbortSQL(GDALDatasetShadow *self){
3152     return GDALDatasetAbortSQL(self);
3153 }
GDALDatasetShadow_StartTransaction(GDALDatasetShadow * self,int force=FALSE)3154 SWIGINTERN OGRErr GDALDatasetShadow_StartTransaction(GDALDatasetShadow *self,int force=FALSE){
3155     return GDALDatasetStartTransaction(self, force);
3156   }
GDALDatasetShadow_CommitTransaction(GDALDatasetShadow * self)3157 SWIGINTERN OGRErr GDALDatasetShadow_CommitTransaction(GDALDatasetShadow *self){
3158     return GDALDatasetCommitTransaction(self);
3159   }
GDALDatasetShadow_RollbackTransaction(GDALDatasetShadow * self)3160 SWIGINTERN OGRErr GDALDatasetShadow_RollbackTransaction(GDALDatasetShadow *self){
3161     return GDALDatasetRollbackTransaction(self);
3162   }
GDALDatasetShadow_ClearStatistics(GDALDatasetShadow * self)3163 SWIGINTERN void GDALDatasetShadow_ClearStatistics(GDALDatasetShadow *self){
3164       GDALDatasetClearStatistics(self);
3165   }
GDALDatasetShadow_GetFieldDomain(GDALDatasetShadow * self,char const * name)3166 SWIGINTERN OGRFieldDomainShadow *GDALDatasetShadow_GetFieldDomain(GDALDatasetShadow *self,char const *name){
3167     return (OGRFieldDomainShadow*) GDALDatasetGetFieldDomain(self, name);
3168   }
GDALDatasetShadow_AddFieldDomain(GDALDatasetShadow * self,OGRFieldDomainShadow * fieldDomain)3169 SWIGINTERN bool GDALDatasetShadow_AddFieldDomain(GDALDatasetShadow *self,OGRFieldDomainShadow *fieldDomain){
3170       return GDALDatasetAddFieldDomain(self, (OGRFieldDomainH)fieldDomain, NULL);
3171   }
3172 
GDALDatasetShadow_RasterXSize_get(GDALDatasetShadow * h)3173 int GDALDatasetShadow_RasterXSize_get( GDALDatasetShadow *h ) {
3174   return GDALGetRasterXSize( h );
3175 }
GDALDatasetShadow_RasterYSize_get(GDALDatasetShadow * h)3176 int GDALDatasetShadow_RasterYSize_get( GDALDatasetShadow *h ) {
3177   return GDALGetRasterYSize( h );
3178 }
GDALDatasetShadow_RasterCount_get(GDALDatasetShadow * h)3179 int GDALDatasetShadow_RasterCount_get( GDALDatasetShadow *h ) {
3180   return GDALGetRasterCount( h );
3181 }
3182 
delete_GDALGroupHS(GDALGroupHS * self)3183 SWIGINTERN void delete_GDALGroupHS(GDALGroupHS *self){
3184     GDALGroupRelease(self);
3185   }
GDALGroupHS_GetName(GDALGroupHS * self)3186 SWIGINTERN char const *GDALGroupHS_GetName(GDALGroupHS *self){
3187     return GDALGroupGetName(self);
3188   }
GDALGroupHS_GetFullName(GDALGroupHS * self)3189 SWIGINTERN char const *GDALGroupHS_GetFullName(GDALGroupHS *self){
3190     return GDALGroupGetFullName(self);
3191   }
GDALGroupHS_GetMDArrayNames(GDALGroupHS * self,char ** options=0)3192 SWIGINTERN char **GDALGroupHS_GetMDArrayNames(GDALGroupHS *self,char **options=0){
3193     return GDALGroupGetMDArrayNames( self, options );
3194   }
GDALGroupHS_OpenMDArray(GDALGroupHS * self,char const * name,char ** options=0)3195 SWIGINTERN GDALMDArrayHS *GDALGroupHS_OpenMDArray(GDALGroupHS *self,char const *name,char **options=0){
3196     return GDALGroupOpenMDArray(self, name, options);
3197   }
GDALGroupHS_OpenMDArrayFromFullname(GDALGroupHS * self,char const * name,char ** options=0)3198 SWIGINTERN GDALMDArrayHS *GDALGroupHS_OpenMDArrayFromFullname(GDALGroupHS *self,char const *name,char **options=0){
3199     return GDALGroupOpenMDArrayFromFullname(self, name, options);
3200   }
GDALGroupHS_ResolveMDArray(GDALGroupHS * self,char const * name,char const * starting_point,char ** options=0)3201 SWIGINTERN GDALMDArrayHS *GDALGroupHS_ResolveMDArray(GDALGroupHS *self,char const *name,char const *starting_point,char **options=0){
3202     return GDALGroupResolveMDArray(self, name, starting_point, options);
3203   }
GDALGroupHS_GetGroupNames(GDALGroupHS * self,char ** options=0)3204 SWIGINTERN char **GDALGroupHS_GetGroupNames(GDALGroupHS *self,char **options=0){
3205     return GDALGroupGetGroupNames( self, options );
3206   }
GDALGroupHS_OpenGroup(GDALGroupHS * self,char const * name,char ** options=0)3207 SWIGINTERN GDALGroupHS *GDALGroupHS_OpenGroup(GDALGroupHS *self,char const *name,char **options=0){
3208     return GDALGroupOpenGroup(self, name, options);
3209   }
GDALGroupHS_OpenGroupFromFullname(GDALGroupHS * self,char const * name,char ** options=0)3210 SWIGINTERN GDALGroupHS *GDALGroupHS_OpenGroupFromFullname(GDALGroupHS *self,char const *name,char **options=0){
3211     return GDALGroupOpenGroupFromFullname(self, name, options);
3212   }
GDALGroupHS_GetAttribute(GDALGroupHS * self,char const * name)3213 SWIGINTERN GDALAttributeHS *GDALGroupHS_GetAttribute(GDALGroupHS *self,char const *name){
3214     return GDALGroupGetAttribute(self, name);
3215   }
GDALGroupHS_GetStructuralInfo(GDALGroupHS * self)3216 SWIGINTERN char **GDALGroupHS_GetStructuralInfo(GDALGroupHS *self){
3217     return GDALGroupGetStructuralInfo( self );
3218   }
GDALGroupHS_CreateGroup(GDALGroupHS * self,char const * name,char ** options=0)3219 SWIGINTERN GDALGroupHS *GDALGroupHS_CreateGroup(GDALGroupHS *self,char const *name,char **options=0){
3220     return GDALGroupCreateGroup(self, name, options);
3221   }
GDALGroupHS_CreateDimension(GDALGroupHS * self,char const * name,char const * type,char const * direction,unsigned long long size,char ** options=0)3222 SWIGINTERN GDALDimensionHS *GDALGroupHS_CreateDimension(GDALGroupHS *self,char const *name,char const *type,char const *direction,unsigned long long size,char **options=0){
3223     return GDALGroupCreateDimension(self, name, type, direction, size, options);
3224   }
GDALGroupHS_CreateAttribute(GDALGroupHS * self,char const * name,int nDimensions,GUIntBig * dimensions,GDALExtendedDataTypeHS * data_type,char ** options=0)3225 SWIGINTERN GDALAttributeHS *GDALGroupHS_CreateAttribute(GDALGroupHS *self,char const *name,int nDimensions,GUIntBig *dimensions,GDALExtendedDataTypeHS *data_type,char **options=0){
3226     return GDALGroupCreateAttribute(self, name, nDimensions,
3227                                     (const GUInt64*)dimensions,
3228                                     data_type, options);
3229   }
3230 
3231 typedef struct
3232 {
3233   double min;
3234   double max;
3235   double mean;
3236   double std_dev;
3237   GIntBig valid_count;
3238 } Statistics;
3239 
delete_Statistics(Statistics * self)3240 SWIGINTERN void delete_Statistics(Statistics *self){
3241     CPLFree(self);
3242   }
3243 
3244 #include <limits>
3245 
CheckNumericDataType(GDALExtendedDataTypeHS * dt)3246 static bool CheckNumericDataType(GDALExtendedDataTypeHS* dt)
3247 {
3248     GDALExtendedDataTypeClass klass = GDALExtendedDataTypeGetClass(dt);
3249     if( klass == GEDTC_NUMERIC )
3250         return true;
3251     if( klass == GEDTC_STRING )
3252         return false;
3253     CPLAssert( klass == GEDTC_COMPOUND );
3254     size_t nCount = 0;
3255     GDALEDTComponentH* comps = GDALExtendedDataTypeGetComponents(dt, &nCount);
3256     bool ret = true;
3257     for( size_t i = 0; i < nCount; i++ )
3258     {
3259         GDALExtendedDataTypeH tmpType = GDALEDTComponentGetType(comps[i]);
3260         ret = CheckNumericDataType(tmpType);
3261         GDALExtendedDataTypeRelease(tmpType);
3262         if( !ret )
3263             break;
3264     }
3265     GDALExtendedDataTypeFreeComponents(comps, nCount);
3266     return ret;
3267 }
3268 
MDArrayReadWriteCheckArguments(GDALMDArrayHS * array,bool bCheckOnlyDims,int nDims1,GUIntBig * array_start_idx,int nDims2,GUIntBig * count,int nDims3,GIntBig * array_step,int nDims4,GIntBig * buffer_stride,GDALExtendedDataTypeHS * buffer_datatype,size_t * pnBufferSize)3269 static CPLErr MDArrayReadWriteCheckArguments(GDALMDArrayHS* array,
3270                                              bool bCheckOnlyDims,
3271                                              int nDims1, GUIntBig* array_start_idx,
3272                                              int nDims2, GUIntBig* count,
3273                                              int nDims3, GIntBig* array_step,
3274                                              int nDims4, GIntBig* buffer_stride,
3275                                              GDALExtendedDataTypeHS* buffer_datatype,
3276                                              size_t* pnBufferSize)
3277 {
3278     const int nExpectedDims = (int)GDALMDArrayGetDimensionCount(array);
3279     if( nDims1 != nExpectedDims )
3280     {
3281         CPLError(CE_Failure, CPLE_AppDefined,
3282             "Wrong number of values in array_start_idx");
3283         return CE_Failure;
3284     }
3285     if( nDims2 != nExpectedDims )
3286     {
3287         CPLError(CE_Failure, CPLE_AppDefined,
3288             "Wrong number of values in count");
3289         return CE_Failure;
3290     }
3291     if( nDims3 != nExpectedDims )
3292     {
3293         CPLError(CE_Failure, CPLE_AppDefined,
3294             "Wrong number of values in array_step");
3295         return CE_Failure;
3296     }
3297     if( nDims4!= nExpectedDims )
3298     {
3299         CPLError(CE_Failure, CPLE_AppDefined,
3300             "Wrong number of values in buffer_stride");
3301         return CE_Failure;
3302     }
3303     if( bCheckOnlyDims )
3304         return CE_None;
3305     if( !CheckNumericDataType(buffer_datatype) )
3306     {
3307         CPLError(CE_Failure, CPLE_NotSupported,
3308             "non-numeric buffer data type not supported in SWIG bindings");
3309         return CE_Failure;
3310     }
3311     GIntBig nBufferSize = 0;
3312     for( int i = 0; i < nExpectedDims; i++ )
3313     {
3314         if( count[i] == 0 )
3315         {
3316             CPLError(CE_Failure, CPLE_AppDefined,
3317                      "count[%d] = 0 is invalid", i);
3318             return CE_Failure;
3319         }
3320         if( buffer_stride[i] < 0 )
3321         {
3322             CPLError(CE_Failure, CPLE_NotSupported,
3323                 "Negative value in buffer_stride not supported in SWIG bindings");
3324             return CE_Failure;
3325         }
3326         if( count[i] > 1 && buffer_stride[i] != 0 )
3327         {
3328             if( (GUIntBig)buffer_stride[i] > std::numeric_limits<GIntBig>::max() / (count[i] - 1) )
3329             {
3330                 CPLError(CE_Failure, CPLE_AppDefined, "Integer overflow");
3331                 return CE_Failure;
3332             }
3333             GIntBig nDelta = buffer_stride[i] * (count[i] - 1);
3334             if( nBufferSize > std::numeric_limits<GIntBig>::max() - nDelta )
3335             {
3336                 CPLError(CE_Failure, CPLE_AppDefined, "Integer overflow");
3337                 return CE_Failure;
3338             }
3339             nBufferSize += nDelta;
3340         }
3341     }
3342     const size_t nDTSize = GDALExtendedDataTypeGetSize(buffer_datatype);
3343     if( nDTSize == 0 )
3344     {
3345         CPLError(CE_Failure, CPLE_AppDefined, "nDTSize == 0");
3346         return CE_Failure;
3347     }
3348     if( (GUIntBig)nBufferSize > (GUIntBig)std::numeric_limits<GIntBig>::max() / nDTSize )
3349     {
3350         CPLError(CE_Failure, CPLE_AppDefined, "Integer overflow");
3351         return CE_Failure;
3352     }
3353     nBufferSize *= nDTSize;
3354     if( (GUIntBig)nBufferSize > (GUIntBig)std::numeric_limits<GIntBig>::max() - nDTSize )
3355     {
3356         CPLError(CE_Failure, CPLE_AppDefined, "Integer overflow");
3357         return CE_Failure;
3358     }
3359     nBufferSize += nDTSize;
3360 
3361 #if SIZEOF_VOIDP == 4
3362     if( nBufferSize > INT_MAX )
3363     {
3364         CPLError(CE_Failure, CPLE_IllegalArg, "Integer overflow");
3365         return CE_Failure;
3366     }
3367 #endif
3368     *pnBufferSize = (size_t)nBufferSize;
3369     return CE_None;
3370 }
3371 
delete_GDALMDArrayHS(GDALMDArrayHS * self)3372 SWIGINTERN void delete_GDALMDArrayHS(GDALMDArrayHS *self){
3373     GDALMDArrayRelease(self);
3374   }
GDALMDArrayHS_GetName(GDALMDArrayHS * self)3375 SWIGINTERN char const *GDALMDArrayHS_GetName(GDALMDArrayHS *self){
3376     return GDALMDArrayGetName(self);
3377   }
GDALMDArrayHS_GetFullName(GDALMDArrayHS * self)3378 SWIGINTERN char const *GDALMDArrayHS_GetFullName(GDALMDArrayHS *self){
3379     return GDALMDArrayGetFullName(self);
3380   }
GDALMDArrayHS_GetTotalElementsCount(GDALMDArrayHS * self)3381 SWIGINTERN unsigned long long GDALMDArrayHS_GetTotalElementsCount(GDALMDArrayHS *self){
3382     return GDALMDArrayGetTotalElementsCount(self);
3383   }
GDALMDArrayHS_GetDimensionCount(GDALMDArrayHS * self)3384 SWIGINTERN size_t GDALMDArrayHS_GetDimensionCount(GDALMDArrayHS *self){
3385     return GDALMDArrayGetDimensionCount(self);
3386   }
GDALMDArrayHS_GetDataType(GDALMDArrayHS * self)3387 SWIGINTERN GDALExtendedDataTypeHS *GDALMDArrayHS_GetDataType(GDALMDArrayHS *self){
3388     return GDALMDArrayGetDataType(self);
3389   }
GDALMDArrayHS_GetStructuralInfo(GDALMDArrayHS * self)3390 SWIGINTERN char **GDALMDArrayHS_GetStructuralInfo(GDALMDArrayHS *self){
3391     return GDALMDArrayGetStructuralInfo( self );
3392   }
GDALMDArrayHS_GetAttribute(GDALMDArrayHS * self,char const * name)3393 SWIGINTERN GDALAttributeHS *GDALMDArrayHS_GetAttribute(GDALMDArrayHS *self,char const *name){
3394     return GDALMDArrayGetAttribute(self, name);
3395   }
GDALMDArrayHS_CreateAttribute(GDALMDArrayHS * self,char const * name,int nDimensions,GUIntBig * dimensions,GDALExtendedDataTypeHS * data_type,char ** options=0)3396 SWIGINTERN GDALAttributeHS *GDALMDArrayHS_CreateAttribute(GDALMDArrayHS *self,char const *name,int nDimensions,GUIntBig *dimensions,GDALExtendedDataTypeHS *data_type,char **options=0){
3397     return GDALMDArrayCreateAttribute(self, name, nDimensions,
3398                                     (const GUInt64*)dimensions,
3399                                     data_type, options);
3400   }
GDALMDArrayHS_GetNoDataValueAsDouble(GDALMDArrayHS * self,double * val,int * hasval)3401 SWIGINTERN void GDALMDArrayHS_GetNoDataValueAsDouble(GDALMDArrayHS *self,double *val,int *hasval){
3402     *val = GDALMDArrayGetNoDataValueAsDouble( self, hasval );
3403   }
GDALMDArrayHS_SetNoDataValueDouble(GDALMDArrayHS * self,double d)3404 SWIGINTERN CPLErr GDALMDArrayHS_SetNoDataValueDouble(GDALMDArrayHS *self,double d){
3405     return GDALMDArraySetNoDataValueAsDouble( self, d ) ? CE_None : CE_Failure;
3406   }
GDALMDArrayHS_DeleteNoDataValue(GDALMDArrayHS * self)3407 SWIGINTERN CPLErr GDALMDArrayHS_DeleteNoDataValue(GDALMDArrayHS *self){
3408     return GDALMDArraySetRawNoDataValue( self, NULL ) ? CE_None : CE_Failure;
3409   }
GDALMDArrayHS_GetOffset(GDALMDArrayHS * self,double * val,int * hasval)3410 SWIGINTERN void GDALMDArrayHS_GetOffset(GDALMDArrayHS *self,double *val,int *hasval){
3411     *val = GDALMDArrayGetOffset( self, hasval );
3412   }
GDALMDArrayHS_GetOffsetStorageType(GDALMDArrayHS * self)3413 SWIGINTERN GDALDataType GDALMDArrayHS_GetOffsetStorageType(GDALMDArrayHS *self){
3414     GDALDataType eDT = GDT_Unknown;
3415     int hasval = FALSE;
3416     GDALMDArrayGetOffsetEx( self, &hasval, &eDT );
3417     return hasval ? eDT : GDT_Unknown;
3418   }
GDALMDArrayHS_GetScale(GDALMDArrayHS * self,double * val,int * hasval)3419 SWIGINTERN void GDALMDArrayHS_GetScale(GDALMDArrayHS *self,double *val,int *hasval){
3420     *val = GDALMDArrayGetScale( self, hasval );
3421   }
GDALMDArrayHS_GetScaleStorageType(GDALMDArrayHS * self)3422 SWIGINTERN GDALDataType GDALMDArrayHS_GetScaleStorageType(GDALMDArrayHS *self){
3423     GDALDataType eDT = GDT_Unknown;
3424     int hasval = FALSE;
3425     GDALMDArrayGetScaleEx( self, &hasval, &eDT );
3426     return hasval ? eDT : GDT_Unknown;
3427   }
GDALMDArrayHS_SetOffset(GDALMDArrayHS * self,double val,GDALDataType storageType=GDT_Unknown)3428 SWIGINTERN CPLErr GDALMDArrayHS_SetOffset(GDALMDArrayHS *self,double val,GDALDataType storageType=GDT_Unknown){
3429     return GDALMDArraySetOffsetEx( self, val, storageType ) ? CE_None : CE_Failure;
3430   }
GDALMDArrayHS_SetScale(GDALMDArrayHS * self,double val,GDALDataType storageType=GDT_Unknown)3431 SWIGINTERN CPLErr GDALMDArrayHS_SetScale(GDALMDArrayHS *self,double val,GDALDataType storageType=GDT_Unknown){
3432     return GDALMDArraySetScaleEx( self, val, storageType ) ? CE_None : CE_Failure;
3433   }
GDALMDArrayHS_SetUnit(GDALMDArrayHS * self,char const * unit)3434 SWIGINTERN CPLErr GDALMDArrayHS_SetUnit(GDALMDArrayHS *self,char const *unit){
3435     return GDALMDArraySetUnit(self, unit) ? CE_None : CE_Failure;
3436   }
GDALMDArrayHS_GetUnit(GDALMDArrayHS * self)3437 SWIGINTERN char const *GDALMDArrayHS_GetUnit(GDALMDArrayHS *self){
3438     return GDALMDArrayGetUnit(self);
3439   }
GDALMDArrayHS_SetSpatialRef(GDALMDArrayHS * self,OSRSpatialReferenceShadow * srs)3440 SWIGINTERN OGRErr GDALMDArrayHS_SetSpatialRef(GDALMDArrayHS *self,OSRSpatialReferenceShadow *srs){
3441      return GDALMDArraySetSpatialRef( self, (OGRSpatialReferenceH)srs ) ? CE_None : CE_Failure;
3442   }
GDALMDArrayHS_GetSpatialRef(GDALMDArrayHS * self)3443 SWIGINTERN OSRSpatialReferenceShadow *GDALMDArrayHS_GetSpatialRef(GDALMDArrayHS *self){
3444     return GDALMDArrayGetSpatialRef(self);
3445   }
GDALMDArrayHS_GetView(GDALMDArrayHS * self,char const * viewExpr)3446 SWIGINTERN GDALMDArrayHS *GDALMDArrayHS_GetView(GDALMDArrayHS *self,char const *viewExpr){
3447     return GDALMDArrayGetView(self, viewExpr);
3448   }
GDALMDArrayHS_Transpose(GDALMDArrayHS * self,int nList,int * pList)3449 SWIGINTERN GDALMDArrayHS *GDALMDArrayHS_Transpose(GDALMDArrayHS *self,int nList,int *pList){
3450     return GDALMDArrayTranspose(self, nList, pList);
3451   }
GDALMDArrayHS_GetUnscaled(GDALMDArrayHS * self)3452 SWIGINTERN GDALMDArrayHS *GDALMDArrayHS_GetUnscaled(GDALMDArrayHS *self){
3453     return GDALMDArrayGetUnscaled(self);
3454   }
GDALMDArrayHS_GetMask(GDALMDArrayHS * self,char ** options=0)3455 SWIGINTERN GDALMDArrayHS *GDALMDArrayHS_GetMask(GDALMDArrayHS *self,char **options=0){
3456     return GDALMDArrayGetMask(self, options);
3457   }
GDALMDArrayHS_AsClassicDataset(GDALMDArrayHS * self,size_t iXDim,size_t iYDim)3458 SWIGINTERN GDALDatasetShadow *GDALMDArrayHS_AsClassicDataset(GDALMDArrayHS *self,size_t iXDim,size_t iYDim){
3459     return (GDALDatasetShadow*)GDALMDArrayAsClassicDataset(self, iXDim, iYDim);
3460   }
3461 
3462 SWIGINTERN int
SWIG_PERL_DECL_ARGS_2(SV * obj,bool * val)3463 SWIG_AsVal_bool SWIG_PERL_DECL_ARGS_2(SV *obj, bool* val)
3464 {
3465   if (obj == &PL_sv_yes) {
3466     if (val) *val = true;
3467     return SWIG_OK;
3468   } else if (obj == &PL_sv_no) {
3469     if (val) *val = false;
3470     return SWIG_OK;
3471   } else {
3472     if (val) *val = SvTRUE(obj) ? true : false;
3473     return SWIG_AddCast(SWIG_OK);
3474   }
3475 }
3476 
GDALMDArrayHS_GetStatistics(GDALMDArrayHS * self,GDALDatasetShadow * ds=NULL,bool approx_ok=FALSE,bool force=TRUE,GDALProgressFunc callback=NULL,void * callback_data=NULL)3477 SWIGINTERN Statistics *GDALMDArrayHS_GetStatistics(GDALMDArrayHS *self,GDALDatasetShadow *ds=NULL,bool approx_ok=FALSE,bool force=TRUE,GDALProgressFunc callback=NULL,void *callback_data=NULL){
3478         GUInt64 nValidCount = 0;
3479         Statistics* psStatisticsOut = (Statistics*)CPLMalloc(sizeof(Statistics));
3480         CPLErr eErr = GDALMDArrayGetStatistics(self, ds, approx_ok, force,
3481                                  &(psStatisticsOut->min),
3482                                  &(psStatisticsOut->max),
3483                                  &(psStatisticsOut->mean),
3484                                  &(psStatisticsOut->std_dev),
3485                                  &nValidCount,
3486                                  callback, callback_data);
3487         psStatisticsOut->valid_count = static_cast<GIntBig>(nValidCount);
3488         if( eErr == CE_None )
3489             return psStatisticsOut;
3490         CPLFree(psStatisticsOut);
3491         return NULL;
3492   }
GDALMDArrayHS_ComputeStatistics(GDALMDArrayHS * self,GDALDatasetShadow * ds=NULL,bool approx_ok=FALSE,GDALProgressFunc callback=NULL,void * callback_data=NULL)3493 SWIGINTERN Statistics *GDALMDArrayHS_ComputeStatistics(GDALMDArrayHS *self,GDALDatasetShadow *ds=NULL,bool approx_ok=FALSE,GDALProgressFunc callback=NULL,void *callback_data=NULL){
3494         GUInt64 nValidCount = 0;
3495         Statistics* psStatisticsOut = (Statistics*)CPLMalloc(sizeof(Statistics));
3496         int nSuccess = GDALMDArrayComputeStatistics(self, ds, approx_ok,
3497                                  &(psStatisticsOut->min),
3498                                  &(psStatisticsOut->max),
3499                                  &(psStatisticsOut->mean),
3500                                  &(psStatisticsOut->std_dev),
3501                                  &nValidCount,
3502                                  callback, callback_data);
3503         psStatisticsOut->valid_count = static_cast<GIntBig>(nValidCount);
3504         if( nSuccess )
3505             return psStatisticsOut;
3506         CPLFree(psStatisticsOut);
3507         return NULL;
3508   }
delete_GDALAttributeHS(GDALAttributeHS * self)3509 SWIGINTERN void delete_GDALAttributeHS(GDALAttributeHS *self){
3510     GDALAttributeRelease(self);
3511   }
GDALAttributeHS_GetName(GDALAttributeHS * self)3512 SWIGINTERN char const *GDALAttributeHS_GetName(GDALAttributeHS *self){
3513     return GDALAttributeGetName(self);
3514   }
GDALAttributeHS_GetFullName(GDALAttributeHS * self)3515 SWIGINTERN char const *GDALAttributeHS_GetFullName(GDALAttributeHS *self){
3516     return GDALAttributeGetFullName(self);
3517   }
GDALAttributeHS_GetTotalElementsCount(GDALAttributeHS * self)3518 SWIGINTERN unsigned long long GDALAttributeHS_GetTotalElementsCount(GDALAttributeHS *self){
3519     return GDALAttributeGetTotalElementsCount(self);
3520   }
GDALAttributeHS_GetDimensionCount(GDALAttributeHS * self)3521 SWIGINTERN size_t GDALAttributeHS_GetDimensionCount(GDALAttributeHS *self){
3522     return GDALAttributeGetDimensionCount(self);
3523   }
GDALAttributeHS_GetDataType(GDALAttributeHS * self)3524 SWIGINTERN GDALExtendedDataTypeHS *GDALAttributeHS_GetDataType(GDALAttributeHS *self){
3525     return GDALAttributeGetDataType(self);
3526   }
GDALAttributeHS_ReadAsString(GDALAttributeHS * self)3527 SWIGINTERN char const *GDALAttributeHS_ReadAsString(GDALAttributeHS *self){
3528     return GDALAttributeReadAsString(self);
3529   }
GDALAttributeHS_ReadAsInt(GDALAttributeHS * self)3530 SWIGINTERN int GDALAttributeHS_ReadAsInt(GDALAttributeHS *self){
3531     return GDALAttributeReadAsInt(self);
3532   }
GDALAttributeHS_ReadAsDouble(GDALAttributeHS * self)3533 SWIGINTERN double GDALAttributeHS_ReadAsDouble(GDALAttributeHS *self){
3534     return GDALAttributeReadAsDouble(self);
3535   }
GDALAttributeHS_ReadAsStringArray(GDALAttributeHS * self)3536 SWIGINTERN char **GDALAttributeHS_ReadAsStringArray(GDALAttributeHS *self){
3537     return GDALAttributeReadAsStringArray(self);
3538   }
GDALAttributeHS_WriteString(GDALAttributeHS * self,char const * val)3539 SWIGINTERN CPLErr GDALAttributeHS_WriteString(GDALAttributeHS *self,char const *val){
3540     return GDALAttributeWriteString(self, val) ? CE_None : CE_Failure;
3541   }
GDALAttributeHS_WriteStringArray(GDALAttributeHS * self,char ** vals)3542 SWIGINTERN CPLErr GDALAttributeHS_WriteStringArray(GDALAttributeHS *self,char **vals){
3543     return GDALAttributeWriteStringArray(self, vals) ? CE_None : CE_Failure;
3544   }
GDALAttributeHS_WriteInt(GDALAttributeHS * self,int val)3545 SWIGINTERN CPLErr GDALAttributeHS_WriteInt(GDALAttributeHS *self,int val){
3546     return GDALAttributeWriteInt(self, val) ? CE_None : CE_Failure;
3547   }
GDALAttributeHS_WriteDouble(GDALAttributeHS * self,double val)3548 SWIGINTERN CPLErr GDALAttributeHS_WriteDouble(GDALAttributeHS *self,double val){
3549     return GDALAttributeWriteDouble(self, val) ? CE_None : CE_Failure;
3550   }
delete_GDALDimensionHS(GDALDimensionHS * self)3551 SWIGINTERN void delete_GDALDimensionHS(GDALDimensionHS *self){
3552     GDALDimensionRelease(self);
3553   }
GDALDimensionHS_GetName(GDALDimensionHS * self)3554 SWIGINTERN char const *GDALDimensionHS_GetName(GDALDimensionHS *self){
3555     return GDALDimensionGetName(self);
3556   }
GDALDimensionHS_GetFullName(GDALDimensionHS * self)3557 SWIGINTERN char const *GDALDimensionHS_GetFullName(GDALDimensionHS *self){
3558     return GDALDimensionGetFullName(self);
3559   }
GDALDimensionHS_GetType(GDALDimensionHS * self)3560 SWIGINTERN char const *GDALDimensionHS_GetType(GDALDimensionHS *self){
3561     return GDALDimensionGetType(self);
3562   }
GDALDimensionHS_GetDirection(GDALDimensionHS * self)3563 SWIGINTERN char const *GDALDimensionHS_GetDirection(GDALDimensionHS *self){
3564     return GDALDimensionGetDirection(self);
3565   }
GDALDimensionHS_GetSize(GDALDimensionHS * self)3566 SWIGINTERN unsigned long long GDALDimensionHS_GetSize(GDALDimensionHS *self){
3567     return GDALDimensionGetSize(self);
3568   }
GDALDimensionHS_GetIndexingVariable(GDALDimensionHS * self)3569 SWIGINTERN GDALMDArrayHS *GDALDimensionHS_GetIndexingVariable(GDALDimensionHS *self){
3570     return GDALDimensionGetIndexingVariable(self);
3571   }
GDALDimensionHS_SetIndexingVariable(GDALDimensionHS * self,GDALMDArrayHS * array)3572 SWIGINTERN bool GDALDimensionHS_SetIndexingVariable(GDALDimensionHS *self,GDALMDArrayHS *array){
3573     return GDALDimensionSetIndexingVariable(self, array);
3574   }
delete_GDALExtendedDataTypeHS(GDALExtendedDataTypeHS * self)3575 SWIGINTERN void delete_GDALExtendedDataTypeHS(GDALExtendedDataTypeHS *self){
3576     GDALExtendedDataTypeRelease(self);
3577   }
GDALExtendedDataTypeHS_Create(GDALDataType dt)3578 SWIGINTERN GDALExtendedDataTypeHS *GDALExtendedDataTypeHS_Create(GDALDataType dt){
3579     return GDALExtendedDataTypeCreate(dt);
3580   }
GDALExtendedDataTypeHS_CreateString(size_t nMaxStringLength=0)3581 SWIGINTERN GDALExtendedDataTypeHS *GDALExtendedDataTypeHS_CreateString(size_t nMaxStringLength=0){
3582     return GDALExtendedDataTypeCreateString(nMaxStringLength);
3583   }
GDALExtendedDataTypeHS_GetName(GDALExtendedDataTypeHS * self)3584 SWIGINTERN char const *GDALExtendedDataTypeHS_GetName(GDALExtendedDataTypeHS *self){
3585     return GDALExtendedDataTypeGetName(self);
3586   }
GDALExtendedDataTypeHS_GetClass(GDALExtendedDataTypeHS * self)3587 SWIGINTERN GDALExtendedDataTypeClass GDALExtendedDataTypeHS_GetClass(GDALExtendedDataTypeHS *self){
3588     return GDALExtendedDataTypeGetClass(self);
3589   }
GDALExtendedDataTypeHS_GetNumericDataType(GDALExtendedDataTypeHS * self)3590 SWIGINTERN GDALDataType GDALExtendedDataTypeHS_GetNumericDataType(GDALExtendedDataTypeHS *self){
3591     return GDALExtendedDataTypeGetNumericDataType(self);
3592   }
GDALExtendedDataTypeHS_GetSize(GDALExtendedDataTypeHS * self)3593 SWIGINTERN size_t GDALExtendedDataTypeHS_GetSize(GDALExtendedDataTypeHS *self){
3594     return GDALExtendedDataTypeGetSize(self);
3595   }
GDALExtendedDataTypeHS_GetMaxStringLength(GDALExtendedDataTypeHS * self)3596 SWIGINTERN size_t GDALExtendedDataTypeHS_GetMaxStringLength(GDALExtendedDataTypeHS *self){
3597     return GDALExtendedDataTypeGetMaxStringLength(self);
3598   }
GDALExtendedDataTypeHS_CanConvertTo(GDALExtendedDataTypeHS * self,GDALExtendedDataTypeHS * other)3599 SWIGINTERN bool GDALExtendedDataTypeHS_CanConvertTo(GDALExtendedDataTypeHS *self,GDALExtendedDataTypeHS *other){
3600     return GDALExtendedDataTypeCanConvertTo(self, other);
3601   }
GDALExtendedDataTypeHS_Equals(GDALExtendedDataTypeHS * self,GDALExtendedDataTypeHS * other)3602 SWIGINTERN bool GDALExtendedDataTypeHS_Equals(GDALExtendedDataTypeHS *self,GDALExtendedDataTypeHS *other){
3603     return GDALExtendedDataTypeEquals(self, other);
3604   }
delete_GDALEDTComponentHS(GDALEDTComponentHS * self)3605 SWIGINTERN void delete_GDALEDTComponentHS(GDALEDTComponentHS *self){
3606     GDALEDTComponentRelease(self);
3607   }
GDALEDTComponentHS_Create(char const * name,size_t offset,GDALExtendedDataTypeHS * type)3608 SWIGINTERN GDALEDTComponentHS *GDALEDTComponentHS_Create(char const *name,size_t offset,GDALExtendedDataTypeHS *type){
3609     return GDALEDTComponentCreate(name, offset, type);
3610   }
GDALEDTComponentHS_GetName(GDALEDTComponentHS * self)3611 SWIGINTERN char const *GDALEDTComponentHS_GetName(GDALEDTComponentHS *self){
3612     return GDALEDTComponentGetName(self);
3613   }
GDALEDTComponentHS_GetOffset(GDALEDTComponentHS * self)3614 SWIGINTERN size_t GDALEDTComponentHS_GetOffset(GDALEDTComponentHS *self){
3615     return GDALEDTComponentGetOffset(self);
3616   }
GDALEDTComponentHS_GetType(GDALEDTComponentHS * self)3617 SWIGINTERN GDALExtendedDataTypeHS *GDALEDTComponentHS_GetType(GDALEDTComponentHS *self){
3618     return GDALEDTComponentGetType(self);
3619   }
3620 
3621 /* Returned size is in bytes or 0 if an error occurred. */
3622 static
ComputeBandRasterIOSize(int buf_xsize,int buf_ysize,int nPixelSize,GIntBig nPixelSpace,GIntBig nLineSpace,int bSpacingShouldBeMultipleOfPixelSize)3623 GIntBig ComputeBandRasterIOSize (int buf_xsize, int buf_ysize, int nPixelSize,
3624                                  GIntBig nPixelSpace, GIntBig nLineSpace,
3625                                  int bSpacingShouldBeMultipleOfPixelSize )
3626 {
3627     if (buf_xsize <= 0 || buf_ysize <= 0)
3628     {
3629         CPLError(CE_Failure, CPLE_IllegalArg, "Illegal values for buffer size");
3630         return 0;
3631     }
3632 
3633     if (nPixelSpace < 0 || nLineSpace < 0)
3634     {
3635         CPLError(CE_Failure, CPLE_IllegalArg, "Illegal values for space arguments");
3636         return 0;
3637     }
3638 
3639     if (nPixelSize == 0)
3640     {
3641         CPLError(CE_Failure, CPLE_IllegalArg, "Illegal value for data type");
3642         return 0;
3643     }
3644 
3645     if( nPixelSpace == 0 )
3646         nPixelSpace = nPixelSize;
3647     else if ( bSpacingShouldBeMultipleOfPixelSize && (nPixelSpace % nPixelSize) != 0 )
3648     {
3649         CPLError(CE_Failure, CPLE_IllegalArg, "nPixelSpace should be a multiple of nPixelSize");
3650         return 0;
3651     }
3652 
3653     if( nLineSpace == 0 )
3654     {
3655         nLineSpace = nPixelSpace * buf_xsize;
3656     }
3657     else if ( bSpacingShouldBeMultipleOfPixelSize && (nLineSpace % nPixelSize) != 0 )
3658     {
3659         CPLError(CE_Failure, CPLE_IllegalArg, "nLineSpace should be a multiple of nPixelSize");
3660         return 0;
3661     }
3662 
3663     GIntBig nRet = (GIntBig)(buf_ysize - 1) * nLineSpace + (GIntBig)(buf_xsize - 1) * nPixelSpace + nPixelSize;
3664 #if SIZEOF_VOIDP == 4
3665     if (nRet > INT_MAX)
3666     {
3667         CPLError(CE_Failure, CPLE_IllegalArg, "Integer overflow");
3668         return 0;
3669     }
3670 #endif
3671 
3672     return nRet;
3673 }
3674 
3675 
3676 static
ReadRaster_internal(GDALRasterBandShadow * obj,int xoff,int yoff,int xsize,int ysize,int buf_xsize,int buf_ysize,GDALDataType buf_type,GIntBig * buf_size,char ** buf,GIntBig pixel_space,GIntBig line_space,GDALRasterIOExtraArg * psExtraArg)3677 CPLErr ReadRaster_internal( GDALRasterBandShadow *obj,
3678                             int xoff, int yoff, int xsize, int ysize,
3679                             int buf_xsize, int buf_ysize,
3680                             GDALDataType buf_type,
3681                             GIntBig *buf_size, char **buf,
3682                             GIntBig pixel_space, GIntBig line_space,
3683                             GDALRasterIOExtraArg* psExtraArg )
3684 {
3685   CPLErr result;
3686 
3687   *buf_size = ComputeBandRasterIOSize( buf_xsize, buf_ysize, GDALGetDataTypeSize( buf_type ) / 8,
3688                                        pixel_space, line_space, FALSE );
3689 
3690   if ( *buf_size == 0 )
3691   {
3692       *buf = 0;
3693       return CE_Failure;
3694   }
3695 
3696   *buf = (char*) malloc( *buf_size );
3697   if ( *buf )
3698   {
3699     result =  GDALRasterIOEx( obj, GF_Read, xoff, yoff, xsize, ysize,
3700                                     (void *) *buf, buf_xsize, buf_ysize,
3701                                     buf_type, pixel_space, line_space, psExtraArg );
3702     if ( result != CE_None )
3703     {
3704         free( *buf );
3705         *buf = 0;
3706         *buf_size = 0;
3707     }
3708   }
3709   else
3710   {
3711     CPLError(CE_Failure, CPLE_OutOfMemory, "Not enough memory to allocate " CPL_FRMT_GIB " bytes", *buf_size);
3712     result = CE_Failure;
3713     *buf = 0;
3714     *buf_size = 0;
3715   }
3716 
3717   return result;
3718 }
3719 
3720 
3721 static
WriteRaster_internal(GDALRasterBandShadow * obj,int xoff,int yoff,int xsize,int ysize,int buf_xsize,int buf_ysize,GDALDataType buf_type,GIntBig buf_size,char * buffer,GIntBig pixel_space,GIntBig line_space,GDALRasterIOExtraArg * psExtraArg)3722 CPLErr WriteRaster_internal( GDALRasterBandShadow *obj,
3723                              int xoff, int yoff, int xsize, int ysize,
3724                              int buf_xsize, int buf_ysize,
3725                              GDALDataType buf_type,
3726                              GIntBig buf_size, char *buffer,
3727                              GIntBig pixel_space, GIntBig line_space,
3728                              GDALRasterIOExtraArg* psExtraArg )
3729 {
3730     GIntBig min_buffer_size = ComputeBandRasterIOSize (buf_xsize, buf_ysize, GDALGetDataTypeSize( buf_type ) / 8,
3731                                                    pixel_space, line_space, FALSE );
3732     if ( min_buffer_size == 0 )
3733       return CE_Failure;
3734 
3735     if ( buf_size < min_buffer_size ) {
3736       CPLError(CE_Failure, CPLE_AppDefined, "Buffer too small");
3737       return CE_Failure;
3738     }
3739 
3740     return GDALRasterIOEx( obj, GF_Write, xoff, yoff, xsize, ysize,
3741                            (void *) buffer, buf_xsize, buf_ysize, buf_type, pixel_space, line_space, psExtraArg );
3742 }
3743 
GDALRasterBandShadow_GetDataset(GDALRasterBandShadow * self)3744 SWIGINTERN GDALDatasetShadow *GDALRasterBandShadow_GetDataset(GDALRasterBandShadow *self){
3745     return (GDALDatasetShadow*) GDALGetBandDataset(self);
3746   }
GDALRasterBandShadow_GetBand(GDALRasterBandShadow * self)3747 SWIGINTERN int GDALRasterBandShadow_GetBand(GDALRasterBandShadow *self){
3748     return GDALGetBandNumber(self);
3749   }
GDALRasterBandShadow_GetBlockSize(GDALRasterBandShadow * self,int * pnBlockXSize,int * pnBlockYSize)3750 SWIGINTERN void GDALRasterBandShadow_GetBlockSize(GDALRasterBandShadow *self,int *pnBlockXSize,int *pnBlockYSize){
3751       GDALGetBlockSize(self, pnBlockXSize, pnBlockYSize);
3752   }
GDALRasterBandShadow_GetColorInterpretation(GDALRasterBandShadow * self)3753 SWIGINTERN GDALColorInterp GDALRasterBandShadow_GetColorInterpretation(GDALRasterBandShadow *self){
3754     return GDALGetRasterColorInterpretation(self);
3755   }
GDALRasterBandShadow_GetRasterColorInterpretation(GDALRasterBandShadow * self)3756 SWIGINTERN GDALColorInterp GDALRasterBandShadow_GetRasterColorInterpretation(GDALRasterBandShadow *self){
3757     return GDALGetRasterColorInterpretation(self);
3758   }
GDALRasterBandShadow_SetColorInterpretation(GDALRasterBandShadow * self,GDALColorInterp val)3759 SWIGINTERN CPLErr GDALRasterBandShadow_SetColorInterpretation(GDALRasterBandShadow *self,GDALColorInterp val){
3760     return GDALSetRasterColorInterpretation( self, val );
3761   }
GDALRasterBandShadow_SetRasterColorInterpretation(GDALRasterBandShadow * self,GDALColorInterp val)3762 SWIGINTERN CPLErr GDALRasterBandShadow_SetRasterColorInterpretation(GDALRasterBandShadow *self,GDALColorInterp val){
3763     return GDALSetRasterColorInterpretation( self, val );
3764   }
GDALRasterBandShadow_GetNoDataValue(GDALRasterBandShadow * self,double * val,int * hasval)3765 SWIGINTERN void GDALRasterBandShadow_GetNoDataValue(GDALRasterBandShadow *self,double *val,int *hasval){
3766     *val = GDALGetRasterNoDataValue( self, hasval );
3767   }
GDALRasterBandShadow_SetNoDataValue(GDALRasterBandShadow * self,double d)3768 SWIGINTERN CPLErr GDALRasterBandShadow_SetNoDataValue(GDALRasterBandShadow *self,double d){
3769     return GDALSetRasterNoDataValue( self, d );
3770   }
GDALRasterBandShadow_DeleteNoDataValue(GDALRasterBandShadow * self)3771 SWIGINTERN CPLErr GDALRasterBandShadow_DeleteNoDataValue(GDALRasterBandShadow *self){
3772     return GDALDeleteRasterNoDataValue(self);
3773   }
GDALRasterBandShadow_GetUnitType(GDALRasterBandShadow * self)3774 SWIGINTERN char const *GDALRasterBandShadow_GetUnitType(GDALRasterBandShadow *self){
3775       return GDALGetRasterUnitType(self);
3776   }
GDALRasterBandShadow_SetUnitType(GDALRasterBandShadow * self,char const * val)3777 SWIGINTERN CPLErr GDALRasterBandShadow_SetUnitType(GDALRasterBandShadow *self,char const *val){
3778     return GDALSetRasterUnitType( self, val );
3779   }
GDALRasterBandShadow_GetRasterCategoryNames(GDALRasterBandShadow * self)3780 SWIGINTERN char **GDALRasterBandShadow_GetRasterCategoryNames(GDALRasterBandShadow *self){
3781     return GDALGetRasterCategoryNames(self);
3782   }
GDALRasterBandShadow_SetRasterCategoryNames(GDALRasterBandShadow * self,char ** names)3783 SWIGINTERN CPLErr GDALRasterBandShadow_SetRasterCategoryNames(GDALRasterBandShadow *self,char **names){
3784     return GDALSetRasterCategoryNames( self, names );
3785   }
GDALRasterBandShadow_GetMinimum(GDALRasterBandShadow * self,double * val,int * hasval)3786 SWIGINTERN void GDALRasterBandShadow_GetMinimum(GDALRasterBandShadow *self,double *val,int *hasval){
3787     *val = GDALGetRasterMinimum( self, hasval );
3788   }
GDALRasterBandShadow_GetMaximum(GDALRasterBandShadow * self,double * val,int * hasval)3789 SWIGINTERN void GDALRasterBandShadow_GetMaximum(GDALRasterBandShadow *self,double *val,int *hasval){
3790     *val = GDALGetRasterMaximum( self, hasval );
3791   }
GDALRasterBandShadow_GetOffset(GDALRasterBandShadow * self,double * val,int * hasval)3792 SWIGINTERN void GDALRasterBandShadow_GetOffset(GDALRasterBandShadow *self,double *val,int *hasval){
3793     *val = GDALGetRasterOffset( self, hasval );
3794   }
GDALRasterBandShadow_GetScale(GDALRasterBandShadow * self,double * val,int * hasval)3795 SWIGINTERN void GDALRasterBandShadow_GetScale(GDALRasterBandShadow *self,double *val,int *hasval){
3796     *val = GDALGetRasterScale( self, hasval );
3797   }
GDALRasterBandShadow_SetOffset(GDALRasterBandShadow * self,double val)3798 SWIGINTERN CPLErr GDALRasterBandShadow_SetOffset(GDALRasterBandShadow *self,double val){
3799     return GDALSetRasterOffset( self, val );
3800   }
GDALRasterBandShadow_SetScale(GDALRasterBandShadow * self,double val)3801 SWIGINTERN CPLErr GDALRasterBandShadow_SetScale(GDALRasterBandShadow *self,double val){
3802     return GDALSetRasterScale( self, val );
3803   }
GDALRasterBandShadow_GetStatistics(GDALRasterBandShadow * self,int approx_ok,int force,double * min,double * max,double * mean,double * stddev)3804 SWIGINTERN CPLErr GDALRasterBandShadow_GetStatistics(GDALRasterBandShadow *self,int approx_ok,int force,double *min,double *max,double *mean,double *stddev){
3805     if (min) *min = 0;
3806     if (max) *max = 0;
3807     if (mean) *mean = 0;
3808     if (stddev) *stddev = -1; /* This is the only way to recognize from Python if GetRasterStatistics() has updated the values */
3809     return GDALGetRasterStatistics( self, approx_ok, force,
3810 				    min, max, mean, stddev );
3811   }
GDALRasterBandShadow_ComputeStatistics(GDALRasterBandShadow * self,bool approx_ok,double * min=NULL,double * max=NULL,double * mean=NULL,double * stddev=NULL,GDALProgressFunc callback=NULL,void * callback_data=NULL)3812 SWIGINTERN CPLErr GDALRasterBandShadow_ComputeStatistics(GDALRasterBandShadow *self,bool approx_ok,double *min=NULL,double *max=NULL,double *mean=NULL,double *stddev=NULL,GDALProgressFunc callback=NULL,void *callback_data=NULL){
3813     return GDALComputeRasterStatistics( self, approx_ok, min, max, mean, stddev, callback, callback_data );
3814   }
GDALRasterBandShadow_SetStatistics(GDALRasterBandShadow * self,double min,double max,double mean,double stddev)3815 SWIGINTERN CPLErr GDALRasterBandShadow_SetStatistics(GDALRasterBandShadow *self,double min,double max,double mean,double stddev){
3816     return GDALSetRasterStatistics( self, min, max, mean, stddev );
3817   }
GDALRasterBandShadow_GetOverviewCount(GDALRasterBandShadow * self)3818 SWIGINTERN int GDALRasterBandShadow_GetOverviewCount(GDALRasterBandShadow *self){
3819     return GDALGetOverviewCount(self);
3820   }
GDALRasterBandShadow_GetOverview(GDALRasterBandShadow * self,int i)3821 SWIGINTERN GDALRasterBandShadow *GDALRasterBandShadow_GetOverview(GDALRasterBandShadow *self,int i){
3822     return (GDALRasterBandShadow*) GDALGetOverview( self, i );
3823   }
GDALRasterBandShadow_Checksum(GDALRasterBandShadow * self,int xoff=0,int yoff=0,int * xsize=0,int * ysize=0)3824 SWIGINTERN int GDALRasterBandShadow_Checksum(GDALRasterBandShadow *self,int xoff=0,int yoff=0,int *xsize=0,int *ysize=0){
3825     int nxsize = (xsize!=0) ? *xsize : GDALGetRasterBandXSize( self );
3826     int nysize = (ysize!=0) ? *ysize : GDALGetRasterBandYSize( self );
3827     return GDALChecksumImage( self, xoff, yoff, nxsize, nysize );
3828   }
GDALRasterBandShadow_ComputeRasterMinMax(GDALRasterBandShadow * self,double argout[2],int approx_ok=0)3829 SWIGINTERN void GDALRasterBandShadow_ComputeRasterMinMax(GDALRasterBandShadow *self,double argout[2],int approx_ok=0){
3830     GDALComputeRasterMinMax( self, approx_ok, argout );
3831   }
GDALRasterBandShadow_ComputeBandStats(GDALRasterBandShadow * self,double argout[2],int samplestep=1)3832 SWIGINTERN void GDALRasterBandShadow_ComputeBandStats(GDALRasterBandShadow *self,double argout[2],int samplestep=1){
3833     GDALComputeBandStats( self, samplestep, argout+0, argout+1,
3834                           NULL, NULL );
3835   }
GDALRasterBandShadow_Fill(GDALRasterBandShadow * self,double real_fill,double imag_fill=0.0)3836 SWIGINTERN CPLErr GDALRasterBandShadow_Fill(GDALRasterBandShadow *self,double real_fill,double imag_fill=0.0){
3837     return GDALFillRaster( self, real_fill, imag_fill );
3838   }
GDALRasterBandShadow_ReadRaster(GDALRasterBandShadow * self,int xoff,int yoff,int xsize,int ysize,GIntBig * buf_len,char ** buf,int * buf_xsize=0,int * buf_ysize=0,int * buf_type=0,GIntBig * buf_pixel_space=0,GIntBig * buf_line_space=0,GDALRIOResampleAlg resample_alg=GRIORA_NearestNeighbour,GDALProgressFunc callback=NULL,void * callback_data=NULL)3839 SWIGINTERN CPLErr GDALRasterBandShadow_ReadRaster(GDALRasterBandShadow *self,int xoff,int yoff,int xsize,int ysize,GIntBig *buf_len,char **buf,int *buf_xsize=0,int *buf_ysize=0,int *buf_type=0,GIntBig *buf_pixel_space=0,GIntBig *buf_line_space=0,GDALRIOResampleAlg resample_alg=GRIORA_NearestNeighbour,GDALProgressFunc callback=NULL,void *callback_data=NULL){
3840     int nxsize = (buf_xsize==0) ? xsize : *buf_xsize;
3841     int nysize = (buf_ysize==0) ? ysize : *buf_ysize;
3842     GDALDataType ntype  = (buf_type==0) ? GDALGetRasterDataType(self)
3843                                         : (GDALDataType)*buf_type;
3844     GIntBig pixel_space = (buf_pixel_space == 0) ? 0 : *buf_pixel_space;
3845     GIntBig line_space = (buf_line_space == 0) ? 0 : *buf_line_space;
3846 
3847     GDALRasterIOExtraArg sExtraArg;
3848     INIT_RASTERIO_EXTRA_ARG(sExtraArg);
3849     sExtraArg.eResampleAlg = resample_alg;
3850     sExtraArg.pfnProgress = callback;
3851     sExtraArg.pProgressData = callback_data;
3852 
3853     return ReadRaster_internal( self, xoff, yoff, xsize, ysize,
3854                                 nxsize, nysize, ntype, buf_len, buf, pixel_space, line_space,
3855                                 &sExtraArg );
3856   }
GDALRasterBandShadow_WriteRaster(GDALRasterBandShadow * self,int xoff,int yoff,int xsize,int ysize,GIntBig buf_len,char * buf_string,int * buf_xsize=0,int * buf_ysize=0,GDALDataType * buf_type=0,GIntBig * buf_pixel_space=0,GIntBig * buf_line_space=0)3857 SWIGINTERN CPLErr GDALRasterBandShadow_WriteRaster(GDALRasterBandShadow *self,int xoff,int yoff,int xsize,int ysize,GIntBig buf_len,char *buf_string,int *buf_xsize=0,int *buf_ysize=0,GDALDataType *buf_type=0,GIntBig *buf_pixel_space=0,GIntBig *buf_line_space=0){
3858     int nxsize = (buf_xsize==0) ? xsize : *buf_xsize;
3859     int nysize = (buf_ysize==0) ? ysize : *buf_ysize;
3860     GDALDataType ntype  = (buf_type==0) ? GDALGetRasterDataType(self)
3861                                         : *buf_type;
3862     GIntBig pixel_space = (buf_pixel_space == 0) ? 0 : *buf_pixel_space;
3863     GIntBig line_space = (buf_line_space == 0) ? 0 : *buf_line_space;
3864     GDALRasterIOExtraArg* psExtraArg = NULL;
3865     return WriteRaster_internal( self, xoff, yoff, xsize, ysize,
3866                                  nxsize, nysize, ntype, buf_len, buf_string, pixel_space, line_space, psExtraArg );
3867   }
GDALRasterBandShadow_FlushCache(GDALRasterBandShadow * self)3868 SWIGINTERN void GDALRasterBandShadow_FlushCache(GDALRasterBandShadow *self){
3869     GDALFlushRasterCache( self );
3870   }
GDALRasterBandShadow_GetRasterColorTable(GDALRasterBandShadow * self)3871 SWIGINTERN GDALColorTableShadow *GDALRasterBandShadow_GetRasterColorTable(GDALRasterBandShadow *self){
3872     return (GDALColorTableShadow*) GDALGetRasterColorTable( self );
3873   }
GDALRasterBandShadow_GetColorTable(GDALRasterBandShadow * self)3874 SWIGINTERN GDALColorTableShadow *GDALRasterBandShadow_GetColorTable(GDALRasterBandShadow *self){
3875     return (GDALColorTableShadow*) GDALGetRasterColorTable( self );
3876   }
GDALRasterBandShadow_SetRasterColorTable(GDALRasterBandShadow * self,GDALColorTableShadow * arg)3877 SWIGINTERN int GDALRasterBandShadow_SetRasterColorTable(GDALRasterBandShadow *self,GDALColorTableShadow *arg){
3878     return GDALSetRasterColorTable( self, arg );
3879   }
GDALRasterBandShadow_SetColorTable(GDALRasterBandShadow * self,GDALColorTableShadow * arg)3880 SWIGINTERN int GDALRasterBandShadow_SetColorTable(GDALRasterBandShadow *self,GDALColorTableShadow *arg){
3881     return GDALSetRasterColorTable( self, arg );
3882   }
GDALRasterBandShadow_GetDefaultRAT(GDALRasterBandShadow * self)3883 SWIGINTERN GDALRasterAttributeTableShadow *GDALRasterBandShadow_GetDefaultRAT(GDALRasterBandShadow *self){
3884       return (GDALRasterAttributeTableShadow*) GDALGetDefaultRAT(self);
3885   }
GDALRasterBandShadow_SetDefaultRAT(GDALRasterBandShadow * self,GDALRasterAttributeTableShadow * table)3886 SWIGINTERN int GDALRasterBandShadow_SetDefaultRAT(GDALRasterBandShadow *self,GDALRasterAttributeTableShadow *table){
3887       return GDALSetDefaultRAT(self, table);
3888   }
GDALRasterBandShadow_GetMaskBand(GDALRasterBandShadow * self)3889 SWIGINTERN GDALRasterBandShadow *GDALRasterBandShadow_GetMaskBand(GDALRasterBandShadow *self){
3890       return (GDALRasterBandShadow *) GDALGetMaskBand( self );
3891   }
GDALRasterBandShadow_GetMaskFlags(GDALRasterBandShadow * self)3892 SWIGINTERN int GDALRasterBandShadow_GetMaskFlags(GDALRasterBandShadow *self){
3893       return GDALGetMaskFlags( self );
3894   }
GDALRasterBandShadow_CreateMaskBand(GDALRasterBandShadow * self,int nFlags)3895 SWIGINTERN CPLErr GDALRasterBandShadow_CreateMaskBand(GDALRasterBandShadow *self,int nFlags){
3896       return GDALCreateMaskBand( self, nFlags );
3897   }
3898 
3899 #define LENGTH_OF_GUIntBig_AS_STRING 30
3900     static SV *
CreateArrayFromGUIntBigArray(GUIntBig * first,unsigned int size)3901         CreateArrayFromGUIntBigArray( GUIntBig *first, unsigned int size ) {
3902         AV *av = (AV*)sv_2mortal((SV*)newAV());
3903         for( unsigned int i=0; i<size; i++ ) {
3904             char s[LENGTH_OF_GUIntBig_AS_STRING];
3905             snprintf(s, LENGTH_OF_GUIntBig_AS_STRING-1, CPL_FRMT_GUIB, *first);
3906             av_store(av,i,newSVpv(s, 0));
3907             ++first;
3908         }
3909         return sv_2mortal(newRV((SV*)av));
3910     }
3911 
GDALRasterBandShadow_GetHistogram(GDALRasterBandShadow * self,double min=-0.5,double max=255.5,int buckets=256,GUIntBig * panHistogram=NULL,int include_out_of_range=0,int approx_ok=1,GDALProgressFunc callback=NULL,void * callback_data=NULL)3912 SWIGINTERN CPLErr GDALRasterBandShadow_GetHistogram(GDALRasterBandShadow *self,double min=-0.5,double max=255.5,int buckets=256,GUIntBig *panHistogram=NULL,int include_out_of_range=0,int approx_ok=1,GDALProgressFunc callback=NULL,void *callback_data=NULL){
3913     CPLErrorReset();
3914     CPLErr err = GDALGetRasterHistogramEx( self, min, max, buckets, panHistogram,
3915                                          include_out_of_range, approx_ok,
3916                                          callback, callback_data );
3917     return err;
3918   }
GDALRasterBandShadow_GetDefaultHistogram(GDALRasterBandShadow * self,double * min_ret=NULL,double * max_ret=NULL,int * buckets_ret=NULL,GUIntBig ** ppanHistogram=NULL,int force=1,GDALProgressFunc callback=NULL,void * callback_data=NULL)3919 SWIGINTERN CPLErr GDALRasterBandShadow_GetDefaultHistogram(GDALRasterBandShadow *self,double *min_ret=NULL,double *max_ret=NULL,int *buckets_ret=NULL,GUIntBig **ppanHistogram=NULL,int force=1,GDALProgressFunc callback=NULL,void *callback_data=NULL){
3920     return GDALGetDefaultHistogramEx( self, min_ret, max_ret, buckets_ret,
3921                                     ppanHistogram, force,
3922                                     callback, callback_data );
3923 }
GDALRasterBandShadow_SetDefaultHistogram(GDALRasterBandShadow * self,double min,double max,int buckets_in,GUIntBig * panHistogram_in)3924 SWIGINTERN CPLErr GDALRasterBandShadow_SetDefaultHistogram(GDALRasterBandShadow *self,double min,double max,int buckets_in,GUIntBig *panHistogram_in){
3925     return GDALSetDefaultHistogramEx( self, min, max,
3926                                     buckets_in, panHistogram_in );
3927 }
GDALRasterBandShadow_HasArbitraryOverviews(GDALRasterBandShadow * self)3928 SWIGINTERN bool GDALRasterBandShadow_HasArbitraryOverviews(GDALRasterBandShadow *self){
3929       return (GDALHasArbitraryOverviews( self ) != 0) ? true : false;
3930   }
GDALRasterBandShadow_GetCategoryNames(GDALRasterBandShadow * self)3931 SWIGINTERN char **GDALRasterBandShadow_GetCategoryNames(GDALRasterBandShadow *self){
3932     return GDALGetRasterCategoryNames( self );
3933   }
GDALRasterBandShadow_SetCategoryNames(GDALRasterBandShadow * self,char ** papszCategoryNames)3934 SWIGINTERN CPLErr GDALRasterBandShadow_SetCategoryNames(GDALRasterBandShadow *self,char **papszCategoryNames){
3935     return GDALSetRasterCategoryNames( self, papszCategoryNames );
3936   }
GDALRasterBandShadow_AdviseRead(GDALRasterBandShadow * self,int xoff,int yoff,int xsize,int ysize,int * buf_xsize=0,int * buf_ysize=0,GDALDataType * buf_type=0,char ** options=NULL)3937 SWIGINTERN CPLErr GDALRasterBandShadow_AdviseRead(GDALRasterBandShadow *self,int xoff,int yoff,int xsize,int ysize,int *buf_xsize=0,int *buf_ysize=0,GDALDataType *buf_type=0,char **options=NULL){
3938     int nxsize = (buf_xsize==0) ? xsize : *buf_xsize;
3939     int nysize = (buf_ysize==0) ? ysize : *buf_ysize;
3940     GDALDataType ntype;
3941     if ( buf_type != 0 ) {
3942       ntype = (GDALDataType) *buf_type;
3943     } else {
3944       ntype = GDALGetRasterDataType( self );
3945     }
3946     return GDALRasterAdviseRead(self, xoff, yoff, xsize, ysize,
3947                                 nxsize, nysize, ntype, options);
3948 }
GDALRasterBandShadow_AsMDArray(GDALRasterBandShadow * self)3949 SWIGINTERN GDALMDArrayHS *GDALRasterBandShadow_AsMDArray(GDALRasterBandShadow *self){
3950     return GDALRasterBandAsMDArray(self);
3951   }
GDALRasterBandShadow_ContourGenerate(GDALRasterBandShadow * self,double dfContourInterval,double dfContourBase,int nFixedLevelCount,double * padfFixedLevels,int bUseNoData,double dfNoDataValue,OGRLayerShadow * hLayer,int iIDField,int iElevField,GDALProgressFunc progress=NULL,void * progress_data=NULL)3952 SWIGINTERN CPLErr GDALRasterBandShadow_ContourGenerate(GDALRasterBandShadow *self,double dfContourInterval,double dfContourBase,int nFixedLevelCount,double *padfFixedLevels,int bUseNoData,double dfNoDataValue,OGRLayerShadow *hLayer,int iIDField,int iElevField,GDALProgressFunc progress=NULL,void *progress_data=NULL){
3953         return GDALContourGenerate( self, dfContourInterval, dfContourBase,
3954                                     nFixedLevelCount, padfFixedLevels,
3955                                     bUseNoData, dfNoDataValue,
3956                                     hLayer, iIDField, iElevField,
3957                                     progress,
3958                                     progress_data );
3959     }
GDALRasterBandShadow_ClassCounts__SWIG_0(GDALRasterBandShadow * self,GDALProgressFunc callback=NULL,void * callback_data=NULL)3960 SWIGINTERN SV *GDALRasterBandShadow_ClassCounts__SWIG_0(GDALRasterBandShadow *self,GDALProgressFunc callback=NULL,void *callback_data=NULL){
3961         GDALDataType dt = GDALGetRasterDataType(self);
3962         if (!(dt == GDT_Byte || dt == GDT_UInt16 || dt == GDT_Int16 || dt == GDT_UInt32 || dt == GDT_Int32)) {
3963             do_confess("ClassCounts without classifier requires an integer band.", 1);
3964         }
3965         HV* hash = newHV();
3966         int XBlockSize, YBlockSize;
3967         GDALGetBlockSize( self, &XBlockSize, &YBlockSize );
3968         int XBlocks = (GDALGetRasterBandXSize(self) + XBlockSize - 1) / XBlockSize;
3969         int YBlocks = (GDALGetRasterBandYSize(self) + YBlockSize - 1) / YBlockSize;
3970         void *data = CPLMalloc(XBlockSize * YBlockSize * GDALGetDataTypeSizeBytes(dt));
3971         for (int yb = 0; yb < YBlocks; ++yb) {
3972             if (callback) {
3973                 double p = (double)yb/(double)YBlocks;
3974                 if (!callback(p, "", callback_data)) {
3975                     CPLError(CE_Failure, CPLE_UserInterrupt, "User terminated");
3976                     hv_undef(hash);
3977                     hash = NULL;
3978                     break;
3979                 }
3980             }
3981             for (int xb = 0; xb < XBlocks; ++xb) {
3982                 int XValid, YValid;
3983                 CPLErr e = GDALReadBlock(self, xb, yb, data);
3984                 GDALGetActualBlockSize(self, xb, yb, &XValid, &YValid);
3985                 for (int iY = 0; iY < YValid; ++iY) {
3986                     for (int iX = 0; iX < XValid; ++iX) {
3987                         int32_t k;
3988                         switch(dt) {
3989                         case GDT_Byte:
3990                           k = ((GByte*)(data))[iX + iY * XBlockSize];
3991                           break;
3992                         case GDT_UInt16:
3993                           k = ((GUInt16*)(data))[iX + iY * XBlockSize];
3994                           break;
3995                         case GDT_Int16:
3996                           k = ((GInt16*)(data))[iX + iY * XBlockSize];
3997                           break;
3998                         case GDT_UInt32:
3999                           k = ((GUInt32*)(data))[iX + iY * XBlockSize];
4000                           break;
4001                         case GDT_Int32:
4002                           k = ((GInt32*)(data))[iX + iY * XBlockSize];
4003                           break;
4004                         }
4005                         char key[12];
4006                         int klen = sprintf(key, "%i", k);
4007                         SV* sv;
4008                         SV** sv2 = hv_fetch(hash, key, klen, 0);
4009                         if (sv2 && SvOK(*sv2)) {
4010                             sv = *sv2;
4011                             sv_setiv(sv, SvIV(sv)+1);
4012                             SvREFCNT_inc(sv);
4013                         } else {
4014                             sv = newSViv(1);
4015                         }
4016                         if (!hv_store(hash, key, klen, sv, 0))
4017                             SvREFCNT_dec(sv);
4018                     }
4019                 }
4020             }
4021         }
4022         CPLFree(data);
4023         if (hash)
4024             return newRV_noinc((SV*)hash);
4025         else
4026             return &PL_sv_undef;
4027     }
GDALRasterBandShadow_ClassCounts__SWIG_1(GDALRasterBandShadow * self,SV * classifier,GDALProgressFunc callback=NULL,void * callback_data=NULL)4028 SWIGINTERN SV *GDALRasterBandShadow_ClassCounts__SWIG_1(GDALRasterBandShadow *self,SV *classifier,GDALProgressFunc callback=NULL,void *callback_data=NULL){
4029 
4030         const char *error = NULL;
4031         GDALDataType dt = GDALGetRasterDataType(self);
4032         if (!(dt == GDT_Byte || dt == GDT_UInt16 || dt == GDT_Int16 || dt == GDT_UInt32 || dt == GDT_Int32 || dt == GDT_Float32 || dt == GDT_Float64)) {
4033             do_confess("ClassCounts with classifier requires an integer or real band.", 1);
4034         }
4035 
4036         AV* array_classifier = NULL;
4037         int comparison = 0;
4038 
4039         array_classifier = to_array_classifier(classifier, &comparison, &error);
4040         if (error) do_confess(error, 1);
4041 
4042         HV* hash = newHV();
4043         int has_no_data;
4044         double no_data = GDALGetRasterNoDataValue(self, &has_no_data);
4045         int XBlockSize, YBlockSize;
4046         GDALGetBlockSize( self, &XBlockSize, &YBlockSize );
4047         int XBlocks = (GDALGetRasterBandXSize(self) + XBlockSize - 1) / XBlockSize;
4048         int YBlocks = (GDALGetRasterBandYSize(self) + YBlockSize - 1) / YBlockSize;
4049         void *data = CPLMalloc(XBlockSize * YBlockSize * GDALGetDataTypeSizeBytes(dt));
4050 
4051         for (int yb = 0; yb < YBlocks; ++yb) {
4052             if (callback) {
4053                 double p = (double)yb/(double)YBlocks;
4054                 if (!callback(p, "", callback_data)) {
4055                     CPLError(CE_Failure, CPLE_UserInterrupt, "User terminated");
4056                     hv_undef(hash);
4057                     hash = NULL;
4058                     break;
4059                 }
4060             }
4061             for (int xb = 0; xb < XBlocks; ++xb) {
4062                 int XValid, YValid;
4063                 CPLErr e = GDALReadBlock(self, xb, yb, data);
4064                 GDALGetActualBlockSize(self, xb, yb, &XValid, &YValid);
4065                 for (int iY = 0; iY < YValid; ++iY) {
4066                     for (int iX = 0; iX < XValid; ++iX) {
4067                         double nv = 0;
4068                         switch(dt) {
4069                         case GDT_Byte:
4070                             nv = ((GByte*)(data))[iX + iY * XBlockSize];
4071                             break;
4072                         case GDT_UInt16:
4073                             nv = ((GUInt16*)(data))[iX + iY * XBlockSize];
4074                             break;
4075                         case GDT_Int16:
4076                             nv = ((GInt16*)(data))[iX + iY * XBlockSize];
4077                             break;
4078                         case GDT_UInt32:
4079                             nv = ((GUInt32*)(data))[iX + iY * XBlockSize];
4080                             break;
4081                         case GDT_Int32:
4082                             nv = ((GInt32*)(data))[iX + iY * XBlockSize];
4083                             break;
4084                         case GDT_Float32:
4085                             nv = ((float*)(data))[iX + iY * XBlockSize];
4086                             break;
4087                         case GDT_Float64:
4088                             nv = ((double*)(data))[iX + iY * XBlockSize];
4089                             break;
4090                         }
4091                         if (has_no_data && nv == no_data) {
4092                             continue;
4093                         }
4094                         int k = 0;
4095                         NVClass(comparison, nv, array_classifier, &k, &error);
4096                         if (error) goto fail;
4097                         char key[12];
4098                         int klen = sprintf(key, "%i", k);
4099                         SV* sv;
4100                         SV** sv2 = hv_fetch(hash, key, klen, 0);
4101                         if (sv2 && SvOK(*sv2)) {
4102                             sv = *sv2;
4103                             sv_setiv(sv, SvIV(sv)+1);
4104                             SvREFCNT_inc(sv);
4105                         } else {
4106                             sv = newSViv(1);
4107                         }
4108                         if (!hv_store(hash, key, klen, sv, 0))
4109                             SvREFCNT_dec(sv);
4110                     }
4111                 }
4112             }
4113         }
4114 
4115         CPLFree(data);
4116         if (hash)
4117             return newRV_noinc((SV*)hash);
4118         else
4119             return &PL_sv_undef;
4120         fail:
4121         CPLFree(data);
4122         do_confess(error, 1);
4123         return &PL_sv_undef;
4124     }
GDALRasterBandShadow_Reclassify(GDALRasterBandShadow * self,SV * classifier,GDALProgressFunc callback=NULL,void * callback_data=NULL)4125 SWIGINTERN void GDALRasterBandShadow_Reclassify(GDALRasterBandShadow *self,SV *classifier,GDALProgressFunc callback=NULL,void *callback_data=NULL){
4126 
4127         const char *error = NULL;
4128 
4129         GDALDataType dt = GDALGetRasterDataType(self);
4130 
4131         bool is_integer_raster = true;
4132         HV* hash_classifier = NULL;
4133         bool has_default = false;
4134         int32_t deflt = 0;
4135 
4136         AV* array_classifier = NULL;
4137         int comparison = 0;
4138 
4139         if (dt == GDT_Byte || dt == GDT_UInt16 || dt == GDT_Int16 || dt == GDT_UInt32 || dt == GDT_Int32) {
4140             if (SvROK(classifier) && (SvTYPE(SvRV(classifier)) == SVt_PVHV)) {
4141                 hash_classifier = (HV*)SvRV(classifier);
4142                 SV** sv = hv_fetch(hash_classifier, "*", 1, 0);
4143                 if (sv && SvOK(*sv)) {
4144                     has_default = true;
4145                     deflt = SvIV(*sv);
4146                 }
4147             } else {
4148                 /*do_confess(NEED_HASH_REF, 1);*/
4149                 array_classifier = to_array_classifier(classifier, &comparison, &error);
4150                 if (error) do_confess(error, 1);
4151             }
4152         } else if (dt == GDT_Float32 || dt == GDT_Float64) {
4153             is_integer_raster = false;
4154             array_classifier = to_array_classifier(classifier, &comparison, &error);
4155             if (error) do_confess(error, 1);
4156         } else {
4157             do_confess("Only integer and float rasters can be reclassified.", 1);
4158         }
4159 
4160         int has_no_data;
4161         double no_data = GDALGetRasterNoDataValue(self, &has_no_data);
4162         int XBlockSize, YBlockSize;
4163         GDALGetBlockSize( self, &XBlockSize, &YBlockSize );
4164         int XBlocks = (GDALGetRasterBandXSize(self) + XBlockSize - 1) / XBlockSize;
4165         int YBlocks = (GDALGetRasterBandYSize(self) + YBlockSize - 1) / YBlockSize;
4166         void *data = CPLMalloc(XBlockSize * YBlockSize * GDALGetDataTypeSizeBytes(dt));
4167 
4168         for (int yb = 0; yb < YBlocks; ++yb) {
4169             if (callback) {
4170                 double p = (double)yb/(double)YBlocks;
4171                 if (!callback(p, "", callback_data)) {
4172                     CPLError(CE_Failure, CPLE_UserInterrupt, "User terminated");
4173                     break;
4174                 }
4175             }
4176             for (int xb = 0; xb < XBlocks; ++xb) {
4177                 int XValid, YValid;
4178                 CPLErr e = GDALReadBlock(self, xb, yb, data);
4179                 GDALGetActualBlockSize(self, xb, yb, &XValid, &YValid);
4180                 for (int iY = 0; iY < YValid; ++iY) {
4181                     for (int iX = 0; iX < XValid; ++iX) {
4182                         int32_t k = 0;
4183                         double nv = 0;
4184                         switch(dt) {
4185                         case GDT_Byte:
4186                           k = ((GByte*)(data))[iX + iY * XBlockSize];
4187                           break;
4188                         case GDT_UInt16:
4189                           k = ((GUInt16*)(data))[iX + iY * XBlockSize];
4190                           break;
4191                         case GDT_Int16:
4192                           k = ((GInt16*)(data))[iX + iY * XBlockSize];
4193                           break;
4194                         case GDT_UInt32:
4195                           k = ((GUInt32*)(data))[iX + iY * XBlockSize];
4196                           break;
4197                         case GDT_Int32:
4198                           k = ((GInt32*)(data))[iX + iY * XBlockSize];
4199                           break;
4200                         case GDT_Float32:
4201                           nv = ((float*)(data))[iX + iY * XBlockSize];
4202                           break;
4203                         case GDT_Float64:
4204                           nv = ((double*)(data))[iX + iY * XBlockSize];
4205                           break;
4206                         }
4207 
4208                         if (is_integer_raster) {
4209                             if (array_classifier) {
4210                                 if (!(has_no_data && k == no_data)) {
4211                                     k = IVClassify(comparison, k, array_classifier, &error);
4212                                     if (error) goto fail;
4213                                 }
4214                             } else {
4215                                 char key[12];
4216                                 int klen = sprintf(key, "%i", k);
4217                                 SV** sv = hv_fetch(hash_classifier, key, klen, 0);
4218                                 if (sv && SvOK(*sv)) {
4219                                     k = SvIV(*sv);
4220                                 } else if (has_default) {
4221                                     if (!(has_no_data && k == no_data))
4222                                         k = deflt;
4223                                     else
4224                                         continue;
4225                                 }
4226                             }
4227                         } else {
4228                             if (!(has_no_data && nv == no_data)) {
4229                                 nv = NVClassify(comparison, nv, array_classifier, &error);
4230                                 if (error) goto fail;
4231                             }
4232                         }
4233 
4234                         switch(dt) {
4235                         case GDT_Byte:
4236                           ((GByte*)(data))[iX + iY * XBlockSize] = k;
4237                           break;
4238                         case GDT_UInt16:
4239                           ((GUInt16*)(data))[iX + iY * XBlockSize] = k;
4240                           break;
4241                         case GDT_Int16:
4242                           ((GInt16*)(data))[iX + iY * XBlockSize] = k;
4243                           break;
4244                         case GDT_UInt32:
4245                           ((GUInt32*)(data))[iX + iY * XBlockSize] = k;
4246                           break;
4247                         case GDT_Int32:
4248                           ((GInt32*)(data))[iX + iY * XBlockSize] = k;
4249                           break;
4250                         case GDT_Float32:
4251                           ((float*)(data))[iX + iY * XBlockSize] = nv;
4252                           break;
4253                         case GDT_Float64:
4254                           ((double*)(data))[iX + iY * XBlockSize] = nv;
4255                           break;
4256                         }
4257                     }
4258                 }
4259                 e = GDALWriteBlock(self, xb, yb, data);
4260             }
4261         }
4262         CPLFree(data);
4263         return;
4264         fail:
4265         CPLFree(data);
4266         do_confess(error, 1);
4267         return;
4268     }
4269 
GDALRasterBandShadow_DataType_get(GDALRasterBandShadow * h)4270 GDALDataType GDALRasterBandShadow_DataType_get( GDALRasterBandShadow *h ) {
4271   return GDALGetRasterDataType( h );
4272 }
GDALRasterBandShadow_XSize_get(GDALRasterBandShadow * h)4273 int GDALRasterBandShadow_XSize_get( GDALRasterBandShadow *h ) {
4274   return GDALGetRasterBandXSize( h );
4275 }
GDALRasterBandShadow_YSize_get(GDALRasterBandShadow * h)4276 int GDALRasterBandShadow_YSize_get( GDALRasterBandShadow *h ) {
4277   return GDALGetRasterBandYSize( h );
4278 }
4279 
new_GDALColorTableShadow(GDALPaletteInterp palette=GPI_RGB)4280 SWIGINTERN GDALColorTableShadow *new_GDALColorTableShadow(GDALPaletteInterp palette=GPI_RGB){
4281         return (GDALColorTableShadow*) GDALCreateColorTable(palette);
4282     }
delete_GDALColorTableShadow(GDALColorTableShadow * self)4283 SWIGINTERN void delete_GDALColorTableShadow(GDALColorTableShadow *self){
4284         GDALDestroyColorTable(self);
4285     }
GDALColorTableShadow_Clone(GDALColorTableShadow * self)4286 SWIGINTERN GDALColorTableShadow *GDALColorTableShadow_Clone(GDALColorTableShadow *self){
4287         return (GDALColorTableShadow*) GDALCloneColorTable (self);
4288     }
GDALColorTableShadow_GetPaletteInterpretation(GDALColorTableShadow * self)4289 SWIGINTERN GDALPaletteInterp GDALColorTableShadow_GetPaletteInterpretation(GDALColorTableShadow *self){
4290         return GDALGetPaletteInterpretation(self);
4291     }
GDALColorTableShadow_GetColorEntryCount(GDALColorTableShadow * self)4292 SWIGINTERN int GDALColorTableShadow_GetColorEntryCount(GDALColorTableShadow *self){
4293         return GDALGetColorEntryCount(self);
4294     }
GDALColorTableShadow_GetColorEntry(GDALColorTableShadow * self,int entry)4295 SWIGINTERN GDALColorEntry *GDALColorTableShadow_GetColorEntry(GDALColorTableShadow *self,int entry){
4296         return (GDALColorEntry*) GDALGetColorEntry(self, entry);
4297     }
GDALColorTableShadow_GetColorEntryAsRGB(GDALColorTableShadow * self,int entry,GDALColorEntry * centry)4298 SWIGINTERN int GDALColorTableShadow_GetColorEntryAsRGB(GDALColorTableShadow *self,int entry,GDALColorEntry *centry){
4299         return GDALGetColorEntryAsRGB(self, entry, centry);
4300     }
GDALColorTableShadow_SetColorEntry(GDALColorTableShadow * self,int entry,GDALColorEntry const * centry)4301 SWIGINTERN void GDALColorTableShadow_SetColorEntry(GDALColorTableShadow *self,int entry,GDALColorEntry const *centry){
4302         GDALSetColorEntry(self, entry, centry);
4303     }
GDALColorTableShadow_CreateColorRamp(GDALColorTableShadow * self,int nStartIndex,GDALColorEntry const * startcolor,int nEndIndex,GDALColorEntry const * endcolor)4304 SWIGINTERN void GDALColorTableShadow_CreateColorRamp(GDALColorTableShadow *self,int nStartIndex,GDALColorEntry const *startcolor,int nEndIndex,GDALColorEntry const *endcolor){
4305         GDALCreateColorRamp(self, nStartIndex, startcolor, nEndIndex, endcolor);
4306     }
new_GDALRasterAttributeTableShadow()4307 SWIGINTERN GDALRasterAttributeTableShadow *new_GDALRasterAttributeTableShadow(){
4308         return (GDALRasterAttributeTableShadow*)
4309 		GDALCreateRasterAttributeTable();
4310     }
delete_GDALRasterAttributeTableShadow(GDALRasterAttributeTableShadow * self)4311 SWIGINTERN void delete_GDALRasterAttributeTableShadow(GDALRasterAttributeTableShadow *self){
4312         GDALDestroyRasterAttributeTable(self);
4313     }
GDALRasterAttributeTableShadow_Clone(GDALRasterAttributeTableShadow * self)4314 SWIGINTERN GDALRasterAttributeTableShadow *GDALRasterAttributeTableShadow_Clone(GDALRasterAttributeTableShadow *self){
4315         return (GDALRasterAttributeTableShadow*) GDALRATClone(self);
4316     }
GDALRasterAttributeTableShadow_GetColumnCount(GDALRasterAttributeTableShadow * self)4317 SWIGINTERN int GDALRasterAttributeTableShadow_GetColumnCount(GDALRasterAttributeTableShadow *self){
4318         return GDALRATGetColumnCount( self );
4319     }
GDALRasterAttributeTableShadow_GetNameOfCol(GDALRasterAttributeTableShadow * self,int iCol)4320 SWIGINTERN char const *GDALRasterAttributeTableShadow_GetNameOfCol(GDALRasterAttributeTableShadow *self,int iCol){
4321         return GDALRATGetNameOfCol( self, iCol );
4322     }
GDALRasterAttributeTableShadow_GetUsageOfCol(GDALRasterAttributeTableShadow * self,int iCol)4323 SWIGINTERN GDALRATFieldUsage GDALRasterAttributeTableShadow_GetUsageOfCol(GDALRasterAttributeTableShadow *self,int iCol){
4324         return GDALRATGetUsageOfCol( self, iCol );
4325     }
GDALRasterAttributeTableShadow_GetTypeOfCol(GDALRasterAttributeTableShadow * self,int iCol)4326 SWIGINTERN GDALRATFieldType GDALRasterAttributeTableShadow_GetTypeOfCol(GDALRasterAttributeTableShadow *self,int iCol){
4327         return GDALRATGetTypeOfCol( self, iCol );
4328     }
GDALRasterAttributeTableShadow_GetColOfUsage(GDALRasterAttributeTableShadow * self,GDALRATFieldUsage eUsage)4329 SWIGINTERN int GDALRasterAttributeTableShadow_GetColOfUsage(GDALRasterAttributeTableShadow *self,GDALRATFieldUsage eUsage){
4330         return GDALRATGetColOfUsage( self, eUsage );
4331     }
GDALRasterAttributeTableShadow_GetRowCount(GDALRasterAttributeTableShadow * self)4332 SWIGINTERN int GDALRasterAttributeTableShadow_GetRowCount(GDALRasterAttributeTableShadow *self){
4333         return GDALRATGetRowCount( self );
4334     }
GDALRasterAttributeTableShadow_GetValueAsString(GDALRasterAttributeTableShadow * self,int iRow,int iCol)4335 SWIGINTERN char const *GDALRasterAttributeTableShadow_GetValueAsString(GDALRasterAttributeTableShadow *self,int iRow,int iCol){
4336         return GDALRATGetValueAsString( self, iRow, iCol );
4337     }
GDALRasterAttributeTableShadow_GetValueAsInt(GDALRasterAttributeTableShadow * self,int iRow,int iCol)4338 SWIGINTERN int GDALRasterAttributeTableShadow_GetValueAsInt(GDALRasterAttributeTableShadow *self,int iRow,int iCol){
4339         return GDALRATGetValueAsInt( self, iRow, iCol );
4340     }
GDALRasterAttributeTableShadow_GetValueAsDouble(GDALRasterAttributeTableShadow * self,int iRow,int iCol)4341 SWIGINTERN double GDALRasterAttributeTableShadow_GetValueAsDouble(GDALRasterAttributeTableShadow *self,int iRow,int iCol){
4342         return GDALRATGetValueAsDouble( self, iRow, iCol );
4343     }
GDALRasterAttributeTableShadow_SetValueAsString(GDALRasterAttributeTableShadow * self,int iRow,int iCol,char const * pszValue)4344 SWIGINTERN void GDALRasterAttributeTableShadow_SetValueAsString(GDALRasterAttributeTableShadow *self,int iRow,int iCol,char const *pszValue){
4345         GDALRATSetValueAsString( self, iRow, iCol, pszValue );
4346     }
GDALRasterAttributeTableShadow_SetValueAsInt(GDALRasterAttributeTableShadow * self,int iRow,int iCol,int nValue)4347 SWIGINTERN void GDALRasterAttributeTableShadow_SetValueAsInt(GDALRasterAttributeTableShadow *self,int iRow,int iCol,int nValue){
4348         GDALRATSetValueAsInt( self, iRow, iCol, nValue );
4349     }
GDALRasterAttributeTableShadow_SetValueAsDouble(GDALRasterAttributeTableShadow * self,int iRow,int iCol,double dfValue)4350 SWIGINTERN void GDALRasterAttributeTableShadow_SetValueAsDouble(GDALRasterAttributeTableShadow *self,int iRow,int iCol,double dfValue){
4351         GDALRATSetValueAsDouble( self, iRow, iCol, dfValue );
4352     }
GDALRasterAttributeTableShadow_SetRowCount(GDALRasterAttributeTableShadow * self,int nCount)4353 SWIGINTERN void GDALRasterAttributeTableShadow_SetRowCount(GDALRasterAttributeTableShadow *self,int nCount){
4354         GDALRATSetRowCount( self, nCount );
4355     }
GDALRasterAttributeTableShadow_CreateColumn(GDALRasterAttributeTableShadow * self,char const * pszName,GDALRATFieldType eType,GDALRATFieldUsage eUsage)4356 SWIGINTERN int GDALRasterAttributeTableShadow_CreateColumn(GDALRasterAttributeTableShadow *self,char const *pszName,GDALRATFieldType eType,GDALRATFieldUsage eUsage){
4357         return GDALRATCreateColumn( self, pszName, eType, eUsage );
4358     }
GDALRasterAttributeTableShadow_GetLinearBinning(GDALRasterAttributeTableShadow * self,double * pdfRow0Min,double * pdfBinSize)4359 SWIGINTERN bool GDALRasterAttributeTableShadow_GetLinearBinning(GDALRasterAttributeTableShadow *self,double *pdfRow0Min,double *pdfBinSize){
4360         return (GDALRATGetLinearBinning(self, pdfRow0Min, pdfBinSize) != 0) ? true : false;
4361     }
GDALRasterAttributeTableShadow_SetLinearBinning(GDALRasterAttributeTableShadow * self,double dfRow0Min,double dfBinSize)4362 SWIGINTERN int GDALRasterAttributeTableShadow_SetLinearBinning(GDALRasterAttributeTableShadow *self,double dfRow0Min,double dfBinSize){
4363         return GDALRATSetLinearBinning(self, dfRow0Min, dfBinSize);
4364     }
GDALRasterAttributeTableShadow_GetRowOfValue(GDALRasterAttributeTableShadow * self,double dfValue)4365 SWIGINTERN int GDALRasterAttributeTableShadow_GetRowOfValue(GDALRasterAttributeTableShadow *self,double dfValue){
4366         return GDALRATGetRowOfValue( self, dfValue );
4367     }
GDALRasterAttributeTableShadow_ChangesAreWrittenToFile(GDALRasterAttributeTableShadow * self)4368 SWIGINTERN int GDALRasterAttributeTableShadow_ChangesAreWrittenToFile(GDALRasterAttributeTableShadow *self){
4369         return GDALRATChangesAreWrittenToFile( self );
4370     }
GDALRasterAttributeTableShadow_DumpReadable(GDALRasterAttributeTableShadow * self)4371 SWIGINTERN void GDALRasterAttributeTableShadow_DumpReadable(GDALRasterAttributeTableShadow *self){
4372         GDALRATDumpReadable( self, NULL );
4373     }
GDALRasterAttributeTableShadow_SetTableType(GDALRasterAttributeTableShadow * self,GDALRATTableType eTableType)4374 SWIGINTERN void GDALRasterAttributeTableShadow_SetTableType(GDALRasterAttributeTableShadow *self,GDALRATTableType eTableType){
4375         GDALRATSetTableType( self, eTableType );
4376     }
GDALRasterAttributeTableShadow_GetTableType(GDALRasterAttributeTableShadow * self)4377 SWIGINTERN GDALRATTableType GDALRasterAttributeTableShadow_GetTableType(GDALRasterAttributeTableShadow *self){
4378         return GDALRATGetTableType( self );
4379     }
4380 
4381 #include "gdalgrid.h"
4382 
4383 #ifdef DEBUG
4384 typedef struct OGRLayerHS OGRLayerShadow;
4385 typedef struct OGRGeometryHS OGRGeometryShadow;
4386 #else
4387 typedef void OGRLayerShadow;
4388 typedef void OGRGeometryShadow;
4389 #endif
4390 
4391 
4392 static int
GDALTermProgress_nocb(double dfProgress,const char * pszMessage=NULL,void * pData=NULL)4393 GDALTermProgress_nocb( double dfProgress, const char * pszMessage=NULL, void *pData=NULL ) {
4394   return GDALTermProgress( dfProgress, pszMessage, pData);
4395 }
4396 
4397 
ComputeMedianCutPCT(GDALRasterBandShadow * red,GDALRasterBandShadow * green,GDALRasterBandShadow * blue,int num_colors,GDALColorTableShadow * colors,GDALProgressFunc callback=NULL,void * callback_data=NULL)4398 int  ComputeMedianCutPCT ( GDALRasterBandShadow *red,
4399                               GDALRasterBandShadow *green,
4400                               GDALRasterBandShadow *blue,
4401                               int num_colors,
4402                               GDALColorTableShadow* colors,
4403                               GDALProgressFunc callback = NULL,
4404                               void* callback_data=NULL) {
4405 
4406     CPLErrorReset();
4407 
4408     int err = GDALComputeMedianCutPCT( red,
4409                                           green,
4410                                           blue,
4411                                           NULL,
4412                                           num_colors,
4413                                           colors,
4414                                           callback,
4415                                           callback_data);
4416 
4417     return err;
4418 }
4419 
4420 
DitherRGB2PCT(GDALRasterBandShadow * red,GDALRasterBandShadow * green,GDALRasterBandShadow * blue,GDALRasterBandShadow * target,GDALColorTableShadow * colors,GDALProgressFunc callback=NULL,void * callback_data=NULL)4421 int  DitherRGB2PCT ( GDALRasterBandShadow *red,
4422                      GDALRasterBandShadow *green,
4423                      GDALRasterBandShadow *blue,
4424                      GDALRasterBandShadow *target,
4425                      GDALColorTableShadow *colors,
4426                      GDALProgressFunc callback = NULL,
4427                      void* callback_data=NULL) {
4428 
4429     CPLErrorReset();
4430     int err;
4431     err = GDALDitherRGB2PCT(  red,
4432                                   green,
4433                                   blue,
4434                                   target,
4435                                   colors,
4436                                   callback,
4437                                   callback_data);
4438 
4439     return err;
4440 }
4441 
4442 
ReprojectImage(GDALDatasetShadow * src_ds,GDALDatasetShadow * dst_ds,const char * src_wkt=NULL,const char * dst_wkt=NULL,GDALResampleAlg eResampleAlg=GRA_NearestNeighbour,double WarpMemoryLimit=0.0,double maxerror=0.0,GDALProgressFunc callback=NULL,void * callback_data=NULL,char ** options=NULL)4443 CPLErr  ReprojectImage ( GDALDatasetShadow *src_ds,
4444                          GDALDatasetShadow *dst_ds,
4445                          const char *src_wkt=NULL,
4446                          const char *dst_wkt=NULL,
4447                          GDALResampleAlg eResampleAlg=GRA_NearestNeighbour,
4448                          double WarpMemoryLimit=0.0,
4449                          double maxerror = 0.0,
4450 			 GDALProgressFunc callback = NULL,
4451                      	 void* callback_data=NULL,
4452                          char** options = NULL ) {
4453 
4454     CPLErrorReset();
4455 
4456     GDALWarpOptions* psOptions = NULL;
4457     if( options != NULL )
4458     {
4459         psOptions = GDALCreateWarpOptions();
4460         psOptions->papszWarpOptions = CSLDuplicate(options);
4461     }
4462 
4463     CPLErr err = GDALReprojectImage( src_ds,
4464                                      src_wkt,
4465                                      dst_ds,
4466                                      dst_wkt,
4467                                      eResampleAlg,
4468                                      WarpMemoryLimit,
4469                                      maxerror,
4470                                      callback,
4471                                      callback_data,
4472                                      psOptions);
4473 
4474     if( psOptions != NULL )
4475         GDALDestroyWarpOptions(psOptions);
4476 
4477     return err;
4478 }
4479 
4480 
ComputeProximity(GDALRasterBandShadow * srcBand,GDALRasterBandShadow * proximityBand,char ** options=NULL,GDALProgressFunc callback=NULL,void * callback_data=NULL)4481 int  ComputeProximity( GDALRasterBandShadow *srcBand,
4482                        GDALRasterBandShadow *proximityBand,
4483                        char **options = NULL,
4484                        GDALProgressFunc callback=NULL,
4485                        void* callback_data=NULL) {
4486 
4487     CPLErrorReset();
4488 
4489     return GDALComputeProximity( srcBand, proximityBand, options,
4490                                  callback, callback_data );
4491 }
4492 
4493 
RasterizeLayer(GDALDatasetShadow * dataset,int bands,int * band_list,OGRLayerShadow * layer,void * pfnTransformer=NULL,void * pTransformArg=NULL,int burn_values=0,double * burn_values_list=NULL,char ** options=NULL,GDALProgressFunc callback=NULL,void * callback_data=NULL)4494 int  RasterizeLayer( GDALDatasetShadow *dataset,
4495                  int bands, int *band_list,
4496                  OGRLayerShadow *layer,
4497                  void *pfnTransformer = NULL,
4498                  void *pTransformArg = NULL,
4499 		 int burn_values = 0, double *burn_values_list = NULL,
4500                  char **options = NULL,
4501                  GDALProgressFunc callback=NULL,
4502                  void* callback_data=NULL) {
4503 
4504     CPLErr eErr;
4505 
4506     CPLErrorReset();
4507 
4508     if( burn_values == 0 )
4509     {
4510         burn_values_list = (double *) CPLMalloc(sizeof(double)*bands);
4511         for( int i = 0; i < bands; i++ )
4512             burn_values_list[i] = 255.0;
4513     }
4514     else if( burn_values != bands )
4515     {
4516         CPLError( CE_Failure, CPLE_AppDefined,
4517                   "Did not get the expected number of burn values in RasterizeLayer()" );
4518         return CE_Failure;
4519     }
4520 
4521     eErr = GDALRasterizeLayers( dataset, bands, band_list,
4522                                 1, &layer,
4523                                 (GDALTransformerFunc) pfnTransformer,
4524                                 pTransformArg,
4525                                 burn_values_list, options,
4526                                 callback, callback_data );
4527 
4528     if( burn_values == 0 )
4529         CPLFree( burn_values_list );
4530 
4531     return eErr;
4532 }
4533 
4534 
Polygonize(GDALRasterBandShadow * srcBand,GDALRasterBandShadow * maskBand,OGRLayerShadow * outLayer,int iPixValField,char ** options=NULL,GDALProgressFunc callback=NULL,void * callback_data=NULL)4535 int  Polygonize( GDALRasterBandShadow *srcBand,
4536      		 GDALRasterBandShadow *maskBand,
4537   	         OGRLayerShadow *outLayer,
4538                  int iPixValField,
4539                  char **options = NULL,
4540                  GDALProgressFunc callback=NULL,
4541                  void* callback_data=NULL) {
4542 
4543     CPLErrorReset();
4544 
4545     return GDALPolygonize( srcBand, maskBand, outLayer, iPixValField,
4546                            options, callback, callback_data );
4547 }
4548 
4549 
FPolygonize(GDALRasterBandShadow * srcBand,GDALRasterBandShadow * maskBand,OGRLayerShadow * outLayer,int iPixValField,char ** options=NULL,GDALProgressFunc callback=NULL,void * callback_data=NULL)4550 int  FPolygonize( GDALRasterBandShadow *srcBand,
4551                  GDALRasterBandShadow *maskBand,
4552                  OGRLayerShadow *outLayer,
4553                  int iPixValField,
4554                  char **options = NULL,
4555                  GDALProgressFunc callback=NULL,
4556                  void* callback_data=NULL) {
4557 
4558     CPLErrorReset();
4559 
4560     return GDALFPolygonize( srcBand, maskBand, outLayer, iPixValField,
4561                            options, callback, callback_data );
4562 }
4563 
4564 
FillNodata(GDALRasterBandShadow * targetBand,GDALRasterBandShadow * maskBand,double maxSearchDist,int smoothingIterations,char ** options=NULL,GDALProgressFunc callback=NULL,void * callback_data=NULL)4565 int  FillNodata( GDALRasterBandShadow *targetBand,
4566      		 GDALRasterBandShadow *maskBand,
4567                  double maxSearchDist,
4568                  int smoothingIterations,
4569                  char **options = NULL,
4570                  GDALProgressFunc callback=NULL,
4571                  void* callback_data=NULL) {
4572 
4573     CPLErrorReset();
4574 
4575     return GDALFillNodata( targetBand, maskBand, maxSearchDist,
4576     	   		   0, smoothingIterations, options,
4577 			   callback, callback_data );
4578 }
4579 
4580 
SieveFilter(GDALRasterBandShadow * srcBand,GDALRasterBandShadow * maskBand,GDALRasterBandShadow * dstBand,int threshold,int connectedness=4,char ** options=NULL,GDALProgressFunc callback=NULL,void * callback_data=NULL)4581 int  SieveFilter( GDALRasterBandShadow *srcBand,
4582      		  GDALRasterBandShadow *maskBand,
4583   	          GDALRasterBandShadow *dstBand,
4584                   int threshold, int connectedness=4,
4585                   char **options = NULL,
4586                   GDALProgressFunc callback=NULL,
4587                   void* callback_data=NULL) {
4588 
4589     CPLErrorReset();
4590 
4591     return GDALSieveFilter( srcBand, maskBand, dstBand,
4592                             threshold, connectedness,
4593                             options, callback, callback_data );
4594 }
4595 
4596 
RegenerateOverviews(GDALRasterBandShadow * srcBand,int overviewBandCount,GDALRasterBandShadow ** overviewBands,const char * resampling="average",GDALProgressFunc callback=NULL,void * callback_data=NULL)4597 int  RegenerateOverviews( GDALRasterBandShadow *srcBand,
4598      			  int overviewBandCount,
4599                           GDALRasterBandShadow **overviewBands,
4600                           const char *resampling = "average",
4601                           GDALProgressFunc callback=NULL,
4602                           void* callback_data=NULL) {
4603 
4604     CPLErrorReset();
4605 
4606     return GDALRegenerateOverviews( srcBand, overviewBandCount, overviewBands,
4607     	   			    resampling ? resampling : "average", callback, callback_data );
4608 }
4609 
4610 
RegenerateOverview(GDALRasterBandShadow * srcBand,GDALRasterBandShadow * overviewBand,const char * resampling="average",GDALProgressFunc callback=NULL,void * callback_data=NULL)4611 int  RegenerateOverview( GDALRasterBandShadow *srcBand,
4612                           GDALRasterBandShadow *overviewBand,
4613                           const char *resampling = "average",
4614                           GDALProgressFunc callback=NULL,
4615                           void* callback_data=NULL) {
4616 
4617     CPLErrorReset();
4618 
4619     return GDALRegenerateOverviews( srcBand, 1, &overviewBand,
4620     	   			    resampling ? resampling : "average", callback, callback_data );
4621 }
4622 
4623 
ContourGenerate(GDALRasterBandShadow * srcBand,double contourInterval,double contourBase,int fixedLevelCount,double * fixedLevels,int useNoData,double noDataValue,OGRLayerShadow * dstLayer,int idField,int elevField,GDALProgressFunc callback=NULL,void * callback_data=NULL)4624 int ContourGenerate( GDALRasterBandShadow *srcBand,
4625                      double contourInterval,
4626                      double contourBase,
4627                      int fixedLevelCount,
4628                      double *fixedLevels,
4629                      int useNoData,
4630                      double noDataValue,
4631                      OGRLayerShadow* dstLayer,
4632                      int idField,
4633                      int elevField,
4634                      GDALProgressFunc callback = NULL,
4635                      void* callback_data = NULL)
4636 {
4637     CPLErr eErr;
4638 
4639     CPLErrorReset();
4640 
4641     eErr =  GDALContourGenerate( srcBand,
4642                                  contourInterval,
4643                                  contourBase,
4644                                  fixedLevelCount,
4645                                  fixedLevels,
4646                                  useNoData,
4647                                  noDataValue,
4648                                  dstLayer,
4649                                  idField,
4650                                  elevField,
4651                                  callback,
4652                                  callback_data);
4653 
4654     return eErr;
4655 }
4656 
4657 
ContourGenerateEx(GDALRasterBandShadow * srcBand,OGRLayerShadow * dstLayer,char ** options=NULL,GDALProgressFunc callback=NULL,void * callback_data=NULL)4658 int ContourGenerateEx( GDALRasterBandShadow *srcBand,
4659                        OGRLayerShadow* dstLayer,
4660                        char** options = NULL,
4661                        GDALProgressFunc callback = NULL,
4662                        void* callback_data = NULL )
4663 {
4664     CPLErr eErr;
4665 
4666     CPLErrorReset();
4667 
4668     eErr =  GDALContourGenerateEx( srcBand,
4669                                    dstLayer,
4670                                    options,
4671                                    callback,
4672                                    callback_data);
4673 
4674     return eErr;
4675 }
4676 
4677 
ViewshedGenerate(GDALRasterBandShadow * srcBand,const char * driverName,const char * targetRasterName,char ** creationOptions,double observerX,double observerY,double observerHeight,double targetHeight,double visibleVal,double invisibleVal,double outOfRangeVal,double noDataVal,double dfCurvCoeff,GDALViewshedMode mode,double maxDistance,GDALProgressFunc callback=NULL,void * callback_data=NULL,GDALViewshedOutputType heightMode=GVOT_NORMAL,char ** papszOptions=NULL)4678 GDALDatasetShadow *ViewshedGenerate( GDALRasterBandShadow *srcBand,
4679                         const char* driverName,
4680                         const char* targetRasterName,
4681                         char** creationOptions,
4682                         double observerX, double observerY, double observerHeight,
4683                         double targetHeight, double visibleVal, double invisibleVal,
4684                         double outOfRangeVal,  double noDataVal, double dfCurvCoeff,
4685                         GDALViewshedMode mode, double maxDistance,
4686                         GDALProgressFunc callback = NULL, void* callback_data = NULL,
4687                         GDALViewshedOutputType heightMode = GVOT_NORMAL,
4688                         char** papszOptions = NULL)
4689 {
4690     GDALDatasetShadow* ds = GDALViewshedGenerate( srcBand,
4691                                  driverName,
4692                                  targetRasterName,
4693                                  creationOptions,
4694                                  observerX,
4695                                  observerY,
4696                                  observerHeight,
4697                                  targetHeight,
4698                                  visibleVal,
4699                                  invisibleVal,
4700                                  outOfRangeVal,
4701                                  noDataVal,
4702                                  dfCurvCoeff,
4703                                  mode,
4704                                  maxDistance,
4705                                  callback,
4706                                  callback_data,
4707                                  heightMode,
4708                                  papszOptions);
4709   if (ds == 0) {
4710     /*throw CPLGetLastErrorMsg(); causes a SWIG_exception later*/
4711   }
4712   return ds;
4713 }
4714 
4715 
AutoCreateWarpedVRT(GDALDatasetShadow * src_ds,const char * src_wkt=0,const char * dst_wkt=0,GDALResampleAlg eResampleAlg=GRA_NearestNeighbour,double maxerror=0.0)4716 GDALDatasetShadow *AutoCreateWarpedVRT( GDALDatasetShadow *src_ds,
4717                                         const char *src_wkt = 0,
4718                                         const char *dst_wkt = 0,
4719                                         GDALResampleAlg eResampleAlg = GRA_NearestNeighbour,
4720                                         double maxerror = 0.0 ) {
4721   GDALDatasetShadow *ds = GDALAutoCreateWarpedVRT( src_ds, src_wkt,
4722                                                    dst_wkt,
4723                                                    eResampleAlg,
4724                                                    maxerror,
4725                                                    0 );
4726   if (ds == 0) {
4727     /*throw CPLGetLastErrorMsg(); causes a SWIG_exception later*/
4728   }
4729   return ds;
4730 
4731 }
4732 
4733 
CreatePansharpenedVRT(const char * pszXML,GDALRasterBandShadow * panchroBand,int nInputSpectralBands,GDALRasterBandShadow ** ahInputSpectralBands)4734 GDALDatasetShadow*  CreatePansharpenedVRT( const char* pszXML,
4735                             GDALRasterBandShadow* panchroBand,
4736                             int nInputSpectralBands,
4737                             GDALRasterBandShadow** ahInputSpectralBands )
4738 {
4739     CPLErrorReset();
4740 
4741     return (GDALDatasetShadow*)GDALCreatePansharpenedVRT( pszXML, panchroBand,
4742                                       nInputSpectralBands, ahInputSpectralBands );
4743 }
4744 
new_GDALTransformerInfoShadow(GDALDatasetShadow * src,GDALDatasetShadow * dst,char ** options)4745 SWIGINTERN GDALTransformerInfoShadow *new_GDALTransformerInfoShadow(GDALDatasetShadow *src,GDALDatasetShadow *dst,char **options){
4746     GDALTransformerInfoShadow *obj = (GDALTransformerInfoShadow*)
4747        GDALCreateGenImgProjTransformer2( (GDALDatasetH)src, (GDALDatasetH)dst,
4748                                          options );
4749     return obj;
4750   }
delete_GDALTransformerInfoShadow(GDALTransformerInfoShadow * self)4751 SWIGINTERN void delete_GDALTransformerInfoShadow(GDALTransformerInfoShadow *self){
4752     GDALDestroyTransformer( self );
4753   }
GDALTransformerInfoShadow_TransformPoint__SWIG_0(GDALTransformerInfoShadow * self,int bDstToSrc,double inout[3])4754 SWIGINTERN int GDALTransformerInfoShadow_TransformPoint__SWIG_0(GDALTransformerInfoShadow *self,int bDstToSrc,double inout[3]){
4755     int nRet, nSuccess = TRUE;
4756 
4757     nRet = GDALUseTransformer( self, bDstToSrc,
4758                                1, &inout[0], &inout[1], &inout[2],
4759                                &nSuccess );
4760 
4761     return nRet && nSuccess;
4762   }
GDALTransformerInfoShadow_TransformPoint__SWIG_1(GDALTransformerInfoShadow * self,double argout[3],int bDstToSrc,double x,double y,double z=0.0)4763 SWIGINTERN int GDALTransformerInfoShadow_TransformPoint__SWIG_1(GDALTransformerInfoShadow *self,double argout[3],int bDstToSrc,double x,double y,double z=0.0){
4764     int nRet, nSuccess = TRUE;
4765 
4766     argout[0] = x;
4767     argout[1] = y;
4768     argout[2] = z;
4769     nRet = GDALUseTransformer( self, bDstToSrc,
4770                                1, &argout[0], &argout[1], &argout[2],
4771                                &nSuccess );
4772 
4773     return nRet && nSuccess;
4774   }
GDALTransformerInfoShadow_TransformPoints(GDALTransformerInfoShadow * self,int bDstToSrc,int nCount,double * x,double * y,double * z,int * panSuccess)4775 SWIGINTERN int GDALTransformerInfoShadow_TransformPoints(GDALTransformerInfoShadow *self,int bDstToSrc,int nCount,double *x,double *y,double *z,int *panSuccess){
4776     int nRet;
4777 
4778     nRet = GDALUseTransformer( self, bDstToSrc, nCount, x, y, z, panSuccess );
4779 
4780     return nRet;
4781   }
GDALTransformerInfoShadow_TransformGeolocations(GDALTransformerInfoShadow * self,GDALRasterBandShadow * xBand,GDALRasterBandShadow * yBand,GDALRasterBandShadow * zBand,GDALProgressFunc callback=NULL,void * callback_data=NULL,char ** options=NULL)4782 SWIGINTERN int GDALTransformerInfoShadow_TransformGeolocations(GDALTransformerInfoShadow *self,GDALRasterBandShadow *xBand,GDALRasterBandShadow *yBand,GDALRasterBandShadow *zBand,GDALProgressFunc callback=NULL,void *callback_data=NULL,char **options=NULL){
4783 
4784     CPLErrorReset();
4785 
4786     return GDALTransformGeolocations( xBand, yBand, zBand,
4787                                       GDALUseTransformer, self,
4788                             	      callback, callback_data, options );
4789   }
4790 
ApplyVerticalShiftGrid(GDALDatasetShadow * src_ds,GDALDatasetShadow * grid_ds,bool inverse=false,double srcUnitToMeter=1.0,double dstUnitToMeter=1.0,char ** options=NULL)4791 GDALDatasetShadow* ApplyVerticalShiftGrid( GDALDatasetShadow *src_ds,
4792                                            GDALDatasetShadow *grid_ds,
4793                                            bool inverse = false,
4794                                            double srcUnitToMeter = 1.0,
4795                                            double dstUnitToMeter = 1.0,
4796                                            char** options = NULL ) {
4797   GDALDatasetShadow *ds = GDALApplyVerticalShiftGrid( src_ds, grid_ds,
4798                                                       inverse,
4799                                                       srcUnitToMeter,
4800                                                       dstUnitToMeter,
4801                                                       options );
4802   return ds;
4803 
4804 }
4805 
4806 
wrapper_GDALGetCacheMax()4807 GIntBig wrapper_GDALGetCacheMax()
4808 {
4809     return GDALGetCacheMax64();
4810 }
4811 
4812 
wrapper_GDALGetCacheUsed()4813 GIntBig wrapper_GDALGetCacheUsed()
4814 {
4815     return GDALGetCacheUsed64();
4816 }
4817 
4818 
wrapper_GDALSetCacheMax(GIntBig nBytes)4819 void wrapper_GDALSetCacheMax(GIntBig nBytes)
4820 {
4821     return GDALSetCacheMax64(nBytes);
4822 }
4823 
4824 
4825 /************************************************************************/
4826 /*                          XMLTreeToAV()                               */
4827 /************************************************************************/
XMLTreeToAV(CPLXMLNode * psTree)4828     static AV *XMLTreeToAV( CPLXMLNode *psTree )
4829     {
4830         AV *av;
4831         int      nChildCount = 0, iChild;
4832         CPLXMLNode *psChild;
4833 
4834         for( psChild = psTree->psChild;
4835              psChild != NULL;
4836              psChild = psChild->psNext )
4837             nChildCount++;
4838 
4839         av = (AV*)sv_2mortal((SV*)newAV());
4840 
4841         av_store(av,0,newSViv((int) psTree->eType));
4842         SV *sv = newSVpv(psTree->pszValue, strlen(psTree->pszValue));
4843         SvUTF8_on(sv); /* expecting UTF-8 from GDAL */
4844         av_store(av,1,sv);
4845 
4846         for( psChild = psTree->psChild, iChild = 2;
4847              psChild != NULL;
4848              psChild = psChild->psNext, iChild++ )
4849         {
4850             SV *s = newRV((SV*)XMLTreeToAV(psChild));
4851             if (!av_store(av, iChild, s))
4852                 SvREFCNT_dec(s);
4853         }
4854 
4855         return av;
4856     }
4857 
4858 
4859 /************************************************************************/
4860 /*                          AVToXMLTree()                               */
4861 /************************************************************************/
AVToXMLTree(AV * av,int * err)4862     static CPLXMLNode *AVToXMLTree( AV *av, int *err )
4863     {
4864         int      nChildCount = 0, iChild, nType;
4865         CPLXMLNode *psThisNode;
4866         char       *pszText = NULL;
4867 
4868         nChildCount = av_len(av) - 1; /* There are two non-children in the array */
4869         if (nChildCount < 0) {
4870             /* the input XML is empty */
4871             *err = 1;
4872             return NULL;
4873         }
4874 
4875         nType = SvIV(*(av_fetch(av,0,0)));
4876         SV *sv = *(av_fetch(av,1,0));
4877         bool sf;
4878         char *tmp = sv_to_utf8_string(sv, NULL, &sf);
4879         psThisNode = CPLCreateXMLNode(NULL, (CPLXMLNodeType)nType, tmp);
4880         if (sf) Safefree(tmp); else free(tmp);
4881 
4882         for( iChild = 0; iChild < nChildCount; iChild++ )
4883         {
4884             SV **s = av_fetch(av, iChild+2, 0);
4885             CPLXMLNode *psChild;
4886             if (!(SvROK(*s) && (SvTYPE(SvRV(*s))==SVt_PVAV))) {
4887                 /* expected a reference to an array */
4888                 *err = 2;
4889                 psChild = NULL;
4890             } else
4891                 psChild = AVToXMLTree((AV*)SvRV(*s), err);
4892             if (psChild)
4893                 CPLAddXMLChild( psThisNode, psChild );
4894             else {
4895                 CPLDestroyXMLNode(psThisNode);
4896                 return NULL;
4897             }
4898         }
4899 
4900         return psThisNode;
4901     }
4902 
4903 
GetJPEG2000StructureAsString(const char * pszFilename,char ** options=NULL)4904 retStringAndCPLFree *GetJPEG2000StructureAsString( const char* pszFilename, char** options = NULL )
4905 {
4906     CPLXMLNode* psNode = GDALGetJPEG2000Structure(pszFilename, options);
4907     if( psNode == NULL )
4908         return NULL;
4909     char* pszXML = CPLSerializeXMLTree(psNode);
4910     CPLDestroyXMLNode(psNode);
4911     return pszXML;
4912 }
4913 
4914 
GetDriverCount()4915 int GetDriverCount() {
4916   return GDALGetDriverCount();
4917 }
4918 
4919 
4920 static
GetDriverByName(char const * name)4921 GDALDriverShadow* GetDriverByName( char const *name ) {
4922   return (GDALDriverShadow*) GDALGetDriverByName( name );
4923 }
4924 
4925 
GetDriver(char const * name)4926 GDALDriverShadow* GetDriver( char const *name ) {
4927   return (GDALDriverShadow*) GDALGetDriverByName( name );
4928 }
4929 
4930 
GetDriver(int i)4931 GDALDriverShadow* GetDriver( int i ) {
4932   return (GDALDriverShadow*) GDALGetDriver( i );
4933 }
4934 
4935 
Open(char const * utf8_path,GDALAccess eAccess=GA_ReadOnly)4936 GDALDatasetShadow* Open( char const* utf8_path, GDALAccess eAccess = GA_ReadOnly ) {
4937   CPLErrorReset();
4938   GDALDatasetShadow *ds = GDALOpen( utf8_path, eAccess );
4939 #ifndef SWIGPYTHON
4940   if( ds != NULL && CPLGetLastErrorType() == CE_Failure )
4941   {
4942       if ( GDALDereferenceDataset( ds ) <= 0 )
4943           GDALClose(ds);
4944       ds = NULL;
4945   }
4946 #endif
4947   return (GDALDatasetShadow*) ds;
4948 }
4949 
4950 
OpenEx(char const * utf8_path,unsigned int nOpenFlags=0,char ** allowed_drivers=NULL,char ** open_options=NULL,char ** sibling_files=NULL)4951 GDALDatasetShadow* OpenEx( char const* utf8_path, unsigned int nOpenFlags = 0,
4952                            char** allowed_drivers = NULL, char** open_options = NULL,
4953                            char** sibling_files = NULL ) {
4954   CPLErrorReset();
4955 #ifdef SWIGPYTHON
4956   if( GetUseExceptions() )
4957       nOpenFlags |= GDAL_OF_VERBOSE_ERROR;
4958 #endif
4959   GDALDatasetShadow *ds = GDALOpenEx( utf8_path, nOpenFlags, allowed_drivers,
4960                                       open_options, sibling_files );
4961 #ifndef SWIGPYTHON
4962   if( ds != NULL && CPLGetLastErrorType() == CE_Failure )
4963   {
4964       if ( GDALDereferenceDataset( ds ) <= 0 )
4965           GDALClose(ds);
4966       ds = NULL;
4967   }
4968 #endif
4969   return (GDALDatasetShadow*) ds;
4970 }
4971 
4972 
4973 SWIGINTERN int
SWIG_PERL_DECL_ARGS_2(SV * obj,unsigned int * val)4974 SWIG_AsVal_unsigned_SS_int SWIG_PERL_DECL_ARGS_2(SV * obj, unsigned int *val)
4975 {
4976   unsigned long v;
4977   int res = SWIG_AsVal_unsigned_SS_long SWIG_PERL_CALL_ARGS_2(obj, &v);
4978   if (SWIG_IsOK(res)) {
4979     if ((v > UINT_MAX)) {
4980       return SWIG_OverflowError;
4981     } else {
4982       if (val) *val = static_cast< unsigned int >(v);
4983     }
4984   }
4985   return res;
4986 }
4987 
4988 
OpenShared(char const * utf8_path,GDALAccess eAccess=GA_ReadOnly)4989 GDALDatasetShadow* OpenShared( char const* utf8_path, GDALAccess eAccess = GA_ReadOnly ) {
4990   CPLErrorReset();
4991   GDALDatasetShadow *ds = GDALOpenShared( utf8_path, eAccess );
4992 #ifndef SWIGPYTHON
4993   if( ds != NULL && CPLGetLastErrorType() == CE_Failure )
4994   {
4995       if ( GDALDereferenceDataset( ds ) <= 0 )
4996           GDALClose(ds);
4997       ds = NULL;
4998   }
4999 #endif
5000   return (GDALDatasetShadow*) ds;
5001 }
5002 
5003 
IdentifyDriver(const char * utf8_path,char ** papszSiblings=NULL)5004 GDALDriverShadow *IdentifyDriver( const char *utf8_path,
5005                                   char **papszSiblings = NULL ) {
5006     return (GDALDriverShadow *) GDALIdentifyDriver( utf8_path,
5007 	                                            papszSiblings );
5008 }
5009 
5010 
IdentifyDriverEx(const char * utf8_path,unsigned int nIdentifyFlags=0,char ** allowed_drivers=NULL,char ** sibling_files=NULL)5011 GDALDriverShadow *IdentifyDriverEx( const char* utf8_path,
5012                                     unsigned int nIdentifyFlags = 0,
5013                                     char** allowed_drivers = NULL,
5014                                     char** sibling_files = NULL )
5015 {
5016     return  (GDALDriverShadow *) GDALIdentifyDriverEx( utf8_path,
5017                                                 nIdentifyFlags,
5018                                                 allowed_drivers,
5019                                                 sibling_files );
5020 }
5021 
5022 
GeneralCmdLineProcessor(char ** papszArgv,int nOptions=0)5023   char **GeneralCmdLineProcessor( char **papszArgv, int nOptions = 0 ) {
5024     int nResArgCount;
5025 
5026     if( papszArgv == NULL )
5027         return NULL;
5028 
5029     bool bReloadDrivers = ( CSLFindString(papszArgv, "GDAL_SKIP") >= 0 ||
5030                             CSLFindString(papszArgv, "OGR_SKIP") >= 0 );
5031 
5032     nResArgCount =
5033       GDALGeneralCmdLineProcessor( CSLCount(papszArgv), &papszArgv, nOptions );
5034 
5035     if( bReloadDrivers )
5036     {
5037         GDALAllRegister();
5038     }
5039 
5040     if( nResArgCount <= 0 )
5041         return NULL;
5042     else
5043         return papszArgv;
5044   }
5045 
5046 
5047 #include "gdal_utils.h"
5048 
new_GDALInfoOptions(char ** options)5049 SWIGINTERN GDALInfoOptions *new_GDALInfoOptions(char **options){
5050         return GDALInfoOptionsNew(options, NULL);
5051     }
delete_GDALInfoOptions(GDALInfoOptions * self)5052 SWIGINTERN void delete_GDALInfoOptions(GDALInfoOptions *self){
5053         GDALInfoOptionsFree( self );
5054     }
new_GDALMultiDimInfoOptions(char ** options)5055 SWIGINTERN GDALMultiDimInfoOptions *new_GDALMultiDimInfoOptions(char **options){
5056         return GDALMultiDimInfoOptionsNew(options, NULL);
5057     }
delete_GDALMultiDimInfoOptions(GDALMultiDimInfoOptions * self)5058 SWIGINTERN void delete_GDALMultiDimInfoOptions(GDALMultiDimInfoOptions *self){
5059         GDALMultiDimInfoOptionsFree( self );
5060     }
new_GDALTranslateOptions(char ** options)5061 SWIGINTERN GDALTranslateOptions *new_GDALTranslateOptions(char **options){
5062         return GDALTranslateOptionsNew(options, NULL);
5063     }
delete_GDALTranslateOptions(GDALTranslateOptions * self)5064 SWIGINTERN void delete_GDALTranslateOptions(GDALTranslateOptions *self){
5065         GDALTranslateOptionsFree( self );
5066     }
5067 
wrapper_GDALTranslate(const char * dest,GDALDatasetShadow * dataset,GDALTranslateOptions * translateOptions,GDALProgressFunc callback=NULL,void * callback_data=NULL)5068 GDALDatasetShadow* wrapper_GDALTranslate( const char* dest,
5069                                       GDALDatasetShadow* dataset,
5070                                       GDALTranslateOptions* translateOptions,
5071                                       GDALProgressFunc callback=NULL,
5072                                       void* callback_data=NULL)
5073 {
5074     int usageError; /* ignored */
5075     bool bFreeOptions = false;
5076     if( callback )
5077     {
5078         if( translateOptions == NULL )
5079         {
5080             bFreeOptions = true;
5081             translateOptions = GDALTranslateOptionsNew(NULL, NULL);
5082         }
5083         GDALTranslateOptionsSetProgress(translateOptions, callback, callback_data);
5084     }
5085 #ifdef SWIGPYTHON
5086     std::vector<ErrorStruct> aoErrors;
5087     if( bUseExceptions )
5088     {
5089         PushStackingErrorHandler(&aoErrors);
5090     }
5091 #endif
5092     GDALDatasetH hDSRet = GDALTranslate(dest, dataset, translateOptions, &usageError);
5093     if( bFreeOptions )
5094         GDALTranslateOptionsFree(translateOptions);
5095 #ifdef SWIGPYTHON
5096     if( bUseExceptions )
5097     {
5098         PopStackingErrorHandler(&aoErrors, hDSRet != NULL);
5099     }
5100 #endif
5101     return hDSRet;
5102 }
5103 
new_GDALWarpAppOptions(char ** options)5104 SWIGINTERN GDALWarpAppOptions *new_GDALWarpAppOptions(char **options){
5105         return GDALWarpAppOptionsNew(options, NULL);
5106     }
delete_GDALWarpAppOptions(GDALWarpAppOptions * self)5107 SWIGINTERN void delete_GDALWarpAppOptions(GDALWarpAppOptions *self){
5108         GDALWarpAppOptionsFree( self );
5109     }
5110 
5111 
wrapper_GDALWarpDestDS(GDALDatasetShadow * dstDS,int object_list_count,GDALDatasetShadow ** poObjects,GDALWarpAppOptions * warpAppOptions,GDALProgressFunc callback=NULL,void * callback_data=NULL)5112 int wrapper_GDALWarpDestDS( GDALDatasetShadow* dstDS,
5113                             int object_list_count, GDALDatasetShadow** poObjects,
5114                             GDALWarpAppOptions* warpAppOptions,
5115                             GDALProgressFunc callback=NULL,
5116                             void* callback_data=NULL)
5117 {
5118     int usageError; /* ignored */
5119     bool bFreeOptions = false;
5120     if( callback )
5121     {
5122         if( warpAppOptions == NULL )
5123         {
5124             bFreeOptions = true;
5125             warpAppOptions = GDALWarpAppOptionsNew(NULL, NULL);
5126         }
5127         GDALWarpAppOptionsSetProgress(warpAppOptions, callback, callback_data);
5128     }
5129 #ifdef SWIGPYTHON
5130     std::vector<ErrorStruct> aoErrors;
5131     if( bUseExceptions )
5132     {
5133         PushStackingErrorHandler(&aoErrors);
5134     }
5135 #endif
5136     bool bRet = (GDALWarp(NULL, dstDS, object_list_count, poObjects, warpAppOptions, &usageError) != NULL);
5137     if( bFreeOptions )
5138         GDALWarpAppOptionsFree(warpAppOptions);
5139 #ifdef SWIGPYTHON
5140     if( bUseExceptions )
5141     {
5142         PopStackingErrorHandler(&aoErrors, bRet);
5143     }
5144 #endif
5145     return bRet;
5146 }
5147 
5148 
wrapper_GDALWarpDestName(const char * dest,int object_list_count,GDALDatasetShadow ** poObjects,GDALWarpAppOptions * warpAppOptions,GDALProgressFunc callback=NULL,void * callback_data=NULL)5149 GDALDatasetShadow* wrapper_GDALWarpDestName( const char* dest,
5150                                              int object_list_count, GDALDatasetShadow** poObjects,
5151                                              GDALWarpAppOptions* warpAppOptions,
5152                                              GDALProgressFunc callback=NULL,
5153                                              void* callback_data=NULL)
5154 {
5155     int usageError; /* ignored */
5156     bool bFreeOptions = false;
5157     if( callback )
5158     {
5159         if( warpAppOptions == NULL )
5160         {
5161             bFreeOptions = true;
5162             warpAppOptions = GDALWarpAppOptionsNew(NULL, NULL);
5163         }
5164         GDALWarpAppOptionsSetProgress(warpAppOptions, callback, callback_data);
5165     }
5166 #ifdef SWIGPYTHON
5167     std::vector<ErrorStruct> aoErrors;
5168     if( bUseExceptions )
5169     {
5170         PushStackingErrorHandler(&aoErrors);
5171     }
5172 #endif
5173     GDALDatasetH hDSRet = GDALWarp(dest, NULL, object_list_count, poObjects, warpAppOptions, &usageError);
5174     if( bFreeOptions )
5175         GDALWarpAppOptionsFree(warpAppOptions);
5176 #ifdef SWIGPYTHON
5177     if( bUseExceptions )
5178     {
5179         PopStackingErrorHandler(&aoErrors, hDSRet != NULL);
5180     }
5181 #endif
5182     return hDSRet;
5183 }
5184 
new_GDALVectorTranslateOptions(char ** options)5185 SWIGINTERN GDALVectorTranslateOptions *new_GDALVectorTranslateOptions(char **options){
5186         return GDALVectorTranslateOptionsNew(options, NULL);
5187     }
delete_GDALVectorTranslateOptions(GDALVectorTranslateOptions * self)5188 SWIGINTERN void delete_GDALVectorTranslateOptions(GDALVectorTranslateOptions *self){
5189         GDALVectorTranslateOptionsFree( self );
5190     }
5191 
wrapper_GDALVectorTranslateDestDS(GDALDatasetShadow * dstDS,GDALDatasetShadow * srcDS,GDALVectorTranslateOptions * options,GDALProgressFunc callback=NULL,void * callback_data=NULL)5192 int wrapper_GDALVectorTranslateDestDS( GDALDatasetShadow* dstDS,
5193                                        GDALDatasetShadow* srcDS,
5194                             GDALVectorTranslateOptions* options,
5195                             GDALProgressFunc callback=NULL,
5196                             void* callback_data=NULL)
5197 {
5198     int usageError; /* ignored */
5199     bool bFreeOptions = false;
5200     if( callback )
5201     {
5202         if( options == NULL )
5203         {
5204             bFreeOptions = true;
5205             options = GDALVectorTranslateOptionsNew(NULL, NULL);
5206         }
5207         GDALVectorTranslateOptionsSetProgress(options, callback, callback_data);
5208     }
5209 #ifdef SWIGPYTHON
5210     std::vector<ErrorStruct> aoErrors;
5211     if( bUseExceptions )
5212     {
5213         PushStackingErrorHandler(&aoErrors);
5214     }
5215 #endif
5216     bool bRet = (GDALVectorTranslate(NULL, dstDS, 1, &srcDS, options, &usageError) != NULL);
5217     if( bFreeOptions )
5218         GDALVectorTranslateOptionsFree(options);
5219 #ifdef SWIGPYTHON
5220     if( bUseExceptions )
5221     {
5222         PopStackingErrorHandler(&aoErrors, bRet);
5223     }
5224 #endif
5225     return bRet;
5226 }
5227 
5228 
wrapper_GDALVectorTranslateDestName(const char * dest,GDALDatasetShadow * srcDS,GDALVectorTranslateOptions * options,GDALProgressFunc callback=NULL,void * callback_data=NULL)5229 GDALDatasetShadow* wrapper_GDALVectorTranslateDestName( const char* dest,
5230                                              GDALDatasetShadow* srcDS,
5231                                              GDALVectorTranslateOptions* options,
5232                                              GDALProgressFunc callback=NULL,
5233                                              void* callback_data=NULL)
5234 {
5235     int usageError; /* ignored */
5236     bool bFreeOptions = false;
5237     if( callback )
5238     {
5239         if( options == NULL )
5240         {
5241             bFreeOptions = true;
5242             options = GDALVectorTranslateOptionsNew(NULL, NULL);
5243         }
5244         GDALVectorTranslateOptionsSetProgress(options, callback, callback_data);
5245     }
5246 #ifdef SWIGPYTHON
5247     std::vector<ErrorStruct> aoErrors;
5248     if( bUseExceptions )
5249     {
5250         PushStackingErrorHandler(&aoErrors);
5251     }
5252 #endif
5253     GDALDatasetH hDSRet = GDALVectorTranslate(dest, NULL, 1, &srcDS, options, &usageError);
5254     if( bFreeOptions )
5255         GDALVectorTranslateOptionsFree(options);
5256 #ifdef SWIGPYTHON
5257     if( bUseExceptions )
5258     {
5259         PopStackingErrorHandler(&aoErrors, hDSRet != NULL);
5260     }
5261 #endif
5262     return hDSRet;
5263 }
5264 
new_GDALDEMProcessingOptions(char ** options)5265 SWIGINTERN GDALDEMProcessingOptions *new_GDALDEMProcessingOptions(char **options){
5266         return GDALDEMProcessingOptionsNew(options, NULL);
5267     }
delete_GDALDEMProcessingOptions(GDALDEMProcessingOptions * self)5268 SWIGINTERN void delete_GDALDEMProcessingOptions(GDALDEMProcessingOptions *self){
5269         GDALDEMProcessingOptionsFree( self );
5270     }
5271 
wrapper_GDALDEMProcessing(const char * dest,GDALDatasetShadow * dataset,const char * pszProcessing,const char * pszColorFilename,GDALDEMProcessingOptions * options,GDALProgressFunc callback=NULL,void * callback_data=NULL)5272 GDALDatasetShadow* wrapper_GDALDEMProcessing( const char* dest,
5273                                       GDALDatasetShadow* dataset,
5274                                       const char* pszProcessing,
5275                                       const char* pszColorFilename,
5276                                       GDALDEMProcessingOptions* options,
5277                                       GDALProgressFunc callback=NULL,
5278                                       void* callback_data=NULL)
5279 {
5280     int usageError; /* ignored */
5281     bool bFreeOptions = false;
5282     if( callback )
5283     {
5284         if( options == NULL )
5285         {
5286             bFreeOptions = true;
5287             options = GDALDEMProcessingOptionsNew(NULL, NULL);
5288         }
5289         GDALDEMProcessingOptionsSetProgress(options, callback, callback_data);
5290     }
5291 #ifdef SWIGPYTHON
5292     std::vector<ErrorStruct> aoErrors;
5293     if( bUseExceptions )
5294     {
5295         PushStackingErrorHandler(&aoErrors);
5296     }
5297 #endif
5298     GDALDatasetH hDSRet = GDALDEMProcessing(dest, dataset, pszProcessing, pszColorFilename, options, &usageError);
5299     if( bFreeOptions )
5300         GDALDEMProcessingOptionsFree(options);
5301 #ifdef SWIGPYTHON
5302     if( bUseExceptions )
5303     {
5304         PopStackingErrorHandler(&aoErrors, hDSRet != NULL);
5305     }
5306 #endif
5307     return hDSRet;
5308 }
5309 
new_GDALNearblackOptions(char ** options)5310 SWIGINTERN GDALNearblackOptions *new_GDALNearblackOptions(char **options){
5311         return GDALNearblackOptionsNew(options, NULL);
5312     }
delete_GDALNearblackOptions(GDALNearblackOptions * self)5313 SWIGINTERN void delete_GDALNearblackOptions(GDALNearblackOptions *self){
5314         GDALNearblackOptionsFree( self );
5315     }
5316 
wrapper_GDALNearblackDestDS(GDALDatasetShadow * dstDS,GDALDatasetShadow * srcDS,GDALNearblackOptions * options,GDALProgressFunc callback=NULL,void * callback_data=NULL)5317 int wrapper_GDALNearblackDestDS( GDALDatasetShadow* dstDS,
5318                             GDALDatasetShadow* srcDS,
5319                             GDALNearblackOptions* options,
5320                             GDALProgressFunc callback=NULL,
5321                             void* callback_data=NULL)
5322 {
5323     int usageError; /* ignored */
5324     bool bFreeOptions = false;
5325     if( callback )
5326     {
5327         if( options == NULL )
5328         {
5329             bFreeOptions = true;
5330             options = GDALNearblackOptionsNew(NULL, NULL);
5331         }
5332         GDALNearblackOptionsSetProgress(options, callback, callback_data);
5333     }
5334 #ifdef SWIGPYTHON
5335     std::vector<ErrorStruct> aoErrors;
5336     if( bUseExceptions )
5337     {
5338         PushStackingErrorHandler(&aoErrors);
5339     }
5340 #endif
5341     bool bRet = (GDALNearblack(NULL, dstDS, srcDS, options, &usageError) != NULL);
5342     if( bFreeOptions )
5343         GDALNearblackOptionsFree(options);
5344 #ifdef SWIGPYTHON
5345     if( bUseExceptions )
5346     {
5347         PopStackingErrorHandler(&aoErrors, bRet);
5348     }
5349 #endif
5350     return bRet;
5351 }
5352 
5353 
wrapper_GDALNearblackDestName(const char * dest,GDALDatasetShadow * srcDS,GDALNearblackOptions * options,GDALProgressFunc callback=NULL,void * callback_data=NULL)5354 GDALDatasetShadow* wrapper_GDALNearblackDestName( const char* dest,
5355                                              GDALDatasetShadow* srcDS,
5356                                              GDALNearblackOptions* options,
5357                                              GDALProgressFunc callback=NULL,
5358                                              void* callback_data=NULL)
5359 {
5360     int usageError; /* ignored */
5361     bool bFreeOptions = false;
5362     if( callback )
5363     {
5364         if( options == NULL )
5365         {
5366             bFreeOptions = true;
5367             options = GDALNearblackOptionsNew(NULL, NULL);
5368         }
5369         GDALNearblackOptionsSetProgress(options, callback, callback_data);
5370     }
5371 #ifdef SWIGPYTHON
5372     std::vector<ErrorStruct> aoErrors;
5373     if( bUseExceptions )
5374     {
5375         PushStackingErrorHandler(&aoErrors);
5376     }
5377 #endif
5378     GDALDatasetH hDSRet = GDALNearblack(dest, NULL, srcDS, options, &usageError);
5379     if( bFreeOptions )
5380         GDALNearblackOptionsFree(options);
5381 #ifdef SWIGPYTHON
5382     if( bUseExceptions )
5383     {
5384         PopStackingErrorHandler(&aoErrors, hDSRet != NULL);
5385     }
5386 #endif
5387     return hDSRet;
5388 }
5389 
new_GDALGridOptions(char ** options)5390 SWIGINTERN GDALGridOptions *new_GDALGridOptions(char **options){
5391         return GDALGridOptionsNew(options, NULL);
5392     }
delete_GDALGridOptions(GDALGridOptions * self)5393 SWIGINTERN void delete_GDALGridOptions(GDALGridOptions *self){
5394         GDALGridOptionsFree( self );
5395     }
5396 
wrapper_GDALGrid(const char * dest,GDALDatasetShadow * dataset,GDALGridOptions * options,GDALProgressFunc callback=NULL,void * callback_data=NULL)5397 GDALDatasetShadow* wrapper_GDALGrid( const char* dest,
5398                                       GDALDatasetShadow* dataset,
5399                                       GDALGridOptions* options,
5400                                       GDALProgressFunc callback=NULL,
5401                                       void* callback_data=NULL)
5402 {
5403     int usageError; /* ignored */
5404     bool bFreeOptions = false;
5405     if( callback )
5406     {
5407         if( options == NULL )
5408         {
5409             bFreeOptions = true;
5410             options = GDALGridOptionsNew(NULL, NULL);
5411         }
5412         GDALGridOptionsSetProgress(options, callback, callback_data);
5413     }
5414 #ifdef SWIGPYTHON
5415     std::vector<ErrorStruct> aoErrors;
5416     if( bUseExceptions )
5417     {
5418         PushStackingErrorHandler(&aoErrors);
5419     }
5420 #endif
5421     GDALDatasetH hDSRet = GDALGrid(dest, dataset, options, &usageError);
5422     if( bFreeOptions )
5423         GDALGridOptionsFree(options);
5424 #ifdef SWIGPYTHON
5425     if( bUseExceptions )
5426     {
5427         PopStackingErrorHandler(&aoErrors, hDSRet != NULL);
5428     }
5429 #endif
5430     return hDSRet;
5431 }
5432 
new_GDALRasterizeOptions(char ** options)5433 SWIGINTERN GDALRasterizeOptions *new_GDALRasterizeOptions(char **options){
5434         return GDALRasterizeOptionsNew(options, NULL);
5435     }
delete_GDALRasterizeOptions(GDALRasterizeOptions * self)5436 SWIGINTERN void delete_GDALRasterizeOptions(GDALRasterizeOptions *self){
5437         GDALRasterizeOptionsFree( self );
5438     }
5439 
wrapper_GDALRasterizeDestDS(GDALDatasetShadow * dstDS,GDALDatasetShadow * srcDS,GDALRasterizeOptions * options,GDALProgressFunc callback=NULL,void * callback_data=NULL)5440 int wrapper_GDALRasterizeDestDS( GDALDatasetShadow* dstDS,
5441                             GDALDatasetShadow* srcDS,
5442                             GDALRasterizeOptions* options,
5443                             GDALProgressFunc callback=NULL,
5444                             void* callback_data=NULL)
5445 {
5446     int usageError; /* ignored */
5447     bool bFreeOptions = false;
5448     if( callback )
5449     {
5450         if( options == NULL )
5451         {
5452             bFreeOptions = true;
5453             options = GDALRasterizeOptionsNew(NULL, NULL);
5454         }
5455         GDALRasterizeOptionsSetProgress(options, callback, callback_data);
5456     }
5457 #ifdef SWIGPYTHON
5458     std::vector<ErrorStruct> aoErrors;
5459     if( bUseExceptions )
5460     {
5461         PushStackingErrorHandler(&aoErrors);
5462     }
5463 #endif
5464     bool bRet = (GDALRasterize(NULL, dstDS, srcDS, options, &usageError) != NULL);
5465     if( bFreeOptions )
5466         GDALRasterizeOptionsFree(options);
5467 #ifdef SWIGPYTHON
5468     if( bUseExceptions )
5469     {
5470         PopStackingErrorHandler(&aoErrors, bRet);
5471     }
5472 #endif
5473     return bRet;
5474 }
5475 
5476 
wrapper_GDALRasterizeDestName(const char * dest,GDALDatasetShadow * srcDS,GDALRasterizeOptions * options,GDALProgressFunc callback=NULL,void * callback_data=NULL)5477 GDALDatasetShadow* wrapper_GDALRasterizeDestName( const char* dest,
5478                                              GDALDatasetShadow* srcDS,
5479                                              GDALRasterizeOptions* options,
5480                                              GDALProgressFunc callback=NULL,
5481                                              void* callback_data=NULL)
5482 {
5483     int usageError; /* ignored */
5484     bool bFreeOptions = false;
5485     if( callback )
5486     {
5487         if( options == NULL )
5488         {
5489             bFreeOptions = true;
5490             options = GDALRasterizeOptionsNew(NULL, NULL);
5491         }
5492         GDALRasterizeOptionsSetProgress(options, callback, callback_data);
5493     }
5494 #ifdef SWIGPYTHON
5495     std::vector<ErrorStruct> aoErrors;
5496     if( bUseExceptions )
5497     {
5498         PushStackingErrorHandler(&aoErrors);
5499     }
5500 #endif
5501     GDALDatasetH hDSRet = GDALRasterize(dest, NULL, srcDS, options, &usageError);
5502     if( bFreeOptions )
5503         GDALRasterizeOptionsFree(options);
5504 #ifdef SWIGPYTHON
5505     if( bUseExceptions )
5506     {
5507         PopStackingErrorHandler(&aoErrors, hDSRet != NULL);
5508     }
5509 #endif
5510     return hDSRet;
5511 }
5512 
new_GDALBuildVRTOptions(char ** options)5513 SWIGINTERN GDALBuildVRTOptions *new_GDALBuildVRTOptions(char **options){
5514         return GDALBuildVRTOptionsNew(options, NULL);
5515     }
delete_GDALBuildVRTOptions(GDALBuildVRTOptions * self)5516 SWIGINTERN void delete_GDALBuildVRTOptions(GDALBuildVRTOptions *self){
5517         GDALBuildVRTOptionsFree( self );
5518     }
5519 
wrapper_GDALBuildVRT_objects(const char * dest,int object_list_count,GDALDatasetShadow ** poObjects,GDALBuildVRTOptions * options,GDALProgressFunc callback=NULL,void * callback_data=NULL)5520 GDALDatasetShadow* wrapper_GDALBuildVRT_objects( const char* dest,
5521                                              int object_list_count, GDALDatasetShadow** poObjects,
5522                                              GDALBuildVRTOptions* options,
5523                                              GDALProgressFunc callback=NULL,
5524                                              void* callback_data=NULL)
5525 {
5526     int usageError; /* ignored */
5527     bool bFreeOptions = false;
5528     if( callback )
5529     {
5530         if( options == NULL )
5531         {
5532             bFreeOptions = true;
5533             options = GDALBuildVRTOptionsNew(NULL, NULL);
5534         }
5535         GDALBuildVRTOptionsSetProgress(options, callback, callback_data);
5536     }
5537 #ifdef SWIGPYTHON
5538     std::vector<ErrorStruct> aoErrors;
5539     if( bUseExceptions )
5540     {
5541         PushStackingErrorHandler(&aoErrors);
5542     }
5543 #endif
5544     GDALDatasetH hDSRet = GDALBuildVRT(dest, object_list_count, poObjects, NULL, options, &usageError);
5545     if( bFreeOptions )
5546         GDALBuildVRTOptionsFree(options);
5547 #ifdef SWIGPYTHON
5548     if( bUseExceptions )
5549     {
5550         PopStackingErrorHandler(&aoErrors, hDSRet != NULL);
5551     }
5552 #endif
5553     return hDSRet;
5554 }
5555 
5556 
wrapper_GDALBuildVRT_names(const char * dest,char ** source_filenames,GDALBuildVRTOptions * options,GDALProgressFunc callback=NULL,void * callback_data=NULL)5557 GDALDatasetShadow* wrapper_GDALBuildVRT_names( const char* dest,
5558                                          char ** source_filenames,
5559                                          GDALBuildVRTOptions* options,
5560                                          GDALProgressFunc callback=NULL,
5561                                          void* callback_data=NULL)
5562 {
5563     int usageError; /* ignored */
5564     bool bFreeOptions = false;
5565     if( callback )
5566     {
5567         if( options == NULL )
5568         {
5569             bFreeOptions = true;
5570             options = GDALBuildVRTOptionsNew(NULL, NULL);
5571         }
5572         GDALBuildVRTOptionsSetProgress(options, callback, callback_data);
5573     }
5574 #ifdef SWIGPYTHON
5575     std::vector<ErrorStruct> aoErrors;
5576     if( bUseExceptions )
5577     {
5578         PushStackingErrorHandler(&aoErrors);
5579     }
5580 #endif
5581     GDALDatasetH hDSRet = GDALBuildVRT(dest, CSLCount(source_filenames), NULL, source_filenames, options, &usageError);
5582     if( bFreeOptions )
5583         GDALBuildVRTOptionsFree(options);
5584 #ifdef SWIGPYTHON
5585     if( bUseExceptions )
5586     {
5587         PopStackingErrorHandler(&aoErrors, hDSRet != NULL);
5588     }
5589 #endif
5590     return hDSRet;
5591 }
5592 
new_GDALMultiDimTranslateOptions(char ** options)5593 SWIGINTERN GDALMultiDimTranslateOptions *new_GDALMultiDimTranslateOptions(char **options){
5594         return GDALMultiDimTranslateOptionsNew(options, NULL);
5595     }
delete_GDALMultiDimTranslateOptions(GDALMultiDimTranslateOptions * self)5596 SWIGINTERN void delete_GDALMultiDimTranslateOptions(GDALMultiDimTranslateOptions *self){
5597         GDALMultiDimTranslateOptionsFree( self );
5598     }
5599 
wrapper_GDALMultiDimTranslateDestName(const char * dest,int object_list_count,GDALDatasetShadow ** poObjects,GDALMultiDimTranslateOptions * multiDimTranslateOptions,GDALProgressFunc callback=NULL,void * callback_data=NULL)5600 GDALDatasetShadow* wrapper_GDALMultiDimTranslateDestName( const char* dest,
5601                                              int object_list_count, GDALDatasetShadow** poObjects,
5602                                              GDALMultiDimTranslateOptions* multiDimTranslateOptions,
5603                                              GDALProgressFunc callback=NULL,
5604                                              void* callback_data=NULL)
5605 {
5606     int usageError; /* ignored */
5607     bool bFreeOptions = false;
5608     if( callback )
5609     {
5610         if( multiDimTranslateOptions == NULL )
5611         {
5612             bFreeOptions = true;
5613             multiDimTranslateOptions = GDALMultiDimTranslateOptionsNew(NULL, NULL);
5614         }
5615         GDALMultiDimTranslateOptionsSetProgress(multiDimTranslateOptions, callback, callback_data);
5616     }
5617 #ifdef SWIGPYTHON
5618     std::vector<ErrorStruct> aoErrors;
5619     if( bUseExceptions )
5620     {
5621         PushStackingErrorHandler(&aoErrors);
5622     }
5623 #endif
5624     GDALDatasetH hDSRet = GDALMultiDimTranslate(dest, NULL, object_list_count, poObjects, multiDimTranslateOptions, &usageError);
5625     if( bFreeOptions )
5626         GDALMultiDimTranslateOptionsFree(multiDimTranslateOptions);
5627 #ifdef SWIGPYTHON
5628     if( bUseExceptions )
5629     {
5630         PopStackingErrorHandler(&aoErrors, hDSRet != NULL);
5631     }
5632 #endif
5633     return hDSRet;
5634 }
5635 
5636 #ifdef __cplusplus
5637 extern "C" {
5638 #endif
5639 
5640 #ifdef PERL_OBJECT
5641 #define MAGIC_CLASS _wrap_Geo__GDAL_var::
5642 class _wrap_Geo__GDAL_var : public CPerlObj {
5643 public:
5644 #else
5645 #define MAGIC_CLASS
5646 #endif
swig_magic_readonly(pTHX_ SV * SWIGUNUSEDPARM (sv),MAGIC * SWIGUNUSEDPARM (mg))5647 SWIGCLASS_STATIC int swig_magic_readonly(pTHX_ SV *SWIGUNUSEDPARM(sv), MAGIC *SWIGUNUSEDPARM(mg)) {
5648     MAGIC_PPERL
5649     croak("Value is read-only.");
5650     return 0;
5651 }
5652 
5653 
5654 #ifdef PERL_OBJECT
5655 };
5656 #endif
5657 
5658 #ifdef __cplusplus
5659 }
5660 #endif
5661 
5662 #ifdef __cplusplus
5663 extern "C" {
5664 #endif
XS(_wrap_UseExceptions)5665 XS(_wrap_UseExceptions) {
5666   {
5667     int argvi = 0;
5668     dXSARGS;
5669 
5670     if ((items < 0) || (items > 0)) {
5671       SWIG_croak("Usage: UseExceptions();");
5672     }
5673     UseExceptions();
5674     ST(argvi) = sv_newmortal();
5675     XSRETURN(argvi);
5676   fail:
5677     SWIG_croak_null();
5678   }
5679 }
5680 
5681 
XS(_wrap_DontUseExceptions)5682 XS(_wrap_DontUseExceptions) {
5683   {
5684     int argvi = 0;
5685     dXSARGS;
5686 
5687     if ((items < 0) || (items > 0)) {
5688       SWIG_croak("Usage: DontUseExceptions();");
5689     }
5690     DontUseExceptions();
5691     ST(argvi) = sv_newmortal();
5692     XSRETURN(argvi);
5693   fail:
5694     SWIG_croak_null();
5695   }
5696 }
5697 
5698 
XS(_wrap_Debug)5699 XS(_wrap_Debug) {
5700   {
5701     char *arg1 = (char *) 0 ;
5702     char *arg2 = (char *) 0 ;
5703     int res1 ;
5704     char *buf1 = 0 ;
5705     int alloc1 = 0 ;
5706     int res2 ;
5707     char *buf2 = 0 ;
5708     int alloc2 = 0 ;
5709     int argvi = 0;
5710     dXSARGS;
5711 
5712     if ((items < 2) || (items > 2)) {
5713       SWIG_croak("Usage: Debug(msg_class,message);");
5714     }
5715     res1 = SWIG_AsCharPtrAndSize(ST(0), &buf1, NULL, &alloc1);
5716     if (!SWIG_IsOK(res1)) {
5717       SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Debug" "', argument " "1"" of type '" "char const *""'");
5718     }
5719     arg1 = reinterpret_cast< char * >(buf1);
5720     res2 = SWIG_AsCharPtrAndSize(ST(1), &buf2, NULL, &alloc2);
5721     if (!SWIG_IsOK(res2)) {
5722       SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Debug" "', argument " "2"" of type '" "char const *""'");
5723     }
5724     arg2 = reinterpret_cast< char * >(buf2);
5725     {
5726       if (!arg2) {
5727         SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
5728       }
5729     }
5730     {
5731       CPLErrorReset();
5732       Debug((char const *)arg1,(char const *)arg2);
5733       CPLErr eclass = CPLGetLastErrorType();
5734       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
5735         do_confess( CPLGetLastErrorMsg(), 0 );
5736 
5737 
5738 
5739 
5740 
5741       }
5742 
5743 
5744       /*
5745           Make warnings regular Perl warnings. This duplicates the warning
5746           message if DontUseExceptions() is in effect (it is not by default).
5747           */
5748       if ( eclass == CE_Warning ) {
5749         warn( CPLGetLastErrorMsg(), "%s" );
5750       }
5751 
5752 
5753     }
5754     {
5755       /* %typemap(out) void */
5756     }
5757     if (alloc1 == SWIG_NEWOBJ) delete[] buf1;
5758     if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
5759     XSRETURN(argvi);
5760   fail:
5761     if (alloc1 == SWIG_NEWOBJ) delete[] buf1;
5762     if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
5763     SWIG_croak_null();
5764   }
5765 }
5766 
5767 
XS(_wrap_SetErrorHandler)5768 XS(_wrap_SetErrorHandler) {
5769   {
5770     CPLErrorHandler arg1 = (CPLErrorHandler) NULL ;
5771     void *arg2 = (void *) NULL ;
5772     void *argp1 ;
5773     int res1 = 0 ;
5774     int res2 ;
5775     int argvi = 0;
5776     CPLErr result;
5777     dXSARGS;
5778 
5779     if ((items < 0) || (items > 2)) {
5780       SWIG_croak("Usage: SetErrorHandler(pfnErrorHandler,user_data);");
5781     }
5782     if (items > 0) {
5783       {
5784         res1 = SWIG_ConvertPtr(ST(0), &argp1, SWIGTYPE_p_CPLErrorHandler,  0 );
5785         if (!SWIG_IsOK(res1)) {
5786           SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SetErrorHandler" "', argument " "1"" of type '" "CPLErrorHandler""'");
5787         }
5788         if (!argp1) {
5789           SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "SetErrorHandler" "', argument " "1"" of type '" "CPLErrorHandler""'");
5790         } else {
5791           arg1 = *(reinterpret_cast< CPLErrorHandler * >(argp1));
5792         }
5793       }
5794     }
5795     if (items > 1) {
5796       res2 = SWIG_ConvertPtr(ST(1),SWIG_as_voidptrptr(&arg2), 0, 0);
5797       if (!SWIG_IsOK(res2)) {
5798         SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "SetErrorHandler" "', argument " "2"" of type '" "void *""'");
5799       }
5800     }
5801     {
5802       CPLErrorReset();
5803       result = (CPLErr)SetErrorHandler(arg1,arg2);
5804       CPLErr eclass = CPLGetLastErrorType();
5805       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
5806         do_confess( CPLGetLastErrorMsg(), 0 );
5807 
5808 
5809 
5810 
5811 
5812       }
5813 
5814 
5815       /*
5816           Make warnings regular Perl warnings. This duplicates the warning
5817           message if DontUseExceptions() is in effect (it is not by default).
5818           */
5819       if ( eclass == CE_Warning ) {
5820         warn( CPLGetLastErrorMsg(), "%s" );
5821       }
5822 
5823 
5824     }
5825     {
5826       /* %typemap(out) CPLErr */
5827     }
5828 
5829     XSRETURN(argvi);
5830   fail:
5831 
5832     SWIG_croak_null();
5833   }
5834 }
5835 
5836 
XS(_wrap_SetCurrentErrorHandlerCatchDebug)5837 XS(_wrap_SetCurrentErrorHandlerCatchDebug) {
5838   {
5839     int arg1 ;
5840     int val1 ;
5841     int ecode1 = 0 ;
5842     int argvi = 0;
5843     dXSARGS;
5844 
5845     if ((items < 1) || (items > 1)) {
5846       SWIG_croak("Usage: SetCurrentErrorHandlerCatchDebug(bCatchDebug);");
5847     }
5848     ecode1 = SWIG_AsVal_int SWIG_PERL_CALL_ARGS_2(ST(0), &val1);
5849     if (!SWIG_IsOK(ecode1)) {
5850       SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "SetCurrentErrorHandlerCatchDebug" "', argument " "1"" of type '" "int""'");
5851     }
5852     arg1 = static_cast< int >(val1);
5853     {
5854       CPLErrorReset();
5855       CPLSetCurrentErrorHandlerCatchDebug(arg1);
5856       CPLErr eclass = CPLGetLastErrorType();
5857       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
5858         do_confess( CPLGetLastErrorMsg(), 0 );
5859 
5860 
5861 
5862 
5863 
5864       }
5865 
5866 
5867       /*
5868           Make warnings regular Perl warnings. This duplicates the warning
5869           message if DontUseExceptions() is in effect (it is not by default).
5870           */
5871       if ( eclass == CE_Warning ) {
5872         warn( CPLGetLastErrorMsg(), "%s" );
5873       }
5874 
5875 
5876     }
5877     {
5878       /* %typemap(out) void */
5879     }
5880 
5881     XSRETURN(argvi);
5882   fail:
5883 
5884     SWIG_croak_null();
5885   }
5886 }
5887 
5888 
XS(_wrap_PushErrorHandler__SWIG_0)5889 XS(_wrap_PushErrorHandler__SWIG_0) {
5890   {
5891     char *arg1 = (char *) NULL ;
5892     int res1 ;
5893     char *buf1 = 0 ;
5894     int alloc1 = 0 ;
5895     int argvi = 0;
5896     CPLErr result;
5897     dXSARGS;
5898 
5899     if ((items < 0) || (items > 1)) {
5900       SWIG_croak("Usage: PushErrorHandler(pszCallbackName);");
5901     }
5902     if (items > 0) {
5903       res1 = SWIG_AsCharPtrAndSize(ST(0), &buf1, NULL, &alloc1);
5904       if (!SWIG_IsOK(res1)) {
5905         SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "PushErrorHandler" "', argument " "1"" of type '" "char const *""'");
5906       }
5907       arg1 = reinterpret_cast< char * >(buf1);
5908     }
5909     {
5910       CPLErrorReset();
5911       result = (CPLErr)PushErrorHandler((char const *)arg1);
5912       CPLErr eclass = CPLGetLastErrorType();
5913       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
5914         do_confess( CPLGetLastErrorMsg(), 0 );
5915 
5916 
5917 
5918 
5919 
5920       }
5921 
5922 
5923       /*
5924           Make warnings regular Perl warnings. This duplicates the warning
5925           message if DontUseExceptions() is in effect (it is not by default).
5926           */
5927       if ( eclass == CE_Warning ) {
5928         warn( CPLGetLastErrorMsg(), "%s" );
5929       }
5930 
5931 
5932     }
5933     {
5934       /* %typemap(out) CPLErr */
5935     }
5936     if (alloc1 == SWIG_NEWOBJ) delete[] buf1;
5937     XSRETURN(argvi);
5938   fail:
5939     if (alloc1 == SWIG_NEWOBJ) delete[] buf1;
5940     SWIG_croak_null();
5941   }
5942 }
5943 
5944 
XS(_wrap_Error)5945 XS(_wrap_Error) {
5946   {
5947     CPLErr arg1 = (CPLErr) CE_Failure ;
5948     int arg2 = (int) 0 ;
5949     char *arg3 = (char *) "error" ;
5950     int val1 ;
5951     int ecode1 = 0 ;
5952     int val2 ;
5953     int ecode2 = 0 ;
5954     int res3 ;
5955     char *buf3 = 0 ;
5956     int alloc3 = 0 ;
5957     int argvi = 0;
5958     dXSARGS;
5959 
5960     if ((items < 0) || (items > 3)) {
5961       SWIG_croak("Usage: Error(msg_class,err_code,msg);");
5962     }
5963     if (items > 0) {
5964       ecode1 = SWIG_AsVal_int SWIG_PERL_CALL_ARGS_2(ST(0), &val1);
5965       if (!SWIG_IsOK(ecode1)) {
5966         SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "Error" "', argument " "1"" of type '" "CPLErr""'");
5967       }
5968       arg1 = static_cast< CPLErr >(val1);
5969     }
5970     if (items > 1) {
5971       ecode2 = SWIG_AsVal_int SWIG_PERL_CALL_ARGS_2(ST(1), &val2);
5972       if (!SWIG_IsOK(ecode2)) {
5973         SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Error" "', argument " "2"" of type '" "int""'");
5974       }
5975       arg2 = static_cast< int >(val2);
5976     }
5977     if (items > 2) {
5978       res3 = SWIG_AsCharPtrAndSize(ST(2), &buf3, NULL, &alloc3);
5979       if (!SWIG_IsOK(res3)) {
5980         SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "Error" "', argument " "3"" of type '" "char const *""'");
5981       }
5982       arg3 = reinterpret_cast< char * >(buf3);
5983     }
5984     {
5985       CPLErrorReset();
5986       Error(arg1,arg2,(char const *)arg3);
5987       CPLErr eclass = CPLGetLastErrorType();
5988       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
5989         do_confess( CPLGetLastErrorMsg(), 0 );
5990 
5991 
5992 
5993 
5994 
5995       }
5996 
5997 
5998       /*
5999           Make warnings regular Perl warnings. This duplicates the warning
6000           message if DontUseExceptions() is in effect (it is not by default).
6001           */
6002       if ( eclass == CE_Warning ) {
6003         warn( CPLGetLastErrorMsg(), "%s" );
6004       }
6005 
6006 
6007     }
6008     {
6009       /* %typemap(out) void */
6010     }
6011 
6012 
6013     if (alloc3 == SWIG_NEWOBJ) delete[] buf3;
6014     XSRETURN(argvi);
6015   fail:
6016 
6017 
6018     if (alloc3 == SWIG_NEWOBJ) delete[] buf3;
6019     SWIG_croak_null();
6020   }
6021 }
6022 
6023 
XS(_wrap_GOA2GetAuthorizationURL)6024 XS(_wrap_GOA2GetAuthorizationURL) {
6025   {
6026     char *arg1 = (char *) 0 ;
6027     int res1 ;
6028     char *buf1 = 0 ;
6029     int alloc1 = 0 ;
6030     int argvi = 0;
6031     retStringAndCPLFree *result = 0 ;
6032     dXSARGS;
6033 
6034     if ((items < 1) || (items > 1)) {
6035       SWIG_croak("Usage: GOA2GetAuthorizationURL(pszScope);");
6036     }
6037     res1 = SWIG_AsCharPtrAndSize(ST(0), &buf1, NULL, &alloc1);
6038     if (!SWIG_IsOK(res1)) {
6039       SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "GOA2GetAuthorizationURL" "', argument " "1"" of type '" "char const *""'");
6040     }
6041     arg1 = reinterpret_cast< char * >(buf1);
6042     {
6043       if (!arg1) {
6044         SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
6045       }
6046     }
6047     {
6048       CPLErrorReset();
6049       result = (retStringAndCPLFree *)GOA2GetAuthorizationURL((char const *)arg1);
6050       CPLErr eclass = CPLGetLastErrorType();
6051       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
6052         do_confess( CPLGetLastErrorMsg(), 0 );
6053 
6054 
6055 
6056 
6057 
6058       }
6059 
6060 
6061       /*
6062           Make warnings regular Perl warnings. This duplicates the warning
6063           message if DontUseExceptions() is in effect (it is not by default).
6064           */
6065       if ( eclass == CE_Warning ) {
6066         warn( CPLGetLastErrorMsg(), "%s" );
6067       }
6068 
6069 
6070     }
6071 
6072     /* %typemap(out) (retStringAndCPLFree*) */
6073     if(result)
6074     {
6075       ST(argvi) = SWIG_FromCharPtr((const char *)result);
6076       CPLFree(result);
6077     }
6078     else
6079     {
6080       ST(argvi) = &PL_sv_undef;
6081     }
6082     argvi++ ;
6083 
6084     if (alloc1 == SWIG_NEWOBJ) delete[] buf1;
6085     XSRETURN(argvi);
6086   fail:
6087     if (alloc1 == SWIG_NEWOBJ) delete[] buf1;
6088     SWIG_croak_null();
6089   }
6090 }
6091 
6092 
XS(_wrap_GOA2GetRefreshToken)6093 XS(_wrap_GOA2GetRefreshToken) {
6094   {
6095     char *arg1 = (char *) 0 ;
6096     char *arg2 = (char *) 0 ;
6097     int res1 ;
6098     char *buf1 = 0 ;
6099     int alloc1 = 0 ;
6100     int res2 ;
6101     char *buf2 = 0 ;
6102     int alloc2 = 0 ;
6103     int argvi = 0;
6104     retStringAndCPLFree *result = 0 ;
6105     dXSARGS;
6106 
6107     if ((items < 2) || (items > 2)) {
6108       SWIG_croak("Usage: GOA2GetRefreshToken(pszAuthToken,pszScope);");
6109     }
6110     res1 = SWIG_AsCharPtrAndSize(ST(0), &buf1, NULL, &alloc1);
6111     if (!SWIG_IsOK(res1)) {
6112       SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "GOA2GetRefreshToken" "', argument " "1"" of type '" "char const *""'");
6113     }
6114     arg1 = reinterpret_cast< char * >(buf1);
6115     res2 = SWIG_AsCharPtrAndSize(ST(1), &buf2, NULL, &alloc2);
6116     if (!SWIG_IsOK(res2)) {
6117       SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "GOA2GetRefreshToken" "', argument " "2"" of type '" "char const *""'");
6118     }
6119     arg2 = reinterpret_cast< char * >(buf2);
6120     {
6121       if (!arg1) {
6122         SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
6123       }
6124     }
6125     {
6126       CPLErrorReset();
6127       result = (retStringAndCPLFree *)GOA2GetRefreshToken((char const *)arg1,(char const *)arg2);
6128       CPLErr eclass = CPLGetLastErrorType();
6129       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
6130         do_confess( CPLGetLastErrorMsg(), 0 );
6131 
6132 
6133 
6134 
6135 
6136       }
6137 
6138 
6139       /*
6140           Make warnings regular Perl warnings. This duplicates the warning
6141           message if DontUseExceptions() is in effect (it is not by default).
6142           */
6143       if ( eclass == CE_Warning ) {
6144         warn( CPLGetLastErrorMsg(), "%s" );
6145       }
6146 
6147 
6148     }
6149 
6150     /* %typemap(out) (retStringAndCPLFree*) */
6151     if(result)
6152     {
6153       ST(argvi) = SWIG_FromCharPtr((const char *)result);
6154       CPLFree(result);
6155     }
6156     else
6157     {
6158       ST(argvi) = &PL_sv_undef;
6159     }
6160     argvi++ ;
6161 
6162     if (alloc1 == SWIG_NEWOBJ) delete[] buf1;
6163     if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
6164     XSRETURN(argvi);
6165   fail:
6166     if (alloc1 == SWIG_NEWOBJ) delete[] buf1;
6167     if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
6168     SWIG_croak_null();
6169   }
6170 }
6171 
6172 
XS(_wrap_GOA2GetAccessToken)6173 XS(_wrap_GOA2GetAccessToken) {
6174   {
6175     char *arg1 = (char *) 0 ;
6176     char *arg2 = (char *) 0 ;
6177     int res1 ;
6178     char *buf1 = 0 ;
6179     int alloc1 = 0 ;
6180     int res2 ;
6181     char *buf2 = 0 ;
6182     int alloc2 = 0 ;
6183     int argvi = 0;
6184     retStringAndCPLFree *result = 0 ;
6185     dXSARGS;
6186 
6187     if ((items < 2) || (items > 2)) {
6188       SWIG_croak("Usage: GOA2GetAccessToken(pszRefreshToken,pszScope);");
6189     }
6190     res1 = SWIG_AsCharPtrAndSize(ST(0), &buf1, NULL, &alloc1);
6191     if (!SWIG_IsOK(res1)) {
6192       SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "GOA2GetAccessToken" "', argument " "1"" of type '" "char const *""'");
6193     }
6194     arg1 = reinterpret_cast< char * >(buf1);
6195     res2 = SWIG_AsCharPtrAndSize(ST(1), &buf2, NULL, &alloc2);
6196     if (!SWIG_IsOK(res2)) {
6197       SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "GOA2GetAccessToken" "', argument " "2"" of type '" "char const *""'");
6198     }
6199     arg2 = reinterpret_cast< char * >(buf2);
6200     {
6201       if (!arg1) {
6202         SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
6203       }
6204     }
6205     {
6206       CPLErrorReset();
6207       result = (retStringAndCPLFree *)GOA2GetAccessToken((char const *)arg1,(char const *)arg2);
6208       CPLErr eclass = CPLGetLastErrorType();
6209       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
6210         do_confess( CPLGetLastErrorMsg(), 0 );
6211 
6212 
6213 
6214 
6215 
6216       }
6217 
6218 
6219       /*
6220           Make warnings regular Perl warnings. This duplicates the warning
6221           message if DontUseExceptions() is in effect (it is not by default).
6222           */
6223       if ( eclass == CE_Warning ) {
6224         warn( CPLGetLastErrorMsg(), "%s" );
6225       }
6226 
6227 
6228     }
6229 
6230     /* %typemap(out) (retStringAndCPLFree*) */
6231     if(result)
6232     {
6233       ST(argvi) = SWIG_FromCharPtr((const char *)result);
6234       CPLFree(result);
6235     }
6236     else
6237     {
6238       ST(argvi) = &PL_sv_undef;
6239     }
6240     argvi++ ;
6241 
6242     if (alloc1 == SWIG_NEWOBJ) delete[] buf1;
6243     if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
6244     XSRETURN(argvi);
6245   fail:
6246     if (alloc1 == SWIG_NEWOBJ) delete[] buf1;
6247     if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
6248     SWIG_croak_null();
6249   }
6250 }
6251 
6252 
XS(_wrap_PushErrorHandler__SWIG_1)6253 XS(_wrap_PushErrorHandler__SWIG_1) {
6254   {
6255     CPLErrorHandler arg1 ;
6256     void *argp1 ;
6257     int res1 = 0 ;
6258     int argvi = 0;
6259     dXSARGS;
6260 
6261     if ((items < 1) || (items > 1)) {
6262       SWIG_croak("Usage: PushErrorHandler(CPLErrorHandler);");
6263     }
6264     {
6265       res1 = SWIG_ConvertPtr(ST(0), &argp1, SWIGTYPE_p_CPLErrorHandler,  0 );
6266       if (!SWIG_IsOK(res1)) {
6267         SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "PushErrorHandler" "', argument " "1"" of type '" "CPLErrorHandler""'");
6268       }
6269       if (!argp1) {
6270         SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "PushErrorHandler" "', argument " "1"" of type '" "CPLErrorHandler""'");
6271       } else {
6272         arg1 = *(reinterpret_cast< CPLErrorHandler * >(argp1));
6273       }
6274     }
6275     {
6276       CPLErrorReset();
6277       CPLPushErrorHandler(arg1);
6278       CPLErr eclass = CPLGetLastErrorType();
6279       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
6280         do_confess( CPLGetLastErrorMsg(), 0 );
6281 
6282 
6283 
6284 
6285 
6286       }
6287 
6288 
6289       /*
6290           Make warnings regular Perl warnings. This duplicates the warning
6291           message if DontUseExceptions() is in effect (it is not by default).
6292           */
6293       if ( eclass == CE_Warning ) {
6294         warn( CPLGetLastErrorMsg(), "%s" );
6295       }
6296 
6297 
6298     }
6299     {
6300       /* %typemap(out) void */
6301     }
6302     XSRETURN(argvi);
6303   fail:
6304     SWIG_croak_null();
6305   }
6306 }
6307 
6308 
XS(_wrap_PushErrorHandler)6309 XS(_wrap_PushErrorHandler) {
6310   dXSARGS;
6311 
6312   {
6313     unsigned long _index = 0;
6314     SWIG_TypeRank _rank = 0;
6315     if ((items >= 0) && (items <= 1)) {
6316       SWIG_TypeRank _ranki = 0;
6317       SWIG_TypeRank _rankm = 0;
6318       SWIG_TypeRank _pi = 1;
6319       int _v = 0;
6320       if (items > 0) {
6321         {
6322           int res = SWIG_AsCharPtrAndSize(ST(0), 0, NULL, 0);
6323           _v = SWIG_CheckState(res);
6324         }
6325         if (!_v) goto check_1;
6326         _ranki += _v*_pi;
6327         _rankm += _pi;
6328         _pi *= SWIG_MAXCASTRANK;
6329       }
6330       if (!_index || (_ranki < _rank)) {
6331         _rank = _ranki; _index = 1;
6332         if (_rank == _rankm) goto dispatch;
6333       }
6334     }
6335   check_1:
6336 
6337     if (items == 1) {
6338       SWIG_TypeRank _ranki = 0;
6339       SWIG_TypeRank _rankm = 0;
6340       SWIG_TypeRank _pi = 1;
6341       int _v = 0;
6342       {
6343         void *vptr = 0;
6344         int res = SWIG_ConvertPtr(ST(0), &vptr, SWIGTYPE_p_CPLErrorHandler, 0);
6345         _v = SWIG_CheckState(res);
6346       }
6347       if (!_v) goto check_2;
6348       _ranki += _v*_pi;
6349       _rankm += _pi;
6350       _pi *= SWIG_MAXCASTRANK;
6351       if (!_index || (_ranki < _rank)) {
6352         _rank = _ranki; _index = 2;
6353         if (_rank == _rankm) goto dispatch;
6354       }
6355     }
6356   check_2:
6357 
6358   dispatch:
6359     switch(_index) {
6360     case 1:
6361       PUSHMARK(MARK); SWIG_CALLXS(_wrap_PushErrorHandler__SWIG_0); return;
6362     case 2:
6363       PUSHMARK(MARK); SWIG_CALLXS(_wrap_PushErrorHandler__SWIG_1); return;
6364     }
6365   }
6366 
6367   croak("No matching function for overloaded 'PushErrorHandler'");
6368   XSRETURN(0);
6369 }
6370 
6371 
XS(_wrap_PopErrorHandler)6372 XS(_wrap_PopErrorHandler) {
6373   {
6374     int argvi = 0;
6375     dXSARGS;
6376 
6377     if ((items < 0) || (items > 0)) {
6378       SWIG_croak("Usage: PopErrorHandler();");
6379     }
6380     {
6381       CPLErrorReset();
6382       CPLPopErrorHandler();
6383       CPLErr eclass = CPLGetLastErrorType();
6384       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
6385         do_confess( CPLGetLastErrorMsg(), 0 );
6386 
6387 
6388 
6389 
6390 
6391       }
6392 
6393 
6394       /*
6395           Make warnings regular Perl warnings. This duplicates the warning
6396           message if DontUseExceptions() is in effect (it is not by default).
6397           */
6398       if ( eclass == CE_Warning ) {
6399         warn( CPLGetLastErrorMsg(), "%s" );
6400       }
6401 
6402 
6403     }
6404     {
6405       /* %typemap(out) void */
6406     }
6407     XSRETURN(argvi);
6408   fail:
6409     SWIG_croak_null();
6410   }
6411 }
6412 
6413 
XS(_wrap_ErrorReset)6414 XS(_wrap_ErrorReset) {
6415   {
6416     int argvi = 0;
6417     dXSARGS;
6418 
6419     if ((items < 0) || (items > 0)) {
6420       SWIG_croak("Usage: ErrorReset();");
6421     }
6422     {
6423       CPLErrorReset();
6424       CPLErrorReset();
6425       CPLErr eclass = CPLGetLastErrorType();
6426       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
6427         do_confess( CPLGetLastErrorMsg(), 0 );
6428 
6429 
6430 
6431 
6432 
6433       }
6434 
6435 
6436       /*
6437           Make warnings regular Perl warnings. This duplicates the warning
6438           message if DontUseExceptions() is in effect (it is not by default).
6439           */
6440       if ( eclass == CE_Warning ) {
6441         warn( CPLGetLastErrorMsg(), "%s" );
6442       }
6443 
6444 
6445     }
6446     {
6447       /* %typemap(out) void */
6448     }
6449     XSRETURN(argvi);
6450   fail:
6451     SWIG_croak_null();
6452   }
6453 }
6454 
6455 
XS(_wrap_EscapeString)6456 XS(_wrap_EscapeString) {
6457   {
6458     int arg1 ;
6459     char *arg2 = (char *) 0 ;
6460     int arg3 = (int) CPLES_SQL ;
6461     int val3 ;
6462     int ecode3 = 0 ;
6463     int argvi = 0;
6464     retStringAndCPLFree *result = 0 ;
6465     dXSARGS;
6466 
6467     if ((items < 1) || (items > 2)) {
6468       SWIG_croak("Usage: EscapeString(len,bin_string,scheme);");
6469     }
6470     {
6471       /* %typemap(in,numinputs=1) (int nLen, char *pBuf ) */
6472       if (SvOK(ST(0))) {
6473         SV *sv = ST(0);
6474         if (SvROK(sv) && SvTYPE(SvRV(sv)) < SVt_PVAV)
6475         sv = SvRV(sv);
6476         if (!SvPOK(sv))
6477         do_confess(NEED_BINARY_DATA, 1);
6478         STRLEN len = SvCUR(sv);
6479         arg2 = SvPV_nolen(sv);
6480         arg1 = len;
6481       } else {
6482         arg2 = NULL;
6483         arg1 = 0;
6484       }
6485     }
6486     if (items > 1) {
6487       ecode3 = SWIG_AsVal_int SWIG_PERL_CALL_ARGS_2(ST(1), &val3);
6488       if (!SWIG_IsOK(ecode3)) {
6489         SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "EscapeString" "', argument " "3"" of type '" "int""'");
6490       }
6491       arg3 = static_cast< int >(val3);
6492     }
6493     {
6494       CPLErrorReset();
6495       result = (retStringAndCPLFree *)EscapeString(arg1,arg2,arg3);
6496       CPLErr eclass = CPLGetLastErrorType();
6497       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
6498         do_confess( CPLGetLastErrorMsg(), 0 );
6499 
6500 
6501 
6502 
6503 
6504       }
6505 
6506 
6507       /*
6508           Make warnings regular Perl warnings. This duplicates the warning
6509           message if DontUseExceptions() is in effect (it is not by default).
6510           */
6511       if ( eclass == CE_Warning ) {
6512         warn( CPLGetLastErrorMsg(), "%s" );
6513       }
6514 
6515 
6516     }
6517 
6518     /* %typemap(out) (retStringAndCPLFree*) */
6519     if(result)
6520     {
6521       ST(argvi) = SWIG_FromCharPtr((const char *)result);
6522       CPLFree(result);
6523     }
6524     else
6525     {
6526       ST(argvi) = &PL_sv_undef;
6527     }
6528     argvi++ ;
6529 
6530 
6531     XSRETURN(argvi);
6532   fail:
6533 
6534     SWIG_croak_null();
6535   }
6536 }
6537 
6538 
XS(_wrap_GetLastErrorNo)6539 XS(_wrap_GetLastErrorNo) {
6540   {
6541     int argvi = 0;
6542     int result;
6543     dXSARGS;
6544 
6545     if ((items < 0) || (items > 0)) {
6546       SWIG_croak("Usage: GetLastErrorNo();");
6547     }
6548     {
6549       CPLErrorReset();
6550       result = (int)CPLGetLastErrorNo();
6551       CPLErr eclass = CPLGetLastErrorType();
6552       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
6553         do_confess( CPLGetLastErrorMsg(), 0 );
6554 
6555 
6556 
6557 
6558 
6559       }
6560 
6561 
6562       /*
6563           Make warnings regular Perl warnings. This duplicates the warning
6564           message if DontUseExceptions() is in effect (it is not by default).
6565           */
6566       if ( eclass == CE_Warning ) {
6567         warn( CPLGetLastErrorMsg(), "%s" );
6568       }
6569 
6570 
6571     }
6572     ST(argvi) = SWIG_From_int  SWIG_PERL_CALL_ARGS_1(static_cast< int >(result)); argvi++ ;
6573     XSRETURN(argvi);
6574   fail:
6575     SWIG_croak_null();
6576   }
6577 }
6578 
6579 
XS(_wrap_GetLastErrorType)6580 XS(_wrap_GetLastErrorType) {
6581   {
6582     int argvi = 0;
6583     CPLErr result;
6584     dXSARGS;
6585 
6586     if ((items < 0) || (items > 0)) {
6587       SWIG_croak("Usage: GetLastErrorType();");
6588     }
6589     {
6590       CPLErrorReset();
6591       result = (CPLErr)CPLGetLastErrorType();
6592       CPLErr eclass = CPLGetLastErrorType();
6593       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
6594         do_confess( CPLGetLastErrorMsg(), 0 );
6595 
6596 
6597 
6598 
6599 
6600       }
6601 
6602 
6603       /*
6604           Make warnings regular Perl warnings. This duplicates the warning
6605           message if DontUseExceptions() is in effect (it is not by default).
6606           */
6607       if ( eclass == CE_Warning ) {
6608         warn( CPLGetLastErrorMsg(), "%s" );
6609       }
6610 
6611 
6612     }
6613     {
6614       /* %typemap(out) CPLErr */
6615     }
6616     XSRETURN(argvi);
6617   fail:
6618     SWIG_croak_null();
6619   }
6620 }
6621 
6622 
XS(_wrap_GetLastErrorMsg)6623 XS(_wrap_GetLastErrorMsg) {
6624   {
6625     int argvi = 0;
6626     char *result = 0 ;
6627     dXSARGS;
6628 
6629     if ((items < 0) || (items > 0)) {
6630       SWIG_croak("Usage: GetLastErrorMsg();");
6631     }
6632     {
6633       CPLErrorReset();
6634       result = (char *)CPLGetLastErrorMsg();
6635       CPLErr eclass = CPLGetLastErrorType();
6636       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
6637         do_confess( CPLGetLastErrorMsg(), 0 );
6638 
6639 
6640 
6641 
6642 
6643       }
6644 
6645 
6646       /*
6647           Make warnings regular Perl warnings. This duplicates the warning
6648           message if DontUseExceptions() is in effect (it is not by default).
6649           */
6650       if ( eclass == CE_Warning ) {
6651         warn( CPLGetLastErrorMsg(), "%s" );
6652       }
6653 
6654 
6655     }
6656     {
6657       /* %typemap(out) const char * */
6658       ST(argvi) = newSVpv(result, 0);
6659       SvUTF8_on(ST(argvi)); /* expecting GDAL to give us UTF-8 */
6660       sv_2mortal(ST(argvi));
6661       argvi++;
6662     }
6663     XSRETURN(argvi);
6664   fail:
6665     SWIG_croak_null();
6666   }
6667 }
6668 
6669 
XS(_wrap_GetErrorCounter)6670 XS(_wrap_GetErrorCounter) {
6671   {
6672     int argvi = 0;
6673     unsigned int result;
6674     dXSARGS;
6675 
6676     if ((items < 0) || (items > 0)) {
6677       SWIG_croak("Usage: GetErrorCounter();");
6678     }
6679     {
6680       CPLErrorReset();
6681       result = (unsigned int)CPLGetErrorCounter();
6682       CPLErr eclass = CPLGetLastErrorType();
6683       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
6684         do_confess( CPLGetLastErrorMsg(), 0 );
6685 
6686 
6687 
6688 
6689 
6690       }
6691 
6692 
6693       /*
6694           Make warnings regular Perl warnings. This duplicates the warning
6695           message if DontUseExceptions() is in effect (it is not by default).
6696           */
6697       if ( eclass == CE_Warning ) {
6698         warn( CPLGetLastErrorMsg(), "%s" );
6699       }
6700 
6701 
6702     }
6703     ST(argvi) = SWIG_From_unsigned_SS_int  SWIG_PERL_CALL_ARGS_1(static_cast< unsigned int >(result)); argvi++ ;
6704     XSRETURN(argvi);
6705   fail:
6706     SWIG_croak_null();
6707   }
6708 }
6709 
6710 
XS(_wrap_VSIGetLastErrorNo)6711 XS(_wrap_VSIGetLastErrorNo) {
6712   {
6713     int argvi = 0;
6714     int result;
6715     dXSARGS;
6716 
6717     if ((items < 0) || (items > 0)) {
6718       SWIG_croak("Usage: VSIGetLastErrorNo();");
6719     }
6720     {
6721       CPLErrorReset();
6722       result = (int)VSIGetLastErrorNo();
6723       CPLErr eclass = CPLGetLastErrorType();
6724       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
6725         do_confess( CPLGetLastErrorMsg(), 0 );
6726 
6727 
6728 
6729 
6730 
6731       }
6732 
6733 
6734       /*
6735           Make warnings regular Perl warnings. This duplicates the warning
6736           message if DontUseExceptions() is in effect (it is not by default).
6737           */
6738       if ( eclass == CE_Warning ) {
6739         warn( CPLGetLastErrorMsg(), "%s" );
6740       }
6741 
6742 
6743     }
6744     ST(argvi) = SWIG_From_int  SWIG_PERL_CALL_ARGS_1(static_cast< int >(result)); argvi++ ;
6745     XSRETURN(argvi);
6746   fail:
6747     SWIG_croak_null();
6748   }
6749 }
6750 
6751 
XS(_wrap_VSIGetLastErrorMsg)6752 XS(_wrap_VSIGetLastErrorMsg) {
6753   {
6754     int argvi = 0;
6755     char *result = 0 ;
6756     dXSARGS;
6757 
6758     if ((items < 0) || (items > 0)) {
6759       SWIG_croak("Usage: VSIGetLastErrorMsg();");
6760     }
6761     {
6762       CPLErrorReset();
6763       result = (char *)VSIGetLastErrorMsg();
6764       CPLErr eclass = CPLGetLastErrorType();
6765       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
6766         do_confess( CPLGetLastErrorMsg(), 0 );
6767 
6768 
6769 
6770 
6771 
6772       }
6773 
6774 
6775       /*
6776           Make warnings regular Perl warnings. This duplicates the warning
6777           message if DontUseExceptions() is in effect (it is not by default).
6778           */
6779       if ( eclass == CE_Warning ) {
6780         warn( CPLGetLastErrorMsg(), "%s" );
6781       }
6782 
6783 
6784     }
6785     {
6786       /* %typemap(out) const char * */
6787       ST(argvi) = newSVpv(result, 0);
6788       SvUTF8_on(ST(argvi)); /* expecting GDAL to give us UTF-8 */
6789       sv_2mortal(ST(argvi));
6790       argvi++;
6791     }
6792     XSRETURN(argvi);
6793   fail:
6794     SWIG_croak_null();
6795   }
6796 }
6797 
6798 
XS(_wrap_VSIErrorReset)6799 XS(_wrap_VSIErrorReset) {
6800   {
6801     int argvi = 0;
6802     dXSARGS;
6803 
6804     if ((items < 0) || (items > 0)) {
6805       SWIG_croak("Usage: VSIErrorReset();");
6806     }
6807     {
6808       CPLErrorReset();
6809       VSIErrorReset();
6810       CPLErr eclass = CPLGetLastErrorType();
6811       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
6812         do_confess( CPLGetLastErrorMsg(), 0 );
6813 
6814 
6815 
6816 
6817 
6818       }
6819 
6820 
6821       /*
6822           Make warnings regular Perl warnings. This duplicates the warning
6823           message if DontUseExceptions() is in effect (it is not by default).
6824           */
6825       if ( eclass == CE_Warning ) {
6826         warn( CPLGetLastErrorMsg(), "%s" );
6827       }
6828 
6829 
6830     }
6831     {
6832       /* %typemap(out) void */
6833     }
6834     XSRETURN(argvi);
6835   fail:
6836     SWIG_croak_null();
6837   }
6838 }
6839 
6840 
XS(_wrap_PushFinderLocation)6841 XS(_wrap_PushFinderLocation) {
6842   {
6843     char *arg1 = (char *) 0 ;
6844     U8 *tmpbuf1 = NULL ;
6845     int argvi = 0;
6846     dXSARGS;
6847 
6848     {
6849       /* %typemap(default) const char * utf8_path */
6850       arg1 = (char *)"";
6851     }
6852     if ((items < 0) || (items > 1)) {
6853       SWIG_croak("Usage: PushFinderLocation(utf8_path);");
6854     }
6855     if (items > 0) {
6856       {
6857         /* %typemap(in,numinputs=1) (const char* utf8_path) (U8 *tmpbuf1) */
6858         arg1 = sv_to_utf8_string(ST(0), &tmpbuf1);
6859       }
6860     }
6861     {
6862       if (!arg1) {
6863         SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
6864       }
6865     }
6866     {
6867       CPLErrorReset();
6868       CPLPushFinderLocation((char const *)arg1);
6869       CPLErr eclass = CPLGetLastErrorType();
6870       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
6871         do_confess( CPLGetLastErrorMsg(), 0 );
6872 
6873 
6874 
6875 
6876 
6877       }
6878 
6879 
6880       /*
6881           Make warnings regular Perl warnings. This duplicates the warning
6882           message if DontUseExceptions() is in effect (it is not by default).
6883           */
6884       if ( eclass == CE_Warning ) {
6885         warn( CPLGetLastErrorMsg(), "%s" );
6886       }
6887 
6888 
6889     }
6890     {
6891       /* %typemap(out) void */
6892     }
6893     {
6894       /* %typemap(freearg) (const char* utf8_path) */
6895       if (tmpbuf1) Safefree(tmpbuf1);
6896     }
6897     XSRETURN(argvi);
6898   fail:
6899     {
6900       /* %typemap(freearg) (const char* utf8_path) */
6901       if (tmpbuf1) Safefree(tmpbuf1);
6902     }
6903     SWIG_croak_null();
6904   }
6905 }
6906 
6907 
XS(_wrap_PopFinderLocation)6908 XS(_wrap_PopFinderLocation) {
6909   {
6910     int argvi = 0;
6911     dXSARGS;
6912 
6913     if ((items < 0) || (items > 0)) {
6914       SWIG_croak("Usage: PopFinderLocation();");
6915     }
6916     {
6917       CPLErrorReset();
6918       CPLPopFinderLocation();
6919       CPLErr eclass = CPLGetLastErrorType();
6920       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
6921         do_confess( CPLGetLastErrorMsg(), 0 );
6922 
6923 
6924 
6925 
6926 
6927       }
6928 
6929 
6930       /*
6931           Make warnings regular Perl warnings. This duplicates the warning
6932           message if DontUseExceptions() is in effect (it is not by default).
6933           */
6934       if ( eclass == CE_Warning ) {
6935         warn( CPLGetLastErrorMsg(), "%s" );
6936       }
6937 
6938 
6939     }
6940     {
6941       /* %typemap(out) void */
6942     }
6943     XSRETURN(argvi);
6944   fail:
6945     SWIG_croak_null();
6946   }
6947 }
6948 
6949 
XS(_wrap_FinderClean)6950 XS(_wrap_FinderClean) {
6951   {
6952     int argvi = 0;
6953     dXSARGS;
6954 
6955     if ((items < 0) || (items > 0)) {
6956       SWIG_croak("Usage: FinderClean();");
6957     }
6958     {
6959       CPLErrorReset();
6960       CPLFinderClean();
6961       CPLErr eclass = CPLGetLastErrorType();
6962       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
6963         do_confess( CPLGetLastErrorMsg(), 0 );
6964 
6965 
6966 
6967 
6968 
6969       }
6970 
6971 
6972       /*
6973           Make warnings regular Perl warnings. This duplicates the warning
6974           message if DontUseExceptions() is in effect (it is not by default).
6975           */
6976       if ( eclass == CE_Warning ) {
6977         warn( CPLGetLastErrorMsg(), "%s" );
6978       }
6979 
6980 
6981     }
6982     {
6983       /* %typemap(out) void */
6984     }
6985     XSRETURN(argvi);
6986   fail:
6987     SWIG_croak_null();
6988   }
6989 }
6990 
6991 
XS(_wrap_FindFile)6992 XS(_wrap_FindFile) {
6993   {
6994     char *arg1 = (char *) 0 ;
6995     char *arg2 = (char *) 0 ;
6996     int res1 ;
6997     char *buf1 = 0 ;
6998     int alloc1 = 0 ;
6999     U8 *tmpbuf2 = NULL ;
7000     int argvi = 0;
7001     char *result = 0 ;
7002     dXSARGS;
7003 
7004     {
7005       /* %typemap(default) const char * utf8_path */
7006       arg2 = (char *)"";
7007     }
7008     if ((items < 1) || (items > 2)) {
7009       SWIG_croak("Usage: FindFile(pszClass,utf8_path);");
7010     }
7011     res1 = SWIG_AsCharPtrAndSize(ST(0), &buf1, NULL, &alloc1);
7012     if (!SWIG_IsOK(res1)) {
7013       SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "FindFile" "', argument " "1"" of type '" "char const *""'");
7014     }
7015     arg1 = reinterpret_cast< char * >(buf1);
7016     if (items > 1) {
7017       {
7018         /* %typemap(in,numinputs=1) (const char* utf8_path) (U8 *tmpbuf2) */
7019         arg2 = sv_to_utf8_string(ST(1), &tmpbuf2);
7020       }
7021     }
7022     {
7023       if (!arg2) {
7024         SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
7025       }
7026     }
7027     {
7028       CPLErrorReset();
7029       result = (char *)CPLFindFile((char const *)arg1,(char const *)arg2);
7030       CPLErr eclass = CPLGetLastErrorType();
7031       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
7032         do_confess( CPLGetLastErrorMsg(), 0 );
7033 
7034 
7035 
7036 
7037 
7038       }
7039 
7040 
7041       /*
7042           Make warnings regular Perl warnings. This duplicates the warning
7043           message if DontUseExceptions() is in effect (it is not by default).
7044           */
7045       if ( eclass == CE_Warning ) {
7046         warn( CPLGetLastErrorMsg(), "%s" );
7047       }
7048 
7049 
7050     }
7051     {
7052       /* %typemap(out) const char * */
7053       ST(argvi) = newSVpv(result, 0);
7054       SvUTF8_on(ST(argvi)); /* expecting GDAL to give us UTF-8 */
7055       sv_2mortal(ST(argvi));
7056       argvi++;
7057     }
7058     if (alloc1 == SWIG_NEWOBJ) delete[] buf1;
7059     {
7060       /* %typemap(freearg) (const char* utf8_path) */
7061       if (tmpbuf2) Safefree(tmpbuf2);
7062     }
7063     XSRETURN(argvi);
7064   fail:
7065     if (alloc1 == SWIG_NEWOBJ) delete[] buf1;
7066     {
7067       /* %typemap(freearg) (const char* utf8_path) */
7068       if (tmpbuf2) Safefree(tmpbuf2);
7069     }
7070     SWIG_croak_null();
7071   }
7072 }
7073 
7074 
XS(_wrap_ReadDir)7075 XS(_wrap_ReadDir) {
7076   {
7077     char *arg1 = (char *) 0 ;
7078     int arg2 = (int) 0 ;
7079     U8 *tmpbuf1 = NULL ;
7080     int val2 ;
7081     int ecode2 = 0 ;
7082     int argvi = 0;
7083     char **result = 0 ;
7084     dXSARGS;
7085 
7086     {
7087       /* %typemap(default) const char * utf8_path */
7088       arg1 = (char *)"";
7089     }
7090     if ((items < 0) || (items > 2)) {
7091       SWIG_croak("Usage: ReadDir(utf8_path,nMaxFiles);");
7092     }
7093     if (items > 0) {
7094       {
7095         /* %typemap(in,numinputs=1) (const char* utf8_path) (U8 *tmpbuf1) */
7096         arg1 = sv_to_utf8_string(ST(0), &tmpbuf1);
7097       }
7098     }
7099     if (items > 1) {
7100       ecode2 = SWIG_AsVal_int SWIG_PERL_CALL_ARGS_2(ST(1), &val2);
7101       if (!SWIG_IsOK(ecode2)) {
7102         SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "ReadDir" "', argument " "2"" of type '" "int""'");
7103       }
7104       arg2 = static_cast< int >(val2);
7105     }
7106     {
7107       if (!arg1) {
7108         SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
7109       }
7110     }
7111     {
7112       CPLErrorReset();
7113       result = (char **)wrapper_VSIReadDirEx((char const *)arg1,arg2);
7114       CPLErr eclass = CPLGetLastErrorType();
7115       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
7116         do_confess( CPLGetLastErrorMsg(), 0 );
7117 
7118 
7119 
7120 
7121 
7122       }
7123 
7124 
7125       /*
7126           Make warnings regular Perl warnings. This duplicates the warning
7127           message if DontUseExceptions() is in effect (it is not by default).
7128           */
7129       if ( eclass == CE_Warning ) {
7130         warn( CPLGetLastErrorMsg(), "%s" );
7131       }
7132 
7133 
7134     }
7135     {
7136       /* %typemap(out) char **CSL */
7137       if (GIMME_V == G_ARRAY) {
7138         if (result) {
7139           int n = CSLCount(result);
7140           EXTEND(SP, argvi+n-items+1);
7141           int i;
7142           for (i = 0; result[i]; i++) {
7143             SV *sv = newSVpv(result[i], 0);
7144             SvUTF8_on(sv); /* expecting GDAL to give us UTF-8 */
7145             ST(argvi++) = sv_2mortal(sv);
7146           }
7147           CSLDestroy(result);
7148         }
7149       } else {
7150         AV *av = (AV*)sv_2mortal((SV*)newAV());
7151         if (result) {
7152           int i;
7153           for (i = 0; result[i]; i++) {
7154             SV *sv = newSVpv(result[i], 0);
7155             SvUTF8_on(sv); /* expecting GDAL to give us UTF-8 */
7156             av_push(av, sv);
7157           }
7158           CSLDestroy(result);
7159         }
7160         ST(argvi) = newRV((SV*)av);
7161         sv_2mortal(ST(argvi));
7162         argvi++;
7163       }
7164     }
7165     {
7166       /* %typemap(freearg) (const char* utf8_path) */
7167       if (tmpbuf1) Safefree(tmpbuf1);
7168     }
7169 
7170     XSRETURN(argvi);
7171   fail:
7172     {
7173       /* %typemap(freearg) (const char* utf8_path) */
7174       if (tmpbuf1) Safefree(tmpbuf1);
7175     }
7176 
7177     SWIG_croak_null();
7178   }
7179 }
7180 
7181 
XS(_wrap_ReadDirRecursive)7182 XS(_wrap_ReadDirRecursive) {
7183   {
7184     char *arg1 = (char *) 0 ;
7185     U8 *tmpbuf1 = NULL ;
7186     int argvi = 0;
7187     char **result = 0 ;
7188     dXSARGS;
7189 
7190     {
7191       /* %typemap(default) const char * utf8_path */
7192       arg1 = (char *)"";
7193     }
7194     if ((items < 0) || (items > 1)) {
7195       SWIG_croak("Usage: ReadDirRecursive(utf8_path);");
7196     }
7197     if (items > 0) {
7198       {
7199         /* %typemap(in,numinputs=1) (const char* utf8_path) (U8 *tmpbuf1) */
7200         arg1 = sv_to_utf8_string(ST(0), &tmpbuf1);
7201       }
7202     }
7203     {
7204       if (!arg1) {
7205         SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
7206       }
7207     }
7208     {
7209       CPLErrorReset();
7210       result = (char **)VSIReadDirRecursive((char const *)arg1);
7211       CPLErr eclass = CPLGetLastErrorType();
7212       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
7213         do_confess( CPLGetLastErrorMsg(), 0 );
7214 
7215 
7216 
7217 
7218 
7219       }
7220 
7221 
7222       /*
7223           Make warnings regular Perl warnings. This duplicates the warning
7224           message if DontUseExceptions() is in effect (it is not by default).
7225           */
7226       if ( eclass == CE_Warning ) {
7227         warn( CPLGetLastErrorMsg(), "%s" );
7228       }
7229 
7230 
7231     }
7232     {
7233       /* %typemap(out) char **CSL */
7234       if (GIMME_V == G_ARRAY) {
7235         if (result) {
7236           int n = CSLCount(result);
7237           EXTEND(SP, argvi+n-items+1);
7238           int i;
7239           for (i = 0; result[i]; i++) {
7240             SV *sv = newSVpv(result[i], 0);
7241             SvUTF8_on(sv); /* expecting GDAL to give us UTF-8 */
7242             ST(argvi++) = sv_2mortal(sv);
7243           }
7244           CSLDestroy(result);
7245         }
7246       } else {
7247         AV *av = (AV*)sv_2mortal((SV*)newAV());
7248         if (result) {
7249           int i;
7250           for (i = 0; result[i]; i++) {
7251             SV *sv = newSVpv(result[i], 0);
7252             SvUTF8_on(sv); /* expecting GDAL to give us UTF-8 */
7253             av_push(av, sv);
7254           }
7255           CSLDestroy(result);
7256         }
7257         ST(argvi) = newRV((SV*)av);
7258         sv_2mortal(ST(argvi));
7259         argvi++;
7260       }
7261     }
7262     {
7263       /* %typemap(freearg) (const char* utf8_path) */
7264       if (tmpbuf1) Safefree(tmpbuf1);
7265     }
7266     XSRETURN(argvi);
7267   fail:
7268     {
7269       /* %typemap(freearg) (const char* utf8_path) */
7270       if (tmpbuf1) Safefree(tmpbuf1);
7271     }
7272     SWIG_croak_null();
7273   }
7274 }
7275 
7276 
XS(_wrap_SetConfigOption)7277 XS(_wrap_SetConfigOption) {
7278   {
7279     char *arg1 = (char *) 0 ;
7280     char *arg2 = (char *) 0 ;
7281     int res1 ;
7282     char *buf1 = 0 ;
7283     int alloc1 = 0 ;
7284     int res2 ;
7285     char *buf2 = 0 ;
7286     int alloc2 = 0 ;
7287     int argvi = 0;
7288     dXSARGS;
7289 
7290     if ((items < 2) || (items > 2)) {
7291       SWIG_croak("Usage: SetConfigOption(pszKey,pszValue);");
7292     }
7293     res1 = SWIG_AsCharPtrAndSize(ST(0), &buf1, NULL, &alloc1);
7294     if (!SWIG_IsOK(res1)) {
7295       SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SetConfigOption" "', argument " "1"" of type '" "char const *""'");
7296     }
7297     arg1 = reinterpret_cast< char * >(buf1);
7298     res2 = SWIG_AsCharPtrAndSize(ST(1), &buf2, NULL, &alloc2);
7299     if (!SWIG_IsOK(res2)) {
7300       SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "SetConfigOption" "', argument " "2"" of type '" "char const *""'");
7301     }
7302     arg2 = reinterpret_cast< char * >(buf2);
7303     {
7304       if (!arg1) {
7305         SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
7306       }
7307     }
7308     {
7309       CPLErrorReset();
7310       CPLSetConfigOption((char const *)arg1,(char const *)arg2);
7311       CPLErr eclass = CPLGetLastErrorType();
7312       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
7313         do_confess( CPLGetLastErrorMsg(), 0 );
7314 
7315 
7316 
7317 
7318 
7319       }
7320 
7321 
7322       /*
7323           Make warnings regular Perl warnings. This duplicates the warning
7324           message if DontUseExceptions() is in effect (it is not by default).
7325           */
7326       if ( eclass == CE_Warning ) {
7327         warn( CPLGetLastErrorMsg(), "%s" );
7328       }
7329 
7330 
7331     }
7332     {
7333       /* %typemap(out) void */
7334     }
7335     if (alloc1 == SWIG_NEWOBJ) delete[] buf1;
7336     if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
7337     XSRETURN(argvi);
7338   fail:
7339     if (alloc1 == SWIG_NEWOBJ) delete[] buf1;
7340     if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
7341     SWIG_croak_null();
7342   }
7343 }
7344 
7345 
XS(_wrap_GetConfigOption)7346 XS(_wrap_GetConfigOption) {
7347   {
7348     char *arg1 = (char *) 0 ;
7349     char *arg2 = (char *) NULL ;
7350     int res1 ;
7351     char *buf1 = 0 ;
7352     int alloc1 = 0 ;
7353     int res2 ;
7354     char *buf2 = 0 ;
7355     int alloc2 = 0 ;
7356     int argvi = 0;
7357     char *result = 0 ;
7358     dXSARGS;
7359 
7360     if ((items < 1) || (items > 2)) {
7361       SWIG_croak("Usage: GetConfigOption(pszKey,pszDefault);");
7362     }
7363     res1 = SWIG_AsCharPtrAndSize(ST(0), &buf1, NULL, &alloc1);
7364     if (!SWIG_IsOK(res1)) {
7365       SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "GetConfigOption" "', argument " "1"" of type '" "char const *""'");
7366     }
7367     arg1 = reinterpret_cast< char * >(buf1);
7368     if (items > 1) {
7369       res2 = SWIG_AsCharPtrAndSize(ST(1), &buf2, NULL, &alloc2);
7370       if (!SWIG_IsOK(res2)) {
7371         SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "GetConfigOption" "', argument " "2"" of type '" "char const *""'");
7372       }
7373       arg2 = reinterpret_cast< char * >(buf2);
7374     }
7375     {
7376       if (!arg1) {
7377         SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
7378       }
7379     }
7380     {
7381       CPLErrorReset();
7382       result = (char *)wrapper_CPLGetConfigOption((char const *)arg1,(char const *)arg2);
7383       CPLErr eclass = CPLGetLastErrorType();
7384       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
7385         do_confess( CPLGetLastErrorMsg(), 0 );
7386 
7387 
7388 
7389 
7390 
7391       }
7392 
7393 
7394       /*
7395           Make warnings regular Perl warnings. This duplicates the warning
7396           message if DontUseExceptions() is in effect (it is not by default).
7397           */
7398       if ( eclass == CE_Warning ) {
7399         warn( CPLGetLastErrorMsg(), "%s" );
7400       }
7401 
7402 
7403     }
7404     {
7405       /* %typemap(out) const char * */
7406       ST(argvi) = newSVpv(result, 0);
7407       SvUTF8_on(ST(argvi)); /* expecting GDAL to give us UTF-8 */
7408       sv_2mortal(ST(argvi));
7409       argvi++;
7410     }
7411     if (alloc1 == SWIG_NEWOBJ) delete[] buf1;
7412     if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
7413     XSRETURN(argvi);
7414   fail:
7415     if (alloc1 == SWIG_NEWOBJ) delete[] buf1;
7416     if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
7417     SWIG_croak_null();
7418   }
7419 }
7420 
7421 
XS(_wrap_CPLBinaryToHex)7422 XS(_wrap_CPLBinaryToHex) {
7423   {
7424     int arg1 ;
7425     GByte *arg2 = (GByte *) 0 ;
7426     int argvi = 0;
7427     retStringAndCPLFree *result = 0 ;
7428     dXSARGS;
7429 
7430     if ((items < 1) || (items > 1)) {
7431       SWIG_croak("Usage: CPLBinaryToHex(nBytes,pabyData);");
7432     }
7433     {
7434       /* %typemap(in,numinputs=1) (int nLen, unsigned char *pBuf ) */
7435       if (SvOK(ST(0))) {
7436         SV *sv = ST(0);
7437         if (SvROK(sv) && SvTYPE(SvRV(sv)) < SVt_PVAV)
7438         sv = SvRV(sv);
7439         if (!SvPOK(sv))
7440         do_confess(NEED_BINARY_DATA, 1);
7441         STRLEN len = SvCUR(sv);
7442         arg2 = (unsigned char *)SvPV_nolen(sv);
7443         arg1 = len;
7444       } else {
7445         arg2 = NULL;
7446         arg1 = 0;
7447       }
7448     }
7449     {
7450       CPLErrorReset();
7451       result = (retStringAndCPLFree *)CPLBinaryToHex(arg1,(GByte const *)arg2);
7452       CPLErr eclass = CPLGetLastErrorType();
7453       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
7454         do_confess( CPLGetLastErrorMsg(), 0 );
7455 
7456 
7457 
7458 
7459 
7460       }
7461 
7462 
7463       /*
7464           Make warnings regular Perl warnings. This duplicates the warning
7465           message if DontUseExceptions() is in effect (it is not by default).
7466           */
7467       if ( eclass == CE_Warning ) {
7468         warn( CPLGetLastErrorMsg(), "%s" );
7469       }
7470 
7471 
7472     }
7473 
7474     /* %typemap(out) (retStringAndCPLFree*) */
7475     if(result)
7476     {
7477       ST(argvi) = SWIG_FromCharPtr((const char *)result);
7478       CPLFree(result);
7479     }
7480     else
7481     {
7482       ST(argvi) = &PL_sv_undef;
7483     }
7484     argvi++ ;
7485 
7486     XSRETURN(argvi);
7487   fail:
7488     SWIG_croak_null();
7489   }
7490 }
7491 
7492 
XS(_wrap_CPLHexToBinary)7493 XS(_wrap_CPLHexToBinary) {
7494   {
7495     char *arg1 = (char *) 0 ;
7496     int *arg2 = (int *) 0 ;
7497     int res1 ;
7498     char *buf1 = 0 ;
7499     int alloc1 = 0 ;
7500     int bytes2 ;
7501     int argvi = 0;
7502     GByte *result = 0 ;
7503     dXSARGS;
7504 
7505     {
7506       /* %typemap(in,numinputs=0) (int *pnBytes) (int bytes2) */
7507       arg2 = &bytes2;
7508     }
7509     if ((items < 1) || (items > 1)) {
7510       SWIG_croak("Usage: CPLHexToBinary(pszHex);");
7511     }
7512     res1 = SWIG_AsCharPtrAndSize(ST(0), &buf1, NULL, &alloc1);
7513     if (!SWIG_IsOK(res1)) {
7514       SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CPLHexToBinary" "', argument " "1"" of type '" "char const *""'");
7515     }
7516     arg1 = reinterpret_cast< char * >(buf1);
7517     {
7518       CPLErrorReset();
7519       result = (GByte *)CPLHexToBinary((char const *)arg1,arg2);
7520       CPLErr eclass = CPLGetLastErrorType();
7521       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
7522         do_confess( CPLGetLastErrorMsg(), 0 );
7523 
7524 
7525 
7526 
7527 
7528       }
7529 
7530 
7531       /*
7532           Make warnings regular Perl warnings. This duplicates the warning
7533           message if DontUseExceptions() is in effect (it is not by default).
7534           */
7535       if ( eclass == CE_Warning ) {
7536         warn( CPLGetLastErrorMsg(), "%s" );
7537       }
7538 
7539 
7540     }
7541     {
7542       /* %typemap(out) GByte * */
7543       ST(argvi) = sv_newmortal();
7544       sv_setpvn(ST(argvi), (const char*)result, *arg2);
7545       CPLFree(result);
7546       argvi++;
7547     }
7548     if (alloc1 == SWIG_NEWOBJ) delete[] buf1;
7549 
7550     XSRETURN(argvi);
7551   fail:
7552     if (alloc1 == SWIG_NEWOBJ) delete[] buf1;
7553 
7554     SWIG_croak_null();
7555   }
7556 }
7557 
7558 
XS(_wrap_FileFromMemBuffer)7559 XS(_wrap_FileFromMemBuffer) {
7560   {
7561     char *arg1 = (char *) 0 ;
7562     int arg2 ;
7563     GByte *arg3 = (GByte *) 0 ;
7564     U8 *tmpbuf1 = NULL ;
7565     int val2 ;
7566     int ecode2 = 0 ;
7567     void *argp3 = 0 ;
7568     int res3 = 0 ;
7569     int argvi = 0;
7570     dXSARGS;
7571 
7572     {
7573       /* %typemap(default) const char * utf8_path */
7574       arg1 = (char *)"";
7575     }
7576     if ((items < 0) || (items > 3)) {
7577       SWIG_croak("Usage: FileFromMemBuffer(utf8_path,nBytes,pabyData);");
7578     }
7579     if (items > 0) {
7580       {
7581         /* %typemap(in,numinputs=1) (const char* utf8_path) (U8 *tmpbuf1) */
7582         arg1 = sv_to_utf8_string(ST(0), &tmpbuf1);
7583       }
7584     }
7585     if (items > 1) {
7586       ecode2 = SWIG_AsVal_int SWIG_PERL_CALL_ARGS_2(ST(1), &val2);
7587       if (!SWIG_IsOK(ecode2)) {
7588         SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "FileFromMemBuffer" "', argument " "2"" of type '" "int""'");
7589       }
7590       arg2 = static_cast< int >(val2);
7591     }
7592     if (items > 2) {
7593       res3 = SWIG_ConvertPtr(ST(2), &argp3,SWIGTYPE_p_GByte, 0 |  0 );
7594       if (!SWIG_IsOK(res3)) {
7595         SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "FileFromMemBuffer" "', argument " "3"" of type '" "GByte const *""'");
7596       }
7597       arg3 = reinterpret_cast< GByte * >(argp3);
7598     }
7599     {
7600       if (!arg1) {
7601         SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
7602       }
7603     }
7604     {
7605       CPLErrorReset();
7606       wrapper_VSIFileFromMemBuffer((char const *)arg1,arg2,(GByte const *)arg3);
7607       CPLErr eclass = CPLGetLastErrorType();
7608       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
7609         do_confess( CPLGetLastErrorMsg(), 0 );
7610 
7611 
7612 
7613 
7614 
7615       }
7616 
7617 
7618       /*
7619           Make warnings regular Perl warnings. This duplicates the warning
7620           message if DontUseExceptions() is in effect (it is not by default).
7621           */
7622       if ( eclass == CE_Warning ) {
7623         warn( CPLGetLastErrorMsg(), "%s" );
7624       }
7625 
7626 
7627     }
7628     {
7629       /* %typemap(out) void */
7630     }
7631     {
7632       /* %typemap(freearg) (const char* utf8_path) */
7633       if (tmpbuf1) Safefree(tmpbuf1);
7634     }
7635 
7636 
7637     XSRETURN(argvi);
7638   fail:
7639     {
7640       /* %typemap(freearg) (const char* utf8_path) */
7641       if (tmpbuf1) Safefree(tmpbuf1);
7642     }
7643 
7644 
7645     SWIG_croak_null();
7646   }
7647 }
7648 
7649 
XS(_wrap_Unlink)7650 XS(_wrap_Unlink) {
7651   {
7652     char *arg1 = (char *) 0 ;
7653     U8 *tmpbuf1 = NULL ;
7654     int argvi = 0;
7655     VSI_RETVAL result;
7656     dXSARGS;
7657 
7658     {
7659       /* %typemap(default) const char * utf8_path */
7660       arg1 = (char *)"";
7661     }
7662     if ((items < 0) || (items > 1)) {
7663       SWIG_croak("Usage: Unlink(utf8_path);");
7664     }
7665     if (items > 0) {
7666       {
7667         /* %typemap(in,numinputs=1) (const char* utf8_path) (U8 *tmpbuf1) */
7668         arg1 = sv_to_utf8_string(ST(0), &tmpbuf1);
7669       }
7670     }
7671     {
7672       if (!arg1) {
7673         SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
7674       }
7675     }
7676     {
7677       CPLErrorReset();
7678       result = VSIUnlink((char const *)arg1);
7679       CPLErr eclass = CPLGetLastErrorType();
7680       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
7681         do_confess( CPLGetLastErrorMsg(), 0 );
7682 
7683 
7684 
7685 
7686 
7687       }
7688 
7689 
7690       /*
7691           Make warnings regular Perl warnings. This duplicates the warning
7692           message if DontUseExceptions() is in effect (it is not by default).
7693           */
7694       if ( eclass == CE_Warning ) {
7695         warn( CPLGetLastErrorMsg(), "%s" );
7696       }
7697 
7698 
7699     }
7700     {
7701       /* %typemap(out) VSI_RETVAL */
7702     }
7703     {
7704       /* %typemap(freearg) (const char* utf8_path) */
7705       if (tmpbuf1) Safefree(tmpbuf1);
7706     }
7707     {
7708       /* %typemap(ret) VSI_RETVAL */
7709       if (result == -1 ) {
7710         do_confess(strerror(errno), 1);
7711       }
7712     }
7713     XSRETURN(argvi);
7714   fail:
7715     {
7716       /* %typemap(freearg) (const char* utf8_path) */
7717       if (tmpbuf1) Safefree(tmpbuf1);
7718     }
7719     SWIG_croak_null();
7720   }
7721 }
7722 
7723 
XS(_wrap_UnlinkBatch)7724 XS(_wrap_UnlinkBatch) {
7725   {
7726     char **arg1 = (char **) 0 ;
7727     int argvi = 0;
7728     bool result;
7729     dXSARGS;
7730 
7731     if ((items < 1) || (items > 1)) {
7732       SWIG_croak("Usage: UnlinkBatch(files);");
7733     }
7734     {
7735       /* %typemap(in) char **options */
7736       if (SvOK(ST(0))) {
7737         if (SvROK(ST(0))) {
7738           if (SvTYPE(SvRV(ST(0)))==SVt_PVAV) {
7739             AV *av = (AV*)(SvRV(ST(0)));
7740             for (int i = 0; i < av_len(av)+1; i++) {
7741               SV *sv = *(av_fetch(av, i, 0));
7742               bool sf;
7743               char *tmp = sv_to_utf8_string(sv, NULL, &sf);
7744               arg1 = CSLAddString(arg1, tmp);
7745               if (sf) Safefree(tmp); else free(tmp);
7746             }
7747           } else if (SvTYPE(SvRV(ST(0)))==SVt_PVHV) {
7748             HV *hv = (HV*)SvRV(ST(0));
7749             SV *sv;
7750             char *key;
7751             I32 klen;
7752             arg1 = NULL;
7753             hv_iterinit(hv);
7754             while(sv = hv_iternextsv(hv, &key, &klen)) {
7755               bool sf;
7756               char *tmp = sv_to_utf8_string(sv, NULL, &sf);
7757               arg1 = CSLAddNameValue(arg1, key, tmp);
7758               if (sf) Safefree(tmp); else free(tmp);
7759             }
7760           } else
7761           do_confess(NEED_REF, 1);
7762         } else
7763         do_confess(NEED_REF, 1);
7764       }
7765     }
7766     {
7767       CPLErrorReset();
7768       result = (bool)wrapper_VSIUnlinkBatch(arg1);
7769       CPLErr eclass = CPLGetLastErrorType();
7770       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
7771         do_confess( CPLGetLastErrorMsg(), 0 );
7772 
7773 
7774 
7775 
7776 
7777       }
7778 
7779 
7780       /*
7781           Make warnings regular Perl warnings. This duplicates the warning
7782           message if DontUseExceptions() is in effect (it is not by default).
7783           */
7784       if ( eclass == CE_Warning ) {
7785         warn( CPLGetLastErrorMsg(), "%s" );
7786       }
7787 
7788 
7789     }
7790     ST(argvi) = SWIG_From_bool  SWIG_PERL_CALL_ARGS_1(static_cast< bool >(result)); argvi++ ;
7791     {
7792       /* %typemap(freearg) char **options */
7793       if (arg1) CSLDestroy( arg1 );
7794     }
7795     XSRETURN(argvi);
7796   fail:
7797     {
7798       /* %typemap(freearg) char **options */
7799       if (arg1) CSLDestroy( arg1 );
7800     }
7801     SWIG_croak_null();
7802   }
7803 }
7804 
7805 
XS(_wrap_HasThreadSupport)7806 XS(_wrap_HasThreadSupport) {
7807   {
7808     int argvi = 0;
7809     int result;
7810     dXSARGS;
7811 
7812     if ((items < 0) || (items > 0)) {
7813       SWIG_croak("Usage: HasThreadSupport();");
7814     }
7815     {
7816       CPLErrorReset();
7817       result = (int)wrapper_HasThreadSupport();
7818       CPLErr eclass = CPLGetLastErrorType();
7819       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
7820         do_confess( CPLGetLastErrorMsg(), 0 );
7821 
7822 
7823 
7824 
7825 
7826       }
7827 
7828 
7829       /*
7830           Make warnings regular Perl warnings. This duplicates the warning
7831           message if DontUseExceptions() is in effect (it is not by default).
7832           */
7833       if ( eclass == CE_Warning ) {
7834         warn( CPLGetLastErrorMsg(), "%s" );
7835       }
7836 
7837 
7838     }
7839     ST(argvi) = SWIG_From_int  SWIG_PERL_CALL_ARGS_1(static_cast< int >(result)); argvi++ ;
7840     XSRETURN(argvi);
7841   fail:
7842     SWIG_croak_null();
7843   }
7844 }
7845 
7846 
XS(_wrap_Mkdir)7847 XS(_wrap_Mkdir) {
7848   {
7849     char *arg1 = (char *) 0 ;
7850     int arg2 ;
7851     U8 *tmpbuf1 = NULL ;
7852     int val2 ;
7853     int ecode2 = 0 ;
7854     int argvi = 0;
7855     VSI_RETVAL result;
7856     dXSARGS;
7857 
7858     {
7859       /* %typemap(default) const char * utf8_path */
7860       arg1 = (char *)"";
7861     }
7862     if ((items < 0) || (items > 2)) {
7863       SWIG_croak("Usage: Mkdir(utf8_path,mode);");
7864     }
7865     if (items > 0) {
7866       {
7867         /* %typemap(in,numinputs=1) (const char* utf8_path) (U8 *tmpbuf1) */
7868         arg1 = sv_to_utf8_string(ST(0), &tmpbuf1);
7869       }
7870     }
7871     if (items > 1) {
7872       ecode2 = SWIG_AsVal_int SWIG_PERL_CALL_ARGS_2(ST(1), &val2);
7873       if (!SWIG_IsOK(ecode2)) {
7874         SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Mkdir" "', argument " "2"" of type '" "int""'");
7875       }
7876       arg2 = static_cast< int >(val2);
7877     }
7878     {
7879       if (!arg1) {
7880         SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
7881       }
7882     }
7883     {
7884       CPLErrorReset();
7885       result = VSIMkdir((char const *)arg1,arg2);
7886       CPLErr eclass = CPLGetLastErrorType();
7887       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
7888         do_confess( CPLGetLastErrorMsg(), 0 );
7889 
7890 
7891 
7892 
7893 
7894       }
7895 
7896 
7897       /*
7898           Make warnings regular Perl warnings. This duplicates the warning
7899           message if DontUseExceptions() is in effect (it is not by default).
7900           */
7901       if ( eclass == CE_Warning ) {
7902         warn( CPLGetLastErrorMsg(), "%s" );
7903       }
7904 
7905 
7906     }
7907     {
7908       /* %typemap(out) VSI_RETVAL */
7909     }
7910     {
7911       /* %typemap(freearg) (const char* utf8_path) */
7912       if (tmpbuf1) Safefree(tmpbuf1);
7913     }
7914 
7915     {
7916       /* %typemap(ret) VSI_RETVAL */
7917       if (result == -1 ) {
7918         do_confess(strerror(errno), 1);
7919       }
7920     }
7921     XSRETURN(argvi);
7922   fail:
7923     {
7924       /* %typemap(freearg) (const char* utf8_path) */
7925       if (tmpbuf1) Safefree(tmpbuf1);
7926     }
7927 
7928     SWIG_croak_null();
7929   }
7930 }
7931 
7932 
XS(_wrap_Rmdir)7933 XS(_wrap_Rmdir) {
7934   {
7935     char *arg1 = (char *) 0 ;
7936     U8 *tmpbuf1 = NULL ;
7937     int argvi = 0;
7938     VSI_RETVAL result;
7939     dXSARGS;
7940 
7941     {
7942       /* %typemap(default) const char * utf8_path */
7943       arg1 = (char *)"";
7944     }
7945     if ((items < 0) || (items > 1)) {
7946       SWIG_croak("Usage: Rmdir(utf8_path);");
7947     }
7948     if (items > 0) {
7949       {
7950         /* %typemap(in,numinputs=1) (const char* utf8_path) (U8 *tmpbuf1) */
7951         arg1 = sv_to_utf8_string(ST(0), &tmpbuf1);
7952       }
7953     }
7954     {
7955       if (!arg1) {
7956         SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
7957       }
7958     }
7959     {
7960       CPLErrorReset();
7961       result = VSIRmdir((char const *)arg1);
7962       CPLErr eclass = CPLGetLastErrorType();
7963       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
7964         do_confess( CPLGetLastErrorMsg(), 0 );
7965 
7966 
7967 
7968 
7969 
7970       }
7971 
7972 
7973       /*
7974           Make warnings regular Perl warnings. This duplicates the warning
7975           message if DontUseExceptions() is in effect (it is not by default).
7976           */
7977       if ( eclass == CE_Warning ) {
7978         warn( CPLGetLastErrorMsg(), "%s" );
7979       }
7980 
7981 
7982     }
7983     {
7984       /* %typemap(out) VSI_RETVAL */
7985     }
7986     {
7987       /* %typemap(freearg) (const char* utf8_path) */
7988       if (tmpbuf1) Safefree(tmpbuf1);
7989     }
7990     {
7991       /* %typemap(ret) VSI_RETVAL */
7992       if (result == -1 ) {
7993         do_confess(strerror(errno), 1);
7994       }
7995     }
7996     XSRETURN(argvi);
7997   fail:
7998     {
7999       /* %typemap(freearg) (const char* utf8_path) */
8000       if (tmpbuf1) Safefree(tmpbuf1);
8001     }
8002     SWIG_croak_null();
8003   }
8004 }
8005 
8006 
XS(_wrap_MkdirRecursive)8007 XS(_wrap_MkdirRecursive) {
8008   {
8009     char *arg1 = (char *) 0 ;
8010     int arg2 ;
8011     U8 *tmpbuf1 = NULL ;
8012     int val2 ;
8013     int ecode2 = 0 ;
8014     int argvi = 0;
8015     VSI_RETVAL result;
8016     dXSARGS;
8017 
8018     {
8019       /* %typemap(default) const char * utf8_path */
8020       arg1 = (char *)"";
8021     }
8022     if ((items < 0) || (items > 2)) {
8023       SWIG_croak("Usage: MkdirRecursive(utf8_path,mode);");
8024     }
8025     if (items > 0) {
8026       {
8027         /* %typemap(in,numinputs=1) (const char* utf8_path) (U8 *tmpbuf1) */
8028         arg1 = sv_to_utf8_string(ST(0), &tmpbuf1);
8029       }
8030     }
8031     if (items > 1) {
8032       ecode2 = SWIG_AsVal_int SWIG_PERL_CALL_ARGS_2(ST(1), &val2);
8033       if (!SWIG_IsOK(ecode2)) {
8034         SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "MkdirRecursive" "', argument " "2"" of type '" "int""'");
8035       }
8036       arg2 = static_cast< int >(val2);
8037     }
8038     {
8039       if (!arg1) {
8040         SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
8041       }
8042     }
8043     {
8044       CPLErrorReset();
8045       result = VSIMkdirRecursive((char const *)arg1,arg2);
8046       CPLErr eclass = CPLGetLastErrorType();
8047       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
8048         do_confess( CPLGetLastErrorMsg(), 0 );
8049 
8050 
8051 
8052 
8053 
8054       }
8055 
8056 
8057       /*
8058           Make warnings regular Perl warnings. This duplicates the warning
8059           message if DontUseExceptions() is in effect (it is not by default).
8060           */
8061       if ( eclass == CE_Warning ) {
8062         warn( CPLGetLastErrorMsg(), "%s" );
8063       }
8064 
8065 
8066     }
8067     {
8068       /* %typemap(out) VSI_RETVAL */
8069     }
8070     {
8071       /* %typemap(freearg) (const char* utf8_path) */
8072       if (tmpbuf1) Safefree(tmpbuf1);
8073     }
8074 
8075     {
8076       /* %typemap(ret) VSI_RETVAL */
8077       if (result == -1 ) {
8078         do_confess(strerror(errno), 1);
8079       }
8080     }
8081     XSRETURN(argvi);
8082   fail:
8083     {
8084       /* %typemap(freearg) (const char* utf8_path) */
8085       if (tmpbuf1) Safefree(tmpbuf1);
8086     }
8087 
8088     SWIG_croak_null();
8089   }
8090 }
8091 
8092 
XS(_wrap_RmdirRecursive)8093 XS(_wrap_RmdirRecursive) {
8094   {
8095     char *arg1 = (char *) 0 ;
8096     U8 *tmpbuf1 = NULL ;
8097     int argvi = 0;
8098     VSI_RETVAL result;
8099     dXSARGS;
8100 
8101     {
8102       /* %typemap(default) const char * utf8_path */
8103       arg1 = (char *)"";
8104     }
8105     if ((items < 0) || (items > 1)) {
8106       SWIG_croak("Usage: RmdirRecursive(utf8_path);");
8107     }
8108     if (items > 0) {
8109       {
8110         /* %typemap(in,numinputs=1) (const char* utf8_path) (U8 *tmpbuf1) */
8111         arg1 = sv_to_utf8_string(ST(0), &tmpbuf1);
8112       }
8113     }
8114     {
8115       if (!arg1) {
8116         SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
8117       }
8118     }
8119     {
8120       CPLErrorReset();
8121       result = VSIRmdirRecursive((char const *)arg1);
8122       CPLErr eclass = CPLGetLastErrorType();
8123       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
8124         do_confess( CPLGetLastErrorMsg(), 0 );
8125 
8126 
8127 
8128 
8129 
8130       }
8131 
8132 
8133       /*
8134           Make warnings regular Perl warnings. This duplicates the warning
8135           message if DontUseExceptions() is in effect (it is not by default).
8136           */
8137       if ( eclass == CE_Warning ) {
8138         warn( CPLGetLastErrorMsg(), "%s" );
8139       }
8140 
8141 
8142     }
8143     {
8144       /* %typemap(out) VSI_RETVAL */
8145     }
8146     {
8147       /* %typemap(freearg) (const char* utf8_path) */
8148       if (tmpbuf1) Safefree(tmpbuf1);
8149     }
8150     {
8151       /* %typemap(ret) VSI_RETVAL */
8152       if (result == -1 ) {
8153         do_confess(strerror(errno), 1);
8154       }
8155     }
8156     XSRETURN(argvi);
8157   fail:
8158     {
8159       /* %typemap(freearg) (const char* utf8_path) */
8160       if (tmpbuf1) Safefree(tmpbuf1);
8161     }
8162     SWIG_croak_null();
8163   }
8164 }
8165 
8166 
XS(_wrap_Rename)8167 XS(_wrap_Rename) {
8168   {
8169     char *arg1 = (char *) 0 ;
8170     char *arg2 = (char *) 0 ;
8171     U8 *tmpbuf1 = NULL ;
8172     U8 *tmpbuf2 = NULL ;
8173     int argvi = 0;
8174     VSI_RETVAL result;
8175     dXSARGS;
8176 
8177     {
8178       /* %typemap(default) const char * utf8_path */
8179       arg1 = (char *)"";
8180     }
8181     {
8182       /* %typemap(default) const char * utf8_path */
8183       arg2 = (char *)"";
8184     }
8185     if ((items < 0) || (items > 2)) {
8186       SWIG_croak("Usage: Rename(pszOld,pszNew);");
8187     }
8188     if (items > 0) {
8189       {
8190         /* %typemap(in,numinputs=1) (const char* utf8_path) (U8 *tmpbuf1) */
8191         arg1 = sv_to_utf8_string(ST(0), &tmpbuf1);
8192       }
8193     }
8194     if (items > 1) {
8195       {
8196         /* %typemap(in,numinputs=1) (const char* utf8_path) (U8 *tmpbuf2) */
8197         arg2 = sv_to_utf8_string(ST(1), &tmpbuf2);
8198       }
8199     }
8200     {
8201       if (!arg1) {
8202         SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
8203       }
8204     }
8205     {
8206       if (!arg2) {
8207         SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
8208       }
8209     }
8210     {
8211       CPLErrorReset();
8212       result = VSIRename((char const *)arg1,(char const *)arg2);
8213       CPLErr eclass = CPLGetLastErrorType();
8214       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
8215         do_confess( CPLGetLastErrorMsg(), 0 );
8216 
8217 
8218 
8219 
8220 
8221       }
8222 
8223 
8224       /*
8225           Make warnings regular Perl warnings. This duplicates the warning
8226           message if DontUseExceptions() is in effect (it is not by default).
8227           */
8228       if ( eclass == CE_Warning ) {
8229         warn( CPLGetLastErrorMsg(), "%s" );
8230       }
8231 
8232 
8233     }
8234     {
8235       /* %typemap(out) VSI_RETVAL */
8236     }
8237     {
8238       /* %typemap(freearg) (const char* utf8_path) */
8239       if (tmpbuf1) Safefree(tmpbuf1);
8240     }
8241     {
8242       /* %typemap(freearg) (const char* utf8_path) */
8243       if (tmpbuf2) Safefree(tmpbuf2);
8244     }
8245     {
8246       /* %typemap(ret) VSI_RETVAL */
8247       if (result == -1 ) {
8248         do_confess(strerror(errno), 1);
8249       }
8250     }
8251     XSRETURN(argvi);
8252   fail:
8253     {
8254       /* %typemap(freearg) (const char* utf8_path) */
8255       if (tmpbuf1) Safefree(tmpbuf1);
8256     }
8257     {
8258       /* %typemap(freearg) (const char* utf8_path) */
8259       if (tmpbuf2) Safefree(tmpbuf2);
8260     }
8261     SWIG_croak_null();
8262   }
8263 }
8264 
8265 
XS(_wrap_GetActualURL)8266 XS(_wrap_GetActualURL) {
8267   {
8268     char *arg1 = (char *) 0 ;
8269     U8 *tmpbuf1 = NULL ;
8270     int argvi = 0;
8271     char *result = 0 ;
8272     dXSARGS;
8273 
8274     {
8275       /* %typemap(default) const char * utf8_path */
8276       arg1 = (char *)"";
8277     }
8278     if ((items < 0) || (items > 1)) {
8279       SWIG_croak("Usage: GetActualURL(utf8_path);");
8280     }
8281     if (items > 0) {
8282       {
8283         /* %typemap(in,numinputs=1) (const char* utf8_path) (U8 *tmpbuf1) */
8284         arg1 = sv_to_utf8_string(ST(0), &tmpbuf1);
8285       }
8286     }
8287     {
8288       if (!arg1) {
8289         SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
8290       }
8291     }
8292     {
8293       CPLErrorReset();
8294       result = (char *)VSIGetActualURL((char const *)arg1);
8295       CPLErr eclass = CPLGetLastErrorType();
8296       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
8297         do_confess( CPLGetLastErrorMsg(), 0 );
8298 
8299 
8300 
8301 
8302 
8303       }
8304 
8305 
8306       /*
8307           Make warnings regular Perl warnings. This duplicates the warning
8308           message if DontUseExceptions() is in effect (it is not by default).
8309           */
8310       if ( eclass == CE_Warning ) {
8311         warn( CPLGetLastErrorMsg(), "%s" );
8312       }
8313 
8314 
8315     }
8316     {
8317       /* %typemap(out) const char * */
8318       ST(argvi) = newSVpv(result, 0);
8319       SvUTF8_on(ST(argvi)); /* expecting GDAL to give us UTF-8 */
8320       sv_2mortal(ST(argvi));
8321       argvi++;
8322     }
8323     {
8324       /* %typemap(freearg) (const char* utf8_path) */
8325       if (tmpbuf1) Safefree(tmpbuf1);
8326     }
8327     XSRETURN(argvi);
8328   fail:
8329     {
8330       /* %typemap(freearg) (const char* utf8_path) */
8331       if (tmpbuf1) Safefree(tmpbuf1);
8332     }
8333     SWIG_croak_null();
8334   }
8335 }
8336 
8337 
XS(_wrap_GetSignedURL)8338 XS(_wrap_GetSignedURL) {
8339   {
8340     char *arg1 = (char *) 0 ;
8341     char **arg2 = (char **) NULL ;
8342     U8 *tmpbuf1 = NULL ;
8343     int argvi = 0;
8344     retStringAndCPLFree *result = 0 ;
8345     dXSARGS;
8346 
8347     {
8348       /* %typemap(default) const char * utf8_path */
8349       arg1 = (char *)"";
8350     }
8351     if ((items < 0) || (items > 2)) {
8352       SWIG_croak("Usage: GetSignedURL(utf8_path,options);");
8353     }
8354     if (items > 0) {
8355       {
8356         /* %typemap(in,numinputs=1) (const char* utf8_path) (U8 *tmpbuf1) */
8357         arg1 = sv_to_utf8_string(ST(0), &tmpbuf1);
8358       }
8359     }
8360     if (items > 1) {
8361       {
8362         /* %typemap(in) char **options */
8363         if (SvOK(ST(1))) {
8364           if (SvROK(ST(1))) {
8365             if (SvTYPE(SvRV(ST(1)))==SVt_PVAV) {
8366               AV *av = (AV*)(SvRV(ST(1)));
8367               for (int i = 0; i < av_len(av)+1; i++) {
8368                 SV *sv = *(av_fetch(av, i, 0));
8369                 bool sf;
8370                 char *tmp = sv_to_utf8_string(sv, NULL, &sf);
8371                 arg2 = CSLAddString(arg2, tmp);
8372                 if (sf) Safefree(tmp); else free(tmp);
8373               }
8374             } else if (SvTYPE(SvRV(ST(1)))==SVt_PVHV) {
8375               HV *hv = (HV*)SvRV(ST(1));
8376               SV *sv;
8377               char *key;
8378               I32 klen;
8379               arg2 = NULL;
8380               hv_iterinit(hv);
8381               while(sv = hv_iternextsv(hv, &key, &klen)) {
8382                 bool sf;
8383                 char *tmp = sv_to_utf8_string(sv, NULL, &sf);
8384                 arg2 = CSLAddNameValue(arg2, key, tmp);
8385                 if (sf) Safefree(tmp); else free(tmp);
8386               }
8387             } else
8388             do_confess(NEED_REF, 1);
8389           } else
8390           do_confess(NEED_REF, 1);
8391         }
8392       }
8393     }
8394     {
8395       if (!arg1) {
8396         SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
8397       }
8398     }
8399     {
8400       CPLErrorReset();
8401       result = (retStringAndCPLFree *)wrapper_VSIGetSignedURL((char const *)arg1,arg2);
8402       CPLErr eclass = CPLGetLastErrorType();
8403       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
8404         do_confess( CPLGetLastErrorMsg(), 0 );
8405 
8406 
8407 
8408 
8409 
8410       }
8411 
8412 
8413       /*
8414           Make warnings regular Perl warnings. This duplicates the warning
8415           message if DontUseExceptions() is in effect (it is not by default).
8416           */
8417       if ( eclass == CE_Warning ) {
8418         warn( CPLGetLastErrorMsg(), "%s" );
8419       }
8420 
8421 
8422     }
8423 
8424     /* %typemap(out) (retStringAndCPLFree*) */
8425     if(result)
8426     {
8427       ST(argvi) = SWIG_FromCharPtr((const char *)result);
8428       CPLFree(result);
8429     }
8430     else
8431     {
8432       ST(argvi) = &PL_sv_undef;
8433     }
8434     argvi++ ;
8435 
8436     {
8437       /* %typemap(freearg) (const char* utf8_path) */
8438       if (tmpbuf1) Safefree(tmpbuf1);
8439     }
8440     {
8441       /* %typemap(freearg) char **options */
8442       if (arg2) CSLDestroy( arg2 );
8443     }
8444     XSRETURN(argvi);
8445   fail:
8446     {
8447       /* %typemap(freearg) (const char* utf8_path) */
8448       if (tmpbuf1) Safefree(tmpbuf1);
8449     }
8450     {
8451       /* %typemap(freearg) char **options */
8452       if (arg2) CSLDestroy( arg2 );
8453     }
8454     SWIG_croak_null();
8455   }
8456 }
8457 
8458 
XS(_wrap_GetFileSystemsPrefixes)8459 XS(_wrap_GetFileSystemsPrefixes) {
8460   {
8461     int argvi = 0;
8462     char **result = 0 ;
8463     dXSARGS;
8464 
8465     if ((items < 0) || (items > 0)) {
8466       SWIG_croak("Usage: GetFileSystemsPrefixes();");
8467     }
8468     {
8469       CPLErrorReset();
8470       result = (char **)VSIGetFileSystemsPrefixes();
8471       CPLErr eclass = CPLGetLastErrorType();
8472       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
8473         do_confess( CPLGetLastErrorMsg(), 0 );
8474 
8475 
8476 
8477 
8478 
8479       }
8480 
8481 
8482       /*
8483           Make warnings regular Perl warnings. This duplicates the warning
8484           message if DontUseExceptions() is in effect (it is not by default).
8485           */
8486       if ( eclass == CE_Warning ) {
8487         warn( CPLGetLastErrorMsg(), "%s" );
8488       }
8489 
8490 
8491     }
8492     {
8493       /* %typemap(out) char **CSL */
8494       if (GIMME_V == G_ARRAY) {
8495         if (result) {
8496           int n = CSLCount(result);
8497           EXTEND(SP, argvi+n-items+1);
8498           int i;
8499           for (i = 0; result[i]; i++) {
8500             SV *sv = newSVpv(result[i], 0);
8501             SvUTF8_on(sv); /* expecting GDAL to give us UTF-8 */
8502             ST(argvi++) = sv_2mortal(sv);
8503           }
8504           CSLDestroy(result);
8505         }
8506       } else {
8507         AV *av = (AV*)sv_2mortal((SV*)newAV());
8508         if (result) {
8509           int i;
8510           for (i = 0; result[i]; i++) {
8511             SV *sv = newSVpv(result[i], 0);
8512             SvUTF8_on(sv); /* expecting GDAL to give us UTF-8 */
8513             av_push(av, sv);
8514           }
8515           CSLDestroy(result);
8516         }
8517         ST(argvi) = newRV((SV*)av);
8518         sv_2mortal(ST(argvi));
8519         argvi++;
8520       }
8521     }
8522     XSRETURN(argvi);
8523   fail:
8524     SWIG_croak_null();
8525   }
8526 }
8527 
8528 
XS(_wrap_GetFileSystemOptions)8529 XS(_wrap_GetFileSystemOptions) {
8530   {
8531     char *arg1 = (char *) 0 ;
8532     U8 *tmpbuf1 = NULL ;
8533     int argvi = 0;
8534     char *result = 0 ;
8535     dXSARGS;
8536 
8537     {
8538       /* %typemap(default) const char * utf8_path */
8539       arg1 = (char *)"";
8540     }
8541     if ((items < 0) || (items > 1)) {
8542       SWIG_croak("Usage: GetFileSystemOptions(utf8_path);");
8543     }
8544     if (items > 0) {
8545       {
8546         /* %typemap(in,numinputs=1) (const char* utf8_path) (U8 *tmpbuf1) */
8547         arg1 = sv_to_utf8_string(ST(0), &tmpbuf1);
8548       }
8549     }
8550     {
8551       if (!arg1) {
8552         SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
8553       }
8554     }
8555     {
8556       CPLErrorReset();
8557       result = (char *)VSIGetFileSystemOptions((char const *)arg1);
8558       CPLErr eclass = CPLGetLastErrorType();
8559       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
8560         do_confess( CPLGetLastErrorMsg(), 0 );
8561 
8562 
8563 
8564 
8565 
8566       }
8567 
8568 
8569       /*
8570           Make warnings regular Perl warnings. This duplicates the warning
8571           message if DontUseExceptions() is in effect (it is not by default).
8572           */
8573       if ( eclass == CE_Warning ) {
8574         warn( CPLGetLastErrorMsg(), "%s" );
8575       }
8576 
8577 
8578     }
8579     {
8580       /* %typemap(out) const char * */
8581       ST(argvi) = newSVpv(result, 0);
8582       SvUTF8_on(ST(argvi)); /* expecting GDAL to give us UTF-8 */
8583       sv_2mortal(ST(argvi));
8584       argvi++;
8585     }
8586     {
8587       /* %typemap(freearg) (const char* utf8_path) */
8588       if (tmpbuf1) Safefree(tmpbuf1);
8589     }
8590     XSRETURN(argvi);
8591   fail:
8592     {
8593       /* %typemap(freearg) (const char* utf8_path) */
8594       if (tmpbuf1) Safefree(tmpbuf1);
8595     }
8596     SWIG_croak_null();
8597   }
8598 }
8599 
8600 
XS(_wrap_Stat)8601 XS(_wrap_Stat) {
8602   {
8603     char *arg1 = (char *) 0 ;
8604     VSIStatBufL *arg2 = (VSIStatBufL *) 0 ;
8605     U8 *tmpbuf1 = NULL ;
8606     VSIStatBufL sStatBuf2 ;
8607     int argvi = 0;
8608     VSI_RETVAL result;
8609     dXSARGS;
8610 
8611     {
8612       /* %typemap(default) const char * utf8_path */
8613       arg1 = (char *)"";
8614     }
8615     {
8616       /* %typemap(in,numinputs=0) (VSIStatBufL *) (VSIStatBufL sStatBuf2) */
8617       arg2 = &sStatBuf2;
8618     }
8619     if ((items < 0) || (items > 1)) {
8620       SWIG_croak("Usage: Stat(utf8_path);");
8621     }
8622     if (items > 0) {
8623       {
8624         /* %typemap(in,numinputs=1) (const char* utf8_path) (U8 *tmpbuf1) */
8625         arg1 = sv_to_utf8_string(ST(0), &tmpbuf1);
8626       }
8627     }
8628     {
8629       if (!arg1) {
8630         SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
8631       }
8632     }
8633     {
8634       CPLErrorReset();
8635       result = VSIStatL((char const *)arg1,arg2);
8636       CPLErr eclass = CPLGetLastErrorType();
8637       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
8638         do_confess( CPLGetLastErrorMsg(), 0 );
8639 
8640 
8641 
8642 
8643 
8644       }
8645 
8646 
8647       /*
8648           Make warnings regular Perl warnings. This duplicates the warning
8649           message if DontUseExceptions() is in effect (it is not by default).
8650           */
8651       if ( eclass == CE_Warning ) {
8652         warn( CPLGetLastErrorMsg(), "%s" );
8653       }
8654 
8655 
8656     }
8657     {
8658       /* %typemap(out) VSI_RETVAL */
8659     }
8660     {
8661       /* %typemap(argout) (VSIStatBufL *) */
8662       char mode[2];
8663       mode[0] = ' ';
8664       mode[1] = '\0';
8665       if (S_ISREG(sStatBuf2.st_mode)) mode[0] = 'f';
8666       else if (S_ISDIR(sStatBuf2.st_mode)) mode[0] = 'd';
8667       else if (S_ISLNK(sStatBuf2.st_mode)) mode[0] = 'l';
8668       else if (S_ISFIFO(sStatBuf2.st_mode)) mode[0] = 'p';
8669       else if (S_ISSOCK(sStatBuf2.st_mode)) mode[0] = 'S';
8670       else if (S_ISBLK(sStatBuf2.st_mode)) mode[0] = 'b';
8671       else if (S_ISCHR(sStatBuf2.st_mode)) mode[0] = 'c';
8672       EXTEND(SP, argvi+2-items+1);
8673       ST(argvi++) = sv_2mortal(newSVpv(mode, 0));
8674       ST(argvi++) = sv_2mortal(newSVuv(sStatBuf2.st_size));
8675     }
8676     {
8677       /* %typemap(freearg) (const char* utf8_path) */
8678       if (tmpbuf1) Safefree(tmpbuf1);
8679     }
8680 
8681     {
8682       /* %typemap(ret) VSI_RETVAL */
8683       if (result == -1 ) {
8684         do_confess(strerror(errno), 1);
8685       }
8686     }
8687     XSRETURN(argvi);
8688   fail:
8689     {
8690       /* %typemap(freearg) (const char* utf8_path) */
8691       if (tmpbuf1) Safefree(tmpbuf1);
8692     }
8693 
8694     SWIG_croak_null();
8695   }
8696 }
8697 
8698 
XS(_wrap_GetFileMetadata)8699 XS(_wrap_GetFileMetadata) {
8700   {
8701     char *arg1 = (char *) 0 ;
8702     char *arg2 = (char *) 0 ;
8703     char **arg3 = (char **) NULL ;
8704     U8 *tmpbuf1 = NULL ;
8705     int res2 ;
8706     char *buf2 = 0 ;
8707     int alloc2 = 0 ;
8708     int argvi = 0;
8709     char **result = 0 ;
8710     dXSARGS;
8711 
8712     {
8713       /* %typemap(default) const char * utf8_path */
8714       arg1 = (char *)"";
8715     }
8716     if ((items < 0) || (items > 3)) {
8717       SWIG_croak("Usage: GetFileMetadata(utf8_path,domain,options);");
8718     }
8719     if (items > 0) {
8720       {
8721         /* %typemap(in,numinputs=1) (const char* utf8_path) (U8 *tmpbuf1) */
8722         arg1 = sv_to_utf8_string(ST(0), &tmpbuf1);
8723       }
8724     }
8725     if (items > 1) {
8726       res2 = SWIG_AsCharPtrAndSize(ST(1), &buf2, NULL, &alloc2);
8727       if (!SWIG_IsOK(res2)) {
8728         SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "GetFileMetadata" "', argument " "2"" of type '" "char const *""'");
8729       }
8730       arg2 = reinterpret_cast< char * >(buf2);
8731     }
8732     if (items > 2) {
8733       {
8734         /* %typemap(in) char **options */
8735         if (SvOK(ST(2))) {
8736           if (SvROK(ST(2))) {
8737             if (SvTYPE(SvRV(ST(2)))==SVt_PVAV) {
8738               AV *av = (AV*)(SvRV(ST(2)));
8739               for (int i = 0; i < av_len(av)+1; i++) {
8740                 SV *sv = *(av_fetch(av, i, 0));
8741                 bool sf;
8742                 char *tmp = sv_to_utf8_string(sv, NULL, &sf);
8743                 arg3 = CSLAddString(arg3, tmp);
8744                 if (sf) Safefree(tmp); else free(tmp);
8745               }
8746             } else if (SvTYPE(SvRV(ST(2)))==SVt_PVHV) {
8747               HV *hv = (HV*)SvRV(ST(2));
8748               SV *sv;
8749               char *key;
8750               I32 klen;
8751               arg3 = NULL;
8752               hv_iterinit(hv);
8753               while(sv = hv_iternextsv(hv, &key, &klen)) {
8754                 bool sf;
8755                 char *tmp = sv_to_utf8_string(sv, NULL, &sf);
8756                 arg3 = CSLAddNameValue(arg3, key, tmp);
8757                 if (sf) Safefree(tmp); else free(tmp);
8758               }
8759             } else
8760             do_confess(NEED_REF, 1);
8761           } else
8762           do_confess(NEED_REF, 1);
8763         }
8764       }
8765     }
8766     {
8767       if (!arg1) {
8768         SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
8769       }
8770     }
8771     {
8772       CPLErrorReset();
8773       result = (char **)VSIGetFileMetadata((char const *)arg1,(char const *)arg2,arg3);
8774       CPLErr eclass = CPLGetLastErrorType();
8775       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
8776         do_confess( CPLGetLastErrorMsg(), 0 );
8777 
8778 
8779 
8780 
8781 
8782       }
8783 
8784 
8785       /*
8786           Make warnings regular Perl warnings. This duplicates the warning
8787           message if DontUseExceptions() is in effect (it is not by default).
8788           */
8789       if ( eclass == CE_Warning ) {
8790         warn( CPLGetLastErrorMsg(), "%s" );
8791       }
8792 
8793 
8794     }
8795     {
8796       /* %typemap(out) char **dict */
8797       char **stringarray = result;
8798       HV *hv = (HV*)sv_2mortal((SV*)newHV());
8799       if ( stringarray != NULL ) {
8800         while (*stringarray != NULL ) {
8801           char const *valptr;
8802           char *keyptr;
8803           valptr = CPLParseNameValue( *stringarray, &keyptr );
8804           if ( valptr != 0 ) {
8805             hv_store(hv, keyptr, strlen(keyptr), newSVpv(valptr, strlen(valptr)), 0);
8806             CPLFree( keyptr );
8807           }
8808           stringarray++;
8809         }
8810       }
8811       ST(argvi) = newRV((SV*)hv);
8812       sv_2mortal(ST(argvi));
8813       argvi++;
8814     }
8815     {
8816       /* %typemap(freearg) (const char* utf8_path) */
8817       if (tmpbuf1) Safefree(tmpbuf1);
8818     }
8819     if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
8820     {
8821       /* %typemap(freearg) char **options */
8822       if (arg3) CSLDestroy( arg3 );
8823     }
8824     XSRETURN(argvi);
8825   fail:
8826     {
8827       /* %typemap(freearg) (const char* utf8_path) */
8828       if (tmpbuf1) Safefree(tmpbuf1);
8829     }
8830     if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
8831     {
8832       /* %typemap(freearg) char **options */
8833       if (arg3) CSLDestroy( arg3 );
8834     }
8835     SWIG_croak_null();
8836   }
8837 }
8838 
8839 
XS(_wrap_SetFileMetadata)8840 XS(_wrap_SetFileMetadata) {
8841   {
8842     char *arg1 = (char *) 0 ;
8843     char **arg2 = (char **) 0 ;
8844     char *arg3 = (char *) 0 ;
8845     char **arg4 = (char **) NULL ;
8846     U8 *tmpbuf1 = NULL ;
8847     int res3 ;
8848     char *buf3 = 0 ;
8849     int alloc3 = 0 ;
8850     int argvi = 0;
8851     bool result;
8852     dXSARGS;
8853 
8854     {
8855       /* %typemap(default) const char * utf8_path */
8856       arg1 = (char *)"";
8857     }
8858     if ((items < 0) || (items > 4)) {
8859       SWIG_croak("Usage: SetFileMetadata(utf8_path,metadata,domain,options);");
8860     }
8861     if (items > 0) {
8862       {
8863         /* %typemap(in,numinputs=1) (const char* utf8_path) (U8 *tmpbuf1) */
8864         arg1 = sv_to_utf8_string(ST(0), &tmpbuf1);
8865       }
8866     }
8867     if (items > 1) {
8868       {
8869         /* %typemap(in) char **dict */
8870         HV *hv = (HV*)SvRV(ST(1));
8871         SV *sv;
8872         char *key;
8873         I32 klen;
8874         arg2 = NULL;
8875         hv_iterinit(hv);
8876         while(sv = hv_iternextsv(hv,&key,&klen)) {
8877           arg2 = CSLAddNameValue( arg2, key, SvPV_nolen(sv) );
8878         }
8879       }
8880     }
8881     if (items > 2) {
8882       res3 = SWIG_AsCharPtrAndSize(ST(2), &buf3, NULL, &alloc3);
8883       if (!SWIG_IsOK(res3)) {
8884         SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "SetFileMetadata" "', argument " "3"" of type '" "char const *""'");
8885       }
8886       arg3 = reinterpret_cast< char * >(buf3);
8887     }
8888     if (items > 3) {
8889       {
8890         /* %typemap(in) char **options */
8891         if (SvOK(ST(3))) {
8892           if (SvROK(ST(3))) {
8893             if (SvTYPE(SvRV(ST(3)))==SVt_PVAV) {
8894               AV *av = (AV*)(SvRV(ST(3)));
8895               for (int i = 0; i < av_len(av)+1; i++) {
8896                 SV *sv = *(av_fetch(av, i, 0));
8897                 bool sf;
8898                 char *tmp = sv_to_utf8_string(sv, NULL, &sf);
8899                 arg4 = CSLAddString(arg4, tmp);
8900                 if (sf) Safefree(tmp); else free(tmp);
8901               }
8902             } else if (SvTYPE(SvRV(ST(3)))==SVt_PVHV) {
8903               HV *hv = (HV*)SvRV(ST(3));
8904               SV *sv;
8905               char *key;
8906               I32 klen;
8907               arg4 = NULL;
8908               hv_iterinit(hv);
8909               while(sv = hv_iternextsv(hv, &key, &klen)) {
8910                 bool sf;
8911                 char *tmp = sv_to_utf8_string(sv, NULL, &sf);
8912                 arg4 = CSLAddNameValue(arg4, key, tmp);
8913                 if (sf) Safefree(tmp); else free(tmp);
8914               }
8915             } else
8916             do_confess(NEED_REF, 1);
8917           } else
8918           do_confess(NEED_REF, 1);
8919         }
8920       }
8921     }
8922     {
8923       if (!arg1) {
8924         SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
8925       }
8926     }
8927     {
8928       CPLErrorReset();
8929       result = (bool)VSISetFileMetadata((char const *)arg1,arg2,(char const *)arg3,arg4);
8930       CPLErr eclass = CPLGetLastErrorType();
8931       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
8932         do_confess( CPLGetLastErrorMsg(), 0 );
8933 
8934 
8935 
8936 
8937 
8938       }
8939 
8940 
8941       /*
8942           Make warnings regular Perl warnings. This duplicates the warning
8943           message if DontUseExceptions() is in effect (it is not by default).
8944           */
8945       if ( eclass == CE_Warning ) {
8946         warn( CPLGetLastErrorMsg(), "%s" );
8947       }
8948 
8949 
8950     }
8951     ST(argvi) = SWIG_From_bool  SWIG_PERL_CALL_ARGS_1(static_cast< bool >(result)); argvi++ ;
8952     {
8953       /* %typemap(freearg) (const char* utf8_path) */
8954       if (tmpbuf1) Safefree(tmpbuf1);
8955     }
8956     {
8957       /* %typemap(freearg) char **dict */
8958       CSLDestroy( arg2 );
8959     }
8960     if (alloc3 == SWIG_NEWOBJ) delete[] buf3;
8961     {
8962       /* %typemap(freearg) char **options */
8963       if (arg4) CSLDestroy( arg4 );
8964     }
8965     XSRETURN(argvi);
8966   fail:
8967     {
8968       /* %typemap(freearg) (const char* utf8_path) */
8969       if (tmpbuf1) Safefree(tmpbuf1);
8970     }
8971     {
8972       /* %typemap(freearg) char **dict */
8973       CSLDestroy( arg2 );
8974     }
8975     if (alloc3 == SWIG_NEWOBJ) delete[] buf3;
8976     {
8977       /* %typemap(freearg) char **options */
8978       if (arg4) CSLDestroy( arg4 );
8979     }
8980     SWIG_croak_null();
8981   }
8982 }
8983 
8984 
XS(_wrap_VSIFOpenL)8985 XS(_wrap_VSIFOpenL) {
8986   {
8987     char *arg1 = (char *) 0 ;
8988     char *arg2 = (char *) 0 ;
8989     U8 *tmpbuf1 = NULL ;
8990     int res2 ;
8991     char *buf2 = 0 ;
8992     int alloc2 = 0 ;
8993     int argvi = 0;
8994     VSILFILE *result = 0 ;
8995     dXSARGS;
8996 
8997     {
8998       /* %typemap(default) const char * utf8_path */
8999       arg1 = (char *)"";
9000     }
9001     if ((items < 0) || (items > 2)) {
9002       SWIG_croak("Usage: VSIFOpenL(utf8_path,pszMode);");
9003     }
9004     if (items > 0) {
9005       {
9006         /* %typemap(in,numinputs=1) (const char* utf8_path) (U8 *tmpbuf1) */
9007         arg1 = sv_to_utf8_string(ST(0), &tmpbuf1);
9008       }
9009     }
9010     if (items > 1) {
9011       res2 = SWIG_AsCharPtrAndSize(ST(1), &buf2, NULL, &alloc2);
9012       if (!SWIG_IsOK(res2)) {
9013         SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "VSIFOpenL" "', argument " "2"" of type '" "char const *""'");
9014       }
9015       arg2 = reinterpret_cast< char * >(buf2);
9016     }
9017     {
9018       if (!arg1) {
9019         SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
9020       }
9021     }
9022     {
9023       CPLErrorReset();
9024       result = (VSILFILE *)wrapper_VSIFOpenL((char const *)arg1,(char const *)arg2);
9025       CPLErr eclass = CPLGetLastErrorType();
9026       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
9027         do_confess( CPLGetLastErrorMsg(), 0 );
9028 
9029 
9030 
9031 
9032 
9033       }
9034 
9035 
9036       /*
9037           Make warnings regular Perl warnings. This duplicates the warning
9038           message if DontUseExceptions() is in effect (it is not by default).
9039           */
9040       if ( eclass == CE_Warning ) {
9041         warn( CPLGetLastErrorMsg(), "%s" );
9042       }
9043 
9044 
9045     }
9046     ST(argvi) = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_VSILFILE, 0 | SWIG_SHADOW); argvi++ ;
9047     {
9048       /* %typemap(freearg) (const char* utf8_path) */
9049       if (tmpbuf1) Safefree(tmpbuf1);
9050     }
9051     if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
9052     XSRETURN(argvi);
9053   fail:
9054     {
9055       /* %typemap(freearg) (const char* utf8_path) */
9056       if (tmpbuf1) Safefree(tmpbuf1);
9057     }
9058     if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
9059     SWIG_croak_null();
9060   }
9061 }
9062 
9063 
XS(_wrap_VSIFOpenExL)9064 XS(_wrap_VSIFOpenExL) {
9065   {
9066     char *arg1 = (char *) 0 ;
9067     char *arg2 = (char *) 0 ;
9068     int arg3 = (int) FALSE ;
9069     char **arg4 = (char **) NULL ;
9070     U8 *tmpbuf1 = NULL ;
9071     int res2 ;
9072     char *buf2 = 0 ;
9073     int alloc2 = 0 ;
9074     int val3 ;
9075     int ecode3 = 0 ;
9076     int argvi = 0;
9077     VSILFILE *result = 0 ;
9078     dXSARGS;
9079 
9080     {
9081       /* %typemap(default) const char * utf8_path */
9082       arg1 = (char *)"";
9083     }
9084     if ((items < 0) || (items > 4)) {
9085       SWIG_croak("Usage: VSIFOpenExL(utf8_path,pszMode,bSetError,options);");
9086     }
9087     if (items > 0) {
9088       {
9089         /* %typemap(in,numinputs=1) (const char* utf8_path) (U8 *tmpbuf1) */
9090         arg1 = sv_to_utf8_string(ST(0), &tmpbuf1);
9091       }
9092     }
9093     if (items > 1) {
9094       res2 = SWIG_AsCharPtrAndSize(ST(1), &buf2, NULL, &alloc2);
9095       if (!SWIG_IsOK(res2)) {
9096         SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "VSIFOpenExL" "', argument " "2"" of type '" "char const *""'");
9097       }
9098       arg2 = reinterpret_cast< char * >(buf2);
9099     }
9100     if (items > 2) {
9101       ecode3 = SWIG_AsVal_int SWIG_PERL_CALL_ARGS_2(ST(2), &val3);
9102       if (!SWIG_IsOK(ecode3)) {
9103         SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "VSIFOpenExL" "', argument " "3"" of type '" "int""'");
9104       }
9105       arg3 = static_cast< int >(val3);
9106     }
9107     if (items > 3) {
9108       {
9109         /* %typemap(in) char **options */
9110         if (SvOK(ST(3))) {
9111           if (SvROK(ST(3))) {
9112             if (SvTYPE(SvRV(ST(3)))==SVt_PVAV) {
9113               AV *av = (AV*)(SvRV(ST(3)));
9114               for (int i = 0; i < av_len(av)+1; i++) {
9115                 SV *sv = *(av_fetch(av, i, 0));
9116                 bool sf;
9117                 char *tmp = sv_to_utf8_string(sv, NULL, &sf);
9118                 arg4 = CSLAddString(arg4, tmp);
9119                 if (sf) Safefree(tmp); else free(tmp);
9120               }
9121             } else if (SvTYPE(SvRV(ST(3)))==SVt_PVHV) {
9122               HV *hv = (HV*)SvRV(ST(3));
9123               SV *sv;
9124               char *key;
9125               I32 klen;
9126               arg4 = NULL;
9127               hv_iterinit(hv);
9128               while(sv = hv_iternextsv(hv, &key, &klen)) {
9129                 bool sf;
9130                 char *tmp = sv_to_utf8_string(sv, NULL, &sf);
9131                 arg4 = CSLAddNameValue(arg4, key, tmp);
9132                 if (sf) Safefree(tmp); else free(tmp);
9133               }
9134             } else
9135             do_confess(NEED_REF, 1);
9136           } else
9137           do_confess(NEED_REF, 1);
9138         }
9139       }
9140     }
9141     {
9142       if (!arg1) {
9143         SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
9144       }
9145     }
9146     {
9147       CPLErrorReset();
9148       result = (VSILFILE *)wrapper_VSIFOpenExL((char const *)arg1,(char const *)arg2,arg3,arg4);
9149       CPLErr eclass = CPLGetLastErrorType();
9150       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
9151         do_confess( CPLGetLastErrorMsg(), 0 );
9152 
9153 
9154 
9155 
9156 
9157       }
9158 
9159 
9160       /*
9161           Make warnings regular Perl warnings. This duplicates the warning
9162           message if DontUseExceptions() is in effect (it is not by default).
9163           */
9164       if ( eclass == CE_Warning ) {
9165         warn( CPLGetLastErrorMsg(), "%s" );
9166       }
9167 
9168 
9169     }
9170     ST(argvi) = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_VSILFILE, 0 | SWIG_SHADOW); argvi++ ;
9171     {
9172       /* %typemap(freearg) (const char* utf8_path) */
9173       if (tmpbuf1) Safefree(tmpbuf1);
9174     }
9175     if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
9176 
9177     {
9178       /* %typemap(freearg) char **options */
9179       if (arg4) CSLDestroy( arg4 );
9180     }
9181     XSRETURN(argvi);
9182   fail:
9183     {
9184       /* %typemap(freearg) (const char* utf8_path) */
9185       if (tmpbuf1) Safefree(tmpbuf1);
9186     }
9187     if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
9188 
9189     {
9190       /* %typemap(freearg) char **options */
9191       if (arg4) CSLDestroy( arg4 );
9192     }
9193     SWIG_croak_null();
9194   }
9195 }
9196 
9197 
XS(_wrap_VSIFEofL)9198 XS(_wrap_VSIFEofL) {
9199   {
9200     VSILFILE *arg1 = (VSILFILE *) 0 ;
9201     void *argp1 = 0 ;
9202     int res1 = 0 ;
9203     int argvi = 0;
9204     int result;
9205     dXSARGS;
9206 
9207     if ((items < 1) || (items > 1)) {
9208       SWIG_croak("Usage: VSIFEofL(fp);");
9209     }
9210     res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_VSILFILE, 0 |  0 );
9211     if (!SWIG_IsOK(res1)) {
9212       SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "VSIFEofL" "', argument " "1"" of type '" "VSILFILE *""'");
9213     }
9214     arg1 = reinterpret_cast< VSILFILE * >(argp1);
9215     {
9216       if (!arg1) {
9217         SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
9218       }
9219     }
9220     {
9221       CPLErrorReset();
9222       result = (int)VSIFEofL(arg1);
9223       CPLErr eclass = CPLGetLastErrorType();
9224       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
9225         do_confess( CPLGetLastErrorMsg(), 0 );
9226 
9227 
9228 
9229 
9230 
9231       }
9232 
9233 
9234       /*
9235           Make warnings regular Perl warnings. This duplicates the warning
9236           message if DontUseExceptions() is in effect (it is not by default).
9237           */
9238       if ( eclass == CE_Warning ) {
9239         warn( CPLGetLastErrorMsg(), "%s" );
9240       }
9241 
9242 
9243     }
9244     ST(argvi) = SWIG_From_int  SWIG_PERL_CALL_ARGS_1(static_cast< int >(result)); argvi++ ;
9245 
9246     XSRETURN(argvi);
9247   fail:
9248 
9249     SWIG_croak_null();
9250   }
9251 }
9252 
9253 
XS(_wrap_VSIFFlushL)9254 XS(_wrap_VSIFFlushL) {
9255   {
9256     VSILFILE *arg1 = (VSILFILE *) 0 ;
9257     void *argp1 = 0 ;
9258     int res1 = 0 ;
9259     int argvi = 0;
9260     int result;
9261     dXSARGS;
9262 
9263     if ((items < 1) || (items > 1)) {
9264       SWIG_croak("Usage: VSIFFlushL(fp);");
9265     }
9266     res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_VSILFILE, 0 |  0 );
9267     if (!SWIG_IsOK(res1)) {
9268       SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "VSIFFlushL" "', argument " "1"" of type '" "VSILFILE *""'");
9269     }
9270     arg1 = reinterpret_cast< VSILFILE * >(argp1);
9271     {
9272       if (!arg1) {
9273         SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
9274       }
9275     }
9276     {
9277       CPLErrorReset();
9278       result = (int)VSIFFlushL(arg1);
9279       CPLErr eclass = CPLGetLastErrorType();
9280       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
9281         do_confess( CPLGetLastErrorMsg(), 0 );
9282 
9283 
9284 
9285 
9286 
9287       }
9288 
9289 
9290       /*
9291           Make warnings regular Perl warnings. This duplicates the warning
9292           message if DontUseExceptions() is in effect (it is not by default).
9293           */
9294       if ( eclass == CE_Warning ) {
9295         warn( CPLGetLastErrorMsg(), "%s" );
9296       }
9297 
9298 
9299     }
9300     ST(argvi) = SWIG_From_int  SWIG_PERL_CALL_ARGS_1(static_cast< int >(result)); argvi++ ;
9301 
9302     XSRETURN(argvi);
9303   fail:
9304 
9305     SWIG_croak_null();
9306   }
9307 }
9308 
9309 
XS(_wrap_VSIFCloseL)9310 XS(_wrap_VSIFCloseL) {
9311   {
9312     VSILFILE *arg1 = (VSILFILE *) 0 ;
9313     void *argp1 = 0 ;
9314     int res1 = 0 ;
9315     int argvi = 0;
9316     VSI_RETVAL result;
9317     dXSARGS;
9318 
9319     if ((items < 1) || (items > 1)) {
9320       SWIG_croak("Usage: VSIFCloseL(fp);");
9321     }
9322     res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_VSILFILE, 0 |  0 );
9323     if (!SWIG_IsOK(res1)) {
9324       SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "VSIFCloseL" "', argument " "1"" of type '" "VSILFILE *""'");
9325     }
9326     arg1 = reinterpret_cast< VSILFILE * >(argp1);
9327     {
9328       if (!arg1) {
9329         SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
9330       }
9331     }
9332     {
9333       CPLErrorReset();
9334       result = VSIFCloseL(arg1);
9335       CPLErr eclass = CPLGetLastErrorType();
9336       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
9337         do_confess( CPLGetLastErrorMsg(), 0 );
9338 
9339 
9340 
9341 
9342 
9343       }
9344 
9345 
9346       /*
9347           Make warnings regular Perl warnings. This duplicates the warning
9348           message if DontUseExceptions() is in effect (it is not by default).
9349           */
9350       if ( eclass == CE_Warning ) {
9351         warn( CPLGetLastErrorMsg(), "%s" );
9352       }
9353 
9354 
9355     }
9356     {
9357       /* %typemap(out) VSI_RETVAL */
9358     }
9359 
9360     {
9361       /* %typemap(ret) VSI_RETVAL */
9362       if (result == -1 ) {
9363         do_confess(strerror(errno), 1);
9364       }
9365     }
9366     XSRETURN(argvi);
9367   fail:
9368 
9369     SWIG_croak_null();
9370   }
9371 }
9372 
9373 
XS(_wrap_VSIFSeekL)9374 XS(_wrap_VSIFSeekL) {
9375   {
9376     VSILFILE *arg1 = (VSILFILE *) 0 ;
9377     long arg2 ;
9378     int arg3 ;
9379     void *argp1 = 0 ;
9380     int res1 = 0 ;
9381     long val2 ;
9382     int ecode2 = 0 ;
9383     int val3 ;
9384     int ecode3 = 0 ;
9385     int argvi = 0;
9386     VSI_RETVAL result;
9387     dXSARGS;
9388 
9389     if ((items < 3) || (items > 3)) {
9390       SWIG_croak("Usage: VSIFSeekL(fp,offset,whence);");
9391     }
9392     res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_VSILFILE, 0 |  0 );
9393     if (!SWIG_IsOK(res1)) {
9394       SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "VSIFSeekL" "', argument " "1"" of type '" "VSILFILE *""'");
9395     }
9396     arg1 = reinterpret_cast< VSILFILE * >(argp1);
9397     ecode2 = SWIG_AsVal_long SWIG_PERL_CALL_ARGS_2(ST(1), &val2);
9398     if (!SWIG_IsOK(ecode2)) {
9399       SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "VSIFSeekL" "', argument " "2"" of type '" "long""'");
9400     }
9401     arg2 = static_cast< long >(val2);
9402     ecode3 = SWIG_AsVal_int SWIG_PERL_CALL_ARGS_2(ST(2), &val3);
9403     if (!SWIG_IsOK(ecode3)) {
9404       SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "VSIFSeekL" "', argument " "3"" of type '" "int""'");
9405     }
9406     arg3 = static_cast< int >(val3);
9407     {
9408       if (!arg1) {
9409         SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
9410       }
9411     }
9412     {
9413       CPLErrorReset();
9414       result = VSIFSeekL(arg1,arg2,arg3);
9415       CPLErr eclass = CPLGetLastErrorType();
9416       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
9417         do_confess( CPLGetLastErrorMsg(), 0 );
9418 
9419 
9420 
9421 
9422 
9423       }
9424 
9425 
9426       /*
9427           Make warnings regular Perl warnings. This duplicates the warning
9428           message if DontUseExceptions() is in effect (it is not by default).
9429           */
9430       if ( eclass == CE_Warning ) {
9431         warn( CPLGetLastErrorMsg(), "%s" );
9432       }
9433 
9434 
9435     }
9436     {
9437       /* %typemap(out) VSI_RETVAL */
9438     }
9439 
9440 
9441 
9442     {
9443       /* %typemap(ret) VSI_RETVAL */
9444       if (result == -1 ) {
9445         do_confess(strerror(errno), 1);
9446       }
9447     }
9448     XSRETURN(argvi);
9449   fail:
9450 
9451 
9452 
9453     SWIG_croak_null();
9454   }
9455 }
9456 
9457 
XS(_wrap_VSIFTellL)9458 XS(_wrap_VSIFTellL) {
9459   {
9460     VSILFILE *arg1 = (VSILFILE *) 0 ;
9461     void *argp1 = 0 ;
9462     int res1 = 0 ;
9463     int argvi = 0;
9464     long result;
9465     dXSARGS;
9466 
9467     if ((items < 1) || (items > 1)) {
9468       SWIG_croak("Usage: VSIFTellL(fp);");
9469     }
9470     res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_VSILFILE, 0 |  0 );
9471     if (!SWIG_IsOK(res1)) {
9472       SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "VSIFTellL" "', argument " "1"" of type '" "VSILFILE *""'");
9473     }
9474     arg1 = reinterpret_cast< VSILFILE * >(argp1);
9475     {
9476       if (!arg1) {
9477         SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
9478       }
9479     }
9480     {
9481       CPLErrorReset();
9482       result = (long)VSIFTellL(arg1);
9483       CPLErr eclass = CPLGetLastErrorType();
9484       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
9485         do_confess( CPLGetLastErrorMsg(), 0 );
9486 
9487 
9488 
9489 
9490 
9491       }
9492 
9493 
9494       /*
9495           Make warnings regular Perl warnings. This duplicates the warning
9496           message if DontUseExceptions() is in effect (it is not by default).
9497           */
9498       if ( eclass == CE_Warning ) {
9499         warn( CPLGetLastErrorMsg(), "%s" );
9500       }
9501 
9502 
9503     }
9504     ST(argvi) = SWIG_From_long  SWIG_PERL_CALL_ARGS_1(static_cast< long >(result)); argvi++ ;
9505 
9506     XSRETURN(argvi);
9507   fail:
9508 
9509     SWIG_croak_null();
9510   }
9511 }
9512 
9513 
XS(_wrap_VSIFTruncateL)9514 XS(_wrap_VSIFTruncateL) {
9515   {
9516     VSILFILE *arg1 = (VSILFILE *) 0 ;
9517     long arg2 ;
9518     void *argp1 = 0 ;
9519     int res1 = 0 ;
9520     long val2 ;
9521     int ecode2 = 0 ;
9522     int argvi = 0;
9523     VSI_RETVAL result;
9524     dXSARGS;
9525 
9526     if ((items < 2) || (items > 2)) {
9527       SWIG_croak("Usage: VSIFTruncateL(fp,length);");
9528     }
9529     res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_VSILFILE, 0 |  0 );
9530     if (!SWIG_IsOK(res1)) {
9531       SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "VSIFTruncateL" "', argument " "1"" of type '" "VSILFILE *""'");
9532     }
9533     arg1 = reinterpret_cast< VSILFILE * >(argp1);
9534     ecode2 = SWIG_AsVal_long SWIG_PERL_CALL_ARGS_2(ST(1), &val2);
9535     if (!SWIG_IsOK(ecode2)) {
9536       SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "VSIFTruncateL" "', argument " "2"" of type '" "long""'");
9537     }
9538     arg2 = static_cast< long >(val2);
9539     {
9540       if (!arg1) {
9541         SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
9542       }
9543     }
9544     {
9545       CPLErrorReset();
9546       result = VSIFTruncateL(arg1,arg2);
9547       CPLErr eclass = CPLGetLastErrorType();
9548       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
9549         do_confess( CPLGetLastErrorMsg(), 0 );
9550 
9551 
9552 
9553 
9554 
9555       }
9556 
9557 
9558       /*
9559           Make warnings regular Perl warnings. This duplicates the warning
9560           message if DontUseExceptions() is in effect (it is not by default).
9561           */
9562       if ( eclass == CE_Warning ) {
9563         warn( CPLGetLastErrorMsg(), "%s" );
9564       }
9565 
9566 
9567     }
9568     {
9569       /* %typemap(out) VSI_RETVAL */
9570     }
9571 
9572 
9573     {
9574       /* %typemap(ret) VSI_RETVAL */
9575       if (result == -1 ) {
9576         do_confess(strerror(errno), 1);
9577       }
9578     }
9579     XSRETURN(argvi);
9580   fail:
9581 
9582 
9583     SWIG_croak_null();
9584   }
9585 }
9586 
9587 
XS(_wrap_VSIFWriteL)9588 XS(_wrap_VSIFWriteL) {
9589   {
9590     void *arg1 = (void *) 0 ;
9591     size_t arg2 ;
9592     size_t arg3 ;
9593     VSILFILE *arg4 = (VSILFILE *) 0 ;
9594     void *argp4 = 0 ;
9595     int res4 = 0 ;
9596     int argvi = 0;
9597     size_t result;
9598     dXSARGS;
9599 
9600     if ((items < 2) || (items > 2)) {
9601       SWIG_croak("Usage: VSIFWriteL(pBuffer,nSize,nCount,fp);");
9602     }
9603     {
9604       /* %typemap(in,numinputs=1) (const void *pBuffer, size_t nSize, size_t nCount) */
9605       size_t len;
9606       arg1 = SvPV(ST(0), len);
9607       arg2 = 1;
9608       arg3 = len;
9609     }
9610     res4 = SWIG_ConvertPtr(ST(1), &argp4,SWIGTYPE_p_VSILFILE, 0 |  0 );
9611     if (!SWIG_IsOK(res4)) {
9612       SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "VSIFWriteL" "', argument " "4"" of type '" "VSILFILE *""'");
9613     }
9614     arg4 = reinterpret_cast< VSILFILE * >(argp4);
9615     {
9616       if (!arg4) {
9617         SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
9618       }
9619     }
9620     {
9621       CPLErrorReset();
9622       result = VSIFWriteL((void const *)arg1,arg2,arg3,arg4);
9623       CPLErr eclass = CPLGetLastErrorType();
9624       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
9625         do_confess( CPLGetLastErrorMsg(), 0 );
9626 
9627 
9628 
9629 
9630 
9631       }
9632 
9633 
9634       /*
9635           Make warnings regular Perl warnings. This duplicates the warning
9636           message if DontUseExceptions() is in effect (it is not by default).
9637           */
9638       if ( eclass == CE_Warning ) {
9639         warn( CPLGetLastErrorMsg(), "%s" );
9640       }
9641 
9642 
9643     }
9644     ST(argvi) = SWIG_From_size_t  SWIG_PERL_CALL_ARGS_1(static_cast< size_t >(result)); argvi++ ;
9645 
9646     XSRETURN(argvi);
9647   fail:
9648 
9649     SWIG_croak_null();
9650   }
9651 }
9652 
9653 
XS(_wrap_VSIFReadL)9654 XS(_wrap_VSIFReadL) {
9655   {
9656     void *arg1 = (void *) 0 ;
9657     size_t arg2 ;
9658     size_t arg3 ;
9659     VSILFILE *arg4 = (VSILFILE *) 0 ;
9660     void *argp4 = 0 ;
9661     int res4 = 0 ;
9662     int argvi = 0;
9663     SV * _saved[1] ;
9664     size_t result;
9665     dXSARGS;
9666 
9667     if ((items < 2) || (items > 2)) {
9668       SWIG_croak("Usage: VSIFReadL(pBuffer,nSize,nCount,fp);");
9669     }
9670     {
9671       /* %typemap(in,numinputs=1) (void *pBuffer, size_t nSize, size_t nCount) */
9672       size_t len = SvIV(ST(0));
9673       arg1 = CPLMalloc(len);
9674       if (!arg1)
9675       SWIG_fail;
9676       arg2 = 1;
9677       arg3 = len;
9678     }
9679     res4 = SWIG_ConvertPtr(ST(1), &argp4,SWIGTYPE_p_VSILFILE, 0 |  0 );
9680     if (!SWIG_IsOK(res4)) {
9681       SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "VSIFReadL" "', argument " "4"" of type '" "VSILFILE *""'");
9682     }
9683     arg4 = reinterpret_cast< VSILFILE * >(argp4);
9684     {
9685       if (!arg4) {
9686         SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
9687       }
9688     }
9689     _saved[0] = ST(0);
9690     {
9691       CPLErrorReset();
9692       result = VSIFReadL(arg1,arg2,arg3,arg4);
9693       CPLErr eclass = CPLGetLastErrorType();
9694       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
9695         do_confess( CPLGetLastErrorMsg(), 0 );
9696 
9697 
9698 
9699 
9700 
9701       }
9702 
9703 
9704       /*
9705           Make warnings regular Perl warnings. This duplicates the warning
9706           message if DontUseExceptions() is in effect (it is not by default).
9707           */
9708       if ( eclass == CE_Warning ) {
9709         warn( CPLGetLastErrorMsg(), "%s" );
9710       }
9711 
9712 
9713     }
9714     {
9715       /* %typemap(out) (size_t VSIFReadL) */
9716     }
9717     {
9718       /* %typemap(argout) (void *pBuffer, size_t nSize, size_t nCount) */
9719       if (result) {
9720         ST(argvi) = sv_2mortal(newSVpvn((char*)arg1, result));
9721       } else {
9722         ST(argvi) = &PL_sv_undef;
9723       }
9724       CPLFree(arg1);
9725       argvi++;
9726     }
9727 
9728     XSRETURN(argvi);
9729   fail:
9730 
9731     SWIG_croak_null();
9732   }
9733 }
9734 
9735 
XS(_wrap_VSIStdoutSetRedirection)9736 XS(_wrap_VSIStdoutSetRedirection) {
9737   {
9738     VSIWriteFunction arg1 ;
9739     FILE *arg2 = (FILE *) 0 ;
9740     int argvi = 0;
9741     dXSARGS;
9742 
9743     if ((items < 1) || (items > 1)) {
9744       SWIG_croak("Usage: VSIStdoutSetRedirection(pFct,stream);");
9745     }
9746     {
9747       /* %typemap(in) (VSIWriteFunction pFct) */
9748       if (VSIStdoutSetRedirectionFct != &PL_sv_undef) {
9749         SvREFCNT_dec(VSIStdoutSetRedirectionFct);
9750       }
9751       if (SvOK(ST(0))) {
9752         if (SvROK(ST(0))) {
9753           if (SvTYPE(SvRV(ST(0))) != SVt_PVCV) {
9754             do_confess(NEED_CODE_REF, 1);
9755           } else {
9756             VSIStdoutSetRedirectionFct = newRV_inc(SvRV((SV *)ST(0)));
9757             arg1 = &callback_fwrite;
9758           }
9759         } else {
9760           do_confess(NEED_CODE_REF, 1);
9761         }
9762       } else
9763       VSIStdoutSetRedirectionFct = &PL_sv_undef;
9764     }
9765     {
9766       CPLErrorReset();
9767       VSIStdoutSetRedirection(arg1,arg2);
9768       CPLErr eclass = CPLGetLastErrorType();
9769       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
9770         do_confess( CPLGetLastErrorMsg(), 0 );
9771 
9772 
9773 
9774 
9775 
9776       }
9777 
9778 
9779       /*
9780           Make warnings regular Perl warnings. This duplicates the warning
9781           message if DontUseExceptions() is in effect (it is not by default).
9782           */
9783       if ( eclass == CE_Warning ) {
9784         warn( CPLGetLastErrorMsg(), "%s" );
9785       }
9786 
9787 
9788     }
9789     {
9790       /* %typemap(out) void */
9791     }
9792 
9793     XSRETURN(argvi);
9794   fail:
9795 
9796     SWIG_croak_null();
9797   }
9798 }
9799 
9800 
XS(_wrap_VSIStdoutUnsetRedirection)9801 XS(_wrap_VSIStdoutUnsetRedirection) {
9802   {
9803     int argvi = 0;
9804     dXSARGS;
9805 
9806     if ((items < 0) || (items > 0)) {
9807       SWIG_croak("Usage: VSIStdoutUnsetRedirection();");
9808     }
9809     {
9810       CPLErrorReset();
9811       VSIStdoutUnsetRedirection();
9812       CPLErr eclass = CPLGetLastErrorType();
9813       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
9814         do_confess( CPLGetLastErrorMsg(), 0 );
9815 
9816 
9817 
9818 
9819 
9820       }
9821 
9822 
9823       /*
9824           Make warnings regular Perl warnings. This duplicates the warning
9825           message if DontUseExceptions() is in effect (it is not by default).
9826           */
9827       if ( eclass == CE_Warning ) {
9828         warn( CPLGetLastErrorMsg(), "%s" );
9829       }
9830 
9831 
9832     }
9833     {
9834       /* %typemap(out) void */
9835     }
9836     XSRETURN(argvi);
9837   fail:
9838     SWIG_croak_null();
9839   }
9840 }
9841 
9842 
XS(_wrap_VSICurlClearCache)9843 XS(_wrap_VSICurlClearCache) {
9844   {
9845     int argvi = 0;
9846     dXSARGS;
9847 
9848     if ((items < 0) || (items > 0)) {
9849       SWIG_croak("Usage: VSICurlClearCache();");
9850     }
9851     {
9852       CPLErrorReset();
9853       VSICurlClearCache();
9854       CPLErr eclass = CPLGetLastErrorType();
9855       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
9856         do_confess( CPLGetLastErrorMsg(), 0 );
9857 
9858 
9859 
9860 
9861 
9862       }
9863 
9864 
9865       /*
9866           Make warnings regular Perl warnings. This duplicates the warning
9867           message if DontUseExceptions() is in effect (it is not by default).
9868           */
9869       if ( eclass == CE_Warning ) {
9870         warn( CPLGetLastErrorMsg(), "%s" );
9871       }
9872 
9873 
9874     }
9875     {
9876       /* %typemap(out) void */
9877     }
9878     XSRETURN(argvi);
9879   fail:
9880     SWIG_croak_null();
9881   }
9882 }
9883 
9884 
XS(_wrap_VSICurlPartialClearCache)9885 XS(_wrap_VSICurlPartialClearCache) {
9886   {
9887     char *arg1 = (char *) 0 ;
9888     U8 *tmpbuf1 = NULL ;
9889     int argvi = 0;
9890     dXSARGS;
9891 
9892     {
9893       /* %typemap(default) const char * utf8_path */
9894       arg1 = (char *)"";
9895     }
9896     if ((items < 0) || (items > 1)) {
9897       SWIG_croak("Usage: VSICurlPartialClearCache(utf8_path);");
9898     }
9899     if (items > 0) {
9900       {
9901         /* %typemap(in,numinputs=1) (const char* utf8_path) (U8 *tmpbuf1) */
9902         arg1 = sv_to_utf8_string(ST(0), &tmpbuf1);
9903       }
9904     }
9905     {
9906       if (!arg1) {
9907         SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
9908       }
9909     }
9910     {
9911       CPLErrorReset();
9912       VSICurlPartialClearCache((char const *)arg1);
9913       CPLErr eclass = CPLGetLastErrorType();
9914       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
9915         do_confess( CPLGetLastErrorMsg(), 0 );
9916 
9917 
9918 
9919 
9920 
9921       }
9922 
9923 
9924       /*
9925           Make warnings regular Perl warnings. This duplicates the warning
9926           message if DontUseExceptions() is in effect (it is not by default).
9927           */
9928       if ( eclass == CE_Warning ) {
9929         warn( CPLGetLastErrorMsg(), "%s" );
9930       }
9931 
9932 
9933     }
9934     {
9935       /* %typemap(out) void */
9936     }
9937     {
9938       /* %typemap(freearg) (const char* utf8_path) */
9939       if (tmpbuf1) Safefree(tmpbuf1);
9940     }
9941     XSRETURN(argvi);
9942   fail:
9943     {
9944       /* %typemap(freearg) (const char* utf8_path) */
9945       if (tmpbuf1) Safefree(tmpbuf1);
9946     }
9947     SWIG_croak_null();
9948   }
9949 }
9950 
9951 
XS(_wrap_NetworkStatsReset)9952 XS(_wrap_NetworkStatsReset) {
9953   {
9954     int argvi = 0;
9955     dXSARGS;
9956 
9957     if ((items < 0) || (items > 0)) {
9958       SWIG_croak("Usage: NetworkStatsReset();");
9959     }
9960     {
9961       CPLErrorReset();
9962       VSINetworkStatsReset();
9963       CPLErr eclass = CPLGetLastErrorType();
9964       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
9965         do_confess( CPLGetLastErrorMsg(), 0 );
9966 
9967 
9968 
9969 
9970 
9971       }
9972 
9973 
9974       /*
9975           Make warnings regular Perl warnings. This duplicates the warning
9976           message if DontUseExceptions() is in effect (it is not by default).
9977           */
9978       if ( eclass == CE_Warning ) {
9979         warn( CPLGetLastErrorMsg(), "%s" );
9980       }
9981 
9982 
9983     }
9984     {
9985       /* %typemap(out) void */
9986     }
9987     XSRETURN(argvi);
9988   fail:
9989     SWIG_croak_null();
9990   }
9991 }
9992 
9993 
XS(_wrap_NetworkStatsGetAsSerializedJSON)9994 XS(_wrap_NetworkStatsGetAsSerializedJSON) {
9995   {
9996     char **arg1 = (char **) NULL ;
9997     int argvi = 0;
9998     retStringAndCPLFree *result = 0 ;
9999     dXSARGS;
10000 
10001     if ((items < 0) || (items > 1)) {
10002       SWIG_croak("Usage: NetworkStatsGetAsSerializedJSON(options);");
10003     }
10004     if (items > 0) {
10005       {
10006         /* %typemap(in) char **options */
10007         if (SvOK(ST(0))) {
10008           if (SvROK(ST(0))) {
10009             if (SvTYPE(SvRV(ST(0)))==SVt_PVAV) {
10010               AV *av = (AV*)(SvRV(ST(0)));
10011               for (int i = 0; i < av_len(av)+1; i++) {
10012                 SV *sv = *(av_fetch(av, i, 0));
10013                 bool sf;
10014                 char *tmp = sv_to_utf8_string(sv, NULL, &sf);
10015                 arg1 = CSLAddString(arg1, tmp);
10016                 if (sf) Safefree(tmp); else free(tmp);
10017               }
10018             } else if (SvTYPE(SvRV(ST(0)))==SVt_PVHV) {
10019               HV *hv = (HV*)SvRV(ST(0));
10020               SV *sv;
10021               char *key;
10022               I32 klen;
10023               arg1 = NULL;
10024               hv_iterinit(hv);
10025               while(sv = hv_iternextsv(hv, &key, &klen)) {
10026                 bool sf;
10027                 char *tmp = sv_to_utf8_string(sv, NULL, &sf);
10028                 arg1 = CSLAddNameValue(arg1, key, tmp);
10029                 if (sf) Safefree(tmp); else free(tmp);
10030               }
10031             } else
10032             do_confess(NEED_REF, 1);
10033           } else
10034           do_confess(NEED_REF, 1);
10035         }
10036       }
10037     }
10038     {
10039       CPLErrorReset();
10040       result = (retStringAndCPLFree *)VSINetworkStatsGetAsSerializedJSON(arg1);
10041       CPLErr eclass = CPLGetLastErrorType();
10042       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
10043         do_confess( CPLGetLastErrorMsg(), 0 );
10044 
10045 
10046 
10047 
10048 
10049       }
10050 
10051 
10052       /*
10053           Make warnings regular Perl warnings. This duplicates the warning
10054           message if DontUseExceptions() is in effect (it is not by default).
10055           */
10056       if ( eclass == CE_Warning ) {
10057         warn( CPLGetLastErrorMsg(), "%s" );
10058       }
10059 
10060 
10061     }
10062 
10063     /* %typemap(out) (retStringAndCPLFree*) */
10064     if(result)
10065     {
10066       ST(argvi) = SWIG_FromCharPtr((const char *)result);
10067       CPLFree(result);
10068     }
10069     else
10070     {
10071       ST(argvi) = &PL_sv_undef;
10072     }
10073     argvi++ ;
10074 
10075     {
10076       /* %typemap(freearg) char **options */
10077       if (arg1) CSLDestroy( arg1 );
10078     }
10079     XSRETURN(argvi);
10080   fail:
10081     {
10082       /* %typemap(freearg) char **options */
10083       if (arg1) CSLDestroy( arg1 );
10084     }
10085     SWIG_croak_null();
10086   }
10087 }
10088 
10089 
XS(_wrap_ParseCommandLine)10090 XS(_wrap_ParseCommandLine) {
10091   {
10092     char *arg1 = (char *) 0 ;
10093     U8 *tmpbuf1 = NULL ;
10094     int argvi = 0;
10095     char **result = 0 ;
10096     dXSARGS;
10097 
10098     {
10099       /* %typemap(default) const char * utf8_path */
10100       arg1 = (char *)"";
10101     }
10102     if ((items < 0) || (items > 1)) {
10103       SWIG_croak("Usage: ParseCommandLine(utf8_path);");
10104     }
10105     if (items > 0) {
10106       {
10107         /* %typemap(in,numinputs=1) (const char* utf8_path) (U8 *tmpbuf1) */
10108         arg1 = sv_to_utf8_string(ST(0), &tmpbuf1);
10109       }
10110     }
10111     {
10112       if (!arg1) {
10113         SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
10114       }
10115     }
10116     {
10117       CPLErrorReset();
10118       result = (char **)CSLParseCommandLine((char const *)arg1);
10119       CPLErr eclass = CPLGetLastErrorType();
10120       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
10121         do_confess( CPLGetLastErrorMsg(), 0 );
10122 
10123 
10124 
10125 
10126 
10127       }
10128 
10129 
10130       /*
10131           Make warnings regular Perl warnings. This duplicates the warning
10132           message if DontUseExceptions() is in effect (it is not by default).
10133           */
10134       if ( eclass == CE_Warning ) {
10135         warn( CPLGetLastErrorMsg(), "%s" );
10136       }
10137 
10138 
10139     }
10140     {
10141       /* %typemap(out) char **CSL */
10142       if (GIMME_V == G_ARRAY) {
10143         if (result) {
10144           int n = CSLCount(result);
10145           EXTEND(SP, argvi+n-items+1);
10146           int i;
10147           for (i = 0; result[i]; i++) {
10148             SV *sv = newSVpv(result[i], 0);
10149             SvUTF8_on(sv); /* expecting GDAL to give us UTF-8 */
10150             ST(argvi++) = sv_2mortal(sv);
10151           }
10152           CSLDestroy(result);
10153         }
10154       } else {
10155         AV *av = (AV*)sv_2mortal((SV*)newAV());
10156         if (result) {
10157           int i;
10158           for (i = 0; result[i]; i++) {
10159             SV *sv = newSVpv(result[i], 0);
10160             SvUTF8_on(sv); /* expecting GDAL to give us UTF-8 */
10161             av_push(av, sv);
10162           }
10163           CSLDestroy(result);
10164         }
10165         ST(argvi) = newRV((SV*)av);
10166         sv_2mortal(ST(argvi));
10167         argvi++;
10168       }
10169     }
10170     {
10171       /* %typemap(freearg) (const char* utf8_path) */
10172       if (tmpbuf1) Safefree(tmpbuf1);
10173     }
10174     XSRETURN(argvi);
10175   fail:
10176     {
10177       /* %typemap(freearg) (const char* utf8_path) */
10178       if (tmpbuf1) Safefree(tmpbuf1);
10179     }
10180     SWIG_croak_null();
10181   }
10182 }
10183 
10184 
XS(_wrap_MajorObject_GetDescription)10185 XS(_wrap_MajorObject_GetDescription) {
10186   {
10187     GDALMajorObjectShadow *arg1 = (GDALMajorObjectShadow *) 0 ;
10188     void *argp1 = 0 ;
10189     int res1 = 0 ;
10190     int argvi = 0;
10191     char *result = 0 ;
10192     dXSARGS;
10193 
10194     if ((items < 1) || (items > 1)) {
10195       SWIG_croak("Usage: MajorObject_GetDescription(self);");
10196     }
10197     res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_GDALMajorObjectShadow, 0 |  0 );
10198     if (!SWIG_IsOK(res1)) {
10199       SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "MajorObject_GetDescription" "', argument " "1"" of type '" "GDALMajorObjectShadow *""'");
10200     }
10201     arg1 = reinterpret_cast< GDALMajorObjectShadow * >(argp1);
10202     {
10203       CPLErrorReset();
10204       result = (char *)GDALMajorObjectShadow_GetDescription(arg1);
10205       CPLErr eclass = CPLGetLastErrorType();
10206       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
10207         do_confess( CPLGetLastErrorMsg(), 0 );
10208 
10209 
10210 
10211 
10212 
10213       }
10214 
10215 
10216       /*
10217           Make warnings regular Perl warnings. This duplicates the warning
10218           message if DontUseExceptions() is in effect (it is not by default).
10219           */
10220       if ( eclass == CE_Warning ) {
10221         warn( CPLGetLastErrorMsg(), "%s" );
10222       }
10223 
10224 
10225     }
10226     {
10227       /* %typemap(out) const char * */
10228       ST(argvi) = newSVpv(result, 0);
10229       SvUTF8_on(ST(argvi)); /* expecting GDAL to give us UTF-8 */
10230       sv_2mortal(ST(argvi));
10231       argvi++;
10232     }
10233 
10234     XSRETURN(argvi);
10235   fail:
10236 
10237     SWIG_croak_null();
10238   }
10239 }
10240 
10241 
XS(_wrap_MajorObject_SetDescription)10242 XS(_wrap_MajorObject_SetDescription) {
10243   {
10244     GDALMajorObjectShadow *arg1 = (GDALMajorObjectShadow *) 0 ;
10245     char *arg2 = (char *) 0 ;
10246     void *argp1 = 0 ;
10247     int res1 = 0 ;
10248     int res2 ;
10249     char *buf2 = 0 ;
10250     int alloc2 = 0 ;
10251     int argvi = 0;
10252     dXSARGS;
10253 
10254     if ((items < 2) || (items > 2)) {
10255       SWIG_croak("Usage: MajorObject_SetDescription(self,pszNewDesc);");
10256     }
10257     res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_GDALMajorObjectShadow, 0 |  0 );
10258     if (!SWIG_IsOK(res1)) {
10259       SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "MajorObject_SetDescription" "', argument " "1"" of type '" "GDALMajorObjectShadow *""'");
10260     }
10261     arg1 = reinterpret_cast< GDALMajorObjectShadow * >(argp1);
10262     res2 = SWIG_AsCharPtrAndSize(ST(1), &buf2, NULL, &alloc2);
10263     if (!SWIG_IsOK(res2)) {
10264       SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "MajorObject_SetDescription" "', argument " "2"" of type '" "char const *""'");
10265     }
10266     arg2 = reinterpret_cast< char * >(buf2);
10267     {
10268       if (!arg2) {
10269         SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
10270       }
10271     }
10272     {
10273       CPLErrorReset();
10274       GDALMajorObjectShadow_SetDescription(arg1,(char const *)arg2);
10275       CPLErr eclass = CPLGetLastErrorType();
10276       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
10277         do_confess( CPLGetLastErrorMsg(), 0 );
10278 
10279 
10280 
10281 
10282 
10283       }
10284 
10285 
10286       /*
10287           Make warnings regular Perl warnings. This duplicates the warning
10288           message if DontUseExceptions() is in effect (it is not by default).
10289           */
10290       if ( eclass == CE_Warning ) {
10291         warn( CPLGetLastErrorMsg(), "%s" );
10292       }
10293 
10294 
10295     }
10296     {
10297       /* %typemap(out) void */
10298     }
10299 
10300     if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
10301     XSRETURN(argvi);
10302   fail:
10303 
10304     if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
10305     SWIG_croak_null();
10306   }
10307 }
10308 
10309 
XS(_wrap_MajorObject_GetMetadataDomainList)10310 XS(_wrap_MajorObject_GetMetadataDomainList) {
10311   {
10312     GDALMajorObjectShadow *arg1 = (GDALMajorObjectShadow *) 0 ;
10313     void *argp1 = 0 ;
10314     int res1 = 0 ;
10315     int argvi = 0;
10316     char **result = 0 ;
10317     dXSARGS;
10318 
10319     if ((items < 1) || (items > 1)) {
10320       SWIG_croak("Usage: MajorObject_GetMetadataDomainList(self);");
10321     }
10322     res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_GDALMajorObjectShadow, 0 |  0 );
10323     if (!SWIG_IsOK(res1)) {
10324       SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "MajorObject_GetMetadataDomainList" "', argument " "1"" of type '" "GDALMajorObjectShadow *""'");
10325     }
10326     arg1 = reinterpret_cast< GDALMajorObjectShadow * >(argp1);
10327     {
10328       CPLErrorReset();
10329       result = (char **)GDALMajorObjectShadow_GetMetadataDomainList(arg1);
10330       CPLErr eclass = CPLGetLastErrorType();
10331       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
10332         do_confess( CPLGetLastErrorMsg(), 0 );
10333 
10334 
10335 
10336 
10337 
10338       }
10339 
10340 
10341       /*
10342           Make warnings regular Perl warnings. This duplicates the warning
10343           message if DontUseExceptions() is in effect (it is not by default).
10344           */
10345       if ( eclass == CE_Warning ) {
10346         warn( CPLGetLastErrorMsg(), "%s" );
10347       }
10348 
10349 
10350     }
10351     {
10352       /* %typemap(out) char **CSL */
10353       if (GIMME_V == G_ARRAY) {
10354         if (result) {
10355           int n = CSLCount(result);
10356           EXTEND(SP, argvi+n-items+1);
10357           int i;
10358           for (i = 0; result[i]; i++) {
10359             SV *sv = newSVpv(result[i], 0);
10360             SvUTF8_on(sv); /* expecting GDAL to give us UTF-8 */
10361             ST(argvi++) = sv_2mortal(sv);
10362           }
10363           CSLDestroy(result);
10364         }
10365       } else {
10366         AV *av = (AV*)sv_2mortal((SV*)newAV());
10367         if (result) {
10368           int i;
10369           for (i = 0; result[i]; i++) {
10370             SV *sv = newSVpv(result[i], 0);
10371             SvUTF8_on(sv); /* expecting GDAL to give us UTF-8 */
10372             av_push(av, sv);
10373           }
10374           CSLDestroy(result);
10375         }
10376         ST(argvi) = newRV((SV*)av);
10377         sv_2mortal(ST(argvi));
10378         argvi++;
10379       }
10380     }
10381 
10382     XSRETURN(argvi);
10383   fail:
10384 
10385     SWIG_croak_null();
10386   }
10387 }
10388 
10389 
XS(_wrap_MajorObject_GetMetadata)10390 XS(_wrap_MajorObject_GetMetadata) {
10391   {
10392     GDALMajorObjectShadow *arg1 = (GDALMajorObjectShadow *) 0 ;
10393     char *arg2 = (char *) "" ;
10394     void *argp1 = 0 ;
10395     int res1 = 0 ;
10396     int res2 ;
10397     char *buf2 = 0 ;
10398     int alloc2 = 0 ;
10399     int argvi = 0;
10400     char **result = 0 ;
10401     dXSARGS;
10402 
10403     if ((items < 1) || (items > 2)) {
10404       SWIG_croak("Usage: MajorObject_GetMetadata(self,pszDomain);");
10405     }
10406     res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_GDALMajorObjectShadow, 0 |  0 );
10407     if (!SWIG_IsOK(res1)) {
10408       SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "MajorObject_GetMetadata" "', argument " "1"" of type '" "GDALMajorObjectShadow *""'");
10409     }
10410     arg1 = reinterpret_cast< GDALMajorObjectShadow * >(argp1);
10411     if (items > 1) {
10412       res2 = SWIG_AsCharPtrAndSize(ST(1), &buf2, NULL, &alloc2);
10413       if (!SWIG_IsOK(res2)) {
10414         SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "MajorObject_GetMetadata" "', argument " "2"" of type '" "char const *""'");
10415       }
10416       arg2 = reinterpret_cast< char * >(buf2);
10417     }
10418     {
10419       CPLErrorReset();
10420       result = (char **)GDALMajorObjectShadow_GetMetadata_Dict(arg1,(char const *)arg2);
10421       CPLErr eclass = CPLGetLastErrorType();
10422       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
10423         do_confess( CPLGetLastErrorMsg(), 0 );
10424 
10425 
10426 
10427 
10428 
10429       }
10430 
10431 
10432       /*
10433           Make warnings regular Perl warnings. This duplicates the warning
10434           message if DontUseExceptions() is in effect (it is not by default).
10435           */
10436       if ( eclass == CE_Warning ) {
10437         warn( CPLGetLastErrorMsg(), "%s" );
10438       }
10439 
10440 
10441     }
10442     {
10443       /* %typemap(out) char **dict */
10444       char **stringarray = result;
10445       HV *hv = (HV*)sv_2mortal((SV*)newHV());
10446       if ( stringarray != NULL ) {
10447         while (*stringarray != NULL ) {
10448           char const *valptr;
10449           char *keyptr;
10450           valptr = CPLParseNameValue( *stringarray, &keyptr );
10451           if ( valptr != 0 ) {
10452             hv_store(hv, keyptr, strlen(keyptr), newSVpv(valptr, strlen(valptr)), 0);
10453             CPLFree( keyptr );
10454           }
10455           stringarray++;
10456         }
10457       }
10458       ST(argvi) = newRV((SV*)hv);
10459       sv_2mortal(ST(argvi));
10460       argvi++;
10461     }
10462 
10463     if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
10464     XSRETURN(argvi);
10465   fail:
10466 
10467     if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
10468     SWIG_croak_null();
10469   }
10470 }
10471 
10472 
XS(_wrap_MajorObject_SetMetadata__SWIG_0)10473 XS(_wrap_MajorObject_SetMetadata__SWIG_0) {
10474   {
10475     GDALMajorObjectShadow *arg1 = (GDALMajorObjectShadow *) 0 ;
10476     char **arg2 = (char **) 0 ;
10477     char *arg3 = (char *) "" ;
10478     void *argp1 = 0 ;
10479     int res1 = 0 ;
10480     int res3 ;
10481     char *buf3 = 0 ;
10482     int alloc3 = 0 ;
10483     int argvi = 0;
10484     CPLErr result;
10485     dXSARGS;
10486 
10487     if ((items < 2) || (items > 3)) {
10488       SWIG_croak("Usage: MajorObject_SetMetadata(self,papszMetadata,pszDomain);");
10489     }
10490     res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_GDALMajorObjectShadow, 0 |  0 );
10491     if (!SWIG_IsOK(res1)) {
10492       SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "MajorObject_SetMetadata" "', argument " "1"" of type '" "GDALMajorObjectShadow *""'");
10493     }
10494     arg1 = reinterpret_cast< GDALMajorObjectShadow * >(argp1);
10495     {
10496       /* %typemap(in) char **dict */
10497       HV *hv = (HV*)SvRV(ST(1));
10498       SV *sv;
10499       char *key;
10500       I32 klen;
10501       arg2 = NULL;
10502       hv_iterinit(hv);
10503       while(sv = hv_iternextsv(hv,&key,&klen)) {
10504         arg2 = CSLAddNameValue( arg2, key, SvPV_nolen(sv) );
10505       }
10506     }
10507     if (items > 2) {
10508       res3 = SWIG_AsCharPtrAndSize(ST(2), &buf3, NULL, &alloc3);
10509       if (!SWIG_IsOK(res3)) {
10510         SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "MajorObject_SetMetadata" "', argument " "3"" of type '" "char const *""'");
10511       }
10512       arg3 = reinterpret_cast< char * >(buf3);
10513     }
10514     {
10515       CPLErrorReset();
10516       result = (CPLErr)GDALMajorObjectShadow_SetMetadata__SWIG_0(arg1,arg2,(char const *)arg3);
10517       CPLErr eclass = CPLGetLastErrorType();
10518       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
10519         do_confess( CPLGetLastErrorMsg(), 0 );
10520 
10521 
10522 
10523 
10524 
10525       }
10526 
10527 
10528       /*
10529           Make warnings regular Perl warnings. This duplicates the warning
10530           message if DontUseExceptions() is in effect (it is not by default).
10531           */
10532       if ( eclass == CE_Warning ) {
10533         warn( CPLGetLastErrorMsg(), "%s" );
10534       }
10535 
10536 
10537     }
10538     {
10539       /* %typemap(out) CPLErr */
10540     }
10541 
10542     {
10543       /* %typemap(freearg) char **dict */
10544       CSLDestroy( arg2 );
10545     }
10546     if (alloc3 == SWIG_NEWOBJ) delete[] buf3;
10547     XSRETURN(argvi);
10548   fail:
10549 
10550     {
10551       /* %typemap(freearg) char **dict */
10552       CSLDestroy( arg2 );
10553     }
10554     if (alloc3 == SWIG_NEWOBJ) delete[] buf3;
10555     SWIG_croak_null();
10556   }
10557 }
10558 
10559 
XS(_wrap_MajorObject_SetMetadata__SWIG_1)10560 XS(_wrap_MajorObject_SetMetadata__SWIG_1) {
10561   {
10562     GDALMajorObjectShadow *arg1 = (GDALMajorObjectShadow *) 0 ;
10563     char *arg2 = (char *) 0 ;
10564     char *arg3 = (char *) "" ;
10565     void *argp1 = 0 ;
10566     int res1 = 0 ;
10567     int res2 ;
10568     char *buf2 = 0 ;
10569     int alloc2 = 0 ;
10570     int res3 ;
10571     char *buf3 = 0 ;
10572     int alloc3 = 0 ;
10573     int argvi = 0;
10574     CPLErr result;
10575     dXSARGS;
10576 
10577     if ((items < 2) || (items > 3)) {
10578       SWIG_croak("Usage: MajorObject_SetMetadata(self,pszMetadataString,pszDomain);");
10579     }
10580     res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_GDALMajorObjectShadow, 0 |  0 );
10581     if (!SWIG_IsOK(res1)) {
10582       SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "MajorObject_SetMetadata" "', argument " "1"" of type '" "GDALMajorObjectShadow *""'");
10583     }
10584     arg1 = reinterpret_cast< GDALMajorObjectShadow * >(argp1);
10585     res2 = SWIG_AsCharPtrAndSize(ST(1), &buf2, NULL, &alloc2);
10586     if (!SWIG_IsOK(res2)) {
10587       SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "MajorObject_SetMetadata" "', argument " "2"" of type '" "char *""'");
10588     }
10589     arg2 = reinterpret_cast< char * >(buf2);
10590     if (items > 2) {
10591       res3 = SWIG_AsCharPtrAndSize(ST(2), &buf3, NULL, &alloc3);
10592       if (!SWIG_IsOK(res3)) {
10593         SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "MajorObject_SetMetadata" "', argument " "3"" of type '" "char const *""'");
10594       }
10595       arg3 = reinterpret_cast< char * >(buf3);
10596     }
10597     {
10598       CPLErrorReset();
10599       result = (CPLErr)GDALMajorObjectShadow_SetMetadata__SWIG_1(arg1,arg2,(char const *)arg3);
10600       CPLErr eclass = CPLGetLastErrorType();
10601       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
10602         do_confess( CPLGetLastErrorMsg(), 0 );
10603 
10604 
10605 
10606 
10607 
10608       }
10609 
10610 
10611       /*
10612           Make warnings regular Perl warnings. This duplicates the warning
10613           message if DontUseExceptions() is in effect (it is not by default).
10614           */
10615       if ( eclass == CE_Warning ) {
10616         warn( CPLGetLastErrorMsg(), "%s" );
10617       }
10618 
10619 
10620     }
10621     {
10622       /* %typemap(out) CPLErr */
10623     }
10624 
10625     if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
10626     if (alloc3 == SWIG_NEWOBJ) delete[] buf3;
10627     XSRETURN(argvi);
10628   fail:
10629 
10630     if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
10631     if (alloc3 == SWIG_NEWOBJ) delete[] buf3;
10632     SWIG_croak_null();
10633   }
10634 }
10635 
10636 
XS(_wrap_MajorObject_SetMetadata)10637 XS(_wrap_MajorObject_SetMetadata) {
10638   dXSARGS;
10639 
10640   {
10641     unsigned long _index = 0;
10642     SWIG_TypeRank _rank = 0;
10643     if ((items >= 2) && (items <= 3)) {
10644       SWIG_TypeRank _ranki = 0;
10645       SWIG_TypeRank _rankm = 0;
10646       SWIG_TypeRank _pi = 1;
10647       int _v = 0;
10648       {
10649         void *vptr = 0;
10650         int res = SWIG_ConvertPtr(ST(0), &vptr, SWIGTYPE_p_GDALMajorObjectShadow, 0);
10651         _v = SWIG_CheckState(res);
10652       }
10653       if (!_v) goto check_1;
10654       _ranki += _v*_pi;
10655       _rankm += _pi;
10656       _pi *= SWIG_MAXCASTRANK;
10657       {
10658         {
10659           /* %typecheck(SWIG_TYPECHECK_POINTER) (char **dict) */
10660           _v = (SvROK(ST(1)) && (SvTYPE(SvRV(ST(1)))==SVt_PVHV)) ? 1 : 0;
10661         }
10662       }
10663       if (!_v) goto check_1;
10664       _ranki += _v*_pi;
10665       _rankm += _pi;
10666       _pi *= SWIG_MAXCASTRANK;
10667       if (items > 2) {
10668         {
10669           int res = SWIG_AsCharPtrAndSize(ST(2), 0, NULL, 0);
10670           _v = SWIG_CheckState(res);
10671         }
10672         if (!_v) goto check_1;
10673         _ranki += _v*_pi;
10674         _rankm += _pi;
10675         _pi *= SWIG_MAXCASTRANK;
10676       }
10677       if (!_index || (_ranki < _rank)) {
10678         _rank = _ranki; _index = 1;
10679         if (_rank == _rankm) goto dispatch;
10680       }
10681     }
10682   check_1:
10683 
10684     if ((items >= 2) && (items <= 3)) {
10685       SWIG_TypeRank _ranki = 0;
10686       SWIG_TypeRank _rankm = 0;
10687       SWIG_TypeRank _pi = 1;
10688       int _v = 0;
10689       {
10690         void *vptr = 0;
10691         int res = SWIG_ConvertPtr(ST(0), &vptr, SWIGTYPE_p_GDALMajorObjectShadow, 0);
10692         _v = SWIG_CheckState(res);
10693       }
10694       if (!_v) goto check_2;
10695       _ranki += _v*_pi;
10696       _rankm += _pi;
10697       _pi *= SWIG_MAXCASTRANK;
10698       {
10699         int res = SWIG_AsCharPtrAndSize(ST(1), 0, NULL, 0);
10700         _v = SWIG_CheckState(res);
10701       }
10702       if (!_v) goto check_2;
10703       _ranki += _v*_pi;
10704       _rankm += _pi;
10705       _pi *= SWIG_MAXCASTRANK;
10706       if (items > 2) {
10707         {
10708           int res = SWIG_AsCharPtrAndSize(ST(2), 0, NULL, 0);
10709           _v = SWIG_CheckState(res);
10710         }
10711         if (!_v) goto check_2;
10712         _ranki += _v*_pi;
10713         _rankm += _pi;
10714         _pi *= SWIG_MAXCASTRANK;
10715       }
10716       if (!_index || (_ranki < _rank)) {
10717         _rank = _ranki; _index = 2;
10718         if (_rank == _rankm) goto dispatch;
10719       }
10720     }
10721   check_2:
10722 
10723   dispatch:
10724     switch(_index) {
10725     case 1:
10726       PUSHMARK(MARK); SWIG_CALLXS(_wrap_MajorObject_SetMetadata__SWIG_0); return;
10727     case 2:
10728       PUSHMARK(MARK); SWIG_CALLXS(_wrap_MajorObject_SetMetadata__SWIG_1); return;
10729     }
10730   }
10731 
10732   croak("No matching function for overloaded 'MajorObject_SetMetadata'");
10733   XSRETURN(0);
10734 }
10735 
10736 
XS(_wrap_MajorObject_GetMetadataItem)10737 XS(_wrap_MajorObject_GetMetadataItem) {
10738   {
10739     GDALMajorObjectShadow *arg1 = (GDALMajorObjectShadow *) 0 ;
10740     char *arg2 = (char *) 0 ;
10741     char *arg3 = (char *) "" ;
10742     void *argp1 = 0 ;
10743     int res1 = 0 ;
10744     int res2 ;
10745     char *buf2 = 0 ;
10746     int alloc2 = 0 ;
10747     int res3 ;
10748     char *buf3 = 0 ;
10749     int alloc3 = 0 ;
10750     int argvi = 0;
10751     char *result = 0 ;
10752     dXSARGS;
10753 
10754     if ((items < 2) || (items > 3)) {
10755       SWIG_croak("Usage: MajorObject_GetMetadataItem(self,pszName,pszDomain);");
10756     }
10757     res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_GDALMajorObjectShadow, 0 |  0 );
10758     if (!SWIG_IsOK(res1)) {
10759       SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "MajorObject_GetMetadataItem" "', argument " "1"" of type '" "GDALMajorObjectShadow *""'");
10760     }
10761     arg1 = reinterpret_cast< GDALMajorObjectShadow * >(argp1);
10762     res2 = SWIG_AsCharPtrAndSize(ST(1), &buf2, NULL, &alloc2);
10763     if (!SWIG_IsOK(res2)) {
10764       SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "MajorObject_GetMetadataItem" "', argument " "2"" of type '" "char const *""'");
10765     }
10766     arg2 = reinterpret_cast< char * >(buf2);
10767     if (items > 2) {
10768       res3 = SWIG_AsCharPtrAndSize(ST(2), &buf3, NULL, &alloc3);
10769       if (!SWIG_IsOK(res3)) {
10770         SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "MajorObject_GetMetadataItem" "', argument " "3"" of type '" "char const *""'");
10771       }
10772       arg3 = reinterpret_cast< char * >(buf3);
10773     }
10774     {
10775       if (!arg2) {
10776         SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
10777       }
10778     }
10779     {
10780       CPLErrorReset();
10781       result = (char *)GDALMajorObjectShadow_GetMetadataItem(arg1,(char const *)arg2,(char const *)arg3);
10782       CPLErr eclass = CPLGetLastErrorType();
10783       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
10784         do_confess( CPLGetLastErrorMsg(), 0 );
10785 
10786 
10787 
10788 
10789 
10790       }
10791 
10792 
10793       /*
10794           Make warnings regular Perl warnings. This duplicates the warning
10795           message if DontUseExceptions() is in effect (it is not by default).
10796           */
10797       if ( eclass == CE_Warning ) {
10798         warn( CPLGetLastErrorMsg(), "%s" );
10799       }
10800 
10801 
10802     }
10803     {
10804       /* %typemap(out) const char * */
10805       ST(argvi) = newSVpv(result, 0);
10806       SvUTF8_on(ST(argvi)); /* expecting GDAL to give us UTF-8 */
10807       sv_2mortal(ST(argvi));
10808       argvi++;
10809     }
10810 
10811     if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
10812     if (alloc3 == SWIG_NEWOBJ) delete[] buf3;
10813     XSRETURN(argvi);
10814   fail:
10815 
10816     if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
10817     if (alloc3 == SWIG_NEWOBJ) delete[] buf3;
10818     SWIG_croak_null();
10819   }
10820 }
10821 
10822 
XS(_wrap_MajorObject_SetMetadataItem)10823 XS(_wrap_MajorObject_SetMetadataItem) {
10824   {
10825     GDALMajorObjectShadow *arg1 = (GDALMajorObjectShadow *) 0 ;
10826     char *arg2 = (char *) 0 ;
10827     char *arg3 = (char *) 0 ;
10828     char *arg4 = (char *) "" ;
10829     void *argp1 = 0 ;
10830     int res1 = 0 ;
10831     int res2 ;
10832     char *buf2 = 0 ;
10833     int alloc2 = 0 ;
10834     int res3 ;
10835     char *buf3 = 0 ;
10836     int alloc3 = 0 ;
10837     int res4 ;
10838     char *buf4 = 0 ;
10839     int alloc4 = 0 ;
10840     int argvi = 0;
10841     CPLErr result;
10842     dXSARGS;
10843 
10844     if ((items < 3) || (items > 4)) {
10845       SWIG_croak("Usage: MajorObject_SetMetadataItem(self,pszName,pszValue,pszDomain);");
10846     }
10847     res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_GDALMajorObjectShadow, 0 |  0 );
10848     if (!SWIG_IsOK(res1)) {
10849       SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "MajorObject_SetMetadataItem" "', argument " "1"" of type '" "GDALMajorObjectShadow *""'");
10850     }
10851     arg1 = reinterpret_cast< GDALMajorObjectShadow * >(argp1);
10852     res2 = SWIG_AsCharPtrAndSize(ST(1), &buf2, NULL, &alloc2);
10853     if (!SWIG_IsOK(res2)) {
10854       SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "MajorObject_SetMetadataItem" "', argument " "2"" of type '" "char const *""'");
10855     }
10856     arg2 = reinterpret_cast< char * >(buf2);
10857     res3 = SWIG_AsCharPtrAndSize(ST(2), &buf3, NULL, &alloc3);
10858     if (!SWIG_IsOK(res3)) {
10859       SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "MajorObject_SetMetadataItem" "', argument " "3"" of type '" "char const *""'");
10860     }
10861     arg3 = reinterpret_cast< char * >(buf3);
10862     if (items > 3) {
10863       res4 = SWIG_AsCharPtrAndSize(ST(3), &buf4, NULL, &alloc4);
10864       if (!SWIG_IsOK(res4)) {
10865         SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "MajorObject_SetMetadataItem" "', argument " "4"" of type '" "char const *""'");
10866       }
10867       arg4 = reinterpret_cast< char * >(buf4);
10868     }
10869     {
10870       if (!arg2) {
10871         SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
10872       }
10873     }
10874     {
10875       CPLErrorReset();
10876       result = (CPLErr)GDALMajorObjectShadow_SetMetadataItem(arg1,(char const *)arg2,(char const *)arg3,(char const *)arg4);
10877       CPLErr eclass = CPLGetLastErrorType();
10878       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
10879         do_confess( CPLGetLastErrorMsg(), 0 );
10880 
10881 
10882 
10883 
10884 
10885       }
10886 
10887 
10888       /*
10889           Make warnings regular Perl warnings. This duplicates the warning
10890           message if DontUseExceptions() is in effect (it is not by default).
10891           */
10892       if ( eclass == CE_Warning ) {
10893         warn( CPLGetLastErrorMsg(), "%s" );
10894       }
10895 
10896 
10897     }
10898     {
10899       /* %typemap(out) CPLErr */
10900     }
10901 
10902     if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
10903     if (alloc3 == SWIG_NEWOBJ) delete[] buf3;
10904     if (alloc4 == SWIG_NEWOBJ) delete[] buf4;
10905     XSRETURN(argvi);
10906   fail:
10907 
10908     if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
10909     if (alloc3 == SWIG_NEWOBJ) delete[] buf3;
10910     if (alloc4 == SWIG_NEWOBJ) delete[] buf4;
10911     SWIG_croak_null();
10912   }
10913 }
10914 
10915 
XS(_wrap_Driver_ShortName_get)10916 XS(_wrap_Driver_ShortName_get) {
10917   {
10918     GDALDriverShadow *arg1 = (GDALDriverShadow *) 0 ;
10919     void *argp1 = 0 ;
10920     int res1 = 0 ;
10921     int argvi = 0;
10922     char *result = 0 ;
10923     dXSARGS;
10924 
10925     if ((items < 1) || (items > 1)) {
10926       SWIG_croak("Usage: Driver_ShortName_get(self);");
10927     }
10928     res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_GDALDriverShadow, 0 |  0 );
10929     if (!SWIG_IsOK(res1)) {
10930       SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Driver_ShortName_get" "', argument " "1"" of type '" "GDALDriverShadow *""'");
10931     }
10932     arg1 = reinterpret_cast< GDALDriverShadow * >(argp1);
10933     {
10934       CPLErrorReset();
10935       result = (char *)GDALDriverShadow_ShortName_get(arg1);
10936       CPLErr eclass = CPLGetLastErrorType();
10937       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
10938         do_confess( CPLGetLastErrorMsg(), 0 );
10939 
10940 
10941 
10942 
10943 
10944       }
10945 
10946 
10947       /*
10948           Make warnings regular Perl warnings. This duplicates the warning
10949           message if DontUseExceptions() is in effect (it is not by default).
10950           */
10951       if ( eclass == CE_Warning ) {
10952         warn( CPLGetLastErrorMsg(), "%s" );
10953       }
10954 
10955 
10956     }
10957     {
10958       /* %typemap(out) const char * */
10959       ST(argvi) = newSVpv(result, 0);
10960       SvUTF8_on(ST(argvi)); /* expecting GDAL to give us UTF-8 */
10961       sv_2mortal(ST(argvi));
10962       argvi++;
10963     }
10964 
10965     XSRETURN(argvi);
10966   fail:
10967 
10968     SWIG_croak_null();
10969   }
10970 }
10971 
10972 
XS(_wrap_Driver_LongName_get)10973 XS(_wrap_Driver_LongName_get) {
10974   {
10975     GDALDriverShadow *arg1 = (GDALDriverShadow *) 0 ;
10976     void *argp1 = 0 ;
10977     int res1 = 0 ;
10978     int argvi = 0;
10979     char *result = 0 ;
10980     dXSARGS;
10981 
10982     if ((items < 1) || (items > 1)) {
10983       SWIG_croak("Usage: Driver_LongName_get(self);");
10984     }
10985     res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_GDALDriverShadow, 0 |  0 );
10986     if (!SWIG_IsOK(res1)) {
10987       SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Driver_LongName_get" "', argument " "1"" of type '" "GDALDriverShadow *""'");
10988     }
10989     arg1 = reinterpret_cast< GDALDriverShadow * >(argp1);
10990     {
10991       CPLErrorReset();
10992       result = (char *)GDALDriverShadow_LongName_get(arg1);
10993       CPLErr eclass = CPLGetLastErrorType();
10994       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
10995         do_confess( CPLGetLastErrorMsg(), 0 );
10996 
10997 
10998 
10999 
11000 
11001       }
11002 
11003 
11004       /*
11005           Make warnings regular Perl warnings. This duplicates the warning
11006           message if DontUseExceptions() is in effect (it is not by default).
11007           */
11008       if ( eclass == CE_Warning ) {
11009         warn( CPLGetLastErrorMsg(), "%s" );
11010       }
11011 
11012 
11013     }
11014     {
11015       /* %typemap(out) const char * */
11016       ST(argvi) = newSVpv(result, 0);
11017       SvUTF8_on(ST(argvi)); /* expecting GDAL to give us UTF-8 */
11018       sv_2mortal(ST(argvi));
11019       argvi++;
11020     }
11021 
11022     XSRETURN(argvi);
11023   fail:
11024 
11025     SWIG_croak_null();
11026   }
11027 }
11028 
11029 
XS(_wrap_Driver_HelpTopic_get)11030 XS(_wrap_Driver_HelpTopic_get) {
11031   {
11032     GDALDriverShadow *arg1 = (GDALDriverShadow *) 0 ;
11033     void *argp1 = 0 ;
11034     int res1 = 0 ;
11035     int argvi = 0;
11036     char *result = 0 ;
11037     dXSARGS;
11038 
11039     if ((items < 1) || (items > 1)) {
11040       SWIG_croak("Usage: Driver_HelpTopic_get(self);");
11041     }
11042     res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_GDALDriverShadow, 0 |  0 );
11043     if (!SWIG_IsOK(res1)) {
11044       SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Driver_HelpTopic_get" "', argument " "1"" of type '" "GDALDriverShadow *""'");
11045     }
11046     arg1 = reinterpret_cast< GDALDriverShadow * >(argp1);
11047     {
11048       CPLErrorReset();
11049       result = (char *)GDALDriverShadow_HelpTopic_get(arg1);
11050       CPLErr eclass = CPLGetLastErrorType();
11051       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
11052         do_confess( CPLGetLastErrorMsg(), 0 );
11053 
11054 
11055 
11056 
11057 
11058       }
11059 
11060 
11061       /*
11062           Make warnings regular Perl warnings. This duplicates the warning
11063           message if DontUseExceptions() is in effect (it is not by default).
11064           */
11065       if ( eclass == CE_Warning ) {
11066         warn( CPLGetLastErrorMsg(), "%s" );
11067       }
11068 
11069 
11070     }
11071     {
11072       /* %typemap(out) const char * */
11073       ST(argvi) = newSVpv(result, 0);
11074       SvUTF8_on(ST(argvi)); /* expecting GDAL to give us UTF-8 */
11075       sv_2mortal(ST(argvi));
11076       argvi++;
11077     }
11078 
11079     XSRETURN(argvi);
11080   fail:
11081 
11082     SWIG_croak_null();
11083   }
11084 }
11085 
11086 
XS(_wrap_Driver__Create)11087 XS(_wrap_Driver__Create) {
11088   {
11089     GDALDriverShadow *arg1 = (GDALDriverShadow *) 0 ;
11090     char *arg2 = (char *) 0 ;
11091     int arg3 ;
11092     int arg4 ;
11093     int arg5 = (int) 1 ;
11094     GDALDataType arg6 = (GDALDataType) GDT_Byte ;
11095     char **arg7 = (char **) 0 ;
11096     void *argp1 = 0 ;
11097     int res1 = 0 ;
11098     U8 *tmpbuf2 = NULL ;
11099     int val3 ;
11100     int ecode3 = 0 ;
11101     int val4 ;
11102     int ecode4 = 0 ;
11103     int val5 ;
11104     int ecode5 = 0 ;
11105     int val6 ;
11106     int ecode6 = 0 ;
11107     int argvi = 0;
11108     GDALDatasetShadow *result = 0 ;
11109     dXSARGS;
11110 
11111     {
11112       /* %typemap(default) const char * utf8_path */
11113       arg2 = (char *)"";
11114     }
11115     if ((items < 1) || (items > 7)) {
11116       SWIG_croak("Usage: Driver__Create(self,utf8_path,xsize,ysize,bands,eType,options);");
11117     }
11118     res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_GDALDriverShadow, 0 |  0 );
11119     if (!SWIG_IsOK(res1)) {
11120       SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Driver__Create" "', argument " "1"" of type '" "GDALDriverShadow *""'");
11121     }
11122     arg1 = reinterpret_cast< GDALDriverShadow * >(argp1);
11123     if (items > 1) {
11124       {
11125         /* %typemap(in,numinputs=1) (const char* utf8_path) (U8 *tmpbuf2) */
11126         arg2 = sv_to_utf8_string(ST(1), &tmpbuf2);
11127       }
11128     }
11129     if (items > 2) {
11130       ecode3 = SWIG_AsVal_int SWIG_PERL_CALL_ARGS_2(ST(2), &val3);
11131       if (!SWIG_IsOK(ecode3)) {
11132         SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "Driver__Create" "', argument " "3"" of type '" "int""'");
11133       }
11134       arg3 = static_cast< int >(val3);
11135     }
11136     if (items > 3) {
11137       ecode4 = SWIG_AsVal_int SWIG_PERL_CALL_ARGS_2(ST(3), &val4);
11138       if (!SWIG_IsOK(ecode4)) {
11139         SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "Driver__Create" "', argument " "4"" of type '" "int""'");
11140       }
11141       arg4 = static_cast< int >(val4);
11142     }
11143     if (items > 4) {
11144       ecode5 = SWIG_AsVal_int SWIG_PERL_CALL_ARGS_2(ST(4), &val5);
11145       if (!SWIG_IsOK(ecode5)) {
11146         SWIG_exception_fail(SWIG_ArgError(ecode5), "in method '" "Driver__Create" "', argument " "5"" of type '" "int""'");
11147       }
11148       arg5 = static_cast< int >(val5);
11149     }
11150     if (items > 5) {
11151       ecode6 = SWIG_AsVal_int SWIG_PERL_CALL_ARGS_2(ST(5), &val6);
11152       if (!SWIG_IsOK(ecode6)) {
11153         SWIG_exception_fail(SWIG_ArgError(ecode6), "in method '" "Driver__Create" "', argument " "6"" of type '" "GDALDataType""'");
11154       }
11155       arg6 = static_cast< GDALDataType >(val6);
11156     }
11157     if (items > 6) {
11158       {
11159         /* %typemap(in) char **options */
11160         if (SvOK(ST(6))) {
11161           if (SvROK(ST(6))) {
11162             if (SvTYPE(SvRV(ST(6)))==SVt_PVAV) {
11163               AV *av = (AV*)(SvRV(ST(6)));
11164               for (int i = 0; i < av_len(av)+1; i++) {
11165                 SV *sv = *(av_fetch(av, i, 0));
11166                 bool sf;
11167                 char *tmp = sv_to_utf8_string(sv, NULL, &sf);
11168                 arg7 = CSLAddString(arg7, tmp);
11169                 if (sf) Safefree(tmp); else free(tmp);
11170               }
11171             } else if (SvTYPE(SvRV(ST(6)))==SVt_PVHV) {
11172               HV *hv = (HV*)SvRV(ST(6));
11173               SV *sv;
11174               char *key;
11175               I32 klen;
11176               arg7 = NULL;
11177               hv_iterinit(hv);
11178               while(sv = hv_iternextsv(hv, &key, &klen)) {
11179                 bool sf;
11180                 char *tmp = sv_to_utf8_string(sv, NULL, &sf);
11181                 arg7 = CSLAddNameValue(arg7, key, tmp);
11182                 if (sf) Safefree(tmp); else free(tmp);
11183               }
11184             } else
11185             do_confess(NEED_REF, 1);
11186           } else
11187           do_confess(NEED_REF, 1);
11188         }
11189       }
11190     }
11191     {
11192       if (!arg2) {
11193         SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
11194       }
11195     }
11196     {
11197       CPLErrorReset();
11198       result = (GDALDatasetShadow *)GDALDriverShadow_Create(arg1,(char const *)arg2,arg3,arg4,arg5,arg6,arg7);
11199       CPLErr eclass = CPLGetLastErrorType();
11200       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
11201         do_confess( CPLGetLastErrorMsg(), 0 );
11202 
11203 
11204 
11205 
11206 
11207       }
11208 
11209 
11210       /*
11211           Make warnings regular Perl warnings. This duplicates the warning
11212           message if DontUseExceptions() is in effect (it is not by default).
11213           */
11214       if ( eclass == CE_Warning ) {
11215         warn( CPLGetLastErrorMsg(), "%s" );
11216       }
11217 
11218 
11219     }
11220     ST(argvi) = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GDALDatasetShadow, SWIG_OWNER | SWIG_SHADOW); argvi++ ;
11221 
11222     {
11223       /* %typemap(freearg) (const char* utf8_path) */
11224       if (tmpbuf2) Safefree(tmpbuf2);
11225     }
11226 
11227 
11228 
11229 
11230     {
11231       /* %typemap(freearg) char **options */
11232       if (arg7) CSLDestroy( arg7 );
11233     }
11234     XSRETURN(argvi);
11235   fail:
11236 
11237     {
11238       /* %typemap(freearg) (const char* utf8_path) */
11239       if (tmpbuf2) Safefree(tmpbuf2);
11240     }
11241 
11242 
11243 
11244 
11245     {
11246       /* %typemap(freearg) char **options */
11247       if (arg7) CSLDestroy( arg7 );
11248     }
11249     SWIG_croak_null();
11250   }
11251 }
11252 
11253 
XS(_wrap_Driver_CreateMultiDimensional)11254 XS(_wrap_Driver_CreateMultiDimensional) {
11255   {
11256     GDALDriverShadow *arg1 = (GDALDriverShadow *) 0 ;
11257     char *arg2 = (char *) 0 ;
11258     char **arg3 = (char **) 0 ;
11259     char **arg4 = (char **) 0 ;
11260     void *argp1 = 0 ;
11261     int res1 = 0 ;
11262     U8 *tmpbuf2 = NULL ;
11263     int argvi = 0;
11264     GDALDatasetShadow *result = 0 ;
11265     dXSARGS;
11266 
11267     {
11268       /* %typemap(default) const char * utf8_path */
11269       arg2 = (char *)"";
11270     }
11271     if ((items < 1) || (items > 4)) {
11272       SWIG_croak("Usage: Driver_CreateMultiDimensional(self,utf8_path,root_group_options,options);");
11273     }
11274     res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_GDALDriverShadow, 0 |  0 );
11275     if (!SWIG_IsOK(res1)) {
11276       SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Driver_CreateMultiDimensional" "', argument " "1"" of type '" "GDALDriverShadow *""'");
11277     }
11278     arg1 = reinterpret_cast< GDALDriverShadow * >(argp1);
11279     if (items > 1) {
11280       {
11281         /* %typemap(in,numinputs=1) (const char* utf8_path) (U8 *tmpbuf2) */
11282         arg2 = sv_to_utf8_string(ST(1), &tmpbuf2);
11283       }
11284     }
11285     if (items > 2) {
11286       {
11287         /* %typemap(in) char **options */
11288         if (SvOK(ST(2))) {
11289           if (SvROK(ST(2))) {
11290             if (SvTYPE(SvRV(ST(2)))==SVt_PVAV) {
11291               AV *av = (AV*)(SvRV(ST(2)));
11292               for (int i = 0; i < av_len(av)+1; i++) {
11293                 SV *sv = *(av_fetch(av, i, 0));
11294                 bool sf;
11295                 char *tmp = sv_to_utf8_string(sv, NULL, &sf);
11296                 arg3 = CSLAddString(arg3, tmp);
11297                 if (sf) Safefree(tmp); else free(tmp);
11298               }
11299             } else if (SvTYPE(SvRV(ST(2)))==SVt_PVHV) {
11300               HV *hv = (HV*)SvRV(ST(2));
11301               SV *sv;
11302               char *key;
11303               I32 klen;
11304               arg3 = NULL;
11305               hv_iterinit(hv);
11306               while(sv = hv_iternextsv(hv, &key, &klen)) {
11307                 bool sf;
11308                 char *tmp = sv_to_utf8_string(sv, NULL, &sf);
11309                 arg3 = CSLAddNameValue(arg3, key, tmp);
11310                 if (sf) Safefree(tmp); else free(tmp);
11311               }
11312             } else
11313             do_confess(NEED_REF, 1);
11314           } else
11315           do_confess(NEED_REF, 1);
11316         }
11317       }
11318     }
11319     if (items > 3) {
11320       {
11321         /* %typemap(in) char **options */
11322         if (SvOK(ST(3))) {
11323           if (SvROK(ST(3))) {
11324             if (SvTYPE(SvRV(ST(3)))==SVt_PVAV) {
11325               AV *av = (AV*)(SvRV(ST(3)));
11326               for (int i = 0; i < av_len(av)+1; i++) {
11327                 SV *sv = *(av_fetch(av, i, 0));
11328                 bool sf;
11329                 char *tmp = sv_to_utf8_string(sv, NULL, &sf);
11330                 arg4 = CSLAddString(arg4, tmp);
11331                 if (sf) Safefree(tmp); else free(tmp);
11332               }
11333             } else if (SvTYPE(SvRV(ST(3)))==SVt_PVHV) {
11334               HV *hv = (HV*)SvRV(ST(3));
11335               SV *sv;
11336               char *key;
11337               I32 klen;
11338               arg4 = NULL;
11339               hv_iterinit(hv);
11340               while(sv = hv_iternextsv(hv, &key, &klen)) {
11341                 bool sf;
11342                 char *tmp = sv_to_utf8_string(sv, NULL, &sf);
11343                 arg4 = CSLAddNameValue(arg4, key, tmp);
11344                 if (sf) Safefree(tmp); else free(tmp);
11345               }
11346             } else
11347             do_confess(NEED_REF, 1);
11348           } else
11349           do_confess(NEED_REF, 1);
11350         }
11351       }
11352     }
11353     {
11354       if (!arg2) {
11355         SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
11356       }
11357     }
11358     {
11359       CPLErrorReset();
11360       result = (GDALDatasetShadow *)GDALDriverShadow_CreateMultiDimensional(arg1,(char const *)arg2,arg3,arg4);
11361       CPLErr eclass = CPLGetLastErrorType();
11362       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
11363         do_confess( CPLGetLastErrorMsg(), 0 );
11364 
11365 
11366 
11367 
11368 
11369       }
11370 
11371 
11372       /*
11373           Make warnings regular Perl warnings. This duplicates the warning
11374           message if DontUseExceptions() is in effect (it is not by default).
11375           */
11376       if ( eclass == CE_Warning ) {
11377         warn( CPLGetLastErrorMsg(), "%s" );
11378       }
11379 
11380 
11381     }
11382     ST(argvi) = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GDALDatasetShadow, SWIG_OWNER | SWIG_SHADOW); argvi++ ;
11383 
11384     {
11385       /* %typemap(freearg) (const char* utf8_path) */
11386       if (tmpbuf2) Safefree(tmpbuf2);
11387     }
11388     {
11389       /* %typemap(freearg) char **options */
11390       if (arg3) CSLDestroy( arg3 );
11391     }
11392     {
11393       /* %typemap(freearg) char **options */
11394       if (arg4) CSLDestroy( arg4 );
11395     }
11396     XSRETURN(argvi);
11397   fail:
11398 
11399     {
11400       /* %typemap(freearg) (const char* utf8_path) */
11401       if (tmpbuf2) Safefree(tmpbuf2);
11402     }
11403     {
11404       /* %typemap(freearg) char **options */
11405       if (arg3) CSLDestroy( arg3 );
11406     }
11407     {
11408       /* %typemap(freearg) char **options */
11409       if (arg4) CSLDestroy( arg4 );
11410     }
11411     SWIG_croak_null();
11412   }
11413 }
11414 
11415 
XS(_wrap_Driver__CreateCopy)11416 XS(_wrap_Driver__CreateCopy) {
11417   {
11418     GDALDriverShadow *arg1 = (GDALDriverShadow *) 0 ;
11419     char *arg2 = (char *) 0 ;
11420     GDALDatasetShadow *arg3 = (GDALDatasetShadow *) 0 ;
11421     int arg4 = (int) 1 ;
11422     char **arg5 = (char **) 0 ;
11423     GDALProgressFunc arg6 = (GDALProgressFunc) NULL ;
11424     void *arg7 = (void *) NULL ;
11425     void *argp1 = 0 ;
11426     int res1 = 0 ;
11427     U8 *tmpbuf2 = NULL ;
11428     int val4 ;
11429     int ecode4 = 0 ;
11430     int argvi = 0;
11431     GDALDatasetShadow *result = 0 ;
11432     dXSARGS;
11433 
11434     /* %typemap(arginit, noblock=1) ( void* callback_data = NULL) */
11435     SavedEnv saved_env;
11436     saved_env.fct = NULL;
11437     saved_env.data = &PL_sv_undef;
11438     arg7 = (void *)(&saved_env);
11439     {
11440       /* %typemap(default) const char * utf8_path */
11441       arg2 = (char *)"";
11442     }
11443     if ((items < 1) || (items > 7)) {
11444       SWIG_croak("Usage: Driver__CreateCopy(self,utf8_path,src,strict,options,callback,callback_data);");
11445     }
11446     res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_GDALDriverShadow, 0 |  0 );
11447     if (!SWIG_IsOK(res1)) {
11448       SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Driver__CreateCopy" "', argument " "1"" of type '" "GDALDriverShadow *""'");
11449     }
11450     arg1 = reinterpret_cast< GDALDriverShadow * >(argp1);
11451     if (items > 1) {
11452       {
11453         /* %typemap(in,numinputs=1) (const char* utf8_path) (U8 *tmpbuf2) */
11454         arg2 = sv_to_utf8_string(ST(1), &tmpbuf2);
11455       }
11456     }
11457     if (items > 2) {
11458       {
11459         /* %typemap(in) (GDALDatasetShadow *) */
11460         void *argp = 0;
11461         int res = SWIG_ConvertPtr(ST(2), &argp, SWIGTYPE_p_GDALDatasetShadow, 0 |  0 );
11462         if (!SWIG_IsOK(res)) {
11463           do_confess(WRONG_CLASS, 1);
11464         }
11465         arg3 = reinterpret_cast< GDALDatasetShadow * >(argp);
11466         if (arg3 == NULL)
11467         do_confess(NEED_DEF, 1);
11468       }
11469     }
11470     if (items > 3) {
11471       ecode4 = SWIG_AsVal_int SWIG_PERL_CALL_ARGS_2(ST(3), &val4);
11472       if (!SWIG_IsOK(ecode4)) {
11473         SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "Driver__CreateCopy" "', argument " "4"" of type '" "int""'");
11474       }
11475       arg4 = static_cast< int >(val4);
11476     }
11477     if (items > 4) {
11478       {
11479         /* %typemap(in) char **options */
11480         if (SvOK(ST(4))) {
11481           if (SvROK(ST(4))) {
11482             if (SvTYPE(SvRV(ST(4)))==SVt_PVAV) {
11483               AV *av = (AV*)(SvRV(ST(4)));
11484               for (int i = 0; i < av_len(av)+1; i++) {
11485                 SV *sv = *(av_fetch(av, i, 0));
11486                 bool sf;
11487                 char *tmp = sv_to_utf8_string(sv, NULL, &sf);
11488                 arg5 = CSLAddString(arg5, tmp);
11489                 if (sf) Safefree(tmp); else free(tmp);
11490               }
11491             } else if (SvTYPE(SvRV(ST(4)))==SVt_PVHV) {
11492               HV *hv = (HV*)SvRV(ST(4));
11493               SV *sv;
11494               char *key;
11495               I32 klen;
11496               arg5 = NULL;
11497               hv_iterinit(hv);
11498               while(sv = hv_iternextsv(hv, &key, &klen)) {
11499                 bool sf;
11500                 char *tmp = sv_to_utf8_string(sv, NULL, &sf);
11501                 arg5 = CSLAddNameValue(arg5, key, tmp);
11502                 if (sf) Safefree(tmp); else free(tmp);
11503               }
11504             } else
11505             do_confess(NEED_REF, 1);
11506           } else
11507           do_confess(NEED_REF, 1);
11508         }
11509       }
11510     }
11511     if (items > 5) {
11512       {
11513         /* %typemap(in) (GDALProgressFunc callback = NULL) */
11514         if (SvOK(ST(5))) {
11515           if (SvROK(ST(5))) {
11516             if (SvTYPE(SvRV(ST(5))) != SVt_PVCV) {
11517               do_confess(NEED_CODE_REF, 1);
11518             } else {
11519               saved_env.fct = (SV *)ST(5);
11520               arg6 = &callback_d_cp_vp;
11521             }
11522           } else {
11523             do_confess(NEED_CODE_REF, 1);
11524           }
11525         }
11526       }
11527     }
11528     if (items > 6) {
11529       {
11530         /* %typemap(in) (void* callback_data=NULL) */
11531         if (SvOK(ST(6)))
11532         saved_env.data = (SV *)ST(6);
11533       }
11534     }
11535     {
11536       if (!arg2) {
11537         SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
11538       }
11539     }
11540     {
11541       if (!arg3) {
11542         SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
11543       }
11544     }
11545     {
11546       CPLErrorReset();
11547       result = (GDALDatasetShadow *)GDALDriverShadow_CreateCopy(arg1,(char const *)arg2,arg3,arg4,arg5,arg6,arg7);
11548       CPLErr eclass = CPLGetLastErrorType();
11549       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
11550         do_confess( CPLGetLastErrorMsg(), 0 );
11551 
11552 
11553 
11554 
11555 
11556       }
11557 
11558 
11559       /*
11560           Make warnings regular Perl warnings. This duplicates the warning
11561           message if DontUseExceptions() is in effect (it is not by default).
11562           */
11563       if ( eclass == CE_Warning ) {
11564         warn( CPLGetLastErrorMsg(), "%s" );
11565       }
11566 
11567 
11568     }
11569     ST(argvi) = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GDALDatasetShadow, SWIG_OWNER | SWIG_SHADOW); argvi++ ;
11570 
11571     {
11572       /* %typemap(freearg) (const char* utf8_path) */
11573       if (tmpbuf2) Safefree(tmpbuf2);
11574     }
11575 
11576 
11577     {
11578       /* %typemap(freearg) char **options */
11579       if (arg5) CSLDestroy( arg5 );
11580     }
11581 
11582     XSRETURN(argvi);
11583   fail:
11584 
11585     {
11586       /* %typemap(freearg) (const char* utf8_path) */
11587       if (tmpbuf2) Safefree(tmpbuf2);
11588     }
11589 
11590 
11591     {
11592       /* %typemap(freearg) char **options */
11593       if (arg5) CSLDestroy( arg5 );
11594     }
11595 
11596     SWIG_croak_null();
11597   }
11598 }
11599 
11600 
XS(_wrap_Driver_Delete)11601 XS(_wrap_Driver_Delete) {
11602   {
11603     GDALDriverShadow *arg1 = (GDALDriverShadow *) 0 ;
11604     char *arg2 = (char *) 0 ;
11605     void *argp1 = 0 ;
11606     int res1 = 0 ;
11607     U8 *tmpbuf2 = NULL ;
11608     int argvi = 0;
11609     CPLErr result;
11610     dXSARGS;
11611 
11612     {
11613       /* %typemap(default) const char * utf8_path */
11614       arg2 = (char *)"";
11615     }
11616     if ((items < 1) || (items > 2)) {
11617       SWIG_croak("Usage: Driver_Delete(self,utf8_path);");
11618     }
11619     res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_GDALDriverShadow, 0 |  0 );
11620     if (!SWIG_IsOK(res1)) {
11621       SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Driver_Delete" "', argument " "1"" of type '" "GDALDriverShadow *""'");
11622     }
11623     arg1 = reinterpret_cast< GDALDriverShadow * >(argp1);
11624     if (items > 1) {
11625       {
11626         /* %typemap(in,numinputs=1) (const char* utf8_path) (U8 *tmpbuf2) */
11627         arg2 = sv_to_utf8_string(ST(1), &tmpbuf2);
11628       }
11629     }
11630     {
11631       if (!arg2) {
11632         SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
11633       }
11634     }
11635     {
11636       CPLErrorReset();
11637       result = (CPLErr)GDALDriverShadow_Delete(arg1,(char const *)arg2);
11638       CPLErr eclass = CPLGetLastErrorType();
11639       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
11640         do_confess( CPLGetLastErrorMsg(), 0 );
11641 
11642 
11643 
11644 
11645 
11646       }
11647 
11648 
11649       /*
11650           Make warnings regular Perl warnings. This duplicates the warning
11651           message if DontUseExceptions() is in effect (it is not by default).
11652           */
11653       if ( eclass == CE_Warning ) {
11654         warn( CPLGetLastErrorMsg(), "%s" );
11655       }
11656 
11657 
11658     }
11659     {
11660       /* %typemap(out) CPLErr */
11661     }
11662 
11663     {
11664       /* %typemap(freearg) (const char* utf8_path) */
11665       if (tmpbuf2) Safefree(tmpbuf2);
11666     }
11667     XSRETURN(argvi);
11668   fail:
11669 
11670     {
11671       /* %typemap(freearg) (const char* utf8_path) */
11672       if (tmpbuf2) Safefree(tmpbuf2);
11673     }
11674     SWIG_croak_null();
11675   }
11676 }
11677 
11678 
XS(_wrap_Driver_Rename)11679 XS(_wrap_Driver_Rename) {
11680   {
11681     GDALDriverShadow *arg1 = (GDALDriverShadow *) 0 ;
11682     char *arg2 = (char *) 0 ;
11683     char *arg3 = (char *) 0 ;
11684     void *argp1 = 0 ;
11685     int res1 = 0 ;
11686     int res2 ;
11687     char *buf2 = 0 ;
11688     int alloc2 = 0 ;
11689     int res3 ;
11690     char *buf3 = 0 ;
11691     int alloc3 = 0 ;
11692     int argvi = 0;
11693     CPLErr result;
11694     dXSARGS;
11695 
11696     if ((items < 3) || (items > 3)) {
11697       SWIG_croak("Usage: Driver_Rename(self,newName,oldName);");
11698     }
11699     res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_GDALDriverShadow, 0 |  0 );
11700     if (!SWIG_IsOK(res1)) {
11701       SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Driver_Rename" "', argument " "1"" of type '" "GDALDriverShadow *""'");
11702     }
11703     arg1 = reinterpret_cast< GDALDriverShadow * >(argp1);
11704     res2 = SWIG_AsCharPtrAndSize(ST(1), &buf2, NULL, &alloc2);
11705     if (!SWIG_IsOK(res2)) {
11706       SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Driver_Rename" "', argument " "2"" of type '" "char const *""'");
11707     }
11708     arg2 = reinterpret_cast< char * >(buf2);
11709     res3 = SWIG_AsCharPtrAndSize(ST(2), &buf3, NULL, &alloc3);
11710     if (!SWIG_IsOK(res3)) {
11711       SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "Driver_Rename" "', argument " "3"" of type '" "char const *""'");
11712     }
11713     arg3 = reinterpret_cast< char * >(buf3);
11714     {
11715       if (!arg2) {
11716         SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
11717       }
11718     }
11719     {
11720       if (!arg3) {
11721         SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
11722       }
11723     }
11724     {
11725       CPLErrorReset();
11726       result = (CPLErr)GDALDriverShadow_Rename(arg1,(char const *)arg2,(char const *)arg3);
11727       CPLErr eclass = CPLGetLastErrorType();
11728       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
11729         do_confess( CPLGetLastErrorMsg(), 0 );
11730 
11731 
11732 
11733 
11734 
11735       }
11736 
11737 
11738       /*
11739           Make warnings regular Perl warnings. This duplicates the warning
11740           message if DontUseExceptions() is in effect (it is not by default).
11741           */
11742       if ( eclass == CE_Warning ) {
11743         warn( CPLGetLastErrorMsg(), "%s" );
11744       }
11745 
11746 
11747     }
11748     {
11749       /* %typemap(out) CPLErr */
11750     }
11751 
11752     if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
11753     if (alloc3 == SWIG_NEWOBJ) delete[] buf3;
11754     XSRETURN(argvi);
11755   fail:
11756 
11757     if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
11758     if (alloc3 == SWIG_NEWOBJ) delete[] buf3;
11759     SWIG_croak_null();
11760   }
11761 }
11762 
11763 
XS(_wrap_Driver_CopyFiles)11764 XS(_wrap_Driver_CopyFiles) {
11765   {
11766     GDALDriverShadow *arg1 = (GDALDriverShadow *) 0 ;
11767     char *arg2 = (char *) 0 ;
11768     char *arg3 = (char *) 0 ;
11769     void *argp1 = 0 ;
11770     int res1 = 0 ;
11771     int res2 ;
11772     char *buf2 = 0 ;
11773     int alloc2 = 0 ;
11774     int res3 ;
11775     char *buf3 = 0 ;
11776     int alloc3 = 0 ;
11777     int argvi = 0;
11778     CPLErr result;
11779     dXSARGS;
11780 
11781     if ((items < 3) || (items > 3)) {
11782       SWIG_croak("Usage: Driver_CopyFiles(self,newName,oldName);");
11783     }
11784     res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_GDALDriverShadow, 0 |  0 );
11785     if (!SWIG_IsOK(res1)) {
11786       SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Driver_CopyFiles" "', argument " "1"" of type '" "GDALDriverShadow *""'");
11787     }
11788     arg1 = reinterpret_cast< GDALDriverShadow * >(argp1);
11789     res2 = SWIG_AsCharPtrAndSize(ST(1), &buf2, NULL, &alloc2);
11790     if (!SWIG_IsOK(res2)) {
11791       SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Driver_CopyFiles" "', argument " "2"" of type '" "char const *""'");
11792     }
11793     arg2 = reinterpret_cast< char * >(buf2);
11794     res3 = SWIG_AsCharPtrAndSize(ST(2), &buf3, NULL, &alloc3);
11795     if (!SWIG_IsOK(res3)) {
11796       SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "Driver_CopyFiles" "', argument " "3"" of type '" "char const *""'");
11797     }
11798     arg3 = reinterpret_cast< char * >(buf3);
11799     {
11800       if (!arg2) {
11801         SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
11802       }
11803     }
11804     {
11805       if (!arg3) {
11806         SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
11807       }
11808     }
11809     {
11810       CPLErrorReset();
11811       result = (CPLErr)GDALDriverShadow_CopyFiles(arg1,(char const *)arg2,(char const *)arg3);
11812       CPLErr eclass = CPLGetLastErrorType();
11813       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
11814         do_confess( CPLGetLastErrorMsg(), 0 );
11815 
11816 
11817 
11818 
11819 
11820       }
11821 
11822 
11823       /*
11824           Make warnings regular Perl warnings. This duplicates the warning
11825           message if DontUseExceptions() is in effect (it is not by default).
11826           */
11827       if ( eclass == CE_Warning ) {
11828         warn( CPLGetLastErrorMsg(), "%s" );
11829       }
11830 
11831 
11832     }
11833     {
11834       /* %typemap(out) CPLErr */
11835     }
11836 
11837     if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
11838     if (alloc3 == SWIG_NEWOBJ) delete[] buf3;
11839     XSRETURN(argvi);
11840   fail:
11841 
11842     if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
11843     if (alloc3 == SWIG_NEWOBJ) delete[] buf3;
11844     SWIG_croak_null();
11845   }
11846 }
11847 
11848 
XS(_wrap_Driver_Register)11849 XS(_wrap_Driver_Register) {
11850   {
11851     GDALDriverShadow *arg1 = (GDALDriverShadow *) 0 ;
11852     void *argp1 = 0 ;
11853     int res1 = 0 ;
11854     int argvi = 0;
11855     int result;
11856     dXSARGS;
11857 
11858     if ((items < 1) || (items > 1)) {
11859       SWIG_croak("Usage: Driver_Register(self);");
11860     }
11861     res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_GDALDriverShadow, 0 |  0 );
11862     if (!SWIG_IsOK(res1)) {
11863       SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Driver_Register" "', argument " "1"" of type '" "GDALDriverShadow *""'");
11864     }
11865     arg1 = reinterpret_cast< GDALDriverShadow * >(argp1);
11866     {
11867       CPLErrorReset();
11868       result = (int)GDALDriverShadow_Register(arg1);
11869       CPLErr eclass = CPLGetLastErrorType();
11870       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
11871         do_confess( CPLGetLastErrorMsg(), 0 );
11872 
11873 
11874 
11875 
11876 
11877       }
11878 
11879 
11880       /*
11881           Make warnings regular Perl warnings. This duplicates the warning
11882           message if DontUseExceptions() is in effect (it is not by default).
11883           */
11884       if ( eclass == CE_Warning ) {
11885         warn( CPLGetLastErrorMsg(), "%s" );
11886       }
11887 
11888 
11889     }
11890     ST(argvi) = SWIG_From_int  SWIG_PERL_CALL_ARGS_1(static_cast< int >(result)); argvi++ ;
11891 
11892     XSRETURN(argvi);
11893   fail:
11894 
11895     SWIG_croak_null();
11896   }
11897 }
11898 
11899 
XS(_wrap_Driver_Deregister)11900 XS(_wrap_Driver_Deregister) {
11901   {
11902     GDALDriverShadow *arg1 = (GDALDriverShadow *) 0 ;
11903     void *argp1 = 0 ;
11904     int res1 = 0 ;
11905     int argvi = 0;
11906     dXSARGS;
11907 
11908     if ((items < 1) || (items > 1)) {
11909       SWIG_croak("Usage: Driver_Deregister(self);");
11910     }
11911     res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_GDALDriverShadow, 0 |  0 );
11912     if (!SWIG_IsOK(res1)) {
11913       SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Driver_Deregister" "', argument " "1"" of type '" "GDALDriverShadow *""'");
11914     }
11915     arg1 = reinterpret_cast< GDALDriverShadow * >(argp1);
11916     {
11917       CPLErrorReset();
11918       GDALDriverShadow_Deregister(arg1);
11919       CPLErr eclass = CPLGetLastErrorType();
11920       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
11921         do_confess( CPLGetLastErrorMsg(), 0 );
11922 
11923 
11924 
11925 
11926 
11927       }
11928 
11929 
11930       /*
11931           Make warnings regular Perl warnings. This duplicates the warning
11932           message if DontUseExceptions() is in effect (it is not by default).
11933           */
11934       if ( eclass == CE_Warning ) {
11935         warn( CPLGetLastErrorMsg(), "%s" );
11936       }
11937 
11938 
11939     }
11940     {
11941       /* %typemap(out) void */
11942     }
11943 
11944     XSRETURN(argvi);
11945   fail:
11946 
11947     SWIG_croak_null();
11948   }
11949 }
11950 
11951 
XS(_wrap_GCP_X_set)11952 XS(_wrap_GCP_X_set) {
11953   {
11954     GDAL_GCP *arg1 = (GDAL_GCP *) 0 ;
11955     double arg2 ;
11956     void *argp1 = 0 ;
11957     int res1 = 0 ;
11958     double val2 ;
11959     int ecode2 = 0 ;
11960     int argvi = 0;
11961     dXSARGS;
11962 
11963     if ((items < 2) || (items > 2)) {
11964       SWIG_croak("Usage: GCP_X_set(self,GCPX);");
11965     }
11966     res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_GDAL_GCP, 0 |  0 );
11967     if (!SWIG_IsOK(res1)) {
11968       SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "GCP_X_set" "', argument " "1"" of type '" "GDAL_GCP *""'");
11969     }
11970     arg1 = reinterpret_cast< GDAL_GCP * >(argp1);
11971     ecode2 = SWIG_AsVal_double SWIG_PERL_CALL_ARGS_2(ST(1), &val2);
11972     if (!SWIG_IsOK(ecode2)) {
11973       SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "GCP_X_set" "', argument " "2"" of type '" "double""'");
11974     }
11975     arg2 = static_cast< double >(val2);
11976     {
11977       CPLErrorReset();
11978       GDAL_GCP_GCPX_set(arg1,arg2);
11979       CPLErr eclass = CPLGetLastErrorType();
11980       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
11981         do_confess( CPLGetLastErrorMsg(), 0 );
11982 
11983 
11984 
11985 
11986 
11987       }
11988 
11989 
11990       /*
11991           Make warnings regular Perl warnings. This duplicates the warning
11992           message if DontUseExceptions() is in effect (it is not by default).
11993           */
11994       if ( eclass == CE_Warning ) {
11995         warn( CPLGetLastErrorMsg(), "%s" );
11996       }
11997 
11998 
11999     }
12000     {
12001       /* %typemap(out) void */
12002     }
12003 
12004 
12005     XSRETURN(argvi);
12006   fail:
12007 
12008 
12009     SWIG_croak_null();
12010   }
12011 }
12012 
12013 
XS(_wrap_GCP_X_get)12014 XS(_wrap_GCP_X_get) {
12015   {
12016     GDAL_GCP *arg1 = (GDAL_GCP *) 0 ;
12017     void *argp1 = 0 ;
12018     int res1 = 0 ;
12019     int argvi = 0;
12020     double result;
12021     dXSARGS;
12022 
12023     if ((items < 1) || (items > 1)) {
12024       SWIG_croak("Usage: GCP_X_get(self);");
12025     }
12026     res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_GDAL_GCP, 0 |  0 );
12027     if (!SWIG_IsOK(res1)) {
12028       SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "GCP_X_get" "', argument " "1"" of type '" "GDAL_GCP *""'");
12029     }
12030     arg1 = reinterpret_cast< GDAL_GCP * >(argp1);
12031     {
12032       CPLErrorReset();
12033       result = (double)GDAL_GCP_GCPX_get(arg1);
12034       CPLErr eclass = CPLGetLastErrorType();
12035       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
12036         do_confess( CPLGetLastErrorMsg(), 0 );
12037 
12038 
12039 
12040 
12041 
12042       }
12043 
12044 
12045       /*
12046           Make warnings regular Perl warnings. This duplicates the warning
12047           message if DontUseExceptions() is in effect (it is not by default).
12048           */
12049       if ( eclass == CE_Warning ) {
12050         warn( CPLGetLastErrorMsg(), "%s" );
12051       }
12052 
12053 
12054     }
12055     ST(argvi) = SWIG_From_double  SWIG_PERL_CALL_ARGS_1(static_cast< double >(result)); argvi++ ;
12056 
12057     XSRETURN(argvi);
12058   fail:
12059 
12060     SWIG_croak_null();
12061   }
12062 }
12063 
12064 
XS(_wrap_GCP_Y_set)12065 XS(_wrap_GCP_Y_set) {
12066   {
12067     GDAL_GCP *arg1 = (GDAL_GCP *) 0 ;
12068     double arg2 ;
12069     void *argp1 = 0 ;
12070     int res1 = 0 ;
12071     double val2 ;
12072     int ecode2 = 0 ;
12073     int argvi = 0;
12074     dXSARGS;
12075 
12076     if ((items < 2) || (items > 2)) {
12077       SWIG_croak("Usage: GCP_Y_set(self,GCPY);");
12078     }
12079     res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_GDAL_GCP, 0 |  0 );
12080     if (!SWIG_IsOK(res1)) {
12081       SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "GCP_Y_set" "', argument " "1"" of type '" "GDAL_GCP *""'");
12082     }
12083     arg1 = reinterpret_cast< GDAL_GCP * >(argp1);
12084     ecode2 = SWIG_AsVal_double SWIG_PERL_CALL_ARGS_2(ST(1), &val2);
12085     if (!SWIG_IsOK(ecode2)) {
12086       SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "GCP_Y_set" "', argument " "2"" of type '" "double""'");
12087     }
12088     arg2 = static_cast< double >(val2);
12089     {
12090       CPLErrorReset();
12091       GDAL_GCP_GCPY_set(arg1,arg2);
12092       CPLErr eclass = CPLGetLastErrorType();
12093       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
12094         do_confess( CPLGetLastErrorMsg(), 0 );
12095 
12096 
12097 
12098 
12099 
12100       }
12101 
12102 
12103       /*
12104           Make warnings regular Perl warnings. This duplicates the warning
12105           message if DontUseExceptions() is in effect (it is not by default).
12106           */
12107       if ( eclass == CE_Warning ) {
12108         warn( CPLGetLastErrorMsg(), "%s" );
12109       }
12110 
12111 
12112     }
12113     {
12114       /* %typemap(out) void */
12115     }
12116 
12117 
12118     XSRETURN(argvi);
12119   fail:
12120 
12121 
12122     SWIG_croak_null();
12123   }
12124 }
12125 
12126 
XS(_wrap_GCP_Y_get)12127 XS(_wrap_GCP_Y_get) {
12128   {
12129     GDAL_GCP *arg1 = (GDAL_GCP *) 0 ;
12130     void *argp1 = 0 ;
12131     int res1 = 0 ;
12132     int argvi = 0;
12133     double result;
12134     dXSARGS;
12135 
12136     if ((items < 1) || (items > 1)) {
12137       SWIG_croak("Usage: GCP_Y_get(self);");
12138     }
12139     res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_GDAL_GCP, 0 |  0 );
12140     if (!SWIG_IsOK(res1)) {
12141       SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "GCP_Y_get" "', argument " "1"" of type '" "GDAL_GCP *""'");
12142     }
12143     arg1 = reinterpret_cast< GDAL_GCP * >(argp1);
12144     {
12145       CPLErrorReset();
12146       result = (double)GDAL_GCP_GCPY_get(arg1);
12147       CPLErr eclass = CPLGetLastErrorType();
12148       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
12149         do_confess( CPLGetLastErrorMsg(), 0 );
12150 
12151 
12152 
12153 
12154 
12155       }
12156 
12157 
12158       /*
12159           Make warnings regular Perl warnings. This duplicates the warning
12160           message if DontUseExceptions() is in effect (it is not by default).
12161           */
12162       if ( eclass == CE_Warning ) {
12163         warn( CPLGetLastErrorMsg(), "%s" );
12164       }
12165 
12166 
12167     }
12168     ST(argvi) = SWIG_From_double  SWIG_PERL_CALL_ARGS_1(static_cast< double >(result)); argvi++ ;
12169 
12170     XSRETURN(argvi);
12171   fail:
12172 
12173     SWIG_croak_null();
12174   }
12175 }
12176 
12177 
XS(_wrap_GCP_Z_set)12178 XS(_wrap_GCP_Z_set) {
12179   {
12180     GDAL_GCP *arg1 = (GDAL_GCP *) 0 ;
12181     double arg2 ;
12182     void *argp1 = 0 ;
12183     int res1 = 0 ;
12184     double val2 ;
12185     int ecode2 = 0 ;
12186     int argvi = 0;
12187     dXSARGS;
12188 
12189     if ((items < 2) || (items > 2)) {
12190       SWIG_croak("Usage: GCP_Z_set(self,GCPZ);");
12191     }
12192     res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_GDAL_GCP, 0 |  0 );
12193     if (!SWIG_IsOK(res1)) {
12194       SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "GCP_Z_set" "', argument " "1"" of type '" "GDAL_GCP *""'");
12195     }
12196     arg1 = reinterpret_cast< GDAL_GCP * >(argp1);
12197     ecode2 = SWIG_AsVal_double SWIG_PERL_CALL_ARGS_2(ST(1), &val2);
12198     if (!SWIG_IsOK(ecode2)) {
12199       SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "GCP_Z_set" "', argument " "2"" of type '" "double""'");
12200     }
12201     arg2 = static_cast< double >(val2);
12202     {
12203       CPLErrorReset();
12204       GDAL_GCP_GCPZ_set(arg1,arg2);
12205       CPLErr eclass = CPLGetLastErrorType();
12206       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
12207         do_confess( CPLGetLastErrorMsg(), 0 );
12208 
12209 
12210 
12211 
12212 
12213       }
12214 
12215 
12216       /*
12217           Make warnings regular Perl warnings. This duplicates the warning
12218           message if DontUseExceptions() is in effect (it is not by default).
12219           */
12220       if ( eclass == CE_Warning ) {
12221         warn( CPLGetLastErrorMsg(), "%s" );
12222       }
12223 
12224 
12225     }
12226     {
12227       /* %typemap(out) void */
12228     }
12229 
12230 
12231     XSRETURN(argvi);
12232   fail:
12233 
12234 
12235     SWIG_croak_null();
12236   }
12237 }
12238 
12239 
XS(_wrap_GCP_Z_get)12240 XS(_wrap_GCP_Z_get) {
12241   {
12242     GDAL_GCP *arg1 = (GDAL_GCP *) 0 ;
12243     void *argp1 = 0 ;
12244     int res1 = 0 ;
12245     int argvi = 0;
12246     double result;
12247     dXSARGS;
12248 
12249     if ((items < 1) || (items > 1)) {
12250       SWIG_croak("Usage: GCP_Z_get(self);");
12251     }
12252     res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_GDAL_GCP, 0 |  0 );
12253     if (!SWIG_IsOK(res1)) {
12254       SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "GCP_Z_get" "', argument " "1"" of type '" "GDAL_GCP *""'");
12255     }
12256     arg1 = reinterpret_cast< GDAL_GCP * >(argp1);
12257     {
12258       CPLErrorReset();
12259       result = (double)GDAL_GCP_GCPZ_get(arg1);
12260       CPLErr eclass = CPLGetLastErrorType();
12261       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
12262         do_confess( CPLGetLastErrorMsg(), 0 );
12263 
12264 
12265 
12266 
12267 
12268       }
12269 
12270 
12271       /*
12272           Make warnings regular Perl warnings. This duplicates the warning
12273           message if DontUseExceptions() is in effect (it is not by default).
12274           */
12275       if ( eclass == CE_Warning ) {
12276         warn( CPLGetLastErrorMsg(), "%s" );
12277       }
12278 
12279 
12280     }
12281     ST(argvi) = SWIG_From_double  SWIG_PERL_CALL_ARGS_1(static_cast< double >(result)); argvi++ ;
12282 
12283     XSRETURN(argvi);
12284   fail:
12285 
12286     SWIG_croak_null();
12287   }
12288 }
12289 
12290 
XS(_wrap_GCP_Column_set)12291 XS(_wrap_GCP_Column_set) {
12292   {
12293     GDAL_GCP *arg1 = (GDAL_GCP *) 0 ;
12294     double arg2 ;
12295     void *argp1 = 0 ;
12296     int res1 = 0 ;
12297     double val2 ;
12298     int ecode2 = 0 ;
12299     int argvi = 0;
12300     dXSARGS;
12301 
12302     if ((items < 2) || (items > 2)) {
12303       SWIG_croak("Usage: GCP_Column_set(self,GCPPixel);");
12304     }
12305     res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_GDAL_GCP, 0 |  0 );
12306     if (!SWIG_IsOK(res1)) {
12307       SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "GCP_Column_set" "', argument " "1"" of type '" "GDAL_GCP *""'");
12308     }
12309     arg1 = reinterpret_cast< GDAL_GCP * >(argp1);
12310     ecode2 = SWIG_AsVal_double SWIG_PERL_CALL_ARGS_2(ST(1), &val2);
12311     if (!SWIG_IsOK(ecode2)) {
12312       SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "GCP_Column_set" "', argument " "2"" of type '" "double""'");
12313     }
12314     arg2 = static_cast< double >(val2);
12315     {
12316       CPLErrorReset();
12317       GDAL_GCP_GCPPixel_set(arg1,arg2);
12318       CPLErr eclass = CPLGetLastErrorType();
12319       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
12320         do_confess( CPLGetLastErrorMsg(), 0 );
12321 
12322 
12323 
12324 
12325 
12326       }
12327 
12328 
12329       /*
12330           Make warnings regular Perl warnings. This duplicates the warning
12331           message if DontUseExceptions() is in effect (it is not by default).
12332           */
12333       if ( eclass == CE_Warning ) {
12334         warn( CPLGetLastErrorMsg(), "%s" );
12335       }
12336 
12337 
12338     }
12339     {
12340       /* %typemap(out) void */
12341     }
12342 
12343 
12344     XSRETURN(argvi);
12345   fail:
12346 
12347 
12348     SWIG_croak_null();
12349   }
12350 }
12351 
12352 
XS(_wrap_GCP_Column_get)12353 XS(_wrap_GCP_Column_get) {
12354   {
12355     GDAL_GCP *arg1 = (GDAL_GCP *) 0 ;
12356     void *argp1 = 0 ;
12357     int res1 = 0 ;
12358     int argvi = 0;
12359     double result;
12360     dXSARGS;
12361 
12362     if ((items < 1) || (items > 1)) {
12363       SWIG_croak("Usage: GCP_Column_get(self);");
12364     }
12365     res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_GDAL_GCP, 0 |  0 );
12366     if (!SWIG_IsOK(res1)) {
12367       SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "GCP_Column_get" "', argument " "1"" of type '" "GDAL_GCP *""'");
12368     }
12369     arg1 = reinterpret_cast< GDAL_GCP * >(argp1);
12370     {
12371       CPLErrorReset();
12372       result = (double)GDAL_GCP_GCPPixel_get(arg1);
12373       CPLErr eclass = CPLGetLastErrorType();
12374       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
12375         do_confess( CPLGetLastErrorMsg(), 0 );
12376 
12377 
12378 
12379 
12380 
12381       }
12382 
12383 
12384       /*
12385           Make warnings regular Perl warnings. This duplicates the warning
12386           message if DontUseExceptions() is in effect (it is not by default).
12387           */
12388       if ( eclass == CE_Warning ) {
12389         warn( CPLGetLastErrorMsg(), "%s" );
12390       }
12391 
12392 
12393     }
12394     ST(argvi) = SWIG_From_double  SWIG_PERL_CALL_ARGS_1(static_cast< double >(result)); argvi++ ;
12395 
12396     XSRETURN(argvi);
12397   fail:
12398 
12399     SWIG_croak_null();
12400   }
12401 }
12402 
12403 
XS(_wrap_GCP_Row_set)12404 XS(_wrap_GCP_Row_set) {
12405   {
12406     GDAL_GCP *arg1 = (GDAL_GCP *) 0 ;
12407     double arg2 ;
12408     void *argp1 = 0 ;
12409     int res1 = 0 ;
12410     double val2 ;
12411     int ecode2 = 0 ;
12412     int argvi = 0;
12413     dXSARGS;
12414 
12415     if ((items < 2) || (items > 2)) {
12416       SWIG_croak("Usage: GCP_Row_set(self,GCPLine);");
12417     }
12418     res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_GDAL_GCP, 0 |  0 );
12419     if (!SWIG_IsOK(res1)) {
12420       SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "GCP_Row_set" "', argument " "1"" of type '" "GDAL_GCP *""'");
12421     }
12422     arg1 = reinterpret_cast< GDAL_GCP * >(argp1);
12423     ecode2 = SWIG_AsVal_double SWIG_PERL_CALL_ARGS_2(ST(1), &val2);
12424     if (!SWIG_IsOK(ecode2)) {
12425       SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "GCP_Row_set" "', argument " "2"" of type '" "double""'");
12426     }
12427     arg2 = static_cast< double >(val2);
12428     {
12429       CPLErrorReset();
12430       GDAL_GCP_GCPLine_set(arg1,arg2);
12431       CPLErr eclass = CPLGetLastErrorType();
12432       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
12433         do_confess( CPLGetLastErrorMsg(), 0 );
12434 
12435 
12436 
12437 
12438 
12439       }
12440 
12441 
12442       /*
12443           Make warnings regular Perl warnings. This duplicates the warning
12444           message if DontUseExceptions() is in effect (it is not by default).
12445           */
12446       if ( eclass == CE_Warning ) {
12447         warn( CPLGetLastErrorMsg(), "%s" );
12448       }
12449 
12450 
12451     }
12452     {
12453       /* %typemap(out) void */
12454     }
12455 
12456 
12457     XSRETURN(argvi);
12458   fail:
12459 
12460 
12461     SWIG_croak_null();
12462   }
12463 }
12464 
12465 
XS(_wrap_GCP_Row_get)12466 XS(_wrap_GCP_Row_get) {
12467   {
12468     GDAL_GCP *arg1 = (GDAL_GCP *) 0 ;
12469     void *argp1 = 0 ;
12470     int res1 = 0 ;
12471     int argvi = 0;
12472     double result;
12473     dXSARGS;
12474 
12475     if ((items < 1) || (items > 1)) {
12476       SWIG_croak("Usage: GCP_Row_get(self);");
12477     }
12478     res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_GDAL_GCP, 0 |  0 );
12479     if (!SWIG_IsOK(res1)) {
12480       SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "GCP_Row_get" "', argument " "1"" of type '" "GDAL_GCP *""'");
12481     }
12482     arg1 = reinterpret_cast< GDAL_GCP * >(argp1);
12483     {
12484       CPLErrorReset();
12485       result = (double)GDAL_GCP_GCPLine_get(arg1);
12486       CPLErr eclass = CPLGetLastErrorType();
12487       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
12488         do_confess( CPLGetLastErrorMsg(), 0 );
12489 
12490 
12491 
12492 
12493 
12494       }
12495 
12496 
12497       /*
12498           Make warnings regular Perl warnings. This duplicates the warning
12499           message if DontUseExceptions() is in effect (it is not by default).
12500           */
12501       if ( eclass == CE_Warning ) {
12502         warn( CPLGetLastErrorMsg(), "%s" );
12503       }
12504 
12505 
12506     }
12507     ST(argvi) = SWIG_From_double  SWIG_PERL_CALL_ARGS_1(static_cast< double >(result)); argvi++ ;
12508 
12509     XSRETURN(argvi);
12510   fail:
12511 
12512     SWIG_croak_null();
12513   }
12514 }
12515 
12516 
XS(_wrap_GCP_Info_set)12517 XS(_wrap_GCP_Info_set) {
12518   {
12519     GDAL_GCP *arg1 = (GDAL_GCP *) 0 ;
12520     char *arg2 = (char *) 0 ;
12521     void *argp1 = 0 ;
12522     int res1 = 0 ;
12523     int res2 ;
12524     char *buf2 = 0 ;
12525     int alloc2 = 0 ;
12526     int argvi = 0;
12527     dXSARGS;
12528 
12529     if ((items < 2) || (items > 2)) {
12530       SWIG_croak("Usage: GCP_Info_set(self,Info);");
12531     }
12532     res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_GDAL_GCP, 0 |  0 );
12533     if (!SWIG_IsOK(res1)) {
12534       SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "GCP_Info_set" "', argument " "1"" of type '" "GDAL_GCP *""'");
12535     }
12536     arg1 = reinterpret_cast< GDAL_GCP * >(argp1);
12537     res2 = SWIG_AsCharPtrAndSize(ST(1), &buf2, NULL, &alloc2);
12538     if (!SWIG_IsOK(res2)) {
12539       SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "GCP_Info_set" "', argument " "2"" of type '" "char *""'");
12540     }
12541     arg2 = reinterpret_cast< char * >(buf2);
12542     {
12543       CPLErrorReset();
12544       GDAL_GCP_Info_set(arg1,arg2);
12545       CPLErr eclass = CPLGetLastErrorType();
12546       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
12547         do_confess( CPLGetLastErrorMsg(), 0 );
12548 
12549 
12550 
12551 
12552 
12553       }
12554 
12555 
12556       /*
12557           Make warnings regular Perl warnings. This duplicates the warning
12558           message if DontUseExceptions() is in effect (it is not by default).
12559           */
12560       if ( eclass == CE_Warning ) {
12561         warn( CPLGetLastErrorMsg(), "%s" );
12562       }
12563 
12564 
12565     }
12566     {
12567       /* %typemap(out) void */
12568     }
12569 
12570     if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
12571     XSRETURN(argvi);
12572   fail:
12573 
12574     if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
12575     SWIG_croak_null();
12576   }
12577 }
12578 
12579 
XS(_wrap_GCP_Info_get)12580 XS(_wrap_GCP_Info_get) {
12581   {
12582     GDAL_GCP *arg1 = (GDAL_GCP *) 0 ;
12583     void *argp1 = 0 ;
12584     int res1 = 0 ;
12585     int argvi = 0;
12586     char *result = 0 ;
12587     dXSARGS;
12588 
12589     if ((items < 1) || (items > 1)) {
12590       SWIG_croak("Usage: GCP_Info_get(self);");
12591     }
12592     res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_GDAL_GCP, 0 |  0 );
12593     if (!SWIG_IsOK(res1)) {
12594       SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "GCP_Info_get" "', argument " "1"" of type '" "GDAL_GCP *""'");
12595     }
12596     arg1 = reinterpret_cast< GDAL_GCP * >(argp1);
12597     {
12598       CPLErrorReset();
12599       result = (char *)GDAL_GCP_Info_get(arg1);
12600       CPLErr eclass = CPLGetLastErrorType();
12601       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
12602         do_confess( CPLGetLastErrorMsg(), 0 );
12603 
12604 
12605 
12606 
12607 
12608       }
12609 
12610 
12611       /*
12612           Make warnings regular Perl warnings. This duplicates the warning
12613           message if DontUseExceptions() is in effect (it is not by default).
12614           */
12615       if ( eclass == CE_Warning ) {
12616         warn( CPLGetLastErrorMsg(), "%s" );
12617       }
12618 
12619 
12620     }
12621     ST(argvi) = SWIG_FromCharPtr((const char *)result); argvi++ ;
12622 
12623     XSRETURN(argvi);
12624   fail:
12625 
12626     SWIG_croak_null();
12627   }
12628 }
12629 
12630 
XS(_wrap_GCP_Id_set)12631 XS(_wrap_GCP_Id_set) {
12632   {
12633     GDAL_GCP *arg1 = (GDAL_GCP *) 0 ;
12634     char *arg2 = (char *) 0 ;
12635     void *argp1 = 0 ;
12636     int res1 = 0 ;
12637     int res2 ;
12638     char *buf2 = 0 ;
12639     int alloc2 = 0 ;
12640     int argvi = 0;
12641     dXSARGS;
12642 
12643     if ((items < 2) || (items > 2)) {
12644       SWIG_croak("Usage: GCP_Id_set(self,Id);");
12645     }
12646     res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_GDAL_GCP, 0 |  0 );
12647     if (!SWIG_IsOK(res1)) {
12648       SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "GCP_Id_set" "', argument " "1"" of type '" "GDAL_GCP *""'");
12649     }
12650     arg1 = reinterpret_cast< GDAL_GCP * >(argp1);
12651     res2 = SWIG_AsCharPtrAndSize(ST(1), &buf2, NULL, &alloc2);
12652     if (!SWIG_IsOK(res2)) {
12653       SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "GCP_Id_set" "', argument " "2"" of type '" "char *""'");
12654     }
12655     arg2 = reinterpret_cast< char * >(buf2);
12656     {
12657       CPLErrorReset();
12658       GDAL_GCP_Id_set(arg1,arg2);
12659       CPLErr eclass = CPLGetLastErrorType();
12660       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
12661         do_confess( CPLGetLastErrorMsg(), 0 );
12662 
12663 
12664 
12665 
12666 
12667       }
12668 
12669 
12670       /*
12671           Make warnings regular Perl warnings. This duplicates the warning
12672           message if DontUseExceptions() is in effect (it is not by default).
12673           */
12674       if ( eclass == CE_Warning ) {
12675         warn( CPLGetLastErrorMsg(), "%s" );
12676       }
12677 
12678 
12679     }
12680     {
12681       /* %typemap(out) void */
12682     }
12683 
12684     if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
12685     XSRETURN(argvi);
12686   fail:
12687 
12688     if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
12689     SWIG_croak_null();
12690   }
12691 }
12692 
12693 
XS(_wrap_GCP_Id_get)12694 XS(_wrap_GCP_Id_get) {
12695   {
12696     GDAL_GCP *arg1 = (GDAL_GCP *) 0 ;
12697     void *argp1 = 0 ;
12698     int res1 = 0 ;
12699     int argvi = 0;
12700     char *result = 0 ;
12701     dXSARGS;
12702 
12703     if ((items < 1) || (items > 1)) {
12704       SWIG_croak("Usage: GCP_Id_get(self);");
12705     }
12706     res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_GDAL_GCP, 0 |  0 );
12707     if (!SWIG_IsOK(res1)) {
12708       SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "GCP_Id_get" "', argument " "1"" of type '" "GDAL_GCP *""'");
12709     }
12710     arg1 = reinterpret_cast< GDAL_GCP * >(argp1);
12711     {
12712       CPLErrorReset();
12713       result = (char *)GDAL_GCP_Id_get(arg1);
12714       CPLErr eclass = CPLGetLastErrorType();
12715       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
12716         do_confess( CPLGetLastErrorMsg(), 0 );
12717 
12718 
12719 
12720 
12721 
12722       }
12723 
12724 
12725       /*
12726           Make warnings regular Perl warnings. This duplicates the warning
12727           message if DontUseExceptions() is in effect (it is not by default).
12728           */
12729       if ( eclass == CE_Warning ) {
12730         warn( CPLGetLastErrorMsg(), "%s" );
12731       }
12732 
12733 
12734     }
12735     ST(argvi) = SWIG_FromCharPtr((const char *)result); argvi++ ;
12736 
12737     XSRETURN(argvi);
12738   fail:
12739 
12740     SWIG_croak_null();
12741   }
12742 }
12743 
12744 
XS(_wrap_new_GCP)12745 XS(_wrap_new_GCP) {
12746   {
12747     double arg1 = (double) 0.0 ;
12748     double arg2 = (double) 0.0 ;
12749     double arg3 = (double) 0.0 ;
12750     double arg4 = (double) 0.0 ;
12751     double arg5 = (double) 0.0 ;
12752     char *arg6 = (char *) "" ;
12753     char *arg7 = (char *) "" ;
12754     double val1 ;
12755     int ecode1 = 0 ;
12756     double val2 ;
12757     int ecode2 = 0 ;
12758     double val3 ;
12759     int ecode3 = 0 ;
12760     double val4 ;
12761     int ecode4 = 0 ;
12762     double val5 ;
12763     int ecode5 = 0 ;
12764     int res6 ;
12765     char *buf6 = 0 ;
12766     int alloc6 = 0 ;
12767     int res7 ;
12768     char *buf7 = 0 ;
12769     int alloc7 = 0 ;
12770     int argvi = 0;
12771     GDAL_GCP *result = 0 ;
12772     dXSARGS;
12773 
12774     if ((items < 0) || (items > 7)) {
12775       SWIG_croak("Usage: new_GCP(x,y,z,pixel,line,info,id);");
12776     }
12777     if (items > 0) {
12778       ecode1 = SWIG_AsVal_double SWIG_PERL_CALL_ARGS_2(ST(0), &val1);
12779       if (!SWIG_IsOK(ecode1)) {
12780         SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "new_GCP" "', argument " "1"" of type '" "double""'");
12781       }
12782       arg1 = static_cast< double >(val1);
12783     }
12784     if (items > 1) {
12785       ecode2 = SWIG_AsVal_double SWIG_PERL_CALL_ARGS_2(ST(1), &val2);
12786       if (!SWIG_IsOK(ecode2)) {
12787         SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "new_GCP" "', argument " "2"" of type '" "double""'");
12788       }
12789       arg2 = static_cast< double >(val2);
12790     }
12791     if (items > 2) {
12792       ecode3 = SWIG_AsVal_double SWIG_PERL_CALL_ARGS_2(ST(2), &val3);
12793       if (!SWIG_IsOK(ecode3)) {
12794         SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "new_GCP" "', argument " "3"" of type '" "double""'");
12795       }
12796       arg3 = static_cast< double >(val3);
12797     }
12798     if (items > 3) {
12799       ecode4 = SWIG_AsVal_double SWIG_PERL_CALL_ARGS_2(ST(3), &val4);
12800       if (!SWIG_IsOK(ecode4)) {
12801         SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "new_GCP" "', argument " "4"" of type '" "double""'");
12802       }
12803       arg4 = static_cast< double >(val4);
12804     }
12805     if (items > 4) {
12806       ecode5 = SWIG_AsVal_double SWIG_PERL_CALL_ARGS_2(ST(4), &val5);
12807       if (!SWIG_IsOK(ecode5)) {
12808         SWIG_exception_fail(SWIG_ArgError(ecode5), "in method '" "new_GCP" "', argument " "5"" of type '" "double""'");
12809       }
12810       arg5 = static_cast< double >(val5);
12811     }
12812     if (items > 5) {
12813       res6 = SWIG_AsCharPtrAndSize(ST(5), &buf6, NULL, &alloc6);
12814       if (!SWIG_IsOK(res6)) {
12815         SWIG_exception_fail(SWIG_ArgError(res6), "in method '" "new_GCP" "', argument " "6"" of type '" "char const *""'");
12816       }
12817       arg6 = reinterpret_cast< char * >(buf6);
12818     }
12819     if (items > 6) {
12820       res7 = SWIG_AsCharPtrAndSize(ST(6), &buf7, NULL, &alloc7);
12821       if (!SWIG_IsOK(res7)) {
12822         SWIG_exception_fail(SWIG_ArgError(res7), "in method '" "new_GCP" "', argument " "7"" of type '" "char const *""'");
12823       }
12824       arg7 = reinterpret_cast< char * >(buf7);
12825     }
12826     {
12827       CPLErrorReset();
12828       result = (GDAL_GCP *)new_GDAL_GCP(arg1,arg2,arg3,arg4,arg5,(char const *)arg6,(char const *)arg7);
12829       CPLErr eclass = CPLGetLastErrorType();
12830       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
12831         do_confess( CPLGetLastErrorMsg(), 0 );
12832 
12833 
12834 
12835 
12836 
12837       }
12838 
12839 
12840       /*
12841           Make warnings regular Perl warnings. This duplicates the warning
12842           message if DontUseExceptions() is in effect (it is not by default).
12843           */
12844       if ( eclass == CE_Warning ) {
12845         warn( CPLGetLastErrorMsg(), "%s" );
12846       }
12847 
12848 
12849     }
12850     ST(argvi) = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GDAL_GCP, SWIG_OWNER | SWIG_SHADOW); argvi++ ;
12851 
12852 
12853 
12854 
12855 
12856     if (alloc6 == SWIG_NEWOBJ) delete[] buf6;
12857     if (alloc7 == SWIG_NEWOBJ) delete[] buf7;
12858     XSRETURN(argvi);
12859   fail:
12860 
12861 
12862 
12863 
12864 
12865     if (alloc6 == SWIG_NEWOBJ) delete[] buf6;
12866     if (alloc7 == SWIG_NEWOBJ) delete[] buf7;
12867     SWIG_croak_null();
12868   }
12869 }
12870 
12871 
XS(_wrap_delete_GCP)12872 XS(_wrap_delete_GCP) {
12873   {
12874     GDAL_GCP *arg1 = (GDAL_GCP *) 0 ;
12875     void *argp1 = 0 ;
12876     int res1 = 0 ;
12877     int argvi = 0;
12878     dXSARGS;
12879 
12880     if ((items < 1) || (items > 1)) {
12881       SWIG_croak("Usage: delete_GCP(self);");
12882     }
12883     res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_GDAL_GCP, SWIG_POINTER_DISOWN |  0 );
12884     if (!SWIG_IsOK(res1)) {
12885       SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_GCP" "', argument " "1"" of type '" "GDAL_GCP *""'");
12886     }
12887     arg1 = reinterpret_cast< GDAL_GCP * >(argp1);
12888     {
12889       CPLErrorReset();
12890       delete_GDAL_GCP(arg1);
12891       CPLErr eclass = CPLGetLastErrorType();
12892       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
12893         do_confess( CPLGetLastErrorMsg(), 0 );
12894 
12895 
12896 
12897 
12898 
12899       }
12900 
12901 
12902       /*
12903           Make warnings regular Perl warnings. This duplicates the warning
12904           message if DontUseExceptions() is in effect (it is not by default).
12905           */
12906       if ( eclass == CE_Warning ) {
12907         warn( CPLGetLastErrorMsg(), "%s" );
12908       }
12909 
12910 
12911     }
12912     {
12913       /* %typemap(out) void */
12914     }
12915 
12916     XSRETURN(argvi);
12917   fail:
12918 
12919     SWIG_croak_null();
12920   }
12921 }
12922 
12923 
XS(_wrap_GDAL_GCP_GCPX_get)12924 XS(_wrap_GDAL_GCP_GCPX_get) {
12925   {
12926     GDAL_GCP *arg1 = (GDAL_GCP *) 0 ;
12927     void *argp1 = 0 ;
12928     int res1 = 0 ;
12929     int argvi = 0;
12930     double result;
12931     dXSARGS;
12932 
12933     if ((items < 1) || (items > 1)) {
12934       SWIG_croak("Usage: GDAL_GCP_GCPX_get(gcp);");
12935     }
12936     res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_GDAL_GCP, 0 |  0 );
12937     if (!SWIG_IsOK(res1)) {
12938       SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "GDAL_GCP_GCPX_get" "', argument " "1"" of type '" "GDAL_GCP *""'");
12939     }
12940     arg1 = reinterpret_cast< GDAL_GCP * >(argp1);
12941     {
12942       if (!arg1) {
12943         SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
12944       }
12945     }
12946     {
12947       CPLErrorReset();
12948       result = (double)GDAL_GCP_GCPX_get(arg1);
12949       CPLErr eclass = CPLGetLastErrorType();
12950       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
12951         do_confess( CPLGetLastErrorMsg(), 0 );
12952 
12953 
12954 
12955 
12956 
12957       }
12958 
12959 
12960       /*
12961           Make warnings regular Perl warnings. This duplicates the warning
12962           message if DontUseExceptions() is in effect (it is not by default).
12963           */
12964       if ( eclass == CE_Warning ) {
12965         warn( CPLGetLastErrorMsg(), "%s" );
12966       }
12967 
12968 
12969     }
12970     ST(argvi) = SWIG_From_double  SWIG_PERL_CALL_ARGS_1(static_cast< double >(result)); argvi++ ;
12971 
12972     XSRETURN(argvi);
12973   fail:
12974 
12975     SWIG_croak_null();
12976   }
12977 }
12978 
12979 
XS(_wrap_GDAL_GCP_GCPX_set)12980 XS(_wrap_GDAL_GCP_GCPX_set) {
12981   {
12982     GDAL_GCP *arg1 = (GDAL_GCP *) 0 ;
12983     double arg2 ;
12984     void *argp1 = 0 ;
12985     int res1 = 0 ;
12986     double val2 ;
12987     int ecode2 = 0 ;
12988     int argvi = 0;
12989     dXSARGS;
12990 
12991     if ((items < 2) || (items > 2)) {
12992       SWIG_croak("Usage: GDAL_GCP_GCPX_set(gcp,dfGCPX);");
12993     }
12994     res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_GDAL_GCP, 0 |  0 );
12995     if (!SWIG_IsOK(res1)) {
12996       SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "GDAL_GCP_GCPX_set" "', argument " "1"" of type '" "GDAL_GCP *""'");
12997     }
12998     arg1 = reinterpret_cast< GDAL_GCP * >(argp1);
12999     ecode2 = SWIG_AsVal_double SWIG_PERL_CALL_ARGS_2(ST(1), &val2);
13000     if (!SWIG_IsOK(ecode2)) {
13001       SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "GDAL_GCP_GCPX_set" "', argument " "2"" of type '" "double""'");
13002     }
13003     arg2 = static_cast< double >(val2);
13004     {
13005       if (!arg1) {
13006         SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
13007       }
13008     }
13009     {
13010       CPLErrorReset();
13011       GDAL_GCP_GCPX_set(arg1,arg2);
13012       CPLErr eclass = CPLGetLastErrorType();
13013       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
13014         do_confess( CPLGetLastErrorMsg(), 0 );
13015 
13016 
13017 
13018 
13019 
13020       }
13021 
13022 
13023       /*
13024           Make warnings regular Perl warnings. This duplicates the warning
13025           message if DontUseExceptions() is in effect (it is not by default).
13026           */
13027       if ( eclass == CE_Warning ) {
13028         warn( CPLGetLastErrorMsg(), "%s" );
13029       }
13030 
13031 
13032     }
13033     {
13034       /* %typemap(out) void */
13035     }
13036 
13037 
13038     XSRETURN(argvi);
13039   fail:
13040 
13041 
13042     SWIG_croak_null();
13043   }
13044 }
13045 
13046 
XS(_wrap_GDAL_GCP_GCPY_get)13047 XS(_wrap_GDAL_GCP_GCPY_get) {
13048   {
13049     GDAL_GCP *arg1 = (GDAL_GCP *) 0 ;
13050     void *argp1 = 0 ;
13051     int res1 = 0 ;
13052     int argvi = 0;
13053     double result;
13054     dXSARGS;
13055 
13056     if ((items < 1) || (items > 1)) {
13057       SWIG_croak("Usage: GDAL_GCP_GCPY_get(gcp);");
13058     }
13059     res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_GDAL_GCP, 0 |  0 );
13060     if (!SWIG_IsOK(res1)) {
13061       SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "GDAL_GCP_GCPY_get" "', argument " "1"" of type '" "GDAL_GCP *""'");
13062     }
13063     arg1 = reinterpret_cast< GDAL_GCP * >(argp1);
13064     {
13065       if (!arg1) {
13066         SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
13067       }
13068     }
13069     {
13070       CPLErrorReset();
13071       result = (double)GDAL_GCP_GCPY_get(arg1);
13072       CPLErr eclass = CPLGetLastErrorType();
13073       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
13074         do_confess( CPLGetLastErrorMsg(), 0 );
13075 
13076 
13077 
13078 
13079 
13080       }
13081 
13082 
13083       /*
13084           Make warnings regular Perl warnings. This duplicates the warning
13085           message if DontUseExceptions() is in effect (it is not by default).
13086           */
13087       if ( eclass == CE_Warning ) {
13088         warn( CPLGetLastErrorMsg(), "%s" );
13089       }
13090 
13091 
13092     }
13093     ST(argvi) = SWIG_From_double  SWIG_PERL_CALL_ARGS_1(static_cast< double >(result)); argvi++ ;
13094 
13095     XSRETURN(argvi);
13096   fail:
13097 
13098     SWIG_croak_null();
13099   }
13100 }
13101 
13102 
XS(_wrap_GDAL_GCP_GCPY_set)13103 XS(_wrap_GDAL_GCP_GCPY_set) {
13104   {
13105     GDAL_GCP *arg1 = (GDAL_GCP *) 0 ;
13106     double arg2 ;
13107     void *argp1 = 0 ;
13108     int res1 = 0 ;
13109     double val2 ;
13110     int ecode2 = 0 ;
13111     int argvi = 0;
13112     dXSARGS;
13113 
13114     if ((items < 2) || (items > 2)) {
13115       SWIG_croak("Usage: GDAL_GCP_GCPY_set(gcp,dfGCPY);");
13116     }
13117     res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_GDAL_GCP, 0 |  0 );
13118     if (!SWIG_IsOK(res1)) {
13119       SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "GDAL_GCP_GCPY_set" "', argument " "1"" of type '" "GDAL_GCP *""'");
13120     }
13121     arg1 = reinterpret_cast< GDAL_GCP * >(argp1);
13122     ecode2 = SWIG_AsVal_double SWIG_PERL_CALL_ARGS_2(ST(1), &val2);
13123     if (!SWIG_IsOK(ecode2)) {
13124       SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "GDAL_GCP_GCPY_set" "', argument " "2"" of type '" "double""'");
13125     }
13126     arg2 = static_cast< double >(val2);
13127     {
13128       if (!arg1) {
13129         SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
13130       }
13131     }
13132     {
13133       CPLErrorReset();
13134       GDAL_GCP_GCPY_set(arg1,arg2);
13135       CPLErr eclass = CPLGetLastErrorType();
13136       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
13137         do_confess( CPLGetLastErrorMsg(), 0 );
13138 
13139 
13140 
13141 
13142 
13143       }
13144 
13145 
13146       /*
13147           Make warnings regular Perl warnings. This duplicates the warning
13148           message if DontUseExceptions() is in effect (it is not by default).
13149           */
13150       if ( eclass == CE_Warning ) {
13151         warn( CPLGetLastErrorMsg(), "%s" );
13152       }
13153 
13154 
13155     }
13156     {
13157       /* %typemap(out) void */
13158     }
13159 
13160 
13161     XSRETURN(argvi);
13162   fail:
13163 
13164 
13165     SWIG_croak_null();
13166   }
13167 }
13168 
13169 
XS(_wrap_GDAL_GCP_GCPZ_get)13170 XS(_wrap_GDAL_GCP_GCPZ_get) {
13171   {
13172     GDAL_GCP *arg1 = (GDAL_GCP *) 0 ;
13173     void *argp1 = 0 ;
13174     int res1 = 0 ;
13175     int argvi = 0;
13176     double result;
13177     dXSARGS;
13178 
13179     if ((items < 1) || (items > 1)) {
13180       SWIG_croak("Usage: GDAL_GCP_GCPZ_get(gcp);");
13181     }
13182     res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_GDAL_GCP, 0 |  0 );
13183     if (!SWIG_IsOK(res1)) {
13184       SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "GDAL_GCP_GCPZ_get" "', argument " "1"" of type '" "GDAL_GCP *""'");
13185     }
13186     arg1 = reinterpret_cast< GDAL_GCP * >(argp1);
13187     {
13188       if (!arg1) {
13189         SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
13190       }
13191     }
13192     {
13193       CPLErrorReset();
13194       result = (double)GDAL_GCP_GCPZ_get(arg1);
13195       CPLErr eclass = CPLGetLastErrorType();
13196       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
13197         do_confess( CPLGetLastErrorMsg(), 0 );
13198 
13199 
13200 
13201 
13202 
13203       }
13204 
13205 
13206       /*
13207           Make warnings regular Perl warnings. This duplicates the warning
13208           message if DontUseExceptions() is in effect (it is not by default).
13209           */
13210       if ( eclass == CE_Warning ) {
13211         warn( CPLGetLastErrorMsg(), "%s" );
13212       }
13213 
13214 
13215     }
13216     ST(argvi) = SWIG_From_double  SWIG_PERL_CALL_ARGS_1(static_cast< double >(result)); argvi++ ;
13217 
13218     XSRETURN(argvi);
13219   fail:
13220 
13221     SWIG_croak_null();
13222   }
13223 }
13224 
13225 
XS(_wrap_GDAL_GCP_GCPZ_set)13226 XS(_wrap_GDAL_GCP_GCPZ_set) {
13227   {
13228     GDAL_GCP *arg1 = (GDAL_GCP *) 0 ;
13229     double arg2 ;
13230     void *argp1 = 0 ;
13231     int res1 = 0 ;
13232     double val2 ;
13233     int ecode2 = 0 ;
13234     int argvi = 0;
13235     dXSARGS;
13236 
13237     if ((items < 2) || (items > 2)) {
13238       SWIG_croak("Usage: GDAL_GCP_GCPZ_set(gcp,dfGCPZ);");
13239     }
13240     res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_GDAL_GCP, 0 |  0 );
13241     if (!SWIG_IsOK(res1)) {
13242       SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "GDAL_GCP_GCPZ_set" "', argument " "1"" of type '" "GDAL_GCP *""'");
13243     }
13244     arg1 = reinterpret_cast< GDAL_GCP * >(argp1);
13245     ecode2 = SWIG_AsVal_double SWIG_PERL_CALL_ARGS_2(ST(1), &val2);
13246     if (!SWIG_IsOK(ecode2)) {
13247       SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "GDAL_GCP_GCPZ_set" "', argument " "2"" of type '" "double""'");
13248     }
13249     arg2 = static_cast< double >(val2);
13250     {
13251       if (!arg1) {
13252         SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
13253       }
13254     }
13255     {
13256       CPLErrorReset();
13257       GDAL_GCP_GCPZ_set(arg1,arg2);
13258       CPLErr eclass = CPLGetLastErrorType();
13259       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
13260         do_confess( CPLGetLastErrorMsg(), 0 );
13261 
13262 
13263 
13264 
13265 
13266       }
13267 
13268 
13269       /*
13270           Make warnings regular Perl warnings. This duplicates the warning
13271           message if DontUseExceptions() is in effect (it is not by default).
13272           */
13273       if ( eclass == CE_Warning ) {
13274         warn( CPLGetLastErrorMsg(), "%s" );
13275       }
13276 
13277 
13278     }
13279     {
13280       /* %typemap(out) void */
13281     }
13282 
13283 
13284     XSRETURN(argvi);
13285   fail:
13286 
13287 
13288     SWIG_croak_null();
13289   }
13290 }
13291 
13292 
XS(_wrap_GDAL_GCP_GCPPixel_get)13293 XS(_wrap_GDAL_GCP_GCPPixel_get) {
13294   {
13295     GDAL_GCP *arg1 = (GDAL_GCP *) 0 ;
13296     void *argp1 = 0 ;
13297     int res1 = 0 ;
13298     int argvi = 0;
13299     double result;
13300     dXSARGS;
13301 
13302     if ((items < 1) || (items > 1)) {
13303       SWIG_croak("Usage: GDAL_GCP_GCPPixel_get(gcp);");
13304     }
13305     res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_GDAL_GCP, 0 |  0 );
13306     if (!SWIG_IsOK(res1)) {
13307       SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "GDAL_GCP_GCPPixel_get" "', argument " "1"" of type '" "GDAL_GCP *""'");
13308     }
13309     arg1 = reinterpret_cast< GDAL_GCP * >(argp1);
13310     {
13311       if (!arg1) {
13312         SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
13313       }
13314     }
13315     {
13316       CPLErrorReset();
13317       result = (double)GDAL_GCP_GCPPixel_get(arg1);
13318       CPLErr eclass = CPLGetLastErrorType();
13319       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
13320         do_confess( CPLGetLastErrorMsg(), 0 );
13321 
13322 
13323 
13324 
13325 
13326       }
13327 
13328 
13329       /*
13330           Make warnings regular Perl warnings. This duplicates the warning
13331           message if DontUseExceptions() is in effect (it is not by default).
13332           */
13333       if ( eclass == CE_Warning ) {
13334         warn( CPLGetLastErrorMsg(), "%s" );
13335       }
13336 
13337 
13338     }
13339     ST(argvi) = SWIG_From_double  SWIG_PERL_CALL_ARGS_1(static_cast< double >(result)); argvi++ ;
13340 
13341     XSRETURN(argvi);
13342   fail:
13343 
13344     SWIG_croak_null();
13345   }
13346 }
13347 
13348 
XS(_wrap_GDAL_GCP_GCPPixel_set)13349 XS(_wrap_GDAL_GCP_GCPPixel_set) {
13350   {
13351     GDAL_GCP *arg1 = (GDAL_GCP *) 0 ;
13352     double arg2 ;
13353     void *argp1 = 0 ;
13354     int res1 = 0 ;
13355     double val2 ;
13356     int ecode2 = 0 ;
13357     int argvi = 0;
13358     dXSARGS;
13359 
13360     if ((items < 2) || (items > 2)) {
13361       SWIG_croak("Usage: GDAL_GCP_GCPPixel_set(gcp,dfGCPPixel);");
13362     }
13363     res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_GDAL_GCP, 0 |  0 );
13364     if (!SWIG_IsOK(res1)) {
13365       SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "GDAL_GCP_GCPPixel_set" "', argument " "1"" of type '" "GDAL_GCP *""'");
13366     }
13367     arg1 = reinterpret_cast< GDAL_GCP * >(argp1);
13368     ecode2 = SWIG_AsVal_double SWIG_PERL_CALL_ARGS_2(ST(1), &val2);
13369     if (!SWIG_IsOK(ecode2)) {
13370       SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "GDAL_GCP_GCPPixel_set" "', argument " "2"" of type '" "double""'");
13371     }
13372     arg2 = static_cast< double >(val2);
13373     {
13374       if (!arg1) {
13375         SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
13376       }
13377     }
13378     {
13379       CPLErrorReset();
13380       GDAL_GCP_GCPPixel_set(arg1,arg2);
13381       CPLErr eclass = CPLGetLastErrorType();
13382       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
13383         do_confess( CPLGetLastErrorMsg(), 0 );
13384 
13385 
13386 
13387 
13388 
13389       }
13390 
13391 
13392       /*
13393           Make warnings regular Perl warnings. This duplicates the warning
13394           message if DontUseExceptions() is in effect (it is not by default).
13395           */
13396       if ( eclass == CE_Warning ) {
13397         warn( CPLGetLastErrorMsg(), "%s" );
13398       }
13399 
13400 
13401     }
13402     {
13403       /* %typemap(out) void */
13404     }
13405 
13406 
13407     XSRETURN(argvi);
13408   fail:
13409 
13410 
13411     SWIG_croak_null();
13412   }
13413 }
13414 
13415 
XS(_wrap_GDAL_GCP_GCPLine_get)13416 XS(_wrap_GDAL_GCP_GCPLine_get) {
13417   {
13418     GDAL_GCP *arg1 = (GDAL_GCP *) 0 ;
13419     void *argp1 = 0 ;
13420     int res1 = 0 ;
13421     int argvi = 0;
13422     double result;
13423     dXSARGS;
13424 
13425     if ((items < 1) || (items > 1)) {
13426       SWIG_croak("Usage: GDAL_GCP_GCPLine_get(gcp);");
13427     }
13428     res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_GDAL_GCP, 0 |  0 );
13429     if (!SWIG_IsOK(res1)) {
13430       SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "GDAL_GCP_GCPLine_get" "', argument " "1"" of type '" "GDAL_GCP *""'");
13431     }
13432     arg1 = reinterpret_cast< GDAL_GCP * >(argp1);
13433     {
13434       if (!arg1) {
13435         SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
13436       }
13437     }
13438     {
13439       CPLErrorReset();
13440       result = (double)GDAL_GCP_GCPLine_get(arg1);
13441       CPLErr eclass = CPLGetLastErrorType();
13442       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
13443         do_confess( CPLGetLastErrorMsg(), 0 );
13444 
13445 
13446 
13447 
13448 
13449       }
13450 
13451 
13452       /*
13453           Make warnings regular Perl warnings. This duplicates the warning
13454           message if DontUseExceptions() is in effect (it is not by default).
13455           */
13456       if ( eclass == CE_Warning ) {
13457         warn( CPLGetLastErrorMsg(), "%s" );
13458       }
13459 
13460 
13461     }
13462     ST(argvi) = SWIG_From_double  SWIG_PERL_CALL_ARGS_1(static_cast< double >(result)); argvi++ ;
13463 
13464     XSRETURN(argvi);
13465   fail:
13466 
13467     SWIG_croak_null();
13468   }
13469 }
13470 
13471 
XS(_wrap_GDAL_GCP_GCPLine_set)13472 XS(_wrap_GDAL_GCP_GCPLine_set) {
13473   {
13474     GDAL_GCP *arg1 = (GDAL_GCP *) 0 ;
13475     double arg2 ;
13476     void *argp1 = 0 ;
13477     int res1 = 0 ;
13478     double val2 ;
13479     int ecode2 = 0 ;
13480     int argvi = 0;
13481     dXSARGS;
13482 
13483     if ((items < 2) || (items > 2)) {
13484       SWIG_croak("Usage: GDAL_GCP_GCPLine_set(gcp,dfGCPLine);");
13485     }
13486     res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_GDAL_GCP, 0 |  0 );
13487     if (!SWIG_IsOK(res1)) {
13488       SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "GDAL_GCP_GCPLine_set" "', argument " "1"" of type '" "GDAL_GCP *""'");
13489     }
13490     arg1 = reinterpret_cast< GDAL_GCP * >(argp1);
13491     ecode2 = SWIG_AsVal_double SWIG_PERL_CALL_ARGS_2(ST(1), &val2);
13492     if (!SWIG_IsOK(ecode2)) {
13493       SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "GDAL_GCP_GCPLine_set" "', argument " "2"" of type '" "double""'");
13494     }
13495     arg2 = static_cast< double >(val2);
13496     {
13497       if (!arg1) {
13498         SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
13499       }
13500     }
13501     {
13502       CPLErrorReset();
13503       GDAL_GCP_GCPLine_set(arg1,arg2);
13504       CPLErr eclass = CPLGetLastErrorType();
13505       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
13506         do_confess( CPLGetLastErrorMsg(), 0 );
13507 
13508 
13509 
13510 
13511 
13512       }
13513 
13514 
13515       /*
13516           Make warnings regular Perl warnings. This duplicates the warning
13517           message if DontUseExceptions() is in effect (it is not by default).
13518           */
13519       if ( eclass == CE_Warning ) {
13520         warn( CPLGetLastErrorMsg(), "%s" );
13521       }
13522 
13523 
13524     }
13525     {
13526       /* %typemap(out) void */
13527     }
13528 
13529 
13530     XSRETURN(argvi);
13531   fail:
13532 
13533 
13534     SWIG_croak_null();
13535   }
13536 }
13537 
13538 
XS(_wrap_GDAL_GCP_Info_get)13539 XS(_wrap_GDAL_GCP_Info_get) {
13540   {
13541     GDAL_GCP *arg1 = (GDAL_GCP *) 0 ;
13542     void *argp1 = 0 ;
13543     int res1 = 0 ;
13544     int argvi = 0;
13545     char *result = 0 ;
13546     dXSARGS;
13547 
13548     if ((items < 1) || (items > 1)) {
13549       SWIG_croak("Usage: GDAL_GCP_Info_get(gcp);");
13550     }
13551     res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_GDAL_GCP, 0 |  0 );
13552     if (!SWIG_IsOK(res1)) {
13553       SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "GDAL_GCP_Info_get" "', argument " "1"" of type '" "GDAL_GCP *""'");
13554     }
13555     arg1 = reinterpret_cast< GDAL_GCP * >(argp1);
13556     {
13557       if (!arg1) {
13558         SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
13559       }
13560     }
13561     {
13562       CPLErrorReset();
13563       result = (char *)GDAL_GCP_Info_get(arg1);
13564       CPLErr eclass = CPLGetLastErrorType();
13565       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
13566         do_confess( CPLGetLastErrorMsg(), 0 );
13567 
13568 
13569 
13570 
13571 
13572       }
13573 
13574 
13575       /*
13576           Make warnings regular Perl warnings. This duplicates the warning
13577           message if DontUseExceptions() is in effect (it is not by default).
13578           */
13579       if ( eclass == CE_Warning ) {
13580         warn( CPLGetLastErrorMsg(), "%s" );
13581       }
13582 
13583 
13584     }
13585     {
13586       /* %typemap(out) const char * */
13587       ST(argvi) = newSVpv(result, 0);
13588       SvUTF8_on(ST(argvi)); /* expecting GDAL to give us UTF-8 */
13589       sv_2mortal(ST(argvi));
13590       argvi++;
13591     }
13592 
13593     XSRETURN(argvi);
13594   fail:
13595 
13596     SWIG_croak_null();
13597   }
13598 }
13599 
13600 
XS(_wrap_GDAL_GCP_Info_set)13601 XS(_wrap_GDAL_GCP_Info_set) {
13602   {
13603     GDAL_GCP *arg1 = (GDAL_GCP *) 0 ;
13604     char *arg2 = (char *) 0 ;
13605     void *argp1 = 0 ;
13606     int res1 = 0 ;
13607     int res2 ;
13608     char *buf2 = 0 ;
13609     int alloc2 = 0 ;
13610     int argvi = 0;
13611     dXSARGS;
13612 
13613     if ((items < 2) || (items > 2)) {
13614       SWIG_croak("Usage: GDAL_GCP_Info_set(gcp,pszInfo);");
13615     }
13616     res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_GDAL_GCP, 0 |  0 );
13617     if (!SWIG_IsOK(res1)) {
13618       SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "GDAL_GCP_Info_set" "', argument " "1"" of type '" "GDAL_GCP *""'");
13619     }
13620     arg1 = reinterpret_cast< GDAL_GCP * >(argp1);
13621     res2 = SWIG_AsCharPtrAndSize(ST(1), &buf2, NULL, &alloc2);
13622     if (!SWIG_IsOK(res2)) {
13623       SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "GDAL_GCP_Info_set" "', argument " "2"" of type '" "char const *""'");
13624     }
13625     arg2 = reinterpret_cast< char * >(buf2);
13626     {
13627       if (!arg1) {
13628         SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
13629       }
13630     }
13631     {
13632       CPLErrorReset();
13633       GDAL_GCP_Info_set(arg1,(char const *)arg2);
13634       CPLErr eclass = CPLGetLastErrorType();
13635       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
13636         do_confess( CPLGetLastErrorMsg(), 0 );
13637 
13638 
13639 
13640 
13641 
13642       }
13643 
13644 
13645       /*
13646           Make warnings regular Perl warnings. This duplicates the warning
13647           message if DontUseExceptions() is in effect (it is not by default).
13648           */
13649       if ( eclass == CE_Warning ) {
13650         warn( CPLGetLastErrorMsg(), "%s" );
13651       }
13652 
13653 
13654     }
13655     {
13656       /* %typemap(out) void */
13657     }
13658 
13659     if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
13660     XSRETURN(argvi);
13661   fail:
13662 
13663     if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
13664     SWIG_croak_null();
13665   }
13666 }
13667 
13668 
XS(_wrap_GDAL_GCP_Id_get)13669 XS(_wrap_GDAL_GCP_Id_get) {
13670   {
13671     GDAL_GCP *arg1 = (GDAL_GCP *) 0 ;
13672     void *argp1 = 0 ;
13673     int res1 = 0 ;
13674     int argvi = 0;
13675     char *result = 0 ;
13676     dXSARGS;
13677 
13678     if ((items < 1) || (items > 1)) {
13679       SWIG_croak("Usage: GDAL_GCP_Id_get(gcp);");
13680     }
13681     res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_GDAL_GCP, 0 |  0 );
13682     if (!SWIG_IsOK(res1)) {
13683       SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "GDAL_GCP_Id_get" "', argument " "1"" of type '" "GDAL_GCP *""'");
13684     }
13685     arg1 = reinterpret_cast< GDAL_GCP * >(argp1);
13686     {
13687       if (!arg1) {
13688         SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
13689       }
13690     }
13691     {
13692       CPLErrorReset();
13693       result = (char *)GDAL_GCP_Id_get(arg1);
13694       CPLErr eclass = CPLGetLastErrorType();
13695       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
13696         do_confess( CPLGetLastErrorMsg(), 0 );
13697 
13698 
13699 
13700 
13701 
13702       }
13703 
13704 
13705       /*
13706           Make warnings regular Perl warnings. This duplicates the warning
13707           message if DontUseExceptions() is in effect (it is not by default).
13708           */
13709       if ( eclass == CE_Warning ) {
13710         warn( CPLGetLastErrorMsg(), "%s" );
13711       }
13712 
13713 
13714     }
13715     {
13716       /* %typemap(out) const char * */
13717       ST(argvi) = newSVpv(result, 0);
13718       SvUTF8_on(ST(argvi)); /* expecting GDAL to give us UTF-8 */
13719       sv_2mortal(ST(argvi));
13720       argvi++;
13721     }
13722 
13723     XSRETURN(argvi);
13724   fail:
13725 
13726     SWIG_croak_null();
13727   }
13728 }
13729 
13730 
XS(_wrap_GDAL_GCP_Id_set)13731 XS(_wrap_GDAL_GCP_Id_set) {
13732   {
13733     GDAL_GCP *arg1 = (GDAL_GCP *) 0 ;
13734     char *arg2 = (char *) 0 ;
13735     void *argp1 = 0 ;
13736     int res1 = 0 ;
13737     int res2 ;
13738     char *buf2 = 0 ;
13739     int alloc2 = 0 ;
13740     int argvi = 0;
13741     dXSARGS;
13742 
13743     if ((items < 2) || (items > 2)) {
13744       SWIG_croak("Usage: GDAL_GCP_Id_set(gcp,pszId);");
13745     }
13746     res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_GDAL_GCP, 0 |  0 );
13747     if (!SWIG_IsOK(res1)) {
13748       SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "GDAL_GCP_Id_set" "', argument " "1"" of type '" "GDAL_GCP *""'");
13749     }
13750     arg1 = reinterpret_cast< GDAL_GCP * >(argp1);
13751     res2 = SWIG_AsCharPtrAndSize(ST(1), &buf2, NULL, &alloc2);
13752     if (!SWIG_IsOK(res2)) {
13753       SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "GDAL_GCP_Id_set" "', argument " "2"" of type '" "char const *""'");
13754     }
13755     arg2 = reinterpret_cast< char * >(buf2);
13756     {
13757       if (!arg1) {
13758         SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
13759       }
13760     }
13761     {
13762       CPLErrorReset();
13763       GDAL_GCP_Id_set(arg1,(char const *)arg2);
13764       CPLErr eclass = CPLGetLastErrorType();
13765       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
13766         do_confess( CPLGetLastErrorMsg(), 0 );
13767 
13768 
13769 
13770 
13771 
13772       }
13773 
13774 
13775       /*
13776           Make warnings regular Perl warnings. This duplicates the warning
13777           message if DontUseExceptions() is in effect (it is not by default).
13778           */
13779       if ( eclass == CE_Warning ) {
13780         warn( CPLGetLastErrorMsg(), "%s" );
13781       }
13782 
13783 
13784     }
13785     {
13786       /* %typemap(out) void */
13787     }
13788 
13789     if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
13790     XSRETURN(argvi);
13791   fail:
13792 
13793     if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
13794     SWIG_croak_null();
13795   }
13796 }
13797 
13798 
XS(_wrap_GCPsToGeoTransform)13799 XS(_wrap_GCPsToGeoTransform) {
13800   {
13801     int arg1 ;
13802     GDAL_GCP *arg2 = (GDAL_GCP *) 0 ;
13803     double *arg3 ;
13804     int arg4 = (int) 1 ;
13805     double argout3[6] ;
13806     int val4 ;
13807     int ecode4 = 0 ;
13808     int argvi = 0;
13809     RETURN_NONE result;
13810     dXSARGS;
13811 
13812     {
13813       /* %typemap(in,numinputs=0) (double argout3[ANY]) */
13814       arg3 = argout3;
13815     }
13816     if ((items < 1) || (items > 2)) {
13817       SWIG_croak("Usage: GCPsToGeoTransform(nGCPs,pGCPs,bApproxOK);");
13818     }
13819     {
13820       /* %typemap(in,numinputs=1) (int nGCPs, GDAL_GCP const *pGCPs ) */
13821       if (!(SvROK(ST(0)) && (SvTYPE(SvRV(ST(0)))==SVt_PVAV)))
13822       do_confess(NEED_ARRAY_REF, 1);
13823       AV *av = (AV*)(SvRV(ST(0)));
13824       arg1 = av_len(av)+1;
13825       arg2 = (GDAL_GCP *)CPLMalloc(arg1*sizeof(GDAL_GCP));
13826       if (arg2) {
13827         for (int i = 0; i < arg1; i++ ) {
13828           SV **sv = av_fetch(av, i, 0);
13829           GDAL_GCP *gcp;
13830           int ret = SWIG_ConvertPtr(*sv, (void**)&gcp, SWIGTYPE_p_GDAL_GCP, 0);
13831           if (!SWIG_IsOK(ret))
13832           do_confess(WRONG_ITEM_IN_ARRAY, 1);
13833           arg2[i] = *gcp;
13834         }
13835       } else
13836       do_confess(OUT_OF_MEMORY, 1);
13837     }
13838     if (items > 1) {
13839       ecode4 = SWIG_AsVal_int SWIG_PERL_CALL_ARGS_2(ST(1), &val4);
13840       if (!SWIG_IsOK(ecode4)) {
13841         SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "GCPsToGeoTransform" "', argument " "4"" of type '" "int""'");
13842       }
13843       arg4 = static_cast< int >(val4);
13844     }
13845     {
13846       CPLErrorReset();
13847       result = (RETURN_NONE)GDALGCPsToGeoTransform(arg1,(GDAL_GCP const *)arg2,arg3,arg4);
13848       CPLErr eclass = CPLGetLastErrorType();
13849       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
13850         do_confess( CPLGetLastErrorMsg(), 0 );
13851 
13852 
13853 
13854 
13855 
13856       }
13857 
13858 
13859       /*
13860           Make warnings regular Perl warnings. This duplicates the warning
13861           message if DontUseExceptions() is in effect (it is not by default).
13862           */
13863       if ( eclass == CE_Warning ) {
13864         warn( CPLGetLastErrorMsg(), "%s" );
13865       }
13866 
13867 
13868     }
13869     {
13870       /* %typemap(out) IF_FALSE_RETURN_NONE */
13871     }
13872     {
13873       /* %typemap(argout) (double argout[ANY]) */
13874       if (GIMME_V == G_ARRAY) {
13875         /* return a list */
13876         int i;
13877         EXTEND(SP, argvi+6-items+1);
13878         for (i = 0; i < 6; i++)
13879         ST(argvi++) = sv_2mortal(newSVnv(arg3[i]));
13880       } else {
13881         ST(argvi) = CreateArrayFromDoubleArray( arg3, 6 );
13882         argvi++;
13883       }
13884     }
13885     {
13886       /* %typemap(freearg) (int nGCPs, GDAL_GCP const *pGCPs ) */
13887       CPLFree(arg2);
13888     }
13889 
13890 
13891     {
13892       /* %typemap(ret) IF_FALSE_RETURN_NONE */
13893       if (result == 0 ) {
13894         do_confess(CALL_FAILED, 1);
13895       }
13896     }
13897     XSRETURN(argvi);
13898   fail:
13899     {
13900       /* %typemap(freearg) (int nGCPs, GDAL_GCP const *pGCPs ) */
13901       CPLFree(arg2);
13902     }
13903 
13904 
13905     SWIG_croak_null();
13906   }
13907 }
13908 
13909 
XS(_wrap_delete_AsyncReader)13910 XS(_wrap_delete_AsyncReader) {
13911   {
13912     GDALAsyncReaderShadow *arg1 = (GDALAsyncReaderShadow *) 0 ;
13913     void *argp1 = 0 ;
13914     int res1 = 0 ;
13915     int argvi = 0;
13916     dXSARGS;
13917 
13918     if ((items < 1) || (items > 1)) {
13919       SWIG_croak("Usage: delete_AsyncReader(self);");
13920     }
13921     res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_GDALAsyncReaderShadow, SWIG_POINTER_DISOWN |  0 );
13922     if (!SWIG_IsOK(res1)) {
13923       SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_AsyncReader" "', argument " "1"" of type '" "GDALAsyncReaderShadow *""'");
13924     }
13925     arg1 = reinterpret_cast< GDALAsyncReaderShadow * >(argp1);
13926     {
13927       CPLErrorReset();
13928       delete_GDALAsyncReaderShadow(arg1);
13929       CPLErr eclass = CPLGetLastErrorType();
13930       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
13931         do_confess( CPLGetLastErrorMsg(), 0 );
13932 
13933 
13934 
13935 
13936 
13937       }
13938 
13939 
13940       /*
13941           Make warnings regular Perl warnings. This duplicates the warning
13942           message if DontUseExceptions() is in effect (it is not by default).
13943           */
13944       if ( eclass == CE_Warning ) {
13945         warn( CPLGetLastErrorMsg(), "%s" );
13946       }
13947 
13948 
13949     }
13950     {
13951       /* %typemap(out) void */
13952     }
13953 
13954     XSRETURN(argvi);
13955   fail:
13956 
13957     SWIG_croak_null();
13958   }
13959 }
13960 
13961 
XS(_wrap_AsyncReader_GetNextUpdatedRegion)13962 XS(_wrap_AsyncReader_GetNextUpdatedRegion) {
13963   {
13964     GDALAsyncReaderShadow *arg1 = (GDALAsyncReaderShadow *) 0 ;
13965     double arg2 ;
13966     int *arg3 = (int *) 0 ;
13967     int *arg4 = (int *) 0 ;
13968     int *arg5 = (int *) 0 ;
13969     int *arg6 = (int *) 0 ;
13970     void *argp1 = 0 ;
13971     int res1 = 0 ;
13972     double val2 ;
13973     int ecode2 = 0 ;
13974     int temp3 ;
13975     int res3 = SWIG_TMPOBJ ;
13976     int temp4 ;
13977     int res4 = SWIG_TMPOBJ ;
13978     int temp5 ;
13979     int res5 = SWIG_TMPOBJ ;
13980     int temp6 ;
13981     int res6 = SWIG_TMPOBJ ;
13982     int argvi = 0;
13983     GDALAsyncStatusType result;
13984     dXSARGS;
13985 
13986     arg3 = &temp3;
13987     arg4 = &temp4;
13988     arg5 = &temp5;
13989     arg6 = &temp6;
13990     if ((items < 2) || (items > 2)) {
13991       SWIG_croak("Usage: AsyncReader_GetNextUpdatedRegion(self,timeout);");
13992     }
13993     res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_GDALAsyncReaderShadow, 0 |  0 );
13994     if (!SWIG_IsOK(res1)) {
13995       SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "AsyncReader_GetNextUpdatedRegion" "', argument " "1"" of type '" "GDALAsyncReaderShadow *""'");
13996     }
13997     arg1 = reinterpret_cast< GDALAsyncReaderShadow * >(argp1);
13998     ecode2 = SWIG_AsVal_double SWIG_PERL_CALL_ARGS_2(ST(1), &val2);
13999     if (!SWIG_IsOK(ecode2)) {
14000       SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "AsyncReader_GetNextUpdatedRegion" "', argument " "2"" of type '" "double""'");
14001     }
14002     arg2 = static_cast< double >(val2);
14003     {
14004       CPLErrorReset();
14005       result = (GDALAsyncStatusType)GDALAsyncReaderShadow_GetNextUpdatedRegion(arg1,arg2,arg3,arg4,arg5,arg6);
14006       CPLErr eclass = CPLGetLastErrorType();
14007       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
14008         do_confess( CPLGetLastErrorMsg(), 0 );
14009 
14010 
14011 
14012 
14013 
14014       }
14015 
14016 
14017       /*
14018           Make warnings regular Perl warnings. This duplicates the warning
14019           message if DontUseExceptions() is in effect (it is not by default).
14020           */
14021       if ( eclass == CE_Warning ) {
14022         warn( CPLGetLastErrorMsg(), "%s" );
14023       }
14024 
14025 
14026     }
14027     ST(argvi) = SWIG_From_int  SWIG_PERL_CALL_ARGS_1(static_cast< int >(result)); argvi++ ;
14028     if (SWIG_IsTmpObj(res3)) {
14029       if (argvi >= items) EXTEND(sp,1);  ST(argvi) = SWIG_From_int  SWIG_PERL_CALL_ARGS_1((*arg3)); argvi++  ;
14030     } else {
14031       int new_flags = SWIG_IsNewObj(res3) ? (SWIG_POINTER_OWN | 0) : 0;
14032       if (argvi >= items) EXTEND(sp,1);  ST(argvi) = SWIG_NewPointerObj((void*)(arg3), SWIGTYPE_p_int, new_flags); argvi++  ;
14033     }
14034     if (SWIG_IsTmpObj(res4)) {
14035       if (argvi >= items) EXTEND(sp,1);  ST(argvi) = SWIG_From_int  SWIG_PERL_CALL_ARGS_1((*arg4)); argvi++  ;
14036     } else {
14037       int new_flags = SWIG_IsNewObj(res4) ? (SWIG_POINTER_OWN | 0) : 0;
14038       if (argvi >= items) EXTEND(sp,1);  ST(argvi) = SWIG_NewPointerObj((void*)(arg4), SWIGTYPE_p_int, new_flags); argvi++  ;
14039     }
14040     if (SWIG_IsTmpObj(res5)) {
14041       if (argvi >= items) EXTEND(sp,1);  ST(argvi) = SWIG_From_int  SWIG_PERL_CALL_ARGS_1((*arg5)); argvi++  ;
14042     } else {
14043       int new_flags = SWIG_IsNewObj(res5) ? (SWIG_POINTER_OWN | 0) : 0;
14044       if (argvi >= items) EXTEND(sp,1);  ST(argvi) = SWIG_NewPointerObj((void*)(arg5), SWIGTYPE_p_int, new_flags); argvi++  ;
14045     }
14046     if (SWIG_IsTmpObj(res6)) {
14047       if (argvi >= items) EXTEND(sp,1);  ST(argvi) = SWIG_From_int  SWIG_PERL_CALL_ARGS_1((*arg6)); argvi++  ;
14048     } else {
14049       int new_flags = SWIG_IsNewObj(res6) ? (SWIG_POINTER_OWN | 0) : 0;
14050       if (argvi >= items) EXTEND(sp,1);  ST(argvi) = SWIG_NewPointerObj((void*)(arg6), SWIGTYPE_p_int, new_flags); argvi++  ;
14051     }
14052 
14053 
14054 
14055 
14056 
14057 
14058     XSRETURN(argvi);
14059   fail:
14060 
14061 
14062 
14063 
14064 
14065 
14066     SWIG_croak_null();
14067   }
14068 }
14069 
14070 
XS(_wrap_AsyncReader_LockBuffer)14071 XS(_wrap_AsyncReader_LockBuffer) {
14072   {
14073     GDALAsyncReaderShadow *arg1 = (GDALAsyncReaderShadow *) 0 ;
14074     double arg2 ;
14075     void *argp1 = 0 ;
14076     int res1 = 0 ;
14077     double val2 ;
14078     int ecode2 = 0 ;
14079     int argvi = 0;
14080     int result;
14081     dXSARGS;
14082 
14083     if ((items < 2) || (items > 2)) {
14084       SWIG_croak("Usage: AsyncReader_LockBuffer(self,timeout);");
14085     }
14086     res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_GDALAsyncReaderShadow, 0 |  0 );
14087     if (!SWIG_IsOK(res1)) {
14088       SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "AsyncReader_LockBuffer" "', argument " "1"" of type '" "GDALAsyncReaderShadow *""'");
14089     }
14090     arg1 = reinterpret_cast< GDALAsyncReaderShadow * >(argp1);
14091     ecode2 = SWIG_AsVal_double SWIG_PERL_CALL_ARGS_2(ST(1), &val2);
14092     if (!SWIG_IsOK(ecode2)) {
14093       SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "AsyncReader_LockBuffer" "', argument " "2"" of type '" "double""'");
14094     }
14095     arg2 = static_cast< double >(val2);
14096     {
14097       CPLErrorReset();
14098       result = (int)GDALAsyncReaderShadow_LockBuffer(arg1,arg2);
14099       CPLErr eclass = CPLGetLastErrorType();
14100       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
14101         do_confess( CPLGetLastErrorMsg(), 0 );
14102 
14103 
14104 
14105 
14106 
14107       }
14108 
14109 
14110       /*
14111           Make warnings regular Perl warnings. This duplicates the warning
14112           message if DontUseExceptions() is in effect (it is not by default).
14113           */
14114       if ( eclass == CE_Warning ) {
14115         warn( CPLGetLastErrorMsg(), "%s" );
14116       }
14117 
14118 
14119     }
14120     ST(argvi) = SWIG_From_int  SWIG_PERL_CALL_ARGS_1(static_cast< int >(result)); argvi++ ;
14121 
14122 
14123     XSRETURN(argvi);
14124   fail:
14125 
14126 
14127     SWIG_croak_null();
14128   }
14129 }
14130 
14131 
XS(_wrap_AsyncReader_UnlockBuffer)14132 XS(_wrap_AsyncReader_UnlockBuffer) {
14133   {
14134     GDALAsyncReaderShadow *arg1 = (GDALAsyncReaderShadow *) 0 ;
14135     void *argp1 = 0 ;
14136     int res1 = 0 ;
14137     int argvi = 0;
14138     dXSARGS;
14139 
14140     if ((items < 1) || (items > 1)) {
14141       SWIG_croak("Usage: AsyncReader_UnlockBuffer(self);");
14142     }
14143     res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_GDALAsyncReaderShadow, 0 |  0 );
14144     if (!SWIG_IsOK(res1)) {
14145       SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "AsyncReader_UnlockBuffer" "', argument " "1"" of type '" "GDALAsyncReaderShadow *""'");
14146     }
14147     arg1 = reinterpret_cast< GDALAsyncReaderShadow * >(argp1);
14148     {
14149       CPLErrorReset();
14150       GDALAsyncReaderShadow_UnlockBuffer(arg1);
14151       CPLErr eclass = CPLGetLastErrorType();
14152       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
14153         do_confess( CPLGetLastErrorMsg(), 0 );
14154 
14155 
14156 
14157 
14158 
14159       }
14160 
14161 
14162       /*
14163           Make warnings regular Perl warnings. This duplicates the warning
14164           message if DontUseExceptions() is in effect (it is not by default).
14165           */
14166       if ( eclass == CE_Warning ) {
14167         warn( CPLGetLastErrorMsg(), "%s" );
14168       }
14169 
14170 
14171     }
14172     {
14173       /* %typemap(out) void */
14174     }
14175 
14176     XSRETURN(argvi);
14177   fail:
14178 
14179     SWIG_croak_null();
14180   }
14181 }
14182 
14183 
XS(_wrap_Dataset_RasterXSize_get)14184 XS(_wrap_Dataset_RasterXSize_get) {
14185   {
14186     GDALDatasetShadow *arg1 = (GDALDatasetShadow *) 0 ;
14187     int argvi = 0;
14188     int result;
14189     dXSARGS;
14190 
14191     if ((items < 1) || (items > 1)) {
14192       SWIG_croak("Usage: Dataset_RasterXSize_get(self);");
14193     }
14194     {
14195       /* %typemap(in) (GDALDatasetShadow *) */
14196       void *argp = 0;
14197       int res = SWIG_ConvertPtr(ST(0), &argp, SWIGTYPE_p_GDALDatasetShadow, 0 |  0 );
14198       if (!SWIG_IsOK(res)) {
14199         do_confess(WRONG_CLASS, 1);
14200       }
14201       arg1 = reinterpret_cast< GDALDatasetShadow * >(argp);
14202       if (arg1 == NULL)
14203       do_confess(NEED_DEF, 1);
14204     }
14205     {
14206       CPLErrorReset();
14207       result = (int)GDALDatasetShadow_RasterXSize_get(arg1);
14208       CPLErr eclass = CPLGetLastErrorType();
14209       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
14210         do_confess( CPLGetLastErrorMsg(), 0 );
14211 
14212 
14213 
14214 
14215 
14216       }
14217 
14218 
14219       /*
14220           Make warnings regular Perl warnings. This duplicates the warning
14221           message if DontUseExceptions() is in effect (it is not by default).
14222           */
14223       if ( eclass == CE_Warning ) {
14224         warn( CPLGetLastErrorMsg(), "%s" );
14225       }
14226 
14227 
14228     }
14229     ST(argvi) = SWIG_From_int  SWIG_PERL_CALL_ARGS_1(static_cast< int >(result)); argvi++ ;
14230 
14231     XSRETURN(argvi);
14232   fail:
14233 
14234     SWIG_croak_null();
14235   }
14236 }
14237 
14238 
XS(_wrap_Dataset_RasterYSize_get)14239 XS(_wrap_Dataset_RasterYSize_get) {
14240   {
14241     GDALDatasetShadow *arg1 = (GDALDatasetShadow *) 0 ;
14242     int argvi = 0;
14243     int result;
14244     dXSARGS;
14245 
14246     if ((items < 1) || (items > 1)) {
14247       SWIG_croak("Usage: Dataset_RasterYSize_get(self);");
14248     }
14249     {
14250       /* %typemap(in) (GDALDatasetShadow *) */
14251       void *argp = 0;
14252       int res = SWIG_ConvertPtr(ST(0), &argp, SWIGTYPE_p_GDALDatasetShadow, 0 |  0 );
14253       if (!SWIG_IsOK(res)) {
14254         do_confess(WRONG_CLASS, 1);
14255       }
14256       arg1 = reinterpret_cast< GDALDatasetShadow * >(argp);
14257       if (arg1 == NULL)
14258       do_confess(NEED_DEF, 1);
14259     }
14260     {
14261       CPLErrorReset();
14262       result = (int)GDALDatasetShadow_RasterYSize_get(arg1);
14263       CPLErr eclass = CPLGetLastErrorType();
14264       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
14265         do_confess( CPLGetLastErrorMsg(), 0 );
14266 
14267 
14268 
14269 
14270 
14271       }
14272 
14273 
14274       /*
14275           Make warnings regular Perl warnings. This duplicates the warning
14276           message if DontUseExceptions() is in effect (it is not by default).
14277           */
14278       if ( eclass == CE_Warning ) {
14279         warn( CPLGetLastErrorMsg(), "%s" );
14280       }
14281 
14282 
14283     }
14284     ST(argvi) = SWIG_From_int  SWIG_PERL_CALL_ARGS_1(static_cast< int >(result)); argvi++ ;
14285 
14286     XSRETURN(argvi);
14287   fail:
14288 
14289     SWIG_croak_null();
14290   }
14291 }
14292 
14293 
XS(_wrap_Dataset_RasterCount_get)14294 XS(_wrap_Dataset_RasterCount_get) {
14295   {
14296     GDALDatasetShadow *arg1 = (GDALDatasetShadow *) 0 ;
14297     int argvi = 0;
14298     int result;
14299     dXSARGS;
14300 
14301     if ((items < 1) || (items > 1)) {
14302       SWIG_croak("Usage: Dataset_RasterCount_get(self);");
14303     }
14304     {
14305       /* %typemap(in) (GDALDatasetShadow *) */
14306       void *argp = 0;
14307       int res = SWIG_ConvertPtr(ST(0), &argp, SWIGTYPE_p_GDALDatasetShadow, 0 |  0 );
14308       if (!SWIG_IsOK(res)) {
14309         do_confess(WRONG_CLASS, 1);
14310       }
14311       arg1 = reinterpret_cast< GDALDatasetShadow * >(argp);
14312       if (arg1 == NULL)
14313       do_confess(NEED_DEF, 1);
14314     }
14315     {
14316       CPLErrorReset();
14317       result = (int)GDALDatasetShadow_RasterCount_get(arg1);
14318       CPLErr eclass = CPLGetLastErrorType();
14319       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
14320         do_confess( CPLGetLastErrorMsg(), 0 );
14321 
14322 
14323 
14324 
14325 
14326       }
14327 
14328 
14329       /*
14330           Make warnings regular Perl warnings. This duplicates the warning
14331           message if DontUseExceptions() is in effect (it is not by default).
14332           */
14333       if ( eclass == CE_Warning ) {
14334         warn( CPLGetLastErrorMsg(), "%s" );
14335       }
14336 
14337 
14338     }
14339     ST(argvi) = SWIG_From_int  SWIG_PERL_CALL_ARGS_1(static_cast< int >(result)); argvi++ ;
14340 
14341     XSRETURN(argvi);
14342   fail:
14343 
14344     SWIG_croak_null();
14345   }
14346 }
14347 
14348 
XS(_wrap_delete_Dataset)14349 XS(_wrap_delete_Dataset) {
14350   {
14351     GDALDatasetShadow *arg1 = (GDALDatasetShadow *) 0 ;
14352     int argvi = 0;
14353     dXSARGS;
14354 
14355     if ((items < 1) || (items > 1)) {
14356       SWIG_croak("Usage: delete_Dataset(self);");
14357     }
14358     {
14359       /* %typemap(in) (GDALDatasetShadow *) */
14360       void *argp = 0;
14361       int res = SWIG_ConvertPtr(ST(0), &argp, SWIGTYPE_p_GDALDatasetShadow, 0 |  0 );
14362       if (!SWIG_IsOK(res)) {
14363         do_confess(WRONG_CLASS, 1);
14364       }
14365       arg1 = reinterpret_cast< GDALDatasetShadow * >(argp);
14366       if (arg1 == NULL)
14367       do_confess(NEED_DEF, 1);
14368     }
14369     {
14370       CPLErrorReset();
14371       delete_GDALDatasetShadow(arg1);
14372       CPLErr eclass = CPLGetLastErrorType();
14373       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
14374         do_confess( CPLGetLastErrorMsg(), 0 );
14375 
14376 
14377 
14378 
14379 
14380       }
14381 
14382 
14383       /*
14384           Make warnings regular Perl warnings. This duplicates the warning
14385           message if DontUseExceptions() is in effect (it is not by default).
14386           */
14387       if ( eclass == CE_Warning ) {
14388         warn( CPLGetLastErrorMsg(), "%s" );
14389       }
14390 
14391 
14392     }
14393     {
14394       /* %typemap(out) void */
14395     }
14396 
14397     XSRETURN(argvi);
14398   fail:
14399 
14400     SWIG_croak_null();
14401   }
14402 }
14403 
14404 
XS(_wrap_Dataset_GetDriver)14405 XS(_wrap_Dataset_GetDriver) {
14406   {
14407     GDALDatasetShadow *arg1 = (GDALDatasetShadow *) 0 ;
14408     int argvi = 0;
14409     GDALDriverShadow *result = 0 ;
14410     dXSARGS;
14411 
14412     if ((items < 1) || (items > 1)) {
14413       SWIG_croak("Usage: Dataset_GetDriver(self);");
14414     }
14415     {
14416       /* %typemap(in) (GDALDatasetShadow *) */
14417       void *argp = 0;
14418       int res = SWIG_ConvertPtr(ST(0), &argp, SWIGTYPE_p_GDALDatasetShadow, 0 |  0 );
14419       if (!SWIG_IsOK(res)) {
14420         do_confess(WRONG_CLASS, 1);
14421       }
14422       arg1 = reinterpret_cast< GDALDatasetShadow * >(argp);
14423       if (arg1 == NULL)
14424       do_confess(NEED_DEF, 1);
14425     }
14426     {
14427       CPLErrorReset();
14428       result = (GDALDriverShadow *)GDALDatasetShadow_GetDriver(arg1);
14429       CPLErr eclass = CPLGetLastErrorType();
14430       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
14431         do_confess( CPLGetLastErrorMsg(), 0 );
14432 
14433 
14434 
14435 
14436 
14437       }
14438 
14439 
14440       /*
14441           Make warnings regular Perl warnings. This duplicates the warning
14442           message if DontUseExceptions() is in effect (it is not by default).
14443           */
14444       if ( eclass == CE_Warning ) {
14445         warn( CPLGetLastErrorMsg(), "%s" );
14446       }
14447 
14448 
14449     }
14450     ST(argvi) = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GDALDriverShadow, 0 | SWIG_SHADOW); argvi++ ;
14451 
14452     XSRETURN(argvi);
14453   fail:
14454 
14455     SWIG_croak_null();
14456   }
14457 }
14458 
14459 
XS(_wrap_Dataset__GetRasterBand)14460 XS(_wrap_Dataset__GetRasterBand) {
14461   {
14462     GDALDatasetShadow *arg1 = (GDALDatasetShadow *) 0 ;
14463     int arg2 ;
14464     int val2 ;
14465     int ecode2 = 0 ;
14466     int argvi = 0;
14467     GDALRasterBandShadow *result = 0 ;
14468     dXSARGS;
14469 
14470     if ((items < 2) || (items > 2)) {
14471       SWIG_croak("Usage: Dataset__GetRasterBand(self,nBand);");
14472     }
14473     {
14474       /* %typemap(in) (GDALDatasetShadow *) */
14475       void *argp = 0;
14476       int res = SWIG_ConvertPtr(ST(0), &argp, SWIGTYPE_p_GDALDatasetShadow, 0 |  0 );
14477       if (!SWIG_IsOK(res)) {
14478         do_confess(WRONG_CLASS, 1);
14479       }
14480       arg1 = reinterpret_cast< GDALDatasetShadow * >(argp);
14481       if (arg1 == NULL)
14482       do_confess(NEED_DEF, 1);
14483     }
14484     ecode2 = SWIG_AsVal_int SWIG_PERL_CALL_ARGS_2(ST(1), &val2);
14485     if (!SWIG_IsOK(ecode2)) {
14486       SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Dataset__GetRasterBand" "', argument " "2"" of type '" "int""'");
14487     }
14488     arg2 = static_cast< int >(val2);
14489     {
14490       CPLErrorReset();
14491       result = (GDALRasterBandShadow *)GDALDatasetShadow_GetRasterBand(arg1,arg2);
14492       CPLErr eclass = CPLGetLastErrorType();
14493       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
14494         do_confess( CPLGetLastErrorMsg(), 0 );
14495 
14496 
14497 
14498 
14499 
14500       }
14501 
14502 
14503       /*
14504           Make warnings regular Perl warnings. This duplicates the warning
14505           message if DontUseExceptions() is in effect (it is not by default).
14506           */
14507       if ( eclass == CE_Warning ) {
14508         warn( CPLGetLastErrorMsg(), "%s" );
14509       }
14510 
14511 
14512     }
14513     ST(argvi) = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GDALRasterBandShadow, 0 | SWIG_SHADOW); argvi++ ;
14514 
14515 
14516     XSRETURN(argvi);
14517   fail:
14518 
14519 
14520     SWIG_croak_null();
14521   }
14522 }
14523 
14524 
XS(_wrap_Dataset_GetRootGroup)14525 XS(_wrap_Dataset_GetRootGroup) {
14526   {
14527     GDALDatasetShadow *arg1 = (GDALDatasetShadow *) 0 ;
14528     int argvi = 0;
14529     GDALGroupHS *result = 0 ;
14530     dXSARGS;
14531 
14532     if ((items < 1) || (items > 1)) {
14533       SWIG_croak("Usage: Dataset_GetRootGroup(self);");
14534     }
14535     {
14536       /* %typemap(in) (GDALDatasetShadow *) */
14537       void *argp = 0;
14538       int res = SWIG_ConvertPtr(ST(0), &argp, SWIGTYPE_p_GDALDatasetShadow, 0 |  0 );
14539       if (!SWIG_IsOK(res)) {
14540         do_confess(WRONG_CLASS, 1);
14541       }
14542       arg1 = reinterpret_cast< GDALDatasetShadow * >(argp);
14543       if (arg1 == NULL)
14544       do_confess(NEED_DEF, 1);
14545     }
14546     {
14547       CPLErrorReset();
14548       result = (GDALGroupHS *)GDALDatasetShadow_GetRootGroup(arg1);
14549       CPLErr eclass = CPLGetLastErrorType();
14550       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
14551         do_confess( CPLGetLastErrorMsg(), 0 );
14552 
14553 
14554 
14555 
14556 
14557       }
14558 
14559 
14560       /*
14561           Make warnings regular Perl warnings. This duplicates the warning
14562           message if DontUseExceptions() is in effect (it is not by default).
14563           */
14564       if ( eclass == CE_Warning ) {
14565         warn( CPLGetLastErrorMsg(), "%s" );
14566       }
14567 
14568 
14569     }
14570     ST(argvi) = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GDALGroupHS, SWIG_OWNER | SWIG_SHADOW); argvi++ ;
14571 
14572     XSRETURN(argvi);
14573   fail:
14574 
14575     SWIG_croak_null();
14576   }
14577 }
14578 
14579 
XS(_wrap_Dataset_GetProjection)14580 XS(_wrap_Dataset_GetProjection) {
14581   {
14582     GDALDatasetShadow *arg1 = (GDALDatasetShadow *) 0 ;
14583     int argvi = 0;
14584     char *result = 0 ;
14585     dXSARGS;
14586 
14587     if ((items < 1) || (items > 1)) {
14588       SWIG_croak("Usage: Dataset_GetProjection(self);");
14589     }
14590     {
14591       /* %typemap(in) (GDALDatasetShadow *) */
14592       void *argp = 0;
14593       int res = SWIG_ConvertPtr(ST(0), &argp, SWIGTYPE_p_GDALDatasetShadow, 0 |  0 );
14594       if (!SWIG_IsOK(res)) {
14595         do_confess(WRONG_CLASS, 1);
14596       }
14597       arg1 = reinterpret_cast< GDALDatasetShadow * >(argp);
14598       if (arg1 == NULL)
14599       do_confess(NEED_DEF, 1);
14600     }
14601     {
14602       CPLErrorReset();
14603       result = (char *)GDALDatasetShadow_GetProjection(arg1);
14604       CPLErr eclass = CPLGetLastErrorType();
14605       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
14606         do_confess( CPLGetLastErrorMsg(), 0 );
14607 
14608 
14609 
14610 
14611 
14612       }
14613 
14614 
14615       /*
14616           Make warnings regular Perl warnings. This duplicates the warning
14617           message if DontUseExceptions() is in effect (it is not by default).
14618           */
14619       if ( eclass == CE_Warning ) {
14620         warn( CPLGetLastErrorMsg(), "%s" );
14621       }
14622 
14623 
14624     }
14625     {
14626       /* %typemap(out) const char * */
14627       ST(argvi) = newSVpv(result, 0);
14628       SvUTF8_on(ST(argvi)); /* expecting GDAL to give us UTF-8 */
14629       sv_2mortal(ST(argvi));
14630       argvi++;
14631     }
14632 
14633     XSRETURN(argvi);
14634   fail:
14635 
14636     SWIG_croak_null();
14637   }
14638 }
14639 
14640 
XS(_wrap_Dataset_GetProjectionRef)14641 XS(_wrap_Dataset_GetProjectionRef) {
14642   {
14643     GDALDatasetShadow *arg1 = (GDALDatasetShadow *) 0 ;
14644     int argvi = 0;
14645     char *result = 0 ;
14646     dXSARGS;
14647 
14648     if ((items < 1) || (items > 1)) {
14649       SWIG_croak("Usage: Dataset_GetProjectionRef(self);");
14650     }
14651     {
14652       /* %typemap(in) (GDALDatasetShadow *) */
14653       void *argp = 0;
14654       int res = SWIG_ConvertPtr(ST(0), &argp, SWIGTYPE_p_GDALDatasetShadow, 0 |  0 );
14655       if (!SWIG_IsOK(res)) {
14656         do_confess(WRONG_CLASS, 1);
14657       }
14658       arg1 = reinterpret_cast< GDALDatasetShadow * >(argp);
14659       if (arg1 == NULL)
14660       do_confess(NEED_DEF, 1);
14661     }
14662     {
14663       CPLErrorReset();
14664       result = (char *)GDALDatasetShadow_GetProjectionRef(arg1);
14665       CPLErr eclass = CPLGetLastErrorType();
14666       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
14667         do_confess( CPLGetLastErrorMsg(), 0 );
14668 
14669 
14670 
14671 
14672 
14673       }
14674 
14675 
14676       /*
14677           Make warnings regular Perl warnings. This duplicates the warning
14678           message if DontUseExceptions() is in effect (it is not by default).
14679           */
14680       if ( eclass == CE_Warning ) {
14681         warn( CPLGetLastErrorMsg(), "%s" );
14682       }
14683 
14684 
14685     }
14686     {
14687       /* %typemap(out) const char * */
14688       ST(argvi) = newSVpv(result, 0);
14689       SvUTF8_on(ST(argvi)); /* expecting GDAL to give us UTF-8 */
14690       sv_2mortal(ST(argvi));
14691       argvi++;
14692     }
14693 
14694     XSRETURN(argvi);
14695   fail:
14696 
14697     SWIG_croak_null();
14698   }
14699 }
14700 
14701 
XS(_wrap_Dataset_GetSpatialRef)14702 XS(_wrap_Dataset_GetSpatialRef) {
14703   {
14704     GDALDatasetShadow *arg1 = (GDALDatasetShadow *) 0 ;
14705     int argvi = 0;
14706     OSRSpatialReferenceShadow *result = 0 ;
14707     dXSARGS;
14708 
14709     if ((items < 1) || (items > 1)) {
14710       SWIG_croak("Usage: Dataset_GetSpatialRef(self);");
14711     }
14712     {
14713       /* %typemap(in) (GDALDatasetShadow *) */
14714       void *argp = 0;
14715       int res = SWIG_ConvertPtr(ST(0), &argp, SWIGTYPE_p_GDALDatasetShadow, 0 |  0 );
14716       if (!SWIG_IsOK(res)) {
14717         do_confess(WRONG_CLASS, 1);
14718       }
14719       arg1 = reinterpret_cast< GDALDatasetShadow * >(argp);
14720       if (arg1 == NULL)
14721       do_confess(NEED_DEF, 1);
14722     }
14723     {
14724       CPLErrorReset();
14725       result = (OSRSpatialReferenceShadow *)GDALDatasetShadow_GetSpatialRef(arg1);
14726       CPLErr eclass = CPLGetLastErrorType();
14727       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
14728         do_confess( CPLGetLastErrorMsg(), 0 );
14729 
14730 
14731 
14732 
14733 
14734       }
14735 
14736 
14737       /*
14738           Make warnings regular Perl warnings. This duplicates the warning
14739           message if DontUseExceptions() is in effect (it is not by default).
14740           */
14741       if ( eclass == CE_Warning ) {
14742         warn( CPLGetLastErrorMsg(), "%s" );
14743       }
14744 
14745 
14746     }
14747     ST(argvi) = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_OSRSpatialReferenceShadow, SWIG_OWNER | SWIG_SHADOW); argvi++ ;
14748 
14749     XSRETURN(argvi);
14750   fail:
14751 
14752     SWIG_croak_null();
14753   }
14754 }
14755 
14756 
XS(_wrap_Dataset_SetProjection)14757 XS(_wrap_Dataset_SetProjection) {
14758   {
14759     GDALDatasetShadow *arg1 = (GDALDatasetShadow *) 0 ;
14760     char *arg2 = (char *) 0 ;
14761     int res2 ;
14762     char *buf2 = 0 ;
14763     int alloc2 = 0 ;
14764     int argvi = 0;
14765     CPLErr result;
14766     dXSARGS;
14767 
14768     if ((items < 2) || (items > 2)) {
14769       SWIG_croak("Usage: Dataset_SetProjection(self,prj);");
14770     }
14771     {
14772       /* %typemap(in) (GDALDatasetShadow *) */
14773       void *argp = 0;
14774       int res = SWIG_ConvertPtr(ST(0), &argp, SWIGTYPE_p_GDALDatasetShadow, 0 |  0 );
14775       if (!SWIG_IsOK(res)) {
14776         do_confess(WRONG_CLASS, 1);
14777       }
14778       arg1 = reinterpret_cast< GDALDatasetShadow * >(argp);
14779       if (arg1 == NULL)
14780       do_confess(NEED_DEF, 1);
14781     }
14782     res2 = SWIG_AsCharPtrAndSize(ST(1), &buf2, NULL, &alloc2);
14783     if (!SWIG_IsOK(res2)) {
14784       SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Dataset_SetProjection" "', argument " "2"" of type '" "char const *""'");
14785     }
14786     arg2 = reinterpret_cast< char * >(buf2);
14787     {
14788       if (!arg2) {
14789         SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
14790       }
14791     }
14792     {
14793       CPLErrorReset();
14794       result = (CPLErr)GDALDatasetShadow_SetProjection(arg1,(char const *)arg2);
14795       CPLErr eclass = CPLGetLastErrorType();
14796       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
14797         do_confess( CPLGetLastErrorMsg(), 0 );
14798 
14799 
14800 
14801 
14802 
14803       }
14804 
14805 
14806       /*
14807           Make warnings regular Perl warnings. This duplicates the warning
14808           message if DontUseExceptions() is in effect (it is not by default).
14809           */
14810       if ( eclass == CE_Warning ) {
14811         warn( CPLGetLastErrorMsg(), "%s" );
14812       }
14813 
14814 
14815     }
14816     {
14817       /* %typemap(out) CPLErr */
14818     }
14819 
14820     if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
14821     XSRETURN(argvi);
14822   fail:
14823 
14824     if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
14825     SWIG_croak_null();
14826   }
14827 }
14828 
14829 
XS(_wrap_Dataset_SetSpatialRef)14830 XS(_wrap_Dataset_SetSpatialRef) {
14831   {
14832     GDALDatasetShadow *arg1 = (GDALDatasetShadow *) 0 ;
14833     OSRSpatialReferenceShadow *arg2 = (OSRSpatialReferenceShadow *) 0 ;
14834     void *argp2 = 0 ;
14835     int res2 = 0 ;
14836     int argvi = 0;
14837     CPLErr result;
14838     dXSARGS;
14839 
14840     if ((items < 2) || (items > 2)) {
14841       SWIG_croak("Usage: Dataset_SetSpatialRef(self,srs);");
14842     }
14843     {
14844       /* %typemap(in) (GDALDatasetShadow *) */
14845       void *argp = 0;
14846       int res = SWIG_ConvertPtr(ST(0), &argp, SWIGTYPE_p_GDALDatasetShadow, 0 |  0 );
14847       if (!SWIG_IsOK(res)) {
14848         do_confess(WRONG_CLASS, 1);
14849       }
14850       arg1 = reinterpret_cast< GDALDatasetShadow * >(argp);
14851       if (arg1 == NULL)
14852       do_confess(NEED_DEF, 1);
14853     }
14854     res2 = SWIG_ConvertPtr(ST(1), &argp2,SWIGTYPE_p_OSRSpatialReferenceShadow, 0 |  0 );
14855     if (!SWIG_IsOK(res2)) {
14856       SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Dataset_SetSpatialRef" "', argument " "2"" of type '" "OSRSpatialReferenceShadow *""'");
14857     }
14858     arg2 = reinterpret_cast< OSRSpatialReferenceShadow * >(argp2);
14859     {
14860       CPLErrorReset();
14861       result = (CPLErr)GDALDatasetShadow_SetSpatialRef(arg1,arg2);
14862       CPLErr eclass = CPLGetLastErrorType();
14863       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
14864         do_confess( CPLGetLastErrorMsg(), 0 );
14865 
14866 
14867 
14868 
14869 
14870       }
14871 
14872 
14873       /*
14874           Make warnings regular Perl warnings. This duplicates the warning
14875           message if DontUseExceptions() is in effect (it is not by default).
14876           */
14877       if ( eclass == CE_Warning ) {
14878         warn( CPLGetLastErrorMsg(), "%s" );
14879       }
14880 
14881 
14882     }
14883     {
14884       /* %typemap(out) CPLErr */
14885     }
14886 
14887 
14888     XSRETURN(argvi);
14889   fail:
14890 
14891 
14892     SWIG_croak_null();
14893   }
14894 }
14895 
14896 
XS(_wrap_Dataset_GetGeoTransform)14897 XS(_wrap_Dataset_GetGeoTransform) {
14898   {
14899     GDALDatasetShadow *arg1 = (GDALDatasetShadow *) 0 ;
14900     double *arg2 ;
14901     double argout2[6] ;
14902     int argvi = 0;
14903     dXSARGS;
14904 
14905     {
14906       /* %typemap(in,numinputs=0) (double argout2[ANY]) */
14907       arg2 = argout2;
14908     }
14909     if ((items < 1) || (items > 1)) {
14910       SWIG_croak("Usage: Dataset_GetGeoTransform(self);");
14911     }
14912     {
14913       /* %typemap(in) (GDALDatasetShadow *) */
14914       void *argp = 0;
14915       int res = SWIG_ConvertPtr(ST(0), &argp, SWIGTYPE_p_GDALDatasetShadow, 0 |  0 );
14916       if (!SWIG_IsOK(res)) {
14917         do_confess(WRONG_CLASS, 1);
14918       }
14919       arg1 = reinterpret_cast< GDALDatasetShadow * >(argp);
14920       if (arg1 == NULL)
14921       do_confess(NEED_DEF, 1);
14922     }
14923     {
14924       CPLErrorReset();
14925       GDALDatasetShadow_GetGeoTransform(arg1,arg2);
14926       CPLErr eclass = CPLGetLastErrorType();
14927       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
14928         do_confess( CPLGetLastErrorMsg(), 0 );
14929 
14930 
14931 
14932 
14933 
14934       }
14935 
14936 
14937       /*
14938           Make warnings regular Perl warnings. This duplicates the warning
14939           message if DontUseExceptions() is in effect (it is not by default).
14940           */
14941       if ( eclass == CE_Warning ) {
14942         warn( CPLGetLastErrorMsg(), "%s" );
14943       }
14944 
14945 
14946     }
14947     {
14948       /* %typemap(out) void */
14949     }
14950     {
14951       /* %typemap(argout) (double argout[ANY]) */
14952       if (GIMME_V == G_ARRAY) {
14953         /* return a list */
14954         int i;
14955         EXTEND(SP, argvi+6-items+1);
14956         for (i = 0; i < 6; i++)
14957         ST(argvi++) = sv_2mortal(newSVnv(arg2[i]));
14958       } else {
14959         ST(argvi) = CreateArrayFromDoubleArray( arg2, 6 );
14960         argvi++;
14961       }
14962     }
14963 
14964 
14965     XSRETURN(argvi);
14966   fail:
14967 
14968 
14969     SWIG_croak_null();
14970   }
14971 }
14972 
14973 
XS(_wrap_Dataset_SetGeoTransform)14974 XS(_wrap_Dataset_SetGeoTransform) {
14975   {
14976     GDALDatasetShadow *arg1 = (GDALDatasetShadow *) 0 ;
14977     double *arg2 ;
14978     double argin2[6] ;
14979     int argvi = 0;
14980     CPLErr result;
14981     dXSARGS;
14982 
14983     if ((items < 2) || (items > 2)) {
14984       SWIG_croak("Usage: Dataset_SetGeoTransform(self,argin);");
14985     }
14986     {
14987       /* %typemap(in) (GDALDatasetShadow *) */
14988       void *argp = 0;
14989       int res = SWIG_ConvertPtr(ST(0), &argp, SWIGTYPE_p_GDALDatasetShadow, 0 |  0 );
14990       if (!SWIG_IsOK(res)) {
14991         do_confess(WRONG_CLASS, 1);
14992       }
14993       arg1 = reinterpret_cast< GDALDatasetShadow * >(argp);
14994       if (arg1 == NULL)
14995       do_confess(NEED_DEF, 1);
14996     }
14997     {
14998       /* %typemap(in) (double argin2[ANY]) */
14999       if (!(SvROK(ST(1)) && (SvTYPE(SvRV(ST(1)))==SVt_PVAV)))
15000       do_confess(NEED_ARRAY_REF, 1);
15001       arg2 = argin2;
15002       AV *av = (AV*)(SvRV(ST(1)));
15003       if (av_len(av)+1 < 6)
15004       do_confess(NOT_ENOUGH_ELEMENTS, 1);
15005       for (unsigned int i=0; i<6; i++) {
15006         SV *sv = *av_fetch(av, i, 0);
15007         if (!SvOK(sv))
15008         do_confess(NEED_DEF, 1);
15009         arg2[i] =  SvNV(sv);
15010       }
15011     }
15012     {
15013       CPLErrorReset();
15014       result = (CPLErr)GDALDatasetShadow_SetGeoTransform(arg1,arg2);
15015       CPLErr eclass = CPLGetLastErrorType();
15016       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
15017         do_confess( CPLGetLastErrorMsg(), 0 );
15018 
15019 
15020 
15021 
15022 
15023       }
15024 
15025 
15026       /*
15027           Make warnings regular Perl warnings. This duplicates the warning
15028           message if DontUseExceptions() is in effect (it is not by default).
15029           */
15030       if ( eclass == CE_Warning ) {
15031         warn( CPLGetLastErrorMsg(), "%s" );
15032       }
15033 
15034 
15035     }
15036     {
15037       /* %typemap(out) CPLErr */
15038     }
15039 
15040 
15041     XSRETURN(argvi);
15042   fail:
15043 
15044 
15045     SWIG_croak_null();
15046   }
15047 }
15048 
15049 
XS(_wrap_Dataset__BuildOverviews)15050 XS(_wrap_Dataset__BuildOverviews) {
15051   {
15052     GDALDatasetShadow *arg1 = (GDALDatasetShadow *) 0 ;
15053     char *arg2 = (char *) "NEAREST" ;
15054     int arg3 = (int) 0 ;
15055     int *arg4 = (int *) 0 ;
15056     GDALProgressFunc arg5 = (GDALProgressFunc) NULL ;
15057     void *arg6 = (void *) NULL ;
15058     int res2 ;
15059     char *buf2 = 0 ;
15060     int alloc2 = 0 ;
15061     int argvi = 0;
15062     int result;
15063     dXSARGS;
15064 
15065     /* %typemap(arginit, noblock=1) ( void* callback_data = NULL) */
15066     SavedEnv saved_env;
15067     saved_env.fct = NULL;
15068     saved_env.data = &PL_sv_undef;
15069     arg6 = (void *)(&saved_env);
15070     if ((items < 1) || (items > 5)) {
15071       SWIG_croak("Usage: Dataset__BuildOverviews(self,resampling,overviewlist,pOverviews,callback,callback_data);");
15072     }
15073     {
15074       /* %typemap(in) (GDALDatasetShadow *) */
15075       void *argp = 0;
15076       int res = SWIG_ConvertPtr(ST(0), &argp, SWIGTYPE_p_GDALDatasetShadow, 0 |  0 );
15077       if (!SWIG_IsOK(res)) {
15078         do_confess(WRONG_CLASS, 1);
15079       }
15080       arg1 = reinterpret_cast< GDALDatasetShadow * >(argp);
15081       if (arg1 == NULL)
15082       do_confess(NEED_DEF, 1);
15083     }
15084     if (items > 1) {
15085       res2 = SWIG_AsCharPtrAndSize(ST(1), &buf2, NULL, &alloc2);
15086       if (!SWIG_IsOK(res2)) {
15087         SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Dataset__BuildOverviews" "', argument " "2"" of type '" "char const *""'");
15088       }
15089       arg2 = reinterpret_cast< char * >(buf2);
15090     }
15091     if (items > 2) {
15092       {
15093         /* %typemap(in,numinputs=1) (int nList, int* pList) */
15094         if (!(SvROK(ST(2)) && (SvTYPE(SvRV(ST(2)))==SVt_PVAV)))
15095         do_confess(NEED_ARRAY_REF, 1);
15096         AV *av = (AV*)(SvRV(ST(2)));
15097         arg3 = av_len(av)+1;
15098         arg4 = (int*)CPLMalloc(arg3*sizeof(int));
15099         if (arg4) {
15100           for( int i = 0; i<arg3; i++ ) {
15101             SV **sv = av_fetch(av, i, 0);
15102             arg4[i] =  SvIV(*sv);
15103           }
15104         } else
15105         SWIG_fail;
15106       }
15107     }
15108     if (items > 3) {
15109       {
15110         /* %typemap(in) (GDALProgressFunc callback = NULL) */
15111         if (SvOK(ST(3))) {
15112           if (SvROK(ST(3))) {
15113             if (SvTYPE(SvRV(ST(3))) != SVt_PVCV) {
15114               do_confess(NEED_CODE_REF, 1);
15115             } else {
15116               saved_env.fct = (SV *)ST(3);
15117               arg5 = &callback_d_cp_vp;
15118             }
15119           } else {
15120             do_confess(NEED_CODE_REF, 1);
15121           }
15122         }
15123       }
15124     }
15125     if (items > 4) {
15126       {
15127         /* %typemap(in) (void* callback_data=NULL) */
15128         if (SvOK(ST(4)))
15129         saved_env.data = (SV *)ST(4);
15130       }
15131     }
15132     {
15133       CPLErrorReset();
15134       result = (int)GDALDatasetShadow_BuildOverviews(arg1,(char const *)arg2,arg3,arg4,arg5,arg6);
15135       CPLErr eclass = CPLGetLastErrorType();
15136       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
15137         do_confess( CPLGetLastErrorMsg(), 0 );
15138 
15139 
15140 
15141 
15142 
15143       }
15144 
15145 
15146       /*
15147           Make warnings regular Perl warnings. This duplicates the warning
15148           message if DontUseExceptions() is in effect (it is not by default).
15149           */
15150       if ( eclass == CE_Warning ) {
15151         warn( CPLGetLastErrorMsg(), "%s" );
15152       }
15153 
15154 
15155     }
15156     ST(argvi) = SWIG_From_int  SWIG_PERL_CALL_ARGS_1(static_cast< int >(result)); argvi++ ;
15157 
15158     if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
15159     {
15160       /* %typemap(freearg) (int nList, int* pList) */
15161       CPLFree((void*) arg4);
15162     }
15163 
15164     XSRETURN(argvi);
15165   fail:
15166 
15167     if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
15168     {
15169       /* %typemap(freearg) (int nList, int* pList) */
15170       CPLFree((void*) arg4);
15171     }
15172 
15173     SWIG_croak_null();
15174   }
15175 }
15176 
15177 
XS(_wrap_Dataset_GetGCPCount)15178 XS(_wrap_Dataset_GetGCPCount) {
15179   {
15180     GDALDatasetShadow *arg1 = (GDALDatasetShadow *) 0 ;
15181     int argvi = 0;
15182     int result;
15183     dXSARGS;
15184 
15185     if ((items < 1) || (items > 1)) {
15186       SWIG_croak("Usage: Dataset_GetGCPCount(self);");
15187     }
15188     {
15189       /* %typemap(in) (GDALDatasetShadow *) */
15190       void *argp = 0;
15191       int res = SWIG_ConvertPtr(ST(0), &argp, SWIGTYPE_p_GDALDatasetShadow, 0 |  0 );
15192       if (!SWIG_IsOK(res)) {
15193         do_confess(WRONG_CLASS, 1);
15194       }
15195       arg1 = reinterpret_cast< GDALDatasetShadow * >(argp);
15196       if (arg1 == NULL)
15197       do_confess(NEED_DEF, 1);
15198     }
15199     {
15200       CPLErrorReset();
15201       result = (int)GDALDatasetShadow_GetGCPCount(arg1);
15202       CPLErr eclass = CPLGetLastErrorType();
15203       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
15204         do_confess( CPLGetLastErrorMsg(), 0 );
15205 
15206 
15207 
15208 
15209 
15210       }
15211 
15212 
15213       /*
15214           Make warnings regular Perl warnings. This duplicates the warning
15215           message if DontUseExceptions() is in effect (it is not by default).
15216           */
15217       if ( eclass == CE_Warning ) {
15218         warn( CPLGetLastErrorMsg(), "%s" );
15219       }
15220 
15221 
15222     }
15223     ST(argvi) = SWIG_From_int  SWIG_PERL_CALL_ARGS_1(static_cast< int >(result)); argvi++ ;
15224 
15225     XSRETURN(argvi);
15226   fail:
15227 
15228     SWIG_croak_null();
15229   }
15230 }
15231 
15232 
XS(_wrap_Dataset_GetGCPProjection)15233 XS(_wrap_Dataset_GetGCPProjection) {
15234   {
15235     GDALDatasetShadow *arg1 = (GDALDatasetShadow *) 0 ;
15236     int argvi = 0;
15237     char *result = 0 ;
15238     dXSARGS;
15239 
15240     if ((items < 1) || (items > 1)) {
15241       SWIG_croak("Usage: Dataset_GetGCPProjection(self);");
15242     }
15243     {
15244       /* %typemap(in) (GDALDatasetShadow *) */
15245       void *argp = 0;
15246       int res = SWIG_ConvertPtr(ST(0), &argp, SWIGTYPE_p_GDALDatasetShadow, 0 |  0 );
15247       if (!SWIG_IsOK(res)) {
15248         do_confess(WRONG_CLASS, 1);
15249       }
15250       arg1 = reinterpret_cast< GDALDatasetShadow * >(argp);
15251       if (arg1 == NULL)
15252       do_confess(NEED_DEF, 1);
15253     }
15254     {
15255       CPLErrorReset();
15256       result = (char *)GDALDatasetShadow_GetGCPProjection(arg1);
15257       CPLErr eclass = CPLGetLastErrorType();
15258       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
15259         do_confess( CPLGetLastErrorMsg(), 0 );
15260 
15261 
15262 
15263 
15264 
15265       }
15266 
15267 
15268       /*
15269           Make warnings regular Perl warnings. This duplicates the warning
15270           message if DontUseExceptions() is in effect (it is not by default).
15271           */
15272       if ( eclass == CE_Warning ) {
15273         warn( CPLGetLastErrorMsg(), "%s" );
15274       }
15275 
15276 
15277     }
15278     {
15279       /* %typemap(out) const char * */
15280       ST(argvi) = newSVpv(result, 0);
15281       SvUTF8_on(ST(argvi)); /* expecting GDAL to give us UTF-8 */
15282       sv_2mortal(ST(argvi));
15283       argvi++;
15284     }
15285 
15286     XSRETURN(argvi);
15287   fail:
15288 
15289     SWIG_croak_null();
15290   }
15291 }
15292 
15293 
XS(_wrap_Dataset_GetGCPSpatialRef)15294 XS(_wrap_Dataset_GetGCPSpatialRef) {
15295   {
15296     GDALDatasetShadow *arg1 = (GDALDatasetShadow *) 0 ;
15297     int argvi = 0;
15298     OSRSpatialReferenceShadow *result = 0 ;
15299     dXSARGS;
15300 
15301     if ((items < 1) || (items > 1)) {
15302       SWIG_croak("Usage: Dataset_GetGCPSpatialRef(self);");
15303     }
15304     {
15305       /* %typemap(in) (GDALDatasetShadow *) */
15306       void *argp = 0;
15307       int res = SWIG_ConvertPtr(ST(0), &argp, SWIGTYPE_p_GDALDatasetShadow, 0 |  0 );
15308       if (!SWIG_IsOK(res)) {
15309         do_confess(WRONG_CLASS, 1);
15310       }
15311       arg1 = reinterpret_cast< GDALDatasetShadow * >(argp);
15312       if (arg1 == NULL)
15313       do_confess(NEED_DEF, 1);
15314     }
15315     {
15316       CPLErrorReset();
15317       result = (OSRSpatialReferenceShadow *)GDALDatasetShadow_GetGCPSpatialRef(arg1);
15318       CPLErr eclass = CPLGetLastErrorType();
15319       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
15320         do_confess( CPLGetLastErrorMsg(), 0 );
15321 
15322 
15323 
15324 
15325 
15326       }
15327 
15328 
15329       /*
15330           Make warnings regular Perl warnings. This duplicates the warning
15331           message if DontUseExceptions() is in effect (it is not by default).
15332           */
15333       if ( eclass == CE_Warning ) {
15334         warn( CPLGetLastErrorMsg(), "%s" );
15335       }
15336 
15337 
15338     }
15339     ST(argvi) = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_OSRSpatialReferenceShadow, SWIG_OWNER | SWIG_SHADOW); argvi++ ;
15340 
15341     XSRETURN(argvi);
15342   fail:
15343 
15344     SWIG_croak_null();
15345   }
15346 }
15347 
15348 
XS(_wrap_Dataset_GetGCPs)15349 XS(_wrap_Dataset_GetGCPs) {
15350   {
15351     GDALDatasetShadow *arg1 = (GDALDatasetShadow *) 0 ;
15352     int *arg2 = (int *) 0 ;
15353     GDAL_GCP **arg3 = (GDAL_GCP **) 0 ;
15354     int nGCPs2 = 0 ;
15355     GDAL_GCP *pGCPs2 = 0 ;
15356     int argvi = 0;
15357     dXSARGS;
15358 
15359     {
15360       /* %typemap(in,numinputs=0) (int *nGCPs2, GDAL_GCP const **pGCPs2 ) */
15361       arg2 = &nGCPs2;
15362       arg3 = &pGCPs2;
15363     }
15364     if ((items < 1) || (items > 1)) {
15365       SWIG_croak("Usage: Dataset_GetGCPs(self,pGCPs);");
15366     }
15367     {
15368       /* %typemap(in) (GDALDatasetShadow *) */
15369       void *argp = 0;
15370       int res = SWIG_ConvertPtr(ST(0), &argp, SWIGTYPE_p_GDALDatasetShadow, 0 |  0 );
15371       if (!SWIG_IsOK(res)) {
15372         do_confess(WRONG_CLASS, 1);
15373       }
15374       arg1 = reinterpret_cast< GDALDatasetShadow * >(argp);
15375       if (arg1 == NULL)
15376       do_confess(NEED_DEF, 1);
15377     }
15378     {
15379       CPLErrorReset();
15380       GDALDatasetShadow_GetGCPs(arg1,arg2,(GDAL_GCP const **)arg3);
15381       CPLErr eclass = CPLGetLastErrorType();
15382       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
15383         do_confess( CPLGetLastErrorMsg(), 0 );
15384 
15385 
15386 
15387 
15388 
15389       }
15390 
15391 
15392       /*
15393           Make warnings regular Perl warnings. This duplicates the warning
15394           message if DontUseExceptions() is in effect (it is not by default).
15395           */
15396       if ( eclass == CE_Warning ) {
15397         warn( CPLGetLastErrorMsg(), "%s" );
15398       }
15399 
15400 
15401     }
15402     {
15403       /* %typemap(out) void */
15404     }
15405     {
15406       /* %typemap(argout) (int *nGCPs, GDAL_GCP const **pGCPs ) */
15407       AV *dict = (AV*)sv_2mortal((SV*)newAV());
15408       for( int i = 0; i < *arg2; i++ ) {
15409         GDAL_GCP *o = new_GDAL_GCP( (*arg3)[i].dfGCPX,
15410           (*arg3)[i].dfGCPY,
15411           (*arg3)[i].dfGCPZ,
15412           (*arg3)[i].dfGCPPixel,
15413           (*arg3)[i].dfGCPLine,
15414           (*arg3)[i].pszInfo,
15415           (*arg3)[i].pszId );
15416         SV *sv = newSV(0);
15417         SWIG_MakePtr( sv, (void*)o, SWIGTYPE_p_GDAL_GCP, SWIG_SHADOW|SWIG_OWNER);
15418         av_store(dict, i, sv);
15419       }
15420       ST(argvi) = sv_2mortal(newRV((SV*)dict));
15421       argvi++;
15422     }
15423 
15424     XSRETURN(argvi);
15425   fail:
15426 
15427     SWIG_croak_null();
15428   }
15429 }
15430 
15431 
XS(_wrap_Dataset_SetGCPs)15432 XS(_wrap_Dataset_SetGCPs) {
15433   {
15434     GDALDatasetShadow *arg1 = (GDALDatasetShadow *) 0 ;
15435     int arg2 ;
15436     GDAL_GCP *arg3 = (GDAL_GCP *) 0 ;
15437     char *arg4 = (char *) 0 ;
15438     int res4 ;
15439     char *buf4 = 0 ;
15440     int alloc4 = 0 ;
15441     int argvi = 0;
15442     CPLErr result;
15443     dXSARGS;
15444 
15445     if ((items < 3) || (items > 3)) {
15446       SWIG_croak("Usage: Dataset_SetGCPs(self,nGCPs,pGCPs,pszGCPProjection);");
15447     }
15448     {
15449       /* %typemap(in) (GDALDatasetShadow *) */
15450       void *argp = 0;
15451       int res = SWIG_ConvertPtr(ST(0), &argp, SWIGTYPE_p_GDALDatasetShadow, 0 |  0 );
15452       if (!SWIG_IsOK(res)) {
15453         do_confess(WRONG_CLASS, 1);
15454       }
15455       arg1 = reinterpret_cast< GDALDatasetShadow * >(argp);
15456       if (arg1 == NULL)
15457       do_confess(NEED_DEF, 1);
15458     }
15459     {
15460       /* %typemap(in,numinputs=1) (int nGCPs, GDAL_GCP const *pGCPs ) */
15461       if (!(SvROK(ST(1)) && (SvTYPE(SvRV(ST(1)))==SVt_PVAV)))
15462       do_confess(NEED_ARRAY_REF, 1);
15463       AV *av = (AV*)(SvRV(ST(1)));
15464       arg2 = av_len(av)+1;
15465       arg3 = (GDAL_GCP *)CPLMalloc(arg2*sizeof(GDAL_GCP));
15466       if (arg3) {
15467         for (int i = 0; i < arg2; i++ ) {
15468           SV **sv = av_fetch(av, i, 0);
15469           GDAL_GCP *gcp;
15470           int ret = SWIG_ConvertPtr(*sv, (void**)&gcp, SWIGTYPE_p_GDAL_GCP, 0);
15471           if (!SWIG_IsOK(ret))
15472           do_confess(WRONG_ITEM_IN_ARRAY, 1);
15473           arg3[i] = *gcp;
15474         }
15475       } else
15476       do_confess(OUT_OF_MEMORY, 1);
15477     }
15478     res4 = SWIG_AsCharPtrAndSize(ST(2), &buf4, NULL, &alloc4);
15479     if (!SWIG_IsOK(res4)) {
15480       SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "Dataset_SetGCPs" "', argument " "4"" of type '" "char const *""'");
15481     }
15482     arg4 = reinterpret_cast< char * >(buf4);
15483     {
15484       CPLErrorReset();
15485       result = (CPLErr)GDALDatasetShadow_SetGCPs(arg1,arg2,(GDAL_GCP const *)arg3,(char const *)arg4);
15486       CPLErr eclass = CPLGetLastErrorType();
15487       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
15488         do_confess( CPLGetLastErrorMsg(), 0 );
15489 
15490 
15491 
15492 
15493 
15494       }
15495 
15496 
15497       /*
15498           Make warnings regular Perl warnings. This duplicates the warning
15499           message if DontUseExceptions() is in effect (it is not by default).
15500           */
15501       if ( eclass == CE_Warning ) {
15502         warn( CPLGetLastErrorMsg(), "%s" );
15503       }
15504 
15505 
15506     }
15507     {
15508       /* %typemap(out) CPLErr */
15509     }
15510 
15511     {
15512       /* %typemap(freearg) (int nGCPs, GDAL_GCP const *pGCPs ) */
15513       CPLFree(arg3);
15514     }
15515     if (alloc4 == SWIG_NEWOBJ) delete[] buf4;
15516     XSRETURN(argvi);
15517   fail:
15518 
15519     {
15520       /* %typemap(freearg) (int nGCPs, GDAL_GCP const *pGCPs ) */
15521       CPLFree(arg3);
15522     }
15523     if (alloc4 == SWIG_NEWOBJ) delete[] buf4;
15524     SWIG_croak_null();
15525   }
15526 }
15527 
15528 
XS(_wrap_Dataset_SetGCPs2)15529 XS(_wrap_Dataset_SetGCPs2) {
15530   {
15531     GDALDatasetShadow *arg1 = (GDALDatasetShadow *) 0 ;
15532     int arg2 ;
15533     GDAL_GCP *arg3 = (GDAL_GCP *) 0 ;
15534     OSRSpatialReferenceShadow *arg4 = (OSRSpatialReferenceShadow *) 0 ;
15535     void *argp4 = 0 ;
15536     int res4 = 0 ;
15537     int argvi = 0;
15538     CPLErr result;
15539     dXSARGS;
15540 
15541     if ((items < 3) || (items > 3)) {
15542       SWIG_croak("Usage: Dataset_SetGCPs2(self,nGCPs,pGCPs,hSRS);");
15543     }
15544     {
15545       /* %typemap(in) (GDALDatasetShadow *) */
15546       void *argp = 0;
15547       int res = SWIG_ConvertPtr(ST(0), &argp, SWIGTYPE_p_GDALDatasetShadow, 0 |  0 );
15548       if (!SWIG_IsOK(res)) {
15549         do_confess(WRONG_CLASS, 1);
15550       }
15551       arg1 = reinterpret_cast< GDALDatasetShadow * >(argp);
15552       if (arg1 == NULL)
15553       do_confess(NEED_DEF, 1);
15554     }
15555     {
15556       /* %typemap(in,numinputs=1) (int nGCPs, GDAL_GCP const *pGCPs ) */
15557       if (!(SvROK(ST(1)) && (SvTYPE(SvRV(ST(1)))==SVt_PVAV)))
15558       do_confess(NEED_ARRAY_REF, 1);
15559       AV *av = (AV*)(SvRV(ST(1)));
15560       arg2 = av_len(av)+1;
15561       arg3 = (GDAL_GCP *)CPLMalloc(arg2*sizeof(GDAL_GCP));
15562       if (arg3) {
15563         for (int i = 0; i < arg2; i++ ) {
15564           SV **sv = av_fetch(av, i, 0);
15565           GDAL_GCP *gcp;
15566           int ret = SWIG_ConvertPtr(*sv, (void**)&gcp, SWIGTYPE_p_GDAL_GCP, 0);
15567           if (!SWIG_IsOK(ret))
15568           do_confess(WRONG_ITEM_IN_ARRAY, 1);
15569           arg3[i] = *gcp;
15570         }
15571       } else
15572       do_confess(OUT_OF_MEMORY, 1);
15573     }
15574     res4 = SWIG_ConvertPtr(ST(2), &argp4,SWIGTYPE_p_OSRSpatialReferenceShadow, 0 |  0 );
15575     if (!SWIG_IsOK(res4)) {
15576       SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "Dataset_SetGCPs2" "', argument " "4"" of type '" "OSRSpatialReferenceShadow *""'");
15577     }
15578     arg4 = reinterpret_cast< OSRSpatialReferenceShadow * >(argp4);
15579     {
15580       CPLErrorReset();
15581       result = (CPLErr)GDALDatasetShadow_SetGCPs2(arg1,arg2,(GDAL_GCP const *)arg3,arg4);
15582       CPLErr eclass = CPLGetLastErrorType();
15583       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
15584         do_confess( CPLGetLastErrorMsg(), 0 );
15585 
15586 
15587 
15588 
15589 
15590       }
15591 
15592 
15593       /*
15594           Make warnings regular Perl warnings. This duplicates the warning
15595           message if DontUseExceptions() is in effect (it is not by default).
15596           */
15597       if ( eclass == CE_Warning ) {
15598         warn( CPLGetLastErrorMsg(), "%s" );
15599       }
15600 
15601 
15602     }
15603     {
15604       /* %typemap(out) CPLErr */
15605     }
15606 
15607     {
15608       /* %typemap(freearg) (int nGCPs, GDAL_GCP const *pGCPs ) */
15609       CPLFree(arg3);
15610     }
15611 
15612     XSRETURN(argvi);
15613   fail:
15614 
15615     {
15616       /* %typemap(freearg) (int nGCPs, GDAL_GCP const *pGCPs ) */
15617       CPLFree(arg3);
15618     }
15619 
15620     SWIG_croak_null();
15621   }
15622 }
15623 
15624 
XS(_wrap_Dataset_FlushCache)15625 XS(_wrap_Dataset_FlushCache) {
15626   {
15627     GDALDatasetShadow *arg1 = (GDALDatasetShadow *) 0 ;
15628     int argvi = 0;
15629     dXSARGS;
15630 
15631     if ((items < 1) || (items > 1)) {
15632       SWIG_croak("Usage: Dataset_FlushCache(self);");
15633     }
15634     {
15635       /* %typemap(in) (GDALDatasetShadow *) */
15636       void *argp = 0;
15637       int res = SWIG_ConvertPtr(ST(0), &argp, SWIGTYPE_p_GDALDatasetShadow, 0 |  0 );
15638       if (!SWIG_IsOK(res)) {
15639         do_confess(WRONG_CLASS, 1);
15640       }
15641       arg1 = reinterpret_cast< GDALDatasetShadow * >(argp);
15642       if (arg1 == NULL)
15643       do_confess(NEED_DEF, 1);
15644     }
15645     {
15646       CPLErrorReset();
15647       GDALDatasetShadow_FlushCache(arg1);
15648       CPLErr eclass = CPLGetLastErrorType();
15649       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
15650         do_confess( CPLGetLastErrorMsg(), 0 );
15651 
15652 
15653 
15654 
15655 
15656       }
15657 
15658 
15659       /*
15660           Make warnings regular Perl warnings. This duplicates the warning
15661           message if DontUseExceptions() is in effect (it is not by default).
15662           */
15663       if ( eclass == CE_Warning ) {
15664         warn( CPLGetLastErrorMsg(), "%s" );
15665       }
15666 
15667 
15668     }
15669     {
15670       /* %typemap(out) void */
15671     }
15672 
15673     XSRETURN(argvi);
15674   fail:
15675 
15676     SWIG_croak_null();
15677   }
15678 }
15679 
15680 
XS(_wrap_Dataset__AddBand)15681 XS(_wrap_Dataset__AddBand) {
15682   {
15683     GDALDatasetShadow *arg1 = (GDALDatasetShadow *) 0 ;
15684     GDALDataType arg2 = (GDALDataType) GDT_Byte ;
15685     char **arg3 = (char **) 0 ;
15686     int val2 ;
15687     int ecode2 = 0 ;
15688     int argvi = 0;
15689     CPLErr result;
15690     dXSARGS;
15691 
15692     if ((items < 1) || (items > 3)) {
15693       SWIG_croak("Usage: Dataset__AddBand(self,datatype,options);");
15694     }
15695     {
15696       /* %typemap(in) (GDALDatasetShadow *) */
15697       void *argp = 0;
15698       int res = SWIG_ConvertPtr(ST(0), &argp, SWIGTYPE_p_GDALDatasetShadow, 0 |  0 );
15699       if (!SWIG_IsOK(res)) {
15700         do_confess(WRONG_CLASS, 1);
15701       }
15702       arg1 = reinterpret_cast< GDALDatasetShadow * >(argp);
15703       if (arg1 == NULL)
15704       do_confess(NEED_DEF, 1);
15705     }
15706     if (items > 1) {
15707       ecode2 = SWIG_AsVal_int SWIG_PERL_CALL_ARGS_2(ST(1), &val2);
15708       if (!SWIG_IsOK(ecode2)) {
15709         SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Dataset__AddBand" "', argument " "2"" of type '" "GDALDataType""'");
15710       }
15711       arg2 = static_cast< GDALDataType >(val2);
15712     }
15713     if (items > 2) {
15714       {
15715         /* %typemap(in) char **options */
15716         if (SvOK(ST(2))) {
15717           if (SvROK(ST(2))) {
15718             if (SvTYPE(SvRV(ST(2)))==SVt_PVAV) {
15719               AV *av = (AV*)(SvRV(ST(2)));
15720               for (int i = 0; i < av_len(av)+1; i++) {
15721                 SV *sv = *(av_fetch(av, i, 0));
15722                 bool sf;
15723                 char *tmp = sv_to_utf8_string(sv, NULL, &sf);
15724                 arg3 = CSLAddString(arg3, tmp);
15725                 if (sf) Safefree(tmp); else free(tmp);
15726               }
15727             } else if (SvTYPE(SvRV(ST(2)))==SVt_PVHV) {
15728               HV *hv = (HV*)SvRV(ST(2));
15729               SV *sv;
15730               char *key;
15731               I32 klen;
15732               arg3 = NULL;
15733               hv_iterinit(hv);
15734               while(sv = hv_iternextsv(hv, &key, &klen)) {
15735                 bool sf;
15736                 char *tmp = sv_to_utf8_string(sv, NULL, &sf);
15737                 arg3 = CSLAddNameValue(arg3, key, tmp);
15738                 if (sf) Safefree(tmp); else free(tmp);
15739               }
15740             } else
15741             do_confess(NEED_REF, 1);
15742           } else
15743           do_confess(NEED_REF, 1);
15744         }
15745       }
15746     }
15747     {
15748       CPLErrorReset();
15749       result = (CPLErr)GDALDatasetShadow_AddBand(arg1,arg2,arg3);
15750       CPLErr eclass = CPLGetLastErrorType();
15751       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
15752         do_confess( CPLGetLastErrorMsg(), 0 );
15753 
15754 
15755 
15756 
15757 
15758       }
15759 
15760 
15761       /*
15762           Make warnings regular Perl warnings. This duplicates the warning
15763           message if DontUseExceptions() is in effect (it is not by default).
15764           */
15765       if ( eclass == CE_Warning ) {
15766         warn( CPLGetLastErrorMsg(), "%s" );
15767       }
15768 
15769 
15770     }
15771     {
15772       /* %typemap(out) CPLErr */
15773     }
15774 
15775 
15776     {
15777       /* %typemap(freearg) char **options */
15778       if (arg3) CSLDestroy( arg3 );
15779     }
15780     XSRETURN(argvi);
15781   fail:
15782 
15783 
15784     {
15785       /* %typemap(freearg) char **options */
15786       if (arg3) CSLDestroy( arg3 );
15787     }
15788     SWIG_croak_null();
15789   }
15790 }
15791 
15792 
XS(_wrap_Dataset__CreateMaskBand)15793 XS(_wrap_Dataset__CreateMaskBand) {
15794   {
15795     GDALDatasetShadow *arg1 = (GDALDatasetShadow *) 0 ;
15796     int arg2 ;
15797     int val2 ;
15798     int ecode2 = 0 ;
15799     int argvi = 0;
15800     CPLErr result;
15801     dXSARGS;
15802 
15803     if ((items < 2) || (items > 2)) {
15804       SWIG_croak("Usage: Dataset__CreateMaskBand(self,nFlags);");
15805     }
15806     {
15807       /* %typemap(in) (GDALDatasetShadow *) */
15808       void *argp = 0;
15809       int res = SWIG_ConvertPtr(ST(0), &argp, SWIGTYPE_p_GDALDatasetShadow, 0 |  0 );
15810       if (!SWIG_IsOK(res)) {
15811         do_confess(WRONG_CLASS, 1);
15812       }
15813       arg1 = reinterpret_cast< GDALDatasetShadow * >(argp);
15814       if (arg1 == NULL)
15815       do_confess(NEED_DEF, 1);
15816     }
15817     ecode2 = SWIG_AsVal_int SWIG_PERL_CALL_ARGS_2(ST(1), &val2);
15818     if (!SWIG_IsOK(ecode2)) {
15819       SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Dataset__CreateMaskBand" "', argument " "2"" of type '" "int""'");
15820     }
15821     arg2 = static_cast< int >(val2);
15822     {
15823       CPLErrorReset();
15824       result = (CPLErr)GDALDatasetShadow_CreateMaskBand(arg1,arg2);
15825       CPLErr eclass = CPLGetLastErrorType();
15826       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
15827         do_confess( CPLGetLastErrorMsg(), 0 );
15828 
15829 
15830 
15831 
15832 
15833       }
15834 
15835 
15836       /*
15837           Make warnings regular Perl warnings. This duplicates the warning
15838           message if DontUseExceptions() is in effect (it is not by default).
15839           */
15840       if ( eclass == CE_Warning ) {
15841         warn( CPLGetLastErrorMsg(), "%s" );
15842       }
15843 
15844 
15845     }
15846     {
15847       /* %typemap(out) CPLErr */
15848     }
15849 
15850 
15851     XSRETURN(argvi);
15852   fail:
15853 
15854 
15855     SWIG_croak_null();
15856   }
15857 }
15858 
15859 
XS(_wrap_Dataset_GetFileList)15860 XS(_wrap_Dataset_GetFileList) {
15861   {
15862     GDALDatasetShadow *arg1 = (GDALDatasetShadow *) 0 ;
15863     int argvi = 0;
15864     char **result = 0 ;
15865     dXSARGS;
15866 
15867     if ((items < 1) || (items > 1)) {
15868       SWIG_croak("Usage: Dataset_GetFileList(self);");
15869     }
15870     {
15871       /* %typemap(in) (GDALDatasetShadow *) */
15872       void *argp = 0;
15873       int res = SWIG_ConvertPtr(ST(0), &argp, SWIGTYPE_p_GDALDatasetShadow, 0 |  0 );
15874       if (!SWIG_IsOK(res)) {
15875         do_confess(WRONG_CLASS, 1);
15876       }
15877       arg1 = reinterpret_cast< GDALDatasetShadow * >(argp);
15878       if (arg1 == NULL)
15879       do_confess(NEED_DEF, 1);
15880     }
15881     {
15882       CPLErrorReset();
15883       result = (char **)GDALDatasetShadow_GetFileList(arg1);
15884       CPLErr eclass = CPLGetLastErrorType();
15885       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
15886         do_confess( CPLGetLastErrorMsg(), 0 );
15887 
15888 
15889 
15890 
15891 
15892       }
15893 
15894 
15895       /*
15896           Make warnings regular Perl warnings. This duplicates the warning
15897           message if DontUseExceptions() is in effect (it is not by default).
15898           */
15899       if ( eclass == CE_Warning ) {
15900         warn( CPLGetLastErrorMsg(), "%s" );
15901       }
15902 
15903 
15904     }
15905     {
15906       /* %typemap(out) char **CSL */
15907       if (GIMME_V == G_ARRAY) {
15908         if (result) {
15909           int n = CSLCount(result);
15910           EXTEND(SP, argvi+n-items+1);
15911           int i;
15912           for (i = 0; result[i]; i++) {
15913             SV *sv = newSVpv(result[i], 0);
15914             SvUTF8_on(sv); /* expecting GDAL to give us UTF-8 */
15915             ST(argvi++) = sv_2mortal(sv);
15916           }
15917           CSLDestroy(result);
15918         }
15919       } else {
15920         AV *av = (AV*)sv_2mortal((SV*)newAV());
15921         if (result) {
15922           int i;
15923           for (i = 0; result[i]; i++) {
15924             SV *sv = newSVpv(result[i], 0);
15925             SvUTF8_on(sv); /* expecting GDAL to give us UTF-8 */
15926             av_push(av, sv);
15927           }
15928           CSLDestroy(result);
15929         }
15930         ST(argvi) = newRV((SV*)av);
15931         sv_2mortal(ST(argvi));
15932         argvi++;
15933       }
15934     }
15935 
15936     XSRETURN(argvi);
15937   fail:
15938 
15939     SWIG_croak_null();
15940   }
15941 }
15942 
15943 
XS(_wrap_Dataset__WriteRaster)15944 XS(_wrap_Dataset__WriteRaster) {
15945   {
15946     GDALDatasetShadow *arg1 = (GDALDatasetShadow *) 0 ;
15947     int arg2 ;
15948     int arg3 ;
15949     int arg4 ;
15950     int arg5 ;
15951     GIntBig arg6 ;
15952     char *arg7 = (char *) 0 ;
15953     int *arg8 = (int *) 0 ;
15954     int *arg9 = (int *) 0 ;
15955     GDALDataType *arg10 = (GDALDataType *) 0 ;
15956     int arg11 = (int) 0 ;
15957     int *arg12 = (int *) 0 ;
15958     GIntBig *arg13 = (GIntBig *) 0 ;
15959     GIntBig *arg14 = (GIntBig *) 0 ;
15960     GIntBig *arg15 = (GIntBig *) 0 ;
15961     int val2 ;
15962     int ecode2 = 0 ;
15963     int val3 ;
15964     int ecode3 = 0 ;
15965     int val4 ;
15966     int ecode4 = 0 ;
15967     int val5 ;
15968     int ecode5 = 0 ;
15969     int val8 ;
15970     int val9 ;
15971     int val10 ;
15972     GIntBig val13 ;
15973     GIntBig val14 ;
15974     GIntBig val15 ;
15975     int argvi = 0;
15976     CPLErr result;
15977     dXSARGS;
15978 
15979     if ((items < 6) || (items > 13)) {
15980       SWIG_croak("Usage: Dataset__WriteRaster(self,xoff,yoff,xsize,ysize,buf_len,buf_string,buf_xsize,buf_ysize,buf_type,band_list,pband_list,buf_pixel_space,buf_line_space,buf_band_space);");
15981     }
15982     {
15983       /* %typemap(in) (GDALDatasetShadow *) */
15984       void *argp = 0;
15985       int res = SWIG_ConvertPtr(ST(0), &argp, SWIGTYPE_p_GDALDatasetShadow, 0 |  0 );
15986       if (!SWIG_IsOK(res)) {
15987         do_confess(WRONG_CLASS, 1);
15988       }
15989       arg1 = reinterpret_cast< GDALDatasetShadow * >(argp);
15990       if (arg1 == NULL)
15991       do_confess(NEED_DEF, 1);
15992     }
15993     ecode2 = SWIG_AsVal_int SWIG_PERL_CALL_ARGS_2(ST(1), &val2);
15994     if (!SWIG_IsOK(ecode2)) {
15995       SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Dataset__WriteRaster" "', argument " "2"" of type '" "int""'");
15996     }
15997     arg2 = static_cast< int >(val2);
15998     ecode3 = SWIG_AsVal_int SWIG_PERL_CALL_ARGS_2(ST(2), &val3);
15999     if (!SWIG_IsOK(ecode3)) {
16000       SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "Dataset__WriteRaster" "', argument " "3"" of type '" "int""'");
16001     }
16002     arg3 = static_cast< int >(val3);
16003     ecode4 = SWIG_AsVal_int SWIG_PERL_CALL_ARGS_2(ST(3), &val4);
16004     if (!SWIG_IsOK(ecode4)) {
16005       SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "Dataset__WriteRaster" "', argument " "4"" of type '" "int""'");
16006     }
16007     arg4 = static_cast< int >(val4);
16008     ecode5 = SWIG_AsVal_int SWIG_PERL_CALL_ARGS_2(ST(4), &val5);
16009     if (!SWIG_IsOK(ecode5)) {
16010       SWIG_exception_fail(SWIG_ArgError(ecode5), "in method '" "Dataset__WriteRaster" "', argument " "5"" of type '" "int""'");
16011     }
16012     arg5 = static_cast< int >(val5);
16013     {
16014       /* %typemap(in,numinputs=1) (GIntBig nLen, char *pBuf ) */
16015       if (SvOK(ST(5))) {
16016         SV *sv = ST(5);
16017         if (SvROK(sv) && SvTYPE(SvRV(sv)) < SVt_PVAV)
16018         sv = SvRV(sv);
16019         if (!SvPOK(sv))
16020         do_confess(NEED_BINARY_DATA, 1);
16021         STRLEN len = SvCUR(sv);
16022         arg7 = SvPV_nolen(sv);
16023         arg6 = len;
16024       } else {
16025         arg7 = NULL;
16026         arg6 = 0;
16027       }
16028     }
16029     if (items > 6) {
16030       {
16031         /* %typemap(in) (int *optional_int) */
16032         if ( !SvOK(ST(6)) ) {
16033           arg8 = 0;
16034         }
16035         else {
16036           val8 = SvIV(ST(6));
16037           arg8 = (int *)&val8;
16038         }
16039       }
16040     }
16041     if (items > 7) {
16042       {
16043         /* %typemap(in) (int *optional_int) */
16044         if ( !SvOK(ST(7)) ) {
16045           arg9 = 0;
16046         }
16047         else {
16048           val9 = SvIV(ST(7));
16049           arg9 = (int *)&val9;
16050         }
16051       }
16052     }
16053     if (items > 8) {
16054       {
16055         /* %typemap(in) (int *optional_int) */
16056         if ( !SvOK(ST(8)) ) {
16057           arg10 = 0;
16058         }
16059         else {
16060           val10 = SvIV(ST(8));
16061           arg10 = (GDALDataType *)&val10;
16062         }
16063       }
16064     }
16065     if (items > 9) {
16066       {
16067         /* %typemap(in,numinputs=1) (int nList, int* pList) */
16068         if (!(SvROK(ST(9)) && (SvTYPE(SvRV(ST(9)))==SVt_PVAV)))
16069         do_confess(NEED_ARRAY_REF, 1);
16070         AV *av = (AV*)(SvRV(ST(9)));
16071         arg11 = av_len(av)+1;
16072         arg12 = (int*)CPLMalloc(arg11*sizeof(int));
16073         if (arg12) {
16074           for( int i = 0; i<arg11; i++ ) {
16075             SV **sv = av_fetch(av, i, 0);
16076             arg12[i] =  SvIV(*sv);
16077           }
16078         } else
16079         SWIG_fail;
16080       }
16081     }
16082     if (items > 10) {
16083       {
16084         /* %typemap(in) (GIntBig *optional_GIntBig) */
16085         if ( !SvOK(ST(10)) ) {
16086           arg13 = 0;
16087         }
16088         else {
16089           val13 = CPLAtoGIntBig(SvPV_nolen(ST(10)));
16090           arg13 = (GIntBig *)&val13;
16091         }
16092       }
16093     }
16094     if (items > 11) {
16095       {
16096         /* %typemap(in) (GIntBig *optional_GIntBig) */
16097         if ( !SvOK(ST(11)) ) {
16098           arg14 = 0;
16099         }
16100         else {
16101           val14 = CPLAtoGIntBig(SvPV_nolen(ST(11)));
16102           arg14 = (GIntBig *)&val14;
16103         }
16104       }
16105     }
16106     if (items > 12) {
16107       {
16108         /* %typemap(in) (GIntBig *optional_GIntBig) */
16109         if ( !SvOK(ST(12)) ) {
16110           arg15 = 0;
16111         }
16112         else {
16113           val15 = CPLAtoGIntBig(SvPV_nolen(ST(12)));
16114           arg15 = (GIntBig *)&val15;
16115         }
16116       }
16117     }
16118     {
16119       CPLErrorReset();
16120       result = (CPLErr)GDALDatasetShadow_WriteRaster(arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9,arg10,arg11,arg12,arg13,arg14,arg15);
16121       CPLErr eclass = CPLGetLastErrorType();
16122       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
16123         do_confess( CPLGetLastErrorMsg(), 0 );
16124 
16125 
16126 
16127 
16128 
16129       }
16130 
16131 
16132       /*
16133           Make warnings regular Perl warnings. This duplicates the warning
16134           message if DontUseExceptions() is in effect (it is not by default).
16135           */
16136       if ( eclass == CE_Warning ) {
16137         warn( CPLGetLastErrorMsg(), "%s" );
16138       }
16139 
16140 
16141     }
16142     {
16143       /* %typemap(out) CPLErr */
16144     }
16145 
16146 
16147 
16148 
16149 
16150 
16151 
16152 
16153     {
16154       /* %typemap(freearg) (int nList, int* pList) */
16155       CPLFree((void*) arg12);
16156     }
16157 
16158 
16159 
16160     XSRETURN(argvi);
16161   fail:
16162 
16163 
16164 
16165 
16166 
16167 
16168 
16169 
16170     {
16171       /* %typemap(freearg) (int nList, int* pList) */
16172       CPLFree((void*) arg12);
16173     }
16174 
16175 
16176 
16177     SWIG_croak_null();
16178   }
16179 }
16180 
16181 
XS(_wrap_Dataset__ReadRaster)16182 XS(_wrap_Dataset__ReadRaster) {
16183   {
16184     GDALDatasetShadow *arg1 = (GDALDatasetShadow *) 0 ;
16185     int arg2 ;
16186     int arg3 ;
16187     int arg4 ;
16188     int arg5 ;
16189     GIntBig *arg6 = (GIntBig *) 0 ;
16190     char **arg7 = (char **) 0 ;
16191     int *arg8 = (int *) 0 ;
16192     int *arg9 = (int *) 0 ;
16193     GDALDataType *arg10 = (GDALDataType *) 0 ;
16194     int arg11 = (int) 0 ;
16195     int *arg12 = (int *) 0 ;
16196     GIntBig *arg13 = (GIntBig *) 0 ;
16197     GIntBig *arg14 = (GIntBig *) 0 ;
16198     GIntBig *arg15 = (GIntBig *) 0 ;
16199     GDALRIOResampleAlg arg16 = (GDALRIOResampleAlg) GRIORA_NearestNeighbour ;
16200     GDALProgressFunc arg17 = (GDALProgressFunc) NULL ;
16201     void *arg18 = (void *) NULL ;
16202     int val2 ;
16203     int ecode2 = 0 ;
16204     int val3 ;
16205     int ecode3 = 0 ;
16206     int val4 ;
16207     int ecode4 = 0 ;
16208     int val5 ;
16209     int ecode5 = 0 ;
16210     GIntBig nLen6 = 0 ;
16211     char *pBuf6 = 0 ;
16212     int val8 ;
16213     int val9 ;
16214     int val10 ;
16215     GIntBig val13 ;
16216     GIntBig val14 ;
16217     GIntBig val15 ;
16218     int val16 ;
16219     int ecode16 = 0 ;
16220     int argvi = 0;
16221     CPLErr result;
16222     dXSARGS;
16223 
16224     /* %typemap(arginit, noblock=1) ( void* callback_data = NULL) */
16225     SavedEnv saved_env;
16226     saved_env.fct = NULL;
16227     saved_env.data = &PL_sv_undef;
16228     arg18 = (void *)(&saved_env);
16229     {
16230       /* %typemap(in,numinputs=0) (GIntBig *nLen6, char **pBuf6 ) */
16231       arg6 = &nLen6;
16232       arg7 = &pBuf6;
16233     }
16234     if ((items < 5) || (items > 15)) {
16235       SWIG_croak("Usage: Dataset__ReadRaster(self,xoff,yoff,xsize,ysize,buf,buf_xsize,buf_ysize,buf_type,band_list,pband_list,buf_pixel_space,buf_line_space,buf_band_space,resample_alg,callback,callback_data);");
16236     }
16237     {
16238       /* %typemap(in) (GDALDatasetShadow *) */
16239       void *argp = 0;
16240       int res = SWIG_ConvertPtr(ST(0), &argp, SWIGTYPE_p_GDALDatasetShadow, 0 |  0 );
16241       if (!SWIG_IsOK(res)) {
16242         do_confess(WRONG_CLASS, 1);
16243       }
16244       arg1 = reinterpret_cast< GDALDatasetShadow * >(argp);
16245       if (arg1 == NULL)
16246       do_confess(NEED_DEF, 1);
16247     }
16248     ecode2 = SWIG_AsVal_int SWIG_PERL_CALL_ARGS_2(ST(1), &val2);
16249     if (!SWIG_IsOK(ecode2)) {
16250       SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Dataset__ReadRaster" "', argument " "2"" of type '" "int""'");
16251     }
16252     arg2 = static_cast< int >(val2);
16253     ecode3 = SWIG_AsVal_int SWIG_PERL_CALL_ARGS_2(ST(2), &val3);
16254     if (!SWIG_IsOK(ecode3)) {
16255       SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "Dataset__ReadRaster" "', argument " "3"" of type '" "int""'");
16256     }
16257     arg3 = static_cast< int >(val3);
16258     ecode4 = SWIG_AsVal_int SWIG_PERL_CALL_ARGS_2(ST(3), &val4);
16259     if (!SWIG_IsOK(ecode4)) {
16260       SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "Dataset__ReadRaster" "', argument " "4"" of type '" "int""'");
16261     }
16262     arg4 = static_cast< int >(val4);
16263     ecode5 = SWIG_AsVal_int SWIG_PERL_CALL_ARGS_2(ST(4), &val5);
16264     if (!SWIG_IsOK(ecode5)) {
16265       SWIG_exception_fail(SWIG_ArgError(ecode5), "in method '" "Dataset__ReadRaster" "', argument " "5"" of type '" "int""'");
16266     }
16267     arg5 = static_cast< int >(val5);
16268     if (items > 5) {
16269       {
16270         /* %typemap(in) (int *optional_int) */
16271         if ( !SvOK(ST(5)) ) {
16272           arg8 = 0;
16273         }
16274         else {
16275           val8 = SvIV(ST(5));
16276           arg8 = (int *)&val8;
16277         }
16278       }
16279     }
16280     if (items > 6) {
16281       {
16282         /* %typemap(in) (int *optional_int) */
16283         if ( !SvOK(ST(6)) ) {
16284           arg9 = 0;
16285         }
16286         else {
16287           val9 = SvIV(ST(6));
16288           arg9 = (int *)&val9;
16289         }
16290       }
16291     }
16292     if (items > 7) {
16293       {
16294         /* %typemap(in) (int *optional_int) */
16295         if ( !SvOK(ST(7)) ) {
16296           arg10 = 0;
16297         }
16298         else {
16299           val10 = SvIV(ST(7));
16300           arg10 = (GDALDataType *)&val10;
16301         }
16302       }
16303     }
16304     if (items > 8) {
16305       {
16306         /* %typemap(in,numinputs=1) (int nList, int* pList) */
16307         if (!(SvROK(ST(8)) && (SvTYPE(SvRV(ST(8)))==SVt_PVAV)))
16308         do_confess(NEED_ARRAY_REF, 1);
16309         AV *av = (AV*)(SvRV(ST(8)));
16310         arg11 = av_len(av)+1;
16311         arg12 = (int*)CPLMalloc(arg11*sizeof(int));
16312         if (arg12) {
16313           for( int i = 0; i<arg11; i++ ) {
16314             SV **sv = av_fetch(av, i, 0);
16315             arg12[i] =  SvIV(*sv);
16316           }
16317         } else
16318         SWIG_fail;
16319       }
16320     }
16321     if (items > 9) {
16322       {
16323         /* %typemap(in) (GIntBig *optional_GIntBig) */
16324         if ( !SvOK(ST(9)) ) {
16325           arg13 = 0;
16326         }
16327         else {
16328           val13 = CPLAtoGIntBig(SvPV_nolen(ST(9)));
16329           arg13 = (GIntBig *)&val13;
16330         }
16331       }
16332     }
16333     if (items > 10) {
16334       {
16335         /* %typemap(in) (GIntBig *optional_GIntBig) */
16336         if ( !SvOK(ST(10)) ) {
16337           arg14 = 0;
16338         }
16339         else {
16340           val14 = CPLAtoGIntBig(SvPV_nolen(ST(10)));
16341           arg14 = (GIntBig *)&val14;
16342         }
16343       }
16344     }
16345     if (items > 11) {
16346       {
16347         /* %typemap(in) (GIntBig *optional_GIntBig) */
16348         if ( !SvOK(ST(11)) ) {
16349           arg15 = 0;
16350         }
16351         else {
16352           val15 = CPLAtoGIntBig(SvPV_nolen(ST(11)));
16353           arg15 = (GIntBig *)&val15;
16354         }
16355       }
16356     }
16357     if (items > 12) {
16358       ecode16 = SWIG_AsVal_int SWIG_PERL_CALL_ARGS_2(ST(12), &val16);
16359       if (!SWIG_IsOK(ecode16)) {
16360         SWIG_exception_fail(SWIG_ArgError(ecode16), "in method '" "Dataset__ReadRaster" "', argument " "16"" of type '" "GDALRIOResampleAlg""'");
16361       }
16362       arg16 = static_cast< GDALRIOResampleAlg >(val16);
16363     }
16364     if (items > 13) {
16365       {
16366         /* %typemap(in) (GDALProgressFunc callback = NULL) */
16367         if (SvOK(ST(13))) {
16368           if (SvROK(ST(13))) {
16369             if (SvTYPE(SvRV(ST(13))) != SVt_PVCV) {
16370               do_confess(NEED_CODE_REF, 1);
16371             } else {
16372               saved_env.fct = (SV *)ST(13);
16373               arg17 = &callback_d_cp_vp;
16374             }
16375           } else {
16376             do_confess(NEED_CODE_REF, 1);
16377           }
16378         }
16379       }
16380     }
16381     if (items > 14) {
16382       {
16383         /* %typemap(in) (void* callback_data=NULL) */
16384         if (SvOK(ST(14)))
16385         saved_env.data = (SV *)ST(14);
16386       }
16387     }
16388     {
16389       CPLErrorReset();
16390       result = (CPLErr)GDALDatasetShadow_ReadRaster(arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9,arg10,arg11,arg12,arg13,arg14,arg15,arg16,arg17,arg18);
16391       CPLErr eclass = CPLGetLastErrorType();
16392       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
16393         do_confess( CPLGetLastErrorMsg(), 0 );
16394 
16395 
16396 
16397 
16398 
16399       }
16400 
16401 
16402       /*
16403           Make warnings regular Perl warnings. This duplicates the warning
16404           message if DontUseExceptions() is in effect (it is not by default).
16405           */
16406       if ( eclass == CE_Warning ) {
16407         warn( CPLGetLastErrorMsg(), "%s" );
16408       }
16409 
16410 
16411     }
16412     {
16413       /* %typemap(out) CPLErr */
16414     }
16415     {
16416       /* %typemap(argout) (GIntBig *nLen, char **pBuf ) */
16417       ST(argvi) = sv_2mortal(newSVpv( *arg7, *arg6 ));
16418       argvi++;
16419     }
16420 
16421 
16422 
16423 
16424 
16425     {
16426       /* %typemap(freearg) (GIntBig *nLen, char **pBuf ) */
16427       if( *arg6 ) {
16428         free( *arg7 );
16429       }
16430     }
16431 
16432 
16433 
16434     {
16435       /* %typemap(freearg) (int nList, int* pList) */
16436       CPLFree((void*) arg12);
16437     }
16438 
16439 
16440 
16441 
16442 
16443     XSRETURN(argvi);
16444   fail:
16445 
16446 
16447 
16448 
16449 
16450     {
16451       /* %typemap(freearg) (GIntBig *nLen, char **pBuf ) */
16452       if( *arg6 ) {
16453         free( *arg7 );
16454       }
16455     }
16456 
16457 
16458 
16459     {
16460       /* %typemap(freearg) (int nList, int* pList) */
16461       CPLFree((void*) arg12);
16462     }
16463 
16464 
16465 
16466 
16467 
16468     SWIG_croak_null();
16469   }
16470 }
16471 
16472 
XS(_wrap_Dataset_AdviseRead)16473 XS(_wrap_Dataset_AdviseRead) {
16474   {
16475     GDALDatasetShadow *arg1 = (GDALDatasetShadow *) 0 ;
16476     int arg2 ;
16477     int arg3 ;
16478     int arg4 ;
16479     int arg5 ;
16480     int *arg6 = (int *) 0 ;
16481     int *arg7 = (int *) 0 ;
16482     GDALDataType *arg8 = (GDALDataType *) 0 ;
16483     int arg9 = (int) 0 ;
16484     int *arg10 = (int *) 0 ;
16485     char **arg11 = (char **) NULL ;
16486     int val2 ;
16487     int ecode2 = 0 ;
16488     int val3 ;
16489     int ecode3 = 0 ;
16490     int val4 ;
16491     int ecode4 = 0 ;
16492     int val5 ;
16493     int ecode5 = 0 ;
16494     void *argp6 = 0 ;
16495     int res6 = 0 ;
16496     void *argp7 = 0 ;
16497     int res7 = 0 ;
16498     int val8 ;
16499     int argvi = 0;
16500     CPLErr result;
16501     dXSARGS;
16502 
16503     if ((items < 5) || (items > 10)) {
16504       SWIG_croak("Usage: Dataset_AdviseRead(self,xoff,yoff,xsize,ysize,buf_xsize,buf_ysize,buf_type,band_list,pband_list,options);");
16505     }
16506     {
16507       /* %typemap(in) (GDALDatasetShadow *) */
16508       void *argp = 0;
16509       int res = SWIG_ConvertPtr(ST(0), &argp, SWIGTYPE_p_GDALDatasetShadow, 0 |  0 );
16510       if (!SWIG_IsOK(res)) {
16511         do_confess(WRONG_CLASS, 1);
16512       }
16513       arg1 = reinterpret_cast< GDALDatasetShadow * >(argp);
16514       if (arg1 == NULL)
16515       do_confess(NEED_DEF, 1);
16516     }
16517     ecode2 = SWIG_AsVal_int SWIG_PERL_CALL_ARGS_2(ST(1), &val2);
16518     if (!SWIG_IsOK(ecode2)) {
16519       SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Dataset_AdviseRead" "', argument " "2"" of type '" "int""'");
16520     }
16521     arg2 = static_cast< int >(val2);
16522     ecode3 = SWIG_AsVal_int SWIG_PERL_CALL_ARGS_2(ST(2), &val3);
16523     if (!SWIG_IsOK(ecode3)) {
16524       SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "Dataset_AdviseRead" "', argument " "3"" of type '" "int""'");
16525     }
16526     arg3 = static_cast< int >(val3);
16527     ecode4 = SWIG_AsVal_int SWIG_PERL_CALL_ARGS_2(ST(3), &val4);
16528     if (!SWIG_IsOK(ecode4)) {
16529       SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "Dataset_AdviseRead" "', argument " "4"" of type '" "int""'");
16530     }
16531     arg4 = static_cast< int >(val4);
16532     ecode5 = SWIG_AsVal_int SWIG_PERL_CALL_ARGS_2(ST(4), &val5);
16533     if (!SWIG_IsOK(ecode5)) {
16534       SWIG_exception_fail(SWIG_ArgError(ecode5), "in method '" "Dataset_AdviseRead" "', argument " "5"" of type '" "int""'");
16535     }
16536     arg5 = static_cast< int >(val5);
16537     if (items > 5) {
16538       res6 = SWIG_ConvertPtr(ST(5), &argp6,SWIGTYPE_p_int, 0 |  0 );
16539       if (!SWIG_IsOK(res6)) {
16540         SWIG_exception_fail(SWIG_ArgError(res6), "in method '" "Dataset_AdviseRead" "', argument " "6"" of type '" "int *""'");
16541       }
16542       arg6 = reinterpret_cast< int * >(argp6);
16543     }
16544     if (items > 6) {
16545       res7 = SWIG_ConvertPtr(ST(6), &argp7,SWIGTYPE_p_int, 0 |  0 );
16546       if (!SWIG_IsOK(res7)) {
16547         SWIG_exception_fail(SWIG_ArgError(res7), "in method '" "Dataset_AdviseRead" "', argument " "7"" of type '" "int *""'");
16548       }
16549       arg7 = reinterpret_cast< int * >(argp7);
16550     }
16551     if (items > 7) {
16552       {
16553         /* %typemap(in) (int *optional_int) */
16554         if ( !SvOK(ST(7)) ) {
16555           arg8 = 0;
16556         }
16557         else {
16558           val8 = SvIV(ST(7));
16559           arg8 = (GDALDataType *)&val8;
16560         }
16561       }
16562     }
16563     if (items > 8) {
16564       {
16565         /* %typemap(in,numinputs=1) (int nList, int* pList) */
16566         if (!(SvROK(ST(8)) && (SvTYPE(SvRV(ST(8)))==SVt_PVAV)))
16567         do_confess(NEED_ARRAY_REF, 1);
16568         AV *av = (AV*)(SvRV(ST(8)));
16569         arg9 = av_len(av)+1;
16570         arg10 = (int*)CPLMalloc(arg9*sizeof(int));
16571         if (arg10) {
16572           for( int i = 0; i<arg9; i++ ) {
16573             SV **sv = av_fetch(av, i, 0);
16574             arg10[i] =  SvIV(*sv);
16575           }
16576         } else
16577         SWIG_fail;
16578       }
16579     }
16580     if (items > 9) {
16581       {
16582         /* %typemap(in) char **options */
16583         if (SvOK(ST(9))) {
16584           if (SvROK(ST(9))) {
16585             if (SvTYPE(SvRV(ST(9)))==SVt_PVAV) {
16586               AV *av = (AV*)(SvRV(ST(9)));
16587               for (int i = 0; i < av_len(av)+1; i++) {
16588                 SV *sv = *(av_fetch(av, i, 0));
16589                 bool sf;
16590                 char *tmp = sv_to_utf8_string(sv, NULL, &sf);
16591                 arg11 = CSLAddString(arg11, tmp);
16592                 if (sf) Safefree(tmp); else free(tmp);
16593               }
16594             } else if (SvTYPE(SvRV(ST(9)))==SVt_PVHV) {
16595               HV *hv = (HV*)SvRV(ST(9));
16596               SV *sv;
16597               char *key;
16598               I32 klen;
16599               arg11 = NULL;
16600               hv_iterinit(hv);
16601               while(sv = hv_iternextsv(hv, &key, &klen)) {
16602                 bool sf;
16603                 char *tmp = sv_to_utf8_string(sv, NULL, &sf);
16604                 arg11 = CSLAddNameValue(arg11, key, tmp);
16605                 if (sf) Safefree(tmp); else free(tmp);
16606               }
16607             } else
16608             do_confess(NEED_REF, 1);
16609           } else
16610           do_confess(NEED_REF, 1);
16611         }
16612       }
16613     }
16614     {
16615       CPLErrorReset();
16616       result = (CPLErr)GDALDatasetShadow_AdviseRead(arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9,arg10,arg11);
16617       CPLErr eclass = CPLGetLastErrorType();
16618       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
16619         do_confess( CPLGetLastErrorMsg(), 0 );
16620 
16621 
16622 
16623 
16624 
16625       }
16626 
16627 
16628       /*
16629           Make warnings regular Perl warnings. This duplicates the warning
16630           message if DontUseExceptions() is in effect (it is not by default).
16631           */
16632       if ( eclass == CE_Warning ) {
16633         warn( CPLGetLastErrorMsg(), "%s" );
16634       }
16635 
16636 
16637     }
16638     {
16639       /* %typemap(out) CPLErr */
16640     }
16641 
16642 
16643 
16644 
16645 
16646 
16647 
16648 
16649     {
16650       /* %typemap(freearg) (int nList, int* pList) */
16651       CPLFree((void*) arg10);
16652     }
16653     {
16654       /* %typemap(freearg) char **options */
16655       if (arg11) CSLDestroy( arg11 );
16656     }
16657     XSRETURN(argvi);
16658   fail:
16659 
16660 
16661 
16662 
16663 
16664 
16665 
16666 
16667     {
16668       /* %typemap(freearg) (int nList, int* pList) */
16669       CPLFree((void*) arg10);
16670     }
16671     {
16672       /* %typemap(freearg) char **options */
16673       if (arg11) CSLDestroy( arg11 );
16674     }
16675     SWIG_croak_null();
16676   }
16677 }
16678 
16679 
XS(_wrap_Dataset__CreateLayer)16680 XS(_wrap_Dataset__CreateLayer) {
16681   {
16682     GDALDatasetShadow *arg1 = (GDALDatasetShadow *) 0 ;
16683     char *arg2 = (char *) 0 ;
16684     OSRSpatialReferenceShadow *arg3 = (OSRSpatialReferenceShadow *) NULL ;
16685     OGRwkbGeometryType arg4 = (OGRwkbGeometryType) wkbUnknown ;
16686     char **arg5 = (char **) 0 ;
16687     int res2 ;
16688     char *buf2 = 0 ;
16689     int alloc2 = 0 ;
16690     void *argp3 = 0 ;
16691     int res3 = 0 ;
16692     int val4 ;
16693     int ecode4 = 0 ;
16694     int argvi = 0;
16695     OGRLayerShadow *result = 0 ;
16696     dXSARGS;
16697 
16698     if ((items < 2) || (items > 5)) {
16699       SWIG_croak("Usage: Dataset__CreateLayer(self,name,srs,geom_type,options);");
16700     }
16701     {
16702       /* %typemap(in) (GDALDatasetShadow *) */
16703       void *argp = 0;
16704       int res = SWIG_ConvertPtr(ST(0), &argp, SWIGTYPE_p_GDALDatasetShadow, 0 |  0 );
16705       if (!SWIG_IsOK(res)) {
16706         do_confess(WRONG_CLASS, 1);
16707       }
16708       arg1 = reinterpret_cast< GDALDatasetShadow * >(argp);
16709       if (arg1 == NULL)
16710       do_confess(NEED_DEF, 1);
16711     }
16712     res2 = SWIG_AsCharPtrAndSize(ST(1), &buf2, NULL, &alloc2);
16713     if (!SWIG_IsOK(res2)) {
16714       SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Dataset__CreateLayer" "', argument " "2"" of type '" "char const *""'");
16715     }
16716     arg2 = reinterpret_cast< char * >(buf2);
16717     if (items > 2) {
16718       res3 = SWIG_ConvertPtr(ST(2), &argp3,SWIGTYPE_p_OSRSpatialReferenceShadow, 0 |  0 );
16719       if (!SWIG_IsOK(res3)) {
16720         SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "Dataset__CreateLayer" "', argument " "3"" of type '" "OSRSpatialReferenceShadow *""'");
16721       }
16722       arg3 = reinterpret_cast< OSRSpatialReferenceShadow * >(argp3);
16723     }
16724     if (items > 3) {
16725       ecode4 = SWIG_AsVal_int SWIG_PERL_CALL_ARGS_2(ST(3), &val4);
16726       if (!SWIG_IsOK(ecode4)) {
16727         SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "Dataset__CreateLayer" "', argument " "4"" of type '" "OGRwkbGeometryType""'");
16728       }
16729       arg4 = static_cast< OGRwkbGeometryType >(val4);
16730     }
16731     if (items > 4) {
16732       {
16733         /* %typemap(in) char **options */
16734         if (SvOK(ST(4))) {
16735           if (SvROK(ST(4))) {
16736             if (SvTYPE(SvRV(ST(4)))==SVt_PVAV) {
16737               AV *av = (AV*)(SvRV(ST(4)));
16738               for (int i = 0; i < av_len(av)+1; i++) {
16739                 SV *sv = *(av_fetch(av, i, 0));
16740                 bool sf;
16741                 char *tmp = sv_to_utf8_string(sv, NULL, &sf);
16742                 arg5 = CSLAddString(arg5, tmp);
16743                 if (sf) Safefree(tmp); else free(tmp);
16744               }
16745             } else if (SvTYPE(SvRV(ST(4)))==SVt_PVHV) {
16746               HV *hv = (HV*)SvRV(ST(4));
16747               SV *sv;
16748               char *key;
16749               I32 klen;
16750               arg5 = NULL;
16751               hv_iterinit(hv);
16752               while(sv = hv_iternextsv(hv, &key, &klen)) {
16753                 bool sf;
16754                 char *tmp = sv_to_utf8_string(sv, NULL, &sf);
16755                 arg5 = CSLAddNameValue(arg5, key, tmp);
16756                 if (sf) Safefree(tmp); else free(tmp);
16757               }
16758             } else
16759             do_confess(NEED_REF, 1);
16760           } else
16761           do_confess(NEED_REF, 1);
16762         }
16763       }
16764     }
16765     {
16766       CPLErrorReset();
16767       result = (OGRLayerShadow *)GDALDatasetShadow_CreateLayer(arg1,(char const *)arg2,arg3,arg4,arg5);
16768       CPLErr eclass = CPLGetLastErrorType();
16769       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
16770         do_confess( CPLGetLastErrorMsg(), 0 );
16771 
16772 
16773 
16774 
16775 
16776       }
16777 
16778 
16779       /*
16780           Make warnings regular Perl warnings. This duplicates the warning
16781           message if DontUseExceptions() is in effect (it is not by default).
16782           */
16783       if ( eclass == CE_Warning ) {
16784         warn( CPLGetLastErrorMsg(), "%s" );
16785       }
16786 
16787 
16788     }
16789     ST(argvi) = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_OGRLayerShadow, 0 | SWIG_SHADOW); argvi++ ;
16790 
16791     if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
16792 
16793 
16794     {
16795       /* %typemap(freearg) char **options */
16796       if (arg5) CSLDestroy( arg5 );
16797     }
16798     XSRETURN(argvi);
16799   fail:
16800 
16801     if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
16802 
16803 
16804     {
16805       /* %typemap(freearg) char **options */
16806       if (arg5) CSLDestroy( arg5 );
16807     }
16808     SWIG_croak_null();
16809   }
16810 }
16811 
16812 
XS(_wrap_Dataset_CopyLayer)16813 XS(_wrap_Dataset_CopyLayer) {
16814   {
16815     GDALDatasetShadow *arg1 = (GDALDatasetShadow *) 0 ;
16816     OGRLayerShadow *arg2 = (OGRLayerShadow *) 0 ;
16817     char *arg3 = (char *) 0 ;
16818     char **arg4 = (char **) 0 ;
16819     void *argp2 = 0 ;
16820     int res2 = 0 ;
16821     int res3 ;
16822     char *buf3 = 0 ;
16823     int alloc3 = 0 ;
16824     int argvi = 0;
16825     OGRLayerShadow *result = 0 ;
16826     dXSARGS;
16827 
16828     if ((items < 3) || (items > 4)) {
16829       SWIG_croak("Usage: Dataset_CopyLayer(self,src_layer,new_name,options);");
16830     }
16831     {
16832       /* %typemap(in) (GDALDatasetShadow *) */
16833       void *argp = 0;
16834       int res = SWIG_ConvertPtr(ST(0), &argp, SWIGTYPE_p_GDALDatasetShadow, 0 |  0 );
16835       if (!SWIG_IsOK(res)) {
16836         do_confess(WRONG_CLASS, 1);
16837       }
16838       arg1 = reinterpret_cast< GDALDatasetShadow * >(argp);
16839       if (arg1 == NULL)
16840       do_confess(NEED_DEF, 1);
16841     }
16842     res2 = SWIG_ConvertPtr(ST(1), &argp2,SWIGTYPE_p_OGRLayerShadow, 0 |  0 );
16843     if (!SWIG_IsOK(res2)) {
16844       SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Dataset_CopyLayer" "', argument " "2"" of type '" "OGRLayerShadow *""'");
16845     }
16846     arg2 = reinterpret_cast< OGRLayerShadow * >(argp2);
16847     res3 = SWIG_AsCharPtrAndSize(ST(2), &buf3, NULL, &alloc3);
16848     if (!SWIG_IsOK(res3)) {
16849       SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "Dataset_CopyLayer" "', argument " "3"" of type '" "char const *""'");
16850     }
16851     arg3 = reinterpret_cast< char * >(buf3);
16852     if (items > 3) {
16853       {
16854         /* %typemap(in) char **options */
16855         if (SvOK(ST(3))) {
16856           if (SvROK(ST(3))) {
16857             if (SvTYPE(SvRV(ST(3)))==SVt_PVAV) {
16858               AV *av = (AV*)(SvRV(ST(3)));
16859               for (int i = 0; i < av_len(av)+1; i++) {
16860                 SV *sv = *(av_fetch(av, i, 0));
16861                 bool sf;
16862                 char *tmp = sv_to_utf8_string(sv, NULL, &sf);
16863                 arg4 = CSLAddString(arg4, tmp);
16864                 if (sf) Safefree(tmp); else free(tmp);
16865               }
16866             } else if (SvTYPE(SvRV(ST(3)))==SVt_PVHV) {
16867               HV *hv = (HV*)SvRV(ST(3));
16868               SV *sv;
16869               char *key;
16870               I32 klen;
16871               arg4 = NULL;
16872               hv_iterinit(hv);
16873               while(sv = hv_iternextsv(hv, &key, &klen)) {
16874                 bool sf;
16875                 char *tmp = sv_to_utf8_string(sv, NULL, &sf);
16876                 arg4 = CSLAddNameValue(arg4, key, tmp);
16877                 if (sf) Safefree(tmp); else free(tmp);
16878               }
16879             } else
16880             do_confess(NEED_REF, 1);
16881           } else
16882           do_confess(NEED_REF, 1);
16883         }
16884       }
16885     }
16886     {
16887       if (!arg2) {
16888         SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
16889       }
16890     }
16891     {
16892       CPLErrorReset();
16893       result = (OGRLayerShadow *)GDALDatasetShadow_CopyLayer(arg1,arg2,(char const *)arg3,arg4);
16894       CPLErr eclass = CPLGetLastErrorType();
16895       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
16896         do_confess( CPLGetLastErrorMsg(), 0 );
16897 
16898 
16899 
16900 
16901 
16902       }
16903 
16904 
16905       /*
16906           Make warnings regular Perl warnings. This duplicates the warning
16907           message if DontUseExceptions() is in effect (it is not by default).
16908           */
16909       if ( eclass == CE_Warning ) {
16910         warn( CPLGetLastErrorMsg(), "%s" );
16911       }
16912 
16913 
16914     }
16915     ST(argvi) = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_OGRLayerShadow, 0 | SWIG_SHADOW); argvi++ ;
16916 
16917 
16918     if (alloc3 == SWIG_NEWOBJ) delete[] buf3;
16919     {
16920       /* %typemap(freearg) char **options */
16921       if (arg4) CSLDestroy( arg4 );
16922     }
16923     XSRETURN(argvi);
16924   fail:
16925 
16926 
16927     if (alloc3 == SWIG_NEWOBJ) delete[] buf3;
16928     {
16929       /* %typemap(freearg) char **options */
16930       if (arg4) CSLDestroy( arg4 );
16931     }
16932     SWIG_croak_null();
16933   }
16934 }
16935 
16936 
XS(_wrap_Dataset__DeleteLayer)16937 XS(_wrap_Dataset__DeleteLayer) {
16938   {
16939     GDALDatasetShadow *arg1 = (GDALDatasetShadow *) 0 ;
16940     int arg2 ;
16941     int val2 ;
16942     int ecode2 = 0 ;
16943     int argvi = 0;
16944     OGRErr result;
16945     dXSARGS;
16946 
16947     if ((items < 2) || (items > 2)) {
16948       SWIG_croak("Usage: Dataset__DeleteLayer(self,index);");
16949     }
16950     {
16951       /* %typemap(in) (GDALDatasetShadow *) */
16952       void *argp = 0;
16953       int res = SWIG_ConvertPtr(ST(0), &argp, SWIGTYPE_p_GDALDatasetShadow, 0 |  0 );
16954       if (!SWIG_IsOK(res)) {
16955         do_confess(WRONG_CLASS, 1);
16956       }
16957       arg1 = reinterpret_cast< GDALDatasetShadow * >(argp);
16958       if (arg1 == NULL)
16959       do_confess(NEED_DEF, 1);
16960     }
16961     ecode2 = SWIG_AsVal_int SWIG_PERL_CALL_ARGS_2(ST(1), &val2);
16962     if (!SWIG_IsOK(ecode2)) {
16963       SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Dataset__DeleteLayer" "', argument " "2"" of type '" "int""'");
16964     }
16965     arg2 = static_cast< int >(val2);
16966     {
16967       CPLErrorReset();
16968       result = (OGRErr)GDALDatasetShadow_DeleteLayer(arg1,arg2);
16969       CPLErr eclass = CPLGetLastErrorType();
16970       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
16971         do_confess( CPLGetLastErrorMsg(), 0 );
16972 
16973 
16974 
16975 
16976 
16977       }
16978 
16979 
16980       /*
16981           Make warnings regular Perl warnings. This duplicates the warning
16982           message if DontUseExceptions() is in effect (it is not by default).
16983           */
16984       if ( eclass == CE_Warning ) {
16985         warn( CPLGetLastErrorMsg(), "%s" );
16986       }
16987 
16988 
16989     }
16990     {
16991       /* %typemap(out) OGRErr */
16992       if ( result != 0 ) {
16993         const char *err = CPLGetLastErrorMsg();
16994         if (err and *err) do_confess(err, 0); /* this is usually better */
16995         do_confess( OGRErrMessages(result), 1 );
16996       }
16997     }
16998 
16999 
17000     XSRETURN(argvi);
17001   fail:
17002 
17003 
17004     SWIG_croak_null();
17005   }
17006 }
17007 
17008 
XS(_wrap_Dataset_GetLayerCount)17009 XS(_wrap_Dataset_GetLayerCount) {
17010   {
17011     GDALDatasetShadow *arg1 = (GDALDatasetShadow *) 0 ;
17012     int argvi = 0;
17013     int result;
17014     dXSARGS;
17015 
17016     if ((items < 1) || (items > 1)) {
17017       SWIG_croak("Usage: Dataset_GetLayerCount(self);");
17018     }
17019     {
17020       /* %typemap(in) (GDALDatasetShadow *) */
17021       void *argp = 0;
17022       int res = SWIG_ConvertPtr(ST(0), &argp, SWIGTYPE_p_GDALDatasetShadow, 0 |  0 );
17023       if (!SWIG_IsOK(res)) {
17024         do_confess(WRONG_CLASS, 1);
17025       }
17026       arg1 = reinterpret_cast< GDALDatasetShadow * >(argp);
17027       if (arg1 == NULL)
17028       do_confess(NEED_DEF, 1);
17029     }
17030     {
17031       CPLErrorReset();
17032       result = (int)GDALDatasetShadow_GetLayerCount(arg1);
17033       CPLErr eclass = CPLGetLastErrorType();
17034       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
17035         do_confess( CPLGetLastErrorMsg(), 0 );
17036 
17037 
17038 
17039 
17040 
17041       }
17042 
17043 
17044       /*
17045           Make warnings regular Perl warnings. This duplicates the warning
17046           message if DontUseExceptions() is in effect (it is not by default).
17047           */
17048       if ( eclass == CE_Warning ) {
17049         warn( CPLGetLastErrorMsg(), "%s" );
17050       }
17051 
17052 
17053     }
17054     ST(argvi) = SWIG_From_int  SWIG_PERL_CALL_ARGS_1(static_cast< int >(result)); argvi++ ;
17055 
17056     XSRETURN(argvi);
17057   fail:
17058 
17059     SWIG_croak_null();
17060   }
17061 }
17062 
17063 
XS(_wrap_Dataset_GetLayerByIndex)17064 XS(_wrap_Dataset_GetLayerByIndex) {
17065   {
17066     GDALDatasetShadow *arg1 = (GDALDatasetShadow *) 0 ;
17067     int arg2 = (int) 0 ;
17068     int val2 ;
17069     int ecode2 = 0 ;
17070     int argvi = 0;
17071     OGRLayerShadow *result = 0 ;
17072     dXSARGS;
17073 
17074     if ((items < 1) || (items > 2)) {
17075       SWIG_croak("Usage: Dataset_GetLayerByIndex(self,index);");
17076     }
17077     {
17078       /* %typemap(in) (GDALDatasetShadow *) */
17079       void *argp = 0;
17080       int res = SWIG_ConvertPtr(ST(0), &argp, SWIGTYPE_p_GDALDatasetShadow, 0 |  0 );
17081       if (!SWIG_IsOK(res)) {
17082         do_confess(WRONG_CLASS, 1);
17083       }
17084       arg1 = reinterpret_cast< GDALDatasetShadow * >(argp);
17085       if (arg1 == NULL)
17086       do_confess(NEED_DEF, 1);
17087     }
17088     if (items > 1) {
17089       ecode2 = SWIG_AsVal_int SWIG_PERL_CALL_ARGS_2(ST(1), &val2);
17090       if (!SWIG_IsOK(ecode2)) {
17091         SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Dataset_GetLayerByIndex" "', argument " "2"" of type '" "int""'");
17092       }
17093       arg2 = static_cast< int >(val2);
17094     }
17095     {
17096       CPLErrorReset();
17097       result = (OGRLayerShadow *)GDALDatasetShadow_GetLayerByIndex(arg1,arg2);
17098       CPLErr eclass = CPLGetLastErrorType();
17099       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
17100         do_confess( CPLGetLastErrorMsg(), 0 );
17101 
17102 
17103 
17104 
17105 
17106       }
17107 
17108 
17109       /*
17110           Make warnings regular Perl warnings. This duplicates the warning
17111           message if DontUseExceptions() is in effect (it is not by default).
17112           */
17113       if ( eclass == CE_Warning ) {
17114         warn( CPLGetLastErrorMsg(), "%s" );
17115       }
17116 
17117 
17118     }
17119     ST(argvi) = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_OGRLayerShadow, 0 | SWIG_SHADOW); argvi++ ;
17120 
17121 
17122     XSRETURN(argvi);
17123   fail:
17124 
17125 
17126     SWIG_croak_null();
17127   }
17128 }
17129 
17130 
XS(_wrap_Dataset_GetLayerByName)17131 XS(_wrap_Dataset_GetLayerByName) {
17132   {
17133     GDALDatasetShadow *arg1 = (GDALDatasetShadow *) 0 ;
17134     char *arg2 = (char *) 0 ;
17135     U8 *tmpbuf2 = NULL ;
17136     int argvi = 0;
17137     OGRLayerShadow *result = 0 ;
17138     dXSARGS;
17139 
17140     if ((items < 2) || (items > 2)) {
17141       SWIG_croak("Usage: Dataset_GetLayerByName(self,layer_name);");
17142     }
17143     {
17144       /* %typemap(in) (GDALDatasetShadow *) */
17145       void *argp = 0;
17146       int res = SWIG_ConvertPtr(ST(0), &argp, SWIGTYPE_p_GDALDatasetShadow, 0 |  0 );
17147       if (!SWIG_IsOK(res)) {
17148         do_confess(WRONG_CLASS, 1);
17149       }
17150       arg1 = reinterpret_cast< GDALDatasetShadow * >(argp);
17151       if (arg1 == NULL)
17152       do_confess(NEED_DEF, 1);
17153     }
17154     {
17155       /* %typemap(in,numinputs=1) (const char* layer_name) */
17156       arg2 = sv_to_utf8_string(ST(1), &tmpbuf2);
17157     }
17158     {
17159       CPLErrorReset();
17160       result = (OGRLayerShadow *)GDALDatasetShadow_GetLayerByName(arg1,(char const *)arg2);
17161       CPLErr eclass = CPLGetLastErrorType();
17162       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
17163         do_confess( CPLGetLastErrorMsg(), 0 );
17164 
17165 
17166 
17167 
17168 
17169       }
17170 
17171 
17172       /*
17173           Make warnings regular Perl warnings. This duplicates the warning
17174           message if DontUseExceptions() is in effect (it is not by default).
17175           */
17176       if ( eclass == CE_Warning ) {
17177         warn( CPLGetLastErrorMsg(), "%s" );
17178       }
17179 
17180 
17181     }
17182     ST(argvi) = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_OGRLayerShadow, 0 | SWIG_SHADOW); argvi++ ;
17183 
17184     {
17185       /* %typemap(freearg) (const char* layer_name) */
17186       if (tmpbuf2) Safefree(tmpbuf2);
17187     }
17188     XSRETURN(argvi);
17189   fail:
17190 
17191     {
17192       /* %typemap(freearg) (const char* layer_name) */
17193       if (tmpbuf2) Safefree(tmpbuf2);
17194     }
17195     SWIG_croak_null();
17196   }
17197 }
17198 
17199 
XS(_wrap_Dataset_ResetReading)17200 XS(_wrap_Dataset_ResetReading) {
17201   {
17202     GDALDatasetShadow *arg1 = (GDALDatasetShadow *) 0 ;
17203     int argvi = 0;
17204     dXSARGS;
17205 
17206     if ((items < 1) || (items > 1)) {
17207       SWIG_croak("Usage: Dataset_ResetReading(self);");
17208     }
17209     {
17210       /* %typemap(in) (GDALDatasetShadow *) */
17211       void *argp = 0;
17212       int res = SWIG_ConvertPtr(ST(0), &argp, SWIGTYPE_p_GDALDatasetShadow, 0 |  0 );
17213       if (!SWIG_IsOK(res)) {
17214         do_confess(WRONG_CLASS, 1);
17215       }
17216       arg1 = reinterpret_cast< GDALDatasetShadow * >(argp);
17217       if (arg1 == NULL)
17218       do_confess(NEED_DEF, 1);
17219     }
17220     {
17221       CPLErrorReset();
17222       GDALDatasetShadow_ResetReading(arg1);
17223       CPLErr eclass = CPLGetLastErrorType();
17224       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
17225         do_confess( CPLGetLastErrorMsg(), 0 );
17226 
17227 
17228 
17229 
17230 
17231       }
17232 
17233 
17234       /*
17235           Make warnings regular Perl warnings. This duplicates the warning
17236           message if DontUseExceptions() is in effect (it is not by default).
17237           */
17238       if ( eclass == CE_Warning ) {
17239         warn( CPLGetLastErrorMsg(), "%s" );
17240       }
17241 
17242 
17243     }
17244     {
17245       /* %typemap(out) void */
17246     }
17247 
17248     XSRETURN(argvi);
17249   fail:
17250 
17251     SWIG_croak_null();
17252   }
17253 }
17254 
17255 
XS(_wrap_Dataset_GetNextFeature)17256 XS(_wrap_Dataset_GetNextFeature) {
17257   {
17258     GDALDatasetShadow *arg1 = (GDALDatasetShadow *) 0 ;
17259     int argvi = 0;
17260     OGRFeatureShadow *result = 0 ;
17261     dXSARGS;
17262 
17263     if ((items < 1) || (items > 1)) {
17264       SWIG_croak("Usage: Dataset_GetNextFeature(self);");
17265     }
17266     {
17267       /* %typemap(in) (GDALDatasetShadow *) */
17268       void *argp = 0;
17269       int res = SWIG_ConvertPtr(ST(0), &argp, SWIGTYPE_p_GDALDatasetShadow, 0 |  0 );
17270       if (!SWIG_IsOK(res)) {
17271         do_confess(WRONG_CLASS, 1);
17272       }
17273       arg1 = reinterpret_cast< GDALDatasetShadow * >(argp);
17274       if (arg1 == NULL)
17275       do_confess(NEED_DEF, 1);
17276     }
17277     {
17278       CPLErrorReset();
17279       result = (OGRFeatureShadow *)GDALDatasetShadow_GetNextFeature(arg1);
17280       CPLErr eclass = CPLGetLastErrorType();
17281       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
17282         do_confess( CPLGetLastErrorMsg(), 0 );
17283 
17284 
17285 
17286 
17287 
17288       }
17289 
17290 
17291       /*
17292           Make warnings regular Perl warnings. This duplicates the warning
17293           message if DontUseExceptions() is in effect (it is not by default).
17294           */
17295       if ( eclass == CE_Warning ) {
17296         warn( CPLGetLastErrorMsg(), "%s" );
17297       }
17298 
17299 
17300     }
17301     ST(argvi) = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_OGRFeatureShadow, SWIG_OWNER | SWIG_SHADOW); argvi++ ;
17302 
17303     XSRETURN(argvi);
17304   fail:
17305 
17306     SWIG_croak_null();
17307   }
17308 }
17309 
17310 
XS(_wrap_Dataset__TestCapability)17311 XS(_wrap_Dataset__TestCapability) {
17312   {
17313     GDALDatasetShadow *arg1 = (GDALDatasetShadow *) 0 ;
17314     char *arg2 = (char *) 0 ;
17315     int res2 ;
17316     char *buf2 = 0 ;
17317     int alloc2 = 0 ;
17318     int argvi = 0;
17319     bool result;
17320     dXSARGS;
17321 
17322     if ((items < 2) || (items > 2)) {
17323       SWIG_croak("Usage: Dataset__TestCapability(self,cap);");
17324     }
17325     {
17326       /* %typemap(in) (GDALDatasetShadow *) */
17327       void *argp = 0;
17328       int res = SWIG_ConvertPtr(ST(0), &argp, SWIGTYPE_p_GDALDatasetShadow, 0 |  0 );
17329       if (!SWIG_IsOK(res)) {
17330         do_confess(WRONG_CLASS, 1);
17331       }
17332       arg1 = reinterpret_cast< GDALDatasetShadow * >(argp);
17333       if (arg1 == NULL)
17334       do_confess(NEED_DEF, 1);
17335     }
17336     res2 = SWIG_AsCharPtrAndSize(ST(1), &buf2, NULL, &alloc2);
17337     if (!SWIG_IsOK(res2)) {
17338       SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Dataset__TestCapability" "', argument " "2"" of type '" "char const *""'");
17339     }
17340     arg2 = reinterpret_cast< char * >(buf2);
17341     {
17342       /* %typemap(check) (const char *cap) */
17343       if (!arg2)
17344       do_confess(NEED_DEF, 1);
17345     }
17346     {
17347       CPLErrorReset();
17348       result = (bool)GDALDatasetShadow_TestCapability(arg1,(char const *)arg2);
17349       CPLErr eclass = CPLGetLastErrorType();
17350       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
17351         do_confess( CPLGetLastErrorMsg(), 0 );
17352 
17353 
17354 
17355 
17356 
17357       }
17358 
17359 
17360       /*
17361           Make warnings regular Perl warnings. This duplicates the warning
17362           message if DontUseExceptions() is in effect (it is not by default).
17363           */
17364       if ( eclass == CE_Warning ) {
17365         warn( CPLGetLastErrorMsg(), "%s" );
17366       }
17367 
17368 
17369     }
17370     ST(argvi) = SWIG_From_bool  SWIG_PERL_CALL_ARGS_1(static_cast< bool >(result)); argvi++ ;
17371 
17372     if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
17373     XSRETURN(argvi);
17374   fail:
17375 
17376     if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
17377     SWIG_croak_null();
17378   }
17379 }
17380 
17381 
XS(_wrap_Dataset_ExecuteSQL)17382 XS(_wrap_Dataset_ExecuteSQL) {
17383   {
17384     GDALDatasetShadow *arg1 = (GDALDatasetShadow *) 0 ;
17385     char *arg2 = (char *) 0 ;
17386     OGRGeometryShadow *arg3 = (OGRGeometryShadow *) NULL ;
17387     char *arg4 = (char *) "" ;
17388     int res2 ;
17389     char *buf2 = 0 ;
17390     int alloc2 = 0 ;
17391     void *argp3 = 0 ;
17392     int res3 = 0 ;
17393     int res4 ;
17394     char *buf4 = 0 ;
17395     int alloc4 = 0 ;
17396     int argvi = 0;
17397     OGRLayerShadow *result = 0 ;
17398     dXSARGS;
17399 
17400     if ((items < 2) || (items > 4)) {
17401       SWIG_croak("Usage: Dataset_ExecuteSQL(self,statement,spatialFilter,dialect);");
17402     }
17403     {
17404       /* %typemap(in) (GDALDatasetShadow *) */
17405       void *argp = 0;
17406       int res = SWIG_ConvertPtr(ST(0), &argp, SWIGTYPE_p_GDALDatasetShadow, 0 |  0 );
17407       if (!SWIG_IsOK(res)) {
17408         do_confess(WRONG_CLASS, 1);
17409       }
17410       arg1 = reinterpret_cast< GDALDatasetShadow * >(argp);
17411       if (arg1 == NULL)
17412       do_confess(NEED_DEF, 1);
17413     }
17414     res2 = SWIG_AsCharPtrAndSize(ST(1), &buf2, NULL, &alloc2);
17415     if (!SWIG_IsOK(res2)) {
17416       SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Dataset_ExecuteSQL" "', argument " "2"" of type '" "char const *""'");
17417     }
17418     arg2 = reinterpret_cast< char * >(buf2);
17419     if (items > 2) {
17420       res3 = SWIG_ConvertPtr(ST(2), &argp3,SWIGTYPE_p_OGRGeometryShadow, 0 |  0 );
17421       if (!SWIG_IsOK(res3)) {
17422         SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "Dataset_ExecuteSQL" "', argument " "3"" of type '" "OGRGeometryShadow *""'");
17423       }
17424       arg3 = reinterpret_cast< OGRGeometryShadow * >(argp3);
17425     }
17426     if (items > 3) {
17427       res4 = SWIG_AsCharPtrAndSize(ST(3), &buf4, NULL, &alloc4);
17428       if (!SWIG_IsOK(res4)) {
17429         SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "Dataset_ExecuteSQL" "', argument " "4"" of type '" "char const *""'");
17430       }
17431       arg4 = reinterpret_cast< char * >(buf4);
17432     }
17433     {
17434       if (!arg2) {
17435         SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
17436       }
17437     }
17438     {
17439       CPLErrorReset();
17440       result = (OGRLayerShadow *)GDALDatasetShadow_ExecuteSQL(arg1,(char const *)arg2,arg3,(char const *)arg4);
17441       CPLErr eclass = CPLGetLastErrorType();
17442       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
17443         do_confess( CPLGetLastErrorMsg(), 0 );
17444 
17445 
17446 
17447 
17448 
17449       }
17450 
17451 
17452       /*
17453           Make warnings regular Perl warnings. This duplicates the warning
17454           message if DontUseExceptions() is in effect (it is not by default).
17455           */
17456       if ( eclass == CE_Warning ) {
17457         warn( CPLGetLastErrorMsg(), "%s" );
17458       }
17459 
17460 
17461     }
17462     ST(argvi) = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_OGRLayerShadow, 0 | SWIG_SHADOW); argvi++ ;
17463 
17464     if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
17465 
17466     if (alloc4 == SWIG_NEWOBJ) delete[] buf4;
17467     XSRETURN(argvi);
17468   fail:
17469 
17470     if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
17471 
17472     if (alloc4 == SWIG_NEWOBJ) delete[] buf4;
17473     SWIG_croak_null();
17474   }
17475 }
17476 
17477 
XS(_wrap_Dataset__ReleaseResultSet)17478 XS(_wrap_Dataset__ReleaseResultSet) {
17479   {
17480     GDALDatasetShadow *arg1 = (GDALDatasetShadow *) 0 ;
17481     OGRLayerShadow *arg2 = (OGRLayerShadow *) 0 ;
17482     int res2 = 0 ;
17483     int argvi = 0;
17484     dXSARGS;
17485 
17486     if ((items < 2) || (items > 2)) {
17487       SWIG_croak("Usage: Dataset__ReleaseResultSet(self,layer);");
17488     }
17489     {
17490       /* %typemap(in) (GDALDatasetShadow *) */
17491       void *argp = 0;
17492       int res = SWIG_ConvertPtr(ST(0), &argp, SWIGTYPE_p_GDALDatasetShadow, 0 |  0 );
17493       if (!SWIG_IsOK(res)) {
17494         do_confess(WRONG_CLASS, 1);
17495       }
17496       arg1 = reinterpret_cast< GDALDatasetShadow * >(argp);
17497       if (arg1 == NULL)
17498       do_confess(NEED_DEF, 1);
17499     }
17500     res2 = SWIG_ConvertPtr(ST(1), SWIG_as_voidptrptr(&arg2), SWIGTYPE_p_OGRLayerShadow, SWIG_POINTER_DISOWN |  0 );
17501     if (!SWIG_IsOK(res2)) {
17502       SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Dataset__ReleaseResultSet" "', argument " "2"" of type '" "OGRLayerShadow *""'");
17503     }
17504     {
17505       CPLErrorReset();
17506       GDALDatasetShadow_ReleaseResultSet(arg1,arg2);
17507       CPLErr eclass = CPLGetLastErrorType();
17508       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
17509         do_confess( CPLGetLastErrorMsg(), 0 );
17510 
17511 
17512 
17513 
17514 
17515       }
17516 
17517 
17518       /*
17519           Make warnings regular Perl warnings. This duplicates the warning
17520           message if DontUseExceptions() is in effect (it is not by default).
17521           */
17522       if ( eclass == CE_Warning ) {
17523         warn( CPLGetLastErrorMsg(), "%s" );
17524       }
17525 
17526 
17527     }
17528     {
17529       /* %typemap(out) void */
17530     }
17531 
17532 
17533     XSRETURN(argvi);
17534   fail:
17535 
17536 
17537     SWIG_croak_null();
17538   }
17539 }
17540 
17541 
XS(_wrap_Dataset_GetStyleTable)17542 XS(_wrap_Dataset_GetStyleTable) {
17543   {
17544     GDALDatasetShadow *arg1 = (GDALDatasetShadow *) 0 ;
17545     int argvi = 0;
17546     OGRStyleTableShadow *result = 0 ;
17547     dXSARGS;
17548 
17549     if ((items < 1) || (items > 1)) {
17550       SWIG_croak("Usage: Dataset_GetStyleTable(self);");
17551     }
17552     {
17553       /* %typemap(in) (GDALDatasetShadow *) */
17554       void *argp = 0;
17555       int res = SWIG_ConvertPtr(ST(0), &argp, SWIGTYPE_p_GDALDatasetShadow, 0 |  0 );
17556       if (!SWIG_IsOK(res)) {
17557         do_confess(WRONG_CLASS, 1);
17558       }
17559       arg1 = reinterpret_cast< GDALDatasetShadow * >(argp);
17560       if (arg1 == NULL)
17561       do_confess(NEED_DEF, 1);
17562     }
17563     {
17564       CPLErrorReset();
17565       result = (OGRStyleTableShadow *)GDALDatasetShadow_GetStyleTable(arg1);
17566       CPLErr eclass = CPLGetLastErrorType();
17567       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
17568         do_confess( CPLGetLastErrorMsg(), 0 );
17569 
17570 
17571 
17572 
17573 
17574       }
17575 
17576 
17577       /*
17578           Make warnings regular Perl warnings. This duplicates the warning
17579           message if DontUseExceptions() is in effect (it is not by default).
17580           */
17581       if ( eclass == CE_Warning ) {
17582         warn( CPLGetLastErrorMsg(), "%s" );
17583       }
17584 
17585 
17586     }
17587     ST(argvi) = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_OGRStyleTableShadow, 0 | SWIG_SHADOW); argvi++ ;
17588 
17589     XSRETURN(argvi);
17590   fail:
17591 
17592     SWIG_croak_null();
17593   }
17594 }
17595 
17596 
XS(_wrap_Dataset_SetStyleTable)17597 XS(_wrap_Dataset_SetStyleTable) {
17598   {
17599     GDALDatasetShadow *arg1 = (GDALDatasetShadow *) 0 ;
17600     OGRStyleTableShadow *arg2 = (OGRStyleTableShadow *) 0 ;
17601     void *argp2 = 0 ;
17602     int res2 = 0 ;
17603     int argvi = 0;
17604     dXSARGS;
17605 
17606     if ((items < 2) || (items > 2)) {
17607       SWIG_croak("Usage: Dataset_SetStyleTable(self,table);");
17608     }
17609     {
17610       /* %typemap(in) (GDALDatasetShadow *) */
17611       void *argp = 0;
17612       int res = SWIG_ConvertPtr(ST(0), &argp, SWIGTYPE_p_GDALDatasetShadow, 0 |  0 );
17613       if (!SWIG_IsOK(res)) {
17614         do_confess(WRONG_CLASS, 1);
17615       }
17616       arg1 = reinterpret_cast< GDALDatasetShadow * >(argp);
17617       if (arg1 == NULL)
17618       do_confess(NEED_DEF, 1);
17619     }
17620     res2 = SWIG_ConvertPtr(ST(1), &argp2,SWIGTYPE_p_OGRStyleTableShadow, 0 |  0 );
17621     if (!SWIG_IsOK(res2)) {
17622       SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Dataset_SetStyleTable" "', argument " "2"" of type '" "OGRStyleTableShadow *""'");
17623     }
17624     arg2 = reinterpret_cast< OGRStyleTableShadow * >(argp2);
17625     {
17626       CPLErrorReset();
17627       GDALDatasetShadow_SetStyleTable(arg1,arg2);
17628       CPLErr eclass = CPLGetLastErrorType();
17629       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
17630         do_confess( CPLGetLastErrorMsg(), 0 );
17631 
17632 
17633 
17634 
17635 
17636       }
17637 
17638 
17639       /*
17640           Make warnings regular Perl warnings. This duplicates the warning
17641           message if DontUseExceptions() is in effect (it is not by default).
17642           */
17643       if ( eclass == CE_Warning ) {
17644         warn( CPLGetLastErrorMsg(), "%s" );
17645       }
17646 
17647 
17648     }
17649     {
17650       /* %typemap(out) void */
17651     }
17652 
17653 
17654     XSRETURN(argvi);
17655   fail:
17656 
17657 
17658     SWIG_croak_null();
17659   }
17660 }
17661 
17662 
XS(_wrap_Dataset_AbortSQL)17663 XS(_wrap_Dataset_AbortSQL) {
17664   {
17665     GDALDatasetShadow *arg1 = (GDALDatasetShadow *) 0 ;
17666     int argvi = 0;
17667     OGRErr result;
17668     dXSARGS;
17669 
17670     if ((items < 1) || (items > 1)) {
17671       SWIG_croak("Usage: Dataset_AbortSQL(self);");
17672     }
17673     {
17674       /* %typemap(in) (GDALDatasetShadow *) */
17675       void *argp = 0;
17676       int res = SWIG_ConvertPtr(ST(0), &argp, SWIGTYPE_p_GDALDatasetShadow, 0 |  0 );
17677       if (!SWIG_IsOK(res)) {
17678         do_confess(WRONG_CLASS, 1);
17679       }
17680       arg1 = reinterpret_cast< GDALDatasetShadow * >(argp);
17681       if (arg1 == NULL)
17682       do_confess(NEED_DEF, 1);
17683     }
17684     {
17685       CPLErrorReset();
17686       result = (OGRErr)GDALDatasetShadow_AbortSQL(arg1);
17687       CPLErr eclass = CPLGetLastErrorType();
17688       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
17689         do_confess( CPLGetLastErrorMsg(), 0 );
17690 
17691 
17692 
17693 
17694 
17695       }
17696 
17697 
17698       /*
17699           Make warnings regular Perl warnings. This duplicates the warning
17700           message if DontUseExceptions() is in effect (it is not by default).
17701           */
17702       if ( eclass == CE_Warning ) {
17703         warn( CPLGetLastErrorMsg(), "%s" );
17704       }
17705 
17706 
17707     }
17708     {
17709       /* %typemap(out) OGRErr */
17710       if ( result != 0 ) {
17711         const char *err = CPLGetLastErrorMsg();
17712         if (err and *err) do_confess(err, 0); /* this is usually better */
17713         do_confess( OGRErrMessages(result), 1 );
17714       }
17715     }
17716 
17717     XSRETURN(argvi);
17718   fail:
17719 
17720     SWIG_croak_null();
17721   }
17722 }
17723 
17724 
XS(_wrap_Dataset_StartTransaction)17725 XS(_wrap_Dataset_StartTransaction) {
17726   {
17727     GDALDatasetShadow *arg1 = (GDALDatasetShadow *) 0 ;
17728     int arg2 = (int) FALSE ;
17729     int val2 ;
17730     int ecode2 = 0 ;
17731     int argvi = 0;
17732     OGRErr result;
17733     dXSARGS;
17734 
17735     if ((items < 1) || (items > 2)) {
17736       SWIG_croak("Usage: Dataset_StartTransaction(self,force);");
17737     }
17738     {
17739       /* %typemap(in) (GDALDatasetShadow *) */
17740       void *argp = 0;
17741       int res = SWIG_ConvertPtr(ST(0), &argp, SWIGTYPE_p_GDALDatasetShadow, 0 |  0 );
17742       if (!SWIG_IsOK(res)) {
17743         do_confess(WRONG_CLASS, 1);
17744       }
17745       arg1 = reinterpret_cast< GDALDatasetShadow * >(argp);
17746       if (arg1 == NULL)
17747       do_confess(NEED_DEF, 1);
17748     }
17749     if (items > 1) {
17750       ecode2 = SWIG_AsVal_int SWIG_PERL_CALL_ARGS_2(ST(1), &val2);
17751       if (!SWIG_IsOK(ecode2)) {
17752         SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Dataset_StartTransaction" "', argument " "2"" of type '" "int""'");
17753       }
17754       arg2 = static_cast< int >(val2);
17755     }
17756     {
17757       CPLErrorReset();
17758       result = (OGRErr)GDALDatasetShadow_StartTransaction(arg1,arg2);
17759       CPLErr eclass = CPLGetLastErrorType();
17760       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
17761         do_confess( CPLGetLastErrorMsg(), 0 );
17762 
17763 
17764 
17765 
17766 
17767       }
17768 
17769 
17770       /*
17771           Make warnings regular Perl warnings. This duplicates the warning
17772           message if DontUseExceptions() is in effect (it is not by default).
17773           */
17774       if ( eclass == CE_Warning ) {
17775         warn( CPLGetLastErrorMsg(), "%s" );
17776       }
17777 
17778 
17779     }
17780     {
17781       /* %typemap(out) OGRErr */
17782       if ( result != 0 ) {
17783         const char *err = CPLGetLastErrorMsg();
17784         if (err and *err) do_confess(err, 0); /* this is usually better */
17785         do_confess( OGRErrMessages(result), 1 );
17786       }
17787     }
17788 
17789 
17790     XSRETURN(argvi);
17791   fail:
17792 
17793 
17794     SWIG_croak_null();
17795   }
17796 }
17797 
17798 
XS(_wrap_Dataset_CommitTransaction)17799 XS(_wrap_Dataset_CommitTransaction) {
17800   {
17801     GDALDatasetShadow *arg1 = (GDALDatasetShadow *) 0 ;
17802     int argvi = 0;
17803     OGRErr result;
17804     dXSARGS;
17805 
17806     if ((items < 1) || (items > 1)) {
17807       SWIG_croak("Usage: Dataset_CommitTransaction(self);");
17808     }
17809     {
17810       /* %typemap(in) (GDALDatasetShadow *) */
17811       void *argp = 0;
17812       int res = SWIG_ConvertPtr(ST(0), &argp, SWIGTYPE_p_GDALDatasetShadow, 0 |  0 );
17813       if (!SWIG_IsOK(res)) {
17814         do_confess(WRONG_CLASS, 1);
17815       }
17816       arg1 = reinterpret_cast< GDALDatasetShadow * >(argp);
17817       if (arg1 == NULL)
17818       do_confess(NEED_DEF, 1);
17819     }
17820     {
17821       CPLErrorReset();
17822       result = (OGRErr)GDALDatasetShadow_CommitTransaction(arg1);
17823       CPLErr eclass = CPLGetLastErrorType();
17824       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
17825         do_confess( CPLGetLastErrorMsg(), 0 );
17826 
17827 
17828 
17829 
17830 
17831       }
17832 
17833 
17834       /*
17835           Make warnings regular Perl warnings. This duplicates the warning
17836           message if DontUseExceptions() is in effect (it is not by default).
17837           */
17838       if ( eclass == CE_Warning ) {
17839         warn( CPLGetLastErrorMsg(), "%s" );
17840       }
17841 
17842 
17843     }
17844     {
17845       /* %typemap(out) OGRErr */
17846       if ( result != 0 ) {
17847         const char *err = CPLGetLastErrorMsg();
17848         if (err and *err) do_confess(err, 0); /* this is usually better */
17849         do_confess( OGRErrMessages(result), 1 );
17850       }
17851     }
17852 
17853     XSRETURN(argvi);
17854   fail:
17855 
17856     SWIG_croak_null();
17857   }
17858 }
17859 
17860 
XS(_wrap_Dataset_RollbackTransaction)17861 XS(_wrap_Dataset_RollbackTransaction) {
17862   {
17863     GDALDatasetShadow *arg1 = (GDALDatasetShadow *) 0 ;
17864     int argvi = 0;
17865     OGRErr result;
17866     dXSARGS;
17867 
17868     if ((items < 1) || (items > 1)) {
17869       SWIG_croak("Usage: Dataset_RollbackTransaction(self);");
17870     }
17871     {
17872       /* %typemap(in) (GDALDatasetShadow *) */
17873       void *argp = 0;
17874       int res = SWIG_ConvertPtr(ST(0), &argp, SWIGTYPE_p_GDALDatasetShadow, 0 |  0 );
17875       if (!SWIG_IsOK(res)) {
17876         do_confess(WRONG_CLASS, 1);
17877       }
17878       arg1 = reinterpret_cast< GDALDatasetShadow * >(argp);
17879       if (arg1 == NULL)
17880       do_confess(NEED_DEF, 1);
17881     }
17882     {
17883       CPLErrorReset();
17884       result = (OGRErr)GDALDatasetShadow_RollbackTransaction(arg1);
17885       CPLErr eclass = CPLGetLastErrorType();
17886       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
17887         do_confess( CPLGetLastErrorMsg(), 0 );
17888 
17889 
17890 
17891 
17892 
17893       }
17894 
17895 
17896       /*
17897           Make warnings regular Perl warnings. This duplicates the warning
17898           message if DontUseExceptions() is in effect (it is not by default).
17899           */
17900       if ( eclass == CE_Warning ) {
17901         warn( CPLGetLastErrorMsg(), "%s" );
17902       }
17903 
17904 
17905     }
17906     {
17907       /* %typemap(out) OGRErr */
17908       if ( result != 0 ) {
17909         const char *err = CPLGetLastErrorMsg();
17910         if (err and *err) do_confess(err, 0); /* this is usually better */
17911         do_confess( OGRErrMessages(result), 1 );
17912       }
17913     }
17914 
17915     XSRETURN(argvi);
17916   fail:
17917 
17918     SWIG_croak_null();
17919   }
17920 }
17921 
17922 
XS(_wrap_Dataset_ClearStatistics)17923 XS(_wrap_Dataset_ClearStatistics) {
17924   {
17925     GDALDatasetShadow *arg1 = (GDALDatasetShadow *) 0 ;
17926     int argvi = 0;
17927     dXSARGS;
17928 
17929     if ((items < 1) || (items > 1)) {
17930       SWIG_croak("Usage: Dataset_ClearStatistics(self);");
17931     }
17932     {
17933       /* %typemap(in) (GDALDatasetShadow *) */
17934       void *argp = 0;
17935       int res = SWIG_ConvertPtr(ST(0), &argp, SWIGTYPE_p_GDALDatasetShadow, 0 |  0 );
17936       if (!SWIG_IsOK(res)) {
17937         do_confess(WRONG_CLASS, 1);
17938       }
17939       arg1 = reinterpret_cast< GDALDatasetShadow * >(argp);
17940       if (arg1 == NULL)
17941       do_confess(NEED_DEF, 1);
17942     }
17943     {
17944       CPLErrorReset();
17945       GDALDatasetShadow_ClearStatistics(arg1);
17946       CPLErr eclass = CPLGetLastErrorType();
17947       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
17948         do_confess( CPLGetLastErrorMsg(), 0 );
17949 
17950 
17951 
17952 
17953 
17954       }
17955 
17956 
17957       /*
17958           Make warnings regular Perl warnings. This duplicates the warning
17959           message if DontUseExceptions() is in effect (it is not by default).
17960           */
17961       if ( eclass == CE_Warning ) {
17962         warn( CPLGetLastErrorMsg(), "%s" );
17963       }
17964 
17965 
17966     }
17967     {
17968       /* %typemap(out) void */
17969     }
17970 
17971     XSRETURN(argvi);
17972   fail:
17973 
17974     SWIG_croak_null();
17975   }
17976 }
17977 
17978 
XS(_wrap_Dataset_GetFieldDomain)17979 XS(_wrap_Dataset_GetFieldDomain) {
17980   {
17981     GDALDatasetShadow *arg1 = (GDALDatasetShadow *) 0 ;
17982     char *arg2 = (char *) 0 ;
17983     int res2 ;
17984     char *buf2 = 0 ;
17985     int alloc2 = 0 ;
17986     int argvi = 0;
17987     OGRFieldDomainShadow *result = 0 ;
17988     dXSARGS;
17989 
17990     if ((items < 2) || (items > 2)) {
17991       SWIG_croak("Usage: Dataset_GetFieldDomain(self,name);");
17992     }
17993     {
17994       /* %typemap(in) (GDALDatasetShadow *) */
17995       void *argp = 0;
17996       int res = SWIG_ConvertPtr(ST(0), &argp, SWIGTYPE_p_GDALDatasetShadow, 0 |  0 );
17997       if (!SWIG_IsOK(res)) {
17998         do_confess(WRONG_CLASS, 1);
17999       }
18000       arg1 = reinterpret_cast< GDALDatasetShadow * >(argp);
18001       if (arg1 == NULL)
18002       do_confess(NEED_DEF, 1);
18003     }
18004     res2 = SWIG_AsCharPtrAndSize(ST(1), &buf2, NULL, &alloc2);
18005     if (!SWIG_IsOK(res2)) {
18006       SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Dataset_GetFieldDomain" "', argument " "2"" of type '" "char const *""'");
18007     }
18008     arg2 = reinterpret_cast< char * >(buf2);
18009     {
18010       if (!arg2) {
18011         SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
18012       }
18013     }
18014     {
18015       CPLErrorReset();
18016       result = (OGRFieldDomainShadow *)GDALDatasetShadow_GetFieldDomain(arg1,(char const *)arg2);
18017       CPLErr eclass = CPLGetLastErrorType();
18018       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
18019         do_confess( CPLGetLastErrorMsg(), 0 );
18020 
18021 
18022 
18023 
18024 
18025       }
18026 
18027 
18028       /*
18029           Make warnings regular Perl warnings. This duplicates the warning
18030           message if DontUseExceptions() is in effect (it is not by default).
18031           */
18032       if ( eclass == CE_Warning ) {
18033         warn( CPLGetLastErrorMsg(), "%s" );
18034       }
18035 
18036 
18037     }
18038     ST(argvi) = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_OGRFieldDomainShadow, 0 | SWIG_SHADOW); argvi++ ;
18039 
18040     if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
18041     XSRETURN(argvi);
18042   fail:
18043 
18044     if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
18045     SWIG_croak_null();
18046   }
18047 }
18048 
18049 
XS(_wrap_Dataset_AddFieldDomain)18050 XS(_wrap_Dataset_AddFieldDomain) {
18051   {
18052     GDALDatasetShadow *arg1 = (GDALDatasetShadow *) 0 ;
18053     OGRFieldDomainShadow *arg2 = (OGRFieldDomainShadow *) 0 ;
18054     void *argp2 = 0 ;
18055     int res2 = 0 ;
18056     int argvi = 0;
18057     bool result;
18058     dXSARGS;
18059 
18060     if ((items < 2) || (items > 2)) {
18061       SWIG_croak("Usage: Dataset_AddFieldDomain(self,fieldDomain);");
18062     }
18063     {
18064       /* %typemap(in) (GDALDatasetShadow *) */
18065       void *argp = 0;
18066       int res = SWIG_ConvertPtr(ST(0), &argp, SWIGTYPE_p_GDALDatasetShadow, 0 |  0 );
18067       if (!SWIG_IsOK(res)) {
18068         do_confess(WRONG_CLASS, 1);
18069       }
18070       arg1 = reinterpret_cast< GDALDatasetShadow * >(argp);
18071       if (arg1 == NULL)
18072       do_confess(NEED_DEF, 1);
18073     }
18074     res2 = SWIG_ConvertPtr(ST(1), &argp2,SWIGTYPE_p_OGRFieldDomainShadow, 0 |  0 );
18075     if (!SWIG_IsOK(res2)) {
18076       SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Dataset_AddFieldDomain" "', argument " "2"" of type '" "OGRFieldDomainShadow *""'");
18077     }
18078     arg2 = reinterpret_cast< OGRFieldDomainShadow * >(argp2);
18079     {
18080       if (!arg2) {
18081         SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
18082       }
18083     }
18084     {
18085       CPLErrorReset();
18086       result = (bool)GDALDatasetShadow_AddFieldDomain(arg1,arg2);
18087       CPLErr eclass = CPLGetLastErrorType();
18088       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
18089         do_confess( CPLGetLastErrorMsg(), 0 );
18090 
18091 
18092 
18093 
18094 
18095       }
18096 
18097 
18098       /*
18099           Make warnings regular Perl warnings. This duplicates the warning
18100           message if DontUseExceptions() is in effect (it is not by default).
18101           */
18102       if ( eclass == CE_Warning ) {
18103         warn( CPLGetLastErrorMsg(), "%s" );
18104       }
18105 
18106 
18107     }
18108     ST(argvi) = SWIG_From_bool  SWIG_PERL_CALL_ARGS_1(static_cast< bool >(result)); argvi++ ;
18109 
18110 
18111     XSRETURN(argvi);
18112   fail:
18113 
18114 
18115     SWIG_croak_null();
18116   }
18117 }
18118 
18119 
XS(_wrap_delete_Group)18120 XS(_wrap_delete_Group) {
18121   {
18122     GDALGroupHS *arg1 = (GDALGroupHS *) 0 ;
18123     void *argp1 = 0 ;
18124     int res1 = 0 ;
18125     int argvi = 0;
18126     dXSARGS;
18127 
18128     if ((items < 1) || (items > 1)) {
18129       SWIG_croak("Usage: delete_Group(self);");
18130     }
18131     res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_GDALGroupHS, SWIG_POINTER_DISOWN |  0 );
18132     if (!SWIG_IsOK(res1)) {
18133       SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_Group" "', argument " "1"" of type '" "GDALGroupHS *""'");
18134     }
18135     arg1 = reinterpret_cast< GDALGroupHS * >(argp1);
18136     {
18137       CPLErrorReset();
18138       delete_GDALGroupHS(arg1);
18139       CPLErr eclass = CPLGetLastErrorType();
18140       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
18141         do_confess( CPLGetLastErrorMsg(), 0 );
18142 
18143 
18144 
18145 
18146 
18147       }
18148 
18149 
18150       /*
18151           Make warnings regular Perl warnings. This duplicates the warning
18152           message if DontUseExceptions() is in effect (it is not by default).
18153           */
18154       if ( eclass == CE_Warning ) {
18155         warn( CPLGetLastErrorMsg(), "%s" );
18156       }
18157 
18158 
18159     }
18160     {
18161       /* %typemap(out) void */
18162     }
18163 
18164     XSRETURN(argvi);
18165   fail:
18166 
18167     SWIG_croak_null();
18168   }
18169 }
18170 
18171 
XS(_wrap_Group_GetName)18172 XS(_wrap_Group_GetName) {
18173   {
18174     GDALGroupHS *arg1 = (GDALGroupHS *) 0 ;
18175     void *argp1 = 0 ;
18176     int res1 = 0 ;
18177     int argvi = 0;
18178     char *result = 0 ;
18179     dXSARGS;
18180 
18181     if ((items < 1) || (items > 1)) {
18182       SWIG_croak("Usage: Group_GetName(self);");
18183     }
18184     res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_GDALGroupHS, 0 |  0 );
18185     if (!SWIG_IsOK(res1)) {
18186       SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Group_GetName" "', argument " "1"" of type '" "GDALGroupHS *""'");
18187     }
18188     arg1 = reinterpret_cast< GDALGroupHS * >(argp1);
18189     {
18190       CPLErrorReset();
18191       result = (char *)GDALGroupHS_GetName(arg1);
18192       CPLErr eclass = CPLGetLastErrorType();
18193       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
18194         do_confess( CPLGetLastErrorMsg(), 0 );
18195 
18196 
18197 
18198 
18199 
18200       }
18201 
18202 
18203       /*
18204           Make warnings regular Perl warnings. This duplicates the warning
18205           message if DontUseExceptions() is in effect (it is not by default).
18206           */
18207       if ( eclass == CE_Warning ) {
18208         warn( CPLGetLastErrorMsg(), "%s" );
18209       }
18210 
18211 
18212     }
18213     {
18214       /* %typemap(out) const char * */
18215       ST(argvi) = newSVpv(result, 0);
18216       SvUTF8_on(ST(argvi)); /* expecting GDAL to give us UTF-8 */
18217       sv_2mortal(ST(argvi));
18218       argvi++;
18219     }
18220 
18221     XSRETURN(argvi);
18222   fail:
18223 
18224     SWIG_croak_null();
18225   }
18226 }
18227 
18228 
XS(_wrap_Group_GetFullName)18229 XS(_wrap_Group_GetFullName) {
18230   {
18231     GDALGroupHS *arg1 = (GDALGroupHS *) 0 ;
18232     void *argp1 = 0 ;
18233     int res1 = 0 ;
18234     int argvi = 0;
18235     char *result = 0 ;
18236     dXSARGS;
18237 
18238     if ((items < 1) || (items > 1)) {
18239       SWIG_croak("Usage: Group_GetFullName(self);");
18240     }
18241     res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_GDALGroupHS, 0 |  0 );
18242     if (!SWIG_IsOK(res1)) {
18243       SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Group_GetFullName" "', argument " "1"" of type '" "GDALGroupHS *""'");
18244     }
18245     arg1 = reinterpret_cast< GDALGroupHS * >(argp1);
18246     {
18247       CPLErrorReset();
18248       result = (char *)GDALGroupHS_GetFullName(arg1);
18249       CPLErr eclass = CPLGetLastErrorType();
18250       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
18251         do_confess( CPLGetLastErrorMsg(), 0 );
18252 
18253 
18254 
18255 
18256 
18257       }
18258 
18259 
18260       /*
18261           Make warnings regular Perl warnings. This duplicates the warning
18262           message if DontUseExceptions() is in effect (it is not by default).
18263           */
18264       if ( eclass == CE_Warning ) {
18265         warn( CPLGetLastErrorMsg(), "%s" );
18266       }
18267 
18268 
18269     }
18270     {
18271       /* %typemap(out) const char * */
18272       ST(argvi) = newSVpv(result, 0);
18273       SvUTF8_on(ST(argvi)); /* expecting GDAL to give us UTF-8 */
18274       sv_2mortal(ST(argvi));
18275       argvi++;
18276     }
18277 
18278     XSRETURN(argvi);
18279   fail:
18280 
18281     SWIG_croak_null();
18282   }
18283 }
18284 
18285 
XS(_wrap_Group_GetMDArrayNames)18286 XS(_wrap_Group_GetMDArrayNames) {
18287   {
18288     GDALGroupHS *arg1 = (GDALGroupHS *) 0 ;
18289     char **arg2 = (char **) 0 ;
18290     void *argp1 = 0 ;
18291     int res1 = 0 ;
18292     int argvi = 0;
18293     char **result = 0 ;
18294     dXSARGS;
18295 
18296     if ((items < 1) || (items > 2)) {
18297       SWIG_croak("Usage: Group_GetMDArrayNames(self,options);");
18298     }
18299     res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_GDALGroupHS, 0 |  0 );
18300     if (!SWIG_IsOK(res1)) {
18301       SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Group_GetMDArrayNames" "', argument " "1"" of type '" "GDALGroupHS *""'");
18302     }
18303     arg1 = reinterpret_cast< GDALGroupHS * >(argp1);
18304     if (items > 1) {
18305       {
18306         /* %typemap(in) char **options */
18307         if (SvOK(ST(1))) {
18308           if (SvROK(ST(1))) {
18309             if (SvTYPE(SvRV(ST(1)))==SVt_PVAV) {
18310               AV *av = (AV*)(SvRV(ST(1)));
18311               for (int i = 0; i < av_len(av)+1; i++) {
18312                 SV *sv = *(av_fetch(av, i, 0));
18313                 bool sf;
18314                 char *tmp = sv_to_utf8_string(sv, NULL, &sf);
18315                 arg2 = CSLAddString(arg2, tmp);
18316                 if (sf) Safefree(tmp); else free(tmp);
18317               }
18318             } else if (SvTYPE(SvRV(ST(1)))==SVt_PVHV) {
18319               HV *hv = (HV*)SvRV(ST(1));
18320               SV *sv;
18321               char *key;
18322               I32 klen;
18323               arg2 = NULL;
18324               hv_iterinit(hv);
18325               while(sv = hv_iternextsv(hv, &key, &klen)) {
18326                 bool sf;
18327                 char *tmp = sv_to_utf8_string(sv, NULL, &sf);
18328                 arg2 = CSLAddNameValue(arg2, key, tmp);
18329                 if (sf) Safefree(tmp); else free(tmp);
18330               }
18331             } else
18332             do_confess(NEED_REF, 1);
18333           } else
18334           do_confess(NEED_REF, 1);
18335         }
18336       }
18337     }
18338     {
18339       CPLErrorReset();
18340       result = (char **)GDALGroupHS_GetMDArrayNames(arg1,arg2);
18341       CPLErr eclass = CPLGetLastErrorType();
18342       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
18343         do_confess( CPLGetLastErrorMsg(), 0 );
18344 
18345 
18346 
18347 
18348 
18349       }
18350 
18351 
18352       /*
18353           Make warnings regular Perl warnings. This duplicates the warning
18354           message if DontUseExceptions() is in effect (it is not by default).
18355           */
18356       if ( eclass == CE_Warning ) {
18357         warn( CPLGetLastErrorMsg(), "%s" );
18358       }
18359 
18360 
18361     }
18362     {
18363       /* %typemap(out) char **CSL */
18364       if (GIMME_V == G_ARRAY) {
18365         if (result) {
18366           int n = CSLCount(result);
18367           EXTEND(SP, argvi+n-items+1);
18368           int i;
18369           for (i = 0; result[i]; i++) {
18370             SV *sv = newSVpv(result[i], 0);
18371             SvUTF8_on(sv); /* expecting GDAL to give us UTF-8 */
18372             ST(argvi++) = sv_2mortal(sv);
18373           }
18374           CSLDestroy(result);
18375         }
18376       } else {
18377         AV *av = (AV*)sv_2mortal((SV*)newAV());
18378         if (result) {
18379           int i;
18380           for (i = 0; result[i]; i++) {
18381             SV *sv = newSVpv(result[i], 0);
18382             SvUTF8_on(sv); /* expecting GDAL to give us UTF-8 */
18383             av_push(av, sv);
18384           }
18385           CSLDestroy(result);
18386         }
18387         ST(argvi) = newRV((SV*)av);
18388         sv_2mortal(ST(argvi));
18389         argvi++;
18390       }
18391     }
18392 
18393     {
18394       /* %typemap(freearg) char **options */
18395       if (arg2) CSLDestroy( arg2 );
18396     }
18397     XSRETURN(argvi);
18398   fail:
18399 
18400     {
18401       /* %typemap(freearg) char **options */
18402       if (arg2) CSLDestroy( arg2 );
18403     }
18404     SWIG_croak_null();
18405   }
18406 }
18407 
18408 
XS(_wrap_Group_OpenMDArray)18409 XS(_wrap_Group_OpenMDArray) {
18410   {
18411     GDALGroupHS *arg1 = (GDALGroupHS *) 0 ;
18412     char *arg2 = (char *) 0 ;
18413     char **arg3 = (char **) 0 ;
18414     void *argp1 = 0 ;
18415     int res1 = 0 ;
18416     int res2 ;
18417     char *buf2 = 0 ;
18418     int alloc2 = 0 ;
18419     int argvi = 0;
18420     GDALMDArrayHS *result = 0 ;
18421     dXSARGS;
18422 
18423     if ((items < 2) || (items > 3)) {
18424       SWIG_croak("Usage: Group_OpenMDArray(self,name,options);");
18425     }
18426     res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_GDALGroupHS, 0 |  0 );
18427     if (!SWIG_IsOK(res1)) {
18428       SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Group_OpenMDArray" "', argument " "1"" of type '" "GDALGroupHS *""'");
18429     }
18430     arg1 = reinterpret_cast< GDALGroupHS * >(argp1);
18431     res2 = SWIG_AsCharPtrAndSize(ST(1), &buf2, NULL, &alloc2);
18432     if (!SWIG_IsOK(res2)) {
18433       SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Group_OpenMDArray" "', argument " "2"" of type '" "char const *""'");
18434     }
18435     arg2 = reinterpret_cast< char * >(buf2);
18436     if (items > 2) {
18437       {
18438         /* %typemap(in) char **options */
18439         if (SvOK(ST(2))) {
18440           if (SvROK(ST(2))) {
18441             if (SvTYPE(SvRV(ST(2)))==SVt_PVAV) {
18442               AV *av = (AV*)(SvRV(ST(2)));
18443               for (int i = 0; i < av_len(av)+1; i++) {
18444                 SV *sv = *(av_fetch(av, i, 0));
18445                 bool sf;
18446                 char *tmp = sv_to_utf8_string(sv, NULL, &sf);
18447                 arg3 = CSLAddString(arg3, tmp);
18448                 if (sf) Safefree(tmp); else free(tmp);
18449               }
18450             } else if (SvTYPE(SvRV(ST(2)))==SVt_PVHV) {
18451               HV *hv = (HV*)SvRV(ST(2));
18452               SV *sv;
18453               char *key;
18454               I32 klen;
18455               arg3 = NULL;
18456               hv_iterinit(hv);
18457               while(sv = hv_iternextsv(hv, &key, &klen)) {
18458                 bool sf;
18459                 char *tmp = sv_to_utf8_string(sv, NULL, &sf);
18460                 arg3 = CSLAddNameValue(arg3, key, tmp);
18461                 if (sf) Safefree(tmp); else free(tmp);
18462               }
18463             } else
18464             do_confess(NEED_REF, 1);
18465           } else
18466           do_confess(NEED_REF, 1);
18467         }
18468       }
18469     }
18470     {
18471       if (!arg2) {
18472         SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
18473       }
18474     }
18475     {
18476       CPLErrorReset();
18477       result = (GDALMDArrayHS *)GDALGroupHS_OpenMDArray(arg1,(char const *)arg2,arg3);
18478       CPLErr eclass = CPLGetLastErrorType();
18479       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
18480         do_confess( CPLGetLastErrorMsg(), 0 );
18481 
18482 
18483 
18484 
18485 
18486       }
18487 
18488 
18489       /*
18490           Make warnings regular Perl warnings. This duplicates the warning
18491           message if DontUseExceptions() is in effect (it is not by default).
18492           */
18493       if ( eclass == CE_Warning ) {
18494         warn( CPLGetLastErrorMsg(), "%s" );
18495       }
18496 
18497 
18498     }
18499     ST(argvi) = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GDALMDArrayHS, SWIG_OWNER | SWIG_SHADOW); argvi++ ;
18500 
18501     if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
18502     {
18503       /* %typemap(freearg) char **options */
18504       if (arg3) CSLDestroy( arg3 );
18505     }
18506     XSRETURN(argvi);
18507   fail:
18508 
18509     if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
18510     {
18511       /* %typemap(freearg) char **options */
18512       if (arg3) CSLDestroy( arg3 );
18513     }
18514     SWIG_croak_null();
18515   }
18516 }
18517 
18518 
XS(_wrap_Group_OpenMDArrayFromFullname)18519 XS(_wrap_Group_OpenMDArrayFromFullname) {
18520   {
18521     GDALGroupHS *arg1 = (GDALGroupHS *) 0 ;
18522     char *arg2 = (char *) 0 ;
18523     char **arg3 = (char **) 0 ;
18524     void *argp1 = 0 ;
18525     int res1 = 0 ;
18526     int res2 ;
18527     char *buf2 = 0 ;
18528     int alloc2 = 0 ;
18529     int argvi = 0;
18530     GDALMDArrayHS *result = 0 ;
18531     dXSARGS;
18532 
18533     if ((items < 2) || (items > 3)) {
18534       SWIG_croak("Usage: Group_OpenMDArrayFromFullname(self,name,options);");
18535     }
18536     res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_GDALGroupHS, 0 |  0 );
18537     if (!SWIG_IsOK(res1)) {
18538       SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Group_OpenMDArrayFromFullname" "', argument " "1"" of type '" "GDALGroupHS *""'");
18539     }
18540     arg1 = reinterpret_cast< GDALGroupHS * >(argp1);
18541     res2 = SWIG_AsCharPtrAndSize(ST(1), &buf2, NULL, &alloc2);
18542     if (!SWIG_IsOK(res2)) {
18543       SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Group_OpenMDArrayFromFullname" "', argument " "2"" of type '" "char const *""'");
18544     }
18545     arg2 = reinterpret_cast< char * >(buf2);
18546     if (items > 2) {
18547       {
18548         /* %typemap(in) char **options */
18549         if (SvOK(ST(2))) {
18550           if (SvROK(ST(2))) {
18551             if (SvTYPE(SvRV(ST(2)))==SVt_PVAV) {
18552               AV *av = (AV*)(SvRV(ST(2)));
18553               for (int i = 0; i < av_len(av)+1; i++) {
18554                 SV *sv = *(av_fetch(av, i, 0));
18555                 bool sf;
18556                 char *tmp = sv_to_utf8_string(sv, NULL, &sf);
18557                 arg3 = CSLAddString(arg3, tmp);
18558                 if (sf) Safefree(tmp); else free(tmp);
18559               }
18560             } else if (SvTYPE(SvRV(ST(2)))==SVt_PVHV) {
18561               HV *hv = (HV*)SvRV(ST(2));
18562               SV *sv;
18563               char *key;
18564               I32 klen;
18565               arg3 = NULL;
18566               hv_iterinit(hv);
18567               while(sv = hv_iternextsv(hv, &key, &klen)) {
18568                 bool sf;
18569                 char *tmp = sv_to_utf8_string(sv, NULL, &sf);
18570                 arg3 = CSLAddNameValue(arg3, key, tmp);
18571                 if (sf) Safefree(tmp); else free(tmp);
18572               }
18573             } else
18574             do_confess(NEED_REF, 1);
18575           } else
18576           do_confess(NEED_REF, 1);
18577         }
18578       }
18579     }
18580     {
18581       if (!arg2) {
18582         SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
18583       }
18584     }
18585     {
18586       CPLErrorReset();
18587       result = (GDALMDArrayHS *)GDALGroupHS_OpenMDArrayFromFullname(arg1,(char const *)arg2,arg3);
18588       CPLErr eclass = CPLGetLastErrorType();
18589       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
18590         do_confess( CPLGetLastErrorMsg(), 0 );
18591 
18592 
18593 
18594 
18595 
18596       }
18597 
18598 
18599       /*
18600           Make warnings regular Perl warnings. This duplicates the warning
18601           message if DontUseExceptions() is in effect (it is not by default).
18602           */
18603       if ( eclass == CE_Warning ) {
18604         warn( CPLGetLastErrorMsg(), "%s" );
18605       }
18606 
18607 
18608     }
18609     ST(argvi) = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GDALMDArrayHS, SWIG_OWNER | SWIG_SHADOW); argvi++ ;
18610 
18611     if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
18612     {
18613       /* %typemap(freearg) char **options */
18614       if (arg3) CSLDestroy( arg3 );
18615     }
18616     XSRETURN(argvi);
18617   fail:
18618 
18619     if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
18620     {
18621       /* %typemap(freearg) char **options */
18622       if (arg3) CSLDestroy( arg3 );
18623     }
18624     SWIG_croak_null();
18625   }
18626 }
18627 
18628 
XS(_wrap_Group_ResolveMDArray)18629 XS(_wrap_Group_ResolveMDArray) {
18630   {
18631     GDALGroupHS *arg1 = (GDALGroupHS *) 0 ;
18632     char *arg2 = (char *) 0 ;
18633     char *arg3 = (char *) 0 ;
18634     char **arg4 = (char **) 0 ;
18635     void *argp1 = 0 ;
18636     int res1 = 0 ;
18637     int res2 ;
18638     char *buf2 = 0 ;
18639     int alloc2 = 0 ;
18640     int res3 ;
18641     char *buf3 = 0 ;
18642     int alloc3 = 0 ;
18643     int argvi = 0;
18644     GDALMDArrayHS *result = 0 ;
18645     dXSARGS;
18646 
18647     if ((items < 3) || (items > 4)) {
18648       SWIG_croak("Usage: Group_ResolveMDArray(self,name,starting_point,options);");
18649     }
18650     res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_GDALGroupHS, 0 |  0 );
18651     if (!SWIG_IsOK(res1)) {
18652       SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Group_ResolveMDArray" "', argument " "1"" of type '" "GDALGroupHS *""'");
18653     }
18654     arg1 = reinterpret_cast< GDALGroupHS * >(argp1);
18655     res2 = SWIG_AsCharPtrAndSize(ST(1), &buf2, NULL, &alloc2);
18656     if (!SWIG_IsOK(res2)) {
18657       SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Group_ResolveMDArray" "', argument " "2"" of type '" "char const *""'");
18658     }
18659     arg2 = reinterpret_cast< char * >(buf2);
18660     res3 = SWIG_AsCharPtrAndSize(ST(2), &buf3, NULL, &alloc3);
18661     if (!SWIG_IsOK(res3)) {
18662       SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "Group_ResolveMDArray" "', argument " "3"" of type '" "char const *""'");
18663     }
18664     arg3 = reinterpret_cast< char * >(buf3);
18665     if (items > 3) {
18666       {
18667         /* %typemap(in) char **options */
18668         if (SvOK(ST(3))) {
18669           if (SvROK(ST(3))) {
18670             if (SvTYPE(SvRV(ST(3)))==SVt_PVAV) {
18671               AV *av = (AV*)(SvRV(ST(3)));
18672               for (int i = 0; i < av_len(av)+1; i++) {
18673                 SV *sv = *(av_fetch(av, i, 0));
18674                 bool sf;
18675                 char *tmp = sv_to_utf8_string(sv, NULL, &sf);
18676                 arg4 = CSLAddString(arg4, tmp);
18677                 if (sf) Safefree(tmp); else free(tmp);
18678               }
18679             } else if (SvTYPE(SvRV(ST(3)))==SVt_PVHV) {
18680               HV *hv = (HV*)SvRV(ST(3));
18681               SV *sv;
18682               char *key;
18683               I32 klen;
18684               arg4 = NULL;
18685               hv_iterinit(hv);
18686               while(sv = hv_iternextsv(hv, &key, &klen)) {
18687                 bool sf;
18688                 char *tmp = sv_to_utf8_string(sv, NULL, &sf);
18689                 arg4 = CSLAddNameValue(arg4, key, tmp);
18690                 if (sf) Safefree(tmp); else free(tmp);
18691               }
18692             } else
18693             do_confess(NEED_REF, 1);
18694           } else
18695           do_confess(NEED_REF, 1);
18696         }
18697       }
18698     }
18699     {
18700       if (!arg2) {
18701         SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
18702       }
18703     }
18704     {
18705       CPLErrorReset();
18706       result = (GDALMDArrayHS *)GDALGroupHS_ResolveMDArray(arg1,(char const *)arg2,(char const *)arg3,arg4);
18707       CPLErr eclass = CPLGetLastErrorType();
18708       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
18709         do_confess( CPLGetLastErrorMsg(), 0 );
18710 
18711 
18712 
18713 
18714 
18715       }
18716 
18717 
18718       /*
18719           Make warnings regular Perl warnings. This duplicates the warning
18720           message if DontUseExceptions() is in effect (it is not by default).
18721           */
18722       if ( eclass == CE_Warning ) {
18723         warn( CPLGetLastErrorMsg(), "%s" );
18724       }
18725 
18726 
18727     }
18728     ST(argvi) = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GDALMDArrayHS, SWIG_OWNER | SWIG_SHADOW); argvi++ ;
18729 
18730     if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
18731     if (alloc3 == SWIG_NEWOBJ) delete[] buf3;
18732     {
18733       /* %typemap(freearg) char **options */
18734       if (arg4) CSLDestroy( arg4 );
18735     }
18736     XSRETURN(argvi);
18737   fail:
18738 
18739     if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
18740     if (alloc3 == SWIG_NEWOBJ) delete[] buf3;
18741     {
18742       /* %typemap(freearg) char **options */
18743       if (arg4) CSLDestroy( arg4 );
18744     }
18745     SWIG_croak_null();
18746   }
18747 }
18748 
18749 
XS(_wrap_Group_GetGroupNames)18750 XS(_wrap_Group_GetGroupNames) {
18751   {
18752     GDALGroupHS *arg1 = (GDALGroupHS *) 0 ;
18753     char **arg2 = (char **) 0 ;
18754     void *argp1 = 0 ;
18755     int res1 = 0 ;
18756     int argvi = 0;
18757     char **result = 0 ;
18758     dXSARGS;
18759 
18760     if ((items < 1) || (items > 2)) {
18761       SWIG_croak("Usage: Group_GetGroupNames(self,options);");
18762     }
18763     res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_GDALGroupHS, 0 |  0 );
18764     if (!SWIG_IsOK(res1)) {
18765       SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Group_GetGroupNames" "', argument " "1"" of type '" "GDALGroupHS *""'");
18766     }
18767     arg1 = reinterpret_cast< GDALGroupHS * >(argp1);
18768     if (items > 1) {
18769       {
18770         /* %typemap(in) char **options */
18771         if (SvOK(ST(1))) {
18772           if (SvROK(ST(1))) {
18773             if (SvTYPE(SvRV(ST(1)))==SVt_PVAV) {
18774               AV *av = (AV*)(SvRV(ST(1)));
18775               for (int i = 0; i < av_len(av)+1; i++) {
18776                 SV *sv = *(av_fetch(av, i, 0));
18777                 bool sf;
18778                 char *tmp = sv_to_utf8_string(sv, NULL, &sf);
18779                 arg2 = CSLAddString(arg2, tmp);
18780                 if (sf) Safefree(tmp); else free(tmp);
18781               }
18782             } else if (SvTYPE(SvRV(ST(1)))==SVt_PVHV) {
18783               HV *hv = (HV*)SvRV(ST(1));
18784               SV *sv;
18785               char *key;
18786               I32 klen;
18787               arg2 = NULL;
18788               hv_iterinit(hv);
18789               while(sv = hv_iternextsv(hv, &key, &klen)) {
18790                 bool sf;
18791                 char *tmp = sv_to_utf8_string(sv, NULL, &sf);
18792                 arg2 = CSLAddNameValue(arg2, key, tmp);
18793                 if (sf) Safefree(tmp); else free(tmp);
18794               }
18795             } else
18796             do_confess(NEED_REF, 1);
18797           } else
18798           do_confess(NEED_REF, 1);
18799         }
18800       }
18801     }
18802     {
18803       CPLErrorReset();
18804       result = (char **)GDALGroupHS_GetGroupNames(arg1,arg2);
18805       CPLErr eclass = CPLGetLastErrorType();
18806       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
18807         do_confess( CPLGetLastErrorMsg(), 0 );
18808 
18809 
18810 
18811 
18812 
18813       }
18814 
18815 
18816       /*
18817           Make warnings regular Perl warnings. This duplicates the warning
18818           message if DontUseExceptions() is in effect (it is not by default).
18819           */
18820       if ( eclass == CE_Warning ) {
18821         warn( CPLGetLastErrorMsg(), "%s" );
18822       }
18823 
18824 
18825     }
18826     {
18827       /* %typemap(out) char **CSL */
18828       if (GIMME_V == G_ARRAY) {
18829         if (result) {
18830           int n = CSLCount(result);
18831           EXTEND(SP, argvi+n-items+1);
18832           int i;
18833           for (i = 0; result[i]; i++) {
18834             SV *sv = newSVpv(result[i], 0);
18835             SvUTF8_on(sv); /* expecting GDAL to give us UTF-8 */
18836             ST(argvi++) = sv_2mortal(sv);
18837           }
18838           CSLDestroy(result);
18839         }
18840       } else {
18841         AV *av = (AV*)sv_2mortal((SV*)newAV());
18842         if (result) {
18843           int i;
18844           for (i = 0; result[i]; i++) {
18845             SV *sv = newSVpv(result[i], 0);
18846             SvUTF8_on(sv); /* expecting GDAL to give us UTF-8 */
18847             av_push(av, sv);
18848           }
18849           CSLDestroy(result);
18850         }
18851         ST(argvi) = newRV((SV*)av);
18852         sv_2mortal(ST(argvi));
18853         argvi++;
18854       }
18855     }
18856 
18857     {
18858       /* %typemap(freearg) char **options */
18859       if (arg2) CSLDestroy( arg2 );
18860     }
18861     XSRETURN(argvi);
18862   fail:
18863 
18864     {
18865       /* %typemap(freearg) char **options */
18866       if (arg2) CSLDestroy( arg2 );
18867     }
18868     SWIG_croak_null();
18869   }
18870 }
18871 
18872 
XS(_wrap_Group_OpenGroup)18873 XS(_wrap_Group_OpenGroup) {
18874   {
18875     GDALGroupHS *arg1 = (GDALGroupHS *) 0 ;
18876     char *arg2 = (char *) 0 ;
18877     char **arg3 = (char **) 0 ;
18878     void *argp1 = 0 ;
18879     int res1 = 0 ;
18880     int res2 ;
18881     char *buf2 = 0 ;
18882     int alloc2 = 0 ;
18883     int argvi = 0;
18884     GDALGroupHS *result = 0 ;
18885     dXSARGS;
18886 
18887     if ((items < 2) || (items > 3)) {
18888       SWIG_croak("Usage: Group_OpenGroup(self,name,options);");
18889     }
18890     res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_GDALGroupHS, 0 |  0 );
18891     if (!SWIG_IsOK(res1)) {
18892       SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Group_OpenGroup" "', argument " "1"" of type '" "GDALGroupHS *""'");
18893     }
18894     arg1 = reinterpret_cast< GDALGroupHS * >(argp1);
18895     res2 = SWIG_AsCharPtrAndSize(ST(1), &buf2, NULL, &alloc2);
18896     if (!SWIG_IsOK(res2)) {
18897       SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Group_OpenGroup" "', argument " "2"" of type '" "char const *""'");
18898     }
18899     arg2 = reinterpret_cast< char * >(buf2);
18900     if (items > 2) {
18901       {
18902         /* %typemap(in) char **options */
18903         if (SvOK(ST(2))) {
18904           if (SvROK(ST(2))) {
18905             if (SvTYPE(SvRV(ST(2)))==SVt_PVAV) {
18906               AV *av = (AV*)(SvRV(ST(2)));
18907               for (int i = 0; i < av_len(av)+1; i++) {
18908                 SV *sv = *(av_fetch(av, i, 0));
18909                 bool sf;
18910                 char *tmp = sv_to_utf8_string(sv, NULL, &sf);
18911                 arg3 = CSLAddString(arg3, tmp);
18912                 if (sf) Safefree(tmp); else free(tmp);
18913               }
18914             } else if (SvTYPE(SvRV(ST(2)))==SVt_PVHV) {
18915               HV *hv = (HV*)SvRV(ST(2));
18916               SV *sv;
18917               char *key;
18918               I32 klen;
18919               arg3 = NULL;
18920               hv_iterinit(hv);
18921               while(sv = hv_iternextsv(hv, &key, &klen)) {
18922                 bool sf;
18923                 char *tmp = sv_to_utf8_string(sv, NULL, &sf);
18924                 arg3 = CSLAddNameValue(arg3, key, tmp);
18925                 if (sf) Safefree(tmp); else free(tmp);
18926               }
18927             } else
18928             do_confess(NEED_REF, 1);
18929           } else
18930           do_confess(NEED_REF, 1);
18931         }
18932       }
18933     }
18934     {
18935       if (!arg2) {
18936         SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
18937       }
18938     }
18939     {
18940       CPLErrorReset();
18941       result = (GDALGroupHS *)GDALGroupHS_OpenGroup(arg1,(char const *)arg2,arg3);
18942       CPLErr eclass = CPLGetLastErrorType();
18943       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
18944         do_confess( CPLGetLastErrorMsg(), 0 );
18945 
18946 
18947 
18948 
18949 
18950       }
18951 
18952 
18953       /*
18954           Make warnings regular Perl warnings. This duplicates the warning
18955           message if DontUseExceptions() is in effect (it is not by default).
18956           */
18957       if ( eclass == CE_Warning ) {
18958         warn( CPLGetLastErrorMsg(), "%s" );
18959       }
18960 
18961 
18962     }
18963     ST(argvi) = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GDALGroupHS, SWIG_OWNER | SWIG_SHADOW); argvi++ ;
18964 
18965     if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
18966     {
18967       /* %typemap(freearg) char **options */
18968       if (arg3) CSLDestroy( arg3 );
18969     }
18970     XSRETURN(argvi);
18971   fail:
18972 
18973     if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
18974     {
18975       /* %typemap(freearg) char **options */
18976       if (arg3) CSLDestroy( arg3 );
18977     }
18978     SWIG_croak_null();
18979   }
18980 }
18981 
18982 
XS(_wrap_Group_OpenGroupFromFullname)18983 XS(_wrap_Group_OpenGroupFromFullname) {
18984   {
18985     GDALGroupHS *arg1 = (GDALGroupHS *) 0 ;
18986     char *arg2 = (char *) 0 ;
18987     char **arg3 = (char **) 0 ;
18988     void *argp1 = 0 ;
18989     int res1 = 0 ;
18990     int res2 ;
18991     char *buf2 = 0 ;
18992     int alloc2 = 0 ;
18993     int argvi = 0;
18994     GDALGroupHS *result = 0 ;
18995     dXSARGS;
18996 
18997     if ((items < 2) || (items > 3)) {
18998       SWIG_croak("Usage: Group_OpenGroupFromFullname(self,name,options);");
18999     }
19000     res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_GDALGroupHS, 0 |  0 );
19001     if (!SWIG_IsOK(res1)) {
19002       SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Group_OpenGroupFromFullname" "', argument " "1"" of type '" "GDALGroupHS *""'");
19003     }
19004     arg1 = reinterpret_cast< GDALGroupHS * >(argp1);
19005     res2 = SWIG_AsCharPtrAndSize(ST(1), &buf2, NULL, &alloc2);
19006     if (!SWIG_IsOK(res2)) {
19007       SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Group_OpenGroupFromFullname" "', argument " "2"" of type '" "char const *""'");
19008     }
19009     arg2 = reinterpret_cast< char * >(buf2);
19010     if (items > 2) {
19011       {
19012         /* %typemap(in) char **options */
19013         if (SvOK(ST(2))) {
19014           if (SvROK(ST(2))) {
19015             if (SvTYPE(SvRV(ST(2)))==SVt_PVAV) {
19016               AV *av = (AV*)(SvRV(ST(2)));
19017               for (int i = 0; i < av_len(av)+1; i++) {
19018                 SV *sv = *(av_fetch(av, i, 0));
19019                 bool sf;
19020                 char *tmp = sv_to_utf8_string(sv, NULL, &sf);
19021                 arg3 = CSLAddString(arg3, tmp);
19022                 if (sf) Safefree(tmp); else free(tmp);
19023               }
19024             } else if (SvTYPE(SvRV(ST(2)))==SVt_PVHV) {
19025               HV *hv = (HV*)SvRV(ST(2));
19026               SV *sv;
19027               char *key;
19028               I32 klen;
19029               arg3 = NULL;
19030               hv_iterinit(hv);
19031               while(sv = hv_iternextsv(hv, &key, &klen)) {
19032                 bool sf;
19033                 char *tmp = sv_to_utf8_string(sv, NULL, &sf);
19034                 arg3 = CSLAddNameValue(arg3, key, tmp);
19035                 if (sf) Safefree(tmp); else free(tmp);
19036               }
19037             } else
19038             do_confess(NEED_REF, 1);
19039           } else
19040           do_confess(NEED_REF, 1);
19041         }
19042       }
19043     }
19044     {
19045       if (!arg2) {
19046         SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
19047       }
19048     }
19049     {
19050       CPLErrorReset();
19051       result = (GDALGroupHS *)GDALGroupHS_OpenGroupFromFullname(arg1,(char const *)arg2,arg3);
19052       CPLErr eclass = CPLGetLastErrorType();
19053       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
19054         do_confess( CPLGetLastErrorMsg(), 0 );
19055 
19056 
19057 
19058 
19059 
19060       }
19061 
19062 
19063       /*
19064           Make warnings regular Perl warnings. This duplicates the warning
19065           message if DontUseExceptions() is in effect (it is not by default).
19066           */
19067       if ( eclass == CE_Warning ) {
19068         warn( CPLGetLastErrorMsg(), "%s" );
19069       }
19070 
19071 
19072     }
19073     ST(argvi) = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GDALGroupHS, SWIG_OWNER | SWIG_SHADOW); argvi++ ;
19074 
19075     if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
19076     {
19077       /* %typemap(freearg) char **options */
19078       if (arg3) CSLDestroy( arg3 );
19079     }
19080     XSRETURN(argvi);
19081   fail:
19082 
19083     if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
19084     {
19085       /* %typemap(freearg) char **options */
19086       if (arg3) CSLDestroy( arg3 );
19087     }
19088     SWIG_croak_null();
19089   }
19090 }
19091 
19092 
XS(_wrap_Group_GetAttribute)19093 XS(_wrap_Group_GetAttribute) {
19094   {
19095     GDALGroupHS *arg1 = (GDALGroupHS *) 0 ;
19096     char *arg2 = (char *) 0 ;
19097     void *argp1 = 0 ;
19098     int res1 = 0 ;
19099     int res2 ;
19100     char *buf2 = 0 ;
19101     int alloc2 = 0 ;
19102     int argvi = 0;
19103     GDALAttributeHS *result = 0 ;
19104     dXSARGS;
19105 
19106     if ((items < 2) || (items > 2)) {
19107       SWIG_croak("Usage: Group_GetAttribute(self,name);");
19108     }
19109     res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_GDALGroupHS, 0 |  0 );
19110     if (!SWIG_IsOK(res1)) {
19111       SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Group_GetAttribute" "', argument " "1"" of type '" "GDALGroupHS *""'");
19112     }
19113     arg1 = reinterpret_cast< GDALGroupHS * >(argp1);
19114     res2 = SWIG_AsCharPtrAndSize(ST(1), &buf2, NULL, &alloc2);
19115     if (!SWIG_IsOK(res2)) {
19116       SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Group_GetAttribute" "', argument " "2"" of type '" "char const *""'");
19117     }
19118     arg2 = reinterpret_cast< char * >(buf2);
19119     {
19120       if (!arg2) {
19121         SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
19122       }
19123     }
19124     {
19125       CPLErrorReset();
19126       result = (GDALAttributeHS *)GDALGroupHS_GetAttribute(arg1,(char const *)arg2);
19127       CPLErr eclass = CPLGetLastErrorType();
19128       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
19129         do_confess( CPLGetLastErrorMsg(), 0 );
19130 
19131 
19132 
19133 
19134 
19135       }
19136 
19137 
19138       /*
19139           Make warnings regular Perl warnings. This duplicates the warning
19140           message if DontUseExceptions() is in effect (it is not by default).
19141           */
19142       if ( eclass == CE_Warning ) {
19143         warn( CPLGetLastErrorMsg(), "%s" );
19144       }
19145 
19146 
19147     }
19148     ST(argvi) = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GDALAttributeHS, SWIG_OWNER | SWIG_SHADOW); argvi++ ;
19149 
19150     if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
19151     XSRETURN(argvi);
19152   fail:
19153 
19154     if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
19155     SWIG_croak_null();
19156   }
19157 }
19158 
19159 
XS(_wrap_Group_GetStructuralInfo)19160 XS(_wrap_Group_GetStructuralInfo) {
19161   {
19162     GDALGroupHS *arg1 = (GDALGroupHS *) 0 ;
19163     void *argp1 = 0 ;
19164     int res1 = 0 ;
19165     int argvi = 0;
19166     char **result = 0 ;
19167     dXSARGS;
19168 
19169     if ((items < 1) || (items > 1)) {
19170       SWIG_croak("Usage: Group_GetStructuralInfo(self);");
19171     }
19172     res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_GDALGroupHS, 0 |  0 );
19173     if (!SWIG_IsOK(res1)) {
19174       SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Group_GetStructuralInfo" "', argument " "1"" of type '" "GDALGroupHS *""'");
19175     }
19176     arg1 = reinterpret_cast< GDALGroupHS * >(argp1);
19177     {
19178       CPLErrorReset();
19179       result = (char **)GDALGroupHS_GetStructuralInfo(arg1);
19180       CPLErr eclass = CPLGetLastErrorType();
19181       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
19182         do_confess( CPLGetLastErrorMsg(), 0 );
19183 
19184 
19185 
19186 
19187 
19188       }
19189 
19190 
19191       /*
19192           Make warnings regular Perl warnings. This duplicates the warning
19193           message if DontUseExceptions() is in effect (it is not by default).
19194           */
19195       if ( eclass == CE_Warning ) {
19196         warn( CPLGetLastErrorMsg(), "%s" );
19197       }
19198 
19199 
19200     }
19201     {
19202       /* %typemap(out) char **dict */
19203       char **stringarray = result;
19204       HV *hv = (HV*)sv_2mortal((SV*)newHV());
19205       if ( stringarray != NULL ) {
19206         while (*stringarray != NULL ) {
19207           char const *valptr;
19208           char *keyptr;
19209           valptr = CPLParseNameValue( *stringarray, &keyptr );
19210           if ( valptr != 0 ) {
19211             hv_store(hv, keyptr, strlen(keyptr), newSVpv(valptr, strlen(valptr)), 0);
19212             CPLFree( keyptr );
19213           }
19214           stringarray++;
19215         }
19216       }
19217       ST(argvi) = newRV((SV*)hv);
19218       sv_2mortal(ST(argvi));
19219       argvi++;
19220     }
19221 
19222     XSRETURN(argvi);
19223   fail:
19224 
19225     SWIG_croak_null();
19226   }
19227 }
19228 
19229 
XS(_wrap_Group_CreateGroup)19230 XS(_wrap_Group_CreateGroup) {
19231   {
19232     GDALGroupHS *arg1 = (GDALGroupHS *) 0 ;
19233     char *arg2 = (char *) 0 ;
19234     char **arg3 = (char **) 0 ;
19235     void *argp1 = 0 ;
19236     int res1 = 0 ;
19237     int res2 ;
19238     char *buf2 = 0 ;
19239     int alloc2 = 0 ;
19240     int argvi = 0;
19241     GDALGroupHS *result = 0 ;
19242     dXSARGS;
19243 
19244     if ((items < 2) || (items > 3)) {
19245       SWIG_croak("Usage: Group_CreateGroup(self,name,options);");
19246     }
19247     res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_GDALGroupHS, 0 |  0 );
19248     if (!SWIG_IsOK(res1)) {
19249       SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Group_CreateGroup" "', argument " "1"" of type '" "GDALGroupHS *""'");
19250     }
19251     arg1 = reinterpret_cast< GDALGroupHS * >(argp1);
19252     res2 = SWIG_AsCharPtrAndSize(ST(1), &buf2, NULL, &alloc2);
19253     if (!SWIG_IsOK(res2)) {
19254       SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Group_CreateGroup" "', argument " "2"" of type '" "char const *""'");
19255     }
19256     arg2 = reinterpret_cast< char * >(buf2);
19257     if (items > 2) {
19258       {
19259         /* %typemap(in) char **options */
19260         if (SvOK(ST(2))) {
19261           if (SvROK(ST(2))) {
19262             if (SvTYPE(SvRV(ST(2)))==SVt_PVAV) {
19263               AV *av = (AV*)(SvRV(ST(2)));
19264               for (int i = 0; i < av_len(av)+1; i++) {
19265                 SV *sv = *(av_fetch(av, i, 0));
19266                 bool sf;
19267                 char *tmp = sv_to_utf8_string(sv, NULL, &sf);
19268                 arg3 = CSLAddString(arg3, tmp);
19269                 if (sf) Safefree(tmp); else free(tmp);
19270               }
19271             } else if (SvTYPE(SvRV(ST(2)))==SVt_PVHV) {
19272               HV *hv = (HV*)SvRV(ST(2));
19273               SV *sv;
19274               char *key;
19275               I32 klen;
19276               arg3 = NULL;
19277               hv_iterinit(hv);
19278               while(sv = hv_iternextsv(hv, &key, &klen)) {
19279                 bool sf;
19280                 char *tmp = sv_to_utf8_string(sv, NULL, &sf);
19281                 arg3 = CSLAddNameValue(arg3, key, tmp);
19282                 if (sf) Safefree(tmp); else free(tmp);
19283               }
19284             } else
19285             do_confess(NEED_REF, 1);
19286           } else
19287           do_confess(NEED_REF, 1);
19288         }
19289       }
19290     }
19291     {
19292       if (!arg2) {
19293         SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
19294       }
19295     }
19296     {
19297       CPLErrorReset();
19298       result = (GDALGroupHS *)GDALGroupHS_CreateGroup(arg1,(char const *)arg2,arg3);
19299       CPLErr eclass = CPLGetLastErrorType();
19300       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
19301         do_confess( CPLGetLastErrorMsg(), 0 );
19302 
19303 
19304 
19305 
19306 
19307       }
19308 
19309 
19310       /*
19311           Make warnings regular Perl warnings. This duplicates the warning
19312           message if DontUseExceptions() is in effect (it is not by default).
19313           */
19314       if ( eclass == CE_Warning ) {
19315         warn( CPLGetLastErrorMsg(), "%s" );
19316       }
19317 
19318 
19319     }
19320     ST(argvi) = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GDALGroupHS, SWIG_OWNER | SWIG_SHADOW); argvi++ ;
19321 
19322     if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
19323     {
19324       /* %typemap(freearg) char **options */
19325       if (arg3) CSLDestroy( arg3 );
19326     }
19327     XSRETURN(argvi);
19328   fail:
19329 
19330     if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
19331     {
19332       /* %typemap(freearg) char **options */
19333       if (arg3) CSLDestroy( arg3 );
19334     }
19335     SWIG_croak_null();
19336   }
19337 }
19338 
19339 
XS(_wrap_Group_CreateDimension)19340 XS(_wrap_Group_CreateDimension) {
19341   {
19342     GDALGroupHS *arg1 = (GDALGroupHS *) 0 ;
19343     char *arg2 = (char *) 0 ;
19344     char *arg3 = (char *) 0 ;
19345     char *arg4 = (char *) 0 ;
19346     unsigned long long arg5 ;
19347     char **arg6 = (char **) 0 ;
19348     void *argp1 = 0 ;
19349     int res1 = 0 ;
19350     int res2 ;
19351     char *buf2 = 0 ;
19352     int alloc2 = 0 ;
19353     int res3 ;
19354     char *buf3 = 0 ;
19355     int alloc3 = 0 ;
19356     int res4 ;
19357     char *buf4 = 0 ;
19358     int alloc4 = 0 ;
19359     unsigned long long val5 ;
19360     int ecode5 = 0 ;
19361     int argvi = 0;
19362     GDALDimensionHS *result = 0 ;
19363     dXSARGS;
19364 
19365     if ((items < 5) || (items > 6)) {
19366       SWIG_croak("Usage: Group_CreateDimension(self,name,type,direction,size,options);");
19367     }
19368     res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_GDALGroupHS, 0 |  0 );
19369     if (!SWIG_IsOK(res1)) {
19370       SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Group_CreateDimension" "', argument " "1"" of type '" "GDALGroupHS *""'");
19371     }
19372     arg1 = reinterpret_cast< GDALGroupHS * >(argp1);
19373     res2 = SWIG_AsCharPtrAndSize(ST(1), &buf2, NULL, &alloc2);
19374     if (!SWIG_IsOK(res2)) {
19375       SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Group_CreateDimension" "', argument " "2"" of type '" "char const *""'");
19376     }
19377     arg2 = reinterpret_cast< char * >(buf2);
19378     res3 = SWIG_AsCharPtrAndSize(ST(2), &buf3, NULL, &alloc3);
19379     if (!SWIG_IsOK(res3)) {
19380       SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "Group_CreateDimension" "', argument " "3"" of type '" "char const *""'");
19381     }
19382     arg3 = reinterpret_cast< char * >(buf3);
19383     res4 = SWIG_AsCharPtrAndSize(ST(3), &buf4, NULL, &alloc4);
19384     if (!SWIG_IsOK(res4)) {
19385       SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "Group_CreateDimension" "', argument " "4"" of type '" "char const *""'");
19386     }
19387     arg4 = reinterpret_cast< char * >(buf4);
19388     ecode5 = SWIG_AsVal_unsigned_SS_long_SS_long SWIG_PERL_CALL_ARGS_2(ST(4), &val5);
19389     if (!SWIG_IsOK(ecode5)) {
19390       SWIG_exception_fail(SWIG_ArgError(ecode5), "in method '" "Group_CreateDimension" "', argument " "5"" of type '" "unsigned long long""'");
19391     }
19392     arg5 = static_cast< unsigned long long >(val5);
19393     if (items > 5) {
19394       {
19395         /* %typemap(in) char **options */
19396         if (SvOK(ST(5))) {
19397           if (SvROK(ST(5))) {
19398             if (SvTYPE(SvRV(ST(5)))==SVt_PVAV) {
19399               AV *av = (AV*)(SvRV(ST(5)));
19400               for (int i = 0; i < av_len(av)+1; i++) {
19401                 SV *sv = *(av_fetch(av, i, 0));
19402                 bool sf;
19403                 char *tmp = sv_to_utf8_string(sv, NULL, &sf);
19404                 arg6 = CSLAddString(arg6, tmp);
19405                 if (sf) Safefree(tmp); else free(tmp);
19406               }
19407             } else if (SvTYPE(SvRV(ST(5)))==SVt_PVHV) {
19408               HV *hv = (HV*)SvRV(ST(5));
19409               SV *sv;
19410               char *key;
19411               I32 klen;
19412               arg6 = NULL;
19413               hv_iterinit(hv);
19414               while(sv = hv_iternextsv(hv, &key, &klen)) {
19415                 bool sf;
19416                 char *tmp = sv_to_utf8_string(sv, NULL, &sf);
19417                 arg6 = CSLAddNameValue(arg6, key, tmp);
19418                 if (sf) Safefree(tmp); else free(tmp);
19419               }
19420             } else
19421             do_confess(NEED_REF, 1);
19422           } else
19423           do_confess(NEED_REF, 1);
19424         }
19425       }
19426     }
19427     {
19428       if (!arg2) {
19429         SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
19430       }
19431     }
19432     {
19433       CPLErrorReset();
19434       result = (GDALDimensionHS *)GDALGroupHS_CreateDimension(arg1,(char const *)arg2,(char const *)arg3,(char const *)arg4,arg5,arg6);
19435       CPLErr eclass = CPLGetLastErrorType();
19436       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
19437         do_confess( CPLGetLastErrorMsg(), 0 );
19438 
19439 
19440 
19441 
19442 
19443       }
19444 
19445 
19446       /*
19447           Make warnings regular Perl warnings. This duplicates the warning
19448           message if DontUseExceptions() is in effect (it is not by default).
19449           */
19450       if ( eclass == CE_Warning ) {
19451         warn( CPLGetLastErrorMsg(), "%s" );
19452       }
19453 
19454 
19455     }
19456     ST(argvi) = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GDALDimensionHS, SWIG_OWNER | SWIG_SHADOW); argvi++ ;
19457 
19458     if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
19459     if (alloc3 == SWIG_NEWOBJ) delete[] buf3;
19460     if (alloc4 == SWIG_NEWOBJ) delete[] buf4;
19461 
19462     {
19463       /* %typemap(freearg) char **options */
19464       if (arg6) CSLDestroy( arg6 );
19465     }
19466     XSRETURN(argvi);
19467   fail:
19468 
19469     if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
19470     if (alloc3 == SWIG_NEWOBJ) delete[] buf3;
19471     if (alloc4 == SWIG_NEWOBJ) delete[] buf4;
19472 
19473     {
19474       /* %typemap(freearg) char **options */
19475       if (arg6) CSLDestroy( arg6 );
19476     }
19477     SWIG_croak_null();
19478   }
19479 }
19480 
19481 
XS(_wrap_Group_CreateAttribute)19482 XS(_wrap_Group_CreateAttribute) {
19483   {
19484     GDALGroupHS *arg1 = (GDALGroupHS *) 0 ;
19485     char *arg2 = (char *) 0 ;
19486     int arg3 ;
19487     GUIntBig *arg4 = (GUIntBig *) 0 ;
19488     GDALExtendedDataTypeHS *arg5 = (GDALExtendedDataTypeHS *) 0 ;
19489     char **arg6 = (char **) 0 ;
19490     void *argp1 = 0 ;
19491     int res1 = 0 ;
19492     int res2 ;
19493     char *buf2 = 0 ;
19494     int alloc2 = 0 ;
19495     void *argp5 = 0 ;
19496     int res5 = 0 ;
19497     int argvi = 0;
19498     GDALAttributeHS *result = 0 ;
19499     dXSARGS;
19500 
19501     if ((items < 4) || (items > 5)) {
19502       SWIG_croak("Usage: Group_CreateAttribute(self,name,nDimensions,dimensions,data_type,options);");
19503     }
19504     res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_GDALGroupHS, 0 |  0 );
19505     if (!SWIG_IsOK(res1)) {
19506       SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Group_CreateAttribute" "', argument " "1"" of type '" "GDALGroupHS *""'");
19507     }
19508     arg1 = reinterpret_cast< GDALGroupHS * >(argp1);
19509     res2 = SWIG_AsCharPtrAndSize(ST(1), &buf2, NULL, &alloc2);
19510     if (!SWIG_IsOK(res2)) {
19511       SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Group_CreateAttribute" "', argument " "2"" of type '" "char const *""'");
19512     }
19513     arg2 = reinterpret_cast< char * >(buf2);
19514     {
19515       /* %typemap(in,numinputs=1) (int nList, GUIntBig* pList) */
19516       if (!(SvROK(ST(2)) && (SvTYPE(SvRV(ST(2)))==SVt_PVAV)))
19517       do_confess(NEED_ARRAY_REF, 1);
19518       AV *av = (AV*)(SvRV(ST(2)));
19519       arg3 = av_len(av)+1;
19520       arg4 = (GUIntBig*)CPLMalloc(arg3*sizeof(GUIntBig));
19521       if (arg4) {
19522         for( int i = 0; i<arg3; i++ ) {
19523           SV **sv = av_fetch(av, i, 0);
19524           arg4[i] =  CPLScanUIntBig(SvPV_nolen(*sv), 30);
19525         }
19526       } else
19527       SWIG_fail;
19528     }
19529     res5 = SWIG_ConvertPtr(ST(3), &argp5,SWIGTYPE_p_GDALExtendedDataTypeHS, 0 |  0 );
19530     if (!SWIG_IsOK(res5)) {
19531       SWIG_exception_fail(SWIG_ArgError(res5), "in method '" "Group_CreateAttribute" "', argument " "5"" of type '" "GDALExtendedDataTypeHS *""'");
19532     }
19533     arg5 = reinterpret_cast< GDALExtendedDataTypeHS * >(argp5);
19534     if (items > 4) {
19535       {
19536         /* %typemap(in) char **options */
19537         if (SvOK(ST(4))) {
19538           if (SvROK(ST(4))) {
19539             if (SvTYPE(SvRV(ST(4)))==SVt_PVAV) {
19540               AV *av = (AV*)(SvRV(ST(4)));
19541               for (int i = 0; i < av_len(av)+1; i++) {
19542                 SV *sv = *(av_fetch(av, i, 0));
19543                 bool sf;
19544                 char *tmp = sv_to_utf8_string(sv, NULL, &sf);
19545                 arg6 = CSLAddString(arg6, tmp);
19546                 if (sf) Safefree(tmp); else free(tmp);
19547               }
19548             } else if (SvTYPE(SvRV(ST(4)))==SVt_PVHV) {
19549               HV *hv = (HV*)SvRV(ST(4));
19550               SV *sv;
19551               char *key;
19552               I32 klen;
19553               arg6 = NULL;
19554               hv_iterinit(hv);
19555               while(sv = hv_iternextsv(hv, &key, &klen)) {
19556                 bool sf;
19557                 char *tmp = sv_to_utf8_string(sv, NULL, &sf);
19558                 arg6 = CSLAddNameValue(arg6, key, tmp);
19559                 if (sf) Safefree(tmp); else free(tmp);
19560               }
19561             } else
19562             do_confess(NEED_REF, 1);
19563           } else
19564           do_confess(NEED_REF, 1);
19565         }
19566       }
19567     }
19568     {
19569       if (!arg2) {
19570         SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
19571       }
19572     }
19573     {
19574       CPLErrorReset();
19575       result = (GDALAttributeHS *)GDALGroupHS_CreateAttribute(arg1,(char const *)arg2,arg3,arg4,arg5,arg6);
19576       CPLErr eclass = CPLGetLastErrorType();
19577       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
19578         do_confess( CPLGetLastErrorMsg(), 0 );
19579 
19580 
19581 
19582 
19583 
19584       }
19585 
19586 
19587       /*
19588           Make warnings regular Perl warnings. This duplicates the warning
19589           message if DontUseExceptions() is in effect (it is not by default).
19590           */
19591       if ( eclass == CE_Warning ) {
19592         warn( CPLGetLastErrorMsg(), "%s" );
19593       }
19594 
19595 
19596     }
19597     ST(argvi) = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GDALAttributeHS, SWIG_OWNER | SWIG_SHADOW); argvi++ ;
19598 
19599     if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
19600     {
19601       /* %typemap(freearg) (int nList, GUIntBig* pList) */
19602       CPLFree((void*) arg4);
19603     }
19604 
19605     {
19606       /* %typemap(freearg) char **options */
19607       if (arg6) CSLDestroy( arg6 );
19608     }
19609     XSRETURN(argvi);
19610   fail:
19611 
19612     if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
19613     {
19614       /* %typemap(freearg) (int nList, GUIntBig* pList) */
19615       CPLFree((void*) arg4);
19616     }
19617 
19618     {
19619       /* %typemap(freearg) char **options */
19620       if (arg6) CSLDestroy( arg6 );
19621     }
19622     SWIG_croak_null();
19623   }
19624 }
19625 
19626 
XS(_wrap_Statistics_min_get)19627 XS(_wrap_Statistics_min_get) {
19628   {
19629     Statistics *arg1 = (Statistics *) 0 ;
19630     void *argp1 = 0 ;
19631     int res1 = 0 ;
19632     int argvi = 0;
19633     double result;
19634     dXSARGS;
19635 
19636     if ((items < 1) || (items > 1)) {
19637       SWIG_croak("Usage: Statistics_min_get(self);");
19638     }
19639     res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_Statistics, 0 |  0 );
19640     if (!SWIG_IsOK(res1)) {
19641       SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Statistics_min_get" "', argument " "1"" of type '" "Statistics *""'");
19642     }
19643     arg1 = reinterpret_cast< Statistics * >(argp1);
19644     result = (double) ((arg1)->min);
19645     ST(argvi) = SWIG_From_double  SWIG_PERL_CALL_ARGS_1(static_cast< double >(result)); argvi++ ;
19646 
19647     XSRETURN(argvi);
19648   fail:
19649 
19650     SWIG_croak_null();
19651   }
19652 }
19653 
19654 
XS(_wrap_Statistics_max_get)19655 XS(_wrap_Statistics_max_get) {
19656   {
19657     Statistics *arg1 = (Statistics *) 0 ;
19658     void *argp1 = 0 ;
19659     int res1 = 0 ;
19660     int argvi = 0;
19661     double result;
19662     dXSARGS;
19663 
19664     if ((items < 1) || (items > 1)) {
19665       SWIG_croak("Usage: Statistics_max_get(self);");
19666     }
19667     res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_Statistics, 0 |  0 );
19668     if (!SWIG_IsOK(res1)) {
19669       SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Statistics_max_get" "', argument " "1"" of type '" "Statistics *""'");
19670     }
19671     arg1 = reinterpret_cast< Statistics * >(argp1);
19672     result = (double) ((arg1)->max);
19673     ST(argvi) = SWIG_From_double  SWIG_PERL_CALL_ARGS_1(static_cast< double >(result)); argvi++ ;
19674 
19675     XSRETURN(argvi);
19676   fail:
19677 
19678     SWIG_croak_null();
19679   }
19680 }
19681 
19682 
XS(_wrap_Statistics_mean_get)19683 XS(_wrap_Statistics_mean_get) {
19684   {
19685     Statistics *arg1 = (Statistics *) 0 ;
19686     void *argp1 = 0 ;
19687     int res1 = 0 ;
19688     int argvi = 0;
19689     double result;
19690     dXSARGS;
19691 
19692     if ((items < 1) || (items > 1)) {
19693       SWIG_croak("Usage: Statistics_mean_get(self);");
19694     }
19695     res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_Statistics, 0 |  0 );
19696     if (!SWIG_IsOK(res1)) {
19697       SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Statistics_mean_get" "', argument " "1"" of type '" "Statistics *""'");
19698     }
19699     arg1 = reinterpret_cast< Statistics * >(argp1);
19700     result = (double) ((arg1)->mean);
19701     ST(argvi) = SWIG_From_double  SWIG_PERL_CALL_ARGS_1(static_cast< double >(result)); argvi++ ;
19702 
19703     XSRETURN(argvi);
19704   fail:
19705 
19706     SWIG_croak_null();
19707   }
19708 }
19709 
19710 
XS(_wrap_Statistics_std_dev_get)19711 XS(_wrap_Statistics_std_dev_get) {
19712   {
19713     Statistics *arg1 = (Statistics *) 0 ;
19714     void *argp1 = 0 ;
19715     int res1 = 0 ;
19716     int argvi = 0;
19717     double result;
19718     dXSARGS;
19719 
19720     if ((items < 1) || (items > 1)) {
19721       SWIG_croak("Usage: Statistics_std_dev_get(self);");
19722     }
19723     res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_Statistics, 0 |  0 );
19724     if (!SWIG_IsOK(res1)) {
19725       SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Statistics_std_dev_get" "', argument " "1"" of type '" "Statistics *""'");
19726     }
19727     arg1 = reinterpret_cast< Statistics * >(argp1);
19728     result = (double) ((arg1)->std_dev);
19729     ST(argvi) = SWIG_From_double  SWIG_PERL_CALL_ARGS_1(static_cast< double >(result)); argvi++ ;
19730 
19731     XSRETURN(argvi);
19732   fail:
19733 
19734     SWIG_croak_null();
19735   }
19736 }
19737 
19738 
XS(_wrap_Statistics_valid_count_get)19739 XS(_wrap_Statistics_valid_count_get) {
19740   {
19741     Statistics *arg1 = (Statistics *) 0 ;
19742     void *argp1 = 0 ;
19743     int res1 = 0 ;
19744     int argvi = 0;
19745     GIntBig result;
19746     dXSARGS;
19747 
19748     if ((items < 1) || (items > 1)) {
19749       SWIG_croak("Usage: Statistics_valid_count_get(self);");
19750     }
19751     res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_Statistics, 0 |  0 );
19752     if (!SWIG_IsOK(res1)) {
19753       SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Statistics_valid_count_get" "', argument " "1"" of type '" "Statistics *""'");
19754     }
19755     arg1 = reinterpret_cast< Statistics * >(argp1);
19756     result =  ((arg1)->valid_count);
19757     {
19758       char temp[256];
19759       sprintf(temp, "" CPL_FRMT_GIB "", result);
19760       ST(argvi) = sv_2mortal(newSVpv(temp, 0));
19761       argvi++;
19762     }
19763 
19764     XSRETURN(argvi);
19765   fail:
19766 
19767     SWIG_croak_null();
19768   }
19769 }
19770 
19771 
XS(_wrap_delete_Statistics)19772 XS(_wrap_delete_Statistics) {
19773   {
19774     Statistics *arg1 = (Statistics *) 0 ;
19775     void *argp1 = 0 ;
19776     int res1 = 0 ;
19777     int argvi = 0;
19778     dXSARGS;
19779 
19780     if ((items < 1) || (items > 1)) {
19781       SWIG_croak("Usage: delete_Statistics(self);");
19782     }
19783     res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_Statistics, SWIG_POINTER_DISOWN |  0 );
19784     if (!SWIG_IsOK(res1)) {
19785       SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_Statistics" "', argument " "1"" of type '" "Statistics *""'");
19786     }
19787     arg1 = reinterpret_cast< Statistics * >(argp1);
19788     {
19789       CPLErrorReset();
19790       delete_Statistics(arg1);
19791       CPLErr eclass = CPLGetLastErrorType();
19792       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
19793         do_confess( CPLGetLastErrorMsg(), 0 );
19794 
19795 
19796 
19797 
19798 
19799       }
19800 
19801 
19802       /*
19803           Make warnings regular Perl warnings. This duplicates the warning
19804           message if DontUseExceptions() is in effect (it is not by default).
19805           */
19806       if ( eclass == CE_Warning ) {
19807         warn( CPLGetLastErrorMsg(), "%s" );
19808       }
19809 
19810 
19811     }
19812     {
19813       /* %typemap(out) void */
19814     }
19815 
19816     XSRETURN(argvi);
19817   fail:
19818 
19819     SWIG_croak_null();
19820   }
19821 }
19822 
19823 
XS(_wrap_new_Statistics)19824 XS(_wrap_new_Statistics) {
19825   {
19826     int argvi = 0;
19827     Statistics *result = 0 ;
19828     dXSARGS;
19829 
19830     if ((items < 0) || (items > 0)) {
19831       SWIG_croak("Usage: new_Statistics();");
19832     }
19833     {
19834       CPLErrorReset();
19835       result = (Statistics *)new Statistics();
19836       CPLErr eclass = CPLGetLastErrorType();
19837       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
19838         do_confess( CPLGetLastErrorMsg(), 0 );
19839 
19840 
19841 
19842 
19843 
19844       }
19845 
19846 
19847       /*
19848           Make warnings regular Perl warnings. This duplicates the warning
19849           message if DontUseExceptions() is in effect (it is not by default).
19850           */
19851       if ( eclass == CE_Warning ) {
19852         warn( CPLGetLastErrorMsg(), "%s" );
19853       }
19854 
19855 
19856     }
19857     ST(argvi) = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_Statistics, SWIG_OWNER | SWIG_SHADOW); argvi++ ;
19858     XSRETURN(argvi);
19859   fail:
19860     SWIG_croak_null();
19861   }
19862 }
19863 
19864 
XS(_wrap_delete_MDArray)19865 XS(_wrap_delete_MDArray) {
19866   {
19867     GDALMDArrayHS *arg1 = (GDALMDArrayHS *) 0 ;
19868     void *argp1 = 0 ;
19869     int res1 = 0 ;
19870     int argvi = 0;
19871     dXSARGS;
19872 
19873     if ((items < 1) || (items > 1)) {
19874       SWIG_croak("Usage: delete_MDArray(self);");
19875     }
19876     res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_GDALMDArrayHS, SWIG_POINTER_DISOWN |  0 );
19877     if (!SWIG_IsOK(res1)) {
19878       SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_MDArray" "', argument " "1"" of type '" "GDALMDArrayHS *""'");
19879     }
19880     arg1 = reinterpret_cast< GDALMDArrayHS * >(argp1);
19881     {
19882       CPLErrorReset();
19883       delete_GDALMDArrayHS(arg1);
19884       CPLErr eclass = CPLGetLastErrorType();
19885       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
19886         do_confess( CPLGetLastErrorMsg(), 0 );
19887 
19888 
19889 
19890 
19891 
19892       }
19893 
19894 
19895       /*
19896           Make warnings regular Perl warnings. This duplicates the warning
19897           message if DontUseExceptions() is in effect (it is not by default).
19898           */
19899       if ( eclass == CE_Warning ) {
19900         warn( CPLGetLastErrorMsg(), "%s" );
19901       }
19902 
19903 
19904     }
19905     {
19906       /* %typemap(out) void */
19907     }
19908 
19909     XSRETURN(argvi);
19910   fail:
19911 
19912     SWIG_croak_null();
19913   }
19914 }
19915 
19916 
XS(_wrap_MDArray_GetName)19917 XS(_wrap_MDArray_GetName) {
19918   {
19919     GDALMDArrayHS *arg1 = (GDALMDArrayHS *) 0 ;
19920     void *argp1 = 0 ;
19921     int res1 = 0 ;
19922     int argvi = 0;
19923     char *result = 0 ;
19924     dXSARGS;
19925 
19926     if ((items < 1) || (items > 1)) {
19927       SWIG_croak("Usage: MDArray_GetName(self);");
19928     }
19929     res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_GDALMDArrayHS, 0 |  0 );
19930     if (!SWIG_IsOK(res1)) {
19931       SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "MDArray_GetName" "', argument " "1"" of type '" "GDALMDArrayHS *""'");
19932     }
19933     arg1 = reinterpret_cast< GDALMDArrayHS * >(argp1);
19934     {
19935       CPLErrorReset();
19936       result = (char *)GDALMDArrayHS_GetName(arg1);
19937       CPLErr eclass = CPLGetLastErrorType();
19938       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
19939         do_confess( CPLGetLastErrorMsg(), 0 );
19940 
19941 
19942 
19943 
19944 
19945       }
19946 
19947 
19948       /*
19949           Make warnings regular Perl warnings. This duplicates the warning
19950           message if DontUseExceptions() is in effect (it is not by default).
19951           */
19952       if ( eclass == CE_Warning ) {
19953         warn( CPLGetLastErrorMsg(), "%s" );
19954       }
19955 
19956 
19957     }
19958     {
19959       /* %typemap(out) const char * */
19960       ST(argvi) = newSVpv(result, 0);
19961       SvUTF8_on(ST(argvi)); /* expecting GDAL to give us UTF-8 */
19962       sv_2mortal(ST(argvi));
19963       argvi++;
19964     }
19965 
19966     XSRETURN(argvi);
19967   fail:
19968 
19969     SWIG_croak_null();
19970   }
19971 }
19972 
19973 
XS(_wrap_MDArray_GetFullName)19974 XS(_wrap_MDArray_GetFullName) {
19975   {
19976     GDALMDArrayHS *arg1 = (GDALMDArrayHS *) 0 ;
19977     void *argp1 = 0 ;
19978     int res1 = 0 ;
19979     int argvi = 0;
19980     char *result = 0 ;
19981     dXSARGS;
19982 
19983     if ((items < 1) || (items > 1)) {
19984       SWIG_croak("Usage: MDArray_GetFullName(self);");
19985     }
19986     res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_GDALMDArrayHS, 0 |  0 );
19987     if (!SWIG_IsOK(res1)) {
19988       SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "MDArray_GetFullName" "', argument " "1"" of type '" "GDALMDArrayHS *""'");
19989     }
19990     arg1 = reinterpret_cast< GDALMDArrayHS * >(argp1);
19991     {
19992       CPLErrorReset();
19993       result = (char *)GDALMDArrayHS_GetFullName(arg1);
19994       CPLErr eclass = CPLGetLastErrorType();
19995       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
19996         do_confess( CPLGetLastErrorMsg(), 0 );
19997 
19998 
19999 
20000 
20001 
20002       }
20003 
20004 
20005       /*
20006           Make warnings regular Perl warnings. This duplicates the warning
20007           message if DontUseExceptions() is in effect (it is not by default).
20008           */
20009       if ( eclass == CE_Warning ) {
20010         warn( CPLGetLastErrorMsg(), "%s" );
20011       }
20012 
20013 
20014     }
20015     {
20016       /* %typemap(out) const char * */
20017       ST(argvi) = newSVpv(result, 0);
20018       SvUTF8_on(ST(argvi)); /* expecting GDAL to give us UTF-8 */
20019       sv_2mortal(ST(argvi));
20020       argvi++;
20021     }
20022 
20023     XSRETURN(argvi);
20024   fail:
20025 
20026     SWIG_croak_null();
20027   }
20028 }
20029 
20030 
XS(_wrap_MDArray_GetTotalElementsCount)20031 XS(_wrap_MDArray_GetTotalElementsCount) {
20032   {
20033     GDALMDArrayHS *arg1 = (GDALMDArrayHS *) 0 ;
20034     void *argp1 = 0 ;
20035     int res1 = 0 ;
20036     int argvi = 0;
20037     unsigned long long result;
20038     dXSARGS;
20039 
20040     if ((items < 1) || (items > 1)) {
20041       SWIG_croak("Usage: MDArray_GetTotalElementsCount(self);");
20042     }
20043     res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_GDALMDArrayHS, 0 |  0 );
20044     if (!SWIG_IsOK(res1)) {
20045       SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "MDArray_GetTotalElementsCount" "', argument " "1"" of type '" "GDALMDArrayHS *""'");
20046     }
20047     arg1 = reinterpret_cast< GDALMDArrayHS * >(argp1);
20048     {
20049       CPLErrorReset();
20050       result = (unsigned long long)GDALMDArrayHS_GetTotalElementsCount(arg1);
20051       CPLErr eclass = CPLGetLastErrorType();
20052       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
20053         do_confess( CPLGetLastErrorMsg(), 0 );
20054 
20055 
20056 
20057 
20058 
20059       }
20060 
20061 
20062       /*
20063           Make warnings regular Perl warnings. This duplicates the warning
20064           message if DontUseExceptions() is in effect (it is not by default).
20065           */
20066       if ( eclass == CE_Warning ) {
20067         warn( CPLGetLastErrorMsg(), "%s" );
20068       }
20069 
20070 
20071     }
20072     ST(argvi) = SWIG_From_unsigned_SS_long_SS_long  SWIG_PERL_CALL_ARGS_1(static_cast< unsigned long long >(result)); argvi++ ;
20073 
20074     XSRETURN(argvi);
20075   fail:
20076 
20077     SWIG_croak_null();
20078   }
20079 }
20080 
20081 
XS(_wrap_MDArray_GetDimensionCount)20082 XS(_wrap_MDArray_GetDimensionCount) {
20083   {
20084     GDALMDArrayHS *arg1 = (GDALMDArrayHS *) 0 ;
20085     void *argp1 = 0 ;
20086     int res1 = 0 ;
20087     int argvi = 0;
20088     size_t result;
20089     dXSARGS;
20090 
20091     if ((items < 1) || (items > 1)) {
20092       SWIG_croak("Usage: MDArray_GetDimensionCount(self);");
20093     }
20094     res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_GDALMDArrayHS, 0 |  0 );
20095     if (!SWIG_IsOK(res1)) {
20096       SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "MDArray_GetDimensionCount" "', argument " "1"" of type '" "GDALMDArrayHS *""'");
20097     }
20098     arg1 = reinterpret_cast< GDALMDArrayHS * >(argp1);
20099     {
20100       CPLErrorReset();
20101       result = GDALMDArrayHS_GetDimensionCount(arg1);
20102       CPLErr eclass = CPLGetLastErrorType();
20103       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
20104         do_confess( CPLGetLastErrorMsg(), 0 );
20105 
20106 
20107 
20108 
20109 
20110       }
20111 
20112 
20113       /*
20114           Make warnings regular Perl warnings. This duplicates the warning
20115           message if DontUseExceptions() is in effect (it is not by default).
20116           */
20117       if ( eclass == CE_Warning ) {
20118         warn( CPLGetLastErrorMsg(), "%s" );
20119       }
20120 
20121 
20122     }
20123     ST(argvi) = SWIG_From_size_t  SWIG_PERL_CALL_ARGS_1(static_cast< size_t >(result)); argvi++ ;
20124 
20125     XSRETURN(argvi);
20126   fail:
20127 
20128     SWIG_croak_null();
20129   }
20130 }
20131 
20132 
XS(_wrap_MDArray_GetDataType)20133 XS(_wrap_MDArray_GetDataType) {
20134   {
20135     GDALMDArrayHS *arg1 = (GDALMDArrayHS *) 0 ;
20136     void *argp1 = 0 ;
20137     int res1 = 0 ;
20138     int argvi = 0;
20139     GDALExtendedDataTypeHS *result = 0 ;
20140     dXSARGS;
20141 
20142     if ((items < 1) || (items > 1)) {
20143       SWIG_croak("Usage: MDArray_GetDataType(self);");
20144     }
20145     res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_GDALMDArrayHS, 0 |  0 );
20146     if (!SWIG_IsOK(res1)) {
20147       SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "MDArray_GetDataType" "', argument " "1"" of type '" "GDALMDArrayHS *""'");
20148     }
20149     arg1 = reinterpret_cast< GDALMDArrayHS * >(argp1);
20150     {
20151       CPLErrorReset();
20152       result = (GDALExtendedDataTypeHS *)GDALMDArrayHS_GetDataType(arg1);
20153       CPLErr eclass = CPLGetLastErrorType();
20154       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
20155         do_confess( CPLGetLastErrorMsg(), 0 );
20156 
20157 
20158 
20159 
20160 
20161       }
20162 
20163 
20164       /*
20165           Make warnings regular Perl warnings. This duplicates the warning
20166           message if DontUseExceptions() is in effect (it is not by default).
20167           */
20168       if ( eclass == CE_Warning ) {
20169         warn( CPLGetLastErrorMsg(), "%s" );
20170       }
20171 
20172 
20173     }
20174     ST(argvi) = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GDALExtendedDataTypeHS, SWIG_OWNER | SWIG_SHADOW); argvi++ ;
20175 
20176     XSRETURN(argvi);
20177   fail:
20178 
20179     SWIG_croak_null();
20180   }
20181 }
20182 
20183 
XS(_wrap_MDArray_GetStructuralInfo)20184 XS(_wrap_MDArray_GetStructuralInfo) {
20185   {
20186     GDALMDArrayHS *arg1 = (GDALMDArrayHS *) 0 ;
20187     void *argp1 = 0 ;
20188     int res1 = 0 ;
20189     int argvi = 0;
20190     char **result = 0 ;
20191     dXSARGS;
20192 
20193     if ((items < 1) || (items > 1)) {
20194       SWIG_croak("Usage: MDArray_GetStructuralInfo(self);");
20195     }
20196     res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_GDALMDArrayHS, 0 |  0 );
20197     if (!SWIG_IsOK(res1)) {
20198       SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "MDArray_GetStructuralInfo" "', argument " "1"" of type '" "GDALMDArrayHS *""'");
20199     }
20200     arg1 = reinterpret_cast< GDALMDArrayHS * >(argp1);
20201     {
20202       CPLErrorReset();
20203       result = (char **)GDALMDArrayHS_GetStructuralInfo(arg1);
20204       CPLErr eclass = CPLGetLastErrorType();
20205       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
20206         do_confess( CPLGetLastErrorMsg(), 0 );
20207 
20208 
20209 
20210 
20211 
20212       }
20213 
20214 
20215       /*
20216           Make warnings regular Perl warnings. This duplicates the warning
20217           message if DontUseExceptions() is in effect (it is not by default).
20218           */
20219       if ( eclass == CE_Warning ) {
20220         warn( CPLGetLastErrorMsg(), "%s" );
20221       }
20222 
20223 
20224     }
20225     {
20226       /* %typemap(out) char **dict */
20227       char **stringarray = result;
20228       HV *hv = (HV*)sv_2mortal((SV*)newHV());
20229       if ( stringarray != NULL ) {
20230         while (*stringarray != NULL ) {
20231           char const *valptr;
20232           char *keyptr;
20233           valptr = CPLParseNameValue( *stringarray, &keyptr );
20234           if ( valptr != 0 ) {
20235             hv_store(hv, keyptr, strlen(keyptr), newSVpv(valptr, strlen(valptr)), 0);
20236             CPLFree( keyptr );
20237           }
20238           stringarray++;
20239         }
20240       }
20241       ST(argvi) = newRV((SV*)hv);
20242       sv_2mortal(ST(argvi));
20243       argvi++;
20244     }
20245 
20246     XSRETURN(argvi);
20247   fail:
20248 
20249     SWIG_croak_null();
20250   }
20251 }
20252 
20253 
XS(_wrap_MDArray_GetAttribute)20254 XS(_wrap_MDArray_GetAttribute) {
20255   {
20256     GDALMDArrayHS *arg1 = (GDALMDArrayHS *) 0 ;
20257     char *arg2 = (char *) 0 ;
20258     void *argp1 = 0 ;
20259     int res1 = 0 ;
20260     int res2 ;
20261     char *buf2 = 0 ;
20262     int alloc2 = 0 ;
20263     int argvi = 0;
20264     GDALAttributeHS *result = 0 ;
20265     dXSARGS;
20266 
20267     if ((items < 2) || (items > 2)) {
20268       SWIG_croak("Usage: MDArray_GetAttribute(self,name);");
20269     }
20270     res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_GDALMDArrayHS, 0 |  0 );
20271     if (!SWIG_IsOK(res1)) {
20272       SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "MDArray_GetAttribute" "', argument " "1"" of type '" "GDALMDArrayHS *""'");
20273     }
20274     arg1 = reinterpret_cast< GDALMDArrayHS * >(argp1);
20275     res2 = SWIG_AsCharPtrAndSize(ST(1), &buf2, NULL, &alloc2);
20276     if (!SWIG_IsOK(res2)) {
20277       SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "MDArray_GetAttribute" "', argument " "2"" of type '" "char const *""'");
20278     }
20279     arg2 = reinterpret_cast< char * >(buf2);
20280     {
20281       if (!arg2) {
20282         SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
20283       }
20284     }
20285     {
20286       CPLErrorReset();
20287       result = (GDALAttributeHS *)GDALMDArrayHS_GetAttribute(arg1,(char const *)arg2);
20288       CPLErr eclass = CPLGetLastErrorType();
20289       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
20290         do_confess( CPLGetLastErrorMsg(), 0 );
20291 
20292 
20293 
20294 
20295 
20296       }
20297 
20298 
20299       /*
20300           Make warnings regular Perl warnings. This duplicates the warning
20301           message if DontUseExceptions() is in effect (it is not by default).
20302           */
20303       if ( eclass == CE_Warning ) {
20304         warn( CPLGetLastErrorMsg(), "%s" );
20305       }
20306 
20307 
20308     }
20309     ST(argvi) = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GDALAttributeHS, SWIG_OWNER | SWIG_SHADOW); argvi++ ;
20310 
20311     if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
20312     XSRETURN(argvi);
20313   fail:
20314 
20315     if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
20316     SWIG_croak_null();
20317   }
20318 }
20319 
20320 
XS(_wrap_MDArray_CreateAttribute)20321 XS(_wrap_MDArray_CreateAttribute) {
20322   {
20323     GDALMDArrayHS *arg1 = (GDALMDArrayHS *) 0 ;
20324     char *arg2 = (char *) 0 ;
20325     int arg3 ;
20326     GUIntBig *arg4 = (GUIntBig *) 0 ;
20327     GDALExtendedDataTypeHS *arg5 = (GDALExtendedDataTypeHS *) 0 ;
20328     char **arg6 = (char **) 0 ;
20329     void *argp1 = 0 ;
20330     int res1 = 0 ;
20331     int res2 ;
20332     char *buf2 = 0 ;
20333     int alloc2 = 0 ;
20334     void *argp5 = 0 ;
20335     int res5 = 0 ;
20336     int argvi = 0;
20337     GDALAttributeHS *result = 0 ;
20338     dXSARGS;
20339 
20340     if ((items < 4) || (items > 5)) {
20341       SWIG_croak("Usage: MDArray_CreateAttribute(self,name,nDimensions,dimensions,data_type,options);");
20342     }
20343     res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_GDALMDArrayHS, 0 |  0 );
20344     if (!SWIG_IsOK(res1)) {
20345       SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "MDArray_CreateAttribute" "', argument " "1"" of type '" "GDALMDArrayHS *""'");
20346     }
20347     arg1 = reinterpret_cast< GDALMDArrayHS * >(argp1);
20348     res2 = SWIG_AsCharPtrAndSize(ST(1), &buf2, NULL, &alloc2);
20349     if (!SWIG_IsOK(res2)) {
20350       SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "MDArray_CreateAttribute" "', argument " "2"" of type '" "char const *""'");
20351     }
20352     arg2 = reinterpret_cast< char * >(buf2);
20353     {
20354       /* %typemap(in,numinputs=1) (int nList, GUIntBig* pList) */
20355       if (!(SvROK(ST(2)) && (SvTYPE(SvRV(ST(2)))==SVt_PVAV)))
20356       do_confess(NEED_ARRAY_REF, 1);
20357       AV *av = (AV*)(SvRV(ST(2)));
20358       arg3 = av_len(av)+1;
20359       arg4 = (GUIntBig*)CPLMalloc(arg3*sizeof(GUIntBig));
20360       if (arg4) {
20361         for( int i = 0; i<arg3; i++ ) {
20362           SV **sv = av_fetch(av, i, 0);
20363           arg4[i] =  CPLScanUIntBig(SvPV_nolen(*sv), 30);
20364         }
20365       } else
20366       SWIG_fail;
20367     }
20368     res5 = SWIG_ConvertPtr(ST(3), &argp5,SWIGTYPE_p_GDALExtendedDataTypeHS, 0 |  0 );
20369     if (!SWIG_IsOK(res5)) {
20370       SWIG_exception_fail(SWIG_ArgError(res5), "in method '" "MDArray_CreateAttribute" "', argument " "5"" of type '" "GDALExtendedDataTypeHS *""'");
20371     }
20372     arg5 = reinterpret_cast< GDALExtendedDataTypeHS * >(argp5);
20373     if (items > 4) {
20374       {
20375         /* %typemap(in) char **options */
20376         if (SvOK(ST(4))) {
20377           if (SvROK(ST(4))) {
20378             if (SvTYPE(SvRV(ST(4)))==SVt_PVAV) {
20379               AV *av = (AV*)(SvRV(ST(4)));
20380               for (int i = 0; i < av_len(av)+1; i++) {
20381                 SV *sv = *(av_fetch(av, i, 0));
20382                 bool sf;
20383                 char *tmp = sv_to_utf8_string(sv, NULL, &sf);
20384                 arg6 = CSLAddString(arg6, tmp);
20385                 if (sf) Safefree(tmp); else free(tmp);
20386               }
20387             } else if (SvTYPE(SvRV(ST(4)))==SVt_PVHV) {
20388               HV *hv = (HV*)SvRV(ST(4));
20389               SV *sv;
20390               char *key;
20391               I32 klen;
20392               arg6 = NULL;
20393               hv_iterinit(hv);
20394               while(sv = hv_iternextsv(hv, &key, &klen)) {
20395                 bool sf;
20396                 char *tmp = sv_to_utf8_string(sv, NULL, &sf);
20397                 arg6 = CSLAddNameValue(arg6, key, tmp);
20398                 if (sf) Safefree(tmp); else free(tmp);
20399               }
20400             } else
20401             do_confess(NEED_REF, 1);
20402           } else
20403           do_confess(NEED_REF, 1);
20404         }
20405       }
20406     }
20407     {
20408       if (!arg2) {
20409         SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
20410       }
20411     }
20412     {
20413       CPLErrorReset();
20414       result = (GDALAttributeHS *)GDALMDArrayHS_CreateAttribute(arg1,(char const *)arg2,arg3,arg4,arg5,arg6);
20415       CPLErr eclass = CPLGetLastErrorType();
20416       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
20417         do_confess( CPLGetLastErrorMsg(), 0 );
20418 
20419 
20420 
20421 
20422 
20423       }
20424 
20425 
20426       /*
20427           Make warnings regular Perl warnings. This duplicates the warning
20428           message if DontUseExceptions() is in effect (it is not by default).
20429           */
20430       if ( eclass == CE_Warning ) {
20431         warn( CPLGetLastErrorMsg(), "%s" );
20432       }
20433 
20434 
20435     }
20436     ST(argvi) = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GDALAttributeHS, SWIG_OWNER | SWIG_SHADOW); argvi++ ;
20437 
20438     if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
20439     {
20440       /* %typemap(freearg) (int nList, GUIntBig* pList) */
20441       CPLFree((void*) arg4);
20442     }
20443 
20444     {
20445       /* %typemap(freearg) char **options */
20446       if (arg6) CSLDestroy( arg6 );
20447     }
20448     XSRETURN(argvi);
20449   fail:
20450 
20451     if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
20452     {
20453       /* %typemap(freearg) (int nList, GUIntBig* pList) */
20454       CPLFree((void*) arg4);
20455     }
20456 
20457     {
20458       /* %typemap(freearg) char **options */
20459       if (arg6) CSLDestroy( arg6 );
20460     }
20461     SWIG_croak_null();
20462   }
20463 }
20464 
20465 
XS(_wrap_MDArray_GetNoDataValueAsDouble)20466 XS(_wrap_MDArray_GetNoDataValueAsDouble) {
20467   {
20468     GDALMDArrayHS *arg1 = (GDALMDArrayHS *) 0 ;
20469     double *arg2 = (double *) 0 ;
20470     int *arg3 = (int *) 0 ;
20471     void *argp1 = 0 ;
20472     int res1 = 0 ;
20473     double tmpval2 ;
20474     int tmphasval2 ;
20475     int argvi = 0;
20476     dXSARGS;
20477 
20478     {
20479       /* %typemap(in,numinputs=0) (double *val, int *hasval) */
20480       arg2 = &tmpval2;
20481       arg3 = &tmphasval2;
20482     }
20483     if ((items < 1) || (items > 1)) {
20484       SWIG_croak("Usage: MDArray_GetNoDataValueAsDouble(self,hasval);");
20485     }
20486     res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_GDALMDArrayHS, 0 |  0 );
20487     if (!SWIG_IsOK(res1)) {
20488       SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "MDArray_GetNoDataValueAsDouble" "', argument " "1"" of type '" "GDALMDArrayHS *""'");
20489     }
20490     arg1 = reinterpret_cast< GDALMDArrayHS * >(argp1);
20491     {
20492       CPLErrorReset();
20493       GDALMDArrayHS_GetNoDataValueAsDouble(arg1,arg2,arg3);
20494       CPLErr eclass = CPLGetLastErrorType();
20495       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
20496         do_confess( CPLGetLastErrorMsg(), 0 );
20497 
20498 
20499 
20500 
20501 
20502       }
20503 
20504 
20505       /*
20506           Make warnings regular Perl warnings. This duplicates the warning
20507           message if DontUseExceptions() is in effect (it is not by default).
20508           */
20509       if ( eclass == CE_Warning ) {
20510         warn( CPLGetLastErrorMsg(), "%s" );
20511       }
20512 
20513 
20514     }
20515     {
20516       /* %typemap(out) void */
20517     }
20518     {
20519       /* %typemap(argout) (double *val, int *hasval) */
20520       if (GIMME_V == G_ARRAY) {
20521         EXTEND(SP, argvi+2-items+1);
20522         ST(argvi) = sv_newmortal();
20523         sv_setnv(ST(argvi), *arg2);
20524         argvi++;
20525         ST(argvi) = sv_newmortal();
20526         sv_setiv(ST(argvi), *arg3);
20527         argvi++;
20528       } else {
20529         if ( *arg3 ) {
20530           ST(argvi) = sv_newmortal();
20531           sv_setnv(ST(argvi), *arg2);
20532           argvi++;
20533         }
20534       }
20535     }
20536 
20537     XSRETURN(argvi);
20538   fail:
20539 
20540     SWIG_croak_null();
20541   }
20542 }
20543 
20544 
XS(_wrap_MDArray_SetNoDataValueDouble)20545 XS(_wrap_MDArray_SetNoDataValueDouble) {
20546   {
20547     GDALMDArrayHS *arg1 = (GDALMDArrayHS *) 0 ;
20548     double arg2 ;
20549     void *argp1 = 0 ;
20550     int res1 = 0 ;
20551     double val2 ;
20552     int ecode2 = 0 ;
20553     int argvi = 0;
20554     CPLErr result;
20555     dXSARGS;
20556 
20557     if ((items < 2) || (items > 2)) {
20558       SWIG_croak("Usage: MDArray_SetNoDataValueDouble(self,d);");
20559     }
20560     res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_GDALMDArrayHS, 0 |  0 );
20561     if (!SWIG_IsOK(res1)) {
20562       SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "MDArray_SetNoDataValueDouble" "', argument " "1"" of type '" "GDALMDArrayHS *""'");
20563     }
20564     arg1 = reinterpret_cast< GDALMDArrayHS * >(argp1);
20565     ecode2 = SWIG_AsVal_double SWIG_PERL_CALL_ARGS_2(ST(1), &val2);
20566     if (!SWIG_IsOK(ecode2)) {
20567       SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "MDArray_SetNoDataValueDouble" "', argument " "2"" of type '" "double""'");
20568     }
20569     arg2 = static_cast< double >(val2);
20570     {
20571       CPLErrorReset();
20572       result = (CPLErr)GDALMDArrayHS_SetNoDataValueDouble(arg1,arg2);
20573       CPLErr eclass = CPLGetLastErrorType();
20574       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
20575         do_confess( CPLGetLastErrorMsg(), 0 );
20576 
20577 
20578 
20579 
20580 
20581       }
20582 
20583 
20584       /*
20585           Make warnings regular Perl warnings. This duplicates the warning
20586           message if DontUseExceptions() is in effect (it is not by default).
20587           */
20588       if ( eclass == CE_Warning ) {
20589         warn( CPLGetLastErrorMsg(), "%s" );
20590       }
20591 
20592 
20593     }
20594     {
20595       /* %typemap(out) CPLErr */
20596     }
20597 
20598 
20599     XSRETURN(argvi);
20600   fail:
20601 
20602 
20603     SWIG_croak_null();
20604   }
20605 }
20606 
20607 
XS(_wrap_MDArray_DeleteNoDataValue)20608 XS(_wrap_MDArray_DeleteNoDataValue) {
20609   {
20610     GDALMDArrayHS *arg1 = (GDALMDArrayHS *) 0 ;
20611     void *argp1 = 0 ;
20612     int res1 = 0 ;
20613     int argvi = 0;
20614     CPLErr result;
20615     dXSARGS;
20616 
20617     if ((items < 1) || (items > 1)) {
20618       SWIG_croak("Usage: MDArray_DeleteNoDataValue(self);");
20619     }
20620     res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_GDALMDArrayHS, 0 |  0 );
20621     if (!SWIG_IsOK(res1)) {
20622       SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "MDArray_DeleteNoDataValue" "', argument " "1"" of type '" "GDALMDArrayHS *""'");
20623     }
20624     arg1 = reinterpret_cast< GDALMDArrayHS * >(argp1);
20625     {
20626       CPLErrorReset();
20627       result = (CPLErr)GDALMDArrayHS_DeleteNoDataValue(arg1);
20628       CPLErr eclass = CPLGetLastErrorType();
20629       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
20630         do_confess( CPLGetLastErrorMsg(), 0 );
20631 
20632 
20633 
20634 
20635 
20636       }
20637 
20638 
20639       /*
20640           Make warnings regular Perl warnings. This duplicates the warning
20641           message if DontUseExceptions() is in effect (it is not by default).
20642           */
20643       if ( eclass == CE_Warning ) {
20644         warn( CPLGetLastErrorMsg(), "%s" );
20645       }
20646 
20647 
20648     }
20649     {
20650       /* %typemap(out) CPLErr */
20651     }
20652 
20653     XSRETURN(argvi);
20654   fail:
20655 
20656     SWIG_croak_null();
20657   }
20658 }
20659 
20660 
XS(_wrap_MDArray_GetOffset)20661 XS(_wrap_MDArray_GetOffset) {
20662   {
20663     GDALMDArrayHS *arg1 = (GDALMDArrayHS *) 0 ;
20664     double *arg2 = (double *) 0 ;
20665     int *arg3 = (int *) 0 ;
20666     void *argp1 = 0 ;
20667     int res1 = 0 ;
20668     double tmpval2 ;
20669     int tmphasval2 ;
20670     int argvi = 0;
20671     dXSARGS;
20672 
20673     {
20674       /* %typemap(in,numinputs=0) (double *val, int *hasval) */
20675       arg2 = &tmpval2;
20676       arg3 = &tmphasval2;
20677     }
20678     if ((items < 1) || (items > 1)) {
20679       SWIG_croak("Usage: MDArray_GetOffset(self,hasval);");
20680     }
20681     res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_GDALMDArrayHS, 0 |  0 );
20682     if (!SWIG_IsOK(res1)) {
20683       SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "MDArray_GetOffset" "', argument " "1"" of type '" "GDALMDArrayHS *""'");
20684     }
20685     arg1 = reinterpret_cast< GDALMDArrayHS * >(argp1);
20686     {
20687       CPLErrorReset();
20688       GDALMDArrayHS_GetOffset(arg1,arg2,arg3);
20689       CPLErr eclass = CPLGetLastErrorType();
20690       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
20691         do_confess( CPLGetLastErrorMsg(), 0 );
20692 
20693 
20694 
20695 
20696 
20697       }
20698 
20699 
20700       /*
20701           Make warnings regular Perl warnings. This duplicates the warning
20702           message if DontUseExceptions() is in effect (it is not by default).
20703           */
20704       if ( eclass == CE_Warning ) {
20705         warn( CPLGetLastErrorMsg(), "%s" );
20706       }
20707 
20708 
20709     }
20710     {
20711       /* %typemap(out) void */
20712     }
20713     {
20714       /* %typemap(argout) (double *val, int *hasval) */
20715       if (GIMME_V == G_ARRAY) {
20716         EXTEND(SP, argvi+2-items+1);
20717         ST(argvi) = sv_newmortal();
20718         sv_setnv(ST(argvi), *arg2);
20719         argvi++;
20720         ST(argvi) = sv_newmortal();
20721         sv_setiv(ST(argvi), *arg3);
20722         argvi++;
20723       } else {
20724         if ( *arg3 ) {
20725           ST(argvi) = sv_newmortal();
20726           sv_setnv(ST(argvi), *arg2);
20727           argvi++;
20728         }
20729       }
20730     }
20731 
20732     XSRETURN(argvi);
20733   fail:
20734 
20735     SWIG_croak_null();
20736   }
20737 }
20738 
20739 
XS(_wrap_MDArray_GetOffsetStorageType)20740 XS(_wrap_MDArray_GetOffsetStorageType) {
20741   {
20742     GDALMDArrayHS *arg1 = (GDALMDArrayHS *) 0 ;
20743     void *argp1 = 0 ;
20744     int res1 = 0 ;
20745     int argvi = 0;
20746     GDALDataType result;
20747     dXSARGS;
20748 
20749     if ((items < 1) || (items > 1)) {
20750       SWIG_croak("Usage: MDArray_GetOffsetStorageType(self);");
20751     }
20752     res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_GDALMDArrayHS, 0 |  0 );
20753     if (!SWIG_IsOK(res1)) {
20754       SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "MDArray_GetOffsetStorageType" "', argument " "1"" of type '" "GDALMDArrayHS *""'");
20755     }
20756     arg1 = reinterpret_cast< GDALMDArrayHS * >(argp1);
20757     {
20758       CPLErrorReset();
20759       result = (GDALDataType)GDALMDArrayHS_GetOffsetStorageType(arg1);
20760       CPLErr eclass = CPLGetLastErrorType();
20761       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
20762         do_confess( CPLGetLastErrorMsg(), 0 );
20763 
20764 
20765 
20766 
20767 
20768       }
20769 
20770 
20771       /*
20772           Make warnings regular Perl warnings. This duplicates the warning
20773           message if DontUseExceptions() is in effect (it is not by default).
20774           */
20775       if ( eclass == CE_Warning ) {
20776         warn( CPLGetLastErrorMsg(), "%s" );
20777       }
20778 
20779 
20780     }
20781     ST(argvi) = SWIG_From_int  SWIG_PERL_CALL_ARGS_1(static_cast< int >(result)); argvi++ ;
20782 
20783     XSRETURN(argvi);
20784   fail:
20785 
20786     SWIG_croak_null();
20787   }
20788 }
20789 
20790 
XS(_wrap_MDArray_GetScale)20791 XS(_wrap_MDArray_GetScale) {
20792   {
20793     GDALMDArrayHS *arg1 = (GDALMDArrayHS *) 0 ;
20794     double *arg2 = (double *) 0 ;
20795     int *arg3 = (int *) 0 ;
20796     void *argp1 = 0 ;
20797     int res1 = 0 ;
20798     double tmpval2 ;
20799     int tmphasval2 ;
20800     int argvi = 0;
20801     dXSARGS;
20802 
20803     {
20804       /* %typemap(in,numinputs=0) (double *val, int *hasval) */
20805       arg2 = &tmpval2;
20806       arg3 = &tmphasval2;
20807     }
20808     if ((items < 1) || (items > 1)) {
20809       SWIG_croak("Usage: MDArray_GetScale(self,hasval);");
20810     }
20811     res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_GDALMDArrayHS, 0 |  0 );
20812     if (!SWIG_IsOK(res1)) {
20813       SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "MDArray_GetScale" "', argument " "1"" of type '" "GDALMDArrayHS *""'");
20814     }
20815     arg1 = reinterpret_cast< GDALMDArrayHS * >(argp1);
20816     {
20817       CPLErrorReset();
20818       GDALMDArrayHS_GetScale(arg1,arg2,arg3);
20819       CPLErr eclass = CPLGetLastErrorType();
20820       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
20821         do_confess( CPLGetLastErrorMsg(), 0 );
20822 
20823 
20824 
20825 
20826 
20827       }
20828 
20829 
20830       /*
20831           Make warnings regular Perl warnings. This duplicates the warning
20832           message if DontUseExceptions() is in effect (it is not by default).
20833           */
20834       if ( eclass == CE_Warning ) {
20835         warn( CPLGetLastErrorMsg(), "%s" );
20836       }
20837 
20838 
20839     }
20840     {
20841       /* %typemap(out) void */
20842     }
20843     {
20844       /* %typemap(argout) (double *val, int *hasval) */
20845       if (GIMME_V == G_ARRAY) {
20846         EXTEND(SP, argvi+2-items+1);
20847         ST(argvi) = sv_newmortal();
20848         sv_setnv(ST(argvi), *arg2);
20849         argvi++;
20850         ST(argvi) = sv_newmortal();
20851         sv_setiv(ST(argvi), *arg3);
20852         argvi++;
20853       } else {
20854         if ( *arg3 ) {
20855           ST(argvi) = sv_newmortal();
20856           sv_setnv(ST(argvi), *arg2);
20857           argvi++;
20858         }
20859       }
20860     }
20861 
20862     XSRETURN(argvi);
20863   fail:
20864 
20865     SWIG_croak_null();
20866   }
20867 }
20868 
20869 
XS(_wrap_MDArray_GetScaleStorageType)20870 XS(_wrap_MDArray_GetScaleStorageType) {
20871   {
20872     GDALMDArrayHS *arg1 = (GDALMDArrayHS *) 0 ;
20873     void *argp1 = 0 ;
20874     int res1 = 0 ;
20875     int argvi = 0;
20876     GDALDataType result;
20877     dXSARGS;
20878 
20879     if ((items < 1) || (items > 1)) {
20880       SWIG_croak("Usage: MDArray_GetScaleStorageType(self);");
20881     }
20882     res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_GDALMDArrayHS, 0 |  0 );
20883     if (!SWIG_IsOK(res1)) {
20884       SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "MDArray_GetScaleStorageType" "', argument " "1"" of type '" "GDALMDArrayHS *""'");
20885     }
20886     arg1 = reinterpret_cast< GDALMDArrayHS * >(argp1);
20887     {
20888       CPLErrorReset();
20889       result = (GDALDataType)GDALMDArrayHS_GetScaleStorageType(arg1);
20890       CPLErr eclass = CPLGetLastErrorType();
20891       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
20892         do_confess( CPLGetLastErrorMsg(), 0 );
20893 
20894 
20895 
20896 
20897 
20898       }
20899 
20900 
20901       /*
20902           Make warnings regular Perl warnings. This duplicates the warning
20903           message if DontUseExceptions() is in effect (it is not by default).
20904           */
20905       if ( eclass == CE_Warning ) {
20906         warn( CPLGetLastErrorMsg(), "%s" );
20907       }
20908 
20909 
20910     }
20911     ST(argvi) = SWIG_From_int  SWIG_PERL_CALL_ARGS_1(static_cast< int >(result)); argvi++ ;
20912 
20913     XSRETURN(argvi);
20914   fail:
20915 
20916     SWIG_croak_null();
20917   }
20918 }
20919 
20920 
XS(_wrap_MDArray_SetOffset)20921 XS(_wrap_MDArray_SetOffset) {
20922   {
20923     GDALMDArrayHS *arg1 = (GDALMDArrayHS *) 0 ;
20924     double arg2 ;
20925     GDALDataType arg3 = (GDALDataType) GDT_Unknown ;
20926     void *argp1 = 0 ;
20927     int res1 = 0 ;
20928     double val2 ;
20929     int ecode2 = 0 ;
20930     int val3 ;
20931     int ecode3 = 0 ;
20932     int argvi = 0;
20933     CPLErr result;
20934     dXSARGS;
20935 
20936     if ((items < 2) || (items > 3)) {
20937       SWIG_croak("Usage: MDArray_SetOffset(self,val,storageType);");
20938     }
20939     res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_GDALMDArrayHS, 0 |  0 );
20940     if (!SWIG_IsOK(res1)) {
20941       SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "MDArray_SetOffset" "', argument " "1"" of type '" "GDALMDArrayHS *""'");
20942     }
20943     arg1 = reinterpret_cast< GDALMDArrayHS * >(argp1);
20944     ecode2 = SWIG_AsVal_double SWIG_PERL_CALL_ARGS_2(ST(1), &val2);
20945     if (!SWIG_IsOK(ecode2)) {
20946       SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "MDArray_SetOffset" "', argument " "2"" of type '" "double""'");
20947     }
20948     arg2 = static_cast< double >(val2);
20949     if (items > 2) {
20950       ecode3 = SWIG_AsVal_int SWIG_PERL_CALL_ARGS_2(ST(2), &val3);
20951       if (!SWIG_IsOK(ecode3)) {
20952         SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "MDArray_SetOffset" "', argument " "3"" of type '" "GDALDataType""'");
20953       }
20954       arg3 = static_cast< GDALDataType >(val3);
20955     }
20956     {
20957       CPLErrorReset();
20958       result = (CPLErr)GDALMDArrayHS_SetOffset(arg1,arg2,arg3);
20959       CPLErr eclass = CPLGetLastErrorType();
20960       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
20961         do_confess( CPLGetLastErrorMsg(), 0 );
20962 
20963 
20964 
20965 
20966 
20967       }
20968 
20969 
20970       /*
20971           Make warnings regular Perl warnings. This duplicates the warning
20972           message if DontUseExceptions() is in effect (it is not by default).
20973           */
20974       if ( eclass == CE_Warning ) {
20975         warn( CPLGetLastErrorMsg(), "%s" );
20976       }
20977 
20978 
20979     }
20980     {
20981       /* %typemap(out) CPLErr */
20982     }
20983 
20984 
20985 
20986     XSRETURN(argvi);
20987   fail:
20988 
20989 
20990 
20991     SWIG_croak_null();
20992   }
20993 }
20994 
20995 
XS(_wrap_MDArray_SetScale)20996 XS(_wrap_MDArray_SetScale) {
20997   {
20998     GDALMDArrayHS *arg1 = (GDALMDArrayHS *) 0 ;
20999     double arg2 ;
21000     GDALDataType arg3 = (GDALDataType) GDT_Unknown ;
21001     void *argp1 = 0 ;
21002     int res1 = 0 ;
21003     double val2 ;
21004     int ecode2 = 0 ;
21005     int val3 ;
21006     int ecode3 = 0 ;
21007     int argvi = 0;
21008     CPLErr result;
21009     dXSARGS;
21010 
21011     if ((items < 2) || (items > 3)) {
21012       SWIG_croak("Usage: MDArray_SetScale(self,val,storageType);");
21013     }
21014     res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_GDALMDArrayHS, 0 |  0 );
21015     if (!SWIG_IsOK(res1)) {
21016       SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "MDArray_SetScale" "', argument " "1"" of type '" "GDALMDArrayHS *""'");
21017     }
21018     arg1 = reinterpret_cast< GDALMDArrayHS * >(argp1);
21019     ecode2 = SWIG_AsVal_double SWIG_PERL_CALL_ARGS_2(ST(1), &val2);
21020     if (!SWIG_IsOK(ecode2)) {
21021       SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "MDArray_SetScale" "', argument " "2"" of type '" "double""'");
21022     }
21023     arg2 = static_cast< double >(val2);
21024     if (items > 2) {
21025       ecode3 = SWIG_AsVal_int SWIG_PERL_CALL_ARGS_2(ST(2), &val3);
21026       if (!SWIG_IsOK(ecode3)) {
21027         SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "MDArray_SetScale" "', argument " "3"" of type '" "GDALDataType""'");
21028       }
21029       arg3 = static_cast< GDALDataType >(val3);
21030     }
21031     {
21032       CPLErrorReset();
21033       result = (CPLErr)GDALMDArrayHS_SetScale(arg1,arg2,arg3);
21034       CPLErr eclass = CPLGetLastErrorType();
21035       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
21036         do_confess( CPLGetLastErrorMsg(), 0 );
21037 
21038 
21039 
21040 
21041 
21042       }
21043 
21044 
21045       /*
21046           Make warnings regular Perl warnings. This duplicates the warning
21047           message if DontUseExceptions() is in effect (it is not by default).
21048           */
21049       if ( eclass == CE_Warning ) {
21050         warn( CPLGetLastErrorMsg(), "%s" );
21051       }
21052 
21053 
21054     }
21055     {
21056       /* %typemap(out) CPLErr */
21057     }
21058 
21059 
21060 
21061     XSRETURN(argvi);
21062   fail:
21063 
21064 
21065 
21066     SWIG_croak_null();
21067   }
21068 }
21069 
21070 
XS(_wrap_MDArray_SetUnit)21071 XS(_wrap_MDArray_SetUnit) {
21072   {
21073     GDALMDArrayHS *arg1 = (GDALMDArrayHS *) 0 ;
21074     char *arg2 = (char *) 0 ;
21075     void *argp1 = 0 ;
21076     int res1 = 0 ;
21077     int res2 ;
21078     char *buf2 = 0 ;
21079     int alloc2 = 0 ;
21080     int argvi = 0;
21081     CPLErr result;
21082     dXSARGS;
21083 
21084     if ((items < 2) || (items > 2)) {
21085       SWIG_croak("Usage: MDArray_SetUnit(self,unit);");
21086     }
21087     res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_GDALMDArrayHS, 0 |  0 );
21088     if (!SWIG_IsOK(res1)) {
21089       SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "MDArray_SetUnit" "', argument " "1"" of type '" "GDALMDArrayHS *""'");
21090     }
21091     arg1 = reinterpret_cast< GDALMDArrayHS * >(argp1);
21092     res2 = SWIG_AsCharPtrAndSize(ST(1), &buf2, NULL, &alloc2);
21093     if (!SWIG_IsOK(res2)) {
21094       SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "MDArray_SetUnit" "', argument " "2"" of type '" "char const *""'");
21095     }
21096     arg2 = reinterpret_cast< char * >(buf2);
21097     {
21098       CPLErrorReset();
21099       result = (CPLErr)GDALMDArrayHS_SetUnit(arg1,(char const *)arg2);
21100       CPLErr eclass = CPLGetLastErrorType();
21101       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
21102         do_confess( CPLGetLastErrorMsg(), 0 );
21103 
21104 
21105 
21106 
21107 
21108       }
21109 
21110 
21111       /*
21112           Make warnings regular Perl warnings. This duplicates the warning
21113           message if DontUseExceptions() is in effect (it is not by default).
21114           */
21115       if ( eclass == CE_Warning ) {
21116         warn( CPLGetLastErrorMsg(), "%s" );
21117       }
21118 
21119 
21120     }
21121     {
21122       /* %typemap(out) CPLErr */
21123     }
21124 
21125     if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
21126     XSRETURN(argvi);
21127   fail:
21128 
21129     if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
21130     SWIG_croak_null();
21131   }
21132 }
21133 
21134 
XS(_wrap_MDArray_GetUnit)21135 XS(_wrap_MDArray_GetUnit) {
21136   {
21137     GDALMDArrayHS *arg1 = (GDALMDArrayHS *) 0 ;
21138     void *argp1 = 0 ;
21139     int res1 = 0 ;
21140     int argvi = 0;
21141     char *result = 0 ;
21142     dXSARGS;
21143 
21144     if ((items < 1) || (items > 1)) {
21145       SWIG_croak("Usage: MDArray_GetUnit(self);");
21146     }
21147     res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_GDALMDArrayHS, 0 |  0 );
21148     if (!SWIG_IsOK(res1)) {
21149       SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "MDArray_GetUnit" "', argument " "1"" of type '" "GDALMDArrayHS *""'");
21150     }
21151     arg1 = reinterpret_cast< GDALMDArrayHS * >(argp1);
21152     {
21153       CPLErrorReset();
21154       result = (char *)GDALMDArrayHS_GetUnit(arg1);
21155       CPLErr eclass = CPLGetLastErrorType();
21156       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
21157         do_confess( CPLGetLastErrorMsg(), 0 );
21158 
21159 
21160 
21161 
21162 
21163       }
21164 
21165 
21166       /*
21167           Make warnings regular Perl warnings. This duplicates the warning
21168           message if DontUseExceptions() is in effect (it is not by default).
21169           */
21170       if ( eclass == CE_Warning ) {
21171         warn( CPLGetLastErrorMsg(), "%s" );
21172       }
21173 
21174 
21175     }
21176     {
21177       /* %typemap(out) const char * */
21178       ST(argvi) = newSVpv(result, 0);
21179       SvUTF8_on(ST(argvi)); /* expecting GDAL to give us UTF-8 */
21180       sv_2mortal(ST(argvi));
21181       argvi++;
21182     }
21183 
21184     XSRETURN(argvi);
21185   fail:
21186 
21187     SWIG_croak_null();
21188   }
21189 }
21190 
21191 
XS(_wrap_MDArray_SetSpatialRef)21192 XS(_wrap_MDArray_SetSpatialRef) {
21193   {
21194     GDALMDArrayHS *arg1 = (GDALMDArrayHS *) 0 ;
21195     OSRSpatialReferenceShadow *arg2 = (OSRSpatialReferenceShadow *) 0 ;
21196     void *argp1 = 0 ;
21197     int res1 = 0 ;
21198     void *argp2 = 0 ;
21199     int res2 = 0 ;
21200     int argvi = 0;
21201     OGRErr result;
21202     dXSARGS;
21203 
21204     if ((items < 2) || (items > 2)) {
21205       SWIG_croak("Usage: MDArray_SetSpatialRef(self,srs);");
21206     }
21207     res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_GDALMDArrayHS, 0 |  0 );
21208     if (!SWIG_IsOK(res1)) {
21209       SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "MDArray_SetSpatialRef" "', argument " "1"" of type '" "GDALMDArrayHS *""'");
21210     }
21211     arg1 = reinterpret_cast< GDALMDArrayHS * >(argp1);
21212     res2 = SWIG_ConvertPtr(ST(1), &argp2,SWIGTYPE_p_OSRSpatialReferenceShadow, 0 |  0 );
21213     if (!SWIG_IsOK(res2)) {
21214       SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "MDArray_SetSpatialRef" "', argument " "2"" of type '" "OSRSpatialReferenceShadow *""'");
21215     }
21216     arg2 = reinterpret_cast< OSRSpatialReferenceShadow * >(argp2);
21217     {
21218       CPLErrorReset();
21219       result = (OGRErr)GDALMDArrayHS_SetSpatialRef(arg1,arg2);
21220       CPLErr eclass = CPLGetLastErrorType();
21221       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
21222         do_confess( CPLGetLastErrorMsg(), 0 );
21223 
21224 
21225 
21226 
21227 
21228       }
21229 
21230 
21231       /*
21232           Make warnings regular Perl warnings. This duplicates the warning
21233           message if DontUseExceptions() is in effect (it is not by default).
21234           */
21235       if ( eclass == CE_Warning ) {
21236         warn( CPLGetLastErrorMsg(), "%s" );
21237       }
21238 
21239 
21240     }
21241     {
21242       /* %typemap(out) OGRErr */
21243       if ( result != 0 ) {
21244         const char *err = CPLGetLastErrorMsg();
21245         if (err and *err) do_confess(err, 0); /* this is usually better */
21246         do_confess( OGRErrMessages(result), 1 );
21247       }
21248     }
21249 
21250 
21251     XSRETURN(argvi);
21252   fail:
21253 
21254 
21255     SWIG_croak_null();
21256   }
21257 }
21258 
21259 
XS(_wrap_MDArray_GetSpatialRef)21260 XS(_wrap_MDArray_GetSpatialRef) {
21261   {
21262     GDALMDArrayHS *arg1 = (GDALMDArrayHS *) 0 ;
21263     void *argp1 = 0 ;
21264     int res1 = 0 ;
21265     int argvi = 0;
21266     OSRSpatialReferenceShadow *result = 0 ;
21267     dXSARGS;
21268 
21269     if ((items < 1) || (items > 1)) {
21270       SWIG_croak("Usage: MDArray_GetSpatialRef(self);");
21271     }
21272     res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_GDALMDArrayHS, 0 |  0 );
21273     if (!SWIG_IsOK(res1)) {
21274       SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "MDArray_GetSpatialRef" "', argument " "1"" of type '" "GDALMDArrayHS *""'");
21275     }
21276     arg1 = reinterpret_cast< GDALMDArrayHS * >(argp1);
21277     {
21278       CPLErrorReset();
21279       result = (OSRSpatialReferenceShadow *)GDALMDArrayHS_GetSpatialRef(arg1);
21280       CPLErr eclass = CPLGetLastErrorType();
21281       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
21282         do_confess( CPLGetLastErrorMsg(), 0 );
21283 
21284 
21285 
21286 
21287 
21288       }
21289 
21290 
21291       /*
21292           Make warnings regular Perl warnings. This duplicates the warning
21293           message if DontUseExceptions() is in effect (it is not by default).
21294           */
21295       if ( eclass == CE_Warning ) {
21296         warn( CPLGetLastErrorMsg(), "%s" );
21297       }
21298 
21299 
21300     }
21301     ST(argvi) = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_OSRSpatialReferenceShadow, SWIG_OWNER | SWIG_SHADOW); argvi++ ;
21302 
21303     XSRETURN(argvi);
21304   fail:
21305 
21306     SWIG_croak_null();
21307   }
21308 }
21309 
21310 
XS(_wrap_MDArray_GetView)21311 XS(_wrap_MDArray_GetView) {
21312   {
21313     GDALMDArrayHS *arg1 = (GDALMDArrayHS *) 0 ;
21314     char *arg2 = (char *) 0 ;
21315     void *argp1 = 0 ;
21316     int res1 = 0 ;
21317     int res2 ;
21318     char *buf2 = 0 ;
21319     int alloc2 = 0 ;
21320     int argvi = 0;
21321     GDALMDArrayHS *result = 0 ;
21322     dXSARGS;
21323 
21324     if ((items < 2) || (items > 2)) {
21325       SWIG_croak("Usage: MDArray_GetView(self,viewExpr);");
21326     }
21327     res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_GDALMDArrayHS, 0 |  0 );
21328     if (!SWIG_IsOK(res1)) {
21329       SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "MDArray_GetView" "', argument " "1"" of type '" "GDALMDArrayHS *""'");
21330     }
21331     arg1 = reinterpret_cast< GDALMDArrayHS * >(argp1);
21332     res2 = SWIG_AsCharPtrAndSize(ST(1), &buf2, NULL, &alloc2);
21333     if (!SWIG_IsOK(res2)) {
21334       SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "MDArray_GetView" "', argument " "2"" of type '" "char const *""'");
21335     }
21336     arg2 = reinterpret_cast< char * >(buf2);
21337     {
21338       if (!arg2) {
21339         SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
21340       }
21341     }
21342     {
21343       CPLErrorReset();
21344       result = (GDALMDArrayHS *)GDALMDArrayHS_GetView(arg1,(char const *)arg2);
21345       CPLErr eclass = CPLGetLastErrorType();
21346       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
21347         do_confess( CPLGetLastErrorMsg(), 0 );
21348 
21349 
21350 
21351 
21352 
21353       }
21354 
21355 
21356       /*
21357           Make warnings regular Perl warnings. This duplicates the warning
21358           message if DontUseExceptions() is in effect (it is not by default).
21359           */
21360       if ( eclass == CE_Warning ) {
21361         warn( CPLGetLastErrorMsg(), "%s" );
21362       }
21363 
21364 
21365     }
21366     ST(argvi) = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GDALMDArrayHS, SWIG_OWNER | SWIG_SHADOW); argvi++ ;
21367 
21368     if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
21369     XSRETURN(argvi);
21370   fail:
21371 
21372     if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
21373     SWIG_croak_null();
21374   }
21375 }
21376 
21377 
XS(_wrap_MDArray_Transpose)21378 XS(_wrap_MDArray_Transpose) {
21379   {
21380     GDALMDArrayHS *arg1 = (GDALMDArrayHS *) 0 ;
21381     int arg2 ;
21382     int *arg3 = (int *) 0 ;
21383     void *argp1 = 0 ;
21384     int res1 = 0 ;
21385     int argvi = 0;
21386     GDALMDArrayHS *result = 0 ;
21387     dXSARGS;
21388 
21389     if ((items < 2) || (items > 2)) {
21390       SWIG_croak("Usage: MDArray_Transpose(self,nList,pList);");
21391     }
21392     res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_GDALMDArrayHS, 0 |  0 );
21393     if (!SWIG_IsOK(res1)) {
21394       SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "MDArray_Transpose" "', argument " "1"" of type '" "GDALMDArrayHS *""'");
21395     }
21396     arg1 = reinterpret_cast< GDALMDArrayHS * >(argp1);
21397     {
21398       /* %typemap(in,numinputs=1) (int nList, int* pList) */
21399       if (!(SvROK(ST(1)) && (SvTYPE(SvRV(ST(1)))==SVt_PVAV)))
21400       do_confess(NEED_ARRAY_REF, 1);
21401       AV *av = (AV*)(SvRV(ST(1)));
21402       arg2 = av_len(av)+1;
21403       arg3 = (int*)CPLMalloc(arg2*sizeof(int));
21404       if (arg3) {
21405         for( int i = 0; i<arg2; i++ ) {
21406           SV **sv = av_fetch(av, i, 0);
21407           arg3[i] =  SvIV(*sv);
21408         }
21409       } else
21410       SWIG_fail;
21411     }
21412     {
21413       CPLErrorReset();
21414       result = (GDALMDArrayHS *)GDALMDArrayHS_Transpose(arg1,arg2,arg3);
21415       CPLErr eclass = CPLGetLastErrorType();
21416       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
21417         do_confess( CPLGetLastErrorMsg(), 0 );
21418 
21419 
21420 
21421 
21422 
21423       }
21424 
21425 
21426       /*
21427           Make warnings regular Perl warnings. This duplicates the warning
21428           message if DontUseExceptions() is in effect (it is not by default).
21429           */
21430       if ( eclass == CE_Warning ) {
21431         warn( CPLGetLastErrorMsg(), "%s" );
21432       }
21433 
21434 
21435     }
21436     ST(argvi) = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GDALMDArrayHS, SWIG_OWNER | SWIG_SHADOW); argvi++ ;
21437 
21438     {
21439       /* %typemap(freearg) (int nList, int* pList) */
21440       CPLFree((void*) arg3);
21441     }
21442     XSRETURN(argvi);
21443   fail:
21444 
21445     {
21446       /* %typemap(freearg) (int nList, int* pList) */
21447       CPLFree((void*) arg3);
21448     }
21449     SWIG_croak_null();
21450   }
21451 }
21452 
21453 
XS(_wrap_MDArray_GetUnscaled)21454 XS(_wrap_MDArray_GetUnscaled) {
21455   {
21456     GDALMDArrayHS *arg1 = (GDALMDArrayHS *) 0 ;
21457     void *argp1 = 0 ;
21458     int res1 = 0 ;
21459     int argvi = 0;
21460     GDALMDArrayHS *result = 0 ;
21461     dXSARGS;
21462 
21463     if ((items < 1) || (items > 1)) {
21464       SWIG_croak("Usage: MDArray_GetUnscaled(self);");
21465     }
21466     res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_GDALMDArrayHS, 0 |  0 );
21467     if (!SWIG_IsOK(res1)) {
21468       SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "MDArray_GetUnscaled" "', argument " "1"" of type '" "GDALMDArrayHS *""'");
21469     }
21470     arg1 = reinterpret_cast< GDALMDArrayHS * >(argp1);
21471     {
21472       CPLErrorReset();
21473       result = (GDALMDArrayHS *)GDALMDArrayHS_GetUnscaled(arg1);
21474       CPLErr eclass = CPLGetLastErrorType();
21475       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
21476         do_confess( CPLGetLastErrorMsg(), 0 );
21477 
21478 
21479 
21480 
21481 
21482       }
21483 
21484 
21485       /*
21486           Make warnings regular Perl warnings. This duplicates the warning
21487           message if DontUseExceptions() is in effect (it is not by default).
21488           */
21489       if ( eclass == CE_Warning ) {
21490         warn( CPLGetLastErrorMsg(), "%s" );
21491       }
21492 
21493 
21494     }
21495     ST(argvi) = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GDALMDArrayHS, SWIG_OWNER | SWIG_SHADOW); argvi++ ;
21496 
21497     XSRETURN(argvi);
21498   fail:
21499 
21500     SWIG_croak_null();
21501   }
21502 }
21503 
21504 
XS(_wrap_MDArray_GetMask)21505 XS(_wrap_MDArray_GetMask) {
21506   {
21507     GDALMDArrayHS *arg1 = (GDALMDArrayHS *) 0 ;
21508     char **arg2 = (char **) 0 ;
21509     void *argp1 = 0 ;
21510     int res1 = 0 ;
21511     int argvi = 0;
21512     GDALMDArrayHS *result = 0 ;
21513     dXSARGS;
21514 
21515     if ((items < 1) || (items > 2)) {
21516       SWIG_croak("Usage: MDArray_GetMask(self,options);");
21517     }
21518     res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_GDALMDArrayHS, 0 |  0 );
21519     if (!SWIG_IsOK(res1)) {
21520       SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "MDArray_GetMask" "', argument " "1"" of type '" "GDALMDArrayHS *""'");
21521     }
21522     arg1 = reinterpret_cast< GDALMDArrayHS * >(argp1);
21523     if (items > 1) {
21524       {
21525         /* %typemap(in) char **options */
21526         if (SvOK(ST(1))) {
21527           if (SvROK(ST(1))) {
21528             if (SvTYPE(SvRV(ST(1)))==SVt_PVAV) {
21529               AV *av = (AV*)(SvRV(ST(1)));
21530               for (int i = 0; i < av_len(av)+1; i++) {
21531                 SV *sv = *(av_fetch(av, i, 0));
21532                 bool sf;
21533                 char *tmp = sv_to_utf8_string(sv, NULL, &sf);
21534                 arg2 = CSLAddString(arg2, tmp);
21535                 if (sf) Safefree(tmp); else free(tmp);
21536               }
21537             } else if (SvTYPE(SvRV(ST(1)))==SVt_PVHV) {
21538               HV *hv = (HV*)SvRV(ST(1));
21539               SV *sv;
21540               char *key;
21541               I32 klen;
21542               arg2 = NULL;
21543               hv_iterinit(hv);
21544               while(sv = hv_iternextsv(hv, &key, &klen)) {
21545                 bool sf;
21546                 char *tmp = sv_to_utf8_string(sv, NULL, &sf);
21547                 arg2 = CSLAddNameValue(arg2, key, tmp);
21548                 if (sf) Safefree(tmp); else free(tmp);
21549               }
21550             } else
21551             do_confess(NEED_REF, 1);
21552           } else
21553           do_confess(NEED_REF, 1);
21554         }
21555       }
21556     }
21557     {
21558       CPLErrorReset();
21559       result = (GDALMDArrayHS *)GDALMDArrayHS_GetMask(arg1,arg2);
21560       CPLErr eclass = CPLGetLastErrorType();
21561       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
21562         do_confess( CPLGetLastErrorMsg(), 0 );
21563 
21564 
21565 
21566 
21567 
21568       }
21569 
21570 
21571       /*
21572           Make warnings regular Perl warnings. This duplicates the warning
21573           message if DontUseExceptions() is in effect (it is not by default).
21574           */
21575       if ( eclass == CE_Warning ) {
21576         warn( CPLGetLastErrorMsg(), "%s" );
21577       }
21578 
21579 
21580     }
21581     ST(argvi) = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GDALMDArrayHS, SWIG_OWNER | SWIG_SHADOW); argvi++ ;
21582 
21583     {
21584       /* %typemap(freearg) char **options */
21585       if (arg2) CSLDestroy( arg2 );
21586     }
21587     XSRETURN(argvi);
21588   fail:
21589 
21590     {
21591       /* %typemap(freearg) char **options */
21592       if (arg2) CSLDestroy( arg2 );
21593     }
21594     SWIG_croak_null();
21595   }
21596 }
21597 
21598 
XS(_wrap_MDArray_AsClassicDataset)21599 XS(_wrap_MDArray_AsClassicDataset) {
21600   {
21601     GDALMDArrayHS *arg1 = (GDALMDArrayHS *) 0 ;
21602     size_t arg2 ;
21603     size_t arg3 ;
21604     void *argp1 = 0 ;
21605     int res1 = 0 ;
21606     size_t val2 ;
21607     int ecode2 = 0 ;
21608     size_t val3 ;
21609     int ecode3 = 0 ;
21610     int argvi = 0;
21611     GDALDatasetShadow *result = 0 ;
21612     dXSARGS;
21613 
21614     if ((items < 3) || (items > 3)) {
21615       SWIG_croak("Usage: MDArray_AsClassicDataset(self,iXDim,iYDim);");
21616     }
21617     res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_GDALMDArrayHS, 0 |  0 );
21618     if (!SWIG_IsOK(res1)) {
21619       SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "MDArray_AsClassicDataset" "', argument " "1"" of type '" "GDALMDArrayHS *""'");
21620     }
21621     arg1 = reinterpret_cast< GDALMDArrayHS * >(argp1);
21622     ecode2 = SWIG_AsVal_size_t SWIG_PERL_CALL_ARGS_2(ST(1), &val2);
21623     if (!SWIG_IsOK(ecode2)) {
21624       SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "MDArray_AsClassicDataset" "', argument " "2"" of type '" "size_t""'");
21625     }
21626     arg2 = static_cast< size_t >(val2);
21627     ecode3 = SWIG_AsVal_size_t SWIG_PERL_CALL_ARGS_2(ST(2), &val3);
21628     if (!SWIG_IsOK(ecode3)) {
21629       SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "MDArray_AsClassicDataset" "', argument " "3"" of type '" "size_t""'");
21630     }
21631     arg3 = static_cast< size_t >(val3);
21632     {
21633       CPLErrorReset();
21634       result = (GDALDatasetShadow *)GDALMDArrayHS_AsClassicDataset(arg1,arg2,arg3);
21635       CPLErr eclass = CPLGetLastErrorType();
21636       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
21637         do_confess( CPLGetLastErrorMsg(), 0 );
21638 
21639 
21640 
21641 
21642 
21643       }
21644 
21645 
21646       /*
21647           Make warnings regular Perl warnings. This duplicates the warning
21648           message if DontUseExceptions() is in effect (it is not by default).
21649           */
21650       if ( eclass == CE_Warning ) {
21651         warn( CPLGetLastErrorMsg(), "%s" );
21652       }
21653 
21654 
21655     }
21656     ST(argvi) = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GDALDatasetShadow, SWIG_OWNER | SWIG_SHADOW); argvi++ ;
21657 
21658 
21659 
21660     XSRETURN(argvi);
21661   fail:
21662 
21663 
21664 
21665     SWIG_croak_null();
21666   }
21667 }
21668 
21669 
XS(_wrap_MDArray_GetStatistics)21670 XS(_wrap_MDArray_GetStatistics) {
21671   {
21672     GDALMDArrayHS *arg1 = (GDALMDArrayHS *) 0 ;
21673     GDALDatasetShadow *arg2 = (GDALDatasetShadow *) NULL ;
21674     bool arg3 = (bool) FALSE ;
21675     bool arg4 = (bool) TRUE ;
21676     GDALProgressFunc arg5 = (GDALProgressFunc) NULL ;
21677     void *arg6 = (void *) NULL ;
21678     void *argp1 = 0 ;
21679     int res1 = 0 ;
21680     bool val3 ;
21681     int ecode3 = 0 ;
21682     bool val4 ;
21683     int ecode4 = 0 ;
21684     int argvi = 0;
21685     Statistics *result = 0 ;
21686     dXSARGS;
21687 
21688     /* %typemap(arginit, noblock=1) ( void* callback_data = NULL) */
21689     SavedEnv saved_env;
21690     saved_env.fct = NULL;
21691     saved_env.data = &PL_sv_undef;
21692     arg6 = (void *)(&saved_env);
21693     if ((items < 1) || (items > 6)) {
21694       SWIG_croak("Usage: MDArray_GetStatistics(self,ds,approx_ok,force,callback,callback_data);");
21695     }
21696     res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_GDALMDArrayHS, 0 |  0 );
21697     if (!SWIG_IsOK(res1)) {
21698       SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "MDArray_GetStatistics" "', argument " "1"" of type '" "GDALMDArrayHS *""'");
21699     }
21700     arg1 = reinterpret_cast< GDALMDArrayHS * >(argp1);
21701     if (items > 1) {
21702       {
21703         /* %typemap(in) (GDALDatasetShadow *) */
21704         void *argp = 0;
21705         int res = SWIG_ConvertPtr(ST(1), &argp, SWIGTYPE_p_GDALDatasetShadow, 0 |  0 );
21706         if (!SWIG_IsOK(res)) {
21707           do_confess(WRONG_CLASS, 1);
21708         }
21709         arg2 = reinterpret_cast< GDALDatasetShadow * >(argp);
21710         if (arg2 == NULL)
21711         do_confess(NEED_DEF, 1);
21712       }
21713     }
21714     if (items > 2) {
21715       ecode3 = SWIG_AsVal_bool SWIG_PERL_CALL_ARGS_2(ST(2), &val3);
21716       if (!SWIG_IsOK(ecode3)) {
21717         SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "MDArray_GetStatistics" "', argument " "3"" of type '" "bool""'");
21718       }
21719       arg3 = static_cast< bool >(val3);
21720     }
21721     if (items > 3) {
21722       ecode4 = SWIG_AsVal_bool SWIG_PERL_CALL_ARGS_2(ST(3), &val4);
21723       if (!SWIG_IsOK(ecode4)) {
21724         SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "MDArray_GetStatistics" "', argument " "4"" of type '" "bool""'");
21725       }
21726       arg4 = static_cast< bool >(val4);
21727     }
21728     if (items > 4) {
21729       {
21730         /* %typemap(in) (GDALProgressFunc callback = NULL) */
21731         if (SvOK(ST(4))) {
21732           if (SvROK(ST(4))) {
21733             if (SvTYPE(SvRV(ST(4))) != SVt_PVCV) {
21734               do_confess(NEED_CODE_REF, 1);
21735             } else {
21736               saved_env.fct = (SV *)ST(4);
21737               arg5 = &callback_d_cp_vp;
21738             }
21739           } else {
21740             do_confess(NEED_CODE_REF, 1);
21741           }
21742         }
21743       }
21744     }
21745     if (items > 5) {
21746       {
21747         /* %typemap(in) (void* callback_data=NULL) */
21748         if (SvOK(ST(5)))
21749         saved_env.data = (SV *)ST(5);
21750       }
21751     }
21752     {
21753       CPLErrorReset();
21754       result = (Statistics *)GDALMDArrayHS_GetStatistics(arg1,arg2,arg3,arg4,arg5,arg6);
21755       CPLErr eclass = CPLGetLastErrorType();
21756       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
21757         do_confess( CPLGetLastErrorMsg(), 0 );
21758 
21759 
21760 
21761 
21762 
21763       }
21764 
21765 
21766       /*
21767           Make warnings regular Perl warnings. This duplicates the warning
21768           message if DontUseExceptions() is in effect (it is not by default).
21769           */
21770       if ( eclass == CE_Warning ) {
21771         warn( CPLGetLastErrorMsg(), "%s" );
21772       }
21773 
21774 
21775     }
21776     ST(argvi) = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_Statistics, 0 | SWIG_SHADOW); argvi++ ;
21777 
21778 
21779 
21780 
21781 
21782     XSRETURN(argvi);
21783   fail:
21784 
21785 
21786 
21787 
21788 
21789     SWIG_croak_null();
21790   }
21791 }
21792 
21793 
XS(_wrap_MDArray_ComputeStatistics)21794 XS(_wrap_MDArray_ComputeStatistics) {
21795   {
21796     GDALMDArrayHS *arg1 = (GDALMDArrayHS *) 0 ;
21797     GDALDatasetShadow *arg2 = (GDALDatasetShadow *) NULL ;
21798     bool arg3 = (bool) FALSE ;
21799     GDALProgressFunc arg4 = (GDALProgressFunc) NULL ;
21800     void *arg5 = (void *) NULL ;
21801     void *argp1 = 0 ;
21802     int res1 = 0 ;
21803     bool val3 ;
21804     int ecode3 = 0 ;
21805     int argvi = 0;
21806     Statistics *result = 0 ;
21807     dXSARGS;
21808 
21809     /* %typemap(arginit, noblock=1) ( void* callback_data = NULL) */
21810     SavedEnv saved_env;
21811     saved_env.fct = NULL;
21812     saved_env.data = &PL_sv_undef;
21813     arg5 = (void *)(&saved_env);
21814     if ((items < 1) || (items > 5)) {
21815       SWIG_croak("Usage: MDArray_ComputeStatistics(self,ds,approx_ok,callback,callback_data);");
21816     }
21817     res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_GDALMDArrayHS, 0 |  0 );
21818     if (!SWIG_IsOK(res1)) {
21819       SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "MDArray_ComputeStatistics" "', argument " "1"" of type '" "GDALMDArrayHS *""'");
21820     }
21821     arg1 = reinterpret_cast< GDALMDArrayHS * >(argp1);
21822     if (items > 1) {
21823       {
21824         /* %typemap(in) (GDALDatasetShadow *) */
21825         void *argp = 0;
21826         int res = SWIG_ConvertPtr(ST(1), &argp, SWIGTYPE_p_GDALDatasetShadow, 0 |  0 );
21827         if (!SWIG_IsOK(res)) {
21828           do_confess(WRONG_CLASS, 1);
21829         }
21830         arg2 = reinterpret_cast< GDALDatasetShadow * >(argp);
21831         if (arg2 == NULL)
21832         do_confess(NEED_DEF, 1);
21833       }
21834     }
21835     if (items > 2) {
21836       ecode3 = SWIG_AsVal_bool SWIG_PERL_CALL_ARGS_2(ST(2), &val3);
21837       if (!SWIG_IsOK(ecode3)) {
21838         SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "MDArray_ComputeStatistics" "', argument " "3"" of type '" "bool""'");
21839       }
21840       arg3 = static_cast< bool >(val3);
21841     }
21842     if (items > 3) {
21843       {
21844         /* %typemap(in) (GDALProgressFunc callback = NULL) */
21845         if (SvOK(ST(3))) {
21846           if (SvROK(ST(3))) {
21847             if (SvTYPE(SvRV(ST(3))) != SVt_PVCV) {
21848               do_confess(NEED_CODE_REF, 1);
21849             } else {
21850               saved_env.fct = (SV *)ST(3);
21851               arg4 = &callback_d_cp_vp;
21852             }
21853           } else {
21854             do_confess(NEED_CODE_REF, 1);
21855           }
21856         }
21857       }
21858     }
21859     if (items > 4) {
21860       {
21861         /* %typemap(in) (void* callback_data=NULL) */
21862         if (SvOK(ST(4)))
21863         saved_env.data = (SV *)ST(4);
21864       }
21865     }
21866     {
21867       CPLErrorReset();
21868       result = (Statistics *)GDALMDArrayHS_ComputeStatistics(arg1,arg2,arg3,arg4,arg5);
21869       CPLErr eclass = CPLGetLastErrorType();
21870       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
21871         do_confess( CPLGetLastErrorMsg(), 0 );
21872 
21873 
21874 
21875 
21876 
21877       }
21878 
21879 
21880       /*
21881           Make warnings regular Perl warnings. This duplicates the warning
21882           message if DontUseExceptions() is in effect (it is not by default).
21883           */
21884       if ( eclass == CE_Warning ) {
21885         warn( CPLGetLastErrorMsg(), "%s" );
21886       }
21887 
21888 
21889     }
21890     ST(argvi) = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_Statistics, 0 | SWIG_SHADOW); argvi++ ;
21891 
21892 
21893 
21894 
21895     XSRETURN(argvi);
21896   fail:
21897 
21898 
21899 
21900 
21901     SWIG_croak_null();
21902   }
21903 }
21904 
21905 
XS(_wrap_delete_Attribute)21906 XS(_wrap_delete_Attribute) {
21907   {
21908     GDALAttributeHS *arg1 = (GDALAttributeHS *) 0 ;
21909     void *argp1 = 0 ;
21910     int res1 = 0 ;
21911     int argvi = 0;
21912     dXSARGS;
21913 
21914     if ((items < 1) || (items > 1)) {
21915       SWIG_croak("Usage: delete_Attribute(self);");
21916     }
21917     res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_GDALAttributeHS, SWIG_POINTER_DISOWN |  0 );
21918     if (!SWIG_IsOK(res1)) {
21919       SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_Attribute" "', argument " "1"" of type '" "GDALAttributeHS *""'");
21920     }
21921     arg1 = reinterpret_cast< GDALAttributeHS * >(argp1);
21922     {
21923       CPLErrorReset();
21924       delete_GDALAttributeHS(arg1);
21925       CPLErr eclass = CPLGetLastErrorType();
21926       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
21927         do_confess( CPLGetLastErrorMsg(), 0 );
21928 
21929 
21930 
21931 
21932 
21933       }
21934 
21935 
21936       /*
21937           Make warnings regular Perl warnings. This duplicates the warning
21938           message if DontUseExceptions() is in effect (it is not by default).
21939           */
21940       if ( eclass == CE_Warning ) {
21941         warn( CPLGetLastErrorMsg(), "%s" );
21942       }
21943 
21944 
21945     }
21946     {
21947       /* %typemap(out) void */
21948     }
21949 
21950     XSRETURN(argvi);
21951   fail:
21952 
21953     SWIG_croak_null();
21954   }
21955 }
21956 
21957 
XS(_wrap_Attribute_GetName)21958 XS(_wrap_Attribute_GetName) {
21959   {
21960     GDALAttributeHS *arg1 = (GDALAttributeHS *) 0 ;
21961     void *argp1 = 0 ;
21962     int res1 = 0 ;
21963     int argvi = 0;
21964     char *result = 0 ;
21965     dXSARGS;
21966 
21967     if ((items < 1) || (items > 1)) {
21968       SWIG_croak("Usage: Attribute_GetName(self);");
21969     }
21970     res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_GDALAttributeHS, 0 |  0 );
21971     if (!SWIG_IsOK(res1)) {
21972       SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Attribute_GetName" "', argument " "1"" of type '" "GDALAttributeHS *""'");
21973     }
21974     arg1 = reinterpret_cast< GDALAttributeHS * >(argp1);
21975     {
21976       CPLErrorReset();
21977       result = (char *)GDALAttributeHS_GetName(arg1);
21978       CPLErr eclass = CPLGetLastErrorType();
21979       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
21980         do_confess( CPLGetLastErrorMsg(), 0 );
21981 
21982 
21983 
21984 
21985 
21986       }
21987 
21988 
21989       /*
21990           Make warnings regular Perl warnings. This duplicates the warning
21991           message if DontUseExceptions() is in effect (it is not by default).
21992           */
21993       if ( eclass == CE_Warning ) {
21994         warn( CPLGetLastErrorMsg(), "%s" );
21995       }
21996 
21997 
21998     }
21999     {
22000       /* %typemap(out) const char * */
22001       ST(argvi) = newSVpv(result, 0);
22002       SvUTF8_on(ST(argvi)); /* expecting GDAL to give us UTF-8 */
22003       sv_2mortal(ST(argvi));
22004       argvi++;
22005     }
22006 
22007     XSRETURN(argvi);
22008   fail:
22009 
22010     SWIG_croak_null();
22011   }
22012 }
22013 
22014 
XS(_wrap_Attribute_GetFullName)22015 XS(_wrap_Attribute_GetFullName) {
22016   {
22017     GDALAttributeHS *arg1 = (GDALAttributeHS *) 0 ;
22018     void *argp1 = 0 ;
22019     int res1 = 0 ;
22020     int argvi = 0;
22021     char *result = 0 ;
22022     dXSARGS;
22023 
22024     if ((items < 1) || (items > 1)) {
22025       SWIG_croak("Usage: Attribute_GetFullName(self);");
22026     }
22027     res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_GDALAttributeHS, 0 |  0 );
22028     if (!SWIG_IsOK(res1)) {
22029       SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Attribute_GetFullName" "', argument " "1"" of type '" "GDALAttributeHS *""'");
22030     }
22031     arg1 = reinterpret_cast< GDALAttributeHS * >(argp1);
22032     {
22033       CPLErrorReset();
22034       result = (char *)GDALAttributeHS_GetFullName(arg1);
22035       CPLErr eclass = CPLGetLastErrorType();
22036       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
22037         do_confess( CPLGetLastErrorMsg(), 0 );
22038 
22039 
22040 
22041 
22042 
22043       }
22044 
22045 
22046       /*
22047           Make warnings regular Perl warnings. This duplicates the warning
22048           message if DontUseExceptions() is in effect (it is not by default).
22049           */
22050       if ( eclass == CE_Warning ) {
22051         warn( CPLGetLastErrorMsg(), "%s" );
22052       }
22053 
22054 
22055     }
22056     {
22057       /* %typemap(out) const char * */
22058       ST(argvi) = newSVpv(result, 0);
22059       SvUTF8_on(ST(argvi)); /* expecting GDAL to give us UTF-8 */
22060       sv_2mortal(ST(argvi));
22061       argvi++;
22062     }
22063 
22064     XSRETURN(argvi);
22065   fail:
22066 
22067     SWIG_croak_null();
22068   }
22069 }
22070 
22071 
XS(_wrap_Attribute_GetTotalElementsCount)22072 XS(_wrap_Attribute_GetTotalElementsCount) {
22073   {
22074     GDALAttributeHS *arg1 = (GDALAttributeHS *) 0 ;
22075     void *argp1 = 0 ;
22076     int res1 = 0 ;
22077     int argvi = 0;
22078     unsigned long long result;
22079     dXSARGS;
22080 
22081     if ((items < 1) || (items > 1)) {
22082       SWIG_croak("Usage: Attribute_GetTotalElementsCount(self);");
22083     }
22084     res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_GDALAttributeHS, 0 |  0 );
22085     if (!SWIG_IsOK(res1)) {
22086       SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Attribute_GetTotalElementsCount" "', argument " "1"" of type '" "GDALAttributeHS *""'");
22087     }
22088     arg1 = reinterpret_cast< GDALAttributeHS * >(argp1);
22089     {
22090       CPLErrorReset();
22091       result = (unsigned long long)GDALAttributeHS_GetTotalElementsCount(arg1);
22092       CPLErr eclass = CPLGetLastErrorType();
22093       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
22094         do_confess( CPLGetLastErrorMsg(), 0 );
22095 
22096 
22097 
22098 
22099 
22100       }
22101 
22102 
22103       /*
22104           Make warnings regular Perl warnings. This duplicates the warning
22105           message if DontUseExceptions() is in effect (it is not by default).
22106           */
22107       if ( eclass == CE_Warning ) {
22108         warn( CPLGetLastErrorMsg(), "%s" );
22109       }
22110 
22111 
22112     }
22113     ST(argvi) = SWIG_From_unsigned_SS_long_SS_long  SWIG_PERL_CALL_ARGS_1(static_cast< unsigned long long >(result)); argvi++ ;
22114 
22115     XSRETURN(argvi);
22116   fail:
22117 
22118     SWIG_croak_null();
22119   }
22120 }
22121 
22122 
XS(_wrap_Attribute_GetDimensionCount)22123 XS(_wrap_Attribute_GetDimensionCount) {
22124   {
22125     GDALAttributeHS *arg1 = (GDALAttributeHS *) 0 ;
22126     void *argp1 = 0 ;
22127     int res1 = 0 ;
22128     int argvi = 0;
22129     size_t result;
22130     dXSARGS;
22131 
22132     if ((items < 1) || (items > 1)) {
22133       SWIG_croak("Usage: Attribute_GetDimensionCount(self);");
22134     }
22135     res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_GDALAttributeHS, 0 |  0 );
22136     if (!SWIG_IsOK(res1)) {
22137       SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Attribute_GetDimensionCount" "', argument " "1"" of type '" "GDALAttributeHS *""'");
22138     }
22139     arg1 = reinterpret_cast< GDALAttributeHS * >(argp1);
22140     {
22141       CPLErrorReset();
22142       result = GDALAttributeHS_GetDimensionCount(arg1);
22143       CPLErr eclass = CPLGetLastErrorType();
22144       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
22145         do_confess( CPLGetLastErrorMsg(), 0 );
22146 
22147 
22148 
22149 
22150 
22151       }
22152 
22153 
22154       /*
22155           Make warnings regular Perl warnings. This duplicates the warning
22156           message if DontUseExceptions() is in effect (it is not by default).
22157           */
22158       if ( eclass == CE_Warning ) {
22159         warn( CPLGetLastErrorMsg(), "%s" );
22160       }
22161 
22162 
22163     }
22164     ST(argvi) = SWIG_From_size_t  SWIG_PERL_CALL_ARGS_1(static_cast< size_t >(result)); argvi++ ;
22165 
22166     XSRETURN(argvi);
22167   fail:
22168 
22169     SWIG_croak_null();
22170   }
22171 }
22172 
22173 
XS(_wrap_Attribute_GetDataType)22174 XS(_wrap_Attribute_GetDataType) {
22175   {
22176     GDALAttributeHS *arg1 = (GDALAttributeHS *) 0 ;
22177     void *argp1 = 0 ;
22178     int res1 = 0 ;
22179     int argvi = 0;
22180     GDALExtendedDataTypeHS *result = 0 ;
22181     dXSARGS;
22182 
22183     if ((items < 1) || (items > 1)) {
22184       SWIG_croak("Usage: Attribute_GetDataType(self);");
22185     }
22186     res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_GDALAttributeHS, 0 |  0 );
22187     if (!SWIG_IsOK(res1)) {
22188       SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Attribute_GetDataType" "', argument " "1"" of type '" "GDALAttributeHS *""'");
22189     }
22190     arg1 = reinterpret_cast< GDALAttributeHS * >(argp1);
22191     {
22192       CPLErrorReset();
22193       result = (GDALExtendedDataTypeHS *)GDALAttributeHS_GetDataType(arg1);
22194       CPLErr eclass = CPLGetLastErrorType();
22195       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
22196         do_confess( CPLGetLastErrorMsg(), 0 );
22197 
22198 
22199 
22200 
22201 
22202       }
22203 
22204 
22205       /*
22206           Make warnings regular Perl warnings. This duplicates the warning
22207           message if DontUseExceptions() is in effect (it is not by default).
22208           */
22209       if ( eclass == CE_Warning ) {
22210         warn( CPLGetLastErrorMsg(), "%s" );
22211       }
22212 
22213 
22214     }
22215     ST(argvi) = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GDALExtendedDataTypeHS, SWIG_OWNER | SWIG_SHADOW); argvi++ ;
22216 
22217     XSRETURN(argvi);
22218   fail:
22219 
22220     SWIG_croak_null();
22221   }
22222 }
22223 
22224 
XS(_wrap_Attribute_ReadAsString)22225 XS(_wrap_Attribute_ReadAsString) {
22226   {
22227     GDALAttributeHS *arg1 = (GDALAttributeHS *) 0 ;
22228     void *argp1 = 0 ;
22229     int res1 = 0 ;
22230     int argvi = 0;
22231     char *result = 0 ;
22232     dXSARGS;
22233 
22234     if ((items < 1) || (items > 1)) {
22235       SWIG_croak("Usage: Attribute_ReadAsString(self);");
22236     }
22237     res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_GDALAttributeHS, 0 |  0 );
22238     if (!SWIG_IsOK(res1)) {
22239       SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Attribute_ReadAsString" "', argument " "1"" of type '" "GDALAttributeHS *""'");
22240     }
22241     arg1 = reinterpret_cast< GDALAttributeHS * >(argp1);
22242     {
22243       CPLErrorReset();
22244       result = (char *)GDALAttributeHS_ReadAsString(arg1);
22245       CPLErr eclass = CPLGetLastErrorType();
22246       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
22247         do_confess( CPLGetLastErrorMsg(), 0 );
22248 
22249 
22250 
22251 
22252 
22253       }
22254 
22255 
22256       /*
22257           Make warnings regular Perl warnings. This duplicates the warning
22258           message if DontUseExceptions() is in effect (it is not by default).
22259           */
22260       if ( eclass == CE_Warning ) {
22261         warn( CPLGetLastErrorMsg(), "%s" );
22262       }
22263 
22264 
22265     }
22266     {
22267       /* %typemap(out) const char * */
22268       ST(argvi) = newSVpv(result, 0);
22269       SvUTF8_on(ST(argvi)); /* expecting GDAL to give us UTF-8 */
22270       sv_2mortal(ST(argvi));
22271       argvi++;
22272     }
22273 
22274     XSRETURN(argvi);
22275   fail:
22276 
22277     SWIG_croak_null();
22278   }
22279 }
22280 
22281 
XS(_wrap_Attribute_ReadAsInt)22282 XS(_wrap_Attribute_ReadAsInt) {
22283   {
22284     GDALAttributeHS *arg1 = (GDALAttributeHS *) 0 ;
22285     void *argp1 = 0 ;
22286     int res1 = 0 ;
22287     int argvi = 0;
22288     int result;
22289     dXSARGS;
22290 
22291     if ((items < 1) || (items > 1)) {
22292       SWIG_croak("Usage: Attribute_ReadAsInt(self);");
22293     }
22294     res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_GDALAttributeHS, 0 |  0 );
22295     if (!SWIG_IsOK(res1)) {
22296       SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Attribute_ReadAsInt" "', argument " "1"" of type '" "GDALAttributeHS *""'");
22297     }
22298     arg1 = reinterpret_cast< GDALAttributeHS * >(argp1);
22299     {
22300       CPLErrorReset();
22301       result = (int)GDALAttributeHS_ReadAsInt(arg1);
22302       CPLErr eclass = CPLGetLastErrorType();
22303       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
22304         do_confess( CPLGetLastErrorMsg(), 0 );
22305 
22306 
22307 
22308 
22309 
22310       }
22311 
22312 
22313       /*
22314           Make warnings regular Perl warnings. This duplicates the warning
22315           message if DontUseExceptions() is in effect (it is not by default).
22316           */
22317       if ( eclass == CE_Warning ) {
22318         warn( CPLGetLastErrorMsg(), "%s" );
22319       }
22320 
22321 
22322     }
22323     ST(argvi) = SWIG_From_int  SWIG_PERL_CALL_ARGS_1(static_cast< int >(result)); argvi++ ;
22324 
22325     XSRETURN(argvi);
22326   fail:
22327 
22328     SWIG_croak_null();
22329   }
22330 }
22331 
22332 
XS(_wrap_Attribute_ReadAsDouble)22333 XS(_wrap_Attribute_ReadAsDouble) {
22334   {
22335     GDALAttributeHS *arg1 = (GDALAttributeHS *) 0 ;
22336     void *argp1 = 0 ;
22337     int res1 = 0 ;
22338     int argvi = 0;
22339     double result;
22340     dXSARGS;
22341 
22342     if ((items < 1) || (items > 1)) {
22343       SWIG_croak("Usage: Attribute_ReadAsDouble(self);");
22344     }
22345     res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_GDALAttributeHS, 0 |  0 );
22346     if (!SWIG_IsOK(res1)) {
22347       SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Attribute_ReadAsDouble" "', argument " "1"" of type '" "GDALAttributeHS *""'");
22348     }
22349     arg1 = reinterpret_cast< GDALAttributeHS * >(argp1);
22350     {
22351       CPLErrorReset();
22352       result = (double)GDALAttributeHS_ReadAsDouble(arg1);
22353       CPLErr eclass = CPLGetLastErrorType();
22354       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
22355         do_confess( CPLGetLastErrorMsg(), 0 );
22356 
22357 
22358 
22359 
22360 
22361       }
22362 
22363 
22364       /*
22365           Make warnings regular Perl warnings. This duplicates the warning
22366           message if DontUseExceptions() is in effect (it is not by default).
22367           */
22368       if ( eclass == CE_Warning ) {
22369         warn( CPLGetLastErrorMsg(), "%s" );
22370       }
22371 
22372 
22373     }
22374     ST(argvi) = SWIG_From_double  SWIG_PERL_CALL_ARGS_1(static_cast< double >(result)); argvi++ ;
22375 
22376     XSRETURN(argvi);
22377   fail:
22378 
22379     SWIG_croak_null();
22380   }
22381 }
22382 
22383 
XS(_wrap_Attribute_ReadAsStringArray)22384 XS(_wrap_Attribute_ReadAsStringArray) {
22385   {
22386     GDALAttributeHS *arg1 = (GDALAttributeHS *) 0 ;
22387     void *argp1 = 0 ;
22388     int res1 = 0 ;
22389     int argvi = 0;
22390     char **result = 0 ;
22391     dXSARGS;
22392 
22393     if ((items < 1) || (items > 1)) {
22394       SWIG_croak("Usage: Attribute_ReadAsStringArray(self);");
22395     }
22396     res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_GDALAttributeHS, 0 |  0 );
22397     if (!SWIG_IsOK(res1)) {
22398       SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Attribute_ReadAsStringArray" "', argument " "1"" of type '" "GDALAttributeHS *""'");
22399     }
22400     arg1 = reinterpret_cast< GDALAttributeHS * >(argp1);
22401     {
22402       CPLErrorReset();
22403       result = (char **)GDALAttributeHS_ReadAsStringArray(arg1);
22404       CPLErr eclass = CPLGetLastErrorType();
22405       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
22406         do_confess( CPLGetLastErrorMsg(), 0 );
22407 
22408 
22409 
22410 
22411 
22412       }
22413 
22414 
22415       /*
22416           Make warnings regular Perl warnings. This duplicates the warning
22417           message if DontUseExceptions() is in effect (it is not by default).
22418           */
22419       if ( eclass == CE_Warning ) {
22420         warn( CPLGetLastErrorMsg(), "%s" );
22421       }
22422 
22423 
22424     }
22425     {
22426       /* %typemap(out) char **CSL */
22427       if (GIMME_V == G_ARRAY) {
22428         if (result) {
22429           int n = CSLCount(result);
22430           EXTEND(SP, argvi+n-items+1);
22431           int i;
22432           for (i = 0; result[i]; i++) {
22433             SV *sv = newSVpv(result[i], 0);
22434             SvUTF8_on(sv); /* expecting GDAL to give us UTF-8 */
22435             ST(argvi++) = sv_2mortal(sv);
22436           }
22437           CSLDestroy(result);
22438         }
22439       } else {
22440         AV *av = (AV*)sv_2mortal((SV*)newAV());
22441         if (result) {
22442           int i;
22443           for (i = 0; result[i]; i++) {
22444             SV *sv = newSVpv(result[i], 0);
22445             SvUTF8_on(sv); /* expecting GDAL to give us UTF-8 */
22446             av_push(av, sv);
22447           }
22448           CSLDestroy(result);
22449         }
22450         ST(argvi) = newRV((SV*)av);
22451         sv_2mortal(ST(argvi));
22452         argvi++;
22453       }
22454     }
22455 
22456     XSRETURN(argvi);
22457   fail:
22458 
22459     SWIG_croak_null();
22460   }
22461 }
22462 
22463 
XS(_wrap_Attribute_WriteString)22464 XS(_wrap_Attribute_WriteString) {
22465   {
22466     GDALAttributeHS *arg1 = (GDALAttributeHS *) 0 ;
22467     char *arg2 = (char *) 0 ;
22468     void *argp1 = 0 ;
22469     int res1 = 0 ;
22470     int res2 ;
22471     char *buf2 = 0 ;
22472     int alloc2 = 0 ;
22473     int argvi = 0;
22474     CPLErr result;
22475     dXSARGS;
22476 
22477     if ((items < 2) || (items > 2)) {
22478       SWIG_croak("Usage: Attribute_WriteString(self,val);");
22479     }
22480     res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_GDALAttributeHS, 0 |  0 );
22481     if (!SWIG_IsOK(res1)) {
22482       SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Attribute_WriteString" "', argument " "1"" of type '" "GDALAttributeHS *""'");
22483     }
22484     arg1 = reinterpret_cast< GDALAttributeHS * >(argp1);
22485     res2 = SWIG_AsCharPtrAndSize(ST(1), &buf2, NULL, &alloc2);
22486     if (!SWIG_IsOK(res2)) {
22487       SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Attribute_WriteString" "', argument " "2"" of type '" "char const *""'");
22488     }
22489     arg2 = reinterpret_cast< char * >(buf2);
22490     {
22491       CPLErrorReset();
22492       result = (CPLErr)GDALAttributeHS_WriteString(arg1,(char const *)arg2);
22493       CPLErr eclass = CPLGetLastErrorType();
22494       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
22495         do_confess( CPLGetLastErrorMsg(), 0 );
22496 
22497 
22498 
22499 
22500 
22501       }
22502 
22503 
22504       /*
22505           Make warnings regular Perl warnings. This duplicates the warning
22506           message if DontUseExceptions() is in effect (it is not by default).
22507           */
22508       if ( eclass == CE_Warning ) {
22509         warn( CPLGetLastErrorMsg(), "%s" );
22510       }
22511 
22512 
22513     }
22514     {
22515       /* %typemap(out) CPLErr */
22516     }
22517 
22518     if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
22519     XSRETURN(argvi);
22520   fail:
22521 
22522     if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
22523     SWIG_croak_null();
22524   }
22525 }
22526 
22527 
XS(_wrap_Attribute_WriteStringArray)22528 XS(_wrap_Attribute_WriteStringArray) {
22529   {
22530     GDALAttributeHS *arg1 = (GDALAttributeHS *) 0 ;
22531     char **arg2 = (char **) 0 ;
22532     void *argp1 = 0 ;
22533     int res1 = 0 ;
22534     int argvi = 0;
22535     CPLErr result;
22536     dXSARGS;
22537 
22538     if ((items < 2) || (items > 2)) {
22539       SWIG_croak("Usage: Attribute_WriteStringArray(self,vals);");
22540     }
22541     res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_GDALAttributeHS, 0 |  0 );
22542     if (!SWIG_IsOK(res1)) {
22543       SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Attribute_WriteStringArray" "', argument " "1"" of type '" "GDALAttributeHS *""'");
22544     }
22545     arg1 = reinterpret_cast< GDALAttributeHS * >(argp1);
22546     {
22547       /* %typemap(in) char **options */
22548       if (SvOK(ST(1))) {
22549         if (SvROK(ST(1))) {
22550           if (SvTYPE(SvRV(ST(1)))==SVt_PVAV) {
22551             AV *av = (AV*)(SvRV(ST(1)));
22552             for (int i = 0; i < av_len(av)+1; i++) {
22553               SV *sv = *(av_fetch(av, i, 0));
22554               bool sf;
22555               char *tmp = sv_to_utf8_string(sv, NULL, &sf);
22556               arg2 = CSLAddString(arg2, tmp);
22557               if (sf) Safefree(tmp); else free(tmp);
22558             }
22559           } else if (SvTYPE(SvRV(ST(1)))==SVt_PVHV) {
22560             HV *hv = (HV*)SvRV(ST(1));
22561             SV *sv;
22562             char *key;
22563             I32 klen;
22564             arg2 = NULL;
22565             hv_iterinit(hv);
22566             while(sv = hv_iternextsv(hv, &key, &klen)) {
22567               bool sf;
22568               char *tmp = sv_to_utf8_string(sv, NULL, &sf);
22569               arg2 = CSLAddNameValue(arg2, key, tmp);
22570               if (sf) Safefree(tmp); else free(tmp);
22571             }
22572           } else
22573           do_confess(NEED_REF, 1);
22574         } else
22575         do_confess(NEED_REF, 1);
22576       }
22577     }
22578     {
22579       CPLErrorReset();
22580       result = (CPLErr)GDALAttributeHS_WriteStringArray(arg1,arg2);
22581       CPLErr eclass = CPLGetLastErrorType();
22582       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
22583         do_confess( CPLGetLastErrorMsg(), 0 );
22584 
22585 
22586 
22587 
22588 
22589       }
22590 
22591 
22592       /*
22593           Make warnings regular Perl warnings. This duplicates the warning
22594           message if DontUseExceptions() is in effect (it is not by default).
22595           */
22596       if ( eclass == CE_Warning ) {
22597         warn( CPLGetLastErrorMsg(), "%s" );
22598       }
22599 
22600 
22601     }
22602     {
22603       /* %typemap(out) CPLErr */
22604     }
22605 
22606     {
22607       /* %typemap(freearg) char **options */
22608       if (arg2) CSLDestroy( arg2 );
22609     }
22610     XSRETURN(argvi);
22611   fail:
22612 
22613     {
22614       /* %typemap(freearg) char **options */
22615       if (arg2) CSLDestroy( arg2 );
22616     }
22617     SWIG_croak_null();
22618   }
22619 }
22620 
22621 
XS(_wrap_Attribute_WriteInt)22622 XS(_wrap_Attribute_WriteInt) {
22623   {
22624     GDALAttributeHS *arg1 = (GDALAttributeHS *) 0 ;
22625     int arg2 ;
22626     void *argp1 = 0 ;
22627     int res1 = 0 ;
22628     int val2 ;
22629     int ecode2 = 0 ;
22630     int argvi = 0;
22631     CPLErr result;
22632     dXSARGS;
22633 
22634     if ((items < 2) || (items > 2)) {
22635       SWIG_croak("Usage: Attribute_WriteInt(self,val);");
22636     }
22637     res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_GDALAttributeHS, 0 |  0 );
22638     if (!SWIG_IsOK(res1)) {
22639       SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Attribute_WriteInt" "', argument " "1"" of type '" "GDALAttributeHS *""'");
22640     }
22641     arg1 = reinterpret_cast< GDALAttributeHS * >(argp1);
22642     ecode2 = SWIG_AsVal_int SWIG_PERL_CALL_ARGS_2(ST(1), &val2);
22643     if (!SWIG_IsOK(ecode2)) {
22644       SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Attribute_WriteInt" "', argument " "2"" of type '" "int""'");
22645     }
22646     arg2 = static_cast< int >(val2);
22647     {
22648       CPLErrorReset();
22649       result = (CPLErr)GDALAttributeHS_WriteInt(arg1,arg2);
22650       CPLErr eclass = CPLGetLastErrorType();
22651       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
22652         do_confess( CPLGetLastErrorMsg(), 0 );
22653 
22654 
22655 
22656 
22657 
22658       }
22659 
22660 
22661       /*
22662           Make warnings regular Perl warnings. This duplicates the warning
22663           message if DontUseExceptions() is in effect (it is not by default).
22664           */
22665       if ( eclass == CE_Warning ) {
22666         warn( CPLGetLastErrorMsg(), "%s" );
22667       }
22668 
22669 
22670     }
22671     {
22672       /* %typemap(out) CPLErr */
22673     }
22674 
22675 
22676     XSRETURN(argvi);
22677   fail:
22678 
22679 
22680     SWIG_croak_null();
22681   }
22682 }
22683 
22684 
XS(_wrap_Attribute_WriteDouble)22685 XS(_wrap_Attribute_WriteDouble) {
22686   {
22687     GDALAttributeHS *arg1 = (GDALAttributeHS *) 0 ;
22688     double arg2 ;
22689     void *argp1 = 0 ;
22690     int res1 = 0 ;
22691     double val2 ;
22692     int ecode2 = 0 ;
22693     int argvi = 0;
22694     CPLErr result;
22695     dXSARGS;
22696 
22697     if ((items < 2) || (items > 2)) {
22698       SWIG_croak("Usage: Attribute_WriteDouble(self,val);");
22699     }
22700     res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_GDALAttributeHS, 0 |  0 );
22701     if (!SWIG_IsOK(res1)) {
22702       SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Attribute_WriteDouble" "', argument " "1"" of type '" "GDALAttributeHS *""'");
22703     }
22704     arg1 = reinterpret_cast< GDALAttributeHS * >(argp1);
22705     ecode2 = SWIG_AsVal_double SWIG_PERL_CALL_ARGS_2(ST(1), &val2);
22706     if (!SWIG_IsOK(ecode2)) {
22707       SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Attribute_WriteDouble" "', argument " "2"" of type '" "double""'");
22708     }
22709     arg2 = static_cast< double >(val2);
22710     {
22711       CPLErrorReset();
22712       result = (CPLErr)GDALAttributeHS_WriteDouble(arg1,arg2);
22713       CPLErr eclass = CPLGetLastErrorType();
22714       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
22715         do_confess( CPLGetLastErrorMsg(), 0 );
22716 
22717 
22718 
22719 
22720 
22721       }
22722 
22723 
22724       /*
22725           Make warnings regular Perl warnings. This duplicates the warning
22726           message if DontUseExceptions() is in effect (it is not by default).
22727           */
22728       if ( eclass == CE_Warning ) {
22729         warn( CPLGetLastErrorMsg(), "%s" );
22730       }
22731 
22732 
22733     }
22734     {
22735       /* %typemap(out) CPLErr */
22736     }
22737 
22738 
22739     XSRETURN(argvi);
22740   fail:
22741 
22742 
22743     SWIG_croak_null();
22744   }
22745 }
22746 
22747 
XS(_wrap_delete_Dimension)22748 XS(_wrap_delete_Dimension) {
22749   {
22750     GDALDimensionHS *arg1 = (GDALDimensionHS *) 0 ;
22751     void *argp1 = 0 ;
22752     int res1 = 0 ;
22753     int argvi = 0;
22754     dXSARGS;
22755 
22756     if ((items < 1) || (items > 1)) {
22757       SWIG_croak("Usage: delete_Dimension(self);");
22758     }
22759     res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_GDALDimensionHS, SWIG_POINTER_DISOWN |  0 );
22760     if (!SWIG_IsOK(res1)) {
22761       SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_Dimension" "', argument " "1"" of type '" "GDALDimensionHS *""'");
22762     }
22763     arg1 = reinterpret_cast< GDALDimensionHS * >(argp1);
22764     {
22765       CPLErrorReset();
22766       delete_GDALDimensionHS(arg1);
22767       CPLErr eclass = CPLGetLastErrorType();
22768       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
22769         do_confess( CPLGetLastErrorMsg(), 0 );
22770 
22771 
22772 
22773 
22774 
22775       }
22776 
22777 
22778       /*
22779           Make warnings regular Perl warnings. This duplicates the warning
22780           message if DontUseExceptions() is in effect (it is not by default).
22781           */
22782       if ( eclass == CE_Warning ) {
22783         warn( CPLGetLastErrorMsg(), "%s" );
22784       }
22785 
22786 
22787     }
22788     {
22789       /* %typemap(out) void */
22790     }
22791 
22792     XSRETURN(argvi);
22793   fail:
22794 
22795     SWIG_croak_null();
22796   }
22797 }
22798 
22799 
XS(_wrap_Dimension_GetName)22800 XS(_wrap_Dimension_GetName) {
22801   {
22802     GDALDimensionHS *arg1 = (GDALDimensionHS *) 0 ;
22803     void *argp1 = 0 ;
22804     int res1 = 0 ;
22805     int argvi = 0;
22806     char *result = 0 ;
22807     dXSARGS;
22808 
22809     if ((items < 1) || (items > 1)) {
22810       SWIG_croak("Usage: Dimension_GetName(self);");
22811     }
22812     res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_GDALDimensionHS, 0 |  0 );
22813     if (!SWIG_IsOK(res1)) {
22814       SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Dimension_GetName" "', argument " "1"" of type '" "GDALDimensionHS *""'");
22815     }
22816     arg1 = reinterpret_cast< GDALDimensionHS * >(argp1);
22817     {
22818       CPLErrorReset();
22819       result = (char *)GDALDimensionHS_GetName(arg1);
22820       CPLErr eclass = CPLGetLastErrorType();
22821       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
22822         do_confess( CPLGetLastErrorMsg(), 0 );
22823 
22824 
22825 
22826 
22827 
22828       }
22829 
22830 
22831       /*
22832           Make warnings regular Perl warnings. This duplicates the warning
22833           message if DontUseExceptions() is in effect (it is not by default).
22834           */
22835       if ( eclass == CE_Warning ) {
22836         warn( CPLGetLastErrorMsg(), "%s" );
22837       }
22838 
22839 
22840     }
22841     {
22842       /* %typemap(out) const char * */
22843       ST(argvi) = newSVpv(result, 0);
22844       SvUTF8_on(ST(argvi)); /* expecting GDAL to give us UTF-8 */
22845       sv_2mortal(ST(argvi));
22846       argvi++;
22847     }
22848 
22849     XSRETURN(argvi);
22850   fail:
22851 
22852     SWIG_croak_null();
22853   }
22854 }
22855 
22856 
XS(_wrap_Dimension_GetFullName)22857 XS(_wrap_Dimension_GetFullName) {
22858   {
22859     GDALDimensionHS *arg1 = (GDALDimensionHS *) 0 ;
22860     void *argp1 = 0 ;
22861     int res1 = 0 ;
22862     int argvi = 0;
22863     char *result = 0 ;
22864     dXSARGS;
22865 
22866     if ((items < 1) || (items > 1)) {
22867       SWIG_croak("Usage: Dimension_GetFullName(self);");
22868     }
22869     res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_GDALDimensionHS, 0 |  0 );
22870     if (!SWIG_IsOK(res1)) {
22871       SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Dimension_GetFullName" "', argument " "1"" of type '" "GDALDimensionHS *""'");
22872     }
22873     arg1 = reinterpret_cast< GDALDimensionHS * >(argp1);
22874     {
22875       CPLErrorReset();
22876       result = (char *)GDALDimensionHS_GetFullName(arg1);
22877       CPLErr eclass = CPLGetLastErrorType();
22878       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
22879         do_confess( CPLGetLastErrorMsg(), 0 );
22880 
22881 
22882 
22883 
22884 
22885       }
22886 
22887 
22888       /*
22889           Make warnings regular Perl warnings. This duplicates the warning
22890           message if DontUseExceptions() is in effect (it is not by default).
22891           */
22892       if ( eclass == CE_Warning ) {
22893         warn( CPLGetLastErrorMsg(), "%s" );
22894       }
22895 
22896 
22897     }
22898     {
22899       /* %typemap(out) const char * */
22900       ST(argvi) = newSVpv(result, 0);
22901       SvUTF8_on(ST(argvi)); /* expecting GDAL to give us UTF-8 */
22902       sv_2mortal(ST(argvi));
22903       argvi++;
22904     }
22905 
22906     XSRETURN(argvi);
22907   fail:
22908 
22909     SWIG_croak_null();
22910   }
22911 }
22912 
22913 
XS(_wrap_Dimension_GetType)22914 XS(_wrap_Dimension_GetType) {
22915   {
22916     GDALDimensionHS *arg1 = (GDALDimensionHS *) 0 ;
22917     void *argp1 = 0 ;
22918     int res1 = 0 ;
22919     int argvi = 0;
22920     char *result = 0 ;
22921     dXSARGS;
22922 
22923     if ((items < 1) || (items > 1)) {
22924       SWIG_croak("Usage: Dimension_GetType(self);");
22925     }
22926     res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_GDALDimensionHS, 0 |  0 );
22927     if (!SWIG_IsOK(res1)) {
22928       SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Dimension_GetType" "', argument " "1"" of type '" "GDALDimensionHS *""'");
22929     }
22930     arg1 = reinterpret_cast< GDALDimensionHS * >(argp1);
22931     {
22932       CPLErrorReset();
22933       result = (char *)GDALDimensionHS_GetType(arg1);
22934       CPLErr eclass = CPLGetLastErrorType();
22935       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
22936         do_confess( CPLGetLastErrorMsg(), 0 );
22937 
22938 
22939 
22940 
22941 
22942       }
22943 
22944 
22945       /*
22946           Make warnings regular Perl warnings. This duplicates the warning
22947           message if DontUseExceptions() is in effect (it is not by default).
22948           */
22949       if ( eclass == CE_Warning ) {
22950         warn( CPLGetLastErrorMsg(), "%s" );
22951       }
22952 
22953 
22954     }
22955     {
22956       /* %typemap(out) const char * */
22957       ST(argvi) = newSVpv(result, 0);
22958       SvUTF8_on(ST(argvi)); /* expecting GDAL to give us UTF-8 */
22959       sv_2mortal(ST(argvi));
22960       argvi++;
22961     }
22962 
22963     XSRETURN(argvi);
22964   fail:
22965 
22966     SWIG_croak_null();
22967   }
22968 }
22969 
22970 
XS(_wrap_Dimension_GetDirection)22971 XS(_wrap_Dimension_GetDirection) {
22972   {
22973     GDALDimensionHS *arg1 = (GDALDimensionHS *) 0 ;
22974     void *argp1 = 0 ;
22975     int res1 = 0 ;
22976     int argvi = 0;
22977     char *result = 0 ;
22978     dXSARGS;
22979 
22980     if ((items < 1) || (items > 1)) {
22981       SWIG_croak("Usage: Dimension_GetDirection(self);");
22982     }
22983     res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_GDALDimensionHS, 0 |  0 );
22984     if (!SWIG_IsOK(res1)) {
22985       SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Dimension_GetDirection" "', argument " "1"" of type '" "GDALDimensionHS *""'");
22986     }
22987     arg1 = reinterpret_cast< GDALDimensionHS * >(argp1);
22988     {
22989       CPLErrorReset();
22990       result = (char *)GDALDimensionHS_GetDirection(arg1);
22991       CPLErr eclass = CPLGetLastErrorType();
22992       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
22993         do_confess( CPLGetLastErrorMsg(), 0 );
22994 
22995 
22996 
22997 
22998 
22999       }
23000 
23001 
23002       /*
23003           Make warnings regular Perl warnings. This duplicates the warning
23004           message if DontUseExceptions() is in effect (it is not by default).
23005           */
23006       if ( eclass == CE_Warning ) {
23007         warn( CPLGetLastErrorMsg(), "%s" );
23008       }
23009 
23010 
23011     }
23012     {
23013       /* %typemap(out) const char * */
23014       ST(argvi) = newSVpv(result, 0);
23015       SvUTF8_on(ST(argvi)); /* expecting GDAL to give us UTF-8 */
23016       sv_2mortal(ST(argvi));
23017       argvi++;
23018     }
23019 
23020     XSRETURN(argvi);
23021   fail:
23022 
23023     SWIG_croak_null();
23024   }
23025 }
23026 
23027 
XS(_wrap_Dimension_GetSize)23028 XS(_wrap_Dimension_GetSize) {
23029   {
23030     GDALDimensionHS *arg1 = (GDALDimensionHS *) 0 ;
23031     void *argp1 = 0 ;
23032     int res1 = 0 ;
23033     int argvi = 0;
23034     unsigned long long result;
23035     dXSARGS;
23036 
23037     if ((items < 1) || (items > 1)) {
23038       SWIG_croak("Usage: Dimension_GetSize(self);");
23039     }
23040     res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_GDALDimensionHS, 0 |  0 );
23041     if (!SWIG_IsOK(res1)) {
23042       SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Dimension_GetSize" "', argument " "1"" of type '" "GDALDimensionHS *""'");
23043     }
23044     arg1 = reinterpret_cast< GDALDimensionHS * >(argp1);
23045     {
23046       CPLErrorReset();
23047       result = (unsigned long long)GDALDimensionHS_GetSize(arg1);
23048       CPLErr eclass = CPLGetLastErrorType();
23049       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
23050         do_confess( CPLGetLastErrorMsg(), 0 );
23051 
23052 
23053 
23054 
23055 
23056       }
23057 
23058 
23059       /*
23060           Make warnings regular Perl warnings. This duplicates the warning
23061           message if DontUseExceptions() is in effect (it is not by default).
23062           */
23063       if ( eclass == CE_Warning ) {
23064         warn( CPLGetLastErrorMsg(), "%s" );
23065       }
23066 
23067 
23068     }
23069     ST(argvi) = SWIG_From_unsigned_SS_long_SS_long  SWIG_PERL_CALL_ARGS_1(static_cast< unsigned long long >(result)); argvi++ ;
23070 
23071     XSRETURN(argvi);
23072   fail:
23073 
23074     SWIG_croak_null();
23075   }
23076 }
23077 
23078 
XS(_wrap_Dimension_GetIndexingVariable)23079 XS(_wrap_Dimension_GetIndexingVariable) {
23080   {
23081     GDALDimensionHS *arg1 = (GDALDimensionHS *) 0 ;
23082     void *argp1 = 0 ;
23083     int res1 = 0 ;
23084     int argvi = 0;
23085     GDALMDArrayHS *result = 0 ;
23086     dXSARGS;
23087 
23088     if ((items < 1) || (items > 1)) {
23089       SWIG_croak("Usage: Dimension_GetIndexingVariable(self);");
23090     }
23091     res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_GDALDimensionHS, 0 |  0 );
23092     if (!SWIG_IsOK(res1)) {
23093       SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Dimension_GetIndexingVariable" "', argument " "1"" of type '" "GDALDimensionHS *""'");
23094     }
23095     arg1 = reinterpret_cast< GDALDimensionHS * >(argp1);
23096     {
23097       CPLErrorReset();
23098       result = (GDALMDArrayHS *)GDALDimensionHS_GetIndexingVariable(arg1);
23099       CPLErr eclass = CPLGetLastErrorType();
23100       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
23101         do_confess( CPLGetLastErrorMsg(), 0 );
23102 
23103 
23104 
23105 
23106 
23107       }
23108 
23109 
23110       /*
23111           Make warnings regular Perl warnings. This duplicates the warning
23112           message if DontUseExceptions() is in effect (it is not by default).
23113           */
23114       if ( eclass == CE_Warning ) {
23115         warn( CPLGetLastErrorMsg(), "%s" );
23116       }
23117 
23118 
23119     }
23120     ST(argvi) = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GDALMDArrayHS, SWIG_OWNER | SWIG_SHADOW); argvi++ ;
23121 
23122     XSRETURN(argvi);
23123   fail:
23124 
23125     SWIG_croak_null();
23126   }
23127 }
23128 
23129 
XS(_wrap_Dimension_SetIndexingVariable)23130 XS(_wrap_Dimension_SetIndexingVariable) {
23131   {
23132     GDALDimensionHS *arg1 = (GDALDimensionHS *) 0 ;
23133     GDALMDArrayHS *arg2 = (GDALMDArrayHS *) 0 ;
23134     void *argp1 = 0 ;
23135     int res1 = 0 ;
23136     void *argp2 = 0 ;
23137     int res2 = 0 ;
23138     int argvi = 0;
23139     bool result;
23140     dXSARGS;
23141 
23142     if ((items < 2) || (items > 2)) {
23143       SWIG_croak("Usage: Dimension_SetIndexingVariable(self,array);");
23144     }
23145     res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_GDALDimensionHS, 0 |  0 );
23146     if (!SWIG_IsOK(res1)) {
23147       SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Dimension_SetIndexingVariable" "', argument " "1"" of type '" "GDALDimensionHS *""'");
23148     }
23149     arg1 = reinterpret_cast< GDALDimensionHS * >(argp1);
23150     res2 = SWIG_ConvertPtr(ST(1), &argp2,SWIGTYPE_p_GDALMDArrayHS, 0 |  0 );
23151     if (!SWIG_IsOK(res2)) {
23152       SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Dimension_SetIndexingVariable" "', argument " "2"" of type '" "GDALMDArrayHS *""'");
23153     }
23154     arg2 = reinterpret_cast< GDALMDArrayHS * >(argp2);
23155     {
23156       CPLErrorReset();
23157       result = (bool)GDALDimensionHS_SetIndexingVariable(arg1,arg2);
23158       CPLErr eclass = CPLGetLastErrorType();
23159       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
23160         do_confess( CPLGetLastErrorMsg(), 0 );
23161 
23162 
23163 
23164 
23165 
23166       }
23167 
23168 
23169       /*
23170           Make warnings regular Perl warnings. This duplicates the warning
23171           message if DontUseExceptions() is in effect (it is not by default).
23172           */
23173       if ( eclass == CE_Warning ) {
23174         warn( CPLGetLastErrorMsg(), "%s" );
23175       }
23176 
23177 
23178     }
23179     ST(argvi) = SWIG_From_bool  SWIG_PERL_CALL_ARGS_1(static_cast< bool >(result)); argvi++ ;
23180 
23181 
23182     XSRETURN(argvi);
23183   fail:
23184 
23185 
23186     SWIG_croak_null();
23187   }
23188 }
23189 
23190 
XS(_wrap_delete_ExtendedDataType)23191 XS(_wrap_delete_ExtendedDataType) {
23192   {
23193     GDALExtendedDataTypeHS *arg1 = (GDALExtendedDataTypeHS *) 0 ;
23194     void *argp1 = 0 ;
23195     int res1 = 0 ;
23196     int argvi = 0;
23197     dXSARGS;
23198 
23199     if ((items < 1) || (items > 1)) {
23200       SWIG_croak("Usage: delete_ExtendedDataType(self);");
23201     }
23202     res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_GDALExtendedDataTypeHS, SWIG_POINTER_DISOWN |  0 );
23203     if (!SWIG_IsOK(res1)) {
23204       SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_ExtendedDataType" "', argument " "1"" of type '" "GDALExtendedDataTypeHS *""'");
23205     }
23206     arg1 = reinterpret_cast< GDALExtendedDataTypeHS * >(argp1);
23207     {
23208       CPLErrorReset();
23209       delete_GDALExtendedDataTypeHS(arg1);
23210       CPLErr eclass = CPLGetLastErrorType();
23211       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
23212         do_confess( CPLGetLastErrorMsg(), 0 );
23213 
23214 
23215 
23216 
23217 
23218       }
23219 
23220 
23221       /*
23222           Make warnings regular Perl warnings. This duplicates the warning
23223           message if DontUseExceptions() is in effect (it is not by default).
23224           */
23225       if ( eclass == CE_Warning ) {
23226         warn( CPLGetLastErrorMsg(), "%s" );
23227       }
23228 
23229 
23230     }
23231     {
23232       /* %typemap(out) void */
23233     }
23234 
23235     XSRETURN(argvi);
23236   fail:
23237 
23238     SWIG_croak_null();
23239   }
23240 }
23241 
23242 
XS(_wrap_ExtendedDataType__Create)23243 XS(_wrap_ExtendedDataType__Create) {
23244   {
23245     GDALDataType arg1 ;
23246     int val1 ;
23247     int ecode1 = 0 ;
23248     int argvi = 0;
23249     GDALExtendedDataTypeHS *result = 0 ;
23250     dXSARGS;
23251 
23252     if ((items < 1) || (items > 1)) {
23253       SWIG_croak("Usage: ExtendedDataType__Create(dt);");
23254     }
23255     ecode1 = SWIG_AsVal_int SWIG_PERL_CALL_ARGS_2(ST(0), &val1);
23256     if (!SWIG_IsOK(ecode1)) {
23257       SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "ExtendedDataType__Create" "', argument " "1"" of type '" "GDALDataType""'");
23258     }
23259     arg1 = static_cast< GDALDataType >(val1);
23260     {
23261       CPLErrorReset();
23262       result = (GDALExtendedDataTypeHS *)GDALExtendedDataTypeHS_Create(arg1);
23263       CPLErr eclass = CPLGetLastErrorType();
23264       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
23265         do_confess( CPLGetLastErrorMsg(), 0 );
23266 
23267 
23268 
23269 
23270 
23271       }
23272 
23273 
23274       /*
23275           Make warnings regular Perl warnings. This duplicates the warning
23276           message if DontUseExceptions() is in effect (it is not by default).
23277           */
23278       if ( eclass == CE_Warning ) {
23279         warn( CPLGetLastErrorMsg(), "%s" );
23280       }
23281 
23282 
23283     }
23284     ST(argvi) = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GDALExtendedDataTypeHS, SWIG_OWNER | SWIG_SHADOW); argvi++ ;
23285 
23286     XSRETURN(argvi);
23287   fail:
23288 
23289     SWIG_croak_null();
23290   }
23291 }
23292 
23293 
XS(_wrap_ExtendedDataType_CreateString)23294 XS(_wrap_ExtendedDataType_CreateString) {
23295   {
23296     size_t arg1 = (size_t) 0 ;
23297     size_t val1 ;
23298     int ecode1 = 0 ;
23299     int argvi = 0;
23300     GDALExtendedDataTypeHS *result = 0 ;
23301     dXSARGS;
23302 
23303     if ((items < 0) || (items > 1)) {
23304       SWIG_croak("Usage: ExtendedDataType_CreateString(nMaxStringLength);");
23305     }
23306     if (items > 0) {
23307       ecode1 = SWIG_AsVal_size_t SWIG_PERL_CALL_ARGS_2(ST(0), &val1);
23308       if (!SWIG_IsOK(ecode1)) {
23309         SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "ExtendedDataType_CreateString" "', argument " "1"" of type '" "size_t""'");
23310       }
23311       arg1 = static_cast< size_t >(val1);
23312     }
23313     {
23314       CPLErrorReset();
23315       result = (GDALExtendedDataTypeHS *)GDALExtendedDataTypeHS_CreateString(arg1);
23316       CPLErr eclass = CPLGetLastErrorType();
23317       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
23318         do_confess( CPLGetLastErrorMsg(), 0 );
23319 
23320 
23321 
23322 
23323 
23324       }
23325 
23326 
23327       /*
23328           Make warnings regular Perl warnings. This duplicates the warning
23329           message if DontUseExceptions() is in effect (it is not by default).
23330           */
23331       if ( eclass == CE_Warning ) {
23332         warn( CPLGetLastErrorMsg(), "%s" );
23333       }
23334 
23335 
23336     }
23337     ST(argvi) = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GDALExtendedDataTypeHS, SWIG_OWNER | SWIG_SHADOW); argvi++ ;
23338 
23339     XSRETURN(argvi);
23340   fail:
23341 
23342     SWIG_croak_null();
23343   }
23344 }
23345 
23346 
XS(_wrap_ExtendedDataType_GetName)23347 XS(_wrap_ExtendedDataType_GetName) {
23348   {
23349     GDALExtendedDataTypeHS *arg1 = (GDALExtendedDataTypeHS *) 0 ;
23350     void *argp1 = 0 ;
23351     int res1 = 0 ;
23352     int argvi = 0;
23353     char *result = 0 ;
23354     dXSARGS;
23355 
23356     if ((items < 1) || (items > 1)) {
23357       SWIG_croak("Usage: ExtendedDataType_GetName(self);");
23358     }
23359     res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_GDALExtendedDataTypeHS, 0 |  0 );
23360     if (!SWIG_IsOK(res1)) {
23361       SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ExtendedDataType_GetName" "', argument " "1"" of type '" "GDALExtendedDataTypeHS *""'");
23362     }
23363     arg1 = reinterpret_cast< GDALExtendedDataTypeHS * >(argp1);
23364     {
23365       CPLErrorReset();
23366       result = (char *)GDALExtendedDataTypeHS_GetName(arg1);
23367       CPLErr eclass = CPLGetLastErrorType();
23368       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
23369         do_confess( CPLGetLastErrorMsg(), 0 );
23370 
23371 
23372 
23373 
23374 
23375       }
23376 
23377 
23378       /*
23379           Make warnings regular Perl warnings. This duplicates the warning
23380           message if DontUseExceptions() is in effect (it is not by default).
23381           */
23382       if ( eclass == CE_Warning ) {
23383         warn( CPLGetLastErrorMsg(), "%s" );
23384       }
23385 
23386 
23387     }
23388     {
23389       /* %typemap(out) const char * */
23390       ST(argvi) = newSVpv(result, 0);
23391       SvUTF8_on(ST(argvi)); /* expecting GDAL to give us UTF-8 */
23392       sv_2mortal(ST(argvi));
23393       argvi++;
23394     }
23395 
23396     XSRETURN(argvi);
23397   fail:
23398 
23399     SWIG_croak_null();
23400   }
23401 }
23402 
23403 
XS(_wrap_ExtendedDataType_GetClass)23404 XS(_wrap_ExtendedDataType_GetClass) {
23405   {
23406     GDALExtendedDataTypeHS *arg1 = (GDALExtendedDataTypeHS *) 0 ;
23407     void *argp1 = 0 ;
23408     int res1 = 0 ;
23409     int argvi = 0;
23410     GDALExtendedDataTypeClass result;
23411     dXSARGS;
23412 
23413     if ((items < 1) || (items > 1)) {
23414       SWIG_croak("Usage: ExtendedDataType_GetClass(self);");
23415     }
23416     res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_GDALExtendedDataTypeHS, 0 |  0 );
23417     if (!SWIG_IsOK(res1)) {
23418       SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ExtendedDataType_GetClass" "', argument " "1"" of type '" "GDALExtendedDataTypeHS *""'");
23419     }
23420     arg1 = reinterpret_cast< GDALExtendedDataTypeHS * >(argp1);
23421     {
23422       CPLErrorReset();
23423       result = (GDALExtendedDataTypeClass)GDALExtendedDataTypeHS_GetClass(arg1);
23424       CPLErr eclass = CPLGetLastErrorType();
23425       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
23426         do_confess( CPLGetLastErrorMsg(), 0 );
23427 
23428 
23429 
23430 
23431 
23432       }
23433 
23434 
23435       /*
23436           Make warnings regular Perl warnings. This duplicates the warning
23437           message if DontUseExceptions() is in effect (it is not by default).
23438           */
23439       if ( eclass == CE_Warning ) {
23440         warn( CPLGetLastErrorMsg(), "%s" );
23441       }
23442 
23443 
23444     }
23445     ST(argvi) = SWIG_From_int  SWIG_PERL_CALL_ARGS_1(static_cast< int >(result)); argvi++ ;
23446 
23447     XSRETURN(argvi);
23448   fail:
23449 
23450     SWIG_croak_null();
23451   }
23452 }
23453 
23454 
XS(_wrap_ExtendedDataType_GetNumericDataType)23455 XS(_wrap_ExtendedDataType_GetNumericDataType) {
23456   {
23457     GDALExtendedDataTypeHS *arg1 = (GDALExtendedDataTypeHS *) 0 ;
23458     void *argp1 = 0 ;
23459     int res1 = 0 ;
23460     int argvi = 0;
23461     GDALDataType result;
23462     dXSARGS;
23463 
23464     if ((items < 1) || (items > 1)) {
23465       SWIG_croak("Usage: ExtendedDataType_GetNumericDataType(self);");
23466     }
23467     res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_GDALExtendedDataTypeHS, 0 |  0 );
23468     if (!SWIG_IsOK(res1)) {
23469       SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ExtendedDataType_GetNumericDataType" "', argument " "1"" of type '" "GDALExtendedDataTypeHS *""'");
23470     }
23471     arg1 = reinterpret_cast< GDALExtendedDataTypeHS * >(argp1);
23472     {
23473       CPLErrorReset();
23474       result = (GDALDataType)GDALExtendedDataTypeHS_GetNumericDataType(arg1);
23475       CPLErr eclass = CPLGetLastErrorType();
23476       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
23477         do_confess( CPLGetLastErrorMsg(), 0 );
23478 
23479 
23480 
23481 
23482 
23483       }
23484 
23485 
23486       /*
23487           Make warnings regular Perl warnings. This duplicates the warning
23488           message if DontUseExceptions() is in effect (it is not by default).
23489           */
23490       if ( eclass == CE_Warning ) {
23491         warn( CPLGetLastErrorMsg(), "%s" );
23492       }
23493 
23494 
23495     }
23496     ST(argvi) = SWIG_From_int  SWIG_PERL_CALL_ARGS_1(static_cast< int >(result)); argvi++ ;
23497 
23498     XSRETURN(argvi);
23499   fail:
23500 
23501     SWIG_croak_null();
23502   }
23503 }
23504 
23505 
XS(_wrap_ExtendedDataType_GetSize)23506 XS(_wrap_ExtendedDataType_GetSize) {
23507   {
23508     GDALExtendedDataTypeHS *arg1 = (GDALExtendedDataTypeHS *) 0 ;
23509     void *argp1 = 0 ;
23510     int res1 = 0 ;
23511     int argvi = 0;
23512     size_t result;
23513     dXSARGS;
23514 
23515     if ((items < 1) || (items > 1)) {
23516       SWIG_croak("Usage: ExtendedDataType_GetSize(self);");
23517     }
23518     res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_GDALExtendedDataTypeHS, 0 |  0 );
23519     if (!SWIG_IsOK(res1)) {
23520       SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ExtendedDataType_GetSize" "', argument " "1"" of type '" "GDALExtendedDataTypeHS *""'");
23521     }
23522     arg1 = reinterpret_cast< GDALExtendedDataTypeHS * >(argp1);
23523     {
23524       CPLErrorReset();
23525       result = GDALExtendedDataTypeHS_GetSize(arg1);
23526       CPLErr eclass = CPLGetLastErrorType();
23527       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
23528         do_confess( CPLGetLastErrorMsg(), 0 );
23529 
23530 
23531 
23532 
23533 
23534       }
23535 
23536 
23537       /*
23538           Make warnings regular Perl warnings. This duplicates the warning
23539           message if DontUseExceptions() is in effect (it is not by default).
23540           */
23541       if ( eclass == CE_Warning ) {
23542         warn( CPLGetLastErrorMsg(), "%s" );
23543       }
23544 
23545 
23546     }
23547     ST(argvi) = SWIG_From_size_t  SWIG_PERL_CALL_ARGS_1(static_cast< size_t >(result)); argvi++ ;
23548 
23549     XSRETURN(argvi);
23550   fail:
23551 
23552     SWIG_croak_null();
23553   }
23554 }
23555 
23556 
XS(_wrap_ExtendedDataType_GetMaxStringLength)23557 XS(_wrap_ExtendedDataType_GetMaxStringLength) {
23558   {
23559     GDALExtendedDataTypeHS *arg1 = (GDALExtendedDataTypeHS *) 0 ;
23560     void *argp1 = 0 ;
23561     int res1 = 0 ;
23562     int argvi = 0;
23563     size_t result;
23564     dXSARGS;
23565 
23566     if ((items < 1) || (items > 1)) {
23567       SWIG_croak("Usage: ExtendedDataType_GetMaxStringLength(self);");
23568     }
23569     res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_GDALExtendedDataTypeHS, 0 |  0 );
23570     if (!SWIG_IsOK(res1)) {
23571       SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ExtendedDataType_GetMaxStringLength" "', argument " "1"" of type '" "GDALExtendedDataTypeHS *""'");
23572     }
23573     arg1 = reinterpret_cast< GDALExtendedDataTypeHS * >(argp1);
23574     {
23575       CPLErrorReset();
23576       result = GDALExtendedDataTypeHS_GetMaxStringLength(arg1);
23577       CPLErr eclass = CPLGetLastErrorType();
23578       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
23579         do_confess( CPLGetLastErrorMsg(), 0 );
23580 
23581 
23582 
23583 
23584 
23585       }
23586 
23587 
23588       /*
23589           Make warnings regular Perl warnings. This duplicates the warning
23590           message if DontUseExceptions() is in effect (it is not by default).
23591           */
23592       if ( eclass == CE_Warning ) {
23593         warn( CPLGetLastErrorMsg(), "%s" );
23594       }
23595 
23596 
23597     }
23598     ST(argvi) = SWIG_From_size_t  SWIG_PERL_CALL_ARGS_1(static_cast< size_t >(result)); argvi++ ;
23599 
23600     XSRETURN(argvi);
23601   fail:
23602 
23603     SWIG_croak_null();
23604   }
23605 }
23606 
23607 
XS(_wrap_ExtendedDataType_CanConvertTo)23608 XS(_wrap_ExtendedDataType_CanConvertTo) {
23609   {
23610     GDALExtendedDataTypeHS *arg1 = (GDALExtendedDataTypeHS *) 0 ;
23611     GDALExtendedDataTypeHS *arg2 = (GDALExtendedDataTypeHS *) 0 ;
23612     void *argp1 = 0 ;
23613     int res1 = 0 ;
23614     void *argp2 = 0 ;
23615     int res2 = 0 ;
23616     int argvi = 0;
23617     bool result;
23618     dXSARGS;
23619 
23620     if ((items < 2) || (items > 2)) {
23621       SWIG_croak("Usage: ExtendedDataType_CanConvertTo(self,other);");
23622     }
23623     res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_GDALExtendedDataTypeHS, 0 |  0 );
23624     if (!SWIG_IsOK(res1)) {
23625       SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ExtendedDataType_CanConvertTo" "', argument " "1"" of type '" "GDALExtendedDataTypeHS *""'");
23626     }
23627     arg1 = reinterpret_cast< GDALExtendedDataTypeHS * >(argp1);
23628     res2 = SWIG_ConvertPtr(ST(1), &argp2,SWIGTYPE_p_GDALExtendedDataTypeHS, 0 |  0 );
23629     if (!SWIG_IsOK(res2)) {
23630       SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "ExtendedDataType_CanConvertTo" "', argument " "2"" of type '" "GDALExtendedDataTypeHS *""'");
23631     }
23632     arg2 = reinterpret_cast< GDALExtendedDataTypeHS * >(argp2);
23633     {
23634       if (!arg2) {
23635         SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
23636       }
23637     }
23638     {
23639       CPLErrorReset();
23640       result = (bool)GDALExtendedDataTypeHS_CanConvertTo(arg1,arg2);
23641       CPLErr eclass = CPLGetLastErrorType();
23642       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
23643         do_confess( CPLGetLastErrorMsg(), 0 );
23644 
23645 
23646 
23647 
23648 
23649       }
23650 
23651 
23652       /*
23653           Make warnings regular Perl warnings. This duplicates the warning
23654           message if DontUseExceptions() is in effect (it is not by default).
23655           */
23656       if ( eclass == CE_Warning ) {
23657         warn( CPLGetLastErrorMsg(), "%s" );
23658       }
23659 
23660 
23661     }
23662     ST(argvi) = SWIG_From_bool  SWIG_PERL_CALL_ARGS_1(static_cast< bool >(result)); argvi++ ;
23663 
23664 
23665     XSRETURN(argvi);
23666   fail:
23667 
23668 
23669     SWIG_croak_null();
23670   }
23671 }
23672 
23673 
XS(_wrap_ExtendedDataType_Equals)23674 XS(_wrap_ExtendedDataType_Equals) {
23675   {
23676     GDALExtendedDataTypeHS *arg1 = (GDALExtendedDataTypeHS *) 0 ;
23677     GDALExtendedDataTypeHS *arg2 = (GDALExtendedDataTypeHS *) 0 ;
23678     void *argp1 = 0 ;
23679     int res1 = 0 ;
23680     void *argp2 = 0 ;
23681     int res2 = 0 ;
23682     int argvi = 0;
23683     bool result;
23684     dXSARGS;
23685 
23686     if ((items < 2) || (items > 2)) {
23687       SWIG_croak("Usage: ExtendedDataType_Equals(self,other);");
23688     }
23689     res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_GDALExtendedDataTypeHS, 0 |  0 );
23690     if (!SWIG_IsOK(res1)) {
23691       SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ExtendedDataType_Equals" "', argument " "1"" of type '" "GDALExtendedDataTypeHS *""'");
23692     }
23693     arg1 = reinterpret_cast< GDALExtendedDataTypeHS * >(argp1);
23694     res2 = SWIG_ConvertPtr(ST(1), &argp2,SWIGTYPE_p_GDALExtendedDataTypeHS, 0 |  0 );
23695     if (!SWIG_IsOK(res2)) {
23696       SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "ExtendedDataType_Equals" "', argument " "2"" of type '" "GDALExtendedDataTypeHS *""'");
23697     }
23698     arg2 = reinterpret_cast< GDALExtendedDataTypeHS * >(argp2);
23699     {
23700       if (!arg2) {
23701         SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
23702       }
23703     }
23704     {
23705       CPLErrorReset();
23706       result = (bool)GDALExtendedDataTypeHS_Equals(arg1,arg2);
23707       CPLErr eclass = CPLGetLastErrorType();
23708       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
23709         do_confess( CPLGetLastErrorMsg(), 0 );
23710 
23711 
23712 
23713 
23714 
23715       }
23716 
23717 
23718       /*
23719           Make warnings regular Perl warnings. This duplicates the warning
23720           message if DontUseExceptions() is in effect (it is not by default).
23721           */
23722       if ( eclass == CE_Warning ) {
23723         warn( CPLGetLastErrorMsg(), "%s" );
23724       }
23725 
23726 
23727     }
23728     ST(argvi) = SWIG_From_bool  SWIG_PERL_CALL_ARGS_1(static_cast< bool >(result)); argvi++ ;
23729 
23730 
23731     XSRETURN(argvi);
23732   fail:
23733 
23734 
23735     SWIG_croak_null();
23736   }
23737 }
23738 
23739 
XS(_wrap_delete_EDTComponent)23740 XS(_wrap_delete_EDTComponent) {
23741   {
23742     GDALEDTComponentHS *arg1 = (GDALEDTComponentHS *) 0 ;
23743     void *argp1 = 0 ;
23744     int res1 = 0 ;
23745     int argvi = 0;
23746     dXSARGS;
23747 
23748     if ((items < 1) || (items > 1)) {
23749       SWIG_croak("Usage: delete_EDTComponent(self);");
23750     }
23751     res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_GDALEDTComponentHS, SWIG_POINTER_DISOWN |  0 );
23752     if (!SWIG_IsOK(res1)) {
23753       SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_EDTComponent" "', argument " "1"" of type '" "GDALEDTComponentHS *""'");
23754     }
23755     arg1 = reinterpret_cast< GDALEDTComponentHS * >(argp1);
23756     {
23757       CPLErrorReset();
23758       delete_GDALEDTComponentHS(arg1);
23759       CPLErr eclass = CPLGetLastErrorType();
23760       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
23761         do_confess( CPLGetLastErrorMsg(), 0 );
23762 
23763 
23764 
23765 
23766 
23767       }
23768 
23769 
23770       /*
23771           Make warnings regular Perl warnings. This duplicates the warning
23772           message if DontUseExceptions() is in effect (it is not by default).
23773           */
23774       if ( eclass == CE_Warning ) {
23775         warn( CPLGetLastErrorMsg(), "%s" );
23776       }
23777 
23778 
23779     }
23780     {
23781       /* %typemap(out) void */
23782     }
23783 
23784     XSRETURN(argvi);
23785   fail:
23786 
23787     SWIG_croak_null();
23788   }
23789 }
23790 
23791 
XS(_wrap_EDTComponent__Create)23792 XS(_wrap_EDTComponent__Create) {
23793   {
23794     char *arg1 = (char *) 0 ;
23795     size_t arg2 ;
23796     GDALExtendedDataTypeHS *arg3 = (GDALExtendedDataTypeHS *) 0 ;
23797     int res1 ;
23798     char *buf1 = 0 ;
23799     int alloc1 = 0 ;
23800     size_t val2 ;
23801     int ecode2 = 0 ;
23802     void *argp3 = 0 ;
23803     int res3 = 0 ;
23804     int argvi = 0;
23805     GDALEDTComponentHS *result = 0 ;
23806     dXSARGS;
23807 
23808     if ((items < 3) || (items > 3)) {
23809       SWIG_croak("Usage: EDTComponent__Create(name,offset,type);");
23810     }
23811     res1 = SWIG_AsCharPtrAndSize(ST(0), &buf1, NULL, &alloc1);
23812     if (!SWIG_IsOK(res1)) {
23813       SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "EDTComponent__Create" "', argument " "1"" of type '" "char const *""'");
23814     }
23815     arg1 = reinterpret_cast< char * >(buf1);
23816     ecode2 = SWIG_AsVal_size_t SWIG_PERL_CALL_ARGS_2(ST(1), &val2);
23817     if (!SWIG_IsOK(ecode2)) {
23818       SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "EDTComponent__Create" "', argument " "2"" of type '" "size_t""'");
23819     }
23820     arg2 = static_cast< size_t >(val2);
23821     res3 = SWIG_ConvertPtr(ST(2), &argp3,SWIGTYPE_p_GDALExtendedDataTypeHS, 0 |  0 );
23822     if (!SWIG_IsOK(res3)) {
23823       SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "EDTComponent__Create" "', argument " "3"" of type '" "GDALExtendedDataTypeHS *""'");
23824     }
23825     arg3 = reinterpret_cast< GDALExtendedDataTypeHS * >(argp3);
23826     {
23827       if (!arg1) {
23828         SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
23829       }
23830     }
23831     {
23832       if (!arg3) {
23833         SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
23834       }
23835     }
23836     {
23837       CPLErrorReset();
23838       result = (GDALEDTComponentHS *)GDALEDTComponentHS_Create((char const *)arg1,arg2,arg3);
23839       CPLErr eclass = CPLGetLastErrorType();
23840       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
23841         do_confess( CPLGetLastErrorMsg(), 0 );
23842 
23843 
23844 
23845 
23846 
23847       }
23848 
23849 
23850       /*
23851           Make warnings regular Perl warnings. This duplicates the warning
23852           message if DontUseExceptions() is in effect (it is not by default).
23853           */
23854       if ( eclass == CE_Warning ) {
23855         warn( CPLGetLastErrorMsg(), "%s" );
23856       }
23857 
23858 
23859     }
23860     ST(argvi) = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GDALEDTComponentHS, SWIG_OWNER | SWIG_SHADOW); argvi++ ;
23861     if (alloc1 == SWIG_NEWOBJ) delete[] buf1;
23862 
23863 
23864     XSRETURN(argvi);
23865   fail:
23866     if (alloc1 == SWIG_NEWOBJ) delete[] buf1;
23867 
23868 
23869     SWIG_croak_null();
23870   }
23871 }
23872 
23873 
XS(_wrap_EDTComponent_GetName)23874 XS(_wrap_EDTComponent_GetName) {
23875   {
23876     GDALEDTComponentHS *arg1 = (GDALEDTComponentHS *) 0 ;
23877     void *argp1 = 0 ;
23878     int res1 = 0 ;
23879     int argvi = 0;
23880     char *result = 0 ;
23881     dXSARGS;
23882 
23883     if ((items < 1) || (items > 1)) {
23884       SWIG_croak("Usage: EDTComponent_GetName(self);");
23885     }
23886     res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_GDALEDTComponentHS, 0 |  0 );
23887     if (!SWIG_IsOK(res1)) {
23888       SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "EDTComponent_GetName" "', argument " "1"" of type '" "GDALEDTComponentHS *""'");
23889     }
23890     arg1 = reinterpret_cast< GDALEDTComponentHS * >(argp1);
23891     {
23892       CPLErrorReset();
23893       result = (char *)GDALEDTComponentHS_GetName(arg1);
23894       CPLErr eclass = CPLGetLastErrorType();
23895       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
23896         do_confess( CPLGetLastErrorMsg(), 0 );
23897 
23898 
23899 
23900 
23901 
23902       }
23903 
23904 
23905       /*
23906           Make warnings regular Perl warnings. This duplicates the warning
23907           message if DontUseExceptions() is in effect (it is not by default).
23908           */
23909       if ( eclass == CE_Warning ) {
23910         warn( CPLGetLastErrorMsg(), "%s" );
23911       }
23912 
23913 
23914     }
23915     {
23916       /* %typemap(out) const char * */
23917       ST(argvi) = newSVpv(result, 0);
23918       SvUTF8_on(ST(argvi)); /* expecting GDAL to give us UTF-8 */
23919       sv_2mortal(ST(argvi));
23920       argvi++;
23921     }
23922 
23923     XSRETURN(argvi);
23924   fail:
23925 
23926     SWIG_croak_null();
23927   }
23928 }
23929 
23930 
XS(_wrap_EDTComponent_GetOffset)23931 XS(_wrap_EDTComponent_GetOffset) {
23932   {
23933     GDALEDTComponentHS *arg1 = (GDALEDTComponentHS *) 0 ;
23934     void *argp1 = 0 ;
23935     int res1 = 0 ;
23936     int argvi = 0;
23937     size_t result;
23938     dXSARGS;
23939 
23940     if ((items < 1) || (items > 1)) {
23941       SWIG_croak("Usage: EDTComponent_GetOffset(self);");
23942     }
23943     res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_GDALEDTComponentHS, 0 |  0 );
23944     if (!SWIG_IsOK(res1)) {
23945       SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "EDTComponent_GetOffset" "', argument " "1"" of type '" "GDALEDTComponentHS *""'");
23946     }
23947     arg1 = reinterpret_cast< GDALEDTComponentHS * >(argp1);
23948     {
23949       CPLErrorReset();
23950       result = GDALEDTComponentHS_GetOffset(arg1);
23951       CPLErr eclass = CPLGetLastErrorType();
23952       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
23953         do_confess( CPLGetLastErrorMsg(), 0 );
23954 
23955 
23956 
23957 
23958 
23959       }
23960 
23961 
23962       /*
23963           Make warnings regular Perl warnings. This duplicates the warning
23964           message if DontUseExceptions() is in effect (it is not by default).
23965           */
23966       if ( eclass == CE_Warning ) {
23967         warn( CPLGetLastErrorMsg(), "%s" );
23968       }
23969 
23970 
23971     }
23972     ST(argvi) = SWIG_From_size_t  SWIG_PERL_CALL_ARGS_1(static_cast< size_t >(result)); argvi++ ;
23973 
23974     XSRETURN(argvi);
23975   fail:
23976 
23977     SWIG_croak_null();
23978   }
23979 }
23980 
23981 
XS(_wrap_EDTComponent_GetType)23982 XS(_wrap_EDTComponent_GetType) {
23983   {
23984     GDALEDTComponentHS *arg1 = (GDALEDTComponentHS *) 0 ;
23985     void *argp1 = 0 ;
23986     int res1 = 0 ;
23987     int argvi = 0;
23988     GDALExtendedDataTypeHS *result = 0 ;
23989     dXSARGS;
23990 
23991     if ((items < 1) || (items > 1)) {
23992       SWIG_croak("Usage: EDTComponent_GetType(self);");
23993     }
23994     res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_GDALEDTComponentHS, 0 |  0 );
23995     if (!SWIG_IsOK(res1)) {
23996       SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "EDTComponent_GetType" "', argument " "1"" of type '" "GDALEDTComponentHS *""'");
23997     }
23998     arg1 = reinterpret_cast< GDALEDTComponentHS * >(argp1);
23999     {
24000       CPLErrorReset();
24001       result = (GDALExtendedDataTypeHS *)GDALEDTComponentHS_GetType(arg1);
24002       CPLErr eclass = CPLGetLastErrorType();
24003       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
24004         do_confess( CPLGetLastErrorMsg(), 0 );
24005 
24006 
24007 
24008 
24009 
24010       }
24011 
24012 
24013       /*
24014           Make warnings regular Perl warnings. This duplicates the warning
24015           message if DontUseExceptions() is in effect (it is not by default).
24016           */
24017       if ( eclass == CE_Warning ) {
24018         warn( CPLGetLastErrorMsg(), "%s" );
24019       }
24020 
24021 
24022     }
24023     ST(argvi) = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GDALExtendedDataTypeHS, SWIG_OWNER | SWIG_SHADOW); argvi++ ;
24024 
24025     XSRETURN(argvi);
24026   fail:
24027 
24028     SWIG_croak_null();
24029   }
24030 }
24031 
24032 
XS(_wrap_Band_XSize_get)24033 XS(_wrap_Band_XSize_get) {
24034   {
24035     GDALRasterBandShadow *arg1 = (GDALRasterBandShadow *) 0 ;
24036     void *argp1 = 0 ;
24037     int res1 = 0 ;
24038     int argvi = 0;
24039     int result;
24040     dXSARGS;
24041 
24042     if ((items < 1) || (items > 1)) {
24043       SWIG_croak("Usage: Band_XSize_get(self);");
24044     }
24045     res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_GDALRasterBandShadow, 0 |  0 );
24046     if (!SWIG_IsOK(res1)) {
24047       SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Band_XSize_get" "', argument " "1"" of type '" "GDALRasterBandShadow *""'");
24048     }
24049     arg1 = reinterpret_cast< GDALRasterBandShadow * >(argp1);
24050     {
24051       CPLErrorReset();
24052       result = (int)GDALRasterBandShadow_XSize_get(arg1);
24053       CPLErr eclass = CPLGetLastErrorType();
24054       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
24055         do_confess( CPLGetLastErrorMsg(), 0 );
24056 
24057 
24058 
24059 
24060 
24061       }
24062 
24063 
24064       /*
24065           Make warnings regular Perl warnings. This duplicates the warning
24066           message if DontUseExceptions() is in effect (it is not by default).
24067           */
24068       if ( eclass == CE_Warning ) {
24069         warn( CPLGetLastErrorMsg(), "%s" );
24070       }
24071 
24072 
24073     }
24074     ST(argvi) = SWIG_From_int  SWIG_PERL_CALL_ARGS_1(static_cast< int >(result)); argvi++ ;
24075 
24076     XSRETURN(argvi);
24077   fail:
24078 
24079     SWIG_croak_null();
24080   }
24081 }
24082 
24083 
XS(_wrap_Band_YSize_get)24084 XS(_wrap_Band_YSize_get) {
24085   {
24086     GDALRasterBandShadow *arg1 = (GDALRasterBandShadow *) 0 ;
24087     void *argp1 = 0 ;
24088     int res1 = 0 ;
24089     int argvi = 0;
24090     int result;
24091     dXSARGS;
24092 
24093     if ((items < 1) || (items > 1)) {
24094       SWIG_croak("Usage: Band_YSize_get(self);");
24095     }
24096     res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_GDALRasterBandShadow, 0 |  0 );
24097     if (!SWIG_IsOK(res1)) {
24098       SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Band_YSize_get" "', argument " "1"" of type '" "GDALRasterBandShadow *""'");
24099     }
24100     arg1 = reinterpret_cast< GDALRasterBandShadow * >(argp1);
24101     {
24102       CPLErrorReset();
24103       result = (int)GDALRasterBandShadow_YSize_get(arg1);
24104       CPLErr eclass = CPLGetLastErrorType();
24105       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
24106         do_confess( CPLGetLastErrorMsg(), 0 );
24107 
24108 
24109 
24110 
24111 
24112       }
24113 
24114 
24115       /*
24116           Make warnings regular Perl warnings. This duplicates the warning
24117           message if DontUseExceptions() is in effect (it is not by default).
24118           */
24119       if ( eclass == CE_Warning ) {
24120         warn( CPLGetLastErrorMsg(), "%s" );
24121       }
24122 
24123 
24124     }
24125     ST(argvi) = SWIG_From_int  SWIG_PERL_CALL_ARGS_1(static_cast< int >(result)); argvi++ ;
24126 
24127     XSRETURN(argvi);
24128   fail:
24129 
24130     SWIG_croak_null();
24131   }
24132 }
24133 
24134 
XS(_wrap_Band_DataType_get)24135 XS(_wrap_Band_DataType_get) {
24136   {
24137     GDALRasterBandShadow *arg1 = (GDALRasterBandShadow *) 0 ;
24138     void *argp1 = 0 ;
24139     int res1 = 0 ;
24140     int argvi = 0;
24141     GDALDataType result;
24142     dXSARGS;
24143 
24144     if ((items < 1) || (items > 1)) {
24145       SWIG_croak("Usage: Band_DataType_get(self);");
24146     }
24147     res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_GDALRasterBandShadow, 0 |  0 );
24148     if (!SWIG_IsOK(res1)) {
24149       SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Band_DataType_get" "', argument " "1"" of type '" "GDALRasterBandShadow *""'");
24150     }
24151     arg1 = reinterpret_cast< GDALRasterBandShadow * >(argp1);
24152     {
24153       CPLErrorReset();
24154       result = (GDALDataType)GDALRasterBandShadow_DataType_get(arg1);
24155       CPLErr eclass = CPLGetLastErrorType();
24156       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
24157         do_confess( CPLGetLastErrorMsg(), 0 );
24158 
24159 
24160 
24161 
24162 
24163       }
24164 
24165 
24166       /*
24167           Make warnings regular Perl warnings. This duplicates the warning
24168           message if DontUseExceptions() is in effect (it is not by default).
24169           */
24170       if ( eclass == CE_Warning ) {
24171         warn( CPLGetLastErrorMsg(), "%s" );
24172       }
24173 
24174 
24175     }
24176     ST(argvi) = SWIG_From_int  SWIG_PERL_CALL_ARGS_1(static_cast< int >(result)); argvi++ ;
24177 
24178     XSRETURN(argvi);
24179   fail:
24180 
24181     SWIG_croak_null();
24182   }
24183 }
24184 
24185 
XS(_wrap_Band_GetDataset)24186 XS(_wrap_Band_GetDataset) {
24187   {
24188     GDALRasterBandShadow *arg1 = (GDALRasterBandShadow *) 0 ;
24189     void *argp1 = 0 ;
24190     int res1 = 0 ;
24191     int argvi = 0;
24192     GDALDatasetShadow *result = 0 ;
24193     dXSARGS;
24194 
24195     if ((items < 1) || (items > 1)) {
24196       SWIG_croak("Usage: Band_GetDataset(self);");
24197     }
24198     res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_GDALRasterBandShadow, 0 |  0 );
24199     if (!SWIG_IsOK(res1)) {
24200       SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Band_GetDataset" "', argument " "1"" of type '" "GDALRasterBandShadow *""'");
24201     }
24202     arg1 = reinterpret_cast< GDALRasterBandShadow * >(argp1);
24203     {
24204       CPLErrorReset();
24205       result = (GDALDatasetShadow *)GDALRasterBandShadow_GetDataset(arg1);
24206       CPLErr eclass = CPLGetLastErrorType();
24207       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
24208         do_confess( CPLGetLastErrorMsg(), 0 );
24209 
24210 
24211 
24212 
24213 
24214       }
24215 
24216 
24217       /*
24218           Make warnings regular Perl warnings. This duplicates the warning
24219           message if DontUseExceptions() is in effect (it is not by default).
24220           */
24221       if ( eclass == CE_Warning ) {
24222         warn( CPLGetLastErrorMsg(), "%s" );
24223       }
24224 
24225 
24226     }
24227     ST(argvi) = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GDALDatasetShadow, 0 | SWIG_SHADOW); argvi++ ;
24228 
24229     XSRETURN(argvi);
24230   fail:
24231 
24232     SWIG_croak_null();
24233   }
24234 }
24235 
24236 
XS(_wrap_Band_GetBand)24237 XS(_wrap_Band_GetBand) {
24238   {
24239     GDALRasterBandShadow *arg1 = (GDALRasterBandShadow *) 0 ;
24240     void *argp1 = 0 ;
24241     int res1 = 0 ;
24242     int argvi = 0;
24243     int result;
24244     dXSARGS;
24245 
24246     if ((items < 1) || (items > 1)) {
24247       SWIG_croak("Usage: Band_GetBand(self);");
24248     }
24249     res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_GDALRasterBandShadow, 0 |  0 );
24250     if (!SWIG_IsOK(res1)) {
24251       SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Band_GetBand" "', argument " "1"" of type '" "GDALRasterBandShadow *""'");
24252     }
24253     arg1 = reinterpret_cast< GDALRasterBandShadow * >(argp1);
24254     {
24255       CPLErrorReset();
24256       result = (int)GDALRasterBandShadow_GetBand(arg1);
24257       CPLErr eclass = CPLGetLastErrorType();
24258       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
24259         do_confess( CPLGetLastErrorMsg(), 0 );
24260 
24261 
24262 
24263 
24264 
24265       }
24266 
24267 
24268       /*
24269           Make warnings regular Perl warnings. This duplicates the warning
24270           message if DontUseExceptions() is in effect (it is not by default).
24271           */
24272       if ( eclass == CE_Warning ) {
24273         warn( CPLGetLastErrorMsg(), "%s" );
24274       }
24275 
24276 
24277     }
24278     ST(argvi) = SWIG_From_int  SWIG_PERL_CALL_ARGS_1(static_cast< int >(result)); argvi++ ;
24279 
24280     XSRETURN(argvi);
24281   fail:
24282 
24283     SWIG_croak_null();
24284   }
24285 }
24286 
24287 
XS(_wrap_Band_GetBlockSize)24288 XS(_wrap_Band_GetBlockSize) {
24289   {
24290     GDALRasterBandShadow *arg1 = (GDALRasterBandShadow *) 0 ;
24291     int *arg2 = (int *) 0 ;
24292     int *arg3 = (int *) 0 ;
24293     void *argp1 = 0 ;
24294     int res1 = 0 ;
24295     int temp2 ;
24296     int res2 = SWIG_TMPOBJ ;
24297     int temp3 ;
24298     int res3 = SWIG_TMPOBJ ;
24299     int argvi = 0;
24300     dXSARGS;
24301 
24302     arg2 = &temp2;
24303     arg3 = &temp3;
24304     if ((items < 1) || (items > 1)) {
24305       SWIG_croak("Usage: Band_GetBlockSize(self);");
24306     }
24307     res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_GDALRasterBandShadow, 0 |  0 );
24308     if (!SWIG_IsOK(res1)) {
24309       SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Band_GetBlockSize" "', argument " "1"" of type '" "GDALRasterBandShadow *""'");
24310     }
24311     arg1 = reinterpret_cast< GDALRasterBandShadow * >(argp1);
24312     {
24313       CPLErrorReset();
24314       GDALRasterBandShadow_GetBlockSize(arg1,arg2,arg3);
24315       CPLErr eclass = CPLGetLastErrorType();
24316       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
24317         do_confess( CPLGetLastErrorMsg(), 0 );
24318 
24319 
24320 
24321 
24322 
24323       }
24324 
24325 
24326       /*
24327           Make warnings regular Perl warnings. This duplicates the warning
24328           message if DontUseExceptions() is in effect (it is not by default).
24329           */
24330       if ( eclass == CE_Warning ) {
24331         warn( CPLGetLastErrorMsg(), "%s" );
24332       }
24333 
24334 
24335     }
24336     {
24337       /* %typemap(out) void */
24338     }
24339     if (SWIG_IsTmpObj(res2)) {
24340       if (argvi >= items) EXTEND(sp,1);  ST(argvi) = SWIG_From_int  SWIG_PERL_CALL_ARGS_1((*arg2)); argvi++  ;
24341     } else {
24342       int new_flags = SWIG_IsNewObj(res2) ? (SWIG_POINTER_OWN | 0) : 0;
24343       if (argvi >= items) EXTEND(sp,1);  ST(argvi) = SWIG_NewPointerObj((void*)(arg2), SWIGTYPE_p_int, new_flags); argvi++  ;
24344     }
24345     if (SWIG_IsTmpObj(res3)) {
24346       if (argvi >= items) EXTEND(sp,1);  ST(argvi) = SWIG_From_int  SWIG_PERL_CALL_ARGS_1((*arg3)); argvi++  ;
24347     } else {
24348       int new_flags = SWIG_IsNewObj(res3) ? (SWIG_POINTER_OWN | 0) : 0;
24349       if (argvi >= items) EXTEND(sp,1);  ST(argvi) = SWIG_NewPointerObj((void*)(arg3), SWIGTYPE_p_int, new_flags); argvi++  ;
24350     }
24351 
24352 
24353 
24354     XSRETURN(argvi);
24355   fail:
24356 
24357 
24358 
24359     SWIG_croak_null();
24360   }
24361 }
24362 
24363 
XS(_wrap_Band_GetColorInterpretation)24364 XS(_wrap_Band_GetColorInterpretation) {
24365   {
24366     GDALRasterBandShadow *arg1 = (GDALRasterBandShadow *) 0 ;
24367     void *argp1 = 0 ;
24368     int res1 = 0 ;
24369     int argvi = 0;
24370     GDALColorInterp result;
24371     dXSARGS;
24372 
24373     if ((items < 1) || (items > 1)) {
24374       SWIG_croak("Usage: Band_GetColorInterpretation(self);");
24375     }
24376     res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_GDALRasterBandShadow, 0 |  0 );
24377     if (!SWIG_IsOK(res1)) {
24378       SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Band_GetColorInterpretation" "', argument " "1"" of type '" "GDALRasterBandShadow *""'");
24379     }
24380     arg1 = reinterpret_cast< GDALRasterBandShadow * >(argp1);
24381     {
24382       CPLErrorReset();
24383       result = (GDALColorInterp)GDALRasterBandShadow_GetColorInterpretation(arg1);
24384       CPLErr eclass = CPLGetLastErrorType();
24385       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
24386         do_confess( CPLGetLastErrorMsg(), 0 );
24387 
24388 
24389 
24390 
24391 
24392       }
24393 
24394 
24395       /*
24396           Make warnings regular Perl warnings. This duplicates the warning
24397           message if DontUseExceptions() is in effect (it is not by default).
24398           */
24399       if ( eclass == CE_Warning ) {
24400         warn( CPLGetLastErrorMsg(), "%s" );
24401       }
24402 
24403 
24404     }
24405     ST(argvi) = SWIG_From_int  SWIG_PERL_CALL_ARGS_1(static_cast< int >(result)); argvi++ ;
24406 
24407     XSRETURN(argvi);
24408   fail:
24409 
24410     SWIG_croak_null();
24411   }
24412 }
24413 
24414 
XS(_wrap_Band_GetRasterColorInterpretation)24415 XS(_wrap_Band_GetRasterColorInterpretation) {
24416   {
24417     GDALRasterBandShadow *arg1 = (GDALRasterBandShadow *) 0 ;
24418     void *argp1 = 0 ;
24419     int res1 = 0 ;
24420     int argvi = 0;
24421     GDALColorInterp result;
24422     dXSARGS;
24423 
24424     if ((items < 1) || (items > 1)) {
24425       SWIG_croak("Usage: Band_GetRasterColorInterpretation(self);");
24426     }
24427     res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_GDALRasterBandShadow, 0 |  0 );
24428     if (!SWIG_IsOK(res1)) {
24429       SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Band_GetRasterColorInterpretation" "', argument " "1"" of type '" "GDALRasterBandShadow *""'");
24430     }
24431     arg1 = reinterpret_cast< GDALRasterBandShadow * >(argp1);
24432     {
24433       CPLErrorReset();
24434       result = (GDALColorInterp)GDALRasterBandShadow_GetRasterColorInterpretation(arg1);
24435       CPLErr eclass = CPLGetLastErrorType();
24436       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
24437         do_confess( CPLGetLastErrorMsg(), 0 );
24438 
24439 
24440 
24441 
24442 
24443       }
24444 
24445 
24446       /*
24447           Make warnings regular Perl warnings. This duplicates the warning
24448           message if DontUseExceptions() is in effect (it is not by default).
24449           */
24450       if ( eclass == CE_Warning ) {
24451         warn( CPLGetLastErrorMsg(), "%s" );
24452       }
24453 
24454 
24455     }
24456     ST(argvi) = SWIG_From_int  SWIG_PERL_CALL_ARGS_1(static_cast< int >(result)); argvi++ ;
24457 
24458     XSRETURN(argvi);
24459   fail:
24460 
24461     SWIG_croak_null();
24462   }
24463 }
24464 
24465 
XS(_wrap_Band_SetColorInterpretation)24466 XS(_wrap_Band_SetColorInterpretation) {
24467   {
24468     GDALRasterBandShadow *arg1 = (GDALRasterBandShadow *) 0 ;
24469     GDALColorInterp arg2 ;
24470     void *argp1 = 0 ;
24471     int res1 = 0 ;
24472     int val2 ;
24473     int ecode2 = 0 ;
24474     int argvi = 0;
24475     CPLErr result;
24476     dXSARGS;
24477 
24478     if ((items < 2) || (items > 2)) {
24479       SWIG_croak("Usage: Band_SetColorInterpretation(self,val);");
24480     }
24481     res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_GDALRasterBandShadow, 0 |  0 );
24482     if (!SWIG_IsOK(res1)) {
24483       SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Band_SetColorInterpretation" "', argument " "1"" of type '" "GDALRasterBandShadow *""'");
24484     }
24485     arg1 = reinterpret_cast< GDALRasterBandShadow * >(argp1);
24486     ecode2 = SWIG_AsVal_int SWIG_PERL_CALL_ARGS_2(ST(1), &val2);
24487     if (!SWIG_IsOK(ecode2)) {
24488       SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Band_SetColorInterpretation" "', argument " "2"" of type '" "GDALColorInterp""'");
24489     }
24490     arg2 = static_cast< GDALColorInterp >(val2);
24491     {
24492       CPLErrorReset();
24493       result = (CPLErr)GDALRasterBandShadow_SetColorInterpretation(arg1,arg2);
24494       CPLErr eclass = CPLGetLastErrorType();
24495       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
24496         do_confess( CPLGetLastErrorMsg(), 0 );
24497 
24498 
24499 
24500 
24501 
24502       }
24503 
24504 
24505       /*
24506           Make warnings regular Perl warnings. This duplicates the warning
24507           message if DontUseExceptions() is in effect (it is not by default).
24508           */
24509       if ( eclass == CE_Warning ) {
24510         warn( CPLGetLastErrorMsg(), "%s" );
24511       }
24512 
24513 
24514     }
24515     {
24516       /* %typemap(out) CPLErr */
24517     }
24518 
24519 
24520     XSRETURN(argvi);
24521   fail:
24522 
24523 
24524     SWIG_croak_null();
24525   }
24526 }
24527 
24528 
XS(_wrap_Band_SetRasterColorInterpretation)24529 XS(_wrap_Band_SetRasterColorInterpretation) {
24530   {
24531     GDALRasterBandShadow *arg1 = (GDALRasterBandShadow *) 0 ;
24532     GDALColorInterp arg2 ;
24533     void *argp1 = 0 ;
24534     int res1 = 0 ;
24535     int val2 ;
24536     int ecode2 = 0 ;
24537     int argvi = 0;
24538     CPLErr result;
24539     dXSARGS;
24540 
24541     if ((items < 2) || (items > 2)) {
24542       SWIG_croak("Usage: Band_SetRasterColorInterpretation(self,val);");
24543     }
24544     res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_GDALRasterBandShadow, 0 |  0 );
24545     if (!SWIG_IsOK(res1)) {
24546       SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Band_SetRasterColorInterpretation" "', argument " "1"" of type '" "GDALRasterBandShadow *""'");
24547     }
24548     arg1 = reinterpret_cast< GDALRasterBandShadow * >(argp1);
24549     ecode2 = SWIG_AsVal_int SWIG_PERL_CALL_ARGS_2(ST(1), &val2);
24550     if (!SWIG_IsOK(ecode2)) {
24551       SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Band_SetRasterColorInterpretation" "', argument " "2"" of type '" "GDALColorInterp""'");
24552     }
24553     arg2 = static_cast< GDALColorInterp >(val2);
24554     {
24555       CPLErrorReset();
24556       result = (CPLErr)GDALRasterBandShadow_SetRasterColorInterpretation(arg1,arg2);
24557       CPLErr eclass = CPLGetLastErrorType();
24558       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
24559         do_confess( CPLGetLastErrorMsg(), 0 );
24560 
24561 
24562 
24563 
24564 
24565       }
24566 
24567 
24568       /*
24569           Make warnings regular Perl warnings. This duplicates the warning
24570           message if DontUseExceptions() is in effect (it is not by default).
24571           */
24572       if ( eclass == CE_Warning ) {
24573         warn( CPLGetLastErrorMsg(), "%s" );
24574       }
24575 
24576 
24577     }
24578     {
24579       /* %typemap(out) CPLErr */
24580     }
24581 
24582 
24583     XSRETURN(argvi);
24584   fail:
24585 
24586 
24587     SWIG_croak_null();
24588   }
24589 }
24590 
24591 
XS(_wrap_Band_GetNoDataValue)24592 XS(_wrap_Band_GetNoDataValue) {
24593   {
24594     GDALRasterBandShadow *arg1 = (GDALRasterBandShadow *) 0 ;
24595     double *arg2 = (double *) 0 ;
24596     int *arg3 = (int *) 0 ;
24597     void *argp1 = 0 ;
24598     int res1 = 0 ;
24599     double tmpval2 ;
24600     int tmphasval2 ;
24601     int argvi = 0;
24602     dXSARGS;
24603 
24604     {
24605       /* %typemap(in,numinputs=0) (double *val, int *hasval) */
24606       arg2 = &tmpval2;
24607       arg3 = &tmphasval2;
24608     }
24609     if ((items < 1) || (items > 1)) {
24610       SWIG_croak("Usage: Band_GetNoDataValue(self,hasval);");
24611     }
24612     res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_GDALRasterBandShadow, 0 |  0 );
24613     if (!SWIG_IsOK(res1)) {
24614       SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Band_GetNoDataValue" "', argument " "1"" of type '" "GDALRasterBandShadow *""'");
24615     }
24616     arg1 = reinterpret_cast< GDALRasterBandShadow * >(argp1);
24617     {
24618       CPLErrorReset();
24619       GDALRasterBandShadow_GetNoDataValue(arg1,arg2,arg3);
24620       CPLErr eclass = CPLGetLastErrorType();
24621       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
24622         do_confess( CPLGetLastErrorMsg(), 0 );
24623 
24624 
24625 
24626 
24627 
24628       }
24629 
24630 
24631       /*
24632           Make warnings regular Perl warnings. This duplicates the warning
24633           message if DontUseExceptions() is in effect (it is not by default).
24634           */
24635       if ( eclass == CE_Warning ) {
24636         warn( CPLGetLastErrorMsg(), "%s" );
24637       }
24638 
24639 
24640     }
24641     {
24642       /* %typemap(out) void */
24643     }
24644     {
24645       /* %typemap(argout) (double *val, int *hasval) */
24646       if (GIMME_V == G_ARRAY) {
24647         EXTEND(SP, argvi+2-items+1);
24648         ST(argvi) = sv_newmortal();
24649         sv_setnv(ST(argvi), *arg2);
24650         argvi++;
24651         ST(argvi) = sv_newmortal();
24652         sv_setiv(ST(argvi), *arg3);
24653         argvi++;
24654       } else {
24655         if ( *arg3 ) {
24656           ST(argvi) = sv_newmortal();
24657           sv_setnv(ST(argvi), *arg2);
24658           argvi++;
24659         }
24660       }
24661     }
24662 
24663     XSRETURN(argvi);
24664   fail:
24665 
24666     SWIG_croak_null();
24667   }
24668 }
24669 
24670 
XS(_wrap_Band_SetNoDataValue)24671 XS(_wrap_Band_SetNoDataValue) {
24672   {
24673     GDALRasterBandShadow *arg1 = (GDALRasterBandShadow *) 0 ;
24674     double arg2 ;
24675     void *argp1 = 0 ;
24676     int res1 = 0 ;
24677     double val2 ;
24678     int ecode2 = 0 ;
24679     int argvi = 0;
24680     CPLErr result;
24681     dXSARGS;
24682 
24683     if ((items < 2) || (items > 2)) {
24684       SWIG_croak("Usage: Band_SetNoDataValue(self,d);");
24685     }
24686     res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_GDALRasterBandShadow, 0 |  0 );
24687     if (!SWIG_IsOK(res1)) {
24688       SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Band_SetNoDataValue" "', argument " "1"" of type '" "GDALRasterBandShadow *""'");
24689     }
24690     arg1 = reinterpret_cast< GDALRasterBandShadow * >(argp1);
24691     ecode2 = SWIG_AsVal_double SWIG_PERL_CALL_ARGS_2(ST(1), &val2);
24692     if (!SWIG_IsOK(ecode2)) {
24693       SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Band_SetNoDataValue" "', argument " "2"" of type '" "double""'");
24694     }
24695     arg2 = static_cast< double >(val2);
24696     {
24697       CPLErrorReset();
24698       result = (CPLErr)GDALRasterBandShadow_SetNoDataValue(arg1,arg2);
24699       CPLErr eclass = CPLGetLastErrorType();
24700       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
24701         do_confess( CPLGetLastErrorMsg(), 0 );
24702 
24703 
24704 
24705 
24706 
24707       }
24708 
24709 
24710       /*
24711           Make warnings regular Perl warnings. This duplicates the warning
24712           message if DontUseExceptions() is in effect (it is not by default).
24713           */
24714       if ( eclass == CE_Warning ) {
24715         warn( CPLGetLastErrorMsg(), "%s" );
24716       }
24717 
24718 
24719     }
24720     {
24721       /* %typemap(out) CPLErr */
24722     }
24723 
24724 
24725     XSRETURN(argvi);
24726   fail:
24727 
24728 
24729     SWIG_croak_null();
24730   }
24731 }
24732 
24733 
XS(_wrap_Band_DeleteNoDataValue)24734 XS(_wrap_Band_DeleteNoDataValue) {
24735   {
24736     GDALRasterBandShadow *arg1 = (GDALRasterBandShadow *) 0 ;
24737     void *argp1 = 0 ;
24738     int res1 = 0 ;
24739     int argvi = 0;
24740     CPLErr result;
24741     dXSARGS;
24742 
24743     if ((items < 1) || (items > 1)) {
24744       SWIG_croak("Usage: Band_DeleteNoDataValue(self);");
24745     }
24746     res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_GDALRasterBandShadow, 0 |  0 );
24747     if (!SWIG_IsOK(res1)) {
24748       SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Band_DeleteNoDataValue" "', argument " "1"" of type '" "GDALRasterBandShadow *""'");
24749     }
24750     arg1 = reinterpret_cast< GDALRasterBandShadow * >(argp1);
24751     {
24752       CPLErrorReset();
24753       result = (CPLErr)GDALRasterBandShadow_DeleteNoDataValue(arg1);
24754       CPLErr eclass = CPLGetLastErrorType();
24755       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
24756         do_confess( CPLGetLastErrorMsg(), 0 );
24757 
24758 
24759 
24760 
24761 
24762       }
24763 
24764 
24765       /*
24766           Make warnings regular Perl warnings. This duplicates the warning
24767           message if DontUseExceptions() is in effect (it is not by default).
24768           */
24769       if ( eclass == CE_Warning ) {
24770         warn( CPLGetLastErrorMsg(), "%s" );
24771       }
24772 
24773 
24774     }
24775     {
24776       /* %typemap(out) CPLErr */
24777     }
24778 
24779     XSRETURN(argvi);
24780   fail:
24781 
24782     SWIG_croak_null();
24783   }
24784 }
24785 
24786 
XS(_wrap_Band_GetUnitType)24787 XS(_wrap_Band_GetUnitType) {
24788   {
24789     GDALRasterBandShadow *arg1 = (GDALRasterBandShadow *) 0 ;
24790     void *argp1 = 0 ;
24791     int res1 = 0 ;
24792     int argvi = 0;
24793     char *result = 0 ;
24794     dXSARGS;
24795 
24796     if ((items < 1) || (items > 1)) {
24797       SWIG_croak("Usage: Band_GetUnitType(self);");
24798     }
24799     res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_GDALRasterBandShadow, 0 |  0 );
24800     if (!SWIG_IsOK(res1)) {
24801       SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Band_GetUnitType" "', argument " "1"" of type '" "GDALRasterBandShadow *""'");
24802     }
24803     arg1 = reinterpret_cast< GDALRasterBandShadow * >(argp1);
24804     {
24805       CPLErrorReset();
24806       result = (char *)GDALRasterBandShadow_GetUnitType(arg1);
24807       CPLErr eclass = CPLGetLastErrorType();
24808       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
24809         do_confess( CPLGetLastErrorMsg(), 0 );
24810 
24811 
24812 
24813 
24814 
24815       }
24816 
24817 
24818       /*
24819           Make warnings regular Perl warnings. This duplicates the warning
24820           message if DontUseExceptions() is in effect (it is not by default).
24821           */
24822       if ( eclass == CE_Warning ) {
24823         warn( CPLGetLastErrorMsg(), "%s" );
24824       }
24825 
24826 
24827     }
24828     {
24829       /* %typemap(out) const char * */
24830       ST(argvi) = newSVpv(result, 0);
24831       SvUTF8_on(ST(argvi)); /* expecting GDAL to give us UTF-8 */
24832       sv_2mortal(ST(argvi));
24833       argvi++;
24834     }
24835 
24836     XSRETURN(argvi);
24837   fail:
24838 
24839     SWIG_croak_null();
24840   }
24841 }
24842 
24843 
XS(_wrap_Band_SetUnitType)24844 XS(_wrap_Band_SetUnitType) {
24845   {
24846     GDALRasterBandShadow *arg1 = (GDALRasterBandShadow *) 0 ;
24847     char *arg2 = (char *) 0 ;
24848     void *argp1 = 0 ;
24849     int res1 = 0 ;
24850     int res2 ;
24851     char *buf2 = 0 ;
24852     int alloc2 = 0 ;
24853     int argvi = 0;
24854     CPLErr result;
24855     dXSARGS;
24856 
24857     if ((items < 2) || (items > 2)) {
24858       SWIG_croak("Usage: Band_SetUnitType(self,val);");
24859     }
24860     res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_GDALRasterBandShadow, 0 |  0 );
24861     if (!SWIG_IsOK(res1)) {
24862       SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Band_SetUnitType" "', argument " "1"" of type '" "GDALRasterBandShadow *""'");
24863     }
24864     arg1 = reinterpret_cast< GDALRasterBandShadow * >(argp1);
24865     res2 = SWIG_AsCharPtrAndSize(ST(1), &buf2, NULL, &alloc2);
24866     if (!SWIG_IsOK(res2)) {
24867       SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Band_SetUnitType" "', argument " "2"" of type '" "char const *""'");
24868     }
24869     arg2 = reinterpret_cast< char * >(buf2);
24870     {
24871       CPLErrorReset();
24872       result = (CPLErr)GDALRasterBandShadow_SetUnitType(arg1,(char const *)arg2);
24873       CPLErr eclass = CPLGetLastErrorType();
24874       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
24875         do_confess( CPLGetLastErrorMsg(), 0 );
24876 
24877 
24878 
24879 
24880 
24881       }
24882 
24883 
24884       /*
24885           Make warnings regular Perl warnings. This duplicates the warning
24886           message if DontUseExceptions() is in effect (it is not by default).
24887           */
24888       if ( eclass == CE_Warning ) {
24889         warn( CPLGetLastErrorMsg(), "%s" );
24890       }
24891 
24892 
24893     }
24894     {
24895       /* %typemap(out) CPLErr */
24896     }
24897 
24898     if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
24899     XSRETURN(argvi);
24900   fail:
24901 
24902     if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
24903     SWIG_croak_null();
24904   }
24905 }
24906 
24907 
XS(_wrap_Band_GetRasterCategoryNames)24908 XS(_wrap_Band_GetRasterCategoryNames) {
24909   {
24910     GDALRasterBandShadow *arg1 = (GDALRasterBandShadow *) 0 ;
24911     void *argp1 = 0 ;
24912     int res1 = 0 ;
24913     int argvi = 0;
24914     char **result = 0 ;
24915     dXSARGS;
24916 
24917     if ((items < 1) || (items > 1)) {
24918       SWIG_croak("Usage: Band_GetRasterCategoryNames(self);");
24919     }
24920     res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_GDALRasterBandShadow, 0 |  0 );
24921     if (!SWIG_IsOK(res1)) {
24922       SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Band_GetRasterCategoryNames" "', argument " "1"" of type '" "GDALRasterBandShadow *""'");
24923     }
24924     arg1 = reinterpret_cast< GDALRasterBandShadow * >(argp1);
24925     {
24926       CPLErrorReset();
24927       result = (char **)GDALRasterBandShadow_GetRasterCategoryNames(arg1);
24928       CPLErr eclass = CPLGetLastErrorType();
24929       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
24930         do_confess( CPLGetLastErrorMsg(), 0 );
24931 
24932 
24933 
24934 
24935 
24936       }
24937 
24938 
24939       /*
24940           Make warnings regular Perl warnings. This duplicates the warning
24941           message if DontUseExceptions() is in effect (it is not by default).
24942           */
24943       if ( eclass == CE_Warning ) {
24944         warn( CPLGetLastErrorMsg(), "%s" );
24945       }
24946 
24947 
24948     }
24949     {
24950       /* %typemap(out) char **options -> ( string ) */
24951       AV* av = (AV*)sv_2mortal((SV*)newAV());
24952       char **stringarray = result;
24953       if ( stringarray != NULL ) {
24954         int n = CSLCount( stringarray );
24955         for ( int i = 0; i < n; i++ ) {
24956           SV *sv = newSVpv(stringarray[i], 0);
24957           SvUTF8_on(sv); /* expecting UTF-8 from GDAL */
24958           if (!av_store(av, i, sv))
24959           SvREFCNT_dec(sv);
24960         }
24961       }
24962       ST(argvi) = newRV((SV*)av);
24963       sv_2mortal(ST(argvi));
24964       argvi++;
24965     }
24966 
24967     XSRETURN(argvi);
24968   fail:
24969 
24970     SWIG_croak_null();
24971   }
24972 }
24973 
24974 
XS(_wrap_Band_SetRasterCategoryNames)24975 XS(_wrap_Band_SetRasterCategoryNames) {
24976   {
24977     GDALRasterBandShadow *arg1 = (GDALRasterBandShadow *) 0 ;
24978     char **arg2 = (char **) 0 ;
24979     void *argp1 = 0 ;
24980     int res1 = 0 ;
24981     int argvi = 0;
24982     CPLErr result;
24983     dXSARGS;
24984 
24985     if ((items < 2) || (items > 2)) {
24986       SWIG_croak("Usage: Band_SetRasterCategoryNames(self,names);");
24987     }
24988     res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_GDALRasterBandShadow, 0 |  0 );
24989     if (!SWIG_IsOK(res1)) {
24990       SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Band_SetRasterCategoryNames" "', argument " "1"" of type '" "GDALRasterBandShadow *""'");
24991     }
24992     arg1 = reinterpret_cast< GDALRasterBandShadow * >(argp1);
24993     {
24994       /* %typemap(in) char **options */
24995       if (SvOK(ST(1))) {
24996         if (SvROK(ST(1))) {
24997           if (SvTYPE(SvRV(ST(1)))==SVt_PVAV) {
24998             AV *av = (AV*)(SvRV(ST(1)));
24999             for (int i = 0; i < av_len(av)+1; i++) {
25000               SV *sv = *(av_fetch(av, i, 0));
25001               bool sf;
25002               char *tmp = sv_to_utf8_string(sv, NULL, &sf);
25003               arg2 = CSLAddString(arg2, tmp);
25004               if (sf) Safefree(tmp); else free(tmp);
25005             }
25006           } else if (SvTYPE(SvRV(ST(1)))==SVt_PVHV) {
25007             HV *hv = (HV*)SvRV(ST(1));
25008             SV *sv;
25009             char *key;
25010             I32 klen;
25011             arg2 = NULL;
25012             hv_iterinit(hv);
25013             while(sv = hv_iternextsv(hv, &key, &klen)) {
25014               bool sf;
25015               char *tmp = sv_to_utf8_string(sv, NULL, &sf);
25016               arg2 = CSLAddNameValue(arg2, key, tmp);
25017               if (sf) Safefree(tmp); else free(tmp);
25018             }
25019           } else
25020           do_confess(NEED_REF, 1);
25021         } else
25022         do_confess(NEED_REF, 1);
25023       }
25024     }
25025     {
25026       CPLErrorReset();
25027       result = (CPLErr)GDALRasterBandShadow_SetRasterCategoryNames(arg1,arg2);
25028       CPLErr eclass = CPLGetLastErrorType();
25029       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
25030         do_confess( CPLGetLastErrorMsg(), 0 );
25031 
25032 
25033 
25034 
25035 
25036       }
25037 
25038 
25039       /*
25040           Make warnings regular Perl warnings. This duplicates the warning
25041           message if DontUseExceptions() is in effect (it is not by default).
25042           */
25043       if ( eclass == CE_Warning ) {
25044         warn( CPLGetLastErrorMsg(), "%s" );
25045       }
25046 
25047 
25048     }
25049     {
25050       /* %typemap(out) CPLErr */
25051     }
25052 
25053     {
25054       /* %typemap(freearg) char **options */
25055       if (arg2) CSLDestroy( arg2 );
25056     }
25057     XSRETURN(argvi);
25058   fail:
25059 
25060     {
25061       /* %typemap(freearg) char **options */
25062       if (arg2) CSLDestroy( arg2 );
25063     }
25064     SWIG_croak_null();
25065   }
25066 }
25067 
25068 
XS(_wrap_Band_GetMinimum)25069 XS(_wrap_Band_GetMinimum) {
25070   {
25071     GDALRasterBandShadow *arg1 = (GDALRasterBandShadow *) 0 ;
25072     double *arg2 = (double *) 0 ;
25073     int *arg3 = (int *) 0 ;
25074     void *argp1 = 0 ;
25075     int res1 = 0 ;
25076     double tmpval2 ;
25077     int tmphasval2 ;
25078     int argvi = 0;
25079     dXSARGS;
25080 
25081     {
25082       /* %typemap(in,numinputs=0) (double *val, int *hasval) */
25083       arg2 = &tmpval2;
25084       arg3 = &tmphasval2;
25085     }
25086     if ((items < 1) || (items > 1)) {
25087       SWIG_croak("Usage: Band_GetMinimum(self,hasval);");
25088     }
25089     res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_GDALRasterBandShadow, 0 |  0 );
25090     if (!SWIG_IsOK(res1)) {
25091       SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Band_GetMinimum" "', argument " "1"" of type '" "GDALRasterBandShadow *""'");
25092     }
25093     arg1 = reinterpret_cast< GDALRasterBandShadow * >(argp1);
25094     {
25095       CPLErrorReset();
25096       GDALRasterBandShadow_GetMinimum(arg1,arg2,arg3);
25097       CPLErr eclass = CPLGetLastErrorType();
25098       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
25099         do_confess( CPLGetLastErrorMsg(), 0 );
25100 
25101 
25102 
25103 
25104 
25105       }
25106 
25107 
25108       /*
25109           Make warnings regular Perl warnings. This duplicates the warning
25110           message if DontUseExceptions() is in effect (it is not by default).
25111           */
25112       if ( eclass == CE_Warning ) {
25113         warn( CPLGetLastErrorMsg(), "%s" );
25114       }
25115 
25116 
25117     }
25118     {
25119       /* %typemap(out) void */
25120     }
25121     {
25122       /* %typemap(argout) (double *val, int *hasval) */
25123       if (GIMME_V == G_ARRAY) {
25124         EXTEND(SP, argvi+2-items+1);
25125         ST(argvi) = sv_newmortal();
25126         sv_setnv(ST(argvi), *arg2);
25127         argvi++;
25128         ST(argvi) = sv_newmortal();
25129         sv_setiv(ST(argvi), *arg3);
25130         argvi++;
25131       } else {
25132         if ( *arg3 ) {
25133           ST(argvi) = sv_newmortal();
25134           sv_setnv(ST(argvi), *arg2);
25135           argvi++;
25136         }
25137       }
25138     }
25139 
25140     XSRETURN(argvi);
25141   fail:
25142 
25143     SWIG_croak_null();
25144   }
25145 }
25146 
25147 
XS(_wrap_Band_GetMaximum)25148 XS(_wrap_Band_GetMaximum) {
25149   {
25150     GDALRasterBandShadow *arg1 = (GDALRasterBandShadow *) 0 ;
25151     double *arg2 = (double *) 0 ;
25152     int *arg3 = (int *) 0 ;
25153     void *argp1 = 0 ;
25154     int res1 = 0 ;
25155     double tmpval2 ;
25156     int tmphasval2 ;
25157     int argvi = 0;
25158     dXSARGS;
25159 
25160     {
25161       /* %typemap(in,numinputs=0) (double *val, int *hasval) */
25162       arg2 = &tmpval2;
25163       arg3 = &tmphasval2;
25164     }
25165     if ((items < 1) || (items > 1)) {
25166       SWIG_croak("Usage: Band_GetMaximum(self,hasval);");
25167     }
25168     res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_GDALRasterBandShadow, 0 |  0 );
25169     if (!SWIG_IsOK(res1)) {
25170       SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Band_GetMaximum" "', argument " "1"" of type '" "GDALRasterBandShadow *""'");
25171     }
25172     arg1 = reinterpret_cast< GDALRasterBandShadow * >(argp1);
25173     {
25174       CPLErrorReset();
25175       GDALRasterBandShadow_GetMaximum(arg1,arg2,arg3);
25176       CPLErr eclass = CPLGetLastErrorType();
25177       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
25178         do_confess( CPLGetLastErrorMsg(), 0 );
25179 
25180 
25181 
25182 
25183 
25184       }
25185 
25186 
25187       /*
25188           Make warnings regular Perl warnings. This duplicates the warning
25189           message if DontUseExceptions() is in effect (it is not by default).
25190           */
25191       if ( eclass == CE_Warning ) {
25192         warn( CPLGetLastErrorMsg(), "%s" );
25193       }
25194 
25195 
25196     }
25197     {
25198       /* %typemap(out) void */
25199     }
25200     {
25201       /* %typemap(argout) (double *val, int *hasval) */
25202       if (GIMME_V == G_ARRAY) {
25203         EXTEND(SP, argvi+2-items+1);
25204         ST(argvi) = sv_newmortal();
25205         sv_setnv(ST(argvi), *arg2);
25206         argvi++;
25207         ST(argvi) = sv_newmortal();
25208         sv_setiv(ST(argvi), *arg3);
25209         argvi++;
25210       } else {
25211         if ( *arg3 ) {
25212           ST(argvi) = sv_newmortal();
25213           sv_setnv(ST(argvi), *arg2);
25214           argvi++;
25215         }
25216       }
25217     }
25218 
25219     XSRETURN(argvi);
25220   fail:
25221 
25222     SWIG_croak_null();
25223   }
25224 }
25225 
25226 
XS(_wrap_Band_GetOffset)25227 XS(_wrap_Band_GetOffset) {
25228   {
25229     GDALRasterBandShadow *arg1 = (GDALRasterBandShadow *) 0 ;
25230     double *arg2 = (double *) 0 ;
25231     int *arg3 = (int *) 0 ;
25232     void *argp1 = 0 ;
25233     int res1 = 0 ;
25234     double tmpval2 ;
25235     int tmphasval2 ;
25236     int argvi = 0;
25237     dXSARGS;
25238 
25239     {
25240       /* %typemap(in,numinputs=0) (double *val, int *hasval) */
25241       arg2 = &tmpval2;
25242       arg3 = &tmphasval2;
25243     }
25244     if ((items < 1) || (items > 1)) {
25245       SWIG_croak("Usage: Band_GetOffset(self,hasval);");
25246     }
25247     res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_GDALRasterBandShadow, 0 |  0 );
25248     if (!SWIG_IsOK(res1)) {
25249       SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Band_GetOffset" "', argument " "1"" of type '" "GDALRasterBandShadow *""'");
25250     }
25251     arg1 = reinterpret_cast< GDALRasterBandShadow * >(argp1);
25252     {
25253       CPLErrorReset();
25254       GDALRasterBandShadow_GetOffset(arg1,arg2,arg3);
25255       CPLErr eclass = CPLGetLastErrorType();
25256       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
25257         do_confess( CPLGetLastErrorMsg(), 0 );
25258 
25259 
25260 
25261 
25262 
25263       }
25264 
25265 
25266       /*
25267           Make warnings regular Perl warnings. This duplicates the warning
25268           message if DontUseExceptions() is in effect (it is not by default).
25269           */
25270       if ( eclass == CE_Warning ) {
25271         warn( CPLGetLastErrorMsg(), "%s" );
25272       }
25273 
25274 
25275     }
25276     {
25277       /* %typemap(out) void */
25278     }
25279     {
25280       /* %typemap(argout) (double *val, int *hasval) */
25281       if (GIMME_V == G_ARRAY) {
25282         EXTEND(SP, argvi+2-items+1);
25283         ST(argvi) = sv_newmortal();
25284         sv_setnv(ST(argvi), *arg2);
25285         argvi++;
25286         ST(argvi) = sv_newmortal();
25287         sv_setiv(ST(argvi), *arg3);
25288         argvi++;
25289       } else {
25290         if ( *arg3 ) {
25291           ST(argvi) = sv_newmortal();
25292           sv_setnv(ST(argvi), *arg2);
25293           argvi++;
25294         }
25295       }
25296     }
25297 
25298     XSRETURN(argvi);
25299   fail:
25300 
25301     SWIG_croak_null();
25302   }
25303 }
25304 
25305 
XS(_wrap_Band_GetScale)25306 XS(_wrap_Band_GetScale) {
25307   {
25308     GDALRasterBandShadow *arg1 = (GDALRasterBandShadow *) 0 ;
25309     double *arg2 = (double *) 0 ;
25310     int *arg3 = (int *) 0 ;
25311     void *argp1 = 0 ;
25312     int res1 = 0 ;
25313     double tmpval2 ;
25314     int tmphasval2 ;
25315     int argvi = 0;
25316     dXSARGS;
25317 
25318     {
25319       /* %typemap(in,numinputs=0) (double *val, int *hasval) */
25320       arg2 = &tmpval2;
25321       arg3 = &tmphasval2;
25322     }
25323     if ((items < 1) || (items > 1)) {
25324       SWIG_croak("Usage: Band_GetScale(self,hasval);");
25325     }
25326     res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_GDALRasterBandShadow, 0 |  0 );
25327     if (!SWIG_IsOK(res1)) {
25328       SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Band_GetScale" "', argument " "1"" of type '" "GDALRasterBandShadow *""'");
25329     }
25330     arg1 = reinterpret_cast< GDALRasterBandShadow * >(argp1);
25331     {
25332       CPLErrorReset();
25333       GDALRasterBandShadow_GetScale(arg1,arg2,arg3);
25334       CPLErr eclass = CPLGetLastErrorType();
25335       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
25336         do_confess( CPLGetLastErrorMsg(), 0 );
25337 
25338 
25339 
25340 
25341 
25342       }
25343 
25344 
25345       /*
25346           Make warnings regular Perl warnings. This duplicates the warning
25347           message if DontUseExceptions() is in effect (it is not by default).
25348           */
25349       if ( eclass == CE_Warning ) {
25350         warn( CPLGetLastErrorMsg(), "%s" );
25351       }
25352 
25353 
25354     }
25355     {
25356       /* %typemap(out) void */
25357     }
25358     {
25359       /* %typemap(argout) (double *val, int *hasval) */
25360       if (GIMME_V == G_ARRAY) {
25361         EXTEND(SP, argvi+2-items+1);
25362         ST(argvi) = sv_newmortal();
25363         sv_setnv(ST(argvi), *arg2);
25364         argvi++;
25365         ST(argvi) = sv_newmortal();
25366         sv_setiv(ST(argvi), *arg3);
25367         argvi++;
25368       } else {
25369         if ( *arg3 ) {
25370           ST(argvi) = sv_newmortal();
25371           sv_setnv(ST(argvi), *arg2);
25372           argvi++;
25373         }
25374       }
25375     }
25376 
25377     XSRETURN(argvi);
25378   fail:
25379 
25380     SWIG_croak_null();
25381   }
25382 }
25383 
25384 
XS(_wrap_Band_SetOffset)25385 XS(_wrap_Band_SetOffset) {
25386   {
25387     GDALRasterBandShadow *arg1 = (GDALRasterBandShadow *) 0 ;
25388     double arg2 ;
25389     void *argp1 = 0 ;
25390     int res1 = 0 ;
25391     double val2 ;
25392     int ecode2 = 0 ;
25393     int argvi = 0;
25394     CPLErr result;
25395     dXSARGS;
25396 
25397     if ((items < 2) || (items > 2)) {
25398       SWIG_croak("Usage: Band_SetOffset(self,val);");
25399     }
25400     res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_GDALRasterBandShadow, 0 |  0 );
25401     if (!SWIG_IsOK(res1)) {
25402       SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Band_SetOffset" "', argument " "1"" of type '" "GDALRasterBandShadow *""'");
25403     }
25404     arg1 = reinterpret_cast< GDALRasterBandShadow * >(argp1);
25405     ecode2 = SWIG_AsVal_double SWIG_PERL_CALL_ARGS_2(ST(1), &val2);
25406     if (!SWIG_IsOK(ecode2)) {
25407       SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Band_SetOffset" "', argument " "2"" of type '" "double""'");
25408     }
25409     arg2 = static_cast< double >(val2);
25410     {
25411       CPLErrorReset();
25412       result = (CPLErr)GDALRasterBandShadow_SetOffset(arg1,arg2);
25413       CPLErr eclass = CPLGetLastErrorType();
25414       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
25415         do_confess( CPLGetLastErrorMsg(), 0 );
25416 
25417 
25418 
25419 
25420 
25421       }
25422 
25423 
25424       /*
25425           Make warnings regular Perl warnings. This duplicates the warning
25426           message if DontUseExceptions() is in effect (it is not by default).
25427           */
25428       if ( eclass == CE_Warning ) {
25429         warn( CPLGetLastErrorMsg(), "%s" );
25430       }
25431 
25432 
25433     }
25434     {
25435       /* %typemap(out) CPLErr */
25436     }
25437 
25438 
25439     XSRETURN(argvi);
25440   fail:
25441 
25442 
25443     SWIG_croak_null();
25444   }
25445 }
25446 
25447 
XS(_wrap_Band_SetScale)25448 XS(_wrap_Band_SetScale) {
25449   {
25450     GDALRasterBandShadow *arg1 = (GDALRasterBandShadow *) 0 ;
25451     double arg2 ;
25452     void *argp1 = 0 ;
25453     int res1 = 0 ;
25454     double val2 ;
25455     int ecode2 = 0 ;
25456     int argvi = 0;
25457     CPLErr result;
25458     dXSARGS;
25459 
25460     if ((items < 2) || (items > 2)) {
25461       SWIG_croak("Usage: Band_SetScale(self,val);");
25462     }
25463     res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_GDALRasterBandShadow, 0 |  0 );
25464     if (!SWIG_IsOK(res1)) {
25465       SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Band_SetScale" "', argument " "1"" of type '" "GDALRasterBandShadow *""'");
25466     }
25467     arg1 = reinterpret_cast< GDALRasterBandShadow * >(argp1);
25468     ecode2 = SWIG_AsVal_double SWIG_PERL_CALL_ARGS_2(ST(1), &val2);
25469     if (!SWIG_IsOK(ecode2)) {
25470       SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Band_SetScale" "', argument " "2"" of type '" "double""'");
25471     }
25472     arg2 = static_cast< double >(val2);
25473     {
25474       CPLErrorReset();
25475       result = (CPLErr)GDALRasterBandShadow_SetScale(arg1,arg2);
25476       CPLErr eclass = CPLGetLastErrorType();
25477       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
25478         do_confess( CPLGetLastErrorMsg(), 0 );
25479 
25480 
25481 
25482 
25483 
25484       }
25485 
25486 
25487       /*
25488           Make warnings regular Perl warnings. This duplicates the warning
25489           message if DontUseExceptions() is in effect (it is not by default).
25490           */
25491       if ( eclass == CE_Warning ) {
25492         warn( CPLGetLastErrorMsg(), "%s" );
25493       }
25494 
25495 
25496     }
25497     {
25498       /* %typemap(out) CPLErr */
25499     }
25500 
25501 
25502     XSRETURN(argvi);
25503   fail:
25504 
25505 
25506     SWIG_croak_null();
25507   }
25508 }
25509 
25510 
XS(_wrap_Band_GetStatistics)25511 XS(_wrap_Band_GetStatistics) {
25512   {
25513     GDALRasterBandShadow *arg1 = (GDALRasterBandShadow *) 0 ;
25514     int arg2 ;
25515     int arg3 ;
25516     double *arg4 = (double *) 0 ;
25517     double *arg5 = (double *) 0 ;
25518     double *arg6 = (double *) 0 ;
25519     double *arg7 = (double *) 0 ;
25520     void *argp1 = 0 ;
25521     int res1 = 0 ;
25522     int val2 ;
25523     int ecode2 = 0 ;
25524     int val3 ;
25525     int ecode3 = 0 ;
25526     double temp4 ;
25527     int res4 = SWIG_TMPOBJ ;
25528     double temp5 ;
25529     int res5 = SWIG_TMPOBJ ;
25530     double temp6 ;
25531     int res6 = SWIG_TMPOBJ ;
25532     double temp7 ;
25533     int res7 = SWIG_TMPOBJ ;
25534     int argvi = 0;
25535     CPLErr result;
25536     dXSARGS;
25537 
25538     arg4 = &temp4;
25539     arg5 = &temp5;
25540     arg6 = &temp6;
25541     arg7 = &temp7;
25542     if ((items < 3) || (items > 3)) {
25543       SWIG_croak("Usage: Band_GetStatistics(self,approx_ok,force);");
25544     }
25545     res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_GDALRasterBandShadow, 0 |  0 );
25546     if (!SWIG_IsOK(res1)) {
25547       SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Band_GetStatistics" "', argument " "1"" of type '" "GDALRasterBandShadow *""'");
25548     }
25549     arg1 = reinterpret_cast< GDALRasterBandShadow * >(argp1);
25550     ecode2 = SWIG_AsVal_int SWIG_PERL_CALL_ARGS_2(ST(1), &val2);
25551     if (!SWIG_IsOK(ecode2)) {
25552       SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Band_GetStatistics" "', argument " "2"" of type '" "int""'");
25553     }
25554     arg2 = static_cast< int >(val2);
25555     ecode3 = SWIG_AsVal_int SWIG_PERL_CALL_ARGS_2(ST(2), &val3);
25556     if (!SWIG_IsOK(ecode3)) {
25557       SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "Band_GetStatistics" "', argument " "3"" of type '" "int""'");
25558     }
25559     arg3 = static_cast< int >(val3);
25560     {
25561       CPLErrorReset();
25562       result = (CPLErr)GDALRasterBandShadow_GetStatistics(arg1,arg2,arg3,arg4,arg5,arg6,arg7);
25563       CPLErr eclass = CPLGetLastErrorType();
25564       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
25565         do_confess( CPLGetLastErrorMsg(), 0 );
25566 
25567 
25568 
25569 
25570 
25571       }
25572 
25573 
25574       /*
25575           Make warnings regular Perl warnings. This duplicates the warning
25576           message if DontUseExceptions() is in effect (it is not by default).
25577           */
25578       if ( eclass == CE_Warning ) {
25579         warn( CPLGetLastErrorMsg(), "%s" );
25580       }
25581 
25582 
25583     }
25584     {
25585       /* %typemap(out) IF_ERROR_RETURN_NONE */
25586     }
25587     if (SWIG_IsTmpObj(res4)) {
25588       if (argvi >= items) EXTEND(sp,1);  ST(argvi) = SWIG_From_double  SWIG_PERL_CALL_ARGS_1((*arg4)); argvi++  ;
25589     } else {
25590       int new_flags = SWIG_IsNewObj(res4) ? (SWIG_POINTER_OWN | 0) : 0;
25591       if (argvi >= items) EXTEND(sp,1);  ST(argvi) = SWIG_NewPointerObj((void*)(arg4), SWIGTYPE_p_double, new_flags); argvi++  ;
25592     }
25593     if (SWIG_IsTmpObj(res5)) {
25594       if (argvi >= items) EXTEND(sp,1);  ST(argvi) = SWIG_From_double  SWIG_PERL_CALL_ARGS_1((*arg5)); argvi++  ;
25595     } else {
25596       int new_flags = SWIG_IsNewObj(res5) ? (SWIG_POINTER_OWN | 0) : 0;
25597       if (argvi >= items) EXTEND(sp,1);  ST(argvi) = SWIG_NewPointerObj((void*)(arg5), SWIGTYPE_p_double, new_flags); argvi++  ;
25598     }
25599     if (SWIG_IsTmpObj(res6)) {
25600       if (argvi >= items) EXTEND(sp,1);  ST(argvi) = SWIG_From_double  SWIG_PERL_CALL_ARGS_1((*arg6)); argvi++  ;
25601     } else {
25602       int new_flags = SWIG_IsNewObj(res6) ? (SWIG_POINTER_OWN | 0) : 0;
25603       if (argvi >= items) EXTEND(sp,1);  ST(argvi) = SWIG_NewPointerObj((void*)(arg6), SWIGTYPE_p_double, new_flags); argvi++  ;
25604     }
25605     if (SWIG_IsTmpObj(res7)) {
25606       if (argvi >= items) EXTEND(sp,1);  ST(argvi) = SWIG_From_double  SWIG_PERL_CALL_ARGS_1((*arg7)); argvi++  ;
25607     } else {
25608       int new_flags = SWIG_IsNewObj(res7) ? (SWIG_POINTER_OWN | 0) : 0;
25609       if (argvi >= items) EXTEND(sp,1);  ST(argvi) = SWIG_NewPointerObj((void*)(arg7), SWIGTYPE_p_double, new_flags); argvi++  ;
25610     }
25611 
25612 
25613 
25614 
25615 
25616 
25617 
25618     XSRETURN(argvi);
25619   fail:
25620 
25621 
25622 
25623 
25624 
25625 
25626 
25627     SWIG_croak_null();
25628   }
25629 }
25630 
25631 
XS(_wrap_Band_ComputeStatistics)25632 XS(_wrap_Band_ComputeStatistics) {
25633   {
25634     GDALRasterBandShadow *arg1 = (GDALRasterBandShadow *) 0 ;
25635     bool arg2 ;
25636     double *arg3 = (double *) NULL ;
25637     double *arg4 = (double *) NULL ;
25638     double *arg5 = (double *) NULL ;
25639     double *arg6 = (double *) NULL ;
25640     GDALProgressFunc arg7 = (GDALProgressFunc) NULL ;
25641     void *arg8 = (void *) NULL ;
25642     void *argp1 = 0 ;
25643     int res1 = 0 ;
25644     bool val2 ;
25645     int ecode2 = 0 ;
25646     double temp3 ;
25647     int res3 = SWIG_TMPOBJ ;
25648     double temp4 ;
25649     int res4 = SWIG_TMPOBJ ;
25650     double temp5 ;
25651     int res5 = SWIG_TMPOBJ ;
25652     double temp6 ;
25653     int res6 = SWIG_TMPOBJ ;
25654     int argvi = 0;
25655     CPLErr result;
25656     dXSARGS;
25657 
25658     /* %typemap(arginit, noblock=1) ( void* callback_data = NULL) */
25659     SavedEnv saved_env;
25660     saved_env.fct = NULL;
25661     saved_env.data = &PL_sv_undef;
25662     arg8 = (void *)(&saved_env);
25663     arg3 = &temp3;
25664     arg4 = &temp4;
25665     arg5 = &temp5;
25666     arg6 = &temp6;
25667     if ((items < 2) || (items > 4)) {
25668       SWIG_croak("Usage: Band_ComputeStatistics(self,approx_ok,callback,callback_data);");
25669     }
25670     res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_GDALRasterBandShadow, 0 |  0 );
25671     if (!SWIG_IsOK(res1)) {
25672       SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Band_ComputeStatistics" "', argument " "1"" of type '" "GDALRasterBandShadow *""'");
25673     }
25674     arg1 = reinterpret_cast< GDALRasterBandShadow * >(argp1);
25675     ecode2 = SWIG_AsVal_bool SWIG_PERL_CALL_ARGS_2(ST(1), &val2);
25676     if (!SWIG_IsOK(ecode2)) {
25677       SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Band_ComputeStatistics" "', argument " "2"" of type '" "bool""'");
25678     }
25679     arg2 = static_cast< bool >(val2);
25680     if (items > 2) {
25681       {
25682         /* %typemap(in) (GDALProgressFunc callback = NULL) */
25683         if (SvOK(ST(2))) {
25684           if (SvROK(ST(2))) {
25685             if (SvTYPE(SvRV(ST(2))) != SVt_PVCV) {
25686               do_confess(NEED_CODE_REF, 1);
25687             } else {
25688               saved_env.fct = (SV *)ST(2);
25689               arg7 = &callback_d_cp_vp;
25690             }
25691           } else {
25692             do_confess(NEED_CODE_REF, 1);
25693           }
25694         }
25695       }
25696     }
25697     if (items > 3) {
25698       {
25699         /* %typemap(in) (void* callback_data=NULL) */
25700         if (SvOK(ST(3)))
25701         saved_env.data = (SV *)ST(3);
25702       }
25703     }
25704     {
25705       CPLErrorReset();
25706       result = (CPLErr)GDALRasterBandShadow_ComputeStatistics(arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8);
25707       CPLErr eclass = CPLGetLastErrorType();
25708       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
25709         do_confess( CPLGetLastErrorMsg(), 0 );
25710 
25711 
25712 
25713 
25714 
25715       }
25716 
25717 
25718       /*
25719           Make warnings regular Perl warnings. This duplicates the warning
25720           message if DontUseExceptions() is in effect (it is not by default).
25721           */
25722       if ( eclass == CE_Warning ) {
25723         warn( CPLGetLastErrorMsg(), "%s" );
25724       }
25725 
25726 
25727     }
25728     {
25729       /* %typemap(out) IF_ERROR_RETURN_NONE */
25730     }
25731     if (SWIG_IsTmpObj(res3)) {
25732       if (argvi >= items) EXTEND(sp,1);  ST(argvi) = SWIG_From_double  SWIG_PERL_CALL_ARGS_1((*arg3)); argvi++  ;
25733     } else {
25734       int new_flags = SWIG_IsNewObj(res3) ? (SWIG_POINTER_OWN | 0) : 0;
25735       if (argvi >= items) EXTEND(sp,1);  ST(argvi) = SWIG_NewPointerObj((void*)(arg3), SWIGTYPE_p_double, new_flags); argvi++  ;
25736     }
25737     if (SWIG_IsTmpObj(res4)) {
25738       if (argvi >= items) EXTEND(sp,1);  ST(argvi) = SWIG_From_double  SWIG_PERL_CALL_ARGS_1((*arg4)); argvi++  ;
25739     } else {
25740       int new_flags = SWIG_IsNewObj(res4) ? (SWIG_POINTER_OWN | 0) : 0;
25741       if (argvi >= items) EXTEND(sp,1);  ST(argvi) = SWIG_NewPointerObj((void*)(arg4), SWIGTYPE_p_double, new_flags); argvi++  ;
25742     }
25743     if (SWIG_IsTmpObj(res5)) {
25744       if (argvi >= items) EXTEND(sp,1);  ST(argvi) = SWIG_From_double  SWIG_PERL_CALL_ARGS_1((*arg5)); argvi++  ;
25745     } else {
25746       int new_flags = SWIG_IsNewObj(res5) ? (SWIG_POINTER_OWN | 0) : 0;
25747       if (argvi >= items) EXTEND(sp,1);  ST(argvi) = SWIG_NewPointerObj((void*)(arg5), SWIGTYPE_p_double, new_flags); argvi++  ;
25748     }
25749     if (SWIG_IsTmpObj(res6)) {
25750       if (argvi >= items) EXTEND(sp,1);  ST(argvi) = SWIG_From_double  SWIG_PERL_CALL_ARGS_1((*arg6)); argvi++  ;
25751     } else {
25752       int new_flags = SWIG_IsNewObj(res6) ? (SWIG_POINTER_OWN | 0) : 0;
25753       if (argvi >= items) EXTEND(sp,1);  ST(argvi) = SWIG_NewPointerObj((void*)(arg6), SWIGTYPE_p_double, new_flags); argvi++  ;
25754     }
25755 
25756 
25757 
25758 
25759 
25760 
25761 
25762     XSRETURN(argvi);
25763   fail:
25764 
25765 
25766 
25767 
25768 
25769 
25770 
25771     SWIG_croak_null();
25772   }
25773 }
25774 
25775 
XS(_wrap_Band_SetStatistics)25776 XS(_wrap_Band_SetStatistics) {
25777   {
25778     GDALRasterBandShadow *arg1 = (GDALRasterBandShadow *) 0 ;
25779     double arg2 ;
25780     double arg3 ;
25781     double arg4 ;
25782     double arg5 ;
25783     void *argp1 = 0 ;
25784     int res1 = 0 ;
25785     double val2 ;
25786     int ecode2 = 0 ;
25787     double val3 ;
25788     int ecode3 = 0 ;
25789     double val4 ;
25790     int ecode4 = 0 ;
25791     double val5 ;
25792     int ecode5 = 0 ;
25793     int argvi = 0;
25794     CPLErr result;
25795     dXSARGS;
25796 
25797     if ((items < 5) || (items > 5)) {
25798       SWIG_croak("Usage: Band_SetStatistics(self,min,max,mean,stddev);");
25799     }
25800     res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_GDALRasterBandShadow, 0 |  0 );
25801     if (!SWIG_IsOK(res1)) {
25802       SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Band_SetStatistics" "', argument " "1"" of type '" "GDALRasterBandShadow *""'");
25803     }
25804     arg1 = reinterpret_cast< GDALRasterBandShadow * >(argp1);
25805     ecode2 = SWIG_AsVal_double SWIG_PERL_CALL_ARGS_2(ST(1), &val2);
25806     if (!SWIG_IsOK(ecode2)) {
25807       SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Band_SetStatistics" "', argument " "2"" of type '" "double""'");
25808     }
25809     arg2 = static_cast< double >(val2);
25810     ecode3 = SWIG_AsVal_double SWIG_PERL_CALL_ARGS_2(ST(2), &val3);
25811     if (!SWIG_IsOK(ecode3)) {
25812       SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "Band_SetStatistics" "', argument " "3"" of type '" "double""'");
25813     }
25814     arg3 = static_cast< double >(val3);
25815     ecode4 = SWIG_AsVal_double SWIG_PERL_CALL_ARGS_2(ST(3), &val4);
25816     if (!SWIG_IsOK(ecode4)) {
25817       SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "Band_SetStatistics" "', argument " "4"" of type '" "double""'");
25818     }
25819     arg4 = static_cast< double >(val4);
25820     ecode5 = SWIG_AsVal_double SWIG_PERL_CALL_ARGS_2(ST(4), &val5);
25821     if (!SWIG_IsOK(ecode5)) {
25822       SWIG_exception_fail(SWIG_ArgError(ecode5), "in method '" "Band_SetStatistics" "', argument " "5"" of type '" "double""'");
25823     }
25824     arg5 = static_cast< double >(val5);
25825     {
25826       CPLErrorReset();
25827       result = (CPLErr)GDALRasterBandShadow_SetStatistics(arg1,arg2,arg3,arg4,arg5);
25828       CPLErr eclass = CPLGetLastErrorType();
25829       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
25830         do_confess( CPLGetLastErrorMsg(), 0 );
25831 
25832 
25833 
25834 
25835 
25836       }
25837 
25838 
25839       /*
25840           Make warnings regular Perl warnings. This duplicates the warning
25841           message if DontUseExceptions() is in effect (it is not by default).
25842           */
25843       if ( eclass == CE_Warning ) {
25844         warn( CPLGetLastErrorMsg(), "%s" );
25845       }
25846 
25847 
25848     }
25849     ST(argvi) = SWIG_From_int  SWIG_PERL_CALL_ARGS_1(static_cast< int >(result)); argvi++ ;
25850 
25851 
25852 
25853 
25854 
25855     XSRETURN(argvi);
25856   fail:
25857 
25858 
25859 
25860 
25861 
25862     SWIG_croak_null();
25863   }
25864 }
25865 
25866 
XS(_wrap_Band_GetOverviewCount)25867 XS(_wrap_Band_GetOverviewCount) {
25868   {
25869     GDALRasterBandShadow *arg1 = (GDALRasterBandShadow *) 0 ;
25870     void *argp1 = 0 ;
25871     int res1 = 0 ;
25872     int argvi = 0;
25873     int result;
25874     dXSARGS;
25875 
25876     if ((items < 1) || (items > 1)) {
25877       SWIG_croak("Usage: Band_GetOverviewCount(self);");
25878     }
25879     res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_GDALRasterBandShadow, 0 |  0 );
25880     if (!SWIG_IsOK(res1)) {
25881       SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Band_GetOverviewCount" "', argument " "1"" of type '" "GDALRasterBandShadow *""'");
25882     }
25883     arg1 = reinterpret_cast< GDALRasterBandShadow * >(argp1);
25884     {
25885       CPLErrorReset();
25886       result = (int)GDALRasterBandShadow_GetOverviewCount(arg1);
25887       CPLErr eclass = CPLGetLastErrorType();
25888       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
25889         do_confess( CPLGetLastErrorMsg(), 0 );
25890 
25891 
25892 
25893 
25894 
25895       }
25896 
25897 
25898       /*
25899           Make warnings regular Perl warnings. This duplicates the warning
25900           message if DontUseExceptions() is in effect (it is not by default).
25901           */
25902       if ( eclass == CE_Warning ) {
25903         warn( CPLGetLastErrorMsg(), "%s" );
25904       }
25905 
25906 
25907     }
25908     ST(argvi) = SWIG_From_int  SWIG_PERL_CALL_ARGS_1(static_cast< int >(result)); argvi++ ;
25909 
25910     XSRETURN(argvi);
25911   fail:
25912 
25913     SWIG_croak_null();
25914   }
25915 }
25916 
25917 
XS(_wrap_Band__GetOverview)25918 XS(_wrap_Band__GetOverview) {
25919   {
25920     GDALRasterBandShadow *arg1 = (GDALRasterBandShadow *) 0 ;
25921     int arg2 ;
25922     void *argp1 = 0 ;
25923     int res1 = 0 ;
25924     int val2 ;
25925     int ecode2 = 0 ;
25926     int argvi = 0;
25927     GDALRasterBandShadow *result = 0 ;
25928     dXSARGS;
25929 
25930     if ((items < 2) || (items > 2)) {
25931       SWIG_croak("Usage: Band__GetOverview(self,i);");
25932     }
25933     res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_GDALRasterBandShadow, 0 |  0 );
25934     if (!SWIG_IsOK(res1)) {
25935       SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Band__GetOverview" "', argument " "1"" of type '" "GDALRasterBandShadow *""'");
25936     }
25937     arg1 = reinterpret_cast< GDALRasterBandShadow * >(argp1);
25938     ecode2 = SWIG_AsVal_int SWIG_PERL_CALL_ARGS_2(ST(1), &val2);
25939     if (!SWIG_IsOK(ecode2)) {
25940       SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Band__GetOverview" "', argument " "2"" of type '" "int""'");
25941     }
25942     arg2 = static_cast< int >(val2);
25943     {
25944       CPLErrorReset();
25945       result = (GDALRasterBandShadow *)GDALRasterBandShadow_GetOverview(arg1,arg2);
25946       CPLErr eclass = CPLGetLastErrorType();
25947       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
25948         do_confess( CPLGetLastErrorMsg(), 0 );
25949 
25950 
25951 
25952 
25953 
25954       }
25955 
25956 
25957       /*
25958           Make warnings regular Perl warnings. This duplicates the warning
25959           message if DontUseExceptions() is in effect (it is not by default).
25960           */
25961       if ( eclass == CE_Warning ) {
25962         warn( CPLGetLastErrorMsg(), "%s" );
25963       }
25964 
25965 
25966     }
25967     ST(argvi) = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GDALRasterBandShadow, 0 | SWIG_SHADOW); argvi++ ;
25968 
25969 
25970     XSRETURN(argvi);
25971   fail:
25972 
25973 
25974     SWIG_croak_null();
25975   }
25976 }
25977 
25978 
XS(_wrap_Band_Checksum)25979 XS(_wrap_Band_Checksum) {
25980   {
25981     GDALRasterBandShadow *arg1 = (GDALRasterBandShadow *) 0 ;
25982     int arg2 = (int) 0 ;
25983     int arg3 = (int) 0 ;
25984     int *arg4 = (int *) 0 ;
25985     int *arg5 = (int *) 0 ;
25986     void *argp1 = 0 ;
25987     int res1 = 0 ;
25988     int val2 ;
25989     int ecode2 = 0 ;
25990     int val3 ;
25991     int ecode3 = 0 ;
25992     int val4 ;
25993     int val5 ;
25994     int argvi = 0;
25995     int result;
25996     dXSARGS;
25997 
25998     if ((items < 1) || (items > 5)) {
25999       SWIG_croak("Usage: Band_Checksum(self,xoff,yoff,xsize,ysize);");
26000     }
26001     res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_GDALRasterBandShadow, 0 |  0 );
26002     if (!SWIG_IsOK(res1)) {
26003       SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Band_Checksum" "', argument " "1"" of type '" "GDALRasterBandShadow *""'");
26004     }
26005     arg1 = reinterpret_cast< GDALRasterBandShadow * >(argp1);
26006     if (items > 1) {
26007       ecode2 = SWIG_AsVal_int SWIG_PERL_CALL_ARGS_2(ST(1), &val2);
26008       if (!SWIG_IsOK(ecode2)) {
26009         SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Band_Checksum" "', argument " "2"" of type '" "int""'");
26010       }
26011       arg2 = static_cast< int >(val2);
26012     }
26013     if (items > 2) {
26014       ecode3 = SWIG_AsVal_int SWIG_PERL_CALL_ARGS_2(ST(2), &val3);
26015       if (!SWIG_IsOK(ecode3)) {
26016         SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "Band_Checksum" "', argument " "3"" of type '" "int""'");
26017       }
26018       arg3 = static_cast< int >(val3);
26019     }
26020     if (items > 3) {
26021       {
26022         /* %typemap(in) (int *optional_int) */
26023         if ( !SvOK(ST(3)) ) {
26024           arg4 = 0;
26025         }
26026         else {
26027           val4 = SvIV(ST(3));
26028           arg4 = (int *)&val4;
26029         }
26030       }
26031     }
26032     if (items > 4) {
26033       {
26034         /* %typemap(in) (int *optional_int) */
26035         if ( !SvOK(ST(4)) ) {
26036           arg5 = 0;
26037         }
26038         else {
26039           val5 = SvIV(ST(4));
26040           arg5 = (int *)&val5;
26041         }
26042       }
26043     }
26044     {
26045       CPLErrorReset();
26046       result = (int)GDALRasterBandShadow_Checksum(arg1,arg2,arg3,arg4,arg5);
26047       CPLErr eclass = CPLGetLastErrorType();
26048       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
26049         do_confess( CPLGetLastErrorMsg(), 0 );
26050 
26051 
26052 
26053 
26054 
26055       }
26056 
26057 
26058       /*
26059           Make warnings regular Perl warnings. This duplicates the warning
26060           message if DontUseExceptions() is in effect (it is not by default).
26061           */
26062       if ( eclass == CE_Warning ) {
26063         warn( CPLGetLastErrorMsg(), "%s" );
26064       }
26065 
26066 
26067     }
26068     ST(argvi) = SWIG_From_int  SWIG_PERL_CALL_ARGS_1(static_cast< int >(result)); argvi++ ;
26069 
26070 
26071 
26072 
26073 
26074     XSRETURN(argvi);
26075   fail:
26076 
26077 
26078 
26079 
26080 
26081     SWIG_croak_null();
26082   }
26083 }
26084 
26085 
XS(_wrap_Band_ComputeRasterMinMax)26086 XS(_wrap_Band_ComputeRasterMinMax) {
26087   {
26088     GDALRasterBandShadow *arg1 = (GDALRasterBandShadow *) 0 ;
26089     double *arg2 ;
26090     int arg3 = (int) 0 ;
26091     void *argp1 = 0 ;
26092     int res1 = 0 ;
26093     double argout2[2] ;
26094     int val3 ;
26095     int ecode3 = 0 ;
26096     int argvi = 0;
26097     dXSARGS;
26098 
26099     {
26100       /* %typemap(in,numinputs=0) (double argout2[ANY]) */
26101       arg2 = argout2;
26102     }
26103     if ((items < 1) || (items > 2)) {
26104       SWIG_croak("Usage: Band_ComputeRasterMinMax(self,approx_ok);");
26105     }
26106     res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_GDALRasterBandShadow, 0 |  0 );
26107     if (!SWIG_IsOK(res1)) {
26108       SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Band_ComputeRasterMinMax" "', argument " "1"" of type '" "GDALRasterBandShadow *""'");
26109     }
26110     arg1 = reinterpret_cast< GDALRasterBandShadow * >(argp1);
26111     if (items > 1) {
26112       ecode3 = SWIG_AsVal_int SWIG_PERL_CALL_ARGS_2(ST(1), &val3);
26113       if (!SWIG_IsOK(ecode3)) {
26114         SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "Band_ComputeRasterMinMax" "', argument " "3"" of type '" "int""'");
26115       }
26116       arg3 = static_cast< int >(val3);
26117     }
26118     {
26119       CPLErrorReset();
26120       GDALRasterBandShadow_ComputeRasterMinMax(arg1,arg2,arg3);
26121       CPLErr eclass = CPLGetLastErrorType();
26122       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
26123         do_confess( CPLGetLastErrorMsg(), 0 );
26124 
26125 
26126 
26127 
26128 
26129       }
26130 
26131 
26132       /*
26133           Make warnings regular Perl warnings. This duplicates the warning
26134           message if DontUseExceptions() is in effect (it is not by default).
26135           */
26136       if ( eclass == CE_Warning ) {
26137         warn( CPLGetLastErrorMsg(), "%s" );
26138       }
26139 
26140 
26141     }
26142     {
26143       /* %typemap(out) void */
26144     }
26145     {
26146       /* %typemap(argout) (double argout[ANY]) */
26147       if (GIMME_V == G_ARRAY) {
26148         /* return a list */
26149         int i;
26150         EXTEND(SP, argvi+2-items+1);
26151         for (i = 0; i < 2; i++)
26152         ST(argvi++) = sv_2mortal(newSVnv(arg2[i]));
26153       } else {
26154         ST(argvi) = CreateArrayFromDoubleArray( arg2, 2 );
26155         argvi++;
26156       }
26157     }
26158 
26159 
26160 
26161     XSRETURN(argvi);
26162   fail:
26163 
26164 
26165 
26166     SWIG_croak_null();
26167   }
26168 }
26169 
26170 
XS(_wrap_Band_ComputeBandStats)26171 XS(_wrap_Band_ComputeBandStats) {
26172   {
26173     GDALRasterBandShadow *arg1 = (GDALRasterBandShadow *) 0 ;
26174     double *arg2 ;
26175     int arg3 = (int) 1 ;
26176     void *argp1 = 0 ;
26177     int res1 = 0 ;
26178     double argout2[2] ;
26179     int val3 ;
26180     int ecode3 = 0 ;
26181     int argvi = 0;
26182     dXSARGS;
26183 
26184     {
26185       /* %typemap(in,numinputs=0) (double argout2[ANY]) */
26186       arg2 = argout2;
26187     }
26188     if ((items < 1) || (items > 2)) {
26189       SWIG_croak("Usage: Band_ComputeBandStats(self,samplestep);");
26190     }
26191     res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_GDALRasterBandShadow, 0 |  0 );
26192     if (!SWIG_IsOK(res1)) {
26193       SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Band_ComputeBandStats" "', argument " "1"" of type '" "GDALRasterBandShadow *""'");
26194     }
26195     arg1 = reinterpret_cast< GDALRasterBandShadow * >(argp1);
26196     if (items > 1) {
26197       ecode3 = SWIG_AsVal_int SWIG_PERL_CALL_ARGS_2(ST(1), &val3);
26198       if (!SWIG_IsOK(ecode3)) {
26199         SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "Band_ComputeBandStats" "', argument " "3"" of type '" "int""'");
26200       }
26201       arg3 = static_cast< int >(val3);
26202     }
26203     {
26204       CPLErrorReset();
26205       GDALRasterBandShadow_ComputeBandStats(arg1,arg2,arg3);
26206       CPLErr eclass = CPLGetLastErrorType();
26207       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
26208         do_confess( CPLGetLastErrorMsg(), 0 );
26209 
26210 
26211 
26212 
26213 
26214       }
26215 
26216 
26217       /*
26218           Make warnings regular Perl warnings. This duplicates the warning
26219           message if DontUseExceptions() is in effect (it is not by default).
26220           */
26221       if ( eclass == CE_Warning ) {
26222         warn( CPLGetLastErrorMsg(), "%s" );
26223       }
26224 
26225 
26226     }
26227     {
26228       /* %typemap(out) void */
26229     }
26230     {
26231       /* %typemap(argout) (double argout[ANY]) */
26232       if (GIMME_V == G_ARRAY) {
26233         /* return a list */
26234         int i;
26235         EXTEND(SP, argvi+2-items+1);
26236         for (i = 0; i < 2; i++)
26237         ST(argvi++) = sv_2mortal(newSVnv(arg2[i]));
26238       } else {
26239         ST(argvi) = CreateArrayFromDoubleArray( arg2, 2 );
26240         argvi++;
26241       }
26242     }
26243 
26244 
26245 
26246     XSRETURN(argvi);
26247   fail:
26248 
26249 
26250 
26251     SWIG_croak_null();
26252   }
26253 }
26254 
26255 
XS(_wrap_Band_Fill)26256 XS(_wrap_Band_Fill) {
26257   {
26258     GDALRasterBandShadow *arg1 = (GDALRasterBandShadow *) 0 ;
26259     double arg2 ;
26260     double arg3 = (double) 0.0 ;
26261     void *argp1 = 0 ;
26262     int res1 = 0 ;
26263     double val2 ;
26264     int ecode2 = 0 ;
26265     double val3 ;
26266     int ecode3 = 0 ;
26267     int argvi = 0;
26268     CPLErr result;
26269     dXSARGS;
26270 
26271     if ((items < 2) || (items > 3)) {
26272       SWIG_croak("Usage: Band_Fill(self,real_fill,imag_fill);");
26273     }
26274     res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_GDALRasterBandShadow, 0 |  0 );
26275     if (!SWIG_IsOK(res1)) {
26276       SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Band_Fill" "', argument " "1"" of type '" "GDALRasterBandShadow *""'");
26277     }
26278     arg1 = reinterpret_cast< GDALRasterBandShadow * >(argp1);
26279     ecode2 = SWIG_AsVal_double SWIG_PERL_CALL_ARGS_2(ST(1), &val2);
26280     if (!SWIG_IsOK(ecode2)) {
26281       SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Band_Fill" "', argument " "2"" of type '" "double""'");
26282     }
26283     arg2 = static_cast< double >(val2);
26284     if (items > 2) {
26285       ecode3 = SWIG_AsVal_double SWIG_PERL_CALL_ARGS_2(ST(2), &val3);
26286       if (!SWIG_IsOK(ecode3)) {
26287         SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "Band_Fill" "', argument " "3"" of type '" "double""'");
26288       }
26289       arg3 = static_cast< double >(val3);
26290     }
26291     {
26292       CPLErrorReset();
26293       result = (CPLErr)GDALRasterBandShadow_Fill(arg1,arg2,arg3);
26294       CPLErr eclass = CPLGetLastErrorType();
26295       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
26296         do_confess( CPLGetLastErrorMsg(), 0 );
26297 
26298 
26299 
26300 
26301 
26302       }
26303 
26304 
26305       /*
26306           Make warnings regular Perl warnings. This duplicates the warning
26307           message if DontUseExceptions() is in effect (it is not by default).
26308           */
26309       if ( eclass == CE_Warning ) {
26310         warn( CPLGetLastErrorMsg(), "%s" );
26311       }
26312 
26313 
26314     }
26315     ST(argvi) = SWIG_From_int  SWIG_PERL_CALL_ARGS_1(static_cast< int >(result)); argvi++ ;
26316 
26317 
26318 
26319     XSRETURN(argvi);
26320   fail:
26321 
26322 
26323 
26324     SWIG_croak_null();
26325   }
26326 }
26327 
26328 
XS(_wrap_Band__ReadRaster)26329 XS(_wrap_Band__ReadRaster) {
26330   {
26331     GDALRasterBandShadow *arg1 = (GDALRasterBandShadow *) 0 ;
26332     int arg2 ;
26333     int arg3 ;
26334     int arg4 ;
26335     int arg5 ;
26336     GIntBig *arg6 = (GIntBig *) 0 ;
26337     char **arg7 = (char **) 0 ;
26338     int *arg8 = (int *) 0 ;
26339     int *arg9 = (int *) 0 ;
26340     int *arg10 = (int *) 0 ;
26341     GIntBig *arg11 = (GIntBig *) 0 ;
26342     GIntBig *arg12 = (GIntBig *) 0 ;
26343     GDALRIOResampleAlg arg13 = (GDALRIOResampleAlg) GRIORA_NearestNeighbour ;
26344     GDALProgressFunc arg14 = (GDALProgressFunc) NULL ;
26345     void *arg15 = (void *) NULL ;
26346     void *argp1 = 0 ;
26347     int res1 = 0 ;
26348     int val2 ;
26349     int ecode2 = 0 ;
26350     int val3 ;
26351     int ecode3 = 0 ;
26352     int val4 ;
26353     int ecode4 = 0 ;
26354     int val5 ;
26355     int ecode5 = 0 ;
26356     GIntBig nLen6 = 0 ;
26357     char *pBuf6 = 0 ;
26358     int val8 ;
26359     int val9 ;
26360     int val10 ;
26361     GIntBig val11 ;
26362     GIntBig val12 ;
26363     int val13 ;
26364     int ecode13 = 0 ;
26365     int argvi = 0;
26366     CPLErr result;
26367     dXSARGS;
26368 
26369     /* %typemap(arginit, noblock=1) ( void* callback_data = NULL) */
26370     SavedEnv saved_env;
26371     saved_env.fct = NULL;
26372     saved_env.data = &PL_sv_undef;
26373     arg15 = (void *)(&saved_env);
26374     {
26375       /* %typemap(in,numinputs=0) (GIntBig *nLen6, char **pBuf6 ) */
26376       arg6 = &nLen6;
26377       arg7 = &pBuf6;
26378     }
26379     if ((items < 5) || (items > 13)) {
26380       SWIG_croak("Usage: Band__ReadRaster(self,xoff,yoff,xsize,ysize,buf,buf_xsize,buf_ysize,buf_type,buf_pixel_space,buf_line_space,resample_alg,callback,callback_data);");
26381     }
26382     res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_GDALRasterBandShadow, 0 |  0 );
26383     if (!SWIG_IsOK(res1)) {
26384       SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Band__ReadRaster" "', argument " "1"" of type '" "GDALRasterBandShadow *""'");
26385     }
26386     arg1 = reinterpret_cast< GDALRasterBandShadow * >(argp1);
26387     ecode2 = SWIG_AsVal_int SWIG_PERL_CALL_ARGS_2(ST(1), &val2);
26388     if (!SWIG_IsOK(ecode2)) {
26389       SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Band__ReadRaster" "', argument " "2"" of type '" "int""'");
26390     }
26391     arg2 = static_cast< int >(val2);
26392     ecode3 = SWIG_AsVal_int SWIG_PERL_CALL_ARGS_2(ST(2), &val3);
26393     if (!SWIG_IsOK(ecode3)) {
26394       SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "Band__ReadRaster" "', argument " "3"" of type '" "int""'");
26395     }
26396     arg3 = static_cast< int >(val3);
26397     ecode4 = SWIG_AsVal_int SWIG_PERL_CALL_ARGS_2(ST(3), &val4);
26398     if (!SWIG_IsOK(ecode4)) {
26399       SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "Band__ReadRaster" "', argument " "4"" of type '" "int""'");
26400     }
26401     arg4 = static_cast< int >(val4);
26402     ecode5 = SWIG_AsVal_int SWIG_PERL_CALL_ARGS_2(ST(4), &val5);
26403     if (!SWIG_IsOK(ecode5)) {
26404       SWIG_exception_fail(SWIG_ArgError(ecode5), "in method '" "Band__ReadRaster" "', argument " "5"" of type '" "int""'");
26405     }
26406     arg5 = static_cast< int >(val5);
26407     if (items > 5) {
26408       {
26409         /* %typemap(in) (int *optional_int) */
26410         if ( !SvOK(ST(5)) ) {
26411           arg8 = 0;
26412         }
26413         else {
26414           val8 = SvIV(ST(5));
26415           arg8 = (int *)&val8;
26416         }
26417       }
26418     }
26419     if (items > 6) {
26420       {
26421         /* %typemap(in) (int *optional_int) */
26422         if ( !SvOK(ST(6)) ) {
26423           arg9 = 0;
26424         }
26425         else {
26426           val9 = SvIV(ST(6));
26427           arg9 = (int *)&val9;
26428         }
26429       }
26430     }
26431     if (items > 7) {
26432       {
26433         /* %typemap(in) (int *optional_int) */
26434         if ( !SvOK(ST(7)) ) {
26435           arg10 = 0;
26436         }
26437         else {
26438           val10 = SvIV(ST(7));
26439           arg10 = (int *)&val10;
26440         }
26441       }
26442     }
26443     if (items > 8) {
26444       {
26445         /* %typemap(in) (GIntBig *optional_GIntBig) */
26446         if ( !SvOK(ST(8)) ) {
26447           arg11 = 0;
26448         }
26449         else {
26450           val11 = CPLAtoGIntBig(SvPV_nolen(ST(8)));
26451           arg11 = (GIntBig *)&val11;
26452         }
26453       }
26454     }
26455     if (items > 9) {
26456       {
26457         /* %typemap(in) (GIntBig *optional_GIntBig) */
26458         if ( !SvOK(ST(9)) ) {
26459           arg12 = 0;
26460         }
26461         else {
26462           val12 = CPLAtoGIntBig(SvPV_nolen(ST(9)));
26463           arg12 = (GIntBig *)&val12;
26464         }
26465       }
26466     }
26467     if (items > 10) {
26468       ecode13 = SWIG_AsVal_int SWIG_PERL_CALL_ARGS_2(ST(10), &val13);
26469       if (!SWIG_IsOK(ecode13)) {
26470         SWIG_exception_fail(SWIG_ArgError(ecode13), "in method '" "Band__ReadRaster" "', argument " "13"" of type '" "GDALRIOResampleAlg""'");
26471       }
26472       arg13 = static_cast< GDALRIOResampleAlg >(val13);
26473     }
26474     if (items > 11) {
26475       {
26476         /* %typemap(in) (GDALProgressFunc callback = NULL) */
26477         if (SvOK(ST(11))) {
26478           if (SvROK(ST(11))) {
26479             if (SvTYPE(SvRV(ST(11))) != SVt_PVCV) {
26480               do_confess(NEED_CODE_REF, 1);
26481             } else {
26482               saved_env.fct = (SV *)ST(11);
26483               arg14 = &callback_d_cp_vp;
26484             }
26485           } else {
26486             do_confess(NEED_CODE_REF, 1);
26487           }
26488         }
26489       }
26490     }
26491     if (items > 12) {
26492       {
26493         /* %typemap(in) (void* callback_data=NULL) */
26494         if (SvOK(ST(12)))
26495         saved_env.data = (SV *)ST(12);
26496       }
26497     }
26498     {
26499       CPLErrorReset();
26500       result = (CPLErr)GDALRasterBandShadow_ReadRaster(arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9,arg10,arg11,arg12,arg13,arg14,arg15);
26501       CPLErr eclass = CPLGetLastErrorType();
26502       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
26503         do_confess( CPLGetLastErrorMsg(), 0 );
26504 
26505 
26506 
26507 
26508 
26509       }
26510 
26511 
26512       /*
26513           Make warnings regular Perl warnings. This duplicates the warning
26514           message if DontUseExceptions() is in effect (it is not by default).
26515           */
26516       if ( eclass == CE_Warning ) {
26517         warn( CPLGetLastErrorMsg(), "%s" );
26518       }
26519 
26520 
26521     }
26522     ST(argvi) = SWIG_From_int  SWIG_PERL_CALL_ARGS_1(static_cast< int >(result)); argvi++ ;
26523     {
26524       /* %typemap(argout) (GIntBig *nLen, char **pBuf ) */
26525       ST(argvi) = sv_2mortal(newSVpv( *arg7, *arg6 ));
26526       argvi++;
26527     }
26528 
26529 
26530 
26531 
26532 
26533     {
26534       /* %typemap(freearg) (GIntBig *nLen, char **pBuf ) */
26535       if( *arg6 ) {
26536         free( *arg7 );
26537       }
26538     }
26539 
26540 
26541 
26542 
26543 
26544 
26545 
26546     XSRETURN(argvi);
26547   fail:
26548 
26549 
26550 
26551 
26552 
26553     {
26554       /* %typemap(freearg) (GIntBig *nLen, char **pBuf ) */
26555       if( *arg6 ) {
26556         free( *arg7 );
26557       }
26558     }
26559 
26560 
26561 
26562 
26563 
26564 
26565 
26566     SWIG_croak_null();
26567   }
26568 }
26569 
26570 
XS(_wrap_Band__WriteRaster)26571 XS(_wrap_Band__WriteRaster) {
26572   {
26573     GDALRasterBandShadow *arg1 = (GDALRasterBandShadow *) 0 ;
26574     int arg2 ;
26575     int arg3 ;
26576     int arg4 ;
26577     int arg5 ;
26578     GIntBig arg6 ;
26579     char *arg7 = (char *) 0 ;
26580     int *arg8 = (int *) 0 ;
26581     int *arg9 = (int *) 0 ;
26582     GDALDataType *arg10 = (GDALDataType *) 0 ;
26583     GIntBig *arg11 = (GIntBig *) 0 ;
26584     GIntBig *arg12 = (GIntBig *) 0 ;
26585     void *argp1 = 0 ;
26586     int res1 = 0 ;
26587     int val2 ;
26588     int ecode2 = 0 ;
26589     int val3 ;
26590     int ecode3 = 0 ;
26591     int val4 ;
26592     int ecode4 = 0 ;
26593     int val5 ;
26594     int ecode5 = 0 ;
26595     int val8 ;
26596     int val9 ;
26597     int val10 ;
26598     GIntBig val11 ;
26599     GIntBig val12 ;
26600     int argvi = 0;
26601     CPLErr result;
26602     dXSARGS;
26603 
26604     if ((items < 6) || (items > 11)) {
26605       SWIG_croak("Usage: Band__WriteRaster(self,xoff,yoff,xsize,ysize,buf_len,buf_string,buf_xsize,buf_ysize,buf_type,buf_pixel_space,buf_line_space);");
26606     }
26607     res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_GDALRasterBandShadow, 0 |  0 );
26608     if (!SWIG_IsOK(res1)) {
26609       SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Band__WriteRaster" "', argument " "1"" of type '" "GDALRasterBandShadow *""'");
26610     }
26611     arg1 = reinterpret_cast< GDALRasterBandShadow * >(argp1);
26612     ecode2 = SWIG_AsVal_int SWIG_PERL_CALL_ARGS_2(ST(1), &val2);
26613     if (!SWIG_IsOK(ecode2)) {
26614       SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Band__WriteRaster" "', argument " "2"" of type '" "int""'");
26615     }
26616     arg2 = static_cast< int >(val2);
26617     ecode3 = SWIG_AsVal_int SWIG_PERL_CALL_ARGS_2(ST(2), &val3);
26618     if (!SWIG_IsOK(ecode3)) {
26619       SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "Band__WriteRaster" "', argument " "3"" of type '" "int""'");
26620     }
26621     arg3 = static_cast< int >(val3);
26622     ecode4 = SWIG_AsVal_int SWIG_PERL_CALL_ARGS_2(ST(3), &val4);
26623     if (!SWIG_IsOK(ecode4)) {
26624       SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "Band__WriteRaster" "', argument " "4"" of type '" "int""'");
26625     }
26626     arg4 = static_cast< int >(val4);
26627     ecode5 = SWIG_AsVal_int SWIG_PERL_CALL_ARGS_2(ST(4), &val5);
26628     if (!SWIG_IsOK(ecode5)) {
26629       SWIG_exception_fail(SWIG_ArgError(ecode5), "in method '" "Band__WriteRaster" "', argument " "5"" of type '" "int""'");
26630     }
26631     arg5 = static_cast< int >(val5);
26632     {
26633       /* %typemap(in,numinputs=1) (GIntBig nLen, char *pBuf ) */
26634       if (SvOK(ST(5))) {
26635         SV *sv = ST(5);
26636         if (SvROK(sv) && SvTYPE(SvRV(sv)) < SVt_PVAV)
26637         sv = SvRV(sv);
26638         if (!SvPOK(sv))
26639         do_confess(NEED_BINARY_DATA, 1);
26640         STRLEN len = SvCUR(sv);
26641         arg7 = SvPV_nolen(sv);
26642         arg6 = len;
26643       } else {
26644         arg7 = NULL;
26645         arg6 = 0;
26646       }
26647     }
26648     if (items > 6) {
26649       {
26650         /* %typemap(in) (int *optional_int) */
26651         if ( !SvOK(ST(6)) ) {
26652           arg8 = 0;
26653         }
26654         else {
26655           val8 = SvIV(ST(6));
26656           arg8 = (int *)&val8;
26657         }
26658       }
26659     }
26660     if (items > 7) {
26661       {
26662         /* %typemap(in) (int *optional_int) */
26663         if ( !SvOK(ST(7)) ) {
26664           arg9 = 0;
26665         }
26666         else {
26667           val9 = SvIV(ST(7));
26668           arg9 = (int *)&val9;
26669         }
26670       }
26671     }
26672     if (items > 8) {
26673       {
26674         /* %typemap(in) (int *optional_int) */
26675         if ( !SvOK(ST(8)) ) {
26676           arg10 = 0;
26677         }
26678         else {
26679           val10 = SvIV(ST(8));
26680           arg10 = (GDALDataType *)&val10;
26681         }
26682       }
26683     }
26684     if (items > 9) {
26685       {
26686         /* %typemap(in) (GIntBig *optional_GIntBig) */
26687         if ( !SvOK(ST(9)) ) {
26688           arg11 = 0;
26689         }
26690         else {
26691           val11 = CPLAtoGIntBig(SvPV_nolen(ST(9)));
26692           arg11 = (GIntBig *)&val11;
26693         }
26694       }
26695     }
26696     if (items > 10) {
26697       {
26698         /* %typemap(in) (GIntBig *optional_GIntBig) */
26699         if ( !SvOK(ST(10)) ) {
26700           arg12 = 0;
26701         }
26702         else {
26703           val12 = CPLAtoGIntBig(SvPV_nolen(ST(10)));
26704           arg12 = (GIntBig *)&val12;
26705         }
26706       }
26707     }
26708     {
26709       CPLErrorReset();
26710       result = (CPLErr)GDALRasterBandShadow_WriteRaster(arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9,arg10,arg11,arg12);
26711       CPLErr eclass = CPLGetLastErrorType();
26712       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
26713         do_confess( CPLGetLastErrorMsg(), 0 );
26714 
26715 
26716 
26717 
26718 
26719       }
26720 
26721 
26722       /*
26723           Make warnings regular Perl warnings. This duplicates the warning
26724           message if DontUseExceptions() is in effect (it is not by default).
26725           */
26726       if ( eclass == CE_Warning ) {
26727         warn( CPLGetLastErrorMsg(), "%s" );
26728       }
26729 
26730 
26731     }
26732     ST(argvi) = SWIG_From_int  SWIG_PERL_CALL_ARGS_1(static_cast< int >(result)); argvi++ ;
26733 
26734 
26735 
26736 
26737 
26738 
26739 
26740 
26741 
26742 
26743     XSRETURN(argvi);
26744   fail:
26745 
26746 
26747 
26748 
26749 
26750 
26751 
26752 
26753 
26754 
26755     SWIG_croak_null();
26756   }
26757 }
26758 
26759 
XS(_wrap_Band_FlushCache)26760 XS(_wrap_Band_FlushCache) {
26761   {
26762     GDALRasterBandShadow *arg1 = (GDALRasterBandShadow *) 0 ;
26763     void *argp1 = 0 ;
26764     int res1 = 0 ;
26765     int argvi = 0;
26766     dXSARGS;
26767 
26768     if ((items < 1) || (items > 1)) {
26769       SWIG_croak("Usage: Band_FlushCache(self);");
26770     }
26771     res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_GDALRasterBandShadow, 0 |  0 );
26772     if (!SWIG_IsOK(res1)) {
26773       SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Band_FlushCache" "', argument " "1"" of type '" "GDALRasterBandShadow *""'");
26774     }
26775     arg1 = reinterpret_cast< GDALRasterBandShadow * >(argp1);
26776     {
26777       CPLErrorReset();
26778       GDALRasterBandShadow_FlushCache(arg1);
26779       CPLErr eclass = CPLGetLastErrorType();
26780       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
26781         do_confess( CPLGetLastErrorMsg(), 0 );
26782 
26783 
26784 
26785 
26786 
26787       }
26788 
26789 
26790       /*
26791           Make warnings regular Perl warnings. This duplicates the warning
26792           message if DontUseExceptions() is in effect (it is not by default).
26793           */
26794       if ( eclass == CE_Warning ) {
26795         warn( CPLGetLastErrorMsg(), "%s" );
26796       }
26797 
26798 
26799     }
26800     {
26801       /* %typemap(out) void */
26802     }
26803 
26804     XSRETURN(argvi);
26805   fail:
26806 
26807     SWIG_croak_null();
26808   }
26809 }
26810 
26811 
XS(_wrap_Band_GetRasterColorTable)26812 XS(_wrap_Band_GetRasterColorTable) {
26813   {
26814     GDALRasterBandShadow *arg1 = (GDALRasterBandShadow *) 0 ;
26815     void *argp1 = 0 ;
26816     int res1 = 0 ;
26817     int argvi = 0;
26818     GDALColorTableShadow *result = 0 ;
26819     dXSARGS;
26820 
26821     if ((items < 1) || (items > 1)) {
26822       SWIG_croak("Usage: Band_GetRasterColorTable(self);");
26823     }
26824     res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_GDALRasterBandShadow, 0 |  0 );
26825     if (!SWIG_IsOK(res1)) {
26826       SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Band_GetRasterColorTable" "', argument " "1"" of type '" "GDALRasterBandShadow *""'");
26827     }
26828     arg1 = reinterpret_cast< GDALRasterBandShadow * >(argp1);
26829     {
26830       CPLErrorReset();
26831       result = (GDALColorTableShadow *)GDALRasterBandShadow_GetRasterColorTable(arg1);
26832       CPLErr eclass = CPLGetLastErrorType();
26833       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
26834         do_confess( CPLGetLastErrorMsg(), 0 );
26835 
26836 
26837 
26838 
26839 
26840       }
26841 
26842 
26843       /*
26844           Make warnings regular Perl warnings. This duplicates the warning
26845           message if DontUseExceptions() is in effect (it is not by default).
26846           */
26847       if ( eclass == CE_Warning ) {
26848         warn( CPLGetLastErrorMsg(), "%s" );
26849       }
26850 
26851 
26852     }
26853     ST(argvi) = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GDALColorTableShadow, 0 | SWIG_SHADOW); argvi++ ;
26854 
26855     XSRETURN(argvi);
26856   fail:
26857 
26858     SWIG_croak_null();
26859   }
26860 }
26861 
26862 
XS(_wrap_Band_GetColorTable)26863 XS(_wrap_Band_GetColorTable) {
26864   {
26865     GDALRasterBandShadow *arg1 = (GDALRasterBandShadow *) 0 ;
26866     void *argp1 = 0 ;
26867     int res1 = 0 ;
26868     int argvi = 0;
26869     GDALColorTableShadow *result = 0 ;
26870     dXSARGS;
26871 
26872     if ((items < 1) || (items > 1)) {
26873       SWIG_croak("Usage: Band_GetColorTable(self);");
26874     }
26875     res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_GDALRasterBandShadow, 0 |  0 );
26876     if (!SWIG_IsOK(res1)) {
26877       SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Band_GetColorTable" "', argument " "1"" of type '" "GDALRasterBandShadow *""'");
26878     }
26879     arg1 = reinterpret_cast< GDALRasterBandShadow * >(argp1);
26880     {
26881       CPLErrorReset();
26882       result = (GDALColorTableShadow *)GDALRasterBandShadow_GetColorTable(arg1);
26883       CPLErr eclass = CPLGetLastErrorType();
26884       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
26885         do_confess( CPLGetLastErrorMsg(), 0 );
26886 
26887 
26888 
26889 
26890 
26891       }
26892 
26893 
26894       /*
26895           Make warnings regular Perl warnings. This duplicates the warning
26896           message if DontUseExceptions() is in effect (it is not by default).
26897           */
26898       if ( eclass == CE_Warning ) {
26899         warn( CPLGetLastErrorMsg(), "%s" );
26900       }
26901 
26902 
26903     }
26904     ST(argvi) = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GDALColorTableShadow, 0 | SWIG_SHADOW); argvi++ ;
26905 
26906     XSRETURN(argvi);
26907   fail:
26908 
26909     SWIG_croak_null();
26910   }
26911 }
26912 
26913 
XS(_wrap_Band_SetRasterColorTable)26914 XS(_wrap_Band_SetRasterColorTable) {
26915   {
26916     GDALRasterBandShadow *arg1 = (GDALRasterBandShadow *) 0 ;
26917     GDALColorTableShadow *arg2 = (GDALColorTableShadow *) 0 ;
26918     void *argp1 = 0 ;
26919     int res1 = 0 ;
26920     void *argp2 = 0 ;
26921     int res2 = 0 ;
26922     int argvi = 0;
26923     int result;
26924     dXSARGS;
26925 
26926     if ((items < 2) || (items > 2)) {
26927       SWIG_croak("Usage: Band_SetRasterColorTable(self,arg);");
26928     }
26929     res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_GDALRasterBandShadow, 0 |  0 );
26930     if (!SWIG_IsOK(res1)) {
26931       SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Band_SetRasterColorTable" "', argument " "1"" of type '" "GDALRasterBandShadow *""'");
26932     }
26933     arg1 = reinterpret_cast< GDALRasterBandShadow * >(argp1);
26934     res2 = SWIG_ConvertPtr(ST(1), &argp2,SWIGTYPE_p_GDALColorTableShadow, 0 |  0 );
26935     if (!SWIG_IsOK(res2)) {
26936       SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Band_SetRasterColorTable" "', argument " "2"" of type '" "GDALColorTableShadow *""'");
26937     }
26938     arg2 = reinterpret_cast< GDALColorTableShadow * >(argp2);
26939     {
26940       CPLErrorReset();
26941       result = (int)GDALRasterBandShadow_SetRasterColorTable(arg1,arg2);
26942       CPLErr eclass = CPLGetLastErrorType();
26943       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
26944         do_confess( CPLGetLastErrorMsg(), 0 );
26945 
26946 
26947 
26948 
26949 
26950       }
26951 
26952 
26953       /*
26954           Make warnings regular Perl warnings. This duplicates the warning
26955           message if DontUseExceptions() is in effect (it is not by default).
26956           */
26957       if ( eclass == CE_Warning ) {
26958         warn( CPLGetLastErrorMsg(), "%s" );
26959       }
26960 
26961 
26962     }
26963     ST(argvi) = SWIG_From_int  SWIG_PERL_CALL_ARGS_1(static_cast< int >(result)); argvi++ ;
26964 
26965 
26966     XSRETURN(argvi);
26967   fail:
26968 
26969 
26970     SWIG_croak_null();
26971   }
26972 }
26973 
26974 
XS(_wrap_Band_SetColorTable)26975 XS(_wrap_Band_SetColorTable) {
26976   {
26977     GDALRasterBandShadow *arg1 = (GDALRasterBandShadow *) 0 ;
26978     GDALColorTableShadow *arg2 = (GDALColorTableShadow *) 0 ;
26979     void *argp1 = 0 ;
26980     int res1 = 0 ;
26981     void *argp2 = 0 ;
26982     int res2 = 0 ;
26983     int argvi = 0;
26984     int result;
26985     dXSARGS;
26986 
26987     if ((items < 2) || (items > 2)) {
26988       SWIG_croak("Usage: Band_SetColorTable(self,arg);");
26989     }
26990     res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_GDALRasterBandShadow, 0 |  0 );
26991     if (!SWIG_IsOK(res1)) {
26992       SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Band_SetColorTable" "', argument " "1"" of type '" "GDALRasterBandShadow *""'");
26993     }
26994     arg1 = reinterpret_cast< GDALRasterBandShadow * >(argp1);
26995     res2 = SWIG_ConvertPtr(ST(1), &argp2,SWIGTYPE_p_GDALColorTableShadow, 0 |  0 );
26996     if (!SWIG_IsOK(res2)) {
26997       SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Band_SetColorTable" "', argument " "2"" of type '" "GDALColorTableShadow *""'");
26998     }
26999     arg2 = reinterpret_cast< GDALColorTableShadow * >(argp2);
27000     {
27001       CPLErrorReset();
27002       result = (int)GDALRasterBandShadow_SetColorTable(arg1,arg2);
27003       CPLErr eclass = CPLGetLastErrorType();
27004       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
27005         do_confess( CPLGetLastErrorMsg(), 0 );
27006 
27007 
27008 
27009 
27010 
27011       }
27012 
27013 
27014       /*
27015           Make warnings regular Perl warnings. This duplicates the warning
27016           message if DontUseExceptions() is in effect (it is not by default).
27017           */
27018       if ( eclass == CE_Warning ) {
27019         warn( CPLGetLastErrorMsg(), "%s" );
27020       }
27021 
27022 
27023     }
27024     ST(argvi) = SWIG_From_int  SWIG_PERL_CALL_ARGS_1(static_cast< int >(result)); argvi++ ;
27025 
27026 
27027     XSRETURN(argvi);
27028   fail:
27029 
27030 
27031     SWIG_croak_null();
27032   }
27033 }
27034 
27035 
XS(_wrap_Band_GetDefaultRAT)27036 XS(_wrap_Band_GetDefaultRAT) {
27037   {
27038     GDALRasterBandShadow *arg1 = (GDALRasterBandShadow *) 0 ;
27039     void *argp1 = 0 ;
27040     int res1 = 0 ;
27041     int argvi = 0;
27042     GDALRasterAttributeTableShadow *result = 0 ;
27043     dXSARGS;
27044 
27045     if ((items < 1) || (items > 1)) {
27046       SWIG_croak("Usage: Band_GetDefaultRAT(self);");
27047     }
27048     res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_GDALRasterBandShadow, 0 |  0 );
27049     if (!SWIG_IsOK(res1)) {
27050       SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Band_GetDefaultRAT" "', argument " "1"" of type '" "GDALRasterBandShadow *""'");
27051     }
27052     arg1 = reinterpret_cast< GDALRasterBandShadow * >(argp1);
27053     {
27054       CPLErrorReset();
27055       result = (GDALRasterAttributeTableShadow *)GDALRasterBandShadow_GetDefaultRAT(arg1);
27056       CPLErr eclass = CPLGetLastErrorType();
27057       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
27058         do_confess( CPLGetLastErrorMsg(), 0 );
27059 
27060 
27061 
27062 
27063 
27064       }
27065 
27066 
27067       /*
27068           Make warnings regular Perl warnings. This duplicates the warning
27069           message if DontUseExceptions() is in effect (it is not by default).
27070           */
27071       if ( eclass == CE_Warning ) {
27072         warn( CPLGetLastErrorMsg(), "%s" );
27073       }
27074 
27075 
27076     }
27077     ST(argvi) = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GDALRasterAttributeTableShadow, 0 | SWIG_SHADOW); argvi++ ;
27078 
27079     XSRETURN(argvi);
27080   fail:
27081 
27082     SWIG_croak_null();
27083   }
27084 }
27085 
27086 
XS(_wrap_Band_SetDefaultRAT)27087 XS(_wrap_Band_SetDefaultRAT) {
27088   {
27089     GDALRasterBandShadow *arg1 = (GDALRasterBandShadow *) 0 ;
27090     GDALRasterAttributeTableShadow *arg2 = (GDALRasterAttributeTableShadow *) 0 ;
27091     void *argp1 = 0 ;
27092     int res1 = 0 ;
27093     void *argp2 = 0 ;
27094     int res2 = 0 ;
27095     int argvi = 0;
27096     int result;
27097     dXSARGS;
27098 
27099     if ((items < 2) || (items > 2)) {
27100       SWIG_croak("Usage: Band_SetDefaultRAT(self,table);");
27101     }
27102     res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_GDALRasterBandShadow, 0 |  0 );
27103     if (!SWIG_IsOK(res1)) {
27104       SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Band_SetDefaultRAT" "', argument " "1"" of type '" "GDALRasterBandShadow *""'");
27105     }
27106     arg1 = reinterpret_cast< GDALRasterBandShadow * >(argp1);
27107     res2 = SWIG_ConvertPtr(ST(1), &argp2,SWIGTYPE_p_GDALRasterAttributeTableShadow, 0 |  0 );
27108     if (!SWIG_IsOK(res2)) {
27109       SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Band_SetDefaultRAT" "', argument " "2"" of type '" "GDALRasterAttributeTableShadow *""'");
27110     }
27111     arg2 = reinterpret_cast< GDALRasterAttributeTableShadow * >(argp2);
27112     {
27113       CPLErrorReset();
27114       result = (int)GDALRasterBandShadow_SetDefaultRAT(arg1,arg2);
27115       CPLErr eclass = CPLGetLastErrorType();
27116       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
27117         do_confess( CPLGetLastErrorMsg(), 0 );
27118 
27119 
27120 
27121 
27122 
27123       }
27124 
27125 
27126       /*
27127           Make warnings regular Perl warnings. This duplicates the warning
27128           message if DontUseExceptions() is in effect (it is not by default).
27129           */
27130       if ( eclass == CE_Warning ) {
27131         warn( CPLGetLastErrorMsg(), "%s" );
27132       }
27133 
27134 
27135     }
27136     ST(argvi) = SWIG_From_int  SWIG_PERL_CALL_ARGS_1(static_cast< int >(result)); argvi++ ;
27137 
27138 
27139     XSRETURN(argvi);
27140   fail:
27141 
27142 
27143     SWIG_croak_null();
27144   }
27145 }
27146 
27147 
XS(_wrap_Band__GetMaskBand)27148 XS(_wrap_Band__GetMaskBand) {
27149   {
27150     GDALRasterBandShadow *arg1 = (GDALRasterBandShadow *) 0 ;
27151     void *argp1 = 0 ;
27152     int res1 = 0 ;
27153     int argvi = 0;
27154     GDALRasterBandShadow *result = 0 ;
27155     dXSARGS;
27156 
27157     if ((items < 1) || (items > 1)) {
27158       SWIG_croak("Usage: Band__GetMaskBand(self);");
27159     }
27160     res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_GDALRasterBandShadow, 0 |  0 );
27161     if (!SWIG_IsOK(res1)) {
27162       SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Band__GetMaskBand" "', argument " "1"" of type '" "GDALRasterBandShadow *""'");
27163     }
27164     arg1 = reinterpret_cast< GDALRasterBandShadow * >(argp1);
27165     {
27166       CPLErrorReset();
27167       result = (GDALRasterBandShadow *)GDALRasterBandShadow_GetMaskBand(arg1);
27168       CPLErr eclass = CPLGetLastErrorType();
27169       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
27170         do_confess( CPLGetLastErrorMsg(), 0 );
27171 
27172 
27173 
27174 
27175 
27176       }
27177 
27178 
27179       /*
27180           Make warnings regular Perl warnings. This duplicates the warning
27181           message if DontUseExceptions() is in effect (it is not by default).
27182           */
27183       if ( eclass == CE_Warning ) {
27184         warn( CPLGetLastErrorMsg(), "%s" );
27185       }
27186 
27187 
27188     }
27189     ST(argvi) = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GDALRasterBandShadow, 0 | SWIG_SHADOW); argvi++ ;
27190 
27191     XSRETURN(argvi);
27192   fail:
27193 
27194     SWIG_croak_null();
27195   }
27196 }
27197 
27198 
XS(_wrap_Band__GetMaskFlags)27199 XS(_wrap_Band__GetMaskFlags) {
27200   {
27201     GDALRasterBandShadow *arg1 = (GDALRasterBandShadow *) 0 ;
27202     void *argp1 = 0 ;
27203     int res1 = 0 ;
27204     int argvi = 0;
27205     int result;
27206     dXSARGS;
27207 
27208     if ((items < 1) || (items > 1)) {
27209       SWIG_croak("Usage: Band__GetMaskFlags(self);");
27210     }
27211     res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_GDALRasterBandShadow, 0 |  0 );
27212     if (!SWIG_IsOK(res1)) {
27213       SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Band__GetMaskFlags" "', argument " "1"" of type '" "GDALRasterBandShadow *""'");
27214     }
27215     arg1 = reinterpret_cast< GDALRasterBandShadow * >(argp1);
27216     {
27217       CPLErrorReset();
27218       result = (int)GDALRasterBandShadow_GetMaskFlags(arg1);
27219       CPLErr eclass = CPLGetLastErrorType();
27220       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
27221         do_confess( CPLGetLastErrorMsg(), 0 );
27222 
27223 
27224 
27225 
27226 
27227       }
27228 
27229 
27230       /*
27231           Make warnings regular Perl warnings. This duplicates the warning
27232           message if DontUseExceptions() is in effect (it is not by default).
27233           */
27234       if ( eclass == CE_Warning ) {
27235         warn( CPLGetLastErrorMsg(), "%s" );
27236       }
27237 
27238 
27239     }
27240     ST(argvi) = SWIG_From_int  SWIG_PERL_CALL_ARGS_1(static_cast< int >(result)); argvi++ ;
27241 
27242     XSRETURN(argvi);
27243   fail:
27244 
27245     SWIG_croak_null();
27246   }
27247 }
27248 
27249 
XS(_wrap_Band__CreateMaskBand)27250 XS(_wrap_Band__CreateMaskBand) {
27251   {
27252     GDALRasterBandShadow *arg1 = (GDALRasterBandShadow *) 0 ;
27253     int arg2 ;
27254     void *argp1 = 0 ;
27255     int res1 = 0 ;
27256     int val2 ;
27257     int ecode2 = 0 ;
27258     int argvi = 0;
27259     CPLErr result;
27260     dXSARGS;
27261 
27262     if ((items < 2) || (items > 2)) {
27263       SWIG_croak("Usage: Band__CreateMaskBand(self,nFlags);");
27264     }
27265     res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_GDALRasterBandShadow, 0 |  0 );
27266     if (!SWIG_IsOK(res1)) {
27267       SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Band__CreateMaskBand" "', argument " "1"" of type '" "GDALRasterBandShadow *""'");
27268     }
27269     arg1 = reinterpret_cast< GDALRasterBandShadow * >(argp1);
27270     ecode2 = SWIG_AsVal_int SWIG_PERL_CALL_ARGS_2(ST(1), &val2);
27271     if (!SWIG_IsOK(ecode2)) {
27272       SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Band__CreateMaskBand" "', argument " "2"" of type '" "int""'");
27273     }
27274     arg2 = static_cast< int >(val2);
27275     {
27276       CPLErrorReset();
27277       result = (CPLErr)GDALRasterBandShadow_CreateMaskBand(arg1,arg2);
27278       CPLErr eclass = CPLGetLastErrorType();
27279       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
27280         do_confess( CPLGetLastErrorMsg(), 0 );
27281 
27282 
27283 
27284 
27285 
27286       }
27287 
27288 
27289       /*
27290           Make warnings regular Perl warnings. This duplicates the warning
27291           message if DontUseExceptions() is in effect (it is not by default).
27292           */
27293       if ( eclass == CE_Warning ) {
27294         warn( CPLGetLastErrorMsg(), "%s" );
27295       }
27296 
27297 
27298     }
27299     ST(argvi) = SWIG_From_int  SWIG_PERL_CALL_ARGS_1(static_cast< int >(result)); argvi++ ;
27300 
27301 
27302     XSRETURN(argvi);
27303   fail:
27304 
27305 
27306     SWIG_croak_null();
27307   }
27308 }
27309 
27310 
XS(_wrap_Band__GetHistogram)27311 XS(_wrap_Band__GetHistogram) {
27312   {
27313     GDALRasterBandShadow *arg1 = (GDALRasterBandShadow *) 0 ;
27314     double arg2 = (double) -0.5 ;
27315     double arg3 = (double) 255.5 ;
27316     int arg4 = (int) 256 ;
27317     GUIntBig *arg5 = (GUIntBig *) NULL ;
27318     int arg6 = (int) 0 ;
27319     int arg7 = (int) 1 ;
27320     GDALProgressFunc arg8 = (GDALProgressFunc) NULL ;
27321     void *arg9 = (void *) NULL ;
27322     void *argp1 = 0 ;
27323     int res1 = 0 ;
27324     double val2 ;
27325     int ecode2 = 0 ;
27326     double val3 ;
27327     int ecode3 = 0 ;
27328     int val6 ;
27329     int ecode6 = 0 ;
27330     int val7 ;
27331     int ecode7 = 0 ;
27332     int argvi = 0;
27333     SV * _saved[1] ;
27334     CPLErr result;
27335     dXSARGS;
27336 
27337     /* %typemap(arginit, noblock=1) ( void* callback_data = NULL) */
27338     SavedEnv saved_env;
27339     saved_env.fct = NULL;
27340     saved_env.data = &PL_sv_undef;
27341     arg9 = (void *)(&saved_env);
27342     if ((items < 1) || (items > 8)) {
27343       SWIG_croak("Usage: Band__GetHistogram(self,min,max,buckets,panHistogram,include_out_of_range,approx_ok,callback,callback_data);");
27344     }
27345     res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_GDALRasterBandShadow, 0 |  0 );
27346     if (!SWIG_IsOK(res1)) {
27347       SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Band__GetHistogram" "', argument " "1"" of type '" "GDALRasterBandShadow *""'");
27348     }
27349     arg1 = reinterpret_cast< GDALRasterBandShadow * >(argp1);
27350     if (items > 1) {
27351       ecode2 = SWIG_AsVal_double SWIG_PERL_CALL_ARGS_2(ST(1), &val2);
27352       if (!SWIG_IsOK(ecode2)) {
27353         SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Band__GetHistogram" "', argument " "2"" of type '" "double""'");
27354       }
27355       arg2 = static_cast< double >(val2);
27356     }
27357     if (items > 2) {
27358       ecode3 = SWIG_AsVal_double SWIG_PERL_CALL_ARGS_2(ST(2), &val3);
27359       if (!SWIG_IsOK(ecode3)) {
27360         SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "Band__GetHistogram" "', argument " "3"" of type '" "double""'");
27361       }
27362       arg3 = static_cast< double >(val3);
27363     }
27364     if (items > 3) {
27365       {
27366         /* %typemap(in,numinputs=1) (int len, GUIntBig *output) */
27367         arg4 = SvIV(ST(3));
27368       }
27369     }
27370     if (items > 4) {
27371       ecode6 = SWIG_AsVal_int SWIG_PERL_CALL_ARGS_2(ST(4), &val6);
27372       if (!SWIG_IsOK(ecode6)) {
27373         SWIG_exception_fail(SWIG_ArgError(ecode6), "in method '" "Band__GetHistogram" "', argument " "6"" of type '" "int""'");
27374       }
27375       arg6 = static_cast< int >(val6);
27376     }
27377     if (items > 5) {
27378       ecode7 = SWIG_AsVal_int SWIG_PERL_CALL_ARGS_2(ST(5), &val7);
27379       if (!SWIG_IsOK(ecode7)) {
27380         SWIG_exception_fail(SWIG_ArgError(ecode7), "in method '" "Band__GetHistogram" "', argument " "7"" of type '" "int""'");
27381       }
27382       arg7 = static_cast< int >(val7);
27383     }
27384     if (items > 6) {
27385       {
27386         /* %typemap(in) (GDALProgressFunc callback = NULL) */
27387         if (SvOK(ST(6))) {
27388           if (SvROK(ST(6))) {
27389             if (SvTYPE(SvRV(ST(6))) != SVt_PVCV) {
27390               do_confess(NEED_CODE_REF, 1);
27391             } else {
27392               saved_env.fct = (SV *)ST(6);
27393               arg8 = &callback_d_cp_vp;
27394             }
27395           } else {
27396             do_confess(NEED_CODE_REF, 1);
27397           }
27398         }
27399       }
27400     }
27401     if (items > 7) {
27402       {
27403         /* %typemap(in) (void* callback_data=NULL) */
27404         if (SvOK(ST(7)))
27405         saved_env.data = (SV *)ST(7);
27406       }
27407     }
27408     {
27409       /* %typemap(check) (int len, GUIntBig *output) */
27410       if (arg4 < 1) arg4 = 1; /* stop idiocy */
27411       arg5 = (GUIntBig*)CPLMalloc( arg4 * sizeof(GUIntBig) );
27412 
27413     }
27414     _saved[0] = ST(3);
27415     {
27416       CPLErrorReset();
27417       result = (CPLErr)GDALRasterBandShadow_GetHistogram(arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9);
27418       CPLErr eclass = CPLGetLastErrorType();
27419       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
27420         do_confess( CPLGetLastErrorMsg(), 0 );
27421 
27422 
27423 
27424 
27425 
27426       }
27427 
27428 
27429       /*
27430           Make warnings regular Perl warnings. This duplicates the warning
27431           message if DontUseExceptions() is in effect (it is not by default).
27432           */
27433       if ( eclass == CE_Warning ) {
27434         warn( CPLGetLastErrorMsg(), "%s" );
27435       }
27436 
27437 
27438     }
27439     {
27440       /* %typemap(out) IF_ERROR_RETURN_NONE */
27441     }
27442     {
27443       /* %typemap(argout) (int len, GUIntBig *output) */
27444       if (GIMME_V == G_ARRAY) {
27445         /* return a list */
27446         int i;
27447         EXTEND(SP, argvi+arg4-items+1);
27448         for (i = 0; i < arg4; i++) {
27449           char s[LENGTH_OF_GUIntBig_AS_STRING];
27450           snprintf(s, LENGTH_OF_GUIntBig_AS_STRING-1, CPL_FRMT_GUIB, arg5[i]);
27451           ST(argvi++) = sv_2mortal(newSVpv(s, 0));
27452         }
27453       } else {
27454         ST(argvi) = CreateArrayFromGUIntBigArray( arg5, arg4 );
27455         argvi++;
27456       }
27457     }
27458 
27459 
27460 
27461     {
27462       /* %typemap(freearg) (int len, GUIntBig *output) */
27463       CPLFree(arg5);
27464     }
27465 
27466 
27467 
27468     XSRETURN(argvi);
27469   fail:
27470 
27471 
27472 
27473     {
27474       /* %typemap(freearg) (int len, GUIntBig *output) */
27475       CPLFree(arg5);
27476     }
27477 
27478 
27479 
27480     SWIG_croak_null();
27481   }
27482 }
27483 
27484 
XS(_wrap_Band_GetDefaultHistogram)27485 XS(_wrap_Band_GetDefaultHistogram) {
27486   {
27487     GDALRasterBandShadow *arg1 = (GDALRasterBandShadow *) 0 ;
27488     double *arg2 = (double *) NULL ;
27489     double *arg3 = (double *) NULL ;
27490     int *arg4 = (int *) NULL ;
27491     GUIntBig **arg5 = (GUIntBig **) NULL ;
27492     int arg6 = (int) 1 ;
27493     GDALProgressFunc arg7 = (GDALProgressFunc) NULL ;
27494     void *arg8 = (void *) NULL ;
27495     void *argp1 = 0 ;
27496     int res1 = 0 ;
27497     double temp2 ;
27498     int res2 = SWIG_TMPOBJ ;
27499     double temp3 ;
27500     int res3 = SWIG_TMPOBJ ;
27501     int nLen4 ;
27502     GUIntBig *pList4 ;
27503     int val6 ;
27504     int ecode6 = 0 ;
27505     int argvi = 0;
27506     CPLErr result;
27507     dXSARGS;
27508 
27509     /* %typemap(arginit, noblock=1) ( void* callback_data = NULL) */
27510     SavedEnv saved_env;
27511     saved_env.fct = NULL;
27512     saved_env.data = &PL_sv_undef;
27513     arg8 = (void *)(&saved_env);
27514     arg2 = &temp2;
27515     arg3 = &temp3;
27516     {
27517       /* %typemap(in,numinputs=0) (int *nLen4, const GUIntBig **pList4) */
27518       arg4 = &nLen4;
27519       arg5 = &pList4;
27520     }
27521     if ((items < 1) || (items > 4)) {
27522       SWIG_croak("Usage: Band_GetDefaultHistogram(self,ppanHistogram,force,callback,callback_data);");
27523     }
27524     res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_GDALRasterBandShadow, 0 |  0 );
27525     if (!SWIG_IsOK(res1)) {
27526       SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Band_GetDefaultHistogram" "', argument " "1"" of type '" "GDALRasterBandShadow *""'");
27527     }
27528     arg1 = reinterpret_cast< GDALRasterBandShadow * >(argp1);
27529     if (items > 1) {
27530       ecode6 = SWIG_AsVal_int SWIG_PERL_CALL_ARGS_2(ST(1), &val6);
27531       if (!SWIG_IsOK(ecode6)) {
27532         SWIG_exception_fail(SWIG_ArgError(ecode6), "in method '" "Band_GetDefaultHistogram" "', argument " "6"" of type '" "int""'");
27533       }
27534       arg6 = static_cast< int >(val6);
27535     }
27536     if (items > 2) {
27537       {
27538         /* %typemap(in) (GDALProgressFunc callback = NULL) */
27539         if (SvOK(ST(2))) {
27540           if (SvROK(ST(2))) {
27541             if (SvTYPE(SvRV(ST(2))) != SVt_PVCV) {
27542               do_confess(NEED_CODE_REF, 1);
27543             } else {
27544               saved_env.fct = (SV *)ST(2);
27545               arg7 = &callback_d_cp_vp;
27546             }
27547           } else {
27548             do_confess(NEED_CODE_REF, 1);
27549           }
27550         }
27551       }
27552     }
27553     if (items > 3) {
27554       {
27555         /* %typemap(in) (void* callback_data=NULL) */
27556         if (SvOK(ST(3)))
27557         saved_env.data = (SV *)ST(3);
27558       }
27559     }
27560     {
27561       CPLErrorReset();
27562       result = (CPLErr)GDALRasterBandShadow_GetDefaultHistogram(arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8);
27563       CPLErr eclass = CPLGetLastErrorType();
27564       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
27565         do_confess( CPLGetLastErrorMsg(), 0 );
27566 
27567 
27568 
27569 
27570 
27571       }
27572 
27573 
27574       /*
27575           Make warnings regular Perl warnings. This duplicates the warning
27576           message if DontUseExceptions() is in effect (it is not by default).
27577           */
27578       if ( eclass == CE_Warning ) {
27579         warn( CPLGetLastErrorMsg(), "%s" );
27580       }
27581 
27582 
27583     }
27584     {
27585       /* %typemap(out) IF_ERROR_RETURN_NONE */
27586     }
27587     if (SWIG_IsTmpObj(res2)) {
27588       if (argvi >= items) EXTEND(sp,1);  ST(argvi) = SWIG_From_double  SWIG_PERL_CALL_ARGS_1((*arg2)); argvi++  ;
27589     } else {
27590       int new_flags = SWIG_IsNewObj(res2) ? (SWIG_POINTER_OWN | 0) : 0;
27591       if (argvi >= items) EXTEND(sp,1);  ST(argvi) = SWIG_NewPointerObj((void*)(arg2), SWIGTYPE_p_double, new_flags); argvi++  ;
27592     }
27593     if (SWIG_IsTmpObj(res3)) {
27594       if (argvi >= items) EXTEND(sp,1);  ST(argvi) = SWIG_From_double  SWIG_PERL_CALL_ARGS_1((*arg3)); argvi++  ;
27595     } else {
27596       int new_flags = SWIG_IsNewObj(res3) ? (SWIG_POINTER_OWN | 0) : 0;
27597       if (argvi >= items) EXTEND(sp,1);  ST(argvi) = SWIG_NewPointerObj((void*)(arg3), SWIGTYPE_p_double, new_flags); argvi++  ;
27598     }
27599     {
27600       /* %typemap(argout) (int *nLen, const GUIntBig **pList) */
27601       ST(argvi) = CreateArrayFromGUIntBigArray( *(arg5), *(arg4) );
27602       argvi++;
27603     }
27604 
27605 
27606 
27607 
27608 
27609     XSRETURN(argvi);
27610   fail:
27611 
27612 
27613 
27614 
27615 
27616     SWIG_croak_null();
27617   }
27618 }
27619 
27620 
XS(_wrap_Band_SetDefaultHistogram)27621 XS(_wrap_Band_SetDefaultHistogram) {
27622   {
27623     GDALRasterBandShadow *arg1 = (GDALRasterBandShadow *) 0 ;
27624     double arg2 ;
27625     double arg3 ;
27626     int arg4 ;
27627     GUIntBig *arg5 = (GUIntBig *) 0 ;
27628     void *argp1 = 0 ;
27629     int res1 = 0 ;
27630     double val2 ;
27631     int ecode2 = 0 ;
27632     double val3 ;
27633     int ecode3 = 0 ;
27634     int argvi = 0;
27635     CPLErr result;
27636     dXSARGS;
27637 
27638     if ((items < 4) || (items > 4)) {
27639       SWIG_croak("Usage: Band_SetDefaultHistogram(self,min,max,buckets_in,panHistogram_in);");
27640     }
27641     res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_GDALRasterBandShadow, 0 |  0 );
27642     if (!SWIG_IsOK(res1)) {
27643       SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Band_SetDefaultHistogram" "', argument " "1"" of type '" "GDALRasterBandShadow *""'");
27644     }
27645     arg1 = reinterpret_cast< GDALRasterBandShadow * >(argp1);
27646     ecode2 = SWIG_AsVal_double SWIG_PERL_CALL_ARGS_2(ST(1), &val2);
27647     if (!SWIG_IsOK(ecode2)) {
27648       SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Band_SetDefaultHistogram" "', argument " "2"" of type '" "double""'");
27649     }
27650     arg2 = static_cast< double >(val2);
27651     ecode3 = SWIG_AsVal_double SWIG_PERL_CALL_ARGS_2(ST(2), &val3);
27652     if (!SWIG_IsOK(ecode3)) {
27653       SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "Band_SetDefaultHistogram" "', argument " "3"" of type '" "double""'");
27654     }
27655     arg3 = static_cast< double >(val3);
27656     {
27657       /* %typemap(in,numinputs=1) (int nList, GUIntBig* pList) */
27658       if (!(SvROK(ST(3)) && (SvTYPE(SvRV(ST(3)))==SVt_PVAV)))
27659       do_confess(NEED_ARRAY_REF, 1);
27660       AV *av = (AV*)(SvRV(ST(3)));
27661       arg4 = av_len(av)+1;
27662       arg5 = (GUIntBig*)CPLMalloc(arg4*sizeof(GUIntBig));
27663       if (arg5) {
27664         for( int i = 0; i<arg4; i++ ) {
27665           SV **sv = av_fetch(av, i, 0);
27666           arg5[i] =  CPLScanUIntBig(SvPV_nolen(*sv), 30);
27667         }
27668       } else
27669       SWIG_fail;
27670     }
27671     {
27672       CPLErrorReset();
27673       result = (CPLErr)GDALRasterBandShadow_SetDefaultHistogram(arg1,arg2,arg3,arg4,arg5);
27674       CPLErr eclass = CPLGetLastErrorType();
27675       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
27676         do_confess( CPLGetLastErrorMsg(), 0 );
27677 
27678 
27679 
27680 
27681 
27682       }
27683 
27684 
27685       /*
27686           Make warnings regular Perl warnings. This duplicates the warning
27687           message if DontUseExceptions() is in effect (it is not by default).
27688           */
27689       if ( eclass == CE_Warning ) {
27690         warn( CPLGetLastErrorMsg(), "%s" );
27691       }
27692 
27693 
27694     }
27695     ST(argvi) = SWIG_From_int  SWIG_PERL_CALL_ARGS_1(static_cast< int >(result)); argvi++ ;
27696 
27697 
27698 
27699     {
27700       /* %typemap(freearg) (int nList, GUIntBig* pList) */
27701       CPLFree((void*) arg5);
27702     }
27703     XSRETURN(argvi);
27704   fail:
27705 
27706 
27707 
27708     {
27709       /* %typemap(freearg) (int nList, GUIntBig* pList) */
27710       CPLFree((void*) arg5);
27711     }
27712     SWIG_croak_null();
27713   }
27714 }
27715 
27716 
XS(_wrap_Band_HasArbitraryOverviews)27717 XS(_wrap_Band_HasArbitraryOverviews) {
27718   {
27719     GDALRasterBandShadow *arg1 = (GDALRasterBandShadow *) 0 ;
27720     void *argp1 = 0 ;
27721     int res1 = 0 ;
27722     int argvi = 0;
27723     bool result;
27724     dXSARGS;
27725 
27726     if ((items < 1) || (items > 1)) {
27727       SWIG_croak("Usage: Band_HasArbitraryOverviews(self);");
27728     }
27729     res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_GDALRasterBandShadow, 0 |  0 );
27730     if (!SWIG_IsOK(res1)) {
27731       SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Band_HasArbitraryOverviews" "', argument " "1"" of type '" "GDALRasterBandShadow *""'");
27732     }
27733     arg1 = reinterpret_cast< GDALRasterBandShadow * >(argp1);
27734     {
27735       CPLErrorReset();
27736       result = (bool)GDALRasterBandShadow_HasArbitraryOverviews(arg1);
27737       CPLErr eclass = CPLGetLastErrorType();
27738       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
27739         do_confess( CPLGetLastErrorMsg(), 0 );
27740 
27741 
27742 
27743 
27744 
27745       }
27746 
27747 
27748       /*
27749           Make warnings regular Perl warnings. This duplicates the warning
27750           message if DontUseExceptions() is in effect (it is not by default).
27751           */
27752       if ( eclass == CE_Warning ) {
27753         warn( CPLGetLastErrorMsg(), "%s" );
27754       }
27755 
27756 
27757     }
27758     ST(argvi) = SWIG_From_bool  SWIG_PERL_CALL_ARGS_1(static_cast< bool >(result)); argvi++ ;
27759 
27760     XSRETURN(argvi);
27761   fail:
27762 
27763     SWIG_croak_null();
27764   }
27765 }
27766 
27767 
XS(_wrap_Band_GetCategoryNames)27768 XS(_wrap_Band_GetCategoryNames) {
27769   {
27770     GDALRasterBandShadow *arg1 = (GDALRasterBandShadow *) 0 ;
27771     void *argp1 = 0 ;
27772     int res1 = 0 ;
27773     int argvi = 0;
27774     char **result = 0 ;
27775     dXSARGS;
27776 
27777     if ((items < 1) || (items > 1)) {
27778       SWIG_croak("Usage: Band_GetCategoryNames(self);");
27779     }
27780     res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_GDALRasterBandShadow, 0 |  0 );
27781     if (!SWIG_IsOK(res1)) {
27782       SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Band_GetCategoryNames" "', argument " "1"" of type '" "GDALRasterBandShadow *""'");
27783     }
27784     arg1 = reinterpret_cast< GDALRasterBandShadow * >(argp1);
27785     {
27786       CPLErrorReset();
27787       result = (char **)GDALRasterBandShadow_GetCategoryNames(arg1);
27788       CPLErr eclass = CPLGetLastErrorType();
27789       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
27790         do_confess( CPLGetLastErrorMsg(), 0 );
27791 
27792 
27793 
27794 
27795 
27796       }
27797 
27798 
27799       /*
27800           Make warnings regular Perl warnings. This duplicates the warning
27801           message if DontUseExceptions() is in effect (it is not by default).
27802           */
27803       if ( eclass == CE_Warning ) {
27804         warn( CPLGetLastErrorMsg(), "%s" );
27805       }
27806 
27807 
27808     }
27809     {
27810       /* %typemap(out) char **options -> ( string ) */
27811       AV* av = (AV*)sv_2mortal((SV*)newAV());
27812       char **stringarray = result;
27813       if ( stringarray != NULL ) {
27814         int n = CSLCount( stringarray );
27815         for ( int i = 0; i < n; i++ ) {
27816           SV *sv = newSVpv(stringarray[i], 0);
27817           SvUTF8_on(sv); /* expecting UTF-8 from GDAL */
27818           if (!av_store(av, i, sv))
27819           SvREFCNT_dec(sv);
27820         }
27821       }
27822       ST(argvi) = newRV((SV*)av);
27823       sv_2mortal(ST(argvi));
27824       argvi++;
27825     }
27826 
27827     XSRETURN(argvi);
27828   fail:
27829 
27830     SWIG_croak_null();
27831   }
27832 }
27833 
27834 
XS(_wrap_Band_SetCategoryNames)27835 XS(_wrap_Band_SetCategoryNames) {
27836   {
27837     GDALRasterBandShadow *arg1 = (GDALRasterBandShadow *) 0 ;
27838     char **arg2 = (char **) 0 ;
27839     void *argp1 = 0 ;
27840     int res1 = 0 ;
27841     int argvi = 0;
27842     CPLErr result;
27843     dXSARGS;
27844 
27845     if ((items < 2) || (items > 2)) {
27846       SWIG_croak("Usage: Band_SetCategoryNames(self,papszCategoryNames);");
27847     }
27848     res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_GDALRasterBandShadow, 0 |  0 );
27849     if (!SWIG_IsOK(res1)) {
27850       SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Band_SetCategoryNames" "', argument " "1"" of type '" "GDALRasterBandShadow *""'");
27851     }
27852     arg1 = reinterpret_cast< GDALRasterBandShadow * >(argp1);
27853     {
27854       /* %typemap(in) char **options */
27855       if (SvOK(ST(1))) {
27856         if (SvROK(ST(1))) {
27857           if (SvTYPE(SvRV(ST(1)))==SVt_PVAV) {
27858             AV *av = (AV*)(SvRV(ST(1)));
27859             for (int i = 0; i < av_len(av)+1; i++) {
27860               SV *sv = *(av_fetch(av, i, 0));
27861               bool sf;
27862               char *tmp = sv_to_utf8_string(sv, NULL, &sf);
27863               arg2 = CSLAddString(arg2, tmp);
27864               if (sf) Safefree(tmp); else free(tmp);
27865             }
27866           } else if (SvTYPE(SvRV(ST(1)))==SVt_PVHV) {
27867             HV *hv = (HV*)SvRV(ST(1));
27868             SV *sv;
27869             char *key;
27870             I32 klen;
27871             arg2 = NULL;
27872             hv_iterinit(hv);
27873             while(sv = hv_iternextsv(hv, &key, &klen)) {
27874               bool sf;
27875               char *tmp = sv_to_utf8_string(sv, NULL, &sf);
27876               arg2 = CSLAddNameValue(arg2, key, tmp);
27877               if (sf) Safefree(tmp); else free(tmp);
27878             }
27879           } else
27880           do_confess(NEED_REF, 1);
27881         } else
27882         do_confess(NEED_REF, 1);
27883       }
27884     }
27885     {
27886       CPLErrorReset();
27887       result = (CPLErr)GDALRasterBandShadow_SetCategoryNames(arg1,arg2);
27888       CPLErr eclass = CPLGetLastErrorType();
27889       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
27890         do_confess( CPLGetLastErrorMsg(), 0 );
27891 
27892 
27893 
27894 
27895 
27896       }
27897 
27898 
27899       /*
27900           Make warnings regular Perl warnings. This duplicates the warning
27901           message if DontUseExceptions() is in effect (it is not by default).
27902           */
27903       if ( eclass == CE_Warning ) {
27904         warn( CPLGetLastErrorMsg(), "%s" );
27905       }
27906 
27907 
27908     }
27909     ST(argvi) = SWIG_From_int  SWIG_PERL_CALL_ARGS_1(static_cast< int >(result)); argvi++ ;
27910 
27911     {
27912       /* %typemap(freearg) char **options */
27913       if (arg2) CSLDestroy( arg2 );
27914     }
27915     XSRETURN(argvi);
27916   fail:
27917 
27918     {
27919       /* %typemap(freearg) char **options */
27920       if (arg2) CSLDestroy( arg2 );
27921     }
27922     SWIG_croak_null();
27923   }
27924 }
27925 
27926 
XS(_wrap_Band_AdviseRead)27927 XS(_wrap_Band_AdviseRead) {
27928   {
27929     GDALRasterBandShadow *arg1 = (GDALRasterBandShadow *) 0 ;
27930     int arg2 ;
27931     int arg3 ;
27932     int arg4 ;
27933     int arg5 ;
27934     int *arg6 = (int *) 0 ;
27935     int *arg7 = (int *) 0 ;
27936     GDALDataType *arg8 = (GDALDataType *) 0 ;
27937     char **arg9 = (char **) NULL ;
27938     void *argp1 = 0 ;
27939     int res1 = 0 ;
27940     int val2 ;
27941     int ecode2 = 0 ;
27942     int val3 ;
27943     int ecode3 = 0 ;
27944     int val4 ;
27945     int ecode4 = 0 ;
27946     int val5 ;
27947     int ecode5 = 0 ;
27948     void *argp6 = 0 ;
27949     int res6 = 0 ;
27950     void *argp7 = 0 ;
27951     int res7 = 0 ;
27952     int val8 ;
27953     int argvi = 0;
27954     CPLErr result;
27955     dXSARGS;
27956 
27957     if ((items < 5) || (items > 9)) {
27958       SWIG_croak("Usage: Band_AdviseRead(self,xoff,yoff,xsize,ysize,buf_xsize,buf_ysize,buf_type,options);");
27959     }
27960     res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_GDALRasterBandShadow, 0 |  0 );
27961     if (!SWIG_IsOK(res1)) {
27962       SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Band_AdviseRead" "', argument " "1"" of type '" "GDALRasterBandShadow *""'");
27963     }
27964     arg1 = reinterpret_cast< GDALRasterBandShadow * >(argp1);
27965     ecode2 = SWIG_AsVal_int SWIG_PERL_CALL_ARGS_2(ST(1), &val2);
27966     if (!SWIG_IsOK(ecode2)) {
27967       SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Band_AdviseRead" "', argument " "2"" of type '" "int""'");
27968     }
27969     arg2 = static_cast< int >(val2);
27970     ecode3 = SWIG_AsVal_int SWIG_PERL_CALL_ARGS_2(ST(2), &val3);
27971     if (!SWIG_IsOK(ecode3)) {
27972       SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "Band_AdviseRead" "', argument " "3"" of type '" "int""'");
27973     }
27974     arg3 = static_cast< int >(val3);
27975     ecode4 = SWIG_AsVal_int SWIG_PERL_CALL_ARGS_2(ST(3), &val4);
27976     if (!SWIG_IsOK(ecode4)) {
27977       SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "Band_AdviseRead" "', argument " "4"" of type '" "int""'");
27978     }
27979     arg4 = static_cast< int >(val4);
27980     ecode5 = SWIG_AsVal_int SWIG_PERL_CALL_ARGS_2(ST(4), &val5);
27981     if (!SWIG_IsOK(ecode5)) {
27982       SWIG_exception_fail(SWIG_ArgError(ecode5), "in method '" "Band_AdviseRead" "', argument " "5"" of type '" "int""'");
27983     }
27984     arg5 = static_cast< int >(val5);
27985     if (items > 5) {
27986       res6 = SWIG_ConvertPtr(ST(5), &argp6,SWIGTYPE_p_int, 0 |  0 );
27987       if (!SWIG_IsOK(res6)) {
27988         SWIG_exception_fail(SWIG_ArgError(res6), "in method '" "Band_AdviseRead" "', argument " "6"" of type '" "int *""'");
27989       }
27990       arg6 = reinterpret_cast< int * >(argp6);
27991     }
27992     if (items > 6) {
27993       res7 = SWIG_ConvertPtr(ST(6), &argp7,SWIGTYPE_p_int, 0 |  0 );
27994       if (!SWIG_IsOK(res7)) {
27995         SWIG_exception_fail(SWIG_ArgError(res7), "in method '" "Band_AdviseRead" "', argument " "7"" of type '" "int *""'");
27996       }
27997       arg7 = reinterpret_cast< int * >(argp7);
27998     }
27999     if (items > 7) {
28000       {
28001         /* %typemap(in) (int *optional_int) */
28002         if ( !SvOK(ST(7)) ) {
28003           arg8 = 0;
28004         }
28005         else {
28006           val8 = SvIV(ST(7));
28007           arg8 = (GDALDataType *)&val8;
28008         }
28009       }
28010     }
28011     if (items > 8) {
28012       {
28013         /* %typemap(in) char **options */
28014         if (SvOK(ST(8))) {
28015           if (SvROK(ST(8))) {
28016             if (SvTYPE(SvRV(ST(8)))==SVt_PVAV) {
28017               AV *av = (AV*)(SvRV(ST(8)));
28018               for (int i = 0; i < av_len(av)+1; i++) {
28019                 SV *sv = *(av_fetch(av, i, 0));
28020                 bool sf;
28021                 char *tmp = sv_to_utf8_string(sv, NULL, &sf);
28022                 arg9 = CSLAddString(arg9, tmp);
28023                 if (sf) Safefree(tmp); else free(tmp);
28024               }
28025             } else if (SvTYPE(SvRV(ST(8)))==SVt_PVHV) {
28026               HV *hv = (HV*)SvRV(ST(8));
28027               SV *sv;
28028               char *key;
28029               I32 klen;
28030               arg9 = NULL;
28031               hv_iterinit(hv);
28032               while(sv = hv_iternextsv(hv, &key, &klen)) {
28033                 bool sf;
28034                 char *tmp = sv_to_utf8_string(sv, NULL, &sf);
28035                 arg9 = CSLAddNameValue(arg9, key, tmp);
28036                 if (sf) Safefree(tmp); else free(tmp);
28037               }
28038             } else
28039             do_confess(NEED_REF, 1);
28040           } else
28041           do_confess(NEED_REF, 1);
28042         }
28043       }
28044     }
28045     {
28046       CPLErrorReset();
28047       result = (CPLErr)GDALRasterBandShadow_AdviseRead(arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9);
28048       CPLErr eclass = CPLGetLastErrorType();
28049       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
28050         do_confess( CPLGetLastErrorMsg(), 0 );
28051 
28052 
28053 
28054 
28055 
28056       }
28057 
28058 
28059       /*
28060           Make warnings regular Perl warnings. This duplicates the warning
28061           message if DontUseExceptions() is in effect (it is not by default).
28062           */
28063       if ( eclass == CE_Warning ) {
28064         warn( CPLGetLastErrorMsg(), "%s" );
28065       }
28066 
28067 
28068     }
28069     ST(argvi) = SWIG_From_int  SWIG_PERL_CALL_ARGS_1(static_cast< int >(result)); argvi++ ;
28070 
28071 
28072 
28073 
28074 
28075 
28076 
28077 
28078     {
28079       /* %typemap(freearg) char **options */
28080       if (arg9) CSLDestroy( arg9 );
28081     }
28082     XSRETURN(argvi);
28083   fail:
28084 
28085 
28086 
28087 
28088 
28089 
28090 
28091 
28092     {
28093       /* %typemap(freearg) char **options */
28094       if (arg9) CSLDestroy( arg9 );
28095     }
28096     SWIG_croak_null();
28097   }
28098 }
28099 
28100 
XS(_wrap_Band_AsMDArray)28101 XS(_wrap_Band_AsMDArray) {
28102   {
28103     GDALRasterBandShadow *arg1 = (GDALRasterBandShadow *) 0 ;
28104     void *argp1 = 0 ;
28105     int res1 = 0 ;
28106     int argvi = 0;
28107     GDALMDArrayHS *result = 0 ;
28108     dXSARGS;
28109 
28110     if ((items < 1) || (items > 1)) {
28111       SWIG_croak("Usage: Band_AsMDArray(self);");
28112     }
28113     res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_GDALRasterBandShadow, 0 |  0 );
28114     if (!SWIG_IsOK(res1)) {
28115       SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Band_AsMDArray" "', argument " "1"" of type '" "GDALRasterBandShadow *""'");
28116     }
28117     arg1 = reinterpret_cast< GDALRasterBandShadow * >(argp1);
28118     {
28119       CPLErrorReset();
28120       result = (GDALMDArrayHS *)GDALRasterBandShadow_AsMDArray(arg1);
28121       CPLErr eclass = CPLGetLastErrorType();
28122       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
28123         do_confess( CPLGetLastErrorMsg(), 0 );
28124 
28125 
28126 
28127 
28128 
28129       }
28130 
28131 
28132       /*
28133           Make warnings regular Perl warnings. This duplicates the warning
28134           message if DontUseExceptions() is in effect (it is not by default).
28135           */
28136       if ( eclass == CE_Warning ) {
28137         warn( CPLGetLastErrorMsg(), "%s" );
28138       }
28139 
28140 
28141     }
28142     ST(argvi) = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GDALMDArrayHS, SWIG_OWNER | SWIG_SHADOW); argvi++ ;
28143 
28144     XSRETURN(argvi);
28145   fail:
28146 
28147     SWIG_croak_null();
28148   }
28149 }
28150 
28151 
XS(_wrap_Band_ContourGenerate)28152 XS(_wrap_Band_ContourGenerate) {
28153   {
28154     GDALRasterBandShadow *arg1 = (GDALRasterBandShadow *) 0 ;
28155     double arg2 ;
28156     double arg3 ;
28157     int arg4 ;
28158     double *arg5 = (double *) 0 ;
28159     int arg6 ;
28160     double arg7 ;
28161     OGRLayerShadow *arg8 = (OGRLayerShadow *) 0 ;
28162     int arg9 ;
28163     int arg10 ;
28164     GDALProgressFunc arg11 = (GDALProgressFunc) NULL ;
28165     void *arg12 = (void *) NULL ;
28166     void *argp1 = 0 ;
28167     int res1 = 0 ;
28168     double val2 ;
28169     int ecode2 = 0 ;
28170     double val3 ;
28171     int ecode3 = 0 ;
28172     void *argp8 = 0 ;
28173     int res8 = 0 ;
28174     int val9 ;
28175     int ecode9 = 0 ;
28176     int val10 ;
28177     int ecode10 = 0 ;
28178     void *argp11 ;
28179     int res11 = 0 ;
28180     int res12 ;
28181     int argvi = 0;
28182     CPLErr result;
28183     dXSARGS;
28184 
28185     if ((items < 8) || (items > 10)) {
28186       SWIG_croak("Usage: Band_ContourGenerate(self,dfContourInterval,dfContourBase,nFixedLevelCount,padfFixedLevels,bUseNoData,dfNoDataValue,hLayer,iIDField,iElevField,progress,progress_data);");
28187     }
28188     res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_GDALRasterBandShadow, 0 |  0 );
28189     if (!SWIG_IsOK(res1)) {
28190       SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Band_ContourGenerate" "', argument " "1"" of type '" "GDALRasterBandShadow *""'");
28191     }
28192     arg1 = reinterpret_cast< GDALRasterBandShadow * >(argp1);
28193     ecode2 = SWIG_AsVal_double SWIG_PERL_CALL_ARGS_2(ST(1), &val2);
28194     if (!SWIG_IsOK(ecode2)) {
28195       SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Band_ContourGenerate" "', argument " "2"" of type '" "double""'");
28196     }
28197     arg2 = static_cast< double >(val2);
28198     ecode3 = SWIG_AsVal_double SWIG_PERL_CALL_ARGS_2(ST(2), &val3);
28199     if (!SWIG_IsOK(ecode3)) {
28200       SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "Band_ContourGenerate" "', argument " "3"" of type '" "double""'");
28201     }
28202     arg3 = static_cast< double >(val3);
28203     {
28204       /* %typemap(in,numinputs=1) (int nList, double* pList) */
28205       if (!(SvROK(ST(3)) && (SvTYPE(SvRV(ST(3)))==SVt_PVAV)))
28206       do_confess(NEED_ARRAY_REF, 1);
28207       AV *av = (AV*)(SvRV(ST(3)));
28208       arg4 = av_len(av)+1;
28209       arg5 = (double*)CPLMalloc(arg4*sizeof(double));
28210       if (arg5) {
28211         for( int i = 0; i<arg4; i++ ) {
28212           SV **sv = av_fetch(av, i, 0);
28213           arg5[i] =  SvNV(*sv);
28214         }
28215       } else
28216       SWIG_fail;
28217     }
28218     {
28219       /* %typemap(in,numinputs=1) (int defined, double value) */
28220       arg6 = SvOK(ST(4));
28221       arg7 = SvNV(ST(4));
28222     }
28223     res8 = SWIG_ConvertPtr(ST(5), &argp8,SWIGTYPE_p_OGRLayerShadow, 0 |  0 );
28224     if (!SWIG_IsOK(res8)) {
28225       SWIG_exception_fail(SWIG_ArgError(res8), "in method '" "Band_ContourGenerate" "', argument " "8"" of type '" "OGRLayerShadow *""'");
28226     }
28227     arg8 = reinterpret_cast< OGRLayerShadow * >(argp8);
28228     ecode9 = SWIG_AsVal_int SWIG_PERL_CALL_ARGS_2(ST(6), &val9);
28229     if (!SWIG_IsOK(ecode9)) {
28230       SWIG_exception_fail(SWIG_ArgError(ecode9), "in method '" "Band_ContourGenerate" "', argument " "9"" of type '" "int""'");
28231     }
28232     arg9 = static_cast< int >(val9);
28233     ecode10 = SWIG_AsVal_int SWIG_PERL_CALL_ARGS_2(ST(7), &val10);
28234     if (!SWIG_IsOK(ecode10)) {
28235       SWIG_exception_fail(SWIG_ArgError(ecode10), "in method '" "Band_ContourGenerate" "', argument " "10"" of type '" "int""'");
28236     }
28237     arg10 = static_cast< int >(val10);
28238     if (items > 8) {
28239       {
28240         res11 = SWIG_ConvertPtr(ST(8), &argp11, SWIGTYPE_p_GDALProgressFunc,  0 );
28241         if (!SWIG_IsOK(res11)) {
28242           SWIG_exception_fail(SWIG_ArgError(res11), "in method '" "Band_ContourGenerate" "', argument " "11"" of type '" "GDALProgressFunc""'");
28243         }
28244         if (!argp11) {
28245           SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "Band_ContourGenerate" "', argument " "11"" of type '" "GDALProgressFunc""'");
28246         } else {
28247           arg11 = *(reinterpret_cast< GDALProgressFunc * >(argp11));
28248         }
28249       }
28250     }
28251     if (items > 9) {
28252       res12 = SWIG_ConvertPtr(ST(9),SWIG_as_voidptrptr(&arg12), 0, 0);
28253       if (!SWIG_IsOK(res12)) {
28254         SWIG_exception_fail(SWIG_ArgError(res12), "in method '" "Band_ContourGenerate" "', argument " "12"" of type '" "void *""'");
28255       }
28256     }
28257     {
28258       CPLErrorReset();
28259       result = (CPLErr)GDALRasterBandShadow_ContourGenerate(arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9,arg10,arg11,arg12);
28260       CPLErr eclass = CPLGetLastErrorType();
28261       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
28262         do_confess( CPLGetLastErrorMsg(), 0 );
28263 
28264 
28265 
28266 
28267 
28268       }
28269 
28270 
28271       /*
28272           Make warnings regular Perl warnings. This duplicates the warning
28273           message if DontUseExceptions() is in effect (it is not by default).
28274           */
28275       if ( eclass == CE_Warning ) {
28276         warn( CPLGetLastErrorMsg(), "%s" );
28277       }
28278 
28279 
28280     }
28281     ST(argvi) = SWIG_From_int  SWIG_PERL_CALL_ARGS_1(static_cast< int >(result)); argvi++ ;
28282 
28283 
28284 
28285     {
28286       /* %typemap(freearg) (int nList, double* pList) */
28287       CPLFree((void*) arg5);
28288     }
28289 
28290 
28291 
28292 
28293     XSRETURN(argvi);
28294   fail:
28295 
28296 
28297 
28298     {
28299       /* %typemap(freearg) (int nList, double* pList) */
28300       CPLFree((void*) arg5);
28301     }
28302 
28303 
28304 
28305 
28306     SWIG_croak_null();
28307   }
28308 }
28309 
28310 
XS(_wrap_Band_ClassCounts__SWIG_0)28311 XS(_wrap_Band_ClassCounts__SWIG_0) {
28312   {
28313     GDALRasterBandShadow *arg1 = (GDALRasterBandShadow *) 0 ;
28314     GDALProgressFunc arg2 = (GDALProgressFunc) NULL ;
28315     void *arg3 = (void *) NULL ;
28316     void *argp1 = 0 ;
28317     int res1 = 0 ;
28318     int argvi = 0;
28319     SV *result = 0 ;
28320     dXSARGS;
28321 
28322     /* %typemap(arginit, noblock=1) ( void* callback_data = NULL) */
28323     SavedEnv saved_env;
28324     saved_env.fct = NULL;
28325     saved_env.data = &PL_sv_undef;
28326     arg3 = (void *)(&saved_env);
28327     if ((items < 1) || (items > 3)) {
28328       SWIG_croak("Usage: Band_ClassCounts(self,callback,callback_data);");
28329     }
28330     res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_GDALRasterBandShadow, 0 |  0 );
28331     if (!SWIG_IsOK(res1)) {
28332       SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Band_ClassCounts" "', argument " "1"" of type '" "GDALRasterBandShadow *""'");
28333     }
28334     arg1 = reinterpret_cast< GDALRasterBandShadow * >(argp1);
28335     if (items > 1) {
28336       {
28337         /* %typemap(in) (GDALProgressFunc callback = NULL) */
28338         if (SvOK(ST(1))) {
28339           if (SvROK(ST(1))) {
28340             if (SvTYPE(SvRV(ST(1))) != SVt_PVCV) {
28341               do_confess(NEED_CODE_REF, 1);
28342             } else {
28343               saved_env.fct = (SV *)ST(1);
28344               arg2 = &callback_d_cp_vp;
28345             }
28346           } else {
28347             do_confess(NEED_CODE_REF, 1);
28348           }
28349         }
28350       }
28351     }
28352     if (items > 2) {
28353       {
28354         /* %typemap(in) (void* callback_data=NULL) */
28355         if (SvOK(ST(2)))
28356         saved_env.data = (SV *)ST(2);
28357       }
28358     }
28359     {
28360       CPLErrorReset();
28361       result = (SV *)GDALRasterBandShadow_ClassCounts__SWIG_0(arg1,arg2,arg3);
28362       CPLErr eclass = CPLGetLastErrorType();
28363       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
28364         do_confess( CPLGetLastErrorMsg(), 0 );
28365 
28366 
28367 
28368 
28369 
28370       }
28371 
28372 
28373       /*
28374           Make warnings regular Perl warnings. This duplicates the warning
28375           message if DontUseExceptions() is in effect (it is not by default).
28376           */
28377       if ( eclass == CE_Warning ) {
28378         warn( CPLGetLastErrorMsg(), "%s" );
28379       }
28380 
28381 
28382     }
28383     ST(argvi) = result; argvi++ ;
28384 
28385 
28386     XSRETURN(argvi);
28387   fail:
28388 
28389 
28390     SWIG_croak_null();
28391   }
28392 }
28393 
28394 
XS(_wrap_Band_ClassCounts__SWIG_1)28395 XS(_wrap_Band_ClassCounts__SWIG_1) {
28396   {
28397     GDALRasterBandShadow *arg1 = (GDALRasterBandShadow *) 0 ;
28398     SV *arg2 = (SV *) 0 ;
28399     GDALProgressFunc arg3 = (GDALProgressFunc) NULL ;
28400     void *arg4 = (void *) NULL ;
28401     void *argp1 = 0 ;
28402     int res1 = 0 ;
28403     int argvi = 0;
28404     SV *result = 0 ;
28405     dXSARGS;
28406 
28407     /* %typemap(arginit, noblock=1) ( void* callback_data = NULL) */
28408     SavedEnv saved_env;
28409     saved_env.fct = NULL;
28410     saved_env.data = &PL_sv_undef;
28411     arg4 = (void *)(&saved_env);
28412     if ((items < 2) || (items > 4)) {
28413       SWIG_croak("Usage: Band_ClassCounts(self,classifier,callback,callback_data);");
28414     }
28415     res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_GDALRasterBandShadow, 0 |  0 );
28416     if (!SWIG_IsOK(res1)) {
28417       SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Band_ClassCounts" "', argument " "1"" of type '" "GDALRasterBandShadow *""'");
28418     }
28419     arg1 = reinterpret_cast< GDALRasterBandShadow * >(argp1);
28420     arg2 = ST(1);
28421     if (items > 2) {
28422       {
28423         /* %typemap(in) (GDALProgressFunc callback = NULL) */
28424         if (SvOK(ST(2))) {
28425           if (SvROK(ST(2))) {
28426             if (SvTYPE(SvRV(ST(2))) != SVt_PVCV) {
28427               do_confess(NEED_CODE_REF, 1);
28428             } else {
28429               saved_env.fct = (SV *)ST(2);
28430               arg3 = &callback_d_cp_vp;
28431             }
28432           } else {
28433             do_confess(NEED_CODE_REF, 1);
28434           }
28435         }
28436       }
28437     }
28438     if (items > 3) {
28439       {
28440         /* %typemap(in) (void* callback_data=NULL) */
28441         if (SvOK(ST(3)))
28442         saved_env.data = (SV *)ST(3);
28443       }
28444     }
28445     {
28446       CPLErrorReset();
28447       result = (SV *)GDALRasterBandShadow_ClassCounts__SWIG_1(arg1,arg2,arg3,arg4);
28448       CPLErr eclass = CPLGetLastErrorType();
28449       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
28450         do_confess( CPLGetLastErrorMsg(), 0 );
28451 
28452 
28453 
28454 
28455 
28456       }
28457 
28458 
28459       /*
28460           Make warnings regular Perl warnings. This duplicates the warning
28461           message if DontUseExceptions() is in effect (it is not by default).
28462           */
28463       if ( eclass == CE_Warning ) {
28464         warn( CPLGetLastErrorMsg(), "%s" );
28465       }
28466 
28467 
28468     }
28469     ST(argvi) = result; argvi++ ;
28470 
28471 
28472 
28473     XSRETURN(argvi);
28474   fail:
28475 
28476 
28477 
28478     SWIG_croak_null();
28479   }
28480 }
28481 
28482 
XS(_wrap_Band_ClassCounts)28483 XS(_wrap_Band_ClassCounts) {
28484   dXSARGS;
28485 
28486   {
28487     unsigned long _index = 0;
28488     SWIG_TypeRank _rank = 0;
28489     if ((items >= 1) && (items <= 3)) {
28490       SWIG_TypeRank _ranki = 0;
28491       SWIG_TypeRank _rankm = 0;
28492       SWIG_TypeRank _pi = 1;
28493       int _v = 0;
28494       {
28495         void *vptr = 0;
28496         int res = SWIG_ConvertPtr(ST(0), &vptr, SWIGTYPE_p_GDALRasterBandShadow, 0);
28497         _v = SWIG_CheckState(res);
28498       }
28499       if (!_v) goto check_1;
28500       _ranki += _v*_pi;
28501       _rankm += _pi;
28502       _pi *= SWIG_MAXCASTRANK;
28503       if (items > 1) {
28504         {
28505           {
28506             /* %typemap(typecheck, precedence=SWIG_TYPECHECK_INTEGER) GDALProgressFunc callback */
28507             _v = SvOK(ST(1)) && SvROK(ST(1)) && SvTYPE(SvRV(ST(1))) == SVt_PVCV;
28508           }
28509         }
28510         if (!_v) goto check_1;
28511         _ranki += _v*_pi;
28512         _rankm += _pi;
28513         _pi *= SWIG_MAXCASTRANK;
28514         if (items > 2) {
28515           {
28516             void *ptr = 0;
28517             int res = SWIG_ConvertPtr(ST(2), &ptr, 0, 0);
28518             _v = SWIG_CheckState(res);
28519           }
28520           if (!_v) goto check_1;
28521           _ranki += _v*_pi;
28522           _rankm += _pi;
28523           _pi *= SWIG_MAXCASTRANK;
28524         }
28525       }
28526       if (!_index || (_ranki < _rank)) {
28527         _rank = _ranki; _index = 1;
28528         if (_rank == _rankm) goto dispatch;
28529       }
28530     }
28531   check_1:
28532 
28533     if ((items >= 2) && (items <= 4)) {
28534       SWIG_TypeRank _ranki = 0;
28535       SWIG_TypeRank _rankm = 0;
28536       SWIG_TypeRank _pi = 1;
28537       int _v = 0;
28538       {
28539         void *vptr = 0;
28540         int res = SWIG_ConvertPtr(ST(0), &vptr, SWIGTYPE_p_GDALRasterBandShadow, 0);
28541         _v = SWIG_CheckState(res);
28542       }
28543       if (!_v) goto check_2;
28544       _ranki += _v*_pi;
28545       _rankm += _pi;
28546       _pi *= SWIG_MAXCASTRANK;
28547       {
28548         _v = (ST(1) != 0);
28549       }
28550       if (!_v) goto check_2;
28551       _ranki += _v*_pi;
28552       _rankm += _pi;
28553       _pi *= SWIG_MAXCASTRANK;
28554       if (items > 2) {
28555         {
28556           {
28557             /* %typemap(typecheck, precedence=SWIG_TYPECHECK_INTEGER) GDALProgressFunc callback */
28558             _v = SvOK(ST(2)) && SvROK(ST(2)) && SvTYPE(SvRV(ST(2))) == SVt_PVCV;
28559           }
28560         }
28561         if (!_v) goto check_2;
28562         _ranki += _v*_pi;
28563         _rankm += _pi;
28564         _pi *= SWIG_MAXCASTRANK;
28565         if (items > 3) {
28566           {
28567             void *ptr = 0;
28568             int res = SWIG_ConvertPtr(ST(3), &ptr, 0, 0);
28569             _v = SWIG_CheckState(res);
28570           }
28571           if (!_v) goto check_2;
28572           _ranki += _v*_pi;
28573           _rankm += _pi;
28574           _pi *= SWIG_MAXCASTRANK;
28575         }
28576       }
28577       if (!_index || (_ranki < _rank)) {
28578         _rank = _ranki; _index = 2;
28579         if (_rank == _rankm) goto dispatch;
28580       }
28581     }
28582   check_2:
28583 
28584   dispatch:
28585     switch(_index) {
28586     case 1:
28587       PUSHMARK(MARK); SWIG_CALLXS(_wrap_Band_ClassCounts__SWIG_0); return;
28588     case 2:
28589       PUSHMARK(MARK); SWIG_CALLXS(_wrap_Band_ClassCounts__SWIG_1); return;
28590     }
28591   }
28592 
28593   croak("No matching function for overloaded 'Band_ClassCounts'");
28594   XSRETURN(0);
28595 }
28596 
28597 
XS(_wrap_Band_Reclassify)28598 XS(_wrap_Band_Reclassify) {
28599   {
28600     GDALRasterBandShadow *arg1 = (GDALRasterBandShadow *) 0 ;
28601     SV *arg2 = (SV *) 0 ;
28602     GDALProgressFunc arg3 = (GDALProgressFunc) NULL ;
28603     void *arg4 = (void *) NULL ;
28604     void *argp1 = 0 ;
28605     int res1 = 0 ;
28606     int argvi = 0;
28607     dXSARGS;
28608 
28609     /* %typemap(arginit, noblock=1) ( void* callback_data = NULL) */
28610     SavedEnv saved_env;
28611     saved_env.fct = NULL;
28612     saved_env.data = &PL_sv_undef;
28613     arg4 = (void *)(&saved_env);
28614     if ((items < 2) || (items > 4)) {
28615       SWIG_croak("Usage: Band_Reclassify(self,classifier,callback,callback_data);");
28616     }
28617     res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_GDALRasterBandShadow, 0 |  0 );
28618     if (!SWIG_IsOK(res1)) {
28619       SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Band_Reclassify" "', argument " "1"" of type '" "GDALRasterBandShadow *""'");
28620     }
28621     arg1 = reinterpret_cast< GDALRasterBandShadow * >(argp1);
28622     arg2 = ST(1);
28623     if (items > 2) {
28624       {
28625         /* %typemap(in) (GDALProgressFunc callback = NULL) */
28626         if (SvOK(ST(2))) {
28627           if (SvROK(ST(2))) {
28628             if (SvTYPE(SvRV(ST(2))) != SVt_PVCV) {
28629               do_confess(NEED_CODE_REF, 1);
28630             } else {
28631               saved_env.fct = (SV *)ST(2);
28632               arg3 = &callback_d_cp_vp;
28633             }
28634           } else {
28635             do_confess(NEED_CODE_REF, 1);
28636           }
28637         }
28638       }
28639     }
28640     if (items > 3) {
28641       {
28642         /* %typemap(in) (void* callback_data=NULL) */
28643         if (SvOK(ST(3)))
28644         saved_env.data = (SV *)ST(3);
28645       }
28646     }
28647     {
28648       CPLErrorReset();
28649       GDALRasterBandShadow_Reclassify(arg1,arg2,arg3,arg4);
28650       CPLErr eclass = CPLGetLastErrorType();
28651       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
28652         do_confess( CPLGetLastErrorMsg(), 0 );
28653 
28654 
28655 
28656 
28657 
28658       }
28659 
28660 
28661       /*
28662           Make warnings regular Perl warnings. This duplicates the warning
28663           message if DontUseExceptions() is in effect (it is not by default).
28664           */
28665       if ( eclass == CE_Warning ) {
28666         warn( CPLGetLastErrorMsg(), "%s" );
28667       }
28668 
28669 
28670     }
28671     {
28672       /* %typemap(out) void */
28673     }
28674 
28675 
28676 
28677     XSRETURN(argvi);
28678   fail:
28679 
28680 
28681 
28682     SWIG_croak_null();
28683   }
28684 }
28685 
28686 
XS(_wrap_new_ColorTable)28687 XS(_wrap_new_ColorTable) {
28688   {
28689     GDALPaletteInterp arg1 = (GDALPaletteInterp) GPI_RGB ;
28690     int val1 ;
28691     int ecode1 = 0 ;
28692     int argvi = 0;
28693     GDALColorTableShadow *result = 0 ;
28694     dXSARGS;
28695 
28696     if ((items < 0) || (items > 1)) {
28697       SWIG_croak("Usage: new_ColorTable(palette);");
28698     }
28699     if (items > 0) {
28700       ecode1 = SWIG_AsVal_int SWIG_PERL_CALL_ARGS_2(ST(0), &val1);
28701       if (!SWIG_IsOK(ecode1)) {
28702         SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "new_ColorTable" "', argument " "1"" of type '" "GDALPaletteInterp""'");
28703       }
28704       arg1 = static_cast< GDALPaletteInterp >(val1);
28705     }
28706     {
28707       CPLErrorReset();
28708       result = (GDALColorTableShadow *)new_GDALColorTableShadow(arg1);
28709       CPLErr eclass = CPLGetLastErrorType();
28710       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
28711         do_confess( CPLGetLastErrorMsg(), 0 );
28712 
28713 
28714 
28715 
28716 
28717       }
28718 
28719 
28720       /*
28721           Make warnings regular Perl warnings. This duplicates the warning
28722           message if DontUseExceptions() is in effect (it is not by default).
28723           */
28724       if ( eclass == CE_Warning ) {
28725         warn( CPLGetLastErrorMsg(), "%s" );
28726       }
28727 
28728 
28729     }
28730     ST(argvi) = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GDALColorTableShadow, SWIG_OWNER | SWIG_SHADOW); argvi++ ;
28731 
28732     XSRETURN(argvi);
28733   fail:
28734 
28735     SWIG_croak_null();
28736   }
28737 }
28738 
28739 
XS(_wrap_delete_ColorTable)28740 XS(_wrap_delete_ColorTable) {
28741   {
28742     GDALColorTableShadow *arg1 = (GDALColorTableShadow *) 0 ;
28743     void *argp1 = 0 ;
28744     int res1 = 0 ;
28745     int argvi = 0;
28746     dXSARGS;
28747 
28748     if ((items < 1) || (items > 1)) {
28749       SWIG_croak("Usage: delete_ColorTable(self);");
28750     }
28751     res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_GDALColorTableShadow, SWIG_POINTER_DISOWN |  0 );
28752     if (!SWIG_IsOK(res1)) {
28753       SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_ColorTable" "', argument " "1"" of type '" "GDALColorTableShadow *""'");
28754     }
28755     arg1 = reinterpret_cast< GDALColorTableShadow * >(argp1);
28756     {
28757       CPLErrorReset();
28758       delete_GDALColorTableShadow(arg1);
28759       CPLErr eclass = CPLGetLastErrorType();
28760       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
28761         do_confess( CPLGetLastErrorMsg(), 0 );
28762 
28763 
28764 
28765 
28766 
28767       }
28768 
28769 
28770       /*
28771           Make warnings regular Perl warnings. This duplicates the warning
28772           message if DontUseExceptions() is in effect (it is not by default).
28773           */
28774       if ( eclass == CE_Warning ) {
28775         warn( CPLGetLastErrorMsg(), "%s" );
28776       }
28777 
28778 
28779     }
28780     {
28781       /* %typemap(out) void */
28782     }
28783 
28784     XSRETURN(argvi);
28785   fail:
28786 
28787     SWIG_croak_null();
28788   }
28789 }
28790 
28791 
XS(_wrap_ColorTable_Clone)28792 XS(_wrap_ColorTable_Clone) {
28793   {
28794     GDALColorTableShadow *arg1 = (GDALColorTableShadow *) 0 ;
28795     void *argp1 = 0 ;
28796     int res1 = 0 ;
28797     int argvi = 0;
28798     GDALColorTableShadow *result = 0 ;
28799     dXSARGS;
28800 
28801     if ((items < 1) || (items > 1)) {
28802       SWIG_croak("Usage: ColorTable_Clone(self);");
28803     }
28804     res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_GDALColorTableShadow, 0 |  0 );
28805     if (!SWIG_IsOK(res1)) {
28806       SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ColorTable_Clone" "', argument " "1"" of type '" "GDALColorTableShadow *""'");
28807     }
28808     arg1 = reinterpret_cast< GDALColorTableShadow * >(argp1);
28809     {
28810       CPLErrorReset();
28811       result = (GDALColorTableShadow *)GDALColorTableShadow_Clone(arg1);
28812       CPLErr eclass = CPLGetLastErrorType();
28813       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
28814         do_confess( CPLGetLastErrorMsg(), 0 );
28815 
28816 
28817 
28818 
28819 
28820       }
28821 
28822 
28823       /*
28824           Make warnings regular Perl warnings. This duplicates the warning
28825           message if DontUseExceptions() is in effect (it is not by default).
28826           */
28827       if ( eclass == CE_Warning ) {
28828         warn( CPLGetLastErrorMsg(), "%s" );
28829       }
28830 
28831 
28832     }
28833     ST(argvi) = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GDALColorTableShadow, SWIG_OWNER | SWIG_SHADOW); argvi++ ;
28834 
28835     XSRETURN(argvi);
28836   fail:
28837 
28838     SWIG_croak_null();
28839   }
28840 }
28841 
28842 
XS(_wrap_ColorTable__GetPaletteInterpretation)28843 XS(_wrap_ColorTable__GetPaletteInterpretation) {
28844   {
28845     GDALColorTableShadow *arg1 = (GDALColorTableShadow *) 0 ;
28846     void *argp1 = 0 ;
28847     int res1 = 0 ;
28848     int argvi = 0;
28849     GDALPaletteInterp result;
28850     dXSARGS;
28851 
28852     if ((items < 1) || (items > 1)) {
28853       SWIG_croak("Usage: ColorTable__GetPaletteInterpretation(self);");
28854     }
28855     res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_GDALColorTableShadow, 0 |  0 );
28856     if (!SWIG_IsOK(res1)) {
28857       SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ColorTable__GetPaletteInterpretation" "', argument " "1"" of type '" "GDALColorTableShadow *""'");
28858     }
28859     arg1 = reinterpret_cast< GDALColorTableShadow * >(argp1);
28860     {
28861       CPLErrorReset();
28862       result = (GDALPaletteInterp)GDALColorTableShadow_GetPaletteInterpretation(arg1);
28863       CPLErr eclass = CPLGetLastErrorType();
28864       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
28865         do_confess( CPLGetLastErrorMsg(), 0 );
28866 
28867 
28868 
28869 
28870 
28871       }
28872 
28873 
28874       /*
28875           Make warnings regular Perl warnings. This duplicates the warning
28876           message if DontUseExceptions() is in effect (it is not by default).
28877           */
28878       if ( eclass == CE_Warning ) {
28879         warn( CPLGetLastErrorMsg(), "%s" );
28880       }
28881 
28882 
28883     }
28884     ST(argvi) = SWIG_From_int  SWIG_PERL_CALL_ARGS_1(static_cast< int >(result)); argvi++ ;
28885 
28886     XSRETURN(argvi);
28887   fail:
28888 
28889     SWIG_croak_null();
28890   }
28891 }
28892 
28893 
XS(_wrap_ColorTable_GetCount)28894 XS(_wrap_ColorTable_GetCount) {
28895   {
28896     GDALColorTableShadow *arg1 = (GDALColorTableShadow *) 0 ;
28897     void *argp1 = 0 ;
28898     int res1 = 0 ;
28899     int argvi = 0;
28900     int result;
28901     dXSARGS;
28902 
28903     if ((items < 1) || (items > 1)) {
28904       SWIG_croak("Usage: ColorTable_GetCount(self);");
28905     }
28906     res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_GDALColorTableShadow, 0 |  0 );
28907     if (!SWIG_IsOK(res1)) {
28908       SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ColorTable_GetCount" "', argument " "1"" of type '" "GDALColorTableShadow *""'");
28909     }
28910     arg1 = reinterpret_cast< GDALColorTableShadow * >(argp1);
28911     {
28912       CPLErrorReset();
28913       result = (int)GDALColorTableShadow_GetColorEntryCount(arg1);
28914       CPLErr eclass = CPLGetLastErrorType();
28915       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
28916         do_confess( CPLGetLastErrorMsg(), 0 );
28917 
28918 
28919 
28920 
28921 
28922       }
28923 
28924 
28925       /*
28926           Make warnings regular Perl warnings. This duplicates the warning
28927           message if DontUseExceptions() is in effect (it is not by default).
28928           */
28929       if ( eclass == CE_Warning ) {
28930         warn( CPLGetLastErrorMsg(), "%s" );
28931       }
28932 
28933 
28934     }
28935     ST(argvi) = SWIG_From_int  SWIG_PERL_CALL_ARGS_1(static_cast< int >(result)); argvi++ ;
28936 
28937     XSRETURN(argvi);
28938   fail:
28939 
28940     SWIG_croak_null();
28941   }
28942 }
28943 
28944 
XS(_wrap_ColorTable_GetColorEntry)28945 XS(_wrap_ColorTable_GetColorEntry) {
28946   {
28947     GDALColorTableShadow *arg1 = (GDALColorTableShadow *) 0 ;
28948     int arg2 ;
28949     void *argp1 = 0 ;
28950     int res1 = 0 ;
28951     int val2 ;
28952     int ecode2 = 0 ;
28953     int argvi = 0;
28954     GDALColorEntry *result = 0 ;
28955     dXSARGS;
28956 
28957     if ((items < 2) || (items > 2)) {
28958       SWIG_croak("Usage: ColorTable_GetColorEntry(self,entry);");
28959     }
28960     res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_GDALColorTableShadow, 0 |  0 );
28961     if (!SWIG_IsOK(res1)) {
28962       SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ColorTable_GetColorEntry" "', argument " "1"" of type '" "GDALColorTableShadow *""'");
28963     }
28964     arg1 = reinterpret_cast< GDALColorTableShadow * >(argp1);
28965     ecode2 = SWIG_AsVal_int SWIG_PERL_CALL_ARGS_2(ST(1), &val2);
28966     if (!SWIG_IsOK(ecode2)) {
28967       SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "ColorTable_GetColorEntry" "', argument " "2"" of type '" "int""'");
28968     }
28969     arg2 = static_cast< int >(val2);
28970     {
28971       CPLErrorReset();
28972       result = (GDALColorEntry *)GDALColorTableShadow_GetColorEntry(arg1,arg2);
28973       CPLErr eclass = CPLGetLastErrorType();
28974       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
28975         do_confess( CPLGetLastErrorMsg(), 0 );
28976 
28977 
28978 
28979 
28980 
28981       }
28982 
28983 
28984       /*
28985           Make warnings regular Perl warnings. This duplicates the warning
28986           message if DontUseExceptions() is in effect (it is not by default).
28987           */
28988       if ( eclass == CE_Warning ) {
28989         warn( CPLGetLastErrorMsg(), "%s" );
28990       }
28991 
28992 
28993     }
28994     {
28995       /* %typemap(out) GDALColorEntry* */
28996       if (!result)
28997       do_confess(CALL_FAILED, 1);
28998       ST(argvi) = sv_newmortal();
28999       sv_setiv(ST(argvi++), (IV) result->c1);
29000       ST(argvi) = sv_newmortal();
29001       sv_setiv(ST(argvi++), (IV) result->c2);
29002       ST(argvi) = sv_newmortal();
29003       sv_setiv(ST(argvi++), (IV) result->c3);
29004       ST(argvi) = sv_newmortal();
29005       sv_setiv(ST(argvi++), (IV) result->c4);
29006     }
29007 
29008 
29009     XSRETURN(argvi);
29010   fail:
29011 
29012 
29013     SWIG_croak_null();
29014   }
29015 }
29016 
29017 
XS(_wrap_ColorTable_GetColorEntryAsRGB)29018 XS(_wrap_ColorTable_GetColorEntryAsRGB) {
29019   {
29020     GDALColorTableShadow *arg1 = (GDALColorTableShadow *) 0 ;
29021     int arg2 ;
29022     GDALColorEntry *arg3 = (GDALColorEntry *) 0 ;
29023     void *argp1 = 0 ;
29024     int res1 = 0 ;
29025     int val2 ;
29026     int ecode2 = 0 ;
29027     GDALColorEntry e3 ;
29028     int argvi = 0;
29029     int result;
29030     dXSARGS;
29031 
29032     {
29033       /* %typemap(in,numinputs=0) GDALColorEntry*(GDALColorEntry e3) */
29034       arg3 = &e3;
29035     }
29036     if ((items < 2) || (items > 2)) {
29037       SWIG_croak("Usage: ColorTable_GetColorEntryAsRGB(self,entry);");
29038     }
29039     res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_GDALColorTableShadow, 0 |  0 );
29040     if (!SWIG_IsOK(res1)) {
29041       SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ColorTable_GetColorEntryAsRGB" "', argument " "1"" of type '" "GDALColorTableShadow *""'");
29042     }
29043     arg1 = reinterpret_cast< GDALColorTableShadow * >(argp1);
29044     ecode2 = SWIG_AsVal_int SWIG_PERL_CALL_ARGS_2(ST(1), &val2);
29045     if (!SWIG_IsOK(ecode2)) {
29046       SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "ColorTable_GetColorEntryAsRGB" "', argument " "2"" of type '" "int""'");
29047     }
29048     arg2 = static_cast< int >(val2);
29049     {
29050       CPLErrorReset();
29051       result = (int)GDALColorTableShadow_GetColorEntryAsRGB(arg1,arg2,arg3);
29052       CPLErr eclass = CPLGetLastErrorType();
29053       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
29054         do_confess( CPLGetLastErrorMsg(), 0 );
29055 
29056 
29057 
29058 
29059 
29060       }
29061 
29062 
29063       /*
29064           Make warnings regular Perl warnings. This duplicates the warning
29065           message if DontUseExceptions() is in effect (it is not by default).
29066           */
29067       if ( eclass == CE_Warning ) {
29068         warn( CPLGetLastErrorMsg(), "%s" );
29069       }
29070 
29071 
29072     }
29073     ST(argvi) = SWIG_From_int  SWIG_PERL_CALL_ARGS_1(static_cast< int >(result)); argvi++ ;
29074     {
29075       /* %typemap(argout) GDALColorEntry* */
29076       if (!result)
29077       do_confess(CALL_FAILED, 1);
29078       argvi--;
29079       ST(argvi) = sv_newmortal();
29080       sv_setiv(ST(argvi++), (IV) e3.c1);
29081       ST(argvi) = sv_newmortal();
29082       sv_setiv(ST(argvi++), (IV) e3.c2);
29083       ST(argvi) = sv_newmortal();
29084       sv_setiv(ST(argvi++), (IV) e3.c3);
29085       ST(argvi) = sv_newmortal();
29086       sv_setiv(ST(argvi++), (IV) e3.c4);
29087     }
29088 
29089 
29090 
29091     XSRETURN(argvi);
29092   fail:
29093 
29094 
29095 
29096     SWIG_croak_null();
29097   }
29098 }
29099 
29100 
XS(_wrap_ColorTable__SetColorEntry)29101 XS(_wrap_ColorTable__SetColorEntry) {
29102   {
29103     GDALColorTableShadow *arg1 = (GDALColorTableShadow *) 0 ;
29104     int arg2 ;
29105     GDALColorEntry *arg3 = (GDALColorEntry *) 0 ;
29106     void *argp1 = 0 ;
29107     int res1 = 0 ;
29108     int val2 ;
29109     int ecode2 = 0 ;
29110     GDALColorEntry e3 ;
29111     int argvi = 0;
29112     SV * _saved[1] ;
29113     dXSARGS;
29114 
29115     if ((items < 3) || (items > 3)) {
29116       SWIG_croak("Usage: ColorTable__SetColorEntry(self,entry,centry);");
29117     }
29118     res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_GDALColorTableShadow, 0 |  0 );
29119     if (!SWIG_IsOK(res1)) {
29120       SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ColorTable__SetColorEntry" "', argument " "1"" of type '" "GDALColorTableShadow *""'");
29121     }
29122     arg1 = reinterpret_cast< GDALColorTableShadow * >(argp1);
29123     ecode2 = SWIG_AsVal_int SWIG_PERL_CALL_ARGS_2(ST(1), &val2);
29124     if (!SWIG_IsOK(ecode2)) {
29125       SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "ColorTable__SetColorEntry" "', argument " "2"" of type '" "int""'");
29126     }
29127     arg2 = static_cast< int >(val2);
29128     {
29129       /* %typemap(in,numinputs=1) const GDALColorEntry*(GDALColorEntry e3) */
29130       arg3 = &e3;
29131       int ok = SvROK(ST(2)) && SvTYPE(SvRV(ST(2)))==SVt_PVAV;
29132       AV *av;
29133       if (ok)
29134       av = (AV*)(SvRV(ST(2)));
29135       else
29136       do_confess(NEED_ARRAY_REF, 1);
29137       SV **sv = av_fetch(av, 0, 0);
29138       if (sv)
29139       arg3->c1 = SvIV(*sv);
29140       else
29141       arg3->c1 = 0;
29142       sv = av_fetch(av, 1, 0);
29143       if (sv)
29144       arg3->c2 = SvIV(*sv);
29145       else
29146       arg3->c2 = 0;
29147       sv = av_fetch(av, 2, 0);
29148       if (sv)
29149       arg3->c3 = SvIV(*sv);
29150       else
29151       arg3->c3 = 0;
29152       sv = av_fetch(av, 3, 0);
29153       if (sv)
29154       arg3->c4 = SvIV(*sv);
29155       else
29156       arg3->c4 = 255;
29157     }
29158     _saved[0] = ST(2);
29159     {
29160       CPLErrorReset();
29161       GDALColorTableShadow_SetColorEntry(arg1,arg2,(GDALColorEntry const *)arg3);
29162       CPLErr eclass = CPLGetLastErrorType();
29163       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
29164         do_confess( CPLGetLastErrorMsg(), 0 );
29165 
29166 
29167 
29168 
29169 
29170       }
29171 
29172 
29173       /*
29174           Make warnings regular Perl warnings. This duplicates the warning
29175           message if DontUseExceptions() is in effect (it is not by default).
29176           */
29177       if ( eclass == CE_Warning ) {
29178         warn( CPLGetLastErrorMsg(), "%s" );
29179       }
29180 
29181 
29182     }
29183     {
29184       /* %typemap(out) void */
29185     }
29186     {
29187       /* %typemap(argout) const GDALColorEntry* */
29188     }
29189 
29190 
29191 
29192     XSRETURN(argvi);
29193   fail:
29194 
29195 
29196 
29197     SWIG_croak_null();
29198   }
29199 }
29200 
29201 
XS(_wrap_ColorTable_CreateColorRamp)29202 XS(_wrap_ColorTable_CreateColorRamp) {
29203   {
29204     GDALColorTableShadow *arg1 = (GDALColorTableShadow *) 0 ;
29205     int arg2 ;
29206     GDALColorEntry *arg3 = (GDALColorEntry *) 0 ;
29207     int arg4 ;
29208     GDALColorEntry *arg5 = (GDALColorEntry *) 0 ;
29209     void *argp1 = 0 ;
29210     int res1 = 0 ;
29211     int val2 ;
29212     int ecode2 = 0 ;
29213     GDALColorEntry e3 ;
29214     int val4 ;
29215     int ecode4 = 0 ;
29216     GDALColorEntry e5 ;
29217     int argvi = 0;
29218     SV * _saved[2] ;
29219     dXSARGS;
29220 
29221     if ((items < 5) || (items > 5)) {
29222       SWIG_croak("Usage: ColorTable_CreateColorRamp(self,nStartIndex,startcolor,nEndIndex,endcolor);");
29223     }
29224     res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_GDALColorTableShadow, 0 |  0 );
29225     if (!SWIG_IsOK(res1)) {
29226       SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ColorTable_CreateColorRamp" "', argument " "1"" of type '" "GDALColorTableShadow *""'");
29227     }
29228     arg1 = reinterpret_cast< GDALColorTableShadow * >(argp1);
29229     ecode2 = SWIG_AsVal_int SWIG_PERL_CALL_ARGS_2(ST(1), &val2);
29230     if (!SWIG_IsOK(ecode2)) {
29231       SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "ColorTable_CreateColorRamp" "', argument " "2"" of type '" "int""'");
29232     }
29233     arg2 = static_cast< int >(val2);
29234     {
29235       /* %typemap(in,numinputs=1) const GDALColorEntry*(GDALColorEntry e3) */
29236       arg3 = &e3;
29237       int ok = SvROK(ST(2)) && SvTYPE(SvRV(ST(2)))==SVt_PVAV;
29238       AV *av;
29239       if (ok)
29240       av = (AV*)(SvRV(ST(2)));
29241       else
29242       do_confess(NEED_ARRAY_REF, 1);
29243       SV **sv = av_fetch(av, 0, 0);
29244       if (sv)
29245       arg3->c1 = SvIV(*sv);
29246       else
29247       arg3->c1 = 0;
29248       sv = av_fetch(av, 1, 0);
29249       if (sv)
29250       arg3->c2 = SvIV(*sv);
29251       else
29252       arg3->c2 = 0;
29253       sv = av_fetch(av, 2, 0);
29254       if (sv)
29255       arg3->c3 = SvIV(*sv);
29256       else
29257       arg3->c3 = 0;
29258       sv = av_fetch(av, 3, 0);
29259       if (sv)
29260       arg3->c4 = SvIV(*sv);
29261       else
29262       arg3->c4 = 255;
29263     }
29264     ecode4 = SWIG_AsVal_int SWIG_PERL_CALL_ARGS_2(ST(3), &val4);
29265     if (!SWIG_IsOK(ecode4)) {
29266       SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "ColorTable_CreateColorRamp" "', argument " "4"" of type '" "int""'");
29267     }
29268     arg4 = static_cast< int >(val4);
29269     {
29270       /* %typemap(in,numinputs=1) const GDALColorEntry*(GDALColorEntry e5) */
29271       arg5 = &e3;
29272       int ok = SvROK(ST(4)) && SvTYPE(SvRV(ST(4)))==SVt_PVAV;
29273       AV *av;
29274       if (ok)
29275       av = (AV*)(SvRV(ST(4)));
29276       else
29277       do_confess(NEED_ARRAY_REF, 1);
29278       SV **sv = av_fetch(av, 0, 0);
29279       if (sv)
29280       arg5->c1 = SvIV(*sv);
29281       else
29282       arg5->c1 = 0;
29283       sv = av_fetch(av, 1, 0);
29284       if (sv)
29285       arg5->c2 = SvIV(*sv);
29286       else
29287       arg5->c2 = 0;
29288       sv = av_fetch(av, 2, 0);
29289       if (sv)
29290       arg5->c3 = SvIV(*sv);
29291       else
29292       arg5->c3 = 0;
29293       sv = av_fetch(av, 3, 0);
29294       if (sv)
29295       arg5->c4 = SvIV(*sv);
29296       else
29297       arg5->c4 = 255;
29298     }
29299     _saved[0] = ST(2);
29300     _saved[1] = ST(4);
29301     {
29302       CPLErrorReset();
29303       GDALColorTableShadow_CreateColorRamp(arg1,arg2,(GDALColorEntry const *)arg3,arg4,(GDALColorEntry const *)arg5);
29304       CPLErr eclass = CPLGetLastErrorType();
29305       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
29306         do_confess( CPLGetLastErrorMsg(), 0 );
29307 
29308 
29309 
29310 
29311 
29312       }
29313 
29314 
29315       /*
29316           Make warnings regular Perl warnings. This duplicates the warning
29317           message if DontUseExceptions() is in effect (it is not by default).
29318           */
29319       if ( eclass == CE_Warning ) {
29320         warn( CPLGetLastErrorMsg(), "%s" );
29321       }
29322 
29323 
29324     }
29325     {
29326       /* %typemap(out) void */
29327     }
29328     {
29329       /* %typemap(argout) const GDALColorEntry* */
29330     }
29331     {
29332       /* %typemap(argout) const GDALColorEntry* */
29333     }
29334 
29335 
29336 
29337 
29338 
29339     XSRETURN(argvi);
29340   fail:
29341 
29342 
29343 
29344 
29345 
29346     SWIG_croak_null();
29347   }
29348 }
29349 
29350 
XS(_wrap_new_RasterAttributeTable)29351 XS(_wrap_new_RasterAttributeTable) {
29352   {
29353     int argvi = 0;
29354     GDALRasterAttributeTableShadow *result = 0 ;
29355     dXSARGS;
29356 
29357     if ((items < 0) || (items > 0)) {
29358       SWIG_croak("Usage: new_RasterAttributeTable();");
29359     }
29360     {
29361       CPLErrorReset();
29362       result = (GDALRasterAttributeTableShadow *)new_GDALRasterAttributeTableShadow();
29363       CPLErr eclass = CPLGetLastErrorType();
29364       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
29365         do_confess( CPLGetLastErrorMsg(), 0 );
29366 
29367 
29368 
29369 
29370 
29371       }
29372 
29373 
29374       /*
29375           Make warnings regular Perl warnings. This duplicates the warning
29376           message if DontUseExceptions() is in effect (it is not by default).
29377           */
29378       if ( eclass == CE_Warning ) {
29379         warn( CPLGetLastErrorMsg(), "%s" );
29380       }
29381 
29382 
29383     }
29384     ST(argvi) = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GDALRasterAttributeTableShadow, SWIG_OWNER | SWIG_SHADOW); argvi++ ;
29385     XSRETURN(argvi);
29386   fail:
29387     SWIG_croak_null();
29388   }
29389 }
29390 
29391 
XS(_wrap_delete_RasterAttributeTable)29392 XS(_wrap_delete_RasterAttributeTable) {
29393   {
29394     GDALRasterAttributeTableShadow *arg1 = (GDALRasterAttributeTableShadow *) 0 ;
29395     void *argp1 = 0 ;
29396     int res1 = 0 ;
29397     int argvi = 0;
29398     dXSARGS;
29399 
29400     if ((items < 1) || (items > 1)) {
29401       SWIG_croak("Usage: delete_RasterAttributeTable(self);");
29402     }
29403     res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_GDALRasterAttributeTableShadow, SWIG_POINTER_DISOWN |  0 );
29404     if (!SWIG_IsOK(res1)) {
29405       SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_RasterAttributeTable" "', argument " "1"" of type '" "GDALRasterAttributeTableShadow *""'");
29406     }
29407     arg1 = reinterpret_cast< GDALRasterAttributeTableShadow * >(argp1);
29408     {
29409       CPLErrorReset();
29410       delete_GDALRasterAttributeTableShadow(arg1);
29411       CPLErr eclass = CPLGetLastErrorType();
29412       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
29413         do_confess( CPLGetLastErrorMsg(), 0 );
29414 
29415 
29416 
29417 
29418 
29419       }
29420 
29421 
29422       /*
29423           Make warnings regular Perl warnings. This duplicates the warning
29424           message if DontUseExceptions() is in effect (it is not by default).
29425           */
29426       if ( eclass == CE_Warning ) {
29427         warn( CPLGetLastErrorMsg(), "%s" );
29428       }
29429 
29430 
29431     }
29432     {
29433       /* %typemap(out) void */
29434     }
29435 
29436     XSRETURN(argvi);
29437   fail:
29438 
29439     SWIG_croak_null();
29440   }
29441 }
29442 
29443 
XS(_wrap_RasterAttributeTable_Clone)29444 XS(_wrap_RasterAttributeTable_Clone) {
29445   {
29446     GDALRasterAttributeTableShadow *arg1 = (GDALRasterAttributeTableShadow *) 0 ;
29447     void *argp1 = 0 ;
29448     int res1 = 0 ;
29449     int argvi = 0;
29450     GDALRasterAttributeTableShadow *result = 0 ;
29451     dXSARGS;
29452 
29453     if ((items < 1) || (items > 1)) {
29454       SWIG_croak("Usage: RasterAttributeTable_Clone(self);");
29455     }
29456     res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_GDALRasterAttributeTableShadow, 0 |  0 );
29457     if (!SWIG_IsOK(res1)) {
29458       SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "RasterAttributeTable_Clone" "', argument " "1"" of type '" "GDALRasterAttributeTableShadow *""'");
29459     }
29460     arg1 = reinterpret_cast< GDALRasterAttributeTableShadow * >(argp1);
29461     {
29462       CPLErrorReset();
29463       result = (GDALRasterAttributeTableShadow *)GDALRasterAttributeTableShadow_Clone(arg1);
29464       CPLErr eclass = CPLGetLastErrorType();
29465       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
29466         do_confess( CPLGetLastErrorMsg(), 0 );
29467 
29468 
29469 
29470 
29471 
29472       }
29473 
29474 
29475       /*
29476           Make warnings regular Perl warnings. This duplicates the warning
29477           message if DontUseExceptions() is in effect (it is not by default).
29478           */
29479       if ( eclass == CE_Warning ) {
29480         warn( CPLGetLastErrorMsg(), "%s" );
29481       }
29482 
29483 
29484     }
29485     ST(argvi) = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GDALRasterAttributeTableShadow, SWIG_OWNER | SWIG_SHADOW); argvi++ ;
29486 
29487     XSRETURN(argvi);
29488   fail:
29489 
29490     SWIG_croak_null();
29491   }
29492 }
29493 
29494 
XS(_wrap_RasterAttributeTable_GetColumnCount)29495 XS(_wrap_RasterAttributeTable_GetColumnCount) {
29496   {
29497     GDALRasterAttributeTableShadow *arg1 = (GDALRasterAttributeTableShadow *) 0 ;
29498     void *argp1 = 0 ;
29499     int res1 = 0 ;
29500     int argvi = 0;
29501     int result;
29502     dXSARGS;
29503 
29504     if ((items < 1) || (items > 1)) {
29505       SWIG_croak("Usage: RasterAttributeTable_GetColumnCount(self);");
29506     }
29507     res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_GDALRasterAttributeTableShadow, 0 |  0 );
29508     if (!SWIG_IsOK(res1)) {
29509       SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "RasterAttributeTable_GetColumnCount" "', argument " "1"" of type '" "GDALRasterAttributeTableShadow *""'");
29510     }
29511     arg1 = reinterpret_cast< GDALRasterAttributeTableShadow * >(argp1);
29512     {
29513       CPLErrorReset();
29514       result = (int)GDALRasterAttributeTableShadow_GetColumnCount(arg1);
29515       CPLErr eclass = CPLGetLastErrorType();
29516       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
29517         do_confess( CPLGetLastErrorMsg(), 0 );
29518 
29519 
29520 
29521 
29522 
29523       }
29524 
29525 
29526       /*
29527           Make warnings regular Perl warnings. This duplicates the warning
29528           message if DontUseExceptions() is in effect (it is not by default).
29529           */
29530       if ( eclass == CE_Warning ) {
29531         warn( CPLGetLastErrorMsg(), "%s" );
29532       }
29533 
29534 
29535     }
29536     ST(argvi) = SWIG_From_int  SWIG_PERL_CALL_ARGS_1(static_cast< int >(result)); argvi++ ;
29537 
29538     XSRETURN(argvi);
29539   fail:
29540 
29541     SWIG_croak_null();
29542   }
29543 }
29544 
29545 
XS(_wrap_RasterAttributeTable_GetNameOfCol)29546 XS(_wrap_RasterAttributeTable_GetNameOfCol) {
29547   {
29548     GDALRasterAttributeTableShadow *arg1 = (GDALRasterAttributeTableShadow *) 0 ;
29549     int arg2 ;
29550     void *argp1 = 0 ;
29551     int res1 = 0 ;
29552     int val2 ;
29553     int ecode2 = 0 ;
29554     int argvi = 0;
29555     char *result = 0 ;
29556     dXSARGS;
29557 
29558     if ((items < 2) || (items > 2)) {
29559       SWIG_croak("Usage: RasterAttributeTable_GetNameOfCol(self,iCol);");
29560     }
29561     res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_GDALRasterAttributeTableShadow, 0 |  0 );
29562     if (!SWIG_IsOK(res1)) {
29563       SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "RasterAttributeTable_GetNameOfCol" "', argument " "1"" of type '" "GDALRasterAttributeTableShadow *""'");
29564     }
29565     arg1 = reinterpret_cast< GDALRasterAttributeTableShadow * >(argp1);
29566     ecode2 = SWIG_AsVal_int SWIG_PERL_CALL_ARGS_2(ST(1), &val2);
29567     if (!SWIG_IsOK(ecode2)) {
29568       SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "RasterAttributeTable_GetNameOfCol" "', argument " "2"" of type '" "int""'");
29569     }
29570     arg2 = static_cast< int >(val2);
29571     {
29572       CPLErrorReset();
29573       result = (char *)GDALRasterAttributeTableShadow_GetNameOfCol(arg1,arg2);
29574       CPLErr eclass = CPLGetLastErrorType();
29575       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
29576         do_confess( CPLGetLastErrorMsg(), 0 );
29577 
29578 
29579 
29580 
29581 
29582       }
29583 
29584 
29585       /*
29586           Make warnings regular Perl warnings. This duplicates the warning
29587           message if DontUseExceptions() is in effect (it is not by default).
29588           */
29589       if ( eclass == CE_Warning ) {
29590         warn( CPLGetLastErrorMsg(), "%s" );
29591       }
29592 
29593 
29594     }
29595     {
29596       /* %typemap(out) const char * */
29597       ST(argvi) = newSVpv(result, 0);
29598       SvUTF8_on(ST(argvi)); /* expecting GDAL to give us UTF-8 */
29599       sv_2mortal(ST(argvi));
29600       argvi++;
29601     }
29602 
29603 
29604     XSRETURN(argvi);
29605   fail:
29606 
29607 
29608     SWIG_croak_null();
29609   }
29610 }
29611 
29612 
XS(_wrap_RasterAttributeTable__GetUsageOfCol)29613 XS(_wrap_RasterAttributeTable__GetUsageOfCol) {
29614   {
29615     GDALRasterAttributeTableShadow *arg1 = (GDALRasterAttributeTableShadow *) 0 ;
29616     int arg2 ;
29617     void *argp1 = 0 ;
29618     int res1 = 0 ;
29619     int val2 ;
29620     int ecode2 = 0 ;
29621     int argvi = 0;
29622     GDALRATFieldUsage result;
29623     dXSARGS;
29624 
29625     if ((items < 2) || (items > 2)) {
29626       SWIG_croak("Usage: RasterAttributeTable__GetUsageOfCol(self,iCol);");
29627     }
29628     res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_GDALRasterAttributeTableShadow, 0 |  0 );
29629     if (!SWIG_IsOK(res1)) {
29630       SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "RasterAttributeTable__GetUsageOfCol" "', argument " "1"" of type '" "GDALRasterAttributeTableShadow *""'");
29631     }
29632     arg1 = reinterpret_cast< GDALRasterAttributeTableShadow * >(argp1);
29633     ecode2 = SWIG_AsVal_int SWIG_PERL_CALL_ARGS_2(ST(1), &val2);
29634     if (!SWIG_IsOK(ecode2)) {
29635       SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "RasterAttributeTable__GetUsageOfCol" "', argument " "2"" of type '" "int""'");
29636     }
29637     arg2 = static_cast< int >(val2);
29638     {
29639       CPLErrorReset();
29640       result = (GDALRATFieldUsage)GDALRasterAttributeTableShadow_GetUsageOfCol(arg1,arg2);
29641       CPLErr eclass = CPLGetLastErrorType();
29642       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
29643         do_confess( CPLGetLastErrorMsg(), 0 );
29644 
29645 
29646 
29647 
29648 
29649       }
29650 
29651 
29652       /*
29653           Make warnings regular Perl warnings. This duplicates the warning
29654           message if DontUseExceptions() is in effect (it is not by default).
29655           */
29656       if ( eclass == CE_Warning ) {
29657         warn( CPLGetLastErrorMsg(), "%s" );
29658       }
29659 
29660 
29661     }
29662     ST(argvi) = SWIG_From_int  SWIG_PERL_CALL_ARGS_1(static_cast< int >(result)); argvi++ ;
29663 
29664 
29665     XSRETURN(argvi);
29666   fail:
29667 
29668 
29669     SWIG_croak_null();
29670   }
29671 }
29672 
29673 
XS(_wrap_RasterAttributeTable__GetTypeOfCol)29674 XS(_wrap_RasterAttributeTable__GetTypeOfCol) {
29675   {
29676     GDALRasterAttributeTableShadow *arg1 = (GDALRasterAttributeTableShadow *) 0 ;
29677     int arg2 ;
29678     void *argp1 = 0 ;
29679     int res1 = 0 ;
29680     int val2 ;
29681     int ecode2 = 0 ;
29682     int argvi = 0;
29683     GDALRATFieldType result;
29684     dXSARGS;
29685 
29686     if ((items < 2) || (items > 2)) {
29687       SWIG_croak("Usage: RasterAttributeTable__GetTypeOfCol(self,iCol);");
29688     }
29689     res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_GDALRasterAttributeTableShadow, 0 |  0 );
29690     if (!SWIG_IsOK(res1)) {
29691       SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "RasterAttributeTable__GetTypeOfCol" "', argument " "1"" of type '" "GDALRasterAttributeTableShadow *""'");
29692     }
29693     arg1 = reinterpret_cast< GDALRasterAttributeTableShadow * >(argp1);
29694     ecode2 = SWIG_AsVal_int SWIG_PERL_CALL_ARGS_2(ST(1), &val2);
29695     if (!SWIG_IsOK(ecode2)) {
29696       SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "RasterAttributeTable__GetTypeOfCol" "', argument " "2"" of type '" "int""'");
29697     }
29698     arg2 = static_cast< int >(val2);
29699     {
29700       CPLErrorReset();
29701       result = (GDALRATFieldType)GDALRasterAttributeTableShadow_GetTypeOfCol(arg1,arg2);
29702       CPLErr eclass = CPLGetLastErrorType();
29703       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
29704         do_confess( CPLGetLastErrorMsg(), 0 );
29705 
29706 
29707 
29708 
29709 
29710       }
29711 
29712 
29713       /*
29714           Make warnings regular Perl warnings. This duplicates the warning
29715           message if DontUseExceptions() is in effect (it is not by default).
29716           */
29717       if ( eclass == CE_Warning ) {
29718         warn( CPLGetLastErrorMsg(), "%s" );
29719       }
29720 
29721 
29722     }
29723     ST(argvi) = SWIG_From_int  SWIG_PERL_CALL_ARGS_1(static_cast< int >(result)); argvi++ ;
29724 
29725 
29726     XSRETURN(argvi);
29727   fail:
29728 
29729 
29730     SWIG_croak_null();
29731   }
29732 }
29733 
29734 
XS(_wrap_RasterAttributeTable__GetColOfUsage)29735 XS(_wrap_RasterAttributeTable__GetColOfUsage) {
29736   {
29737     GDALRasterAttributeTableShadow *arg1 = (GDALRasterAttributeTableShadow *) 0 ;
29738     GDALRATFieldUsage arg2 ;
29739     void *argp1 = 0 ;
29740     int res1 = 0 ;
29741     int val2 ;
29742     int ecode2 = 0 ;
29743     int argvi = 0;
29744     int result;
29745     dXSARGS;
29746 
29747     if ((items < 2) || (items > 2)) {
29748       SWIG_croak("Usage: RasterAttributeTable__GetColOfUsage(self,eUsage);");
29749     }
29750     res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_GDALRasterAttributeTableShadow, 0 |  0 );
29751     if (!SWIG_IsOK(res1)) {
29752       SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "RasterAttributeTable__GetColOfUsage" "', argument " "1"" of type '" "GDALRasterAttributeTableShadow *""'");
29753     }
29754     arg1 = reinterpret_cast< GDALRasterAttributeTableShadow * >(argp1);
29755     ecode2 = SWIG_AsVal_int SWIG_PERL_CALL_ARGS_2(ST(1), &val2);
29756     if (!SWIG_IsOK(ecode2)) {
29757       SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "RasterAttributeTable__GetColOfUsage" "', argument " "2"" of type '" "GDALRATFieldUsage""'");
29758     }
29759     arg2 = static_cast< GDALRATFieldUsage >(val2);
29760     {
29761       CPLErrorReset();
29762       result = (int)GDALRasterAttributeTableShadow_GetColOfUsage(arg1,arg2);
29763       CPLErr eclass = CPLGetLastErrorType();
29764       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
29765         do_confess( CPLGetLastErrorMsg(), 0 );
29766 
29767 
29768 
29769 
29770 
29771       }
29772 
29773 
29774       /*
29775           Make warnings regular Perl warnings. This duplicates the warning
29776           message if DontUseExceptions() is in effect (it is not by default).
29777           */
29778       if ( eclass == CE_Warning ) {
29779         warn( CPLGetLastErrorMsg(), "%s" );
29780       }
29781 
29782 
29783     }
29784     ST(argvi) = SWIG_From_int  SWIG_PERL_CALL_ARGS_1(static_cast< int >(result)); argvi++ ;
29785 
29786 
29787     XSRETURN(argvi);
29788   fail:
29789 
29790 
29791     SWIG_croak_null();
29792   }
29793 }
29794 
29795 
XS(_wrap_RasterAttributeTable_GetRowCount)29796 XS(_wrap_RasterAttributeTable_GetRowCount) {
29797   {
29798     GDALRasterAttributeTableShadow *arg1 = (GDALRasterAttributeTableShadow *) 0 ;
29799     void *argp1 = 0 ;
29800     int res1 = 0 ;
29801     int argvi = 0;
29802     int result;
29803     dXSARGS;
29804 
29805     if ((items < 1) || (items > 1)) {
29806       SWIG_croak("Usage: RasterAttributeTable_GetRowCount(self);");
29807     }
29808     res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_GDALRasterAttributeTableShadow, 0 |  0 );
29809     if (!SWIG_IsOK(res1)) {
29810       SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "RasterAttributeTable_GetRowCount" "', argument " "1"" of type '" "GDALRasterAttributeTableShadow *""'");
29811     }
29812     arg1 = reinterpret_cast< GDALRasterAttributeTableShadow * >(argp1);
29813     {
29814       CPLErrorReset();
29815       result = (int)GDALRasterAttributeTableShadow_GetRowCount(arg1);
29816       CPLErr eclass = CPLGetLastErrorType();
29817       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
29818         do_confess( CPLGetLastErrorMsg(), 0 );
29819 
29820 
29821 
29822 
29823 
29824       }
29825 
29826 
29827       /*
29828           Make warnings regular Perl warnings. This duplicates the warning
29829           message if DontUseExceptions() is in effect (it is not by default).
29830           */
29831       if ( eclass == CE_Warning ) {
29832         warn( CPLGetLastErrorMsg(), "%s" );
29833       }
29834 
29835 
29836     }
29837     ST(argvi) = SWIG_From_int  SWIG_PERL_CALL_ARGS_1(static_cast< int >(result)); argvi++ ;
29838 
29839     XSRETURN(argvi);
29840   fail:
29841 
29842     SWIG_croak_null();
29843   }
29844 }
29845 
29846 
XS(_wrap_RasterAttributeTable_GetValueAsString)29847 XS(_wrap_RasterAttributeTable_GetValueAsString) {
29848   {
29849     GDALRasterAttributeTableShadow *arg1 = (GDALRasterAttributeTableShadow *) 0 ;
29850     int arg2 ;
29851     int arg3 ;
29852     void *argp1 = 0 ;
29853     int res1 = 0 ;
29854     int val2 ;
29855     int ecode2 = 0 ;
29856     int val3 ;
29857     int ecode3 = 0 ;
29858     int argvi = 0;
29859     char *result = 0 ;
29860     dXSARGS;
29861 
29862     if ((items < 3) || (items > 3)) {
29863       SWIG_croak("Usage: RasterAttributeTable_GetValueAsString(self,iRow,iCol);");
29864     }
29865     res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_GDALRasterAttributeTableShadow, 0 |  0 );
29866     if (!SWIG_IsOK(res1)) {
29867       SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "RasterAttributeTable_GetValueAsString" "', argument " "1"" of type '" "GDALRasterAttributeTableShadow *""'");
29868     }
29869     arg1 = reinterpret_cast< GDALRasterAttributeTableShadow * >(argp1);
29870     ecode2 = SWIG_AsVal_int SWIG_PERL_CALL_ARGS_2(ST(1), &val2);
29871     if (!SWIG_IsOK(ecode2)) {
29872       SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "RasterAttributeTable_GetValueAsString" "', argument " "2"" of type '" "int""'");
29873     }
29874     arg2 = static_cast< int >(val2);
29875     ecode3 = SWIG_AsVal_int SWIG_PERL_CALL_ARGS_2(ST(2), &val3);
29876     if (!SWIG_IsOK(ecode3)) {
29877       SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "RasterAttributeTable_GetValueAsString" "', argument " "3"" of type '" "int""'");
29878     }
29879     arg3 = static_cast< int >(val3);
29880     {
29881       CPLErrorReset();
29882       result = (char *)GDALRasterAttributeTableShadow_GetValueAsString(arg1,arg2,arg3);
29883       CPLErr eclass = CPLGetLastErrorType();
29884       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
29885         do_confess( CPLGetLastErrorMsg(), 0 );
29886 
29887 
29888 
29889 
29890 
29891       }
29892 
29893 
29894       /*
29895           Make warnings regular Perl warnings. This duplicates the warning
29896           message if DontUseExceptions() is in effect (it is not by default).
29897           */
29898       if ( eclass == CE_Warning ) {
29899         warn( CPLGetLastErrorMsg(), "%s" );
29900       }
29901 
29902 
29903     }
29904     {
29905       /* %typemap(out) const char * */
29906       ST(argvi) = newSVpv(result, 0);
29907       SvUTF8_on(ST(argvi)); /* expecting GDAL to give us UTF-8 */
29908       sv_2mortal(ST(argvi));
29909       argvi++;
29910     }
29911 
29912 
29913 
29914     XSRETURN(argvi);
29915   fail:
29916 
29917 
29918 
29919     SWIG_croak_null();
29920   }
29921 }
29922 
29923 
XS(_wrap_RasterAttributeTable_GetValueAsInt)29924 XS(_wrap_RasterAttributeTable_GetValueAsInt) {
29925   {
29926     GDALRasterAttributeTableShadow *arg1 = (GDALRasterAttributeTableShadow *) 0 ;
29927     int arg2 ;
29928     int arg3 ;
29929     void *argp1 = 0 ;
29930     int res1 = 0 ;
29931     int val2 ;
29932     int ecode2 = 0 ;
29933     int val3 ;
29934     int ecode3 = 0 ;
29935     int argvi = 0;
29936     int result;
29937     dXSARGS;
29938 
29939     if ((items < 3) || (items > 3)) {
29940       SWIG_croak("Usage: RasterAttributeTable_GetValueAsInt(self,iRow,iCol);");
29941     }
29942     res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_GDALRasterAttributeTableShadow, 0 |  0 );
29943     if (!SWIG_IsOK(res1)) {
29944       SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "RasterAttributeTable_GetValueAsInt" "', argument " "1"" of type '" "GDALRasterAttributeTableShadow *""'");
29945     }
29946     arg1 = reinterpret_cast< GDALRasterAttributeTableShadow * >(argp1);
29947     ecode2 = SWIG_AsVal_int SWIG_PERL_CALL_ARGS_2(ST(1), &val2);
29948     if (!SWIG_IsOK(ecode2)) {
29949       SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "RasterAttributeTable_GetValueAsInt" "', argument " "2"" of type '" "int""'");
29950     }
29951     arg2 = static_cast< int >(val2);
29952     ecode3 = SWIG_AsVal_int SWIG_PERL_CALL_ARGS_2(ST(2), &val3);
29953     if (!SWIG_IsOK(ecode3)) {
29954       SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "RasterAttributeTable_GetValueAsInt" "', argument " "3"" of type '" "int""'");
29955     }
29956     arg3 = static_cast< int >(val3);
29957     {
29958       CPLErrorReset();
29959       result = (int)GDALRasterAttributeTableShadow_GetValueAsInt(arg1,arg2,arg3);
29960       CPLErr eclass = CPLGetLastErrorType();
29961       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
29962         do_confess( CPLGetLastErrorMsg(), 0 );
29963 
29964 
29965 
29966 
29967 
29968       }
29969 
29970 
29971       /*
29972           Make warnings regular Perl warnings. This duplicates the warning
29973           message if DontUseExceptions() is in effect (it is not by default).
29974           */
29975       if ( eclass == CE_Warning ) {
29976         warn( CPLGetLastErrorMsg(), "%s" );
29977       }
29978 
29979 
29980     }
29981     ST(argvi) = SWIG_From_int  SWIG_PERL_CALL_ARGS_1(static_cast< int >(result)); argvi++ ;
29982 
29983 
29984 
29985     XSRETURN(argvi);
29986   fail:
29987 
29988 
29989 
29990     SWIG_croak_null();
29991   }
29992 }
29993 
29994 
XS(_wrap_RasterAttributeTable_GetValueAsDouble)29995 XS(_wrap_RasterAttributeTable_GetValueAsDouble) {
29996   {
29997     GDALRasterAttributeTableShadow *arg1 = (GDALRasterAttributeTableShadow *) 0 ;
29998     int arg2 ;
29999     int arg3 ;
30000     void *argp1 = 0 ;
30001     int res1 = 0 ;
30002     int val2 ;
30003     int ecode2 = 0 ;
30004     int val3 ;
30005     int ecode3 = 0 ;
30006     int argvi = 0;
30007     double result;
30008     dXSARGS;
30009 
30010     if ((items < 3) || (items > 3)) {
30011       SWIG_croak("Usage: RasterAttributeTable_GetValueAsDouble(self,iRow,iCol);");
30012     }
30013     res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_GDALRasterAttributeTableShadow, 0 |  0 );
30014     if (!SWIG_IsOK(res1)) {
30015       SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "RasterAttributeTable_GetValueAsDouble" "', argument " "1"" of type '" "GDALRasterAttributeTableShadow *""'");
30016     }
30017     arg1 = reinterpret_cast< GDALRasterAttributeTableShadow * >(argp1);
30018     ecode2 = SWIG_AsVal_int SWIG_PERL_CALL_ARGS_2(ST(1), &val2);
30019     if (!SWIG_IsOK(ecode2)) {
30020       SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "RasterAttributeTable_GetValueAsDouble" "', argument " "2"" of type '" "int""'");
30021     }
30022     arg2 = static_cast< int >(val2);
30023     ecode3 = SWIG_AsVal_int SWIG_PERL_CALL_ARGS_2(ST(2), &val3);
30024     if (!SWIG_IsOK(ecode3)) {
30025       SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "RasterAttributeTable_GetValueAsDouble" "', argument " "3"" of type '" "int""'");
30026     }
30027     arg3 = static_cast< int >(val3);
30028     {
30029       CPLErrorReset();
30030       result = (double)GDALRasterAttributeTableShadow_GetValueAsDouble(arg1,arg2,arg3);
30031       CPLErr eclass = CPLGetLastErrorType();
30032       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
30033         do_confess( CPLGetLastErrorMsg(), 0 );
30034 
30035 
30036 
30037 
30038 
30039       }
30040 
30041 
30042       /*
30043           Make warnings regular Perl warnings. This duplicates the warning
30044           message if DontUseExceptions() is in effect (it is not by default).
30045           */
30046       if ( eclass == CE_Warning ) {
30047         warn( CPLGetLastErrorMsg(), "%s" );
30048       }
30049 
30050 
30051     }
30052     ST(argvi) = SWIG_From_double  SWIG_PERL_CALL_ARGS_1(static_cast< double >(result)); argvi++ ;
30053 
30054 
30055 
30056     XSRETURN(argvi);
30057   fail:
30058 
30059 
30060 
30061     SWIG_croak_null();
30062   }
30063 }
30064 
30065 
XS(_wrap_RasterAttributeTable_SetValueAsString)30066 XS(_wrap_RasterAttributeTable_SetValueAsString) {
30067   {
30068     GDALRasterAttributeTableShadow *arg1 = (GDALRasterAttributeTableShadow *) 0 ;
30069     int arg2 ;
30070     int arg3 ;
30071     char *arg4 = (char *) 0 ;
30072     void *argp1 = 0 ;
30073     int res1 = 0 ;
30074     int val2 ;
30075     int ecode2 = 0 ;
30076     int val3 ;
30077     int ecode3 = 0 ;
30078     U8 *tmpbuf4 = NULL ;
30079     int argvi = 0;
30080     dXSARGS;
30081 
30082     if ((items < 4) || (items > 4)) {
30083       SWIG_croak("Usage: RasterAttributeTable_SetValueAsString(self,iRow,iCol,pszValue);");
30084     }
30085     res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_GDALRasterAttributeTableShadow, 0 |  0 );
30086     if (!SWIG_IsOK(res1)) {
30087       SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "RasterAttributeTable_SetValueAsString" "', argument " "1"" of type '" "GDALRasterAttributeTableShadow *""'");
30088     }
30089     arg1 = reinterpret_cast< GDALRasterAttributeTableShadow * >(argp1);
30090     ecode2 = SWIG_AsVal_int SWIG_PERL_CALL_ARGS_2(ST(1), &val2);
30091     if (!SWIG_IsOK(ecode2)) {
30092       SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "RasterAttributeTable_SetValueAsString" "', argument " "2"" of type '" "int""'");
30093     }
30094     arg2 = static_cast< int >(val2);
30095     ecode3 = SWIG_AsVal_int SWIG_PERL_CALL_ARGS_2(ST(2), &val3);
30096     if (!SWIG_IsOK(ecode3)) {
30097       SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "RasterAttributeTable_SetValueAsString" "', argument " "3"" of type '" "int""'");
30098     }
30099     arg3 = static_cast< int >(val3);
30100     {
30101       /* %typemap(in) (tostring argin) */
30102       arg4 = sv_to_utf8_string(ST(3), &tmpbuf4);
30103     }
30104     {
30105       CPLErrorReset();
30106       GDALRasterAttributeTableShadow_SetValueAsString(arg1,arg2,arg3,(char const *)arg4);
30107       CPLErr eclass = CPLGetLastErrorType();
30108       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
30109         do_confess( CPLGetLastErrorMsg(), 0 );
30110 
30111 
30112 
30113 
30114 
30115       }
30116 
30117 
30118       /*
30119           Make warnings regular Perl warnings. This duplicates the warning
30120           message if DontUseExceptions() is in effect (it is not by default).
30121           */
30122       if ( eclass == CE_Warning ) {
30123         warn( CPLGetLastErrorMsg(), "%s" );
30124       }
30125 
30126 
30127     }
30128     {
30129       /* %typemap(out) void */
30130     }
30131 
30132 
30133 
30134     {
30135       /* %typemap(freearg) (tostring argin) */
30136       if (tmpbuf4) Safefree(tmpbuf4);
30137     }
30138     XSRETURN(argvi);
30139   fail:
30140 
30141 
30142 
30143     {
30144       /* %typemap(freearg) (tostring argin) */
30145       if (tmpbuf4) Safefree(tmpbuf4);
30146     }
30147     SWIG_croak_null();
30148   }
30149 }
30150 
30151 
XS(_wrap_RasterAttributeTable_SetValueAsInt)30152 XS(_wrap_RasterAttributeTable_SetValueAsInt) {
30153   {
30154     GDALRasterAttributeTableShadow *arg1 = (GDALRasterAttributeTableShadow *) 0 ;
30155     int arg2 ;
30156     int arg3 ;
30157     int arg4 ;
30158     void *argp1 = 0 ;
30159     int res1 = 0 ;
30160     int val2 ;
30161     int ecode2 = 0 ;
30162     int val3 ;
30163     int ecode3 = 0 ;
30164     int val4 ;
30165     int ecode4 = 0 ;
30166     int argvi = 0;
30167     dXSARGS;
30168 
30169     if ((items < 4) || (items > 4)) {
30170       SWIG_croak("Usage: RasterAttributeTable_SetValueAsInt(self,iRow,iCol,nValue);");
30171     }
30172     res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_GDALRasterAttributeTableShadow, 0 |  0 );
30173     if (!SWIG_IsOK(res1)) {
30174       SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "RasterAttributeTable_SetValueAsInt" "', argument " "1"" of type '" "GDALRasterAttributeTableShadow *""'");
30175     }
30176     arg1 = reinterpret_cast< GDALRasterAttributeTableShadow * >(argp1);
30177     ecode2 = SWIG_AsVal_int SWIG_PERL_CALL_ARGS_2(ST(1), &val2);
30178     if (!SWIG_IsOK(ecode2)) {
30179       SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "RasterAttributeTable_SetValueAsInt" "', argument " "2"" of type '" "int""'");
30180     }
30181     arg2 = static_cast< int >(val2);
30182     ecode3 = SWIG_AsVal_int SWIG_PERL_CALL_ARGS_2(ST(2), &val3);
30183     if (!SWIG_IsOK(ecode3)) {
30184       SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "RasterAttributeTable_SetValueAsInt" "', argument " "3"" of type '" "int""'");
30185     }
30186     arg3 = static_cast< int >(val3);
30187     ecode4 = SWIG_AsVal_int SWIG_PERL_CALL_ARGS_2(ST(3), &val4);
30188     if (!SWIG_IsOK(ecode4)) {
30189       SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "RasterAttributeTable_SetValueAsInt" "', argument " "4"" of type '" "int""'");
30190     }
30191     arg4 = static_cast< int >(val4);
30192     {
30193       CPLErrorReset();
30194       GDALRasterAttributeTableShadow_SetValueAsInt(arg1,arg2,arg3,arg4);
30195       CPLErr eclass = CPLGetLastErrorType();
30196       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
30197         do_confess( CPLGetLastErrorMsg(), 0 );
30198 
30199 
30200 
30201 
30202 
30203       }
30204 
30205 
30206       /*
30207           Make warnings regular Perl warnings. This duplicates the warning
30208           message if DontUseExceptions() is in effect (it is not by default).
30209           */
30210       if ( eclass == CE_Warning ) {
30211         warn( CPLGetLastErrorMsg(), "%s" );
30212       }
30213 
30214 
30215     }
30216     {
30217       /* %typemap(out) void */
30218     }
30219 
30220 
30221 
30222 
30223     XSRETURN(argvi);
30224   fail:
30225 
30226 
30227 
30228 
30229     SWIG_croak_null();
30230   }
30231 }
30232 
30233 
XS(_wrap_RasterAttributeTable_SetValueAsDouble)30234 XS(_wrap_RasterAttributeTable_SetValueAsDouble) {
30235   {
30236     GDALRasterAttributeTableShadow *arg1 = (GDALRasterAttributeTableShadow *) 0 ;
30237     int arg2 ;
30238     int arg3 ;
30239     double arg4 ;
30240     void *argp1 = 0 ;
30241     int res1 = 0 ;
30242     int val2 ;
30243     int ecode2 = 0 ;
30244     int val3 ;
30245     int ecode3 = 0 ;
30246     double val4 ;
30247     int ecode4 = 0 ;
30248     int argvi = 0;
30249     dXSARGS;
30250 
30251     if ((items < 4) || (items > 4)) {
30252       SWIG_croak("Usage: RasterAttributeTable_SetValueAsDouble(self,iRow,iCol,dfValue);");
30253     }
30254     res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_GDALRasterAttributeTableShadow, 0 |  0 );
30255     if (!SWIG_IsOK(res1)) {
30256       SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "RasterAttributeTable_SetValueAsDouble" "', argument " "1"" of type '" "GDALRasterAttributeTableShadow *""'");
30257     }
30258     arg1 = reinterpret_cast< GDALRasterAttributeTableShadow * >(argp1);
30259     ecode2 = SWIG_AsVal_int SWIG_PERL_CALL_ARGS_2(ST(1), &val2);
30260     if (!SWIG_IsOK(ecode2)) {
30261       SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "RasterAttributeTable_SetValueAsDouble" "', argument " "2"" of type '" "int""'");
30262     }
30263     arg2 = static_cast< int >(val2);
30264     ecode3 = SWIG_AsVal_int SWIG_PERL_CALL_ARGS_2(ST(2), &val3);
30265     if (!SWIG_IsOK(ecode3)) {
30266       SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "RasterAttributeTable_SetValueAsDouble" "', argument " "3"" of type '" "int""'");
30267     }
30268     arg3 = static_cast< int >(val3);
30269     ecode4 = SWIG_AsVal_double SWIG_PERL_CALL_ARGS_2(ST(3), &val4);
30270     if (!SWIG_IsOK(ecode4)) {
30271       SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "RasterAttributeTable_SetValueAsDouble" "', argument " "4"" of type '" "double""'");
30272     }
30273     arg4 = static_cast< double >(val4);
30274     {
30275       CPLErrorReset();
30276       GDALRasterAttributeTableShadow_SetValueAsDouble(arg1,arg2,arg3,arg4);
30277       CPLErr eclass = CPLGetLastErrorType();
30278       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
30279         do_confess( CPLGetLastErrorMsg(), 0 );
30280 
30281 
30282 
30283 
30284 
30285       }
30286 
30287 
30288       /*
30289           Make warnings regular Perl warnings. This duplicates the warning
30290           message if DontUseExceptions() is in effect (it is not by default).
30291           */
30292       if ( eclass == CE_Warning ) {
30293         warn( CPLGetLastErrorMsg(), "%s" );
30294       }
30295 
30296 
30297     }
30298     {
30299       /* %typemap(out) void */
30300     }
30301 
30302 
30303 
30304 
30305     XSRETURN(argvi);
30306   fail:
30307 
30308 
30309 
30310 
30311     SWIG_croak_null();
30312   }
30313 }
30314 
30315 
XS(_wrap_RasterAttributeTable_SetRowCount)30316 XS(_wrap_RasterAttributeTable_SetRowCount) {
30317   {
30318     GDALRasterAttributeTableShadow *arg1 = (GDALRasterAttributeTableShadow *) 0 ;
30319     int arg2 ;
30320     void *argp1 = 0 ;
30321     int res1 = 0 ;
30322     int val2 ;
30323     int ecode2 = 0 ;
30324     int argvi = 0;
30325     dXSARGS;
30326 
30327     if ((items < 2) || (items > 2)) {
30328       SWIG_croak("Usage: RasterAttributeTable_SetRowCount(self,nCount);");
30329     }
30330     res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_GDALRasterAttributeTableShadow, 0 |  0 );
30331     if (!SWIG_IsOK(res1)) {
30332       SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "RasterAttributeTable_SetRowCount" "', argument " "1"" of type '" "GDALRasterAttributeTableShadow *""'");
30333     }
30334     arg1 = reinterpret_cast< GDALRasterAttributeTableShadow * >(argp1);
30335     ecode2 = SWIG_AsVal_int SWIG_PERL_CALL_ARGS_2(ST(1), &val2);
30336     if (!SWIG_IsOK(ecode2)) {
30337       SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "RasterAttributeTable_SetRowCount" "', argument " "2"" of type '" "int""'");
30338     }
30339     arg2 = static_cast< int >(val2);
30340     {
30341       CPLErrorReset();
30342       GDALRasterAttributeTableShadow_SetRowCount(arg1,arg2);
30343       CPLErr eclass = CPLGetLastErrorType();
30344       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
30345         do_confess( CPLGetLastErrorMsg(), 0 );
30346 
30347 
30348 
30349 
30350 
30351       }
30352 
30353 
30354       /*
30355           Make warnings regular Perl warnings. This duplicates the warning
30356           message if DontUseExceptions() is in effect (it is not by default).
30357           */
30358       if ( eclass == CE_Warning ) {
30359         warn( CPLGetLastErrorMsg(), "%s" );
30360       }
30361 
30362 
30363     }
30364     {
30365       /* %typemap(out) void */
30366     }
30367 
30368 
30369     XSRETURN(argvi);
30370   fail:
30371 
30372 
30373     SWIG_croak_null();
30374   }
30375 }
30376 
30377 
XS(_wrap_RasterAttributeTable__CreateColumn)30378 XS(_wrap_RasterAttributeTable__CreateColumn) {
30379   {
30380     GDALRasterAttributeTableShadow *arg1 = (GDALRasterAttributeTableShadow *) 0 ;
30381     char *arg2 = (char *) 0 ;
30382     GDALRATFieldType arg3 ;
30383     GDALRATFieldUsage arg4 ;
30384     void *argp1 = 0 ;
30385     int res1 = 0 ;
30386     int res2 ;
30387     char *buf2 = 0 ;
30388     int alloc2 = 0 ;
30389     int val3 ;
30390     int ecode3 = 0 ;
30391     int val4 ;
30392     int ecode4 = 0 ;
30393     int argvi = 0;
30394     int result;
30395     dXSARGS;
30396 
30397     if ((items < 4) || (items > 4)) {
30398       SWIG_croak("Usage: RasterAttributeTable__CreateColumn(self,pszName,eType,eUsage);");
30399     }
30400     res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_GDALRasterAttributeTableShadow, 0 |  0 );
30401     if (!SWIG_IsOK(res1)) {
30402       SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "RasterAttributeTable__CreateColumn" "', argument " "1"" of type '" "GDALRasterAttributeTableShadow *""'");
30403     }
30404     arg1 = reinterpret_cast< GDALRasterAttributeTableShadow * >(argp1);
30405     res2 = SWIG_AsCharPtrAndSize(ST(1), &buf2, NULL, &alloc2);
30406     if (!SWIG_IsOK(res2)) {
30407       SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "RasterAttributeTable__CreateColumn" "', argument " "2"" of type '" "char const *""'");
30408     }
30409     arg2 = reinterpret_cast< char * >(buf2);
30410     ecode3 = SWIG_AsVal_int SWIG_PERL_CALL_ARGS_2(ST(2), &val3);
30411     if (!SWIG_IsOK(ecode3)) {
30412       SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "RasterAttributeTable__CreateColumn" "', argument " "3"" of type '" "GDALRATFieldType""'");
30413     }
30414     arg3 = static_cast< GDALRATFieldType >(val3);
30415     ecode4 = SWIG_AsVal_int SWIG_PERL_CALL_ARGS_2(ST(3), &val4);
30416     if (!SWIG_IsOK(ecode4)) {
30417       SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "RasterAttributeTable__CreateColumn" "', argument " "4"" of type '" "GDALRATFieldUsage""'");
30418     }
30419     arg4 = static_cast< GDALRATFieldUsage >(val4);
30420     {
30421       CPLErrorReset();
30422       result = (int)GDALRasterAttributeTableShadow_CreateColumn(arg1,(char const *)arg2,arg3,arg4);
30423       CPLErr eclass = CPLGetLastErrorType();
30424       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
30425         do_confess( CPLGetLastErrorMsg(), 0 );
30426 
30427 
30428 
30429 
30430 
30431       }
30432 
30433 
30434       /*
30435           Make warnings regular Perl warnings. This duplicates the warning
30436           message if DontUseExceptions() is in effect (it is not by default).
30437           */
30438       if ( eclass == CE_Warning ) {
30439         warn( CPLGetLastErrorMsg(), "%s" );
30440       }
30441 
30442 
30443     }
30444     ST(argvi) = SWIG_From_int  SWIG_PERL_CALL_ARGS_1(static_cast< int >(result)); argvi++ ;
30445 
30446     if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
30447 
30448 
30449     XSRETURN(argvi);
30450   fail:
30451 
30452     if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
30453 
30454 
30455     SWIG_croak_null();
30456   }
30457 }
30458 
30459 
XS(_wrap_RasterAttributeTable_GetLinearBinning)30460 XS(_wrap_RasterAttributeTable_GetLinearBinning) {
30461   {
30462     GDALRasterAttributeTableShadow *arg1 = (GDALRasterAttributeTableShadow *) 0 ;
30463     double *arg2 = (double *) 0 ;
30464     double *arg3 = (double *) 0 ;
30465     void *argp1 = 0 ;
30466     int res1 = 0 ;
30467     double temp2 ;
30468     int res2 = SWIG_TMPOBJ ;
30469     double temp3 ;
30470     int res3 = SWIG_TMPOBJ ;
30471     int argvi = 0;
30472     bool result;
30473     dXSARGS;
30474 
30475     arg2 = &temp2;
30476     arg3 = &temp3;
30477     if ((items < 1) || (items > 1)) {
30478       SWIG_croak("Usage: RasterAttributeTable_GetLinearBinning(self);");
30479     }
30480     res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_GDALRasterAttributeTableShadow, 0 |  0 );
30481     if (!SWIG_IsOK(res1)) {
30482       SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "RasterAttributeTable_GetLinearBinning" "', argument " "1"" of type '" "GDALRasterAttributeTableShadow *""'");
30483     }
30484     arg1 = reinterpret_cast< GDALRasterAttributeTableShadow * >(argp1);
30485     {
30486       CPLErrorReset();
30487       result = (bool)GDALRasterAttributeTableShadow_GetLinearBinning(arg1,arg2,arg3);
30488       CPLErr eclass = CPLGetLastErrorType();
30489       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
30490         do_confess( CPLGetLastErrorMsg(), 0 );
30491 
30492 
30493 
30494 
30495 
30496       }
30497 
30498 
30499       /*
30500           Make warnings regular Perl warnings. This duplicates the warning
30501           message if DontUseExceptions() is in effect (it is not by default).
30502           */
30503       if ( eclass == CE_Warning ) {
30504         warn( CPLGetLastErrorMsg(), "%s" );
30505       }
30506 
30507 
30508     }
30509     ST(argvi) = SWIG_From_bool  SWIG_PERL_CALL_ARGS_1(static_cast< bool >(result)); argvi++ ;
30510     if (SWIG_IsTmpObj(res2)) {
30511       if (argvi >= items) EXTEND(sp,1);  ST(argvi) = SWIG_From_double  SWIG_PERL_CALL_ARGS_1((*arg2)); argvi++  ;
30512     } else {
30513       int new_flags = SWIG_IsNewObj(res2) ? (SWIG_POINTER_OWN | 0) : 0;
30514       if (argvi >= items) EXTEND(sp,1);  ST(argvi) = SWIG_NewPointerObj((void*)(arg2), SWIGTYPE_p_double, new_flags); argvi++  ;
30515     }
30516     if (SWIG_IsTmpObj(res3)) {
30517       if (argvi >= items) EXTEND(sp,1);  ST(argvi) = SWIG_From_double  SWIG_PERL_CALL_ARGS_1((*arg3)); argvi++  ;
30518     } else {
30519       int new_flags = SWIG_IsNewObj(res3) ? (SWIG_POINTER_OWN | 0) : 0;
30520       if (argvi >= items) EXTEND(sp,1);  ST(argvi) = SWIG_NewPointerObj((void*)(arg3), SWIGTYPE_p_double, new_flags); argvi++  ;
30521     }
30522 
30523 
30524 
30525     XSRETURN(argvi);
30526   fail:
30527 
30528 
30529 
30530     SWIG_croak_null();
30531   }
30532 }
30533 
30534 
XS(_wrap_RasterAttributeTable_SetLinearBinning)30535 XS(_wrap_RasterAttributeTable_SetLinearBinning) {
30536   {
30537     GDALRasterAttributeTableShadow *arg1 = (GDALRasterAttributeTableShadow *) 0 ;
30538     double arg2 ;
30539     double arg3 ;
30540     void *argp1 = 0 ;
30541     int res1 = 0 ;
30542     double val2 ;
30543     int ecode2 = 0 ;
30544     double val3 ;
30545     int ecode3 = 0 ;
30546     int argvi = 0;
30547     int result;
30548     dXSARGS;
30549 
30550     if ((items < 3) || (items > 3)) {
30551       SWIG_croak("Usage: RasterAttributeTable_SetLinearBinning(self,dfRow0Min,dfBinSize);");
30552     }
30553     res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_GDALRasterAttributeTableShadow, 0 |  0 );
30554     if (!SWIG_IsOK(res1)) {
30555       SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "RasterAttributeTable_SetLinearBinning" "', argument " "1"" of type '" "GDALRasterAttributeTableShadow *""'");
30556     }
30557     arg1 = reinterpret_cast< GDALRasterAttributeTableShadow * >(argp1);
30558     ecode2 = SWIG_AsVal_double SWIG_PERL_CALL_ARGS_2(ST(1), &val2);
30559     if (!SWIG_IsOK(ecode2)) {
30560       SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "RasterAttributeTable_SetLinearBinning" "', argument " "2"" of type '" "double""'");
30561     }
30562     arg2 = static_cast< double >(val2);
30563     ecode3 = SWIG_AsVal_double SWIG_PERL_CALL_ARGS_2(ST(2), &val3);
30564     if (!SWIG_IsOK(ecode3)) {
30565       SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "RasterAttributeTable_SetLinearBinning" "', argument " "3"" of type '" "double""'");
30566     }
30567     arg3 = static_cast< double >(val3);
30568     {
30569       CPLErrorReset();
30570       result = (int)GDALRasterAttributeTableShadow_SetLinearBinning(arg1,arg2,arg3);
30571       CPLErr eclass = CPLGetLastErrorType();
30572       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
30573         do_confess( CPLGetLastErrorMsg(), 0 );
30574 
30575 
30576 
30577 
30578 
30579       }
30580 
30581 
30582       /*
30583           Make warnings regular Perl warnings. This duplicates the warning
30584           message if DontUseExceptions() is in effect (it is not by default).
30585           */
30586       if ( eclass == CE_Warning ) {
30587         warn( CPLGetLastErrorMsg(), "%s" );
30588       }
30589 
30590 
30591     }
30592     ST(argvi) = SWIG_From_int  SWIG_PERL_CALL_ARGS_1(static_cast< int >(result)); argvi++ ;
30593 
30594 
30595 
30596     XSRETURN(argvi);
30597   fail:
30598 
30599 
30600 
30601     SWIG_croak_null();
30602   }
30603 }
30604 
30605 
XS(_wrap_RasterAttributeTable_GetRowOfValue)30606 XS(_wrap_RasterAttributeTable_GetRowOfValue) {
30607   {
30608     GDALRasterAttributeTableShadow *arg1 = (GDALRasterAttributeTableShadow *) 0 ;
30609     double arg2 ;
30610     void *argp1 = 0 ;
30611     int res1 = 0 ;
30612     double val2 ;
30613     int ecode2 = 0 ;
30614     int argvi = 0;
30615     int result;
30616     dXSARGS;
30617 
30618     if ((items < 2) || (items > 2)) {
30619       SWIG_croak("Usage: RasterAttributeTable_GetRowOfValue(self,dfValue);");
30620     }
30621     res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_GDALRasterAttributeTableShadow, 0 |  0 );
30622     if (!SWIG_IsOK(res1)) {
30623       SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "RasterAttributeTable_GetRowOfValue" "', argument " "1"" of type '" "GDALRasterAttributeTableShadow *""'");
30624     }
30625     arg1 = reinterpret_cast< GDALRasterAttributeTableShadow * >(argp1);
30626     ecode2 = SWIG_AsVal_double SWIG_PERL_CALL_ARGS_2(ST(1), &val2);
30627     if (!SWIG_IsOK(ecode2)) {
30628       SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "RasterAttributeTable_GetRowOfValue" "', argument " "2"" of type '" "double""'");
30629     }
30630     arg2 = static_cast< double >(val2);
30631     {
30632       CPLErrorReset();
30633       result = (int)GDALRasterAttributeTableShadow_GetRowOfValue(arg1,arg2);
30634       CPLErr eclass = CPLGetLastErrorType();
30635       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
30636         do_confess( CPLGetLastErrorMsg(), 0 );
30637 
30638 
30639 
30640 
30641 
30642       }
30643 
30644 
30645       /*
30646           Make warnings regular Perl warnings. This duplicates the warning
30647           message if DontUseExceptions() is in effect (it is not by default).
30648           */
30649       if ( eclass == CE_Warning ) {
30650         warn( CPLGetLastErrorMsg(), "%s" );
30651       }
30652 
30653 
30654     }
30655     ST(argvi) = SWIG_From_int  SWIG_PERL_CALL_ARGS_1(static_cast< int >(result)); argvi++ ;
30656 
30657 
30658     XSRETURN(argvi);
30659   fail:
30660 
30661 
30662     SWIG_croak_null();
30663   }
30664 }
30665 
30666 
XS(_wrap_RasterAttributeTable_ChangesAreWrittenToFile)30667 XS(_wrap_RasterAttributeTable_ChangesAreWrittenToFile) {
30668   {
30669     GDALRasterAttributeTableShadow *arg1 = (GDALRasterAttributeTableShadow *) 0 ;
30670     void *argp1 = 0 ;
30671     int res1 = 0 ;
30672     int argvi = 0;
30673     int result;
30674     dXSARGS;
30675 
30676     if ((items < 1) || (items > 1)) {
30677       SWIG_croak("Usage: RasterAttributeTable_ChangesAreWrittenToFile(self);");
30678     }
30679     res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_GDALRasterAttributeTableShadow, 0 |  0 );
30680     if (!SWIG_IsOK(res1)) {
30681       SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "RasterAttributeTable_ChangesAreWrittenToFile" "', argument " "1"" of type '" "GDALRasterAttributeTableShadow *""'");
30682     }
30683     arg1 = reinterpret_cast< GDALRasterAttributeTableShadow * >(argp1);
30684     {
30685       CPLErrorReset();
30686       result = (int)GDALRasterAttributeTableShadow_ChangesAreWrittenToFile(arg1);
30687       CPLErr eclass = CPLGetLastErrorType();
30688       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
30689         do_confess( CPLGetLastErrorMsg(), 0 );
30690 
30691 
30692 
30693 
30694 
30695       }
30696 
30697 
30698       /*
30699           Make warnings regular Perl warnings. This duplicates the warning
30700           message if DontUseExceptions() is in effect (it is not by default).
30701           */
30702       if ( eclass == CE_Warning ) {
30703         warn( CPLGetLastErrorMsg(), "%s" );
30704       }
30705 
30706 
30707     }
30708     ST(argvi) = SWIG_From_int  SWIG_PERL_CALL_ARGS_1(static_cast< int >(result)); argvi++ ;
30709 
30710     XSRETURN(argvi);
30711   fail:
30712 
30713     SWIG_croak_null();
30714   }
30715 }
30716 
30717 
XS(_wrap_RasterAttributeTable_DumpReadable)30718 XS(_wrap_RasterAttributeTable_DumpReadable) {
30719   {
30720     GDALRasterAttributeTableShadow *arg1 = (GDALRasterAttributeTableShadow *) 0 ;
30721     void *argp1 = 0 ;
30722     int res1 = 0 ;
30723     int argvi = 0;
30724     dXSARGS;
30725 
30726     if ((items < 1) || (items > 1)) {
30727       SWIG_croak("Usage: RasterAttributeTable_DumpReadable(self);");
30728     }
30729     res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_GDALRasterAttributeTableShadow, 0 |  0 );
30730     if (!SWIG_IsOK(res1)) {
30731       SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "RasterAttributeTable_DumpReadable" "', argument " "1"" of type '" "GDALRasterAttributeTableShadow *""'");
30732     }
30733     arg1 = reinterpret_cast< GDALRasterAttributeTableShadow * >(argp1);
30734     {
30735       CPLErrorReset();
30736       GDALRasterAttributeTableShadow_DumpReadable(arg1);
30737       CPLErr eclass = CPLGetLastErrorType();
30738       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
30739         do_confess( CPLGetLastErrorMsg(), 0 );
30740 
30741 
30742 
30743 
30744 
30745       }
30746 
30747 
30748       /*
30749           Make warnings regular Perl warnings. This duplicates the warning
30750           message if DontUseExceptions() is in effect (it is not by default).
30751           */
30752       if ( eclass == CE_Warning ) {
30753         warn( CPLGetLastErrorMsg(), "%s" );
30754       }
30755 
30756 
30757     }
30758     {
30759       /* %typemap(out) void */
30760     }
30761 
30762     XSRETURN(argvi);
30763   fail:
30764 
30765     SWIG_croak_null();
30766   }
30767 }
30768 
30769 
XS(_wrap_RasterAttributeTable_SetTableType)30770 XS(_wrap_RasterAttributeTable_SetTableType) {
30771   {
30772     GDALRasterAttributeTableShadow *arg1 = (GDALRasterAttributeTableShadow *) 0 ;
30773     GDALRATTableType arg2 ;
30774     void *argp1 = 0 ;
30775     int res1 = 0 ;
30776     int val2 ;
30777     int ecode2 = 0 ;
30778     int argvi = 0;
30779     dXSARGS;
30780 
30781     if ((items < 2) || (items > 2)) {
30782       SWIG_croak("Usage: RasterAttributeTable_SetTableType(self,eTableType);");
30783     }
30784     res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_GDALRasterAttributeTableShadow, 0 |  0 );
30785     if (!SWIG_IsOK(res1)) {
30786       SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "RasterAttributeTable_SetTableType" "', argument " "1"" of type '" "GDALRasterAttributeTableShadow *""'");
30787     }
30788     arg1 = reinterpret_cast< GDALRasterAttributeTableShadow * >(argp1);
30789     ecode2 = SWIG_AsVal_int SWIG_PERL_CALL_ARGS_2(ST(1), &val2);
30790     if (!SWIG_IsOK(ecode2)) {
30791       SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "RasterAttributeTable_SetTableType" "', argument " "2"" of type '" "GDALRATTableType""'");
30792     }
30793     arg2 = static_cast< GDALRATTableType >(val2);
30794     {
30795       CPLErrorReset();
30796       GDALRasterAttributeTableShadow_SetTableType(arg1,arg2);
30797       CPLErr eclass = CPLGetLastErrorType();
30798       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
30799         do_confess( CPLGetLastErrorMsg(), 0 );
30800 
30801 
30802 
30803 
30804 
30805       }
30806 
30807 
30808       /*
30809           Make warnings regular Perl warnings. This duplicates the warning
30810           message if DontUseExceptions() is in effect (it is not by default).
30811           */
30812       if ( eclass == CE_Warning ) {
30813         warn( CPLGetLastErrorMsg(), "%s" );
30814       }
30815 
30816 
30817     }
30818     {
30819       /* %typemap(out) void */
30820     }
30821 
30822 
30823     XSRETURN(argvi);
30824   fail:
30825 
30826 
30827     SWIG_croak_null();
30828   }
30829 }
30830 
30831 
XS(_wrap_RasterAttributeTable_GetTableType)30832 XS(_wrap_RasterAttributeTable_GetTableType) {
30833   {
30834     GDALRasterAttributeTableShadow *arg1 = (GDALRasterAttributeTableShadow *) 0 ;
30835     void *argp1 = 0 ;
30836     int res1 = 0 ;
30837     int argvi = 0;
30838     GDALRATTableType result;
30839     dXSARGS;
30840 
30841     if ((items < 1) || (items > 1)) {
30842       SWIG_croak("Usage: RasterAttributeTable_GetTableType(self);");
30843     }
30844     res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_GDALRasterAttributeTableShadow, 0 |  0 );
30845     if (!SWIG_IsOK(res1)) {
30846       SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "RasterAttributeTable_GetTableType" "', argument " "1"" of type '" "GDALRasterAttributeTableShadow *""'");
30847     }
30848     arg1 = reinterpret_cast< GDALRasterAttributeTableShadow * >(argp1);
30849     {
30850       CPLErrorReset();
30851       result = (GDALRATTableType)GDALRasterAttributeTableShadow_GetTableType(arg1);
30852       CPLErr eclass = CPLGetLastErrorType();
30853       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
30854         do_confess( CPLGetLastErrorMsg(), 0 );
30855 
30856 
30857 
30858 
30859 
30860       }
30861 
30862 
30863       /*
30864           Make warnings regular Perl warnings. This duplicates the warning
30865           message if DontUseExceptions() is in effect (it is not by default).
30866           */
30867       if ( eclass == CE_Warning ) {
30868         warn( CPLGetLastErrorMsg(), "%s" );
30869       }
30870 
30871 
30872     }
30873     ST(argvi) = SWIG_From_int  SWIG_PERL_CALL_ARGS_1(static_cast< int >(result)); argvi++ ;
30874 
30875     XSRETURN(argvi);
30876   fail:
30877 
30878     SWIG_croak_null();
30879   }
30880 }
30881 
30882 
XS(_wrap_TermProgress_nocb)30883 XS(_wrap_TermProgress_nocb) {
30884   {
30885     double arg1 ;
30886     char *arg2 = (char *) NULL ;
30887     void *arg3 = (void *) NULL ;
30888     double val1 ;
30889     int ecode1 = 0 ;
30890     int res2 ;
30891     char *buf2 = 0 ;
30892     int alloc2 = 0 ;
30893     int res3 ;
30894     int argvi = 0;
30895     int result;
30896     dXSARGS;
30897 
30898     if ((items < 1) || (items > 3)) {
30899       SWIG_croak("Usage: TermProgress_nocb(dfProgress,pszMessage,pData);");
30900     }
30901     ecode1 = SWIG_AsVal_double SWIG_PERL_CALL_ARGS_2(ST(0), &val1);
30902     if (!SWIG_IsOK(ecode1)) {
30903       SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "TermProgress_nocb" "', argument " "1"" of type '" "double""'");
30904     }
30905     arg1 = static_cast< double >(val1);
30906     if (items > 1) {
30907       res2 = SWIG_AsCharPtrAndSize(ST(1), &buf2, NULL, &alloc2);
30908       if (!SWIG_IsOK(res2)) {
30909         SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "TermProgress_nocb" "', argument " "2"" of type '" "char const *""'");
30910       }
30911       arg2 = reinterpret_cast< char * >(buf2);
30912     }
30913     if (items > 2) {
30914       res3 = SWIG_ConvertPtr(ST(2),SWIG_as_voidptrptr(&arg3), 0, 0);
30915       if (!SWIG_IsOK(res3)) {
30916         SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "TermProgress_nocb" "', argument " "3"" of type '" "void *""'");
30917       }
30918     }
30919     {
30920       CPLErrorReset();
30921       result = (int)GDALTermProgress_nocb(arg1,(char const *)arg2,arg3);
30922       CPLErr eclass = CPLGetLastErrorType();
30923       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
30924         do_confess( CPLGetLastErrorMsg(), 0 );
30925 
30926 
30927 
30928 
30929 
30930       }
30931 
30932 
30933       /*
30934           Make warnings regular Perl warnings. This duplicates the warning
30935           message if DontUseExceptions() is in effect (it is not by default).
30936           */
30937       if ( eclass == CE_Warning ) {
30938         warn( CPLGetLastErrorMsg(), "%s" );
30939       }
30940 
30941 
30942     }
30943     ST(argvi) = SWIG_From_int  SWIG_PERL_CALL_ARGS_1(static_cast< int >(result)); argvi++ ;
30944 
30945     if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
30946 
30947     XSRETURN(argvi);
30948   fail:
30949 
30950     if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
30951 
30952     SWIG_croak_null();
30953   }
30954 }
30955 
30956 
XS(_wrap_ComputeMedianCutPCT)30957 XS(_wrap_ComputeMedianCutPCT) {
30958   {
30959     GDALRasterBandShadow *arg1 = (GDALRasterBandShadow *) 0 ;
30960     GDALRasterBandShadow *arg2 = (GDALRasterBandShadow *) 0 ;
30961     GDALRasterBandShadow *arg3 = (GDALRasterBandShadow *) 0 ;
30962     int arg4 ;
30963     GDALColorTableShadow *arg5 = (GDALColorTableShadow *) 0 ;
30964     GDALProgressFunc arg6 = (GDALProgressFunc) NULL ;
30965     void *arg7 = (void *) NULL ;
30966     void *argp1 = 0 ;
30967     int res1 = 0 ;
30968     void *argp2 = 0 ;
30969     int res2 = 0 ;
30970     void *argp3 = 0 ;
30971     int res3 = 0 ;
30972     int val4 ;
30973     int ecode4 = 0 ;
30974     void *argp5 = 0 ;
30975     int res5 = 0 ;
30976     int argvi = 0;
30977     int result;
30978     dXSARGS;
30979 
30980     /* %typemap(arginit, noblock=1) ( void* callback_data = NULL) */
30981     SavedEnv saved_env;
30982     saved_env.fct = NULL;
30983     saved_env.data = &PL_sv_undef;
30984     arg7 = (void *)(&saved_env);
30985     if ((items < 5) || (items > 7)) {
30986       SWIG_croak("Usage: ComputeMedianCutPCT(red,green,blue,num_colors,colors,callback,callback_data);");
30987     }
30988     res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_GDALRasterBandShadow, 0 |  0 );
30989     if (!SWIG_IsOK(res1)) {
30990       SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ComputeMedianCutPCT" "', argument " "1"" of type '" "GDALRasterBandShadow *""'");
30991     }
30992     arg1 = reinterpret_cast< GDALRasterBandShadow * >(argp1);
30993     res2 = SWIG_ConvertPtr(ST(1), &argp2,SWIGTYPE_p_GDALRasterBandShadow, 0 |  0 );
30994     if (!SWIG_IsOK(res2)) {
30995       SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "ComputeMedianCutPCT" "', argument " "2"" of type '" "GDALRasterBandShadow *""'");
30996     }
30997     arg2 = reinterpret_cast< GDALRasterBandShadow * >(argp2);
30998     res3 = SWIG_ConvertPtr(ST(2), &argp3,SWIGTYPE_p_GDALRasterBandShadow, 0 |  0 );
30999     if (!SWIG_IsOK(res3)) {
31000       SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "ComputeMedianCutPCT" "', argument " "3"" of type '" "GDALRasterBandShadow *""'");
31001     }
31002     arg3 = reinterpret_cast< GDALRasterBandShadow * >(argp3);
31003     ecode4 = SWIG_AsVal_int SWIG_PERL_CALL_ARGS_2(ST(3), &val4);
31004     if (!SWIG_IsOK(ecode4)) {
31005       SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "ComputeMedianCutPCT" "', argument " "4"" of type '" "int""'");
31006     }
31007     arg4 = static_cast< int >(val4);
31008     res5 = SWIG_ConvertPtr(ST(4), &argp5,SWIGTYPE_p_GDALColorTableShadow, 0 |  0 );
31009     if (!SWIG_IsOK(res5)) {
31010       SWIG_exception_fail(SWIG_ArgError(res5), "in method '" "ComputeMedianCutPCT" "', argument " "5"" of type '" "GDALColorTableShadow *""'");
31011     }
31012     arg5 = reinterpret_cast< GDALColorTableShadow * >(argp5);
31013     if (items > 5) {
31014       {
31015         /* %typemap(in) (GDALProgressFunc callback = NULL) */
31016         if (SvOK(ST(5))) {
31017           if (SvROK(ST(5))) {
31018             if (SvTYPE(SvRV(ST(5))) != SVt_PVCV) {
31019               do_confess(NEED_CODE_REF, 1);
31020             } else {
31021               saved_env.fct = (SV *)ST(5);
31022               arg6 = &callback_d_cp_vp;
31023             }
31024           } else {
31025             do_confess(NEED_CODE_REF, 1);
31026           }
31027         }
31028       }
31029     }
31030     if (items > 6) {
31031       {
31032         /* %typemap(in) (void* callback_data=NULL) */
31033         if (SvOK(ST(6)))
31034         saved_env.data = (SV *)ST(6);
31035       }
31036     }
31037     {
31038       if (!arg1) {
31039         SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
31040       }
31041     }
31042     {
31043       if (!arg2) {
31044         SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
31045       }
31046     }
31047     {
31048       if (!arg3) {
31049         SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
31050       }
31051     }
31052     {
31053       if (!arg5) {
31054         SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
31055       }
31056     }
31057     {
31058       CPLErrorReset();
31059       result = (int)ComputeMedianCutPCT(arg1,arg2,arg3,arg4,arg5,arg6,arg7);
31060       CPLErr eclass = CPLGetLastErrorType();
31061       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
31062         do_confess( CPLGetLastErrorMsg(), 0 );
31063 
31064 
31065 
31066 
31067 
31068       }
31069 
31070 
31071       /*
31072           Make warnings regular Perl warnings. This duplicates the warning
31073           message if DontUseExceptions() is in effect (it is not by default).
31074           */
31075       if ( eclass == CE_Warning ) {
31076         warn( CPLGetLastErrorMsg(), "%s" );
31077       }
31078 
31079 
31080     }
31081     ST(argvi) = SWIG_From_int  SWIG_PERL_CALL_ARGS_1(static_cast< int >(result)); argvi++ ;
31082 
31083 
31084 
31085 
31086 
31087 
31088     XSRETURN(argvi);
31089   fail:
31090 
31091 
31092 
31093 
31094 
31095 
31096     SWIG_croak_null();
31097   }
31098 }
31099 
31100 
XS(_wrap_DitherRGB2PCT)31101 XS(_wrap_DitherRGB2PCT) {
31102   {
31103     GDALRasterBandShadow *arg1 = (GDALRasterBandShadow *) 0 ;
31104     GDALRasterBandShadow *arg2 = (GDALRasterBandShadow *) 0 ;
31105     GDALRasterBandShadow *arg3 = (GDALRasterBandShadow *) 0 ;
31106     GDALRasterBandShadow *arg4 = (GDALRasterBandShadow *) 0 ;
31107     GDALColorTableShadow *arg5 = (GDALColorTableShadow *) 0 ;
31108     GDALProgressFunc arg6 = (GDALProgressFunc) NULL ;
31109     void *arg7 = (void *) NULL ;
31110     void *argp1 = 0 ;
31111     int res1 = 0 ;
31112     void *argp2 = 0 ;
31113     int res2 = 0 ;
31114     void *argp3 = 0 ;
31115     int res3 = 0 ;
31116     void *argp4 = 0 ;
31117     int res4 = 0 ;
31118     void *argp5 = 0 ;
31119     int res5 = 0 ;
31120     int argvi = 0;
31121     int result;
31122     dXSARGS;
31123 
31124     /* %typemap(arginit, noblock=1) ( void* callback_data = NULL) */
31125     SavedEnv saved_env;
31126     saved_env.fct = NULL;
31127     saved_env.data = &PL_sv_undef;
31128     arg7 = (void *)(&saved_env);
31129     if ((items < 5) || (items > 7)) {
31130       SWIG_croak("Usage: DitherRGB2PCT(red,green,blue,target,colors,callback,callback_data);");
31131     }
31132     res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_GDALRasterBandShadow, 0 |  0 );
31133     if (!SWIG_IsOK(res1)) {
31134       SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DitherRGB2PCT" "', argument " "1"" of type '" "GDALRasterBandShadow *""'");
31135     }
31136     arg1 = reinterpret_cast< GDALRasterBandShadow * >(argp1);
31137     res2 = SWIG_ConvertPtr(ST(1), &argp2,SWIGTYPE_p_GDALRasterBandShadow, 0 |  0 );
31138     if (!SWIG_IsOK(res2)) {
31139       SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "DitherRGB2PCT" "', argument " "2"" of type '" "GDALRasterBandShadow *""'");
31140     }
31141     arg2 = reinterpret_cast< GDALRasterBandShadow * >(argp2);
31142     res3 = SWIG_ConvertPtr(ST(2), &argp3,SWIGTYPE_p_GDALRasterBandShadow, 0 |  0 );
31143     if (!SWIG_IsOK(res3)) {
31144       SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "DitherRGB2PCT" "', argument " "3"" of type '" "GDALRasterBandShadow *""'");
31145     }
31146     arg3 = reinterpret_cast< GDALRasterBandShadow * >(argp3);
31147     res4 = SWIG_ConvertPtr(ST(3), &argp4,SWIGTYPE_p_GDALRasterBandShadow, 0 |  0 );
31148     if (!SWIG_IsOK(res4)) {
31149       SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "DitherRGB2PCT" "', argument " "4"" of type '" "GDALRasterBandShadow *""'");
31150     }
31151     arg4 = reinterpret_cast< GDALRasterBandShadow * >(argp4);
31152     res5 = SWIG_ConvertPtr(ST(4), &argp5,SWIGTYPE_p_GDALColorTableShadow, 0 |  0 );
31153     if (!SWIG_IsOK(res5)) {
31154       SWIG_exception_fail(SWIG_ArgError(res5), "in method '" "DitherRGB2PCT" "', argument " "5"" of type '" "GDALColorTableShadow *""'");
31155     }
31156     arg5 = reinterpret_cast< GDALColorTableShadow * >(argp5);
31157     if (items > 5) {
31158       {
31159         /* %typemap(in) (GDALProgressFunc callback = NULL) */
31160         if (SvOK(ST(5))) {
31161           if (SvROK(ST(5))) {
31162             if (SvTYPE(SvRV(ST(5))) != SVt_PVCV) {
31163               do_confess(NEED_CODE_REF, 1);
31164             } else {
31165               saved_env.fct = (SV *)ST(5);
31166               arg6 = &callback_d_cp_vp;
31167             }
31168           } else {
31169             do_confess(NEED_CODE_REF, 1);
31170           }
31171         }
31172       }
31173     }
31174     if (items > 6) {
31175       {
31176         /* %typemap(in) (void* callback_data=NULL) */
31177         if (SvOK(ST(6)))
31178         saved_env.data = (SV *)ST(6);
31179       }
31180     }
31181     {
31182       if (!arg1) {
31183         SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
31184       }
31185     }
31186     {
31187       if (!arg2) {
31188         SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
31189       }
31190     }
31191     {
31192       if (!arg3) {
31193         SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
31194       }
31195     }
31196     {
31197       if (!arg4) {
31198         SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
31199       }
31200     }
31201     {
31202       if (!arg5) {
31203         SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
31204       }
31205     }
31206     {
31207       CPLErrorReset();
31208       result = (int)DitherRGB2PCT(arg1,arg2,arg3,arg4,arg5,arg6,arg7);
31209       CPLErr eclass = CPLGetLastErrorType();
31210       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
31211         do_confess( CPLGetLastErrorMsg(), 0 );
31212 
31213 
31214 
31215 
31216 
31217       }
31218 
31219 
31220       /*
31221           Make warnings regular Perl warnings. This duplicates the warning
31222           message if DontUseExceptions() is in effect (it is not by default).
31223           */
31224       if ( eclass == CE_Warning ) {
31225         warn( CPLGetLastErrorMsg(), "%s" );
31226       }
31227 
31228 
31229     }
31230     ST(argvi) = SWIG_From_int  SWIG_PERL_CALL_ARGS_1(static_cast< int >(result)); argvi++ ;
31231 
31232 
31233 
31234 
31235 
31236 
31237     XSRETURN(argvi);
31238   fail:
31239 
31240 
31241 
31242 
31243 
31244 
31245     SWIG_croak_null();
31246   }
31247 }
31248 
31249 
XS(_wrap__ReprojectImage)31250 XS(_wrap__ReprojectImage) {
31251   {
31252     GDALDatasetShadow *arg1 = (GDALDatasetShadow *) 0 ;
31253     GDALDatasetShadow *arg2 = (GDALDatasetShadow *) 0 ;
31254     char *arg3 = (char *) NULL ;
31255     char *arg4 = (char *) NULL ;
31256     GDALResampleAlg arg5 = (GDALResampleAlg) GRA_NearestNeighbour ;
31257     double arg6 = (double) 0.0 ;
31258     double arg7 = (double) 0.0 ;
31259     GDALProgressFunc arg8 = (GDALProgressFunc) NULL ;
31260     void *arg9 = (void *) NULL ;
31261     char **arg10 = (char **) NULL ;
31262     int res3 ;
31263     char *buf3 = 0 ;
31264     int alloc3 = 0 ;
31265     int res4 ;
31266     char *buf4 = 0 ;
31267     int alloc4 = 0 ;
31268     int val5 ;
31269     int ecode5 = 0 ;
31270     double val6 ;
31271     int ecode6 = 0 ;
31272     double val7 ;
31273     int ecode7 = 0 ;
31274     int argvi = 0;
31275     CPLErr result;
31276     dXSARGS;
31277 
31278     /* %typemap(arginit, noblock=1) ( void* callback_data = NULL) */
31279     SavedEnv saved_env;
31280     saved_env.fct = NULL;
31281     saved_env.data = &PL_sv_undef;
31282     arg9 = (void *)(&saved_env);
31283     if ((items < 2) || (items > 10)) {
31284       SWIG_croak("Usage: _ReprojectImage(src_ds,dst_ds,src_wkt,dst_wkt,eResampleAlg,WarpMemoryLimit,maxerror,callback,callback_data,options);");
31285     }
31286     {
31287       /* %typemap(in) (GDALDatasetShadow *) */
31288       void *argp = 0;
31289       int res = SWIG_ConvertPtr(ST(0), &argp, SWIGTYPE_p_GDALDatasetShadow, 0 |  0 );
31290       if (!SWIG_IsOK(res)) {
31291         do_confess(WRONG_CLASS, 1);
31292       }
31293       arg1 = reinterpret_cast< GDALDatasetShadow * >(argp);
31294       if (arg1 == NULL)
31295       do_confess(NEED_DEF, 1);
31296     }
31297     {
31298       /* %typemap(in) (GDALDatasetShadow *) */
31299       void *argp = 0;
31300       int res = SWIG_ConvertPtr(ST(1), &argp, SWIGTYPE_p_GDALDatasetShadow, 0 |  0 );
31301       if (!SWIG_IsOK(res)) {
31302         do_confess(WRONG_CLASS, 1);
31303       }
31304       arg2 = reinterpret_cast< GDALDatasetShadow * >(argp);
31305       if (arg2 == NULL)
31306       do_confess(NEED_DEF, 1);
31307     }
31308     if (items > 2) {
31309       res3 = SWIG_AsCharPtrAndSize(ST(2), &buf3, NULL, &alloc3);
31310       if (!SWIG_IsOK(res3)) {
31311         SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "_ReprojectImage" "', argument " "3"" of type '" "char const *""'");
31312       }
31313       arg3 = reinterpret_cast< char * >(buf3);
31314     }
31315     if (items > 3) {
31316       res4 = SWIG_AsCharPtrAndSize(ST(3), &buf4, NULL, &alloc4);
31317       if (!SWIG_IsOK(res4)) {
31318         SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "_ReprojectImage" "', argument " "4"" of type '" "char const *""'");
31319       }
31320       arg4 = reinterpret_cast< char * >(buf4);
31321     }
31322     if (items > 4) {
31323       ecode5 = SWIG_AsVal_int SWIG_PERL_CALL_ARGS_2(ST(4), &val5);
31324       if (!SWIG_IsOK(ecode5)) {
31325         SWIG_exception_fail(SWIG_ArgError(ecode5), "in method '" "_ReprojectImage" "', argument " "5"" of type '" "GDALResampleAlg""'");
31326       }
31327       arg5 = static_cast< GDALResampleAlg >(val5);
31328     }
31329     if (items > 5) {
31330       ecode6 = SWIG_AsVal_double SWIG_PERL_CALL_ARGS_2(ST(5), &val6);
31331       if (!SWIG_IsOK(ecode6)) {
31332         SWIG_exception_fail(SWIG_ArgError(ecode6), "in method '" "_ReprojectImage" "', argument " "6"" of type '" "double""'");
31333       }
31334       arg6 = static_cast< double >(val6);
31335     }
31336     if (items > 6) {
31337       ecode7 = SWIG_AsVal_double SWIG_PERL_CALL_ARGS_2(ST(6), &val7);
31338       if (!SWIG_IsOK(ecode7)) {
31339         SWIG_exception_fail(SWIG_ArgError(ecode7), "in method '" "_ReprojectImage" "', argument " "7"" of type '" "double""'");
31340       }
31341       arg7 = static_cast< double >(val7);
31342     }
31343     if (items > 7) {
31344       {
31345         /* %typemap(in) (GDALProgressFunc callback = NULL) */
31346         if (SvOK(ST(7))) {
31347           if (SvROK(ST(7))) {
31348             if (SvTYPE(SvRV(ST(7))) != SVt_PVCV) {
31349               do_confess(NEED_CODE_REF, 1);
31350             } else {
31351               saved_env.fct = (SV *)ST(7);
31352               arg8 = &callback_d_cp_vp;
31353             }
31354           } else {
31355             do_confess(NEED_CODE_REF, 1);
31356           }
31357         }
31358       }
31359     }
31360     if (items > 8) {
31361       {
31362         /* %typemap(in) (void* callback_data=NULL) */
31363         if (SvOK(ST(8)))
31364         saved_env.data = (SV *)ST(8);
31365       }
31366     }
31367     if (items > 9) {
31368       {
31369         /* %typemap(in) char **options */
31370         if (SvOK(ST(9))) {
31371           if (SvROK(ST(9))) {
31372             if (SvTYPE(SvRV(ST(9)))==SVt_PVAV) {
31373               AV *av = (AV*)(SvRV(ST(9)));
31374               for (int i = 0; i < av_len(av)+1; i++) {
31375                 SV *sv = *(av_fetch(av, i, 0));
31376                 bool sf;
31377                 char *tmp = sv_to_utf8_string(sv, NULL, &sf);
31378                 arg10 = CSLAddString(arg10, tmp);
31379                 if (sf) Safefree(tmp); else free(tmp);
31380               }
31381             } else if (SvTYPE(SvRV(ST(9)))==SVt_PVHV) {
31382               HV *hv = (HV*)SvRV(ST(9));
31383               SV *sv;
31384               char *key;
31385               I32 klen;
31386               arg10 = NULL;
31387               hv_iterinit(hv);
31388               while(sv = hv_iternextsv(hv, &key, &klen)) {
31389                 bool sf;
31390                 char *tmp = sv_to_utf8_string(sv, NULL, &sf);
31391                 arg10 = CSLAddNameValue(arg10, key, tmp);
31392                 if (sf) Safefree(tmp); else free(tmp);
31393               }
31394             } else
31395             do_confess(NEED_REF, 1);
31396           } else
31397           do_confess(NEED_REF, 1);
31398         }
31399       }
31400     }
31401     {
31402       if (!arg1) {
31403         SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
31404       }
31405     }
31406     {
31407       if (!arg2) {
31408         SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
31409       }
31410     }
31411     {
31412       CPLErrorReset();
31413       result = (CPLErr)ReprojectImage(arg1,arg2,(char const *)arg3,(char const *)arg4,arg5,arg6,arg7,arg8,arg9,arg10);
31414       CPLErr eclass = CPLGetLastErrorType();
31415       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
31416         do_confess( CPLGetLastErrorMsg(), 0 );
31417 
31418 
31419 
31420 
31421 
31422       }
31423 
31424 
31425       /*
31426           Make warnings regular Perl warnings. This duplicates the warning
31427           message if DontUseExceptions() is in effect (it is not by default).
31428           */
31429       if ( eclass == CE_Warning ) {
31430         warn( CPLGetLastErrorMsg(), "%s" );
31431       }
31432 
31433 
31434     }
31435     ST(argvi) = SWIG_From_int  SWIG_PERL_CALL_ARGS_1(static_cast< int >(result)); argvi++ ;
31436 
31437 
31438     if (alloc3 == SWIG_NEWOBJ) delete[] buf3;
31439     if (alloc4 == SWIG_NEWOBJ) delete[] buf4;
31440 
31441 
31442 
31443 
31444     {
31445       /* %typemap(freearg) char **options */
31446       if (arg10) CSLDestroy( arg10 );
31447     }
31448     XSRETURN(argvi);
31449   fail:
31450 
31451 
31452     if (alloc3 == SWIG_NEWOBJ) delete[] buf3;
31453     if (alloc4 == SWIG_NEWOBJ) delete[] buf4;
31454 
31455 
31456 
31457 
31458     {
31459       /* %typemap(freearg) char **options */
31460       if (arg10) CSLDestroy( arg10 );
31461     }
31462     SWIG_croak_null();
31463   }
31464 }
31465 
31466 
XS(_wrap_ComputeProximity)31467 XS(_wrap_ComputeProximity) {
31468   {
31469     GDALRasterBandShadow *arg1 = (GDALRasterBandShadow *) 0 ;
31470     GDALRasterBandShadow *arg2 = (GDALRasterBandShadow *) 0 ;
31471     char **arg3 = (char **) NULL ;
31472     GDALProgressFunc arg4 = (GDALProgressFunc) NULL ;
31473     void *arg5 = (void *) NULL ;
31474     void *argp1 = 0 ;
31475     int res1 = 0 ;
31476     void *argp2 = 0 ;
31477     int res2 = 0 ;
31478     int argvi = 0;
31479     int result;
31480     dXSARGS;
31481 
31482     /* %typemap(arginit, noblock=1) ( void* callback_data = NULL) */
31483     SavedEnv saved_env;
31484     saved_env.fct = NULL;
31485     saved_env.data = &PL_sv_undef;
31486     arg5 = (void *)(&saved_env);
31487     if ((items < 2) || (items > 5)) {
31488       SWIG_croak("Usage: ComputeProximity(srcBand,proximityBand,options,callback,callback_data);");
31489     }
31490     res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_GDALRasterBandShadow, 0 |  0 );
31491     if (!SWIG_IsOK(res1)) {
31492       SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ComputeProximity" "', argument " "1"" of type '" "GDALRasterBandShadow *""'");
31493     }
31494     arg1 = reinterpret_cast< GDALRasterBandShadow * >(argp1);
31495     res2 = SWIG_ConvertPtr(ST(1), &argp2,SWIGTYPE_p_GDALRasterBandShadow, 0 |  0 );
31496     if (!SWIG_IsOK(res2)) {
31497       SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "ComputeProximity" "', argument " "2"" of type '" "GDALRasterBandShadow *""'");
31498     }
31499     arg2 = reinterpret_cast< GDALRasterBandShadow * >(argp2);
31500     if (items > 2) {
31501       {
31502         /* %typemap(in) char **options */
31503         if (SvOK(ST(2))) {
31504           if (SvROK(ST(2))) {
31505             if (SvTYPE(SvRV(ST(2)))==SVt_PVAV) {
31506               AV *av = (AV*)(SvRV(ST(2)));
31507               for (int i = 0; i < av_len(av)+1; i++) {
31508                 SV *sv = *(av_fetch(av, i, 0));
31509                 bool sf;
31510                 char *tmp = sv_to_utf8_string(sv, NULL, &sf);
31511                 arg3 = CSLAddString(arg3, tmp);
31512                 if (sf) Safefree(tmp); else free(tmp);
31513               }
31514             } else if (SvTYPE(SvRV(ST(2)))==SVt_PVHV) {
31515               HV *hv = (HV*)SvRV(ST(2));
31516               SV *sv;
31517               char *key;
31518               I32 klen;
31519               arg3 = NULL;
31520               hv_iterinit(hv);
31521               while(sv = hv_iternextsv(hv, &key, &klen)) {
31522                 bool sf;
31523                 char *tmp = sv_to_utf8_string(sv, NULL, &sf);
31524                 arg3 = CSLAddNameValue(arg3, key, tmp);
31525                 if (sf) Safefree(tmp); else free(tmp);
31526               }
31527             } else
31528             do_confess(NEED_REF, 1);
31529           } else
31530           do_confess(NEED_REF, 1);
31531         }
31532       }
31533     }
31534     if (items > 3) {
31535       {
31536         /* %typemap(in) (GDALProgressFunc callback = NULL) */
31537         if (SvOK(ST(3))) {
31538           if (SvROK(ST(3))) {
31539             if (SvTYPE(SvRV(ST(3))) != SVt_PVCV) {
31540               do_confess(NEED_CODE_REF, 1);
31541             } else {
31542               saved_env.fct = (SV *)ST(3);
31543               arg4 = &callback_d_cp_vp;
31544             }
31545           } else {
31546             do_confess(NEED_CODE_REF, 1);
31547           }
31548         }
31549       }
31550     }
31551     if (items > 4) {
31552       {
31553         /* %typemap(in) (void* callback_data=NULL) */
31554         if (SvOK(ST(4)))
31555         saved_env.data = (SV *)ST(4);
31556       }
31557     }
31558     {
31559       if (!arg1) {
31560         SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
31561       }
31562     }
31563     {
31564       if (!arg2) {
31565         SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
31566       }
31567     }
31568     {
31569       CPLErrorReset();
31570       result = (int)ComputeProximity(arg1,arg2,arg3,arg4,arg5);
31571       CPLErr eclass = CPLGetLastErrorType();
31572       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
31573         do_confess( CPLGetLastErrorMsg(), 0 );
31574 
31575 
31576 
31577 
31578 
31579       }
31580 
31581 
31582       /*
31583           Make warnings regular Perl warnings. This duplicates the warning
31584           message if DontUseExceptions() is in effect (it is not by default).
31585           */
31586       if ( eclass == CE_Warning ) {
31587         warn( CPLGetLastErrorMsg(), "%s" );
31588       }
31589 
31590 
31591     }
31592     ST(argvi) = SWIG_From_int  SWIG_PERL_CALL_ARGS_1(static_cast< int >(result)); argvi++ ;
31593 
31594 
31595     {
31596       /* %typemap(freearg) char **options */
31597       if (arg3) CSLDestroy( arg3 );
31598     }
31599 
31600     XSRETURN(argvi);
31601   fail:
31602 
31603 
31604     {
31605       /* %typemap(freearg) char **options */
31606       if (arg3) CSLDestroy( arg3 );
31607     }
31608 
31609     SWIG_croak_null();
31610   }
31611 }
31612 
31613 
XS(_wrap_RasterizeLayer)31614 XS(_wrap_RasterizeLayer) {
31615   {
31616     GDALDatasetShadow *arg1 = (GDALDatasetShadow *) 0 ;
31617     int arg2 ;
31618     int *arg3 = (int *) 0 ;
31619     OGRLayerShadow *arg4 = (OGRLayerShadow *) 0 ;
31620     void *arg5 = (void *) NULL ;
31621     void *arg6 = (void *) NULL ;
31622     int arg7 = (int) 0 ;
31623     double *arg8 = (double *) NULL ;
31624     char **arg9 = (char **) NULL ;
31625     GDALProgressFunc arg10 = (GDALProgressFunc) NULL ;
31626     void *arg11 = (void *) NULL ;
31627     void *argp4 = 0 ;
31628     int res4 = 0 ;
31629     int res5 ;
31630     int res6 ;
31631     int argvi = 0;
31632     int result;
31633     dXSARGS;
31634 
31635     /* %typemap(arginit, noblock=1) ( void* callback_data = NULL) */
31636     SavedEnv saved_env;
31637     saved_env.fct = NULL;
31638     saved_env.data = &PL_sv_undef;
31639     arg11 = (void *)(&saved_env);
31640     if ((items < 3) || (items > 9)) {
31641       SWIG_croak("Usage: RasterizeLayer(dataset,bands,band_list,layer,pfnTransformer,pTransformArg,burn_values,burn_values_list,options,callback,callback_data);");
31642     }
31643     {
31644       /* %typemap(in) (GDALDatasetShadow *) */
31645       void *argp = 0;
31646       int res = SWIG_ConvertPtr(ST(0), &argp, SWIGTYPE_p_GDALDatasetShadow, 0 |  0 );
31647       if (!SWIG_IsOK(res)) {
31648         do_confess(WRONG_CLASS, 1);
31649       }
31650       arg1 = reinterpret_cast< GDALDatasetShadow * >(argp);
31651       if (arg1 == NULL)
31652       do_confess(NEED_DEF, 1);
31653     }
31654     {
31655       /* %typemap(in,numinputs=1) (int nList, int* pList) */
31656       if (!(SvROK(ST(1)) && (SvTYPE(SvRV(ST(1)))==SVt_PVAV)))
31657       do_confess(NEED_ARRAY_REF, 1);
31658       AV *av = (AV*)(SvRV(ST(1)));
31659       arg2 = av_len(av)+1;
31660       arg3 = (int*)CPLMalloc(arg2*sizeof(int));
31661       if (arg3) {
31662         for( int i = 0; i<arg2; i++ ) {
31663           SV **sv = av_fetch(av, i, 0);
31664           arg3[i] =  SvIV(*sv);
31665         }
31666       } else
31667       SWIG_fail;
31668     }
31669     res4 = SWIG_ConvertPtr(ST(2), &argp4,SWIGTYPE_p_OGRLayerShadow, 0 |  0 );
31670     if (!SWIG_IsOK(res4)) {
31671       SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "RasterizeLayer" "', argument " "4"" of type '" "OGRLayerShadow *""'");
31672     }
31673     arg4 = reinterpret_cast< OGRLayerShadow * >(argp4);
31674     if (items > 3) {
31675       res5 = SWIG_ConvertPtr(ST(3),SWIG_as_voidptrptr(&arg5), 0, 0);
31676       if (!SWIG_IsOK(res5)) {
31677         SWIG_exception_fail(SWIG_ArgError(res5), "in method '" "RasterizeLayer" "', argument " "5"" of type '" "void *""'");
31678       }
31679     }
31680     if (items > 4) {
31681       res6 = SWIG_ConvertPtr(ST(4),SWIG_as_voidptrptr(&arg6), 0, 0);
31682       if (!SWIG_IsOK(res6)) {
31683         SWIG_exception_fail(SWIG_ArgError(res6), "in method '" "RasterizeLayer" "', argument " "6"" of type '" "void *""'");
31684       }
31685     }
31686     if (items > 5) {
31687       {
31688         /* %typemap(in,numinputs=1) (int nList, double* pList) */
31689         if (!(SvROK(ST(5)) && (SvTYPE(SvRV(ST(5)))==SVt_PVAV)))
31690         do_confess(NEED_ARRAY_REF, 1);
31691         AV *av = (AV*)(SvRV(ST(5)));
31692         arg7 = av_len(av)+1;
31693         arg8 = (double*)CPLMalloc(arg7*sizeof(double));
31694         if (arg8) {
31695           for( int i = 0; i<arg7; i++ ) {
31696             SV **sv = av_fetch(av, i, 0);
31697             arg8[i] =  SvNV(*sv);
31698           }
31699         } else
31700         SWIG_fail;
31701       }
31702     }
31703     if (items > 6) {
31704       {
31705         /* %typemap(in) char **options */
31706         if (SvOK(ST(6))) {
31707           if (SvROK(ST(6))) {
31708             if (SvTYPE(SvRV(ST(6)))==SVt_PVAV) {
31709               AV *av = (AV*)(SvRV(ST(6)));
31710               for (int i = 0; i < av_len(av)+1; i++) {
31711                 SV *sv = *(av_fetch(av, i, 0));
31712                 bool sf;
31713                 char *tmp = sv_to_utf8_string(sv, NULL, &sf);
31714                 arg9 = CSLAddString(arg9, tmp);
31715                 if (sf) Safefree(tmp); else free(tmp);
31716               }
31717             } else if (SvTYPE(SvRV(ST(6)))==SVt_PVHV) {
31718               HV *hv = (HV*)SvRV(ST(6));
31719               SV *sv;
31720               char *key;
31721               I32 klen;
31722               arg9 = NULL;
31723               hv_iterinit(hv);
31724               while(sv = hv_iternextsv(hv, &key, &klen)) {
31725                 bool sf;
31726                 char *tmp = sv_to_utf8_string(sv, NULL, &sf);
31727                 arg9 = CSLAddNameValue(arg9, key, tmp);
31728                 if (sf) Safefree(tmp); else free(tmp);
31729               }
31730             } else
31731             do_confess(NEED_REF, 1);
31732           } else
31733           do_confess(NEED_REF, 1);
31734         }
31735       }
31736     }
31737     if (items > 7) {
31738       {
31739         /* %typemap(in) (GDALProgressFunc callback = NULL) */
31740         if (SvOK(ST(7))) {
31741           if (SvROK(ST(7))) {
31742             if (SvTYPE(SvRV(ST(7))) != SVt_PVCV) {
31743               do_confess(NEED_CODE_REF, 1);
31744             } else {
31745               saved_env.fct = (SV *)ST(7);
31746               arg10 = &callback_d_cp_vp;
31747             }
31748           } else {
31749             do_confess(NEED_CODE_REF, 1);
31750           }
31751         }
31752       }
31753     }
31754     if (items > 8) {
31755       {
31756         /* %typemap(in) (void* callback_data=NULL) */
31757         if (SvOK(ST(8)))
31758         saved_env.data = (SV *)ST(8);
31759       }
31760     }
31761     {
31762       if (!arg1) {
31763         SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
31764       }
31765     }
31766     {
31767       if (!arg4) {
31768         SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
31769       }
31770     }
31771     {
31772       CPLErrorReset();
31773       result = (int)RasterizeLayer(arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9,arg10,arg11);
31774       CPLErr eclass = CPLGetLastErrorType();
31775       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
31776         do_confess( CPLGetLastErrorMsg(), 0 );
31777 
31778 
31779 
31780 
31781 
31782       }
31783 
31784 
31785       /*
31786           Make warnings regular Perl warnings. This duplicates the warning
31787           message if DontUseExceptions() is in effect (it is not by default).
31788           */
31789       if ( eclass == CE_Warning ) {
31790         warn( CPLGetLastErrorMsg(), "%s" );
31791       }
31792 
31793 
31794     }
31795     ST(argvi) = SWIG_From_int  SWIG_PERL_CALL_ARGS_1(static_cast< int >(result)); argvi++ ;
31796 
31797     {
31798       /* %typemap(freearg) (int nList, int* pList) */
31799       CPLFree((void*) arg3);
31800     }
31801 
31802 
31803 
31804     {
31805       /* %typemap(freearg) (int nList, double* pList) */
31806       CPLFree((void*) arg8);
31807     }
31808     {
31809       /* %typemap(freearg) char **options */
31810       if (arg9) CSLDestroy( arg9 );
31811     }
31812 
31813     XSRETURN(argvi);
31814   fail:
31815 
31816     {
31817       /* %typemap(freearg) (int nList, int* pList) */
31818       CPLFree((void*) arg3);
31819     }
31820 
31821 
31822 
31823     {
31824       /* %typemap(freearg) (int nList, double* pList) */
31825       CPLFree((void*) arg8);
31826     }
31827     {
31828       /* %typemap(freearg) char **options */
31829       if (arg9) CSLDestroy( arg9 );
31830     }
31831 
31832     SWIG_croak_null();
31833   }
31834 }
31835 
31836 
XS(_wrap__Polygonize)31837 XS(_wrap__Polygonize) {
31838   {
31839     GDALRasterBandShadow *arg1 = (GDALRasterBandShadow *) 0 ;
31840     GDALRasterBandShadow *arg2 = (GDALRasterBandShadow *) 0 ;
31841     OGRLayerShadow *arg3 = (OGRLayerShadow *) 0 ;
31842     int arg4 ;
31843     char **arg5 = (char **) NULL ;
31844     GDALProgressFunc arg6 = (GDALProgressFunc) NULL ;
31845     void *arg7 = (void *) NULL ;
31846     void *argp1 = 0 ;
31847     int res1 = 0 ;
31848     void *argp2 = 0 ;
31849     int res2 = 0 ;
31850     void *argp3 = 0 ;
31851     int res3 = 0 ;
31852     int val4 ;
31853     int ecode4 = 0 ;
31854     int argvi = 0;
31855     int result;
31856     dXSARGS;
31857 
31858     /* %typemap(arginit, noblock=1) ( void* callback_data = NULL) */
31859     SavedEnv saved_env;
31860     saved_env.fct = NULL;
31861     saved_env.data = &PL_sv_undef;
31862     arg7 = (void *)(&saved_env);
31863     if ((items < 4) || (items > 7)) {
31864       SWIG_croak("Usage: _Polygonize(srcBand,maskBand,outLayer,iPixValField,options,callback,callback_data);");
31865     }
31866     res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_GDALRasterBandShadow, 0 |  0 );
31867     if (!SWIG_IsOK(res1)) {
31868       SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "_Polygonize" "', argument " "1"" of type '" "GDALRasterBandShadow *""'");
31869     }
31870     arg1 = reinterpret_cast< GDALRasterBandShadow * >(argp1);
31871     res2 = SWIG_ConvertPtr(ST(1), &argp2,SWIGTYPE_p_GDALRasterBandShadow, 0 |  0 );
31872     if (!SWIG_IsOK(res2)) {
31873       SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "_Polygonize" "', argument " "2"" of type '" "GDALRasterBandShadow *""'");
31874     }
31875     arg2 = reinterpret_cast< GDALRasterBandShadow * >(argp2);
31876     res3 = SWIG_ConvertPtr(ST(2), &argp3,SWIGTYPE_p_OGRLayerShadow, 0 |  0 );
31877     if (!SWIG_IsOK(res3)) {
31878       SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "_Polygonize" "', argument " "3"" of type '" "OGRLayerShadow *""'");
31879     }
31880     arg3 = reinterpret_cast< OGRLayerShadow * >(argp3);
31881     ecode4 = SWIG_AsVal_int SWIG_PERL_CALL_ARGS_2(ST(3), &val4);
31882     if (!SWIG_IsOK(ecode4)) {
31883       SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "_Polygonize" "', argument " "4"" of type '" "int""'");
31884     }
31885     arg4 = static_cast< int >(val4);
31886     if (items > 4) {
31887       {
31888         /* %typemap(in) char **options */
31889         if (SvOK(ST(4))) {
31890           if (SvROK(ST(4))) {
31891             if (SvTYPE(SvRV(ST(4)))==SVt_PVAV) {
31892               AV *av = (AV*)(SvRV(ST(4)));
31893               for (int i = 0; i < av_len(av)+1; i++) {
31894                 SV *sv = *(av_fetch(av, i, 0));
31895                 bool sf;
31896                 char *tmp = sv_to_utf8_string(sv, NULL, &sf);
31897                 arg5 = CSLAddString(arg5, tmp);
31898                 if (sf) Safefree(tmp); else free(tmp);
31899               }
31900             } else if (SvTYPE(SvRV(ST(4)))==SVt_PVHV) {
31901               HV *hv = (HV*)SvRV(ST(4));
31902               SV *sv;
31903               char *key;
31904               I32 klen;
31905               arg5 = NULL;
31906               hv_iterinit(hv);
31907               while(sv = hv_iternextsv(hv, &key, &klen)) {
31908                 bool sf;
31909                 char *tmp = sv_to_utf8_string(sv, NULL, &sf);
31910                 arg5 = CSLAddNameValue(arg5, key, tmp);
31911                 if (sf) Safefree(tmp); else free(tmp);
31912               }
31913             } else
31914             do_confess(NEED_REF, 1);
31915           } else
31916           do_confess(NEED_REF, 1);
31917         }
31918       }
31919     }
31920     if (items > 5) {
31921       {
31922         /* %typemap(in) (GDALProgressFunc callback = NULL) */
31923         if (SvOK(ST(5))) {
31924           if (SvROK(ST(5))) {
31925             if (SvTYPE(SvRV(ST(5))) != SVt_PVCV) {
31926               do_confess(NEED_CODE_REF, 1);
31927             } else {
31928               saved_env.fct = (SV *)ST(5);
31929               arg6 = &callback_d_cp_vp;
31930             }
31931           } else {
31932             do_confess(NEED_CODE_REF, 1);
31933           }
31934         }
31935       }
31936     }
31937     if (items > 6) {
31938       {
31939         /* %typemap(in) (void* callback_data=NULL) */
31940         if (SvOK(ST(6)))
31941         saved_env.data = (SV *)ST(6);
31942       }
31943     }
31944     {
31945       if (!arg1) {
31946         SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
31947       }
31948     }
31949     {
31950       if (!arg3) {
31951         SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
31952       }
31953     }
31954     {
31955       CPLErrorReset();
31956       result = (int)Polygonize(arg1,arg2,arg3,arg4,arg5,arg6,arg7);
31957       CPLErr eclass = CPLGetLastErrorType();
31958       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
31959         do_confess( CPLGetLastErrorMsg(), 0 );
31960 
31961 
31962 
31963 
31964 
31965       }
31966 
31967 
31968       /*
31969           Make warnings regular Perl warnings. This duplicates the warning
31970           message if DontUseExceptions() is in effect (it is not by default).
31971           */
31972       if ( eclass == CE_Warning ) {
31973         warn( CPLGetLastErrorMsg(), "%s" );
31974       }
31975 
31976 
31977     }
31978     ST(argvi) = SWIG_From_int  SWIG_PERL_CALL_ARGS_1(static_cast< int >(result)); argvi++ ;
31979 
31980 
31981 
31982 
31983     {
31984       /* %typemap(freearg) char **options */
31985       if (arg5) CSLDestroy( arg5 );
31986     }
31987 
31988     XSRETURN(argvi);
31989   fail:
31990 
31991 
31992 
31993 
31994     {
31995       /* %typemap(freearg) char **options */
31996       if (arg5) CSLDestroy( arg5 );
31997     }
31998 
31999     SWIG_croak_null();
32000   }
32001 }
32002 
32003 
XS(_wrap_FPolygonize)32004 XS(_wrap_FPolygonize) {
32005   {
32006     GDALRasterBandShadow *arg1 = (GDALRasterBandShadow *) 0 ;
32007     GDALRasterBandShadow *arg2 = (GDALRasterBandShadow *) 0 ;
32008     OGRLayerShadow *arg3 = (OGRLayerShadow *) 0 ;
32009     int arg4 ;
32010     char **arg5 = (char **) NULL ;
32011     GDALProgressFunc arg6 = (GDALProgressFunc) NULL ;
32012     void *arg7 = (void *) NULL ;
32013     void *argp1 = 0 ;
32014     int res1 = 0 ;
32015     void *argp2 = 0 ;
32016     int res2 = 0 ;
32017     void *argp3 = 0 ;
32018     int res3 = 0 ;
32019     int val4 ;
32020     int ecode4 = 0 ;
32021     int argvi = 0;
32022     int result;
32023     dXSARGS;
32024 
32025     /* %typemap(arginit, noblock=1) ( void* callback_data = NULL) */
32026     SavedEnv saved_env;
32027     saved_env.fct = NULL;
32028     saved_env.data = &PL_sv_undef;
32029     arg7 = (void *)(&saved_env);
32030     if ((items < 4) || (items > 7)) {
32031       SWIG_croak("Usage: FPolygonize(srcBand,maskBand,outLayer,iPixValField,options,callback,callback_data);");
32032     }
32033     res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_GDALRasterBandShadow, 0 |  0 );
32034     if (!SWIG_IsOK(res1)) {
32035       SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "FPolygonize" "', argument " "1"" of type '" "GDALRasterBandShadow *""'");
32036     }
32037     arg1 = reinterpret_cast< GDALRasterBandShadow * >(argp1);
32038     res2 = SWIG_ConvertPtr(ST(1), &argp2,SWIGTYPE_p_GDALRasterBandShadow, 0 |  0 );
32039     if (!SWIG_IsOK(res2)) {
32040       SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "FPolygonize" "', argument " "2"" of type '" "GDALRasterBandShadow *""'");
32041     }
32042     arg2 = reinterpret_cast< GDALRasterBandShadow * >(argp2);
32043     res3 = SWIG_ConvertPtr(ST(2), &argp3,SWIGTYPE_p_OGRLayerShadow, 0 |  0 );
32044     if (!SWIG_IsOK(res3)) {
32045       SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "FPolygonize" "', argument " "3"" of type '" "OGRLayerShadow *""'");
32046     }
32047     arg3 = reinterpret_cast< OGRLayerShadow * >(argp3);
32048     ecode4 = SWIG_AsVal_int SWIG_PERL_CALL_ARGS_2(ST(3), &val4);
32049     if (!SWIG_IsOK(ecode4)) {
32050       SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "FPolygonize" "', argument " "4"" of type '" "int""'");
32051     }
32052     arg4 = static_cast< int >(val4);
32053     if (items > 4) {
32054       {
32055         /* %typemap(in) char **options */
32056         if (SvOK(ST(4))) {
32057           if (SvROK(ST(4))) {
32058             if (SvTYPE(SvRV(ST(4)))==SVt_PVAV) {
32059               AV *av = (AV*)(SvRV(ST(4)));
32060               for (int i = 0; i < av_len(av)+1; i++) {
32061                 SV *sv = *(av_fetch(av, i, 0));
32062                 bool sf;
32063                 char *tmp = sv_to_utf8_string(sv, NULL, &sf);
32064                 arg5 = CSLAddString(arg5, tmp);
32065                 if (sf) Safefree(tmp); else free(tmp);
32066               }
32067             } else if (SvTYPE(SvRV(ST(4)))==SVt_PVHV) {
32068               HV *hv = (HV*)SvRV(ST(4));
32069               SV *sv;
32070               char *key;
32071               I32 klen;
32072               arg5 = NULL;
32073               hv_iterinit(hv);
32074               while(sv = hv_iternextsv(hv, &key, &klen)) {
32075                 bool sf;
32076                 char *tmp = sv_to_utf8_string(sv, NULL, &sf);
32077                 arg5 = CSLAddNameValue(arg5, key, tmp);
32078                 if (sf) Safefree(tmp); else free(tmp);
32079               }
32080             } else
32081             do_confess(NEED_REF, 1);
32082           } else
32083           do_confess(NEED_REF, 1);
32084         }
32085       }
32086     }
32087     if (items > 5) {
32088       {
32089         /* %typemap(in) (GDALProgressFunc callback = NULL) */
32090         if (SvOK(ST(5))) {
32091           if (SvROK(ST(5))) {
32092             if (SvTYPE(SvRV(ST(5))) != SVt_PVCV) {
32093               do_confess(NEED_CODE_REF, 1);
32094             } else {
32095               saved_env.fct = (SV *)ST(5);
32096               arg6 = &callback_d_cp_vp;
32097             }
32098           } else {
32099             do_confess(NEED_CODE_REF, 1);
32100           }
32101         }
32102       }
32103     }
32104     if (items > 6) {
32105       {
32106         /* %typemap(in) (void* callback_data=NULL) */
32107         if (SvOK(ST(6)))
32108         saved_env.data = (SV *)ST(6);
32109       }
32110     }
32111     {
32112       if (!arg1) {
32113         SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
32114       }
32115     }
32116     {
32117       if (!arg3) {
32118         SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
32119       }
32120     }
32121     {
32122       CPLErrorReset();
32123       result = (int)FPolygonize(arg1,arg2,arg3,arg4,arg5,arg6,arg7);
32124       CPLErr eclass = CPLGetLastErrorType();
32125       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
32126         do_confess( CPLGetLastErrorMsg(), 0 );
32127 
32128 
32129 
32130 
32131 
32132       }
32133 
32134 
32135       /*
32136           Make warnings regular Perl warnings. This duplicates the warning
32137           message if DontUseExceptions() is in effect (it is not by default).
32138           */
32139       if ( eclass == CE_Warning ) {
32140         warn( CPLGetLastErrorMsg(), "%s" );
32141       }
32142 
32143 
32144     }
32145     ST(argvi) = SWIG_From_int  SWIG_PERL_CALL_ARGS_1(static_cast< int >(result)); argvi++ ;
32146 
32147 
32148 
32149 
32150     {
32151       /* %typemap(freearg) char **options */
32152       if (arg5) CSLDestroy( arg5 );
32153     }
32154 
32155     XSRETURN(argvi);
32156   fail:
32157 
32158 
32159 
32160 
32161     {
32162       /* %typemap(freearg) char **options */
32163       if (arg5) CSLDestroy( arg5 );
32164     }
32165 
32166     SWIG_croak_null();
32167   }
32168 }
32169 
32170 
XS(_wrap_FillNodata)32171 XS(_wrap_FillNodata) {
32172   {
32173     GDALRasterBandShadow *arg1 = (GDALRasterBandShadow *) 0 ;
32174     GDALRasterBandShadow *arg2 = (GDALRasterBandShadow *) 0 ;
32175     double arg3 ;
32176     int arg4 ;
32177     char **arg5 = (char **) NULL ;
32178     GDALProgressFunc arg6 = (GDALProgressFunc) NULL ;
32179     void *arg7 = (void *) NULL ;
32180     void *argp1 = 0 ;
32181     int res1 = 0 ;
32182     void *argp2 = 0 ;
32183     int res2 = 0 ;
32184     double val3 ;
32185     int ecode3 = 0 ;
32186     int val4 ;
32187     int ecode4 = 0 ;
32188     int argvi = 0;
32189     int result;
32190     dXSARGS;
32191 
32192     /* %typemap(arginit, noblock=1) ( void* callback_data = NULL) */
32193     SavedEnv saved_env;
32194     saved_env.fct = NULL;
32195     saved_env.data = &PL_sv_undef;
32196     arg7 = (void *)(&saved_env);
32197     if ((items < 4) || (items > 7)) {
32198       SWIG_croak("Usage: FillNodata(targetBand,maskBand,maxSearchDist,smoothingIterations,options,callback,callback_data);");
32199     }
32200     res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_GDALRasterBandShadow, 0 |  0 );
32201     if (!SWIG_IsOK(res1)) {
32202       SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "FillNodata" "', argument " "1"" of type '" "GDALRasterBandShadow *""'");
32203     }
32204     arg1 = reinterpret_cast< GDALRasterBandShadow * >(argp1);
32205     res2 = SWIG_ConvertPtr(ST(1), &argp2,SWIGTYPE_p_GDALRasterBandShadow, 0 |  0 );
32206     if (!SWIG_IsOK(res2)) {
32207       SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "FillNodata" "', argument " "2"" of type '" "GDALRasterBandShadow *""'");
32208     }
32209     arg2 = reinterpret_cast< GDALRasterBandShadow * >(argp2);
32210     ecode3 = SWIG_AsVal_double SWIG_PERL_CALL_ARGS_2(ST(2), &val3);
32211     if (!SWIG_IsOK(ecode3)) {
32212       SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "FillNodata" "', argument " "3"" of type '" "double""'");
32213     }
32214     arg3 = static_cast< double >(val3);
32215     ecode4 = SWIG_AsVal_int SWIG_PERL_CALL_ARGS_2(ST(3), &val4);
32216     if (!SWIG_IsOK(ecode4)) {
32217       SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "FillNodata" "', argument " "4"" of type '" "int""'");
32218     }
32219     arg4 = static_cast< int >(val4);
32220     if (items > 4) {
32221       {
32222         /* %typemap(in) char **options */
32223         if (SvOK(ST(4))) {
32224           if (SvROK(ST(4))) {
32225             if (SvTYPE(SvRV(ST(4)))==SVt_PVAV) {
32226               AV *av = (AV*)(SvRV(ST(4)));
32227               for (int i = 0; i < av_len(av)+1; i++) {
32228                 SV *sv = *(av_fetch(av, i, 0));
32229                 bool sf;
32230                 char *tmp = sv_to_utf8_string(sv, NULL, &sf);
32231                 arg5 = CSLAddString(arg5, tmp);
32232                 if (sf) Safefree(tmp); else free(tmp);
32233               }
32234             } else if (SvTYPE(SvRV(ST(4)))==SVt_PVHV) {
32235               HV *hv = (HV*)SvRV(ST(4));
32236               SV *sv;
32237               char *key;
32238               I32 klen;
32239               arg5 = NULL;
32240               hv_iterinit(hv);
32241               while(sv = hv_iternextsv(hv, &key, &klen)) {
32242                 bool sf;
32243                 char *tmp = sv_to_utf8_string(sv, NULL, &sf);
32244                 arg5 = CSLAddNameValue(arg5, key, tmp);
32245                 if (sf) Safefree(tmp); else free(tmp);
32246               }
32247             } else
32248             do_confess(NEED_REF, 1);
32249           } else
32250           do_confess(NEED_REF, 1);
32251         }
32252       }
32253     }
32254     if (items > 5) {
32255       {
32256         /* %typemap(in) (GDALProgressFunc callback = NULL) */
32257         if (SvOK(ST(5))) {
32258           if (SvROK(ST(5))) {
32259             if (SvTYPE(SvRV(ST(5))) != SVt_PVCV) {
32260               do_confess(NEED_CODE_REF, 1);
32261             } else {
32262               saved_env.fct = (SV *)ST(5);
32263               arg6 = &callback_d_cp_vp;
32264             }
32265           } else {
32266             do_confess(NEED_CODE_REF, 1);
32267           }
32268         }
32269       }
32270     }
32271     if (items > 6) {
32272       {
32273         /* %typemap(in) (void* callback_data=NULL) */
32274         if (SvOK(ST(6)))
32275         saved_env.data = (SV *)ST(6);
32276       }
32277     }
32278     {
32279       if (!arg1) {
32280         SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
32281       }
32282     }
32283     {
32284       CPLErrorReset();
32285       result = (int)FillNodata(arg1,arg2,arg3,arg4,arg5,arg6,arg7);
32286       CPLErr eclass = CPLGetLastErrorType();
32287       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
32288         do_confess( CPLGetLastErrorMsg(), 0 );
32289 
32290 
32291 
32292 
32293 
32294       }
32295 
32296 
32297       /*
32298           Make warnings regular Perl warnings. This duplicates the warning
32299           message if DontUseExceptions() is in effect (it is not by default).
32300           */
32301       if ( eclass == CE_Warning ) {
32302         warn( CPLGetLastErrorMsg(), "%s" );
32303       }
32304 
32305 
32306     }
32307     ST(argvi) = SWIG_From_int  SWIG_PERL_CALL_ARGS_1(static_cast< int >(result)); argvi++ ;
32308 
32309 
32310 
32311 
32312     {
32313       /* %typemap(freearg) char **options */
32314       if (arg5) CSLDestroy( arg5 );
32315     }
32316 
32317     XSRETURN(argvi);
32318   fail:
32319 
32320 
32321 
32322 
32323     {
32324       /* %typemap(freearg) char **options */
32325       if (arg5) CSLDestroy( arg5 );
32326     }
32327 
32328     SWIG_croak_null();
32329   }
32330 }
32331 
32332 
XS(_wrap_SieveFilter)32333 XS(_wrap_SieveFilter) {
32334   {
32335     GDALRasterBandShadow *arg1 = (GDALRasterBandShadow *) 0 ;
32336     GDALRasterBandShadow *arg2 = (GDALRasterBandShadow *) 0 ;
32337     GDALRasterBandShadow *arg3 = (GDALRasterBandShadow *) 0 ;
32338     int arg4 ;
32339     int arg5 = (int) 4 ;
32340     char **arg6 = (char **) NULL ;
32341     GDALProgressFunc arg7 = (GDALProgressFunc) NULL ;
32342     void *arg8 = (void *) NULL ;
32343     void *argp1 = 0 ;
32344     int res1 = 0 ;
32345     void *argp2 = 0 ;
32346     int res2 = 0 ;
32347     void *argp3 = 0 ;
32348     int res3 = 0 ;
32349     int val4 ;
32350     int ecode4 = 0 ;
32351     int val5 ;
32352     int ecode5 = 0 ;
32353     int argvi = 0;
32354     int result;
32355     dXSARGS;
32356 
32357     /* %typemap(arginit, noblock=1) ( void* callback_data = NULL) */
32358     SavedEnv saved_env;
32359     saved_env.fct = NULL;
32360     saved_env.data = &PL_sv_undef;
32361     arg8 = (void *)(&saved_env);
32362     if ((items < 4) || (items > 8)) {
32363       SWIG_croak("Usage: SieveFilter(srcBand,maskBand,dstBand,threshold,connectedness,options,callback,callback_data);");
32364     }
32365     res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_GDALRasterBandShadow, 0 |  0 );
32366     if (!SWIG_IsOK(res1)) {
32367       SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SieveFilter" "', argument " "1"" of type '" "GDALRasterBandShadow *""'");
32368     }
32369     arg1 = reinterpret_cast< GDALRasterBandShadow * >(argp1);
32370     res2 = SWIG_ConvertPtr(ST(1), &argp2,SWIGTYPE_p_GDALRasterBandShadow, 0 |  0 );
32371     if (!SWIG_IsOK(res2)) {
32372       SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "SieveFilter" "', argument " "2"" of type '" "GDALRasterBandShadow *""'");
32373     }
32374     arg2 = reinterpret_cast< GDALRasterBandShadow * >(argp2);
32375     res3 = SWIG_ConvertPtr(ST(2), &argp3,SWIGTYPE_p_GDALRasterBandShadow, 0 |  0 );
32376     if (!SWIG_IsOK(res3)) {
32377       SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "SieveFilter" "', argument " "3"" of type '" "GDALRasterBandShadow *""'");
32378     }
32379     arg3 = reinterpret_cast< GDALRasterBandShadow * >(argp3);
32380     ecode4 = SWIG_AsVal_int SWIG_PERL_CALL_ARGS_2(ST(3), &val4);
32381     if (!SWIG_IsOK(ecode4)) {
32382       SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "SieveFilter" "', argument " "4"" of type '" "int""'");
32383     }
32384     arg4 = static_cast< int >(val4);
32385     if (items > 4) {
32386       ecode5 = SWIG_AsVal_int SWIG_PERL_CALL_ARGS_2(ST(4), &val5);
32387       if (!SWIG_IsOK(ecode5)) {
32388         SWIG_exception_fail(SWIG_ArgError(ecode5), "in method '" "SieveFilter" "', argument " "5"" of type '" "int""'");
32389       }
32390       arg5 = static_cast< int >(val5);
32391     }
32392     if (items > 5) {
32393       {
32394         /* %typemap(in) char **options */
32395         if (SvOK(ST(5))) {
32396           if (SvROK(ST(5))) {
32397             if (SvTYPE(SvRV(ST(5)))==SVt_PVAV) {
32398               AV *av = (AV*)(SvRV(ST(5)));
32399               for (int i = 0; i < av_len(av)+1; i++) {
32400                 SV *sv = *(av_fetch(av, i, 0));
32401                 bool sf;
32402                 char *tmp = sv_to_utf8_string(sv, NULL, &sf);
32403                 arg6 = CSLAddString(arg6, tmp);
32404                 if (sf) Safefree(tmp); else free(tmp);
32405               }
32406             } else if (SvTYPE(SvRV(ST(5)))==SVt_PVHV) {
32407               HV *hv = (HV*)SvRV(ST(5));
32408               SV *sv;
32409               char *key;
32410               I32 klen;
32411               arg6 = NULL;
32412               hv_iterinit(hv);
32413               while(sv = hv_iternextsv(hv, &key, &klen)) {
32414                 bool sf;
32415                 char *tmp = sv_to_utf8_string(sv, NULL, &sf);
32416                 arg6 = CSLAddNameValue(arg6, key, tmp);
32417                 if (sf) Safefree(tmp); else free(tmp);
32418               }
32419             } else
32420             do_confess(NEED_REF, 1);
32421           } else
32422           do_confess(NEED_REF, 1);
32423         }
32424       }
32425     }
32426     if (items > 6) {
32427       {
32428         /* %typemap(in) (GDALProgressFunc callback = NULL) */
32429         if (SvOK(ST(6))) {
32430           if (SvROK(ST(6))) {
32431             if (SvTYPE(SvRV(ST(6))) != SVt_PVCV) {
32432               do_confess(NEED_CODE_REF, 1);
32433             } else {
32434               saved_env.fct = (SV *)ST(6);
32435               arg7 = &callback_d_cp_vp;
32436             }
32437           } else {
32438             do_confess(NEED_CODE_REF, 1);
32439           }
32440         }
32441       }
32442     }
32443     if (items > 7) {
32444       {
32445         /* %typemap(in) (void* callback_data=NULL) */
32446         if (SvOK(ST(7)))
32447         saved_env.data = (SV *)ST(7);
32448       }
32449     }
32450     {
32451       if (!arg1) {
32452         SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
32453       }
32454     }
32455     {
32456       if (!arg3) {
32457         SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
32458       }
32459     }
32460     {
32461       CPLErrorReset();
32462       result = (int)SieveFilter(arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8);
32463       CPLErr eclass = CPLGetLastErrorType();
32464       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
32465         do_confess( CPLGetLastErrorMsg(), 0 );
32466 
32467 
32468 
32469 
32470 
32471       }
32472 
32473 
32474       /*
32475           Make warnings regular Perl warnings. This duplicates the warning
32476           message if DontUseExceptions() is in effect (it is not by default).
32477           */
32478       if ( eclass == CE_Warning ) {
32479         warn( CPLGetLastErrorMsg(), "%s" );
32480       }
32481 
32482 
32483     }
32484     ST(argvi) = SWIG_From_int  SWIG_PERL_CALL_ARGS_1(static_cast< int >(result)); argvi++ ;
32485 
32486 
32487 
32488 
32489 
32490     {
32491       /* %typemap(freearg) char **options */
32492       if (arg6) CSLDestroy( arg6 );
32493     }
32494 
32495     XSRETURN(argvi);
32496   fail:
32497 
32498 
32499 
32500 
32501 
32502     {
32503       /* %typemap(freearg) char **options */
32504       if (arg6) CSLDestroy( arg6 );
32505     }
32506 
32507     SWIG_croak_null();
32508   }
32509 }
32510 
32511 
XS(_wrap__RegenerateOverviews)32512 XS(_wrap__RegenerateOverviews) {
32513   {
32514     GDALRasterBandShadow *arg1 = (GDALRasterBandShadow *) 0 ;
32515     int arg2 ;
32516     GDALRasterBandShadow **arg3 = (GDALRasterBandShadow **) 0 ;
32517     char *arg4 = (char *) "average" ;
32518     GDALProgressFunc arg5 = (GDALProgressFunc) NULL ;
32519     void *arg6 = (void *) NULL ;
32520     void *argp1 = 0 ;
32521     int res1 = 0 ;
32522     int res4 ;
32523     char *buf4 = 0 ;
32524     int alloc4 = 0 ;
32525     int argvi = 0;
32526     int result;
32527     dXSARGS;
32528 
32529     /* %typemap(arginit, noblock=1) ( void* callback_data = NULL) */
32530     SavedEnv saved_env;
32531     saved_env.fct = NULL;
32532     saved_env.data = &PL_sv_undef;
32533     arg6 = (void *)(&saved_env);
32534     if ((items < 2) || (items > 5)) {
32535       SWIG_croak("Usage: _RegenerateOverviews(srcBand,overviewBandCount,overviewBands,resampling,callback,callback_data);");
32536     }
32537     res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_GDALRasterBandShadow, 0 |  0 );
32538     if (!SWIG_IsOK(res1)) {
32539       SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "_RegenerateOverviews" "', argument " "1"" of type '" "GDALRasterBandShadow *""'");
32540     }
32541     arg1 = reinterpret_cast< GDALRasterBandShadow * >(argp1);
32542     {
32543       /* %typemap(in,numinputs=1) (int object_list_count, GDALRasterBandShadow **poObjects) */
32544       if (!(SvROK(ST(1)) && (SvTYPE(SvRV(ST(1)))==SVt_PVAV)))
32545       do_confess(NEED_ARRAY_REF, 1);
32546       AV *av = (AV*)(SvRV(ST(1)));
32547       arg2 = av_len(av)+1;
32548       /* get the pointers from the array into bands */
32549       arg3 = (GDALRasterBandShadow **)CPLMalloc(arg2*sizeof(GDALRasterBandShadow *));
32550       if (arg3) {
32551         for (int i = 0; i < arg2; i++) {
32552           SV **sv = av_fetch(av, i, 0);
32553           int ret = SWIG_ConvertPtr(*sv, &(arg3[i]), SWIGTYPE_p_GDALRasterBandShadow, 0);
32554           if (!SWIG_IsOK(ret))
32555           do_confess(WRONG_ITEM_IN_ARRAY, 1);
32556         }
32557       } else
32558       do_confess(OUT_OF_MEMORY, 1);
32559 
32560     }
32561     if (items > 2) {
32562       res4 = SWIG_AsCharPtrAndSize(ST(2), &buf4, NULL, &alloc4);
32563       if (!SWIG_IsOK(res4)) {
32564         SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "_RegenerateOverviews" "', argument " "4"" of type '" "char const *""'");
32565       }
32566       arg4 = reinterpret_cast< char * >(buf4);
32567     }
32568     if (items > 3) {
32569       {
32570         /* %typemap(in) (GDALProgressFunc callback = NULL) */
32571         if (SvOK(ST(3))) {
32572           if (SvROK(ST(3))) {
32573             if (SvTYPE(SvRV(ST(3))) != SVt_PVCV) {
32574               do_confess(NEED_CODE_REF, 1);
32575             } else {
32576               saved_env.fct = (SV *)ST(3);
32577               arg5 = &callback_d_cp_vp;
32578             }
32579           } else {
32580             do_confess(NEED_CODE_REF, 1);
32581           }
32582         }
32583       }
32584     }
32585     if (items > 4) {
32586       {
32587         /* %typemap(in) (void* callback_data=NULL) */
32588         if (SvOK(ST(4)))
32589         saved_env.data = (SV *)ST(4);
32590       }
32591     }
32592     {
32593       if (!arg1) {
32594         SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
32595       }
32596     }
32597     {
32598       CPLErrorReset();
32599       result = (int)RegenerateOverviews(arg1,arg2,arg3,(char const *)arg4,arg5,arg6);
32600       CPLErr eclass = CPLGetLastErrorType();
32601       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
32602         do_confess( CPLGetLastErrorMsg(), 0 );
32603 
32604 
32605 
32606 
32607 
32608       }
32609 
32610 
32611       /*
32612           Make warnings regular Perl warnings. This duplicates the warning
32613           message if DontUseExceptions() is in effect (it is not by default).
32614           */
32615       if ( eclass == CE_Warning ) {
32616         warn( CPLGetLastErrorMsg(), "%s" );
32617       }
32618 
32619 
32620     }
32621     ST(argvi) = SWIG_From_int  SWIG_PERL_CALL_ARGS_1(static_cast< int >(result)); argvi++ ;
32622 
32623     {
32624       /* %typemap(freearg) (int object_list_count, GDALRasterBandShadow **poObjects) */
32625       CPLFree(arg3);
32626     }
32627     if (alloc4 == SWIG_NEWOBJ) delete[] buf4;
32628 
32629     XSRETURN(argvi);
32630   fail:
32631 
32632     {
32633       /* %typemap(freearg) (int object_list_count, GDALRasterBandShadow **poObjects) */
32634       CPLFree(arg3);
32635     }
32636     if (alloc4 == SWIG_NEWOBJ) delete[] buf4;
32637 
32638     SWIG_croak_null();
32639   }
32640 }
32641 
32642 
XS(_wrap__RegenerateOverview)32643 XS(_wrap__RegenerateOverview) {
32644   {
32645     GDALRasterBandShadow *arg1 = (GDALRasterBandShadow *) 0 ;
32646     GDALRasterBandShadow *arg2 = (GDALRasterBandShadow *) 0 ;
32647     char *arg3 = (char *) "average" ;
32648     GDALProgressFunc arg4 = (GDALProgressFunc) NULL ;
32649     void *arg5 = (void *) NULL ;
32650     void *argp1 = 0 ;
32651     int res1 = 0 ;
32652     void *argp2 = 0 ;
32653     int res2 = 0 ;
32654     int res3 ;
32655     char *buf3 = 0 ;
32656     int alloc3 = 0 ;
32657     int argvi = 0;
32658     int result;
32659     dXSARGS;
32660 
32661     /* %typemap(arginit, noblock=1) ( void* callback_data = NULL) */
32662     SavedEnv saved_env;
32663     saved_env.fct = NULL;
32664     saved_env.data = &PL_sv_undef;
32665     arg5 = (void *)(&saved_env);
32666     if ((items < 2) || (items > 5)) {
32667       SWIG_croak("Usage: _RegenerateOverview(srcBand,overviewBand,resampling,callback,callback_data);");
32668     }
32669     res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_GDALRasterBandShadow, 0 |  0 );
32670     if (!SWIG_IsOK(res1)) {
32671       SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "_RegenerateOverview" "', argument " "1"" of type '" "GDALRasterBandShadow *""'");
32672     }
32673     arg1 = reinterpret_cast< GDALRasterBandShadow * >(argp1);
32674     res2 = SWIG_ConvertPtr(ST(1), &argp2,SWIGTYPE_p_GDALRasterBandShadow, 0 |  0 );
32675     if (!SWIG_IsOK(res2)) {
32676       SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "_RegenerateOverview" "', argument " "2"" of type '" "GDALRasterBandShadow *""'");
32677     }
32678     arg2 = reinterpret_cast< GDALRasterBandShadow * >(argp2);
32679     if (items > 2) {
32680       res3 = SWIG_AsCharPtrAndSize(ST(2), &buf3, NULL, &alloc3);
32681       if (!SWIG_IsOK(res3)) {
32682         SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "_RegenerateOverview" "', argument " "3"" of type '" "char const *""'");
32683       }
32684       arg3 = reinterpret_cast< char * >(buf3);
32685     }
32686     if (items > 3) {
32687       {
32688         /* %typemap(in) (GDALProgressFunc callback = NULL) */
32689         if (SvOK(ST(3))) {
32690           if (SvROK(ST(3))) {
32691             if (SvTYPE(SvRV(ST(3))) != SVt_PVCV) {
32692               do_confess(NEED_CODE_REF, 1);
32693             } else {
32694               saved_env.fct = (SV *)ST(3);
32695               arg4 = &callback_d_cp_vp;
32696             }
32697           } else {
32698             do_confess(NEED_CODE_REF, 1);
32699           }
32700         }
32701       }
32702     }
32703     if (items > 4) {
32704       {
32705         /* %typemap(in) (void* callback_data=NULL) */
32706         if (SvOK(ST(4)))
32707         saved_env.data = (SV *)ST(4);
32708       }
32709     }
32710     {
32711       if (!arg1) {
32712         SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
32713       }
32714     }
32715     {
32716       if (!arg2) {
32717         SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
32718       }
32719     }
32720     {
32721       CPLErrorReset();
32722       result = (int)RegenerateOverview(arg1,arg2,(char const *)arg3,arg4,arg5);
32723       CPLErr eclass = CPLGetLastErrorType();
32724       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
32725         do_confess( CPLGetLastErrorMsg(), 0 );
32726 
32727 
32728 
32729 
32730 
32731       }
32732 
32733 
32734       /*
32735           Make warnings regular Perl warnings. This duplicates the warning
32736           message if DontUseExceptions() is in effect (it is not by default).
32737           */
32738       if ( eclass == CE_Warning ) {
32739         warn( CPLGetLastErrorMsg(), "%s" );
32740       }
32741 
32742 
32743     }
32744     ST(argvi) = SWIG_From_int  SWIG_PERL_CALL_ARGS_1(static_cast< int >(result)); argvi++ ;
32745 
32746 
32747     if (alloc3 == SWIG_NEWOBJ) delete[] buf3;
32748 
32749     XSRETURN(argvi);
32750   fail:
32751 
32752 
32753     if (alloc3 == SWIG_NEWOBJ) delete[] buf3;
32754 
32755     SWIG_croak_null();
32756   }
32757 }
32758 
32759 
XS(_wrap_ContourGenerate)32760 XS(_wrap_ContourGenerate) {
32761   {
32762     GDALRasterBandShadow *arg1 = (GDALRasterBandShadow *) 0 ;
32763     double arg2 ;
32764     double arg3 ;
32765     int arg4 ;
32766     double *arg5 = (double *) 0 ;
32767     int arg6 ;
32768     double arg7 ;
32769     OGRLayerShadow *arg8 = (OGRLayerShadow *) 0 ;
32770     int arg9 ;
32771     int arg10 ;
32772     GDALProgressFunc arg11 = (GDALProgressFunc) NULL ;
32773     void *arg12 = (void *) NULL ;
32774     void *argp1 = 0 ;
32775     int res1 = 0 ;
32776     double val2 ;
32777     int ecode2 = 0 ;
32778     double val3 ;
32779     int ecode3 = 0 ;
32780     int val6 ;
32781     int ecode6 = 0 ;
32782     double val7 ;
32783     int ecode7 = 0 ;
32784     void *argp8 = 0 ;
32785     int res8 = 0 ;
32786     int val9 ;
32787     int ecode9 = 0 ;
32788     int val10 ;
32789     int ecode10 = 0 ;
32790     int argvi = 0;
32791     int result;
32792     dXSARGS;
32793 
32794     /* %typemap(arginit, noblock=1) ( void* callback_data = NULL) */
32795     SavedEnv saved_env;
32796     saved_env.fct = NULL;
32797     saved_env.data = &PL_sv_undef;
32798     arg12 = (void *)(&saved_env);
32799     if ((items < 9) || (items > 11)) {
32800       SWIG_croak("Usage: ContourGenerate(srcBand,contourInterval,contourBase,fixedLevelCount,fixedLevels,useNoData,noDataValue,dstLayer,idField,elevField,callback,callback_data);");
32801     }
32802     res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_GDALRasterBandShadow, 0 |  0 );
32803     if (!SWIG_IsOK(res1)) {
32804       SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ContourGenerate" "', argument " "1"" of type '" "GDALRasterBandShadow *""'");
32805     }
32806     arg1 = reinterpret_cast< GDALRasterBandShadow * >(argp1);
32807     ecode2 = SWIG_AsVal_double SWIG_PERL_CALL_ARGS_2(ST(1), &val2);
32808     if (!SWIG_IsOK(ecode2)) {
32809       SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "ContourGenerate" "', argument " "2"" of type '" "double""'");
32810     }
32811     arg2 = static_cast< double >(val2);
32812     ecode3 = SWIG_AsVal_double SWIG_PERL_CALL_ARGS_2(ST(2), &val3);
32813     if (!SWIG_IsOK(ecode3)) {
32814       SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "ContourGenerate" "', argument " "3"" of type '" "double""'");
32815     }
32816     arg3 = static_cast< double >(val3);
32817     {
32818       /* %typemap(in,numinputs=1) (int nList, double* pList) */
32819       if (!(SvROK(ST(3)) && (SvTYPE(SvRV(ST(3)))==SVt_PVAV)))
32820       do_confess(NEED_ARRAY_REF, 1);
32821       AV *av = (AV*)(SvRV(ST(3)));
32822       arg4 = av_len(av)+1;
32823       arg5 = (double*)CPLMalloc(arg4*sizeof(double));
32824       if (arg5) {
32825         for( int i = 0; i<arg4; i++ ) {
32826           SV **sv = av_fetch(av, i, 0);
32827           arg5[i] =  SvNV(*sv);
32828         }
32829       } else
32830       SWIG_fail;
32831     }
32832     ecode6 = SWIG_AsVal_int SWIG_PERL_CALL_ARGS_2(ST(4), &val6);
32833     if (!SWIG_IsOK(ecode6)) {
32834       SWIG_exception_fail(SWIG_ArgError(ecode6), "in method '" "ContourGenerate" "', argument " "6"" of type '" "int""'");
32835     }
32836     arg6 = static_cast< int >(val6);
32837     ecode7 = SWIG_AsVal_double SWIG_PERL_CALL_ARGS_2(ST(5), &val7);
32838     if (!SWIG_IsOK(ecode7)) {
32839       SWIG_exception_fail(SWIG_ArgError(ecode7), "in method '" "ContourGenerate" "', argument " "7"" of type '" "double""'");
32840     }
32841     arg7 = static_cast< double >(val7);
32842     res8 = SWIG_ConvertPtr(ST(6), &argp8,SWIGTYPE_p_OGRLayerShadow, 0 |  0 );
32843     if (!SWIG_IsOK(res8)) {
32844       SWIG_exception_fail(SWIG_ArgError(res8), "in method '" "ContourGenerate" "', argument " "8"" of type '" "OGRLayerShadow *""'");
32845     }
32846     arg8 = reinterpret_cast< OGRLayerShadow * >(argp8);
32847     ecode9 = SWIG_AsVal_int SWIG_PERL_CALL_ARGS_2(ST(7), &val9);
32848     if (!SWIG_IsOK(ecode9)) {
32849       SWIG_exception_fail(SWIG_ArgError(ecode9), "in method '" "ContourGenerate" "', argument " "9"" of type '" "int""'");
32850     }
32851     arg9 = static_cast< int >(val9);
32852     ecode10 = SWIG_AsVal_int SWIG_PERL_CALL_ARGS_2(ST(8), &val10);
32853     if (!SWIG_IsOK(ecode10)) {
32854       SWIG_exception_fail(SWIG_ArgError(ecode10), "in method '" "ContourGenerate" "', argument " "10"" of type '" "int""'");
32855     }
32856     arg10 = static_cast< int >(val10);
32857     if (items > 9) {
32858       {
32859         /* %typemap(in) (GDALProgressFunc callback = NULL) */
32860         if (SvOK(ST(9))) {
32861           if (SvROK(ST(9))) {
32862             if (SvTYPE(SvRV(ST(9))) != SVt_PVCV) {
32863               do_confess(NEED_CODE_REF, 1);
32864             } else {
32865               saved_env.fct = (SV *)ST(9);
32866               arg11 = &callback_d_cp_vp;
32867             }
32868           } else {
32869             do_confess(NEED_CODE_REF, 1);
32870           }
32871         }
32872       }
32873     }
32874     if (items > 10) {
32875       {
32876         /* %typemap(in) (void* callback_data=NULL) */
32877         if (SvOK(ST(10)))
32878         saved_env.data = (SV *)ST(10);
32879       }
32880     }
32881     {
32882       if (!arg1) {
32883         SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
32884       }
32885     }
32886     {
32887       if (!arg8) {
32888         SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
32889       }
32890     }
32891     {
32892       CPLErrorReset();
32893       result = (int)ContourGenerate(arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9,arg10,arg11,arg12);
32894       CPLErr eclass = CPLGetLastErrorType();
32895       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
32896         do_confess( CPLGetLastErrorMsg(), 0 );
32897 
32898 
32899 
32900 
32901 
32902       }
32903 
32904 
32905       /*
32906           Make warnings regular Perl warnings. This duplicates the warning
32907           message if DontUseExceptions() is in effect (it is not by default).
32908           */
32909       if ( eclass == CE_Warning ) {
32910         warn( CPLGetLastErrorMsg(), "%s" );
32911       }
32912 
32913 
32914     }
32915     ST(argvi) = SWIG_From_int  SWIG_PERL_CALL_ARGS_1(static_cast< int >(result)); argvi++ ;
32916 
32917 
32918 
32919     {
32920       /* %typemap(freearg) (int nList, double* pList) */
32921       CPLFree((void*) arg5);
32922     }
32923 
32924 
32925 
32926 
32927 
32928 
32929     XSRETURN(argvi);
32930   fail:
32931 
32932 
32933 
32934     {
32935       /* %typemap(freearg) (int nList, double* pList) */
32936       CPLFree((void*) arg5);
32937     }
32938 
32939 
32940 
32941 
32942 
32943 
32944     SWIG_croak_null();
32945   }
32946 }
32947 
32948 
XS(_wrap_ContourGenerateEx)32949 XS(_wrap_ContourGenerateEx) {
32950   {
32951     GDALRasterBandShadow *arg1 = (GDALRasterBandShadow *) 0 ;
32952     OGRLayerShadow *arg2 = (OGRLayerShadow *) 0 ;
32953     char **arg3 = (char **) NULL ;
32954     GDALProgressFunc arg4 = (GDALProgressFunc) NULL ;
32955     void *arg5 = (void *) NULL ;
32956     void *argp1 = 0 ;
32957     int res1 = 0 ;
32958     void *argp2 = 0 ;
32959     int res2 = 0 ;
32960     int argvi = 0;
32961     int result;
32962     dXSARGS;
32963 
32964     /* %typemap(arginit, noblock=1) ( void* callback_data = NULL) */
32965     SavedEnv saved_env;
32966     saved_env.fct = NULL;
32967     saved_env.data = &PL_sv_undef;
32968     arg5 = (void *)(&saved_env);
32969     if ((items < 2) || (items > 5)) {
32970       SWIG_croak("Usage: ContourGenerateEx(srcBand,dstLayer,options,callback,callback_data);");
32971     }
32972     res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_GDALRasterBandShadow, 0 |  0 );
32973     if (!SWIG_IsOK(res1)) {
32974       SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ContourGenerateEx" "', argument " "1"" of type '" "GDALRasterBandShadow *""'");
32975     }
32976     arg1 = reinterpret_cast< GDALRasterBandShadow * >(argp1);
32977     res2 = SWIG_ConvertPtr(ST(1), &argp2,SWIGTYPE_p_OGRLayerShadow, 0 |  0 );
32978     if (!SWIG_IsOK(res2)) {
32979       SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "ContourGenerateEx" "', argument " "2"" of type '" "OGRLayerShadow *""'");
32980     }
32981     arg2 = reinterpret_cast< OGRLayerShadow * >(argp2);
32982     if (items > 2) {
32983       {
32984         /* %typemap(in) char **options */
32985         if (SvOK(ST(2))) {
32986           if (SvROK(ST(2))) {
32987             if (SvTYPE(SvRV(ST(2)))==SVt_PVAV) {
32988               AV *av = (AV*)(SvRV(ST(2)));
32989               for (int i = 0; i < av_len(av)+1; i++) {
32990                 SV *sv = *(av_fetch(av, i, 0));
32991                 bool sf;
32992                 char *tmp = sv_to_utf8_string(sv, NULL, &sf);
32993                 arg3 = CSLAddString(arg3, tmp);
32994                 if (sf) Safefree(tmp); else free(tmp);
32995               }
32996             } else if (SvTYPE(SvRV(ST(2)))==SVt_PVHV) {
32997               HV *hv = (HV*)SvRV(ST(2));
32998               SV *sv;
32999               char *key;
33000               I32 klen;
33001               arg3 = NULL;
33002               hv_iterinit(hv);
33003               while(sv = hv_iternextsv(hv, &key, &klen)) {
33004                 bool sf;
33005                 char *tmp = sv_to_utf8_string(sv, NULL, &sf);
33006                 arg3 = CSLAddNameValue(arg3, key, tmp);
33007                 if (sf) Safefree(tmp); else free(tmp);
33008               }
33009             } else
33010             do_confess(NEED_REF, 1);
33011           } else
33012           do_confess(NEED_REF, 1);
33013         }
33014       }
33015     }
33016     if (items > 3) {
33017       {
33018         /* %typemap(in) (GDALProgressFunc callback = NULL) */
33019         if (SvOK(ST(3))) {
33020           if (SvROK(ST(3))) {
33021             if (SvTYPE(SvRV(ST(3))) != SVt_PVCV) {
33022               do_confess(NEED_CODE_REF, 1);
33023             } else {
33024               saved_env.fct = (SV *)ST(3);
33025               arg4 = &callback_d_cp_vp;
33026             }
33027           } else {
33028             do_confess(NEED_CODE_REF, 1);
33029           }
33030         }
33031       }
33032     }
33033     if (items > 4) {
33034       {
33035         /* %typemap(in) (void* callback_data=NULL) */
33036         if (SvOK(ST(4)))
33037         saved_env.data = (SV *)ST(4);
33038       }
33039     }
33040     {
33041       if (!arg1) {
33042         SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
33043       }
33044     }
33045     {
33046       if (!arg2) {
33047         SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
33048       }
33049     }
33050     {
33051       CPLErrorReset();
33052       result = (int)ContourGenerateEx(arg1,arg2,arg3,arg4,arg5);
33053       CPLErr eclass = CPLGetLastErrorType();
33054       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
33055         do_confess( CPLGetLastErrorMsg(), 0 );
33056 
33057 
33058 
33059 
33060 
33061       }
33062 
33063 
33064       /*
33065           Make warnings regular Perl warnings. This duplicates the warning
33066           message if DontUseExceptions() is in effect (it is not by default).
33067           */
33068       if ( eclass == CE_Warning ) {
33069         warn( CPLGetLastErrorMsg(), "%s" );
33070       }
33071 
33072 
33073     }
33074     ST(argvi) = SWIG_From_int  SWIG_PERL_CALL_ARGS_1(static_cast< int >(result)); argvi++ ;
33075 
33076 
33077     {
33078       /* %typemap(freearg) char **options */
33079       if (arg3) CSLDestroy( arg3 );
33080     }
33081 
33082     XSRETURN(argvi);
33083   fail:
33084 
33085 
33086     {
33087       /* %typemap(freearg) char **options */
33088       if (arg3) CSLDestroy( arg3 );
33089     }
33090 
33091     SWIG_croak_null();
33092   }
33093 }
33094 
33095 
XS(_wrap_ViewshedGenerate)33096 XS(_wrap_ViewshedGenerate) {
33097   {
33098     GDALRasterBandShadow *arg1 = (GDALRasterBandShadow *) 0 ;
33099     char *arg2 = (char *) 0 ;
33100     char *arg3 = (char *) 0 ;
33101     char **arg4 = (char **) 0 ;
33102     double arg5 ;
33103     double arg6 ;
33104     double arg7 ;
33105     double arg8 ;
33106     double arg9 ;
33107     double arg10 ;
33108     double arg11 ;
33109     double arg12 ;
33110     double arg13 ;
33111     GDALViewshedMode arg14 ;
33112     double arg15 ;
33113     GDALProgressFunc arg16 = (GDALProgressFunc) NULL ;
33114     void *arg17 = (void *) NULL ;
33115     GDALViewshedOutputType arg18 = (GDALViewshedOutputType) GVOT_NORMAL ;
33116     char **arg19 = (char **) NULL ;
33117     void *argp1 = 0 ;
33118     int res1 = 0 ;
33119     int res2 ;
33120     char *buf2 = 0 ;
33121     int alloc2 = 0 ;
33122     int res3 ;
33123     char *buf3 = 0 ;
33124     int alloc3 = 0 ;
33125     void *argp4 = 0 ;
33126     int res4 = 0 ;
33127     double val5 ;
33128     int ecode5 = 0 ;
33129     double val6 ;
33130     int ecode6 = 0 ;
33131     double val7 ;
33132     int ecode7 = 0 ;
33133     double val8 ;
33134     int ecode8 = 0 ;
33135     double val9 ;
33136     int ecode9 = 0 ;
33137     double val10 ;
33138     int ecode10 = 0 ;
33139     double val11 ;
33140     int ecode11 = 0 ;
33141     double val12 ;
33142     int ecode12 = 0 ;
33143     double val13 ;
33144     int ecode13 = 0 ;
33145     int val14 ;
33146     int ecode14 = 0 ;
33147     double val15 ;
33148     int ecode15 = 0 ;
33149     int val18 ;
33150     int ecode18 = 0 ;
33151     void *argp19 = 0 ;
33152     int res19 = 0 ;
33153     int argvi = 0;
33154     GDALDatasetShadow *result = 0 ;
33155     dXSARGS;
33156 
33157     /* %typemap(arginit, noblock=1) ( void* callback_data = NULL) */
33158     SavedEnv saved_env;
33159     saved_env.fct = NULL;
33160     saved_env.data = &PL_sv_undef;
33161     arg17 = (void *)(&saved_env);
33162     if ((items < 15) || (items > 19)) {
33163       SWIG_croak("Usage: ViewshedGenerate(srcBand,driverName,targetRasterName,creationOptions,observerX,observerY,observerHeight,targetHeight,visibleVal,invisibleVal,outOfRangeVal,noDataVal,dfCurvCoeff,mode,maxDistance,callback,callback_data,heightMode,papszOptions);");
33164     }
33165     res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_GDALRasterBandShadow, 0 |  0 );
33166     if (!SWIG_IsOK(res1)) {
33167       SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ViewshedGenerate" "', argument " "1"" of type '" "GDALRasterBandShadow *""'");
33168     }
33169     arg1 = reinterpret_cast< GDALRasterBandShadow * >(argp1);
33170     res2 = SWIG_AsCharPtrAndSize(ST(1), &buf2, NULL, &alloc2);
33171     if (!SWIG_IsOK(res2)) {
33172       SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "ViewshedGenerate" "', argument " "2"" of type '" "char const *""'");
33173     }
33174     arg2 = reinterpret_cast< char * >(buf2);
33175     res3 = SWIG_AsCharPtrAndSize(ST(2), &buf3, NULL, &alloc3);
33176     if (!SWIG_IsOK(res3)) {
33177       SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "ViewshedGenerate" "', argument " "3"" of type '" "char const *""'");
33178     }
33179     arg3 = reinterpret_cast< char * >(buf3);
33180     res4 = SWIG_ConvertPtr(ST(3), &argp4,SWIGTYPE_p_p_char, 0 |  0 );
33181     if (!SWIG_IsOK(res4)) {
33182       SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "ViewshedGenerate" "', argument " "4"" of type '" "char **""'");
33183     }
33184     arg4 = reinterpret_cast< char ** >(argp4);
33185     ecode5 = SWIG_AsVal_double SWIG_PERL_CALL_ARGS_2(ST(4), &val5);
33186     if (!SWIG_IsOK(ecode5)) {
33187       SWIG_exception_fail(SWIG_ArgError(ecode5), "in method '" "ViewshedGenerate" "', argument " "5"" of type '" "double""'");
33188     }
33189     arg5 = static_cast< double >(val5);
33190     ecode6 = SWIG_AsVal_double SWIG_PERL_CALL_ARGS_2(ST(5), &val6);
33191     if (!SWIG_IsOK(ecode6)) {
33192       SWIG_exception_fail(SWIG_ArgError(ecode6), "in method '" "ViewshedGenerate" "', argument " "6"" of type '" "double""'");
33193     }
33194     arg6 = static_cast< double >(val6);
33195     ecode7 = SWIG_AsVal_double SWIG_PERL_CALL_ARGS_2(ST(6), &val7);
33196     if (!SWIG_IsOK(ecode7)) {
33197       SWIG_exception_fail(SWIG_ArgError(ecode7), "in method '" "ViewshedGenerate" "', argument " "7"" of type '" "double""'");
33198     }
33199     arg7 = static_cast< double >(val7);
33200     ecode8 = SWIG_AsVal_double SWIG_PERL_CALL_ARGS_2(ST(7), &val8);
33201     if (!SWIG_IsOK(ecode8)) {
33202       SWIG_exception_fail(SWIG_ArgError(ecode8), "in method '" "ViewshedGenerate" "', argument " "8"" of type '" "double""'");
33203     }
33204     arg8 = static_cast< double >(val8);
33205     ecode9 = SWIG_AsVal_double SWIG_PERL_CALL_ARGS_2(ST(8), &val9);
33206     if (!SWIG_IsOK(ecode9)) {
33207       SWIG_exception_fail(SWIG_ArgError(ecode9), "in method '" "ViewshedGenerate" "', argument " "9"" of type '" "double""'");
33208     }
33209     arg9 = static_cast< double >(val9);
33210     ecode10 = SWIG_AsVal_double SWIG_PERL_CALL_ARGS_2(ST(9), &val10);
33211     if (!SWIG_IsOK(ecode10)) {
33212       SWIG_exception_fail(SWIG_ArgError(ecode10), "in method '" "ViewshedGenerate" "', argument " "10"" of type '" "double""'");
33213     }
33214     arg10 = static_cast< double >(val10);
33215     ecode11 = SWIG_AsVal_double SWIG_PERL_CALL_ARGS_2(ST(10), &val11);
33216     if (!SWIG_IsOK(ecode11)) {
33217       SWIG_exception_fail(SWIG_ArgError(ecode11), "in method '" "ViewshedGenerate" "', argument " "11"" of type '" "double""'");
33218     }
33219     arg11 = static_cast< double >(val11);
33220     ecode12 = SWIG_AsVal_double SWIG_PERL_CALL_ARGS_2(ST(11), &val12);
33221     if (!SWIG_IsOK(ecode12)) {
33222       SWIG_exception_fail(SWIG_ArgError(ecode12), "in method '" "ViewshedGenerate" "', argument " "12"" of type '" "double""'");
33223     }
33224     arg12 = static_cast< double >(val12);
33225     ecode13 = SWIG_AsVal_double SWIG_PERL_CALL_ARGS_2(ST(12), &val13);
33226     if (!SWIG_IsOK(ecode13)) {
33227       SWIG_exception_fail(SWIG_ArgError(ecode13), "in method '" "ViewshedGenerate" "', argument " "13"" of type '" "double""'");
33228     }
33229     arg13 = static_cast< double >(val13);
33230     ecode14 = SWIG_AsVal_int SWIG_PERL_CALL_ARGS_2(ST(13), &val14);
33231     if (!SWIG_IsOK(ecode14)) {
33232       SWIG_exception_fail(SWIG_ArgError(ecode14), "in method '" "ViewshedGenerate" "', argument " "14"" of type '" "GDALViewshedMode""'");
33233     }
33234     arg14 = static_cast< GDALViewshedMode >(val14);
33235     ecode15 = SWIG_AsVal_double SWIG_PERL_CALL_ARGS_2(ST(14), &val15);
33236     if (!SWIG_IsOK(ecode15)) {
33237       SWIG_exception_fail(SWIG_ArgError(ecode15), "in method '" "ViewshedGenerate" "', argument " "15"" of type '" "double""'");
33238     }
33239     arg15 = static_cast< double >(val15);
33240     if (items > 15) {
33241       {
33242         /* %typemap(in) (GDALProgressFunc callback = NULL) */
33243         if (SvOK(ST(15))) {
33244           if (SvROK(ST(15))) {
33245             if (SvTYPE(SvRV(ST(15))) != SVt_PVCV) {
33246               do_confess(NEED_CODE_REF, 1);
33247             } else {
33248               saved_env.fct = (SV *)ST(15);
33249               arg16 = &callback_d_cp_vp;
33250             }
33251           } else {
33252             do_confess(NEED_CODE_REF, 1);
33253           }
33254         }
33255       }
33256     }
33257     if (items > 16) {
33258       {
33259         /* %typemap(in) (void* callback_data=NULL) */
33260         if (SvOK(ST(16)))
33261         saved_env.data = (SV *)ST(16);
33262       }
33263     }
33264     if (items > 17) {
33265       ecode18 = SWIG_AsVal_int SWIG_PERL_CALL_ARGS_2(ST(17), &val18);
33266       if (!SWIG_IsOK(ecode18)) {
33267         SWIG_exception_fail(SWIG_ArgError(ecode18), "in method '" "ViewshedGenerate" "', argument " "18"" of type '" "GDALViewshedOutputType""'");
33268       }
33269       arg18 = static_cast< GDALViewshedOutputType >(val18);
33270     }
33271     if (items > 18) {
33272       res19 = SWIG_ConvertPtr(ST(18), &argp19,SWIGTYPE_p_p_char, 0 |  0 );
33273       if (!SWIG_IsOK(res19)) {
33274         SWIG_exception_fail(SWIG_ArgError(res19), "in method '" "ViewshedGenerate" "', argument " "19"" of type '" "char **""'");
33275       }
33276       arg19 = reinterpret_cast< char ** >(argp19);
33277     }
33278     {
33279       if (!arg1) {
33280         SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
33281       }
33282     }
33283     {
33284       CPLErrorReset();
33285       result = (GDALDatasetShadow *)ViewshedGenerate(arg1,(char const *)arg2,(char const *)arg3,arg4,arg5,arg6,arg7,arg8,arg9,arg10,arg11,arg12,arg13,arg14,arg15,arg16,arg17,arg18,arg19);
33286       CPLErr eclass = CPLGetLastErrorType();
33287       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
33288         do_confess( CPLGetLastErrorMsg(), 0 );
33289 
33290 
33291 
33292 
33293 
33294       }
33295 
33296 
33297       /*
33298           Make warnings regular Perl warnings. This duplicates the warning
33299           message if DontUseExceptions() is in effect (it is not by default).
33300           */
33301       if ( eclass == CE_Warning ) {
33302         warn( CPLGetLastErrorMsg(), "%s" );
33303       }
33304 
33305 
33306     }
33307     ST(argvi) = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GDALDatasetShadow, SWIG_OWNER | SWIG_SHADOW); argvi++ ;
33308 
33309     if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
33310     if (alloc3 == SWIG_NEWOBJ) delete[] buf3;
33311 
33312 
33313 
33314 
33315 
33316 
33317 
33318 
33319 
33320 
33321 
33322 
33323 
33324 
33325 
33326     XSRETURN(argvi);
33327   fail:
33328 
33329     if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
33330     if (alloc3 == SWIG_NEWOBJ) delete[] buf3;
33331 
33332 
33333 
33334 
33335 
33336 
33337 
33338 
33339 
33340 
33341 
33342 
33343 
33344 
33345 
33346     SWIG_croak_null();
33347   }
33348 }
33349 
33350 
XS(_wrap__AutoCreateWarpedVRT)33351 XS(_wrap__AutoCreateWarpedVRT) {
33352   {
33353     GDALDatasetShadow *arg1 = (GDALDatasetShadow *) 0 ;
33354     char *arg2 = (char *) 0 ;
33355     char *arg3 = (char *) 0 ;
33356     GDALResampleAlg arg4 = (GDALResampleAlg) GRA_NearestNeighbour ;
33357     double arg5 = (double) 0.0 ;
33358     int res2 ;
33359     char *buf2 = 0 ;
33360     int alloc2 = 0 ;
33361     int res3 ;
33362     char *buf3 = 0 ;
33363     int alloc3 = 0 ;
33364     int val4 ;
33365     int ecode4 = 0 ;
33366     double val5 ;
33367     int ecode5 = 0 ;
33368     int argvi = 0;
33369     GDALDatasetShadow *result = 0 ;
33370     dXSARGS;
33371 
33372     if ((items < 1) || (items > 5)) {
33373       SWIG_croak("Usage: _AutoCreateWarpedVRT(src_ds,src_wkt,dst_wkt,eResampleAlg,maxerror);");
33374     }
33375     {
33376       /* %typemap(in) (GDALDatasetShadow *) */
33377       void *argp = 0;
33378       int res = SWIG_ConvertPtr(ST(0), &argp, SWIGTYPE_p_GDALDatasetShadow, 0 |  0 );
33379       if (!SWIG_IsOK(res)) {
33380         do_confess(WRONG_CLASS, 1);
33381       }
33382       arg1 = reinterpret_cast< GDALDatasetShadow * >(argp);
33383       if (arg1 == NULL)
33384       do_confess(NEED_DEF, 1);
33385     }
33386     if (items > 1) {
33387       res2 = SWIG_AsCharPtrAndSize(ST(1), &buf2, NULL, &alloc2);
33388       if (!SWIG_IsOK(res2)) {
33389         SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "_AutoCreateWarpedVRT" "', argument " "2"" of type '" "char const *""'");
33390       }
33391       arg2 = reinterpret_cast< char * >(buf2);
33392     }
33393     if (items > 2) {
33394       res3 = SWIG_AsCharPtrAndSize(ST(2), &buf3, NULL, &alloc3);
33395       if (!SWIG_IsOK(res3)) {
33396         SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "_AutoCreateWarpedVRT" "', argument " "3"" of type '" "char const *""'");
33397       }
33398       arg3 = reinterpret_cast< char * >(buf3);
33399     }
33400     if (items > 3) {
33401       ecode4 = SWIG_AsVal_int SWIG_PERL_CALL_ARGS_2(ST(3), &val4);
33402       if (!SWIG_IsOK(ecode4)) {
33403         SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "_AutoCreateWarpedVRT" "', argument " "4"" of type '" "GDALResampleAlg""'");
33404       }
33405       arg4 = static_cast< GDALResampleAlg >(val4);
33406     }
33407     if (items > 4) {
33408       ecode5 = SWIG_AsVal_double SWIG_PERL_CALL_ARGS_2(ST(4), &val5);
33409       if (!SWIG_IsOK(ecode5)) {
33410         SWIG_exception_fail(SWIG_ArgError(ecode5), "in method '" "_AutoCreateWarpedVRT" "', argument " "5"" of type '" "double""'");
33411       }
33412       arg5 = static_cast< double >(val5);
33413     }
33414     {
33415       if (!arg1) {
33416         SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
33417       }
33418     }
33419     {
33420       CPLErrorReset();
33421       result = (GDALDatasetShadow *)AutoCreateWarpedVRT(arg1,(char const *)arg2,(char const *)arg3,arg4,arg5);
33422       CPLErr eclass = CPLGetLastErrorType();
33423       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
33424         do_confess( CPLGetLastErrorMsg(), 0 );
33425 
33426 
33427 
33428 
33429 
33430       }
33431 
33432 
33433       /*
33434           Make warnings regular Perl warnings. This duplicates the warning
33435           message if DontUseExceptions() is in effect (it is not by default).
33436           */
33437       if ( eclass == CE_Warning ) {
33438         warn( CPLGetLastErrorMsg(), "%s" );
33439       }
33440 
33441 
33442     }
33443     ST(argvi) = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GDALDatasetShadow, SWIG_OWNER | SWIG_SHADOW); argvi++ ;
33444 
33445     if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
33446     if (alloc3 == SWIG_NEWOBJ) delete[] buf3;
33447 
33448 
33449     XSRETURN(argvi);
33450   fail:
33451 
33452     if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
33453     if (alloc3 == SWIG_NEWOBJ) delete[] buf3;
33454 
33455 
33456     SWIG_croak_null();
33457   }
33458 }
33459 
33460 
XS(_wrap_CreatePansharpenedVRT)33461 XS(_wrap_CreatePansharpenedVRT) {
33462   {
33463     char *arg1 = (char *) 0 ;
33464     GDALRasterBandShadow *arg2 = (GDALRasterBandShadow *) 0 ;
33465     int arg3 ;
33466     GDALRasterBandShadow **arg4 = (GDALRasterBandShadow **) 0 ;
33467     int res1 ;
33468     char *buf1 = 0 ;
33469     int alloc1 = 0 ;
33470     void *argp2 = 0 ;
33471     int res2 = 0 ;
33472     int argvi = 0;
33473     GDALDatasetShadow *result = 0 ;
33474     dXSARGS;
33475 
33476     if ((items < 3) || (items > 3)) {
33477       SWIG_croak("Usage: CreatePansharpenedVRT(pszXML,panchroBand,nInputSpectralBands,ahInputSpectralBands);");
33478     }
33479     res1 = SWIG_AsCharPtrAndSize(ST(0), &buf1, NULL, &alloc1);
33480     if (!SWIG_IsOK(res1)) {
33481       SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CreatePansharpenedVRT" "', argument " "1"" of type '" "char const *""'");
33482     }
33483     arg1 = reinterpret_cast< char * >(buf1);
33484     res2 = SWIG_ConvertPtr(ST(1), &argp2,SWIGTYPE_p_GDALRasterBandShadow, 0 |  0 );
33485     if (!SWIG_IsOK(res2)) {
33486       SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "CreatePansharpenedVRT" "', argument " "2"" of type '" "GDALRasterBandShadow *""'");
33487     }
33488     arg2 = reinterpret_cast< GDALRasterBandShadow * >(argp2);
33489     {
33490       /* %typemap(in,numinputs=1) (int object_list_count, GDALRasterBandShadow **poObjects) */
33491       if (!(SvROK(ST(2)) && (SvTYPE(SvRV(ST(2)))==SVt_PVAV)))
33492       do_confess(NEED_ARRAY_REF, 1);
33493       AV *av = (AV*)(SvRV(ST(2)));
33494       arg3 = av_len(av)+1;
33495       /* get the pointers from the array into bands */
33496       arg4 = (GDALRasterBandShadow **)CPLMalloc(arg3*sizeof(GDALRasterBandShadow *));
33497       if (arg4) {
33498         for (int i = 0; i < arg3; i++) {
33499           SV **sv = av_fetch(av, i, 0);
33500           int ret = SWIG_ConvertPtr(*sv, &(arg4[i]), SWIGTYPE_p_GDALRasterBandShadow, 0);
33501           if (!SWIG_IsOK(ret))
33502           do_confess(WRONG_ITEM_IN_ARRAY, 1);
33503         }
33504       } else
33505       do_confess(OUT_OF_MEMORY, 1);
33506 
33507     }
33508     {
33509       if (!arg2) {
33510         SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
33511       }
33512     }
33513     {
33514       CPLErrorReset();
33515       result = (GDALDatasetShadow *)CreatePansharpenedVRT((char const *)arg1,arg2,arg3,arg4);
33516       CPLErr eclass = CPLGetLastErrorType();
33517       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
33518         do_confess( CPLGetLastErrorMsg(), 0 );
33519 
33520 
33521 
33522 
33523 
33524       }
33525 
33526 
33527       /*
33528           Make warnings regular Perl warnings. This duplicates the warning
33529           message if DontUseExceptions() is in effect (it is not by default).
33530           */
33531       if ( eclass == CE_Warning ) {
33532         warn( CPLGetLastErrorMsg(), "%s" );
33533       }
33534 
33535 
33536     }
33537     ST(argvi) = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GDALDatasetShadow, SWIG_OWNER | SWIG_SHADOW); argvi++ ;
33538     if (alloc1 == SWIG_NEWOBJ) delete[] buf1;
33539 
33540     {
33541       /* %typemap(freearg) (int object_list_count, GDALRasterBandShadow **poObjects) */
33542       CPLFree(arg4);
33543     }
33544     XSRETURN(argvi);
33545   fail:
33546     if (alloc1 == SWIG_NEWOBJ) delete[] buf1;
33547 
33548     {
33549       /* %typemap(freearg) (int object_list_count, GDALRasterBandShadow **poObjects) */
33550       CPLFree(arg4);
33551     }
33552     SWIG_croak_null();
33553   }
33554 }
33555 
33556 
XS(_wrap_new_Transformer)33557 XS(_wrap_new_Transformer) {
33558   {
33559     GDALDatasetShadow *arg1 = (GDALDatasetShadow *) 0 ;
33560     GDALDatasetShadow *arg2 = (GDALDatasetShadow *) 0 ;
33561     char **arg3 = (char **) 0 ;
33562     int argvi = 0;
33563     GDALTransformerInfoShadow *result = 0 ;
33564     dXSARGS;
33565 
33566     if ((items < 3) || (items > 3)) {
33567       SWIG_croak("Usage: new_Transformer(src,dst,options);");
33568     }
33569     {
33570       /* %typemap(in) (GDALDatasetShadow *) */
33571       void *argp = 0;
33572       int res = SWIG_ConvertPtr(ST(0), &argp, SWIGTYPE_p_GDALDatasetShadow, 0 |  0 );
33573       if (!SWIG_IsOK(res)) {
33574         do_confess(WRONG_CLASS, 1);
33575       }
33576       arg1 = reinterpret_cast< GDALDatasetShadow * >(argp);
33577       if (arg1 == NULL)
33578       do_confess(NEED_DEF, 1);
33579     }
33580     {
33581       /* %typemap(in) (GDALDatasetShadow *) */
33582       void *argp = 0;
33583       int res = SWIG_ConvertPtr(ST(1), &argp, SWIGTYPE_p_GDALDatasetShadow, 0 |  0 );
33584       if (!SWIG_IsOK(res)) {
33585         do_confess(WRONG_CLASS, 1);
33586       }
33587       arg2 = reinterpret_cast< GDALDatasetShadow * >(argp);
33588       if (arg2 == NULL)
33589       do_confess(NEED_DEF, 1);
33590     }
33591     {
33592       /* %typemap(in) char **options */
33593       if (SvOK(ST(2))) {
33594         if (SvROK(ST(2))) {
33595           if (SvTYPE(SvRV(ST(2)))==SVt_PVAV) {
33596             AV *av = (AV*)(SvRV(ST(2)));
33597             for (int i = 0; i < av_len(av)+1; i++) {
33598               SV *sv = *(av_fetch(av, i, 0));
33599               bool sf;
33600               char *tmp = sv_to_utf8_string(sv, NULL, &sf);
33601               arg3 = CSLAddString(arg3, tmp);
33602               if (sf) Safefree(tmp); else free(tmp);
33603             }
33604           } else if (SvTYPE(SvRV(ST(2)))==SVt_PVHV) {
33605             HV *hv = (HV*)SvRV(ST(2));
33606             SV *sv;
33607             char *key;
33608             I32 klen;
33609             arg3 = NULL;
33610             hv_iterinit(hv);
33611             while(sv = hv_iternextsv(hv, &key, &klen)) {
33612               bool sf;
33613               char *tmp = sv_to_utf8_string(sv, NULL, &sf);
33614               arg3 = CSLAddNameValue(arg3, key, tmp);
33615               if (sf) Safefree(tmp); else free(tmp);
33616             }
33617           } else
33618           do_confess(NEED_REF, 1);
33619         } else
33620         do_confess(NEED_REF, 1);
33621       }
33622     }
33623     {
33624       CPLErrorReset();
33625       result = (GDALTransformerInfoShadow *)new_GDALTransformerInfoShadow(arg1,arg2,arg3);
33626       CPLErr eclass = CPLGetLastErrorType();
33627       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
33628         do_confess( CPLGetLastErrorMsg(), 0 );
33629 
33630 
33631 
33632 
33633 
33634       }
33635 
33636 
33637       /*
33638           Make warnings regular Perl warnings. This duplicates the warning
33639           message if DontUseExceptions() is in effect (it is not by default).
33640           */
33641       if ( eclass == CE_Warning ) {
33642         warn( CPLGetLastErrorMsg(), "%s" );
33643       }
33644 
33645 
33646     }
33647     ST(argvi) = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GDALTransformerInfoShadow, SWIG_OWNER | SWIG_SHADOW); argvi++ ;
33648 
33649 
33650     {
33651       /* %typemap(freearg) char **options */
33652       if (arg3) CSLDestroy( arg3 );
33653     }
33654     XSRETURN(argvi);
33655   fail:
33656 
33657 
33658     {
33659       /* %typemap(freearg) char **options */
33660       if (arg3) CSLDestroy( arg3 );
33661     }
33662     SWIG_croak_null();
33663   }
33664 }
33665 
33666 
XS(_wrap_delete_Transformer)33667 XS(_wrap_delete_Transformer) {
33668   {
33669     GDALTransformerInfoShadow *arg1 = (GDALTransformerInfoShadow *) 0 ;
33670     void *argp1 = 0 ;
33671     int res1 = 0 ;
33672     int argvi = 0;
33673     dXSARGS;
33674 
33675     if ((items < 1) || (items > 1)) {
33676       SWIG_croak("Usage: delete_Transformer(self);");
33677     }
33678     res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_GDALTransformerInfoShadow, SWIG_POINTER_DISOWN |  0 );
33679     if (!SWIG_IsOK(res1)) {
33680       SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_Transformer" "', argument " "1"" of type '" "GDALTransformerInfoShadow *""'");
33681     }
33682     arg1 = reinterpret_cast< GDALTransformerInfoShadow * >(argp1);
33683     {
33684       CPLErrorReset();
33685       delete_GDALTransformerInfoShadow(arg1);
33686       CPLErr eclass = CPLGetLastErrorType();
33687       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
33688         do_confess( CPLGetLastErrorMsg(), 0 );
33689 
33690 
33691 
33692 
33693 
33694       }
33695 
33696 
33697       /*
33698           Make warnings regular Perl warnings. This duplicates the warning
33699           message if DontUseExceptions() is in effect (it is not by default).
33700           */
33701       if ( eclass == CE_Warning ) {
33702         warn( CPLGetLastErrorMsg(), "%s" );
33703       }
33704 
33705 
33706     }
33707     {
33708       /* %typemap(out) void */
33709     }
33710 
33711     XSRETURN(argvi);
33712   fail:
33713 
33714     SWIG_croak_null();
33715   }
33716 }
33717 
33718 
XS(_wrap_Transformer_TransformPoint__SWIG_0)33719 XS(_wrap_Transformer_TransformPoint__SWIG_0) {
33720   {
33721     GDALTransformerInfoShadow *arg1 = (GDALTransformerInfoShadow *) 0 ;
33722     int arg2 ;
33723     double *arg3 ;
33724     void *argp1 = 0 ;
33725     int res1 = 0 ;
33726     int val2 ;
33727     int ecode2 = 0 ;
33728     double argin3[3] ;
33729     int argvi = 0;
33730     SV * _saved[1] ;
33731     int result;
33732     dXSARGS;
33733 
33734     if ((items < 3) || (items > 3)) {
33735       SWIG_croak("Usage: Transformer_TransformPoint(self,bDstToSrc,inout);");
33736     }
33737     res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_GDALTransformerInfoShadow, 0 |  0 );
33738     if (!SWIG_IsOK(res1)) {
33739       SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Transformer_TransformPoint" "', argument " "1"" of type '" "GDALTransformerInfoShadow *""'");
33740     }
33741     arg1 = reinterpret_cast< GDALTransformerInfoShadow * >(argp1);
33742     ecode2 = SWIG_AsVal_int SWIG_PERL_CALL_ARGS_2(ST(1), &val2);
33743     if (!SWIG_IsOK(ecode2)) {
33744       SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Transformer_TransformPoint" "', argument " "2"" of type '" "int""'");
33745     }
33746     arg2 = static_cast< int >(val2);
33747     {
33748       /* %typemap(in) (double argin3[ANY]) */
33749       if (!(SvROK(ST(2)) && (SvTYPE(SvRV(ST(2)))==SVt_PVAV)))
33750       do_confess(NEED_ARRAY_REF, 1);
33751       arg3 = argin3;
33752       AV *av = (AV*)(SvRV(ST(2)));
33753       if (av_len(av)+1 < 3)
33754       do_confess(NOT_ENOUGH_ELEMENTS, 1);
33755       for (unsigned int i=0; i<3; i++) {
33756         SV *sv = *av_fetch(av, i, 0);
33757         if (!SvOK(sv))
33758         do_confess(NEED_DEF, 1);
33759         arg3[i] =  SvNV(sv);
33760       }
33761     }
33762     _saved[0] = ST(2);
33763     {
33764       CPLErrorReset();
33765       result = (int)GDALTransformerInfoShadow_TransformPoint__SWIG_0(arg1,arg2,arg3);
33766       CPLErr eclass = CPLGetLastErrorType();
33767       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
33768         do_confess( CPLGetLastErrorMsg(), 0 );
33769 
33770 
33771 
33772 
33773 
33774       }
33775 
33776 
33777       /*
33778           Make warnings regular Perl warnings. This duplicates the warning
33779           message if DontUseExceptions() is in effect (it is not by default).
33780           */
33781       if ( eclass == CE_Warning ) {
33782         warn( CPLGetLastErrorMsg(), "%s" );
33783       }
33784 
33785 
33786     }
33787     ST(argvi) = SWIG_From_int  SWIG_PERL_CALL_ARGS_1(static_cast< int >(result)); argvi++ ;
33788     {
33789       /* %typemap(argout) (double argout[ANY]) */
33790       if (GIMME_V == G_ARRAY) {
33791         /* return a list */
33792         int i;
33793         EXTEND(SP, argvi+3-items+1);
33794         for (i = 0; i < 3; i++)
33795         ST(argvi++) = sv_2mortal(newSVnv(arg3[i]));
33796       } else {
33797         ST(argvi) = CreateArrayFromDoubleArray( arg3, 3 );
33798         argvi++;
33799       }
33800     }
33801 
33802 
33803 
33804     XSRETURN(argvi);
33805   fail:
33806 
33807 
33808 
33809     SWIG_croak_null();
33810   }
33811 }
33812 
33813 
XS(_wrap_Transformer_TransformPoint__SWIG_1)33814 XS(_wrap_Transformer_TransformPoint__SWIG_1) {
33815   {
33816     GDALTransformerInfoShadow *arg1 = (GDALTransformerInfoShadow *) 0 ;
33817     double *arg2 ;
33818     int arg3 ;
33819     double arg4 ;
33820     double arg5 ;
33821     double arg6 = (double) 0.0 ;
33822     void *argp1 = 0 ;
33823     int res1 = 0 ;
33824     double argout2[3] ;
33825     int val3 ;
33826     int ecode3 = 0 ;
33827     double val4 ;
33828     int ecode4 = 0 ;
33829     double val5 ;
33830     int ecode5 = 0 ;
33831     double val6 ;
33832     int ecode6 = 0 ;
33833     int argvi = 0;
33834     int result;
33835     dXSARGS;
33836 
33837     {
33838       /* %typemap(in,numinputs=0) (double argout2[ANY]) */
33839       arg2 = argout2;
33840     }
33841     if ((items < 4) || (items > 5)) {
33842       SWIG_croak("Usage: Transformer_TransformPoint(self,bDstToSrc,x,y,z);");
33843     }
33844     res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_GDALTransformerInfoShadow, 0 |  0 );
33845     if (!SWIG_IsOK(res1)) {
33846       SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Transformer_TransformPoint" "', argument " "1"" of type '" "GDALTransformerInfoShadow *""'");
33847     }
33848     arg1 = reinterpret_cast< GDALTransformerInfoShadow * >(argp1);
33849     ecode3 = SWIG_AsVal_int SWIG_PERL_CALL_ARGS_2(ST(1), &val3);
33850     if (!SWIG_IsOK(ecode3)) {
33851       SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "Transformer_TransformPoint" "', argument " "3"" of type '" "int""'");
33852     }
33853     arg3 = static_cast< int >(val3);
33854     ecode4 = SWIG_AsVal_double SWIG_PERL_CALL_ARGS_2(ST(2), &val4);
33855     if (!SWIG_IsOK(ecode4)) {
33856       SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "Transformer_TransformPoint" "', argument " "4"" of type '" "double""'");
33857     }
33858     arg4 = static_cast< double >(val4);
33859     ecode5 = SWIG_AsVal_double SWIG_PERL_CALL_ARGS_2(ST(3), &val5);
33860     if (!SWIG_IsOK(ecode5)) {
33861       SWIG_exception_fail(SWIG_ArgError(ecode5), "in method '" "Transformer_TransformPoint" "', argument " "5"" of type '" "double""'");
33862     }
33863     arg5 = static_cast< double >(val5);
33864     if (items > 4) {
33865       ecode6 = SWIG_AsVal_double SWIG_PERL_CALL_ARGS_2(ST(4), &val6);
33866       if (!SWIG_IsOK(ecode6)) {
33867         SWIG_exception_fail(SWIG_ArgError(ecode6), "in method '" "Transformer_TransformPoint" "', argument " "6"" of type '" "double""'");
33868       }
33869       arg6 = static_cast< double >(val6);
33870     }
33871     {
33872       CPLErrorReset();
33873       result = (int)GDALTransformerInfoShadow_TransformPoint__SWIG_1(arg1,arg2,arg3,arg4,arg5,arg6);
33874       CPLErr eclass = CPLGetLastErrorType();
33875       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
33876         do_confess( CPLGetLastErrorMsg(), 0 );
33877 
33878 
33879 
33880 
33881 
33882       }
33883 
33884 
33885       /*
33886           Make warnings regular Perl warnings. This duplicates the warning
33887           message if DontUseExceptions() is in effect (it is not by default).
33888           */
33889       if ( eclass == CE_Warning ) {
33890         warn( CPLGetLastErrorMsg(), "%s" );
33891       }
33892 
33893 
33894     }
33895     ST(argvi) = SWIG_From_int  SWIG_PERL_CALL_ARGS_1(static_cast< int >(result)); argvi++ ;
33896     {
33897       /* %typemap(argout) (double argout[ANY]) */
33898       if (GIMME_V == G_ARRAY) {
33899         /* return a list */
33900         int i;
33901         EXTEND(SP, argvi+3-items+1);
33902         for (i = 0; i < 3; i++)
33903         ST(argvi++) = sv_2mortal(newSVnv(arg2[i]));
33904       } else {
33905         ST(argvi) = CreateArrayFromDoubleArray( arg2, 3 );
33906         argvi++;
33907       }
33908     }
33909 
33910 
33911 
33912 
33913 
33914 
33915     XSRETURN(argvi);
33916   fail:
33917 
33918 
33919 
33920 
33921 
33922 
33923     SWIG_croak_null();
33924   }
33925 }
33926 
33927 
XS(_wrap_Transformer_TransformPoint)33928 XS(_wrap_Transformer_TransformPoint) {
33929   dXSARGS;
33930 
33931   {
33932     unsigned long _index = 0;
33933     SWIG_TypeRank _rank = 0;
33934     if (items == 3) {
33935       SWIG_TypeRank _ranki = 0;
33936       SWIG_TypeRank _rankm = 0;
33937       SWIG_TypeRank _pi = 1;
33938       int _v = 0;
33939       {
33940         void *vptr = 0;
33941         int res = SWIG_ConvertPtr(ST(0), &vptr, SWIGTYPE_p_GDALTransformerInfoShadow, 0);
33942         _v = SWIG_CheckState(res);
33943       }
33944       if (!_v) goto check_1;
33945       _ranki += _v*_pi;
33946       _rankm += _pi;
33947       _pi *= SWIG_MAXCASTRANK;
33948       {
33949         {
33950           int res = SWIG_AsVal_int SWIG_PERL_CALL_ARGS_2(ST(1), NULL);
33951           _v = SWIG_CheckState(res);
33952         }
33953       }
33954       if (!_v) goto check_1;
33955       _ranki += _v*_pi;
33956       _rankm += _pi;
33957       _pi *= SWIG_MAXCASTRANK;
33958       {
33959         void *vptr = 0;
33960         int res = SWIG_ConvertPtr(ST(2), &vptr, SWIGTYPE_p_double, 0);
33961         _v = SWIG_CheckState(res);
33962       }
33963       if (!_v) goto check_1;
33964       _ranki += _v*_pi;
33965       _rankm += _pi;
33966       _pi *= SWIG_MAXCASTRANK;
33967       if (!_index || (_ranki < _rank)) {
33968         _rank = _ranki; _index = 1;
33969         if (_rank == _rankm) goto dispatch;
33970       }
33971     }
33972   check_1:
33973 
33974     if ((items >= 4) && (items <= 5)) {
33975       SWIG_TypeRank _ranki = 0;
33976       SWIG_TypeRank _rankm = 0;
33977       SWIG_TypeRank _pi = 1;
33978       int _v = 0;
33979       {
33980         void *vptr = 0;
33981         int res = SWIG_ConvertPtr(ST(0), &vptr, SWIGTYPE_p_GDALTransformerInfoShadow, 0);
33982         _v = SWIG_CheckState(res);
33983       }
33984       if (!_v) goto check_2;
33985       _ranki += _v*_pi;
33986       _rankm += _pi;
33987       _pi *= SWIG_MAXCASTRANK;
33988       {
33989         {
33990           int res = SWIG_AsVal_int SWIG_PERL_CALL_ARGS_2(ST(1), NULL);
33991           _v = SWIG_CheckState(res);
33992         }
33993       }
33994       if (!_v) goto check_2;
33995       _ranki += _v*_pi;
33996       _rankm += _pi;
33997       _pi *= SWIG_MAXCASTRANK;
33998       {
33999         {
34000           int res = SWIG_AsVal_double SWIG_PERL_CALL_ARGS_2(ST(2), NULL);
34001           _v = SWIG_CheckState(res);
34002         }
34003       }
34004       if (!_v) goto check_2;
34005       _ranki += _v*_pi;
34006       _rankm += _pi;
34007       _pi *= SWIG_MAXCASTRANK;
34008       {
34009         {
34010           int res = SWIG_AsVal_double SWIG_PERL_CALL_ARGS_2(ST(3), NULL);
34011           _v = SWIG_CheckState(res);
34012         }
34013       }
34014       if (!_v) goto check_2;
34015       _ranki += _v*_pi;
34016       _rankm += _pi;
34017       _pi *= SWIG_MAXCASTRANK;
34018       if (items > 4) {
34019         {
34020           {
34021             int res = SWIG_AsVal_double SWIG_PERL_CALL_ARGS_2(ST(4), NULL);
34022             _v = SWIG_CheckState(res);
34023           }
34024         }
34025         if (!_v) goto check_2;
34026         _ranki += _v*_pi;
34027         _rankm += _pi;
34028         _pi *= SWIG_MAXCASTRANK;
34029       }
34030       if (!_index || (_ranki < _rank)) {
34031         _rank = _ranki; _index = 2;
34032         if (_rank == _rankm) goto dispatch;
34033       }
34034     }
34035   check_2:
34036 
34037   dispatch:
34038     switch(_index) {
34039     case 1:
34040       PUSHMARK(MARK); SWIG_CALLXS(_wrap_Transformer_TransformPoint__SWIG_0); return;
34041     case 2:
34042       PUSHMARK(MARK); SWIG_CALLXS(_wrap_Transformer_TransformPoint__SWIG_1); return;
34043     }
34044   }
34045 
34046   croak("No matching function for overloaded 'Transformer_TransformPoint'");
34047   XSRETURN(0);
34048 }
34049 
34050 
XS(_wrap_Transformer__TransformPoints)34051 XS(_wrap_Transformer__TransformPoints) {
34052   {
34053     GDALTransformerInfoShadow *arg1 = (GDALTransformerInfoShadow *) 0 ;
34054     int arg2 ;
34055     int arg3 ;
34056     double *arg4 = (double *) 0 ;
34057     double *arg5 = (double *) 0 ;
34058     double *arg6 = (double *) 0 ;
34059     int *arg7 = (int *) 0 ;
34060     void *argp1 = 0 ;
34061     int res1 = 0 ;
34062     int val2 ;
34063     int ecode2 = 0 ;
34064     void *argp7 = 0 ;
34065     int res7 = 0 ;
34066     int argvi = 0;
34067     SV * _saved[1] ;
34068     int result;
34069     dXSARGS;
34070 
34071     if ((items < 4) || (items > 4)) {
34072       SWIG_croak("Usage: Transformer__TransformPoints(self,bDstToSrc,nCount,x,y,z,panSuccess);");
34073     }
34074     res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_GDALTransformerInfoShadow, 0 |  0 );
34075     if (!SWIG_IsOK(res1)) {
34076       SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Transformer__TransformPoints" "', argument " "1"" of type '" "GDALTransformerInfoShadow *""'");
34077     }
34078     arg1 = reinterpret_cast< GDALTransformerInfoShadow * >(argp1);
34079     ecode2 = SWIG_AsVal_int SWIG_PERL_CALL_ARGS_2(ST(1), &val2);
34080     if (!SWIG_IsOK(ecode2)) {
34081       SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Transformer__TransformPoints" "', argument " "2"" of type '" "int""'");
34082     }
34083     arg2 = static_cast< int >(val2);
34084     {
34085       /* %typemap(in) (int nCount, double *x, double *y, double *z) */
34086       /* ST(2) is a ref to a list of refs to point lists */
34087       if (! (SvROK(ST(2)) && (SvTYPE(SvRV(ST(2)))==SVt_PVAV)))
34088       do_confess(NEED_ARRAY_REF, 1);
34089       AV *av = (AV*)(SvRV(ST(2)));
34090       arg3 = av_len(av)+1;
34091       arg4 = (double*)CPLMalloc(arg3*sizeof(double));
34092       if (arg4)
34093       arg5 = (double*)CPLMalloc(arg3*sizeof(double));
34094       if (arg4 && arg5)
34095       arg6 = (double*)CPLMalloc(arg3*sizeof(double));
34096       if (!arg4 or !arg5 or !arg6)
34097       SWIG_fail;
34098       for (int i = 0; i < arg3; i++) {
34099         SV **sv = av_fetch(av, i, 0); /* ref to one point list */
34100         if (!(SvROK(*sv) && (SvTYPE(SvRV(*sv))==SVt_PVAV)))
34101         do_confess(WRONG_ITEM_IN_ARRAY, 1);
34102         AV *ac = (AV*)(SvRV(*sv));
34103         int n = av_len(ac)+1;
34104         SV **c = av_fetch(ac, 0, 0);
34105         arg4[i] = SvNV(*c);
34106         c = av_fetch(ac, 1, 0);
34107         arg5[i] = SvNV(*c);
34108         if (n < 3) {
34109           arg6[i] = 0;
34110         } else {
34111           c = av_fetch(ac, 2, 0);
34112           arg6[i] = SvNV(*c);
34113         }
34114       }
34115     }
34116     res7 = SWIG_ConvertPtr(ST(3), &argp7,SWIGTYPE_p_int, 0 |  0 );
34117     if (!SWIG_IsOK(res7)) {
34118       SWIG_exception_fail(SWIG_ArgError(res7), "in method '" "Transformer__TransformPoints" "', argument " "7"" of type '" "int *""'");
34119     }
34120     arg7 = reinterpret_cast< int * >(argp7);
34121     _saved[0] = ST(2);
34122     {
34123       CPLErrorReset();
34124       result = (int)GDALTransformerInfoShadow_TransformPoints(arg1,arg2,arg3,arg4,arg5,arg6,arg7);
34125       CPLErr eclass = CPLGetLastErrorType();
34126       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
34127         do_confess( CPLGetLastErrorMsg(), 0 );
34128 
34129 
34130 
34131 
34132 
34133       }
34134 
34135 
34136       /*
34137           Make warnings regular Perl warnings. This duplicates the warning
34138           message if DontUseExceptions() is in effect (it is not by default).
34139           */
34140       if ( eclass == CE_Warning ) {
34141         warn( CPLGetLastErrorMsg(), "%s" );
34142       }
34143 
34144 
34145     }
34146     ST(argvi) = SWIG_From_int  SWIG_PERL_CALL_ARGS_1(static_cast< int >(result)); argvi++ ;
34147     {
34148       /* %typemap(argout) (int nCount, double *x, double *y, double *z) */
34149       AV *av = (AV*)(SvRV(_saved[0]));
34150       for (int i = 0; i < arg3; i++) {
34151         SV **sv = av_fetch(av, i, 0);
34152         AV *ac = (AV*)(SvRV(*sv));
34153         int n = av_len(ac)+1;
34154         SV *c = newSVnv(arg4[i]);
34155         if (!av_store(ac, 0, c))
34156         SvREFCNT_dec(c);
34157         c = newSVnv(arg5[i]);
34158         if (!av_store(ac, 1, c))
34159         SvREFCNT_dec(c);
34160         c = newSVnv(arg6[i]);
34161         if (!av_store(ac, 2, c))
34162         SvREFCNT_dec(c);
34163       }
34164     }
34165 
34166 
34167     {
34168       /* %typemap(freearg) (int nCount, double *x, double *y, double *z) */
34169       CPLFree(arg4);
34170       CPLFree(arg5);
34171       CPLFree(arg6);
34172     }
34173 
34174     XSRETURN(argvi);
34175   fail:
34176 
34177 
34178     {
34179       /* %typemap(freearg) (int nCount, double *x, double *y, double *z) */
34180       CPLFree(arg4);
34181       CPLFree(arg5);
34182       CPLFree(arg6);
34183     }
34184 
34185     SWIG_croak_null();
34186   }
34187 }
34188 
34189 
XS(_wrap_Transformer_TransformGeolocations)34190 XS(_wrap_Transformer_TransformGeolocations) {
34191   {
34192     GDALTransformerInfoShadow *arg1 = (GDALTransformerInfoShadow *) 0 ;
34193     GDALRasterBandShadow *arg2 = (GDALRasterBandShadow *) 0 ;
34194     GDALRasterBandShadow *arg3 = (GDALRasterBandShadow *) 0 ;
34195     GDALRasterBandShadow *arg4 = (GDALRasterBandShadow *) 0 ;
34196     GDALProgressFunc arg5 = (GDALProgressFunc) NULL ;
34197     void *arg6 = (void *) NULL ;
34198     char **arg7 = (char **) NULL ;
34199     void *argp1 = 0 ;
34200     int res1 = 0 ;
34201     void *argp2 = 0 ;
34202     int res2 = 0 ;
34203     void *argp3 = 0 ;
34204     int res3 = 0 ;
34205     void *argp4 = 0 ;
34206     int res4 = 0 ;
34207     int argvi = 0;
34208     int result;
34209     dXSARGS;
34210 
34211     /* %typemap(arginit, noblock=1) ( void* callback_data = NULL) */
34212     SavedEnv saved_env;
34213     saved_env.fct = NULL;
34214     saved_env.data = &PL_sv_undef;
34215     arg6 = (void *)(&saved_env);
34216     if ((items < 4) || (items > 7)) {
34217       SWIG_croak("Usage: Transformer_TransformGeolocations(self,xBand,yBand,zBand,callback,callback_data,options);");
34218     }
34219     res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_GDALTransformerInfoShadow, 0 |  0 );
34220     if (!SWIG_IsOK(res1)) {
34221       SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Transformer_TransformGeolocations" "', argument " "1"" of type '" "GDALTransformerInfoShadow *""'");
34222     }
34223     arg1 = reinterpret_cast< GDALTransformerInfoShadow * >(argp1);
34224     res2 = SWIG_ConvertPtr(ST(1), &argp2,SWIGTYPE_p_GDALRasterBandShadow, 0 |  0 );
34225     if (!SWIG_IsOK(res2)) {
34226       SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Transformer_TransformGeolocations" "', argument " "2"" of type '" "GDALRasterBandShadow *""'");
34227     }
34228     arg2 = reinterpret_cast< GDALRasterBandShadow * >(argp2);
34229     res3 = SWIG_ConvertPtr(ST(2), &argp3,SWIGTYPE_p_GDALRasterBandShadow, 0 |  0 );
34230     if (!SWIG_IsOK(res3)) {
34231       SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "Transformer_TransformGeolocations" "', argument " "3"" of type '" "GDALRasterBandShadow *""'");
34232     }
34233     arg3 = reinterpret_cast< GDALRasterBandShadow * >(argp3);
34234     res4 = SWIG_ConvertPtr(ST(3), &argp4,SWIGTYPE_p_GDALRasterBandShadow, 0 |  0 );
34235     if (!SWIG_IsOK(res4)) {
34236       SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "Transformer_TransformGeolocations" "', argument " "4"" of type '" "GDALRasterBandShadow *""'");
34237     }
34238     arg4 = reinterpret_cast< GDALRasterBandShadow * >(argp4);
34239     if (items > 4) {
34240       {
34241         /* %typemap(in) (GDALProgressFunc callback = NULL) */
34242         if (SvOK(ST(4))) {
34243           if (SvROK(ST(4))) {
34244             if (SvTYPE(SvRV(ST(4))) != SVt_PVCV) {
34245               do_confess(NEED_CODE_REF, 1);
34246             } else {
34247               saved_env.fct = (SV *)ST(4);
34248               arg5 = &callback_d_cp_vp;
34249             }
34250           } else {
34251             do_confess(NEED_CODE_REF, 1);
34252           }
34253         }
34254       }
34255     }
34256     if (items > 5) {
34257       {
34258         /* %typemap(in) (void* callback_data=NULL) */
34259         if (SvOK(ST(5)))
34260         saved_env.data = (SV *)ST(5);
34261       }
34262     }
34263     if (items > 6) {
34264       {
34265         /* %typemap(in) char **options */
34266         if (SvOK(ST(6))) {
34267           if (SvROK(ST(6))) {
34268             if (SvTYPE(SvRV(ST(6)))==SVt_PVAV) {
34269               AV *av = (AV*)(SvRV(ST(6)));
34270               for (int i = 0; i < av_len(av)+1; i++) {
34271                 SV *sv = *(av_fetch(av, i, 0));
34272                 bool sf;
34273                 char *tmp = sv_to_utf8_string(sv, NULL, &sf);
34274                 arg7 = CSLAddString(arg7, tmp);
34275                 if (sf) Safefree(tmp); else free(tmp);
34276               }
34277             } else if (SvTYPE(SvRV(ST(6)))==SVt_PVHV) {
34278               HV *hv = (HV*)SvRV(ST(6));
34279               SV *sv;
34280               char *key;
34281               I32 klen;
34282               arg7 = NULL;
34283               hv_iterinit(hv);
34284               while(sv = hv_iternextsv(hv, &key, &klen)) {
34285                 bool sf;
34286                 char *tmp = sv_to_utf8_string(sv, NULL, &sf);
34287                 arg7 = CSLAddNameValue(arg7, key, tmp);
34288                 if (sf) Safefree(tmp); else free(tmp);
34289               }
34290             } else
34291             do_confess(NEED_REF, 1);
34292           } else
34293           do_confess(NEED_REF, 1);
34294         }
34295       }
34296     }
34297     {
34298       if (!arg2) {
34299         SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
34300       }
34301     }
34302     {
34303       if (!arg3) {
34304         SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
34305       }
34306     }
34307     {
34308       if (!arg4) {
34309         SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
34310       }
34311     }
34312     {
34313       CPLErrorReset();
34314       result = (int)GDALTransformerInfoShadow_TransformGeolocations(arg1,arg2,arg3,arg4,arg5,arg6,arg7);
34315       CPLErr eclass = CPLGetLastErrorType();
34316       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
34317         do_confess( CPLGetLastErrorMsg(), 0 );
34318 
34319 
34320 
34321 
34322 
34323       }
34324 
34325 
34326       /*
34327           Make warnings regular Perl warnings. This duplicates the warning
34328           message if DontUseExceptions() is in effect (it is not by default).
34329           */
34330       if ( eclass == CE_Warning ) {
34331         warn( CPLGetLastErrorMsg(), "%s" );
34332       }
34333 
34334 
34335     }
34336     ST(argvi) = SWIG_From_int  SWIG_PERL_CALL_ARGS_1(static_cast< int >(result)); argvi++ ;
34337 
34338 
34339 
34340 
34341 
34342     {
34343       /* %typemap(freearg) char **options */
34344       if (arg7) CSLDestroy( arg7 );
34345     }
34346     XSRETURN(argvi);
34347   fail:
34348 
34349 
34350 
34351 
34352 
34353     {
34354       /* %typemap(freearg) char **options */
34355       if (arg7) CSLDestroy( arg7 );
34356     }
34357     SWIG_croak_null();
34358   }
34359 }
34360 
34361 
XS(_wrap_ApplyVerticalShiftGrid)34362 XS(_wrap_ApplyVerticalShiftGrid) {
34363   {
34364     GDALDatasetShadow *arg1 = (GDALDatasetShadow *) 0 ;
34365     GDALDatasetShadow *arg2 = (GDALDatasetShadow *) 0 ;
34366     bool arg3 = (bool) false ;
34367     double arg4 = (double) 1.0 ;
34368     double arg5 = (double) 1.0 ;
34369     char **arg6 = (char **) NULL ;
34370     bool val3 ;
34371     int ecode3 = 0 ;
34372     double val4 ;
34373     int ecode4 = 0 ;
34374     double val5 ;
34375     int ecode5 = 0 ;
34376     int argvi = 0;
34377     GDALDatasetShadow *result = 0 ;
34378     dXSARGS;
34379 
34380     if ((items < 2) || (items > 6)) {
34381       SWIG_croak("Usage: ApplyVerticalShiftGrid(src_ds,grid_ds,inverse,srcUnitToMeter,dstUnitToMeter,options);");
34382     }
34383     {
34384       /* %typemap(in) (GDALDatasetShadow *) */
34385       void *argp = 0;
34386       int res = SWIG_ConvertPtr(ST(0), &argp, SWIGTYPE_p_GDALDatasetShadow, 0 |  0 );
34387       if (!SWIG_IsOK(res)) {
34388         do_confess(WRONG_CLASS, 1);
34389       }
34390       arg1 = reinterpret_cast< GDALDatasetShadow * >(argp);
34391       if (arg1 == NULL)
34392       do_confess(NEED_DEF, 1);
34393     }
34394     {
34395       /* %typemap(in) (GDALDatasetShadow *) */
34396       void *argp = 0;
34397       int res = SWIG_ConvertPtr(ST(1), &argp, SWIGTYPE_p_GDALDatasetShadow, 0 |  0 );
34398       if (!SWIG_IsOK(res)) {
34399         do_confess(WRONG_CLASS, 1);
34400       }
34401       arg2 = reinterpret_cast< GDALDatasetShadow * >(argp);
34402       if (arg2 == NULL)
34403       do_confess(NEED_DEF, 1);
34404     }
34405     if (items > 2) {
34406       ecode3 = SWIG_AsVal_bool SWIG_PERL_CALL_ARGS_2(ST(2), &val3);
34407       if (!SWIG_IsOK(ecode3)) {
34408         SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "ApplyVerticalShiftGrid" "', argument " "3"" of type '" "bool""'");
34409       }
34410       arg3 = static_cast< bool >(val3);
34411     }
34412     if (items > 3) {
34413       ecode4 = SWIG_AsVal_double SWIG_PERL_CALL_ARGS_2(ST(3), &val4);
34414       if (!SWIG_IsOK(ecode4)) {
34415         SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "ApplyVerticalShiftGrid" "', argument " "4"" of type '" "double""'");
34416       }
34417       arg4 = static_cast< double >(val4);
34418     }
34419     if (items > 4) {
34420       ecode5 = SWIG_AsVal_double SWIG_PERL_CALL_ARGS_2(ST(4), &val5);
34421       if (!SWIG_IsOK(ecode5)) {
34422         SWIG_exception_fail(SWIG_ArgError(ecode5), "in method '" "ApplyVerticalShiftGrid" "', argument " "5"" of type '" "double""'");
34423       }
34424       arg5 = static_cast< double >(val5);
34425     }
34426     if (items > 5) {
34427       {
34428         /* %typemap(in) char **options */
34429         if (SvOK(ST(5))) {
34430           if (SvROK(ST(5))) {
34431             if (SvTYPE(SvRV(ST(5)))==SVt_PVAV) {
34432               AV *av = (AV*)(SvRV(ST(5)));
34433               for (int i = 0; i < av_len(av)+1; i++) {
34434                 SV *sv = *(av_fetch(av, i, 0));
34435                 bool sf;
34436                 char *tmp = sv_to_utf8_string(sv, NULL, &sf);
34437                 arg6 = CSLAddString(arg6, tmp);
34438                 if (sf) Safefree(tmp); else free(tmp);
34439               }
34440             } else if (SvTYPE(SvRV(ST(5)))==SVt_PVHV) {
34441               HV *hv = (HV*)SvRV(ST(5));
34442               SV *sv;
34443               char *key;
34444               I32 klen;
34445               arg6 = NULL;
34446               hv_iterinit(hv);
34447               while(sv = hv_iternextsv(hv, &key, &klen)) {
34448                 bool sf;
34449                 char *tmp = sv_to_utf8_string(sv, NULL, &sf);
34450                 arg6 = CSLAddNameValue(arg6, key, tmp);
34451                 if (sf) Safefree(tmp); else free(tmp);
34452               }
34453             } else
34454             do_confess(NEED_REF, 1);
34455           } else
34456           do_confess(NEED_REF, 1);
34457         }
34458       }
34459     }
34460     {
34461       if (!arg1) {
34462         SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
34463       }
34464     }
34465     {
34466       if (!arg2) {
34467         SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
34468       }
34469     }
34470     {
34471       CPLErrorReset();
34472       result = (GDALDatasetShadow *)ApplyVerticalShiftGrid(arg1,arg2,arg3,arg4,arg5,arg6);
34473       CPLErr eclass = CPLGetLastErrorType();
34474       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
34475         do_confess( CPLGetLastErrorMsg(), 0 );
34476 
34477 
34478 
34479 
34480 
34481       }
34482 
34483 
34484       /*
34485           Make warnings regular Perl warnings. This duplicates the warning
34486           message if DontUseExceptions() is in effect (it is not by default).
34487           */
34488       if ( eclass == CE_Warning ) {
34489         warn( CPLGetLastErrorMsg(), "%s" );
34490       }
34491 
34492 
34493     }
34494     ST(argvi) = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GDALDatasetShadow, SWIG_OWNER | SWIG_SHADOW); argvi++ ;
34495 
34496 
34497 
34498 
34499 
34500     {
34501       /* %typemap(freearg) char **options */
34502       if (arg6) CSLDestroy( arg6 );
34503     }
34504     XSRETURN(argvi);
34505   fail:
34506 
34507 
34508 
34509 
34510 
34511     {
34512       /* %typemap(freearg) char **options */
34513       if (arg6) CSLDestroy( arg6 );
34514     }
34515     SWIG_croak_null();
34516   }
34517 }
34518 
34519 
XS(_wrap_ApplyGeoTransform)34520 XS(_wrap_ApplyGeoTransform) {
34521   {
34522     double *arg1 ;
34523     double arg2 ;
34524     double arg3 ;
34525     double *arg4 = (double *) 0 ;
34526     double *arg5 = (double *) 0 ;
34527     double argin1[6] ;
34528     double val2 ;
34529     int ecode2 = 0 ;
34530     double val3 ;
34531     int ecode3 = 0 ;
34532     double temp4 ;
34533     int res4 = SWIG_TMPOBJ ;
34534     double temp5 ;
34535     int res5 = SWIG_TMPOBJ ;
34536     int argvi = 0;
34537     dXSARGS;
34538 
34539     arg4 = &temp4;
34540     arg5 = &temp5;
34541     if ((items < 3) || (items > 3)) {
34542       SWIG_croak("Usage: ApplyGeoTransform(padfGeoTransform,dfPixel,dfLine);");
34543     }
34544     {
34545       /* %typemap(in) (double argin1[ANY]) */
34546       if (!(SvROK(ST(0)) && (SvTYPE(SvRV(ST(0)))==SVt_PVAV)))
34547       do_confess(NEED_ARRAY_REF, 1);
34548       arg1 = argin1;
34549       AV *av = (AV*)(SvRV(ST(0)));
34550       if (av_len(av)+1 < 6)
34551       do_confess(NOT_ENOUGH_ELEMENTS, 1);
34552       for (unsigned int i=0; i<6; i++) {
34553         SV *sv = *av_fetch(av, i, 0);
34554         if (!SvOK(sv))
34555         do_confess(NEED_DEF, 1);
34556         arg1[i] =  SvNV(sv);
34557       }
34558     }
34559     ecode2 = SWIG_AsVal_double SWIG_PERL_CALL_ARGS_2(ST(1), &val2);
34560     if (!SWIG_IsOK(ecode2)) {
34561       SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "ApplyGeoTransform" "', argument " "2"" of type '" "double""'");
34562     }
34563     arg2 = static_cast< double >(val2);
34564     ecode3 = SWIG_AsVal_double SWIG_PERL_CALL_ARGS_2(ST(2), &val3);
34565     if (!SWIG_IsOK(ecode3)) {
34566       SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "ApplyGeoTransform" "', argument " "3"" of type '" "double""'");
34567     }
34568     arg3 = static_cast< double >(val3);
34569     {
34570       CPLErrorReset();
34571       GDALApplyGeoTransform(arg1,arg2,arg3,arg4,arg5);
34572       CPLErr eclass = CPLGetLastErrorType();
34573       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
34574         do_confess( CPLGetLastErrorMsg(), 0 );
34575 
34576 
34577 
34578 
34579 
34580       }
34581 
34582 
34583       /*
34584           Make warnings regular Perl warnings. This duplicates the warning
34585           message if DontUseExceptions() is in effect (it is not by default).
34586           */
34587       if ( eclass == CE_Warning ) {
34588         warn( CPLGetLastErrorMsg(), "%s" );
34589       }
34590 
34591 
34592     }
34593     {
34594       /* %typemap(out) void */
34595     }
34596     if (SWIG_IsTmpObj(res4)) {
34597       if (argvi >= items) EXTEND(sp,1);  ST(argvi) = SWIG_From_double  SWIG_PERL_CALL_ARGS_1((*arg4)); argvi++  ;
34598     } else {
34599       int new_flags = SWIG_IsNewObj(res4) ? (SWIG_POINTER_OWN | 0) : 0;
34600       if (argvi >= items) EXTEND(sp,1);  ST(argvi) = SWIG_NewPointerObj((void*)(arg4), SWIGTYPE_p_double, new_flags); argvi++  ;
34601     }
34602     if (SWIG_IsTmpObj(res5)) {
34603       if (argvi >= items) EXTEND(sp,1);  ST(argvi) = SWIG_From_double  SWIG_PERL_CALL_ARGS_1((*arg5)); argvi++  ;
34604     } else {
34605       int new_flags = SWIG_IsNewObj(res5) ? (SWIG_POINTER_OWN | 0) : 0;
34606       if (argvi >= items) EXTEND(sp,1);  ST(argvi) = SWIG_NewPointerObj((void*)(arg5), SWIGTYPE_p_double, new_flags); argvi++  ;
34607     }
34608 
34609 
34610 
34611 
34612 
34613     XSRETURN(argvi);
34614   fail:
34615 
34616 
34617 
34618 
34619 
34620     SWIG_croak_null();
34621   }
34622 }
34623 
34624 
XS(_wrap_InvGeoTransform)34625 XS(_wrap_InvGeoTransform) {
34626   {
34627     double *arg1 ;
34628     double *arg2 ;
34629     double argin1[6] ;
34630     double argout2[6] ;
34631     int argvi = 0;
34632     RETURN_NONE result;
34633     dXSARGS;
34634 
34635     {
34636       /* %typemap(in,numinputs=0) (double argout2[ANY]) */
34637       arg2 = argout2;
34638     }
34639     if ((items < 1) || (items > 1)) {
34640       SWIG_croak("Usage: InvGeoTransform(gt_in);");
34641     }
34642     {
34643       /* %typemap(in) (double argin1[ANY]) */
34644       if (!(SvROK(ST(0)) && (SvTYPE(SvRV(ST(0)))==SVt_PVAV)))
34645       do_confess(NEED_ARRAY_REF, 1);
34646       arg1 = argin1;
34647       AV *av = (AV*)(SvRV(ST(0)));
34648       if (av_len(av)+1 < 6)
34649       do_confess(NOT_ENOUGH_ELEMENTS, 1);
34650       for (unsigned int i=0; i<6; i++) {
34651         SV *sv = *av_fetch(av, i, 0);
34652         if (!SvOK(sv))
34653         do_confess(NEED_DEF, 1);
34654         arg1[i] =  SvNV(sv);
34655       }
34656     }
34657     {
34658       CPLErrorReset();
34659       result = (RETURN_NONE)GDALInvGeoTransform(arg1,arg2);
34660       CPLErr eclass = CPLGetLastErrorType();
34661       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
34662         do_confess( CPLGetLastErrorMsg(), 0 );
34663 
34664 
34665 
34666 
34667 
34668       }
34669 
34670 
34671       /*
34672           Make warnings regular Perl warnings. This duplicates the warning
34673           message if DontUseExceptions() is in effect (it is not by default).
34674           */
34675       if ( eclass == CE_Warning ) {
34676         warn( CPLGetLastErrorMsg(), "%s" );
34677       }
34678 
34679 
34680     }
34681     {
34682       /* %typemap(out) IF_FALSE_RETURN_NONE */
34683     }
34684     {
34685       /* %typemap(argout) (double argout[ANY]) */
34686       if (GIMME_V == G_ARRAY) {
34687         /* return a list */
34688         int i;
34689         EXTEND(SP, argvi+6-items+1);
34690         for (i = 0; i < 6; i++)
34691         ST(argvi++) = sv_2mortal(newSVnv(arg2[i]));
34692       } else {
34693         ST(argvi) = CreateArrayFromDoubleArray( arg2, 6 );
34694         argvi++;
34695       }
34696     }
34697 
34698 
34699     {
34700       /* %typemap(ret) IF_FALSE_RETURN_NONE */
34701       if (result == 0 ) {
34702         do_confess(CALL_FAILED, 1);
34703       }
34704     }
34705     XSRETURN(argvi);
34706   fail:
34707 
34708 
34709     SWIG_croak_null();
34710   }
34711 }
34712 
34713 
XS(_wrap_VersionInfo)34714 XS(_wrap_VersionInfo) {
34715   {
34716     char *arg1 = (char *) "VERSION_NUM" ;
34717     int res1 ;
34718     char *buf1 = 0 ;
34719     int alloc1 = 0 ;
34720     int argvi = 0;
34721     char *result = 0 ;
34722     dXSARGS;
34723 
34724     if ((items < 0) || (items > 1)) {
34725       SWIG_croak("Usage: VersionInfo(request);");
34726     }
34727     if (items > 0) {
34728       res1 = SWIG_AsCharPtrAndSize(ST(0), &buf1, NULL, &alloc1);
34729       if (!SWIG_IsOK(res1)) {
34730         SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "VersionInfo" "', argument " "1"" of type '" "char const *""'");
34731       }
34732       arg1 = reinterpret_cast< char * >(buf1);
34733     }
34734     {
34735       /* %typemap(check) (const char *request) */
34736       if (!arg1)
34737       do_confess(NEED_DEF, 1);
34738     }
34739     {
34740       CPLErrorReset();
34741       result = (char *)GDALVersionInfo((char const *)arg1);
34742       CPLErr eclass = CPLGetLastErrorType();
34743       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
34744         do_confess( CPLGetLastErrorMsg(), 0 );
34745 
34746 
34747 
34748 
34749 
34750       }
34751 
34752 
34753       /*
34754           Make warnings regular Perl warnings. This duplicates the warning
34755           message if DontUseExceptions() is in effect (it is not by default).
34756           */
34757       if ( eclass == CE_Warning ) {
34758         warn( CPLGetLastErrorMsg(), "%s" );
34759       }
34760 
34761 
34762     }
34763     {
34764       /* %typemap(out) const char * */
34765       ST(argvi) = newSVpv(result, 0);
34766       SvUTF8_on(ST(argvi)); /* expecting GDAL to give us UTF-8 */
34767       sv_2mortal(ST(argvi));
34768       argvi++;
34769     }
34770     if (alloc1 == SWIG_NEWOBJ) delete[] buf1;
34771     XSRETURN(argvi);
34772   fail:
34773     if (alloc1 == SWIG_NEWOBJ) delete[] buf1;
34774     SWIG_croak_null();
34775   }
34776 }
34777 
34778 
XS(_wrap_AllRegister)34779 XS(_wrap_AllRegister) {
34780   {
34781     int argvi = 0;
34782     dXSARGS;
34783 
34784     if ((items < 0) || (items > 0)) {
34785       SWIG_croak("Usage: AllRegister();");
34786     }
34787     {
34788       CPLErrorReset();
34789       GDALAllRegister();
34790       CPLErr eclass = CPLGetLastErrorType();
34791       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
34792         do_confess( CPLGetLastErrorMsg(), 0 );
34793 
34794 
34795 
34796 
34797 
34798       }
34799 
34800 
34801       /*
34802           Make warnings regular Perl warnings. This duplicates the warning
34803           message if DontUseExceptions() is in effect (it is not by default).
34804           */
34805       if ( eclass == CE_Warning ) {
34806         warn( CPLGetLastErrorMsg(), "%s" );
34807       }
34808 
34809 
34810     }
34811     {
34812       /* %typemap(out) void */
34813     }
34814     XSRETURN(argvi);
34815   fail:
34816     SWIG_croak_null();
34817   }
34818 }
34819 
34820 
XS(_wrap_GDALDestroyDriverManager)34821 XS(_wrap_GDALDestroyDriverManager) {
34822   {
34823     int argvi = 0;
34824     dXSARGS;
34825 
34826     if ((items < 0) || (items > 0)) {
34827       SWIG_croak("Usage: GDALDestroyDriverManager();");
34828     }
34829     {
34830       CPLErrorReset();
34831       GDALDestroyDriverManager();
34832       CPLErr eclass = CPLGetLastErrorType();
34833       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
34834         do_confess( CPLGetLastErrorMsg(), 0 );
34835 
34836 
34837 
34838 
34839 
34840       }
34841 
34842 
34843       /*
34844           Make warnings regular Perl warnings. This duplicates the warning
34845           message if DontUseExceptions() is in effect (it is not by default).
34846           */
34847       if ( eclass == CE_Warning ) {
34848         warn( CPLGetLastErrorMsg(), "%s" );
34849       }
34850 
34851 
34852     }
34853     {
34854       /* %typemap(out) void */
34855     }
34856     XSRETURN(argvi);
34857   fail:
34858     SWIG_croak_null();
34859   }
34860 }
34861 
34862 
XS(_wrap_GetCacheMax)34863 XS(_wrap_GetCacheMax) {
34864   {
34865     int argvi = 0;
34866     GIntBig result;
34867     dXSARGS;
34868 
34869     if ((items < 0) || (items > 0)) {
34870       SWIG_croak("Usage: GetCacheMax();");
34871     }
34872     {
34873       CPLErrorReset();
34874       result = wrapper_GDALGetCacheMax();
34875       CPLErr eclass = CPLGetLastErrorType();
34876       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
34877         do_confess( CPLGetLastErrorMsg(), 0 );
34878 
34879 
34880 
34881 
34882 
34883       }
34884 
34885 
34886       /*
34887           Make warnings regular Perl warnings. This duplicates the warning
34888           message if DontUseExceptions() is in effect (it is not by default).
34889           */
34890       if ( eclass == CE_Warning ) {
34891         warn( CPLGetLastErrorMsg(), "%s" );
34892       }
34893 
34894 
34895     }
34896     {
34897       char temp[256];
34898       sprintf(temp, "" CPL_FRMT_GIB "", result);
34899       ST(argvi) = sv_2mortal(newSVpv(temp, 0));
34900       argvi++;
34901     }
34902     XSRETURN(argvi);
34903   fail:
34904     SWIG_croak_null();
34905   }
34906 }
34907 
34908 
XS(_wrap_GetCacheUsed)34909 XS(_wrap_GetCacheUsed) {
34910   {
34911     int argvi = 0;
34912     GIntBig result;
34913     dXSARGS;
34914 
34915     if ((items < 0) || (items > 0)) {
34916       SWIG_croak("Usage: GetCacheUsed();");
34917     }
34918     {
34919       CPLErrorReset();
34920       result = wrapper_GDALGetCacheUsed();
34921       CPLErr eclass = CPLGetLastErrorType();
34922       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
34923         do_confess( CPLGetLastErrorMsg(), 0 );
34924 
34925 
34926 
34927 
34928 
34929       }
34930 
34931 
34932       /*
34933           Make warnings regular Perl warnings. This duplicates the warning
34934           message if DontUseExceptions() is in effect (it is not by default).
34935           */
34936       if ( eclass == CE_Warning ) {
34937         warn( CPLGetLastErrorMsg(), "%s" );
34938       }
34939 
34940 
34941     }
34942     {
34943       char temp[256];
34944       sprintf(temp, "" CPL_FRMT_GIB "", result);
34945       ST(argvi) = sv_2mortal(newSVpv(temp, 0));
34946       argvi++;
34947     }
34948     XSRETURN(argvi);
34949   fail:
34950     SWIG_croak_null();
34951   }
34952 }
34953 
34954 
XS(_wrap_SetCacheMax)34955 XS(_wrap_SetCacheMax) {
34956   {
34957     GIntBig arg1 ;
34958     int argvi = 0;
34959     dXSARGS;
34960 
34961     if ((items < 1) || (items > 1)) {
34962       SWIG_croak("Usage: SetCacheMax(nBytes);");
34963     }
34964     {
34965       arg1 = CPLAtoGIntBig(SvPV_nolen(ST(0)));
34966     }
34967     {
34968       CPLErrorReset();
34969       wrapper_GDALSetCacheMax(arg1);
34970       CPLErr eclass = CPLGetLastErrorType();
34971       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
34972         do_confess( CPLGetLastErrorMsg(), 0 );
34973 
34974 
34975 
34976 
34977 
34978       }
34979 
34980 
34981       /*
34982           Make warnings regular Perl warnings. This duplicates the warning
34983           message if DontUseExceptions() is in effect (it is not by default).
34984           */
34985       if ( eclass == CE_Warning ) {
34986         warn( CPLGetLastErrorMsg(), "%s" );
34987       }
34988 
34989 
34990     }
34991     {
34992       /* %typemap(out) void */
34993     }
34994     XSRETURN(argvi);
34995   fail:
34996     SWIG_croak_null();
34997   }
34998 }
34999 
35000 
XS(_wrap__GetDataTypeSize)35001 XS(_wrap__GetDataTypeSize) {
35002   {
35003     GDALDataType arg1 ;
35004     int val1 ;
35005     int ecode1 = 0 ;
35006     int argvi = 0;
35007     int result;
35008     dXSARGS;
35009 
35010     if ((items < 1) || (items > 1)) {
35011       SWIG_croak("Usage: _GetDataTypeSize(eDataType);");
35012     }
35013     ecode1 = SWIG_AsVal_int SWIG_PERL_CALL_ARGS_2(ST(0), &val1);
35014     if (!SWIG_IsOK(ecode1)) {
35015       SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "_GetDataTypeSize" "', argument " "1"" of type '" "GDALDataType""'");
35016     }
35017     arg1 = static_cast< GDALDataType >(val1);
35018     {
35019       CPLErrorReset();
35020       result = (int)GDALGetDataTypeSize(arg1);
35021       CPLErr eclass = CPLGetLastErrorType();
35022       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
35023         do_confess( CPLGetLastErrorMsg(), 0 );
35024 
35025 
35026 
35027 
35028 
35029       }
35030 
35031 
35032       /*
35033           Make warnings regular Perl warnings. This duplicates the warning
35034           message if DontUseExceptions() is in effect (it is not by default).
35035           */
35036       if ( eclass == CE_Warning ) {
35037         warn( CPLGetLastErrorMsg(), "%s" );
35038       }
35039 
35040 
35041     }
35042     ST(argvi) = SWIG_From_int  SWIG_PERL_CALL_ARGS_1(static_cast< int >(result)); argvi++ ;
35043 
35044     XSRETURN(argvi);
35045   fail:
35046 
35047     SWIG_croak_null();
35048   }
35049 }
35050 
35051 
XS(_wrap__DataTypeIsComplex)35052 XS(_wrap__DataTypeIsComplex) {
35053   {
35054     GDALDataType arg1 ;
35055     int val1 ;
35056     int ecode1 = 0 ;
35057     int argvi = 0;
35058     int result;
35059     dXSARGS;
35060 
35061     if ((items < 1) || (items > 1)) {
35062       SWIG_croak("Usage: _DataTypeIsComplex(eDataType);");
35063     }
35064     ecode1 = SWIG_AsVal_int SWIG_PERL_CALL_ARGS_2(ST(0), &val1);
35065     if (!SWIG_IsOK(ecode1)) {
35066       SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "_DataTypeIsComplex" "', argument " "1"" of type '" "GDALDataType""'");
35067     }
35068     arg1 = static_cast< GDALDataType >(val1);
35069     {
35070       CPLErrorReset();
35071       result = (int)GDALDataTypeIsComplex(arg1);
35072       CPLErr eclass = CPLGetLastErrorType();
35073       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
35074         do_confess( CPLGetLastErrorMsg(), 0 );
35075 
35076 
35077 
35078 
35079 
35080       }
35081 
35082 
35083       /*
35084           Make warnings regular Perl warnings. This duplicates the warning
35085           message if DontUseExceptions() is in effect (it is not by default).
35086           */
35087       if ( eclass == CE_Warning ) {
35088         warn( CPLGetLastErrorMsg(), "%s" );
35089       }
35090 
35091 
35092     }
35093     ST(argvi) = SWIG_From_int  SWIG_PERL_CALL_ARGS_1(static_cast< int >(result)); argvi++ ;
35094 
35095     XSRETURN(argvi);
35096   fail:
35097 
35098     SWIG_croak_null();
35099   }
35100 }
35101 
35102 
XS(_wrap_GetDataTypeName)35103 XS(_wrap_GetDataTypeName) {
35104   {
35105     GDALDataType arg1 ;
35106     int val1 ;
35107     int ecode1 = 0 ;
35108     int argvi = 0;
35109     char *result = 0 ;
35110     dXSARGS;
35111 
35112     if ((items < 1) || (items > 1)) {
35113       SWIG_croak("Usage: GetDataTypeName(eDataType);");
35114     }
35115     ecode1 = SWIG_AsVal_int SWIG_PERL_CALL_ARGS_2(ST(0), &val1);
35116     if (!SWIG_IsOK(ecode1)) {
35117       SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "GetDataTypeName" "', argument " "1"" of type '" "GDALDataType""'");
35118     }
35119     arg1 = static_cast< GDALDataType >(val1);
35120     {
35121       CPLErrorReset();
35122       result = (char *)GDALGetDataTypeName(arg1);
35123       CPLErr eclass = CPLGetLastErrorType();
35124       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
35125         do_confess( CPLGetLastErrorMsg(), 0 );
35126 
35127 
35128 
35129 
35130 
35131       }
35132 
35133 
35134       /*
35135           Make warnings regular Perl warnings. This duplicates the warning
35136           message if DontUseExceptions() is in effect (it is not by default).
35137           */
35138       if ( eclass == CE_Warning ) {
35139         warn( CPLGetLastErrorMsg(), "%s" );
35140       }
35141 
35142 
35143     }
35144     {
35145       /* %typemap(out) const char * */
35146       ST(argvi) = newSVpv(result, 0);
35147       SvUTF8_on(ST(argvi)); /* expecting GDAL to give us UTF-8 */
35148       sv_2mortal(ST(argvi));
35149       argvi++;
35150     }
35151 
35152     XSRETURN(argvi);
35153   fail:
35154 
35155     SWIG_croak_null();
35156   }
35157 }
35158 
35159 
XS(_wrap_GetDataTypeByName)35160 XS(_wrap_GetDataTypeByName) {
35161   {
35162     char *arg1 = (char *) 0 ;
35163     int res1 ;
35164     char *buf1 = 0 ;
35165     int alloc1 = 0 ;
35166     int argvi = 0;
35167     GDALDataType result;
35168     dXSARGS;
35169 
35170     if ((items < 1) || (items > 1)) {
35171       SWIG_croak("Usage: GetDataTypeByName(pszDataTypeName);");
35172     }
35173     res1 = SWIG_AsCharPtrAndSize(ST(0), &buf1, NULL, &alloc1);
35174     if (!SWIG_IsOK(res1)) {
35175       SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "GetDataTypeByName" "', argument " "1"" of type '" "char const *""'");
35176     }
35177     arg1 = reinterpret_cast< char * >(buf1);
35178     {
35179       CPLErrorReset();
35180       result = (GDALDataType)GDALGetDataTypeByName((char const *)arg1);
35181       CPLErr eclass = CPLGetLastErrorType();
35182       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
35183         do_confess( CPLGetLastErrorMsg(), 0 );
35184 
35185 
35186 
35187 
35188 
35189       }
35190 
35191 
35192       /*
35193           Make warnings regular Perl warnings. This duplicates the warning
35194           message if DontUseExceptions() is in effect (it is not by default).
35195           */
35196       if ( eclass == CE_Warning ) {
35197         warn( CPLGetLastErrorMsg(), "%s" );
35198       }
35199 
35200 
35201     }
35202     ST(argvi) = SWIG_From_int  SWIG_PERL_CALL_ARGS_1(static_cast< int >(result)); argvi++ ;
35203     if (alloc1 == SWIG_NEWOBJ) delete[] buf1;
35204     XSRETURN(argvi);
35205   fail:
35206     if (alloc1 == SWIG_NEWOBJ) delete[] buf1;
35207     SWIG_croak_null();
35208   }
35209 }
35210 
35211 
XS(_wrap_GetColorInterpretationName)35212 XS(_wrap_GetColorInterpretationName) {
35213   {
35214     GDALColorInterp arg1 ;
35215     int val1 ;
35216     int ecode1 = 0 ;
35217     int argvi = 0;
35218     char *result = 0 ;
35219     dXSARGS;
35220 
35221     if ((items < 1) || (items > 1)) {
35222       SWIG_croak("Usage: GetColorInterpretationName(eColorInterp);");
35223     }
35224     ecode1 = SWIG_AsVal_int SWIG_PERL_CALL_ARGS_2(ST(0), &val1);
35225     if (!SWIG_IsOK(ecode1)) {
35226       SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "GetColorInterpretationName" "', argument " "1"" of type '" "GDALColorInterp""'");
35227     }
35228     arg1 = static_cast< GDALColorInterp >(val1);
35229     {
35230       CPLErrorReset();
35231       result = (char *)GDALGetColorInterpretationName(arg1);
35232       CPLErr eclass = CPLGetLastErrorType();
35233       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
35234         do_confess( CPLGetLastErrorMsg(), 0 );
35235 
35236 
35237 
35238 
35239 
35240       }
35241 
35242 
35243       /*
35244           Make warnings regular Perl warnings. This duplicates the warning
35245           message if DontUseExceptions() is in effect (it is not by default).
35246           */
35247       if ( eclass == CE_Warning ) {
35248         warn( CPLGetLastErrorMsg(), "%s" );
35249       }
35250 
35251 
35252     }
35253     {
35254       /* %typemap(out) const char * */
35255       ST(argvi) = newSVpv(result, 0);
35256       SvUTF8_on(ST(argvi)); /* expecting GDAL to give us UTF-8 */
35257       sv_2mortal(ST(argvi));
35258       argvi++;
35259     }
35260 
35261     XSRETURN(argvi);
35262   fail:
35263 
35264     SWIG_croak_null();
35265   }
35266 }
35267 
35268 
XS(_wrap_GetPaletteInterpretationName)35269 XS(_wrap_GetPaletteInterpretationName) {
35270   {
35271     GDALPaletteInterp arg1 ;
35272     int val1 ;
35273     int ecode1 = 0 ;
35274     int argvi = 0;
35275     char *result = 0 ;
35276     dXSARGS;
35277 
35278     if ((items < 1) || (items > 1)) {
35279       SWIG_croak("Usage: GetPaletteInterpretationName(ePaletteInterp);");
35280     }
35281     ecode1 = SWIG_AsVal_int SWIG_PERL_CALL_ARGS_2(ST(0), &val1);
35282     if (!SWIG_IsOK(ecode1)) {
35283       SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "GetPaletteInterpretationName" "', argument " "1"" of type '" "GDALPaletteInterp""'");
35284     }
35285     arg1 = static_cast< GDALPaletteInterp >(val1);
35286     {
35287       CPLErrorReset();
35288       result = (char *)GDALGetPaletteInterpretationName(arg1);
35289       CPLErr eclass = CPLGetLastErrorType();
35290       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
35291         do_confess( CPLGetLastErrorMsg(), 0 );
35292 
35293 
35294 
35295 
35296 
35297       }
35298 
35299 
35300       /*
35301           Make warnings regular Perl warnings. This duplicates the warning
35302           message if DontUseExceptions() is in effect (it is not by default).
35303           */
35304       if ( eclass == CE_Warning ) {
35305         warn( CPLGetLastErrorMsg(), "%s" );
35306       }
35307 
35308 
35309     }
35310     {
35311       /* %typemap(out) const char * */
35312       ST(argvi) = newSVpv(result, 0);
35313       SvUTF8_on(ST(argvi)); /* expecting GDAL to give us UTF-8 */
35314       sv_2mortal(ST(argvi));
35315       argvi++;
35316     }
35317 
35318     XSRETURN(argvi);
35319   fail:
35320 
35321     SWIG_croak_null();
35322   }
35323 }
35324 
35325 
XS(_wrap_DecToDMS)35326 XS(_wrap_DecToDMS) {
35327   {
35328     double arg1 ;
35329     char *arg2 = (char *) 0 ;
35330     int arg3 = (int) 2 ;
35331     double val1 ;
35332     int ecode1 = 0 ;
35333     int res2 ;
35334     char *buf2 = 0 ;
35335     int alloc2 = 0 ;
35336     int val3 ;
35337     int ecode3 = 0 ;
35338     int argvi = 0;
35339     char *result = 0 ;
35340     dXSARGS;
35341 
35342     if ((items < 2) || (items > 3)) {
35343       SWIG_croak("Usage: DecToDMS(double,char const *,int);");
35344     }
35345     ecode1 = SWIG_AsVal_double SWIG_PERL_CALL_ARGS_2(ST(0), &val1);
35346     if (!SWIG_IsOK(ecode1)) {
35347       SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "DecToDMS" "', argument " "1"" of type '" "double""'");
35348     }
35349     arg1 = static_cast< double >(val1);
35350     res2 = SWIG_AsCharPtrAndSize(ST(1), &buf2, NULL, &alloc2);
35351     if (!SWIG_IsOK(res2)) {
35352       SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "DecToDMS" "', argument " "2"" of type '" "char const *""'");
35353     }
35354     arg2 = reinterpret_cast< char * >(buf2);
35355     if (items > 2) {
35356       ecode3 = SWIG_AsVal_int SWIG_PERL_CALL_ARGS_2(ST(2), &val3);
35357       if (!SWIG_IsOK(ecode3)) {
35358         SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "DecToDMS" "', argument " "3"" of type '" "int""'");
35359       }
35360       arg3 = static_cast< int >(val3);
35361     }
35362     {
35363       CPLErrorReset();
35364       result = (char *)GDALDecToDMS(arg1,(char const *)arg2,arg3);
35365       CPLErr eclass = CPLGetLastErrorType();
35366       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
35367         do_confess( CPLGetLastErrorMsg(), 0 );
35368 
35369 
35370 
35371 
35372 
35373       }
35374 
35375 
35376       /*
35377           Make warnings regular Perl warnings. This duplicates the warning
35378           message if DontUseExceptions() is in effect (it is not by default).
35379           */
35380       if ( eclass == CE_Warning ) {
35381         warn( CPLGetLastErrorMsg(), "%s" );
35382       }
35383 
35384 
35385     }
35386     {
35387       /* %typemap(out) const char * */
35388       ST(argvi) = newSVpv(result, 0);
35389       SvUTF8_on(ST(argvi)); /* expecting GDAL to give us UTF-8 */
35390       sv_2mortal(ST(argvi));
35391       argvi++;
35392     }
35393 
35394     if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
35395 
35396     XSRETURN(argvi);
35397   fail:
35398 
35399     if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
35400 
35401     SWIG_croak_null();
35402   }
35403 }
35404 
35405 
XS(_wrap_PackedDMSToDec)35406 XS(_wrap_PackedDMSToDec) {
35407   {
35408     double arg1 ;
35409     double val1 ;
35410     int ecode1 = 0 ;
35411     int argvi = 0;
35412     double result;
35413     dXSARGS;
35414 
35415     if ((items < 1) || (items > 1)) {
35416       SWIG_croak("Usage: PackedDMSToDec(dfPacked);");
35417     }
35418     ecode1 = SWIG_AsVal_double SWIG_PERL_CALL_ARGS_2(ST(0), &val1);
35419     if (!SWIG_IsOK(ecode1)) {
35420       SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "PackedDMSToDec" "', argument " "1"" of type '" "double""'");
35421     }
35422     arg1 = static_cast< double >(val1);
35423     {
35424       CPLErrorReset();
35425       result = (double)GDALPackedDMSToDec(arg1);
35426       CPLErr eclass = CPLGetLastErrorType();
35427       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
35428         do_confess( CPLGetLastErrorMsg(), 0 );
35429 
35430 
35431 
35432 
35433 
35434       }
35435 
35436 
35437       /*
35438           Make warnings regular Perl warnings. This duplicates the warning
35439           message if DontUseExceptions() is in effect (it is not by default).
35440           */
35441       if ( eclass == CE_Warning ) {
35442         warn( CPLGetLastErrorMsg(), "%s" );
35443       }
35444 
35445 
35446     }
35447     ST(argvi) = SWIG_From_double  SWIG_PERL_CALL_ARGS_1(static_cast< double >(result)); argvi++ ;
35448 
35449     XSRETURN(argvi);
35450   fail:
35451 
35452     SWIG_croak_null();
35453   }
35454 }
35455 
35456 
XS(_wrap_DecToPackedDMS)35457 XS(_wrap_DecToPackedDMS) {
35458   {
35459     double arg1 ;
35460     double val1 ;
35461     int ecode1 = 0 ;
35462     int argvi = 0;
35463     double result;
35464     dXSARGS;
35465 
35466     if ((items < 1) || (items > 1)) {
35467       SWIG_croak("Usage: DecToPackedDMS(dfDec);");
35468     }
35469     ecode1 = SWIG_AsVal_double SWIG_PERL_CALL_ARGS_2(ST(0), &val1);
35470     if (!SWIG_IsOK(ecode1)) {
35471       SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "DecToPackedDMS" "', argument " "1"" of type '" "double""'");
35472     }
35473     arg1 = static_cast< double >(val1);
35474     {
35475       CPLErrorReset();
35476       result = (double)GDALDecToPackedDMS(arg1);
35477       CPLErr eclass = CPLGetLastErrorType();
35478       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
35479         do_confess( CPLGetLastErrorMsg(), 0 );
35480 
35481 
35482 
35483 
35484 
35485       }
35486 
35487 
35488       /*
35489           Make warnings regular Perl warnings. This duplicates the warning
35490           message if DontUseExceptions() is in effect (it is not by default).
35491           */
35492       if ( eclass == CE_Warning ) {
35493         warn( CPLGetLastErrorMsg(), "%s" );
35494       }
35495 
35496 
35497     }
35498     ST(argvi) = SWIG_From_double  SWIG_PERL_CALL_ARGS_1(static_cast< double >(result)); argvi++ ;
35499 
35500     XSRETURN(argvi);
35501   fail:
35502 
35503     SWIG_croak_null();
35504   }
35505 }
35506 
35507 
XS(_wrap_ParseXMLString)35508 XS(_wrap_ParseXMLString) {
35509   {
35510     char *arg1 = (char *) 0 ;
35511     int res1 ;
35512     char *buf1 = 0 ;
35513     int alloc1 = 0 ;
35514     int argvi = 0;
35515     CPLXMLNode *result = 0 ;
35516     dXSARGS;
35517 
35518     if ((items < 1) || (items > 1)) {
35519       SWIG_croak("Usage: ParseXMLString(pszXMLString);");
35520     }
35521     res1 = SWIG_AsCharPtrAndSize(ST(0), &buf1, NULL, &alloc1);
35522     if (!SWIG_IsOK(res1)) {
35523       SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ParseXMLString" "', argument " "1"" of type '" "char *""'");
35524     }
35525     arg1 = reinterpret_cast< char * >(buf1);
35526     {
35527       CPLErrorReset();
35528       result = (CPLXMLNode *)CPLParseXMLString(arg1);
35529       CPLErr eclass = CPLGetLastErrorType();
35530       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
35531         do_confess( CPLGetLastErrorMsg(), 0 );
35532 
35533 
35534 
35535 
35536 
35537       }
35538 
35539 
35540       /*
35541           Make warnings regular Perl warnings. This duplicates the warning
35542           message if DontUseExceptions() is in effect (it is not by default).
35543           */
35544       if ( eclass == CE_Warning ) {
35545         warn( CPLGetLastErrorMsg(), "%s" );
35546       }
35547 
35548 
35549     }
35550     {
35551       /* %typemap(out) (CPLXMLNode*) */
35552       ST(argvi) = newRV((SV*)XMLTreeToAV( result ));
35553       sv_2mortal(ST(argvi));
35554       argvi++;
35555     }
35556     if (alloc1 == SWIG_NEWOBJ) delete[] buf1;
35557     {
35558       /* %typemap(ret) (CPLXMLNode*) */
35559       if ( result ) CPLDestroyXMLNode( result );
35560     }
35561     XSRETURN(argvi);
35562   fail:
35563     if (alloc1 == SWIG_NEWOBJ) delete[] buf1;
35564     SWIG_croak_null();
35565   }
35566 }
35567 
35568 
XS(_wrap_SerializeXMLTree)35569 XS(_wrap_SerializeXMLTree) {
35570   {
35571     CPLXMLNode *arg1 = (CPLXMLNode *) 0 ;
35572     int argvi = 0;
35573     retStringAndCPLFree *result = 0 ;
35574     dXSARGS;
35575 
35576     if ((items < 1) || (items > 1)) {
35577       SWIG_croak("Usage: SerializeXMLTree(xmlnode);");
35578     }
35579     {
35580       /* %typemap(in) (CPLXMLNode* xmlnode ) */
35581       if (!(SvROK(ST(0)) && (SvTYPE(SvRV(ST(0)))==SVt_PVAV)))
35582       do_confess(NEED_ARRAY_REF, 1);
35583       AV *av = (AV*)(SvRV(ST(0)));
35584       int err;
35585       arg1 = AVToXMLTree( av, &err );
35586       if ( !arg1 ) {
35587         switch (err) {
35588         case 1:
35589           do_confess(ARRAY_TO_XML_FAILED " " NEED_DEF, 1);
35590         case 2:
35591           do_confess(ARRAY_TO_XML_FAILED " " NEED_ARRAY_REF, 1);
35592         }
35593       }
35594     }
35595     {
35596       CPLErrorReset();
35597       result = (retStringAndCPLFree *)CPLSerializeXMLTree(arg1);
35598       CPLErr eclass = CPLGetLastErrorType();
35599       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
35600         do_confess( CPLGetLastErrorMsg(), 0 );
35601 
35602 
35603 
35604 
35605 
35606       }
35607 
35608 
35609       /*
35610           Make warnings regular Perl warnings. This duplicates the warning
35611           message if DontUseExceptions() is in effect (it is not by default).
35612           */
35613       if ( eclass == CE_Warning ) {
35614         warn( CPLGetLastErrorMsg(), "%s" );
35615       }
35616 
35617 
35618     }
35619 
35620     /* %typemap(out) (retStringAndCPLFree*) */
35621     if(result)
35622     {
35623       ST(argvi) = SWIG_FromCharPtr((const char *)result);
35624       CPLFree(result);
35625     }
35626     else
35627     {
35628       ST(argvi) = &PL_sv_undef;
35629     }
35630     argvi++ ;
35631 
35632     {
35633       /* %typemap(freearg) (CPLXMLNode *xmlnode) */
35634       if ( arg1 ) CPLDestroyXMLNode( arg1 );
35635     }
35636     XSRETURN(argvi);
35637   fail:
35638     {
35639       /* %typemap(freearg) (CPLXMLNode *xmlnode) */
35640       if ( arg1 ) CPLDestroyXMLNode( arg1 );
35641     }
35642     SWIG_croak_null();
35643   }
35644 }
35645 
35646 
XS(_wrap_GetJPEG2000StructureAsString)35647 XS(_wrap_GetJPEG2000StructureAsString) {
35648   {
35649     char *arg1 = (char *) 0 ;
35650     char **arg2 = (char **) NULL ;
35651     int res1 ;
35652     char *buf1 = 0 ;
35653     int alloc1 = 0 ;
35654     int argvi = 0;
35655     retStringAndCPLFree *result = 0 ;
35656     dXSARGS;
35657 
35658     if ((items < 1) || (items > 2)) {
35659       SWIG_croak("Usage: GetJPEG2000StructureAsString(pszFilename,options);");
35660     }
35661     res1 = SWIG_AsCharPtrAndSize(ST(0), &buf1, NULL, &alloc1);
35662     if (!SWIG_IsOK(res1)) {
35663       SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "GetJPEG2000StructureAsString" "', argument " "1"" of type '" "char const *""'");
35664     }
35665     arg1 = reinterpret_cast< char * >(buf1);
35666     if (items > 1) {
35667       {
35668         /* %typemap(in) char **options */
35669         if (SvOK(ST(1))) {
35670           if (SvROK(ST(1))) {
35671             if (SvTYPE(SvRV(ST(1)))==SVt_PVAV) {
35672               AV *av = (AV*)(SvRV(ST(1)));
35673               for (int i = 0; i < av_len(av)+1; i++) {
35674                 SV *sv = *(av_fetch(av, i, 0));
35675                 bool sf;
35676                 char *tmp = sv_to_utf8_string(sv, NULL, &sf);
35677                 arg2 = CSLAddString(arg2, tmp);
35678                 if (sf) Safefree(tmp); else free(tmp);
35679               }
35680             } else if (SvTYPE(SvRV(ST(1)))==SVt_PVHV) {
35681               HV *hv = (HV*)SvRV(ST(1));
35682               SV *sv;
35683               char *key;
35684               I32 klen;
35685               arg2 = NULL;
35686               hv_iterinit(hv);
35687               while(sv = hv_iternextsv(hv, &key, &klen)) {
35688                 bool sf;
35689                 char *tmp = sv_to_utf8_string(sv, NULL, &sf);
35690                 arg2 = CSLAddNameValue(arg2, key, tmp);
35691                 if (sf) Safefree(tmp); else free(tmp);
35692               }
35693             } else
35694             do_confess(NEED_REF, 1);
35695           } else
35696           do_confess(NEED_REF, 1);
35697         }
35698       }
35699     }
35700     {
35701       if (!arg1) {
35702         SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
35703       }
35704     }
35705     {
35706       CPLErrorReset();
35707       result = (retStringAndCPLFree *)GetJPEG2000StructureAsString((char const *)arg1,arg2);
35708       CPLErr eclass = CPLGetLastErrorType();
35709       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
35710         do_confess( CPLGetLastErrorMsg(), 0 );
35711 
35712 
35713 
35714 
35715 
35716       }
35717 
35718 
35719       /*
35720           Make warnings regular Perl warnings. This duplicates the warning
35721           message if DontUseExceptions() is in effect (it is not by default).
35722           */
35723       if ( eclass == CE_Warning ) {
35724         warn( CPLGetLastErrorMsg(), "%s" );
35725       }
35726 
35727 
35728     }
35729 
35730     /* %typemap(out) (retStringAndCPLFree*) */
35731     if(result)
35732     {
35733       ST(argvi) = SWIG_FromCharPtr((const char *)result);
35734       CPLFree(result);
35735     }
35736     else
35737     {
35738       ST(argvi) = &PL_sv_undef;
35739     }
35740     argvi++ ;
35741 
35742     if (alloc1 == SWIG_NEWOBJ) delete[] buf1;
35743     {
35744       /* %typemap(freearg) char **options */
35745       if (arg2) CSLDestroy( arg2 );
35746     }
35747     XSRETURN(argvi);
35748   fail:
35749     if (alloc1 == SWIG_NEWOBJ) delete[] buf1;
35750     {
35751       /* %typemap(freearg) char **options */
35752       if (arg2) CSLDestroy( arg2 );
35753     }
35754     SWIG_croak_null();
35755   }
35756 }
35757 
35758 
XS(_wrap_GetDriverCount)35759 XS(_wrap_GetDriverCount) {
35760   {
35761     int argvi = 0;
35762     int result;
35763     dXSARGS;
35764 
35765     if ((items < 0) || (items > 0)) {
35766       SWIG_croak("Usage: GetDriverCount();");
35767     }
35768     {
35769       CPLErrorReset();
35770       result = (int)GetDriverCount();
35771       CPLErr eclass = CPLGetLastErrorType();
35772       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
35773         do_confess( CPLGetLastErrorMsg(), 0 );
35774 
35775 
35776 
35777 
35778 
35779       }
35780 
35781 
35782       /*
35783           Make warnings regular Perl warnings. This duplicates the warning
35784           message if DontUseExceptions() is in effect (it is not by default).
35785           */
35786       if ( eclass == CE_Warning ) {
35787         warn( CPLGetLastErrorMsg(), "%s" );
35788       }
35789 
35790 
35791     }
35792     ST(argvi) = SWIG_From_int  SWIG_PERL_CALL_ARGS_1(static_cast< int >(result)); argvi++ ;
35793     XSRETURN(argvi);
35794   fail:
35795     SWIG_croak_null();
35796   }
35797 }
35798 
35799 
XS(_wrap_GetDriverByName)35800 XS(_wrap_GetDriverByName) {
35801   {
35802     char *arg1 = (char *) 0 ;
35803     int res1 ;
35804     char *buf1 = 0 ;
35805     int alloc1 = 0 ;
35806     int argvi = 0;
35807     GDALDriverShadow *result = 0 ;
35808     dXSARGS;
35809 
35810     if ((items < 1) || (items > 1)) {
35811       SWIG_croak("Usage: GetDriverByName(name);");
35812     }
35813     res1 = SWIG_AsCharPtrAndSize(ST(0), &buf1, NULL, &alloc1);
35814     if (!SWIG_IsOK(res1)) {
35815       SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "GetDriverByName" "', argument " "1"" of type '" "char const *""'");
35816     }
35817     arg1 = reinterpret_cast< char * >(buf1);
35818     {
35819       if (!arg1) {
35820         SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
35821       }
35822     }
35823     {
35824       CPLErrorReset();
35825       result = (GDALDriverShadow *)GetDriverByName((char const *)arg1);
35826       CPLErr eclass = CPLGetLastErrorType();
35827       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
35828         do_confess( CPLGetLastErrorMsg(), 0 );
35829 
35830 
35831 
35832 
35833 
35834       }
35835 
35836 
35837       /*
35838           Make warnings regular Perl warnings. This duplicates the warning
35839           message if DontUseExceptions() is in effect (it is not by default).
35840           */
35841       if ( eclass == CE_Warning ) {
35842         warn( CPLGetLastErrorMsg(), "%s" );
35843       }
35844 
35845 
35846     }
35847     ST(argvi) = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GDALDriverShadow, 0 | SWIG_SHADOW); argvi++ ;
35848     if (alloc1 == SWIG_NEWOBJ) delete[] buf1;
35849     XSRETURN(argvi);
35850   fail:
35851     if (alloc1 == SWIG_NEWOBJ) delete[] buf1;
35852     SWIG_croak_null();
35853   }
35854 }
35855 
35856 
XS(_wrap_GetDriver__SWIG_0)35857 XS(_wrap_GetDriver__SWIG_0) {
35858   {
35859     char *arg1 = (char *) 0 ;
35860     int res1 ;
35861     char *buf1 = 0 ;
35862     int alloc1 = 0 ;
35863     int argvi = 0;
35864     GDALDriverShadow *result = 0 ;
35865     dXSARGS;
35866 
35867     if ((items < 1) || (items > 1)) {
35868       SWIG_croak("Usage: GetDriver(name);");
35869     }
35870     res1 = SWIG_AsCharPtrAndSize(ST(0), &buf1, NULL, &alloc1);
35871     if (!SWIG_IsOK(res1)) {
35872       SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "GetDriver" "', argument " "1"" of type '" "char const *""'");
35873     }
35874     arg1 = reinterpret_cast< char * >(buf1);
35875     {
35876       if (!arg1) {
35877         SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
35878       }
35879     }
35880     {
35881       CPLErrorReset();
35882       result = (GDALDriverShadow *)GetDriver((char const *)arg1);
35883       CPLErr eclass = CPLGetLastErrorType();
35884       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
35885         do_confess( CPLGetLastErrorMsg(), 0 );
35886 
35887 
35888 
35889 
35890 
35891       }
35892 
35893 
35894       /*
35895           Make warnings regular Perl warnings. This duplicates the warning
35896           message if DontUseExceptions() is in effect (it is not by default).
35897           */
35898       if ( eclass == CE_Warning ) {
35899         warn( CPLGetLastErrorMsg(), "%s" );
35900       }
35901 
35902 
35903     }
35904     ST(argvi) = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GDALDriverShadow, 0 | SWIG_SHADOW); argvi++ ;
35905     if (alloc1 == SWIG_NEWOBJ) delete[] buf1;
35906     XSRETURN(argvi);
35907   fail:
35908     if (alloc1 == SWIG_NEWOBJ) delete[] buf1;
35909     SWIG_croak_null();
35910   }
35911 }
35912 
35913 
XS(_wrap_GetDriver__SWIG_1)35914 XS(_wrap_GetDriver__SWIG_1) {
35915   {
35916     int arg1 ;
35917     int val1 ;
35918     int ecode1 = 0 ;
35919     int argvi = 0;
35920     GDALDriverShadow *result = 0 ;
35921     dXSARGS;
35922 
35923     if ((items < 1) || (items > 1)) {
35924       SWIG_croak("Usage: GetDriver(i);");
35925     }
35926     ecode1 = SWIG_AsVal_int SWIG_PERL_CALL_ARGS_2(ST(0), &val1);
35927     if (!SWIG_IsOK(ecode1)) {
35928       SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "GetDriver" "', argument " "1"" of type '" "int""'");
35929     }
35930     arg1 = static_cast< int >(val1);
35931     {
35932       CPLErrorReset();
35933       result = (GDALDriverShadow *)GetDriver(arg1);
35934       CPLErr eclass = CPLGetLastErrorType();
35935       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
35936         do_confess( CPLGetLastErrorMsg(), 0 );
35937 
35938 
35939 
35940 
35941 
35942       }
35943 
35944 
35945       /*
35946           Make warnings regular Perl warnings. This duplicates the warning
35947           message if DontUseExceptions() is in effect (it is not by default).
35948           */
35949       if ( eclass == CE_Warning ) {
35950         warn( CPLGetLastErrorMsg(), "%s" );
35951       }
35952 
35953 
35954     }
35955     ST(argvi) = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GDALDriverShadow, 0 | SWIG_SHADOW); argvi++ ;
35956 
35957     XSRETURN(argvi);
35958   fail:
35959 
35960     SWIG_croak_null();
35961   }
35962 }
35963 
35964 
XS(_wrap_GetDriver)35965 XS(_wrap_GetDriver) {
35966   dXSARGS;
35967 
35968   {
35969     unsigned long _index = 0;
35970     SWIG_TypeRank _rank = 0;
35971     if (items == 1) {
35972       SWIG_TypeRank _ranki = 0;
35973       SWIG_TypeRank _rankm = 0;
35974       SWIG_TypeRank _pi = 1;
35975       int _v = 0;
35976       {
35977         {
35978           int res = SWIG_AsVal_int SWIG_PERL_CALL_ARGS_2(ST(0), NULL);
35979           _v = SWIG_CheckState(res);
35980         }
35981       }
35982       if (!_v) goto check_1;
35983       _ranki += _v*_pi;
35984       _rankm += _pi;
35985       _pi *= SWIG_MAXCASTRANK;
35986       if (!_index || (_ranki < _rank)) {
35987         _rank = _ranki; _index = 1;
35988         if (_rank == _rankm) goto dispatch;
35989       }
35990     }
35991   check_1:
35992 
35993     if (items == 1) {
35994       SWIG_TypeRank _ranki = 0;
35995       SWIG_TypeRank _rankm = 0;
35996       SWIG_TypeRank _pi = 1;
35997       int _v = 0;
35998       {
35999         int res = SWIG_AsCharPtrAndSize(ST(0), 0, NULL, 0);
36000         _v = SWIG_CheckState(res);
36001       }
36002       if (!_v) goto check_2;
36003       _ranki += _v*_pi;
36004       _rankm += _pi;
36005       _pi *= SWIG_MAXCASTRANK;
36006       if (!_index || (_ranki < _rank)) {
36007         _rank = _ranki; _index = 2;
36008         if (_rank == _rankm) goto dispatch;
36009       }
36010     }
36011   check_2:
36012 
36013   dispatch:
36014     switch(_index) {
36015     case 1:
36016       PUSHMARK(MARK); SWIG_CALLXS(_wrap_GetDriver__SWIG_1); return;
36017     case 2:
36018       PUSHMARK(MARK); SWIG_CALLXS(_wrap_GetDriver__SWIG_0); return;
36019     }
36020   }
36021 
36022   croak("No matching function for overloaded 'GetDriver'");
36023   XSRETURN(0);
36024 }
36025 
36026 
XS(_wrap__Open)36027 XS(_wrap__Open) {
36028   {
36029     char *arg1 = (char *) 0 ;
36030     GDALAccess arg2 = (GDALAccess) GA_ReadOnly ;
36031     U8 *tmpbuf1 = NULL ;
36032     int val2 ;
36033     int ecode2 = 0 ;
36034     int argvi = 0;
36035     GDALDatasetShadow *result = 0 ;
36036     dXSARGS;
36037 
36038     {
36039       /* %typemap(default) const char * utf8_path */
36040       arg1 = (char *)"";
36041     }
36042     if ((items < 0) || (items > 2)) {
36043       SWIG_croak("Usage: _Open(utf8_path,eAccess);");
36044     }
36045     if (items > 0) {
36046       {
36047         /* %typemap(in,numinputs=1) (const char* utf8_path) (U8 *tmpbuf1) */
36048         arg1 = sv_to_utf8_string(ST(0), &tmpbuf1);
36049       }
36050     }
36051     if (items > 1) {
36052       ecode2 = SWIG_AsVal_int SWIG_PERL_CALL_ARGS_2(ST(1), &val2);
36053       if (!SWIG_IsOK(ecode2)) {
36054         SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "_Open" "', argument " "2"" of type '" "GDALAccess""'");
36055       }
36056       arg2 = static_cast< GDALAccess >(val2);
36057     }
36058     {
36059       if (!arg1) {
36060         SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
36061       }
36062     }
36063     {
36064       CPLErrorReset();
36065       result = (GDALDatasetShadow *)Open((char const *)arg1,arg2);
36066       CPLErr eclass = CPLGetLastErrorType();
36067       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
36068         do_confess( CPLGetLastErrorMsg(), 0 );
36069 
36070 
36071 
36072 
36073 
36074       }
36075 
36076 
36077       /*
36078           Make warnings regular Perl warnings. This duplicates the warning
36079           message if DontUseExceptions() is in effect (it is not by default).
36080           */
36081       if ( eclass == CE_Warning ) {
36082         warn( CPLGetLastErrorMsg(), "%s" );
36083       }
36084 
36085 
36086     }
36087     ST(argvi) = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GDALDatasetShadow, SWIG_OWNER | SWIG_SHADOW); argvi++ ;
36088     {
36089       /* %typemap(freearg) (const char* utf8_path) */
36090       if (tmpbuf1) Safefree(tmpbuf1);
36091     }
36092 
36093     XSRETURN(argvi);
36094   fail:
36095     {
36096       /* %typemap(freearg) (const char* utf8_path) */
36097       if (tmpbuf1) Safefree(tmpbuf1);
36098     }
36099 
36100     SWIG_croak_null();
36101   }
36102 }
36103 
36104 
XS(_wrap__OpenEx)36105 XS(_wrap__OpenEx) {
36106   {
36107     char *arg1 = (char *) 0 ;
36108     unsigned int arg2 = (unsigned int) 0 ;
36109     char **arg3 = (char **) NULL ;
36110     char **arg4 = (char **) NULL ;
36111     char **arg5 = (char **) NULL ;
36112     U8 *tmpbuf1 = NULL ;
36113     unsigned int val2 ;
36114     int ecode2 = 0 ;
36115     int argvi = 0;
36116     GDALDatasetShadow *result = 0 ;
36117     dXSARGS;
36118 
36119     {
36120       /* %typemap(default) const char * utf8_path */
36121       arg1 = (char *)"";
36122     }
36123     if ((items < 0) || (items > 5)) {
36124       SWIG_croak("Usage: _OpenEx(utf8_path,nOpenFlags,allowed_drivers,open_options,sibling_files);");
36125     }
36126     if (items > 0) {
36127       {
36128         /* %typemap(in,numinputs=1) (const char* utf8_path) (U8 *tmpbuf1) */
36129         arg1 = sv_to_utf8_string(ST(0), &tmpbuf1);
36130       }
36131     }
36132     if (items > 1) {
36133       ecode2 = SWIG_AsVal_unsigned_SS_int SWIG_PERL_CALL_ARGS_2(ST(1), &val2);
36134       if (!SWIG_IsOK(ecode2)) {
36135         SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "_OpenEx" "', argument " "2"" of type '" "unsigned int""'");
36136       }
36137       arg2 = static_cast< unsigned int >(val2);
36138     }
36139     if (items > 2) {
36140       {
36141         /* %typemap(in) char **options */
36142         if (SvOK(ST(2))) {
36143           if (SvROK(ST(2))) {
36144             if (SvTYPE(SvRV(ST(2)))==SVt_PVAV) {
36145               AV *av = (AV*)(SvRV(ST(2)));
36146               for (int i = 0; i < av_len(av)+1; i++) {
36147                 SV *sv = *(av_fetch(av, i, 0));
36148                 bool sf;
36149                 char *tmp = sv_to_utf8_string(sv, NULL, &sf);
36150                 arg3 = CSLAddString(arg3, tmp);
36151                 if (sf) Safefree(tmp); else free(tmp);
36152               }
36153             } else if (SvTYPE(SvRV(ST(2)))==SVt_PVHV) {
36154               HV *hv = (HV*)SvRV(ST(2));
36155               SV *sv;
36156               char *key;
36157               I32 klen;
36158               arg3 = NULL;
36159               hv_iterinit(hv);
36160               while(sv = hv_iternextsv(hv, &key, &klen)) {
36161                 bool sf;
36162                 char *tmp = sv_to_utf8_string(sv, NULL, &sf);
36163                 arg3 = CSLAddNameValue(arg3, key, tmp);
36164                 if (sf) Safefree(tmp); else free(tmp);
36165               }
36166             } else
36167             do_confess(NEED_REF, 1);
36168           } else
36169           do_confess(NEED_REF, 1);
36170         }
36171       }
36172     }
36173     if (items > 3) {
36174       {
36175         /* %typemap(in) char **options */
36176         if (SvOK(ST(3))) {
36177           if (SvROK(ST(3))) {
36178             if (SvTYPE(SvRV(ST(3)))==SVt_PVAV) {
36179               AV *av = (AV*)(SvRV(ST(3)));
36180               for (int i = 0; i < av_len(av)+1; i++) {
36181                 SV *sv = *(av_fetch(av, i, 0));
36182                 bool sf;
36183                 char *tmp = sv_to_utf8_string(sv, NULL, &sf);
36184                 arg4 = CSLAddString(arg4, tmp);
36185                 if (sf) Safefree(tmp); else free(tmp);
36186               }
36187             } else if (SvTYPE(SvRV(ST(3)))==SVt_PVHV) {
36188               HV *hv = (HV*)SvRV(ST(3));
36189               SV *sv;
36190               char *key;
36191               I32 klen;
36192               arg4 = NULL;
36193               hv_iterinit(hv);
36194               while(sv = hv_iternextsv(hv, &key, &klen)) {
36195                 bool sf;
36196                 char *tmp = sv_to_utf8_string(sv, NULL, &sf);
36197                 arg4 = CSLAddNameValue(arg4, key, tmp);
36198                 if (sf) Safefree(tmp); else free(tmp);
36199               }
36200             } else
36201             do_confess(NEED_REF, 1);
36202           } else
36203           do_confess(NEED_REF, 1);
36204         }
36205       }
36206     }
36207     if (items > 4) {
36208       {
36209         /* %typemap(in) char **options */
36210         if (SvOK(ST(4))) {
36211           if (SvROK(ST(4))) {
36212             if (SvTYPE(SvRV(ST(4)))==SVt_PVAV) {
36213               AV *av = (AV*)(SvRV(ST(4)));
36214               for (int i = 0; i < av_len(av)+1; i++) {
36215                 SV *sv = *(av_fetch(av, i, 0));
36216                 bool sf;
36217                 char *tmp = sv_to_utf8_string(sv, NULL, &sf);
36218                 arg5 = CSLAddString(arg5, tmp);
36219                 if (sf) Safefree(tmp); else free(tmp);
36220               }
36221             } else if (SvTYPE(SvRV(ST(4)))==SVt_PVHV) {
36222               HV *hv = (HV*)SvRV(ST(4));
36223               SV *sv;
36224               char *key;
36225               I32 klen;
36226               arg5 = NULL;
36227               hv_iterinit(hv);
36228               while(sv = hv_iternextsv(hv, &key, &klen)) {
36229                 bool sf;
36230                 char *tmp = sv_to_utf8_string(sv, NULL, &sf);
36231                 arg5 = CSLAddNameValue(arg5, key, tmp);
36232                 if (sf) Safefree(tmp); else free(tmp);
36233               }
36234             } else
36235             do_confess(NEED_REF, 1);
36236           } else
36237           do_confess(NEED_REF, 1);
36238         }
36239       }
36240     }
36241     {
36242       if (!arg1) {
36243         SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
36244       }
36245     }
36246     {
36247       CPLErrorReset();
36248       result = (GDALDatasetShadow *)OpenEx((char const *)arg1,arg2,arg3,arg4,arg5);
36249       CPLErr eclass = CPLGetLastErrorType();
36250       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
36251         do_confess( CPLGetLastErrorMsg(), 0 );
36252 
36253 
36254 
36255 
36256 
36257       }
36258 
36259 
36260       /*
36261           Make warnings regular Perl warnings. This duplicates the warning
36262           message if DontUseExceptions() is in effect (it is not by default).
36263           */
36264       if ( eclass == CE_Warning ) {
36265         warn( CPLGetLastErrorMsg(), "%s" );
36266       }
36267 
36268 
36269     }
36270     ST(argvi) = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GDALDatasetShadow, SWIG_OWNER | SWIG_SHADOW); argvi++ ;
36271     {
36272       /* %typemap(freearg) (const char* utf8_path) */
36273       if (tmpbuf1) Safefree(tmpbuf1);
36274     }
36275 
36276     {
36277       /* %typemap(freearg) char **options */
36278       if (arg3) CSLDestroy( arg3 );
36279     }
36280     {
36281       /* %typemap(freearg) char **options */
36282       if (arg4) CSLDestroy( arg4 );
36283     }
36284     {
36285       /* %typemap(freearg) char **options */
36286       if (arg5) CSLDestroy( arg5 );
36287     }
36288     XSRETURN(argvi);
36289   fail:
36290     {
36291       /* %typemap(freearg) (const char* utf8_path) */
36292       if (tmpbuf1) Safefree(tmpbuf1);
36293     }
36294 
36295     {
36296       /* %typemap(freearg) char **options */
36297       if (arg3) CSLDestroy( arg3 );
36298     }
36299     {
36300       /* %typemap(freearg) char **options */
36301       if (arg4) CSLDestroy( arg4 );
36302     }
36303     {
36304       /* %typemap(freearg) char **options */
36305       if (arg5) CSLDestroy( arg5 );
36306     }
36307     SWIG_croak_null();
36308   }
36309 }
36310 
36311 
XS(_wrap__OpenShared)36312 XS(_wrap__OpenShared) {
36313   {
36314     char *arg1 = (char *) 0 ;
36315     GDALAccess arg2 = (GDALAccess) GA_ReadOnly ;
36316     U8 *tmpbuf1 = NULL ;
36317     int val2 ;
36318     int ecode2 = 0 ;
36319     int argvi = 0;
36320     GDALDatasetShadow *result = 0 ;
36321     dXSARGS;
36322 
36323     {
36324       /* %typemap(default) const char * utf8_path */
36325       arg1 = (char *)"";
36326     }
36327     if ((items < 0) || (items > 2)) {
36328       SWIG_croak("Usage: _OpenShared(utf8_path,eAccess);");
36329     }
36330     if (items > 0) {
36331       {
36332         /* %typemap(in,numinputs=1) (const char* utf8_path) (U8 *tmpbuf1) */
36333         arg1 = sv_to_utf8_string(ST(0), &tmpbuf1);
36334       }
36335     }
36336     if (items > 1) {
36337       ecode2 = SWIG_AsVal_int SWIG_PERL_CALL_ARGS_2(ST(1), &val2);
36338       if (!SWIG_IsOK(ecode2)) {
36339         SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "_OpenShared" "', argument " "2"" of type '" "GDALAccess""'");
36340       }
36341       arg2 = static_cast< GDALAccess >(val2);
36342     }
36343     {
36344       if (!arg1) {
36345         SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
36346       }
36347     }
36348     {
36349       CPLErrorReset();
36350       result = (GDALDatasetShadow *)OpenShared((char const *)arg1,arg2);
36351       CPLErr eclass = CPLGetLastErrorType();
36352       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
36353         do_confess( CPLGetLastErrorMsg(), 0 );
36354 
36355 
36356 
36357 
36358 
36359       }
36360 
36361 
36362       /*
36363           Make warnings regular Perl warnings. This duplicates the warning
36364           message if DontUseExceptions() is in effect (it is not by default).
36365           */
36366       if ( eclass == CE_Warning ) {
36367         warn( CPLGetLastErrorMsg(), "%s" );
36368       }
36369 
36370 
36371     }
36372     ST(argvi) = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GDALDatasetShadow, SWIG_OWNER | SWIG_SHADOW); argvi++ ;
36373     {
36374       /* %typemap(freearg) (const char* utf8_path) */
36375       if (tmpbuf1) Safefree(tmpbuf1);
36376     }
36377 
36378     XSRETURN(argvi);
36379   fail:
36380     {
36381       /* %typemap(freearg) (const char* utf8_path) */
36382       if (tmpbuf1) Safefree(tmpbuf1);
36383     }
36384 
36385     SWIG_croak_null();
36386   }
36387 }
36388 
36389 
XS(_wrap_IdentifyDriver)36390 XS(_wrap_IdentifyDriver) {
36391   {
36392     char *arg1 = (char *) 0 ;
36393     char **arg2 = (char **) NULL ;
36394     U8 *tmpbuf1 = NULL ;
36395     int argvi = 0;
36396     GDALDriverShadow *result = 0 ;
36397     dXSARGS;
36398 
36399     {
36400       /* %typemap(default) const char * utf8_path */
36401       arg1 = (char *)"";
36402     }
36403     if ((items < 0) || (items > 2)) {
36404       SWIG_croak("Usage: IdentifyDriver(utf8_path,papszSiblings);");
36405     }
36406     if (items > 0) {
36407       {
36408         /* %typemap(in,numinputs=1) (const char* utf8_path) (U8 *tmpbuf1) */
36409         arg1 = sv_to_utf8_string(ST(0), &tmpbuf1);
36410       }
36411     }
36412     if (items > 1) {
36413       {
36414         /* %typemap(in) char **options */
36415         if (SvOK(ST(1))) {
36416           if (SvROK(ST(1))) {
36417             if (SvTYPE(SvRV(ST(1)))==SVt_PVAV) {
36418               AV *av = (AV*)(SvRV(ST(1)));
36419               for (int i = 0; i < av_len(av)+1; i++) {
36420                 SV *sv = *(av_fetch(av, i, 0));
36421                 bool sf;
36422                 char *tmp = sv_to_utf8_string(sv, NULL, &sf);
36423                 arg2 = CSLAddString(arg2, tmp);
36424                 if (sf) Safefree(tmp); else free(tmp);
36425               }
36426             } else if (SvTYPE(SvRV(ST(1)))==SVt_PVHV) {
36427               HV *hv = (HV*)SvRV(ST(1));
36428               SV *sv;
36429               char *key;
36430               I32 klen;
36431               arg2 = NULL;
36432               hv_iterinit(hv);
36433               while(sv = hv_iternextsv(hv, &key, &klen)) {
36434                 bool sf;
36435                 char *tmp = sv_to_utf8_string(sv, NULL, &sf);
36436                 arg2 = CSLAddNameValue(arg2, key, tmp);
36437                 if (sf) Safefree(tmp); else free(tmp);
36438               }
36439             } else
36440             do_confess(NEED_REF, 1);
36441           } else
36442           do_confess(NEED_REF, 1);
36443         }
36444       }
36445     }
36446     {
36447       if (!arg1) {
36448         SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
36449       }
36450     }
36451     {
36452       CPLErrorReset();
36453       result = (GDALDriverShadow *)IdentifyDriver((char const *)arg1,arg2);
36454       CPLErr eclass = CPLGetLastErrorType();
36455       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
36456         do_confess( CPLGetLastErrorMsg(), 0 );
36457 
36458 
36459 
36460 
36461 
36462       }
36463 
36464 
36465       /*
36466           Make warnings regular Perl warnings. This duplicates the warning
36467           message if DontUseExceptions() is in effect (it is not by default).
36468           */
36469       if ( eclass == CE_Warning ) {
36470         warn( CPLGetLastErrorMsg(), "%s" );
36471       }
36472 
36473 
36474     }
36475     ST(argvi) = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GDALDriverShadow, 0 | SWIG_SHADOW); argvi++ ;
36476     {
36477       /* %typemap(freearg) (const char* utf8_path) */
36478       if (tmpbuf1) Safefree(tmpbuf1);
36479     }
36480     {
36481       /* %typemap(freearg) char **options */
36482       if (arg2) CSLDestroy( arg2 );
36483     }
36484     XSRETURN(argvi);
36485   fail:
36486     {
36487       /* %typemap(freearg) (const char* utf8_path) */
36488       if (tmpbuf1) Safefree(tmpbuf1);
36489     }
36490     {
36491       /* %typemap(freearg) char **options */
36492       if (arg2) CSLDestroy( arg2 );
36493     }
36494     SWIG_croak_null();
36495   }
36496 }
36497 
36498 
XS(_wrap_IdentifyDriverEx)36499 XS(_wrap_IdentifyDriverEx) {
36500   {
36501     char *arg1 = (char *) 0 ;
36502     unsigned int arg2 = (unsigned int) 0 ;
36503     char **arg3 = (char **) NULL ;
36504     char **arg4 = (char **) NULL ;
36505     U8 *tmpbuf1 = NULL ;
36506     unsigned int val2 ;
36507     int ecode2 = 0 ;
36508     int argvi = 0;
36509     GDALDriverShadow *result = 0 ;
36510     dXSARGS;
36511 
36512     {
36513       /* %typemap(default) const char * utf8_path */
36514       arg1 = (char *)"";
36515     }
36516     if ((items < 0) || (items > 4)) {
36517       SWIG_croak("Usage: IdentifyDriverEx(utf8_path,nIdentifyFlags,allowed_drivers,sibling_files);");
36518     }
36519     if (items > 0) {
36520       {
36521         /* %typemap(in,numinputs=1) (const char* utf8_path) (U8 *tmpbuf1) */
36522         arg1 = sv_to_utf8_string(ST(0), &tmpbuf1);
36523       }
36524     }
36525     if (items > 1) {
36526       ecode2 = SWIG_AsVal_unsigned_SS_int SWIG_PERL_CALL_ARGS_2(ST(1), &val2);
36527       if (!SWIG_IsOK(ecode2)) {
36528         SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IdentifyDriverEx" "', argument " "2"" of type '" "unsigned int""'");
36529       }
36530       arg2 = static_cast< unsigned int >(val2);
36531     }
36532     if (items > 2) {
36533       {
36534         /* %typemap(in) char **options */
36535         if (SvOK(ST(2))) {
36536           if (SvROK(ST(2))) {
36537             if (SvTYPE(SvRV(ST(2)))==SVt_PVAV) {
36538               AV *av = (AV*)(SvRV(ST(2)));
36539               for (int i = 0; i < av_len(av)+1; i++) {
36540                 SV *sv = *(av_fetch(av, i, 0));
36541                 bool sf;
36542                 char *tmp = sv_to_utf8_string(sv, NULL, &sf);
36543                 arg3 = CSLAddString(arg3, tmp);
36544                 if (sf) Safefree(tmp); else free(tmp);
36545               }
36546             } else if (SvTYPE(SvRV(ST(2)))==SVt_PVHV) {
36547               HV *hv = (HV*)SvRV(ST(2));
36548               SV *sv;
36549               char *key;
36550               I32 klen;
36551               arg3 = NULL;
36552               hv_iterinit(hv);
36553               while(sv = hv_iternextsv(hv, &key, &klen)) {
36554                 bool sf;
36555                 char *tmp = sv_to_utf8_string(sv, NULL, &sf);
36556                 arg3 = CSLAddNameValue(arg3, key, tmp);
36557                 if (sf) Safefree(tmp); else free(tmp);
36558               }
36559             } else
36560             do_confess(NEED_REF, 1);
36561           } else
36562           do_confess(NEED_REF, 1);
36563         }
36564       }
36565     }
36566     if (items > 3) {
36567       {
36568         /* %typemap(in) char **options */
36569         if (SvOK(ST(3))) {
36570           if (SvROK(ST(3))) {
36571             if (SvTYPE(SvRV(ST(3)))==SVt_PVAV) {
36572               AV *av = (AV*)(SvRV(ST(3)));
36573               for (int i = 0; i < av_len(av)+1; i++) {
36574                 SV *sv = *(av_fetch(av, i, 0));
36575                 bool sf;
36576                 char *tmp = sv_to_utf8_string(sv, NULL, &sf);
36577                 arg4 = CSLAddString(arg4, tmp);
36578                 if (sf) Safefree(tmp); else free(tmp);
36579               }
36580             } else if (SvTYPE(SvRV(ST(3)))==SVt_PVHV) {
36581               HV *hv = (HV*)SvRV(ST(3));
36582               SV *sv;
36583               char *key;
36584               I32 klen;
36585               arg4 = NULL;
36586               hv_iterinit(hv);
36587               while(sv = hv_iternextsv(hv, &key, &klen)) {
36588                 bool sf;
36589                 char *tmp = sv_to_utf8_string(sv, NULL, &sf);
36590                 arg4 = CSLAddNameValue(arg4, key, tmp);
36591                 if (sf) Safefree(tmp); else free(tmp);
36592               }
36593             } else
36594             do_confess(NEED_REF, 1);
36595           } else
36596           do_confess(NEED_REF, 1);
36597         }
36598       }
36599     }
36600     {
36601       if (!arg1) {
36602         SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
36603       }
36604     }
36605     {
36606       CPLErrorReset();
36607       result = (GDALDriverShadow *)IdentifyDriverEx((char const *)arg1,arg2,arg3,arg4);
36608       CPLErr eclass = CPLGetLastErrorType();
36609       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
36610         do_confess( CPLGetLastErrorMsg(), 0 );
36611 
36612 
36613 
36614 
36615 
36616       }
36617 
36618 
36619       /*
36620           Make warnings regular Perl warnings. This duplicates the warning
36621           message if DontUseExceptions() is in effect (it is not by default).
36622           */
36623       if ( eclass == CE_Warning ) {
36624         warn( CPLGetLastErrorMsg(), "%s" );
36625       }
36626 
36627 
36628     }
36629     ST(argvi) = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GDALDriverShadow, 0 | SWIG_SHADOW); argvi++ ;
36630     {
36631       /* %typemap(freearg) (const char* utf8_path) */
36632       if (tmpbuf1) Safefree(tmpbuf1);
36633     }
36634 
36635     {
36636       /* %typemap(freearg) char **options */
36637       if (arg3) CSLDestroy( arg3 );
36638     }
36639     {
36640       /* %typemap(freearg) char **options */
36641       if (arg4) CSLDestroy( arg4 );
36642     }
36643     XSRETURN(argvi);
36644   fail:
36645     {
36646       /* %typemap(freearg) (const char* utf8_path) */
36647       if (tmpbuf1) Safefree(tmpbuf1);
36648     }
36649 
36650     {
36651       /* %typemap(freearg) char **options */
36652       if (arg3) CSLDestroy( arg3 );
36653     }
36654     {
36655       /* %typemap(freearg) char **options */
36656       if (arg4) CSLDestroy( arg4 );
36657     }
36658     SWIG_croak_null();
36659   }
36660 }
36661 
36662 
XS(_wrap_GeneralCmdLineProcessor)36663 XS(_wrap_GeneralCmdLineProcessor) {
36664   {
36665     char **arg1 = (char **) 0 ;
36666     int arg2 = (int) 0 ;
36667     int val2 ;
36668     int ecode2 = 0 ;
36669     int argvi = 0;
36670     char **result = 0 ;
36671     dXSARGS;
36672 
36673     if ((items < 1) || (items > 2)) {
36674       SWIG_croak("Usage: GeneralCmdLineProcessor(papszArgv,nOptions);");
36675     }
36676     {
36677       /* %typemap(in) char **options */
36678       if (SvOK(ST(0))) {
36679         if (SvROK(ST(0))) {
36680           if (SvTYPE(SvRV(ST(0)))==SVt_PVAV) {
36681             AV *av = (AV*)(SvRV(ST(0)));
36682             for (int i = 0; i < av_len(av)+1; i++) {
36683               SV *sv = *(av_fetch(av, i, 0));
36684               bool sf;
36685               char *tmp = sv_to_utf8_string(sv, NULL, &sf);
36686               arg1 = CSLAddString(arg1, tmp);
36687               if (sf) Safefree(tmp); else free(tmp);
36688             }
36689           } else if (SvTYPE(SvRV(ST(0)))==SVt_PVHV) {
36690             HV *hv = (HV*)SvRV(ST(0));
36691             SV *sv;
36692             char *key;
36693             I32 klen;
36694             arg1 = NULL;
36695             hv_iterinit(hv);
36696             while(sv = hv_iternextsv(hv, &key, &klen)) {
36697               bool sf;
36698               char *tmp = sv_to_utf8_string(sv, NULL, &sf);
36699               arg1 = CSLAddNameValue(arg1, key, tmp);
36700               if (sf) Safefree(tmp); else free(tmp);
36701             }
36702           } else
36703           do_confess(NEED_REF, 1);
36704         } else
36705         do_confess(NEED_REF, 1);
36706       }
36707     }
36708     if (items > 1) {
36709       ecode2 = SWIG_AsVal_int SWIG_PERL_CALL_ARGS_2(ST(1), &val2);
36710       if (!SWIG_IsOK(ecode2)) {
36711         SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "GeneralCmdLineProcessor" "', argument " "2"" of type '" "int""'");
36712       }
36713       arg2 = static_cast< int >(val2);
36714     }
36715     {
36716       CPLErrorReset();
36717       result = (char **)GeneralCmdLineProcessor(arg1,arg2);
36718       CPLErr eclass = CPLGetLastErrorType();
36719       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
36720         do_confess( CPLGetLastErrorMsg(), 0 );
36721 
36722 
36723 
36724 
36725 
36726       }
36727 
36728 
36729       /*
36730           Make warnings regular Perl warnings. This duplicates the warning
36731           message if DontUseExceptions() is in effect (it is not by default).
36732           */
36733       if ( eclass == CE_Warning ) {
36734         warn( CPLGetLastErrorMsg(), "%s" );
36735       }
36736 
36737 
36738     }
36739     {
36740       /* %typemap(out) char **options -> ( string ) */
36741       AV* av = (AV*)sv_2mortal((SV*)newAV());
36742       char **stringarray = result;
36743       if ( stringarray != NULL ) {
36744         int n = CSLCount( stringarray );
36745         for ( int i = 0; i < n; i++ ) {
36746           SV *sv = newSVpv(stringarray[i], 0);
36747           SvUTF8_on(sv); /* expecting UTF-8 from GDAL */
36748           if (!av_store(av, i, sv))
36749           SvREFCNT_dec(sv);
36750         }
36751       }
36752       ST(argvi) = newRV((SV*)av);
36753       sv_2mortal(ST(argvi));
36754       argvi++;
36755     }
36756     {
36757       /* %typemap(freearg) char **options */
36758       if (arg1) CSLDestroy( arg1 );
36759     }
36760 
36761     XSRETURN(argvi);
36762   fail:
36763     {
36764       /* %typemap(freearg) char **options */
36765       if (arg1) CSLDestroy( arg1 );
36766     }
36767 
36768     SWIG_croak_null();
36769   }
36770 }
36771 
36772 
XS(_wrap_new_GDALInfoOptions)36773 XS(_wrap_new_GDALInfoOptions) {
36774   {
36775     char **arg1 = (char **) 0 ;
36776     int argvi = 0;
36777     GDALInfoOptions *result = 0 ;
36778     dXSARGS;
36779 
36780     if ((items < 1) || (items > 1)) {
36781       SWIG_croak("Usage: new_GDALInfoOptions(options);");
36782     }
36783     {
36784       /* %typemap(in) char **options */
36785       if (SvOK(ST(0))) {
36786         if (SvROK(ST(0))) {
36787           if (SvTYPE(SvRV(ST(0)))==SVt_PVAV) {
36788             AV *av = (AV*)(SvRV(ST(0)));
36789             for (int i = 0; i < av_len(av)+1; i++) {
36790               SV *sv = *(av_fetch(av, i, 0));
36791               bool sf;
36792               char *tmp = sv_to_utf8_string(sv, NULL, &sf);
36793               arg1 = CSLAddString(arg1, tmp);
36794               if (sf) Safefree(tmp); else free(tmp);
36795             }
36796           } else if (SvTYPE(SvRV(ST(0)))==SVt_PVHV) {
36797             HV *hv = (HV*)SvRV(ST(0));
36798             SV *sv;
36799             char *key;
36800             I32 klen;
36801             arg1 = NULL;
36802             hv_iterinit(hv);
36803             while(sv = hv_iternextsv(hv, &key, &klen)) {
36804               bool sf;
36805               char *tmp = sv_to_utf8_string(sv, NULL, &sf);
36806               arg1 = CSLAddNameValue(arg1, key, tmp);
36807               if (sf) Safefree(tmp); else free(tmp);
36808             }
36809           } else
36810           do_confess(NEED_REF, 1);
36811         } else
36812         do_confess(NEED_REF, 1);
36813       }
36814     }
36815     {
36816       CPLErrorReset();
36817       result = (GDALInfoOptions *)new_GDALInfoOptions(arg1);
36818       CPLErr eclass = CPLGetLastErrorType();
36819       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
36820         do_confess( CPLGetLastErrorMsg(), 0 );
36821 
36822 
36823 
36824 
36825 
36826       }
36827 
36828 
36829       /*
36830           Make warnings regular Perl warnings. This duplicates the warning
36831           message if DontUseExceptions() is in effect (it is not by default).
36832           */
36833       if ( eclass == CE_Warning ) {
36834         warn( CPLGetLastErrorMsg(), "%s" );
36835       }
36836 
36837 
36838     }
36839     ST(argvi) = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GDALInfoOptions, SWIG_OWNER | SWIG_SHADOW); argvi++ ;
36840     {
36841       /* %typemap(freearg) char **options */
36842       if (arg1) CSLDestroy( arg1 );
36843     }
36844     XSRETURN(argvi);
36845   fail:
36846     {
36847       /* %typemap(freearg) char **options */
36848       if (arg1) CSLDestroy( arg1 );
36849     }
36850     SWIG_croak_null();
36851   }
36852 }
36853 
36854 
XS(_wrap_delete_GDALInfoOptions)36855 XS(_wrap_delete_GDALInfoOptions) {
36856   {
36857     GDALInfoOptions *arg1 = (GDALInfoOptions *) 0 ;
36858     void *argp1 = 0 ;
36859     int res1 = 0 ;
36860     int argvi = 0;
36861     dXSARGS;
36862 
36863     if ((items < 1) || (items > 1)) {
36864       SWIG_croak("Usage: delete_GDALInfoOptions(self);");
36865     }
36866     res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_GDALInfoOptions, SWIG_POINTER_DISOWN |  0 );
36867     if (!SWIG_IsOK(res1)) {
36868       SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_GDALInfoOptions" "', argument " "1"" of type '" "GDALInfoOptions *""'");
36869     }
36870     arg1 = reinterpret_cast< GDALInfoOptions * >(argp1);
36871     {
36872       CPLErrorReset();
36873       delete_GDALInfoOptions(arg1);
36874       CPLErr eclass = CPLGetLastErrorType();
36875       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
36876         do_confess( CPLGetLastErrorMsg(), 0 );
36877 
36878 
36879 
36880 
36881 
36882       }
36883 
36884 
36885       /*
36886           Make warnings regular Perl warnings. This duplicates the warning
36887           message if DontUseExceptions() is in effect (it is not by default).
36888           */
36889       if ( eclass == CE_Warning ) {
36890         warn( CPLGetLastErrorMsg(), "%s" );
36891       }
36892 
36893 
36894     }
36895     {
36896       /* %typemap(out) void */
36897     }
36898 
36899     XSRETURN(argvi);
36900   fail:
36901 
36902     SWIG_croak_null();
36903   }
36904 }
36905 
36906 
XS(_wrap_GDALInfo)36907 XS(_wrap_GDALInfo) {
36908   {
36909     GDALDatasetShadow *arg1 = (GDALDatasetShadow *) 0 ;
36910     GDALInfoOptions *arg2 = (GDALInfoOptions *) 0 ;
36911     void *argp2 = 0 ;
36912     int res2 = 0 ;
36913     int argvi = 0;
36914     retStringAndCPLFree *result = 0 ;
36915     dXSARGS;
36916 
36917     if ((items < 2) || (items > 2)) {
36918       SWIG_croak("Usage: GDALInfo(hDataset,infoOptions);");
36919     }
36920     {
36921       /* %typemap(in) (GDALDatasetShadow *) */
36922       void *argp = 0;
36923       int res = SWIG_ConvertPtr(ST(0), &argp, SWIGTYPE_p_GDALDatasetShadow, 0 |  0 );
36924       if (!SWIG_IsOK(res)) {
36925         do_confess(WRONG_CLASS, 1);
36926       }
36927       arg1 = reinterpret_cast< GDALDatasetShadow * >(argp);
36928       if (arg1 == NULL)
36929       do_confess(NEED_DEF, 1);
36930     }
36931     res2 = SWIG_ConvertPtr(ST(1), &argp2,SWIGTYPE_p_GDALInfoOptions, 0 |  0 );
36932     if (!SWIG_IsOK(res2)) {
36933       SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "GDALInfo" "', argument " "2"" of type '" "GDALInfoOptions *""'");
36934     }
36935     arg2 = reinterpret_cast< GDALInfoOptions * >(argp2);
36936     {
36937       CPLErrorReset();
36938       result = (retStringAndCPLFree *)GDALInfo(arg1,arg2);
36939       CPLErr eclass = CPLGetLastErrorType();
36940       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
36941         do_confess( CPLGetLastErrorMsg(), 0 );
36942 
36943 
36944 
36945 
36946 
36947       }
36948 
36949 
36950       /*
36951           Make warnings regular Perl warnings. This duplicates the warning
36952           message if DontUseExceptions() is in effect (it is not by default).
36953           */
36954       if ( eclass == CE_Warning ) {
36955         warn( CPLGetLastErrorMsg(), "%s" );
36956       }
36957 
36958 
36959     }
36960 
36961     /* %typemap(out) (retStringAndCPLFree*) */
36962     if(result)
36963     {
36964       ST(argvi) = SWIG_FromCharPtr((const char *)result);
36965       CPLFree(result);
36966     }
36967     else
36968     {
36969       ST(argvi) = &PL_sv_undef;
36970     }
36971     argvi++ ;
36972 
36973 
36974 
36975     XSRETURN(argvi);
36976   fail:
36977 
36978 
36979     SWIG_croak_null();
36980   }
36981 }
36982 
36983 
XS(_wrap_new_GDALMultiDimInfoOptions)36984 XS(_wrap_new_GDALMultiDimInfoOptions) {
36985   {
36986     char **arg1 = (char **) 0 ;
36987     int argvi = 0;
36988     GDALMultiDimInfoOptions *result = 0 ;
36989     dXSARGS;
36990 
36991     if ((items < 1) || (items > 1)) {
36992       SWIG_croak("Usage: new_GDALMultiDimInfoOptions(options);");
36993     }
36994     {
36995       /* %typemap(in) char **options */
36996       if (SvOK(ST(0))) {
36997         if (SvROK(ST(0))) {
36998           if (SvTYPE(SvRV(ST(0)))==SVt_PVAV) {
36999             AV *av = (AV*)(SvRV(ST(0)));
37000             for (int i = 0; i < av_len(av)+1; i++) {
37001               SV *sv = *(av_fetch(av, i, 0));
37002               bool sf;
37003               char *tmp = sv_to_utf8_string(sv, NULL, &sf);
37004               arg1 = CSLAddString(arg1, tmp);
37005               if (sf) Safefree(tmp); else free(tmp);
37006             }
37007           } else if (SvTYPE(SvRV(ST(0)))==SVt_PVHV) {
37008             HV *hv = (HV*)SvRV(ST(0));
37009             SV *sv;
37010             char *key;
37011             I32 klen;
37012             arg1 = NULL;
37013             hv_iterinit(hv);
37014             while(sv = hv_iternextsv(hv, &key, &klen)) {
37015               bool sf;
37016               char *tmp = sv_to_utf8_string(sv, NULL, &sf);
37017               arg1 = CSLAddNameValue(arg1, key, tmp);
37018               if (sf) Safefree(tmp); else free(tmp);
37019             }
37020           } else
37021           do_confess(NEED_REF, 1);
37022         } else
37023         do_confess(NEED_REF, 1);
37024       }
37025     }
37026     {
37027       CPLErrorReset();
37028       result = (GDALMultiDimInfoOptions *)new_GDALMultiDimInfoOptions(arg1);
37029       CPLErr eclass = CPLGetLastErrorType();
37030       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
37031         do_confess( CPLGetLastErrorMsg(), 0 );
37032 
37033 
37034 
37035 
37036 
37037       }
37038 
37039 
37040       /*
37041           Make warnings regular Perl warnings. This duplicates the warning
37042           message if DontUseExceptions() is in effect (it is not by default).
37043           */
37044       if ( eclass == CE_Warning ) {
37045         warn( CPLGetLastErrorMsg(), "%s" );
37046       }
37047 
37048 
37049     }
37050     ST(argvi) = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GDALMultiDimInfoOptions, SWIG_OWNER | SWIG_SHADOW); argvi++ ;
37051     {
37052       /* %typemap(freearg) char **options */
37053       if (arg1) CSLDestroy( arg1 );
37054     }
37055     XSRETURN(argvi);
37056   fail:
37057     {
37058       /* %typemap(freearg) char **options */
37059       if (arg1) CSLDestroy( arg1 );
37060     }
37061     SWIG_croak_null();
37062   }
37063 }
37064 
37065 
XS(_wrap_delete_GDALMultiDimInfoOptions)37066 XS(_wrap_delete_GDALMultiDimInfoOptions) {
37067   {
37068     GDALMultiDimInfoOptions *arg1 = (GDALMultiDimInfoOptions *) 0 ;
37069     void *argp1 = 0 ;
37070     int res1 = 0 ;
37071     int argvi = 0;
37072     dXSARGS;
37073 
37074     if ((items < 1) || (items > 1)) {
37075       SWIG_croak("Usage: delete_GDALMultiDimInfoOptions(self);");
37076     }
37077     res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_GDALMultiDimInfoOptions, SWIG_POINTER_DISOWN |  0 );
37078     if (!SWIG_IsOK(res1)) {
37079       SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_GDALMultiDimInfoOptions" "', argument " "1"" of type '" "GDALMultiDimInfoOptions *""'");
37080     }
37081     arg1 = reinterpret_cast< GDALMultiDimInfoOptions * >(argp1);
37082     {
37083       CPLErrorReset();
37084       delete_GDALMultiDimInfoOptions(arg1);
37085       CPLErr eclass = CPLGetLastErrorType();
37086       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
37087         do_confess( CPLGetLastErrorMsg(), 0 );
37088 
37089 
37090 
37091 
37092 
37093       }
37094 
37095 
37096       /*
37097           Make warnings regular Perl warnings. This duplicates the warning
37098           message if DontUseExceptions() is in effect (it is not by default).
37099           */
37100       if ( eclass == CE_Warning ) {
37101         warn( CPLGetLastErrorMsg(), "%s" );
37102       }
37103 
37104 
37105     }
37106     {
37107       /* %typemap(out) void */
37108     }
37109 
37110     XSRETURN(argvi);
37111   fail:
37112 
37113     SWIG_croak_null();
37114   }
37115 }
37116 
37117 
XS(_wrap_GDALMultiDimInfo)37118 XS(_wrap_GDALMultiDimInfo) {
37119   {
37120     GDALDatasetShadow *arg1 = (GDALDatasetShadow *) 0 ;
37121     GDALMultiDimInfoOptions *arg2 = (GDALMultiDimInfoOptions *) 0 ;
37122     void *argp2 = 0 ;
37123     int res2 = 0 ;
37124     int argvi = 0;
37125     retStringAndCPLFree *result = 0 ;
37126     dXSARGS;
37127 
37128     if ((items < 2) || (items > 2)) {
37129       SWIG_croak("Usage: GDALMultiDimInfo(hDataset,infoOptions);");
37130     }
37131     {
37132       /* %typemap(in) (GDALDatasetShadow *) */
37133       void *argp = 0;
37134       int res = SWIG_ConvertPtr(ST(0), &argp, SWIGTYPE_p_GDALDatasetShadow, 0 |  0 );
37135       if (!SWIG_IsOK(res)) {
37136         do_confess(WRONG_CLASS, 1);
37137       }
37138       arg1 = reinterpret_cast< GDALDatasetShadow * >(argp);
37139       if (arg1 == NULL)
37140       do_confess(NEED_DEF, 1);
37141     }
37142     res2 = SWIG_ConvertPtr(ST(1), &argp2,SWIGTYPE_p_GDALMultiDimInfoOptions, 0 |  0 );
37143     if (!SWIG_IsOK(res2)) {
37144       SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "GDALMultiDimInfo" "', argument " "2"" of type '" "GDALMultiDimInfoOptions *""'");
37145     }
37146     arg2 = reinterpret_cast< GDALMultiDimInfoOptions * >(argp2);
37147     {
37148       CPLErrorReset();
37149       result = (retStringAndCPLFree *)GDALMultiDimInfo(arg1,arg2);
37150       CPLErr eclass = CPLGetLastErrorType();
37151       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
37152         do_confess( CPLGetLastErrorMsg(), 0 );
37153 
37154 
37155 
37156 
37157 
37158       }
37159 
37160 
37161       /*
37162           Make warnings regular Perl warnings. This duplicates the warning
37163           message if DontUseExceptions() is in effect (it is not by default).
37164           */
37165       if ( eclass == CE_Warning ) {
37166         warn( CPLGetLastErrorMsg(), "%s" );
37167       }
37168 
37169 
37170     }
37171 
37172     /* %typemap(out) (retStringAndCPLFree*) */
37173     if(result)
37174     {
37175       ST(argvi) = SWIG_FromCharPtr((const char *)result);
37176       CPLFree(result);
37177     }
37178     else
37179     {
37180       ST(argvi) = &PL_sv_undef;
37181     }
37182     argvi++ ;
37183 
37184 
37185 
37186     XSRETURN(argvi);
37187   fail:
37188 
37189 
37190     SWIG_croak_null();
37191   }
37192 }
37193 
37194 
XS(_wrap_new_GDALTranslateOptions)37195 XS(_wrap_new_GDALTranslateOptions) {
37196   {
37197     char **arg1 = (char **) 0 ;
37198     int argvi = 0;
37199     GDALTranslateOptions *result = 0 ;
37200     dXSARGS;
37201 
37202     if ((items < 1) || (items > 1)) {
37203       SWIG_croak("Usage: new_GDALTranslateOptions(options);");
37204     }
37205     {
37206       /* %typemap(in) char **options */
37207       if (SvOK(ST(0))) {
37208         if (SvROK(ST(0))) {
37209           if (SvTYPE(SvRV(ST(0)))==SVt_PVAV) {
37210             AV *av = (AV*)(SvRV(ST(0)));
37211             for (int i = 0; i < av_len(av)+1; i++) {
37212               SV *sv = *(av_fetch(av, i, 0));
37213               bool sf;
37214               char *tmp = sv_to_utf8_string(sv, NULL, &sf);
37215               arg1 = CSLAddString(arg1, tmp);
37216               if (sf) Safefree(tmp); else free(tmp);
37217             }
37218           } else if (SvTYPE(SvRV(ST(0)))==SVt_PVHV) {
37219             HV *hv = (HV*)SvRV(ST(0));
37220             SV *sv;
37221             char *key;
37222             I32 klen;
37223             arg1 = NULL;
37224             hv_iterinit(hv);
37225             while(sv = hv_iternextsv(hv, &key, &klen)) {
37226               bool sf;
37227               char *tmp = sv_to_utf8_string(sv, NULL, &sf);
37228               arg1 = CSLAddNameValue(arg1, key, tmp);
37229               if (sf) Safefree(tmp); else free(tmp);
37230             }
37231           } else
37232           do_confess(NEED_REF, 1);
37233         } else
37234         do_confess(NEED_REF, 1);
37235       }
37236     }
37237     {
37238       CPLErrorReset();
37239       result = (GDALTranslateOptions *)new_GDALTranslateOptions(arg1);
37240       CPLErr eclass = CPLGetLastErrorType();
37241       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
37242         do_confess( CPLGetLastErrorMsg(), 0 );
37243 
37244 
37245 
37246 
37247 
37248       }
37249 
37250 
37251       /*
37252           Make warnings regular Perl warnings. This duplicates the warning
37253           message if DontUseExceptions() is in effect (it is not by default).
37254           */
37255       if ( eclass == CE_Warning ) {
37256         warn( CPLGetLastErrorMsg(), "%s" );
37257       }
37258 
37259 
37260     }
37261     ST(argvi) = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GDALTranslateOptions, SWIG_OWNER | SWIG_SHADOW); argvi++ ;
37262     {
37263       /* %typemap(freearg) char **options */
37264       if (arg1) CSLDestroy( arg1 );
37265     }
37266     XSRETURN(argvi);
37267   fail:
37268     {
37269       /* %typemap(freearg) char **options */
37270       if (arg1) CSLDestroy( arg1 );
37271     }
37272     SWIG_croak_null();
37273   }
37274 }
37275 
37276 
XS(_wrap_delete_GDALTranslateOptions)37277 XS(_wrap_delete_GDALTranslateOptions) {
37278   {
37279     GDALTranslateOptions *arg1 = (GDALTranslateOptions *) 0 ;
37280     void *argp1 = 0 ;
37281     int res1 = 0 ;
37282     int argvi = 0;
37283     dXSARGS;
37284 
37285     if ((items < 1) || (items > 1)) {
37286       SWIG_croak("Usage: delete_GDALTranslateOptions(self);");
37287     }
37288     res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_GDALTranslateOptions, SWIG_POINTER_DISOWN |  0 );
37289     if (!SWIG_IsOK(res1)) {
37290       SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_GDALTranslateOptions" "', argument " "1"" of type '" "GDALTranslateOptions *""'");
37291     }
37292     arg1 = reinterpret_cast< GDALTranslateOptions * >(argp1);
37293     {
37294       CPLErrorReset();
37295       delete_GDALTranslateOptions(arg1);
37296       CPLErr eclass = CPLGetLastErrorType();
37297       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
37298         do_confess( CPLGetLastErrorMsg(), 0 );
37299 
37300 
37301 
37302 
37303 
37304       }
37305 
37306 
37307       /*
37308           Make warnings regular Perl warnings. This duplicates the warning
37309           message if DontUseExceptions() is in effect (it is not by default).
37310           */
37311       if ( eclass == CE_Warning ) {
37312         warn( CPLGetLastErrorMsg(), "%s" );
37313       }
37314 
37315 
37316     }
37317     {
37318       /* %typemap(out) void */
37319     }
37320 
37321     XSRETURN(argvi);
37322   fail:
37323 
37324     SWIG_croak_null();
37325   }
37326 }
37327 
37328 
XS(_wrap_wrapper_GDALTranslate)37329 XS(_wrap_wrapper_GDALTranslate) {
37330   {
37331     char *arg1 = (char *) 0 ;
37332     GDALDatasetShadow *arg2 = (GDALDatasetShadow *) 0 ;
37333     GDALTranslateOptions *arg3 = (GDALTranslateOptions *) 0 ;
37334     GDALProgressFunc arg4 = (GDALProgressFunc) NULL ;
37335     void *arg5 = (void *) NULL ;
37336     U8 *tmpbuf1 = NULL ;
37337     void *argp3 = 0 ;
37338     int res3 = 0 ;
37339     int argvi = 0;
37340     GDALDatasetShadow *result = 0 ;
37341     dXSARGS;
37342 
37343     /* %typemap(arginit, noblock=1) ( void* callback_data = NULL) */
37344     SavedEnv saved_env;
37345     saved_env.fct = NULL;
37346     saved_env.data = &PL_sv_undef;
37347     arg5 = (void *)(&saved_env);
37348     {
37349       /* %typemap(default) const char * utf8_path */
37350       arg1 = (char *)"";
37351     }
37352     if ((items < 0) || (items > 5)) {
37353       SWIG_croak("Usage: wrapper_GDALTranslate(dest,dataset,translateOptions,callback,callback_data);");
37354     }
37355     if (items > 0) {
37356       {
37357         /* %typemap(in,numinputs=1) (const char* utf8_path) (U8 *tmpbuf1) */
37358         arg1 = sv_to_utf8_string(ST(0), &tmpbuf1);
37359       }
37360     }
37361     if (items > 1) {
37362       {
37363         /* %typemap(in) (GDALDatasetShadow *) */
37364         void *argp = 0;
37365         int res = SWIG_ConvertPtr(ST(1), &argp, SWIGTYPE_p_GDALDatasetShadow, 0 |  0 );
37366         if (!SWIG_IsOK(res)) {
37367           do_confess(WRONG_CLASS, 1);
37368         }
37369         arg2 = reinterpret_cast< GDALDatasetShadow * >(argp);
37370         if (arg2 == NULL)
37371         do_confess(NEED_DEF, 1);
37372       }
37373     }
37374     if (items > 2) {
37375       res3 = SWIG_ConvertPtr(ST(2), &argp3,SWIGTYPE_p_GDALTranslateOptions, 0 |  0 );
37376       if (!SWIG_IsOK(res3)) {
37377         SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "wrapper_GDALTranslate" "', argument " "3"" of type '" "GDALTranslateOptions *""'");
37378       }
37379       arg3 = reinterpret_cast< GDALTranslateOptions * >(argp3);
37380     }
37381     if (items > 3) {
37382       {
37383         /* %typemap(in) (GDALProgressFunc callback = NULL) */
37384         if (SvOK(ST(3))) {
37385           if (SvROK(ST(3))) {
37386             if (SvTYPE(SvRV(ST(3))) != SVt_PVCV) {
37387               do_confess(NEED_CODE_REF, 1);
37388             } else {
37389               saved_env.fct = (SV *)ST(3);
37390               arg4 = &callback_d_cp_vp;
37391             }
37392           } else {
37393             do_confess(NEED_CODE_REF, 1);
37394           }
37395         }
37396       }
37397     }
37398     if (items > 4) {
37399       {
37400         /* %typemap(in) (void* callback_data=NULL) */
37401         if (SvOK(ST(4)))
37402         saved_env.data = (SV *)ST(4);
37403       }
37404     }
37405     {
37406       if (!arg1) {
37407         SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
37408       }
37409     }
37410     {
37411       if (!arg2) {
37412         SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
37413       }
37414     }
37415     {
37416       CPLErrorReset();
37417       result = (GDALDatasetShadow *)wrapper_GDALTranslate((char const *)arg1,arg2,arg3,arg4,arg5);
37418       CPLErr eclass = CPLGetLastErrorType();
37419       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
37420         do_confess( CPLGetLastErrorMsg(), 0 );
37421 
37422 
37423 
37424 
37425 
37426       }
37427 
37428 
37429       /*
37430           Make warnings regular Perl warnings. This duplicates the warning
37431           message if DontUseExceptions() is in effect (it is not by default).
37432           */
37433       if ( eclass == CE_Warning ) {
37434         warn( CPLGetLastErrorMsg(), "%s" );
37435       }
37436 
37437 
37438     }
37439     ST(argvi) = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GDALDatasetShadow, SWIG_OWNER | SWIG_SHADOW); argvi++ ;
37440     {
37441       /* %typemap(freearg) (const char* utf8_path) */
37442       if (tmpbuf1) Safefree(tmpbuf1);
37443     }
37444 
37445 
37446 
37447     XSRETURN(argvi);
37448   fail:
37449     {
37450       /* %typemap(freearg) (const char* utf8_path) */
37451       if (tmpbuf1) Safefree(tmpbuf1);
37452     }
37453 
37454 
37455 
37456     SWIG_croak_null();
37457   }
37458 }
37459 
37460 
XS(_wrap_new_GDALWarpAppOptions)37461 XS(_wrap_new_GDALWarpAppOptions) {
37462   {
37463     char **arg1 = (char **) 0 ;
37464     int argvi = 0;
37465     GDALWarpAppOptions *result = 0 ;
37466     dXSARGS;
37467 
37468     if ((items < 1) || (items > 1)) {
37469       SWIG_croak("Usage: new_GDALWarpAppOptions(options);");
37470     }
37471     {
37472       /* %typemap(in) char **options */
37473       if (SvOK(ST(0))) {
37474         if (SvROK(ST(0))) {
37475           if (SvTYPE(SvRV(ST(0)))==SVt_PVAV) {
37476             AV *av = (AV*)(SvRV(ST(0)));
37477             for (int i = 0; i < av_len(av)+1; i++) {
37478               SV *sv = *(av_fetch(av, i, 0));
37479               bool sf;
37480               char *tmp = sv_to_utf8_string(sv, NULL, &sf);
37481               arg1 = CSLAddString(arg1, tmp);
37482               if (sf) Safefree(tmp); else free(tmp);
37483             }
37484           } else if (SvTYPE(SvRV(ST(0)))==SVt_PVHV) {
37485             HV *hv = (HV*)SvRV(ST(0));
37486             SV *sv;
37487             char *key;
37488             I32 klen;
37489             arg1 = NULL;
37490             hv_iterinit(hv);
37491             while(sv = hv_iternextsv(hv, &key, &klen)) {
37492               bool sf;
37493               char *tmp = sv_to_utf8_string(sv, NULL, &sf);
37494               arg1 = CSLAddNameValue(arg1, key, tmp);
37495               if (sf) Safefree(tmp); else free(tmp);
37496             }
37497           } else
37498           do_confess(NEED_REF, 1);
37499         } else
37500         do_confess(NEED_REF, 1);
37501       }
37502     }
37503     {
37504       CPLErrorReset();
37505       result = (GDALWarpAppOptions *)new_GDALWarpAppOptions(arg1);
37506       CPLErr eclass = CPLGetLastErrorType();
37507       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
37508         do_confess( CPLGetLastErrorMsg(), 0 );
37509 
37510 
37511 
37512 
37513 
37514       }
37515 
37516 
37517       /*
37518           Make warnings regular Perl warnings. This duplicates the warning
37519           message if DontUseExceptions() is in effect (it is not by default).
37520           */
37521       if ( eclass == CE_Warning ) {
37522         warn( CPLGetLastErrorMsg(), "%s" );
37523       }
37524 
37525 
37526     }
37527     ST(argvi) = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GDALWarpAppOptions, SWIG_OWNER | SWIG_SHADOW); argvi++ ;
37528     {
37529       /* %typemap(freearg) char **options */
37530       if (arg1) CSLDestroy( arg1 );
37531     }
37532     XSRETURN(argvi);
37533   fail:
37534     {
37535       /* %typemap(freearg) char **options */
37536       if (arg1) CSLDestroy( arg1 );
37537     }
37538     SWIG_croak_null();
37539   }
37540 }
37541 
37542 
XS(_wrap_delete_GDALWarpAppOptions)37543 XS(_wrap_delete_GDALWarpAppOptions) {
37544   {
37545     GDALWarpAppOptions *arg1 = (GDALWarpAppOptions *) 0 ;
37546     void *argp1 = 0 ;
37547     int res1 = 0 ;
37548     int argvi = 0;
37549     dXSARGS;
37550 
37551     if ((items < 1) || (items > 1)) {
37552       SWIG_croak("Usage: delete_GDALWarpAppOptions(self);");
37553     }
37554     res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_GDALWarpAppOptions, SWIG_POINTER_DISOWN |  0 );
37555     if (!SWIG_IsOK(res1)) {
37556       SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_GDALWarpAppOptions" "', argument " "1"" of type '" "GDALWarpAppOptions *""'");
37557     }
37558     arg1 = reinterpret_cast< GDALWarpAppOptions * >(argp1);
37559     {
37560       CPLErrorReset();
37561       delete_GDALWarpAppOptions(arg1);
37562       CPLErr eclass = CPLGetLastErrorType();
37563       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
37564         do_confess( CPLGetLastErrorMsg(), 0 );
37565 
37566 
37567 
37568 
37569 
37570       }
37571 
37572 
37573       /*
37574           Make warnings regular Perl warnings. This duplicates the warning
37575           message if DontUseExceptions() is in effect (it is not by default).
37576           */
37577       if ( eclass == CE_Warning ) {
37578         warn( CPLGetLastErrorMsg(), "%s" );
37579       }
37580 
37581 
37582     }
37583     {
37584       /* %typemap(out) void */
37585     }
37586 
37587     XSRETURN(argvi);
37588   fail:
37589 
37590     SWIG_croak_null();
37591   }
37592 }
37593 
37594 
XS(_wrap_wrapper_GDALWarpDestDS)37595 XS(_wrap_wrapper_GDALWarpDestDS) {
37596   {
37597     GDALDatasetShadow *arg1 = (GDALDatasetShadow *) 0 ;
37598     int arg2 ;
37599     GDALDatasetShadow **arg3 = (GDALDatasetShadow **) 0 ;
37600     GDALWarpAppOptions *arg4 = (GDALWarpAppOptions *) 0 ;
37601     GDALProgressFunc arg5 = (GDALProgressFunc) NULL ;
37602     void *arg6 = (void *) NULL ;
37603     void *argp4 = 0 ;
37604     int res4 = 0 ;
37605     int argvi = 0;
37606     int result;
37607     dXSARGS;
37608 
37609     /* %typemap(arginit, noblock=1) ( void* callback_data = NULL) */
37610     SavedEnv saved_env;
37611     saved_env.fct = NULL;
37612     saved_env.data = &PL_sv_undef;
37613     arg6 = (void *)(&saved_env);
37614     if ((items < 3) || (items > 5)) {
37615       SWIG_croak("Usage: wrapper_GDALWarpDestDS(dstDS,object_list_count,poObjects,warpAppOptions,callback,callback_data);");
37616     }
37617     {
37618       /* %typemap(in) (GDALDatasetShadow *) */
37619       void *argp = 0;
37620       int res = SWIG_ConvertPtr(ST(0), &argp, SWIGTYPE_p_GDALDatasetShadow, 0 |  0 );
37621       if (!SWIG_IsOK(res)) {
37622         do_confess(WRONG_CLASS, 1);
37623       }
37624       arg1 = reinterpret_cast< GDALDatasetShadow * >(argp);
37625       if (arg1 == NULL)
37626       do_confess(NEED_DEF, 1);
37627     }
37628     {
37629       /* %typemap(in, numinputs=1) (int object_list_count, GDALDatasetShadow** poObjects) */
37630       if (!(SvROK(ST(1)) && (SvTYPE(SvRV(ST(1)))==SVt_PVAV)))
37631       do_confess(NEED_ARRAY_REF, 1);
37632       AV *av = (AV*)(SvRV(ST(1)));
37633       arg2 = av_len(av)+1;
37634       /* get the pointers from the array */
37635       arg3 = (GDALDatasetShadow **)CPLMalloc(arg2*sizeof(GDALDatasetShadow *));
37636       if (arg3) {
37637         for (int i = 0; i < arg2; i++) {
37638           SV **sv = av_fetch(av, i, 0);
37639           int ret = SWIG_ConvertPtr(*sv, &(arg3[i]), SWIGTYPE_p_GDALDatasetShadow, 0);
37640           if (!SWIG_IsOK(ret))
37641           do_confess(WRONG_ITEM_IN_ARRAY, 1);
37642         }
37643       } else
37644       do_confess(OUT_OF_MEMORY, 1);
37645     }
37646     res4 = SWIG_ConvertPtr(ST(2), &argp4,SWIGTYPE_p_GDALWarpAppOptions, 0 |  0 );
37647     if (!SWIG_IsOK(res4)) {
37648       SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "wrapper_GDALWarpDestDS" "', argument " "4"" of type '" "GDALWarpAppOptions *""'");
37649     }
37650     arg4 = reinterpret_cast< GDALWarpAppOptions * >(argp4);
37651     if (items > 3) {
37652       {
37653         /* %typemap(in) (GDALProgressFunc callback = NULL) */
37654         if (SvOK(ST(3))) {
37655           if (SvROK(ST(3))) {
37656             if (SvTYPE(SvRV(ST(3))) != SVt_PVCV) {
37657               do_confess(NEED_CODE_REF, 1);
37658             } else {
37659               saved_env.fct = (SV *)ST(3);
37660               arg5 = &callback_d_cp_vp;
37661             }
37662           } else {
37663             do_confess(NEED_CODE_REF, 1);
37664           }
37665         }
37666       }
37667     }
37668     if (items > 4) {
37669       {
37670         /* %typemap(in) (void* callback_data=NULL) */
37671         if (SvOK(ST(4)))
37672         saved_env.data = (SV *)ST(4);
37673       }
37674     }
37675     {
37676       CPLErrorReset();
37677       result = (int)wrapper_GDALWarpDestDS(arg1,arg2,arg3,arg4,arg5,arg6);
37678       CPLErr eclass = CPLGetLastErrorType();
37679       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
37680         do_confess( CPLGetLastErrorMsg(), 0 );
37681 
37682 
37683 
37684 
37685 
37686       }
37687 
37688 
37689       /*
37690           Make warnings regular Perl warnings. This duplicates the warning
37691           message if DontUseExceptions() is in effect (it is not by default).
37692           */
37693       if ( eclass == CE_Warning ) {
37694         warn( CPLGetLastErrorMsg(), "%s" );
37695       }
37696 
37697 
37698     }
37699     ST(argvi) = SWIG_From_int  SWIG_PERL_CALL_ARGS_1(static_cast< int >(result)); argvi++ ;
37700 
37701 
37702 
37703     XSRETURN(argvi);
37704   fail:
37705 
37706 
37707 
37708     SWIG_croak_null();
37709   }
37710 }
37711 
37712 
XS(_wrap_wrapper_GDALWarpDestName)37713 XS(_wrap_wrapper_GDALWarpDestName) {
37714   {
37715     char *arg1 = (char *) 0 ;
37716     int arg2 ;
37717     GDALDatasetShadow **arg3 = (GDALDatasetShadow **) 0 ;
37718     GDALWarpAppOptions *arg4 = (GDALWarpAppOptions *) 0 ;
37719     GDALProgressFunc arg5 = (GDALProgressFunc) NULL ;
37720     void *arg6 = (void *) NULL ;
37721     U8 *tmpbuf1 = NULL ;
37722     void *argp4 = 0 ;
37723     int res4 = 0 ;
37724     int argvi = 0;
37725     GDALDatasetShadow *result = 0 ;
37726     dXSARGS;
37727 
37728     /* %typemap(arginit, noblock=1) ( void* callback_data = NULL) */
37729     SavedEnv saved_env;
37730     saved_env.fct = NULL;
37731     saved_env.data = &PL_sv_undef;
37732     arg6 = (void *)(&saved_env);
37733     {
37734       /* %typemap(default) const char * utf8_path */
37735       arg1 = (char *)"";
37736     }
37737     if ((items < 0) || (items > 5)) {
37738       SWIG_croak("Usage: wrapper_GDALWarpDestName(dest,object_list_count,poObjects,warpAppOptions,callback,callback_data);");
37739     }
37740     if (items > 0) {
37741       {
37742         /* %typemap(in,numinputs=1) (const char* utf8_path) (U8 *tmpbuf1) */
37743         arg1 = sv_to_utf8_string(ST(0), &tmpbuf1);
37744       }
37745     }
37746     if (items > 1) {
37747       {
37748         /* %typemap(in, numinputs=1) (int object_list_count, GDALDatasetShadow** poObjects) */
37749         if (!(SvROK(ST(1)) && (SvTYPE(SvRV(ST(1)))==SVt_PVAV)))
37750         do_confess(NEED_ARRAY_REF, 1);
37751         AV *av = (AV*)(SvRV(ST(1)));
37752         arg2 = av_len(av)+1;
37753         /* get the pointers from the array */
37754         arg3 = (GDALDatasetShadow **)CPLMalloc(arg2*sizeof(GDALDatasetShadow *));
37755         if (arg3) {
37756           for (int i = 0; i < arg2; i++) {
37757             SV **sv = av_fetch(av, i, 0);
37758             int ret = SWIG_ConvertPtr(*sv, &(arg3[i]), SWIGTYPE_p_GDALDatasetShadow, 0);
37759             if (!SWIG_IsOK(ret))
37760             do_confess(WRONG_ITEM_IN_ARRAY, 1);
37761           }
37762         } else
37763         do_confess(OUT_OF_MEMORY, 1);
37764       }
37765     }
37766     if (items > 2) {
37767       res4 = SWIG_ConvertPtr(ST(2), &argp4,SWIGTYPE_p_GDALWarpAppOptions, 0 |  0 );
37768       if (!SWIG_IsOK(res4)) {
37769         SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "wrapper_GDALWarpDestName" "', argument " "4"" of type '" "GDALWarpAppOptions *""'");
37770       }
37771       arg4 = reinterpret_cast< GDALWarpAppOptions * >(argp4);
37772     }
37773     if (items > 3) {
37774       {
37775         /* %typemap(in) (GDALProgressFunc callback = NULL) */
37776         if (SvOK(ST(3))) {
37777           if (SvROK(ST(3))) {
37778             if (SvTYPE(SvRV(ST(3))) != SVt_PVCV) {
37779               do_confess(NEED_CODE_REF, 1);
37780             } else {
37781               saved_env.fct = (SV *)ST(3);
37782               arg5 = &callback_d_cp_vp;
37783             }
37784           } else {
37785             do_confess(NEED_CODE_REF, 1);
37786           }
37787         }
37788       }
37789     }
37790     if (items > 4) {
37791       {
37792         /* %typemap(in) (void* callback_data=NULL) */
37793         if (SvOK(ST(4)))
37794         saved_env.data = (SV *)ST(4);
37795       }
37796     }
37797     {
37798       if (!arg1) {
37799         SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
37800       }
37801     }
37802     {
37803       CPLErrorReset();
37804       result = (GDALDatasetShadow *)wrapper_GDALWarpDestName((char const *)arg1,arg2,arg3,arg4,arg5,arg6);
37805       CPLErr eclass = CPLGetLastErrorType();
37806       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
37807         do_confess( CPLGetLastErrorMsg(), 0 );
37808 
37809 
37810 
37811 
37812 
37813       }
37814 
37815 
37816       /*
37817           Make warnings regular Perl warnings. This duplicates the warning
37818           message if DontUseExceptions() is in effect (it is not by default).
37819           */
37820       if ( eclass == CE_Warning ) {
37821         warn( CPLGetLastErrorMsg(), "%s" );
37822       }
37823 
37824 
37825     }
37826     ST(argvi) = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GDALDatasetShadow, SWIG_OWNER | SWIG_SHADOW); argvi++ ;
37827     {
37828       /* %typemap(freearg) (const char* utf8_path) */
37829       if (tmpbuf1) Safefree(tmpbuf1);
37830     }
37831 
37832 
37833     XSRETURN(argvi);
37834   fail:
37835     {
37836       /* %typemap(freearg) (const char* utf8_path) */
37837       if (tmpbuf1) Safefree(tmpbuf1);
37838     }
37839 
37840 
37841     SWIG_croak_null();
37842   }
37843 }
37844 
37845 
XS(_wrap_new_GDALVectorTranslateOptions)37846 XS(_wrap_new_GDALVectorTranslateOptions) {
37847   {
37848     char **arg1 = (char **) 0 ;
37849     int argvi = 0;
37850     GDALVectorTranslateOptions *result = 0 ;
37851     dXSARGS;
37852 
37853     if ((items < 1) || (items > 1)) {
37854       SWIG_croak("Usage: new_GDALVectorTranslateOptions(options);");
37855     }
37856     {
37857       /* %typemap(in) char **options */
37858       if (SvOK(ST(0))) {
37859         if (SvROK(ST(0))) {
37860           if (SvTYPE(SvRV(ST(0)))==SVt_PVAV) {
37861             AV *av = (AV*)(SvRV(ST(0)));
37862             for (int i = 0; i < av_len(av)+1; i++) {
37863               SV *sv = *(av_fetch(av, i, 0));
37864               bool sf;
37865               char *tmp = sv_to_utf8_string(sv, NULL, &sf);
37866               arg1 = CSLAddString(arg1, tmp);
37867               if (sf) Safefree(tmp); else free(tmp);
37868             }
37869           } else if (SvTYPE(SvRV(ST(0)))==SVt_PVHV) {
37870             HV *hv = (HV*)SvRV(ST(0));
37871             SV *sv;
37872             char *key;
37873             I32 klen;
37874             arg1 = NULL;
37875             hv_iterinit(hv);
37876             while(sv = hv_iternextsv(hv, &key, &klen)) {
37877               bool sf;
37878               char *tmp = sv_to_utf8_string(sv, NULL, &sf);
37879               arg1 = CSLAddNameValue(arg1, key, tmp);
37880               if (sf) Safefree(tmp); else free(tmp);
37881             }
37882           } else
37883           do_confess(NEED_REF, 1);
37884         } else
37885         do_confess(NEED_REF, 1);
37886       }
37887     }
37888     {
37889       CPLErrorReset();
37890       result = (GDALVectorTranslateOptions *)new_GDALVectorTranslateOptions(arg1);
37891       CPLErr eclass = CPLGetLastErrorType();
37892       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
37893         do_confess( CPLGetLastErrorMsg(), 0 );
37894 
37895 
37896 
37897 
37898 
37899       }
37900 
37901 
37902       /*
37903           Make warnings regular Perl warnings. This duplicates the warning
37904           message if DontUseExceptions() is in effect (it is not by default).
37905           */
37906       if ( eclass == CE_Warning ) {
37907         warn( CPLGetLastErrorMsg(), "%s" );
37908       }
37909 
37910 
37911     }
37912     ST(argvi) = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GDALVectorTranslateOptions, SWIG_OWNER | SWIG_SHADOW); argvi++ ;
37913     {
37914       /* %typemap(freearg) char **options */
37915       if (arg1) CSLDestroy( arg1 );
37916     }
37917     XSRETURN(argvi);
37918   fail:
37919     {
37920       /* %typemap(freearg) char **options */
37921       if (arg1) CSLDestroy( arg1 );
37922     }
37923     SWIG_croak_null();
37924   }
37925 }
37926 
37927 
XS(_wrap_delete_GDALVectorTranslateOptions)37928 XS(_wrap_delete_GDALVectorTranslateOptions) {
37929   {
37930     GDALVectorTranslateOptions *arg1 = (GDALVectorTranslateOptions *) 0 ;
37931     void *argp1 = 0 ;
37932     int res1 = 0 ;
37933     int argvi = 0;
37934     dXSARGS;
37935 
37936     if ((items < 1) || (items > 1)) {
37937       SWIG_croak("Usage: delete_GDALVectorTranslateOptions(self);");
37938     }
37939     res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_GDALVectorTranslateOptions, SWIG_POINTER_DISOWN |  0 );
37940     if (!SWIG_IsOK(res1)) {
37941       SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_GDALVectorTranslateOptions" "', argument " "1"" of type '" "GDALVectorTranslateOptions *""'");
37942     }
37943     arg1 = reinterpret_cast< GDALVectorTranslateOptions * >(argp1);
37944     {
37945       CPLErrorReset();
37946       delete_GDALVectorTranslateOptions(arg1);
37947       CPLErr eclass = CPLGetLastErrorType();
37948       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
37949         do_confess( CPLGetLastErrorMsg(), 0 );
37950 
37951 
37952 
37953 
37954 
37955       }
37956 
37957 
37958       /*
37959           Make warnings regular Perl warnings. This duplicates the warning
37960           message if DontUseExceptions() is in effect (it is not by default).
37961           */
37962       if ( eclass == CE_Warning ) {
37963         warn( CPLGetLastErrorMsg(), "%s" );
37964       }
37965 
37966 
37967     }
37968     {
37969       /* %typemap(out) void */
37970     }
37971 
37972     XSRETURN(argvi);
37973   fail:
37974 
37975     SWIG_croak_null();
37976   }
37977 }
37978 
37979 
XS(_wrap_wrapper_GDALVectorTranslateDestDS)37980 XS(_wrap_wrapper_GDALVectorTranslateDestDS) {
37981   {
37982     GDALDatasetShadow *arg1 = (GDALDatasetShadow *) 0 ;
37983     GDALDatasetShadow *arg2 = (GDALDatasetShadow *) 0 ;
37984     GDALVectorTranslateOptions *arg3 = (GDALVectorTranslateOptions *) 0 ;
37985     GDALProgressFunc arg4 = (GDALProgressFunc) NULL ;
37986     void *arg5 = (void *) NULL ;
37987     void *argp3 = 0 ;
37988     int res3 = 0 ;
37989     int argvi = 0;
37990     int result;
37991     dXSARGS;
37992 
37993     /* %typemap(arginit, noblock=1) ( void* callback_data = NULL) */
37994     SavedEnv saved_env;
37995     saved_env.fct = NULL;
37996     saved_env.data = &PL_sv_undef;
37997     arg5 = (void *)(&saved_env);
37998     if ((items < 3) || (items > 5)) {
37999       SWIG_croak("Usage: wrapper_GDALVectorTranslateDestDS(dstDS,srcDS,options,callback,callback_data);");
38000     }
38001     {
38002       /* %typemap(in) (GDALDatasetShadow *) */
38003       void *argp = 0;
38004       int res = SWIG_ConvertPtr(ST(0), &argp, SWIGTYPE_p_GDALDatasetShadow, 0 |  0 );
38005       if (!SWIG_IsOK(res)) {
38006         do_confess(WRONG_CLASS, 1);
38007       }
38008       arg1 = reinterpret_cast< GDALDatasetShadow * >(argp);
38009       if (arg1 == NULL)
38010       do_confess(NEED_DEF, 1);
38011     }
38012     {
38013       /* %typemap(in) (GDALDatasetShadow *) */
38014       void *argp = 0;
38015       int res = SWIG_ConvertPtr(ST(1), &argp, SWIGTYPE_p_GDALDatasetShadow, 0 |  0 );
38016       if (!SWIG_IsOK(res)) {
38017         do_confess(WRONG_CLASS, 1);
38018       }
38019       arg2 = reinterpret_cast< GDALDatasetShadow * >(argp);
38020       if (arg2 == NULL)
38021       do_confess(NEED_DEF, 1);
38022     }
38023     res3 = SWIG_ConvertPtr(ST(2), &argp3,SWIGTYPE_p_GDALVectorTranslateOptions, 0 |  0 );
38024     if (!SWIG_IsOK(res3)) {
38025       SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "wrapper_GDALVectorTranslateDestDS" "', argument " "3"" of type '" "GDALVectorTranslateOptions *""'");
38026     }
38027     arg3 = reinterpret_cast< GDALVectorTranslateOptions * >(argp3);
38028     if (items > 3) {
38029       {
38030         /* %typemap(in) (GDALProgressFunc callback = NULL) */
38031         if (SvOK(ST(3))) {
38032           if (SvROK(ST(3))) {
38033             if (SvTYPE(SvRV(ST(3))) != SVt_PVCV) {
38034               do_confess(NEED_CODE_REF, 1);
38035             } else {
38036               saved_env.fct = (SV *)ST(3);
38037               arg4 = &callback_d_cp_vp;
38038             }
38039           } else {
38040             do_confess(NEED_CODE_REF, 1);
38041           }
38042         }
38043       }
38044     }
38045     if (items > 4) {
38046       {
38047         /* %typemap(in) (void* callback_data=NULL) */
38048         if (SvOK(ST(4)))
38049         saved_env.data = (SV *)ST(4);
38050       }
38051     }
38052     {
38053       CPLErrorReset();
38054       result = (int)wrapper_GDALVectorTranslateDestDS(arg1,arg2,arg3,arg4,arg5);
38055       CPLErr eclass = CPLGetLastErrorType();
38056       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
38057         do_confess( CPLGetLastErrorMsg(), 0 );
38058 
38059 
38060 
38061 
38062 
38063       }
38064 
38065 
38066       /*
38067           Make warnings regular Perl warnings. This duplicates the warning
38068           message if DontUseExceptions() is in effect (it is not by default).
38069           */
38070       if ( eclass == CE_Warning ) {
38071         warn( CPLGetLastErrorMsg(), "%s" );
38072       }
38073 
38074 
38075     }
38076     ST(argvi) = SWIG_From_int  SWIG_PERL_CALL_ARGS_1(static_cast< int >(result)); argvi++ ;
38077 
38078 
38079 
38080 
38081     XSRETURN(argvi);
38082   fail:
38083 
38084 
38085 
38086 
38087     SWIG_croak_null();
38088   }
38089 }
38090 
38091 
XS(_wrap_wrapper_GDALVectorTranslateDestName)38092 XS(_wrap_wrapper_GDALVectorTranslateDestName) {
38093   {
38094     char *arg1 = (char *) 0 ;
38095     GDALDatasetShadow *arg2 = (GDALDatasetShadow *) 0 ;
38096     GDALVectorTranslateOptions *arg3 = (GDALVectorTranslateOptions *) 0 ;
38097     GDALProgressFunc arg4 = (GDALProgressFunc) NULL ;
38098     void *arg5 = (void *) NULL ;
38099     U8 *tmpbuf1 = NULL ;
38100     void *argp3 = 0 ;
38101     int res3 = 0 ;
38102     int argvi = 0;
38103     GDALDatasetShadow *result = 0 ;
38104     dXSARGS;
38105 
38106     /* %typemap(arginit, noblock=1) ( void* callback_data = NULL) */
38107     SavedEnv saved_env;
38108     saved_env.fct = NULL;
38109     saved_env.data = &PL_sv_undef;
38110     arg5 = (void *)(&saved_env);
38111     {
38112       /* %typemap(default) const char * utf8_path */
38113       arg1 = (char *)"";
38114     }
38115     if ((items < 0) || (items > 5)) {
38116       SWIG_croak("Usage: wrapper_GDALVectorTranslateDestName(dest,srcDS,options,callback,callback_data);");
38117     }
38118     if (items > 0) {
38119       {
38120         /* %typemap(in,numinputs=1) (const char* utf8_path) (U8 *tmpbuf1) */
38121         arg1 = sv_to_utf8_string(ST(0), &tmpbuf1);
38122       }
38123     }
38124     if (items > 1) {
38125       {
38126         /* %typemap(in) (GDALDatasetShadow *) */
38127         void *argp = 0;
38128         int res = SWIG_ConvertPtr(ST(1), &argp, SWIGTYPE_p_GDALDatasetShadow, 0 |  0 );
38129         if (!SWIG_IsOK(res)) {
38130           do_confess(WRONG_CLASS, 1);
38131         }
38132         arg2 = reinterpret_cast< GDALDatasetShadow * >(argp);
38133         if (arg2 == NULL)
38134         do_confess(NEED_DEF, 1);
38135       }
38136     }
38137     if (items > 2) {
38138       res3 = SWIG_ConvertPtr(ST(2), &argp3,SWIGTYPE_p_GDALVectorTranslateOptions, 0 |  0 );
38139       if (!SWIG_IsOK(res3)) {
38140         SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "wrapper_GDALVectorTranslateDestName" "', argument " "3"" of type '" "GDALVectorTranslateOptions *""'");
38141       }
38142       arg3 = reinterpret_cast< GDALVectorTranslateOptions * >(argp3);
38143     }
38144     if (items > 3) {
38145       {
38146         /* %typemap(in) (GDALProgressFunc callback = NULL) */
38147         if (SvOK(ST(3))) {
38148           if (SvROK(ST(3))) {
38149             if (SvTYPE(SvRV(ST(3))) != SVt_PVCV) {
38150               do_confess(NEED_CODE_REF, 1);
38151             } else {
38152               saved_env.fct = (SV *)ST(3);
38153               arg4 = &callback_d_cp_vp;
38154             }
38155           } else {
38156             do_confess(NEED_CODE_REF, 1);
38157           }
38158         }
38159       }
38160     }
38161     if (items > 4) {
38162       {
38163         /* %typemap(in) (void* callback_data=NULL) */
38164         if (SvOK(ST(4)))
38165         saved_env.data = (SV *)ST(4);
38166       }
38167     }
38168     {
38169       if (!arg1) {
38170         SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
38171       }
38172     }
38173     {
38174       CPLErrorReset();
38175       result = (GDALDatasetShadow *)wrapper_GDALVectorTranslateDestName((char const *)arg1,arg2,arg3,arg4,arg5);
38176       CPLErr eclass = CPLGetLastErrorType();
38177       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
38178         do_confess( CPLGetLastErrorMsg(), 0 );
38179 
38180 
38181 
38182 
38183 
38184       }
38185 
38186 
38187       /*
38188           Make warnings regular Perl warnings. This duplicates the warning
38189           message if DontUseExceptions() is in effect (it is not by default).
38190           */
38191       if ( eclass == CE_Warning ) {
38192         warn( CPLGetLastErrorMsg(), "%s" );
38193       }
38194 
38195 
38196     }
38197     ST(argvi) = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GDALDatasetShadow, SWIG_OWNER | SWIG_SHADOW); argvi++ ;
38198     {
38199       /* %typemap(freearg) (const char* utf8_path) */
38200       if (tmpbuf1) Safefree(tmpbuf1);
38201     }
38202 
38203 
38204 
38205     XSRETURN(argvi);
38206   fail:
38207     {
38208       /* %typemap(freearg) (const char* utf8_path) */
38209       if (tmpbuf1) Safefree(tmpbuf1);
38210     }
38211 
38212 
38213 
38214     SWIG_croak_null();
38215   }
38216 }
38217 
38218 
XS(_wrap_new_GDALDEMProcessingOptions)38219 XS(_wrap_new_GDALDEMProcessingOptions) {
38220   {
38221     char **arg1 = (char **) 0 ;
38222     int argvi = 0;
38223     GDALDEMProcessingOptions *result = 0 ;
38224     dXSARGS;
38225 
38226     if ((items < 1) || (items > 1)) {
38227       SWIG_croak("Usage: new_GDALDEMProcessingOptions(options);");
38228     }
38229     {
38230       /* %typemap(in) char **options */
38231       if (SvOK(ST(0))) {
38232         if (SvROK(ST(0))) {
38233           if (SvTYPE(SvRV(ST(0)))==SVt_PVAV) {
38234             AV *av = (AV*)(SvRV(ST(0)));
38235             for (int i = 0; i < av_len(av)+1; i++) {
38236               SV *sv = *(av_fetch(av, i, 0));
38237               bool sf;
38238               char *tmp = sv_to_utf8_string(sv, NULL, &sf);
38239               arg1 = CSLAddString(arg1, tmp);
38240               if (sf) Safefree(tmp); else free(tmp);
38241             }
38242           } else if (SvTYPE(SvRV(ST(0)))==SVt_PVHV) {
38243             HV *hv = (HV*)SvRV(ST(0));
38244             SV *sv;
38245             char *key;
38246             I32 klen;
38247             arg1 = NULL;
38248             hv_iterinit(hv);
38249             while(sv = hv_iternextsv(hv, &key, &klen)) {
38250               bool sf;
38251               char *tmp = sv_to_utf8_string(sv, NULL, &sf);
38252               arg1 = CSLAddNameValue(arg1, key, tmp);
38253               if (sf) Safefree(tmp); else free(tmp);
38254             }
38255           } else
38256           do_confess(NEED_REF, 1);
38257         } else
38258         do_confess(NEED_REF, 1);
38259       }
38260     }
38261     {
38262       CPLErrorReset();
38263       result = (GDALDEMProcessingOptions *)new_GDALDEMProcessingOptions(arg1);
38264       CPLErr eclass = CPLGetLastErrorType();
38265       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
38266         do_confess( CPLGetLastErrorMsg(), 0 );
38267 
38268 
38269 
38270 
38271 
38272       }
38273 
38274 
38275       /*
38276           Make warnings regular Perl warnings. This duplicates the warning
38277           message if DontUseExceptions() is in effect (it is not by default).
38278           */
38279       if ( eclass == CE_Warning ) {
38280         warn( CPLGetLastErrorMsg(), "%s" );
38281       }
38282 
38283 
38284     }
38285     ST(argvi) = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GDALDEMProcessingOptions, SWIG_OWNER | SWIG_SHADOW); argvi++ ;
38286     {
38287       /* %typemap(freearg) char **options */
38288       if (arg1) CSLDestroy( arg1 );
38289     }
38290     XSRETURN(argvi);
38291   fail:
38292     {
38293       /* %typemap(freearg) char **options */
38294       if (arg1) CSLDestroy( arg1 );
38295     }
38296     SWIG_croak_null();
38297   }
38298 }
38299 
38300 
XS(_wrap_delete_GDALDEMProcessingOptions)38301 XS(_wrap_delete_GDALDEMProcessingOptions) {
38302   {
38303     GDALDEMProcessingOptions *arg1 = (GDALDEMProcessingOptions *) 0 ;
38304     void *argp1 = 0 ;
38305     int res1 = 0 ;
38306     int argvi = 0;
38307     dXSARGS;
38308 
38309     if ((items < 1) || (items > 1)) {
38310       SWIG_croak("Usage: delete_GDALDEMProcessingOptions(self);");
38311     }
38312     res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_GDALDEMProcessingOptions, SWIG_POINTER_DISOWN |  0 );
38313     if (!SWIG_IsOK(res1)) {
38314       SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_GDALDEMProcessingOptions" "', argument " "1"" of type '" "GDALDEMProcessingOptions *""'");
38315     }
38316     arg1 = reinterpret_cast< GDALDEMProcessingOptions * >(argp1);
38317     {
38318       CPLErrorReset();
38319       delete_GDALDEMProcessingOptions(arg1);
38320       CPLErr eclass = CPLGetLastErrorType();
38321       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
38322         do_confess( CPLGetLastErrorMsg(), 0 );
38323 
38324 
38325 
38326 
38327 
38328       }
38329 
38330 
38331       /*
38332           Make warnings regular Perl warnings. This duplicates the warning
38333           message if DontUseExceptions() is in effect (it is not by default).
38334           */
38335       if ( eclass == CE_Warning ) {
38336         warn( CPLGetLastErrorMsg(), "%s" );
38337       }
38338 
38339 
38340     }
38341     {
38342       /* %typemap(out) void */
38343     }
38344 
38345     XSRETURN(argvi);
38346   fail:
38347 
38348     SWIG_croak_null();
38349   }
38350 }
38351 
38352 
XS(_wrap_wrapper_GDALDEMProcessing)38353 XS(_wrap_wrapper_GDALDEMProcessing) {
38354   {
38355     char *arg1 = (char *) 0 ;
38356     GDALDatasetShadow *arg2 = (GDALDatasetShadow *) 0 ;
38357     char *arg3 = (char *) 0 ;
38358     char *arg4 = (char *) 0 ;
38359     GDALDEMProcessingOptions *arg5 = (GDALDEMProcessingOptions *) 0 ;
38360     GDALProgressFunc arg6 = (GDALProgressFunc) NULL ;
38361     void *arg7 = (void *) NULL ;
38362     U8 *tmpbuf1 = NULL ;
38363     int res3 ;
38364     char *buf3 = 0 ;
38365     int alloc3 = 0 ;
38366     int res4 ;
38367     char *buf4 = 0 ;
38368     int alloc4 = 0 ;
38369     void *argp5 = 0 ;
38370     int res5 = 0 ;
38371     int argvi = 0;
38372     GDALDatasetShadow *result = 0 ;
38373     dXSARGS;
38374 
38375     /* %typemap(arginit, noblock=1) ( void* callback_data = NULL) */
38376     SavedEnv saved_env;
38377     saved_env.fct = NULL;
38378     saved_env.data = &PL_sv_undef;
38379     arg7 = (void *)(&saved_env);
38380     {
38381       /* %typemap(default) const char * utf8_path */
38382       arg1 = (char *)"";
38383     }
38384     if ((items < 0) || (items > 7)) {
38385       SWIG_croak("Usage: wrapper_GDALDEMProcessing(dest,dataset,pszProcessing,pszColorFilename,options,callback,callback_data);");
38386     }
38387     if (items > 0) {
38388       {
38389         /* %typemap(in,numinputs=1) (const char* utf8_path) (U8 *tmpbuf1) */
38390         arg1 = sv_to_utf8_string(ST(0), &tmpbuf1);
38391       }
38392     }
38393     if (items > 1) {
38394       {
38395         /* %typemap(in) (GDALDatasetShadow *) */
38396         void *argp = 0;
38397         int res = SWIG_ConvertPtr(ST(1), &argp, SWIGTYPE_p_GDALDatasetShadow, 0 |  0 );
38398         if (!SWIG_IsOK(res)) {
38399           do_confess(WRONG_CLASS, 1);
38400         }
38401         arg2 = reinterpret_cast< GDALDatasetShadow * >(argp);
38402         if (arg2 == NULL)
38403         do_confess(NEED_DEF, 1);
38404       }
38405     }
38406     if (items > 2) {
38407       res3 = SWIG_AsCharPtrAndSize(ST(2), &buf3, NULL, &alloc3);
38408       if (!SWIG_IsOK(res3)) {
38409         SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "wrapper_GDALDEMProcessing" "', argument " "3"" of type '" "char const *""'");
38410       }
38411       arg3 = reinterpret_cast< char * >(buf3);
38412     }
38413     if (items > 3) {
38414       res4 = SWIG_AsCharPtrAndSize(ST(3), &buf4, NULL, &alloc4);
38415       if (!SWIG_IsOK(res4)) {
38416         SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "wrapper_GDALDEMProcessing" "', argument " "4"" of type '" "char const *""'");
38417       }
38418       arg4 = reinterpret_cast< char * >(buf4);
38419     }
38420     if (items > 4) {
38421       res5 = SWIG_ConvertPtr(ST(4), &argp5,SWIGTYPE_p_GDALDEMProcessingOptions, 0 |  0 );
38422       if (!SWIG_IsOK(res5)) {
38423         SWIG_exception_fail(SWIG_ArgError(res5), "in method '" "wrapper_GDALDEMProcessing" "', argument " "5"" of type '" "GDALDEMProcessingOptions *""'");
38424       }
38425       arg5 = reinterpret_cast< GDALDEMProcessingOptions * >(argp5);
38426     }
38427     if (items > 5) {
38428       {
38429         /* %typemap(in) (GDALProgressFunc callback = NULL) */
38430         if (SvOK(ST(5))) {
38431           if (SvROK(ST(5))) {
38432             if (SvTYPE(SvRV(ST(5))) != SVt_PVCV) {
38433               do_confess(NEED_CODE_REF, 1);
38434             } else {
38435               saved_env.fct = (SV *)ST(5);
38436               arg6 = &callback_d_cp_vp;
38437             }
38438           } else {
38439             do_confess(NEED_CODE_REF, 1);
38440           }
38441         }
38442       }
38443     }
38444     if (items > 6) {
38445       {
38446         /* %typemap(in) (void* callback_data=NULL) */
38447         if (SvOK(ST(6)))
38448         saved_env.data = (SV *)ST(6);
38449       }
38450     }
38451     {
38452       if (!arg1) {
38453         SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
38454       }
38455     }
38456     {
38457       if (!arg2) {
38458         SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
38459       }
38460     }
38461     {
38462       if (!arg3) {
38463         SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
38464       }
38465     }
38466     {
38467       CPLErrorReset();
38468       result = (GDALDatasetShadow *)wrapper_GDALDEMProcessing((char const *)arg1,arg2,(char const *)arg3,(char const *)arg4,arg5,arg6,arg7);
38469       CPLErr eclass = CPLGetLastErrorType();
38470       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
38471         do_confess( CPLGetLastErrorMsg(), 0 );
38472 
38473 
38474 
38475 
38476 
38477       }
38478 
38479 
38480       /*
38481           Make warnings regular Perl warnings. This duplicates the warning
38482           message if DontUseExceptions() is in effect (it is not by default).
38483           */
38484       if ( eclass == CE_Warning ) {
38485         warn( CPLGetLastErrorMsg(), "%s" );
38486       }
38487 
38488 
38489     }
38490     ST(argvi) = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GDALDatasetShadow, SWIG_OWNER | SWIG_SHADOW); argvi++ ;
38491     {
38492       /* %typemap(freearg) (const char* utf8_path) */
38493       if (tmpbuf1) Safefree(tmpbuf1);
38494     }
38495 
38496     if (alloc3 == SWIG_NEWOBJ) delete[] buf3;
38497     if (alloc4 == SWIG_NEWOBJ) delete[] buf4;
38498 
38499 
38500     XSRETURN(argvi);
38501   fail:
38502     {
38503       /* %typemap(freearg) (const char* utf8_path) */
38504       if (tmpbuf1) Safefree(tmpbuf1);
38505     }
38506 
38507     if (alloc3 == SWIG_NEWOBJ) delete[] buf3;
38508     if (alloc4 == SWIG_NEWOBJ) delete[] buf4;
38509 
38510 
38511     SWIG_croak_null();
38512   }
38513 }
38514 
38515 
XS(_wrap_new_GDALNearblackOptions)38516 XS(_wrap_new_GDALNearblackOptions) {
38517   {
38518     char **arg1 = (char **) 0 ;
38519     int argvi = 0;
38520     GDALNearblackOptions *result = 0 ;
38521     dXSARGS;
38522 
38523     if ((items < 1) || (items > 1)) {
38524       SWIG_croak("Usage: new_GDALNearblackOptions(options);");
38525     }
38526     {
38527       /* %typemap(in) char **options */
38528       if (SvOK(ST(0))) {
38529         if (SvROK(ST(0))) {
38530           if (SvTYPE(SvRV(ST(0)))==SVt_PVAV) {
38531             AV *av = (AV*)(SvRV(ST(0)));
38532             for (int i = 0; i < av_len(av)+1; i++) {
38533               SV *sv = *(av_fetch(av, i, 0));
38534               bool sf;
38535               char *tmp = sv_to_utf8_string(sv, NULL, &sf);
38536               arg1 = CSLAddString(arg1, tmp);
38537               if (sf) Safefree(tmp); else free(tmp);
38538             }
38539           } else if (SvTYPE(SvRV(ST(0)))==SVt_PVHV) {
38540             HV *hv = (HV*)SvRV(ST(0));
38541             SV *sv;
38542             char *key;
38543             I32 klen;
38544             arg1 = NULL;
38545             hv_iterinit(hv);
38546             while(sv = hv_iternextsv(hv, &key, &klen)) {
38547               bool sf;
38548               char *tmp = sv_to_utf8_string(sv, NULL, &sf);
38549               arg1 = CSLAddNameValue(arg1, key, tmp);
38550               if (sf) Safefree(tmp); else free(tmp);
38551             }
38552           } else
38553           do_confess(NEED_REF, 1);
38554         } else
38555         do_confess(NEED_REF, 1);
38556       }
38557     }
38558     {
38559       CPLErrorReset();
38560       result = (GDALNearblackOptions *)new_GDALNearblackOptions(arg1);
38561       CPLErr eclass = CPLGetLastErrorType();
38562       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
38563         do_confess( CPLGetLastErrorMsg(), 0 );
38564 
38565 
38566 
38567 
38568 
38569       }
38570 
38571 
38572       /*
38573           Make warnings regular Perl warnings. This duplicates the warning
38574           message if DontUseExceptions() is in effect (it is not by default).
38575           */
38576       if ( eclass == CE_Warning ) {
38577         warn( CPLGetLastErrorMsg(), "%s" );
38578       }
38579 
38580 
38581     }
38582     ST(argvi) = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GDALNearblackOptions, SWIG_OWNER | SWIG_SHADOW); argvi++ ;
38583     {
38584       /* %typemap(freearg) char **options */
38585       if (arg1) CSLDestroy( arg1 );
38586     }
38587     XSRETURN(argvi);
38588   fail:
38589     {
38590       /* %typemap(freearg) char **options */
38591       if (arg1) CSLDestroy( arg1 );
38592     }
38593     SWIG_croak_null();
38594   }
38595 }
38596 
38597 
XS(_wrap_delete_GDALNearblackOptions)38598 XS(_wrap_delete_GDALNearblackOptions) {
38599   {
38600     GDALNearblackOptions *arg1 = (GDALNearblackOptions *) 0 ;
38601     void *argp1 = 0 ;
38602     int res1 = 0 ;
38603     int argvi = 0;
38604     dXSARGS;
38605 
38606     if ((items < 1) || (items > 1)) {
38607       SWIG_croak("Usage: delete_GDALNearblackOptions(self);");
38608     }
38609     res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_GDALNearblackOptions, SWIG_POINTER_DISOWN |  0 );
38610     if (!SWIG_IsOK(res1)) {
38611       SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_GDALNearblackOptions" "', argument " "1"" of type '" "GDALNearblackOptions *""'");
38612     }
38613     arg1 = reinterpret_cast< GDALNearblackOptions * >(argp1);
38614     {
38615       CPLErrorReset();
38616       delete_GDALNearblackOptions(arg1);
38617       CPLErr eclass = CPLGetLastErrorType();
38618       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
38619         do_confess( CPLGetLastErrorMsg(), 0 );
38620 
38621 
38622 
38623 
38624 
38625       }
38626 
38627 
38628       /*
38629           Make warnings regular Perl warnings. This duplicates the warning
38630           message if DontUseExceptions() is in effect (it is not by default).
38631           */
38632       if ( eclass == CE_Warning ) {
38633         warn( CPLGetLastErrorMsg(), "%s" );
38634       }
38635 
38636 
38637     }
38638     {
38639       /* %typemap(out) void */
38640     }
38641 
38642     XSRETURN(argvi);
38643   fail:
38644 
38645     SWIG_croak_null();
38646   }
38647 }
38648 
38649 
XS(_wrap_wrapper_GDALNearblackDestDS)38650 XS(_wrap_wrapper_GDALNearblackDestDS) {
38651   {
38652     GDALDatasetShadow *arg1 = (GDALDatasetShadow *) 0 ;
38653     GDALDatasetShadow *arg2 = (GDALDatasetShadow *) 0 ;
38654     GDALNearblackOptions *arg3 = (GDALNearblackOptions *) 0 ;
38655     GDALProgressFunc arg4 = (GDALProgressFunc) NULL ;
38656     void *arg5 = (void *) NULL ;
38657     void *argp3 = 0 ;
38658     int res3 = 0 ;
38659     int argvi = 0;
38660     int result;
38661     dXSARGS;
38662 
38663     /* %typemap(arginit, noblock=1) ( void* callback_data = NULL) */
38664     SavedEnv saved_env;
38665     saved_env.fct = NULL;
38666     saved_env.data = &PL_sv_undef;
38667     arg5 = (void *)(&saved_env);
38668     if ((items < 3) || (items > 5)) {
38669       SWIG_croak("Usage: wrapper_GDALNearblackDestDS(dstDS,srcDS,options,callback,callback_data);");
38670     }
38671     {
38672       /* %typemap(in) (GDALDatasetShadow *) */
38673       void *argp = 0;
38674       int res = SWIG_ConvertPtr(ST(0), &argp, SWIGTYPE_p_GDALDatasetShadow, 0 |  0 );
38675       if (!SWIG_IsOK(res)) {
38676         do_confess(WRONG_CLASS, 1);
38677       }
38678       arg1 = reinterpret_cast< GDALDatasetShadow * >(argp);
38679       if (arg1 == NULL)
38680       do_confess(NEED_DEF, 1);
38681     }
38682     {
38683       /* %typemap(in) (GDALDatasetShadow *) */
38684       void *argp = 0;
38685       int res = SWIG_ConvertPtr(ST(1), &argp, SWIGTYPE_p_GDALDatasetShadow, 0 |  0 );
38686       if (!SWIG_IsOK(res)) {
38687         do_confess(WRONG_CLASS, 1);
38688       }
38689       arg2 = reinterpret_cast< GDALDatasetShadow * >(argp);
38690       if (arg2 == NULL)
38691       do_confess(NEED_DEF, 1);
38692     }
38693     res3 = SWIG_ConvertPtr(ST(2), &argp3,SWIGTYPE_p_GDALNearblackOptions, 0 |  0 );
38694     if (!SWIG_IsOK(res3)) {
38695       SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "wrapper_GDALNearblackDestDS" "', argument " "3"" of type '" "GDALNearblackOptions *""'");
38696     }
38697     arg3 = reinterpret_cast< GDALNearblackOptions * >(argp3);
38698     if (items > 3) {
38699       {
38700         /* %typemap(in) (GDALProgressFunc callback = NULL) */
38701         if (SvOK(ST(3))) {
38702           if (SvROK(ST(3))) {
38703             if (SvTYPE(SvRV(ST(3))) != SVt_PVCV) {
38704               do_confess(NEED_CODE_REF, 1);
38705             } else {
38706               saved_env.fct = (SV *)ST(3);
38707               arg4 = &callback_d_cp_vp;
38708             }
38709           } else {
38710             do_confess(NEED_CODE_REF, 1);
38711           }
38712         }
38713       }
38714     }
38715     if (items > 4) {
38716       {
38717         /* %typemap(in) (void* callback_data=NULL) */
38718         if (SvOK(ST(4)))
38719         saved_env.data = (SV *)ST(4);
38720       }
38721     }
38722     {
38723       CPLErrorReset();
38724       result = (int)wrapper_GDALNearblackDestDS(arg1,arg2,arg3,arg4,arg5);
38725       CPLErr eclass = CPLGetLastErrorType();
38726       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
38727         do_confess( CPLGetLastErrorMsg(), 0 );
38728 
38729 
38730 
38731 
38732 
38733       }
38734 
38735 
38736       /*
38737           Make warnings regular Perl warnings. This duplicates the warning
38738           message if DontUseExceptions() is in effect (it is not by default).
38739           */
38740       if ( eclass == CE_Warning ) {
38741         warn( CPLGetLastErrorMsg(), "%s" );
38742       }
38743 
38744 
38745     }
38746     ST(argvi) = SWIG_From_int  SWIG_PERL_CALL_ARGS_1(static_cast< int >(result)); argvi++ ;
38747 
38748 
38749 
38750 
38751     XSRETURN(argvi);
38752   fail:
38753 
38754 
38755 
38756 
38757     SWIG_croak_null();
38758   }
38759 }
38760 
38761 
XS(_wrap_wrapper_GDALNearblackDestName)38762 XS(_wrap_wrapper_GDALNearblackDestName) {
38763   {
38764     char *arg1 = (char *) 0 ;
38765     GDALDatasetShadow *arg2 = (GDALDatasetShadow *) 0 ;
38766     GDALNearblackOptions *arg3 = (GDALNearblackOptions *) 0 ;
38767     GDALProgressFunc arg4 = (GDALProgressFunc) NULL ;
38768     void *arg5 = (void *) NULL ;
38769     U8 *tmpbuf1 = NULL ;
38770     void *argp3 = 0 ;
38771     int res3 = 0 ;
38772     int argvi = 0;
38773     GDALDatasetShadow *result = 0 ;
38774     dXSARGS;
38775 
38776     /* %typemap(arginit, noblock=1) ( void* callback_data = NULL) */
38777     SavedEnv saved_env;
38778     saved_env.fct = NULL;
38779     saved_env.data = &PL_sv_undef;
38780     arg5 = (void *)(&saved_env);
38781     {
38782       /* %typemap(default) const char * utf8_path */
38783       arg1 = (char *)"";
38784     }
38785     if ((items < 0) || (items > 5)) {
38786       SWIG_croak("Usage: wrapper_GDALNearblackDestName(dest,srcDS,options,callback,callback_data);");
38787     }
38788     if (items > 0) {
38789       {
38790         /* %typemap(in,numinputs=1) (const char* utf8_path) (U8 *tmpbuf1) */
38791         arg1 = sv_to_utf8_string(ST(0), &tmpbuf1);
38792       }
38793     }
38794     if (items > 1) {
38795       {
38796         /* %typemap(in) (GDALDatasetShadow *) */
38797         void *argp = 0;
38798         int res = SWIG_ConvertPtr(ST(1), &argp, SWIGTYPE_p_GDALDatasetShadow, 0 |  0 );
38799         if (!SWIG_IsOK(res)) {
38800           do_confess(WRONG_CLASS, 1);
38801         }
38802         arg2 = reinterpret_cast< GDALDatasetShadow * >(argp);
38803         if (arg2 == NULL)
38804         do_confess(NEED_DEF, 1);
38805       }
38806     }
38807     if (items > 2) {
38808       res3 = SWIG_ConvertPtr(ST(2), &argp3,SWIGTYPE_p_GDALNearblackOptions, 0 |  0 );
38809       if (!SWIG_IsOK(res3)) {
38810         SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "wrapper_GDALNearblackDestName" "', argument " "3"" of type '" "GDALNearblackOptions *""'");
38811       }
38812       arg3 = reinterpret_cast< GDALNearblackOptions * >(argp3);
38813     }
38814     if (items > 3) {
38815       {
38816         /* %typemap(in) (GDALProgressFunc callback = NULL) */
38817         if (SvOK(ST(3))) {
38818           if (SvROK(ST(3))) {
38819             if (SvTYPE(SvRV(ST(3))) != SVt_PVCV) {
38820               do_confess(NEED_CODE_REF, 1);
38821             } else {
38822               saved_env.fct = (SV *)ST(3);
38823               arg4 = &callback_d_cp_vp;
38824             }
38825           } else {
38826             do_confess(NEED_CODE_REF, 1);
38827           }
38828         }
38829       }
38830     }
38831     if (items > 4) {
38832       {
38833         /* %typemap(in) (void* callback_data=NULL) */
38834         if (SvOK(ST(4)))
38835         saved_env.data = (SV *)ST(4);
38836       }
38837     }
38838     {
38839       if (!arg1) {
38840         SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
38841       }
38842     }
38843     {
38844       CPLErrorReset();
38845       result = (GDALDatasetShadow *)wrapper_GDALNearblackDestName((char const *)arg1,arg2,arg3,arg4,arg5);
38846       CPLErr eclass = CPLGetLastErrorType();
38847       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
38848         do_confess( CPLGetLastErrorMsg(), 0 );
38849 
38850 
38851 
38852 
38853 
38854       }
38855 
38856 
38857       /*
38858           Make warnings regular Perl warnings. This duplicates the warning
38859           message if DontUseExceptions() is in effect (it is not by default).
38860           */
38861       if ( eclass == CE_Warning ) {
38862         warn( CPLGetLastErrorMsg(), "%s" );
38863       }
38864 
38865 
38866     }
38867     ST(argvi) = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GDALDatasetShadow, SWIG_OWNER | SWIG_SHADOW); argvi++ ;
38868     {
38869       /* %typemap(freearg) (const char* utf8_path) */
38870       if (tmpbuf1) Safefree(tmpbuf1);
38871     }
38872 
38873 
38874 
38875     XSRETURN(argvi);
38876   fail:
38877     {
38878       /* %typemap(freearg) (const char* utf8_path) */
38879       if (tmpbuf1) Safefree(tmpbuf1);
38880     }
38881 
38882 
38883 
38884     SWIG_croak_null();
38885   }
38886 }
38887 
38888 
XS(_wrap_new_GDALGridOptions)38889 XS(_wrap_new_GDALGridOptions) {
38890   {
38891     char **arg1 = (char **) 0 ;
38892     int argvi = 0;
38893     GDALGridOptions *result = 0 ;
38894     dXSARGS;
38895 
38896     if ((items < 1) || (items > 1)) {
38897       SWIG_croak("Usage: new_GDALGridOptions(options);");
38898     }
38899     {
38900       /* %typemap(in) char **options */
38901       if (SvOK(ST(0))) {
38902         if (SvROK(ST(0))) {
38903           if (SvTYPE(SvRV(ST(0)))==SVt_PVAV) {
38904             AV *av = (AV*)(SvRV(ST(0)));
38905             for (int i = 0; i < av_len(av)+1; i++) {
38906               SV *sv = *(av_fetch(av, i, 0));
38907               bool sf;
38908               char *tmp = sv_to_utf8_string(sv, NULL, &sf);
38909               arg1 = CSLAddString(arg1, tmp);
38910               if (sf) Safefree(tmp); else free(tmp);
38911             }
38912           } else if (SvTYPE(SvRV(ST(0)))==SVt_PVHV) {
38913             HV *hv = (HV*)SvRV(ST(0));
38914             SV *sv;
38915             char *key;
38916             I32 klen;
38917             arg1 = NULL;
38918             hv_iterinit(hv);
38919             while(sv = hv_iternextsv(hv, &key, &klen)) {
38920               bool sf;
38921               char *tmp = sv_to_utf8_string(sv, NULL, &sf);
38922               arg1 = CSLAddNameValue(arg1, key, tmp);
38923               if (sf) Safefree(tmp); else free(tmp);
38924             }
38925           } else
38926           do_confess(NEED_REF, 1);
38927         } else
38928         do_confess(NEED_REF, 1);
38929       }
38930     }
38931     {
38932       CPLErrorReset();
38933       result = (GDALGridOptions *)new_GDALGridOptions(arg1);
38934       CPLErr eclass = CPLGetLastErrorType();
38935       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
38936         do_confess( CPLGetLastErrorMsg(), 0 );
38937 
38938 
38939 
38940 
38941 
38942       }
38943 
38944 
38945       /*
38946           Make warnings regular Perl warnings. This duplicates the warning
38947           message if DontUseExceptions() is in effect (it is not by default).
38948           */
38949       if ( eclass == CE_Warning ) {
38950         warn( CPLGetLastErrorMsg(), "%s" );
38951       }
38952 
38953 
38954     }
38955     ST(argvi) = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GDALGridOptions, SWIG_OWNER | SWIG_SHADOW); argvi++ ;
38956     {
38957       /* %typemap(freearg) char **options */
38958       if (arg1) CSLDestroy( arg1 );
38959     }
38960     XSRETURN(argvi);
38961   fail:
38962     {
38963       /* %typemap(freearg) char **options */
38964       if (arg1) CSLDestroy( arg1 );
38965     }
38966     SWIG_croak_null();
38967   }
38968 }
38969 
38970 
XS(_wrap_delete_GDALGridOptions)38971 XS(_wrap_delete_GDALGridOptions) {
38972   {
38973     GDALGridOptions *arg1 = (GDALGridOptions *) 0 ;
38974     void *argp1 = 0 ;
38975     int res1 = 0 ;
38976     int argvi = 0;
38977     dXSARGS;
38978 
38979     if ((items < 1) || (items > 1)) {
38980       SWIG_croak("Usage: delete_GDALGridOptions(self);");
38981     }
38982     res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_GDALGridOptions, SWIG_POINTER_DISOWN |  0 );
38983     if (!SWIG_IsOK(res1)) {
38984       SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_GDALGridOptions" "', argument " "1"" of type '" "GDALGridOptions *""'");
38985     }
38986     arg1 = reinterpret_cast< GDALGridOptions * >(argp1);
38987     {
38988       CPLErrorReset();
38989       delete_GDALGridOptions(arg1);
38990       CPLErr eclass = CPLGetLastErrorType();
38991       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
38992         do_confess( CPLGetLastErrorMsg(), 0 );
38993 
38994 
38995 
38996 
38997 
38998       }
38999 
39000 
39001       /*
39002           Make warnings regular Perl warnings. This duplicates the warning
39003           message if DontUseExceptions() is in effect (it is not by default).
39004           */
39005       if ( eclass == CE_Warning ) {
39006         warn( CPLGetLastErrorMsg(), "%s" );
39007       }
39008 
39009 
39010     }
39011     {
39012       /* %typemap(out) void */
39013     }
39014 
39015     XSRETURN(argvi);
39016   fail:
39017 
39018     SWIG_croak_null();
39019   }
39020 }
39021 
39022 
XS(_wrap_wrapper_GDALGrid)39023 XS(_wrap_wrapper_GDALGrid) {
39024   {
39025     char *arg1 = (char *) 0 ;
39026     GDALDatasetShadow *arg2 = (GDALDatasetShadow *) 0 ;
39027     GDALGridOptions *arg3 = (GDALGridOptions *) 0 ;
39028     GDALProgressFunc arg4 = (GDALProgressFunc) NULL ;
39029     void *arg5 = (void *) NULL ;
39030     U8 *tmpbuf1 = NULL ;
39031     void *argp3 = 0 ;
39032     int res3 = 0 ;
39033     int argvi = 0;
39034     GDALDatasetShadow *result = 0 ;
39035     dXSARGS;
39036 
39037     /* %typemap(arginit, noblock=1) ( void* callback_data = NULL) */
39038     SavedEnv saved_env;
39039     saved_env.fct = NULL;
39040     saved_env.data = &PL_sv_undef;
39041     arg5 = (void *)(&saved_env);
39042     {
39043       /* %typemap(default) const char * utf8_path */
39044       arg1 = (char *)"";
39045     }
39046     if ((items < 0) || (items > 5)) {
39047       SWIG_croak("Usage: wrapper_GDALGrid(dest,dataset,options,callback,callback_data);");
39048     }
39049     if (items > 0) {
39050       {
39051         /* %typemap(in,numinputs=1) (const char* utf8_path) (U8 *tmpbuf1) */
39052         arg1 = sv_to_utf8_string(ST(0), &tmpbuf1);
39053       }
39054     }
39055     if (items > 1) {
39056       {
39057         /* %typemap(in) (GDALDatasetShadow *) */
39058         void *argp = 0;
39059         int res = SWIG_ConvertPtr(ST(1), &argp, SWIGTYPE_p_GDALDatasetShadow, 0 |  0 );
39060         if (!SWIG_IsOK(res)) {
39061           do_confess(WRONG_CLASS, 1);
39062         }
39063         arg2 = reinterpret_cast< GDALDatasetShadow * >(argp);
39064         if (arg2 == NULL)
39065         do_confess(NEED_DEF, 1);
39066       }
39067     }
39068     if (items > 2) {
39069       res3 = SWIG_ConvertPtr(ST(2), &argp3,SWIGTYPE_p_GDALGridOptions, 0 |  0 );
39070       if (!SWIG_IsOK(res3)) {
39071         SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "wrapper_GDALGrid" "', argument " "3"" of type '" "GDALGridOptions *""'");
39072       }
39073       arg3 = reinterpret_cast< GDALGridOptions * >(argp3);
39074     }
39075     if (items > 3) {
39076       {
39077         /* %typemap(in) (GDALProgressFunc callback = NULL) */
39078         if (SvOK(ST(3))) {
39079           if (SvROK(ST(3))) {
39080             if (SvTYPE(SvRV(ST(3))) != SVt_PVCV) {
39081               do_confess(NEED_CODE_REF, 1);
39082             } else {
39083               saved_env.fct = (SV *)ST(3);
39084               arg4 = &callback_d_cp_vp;
39085             }
39086           } else {
39087             do_confess(NEED_CODE_REF, 1);
39088           }
39089         }
39090       }
39091     }
39092     if (items > 4) {
39093       {
39094         /* %typemap(in) (void* callback_data=NULL) */
39095         if (SvOK(ST(4)))
39096         saved_env.data = (SV *)ST(4);
39097       }
39098     }
39099     {
39100       if (!arg1) {
39101         SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
39102       }
39103     }
39104     {
39105       if (!arg2) {
39106         SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
39107       }
39108     }
39109     {
39110       CPLErrorReset();
39111       result = (GDALDatasetShadow *)wrapper_GDALGrid((char const *)arg1,arg2,arg3,arg4,arg5);
39112       CPLErr eclass = CPLGetLastErrorType();
39113       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
39114         do_confess( CPLGetLastErrorMsg(), 0 );
39115 
39116 
39117 
39118 
39119 
39120       }
39121 
39122 
39123       /*
39124           Make warnings regular Perl warnings. This duplicates the warning
39125           message if DontUseExceptions() is in effect (it is not by default).
39126           */
39127       if ( eclass == CE_Warning ) {
39128         warn( CPLGetLastErrorMsg(), "%s" );
39129       }
39130 
39131 
39132     }
39133     ST(argvi) = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GDALDatasetShadow, SWIG_OWNER | SWIG_SHADOW); argvi++ ;
39134     {
39135       /* %typemap(freearg) (const char* utf8_path) */
39136       if (tmpbuf1) Safefree(tmpbuf1);
39137     }
39138 
39139 
39140 
39141     XSRETURN(argvi);
39142   fail:
39143     {
39144       /* %typemap(freearg) (const char* utf8_path) */
39145       if (tmpbuf1) Safefree(tmpbuf1);
39146     }
39147 
39148 
39149 
39150     SWIG_croak_null();
39151   }
39152 }
39153 
39154 
XS(_wrap_new_GDALRasterizeOptions)39155 XS(_wrap_new_GDALRasterizeOptions) {
39156   {
39157     char **arg1 = (char **) 0 ;
39158     int argvi = 0;
39159     GDALRasterizeOptions *result = 0 ;
39160     dXSARGS;
39161 
39162     if ((items < 1) || (items > 1)) {
39163       SWIG_croak("Usage: new_GDALRasterizeOptions(options);");
39164     }
39165     {
39166       /* %typemap(in) char **options */
39167       if (SvOK(ST(0))) {
39168         if (SvROK(ST(0))) {
39169           if (SvTYPE(SvRV(ST(0)))==SVt_PVAV) {
39170             AV *av = (AV*)(SvRV(ST(0)));
39171             for (int i = 0; i < av_len(av)+1; i++) {
39172               SV *sv = *(av_fetch(av, i, 0));
39173               bool sf;
39174               char *tmp = sv_to_utf8_string(sv, NULL, &sf);
39175               arg1 = CSLAddString(arg1, tmp);
39176               if (sf) Safefree(tmp); else free(tmp);
39177             }
39178           } else if (SvTYPE(SvRV(ST(0)))==SVt_PVHV) {
39179             HV *hv = (HV*)SvRV(ST(0));
39180             SV *sv;
39181             char *key;
39182             I32 klen;
39183             arg1 = NULL;
39184             hv_iterinit(hv);
39185             while(sv = hv_iternextsv(hv, &key, &klen)) {
39186               bool sf;
39187               char *tmp = sv_to_utf8_string(sv, NULL, &sf);
39188               arg1 = CSLAddNameValue(arg1, key, tmp);
39189               if (sf) Safefree(tmp); else free(tmp);
39190             }
39191           } else
39192           do_confess(NEED_REF, 1);
39193         } else
39194         do_confess(NEED_REF, 1);
39195       }
39196     }
39197     {
39198       CPLErrorReset();
39199       result = (GDALRasterizeOptions *)new_GDALRasterizeOptions(arg1);
39200       CPLErr eclass = CPLGetLastErrorType();
39201       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
39202         do_confess( CPLGetLastErrorMsg(), 0 );
39203 
39204 
39205 
39206 
39207 
39208       }
39209 
39210 
39211       /*
39212           Make warnings regular Perl warnings. This duplicates the warning
39213           message if DontUseExceptions() is in effect (it is not by default).
39214           */
39215       if ( eclass == CE_Warning ) {
39216         warn( CPLGetLastErrorMsg(), "%s" );
39217       }
39218 
39219 
39220     }
39221     ST(argvi) = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GDALRasterizeOptions, SWIG_OWNER | SWIG_SHADOW); argvi++ ;
39222     {
39223       /* %typemap(freearg) char **options */
39224       if (arg1) CSLDestroy( arg1 );
39225     }
39226     XSRETURN(argvi);
39227   fail:
39228     {
39229       /* %typemap(freearg) char **options */
39230       if (arg1) CSLDestroy( arg1 );
39231     }
39232     SWIG_croak_null();
39233   }
39234 }
39235 
39236 
XS(_wrap_delete_GDALRasterizeOptions)39237 XS(_wrap_delete_GDALRasterizeOptions) {
39238   {
39239     GDALRasterizeOptions *arg1 = (GDALRasterizeOptions *) 0 ;
39240     void *argp1 = 0 ;
39241     int res1 = 0 ;
39242     int argvi = 0;
39243     dXSARGS;
39244 
39245     if ((items < 1) || (items > 1)) {
39246       SWIG_croak("Usage: delete_GDALRasterizeOptions(self);");
39247     }
39248     res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_GDALRasterizeOptions, SWIG_POINTER_DISOWN |  0 );
39249     if (!SWIG_IsOK(res1)) {
39250       SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_GDALRasterizeOptions" "', argument " "1"" of type '" "GDALRasterizeOptions *""'");
39251     }
39252     arg1 = reinterpret_cast< GDALRasterizeOptions * >(argp1);
39253     {
39254       CPLErrorReset();
39255       delete_GDALRasterizeOptions(arg1);
39256       CPLErr eclass = CPLGetLastErrorType();
39257       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
39258         do_confess( CPLGetLastErrorMsg(), 0 );
39259 
39260 
39261 
39262 
39263 
39264       }
39265 
39266 
39267       /*
39268           Make warnings regular Perl warnings. This duplicates the warning
39269           message if DontUseExceptions() is in effect (it is not by default).
39270           */
39271       if ( eclass == CE_Warning ) {
39272         warn( CPLGetLastErrorMsg(), "%s" );
39273       }
39274 
39275 
39276     }
39277     {
39278       /* %typemap(out) void */
39279     }
39280 
39281     XSRETURN(argvi);
39282   fail:
39283 
39284     SWIG_croak_null();
39285   }
39286 }
39287 
39288 
XS(_wrap_wrapper_GDALRasterizeDestDS)39289 XS(_wrap_wrapper_GDALRasterizeDestDS) {
39290   {
39291     GDALDatasetShadow *arg1 = (GDALDatasetShadow *) 0 ;
39292     GDALDatasetShadow *arg2 = (GDALDatasetShadow *) 0 ;
39293     GDALRasterizeOptions *arg3 = (GDALRasterizeOptions *) 0 ;
39294     GDALProgressFunc arg4 = (GDALProgressFunc) NULL ;
39295     void *arg5 = (void *) NULL ;
39296     void *argp3 = 0 ;
39297     int res3 = 0 ;
39298     int argvi = 0;
39299     int result;
39300     dXSARGS;
39301 
39302     /* %typemap(arginit, noblock=1) ( void* callback_data = NULL) */
39303     SavedEnv saved_env;
39304     saved_env.fct = NULL;
39305     saved_env.data = &PL_sv_undef;
39306     arg5 = (void *)(&saved_env);
39307     if ((items < 3) || (items > 5)) {
39308       SWIG_croak("Usage: wrapper_GDALRasterizeDestDS(dstDS,srcDS,options,callback,callback_data);");
39309     }
39310     {
39311       /* %typemap(in) (GDALDatasetShadow *) */
39312       void *argp = 0;
39313       int res = SWIG_ConvertPtr(ST(0), &argp, SWIGTYPE_p_GDALDatasetShadow, 0 |  0 );
39314       if (!SWIG_IsOK(res)) {
39315         do_confess(WRONG_CLASS, 1);
39316       }
39317       arg1 = reinterpret_cast< GDALDatasetShadow * >(argp);
39318       if (arg1 == NULL)
39319       do_confess(NEED_DEF, 1);
39320     }
39321     {
39322       /* %typemap(in) (GDALDatasetShadow *) */
39323       void *argp = 0;
39324       int res = SWIG_ConvertPtr(ST(1), &argp, SWIGTYPE_p_GDALDatasetShadow, 0 |  0 );
39325       if (!SWIG_IsOK(res)) {
39326         do_confess(WRONG_CLASS, 1);
39327       }
39328       arg2 = reinterpret_cast< GDALDatasetShadow * >(argp);
39329       if (arg2 == NULL)
39330       do_confess(NEED_DEF, 1);
39331     }
39332     res3 = SWIG_ConvertPtr(ST(2), &argp3,SWIGTYPE_p_GDALRasterizeOptions, 0 |  0 );
39333     if (!SWIG_IsOK(res3)) {
39334       SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "wrapper_GDALRasterizeDestDS" "', argument " "3"" of type '" "GDALRasterizeOptions *""'");
39335     }
39336     arg3 = reinterpret_cast< GDALRasterizeOptions * >(argp3);
39337     if (items > 3) {
39338       {
39339         /* %typemap(in) (GDALProgressFunc callback = NULL) */
39340         if (SvOK(ST(3))) {
39341           if (SvROK(ST(3))) {
39342             if (SvTYPE(SvRV(ST(3))) != SVt_PVCV) {
39343               do_confess(NEED_CODE_REF, 1);
39344             } else {
39345               saved_env.fct = (SV *)ST(3);
39346               arg4 = &callback_d_cp_vp;
39347             }
39348           } else {
39349             do_confess(NEED_CODE_REF, 1);
39350           }
39351         }
39352       }
39353     }
39354     if (items > 4) {
39355       {
39356         /* %typemap(in) (void* callback_data=NULL) */
39357         if (SvOK(ST(4)))
39358         saved_env.data = (SV *)ST(4);
39359       }
39360     }
39361     {
39362       CPLErrorReset();
39363       result = (int)wrapper_GDALRasterizeDestDS(arg1,arg2,arg3,arg4,arg5);
39364       CPLErr eclass = CPLGetLastErrorType();
39365       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
39366         do_confess( CPLGetLastErrorMsg(), 0 );
39367 
39368 
39369 
39370 
39371 
39372       }
39373 
39374 
39375       /*
39376           Make warnings regular Perl warnings. This duplicates the warning
39377           message if DontUseExceptions() is in effect (it is not by default).
39378           */
39379       if ( eclass == CE_Warning ) {
39380         warn( CPLGetLastErrorMsg(), "%s" );
39381       }
39382 
39383 
39384     }
39385     ST(argvi) = SWIG_From_int  SWIG_PERL_CALL_ARGS_1(static_cast< int >(result)); argvi++ ;
39386 
39387 
39388 
39389 
39390     XSRETURN(argvi);
39391   fail:
39392 
39393 
39394 
39395 
39396     SWIG_croak_null();
39397   }
39398 }
39399 
39400 
XS(_wrap_wrapper_GDALRasterizeDestName)39401 XS(_wrap_wrapper_GDALRasterizeDestName) {
39402   {
39403     char *arg1 = (char *) 0 ;
39404     GDALDatasetShadow *arg2 = (GDALDatasetShadow *) 0 ;
39405     GDALRasterizeOptions *arg3 = (GDALRasterizeOptions *) 0 ;
39406     GDALProgressFunc arg4 = (GDALProgressFunc) NULL ;
39407     void *arg5 = (void *) NULL ;
39408     U8 *tmpbuf1 = NULL ;
39409     void *argp3 = 0 ;
39410     int res3 = 0 ;
39411     int argvi = 0;
39412     GDALDatasetShadow *result = 0 ;
39413     dXSARGS;
39414 
39415     /* %typemap(arginit, noblock=1) ( void* callback_data = NULL) */
39416     SavedEnv saved_env;
39417     saved_env.fct = NULL;
39418     saved_env.data = &PL_sv_undef;
39419     arg5 = (void *)(&saved_env);
39420     {
39421       /* %typemap(default) const char * utf8_path */
39422       arg1 = (char *)"";
39423     }
39424     if ((items < 0) || (items > 5)) {
39425       SWIG_croak("Usage: wrapper_GDALRasterizeDestName(dest,srcDS,options,callback,callback_data);");
39426     }
39427     if (items > 0) {
39428       {
39429         /* %typemap(in,numinputs=1) (const char* utf8_path) (U8 *tmpbuf1) */
39430         arg1 = sv_to_utf8_string(ST(0), &tmpbuf1);
39431       }
39432     }
39433     if (items > 1) {
39434       {
39435         /* %typemap(in) (GDALDatasetShadow *) */
39436         void *argp = 0;
39437         int res = SWIG_ConvertPtr(ST(1), &argp, SWIGTYPE_p_GDALDatasetShadow, 0 |  0 );
39438         if (!SWIG_IsOK(res)) {
39439           do_confess(WRONG_CLASS, 1);
39440         }
39441         arg2 = reinterpret_cast< GDALDatasetShadow * >(argp);
39442         if (arg2 == NULL)
39443         do_confess(NEED_DEF, 1);
39444       }
39445     }
39446     if (items > 2) {
39447       res3 = SWIG_ConvertPtr(ST(2), &argp3,SWIGTYPE_p_GDALRasterizeOptions, 0 |  0 );
39448       if (!SWIG_IsOK(res3)) {
39449         SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "wrapper_GDALRasterizeDestName" "', argument " "3"" of type '" "GDALRasterizeOptions *""'");
39450       }
39451       arg3 = reinterpret_cast< GDALRasterizeOptions * >(argp3);
39452     }
39453     if (items > 3) {
39454       {
39455         /* %typemap(in) (GDALProgressFunc callback = NULL) */
39456         if (SvOK(ST(3))) {
39457           if (SvROK(ST(3))) {
39458             if (SvTYPE(SvRV(ST(3))) != SVt_PVCV) {
39459               do_confess(NEED_CODE_REF, 1);
39460             } else {
39461               saved_env.fct = (SV *)ST(3);
39462               arg4 = &callback_d_cp_vp;
39463             }
39464           } else {
39465             do_confess(NEED_CODE_REF, 1);
39466           }
39467         }
39468       }
39469     }
39470     if (items > 4) {
39471       {
39472         /* %typemap(in) (void* callback_data=NULL) */
39473         if (SvOK(ST(4)))
39474         saved_env.data = (SV *)ST(4);
39475       }
39476     }
39477     {
39478       if (!arg1) {
39479         SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
39480       }
39481     }
39482     {
39483       CPLErrorReset();
39484       result = (GDALDatasetShadow *)wrapper_GDALRasterizeDestName((char const *)arg1,arg2,arg3,arg4,arg5);
39485       CPLErr eclass = CPLGetLastErrorType();
39486       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
39487         do_confess( CPLGetLastErrorMsg(), 0 );
39488 
39489 
39490 
39491 
39492 
39493       }
39494 
39495 
39496       /*
39497           Make warnings regular Perl warnings. This duplicates the warning
39498           message if DontUseExceptions() is in effect (it is not by default).
39499           */
39500       if ( eclass == CE_Warning ) {
39501         warn( CPLGetLastErrorMsg(), "%s" );
39502       }
39503 
39504 
39505     }
39506     ST(argvi) = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GDALDatasetShadow, SWIG_OWNER | SWIG_SHADOW); argvi++ ;
39507     {
39508       /* %typemap(freearg) (const char* utf8_path) */
39509       if (tmpbuf1) Safefree(tmpbuf1);
39510     }
39511 
39512 
39513 
39514     XSRETURN(argvi);
39515   fail:
39516     {
39517       /* %typemap(freearg) (const char* utf8_path) */
39518       if (tmpbuf1) Safefree(tmpbuf1);
39519     }
39520 
39521 
39522 
39523     SWIG_croak_null();
39524   }
39525 }
39526 
39527 
XS(_wrap_new_GDALBuildVRTOptions)39528 XS(_wrap_new_GDALBuildVRTOptions) {
39529   {
39530     char **arg1 = (char **) 0 ;
39531     int argvi = 0;
39532     GDALBuildVRTOptions *result = 0 ;
39533     dXSARGS;
39534 
39535     if ((items < 1) || (items > 1)) {
39536       SWIG_croak("Usage: new_GDALBuildVRTOptions(options);");
39537     }
39538     {
39539       /* %typemap(in) char **options */
39540       if (SvOK(ST(0))) {
39541         if (SvROK(ST(0))) {
39542           if (SvTYPE(SvRV(ST(0)))==SVt_PVAV) {
39543             AV *av = (AV*)(SvRV(ST(0)));
39544             for (int i = 0; i < av_len(av)+1; i++) {
39545               SV *sv = *(av_fetch(av, i, 0));
39546               bool sf;
39547               char *tmp = sv_to_utf8_string(sv, NULL, &sf);
39548               arg1 = CSLAddString(arg1, tmp);
39549               if (sf) Safefree(tmp); else free(tmp);
39550             }
39551           } else if (SvTYPE(SvRV(ST(0)))==SVt_PVHV) {
39552             HV *hv = (HV*)SvRV(ST(0));
39553             SV *sv;
39554             char *key;
39555             I32 klen;
39556             arg1 = NULL;
39557             hv_iterinit(hv);
39558             while(sv = hv_iternextsv(hv, &key, &klen)) {
39559               bool sf;
39560               char *tmp = sv_to_utf8_string(sv, NULL, &sf);
39561               arg1 = CSLAddNameValue(arg1, key, tmp);
39562               if (sf) Safefree(tmp); else free(tmp);
39563             }
39564           } else
39565           do_confess(NEED_REF, 1);
39566         } else
39567         do_confess(NEED_REF, 1);
39568       }
39569     }
39570     {
39571       CPLErrorReset();
39572       result = (GDALBuildVRTOptions *)new_GDALBuildVRTOptions(arg1);
39573       CPLErr eclass = CPLGetLastErrorType();
39574       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
39575         do_confess( CPLGetLastErrorMsg(), 0 );
39576 
39577 
39578 
39579 
39580 
39581       }
39582 
39583 
39584       /*
39585           Make warnings regular Perl warnings. This duplicates the warning
39586           message if DontUseExceptions() is in effect (it is not by default).
39587           */
39588       if ( eclass == CE_Warning ) {
39589         warn( CPLGetLastErrorMsg(), "%s" );
39590       }
39591 
39592 
39593     }
39594     ST(argvi) = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GDALBuildVRTOptions, SWIG_OWNER | SWIG_SHADOW); argvi++ ;
39595     {
39596       /* %typemap(freearg) char **options */
39597       if (arg1) CSLDestroy( arg1 );
39598     }
39599     XSRETURN(argvi);
39600   fail:
39601     {
39602       /* %typemap(freearg) char **options */
39603       if (arg1) CSLDestroy( arg1 );
39604     }
39605     SWIG_croak_null();
39606   }
39607 }
39608 
39609 
XS(_wrap_delete_GDALBuildVRTOptions)39610 XS(_wrap_delete_GDALBuildVRTOptions) {
39611   {
39612     GDALBuildVRTOptions *arg1 = (GDALBuildVRTOptions *) 0 ;
39613     void *argp1 = 0 ;
39614     int res1 = 0 ;
39615     int argvi = 0;
39616     dXSARGS;
39617 
39618     if ((items < 1) || (items > 1)) {
39619       SWIG_croak("Usage: delete_GDALBuildVRTOptions(self);");
39620     }
39621     res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_GDALBuildVRTOptions, SWIG_POINTER_DISOWN |  0 );
39622     if (!SWIG_IsOK(res1)) {
39623       SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_GDALBuildVRTOptions" "', argument " "1"" of type '" "GDALBuildVRTOptions *""'");
39624     }
39625     arg1 = reinterpret_cast< GDALBuildVRTOptions * >(argp1);
39626     {
39627       CPLErrorReset();
39628       delete_GDALBuildVRTOptions(arg1);
39629       CPLErr eclass = CPLGetLastErrorType();
39630       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
39631         do_confess( CPLGetLastErrorMsg(), 0 );
39632 
39633 
39634 
39635 
39636 
39637       }
39638 
39639 
39640       /*
39641           Make warnings regular Perl warnings. This duplicates the warning
39642           message if DontUseExceptions() is in effect (it is not by default).
39643           */
39644       if ( eclass == CE_Warning ) {
39645         warn( CPLGetLastErrorMsg(), "%s" );
39646       }
39647 
39648 
39649     }
39650     {
39651       /* %typemap(out) void */
39652     }
39653 
39654     XSRETURN(argvi);
39655   fail:
39656 
39657     SWIG_croak_null();
39658   }
39659 }
39660 
39661 
XS(_wrap_wrapper_GDALBuildVRT_objects)39662 XS(_wrap_wrapper_GDALBuildVRT_objects) {
39663   {
39664     char *arg1 = (char *) 0 ;
39665     int arg2 ;
39666     GDALDatasetShadow **arg3 = (GDALDatasetShadow **) 0 ;
39667     GDALBuildVRTOptions *arg4 = (GDALBuildVRTOptions *) 0 ;
39668     GDALProgressFunc arg5 = (GDALProgressFunc) NULL ;
39669     void *arg6 = (void *) NULL ;
39670     U8 *tmpbuf1 = NULL ;
39671     void *argp4 = 0 ;
39672     int res4 = 0 ;
39673     int argvi = 0;
39674     GDALDatasetShadow *result = 0 ;
39675     dXSARGS;
39676 
39677     /* %typemap(arginit, noblock=1) ( void* callback_data = NULL) */
39678     SavedEnv saved_env;
39679     saved_env.fct = NULL;
39680     saved_env.data = &PL_sv_undef;
39681     arg6 = (void *)(&saved_env);
39682     {
39683       /* %typemap(default) const char * utf8_path */
39684       arg1 = (char *)"";
39685     }
39686     if ((items < 0) || (items > 5)) {
39687       SWIG_croak("Usage: wrapper_GDALBuildVRT_objects(dest,object_list_count,poObjects,options,callback,callback_data);");
39688     }
39689     if (items > 0) {
39690       {
39691         /* %typemap(in,numinputs=1) (const char* utf8_path) (U8 *tmpbuf1) */
39692         arg1 = sv_to_utf8_string(ST(0), &tmpbuf1);
39693       }
39694     }
39695     if (items > 1) {
39696       {
39697         /* %typemap(in, numinputs=1) (int object_list_count, GDALDatasetShadow** poObjects) */
39698         if (!(SvROK(ST(1)) && (SvTYPE(SvRV(ST(1)))==SVt_PVAV)))
39699         do_confess(NEED_ARRAY_REF, 1);
39700         AV *av = (AV*)(SvRV(ST(1)));
39701         arg2 = av_len(av)+1;
39702         /* get the pointers from the array */
39703         arg3 = (GDALDatasetShadow **)CPLMalloc(arg2*sizeof(GDALDatasetShadow *));
39704         if (arg3) {
39705           for (int i = 0; i < arg2; i++) {
39706             SV **sv = av_fetch(av, i, 0);
39707             int ret = SWIG_ConvertPtr(*sv, &(arg3[i]), SWIGTYPE_p_GDALDatasetShadow, 0);
39708             if (!SWIG_IsOK(ret))
39709             do_confess(WRONG_ITEM_IN_ARRAY, 1);
39710           }
39711         } else
39712         do_confess(OUT_OF_MEMORY, 1);
39713       }
39714     }
39715     if (items > 2) {
39716       res4 = SWIG_ConvertPtr(ST(2), &argp4,SWIGTYPE_p_GDALBuildVRTOptions, 0 |  0 );
39717       if (!SWIG_IsOK(res4)) {
39718         SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "wrapper_GDALBuildVRT_objects" "', argument " "4"" of type '" "GDALBuildVRTOptions *""'");
39719       }
39720       arg4 = reinterpret_cast< GDALBuildVRTOptions * >(argp4);
39721     }
39722     if (items > 3) {
39723       {
39724         /* %typemap(in) (GDALProgressFunc callback = NULL) */
39725         if (SvOK(ST(3))) {
39726           if (SvROK(ST(3))) {
39727             if (SvTYPE(SvRV(ST(3))) != SVt_PVCV) {
39728               do_confess(NEED_CODE_REF, 1);
39729             } else {
39730               saved_env.fct = (SV *)ST(3);
39731               arg5 = &callback_d_cp_vp;
39732             }
39733           } else {
39734             do_confess(NEED_CODE_REF, 1);
39735           }
39736         }
39737       }
39738     }
39739     if (items > 4) {
39740       {
39741         /* %typemap(in) (void* callback_data=NULL) */
39742         if (SvOK(ST(4)))
39743         saved_env.data = (SV *)ST(4);
39744       }
39745     }
39746     {
39747       if (!arg1) {
39748         SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
39749       }
39750     }
39751     {
39752       CPLErrorReset();
39753       result = (GDALDatasetShadow *)wrapper_GDALBuildVRT_objects((char const *)arg1,arg2,arg3,arg4,arg5,arg6);
39754       CPLErr eclass = CPLGetLastErrorType();
39755       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
39756         do_confess( CPLGetLastErrorMsg(), 0 );
39757 
39758 
39759 
39760 
39761 
39762       }
39763 
39764 
39765       /*
39766           Make warnings regular Perl warnings. This duplicates the warning
39767           message if DontUseExceptions() is in effect (it is not by default).
39768           */
39769       if ( eclass == CE_Warning ) {
39770         warn( CPLGetLastErrorMsg(), "%s" );
39771       }
39772 
39773 
39774     }
39775     ST(argvi) = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GDALDatasetShadow, SWIG_OWNER | SWIG_SHADOW); argvi++ ;
39776     {
39777       /* %typemap(freearg) (const char* utf8_path) */
39778       if (tmpbuf1) Safefree(tmpbuf1);
39779     }
39780 
39781 
39782     XSRETURN(argvi);
39783   fail:
39784     {
39785       /* %typemap(freearg) (const char* utf8_path) */
39786       if (tmpbuf1) Safefree(tmpbuf1);
39787     }
39788 
39789 
39790     SWIG_croak_null();
39791   }
39792 }
39793 
39794 
XS(_wrap_wrapper_GDALBuildVRT_names)39795 XS(_wrap_wrapper_GDALBuildVRT_names) {
39796   {
39797     char *arg1 = (char *) 0 ;
39798     char **arg2 = (char **) 0 ;
39799     GDALBuildVRTOptions *arg3 = (GDALBuildVRTOptions *) 0 ;
39800     GDALProgressFunc arg4 = (GDALProgressFunc) NULL ;
39801     void *arg5 = (void *) NULL ;
39802     U8 *tmpbuf1 = NULL ;
39803     void *argp3 = 0 ;
39804     int res3 = 0 ;
39805     int argvi = 0;
39806     GDALDatasetShadow *result = 0 ;
39807     dXSARGS;
39808 
39809     /* %typemap(arginit, noblock=1) ( void* callback_data = NULL) */
39810     SavedEnv saved_env;
39811     saved_env.fct = NULL;
39812     saved_env.data = &PL_sv_undef;
39813     arg5 = (void *)(&saved_env);
39814     {
39815       /* %typemap(default) const char * utf8_path */
39816       arg1 = (char *)"";
39817     }
39818     if ((items < 0) || (items > 5)) {
39819       SWIG_croak("Usage: wrapper_GDALBuildVRT_names(dest,source_filenames,options,callback,callback_data);");
39820     }
39821     if (items > 0) {
39822       {
39823         /* %typemap(in,numinputs=1) (const char* utf8_path) (U8 *tmpbuf1) */
39824         arg1 = sv_to_utf8_string(ST(0), &tmpbuf1);
39825       }
39826     }
39827     if (items > 1) {
39828       {
39829         /* %typemap(in) char **options */
39830         if (SvOK(ST(1))) {
39831           if (SvROK(ST(1))) {
39832             if (SvTYPE(SvRV(ST(1)))==SVt_PVAV) {
39833               AV *av = (AV*)(SvRV(ST(1)));
39834               for (int i = 0; i < av_len(av)+1; i++) {
39835                 SV *sv = *(av_fetch(av, i, 0));
39836                 bool sf;
39837                 char *tmp = sv_to_utf8_string(sv, NULL, &sf);
39838                 arg2 = CSLAddString(arg2, tmp);
39839                 if (sf) Safefree(tmp); else free(tmp);
39840               }
39841             } else if (SvTYPE(SvRV(ST(1)))==SVt_PVHV) {
39842               HV *hv = (HV*)SvRV(ST(1));
39843               SV *sv;
39844               char *key;
39845               I32 klen;
39846               arg2 = NULL;
39847               hv_iterinit(hv);
39848               while(sv = hv_iternextsv(hv, &key, &klen)) {
39849                 bool sf;
39850                 char *tmp = sv_to_utf8_string(sv, NULL, &sf);
39851                 arg2 = CSLAddNameValue(arg2, key, tmp);
39852                 if (sf) Safefree(tmp); else free(tmp);
39853               }
39854             } else
39855             do_confess(NEED_REF, 1);
39856           } else
39857           do_confess(NEED_REF, 1);
39858         }
39859       }
39860     }
39861     if (items > 2) {
39862       res3 = SWIG_ConvertPtr(ST(2), &argp3,SWIGTYPE_p_GDALBuildVRTOptions, 0 |  0 );
39863       if (!SWIG_IsOK(res3)) {
39864         SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "wrapper_GDALBuildVRT_names" "', argument " "3"" of type '" "GDALBuildVRTOptions *""'");
39865       }
39866       arg3 = reinterpret_cast< GDALBuildVRTOptions * >(argp3);
39867     }
39868     if (items > 3) {
39869       {
39870         /* %typemap(in) (GDALProgressFunc callback = NULL) */
39871         if (SvOK(ST(3))) {
39872           if (SvROK(ST(3))) {
39873             if (SvTYPE(SvRV(ST(3))) != SVt_PVCV) {
39874               do_confess(NEED_CODE_REF, 1);
39875             } else {
39876               saved_env.fct = (SV *)ST(3);
39877               arg4 = &callback_d_cp_vp;
39878             }
39879           } else {
39880             do_confess(NEED_CODE_REF, 1);
39881           }
39882         }
39883       }
39884     }
39885     if (items > 4) {
39886       {
39887         /* %typemap(in) (void* callback_data=NULL) */
39888         if (SvOK(ST(4)))
39889         saved_env.data = (SV *)ST(4);
39890       }
39891     }
39892     {
39893       if (!arg1) {
39894         SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
39895       }
39896     }
39897     {
39898       CPLErrorReset();
39899       result = (GDALDatasetShadow *)wrapper_GDALBuildVRT_names((char const *)arg1,arg2,arg3,arg4,arg5);
39900       CPLErr eclass = CPLGetLastErrorType();
39901       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
39902         do_confess( CPLGetLastErrorMsg(), 0 );
39903 
39904 
39905 
39906 
39907 
39908       }
39909 
39910 
39911       /*
39912           Make warnings regular Perl warnings. This duplicates the warning
39913           message if DontUseExceptions() is in effect (it is not by default).
39914           */
39915       if ( eclass == CE_Warning ) {
39916         warn( CPLGetLastErrorMsg(), "%s" );
39917       }
39918 
39919 
39920     }
39921     ST(argvi) = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GDALDatasetShadow, SWIG_OWNER | SWIG_SHADOW); argvi++ ;
39922     {
39923       /* %typemap(freearg) (const char* utf8_path) */
39924       if (tmpbuf1) Safefree(tmpbuf1);
39925     }
39926     {
39927       /* %typemap(freearg) char **options */
39928       if (arg2) CSLDestroy( arg2 );
39929     }
39930 
39931 
39932     XSRETURN(argvi);
39933   fail:
39934     {
39935       /* %typemap(freearg) (const char* utf8_path) */
39936       if (tmpbuf1) Safefree(tmpbuf1);
39937     }
39938     {
39939       /* %typemap(freearg) char **options */
39940       if (arg2) CSLDestroy( arg2 );
39941     }
39942 
39943 
39944     SWIG_croak_null();
39945   }
39946 }
39947 
39948 
XS(_wrap_new_GDALMultiDimTranslateOptions)39949 XS(_wrap_new_GDALMultiDimTranslateOptions) {
39950   {
39951     char **arg1 = (char **) 0 ;
39952     int argvi = 0;
39953     GDALMultiDimTranslateOptions *result = 0 ;
39954     dXSARGS;
39955 
39956     if ((items < 1) || (items > 1)) {
39957       SWIG_croak("Usage: new_GDALMultiDimTranslateOptions(options);");
39958     }
39959     {
39960       /* %typemap(in) char **options */
39961       if (SvOK(ST(0))) {
39962         if (SvROK(ST(0))) {
39963           if (SvTYPE(SvRV(ST(0)))==SVt_PVAV) {
39964             AV *av = (AV*)(SvRV(ST(0)));
39965             for (int i = 0; i < av_len(av)+1; i++) {
39966               SV *sv = *(av_fetch(av, i, 0));
39967               bool sf;
39968               char *tmp = sv_to_utf8_string(sv, NULL, &sf);
39969               arg1 = CSLAddString(arg1, tmp);
39970               if (sf) Safefree(tmp); else free(tmp);
39971             }
39972           } else if (SvTYPE(SvRV(ST(0)))==SVt_PVHV) {
39973             HV *hv = (HV*)SvRV(ST(0));
39974             SV *sv;
39975             char *key;
39976             I32 klen;
39977             arg1 = NULL;
39978             hv_iterinit(hv);
39979             while(sv = hv_iternextsv(hv, &key, &klen)) {
39980               bool sf;
39981               char *tmp = sv_to_utf8_string(sv, NULL, &sf);
39982               arg1 = CSLAddNameValue(arg1, key, tmp);
39983               if (sf) Safefree(tmp); else free(tmp);
39984             }
39985           } else
39986           do_confess(NEED_REF, 1);
39987         } else
39988         do_confess(NEED_REF, 1);
39989       }
39990     }
39991     {
39992       CPLErrorReset();
39993       result = (GDALMultiDimTranslateOptions *)new_GDALMultiDimTranslateOptions(arg1);
39994       CPLErr eclass = CPLGetLastErrorType();
39995       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
39996         do_confess( CPLGetLastErrorMsg(), 0 );
39997 
39998 
39999 
40000 
40001 
40002       }
40003 
40004 
40005       /*
40006           Make warnings regular Perl warnings. This duplicates the warning
40007           message if DontUseExceptions() is in effect (it is not by default).
40008           */
40009       if ( eclass == CE_Warning ) {
40010         warn( CPLGetLastErrorMsg(), "%s" );
40011       }
40012 
40013 
40014     }
40015     ST(argvi) = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GDALMultiDimTranslateOptions, SWIG_OWNER | SWIG_SHADOW); argvi++ ;
40016     {
40017       /* %typemap(freearg) char **options */
40018       if (arg1) CSLDestroy( arg1 );
40019     }
40020     XSRETURN(argvi);
40021   fail:
40022     {
40023       /* %typemap(freearg) char **options */
40024       if (arg1) CSLDestroy( arg1 );
40025     }
40026     SWIG_croak_null();
40027   }
40028 }
40029 
40030 
XS(_wrap_delete_GDALMultiDimTranslateOptions)40031 XS(_wrap_delete_GDALMultiDimTranslateOptions) {
40032   {
40033     GDALMultiDimTranslateOptions *arg1 = (GDALMultiDimTranslateOptions *) 0 ;
40034     void *argp1 = 0 ;
40035     int res1 = 0 ;
40036     int argvi = 0;
40037     dXSARGS;
40038 
40039     if ((items < 1) || (items > 1)) {
40040       SWIG_croak("Usage: delete_GDALMultiDimTranslateOptions(self);");
40041     }
40042     res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_GDALMultiDimTranslateOptions, SWIG_POINTER_DISOWN |  0 );
40043     if (!SWIG_IsOK(res1)) {
40044       SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_GDALMultiDimTranslateOptions" "', argument " "1"" of type '" "GDALMultiDimTranslateOptions *""'");
40045     }
40046     arg1 = reinterpret_cast< GDALMultiDimTranslateOptions * >(argp1);
40047     {
40048       CPLErrorReset();
40049       delete_GDALMultiDimTranslateOptions(arg1);
40050       CPLErr eclass = CPLGetLastErrorType();
40051       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
40052         do_confess( CPLGetLastErrorMsg(), 0 );
40053 
40054 
40055 
40056 
40057 
40058       }
40059 
40060 
40061       /*
40062           Make warnings regular Perl warnings. This duplicates the warning
40063           message if DontUseExceptions() is in effect (it is not by default).
40064           */
40065       if ( eclass == CE_Warning ) {
40066         warn( CPLGetLastErrorMsg(), "%s" );
40067       }
40068 
40069 
40070     }
40071     {
40072       /* %typemap(out) void */
40073     }
40074 
40075     XSRETURN(argvi);
40076   fail:
40077 
40078     SWIG_croak_null();
40079   }
40080 }
40081 
40082 
XS(_wrap_wrapper_GDALMultiDimTranslateDestName)40083 XS(_wrap_wrapper_GDALMultiDimTranslateDestName) {
40084   {
40085     char *arg1 = (char *) 0 ;
40086     int arg2 ;
40087     GDALDatasetShadow **arg3 = (GDALDatasetShadow **) 0 ;
40088     GDALMultiDimTranslateOptions *arg4 = (GDALMultiDimTranslateOptions *) 0 ;
40089     GDALProgressFunc arg5 = (GDALProgressFunc) NULL ;
40090     void *arg6 = (void *) NULL ;
40091     U8 *tmpbuf1 = NULL ;
40092     void *argp4 = 0 ;
40093     int res4 = 0 ;
40094     int argvi = 0;
40095     GDALDatasetShadow *result = 0 ;
40096     dXSARGS;
40097 
40098     /* %typemap(arginit, noblock=1) ( void* callback_data = NULL) */
40099     SavedEnv saved_env;
40100     saved_env.fct = NULL;
40101     saved_env.data = &PL_sv_undef;
40102     arg6 = (void *)(&saved_env);
40103     {
40104       /* %typemap(default) const char * utf8_path */
40105       arg1 = (char *)"";
40106     }
40107     if ((items < 0) || (items > 5)) {
40108       SWIG_croak("Usage: wrapper_GDALMultiDimTranslateDestName(dest,object_list_count,poObjects,multiDimTranslateOptions,callback,callback_data);");
40109     }
40110     if (items > 0) {
40111       {
40112         /* %typemap(in,numinputs=1) (const char* utf8_path) (U8 *tmpbuf1) */
40113         arg1 = sv_to_utf8_string(ST(0), &tmpbuf1);
40114       }
40115     }
40116     if (items > 1) {
40117       {
40118         /* %typemap(in, numinputs=1) (int object_list_count, GDALDatasetShadow** poObjects) */
40119         if (!(SvROK(ST(1)) && (SvTYPE(SvRV(ST(1)))==SVt_PVAV)))
40120         do_confess(NEED_ARRAY_REF, 1);
40121         AV *av = (AV*)(SvRV(ST(1)));
40122         arg2 = av_len(av)+1;
40123         /* get the pointers from the array */
40124         arg3 = (GDALDatasetShadow **)CPLMalloc(arg2*sizeof(GDALDatasetShadow *));
40125         if (arg3) {
40126           for (int i = 0; i < arg2; i++) {
40127             SV **sv = av_fetch(av, i, 0);
40128             int ret = SWIG_ConvertPtr(*sv, &(arg3[i]), SWIGTYPE_p_GDALDatasetShadow, 0);
40129             if (!SWIG_IsOK(ret))
40130             do_confess(WRONG_ITEM_IN_ARRAY, 1);
40131           }
40132         } else
40133         do_confess(OUT_OF_MEMORY, 1);
40134       }
40135     }
40136     if (items > 2) {
40137       res4 = SWIG_ConvertPtr(ST(2), &argp4,SWIGTYPE_p_GDALMultiDimTranslateOptions, 0 |  0 );
40138       if (!SWIG_IsOK(res4)) {
40139         SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "wrapper_GDALMultiDimTranslateDestName" "', argument " "4"" of type '" "GDALMultiDimTranslateOptions *""'");
40140       }
40141       arg4 = reinterpret_cast< GDALMultiDimTranslateOptions * >(argp4);
40142     }
40143     if (items > 3) {
40144       {
40145         /* %typemap(in) (GDALProgressFunc callback = NULL) */
40146         if (SvOK(ST(3))) {
40147           if (SvROK(ST(3))) {
40148             if (SvTYPE(SvRV(ST(3))) != SVt_PVCV) {
40149               do_confess(NEED_CODE_REF, 1);
40150             } else {
40151               saved_env.fct = (SV *)ST(3);
40152               arg5 = &callback_d_cp_vp;
40153             }
40154           } else {
40155             do_confess(NEED_CODE_REF, 1);
40156           }
40157         }
40158       }
40159     }
40160     if (items > 4) {
40161       {
40162         /* %typemap(in) (void* callback_data=NULL) */
40163         if (SvOK(ST(4)))
40164         saved_env.data = (SV *)ST(4);
40165       }
40166     }
40167     {
40168       if (!arg1) {
40169         SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
40170       }
40171     }
40172     {
40173       CPLErrorReset();
40174       result = (GDALDatasetShadow *)wrapper_GDALMultiDimTranslateDestName((char const *)arg1,arg2,arg3,arg4,arg5,arg6);
40175       CPLErr eclass = CPLGetLastErrorType();
40176       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
40177         do_confess( CPLGetLastErrorMsg(), 0 );
40178 
40179 
40180 
40181 
40182 
40183       }
40184 
40185 
40186       /*
40187           Make warnings regular Perl warnings. This duplicates the warning
40188           message if DontUseExceptions() is in effect (it is not by default).
40189           */
40190       if ( eclass == CE_Warning ) {
40191         warn( CPLGetLastErrorMsg(), "%s" );
40192       }
40193 
40194 
40195     }
40196     ST(argvi) = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GDALDatasetShadow, SWIG_OWNER | SWIG_SHADOW); argvi++ ;
40197     {
40198       /* %typemap(freearg) (const char* utf8_path) */
40199       if (tmpbuf1) Safefree(tmpbuf1);
40200     }
40201 
40202 
40203     XSRETURN(argvi);
40204   fail:
40205     {
40206       /* %typemap(freearg) (const char* utf8_path) */
40207       if (tmpbuf1) Safefree(tmpbuf1);
40208     }
40209 
40210 
40211     SWIG_croak_null();
40212   }
40213 }
40214 
40215 
40216 
40217 /* -------- TYPE CONVERSION AND EQUIVALENCE RULES (BEGIN) -------- */
40218 
_p_GDALDriverShadowTo_p_GDALMajorObjectShadow(void * x,int * SWIGUNUSEDPARM (newmemory))40219 static void *_p_GDALDriverShadowTo_p_GDALMajorObjectShadow(void *x, int *SWIGUNUSEDPARM(newmemory)) {
40220     return (void *)((GDALMajorObjectShadow *)  ((GDALDriverShadow *) x));
40221 }
_p_OGRLayerShadowTo_p_GDALMajorObjectShadow(void * x,int * SWIGUNUSEDPARM (newmemory))40222 static void *_p_OGRLayerShadowTo_p_GDALMajorObjectShadow(void *x, int *SWIGUNUSEDPARM(newmemory)) {
40223     return (void *)((GDALMajorObjectShadow *)  ((OGRLayerShadow *) x));
40224 }
_p_GDALDatasetShadowTo_p_GDALMajorObjectShadow(void * x,int * SWIGUNUSEDPARM (newmemory))40225 static void *_p_GDALDatasetShadowTo_p_GDALMajorObjectShadow(void *x, int *SWIGUNUSEDPARM(newmemory)) {
40226     return (void *)((GDALMajorObjectShadow *)  ((GDALDatasetShadow *) x));
40227 }
_p_GDALRasterBandShadowTo_p_GDALMajorObjectShadow(void * x,int * SWIGUNUSEDPARM (newmemory))40228 static void *_p_GDALRasterBandShadowTo_p_GDALMajorObjectShadow(void *x, int *SWIGUNUSEDPARM(newmemory)) {
40229     return (void *)((GDALMajorObjectShadow *)  ((GDALRasterBandShadow *) x));
40230 }
40231 static swig_type_info _swigt__p_CPLErrorHandler = {"_p_CPLErrorHandler", "CPLErrorHandler *", 0, 0, (void*)0, 0};
40232 static swig_type_info _swigt__p_CPLXMLNode = {"_p_CPLXMLNode", "CPLXMLNode *", 0, 0, (void*)0, 0};
40233 static swig_type_info _swigt__p_FILE = {"_p_FILE", "FILE *", 0, 0, (void*)0, 0};
40234 static swig_type_info _swigt__p_GByte = {"_p_GByte", "GByte *", 0, 0, (void*)0, 0};
40235 static swig_type_info _swigt__p_GDALAsyncReaderShadow = {"_p_GDALAsyncReaderShadow", "GDALAsyncReaderShadow *", 0, 0, (void*)"Geo::GDAL::AsyncReader", 0};
40236 static swig_type_info _swigt__p_GDALAttributeHS = {"_p_GDALAttributeHS", "GDALAttributeHS *", 0, 0, (void*)"Geo::GDAL::Attribute", 0};
40237 static swig_type_info _swigt__p_GDALBuildVRTOptions = {"_p_GDALBuildVRTOptions", "GDALBuildVRTOptions *", 0, 0, (void*)"Geo::GDAL::GDALBuildVRTOptions", 0};
40238 static swig_type_info _swigt__p_GDALColorEntry = {"_p_GDALColorEntry", "GDALColorEntry *", 0, 0, (void*)0, 0};
40239 static swig_type_info _swigt__p_GDALColorTableShadow = {"_p_GDALColorTableShadow", "GDALColorTableShadow *", 0, 0, (void*)"Geo::GDAL::ColorTable", 0};
40240 static swig_type_info _swigt__p_GDALDEMProcessingOptions = {"_p_GDALDEMProcessingOptions", "GDALDEMProcessingOptions *", 0, 0, (void*)"Geo::GDAL::GDALDEMProcessingOptions", 0};
40241 static swig_type_info _swigt__p_GDALDatasetShadow = {"_p_GDALDatasetShadow", "GDALDatasetShadow *", 0, 0, (void*)"Geo::GDAL::Dataset", 0};
40242 static swig_type_info _swigt__p_GDALDimensionHS = {"_p_GDALDimensionHS", "GDALDimensionHS *", 0, 0, (void*)"Geo::GDAL::Dimension", 0};
40243 static swig_type_info _swigt__p_GDALDriverShadow = {"_p_GDALDriverShadow", "GDALDriverShadow *", 0, 0, (void*)"Geo::GDAL::Driver", 0};
40244 static swig_type_info _swigt__p_GDALEDTComponentHS = {"_p_GDALEDTComponentHS", "GDALEDTComponentHS *", 0, 0, (void*)"Geo::GDAL::EDTComponent", 0};
40245 static swig_type_info _swigt__p_GDALExtendedDataTypeClass = {"_p_GDALExtendedDataTypeClass", "enum GDALExtendedDataTypeClass *|GDALExtendedDataTypeClass *", 0, 0, (void*)0, 0};
40246 static swig_type_info _swigt__p_GDALExtendedDataTypeHS = {"_p_GDALExtendedDataTypeHS", "GDALExtendedDataTypeHS *", 0, 0, (void*)"Geo::GDAL::ExtendedDataType", 0};
40247 static swig_type_info _swigt__p_GDALGridOptions = {"_p_GDALGridOptions", "GDALGridOptions *", 0, 0, (void*)"Geo::GDAL::GDALGridOptions", 0};
40248 static swig_type_info _swigt__p_GDALGroupHS = {"_p_GDALGroupHS", "GDALGroupHS *", 0, 0, (void*)"Geo::GDAL::Group", 0};
40249 static swig_type_info _swigt__p_GDALInfoOptions = {"_p_GDALInfoOptions", "GDALInfoOptions *", 0, 0, (void*)"Geo::GDAL::GDALInfoOptions", 0};
40250 static swig_type_info _swigt__p_GDALMDArrayHS = {"_p_GDALMDArrayHS", "GDALMDArrayHS *", 0, 0, (void*)"Geo::GDAL::MDArray", 0};
40251 static swig_type_info _swigt__p_GDALMajorObjectShadow = {"_p_GDALMajorObjectShadow", "GDALMajorObjectShadow *", 0, 0, (void*)"Geo::GDAL::MajorObject", 0};
40252 static swig_type_info _swigt__p_GDALMultiDimInfoOptions = {"_p_GDALMultiDimInfoOptions", "GDALMultiDimInfoOptions *", 0, 0, (void*)"Geo::GDAL::GDALMultiDimInfoOptions", 0};
40253 static swig_type_info _swigt__p_GDALMultiDimTranslateOptions = {"_p_GDALMultiDimTranslateOptions", "GDALMultiDimTranslateOptions *", 0, 0, (void*)"Geo::GDAL::GDALMultiDimTranslateOptions", 0};
40254 static swig_type_info _swigt__p_GDALNearblackOptions = {"_p_GDALNearblackOptions", "GDALNearblackOptions *", 0, 0, (void*)"Geo::GDAL::GDALNearblackOptions", 0};
40255 static swig_type_info _swigt__p_GDALProgressFunc = {"_p_GDALProgressFunc", "GDALProgressFunc *", 0, 0, (void*)0, 0};
40256 static swig_type_info _swigt__p_GDALRasterAttributeTableShadow = {"_p_GDALRasterAttributeTableShadow", "GDALRasterAttributeTableShadow *", 0, 0, (void*)"Geo::GDAL::RasterAttributeTable", 0};
40257 static swig_type_info _swigt__p_GDALRasterBandShadow = {"_p_GDALRasterBandShadow", "GDALRasterBandShadow *", 0, 0, (void*)"Geo::GDAL::Band", 0};
40258 static swig_type_info _swigt__p_GDALRasterizeOptions = {"_p_GDALRasterizeOptions", "GDALRasterizeOptions *", 0, 0, (void*)"Geo::GDAL::GDALRasterizeOptions", 0};
40259 static swig_type_info _swigt__p_GDALTransformerInfoShadow = {"_p_GDALTransformerInfoShadow", "GDALTransformerInfoShadow *", 0, 0, (void*)"Geo::GDAL::Transformer", 0};
40260 static swig_type_info _swigt__p_GDALTranslateOptions = {"_p_GDALTranslateOptions", "GDALTranslateOptions *", 0, 0, (void*)"Geo::GDAL::GDALTranslateOptions", 0};
40261 static swig_type_info _swigt__p_GDALVectorTranslateOptions = {"_p_GDALVectorTranslateOptions", "GDALVectorTranslateOptions *", 0, 0, (void*)"Geo::GDAL::GDALVectorTranslateOptions", 0};
40262 static swig_type_info _swigt__p_GDALViewshedMode = {"_p_GDALViewshedMode", "enum GDALViewshedMode *|GDALViewshedMode *", 0, 0, (void*)0, 0};
40263 static swig_type_info _swigt__p_GDALViewshedOutputType = {"_p_GDALViewshedOutputType", "enum GDALViewshedOutputType *|GDALViewshedOutputType *", 0, 0, (void*)0, 0};
40264 static swig_type_info _swigt__p_GDALWarpAppOptions = {"_p_GDALWarpAppOptions", "GDALWarpAppOptions *", 0, 0, (void*)"Geo::GDAL::GDALWarpAppOptions", 0};
40265 static swig_type_info _swigt__p_GDAL_GCP = {"_p_GDAL_GCP", "GDAL_GCP *", 0, 0, (void*)"Geo::GDAL::GCP", 0};
40266 static swig_type_info _swigt__p_GIntBig = {"_p_GIntBig", "GIntBig *", 0, 0, (void*)0, 0};
40267 static swig_type_info _swigt__p_GUIntBig = {"_p_GUIntBig", "GUIntBig *", 0, 0, (void*)0, 0};
40268 static swig_type_info _swigt__p_OGRFeatureShadow = {"_p_OGRFeatureShadow", "OGRFeatureShadow *", 0, 0, (void*)"Geo::OGR::Feature", 0};
40269 static swig_type_info _swigt__p_OGRFieldDomainShadow = {"_p_OGRFieldDomainShadow", "OGRFieldDomainShadow *", 0, 0, (void*)"Geo::OGR::FieldDomain", 0};
40270 static swig_type_info _swigt__p_OGRGeometryShadow = {"_p_OGRGeometryShadow", "OGRGeometryShadow *", 0, 0, (void*)"Geo::OGR::Geometry", 0};
40271 static swig_type_info _swigt__p_OGRLayerShadow = {"_p_OGRLayerShadow", "OGRLayerShadow *", 0, 0, (void*)"Geo::OGR::Layer", 0};
40272 static swig_type_info _swigt__p_OGRStyleTableShadow = {"_p_OGRStyleTableShadow", "OGRStyleTableShadow *", 0, 0, (void*)"Geo::OGR::StyleTable", 0};
40273 static swig_type_info _swigt__p_OSRSpatialReferenceShadow = {"_p_OSRSpatialReferenceShadow", "OSRSpatialReferenceShadow *", 0, 0, (void*)"Geo::OSR::SpatialReference", 0};
40274 static swig_type_info _swigt__p_Statistics = {"_p_Statistics", "Statistics *", 0, 0, (void*)"Geo::GDAL::Statistics", 0};
40275 static swig_type_info _swigt__p_VSILFILE = {"_p_VSILFILE", "VSILFILE *", 0, 0, (void*)"Geo::GDAL::VSILFILE", 0};
40276 static swig_type_info _swigt__p_VSIStatBufL = {"_p_VSIStatBufL", "VSIStatBufL *", 0, 0, (void*)0, 0};
40277 static swig_type_info _swigt__p_VSIWriteFunction = {"_p_VSIWriteFunction", "VSIWriteFunction *", 0, 0, (void*)0, 0};
40278 static swig_type_info _swigt__p_char = {"_p_char", "char *|retStringAndCPLFree *", 0, 0, (void*)0, 0};
40279 static swig_type_info _swigt__p_double = {"_p_double", "double *", 0, 0, (void*)0, 0};
40280 static swig_type_info _swigt__p_f_double_p_q_const__char_p_void__int = {"_p_f_double_p_q_const__char_p_void__int", "int (*)(double,char const *,void *)", 0, 0, (void*)0, 0};
40281 static swig_type_info _swigt__p_int = {"_p_int", "OGRFieldSubType *|OGRFieldDomainType *|GDALRATFieldType *|OGRFieldType *|RETURN_NONE *|int *|GDALAccess *|OSRAxisMappingStrategy *|OGRwkbByteOrder *|CPLErr *|GDALRWFlag *|OGRJustification *|GDALRATFieldUsage *|GDALTileOrganization *|OGRAxisOrientation *|GDALPaletteInterp *|GDALColorInterp *|GDALRIOResampleAlg *|GDALResampleAlg *|OGRErr *|OGRwkbGeometryType *|GDALDataType *|GDALAsyncStatusType *|GDALRATTableType *|OGRFieldDomainMergePolicy *|OGRFieldDomainSplitPolicy *", 0, 0, (void*)0, 0};
40282 static swig_type_info _swigt__p_p_GDALDatasetShadow = {"_p_p_GDALDatasetShadow", "GDALDatasetShadow **", 0, 0, (void*)0, 0};
40283 static swig_type_info _swigt__p_p_GDALRasterBandShadow = {"_p_p_GDALRasterBandShadow", "GDALRasterBandShadow **", 0, 0, (void*)0, 0};
40284 static swig_type_info _swigt__p_p_GDAL_GCP = {"_p_p_GDAL_GCP", "GDAL_GCP **", 0, 0, (void*)0, 0};
40285 static swig_type_info _swigt__p_p_GUIntBig = {"_p_p_GUIntBig", "GUIntBig **", 0, 0, (void*)0, 0};
40286 static swig_type_info _swigt__p_p_char = {"_p_p_char", "char **", 0, 0, (void*)0, 0};
40287 
40288 static swig_type_info *swig_type_initial[] = {
40289   &_swigt__p_CPLErrorHandler,
40290   &_swigt__p_CPLXMLNode,
40291   &_swigt__p_FILE,
40292   &_swigt__p_GByte,
40293   &_swigt__p_GDALAsyncReaderShadow,
40294   &_swigt__p_GDALAttributeHS,
40295   &_swigt__p_GDALBuildVRTOptions,
40296   &_swigt__p_GDALColorEntry,
40297   &_swigt__p_GDALColorTableShadow,
40298   &_swigt__p_GDALDEMProcessingOptions,
40299   &_swigt__p_GDALDatasetShadow,
40300   &_swigt__p_GDALDimensionHS,
40301   &_swigt__p_GDALDriverShadow,
40302   &_swigt__p_GDALEDTComponentHS,
40303   &_swigt__p_GDALExtendedDataTypeClass,
40304   &_swigt__p_GDALExtendedDataTypeHS,
40305   &_swigt__p_GDALGridOptions,
40306   &_swigt__p_GDALGroupHS,
40307   &_swigt__p_GDALInfoOptions,
40308   &_swigt__p_GDALMDArrayHS,
40309   &_swigt__p_GDALMajorObjectShadow,
40310   &_swigt__p_GDALMultiDimInfoOptions,
40311   &_swigt__p_GDALMultiDimTranslateOptions,
40312   &_swigt__p_GDALNearblackOptions,
40313   &_swigt__p_GDALProgressFunc,
40314   &_swigt__p_GDALRasterAttributeTableShadow,
40315   &_swigt__p_GDALRasterBandShadow,
40316   &_swigt__p_GDALRasterizeOptions,
40317   &_swigt__p_GDALTransformerInfoShadow,
40318   &_swigt__p_GDALTranslateOptions,
40319   &_swigt__p_GDALVectorTranslateOptions,
40320   &_swigt__p_GDALViewshedMode,
40321   &_swigt__p_GDALViewshedOutputType,
40322   &_swigt__p_GDALWarpAppOptions,
40323   &_swigt__p_GDAL_GCP,
40324   &_swigt__p_GIntBig,
40325   &_swigt__p_GUIntBig,
40326   &_swigt__p_OGRFeatureShadow,
40327   &_swigt__p_OGRFieldDomainShadow,
40328   &_swigt__p_OGRGeometryShadow,
40329   &_swigt__p_OGRLayerShadow,
40330   &_swigt__p_OGRStyleTableShadow,
40331   &_swigt__p_OSRSpatialReferenceShadow,
40332   &_swigt__p_Statistics,
40333   &_swigt__p_VSILFILE,
40334   &_swigt__p_VSIStatBufL,
40335   &_swigt__p_VSIWriteFunction,
40336   &_swigt__p_char,
40337   &_swigt__p_double,
40338   &_swigt__p_f_double_p_q_const__char_p_void__int,
40339   &_swigt__p_int,
40340   &_swigt__p_p_GDALDatasetShadow,
40341   &_swigt__p_p_GDALRasterBandShadow,
40342   &_swigt__p_p_GDAL_GCP,
40343   &_swigt__p_p_GUIntBig,
40344   &_swigt__p_p_char,
40345 };
40346 
40347 static swig_cast_info _swigc__p_CPLErrorHandler[] = {  {&_swigt__p_CPLErrorHandler, 0, 0, 0},{0, 0, 0, 0}};
40348 static swig_cast_info _swigc__p_CPLXMLNode[] = {  {&_swigt__p_CPLXMLNode, 0, 0, 0},{0, 0, 0, 0}};
40349 static swig_cast_info _swigc__p_FILE[] = {  {&_swigt__p_FILE, 0, 0, 0},{0, 0, 0, 0}};
40350 static swig_cast_info _swigc__p_GByte[] = {  {&_swigt__p_GByte, 0, 0, 0},{0, 0, 0, 0}};
40351 static swig_cast_info _swigc__p_GDALAsyncReaderShadow[] = {  {&_swigt__p_GDALAsyncReaderShadow, 0, 0, 0},{0, 0, 0, 0}};
40352 static swig_cast_info _swigc__p_GDALAttributeHS[] = {  {&_swigt__p_GDALAttributeHS, 0, 0, 0},{0, 0, 0, 0}};
40353 static swig_cast_info _swigc__p_GDALBuildVRTOptions[] = {  {&_swigt__p_GDALBuildVRTOptions, 0, 0, 0},{0, 0, 0, 0}};
40354 static swig_cast_info _swigc__p_GDALColorEntry[] = {  {&_swigt__p_GDALColorEntry, 0, 0, 0},{0, 0, 0, 0}};
40355 static swig_cast_info _swigc__p_GDALColorTableShadow[] = {  {&_swigt__p_GDALColorTableShadow, 0, 0, 0},{0, 0, 0, 0}};
40356 static swig_cast_info _swigc__p_GDALDEMProcessingOptions[] = {  {&_swigt__p_GDALDEMProcessingOptions, 0, 0, 0},{0, 0, 0, 0}};
40357 static swig_cast_info _swigc__p_GDALDatasetShadow[] = {  {&_swigt__p_GDALDatasetShadow, 0, 0, 0},{0, 0, 0, 0}};
40358 static swig_cast_info _swigc__p_GDALDimensionHS[] = {  {&_swigt__p_GDALDimensionHS, 0, 0, 0},{0, 0, 0, 0}};
40359 static swig_cast_info _swigc__p_GDALDriverShadow[] = {  {&_swigt__p_GDALDriverShadow, 0, 0, 0},{0, 0, 0, 0}};
40360 static swig_cast_info _swigc__p_GDALEDTComponentHS[] = {  {&_swigt__p_GDALEDTComponentHS, 0, 0, 0},{0, 0, 0, 0}};
40361 static swig_cast_info _swigc__p_GDALExtendedDataTypeClass[] = {  {&_swigt__p_GDALExtendedDataTypeClass, 0, 0, 0},{0, 0, 0, 0}};
40362 static swig_cast_info _swigc__p_GDALExtendedDataTypeHS[] = {  {&_swigt__p_GDALExtendedDataTypeHS, 0, 0, 0},{0, 0, 0, 0}};
40363 static swig_cast_info _swigc__p_GDALGridOptions[] = {  {&_swigt__p_GDALGridOptions, 0, 0, 0},{0, 0, 0, 0}};
40364 static swig_cast_info _swigc__p_GDALGroupHS[] = {  {&_swigt__p_GDALGroupHS, 0, 0, 0},{0, 0, 0, 0}};
40365 static swig_cast_info _swigc__p_GDALInfoOptions[] = {  {&_swigt__p_GDALInfoOptions, 0, 0, 0},{0, 0, 0, 0}};
40366 static swig_cast_info _swigc__p_GDALMDArrayHS[] = {  {&_swigt__p_GDALMDArrayHS, 0, 0, 0},{0, 0, 0, 0}};
40367 static swig_cast_info _swigc__p_GDALMajorObjectShadow[] = {  {&_swigt__p_GDALMajorObjectShadow, 0, 0, 0},  {&_swigt__p_GDALDriverShadow, _p_GDALDriverShadowTo_p_GDALMajorObjectShadow, 0, 0},  {&_swigt__p_OGRLayerShadow, _p_OGRLayerShadowTo_p_GDALMajorObjectShadow, 0, 0},  {&_swigt__p_GDALDatasetShadow, _p_GDALDatasetShadowTo_p_GDALMajorObjectShadow, 0, 0},  {&_swigt__p_GDALRasterBandShadow, _p_GDALRasterBandShadowTo_p_GDALMajorObjectShadow, 0, 0},{0, 0, 0, 0}};
40368 static swig_cast_info _swigc__p_GDALMultiDimInfoOptions[] = {  {&_swigt__p_GDALMultiDimInfoOptions, 0, 0, 0},{0, 0, 0, 0}};
40369 static swig_cast_info _swigc__p_GDALMultiDimTranslateOptions[] = {  {&_swigt__p_GDALMultiDimTranslateOptions, 0, 0, 0},{0, 0, 0, 0}};
40370 static swig_cast_info _swigc__p_GDALNearblackOptions[] = {  {&_swigt__p_GDALNearblackOptions, 0, 0, 0},{0, 0, 0, 0}};
40371 static swig_cast_info _swigc__p_GDALProgressFunc[] = {  {&_swigt__p_GDALProgressFunc, 0, 0, 0},{0, 0, 0, 0}};
40372 static swig_cast_info _swigc__p_GDALRasterAttributeTableShadow[] = {  {&_swigt__p_GDALRasterAttributeTableShadow, 0, 0, 0},{0, 0, 0, 0}};
40373 static swig_cast_info _swigc__p_GDALRasterBandShadow[] = {  {&_swigt__p_GDALRasterBandShadow, 0, 0, 0},{0, 0, 0, 0}};
40374 static swig_cast_info _swigc__p_GDALRasterizeOptions[] = {  {&_swigt__p_GDALRasterizeOptions, 0, 0, 0},{0, 0, 0, 0}};
40375 static swig_cast_info _swigc__p_GDALTransformerInfoShadow[] = {  {&_swigt__p_GDALTransformerInfoShadow, 0, 0, 0},{0, 0, 0, 0}};
40376 static swig_cast_info _swigc__p_GDALTranslateOptions[] = {  {&_swigt__p_GDALTranslateOptions, 0, 0, 0},{0, 0, 0, 0}};
40377 static swig_cast_info _swigc__p_GDALVectorTranslateOptions[] = {  {&_swigt__p_GDALVectorTranslateOptions, 0, 0, 0},{0, 0, 0, 0}};
40378 static swig_cast_info _swigc__p_GDALViewshedMode[] = {  {&_swigt__p_GDALViewshedMode, 0, 0, 0},{0, 0, 0, 0}};
40379 static swig_cast_info _swigc__p_GDALViewshedOutputType[] = {  {&_swigt__p_GDALViewshedOutputType, 0, 0, 0},{0, 0, 0, 0}};
40380 static swig_cast_info _swigc__p_GDALWarpAppOptions[] = {  {&_swigt__p_GDALWarpAppOptions, 0, 0, 0},{0, 0, 0, 0}};
40381 static swig_cast_info _swigc__p_GDAL_GCP[] = {  {&_swigt__p_GDAL_GCP, 0, 0, 0},{0, 0, 0, 0}};
40382 static swig_cast_info _swigc__p_GIntBig[] = {  {&_swigt__p_GIntBig, 0, 0, 0},{0, 0, 0, 0}};
40383 static swig_cast_info _swigc__p_GUIntBig[] = {  {&_swigt__p_GUIntBig, 0, 0, 0},{0, 0, 0, 0}};
40384 static swig_cast_info _swigc__p_OGRFeatureShadow[] = {  {&_swigt__p_OGRFeatureShadow, 0, 0, 0},{0, 0, 0, 0}};
40385 static swig_cast_info _swigc__p_OGRFieldDomainShadow[] = {  {&_swigt__p_OGRFieldDomainShadow, 0, 0, 0},{0, 0, 0, 0}};
40386 static swig_cast_info _swigc__p_OGRGeometryShadow[] = {  {&_swigt__p_OGRGeometryShadow, 0, 0, 0},{0, 0, 0, 0}};
40387 static swig_cast_info _swigc__p_OGRLayerShadow[] = {  {&_swigt__p_OGRLayerShadow, 0, 0, 0},{0, 0, 0, 0}};
40388 static swig_cast_info _swigc__p_OGRStyleTableShadow[] = {  {&_swigt__p_OGRStyleTableShadow, 0, 0, 0},{0, 0, 0, 0}};
40389 static swig_cast_info _swigc__p_OSRSpatialReferenceShadow[] = {  {&_swigt__p_OSRSpatialReferenceShadow, 0, 0, 0},{0, 0, 0, 0}};
40390 static swig_cast_info _swigc__p_Statistics[] = {  {&_swigt__p_Statistics, 0, 0, 0},{0, 0, 0, 0}};
40391 static swig_cast_info _swigc__p_VSILFILE[] = {  {&_swigt__p_VSILFILE, 0, 0, 0},{0, 0, 0, 0}};
40392 static swig_cast_info _swigc__p_VSIStatBufL[] = {  {&_swigt__p_VSIStatBufL, 0, 0, 0},{0, 0, 0, 0}};
40393 static swig_cast_info _swigc__p_VSIWriteFunction[] = {  {&_swigt__p_VSIWriteFunction, 0, 0, 0},{0, 0, 0, 0}};
40394 static swig_cast_info _swigc__p_char[] = {  {&_swigt__p_char, 0, 0, 0},{0, 0, 0, 0}};
40395 static swig_cast_info _swigc__p_double[] = {  {&_swigt__p_double, 0, 0, 0},{0, 0, 0, 0}};
40396 static swig_cast_info _swigc__p_f_double_p_q_const__char_p_void__int[] = {  {&_swigt__p_f_double_p_q_const__char_p_void__int, 0, 0, 0},{0, 0, 0, 0}};
40397 static swig_cast_info _swigc__p_int[] = {  {&_swigt__p_int, 0, 0, 0},{0, 0, 0, 0}};
40398 static swig_cast_info _swigc__p_p_GDALDatasetShadow[] = {  {&_swigt__p_p_GDALDatasetShadow, 0, 0, 0},{0, 0, 0, 0}};
40399 static swig_cast_info _swigc__p_p_GDALRasterBandShadow[] = {  {&_swigt__p_p_GDALRasterBandShadow, 0, 0, 0},{0, 0, 0, 0}};
40400 static swig_cast_info _swigc__p_p_GDAL_GCP[] = {  {&_swigt__p_p_GDAL_GCP, 0, 0, 0},{0, 0, 0, 0}};
40401 static swig_cast_info _swigc__p_p_GUIntBig[] = {  {&_swigt__p_p_GUIntBig, 0, 0, 0},{0, 0, 0, 0}};
40402 static swig_cast_info _swigc__p_p_char[] = {  {&_swigt__p_p_char, 0, 0, 0},{0, 0, 0, 0}};
40403 
40404 static swig_cast_info *swig_cast_initial[] = {
40405   _swigc__p_CPLErrorHandler,
40406   _swigc__p_CPLXMLNode,
40407   _swigc__p_FILE,
40408   _swigc__p_GByte,
40409   _swigc__p_GDALAsyncReaderShadow,
40410   _swigc__p_GDALAttributeHS,
40411   _swigc__p_GDALBuildVRTOptions,
40412   _swigc__p_GDALColorEntry,
40413   _swigc__p_GDALColorTableShadow,
40414   _swigc__p_GDALDEMProcessingOptions,
40415   _swigc__p_GDALDatasetShadow,
40416   _swigc__p_GDALDimensionHS,
40417   _swigc__p_GDALDriverShadow,
40418   _swigc__p_GDALEDTComponentHS,
40419   _swigc__p_GDALExtendedDataTypeClass,
40420   _swigc__p_GDALExtendedDataTypeHS,
40421   _swigc__p_GDALGridOptions,
40422   _swigc__p_GDALGroupHS,
40423   _swigc__p_GDALInfoOptions,
40424   _swigc__p_GDALMDArrayHS,
40425   _swigc__p_GDALMajorObjectShadow,
40426   _swigc__p_GDALMultiDimInfoOptions,
40427   _swigc__p_GDALMultiDimTranslateOptions,
40428   _swigc__p_GDALNearblackOptions,
40429   _swigc__p_GDALProgressFunc,
40430   _swigc__p_GDALRasterAttributeTableShadow,
40431   _swigc__p_GDALRasterBandShadow,
40432   _swigc__p_GDALRasterizeOptions,
40433   _swigc__p_GDALTransformerInfoShadow,
40434   _swigc__p_GDALTranslateOptions,
40435   _swigc__p_GDALVectorTranslateOptions,
40436   _swigc__p_GDALViewshedMode,
40437   _swigc__p_GDALViewshedOutputType,
40438   _swigc__p_GDALWarpAppOptions,
40439   _swigc__p_GDAL_GCP,
40440   _swigc__p_GIntBig,
40441   _swigc__p_GUIntBig,
40442   _swigc__p_OGRFeatureShadow,
40443   _swigc__p_OGRFieldDomainShadow,
40444   _swigc__p_OGRGeometryShadow,
40445   _swigc__p_OGRLayerShadow,
40446   _swigc__p_OGRStyleTableShadow,
40447   _swigc__p_OSRSpatialReferenceShadow,
40448   _swigc__p_Statistics,
40449   _swigc__p_VSILFILE,
40450   _swigc__p_VSIStatBufL,
40451   _swigc__p_VSIWriteFunction,
40452   _swigc__p_char,
40453   _swigc__p_double,
40454   _swigc__p_f_double_p_q_const__char_p_void__int,
40455   _swigc__p_int,
40456   _swigc__p_p_GDALDatasetShadow,
40457   _swigc__p_p_GDALRasterBandShadow,
40458   _swigc__p_p_GDAL_GCP,
40459   _swigc__p_p_GUIntBig,
40460   _swigc__p_p_char,
40461 };
40462 
40463 
40464 /* -------- TYPE CONVERSION AND EQUIVALENCE RULES (END) -------- */
40465 
40466 static swig_constant_info swig_constants[] = {
40467 {0,0,0,0,0,0}
40468 };
40469 #ifdef __cplusplus
40470 }
40471 #endif
40472 static swig_variable_info swig_variables[] = {
40473 {0,0,0,0}
40474 };
40475 static swig_command_info swig_commands[] = {
40476 {"Geo::GDALc::UseExceptions", _wrap_UseExceptions},
40477 {"Geo::GDALc::DontUseExceptions", _wrap_DontUseExceptions},
40478 {"Geo::GDALc::Debug", _wrap_Debug},
40479 {"Geo::GDALc::SetErrorHandler", _wrap_SetErrorHandler},
40480 {"Geo::GDALc::SetCurrentErrorHandlerCatchDebug", _wrap_SetCurrentErrorHandlerCatchDebug},
40481 {"Geo::GDALc::Error", _wrap_Error},
40482 {"Geo::GDALc::GOA2GetAuthorizationURL", _wrap_GOA2GetAuthorizationURL},
40483 {"Geo::GDALc::GOA2GetRefreshToken", _wrap_GOA2GetRefreshToken},
40484 {"Geo::GDALc::GOA2GetAccessToken", _wrap_GOA2GetAccessToken},
40485 {"Geo::GDALc::PushErrorHandler", _wrap_PushErrorHandler},
40486 {"Geo::GDALc::PopErrorHandler", _wrap_PopErrorHandler},
40487 {"Geo::GDALc::ErrorReset", _wrap_ErrorReset},
40488 {"Geo::GDALc::EscapeString", _wrap_EscapeString},
40489 {"Geo::GDALc::GetLastErrorNo", _wrap_GetLastErrorNo},
40490 {"Geo::GDALc::GetLastErrorType", _wrap_GetLastErrorType},
40491 {"Geo::GDALc::GetLastErrorMsg", _wrap_GetLastErrorMsg},
40492 {"Geo::GDALc::GetErrorCounter", _wrap_GetErrorCounter},
40493 {"Geo::GDALc::VSIGetLastErrorNo", _wrap_VSIGetLastErrorNo},
40494 {"Geo::GDALc::VSIGetLastErrorMsg", _wrap_VSIGetLastErrorMsg},
40495 {"Geo::GDALc::VSIErrorReset", _wrap_VSIErrorReset},
40496 {"Geo::GDALc::PushFinderLocation", _wrap_PushFinderLocation},
40497 {"Geo::GDALc::PopFinderLocation", _wrap_PopFinderLocation},
40498 {"Geo::GDALc::FinderClean", _wrap_FinderClean},
40499 {"Geo::GDALc::FindFile", _wrap_FindFile},
40500 {"Geo::GDALc::ReadDir", _wrap_ReadDir},
40501 {"Geo::GDALc::ReadDirRecursive", _wrap_ReadDirRecursive},
40502 {"Geo::GDALc::SetConfigOption", _wrap_SetConfigOption},
40503 {"Geo::GDALc::GetConfigOption", _wrap_GetConfigOption},
40504 {"Geo::GDALc::CPLBinaryToHex", _wrap_CPLBinaryToHex},
40505 {"Geo::GDALc::CPLHexToBinary", _wrap_CPLHexToBinary},
40506 {"Geo::GDALc::FileFromMemBuffer", _wrap_FileFromMemBuffer},
40507 {"Geo::GDALc::Unlink", _wrap_Unlink},
40508 {"Geo::GDALc::UnlinkBatch", _wrap_UnlinkBatch},
40509 {"Geo::GDALc::HasThreadSupport", _wrap_HasThreadSupport},
40510 {"Geo::GDALc::Mkdir", _wrap_Mkdir},
40511 {"Geo::GDALc::Rmdir", _wrap_Rmdir},
40512 {"Geo::GDALc::MkdirRecursive", _wrap_MkdirRecursive},
40513 {"Geo::GDALc::RmdirRecursive", _wrap_RmdirRecursive},
40514 {"Geo::GDALc::Rename", _wrap_Rename},
40515 {"Geo::GDALc::GetActualURL", _wrap_GetActualURL},
40516 {"Geo::GDALc::GetSignedURL", _wrap_GetSignedURL},
40517 {"Geo::GDALc::GetFileSystemsPrefixes", _wrap_GetFileSystemsPrefixes},
40518 {"Geo::GDALc::GetFileSystemOptions", _wrap_GetFileSystemOptions},
40519 {"Geo::GDALc::Stat", _wrap_Stat},
40520 {"Geo::GDALc::GetFileMetadata", _wrap_GetFileMetadata},
40521 {"Geo::GDALc::SetFileMetadata", _wrap_SetFileMetadata},
40522 {"Geo::GDALc::VSIFOpenL", _wrap_VSIFOpenL},
40523 {"Geo::GDALc::VSIFOpenExL", _wrap_VSIFOpenExL},
40524 {"Geo::GDALc::VSIFEofL", _wrap_VSIFEofL},
40525 {"Geo::GDALc::VSIFFlushL", _wrap_VSIFFlushL},
40526 {"Geo::GDALc::VSIFCloseL", _wrap_VSIFCloseL},
40527 {"Geo::GDALc::VSIFSeekL", _wrap_VSIFSeekL},
40528 {"Geo::GDALc::VSIFTellL", _wrap_VSIFTellL},
40529 {"Geo::GDALc::VSIFTruncateL", _wrap_VSIFTruncateL},
40530 {"Geo::GDALc::VSIFWriteL", _wrap_VSIFWriteL},
40531 {"Geo::GDALc::VSIFReadL", _wrap_VSIFReadL},
40532 {"Geo::GDALc::VSIStdoutSetRedirection", _wrap_VSIStdoutSetRedirection},
40533 {"Geo::GDALc::VSIStdoutUnsetRedirection", _wrap_VSIStdoutUnsetRedirection},
40534 {"Geo::GDALc::VSICurlClearCache", _wrap_VSICurlClearCache},
40535 {"Geo::GDALc::VSICurlPartialClearCache", _wrap_VSICurlPartialClearCache},
40536 {"Geo::GDALc::NetworkStatsReset", _wrap_NetworkStatsReset},
40537 {"Geo::GDALc::NetworkStatsGetAsSerializedJSON", _wrap_NetworkStatsGetAsSerializedJSON},
40538 {"Geo::GDALc::ParseCommandLine", _wrap_ParseCommandLine},
40539 {"Geo::GDALc::MajorObject_GetDescription", _wrap_MajorObject_GetDescription},
40540 {"Geo::GDALc::MajorObject_SetDescription", _wrap_MajorObject_SetDescription},
40541 {"Geo::GDALc::MajorObject_GetMetadataDomainList", _wrap_MajorObject_GetMetadataDomainList},
40542 {"Geo::GDALc::MajorObject_GetMetadata", _wrap_MajorObject_GetMetadata},
40543 {"Geo::GDALc::MajorObject_SetMetadata", _wrap_MajorObject_SetMetadata},
40544 {"Geo::GDALc::MajorObject_GetMetadataItem", _wrap_MajorObject_GetMetadataItem},
40545 {"Geo::GDALc::MajorObject_SetMetadataItem", _wrap_MajorObject_SetMetadataItem},
40546 {"Geo::GDALc::Driver_ShortName_get", _wrap_Driver_ShortName_get},
40547 {"Geo::GDALc::Driver_LongName_get", _wrap_Driver_LongName_get},
40548 {"Geo::GDALc::Driver_HelpTopic_get", _wrap_Driver_HelpTopic_get},
40549 {"Geo::GDALc::Driver__Create", _wrap_Driver__Create},
40550 {"Geo::GDALc::Driver_CreateMultiDimensional", _wrap_Driver_CreateMultiDimensional},
40551 {"Geo::GDALc::Driver__CreateCopy", _wrap_Driver__CreateCopy},
40552 {"Geo::GDALc::Driver_Delete", _wrap_Driver_Delete},
40553 {"Geo::GDALc::Driver_Rename", _wrap_Driver_Rename},
40554 {"Geo::GDALc::Driver_CopyFiles", _wrap_Driver_CopyFiles},
40555 {"Geo::GDALc::Driver_Register", _wrap_Driver_Register},
40556 {"Geo::GDALc::Driver_Deregister", _wrap_Driver_Deregister},
40557 {"Geo::GDALc::GCP_X_set", _wrap_GCP_X_set},
40558 {"Geo::GDALc::GCP_X_get", _wrap_GCP_X_get},
40559 {"Geo::GDALc::GCP_Y_set", _wrap_GCP_Y_set},
40560 {"Geo::GDALc::GCP_Y_get", _wrap_GCP_Y_get},
40561 {"Geo::GDALc::GCP_Z_set", _wrap_GCP_Z_set},
40562 {"Geo::GDALc::GCP_Z_get", _wrap_GCP_Z_get},
40563 {"Geo::GDALc::GCP_Column_set", _wrap_GCP_Column_set},
40564 {"Geo::GDALc::GCP_Column_get", _wrap_GCP_Column_get},
40565 {"Geo::GDALc::GCP_Row_set", _wrap_GCP_Row_set},
40566 {"Geo::GDALc::GCP_Row_get", _wrap_GCP_Row_get},
40567 {"Geo::GDALc::GCP_Info_set", _wrap_GCP_Info_set},
40568 {"Geo::GDALc::GCP_Info_get", _wrap_GCP_Info_get},
40569 {"Geo::GDALc::GCP_Id_set", _wrap_GCP_Id_set},
40570 {"Geo::GDALc::GCP_Id_get", _wrap_GCP_Id_get},
40571 {"Geo::GDALc::new_GCP", _wrap_new_GCP},
40572 {"Geo::GDALc::delete_GCP", _wrap_delete_GCP},
40573 {"Geo::GDALc::GDAL_GCP_GCPX_get", _wrap_GDAL_GCP_GCPX_get},
40574 {"Geo::GDALc::GDAL_GCP_GCPX_set", _wrap_GDAL_GCP_GCPX_set},
40575 {"Geo::GDALc::GDAL_GCP_GCPY_get", _wrap_GDAL_GCP_GCPY_get},
40576 {"Geo::GDALc::GDAL_GCP_GCPY_set", _wrap_GDAL_GCP_GCPY_set},
40577 {"Geo::GDALc::GDAL_GCP_GCPZ_get", _wrap_GDAL_GCP_GCPZ_get},
40578 {"Geo::GDALc::GDAL_GCP_GCPZ_set", _wrap_GDAL_GCP_GCPZ_set},
40579 {"Geo::GDALc::GDAL_GCP_GCPPixel_get", _wrap_GDAL_GCP_GCPPixel_get},
40580 {"Geo::GDALc::GDAL_GCP_GCPPixel_set", _wrap_GDAL_GCP_GCPPixel_set},
40581 {"Geo::GDALc::GDAL_GCP_GCPLine_get", _wrap_GDAL_GCP_GCPLine_get},
40582 {"Geo::GDALc::GDAL_GCP_GCPLine_set", _wrap_GDAL_GCP_GCPLine_set},
40583 {"Geo::GDALc::GDAL_GCP_Info_get", _wrap_GDAL_GCP_Info_get},
40584 {"Geo::GDALc::GDAL_GCP_Info_set", _wrap_GDAL_GCP_Info_set},
40585 {"Geo::GDALc::GDAL_GCP_Id_get", _wrap_GDAL_GCP_Id_get},
40586 {"Geo::GDALc::GDAL_GCP_Id_set", _wrap_GDAL_GCP_Id_set},
40587 {"Geo::GDALc::GCPsToGeoTransform", _wrap_GCPsToGeoTransform},
40588 {"Geo::GDALc::delete_AsyncReader", _wrap_delete_AsyncReader},
40589 {"Geo::GDALc::AsyncReader_GetNextUpdatedRegion", _wrap_AsyncReader_GetNextUpdatedRegion},
40590 {"Geo::GDALc::AsyncReader_LockBuffer", _wrap_AsyncReader_LockBuffer},
40591 {"Geo::GDALc::AsyncReader_UnlockBuffer", _wrap_AsyncReader_UnlockBuffer},
40592 {"Geo::GDALc::Dataset_RasterXSize_get", _wrap_Dataset_RasterXSize_get},
40593 {"Geo::GDALc::Dataset_RasterYSize_get", _wrap_Dataset_RasterYSize_get},
40594 {"Geo::GDALc::Dataset_RasterCount_get", _wrap_Dataset_RasterCount_get},
40595 {"Geo::GDALc::delete_Dataset", _wrap_delete_Dataset},
40596 {"Geo::GDALc::Dataset_GetDriver", _wrap_Dataset_GetDriver},
40597 {"Geo::GDALc::Dataset__GetRasterBand", _wrap_Dataset__GetRasterBand},
40598 {"Geo::GDALc::Dataset_GetRootGroup", _wrap_Dataset_GetRootGroup},
40599 {"Geo::GDALc::Dataset_GetProjection", _wrap_Dataset_GetProjection},
40600 {"Geo::GDALc::Dataset_GetProjectionRef", _wrap_Dataset_GetProjectionRef},
40601 {"Geo::GDALc::Dataset_GetSpatialRef", _wrap_Dataset_GetSpatialRef},
40602 {"Geo::GDALc::Dataset_SetProjection", _wrap_Dataset_SetProjection},
40603 {"Geo::GDALc::Dataset_SetSpatialRef", _wrap_Dataset_SetSpatialRef},
40604 {"Geo::GDALc::Dataset_GetGeoTransform", _wrap_Dataset_GetGeoTransform},
40605 {"Geo::GDALc::Dataset_SetGeoTransform", _wrap_Dataset_SetGeoTransform},
40606 {"Geo::GDALc::Dataset__BuildOverviews", _wrap_Dataset__BuildOverviews},
40607 {"Geo::GDALc::Dataset_GetGCPCount", _wrap_Dataset_GetGCPCount},
40608 {"Geo::GDALc::Dataset_GetGCPProjection", _wrap_Dataset_GetGCPProjection},
40609 {"Geo::GDALc::Dataset_GetGCPSpatialRef", _wrap_Dataset_GetGCPSpatialRef},
40610 {"Geo::GDALc::Dataset_GetGCPs", _wrap_Dataset_GetGCPs},
40611 {"Geo::GDALc::Dataset_SetGCPs", _wrap_Dataset_SetGCPs},
40612 {"Geo::GDALc::Dataset_SetGCPs2", _wrap_Dataset_SetGCPs2},
40613 {"Geo::GDALc::Dataset_FlushCache", _wrap_Dataset_FlushCache},
40614 {"Geo::GDALc::Dataset__AddBand", _wrap_Dataset__AddBand},
40615 {"Geo::GDALc::Dataset__CreateMaskBand", _wrap_Dataset__CreateMaskBand},
40616 {"Geo::GDALc::Dataset_GetFileList", _wrap_Dataset_GetFileList},
40617 {"Geo::GDALc::Dataset__WriteRaster", _wrap_Dataset__WriteRaster},
40618 {"Geo::GDALc::Dataset__ReadRaster", _wrap_Dataset__ReadRaster},
40619 {"Geo::GDALc::Dataset_AdviseRead", _wrap_Dataset_AdviseRead},
40620 {"Geo::GDALc::Dataset__CreateLayer", _wrap_Dataset__CreateLayer},
40621 {"Geo::GDALc::Dataset_CopyLayer", _wrap_Dataset_CopyLayer},
40622 {"Geo::GDALc::Dataset__DeleteLayer", _wrap_Dataset__DeleteLayer},
40623 {"Geo::GDALc::Dataset_GetLayerCount", _wrap_Dataset_GetLayerCount},
40624 {"Geo::GDALc::Dataset_GetLayerByIndex", _wrap_Dataset_GetLayerByIndex},
40625 {"Geo::GDALc::Dataset_GetLayerByName", _wrap_Dataset_GetLayerByName},
40626 {"Geo::GDALc::Dataset_ResetReading", _wrap_Dataset_ResetReading},
40627 {"Geo::GDALc::Dataset_GetNextFeature", _wrap_Dataset_GetNextFeature},
40628 {"Geo::GDALc::Dataset__TestCapability", _wrap_Dataset__TestCapability},
40629 {"Geo::GDALc::Dataset_ExecuteSQL", _wrap_Dataset_ExecuteSQL},
40630 {"Geo::GDALc::Dataset__ReleaseResultSet", _wrap_Dataset__ReleaseResultSet},
40631 {"Geo::GDALc::Dataset_GetStyleTable", _wrap_Dataset_GetStyleTable},
40632 {"Geo::GDALc::Dataset_SetStyleTable", _wrap_Dataset_SetStyleTable},
40633 {"Geo::GDALc::Dataset_AbortSQL", _wrap_Dataset_AbortSQL},
40634 {"Geo::GDALc::Dataset_StartTransaction", _wrap_Dataset_StartTransaction},
40635 {"Geo::GDALc::Dataset_CommitTransaction", _wrap_Dataset_CommitTransaction},
40636 {"Geo::GDALc::Dataset_RollbackTransaction", _wrap_Dataset_RollbackTransaction},
40637 {"Geo::GDALc::Dataset_ClearStatistics", _wrap_Dataset_ClearStatistics},
40638 {"Geo::GDALc::Dataset_GetFieldDomain", _wrap_Dataset_GetFieldDomain},
40639 {"Geo::GDALc::Dataset_AddFieldDomain", _wrap_Dataset_AddFieldDomain},
40640 {"Geo::GDALc::delete_Group", _wrap_delete_Group},
40641 {"Geo::GDALc::Group_GetName", _wrap_Group_GetName},
40642 {"Geo::GDALc::Group_GetFullName", _wrap_Group_GetFullName},
40643 {"Geo::GDALc::Group_GetMDArrayNames", _wrap_Group_GetMDArrayNames},
40644 {"Geo::GDALc::Group_OpenMDArray", _wrap_Group_OpenMDArray},
40645 {"Geo::GDALc::Group_OpenMDArrayFromFullname", _wrap_Group_OpenMDArrayFromFullname},
40646 {"Geo::GDALc::Group_ResolveMDArray", _wrap_Group_ResolveMDArray},
40647 {"Geo::GDALc::Group_GetGroupNames", _wrap_Group_GetGroupNames},
40648 {"Geo::GDALc::Group_OpenGroup", _wrap_Group_OpenGroup},
40649 {"Geo::GDALc::Group_OpenGroupFromFullname", _wrap_Group_OpenGroupFromFullname},
40650 {"Geo::GDALc::Group_GetAttribute", _wrap_Group_GetAttribute},
40651 {"Geo::GDALc::Group_GetStructuralInfo", _wrap_Group_GetStructuralInfo},
40652 {"Geo::GDALc::Group_CreateGroup", _wrap_Group_CreateGroup},
40653 {"Geo::GDALc::Group_CreateDimension", _wrap_Group_CreateDimension},
40654 {"Geo::GDALc::Group_CreateAttribute", _wrap_Group_CreateAttribute},
40655 {"Geo::GDALc::Statistics_min_get", _wrap_Statistics_min_get},
40656 {"Geo::GDALc::Statistics_max_get", _wrap_Statistics_max_get},
40657 {"Geo::GDALc::Statistics_mean_get", _wrap_Statistics_mean_get},
40658 {"Geo::GDALc::Statistics_std_dev_get", _wrap_Statistics_std_dev_get},
40659 {"Geo::GDALc::Statistics_valid_count_get", _wrap_Statistics_valid_count_get},
40660 {"Geo::GDALc::delete_Statistics", _wrap_delete_Statistics},
40661 {"Geo::GDALc::new_Statistics", _wrap_new_Statistics},
40662 {"Geo::GDALc::delete_MDArray", _wrap_delete_MDArray},
40663 {"Geo::GDALc::MDArray_GetName", _wrap_MDArray_GetName},
40664 {"Geo::GDALc::MDArray_GetFullName", _wrap_MDArray_GetFullName},
40665 {"Geo::GDALc::MDArray_GetTotalElementsCount", _wrap_MDArray_GetTotalElementsCount},
40666 {"Geo::GDALc::MDArray_GetDimensionCount", _wrap_MDArray_GetDimensionCount},
40667 {"Geo::GDALc::MDArray_GetDataType", _wrap_MDArray_GetDataType},
40668 {"Geo::GDALc::MDArray_GetStructuralInfo", _wrap_MDArray_GetStructuralInfo},
40669 {"Geo::GDALc::MDArray_GetAttribute", _wrap_MDArray_GetAttribute},
40670 {"Geo::GDALc::MDArray_CreateAttribute", _wrap_MDArray_CreateAttribute},
40671 {"Geo::GDALc::MDArray_GetNoDataValueAsDouble", _wrap_MDArray_GetNoDataValueAsDouble},
40672 {"Geo::GDALc::MDArray_SetNoDataValueDouble", _wrap_MDArray_SetNoDataValueDouble},
40673 {"Geo::GDALc::MDArray_DeleteNoDataValue", _wrap_MDArray_DeleteNoDataValue},
40674 {"Geo::GDALc::MDArray_GetOffset", _wrap_MDArray_GetOffset},
40675 {"Geo::GDALc::MDArray_GetOffsetStorageType", _wrap_MDArray_GetOffsetStorageType},
40676 {"Geo::GDALc::MDArray_GetScale", _wrap_MDArray_GetScale},
40677 {"Geo::GDALc::MDArray_GetScaleStorageType", _wrap_MDArray_GetScaleStorageType},
40678 {"Geo::GDALc::MDArray_SetOffset", _wrap_MDArray_SetOffset},
40679 {"Geo::GDALc::MDArray_SetScale", _wrap_MDArray_SetScale},
40680 {"Geo::GDALc::MDArray_SetUnit", _wrap_MDArray_SetUnit},
40681 {"Geo::GDALc::MDArray_GetUnit", _wrap_MDArray_GetUnit},
40682 {"Geo::GDALc::MDArray_SetSpatialRef", _wrap_MDArray_SetSpatialRef},
40683 {"Geo::GDALc::MDArray_GetSpatialRef", _wrap_MDArray_GetSpatialRef},
40684 {"Geo::GDALc::MDArray_GetView", _wrap_MDArray_GetView},
40685 {"Geo::GDALc::MDArray_Transpose", _wrap_MDArray_Transpose},
40686 {"Geo::GDALc::MDArray_GetUnscaled", _wrap_MDArray_GetUnscaled},
40687 {"Geo::GDALc::MDArray_GetMask", _wrap_MDArray_GetMask},
40688 {"Geo::GDALc::MDArray_AsClassicDataset", _wrap_MDArray_AsClassicDataset},
40689 {"Geo::GDALc::MDArray_GetStatistics", _wrap_MDArray_GetStatistics},
40690 {"Geo::GDALc::MDArray_ComputeStatistics", _wrap_MDArray_ComputeStatistics},
40691 {"Geo::GDALc::delete_Attribute", _wrap_delete_Attribute},
40692 {"Geo::GDALc::Attribute_GetName", _wrap_Attribute_GetName},
40693 {"Geo::GDALc::Attribute_GetFullName", _wrap_Attribute_GetFullName},
40694 {"Geo::GDALc::Attribute_GetTotalElementsCount", _wrap_Attribute_GetTotalElementsCount},
40695 {"Geo::GDALc::Attribute_GetDimensionCount", _wrap_Attribute_GetDimensionCount},
40696 {"Geo::GDALc::Attribute_GetDataType", _wrap_Attribute_GetDataType},
40697 {"Geo::GDALc::Attribute_ReadAsString", _wrap_Attribute_ReadAsString},
40698 {"Geo::GDALc::Attribute_ReadAsInt", _wrap_Attribute_ReadAsInt},
40699 {"Geo::GDALc::Attribute_ReadAsDouble", _wrap_Attribute_ReadAsDouble},
40700 {"Geo::GDALc::Attribute_ReadAsStringArray", _wrap_Attribute_ReadAsStringArray},
40701 {"Geo::GDALc::Attribute_WriteString", _wrap_Attribute_WriteString},
40702 {"Geo::GDALc::Attribute_WriteStringArray", _wrap_Attribute_WriteStringArray},
40703 {"Geo::GDALc::Attribute_WriteInt", _wrap_Attribute_WriteInt},
40704 {"Geo::GDALc::Attribute_WriteDouble", _wrap_Attribute_WriteDouble},
40705 {"Geo::GDALc::delete_Dimension", _wrap_delete_Dimension},
40706 {"Geo::GDALc::Dimension_GetName", _wrap_Dimension_GetName},
40707 {"Geo::GDALc::Dimension_GetFullName", _wrap_Dimension_GetFullName},
40708 {"Geo::GDALc::Dimension_GetType", _wrap_Dimension_GetType},
40709 {"Geo::GDALc::Dimension_GetDirection", _wrap_Dimension_GetDirection},
40710 {"Geo::GDALc::Dimension_GetSize", _wrap_Dimension_GetSize},
40711 {"Geo::GDALc::Dimension_GetIndexingVariable", _wrap_Dimension_GetIndexingVariable},
40712 {"Geo::GDALc::Dimension_SetIndexingVariable", _wrap_Dimension_SetIndexingVariable},
40713 {"Geo::GDALc::delete_ExtendedDataType", _wrap_delete_ExtendedDataType},
40714 {"Geo::GDALc::ExtendedDataType__Create", _wrap_ExtendedDataType__Create},
40715 {"Geo::GDALc::ExtendedDataType_CreateString", _wrap_ExtendedDataType_CreateString},
40716 {"Geo::GDALc::ExtendedDataType_GetName", _wrap_ExtendedDataType_GetName},
40717 {"Geo::GDALc::ExtendedDataType_GetClass", _wrap_ExtendedDataType_GetClass},
40718 {"Geo::GDALc::ExtendedDataType_GetNumericDataType", _wrap_ExtendedDataType_GetNumericDataType},
40719 {"Geo::GDALc::ExtendedDataType_GetSize", _wrap_ExtendedDataType_GetSize},
40720 {"Geo::GDALc::ExtendedDataType_GetMaxStringLength", _wrap_ExtendedDataType_GetMaxStringLength},
40721 {"Geo::GDALc::ExtendedDataType_CanConvertTo", _wrap_ExtendedDataType_CanConvertTo},
40722 {"Geo::GDALc::ExtendedDataType_Equals", _wrap_ExtendedDataType_Equals},
40723 {"Geo::GDALc::delete_EDTComponent", _wrap_delete_EDTComponent},
40724 {"Geo::GDALc::EDTComponent__Create", _wrap_EDTComponent__Create},
40725 {"Geo::GDALc::EDTComponent_GetName", _wrap_EDTComponent_GetName},
40726 {"Geo::GDALc::EDTComponent_GetOffset", _wrap_EDTComponent_GetOffset},
40727 {"Geo::GDALc::EDTComponent_GetType", _wrap_EDTComponent_GetType},
40728 {"Geo::GDALc::Band_XSize_get", _wrap_Band_XSize_get},
40729 {"Geo::GDALc::Band_YSize_get", _wrap_Band_YSize_get},
40730 {"Geo::GDALc::Band_DataType_get", _wrap_Band_DataType_get},
40731 {"Geo::GDALc::Band_GetDataset", _wrap_Band_GetDataset},
40732 {"Geo::GDALc::Band_GetBand", _wrap_Band_GetBand},
40733 {"Geo::GDALc::Band_GetBlockSize", _wrap_Band_GetBlockSize},
40734 {"Geo::GDALc::Band_GetColorInterpretation", _wrap_Band_GetColorInterpretation},
40735 {"Geo::GDALc::Band_GetRasterColorInterpretation", _wrap_Band_GetRasterColorInterpretation},
40736 {"Geo::GDALc::Band_SetColorInterpretation", _wrap_Band_SetColorInterpretation},
40737 {"Geo::GDALc::Band_SetRasterColorInterpretation", _wrap_Band_SetRasterColorInterpretation},
40738 {"Geo::GDALc::Band_GetNoDataValue", _wrap_Band_GetNoDataValue},
40739 {"Geo::GDALc::Band_SetNoDataValue", _wrap_Band_SetNoDataValue},
40740 {"Geo::GDALc::Band_DeleteNoDataValue", _wrap_Band_DeleteNoDataValue},
40741 {"Geo::GDALc::Band_GetUnitType", _wrap_Band_GetUnitType},
40742 {"Geo::GDALc::Band_SetUnitType", _wrap_Band_SetUnitType},
40743 {"Geo::GDALc::Band_GetRasterCategoryNames", _wrap_Band_GetRasterCategoryNames},
40744 {"Geo::GDALc::Band_SetRasterCategoryNames", _wrap_Band_SetRasterCategoryNames},
40745 {"Geo::GDALc::Band_GetMinimum", _wrap_Band_GetMinimum},
40746 {"Geo::GDALc::Band_GetMaximum", _wrap_Band_GetMaximum},
40747 {"Geo::GDALc::Band_GetOffset", _wrap_Band_GetOffset},
40748 {"Geo::GDALc::Band_GetScale", _wrap_Band_GetScale},
40749 {"Geo::GDALc::Band_SetOffset", _wrap_Band_SetOffset},
40750 {"Geo::GDALc::Band_SetScale", _wrap_Band_SetScale},
40751 {"Geo::GDALc::Band_GetStatistics", _wrap_Band_GetStatistics},
40752 {"Geo::GDALc::Band_ComputeStatistics", _wrap_Band_ComputeStatistics},
40753 {"Geo::GDALc::Band_SetStatistics", _wrap_Band_SetStatistics},
40754 {"Geo::GDALc::Band_GetOverviewCount", _wrap_Band_GetOverviewCount},
40755 {"Geo::GDALc::Band__GetOverview", _wrap_Band__GetOverview},
40756 {"Geo::GDALc::Band_Checksum", _wrap_Band_Checksum},
40757 {"Geo::GDALc::Band_ComputeRasterMinMax", _wrap_Band_ComputeRasterMinMax},
40758 {"Geo::GDALc::Band_ComputeBandStats", _wrap_Band_ComputeBandStats},
40759 {"Geo::GDALc::Band_Fill", _wrap_Band_Fill},
40760 {"Geo::GDALc::Band__ReadRaster", _wrap_Band__ReadRaster},
40761 {"Geo::GDALc::Band__WriteRaster", _wrap_Band__WriteRaster},
40762 {"Geo::GDALc::Band_FlushCache", _wrap_Band_FlushCache},
40763 {"Geo::GDALc::Band_GetRasterColorTable", _wrap_Band_GetRasterColorTable},
40764 {"Geo::GDALc::Band_GetColorTable", _wrap_Band_GetColorTable},
40765 {"Geo::GDALc::Band_SetRasterColorTable", _wrap_Band_SetRasterColorTable},
40766 {"Geo::GDALc::Band_SetColorTable", _wrap_Band_SetColorTable},
40767 {"Geo::GDALc::Band_GetDefaultRAT", _wrap_Band_GetDefaultRAT},
40768 {"Geo::GDALc::Band_SetDefaultRAT", _wrap_Band_SetDefaultRAT},
40769 {"Geo::GDALc::Band__GetMaskBand", _wrap_Band__GetMaskBand},
40770 {"Geo::GDALc::Band__GetMaskFlags", _wrap_Band__GetMaskFlags},
40771 {"Geo::GDALc::Band__CreateMaskBand", _wrap_Band__CreateMaskBand},
40772 {"Geo::GDALc::Band__GetHistogram", _wrap_Band__GetHistogram},
40773 {"Geo::GDALc::Band_GetDefaultHistogram", _wrap_Band_GetDefaultHistogram},
40774 {"Geo::GDALc::Band_SetDefaultHistogram", _wrap_Band_SetDefaultHistogram},
40775 {"Geo::GDALc::Band_HasArbitraryOverviews", _wrap_Band_HasArbitraryOverviews},
40776 {"Geo::GDALc::Band_GetCategoryNames", _wrap_Band_GetCategoryNames},
40777 {"Geo::GDALc::Band_SetCategoryNames", _wrap_Band_SetCategoryNames},
40778 {"Geo::GDALc::Band_AdviseRead", _wrap_Band_AdviseRead},
40779 {"Geo::GDALc::Band_AsMDArray", _wrap_Band_AsMDArray},
40780 {"Geo::GDALc::Band_ContourGenerate", _wrap_Band_ContourGenerate},
40781 {"Geo::GDALc::Band_ClassCounts", _wrap_Band_ClassCounts},
40782 {"Geo::GDALc::Band_Reclassify", _wrap_Band_Reclassify},
40783 {"Geo::GDALc::new_ColorTable", _wrap_new_ColorTable},
40784 {"Geo::GDALc::delete_ColorTable", _wrap_delete_ColorTable},
40785 {"Geo::GDALc::ColorTable_Clone", _wrap_ColorTable_Clone},
40786 {"Geo::GDALc::ColorTable__GetPaletteInterpretation", _wrap_ColorTable__GetPaletteInterpretation},
40787 {"Geo::GDALc::ColorTable_GetCount", _wrap_ColorTable_GetCount},
40788 {"Geo::GDALc::ColorTable_GetColorEntry", _wrap_ColorTable_GetColorEntry},
40789 {"Geo::GDALc::ColorTable_GetColorEntryAsRGB", _wrap_ColorTable_GetColorEntryAsRGB},
40790 {"Geo::GDALc::ColorTable__SetColorEntry", _wrap_ColorTable__SetColorEntry},
40791 {"Geo::GDALc::ColorTable_CreateColorRamp", _wrap_ColorTable_CreateColorRamp},
40792 {"Geo::GDALc::new_RasterAttributeTable", _wrap_new_RasterAttributeTable},
40793 {"Geo::GDALc::delete_RasterAttributeTable", _wrap_delete_RasterAttributeTable},
40794 {"Geo::GDALc::RasterAttributeTable_Clone", _wrap_RasterAttributeTable_Clone},
40795 {"Geo::GDALc::RasterAttributeTable_GetColumnCount", _wrap_RasterAttributeTable_GetColumnCount},
40796 {"Geo::GDALc::RasterAttributeTable_GetNameOfCol", _wrap_RasterAttributeTable_GetNameOfCol},
40797 {"Geo::GDALc::RasterAttributeTable__GetUsageOfCol", _wrap_RasterAttributeTable__GetUsageOfCol},
40798 {"Geo::GDALc::RasterAttributeTable__GetTypeOfCol", _wrap_RasterAttributeTable__GetTypeOfCol},
40799 {"Geo::GDALc::RasterAttributeTable__GetColOfUsage", _wrap_RasterAttributeTable__GetColOfUsage},
40800 {"Geo::GDALc::RasterAttributeTable_GetRowCount", _wrap_RasterAttributeTable_GetRowCount},
40801 {"Geo::GDALc::RasterAttributeTable_GetValueAsString", _wrap_RasterAttributeTable_GetValueAsString},
40802 {"Geo::GDALc::RasterAttributeTable_GetValueAsInt", _wrap_RasterAttributeTable_GetValueAsInt},
40803 {"Geo::GDALc::RasterAttributeTable_GetValueAsDouble", _wrap_RasterAttributeTable_GetValueAsDouble},
40804 {"Geo::GDALc::RasterAttributeTable_SetValueAsString", _wrap_RasterAttributeTable_SetValueAsString},
40805 {"Geo::GDALc::RasterAttributeTable_SetValueAsInt", _wrap_RasterAttributeTable_SetValueAsInt},
40806 {"Geo::GDALc::RasterAttributeTable_SetValueAsDouble", _wrap_RasterAttributeTable_SetValueAsDouble},
40807 {"Geo::GDALc::RasterAttributeTable_SetRowCount", _wrap_RasterAttributeTable_SetRowCount},
40808 {"Geo::GDALc::RasterAttributeTable__CreateColumn", _wrap_RasterAttributeTable__CreateColumn},
40809 {"Geo::GDALc::RasterAttributeTable_GetLinearBinning", _wrap_RasterAttributeTable_GetLinearBinning},
40810 {"Geo::GDALc::RasterAttributeTable_SetLinearBinning", _wrap_RasterAttributeTable_SetLinearBinning},
40811 {"Geo::GDALc::RasterAttributeTable_GetRowOfValue", _wrap_RasterAttributeTable_GetRowOfValue},
40812 {"Geo::GDALc::RasterAttributeTable_ChangesAreWrittenToFile", _wrap_RasterAttributeTable_ChangesAreWrittenToFile},
40813 {"Geo::GDALc::RasterAttributeTable_DumpReadable", _wrap_RasterAttributeTable_DumpReadable},
40814 {"Geo::GDALc::RasterAttributeTable_SetTableType", _wrap_RasterAttributeTable_SetTableType},
40815 {"Geo::GDALc::RasterAttributeTable_GetTableType", _wrap_RasterAttributeTable_GetTableType},
40816 {"Geo::GDALc::TermProgress_nocb", _wrap_TermProgress_nocb},
40817 {"Geo::GDALc::ComputeMedianCutPCT", _wrap_ComputeMedianCutPCT},
40818 {"Geo::GDALc::DitherRGB2PCT", _wrap_DitherRGB2PCT},
40819 {"Geo::GDALc::_ReprojectImage", _wrap__ReprojectImage},
40820 {"Geo::GDALc::ComputeProximity", _wrap_ComputeProximity},
40821 {"Geo::GDALc::RasterizeLayer", _wrap_RasterizeLayer},
40822 {"Geo::GDALc::_Polygonize", _wrap__Polygonize},
40823 {"Geo::GDALc::FPolygonize", _wrap_FPolygonize},
40824 {"Geo::GDALc::FillNodata", _wrap_FillNodata},
40825 {"Geo::GDALc::SieveFilter", _wrap_SieveFilter},
40826 {"Geo::GDALc::_RegenerateOverviews", _wrap__RegenerateOverviews},
40827 {"Geo::GDALc::_RegenerateOverview", _wrap__RegenerateOverview},
40828 {"Geo::GDALc::ContourGenerate", _wrap_ContourGenerate},
40829 {"Geo::GDALc::ContourGenerateEx", _wrap_ContourGenerateEx},
40830 {"Geo::GDALc::ViewshedGenerate", _wrap_ViewshedGenerate},
40831 {"Geo::GDALc::_AutoCreateWarpedVRT", _wrap__AutoCreateWarpedVRT},
40832 {"Geo::GDALc::CreatePansharpenedVRT", _wrap_CreatePansharpenedVRT},
40833 {"Geo::GDALc::new_Transformer", _wrap_new_Transformer},
40834 {"Geo::GDALc::delete_Transformer", _wrap_delete_Transformer},
40835 {"Geo::GDALc::Transformer_TransformPoint", _wrap_Transformer_TransformPoint},
40836 {"Geo::GDALc::Transformer__TransformPoints", _wrap_Transformer__TransformPoints},
40837 {"Geo::GDALc::Transformer_TransformGeolocations", _wrap_Transformer_TransformGeolocations},
40838 {"Geo::GDALc::ApplyVerticalShiftGrid", _wrap_ApplyVerticalShiftGrid},
40839 {"Geo::GDALc::ApplyGeoTransform", _wrap_ApplyGeoTransform},
40840 {"Geo::GDALc::InvGeoTransform", _wrap_InvGeoTransform},
40841 {"Geo::GDALc::VersionInfo", _wrap_VersionInfo},
40842 {"Geo::GDALc::AllRegister", _wrap_AllRegister},
40843 {"Geo::GDALc::GDALDestroyDriverManager", _wrap_GDALDestroyDriverManager},
40844 {"Geo::GDALc::GetCacheMax", _wrap_GetCacheMax},
40845 {"Geo::GDALc::GetCacheUsed", _wrap_GetCacheUsed},
40846 {"Geo::GDALc::SetCacheMax", _wrap_SetCacheMax},
40847 {"Geo::GDALc::_GetDataTypeSize", _wrap__GetDataTypeSize},
40848 {"Geo::GDALc::_DataTypeIsComplex", _wrap__DataTypeIsComplex},
40849 {"Geo::GDALc::GetDataTypeName", _wrap_GetDataTypeName},
40850 {"Geo::GDALc::GetDataTypeByName", _wrap_GetDataTypeByName},
40851 {"Geo::GDALc::GetColorInterpretationName", _wrap_GetColorInterpretationName},
40852 {"Geo::GDALc::GetPaletteInterpretationName", _wrap_GetPaletteInterpretationName},
40853 {"Geo::GDALc::DecToDMS", _wrap_DecToDMS},
40854 {"Geo::GDALc::PackedDMSToDec", _wrap_PackedDMSToDec},
40855 {"Geo::GDALc::DecToPackedDMS", _wrap_DecToPackedDMS},
40856 {"Geo::GDALc::ParseXMLString", _wrap_ParseXMLString},
40857 {"Geo::GDALc::SerializeXMLTree", _wrap_SerializeXMLTree},
40858 {"Geo::GDALc::GetJPEG2000StructureAsString", _wrap_GetJPEG2000StructureAsString},
40859 {"Geo::GDALc::GetDriverCount", _wrap_GetDriverCount},
40860 {"Geo::GDALc::GetDriverByName", _wrap_GetDriverByName},
40861 {"Geo::GDALc::GetDriver", _wrap_GetDriver},
40862 {"Geo::GDALc::_Open", _wrap__Open},
40863 {"Geo::GDALc::_OpenEx", _wrap__OpenEx},
40864 {"Geo::GDALc::_OpenShared", _wrap__OpenShared},
40865 {"Geo::GDALc::IdentifyDriver", _wrap_IdentifyDriver},
40866 {"Geo::GDALc::IdentifyDriverEx", _wrap_IdentifyDriverEx},
40867 {"Geo::GDALc::GeneralCmdLineProcessor", _wrap_GeneralCmdLineProcessor},
40868 {"Geo::GDALc::new_GDALInfoOptions", _wrap_new_GDALInfoOptions},
40869 {"Geo::GDALc::delete_GDALInfoOptions", _wrap_delete_GDALInfoOptions},
40870 {"Geo::GDALc::GDALInfo", _wrap_GDALInfo},
40871 {"Geo::GDALc::new_GDALMultiDimInfoOptions", _wrap_new_GDALMultiDimInfoOptions},
40872 {"Geo::GDALc::delete_GDALMultiDimInfoOptions", _wrap_delete_GDALMultiDimInfoOptions},
40873 {"Geo::GDALc::GDALMultiDimInfo", _wrap_GDALMultiDimInfo},
40874 {"Geo::GDALc::new_GDALTranslateOptions", _wrap_new_GDALTranslateOptions},
40875 {"Geo::GDALc::delete_GDALTranslateOptions", _wrap_delete_GDALTranslateOptions},
40876 {"Geo::GDALc::wrapper_GDALTranslate", _wrap_wrapper_GDALTranslate},
40877 {"Geo::GDALc::new_GDALWarpAppOptions", _wrap_new_GDALWarpAppOptions},
40878 {"Geo::GDALc::delete_GDALWarpAppOptions", _wrap_delete_GDALWarpAppOptions},
40879 {"Geo::GDALc::wrapper_GDALWarpDestDS", _wrap_wrapper_GDALWarpDestDS},
40880 {"Geo::GDALc::wrapper_GDALWarpDestName", _wrap_wrapper_GDALWarpDestName},
40881 {"Geo::GDALc::new_GDALVectorTranslateOptions", _wrap_new_GDALVectorTranslateOptions},
40882 {"Geo::GDALc::delete_GDALVectorTranslateOptions", _wrap_delete_GDALVectorTranslateOptions},
40883 {"Geo::GDALc::wrapper_GDALVectorTranslateDestDS", _wrap_wrapper_GDALVectorTranslateDestDS},
40884 {"Geo::GDALc::wrapper_GDALVectorTranslateDestName", _wrap_wrapper_GDALVectorTranslateDestName},
40885 {"Geo::GDALc::new_GDALDEMProcessingOptions", _wrap_new_GDALDEMProcessingOptions},
40886 {"Geo::GDALc::delete_GDALDEMProcessingOptions", _wrap_delete_GDALDEMProcessingOptions},
40887 {"Geo::GDALc::wrapper_GDALDEMProcessing", _wrap_wrapper_GDALDEMProcessing},
40888 {"Geo::GDALc::new_GDALNearblackOptions", _wrap_new_GDALNearblackOptions},
40889 {"Geo::GDALc::delete_GDALNearblackOptions", _wrap_delete_GDALNearblackOptions},
40890 {"Geo::GDALc::wrapper_GDALNearblackDestDS", _wrap_wrapper_GDALNearblackDestDS},
40891 {"Geo::GDALc::wrapper_GDALNearblackDestName", _wrap_wrapper_GDALNearblackDestName},
40892 {"Geo::GDALc::new_GDALGridOptions", _wrap_new_GDALGridOptions},
40893 {"Geo::GDALc::delete_GDALGridOptions", _wrap_delete_GDALGridOptions},
40894 {"Geo::GDALc::wrapper_GDALGrid", _wrap_wrapper_GDALGrid},
40895 {"Geo::GDALc::new_GDALRasterizeOptions", _wrap_new_GDALRasterizeOptions},
40896 {"Geo::GDALc::delete_GDALRasterizeOptions", _wrap_delete_GDALRasterizeOptions},
40897 {"Geo::GDALc::wrapper_GDALRasterizeDestDS", _wrap_wrapper_GDALRasterizeDestDS},
40898 {"Geo::GDALc::wrapper_GDALRasterizeDestName", _wrap_wrapper_GDALRasterizeDestName},
40899 {"Geo::GDALc::new_GDALBuildVRTOptions", _wrap_new_GDALBuildVRTOptions},
40900 {"Geo::GDALc::delete_GDALBuildVRTOptions", _wrap_delete_GDALBuildVRTOptions},
40901 {"Geo::GDALc::wrapper_GDALBuildVRT_objects", _wrap_wrapper_GDALBuildVRT_objects},
40902 {"Geo::GDALc::wrapper_GDALBuildVRT_names", _wrap_wrapper_GDALBuildVRT_names},
40903 {"Geo::GDALc::new_GDALMultiDimTranslateOptions", _wrap_new_GDALMultiDimTranslateOptions},
40904 {"Geo::GDALc::delete_GDALMultiDimTranslateOptions", _wrap_delete_GDALMultiDimTranslateOptions},
40905 {"Geo::GDALc::wrapper_GDALMultiDimTranslateDestName", _wrap_wrapper_GDALMultiDimTranslateDestName},
40906 {0,0}
40907 };
40908 /* -----------------------------------------------------------------------------
40909  * Type initialization:
40910  * This problem is tough by the requirement that no dynamic
40911  * memory is used. Also, since swig_type_info structures store pointers to
40912  * swig_cast_info structures and swig_cast_info structures store pointers back
40913  * to swig_type_info structures, we need some lookup code at initialization.
40914  * The idea is that swig generates all the structures that are needed.
40915  * The runtime then collects these partially filled structures.
40916  * The SWIG_InitializeModule function takes these initial arrays out of
40917  * swig_module, and does all the lookup, filling in the swig_module.types
40918  * array with the correct data and linking the correct swig_cast_info
40919  * structures together.
40920  *
40921  * The generated swig_type_info structures are assigned statically to an initial
40922  * array. We just loop through that array, and handle each type individually.
40923  * First we lookup if this type has been already loaded, and if so, use the
40924  * loaded structure instead of the generated one. Then we have to fill in the
40925  * cast linked list. The cast data is initially stored in something like a
40926  * two-dimensional array. Each row corresponds to a type (there are the same
40927  * number of rows as there are in the swig_type_initial array). Each entry in
40928  * a column is one of the swig_cast_info structures for that type.
40929  * The cast_initial array is actually an array of arrays, because each row has
40930  * a variable number of columns. So to actually build the cast linked list,
40931  * we find the array of casts associated with the type, and loop through it
40932  * adding the casts to the list. The one last trick we need to do is making
40933  * sure the type pointer in the swig_cast_info struct is correct.
40934  *
40935  * First off, we lookup the cast->type name to see if it is already loaded.
40936  * There are three cases to handle:
40937  *  1) If the cast->type has already been loaded AND the type we are adding
40938  *     casting info to has not been loaded (it is in this module), THEN we
40939  *     replace the cast->type pointer with the type pointer that has already
40940  *     been loaded.
40941  *  2) If BOTH types (the one we are adding casting info to, and the
40942  *     cast->type) are loaded, THEN the cast info has already been loaded by
40943  *     the previous module so we just ignore it.
40944  *  3) Finally, if cast->type has not already been loaded, then we add that
40945  *     swig_cast_info to the linked list (because the cast->type) pointer will
40946  *     be correct.
40947  * ----------------------------------------------------------------------------- */
40948 
40949 #ifdef __cplusplus
40950 extern "C" {
40951 #if 0
40952 } /* c-mode */
40953 #endif
40954 #endif
40955 
40956 #if 0
40957 #define SWIGRUNTIME_DEBUG
40958 #endif
40959 
40960 
40961 SWIGRUNTIME void
SWIG_InitializeModule(void * clientdata)40962 SWIG_InitializeModule(void *clientdata) {
40963   size_t i;
40964   swig_module_info *module_head, *iter;
40965   int init;
40966 
40967   /* check to see if the circular list has been setup, if not, set it up */
40968   if (swig_module.next==0) {
40969     /* Initialize the swig_module */
40970     swig_module.type_initial = swig_type_initial;
40971     swig_module.cast_initial = swig_cast_initial;
40972     swig_module.next = &swig_module;
40973     init = 1;
40974   } else {
40975     init = 0;
40976   }
40977 
40978   /* Try and load any already created modules */
40979   module_head = SWIG_GetModule(clientdata);
40980   if (!module_head) {
40981     /* This is the first module loaded for this interpreter */
40982     /* so set the swig module into the interpreter */
40983     SWIG_SetModule(clientdata, &swig_module);
40984   } else {
40985     /* the interpreter has loaded a SWIG module, but has it loaded this one? */
40986     iter=module_head;
40987     do {
40988       if (iter==&swig_module) {
40989         /* Our module is already in the list, so there's nothing more to do. */
40990         return;
40991       }
40992       iter=iter->next;
40993     } while (iter!= module_head);
40994 
40995     /* otherwise we must add our module into the list */
40996     swig_module.next = module_head->next;
40997     module_head->next = &swig_module;
40998   }
40999 
41000   /* When multiple interpreters are used, a module could have already been initialized in
41001        a different interpreter, but not yet have a pointer in this interpreter.
41002        In this case, we do not want to continue adding types... everything should be
41003        set up already */
41004   if (init == 0) return;
41005 
41006   /* Now work on filling in swig_module.types */
41007 #ifdef SWIGRUNTIME_DEBUG
41008   printf("SWIG_InitializeModule: size %d\n", swig_module.size);
41009 #endif
41010   for (i = 0; i < swig_module.size; ++i) {
41011     swig_type_info *type = 0;
41012     swig_type_info *ret;
41013     swig_cast_info *cast;
41014 
41015 #ifdef SWIGRUNTIME_DEBUG
41016     printf("SWIG_InitializeModule: type %d %s\n", i, swig_module.type_initial[i]->name);
41017 #endif
41018 
41019     /* if there is another module already loaded */
41020     if (swig_module.next != &swig_module) {
41021       type = SWIG_MangledTypeQueryModule(swig_module.next, &swig_module, swig_module.type_initial[i]->name);
41022     }
41023     if (type) {
41024       /* Overwrite clientdata field */
41025 #ifdef SWIGRUNTIME_DEBUG
41026       printf("SWIG_InitializeModule: found type %s\n", type->name);
41027 #endif
41028       if (swig_module.type_initial[i]->clientdata) {
41029         type->clientdata = swig_module.type_initial[i]->clientdata;
41030 #ifdef SWIGRUNTIME_DEBUG
41031         printf("SWIG_InitializeModule: found and overwrite type %s \n", type->name);
41032 #endif
41033       }
41034     } else {
41035       type = swig_module.type_initial[i];
41036     }
41037 
41038     /* Insert casting types */
41039     cast = swig_module.cast_initial[i];
41040     while (cast->type) {
41041       /* Don't need to add information already in the list */
41042       ret = 0;
41043 #ifdef SWIGRUNTIME_DEBUG
41044       printf("SWIG_InitializeModule: look cast %s\n", cast->type->name);
41045 #endif
41046       if (swig_module.next != &swig_module) {
41047         ret = SWIG_MangledTypeQueryModule(swig_module.next, &swig_module, cast->type->name);
41048 #ifdef SWIGRUNTIME_DEBUG
41049         if (ret) printf("SWIG_InitializeModule: found cast %s\n", ret->name);
41050 #endif
41051       }
41052       if (ret) {
41053         if (type == swig_module.type_initial[i]) {
41054 #ifdef SWIGRUNTIME_DEBUG
41055           printf("SWIG_InitializeModule: skip old type %s\n", ret->name);
41056 #endif
41057           cast->type = ret;
41058           ret = 0;
41059         } else {
41060           /* Check for casting already in the list */
41061           swig_cast_info *ocast = SWIG_TypeCheck(ret->name, type);
41062 #ifdef SWIGRUNTIME_DEBUG
41063           if (ocast) printf("SWIG_InitializeModule: skip old cast %s\n", ret->name);
41064 #endif
41065           if (!ocast) ret = 0;
41066         }
41067       }
41068 
41069       if (!ret) {
41070 #ifdef SWIGRUNTIME_DEBUG
41071         printf("SWIG_InitializeModule: adding cast %s\n", cast->type->name);
41072 #endif
41073         if (type->cast) {
41074           type->cast->prev = cast;
41075           cast->next = type->cast;
41076         }
41077         type->cast = cast;
41078       }
41079       cast++;
41080     }
41081     /* Set entry in modules->types array equal to the type */
41082     swig_module.types[i] = type;
41083   }
41084   swig_module.types[i] = 0;
41085 
41086 #ifdef SWIGRUNTIME_DEBUG
41087   printf("**** SWIG_InitializeModule: Cast List ******\n");
41088   for (i = 0; i < swig_module.size; ++i) {
41089     int j = 0;
41090     swig_cast_info *cast = swig_module.cast_initial[i];
41091     printf("SWIG_InitializeModule: type %d %s\n", i, swig_module.type_initial[i]->name);
41092     while (cast->type) {
41093       printf("SWIG_InitializeModule: cast type %s\n", cast->type->name);
41094       cast++;
41095       ++j;
41096     }
41097     printf("---- Total casts: %d\n",j);
41098   }
41099   printf("**** SWIG_InitializeModule: Cast List ******\n");
41100 #endif
41101 }
41102 
41103 /* This function will propagate the clientdata field of type to
41104 * any new swig_type_info structures that have been added into the list
41105 * of equivalent types.  It is like calling
41106 * SWIG_TypeClientData(type, clientdata) a second time.
41107 */
41108 SWIGRUNTIME void
SWIG_PropagateClientData(void)41109 SWIG_PropagateClientData(void) {
41110   size_t i;
41111   swig_cast_info *equiv;
41112   static int init_run = 0;
41113 
41114   if (init_run) return;
41115   init_run = 1;
41116 
41117   for (i = 0; i < swig_module.size; i++) {
41118     if (swig_module.types[i]->clientdata) {
41119       equiv = swig_module.types[i]->cast;
41120       while (equiv) {
41121         if (!equiv->converter) {
41122           if (equiv->type && !equiv->type->clientdata)
41123           SWIG_TypeClientData(equiv->type, swig_module.types[i]->clientdata);
41124         }
41125         equiv = equiv->next;
41126       }
41127     }
41128   }
41129 }
41130 
41131 #ifdef __cplusplus
41132 #if 0
41133 {
41134   /* c-mode */
41135 #endif
41136 }
41137 #endif
41138 
41139 
41140 
41141 #if defined(__cplusplus) && ! defined(XSPROTO)
41142 extern "C"
41143 #endif
41144 
XS(SWIG_init)41145 XS(SWIG_init) {
41146   dXSARGS;
41147   int i;
41148   (void)items;
41149 
41150   SWIG_InitializeModule(0);
41151 
41152   /* Install commands */
41153   for (i = 0; swig_commands[i].name; i++) {
41154     /* Casts only needed for Perl < 5.10. */
41155 #ifdef __cplusplus
41156     newXS(const_cast<char*>(swig_commands[i].name), swig_commands[i].wrapper, const_cast<char*>(__FILE__));
41157 #else
41158     newXS((char*)swig_commands[i].name, swig_commands[i].wrapper, (char*)__FILE__);
41159 #endif
41160   }
41161 
41162   /* Install variables */
41163   for (i = 0; swig_variables[i].name; i++) {
41164     SV *sv;
41165     sv = get_sv(swig_variables[i].name, TRUE | 0x2 | GV_ADDMULTI);
41166     if (swig_variables[i].type) {
41167       SWIG_MakePtr(sv,(void *)1, *swig_variables[i].type,0);
41168     } else {
41169       sv_setiv(sv,(IV) 0);
41170     }
41171     swig_create_magic(sv, swig_variables[i].name, swig_variables[i].set, swig_variables[i].get);
41172   }
41173 
41174   /* Install constant */
41175   for (i = 0; swig_constants[i].type; i++) {
41176     SV *sv;
41177     sv = get_sv(swig_constants[i].name, TRUE | 0x2 | GV_ADDMULTI);
41178     switch(swig_constants[i].type) {
41179     case SWIG_INT:
41180       sv_setiv(sv, (IV) swig_constants[i].lvalue);
41181       break;
41182     case SWIG_FLOAT:
41183       sv_setnv(sv, (double) swig_constants[i].dvalue);
41184       break;
41185     case SWIG_STRING:
41186       sv_setpv(sv, (const char *) swig_constants[i].pvalue);
41187       break;
41188     case SWIG_POINTER:
41189       SWIG_MakePtr(sv, swig_constants[i].pvalue, *(swig_constants[i].ptype),0);
41190       break;
41191     case SWIG_BINARY:
41192       SWIG_MakePackedObj(sv, swig_constants[i].pvalue, swig_constants[i].lvalue, *(swig_constants[i].ptype));
41193       break;
41194     default:
41195       break;
41196     }
41197     SvREADONLY_on(sv);
41198   }
41199 
41200 
41201   /* gdal_perl.i %init code */
41202   UseExceptions();
41203   if ( GDALGetDriverCount() == 0 ) {
41204     GDALAllRegister();
41205   }
41206 
41207   SWIG_TypeClientData(SWIGTYPE_p_VSILFILE, (void*) "Geo::GDAL::VSILFILE");
41208   SWIG_TypeClientData(SWIGTYPE_p_GDALMajorObjectShadow, (void*) "Geo::GDAL::MajorObject");
41209   SWIG_TypeClientData(SWIGTYPE_p_GDALDriverShadow, (void*) "Geo::GDAL::Driver");
41210   SWIG_TypeClientData(SWIGTYPE_p_GDAL_GCP, (void*) "Geo::GDAL::GCP");
41211   SWIG_TypeClientData(SWIGTYPE_p_GDALAsyncReaderShadow, (void*) "Geo::GDAL::AsyncReader");
41212   SWIG_TypeClientData(SWIGTYPE_p_GDALDatasetShadow, (void*) "Geo::GDAL::Dataset");
41213   SWIG_TypeClientData(SWIGTYPE_p_GDALGroupHS, (void*) "Geo::GDAL::Group");
41214   SWIG_TypeClientData(SWIGTYPE_p_Statistics, (void*) "Geo::GDAL::Statistics");
41215   SWIG_TypeClientData(SWIGTYPE_p_GDALMDArrayHS, (void*) "Geo::GDAL::MDArray");
41216   SWIG_TypeClientData(SWIGTYPE_p_GDALAttributeHS, (void*) "Geo::GDAL::Attribute");
41217   SWIG_TypeClientData(SWIGTYPE_p_GDALDimensionHS, (void*) "Geo::GDAL::Dimension");
41218   /*@SWIG:/home/even/install-swig-3.0.12/share/swig/3.0.12/perl5/perltypemaps.swg,65,%set_constant@*/ do {
41219     SV *sv = get_sv((char*) SWIG_prefix "GEDTC_NUMERIC", TRUE | 0x2 | GV_ADDMULTI);
41220     sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1(static_cast< int >(GEDTC_NUMERIC)));
41221     SvREADONLY_on(sv);
41222   } while(0) /*@SWIG@*/;
41223   /*@SWIG:/home/even/install-swig-3.0.12/share/swig/3.0.12/perl5/perltypemaps.swg,65,%set_constant@*/ do {
41224     SV *sv = get_sv((char*) SWIG_prefix "GEDTC_STRING", TRUE | 0x2 | GV_ADDMULTI);
41225     sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1(static_cast< int >(GEDTC_STRING)));
41226     SvREADONLY_on(sv);
41227   } while(0) /*@SWIG@*/;
41228   /*@SWIG:/home/even/install-swig-3.0.12/share/swig/3.0.12/perl5/perltypemaps.swg,65,%set_constant@*/ do {
41229     SV *sv = get_sv((char*) SWIG_prefix "GEDTC_COMPOUND", TRUE | 0x2 | GV_ADDMULTI);
41230     sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1(static_cast< int >(GEDTC_COMPOUND)));
41231     SvREADONLY_on(sv);
41232   } while(0) /*@SWIG@*/;
41233   SWIG_TypeClientData(SWIGTYPE_p_GDALExtendedDataTypeHS, (void*) "Geo::GDAL::ExtendedDataType");
41234   SWIG_TypeClientData(SWIGTYPE_p_GDALEDTComponentHS, (void*) "Geo::GDAL::EDTComponent");
41235   SWIG_TypeClientData(SWIGTYPE_p_GDALRasterBandShadow, (void*) "Geo::GDAL::Band");
41236   SWIG_TypeClientData(SWIGTYPE_p_GDALColorTableShadow, (void*) "Geo::GDAL::ColorTable");
41237   SWIG_TypeClientData(SWIGTYPE_p_GDALRasterAttributeTableShadow, (void*) "Geo::GDAL::RasterAttributeTable");
41238   /*@SWIG:/home/even/install-swig-3.0.12/share/swig/3.0.12/perl5/perltypemaps.swg,65,%set_constant@*/ do {
41239     SV *sv = get_sv((char*) SWIG_prefix "TermProgress", TRUE | 0x2 | GV_ADDMULTI);
41240     sv_setsv(sv, SWIG_NewFunctionPtrObj((void *)(int (*)(double,char const *,void *))(GDALTermProgress), SWIGTYPE_p_f_double_p_q_const__char_p_void__int));
41241     SvREADONLY_on(sv);
41242   } while(0) /*@SWIG@*/;
41243   /*@SWIG:/home/even/install-swig-3.0.12/share/swig/3.0.12/perl5/perltypemaps.swg,65,%set_constant@*/ do {
41244     SV *sv = get_sv((char*) SWIG_prefix "GVM_Diagonal", TRUE | 0x2 | GV_ADDMULTI);
41245     sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1(static_cast< int >(GVM_Diagonal)));
41246     SvREADONLY_on(sv);
41247   } while(0) /*@SWIG@*/;
41248   /*@SWIG:/home/even/install-swig-3.0.12/share/swig/3.0.12/perl5/perltypemaps.swg,65,%set_constant@*/ do {
41249     SV *sv = get_sv((char*) SWIG_prefix "GVM_Edge", TRUE | 0x2 | GV_ADDMULTI);
41250     sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1(static_cast< int >(GVM_Edge)));
41251     SvREADONLY_on(sv);
41252   } while(0) /*@SWIG@*/;
41253   /*@SWIG:/home/even/install-swig-3.0.12/share/swig/3.0.12/perl5/perltypemaps.swg,65,%set_constant@*/ do {
41254     SV *sv = get_sv((char*) SWIG_prefix "GVM_Max", TRUE | 0x2 | GV_ADDMULTI);
41255     sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1(static_cast< int >(GVM_Max)));
41256     SvREADONLY_on(sv);
41257   } while(0) /*@SWIG@*/;
41258   /*@SWIG:/home/even/install-swig-3.0.12/share/swig/3.0.12/perl5/perltypemaps.swg,65,%set_constant@*/ do {
41259     SV *sv = get_sv((char*) SWIG_prefix "GVM_Min", TRUE | 0x2 | GV_ADDMULTI);
41260     sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1(static_cast< int >(GVM_Min)));
41261     SvREADONLY_on(sv);
41262   } while(0) /*@SWIG@*/;
41263   /*@SWIG:/home/even/install-swig-3.0.12/share/swig/3.0.12/perl5/perltypemaps.swg,65,%set_constant@*/ do {
41264     SV *sv = get_sv((char*) SWIG_prefix "GVOT_NORMAL", TRUE | 0x2 | GV_ADDMULTI);
41265     sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1(static_cast< int >(GVOT_NORMAL)));
41266     SvREADONLY_on(sv);
41267   } while(0) /*@SWIG@*/;
41268   /*@SWIG:/home/even/install-swig-3.0.12/share/swig/3.0.12/perl5/perltypemaps.swg,65,%set_constant@*/ do {
41269     SV *sv = get_sv((char*) SWIG_prefix "GVOT_MIN_TARGET_HEIGHT_FROM_DEM", TRUE | 0x2 | GV_ADDMULTI);
41270     sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1(static_cast< int >(GVOT_MIN_TARGET_HEIGHT_FROM_DEM)));
41271     SvREADONLY_on(sv);
41272   } while(0) /*@SWIG@*/;
41273   /*@SWIG:/home/even/install-swig-3.0.12/share/swig/3.0.12/perl5/perltypemaps.swg,65,%set_constant@*/ do {
41274     SV *sv = get_sv((char*) SWIG_prefix "GVOT_MIN_TARGET_HEIGHT_FROM_GROUND", TRUE | 0x2 | GV_ADDMULTI);
41275     sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1(static_cast< int >(GVOT_MIN_TARGET_HEIGHT_FROM_GROUND)));
41276     SvREADONLY_on(sv);
41277   } while(0) /*@SWIG@*/;
41278   SWIG_TypeClientData(SWIGTYPE_p_GDALTransformerInfoShadow, (void*) "Geo::GDAL::Transformer");
41279   SWIG_TypeClientData(SWIGTYPE_p_GDALInfoOptions, (void*) "Geo::GDAL::GDALInfoOptions");
41280   SWIG_TypeClientData(SWIGTYPE_p_GDALMultiDimInfoOptions, (void*) "Geo::GDAL::GDALMultiDimInfoOptions");
41281   SWIG_TypeClientData(SWIGTYPE_p_GDALTranslateOptions, (void*) "Geo::GDAL::GDALTranslateOptions");
41282   SWIG_TypeClientData(SWIGTYPE_p_GDALWarpAppOptions, (void*) "Geo::GDAL::GDALWarpAppOptions");
41283   SWIG_TypeClientData(SWIGTYPE_p_GDALVectorTranslateOptions, (void*) "Geo::GDAL::GDALVectorTranslateOptions");
41284   SWIG_TypeClientData(SWIGTYPE_p_GDALDEMProcessingOptions, (void*) "Geo::GDAL::GDALDEMProcessingOptions");
41285   SWIG_TypeClientData(SWIGTYPE_p_GDALNearblackOptions, (void*) "Geo::GDAL::GDALNearblackOptions");
41286   SWIG_TypeClientData(SWIGTYPE_p_GDALGridOptions, (void*) "Geo::GDAL::GDALGridOptions");
41287   SWIG_TypeClientData(SWIGTYPE_p_GDALRasterizeOptions, (void*) "Geo::GDAL::GDALRasterizeOptions");
41288   SWIG_TypeClientData(SWIGTYPE_p_GDALBuildVRTOptions, (void*) "Geo::GDAL::GDALBuildVRTOptions");
41289   SWIG_TypeClientData(SWIGTYPE_p_GDALMultiDimTranslateOptions, (void*) "Geo::GDAL::GDALMultiDimTranslateOptions");
41290   ST(0) = &PL_sv_yes;
41291   XSRETURN(1);
41292 }
41293 
41294