/* ----------------------------------------------------------------------------
 * This file was automatically generated by SWIG (http://www.swig.org).
 * Version 1.3.40
 * 
 * This file is not intended to be easily readable and contains a number of 
 * coding conventions designed to improve portability and efficiency. Do not make
 * changes to this file unless you know what you are doing--modify the SWIG 
 * interface file instead. 
 * ----------------------------------------------------------------------------- */

#define SWIGPHP


#ifdef __cplusplus
/* SwigValueWrapper is described in swig.swg */
template<typename T> class SwigValueWrapper {
  struct SwigMovePointer {
    T *ptr;
    SwigMovePointer(T *p) : ptr(p) { }
    ~SwigMovePointer() { delete ptr; }
    SwigMovePointer& operator=(SwigMovePointer& rhs) { T* oldptr = ptr; ptr = 0; delete oldptr; ptr = rhs.ptr; rhs.ptr = 0; return *this; }
  } pointer;
  SwigValueWrapper& operator=(const SwigValueWrapper<T>& rhs);
  SwigValueWrapper(const SwigValueWrapper<T>& rhs);
public:
  SwigValueWrapper() : pointer(0) { }
  SwigValueWrapper& operator=(const T& t) { SwigMovePointer tmp(new T(t)); pointer = tmp; return *this; }
  operator T&() const { return *pointer.ptr; }
  T *operator&() { return pointer.ptr; }
};

template <typename T> T SwigValueInit() {
  return T();
}
#endif

/* -----------------------------------------------------------------------------
 *  This section contains generic SWIG labels for method/variable
 *  declarations/attributes, and other compiler dependent labels.
 * ----------------------------------------------------------------------------- */

/* template workaround for compilers that cannot correctly implement the C++ standard */
#ifndef SWIGTEMPLATEDISAMBIGUATOR
# if defined(__SUNPRO_CC) && (__SUNPRO_CC <= 0x560)
#  define SWIGTEMPLATEDISAMBIGUATOR template
# elif defined(__HP_aCC)
/* Needed even with `aCC -AA' when `aCC -V' reports HP ANSI C++ B3910B A.03.55 */
/* If we find a maximum version that requires this, the test would be __HP_aCC <= 35500 for A.03.55 */
#  define SWIGTEMPLATEDISAMBIGUATOR template
# else
#  define SWIGTEMPLATEDISAMBIGUATOR
# endif
#endif

/* inline attribute */
#ifndef SWIGINLINE
# if defined(__cplusplus) || (defined(__GNUC__) && !defined(__STRICT_ANSI__))
#   define SWIGINLINE inline
# else
#   define SWIGINLINE
# endif
#endif

/* attribute recognised by some compilers to avoid 'unused' warnings */
#ifndef SWIGUNUSED
# if defined(__GNUC__)
#   if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
#     define SWIGUNUSED __attribute__ ((__unused__)) 
#   else
#     define SWIGUNUSED
#   endif
# elif defined(__ICC)
#   define SWIGUNUSED __attribute__ ((__unused__)) 
# else
#   define SWIGUNUSED 
# endif
#endif

#ifndef SWIG_MSC_UNSUPPRESS_4505
# if defined(_MSC_VER)
#   pragma warning(disable : 4505) /* unreferenced local function has been removed */
# endif 
#endif

#ifndef SWIGUNUSEDPARM
# ifdef __cplusplus
#   define SWIGUNUSEDPARM(p)
# else
#   define SWIGUNUSEDPARM(p) p SWIGUNUSED 
# endif
#endif

/* internal SWIG method */
#ifndef SWIGINTERN
# define SWIGINTERN static SWIGUNUSED
#endif

/* internal inline SWIG method */
#ifndef SWIGINTERNINLINE
# define SWIGINTERNINLINE SWIGINTERN SWIGINLINE
#endif

/* exporting methods */
#if (__GNUC__ >= 4) || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)
#  ifndef GCC_HASCLASSVISIBILITY
#    define GCC_HASCLASSVISIBILITY
#  endif
#endif

#ifndef SWIGEXPORT
# if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__)
#   if defined(STATIC_LINKED)
#     define SWIGEXPORT
#   else
#     define SWIGEXPORT __declspec(dllexport)
#   endif
# else
#   if defined(__GNUC__) && defined(GCC_HASCLASSVISIBILITY)
#     define SWIGEXPORT __attribute__ ((visibility("default")))
#   else
#     define SWIGEXPORT
#   endif
# endif
#endif

/* calling conventions for Windows */
#ifndef SWIGSTDCALL
# if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__)
#   define SWIGSTDCALL __stdcall
# else
#   define SWIGSTDCALL
# endif 
#endif

/* Deal with Microsoft's attempt at deprecating C standard runtime functions */
#if !defined(SWIG_NO_CRT_SECURE_NO_DEPRECATE) && defined(_MSC_VER) && !defined(_CRT_SECURE_NO_DEPRECATE)
# define _CRT_SECURE_NO_DEPRECATE
#endif

/* Deal with Microsoft's attempt at deprecating methods in the standard C++ library */
#if !defined(SWIG_NO_SCL_SECURE_NO_DEPRECATE) && defined(_MSC_VER) && !defined(_SCL_SECURE_NO_DEPRECATE)
# define _SCL_SECURE_NO_DEPRECATE
#endif


/* -----------------------------------------------------------------------------
 * swigrun.swg
 *
 * This file contains generic C API SWIG runtime support for pointer
 * type checking.
 * ----------------------------------------------------------------------------- */

/* This should only be incremented when either the layout of swig_type_info changes,
   or for whatever reason, the runtime changes incompatibly */
#define SWIG_RUNTIME_VERSION "4"

/* define SWIG_TYPE_TABLE_NAME as "SWIG_TYPE_TABLE" */
#ifdef SWIG_TYPE_TABLE
# define SWIG_QUOTE_STRING(x) #x
# define SWIG_EXPAND_AND_QUOTE_STRING(x) SWIG_QUOTE_STRING(x)
# define SWIG_TYPE_TABLE_NAME SWIG_EXPAND_AND_QUOTE_STRING(SWIG_TYPE_TABLE)
#else
# define SWIG_TYPE_TABLE_NAME
#endif

/*
  You can use the SWIGRUNTIME and SWIGRUNTIMEINLINE macros for
  creating a static or dynamic library from the SWIG runtime code.
  In 99.9% of the cases, SWIG just needs to declare them as 'static'.

  But only do this if strictly necessary, i.e. if you have problems
  with your compiler or suchlike.
*/

#ifndef SWIGRUNTIME
# define SWIGRUNTIME SWIGINTERN
#endif

#ifndef SWIGRUNTIMEINLINE
# define SWIGRUNTIMEINLINE SWIGRUNTIME SWIGINLINE
#endif

/*  Generic buffer size */
#ifndef SWIG_BUFFER_SIZE
# define SWIG_BUFFER_SIZE 1024
#endif

/* Flags for pointer conversions */
#define SWIG_POINTER_DISOWN        0x1
#define SWIG_CAST_NEW_MEMORY       0x2

/* Flags for new pointer objects */
#define SWIG_POINTER_OWN           0x1


/* 
   Flags/methods for returning states.
   
   The SWIG conversion methods, as ConvertPtr, return and integer 
   that tells if the conversion was successful or not. And if not,
   an error code can be returned (see swigerrors.swg for the codes).
   
   Use the following macros/flags to set or process the returning
   states.
   
   In old versions of SWIG, code such as the following was usually written:

     if (SWIG_ConvertPtr(obj,vptr,ty.flags) != -1) {
       // success code
     } else {
       //fail code
     }

   Now you can be more explicit:

    int res = SWIG_ConvertPtr(obj,vptr,ty.flags);
    if (SWIG_IsOK(res)) {
      // success code
    } else {
      // fail code
    }

   which is the same really, but now you can also do

    Type *ptr;
    int res = SWIG_ConvertPtr(obj,(void **)(&ptr),ty.flags);
    if (SWIG_IsOK(res)) {
      // success code
      if (SWIG_IsNewObj(res) {
        ...
	delete *ptr;
      } else {
        ...
      }
    } else {
      // fail code
    }
    
   I.e., now SWIG_ConvertPtr can return new objects and you can
   identify the case and take care of the deallocation. Of course that
   also requires SWIG_ConvertPtr to return new result values, such as

      int SWIG_ConvertPtr(obj, ptr,...) {         
        if (<obj is ok>) {			       
          if (<need new object>) {		       
            *ptr = <ptr to new allocated object>; 
            return SWIG_NEWOBJ;		       
          } else {				       
            *ptr = <ptr to old object>;	       
            return SWIG_OLDOBJ;		       
          } 				       
        } else {				       
          return SWIG_BADOBJ;		       
        }					       
      }

   Of course, returning the plain '0(success)/-1(fail)' still works, but you can be
   more explicit by returning SWIG_BADOBJ, SWIG_ERROR or any of the
   SWIG errors code.

   Finally, if the SWIG_CASTRANK_MODE is enabled, the result code
   allows returning the 'cast rank', for example, if you have this

       int food(double)
       int fooi(int);

   and you call
 
      food(1)   // cast rank '1'  (1 -> 1.0)
      fooi(1)   // cast rank '0'

   just use the SWIG_AddCast()/SWIG_CheckState()
*/

#define SWIG_OK                    (0) 
#define SWIG_ERROR                 (-1)
#define SWIG_IsOK(r)               (r >= 0)
#define SWIG_ArgError(r)           ((r != SWIG_ERROR) ? r : SWIG_TypeError)  

/* The CastRankLimit says how many bits are used for the cast rank */
#define SWIG_CASTRANKLIMIT         (1 << 8)
/* The NewMask denotes the object was created (using new/malloc) */
#define SWIG_NEWOBJMASK            (SWIG_CASTRANKLIMIT  << 1)
/* The TmpMask is for in/out typemaps that use temporal objects */
#define SWIG_TMPOBJMASK            (SWIG_NEWOBJMASK << 1)
/* Simple returning values */
#define SWIG_BADOBJ                (SWIG_ERROR)
#define SWIG_OLDOBJ                (SWIG_OK)
#define SWIG_NEWOBJ                (SWIG_OK | SWIG_NEWOBJMASK)
#define SWIG_TMPOBJ                (SWIG_OK | SWIG_TMPOBJMASK)
/* Check, add and del mask methods */
#define SWIG_AddNewMask(r)         (SWIG_IsOK(r) ? (r | SWIG_NEWOBJMASK) : r)
#define SWIG_DelNewMask(r)         (SWIG_IsOK(r) ? (r & ~SWIG_NEWOBJMASK) : r)
#define SWIG_IsNewObj(r)           (SWIG_IsOK(r) && (r & SWIG_NEWOBJMASK))
#define SWIG_AddTmpMask(r)         (SWIG_IsOK(r) ? (r | SWIG_TMPOBJMASK) : r)
#define SWIG_DelTmpMask(r)         (SWIG_IsOK(r) ? (r & ~SWIG_TMPOBJMASK) : r)
#define SWIG_IsTmpObj(r)           (SWIG_IsOK(r) && (r & SWIG_TMPOBJMASK))

/* Cast-Rank Mode */
#if defined(SWIG_CASTRANK_MODE)
#  ifndef SWIG_TypeRank
#    define SWIG_TypeRank             unsigned long
#  endif
#  ifndef SWIG_MAXCASTRANK            /* Default cast allowed */
#    define SWIG_MAXCASTRANK          (2)
#  endif
#  define SWIG_CASTRANKMASK          ((SWIG_CASTRANKLIMIT) -1)
#  define SWIG_CastRank(r)           (r & SWIG_CASTRANKMASK)
SWIGINTERNINLINE int SWIG_AddCast(int r) { 
  return SWIG_IsOK(r) ? ((SWIG_CastRank(r) < SWIG_MAXCASTRANK) ? (r + 1) : SWIG_ERROR) : r;
}
SWIGINTERNINLINE int SWIG_CheckState(int r) { 
  return SWIG_IsOK(r) ? SWIG_CastRank(r) + 1 : 0; 
}
#else /* no cast-rank mode */
#  define SWIG_AddCast
#  define SWIG_CheckState(r) (SWIG_IsOK(r) ? 1 : 0)
#endif


#include <string.h>

#ifdef __cplusplus
extern "C" {
#endif

typedef void *(*swig_converter_func)(void *, int *);
typedef struct swig_type_info *(*swig_dycast_func)(void **);

/* Structure to store information on one type */
typedef struct swig_type_info {
  const char             *name;			/* mangled name of this type */
  const char             *str;			/* human readable name of this type */
  swig_dycast_func        dcast;		/* dynamic cast function down a hierarchy */
  struct swig_cast_info  *cast;			/* linked list of types that can cast into this type */
  void                   *clientdata;		/* language specific type data */
  int                    owndata;		/* flag if the structure owns the clientdata */
} swig_type_info;

/* Structure to store a type and conversion function used for casting */
typedef struct swig_cast_info {
  swig_type_info         *type;			/* pointer to type that is equivalent to this type */
  swig_converter_func     converter;		/* function to cast the void pointers */
  struct swig_cast_info  *next;			/* pointer to next cast in linked list */
  struct swig_cast_info  *prev;			/* pointer to the previous cast */
} swig_cast_info;

/* Structure used to store module information
 * Each module generates one structure like this, and the runtime collects
 * all of these structures and stores them in a circularly linked list.*/
typedef struct swig_module_info {
  swig_type_info         **types;		/* Array of pointers to swig_type_info structures that are in this module */
  size_t                 size;		        /* Number of types in this module */
  struct swig_module_info *next;		/* Pointer to next element in circularly linked list */
  swig_type_info         **type_initial;	/* Array of initially generated type structures */
  swig_cast_info         **cast_initial;	/* Array of initially generated casting structures */
  void                    *clientdata;		/* Language specific module data */
} swig_module_info;

/* 
  Compare two type names skipping the space characters, therefore
  "char*" == "char *" and "Class<int>" == "Class<int >", etc.

  Return 0 when the two name types are equivalent, as in
  strncmp, but skipping ' '.
*/
SWIGRUNTIME int
SWIG_TypeNameComp(const char *f1, const char *l1,
		  const char *f2, const char *l2) {
  for (;(f1 != l1) && (f2 != l2); ++f1, ++f2) {
    while ((*f1 == ' ') && (f1 != l1)) ++f1;
    while ((*f2 == ' ') && (f2 != l2)) ++f2;
    if (*f1 != *f2) return (*f1 > *f2) ? 1 : -1;
  }
  return (int)((l1 - f1) - (l2 - f2));
}

/*
  Check type equivalence in a name list like <name1>|<name2>|...
  Return 0 if not equal, 1 if equal
*/
SWIGRUNTIME int
SWIG_TypeEquiv(const char *nb, const char *tb) {
  int equiv = 0;
  const char* te = tb + strlen(tb);
  const char* ne = nb;
  while (!equiv && *ne) {
    for (nb = ne; *ne; ++ne) {
      if (*ne == '|') break;
    }
    equiv = (SWIG_TypeNameComp(nb, ne, tb, te) == 0) ? 1 : 0;
    if (*ne) ++ne;
  }
  return equiv;
}

/*
  Check type equivalence in a name list like <name1>|<name2>|...
  Return 0 if equal, -1 if nb < tb, 1 if nb > tb
*/
SWIGRUNTIME int
SWIG_TypeCompare(const char *nb, const char *tb) {
  int equiv = 0;
  const char* te = tb + strlen(tb);
  const char* ne = nb;
  while (!equiv && *ne) {
    for (nb = ne; *ne; ++ne) {
      if (*ne == '|') break;
    }
    equiv = (SWIG_TypeNameComp(nb, ne, tb, te) == 0) ? 1 : 0;
    if (*ne) ++ne;
  }
  return equiv;
}


/*
  Check the typename
*/
SWIGRUNTIME swig_cast_info *
SWIG_TypeCheck(const char *c, swig_type_info *ty) {
  if (ty) {
    swig_cast_info *iter = ty->cast;
    while (iter) {
      if (strcmp(iter->type->name, c) == 0) {
        if (iter == ty->cast)
          return iter;
        /* Move iter to the top of the linked list */
        iter->prev->next = iter->next;
        if (iter->next)
          iter->next->prev = iter->prev;
        iter->next = ty->cast;
        iter->prev = 0;
        if (ty->cast) ty->cast->prev = iter;
        ty->cast = iter;
        return iter;
      }
      iter = iter->next;
    }
  }
  return 0;
}

/* 
  Identical to SWIG_TypeCheck, except strcmp is replaced with a pointer comparison
*/
SWIGRUNTIME swig_cast_info *
SWIG_TypeCheckStruct(swig_type_info *from, swig_type_info *ty) {
  if (ty) {
    swig_cast_info *iter = ty->cast;
    while (iter) {
      if (iter->type == from) {
        if (iter == ty->cast)
          return iter;
        /* Move iter to the top of the linked list */
        iter->prev->next = iter->next;
        if (iter->next)
          iter->next->prev = iter->prev;
        iter->next = ty->cast;
        iter->prev = 0;
        if (ty->cast) ty->cast->prev = iter;
        ty->cast = iter;
        return iter;
      }
      iter = iter->next;
    }
  }
  return 0;
}

/*
  Cast a pointer up an inheritance hierarchy
*/
SWIGRUNTIMEINLINE void *
SWIG_TypeCast(swig_cast_info *ty, void *ptr, int *newmemory) {
  return ((!ty) || (!ty->converter)) ? ptr : (*ty->converter)(ptr, newmemory);
}

/* 
   Dynamic pointer casting. Down an inheritance hierarchy
*/
SWIGRUNTIME swig_type_info *
SWIG_TypeDynamicCast(swig_type_info *ty, void **ptr) {
  swig_type_info *lastty = ty;
  if (!ty || !ty->dcast) return ty;
  while (ty && (ty->dcast)) {
    ty = (*ty->dcast)(ptr);
    if (ty) lastty = ty;
  }
  return lastty;
}

/*
  Return the name associated with this type
*/
SWIGRUNTIMEINLINE const char *
SWIG_TypeName(const swig_type_info *ty) {
  return ty->name;
}

/*
  Return the pretty name associated with this type,
  that is an unmangled type name in a form presentable to the user.
*/
SWIGRUNTIME const char *
SWIG_TypePrettyName(const swig_type_info *type) {
  /* The "str" field contains the equivalent pretty names of the
     type, separated by vertical-bar characters.  We choose
     to print the last name, as it is often (?) the most
     specific. */
  if (!type) return NULL;
  if (type->str != NULL) {
    const char *last_name = type->str;
    const char *s;
    for (s = type->str; *s; s++)
      if (*s == '|') last_name = s+1;
    return last_name;
  }
  else
    return type->name;
}

/* 
   Set the clientdata field for a type
*/
SWIGRUNTIME void
SWIG_TypeClientData(swig_type_info *ti, void *clientdata) {
  swig_cast_info *cast = ti->cast;
  /* if (ti->clientdata == clientdata) return; */
  ti->clientdata = clientdata;
  
  while (cast) {
    if (!cast->converter) {
      swig_type_info *tc = cast->type;
      if (!tc->clientdata) {
	SWIG_TypeClientData(tc, clientdata);
      }
    }    
    cast = cast->next;
  }
}
SWIGRUNTIME void
SWIG_TypeNewClientData(swig_type_info *ti, void *clientdata) {
  SWIG_TypeClientData(ti, clientdata);
  ti->owndata = 1;
}
  
/*
  Search for a swig_type_info structure only by mangled name
  Search is a O(log #types)
  
  We start searching at module start, and finish searching when start == end.  
  Note: if start == end at the beginning of the function, we go all the way around
  the circular list.
*/
SWIGRUNTIME swig_type_info *
SWIG_MangledTypeQueryModule(swig_module_info *start, 
                            swig_module_info *end, 
		            const char *name) {
  swig_module_info *iter = start;
  do {
    if (iter->size) {
      register size_t l = 0;
      register size_t r = iter->size - 1;
      do {
	/* since l+r >= 0, we can (>> 1) instead (/ 2) */
	register size_t i = (l + r) >> 1; 
	const char *iname = iter->types[i]->name;
	if (iname) {
	  register int compare = strcmp(name, iname);
	  if (compare == 0) {	    
	    return iter->types[i];
	  } else if (compare < 0) {
	    if (i) {
	      r = i - 1;
	    } else {
	      break;
	    }
	  } else if (compare > 0) {
	    l = i + 1;
	  }
	} else {
	  break; /* should never happen */
	}
      } while (l <= r);
    }
    iter = iter->next;
  } while (iter != end);
  return 0;
}

/*
  Search for a swig_type_info structure for either a mangled name or a human readable name.
  It first searches the mangled names of the types, which is a O(log #types)
  If a type is not found it then searches the human readable names, which is O(#types).
  
  We start searching at module start, and finish searching when start == end.  
  Note: if start == end at the beginning of the function, we go all the way around
  the circular list.
*/
SWIGRUNTIME swig_type_info *
SWIG_TypeQueryModule(swig_module_info *start, 
                     swig_module_info *end, 
		     const char *name) {
  /* STEP 1: Search the name field using binary search */
  swig_type_info *ret = SWIG_MangledTypeQueryModule(start, end, name);
  if (ret) {
    return ret;
  } else {
    /* STEP 2: If the type hasn't been found, do a complete search
       of the str field (the human readable name) */
    swig_module_info *iter = start;
    do {
      register size_t i = 0;
      for (; i < iter->size; ++i) {
	if (iter->types[i]->str && (SWIG_TypeEquiv(iter->types[i]->str, name)))
	  return iter->types[i];
      }
      iter = iter->next;
    } while (iter != end);
  }
  
  /* neither found a match */
  return 0;
}

/* 
   Pack binary data into a string
*/
SWIGRUNTIME char *
SWIG_PackData(char *c, void *ptr, size_t sz) {
  static const char hex[17] = "0123456789abcdef";
  register const unsigned char *u = (unsigned char *) ptr;
  register const unsigned char *eu =  u + sz;
  for (; u != eu; ++u) {
    register unsigned char uu = *u;
    *(c++) = hex[(uu & 0xf0) >> 4];
    *(c++) = hex[uu & 0xf];
  }
  return c;
}

/* 
   Unpack binary data from a string
*/
SWIGRUNTIME const char *
SWIG_UnpackData(const char *c, void *ptr, size_t sz) {
  register unsigned char *u = (unsigned char *) ptr;
  register const unsigned char *eu = u + sz;
  for (; u != eu; ++u) {
    register char d = *(c++);
    register unsigned char uu;
    if ((d >= '0') && (d <= '9'))
      uu = ((d - '0') << 4);
    else if ((d >= 'a') && (d <= 'f'))
      uu = ((d - ('a'-10)) << 4);
    else 
      return (char *) 0;
    d = *(c++);
    if ((d >= '0') && (d <= '9'))
      uu |= (d - '0');
    else if ((d >= 'a') && (d <= 'f'))
      uu |= (d - ('a'-10));
    else 
      return (char *) 0;
    *u = uu;
  }
  return c;
}

/* 
   Pack 'void *' into a string buffer.
*/
SWIGRUNTIME char *
SWIG_PackVoidPtr(char *buff, void *ptr, const char *name, size_t bsz) {
  char *r = buff;
  if ((2*sizeof(void *) + 2) > bsz) return 0;
  *(r++) = '_';
  r = SWIG_PackData(r,&ptr,sizeof(void *));
  if (strlen(name) + 1 > (bsz - (r - buff))) return 0;
  strcpy(r,name);
  return buff;
}

SWIGRUNTIME const char *
SWIG_UnpackVoidPtr(const char *c, void **ptr, const char *name) {
  if (*c != '_') {
    if (strcmp(c,"NULL") == 0) {
      *ptr = (void *) 0;
      return name;
    } else {
      return 0;
    }
  }
  return SWIG_UnpackData(++c,ptr,sizeof(void *));
}

SWIGRUNTIME char *
SWIG_PackDataName(char *buff, void *ptr, size_t sz, const char *name, size_t bsz) {
  char *r = buff;
  size_t lname = (name ? strlen(name) : 0);
  if ((2*sz + 2 + lname) > bsz) return 0;
  *(r++) = '_';
  r = SWIG_PackData(r,ptr,sz);
  if (lname) {
    strncpy(r,name,lname+1);
  } else {
    *r = 0;
  }
  return buff;
}

SWIGRUNTIME const char *
SWIG_UnpackDataName(const char *c, void *ptr, size_t sz, const char *name) {
  if (*c != '_') {
    if (strcmp(c,"NULL") == 0) {
      memset(ptr,0,sz);
      return name;
    } else {
      return 0;
    }
  }
  return SWIG_UnpackData(++c,ptr,sz);
}

#ifdef __cplusplus
}
#endif

/* -----------------------------------------------------------------------------
 * See the LICENSE file for information on copyright, usage and redistribution
 * of SWIG, and the README file for authors - http://www.swig.org/release.html.
 *
 * phprun.swg
 *
 * PHP runtime library
 * ----------------------------------------------------------------------------- */

#ifdef __cplusplus
extern "C" {
#endif
#include "zend.h"
#include "zend_API.h"
#include "php.h"
#include "ext/standard/php_string.h"

#ifdef ZEND_RAW_FENTRY
/* ZEND_RAW_FENTRY was added somewhere between 5.2.0 and 5.2.3 */
# define SWIG_ZEND_NAMED_FE(ZN, N, A) ZEND_RAW_FENTRY((char*)#ZN, N, A, 0)
#else
/* This causes warnings from GCC >= 4.2 (assigning a string literal to char*).
 * But this seems to be unavoidable without directly assuming knowledge of
 * the structure, which changed between PHP4 and PHP5. */
# define SWIG_ZEND_NAMED_FE(ZN, N, A) ZEND_NAMED_FE(ZN, N, A)
#endif

#ifndef Z_SET_ISREF_P
// For PHP < 5.3
# define Z_SET_ISREF_P(z) (z)->is_ref = 1
#endif
#ifndef Z_SET_REFCOUNT_P
// For PHP < 5.3
# define Z_SET_REFCOUNT_P(z, rc) (z)->refcount = (rc)
#endif

#define SWIG_LONG_CONSTANT(N, V) zend_register_long_constant((char*)#N, sizeof(#N), V, CONST_CS | CONST_PERSISTENT, module_number TSRMLS_CC)
#define SWIG_DOUBLE_CONSTANT(N, V) zend_register_double_constant((char*)#N, sizeof(#N), V, CONST_CS | CONST_PERSISTENT, module_number TSRMLS_CC)
#define SWIG_STRING_CONSTANT(N, V) zend_register_stringl_constant((char*)#N, sizeof(#N), V, strlen(V), CONST_CS | CONST_PERSISTENT, module_number TSRMLS_CC)
#define SWIG_CHAR_CONSTANT(N, V) do {\
    static char swig_char = (V);\
    zend_register_stringl_constant((char*)#N, sizeof(#N), &swig_char, 1, CONST_CS | CONST_PERSISTENT, module_number TSRMLS_CC);\
} while (0)

/* These TSRMLS_ stuff should already be defined now, but with older php under
   redhat are not... */
#ifndef TSRMLS_D
#define TSRMLS_D
#endif
#ifndef TSRMLS_DC
#define TSRMLS_DC
#endif
#ifndef TSRMLS_C
#define TSRMLS_C
#endif
#ifndef TSRMLS_CC
#define TSRMLS_CC
#endif

#ifdef __cplusplus
}
#endif

/* But in fact SWIG_ConvertPtr is the native interface for getting typed
   pointer values out of zvals.  We need the TSRMLS_ macros for when we
   make PHP type calls later as we handle php resources */
#define SWIG_ConvertPtr(obj,pp,type,flags) SWIG_ZTS_ConvertPtr(obj,pp,type,flags TSRMLS_CC)


#define SWIG_fail goto fail

static const char *default_error_msg = "Unknown error occurred";
static int default_error_code = E_ERROR;

#define SWIG_PHP_Arg_Error_Msg(argnum,extramsg) "Error in argument " #argnum " "#extramsg

#define SWIG_PHP_Error(code,msg) do { SWIG_ErrorCode() = code; SWIG_ErrorMsg() = msg; SWIG_fail; } while (0)

#define SWIG_contract_assert(expr,msg) \
  if (!(expr) ) { zend_printf("Contract Assert Failed %s\n",msg ); } else

/* Standard SWIG API */
#define SWIG_GetModule(clientdata) SWIG_Php_GetModule()
#define SWIG_SetModule(clientdata, pointer) SWIG_Php_SetModule(pointer)

/* used to wrap returned objects in so we know whether they are newobject
   and need freeing, or not */
typedef struct {
  void * ptr;
  int newobject;
} swig_object_wrapper;

/* empty zend destructor for types without one */
static ZEND_RSRC_DTOR_FUNC(SWIG_landfill) { (void)rsrc; }

#define SWIG_SetPointerZval(a,b,c,d) SWIG_ZTS_SetPointerZval(a,b,c,d TSRMLS_CC)
#define SWIG_as_voidptr(a) const_cast< void * >(static_cast< const void * >(a))

static void
SWIG_ZTS_SetPointerZval(zval *z, void *ptr, swig_type_info *type, int newobject TSRMLS_DC) {
  swig_object_wrapper *value=NULL;
  /*
   * First test for Null pointers.  Return those as PHP native NULL
   */
  if (!ptr ) {
    ZVAL_NULL(z);
    return;
  }
  if (type->clientdata) {
    if (! (*(int *)(type->clientdata)))
      zend_error(E_ERROR, "Type: %s failed to register with zend",type->name);
    value=(swig_object_wrapper *)emalloc(sizeof(swig_object_wrapper));
    value->ptr=ptr;
    value->newobject=newobject;
    if (newobject <= 1) {
      /* Just register the pointer as a resource. */
      ZEND_REGISTER_RESOURCE(z, value, *(int *)(type->clientdata));
    } else {
      /*
       * Wrap the resource in an object, the resource will be accessible
       * via the "_cPtr" member. This is currently only used by
       * directory typemaps.
       */
      value->newobject = 0;
      zval *resource;
      MAKE_STD_ZVAL(resource);
      ZEND_REGISTER_RESOURCE(resource, value, *(int *)(type->clientdata));
      zend_class_entry **ce = NULL;
      zval *classname;
      MAKE_STD_ZVAL(classname);
      /* _p_Foo -> Foo */
      ZVAL_STRING(classname, (char*)type->name+3, 1);
      /* class names are stored in lowercase */
      php_strtolower(Z_STRVAL_PP(&classname), Z_STRLEN_PP(&classname));
      if (zend_lookup_class(Z_STRVAL_P(classname), Z_STRLEN_P(classname), &ce TSRMLS_CC) != SUCCESS) {
        /* class does not exist */
        object_init(z);
      } else {
        object_init_ex(z, *ce);
      }
      Z_SET_REFCOUNT_P(z, 1);
      Z_SET_ISREF_P(z);
      zend_hash_update(HASH_OF(z), (char*)"_cPtr", sizeof("_cPtr"), (void*)&resource, sizeof(zval), NULL);
      FREE_ZVAL(classname);
    }
    return;
  }
  zend_error(E_ERROR, "Type: %s not registered with zend",type->name);
}

/* This pointer conversion routine takes the native pointer p (along with
   its type name) and converts it by calling appropriate casting functions
   according to ty.  The resultant pointer is returned, or NULL is returned
   if the pointer can't be cast.

   Sadly PHP has no API to find a type name from a type id, only from an
   instance of a resource of the type id, so we have to pass type_name as well.

   The two functions which might call this are:
   SWIG_ZTS_ConvertResourcePtr which gets the type name from the resource
   and the registered zend destructors for which we have one per type each
   with the type name hard wired in. */
static void *
SWIG_ZTS_ConvertResourceData(void * p, const char *type_name, swig_type_info *ty TSRMLS_DC) {
  swig_cast_info *tc;
  void *result = 0;

  if (!ty) {
    /* They don't care about the target type, so just pass on the pointer! */
    return p;
  }

  if (! type_name) {  
    /* can't convert p to ptr type ty if we don't know what type p is */
    return NULL;
  }

  /* convert and cast p from type_name to ptr as ty. */
  tc = SWIG_TypeCheck(type_name, ty);
  if (tc) {
    int newmemory = 0;
    result = SWIG_TypeCast(tc, p, &newmemory);
    assert(!newmemory); /* newmemory handling not yet implemented */
  }
  return result;
}

/* This function returns a pointer of type ty by extracting the pointer
   and type info from the resource in z.  z must be a resource.
   If it fails, NULL is returned.
   It uses SWIG_ZTS_ConvertResourceData to do the real work. */
static void *
SWIG_ZTS_ConvertResourcePtr(zval *z, swig_type_info *ty, int flags TSRMLS_DC) {
  swig_object_wrapper *value;
  void *p;
  int type;
  char *type_name;

  value = (swig_object_wrapper *) zend_list_find(z->value.lval, &type);
  if ( flags & SWIG_POINTER_DISOWN ) {
    value->newobject = 0;
  }
  p = value->ptr;
  if (type==-1) return NULL;

  type_name=zend_rsrc_list_get_rsrc_type(z->value.lval TSRMLS_CC);

  return SWIG_ZTS_ConvertResourceData(p, type_name, ty TSRMLS_CC);
}

/* We allow passing of a RESOURCE pointing to the object or an OBJECT whose
   _cPtr is a resource pointing to the object */
static int
SWIG_ZTS_ConvertPtr(zval *z, void **ptr, swig_type_info *ty, int flags TSRMLS_DC) {
  if (z == NULL) {
    *ptr = 0;
    return 0;
  }

  switch (z->type) {
    case IS_OBJECT: {
      zval ** _cPtr;
      if (zend_hash_find(HASH_OF(z),(char*)"_cPtr",sizeof("_cPtr"),(void**)&_cPtr)==SUCCESS) {
	if ((*_cPtr)->type==IS_RESOURCE) {
	  *ptr = SWIG_ZTS_ConvertResourcePtr(*_cPtr, ty, flags TSRMLS_CC);
	  return (*ptr == NULL ? -1 : 0);
	}
      }
      break;
    }
    case IS_RESOURCE:
      *ptr = SWIG_ZTS_ConvertResourcePtr(z, ty, flags TSRMLS_CC);
      return (*ptr == NULL ? -1 : 0);
    case IS_NULL:
      *ptr = 0;
      return 0;
  }

  return -1;
}

static char const_name[] = "swig_runtime_data_type_pointer";
static swig_module_info *SWIG_Php_GetModule() {
  zval *pointer;
  swig_module_info *ret = 0;

  MAKE_STD_ZVAL(pointer);

  TSRMLS_FETCH();

  if (zend_get_constant(const_name, sizeof(const_name), pointer TSRMLS_CC)) {
    if (pointer->type == IS_LONG) {
      ret = (swig_module_info *) pointer->value.lval;
    }
  } 
  FREE_ZVAL(pointer);
  return ret; 
}

static void SWIG_Php_SetModule(swig_module_info *pointer) {
  TSRMLS_FETCH();
  REGISTER_MAIN_LONG_CONSTANT(const_name, (long) pointer, 0);
}

/*  Errors in SWIG */
#define  SWIG_UnknownError    	   -1 
#define  SWIG_IOError        	   -2 
#define  SWIG_RuntimeError   	   -3 
#define  SWIG_IndexError     	   -4 
#define  SWIG_TypeError      	   -5 
#define  SWIG_DivisionByZero 	   -6 
#define  SWIG_OverflowError  	   -7 
#define  SWIG_SyntaxError    	   -8 
#define  SWIG_ValueError     	   -9 
#define  SWIG_SystemError    	   -10
#define  SWIG_AttributeError 	   -11
#define  SWIG_MemoryError    	   -12 
#define  SWIG_NullReferenceError   -13




/* -------- TYPES TABLE (BEGIN) -------- */

#define SWIGTYPE_p_CPLErrorHandler swig_types[0]
#define SWIGTYPE_p_CPLXMLNode swig_types[1]
#define SWIGTYPE_p_GByte swig_types[2]
#define SWIGTYPE_p_GDALAsyncReaderShadow swig_types[3]
#define SWIGTYPE_p_GDALColorEntry swig_types[4]
#define SWIGTYPE_p_GDALColorTableShadow swig_types[5]
#define SWIGTYPE_p_GDALDatasetShadow swig_types[6]
#define SWIGTYPE_p_GDALDriverShadow swig_types[7]
#define SWIGTYPE_p_GDALMajorObjectShadow swig_types[8]
#define SWIGTYPE_p_GDALProgressFunc swig_types[9]
#define SWIGTYPE_p_GDALRasterAttributeTableShadow swig_types[10]
#define SWIGTYPE_p_GDALRasterBandShadow swig_types[11]
#define SWIGTYPE_p_GDALTransformerInfoShadow swig_types[12]
#define SWIGTYPE_p_GDAL_GCP swig_types[13]
#define SWIGTYPE_p_OGRLayerShadow swig_types[14]
#define SWIGTYPE_p_char swig_types[15]
#define SWIGTYPE_p_double swig_types[16]
#define SWIGTYPE_p_f_double_p_q_const__char_p_void__int swig_types[17]
#define SWIGTYPE_p_int swig_types[18]
#define SWIGTYPE_p_p_GDALRasterBandShadow swig_types[19]
#define SWIGTYPE_p_p_GDAL_GCP swig_types[20]
#define SWIGTYPE_p_p_char swig_types[21]
#define SWIGTYPE_p_p_int swig_types[22]
#define SWIGTYPE_p_p_void swig_types[23]
#define SWIGTYPE_p_void swig_types[24]
static swig_type_info *swig_types[26];
static swig_module_info swig_module = {swig_types, 25, 0, 0, 0, 0};
#define SWIG_TypeQuery(name) SWIG_TypeQueryModule(&swig_module, &swig_module, name)
#define SWIG_MangledTypeQuery(name) SWIG_MangledTypeQueryModule(&swig_module, &swig_module, name)

/* -------- TYPES TABLE (END) -------- */

/* header section */
ZEND_BEGIN_MODULE_GLOBALS(gdal)
const char *error_msg;
int error_code;
ZEND_END_MODULE_GLOBALS(gdal)
ZEND_DECLARE_MODULE_GLOBALS(gdal)
#ifdef ZTS
#define SWIG_ErrorMsg() TSRMG(gdal_globals_id, zend_gdal_globals *, error_msg )
#define SWIG_ErrorCode() TSRMG(gdal_globals_id, zend_gdal_globals *, error_code )
#else
#define SWIG_ErrorMsg() (gdal_globals.error_msg)
#define SWIG_ErrorCode() (gdal_globals.error_code)
#endif

static void gdal_init_globals(zend_gdal_globals *globals ) {
  globals->error_msg = default_error_msg;
  globals->error_code = default_error_code;
}
static void gdal_destroy_globals(zend_gdal_globals * globals) { (void)globals; }

static void SWIG_ResetError() {
  TSRMLS_FETCH();
  SWIG_ErrorMsg() = default_error_msg;
  SWIG_ErrorCode() = default_error_code;
}

ZEND_NAMED_FUNCTION(_wrap_swig_gdal_alter_newobject) {
  zval **args[2];
  swig_object_wrapper *value;
  int type;
  int thisown;

  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 2 || zend_get_parameters_array_ex(2, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }

  value = (swig_object_wrapper *) zend_list_find((*args[0])->value.lval, &type);
  value->newobject = zval_is_true(*args[1]);

  return;
}
ZEND_NAMED_FUNCTION(_wrap_swig_gdal_get_newobject) {
  zval **args[1];
  swig_object_wrapper *value;
  int type;

  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 1 || zend_get_parameters_array_ex(1, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }

  value = (swig_object_wrapper *) zend_list_find((*args[0])->value.lval, &type);
  RETVAL_LONG(value->newobject);

  return;
}
#define SWIG_name  "gdal"
#ifdef __cplusplus
extern "C" {
#endif
#include "php.h"
#include "php_ini.h"
#include "ext/standard/info.h"
#include "php_gdal.h"
#ifdef __cplusplus
}
#endif


#include <iostream>
using namespace std;

#include "cpl_port.h"
#include "cpl_string.h"
#include "cpl_multiproc.h"

#include "gdal.h"
#include "gdal_priv.h"
#include "gdal_alg.h"
#include "gdalwarper.h"

typedef void GDALMajorObjectShadow;
typedef void GDALDriverShadow;
typedef void GDALDatasetShadow;
typedef void GDALRasterBandShadow;
typedef void GDALColorTableShadow;
typedef void GDALRasterAttributeTableShadow;
typedef void GDALTransformerInfoShadow;
typedef void GDALAsyncReaderShadow;

/* use this to not return the int returned by GDAL */
typedef int RETURN_NONE;



#if PHP_MAJOR_VERSION < 5
# define SWIG_exception(code, msg) { zend_error(E_ERROR, msg); }
#else
# include "zend_exceptions.h"
# define SWIG_exception(code, msg) { zend_throw_exception(NULL, (char*)msg, code TSRMLS_CC); }
#endif


#include <stdexcept>


typedef char retStringAndCPLFree;


  void Debug( const char *msg_class, const char *message ) {
    CPLDebug( msg_class, "%s", message );
  }

  CPLErr PushErrorHandler( char const * pszCallbackName = NULL ) {
    CPLErrorHandler pfnHandler = NULL;
    if( pszCallbackName == NULL || EQUAL(pszCallbackName,"CPLQuietErrorHandler") )
      pfnHandler = CPLQuietErrorHandler;
    else if( EQUAL(pszCallbackName,"CPLDefaultErrorHandler") )
      pfnHandler = CPLDefaultErrorHandler;
    else if( EQUAL(pszCallbackName,"CPLLoggingErrorHandler") )
      pfnHandler = CPLLoggingErrorHandler;

    if ( pfnHandler == NULL )
      return CE_Fatal;

    CPLPushErrorHandler( pfnHandler );

    return CE_None;
  }



  void Error( CPLErr msg_class = CE_Failure, int err_code = 0, const char* msg = "error" ) {
    CPLError( msg_class, err_code, "%s", msg );
  }


char* EscapeString(int len, char *bin_string , int scheme=CPLES_SQL) {
    return CPLEscapeString(bin_string, len, scheme);
} 


const char *wrapper_CPLGetConfigOption( const char * pszKey, const char * pszDefault = NULL )
{
    return CPLGetConfigOption( pszKey, pszDefault );
}


void wrapper_VSIFileFromMemBuffer( const char* utf8_path, int nBytes, const GByte *pabyData)
{
    GByte* pabyDataDup = (GByte*)VSIMalloc(nBytes);
    if (pabyDataDup == NULL)
            return;
    memcpy(pabyDataDup, pabyData, nBytes);
    VSIFCloseL(VSIFileFromMemBuffer(utf8_path, (GByte*) pabyDataDup, nBytes, TRUE));
}



int wrapper_HasThreadSupport()
{
    return strcmp(CPLGetThreadingModel(), "stub") != 0;
}

SWIGINTERN char const *GDALMajorObjectShadow_GetDescription(GDALMajorObjectShadow *self){
    return GDALGetDescription( self );
  }
SWIGINTERN void GDALMajorObjectShadow_SetDescription(GDALMajorObjectShadow *self,char const *pszNewDesc){
    GDALSetDescription( self, pszNewDesc );
  }
SWIGINTERN char **GDALMajorObjectShadow_GetMetadata_Dict(GDALMajorObjectShadow *self,char const *pszDomain=""){
    return GDALGetMetadata( self, pszDomain );
  }
SWIGINTERN char **GDALMajorObjectShadow_GetMetadata_List(GDALMajorObjectShadow *self,char const *pszDomain=""){
    return GDALGetMetadata( self, pszDomain );
  }
SWIGINTERN CPLErr GDALMajorObjectShadow_SetMetadata__SWIG_0(GDALMajorObjectShadow *self,char **papszMetadata,char const *pszDomain=""){
    return GDALSetMetadata( self, papszMetadata, pszDomain );
  }
SWIGINTERN CPLErr GDALMajorObjectShadow_SetMetadata__SWIG_1(GDALMajorObjectShadow *self,char *pszMetadataString,char const *pszDomain=""){
    char *tmpList[2];
    tmpList[0] = pszMetadataString;
    tmpList[1] = 0;
    return GDALSetMetadata( self, tmpList, pszDomain );
  }
SWIGINTERN char const *GDALMajorObjectShadow_GetMetadataItem(GDALMajorObjectShadow *self,char const *pszName,char const *pszDomain=""){
    return GDALGetMetadataItem( self, pszName, pszDomain);
  }
SWIGINTERN CPLErr GDALMajorObjectShadow_SetMetadataItem(GDALMajorObjectShadow *self,char const *pszName,char const *pszValue,char const *pszDomain=""){
    return GDALSetMetadataItem( self, pszName, pszValue, pszDomain);
  }
SWIGINTERN GDALDatasetShadow *GDALDriverShadow_Create(GDALDriverShadow *self,char const *utf8_path,int xsize,int ysize,int bands=1,GDALDataType eType=GDT_Byte,char **options=0){

    GDALDatasetShadow* ds = (GDALDatasetShadow*) GDALCreate(    self, 
                                                                utf8_path, 
                                                                xsize, 
                                                                ysize, 
                                                                bands, 
                                                                eType, 
                                                                options );
    return ds;
  }
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){

    GDALDatasetShadow *ds = (GDALDatasetShadow*) GDALCreateCopy(    self, 
                                                                    utf8_path, 
                                                                    src, 
                                                                    strict, 
                                                                    options, 
                                                                    callback, 
                                                                    callback_data );
    return ds;
  }
SWIGINTERN int GDALDriverShadow_Delete(GDALDriverShadow *self,char const *utf8_path){
    return GDALDeleteDataset( self, utf8_path );
  }
SWIGINTERN int GDALDriverShadow_Rename(GDALDriverShadow *self,char const *newName,char const *oldName){
    return GDALRenameDataset( self, newName, oldName );
  }
SWIGINTERN int GDALDriverShadow_Register(GDALDriverShadow *self){
    return GDALRegisterDriver( self );
  }
SWIGINTERN void GDALDriverShadow_Deregister(GDALDriverShadow *self){
    GDALDeregisterDriver( self );
  }

char const *GDALDriverShadow_ShortName_get( GDALDriverShadow *h ) {
  return GDALGetDriverShortName( h );
}
char const *GDALDriverShadow_LongName_get( GDALDriverShadow *h ) {
  return GDALGetDriverLongName( h );
}
char const *GDALDriverShadow_HelpTopic_get( GDALDriverShadow *h ) {
  return GDALGetDriverHelpTopic( h );
}

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=""){

    GDAL_GCP *self = (GDAL_GCP*) CPLMalloc( sizeof( GDAL_GCP ) );
    self->dfGCPX = x;
    self->dfGCPY = y;
    self->dfGCPZ = z;
    self->dfGCPPixel = pixel;
    self->dfGCPLine = line;
    self->pszInfo =  CPLStrdup( (info == 0) ? "" : info );
    self->pszId = CPLStrdup( (id==0)? "" : id );
    return self;
  }
SWIGINTERN void delete_GDAL_GCP(GDAL_GCP *self){
    if ( self->pszInfo )
      CPLFree( self->pszInfo );
    if ( self->pszId )
      CPLFree( self->pszId );
    CPLFree( self );
  }


double GDAL_GCP_GCPX_get( GDAL_GCP *gcp ) {
  return gcp->dfGCPX;
}
void GDAL_GCP_GCPX_set( GDAL_GCP *gcp, double dfGCPX ) {
  gcp->dfGCPX = dfGCPX;
}
double GDAL_GCP_GCPY_get( GDAL_GCP *gcp ) {
  return gcp->dfGCPY;
}
void GDAL_GCP_GCPY_set( GDAL_GCP *gcp, double dfGCPY ) {
  gcp->dfGCPY = dfGCPY;
}
double GDAL_GCP_GCPZ_get( GDAL_GCP *gcp ) {
  return gcp->dfGCPZ;
}
void GDAL_GCP_GCPZ_set( GDAL_GCP *gcp, double dfGCPZ ) {
  gcp->dfGCPZ = dfGCPZ;
}
double GDAL_GCP_GCPPixel_get( GDAL_GCP *gcp ) {
  return gcp->dfGCPPixel;
}
void GDAL_GCP_GCPPixel_set( GDAL_GCP *gcp, double dfGCPPixel ) {
  gcp->dfGCPPixel = dfGCPPixel;
}
double GDAL_GCP_GCPLine_get( GDAL_GCP *gcp ) {
  return gcp->dfGCPLine;
}
void GDAL_GCP_GCPLine_set( GDAL_GCP *gcp, double dfGCPLine ) {
  gcp->dfGCPLine = dfGCPLine;
}
const char * GDAL_GCP_Info_get( GDAL_GCP *gcp ) {
  return gcp->pszInfo;
}
void GDAL_GCP_Info_set( GDAL_GCP *gcp, const char * pszInfo ) {
  if ( gcp->pszInfo ) 
    CPLFree( gcp->pszInfo );
  gcp->pszInfo = CPLStrdup(pszInfo);
}
const char * GDAL_GCP_Id_get( GDAL_GCP *gcp ) {
  return gcp->pszId;
}
void GDAL_GCP_Id_set( GDAL_GCP *gcp, const char * pszId ) {
  if ( gcp->pszId ) 
    CPLFree( gcp->pszId );
  gcp->pszId = CPLStrdup(pszId);
}



/* Duplicate, but transposed names for C# because 
*  the C# module outputs backwards names
*/
double GDAL_GCP_get_GCPX( GDAL_GCP *gcp ) {
  return gcp->dfGCPX;
}
void GDAL_GCP_set_GCPX( GDAL_GCP *gcp, double dfGCPX ) {
  gcp->dfGCPX = dfGCPX;
}
double GDAL_GCP_get_GCPY( GDAL_GCP *gcp ) {
  return gcp->dfGCPY;
}
void GDAL_GCP_set_GCPY( GDAL_GCP *gcp, double dfGCPY ) {
  gcp->dfGCPY = dfGCPY;
}
double GDAL_GCP_get_GCPZ( GDAL_GCP *gcp ) {
  return gcp->dfGCPZ;
}
void GDAL_GCP_set_GCPZ( GDAL_GCP *gcp, double dfGCPZ ) {
  gcp->dfGCPZ = dfGCPZ;
}
double GDAL_GCP_get_GCPPixel( GDAL_GCP *gcp ) {
  return gcp->dfGCPPixel;
}
void GDAL_GCP_set_GCPPixel( GDAL_GCP *gcp, double dfGCPPixel ) {
  gcp->dfGCPPixel = dfGCPPixel;
}
double GDAL_GCP_get_GCPLine( GDAL_GCP *gcp ) {
  return gcp->dfGCPLine;
}
void GDAL_GCP_set_GCPLine( GDAL_GCP *gcp, double dfGCPLine ) {
  gcp->dfGCPLine = dfGCPLine;
}
const char * GDAL_GCP_get_Info( GDAL_GCP *gcp ) {
  return gcp->pszInfo;
}
void GDAL_GCP_set_Info( GDAL_GCP *gcp, const char * pszInfo ) {
  if ( gcp->pszInfo ) 
    CPLFree( gcp->pszInfo );
  gcp->pszInfo = CPLStrdup(pszInfo);
}
const char * GDAL_GCP_get_Id( GDAL_GCP *gcp ) {
  return gcp->pszId;
}
void GDAL_GCP_set_Id( GDAL_GCP *gcp, const char * pszId ) {
  if ( gcp->pszId ) 
    CPLFree( gcp->pszId );
  gcp->pszId = CPLStrdup(pszId);
}



  zval *
  CreateTupleFromDoubleArray( double *first, unsigned int size ) {
    zval *tmp;
    MAKE_STD_ZVAL(tmp);
    array_init(tmp);
    for( unsigned int i=0; i<size; i++ ) {
      add_next_index_double( tmp, *first );
      ++first;
    }
    return tmp;
 }


static void
t_output_helper( zval **target, zval *o) {
  if ( (*target)->type == IS_ARRAY ) {
    /* it's already an array, just append */
    add_next_index_zval( *target, o );
    return;
  }
  if ( (*target)->type == IS_NULL ) {
    REPLACE_ZVAL_VALUE(target,o,1);
    FREE_ZVAL(o);
    return;
  }
  zval *tmp;
  ALLOC_INIT_ZVAL(tmp);
  *tmp = **target;
  zval_copy_ctor(tmp);
  array_init(*target);
  add_next_index_zval( *target, tmp);
  add_next_index_zval( *target, o);

}


/* Returned size is in bytes or 0 if an error occurred */
static
GIntBig ComputeDatasetRasterIOSize (int buf_xsize, int buf_ysize, int nPixelSize,
                                int nBands, int* bandMap, int nBandMapArrayLength,
                                int nPixelSpace, int nLineSpace, int nBandSpace,
                                int bSpacingShouldBeMultipleOfPixelSize )
{
#if SIZEOF_VOIDP == 8
    const GIntBig MAX_INT = (((GIntBig)0x7fffffff) << 32) | 0xffffffff;
#else
    const GIntBig MAX_INT = 0x7fffffff;
#endif
    const GIntBig MAX_INT32 = 0x7fffffff;
    if (buf_xsize <= 0 || buf_ysize <= 0)
    {
        CPLError(CE_Failure, CPLE_IllegalArg, "Illegal values for buffer size");
        return 0;
    }

    if (nPixelSpace < 0 || nLineSpace < 0 || nBandSpace < 0)
    {
        CPLError(CE_Failure, CPLE_IllegalArg, "Illegal values for space arguments");
        return 0;
    }

    if (nPixelSize == 0)
    {
        CPLError(CE_Failure, CPLE_IllegalArg, "Illegal value for data type");
        return 0;
    }

    if( nPixelSpace == 0 )
        nPixelSpace = nPixelSize;
    else if ( bSpacingShouldBeMultipleOfPixelSize && (nPixelSpace % nPixelSize) != 0 )
    {
        CPLError(CE_Failure, CPLE_IllegalArg, "nPixelSpace should be a multiple of nPixelSize");
        return 0;
    }

    if( nLineSpace == 0 )
    {
        if (nPixelSpace > MAX_INT32 / buf_xsize)
        {
            CPLError(CE_Failure, CPLE_IllegalArg, "Integer overflow for nLineSpace");
            return 0;
        }
        nLineSpace = nPixelSpace * buf_xsize;
    }
    else if ( bSpacingShouldBeMultipleOfPixelSize && (nLineSpace % nPixelSize) != 0 )
    {
        CPLError(CE_Failure, CPLE_IllegalArg, "nLineSpace should be a multiple of nPixelSize");
        return 0;
    }

    if( nBandSpace == 0 )
    {
        if (nLineSpace > MAX_INT32 / buf_ysize)
        {
            CPLError(CE_Failure, CPLE_IllegalArg, "Integer overflow for nBandSpace");
            return 0;
        }
        nBandSpace = nLineSpace * buf_ysize;
    }
    else if ( bSpacingShouldBeMultipleOfPixelSize && (nBandSpace % nPixelSize) != 0 )
    {
        CPLError(CE_Failure, CPLE_IllegalArg, "nLineSpace should be a multiple of nPixelSize");
        return 0;
    }

    if (nBands <= 0 || (bandMap != NULL && nBands > nBandMapArrayLength))
    {
        CPLError(CE_Failure, CPLE_IllegalArg, "Invalid band count");
        return 0;
    }

    GIntBig nRet = (GIntBig)(buf_ysize - 1) * nLineSpace + (GIntBig)(buf_xsize - 1) * nPixelSpace + (GIntBig)(nBands - 1) * nBandSpace + nPixelSize;
    if (nRet > MAX_INT)
    {
        CPLError(CE_Failure, CPLE_IllegalArg, "Integer overflow");
        return 0;
    }

    return nRet;
}


static
CPLErr DSReadRaster_internal( GDALDatasetShadow *obj, 
                            int xoff, int yoff, int xsize, int ysize,
                            int buf_xsize, int buf_ysize,
                            GDALDataType buf_type,
                            int *buf_size, char **buf,
                            int band_list, int *pband_list,
                            int pixel_space, int line_space, int band_space)
{
  CPLErr result;

  GIntBig nRequiredSize = ComputeDatasetRasterIOSize (buf_xsize, buf_ysize, GDALGetDataTypeSize( buf_type ) / 8,
                                          band_list ? band_list : GDALGetRasterCount(obj), pband_list, band_list,
                                          pixel_space, line_space, band_space, FALSE);
  if (nRequiredSize > 0x7fffffff)
  {
     CPLError(CE_Failure, CPLE_IllegalArg, "Integer overflow");
     nRequiredSize = 0;
  }
  *buf_size = (int)nRequiredSize;
  if (*buf_size == 0)
  {
      *buf = 0;
      return CE_Failure;
  }
  
  *buf = (char*) malloc( *buf_size );
  if (*buf)
  {
    result = GDALDatasetRasterIO(obj, GF_Read, xoff, yoff, xsize, ysize,
                                    (void*) *buf, buf_xsize, buf_ysize, buf_type,
                                    band_list, pband_list, pixel_space, line_space, band_space );
    if ( result != CE_None ) {
        free( *buf );
        *buf = 0;
        *buf_size = 0;
    }
  }
  else
  {
    CPLError(CE_Failure, CPLE_OutOfMemory, "Not enough memory to allocate %d bytes", *buf_size);
    result = CE_Failure;
    *buf = 0;
    *buf_size = 0;
  }
  return result;
}


typedef struct
{
    GDALAsyncReaderH  hAsyncReader;
    void             *pyObject;
} GDALAsyncReaderWrapper;

typedef void* GDALAsyncReaderWrapperH;

static GDALAsyncReaderH AsyncReaderWrapperGetReader(GDALAsyncReaderWrapperH hWrapper)
{
    GDALAsyncReaderWrapper* psWrapper = (GDALAsyncReaderWrapper*)hWrapper;
    if (psWrapper->hAsyncReader == NULL)
    {
        CPLError(CE_Failure, CPLE_AppDefined, "AsyncReader object is defunct");
    }
    return psWrapper->hAsyncReader;
}

static void* AsyncReaderWrapperGetPyObject(GDALAsyncReaderWrapperH hWrapper)
{
    GDALAsyncReaderWrapper* psWrapper = (GDALAsyncReaderWrapper*)hWrapper;
    return psWrapper->pyObject;
}

static void DeleteAsyncReaderWrapper(GDALAsyncReaderWrapperH hWrapper)
{
    GDALAsyncReaderWrapper* psWrapper = (GDALAsyncReaderWrapper*)hWrapper;
    if (psWrapper->hAsyncReader != NULL)
    {
        CPLError(CE_Failure, CPLE_AppDefined,
                 "Native AsyncReader object will leak. EndAsyncReader() should have been called before");
    }
    CPLFree(psWrapper);
}


SWIGINTERN void delete_GDALAsyncReaderShadow(GDALAsyncReaderShadow *self){
        DeleteAsyncReaderWrapper(self);
    }
SWIGINTERN GDALAsyncStatusType GDALAsyncReaderShadow_GetNextUpdatedRegion(GDALAsyncReaderShadow *self,double timeout,int *xoff,int *yoff,int *buf_xsize,int *buf_ysize){
        GDALAsyncReaderH hReader = AsyncReaderWrapperGetReader(self);
        if (hReader == NULL)
        {
            *xoff = 0;
            *yoff = 0;
            *buf_xsize = 0;
            *buf_ysize = 0;
            return GARIO_ERROR;
        }
        return GDALARGetNextUpdatedRegion(hReader, timeout, xoff, yoff, buf_xsize, buf_ysize );
    }
SWIGINTERN int GDALAsyncReaderShadow_LockBuffer(GDALAsyncReaderShadow *self,double timeout){
        GDALAsyncReaderH hReader = AsyncReaderWrapperGetReader(self);
        if (hReader == NULL)
        {
            return 0;
        }
        return GDALARLockBuffer(hReader,timeout);
    }
SWIGINTERN void GDALAsyncReaderShadow_UnlockBuffer(GDALAsyncReaderShadow *self){
        GDALAsyncReaderH hReader = AsyncReaderWrapperGetReader(self);
        if (hReader == NULL)
        {
            return;
        }
        GDALARUnlockBuffer(hReader);
    }
SWIGINTERN void delete_GDALDatasetShadow(GDALDatasetShadow *self){
    if ( GDALDereferenceDataset( self ) <= 0 ) {
      GDALClose(self);
    }
  }
SWIGINTERN GDALDriverShadow *GDALDatasetShadow_GetDriver(GDALDatasetShadow *self){
    return (GDALDriverShadow*) GDALGetDatasetDriver( self );
  }
SWIGINTERN GDALRasterBandShadow *GDALDatasetShadow_GetRasterBand(GDALDatasetShadow *self,int nBand){
    return (GDALRasterBandShadow*) GDALGetRasterBand( self, nBand );
  }
SWIGINTERN char const *GDALDatasetShadow_GetProjection(GDALDatasetShadow *self){
    return GDALGetProjectionRef( self );
  }
SWIGINTERN char const *GDALDatasetShadow_GetProjectionRef(GDALDatasetShadow *self){
    return GDALGetProjectionRef( self );
  }
SWIGINTERN CPLErr GDALDatasetShadow_SetProjection(GDALDatasetShadow *self,char const *prj){
    return GDALSetProjection( self, prj );
  }
SWIGINTERN void GDALDatasetShadow_GetGeoTransform(GDALDatasetShadow *self,double argout[6]){
    if ( GDALGetGeoTransform( self, argout ) != CE_None ) {
      argout[0] = 0.0;
      argout[1] = 1.0;
      argout[2] = 0.0;
      argout[3] = 0.0;
      argout[4] = 0.0;
      argout[5] = 1.0;
    }
  }
SWIGINTERN CPLErr GDALDatasetShadow_SetGeoTransform(GDALDatasetShadow *self,double argin[6]){
    return GDALSetGeoTransform( self, argin );
  }
SWIGINTERN int GDALDatasetShadow_BuildOverviews(GDALDatasetShadow *self,char const *resampling="NEAREST",int overviewlist=0,int *pOverviews=0,GDALProgressFunc callback=NULL,void *callback_data=NULL){

    return GDALBuildOverviews(  self, 
                                resampling ? resampling : "NEAREST", 
                                overviewlist, 
                                pOverviews, 
                                0, 
                                0, 
                                callback, 
                                callback_data);
  }
SWIGINTERN int GDALDatasetShadow_GetGCPCount(GDALDatasetShadow *self){
    return GDALGetGCPCount( self );
  }
SWIGINTERN char const *GDALDatasetShadow_GetGCPProjection(GDALDatasetShadow *self){
    return GDALGetGCPProjection( self );
  }
SWIGINTERN void GDALDatasetShadow_GetGCPs(GDALDatasetShadow *self,int *nGCPs,GDAL_GCP const **pGCPs){
    *nGCPs = GDALGetGCPCount( self );
    *pGCPs = GDALGetGCPs( self );
  }
SWIGINTERN CPLErr GDALDatasetShadow_SetGCPs(GDALDatasetShadow *self,int nGCPs,GDAL_GCP const *pGCPs,char const *pszGCPProjection){
    return GDALSetGCPs( self, nGCPs, pGCPs, pszGCPProjection );
  }
SWIGINTERN void GDALDatasetShadow_FlushCache(GDALDatasetShadow *self){
    GDALFlushCache( self );
  }
SWIGINTERN CPLErr GDALDatasetShadow_AddBand(GDALDatasetShadow *self,GDALDataType datatype=GDT_Byte,char **options=0){
    return GDALAddBand( self, datatype, options );
  }
SWIGINTERN CPLErr GDALDatasetShadow_CreateMaskBand(GDALDatasetShadow *self,int nFlags){
      return GDALCreateDatasetMaskBand( self, nFlags );
  }
SWIGINTERN char **GDALDatasetShadow_GetFileList(GDALDatasetShadow *self){
    return GDALGetFileList( self );
  }
SWIGINTERN CPLErr GDALDatasetShadow_WriteRaster(GDALDatasetShadow *self,int xoff,int yoff,int xsize,int ysize,int 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,int *buf_pixel_space=0,int *buf_line_space=0,int *buf_band_space=0){
    CPLErr eErr;
    int nxsize = (buf_xsize==0) ? xsize : *buf_xsize;
    int nysize = (buf_ysize==0) ? ysize : *buf_ysize;
    GDALDataType ntype;
    if ( buf_type != 0 ) {
      ntype = (GDALDataType) *buf_type;
    } else {
      int lastband = GDALGetRasterCount( self ) - 1;
      if (lastband < 0)
        return CE_Failure;
      ntype = GDALGetRasterDataType( GDALGetRasterBand( self, lastband ) );
    }

    int pixel_space = (buf_pixel_space == 0) ? 0 : *buf_pixel_space;
    int line_space = (buf_line_space == 0) ? 0 : *buf_line_space;
    int band_space = (buf_band_space == 0) ? 0 : *buf_band_space;

    GIntBig min_buffer_size =
      ComputeDatasetRasterIOSize (nxsize, nysize, GDALGetDataTypeSize( ntype ) / 8,
                                  band_list ? band_list : GDALGetRasterCount(self), pband_list, band_list,
                                  pixel_space, line_space, band_space, FALSE);
    if (min_buffer_size == 0)
        return CE_Failure;

    if ( buf_len < min_buffer_size )
    {
        CPLError(CE_Failure, CPLE_AppDefined, "Buffer too small");
        return CE_Failure;
    }
  
    eErr = GDALDatasetRasterIO( self, GF_Write, xoff, yoff, xsize, ysize,
                                (void*) buf_string, nxsize, nysize, ntype,
                                band_list, pband_list, pixel_space, line_space, band_space );

    return eErr;
  }
SWIGINTERN CPLErr GDALDatasetShadow_ReadRaster(GDALDatasetShadow *self,int xoff,int yoff,int xsize,int ysize,int *buf_len,char **buf,int *buf_xsize=0,int *buf_ysize=0,GDALDataType *buf_type=0,int band_list=0,int *pband_list=0,int *buf_pixel_space=0,int *buf_line_space=0,int *buf_band_space=0){
    CPLErr eErr;
    int nxsize = (buf_xsize==0) ? xsize : *buf_xsize;
    int nysize = (buf_ysize==0) ? ysize : *buf_ysize;
    GDALDataType ntype;
    if ( buf_type != 0 ) {
      ntype = (GDALDataType) *buf_type;
    } else {
      int lastband = GDALGetRasterCount( self ) - 1;
      if (lastband < 0)
        return CE_Failure;
      ntype = GDALGetRasterDataType( GDALGetRasterBand( self, lastband ) );
    }

    int pixel_space = (buf_pixel_space == 0) ? 0 : *buf_pixel_space;
    int line_space = (buf_line_space == 0) ? 0 : *buf_line_space;
    int band_space = (buf_band_space == 0) ? 0 : *buf_band_space;
                            
    eErr = DSReadRaster_internal( self, xoff, yoff, xsize, ysize,
                                nxsize, nysize, ntype,
                                buf_len, buf, 
                                band_list, pband_list,
                                pixel_space, line_space, band_space);

    return eErr;
}

int GDALDatasetShadow_RasterXSize_get( GDALDatasetShadow *h ) {
  return GDALGetRasterXSize( h );
}
int GDALDatasetShadow_RasterYSize_get( GDALDatasetShadow *h ) {
  return GDALGetRasterYSize( h );
}
int GDALDatasetShadow_RasterCount_get( GDALDatasetShadow *h ) {
  return GDALGetRasterCount( h );
}


/* Returned size is in bytes or 0 if an error occurred */
static
GIntBig ComputeBandRasterIOSize (int buf_xsize, int buf_ysize, int nPixelSize,
                             int nPixelSpace, int nLineSpace,
                             int bSpacingShouldBeMultipleOfPixelSize )
{
#if SIZEOF_VOIDP == 8
    const GIntBig MAX_INT = (((GIntBig)0x7fffffff) << 32) | 0xffffffff;
#else
    const GIntBig MAX_INT = 0x7fffffff;
#endif
    const GIntBig MAX_INT32 = 0x7fffffff;
    if (buf_xsize <= 0 || buf_ysize <= 0)
    {
        CPLError(CE_Failure, CPLE_IllegalArg, "Illegal values for buffer size");
        return 0;
    }

    if (nPixelSpace < 0 || nLineSpace < 0)
    {
        CPLError(CE_Failure, CPLE_IllegalArg, "Illegal values for space arguments");
        return 0;
    }

    if (nPixelSize == 0)
    {
        CPLError(CE_Failure, CPLE_IllegalArg, "Illegal value for data type");
        return 0;
    }

    if( nPixelSpace == 0 )
        nPixelSpace = nPixelSize;
    else if ( bSpacingShouldBeMultipleOfPixelSize && (nPixelSpace % nPixelSize) != 0 )
    {
        CPLError(CE_Failure, CPLE_IllegalArg, "nPixelSpace should be a multiple of nPixelSize");
        return 0;
    }

    if( nLineSpace == 0 )
    {
        if (nPixelSpace > MAX_INT32 / buf_xsize)
        {
            CPLError(CE_Failure, CPLE_IllegalArg, "Integer overflow for nLineSpace");
            return 0;
        }
        nLineSpace = nPixelSpace * buf_xsize;
    }
    else if ( bSpacingShouldBeMultipleOfPixelSize && (nLineSpace % nPixelSize) != 0 )
    {
        CPLError(CE_Failure, CPLE_IllegalArg, "nLineSpace should be a multiple of nPixelSize");
        return 0;
    }

    GIntBig nRet = (GIntBig)(buf_ysize - 1) * nLineSpace + (GIntBig)(buf_xsize - 1) * nPixelSpace + nPixelSize;
    if (nRet > MAX_INT)
    {
        CPLError(CE_Failure, CPLE_IllegalArg, "Integer overflow");
        return 0;
    }

    return nRet;
}


static
CPLErr ReadRaster_internal( GDALRasterBandShadow *obj, 
                            int xoff, int yoff, int xsize, int ysize,
                            int buf_xsize, int buf_ysize,
                            GDALDataType buf_type,
                            int *buf_size, char **buf,
                            int pixel_space, int line_space )
{
  CPLErr result;

  GIntBig nRequiredSize = ComputeBandRasterIOSize( buf_xsize, buf_ysize, GDALGetDataTypeSize( buf_type ) / 8,
                                       pixel_space, line_space, FALSE );
  if (nRequiredSize > 0x7fffffff)
  {
     CPLError(CE_Failure, CPLE_IllegalArg, "Integer overflow");
     nRequiredSize = 0;
  }
  *buf_size = (int)nRequiredSize;
  
  if ( *buf_size == 0 )
  {
      *buf = 0;
      return CE_Failure;
  }
  
  *buf = (char*) malloc( *buf_size );
  if ( *buf )
  {
    result =  GDALRasterIO( obj, GF_Read, xoff, yoff, xsize, ysize,
                                    (void *) *buf, buf_xsize, buf_ysize,
                                    buf_type, pixel_space, line_space );
    if ( result != CE_None )
    {
        free( *buf );
        *buf = 0;
        *buf_size = 0;
    }
  }
  else
  {
    CPLError(CE_Failure, CPLE_OutOfMemory, "Not enough memory to allocate %d bytes", *buf_size);
    result = CE_Failure;
    *buf = 0;
    *buf_size = 0;
  }

  return result;
}


static
CPLErr 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,
                             int pixel_space, int line_space)
{
    GIntBig min_buffer_size = ComputeBandRasterIOSize (buf_xsize, buf_ysize, GDALGetDataTypeSize( buf_type ) / 8,
                                                   pixel_space, line_space, FALSE );
    if ( min_buffer_size == 0 )
      return CE_Failure;
      
    if ( buf_size < min_buffer_size ) {
      CPLError(CE_Failure, CPLE_AppDefined, "Buffer too small");
      return CE_Failure;
    }

    return GDALRasterIO( obj, GF_Write, xoff, yoff, xsize, ysize, 
		        (void *) buffer, buf_xsize, buf_ysize, buf_type, pixel_space, line_space );
}

SWIGINTERN int GDALRasterBandShadow_GetBand(GDALRasterBandShadow *self){
    return GDALGetBandNumber(self);
  }
SWIGINTERN void GDALRasterBandShadow_GetBlockSize(GDALRasterBandShadow *self,int *pnBlockXSize,int *pnBlockYSize){
      GDALGetBlockSize(self, pnBlockXSize, pnBlockYSize);
  }
SWIGINTERN GDALColorInterp GDALRasterBandShadow_GetColorInterpretation(GDALRasterBandShadow *self){
    return GDALGetRasterColorInterpretation( self );
  }
SWIGINTERN GDALColorInterp GDALRasterBandShadow_GetRasterColorInterpretation(GDALRasterBandShadow *self){
    return GDALGetRasterColorInterpretation( self );
  }
SWIGINTERN CPLErr GDALRasterBandShadow_SetColorInterpretation(GDALRasterBandShadow *self,GDALColorInterp val){
    return GDALSetRasterColorInterpretation( self, val );
  }
SWIGINTERN CPLErr GDALRasterBandShadow_SetRasterColorInterpretation(GDALRasterBandShadow *self,GDALColorInterp val){
    return GDALSetRasterColorInterpretation( self, val );
  }
SWIGINTERN void GDALRasterBandShadow_GetNoDataValue(GDALRasterBandShadow *self,double *val,int *hasval){
    *val = GDALGetRasterNoDataValue( self, hasval );
  }
SWIGINTERN CPLErr GDALRasterBandShadow_SetNoDataValue(GDALRasterBandShadow *self,double d){
    return GDALSetRasterNoDataValue( self, d );
  }
SWIGINTERN char const *GDALRasterBandShadow_GetUnitType(GDALRasterBandShadow *self){
      return GDALGetRasterUnitType( self );
  }
SWIGINTERN CPLErr GDALRasterBandShadow_SetUnitType(GDALRasterBandShadow *self,char const *val){
    return GDALSetRasterUnitType( self, val );
  }
SWIGINTERN char **GDALRasterBandShadow_GetRasterCategoryNames(GDALRasterBandShadow *self){
    return GDALGetRasterCategoryNames( self );
  }
SWIGINTERN CPLErr GDALRasterBandShadow_SetRasterCategoryNames(GDALRasterBandShadow *self,char **names){
    return GDALSetRasterCategoryNames( self, names );
  }
SWIGINTERN void GDALRasterBandShadow_GetMinimum(GDALRasterBandShadow *self,double *val,int *hasval){
    *val = GDALGetRasterMinimum( self, hasval );
  }
SWIGINTERN void GDALRasterBandShadow_GetMaximum(GDALRasterBandShadow *self,double *val,int *hasval){
    *val = GDALGetRasterMaximum( self, hasval );
  }
SWIGINTERN void GDALRasterBandShadow_GetOffset(GDALRasterBandShadow *self,double *val,int *hasval){
    *val = GDALGetRasterOffset( self, hasval );
  }
SWIGINTERN void GDALRasterBandShadow_GetScale(GDALRasterBandShadow *self,double *val,int *hasval){
    *val = GDALGetRasterScale( self, hasval );
  }
SWIGINTERN CPLErr GDALRasterBandShadow_SetOffset(GDALRasterBandShadow *self,double val){
    return GDALSetRasterOffset( self, val );
  }
SWIGINTERN CPLErr GDALRasterBandShadow_SetScale(GDALRasterBandShadow *self,double val){
    return GDALSetRasterScale( self, val );
  }
SWIGINTERN CPLErr GDALRasterBandShadow_GetStatistics(GDALRasterBandShadow *self,int approx_ok,int force,double *min,double *max,double *mean,double *stddev){
    if (min) *min = 0;
    if (max) *max = 0;
    if (mean) *mean = 0;
    if (stddev) *stddev = -1; /* This is the only way to recognize from Python if GetRasterStatistics() has updated the values */
    return GDALGetRasterStatistics( self, approx_ok, force, 
				    min, max, mean, stddev );
  }
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){
    return GDALComputeRasterStatistics( self, approx_ok, min, max, mean, stddev, callback, callback_data );
  }
SWIGINTERN CPLErr GDALRasterBandShadow_SetStatistics(GDALRasterBandShadow *self,double min,double max,double mean,double stddev){
    return GDALSetRasterStatistics( self, min, max, mean, stddev );
  }
SWIGINTERN int GDALRasterBandShadow_GetOverviewCount(GDALRasterBandShadow *self){
    return GDALGetOverviewCount( self );
  }
SWIGINTERN GDALRasterBandShadow *GDALRasterBandShadow_GetOverview(GDALRasterBandShadow *self,int i){
    return (GDALRasterBandShadow*) GDALGetOverview( self, i );
  }
SWIGINTERN int GDALRasterBandShadow_Checksum(GDALRasterBandShadow *self,int xoff=0,int yoff=0,int *xsize=0,int *ysize=0){
    int nxsize = (xsize!=0) ? *xsize : GDALGetRasterBandXSize( self );
    int nysize = (ysize!=0) ? *ysize : GDALGetRasterBandYSize( self );
    return GDALChecksumImage( self, xoff, yoff, nxsize, nysize );
  }
SWIGINTERN void GDALRasterBandShadow_ComputeRasterMinMax(GDALRasterBandShadow *self,double argout[2],int approx_ok=0){
    GDALComputeRasterMinMax( self, approx_ok, argout );
  }
SWIGINTERN void GDALRasterBandShadow_ComputeBandStats(GDALRasterBandShadow *self,double argout[2],int samplestep=1){
    GDALComputeBandStats( self, samplestep, argout+0, argout+1, 
                          NULL, NULL );
  }
SWIGINTERN CPLErr GDALRasterBandShadow_Fill(GDALRasterBandShadow *self,double real_fill,double imag_fill=0.0){
    return GDALFillRaster( self, real_fill, imag_fill );
  }
SWIGINTERN CPLErr GDALRasterBandShadow_ReadRaster(GDALRasterBandShadow *self,int xoff,int yoff,int xsize,int ysize,int *buf_len,char **buf,int *buf_xsize=0,int *buf_ysize=0,int *buf_type=0,int *buf_pixel_space=0,int *buf_line_space=0){
    int nxsize = (buf_xsize==0) ? xsize : *buf_xsize;
    int nysize = (buf_ysize==0) ? ysize : *buf_ysize;
    GDALDataType ntype  = (buf_type==0) ? GDALGetRasterDataType(self)
                                        : (GDALDataType)*buf_type;
    int pixel_space = (buf_pixel_space == 0) ? 0 : *buf_pixel_space;
    int line_space = (buf_line_space == 0) ? 0 : *buf_line_space;
    return ReadRaster_internal( self, xoff, yoff, xsize, ysize,
                                nxsize, nysize, ntype, buf_len, buf, pixel_space, line_space );
  }
SWIGINTERN CPLErr GDALRasterBandShadow_WriteRaster(GDALRasterBandShadow *self,int xoff,int yoff,int xsize,int ysize,int buf_len,char *buf_string,int *buf_xsize=0,int *buf_ysize=0,int *buf_type=0,int *buf_pixel_space=0,int *buf_line_space=0){
    int nxsize = (buf_xsize==0) ? xsize : *buf_xsize;
    int nysize = (buf_ysize==0) ? ysize : *buf_ysize;
    GDALDataType ntype  = (buf_type==0) ? GDALGetRasterDataType(self)
                                        : (GDALDataType)*buf_type;
    int pixel_space = (buf_pixel_space == 0) ? 0 : *buf_pixel_space;
    int line_space = (buf_line_space == 0) ? 0 : *buf_line_space;
    return WriteRaster_internal( self, xoff, yoff, xsize, ysize,
                                 nxsize, nysize, ntype, buf_len, buf_string, pixel_space, line_space );
  }
SWIGINTERN void GDALRasterBandShadow_FlushCache(GDALRasterBandShadow *self){
    GDALFlushRasterCache( self );
  }
SWIGINTERN GDALColorTableShadow *GDALRasterBandShadow_GetRasterColorTable(GDALRasterBandShadow *self){
    return (GDALColorTableShadow*) GDALGetRasterColorTable( self );
  }
SWIGINTERN GDALColorTableShadow *GDALRasterBandShadow_GetColorTable(GDALRasterBandShadow *self){
    return (GDALColorTableShadow*) GDALGetRasterColorTable( self );
  }
SWIGINTERN int GDALRasterBandShadow_SetRasterColorTable(GDALRasterBandShadow *self,GDALColorTableShadow *arg){
    return GDALSetRasterColorTable( self, arg );
  }
SWIGINTERN int GDALRasterBandShadow_SetColorTable(GDALRasterBandShadow *self,GDALColorTableShadow *arg){
    return GDALSetRasterColorTable( self, arg );
  }
SWIGINTERN GDALRasterAttributeTableShadow *GDALRasterBandShadow_GetDefaultRAT(GDALRasterBandShadow *self){ 
      return (GDALRasterAttributeTableShadow*) GDALGetDefaultRAT(self);
  }
SWIGINTERN int GDALRasterBandShadow_SetDefaultRAT(GDALRasterBandShadow *self,GDALRasterAttributeTableShadow *table){
      return GDALSetDefaultRAT(self, table);
  }
SWIGINTERN GDALRasterBandShadow *GDALRasterBandShadow_GetMaskBand(GDALRasterBandShadow *self){
      return (GDALRasterBandShadow *) GDALGetMaskBand( self );
  }
SWIGINTERN int GDALRasterBandShadow_GetMaskFlags(GDALRasterBandShadow *self){
      return GDALGetMaskFlags( self );
  }
SWIGINTERN CPLErr GDALRasterBandShadow_CreateMaskBand(GDALRasterBandShadow *self,int nFlags){
      return GDALCreateMaskBand( self, nFlags );
  }
SWIGINTERN CPLErr GDALRasterBandShadow_GetHistogram(GDALRasterBandShadow *self,double min=-0.5,double max=255.5,int buckets=256,int *panHistogram=NULL,int include_out_of_range=0,int approx_ok=1,GDALProgressFunc callback=NULL,void *callback_data=NULL){
    CPLErrorReset(); 
    CPLErr err = GDALGetRasterHistogram( self, min, max, buckets, panHistogram,
                                         include_out_of_range, approx_ok,
                                         callback, callback_data );
    return err;
  }
SWIGINTERN CPLErr GDALRasterBandShadow_GetDefaultHistogram(GDALRasterBandShadow *self,double *min_ret=NULL,double *max_ret=NULL,int *buckets_ret=NULL,int **ppanHistogram=NULL,int force=1,GDALProgressFunc callback=NULL,void *callback_data=NULL){
    return GDALGetDefaultHistogram( self, min_ret, max_ret, buckets_ret,
                                    ppanHistogram, force, 
                                    callback, callback_data );
}
SWIGINTERN CPLErr GDALRasterBandShadow_SetDefaultHistogram(GDALRasterBandShadow *self,double min,double max,int buckets_in,int *panHistogram_in){
    return GDALSetDefaultHistogram( self, min, max, 
    	   			    buckets_in, panHistogram_in );
}
SWIGINTERN bool GDALRasterBandShadow_HasArbitraryOverviews(GDALRasterBandShadow *self){
      return (GDALHasArbitraryOverviews( self ) != 0) ? true : false;
  }

GDALDataType GDALRasterBandShadow_DataType_get( GDALRasterBandShadow *h ) {
  return GDALGetRasterDataType( h );
}
int GDALRasterBandShadow_XSize_get( GDALRasterBandShadow *h ) {
  return GDALGetRasterBandXSize( h );
}
int GDALRasterBandShadow_YSize_get( GDALRasterBandShadow *h ) {
  return GDALGetRasterBandYSize( h );
}

SWIGINTERN GDALColorTableShadow *new_GDALColorTableShadow(GDALPaletteInterp palette=GPI_RGB){
        return (GDALColorTableShadow*) GDALCreateColorTable(palette);
    }
SWIGINTERN void delete_GDALColorTableShadow(GDALColorTableShadow *self){
        GDALDestroyColorTable(self);
    }
SWIGINTERN GDALColorTableShadow *GDALColorTableShadow_Clone(GDALColorTableShadow *self){
        return (GDALColorTableShadow*) GDALCloneColorTable (self);
    }
SWIGINTERN GDALPaletteInterp GDALColorTableShadow_GetPaletteInterpretation(GDALColorTableShadow *self){
        return GDALGetPaletteInterpretation(self);
    }
SWIGINTERN int GDALColorTableShadow_GetColorEntryCount(GDALColorTableShadow *self){
        return GDALGetColorEntryCount(self);
    }
SWIGINTERN GDALColorEntry *GDALColorTableShadow_GetColorEntry(GDALColorTableShadow *self,int entry){
        return (GDALColorEntry*) GDALGetColorEntry(self, entry);
    }
SWIGINTERN int GDALColorTableShadow_GetColorEntryAsRGB(GDALColorTableShadow *self,int entry,GDALColorEntry *centry){
        return GDALGetColorEntryAsRGB(self, entry, centry);
    }
SWIGINTERN void GDALColorTableShadow_SetColorEntry(GDALColorTableShadow *self,int entry,GDALColorEntry const *centry){
        GDALSetColorEntry(self, entry, centry);
    }
SWIGINTERN void GDALColorTableShadow_CreateColorRamp(GDALColorTableShadow *self,int nStartIndex,GDALColorEntry const *startcolor,int nEndIndex,GDALColorEntry const *endcolor){
        GDALCreateColorRamp(self, nStartIndex, startcolor, nEndIndex, endcolor);
    }
SWIGINTERN GDALRasterAttributeTableShadow *new_GDALRasterAttributeTableShadow(){
        return (GDALRasterAttributeTableShadow*) 
		GDALCreateRasterAttributeTable();
    }
SWIGINTERN void delete_GDALRasterAttributeTableShadow(GDALRasterAttributeTableShadow *self){
        GDALDestroyRasterAttributeTable(self);
    }
SWIGINTERN GDALRasterAttributeTableShadow *GDALRasterAttributeTableShadow_Clone(GDALRasterAttributeTableShadow *self){
        return (GDALRasterAttributeTableShadow*) GDALRATClone(self);
    }
SWIGINTERN int GDALRasterAttributeTableShadow_GetColumnCount(GDALRasterAttributeTableShadow *self){ 
        return GDALRATGetColumnCount( self );
    }
SWIGINTERN char const *GDALRasterAttributeTableShadow_GetNameOfCol(GDALRasterAttributeTableShadow *self,int iCol){ 
        return GDALRATGetNameOfCol( self, iCol );
    }
SWIGINTERN GDALRATFieldUsage GDALRasterAttributeTableShadow_GetUsageOfCol(GDALRasterAttributeTableShadow *self,int iCol){
        return GDALRATGetUsageOfCol( self, iCol );
    }
SWIGINTERN GDALRATFieldType GDALRasterAttributeTableShadow_GetTypeOfCol(GDALRasterAttributeTableShadow *self,int iCol){
        return GDALRATGetTypeOfCol( self, iCol );
    }
SWIGINTERN int GDALRasterAttributeTableShadow_GetColOfUsage(GDALRasterAttributeTableShadow *self,GDALRATFieldUsage eUsage){
        return GDALRATGetColOfUsage( self, eUsage );
    }
SWIGINTERN int GDALRasterAttributeTableShadow_GetRowCount(GDALRasterAttributeTableShadow *self){ 
        return GDALRATGetRowCount( self );
    }
SWIGINTERN char const *GDALRasterAttributeTableShadow_GetValueAsString(GDALRasterAttributeTableShadow *self,int iRow,int iCol){ 
        return GDALRATGetValueAsString( self, iRow, iCol );
    }
SWIGINTERN int GDALRasterAttributeTableShadow_GetValueAsInt(GDALRasterAttributeTableShadow *self,int iRow,int iCol){ 
        return GDALRATGetValueAsInt( self, iRow, iCol );
    }
SWIGINTERN double GDALRasterAttributeTableShadow_GetValueAsDouble(GDALRasterAttributeTableShadow *self,int iRow,int iCol){ 
        return GDALRATGetValueAsDouble( self, iRow, iCol );
    }
SWIGINTERN void GDALRasterAttributeTableShadow_SetValueAsString(GDALRasterAttributeTableShadow *self,int iRow,int iCol,char const *pszValue){ 
        GDALRATSetValueAsString( self, iRow, iCol, pszValue );
    }
SWIGINTERN void GDALRasterAttributeTableShadow_SetValueAsInt(GDALRasterAttributeTableShadow *self,int iRow,int iCol,int nValue){ 
        GDALRATSetValueAsInt( self, iRow, iCol, nValue );
    }
SWIGINTERN void GDALRasterAttributeTableShadow_SetValueAsDouble(GDALRasterAttributeTableShadow *self,int iRow,int iCol,double dfValue){ 
        GDALRATSetValueAsDouble( self, iRow, iCol, dfValue );
    }
SWIGINTERN void GDALRasterAttributeTableShadow_SetRowCount(GDALRasterAttributeTableShadow *self,int nCount){
        GDALRATSetRowCount( self, nCount );
    }
SWIGINTERN int GDALRasterAttributeTableShadow_CreateColumn(GDALRasterAttributeTableShadow *self,char const *pszName,GDALRATFieldType eType,GDALRATFieldUsage eUsage){
        return GDALRATCreateColumn( self, pszName, eType, eUsage );
    }
SWIGINTERN bool GDALRasterAttributeTableShadow_GetLinearBinning(GDALRasterAttributeTableShadow *self,double *pdfRow0Min,double *pdfBinSize){
        return (GDALRATGetLinearBinning(self, pdfRow0Min, pdfBinSize) != 0) ? true : false;
    }
SWIGINTERN int GDALRasterAttributeTableShadow_SetLinearBinning(GDALRasterAttributeTableShadow *self,double dfRow0Min,double dfBinSize){
        return GDALRATSetLinearBinning(self, dfRow0Min, dfBinSize);
    }
SWIGINTERN int GDALRasterAttributeTableShadow_GetRowOfValue(GDALRasterAttributeTableShadow *self,double dfValue){
        return GDALRATGetRowOfValue( self, dfValue );
    }

#include "gdalgrid.h"

#ifdef DEBUG 
typedef struct OGRLayerHS OGRLayerShadow;
typedef struct OGRGeometryHS OGRGeometryShadow;
#else
typedef void OGRLayerShadow;
typedef void OGRGeometryShadow;
#endif


int GDALTermProgress_nocb( double dfProgress, const char * pszMessage=NULL, void *pData=NULL ) {
  return GDALTermProgress( dfProgress, pszMessage, pData);
}


int  ComputeMedianCutPCT ( GDALRasterBandShadow *red,
                              GDALRasterBandShadow *green,
                              GDALRasterBandShadow *blue,
                              int num_colors,
                              GDALColorTableShadow* colors,
                              GDALProgressFunc callback = NULL,
                              void* callback_data=NULL) {

    CPLErrorReset();

    int err = GDALComputeMedianCutPCT( red,
                                          green,
                                          blue,
                                          NULL,
                                          num_colors,
                                          colors,
                                          callback,
                                          callback_data);

    return err;
}


int  DitherRGB2PCT ( GDALRasterBandShadow *red,
                     GDALRasterBandShadow *green,
                     GDALRasterBandShadow *blue,
                     GDALRasterBandShadow *target,
                     GDALColorTableShadow *colors,
                     GDALProgressFunc callback = NULL,
                     void* callback_data=NULL) {

    CPLErrorReset();
    int err;
    err = GDALDitherRGB2PCT(  red,
                                  green,
                                  blue,
                                  target,
                                  colors,
                                  callback,
                                  callback_data);

    return err;
}


CPLErr  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) {

    CPLErrorReset();

    CPLErr err = GDALReprojectImage( src_ds,
                                     src_wkt,
                                     dst_ds,
                                     dst_wkt,
                                     eResampleAlg,
                                     WarpMemoryLimit,
                                     maxerror,
                                     callback,
                                     callback_data,
                                     NULL);

    return err;
}


int  ComputeProximity( GDALRasterBandShadow *srcBand,
                       GDALRasterBandShadow *proximityBand,
                       char **options = NULL,
                       GDALProgressFunc callback=NULL,
                       void* callback_data=NULL) {

    CPLErrorReset();

    return GDALComputeProximity( srcBand, proximityBand, options,
                                 callback, callback_data );
}


int  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) {

    CPLErr eErr;

    CPLErrorReset();

    if( burn_values == 0 )
    {
        burn_values_list = (double *) CPLMalloc(sizeof(double)*bands);
        for( int i = 0; i < bands; i++ )
            burn_values_list[i] = 255.0;
    }
    else if( burn_values != bands )
    {
        CPLError( CE_Failure, CPLE_AppDefined, 
                  "Did not get the expected number of burn values in RasterizeLayer()" );
        return CE_Failure;
    }

    eErr = GDALRasterizeLayers( dataset, bands, band_list,
                                1, &layer, 
                                (GDALTransformerFunc) pfnTransformer, 
                                pTransformArg,
                                burn_values_list, options, 
                                callback, callback_data );

    if( burn_values == 0 )
        CPLFree( burn_values_list );

    return eErr;
}


int  Polygonize( GDALRasterBandShadow *srcBand,
     		 GDALRasterBandShadow *maskBand,
  	         OGRLayerShadow *outLayer, 
                 int iPixValField,
                 char **options = NULL,
                 GDALProgressFunc callback=NULL,
                 void* callback_data=NULL) {

    CPLErrorReset();

    return GDALPolygonize( srcBand, maskBand, outLayer, iPixValField,
                           options, callback, callback_data );
}


int  FillNodata( GDALRasterBandShadow *targetBand,
     		 GDALRasterBandShadow *maskBand,
                 double maxSearchDist,
                 int smoothingIterations,
                 char **options = NULL,
                 GDALProgressFunc callback=NULL,
                 void* callback_data=NULL) {

    CPLErrorReset();

    return GDALFillNodata( targetBand, maskBand, maxSearchDist, 
    	   		   0, smoothingIterations, options, 
			   callback, callback_data );
}


int  SieveFilter( GDALRasterBandShadow *srcBand,
     		  GDALRasterBandShadow *maskBand,
  	          GDALRasterBandShadow *dstBand,
                  int threshold, int connectedness=4,
                  char **options = NULL,
                  GDALProgressFunc callback=NULL,
                  void* callback_data=NULL) {

    CPLErrorReset();

    return GDALSieveFilter( srcBand, maskBand, dstBand, 
                            threshold, connectedness,
                            options, callback, callback_data );
}


int  RegenerateOverviews( GDALRasterBandShadow *srcBand,
     			  int overviewBandCount,
                          GDALRasterBandShadow **overviewBands,
                          const char *resampling = "average",
                          GDALProgressFunc callback=NULL,
                          void* callback_data=NULL) {

    CPLErrorReset();

    return GDALRegenerateOverviews( srcBand, overviewBandCount, overviewBands,
    	   			    resampling ? resampling : "average", callback, callback_data );
}


int  RegenerateOverview( GDALRasterBandShadow *srcBand,
                          GDALRasterBandShadow *overviewBand,
                          const char *resampling = "average",
                          GDALProgressFunc callback=NULL,
                          void* callback_data=NULL) {

    CPLErrorReset();

    return GDALRegenerateOverviews( srcBand, 1, &overviewBand,
    	   			    resampling ? resampling : "average", callback, callback_data );
}


int 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)
{
    CPLErr eErr;

    CPLErrorReset();

    eErr =  GDALContourGenerate( srcBand,
                                 contourInterval,
                                 contourBase,
                                 fixedLevelCount,
                                 fixedLevels,
                                 useNoData,
                                 noDataValue,
                                 dstLayer,
                                 idField,
                                 elevField,
                                 callback,
                                 callback_data);

    return eErr;
}


GDALDatasetShadow *AutoCreateWarpedVRT( GDALDatasetShadow *src_ds,
                                        const char *src_wkt = 0,
                                        const char *dst_wkt = 0,
                                        GDALResampleAlg eResampleAlg = GRA_NearestNeighbour,
                                        double maxerror = 0.0 ) {
  GDALDatasetShadow *ds = GDALAutoCreateWarpedVRT( src_ds, src_wkt,
                                                   dst_wkt,
                                                   eResampleAlg,
                                                   maxerror,
                                                   0 );
  if (ds == 0) {
    /*throw CPLGetLastErrorMsg(); causes a SWIG_exception later*/
  }
  return ds;
  
}

SWIGINTERN GDALTransformerInfoShadow *new_GDALTransformerInfoShadow(GDALDatasetShadow *src,GDALDatasetShadow *dst,char **options){
    GDALTransformerInfoShadow *obj = (GDALTransformerInfoShadow*) 
       GDALCreateGenImgProjTransformer2( (GDALDatasetH)src, (GDALDatasetH)dst, 
                                         options );
    return obj;
  }
SWIGINTERN void delete_GDALTransformerInfoShadow(GDALTransformerInfoShadow *self){
    GDALDestroyTransformer( self );
  }
SWIGINTERN int GDALTransformerInfoShadow_TransformPoint__SWIG_0(GDALTransformerInfoShadow *self,int bDstToSrc,double inout[3]){
    int nRet, nSuccess = TRUE;

    nRet = GDALUseTransformer( self, bDstToSrc, 
                               1, &inout[0], &inout[1], &inout[2], 
                               &nSuccess );

    return nRet && nSuccess;
  }
SWIGINTERN int GDALTransformerInfoShadow_TransformPoint__SWIG_1(GDALTransformerInfoShadow *self,double argout[3],int bDstToSrc,double x,double y,double z=0.0){
    int nRet, nSuccess = TRUE;
    
    argout[0] = x;
    argout[1] = y;
    argout[2] = z;
    nRet = GDALUseTransformer( self, bDstToSrc, 
                               1, &argout[0], &argout[1], &argout[2], 
                               &nSuccess );

    return nRet && nSuccess;
  }
SWIGINTERN int GDALTransformerInfoShadow_TransformPoints(GDALTransformerInfoShadow *self,int bDstToSrc,int nCount,double *x,double *y,double *z,int *panSuccess){
    int nRet;

    nRet = GDALUseTransformer( self, bDstToSrc, nCount, x, y, z, panSuccess );

    return nRet;
  }

int wrapper_GDALGetCacheMax()
{
    return GDALGetCacheMax();
}


int wrapper_GDALGetCacheUsed()
{
    return GDALGetCacheUsed();
}


void wrapper_GDALSetCacheMax(int nBytes)
{
    return GDALSetCacheMax(nBytes);
}


int GetDriverCount() {
  return GDALGetDriverCount();
}


GDALDriverShadow* GetDriverByName( char const *name ) {
  return (GDALDriverShadow*) GDALGetDriverByName( name );
}


GDALDriverShadow* GetDriver( int i ) {
  return (GDALDriverShadow*) GDALGetDriver( i );
}


GDALDatasetShadow* Open( char const* utf8_path, GDALAccess eAccess = GA_ReadOnly ) {
  CPLErrorReset();
  GDALDatasetShadow *ds = GDALOpen( utf8_path, eAccess );
  if( ds != NULL && CPLGetLastErrorType() == CE_Failure )
  {
      if ( GDALDereferenceDataset( ds ) <= 0 )
          GDALClose(ds);
      ds = NULL;
  }
  return (GDALDatasetShadow*) ds;
}


GDALDatasetShadow* OpenShared( char const* utf8_path, GDALAccess eAccess = GA_ReadOnly ) {
  CPLErrorReset();
  GDALDatasetShadow *ds = GDALOpenShared( utf8_path, eAccess );
  if( ds != NULL && CPLGetLastErrorType() == CE_Failure )
  {
      if ( GDALDereferenceDataset( ds ) <= 0 )
          GDALClose(ds);
      ds = NULL;
  }
  return (GDALDatasetShadow*) ds;
}


GDALDriverShadow *IdentifyDriver( const char *utf8_path, 
                                  char **papszSiblings = NULL ) {
    return (GDALDriverShadow *) GDALIdentifyDriver( utf8_path, 
	                                            papszSiblings );
}


  char **GeneralCmdLineProcessor( char **papszArgv, int nOptions = 0 ) {
    int nResArgCount;

    nResArgCount = 
      GDALGeneralCmdLineProcessor( CSLCount(papszArgv), &papszArgv, nOptions ); 

    if( nResArgCount <= 0 )
        return NULL;
    else
        return papszArgv;
  }


/* -------- TYPE CONVERSION AND EQUIVALENCE RULES (BEGIN) -------- */

static void *_p_GDALDriverShadowTo_p_GDALMajorObjectShadow(void *x, int *SWIGUNUSEDPARM(newmemory)) {
    return (void *)((GDALMajorObjectShadow *)  ((GDALDriverShadow *) x));
}
static void *_p_GDALDatasetShadowTo_p_GDALMajorObjectShadow(void *x, int *SWIGUNUSEDPARM(newmemory)) {
    return (void *)((GDALMajorObjectShadow *)  ((GDALDatasetShadow *) x));
}
static void *_p_GDALRasterBandShadowTo_p_GDALMajorObjectShadow(void *x, int *SWIGUNUSEDPARM(newmemory)) {
    return (void *)((GDALMajorObjectShadow *)  ((GDALRasterBandShadow *) x));
}
static swig_type_info _swigt__p_CPLErrorHandler = {"_p_CPLErrorHandler", "CPLErrorHandler *", 0, 0, (void*)0, 0};
static swig_type_info _swigt__p_CPLXMLNode = {"_p_CPLXMLNode", "CPLXMLNode *", 0, 0, (void*)0, 0};
static swig_type_info _swigt__p_GByte = {"_p_GByte", "GByte *", 0, 0, (void*)0, 0};
static swig_type_info _swigt__p_GDALAsyncReaderShadow = {"_p_GDALAsyncReaderShadow", "GDALAsyncReaderShadow *", 0, 0, (void*)0, 0};
static swig_type_info _swigt__p_GDALColorEntry = {"_p_GDALColorEntry", "GDALColorEntry *", 0, 0, (void*)0, 0};
static swig_type_info _swigt__p_GDALColorTableShadow = {"_p_GDALColorTableShadow", "GDALColorTableShadow *", 0, 0, (void*)0, 0};
static swig_type_info _swigt__p_GDALDatasetShadow = {"_p_GDALDatasetShadow", "GDALDatasetShadow *", 0, 0, (void*)0, 0};
static swig_type_info _swigt__p_GDALDriverShadow = {"_p_GDALDriverShadow", "GDALDriverShadow *", 0, 0, (void*)0, 0};
static swig_type_info _swigt__p_GDALMajorObjectShadow = {"_p_GDALMajorObjectShadow", "GDALMajorObjectShadow *", 0, 0, (void*)0, 0};
static swig_type_info _swigt__p_GDALProgressFunc = {"_p_GDALProgressFunc", "GDALProgressFunc *", 0, 0, (void*)0, 0};
static swig_type_info _swigt__p_GDALRasterAttributeTableShadow = {"_p_GDALRasterAttributeTableShadow", "GDALRasterAttributeTableShadow *", 0, 0, (void*)0, 0};
static swig_type_info _swigt__p_GDALRasterBandShadow = {"_p_GDALRasterBandShadow", "GDALRasterBandShadow *", 0, 0, (void*)0, 0};
static swig_type_info _swigt__p_GDALTransformerInfoShadow = {"_p_GDALTransformerInfoShadow", "GDALTransformerInfoShadow *", 0, 0, (void*)0, 0};
static swig_type_info _swigt__p_GDAL_GCP = {"_p_GDAL_GCP", "GDAL_GCP *", 0, 0, (void*)0, 0};
static swig_type_info _swigt__p_OGRLayerShadow = {"_p_OGRLayerShadow", "OGRLayerShadow *", 0, 0, (void*)0, 0};
static swig_type_info _swigt__p_char = {"_p_char", "char *|retStringAndCPLFree *", 0, 0, (void*)0, 0};
static swig_type_info _swigt__p_double = {"_p_double", "double *", 0, 0, (void*)0, 0};
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};
static swig_type_info _swigt__p_int = {"_p_int", "CPLErr *|GDALRATFieldType *|int *|GDALColorInterp *|GDALAccess *|GDALPaletteInterp *|GDALDataType *|GDALAsyncStatusType *|GDALRATFieldUsage *|GDALResampleAlg *", 0, 0, (void*)0, 0};
static swig_type_info _swigt__p_p_GDALRasterBandShadow = {"_p_p_GDALRasterBandShadow", "GDALRasterBandShadow **", 0, 0, (void*)0, 0};
static swig_type_info _swigt__p_p_GDAL_GCP = {"_p_p_GDAL_GCP", "GDAL_GCP **", 0, 0, (void*)0, 0};
static swig_type_info _swigt__p_p_char = {"_p_p_char", "char **", 0, 0, (void*)0, 0};
static swig_type_info _swigt__p_p_int = {"_p_p_int", "int **", 0, 0, (void*)0, 0};
static swig_type_info _swigt__p_p_void = {"_p_p_void", "FILE **|void **", 0, 0, (void*)0, 0};
static swig_type_info _swigt__p_void = {"_p_void", "FILE *|void *", 0, 0, (void*)0, 0};

static swig_type_info *swig_type_initial[] = {
  &_swigt__p_CPLErrorHandler,
  &_swigt__p_CPLXMLNode,
  &_swigt__p_GByte,
  &_swigt__p_GDALAsyncReaderShadow,
  &_swigt__p_GDALColorEntry,
  &_swigt__p_GDALColorTableShadow,
  &_swigt__p_GDALDatasetShadow,
  &_swigt__p_GDALDriverShadow,
  &_swigt__p_GDALMajorObjectShadow,
  &_swigt__p_GDALProgressFunc,
  &_swigt__p_GDALRasterAttributeTableShadow,
  &_swigt__p_GDALRasterBandShadow,
  &_swigt__p_GDALTransformerInfoShadow,
  &_swigt__p_GDAL_GCP,
  &_swigt__p_OGRLayerShadow,
  &_swigt__p_char,
  &_swigt__p_double,
  &_swigt__p_f_double_p_q_const__char_p_void__int,
  &_swigt__p_int,
  &_swigt__p_p_GDALRasterBandShadow,
  &_swigt__p_p_GDAL_GCP,
  &_swigt__p_p_char,
  &_swigt__p_p_int,
  &_swigt__p_p_void,
  &_swigt__p_void,
};

static swig_cast_info _swigc__p_CPLErrorHandler[] = {  {&_swigt__p_CPLErrorHandler, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_CPLXMLNode[] = {  {&_swigt__p_CPLXMLNode, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_GByte[] = {  {&_swigt__p_GByte, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_GDALAsyncReaderShadow[] = {  {&_swigt__p_GDALAsyncReaderShadow, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_GDALColorEntry[] = {  {&_swigt__p_GDALColorEntry, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_GDALColorTableShadow[] = {  {&_swigt__p_GDALColorTableShadow, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_GDALDatasetShadow[] = {  {&_swigt__p_GDALDatasetShadow, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_GDALDriverShadow[] = {  {&_swigt__p_GDALDriverShadow, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_GDALMajorObjectShadow[] = {  {&_swigt__p_GDALMajorObjectShadow, 0, 0, 0},  {&_swigt__p_GDALDriverShadow, _p_GDALDriverShadowTo_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}};
static swig_cast_info _swigc__p_GDALProgressFunc[] = {  {&_swigt__p_GDALProgressFunc, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_GDALRasterAttributeTableShadow[] = {  {&_swigt__p_GDALRasterAttributeTableShadow, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_GDALRasterBandShadow[] = {  {&_swigt__p_GDALRasterBandShadow, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_GDALTransformerInfoShadow[] = {  {&_swigt__p_GDALTransformerInfoShadow, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_GDAL_GCP[] = {  {&_swigt__p_GDAL_GCP, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_OGRLayerShadow[] = {  {&_swigt__p_OGRLayerShadow, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_char[] = {  {&_swigt__p_char, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_double[] = {  {&_swigt__p_double, 0, 0, 0},{0, 0, 0, 0}};
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}};
static swig_cast_info _swigc__p_int[] = {  {&_swigt__p_int, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_p_GDALRasterBandShadow[] = {  {&_swigt__p_p_GDALRasterBandShadow, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_p_GDAL_GCP[] = {  {&_swigt__p_p_GDAL_GCP, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_p_char[] = {  {&_swigt__p_p_char, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_p_int[] = {  {&_swigt__p_p_int, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_p_void[] = {  {&_swigt__p_p_void, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_void[] = {  {&_swigt__p_void, 0, 0, 0},{0, 0, 0, 0}};

static swig_cast_info *swig_cast_initial[] = {
  _swigc__p_CPLErrorHandler,
  _swigc__p_CPLXMLNode,
  _swigc__p_GByte,
  _swigc__p_GDALAsyncReaderShadow,
  _swigc__p_GDALColorEntry,
  _swigc__p_GDALColorTableShadow,
  _swigc__p_GDALDatasetShadow,
  _swigc__p_GDALDriverShadow,
  _swigc__p_GDALMajorObjectShadow,
  _swigc__p_GDALProgressFunc,
  _swigc__p_GDALRasterAttributeTableShadow,
  _swigc__p_GDALRasterBandShadow,
  _swigc__p_GDALTransformerInfoShadow,
  _swigc__p_GDAL_GCP,
  _swigc__p_OGRLayerShadow,
  _swigc__p_char,
  _swigc__p_double,
  _swigc__p_f_double_p_q_const__char_p_void__int,
  _swigc__p_int,
  _swigc__p_p_GDALRasterBandShadow,
  _swigc__p_p_GDAL_GCP,
  _swigc__p_p_char,
  _swigc__p_p_int,
  _swigc__p_p_void,
  _swigc__p_void,
};


/* -------- TYPE CONVERSION AND EQUIVALENCE RULES (END) -------- */

/* end header section */
/* vdecl subsection */
static int le_swig__p_double=0; /* handle for _p_double */
static int le_swig__p_GByte=0; /* handle for _p_GByte */
static int le_swig__p_GDALColorEntry=0; /* handle for ColorEntry */
static int le_swig__p_p_void=0; /* handle for _p_p_void */
static int le_swig__p_void=0; /* handle for _p_void */
static int le_swig__p_p_char=0; /* handle for _p_p_char */
static int le_swig__p_char=0; /* handle for _p_char */
static int le_swig__p_GDAL_GCP=0; /* handle for GCP */
static int le_swig__p_p_GDAL_GCP=0; /* handle for _p_p_GDAL_GCP */
static int le_swig__p_CPLErrorHandler=0; /* handle for _p_CPLErrorHandler */
static int le_swig__p_CPLXMLNode=0; /* handle for _p_CPLXMLNode */
static int le_swig__p_GDALColorTableShadow=0; /* handle for ColorTable */
static int le_swig__p_GDALRasterAttributeTableShadow=0; /* handle for RasterAttributeTable */
static int le_swig__p_GDALTransformerInfoShadow=0; /* handle for Transformer */
static int le_swig__p_f_double_p_q_const__char_p_void__int=0; /* handle for _p_f_double_p_q_const__char_p_void__int */
static int le_swig__p_int=0; /* handle for _p_int */
static int le_swig__p_GDALDatasetShadow=0; /* handle for Dataset */
static int le_swig__p_GDALDriverShadow=0; /* handle for Driver */
static int le_swig__p_GDALMajorObjectShadow=0; /* handle for MajorObject */
static int le_swig__p_GDALProgressFunc=0; /* handle for _p_GDALProgressFunc */
static int le_swig__p_GDALAsyncReaderShadow=0; /* handle for AsyncReader */
static int le_swig__p_GDALRasterBandShadow=0; /* handle for Band */
static int le_swig__p_p_int=0; /* handle for _p_p_int */
static int le_swig__p_OGRLayerShadow=0; /* handle for _p_OGRLayerShadow */
static int le_swig__p_p_GDALRasterBandShadow=0; /* handle for _p_p_GDALRasterBandShadow */
/* end vdecl subsection */
/* wrapper section */
ZEND_NAMED_FUNCTION(_wrap_Debug) {
  char *arg1 = (char *) 0 ;
  char *arg2 = (char *) 0 ;
  zval **args[2];
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 2 || zend_get_parameters_array_ex(2, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  
  /*@SWIG:/usr/share/swig1.3/php/utils.i,26,CONVERT_STRING_IN@*/
  if ((*args[0])->type==IS_NULL) {
    arg1 = (char *) 0;
  } else {
    convert_to_string_ex(args[0]);
    arg1 = (char *) Z_STRVAL_PP(args[0]);
  }
  /*@SWIG@*/;
  
  
  /*@SWIG:/usr/share/swig1.3/php/utils.i,26,CONVERT_STRING_IN@*/
  if ((*args[1])->type==IS_NULL) {
    arg2 = (char *) 0;
  } else {
    convert_to_string_ex(args[1]);
    arg2 = (char *) Z_STRVAL_PP(args[1]);
  }
  /*@SWIG@*/;
  
  Debug((char const *)arg1,(char const *)arg2);
  
  return;
fail:
  zend_error_noreturn(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_PushErrorHandler__SWIG_0) {
  char *arg1 = (char *) NULL ;
  zval **args[1];
  int arg_count;
  CPLErr result;
  
  SWIG_ResetError();
  arg_count = ZEND_NUM_ARGS();
  if(arg_count<0 || arg_count>1 ||
    zend_get_parameters_array_ex(arg_count,args)!=SUCCESS)
  WRONG_PARAM_COUNT;
  
  if(arg_count > 0) {
    /*@SWIG:/usr/share/swig1.3/php/utils.i,26,CONVERT_STRING_IN@*/
    if ((*args[0])->type==IS_NULL) {
      arg1 = (char *) 0;
    } else {
      convert_to_string_ex(args[0]);
      arg1 = (char *) Z_STRVAL_PP(args[0]);
    }
    /*@SWIG@*/;
    
  }
  result = (CPLErr)PushErrorHandler((char const *)arg1);
  {
    ZVAL_LONG(return_value,result);
  }
  return;
fail:
  zend_error_noreturn(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_Error) {
  CPLErr arg1 = (CPLErr) CE_Failure ;
  int arg2 = (int) 0 ;
  char *arg3 = (char *) "error" ;
  zval **args[3];
  int arg_count;
  
  SWIG_ResetError();
  arg_count = ZEND_NUM_ARGS();
  if(arg_count<0 || arg_count>3 ||
    zend_get_parameters_array_ex(arg_count,args)!=SUCCESS)
  WRONG_PARAM_COUNT;
  
  if(arg_count > 0) {
    /*@SWIG:/usr/share/swig1.3/php/utils.i,7,CONVERT_INT_IN@*/
    convert_to_long_ex(args[0]);
    arg1 = (CPLErr) Z_LVAL_PP(args[0]);
    /*@SWIG@*/;
    
  }
  if(arg_count > 1) {
    /*@SWIG:/usr/share/swig1.3/php/utils.i,7,CONVERT_INT_IN@*/
    convert_to_long_ex(args[1]);
    arg2 = (int) Z_LVAL_PP(args[1]);
    /*@SWIG@*/;
    
  }
  if(arg_count > 2) {
    /*@SWIG:/usr/share/swig1.3/php/utils.i,26,CONVERT_STRING_IN@*/
    if ((*args[2])->type==IS_NULL) {
      arg3 = (char *) 0;
    } else {
      convert_to_string_ex(args[2]);
      arg3 = (char *) Z_STRVAL_PP(args[2]);
    }
    /*@SWIG@*/;
    
  }
  Error(arg1,arg2,(char const *)arg3);
  
  return;
fail:
  zend_error_noreturn(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_PushErrorHandler__SWIG_1) {
  CPLErrorHandler arg1 ;
  CPLErrorHandler *tmp1 ;
  zval **args[1];
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 1 || zend_get_parameters_array_ex(1, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*args[0], (void **) &tmp1, SWIGTYPE_p_CPLErrorHandler, 0) < 0 || tmp1 == NULL) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of PushErrorHandler. Expected SWIGTYPE_p_CPLErrorHandler");
    }
    arg1 = *tmp1;
  }
  CPLPushErrorHandler(arg1);
  
  return;
fail:
  zend_error_noreturn(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_PushErrorHandler) {
  int argc;
  zval **argv[1];
  
  argc = ZEND_NUM_ARGS();
  zend_get_parameters_array_ex(argc,argv);
  if ((argc >= 0) && (argc <= 1)) {
    int _v;
    if (argc <= 0) {
      return _wrap_PushErrorHandler__SWIG_0(INTERNAL_FUNCTION_PARAM_PASSTHRU);
    }
    _v = (Z_TYPE_PP(argv[0]) == IS_STRING); 
    if (_v) {
      return _wrap_PushErrorHandler__SWIG_0(INTERNAL_FUNCTION_PARAM_PASSTHRU);
    }
  }
  if (argc == 1) {
    int _v;
    {
      void *tmp;
      _v = (SWIG_ConvertPtr(*argv[0], (void **)&tmp, SWIGTYPE_p_CPLErrorHandler, 0) >= 0);
    }
    if (_v) {
      return _wrap_PushErrorHandler__SWIG_1(INTERNAL_FUNCTION_PARAM_PASSTHRU);
    }
  }
  
  SWIG_ErrorCode() = E_ERROR;
  SWIG_ErrorMsg() = "No matching function for overloaded 'PushErrorHandler'";
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_PopErrorHandler) {
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 0) {
    WRONG_PARAM_COUNT;
  }
  
  CPLPopErrorHandler();
  
  return;
fail:
  zend_error_noreturn(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_ErrorReset) {
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 0) {
    WRONG_PARAM_COUNT;
  }
  
  CPLErrorReset();
  
  return;
fail:
  zend_error_noreturn(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_EscapeString) {
  int arg1 ;
  char *arg2 = (char *) 0 ;
  int arg3 = (int) CPLES_SQL ;
  zval **args[2];
  int arg_count;
  char *result = 0 ;
  
  SWIG_ResetError();
  arg_count = ZEND_NUM_ARGS();
  if(arg_count<1 || arg_count>2 ||
    zend_get_parameters_array_ex(arg_count,args)!=SUCCESS)
  WRONG_PARAM_COUNT;
  
  {
    /* %typemap(in,numinputs=1) (int nLen, char *pBuf ) */
    convert_to_string_ex(args[0]);
    arg2 = Z_STRVAL_PP(args[0]);
    arg1 = Z_STRLEN_PP(args[0]);
  }
  if(arg_count > 1) {
    /*@SWIG:/usr/share/swig1.3/php/utils.i,7,CONVERT_INT_IN@*/
    convert_to_long_ex(args[1]);
    arg3 = (int) Z_LVAL_PP(args[1]);
    /*@SWIG@*/;
    
  }
  result = (char *)EscapeString(arg1,arg2,arg3);
  {
    if(!result) {
      ZVAL_NULL(return_value);
    } else {
      ZVAL_STRING(return_value, (char *)result, 1);
    }
  }
  return;
fail:
  zend_error_noreturn(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_GetLastErrorNo) {
  int result;
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 0) {
    WRONG_PARAM_COUNT;
  }
  
  result = (int)CPLGetLastErrorNo();
  {
    ZVAL_LONG(return_value,result);
  }
  return;
fail:
  zend_error_noreturn(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_GetLastErrorType) {
  CPLErr result;
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 0) {
    WRONG_PARAM_COUNT;
  }
  
  result = (CPLErr)CPLGetLastErrorType();
  {
    ZVAL_LONG(return_value,result);
  }
  return;
fail:
  zend_error_noreturn(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_GetLastErrorMsg) {
  char *result = 0 ;
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 0) {
    WRONG_PARAM_COUNT;
  }
  
  result = (char *)CPLGetLastErrorMsg();
  {
    if(!result) {
      ZVAL_NULL(return_value);
    } else {
      ZVAL_STRING(return_value, (char *)result, 1);
    }
  }
  return;
fail:
  zend_error_noreturn(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_PushFinderLocation) {
  char *arg1 = (char *) 0 ;
  zval **args[1];
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 1 || zend_get_parameters_array_ex(1, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  
  /*@SWIG:/usr/share/swig1.3/php/utils.i,26,CONVERT_STRING_IN@*/
  if ((*args[0])->type==IS_NULL) {
    arg1 = (char *) 0;
  } else {
    convert_to_string_ex(args[0]);
    arg1 = (char *) Z_STRVAL_PP(args[0]);
  }
  /*@SWIG@*/;
  
  CPLPushFinderLocation((char const *)arg1);
  
  return;
fail:
  zend_error_noreturn(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_PopFinderLocation) {
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 0) {
    WRONG_PARAM_COUNT;
  }
  
  CPLPopFinderLocation();
  
  return;
fail:
  zend_error_noreturn(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_FinderClean) {
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 0) {
    WRONG_PARAM_COUNT;
  }
  
  CPLFinderClean();
  
  return;
fail:
  zend_error_noreturn(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_FindFile) {
  char *arg1 = (char *) 0 ;
  char *arg2 = (char *) 0 ;
  zval **args[2];
  char *result = 0 ;
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 2 || zend_get_parameters_array_ex(2, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  
  /*@SWIG:/usr/share/swig1.3/php/utils.i,26,CONVERT_STRING_IN@*/
  if ((*args[0])->type==IS_NULL) {
    arg1 = (char *) 0;
  } else {
    convert_to_string_ex(args[0]);
    arg1 = (char *) Z_STRVAL_PP(args[0]);
  }
  /*@SWIG@*/;
  
  
  /*@SWIG:/usr/share/swig1.3/php/utils.i,26,CONVERT_STRING_IN@*/
  if ((*args[1])->type==IS_NULL) {
    arg2 = (char *) 0;
  } else {
    convert_to_string_ex(args[1]);
    arg2 = (char *) Z_STRVAL_PP(args[1]);
  }
  /*@SWIG@*/;
  
  result = (char *)CPLFindFile((char const *)arg1,(char const *)arg2);
  {
    if(!result) {
      ZVAL_NULL(return_value);
    } else {
      ZVAL_STRING(return_value, (char *)result, 1);
    }
  }
  return;
fail:
  zend_error_noreturn(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_ReadDir) {
  char *arg1 = (char *) 0 ;
  zval **args[1];
  char **result = 0 ;
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 1 || zend_get_parameters_array_ex(1, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  
  /*@SWIG:/usr/share/swig1.3/php/utils.i,26,CONVERT_STRING_IN@*/
  if ((*args[0])->type==IS_NULL) {
    arg1 = (char *) 0;
  } else {
    convert_to_string_ex(args[0]);
    arg1 = (char *) Z_STRVAL_PP(args[0]);
  }
  /*@SWIG@*/;
  
  result = (char **)VSIReadDir((char const *)arg1);
  
  SWIG_SetPointerZval(return_value, (void *)result, SWIGTYPE_p_p_char, 0);
  
  return;
fail:
  zend_error_noreturn(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_SetConfigOption) {
  char *arg1 = (char *) 0 ;
  char *arg2 = (char *) 0 ;
  zval **args[2];
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 2 || zend_get_parameters_array_ex(2, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  
  /*@SWIG:/usr/share/swig1.3/php/utils.i,26,CONVERT_STRING_IN@*/
  if ((*args[0])->type==IS_NULL) {
    arg1 = (char *) 0;
  } else {
    convert_to_string_ex(args[0]);
    arg1 = (char *) Z_STRVAL_PP(args[0]);
  }
  /*@SWIG@*/;
  
  
  /*@SWIG:/usr/share/swig1.3/php/utils.i,26,CONVERT_STRING_IN@*/
  if ((*args[1])->type==IS_NULL) {
    arg2 = (char *) 0;
  } else {
    convert_to_string_ex(args[1]);
    arg2 = (char *) Z_STRVAL_PP(args[1]);
  }
  /*@SWIG@*/;
  
  {
    if (!arg1) {
      SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
    }
  }
  CPLSetConfigOption((char const *)arg1,(char const *)arg2);
  
  return;
fail:
  zend_error_noreturn(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_GetConfigOption) {
  char *arg1 = (char *) 0 ;
  char *arg2 = (char *) NULL ;
  zval **args[2];
  int arg_count;
  char *result = 0 ;
  
  SWIG_ResetError();
  arg_count = ZEND_NUM_ARGS();
  if(arg_count<1 || arg_count>2 ||
    zend_get_parameters_array_ex(arg_count,args)!=SUCCESS)
  WRONG_PARAM_COUNT;
  
  
  /*@SWIG:/usr/share/swig1.3/php/utils.i,26,CONVERT_STRING_IN@*/
  if ((*args[0])->type==IS_NULL) {
    arg1 = (char *) 0;
  } else {
    convert_to_string_ex(args[0]);
    arg1 = (char *) Z_STRVAL_PP(args[0]);
  }
  /*@SWIG@*/;
  
  if(arg_count > 1) {
    /*@SWIG:/usr/share/swig1.3/php/utils.i,26,CONVERT_STRING_IN@*/
    if ((*args[1])->type==IS_NULL) {
      arg2 = (char *) 0;
    } else {
      convert_to_string_ex(args[1]);
      arg2 = (char *) Z_STRVAL_PP(args[1]);
    }
    /*@SWIG@*/;
    
  }
  {
    if (!arg1) {
      SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
    }
  }
  result = (char *)wrapper_CPLGetConfigOption((char const *)arg1,(char const *)arg2);
  {
    if(!result) {
      ZVAL_NULL(return_value);
    } else {
      ZVAL_STRING(return_value, (char *)result, 1);
    }
  }
  return;
fail:
  zend_error_noreturn(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_CPLBinaryToHex) {
  int arg1 ;
  GByte *arg2 = (GByte *) 0 ;
  zval **args[2];
  char *result = 0 ;
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 2 || zend_get_parameters_array_ex(2, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  
  /*@SWIG:/usr/share/swig1.3/php/utils.i,7,CONVERT_INT_IN@*/
  convert_to_long_ex(args[0]);
  arg1 = (int) Z_LVAL_PP(args[0]);
  /*@SWIG@*/;
  
  {
    if(SWIG_ConvertPtr(*args[1], (void **) &arg2, SWIGTYPE_p_GByte, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 2 of CPLBinaryToHex. Expected SWIGTYPE_p_GByte");
    }
  }
  result = (char *)CPLBinaryToHex(arg1,(GByte const *)arg2);
  {
    if(!result) {
      ZVAL_NULL(return_value);
    } else {
      ZVAL_STRING(return_value, (char *)result, 1);
    }
  }
  return;
fail:
  zend_error_noreturn(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_CPLHexToBinary) {
  char *arg1 = (char *) 0 ;
  int *arg2 = (int *) 0 ;
  zval **args[2];
  GByte *result = 0 ;
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 2 || zend_get_parameters_array_ex(2, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  
  /*@SWIG:/usr/share/swig1.3/php/utils.i,26,CONVERT_STRING_IN@*/
  if ((*args[0])->type==IS_NULL) {
    arg1 = (char *) 0;
  } else {
    convert_to_string_ex(args[0]);
    arg1 = (char *) Z_STRVAL_PP(args[0]);
  }
  /*@SWIG@*/;
  
  {
    if(SWIG_ConvertPtr(*args[1], (void **) &arg2, SWIGTYPE_p_int, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 2 of CPLHexToBinary. Expected SWIGTYPE_p_int");
    }
  }
  result = (GByte *)CPLHexToBinary((char const *)arg1,arg2);
  
  SWIG_SetPointerZval(return_value, (void *)result, SWIGTYPE_p_GByte, 0);
  
  return;
fail:
  zend_error_noreturn(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_FileFromMemBuffer) {
  char *arg1 = (char *) 0 ;
  int arg2 ;
  GByte *arg3 = (GByte *) 0 ;
  zval **args[3];
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 3 || zend_get_parameters_array_ex(3, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  
  /*@SWIG:/usr/share/swig1.3/php/utils.i,26,CONVERT_STRING_IN@*/
  if ((*args[0])->type==IS_NULL) {
    arg1 = (char *) 0;
  } else {
    convert_to_string_ex(args[0]);
    arg1 = (char *) Z_STRVAL_PP(args[0]);
  }
  /*@SWIG@*/;
  
  
  /*@SWIG:/usr/share/swig1.3/php/utils.i,7,CONVERT_INT_IN@*/
  convert_to_long_ex(args[1]);
  arg2 = (int) Z_LVAL_PP(args[1]);
  /*@SWIG@*/;
  
  {
    if(SWIG_ConvertPtr(*args[2], (void **) &arg3, SWIGTYPE_p_GByte, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 3 of FileFromMemBuffer. Expected SWIGTYPE_p_GByte");
    }
  }
  wrapper_VSIFileFromMemBuffer((char const *)arg1,arg2,(GByte const *)arg3);
  
  return;
fail:
  zend_error_noreturn(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_Unlink) {
  char *arg1 = (char *) 0 ;
  zval **args[1];
  int result;
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 1 || zend_get_parameters_array_ex(1, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  
  /*@SWIG:/usr/share/swig1.3/php/utils.i,26,CONVERT_STRING_IN@*/
  if ((*args[0])->type==IS_NULL) {
    arg1 = (char *) 0;
  } else {
    convert_to_string_ex(args[0]);
    arg1 = (char *) Z_STRVAL_PP(args[0]);
  }
  /*@SWIG@*/;
  
  {
    if (!arg1) {
      SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
    }
  }
  result = (int)VSIUnlink((char const *)arg1);
  {
    ZVAL_LONG(return_value,result);
  }
  return;
fail:
  zend_error_noreturn(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_HasThreadSupport) {
  int result;
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 0) {
    WRONG_PARAM_COUNT;
  }
  
  result = (int)wrapper_HasThreadSupport();
  {
    ZVAL_LONG(return_value,result);
  }
  return;
fail:
  zend_error_noreturn(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_Mkdir) {
  char *arg1 = (char *) 0 ;
  int arg2 ;
  zval **args[2];
  int result;
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 2 || zend_get_parameters_array_ex(2, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  
  /*@SWIG:/usr/share/swig1.3/php/utils.i,26,CONVERT_STRING_IN@*/
  if ((*args[0])->type==IS_NULL) {
    arg1 = (char *) 0;
  } else {
    convert_to_string_ex(args[0]);
    arg1 = (char *) Z_STRVAL_PP(args[0]);
  }
  /*@SWIG@*/;
  
  
  /*@SWIG:/usr/share/swig1.3/php/utils.i,7,CONVERT_INT_IN@*/
  convert_to_long_ex(args[1]);
  arg2 = (int) Z_LVAL_PP(args[1]);
  /*@SWIG@*/;
  
  result = (int)VSIMkdir((char const *)arg1,arg2);
  {
    ZVAL_LONG(return_value,result);
  }
  return;
fail:
  zend_error_noreturn(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_Rmdir) {
  char *arg1 = (char *) 0 ;
  zval **args[1];
  int result;
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 1 || zend_get_parameters_array_ex(1, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  
  /*@SWIG:/usr/share/swig1.3/php/utils.i,26,CONVERT_STRING_IN@*/
  if ((*args[0])->type==IS_NULL) {
    arg1 = (char *) 0;
  } else {
    convert_to_string_ex(args[0]);
    arg1 = (char *) Z_STRVAL_PP(args[0]);
  }
  /*@SWIG@*/;
  
  result = (int)VSIRmdir((char const *)arg1);
  {
    ZVAL_LONG(return_value,result);
  }
  return;
fail:
  zend_error_noreturn(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_Rename) {
  char *arg1 = (char *) 0 ;
  char *arg2 = (char *) 0 ;
  zval **args[2];
  int result;
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 2 || zend_get_parameters_array_ex(2, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  
  /*@SWIG:/usr/share/swig1.3/php/utils.i,26,CONVERT_STRING_IN@*/
  if ((*args[0])->type==IS_NULL) {
    arg1 = (char *) 0;
  } else {
    convert_to_string_ex(args[0]);
    arg1 = (char *) Z_STRVAL_PP(args[0]);
  }
  /*@SWIG@*/;
  
  
  /*@SWIG:/usr/share/swig1.3/php/utils.i,26,CONVERT_STRING_IN@*/
  if ((*args[1])->type==IS_NULL) {
    arg2 = (char *) 0;
  } else {
    convert_to_string_ex(args[1]);
    arg2 = (char *) Z_STRVAL_PP(args[1]);
  }
  /*@SWIG@*/;
  
  result = (int)VSIRename((char const *)arg1,(char const *)arg2);
  {
    ZVAL_LONG(return_value,result);
  }
  return;
fail:
  zend_error_noreturn(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_VSIFOpenL) {
  char *arg1 = (char *) 0 ;
  char *arg2 = (char *) 0 ;
  zval **args[2];
  FILE *result = 0 ;
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 2 || zend_get_parameters_array_ex(2, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  
  /*@SWIG:/usr/share/swig1.3/php/utils.i,26,CONVERT_STRING_IN@*/
  if ((*args[0])->type==IS_NULL) {
    arg1 = (char *) 0;
  } else {
    convert_to_string_ex(args[0]);
    arg1 = (char *) Z_STRVAL_PP(args[0]);
  }
  /*@SWIG@*/;
  
  
  /*@SWIG:/usr/share/swig1.3/php/utils.i,26,CONVERT_STRING_IN@*/
  if ((*args[1])->type==IS_NULL) {
    arg2 = (char *) 0;
  } else {
    convert_to_string_ex(args[1]);
    arg2 = (char *) Z_STRVAL_PP(args[1]);
  }
  /*@SWIG@*/;
  
  result = (FILE *)VSIFOpenL((char const *)arg1,(char const *)arg2);
  
  SWIG_SetPointerZval(return_value, (void *)result, SWIGTYPE_p_void, 0);
  
  return;
fail:
  zend_error_noreturn(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_VSIFCloseL) {
  FILE *arg1 = (FILE *) 0 ;
  zval **args[1];
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 1 || zend_get_parameters_array_ex(1, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*args[0], (void **) &arg1, 0, 0) < 0) {
      /* Allow NULL from php for void* */
      if ((*args[0])->type==IS_NULL) arg1=0;
      else
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of VSIFCloseL. Expected SWIGTYPE_p_p_void");
    }
  }
  VSIFCloseL(arg1);
  
  return;
fail:
  zend_error_noreturn(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_VSIFSeekL) {
  FILE *arg1 = (FILE *) 0 ;
  long arg2 ;
  int arg3 ;
  zval **args[3];
  int result;
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 3 || zend_get_parameters_array_ex(3, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*args[0], (void **) &arg1, 0, 0) < 0) {
      /* Allow NULL from php for void* */
      if ((*args[0])->type==IS_NULL) arg1=0;
      else
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of VSIFSeekL. Expected SWIGTYPE_p_p_void");
    }
  }
  
  /*@SWIG:/usr/share/swig1.3/php/utils.i,7,CONVERT_INT_IN@*/
  convert_to_long_ex(args[1]);
  arg2 = (long) Z_LVAL_PP(args[1]);
  /*@SWIG@*/;
  
  
  /*@SWIG:/usr/share/swig1.3/php/utils.i,7,CONVERT_INT_IN@*/
  convert_to_long_ex(args[2]);
  arg3 = (int) Z_LVAL_PP(args[2]);
  /*@SWIG@*/;
  
  result = (int)VSIFSeekL(arg1,arg2,arg3);
  {
    ZVAL_LONG(return_value,result);
  }
  return;
fail:
  zend_error_noreturn(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_VSIFTellL) {
  FILE *arg1 = (FILE *) 0 ;
  zval **args[1];
  long result;
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 1 || zend_get_parameters_array_ex(1, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*args[0], (void **) &arg1, 0, 0) < 0) {
      /* Allow NULL from php for void* */
      if ((*args[0])->type==IS_NULL) arg1=0;
      else
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of VSIFTellL. Expected SWIGTYPE_p_p_void");
    }
  }
  result = (long)VSIFTellL(arg1);
  {
    ZVAL_LONG(return_value,result);
  }
  return;
fail:
  zend_error_noreturn(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_VSIFWriteL) {
  char *arg1 = (char *) 0 ;
  int arg2 ;
  int arg3 ;
  FILE *arg4 = (FILE *) 0 ;
  zval **args[4];
  int result;
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 4 || zend_get_parameters_array_ex(4, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  
  /*@SWIG:/usr/share/swig1.3/php/utils.i,26,CONVERT_STRING_IN@*/
  if ((*args[0])->type==IS_NULL) {
    arg1 = (char *) 0;
  } else {
    convert_to_string_ex(args[0]);
    arg1 = (char *) Z_STRVAL_PP(args[0]);
  }
  /*@SWIG@*/;
  
  
  /*@SWIG:/usr/share/swig1.3/php/utils.i,7,CONVERT_INT_IN@*/
  convert_to_long_ex(args[1]);
  arg2 = (int) Z_LVAL_PP(args[1]);
  /*@SWIG@*/;
  
  
  /*@SWIG:/usr/share/swig1.3/php/utils.i,7,CONVERT_INT_IN@*/
  convert_to_long_ex(args[2]);
  arg3 = (int) Z_LVAL_PP(args[2]);
  /*@SWIG@*/;
  
  {
    if(SWIG_ConvertPtr(*args[3], (void **) &arg4, 0, 0) < 0) {
      /* Allow NULL from php for void* */
      if ((*args[3])->type==IS_NULL) arg4=0;
      else
      SWIG_PHP_Error(E_ERROR, "Type error in argument 4 of VSIFWriteL. Expected SWIGTYPE_p_p_void");
    }
  }
  result = (int)VSIFWriteL((char const *)arg1,arg2,arg3,arg4);
  {
    ZVAL_LONG(return_value,result);
  }
  return;
fail:
  zend_error_noreturn(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_MajorObject_GetDescription) {
  GDALMajorObjectShadow *arg1 = (GDALMajorObjectShadow *) 0 ;
  zval **args[1];
  char *result = 0 ;
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 1 || zend_get_parameters_array_ex(1, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*args[0], (void **) &arg1, SWIGTYPE_p_GDALMajorObjectShadow, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of MajorObject_GetDescription. Expected SWIGTYPE_p_GDALMajorObjectShadow");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  result = (char *)GDALMajorObjectShadow_GetDescription(arg1);
  {
    if(!result) {
      ZVAL_NULL(return_value);
    } else {
      ZVAL_STRING(return_value, (char *)result, 1);
    }
  }
  return;
fail:
  zend_error_noreturn(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_MajorObject_SetDescription) {
  GDALMajorObjectShadow *arg1 = (GDALMajorObjectShadow *) 0 ;
  char *arg2 = (char *) 0 ;
  zval **args[2];
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 2 || zend_get_parameters_array_ex(2, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*args[0], (void **) &arg1, SWIGTYPE_p_GDALMajorObjectShadow, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of MajorObject_SetDescription. Expected SWIGTYPE_p_GDALMajorObjectShadow");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  
  /*@SWIG:/usr/share/swig1.3/php/utils.i,26,CONVERT_STRING_IN@*/
  if ((*args[1])->type==IS_NULL) {
    arg2 = (char *) 0;
  } else {
    convert_to_string_ex(args[1]);
    arg2 = (char *) Z_STRVAL_PP(args[1]);
  }
  /*@SWIG@*/;
  
  GDALMajorObjectShadow_SetDescription(arg1,(char const *)arg2);
  
  return;
fail:
  zend_error_noreturn(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_MajorObject_GetMetadata_Dict) {
  GDALMajorObjectShadow *arg1 = (GDALMajorObjectShadow *) 0 ;
  char *arg2 = (char *) "" ;
  zval **args[2];
  int arg_count;
  char **result = 0 ;
  
  SWIG_ResetError();
  arg_count = ZEND_NUM_ARGS();
  if(arg_count<1 || arg_count>2 ||
    zend_get_parameters_array_ex(arg_count,args)!=SUCCESS)
  WRONG_PARAM_COUNT;
  
  {
    if(SWIG_ConvertPtr(*args[0], (void **) &arg1, SWIGTYPE_p_GDALMajorObjectShadow, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of MajorObject_GetMetadata_Dict. Expected SWIGTYPE_p_GDALMajorObjectShadow");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  if(arg_count > 1) {
    /*@SWIG:/usr/share/swig1.3/php/utils.i,26,CONVERT_STRING_IN@*/
    if ((*args[1])->type==IS_NULL) {
      arg2 = (char *) 0;
    } else {
      convert_to_string_ex(args[1]);
      arg2 = (char *) Z_STRVAL_PP(args[1]);
    }
    /*@SWIG@*/;
    
  }
  result = (char **)GDALMajorObjectShadow_GetMetadata_Dict(arg1,(char const *)arg2);
  {
    /* %typemap(out) char **dict */
    char **stringarray = result;
    array_init(return_value);
    if ( stringarray != NULL ) {
      while (*stringarray != NULL ) {
        char const *valptr;
        char *keyptr;
        valptr = CPLParseNameValue( *stringarray, &keyptr );
        if ( valptr != 0 ) {
          add_assoc_string(return_value,keyptr,(char*)valptr,1);
          CPLFree( keyptr );
        }
        stringarray++;
      }
    }
  }
  return;
fail:
  zend_error_noreturn(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_MajorObject_GetMetadata_List) {
  GDALMajorObjectShadow *arg1 = (GDALMajorObjectShadow *) 0 ;
  char *arg2 = (char *) "" ;
  zval **args[2];
  int arg_count;
  char **result = 0 ;
  
  SWIG_ResetError();
  arg_count = ZEND_NUM_ARGS();
  if(arg_count<1 || arg_count>2 ||
    zend_get_parameters_array_ex(arg_count,args)!=SUCCESS)
  WRONG_PARAM_COUNT;
  
  {
    if(SWIG_ConvertPtr(*args[0], (void **) &arg1, SWIGTYPE_p_GDALMajorObjectShadow, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of MajorObject_GetMetadata_List. Expected SWIGTYPE_p_GDALMajorObjectShadow");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  if(arg_count > 1) {
    /*@SWIG:/usr/share/swig1.3/php/utils.i,26,CONVERT_STRING_IN@*/
    if ((*args[1])->type==IS_NULL) {
      arg2 = (char *) 0;
    } else {
      convert_to_string_ex(args[1]);
      arg2 = (char *) Z_STRVAL_PP(args[1]);
    }
    /*@SWIG@*/;
    
  }
  result = (char **)GDALMajorObjectShadow_GetMetadata_List(arg1,(char const *)arg2);
  {
    /* %typemap(out) char ** -> ( string ) */
    char **stringarray = result;
    if ( stringarray == NULL ) {
      RETVAL_NULL();
    }
    else {
      int len = CSLCount( stringarray );
      array_init(return_value);
      for ( int i = 0; i < len; ++i, ++stringarray ) {
        add_next_index_string( return_value, *stringarray, 1 );
      }
    }
  }
  return;
fail:
  zend_error_noreturn(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_MajorObject_SetMetadata__SWIG_0) {
  GDALMajorObjectShadow *arg1 = (GDALMajorObjectShadow *) 0 ;
  char **arg2 = (char **) 0 ;
  char *arg3 = (char *) "" ;
  zval **args[3];
  int arg_count;
  CPLErr result;
  
  SWIG_ResetError();
  arg_count = ZEND_NUM_ARGS();
  if(arg_count<2 || arg_count>3 ||
    zend_get_parameters_array_ex(arg_count,args)!=SUCCESS)
  WRONG_PARAM_COUNT;
  
  {
    if(SWIG_ConvertPtr(*args[0], (void **) &arg1, SWIGTYPE_p_GDALMajorObjectShadow, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of MajorObject_SetMetadata. Expected SWIGTYPE_p_GDALMajorObjectShadow");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    /* %typemap(in) char **dict */
    zend_error(E_ERROR,"Typemap (in) char **dict not properly defined");
    /*  if ( PySequence_Check( args[1] ) ) {
        int size = PySequence_Size(args[1]);
        for (int i = 0; i < size; i++) {
          char *pszItem = NULL;
          if ( ! PyArg_Parse( PySequence_GetItem(args[1],i), "s", &pszItem ) ) {
            PyErr_SetString(PyExc_TypeError,"sequence must contain strings");
            SWIG_fail;
          }
          arg2 = CSLAddString( arg2, pszItem );
        }
      }
    */
  }
  if(arg_count > 2) {
    /*@SWIG:/usr/share/swig1.3/php/utils.i,26,CONVERT_STRING_IN@*/
    if ((*args[2])->type==IS_NULL) {
      arg3 = (char *) 0;
    } else {
      convert_to_string_ex(args[2]);
      arg3 = (char *) Z_STRVAL_PP(args[2]);
    }
    /*@SWIG@*/;
    
  }
  result = (CPLErr)GDALMajorObjectShadow_SetMetadata__SWIG_0(arg1,arg2,(char const *)arg3);
  {
    ZVAL_LONG(return_value,result);
  }
  {
    /* %typemap(freearg) char **dict */
    CSLDestroy( arg2 );
  }
  return;
fail:
  {
    /* %typemap(freearg) char **dict */
    CSLDestroy( arg2 );
  }
  zend_error_noreturn(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_MajorObject_SetMetadata__SWIG_1) {
  GDALMajorObjectShadow *arg1 = (GDALMajorObjectShadow *) 0 ;
  char *arg2 = (char *) 0 ;
  char *arg3 = (char *) "" ;
  zval **args[3];
  int arg_count;
  CPLErr result;
  
  SWIG_ResetError();
  arg_count = ZEND_NUM_ARGS();
  if(arg_count<2 || arg_count>3 ||
    zend_get_parameters_array_ex(arg_count,args)!=SUCCESS)
  WRONG_PARAM_COUNT;
  
  {
    if(SWIG_ConvertPtr(*args[0], (void **) &arg1, SWIGTYPE_p_GDALMajorObjectShadow, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of MajorObject_SetMetadata. Expected SWIGTYPE_p_GDALMajorObjectShadow");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  
  /*@SWIG:/usr/share/swig1.3/php/utils.i,26,CONVERT_STRING_IN@*/
  if ((*args[1])->type==IS_NULL) {
    arg2 = (char *) 0;
  } else {
    convert_to_string_ex(args[1]);
    arg2 = (char *) Z_STRVAL_PP(args[1]);
  }
  /*@SWIG@*/;
  
  if(arg_count > 2) {
    /*@SWIG:/usr/share/swig1.3/php/utils.i,26,CONVERT_STRING_IN@*/
    if ((*args[2])->type==IS_NULL) {
      arg3 = (char *) 0;
    } else {
      convert_to_string_ex(args[2]);
      arg3 = (char *) Z_STRVAL_PP(args[2]);
    }
    /*@SWIG@*/;
    
  }
  result = (CPLErr)GDALMajorObjectShadow_SetMetadata__SWIG_1(arg1,arg2,(char const *)arg3);
  {
    ZVAL_LONG(return_value,result);
  }
  return;
fail:
  zend_error_noreturn(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_MajorObject_SetMetadata) {
  int argc;
  zval **argv[3];
  
  argc = ZEND_NUM_ARGS();
  zend_get_parameters_array_ex(argc,argv);
  if ((argc >= 2) && (argc <= 3)) {
    int _v;
    {
      void *tmp;
      _v = (SWIG_ConvertPtr(*argv[0], (void**)&tmp, SWIGTYPE_p_GDALMajorObjectShadow, 0) >= 0);
    }
    if (_v) {
      {
        /* %typecheck(SWIG_TYPECHECK_POINTER) (char **dict) */
        _v = 0; //(PyMapping_Check(argv[1]) || PySequence_Check(argv[1]) ) ? 1 : 0;
      }
      if (_v) {
        if (argc <= 2) {
          return _wrap_MajorObject_SetMetadata__SWIG_0(INTERNAL_FUNCTION_PARAM_PASSTHRU);
        }
        _v = (Z_TYPE_PP(argv[2]) == IS_STRING); 
        if (_v) {
          return _wrap_MajorObject_SetMetadata__SWIG_0(INTERNAL_FUNCTION_PARAM_PASSTHRU);
        }
      }
    }
  }
  if ((argc >= 2) && (argc <= 3)) {
    int _v;
    {
      void *tmp;
      _v = (SWIG_ConvertPtr(*argv[0], (void**)&tmp, SWIGTYPE_p_GDALMajorObjectShadow, 0) >= 0);
    }
    if (_v) {
      _v = (Z_TYPE_PP(argv[1]) == IS_STRING); 
      if (_v) {
        if (argc <= 2) {
          return _wrap_MajorObject_SetMetadata__SWIG_1(INTERNAL_FUNCTION_PARAM_PASSTHRU);
        }
        _v = (Z_TYPE_PP(argv[2]) == IS_STRING); 
        if (_v) {
          return _wrap_MajorObject_SetMetadata__SWIG_1(INTERNAL_FUNCTION_PARAM_PASSTHRU);
        }
      }
    }
  }
  
  SWIG_ErrorCode() = E_ERROR;
  SWIG_ErrorMsg() = "No matching function for overloaded 'MajorObject_SetMetadata'";
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_MajorObject_GetMetadataItem) {
  GDALMajorObjectShadow *arg1 = (GDALMajorObjectShadow *) 0 ;
  char *arg2 = (char *) 0 ;
  char *arg3 = (char *) "" ;
  zval **args[3];
  int arg_count;
  char *result = 0 ;
  
  SWIG_ResetError();
  arg_count = ZEND_NUM_ARGS();
  if(arg_count<2 || arg_count>3 ||
    zend_get_parameters_array_ex(arg_count,args)!=SUCCESS)
  WRONG_PARAM_COUNT;
  
  {
    if(SWIG_ConvertPtr(*args[0], (void **) &arg1, SWIGTYPE_p_GDALMajorObjectShadow, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of MajorObject_GetMetadataItem. Expected SWIGTYPE_p_GDALMajorObjectShadow");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  
  /*@SWIG:/usr/share/swig1.3/php/utils.i,26,CONVERT_STRING_IN@*/
  if ((*args[1])->type==IS_NULL) {
    arg2 = (char *) 0;
  } else {
    convert_to_string_ex(args[1]);
    arg2 = (char *) Z_STRVAL_PP(args[1]);
  }
  /*@SWIG@*/;
  
  if(arg_count > 2) {
    /*@SWIG:/usr/share/swig1.3/php/utils.i,26,CONVERT_STRING_IN@*/
    if ((*args[2])->type==IS_NULL) {
      arg3 = (char *) 0;
    } else {
      convert_to_string_ex(args[2]);
      arg3 = (char *) Z_STRVAL_PP(args[2]);
    }
    /*@SWIG@*/;
    
  }
  {
    if (!arg2) {
      SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
    }
  }
  result = (char *)GDALMajorObjectShadow_GetMetadataItem(arg1,(char const *)arg2,(char const *)arg3);
  {
    if(!result) {
      ZVAL_NULL(return_value);
    } else {
      ZVAL_STRING(return_value, (char *)result, 1);
    }
  }
  return;
fail:
  zend_error_noreturn(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_MajorObject_SetMetadataItem) {
  GDALMajorObjectShadow *arg1 = (GDALMajorObjectShadow *) 0 ;
  char *arg2 = (char *) 0 ;
  char *arg3 = (char *) 0 ;
  char *arg4 = (char *) "" ;
  zval **args[4];
  int arg_count;
  CPLErr result;
  
  SWIG_ResetError();
  arg_count = ZEND_NUM_ARGS();
  if(arg_count<3 || arg_count>4 ||
    zend_get_parameters_array_ex(arg_count,args)!=SUCCESS)
  WRONG_PARAM_COUNT;
  
  {
    if(SWIG_ConvertPtr(*args[0], (void **) &arg1, SWIGTYPE_p_GDALMajorObjectShadow, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of MajorObject_SetMetadataItem. Expected SWIGTYPE_p_GDALMajorObjectShadow");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  
  /*@SWIG:/usr/share/swig1.3/php/utils.i,26,CONVERT_STRING_IN@*/
  if ((*args[1])->type==IS_NULL) {
    arg2 = (char *) 0;
  } else {
    convert_to_string_ex(args[1]);
    arg2 = (char *) Z_STRVAL_PP(args[1]);
  }
  /*@SWIG@*/;
  
  
  /*@SWIG:/usr/share/swig1.3/php/utils.i,26,CONVERT_STRING_IN@*/
  if ((*args[2])->type==IS_NULL) {
    arg3 = (char *) 0;
  } else {
    convert_to_string_ex(args[2]);
    arg3 = (char *) Z_STRVAL_PP(args[2]);
  }
  /*@SWIG@*/;
  
  if(arg_count > 3) {
    /*@SWIG:/usr/share/swig1.3/php/utils.i,26,CONVERT_STRING_IN@*/
    if ((*args[3])->type==IS_NULL) {
      arg4 = (char *) 0;
    } else {
      convert_to_string_ex(args[3]);
      arg4 = (char *) Z_STRVAL_PP(args[3]);
    }
    /*@SWIG@*/;
    
  }
  {
    if (!arg2) {
      SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
    }
  }
  result = (CPLErr)GDALMajorObjectShadow_SetMetadataItem(arg1,(char const *)arg2,(char const *)arg3,(char const *)arg4);
  {
    ZVAL_LONG(return_value,result);
  }
  return;
fail:
  zend_error_noreturn(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_Driver_ShortName_get) {
  GDALDriverShadow *arg1 = (GDALDriverShadow *) 0 ;
  zval **args[1];
  char *result = 0 ;
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 1 || zend_get_parameters_array_ex(1, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*args[0], (void **) &arg1, SWIGTYPE_p_GDALDriverShadow, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of Driver_ShortName_get. Expected SWIGTYPE_p_GDALDriverShadow");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  result = (char *)GDALDriverShadow_ShortName_get(arg1);
  {
    if(!result) {
      ZVAL_NULL(return_value);
    } else {
      ZVAL_STRING(return_value, (char *)result, 1);
    }
  }
  return;
fail:
  zend_error_noreturn(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_Driver_LongName_get) {
  GDALDriverShadow *arg1 = (GDALDriverShadow *) 0 ;
  zval **args[1];
  char *result = 0 ;
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 1 || zend_get_parameters_array_ex(1, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*args[0], (void **) &arg1, SWIGTYPE_p_GDALDriverShadow, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of Driver_LongName_get. Expected SWIGTYPE_p_GDALDriverShadow");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  result = (char *)GDALDriverShadow_LongName_get(arg1);
  {
    if(!result) {
      ZVAL_NULL(return_value);
    } else {
      ZVAL_STRING(return_value, (char *)result, 1);
    }
  }
  return;
fail:
  zend_error_noreturn(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_Driver_HelpTopic_get) {
  GDALDriverShadow *arg1 = (GDALDriverShadow *) 0 ;
  zval **args[1];
  char *result = 0 ;
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 1 || zend_get_parameters_array_ex(1, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*args[0], (void **) &arg1, SWIGTYPE_p_GDALDriverShadow, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of Driver_HelpTopic_get. Expected SWIGTYPE_p_GDALDriverShadow");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  result = (char *)GDALDriverShadow_HelpTopic_get(arg1);
  {
    if(!result) {
      ZVAL_NULL(return_value);
    } else {
      ZVAL_STRING(return_value, (char *)result, 1);
    }
  }
  return;
fail:
  zend_error_noreturn(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_Driver_Create) {
  GDALDriverShadow *arg1 = (GDALDriverShadow *) 0 ;
  char *arg2 = (char *) 0 ;
  int arg3 ;
  int arg4 ;
  int arg5 = (int) 1 ;
  GDALDataType arg6 = (GDALDataType) GDT_Byte ;
  char **arg7 = (char **) 0 ;
  zval **args[7];
  int arg_count;
  GDALDatasetShadow *result = 0 ;
  
  SWIG_ResetError();
  arg_count = ZEND_NUM_ARGS();
  if(arg_count<4 || arg_count>7 ||
    zend_get_parameters_array_ex(arg_count,args)!=SUCCESS)
  WRONG_PARAM_COUNT;
  
  {
    if(SWIG_ConvertPtr(*args[0], (void **) &arg1, SWIGTYPE_p_GDALDriverShadow, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of Driver_Create. Expected SWIGTYPE_p_GDALDriverShadow");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  
  /*@SWIG:/usr/share/swig1.3/php/utils.i,26,CONVERT_STRING_IN@*/
  if ((*args[1])->type==IS_NULL) {
    arg2 = (char *) 0;
  } else {
    convert_to_string_ex(args[1]);
    arg2 = (char *) Z_STRVAL_PP(args[1]);
  }
  /*@SWIG@*/;
  
  
  /*@SWIG:/usr/share/swig1.3/php/utils.i,7,CONVERT_INT_IN@*/
  convert_to_long_ex(args[2]);
  arg3 = (int) Z_LVAL_PP(args[2]);
  /*@SWIG@*/;
  
  
  /*@SWIG:/usr/share/swig1.3/php/utils.i,7,CONVERT_INT_IN@*/
  convert_to_long_ex(args[3]);
  arg4 = (int) Z_LVAL_PP(args[3]);
  /*@SWIG@*/;
  
  if(arg_count > 4) {
    /*@SWIG:/usr/share/swig1.3/php/utils.i,7,CONVERT_INT_IN@*/
    convert_to_long_ex(args[4]);
    arg5 = (int) Z_LVAL_PP(args[4]);
    /*@SWIG@*/;
    
  }
  if(arg_count > 5) {
    /*@SWIG:/usr/share/swig1.3/php/utils.i,7,CONVERT_INT_IN@*/
    convert_to_long_ex(args[5]);
    arg6 = (GDALDataType) Z_LVAL_PP(args[5]);
    /*@SWIG@*/;
    
  }
  if(arg_count > 6) {
    {
      /* %typemap(in) char **options */
      zend_error(E_ERROR,"Typemap (in) char **options not properly defined");
      //  int size = PySequence_Size(args[6]);
      //  for (int i = 0; i < size; i++) {
      //    char *pszItem = NULL;
      //    if ( ! PyArg_Parse( PySequence_GetItem(args[6],i), "s", &pszItem ) ) {
      //      PyErr_SetString(PyExc_TypeError,"sequence must contain strings");
      //      SWIG_fail;
      //    }
      //    arg7 = CSLAddString( arg7, pszItem );
      //  }
    }
  }
  result = (GDALDatasetShadow *)GDALDriverShadow_Create(arg1,(char const *)arg2,arg3,arg4,arg5,arg6,arg7);
  
  SWIG_SetPointerZval(return_value, (void *)result, SWIGTYPE_p_GDALDatasetShadow, 1);
  
  {
    /* %typemap(freearg) char **options */
    CSLDestroy( arg7 );
  }
  return;
fail:
  {
    /* %typemap(freearg) char **options */
    CSLDestroy( arg7 );
  }
  zend_error_noreturn(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_Driver_CreateCopy) {
  GDALDriverShadow *arg1 = (GDALDriverShadow *) 0 ;
  char *arg2 = (char *) 0 ;
  GDALDatasetShadow *arg3 = (GDALDatasetShadow *) 0 ;
  int arg4 = (int) 1 ;
  char **arg5 = (char **) 0 ;
  GDALProgressFunc arg6 = (GDALProgressFunc) NULL ;
  void *arg7 = (void *) NULL ;
  GDALProgressFunc *tmp6 ;
  zval **args[7];
  int arg_count;
  GDALDatasetShadow *result = 0 ;
  
  SWIG_ResetError();
  arg_count = ZEND_NUM_ARGS();
  if(arg_count<3 || arg_count>7 ||
    zend_get_parameters_array_ex(arg_count,args)!=SUCCESS)
  WRONG_PARAM_COUNT;
  
  {
    if(SWIG_ConvertPtr(*args[0], (void **) &arg1, SWIGTYPE_p_GDALDriverShadow, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of Driver_CreateCopy. Expected SWIGTYPE_p_GDALDriverShadow");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  
  /*@SWIG:/usr/share/swig1.3/php/utils.i,26,CONVERT_STRING_IN@*/
  if ((*args[1])->type==IS_NULL) {
    arg2 = (char *) 0;
  } else {
    convert_to_string_ex(args[1]);
    arg2 = (char *) Z_STRVAL_PP(args[1]);
  }
  /*@SWIG@*/;
  
  {
    if(SWIG_ConvertPtr(*args[2], (void **) &arg3, SWIGTYPE_p_GDALDatasetShadow, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 3 of Driver_CreateCopy. Expected SWIGTYPE_p_GDALDatasetShadow");
    }
  }
  if(arg_count > 3) {
    /*@SWIG:/usr/share/swig1.3/php/utils.i,7,CONVERT_INT_IN@*/
    convert_to_long_ex(args[3]);
    arg4 = (int) Z_LVAL_PP(args[3]);
    /*@SWIG@*/;
    
  }
  if(arg_count > 4) {
    {
      /* %typemap(in) char **options */
      zend_error(E_ERROR,"Typemap (in) char **options not properly defined");
      //  int size = PySequence_Size(args[4]);
      //  for (int i = 0; i < size; i++) {
      //    char *pszItem = NULL;
      //    if ( ! PyArg_Parse( PySequence_GetItem(args[4],i), "s", &pszItem ) ) {
      //      PyErr_SetString(PyExc_TypeError,"sequence must contain strings");
      //      SWIG_fail;
      //    }
      //    arg5 = CSLAddString( arg5, pszItem );
      //  }
    }
  }
  if(arg_count > 5) {
    {
      if(SWIG_ConvertPtr(*args[5], (void **) &tmp6, SWIGTYPE_p_GDALProgressFunc, 0) < 0 || tmp6 == NULL) {
        SWIG_PHP_Error(E_ERROR, "Type error in argument 6 of Driver_CreateCopy. Expected SWIGTYPE_p_GDALProgressFunc");
      }
      arg6 = *tmp6;
    }
  }
  if(arg_count > 6) {
    {
      if(SWIG_ConvertPtr(*args[6], (void **) &arg7, 0, 0) < 0) {
        /* Allow NULL from php for void* */
        if ((*args[6])->type==IS_NULL) arg7=0;
        else
        SWIG_PHP_Error(E_ERROR, "Type error in argument 7 of Driver_CreateCopy. Expected SWIGTYPE_p_p_void");
      }
    }
  }
  {
    if (!arg3) {
      SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
    }
  }
  result = (GDALDatasetShadow *)GDALDriverShadow_CreateCopy(arg1,(char const *)arg2,arg3,arg4,arg5,arg6,arg7);
  
  SWIG_SetPointerZval(return_value, (void *)result, SWIGTYPE_p_GDALDatasetShadow, 1);
  
  {
    /* %typemap(freearg) char **options */
    CSLDestroy( arg5 );
  }
  return;
fail:
  {
    /* %typemap(freearg) char **options */
    CSLDestroy( arg5 );
  }
  zend_error_noreturn(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_Driver_Delete) {
  GDALDriverShadow *arg1 = (GDALDriverShadow *) 0 ;
  char *arg2 = (char *) 0 ;
  zval **args[2];
  int result;
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 2 || zend_get_parameters_array_ex(2, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*args[0], (void **) &arg1, SWIGTYPE_p_GDALDriverShadow, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of Driver_Delete. Expected SWIGTYPE_p_GDALDriverShadow");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  
  /*@SWIG:/usr/share/swig1.3/php/utils.i,26,CONVERT_STRING_IN@*/
  if ((*args[1])->type==IS_NULL) {
    arg2 = (char *) 0;
  } else {
    convert_to_string_ex(args[1]);
    arg2 = (char *) Z_STRVAL_PP(args[1]);
  }
  /*@SWIG@*/;
  
  result = (int)GDALDriverShadow_Delete(arg1,(char const *)arg2);
  {
    ZVAL_LONG(return_value,result);
  }
  return;
fail:
  zend_error_noreturn(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_Driver_Rename) {
  GDALDriverShadow *arg1 = (GDALDriverShadow *) 0 ;
  char *arg2 = (char *) 0 ;
  char *arg3 = (char *) 0 ;
  zval **args[3];
  int result;
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 3 || zend_get_parameters_array_ex(3, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*args[0], (void **) &arg1, SWIGTYPE_p_GDALDriverShadow, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of Driver_Rename. Expected SWIGTYPE_p_GDALDriverShadow");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  
  /*@SWIG:/usr/share/swig1.3/php/utils.i,26,CONVERT_STRING_IN@*/
  if ((*args[1])->type==IS_NULL) {
    arg2 = (char *) 0;
  } else {
    convert_to_string_ex(args[1]);
    arg2 = (char *) Z_STRVAL_PP(args[1]);
  }
  /*@SWIG@*/;
  
  
  /*@SWIG:/usr/share/swig1.3/php/utils.i,26,CONVERT_STRING_IN@*/
  if ((*args[2])->type==IS_NULL) {
    arg3 = (char *) 0;
  } else {
    convert_to_string_ex(args[2]);
    arg3 = (char *) Z_STRVAL_PP(args[2]);
  }
  /*@SWIG@*/;
  
  {
    if (!arg2) {
      SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
    }
  }
  {
    if (!arg3) {
      SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
    }
  }
  result = (int)GDALDriverShadow_Rename(arg1,(char const *)arg2,(char const *)arg3);
  {
    ZVAL_LONG(return_value,result);
  }
  return;
fail:
  zend_error_noreturn(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_Driver_Register) {
  GDALDriverShadow *arg1 = (GDALDriverShadow *) 0 ;
  zval **args[1];
  int result;
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 1 || zend_get_parameters_array_ex(1, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*args[0], (void **) &arg1, SWIGTYPE_p_GDALDriverShadow, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of Driver_Register. Expected SWIGTYPE_p_GDALDriverShadow");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  result = (int)GDALDriverShadow_Register(arg1);
  {
    ZVAL_LONG(return_value,result);
  }
  return;
fail:
  zend_error_noreturn(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_Driver_Deregister) {
  GDALDriverShadow *arg1 = (GDALDriverShadow *) 0 ;
  zval **args[1];
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 1 || zend_get_parameters_array_ex(1, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*args[0], (void **) &arg1, SWIGTYPE_p_GDALDriverShadow, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of Driver_Deregister. Expected SWIGTYPE_p_GDALDriverShadow");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  GDALDriverShadow_Deregister(arg1);
  
  return;
fail:
  zend_error_noreturn(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_ColorEntry_c1_set) {
  GDALColorEntry *arg1 = (GDALColorEntry *) 0 ;
  short arg2 ;
  zval **args[2];
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 2 || zend_get_parameters_array_ex(2, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    /* %typemap(in) GDALColorEntry* */
    GDALColorEntry ce = {
      255,255,255,255
    };
    // Need to parse the array values from args[0]
    arg1 = &ce;
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  
  /*@SWIG:/usr/share/swig1.3/php/utils.i,7,CONVERT_INT_IN@*/
  convert_to_long_ex(args[1]);
  arg2 = (short) Z_LVAL_PP(args[1]);
  /*@SWIG@*/;
  
  if (arg1) (arg1)->c1 = arg2;
  
  return;
fail:
  zend_error_noreturn(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_ColorEntry_c1_get) {
  GDALColorEntry *arg1 = (GDALColorEntry *) 0 ;
  zval **args[1];
  short result;
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 1 || zend_get_parameters_array_ex(1, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    /* %typemap(in) GDALColorEntry* */
    GDALColorEntry ce = {
      255,255,255,255
    };
    // Need to parse the array values from args[0]
    arg1 = &ce;
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  result = (short) ((arg1)->c1);
  {
    ZVAL_LONG(return_value,result);
  }
  return;
fail:
  zend_error_noreturn(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_ColorEntry_c2_set) {
  GDALColorEntry *arg1 = (GDALColorEntry *) 0 ;
  short arg2 ;
  zval **args[2];
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 2 || zend_get_parameters_array_ex(2, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    /* %typemap(in) GDALColorEntry* */
    GDALColorEntry ce = {
      255,255,255,255
    };
    // Need to parse the array values from args[0]
    arg1 = &ce;
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  
  /*@SWIG:/usr/share/swig1.3/php/utils.i,7,CONVERT_INT_IN@*/
  convert_to_long_ex(args[1]);
  arg2 = (short) Z_LVAL_PP(args[1]);
  /*@SWIG@*/;
  
  if (arg1) (arg1)->c2 = arg2;
  
  return;
fail:
  zend_error_noreturn(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_ColorEntry_c2_get) {
  GDALColorEntry *arg1 = (GDALColorEntry *) 0 ;
  zval **args[1];
  short result;
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 1 || zend_get_parameters_array_ex(1, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    /* %typemap(in) GDALColorEntry* */
    GDALColorEntry ce = {
      255,255,255,255
    };
    // Need to parse the array values from args[0]
    arg1 = &ce;
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  result = (short) ((arg1)->c2);
  {
    ZVAL_LONG(return_value,result);
  }
  return;
fail:
  zend_error_noreturn(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_ColorEntry_c3_set) {
  GDALColorEntry *arg1 = (GDALColorEntry *) 0 ;
  short arg2 ;
  zval **args[2];
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 2 || zend_get_parameters_array_ex(2, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    /* %typemap(in) GDALColorEntry* */
    GDALColorEntry ce = {
      255,255,255,255
    };
    // Need to parse the array values from args[0]
    arg1 = &ce;
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  
  /*@SWIG:/usr/share/swig1.3/php/utils.i,7,CONVERT_INT_IN@*/
  convert_to_long_ex(args[1]);
  arg2 = (short) Z_LVAL_PP(args[1]);
  /*@SWIG@*/;
  
  if (arg1) (arg1)->c3 = arg2;
  
  return;
fail:
  zend_error_noreturn(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_ColorEntry_c3_get) {
  GDALColorEntry *arg1 = (GDALColorEntry *) 0 ;
  zval **args[1];
  short result;
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 1 || zend_get_parameters_array_ex(1, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    /* %typemap(in) GDALColorEntry* */
    GDALColorEntry ce = {
      255,255,255,255
    };
    // Need to parse the array values from args[0]
    arg1 = &ce;
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  result = (short) ((arg1)->c3);
  {
    ZVAL_LONG(return_value,result);
  }
  return;
fail:
  zend_error_noreturn(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_ColorEntry_c4_set) {
  GDALColorEntry *arg1 = (GDALColorEntry *) 0 ;
  short arg2 ;
  zval **args[2];
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 2 || zend_get_parameters_array_ex(2, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    /* %typemap(in) GDALColorEntry* */
    GDALColorEntry ce = {
      255,255,255,255
    };
    // Need to parse the array values from args[0]
    arg1 = &ce;
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  
  /*@SWIG:/usr/share/swig1.3/php/utils.i,7,CONVERT_INT_IN@*/
  convert_to_long_ex(args[1]);
  arg2 = (short) Z_LVAL_PP(args[1]);
  /*@SWIG@*/;
  
  if (arg1) (arg1)->c4 = arg2;
  
  return;
fail:
  zend_error_noreturn(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_ColorEntry_c4_get) {
  GDALColorEntry *arg1 = (GDALColorEntry *) 0 ;
  zval **args[1];
  short result;
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 1 || zend_get_parameters_array_ex(1, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    /* %typemap(in) GDALColorEntry* */
    GDALColorEntry ce = {
      255,255,255,255
    };
    // Need to parse the array values from args[0]
    arg1 = &ce;
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  result = (short) ((arg1)->c4);
  {
    ZVAL_LONG(return_value,result);
  }
  return;
fail:
  zend_error_noreturn(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_new_ColorEntry) {
  GDALColorEntry *result = 0 ;
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 0) {
    WRONG_PARAM_COUNT;
  }
  
  result = (GDALColorEntry *)new GDALColorEntry();
  {
    /* %typemap(out) GDALColorEntry* */
    array_init(return_value);
    add_next_index_long(return_value,(*result).c1);
    add_next_index_long(return_value,(*result).c2);
    add_next_index_long(return_value,(*result).c3);
    add_next_index_long(return_value,(*result).c4);
  }
  return;
fail:
  zend_error_noreturn(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


/* This function is designed to be called by the zend list destructors */
/* to typecast and do the actual destruction */
static void __wrap_delete_ColorEntry(zend_rsrc_list_entry *rsrc, const char *type_name TSRMLS_DC) {
  swig_object_wrapper *value=(swig_object_wrapper *) rsrc->ptr ;
  void *ptr=value->ptr ;
  int newobject=value->newobject ;
  GDALColorEntry *arg1 = (GDALColorEntry *) 0 ;
  
  efree(value);
  if (! newobject) return; /* can't delete it! */
  arg1 = (GDALColorEntry *)SWIG_ZTS_ConvertResourceData(ptr,type_name,SWIGTYPE_p_GDALColorEntry TSRMLS_CC);
  if (! arg1) zend_error(E_ERROR, "GDALColorEntry resource already free'd");
  delete arg1;
  return;
fail:
  zend_error_noreturn(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_GCP_GCPX_set) {
  GDAL_GCP *arg1 = (GDAL_GCP *) 0 ;
  double arg2 ;
  zval **args[2];
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 2 || zend_get_parameters_array_ex(2, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*args[0], (void **) &arg1, SWIGTYPE_p_GDAL_GCP, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of GCP_GCPX_set. Expected SWIGTYPE_p_GDAL_GCP");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  
  /*@SWIG:/usr/share/swig1.3/php/utils.i,16,CONVERT_FLOAT_IN@*/
  convert_to_double_ex(args[1]);
  arg2 = (double) Z_DVAL_PP(args[1]);
  /*@SWIG@*/;
  
  GDAL_GCP_GCPX_set(arg1,arg2);
  
  return;
fail:
  zend_error_noreturn(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_GCP_GCPX_get) {
  GDAL_GCP *arg1 = (GDAL_GCP *) 0 ;
  zval **args[1];
  double result;
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 1 || zend_get_parameters_array_ex(1, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*args[0], (void **) &arg1, SWIGTYPE_p_GDAL_GCP, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of GCP_GCPX_get. Expected SWIGTYPE_p_GDAL_GCP");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  result = (double)GDAL_GCP_GCPX_get(arg1);
  {
    ZVAL_DOUBLE(return_value,result);
  }
  return;
fail:
  zend_error_noreturn(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_GCP_GCPY_set) {
  GDAL_GCP *arg1 = (GDAL_GCP *) 0 ;
  double arg2 ;
  zval **args[2];
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 2 || zend_get_parameters_array_ex(2, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*args[0], (void **) &arg1, SWIGTYPE_p_GDAL_GCP, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of GCP_GCPY_set. Expected SWIGTYPE_p_GDAL_GCP");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  
  /*@SWIG:/usr/share/swig1.3/php/utils.i,16,CONVERT_FLOAT_IN@*/
  convert_to_double_ex(args[1]);
  arg2 = (double) Z_DVAL_PP(args[1]);
  /*@SWIG@*/;
  
  GDAL_GCP_GCPY_set(arg1,arg2);
  
  return;
fail:
  zend_error_noreturn(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_GCP_GCPY_get) {
  GDAL_GCP *arg1 = (GDAL_GCP *) 0 ;
  zval **args[1];
  double result;
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 1 || zend_get_parameters_array_ex(1, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*args[0], (void **) &arg1, SWIGTYPE_p_GDAL_GCP, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of GCP_GCPY_get. Expected SWIGTYPE_p_GDAL_GCP");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  result = (double)GDAL_GCP_GCPY_get(arg1);
  {
    ZVAL_DOUBLE(return_value,result);
  }
  return;
fail:
  zend_error_noreturn(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_GCP_GCPZ_set) {
  GDAL_GCP *arg1 = (GDAL_GCP *) 0 ;
  double arg2 ;
  zval **args[2];
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 2 || zend_get_parameters_array_ex(2, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*args[0], (void **) &arg1, SWIGTYPE_p_GDAL_GCP, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of GCP_GCPZ_set. Expected SWIGTYPE_p_GDAL_GCP");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  
  /*@SWIG:/usr/share/swig1.3/php/utils.i,16,CONVERT_FLOAT_IN@*/
  convert_to_double_ex(args[1]);
  arg2 = (double) Z_DVAL_PP(args[1]);
  /*@SWIG@*/;
  
  GDAL_GCP_GCPZ_set(arg1,arg2);
  
  return;
fail:
  zend_error_noreturn(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_GCP_GCPZ_get) {
  GDAL_GCP *arg1 = (GDAL_GCP *) 0 ;
  zval **args[1];
  double result;
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 1 || zend_get_parameters_array_ex(1, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*args[0], (void **) &arg1, SWIGTYPE_p_GDAL_GCP, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of GCP_GCPZ_get. Expected SWIGTYPE_p_GDAL_GCP");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  result = (double)GDAL_GCP_GCPZ_get(arg1);
  {
    ZVAL_DOUBLE(return_value,result);
  }
  return;
fail:
  zend_error_noreturn(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_GCP_GCPPixel_set) {
  GDAL_GCP *arg1 = (GDAL_GCP *) 0 ;
  double arg2 ;
  zval **args[2];
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 2 || zend_get_parameters_array_ex(2, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*args[0], (void **) &arg1, SWIGTYPE_p_GDAL_GCP, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of GCP_GCPPixel_set. Expected SWIGTYPE_p_GDAL_GCP");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  
  /*@SWIG:/usr/share/swig1.3/php/utils.i,16,CONVERT_FLOAT_IN@*/
  convert_to_double_ex(args[1]);
  arg2 = (double) Z_DVAL_PP(args[1]);
  /*@SWIG@*/;
  
  GDAL_GCP_GCPPixel_set(arg1,arg2);
  
  return;
fail:
  zend_error_noreturn(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_GCP_GCPPixel_get) {
  GDAL_GCP *arg1 = (GDAL_GCP *) 0 ;
  zval **args[1];
  double result;
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 1 || zend_get_parameters_array_ex(1, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*args[0], (void **) &arg1, SWIGTYPE_p_GDAL_GCP, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of GCP_GCPPixel_get. Expected SWIGTYPE_p_GDAL_GCP");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  result = (double)GDAL_GCP_GCPPixel_get(arg1);
  {
    ZVAL_DOUBLE(return_value,result);
  }
  return;
fail:
  zend_error_noreturn(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_GCP_GCPLine_set) {
  GDAL_GCP *arg1 = (GDAL_GCP *) 0 ;
  double arg2 ;
  zval **args[2];
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 2 || zend_get_parameters_array_ex(2, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*args[0], (void **) &arg1, SWIGTYPE_p_GDAL_GCP, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of GCP_GCPLine_set. Expected SWIGTYPE_p_GDAL_GCP");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  
  /*@SWIG:/usr/share/swig1.3/php/utils.i,16,CONVERT_FLOAT_IN@*/
  convert_to_double_ex(args[1]);
  arg2 = (double) Z_DVAL_PP(args[1]);
  /*@SWIG@*/;
  
  GDAL_GCP_GCPLine_set(arg1,arg2);
  
  return;
fail:
  zend_error_noreturn(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_GCP_GCPLine_get) {
  GDAL_GCP *arg1 = (GDAL_GCP *) 0 ;
  zval **args[1];
  double result;
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 1 || zend_get_parameters_array_ex(1, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*args[0], (void **) &arg1, SWIGTYPE_p_GDAL_GCP, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of GCP_GCPLine_get. Expected SWIGTYPE_p_GDAL_GCP");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  result = (double)GDAL_GCP_GCPLine_get(arg1);
  {
    ZVAL_DOUBLE(return_value,result);
  }
  return;
fail:
  zend_error_noreturn(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_GCP_Info_set) {
  GDAL_GCP *arg1 = (GDAL_GCP *) 0 ;
  char *arg2 = (char *) 0 ;
  zval **args[2];
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 2 || zend_get_parameters_array_ex(2, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*args[0], (void **) &arg1, SWIGTYPE_p_GDAL_GCP, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of GCP_Info_set. Expected SWIGTYPE_p_GDAL_GCP");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  
  /*@SWIG:/usr/share/swig1.3/php/utils.i,26,CONVERT_STRING_IN@*/
  if ((*args[1])->type==IS_NULL) {
    arg2 = (char *) 0;
  } else {
    convert_to_string_ex(args[1]);
    arg2 = (char *) Z_STRVAL_PP(args[1]);
  }
  /*@SWIG@*/;
  
  
  /* char* Info memberin typemap */
  GDAL_GCP_Info_set(arg1,arg2);
  
  
  return;
fail:
  zend_error_noreturn(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_GCP_Info_get) {
  GDAL_GCP *arg1 = (GDAL_GCP *) 0 ;
  zval **args[1];
  char *result = 0 ;
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 1 || zend_get_parameters_array_ex(1, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*args[0], (void **) &arg1, SWIGTYPE_p_GDAL_GCP, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of GCP_Info_get. Expected SWIGTYPE_p_GDAL_GCP");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  result = (char *)GDAL_GCP_Info_get(arg1);
  {
    if(!result) {
      ZVAL_NULL(return_value);
    } else {
      ZVAL_STRING(return_value, (char *)result, 1);
    }
  }
  return;
fail:
  zend_error_noreturn(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_GCP_Id_set) {
  GDAL_GCP *arg1 = (GDAL_GCP *) 0 ;
  char *arg2 = (char *) 0 ;
  zval **args[2];
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 2 || zend_get_parameters_array_ex(2, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*args[0], (void **) &arg1, SWIGTYPE_p_GDAL_GCP, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of GCP_Id_set. Expected SWIGTYPE_p_GDAL_GCP");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  
  /*@SWIG:/usr/share/swig1.3/php/utils.i,26,CONVERT_STRING_IN@*/
  if ((*args[1])->type==IS_NULL) {
    arg2 = (char *) 0;
  } else {
    convert_to_string_ex(args[1]);
    arg2 = (char *) Z_STRVAL_PP(args[1]);
  }
  /*@SWIG@*/;
  
  
  /* char* Info memberin typemap */
  GDAL_GCP_Id_set(arg1,arg2);
  
  
  return;
fail:
  zend_error_noreturn(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_GCP_Id_get) {
  GDAL_GCP *arg1 = (GDAL_GCP *) 0 ;
  zval **args[1];
  char *result = 0 ;
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 1 || zend_get_parameters_array_ex(1, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*args[0], (void **) &arg1, SWIGTYPE_p_GDAL_GCP, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of GCP_Id_get. Expected SWIGTYPE_p_GDAL_GCP");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  result = (char *)GDAL_GCP_Id_get(arg1);
  {
    if(!result) {
      ZVAL_NULL(return_value);
    } else {
      ZVAL_STRING(return_value, (char *)result, 1);
    }
  }
  return;
fail:
  zend_error_noreturn(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_new_GCP) {
  double arg1 = (double) 0.0 ;
  double arg2 = (double) 0.0 ;
  double arg3 = (double) 0.0 ;
  double arg4 = (double) 0.0 ;
  double arg5 = (double) 0.0 ;
  char *arg6 = (char *) "" ;
  char *arg7 = (char *) "" ;
  zval **args[7];
  int arg_count;
  GDAL_GCP *result = 0 ;
  
  SWIG_ResetError();
  arg_count = ZEND_NUM_ARGS();
  if(arg_count<0 || arg_count>7 ||
    zend_get_parameters_array_ex(arg_count,args)!=SUCCESS)
  WRONG_PARAM_COUNT;
  
  if(arg_count > 0) {
    /*@SWIG:/usr/share/swig1.3/php/utils.i,16,CONVERT_FLOAT_IN@*/
    convert_to_double_ex(args[0]);
    arg1 = (double) Z_DVAL_PP(args[0]);
    /*@SWIG@*/;
    
  }
  if(arg_count > 1) {
    /*@SWIG:/usr/share/swig1.3/php/utils.i,16,CONVERT_FLOAT_IN@*/
    convert_to_double_ex(args[1]);
    arg2 = (double) Z_DVAL_PP(args[1]);
    /*@SWIG@*/;
    
  }
  if(arg_count > 2) {
    /*@SWIG:/usr/share/swig1.3/php/utils.i,16,CONVERT_FLOAT_IN@*/
    convert_to_double_ex(args[2]);
    arg3 = (double) Z_DVAL_PP(args[2]);
    /*@SWIG@*/;
    
  }
  if(arg_count > 3) {
    /*@SWIG:/usr/share/swig1.3/php/utils.i,16,CONVERT_FLOAT_IN@*/
    convert_to_double_ex(args[3]);
    arg4 = (double) Z_DVAL_PP(args[3]);
    /*@SWIG@*/;
    
  }
  if(arg_count > 4) {
    /*@SWIG:/usr/share/swig1.3/php/utils.i,16,CONVERT_FLOAT_IN@*/
    convert_to_double_ex(args[4]);
    arg5 = (double) Z_DVAL_PP(args[4]);
    /*@SWIG@*/;
    
  }
  if(arg_count > 5) {
    /*@SWIG:/usr/share/swig1.3/php/utils.i,26,CONVERT_STRING_IN@*/
    if ((*args[5])->type==IS_NULL) {
      arg6 = (char *) 0;
    } else {
      convert_to_string_ex(args[5]);
      arg6 = (char *) Z_STRVAL_PP(args[5]);
    }
    /*@SWIG@*/;
    
  }
  if(arg_count > 6) {
    /*@SWIG:/usr/share/swig1.3/php/utils.i,26,CONVERT_STRING_IN@*/
    if ((*args[6])->type==IS_NULL) {
      arg7 = (char *) 0;
    } else {
      convert_to_string_ex(args[6]);
      arg7 = (char *) Z_STRVAL_PP(args[6]);
    }
    /*@SWIG@*/;
    
  }
  result = (GDAL_GCP *)new_GDAL_GCP(arg1,arg2,arg3,arg4,arg5,(char const *)arg6,(char const *)arg7);
  
  SWIG_SetPointerZval(return_value, (void *)result, SWIGTYPE_p_GDAL_GCP, 1);
  
  return;
fail:
  zend_error_noreturn(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


/* This function is designed to be called by the zend list destructors */
/* to typecast and do the actual destruction */
static void __wrap_delete_GCP(zend_rsrc_list_entry *rsrc, const char *type_name TSRMLS_DC) {
  swig_object_wrapper *value=(swig_object_wrapper *) rsrc->ptr ;
  void *ptr=value->ptr ;
  int newobject=value->newobject ;
  GDAL_GCP *arg1 = (GDAL_GCP *) 0 ;
  
  efree(value);
  if (! newobject) return; /* can't delete it! */
  arg1 = (GDAL_GCP *)SWIG_ZTS_ConvertResourceData(ptr,type_name,SWIGTYPE_p_GDAL_GCP TSRMLS_CC);
  if (! arg1) zend_error(E_ERROR, "GDAL_GCP resource already free'd");
  delete_GDAL_GCP(arg1);
  return;
fail:
  zend_error_noreturn(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_GDAL_GCP_GCPX_get) {
  GDAL_GCP *arg1 = (GDAL_GCP *) 0 ;
  zval **args[1];
  double result;
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 1 || zend_get_parameters_array_ex(1, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*args[0], (void **) &arg1, SWIGTYPE_p_GDAL_GCP, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of GDAL_GCP_GCPX_get. Expected SWIGTYPE_p_GDAL_GCP");
    }
  }
  {
    if (!arg1) {
      SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
    }
  }
  result = (double)GDAL_GCP_GCPX_get(arg1);
  {
    ZVAL_DOUBLE(return_value,result);
  }
  return;
fail:
  zend_error_noreturn(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_GDAL_GCP_GCPX_set) {
  GDAL_GCP *arg1 = (GDAL_GCP *) 0 ;
  double arg2 ;
  zval **args[2];
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 2 || zend_get_parameters_array_ex(2, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*args[0], (void **) &arg1, SWIGTYPE_p_GDAL_GCP, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of GDAL_GCP_GCPX_set. Expected SWIGTYPE_p_GDAL_GCP");
    }
  }
  
  /*@SWIG:/usr/share/swig1.3/php/utils.i,16,CONVERT_FLOAT_IN@*/
  convert_to_double_ex(args[1]);
  arg2 = (double) Z_DVAL_PP(args[1]);
  /*@SWIG@*/;
  
  {
    if (!arg1) {
      SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
    }
  }
  GDAL_GCP_GCPX_set(arg1,arg2);
  
  return;
fail:
  zend_error_noreturn(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_GDAL_GCP_GCPY_get) {
  GDAL_GCP *arg1 = (GDAL_GCP *) 0 ;
  zval **args[1];
  double result;
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 1 || zend_get_parameters_array_ex(1, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*args[0], (void **) &arg1, SWIGTYPE_p_GDAL_GCP, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of GDAL_GCP_GCPY_get. Expected SWIGTYPE_p_GDAL_GCP");
    }
  }
  {
    if (!arg1) {
      SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
    }
  }
  result = (double)GDAL_GCP_GCPY_get(arg1);
  {
    ZVAL_DOUBLE(return_value,result);
  }
  return;
fail:
  zend_error_noreturn(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_GDAL_GCP_GCPY_set) {
  GDAL_GCP *arg1 = (GDAL_GCP *) 0 ;
  double arg2 ;
  zval **args[2];
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 2 || zend_get_parameters_array_ex(2, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*args[0], (void **) &arg1, SWIGTYPE_p_GDAL_GCP, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of GDAL_GCP_GCPY_set. Expected SWIGTYPE_p_GDAL_GCP");
    }
  }
  
  /*@SWIG:/usr/share/swig1.3/php/utils.i,16,CONVERT_FLOAT_IN@*/
  convert_to_double_ex(args[1]);
  arg2 = (double) Z_DVAL_PP(args[1]);
  /*@SWIG@*/;
  
  {
    if (!arg1) {
      SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
    }
  }
  GDAL_GCP_GCPY_set(arg1,arg2);
  
  return;
fail:
  zend_error_noreturn(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_GDAL_GCP_GCPZ_get) {
  GDAL_GCP *arg1 = (GDAL_GCP *) 0 ;
  zval **args[1];
  double result;
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 1 || zend_get_parameters_array_ex(1, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*args[0], (void **) &arg1, SWIGTYPE_p_GDAL_GCP, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of GDAL_GCP_GCPZ_get. Expected SWIGTYPE_p_GDAL_GCP");
    }
  }
  {
    if (!arg1) {
      SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
    }
  }
  result = (double)GDAL_GCP_GCPZ_get(arg1);
  {
    ZVAL_DOUBLE(return_value,result);
  }
  return;
fail:
  zend_error_noreturn(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_GDAL_GCP_GCPZ_set) {
  GDAL_GCP *arg1 = (GDAL_GCP *) 0 ;
  double arg2 ;
  zval **args[2];
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 2 || zend_get_parameters_array_ex(2, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*args[0], (void **) &arg1, SWIGTYPE_p_GDAL_GCP, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of GDAL_GCP_GCPZ_set. Expected SWIGTYPE_p_GDAL_GCP");
    }
  }
  
  /*@SWIG:/usr/share/swig1.3/php/utils.i,16,CONVERT_FLOAT_IN@*/
  convert_to_double_ex(args[1]);
  arg2 = (double) Z_DVAL_PP(args[1]);
  /*@SWIG@*/;
  
  {
    if (!arg1) {
      SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
    }
  }
  GDAL_GCP_GCPZ_set(arg1,arg2);
  
  return;
fail:
  zend_error_noreturn(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_GDAL_GCP_GCPPixel_get) {
  GDAL_GCP *arg1 = (GDAL_GCP *) 0 ;
  zval **args[1];
  double result;
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 1 || zend_get_parameters_array_ex(1, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*args[0], (void **) &arg1, SWIGTYPE_p_GDAL_GCP, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of GDAL_GCP_GCPPixel_get. Expected SWIGTYPE_p_GDAL_GCP");
    }
  }
  {
    if (!arg1) {
      SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
    }
  }
  result = (double)GDAL_GCP_GCPPixel_get(arg1);
  {
    ZVAL_DOUBLE(return_value,result);
  }
  return;
fail:
  zend_error_noreturn(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_GDAL_GCP_GCPPixel_set) {
  GDAL_GCP *arg1 = (GDAL_GCP *) 0 ;
  double arg2 ;
  zval **args[2];
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 2 || zend_get_parameters_array_ex(2, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*args[0], (void **) &arg1, SWIGTYPE_p_GDAL_GCP, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of GDAL_GCP_GCPPixel_set. Expected SWIGTYPE_p_GDAL_GCP");
    }
  }
  
  /*@SWIG:/usr/share/swig1.3/php/utils.i,16,CONVERT_FLOAT_IN@*/
  convert_to_double_ex(args[1]);
  arg2 = (double) Z_DVAL_PP(args[1]);
  /*@SWIG@*/;
  
  {
    if (!arg1) {
      SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
    }
  }
  GDAL_GCP_GCPPixel_set(arg1,arg2);
  
  return;
fail:
  zend_error_noreturn(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_GDAL_GCP_GCPLine_get) {
  GDAL_GCP *arg1 = (GDAL_GCP *) 0 ;
  zval **args[1];
  double result;
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 1 || zend_get_parameters_array_ex(1, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*args[0], (void **) &arg1, SWIGTYPE_p_GDAL_GCP, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of GDAL_GCP_GCPLine_get. Expected SWIGTYPE_p_GDAL_GCP");
    }
  }
  {
    if (!arg1) {
      SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
    }
  }
  result = (double)GDAL_GCP_GCPLine_get(arg1);
  {
    ZVAL_DOUBLE(return_value,result);
  }
  return;
fail:
  zend_error_noreturn(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_GDAL_GCP_GCPLine_set) {
  GDAL_GCP *arg1 = (GDAL_GCP *) 0 ;
  double arg2 ;
  zval **args[2];
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 2 || zend_get_parameters_array_ex(2, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*args[0], (void **) &arg1, SWIGTYPE_p_GDAL_GCP, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of GDAL_GCP_GCPLine_set. Expected SWIGTYPE_p_GDAL_GCP");
    }
  }
  
  /*@SWIG:/usr/share/swig1.3/php/utils.i,16,CONVERT_FLOAT_IN@*/
  convert_to_double_ex(args[1]);
  arg2 = (double) Z_DVAL_PP(args[1]);
  /*@SWIG@*/;
  
  {
    if (!arg1) {
      SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
    }
  }
  GDAL_GCP_GCPLine_set(arg1,arg2);
  
  return;
fail:
  zend_error_noreturn(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_GDAL_GCP_Info_get) {
  GDAL_GCP *arg1 = (GDAL_GCP *) 0 ;
  zval **args[1];
  char *result = 0 ;
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 1 || zend_get_parameters_array_ex(1, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*args[0], (void **) &arg1, SWIGTYPE_p_GDAL_GCP, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of GDAL_GCP_Info_get. Expected SWIGTYPE_p_GDAL_GCP");
    }
  }
  {
    if (!arg1) {
      SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
    }
  }
  result = (char *)GDAL_GCP_Info_get(arg1);
  {
    if(!result) {
      ZVAL_NULL(return_value);
    } else {
      ZVAL_STRING(return_value, (char *)result, 1);
    }
  }
  return;
fail:
  zend_error_noreturn(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_GDAL_GCP_Info_set) {
  GDAL_GCP *arg1 = (GDAL_GCP *) 0 ;
  char *arg2 = (char *) 0 ;
  zval **args[2];
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 2 || zend_get_parameters_array_ex(2, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*args[0], (void **) &arg1, SWIGTYPE_p_GDAL_GCP, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of GDAL_GCP_Info_set. Expected SWIGTYPE_p_GDAL_GCP");
    }
  }
  
  /*@SWIG:/usr/share/swig1.3/php/utils.i,26,CONVERT_STRING_IN@*/
  if ((*args[1])->type==IS_NULL) {
    arg2 = (char *) 0;
  } else {
    convert_to_string_ex(args[1]);
    arg2 = (char *) Z_STRVAL_PP(args[1]);
  }
  /*@SWIG@*/;
  
  {
    if (!arg1) {
      SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
    }
  }
  GDAL_GCP_Info_set(arg1,(char const *)arg2);
  
  return;
fail:
  zend_error_noreturn(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_GDAL_GCP_Id_get) {
  GDAL_GCP *arg1 = (GDAL_GCP *) 0 ;
  zval **args[1];
  char *result = 0 ;
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 1 || zend_get_parameters_array_ex(1, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*args[0], (void **) &arg1, SWIGTYPE_p_GDAL_GCP, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of GDAL_GCP_Id_get. Expected SWIGTYPE_p_GDAL_GCP");
    }
  }
  {
    if (!arg1) {
      SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
    }
  }
  result = (char *)GDAL_GCP_Id_get(arg1);
  {
    if(!result) {
      ZVAL_NULL(return_value);
    } else {
      ZVAL_STRING(return_value, (char *)result, 1);
    }
  }
  return;
fail:
  zend_error_noreturn(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_GDAL_GCP_Id_set) {
  GDAL_GCP *arg1 = (GDAL_GCP *) 0 ;
  char *arg2 = (char *) 0 ;
  zval **args[2];
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 2 || zend_get_parameters_array_ex(2, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*args[0], (void **) &arg1, SWIGTYPE_p_GDAL_GCP, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of GDAL_GCP_Id_set. Expected SWIGTYPE_p_GDAL_GCP");
    }
  }
  
  /*@SWIG:/usr/share/swig1.3/php/utils.i,26,CONVERT_STRING_IN@*/
  if ((*args[1])->type==IS_NULL) {
    arg2 = (char *) 0;
  } else {
    convert_to_string_ex(args[1]);
    arg2 = (char *) Z_STRVAL_PP(args[1]);
  }
  /*@SWIG@*/;
  
  {
    if (!arg1) {
      SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
    }
  }
  GDAL_GCP_Id_set(arg1,(char const *)arg2);
  
  return;
fail:
  zend_error_noreturn(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_GDAL_GCP_get_GCPX) {
  GDAL_GCP *arg1 = (GDAL_GCP *) 0 ;
  zval **args[1];
  double result;
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 1 || zend_get_parameters_array_ex(1, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*args[0], (void **) &arg1, SWIGTYPE_p_GDAL_GCP, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of GDAL_GCP_get_GCPX. Expected SWIGTYPE_p_GDAL_GCP");
    }
  }
  {
    if (!arg1) {
      SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
    }
  }
  result = (double)GDAL_GCP_get_GCPX(arg1);
  {
    ZVAL_DOUBLE(return_value,result);
  }
  return;
fail:
  zend_error_noreturn(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_GDAL_GCP_set_GCPX) {
  GDAL_GCP *arg1 = (GDAL_GCP *) 0 ;
  double arg2 ;
  zval **args[2];
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 2 || zend_get_parameters_array_ex(2, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*args[0], (void **) &arg1, SWIGTYPE_p_GDAL_GCP, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of GDAL_GCP_set_GCPX. Expected SWIGTYPE_p_GDAL_GCP");
    }
  }
  
  /*@SWIG:/usr/share/swig1.3/php/utils.i,16,CONVERT_FLOAT_IN@*/
  convert_to_double_ex(args[1]);
  arg2 = (double) Z_DVAL_PP(args[1]);
  /*@SWIG@*/;
  
  {
    if (!arg1) {
      SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
    }
  }
  GDAL_GCP_set_GCPX(arg1,arg2);
  
  return;
fail:
  zend_error_noreturn(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_GDAL_GCP_get_GCPY) {
  GDAL_GCP *arg1 = (GDAL_GCP *) 0 ;
  zval **args[1];
  double result;
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 1 || zend_get_parameters_array_ex(1, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*args[0], (void **) &arg1, SWIGTYPE_p_GDAL_GCP, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of GDAL_GCP_get_GCPY. Expected SWIGTYPE_p_GDAL_GCP");
    }
  }
  {
    if (!arg1) {
      SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
    }
  }
  result = (double)GDAL_GCP_get_GCPY(arg1);
  {
    ZVAL_DOUBLE(return_value,result);
  }
  return;
fail:
  zend_error_noreturn(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_GDAL_GCP_set_GCPY) {
  GDAL_GCP *arg1 = (GDAL_GCP *) 0 ;
  double arg2 ;
  zval **args[2];
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 2 || zend_get_parameters_array_ex(2, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*args[0], (void **) &arg1, SWIGTYPE_p_GDAL_GCP, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of GDAL_GCP_set_GCPY. Expected SWIGTYPE_p_GDAL_GCP");
    }
  }
  
  /*@SWIG:/usr/share/swig1.3/php/utils.i,16,CONVERT_FLOAT_IN@*/
  convert_to_double_ex(args[1]);
  arg2 = (double) Z_DVAL_PP(args[1]);
  /*@SWIG@*/;
  
  {
    if (!arg1) {
      SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
    }
  }
  GDAL_GCP_set_GCPY(arg1,arg2);
  
  return;
fail:
  zend_error_noreturn(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_GDAL_GCP_get_GCPZ) {
  GDAL_GCP *arg1 = (GDAL_GCP *) 0 ;
  zval **args[1];
  double result;
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 1 || zend_get_parameters_array_ex(1, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*args[0], (void **) &arg1, SWIGTYPE_p_GDAL_GCP, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of GDAL_GCP_get_GCPZ. Expected SWIGTYPE_p_GDAL_GCP");
    }
  }
  {
    if (!arg1) {
      SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
    }
  }
  result = (double)GDAL_GCP_get_GCPZ(arg1);
  {
    ZVAL_DOUBLE(return_value,result);
  }
  return;
fail:
  zend_error_noreturn(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_GDAL_GCP_set_GCPZ) {
  GDAL_GCP *arg1 = (GDAL_GCP *) 0 ;
  double arg2 ;
  zval **args[2];
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 2 || zend_get_parameters_array_ex(2, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*args[0], (void **) &arg1, SWIGTYPE_p_GDAL_GCP, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of GDAL_GCP_set_GCPZ. Expected SWIGTYPE_p_GDAL_GCP");
    }
  }
  
  /*@SWIG:/usr/share/swig1.3/php/utils.i,16,CONVERT_FLOAT_IN@*/
  convert_to_double_ex(args[1]);
  arg2 = (double) Z_DVAL_PP(args[1]);
  /*@SWIG@*/;
  
  {
    if (!arg1) {
      SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
    }
  }
  GDAL_GCP_set_GCPZ(arg1,arg2);
  
  return;
fail:
  zend_error_noreturn(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_GDAL_GCP_get_GCPPixel) {
  GDAL_GCP *arg1 = (GDAL_GCP *) 0 ;
  zval **args[1];
  double result;
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 1 || zend_get_parameters_array_ex(1, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*args[0], (void **) &arg1, SWIGTYPE_p_GDAL_GCP, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of GDAL_GCP_get_GCPPixel. Expected SWIGTYPE_p_GDAL_GCP");
    }
  }
  {
    if (!arg1) {
      SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
    }
  }
  result = (double)GDAL_GCP_get_GCPPixel(arg1);
  {
    ZVAL_DOUBLE(return_value,result);
  }
  return;
fail:
  zend_error_noreturn(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_GDAL_GCP_set_GCPPixel) {
  GDAL_GCP *arg1 = (GDAL_GCP *) 0 ;
  double arg2 ;
  zval **args[2];
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 2 || zend_get_parameters_array_ex(2, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*args[0], (void **) &arg1, SWIGTYPE_p_GDAL_GCP, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of GDAL_GCP_set_GCPPixel. Expected SWIGTYPE_p_GDAL_GCP");
    }
  }
  
  /*@SWIG:/usr/share/swig1.3/php/utils.i,16,CONVERT_FLOAT_IN@*/
  convert_to_double_ex(args[1]);
  arg2 = (double) Z_DVAL_PP(args[1]);
  /*@SWIG@*/;
  
  {
    if (!arg1) {
      SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
    }
  }
  GDAL_GCP_set_GCPPixel(arg1,arg2);
  
  return;
fail:
  zend_error_noreturn(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_GDAL_GCP_get_GCPLine) {
  GDAL_GCP *arg1 = (GDAL_GCP *) 0 ;
  zval **args[1];
  double result;
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 1 || zend_get_parameters_array_ex(1, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*args[0], (void **) &arg1, SWIGTYPE_p_GDAL_GCP, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of GDAL_GCP_get_GCPLine. Expected SWIGTYPE_p_GDAL_GCP");
    }
  }
  {
    if (!arg1) {
      SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
    }
  }
  result = (double)GDAL_GCP_get_GCPLine(arg1);
  {
    ZVAL_DOUBLE(return_value,result);
  }
  return;
fail:
  zend_error_noreturn(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_GDAL_GCP_set_GCPLine) {
  GDAL_GCP *arg1 = (GDAL_GCP *) 0 ;
  double arg2 ;
  zval **args[2];
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 2 || zend_get_parameters_array_ex(2, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*args[0], (void **) &arg1, SWIGTYPE_p_GDAL_GCP, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of GDAL_GCP_set_GCPLine. Expected SWIGTYPE_p_GDAL_GCP");
    }
  }
  
  /*@SWIG:/usr/share/swig1.3/php/utils.i,16,CONVERT_FLOAT_IN@*/
  convert_to_double_ex(args[1]);
  arg2 = (double) Z_DVAL_PP(args[1]);
  /*@SWIG@*/;
  
  {
    if (!arg1) {
      SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
    }
  }
  GDAL_GCP_set_GCPLine(arg1,arg2);
  
  return;
fail:
  zend_error_noreturn(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_GDAL_GCP_get_Info) {
  GDAL_GCP *arg1 = (GDAL_GCP *) 0 ;
  zval **args[1];
  char *result = 0 ;
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 1 || zend_get_parameters_array_ex(1, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*args[0], (void **) &arg1, SWIGTYPE_p_GDAL_GCP, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of GDAL_GCP_get_Info. Expected SWIGTYPE_p_GDAL_GCP");
    }
  }
  {
    if (!arg1) {
      SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
    }
  }
  result = (char *)GDAL_GCP_get_Info(arg1);
  {
    if(!result) {
      ZVAL_NULL(return_value);
    } else {
      ZVAL_STRING(return_value, (char *)result, 1);
    }
  }
  return;
fail:
  zend_error_noreturn(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_GDAL_GCP_set_Info) {
  GDAL_GCP *arg1 = (GDAL_GCP *) 0 ;
  char *arg2 = (char *) 0 ;
  zval **args[2];
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 2 || zend_get_parameters_array_ex(2, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*args[0], (void **) &arg1, SWIGTYPE_p_GDAL_GCP, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of GDAL_GCP_set_Info. Expected SWIGTYPE_p_GDAL_GCP");
    }
  }
  
  /*@SWIG:/usr/share/swig1.3/php/utils.i,26,CONVERT_STRING_IN@*/
  if ((*args[1])->type==IS_NULL) {
    arg2 = (char *) 0;
  } else {
    convert_to_string_ex(args[1]);
    arg2 = (char *) Z_STRVAL_PP(args[1]);
  }
  /*@SWIG@*/;
  
  {
    if (!arg1) {
      SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
    }
  }
  GDAL_GCP_set_Info(arg1,(char const *)arg2);
  
  return;
fail:
  zend_error_noreturn(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_GDAL_GCP_get_Id) {
  GDAL_GCP *arg1 = (GDAL_GCP *) 0 ;
  zval **args[1];
  char *result = 0 ;
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 1 || zend_get_parameters_array_ex(1, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*args[0], (void **) &arg1, SWIGTYPE_p_GDAL_GCP, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of GDAL_GCP_get_Id. Expected SWIGTYPE_p_GDAL_GCP");
    }
  }
  {
    if (!arg1) {
      SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
    }
  }
  result = (char *)GDAL_GCP_get_Id(arg1);
  {
    if(!result) {
      ZVAL_NULL(return_value);
    } else {
      ZVAL_STRING(return_value, (char *)result, 1);
    }
  }
  return;
fail:
  zend_error_noreturn(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_GDAL_GCP_set_Id) {
  GDAL_GCP *arg1 = (GDAL_GCP *) 0 ;
  char *arg2 = (char *) 0 ;
  zval **args[2];
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 2 || zend_get_parameters_array_ex(2, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*args[0], (void **) &arg1, SWIGTYPE_p_GDAL_GCP, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of GDAL_GCP_set_Id. Expected SWIGTYPE_p_GDAL_GCP");
    }
  }
  
  /*@SWIG:/usr/share/swig1.3/php/utils.i,26,CONVERT_STRING_IN@*/
  if ((*args[1])->type==IS_NULL) {
    arg2 = (char *) 0;
  } else {
    convert_to_string_ex(args[1]);
    arg2 = (char *) Z_STRVAL_PP(args[1]);
  }
  /*@SWIG@*/;
  
  {
    if (!arg1) {
      SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
    }
  }
  GDAL_GCP_set_Id(arg1,(char const *)arg2);
  
  return;
fail:
  zend_error_noreturn(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_GCPsToGeoTransform) {
  int arg1 ;
  GDAL_GCP *arg2 = (GDAL_GCP *) 0 ;
  double *arg3 ;
  int arg4 = (int) 1 ;
  GDAL_GCP *tmpGCPList1 ;
  double argout3[6] ;
  zval **args[2];
  int arg_count;
  RETURN_NONE result;
  
  {
    /* %typemap(in,numinputs=0) (double argout3[ANY]) */
    arg3 = argout3;
  }
  SWIG_ResetError();
  arg_count = ZEND_NUM_ARGS();
  if(arg_count<1 || arg_count>2 ||
    zend_get_parameters_array_ex(arg_count,args)!=SUCCESS)
  WRONG_PARAM_COUNT;
  
  {
    /* %typemap(in,numinputs=1) (int nGCPs, GDAL_GCP const *pGCPs ) */
  }
  if(arg_count > 1) {
    /*@SWIG:/usr/share/swig1.3/php/utils.i,7,CONVERT_INT_IN@*/
    convert_to_long_ex(args[1]);
    arg4 = (int) Z_LVAL_PP(args[1]);
    /*@SWIG@*/;
    
  }
  result = GDALGCPsToGeoTransform(arg1,(GDAL_GCP const *)arg2,arg3,arg4);
  {
    /* %typemap(out) IF_FALSE_RETURN_NONE */
    RETVAL_NULL();  
  }
  {
    /* %typemap(argout) (double argout[ANY]) */
    zval *t = CreateTupleFromDoubleArray( arg3, 6 );
    t_output_helper( &return_value, t );
  }
  {
    /* %typemap(freearg) (int nGCPs, GDAL_GCP const *pGCPs ) */
    if (arg2) {
      free( (void*) arg2 );
    }
  }
  {
    /* %typemap(ret) IF_FALSE_RETURN_NONE */
    RETVAL_NULL();
  }
  return;
fail:
  {
    /* %typemap(freearg) (int nGCPs, GDAL_GCP const *pGCPs ) */
    if (arg2) {
      free( (void*) arg2 );
    }
  }
  zend_error_noreturn(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


/* This function is designed to be called by the zend list destructors */
/* to typecast and do the actual destruction */
static void __wrap_delete_AsyncReader(zend_rsrc_list_entry *rsrc, const char *type_name TSRMLS_DC) {
  swig_object_wrapper *value=(swig_object_wrapper *) rsrc->ptr ;
  void *ptr=value->ptr ;
  int newobject=value->newobject ;
  GDALAsyncReaderShadow *arg1 = (GDALAsyncReaderShadow *) 0 ;
  
  efree(value);
  if (! newobject) return; /* can't delete it! */
  arg1 = (GDALAsyncReaderShadow *)SWIG_ZTS_ConvertResourceData(ptr,type_name,SWIGTYPE_p_GDALAsyncReaderShadow TSRMLS_CC);
  if (! arg1) zend_error(E_ERROR, "GDALAsyncReaderShadow resource already free'd");
  delete_GDALAsyncReaderShadow(arg1);
  return;
fail:
  zend_error_noreturn(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_AsyncReader_GetNextUpdatedRegion) {
  GDALAsyncReaderShadow *arg1 = (GDALAsyncReaderShadow *) 0 ;
  double arg2 ;
  int *arg3 = (int *) 0 ;
  int *arg4 = (int *) 0 ;
  int *arg5 = (int *) 0 ;
  int *arg6 = (int *) 0 ;
  int temp3 ;
  int temp4 ;
  int temp5 ;
  int temp6 ;
  zval **args[2];
  GDALAsyncStatusType result;
  
  arg3 = &temp3;
  arg4 = &temp4;
  arg5 = &temp5;
  arg6 = &temp6;
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 2 || zend_get_parameters_array_ex(2, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*args[0], (void **) &arg1, SWIGTYPE_p_GDALAsyncReaderShadow, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of AsyncReader_GetNextUpdatedRegion. Expected SWIGTYPE_p_GDALAsyncReaderShadow");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  
  /*@SWIG:/usr/share/swig1.3/php/utils.i,16,CONVERT_FLOAT_IN@*/
  convert_to_double_ex(args[1]);
  arg2 = (double) Z_DVAL_PP(args[1]);
  /*@SWIG@*/;
  
  result = (GDALAsyncStatusType)GDALAsyncReaderShadow_GetNextUpdatedRegion(arg1,arg2,arg3,arg4,arg5,arg6);
  {
    ZVAL_LONG(return_value,result);
  }
  {
    zval *o;
    MAKE_STD_ZVAL(o);
    ZVAL_LONG(o,temp3);
    t_output_helper( &return_value, o );
  }
  {
    zval *o;
    MAKE_STD_ZVAL(o);
    ZVAL_LONG(o,temp4);
    t_output_helper( &return_value, o );
  }
  {
    zval *o;
    MAKE_STD_ZVAL(o);
    ZVAL_LONG(o,temp5);
    t_output_helper( &return_value, o );
  }
  {
    zval *o;
    MAKE_STD_ZVAL(o);
    ZVAL_LONG(o,temp6);
    t_output_helper( &return_value, o );
  }
  return;
fail:
  zend_error_noreturn(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_AsyncReader_LockBuffer) {
  GDALAsyncReaderShadow *arg1 = (GDALAsyncReaderShadow *) 0 ;
  double arg2 ;
  zval **args[2];
  int result;
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 2 || zend_get_parameters_array_ex(2, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*args[0], (void **) &arg1, SWIGTYPE_p_GDALAsyncReaderShadow, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of AsyncReader_LockBuffer. Expected SWIGTYPE_p_GDALAsyncReaderShadow");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  
  /*@SWIG:/usr/share/swig1.3/php/utils.i,16,CONVERT_FLOAT_IN@*/
  convert_to_double_ex(args[1]);
  arg2 = (double) Z_DVAL_PP(args[1]);
  /*@SWIG@*/;
  
  result = (int)GDALAsyncReaderShadow_LockBuffer(arg1,arg2);
  {
    ZVAL_LONG(return_value,result);
  }
  return;
fail:
  zend_error_noreturn(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_AsyncReader_UnlockBuffer) {
  GDALAsyncReaderShadow *arg1 = (GDALAsyncReaderShadow *) 0 ;
  zval **args[1];
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 1 || zend_get_parameters_array_ex(1, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*args[0], (void **) &arg1, SWIGTYPE_p_GDALAsyncReaderShadow, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of AsyncReader_UnlockBuffer. Expected SWIGTYPE_p_GDALAsyncReaderShadow");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  GDALAsyncReaderShadow_UnlockBuffer(arg1);
  
  return;
fail:
  zend_error_noreturn(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_Dataset_RasterXSize_get) {
  GDALDatasetShadow *arg1 = (GDALDatasetShadow *) 0 ;
  zval **args[1];
  int result;
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 1 || zend_get_parameters_array_ex(1, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*args[0], (void **) &arg1, SWIGTYPE_p_GDALDatasetShadow, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of Dataset_RasterXSize_get. Expected SWIGTYPE_p_GDALDatasetShadow");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  result = (int)GDALDatasetShadow_RasterXSize_get(arg1);
  {
    ZVAL_LONG(return_value,result);
  }
  return;
fail:
  zend_error_noreturn(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_Dataset_RasterYSize_get) {
  GDALDatasetShadow *arg1 = (GDALDatasetShadow *) 0 ;
  zval **args[1];
  int result;
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 1 || zend_get_parameters_array_ex(1, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*args[0], (void **) &arg1, SWIGTYPE_p_GDALDatasetShadow, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of Dataset_RasterYSize_get. Expected SWIGTYPE_p_GDALDatasetShadow");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  result = (int)GDALDatasetShadow_RasterYSize_get(arg1);
  {
    ZVAL_LONG(return_value,result);
  }
  return;
fail:
  zend_error_noreturn(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_Dataset_RasterCount_get) {
  GDALDatasetShadow *arg1 = (GDALDatasetShadow *) 0 ;
  zval **args[1];
  int result;
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 1 || zend_get_parameters_array_ex(1, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*args[0], (void **) &arg1, SWIGTYPE_p_GDALDatasetShadow, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of Dataset_RasterCount_get. Expected SWIGTYPE_p_GDALDatasetShadow");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  result = (int)GDALDatasetShadow_RasterCount_get(arg1);
  {
    ZVAL_LONG(return_value,result);
  }
  return;
fail:
  zend_error_noreturn(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


/* This function is designed to be called by the zend list destructors */
/* to typecast and do the actual destruction */
static void __wrap_delete_Dataset(zend_rsrc_list_entry *rsrc, const char *type_name TSRMLS_DC) {
  swig_object_wrapper *value=(swig_object_wrapper *) rsrc->ptr ;
  void *ptr=value->ptr ;
  int newobject=value->newobject ;
  GDALDatasetShadow *arg1 = (GDALDatasetShadow *) 0 ;
  
  efree(value);
  if (! newobject) return; /* can't delete it! */
  arg1 = (GDALDatasetShadow *)SWIG_ZTS_ConvertResourceData(ptr,type_name,SWIGTYPE_p_GDALDatasetShadow TSRMLS_CC);
  if (! arg1) zend_error(E_ERROR, "GDALDatasetShadow resource already free'd");
  delete_GDALDatasetShadow(arg1);
  return;
fail:
  zend_error_noreturn(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_Dataset_GetDriver) {
  GDALDatasetShadow *arg1 = (GDALDatasetShadow *) 0 ;
  zval **args[1];
  GDALDriverShadow *result = 0 ;
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 1 || zend_get_parameters_array_ex(1, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*args[0], (void **) &arg1, SWIGTYPE_p_GDALDatasetShadow, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of Dataset_GetDriver. Expected SWIGTYPE_p_GDALDatasetShadow");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  result = (GDALDriverShadow *)GDALDatasetShadow_GetDriver(arg1);
  
  SWIG_SetPointerZval(return_value, (void *)result, SWIGTYPE_p_GDALDriverShadow, 0);
  
  return;
fail:
  zend_error_noreturn(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_Dataset_GetRasterBand) {
  GDALDatasetShadow *arg1 = (GDALDatasetShadow *) 0 ;
  int arg2 ;
  zval **args[2];
  GDALRasterBandShadow *result = 0 ;
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 2 || zend_get_parameters_array_ex(2, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*args[0], (void **) &arg1, SWIGTYPE_p_GDALDatasetShadow, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of Dataset_GetRasterBand. Expected SWIGTYPE_p_GDALDatasetShadow");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  
  /*@SWIG:/usr/share/swig1.3/php/utils.i,7,CONVERT_INT_IN@*/
  convert_to_long_ex(args[1]);
  arg2 = (int) Z_LVAL_PP(args[1]);
  /*@SWIG@*/;
  
  result = (GDALRasterBandShadow *)GDALDatasetShadow_GetRasterBand(arg1,arg2);
  
  SWIG_SetPointerZval(return_value, (void *)result, SWIGTYPE_p_GDALRasterBandShadow, 0);
  
  return;
fail:
  zend_error_noreturn(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_Dataset_GetProjection) {
  GDALDatasetShadow *arg1 = (GDALDatasetShadow *) 0 ;
  zval **args[1];
  char *result = 0 ;
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 1 || zend_get_parameters_array_ex(1, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*args[0], (void **) &arg1, SWIGTYPE_p_GDALDatasetShadow, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of Dataset_GetProjection. Expected SWIGTYPE_p_GDALDatasetShadow");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  result = (char *)GDALDatasetShadow_GetProjection(arg1);
  {
    if(!result) {
      ZVAL_NULL(return_value);
    } else {
      ZVAL_STRING(return_value, (char *)result, 1);
    }
  }
  return;
fail:
  zend_error_noreturn(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_Dataset_GetProjectionRef) {
  GDALDatasetShadow *arg1 = (GDALDatasetShadow *) 0 ;
  zval **args[1];
  char *result = 0 ;
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 1 || zend_get_parameters_array_ex(1, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*args[0], (void **) &arg1, SWIGTYPE_p_GDALDatasetShadow, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of Dataset_GetProjectionRef. Expected SWIGTYPE_p_GDALDatasetShadow");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  result = (char *)GDALDatasetShadow_GetProjectionRef(arg1);
  {
    if(!result) {
      ZVAL_NULL(return_value);
    } else {
      ZVAL_STRING(return_value, (char *)result, 1);
    }
  }
  return;
fail:
  zend_error_noreturn(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_Dataset_SetProjection) {
  GDALDatasetShadow *arg1 = (GDALDatasetShadow *) 0 ;
  char *arg2 = (char *) 0 ;
  zval **args[2];
  CPLErr result;
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 2 || zend_get_parameters_array_ex(2, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*args[0], (void **) &arg1, SWIGTYPE_p_GDALDatasetShadow, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of Dataset_SetProjection. Expected SWIGTYPE_p_GDALDatasetShadow");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  
  /*@SWIG:/usr/share/swig1.3/php/utils.i,26,CONVERT_STRING_IN@*/
  if ((*args[1])->type==IS_NULL) {
    arg2 = (char *) 0;
  } else {
    convert_to_string_ex(args[1]);
    arg2 = (char *) Z_STRVAL_PP(args[1]);
  }
  /*@SWIG@*/;
  
  {
    if (!arg2) {
      SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
    }
  }
  result = (CPLErr)GDALDatasetShadow_SetProjection(arg1,(char const *)arg2);
  {
    ZVAL_LONG(return_value,result);
  }
  return;
fail:
  zend_error_noreturn(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_Dataset_GetGeoTransform) {
  GDALDatasetShadow *arg1 = (GDALDatasetShadow *) 0 ;
  double *arg2 ;
  double argout2[6] ;
  zval **args[1];
  
  {
    /* %typemap(in,numinputs=0) (double argout2[ANY]) */
    arg2 = argout2;
  }
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 1 || zend_get_parameters_array_ex(1, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*args[0], (void **) &arg1, SWIGTYPE_p_GDALDatasetShadow, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of Dataset_GetGeoTransform. Expected SWIGTYPE_p_GDALDatasetShadow");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  GDALDatasetShadow_GetGeoTransform(arg1,arg2);
  
  {
    /* %typemap(argout) (double argout[ANY]) */
    zval *t = CreateTupleFromDoubleArray( arg2, 6 );
    t_output_helper( &return_value, t );
  }
  return;
fail:
  zend_error_noreturn(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_Dataset_SetGeoTransform) {
  GDALDatasetShadow *arg1 = (GDALDatasetShadow *) 0 ;
  double *arg2 ;
  double argin2[6] ;
  zval **args[2];
  CPLErr result;
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 2 || zend_get_parameters_array_ex(2, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*args[0], (void **) &arg1, SWIGTYPE_p_GDALDatasetShadow, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of Dataset_SetGeoTransform. Expected SWIGTYPE_p_GDALDatasetShadow");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    /* %typemap(in) (double argin2[ANY]) */
    arg2 = argin2;
    for (unsigned int i=0; i<6; i++) {
      double val = 0.0; /* extract val from i-th position of args[1] */
      arg2[i] =  val;
    }
  }
  result = (CPLErr)GDALDatasetShadow_SetGeoTransform(arg1,arg2);
  {
    ZVAL_LONG(return_value,result);
  }
  return;
fail:
  zend_error_noreturn(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_Dataset_BuildOverviews) {
  GDALDatasetShadow *arg1 = (GDALDatasetShadow *) 0 ;
  char *arg2 = (char *) "NEAREST" ;
  int arg3 = (int) 0 ;
  int *arg4 = (int *) 0 ;
  GDALProgressFunc arg5 = (GDALProgressFunc) NULL ;
  void *arg6 = (void *) NULL ;
  GDALProgressFunc *tmp5 ;
  zval **args[5];
  int arg_count;
  int result;
  
  SWIG_ResetError();
  arg_count = ZEND_NUM_ARGS();
  if(arg_count<1 || arg_count>5 ||
    zend_get_parameters_array_ex(arg_count,args)!=SUCCESS)
  WRONG_PARAM_COUNT;
  
  {
    if(SWIG_ConvertPtr(*args[0], (void **) &arg1, SWIGTYPE_p_GDALDatasetShadow, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of Dataset_BuildOverviews. Expected SWIGTYPE_p_GDALDatasetShadow");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  if(arg_count > 1) {
    /*@SWIG:/usr/share/swig1.3/php/utils.i,26,CONVERT_STRING_IN@*/
    if ((*args[1])->type==IS_NULL) {
      arg2 = (char *) 0;
    } else {
      convert_to_string_ex(args[1]);
      arg2 = (char *) Z_STRVAL_PP(args[1]);
    }
    /*@SWIG@*/;
    
  }
  if(arg_count > 2) {
    {
      /* %typemap(in,numinputs=1) (int nList, int* pList)*/
      zend_error(E_ERROR,"Typemap (in,numinputs=1) (int nList, int*pList) not properly defined");
      /* check if is List */
      //  if ( !PySequence_Check(args[2]) ) {
      //    PyErr_SetString(PyExc_TypeError, "not a sequence");
      //    SWIG_fail;
      //  }
      //  arg3 = PySequence_Size(args[2]);
      //  arg4 = (int*) malloc(arg3*sizeof(int));
      //  for( int i = 0; i<arg3; i++ ) {
      //    PyObject *o = PySequence_GetItem(args[2],i);
      //    if ( !PyArg_Parse(o,"i",&arg4[i]) ) {
      //      SWIG_fail;
      //    }
      //  }
    }
  }
  if(arg_count > 3) {
    {
      if(SWIG_ConvertPtr(*args[3], (void **) &tmp5, SWIGTYPE_p_GDALProgressFunc, 0) < 0 || tmp5 == NULL) {
        SWIG_PHP_Error(E_ERROR, "Type error in argument 5 of Dataset_BuildOverviews. Expected SWIGTYPE_p_GDALProgressFunc");
      }
      arg5 = *tmp5;
    }
  }
  if(arg_count > 4) {
    {
      if(SWIG_ConvertPtr(*args[4], (void **) &arg6, 0, 0) < 0) {
        /* Allow NULL from php for void* */
        if ((*args[4])->type==IS_NULL) arg6=0;
        else
        SWIG_PHP_Error(E_ERROR, "Type error in argument 6 of Dataset_BuildOverviews. Expected SWIGTYPE_p_p_void");
      }
    }
  }
  result = (int)GDALDatasetShadow_BuildOverviews(arg1,(char const *)arg2,arg3,arg4,arg5,arg6);
  {
    ZVAL_LONG(return_value,result);
  }
  {
    /* %typemap(freearg) (int nList, int* pList) */
    if (arg4) {
      free((void*) arg4);
    }
  }
  return;
fail:
  {
    /* %typemap(freearg) (int nList, int* pList) */
    if (arg4) {
      free((void*) arg4);
    }
  }
  zend_error_noreturn(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_Dataset_GetGCPCount) {
  GDALDatasetShadow *arg1 = (GDALDatasetShadow *) 0 ;
  zval **args[1];
  int result;
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 1 || zend_get_parameters_array_ex(1, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*args[0], (void **) &arg1, SWIGTYPE_p_GDALDatasetShadow, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of Dataset_GetGCPCount. Expected SWIGTYPE_p_GDALDatasetShadow");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  result = (int)GDALDatasetShadow_GetGCPCount(arg1);
  {
    ZVAL_LONG(return_value,result);
  }
  return;
fail:
  zend_error_noreturn(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_Dataset_GetGCPProjection) {
  GDALDatasetShadow *arg1 = (GDALDatasetShadow *) 0 ;
  zval **args[1];
  char *result = 0 ;
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 1 || zend_get_parameters_array_ex(1, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*args[0], (void **) &arg1, SWIGTYPE_p_GDALDatasetShadow, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of Dataset_GetGCPProjection. Expected SWIGTYPE_p_GDALDatasetShadow");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  result = (char *)GDALDatasetShadow_GetGCPProjection(arg1);
  {
    if(!result) {
      ZVAL_NULL(return_value);
    } else {
      ZVAL_STRING(return_value, (char *)result, 1);
    }
  }
  return;
fail:
  zend_error_noreturn(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_Dataset_GetGCPs) {
  GDALDatasetShadow *arg1 = (GDALDatasetShadow *) 0 ;
  int *arg2 = (int *) 0 ;
  GDAL_GCP **arg3 = (GDAL_GCP **) 0 ;
  int nGCPs2 = 0 ;
  GDAL_GCP *pGCPs2 = 0 ;
  zval **args[1];
  
  {
    /* %typemap(in,numinputs=0) (int *nGCPs2, GDAL_GCP const **pGCPs2 ) */
    arg2 = &nGCPs2;
    arg3 = &pGCPs2;
  }
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 1 || zend_get_parameters_array_ex(1, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*args[0], (void **) &arg1, SWIGTYPE_p_GDALDatasetShadow, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of Dataset_GetGCPs. Expected SWIGTYPE_p_GDALDatasetShadow");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  GDALDatasetShadow_GetGCPs(arg1,arg2,(GDAL_GCP const **)arg3);
  
  {
    /* %typemap(argout) (int *nGCPs, GDAL_GCP const **pGCPs ) */
    zval *out;
    MAKE_STD_ZVAL(out);
    array_init(out);
    for( int i = 0; i < *arg2; i++ ) {
      GDAL_GCP *o = new_GDAL_GCP( (*arg3)[i].dfGCPX,
        (*arg3)[i].dfGCPY,
        (*arg3)[i].dfGCPZ,
        (*arg3)[i].dfGCPPixel,
        (*arg3)[i].dfGCPLine,
        (*arg3)[i].pszInfo,
        (*arg3)[i].pszId );
      zval *t;
      MAKE_STD_ZVAL(t);
      SWIG_SetPointerZval(t,(void*)o,SWIGTYPE_p_GDAL_GCP,1);
      add_next_index_zval(out,t);
    }
    return_value = out;
    zval_copy_ctor(return_value);
  }
  return;
fail:
  zend_error_noreturn(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_Dataset_SetGCPs) {
  GDALDatasetShadow *arg1 = (GDALDatasetShadow *) 0 ;
  int arg2 ;
  GDAL_GCP *arg3 = (GDAL_GCP *) 0 ;
  char *arg4 = (char *) 0 ;
  GDAL_GCP *tmpGCPList2 ;
  zval **args[3];
  CPLErr result;
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 3 || zend_get_parameters_array_ex(3, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*args[0], (void **) &arg1, SWIGTYPE_p_GDALDatasetShadow, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of Dataset_SetGCPs. Expected SWIGTYPE_p_GDALDatasetShadow");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    /* %typemap(in,numinputs=1) (int nGCPs, GDAL_GCP const *pGCPs ) */
  }
  
  /*@SWIG:/usr/share/swig1.3/php/utils.i,26,CONVERT_STRING_IN@*/
  if ((*args[2])->type==IS_NULL) {
    arg4 = (char *) 0;
  } else {
    convert_to_string_ex(args[2]);
    arg4 = (char *) Z_STRVAL_PP(args[2]);
  }
  /*@SWIG@*/;
  
  result = (CPLErr)GDALDatasetShadow_SetGCPs(arg1,arg2,(GDAL_GCP const *)arg3,(char const *)arg4);
  {
    ZVAL_LONG(return_value,result);
  }
  {
    /* %typemap(freearg) (int nGCPs, GDAL_GCP const *pGCPs ) */
    if (arg3) {
      free( (void*) arg3 );
    }
  }
  return;
fail:
  {
    /* %typemap(freearg) (int nGCPs, GDAL_GCP const *pGCPs ) */
    if (arg3) {
      free( (void*) arg3 );
    }
  }
  zend_error_noreturn(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_Dataset_FlushCache) {
  GDALDatasetShadow *arg1 = (GDALDatasetShadow *) 0 ;
  zval **args[1];
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 1 || zend_get_parameters_array_ex(1, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*args[0], (void **) &arg1, SWIGTYPE_p_GDALDatasetShadow, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of Dataset_FlushCache. Expected SWIGTYPE_p_GDALDatasetShadow");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  GDALDatasetShadow_FlushCache(arg1);
  
  return;
fail:
  zend_error_noreturn(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_Dataset_AddBand) {
  GDALDatasetShadow *arg1 = (GDALDatasetShadow *) 0 ;
  GDALDataType arg2 = (GDALDataType) GDT_Byte ;
  char **arg3 = (char **) 0 ;
  zval **args[3];
  int arg_count;
  CPLErr result;
  
  SWIG_ResetError();
  arg_count = ZEND_NUM_ARGS();
  if(arg_count<1 || arg_count>3 ||
    zend_get_parameters_array_ex(arg_count,args)!=SUCCESS)
  WRONG_PARAM_COUNT;
  
  {
    if(SWIG_ConvertPtr(*args[0], (void **) &arg1, SWIGTYPE_p_GDALDatasetShadow, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of Dataset_AddBand. Expected SWIGTYPE_p_GDALDatasetShadow");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  if(arg_count > 1) {
    /*@SWIG:/usr/share/swig1.3/php/utils.i,7,CONVERT_INT_IN@*/
    convert_to_long_ex(args[1]);
    arg2 = (GDALDataType) Z_LVAL_PP(args[1]);
    /*@SWIG@*/;
    
  }
  if(arg_count > 2) {
    {
      /* %typemap(in) char **options */
      zend_error(E_ERROR,"Typemap (in) char **options not properly defined");
      //  int size = PySequence_Size(args[2]);
      //  for (int i = 0; i < size; i++) {
      //    char *pszItem = NULL;
      //    if ( ! PyArg_Parse( PySequence_GetItem(args[2],i), "s", &pszItem ) ) {
      //      PyErr_SetString(PyExc_TypeError,"sequence must contain strings");
      //      SWIG_fail;
      //    }
      //    arg3 = CSLAddString( arg3, pszItem );
      //  }
    }
  }
  result = (CPLErr)GDALDatasetShadow_AddBand(arg1,arg2,arg3);
  {
    ZVAL_LONG(return_value,result);
  }
  {
    /* %typemap(freearg) char **options */
    CSLDestroy( arg3 );
  }
  return;
fail:
  {
    /* %typemap(freearg) char **options */
    CSLDestroy( arg3 );
  }
  zend_error_noreturn(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_Dataset_CreateMaskBand) {
  GDALDatasetShadow *arg1 = (GDALDatasetShadow *) 0 ;
  int arg2 ;
  zval **args[2];
  CPLErr result;
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 2 || zend_get_parameters_array_ex(2, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*args[0], (void **) &arg1, SWIGTYPE_p_GDALDatasetShadow, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of Dataset_CreateMaskBand. Expected SWIGTYPE_p_GDALDatasetShadow");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  
  /*@SWIG:/usr/share/swig1.3/php/utils.i,7,CONVERT_INT_IN@*/
  convert_to_long_ex(args[1]);
  arg2 = (int) Z_LVAL_PP(args[1]);
  /*@SWIG@*/;
  
  result = (CPLErr)GDALDatasetShadow_CreateMaskBand(arg1,arg2);
  {
    ZVAL_LONG(return_value,result);
  }
  return;
fail:
  zend_error_noreturn(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_Dataset_GetFileList) {
  GDALDatasetShadow *arg1 = (GDALDatasetShadow *) 0 ;
  zval **args[1];
  char **result = 0 ;
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 1 || zend_get_parameters_array_ex(1, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*args[0], (void **) &arg1, SWIGTYPE_p_GDALDatasetShadow, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of Dataset_GetFileList. Expected SWIGTYPE_p_GDALDatasetShadow");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  result = (char **)GDALDatasetShadow_GetFileList(arg1);
  
  SWIG_SetPointerZval(return_value, (void *)result, SWIGTYPE_p_p_char, 0);
  
  return;
fail:
  zend_error_noreturn(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_Dataset_WriteRaster) {
  GDALDatasetShadow *arg1 = (GDALDatasetShadow *) 0 ;
  int arg2 ;
  int arg3 ;
  int arg4 ;
  int arg5 ;
  int arg6 ;
  char *arg7 = (char *) 0 ;
  int *arg8 = (int *) 0 ;
  int *arg9 = (int *) 0 ;
  GDALDataType *arg10 = (GDALDataType *) 0 ;
  int arg11 = (int) 0 ;
  int *arg12 = (int *) 0 ;
  int *arg13 = (int *) 0 ;
  int *arg14 = (int *) 0 ;
  int *arg15 = (int *) 0 ;
  int val8 ;
  int val9 ;
  GDALDataType val10 ;
  int val13 ;
  int val14 ;
  int val15 ;
  zval **args[13];
  int arg_count;
  CPLErr result;
  
  SWIG_ResetError();
  arg_count = ZEND_NUM_ARGS();
  if(arg_count<6 || arg_count>13 ||
    zend_get_parameters_array_ex(arg_count,args)!=SUCCESS)
  WRONG_PARAM_COUNT;
  
  {
    if(SWIG_ConvertPtr(*args[0], (void **) &arg1, SWIGTYPE_p_GDALDatasetShadow, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of Dataset_WriteRaster. Expected SWIGTYPE_p_GDALDatasetShadow");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  
  /*@SWIG:/usr/share/swig1.3/php/utils.i,7,CONVERT_INT_IN@*/
  convert_to_long_ex(args[1]);
  arg2 = (int) Z_LVAL_PP(args[1]);
  /*@SWIG@*/;
  
  
  /*@SWIG:/usr/share/swig1.3/php/utils.i,7,CONVERT_INT_IN@*/
  convert_to_long_ex(args[2]);
  arg3 = (int) Z_LVAL_PP(args[2]);
  /*@SWIG@*/;
  
  
  /*@SWIG:/usr/share/swig1.3/php/utils.i,7,CONVERT_INT_IN@*/
  convert_to_long_ex(args[3]);
  arg4 = (int) Z_LVAL_PP(args[3]);
  /*@SWIG@*/;
  
  
  /*@SWIG:/usr/share/swig1.3/php/utils.i,7,CONVERT_INT_IN@*/
  convert_to_long_ex(args[4]);
  arg5 = (int) Z_LVAL_PP(args[4]);
  /*@SWIG@*/;
  
  {
    /* %typemap(in,numinputs=1) (int nLen, char *pBuf ) */
    convert_to_string_ex(args[5]);
    arg7 = Z_STRVAL_PP(args[5]);
    arg6 = Z_STRLEN_PP(args[5]);
  }
  if(arg_count > 6) {
    {
      /* %typemap(in) (int *optional_int) */
      if ( ZVAL_IS_NULL(*args[6]) ) {
        arg8 = 0;
      }
      convert_to_long_ex(args[6]);
      val8 = (int) Z_LVAL_PP( args[6] );
      arg8 = &val8;  
    }
  }
  if(arg_count > 7) {
    {
      /* %typemap(in) (int *optional_int) */
      if ( ZVAL_IS_NULL(*args[7]) ) {
        arg9 = 0;
      }
      convert_to_long_ex(args[7]);
      val9 = (int) Z_LVAL_PP( args[7] );
      arg9 = &val9;  
    }
  }
  if(arg_count > 8) {
    {
      /* %typemap(in) (int *optional_int) */
      if ( ZVAL_IS_NULL(*args[8]) ) {
        arg10 = 0;
      }
      convert_to_long_ex(args[8]);
      val10 = (GDALDataType) Z_LVAL_PP( args[8] );
      arg10 = &val10;  
    }
  }
  if(arg_count > 9) {
    {
      /* %typemap(in,numinputs=1) (int nList, int* pList)*/
      zend_error(E_ERROR,"Typemap (in,numinputs=1) (int nList, int*pList) not properly defined");
      /* check if is List */
      //  if ( !PySequence_Check(args[9]) ) {
      //    PyErr_SetString(PyExc_TypeError, "not a sequence");
      //    SWIG_fail;
      //  }
      //  arg11 = PySequence_Size(args[9]);
      //  arg12 = (int*) malloc(arg11*sizeof(int));
      //  for( int i = 0; i<arg11; i++ ) {
      //    PyObject *o = PySequence_GetItem(args[9],i);
      //    if ( !PyArg_Parse(o,"i",&arg12[i]) ) {
      //      SWIG_fail;
      //    }
      //  }
    }
  }
  if(arg_count > 10) {
    {
      /* %typemap(in) (int *optional_int) */
      if ( ZVAL_IS_NULL(*args[10]) ) {
        arg13 = 0;
      }
      convert_to_long_ex(args[10]);
      val13 = (int) Z_LVAL_PP( args[10] );
      arg13 = &val13;  
    }
  }
  if(arg_count > 11) {
    {
      /* %typemap(in) (int *optional_int) */
      if ( ZVAL_IS_NULL(*args[11]) ) {
        arg14 = 0;
      }
      convert_to_long_ex(args[11]);
      val14 = (int) Z_LVAL_PP( args[11] );
      arg14 = &val14;  
    }
  }
  if(arg_count > 12) {
    {
      /* %typemap(in) (int *optional_int) */
      if ( ZVAL_IS_NULL(*args[12]) ) {
        arg15 = 0;
      }
      convert_to_long_ex(args[12]);
      val15 = (int) Z_LVAL_PP( args[12] );
      arg15 = &val15;  
    }
  }
  result = (CPLErr)GDALDatasetShadow_WriteRaster(arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9,arg10,arg11,arg12,arg13,arg14,arg15);
  {
    ZVAL_LONG(return_value,result);
  }
  {
    /* %typemap(freearg) (int nList, int* pList) */
    if (arg12) {
      free((void*) arg12);
    }
  }
  return;
fail:
  {
    /* %typemap(freearg) (int nList, int* pList) */
    if (arg12) {
      free((void*) arg12);
    }
  }
  zend_error_noreturn(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_Dataset_ReadRaster) {
  GDALDatasetShadow *arg1 = (GDALDatasetShadow *) 0 ;
  int arg2 ;
  int arg3 ;
  int arg4 ;
  int arg5 ;
  int *arg6 = (int *) 0 ;
  char **arg7 = (char **) 0 ;
  int *arg8 = (int *) 0 ;
  int *arg9 = (int *) 0 ;
  GDALDataType *arg10 = (GDALDataType *) 0 ;
  int arg11 = (int) 0 ;
  int *arg12 = (int *) 0 ;
  int *arg13 = (int *) 0 ;
  int *arg14 = (int *) 0 ;
  int *arg15 = (int *) 0 ;
  int nLen6 = 0 ;
  char *pBuf6 = 0 ;
  int val8 ;
  int val9 ;
  GDALDataType val10 ;
  int val13 ;
  int val14 ;
  int val15 ;
  zval **args[12];
  int arg_count;
  CPLErr result;
  
  {
    /* %typemap(in,numinputs=0) (int *nLen6, char **pBuf6 ) */
    arg6 = &nLen6;
    arg7 = &pBuf6;
  }
  SWIG_ResetError();
  arg_count = ZEND_NUM_ARGS();
  if(arg_count<5 || arg_count>12 ||
    zend_get_parameters_array_ex(arg_count,args)!=SUCCESS)
  WRONG_PARAM_COUNT;
  
  {
    if(SWIG_ConvertPtr(*args[0], (void **) &arg1, SWIGTYPE_p_GDALDatasetShadow, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of Dataset_ReadRaster. Expected SWIGTYPE_p_GDALDatasetShadow");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  
  /*@SWIG:/usr/share/swig1.3/php/utils.i,7,CONVERT_INT_IN@*/
  convert_to_long_ex(args[1]);
  arg2 = (int) Z_LVAL_PP(args[1]);
  /*@SWIG@*/;
  
  
  /*@SWIG:/usr/share/swig1.3/php/utils.i,7,CONVERT_INT_IN@*/
  convert_to_long_ex(args[2]);
  arg3 = (int) Z_LVAL_PP(args[2]);
  /*@SWIG@*/;
  
  
  /*@SWIG:/usr/share/swig1.3/php/utils.i,7,CONVERT_INT_IN@*/
  convert_to_long_ex(args[3]);
  arg4 = (int) Z_LVAL_PP(args[3]);
  /*@SWIG@*/;
  
  
  /*@SWIG:/usr/share/swig1.3/php/utils.i,7,CONVERT_INT_IN@*/
  convert_to_long_ex(args[4]);
  arg5 = (int) Z_LVAL_PP(args[4]);
  /*@SWIG@*/;
  
  if(arg_count > 5) {
    {
      /* %typemap(in) (int *optional_int) */
      if ( ZVAL_IS_NULL(*args[5]) ) {
        arg8 = 0;
      }
      convert_to_long_ex(args[5]);
      val8 = (int) Z_LVAL_PP( args[5] );
      arg8 = &val8;  
    }
  }
  if(arg_count > 6) {
    {
      /* %typemap(in) (int *optional_int) */
      if ( ZVAL_IS_NULL(*args[6]) ) {
        arg9 = 0;
      }
      convert_to_long_ex(args[6]);
      val9 = (int) Z_LVAL_PP( args[6] );
      arg9 = &val9;  
    }
  }
  if(arg_count > 7) {
    {
      /* %typemap(in) (int *optional_int) */
      if ( ZVAL_IS_NULL(*args[7]) ) {
        arg10 = 0;
      }
      convert_to_long_ex(args[7]);
      val10 = (GDALDataType) Z_LVAL_PP( args[7] );
      arg10 = &val10;  
    }
  }
  if(arg_count > 8) {
    {
      /* %typemap(in,numinputs=1) (int nList, int* pList)*/
      zend_error(E_ERROR,"Typemap (in,numinputs=1) (int nList, int*pList) not properly defined");
      /* check if is List */
      //  if ( !PySequence_Check(args[8]) ) {
      //    PyErr_SetString(PyExc_TypeError, "not a sequence");
      //    SWIG_fail;
      //  }
      //  arg11 = PySequence_Size(args[8]);
      //  arg12 = (int*) malloc(arg11*sizeof(int));
      //  for( int i = 0; i<arg11; i++ ) {
      //    PyObject *o = PySequence_GetItem(args[8],i);
      //    if ( !PyArg_Parse(o,"i",&arg12[i]) ) {
      //      SWIG_fail;
      //    }
      //  }
    }
  }
  if(arg_count > 9) {
    {
      /* %typemap(in) (int *optional_int) */
      if ( ZVAL_IS_NULL(*args[9]) ) {
        arg13 = 0;
      }
      convert_to_long_ex(args[9]);
      val13 = (int) Z_LVAL_PP( args[9] );
      arg13 = &val13;  
    }
  }
  if(arg_count > 10) {
    {
      /* %typemap(in) (int *optional_int) */
      if ( ZVAL_IS_NULL(*args[10]) ) {
        arg14 = 0;
      }
      convert_to_long_ex(args[10]);
      val14 = (int) Z_LVAL_PP( args[10] );
      arg14 = &val14;  
    }
  }
  if(arg_count > 11) {
    {
      /* %typemap(in) (int *optional_int) */
      if ( ZVAL_IS_NULL(*args[11]) ) {
        arg15 = 0;
      }
      convert_to_long_ex(args[11]);
      val15 = (int) Z_LVAL_PP( args[11] );
      arg15 = &val15;  
    }
  }
  result = (CPLErr)GDALDatasetShadow_ReadRaster(arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9,arg10,arg11,arg12,arg13,arg14,arg15);
  {
    ZVAL_LONG(return_value,result);
  }
  {
    /* %typemap(argout) (int *nLen, char **pBuf ) */
    ZVAL_STRINGL( return_value, *arg7, *arg6, 1 );
  }
  {
    /* %typemap(freearg) (int *nLen, char **pBuf ) */
    if( *arg6 ) {
      free( *arg7 );
    }
  }
  {
    /* %typemap(freearg) (int nList, int* pList) */
    if (arg12) {
      free((void*) arg12);
    }
  }
  return;
fail:
  {
    /* %typemap(freearg) (int *nLen, char **pBuf ) */
    if( *arg6 ) {
      free( *arg7 );
    }
  }
  {
    /* %typemap(freearg) (int nList, int* pList) */
    if (arg12) {
      free((void*) arg12);
    }
  }
  zend_error_noreturn(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_Band_XSize_get) {
  GDALRasterBandShadow *arg1 = (GDALRasterBandShadow *) 0 ;
  zval **args[1];
  int result;
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 1 || zend_get_parameters_array_ex(1, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*args[0], (void **) &arg1, SWIGTYPE_p_GDALRasterBandShadow, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of Band_XSize_get. Expected SWIGTYPE_p_GDALRasterBandShadow");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  result = (int)GDALRasterBandShadow_XSize_get(arg1);
  {
    ZVAL_LONG(return_value,result);
  }
  return;
fail:
  zend_error_noreturn(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_Band_YSize_get) {
  GDALRasterBandShadow *arg1 = (GDALRasterBandShadow *) 0 ;
  zval **args[1];
  int result;
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 1 || zend_get_parameters_array_ex(1, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*args[0], (void **) &arg1, SWIGTYPE_p_GDALRasterBandShadow, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of Band_YSize_get. Expected SWIGTYPE_p_GDALRasterBandShadow");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  result = (int)GDALRasterBandShadow_YSize_get(arg1);
  {
    ZVAL_LONG(return_value,result);
  }
  return;
fail:
  zend_error_noreturn(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_Band_DataType_get) {
  GDALRasterBandShadow *arg1 = (GDALRasterBandShadow *) 0 ;
  zval **args[1];
  GDALDataType result;
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 1 || zend_get_parameters_array_ex(1, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*args[0], (void **) &arg1, SWIGTYPE_p_GDALRasterBandShadow, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of Band_DataType_get. Expected SWIGTYPE_p_GDALRasterBandShadow");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  result = (GDALDataType)GDALRasterBandShadow_DataType_get(arg1);
  {
    ZVAL_LONG(return_value,result);
  }
  return;
fail:
  zend_error_noreturn(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_Band_GetBand) {
  GDALRasterBandShadow *arg1 = (GDALRasterBandShadow *) 0 ;
  zval **args[1];
  int result;
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 1 || zend_get_parameters_array_ex(1, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*args[0], (void **) &arg1, SWIGTYPE_p_GDALRasterBandShadow, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of Band_GetBand. Expected SWIGTYPE_p_GDALRasterBandShadow");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  result = (int)GDALRasterBandShadow_GetBand(arg1);
  {
    ZVAL_LONG(return_value,result);
  }
  return;
fail:
  zend_error_noreturn(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_Band_GetBlockSize) {
  GDALRasterBandShadow *arg1 = (GDALRasterBandShadow *) 0 ;
  int *arg2 = (int *) 0 ;
  int *arg3 = (int *) 0 ;
  int temp2 ;
  int temp3 ;
  zval **args[1];
  
  arg2 = &temp2;
  arg3 = &temp3;
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 1 || zend_get_parameters_array_ex(1, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*args[0], (void **) &arg1, SWIGTYPE_p_GDALRasterBandShadow, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of Band_GetBlockSize. Expected SWIGTYPE_p_GDALRasterBandShadow");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  GDALRasterBandShadow_GetBlockSize(arg1,arg2,arg3);
  
  {
    zval *o;
    MAKE_STD_ZVAL(o);
    ZVAL_LONG(o,temp2);
    t_output_helper( &return_value, o );
  }
  {
    zval *o;
    MAKE_STD_ZVAL(o);
    ZVAL_LONG(o,temp3);
    t_output_helper( &return_value, o );
  }
  return;
fail:
  zend_error_noreturn(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_Band_GetColorInterpretation) {
  GDALRasterBandShadow *arg1 = (GDALRasterBandShadow *) 0 ;
  zval **args[1];
  GDALColorInterp result;
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 1 || zend_get_parameters_array_ex(1, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*args[0], (void **) &arg1, SWIGTYPE_p_GDALRasterBandShadow, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of Band_GetColorInterpretation. Expected SWIGTYPE_p_GDALRasterBandShadow");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  result = (GDALColorInterp)GDALRasterBandShadow_GetColorInterpretation(arg1);
  {
    ZVAL_LONG(return_value,result);
  }
  return;
fail:
  zend_error_noreturn(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_Band_GetRasterColorInterpretation) {
  GDALRasterBandShadow *arg1 = (GDALRasterBandShadow *) 0 ;
  zval **args[1];
  GDALColorInterp result;
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 1 || zend_get_parameters_array_ex(1, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*args[0], (void **) &arg1, SWIGTYPE_p_GDALRasterBandShadow, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of Band_GetRasterColorInterpretation. Expected SWIGTYPE_p_GDALRasterBandShadow");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  result = (GDALColorInterp)GDALRasterBandShadow_GetRasterColorInterpretation(arg1);
  {
    ZVAL_LONG(return_value,result);
  }
  return;
fail:
  zend_error_noreturn(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_Band_SetColorInterpretation) {
  GDALRasterBandShadow *arg1 = (GDALRasterBandShadow *) 0 ;
  GDALColorInterp arg2 ;
  zval **args[2];
  CPLErr result;
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 2 || zend_get_parameters_array_ex(2, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*args[0], (void **) &arg1, SWIGTYPE_p_GDALRasterBandShadow, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of Band_SetColorInterpretation. Expected SWIGTYPE_p_GDALRasterBandShadow");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  
  /*@SWIG:/usr/share/swig1.3/php/utils.i,7,CONVERT_INT_IN@*/
  convert_to_long_ex(args[1]);
  arg2 = (GDALColorInterp) Z_LVAL_PP(args[1]);
  /*@SWIG@*/;
  
  result = (CPLErr)GDALRasterBandShadow_SetColorInterpretation(arg1,arg2);
  {
    ZVAL_LONG(return_value,result);
  }
  return;
fail:
  zend_error_noreturn(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_Band_SetRasterColorInterpretation) {
  GDALRasterBandShadow *arg1 = (GDALRasterBandShadow *) 0 ;
  GDALColorInterp arg2 ;
  zval **args[2];
  CPLErr result;
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 2 || zend_get_parameters_array_ex(2, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*args[0], (void **) &arg1, SWIGTYPE_p_GDALRasterBandShadow, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of Band_SetRasterColorInterpretation. Expected SWIGTYPE_p_GDALRasterBandShadow");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  
  /*@SWIG:/usr/share/swig1.3/php/utils.i,7,CONVERT_INT_IN@*/
  convert_to_long_ex(args[1]);
  arg2 = (GDALColorInterp) Z_LVAL_PP(args[1]);
  /*@SWIG@*/;
  
  result = (CPLErr)GDALRasterBandShadow_SetRasterColorInterpretation(arg1,arg2);
  {
    ZVAL_LONG(return_value,result);
  }
  return;
fail:
  zend_error_noreturn(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_Band_GetNoDataValue) {
  GDALRasterBandShadow *arg1 = (GDALRasterBandShadow *) 0 ;
  double *arg2 = (double *) 0 ;
  int *arg3 = (int *) 0 ;
  double tmpval2 ;
  int tmphasval2 ;
  zval **args[1];
  
  {
    /* %typemap(in,numinputs=0) (double *val, int*hasval) */
    arg2 = &tmpval2;
    arg3 = &tmphasval2;
  }
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 1 || zend_get_parameters_array_ex(1, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*args[0], (void **) &arg1, SWIGTYPE_p_GDALRasterBandShadow, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of Band_GetNoDataValue. Expected SWIGTYPE_p_GDALRasterBandShadow");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  GDALRasterBandShadow_GetNoDataValue(arg1,arg2,arg3);
  
  {
    /* %typemap(argout) (double *val, int*hasval) */
    if ( !*arg3 ) {
      RETVAL_NULL();
    }
    else {
      RETVAL_DOUBLE( *arg2 );
    }
  }
  return;
fail:
  zend_error_noreturn(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_Band_SetNoDataValue) {
  GDALRasterBandShadow *arg1 = (GDALRasterBandShadow *) 0 ;
  double arg2 ;
  zval **args[2];
  CPLErr result;
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 2 || zend_get_parameters_array_ex(2, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*args[0], (void **) &arg1, SWIGTYPE_p_GDALRasterBandShadow, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of Band_SetNoDataValue. Expected SWIGTYPE_p_GDALRasterBandShadow");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  
  /*@SWIG:/usr/share/swig1.3/php/utils.i,16,CONVERT_FLOAT_IN@*/
  convert_to_double_ex(args[1]);
  arg2 = (double) Z_DVAL_PP(args[1]);
  /*@SWIG@*/;
  
  result = (CPLErr)GDALRasterBandShadow_SetNoDataValue(arg1,arg2);
  {
    ZVAL_LONG(return_value,result);
  }
  return;
fail:
  zend_error_noreturn(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_Band_GetUnitType) {
  GDALRasterBandShadow *arg1 = (GDALRasterBandShadow *) 0 ;
  zval **args[1];
  char *result = 0 ;
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 1 || zend_get_parameters_array_ex(1, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*args[0], (void **) &arg1, SWIGTYPE_p_GDALRasterBandShadow, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of Band_GetUnitType. Expected SWIGTYPE_p_GDALRasterBandShadow");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  result = (char *)GDALRasterBandShadow_GetUnitType(arg1);
  {
    if(!result) {
      ZVAL_NULL(return_value);
    } else {
      ZVAL_STRING(return_value, (char *)result, 1);
    }
  }
  return;
fail:
  zend_error_noreturn(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_Band_SetUnitType) {
  GDALRasterBandShadow *arg1 = (GDALRasterBandShadow *) 0 ;
  char *arg2 = (char *) 0 ;
  zval **args[2];
  CPLErr result;
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 2 || zend_get_parameters_array_ex(2, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*args[0], (void **) &arg1, SWIGTYPE_p_GDALRasterBandShadow, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of Band_SetUnitType. Expected SWIGTYPE_p_GDALRasterBandShadow");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  
  /*@SWIG:/usr/share/swig1.3/php/utils.i,26,CONVERT_STRING_IN@*/
  if ((*args[1])->type==IS_NULL) {
    arg2 = (char *) 0;
  } else {
    convert_to_string_ex(args[1]);
    arg2 = (char *) Z_STRVAL_PP(args[1]);
  }
  /*@SWIG@*/;
  
  result = (CPLErr)GDALRasterBandShadow_SetUnitType(arg1,(char const *)arg2);
  {
    ZVAL_LONG(return_value,result);
  }
  return;
fail:
  zend_error_noreturn(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_Band_GetRasterCategoryNames) {
  GDALRasterBandShadow *arg1 = (GDALRasterBandShadow *) 0 ;
  zval **args[1];
  char **result = 0 ;
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 1 || zend_get_parameters_array_ex(1, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*args[0], (void **) &arg1, SWIGTYPE_p_GDALRasterBandShadow, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of Band_GetRasterCategoryNames. Expected SWIGTYPE_p_GDALRasterBandShadow");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  result = (char **)GDALRasterBandShadow_GetRasterCategoryNames(arg1);
  {
    /* %typemap(out) char ** -> ( string ) */
    char **stringarray = result;
    if ( stringarray == NULL ) {
      RETVAL_NULL();
    }
    else {
      int len = CSLCount( stringarray );
      array_init(return_value);
      for ( int i = 0; i < len; ++i, ++stringarray ) {
        add_next_index_string( return_value, *stringarray, 1 );
      }
    }
  }
  return;
fail:
  zend_error_noreturn(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_Band_SetRasterCategoryNames) {
  GDALRasterBandShadow *arg1 = (GDALRasterBandShadow *) 0 ;
  char **arg2 = (char **) 0 ;
  zval **args[2];
  CPLErr result;
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 2 || zend_get_parameters_array_ex(2, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*args[0], (void **) &arg1, SWIGTYPE_p_GDALRasterBandShadow, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of Band_SetRasterCategoryNames. Expected SWIGTYPE_p_GDALRasterBandShadow");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    /* %typemap(in) char **options */
    zend_error(E_ERROR,"Typemap (in) char **options not properly defined");
    //  int size = PySequence_Size(args[1]);
    //  for (int i = 0; i < size; i++) {
    //    char *pszItem = NULL;
    //    if ( ! PyArg_Parse( PySequence_GetItem(args[1],i), "s", &pszItem ) ) {
    //      PyErr_SetString(PyExc_TypeError,"sequence must contain strings");
    //      SWIG_fail;
    //    }
    //    arg2 = CSLAddString( arg2, pszItem );
    //  }
  }
  result = (CPLErr)GDALRasterBandShadow_SetRasterCategoryNames(arg1,arg2);
  {
    ZVAL_LONG(return_value,result);
  }
  {
    /* %typemap(freearg) char **options */
    CSLDestroy( arg2 );
  }
  return;
fail:
  {
    /* %typemap(freearg) char **options */
    CSLDestroy( arg2 );
  }
  zend_error_noreturn(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_Band_GetMinimum) {
  GDALRasterBandShadow *arg1 = (GDALRasterBandShadow *) 0 ;
  double *arg2 = (double *) 0 ;
  int *arg3 = (int *) 0 ;
  double tmpval2 ;
  int tmphasval2 ;
  zval **args[1];
  
  {
    /* %typemap(in,numinputs=0) (double *val, int*hasval) */
    arg2 = &tmpval2;
    arg3 = &tmphasval2;
  }
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 1 || zend_get_parameters_array_ex(1, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*args[0], (void **) &arg1, SWIGTYPE_p_GDALRasterBandShadow, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of Band_GetMinimum. Expected SWIGTYPE_p_GDALRasterBandShadow");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  GDALRasterBandShadow_GetMinimum(arg1,arg2,arg3);
  
  {
    /* %typemap(argout) (double *val, int*hasval) */
    if ( !*arg3 ) {
      RETVAL_NULL();
    }
    else {
      RETVAL_DOUBLE( *arg2 );
    }
  }
  return;
fail:
  zend_error_noreturn(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_Band_GetMaximum) {
  GDALRasterBandShadow *arg1 = (GDALRasterBandShadow *) 0 ;
  double *arg2 = (double *) 0 ;
  int *arg3 = (int *) 0 ;
  double tmpval2 ;
  int tmphasval2 ;
  zval **args[1];
  
  {
    /* %typemap(in,numinputs=0) (double *val, int*hasval) */
    arg2 = &tmpval2;
    arg3 = &tmphasval2;
  }
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 1 || zend_get_parameters_array_ex(1, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*args[0], (void **) &arg1, SWIGTYPE_p_GDALRasterBandShadow, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of Band_GetMaximum. Expected SWIGTYPE_p_GDALRasterBandShadow");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  GDALRasterBandShadow_GetMaximum(arg1,arg2,arg3);
  
  {
    /* %typemap(argout) (double *val, int*hasval) */
    if ( !*arg3 ) {
      RETVAL_NULL();
    }
    else {
      RETVAL_DOUBLE( *arg2 );
    }
  }
  return;
fail:
  zend_error_noreturn(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_Band_GetOffset) {
  GDALRasterBandShadow *arg1 = (GDALRasterBandShadow *) 0 ;
  double *arg2 = (double *) 0 ;
  int *arg3 = (int *) 0 ;
  double tmpval2 ;
  int tmphasval2 ;
  zval **args[1];
  
  {
    /* %typemap(in,numinputs=0) (double *val, int*hasval) */
    arg2 = &tmpval2;
    arg3 = &tmphasval2;
  }
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 1 || zend_get_parameters_array_ex(1, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*args[0], (void **) &arg1, SWIGTYPE_p_GDALRasterBandShadow, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of Band_GetOffset. Expected SWIGTYPE_p_GDALRasterBandShadow");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  GDALRasterBandShadow_GetOffset(arg1,arg2,arg3);
  
  {
    /* %typemap(argout) (double *val, int*hasval) */
    if ( !*arg3 ) {
      RETVAL_NULL();
    }
    else {
      RETVAL_DOUBLE( *arg2 );
    }
  }
  return;
fail:
  zend_error_noreturn(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_Band_GetScale) {
  GDALRasterBandShadow *arg1 = (GDALRasterBandShadow *) 0 ;
  double *arg2 = (double *) 0 ;
  int *arg3 = (int *) 0 ;
  double tmpval2 ;
  int tmphasval2 ;
  zval **args[1];
  
  {
    /* %typemap(in,numinputs=0) (double *val, int*hasval) */
    arg2 = &tmpval2;
    arg3 = &tmphasval2;
  }
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 1 || zend_get_parameters_array_ex(1, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*args[0], (void **) &arg1, SWIGTYPE_p_GDALRasterBandShadow, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of Band_GetScale. Expected SWIGTYPE_p_GDALRasterBandShadow");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  GDALRasterBandShadow_GetScale(arg1,arg2,arg3);
  
  {
    /* %typemap(argout) (double *val, int*hasval) */
    if ( !*arg3 ) {
      RETVAL_NULL();
    }
    else {
      RETVAL_DOUBLE( *arg2 );
    }
  }
  return;
fail:
  zend_error_noreturn(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_Band_SetOffset) {
  GDALRasterBandShadow *arg1 = (GDALRasterBandShadow *) 0 ;
  double arg2 ;
  zval **args[2];
  CPLErr result;
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 2 || zend_get_parameters_array_ex(2, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*args[0], (void **) &arg1, SWIGTYPE_p_GDALRasterBandShadow, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of Band_SetOffset. Expected SWIGTYPE_p_GDALRasterBandShadow");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  
  /*@SWIG:/usr/share/swig1.3/php/utils.i,16,CONVERT_FLOAT_IN@*/
  convert_to_double_ex(args[1]);
  arg2 = (double) Z_DVAL_PP(args[1]);
  /*@SWIG@*/;
  
  result = (CPLErr)GDALRasterBandShadow_SetOffset(arg1,arg2);
  {
    ZVAL_LONG(return_value,result);
  }
  return;
fail:
  zend_error_noreturn(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_Band_SetScale) {
  GDALRasterBandShadow *arg1 = (GDALRasterBandShadow *) 0 ;
  double arg2 ;
  zval **args[2];
  CPLErr result;
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 2 || zend_get_parameters_array_ex(2, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*args[0], (void **) &arg1, SWIGTYPE_p_GDALRasterBandShadow, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of Band_SetScale. Expected SWIGTYPE_p_GDALRasterBandShadow");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  
  /*@SWIG:/usr/share/swig1.3/php/utils.i,16,CONVERT_FLOAT_IN@*/
  convert_to_double_ex(args[1]);
  arg2 = (double) Z_DVAL_PP(args[1]);
  /*@SWIG@*/;
  
  result = (CPLErr)GDALRasterBandShadow_SetScale(arg1,arg2);
  {
    ZVAL_LONG(return_value,result);
  }
  return;
fail:
  zend_error_noreturn(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_Band_GetStatistics) {
  GDALRasterBandShadow *arg1 = (GDALRasterBandShadow *) 0 ;
  int arg2 ;
  int arg3 ;
  double *arg4 = (double *) 0 ;
  double *arg5 = (double *) 0 ;
  double *arg6 = (double *) 0 ;
  double *arg7 = (double *) 0 ;
  double temp4 ;
  double temp5 ;
  double temp6 ;
  double temp7 ;
  zval **args[3];
  CPLErr result;
  
  arg4 = &temp4;
  arg5 = &temp5;
  arg6 = &temp6;
  arg7 = &temp7;
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 3 || zend_get_parameters_array_ex(3, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*args[0], (void **) &arg1, SWIGTYPE_p_GDALRasterBandShadow, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of Band_GetStatistics. Expected SWIGTYPE_p_GDALRasterBandShadow");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  
  /*@SWIG:/usr/share/swig1.3/php/utils.i,7,CONVERT_INT_IN@*/
  convert_to_long_ex(args[1]);
  arg2 = (int) Z_LVAL_PP(args[1]);
  /*@SWIG@*/;
  
  
  /*@SWIG:/usr/share/swig1.3/php/utils.i,7,CONVERT_INT_IN@*/
  convert_to_long_ex(args[2]);
  arg3 = (int) Z_LVAL_PP(args[2]);
  /*@SWIG@*/;
  
  result = (CPLErr)GDALRasterBandShadow_GetStatistics(arg1,arg2,arg3,arg4,arg5,arg6,arg7);
  {
    ZVAL_LONG(return_value,result);
  }
  {
    zval *o;
    MAKE_STD_ZVAL(o);
    ZVAL_DOUBLE(o,temp4);
    t_output_helper( &return_value, o );
  }
  {
    zval *o;
    MAKE_STD_ZVAL(o);
    ZVAL_DOUBLE(o,temp5);
    t_output_helper( &return_value, o );
  }
  {
    zval *o;
    MAKE_STD_ZVAL(o);
    ZVAL_DOUBLE(o,temp6);
    t_output_helper( &return_value, o );
  }
  {
    zval *o;
    MAKE_STD_ZVAL(o);
    ZVAL_DOUBLE(o,temp7);
    t_output_helper( &return_value, o );
  }
  return;
fail:
  zend_error_noreturn(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_Band_ComputeStatistics) {
  GDALRasterBandShadow *arg1 = (GDALRasterBandShadow *) 0 ;
  bool arg2 ;
  double *arg3 = (double *) NULL ;
  double *arg4 = (double *) NULL ;
  double *arg5 = (double *) NULL ;
  double *arg6 = (double *) NULL ;
  GDALProgressFunc arg7 = (GDALProgressFunc) NULL ;
  void *arg8 = (void *) NULL ;
  double temp3 ;
  double temp4 ;
  double temp5 ;
  double temp6 ;
  GDALProgressFunc *tmp7 ;
  zval **args[4];
  int arg_count;
  CPLErr result;
  
  arg3 = &temp3;
  arg4 = &temp4;
  arg5 = &temp5;
  arg6 = &temp6;
  SWIG_ResetError();
  arg_count = ZEND_NUM_ARGS();
  if(arg_count<2 || arg_count>4 ||
    zend_get_parameters_array_ex(arg_count,args)!=SUCCESS)
  WRONG_PARAM_COUNT;
  
  {
    if(SWIG_ConvertPtr(*args[0], (void **) &arg1, SWIGTYPE_p_GDALRasterBandShadow, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of Band_ComputeStatistics. Expected SWIGTYPE_p_GDALRasterBandShadow");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  
  /*@SWIG:/usr/share/swig1.3/php/utils.i,2,CONVERT_BOOL_IN@*/
  convert_to_boolean_ex(args[1]);
  arg2 = (bool) Z_LVAL_PP(args[1]);
  /*@SWIG@*/;
  
  if(arg_count > 2) {
    {
      if(SWIG_ConvertPtr(*args[2], (void **) &tmp7, SWIGTYPE_p_GDALProgressFunc, 0) < 0 || tmp7 == NULL) {
        SWIG_PHP_Error(E_ERROR, "Type error in argument 7 of Band_ComputeStatistics. Expected SWIGTYPE_p_GDALProgressFunc");
      }
      arg7 = *tmp7;
    }
  }
  if(arg_count > 3) {
    {
      if(SWIG_ConvertPtr(*args[3], (void **) &arg8, 0, 0) < 0) {
        /* Allow NULL from php for void* */
        if ((*args[3])->type==IS_NULL) arg8=0;
        else
        SWIG_PHP_Error(E_ERROR, "Type error in argument 8 of Band_ComputeStatistics. Expected SWIGTYPE_p_p_void");
      }
    }
  }
  result = (CPLErr)GDALRasterBandShadow_ComputeStatistics(arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8);
  {
    ZVAL_LONG(return_value,result);
  }
  {
    zval *o;
    MAKE_STD_ZVAL(o);
    ZVAL_DOUBLE(o,temp3);
    t_output_helper( &return_value, o );
  }
  {
    zval *o;
    MAKE_STD_ZVAL(o);
    ZVAL_DOUBLE(o,temp4);
    t_output_helper( &return_value, o );
  }
  {
    zval *o;
    MAKE_STD_ZVAL(o);
    ZVAL_DOUBLE(o,temp5);
    t_output_helper( &return_value, o );
  }
  {
    zval *o;
    MAKE_STD_ZVAL(o);
    ZVAL_DOUBLE(o,temp6);
    t_output_helper( &return_value, o );
  }
  return;
fail:
  zend_error_noreturn(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_Band_SetStatistics) {
  GDALRasterBandShadow *arg1 = (GDALRasterBandShadow *) 0 ;
  double arg2 ;
  double arg3 ;
  double arg4 ;
  double arg5 ;
  zval **args[5];
  CPLErr result;
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 5 || zend_get_parameters_array_ex(5, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*args[0], (void **) &arg1, SWIGTYPE_p_GDALRasterBandShadow, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of Band_SetStatistics. Expected SWIGTYPE_p_GDALRasterBandShadow");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  
  /*@SWIG:/usr/share/swig1.3/php/utils.i,16,CONVERT_FLOAT_IN@*/
  convert_to_double_ex(args[1]);
  arg2 = (double) Z_DVAL_PP(args[1]);
  /*@SWIG@*/;
  
  
  /*@SWIG:/usr/share/swig1.3/php/utils.i,16,CONVERT_FLOAT_IN@*/
  convert_to_double_ex(args[2]);
  arg3 = (double) Z_DVAL_PP(args[2]);
  /*@SWIG@*/;
  
  
  /*@SWIG:/usr/share/swig1.3/php/utils.i,16,CONVERT_FLOAT_IN@*/
  convert_to_double_ex(args[3]);
  arg4 = (double) Z_DVAL_PP(args[3]);
  /*@SWIG@*/;
  
  
  /*@SWIG:/usr/share/swig1.3/php/utils.i,16,CONVERT_FLOAT_IN@*/
  convert_to_double_ex(args[4]);
  arg5 = (double) Z_DVAL_PP(args[4]);
  /*@SWIG@*/;
  
  result = (CPLErr)GDALRasterBandShadow_SetStatistics(arg1,arg2,arg3,arg4,arg5);
  {
    ZVAL_LONG(return_value,result);
  }
  return;
fail:
  zend_error_noreturn(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_Band_GetOverviewCount) {
  GDALRasterBandShadow *arg1 = (GDALRasterBandShadow *) 0 ;
  zval **args[1];
  int result;
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 1 || zend_get_parameters_array_ex(1, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*args[0], (void **) &arg1, SWIGTYPE_p_GDALRasterBandShadow, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of Band_GetOverviewCount. Expected SWIGTYPE_p_GDALRasterBandShadow");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  result = (int)GDALRasterBandShadow_GetOverviewCount(arg1);
  {
    ZVAL_LONG(return_value,result);
  }
  return;
fail:
  zend_error_noreturn(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_Band_GetOverview) {
  GDALRasterBandShadow *arg1 = (GDALRasterBandShadow *) 0 ;
  int arg2 ;
  zval **args[2];
  GDALRasterBandShadow *result = 0 ;
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 2 || zend_get_parameters_array_ex(2, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*args[0], (void **) &arg1, SWIGTYPE_p_GDALRasterBandShadow, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of Band_GetOverview. Expected SWIGTYPE_p_GDALRasterBandShadow");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  
  /*@SWIG:/usr/share/swig1.3/php/utils.i,7,CONVERT_INT_IN@*/
  convert_to_long_ex(args[1]);
  arg2 = (int) Z_LVAL_PP(args[1]);
  /*@SWIG@*/;
  
  result = (GDALRasterBandShadow *)GDALRasterBandShadow_GetOverview(arg1,arg2);
  
  SWIG_SetPointerZval(return_value, (void *)result, SWIGTYPE_p_GDALRasterBandShadow, 0);
  
  return;
fail:
  zend_error_noreturn(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_Band_Checksum) {
  GDALRasterBandShadow *arg1 = (GDALRasterBandShadow *) 0 ;
  int arg2 = (int) 0 ;
  int arg3 = (int) 0 ;
  int *arg4 = (int *) 0 ;
  int *arg5 = (int *) 0 ;
  int val4 ;
  int val5 ;
  zval **args[5];
  int arg_count;
  int result;
  
  SWIG_ResetError();
  arg_count = ZEND_NUM_ARGS();
  if(arg_count<1 || arg_count>5 ||
    zend_get_parameters_array_ex(arg_count,args)!=SUCCESS)
  WRONG_PARAM_COUNT;
  
  {
    if(SWIG_ConvertPtr(*args[0], (void **) &arg1, SWIGTYPE_p_GDALRasterBandShadow, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of Band_Checksum. Expected SWIGTYPE_p_GDALRasterBandShadow");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  if(arg_count > 1) {
    /*@SWIG:/usr/share/swig1.3/php/utils.i,7,CONVERT_INT_IN@*/
    convert_to_long_ex(args[1]);
    arg2 = (int) Z_LVAL_PP(args[1]);
    /*@SWIG@*/;
    
  }
  if(arg_count > 2) {
    /*@SWIG:/usr/share/swig1.3/php/utils.i,7,CONVERT_INT_IN@*/
    convert_to_long_ex(args[2]);
    arg3 = (int) Z_LVAL_PP(args[2]);
    /*@SWIG@*/;
    
  }
  if(arg_count > 3) {
    {
      /* %typemap(in) (int *optional_int) */
      if ( ZVAL_IS_NULL(*args[3]) ) {
        arg4 = 0;
      }
      convert_to_long_ex(args[3]);
      val4 = (int) Z_LVAL_PP( args[3] );
      arg4 = &val4;  
    }
  }
  if(arg_count > 4) {
    {
      /* %typemap(in) (int *optional_int) */
      if ( ZVAL_IS_NULL(*args[4]) ) {
        arg5 = 0;
      }
      convert_to_long_ex(args[4]);
      val5 = (int) Z_LVAL_PP( args[4] );
      arg5 = &val5;  
    }
  }
  result = (int)GDALRasterBandShadow_Checksum(arg1,arg2,arg3,arg4,arg5);
  {
    ZVAL_LONG(return_value,result);
  }
  return;
fail:
  zend_error_noreturn(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_Band_ComputeRasterMinMax) {
  GDALRasterBandShadow *arg1 = (GDALRasterBandShadow *) 0 ;
  double *arg2 ;
  int arg3 = (int) 0 ;
  double argout2[2] ;
  zval **args[2];
  int arg_count;
  
  {
    /* %typemap(in,numinputs=0) (double argout2[ANY]) */
    arg2 = argout2;
  }
  SWIG_ResetError();
  arg_count = ZEND_NUM_ARGS();
  if(arg_count<1 || arg_count>2 ||
    zend_get_parameters_array_ex(arg_count,args)!=SUCCESS)
  WRONG_PARAM_COUNT;
  
  {
    if(SWIG_ConvertPtr(*args[0], (void **) &arg1, SWIGTYPE_p_GDALRasterBandShadow, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of Band_ComputeRasterMinMax. Expected SWIGTYPE_p_GDALRasterBandShadow");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  if(arg_count > 1) {
    /*@SWIG:/usr/share/swig1.3/php/utils.i,7,CONVERT_INT_IN@*/
    convert_to_long_ex(args[1]);
    arg3 = (int) Z_LVAL_PP(args[1]);
    /*@SWIG@*/;
    
  }
  GDALRasterBandShadow_ComputeRasterMinMax(arg1,arg2,arg3);
  
  {
    /* %typemap(argout) (double argout[ANY]) */
    zval *t = CreateTupleFromDoubleArray( arg2, 2 );
    t_output_helper( &return_value, t );
  }
  return;
fail:
  zend_error_noreturn(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_Band_ComputeBandStats) {
  GDALRasterBandShadow *arg1 = (GDALRasterBandShadow *) 0 ;
  double *arg2 ;
  int arg3 = (int) 1 ;
  double argout2[2] ;
  zval **args[2];
  int arg_count;
  
  {
    /* %typemap(in,numinputs=0) (double argout2[ANY]) */
    arg2 = argout2;
  }
  SWIG_ResetError();
  arg_count = ZEND_NUM_ARGS();
  if(arg_count<1 || arg_count>2 ||
    zend_get_parameters_array_ex(arg_count,args)!=SUCCESS)
  WRONG_PARAM_COUNT;
  
  {
    if(SWIG_ConvertPtr(*args[0], (void **) &arg1, SWIGTYPE_p_GDALRasterBandShadow, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of Band_ComputeBandStats. Expected SWIGTYPE_p_GDALRasterBandShadow");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  if(arg_count > 1) {
    /*@SWIG:/usr/share/swig1.3/php/utils.i,7,CONVERT_INT_IN@*/
    convert_to_long_ex(args[1]);
    arg3 = (int) Z_LVAL_PP(args[1]);
    /*@SWIG@*/;
    
  }
  GDALRasterBandShadow_ComputeBandStats(arg1,arg2,arg3);
  
  {
    /* %typemap(argout) (double argout[ANY]) */
    zval *t = CreateTupleFromDoubleArray( arg2, 2 );
    t_output_helper( &return_value, t );
  }
  return;
fail:
  zend_error_noreturn(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_Band_Fill) {
  GDALRasterBandShadow *arg1 = (GDALRasterBandShadow *) 0 ;
  double arg2 ;
  double arg3 = (double) 0.0 ;
  zval **args[3];
  int arg_count;
  CPLErr result;
  
  SWIG_ResetError();
  arg_count = ZEND_NUM_ARGS();
  if(arg_count<2 || arg_count>3 ||
    zend_get_parameters_array_ex(arg_count,args)!=SUCCESS)
  WRONG_PARAM_COUNT;
  
  {
    if(SWIG_ConvertPtr(*args[0], (void **) &arg1, SWIGTYPE_p_GDALRasterBandShadow, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of Band_Fill. Expected SWIGTYPE_p_GDALRasterBandShadow");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  
  /*@SWIG:/usr/share/swig1.3/php/utils.i,16,CONVERT_FLOAT_IN@*/
  convert_to_double_ex(args[1]);
  arg2 = (double) Z_DVAL_PP(args[1]);
  /*@SWIG@*/;
  
  if(arg_count > 2) {
    /*@SWIG:/usr/share/swig1.3/php/utils.i,16,CONVERT_FLOAT_IN@*/
    convert_to_double_ex(args[2]);
    arg3 = (double) Z_DVAL_PP(args[2]);
    /*@SWIG@*/;
    
  }
  result = (CPLErr)GDALRasterBandShadow_Fill(arg1,arg2,arg3);
  {
    ZVAL_LONG(return_value,result);
  }
  return;
fail:
  zend_error_noreturn(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_Band_ReadRaster) {
  GDALRasterBandShadow *arg1 = (GDALRasterBandShadow *) 0 ;
  int arg2 ;
  int arg3 ;
  int arg4 ;
  int arg5 ;
  int *arg6 = (int *) 0 ;
  char **arg7 = (char **) 0 ;
  int *arg8 = (int *) 0 ;
  int *arg9 = (int *) 0 ;
  int *arg10 = (int *) 0 ;
  int *arg11 = (int *) 0 ;
  int *arg12 = (int *) 0 ;
  int nLen6 = 0 ;
  char *pBuf6 = 0 ;
  int val8 ;
  int val9 ;
  int val10 ;
  int val11 ;
  int val12 ;
  zval **args[10];
  int arg_count;
  CPLErr result;
  
  {
    /* %typemap(in,numinputs=0) (int *nLen6, char **pBuf6 ) */
    arg6 = &nLen6;
    arg7 = &pBuf6;
  }
  SWIG_ResetError();
  arg_count = ZEND_NUM_ARGS();
  if(arg_count<5 || arg_count>10 ||
    zend_get_parameters_array_ex(arg_count,args)!=SUCCESS)
  WRONG_PARAM_COUNT;
  
  {
    if(SWIG_ConvertPtr(*args[0], (void **) &arg1, SWIGTYPE_p_GDALRasterBandShadow, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of Band_ReadRaster. Expected SWIGTYPE_p_GDALRasterBandShadow");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  
  /*@SWIG:/usr/share/swig1.3/php/utils.i,7,CONVERT_INT_IN@*/
  convert_to_long_ex(args[1]);
  arg2 = (int) Z_LVAL_PP(args[1]);
  /*@SWIG@*/;
  
  
  /*@SWIG:/usr/share/swig1.3/php/utils.i,7,CONVERT_INT_IN@*/
  convert_to_long_ex(args[2]);
  arg3 = (int) Z_LVAL_PP(args[2]);
  /*@SWIG@*/;
  
  
  /*@SWIG:/usr/share/swig1.3/php/utils.i,7,CONVERT_INT_IN@*/
  convert_to_long_ex(args[3]);
  arg4 = (int) Z_LVAL_PP(args[3]);
  /*@SWIG@*/;
  
  
  /*@SWIG:/usr/share/swig1.3/php/utils.i,7,CONVERT_INT_IN@*/
  convert_to_long_ex(args[4]);
  arg5 = (int) Z_LVAL_PP(args[4]);
  /*@SWIG@*/;
  
  if(arg_count > 5) {
    {
      /* %typemap(in) (int *optional_int) */
      if ( ZVAL_IS_NULL(*args[5]) ) {
        arg8 = 0;
      }
      convert_to_long_ex(args[5]);
      val8 = (int) Z_LVAL_PP( args[5] );
      arg8 = &val8;  
    }
  }
  if(arg_count > 6) {
    {
      /* %typemap(in) (int *optional_int) */
      if ( ZVAL_IS_NULL(*args[6]) ) {
        arg9 = 0;
      }
      convert_to_long_ex(args[6]);
      val9 = (int) Z_LVAL_PP( args[6] );
      arg9 = &val9;  
    }
  }
  if(arg_count > 7) {
    {
      /* %typemap(in) (int *optional_int) */
      if ( ZVAL_IS_NULL(*args[7]) ) {
        arg10 = 0;
      }
      convert_to_long_ex(args[7]);
      val10 = (int) Z_LVAL_PP( args[7] );
      arg10 = &val10;  
    }
  }
  if(arg_count > 8) {
    {
      /* %typemap(in) (int *optional_int) */
      if ( ZVAL_IS_NULL(*args[8]) ) {
        arg11 = 0;
      }
      convert_to_long_ex(args[8]);
      val11 = (int) Z_LVAL_PP( args[8] );
      arg11 = &val11;  
    }
  }
  if(arg_count > 9) {
    {
      /* %typemap(in) (int *optional_int) */
      if ( ZVAL_IS_NULL(*args[9]) ) {
        arg12 = 0;
      }
      convert_to_long_ex(args[9]);
      val12 = (int) Z_LVAL_PP( args[9] );
      arg12 = &val12;  
    }
  }
  result = (CPLErr)GDALRasterBandShadow_ReadRaster(arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9,arg10,arg11,arg12);
  {
    ZVAL_LONG(return_value,result);
  }
  {
    /* %typemap(argout) (int *nLen, char **pBuf ) */
    ZVAL_STRINGL( return_value, *arg7, *arg6, 1 );
  }
  {
    /* %typemap(freearg) (int *nLen, char **pBuf ) */
    if( *arg6 ) {
      free( *arg7 );
    }
  }
  return;
fail:
  {
    /* %typemap(freearg) (int *nLen, char **pBuf ) */
    if( *arg6 ) {
      free( *arg7 );
    }
  }
  zend_error_noreturn(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_Band_WriteRaster) {
  GDALRasterBandShadow *arg1 = (GDALRasterBandShadow *) 0 ;
  int arg2 ;
  int arg3 ;
  int arg4 ;
  int arg5 ;
  int arg6 ;
  char *arg7 = (char *) 0 ;
  int *arg8 = (int *) 0 ;
  int *arg9 = (int *) 0 ;
  int *arg10 = (int *) 0 ;
  int *arg11 = (int *) 0 ;
  int *arg12 = (int *) 0 ;
  int val8 ;
  int val9 ;
  int val10 ;
  int val11 ;
  int val12 ;
  zval **args[11];
  int arg_count;
  CPLErr result;
  
  SWIG_ResetError();
  arg_count = ZEND_NUM_ARGS();
  if(arg_count<6 || arg_count>11 ||
    zend_get_parameters_array_ex(arg_count,args)!=SUCCESS)
  WRONG_PARAM_COUNT;
  
  {
    if(SWIG_ConvertPtr(*args[0], (void **) &arg1, SWIGTYPE_p_GDALRasterBandShadow, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of Band_WriteRaster. Expected SWIGTYPE_p_GDALRasterBandShadow");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  
  /*@SWIG:/usr/share/swig1.3/php/utils.i,7,CONVERT_INT_IN@*/
  convert_to_long_ex(args[1]);
  arg2 = (int) Z_LVAL_PP(args[1]);
  /*@SWIG@*/;
  
  
  /*@SWIG:/usr/share/swig1.3/php/utils.i,7,CONVERT_INT_IN@*/
  convert_to_long_ex(args[2]);
  arg3 = (int) Z_LVAL_PP(args[2]);
  /*@SWIG@*/;
  
  
  /*@SWIG:/usr/share/swig1.3/php/utils.i,7,CONVERT_INT_IN@*/
  convert_to_long_ex(args[3]);
  arg4 = (int) Z_LVAL_PP(args[3]);
  /*@SWIG@*/;
  
  
  /*@SWIG:/usr/share/swig1.3/php/utils.i,7,CONVERT_INT_IN@*/
  convert_to_long_ex(args[4]);
  arg5 = (int) Z_LVAL_PP(args[4]);
  /*@SWIG@*/;
  
  {
    /* %typemap(in,numinputs=1) (int nLen, char *pBuf ) */
    convert_to_string_ex(args[5]);
    arg7 = Z_STRVAL_PP(args[5]);
    arg6 = Z_STRLEN_PP(args[5]);
  }
  if(arg_count > 6) {
    {
      /* %typemap(in) (int *optional_int) */
      if ( ZVAL_IS_NULL(*args[6]) ) {
        arg8 = 0;
      }
      convert_to_long_ex(args[6]);
      val8 = (int) Z_LVAL_PP( args[6] );
      arg8 = &val8;  
    }
  }
  if(arg_count > 7) {
    {
      /* %typemap(in) (int *optional_int) */
      if ( ZVAL_IS_NULL(*args[7]) ) {
        arg9 = 0;
      }
      convert_to_long_ex(args[7]);
      val9 = (int) Z_LVAL_PP( args[7] );
      arg9 = &val9;  
    }
  }
  if(arg_count > 8) {
    {
      /* %typemap(in) (int *optional_int) */
      if ( ZVAL_IS_NULL(*args[8]) ) {
        arg10 = 0;
      }
      convert_to_long_ex(args[8]);
      val10 = (int) Z_LVAL_PP( args[8] );
      arg10 = &val10;  
    }
  }
  if(arg_count > 9) {
    {
      /* %typemap(in) (int *optional_int) */
      if ( ZVAL_IS_NULL(*args[9]) ) {
        arg11 = 0;
      }
      convert_to_long_ex(args[9]);
      val11 = (int) Z_LVAL_PP( args[9] );
      arg11 = &val11;  
    }
  }
  if(arg_count > 10) {
    {
      /* %typemap(in) (int *optional_int) */
      if ( ZVAL_IS_NULL(*args[10]) ) {
        arg12 = 0;
      }
      convert_to_long_ex(args[10]);
      val12 = (int) Z_LVAL_PP( args[10] );
      arg12 = &val12;  
    }
  }
  result = (CPLErr)GDALRasterBandShadow_WriteRaster(arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9,arg10,arg11,arg12);
  {
    ZVAL_LONG(return_value,result);
  }
  return;
fail:
  zend_error_noreturn(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_Band_FlushCache) {
  GDALRasterBandShadow *arg1 = (GDALRasterBandShadow *) 0 ;
  zval **args[1];
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 1 || zend_get_parameters_array_ex(1, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*args[0], (void **) &arg1, SWIGTYPE_p_GDALRasterBandShadow, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of Band_FlushCache. Expected SWIGTYPE_p_GDALRasterBandShadow");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  GDALRasterBandShadow_FlushCache(arg1);
  
  return;
fail:
  zend_error_noreturn(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_Band_GetRasterColorTable) {
  GDALRasterBandShadow *arg1 = (GDALRasterBandShadow *) 0 ;
  zval **args[1];
  GDALColorTableShadow *result = 0 ;
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 1 || zend_get_parameters_array_ex(1, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*args[0], (void **) &arg1, SWIGTYPE_p_GDALRasterBandShadow, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of Band_GetRasterColorTable. Expected SWIGTYPE_p_GDALRasterBandShadow");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  result = (GDALColorTableShadow *)GDALRasterBandShadow_GetRasterColorTable(arg1);
  
  SWIG_SetPointerZval(return_value, (void *)result, SWIGTYPE_p_GDALColorTableShadow, 0);
  
  return;
fail:
  zend_error_noreturn(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_Band_GetColorTable) {
  GDALRasterBandShadow *arg1 = (GDALRasterBandShadow *) 0 ;
  zval **args[1];
  GDALColorTableShadow *result = 0 ;
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 1 || zend_get_parameters_array_ex(1, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*args[0], (void **) &arg1, SWIGTYPE_p_GDALRasterBandShadow, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of Band_GetColorTable. Expected SWIGTYPE_p_GDALRasterBandShadow");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  result = (GDALColorTableShadow *)GDALRasterBandShadow_GetColorTable(arg1);
  
  SWIG_SetPointerZval(return_value, (void *)result, SWIGTYPE_p_GDALColorTableShadow, 0);
  
  return;
fail:
  zend_error_noreturn(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_Band_SetRasterColorTable) {
  GDALRasterBandShadow *arg1 = (GDALRasterBandShadow *) 0 ;
  GDALColorTableShadow *arg2 = (GDALColorTableShadow *) 0 ;
  zval **args[2];
  int result;
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 2 || zend_get_parameters_array_ex(2, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*args[0], (void **) &arg1, SWIGTYPE_p_GDALRasterBandShadow, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of Band_SetRasterColorTable. Expected SWIGTYPE_p_GDALRasterBandShadow");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    if(SWIG_ConvertPtr(*args[1], (void **) &arg2, SWIGTYPE_p_GDALColorTableShadow, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 2 of Band_SetRasterColorTable. Expected SWIGTYPE_p_GDALColorTableShadow");
    }
  }
  result = (int)GDALRasterBandShadow_SetRasterColorTable(arg1,arg2);
  {
    ZVAL_LONG(return_value,result);
  }
  return;
fail:
  zend_error_noreturn(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_Band_SetColorTable) {
  GDALRasterBandShadow *arg1 = (GDALRasterBandShadow *) 0 ;
  GDALColorTableShadow *arg2 = (GDALColorTableShadow *) 0 ;
  zval **args[2];
  int result;
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 2 || zend_get_parameters_array_ex(2, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*args[0], (void **) &arg1, SWIGTYPE_p_GDALRasterBandShadow, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of Band_SetColorTable. Expected SWIGTYPE_p_GDALRasterBandShadow");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    if(SWIG_ConvertPtr(*args[1], (void **) &arg2, SWIGTYPE_p_GDALColorTableShadow, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 2 of Band_SetColorTable. Expected SWIGTYPE_p_GDALColorTableShadow");
    }
  }
  result = (int)GDALRasterBandShadow_SetColorTable(arg1,arg2);
  {
    ZVAL_LONG(return_value,result);
  }
  return;
fail:
  zend_error_noreturn(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_Band_GetDefaultRAT) {
  GDALRasterBandShadow *arg1 = (GDALRasterBandShadow *) 0 ;
  zval **args[1];
  GDALRasterAttributeTableShadow *result = 0 ;
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 1 || zend_get_parameters_array_ex(1, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*args[0], (void **) &arg1, SWIGTYPE_p_GDALRasterBandShadow, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of Band_GetDefaultRAT. Expected SWIGTYPE_p_GDALRasterBandShadow");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  result = (GDALRasterAttributeTableShadow *)GDALRasterBandShadow_GetDefaultRAT(arg1);
  
  SWIG_SetPointerZval(return_value, (void *)result, SWIGTYPE_p_GDALRasterAttributeTableShadow, 0);
  
  return;
fail:
  zend_error_noreturn(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_Band_SetDefaultRAT) {
  GDALRasterBandShadow *arg1 = (GDALRasterBandShadow *) 0 ;
  GDALRasterAttributeTableShadow *arg2 = (GDALRasterAttributeTableShadow *) 0 ;
  zval **args[2];
  int result;
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 2 || zend_get_parameters_array_ex(2, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*args[0], (void **) &arg1, SWIGTYPE_p_GDALRasterBandShadow, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of Band_SetDefaultRAT. Expected SWIGTYPE_p_GDALRasterBandShadow");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    if(SWIG_ConvertPtr(*args[1], (void **) &arg2, SWIGTYPE_p_GDALRasterAttributeTableShadow, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 2 of Band_SetDefaultRAT. Expected SWIGTYPE_p_GDALRasterAttributeTableShadow");
    }
  }
  result = (int)GDALRasterBandShadow_SetDefaultRAT(arg1,arg2);
  {
    ZVAL_LONG(return_value,result);
  }
  return;
fail:
  zend_error_noreturn(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_Band_GetMaskBand) {
  GDALRasterBandShadow *arg1 = (GDALRasterBandShadow *) 0 ;
  zval **args[1];
  GDALRasterBandShadow *result = 0 ;
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 1 || zend_get_parameters_array_ex(1, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*args[0], (void **) &arg1, SWIGTYPE_p_GDALRasterBandShadow, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of Band_GetMaskBand. Expected SWIGTYPE_p_GDALRasterBandShadow");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  result = (GDALRasterBandShadow *)GDALRasterBandShadow_GetMaskBand(arg1);
  
  SWIG_SetPointerZval(return_value, (void *)result, SWIGTYPE_p_GDALRasterBandShadow, 0);
  
  return;
fail:
  zend_error_noreturn(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_Band_GetMaskFlags) {
  GDALRasterBandShadow *arg1 = (GDALRasterBandShadow *) 0 ;
  zval **args[1];
  int result;
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 1 || zend_get_parameters_array_ex(1, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*args[0], (void **) &arg1, SWIGTYPE_p_GDALRasterBandShadow, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of Band_GetMaskFlags. Expected SWIGTYPE_p_GDALRasterBandShadow");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  result = (int)GDALRasterBandShadow_GetMaskFlags(arg1);
  {
    ZVAL_LONG(return_value,result);
  }
  return;
fail:
  zend_error_noreturn(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_Band_CreateMaskBand) {
  GDALRasterBandShadow *arg1 = (GDALRasterBandShadow *) 0 ;
  int arg2 ;
  zval **args[2];
  CPLErr result;
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 2 || zend_get_parameters_array_ex(2, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*args[0], (void **) &arg1, SWIGTYPE_p_GDALRasterBandShadow, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of Band_CreateMaskBand. Expected SWIGTYPE_p_GDALRasterBandShadow");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  
  /*@SWIG:/usr/share/swig1.3/php/utils.i,7,CONVERT_INT_IN@*/
  convert_to_long_ex(args[1]);
  arg2 = (int) Z_LVAL_PP(args[1]);
  /*@SWIG@*/;
  
  result = (CPLErr)GDALRasterBandShadow_CreateMaskBand(arg1,arg2);
  {
    ZVAL_LONG(return_value,result);
  }
  return;
fail:
  zend_error_noreturn(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_Band_GetHistogram) {
  GDALRasterBandShadow *arg1 = (GDALRasterBandShadow *) 0 ;
  double arg2 = (double) -0.5 ;
  double arg3 = (double) 255.5 ;
  int arg4 = (int) 256 ;
  int *arg5 = (int *) NULL ;
  int arg6 = (int) 0 ;
  int arg7 = (int) 1 ;
  GDALProgressFunc arg8 = (GDALProgressFunc) NULL ;
  void *arg9 = (void *) NULL ;
  GDALProgressFunc *tmp8 ;
  zval **args[9];
  int arg_count;
  CPLErr result;
  
  SWIG_ResetError();
  arg_count = ZEND_NUM_ARGS();
  if(arg_count<1 || arg_count>9 ||
    zend_get_parameters_array_ex(arg_count,args)!=SUCCESS)
  WRONG_PARAM_COUNT;
  
  {
    if(SWIG_ConvertPtr(*args[0], (void **) &arg1, SWIGTYPE_p_GDALRasterBandShadow, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of Band_GetHistogram. Expected SWIGTYPE_p_GDALRasterBandShadow");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  if(arg_count > 1) {
    /*@SWIG:/usr/share/swig1.3/php/utils.i,16,CONVERT_FLOAT_IN@*/
    convert_to_double_ex(args[1]);
    arg2 = (double) Z_DVAL_PP(args[1]);
    /*@SWIG@*/;
    
  }
  if(arg_count > 2) {
    /*@SWIG:/usr/share/swig1.3/php/utils.i,16,CONVERT_FLOAT_IN@*/
    convert_to_double_ex(args[2]);
    arg3 = (double) Z_DVAL_PP(args[2]);
    /*@SWIG@*/;
    
  }
  if(arg_count > 3) {
    /*@SWIG:/usr/share/swig1.3/php/utils.i,7,CONVERT_INT_IN@*/
    convert_to_long_ex(args[3]);
    arg4 = (int) Z_LVAL_PP(args[3]);
    /*@SWIG@*/;
    
  }
  if(arg_count > 4) {
    {
      if(SWIG_ConvertPtr(*args[4], (void **) &arg5, SWIGTYPE_p_int, 0) < 0) {
        SWIG_PHP_Error(E_ERROR, "Type error in argument 5 of Band_GetHistogram. Expected SWIGTYPE_p_int");
      }
    }
  }
  if(arg_count > 5) {
    /*@SWIG:/usr/share/swig1.3/php/utils.i,7,CONVERT_INT_IN@*/
    convert_to_long_ex(args[5]);
    arg6 = (int) Z_LVAL_PP(args[5]);
    /*@SWIG@*/;
    
  }
  if(arg_count > 6) {
    /*@SWIG:/usr/share/swig1.3/php/utils.i,7,CONVERT_INT_IN@*/
    convert_to_long_ex(args[6]);
    arg7 = (int) Z_LVAL_PP(args[6]);
    /*@SWIG@*/;
    
  }
  if(arg_count > 7) {
    {
      if(SWIG_ConvertPtr(*args[7], (void **) &tmp8, SWIGTYPE_p_GDALProgressFunc, 0) < 0 || tmp8 == NULL) {
        SWIG_PHP_Error(E_ERROR, "Type error in argument 8 of Band_GetHistogram. Expected SWIGTYPE_p_GDALProgressFunc");
      }
      arg8 = *tmp8;
    }
  }
  if(arg_count > 8) {
    {
      if(SWIG_ConvertPtr(*args[8], (void **) &arg9, 0, 0) < 0) {
        /* Allow NULL from php for void* */
        if ((*args[8])->type==IS_NULL) arg9=0;
        else
        SWIG_PHP_Error(E_ERROR, "Type error in argument 9 of Band_GetHistogram. Expected SWIGTYPE_p_p_void");
      }
    }
  }
  result = (CPLErr)GDALRasterBandShadow_GetHistogram(arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9);
  {
    ZVAL_LONG(return_value,result);
  }
  return;
fail:
  zend_error_noreturn(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_Band_GetDefaultHistogram) {
  GDALRasterBandShadow *arg1 = (GDALRasterBandShadow *) 0 ;
  double *arg2 = (double *) NULL ;
  double *arg3 = (double *) NULL ;
  int *arg4 = (int *) NULL ;
  int **arg5 = (int **) NULL ;
  int arg6 = (int) 1 ;
  GDALProgressFunc arg7 = (GDALProgressFunc) NULL ;
  void *arg8 = (void *) NULL ;
  GDALProgressFunc *tmp7 ;
  zval **args[8];
  int arg_count;
  CPLErr result;
  
  SWIG_ResetError();
  arg_count = ZEND_NUM_ARGS();
  if(arg_count<1 || arg_count>8 ||
    zend_get_parameters_array_ex(arg_count,args)!=SUCCESS)
  WRONG_PARAM_COUNT;
  
  {
    if(SWIG_ConvertPtr(*args[0], (void **) &arg1, SWIGTYPE_p_GDALRasterBandShadow, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of Band_GetDefaultHistogram. Expected SWIGTYPE_p_GDALRasterBandShadow");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  if(arg_count > 1) {
    {
      if(SWIG_ConvertPtr(*args[1], (void **) &arg2, SWIGTYPE_p_double, 0) < 0) {
        SWIG_PHP_Error(E_ERROR, "Type error in argument 2 of Band_GetDefaultHistogram. Expected SWIGTYPE_p_double");
      }
    }
  }
  if(arg_count > 2) {
    {
      if(SWIG_ConvertPtr(*args[2], (void **) &arg3, SWIGTYPE_p_double, 0) < 0) {
        SWIG_PHP_Error(E_ERROR, "Type error in argument 3 of Band_GetDefaultHistogram. Expected SWIGTYPE_p_double");
      }
    }
  }
  if(arg_count > 3) {
    {
      if(SWIG_ConvertPtr(*args[3], (void **) &arg4, SWIGTYPE_p_int, 0) < 0) {
        SWIG_PHP_Error(E_ERROR, "Type error in argument 4 of Band_GetDefaultHistogram. Expected SWIGTYPE_p_int");
      }
    }
  }
  if(arg_count > 4) {
    {
      if(SWIG_ConvertPtr(*args[4], (void **) &arg5, SWIGTYPE_p_p_int, 0) < 0) {
        SWIG_PHP_Error(E_ERROR, "Type error in argument 5 of Band_GetDefaultHistogram. Expected SWIGTYPE_p_p_int");
      }
    }
  }
  if(arg_count > 5) {
    /*@SWIG:/usr/share/swig1.3/php/utils.i,7,CONVERT_INT_IN@*/
    convert_to_long_ex(args[5]);
    arg6 = (int) Z_LVAL_PP(args[5]);
    /*@SWIG@*/;
    
  }
  if(arg_count > 6) {
    {
      if(SWIG_ConvertPtr(*args[6], (void **) &tmp7, SWIGTYPE_p_GDALProgressFunc, 0) < 0 || tmp7 == NULL) {
        SWIG_PHP_Error(E_ERROR, "Type error in argument 7 of Band_GetDefaultHistogram. Expected SWIGTYPE_p_GDALProgressFunc");
      }
      arg7 = *tmp7;
    }
  }
  if(arg_count > 7) {
    {
      if(SWIG_ConvertPtr(*args[7], (void **) &arg8, 0, 0) < 0) {
        /* Allow NULL from php for void* */
        if ((*args[7])->type==IS_NULL) arg8=0;
        else
        SWIG_PHP_Error(E_ERROR, "Type error in argument 8 of Band_GetDefaultHistogram. Expected SWIGTYPE_p_p_void");
      }
    }
  }
  result = (CPLErr)GDALRasterBandShadow_GetDefaultHistogram(arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8);
  {
    ZVAL_LONG(return_value,result);
  }
  return;
fail:
  zend_error_noreturn(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_Band_SetDefaultHistogram) {
  GDALRasterBandShadow *arg1 = (GDALRasterBandShadow *) 0 ;
  double arg2 ;
  double arg3 ;
  int arg4 ;
  int *arg5 = (int *) 0 ;
  zval **args[5];
  CPLErr result;
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 5 || zend_get_parameters_array_ex(5, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*args[0], (void **) &arg1, SWIGTYPE_p_GDALRasterBandShadow, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of Band_SetDefaultHistogram. Expected SWIGTYPE_p_GDALRasterBandShadow");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  
  /*@SWIG:/usr/share/swig1.3/php/utils.i,16,CONVERT_FLOAT_IN@*/
  convert_to_double_ex(args[1]);
  arg2 = (double) Z_DVAL_PP(args[1]);
  /*@SWIG@*/;
  
  
  /*@SWIG:/usr/share/swig1.3/php/utils.i,16,CONVERT_FLOAT_IN@*/
  convert_to_double_ex(args[2]);
  arg3 = (double) Z_DVAL_PP(args[2]);
  /*@SWIG@*/;
  
  
  /*@SWIG:/usr/share/swig1.3/php/utils.i,7,CONVERT_INT_IN@*/
  convert_to_long_ex(args[3]);
  arg4 = (int) Z_LVAL_PP(args[3]);
  /*@SWIG@*/;
  
  {
    if(SWIG_ConvertPtr(*args[4], (void **) &arg5, SWIGTYPE_p_int, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 5 of Band_SetDefaultHistogram. Expected SWIGTYPE_p_int");
    }
  }
  result = (CPLErr)GDALRasterBandShadow_SetDefaultHistogram(arg1,arg2,arg3,arg4,arg5);
  {
    ZVAL_LONG(return_value,result);
  }
  return;
fail:
  zend_error_noreturn(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_Band_HasArbitraryOverviews) {
  GDALRasterBandShadow *arg1 = (GDALRasterBandShadow *) 0 ;
  zval **args[1];
  bool result;
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 1 || zend_get_parameters_array_ex(1, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*args[0], (void **) &arg1, SWIGTYPE_p_GDALRasterBandShadow, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of Band_HasArbitraryOverviews. Expected SWIGTYPE_p_GDALRasterBandShadow");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  result = (bool)GDALRasterBandShadow_HasArbitraryOverviews(arg1);
  {
    ZVAL_BOOL(return_value,(result)?1:0);
  }
  return;
fail:
  zend_error_noreturn(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_new_ColorTable) {
  GDALPaletteInterp arg1 = (GDALPaletteInterp) GPI_RGB ;
  zval **args[1];
  int arg_count;
  GDALColorTableShadow *result = 0 ;
  
  SWIG_ResetError();
  arg_count = ZEND_NUM_ARGS();
  if(arg_count<0 || arg_count>1 ||
    zend_get_parameters_array_ex(arg_count,args)!=SUCCESS)
  WRONG_PARAM_COUNT;
  
  if(arg_count > 0) {
    /*@SWIG:/usr/share/swig1.3/php/utils.i,7,CONVERT_INT_IN@*/
    convert_to_long_ex(args[0]);
    arg1 = (GDALPaletteInterp) Z_LVAL_PP(args[0]);
    /*@SWIG@*/;
    
  }
  result = (GDALColorTableShadow *)new_GDALColorTableShadow(arg1);
  
  SWIG_SetPointerZval(return_value, (void *)result, SWIGTYPE_p_GDALColorTableShadow, 1);
  
  return;
fail:
  zend_error_noreturn(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


/* This function is designed to be called by the zend list destructors */
/* to typecast and do the actual destruction */
static void __wrap_delete_ColorTable(zend_rsrc_list_entry *rsrc, const char *type_name TSRMLS_DC) {
  swig_object_wrapper *value=(swig_object_wrapper *) rsrc->ptr ;
  void *ptr=value->ptr ;
  int newobject=value->newobject ;
  GDALColorTableShadow *arg1 = (GDALColorTableShadow *) 0 ;
  
  efree(value);
  if (! newobject) return; /* can't delete it! */
  arg1 = (GDALColorTableShadow *)SWIG_ZTS_ConvertResourceData(ptr,type_name,SWIGTYPE_p_GDALColorTableShadow TSRMLS_CC);
  if (! arg1) zend_error(E_ERROR, "GDALColorTableShadow resource already free'd");
  delete_GDALColorTableShadow(arg1);
  return;
fail:
  zend_error_noreturn(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_ColorTable_c_Clone) {
  GDALColorTableShadow *arg1 = (GDALColorTableShadow *) 0 ;
  zval **args[1];
  GDALColorTableShadow *result = 0 ;
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 1 || zend_get_parameters_array_ex(1, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*args[0], (void **) &arg1, SWIGTYPE_p_GDALColorTableShadow, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of ColorTable_c_Clone. Expected SWIGTYPE_p_GDALColorTableShadow");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  result = (GDALColorTableShadow *)GDALColorTableShadow_Clone(arg1);
  
  SWIG_SetPointerZval(return_value, (void *)result, SWIGTYPE_p_GDALColorTableShadow, 1);
  
  return;
fail:
  zend_error_noreturn(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_ColorTable_GetPaletteInterpretation) {
  GDALColorTableShadow *arg1 = (GDALColorTableShadow *) 0 ;
  zval **args[1];
  GDALPaletteInterp result;
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 1 || zend_get_parameters_array_ex(1, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*args[0], (void **) &arg1, SWIGTYPE_p_GDALColorTableShadow, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of ColorTable_GetPaletteInterpretation. Expected SWIGTYPE_p_GDALColorTableShadow");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  result = (GDALPaletteInterp)GDALColorTableShadow_GetPaletteInterpretation(arg1);
  {
    ZVAL_LONG(return_value,result);
  }
  return;
fail:
  zend_error_noreturn(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_ColorTable_GetCount) {
  GDALColorTableShadow *arg1 = (GDALColorTableShadow *) 0 ;
  zval **args[1];
  int result;
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 1 || zend_get_parameters_array_ex(1, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*args[0], (void **) &arg1, SWIGTYPE_p_GDALColorTableShadow, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of ColorTable_GetCount. Expected SWIGTYPE_p_GDALColorTableShadow");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  result = (int)GDALColorTableShadow_GetColorEntryCount(arg1);
  {
    ZVAL_LONG(return_value,result);
  }
  return;
fail:
  zend_error_noreturn(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_ColorTable_GetColorEntry) {
  GDALColorTableShadow *arg1 = (GDALColorTableShadow *) 0 ;
  int arg2 ;
  zval **args[2];
  GDALColorEntry *result = 0 ;
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 2 || zend_get_parameters_array_ex(2, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*args[0], (void **) &arg1, SWIGTYPE_p_GDALColorTableShadow, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of ColorTable_GetColorEntry. Expected SWIGTYPE_p_GDALColorTableShadow");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  
  /*@SWIG:/usr/share/swig1.3/php/utils.i,7,CONVERT_INT_IN@*/
  convert_to_long_ex(args[1]);
  arg2 = (int) Z_LVAL_PP(args[1]);
  /*@SWIG@*/;
  
  result = (GDALColorEntry *)GDALColorTableShadow_GetColorEntry(arg1,arg2);
  {
    /* %typemap(out) GDALColorEntry* */
    array_init(return_value);
    add_next_index_long(return_value,(*result).c1);
    add_next_index_long(return_value,(*result).c2);
    add_next_index_long(return_value,(*result).c3);
    add_next_index_long(return_value,(*result).c4);
  }
  return;
fail:
  zend_error_noreturn(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_ColorTable_GetColorEntryAsRGB) {
  GDALColorTableShadow *arg1 = (GDALColorTableShadow *) 0 ;
  int arg2 ;
  GDALColorEntry *arg3 = (GDALColorEntry *) 0 ;
  zval **args[3];
  int result;
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 3 || zend_get_parameters_array_ex(3, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*args[0], (void **) &arg1, SWIGTYPE_p_GDALColorTableShadow, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of ColorTable_GetColorEntryAsRGB. Expected SWIGTYPE_p_GDALColorTableShadow");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  
  /*@SWIG:/usr/share/swig1.3/php/utils.i,7,CONVERT_INT_IN@*/
  convert_to_long_ex(args[1]);
  arg2 = (int) Z_LVAL_PP(args[1]);
  /*@SWIG@*/;
  
  {
    /* %typemap(in) GDALColorEntry* */
    GDALColorEntry ce = {
      255,255,255,255
    };
    // Need to parse the array values from args[2]
    arg3 = &ce;
  }
  result = (int)GDALColorTableShadow_GetColorEntryAsRGB(arg1,arg2,arg3);
  {
    ZVAL_LONG(return_value,result);
  }
  return;
fail:
  zend_error_noreturn(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_ColorTable_SetColorEntry) {
  GDALColorTableShadow *arg1 = (GDALColorTableShadow *) 0 ;
  int arg2 ;
  GDALColorEntry *arg3 = (GDALColorEntry *) 0 ;
  zval **args[3];
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 3 || zend_get_parameters_array_ex(3, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*args[0], (void **) &arg1, SWIGTYPE_p_GDALColorTableShadow, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of ColorTable_SetColorEntry. Expected SWIGTYPE_p_GDALColorTableShadow");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  
  /*@SWIG:/usr/share/swig1.3/php/utils.i,7,CONVERT_INT_IN@*/
  convert_to_long_ex(args[1]);
  arg2 = (int) Z_LVAL_PP(args[1]);
  /*@SWIG@*/;
  
  {
    /* %typemap(in) GDALColorEntry* */
    GDALColorEntry ce = {
      255,255,255,255
    };
    // Need to parse the array values from args[2]
    arg3 = &ce;
  }
  GDALColorTableShadow_SetColorEntry(arg1,arg2,(GDALColorEntry const *)arg3);
  
  return;
fail:
  zend_error_noreturn(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_ColorTable_CreateColorRamp) {
  GDALColorTableShadow *arg1 = (GDALColorTableShadow *) 0 ;
  int arg2 ;
  GDALColorEntry *arg3 = (GDALColorEntry *) 0 ;
  int arg4 ;
  GDALColorEntry *arg5 = (GDALColorEntry *) 0 ;
  zval **args[5];
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 5 || zend_get_parameters_array_ex(5, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*args[0], (void **) &arg1, SWIGTYPE_p_GDALColorTableShadow, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of ColorTable_CreateColorRamp. Expected SWIGTYPE_p_GDALColorTableShadow");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  
  /*@SWIG:/usr/share/swig1.3/php/utils.i,7,CONVERT_INT_IN@*/
  convert_to_long_ex(args[1]);
  arg2 = (int) Z_LVAL_PP(args[1]);
  /*@SWIG@*/;
  
  {
    /* %typemap(in) GDALColorEntry* */
    GDALColorEntry ce = {
      255,255,255,255
    };
    // Need to parse the array values from args[2]
    arg3 = &ce;
  }
  
  /*@SWIG:/usr/share/swig1.3/php/utils.i,7,CONVERT_INT_IN@*/
  convert_to_long_ex(args[3]);
  arg4 = (int) Z_LVAL_PP(args[3]);
  /*@SWIG@*/;
  
  {
    /* %typemap(in) GDALColorEntry* */
    GDALColorEntry ce = {
      255,255,255,255
    };
    // Need to parse the array values from args[4]
    arg5 = &ce;
  }
  GDALColorTableShadow_CreateColorRamp(arg1,arg2,(GDALColorEntry const *)arg3,arg4,(GDALColorEntry const *)arg5);
  
  return;
fail:
  zend_error_noreturn(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_new_RasterAttributeTable) {
  GDALRasterAttributeTableShadow *result = 0 ;
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 0) {
    WRONG_PARAM_COUNT;
  }
  
  result = (GDALRasterAttributeTableShadow *)new_GDALRasterAttributeTableShadow();
  
  SWIG_SetPointerZval(return_value, (void *)result, SWIGTYPE_p_GDALRasterAttributeTableShadow, 1);
  
  return;
fail:
  zend_error_noreturn(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


/* This function is designed to be called by the zend list destructors */
/* to typecast and do the actual destruction */
static void __wrap_delete_RasterAttributeTable(zend_rsrc_list_entry *rsrc, const char *type_name TSRMLS_DC) {
  swig_object_wrapper *value=(swig_object_wrapper *) rsrc->ptr ;
  void *ptr=value->ptr ;
  int newobject=value->newobject ;
  GDALRasterAttributeTableShadow *arg1 = (GDALRasterAttributeTableShadow *) 0 ;
  
  efree(value);
  if (! newobject) return; /* can't delete it! */
  arg1 = (GDALRasterAttributeTableShadow *)SWIG_ZTS_ConvertResourceData(ptr,type_name,SWIGTYPE_p_GDALRasterAttributeTableShadow TSRMLS_CC);
  if (! arg1) zend_error(E_ERROR, "GDALRasterAttributeTableShadow resource already free'd");
  delete_GDALRasterAttributeTableShadow(arg1);
  return;
fail:
  zend_error_noreturn(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_RasterAttributeTable_c_Clone) {
  GDALRasterAttributeTableShadow *arg1 = (GDALRasterAttributeTableShadow *) 0 ;
  zval **args[1];
  GDALRasterAttributeTableShadow *result = 0 ;
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 1 || zend_get_parameters_array_ex(1, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*args[0], (void **) &arg1, SWIGTYPE_p_GDALRasterAttributeTableShadow, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of RasterAttributeTable_c_Clone. Expected SWIGTYPE_p_GDALRasterAttributeTableShadow");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  result = (GDALRasterAttributeTableShadow *)GDALRasterAttributeTableShadow_Clone(arg1);
  
  SWIG_SetPointerZval(return_value, (void *)result, SWIGTYPE_p_GDALRasterAttributeTableShadow, 1);
  
  return;
fail:
  zend_error_noreturn(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_RasterAttributeTable_GetColumnCount) {
  GDALRasterAttributeTableShadow *arg1 = (GDALRasterAttributeTableShadow *) 0 ;
  zval **args[1];
  int result;
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 1 || zend_get_parameters_array_ex(1, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*args[0], (void **) &arg1, SWIGTYPE_p_GDALRasterAttributeTableShadow, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of RasterAttributeTable_GetColumnCount. Expected SWIGTYPE_p_GDALRasterAttributeTableShadow");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  result = (int)GDALRasterAttributeTableShadow_GetColumnCount(arg1);
  {
    ZVAL_LONG(return_value,result);
  }
  return;
fail:
  zend_error_noreturn(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_RasterAttributeTable_GetNameOfCol) {
  GDALRasterAttributeTableShadow *arg1 = (GDALRasterAttributeTableShadow *) 0 ;
  int arg2 ;
  zval **args[2];
  char *result = 0 ;
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 2 || zend_get_parameters_array_ex(2, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*args[0], (void **) &arg1, SWIGTYPE_p_GDALRasterAttributeTableShadow, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of RasterAttributeTable_GetNameOfCol. Expected SWIGTYPE_p_GDALRasterAttributeTableShadow");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  
  /*@SWIG:/usr/share/swig1.3/php/utils.i,7,CONVERT_INT_IN@*/
  convert_to_long_ex(args[1]);
  arg2 = (int) Z_LVAL_PP(args[1]);
  /*@SWIG@*/;
  
  result = (char *)GDALRasterAttributeTableShadow_GetNameOfCol(arg1,arg2);
  {
    if(!result) {
      ZVAL_NULL(return_value);
    } else {
      ZVAL_STRING(return_value, (char *)result, 1);
    }
  }
  return;
fail:
  zend_error_noreturn(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_RasterAttributeTable_GetUsageOfCol) {
  GDALRasterAttributeTableShadow *arg1 = (GDALRasterAttributeTableShadow *) 0 ;
  int arg2 ;
  zval **args[2];
  GDALRATFieldUsage result;
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 2 || zend_get_parameters_array_ex(2, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*args[0], (void **) &arg1, SWIGTYPE_p_GDALRasterAttributeTableShadow, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of RasterAttributeTable_GetUsageOfCol. Expected SWIGTYPE_p_GDALRasterAttributeTableShadow");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  
  /*@SWIG:/usr/share/swig1.3/php/utils.i,7,CONVERT_INT_IN@*/
  convert_to_long_ex(args[1]);
  arg2 = (int) Z_LVAL_PP(args[1]);
  /*@SWIG@*/;
  
  result = (GDALRATFieldUsage)GDALRasterAttributeTableShadow_GetUsageOfCol(arg1,arg2);
  {
    ZVAL_LONG(return_value,result);
  }
  return;
fail:
  zend_error_noreturn(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_RasterAttributeTable_GetTypeOfCol) {
  GDALRasterAttributeTableShadow *arg1 = (GDALRasterAttributeTableShadow *) 0 ;
  int arg2 ;
  zval **args[2];
  GDALRATFieldType result;
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 2 || zend_get_parameters_array_ex(2, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*args[0], (void **) &arg1, SWIGTYPE_p_GDALRasterAttributeTableShadow, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of RasterAttributeTable_GetTypeOfCol. Expected SWIGTYPE_p_GDALRasterAttributeTableShadow");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  
  /*@SWIG:/usr/share/swig1.3/php/utils.i,7,CONVERT_INT_IN@*/
  convert_to_long_ex(args[1]);
  arg2 = (int) Z_LVAL_PP(args[1]);
  /*@SWIG@*/;
  
  result = (GDALRATFieldType)GDALRasterAttributeTableShadow_GetTypeOfCol(arg1,arg2);
  {
    ZVAL_LONG(return_value,result);
  }
  return;
fail:
  zend_error_noreturn(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_RasterAttributeTable_GetColOfUsage) {
  GDALRasterAttributeTableShadow *arg1 = (GDALRasterAttributeTableShadow *) 0 ;
  GDALRATFieldUsage arg2 ;
  zval **args[2];
  int result;
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 2 || zend_get_parameters_array_ex(2, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*args[0], (void **) &arg1, SWIGTYPE_p_GDALRasterAttributeTableShadow, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of RasterAttributeTable_GetColOfUsage. Expected SWIGTYPE_p_GDALRasterAttributeTableShadow");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  
  /*@SWIG:/usr/share/swig1.3/php/utils.i,7,CONVERT_INT_IN@*/
  convert_to_long_ex(args[1]);
  arg2 = (GDALRATFieldUsage) Z_LVAL_PP(args[1]);
  /*@SWIG@*/;
  
  result = (int)GDALRasterAttributeTableShadow_GetColOfUsage(arg1,arg2);
  {
    ZVAL_LONG(return_value,result);
  }
  return;
fail:
  zend_error_noreturn(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_RasterAttributeTable_GetRowCount) {
  GDALRasterAttributeTableShadow *arg1 = (GDALRasterAttributeTableShadow *) 0 ;
  zval **args[1];
  int result;
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 1 || zend_get_parameters_array_ex(1, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*args[0], (void **) &arg1, SWIGTYPE_p_GDALRasterAttributeTableShadow, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of RasterAttributeTable_GetRowCount. Expected SWIGTYPE_p_GDALRasterAttributeTableShadow");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  result = (int)GDALRasterAttributeTableShadow_GetRowCount(arg1);
  {
    ZVAL_LONG(return_value,result);
  }
  return;
fail:
  zend_error_noreturn(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_RasterAttributeTable_GetValueAsString) {
  GDALRasterAttributeTableShadow *arg1 = (GDALRasterAttributeTableShadow *) 0 ;
  int arg2 ;
  int arg3 ;
  zval **args[3];
  char *result = 0 ;
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 3 || zend_get_parameters_array_ex(3, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*args[0], (void **) &arg1, SWIGTYPE_p_GDALRasterAttributeTableShadow, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of RasterAttributeTable_GetValueAsString. Expected SWIGTYPE_p_GDALRasterAttributeTableShadow");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  
  /*@SWIG:/usr/share/swig1.3/php/utils.i,7,CONVERT_INT_IN@*/
  convert_to_long_ex(args[1]);
  arg2 = (int) Z_LVAL_PP(args[1]);
  /*@SWIG@*/;
  
  
  /*@SWIG:/usr/share/swig1.3/php/utils.i,7,CONVERT_INT_IN@*/
  convert_to_long_ex(args[2]);
  arg3 = (int) Z_LVAL_PP(args[2]);
  /*@SWIG@*/;
  
  result = (char *)GDALRasterAttributeTableShadow_GetValueAsString(arg1,arg2,arg3);
  {
    if(!result) {
      ZVAL_NULL(return_value);
    } else {
      ZVAL_STRING(return_value, (char *)result, 1);
    }
  }
  return;
fail:
  zend_error_noreturn(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_RasterAttributeTable_GetValueAsInt) {
  GDALRasterAttributeTableShadow *arg1 = (GDALRasterAttributeTableShadow *) 0 ;
  int arg2 ;
  int arg3 ;
  zval **args[3];
  int result;
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 3 || zend_get_parameters_array_ex(3, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*args[0], (void **) &arg1, SWIGTYPE_p_GDALRasterAttributeTableShadow, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of RasterAttributeTable_GetValueAsInt. Expected SWIGTYPE_p_GDALRasterAttributeTableShadow");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  
  /*@SWIG:/usr/share/swig1.3/php/utils.i,7,CONVERT_INT_IN@*/
  convert_to_long_ex(args[1]);
  arg2 = (int) Z_LVAL_PP(args[1]);
  /*@SWIG@*/;
  
  
  /*@SWIG:/usr/share/swig1.3/php/utils.i,7,CONVERT_INT_IN@*/
  convert_to_long_ex(args[2]);
  arg3 = (int) Z_LVAL_PP(args[2]);
  /*@SWIG@*/;
  
  result = (int)GDALRasterAttributeTableShadow_GetValueAsInt(arg1,arg2,arg3);
  {
    ZVAL_LONG(return_value,result);
  }
  return;
fail:
  zend_error_noreturn(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_RasterAttributeTable_GetValueAsDouble) {
  GDALRasterAttributeTableShadow *arg1 = (GDALRasterAttributeTableShadow *) 0 ;
  int arg2 ;
  int arg3 ;
  zval **args[3];
  double result;
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 3 || zend_get_parameters_array_ex(3, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*args[0], (void **) &arg1, SWIGTYPE_p_GDALRasterAttributeTableShadow, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of RasterAttributeTable_GetValueAsDouble. Expected SWIGTYPE_p_GDALRasterAttributeTableShadow");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  
  /*@SWIG:/usr/share/swig1.3/php/utils.i,7,CONVERT_INT_IN@*/
  convert_to_long_ex(args[1]);
  arg2 = (int) Z_LVAL_PP(args[1]);
  /*@SWIG@*/;
  
  
  /*@SWIG:/usr/share/swig1.3/php/utils.i,7,CONVERT_INT_IN@*/
  convert_to_long_ex(args[2]);
  arg3 = (int) Z_LVAL_PP(args[2]);
  /*@SWIG@*/;
  
  result = (double)GDALRasterAttributeTableShadow_GetValueAsDouble(arg1,arg2,arg3);
  {
    ZVAL_DOUBLE(return_value,result);
  }
  return;
fail:
  zend_error_noreturn(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_RasterAttributeTable_SetValueAsString) {
  GDALRasterAttributeTableShadow *arg1 = (GDALRasterAttributeTableShadow *) 0 ;
  int arg2 ;
  int arg3 ;
  char *arg4 = (char *) 0 ;
  zval **args[4];
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 4 || zend_get_parameters_array_ex(4, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*args[0], (void **) &arg1, SWIGTYPE_p_GDALRasterAttributeTableShadow, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of RasterAttributeTable_SetValueAsString. Expected SWIGTYPE_p_GDALRasterAttributeTableShadow");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  
  /*@SWIG:/usr/share/swig1.3/php/utils.i,7,CONVERT_INT_IN@*/
  convert_to_long_ex(args[1]);
  arg2 = (int) Z_LVAL_PP(args[1]);
  /*@SWIG@*/;
  
  
  /*@SWIG:/usr/share/swig1.3/php/utils.i,7,CONVERT_INT_IN@*/
  convert_to_long_ex(args[2]);
  arg3 = (int) Z_LVAL_PP(args[2]);
  /*@SWIG@*/;
  
  {
    /* %typemap(in) (tostring argin) */
    convert_to_string_ex(args[3]);
    arg4 = Z_STRVAL_PP( args[3] );
  }
  GDALRasterAttributeTableShadow_SetValueAsString(arg1,arg2,arg3,(char const *)arg4);
  
  return;
fail:
  zend_error_noreturn(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_RasterAttributeTable_SetValueAsInt) {
  GDALRasterAttributeTableShadow *arg1 = (GDALRasterAttributeTableShadow *) 0 ;
  int arg2 ;
  int arg3 ;
  int arg4 ;
  zval **args[4];
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 4 || zend_get_parameters_array_ex(4, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*args[0], (void **) &arg1, SWIGTYPE_p_GDALRasterAttributeTableShadow, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of RasterAttributeTable_SetValueAsInt. Expected SWIGTYPE_p_GDALRasterAttributeTableShadow");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  
  /*@SWIG:/usr/share/swig1.3/php/utils.i,7,CONVERT_INT_IN@*/
  convert_to_long_ex(args[1]);
  arg2 = (int) Z_LVAL_PP(args[1]);
  /*@SWIG@*/;
  
  
  /*@SWIG:/usr/share/swig1.3/php/utils.i,7,CONVERT_INT_IN@*/
  convert_to_long_ex(args[2]);
  arg3 = (int) Z_LVAL_PP(args[2]);
  /*@SWIG@*/;
  
  
  /*@SWIG:/usr/share/swig1.3/php/utils.i,7,CONVERT_INT_IN@*/
  convert_to_long_ex(args[3]);
  arg4 = (int) Z_LVAL_PP(args[3]);
  /*@SWIG@*/;
  
  GDALRasterAttributeTableShadow_SetValueAsInt(arg1,arg2,arg3,arg4);
  
  return;
fail:
  zend_error_noreturn(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_RasterAttributeTable_SetValueAsDouble) {
  GDALRasterAttributeTableShadow *arg1 = (GDALRasterAttributeTableShadow *) 0 ;
  int arg2 ;
  int arg3 ;
  double arg4 ;
  zval **args[4];
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 4 || zend_get_parameters_array_ex(4, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*args[0], (void **) &arg1, SWIGTYPE_p_GDALRasterAttributeTableShadow, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of RasterAttributeTable_SetValueAsDouble. Expected SWIGTYPE_p_GDALRasterAttributeTableShadow");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  
  /*@SWIG:/usr/share/swig1.3/php/utils.i,7,CONVERT_INT_IN@*/
  convert_to_long_ex(args[1]);
  arg2 = (int) Z_LVAL_PP(args[1]);
  /*@SWIG@*/;
  
  
  /*@SWIG:/usr/share/swig1.3/php/utils.i,7,CONVERT_INT_IN@*/
  convert_to_long_ex(args[2]);
  arg3 = (int) Z_LVAL_PP(args[2]);
  /*@SWIG@*/;
  
  
  /*@SWIG:/usr/share/swig1.3/php/utils.i,16,CONVERT_FLOAT_IN@*/
  convert_to_double_ex(args[3]);
  arg4 = (double) Z_DVAL_PP(args[3]);
  /*@SWIG@*/;
  
  GDALRasterAttributeTableShadow_SetValueAsDouble(arg1,arg2,arg3,arg4);
  
  return;
fail:
  zend_error_noreturn(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_RasterAttributeTable_SetRowCount) {
  GDALRasterAttributeTableShadow *arg1 = (GDALRasterAttributeTableShadow *) 0 ;
  int arg2 ;
  zval **args[2];
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 2 || zend_get_parameters_array_ex(2, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*args[0], (void **) &arg1, SWIGTYPE_p_GDALRasterAttributeTableShadow, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of RasterAttributeTable_SetRowCount. Expected SWIGTYPE_p_GDALRasterAttributeTableShadow");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  
  /*@SWIG:/usr/share/swig1.3/php/utils.i,7,CONVERT_INT_IN@*/
  convert_to_long_ex(args[1]);
  arg2 = (int) Z_LVAL_PP(args[1]);
  /*@SWIG@*/;
  
  GDALRasterAttributeTableShadow_SetRowCount(arg1,arg2);
  
  return;
fail:
  zend_error_noreturn(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_RasterAttributeTable_CreateColumn) {
  GDALRasterAttributeTableShadow *arg1 = (GDALRasterAttributeTableShadow *) 0 ;
  char *arg2 = (char *) 0 ;
  GDALRATFieldType arg3 ;
  GDALRATFieldUsage arg4 ;
  zval **args[4];
  int result;
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 4 || zend_get_parameters_array_ex(4, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*args[0], (void **) &arg1, SWIGTYPE_p_GDALRasterAttributeTableShadow, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of RasterAttributeTable_CreateColumn. Expected SWIGTYPE_p_GDALRasterAttributeTableShadow");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  
  /*@SWIG:/usr/share/swig1.3/php/utils.i,26,CONVERT_STRING_IN@*/
  if ((*args[1])->type==IS_NULL) {
    arg2 = (char *) 0;
  } else {
    convert_to_string_ex(args[1]);
    arg2 = (char *) Z_STRVAL_PP(args[1]);
  }
  /*@SWIG@*/;
  
  
  /*@SWIG:/usr/share/swig1.3/php/utils.i,7,CONVERT_INT_IN@*/
  convert_to_long_ex(args[2]);
  arg3 = (GDALRATFieldType) Z_LVAL_PP(args[2]);
  /*@SWIG@*/;
  
  
  /*@SWIG:/usr/share/swig1.3/php/utils.i,7,CONVERT_INT_IN@*/
  convert_to_long_ex(args[3]);
  arg4 = (GDALRATFieldUsage) Z_LVAL_PP(args[3]);
  /*@SWIG@*/;
  
  result = (int)GDALRasterAttributeTableShadow_CreateColumn(arg1,(char const *)arg2,arg3,arg4);
  {
    ZVAL_LONG(return_value,result);
  }
  return;
fail:
  zend_error_noreturn(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_RasterAttributeTable_GetLinearBinning) {
  GDALRasterAttributeTableShadow *arg1 = (GDALRasterAttributeTableShadow *) 0 ;
  double *arg2 = (double *) 0 ;
  double *arg3 = (double *) 0 ;
  double temp2 ;
  double temp3 ;
  zval **args[1];
  bool result;
  
  arg2 = &temp2;
  arg3 = &temp3;
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 1 || zend_get_parameters_array_ex(1, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*args[0], (void **) &arg1, SWIGTYPE_p_GDALRasterAttributeTableShadow, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of RasterAttributeTable_GetLinearBinning. Expected SWIGTYPE_p_GDALRasterAttributeTableShadow");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  result = (bool)GDALRasterAttributeTableShadow_GetLinearBinning(arg1,arg2,arg3);
  {
    ZVAL_BOOL(return_value,(result)?1:0);
  }
  {
    zval *o;
    MAKE_STD_ZVAL(o);
    ZVAL_DOUBLE(o,temp2);
    t_output_helper( &return_value, o );
  }
  {
    zval *o;
    MAKE_STD_ZVAL(o);
    ZVAL_DOUBLE(o,temp3);
    t_output_helper( &return_value, o );
  }
  return;
fail:
  zend_error_noreturn(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_RasterAttributeTable_SetLinearBinning) {
  GDALRasterAttributeTableShadow *arg1 = (GDALRasterAttributeTableShadow *) 0 ;
  double arg2 ;
  double arg3 ;
  zval **args[3];
  int result;
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 3 || zend_get_parameters_array_ex(3, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*args[0], (void **) &arg1, SWIGTYPE_p_GDALRasterAttributeTableShadow, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of RasterAttributeTable_SetLinearBinning. Expected SWIGTYPE_p_GDALRasterAttributeTableShadow");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  
  /*@SWIG:/usr/share/swig1.3/php/utils.i,16,CONVERT_FLOAT_IN@*/
  convert_to_double_ex(args[1]);
  arg2 = (double) Z_DVAL_PP(args[1]);
  /*@SWIG@*/;
  
  
  /*@SWIG:/usr/share/swig1.3/php/utils.i,16,CONVERT_FLOAT_IN@*/
  convert_to_double_ex(args[2]);
  arg3 = (double) Z_DVAL_PP(args[2]);
  /*@SWIG@*/;
  
  result = (int)GDALRasterAttributeTableShadow_SetLinearBinning(arg1,arg2,arg3);
  {
    ZVAL_LONG(return_value,result);
  }
  return;
fail:
  zend_error_noreturn(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_RasterAttributeTable_GetRowOfValue) {
  GDALRasterAttributeTableShadow *arg1 = (GDALRasterAttributeTableShadow *) 0 ;
  double arg2 ;
  zval **args[2];
  int result;
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 2 || zend_get_parameters_array_ex(2, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*args[0], (void **) &arg1, SWIGTYPE_p_GDALRasterAttributeTableShadow, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of RasterAttributeTable_GetRowOfValue. Expected SWIGTYPE_p_GDALRasterAttributeTableShadow");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  
  /*@SWIG:/usr/share/swig1.3/php/utils.i,16,CONVERT_FLOAT_IN@*/
  convert_to_double_ex(args[1]);
  arg2 = (double) Z_DVAL_PP(args[1]);
  /*@SWIG@*/;
  
  result = (int)GDALRasterAttributeTableShadow_GetRowOfValue(arg1,arg2);
  {
    ZVAL_LONG(return_value,result);
  }
  return;
fail:
  zend_error_noreturn(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_TermProgress_nocb) {
  double arg1 ;
  char *arg2 = (char *) NULL ;
  void *arg3 = (void *) NULL ;
  zval **args[3];
  int arg_count;
  int result;
  
  SWIG_ResetError();
  arg_count = ZEND_NUM_ARGS();
  if(arg_count<1 || arg_count>3 ||
    zend_get_parameters_array_ex(arg_count,args)!=SUCCESS)
  WRONG_PARAM_COUNT;
  
  
  /*@SWIG:/usr/share/swig1.3/php/utils.i,16,CONVERT_FLOAT_IN@*/
  convert_to_double_ex(args[0]);
  arg1 = (double) Z_DVAL_PP(args[0]);
  /*@SWIG@*/;
  
  if(arg_count > 1) {
    /*@SWIG:/usr/share/swig1.3/php/utils.i,26,CONVERT_STRING_IN@*/
    if ((*args[1])->type==IS_NULL) {
      arg2 = (char *) 0;
    } else {
      convert_to_string_ex(args[1]);
      arg2 = (char *) Z_STRVAL_PP(args[1]);
    }
    /*@SWIG@*/;
    
  }
  if(arg_count > 2) {
    {
      if(SWIG_ConvertPtr(*args[2], (void **) &arg3, 0, 0) < 0) {
        /* Allow NULL from php for void* */
        if ((*args[2])->type==IS_NULL) arg3=0;
        else
        SWIG_PHP_Error(E_ERROR, "Type error in argument 3 of TermProgress_nocb. Expected SWIGTYPE_p_p_void");
      }
    }
  }
  result = (int)GDALTermProgress_nocb(arg1,(char const *)arg2,arg3);
  {
    ZVAL_LONG(return_value,result);
  }
  return;
fail:
  zend_error_noreturn(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_ComputeMedianCutPCT) {
  GDALRasterBandShadow *arg1 = (GDALRasterBandShadow *) 0 ;
  GDALRasterBandShadow *arg2 = (GDALRasterBandShadow *) 0 ;
  GDALRasterBandShadow *arg3 = (GDALRasterBandShadow *) 0 ;
  int arg4 ;
  GDALColorTableShadow *arg5 = (GDALColorTableShadow *) 0 ;
  GDALProgressFunc arg6 = (GDALProgressFunc) NULL ;
  void *arg7 = (void *) NULL ;
  GDALProgressFunc *tmp6 ;
  zval **args[7];
  int arg_count;
  int result;
  
  SWIG_ResetError();
  arg_count = ZEND_NUM_ARGS();
  if(arg_count<5 || arg_count>7 ||
    zend_get_parameters_array_ex(arg_count,args)!=SUCCESS)
  WRONG_PARAM_COUNT;
  
  {
    if(SWIG_ConvertPtr(*args[0], (void **) &arg1, SWIGTYPE_p_GDALRasterBandShadow, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of ComputeMedianCutPCT. Expected SWIGTYPE_p_GDALRasterBandShadow");
    }
  }
  {
    if(SWIG_ConvertPtr(*args[1], (void **) &arg2, SWIGTYPE_p_GDALRasterBandShadow, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 2 of ComputeMedianCutPCT. Expected SWIGTYPE_p_GDALRasterBandShadow");
    }
  }
  {
    if(SWIG_ConvertPtr(*args[2], (void **) &arg3, SWIGTYPE_p_GDALRasterBandShadow, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 3 of ComputeMedianCutPCT. Expected SWIGTYPE_p_GDALRasterBandShadow");
    }
  }
  
  /*@SWIG:/usr/share/swig1.3/php/utils.i,7,CONVERT_INT_IN@*/
  convert_to_long_ex(args[3]);
  arg4 = (int) Z_LVAL_PP(args[3]);
  /*@SWIG@*/;
  
  {
    if(SWIG_ConvertPtr(*args[4], (void **) &arg5, SWIGTYPE_p_GDALColorTableShadow, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 5 of ComputeMedianCutPCT. Expected SWIGTYPE_p_GDALColorTableShadow");
    }
  }
  if(arg_count > 5) {
    {
      if(SWIG_ConvertPtr(*args[5], (void **) &tmp6, SWIGTYPE_p_GDALProgressFunc, 0) < 0 || tmp6 == NULL) {
        SWIG_PHP_Error(E_ERROR, "Type error in argument 6 of ComputeMedianCutPCT. Expected SWIGTYPE_p_GDALProgressFunc");
      }
      arg6 = *tmp6;
    }
  }
  if(arg_count > 6) {
    {
      if(SWIG_ConvertPtr(*args[6], (void **) &arg7, 0, 0) < 0) {
        /* Allow NULL from php for void* */
        if ((*args[6])->type==IS_NULL) arg7=0;
        else
        SWIG_PHP_Error(E_ERROR, "Type error in argument 7 of ComputeMedianCutPCT. Expected SWIGTYPE_p_p_void");
      }
    }
  }
  {
    if (!arg1) {
      SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
    }
  }
  {
    if (!arg2) {
      SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
    }
  }
  {
    if (!arg3) {
      SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
    }
  }
  {
    if (!arg5) {
      SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
    }
  }
  result = (int)ComputeMedianCutPCT(arg1,arg2,arg3,arg4,arg5,arg6,arg7);
  {
    ZVAL_LONG(return_value,result);
  }
  return;
fail:
  zend_error_noreturn(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_DitherRGB2PCT) {
  GDALRasterBandShadow *arg1 = (GDALRasterBandShadow *) 0 ;
  GDALRasterBandShadow *arg2 = (GDALRasterBandShadow *) 0 ;
  GDALRasterBandShadow *arg3 = (GDALRasterBandShadow *) 0 ;
  GDALRasterBandShadow *arg4 = (GDALRasterBandShadow *) 0 ;
  GDALColorTableShadow *arg5 = (GDALColorTableShadow *) 0 ;
  GDALProgressFunc arg6 = (GDALProgressFunc) NULL ;
  void *arg7 = (void *) NULL ;
  GDALProgressFunc *tmp6 ;
  zval **args[7];
  int arg_count;
  int result;
  
  SWIG_ResetError();
  arg_count = ZEND_NUM_ARGS();
  if(arg_count<5 || arg_count>7 ||
    zend_get_parameters_array_ex(arg_count,args)!=SUCCESS)
  WRONG_PARAM_COUNT;
  
  {
    if(SWIG_ConvertPtr(*args[0], (void **) &arg1, SWIGTYPE_p_GDALRasterBandShadow, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of DitherRGB2PCT. Expected SWIGTYPE_p_GDALRasterBandShadow");
    }
  }
  {
    if(SWIG_ConvertPtr(*args[1], (void **) &arg2, SWIGTYPE_p_GDALRasterBandShadow, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 2 of DitherRGB2PCT. Expected SWIGTYPE_p_GDALRasterBandShadow");
    }
  }
  {
    if(SWIG_ConvertPtr(*args[2], (void **) &arg3, SWIGTYPE_p_GDALRasterBandShadow, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 3 of DitherRGB2PCT. Expected SWIGTYPE_p_GDALRasterBandShadow");
    }
  }
  {
    if(SWIG_ConvertPtr(*args[3], (void **) &arg4, SWIGTYPE_p_GDALRasterBandShadow, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 4 of DitherRGB2PCT. Expected SWIGTYPE_p_GDALRasterBandShadow");
    }
  }
  {
    if(SWIG_ConvertPtr(*args[4], (void **) &arg5, SWIGTYPE_p_GDALColorTableShadow, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 5 of DitherRGB2PCT. Expected SWIGTYPE_p_GDALColorTableShadow");
    }
  }
  if(arg_count > 5) {
    {
      if(SWIG_ConvertPtr(*args[5], (void **) &tmp6, SWIGTYPE_p_GDALProgressFunc, 0) < 0 || tmp6 == NULL) {
        SWIG_PHP_Error(E_ERROR, "Type error in argument 6 of DitherRGB2PCT. Expected SWIGTYPE_p_GDALProgressFunc");
      }
      arg6 = *tmp6;
    }
  }
  if(arg_count > 6) {
    {
      if(SWIG_ConvertPtr(*args[6], (void **) &arg7, 0, 0) < 0) {
        /* Allow NULL from php for void* */
        if ((*args[6])->type==IS_NULL) arg7=0;
        else
        SWIG_PHP_Error(E_ERROR, "Type error in argument 7 of DitherRGB2PCT. Expected SWIGTYPE_p_p_void");
      }
    }
  }
  {
    if (!arg1) {
      SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
    }
  }
  {
    if (!arg2) {
      SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
    }
  }
  {
    if (!arg3) {
      SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
    }
  }
  {
    if (!arg4) {
      SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
    }
  }
  {
    if (!arg5) {
      SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
    }
  }
  result = (int)DitherRGB2PCT(arg1,arg2,arg3,arg4,arg5,arg6,arg7);
  {
    ZVAL_LONG(return_value,result);
  }
  return;
fail:
  zend_error_noreturn(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_ReprojectImage) {
  GDALDatasetShadow *arg1 = (GDALDatasetShadow *) 0 ;
  GDALDatasetShadow *arg2 = (GDALDatasetShadow *) 0 ;
  char *arg3 = (char *) NULL ;
  char *arg4 = (char *) NULL ;
  GDALResampleAlg arg5 = (GDALResampleAlg) GRA_NearestNeighbour ;
  double arg6 = (double) 0.0 ;
  double arg7 = (double) 0.0 ;
  GDALProgressFunc arg8 = (GDALProgressFunc) NULL ;
  void *arg9 = (void *) NULL ;
  GDALProgressFunc *tmp8 ;
  zval **args[9];
  int arg_count;
  CPLErr result;
  
  SWIG_ResetError();
  arg_count = ZEND_NUM_ARGS();
  if(arg_count<2 || arg_count>9 ||
    zend_get_parameters_array_ex(arg_count,args)!=SUCCESS)
  WRONG_PARAM_COUNT;
  
  {
    if(SWIG_ConvertPtr(*args[0], (void **) &arg1, SWIGTYPE_p_GDALDatasetShadow, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of ReprojectImage. Expected SWIGTYPE_p_GDALDatasetShadow");
    }
  }
  {
    if(SWIG_ConvertPtr(*args[1], (void **) &arg2, SWIGTYPE_p_GDALDatasetShadow, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 2 of ReprojectImage. Expected SWIGTYPE_p_GDALDatasetShadow");
    }
  }
  if(arg_count > 2) {
    /*@SWIG:/usr/share/swig1.3/php/utils.i,26,CONVERT_STRING_IN@*/
    if ((*args[2])->type==IS_NULL) {
      arg3 = (char *) 0;
    } else {
      convert_to_string_ex(args[2]);
      arg3 = (char *) Z_STRVAL_PP(args[2]);
    }
    /*@SWIG@*/;
    
  }
  if(arg_count > 3) {
    /*@SWIG:/usr/share/swig1.3/php/utils.i,26,CONVERT_STRING_IN@*/
    if ((*args[3])->type==IS_NULL) {
      arg4 = (char *) 0;
    } else {
      convert_to_string_ex(args[3]);
      arg4 = (char *) Z_STRVAL_PP(args[3]);
    }
    /*@SWIG@*/;
    
  }
  if(arg_count > 4) {
    /*@SWIG:/usr/share/swig1.3/php/utils.i,7,CONVERT_INT_IN@*/
    convert_to_long_ex(args[4]);
    arg5 = (GDALResampleAlg) Z_LVAL_PP(args[4]);
    /*@SWIG@*/;
    
  }
  if(arg_count > 5) {
    /*@SWIG:/usr/share/swig1.3/php/utils.i,16,CONVERT_FLOAT_IN@*/
    convert_to_double_ex(args[5]);
    arg6 = (double) Z_DVAL_PP(args[5]);
    /*@SWIG@*/;
    
  }
  if(arg_count > 6) {
    /*@SWIG:/usr/share/swig1.3/php/utils.i,16,CONVERT_FLOAT_IN@*/
    convert_to_double_ex(args[6]);
    arg7 = (double) Z_DVAL_PP(args[6]);
    /*@SWIG@*/;
    
  }
  if(arg_count > 7) {
    {
      if(SWIG_ConvertPtr(*args[7], (void **) &tmp8, SWIGTYPE_p_GDALProgressFunc, 0) < 0 || tmp8 == NULL) {
        SWIG_PHP_Error(E_ERROR, "Type error in argument 8 of ReprojectImage. Expected SWIGTYPE_p_GDALProgressFunc");
      }
      arg8 = *tmp8;
    }
  }
  if(arg_count > 8) {
    {
      if(SWIG_ConvertPtr(*args[8], (void **) &arg9, 0, 0) < 0) {
        /* Allow NULL from php for void* */
        if ((*args[8])->type==IS_NULL) arg9=0;
        else
        SWIG_PHP_Error(E_ERROR, "Type error in argument 9 of ReprojectImage. Expected SWIGTYPE_p_p_void");
      }
    }
  }
  {
    if (!arg1) {
      SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
    }
  }
  {
    if (!arg2) {
      SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
    }
  }
  result = (CPLErr)ReprojectImage(arg1,arg2,(char const *)arg3,(char const *)arg4,arg5,arg6,arg7,arg8,arg9);
  {
    ZVAL_LONG(return_value,result);
  }
  return;
fail:
  zend_error_noreturn(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_ComputeProximity) {
  GDALRasterBandShadow *arg1 = (GDALRasterBandShadow *) 0 ;
  GDALRasterBandShadow *arg2 = (GDALRasterBandShadow *) 0 ;
  char **arg3 = (char **) NULL ;
  GDALProgressFunc arg4 = (GDALProgressFunc) NULL ;
  void *arg5 = (void *) NULL ;
  GDALProgressFunc *tmp4 ;
  zval **args[5];
  int arg_count;
  int result;
  
  SWIG_ResetError();
  arg_count = ZEND_NUM_ARGS();
  if(arg_count<2 || arg_count>5 ||
    zend_get_parameters_array_ex(arg_count,args)!=SUCCESS)
  WRONG_PARAM_COUNT;
  
  {
    if(SWIG_ConvertPtr(*args[0], (void **) &arg1, SWIGTYPE_p_GDALRasterBandShadow, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of ComputeProximity. Expected SWIGTYPE_p_GDALRasterBandShadow");
    }
  }
  {
    if(SWIG_ConvertPtr(*args[1], (void **) &arg2, SWIGTYPE_p_GDALRasterBandShadow, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 2 of ComputeProximity. Expected SWIGTYPE_p_GDALRasterBandShadow");
    }
  }
  if(arg_count > 2) {
    {
      /* %typemap(in) char **options */
      zend_error(E_ERROR,"Typemap (in) char **options not properly defined");
      //  int size = PySequence_Size(args[2]);
      //  for (int i = 0; i < size; i++) {
      //    char *pszItem = NULL;
      //    if ( ! PyArg_Parse( PySequence_GetItem(args[2],i), "s", &pszItem ) ) {
      //      PyErr_SetString(PyExc_TypeError,"sequence must contain strings");
      //      SWIG_fail;
      //    }
      //    arg3 = CSLAddString( arg3, pszItem );
      //  }
    }
  }
  if(arg_count > 3) {
    {
      if(SWIG_ConvertPtr(*args[3], (void **) &tmp4, SWIGTYPE_p_GDALProgressFunc, 0) < 0 || tmp4 == NULL) {
        SWIG_PHP_Error(E_ERROR, "Type error in argument 4 of ComputeProximity. Expected SWIGTYPE_p_GDALProgressFunc");
      }
      arg4 = *tmp4;
    }
  }
  if(arg_count > 4) {
    {
      if(SWIG_ConvertPtr(*args[4], (void **) &arg5, 0, 0) < 0) {
        /* Allow NULL from php for void* */
        if ((*args[4])->type==IS_NULL) arg5=0;
        else
        SWIG_PHP_Error(E_ERROR, "Type error in argument 5 of ComputeProximity. Expected SWIGTYPE_p_p_void");
      }
    }
  }
  {
    if (!arg1) {
      SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
    }
  }
  {
    if (!arg2) {
      SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
    }
  }
  result = (int)ComputeProximity(arg1,arg2,arg3,arg4,arg5);
  {
    ZVAL_LONG(return_value,result);
  }
  {
    /* %typemap(freearg) char **options */
    CSLDestroy( arg3 );
  }
  return;
fail:
  {
    /* %typemap(freearg) char **options */
    CSLDestroy( arg3 );
  }
  zend_error_noreturn(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_RasterizeLayer) {
  GDALDatasetShadow *arg1 = (GDALDatasetShadow *) 0 ;
  int arg2 ;
  int *arg3 = (int *) 0 ;
  OGRLayerShadow *arg4 = (OGRLayerShadow *) 0 ;
  void *arg5 = (void *) NULL ;
  void *arg6 = (void *) NULL ;
  int arg7 = (int) 0 ;
  double *arg8 = (double *) NULL ;
  char **arg9 = (char **) NULL ;
  GDALProgressFunc arg10 = (GDALProgressFunc) NULL ;
  void *arg11 = (void *) NULL ;
  GDALProgressFunc *tmp10 ;
  zval **args[10];
  int arg_count;
  int result;
  
  SWIG_ResetError();
  arg_count = ZEND_NUM_ARGS();
  if(arg_count<3 || arg_count>10 ||
    zend_get_parameters_array_ex(arg_count,args)!=SUCCESS)
  WRONG_PARAM_COUNT;
  
  {
    if(SWIG_ConvertPtr(*args[0], (void **) &arg1, SWIGTYPE_p_GDALDatasetShadow, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of RasterizeLayer. Expected SWIGTYPE_p_GDALDatasetShadow");
    }
  }
  {
    /* %typemap(in,numinputs=1) (int nList, int* pList)*/
    zend_error(E_ERROR,"Typemap (in,numinputs=1) (int nList, int*pList) not properly defined");
    /* check if is List */
    //  if ( !PySequence_Check(args[1]) ) {
    //    PyErr_SetString(PyExc_TypeError, "not a sequence");
    //    SWIG_fail;
    //  }
    //  arg2 = PySequence_Size(args[1]);
    //  arg3 = (int*) malloc(arg2*sizeof(int));
    //  for( int i = 0; i<arg2; i++ ) {
    //    PyObject *o = PySequence_GetItem(args[1],i);
    //    if ( !PyArg_Parse(o,"i",&arg3[i]) ) {
    //      SWIG_fail;
    //    }
    //  }
  }
  {
    if(SWIG_ConvertPtr(*args[2], (void **) &arg4, SWIGTYPE_p_OGRLayerShadow, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 4 of RasterizeLayer. Expected SWIGTYPE_p_OGRLayerShadow");
    }
  }
  if(arg_count > 3) {
    {
      if(SWIG_ConvertPtr(*args[3], (void **) &arg5, 0, 0) < 0) {
        /* Allow NULL from php for void* */
        if ((*args[3])->type==IS_NULL) arg5=0;
        else
        SWIG_PHP_Error(E_ERROR, "Type error in argument 5 of RasterizeLayer. Expected SWIGTYPE_p_p_void");
      }
    }
  }
  if(arg_count > 4) {
    {
      if(SWIG_ConvertPtr(*args[4], (void **) &arg6, 0, 0) < 0) {
        /* Allow NULL from php for void* */
        if ((*args[4])->type==IS_NULL) arg6=0;
        else
        SWIG_PHP_Error(E_ERROR, "Type error in argument 6 of RasterizeLayer. Expected SWIGTYPE_p_p_void");
      }
    }
  }
  if(arg_count > 5) {
    /*@SWIG:/usr/share/swig1.3/php/utils.i,7,CONVERT_INT_IN@*/
    convert_to_long_ex(args[5]);
    arg7 = (int) Z_LVAL_PP(args[5]);
    /*@SWIG@*/;
    
  }
  if(arg_count > 6) {
    {
      if(SWIG_ConvertPtr(*args[6], (void **) &arg8, SWIGTYPE_p_double, 0) < 0) {
        SWIG_PHP_Error(E_ERROR, "Type error in argument 8 of RasterizeLayer. Expected SWIGTYPE_p_double");
      }
    }
  }
  if(arg_count > 7) {
    {
      /* %typemap(in) char **options */
      zend_error(E_ERROR,"Typemap (in) char **options not properly defined");
      //  int size = PySequence_Size(args[7]);
      //  for (int i = 0; i < size; i++) {
      //    char *pszItem = NULL;
      //    if ( ! PyArg_Parse( PySequence_GetItem(args[7],i), "s", &pszItem ) ) {
      //      PyErr_SetString(PyExc_TypeError,"sequence must contain strings");
      //      SWIG_fail;
      //    }
      //    arg9 = CSLAddString( arg9, pszItem );
      //  }
    }
  }
  if(arg_count > 8) {
    {
      if(SWIG_ConvertPtr(*args[8], (void **) &tmp10, SWIGTYPE_p_GDALProgressFunc, 0) < 0 || tmp10 == NULL) {
        SWIG_PHP_Error(E_ERROR, "Type error in argument 10 of RasterizeLayer. Expected SWIGTYPE_p_GDALProgressFunc");
      }
      arg10 = *tmp10;
    }
  }
  if(arg_count > 9) {
    {
      if(SWIG_ConvertPtr(*args[9], (void **) &arg11, 0, 0) < 0) {
        /* Allow NULL from php for void* */
        if ((*args[9])->type==IS_NULL) arg11=0;
        else
        SWIG_PHP_Error(E_ERROR, "Type error in argument 11 of RasterizeLayer. Expected SWIGTYPE_p_p_void");
      }
    }
  }
  {
    if (!arg1) {
      SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
    }
  }
  {
    if (!arg4) {
      SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
    }
  }
  result = (int)RasterizeLayer(arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9,arg10,arg11);
  {
    ZVAL_LONG(return_value,result);
  }
  {
    /* %typemap(freearg) (int nList, int* pList) */
    if (arg3) {
      free((void*) arg3);
    }
  }
  {
    /* %typemap(freearg) char **options */
    CSLDestroy( arg9 );
  }
  return;
fail:
  {
    /* %typemap(freearg) (int nList, int* pList) */
    if (arg3) {
      free((void*) arg3);
    }
  }
  {
    /* %typemap(freearg) char **options */
    CSLDestroy( arg9 );
  }
  zend_error_noreturn(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_Polygonize) {
  GDALRasterBandShadow *arg1 = (GDALRasterBandShadow *) 0 ;
  GDALRasterBandShadow *arg2 = (GDALRasterBandShadow *) 0 ;
  OGRLayerShadow *arg3 = (OGRLayerShadow *) 0 ;
  int arg4 ;
  char **arg5 = (char **) NULL ;
  GDALProgressFunc arg6 = (GDALProgressFunc) NULL ;
  void *arg7 = (void *) NULL ;
  GDALProgressFunc *tmp6 ;
  zval **args[7];
  int arg_count;
  int result;
  
  SWIG_ResetError();
  arg_count = ZEND_NUM_ARGS();
  if(arg_count<4 || arg_count>7 ||
    zend_get_parameters_array_ex(arg_count,args)!=SUCCESS)
  WRONG_PARAM_COUNT;
  
  {
    if(SWIG_ConvertPtr(*args[0], (void **) &arg1, SWIGTYPE_p_GDALRasterBandShadow, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of Polygonize. Expected SWIGTYPE_p_GDALRasterBandShadow");
    }
  }
  {
    if(SWIG_ConvertPtr(*args[1], (void **) &arg2, SWIGTYPE_p_GDALRasterBandShadow, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 2 of Polygonize. Expected SWIGTYPE_p_GDALRasterBandShadow");
    }
  }
  {
    if(SWIG_ConvertPtr(*args[2], (void **) &arg3, SWIGTYPE_p_OGRLayerShadow, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 3 of Polygonize. Expected SWIGTYPE_p_OGRLayerShadow");
    }
  }
  
  /*@SWIG:/usr/share/swig1.3/php/utils.i,7,CONVERT_INT_IN@*/
  convert_to_long_ex(args[3]);
  arg4 = (int) Z_LVAL_PP(args[3]);
  /*@SWIG@*/;
  
  if(arg_count > 4) {
    {
      /* %typemap(in) char **options */
      zend_error(E_ERROR,"Typemap (in) char **options not properly defined");
      //  int size = PySequence_Size(args[4]);
      //  for (int i = 0; i < size; i++) {
      //    char *pszItem = NULL;
      //    if ( ! PyArg_Parse( PySequence_GetItem(args[4],i), "s", &pszItem ) ) {
      //      PyErr_SetString(PyExc_TypeError,"sequence must contain strings");
      //      SWIG_fail;
      //    }
      //    arg5 = CSLAddString( arg5, pszItem );
      //  }
    }
  }
  if(arg_count > 5) {
    {
      if(SWIG_ConvertPtr(*args[5], (void **) &tmp6, SWIGTYPE_p_GDALProgressFunc, 0) < 0 || tmp6 == NULL) {
        SWIG_PHP_Error(E_ERROR, "Type error in argument 6 of Polygonize. Expected SWIGTYPE_p_GDALProgressFunc");
      }
      arg6 = *tmp6;
    }
  }
  if(arg_count > 6) {
    {
      if(SWIG_ConvertPtr(*args[6], (void **) &arg7, 0, 0) < 0) {
        /* Allow NULL from php for void* */
        if ((*args[6])->type==IS_NULL) arg7=0;
        else
        SWIG_PHP_Error(E_ERROR, "Type error in argument 7 of Polygonize. Expected SWIGTYPE_p_p_void");
      }
    }
  }
  {
    if (!arg1) {
      SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
    }
  }
  {
    if (!arg3) {
      SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
    }
  }
  result = (int)Polygonize(arg1,arg2,arg3,arg4,arg5,arg6,arg7);
  {
    ZVAL_LONG(return_value,result);
  }
  {
    /* %typemap(freearg) char **options */
    CSLDestroy( arg5 );
  }
  return;
fail:
  {
    /* %typemap(freearg) char **options */
    CSLDestroy( arg5 );
  }
  zend_error_noreturn(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_FillNodata) {
  GDALRasterBandShadow *arg1 = (GDALRasterBandShadow *) 0 ;
  GDALRasterBandShadow *arg2 = (GDALRasterBandShadow *) 0 ;
  double arg3 ;
  int arg4 ;
  char **arg5 = (char **) NULL ;
  GDALProgressFunc arg6 = (GDALProgressFunc) NULL ;
  void *arg7 = (void *) NULL ;
  GDALProgressFunc *tmp6 ;
  zval **args[7];
  int arg_count;
  int result;
  
  SWIG_ResetError();
  arg_count = ZEND_NUM_ARGS();
  if(arg_count<4 || arg_count>7 ||
    zend_get_parameters_array_ex(arg_count,args)!=SUCCESS)
  WRONG_PARAM_COUNT;
  
  {
    if(SWIG_ConvertPtr(*args[0], (void **) &arg1, SWIGTYPE_p_GDALRasterBandShadow, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of FillNodata. Expected SWIGTYPE_p_GDALRasterBandShadow");
    }
  }
  {
    if(SWIG_ConvertPtr(*args[1], (void **) &arg2, SWIGTYPE_p_GDALRasterBandShadow, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 2 of FillNodata. Expected SWIGTYPE_p_GDALRasterBandShadow");
    }
  }
  
  /*@SWIG:/usr/share/swig1.3/php/utils.i,16,CONVERT_FLOAT_IN@*/
  convert_to_double_ex(args[2]);
  arg3 = (double) Z_DVAL_PP(args[2]);
  /*@SWIG@*/;
  
  
  /*@SWIG:/usr/share/swig1.3/php/utils.i,7,CONVERT_INT_IN@*/
  convert_to_long_ex(args[3]);
  arg4 = (int) Z_LVAL_PP(args[3]);
  /*@SWIG@*/;
  
  if(arg_count > 4) {
    {
      /* %typemap(in) char **options */
      zend_error(E_ERROR,"Typemap (in) char **options not properly defined");
      //  int size = PySequence_Size(args[4]);
      //  for (int i = 0; i < size; i++) {
      //    char *pszItem = NULL;
      //    if ( ! PyArg_Parse( PySequence_GetItem(args[4],i), "s", &pszItem ) ) {
      //      PyErr_SetString(PyExc_TypeError,"sequence must contain strings");
      //      SWIG_fail;
      //    }
      //    arg5 = CSLAddString( arg5, pszItem );
      //  }
    }
  }
  if(arg_count > 5) {
    {
      if(SWIG_ConvertPtr(*args[5], (void **) &tmp6, SWIGTYPE_p_GDALProgressFunc, 0) < 0 || tmp6 == NULL) {
        SWIG_PHP_Error(E_ERROR, "Type error in argument 6 of FillNodata. Expected SWIGTYPE_p_GDALProgressFunc");
      }
      arg6 = *tmp6;
    }
  }
  if(arg_count > 6) {
    {
      if(SWIG_ConvertPtr(*args[6], (void **) &arg7, 0, 0) < 0) {
        /* Allow NULL from php for void* */
        if ((*args[6])->type==IS_NULL) arg7=0;
        else
        SWIG_PHP_Error(E_ERROR, "Type error in argument 7 of FillNodata. Expected SWIGTYPE_p_p_void");
      }
    }
  }
  {
    if (!arg1) {
      SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
    }
  }
  result = (int)FillNodata(arg1,arg2,arg3,arg4,arg5,arg6,arg7);
  {
    ZVAL_LONG(return_value,result);
  }
  {
    /* %typemap(freearg) char **options */
    CSLDestroy( arg5 );
  }
  return;
fail:
  {
    /* %typemap(freearg) char **options */
    CSLDestroy( arg5 );
  }
  zend_error_noreturn(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_SieveFilter) {
  GDALRasterBandShadow *arg1 = (GDALRasterBandShadow *) 0 ;
  GDALRasterBandShadow *arg2 = (GDALRasterBandShadow *) 0 ;
  GDALRasterBandShadow *arg3 = (GDALRasterBandShadow *) 0 ;
  int arg4 ;
  int arg5 = (int) 4 ;
  char **arg6 = (char **) NULL ;
  GDALProgressFunc arg7 = (GDALProgressFunc) NULL ;
  void *arg8 = (void *) NULL ;
  GDALProgressFunc *tmp7 ;
  zval **args[8];
  int arg_count;
  int result;
  
  SWIG_ResetError();
  arg_count = ZEND_NUM_ARGS();
  if(arg_count<4 || arg_count>8 ||
    zend_get_parameters_array_ex(arg_count,args)!=SUCCESS)
  WRONG_PARAM_COUNT;
  
  {
    if(SWIG_ConvertPtr(*args[0], (void **) &arg1, SWIGTYPE_p_GDALRasterBandShadow, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of SieveFilter. Expected SWIGTYPE_p_GDALRasterBandShadow");
    }
  }
  {
    if(SWIG_ConvertPtr(*args[1], (void **) &arg2, SWIGTYPE_p_GDALRasterBandShadow, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 2 of SieveFilter. Expected SWIGTYPE_p_GDALRasterBandShadow");
    }
  }
  {
    if(SWIG_ConvertPtr(*args[2], (void **) &arg3, SWIGTYPE_p_GDALRasterBandShadow, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 3 of SieveFilter. Expected SWIGTYPE_p_GDALRasterBandShadow");
    }
  }
  
  /*@SWIG:/usr/share/swig1.3/php/utils.i,7,CONVERT_INT_IN@*/
  convert_to_long_ex(args[3]);
  arg4 = (int) Z_LVAL_PP(args[3]);
  /*@SWIG@*/;
  
  if(arg_count > 4) {
    /*@SWIG:/usr/share/swig1.3/php/utils.i,7,CONVERT_INT_IN@*/
    convert_to_long_ex(args[4]);
    arg5 = (int) Z_LVAL_PP(args[4]);
    /*@SWIG@*/;
    
  }
  if(arg_count > 5) {
    {
      /* %typemap(in) char **options */
      zend_error(E_ERROR,"Typemap (in) char **options not properly defined");
      //  int size = PySequence_Size(args[5]);
      //  for (int i = 0; i < size; i++) {
      //    char *pszItem = NULL;
      //    if ( ! PyArg_Parse( PySequence_GetItem(args[5],i), "s", &pszItem ) ) {
      //      PyErr_SetString(PyExc_TypeError,"sequence must contain strings");
      //      SWIG_fail;
      //    }
      //    arg6 = CSLAddString( arg6, pszItem );
      //  }
    }
  }
  if(arg_count > 6) {
    {
      if(SWIG_ConvertPtr(*args[6], (void **) &tmp7, SWIGTYPE_p_GDALProgressFunc, 0) < 0 || tmp7 == NULL) {
        SWIG_PHP_Error(E_ERROR, "Type error in argument 7 of SieveFilter. Expected SWIGTYPE_p_GDALProgressFunc");
      }
      arg7 = *tmp7;
    }
  }
  if(arg_count > 7) {
    {
      if(SWIG_ConvertPtr(*args[7], (void **) &arg8, 0, 0) < 0) {
        /* Allow NULL from php for void* */
        if ((*args[7])->type==IS_NULL) arg8=0;
        else
        SWIG_PHP_Error(E_ERROR, "Type error in argument 8 of SieveFilter. Expected SWIGTYPE_p_p_void");
      }
    }
  }
  {
    if (!arg1) {
      SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
    }
  }
  {
    if (!arg3) {
      SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
    }
  }
  result = (int)SieveFilter(arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8);
  {
    ZVAL_LONG(return_value,result);
  }
  {
    /* %typemap(freearg) char **options */
    CSLDestroy( arg6 );
  }
  return;
fail:
  {
    /* %typemap(freearg) char **options */
    CSLDestroy( arg6 );
  }
  zend_error_noreturn(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_RegenerateOverviews) {
  GDALRasterBandShadow *arg1 = (GDALRasterBandShadow *) 0 ;
  int arg2 ;
  GDALRasterBandShadow **arg3 = (GDALRasterBandShadow **) 0 ;
  char *arg4 = (char *) "average" ;
  GDALProgressFunc arg5 = (GDALProgressFunc) NULL ;
  void *arg6 = (void *) NULL ;
  GDALProgressFunc *tmp5 ;
  zval **args[6];
  int arg_count;
  int result;
  
  SWIG_ResetError();
  arg_count = ZEND_NUM_ARGS();
  if(arg_count<3 || arg_count>6 ||
    zend_get_parameters_array_ex(arg_count,args)!=SUCCESS)
  WRONG_PARAM_COUNT;
  
  {
    if(SWIG_ConvertPtr(*args[0], (void **) &arg1, SWIGTYPE_p_GDALRasterBandShadow, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of RegenerateOverviews. Expected SWIGTYPE_p_GDALRasterBandShadow");
    }
  }
  
  /*@SWIG:/usr/share/swig1.3/php/utils.i,7,CONVERT_INT_IN@*/
  convert_to_long_ex(args[1]);
  arg2 = (int) Z_LVAL_PP(args[1]);
  /*@SWIG@*/;
  
  {
    if(SWIG_ConvertPtr(*args[2], (void **) &arg3, SWIGTYPE_p_p_GDALRasterBandShadow, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 3 of RegenerateOverviews. Expected SWIGTYPE_p_p_GDALRasterBandShadow");
    }
  }
  if(arg_count > 3) {
    /*@SWIG:/usr/share/swig1.3/php/utils.i,26,CONVERT_STRING_IN@*/
    if ((*args[3])->type==IS_NULL) {
      arg4 = (char *) 0;
    } else {
      convert_to_string_ex(args[3]);
      arg4 = (char *) Z_STRVAL_PP(args[3]);
    }
    /*@SWIG@*/;
    
  }
  if(arg_count > 4) {
    {
      if(SWIG_ConvertPtr(*args[4], (void **) &tmp5, SWIGTYPE_p_GDALProgressFunc, 0) < 0 || tmp5 == NULL) {
        SWIG_PHP_Error(E_ERROR, "Type error in argument 5 of RegenerateOverviews. Expected SWIGTYPE_p_GDALProgressFunc");
      }
      arg5 = *tmp5;
    }
  }
  if(arg_count > 5) {
    {
      if(SWIG_ConvertPtr(*args[5], (void **) &arg6, 0, 0) < 0) {
        /* Allow NULL from php for void* */
        if ((*args[5])->type==IS_NULL) arg6=0;
        else
        SWIG_PHP_Error(E_ERROR, "Type error in argument 6 of RegenerateOverviews. Expected SWIGTYPE_p_p_void");
      }
    }
  }
  {
    if (!arg1) {
      SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
    }
  }
  result = (int)RegenerateOverviews(arg1,arg2,arg3,(char const *)arg4,arg5,arg6);
  {
    ZVAL_LONG(return_value,result);
  }
  return;
fail:
  zend_error_noreturn(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_RegenerateOverview) {
  GDALRasterBandShadow *arg1 = (GDALRasterBandShadow *) 0 ;
  GDALRasterBandShadow *arg2 = (GDALRasterBandShadow *) 0 ;
  char *arg3 = (char *) "average" ;
  GDALProgressFunc arg4 = (GDALProgressFunc) NULL ;
  void *arg5 = (void *) NULL ;
  GDALProgressFunc *tmp4 ;
  zval **args[5];
  int arg_count;
  int result;
  
  SWIG_ResetError();
  arg_count = ZEND_NUM_ARGS();
  if(arg_count<2 || arg_count>5 ||
    zend_get_parameters_array_ex(arg_count,args)!=SUCCESS)
  WRONG_PARAM_COUNT;
  
  {
    if(SWIG_ConvertPtr(*args[0], (void **) &arg1, SWIGTYPE_p_GDALRasterBandShadow, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of RegenerateOverview. Expected SWIGTYPE_p_GDALRasterBandShadow");
    }
  }
  {
    if(SWIG_ConvertPtr(*args[1], (void **) &arg2, SWIGTYPE_p_GDALRasterBandShadow, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 2 of RegenerateOverview. Expected SWIGTYPE_p_GDALRasterBandShadow");
    }
  }
  if(arg_count > 2) {
    /*@SWIG:/usr/share/swig1.3/php/utils.i,26,CONVERT_STRING_IN@*/
    if ((*args[2])->type==IS_NULL) {
      arg3 = (char *) 0;
    } else {
      convert_to_string_ex(args[2]);
      arg3 = (char *) Z_STRVAL_PP(args[2]);
    }
    /*@SWIG@*/;
    
  }
  if(arg_count > 3) {
    {
      if(SWIG_ConvertPtr(*args[3], (void **) &tmp4, SWIGTYPE_p_GDALProgressFunc, 0) < 0 || tmp4 == NULL) {
        SWIG_PHP_Error(E_ERROR, "Type error in argument 4 of RegenerateOverview. Expected SWIGTYPE_p_GDALProgressFunc");
      }
      arg4 = *tmp4;
    }
  }
  if(arg_count > 4) {
    {
      if(SWIG_ConvertPtr(*args[4], (void **) &arg5, 0, 0) < 0) {
        /* Allow NULL from php for void* */
        if ((*args[4])->type==IS_NULL) arg5=0;
        else
        SWIG_PHP_Error(E_ERROR, "Type error in argument 5 of RegenerateOverview. Expected SWIGTYPE_p_p_void");
      }
    }
  }
  {
    if (!arg1) {
      SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
    }
  }
  {
    if (!arg2) {
      SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
    }
  }
  result = (int)RegenerateOverview(arg1,arg2,(char const *)arg3,arg4,arg5);
  {
    ZVAL_LONG(return_value,result);
  }
  return;
fail:
  zend_error_noreturn(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_ContourGenerate) {
  GDALRasterBandShadow *arg1 = (GDALRasterBandShadow *) 0 ;
  double arg2 ;
  double arg3 ;
  int arg4 ;
  double *arg5 = (double *) 0 ;
  int arg6 ;
  double arg7 ;
  OGRLayerShadow *arg8 = (OGRLayerShadow *) 0 ;
  int arg9 ;
  int arg10 ;
  GDALProgressFunc arg11 = (GDALProgressFunc) NULL ;
  void *arg12 = (void *) NULL ;
  GDALProgressFunc *tmp11 ;
  zval **args[12];
  int arg_count;
  int result;
  
  SWIG_ResetError();
  arg_count = ZEND_NUM_ARGS();
  if(arg_count<10 || arg_count>12 ||
    zend_get_parameters_array_ex(arg_count,args)!=SUCCESS)
  WRONG_PARAM_COUNT;
  
  {
    if(SWIG_ConvertPtr(*args[0], (void **) &arg1, SWIGTYPE_p_GDALRasterBandShadow, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of ContourGenerate. Expected SWIGTYPE_p_GDALRasterBandShadow");
    }
  }
  
  /*@SWIG:/usr/share/swig1.3/php/utils.i,16,CONVERT_FLOAT_IN@*/
  convert_to_double_ex(args[1]);
  arg2 = (double) Z_DVAL_PP(args[1]);
  /*@SWIG@*/;
  
  
  /*@SWIG:/usr/share/swig1.3/php/utils.i,16,CONVERT_FLOAT_IN@*/
  convert_to_double_ex(args[2]);
  arg3 = (double) Z_DVAL_PP(args[2]);
  /*@SWIG@*/;
  
  
  /*@SWIG:/usr/share/swig1.3/php/utils.i,7,CONVERT_INT_IN@*/
  convert_to_long_ex(args[3]);
  arg4 = (int) Z_LVAL_PP(args[3]);
  /*@SWIG@*/;
  
  {
    if(SWIG_ConvertPtr(*args[4], (void **) &arg5, SWIGTYPE_p_double, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 5 of ContourGenerate. Expected SWIGTYPE_p_double");
    }
  }
  
  /*@SWIG:/usr/share/swig1.3/php/utils.i,7,CONVERT_INT_IN@*/
  convert_to_long_ex(args[5]);
  arg6 = (int) Z_LVAL_PP(args[5]);
  /*@SWIG@*/;
  
  
  /*@SWIG:/usr/share/swig1.3/php/utils.i,16,CONVERT_FLOAT_IN@*/
  convert_to_double_ex(args[6]);
  arg7 = (double) Z_DVAL_PP(args[6]);
  /*@SWIG@*/;
  
  {
    if(SWIG_ConvertPtr(*args[7], (void **) &arg8, SWIGTYPE_p_OGRLayerShadow, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 8 of ContourGenerate. Expected SWIGTYPE_p_OGRLayerShadow");
    }
  }
  
  /*@SWIG:/usr/share/swig1.3/php/utils.i,7,CONVERT_INT_IN@*/
  convert_to_long_ex(args[8]);
  arg9 = (int) Z_LVAL_PP(args[8]);
  /*@SWIG@*/;
  
  
  /*@SWIG:/usr/share/swig1.3/php/utils.i,7,CONVERT_INT_IN@*/
  convert_to_long_ex(args[9]);
  arg10 = (int) Z_LVAL_PP(args[9]);
  /*@SWIG@*/;
  
  if(arg_count > 10) {
    {
      if(SWIG_ConvertPtr(*args[10], (void **) &tmp11, SWIGTYPE_p_GDALProgressFunc, 0) < 0 || tmp11 == NULL) {
        SWIG_PHP_Error(E_ERROR, "Type error in argument 11 of ContourGenerate. Expected SWIGTYPE_p_GDALProgressFunc");
      }
      arg11 = *tmp11;
    }
  }
  if(arg_count > 11) {
    {
      if(SWIG_ConvertPtr(*args[11], (void **) &arg12, 0, 0) < 0) {
        /* Allow NULL from php for void* */
        if ((*args[11])->type==IS_NULL) arg12=0;
        else
        SWIG_PHP_Error(E_ERROR, "Type error in argument 12 of ContourGenerate. Expected SWIGTYPE_p_p_void");
      }
    }
  }
  {
    if (!arg1) {
      SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
    }
  }
  {
    if (!arg8) {
      SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
    }
  }
  result = (int)ContourGenerate(arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9,arg10,arg11,arg12);
  {
    ZVAL_LONG(return_value,result);
  }
  return;
fail:
  zend_error_noreturn(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_AutoCreateWarpedVRT) {
  GDALDatasetShadow *arg1 = (GDALDatasetShadow *) 0 ;
  char *arg2 = (char *) 0 ;
  char *arg3 = (char *) 0 ;
  GDALResampleAlg arg4 = (GDALResampleAlg) GRA_NearestNeighbour ;
  double arg5 = (double) 0.0 ;
  zval **args[5];
  int arg_count;
  GDALDatasetShadow *result = 0 ;
  
  SWIG_ResetError();
  arg_count = ZEND_NUM_ARGS();
  if(arg_count<1 || arg_count>5 ||
    zend_get_parameters_array_ex(arg_count,args)!=SUCCESS)
  WRONG_PARAM_COUNT;
  
  {
    if(SWIG_ConvertPtr(*args[0], (void **) &arg1, SWIGTYPE_p_GDALDatasetShadow, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of AutoCreateWarpedVRT. Expected SWIGTYPE_p_GDALDatasetShadow");
    }
  }
  if(arg_count > 1) {
    /*@SWIG:/usr/share/swig1.3/php/utils.i,26,CONVERT_STRING_IN@*/
    if ((*args[1])->type==IS_NULL) {
      arg2 = (char *) 0;
    } else {
      convert_to_string_ex(args[1]);
      arg2 = (char *) Z_STRVAL_PP(args[1]);
    }
    /*@SWIG@*/;
    
  }
  if(arg_count > 2) {
    /*@SWIG:/usr/share/swig1.3/php/utils.i,26,CONVERT_STRING_IN@*/
    if ((*args[2])->type==IS_NULL) {
      arg3 = (char *) 0;
    } else {
      convert_to_string_ex(args[2]);
      arg3 = (char *) Z_STRVAL_PP(args[2]);
    }
    /*@SWIG@*/;
    
  }
  if(arg_count > 3) {
    /*@SWIG:/usr/share/swig1.3/php/utils.i,7,CONVERT_INT_IN@*/
    convert_to_long_ex(args[3]);
    arg4 = (GDALResampleAlg) Z_LVAL_PP(args[3]);
    /*@SWIG@*/;
    
  }
  if(arg_count > 4) {
    /*@SWIG:/usr/share/swig1.3/php/utils.i,16,CONVERT_FLOAT_IN@*/
    convert_to_double_ex(args[4]);
    arg5 = (double) Z_DVAL_PP(args[4]);
    /*@SWIG@*/;
    
  }
  {
    if (!arg1) {
      SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
    }
  }
  result = (GDALDatasetShadow *)AutoCreateWarpedVRT(arg1,(char const *)arg2,(char const *)arg3,arg4,arg5);
  
  SWIG_SetPointerZval(return_value, (void *)result, SWIGTYPE_p_GDALDatasetShadow, 1);
  
  return;
fail:
  zend_error_noreturn(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_new_Transformer) {
  GDALDatasetShadow *arg1 = (GDALDatasetShadow *) 0 ;
  GDALDatasetShadow *arg2 = (GDALDatasetShadow *) 0 ;
  char **arg3 = (char **) 0 ;
  zval **args[3];
  GDALTransformerInfoShadow *result = 0 ;
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 3 || zend_get_parameters_array_ex(3, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*args[0], (void **) &arg1, SWIGTYPE_p_GDALDatasetShadow, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of new_Transformer. Expected SWIGTYPE_p_GDALDatasetShadow");
    }
  }
  {
    if(SWIG_ConvertPtr(*args[1], (void **) &arg2, SWIGTYPE_p_GDALDatasetShadow, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 2 of new_Transformer. Expected SWIGTYPE_p_GDALDatasetShadow");
    }
  }
  {
    /* %typemap(in) char **options */
    zend_error(E_ERROR,"Typemap (in) char **options not properly defined");
    //  int size = PySequence_Size(args[2]);
    //  for (int i = 0; i < size; i++) {
    //    char *pszItem = NULL;
    //    if ( ! PyArg_Parse( PySequence_GetItem(args[2],i), "s", &pszItem ) ) {
    //      PyErr_SetString(PyExc_TypeError,"sequence must contain strings");
    //      SWIG_fail;
    //    }
    //    arg3 = CSLAddString( arg3, pszItem );
    //  }
  }
  result = (GDALTransformerInfoShadow *)new_GDALTransformerInfoShadow(arg1,arg2,arg3);
  
  SWIG_SetPointerZval(return_value, (void *)result, SWIGTYPE_p_GDALTransformerInfoShadow, 1);
  
  {
    /* %typemap(freearg) char **options */
    CSLDestroy( arg3 );
  }
  return;
fail:
  {
    /* %typemap(freearg) char **options */
    CSLDestroy( arg3 );
  }
  zend_error_noreturn(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


/* This function is designed to be called by the zend list destructors */
/* to typecast and do the actual destruction */
static void __wrap_delete_Transformer(zend_rsrc_list_entry *rsrc, const char *type_name TSRMLS_DC) {
  swig_object_wrapper *value=(swig_object_wrapper *) rsrc->ptr ;
  void *ptr=value->ptr ;
  int newobject=value->newobject ;
  GDALTransformerInfoShadow *arg1 = (GDALTransformerInfoShadow *) 0 ;
  
  efree(value);
  if (! newobject) return; /* can't delete it! */
  arg1 = (GDALTransformerInfoShadow *)SWIG_ZTS_ConvertResourceData(ptr,type_name,SWIGTYPE_p_GDALTransformerInfoShadow TSRMLS_CC);
  if (! arg1) zend_error(E_ERROR, "GDALTransformerInfoShadow resource already free'd");
  delete_GDALTransformerInfoShadow(arg1);
  return;
fail:
  zend_error_noreturn(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_Transformer_TransformPoint__SWIG_0) {
  GDALTransformerInfoShadow *arg1 = (GDALTransformerInfoShadow *) 0 ;
  int arg2 ;
  double *arg3 ;
  double argin3[3] ;
  zval **args[3];
  int result;
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 3 || zend_get_parameters_array_ex(3, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*args[0], (void **) &arg1, SWIGTYPE_p_GDALTransformerInfoShadow, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of Transformer_TransformPoint. Expected SWIGTYPE_p_GDALTransformerInfoShadow");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  
  /*@SWIG:/usr/share/swig1.3/php/utils.i,7,CONVERT_INT_IN@*/
  convert_to_long_ex(args[1]);
  arg2 = (int) Z_LVAL_PP(args[1]);
  /*@SWIG@*/;
  
  {
    /* %typemap(in) (double argin3[ANY]) */
    arg3 = argin3;
    for (unsigned int i=0; i<3; i++) {
      double val = 0.0; /* extract val from i-th position of args[2] */
      arg3[i] =  val;
    }
  }
  result = (int)GDALTransformerInfoShadow_TransformPoint__SWIG_0(arg1,arg2,arg3);
  {
    ZVAL_LONG(return_value,result);
  }
  {
    /* %typemap(argout) (double argout[ANY]) */
    zval *t = CreateTupleFromDoubleArray( arg3, 3 );
    t_output_helper( &return_value, t );
  }
  return;
fail:
  zend_error_noreturn(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_Transformer_TransformPoint__SWIG_1) {
  GDALTransformerInfoShadow *arg1 = (GDALTransformerInfoShadow *) 0 ;
  double *arg2 ;
  int arg3 ;
  double arg4 ;
  double arg5 ;
  double arg6 = (double) 0.0 ;
  double argout2[3] ;
  zval **args[5];
  int arg_count;
  int result;
  
  {
    /* %typemap(in,numinputs=0) (double argout2[ANY]) */
    arg2 = argout2;
  }
  SWIG_ResetError();
  arg_count = ZEND_NUM_ARGS();
  if(arg_count<4 || arg_count>5 ||
    zend_get_parameters_array_ex(arg_count,args)!=SUCCESS)
  WRONG_PARAM_COUNT;
  
  {
    if(SWIG_ConvertPtr(*args[0], (void **) &arg1, SWIGTYPE_p_GDALTransformerInfoShadow, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of Transformer_TransformPoint. Expected SWIGTYPE_p_GDALTransformerInfoShadow");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  
  /*@SWIG:/usr/share/swig1.3/php/utils.i,7,CONVERT_INT_IN@*/
  convert_to_long_ex(args[1]);
  arg3 = (int) Z_LVAL_PP(args[1]);
  /*@SWIG@*/;
  
  
  /*@SWIG:/usr/share/swig1.3/php/utils.i,16,CONVERT_FLOAT_IN@*/
  convert_to_double_ex(args[2]);
  arg4 = (double) Z_DVAL_PP(args[2]);
  /*@SWIG@*/;
  
  
  /*@SWIG:/usr/share/swig1.3/php/utils.i,16,CONVERT_FLOAT_IN@*/
  convert_to_double_ex(args[3]);
  arg5 = (double) Z_DVAL_PP(args[3]);
  /*@SWIG@*/;
  
  if(arg_count > 4) {
    /*@SWIG:/usr/share/swig1.3/php/utils.i,16,CONVERT_FLOAT_IN@*/
    convert_to_double_ex(args[4]);
    arg6 = (double) Z_DVAL_PP(args[4]);
    /*@SWIG@*/;
    
  }
  result = (int)GDALTransformerInfoShadow_TransformPoint__SWIG_1(arg1,arg2,arg3,arg4,arg5,arg6);
  {
    ZVAL_LONG(return_value,result);
  }
  {
    /* %typemap(argout) (double argout[ANY]) */
    zval *t = CreateTupleFromDoubleArray( arg2, 3 );
    t_output_helper( &return_value, t );
  }
  return;
fail:
  zend_error_noreturn(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_Transformer_TransformPoint) {
  int argc;
  zval **argv[5];
  
  argc = ZEND_NUM_ARGS();
  zend_get_parameters_array_ex(argc,argv);
  if (argc == 3) {
    int _v;
    {
      void *tmp;
      _v = (SWIG_ConvertPtr(*argv[0], (void**)&tmp, SWIGTYPE_p_GDALTransformerInfoShadow, 0) >= 0);
    }
    if (_v) {
      _v = (Z_TYPE_PP(argv[1]) == IS_LONG); 
      if (_v) {
        {
          void *tmp;
          _v = (SWIG_ConvertPtr(*argv[2], (void**)&tmp, SWIGTYPE_p_double, 0) >= 0);
        }
        if (_v) {
          return _wrap_Transformer_TransformPoint__SWIG_0(INTERNAL_FUNCTION_PARAM_PASSTHRU);
        }
      }
    }
  }
  if ((argc >= 4) && (argc <= 5)) {
    int _v;
    {
      void *tmp;
      _v = (SWIG_ConvertPtr(*argv[0], (void**)&tmp, SWIGTYPE_p_GDALTransformerInfoShadow, 0) >= 0);
    }
    if (_v) {
      _v = (Z_TYPE_PP(argv[1]) == IS_LONG); 
      if (_v) {
        _v = (Z_TYPE_PP(argv[2]) == IS_DOUBLE); 
        if (_v) {
          _v = (Z_TYPE_PP(argv[3]) == IS_DOUBLE); 
          if (_v) {
            if (argc <= 4) {
              return _wrap_Transformer_TransformPoint__SWIG_1(INTERNAL_FUNCTION_PARAM_PASSTHRU);
            }
            _v = (Z_TYPE_PP(argv[4]) == IS_DOUBLE); 
            if (_v) {
              return _wrap_Transformer_TransformPoint__SWIG_1(INTERNAL_FUNCTION_PARAM_PASSTHRU);
            }
          }
        }
      }
    }
  }
  
  SWIG_ErrorCode() = E_ERROR;
  SWIG_ErrorMsg() = "No matching function for overloaded 'Transformer_TransformPoint'";
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_Transformer_TransformPoints) {
  GDALTransformerInfoShadow *arg1 = (GDALTransformerInfoShadow *) 0 ;
  int arg2 ;
  int arg3 ;
  double *arg4 = (double *) 0 ;
  double *arg5 = (double *) 0 ;
  double *arg6 = (double *) 0 ;
  int *arg7 = (int *) 0 ;
  zval **args[7];
  int result;
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 7 || zend_get_parameters_array_ex(7, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*args[0], (void **) &arg1, SWIGTYPE_p_GDALTransformerInfoShadow, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of Transformer_TransformPoints. Expected SWIGTYPE_p_GDALTransformerInfoShadow");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  
  /*@SWIG:/usr/share/swig1.3/php/utils.i,7,CONVERT_INT_IN@*/
  convert_to_long_ex(args[1]);
  arg2 = (int) Z_LVAL_PP(args[1]);
  /*@SWIG@*/;
  
  
  /*@SWIG:/usr/share/swig1.3/php/utils.i,7,CONVERT_INT_IN@*/
  convert_to_long_ex(args[2]);
  arg3 = (int) Z_LVAL_PP(args[2]);
  /*@SWIG@*/;
  
  {
    if(SWIG_ConvertPtr(*args[3], (void **) &arg4, SWIGTYPE_p_double, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 4 of Transformer_TransformPoints. Expected SWIGTYPE_p_double");
    }
  }
  {
    if(SWIG_ConvertPtr(*args[4], (void **) &arg5, SWIGTYPE_p_double, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 5 of Transformer_TransformPoints. Expected SWIGTYPE_p_double");
    }
  }
  {
    if(SWIG_ConvertPtr(*args[5], (void **) &arg6, SWIGTYPE_p_double, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 6 of Transformer_TransformPoints. Expected SWIGTYPE_p_double");
    }
  }
  {
    if(SWIG_ConvertPtr(*args[6], (void **) &arg7, SWIGTYPE_p_int, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 7 of Transformer_TransformPoints. Expected SWIGTYPE_p_int");
    }
  }
  result = (int)GDALTransformerInfoShadow_TransformPoints(arg1,arg2,arg3,arg4,arg5,arg6,arg7);
  {
    ZVAL_LONG(return_value,result);
  }
  return;
fail:
  zend_error_noreturn(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_ApplyGeoTransform) {
  double *arg1 ;
  double arg2 ;
  double arg3 ;
  double *arg4 = (double *) 0 ;
  double *arg5 = (double *) 0 ;
  double argin1[6] ;
  double temp4 ;
  double temp5 ;
  zval **args[3];
  
  arg4 = &temp4;
  arg5 = &temp5;
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 3 || zend_get_parameters_array_ex(3, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    /* %typemap(in) (double argin1[ANY]) */
    arg1 = argin1;
    for (unsigned int i=0; i<6; i++) {
      double val = 0.0; /* extract val from i-th position of args[0] */
      arg1[i] =  val;
    }
  }
  
  /*@SWIG:/usr/share/swig1.3/php/utils.i,16,CONVERT_FLOAT_IN@*/
  convert_to_double_ex(args[1]);
  arg2 = (double) Z_DVAL_PP(args[1]);
  /*@SWIG@*/;
  
  
  /*@SWIG:/usr/share/swig1.3/php/utils.i,16,CONVERT_FLOAT_IN@*/
  convert_to_double_ex(args[2]);
  arg3 = (double) Z_DVAL_PP(args[2]);
  /*@SWIG@*/;
  
  GDALApplyGeoTransform(arg1,arg2,arg3,arg4,arg5);
  
  {
    zval *o;
    MAKE_STD_ZVAL(o);
    ZVAL_DOUBLE(o,temp4);
    t_output_helper( &return_value, o );
  }
  {
    zval *o;
    MAKE_STD_ZVAL(o);
    ZVAL_DOUBLE(o,temp5);
    t_output_helper( &return_value, o );
  }
  return;
fail:
  zend_error_noreturn(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_InvGeoTransform) {
  double *arg1 ;
  double *arg2 ;
  double argin1[6] ;
  double argout2[6] ;
  zval **args[1];
  int result;
  
  {
    /* %typemap(in,numinputs=0) (double argout2[ANY]) */
    arg2 = argout2;
  }
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 1 || zend_get_parameters_array_ex(1, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    /* %typemap(in) (double argin1[ANY]) */
    arg1 = argin1;
    for (unsigned int i=0; i<6; i++) {
      double val = 0.0; /* extract val from i-th position of args[0] */
      arg1[i] =  val;
    }
  }
  result = (int)GDALInvGeoTransform(arg1,arg2);
  {
    ZVAL_LONG(return_value,result);
  }
  {
    /* %typemap(argout) (double argout[ANY]) */
    zval *t = CreateTupleFromDoubleArray( arg2, 6 );
    t_output_helper( &return_value, t );
  }
  return;
fail:
  zend_error_noreturn(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_VersionInfo) {
  char *arg1 = (char *) "VERSION_NUM" ;
  zval **args[1];
  int arg_count;
  char *result = 0 ;
  
  SWIG_ResetError();
  arg_count = ZEND_NUM_ARGS();
  if(arg_count<0 || arg_count>1 ||
    zend_get_parameters_array_ex(arg_count,args)!=SUCCESS)
  WRONG_PARAM_COUNT;
  
  if(arg_count > 0) {
    /*@SWIG:/usr/share/swig1.3/php/utils.i,26,CONVERT_STRING_IN@*/
    if ((*args[0])->type==IS_NULL) {
      arg1 = (char *) 0;
    } else {
      convert_to_string_ex(args[0]);
      arg1 = (char *) Z_STRVAL_PP(args[0]);
    }
    /*@SWIG@*/;
    
  }
  result = (char *)GDALVersionInfo((char const *)arg1);
  {
    if(!result) {
      ZVAL_NULL(return_value);
    } else {
      ZVAL_STRING(return_value, (char *)result, 1);
    }
  }
  return;
fail:
  zend_error_noreturn(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_AllRegister) {
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 0) {
    WRONG_PARAM_COUNT;
  }
  
  GDALAllRegister();
  
  return;
fail:
  zend_error_noreturn(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_GDALDestroyDriverManager) {
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 0) {
    WRONG_PARAM_COUNT;
  }
  
  GDALDestroyDriverManager();
  
  return;
fail:
  zend_error_noreturn(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_GetCacheMax) {
  int result;
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 0) {
    WRONG_PARAM_COUNT;
  }
  
  result = (int)wrapper_GDALGetCacheMax();
  {
    ZVAL_LONG(return_value,result);
  }
  return;
fail:
  zend_error_noreturn(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_GetCacheUsed) {
  int result;
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 0) {
    WRONG_PARAM_COUNT;
  }
  
  result = (int)wrapper_GDALGetCacheUsed();
  {
    ZVAL_LONG(return_value,result);
  }
  return;
fail:
  zend_error_noreturn(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_SetCacheMax) {
  int arg1 ;
  zval **args[1];
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 1 || zend_get_parameters_array_ex(1, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  
  /*@SWIG:/usr/share/swig1.3/php/utils.i,7,CONVERT_INT_IN@*/
  convert_to_long_ex(args[0]);
  arg1 = (int) Z_LVAL_PP(args[0]);
  /*@SWIG@*/;
  
  wrapper_GDALSetCacheMax(arg1);
  
  return;
fail:
  zend_error_noreturn(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_GetDataTypeSize) {
  GDALDataType arg1 ;
  zval **args[1];
  int result;
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 1 || zend_get_parameters_array_ex(1, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  
  /*@SWIG:/usr/share/swig1.3/php/utils.i,7,CONVERT_INT_IN@*/
  convert_to_long_ex(args[0]);
  arg1 = (GDALDataType) Z_LVAL_PP(args[0]);
  /*@SWIG@*/;
  
  result = (int)GDALGetDataTypeSize(arg1);
  {
    ZVAL_LONG(return_value,result);
  }
  return;
fail:
  zend_error_noreturn(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_DataTypeIsComplex) {
  GDALDataType arg1 ;
  zval **args[1];
  int result;
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 1 || zend_get_parameters_array_ex(1, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  
  /*@SWIG:/usr/share/swig1.3/php/utils.i,7,CONVERT_INT_IN@*/
  convert_to_long_ex(args[0]);
  arg1 = (GDALDataType) Z_LVAL_PP(args[0]);
  /*@SWIG@*/;
  
  result = (int)GDALDataTypeIsComplex(arg1);
  {
    ZVAL_LONG(return_value,result);
  }
  return;
fail:
  zend_error_noreturn(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_GetDataTypeName) {
  GDALDataType arg1 ;
  zval **args[1];
  char *result = 0 ;
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 1 || zend_get_parameters_array_ex(1, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  
  /*@SWIG:/usr/share/swig1.3/php/utils.i,7,CONVERT_INT_IN@*/
  convert_to_long_ex(args[0]);
  arg1 = (GDALDataType) Z_LVAL_PP(args[0]);
  /*@SWIG@*/;
  
  result = (char *)GDALGetDataTypeName(arg1);
  {
    if(!result) {
      ZVAL_NULL(return_value);
    } else {
      ZVAL_STRING(return_value, (char *)result, 1);
    }
  }
  return;
fail:
  zend_error_noreturn(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_GetDataTypeByName) {
  char *arg1 = (char *) 0 ;
  zval **args[1];
  GDALDataType result;
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 1 || zend_get_parameters_array_ex(1, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  
  /*@SWIG:/usr/share/swig1.3/php/utils.i,26,CONVERT_STRING_IN@*/
  if ((*args[0])->type==IS_NULL) {
    arg1 = (char *) 0;
  } else {
    convert_to_string_ex(args[0]);
    arg1 = (char *) Z_STRVAL_PP(args[0]);
  }
  /*@SWIG@*/;
  
  result = (GDALDataType)GDALGetDataTypeByName((char const *)arg1);
  {
    ZVAL_LONG(return_value,result);
  }
  return;
fail:
  zend_error_noreturn(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_GetColorInterpretationName) {
  GDALColorInterp arg1 ;
  zval **args[1];
  char *result = 0 ;
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 1 || zend_get_parameters_array_ex(1, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  
  /*@SWIG:/usr/share/swig1.3/php/utils.i,7,CONVERT_INT_IN@*/
  convert_to_long_ex(args[0]);
  arg1 = (GDALColorInterp) Z_LVAL_PP(args[0]);
  /*@SWIG@*/;
  
  result = (char *)GDALGetColorInterpretationName(arg1);
  {
    if(!result) {
      ZVAL_NULL(return_value);
    } else {
      ZVAL_STRING(return_value, (char *)result, 1);
    }
  }
  return;
fail:
  zend_error_noreturn(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_GetPaletteInterpretationName) {
  GDALPaletteInterp arg1 ;
  zval **args[1];
  char *result = 0 ;
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 1 || zend_get_parameters_array_ex(1, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  
  /*@SWIG:/usr/share/swig1.3/php/utils.i,7,CONVERT_INT_IN@*/
  convert_to_long_ex(args[0]);
  arg1 = (GDALPaletteInterp) Z_LVAL_PP(args[0]);
  /*@SWIG@*/;
  
  result = (char *)GDALGetPaletteInterpretationName(arg1);
  {
    if(!result) {
      ZVAL_NULL(return_value);
    } else {
      ZVAL_STRING(return_value, (char *)result, 1);
    }
  }
  return;
fail:
  zend_error_noreturn(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_DecToDMS) {
  double arg1 ;
  char *arg2 = (char *) 0 ;
  int arg3 = (int) 2 ;
  zval **args[3];
  int arg_count;
  char *result = 0 ;
  
  SWIG_ResetError();
  arg_count = ZEND_NUM_ARGS();
  if(arg_count<2 || arg_count>3 ||
    zend_get_parameters_array_ex(arg_count,args)!=SUCCESS)
  WRONG_PARAM_COUNT;
  
  
  /*@SWIG:/usr/share/swig1.3/php/utils.i,16,CONVERT_FLOAT_IN@*/
  convert_to_double_ex(args[0]);
  arg1 = (double) Z_DVAL_PP(args[0]);
  /*@SWIG@*/;
  
  
  /*@SWIG:/usr/share/swig1.3/php/utils.i,26,CONVERT_STRING_IN@*/
  if ((*args[1])->type==IS_NULL) {
    arg2 = (char *) 0;
  } else {
    convert_to_string_ex(args[1]);
    arg2 = (char *) Z_STRVAL_PP(args[1]);
  }
  /*@SWIG@*/;
  
  if(arg_count > 2) {
    /*@SWIG:/usr/share/swig1.3/php/utils.i,7,CONVERT_INT_IN@*/
    convert_to_long_ex(args[2]);
    arg3 = (int) Z_LVAL_PP(args[2]);
    /*@SWIG@*/;
    
  }
  result = (char *)GDALDecToDMS(arg1,(char const *)arg2,arg3);
  {
    if(!result) {
      ZVAL_NULL(return_value);
    } else {
      ZVAL_STRING(return_value, (char *)result, 1);
    }
  }
  return;
fail:
  zend_error_noreturn(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_PackedDMSToDec) {
  double arg1 ;
  zval **args[1];
  double result;
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 1 || zend_get_parameters_array_ex(1, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  
  /*@SWIG:/usr/share/swig1.3/php/utils.i,16,CONVERT_FLOAT_IN@*/
  convert_to_double_ex(args[0]);
  arg1 = (double) Z_DVAL_PP(args[0]);
  /*@SWIG@*/;
  
  result = (double)GDALPackedDMSToDec(arg1);
  {
    ZVAL_DOUBLE(return_value,result);
  }
  return;
fail:
  zend_error_noreturn(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_DecToPackedDMS) {
  double arg1 ;
  zval **args[1];
  double result;
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 1 || zend_get_parameters_array_ex(1, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  
  /*@SWIG:/usr/share/swig1.3/php/utils.i,16,CONVERT_FLOAT_IN@*/
  convert_to_double_ex(args[0]);
  arg1 = (double) Z_DVAL_PP(args[0]);
  /*@SWIG@*/;
  
  result = (double)GDALDecToPackedDMS(arg1);
  {
    ZVAL_DOUBLE(return_value,result);
  }
  return;
fail:
  zend_error_noreturn(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_ParseXMLString) {
  char *arg1 = (char *) 0 ;
  zval **args[1];
  CPLXMLNode *result = 0 ;
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 1 || zend_get_parameters_array_ex(1, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  
  /*@SWIG:/usr/share/swig1.3/php/utils.i,26,CONVERT_STRING_IN@*/
  if ((*args[0])->type==IS_NULL) {
    arg1 = (char *) 0;
  } else {
    convert_to_string_ex(args[0]);
    arg1 = (char *) Z_STRVAL_PP(args[0]);
  }
  /*@SWIG@*/;
  
  result = (CPLXMLNode *)CPLParseXMLString(arg1);
  
  SWIG_SetPointerZval(return_value, (void *)result, SWIGTYPE_p_CPLXMLNode, 0);
  
  return;
fail:
  zend_error_noreturn(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_SerializeXMLTree) {
  CPLXMLNode *arg1 = (CPLXMLNode *) 0 ;
  zval **args[1];
  char *result = 0 ;
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 1 || zend_get_parameters_array_ex(1, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*args[0], (void **) &arg1, SWIGTYPE_p_CPLXMLNode, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of SerializeXMLTree. Expected SWIGTYPE_p_CPLXMLNode");
    }
  }
  result = (char *)CPLSerializeXMLTree(arg1);
  {
    if(!result) {
      ZVAL_NULL(return_value);
    } else {
      ZVAL_STRING(return_value, (char *)result, 1);
    }
  }
  return;
fail:
  zend_error_noreturn(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_GetDriverCount) {
  int result;
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 0) {
    WRONG_PARAM_COUNT;
  }
  
  result = (int)GetDriverCount();
  {
    ZVAL_LONG(return_value,result);
  }
  return;
fail:
  zend_error_noreturn(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_GetDriverByName) {
  char *arg1 = (char *) 0 ;
  zval **args[1];
  GDALDriverShadow *result = 0 ;
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 1 || zend_get_parameters_array_ex(1, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  
  /*@SWIG:/usr/share/swig1.3/php/utils.i,26,CONVERT_STRING_IN@*/
  if ((*args[0])->type==IS_NULL) {
    arg1 = (char *) 0;
  } else {
    convert_to_string_ex(args[0]);
    arg1 = (char *) Z_STRVAL_PP(args[0]);
  }
  /*@SWIG@*/;
  
  {
    if (!arg1) {
      SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
    }
  }
  result = (GDALDriverShadow *)GetDriverByName((char const *)arg1);
  
  SWIG_SetPointerZval(return_value, (void *)result, SWIGTYPE_p_GDALDriverShadow, 0);
  
  return;
fail:
  zend_error_noreturn(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_GetDriver) {
  int arg1 ;
  zval **args[1];
  GDALDriverShadow *result = 0 ;
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 1 || zend_get_parameters_array_ex(1, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  
  /*@SWIG:/usr/share/swig1.3/php/utils.i,7,CONVERT_INT_IN@*/
  convert_to_long_ex(args[0]);
  arg1 = (int) Z_LVAL_PP(args[0]);
  /*@SWIG@*/;
  
  result = (GDALDriverShadow *)GetDriver(arg1);
  
  SWIG_SetPointerZval(return_value, (void *)result, SWIGTYPE_p_GDALDriverShadow, 0);
  
  return;
fail:
  zend_error_noreturn(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_Open) {
  char *arg1 = (char *) 0 ;
  GDALAccess arg2 = (GDALAccess) GA_ReadOnly ;
  zval **args[2];
  int arg_count;
  GDALDatasetShadow *result = 0 ;
  
  SWIG_ResetError();
  arg_count = ZEND_NUM_ARGS();
  if(arg_count<1 || arg_count>2 ||
    zend_get_parameters_array_ex(arg_count,args)!=SUCCESS)
  WRONG_PARAM_COUNT;
  
  
  /*@SWIG:/usr/share/swig1.3/php/utils.i,26,CONVERT_STRING_IN@*/
  if ((*args[0])->type==IS_NULL) {
    arg1 = (char *) 0;
  } else {
    convert_to_string_ex(args[0]);
    arg1 = (char *) Z_STRVAL_PP(args[0]);
  }
  /*@SWIG@*/;
  
  if(arg_count > 1) {
    /*@SWIG:/usr/share/swig1.3/php/utils.i,7,CONVERT_INT_IN@*/
    convert_to_long_ex(args[1]);
    arg2 = (GDALAccess) Z_LVAL_PP(args[1]);
    /*@SWIG@*/;
    
  }
  result = (GDALDatasetShadow *)Open((char const *)arg1,arg2);
  
  SWIG_SetPointerZval(return_value, (void *)result, SWIGTYPE_p_GDALDatasetShadow, 1);
  
  return;
fail:
  zend_error_noreturn(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_OpenShared) {
  char *arg1 = (char *) 0 ;
  GDALAccess arg2 = (GDALAccess) GA_ReadOnly ;
  zval **args[2];
  int arg_count;
  GDALDatasetShadow *result = 0 ;
  
  SWIG_ResetError();
  arg_count = ZEND_NUM_ARGS();
  if(arg_count<1 || arg_count>2 ||
    zend_get_parameters_array_ex(arg_count,args)!=SUCCESS)
  WRONG_PARAM_COUNT;
  
  
  /*@SWIG:/usr/share/swig1.3/php/utils.i,26,CONVERT_STRING_IN@*/
  if ((*args[0])->type==IS_NULL) {
    arg1 = (char *) 0;
  } else {
    convert_to_string_ex(args[0]);
    arg1 = (char *) Z_STRVAL_PP(args[0]);
  }
  /*@SWIG@*/;
  
  if(arg_count > 1) {
    /*@SWIG:/usr/share/swig1.3/php/utils.i,7,CONVERT_INT_IN@*/
    convert_to_long_ex(args[1]);
    arg2 = (GDALAccess) Z_LVAL_PP(args[1]);
    /*@SWIG@*/;
    
  }
  result = (GDALDatasetShadow *)OpenShared((char const *)arg1,arg2);
  
  SWIG_SetPointerZval(return_value, (void *)result, SWIGTYPE_p_GDALDatasetShadow, 1);
  
  return;
fail:
  zend_error_noreturn(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_IdentifyDriver) {
  char *arg1 = (char *) 0 ;
  char **arg2 = (char **) NULL ;
  zval **args[2];
  int arg_count;
  GDALDriverShadow *result = 0 ;
  
  SWIG_ResetError();
  arg_count = ZEND_NUM_ARGS();
  if(arg_count<1 || arg_count>2 ||
    zend_get_parameters_array_ex(arg_count,args)!=SUCCESS)
  WRONG_PARAM_COUNT;
  
  
  /*@SWIG:/usr/share/swig1.3/php/utils.i,26,CONVERT_STRING_IN@*/
  if ((*args[0])->type==IS_NULL) {
    arg1 = (char *) 0;
  } else {
    convert_to_string_ex(args[0]);
    arg1 = (char *) Z_STRVAL_PP(args[0]);
  }
  /*@SWIG@*/;
  
  if(arg_count > 1) {
    {
      /* %typemap(in) char **options */
      zend_error(E_ERROR,"Typemap (in) char **options not properly defined");
      //  int size = PySequence_Size(args[1]);
      //  for (int i = 0; i < size; i++) {
      //    char *pszItem = NULL;
      //    if ( ! PyArg_Parse( PySequence_GetItem(args[1],i), "s", &pszItem ) ) {
      //      PyErr_SetString(PyExc_TypeError,"sequence must contain strings");
      //      SWIG_fail;
      //    }
      //    arg2 = CSLAddString( arg2, pszItem );
      //  }
    }
  }
  result = (GDALDriverShadow *)IdentifyDriver((char const *)arg1,arg2);
  
  SWIG_SetPointerZval(return_value, (void *)result, SWIGTYPE_p_GDALDriverShadow, 0);
  
  {
    /* %typemap(freearg) char **options */
    CSLDestroy( arg2 );
  }
  return;
fail:
  {
    /* %typemap(freearg) char **options */
    CSLDestroy( arg2 );
  }
  zend_error_noreturn(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_GeneralCmdLineProcessor) {
  char **arg1 = (char **) 0 ;
  int arg2 = (int) 0 ;
  zval **args[2];
  int arg_count;
  char **result = 0 ;
  
  SWIG_ResetError();
  arg_count = ZEND_NUM_ARGS();
  if(arg_count<1 || arg_count>2 ||
    zend_get_parameters_array_ex(arg_count,args)!=SUCCESS)
  WRONG_PARAM_COUNT;
  
  {
    /* %typemap(in) char **options */
    zend_error(E_ERROR,"Typemap (in) char **options not properly defined");
    //  int size = PySequence_Size(args[0]);
    //  for (int i = 0; i < size; i++) {
    //    char *pszItem = NULL;
    //    if ( ! PyArg_Parse( PySequence_GetItem(args[0],i), "s", &pszItem ) ) {
    //      PyErr_SetString(PyExc_TypeError,"sequence must contain strings");
    //      SWIG_fail;
    //    }
    //    arg1 = CSLAddString( arg1, pszItem );
    //  }
  }
  if(arg_count > 1) {
    /*@SWIG:/usr/share/swig1.3/php/utils.i,7,CONVERT_INT_IN@*/
    convert_to_long_ex(args[1]);
    arg2 = (int) Z_LVAL_PP(args[1]);
    /*@SWIG@*/;
    
  }
  result = (char **)GeneralCmdLineProcessor(arg1,arg2);
  {
    /* %typemap(out) char ** -> ( string ) */
    char **stringarray = result;
    if ( stringarray == NULL ) {
      RETVAL_NULL();
    }
    else {
      int len = CSLCount( stringarray );
      array_init(return_value);
      for ( int i = 0; i < len; ++i, ++stringarray ) {
        add_next_index_string( return_value, *stringarray, 1 );
      }
    }
  }
  {
    /* %typemap(freearg) char **options */
    CSLDestroy( arg1 );
  }
  return;
fail:
  {
    /* %typemap(freearg) char **options */
    CSLDestroy( arg1 );
  }
  zend_error_noreturn(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


static ZEND_RSRC_DTOR_FUNC(_wrap_destroy_p_double) {
  /* No destructor for simple type _p_double */
  efree(rsrc->ptr);
}
static ZEND_RSRC_DTOR_FUNC(_wrap_destroy_p_GByte) {
  /* No destructor for simple type _p_GByte */
  efree(rsrc->ptr);
}
static ZEND_RSRC_DTOR_FUNC(_wrap_destroy_p_GDALColorEntry) {
  __wrap_delete_ColorEntry(rsrc, SWIGTYPE_p_GDALColorEntry->name TSRMLS_CC);
}
static ZEND_RSRC_DTOR_FUNC(_wrap_destroy_p_p_void) {
  /* No destructor for simple type _p_p_void */
  efree(rsrc->ptr);
}
static ZEND_RSRC_DTOR_FUNC(_wrap_destroy_p_void) {
  /* No destructor for simple type _p_void */
  efree(rsrc->ptr);
}
static ZEND_RSRC_DTOR_FUNC(_wrap_destroy_p_p_char) {
  /* No destructor for simple type _p_p_char */
  efree(rsrc->ptr);
}
static ZEND_RSRC_DTOR_FUNC(_wrap_destroy_p_char) {
  /* No destructor for simple type _p_char */
  efree(rsrc->ptr);
}
static ZEND_RSRC_DTOR_FUNC(_wrap_destroy_p_GDAL_GCP) {
  __wrap_delete_GCP(rsrc, SWIGTYPE_p_GDAL_GCP->name TSRMLS_CC);
}
static ZEND_RSRC_DTOR_FUNC(_wrap_destroy_p_p_GDAL_GCP) {
  /* No destructor for simple type _p_p_GDAL_GCP */
  efree(rsrc->ptr);
}
static ZEND_RSRC_DTOR_FUNC(_wrap_destroy_p_CPLErrorHandler) {
  /* No destructor for simple type _p_CPLErrorHandler */
  efree(rsrc->ptr);
}
static ZEND_RSRC_DTOR_FUNC(_wrap_destroy_p_CPLXMLNode) {
  /* No destructor for simple type _p_CPLXMLNode */
  efree(rsrc->ptr);
}
static ZEND_RSRC_DTOR_FUNC(_wrap_destroy_p_GDALColorTableShadow) {
  __wrap_delete_ColorTable(rsrc, SWIGTYPE_p_GDALColorTableShadow->name TSRMLS_CC);
}
static ZEND_RSRC_DTOR_FUNC(_wrap_destroy_p_GDALRasterAttributeTableShadow) {
  __wrap_delete_RasterAttributeTable(rsrc, SWIGTYPE_p_GDALRasterAttributeTableShadow->name TSRMLS_CC);
}
static ZEND_RSRC_DTOR_FUNC(_wrap_destroy_p_GDALTransformerInfoShadow) {
  __wrap_delete_Transformer(rsrc, SWIGTYPE_p_GDALTransformerInfoShadow->name TSRMLS_CC);
}
static ZEND_RSRC_DTOR_FUNC(_wrap_destroy_p_f_double_p_q_const__char_p_void__int) {
  /* No destructor for simple type _p_f_double_p_q_const__char_p_void__int */
  efree(rsrc->ptr);
}
static ZEND_RSRC_DTOR_FUNC(_wrap_destroy_p_int) {
  /* No destructor for simple type _p_int */
  efree(rsrc->ptr);
}
static ZEND_RSRC_DTOR_FUNC(_wrap_destroy_p_GDALDatasetShadow) {
  __wrap_delete_Dataset(rsrc, SWIGTYPE_p_GDALDatasetShadow->name TSRMLS_CC);
}
static ZEND_RSRC_DTOR_FUNC(_wrap_destroy_p_GDALDriverShadow) {
  /* No destructor for class Driver */
  efree(rsrc->ptr);
}
static ZEND_RSRC_DTOR_FUNC(_wrap_destroy_p_GDALMajorObjectShadow) {
  /* No destructor for class MajorObject */
  efree(rsrc->ptr);
}
static ZEND_RSRC_DTOR_FUNC(_wrap_destroy_p_GDALProgressFunc) {
  /* No destructor for simple type _p_GDALProgressFunc */
  efree(rsrc->ptr);
}
static ZEND_RSRC_DTOR_FUNC(_wrap_destroy_p_GDALAsyncReaderShadow) {
  __wrap_delete_AsyncReader(rsrc, SWIGTYPE_p_GDALAsyncReaderShadow->name TSRMLS_CC);
}
static ZEND_RSRC_DTOR_FUNC(_wrap_destroy_p_GDALRasterBandShadow) {
  /* No destructor for class Band */
  efree(rsrc->ptr);
}
static ZEND_RSRC_DTOR_FUNC(_wrap_destroy_p_p_int) {
  /* No destructor for simple type _p_p_int */
  efree(rsrc->ptr);
}
static ZEND_RSRC_DTOR_FUNC(_wrap_destroy_p_OGRLayerShadow) {
  /* No destructor for simple type _p_OGRLayerShadow */
  efree(rsrc->ptr);
}
static ZEND_RSRC_DTOR_FUNC(_wrap_destroy_p_p_GDALRasterBandShadow) {
  /* No destructor for simple type _p_p_GDALRasterBandShadow */
  efree(rsrc->ptr);
}
/* end wrapper section */
/* class entry subsection */


/* entry subsection */
/* Every non-class user visible function must have an entry here */
static zend_function_entry gdal_functions[] = {
 SWIG_ZEND_NAMED_FE(debug,_wrap_Debug,NULL)
 SWIG_ZEND_NAMED_FE(error,_wrap_Error,NULL)
 SWIG_ZEND_NAMED_FE(pusherrorhandler,_wrap_PushErrorHandler,NULL)
 SWIG_ZEND_NAMED_FE(poperrorhandler,_wrap_PopErrorHandler,NULL)
 SWIG_ZEND_NAMED_FE(errorreset,_wrap_ErrorReset,NULL)
 SWIG_ZEND_NAMED_FE(escapestring,_wrap_EscapeString,NULL)
 SWIG_ZEND_NAMED_FE(getlasterrorno,_wrap_GetLastErrorNo,NULL)
 SWIG_ZEND_NAMED_FE(getlasterrortype,_wrap_GetLastErrorType,NULL)
 SWIG_ZEND_NAMED_FE(getlasterrormsg,_wrap_GetLastErrorMsg,NULL)
 SWIG_ZEND_NAMED_FE(pushfinderlocation,_wrap_PushFinderLocation,NULL)
 SWIG_ZEND_NAMED_FE(popfinderlocation,_wrap_PopFinderLocation,NULL)
 SWIG_ZEND_NAMED_FE(finderclean,_wrap_FinderClean,NULL)
 SWIG_ZEND_NAMED_FE(findfile,_wrap_FindFile,NULL)
 SWIG_ZEND_NAMED_FE(readdir,_wrap_ReadDir,NULL)
 SWIG_ZEND_NAMED_FE(setconfigoption,_wrap_SetConfigOption,NULL)
 SWIG_ZEND_NAMED_FE(getconfigoption,_wrap_GetConfigOption,NULL)
 SWIG_ZEND_NAMED_FE(cplbinarytohex,_wrap_CPLBinaryToHex,NULL)
 SWIG_ZEND_NAMED_FE(cplhextobinary,_wrap_CPLHexToBinary,NULL)
 SWIG_ZEND_NAMED_FE(filefrommembuffer,_wrap_FileFromMemBuffer,NULL)
 SWIG_ZEND_NAMED_FE(unlink,_wrap_Unlink,NULL)
 SWIG_ZEND_NAMED_FE(hasthreadsupport,_wrap_HasThreadSupport,NULL)
 SWIG_ZEND_NAMED_FE(mkdir,_wrap_Mkdir,NULL)
 SWIG_ZEND_NAMED_FE(rmdir,_wrap_Rmdir,NULL)
 SWIG_ZEND_NAMED_FE(rename,_wrap_Rename,NULL)
 SWIG_ZEND_NAMED_FE(vsifopenl,_wrap_VSIFOpenL,NULL)
 SWIG_ZEND_NAMED_FE(vsifclosel,_wrap_VSIFCloseL,NULL)
 SWIG_ZEND_NAMED_FE(vsifseekl,_wrap_VSIFSeekL,NULL)
 SWIG_ZEND_NAMED_FE(vsiftelll,_wrap_VSIFTellL,NULL)
 SWIG_ZEND_NAMED_FE(vsifwritel,_wrap_VSIFWriteL,NULL)
 SWIG_ZEND_NAMED_FE(majorobject_getdescription,_wrap_MajorObject_GetDescription,NULL)
 SWIG_ZEND_NAMED_FE(majorobject_setdescription,_wrap_MajorObject_SetDescription,NULL)
 SWIG_ZEND_NAMED_FE(majorobject_getmetadata_dict,_wrap_MajorObject_GetMetadata_Dict,NULL)
 SWIG_ZEND_NAMED_FE(majorobject_getmetadata_list,_wrap_MajorObject_GetMetadata_List,NULL)
 SWIG_ZEND_NAMED_FE(majorobject_setmetadata,_wrap_MajorObject_SetMetadata,NULL)
 SWIG_ZEND_NAMED_FE(majorobject_getmetadataitem,_wrap_MajorObject_GetMetadataItem,NULL)
 SWIG_ZEND_NAMED_FE(majorobject_setmetadataitem,_wrap_MajorObject_SetMetadataItem,NULL)
 SWIG_ZEND_NAMED_FE(driver_shortname_get,_wrap_Driver_ShortName_get,NULL)
 SWIG_ZEND_NAMED_FE(driver_longname_get,_wrap_Driver_LongName_get,NULL)
 SWIG_ZEND_NAMED_FE(driver_helptopic_get,_wrap_Driver_HelpTopic_get,NULL)
 SWIG_ZEND_NAMED_FE(driver_create,_wrap_Driver_Create,NULL)
 SWIG_ZEND_NAMED_FE(driver_createcopy,_wrap_Driver_CreateCopy,NULL)
 SWIG_ZEND_NAMED_FE(driver_delete,_wrap_Driver_Delete,NULL)
 SWIG_ZEND_NAMED_FE(driver_rename,_wrap_Driver_Rename,NULL)
 SWIG_ZEND_NAMED_FE(driver_register,_wrap_Driver_Register,NULL)
 SWIG_ZEND_NAMED_FE(driver_deregister,_wrap_Driver_Deregister,NULL)
 SWIG_ZEND_NAMED_FE(colorentry_c1_set,_wrap_ColorEntry_c1_set,NULL)
 SWIG_ZEND_NAMED_FE(colorentry_c1_get,_wrap_ColorEntry_c1_get,NULL)
 SWIG_ZEND_NAMED_FE(colorentry_c2_set,_wrap_ColorEntry_c2_set,NULL)
 SWIG_ZEND_NAMED_FE(colorentry_c2_get,_wrap_ColorEntry_c2_get,NULL)
 SWIG_ZEND_NAMED_FE(colorentry_c3_set,_wrap_ColorEntry_c3_set,NULL)
 SWIG_ZEND_NAMED_FE(colorentry_c3_get,_wrap_ColorEntry_c3_get,NULL)
 SWIG_ZEND_NAMED_FE(colorentry_c4_set,_wrap_ColorEntry_c4_set,NULL)
 SWIG_ZEND_NAMED_FE(colorentry_c4_get,_wrap_ColorEntry_c4_get,NULL)
 SWIG_ZEND_NAMED_FE(new_colorentry,_wrap_new_ColorEntry,NULL)
 SWIG_ZEND_NAMED_FE(gcp_gcpx_set,_wrap_GCP_GCPX_set,NULL)
 SWIG_ZEND_NAMED_FE(gcp_gcpx_get,_wrap_GCP_GCPX_get,NULL)
 SWIG_ZEND_NAMED_FE(gcp_gcpy_set,_wrap_GCP_GCPY_set,NULL)
 SWIG_ZEND_NAMED_FE(gcp_gcpy_get,_wrap_GCP_GCPY_get,NULL)
 SWIG_ZEND_NAMED_FE(gcp_gcpz_set,_wrap_GCP_GCPZ_set,NULL)
 SWIG_ZEND_NAMED_FE(gcp_gcpz_get,_wrap_GCP_GCPZ_get,NULL)
 SWIG_ZEND_NAMED_FE(gcp_gcppixel_set,_wrap_GCP_GCPPixel_set,NULL)
 SWIG_ZEND_NAMED_FE(gcp_gcppixel_get,_wrap_GCP_GCPPixel_get,NULL)
 SWIG_ZEND_NAMED_FE(gcp_gcpline_set,_wrap_GCP_GCPLine_set,NULL)
 SWIG_ZEND_NAMED_FE(gcp_gcpline_get,_wrap_GCP_GCPLine_get,NULL)
 SWIG_ZEND_NAMED_FE(gcp_info_set,_wrap_GCP_Info_set,NULL)
 SWIG_ZEND_NAMED_FE(gcp_info_get,_wrap_GCP_Info_get,NULL)
 SWIG_ZEND_NAMED_FE(gcp_id_set,_wrap_GCP_Id_set,NULL)
 SWIG_ZEND_NAMED_FE(gcp_id_get,_wrap_GCP_Id_get,NULL)
 SWIG_ZEND_NAMED_FE(new_gcp,_wrap_new_GCP,NULL)
 SWIG_ZEND_NAMED_FE(gdal_gcp_gcpx_get,_wrap_GDAL_GCP_GCPX_get,NULL)
 SWIG_ZEND_NAMED_FE(gdal_gcp_gcpx_set,_wrap_GDAL_GCP_GCPX_set,NULL)
 SWIG_ZEND_NAMED_FE(gdal_gcp_gcpy_get,_wrap_GDAL_GCP_GCPY_get,NULL)
 SWIG_ZEND_NAMED_FE(gdal_gcp_gcpy_set,_wrap_GDAL_GCP_GCPY_set,NULL)
 SWIG_ZEND_NAMED_FE(gdal_gcp_gcpz_get,_wrap_GDAL_GCP_GCPZ_get,NULL)
 SWIG_ZEND_NAMED_FE(gdal_gcp_gcpz_set,_wrap_GDAL_GCP_GCPZ_set,NULL)
 SWIG_ZEND_NAMED_FE(gdal_gcp_gcppixel_get,_wrap_GDAL_GCP_GCPPixel_get,NULL)
 SWIG_ZEND_NAMED_FE(gdal_gcp_gcppixel_set,_wrap_GDAL_GCP_GCPPixel_set,NULL)
 SWIG_ZEND_NAMED_FE(gdal_gcp_gcpline_get,_wrap_GDAL_GCP_GCPLine_get,NULL)
 SWIG_ZEND_NAMED_FE(gdal_gcp_gcpline_set,_wrap_GDAL_GCP_GCPLine_set,NULL)
 SWIG_ZEND_NAMED_FE(gdal_gcp_info_get,_wrap_GDAL_GCP_Info_get,NULL)
 SWIG_ZEND_NAMED_FE(gdal_gcp_info_set,_wrap_GDAL_GCP_Info_set,NULL)
 SWIG_ZEND_NAMED_FE(gdal_gcp_id_get,_wrap_GDAL_GCP_Id_get,NULL)
 SWIG_ZEND_NAMED_FE(gdal_gcp_id_set,_wrap_GDAL_GCP_Id_set,NULL)
 SWIG_ZEND_NAMED_FE(gdal_gcp_get_gcpx,_wrap_GDAL_GCP_get_GCPX,NULL)
 SWIG_ZEND_NAMED_FE(gdal_gcp_set_gcpx,_wrap_GDAL_GCP_set_GCPX,NULL)
 SWIG_ZEND_NAMED_FE(gdal_gcp_get_gcpy,_wrap_GDAL_GCP_get_GCPY,NULL)
 SWIG_ZEND_NAMED_FE(gdal_gcp_set_gcpy,_wrap_GDAL_GCP_set_GCPY,NULL)
 SWIG_ZEND_NAMED_FE(gdal_gcp_get_gcpz,_wrap_GDAL_GCP_get_GCPZ,NULL)
 SWIG_ZEND_NAMED_FE(gdal_gcp_set_gcpz,_wrap_GDAL_GCP_set_GCPZ,NULL)
 SWIG_ZEND_NAMED_FE(gdal_gcp_get_gcppixel,_wrap_GDAL_GCP_get_GCPPixel,NULL)
 SWIG_ZEND_NAMED_FE(gdal_gcp_set_gcppixel,_wrap_GDAL_GCP_set_GCPPixel,NULL)
 SWIG_ZEND_NAMED_FE(gdal_gcp_get_gcpline,_wrap_GDAL_GCP_get_GCPLine,NULL)
 SWIG_ZEND_NAMED_FE(gdal_gcp_set_gcpline,_wrap_GDAL_GCP_set_GCPLine,NULL)
 SWIG_ZEND_NAMED_FE(gdal_gcp_get_info,_wrap_GDAL_GCP_get_Info,NULL)
 SWIG_ZEND_NAMED_FE(gdal_gcp_set_info,_wrap_GDAL_GCP_set_Info,NULL)
 SWIG_ZEND_NAMED_FE(gdal_gcp_get_id,_wrap_GDAL_GCP_get_Id,NULL)
 SWIG_ZEND_NAMED_FE(gdal_gcp_set_id,_wrap_GDAL_GCP_set_Id,NULL)
 SWIG_ZEND_NAMED_FE(gcpstogeotransform,_wrap_GCPsToGeoTransform,NULL)
 SWIG_ZEND_NAMED_FE(asyncreader_getnextupdatedregion,_wrap_AsyncReader_GetNextUpdatedRegion,NULL)
 SWIG_ZEND_NAMED_FE(asyncreader_lockbuffer,_wrap_AsyncReader_LockBuffer,NULL)
 SWIG_ZEND_NAMED_FE(asyncreader_unlockbuffer,_wrap_AsyncReader_UnlockBuffer,NULL)
 SWIG_ZEND_NAMED_FE(dataset_rasterxsize_get,_wrap_Dataset_RasterXSize_get,NULL)
 SWIG_ZEND_NAMED_FE(dataset_rasterysize_get,_wrap_Dataset_RasterYSize_get,NULL)
 SWIG_ZEND_NAMED_FE(dataset_rastercount_get,_wrap_Dataset_RasterCount_get,NULL)
 SWIG_ZEND_NAMED_FE(dataset_getdriver,_wrap_Dataset_GetDriver,NULL)
 SWIG_ZEND_NAMED_FE(dataset_getrasterband,_wrap_Dataset_GetRasterBand,NULL)
 SWIG_ZEND_NAMED_FE(dataset_getprojection,_wrap_Dataset_GetProjection,NULL)
 SWIG_ZEND_NAMED_FE(dataset_getprojectionref,_wrap_Dataset_GetProjectionRef,NULL)
 SWIG_ZEND_NAMED_FE(dataset_setprojection,_wrap_Dataset_SetProjection,NULL)
 SWIG_ZEND_NAMED_FE(dataset_getgeotransform,_wrap_Dataset_GetGeoTransform,NULL)
 SWIG_ZEND_NAMED_FE(dataset_setgeotransform,_wrap_Dataset_SetGeoTransform,NULL)
 SWIG_ZEND_NAMED_FE(dataset_buildoverviews,_wrap_Dataset_BuildOverviews,NULL)
 SWIG_ZEND_NAMED_FE(dataset_getgcpcount,_wrap_Dataset_GetGCPCount,NULL)
 SWIG_ZEND_NAMED_FE(dataset_getgcpprojection,_wrap_Dataset_GetGCPProjection,NULL)
 SWIG_ZEND_NAMED_FE(dataset_getgcps,_wrap_Dataset_GetGCPs,NULL)
 SWIG_ZEND_NAMED_FE(dataset_setgcps,_wrap_Dataset_SetGCPs,NULL)
 SWIG_ZEND_NAMED_FE(dataset_flushcache,_wrap_Dataset_FlushCache,NULL)
 SWIG_ZEND_NAMED_FE(dataset_addband,_wrap_Dataset_AddBand,NULL)
 SWIG_ZEND_NAMED_FE(dataset_createmaskband,_wrap_Dataset_CreateMaskBand,NULL)
 SWIG_ZEND_NAMED_FE(dataset_getfilelist,_wrap_Dataset_GetFileList,NULL)
 SWIG_ZEND_NAMED_FE(dataset_writeraster,_wrap_Dataset_WriteRaster,NULL)
 SWIG_ZEND_NAMED_FE(dataset_readraster,_wrap_Dataset_ReadRaster,NULL)
 SWIG_ZEND_NAMED_FE(band_xsize_get,_wrap_Band_XSize_get,NULL)
 SWIG_ZEND_NAMED_FE(band_ysize_get,_wrap_Band_YSize_get,NULL)
 SWIG_ZEND_NAMED_FE(band_datatype_get,_wrap_Band_DataType_get,NULL)
 SWIG_ZEND_NAMED_FE(band_getband,_wrap_Band_GetBand,NULL)
 SWIG_ZEND_NAMED_FE(band_getblocksize,_wrap_Band_GetBlockSize,NULL)
 SWIG_ZEND_NAMED_FE(band_getcolorinterpretation,_wrap_Band_GetColorInterpretation,NULL)
 SWIG_ZEND_NAMED_FE(band_getrastercolorinterpretation,_wrap_Band_GetRasterColorInterpretation,NULL)
 SWIG_ZEND_NAMED_FE(band_setcolorinterpretation,_wrap_Band_SetColorInterpretation,NULL)
 SWIG_ZEND_NAMED_FE(band_setrastercolorinterpretation,_wrap_Band_SetRasterColorInterpretation,NULL)
 SWIG_ZEND_NAMED_FE(band_getnodatavalue,_wrap_Band_GetNoDataValue,NULL)
 SWIG_ZEND_NAMED_FE(band_setnodatavalue,_wrap_Band_SetNoDataValue,NULL)
 SWIG_ZEND_NAMED_FE(band_getunittype,_wrap_Band_GetUnitType,NULL)
 SWIG_ZEND_NAMED_FE(band_setunittype,_wrap_Band_SetUnitType,NULL)
 SWIG_ZEND_NAMED_FE(band_getrastercategorynames,_wrap_Band_GetRasterCategoryNames,NULL)
 SWIG_ZEND_NAMED_FE(band_setrastercategorynames,_wrap_Band_SetRasterCategoryNames,NULL)
 SWIG_ZEND_NAMED_FE(band_getminimum,_wrap_Band_GetMinimum,NULL)
 SWIG_ZEND_NAMED_FE(band_getmaximum,_wrap_Band_GetMaximum,NULL)
 SWIG_ZEND_NAMED_FE(band_getoffset,_wrap_Band_GetOffset,NULL)
 SWIG_ZEND_NAMED_FE(band_getscale,_wrap_Band_GetScale,NULL)
 SWIG_ZEND_NAMED_FE(band_setoffset,_wrap_Band_SetOffset,NULL)
 SWIG_ZEND_NAMED_FE(band_setscale,_wrap_Band_SetScale,NULL)
 SWIG_ZEND_NAMED_FE(band_getstatistics,_wrap_Band_GetStatistics,NULL)
 SWIG_ZEND_NAMED_FE(band_computestatistics,_wrap_Band_ComputeStatistics,NULL)
 SWIG_ZEND_NAMED_FE(band_setstatistics,_wrap_Band_SetStatistics,NULL)
 SWIG_ZEND_NAMED_FE(band_getoverviewcount,_wrap_Band_GetOverviewCount,NULL)
 SWIG_ZEND_NAMED_FE(band_getoverview,_wrap_Band_GetOverview,NULL)
 SWIG_ZEND_NAMED_FE(band_checksum,_wrap_Band_Checksum,NULL)
 SWIG_ZEND_NAMED_FE(band_computerasterminmax,_wrap_Band_ComputeRasterMinMax,NULL)
 SWIG_ZEND_NAMED_FE(band_computebandstats,_wrap_Band_ComputeBandStats,NULL)
 SWIG_ZEND_NAMED_FE(band_fill,_wrap_Band_Fill,NULL)
 SWIG_ZEND_NAMED_FE(band_readraster,_wrap_Band_ReadRaster,NULL)
 SWIG_ZEND_NAMED_FE(band_writeraster,_wrap_Band_WriteRaster,NULL)
 SWIG_ZEND_NAMED_FE(band_flushcache,_wrap_Band_FlushCache,NULL)
 SWIG_ZEND_NAMED_FE(band_getrastercolortable,_wrap_Band_GetRasterColorTable,NULL)
 SWIG_ZEND_NAMED_FE(band_getcolortable,_wrap_Band_GetColorTable,NULL)
 SWIG_ZEND_NAMED_FE(band_setrastercolortable,_wrap_Band_SetRasterColorTable,NULL)
 SWIG_ZEND_NAMED_FE(band_setcolortable,_wrap_Band_SetColorTable,NULL)
 SWIG_ZEND_NAMED_FE(band_getdefaultrat,_wrap_Band_GetDefaultRAT,NULL)
 SWIG_ZEND_NAMED_FE(band_setdefaultrat,_wrap_Band_SetDefaultRAT,NULL)
 SWIG_ZEND_NAMED_FE(band_getmaskband,_wrap_Band_GetMaskBand,NULL)
 SWIG_ZEND_NAMED_FE(band_getmaskflags,_wrap_Band_GetMaskFlags,NULL)
 SWIG_ZEND_NAMED_FE(band_createmaskband,_wrap_Band_CreateMaskBand,NULL)
 SWIG_ZEND_NAMED_FE(band_gethistogram,_wrap_Band_GetHistogram,NULL)
 SWIG_ZEND_NAMED_FE(band_getdefaulthistogram,_wrap_Band_GetDefaultHistogram,NULL)
 SWIG_ZEND_NAMED_FE(band_setdefaulthistogram,_wrap_Band_SetDefaultHistogram,NULL)
 SWIG_ZEND_NAMED_FE(band_hasarbitraryoverviews,_wrap_Band_HasArbitraryOverviews,NULL)
 SWIG_ZEND_NAMED_FE(new_colortable,_wrap_new_ColorTable,NULL)
 SWIG_ZEND_NAMED_FE(colortable_c_clone,_wrap_ColorTable_c_Clone,NULL)
 SWIG_ZEND_NAMED_FE(colortable_getpaletteinterpretation,_wrap_ColorTable_GetPaletteInterpretation,NULL)
 SWIG_ZEND_NAMED_FE(colortable_getcount,_wrap_ColorTable_GetCount,NULL)
 SWIG_ZEND_NAMED_FE(colortable_getcolorentry,_wrap_ColorTable_GetColorEntry,NULL)
 SWIG_ZEND_NAMED_FE(colortable_getcolorentryasrgb,_wrap_ColorTable_GetColorEntryAsRGB,NULL)
 SWIG_ZEND_NAMED_FE(colortable_setcolorentry,_wrap_ColorTable_SetColorEntry,NULL)
 SWIG_ZEND_NAMED_FE(colortable_createcolorramp,_wrap_ColorTable_CreateColorRamp,NULL)
 SWIG_ZEND_NAMED_FE(new_rasterattributetable,_wrap_new_RasterAttributeTable,NULL)
 SWIG_ZEND_NAMED_FE(rasterattributetable_c_clone,_wrap_RasterAttributeTable_c_Clone,NULL)
 SWIG_ZEND_NAMED_FE(rasterattributetable_getcolumncount,_wrap_RasterAttributeTable_GetColumnCount,NULL)
 SWIG_ZEND_NAMED_FE(rasterattributetable_getnameofcol,_wrap_RasterAttributeTable_GetNameOfCol,NULL)
 SWIG_ZEND_NAMED_FE(rasterattributetable_getusageofcol,_wrap_RasterAttributeTable_GetUsageOfCol,NULL)
 SWIG_ZEND_NAMED_FE(rasterattributetable_gettypeofcol,_wrap_RasterAttributeTable_GetTypeOfCol,NULL)
 SWIG_ZEND_NAMED_FE(rasterattributetable_getcolofusage,_wrap_RasterAttributeTable_GetColOfUsage,NULL)
 SWIG_ZEND_NAMED_FE(rasterattributetable_getrowcount,_wrap_RasterAttributeTable_GetRowCount,NULL)
 SWIG_ZEND_NAMED_FE(rasterattributetable_getvalueasstring,_wrap_RasterAttributeTable_GetValueAsString,NULL)
 SWIG_ZEND_NAMED_FE(rasterattributetable_getvalueasint,_wrap_RasterAttributeTable_GetValueAsInt,NULL)
 SWIG_ZEND_NAMED_FE(rasterattributetable_getvalueasdouble,_wrap_RasterAttributeTable_GetValueAsDouble,NULL)
 SWIG_ZEND_NAMED_FE(rasterattributetable_setvalueasstring,_wrap_RasterAttributeTable_SetValueAsString,NULL)
 SWIG_ZEND_NAMED_FE(rasterattributetable_setvalueasint,_wrap_RasterAttributeTable_SetValueAsInt,NULL)
 SWIG_ZEND_NAMED_FE(rasterattributetable_setvalueasdouble,_wrap_RasterAttributeTable_SetValueAsDouble,NULL)
 SWIG_ZEND_NAMED_FE(rasterattributetable_setrowcount,_wrap_RasterAttributeTable_SetRowCount,NULL)
 SWIG_ZEND_NAMED_FE(rasterattributetable_createcolumn,_wrap_RasterAttributeTable_CreateColumn,NULL)
 SWIG_ZEND_NAMED_FE(rasterattributetable_getlinearbinning,_wrap_RasterAttributeTable_GetLinearBinning,NULL)
 SWIG_ZEND_NAMED_FE(rasterattributetable_setlinearbinning,_wrap_RasterAttributeTable_SetLinearBinning,NULL)
 SWIG_ZEND_NAMED_FE(rasterattributetable_getrowofvalue,_wrap_RasterAttributeTable_GetRowOfValue,NULL)
 SWIG_ZEND_NAMED_FE(termprogress_nocb,_wrap_TermProgress_nocb,NULL)
 SWIG_ZEND_NAMED_FE(computemediancutpct,_wrap_ComputeMedianCutPCT,NULL)
 SWIG_ZEND_NAMED_FE(ditherrgb2pct,_wrap_DitherRGB2PCT,NULL)
 SWIG_ZEND_NAMED_FE(reprojectimage,_wrap_ReprojectImage,NULL)
 SWIG_ZEND_NAMED_FE(computeproximity,_wrap_ComputeProximity,NULL)
 SWIG_ZEND_NAMED_FE(rasterizelayer,_wrap_RasterizeLayer,NULL)
 SWIG_ZEND_NAMED_FE(polygonize,_wrap_Polygonize,NULL)
 SWIG_ZEND_NAMED_FE(fillnodata,_wrap_FillNodata,NULL)
 SWIG_ZEND_NAMED_FE(sievefilter,_wrap_SieveFilter,NULL)
 SWIG_ZEND_NAMED_FE(regenerateoverviews,_wrap_RegenerateOverviews,NULL)
 SWIG_ZEND_NAMED_FE(regenerateoverview,_wrap_RegenerateOverview,NULL)
 SWIG_ZEND_NAMED_FE(contourgenerate,_wrap_ContourGenerate,NULL)
 SWIG_ZEND_NAMED_FE(autocreatewarpedvrt,_wrap_AutoCreateWarpedVRT,NULL)
 SWIG_ZEND_NAMED_FE(new_transformer,_wrap_new_Transformer,NULL)
 SWIG_ZEND_NAMED_FE(transformer_transformpoint,_wrap_Transformer_TransformPoint,NULL)
 SWIG_ZEND_NAMED_FE(transformer_transformpoints,_wrap_Transformer_TransformPoints,NULL)
 SWIG_ZEND_NAMED_FE(applygeotransform,_wrap_ApplyGeoTransform,NULL)
 SWIG_ZEND_NAMED_FE(invgeotransform,_wrap_InvGeoTransform,NULL)
 SWIG_ZEND_NAMED_FE(versioninfo,_wrap_VersionInfo,NULL)
 SWIG_ZEND_NAMED_FE(allregister,_wrap_AllRegister,NULL)
 SWIG_ZEND_NAMED_FE(gdaldestroydrivermanager,_wrap_GDALDestroyDriverManager,NULL)
 SWIG_ZEND_NAMED_FE(getcachemax,_wrap_GetCacheMax,NULL)
 SWIG_ZEND_NAMED_FE(getcacheused,_wrap_GetCacheUsed,NULL)
 SWIG_ZEND_NAMED_FE(setcachemax,_wrap_SetCacheMax,NULL)
 SWIG_ZEND_NAMED_FE(getdatatypesize,_wrap_GetDataTypeSize,NULL)
 SWIG_ZEND_NAMED_FE(datatypeiscomplex,_wrap_DataTypeIsComplex,NULL)
 SWIG_ZEND_NAMED_FE(getdatatypename,_wrap_GetDataTypeName,NULL)
 SWIG_ZEND_NAMED_FE(getdatatypebyname,_wrap_GetDataTypeByName,NULL)
 SWIG_ZEND_NAMED_FE(getcolorinterpretationname,_wrap_GetColorInterpretationName,NULL)
 SWIG_ZEND_NAMED_FE(getpaletteinterpretationname,_wrap_GetPaletteInterpretationName,NULL)
 SWIG_ZEND_NAMED_FE(dectodms,_wrap_DecToDMS,NULL)
 SWIG_ZEND_NAMED_FE(packeddmstodec,_wrap_PackedDMSToDec,NULL)
 SWIG_ZEND_NAMED_FE(dectopackeddms,_wrap_DecToPackedDMS,NULL)
 SWIG_ZEND_NAMED_FE(parsexmlstring,_wrap_ParseXMLString,NULL)
 SWIG_ZEND_NAMED_FE(serializexmltree,_wrap_SerializeXMLTree,NULL)
 SWIG_ZEND_NAMED_FE(getdrivercount,_wrap_GetDriverCount,NULL)
 SWIG_ZEND_NAMED_FE(getdriverbyname,_wrap_GetDriverByName,NULL)
 SWIG_ZEND_NAMED_FE(getdriver,_wrap_GetDriver,NULL)
 SWIG_ZEND_NAMED_FE(open,_wrap_Open,NULL)
 SWIG_ZEND_NAMED_FE(openshared,_wrap_OpenShared,NULL)
 SWIG_ZEND_NAMED_FE(identifydriver,_wrap_IdentifyDriver,NULL)
 SWIG_ZEND_NAMED_FE(generalcmdlineprocessor,_wrap_GeneralCmdLineProcessor,NULL)
 SWIG_ZEND_NAMED_FE(swig_gdal_alter_newobject,_wrap_swig_gdal_alter_newobject,NULL)
 SWIG_ZEND_NAMED_FE(swig_gdal_get_newobject,_wrap_swig_gdal_get_newobject,NULL)
{NULL, NULL, NULL}
};

/* init section */
#if ZEND_MODULE_API_NO <= 20090626
#undef ZEND_MODULE_BUILD_ID
#define ZEND_MODULE_BUILD_ID (char*)"API" ZEND_TOSTR(ZEND_MODULE_API_NO) ZEND_BUILD_TS ZEND_BUILD_DEBUG ZEND_BUILD_SYSTEM ZEND_BUILD_EXTRA
#endif
zend_module_entry gdal_module_entry = {
#if ZEND_MODULE_API_NO > 20010900
    STANDARD_MODULE_HEADER,
#endif
    (char*)"gdal",
    gdal_functions,
    PHP_MINIT(gdal),
    PHP_MSHUTDOWN(gdal),
    PHP_RINIT(gdal),
    PHP_RSHUTDOWN(gdal),
    PHP_MINFO(gdal),
#if ZEND_MODULE_API_NO > 20010900
    NO_VERSION_YET,
#endif
    STANDARD_MODULE_PROPERTIES
};
zend_module_entry* SWIG_module_entry = &gdal_module_entry;

#ifdef __cplusplus
extern "C" {
#endif
SWIGEXPORT zend_module_entry *get_module(void) { return &gdal_module_entry; }
#ifdef __cplusplus
}
#endif

#define SWIG_php_minit PHP_MINIT_FUNCTION(gdal)
/* -----------------------------------------------------------------------------
 * Type initialization:
 * This problem is tough by the requirement that no dynamic 
 * memory is used. Also, since swig_type_info structures store pointers to 
 * swig_cast_info structures and swig_cast_info structures store pointers back
 * to swig_type_info structures, we need some lookup code at initialization. 
 * The idea is that swig generates all the structures that are needed. 
 * The runtime then collects these partially filled structures. 
 * The SWIG_InitializeModule function takes these initial arrays out of 
 * swig_module, and does all the lookup, filling in the swig_module.types
 * array with the correct data and linking the correct swig_cast_info
 * structures together.
 *
 * The generated swig_type_info structures are assigned staticly to an initial 
 * array. We just loop through that array, and handle each type individually.
 * First we lookup if this type has been already loaded, and if so, use the
 * loaded structure instead of the generated one. Then we have to fill in the
 * cast linked list. The cast data is initially stored in something like a
 * two-dimensional array. Each row corresponds to a type (there are the same
 * number of rows as there are in the swig_type_initial array). Each entry in
 * a column is one of the swig_cast_info structures for that type.
 * The cast_initial array is actually an array of arrays, because each row has
 * a variable number of columns. So to actually build the cast linked list,
 * we find the array of casts associated with the type, and loop through it 
 * adding the casts to the list. The one last trick we need to do is making
 * sure the type pointer in the swig_cast_info struct is correct.
 *
 * First off, we lookup the cast->type name to see if it is already loaded. 
 * There are three cases to handle:
 *  1) If the cast->type has already been loaded AND the type we are adding
 *     casting info to has not been loaded (it is in this module), THEN we
 *     replace the cast->type pointer with the type pointer that has already
 *     been loaded.
 *  2) If BOTH types (the one we are adding casting info to, and the 
 *     cast->type) are loaded, THEN the cast info has already been loaded by
 *     the previous module so we just ignore it.
 *  3) Finally, if cast->type has not already been loaded, then we add that
 *     swig_cast_info to the linked list (because the cast->type) pointer will
 *     be correct.
 * ----------------------------------------------------------------------------- */

#ifdef __cplusplus
extern "C" {
#if 0
} /* c-mode */
#endif
#endif

#if 0
#define SWIGRUNTIME_DEBUG
#endif


SWIGRUNTIME void
SWIG_InitializeModule(void *clientdata) {
  size_t i;
  swig_module_info *module_head, *iter;
  int found, init;

  clientdata = clientdata;

  /* check to see if the circular list has been setup, if not, set it up */
  if (swig_module.next==0) {
    /* Initialize the swig_module */
    swig_module.type_initial = swig_type_initial;
    swig_module.cast_initial = swig_cast_initial;
    swig_module.next = &swig_module;
    init = 1;
  } else {
    init = 0;
  }

  /* Try and load any already created modules */
  module_head = SWIG_GetModule(clientdata);
  if (!module_head) {
    /* This is the first module loaded for this interpreter */
    /* so set the swig module into the interpreter */
    SWIG_SetModule(clientdata, &swig_module);
    module_head = &swig_module;
  } else {
    /* the interpreter has loaded a SWIG module, but has it loaded this one? */
    found=0;
    iter=module_head;
    do {
      if (iter==&swig_module) {
        found=1;
        break;
      }
      iter=iter->next;
    } while (iter!= module_head);

    /* if the is found in the list, then all is done and we may leave */
    if (found) return;
    /* otherwise we must add out module into the list */
    swig_module.next = module_head->next;
    module_head->next = &swig_module;
  }

  /* When multiple interpreters are used, a module could have already
     been initialized in a different interpreter, but not yet have a
     pointer in this interpreter.  In this case, we do not want to
     continue adding types... everything should be set up already */
  if (init == 0) return;

  /* Now work on filling in swig_module.types */
#ifdef SWIGRUNTIME_DEBUG
  printf("SWIG_InitializeModule: size %d\n", swig_module.size);
#endif
  for (i = 0; i < swig_module.size; ++i) {
    swig_type_info *type = 0;
    swig_type_info *ret;
    swig_cast_info *cast;

#ifdef SWIGRUNTIME_DEBUG
    printf("SWIG_InitializeModule: type %d %s\n", i, swig_module.type_initial[i]->name);
#endif

    /* if there is another module already loaded */
    if (swig_module.next != &swig_module) {
      type = SWIG_MangledTypeQueryModule(swig_module.next, &swig_module, swig_module.type_initial[i]->name);
    }
    if (type) {
      /* Overwrite clientdata field */
#ifdef SWIGRUNTIME_DEBUG
      printf("SWIG_InitializeModule: found type %s\n", type->name);
#endif
      if (swig_module.type_initial[i]->clientdata) {
	type->clientdata = swig_module.type_initial[i]->clientdata;
#ifdef SWIGRUNTIME_DEBUG
      printf("SWIG_InitializeModule: found and overwrite type %s \n", type->name);
#endif
      }
    } else {
      type = swig_module.type_initial[i];
    }

    /* Insert casting types */
    cast = swig_module.cast_initial[i];
    while (cast->type) {
    
      /* Don't need to add information already in the list */
      ret = 0;
#ifdef SWIGRUNTIME_DEBUG
      printf("SWIG_InitializeModule: look cast %s\n", cast->type->name);
#endif
      if (swig_module.next != &swig_module) {
        ret = SWIG_MangledTypeQueryModule(swig_module.next, &swig_module, cast->type->name);
#ifdef SWIGRUNTIME_DEBUG
	if (ret) printf("SWIG_InitializeModule: found cast %s\n", ret->name);
#endif
      }
      if (ret) {
	if (type == swig_module.type_initial[i]) {
#ifdef SWIGRUNTIME_DEBUG
	  printf("SWIG_InitializeModule: skip old type %s\n", ret->name);
#endif
	  cast->type = ret;
	  ret = 0;
	} else {
	  /* Check for casting already in the list */
	  swig_cast_info *ocast = SWIG_TypeCheck(ret->name, type);
#ifdef SWIGRUNTIME_DEBUG
	  if (ocast) printf("SWIG_InitializeModule: skip old cast %s\n", ret->name);
#endif
	  if (!ocast) ret = 0;
	}
      }

      if (!ret) {
#ifdef SWIGRUNTIME_DEBUG
	printf("SWIG_InitializeModule: adding cast %s\n", cast->type->name);
#endif
        if (type->cast) {
          type->cast->prev = cast;
          cast->next = type->cast;
        }
        type->cast = cast;
      }
      cast++;
    }
    /* Set entry in modules->types array equal to the type */
    swig_module.types[i] = type;
  }
  swig_module.types[i] = 0;

#ifdef SWIGRUNTIME_DEBUG
  printf("**** SWIG_InitializeModule: Cast List ******\n");
  for (i = 0; i < swig_module.size; ++i) {
    int j = 0;
    swig_cast_info *cast = swig_module.cast_initial[i];
    printf("SWIG_InitializeModule: type %d %s\n", i, swig_module.type_initial[i]->name);
    while (cast->type) {
      printf("SWIG_InitializeModule: cast type %s\n", cast->type->name);
      cast++;
      ++j;
    }
  printf("---- Total casts: %d\n",j);
  }
  printf("**** SWIG_InitializeModule: Cast List ******\n");
#endif
}

/* This function will propagate the clientdata field of type to
* any new swig_type_info structures that have been added into the list
* of equivalent types.  It is like calling
* SWIG_TypeClientData(type, clientdata) a second time.
*/
SWIGRUNTIME void
SWIG_PropagateClientData(void) {
  size_t i;
  swig_cast_info *equiv;
  static int init_run = 0;

  if (init_run) return;
  init_run = 1;

  for (i = 0; i < swig_module.size; i++) {
    if (swig_module.types[i]->clientdata) {
      equiv = swig_module.types[i]->cast;
      while (equiv) {
        if (!equiv->converter) {
          if (equiv->type && !equiv->type->clientdata)
            SWIG_TypeClientData(equiv->type, swig_module.types[i]->clientdata);
        }
        equiv = equiv->next;
      }
    }
  }
}

#ifdef __cplusplus
#if 0
{ /* c-mode */
#endif
}
#endif


  SWIG_php_minit {
    SWIG_InitializeModule(0);

/* oinit subsection */
ZEND_INIT_MODULE_GLOBALS(gdal, gdal_init_globals, gdal_destroy_globals);

/* Register resource destructors for pointer types */
le_swig__p_double=zend_register_list_destructors_ex(_wrap_destroy_p_double,NULL,(char *)(SWIGTYPE_p_double->name),module_number);
SWIG_TypeClientData(SWIGTYPE_p_double,&le_swig__p_double);
le_swig__p_GByte=zend_register_list_destructors_ex(_wrap_destroy_p_GByte,NULL,(char *)(SWIGTYPE_p_GByte->name),module_number);
SWIG_TypeClientData(SWIGTYPE_p_GByte,&le_swig__p_GByte);
le_swig__p_GDALColorEntry=zend_register_list_destructors_ex(_wrap_destroy_p_GDALColorEntry,NULL,(char *)(SWIGTYPE_p_GDALColorEntry->name),module_number);
SWIG_TypeClientData(SWIGTYPE_p_GDALColorEntry,&le_swig__p_GDALColorEntry);
le_swig__p_p_void=zend_register_list_destructors_ex(_wrap_destroy_p_p_void,NULL,(char *)(SWIGTYPE_p_p_void->name),module_number);
SWIG_TypeClientData(SWIGTYPE_p_p_void,&le_swig__p_p_void);
le_swig__p_void=zend_register_list_destructors_ex(_wrap_destroy_p_void,NULL,(char *)(SWIGTYPE_p_void->name),module_number);
SWIG_TypeClientData(SWIGTYPE_p_void,&le_swig__p_void);
le_swig__p_p_char=zend_register_list_destructors_ex(_wrap_destroy_p_p_char,NULL,(char *)(SWIGTYPE_p_p_char->name),module_number);
SWIG_TypeClientData(SWIGTYPE_p_p_char,&le_swig__p_p_char);
le_swig__p_char=zend_register_list_destructors_ex(_wrap_destroy_p_char,NULL,(char *)(SWIGTYPE_p_char->name),module_number);
SWIG_TypeClientData(SWIGTYPE_p_char,&le_swig__p_char);
le_swig__p_GDAL_GCP=zend_register_list_destructors_ex(_wrap_destroy_p_GDAL_GCP,NULL,(char *)(SWIGTYPE_p_GDAL_GCP->name),module_number);
SWIG_TypeClientData(SWIGTYPE_p_GDAL_GCP,&le_swig__p_GDAL_GCP);
le_swig__p_p_GDAL_GCP=zend_register_list_destructors_ex(_wrap_destroy_p_p_GDAL_GCP,NULL,(char *)(SWIGTYPE_p_p_GDAL_GCP->name),module_number);
SWIG_TypeClientData(SWIGTYPE_p_p_GDAL_GCP,&le_swig__p_p_GDAL_GCP);
le_swig__p_CPLErrorHandler=zend_register_list_destructors_ex(_wrap_destroy_p_CPLErrorHandler,NULL,(char *)(SWIGTYPE_p_CPLErrorHandler->name),module_number);
SWIG_TypeClientData(SWIGTYPE_p_CPLErrorHandler,&le_swig__p_CPLErrorHandler);
le_swig__p_CPLXMLNode=zend_register_list_destructors_ex(_wrap_destroy_p_CPLXMLNode,NULL,(char *)(SWIGTYPE_p_CPLXMLNode->name),module_number);
SWIG_TypeClientData(SWIGTYPE_p_CPLXMLNode,&le_swig__p_CPLXMLNode);
le_swig__p_GDALColorTableShadow=zend_register_list_destructors_ex(_wrap_destroy_p_GDALColorTableShadow,NULL,(char *)(SWIGTYPE_p_GDALColorTableShadow->name),module_number);
SWIG_TypeClientData(SWIGTYPE_p_GDALColorTableShadow,&le_swig__p_GDALColorTableShadow);
le_swig__p_GDALRasterAttributeTableShadow=zend_register_list_destructors_ex(_wrap_destroy_p_GDALRasterAttributeTableShadow,NULL,(char *)(SWIGTYPE_p_GDALRasterAttributeTableShadow->name),module_number);
SWIG_TypeClientData(SWIGTYPE_p_GDALRasterAttributeTableShadow,&le_swig__p_GDALRasterAttributeTableShadow);
le_swig__p_GDALTransformerInfoShadow=zend_register_list_destructors_ex(_wrap_destroy_p_GDALTransformerInfoShadow,NULL,(char *)(SWIGTYPE_p_GDALTransformerInfoShadow->name),module_number);
SWIG_TypeClientData(SWIGTYPE_p_GDALTransformerInfoShadow,&le_swig__p_GDALTransformerInfoShadow);
le_swig__p_f_double_p_q_const__char_p_void__int=zend_register_list_destructors_ex(_wrap_destroy_p_f_double_p_q_const__char_p_void__int,NULL,(char *)(SWIGTYPE_p_f_double_p_q_const__char_p_void__int->name),module_number);
SWIG_TypeClientData(SWIGTYPE_p_f_double_p_q_const__char_p_void__int,&le_swig__p_f_double_p_q_const__char_p_void__int);
le_swig__p_int=zend_register_list_destructors_ex(_wrap_destroy_p_int,NULL,(char *)(SWIGTYPE_p_int->name),module_number);
SWIG_TypeClientData(SWIGTYPE_p_int,&le_swig__p_int);
le_swig__p_GDALDatasetShadow=zend_register_list_destructors_ex(_wrap_destroy_p_GDALDatasetShadow,NULL,(char *)(SWIGTYPE_p_GDALDatasetShadow->name),module_number);
SWIG_TypeClientData(SWIGTYPE_p_GDALDatasetShadow,&le_swig__p_GDALDatasetShadow);
le_swig__p_GDALDriverShadow=zend_register_list_destructors_ex(_wrap_destroy_p_GDALDriverShadow,NULL,(char *)(SWIGTYPE_p_GDALDriverShadow->name),module_number);
SWIG_TypeClientData(SWIGTYPE_p_GDALDriverShadow,&le_swig__p_GDALDriverShadow);
le_swig__p_GDALMajorObjectShadow=zend_register_list_destructors_ex(_wrap_destroy_p_GDALMajorObjectShadow,NULL,(char *)(SWIGTYPE_p_GDALMajorObjectShadow->name),module_number);
SWIG_TypeClientData(SWIGTYPE_p_GDALMajorObjectShadow,&le_swig__p_GDALMajorObjectShadow);
le_swig__p_GDALProgressFunc=zend_register_list_destructors_ex(_wrap_destroy_p_GDALProgressFunc,NULL,(char *)(SWIGTYPE_p_GDALProgressFunc->name),module_number);
SWIG_TypeClientData(SWIGTYPE_p_GDALProgressFunc,&le_swig__p_GDALProgressFunc);
le_swig__p_GDALAsyncReaderShadow=zend_register_list_destructors_ex(_wrap_destroy_p_GDALAsyncReaderShadow,NULL,(char *)(SWIGTYPE_p_GDALAsyncReaderShadow->name),module_number);
SWIG_TypeClientData(SWIGTYPE_p_GDALAsyncReaderShadow,&le_swig__p_GDALAsyncReaderShadow);
le_swig__p_GDALRasterBandShadow=zend_register_list_destructors_ex(_wrap_destroy_p_GDALRasterBandShadow,NULL,(char *)(SWIGTYPE_p_GDALRasterBandShadow->name),module_number);
SWIG_TypeClientData(SWIGTYPE_p_GDALRasterBandShadow,&le_swig__p_GDALRasterBandShadow);
le_swig__p_p_int=zend_register_list_destructors_ex(_wrap_destroy_p_p_int,NULL,(char *)(SWIGTYPE_p_p_int->name),module_number);
SWIG_TypeClientData(SWIGTYPE_p_p_int,&le_swig__p_p_int);
le_swig__p_OGRLayerShadow=zend_register_list_destructors_ex(_wrap_destroy_p_OGRLayerShadow,NULL,(char *)(SWIGTYPE_p_OGRLayerShadow->name),module_number);
SWIG_TypeClientData(SWIGTYPE_p_OGRLayerShadow,&le_swig__p_OGRLayerShadow);
le_swig__p_p_GDALRasterBandShadow=zend_register_list_destructors_ex(_wrap_destroy_p_p_GDALRasterBandShadow,NULL,(char *)(SWIGTYPE_p_p_GDALRasterBandShadow->name),module_number);
SWIG_TypeClientData(SWIGTYPE_p_p_GDALRasterBandShadow,&le_swig__p_p_GDALRasterBandShadow);
CG(active_class_entry) = NULL;
/* end oinit subsection */

/* cinit subsection */
{
  /* This actually registers it as a global variable and constant.  I don't
   * like it, but I can't figure out the zend_constant code... */
  zval *z_var;
  MAKE_STD_ZVAL(z_var);
  SWIG_SetPointerZval(z_var, (void*)(int (*)(double,char const *,void *))(GDALTermProgress), SWIGTYPE_p_f_double_p_q_const__char_p_void__int, 0);
  /* zend_hash_add(&EG(symbol_table), "GDALTermProgress", sizeof("GDALTermProgress"), (void *)&z_var,sizeof(zval *), NULL); */
  zend_constant c;
  c.value = *z_var;
  zval_copy_ctor(&c.value);
  size_t len = sizeof("GDALTermProgress") - 1;
  c.name = zend_strndup("GDALTermProgress", len);
  c.name_len = len+1;
  c.flags = CONST_CS | CONST_PERSISTENT;
  c.module_number = module_number;
  zend_register_constant( &c TSRMLS_CC );
}
/* end cinit subsection */

    return SUCCESS;
}

PHP_RINIT_FUNCTION(gdal)
{
/* rinit section */

/* vinit subsection */
/* end vinit subsection */

    return SUCCESS;
}

PHP_MSHUTDOWN_FUNCTION(gdal)
{
/* shutdown section */
#ifdef ZTS
    ts_free_id(gdal_globals_id);
#endif
    return SUCCESS;
}

PHP_RSHUTDOWN_FUNCTION(gdal)
{
/* rshutdown section */

    return SUCCESS;
}

PHP_MINFO_FUNCTION(gdal)
{
}
/* end init section */
