/* ----------------------------------------------------------------------------
 * This file was automatically generated by SWIG (http://www.swig.org).
 * Version 2.0.5
 * 
 * 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

#define SWIG_DIRECTORS
#define SWIG_PREFIX "Xapian"
#define SWIG_PREFIX_LEN 6

#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, ie, 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 an 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 to return 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

/* -----------------------------------------------------------------------------
 * phprun.swg
 *
 * PHP runtime library
 * ----------------------------------------------------------------------------- */

#ifdef __cplusplus
extern "C" {
#endif
#include "zend.h"
#include "zend_API.h"
#include "zend_exceptions.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), (char*)(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) {
  /*
   * First test for Null pointers.  Return those as PHP native NULL
   */
  if (!ptr ) {
    ZVAL_NULL(z);
    return;
  }
  if (type->clientdata) {
    swig_object_wrapper *value;
    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 & 1);
    if ((newobject & 2) == 0) {
      /* 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
       * directorin typemaps.
       */
      zval *resource;
      zend_class_entry **ce = NULL;
      const char *type_name = type->name+3; /* +3 so: _p_Foo -> Foo */
      size_t type_name_len;
      int result;
      const char * p;

      /* Namespace__Foo -> Foo */
      /* FIXME: ugly and goes wrong for classes with __ in their names. */
      while ((p = strstr(type_name, "__")) != NULL) {
        type_name = p + 2;
      }
      type_name_len = strlen(type_name);

      MAKE_STD_ZVAL(resource);
      ZEND_REGISTER_RESOURCE(resource, value, *(int *)(type->clientdata));
      if (SWIG_PREFIX_LEN > 0) {
        char * classname = (char*)emalloc(SWIG_PREFIX_LEN + type_name_len + 1);
        strcpy(classname, SWIG_PREFIX);
        strcpy(classname + SWIG_PREFIX_LEN, type_name);
        result = zend_lookup_class(classname, SWIG_PREFIX_LEN + type_name_len, &ce TSRMLS_CC);
        efree(classname);
      } else {
        result = zend_lookup_class((char *)type_name, type_name_len, &ce TSRMLS_CC);
      }
      if (result != 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);
    }
    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;
  const 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) - 1, 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_int swig_types[0]
#define SWIGTYPE_p_Xapian__BM25Weight swig_types[1]
#define SWIGTYPE_p_Xapian__BoolWeight swig_types[2]
#define SWIGTYPE_p_Xapian__Compactor swig_types[3]
#define SWIGTYPE_p_Xapian__Database swig_types[4]
#define SWIGTYPE_p_Xapian__DateValueRangeProcessor swig_types[5]
#define SWIGTYPE_p_Xapian__DecreasingValueWeightPostingSource swig_types[6]
#define SWIGTYPE_p_Xapian__Document swig_types[7]
#define SWIGTYPE_p_Xapian__ESet swig_types[8]
#define SWIGTYPE_p_Xapian__ESetIterator swig_types[9]
#define SWIGTYPE_p_Xapian__Enquire swig_types[10]
#define SWIGTYPE_p_Xapian__ExpandDecider swig_types[11]
#define SWIGTYPE_p_Xapian__FixedWeightPostingSource swig_types[12]
#define SWIGTYPE_p_Xapian__KeyMaker swig_types[13]
#define SWIGTYPE_p_Xapian__MSet swig_types[14]
#define SWIGTYPE_p_Xapian__MSetIterator swig_types[15]
#define SWIGTYPE_p_Xapian__MatchDecider swig_types[16]
#define SWIGTYPE_p_Xapian__MatchSpy swig_types[17]
#define SWIGTYPE_p_Xapian__MultiValueKeyMaker swig_types[18]
#define SWIGTYPE_p_Xapian__MultiValueSorter swig_types[19]
#define SWIGTYPE_p_Xapian__NumberValueRangeProcessor swig_types[20]
#define SWIGTYPE_p_Xapian__PositionIterator swig_types[21]
#define SWIGTYPE_p_Xapian__PostingIterator swig_types[22]
#define SWIGTYPE_p_Xapian__PostingSource swig_types[23]
#define SWIGTYPE_p_Xapian__Query swig_types[24]
#define SWIGTYPE_p_Xapian__QueryParser swig_types[25]
#define SWIGTYPE_p_Xapian__RSet swig_types[26]
#define SWIGTYPE_p_Xapian__Registry swig_types[27]
#define SWIGTYPE_p_Xapian__SimpleStopper swig_types[28]
#define SWIGTYPE_p_Xapian__Sorter swig_types[29]
#define SWIGTYPE_p_Xapian__Stem swig_types[30]
#define SWIGTYPE_p_Xapian__StemImplementation swig_types[31]
#define SWIGTYPE_p_Xapian__Stopper swig_types[32]
#define SWIGTYPE_p_Xapian__StringValueRangeProcessor swig_types[33]
#define SWIGTYPE_p_Xapian__TermGenerator swig_types[34]
#define SWIGTYPE_p_Xapian__TermIterator swig_types[35]
#define SWIGTYPE_p_Xapian__TradWeight swig_types[36]
#define SWIGTYPE_p_Xapian__ValueCountMatchSpy swig_types[37]
#define SWIGTYPE_p_Xapian__ValueIterator swig_types[38]
#define SWIGTYPE_p_Xapian__ValueMapPostingSource swig_types[39]
#define SWIGTYPE_p_Xapian__ValuePostingSource swig_types[40]
#define SWIGTYPE_p_Xapian__ValueRangeProcessor swig_types[41]
#define SWIGTYPE_p_Xapian__ValueSetMatchDecider swig_types[42]
#define SWIGTYPE_p_Xapian__ValueWeightPostingSource swig_types[43]
#define SWIGTYPE_p_Xapian__Weight swig_types[44]
#define SWIGTYPE_p_Xapian__WritableDatabase swig_types[45]
#define SWIGTYPE_p_compaction_level swig_types[46]
#define SWIGTYPE_p_docid_order swig_types[47]
#define SWIGTYPE_p_double swig_types[48]
#define SWIGTYPE_p_feature_flag swig_types[49]
#define SWIGTYPE_p_int swig_types[50]
#define SWIGTYPE_p_op swig_types[51]
#define SWIGTYPE_p_std__string swig_types[52]
#define SWIGTYPE_p_stem_strategy swig_types[53]
#define SWIGTYPE_p_unsigned_int swig_types[54]
static swig_type_info *swig_types[56];
static swig_module_info swig_module = {swig_types, 55, 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(xapian)
const char *error_msg;
int error_code;
ZEND_END_MODULE_GLOBALS(xapian)
ZEND_DECLARE_MODULE_GLOBALS(xapian)
#ifdef ZTS
#define SWIG_ErrorMsg() TSRMG(xapian_globals_id, zend_xapian_globals *, error_msg )
#define SWIG_ErrorCode() TSRMG(xapian_globals_id, zend_xapian_globals *, error_code )
#else
#define SWIG_ErrorMsg() (xapian_globals.error_msg)
#define SWIG_ErrorCode() (xapian_globals.error_code)
#endif

// Allow the user to workaround a PHP bug on some platforms/architectures by
// compiling with -DSWIG_ZEND_ERROR_NORETURN=zend_error
#ifndef SWIG_ZEND_ERROR_NORETURN
# define SWIG_ZEND_ERROR_NORETURN zend_error_noreturn
#endif

static void xapian_init_globals(zend_xapian_globals *globals ) {
  globals->error_msg = default_error_msg;
  globals->error_code = default_error_code;
}
static void xapian_destroy_globals(zend_xapian_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_xapian_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_xapian_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  "xapian"
#ifdef __cplusplus
extern "C" {
#endif
#include "php.h"
#include "php_ini.h"
#include "ext/standard/info.h"
#include "php_xapian.h"
#ifdef __cplusplus
}
#endif

/* -----------------------------------------------------------------------------
 * director.swg
 *
 * This file contains support for director classes that proxy
 * method calls from C++ to PHP extensions.
 * ----------------------------------------------------------------------------- */

#ifndef SWIG_DIRECTOR_PHP_HEADER_
#define SWIG_DIRECTOR_PHP_HEADER_

#ifdef __cplusplus

#include <string>
#include <map>

/*
  Use -DSWIG_DIRECTOR_STATIC if you prefer to avoid the use of the
  'Swig' namespace. This could be useful for multi-modules projects.
*/
#ifdef SWIG_DIRECTOR_STATIC
/* Force anonymous (static) namespace */
#define Swig
#endif

namespace Swig {
  /* memory handler */
  struct GCItem
  {
    virtual ~GCItem() {}

    virtual int get_own() const
    {
      return 0;
    }
  };

  struct GCItem_var
  {
    GCItem_var(GCItem *item = 0) : _item(item)
    {
    }

    GCItem_var& operator=(GCItem *item)
    {
      GCItem *tmp = _item;
      _item = item;
      delete tmp;
      return *this;
    }

    ~GCItem_var()
    {
      delete _item;
    }

    GCItem * operator->() const
    {
      return _item;
    }

    private:
    GCItem *_item;
  };

  struct GCItem_Object : GCItem
  {
    GCItem_Object(int own) : _own(own)
    {
    }

    virtual ~GCItem_Object()
    {
    }

    int get_own() const
    {
      return _own;
    }

    private:
    int _own;
  };

  template <typename Type>
  struct GCItem_T : GCItem
  {
    GCItem_T(Type *ptr) : _ptr(ptr)
    {
    }

    virtual ~GCItem_T()
    {
      delete _ptr;
    }

    private:
    Type *_ptr;
  };

  class Director {
    protected:
      zval *swig_self;
      typedef std::map<void*, GCItem_var> swig_ownership_map;
      mutable swig_ownership_map swig_owner;
#ifdef ZTS
      // Store the ZTS context so it's available when C++ calls back to PHP.
      void *** swig_zts_ctx;
#endif 
    public:
      Director(zval* self TSRMLS_DC) : swig_self(self) {
        TSRMLS_SET_CTX(swig_zts_ctx);
      }

      bool swig_is_overridden_method(char *cname, char *lc_fname) {
        TSRMLS_FETCH_FROM_CTX(swig_zts_ctx);
        zend_class_entry **ce;
        zend_function *mptr;
        int name_len = strlen(lc_fname);
        
        if (zend_lookup_class(cname, strlen(cname), &ce TSRMLS_CC) != SUCCESS) {
          return false;
        }
        if (zend_hash_find(&(*ce)->function_table, lc_fname, name_len + 1, (void**) &mptr) != SUCCESS) {
          return false;
        }
        // common.scope points to the declaring class
        return strcmp(mptr->common.scope->name, cname);
      }

      template <typename Type>
      void swig_acquire_ownership(Type *vptr) const
      {
        if (vptr) {
          swig_owner[vptr] = new GCItem_T<Type>(vptr);
        }
      }
  };

  /* base class for director exceptions */
  class DirectorException {
  protected:
    std::string swig_msg;
  public:
    DirectorException(int code, const char *hdr, const char* msg TSRMLS_DC)
      : swig_msg(hdr)
    {
      if (strlen(msg)) {
        swig_msg += " ";
        swig_msg += msg;
      }
      SWIG_ErrorCode() = code;
      SWIG_ErrorMsg() = swig_msg.c_str();
    }

    static void raise(int code, const char *hdr, const char* msg TSRMLS_DC)
    {
      throw DirectorException(code, hdr, msg TSRMLS_CC);
    }
  };

  /* attempt to call a pure virtual method via a director method */
  class DirectorPureVirtualException : public Swig::DirectorException
  {
  public:
    DirectorPureVirtualException(const char* msg TSRMLS_DC)
      : DirectorException(E_ERROR, "SWIG director pure virtual method called", msg TSRMLS_CC)
    {
    }

    static void raise(const char *msg TSRMLS_DC)
    {
      throw DirectorPureVirtualException(msg TSRMLS_CC);
    }
  };
  /* any php exception that occurs during a director method call */
  class DirectorMethodException : public Swig::DirectorException
  {
  public:
    DirectorMethodException(const char* msg TSRMLS_DC)
      : DirectorException(E_ERROR, "SWIG director method error", msg TSRMLS_CC)
    {
    }

    static void raise(const char *msg TSRMLS_DC)
    {
      throw DirectorMethodException(msg TSRMLS_CC);
    }
  };
}

// DirectorMethodException() is documented to be callable with no parameters
// so use a macro to insert TSRMLS_CC so any ZTS context gets passed.
#define DirectorMethodException() DirectorMethodException("" TSRMLS_CC)

#endif /* __cplusplus */

#endif

/* xapian.i: the Xapian scripting interface.
 *
 * Copyright 1999,2000,2001 BrightStation PLC
 * Copyright 2001,2002 Ananova Ltd
 * Copyright 2002,2003,2005 James Aylett
 * Copyright 2002,2003,2004,2005,2006,2007,2008,2009,2010,2011 Olly Betts
 * Copyright 2007 Lemur Consulting Ltd
 *
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public License as
 * published by the Free Software Foundation; either version 2 of the
 * License, or (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301
 * USA
 */


/** @file xapian-head.i
 * @brief Header for SWIG interface file for Xapian.
 */
/* Copyright (C) 2005,2006,2007,2008,2009,2011 Olly Betts
 *
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public License as
 * published by the Free Software Foundation; either version 2 of the
 * License, or (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301
 * USA
 */

// Disable any deprecation warnings for Xapian methods/functions/classes.
#define XAPIAN_DEPRECATED(D) D
#define XAPIAN_DEPRECATED_CLASS

#include <xapian.h>

#include <string>
#include <vector>

using namespace std;

// If a backend has been disabled in xapian-core (manually or automatically) we
// include a stub definition here so the bindings can still be built.
namespace Xapian {
#ifndef XAPIAN_HAS_BRASS_BACKEND
    namespace Brass {
	static Database open(const string &) {
	    throw FeatureUnavailableError("Brass backend not supported");
	}
	static WritableDatabase open(const string &, int, int = 8192) {
	    throw FeatureUnavailableError("Brass backend not supported");
	}
    }
#endif

#ifndef XAPIAN_HAS_CHERT_BACKEND
    namespace Chert {
	static Database open(const string &) {
	    throw FeatureUnavailableError("Chert backend not supported");
	}
	static WritableDatabase open(const string &, int, int = 8192) {
	    throw FeatureUnavailableError("Chert backend not supported");
	}
    }
#endif

#ifndef XAPIAN_HAS_FLINT_BACKEND
    namespace Flint {
	static Database open(const string &) {
	    throw FeatureUnavailableError("Flint backend not supported");
	}
	static WritableDatabase open(const string &, int, int = 8192) {
	    throw FeatureUnavailableError("Flint backend not supported");
	}
    }
#endif

#ifndef XAPIAN_HAS_INMEMORY_BACKEND
    namespace InMemory {
	static WritableDatabase open() {
	    throw FeatureUnavailableError("InMemory backend not supported");
	}
    }
#endif

#ifndef XAPIAN_HAS_REMOTE_BACKEND
    namespace Remote {
	static Database open(const string &, unsigned int, timeout = 0, timeout = 0) {
	    throw FeatureUnavailableError("Remote backend not supported");
	}

	static WritableDatabase open_writable(const string &, unsigned int, timeout = 0, timeout = 0) {
	    throw FeatureUnavailableError("Remote backend not supported");
	}

	static Database open(const string &, const string &, timeout = 0) {
	    throw FeatureUnavailableError("Remote backend not supported");
	}

	static WritableDatabase open_writable(const string &, const string &, timeout = 0) {
	    throw FeatureUnavailableError("Remote backend not supported");
	}
    }
#endif
}


#include <stdexcept>


#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>


#include <string>


#include <vector>
#include <stdexcept>


#include <map>
#include <algorithm>
#include <stdexcept>


#include <utility>


/* php/util.i: custom PHP typemaps for xapian-bindings
 *
 * Copyright (C) 2004,2005,2006,2007,2008,2010,2011 Olly Betts
 *
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public License as
 * published by the Free Software Foundation; either version 2 of the
 * License, or (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301
 * USA
 */

#include "../xapian-version.h"


#include <zend_exceptions.h>

static void
XapianExceptionHandler()
{
    TSRMLS_FETCH();
    string msg;
    try {
	// Rethrow so we can look at the exception if it was a Xapian::Error.
	throw;
    } catch (const Xapian::Error &e) {
        // FIXME: It would be nicer to make the exceptions PHP classes
        // corresponding to the C++ Xapian::Error class hierarchy.
	msg = e.get_type();
	msg += ": ";
	msg += e.get_msg();
    } catch (...) {
	msg = "unknown error in Xapian";
    }
    // zend_throw_exception takes a non-const char * parameter (sigh).
    char * message = const_cast<char*>(msg.c_str());
    zend_throw_exception(NULL, message, SWIG_UnknownError TSRMLS_CC);
}

SWIGINTERN Xapian::termpos Xapian_PositionIterator_get_termpos(Xapian::PositionIterator const *self){
	    return *(*self);
	}
SWIGINTERN void Xapian_PositionIterator_next(Xapian::PositionIterator *self){ ++(*self); }
SWIGINTERN bool Xapian_PositionIterator_equals(Xapian::PositionIterator const *self,Xapian::PositionIterator const &other){
	    return (*self) == other;
	}
SWIGINTERN Xapian::docid Xapian_PostingIterator_get_docid(Xapian::PostingIterator const *self){
	return *(*self);
    }
SWIGINTERN void Xapian_PostingIterator_next(Xapian::PostingIterator *self){ ++(*self); }
SWIGINTERN bool Xapian_PostingIterator_equals(Xapian::PostingIterator const *self,Xapian::PostingIterator const &other){
	return (*self) == other;
    }
SWIGINTERN std::string Xapian_TermIterator_get_term(Xapian::TermIterator const *self){
	    return *(*self);
	}
SWIGINTERN void Xapian_TermIterator_next(Xapian::TermIterator *self){ ++(*self); }
SWIGINTERN bool Xapian_TermIterator_equals(Xapian::TermIterator const *self,Xapian::TermIterator const &other){
	    return (*self) == other;
	}
SWIGINTERN std::string Xapian_ValueIterator_get_value(Xapian::ValueIterator const *self){
	    return *(*self);
	}
SWIGINTERN void Xapian_ValueIterator_next(Xapian::ValueIterator *self){ ++(*self); }
SWIGINTERN bool Xapian_ValueIterator_equals(Xapian::ValueIterator const *self,Xapian::ValueIterator const &other){
	    return (*self) == other;
	}
SWIGINTERN Xapian::MSetIterator Xapian_MSet_get_hit(Xapian::MSet const *self,Xapian::doccount i){
	    return ((*self)[i]);
	}
SWIGINTERN int Xapian_MSet_get_document_percentage(Xapian::MSet const *self,Xapian::doccount i){
	    return (*self).convert_to_percent( ((*self)[i]) );
	}
SWIGINTERN Xapian::Document const Xapian_MSet_get_document(Xapian::MSet const *self,Xapian::doccount i){
	    return ((*self)[i]).get_document();
	}
SWIGINTERN Xapian::docid Xapian_MSet_get_docid(Xapian::MSet const *self,Xapian::doccount i){
	    return *((*self)[i]);
	}
SWIGINTERN Xapian::docid Xapian_MSetIterator_get_docid(Xapian::MSetIterator const *self){
	    return *(*self);
	}
SWIGINTERN void Xapian_MSetIterator_next(Xapian::MSetIterator *self){ ++(*self); }
SWIGINTERN void Xapian_MSetIterator_prev(Xapian::MSetIterator *self){ --(*self); }
SWIGINTERN bool Xapian_MSetIterator_equals(Xapian::MSetIterator const *self,Xapian::MSetIterator const &other){
	    return (*self) == other;
	}
SWIGINTERN std::string Xapian_ESetIterator_get_term(Xapian::ESetIterator const *self){
	    return *(*self);
	}
SWIGINTERN void Xapian_ESetIterator_next(Xapian::ESetIterator *self){ ++(*self); }
SWIGINTERN void Xapian_ESetIterator_prev(Xapian::ESetIterator *self){ --(*self); }
SWIGINTERN bool Xapian_ESetIterator_equals(Xapian::ESetIterator const *self,Xapian::ESetIterator const &other){
	    return (*self) == other;
	}
SWIGINTERN std::pair< Xapian::TermIterator,Xapian::TermIterator > Xapian_Enquire_get_matching_terms(Xapian::Enquire const *self,Xapian::MSetIterator const &hit){
	    return make_pair(self->get_matching_terms_begin(hit),
			     self->get_matching_terms_end(hit));
	}
SWIGINTERN Xapian::Query *new_Xapian_Query__SWIG_13(Xapian::Query::op op,std::vector< Xapian::Query > const &subqs,Xapian::termcount param=0){
		return new Xapian::Query(op, subqs.begin(), subqs.end(), param);
	    }

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

static void *_p_Xapian__WritableDatabaseTo_p_Xapian__Database(void *x, int *SWIGUNUSEDPARM(newmemory)) {
    return (void *)((Xapian::Database *)  ((Xapian::WritableDatabase *) x));
}
static void *_p_Xapian__ValueSetMatchDeciderTo_p_Xapian__MatchDecider(void *x, int *SWIGUNUSEDPARM(newmemory)) {
    return (void *)((Xapian::MatchDecider *)  ((Xapian::ValueSetMatchDecider *) x));
}
static void *_p_Xapian__MultiValueSorterTo_p_Xapian__Sorter(void *x, int *SWIGUNUSEDPARM(newmemory)) {
    return (void *)((Xapian::Sorter *)  ((Xapian::MultiValueSorter *) x));
}
static void *_p_Xapian__SorterTo_p_Xapian__KeyMaker(void *x, int *SWIGUNUSEDPARM(newmemory)) {
    return (void *)((Xapian::KeyMaker *)  ((Xapian::Sorter *) x));
}
static void *_p_Xapian__MultiValueSorterTo_p_Xapian__KeyMaker(void *x, int *SWIGUNUSEDPARM(newmemory)) {
    return (void *)((Xapian::KeyMaker *) (Xapian::Sorter *) ((Xapian::MultiValueSorter *) x));
}
static void *_p_Xapian__MultiValueKeyMakerTo_p_Xapian__KeyMaker(void *x, int *SWIGUNUSEDPARM(newmemory)) {
    return (void *)((Xapian::KeyMaker *)  ((Xapian::MultiValueKeyMaker *) x));
}
static void *_p_Xapian__ValuePostingSourceTo_p_Xapian__PostingSource(void *x, int *SWIGUNUSEDPARM(newmemory)) {
    return (void *)((Xapian::PostingSource *)  ((Xapian::ValuePostingSource *) x));
}
static void *_p_Xapian__ValueWeightPostingSourceTo_p_Xapian__PostingSource(void *x, int *SWIGUNUSEDPARM(newmemory)) {
    return (void *)((Xapian::PostingSource *) (Xapian::ValuePostingSource *) ((Xapian::ValueWeightPostingSource *) x));
}
static void *_p_Xapian__DecreasingValueWeightPostingSourceTo_p_Xapian__PostingSource(void *x, int *SWIGUNUSEDPARM(newmemory)) {
    return (void *)((Xapian::PostingSource *) (Xapian::ValuePostingSource *)(Xapian::ValueWeightPostingSource *) ((Xapian::DecreasingValueWeightPostingSource *) x));
}
static void *_p_Xapian__ValueMapPostingSourceTo_p_Xapian__PostingSource(void *x, int *SWIGUNUSEDPARM(newmemory)) {
    return (void *)((Xapian::PostingSource *) (Xapian::ValuePostingSource *) ((Xapian::ValueMapPostingSource *) x));
}
static void *_p_Xapian__FixedWeightPostingSourceTo_p_Xapian__PostingSource(void *x, int *SWIGUNUSEDPARM(newmemory)) {
    return (void *)((Xapian::PostingSource *)  ((Xapian::FixedWeightPostingSource *) x));
}
static void *_p_Xapian__DecreasingValueWeightPostingSourceTo_p_Xapian__ValueWeightPostingSource(void *x, int *SWIGUNUSEDPARM(newmemory)) {
    return (void *)((Xapian::ValueWeightPostingSource *)  ((Xapian::DecreasingValueWeightPostingSource *) x));
}
static void *_p_Xapian__ValueWeightPostingSourceTo_p_Xapian__ValuePostingSource(void *x, int *SWIGUNUSEDPARM(newmemory)) {
    return (void *)((Xapian::ValuePostingSource *)  ((Xapian::ValueWeightPostingSource *) x));
}
static void *_p_Xapian__DecreasingValueWeightPostingSourceTo_p_Xapian__ValuePostingSource(void *x, int *SWIGUNUSEDPARM(newmemory)) {
    return (void *)((Xapian::ValuePostingSource *) (Xapian::ValueWeightPostingSource *) ((Xapian::DecreasingValueWeightPostingSource *) x));
}
static void *_p_Xapian__ValueMapPostingSourceTo_p_Xapian__ValuePostingSource(void *x, int *SWIGUNUSEDPARM(newmemory)) {
    return (void *)((Xapian::ValuePostingSource *)  ((Xapian::ValueMapPostingSource *) x));
}
static void *_p_Xapian__BoolWeightTo_p_Xapian__Weight(void *x, int *SWIGUNUSEDPARM(newmemory)) {
    return (void *)((Xapian::Weight *)  ((Xapian::BoolWeight *) x));
}
static void *_p_Xapian__TradWeightTo_p_Xapian__Weight(void *x, int *SWIGUNUSEDPARM(newmemory)) {
    return (void *)((Xapian::Weight *)  ((Xapian::TradWeight *) x));
}
static void *_p_Xapian__BM25WeightTo_p_Xapian__Weight(void *x, int *SWIGUNUSEDPARM(newmemory)) {
    return (void *)((Xapian::Weight *)  ((Xapian::BM25Weight *) x));
}
static void *_p_Xapian__ValueCountMatchSpyTo_p_Xapian__MatchSpy(void *x, int *SWIGUNUSEDPARM(newmemory)) {
    return (void *)((Xapian::MatchSpy *)  ((Xapian::ValueCountMatchSpy *) x));
}
static void *_p_Xapian__SimpleStopperTo_p_Xapian__Stopper(void *x, int *SWIGUNUSEDPARM(newmemory)) {
    return (void *)((Xapian::Stopper *)  ((Xapian::SimpleStopper *) x));
}
static void *_p_Xapian__DateValueRangeProcessorTo_p_Xapian__StringValueRangeProcessor(void *x, int *SWIGUNUSEDPARM(newmemory)) {
    return (void *)((Xapian::StringValueRangeProcessor *)  ((Xapian::DateValueRangeProcessor *) x));
}
static void *_p_Xapian__NumberValueRangeProcessorTo_p_Xapian__StringValueRangeProcessor(void *x, int *SWIGUNUSEDPARM(newmemory)) {
    return (void *)((Xapian::StringValueRangeProcessor *)  ((Xapian::NumberValueRangeProcessor *) x));
}
static void *_p_Xapian__StringValueRangeProcessorTo_p_Xapian__ValueRangeProcessor(void *x, int *SWIGUNUSEDPARM(newmemory)) {
    return (void *)((Xapian::ValueRangeProcessor *)  ((Xapian::StringValueRangeProcessor *) x));
}
static void *_p_Xapian__DateValueRangeProcessorTo_p_Xapian__ValueRangeProcessor(void *x, int *SWIGUNUSEDPARM(newmemory)) {
    return (void *)((Xapian::ValueRangeProcessor *) (Xapian::StringValueRangeProcessor *) ((Xapian::DateValueRangeProcessor *) x));
}
static void *_p_Xapian__NumberValueRangeProcessorTo_p_Xapian__ValueRangeProcessor(void *x, int *SWIGUNUSEDPARM(newmemory)) {
    return (void *)((Xapian::ValueRangeProcessor *) (Xapian::StringValueRangeProcessor *) ((Xapian::NumberValueRangeProcessor *) x));
}
static swig_type_info _swigt__int = {"_int", "int", 0, 0, (void*)0, 0};
static swig_type_info _swigt__p_Xapian__BM25Weight = {"_p_Xapian__BM25Weight", "Xapian::BM25Weight *", 0, 0, (void*)0, 0};
static swig_type_info _swigt__p_Xapian__BoolWeight = {"_p_Xapian__BoolWeight", "Xapian::BoolWeight *", 0, 0, (void*)0, 0};
static swig_type_info _swigt__p_Xapian__Compactor = {"_p_Xapian__Compactor", "Xapian::Compactor *", 0, 0, (void*)0, 0};
static swig_type_info _swigt__p_Xapian__Database = {"_p_Xapian__Database", "Xapian::Database *", 0, 0, (void*)0, 0};
static swig_type_info _swigt__p_Xapian__DateValueRangeProcessor = {"_p_Xapian__DateValueRangeProcessor", "Xapian::DateValueRangeProcessor *", 0, 0, (void*)0, 0};
static swig_type_info _swigt__p_Xapian__DecreasingValueWeightPostingSource = {"_p_Xapian__DecreasingValueWeightPostingSource", "Xapian::DecreasingValueWeightPostingSource *", 0, 0, (void*)0, 0};
static swig_type_info _swigt__p_Xapian__Document = {"_p_Xapian__Document", "Xapian::Document *", 0, 0, (void*)0, 0};
static swig_type_info _swigt__p_Xapian__ESet = {"_p_Xapian__ESet", "Xapian::ESet *", 0, 0, (void*)0, 0};
static swig_type_info _swigt__p_Xapian__ESetIterator = {"_p_Xapian__ESetIterator", "Xapian::ESetIterator *", 0, 0, (void*)0, 0};
static swig_type_info _swigt__p_Xapian__Enquire = {"_p_Xapian__Enquire", "Xapian::Enquire *", 0, 0, (void*)0, 0};
static swig_type_info _swigt__p_Xapian__ExpandDecider = {"_p_Xapian__ExpandDecider", "Xapian::ExpandDecider *", 0, 0, (void*)0, 0};
static swig_type_info _swigt__p_Xapian__FixedWeightPostingSource = {"_p_Xapian__FixedWeightPostingSource", "Xapian::FixedWeightPostingSource *", 0, 0, (void*)0, 0};
static swig_type_info _swigt__p_Xapian__KeyMaker = {"_p_Xapian__KeyMaker", "Xapian::KeyMaker *", 0, 0, (void*)0, 0};
static swig_type_info _swigt__p_Xapian__MSet = {"_p_Xapian__MSet", "Xapian::MSet *", 0, 0, (void*)0, 0};
static swig_type_info _swigt__p_Xapian__MSetIterator = {"_p_Xapian__MSetIterator", "Xapian::MSetIterator *", 0, 0, (void*)0, 0};
static swig_type_info _swigt__p_Xapian__MatchDecider = {"_p_Xapian__MatchDecider", "Xapian::MatchDecider *", 0, 0, (void*)0, 0};
static swig_type_info _swigt__p_Xapian__MatchSpy = {"_p_Xapian__MatchSpy", "Xapian::MatchSpy *", 0, 0, (void*)0, 0};
static swig_type_info _swigt__p_Xapian__MultiValueKeyMaker = {"_p_Xapian__MultiValueKeyMaker", "Xapian::MultiValueKeyMaker *", 0, 0, (void*)0, 0};
static swig_type_info _swigt__p_Xapian__MultiValueSorter = {"_p_Xapian__MultiValueSorter", "Xapian::MultiValueSorter *", 0, 0, (void*)0, 0};
static swig_type_info _swigt__p_Xapian__NumberValueRangeProcessor = {"_p_Xapian__NumberValueRangeProcessor", "Xapian::NumberValueRangeProcessor *", 0, 0, (void*)0, 0};
static swig_type_info _swigt__p_Xapian__PositionIterator = {"_p_Xapian__PositionIterator", "Xapian::PositionIterator *", 0, 0, (void*)0, 0};
static swig_type_info _swigt__p_Xapian__PostingIterator = {"_p_Xapian__PostingIterator", "Xapian::PostingIterator *", 0, 0, (void*)0, 0};
static swig_type_info _swigt__p_Xapian__PostingSource = {"_p_Xapian__PostingSource", "Xapian::PostingSource *", 0, 0, (void*)0, 0};
static swig_type_info _swigt__p_Xapian__Query = {"_p_Xapian__Query", "Xapian::Query *", 0, 0, (void*)0, 0};
static swig_type_info _swigt__p_Xapian__QueryParser = {"_p_Xapian__QueryParser", "Xapian::QueryParser *", 0, 0, (void*)0, 0};
static swig_type_info _swigt__p_Xapian__RSet = {"_p_Xapian__RSet", "Xapian::RSet *", 0, 0, (void*)0, 0};
static swig_type_info _swigt__p_Xapian__Registry = {"_p_Xapian__Registry", "Xapian::Registry *", 0, 0, (void*)0, 0};
static swig_type_info _swigt__p_Xapian__SimpleStopper = {"_p_Xapian__SimpleStopper", "Xapian::SimpleStopper *", 0, 0, (void*)0, 0};
static swig_type_info _swigt__p_Xapian__Sorter = {"_p_Xapian__Sorter", "Xapian::Sorter *", 0, 0, (void*)0, 0};
static swig_type_info _swigt__p_Xapian__Stem = {"_p_Xapian__Stem", "Xapian::Stem *", 0, 0, (void*)0, 0};
static swig_type_info _swigt__p_Xapian__StemImplementation = {"_p_Xapian__StemImplementation", "Xapian::StemImplementation *", 0, 0, (void*)0, 0};
static swig_type_info _swigt__p_Xapian__Stopper = {"_p_Xapian__Stopper", "Xapian::Stopper *", 0, 0, (void*)0, 0};
static swig_type_info _swigt__p_Xapian__StringValueRangeProcessor = {"_p_Xapian__StringValueRangeProcessor", "Xapian::StringValueRangeProcessor *", 0, 0, (void*)0, 0};
static swig_type_info _swigt__p_Xapian__TermGenerator = {"_p_Xapian__TermGenerator", "Xapian::TermGenerator *", 0, 0, (void*)0, 0};
static swig_type_info _swigt__p_Xapian__TermIterator = {"_p_Xapian__TermIterator", "Xapian::TermIterator *", 0, 0, (void*)0, 0};
static swig_type_info _swigt__p_Xapian__TradWeight = {"_p_Xapian__TradWeight", "Xapian::TradWeight *", 0, 0, (void*)0, 0};
static swig_type_info _swigt__p_Xapian__ValueCountMatchSpy = {"_p_Xapian__ValueCountMatchSpy", "Xapian::ValueCountMatchSpy *", 0, 0, (void*)0, 0};
static swig_type_info _swigt__p_Xapian__ValueIterator = {"_p_Xapian__ValueIterator", "Xapian::ValueIterator *", 0, 0, (void*)0, 0};
static swig_type_info _swigt__p_Xapian__ValueMapPostingSource = {"_p_Xapian__ValueMapPostingSource", "Xapian::ValueMapPostingSource *", 0, 0, (void*)0, 0};
static swig_type_info _swigt__p_Xapian__ValuePostingSource = {"_p_Xapian__ValuePostingSource", "Xapian::ValuePostingSource *", 0, 0, (void*)0, 0};
static swig_type_info _swigt__p_Xapian__ValueRangeProcessor = {"_p_Xapian__ValueRangeProcessor", "Xapian::ValueRangeProcessor *", 0, 0, (void*)0, 0};
static swig_type_info _swigt__p_Xapian__ValueSetMatchDecider = {"_p_Xapian__ValueSetMatchDecider", "Xapian::ValueSetMatchDecider *", 0, 0, (void*)0, 0};
static swig_type_info _swigt__p_Xapian__ValueWeightPostingSource = {"_p_Xapian__ValueWeightPostingSource", "Xapian::ValueWeightPostingSource *", 0, 0, (void*)0, 0};
static swig_type_info _swigt__p_Xapian__Weight = {"_p_Xapian__Weight", "Xapian::Weight *", 0, 0, (void*)0, 0};
static swig_type_info _swigt__p_Xapian__WritableDatabase = {"_p_Xapian__WritableDatabase", "Xapian::WritableDatabase *", 0, 0, (void*)0, 0};
static swig_type_info _swigt__p_compaction_level = {"_p_compaction_level", "compaction_level *", 0, 0, (void*)0, 0};
static swig_type_info _swigt__p_docid_order = {"_p_docid_order", "docid_order *", 0, 0, (void*)0, 0};
static swig_type_info _swigt__p_double = {"_p_double", "Xapian::doclength *|double *|Xapian::weight *", 0, 0, (void*)0, 0};
static swig_type_info _swigt__p_feature_flag = {"_p_feature_flag", "feature_flag *", 0, 0, (void*)0, 0};
static swig_type_info _swigt__p_int = {"_p_int", "int *|Xapian::doccount_diff *|Xapian::termcount_diff *|Xapian::termpos_diff *|Xapian::valueno_diff *|Xapian::percent *", 0, 0, (void*)0, 0};
static swig_type_info _swigt__p_op = {"_p_op", "op *", 0, 0, (void*)0, 0};
static swig_type_info _swigt__p_std__string = {"_p_std__string", "std::string *", 0, 0, (void*)0, 0};
static swig_type_info _swigt__p_stem_strategy = {"_p_stem_strategy", "stem_strategy *", 0, 0, (void*)0, 0};
static swig_type_info _swigt__p_unsigned_int = {"_p_unsigned_int", "Xapian::timeout *|unsigned int *|Xapian::doccount *|Xapian::termcount *|Xapian::valueno *|Xapian::docid *|Xapian::termpos *", 0, 0, (void*)0, 0};

static swig_type_info *swig_type_initial[] = {
  &_swigt__int,
  &_swigt__p_Xapian__BM25Weight,
  &_swigt__p_Xapian__BoolWeight,
  &_swigt__p_Xapian__Compactor,
  &_swigt__p_Xapian__Database,
  &_swigt__p_Xapian__DateValueRangeProcessor,
  &_swigt__p_Xapian__DecreasingValueWeightPostingSource,
  &_swigt__p_Xapian__Document,
  &_swigt__p_Xapian__ESet,
  &_swigt__p_Xapian__ESetIterator,
  &_swigt__p_Xapian__Enquire,
  &_swigt__p_Xapian__ExpandDecider,
  &_swigt__p_Xapian__FixedWeightPostingSource,
  &_swigt__p_Xapian__KeyMaker,
  &_swigt__p_Xapian__MSet,
  &_swigt__p_Xapian__MSetIterator,
  &_swigt__p_Xapian__MatchDecider,
  &_swigt__p_Xapian__MatchSpy,
  &_swigt__p_Xapian__MultiValueKeyMaker,
  &_swigt__p_Xapian__MultiValueSorter,
  &_swigt__p_Xapian__NumberValueRangeProcessor,
  &_swigt__p_Xapian__PositionIterator,
  &_swigt__p_Xapian__PostingIterator,
  &_swigt__p_Xapian__PostingSource,
  &_swigt__p_Xapian__Query,
  &_swigt__p_Xapian__QueryParser,
  &_swigt__p_Xapian__RSet,
  &_swigt__p_Xapian__Registry,
  &_swigt__p_Xapian__SimpleStopper,
  &_swigt__p_Xapian__Sorter,
  &_swigt__p_Xapian__Stem,
  &_swigt__p_Xapian__StemImplementation,
  &_swigt__p_Xapian__Stopper,
  &_swigt__p_Xapian__StringValueRangeProcessor,
  &_swigt__p_Xapian__TermGenerator,
  &_swigt__p_Xapian__TermIterator,
  &_swigt__p_Xapian__TradWeight,
  &_swigt__p_Xapian__ValueCountMatchSpy,
  &_swigt__p_Xapian__ValueIterator,
  &_swigt__p_Xapian__ValueMapPostingSource,
  &_swigt__p_Xapian__ValuePostingSource,
  &_swigt__p_Xapian__ValueRangeProcessor,
  &_swigt__p_Xapian__ValueSetMatchDecider,
  &_swigt__p_Xapian__ValueWeightPostingSource,
  &_swigt__p_Xapian__Weight,
  &_swigt__p_Xapian__WritableDatabase,
  &_swigt__p_compaction_level,
  &_swigt__p_docid_order,
  &_swigt__p_double,
  &_swigt__p_feature_flag,
  &_swigt__p_int,
  &_swigt__p_op,
  &_swigt__p_std__string,
  &_swigt__p_stem_strategy,
  &_swigt__p_unsigned_int,
};

static swig_cast_info _swigc__int[] = {  {&_swigt__int, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_Xapian__BM25Weight[] = {  {&_swigt__p_Xapian__BM25Weight, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_Xapian__BoolWeight[] = {  {&_swigt__p_Xapian__BoolWeight, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_Xapian__Compactor[] = {  {&_swigt__p_Xapian__Compactor, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_Xapian__Database[] = {  {&_swigt__p_Xapian__Database, 0, 0, 0},  {&_swigt__p_Xapian__WritableDatabase, _p_Xapian__WritableDatabaseTo_p_Xapian__Database, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_Xapian__DateValueRangeProcessor[] = {  {&_swigt__p_Xapian__DateValueRangeProcessor, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_Xapian__DecreasingValueWeightPostingSource[] = {  {&_swigt__p_Xapian__DecreasingValueWeightPostingSource, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_Xapian__Document[] = {  {&_swigt__p_Xapian__Document, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_Xapian__ESet[] = {  {&_swigt__p_Xapian__ESet, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_Xapian__ESetIterator[] = {  {&_swigt__p_Xapian__ESetIterator, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_Xapian__Enquire[] = {  {&_swigt__p_Xapian__Enquire, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_Xapian__ExpandDecider[] = {  {&_swigt__p_Xapian__ExpandDecider, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_Xapian__FixedWeightPostingSource[] = {  {&_swigt__p_Xapian__FixedWeightPostingSource, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_Xapian__KeyMaker[] = {  {&_swigt__p_Xapian__Sorter, _p_Xapian__SorterTo_p_Xapian__KeyMaker, 0, 0},  {&_swigt__p_Xapian__MultiValueSorter, _p_Xapian__MultiValueSorterTo_p_Xapian__KeyMaker, 0, 0},  {&_swigt__p_Xapian__KeyMaker, 0, 0, 0},  {&_swigt__p_Xapian__MultiValueKeyMaker, _p_Xapian__MultiValueKeyMakerTo_p_Xapian__KeyMaker, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_Xapian__MSet[] = {  {&_swigt__p_Xapian__MSet, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_Xapian__MSetIterator[] = {  {&_swigt__p_Xapian__MSetIterator, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_Xapian__MatchDecider[] = {  {&_swigt__p_Xapian__MatchDecider, 0, 0, 0},  {&_swigt__p_Xapian__ValueSetMatchDecider, _p_Xapian__ValueSetMatchDeciderTo_p_Xapian__MatchDecider, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_Xapian__MatchSpy[] = {  {&_swigt__p_Xapian__MatchSpy, 0, 0, 0},  {&_swigt__p_Xapian__ValueCountMatchSpy, _p_Xapian__ValueCountMatchSpyTo_p_Xapian__MatchSpy, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_Xapian__MultiValueKeyMaker[] = {  {&_swigt__p_Xapian__MultiValueKeyMaker, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_Xapian__MultiValueSorter[] = {  {&_swigt__p_Xapian__MultiValueSorter, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_Xapian__NumberValueRangeProcessor[] = {  {&_swigt__p_Xapian__NumberValueRangeProcessor, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_Xapian__PositionIterator[] = {  {&_swigt__p_Xapian__PositionIterator, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_Xapian__PostingIterator[] = {  {&_swigt__p_Xapian__PostingIterator, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_Xapian__PostingSource[] = {  {&_swigt__p_Xapian__PostingSource, 0, 0, 0},  {&_swigt__p_Xapian__ValuePostingSource, _p_Xapian__ValuePostingSourceTo_p_Xapian__PostingSource, 0, 0},  {&_swigt__p_Xapian__ValueWeightPostingSource, _p_Xapian__ValueWeightPostingSourceTo_p_Xapian__PostingSource, 0, 0},  {&_swigt__p_Xapian__DecreasingValueWeightPostingSource, _p_Xapian__DecreasingValueWeightPostingSourceTo_p_Xapian__PostingSource, 0, 0},  {&_swigt__p_Xapian__ValueMapPostingSource, _p_Xapian__ValueMapPostingSourceTo_p_Xapian__PostingSource, 0, 0},  {&_swigt__p_Xapian__FixedWeightPostingSource, _p_Xapian__FixedWeightPostingSourceTo_p_Xapian__PostingSource, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_Xapian__Query[] = {  {&_swigt__p_Xapian__Query, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_Xapian__QueryParser[] = {  {&_swigt__p_Xapian__QueryParser, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_Xapian__RSet[] = {  {&_swigt__p_Xapian__RSet, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_Xapian__Registry[] = {  {&_swigt__p_Xapian__Registry, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_Xapian__SimpleStopper[] = {  {&_swigt__p_Xapian__SimpleStopper, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_Xapian__Sorter[] = {  {&_swigt__p_Xapian__Sorter, 0, 0, 0},  {&_swigt__p_Xapian__MultiValueSorter, _p_Xapian__MultiValueSorterTo_p_Xapian__Sorter, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_Xapian__Stem[] = {  {&_swigt__p_Xapian__Stem, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_Xapian__StemImplementation[] = {  {&_swigt__p_Xapian__StemImplementation, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_Xapian__Stopper[] = {  {&_swigt__p_Xapian__Stopper, 0, 0, 0},  {&_swigt__p_Xapian__SimpleStopper, _p_Xapian__SimpleStopperTo_p_Xapian__Stopper, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_Xapian__StringValueRangeProcessor[] = {  {&_swigt__p_Xapian__StringValueRangeProcessor, 0, 0, 0},  {&_swigt__p_Xapian__DateValueRangeProcessor, _p_Xapian__DateValueRangeProcessorTo_p_Xapian__StringValueRangeProcessor, 0, 0},  {&_swigt__p_Xapian__NumberValueRangeProcessor, _p_Xapian__NumberValueRangeProcessorTo_p_Xapian__StringValueRangeProcessor, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_Xapian__TermGenerator[] = {  {&_swigt__p_Xapian__TermGenerator, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_Xapian__TermIterator[] = {  {&_swigt__p_Xapian__TermIterator, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_Xapian__TradWeight[] = {  {&_swigt__p_Xapian__TradWeight, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_Xapian__ValueCountMatchSpy[] = {  {&_swigt__p_Xapian__ValueCountMatchSpy, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_Xapian__ValueIterator[] = {  {&_swigt__p_Xapian__ValueIterator, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_Xapian__ValueMapPostingSource[] = {  {&_swigt__p_Xapian__ValueMapPostingSource, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_Xapian__ValuePostingSource[] = {  {&_swigt__p_Xapian__ValuePostingSource, 0, 0, 0},  {&_swigt__p_Xapian__ValueWeightPostingSource, _p_Xapian__ValueWeightPostingSourceTo_p_Xapian__ValuePostingSource, 0, 0},  {&_swigt__p_Xapian__DecreasingValueWeightPostingSource, _p_Xapian__DecreasingValueWeightPostingSourceTo_p_Xapian__ValuePostingSource, 0, 0},  {&_swigt__p_Xapian__ValueMapPostingSource, _p_Xapian__ValueMapPostingSourceTo_p_Xapian__ValuePostingSource, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_Xapian__ValueRangeProcessor[] = {  {&_swigt__p_Xapian__ValueRangeProcessor, 0, 0, 0},  {&_swigt__p_Xapian__StringValueRangeProcessor, _p_Xapian__StringValueRangeProcessorTo_p_Xapian__ValueRangeProcessor, 0, 0},  {&_swigt__p_Xapian__DateValueRangeProcessor, _p_Xapian__DateValueRangeProcessorTo_p_Xapian__ValueRangeProcessor, 0, 0},  {&_swigt__p_Xapian__NumberValueRangeProcessor, _p_Xapian__NumberValueRangeProcessorTo_p_Xapian__ValueRangeProcessor, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_Xapian__ValueSetMatchDecider[] = {  {&_swigt__p_Xapian__ValueSetMatchDecider, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_Xapian__ValueWeightPostingSource[] = {  {&_swigt__p_Xapian__ValueWeightPostingSource, 0, 0, 0},  {&_swigt__p_Xapian__DecreasingValueWeightPostingSource, _p_Xapian__DecreasingValueWeightPostingSourceTo_p_Xapian__ValueWeightPostingSource, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_Xapian__Weight[] = {  {&_swigt__p_Xapian__BoolWeight, _p_Xapian__BoolWeightTo_p_Xapian__Weight, 0, 0},  {&_swigt__p_Xapian__TradWeight, _p_Xapian__TradWeightTo_p_Xapian__Weight, 0, 0},  {&_swigt__p_Xapian__Weight, 0, 0, 0},  {&_swigt__p_Xapian__BM25Weight, _p_Xapian__BM25WeightTo_p_Xapian__Weight, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_Xapian__WritableDatabase[] = {  {&_swigt__p_Xapian__WritableDatabase, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_compaction_level[] = {  {&_swigt__p_compaction_level, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_docid_order[] = {  {&_swigt__p_docid_order, 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_feature_flag[] = {  {&_swigt__p_feature_flag, 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_op[] = {  {&_swigt__p_op, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_std__string[] = {  {&_swigt__p_std__string, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_stem_strategy[] = {  {&_swigt__p_stem_strategy, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_unsigned_int[] = {  {&_swigt__p_unsigned_int, 0, 0, 0},{0, 0, 0, 0}};

static swig_cast_info *swig_cast_initial[] = {
  _swigc__int,
  _swigc__p_Xapian__BM25Weight,
  _swigc__p_Xapian__BoolWeight,
  _swigc__p_Xapian__Compactor,
  _swigc__p_Xapian__Database,
  _swigc__p_Xapian__DateValueRangeProcessor,
  _swigc__p_Xapian__DecreasingValueWeightPostingSource,
  _swigc__p_Xapian__Document,
  _swigc__p_Xapian__ESet,
  _swigc__p_Xapian__ESetIterator,
  _swigc__p_Xapian__Enquire,
  _swigc__p_Xapian__ExpandDecider,
  _swigc__p_Xapian__FixedWeightPostingSource,
  _swigc__p_Xapian__KeyMaker,
  _swigc__p_Xapian__MSet,
  _swigc__p_Xapian__MSetIterator,
  _swigc__p_Xapian__MatchDecider,
  _swigc__p_Xapian__MatchSpy,
  _swigc__p_Xapian__MultiValueKeyMaker,
  _swigc__p_Xapian__MultiValueSorter,
  _swigc__p_Xapian__NumberValueRangeProcessor,
  _swigc__p_Xapian__PositionIterator,
  _swigc__p_Xapian__PostingIterator,
  _swigc__p_Xapian__PostingSource,
  _swigc__p_Xapian__Query,
  _swigc__p_Xapian__QueryParser,
  _swigc__p_Xapian__RSet,
  _swigc__p_Xapian__Registry,
  _swigc__p_Xapian__SimpleStopper,
  _swigc__p_Xapian__Sorter,
  _swigc__p_Xapian__Stem,
  _swigc__p_Xapian__StemImplementation,
  _swigc__p_Xapian__Stopper,
  _swigc__p_Xapian__StringValueRangeProcessor,
  _swigc__p_Xapian__TermGenerator,
  _swigc__p_Xapian__TermIterator,
  _swigc__p_Xapian__TradWeight,
  _swigc__p_Xapian__ValueCountMatchSpy,
  _swigc__p_Xapian__ValueIterator,
  _swigc__p_Xapian__ValueMapPostingSource,
  _swigc__p_Xapian__ValuePostingSource,
  _swigc__p_Xapian__ValueRangeProcessor,
  _swigc__p_Xapian__ValueSetMatchDecider,
  _swigc__p_Xapian__ValueWeightPostingSource,
  _swigc__p_Xapian__Weight,
  _swigc__p_Xapian__WritableDatabase,
  _swigc__p_compaction_level,
  _swigc__p_docid_order,
  _swigc__p_double,
  _swigc__p_feature_flag,
  _swigc__p_int,
  _swigc__p_op,
  _swigc__p_std__string,
  _swigc__p_stem_strategy,
  _swigc__p_unsigned_int,
};


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

/* end header section */

#include "xapian_wrap.h"

SwigDirector_PostingSource::SwigDirector_PostingSource(zval *self TSRMLS_DC): Xapian::PostingSource(), Swig::Director(self TSRMLS_CC) {
  
}



SwigDirector_PostingSource::~SwigDirector_PostingSource() {
}

Xapian::doccount SwigDirector_PostingSource::get_termfreq_min() const {
  TSRMLS_FETCH_FROM_CTX(swig_zts_ctx);
  Xapian::doccount c_result;
  zval **args = NULL;
  zval *result, funcname;
  MAKE_STD_ZVAL(result);
  ZVAL_STRING(&funcname, (char *)"get_termfreq_min", 0);
  if (!swig_self) {
    SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  }
  
  call_user_function(EG(function_table), (zval**)&swig_self, &funcname,
    result, 0, args TSRMLS_CC);
  
  /*@SWIG:/data/home/olly/tmp/xapian-svn-snapshot/tags/1.2.8/xapian/swig/Lib/php/utils.i,7,CONVERT_INT_IN@*/
  convert_to_long_ex(&result);
  c_result = (Xapian::doccount) Z_LVAL_PP(&result);
  /*@SWIG@*/;
  
  FREE_ZVAL(result);
  return (Xapian::doccount) c_result;
fail:
  SWIG_ZEND_ERROR_NORETURN(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


Xapian::doccount SwigDirector_PostingSource::get_termfreq_est() const {
  TSRMLS_FETCH_FROM_CTX(swig_zts_ctx);
  Xapian::doccount c_result;
  zval **args = NULL;
  zval *result, funcname;
  MAKE_STD_ZVAL(result);
  ZVAL_STRING(&funcname, (char *)"get_termfreq_est", 0);
  if (!swig_self) {
    SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  }
  
  call_user_function(EG(function_table), (zval**)&swig_self, &funcname,
    result, 0, args TSRMLS_CC);
  
  /*@SWIG:/data/home/olly/tmp/xapian-svn-snapshot/tags/1.2.8/xapian/swig/Lib/php/utils.i,7,CONVERT_INT_IN@*/
  convert_to_long_ex(&result);
  c_result = (Xapian::doccount) Z_LVAL_PP(&result);
  /*@SWIG@*/;
  
  FREE_ZVAL(result);
  return (Xapian::doccount) c_result;
fail:
  SWIG_ZEND_ERROR_NORETURN(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


Xapian::doccount SwigDirector_PostingSource::get_termfreq_max() const {
  TSRMLS_FETCH_FROM_CTX(swig_zts_ctx);
  Xapian::doccount c_result;
  zval **args = NULL;
  zval *result, funcname;
  MAKE_STD_ZVAL(result);
  ZVAL_STRING(&funcname, (char *)"get_termfreq_max", 0);
  if (!swig_self) {
    SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  }
  
  call_user_function(EG(function_table), (zval**)&swig_self, &funcname,
    result, 0, args TSRMLS_CC);
  
  /*@SWIG:/data/home/olly/tmp/xapian-svn-snapshot/tags/1.2.8/xapian/swig/Lib/php/utils.i,7,CONVERT_INT_IN@*/
  convert_to_long_ex(&result);
  c_result = (Xapian::doccount) Z_LVAL_PP(&result);
  /*@SWIG@*/;
  
  FREE_ZVAL(result);
  return (Xapian::doccount) c_result;
fail:
  SWIG_ZEND_ERROR_NORETURN(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


Xapian::weight SwigDirector_PostingSource::get_weight() const {
  TSRMLS_FETCH_FROM_CTX(swig_zts_ctx);
  Xapian::weight c_result;
  zval **args = NULL;
  zval *result, funcname;
  MAKE_STD_ZVAL(result);
  ZVAL_STRING(&funcname, (char *)"get_weight", 0);
  if (!swig_self) {
    SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  }
  
  call_user_function(EG(function_table), (zval**)&swig_self, &funcname,
    result, 0, args TSRMLS_CC);
  
  /*@SWIG:/data/home/olly/tmp/xapian-svn-snapshot/tags/1.2.8/xapian/swig/Lib/php/utils.i,52,CONVERT_FLOAT_IN@*/
  convert_to_double_ex(&result);
  c_result = (Xapian::weight) Z_DVAL_PP(&result);
  /*@SWIG@*/;
  
  FREE_ZVAL(result);
  return (Xapian::weight) c_result;
fail:
  SWIG_ZEND_ERROR_NORETURN(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


Xapian::docid SwigDirector_PostingSource::get_docid() const {
  TSRMLS_FETCH_FROM_CTX(swig_zts_ctx);
  Xapian::docid c_result;
  zval **args = NULL;
  zval *result, funcname;
  MAKE_STD_ZVAL(result);
  ZVAL_STRING(&funcname, (char *)"get_docid", 0);
  if (!swig_self) {
    SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  }
  
  call_user_function(EG(function_table), (zval**)&swig_self, &funcname,
    result, 0, args TSRMLS_CC);
  
  /*@SWIG:/data/home/olly/tmp/xapian-svn-snapshot/tags/1.2.8/xapian/swig/Lib/php/utils.i,7,CONVERT_INT_IN@*/
  convert_to_long_ex(&result);
  c_result = (Xapian::docid) Z_LVAL_PP(&result);
  /*@SWIG@*/;
  
  FREE_ZVAL(result);
  return (Xapian::docid) c_result;
fail:
  SWIG_ZEND_ERROR_NORETURN(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


void SwigDirector_PostingSource::next(Xapian::weight min_wt) {
  TSRMLS_FETCH_FROM_CTX(swig_zts_ctx);
  zval *args[1];
  zval *result, funcname;
  MAKE_STD_ZVAL(result);
  ZVAL_STRING(&funcname, (char *)"next", 0);
  if (!swig_self) {
    SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  }
  
  zval obj0;
  args[0] = &obj0;
  {
    ZVAL_DOUBLE(&obj0,min_wt);
  }
  call_user_function(EG(function_table), (zval**)&swig_self, &funcname,
    result, 1, args TSRMLS_CC);
  FREE_ZVAL(result);
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


void SwigDirector_PostingSource::skip_to(Xapian::docid did, Xapian::weight min_wt) {
  TSRMLS_FETCH_FROM_CTX(swig_zts_ctx);
  zval *args[2];
  zval *result, funcname;
  MAKE_STD_ZVAL(result);
  ZVAL_STRING(&funcname, (char *)"skip_to", 0);
  if (!swig_self) {
    SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  }
  
  zval obj0;
  args[0] = &obj0;
  {
    ZVAL_LONG(&obj0,did);
  }
  zval obj1;
  args[1] = &obj1;
  {
    ZVAL_DOUBLE(&obj1,min_wt);
  }
  call_user_function(EG(function_table), (zval**)&swig_self, &funcname,
    result, 2, args TSRMLS_CC);
  FREE_ZVAL(result);
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


bool SwigDirector_PostingSource::check(Xapian::docid did, Xapian::weight min_wt) {
  TSRMLS_FETCH_FROM_CTX(swig_zts_ctx);
  bool c_result;
  zval *args[2];
  zval *result, funcname;
  MAKE_STD_ZVAL(result);
  ZVAL_STRING(&funcname, (char *)"check", 0);
  if (!swig_self) {
    SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  }
  
  zval obj0;
  args[0] = &obj0;
  {
    ZVAL_LONG(&obj0,did);
  }
  zval obj1;
  args[1] = &obj1;
  {
    ZVAL_DOUBLE(&obj1,min_wt);
  }
  call_user_function(EG(function_table), (zval**)&swig_self, &funcname,
    result, 2, args TSRMLS_CC);
  
  /*@SWIG:/data/home/olly/tmp/xapian-svn-snapshot/tags/1.2.8/xapian/swig/Lib/php/utils.i,2,CONVERT_BOOL_IN@*/
  convert_to_boolean_ex(&result);
  c_result = (bool) Z_LVAL_PP(&result);
  /*@SWIG@*/;
  
  FREE_ZVAL(result);
  return (bool) c_result;
fail:
  SWIG_ZEND_ERROR_NORETURN(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


bool SwigDirector_PostingSource::at_end() const {
  TSRMLS_FETCH_FROM_CTX(swig_zts_ctx);
  bool c_result;
  zval **args = NULL;
  zval *result, funcname;
  MAKE_STD_ZVAL(result);
  ZVAL_STRING(&funcname, (char *)"at_end", 0);
  if (!swig_self) {
    SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  }
  
  call_user_function(EG(function_table), (zval**)&swig_self, &funcname,
    result, 0, args TSRMLS_CC);
  
  /*@SWIG:/data/home/olly/tmp/xapian-svn-snapshot/tags/1.2.8/xapian/swig/Lib/php/utils.i,2,CONVERT_BOOL_IN@*/
  convert_to_boolean_ex(&result);
  c_result = (bool) Z_LVAL_PP(&result);
  /*@SWIG@*/;
  
  FREE_ZVAL(result);
  return (bool) c_result;
fail:
  SWIG_ZEND_ERROR_NORETURN(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


Xapian::PostingSource *SwigDirector_PostingSource::clone() const {
  TSRMLS_FETCH_FROM_CTX(swig_zts_ctx);
  return Xapian::PostingSource::clone();
fail:
  SWIG_ZEND_ERROR_NORETURN(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


std::string SwigDirector_PostingSource::name() const {
  TSRMLS_FETCH_FROM_CTX(swig_zts_ctx);
  std::string c_result;
  zval **args = NULL;
  zval *result, funcname;
  MAKE_STD_ZVAL(result);
  ZVAL_STRING(&funcname, (char *)"name", 0);
  if (!swig_self) {
    SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  }
  
  call_user_function(EG(function_table), (zval**)&swig_self, &funcname,
    result, 0, args TSRMLS_CC);
  
  convert_to_string_ex(&result);
  c_result.assign(Z_STRVAL_PP(&result), Z_STRLEN_PP(&result));
  
  FREE_ZVAL(result);
  return (std::string) c_result;
fail:
  SWIG_ZEND_ERROR_NORETURN(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


std::string SwigDirector_PostingSource::serialise() const {
  TSRMLS_FETCH_FROM_CTX(swig_zts_ctx);
  return Xapian::PostingSource::serialise();
fail:
  SWIG_ZEND_ERROR_NORETURN(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


Xapian::PostingSource *SwigDirector_PostingSource::unserialise(std::string const &s) const {
  TSRMLS_FETCH_FROM_CTX(swig_zts_ctx);
  return Xapian::PostingSource::unserialise(s);
fail:
  SWIG_ZEND_ERROR_NORETURN(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


void SwigDirector_PostingSource::init(Xapian::Database const &db) {
  TSRMLS_FETCH_FROM_CTX(swig_zts_ctx);
  zval *args[1];
  zval *result, funcname;
  MAKE_STD_ZVAL(result);
  ZVAL_STRING(&funcname, (char *)"init", 0);
  if (!swig_self) {
    SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  }
  
  zval obj0;
  args[0] = &obj0;
  
  SWIG_SetPointerZval(&obj0, (void *)&db, SWIGTYPE_p_Xapian__Database, (0)|2);
  
  call_user_function(EG(function_table), (zval**)&swig_self, &funcname,
    result, 1, args TSRMLS_CC);
  FREE_ZVAL(result);
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


std::string SwigDirector_PostingSource::get_description() const {
  TSRMLS_FETCH_FROM_CTX(swig_zts_ctx);
  std::string c_result;
  zval **args = NULL;
  zval *result, funcname;
  MAKE_STD_ZVAL(result);
  ZVAL_STRING(&funcname, (char *)"get_description", 0);
  if (!swig_self) {
    SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  }
  
  call_user_function(EG(function_table), (zval**)&swig_self, &funcname,
    result, 0, args TSRMLS_CC);
  
  convert_to_string_ex(&result);
  c_result.assign(Z_STRVAL_PP(&result), Z_STRLEN_PP(&result));
  
  FREE_ZVAL(result);
  return (std::string) c_result;
fail:
  SWIG_ZEND_ERROR_NORETURN(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


SwigDirector_MatchDecider::SwigDirector_MatchDecider(zval *self TSRMLS_DC): Xapian::MatchDecider(), Swig::Director(self TSRMLS_CC) {
  
}



bool SwigDirector_MatchDecider::operator ()(Xapian::Document const &doc) const {
  TSRMLS_FETCH_FROM_CTX(swig_zts_ctx);
  bool c_result;
  zval *args[1];
  zval *result, funcname;
  MAKE_STD_ZVAL(result);
  ZVAL_STRING(&funcname, (char *)"apply", 0);
  if (!swig_self) {
    SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  }
  
  zval obj0;
  args[0] = &obj0;
  
  SWIG_SetPointerZval(&obj0, (void *)&doc, SWIGTYPE_p_Xapian__Document, (0)|2);
  
  call_user_function(EG(function_table), (zval**)&swig_self, &funcname,
    result, 1, args TSRMLS_CC);
  
  /*@SWIG:/data/home/olly/tmp/xapian-svn-snapshot/tags/1.2.8/xapian/swig/Lib/php/utils.i,2,CONVERT_BOOL_IN@*/
  convert_to_boolean_ex(&result);
  c_result = (bool) Z_LVAL_PP(&result);
  /*@SWIG@*/;
  
  FREE_ZVAL(result);
  return (bool) c_result;
fail:
  SWIG_ZEND_ERROR_NORETURN(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


SwigDirector_MatchDecider::~SwigDirector_MatchDecider() {
}

SwigDirector_ExpandDecider::SwigDirector_ExpandDecider(zval *self TSRMLS_DC): Xapian::ExpandDecider(), Swig::Director(self TSRMLS_CC) {
  
}



bool SwigDirector_ExpandDecider::operator ()(std::string const &term) const {
  TSRMLS_FETCH_FROM_CTX(swig_zts_ctx);
  bool c_result;
  zval *args[1];
  zval *result, funcname;
  MAKE_STD_ZVAL(result);
  ZVAL_STRING(&funcname, (char *)"apply", 0);
  if (!swig_self) {
    SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  }
  
  zval obj0;
  args[0] = &obj0;
  
  ZVAL_STRINGL(&obj0, const_cast<char*>(term.data()), term.size(), 1);
  
  call_user_function(EG(function_table), (zval**)&swig_self, &funcname,
    result, 1, args TSRMLS_CC);
  
  /*@SWIG:/data/home/olly/tmp/xapian-svn-snapshot/tags/1.2.8/xapian/swig/Lib/php/utils.i,2,CONVERT_BOOL_IN@*/
  convert_to_boolean_ex(&result);
  c_result = (bool) Z_LVAL_PP(&result);
  /*@SWIG@*/;
  
  FREE_ZVAL(result);
  return (bool) c_result;
fail:
  SWIG_ZEND_ERROR_NORETURN(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


SwigDirector_ExpandDecider::~SwigDirector_ExpandDecider() {
}

SwigDirector_MatchSpy::SwigDirector_MatchSpy(zval *self TSRMLS_DC): Xapian::MatchSpy(), Swig::Director(self TSRMLS_CC) {
  
}



SwigDirector_MatchSpy::~SwigDirector_MatchSpy() {
}

void SwigDirector_MatchSpy::operator ()(Xapian::Document const &doc, Xapian::weight wt) {
  TSRMLS_FETCH_FROM_CTX(swig_zts_ctx);
  zval *args[2];
  zval *result, funcname;
  MAKE_STD_ZVAL(result);
  ZVAL_STRING(&funcname, (char *)"apply", 0);
  if (!swig_self) {
    SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  }
  
  zval obj0;
  args[0] = &obj0;
  
  SWIG_SetPointerZval(&obj0, (void *)&doc, SWIGTYPE_p_Xapian__Document, (0)|2);
  
  zval obj1;
  args[1] = &obj1;
  {
    ZVAL_DOUBLE(&obj1,wt);
  }
  call_user_function(EG(function_table), (zval**)&swig_self, &funcname,
    result, 2, args TSRMLS_CC);
  FREE_ZVAL(result);
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


Xapian::MatchSpy *SwigDirector_MatchSpy::clone() const {
  TSRMLS_FETCH_FROM_CTX(swig_zts_ctx);
  return Xapian::MatchSpy::clone();
fail:
  SWIG_ZEND_ERROR_NORETURN(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


std::string SwigDirector_MatchSpy::name() const {
  TSRMLS_FETCH_FROM_CTX(swig_zts_ctx);
  std::string c_result;
  zval **args = NULL;
  zval *result, funcname;
  MAKE_STD_ZVAL(result);
  ZVAL_STRING(&funcname, (char *)"name", 0);
  if (!swig_self) {
    SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  }
  
  call_user_function(EG(function_table), (zval**)&swig_self, &funcname,
    result, 0, args TSRMLS_CC);
  
  convert_to_string_ex(&result);
  c_result.assign(Z_STRVAL_PP(&result), Z_STRLEN_PP(&result));
  
  FREE_ZVAL(result);
  return (std::string) c_result;
fail:
  SWIG_ZEND_ERROR_NORETURN(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


std::string SwigDirector_MatchSpy::serialise() const {
  TSRMLS_FETCH_FROM_CTX(swig_zts_ctx);
  return Xapian::MatchSpy::serialise();
fail:
  SWIG_ZEND_ERROR_NORETURN(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


Xapian::MatchSpy *SwigDirector_MatchSpy::unserialise(std::string const &s, Xapian::Registry const &context) const {
  TSRMLS_FETCH_FROM_CTX(swig_zts_ctx);
  return Xapian::MatchSpy::unserialise(s,context);
fail:
  SWIG_ZEND_ERROR_NORETURN(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


std::string SwigDirector_MatchSpy::serialise_results() const {
  TSRMLS_FETCH_FROM_CTX(swig_zts_ctx);
  return Xapian::MatchSpy::serialise_results();
fail:
  SWIG_ZEND_ERROR_NORETURN(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


void SwigDirector_MatchSpy::merge_results(std::string const &s) {
  TSRMLS_FETCH_FROM_CTX(swig_zts_ctx);
  zval *args[1];
  zval *result, funcname;
  MAKE_STD_ZVAL(result);
  ZVAL_STRING(&funcname, (char *)"merge_results", 0);
  if (!swig_self) {
    SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  }
  
  zval obj0;
  args[0] = &obj0;
  
  ZVAL_STRINGL(&obj0, const_cast<char*>(s.data()), s.size(), 1);
  
  call_user_function(EG(function_table), (zval**)&swig_self, &funcname,
    result, 1, args TSRMLS_CC);
  FREE_ZVAL(result);
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


std::string SwigDirector_MatchSpy::get_description() const {
  TSRMLS_FETCH_FROM_CTX(swig_zts_ctx);
  std::string c_result;
  zval **args = NULL;
  zval *result, funcname;
  MAKE_STD_ZVAL(result);
  ZVAL_STRING(&funcname, (char *)"get_description", 0);
  if (!swig_self) {
    SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  }
  
  call_user_function(EG(function_table), (zval**)&swig_self, &funcname,
    result, 0, args TSRMLS_CC);
  
  convert_to_string_ex(&result);
  c_result.assign(Z_STRVAL_PP(&result), Z_STRLEN_PP(&result));
  
  FREE_ZVAL(result);
  return (std::string) c_result;
fail:
  SWIG_ZEND_ERROR_NORETURN(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


SwigDirector_Stopper::SwigDirector_Stopper(zval *self TSRMLS_DC): Xapian::Stopper(), Swig::Director(self TSRMLS_CC) {
  
}



bool SwigDirector_Stopper::operator ()(std::string const &term) const {
  TSRMLS_FETCH_FROM_CTX(swig_zts_ctx);
  bool c_result;
  zval *args[1];
  zval *result, funcname;
  MAKE_STD_ZVAL(result);
  ZVAL_STRING(&funcname, (char *)"apply", 0);
  if (!swig_self) {
    SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  }
  
  zval obj0;
  args[0] = &obj0;
  
  ZVAL_STRINGL(&obj0, const_cast<char*>(term.data()), term.size(), 1);
  
  call_user_function(EG(function_table), (zval**)&swig_self, &funcname,
    result, 1, args TSRMLS_CC);
  
  /*@SWIG:/data/home/olly/tmp/xapian-svn-snapshot/tags/1.2.8/xapian/swig/Lib/php/utils.i,2,CONVERT_BOOL_IN@*/
  convert_to_boolean_ex(&result);
  c_result = (bool) Z_LVAL_PP(&result);
  /*@SWIG@*/;
  
  FREE_ZVAL(result);
  return (bool) c_result;
fail:
  SWIG_ZEND_ERROR_NORETURN(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


SwigDirector_Stopper::~SwigDirector_Stopper() {
}

std::string SwigDirector_Stopper::get_description() const {
  TSRMLS_FETCH_FROM_CTX(swig_zts_ctx);
  std::string c_result;
  zval **args = NULL;
  zval *result, funcname;
  MAKE_STD_ZVAL(result);
  ZVAL_STRING(&funcname, (char *)"get_description", 0);
  if (!swig_self) {
    SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  }
  
  call_user_function(EG(function_table), (zval**)&swig_self, &funcname,
    result, 0, args TSRMLS_CC);
  
  convert_to_string_ex(&result);
  c_result.assign(Z_STRVAL_PP(&result), Z_STRLEN_PP(&result));
  
  FREE_ZVAL(result);
  return (std::string) c_result;
fail:
  SWIG_ZEND_ERROR_NORETURN(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


SwigDirector_ValueRangeProcessor::SwigDirector_ValueRangeProcessor(zval *self TSRMLS_DC): Xapian::ValueRangeProcessor(), Swig::Director(self TSRMLS_CC) {
  
}



SwigDirector_ValueRangeProcessor::~SwigDirector_ValueRangeProcessor() {
}

Xapian::valueno SwigDirector_ValueRangeProcessor::operator ()(std::string &begin, std::string &end) {
  TSRMLS_FETCH_FROM_CTX(swig_zts_ctx);
  Xapian::valueno c_result;
  zval *args[2];
  zval *result, funcname;
  MAKE_STD_ZVAL(result);
  ZVAL_STRING(&funcname, (char *)"apply", 0);
  if (!swig_self) {
    SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  }
  
  zval obj0;
  args[0] = &obj0;
  
  SWIG_SetPointerZval(&obj0, (void *)&begin, SWIGTYPE_p_std__string, (0)|2);
  
  zval obj1;
  args[1] = &obj1;
  
  SWIG_SetPointerZval(&obj1, (void *)&end, SWIGTYPE_p_std__string, (0)|2);
  
  call_user_function(EG(function_table), (zval**)&swig_self, &funcname,
    result, 2, args TSRMLS_CC);
  
  /*@SWIG:/data/home/olly/tmp/xapian-svn-snapshot/tags/1.2.8/xapian/swig/Lib/php/utils.i,7,CONVERT_INT_IN@*/
  convert_to_long_ex(&result);
  c_result = (Xapian::valueno) Z_LVAL_PP(&result);
  /*@SWIG@*/;
  
  FREE_ZVAL(result);
  return (Xapian::valueno) c_result;
fail:
  SWIG_ZEND_ERROR_NORETURN(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


SwigDirector_StemImplementation::SwigDirector_StemImplementation(zval *self TSRMLS_DC): Xapian::StemImplementation(), Swig::Director(self TSRMLS_CC) {
  
}



SwigDirector_StemImplementation::~SwigDirector_StemImplementation() {
}

std::string SwigDirector_StemImplementation::operator ()(std::string const &word) {
  TSRMLS_FETCH_FROM_CTX(swig_zts_ctx);
  std::string c_result;
  zval *args[1];
  zval *result, funcname;
  MAKE_STD_ZVAL(result);
  ZVAL_STRING(&funcname, (char *)"apply", 0);
  if (!swig_self) {
    SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  }
  
  zval obj0;
  args[0] = &obj0;
  
  ZVAL_STRINGL(&obj0, const_cast<char*>(word.data()), word.size(), 1);
  
  call_user_function(EG(function_table), (zval**)&swig_self, &funcname,
    result, 1, args TSRMLS_CC);
  
  convert_to_string_ex(&result);
  c_result.assign(Z_STRVAL_PP(&result), Z_STRLEN_PP(&result));
  
  FREE_ZVAL(result);
  return (std::string) c_result;
fail:
  SWIG_ZEND_ERROR_NORETURN(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


std::string SwigDirector_StemImplementation::get_description() const {
  TSRMLS_FETCH_FROM_CTX(swig_zts_ctx);
  std::string c_result;
  zval **args = NULL;
  zval *result, funcname;
  MAKE_STD_ZVAL(result);
  ZVAL_STRING(&funcname, (char *)"get_description", 0);
  if (!swig_self) {
    SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  }
  
  call_user_function(EG(function_table), (zval**)&swig_self, &funcname,
    result, 0, args TSRMLS_CC);
  
  convert_to_string_ex(&result);
  c_result.assign(Z_STRVAL_PP(&result), Z_STRLEN_PP(&result));
  
  FREE_ZVAL(result);
  return (std::string) c_result;
fail:
  SWIG_ZEND_ERROR_NORETURN(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


SwigDirector_KeyMaker::SwigDirector_KeyMaker(zval *self TSRMLS_DC): Xapian::KeyMaker(), Swig::Director(self TSRMLS_CC) {
  
}



std::string SwigDirector_KeyMaker::operator ()(Xapian::Document const &doc) const {
  TSRMLS_FETCH_FROM_CTX(swig_zts_ctx);
  std::string c_result;
  zval *args[1];
  zval *result, funcname;
  MAKE_STD_ZVAL(result);
  ZVAL_STRING(&funcname, (char *)"apply", 0);
  if (!swig_self) {
    SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  }
  
  zval obj0;
  args[0] = &obj0;
  
  SWIG_SetPointerZval(&obj0, (void *)&doc, SWIGTYPE_p_Xapian__Document, (0)|2);
  
  call_user_function(EG(function_table), (zval**)&swig_self, &funcname,
    result, 1, args TSRMLS_CC);
  
  convert_to_string_ex(&result);
  c_result.assign(Z_STRVAL_PP(&result), Z_STRLEN_PP(&result));
  
  FREE_ZVAL(result);
  return (std::string) c_result;
fail:
  SWIG_ZEND_ERROR_NORETURN(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


SwigDirector_KeyMaker::~SwigDirector_KeyMaker() {
}

SwigDirector_Compactor::SwigDirector_Compactor(zval *self TSRMLS_DC): Xapian::Compactor(), Swig::Director(self TSRMLS_CC) {
  
}



SwigDirector_Compactor::~SwigDirector_Compactor() {
}

void SwigDirector_Compactor::set_status(std::string const &table, std::string const &status) {
  TSRMLS_FETCH_FROM_CTX(swig_zts_ctx);
  zval *args[2];
  zval *result, funcname;
  MAKE_STD_ZVAL(result);
  ZVAL_STRING(&funcname, (char *)"set_status", 0);
  if (!swig_self) {
    SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  }
  
  zval obj0;
  args[0] = &obj0;
  
  ZVAL_STRINGL(&obj0, const_cast<char*>(table.data()), table.size(), 1);
  
  zval obj1;
  args[1] = &obj1;
  
  ZVAL_STRINGL(&obj1, const_cast<char*>(status.data()), status.size(), 1);
  
  call_user_function(EG(function_table), (zval**)&swig_self, &funcname,
    result, 2, args TSRMLS_CC);
  FREE_ZVAL(result);
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


std::string SwigDirector_Compactor::resolve_duplicate_metadata(std::string const &key, size_t num_tags, std::string const tags[]) {
  TSRMLS_FETCH_FROM_CTX(swig_zts_ctx);
  std::string c_result;
  zval *args[2];
  zval *result, funcname;
  MAKE_STD_ZVAL(result);
  ZVAL_STRING(&funcname, (char *)"resolve_duplicate_metadata", 0);
  if (!swig_self) {
    SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  }
  
  zval obj0;
  args[0] = &obj0;
  
  ZVAL_STRINGL(&obj0, const_cast<char*>(key.data()), key.size(), 1);
  
  zval obj1;
  args[1] = &obj1;
  {
    if (array_init(&obj1) == FAILURE) {
      SWIG_PHP_Error(E_ERROR, "array_init failed");
    }
    
    for (size_t i = 0; i != num_tags; ++i) {
      const string & term = tags[i];
      char *p = const_cast<char*>(term.data());
      add_next_index_stringl(&obj1, p, term.length(), 1);
    }
  }
  call_user_function(EG(function_table), (zval**)&swig_self, &funcname,
    result, 2, args TSRMLS_CC);
  
  convert_to_string_ex(&result);
  c_result.assign(Z_STRVAL_PP(&result), Z_STRLEN_PP(&result));
  
  FREE_ZVAL(result);
  return (std::string) c_result;
fail:
  SWIG_ZEND_ERROR_NORETURN(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


/* vdecl subsection */
static int le_swig__p_Xapian__RSet=0; /* handle for RSet */
static int le_swig__p_Xapian__Registry=0; /* handle for Registry */
static int le_swig__p_Xapian__Compactor=0; /* handle for Compactor */
static int le_swig__p_Xapian__KeyMaker=0; /* handle for KeyMaker */
static int le_swig__p_Xapian__MultiValueKeyMaker=0; /* handle for MultiValueKeyMaker */
static int le_swig__p_Xapian__Sorter=0; /* handle for Sorter */
static int le_swig__p_Xapian__Document=0; /* handle for Document */
static int le_swig__p_double=0; /* handle for _p_double */
static int le_swig__p_stem_strategy=0; /* handle for _p_stem_strategy */
static int le_swig__p_Xapian__MultiValueSorter=0; /* handle for MultiValueSorter */
static int le_swig__int=0; /* handle for _int */
static int le_swig__p_Xapian__Enquire=0; /* handle for Enquire */
static int le_swig__p_Xapian__ESetIterator=0; /* handle for ESetIterator */
static int le_swig__p_Xapian__MSetIterator=0; /* handle for MSetIterator */
static int le_swig__p_Xapian__ValueIterator=0; /* handle for ValueIterator */
static int le_swig__p_Xapian__TermIterator=0; /* handle for TermIterator */
static int le_swig__p_Xapian__PostingIterator=0; /* handle for PostingIterator */
static int le_swig__p_Xapian__PositionIterator=0; /* handle for PositionIterator */
static int le_swig__p_Xapian__TermGenerator=0; /* handle for TermGenerator */
static int le_swig__p_unsigned_int=0; /* handle for _p_unsigned_int */
static int le_swig__p_Xapian__BoolWeight=0; /* handle for BoolWeight */
static int le_swig__p_Xapian__TradWeight=0; /* handle for TradWeight */
static int le_swig__p_std__string=0; /* handle for _p_std__string */
static int le_swig__p_Xapian__QueryParser=0; /* handle for QueryParser */
static int le_swig__p_Xapian__Query=0; /* handle for Query */
static int le_swig__p_Xapian__Stopper=0; /* handle for Stopper */
static int le_swig__p_Xapian__SimpleStopper=0; /* handle for SimpleStopper */
static int le_swig__p_Xapian__ExpandDecider=0; /* handle for ExpandDecider */
static int le_swig__p_Xapian__MatchDecider=0; /* handle for MatchDecider */
static int le_swig__p_op=0; /* handle for _p_op */
static int le_swig__p_Xapian__ValueSetMatchDecider=0; /* handle for ValueSetMatchDecider */
static int le_swig__p_docid_order=0; /* handle for _p_docid_order */
static int le_swig__p_Xapian__StemImplementation=0; /* handle for StemImplementation */
static int le_swig__p_Xapian__FixedWeightPostingSource=0; /* handle for FixedWeightPostingSource */
static int le_swig__p_Xapian__ValueMapPostingSource=0; /* handle for ValueMapPostingSource */
static int le_swig__p_Xapian__DecreasingValueWeightPostingSource=0; /* handle for DecreasingValueWeightPostingSource */
static int le_swig__p_Xapian__PostingSource=0; /* handle for PostingSource */
static int le_swig__p_Xapian__ValuePostingSource=0; /* handle for ValuePostingSource */
static int le_swig__p_Xapian__ValueWeightPostingSource=0; /* handle for ValueWeightPostingSource */
static int le_swig__p_Xapian__Weight=0; /* handle for Weight */
static int le_swig__p_Xapian__BM25Weight=0; /* handle for BM25Weight */
static int le_swig__p_Xapian__Stem=0; /* handle for Stem */
static int le_swig__p_feature_flag=0; /* handle for _p_feature_flag */
static int le_swig__p_compaction_level=0; /* handle for _p_compaction_level */
static int le_swig__p_int=0; /* handle for _p_int */
static int le_swig__p_Xapian__MSet=0; /* handle for MSet */
static int le_swig__p_Xapian__ESet=0; /* handle for ESet */
static int le_swig__p_Xapian__Database=0; /* handle for Database */
static int le_swig__p_Xapian__MatchSpy=0; /* handle for MatchSpy */
static int le_swig__p_Xapian__ValueRangeProcessor=0; /* handle for ValueRangeProcessor */
static int le_swig__p_Xapian__StringValueRangeProcessor=0; /* handle for StringValueRangeProcessor */
static int le_swig__p_Xapian__ValueCountMatchSpy=0; /* handle for ValueCountMatchSpy */
static int le_swig__p_Xapian__WritableDatabase=0; /* handle for WritableDatabase */
static int le_swig__p_Xapian__DateValueRangeProcessor=0; /* handle for DateValueRangeProcessor */
static int le_swig__p_Xapian__NumberValueRangeProcessor=0; /* handle for NumberValueRangeProcessor */
/* end vdecl subsection */
/* wrapper section */
ZEND_NAMED_FUNCTION(_wrap_BAD_VALUENO_get) {
  Xapian::valueno result;
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 0) {
    WRONG_PARAM_COUNT;
  }
  
  result = (Xapian::valueno)(Xapian::valueno)Xapian::BAD_VALUENO;
  {
    ZVAL_LONG(return_value,result);
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


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


ZEND_NAMED_FUNCTION(_wrap_major_version) {
  int result;
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 0) {
    WRONG_PARAM_COUNT;
  }
  
  result = (int)Xapian::major_version();
  {
    ZVAL_LONG(return_value,result);
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_minor_version) {
  int result;
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 0) {
    WRONG_PARAM_COUNT;
  }
  
  result = (int)Xapian::minor_version();
  {
    ZVAL_LONG(return_value,result);
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_revision) {
  int result;
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 0) {
    WRONG_PARAM_COUNT;
  }
  
  result = (int)Xapian::revision();
  {
    ZVAL_LONG(return_value,result);
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_new_PositionIterator__SWIG_0) {
  Xapian::PositionIterator *result = 0 ;
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 0) {
    WRONG_PARAM_COUNT;
  }
  
  {
    try {
      result = (Xapian::PositionIterator *)new Xapian::PositionIterator();
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  
  SWIG_SetPointerZval(return_value, (void *)result, SWIGTYPE_p_Xapian__PositionIterator, 1);
  
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_new_PositionIterator__SWIG_1) {
  Xapian::PositionIterator *arg1 = 0 ;
  zval **args[1];
  Xapian::PositionIterator *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_Xapian__PositionIterator, 0) < 0 || arg1 == NULL) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of new_PositionIterator. Expected SWIGTYPE_p_Xapian__PositionIterator");
    }
  }
  {
    try {
      result = (Xapian::PositionIterator *)new Xapian::PositionIterator((Xapian::PositionIterator const &)*arg1);
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  
  SWIG_SetPointerZval(return_value, (void *)result, SWIGTYPE_p_Xapian__PositionIterator, 1);
  
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_new_PositionIterator) {
  int argc;
  zval **argv[1];
  
  argc = ZEND_NUM_ARGS();
  zend_get_parameters_array_ex(argc,argv);
  if (argc == 0) {
    _wrap_new_PositionIterator__SWIG_0(INTERNAL_FUNCTION_PARAM_PASSTHRU); return;
  }
  if (argc == 1) {
    int _v;
    {
      void *ptr;
      _v = (SWIG_ConvertPtr(*argv[0], (void **)&ptr, SWIGTYPE_p_Xapian__PositionIterator, 0) == 0);
    }
    if (_v) {
      _wrap_new_PositionIterator__SWIG_1(INTERNAL_FUNCTION_PARAM_PASSTHRU); return;
    }
  }
  
  SWIG_ErrorCode() = E_ERROR;
  SWIG_ErrorMsg() = "No matching function for overloaded 'new_PositionIterator'";
  zend_error(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_PositionIterator(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 ;
  Xapian::PositionIterator *arg1 = (Xapian::PositionIterator *) 0 ;
  
  efree(value);
  if (! newobject) return; /* can't delete it! */
  arg1 = (Xapian::PositionIterator *)SWIG_ZTS_ConvertResourceData(ptr,type_name,SWIGTYPE_p_Xapian__PositionIterator TSRMLS_CC);
  if (! arg1) zend_error(E_ERROR, "Xapian::PositionIterator resource already free'd");
  {
    try {
      delete arg1;
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_PositionIterator_get_termpos) {
  Xapian::PositionIterator *arg1 = (Xapian::PositionIterator *) 0 ;
  zval **args[1];
  Xapian::termpos 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_Xapian__PositionIterator, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of PositionIterator_get_termpos. Expected SWIGTYPE_p_Xapian__PositionIterator");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    try {
      result = (Xapian::termpos)Xapian_PositionIterator_get_termpos((Xapian::PositionIterator const *)arg1);
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  {
    ZVAL_LONG(return_value,result);
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_PositionIterator_next) {
  Xapian::PositionIterator *arg1 = (Xapian::PositionIterator *) 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_Xapian__PositionIterator, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of PositionIterator_next. Expected SWIGTYPE_p_Xapian__PositionIterator");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    try {
      Xapian_PositionIterator_next(arg1);
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_PositionIterator_equals) {
  Xapian::PositionIterator *arg1 = (Xapian::PositionIterator *) 0 ;
  Xapian::PositionIterator *arg2 = 0 ;
  zval **args[2];
  bool 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_Xapian__PositionIterator, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of PositionIterator_equals. Expected SWIGTYPE_p_Xapian__PositionIterator");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    if (SWIG_ConvertPtr(*args[1], (void**)&arg2, SWIGTYPE_p_Xapian__PositionIterator, 0) < 0 || arg2 == NULL) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 2 of PositionIterator_equals. Expected SWIGTYPE_p_Xapian__PositionIterator");
    }
  }
  {
    try {
      result = (bool)Xapian_PositionIterator_equals((Xapian::PositionIterator const *)arg1,(Xapian::PositionIterator const &)*arg2);
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  {
    ZVAL_BOOL(return_value,(result)?1:0);
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_PositionIterator_skip_to) {
  Xapian::PositionIterator *arg1 = (Xapian::PositionIterator *) 0 ;
  Xapian::termpos 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_Xapian__PositionIterator, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of PositionIterator_skip_to. Expected SWIGTYPE_p_Xapian__PositionIterator");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  
  /*@SWIG:/data/home/olly/tmp/xapian-svn-snapshot/tags/1.2.8/xapian/swig/Lib/php/utils.i,7,CONVERT_INT_IN@*/
  convert_to_long_ex(args[1]);
  arg2 = (Xapian::termpos) Z_LVAL_PP(args[1]);
  /*@SWIG@*/;
  
  {
    try {
      (arg1)->skip_to(arg2);
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_PositionIterator_get_description) {
  Xapian::PositionIterator *arg1 = (Xapian::PositionIterator *) 0 ;
  zval **args[1];
  std::string 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_Xapian__PositionIterator, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of PositionIterator_get_description. Expected SWIGTYPE_p_Xapian__PositionIterator");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    try {
      result = ((Xapian::PositionIterator const *)arg1)->get_description();
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  
  ZVAL_STRINGL(return_value, const_cast<char*>((&result)->data()), (&result)->size(), 1);
  
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_new_PostingIterator__SWIG_0) {
  Xapian::PostingIterator *result = 0 ;
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 0) {
    WRONG_PARAM_COUNT;
  }
  
  {
    try {
      result = (Xapian::PostingIterator *)new Xapian::PostingIterator();
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  
  SWIG_SetPointerZval(return_value, (void *)result, SWIGTYPE_p_Xapian__PostingIterator, 1);
  
  return;
fail:
  zend_error(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_PostingIterator(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 ;
  Xapian::PostingIterator *arg1 = (Xapian::PostingIterator *) 0 ;
  
  efree(value);
  if (! newobject) return; /* can't delete it! */
  arg1 = (Xapian::PostingIterator *)SWIG_ZTS_ConvertResourceData(ptr,type_name,SWIGTYPE_p_Xapian__PostingIterator TSRMLS_CC);
  if (! arg1) zend_error(E_ERROR, "Xapian::PostingIterator resource already free'd");
  {
    try {
      delete arg1;
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_new_PostingIterator__SWIG_1) {
  Xapian::PostingIterator *arg1 = 0 ;
  zval **args[1];
  Xapian::PostingIterator *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_Xapian__PostingIterator, 0) < 0 || arg1 == NULL) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of new_PostingIterator. Expected SWIGTYPE_p_Xapian__PostingIterator");
    }
  }
  {
    try {
      result = (Xapian::PostingIterator *)new Xapian::PostingIterator((Xapian::PostingIterator const &)*arg1);
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  
  SWIG_SetPointerZval(return_value, (void *)result, SWIGTYPE_p_Xapian__PostingIterator, 1);
  
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_new_PostingIterator) {
  int argc;
  zval **argv[1];
  
  argc = ZEND_NUM_ARGS();
  zend_get_parameters_array_ex(argc,argv);
  if (argc == 0) {
    _wrap_new_PostingIterator__SWIG_0(INTERNAL_FUNCTION_PARAM_PASSTHRU); return;
  }
  if (argc == 1) {
    int _v;
    {
      void *ptr;
      _v = (SWIG_ConvertPtr(*argv[0], (void **)&ptr, SWIGTYPE_p_Xapian__PostingIterator, 0) == 0);
    }
    if (_v) {
      _wrap_new_PostingIterator__SWIG_1(INTERNAL_FUNCTION_PARAM_PASSTHRU); return;
    }
  }
  
  SWIG_ErrorCode() = E_ERROR;
  SWIG_ErrorMsg() = "No matching function for overloaded 'new_PostingIterator'";
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_PostingIterator_skip_to) {
  Xapian::PostingIterator *arg1 = (Xapian::PostingIterator *) 0 ;
  Xapian::docid 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_Xapian__PostingIterator, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of PostingIterator_skip_to. Expected SWIGTYPE_p_Xapian__PostingIterator");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  
  /*@SWIG:/data/home/olly/tmp/xapian-svn-snapshot/tags/1.2.8/xapian/swig/Lib/php/utils.i,7,CONVERT_INT_IN@*/
  convert_to_long_ex(args[1]);
  arg2 = (Xapian::docid) Z_LVAL_PP(args[1]);
  /*@SWIG@*/;
  
  {
    try {
      (arg1)->skip_to(arg2);
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_PostingIterator_get_doclength) {
  Xapian::PostingIterator *arg1 = (Xapian::PostingIterator *) 0 ;
  zval **args[1];
  Xapian::termcount 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_Xapian__PostingIterator, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of PostingIterator_get_doclength. Expected SWIGTYPE_p_Xapian__PostingIterator");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    try {
      result = (Xapian::termcount)((Xapian::PostingIterator const *)arg1)->get_doclength();
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  {
    ZVAL_LONG(return_value,result);
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_PostingIterator_get_wdf) {
  Xapian::PostingIterator *arg1 = (Xapian::PostingIterator *) 0 ;
  zval **args[1];
  Xapian::termcount 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_Xapian__PostingIterator, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of PostingIterator_get_wdf. Expected SWIGTYPE_p_Xapian__PostingIterator");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    try {
      result = (Xapian::termcount)((Xapian::PostingIterator const *)arg1)->get_wdf();
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  {
    ZVAL_LONG(return_value,result);
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_PostingIterator_positionlist_begin) {
  Xapian::PostingIterator *arg1 = (Xapian::PostingIterator *) 0 ;
  zval **args[1];
  Xapian::PositionIterator 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_Xapian__PostingIterator, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of PostingIterator_positionlist_begin. Expected SWIGTYPE_p_Xapian__PostingIterator");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    try {
      result = ((Xapian::PostingIterator const *)arg1)->positionlist_begin();
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  {
    Xapian::PositionIterator * resultobj = new Xapian::PositionIterator((const Xapian::PositionIterator &) result);
    SWIG_SetPointerZval(return_value, (void *)resultobj, SWIGTYPE_p_Xapian__PositionIterator, 1);
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_PostingIterator_positionlist_end) {
  Xapian::PostingIterator *arg1 = (Xapian::PostingIterator *) 0 ;
  zval **args[1];
  Xapian::PositionIterator 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_Xapian__PostingIterator, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of PostingIterator_positionlist_end. Expected SWIGTYPE_p_Xapian__PostingIterator");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    try {
      result = ((Xapian::PostingIterator const *)arg1)->positionlist_end();
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  {
    Xapian::PositionIterator * resultobj = new Xapian::PositionIterator((const Xapian::PositionIterator &) result);
    SWIG_SetPointerZval(return_value, (void *)resultobj, SWIGTYPE_p_Xapian__PositionIterator, 1);
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_PostingIterator_get_description) {
  Xapian::PostingIterator *arg1 = (Xapian::PostingIterator *) 0 ;
  zval **args[1];
  std::string 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_Xapian__PostingIterator, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of PostingIterator_get_description. Expected SWIGTYPE_p_Xapian__PostingIterator");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    try {
      result = ((Xapian::PostingIterator const *)arg1)->get_description();
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  
  ZVAL_STRINGL(return_value, const_cast<char*>((&result)->data()), (&result)->size(), 1);
  
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_PostingIterator_get_docid) {
  Xapian::PostingIterator *arg1 = (Xapian::PostingIterator *) 0 ;
  zval **args[1];
  Xapian::docid 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_Xapian__PostingIterator, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of PostingIterator_get_docid. Expected SWIGTYPE_p_Xapian__PostingIterator");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    try {
      result = (Xapian::docid)Xapian_PostingIterator_get_docid((Xapian::PostingIterator const *)arg1);
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  {
    ZVAL_LONG(return_value,result);
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_PostingIterator_next) {
  Xapian::PostingIterator *arg1 = (Xapian::PostingIterator *) 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_Xapian__PostingIterator, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of PostingIterator_next. Expected SWIGTYPE_p_Xapian__PostingIterator");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    try {
      Xapian_PostingIterator_next(arg1);
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_PostingIterator_equals) {
  Xapian::PostingIterator *arg1 = (Xapian::PostingIterator *) 0 ;
  Xapian::PostingIterator *arg2 = 0 ;
  zval **args[2];
  bool 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_Xapian__PostingIterator, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of PostingIterator_equals. Expected SWIGTYPE_p_Xapian__PostingIterator");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    if (SWIG_ConvertPtr(*args[1], (void**)&arg2, SWIGTYPE_p_Xapian__PostingIterator, 0) < 0 || arg2 == NULL) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 2 of PostingIterator_equals. Expected SWIGTYPE_p_Xapian__PostingIterator");
    }
  }
  {
    try {
      result = (bool)Xapian_PostingIterator_equals((Xapian::PostingIterator const *)arg1,(Xapian::PostingIterator const &)*arg2);
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  {
    ZVAL_BOOL(return_value,(result)?1:0);
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_new_TermIterator__SWIG_0) {
  Xapian::TermIterator *result = 0 ;
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 0) {
    WRONG_PARAM_COUNT;
  }
  
  {
    try {
      result = (Xapian::TermIterator *)new Xapian::TermIterator();
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  
  SWIG_SetPointerZval(return_value, (void *)result, SWIGTYPE_p_Xapian__TermIterator, 1);
  
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_new_TermIterator__SWIG_1) {
  Xapian::TermIterator *arg1 = 0 ;
  zval **args[1];
  Xapian::TermIterator *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_Xapian__TermIterator, 0) < 0 || arg1 == NULL) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of new_TermIterator. Expected SWIGTYPE_p_Xapian__TermIterator");
    }
  }
  {
    try {
      result = (Xapian::TermIterator *)new Xapian::TermIterator((Xapian::TermIterator const &)*arg1);
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  
  SWIG_SetPointerZval(return_value, (void *)result, SWIGTYPE_p_Xapian__TermIterator, 1);
  
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_new_TermIterator) {
  int argc;
  zval **argv[1];
  
  argc = ZEND_NUM_ARGS();
  zend_get_parameters_array_ex(argc,argv);
  if (argc == 0) {
    _wrap_new_TermIterator__SWIG_0(INTERNAL_FUNCTION_PARAM_PASSTHRU); return;
  }
  if (argc == 1) {
    int _v;
    {
      void *ptr;
      _v = (SWIG_ConvertPtr(*argv[0], (void **)&ptr, SWIGTYPE_p_Xapian__TermIterator, 0) == 0);
    }
    if (_v) {
      _wrap_new_TermIterator__SWIG_1(INTERNAL_FUNCTION_PARAM_PASSTHRU); return;
    }
  }
  
  SWIG_ErrorCode() = E_ERROR;
  SWIG_ErrorMsg() = "No matching function for overloaded 'new_TermIterator'";
  zend_error(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_TermIterator(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 ;
  Xapian::TermIterator *arg1 = (Xapian::TermIterator *) 0 ;
  
  efree(value);
  if (! newobject) return; /* can't delete it! */
  arg1 = (Xapian::TermIterator *)SWIG_ZTS_ConvertResourceData(ptr,type_name,SWIGTYPE_p_Xapian__TermIterator TSRMLS_CC);
  if (! arg1) zend_error(E_ERROR, "Xapian::TermIterator resource already free'd");
  {
    try {
      delete arg1;
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_TermIterator_get_term) {
  Xapian::TermIterator *arg1 = (Xapian::TermIterator *) 0 ;
  zval **args[1];
  std::string 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_Xapian__TermIterator, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of TermIterator_get_term. Expected SWIGTYPE_p_Xapian__TermIterator");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    try {
      result = Xapian_TermIterator_get_term((Xapian::TermIterator const *)arg1);
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  
  ZVAL_STRINGL(return_value, const_cast<char*>((&result)->data()), (&result)->size(), 1);
  
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_TermIterator_next) {
  Xapian::TermIterator *arg1 = (Xapian::TermIterator *) 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_Xapian__TermIterator, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of TermIterator_next. Expected SWIGTYPE_p_Xapian__TermIterator");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    try {
      Xapian_TermIterator_next(arg1);
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_TermIterator_equals) {
  Xapian::TermIterator *arg1 = (Xapian::TermIterator *) 0 ;
  Xapian::TermIterator *arg2 = 0 ;
  zval **args[2];
  bool 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_Xapian__TermIterator, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of TermIterator_equals. Expected SWIGTYPE_p_Xapian__TermIterator");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    if (SWIG_ConvertPtr(*args[1], (void**)&arg2, SWIGTYPE_p_Xapian__TermIterator, 0) < 0 || arg2 == NULL) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 2 of TermIterator_equals. Expected SWIGTYPE_p_Xapian__TermIterator");
    }
  }
  {
    try {
      result = (bool)Xapian_TermIterator_equals((Xapian::TermIterator const *)arg1,(Xapian::TermIterator const &)*arg2);
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  {
    ZVAL_BOOL(return_value,(result)?1:0);
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_TermIterator_skip_to) {
  Xapian::TermIterator *arg1 = (Xapian::TermIterator *) 0 ;
  std::string *arg2 = 0 ;
  std::string temp2 ;
  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_Xapian__TermIterator, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of TermIterator_skip_to. Expected SWIGTYPE_p_Xapian__TermIterator");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  
  convert_to_string_ex(args[1]);
  temp2.assign(Z_STRVAL_PP(args[1]), Z_STRLEN_PP(args[1]));
  arg2 = &temp2;
  
  {
    try {
      (arg1)->skip_to((std::string const &)*arg2);
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  
  
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_TermIterator_get_wdf) {
  Xapian::TermIterator *arg1 = (Xapian::TermIterator *) 0 ;
  zval **args[1];
  Xapian::termcount 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_Xapian__TermIterator, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of TermIterator_get_wdf. Expected SWIGTYPE_p_Xapian__TermIterator");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    try {
      result = (Xapian::termcount)((Xapian::TermIterator const *)arg1)->get_wdf();
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  {
    ZVAL_LONG(return_value,result);
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_TermIterator_get_termfreq) {
  Xapian::TermIterator *arg1 = (Xapian::TermIterator *) 0 ;
  zval **args[1];
  Xapian::doccount 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_Xapian__TermIterator, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of TermIterator_get_termfreq. Expected SWIGTYPE_p_Xapian__TermIterator");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    try {
      result = (Xapian::doccount)((Xapian::TermIterator const *)arg1)->get_termfreq();
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  {
    ZVAL_LONG(return_value,result);
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_TermIterator_positionlist_count) {
  Xapian::TermIterator *arg1 = (Xapian::TermIterator *) 0 ;
  zval **args[1];
  Xapian::termcount 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_Xapian__TermIterator, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of TermIterator_positionlist_count. Expected SWIGTYPE_p_Xapian__TermIterator");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    try {
      result = (Xapian::termcount)((Xapian::TermIterator const *)arg1)->positionlist_count();
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  {
    ZVAL_LONG(return_value,result);
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_TermIterator_positionlist_begin) {
  Xapian::TermIterator *arg1 = (Xapian::TermIterator *) 0 ;
  zval **args[1];
  Xapian::PositionIterator 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_Xapian__TermIterator, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of TermIterator_positionlist_begin. Expected SWIGTYPE_p_Xapian__TermIterator");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    try {
      result = (arg1)->positionlist_begin();
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  {
    Xapian::PositionIterator * resultobj = new Xapian::PositionIterator((const Xapian::PositionIterator &) result);
    SWIG_SetPointerZval(return_value, (void *)resultobj, SWIGTYPE_p_Xapian__PositionIterator, 1);
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_TermIterator_positionlist_end) {
  Xapian::TermIterator *arg1 = (Xapian::TermIterator *) 0 ;
  zval **args[1];
  Xapian::PositionIterator 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_Xapian__TermIterator, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of TermIterator_positionlist_end. Expected SWIGTYPE_p_Xapian__TermIterator");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    try {
      result = (arg1)->positionlist_end();
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  {
    Xapian::PositionIterator * resultobj = new Xapian::PositionIterator((const Xapian::PositionIterator &) result);
    SWIG_SetPointerZval(return_value, (void *)resultobj, SWIGTYPE_p_Xapian__PositionIterator, 1);
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_TermIterator_get_description) {
  Xapian::TermIterator *arg1 = (Xapian::TermIterator *) 0 ;
  zval **args[1];
  std::string 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_Xapian__TermIterator, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of TermIterator_get_description. Expected SWIGTYPE_p_Xapian__TermIterator");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    try {
      result = ((Xapian::TermIterator const *)arg1)->get_description();
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  
  ZVAL_STRINGL(return_value, const_cast<char*>((&result)->data()), (&result)->size(), 1);
  
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_new_ValueIterator__SWIG_0) {
  Xapian::ValueIterator *result = 0 ;
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 0) {
    WRONG_PARAM_COUNT;
  }
  
  {
    try {
      result = (Xapian::ValueIterator *)new Xapian::ValueIterator();
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  
  SWIG_SetPointerZval(return_value, (void *)result, SWIGTYPE_p_Xapian__ValueIterator, 1);
  
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_new_ValueIterator__SWIG_1) {
  Xapian::ValueIterator *arg1 = 0 ;
  zval **args[1];
  Xapian::ValueIterator *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_Xapian__ValueIterator, 0) < 0 || arg1 == NULL) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of new_ValueIterator. Expected SWIGTYPE_p_Xapian__ValueIterator");
    }
  }
  {
    try {
      result = (Xapian::ValueIterator *)new Xapian::ValueIterator((Xapian::ValueIterator const &)*arg1);
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  
  SWIG_SetPointerZval(return_value, (void *)result, SWIGTYPE_p_Xapian__ValueIterator, 1);
  
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_new_ValueIterator) {
  int argc;
  zval **argv[1];
  
  argc = ZEND_NUM_ARGS();
  zend_get_parameters_array_ex(argc,argv);
  if (argc == 0) {
    _wrap_new_ValueIterator__SWIG_0(INTERNAL_FUNCTION_PARAM_PASSTHRU); return;
  }
  if (argc == 1) {
    int _v;
    {
      void *ptr;
      _v = (SWIG_ConvertPtr(*argv[0], (void **)&ptr, SWIGTYPE_p_Xapian__ValueIterator, 0) == 0);
    }
    if (_v) {
      _wrap_new_ValueIterator__SWIG_1(INTERNAL_FUNCTION_PARAM_PASSTHRU); return;
    }
  }
  
  SWIG_ErrorCode() = E_ERROR;
  SWIG_ErrorMsg() = "No matching function for overloaded 'new_ValueIterator'";
  zend_error(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_ValueIterator(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 ;
  Xapian::ValueIterator *arg1 = (Xapian::ValueIterator *) 0 ;
  
  efree(value);
  if (! newobject) return; /* can't delete it! */
  arg1 = (Xapian::ValueIterator *)SWIG_ZTS_ConvertResourceData(ptr,type_name,SWIGTYPE_p_Xapian__ValueIterator TSRMLS_CC);
  if (! arg1) zend_error(E_ERROR, "Xapian::ValueIterator resource already free'd");
  {
    try {
      delete arg1;
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_ValueIterator_get_value) {
  Xapian::ValueIterator *arg1 = (Xapian::ValueIterator *) 0 ;
  zval **args[1];
  std::string 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_Xapian__ValueIterator, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of ValueIterator_get_value. Expected SWIGTYPE_p_Xapian__ValueIterator");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    try {
      result = Xapian_ValueIterator_get_value((Xapian::ValueIterator const *)arg1);
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  
  ZVAL_STRINGL(return_value, const_cast<char*>((&result)->data()), (&result)->size(), 1);
  
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_ValueIterator_next) {
  Xapian::ValueIterator *arg1 = (Xapian::ValueIterator *) 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_Xapian__ValueIterator, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of ValueIterator_next. Expected SWIGTYPE_p_Xapian__ValueIterator");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    try {
      Xapian_ValueIterator_next(arg1);
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_ValueIterator_equals) {
  Xapian::ValueIterator *arg1 = (Xapian::ValueIterator *) 0 ;
  Xapian::ValueIterator *arg2 = 0 ;
  zval **args[2];
  bool 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_Xapian__ValueIterator, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of ValueIterator_equals. Expected SWIGTYPE_p_Xapian__ValueIterator");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    if (SWIG_ConvertPtr(*args[1], (void**)&arg2, SWIGTYPE_p_Xapian__ValueIterator, 0) < 0 || arg2 == NULL) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 2 of ValueIterator_equals. Expected SWIGTYPE_p_Xapian__ValueIterator");
    }
  }
  {
    try {
      result = (bool)Xapian_ValueIterator_equals((Xapian::ValueIterator const *)arg1,(Xapian::ValueIterator const &)*arg2);
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  {
    ZVAL_BOOL(return_value,(result)?1:0);
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_ValueIterator_get_docid) {
  Xapian::ValueIterator *arg1 = (Xapian::ValueIterator *) 0 ;
  zval **args[1];
  Xapian::docid 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_Xapian__ValueIterator, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of ValueIterator_get_docid. Expected SWIGTYPE_p_Xapian__ValueIterator");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    try {
      result = (Xapian::docid)((Xapian::ValueIterator const *)arg1)->get_docid();
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  {
    ZVAL_LONG(return_value,result);
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_ValueIterator_get_valueno) {
  Xapian::ValueIterator *arg1 = (Xapian::ValueIterator *) 0 ;
  zval **args[1];
  Xapian::valueno 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_Xapian__ValueIterator, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of ValueIterator_get_valueno. Expected SWIGTYPE_p_Xapian__ValueIterator");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    try {
      result = (Xapian::valueno)((Xapian::ValueIterator const *)arg1)->get_valueno();
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  {
    ZVAL_LONG(return_value,result);
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_ValueIterator_skip_to) {
  Xapian::ValueIterator *arg1 = (Xapian::ValueIterator *) 0 ;
  Xapian::docid 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_Xapian__ValueIterator, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of ValueIterator_skip_to. Expected SWIGTYPE_p_Xapian__ValueIterator");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  
  /*@SWIG:/data/home/olly/tmp/xapian-svn-snapshot/tags/1.2.8/xapian/swig/Lib/php/utils.i,7,CONVERT_INT_IN@*/
  convert_to_long_ex(args[1]);
  arg2 = (Xapian::docid) Z_LVAL_PP(args[1]);
  /*@SWIG@*/;
  
  {
    try {
      (arg1)->skip_to(arg2);
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_ValueIterator_check) {
  Xapian::ValueIterator *arg1 = (Xapian::ValueIterator *) 0 ;
  Xapian::docid arg2 ;
  zval **args[2];
  bool 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_Xapian__ValueIterator, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of ValueIterator_check. Expected SWIGTYPE_p_Xapian__ValueIterator");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  
  /*@SWIG:/data/home/olly/tmp/xapian-svn-snapshot/tags/1.2.8/xapian/swig/Lib/php/utils.i,7,CONVERT_INT_IN@*/
  convert_to_long_ex(args[1]);
  arg2 = (Xapian::docid) Z_LVAL_PP(args[1]);
  /*@SWIG@*/;
  
  {
    try {
      result = (bool)(arg1)->check(arg2);
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  {
    ZVAL_BOOL(return_value,(result)?1:0);
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_ValueIterator_get_description) {
  Xapian::ValueIterator *arg1 = (Xapian::ValueIterator *) 0 ;
  zval **args[1];
  std::string 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_Xapian__ValueIterator, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of ValueIterator_get_description. Expected SWIGTYPE_p_Xapian__ValueIterator");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    try {
      result = ((Xapian::ValueIterator const *)arg1)->get_description();
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  
  ZVAL_STRINGL(return_value, const_cast<char*>((&result)->data()), (&result)->size(), 1);
  
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_new_Document__SWIG_0) {
  Xapian::Document *arg1 = 0 ;
  zval **args[1];
  Xapian::Document *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_Xapian__Document, 0) < 0 || arg1 == NULL) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of new_Document. Expected SWIGTYPE_p_Xapian__Document");
    }
  }
  {
    try {
      result = (Xapian::Document *)new Xapian::Document((Xapian::Document const &)*arg1);
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  
  SWIG_SetPointerZval(return_value, (void *)result, SWIGTYPE_p_Xapian__Document, 1);
  
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_new_Document__SWIG_1) {
  Xapian::Document *result = 0 ;
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 0) {
    WRONG_PARAM_COUNT;
  }
  
  {
    try {
      result = (Xapian::Document *)new Xapian::Document();
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  
  SWIG_SetPointerZval(return_value, (void *)result, SWIGTYPE_p_Xapian__Document, 1);
  
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_new_Document) {
  int argc;
  zval **argv[1];
  
  argc = ZEND_NUM_ARGS();
  zend_get_parameters_array_ex(argc,argv);
  if (argc == 0) {
    _wrap_new_Document__SWIG_1(INTERNAL_FUNCTION_PARAM_PASSTHRU); return;
  }
  if (argc == 1) {
    int _v;
    {
      void *ptr;
      _v = (SWIG_ConvertPtr(*argv[0], (void **)&ptr, SWIGTYPE_p_Xapian__Document, 0) == 0);
    }
    if (_v) {
      _wrap_new_Document__SWIG_0(INTERNAL_FUNCTION_PARAM_PASSTHRU); return;
    }
  }
  
  SWIG_ErrorCode() = E_ERROR;
  SWIG_ErrorMsg() = "No matching function for overloaded 'new_Document'";
  zend_error(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_Document(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 ;
  Xapian::Document *arg1 = (Xapian::Document *) 0 ;
  
  efree(value);
  if (! newobject) return; /* can't delete it! */
  arg1 = (Xapian::Document *)SWIG_ZTS_ConvertResourceData(ptr,type_name,SWIGTYPE_p_Xapian__Document TSRMLS_CC);
  if (! arg1) zend_error(E_ERROR, "Xapian::Document resource already free'd");
  {
    try {
      delete arg1;
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_Document_get_value) {
  Xapian::Document *arg1 = (Xapian::Document *) 0 ;
  Xapian::valueno arg2 ;
  zval **args[2];
  std::string 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_Xapian__Document, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of Document_get_value. Expected SWIGTYPE_p_Xapian__Document");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  
  /*@SWIG:/data/home/olly/tmp/xapian-svn-snapshot/tags/1.2.8/xapian/swig/Lib/php/utils.i,7,CONVERT_INT_IN@*/
  convert_to_long_ex(args[1]);
  arg2 = (Xapian::valueno) Z_LVAL_PP(args[1]);
  /*@SWIG@*/;
  
  {
    try {
      result = ((Xapian::Document const *)arg1)->get_value(arg2);
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  
  ZVAL_STRINGL(return_value, const_cast<char*>((&result)->data()), (&result)->size(), 1);
  
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_Document_add_value) {
  Xapian::Document *arg1 = (Xapian::Document *) 0 ;
  Xapian::valueno arg2 ;
  std::string *arg3 = 0 ;
  std::string temp3 ;
  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_Xapian__Document, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of Document_add_value. Expected SWIGTYPE_p_Xapian__Document");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  
  /*@SWIG:/data/home/olly/tmp/xapian-svn-snapshot/tags/1.2.8/xapian/swig/Lib/php/utils.i,7,CONVERT_INT_IN@*/
  convert_to_long_ex(args[1]);
  arg2 = (Xapian::valueno) Z_LVAL_PP(args[1]);
  /*@SWIG@*/;
  
  
  convert_to_string_ex(args[2]);
  temp3.assign(Z_STRVAL_PP(args[2]), Z_STRLEN_PP(args[2]));
  arg3 = &temp3;
  
  {
    try {
      (arg1)->add_value(arg2,(std::string const &)*arg3);
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  
  
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_Document_remove_value) {
  Xapian::Document *arg1 = (Xapian::Document *) 0 ;
  Xapian::valueno 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_Xapian__Document, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of Document_remove_value. Expected SWIGTYPE_p_Xapian__Document");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  
  /*@SWIG:/data/home/olly/tmp/xapian-svn-snapshot/tags/1.2.8/xapian/swig/Lib/php/utils.i,7,CONVERT_INT_IN@*/
  convert_to_long_ex(args[1]);
  arg2 = (Xapian::valueno) Z_LVAL_PP(args[1]);
  /*@SWIG@*/;
  
  {
    try {
      (arg1)->remove_value(arg2);
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_Document_clear_values) {
  Xapian::Document *arg1 = (Xapian::Document *) 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_Xapian__Document, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of Document_clear_values. Expected SWIGTYPE_p_Xapian__Document");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    try {
      (arg1)->clear_values();
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_Document_get_data) {
  Xapian::Document *arg1 = (Xapian::Document *) 0 ;
  zval **args[1];
  std::string 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_Xapian__Document, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of Document_get_data. Expected SWIGTYPE_p_Xapian__Document");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    try {
      result = ((Xapian::Document const *)arg1)->get_data();
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  
  ZVAL_STRINGL(return_value, const_cast<char*>((&result)->data()), (&result)->size(), 1);
  
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_Document_set_data) {
  Xapian::Document *arg1 = (Xapian::Document *) 0 ;
  std::string *arg2 = 0 ;
  std::string temp2 ;
  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_Xapian__Document, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of Document_set_data. Expected SWIGTYPE_p_Xapian__Document");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  
  convert_to_string_ex(args[1]);
  temp2.assign(Z_STRVAL_PP(args[1]), Z_STRLEN_PP(args[1]));
  arg2 = &temp2;
  
  {
    try {
      (arg1)->set_data((std::string const &)*arg2);
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  
  
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_Document_add_posting__SWIG_0) {
  Xapian::Document *arg1 = (Xapian::Document *) 0 ;
  std::string *arg2 = 0 ;
  Xapian::termpos arg3 ;
  Xapian::termcount arg4 ;
  std::string temp2 ;
  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_Xapian__Document, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of Document_add_posting. Expected SWIGTYPE_p_Xapian__Document");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  
  convert_to_string_ex(args[1]);
  temp2.assign(Z_STRVAL_PP(args[1]), Z_STRLEN_PP(args[1]));
  arg2 = &temp2;
  
  
  /*@SWIG:/data/home/olly/tmp/xapian-svn-snapshot/tags/1.2.8/xapian/swig/Lib/php/utils.i,7,CONVERT_INT_IN@*/
  convert_to_long_ex(args[2]);
  arg3 = (Xapian::termpos) Z_LVAL_PP(args[2]);
  /*@SWIG@*/;
  
  
  /*@SWIG:/data/home/olly/tmp/xapian-svn-snapshot/tags/1.2.8/xapian/swig/Lib/php/utils.i,7,CONVERT_INT_IN@*/
  convert_to_long_ex(args[3]);
  arg4 = (Xapian::termcount) Z_LVAL_PP(args[3]);
  /*@SWIG@*/;
  
  {
    try {
      (arg1)->add_posting((std::string const &)*arg2,arg3,arg4);
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  
  
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_Document_add_posting__SWIG_1) {
  Xapian::Document *arg1 = (Xapian::Document *) 0 ;
  std::string *arg2 = 0 ;
  Xapian::termpos arg3 ;
  std::string temp2 ;
  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_Xapian__Document, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of Document_add_posting. Expected SWIGTYPE_p_Xapian__Document");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  
  convert_to_string_ex(args[1]);
  temp2.assign(Z_STRVAL_PP(args[1]), Z_STRLEN_PP(args[1]));
  arg2 = &temp2;
  
  
  /*@SWIG:/data/home/olly/tmp/xapian-svn-snapshot/tags/1.2.8/xapian/swig/Lib/php/utils.i,7,CONVERT_INT_IN@*/
  convert_to_long_ex(args[2]);
  arg3 = (Xapian::termpos) Z_LVAL_PP(args[2]);
  /*@SWIG@*/;
  
  {
    try {
      (arg1)->add_posting((std::string const &)*arg2,arg3);
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  
  
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_Document_add_posting) {
  int argc;
  zval **argv[4];
  
  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_Xapian__Document, 0) >= 0);
    }
    if (_v) {
      {
        _v = (Z_TYPE_PP(argv[1]) == IS_STRING);
      }
      if (_v) {
        _v = (Z_TYPE_PP(argv[2]) == IS_LONG); 
        if (_v) {
          _wrap_Document_add_posting__SWIG_1(INTERNAL_FUNCTION_PARAM_PASSTHRU); return;
        }
      }
    }
  }
  if (argc == 4) {
    int _v;
    {
      void *tmp;
      _v = (SWIG_ConvertPtr(*argv[0], (void**)&tmp, SWIGTYPE_p_Xapian__Document, 0) >= 0);
    }
    if (_v) {
      {
        _v = (Z_TYPE_PP(argv[1]) == IS_STRING);
      }
      if (_v) {
        _v = (Z_TYPE_PP(argv[2]) == IS_LONG); 
        if (_v) {
          _v = (Z_TYPE_PP(argv[3]) == IS_LONG); 
          if (_v) {
            _wrap_Document_add_posting__SWIG_0(INTERNAL_FUNCTION_PARAM_PASSTHRU); return;
          }
        }
      }
    }
  }
  
  SWIG_ErrorCode() = E_ERROR;
  SWIG_ErrorMsg() = "No matching function for overloaded 'Document_add_posting'";
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_Document_add_term__SWIG_0) {
  Xapian::Document *arg1 = (Xapian::Document *) 0 ;
  std::string *arg2 = 0 ;
  Xapian::termcount arg3 ;
  std::string temp2 ;
  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_Xapian__Document, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of Document_add_term. Expected SWIGTYPE_p_Xapian__Document");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  
  convert_to_string_ex(args[1]);
  temp2.assign(Z_STRVAL_PP(args[1]), Z_STRLEN_PP(args[1]));
  arg2 = &temp2;
  
  
  /*@SWIG:/data/home/olly/tmp/xapian-svn-snapshot/tags/1.2.8/xapian/swig/Lib/php/utils.i,7,CONVERT_INT_IN@*/
  convert_to_long_ex(args[2]);
  arg3 = (Xapian::termcount) Z_LVAL_PP(args[2]);
  /*@SWIG@*/;
  
  {
    try {
      (arg1)->add_term((std::string const &)*arg2,arg3);
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  
  
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_Document_add_term__SWIG_1) {
  Xapian::Document *arg1 = (Xapian::Document *) 0 ;
  std::string *arg2 = 0 ;
  std::string temp2 ;
  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_Xapian__Document, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of Document_add_term. Expected SWIGTYPE_p_Xapian__Document");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  
  convert_to_string_ex(args[1]);
  temp2.assign(Z_STRVAL_PP(args[1]), Z_STRLEN_PP(args[1]));
  arg2 = &temp2;
  
  {
    try {
      (arg1)->add_term((std::string const &)*arg2);
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  
  
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_Document_add_term) {
  int argc;
  zval **argv[3];
  
  argc = ZEND_NUM_ARGS();
  zend_get_parameters_array_ex(argc,argv);
  if (argc == 2) {
    int _v;
    {
      void *tmp;
      _v = (SWIG_ConvertPtr(*argv[0], (void**)&tmp, SWIGTYPE_p_Xapian__Document, 0) >= 0);
    }
    if (_v) {
      {
        _v = (Z_TYPE_PP(argv[1]) == IS_STRING);
      }
      if (_v) {
        _wrap_Document_add_term__SWIG_1(INTERNAL_FUNCTION_PARAM_PASSTHRU); return;
      }
    }
  }
  if (argc == 3) {
    int _v;
    {
      void *tmp;
      _v = (SWIG_ConvertPtr(*argv[0], (void**)&tmp, SWIGTYPE_p_Xapian__Document, 0) >= 0);
    }
    if (_v) {
      {
        _v = (Z_TYPE_PP(argv[1]) == IS_STRING);
      }
      if (_v) {
        _v = (Z_TYPE_PP(argv[2]) == IS_LONG); 
        if (_v) {
          _wrap_Document_add_term__SWIG_0(INTERNAL_FUNCTION_PARAM_PASSTHRU); return;
        }
      }
    }
  }
  
  SWIG_ErrorCode() = E_ERROR;
  SWIG_ErrorMsg() = "No matching function for overloaded 'Document_add_term'";
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_Document_add_boolean_term) {
  Xapian::Document *arg1 = (Xapian::Document *) 0 ;
  std::string *arg2 = 0 ;
  std::string temp2 ;
  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_Xapian__Document, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of Document_add_boolean_term. Expected SWIGTYPE_p_Xapian__Document");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  
  convert_to_string_ex(args[1]);
  temp2.assign(Z_STRVAL_PP(args[1]), Z_STRLEN_PP(args[1]));
  arg2 = &temp2;
  
  {
    try {
      (arg1)->add_boolean_term((std::string const &)*arg2);
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  
  
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_Document_remove_posting__SWIG_0) {
  Xapian::Document *arg1 = (Xapian::Document *) 0 ;
  std::string *arg2 = 0 ;
  Xapian::termpos arg3 ;
  Xapian::termcount arg4 ;
  std::string temp2 ;
  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_Xapian__Document, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of Document_remove_posting. Expected SWIGTYPE_p_Xapian__Document");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  
  convert_to_string_ex(args[1]);
  temp2.assign(Z_STRVAL_PP(args[1]), Z_STRLEN_PP(args[1]));
  arg2 = &temp2;
  
  
  /*@SWIG:/data/home/olly/tmp/xapian-svn-snapshot/tags/1.2.8/xapian/swig/Lib/php/utils.i,7,CONVERT_INT_IN@*/
  convert_to_long_ex(args[2]);
  arg3 = (Xapian::termpos) Z_LVAL_PP(args[2]);
  /*@SWIG@*/;
  
  
  /*@SWIG:/data/home/olly/tmp/xapian-svn-snapshot/tags/1.2.8/xapian/swig/Lib/php/utils.i,7,CONVERT_INT_IN@*/
  convert_to_long_ex(args[3]);
  arg4 = (Xapian::termcount) Z_LVAL_PP(args[3]);
  /*@SWIG@*/;
  
  {
    try {
      (arg1)->remove_posting((std::string const &)*arg2,arg3,arg4);
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  
  
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_Document_remove_posting__SWIG_1) {
  Xapian::Document *arg1 = (Xapian::Document *) 0 ;
  std::string *arg2 = 0 ;
  Xapian::termpos arg3 ;
  std::string temp2 ;
  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_Xapian__Document, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of Document_remove_posting. Expected SWIGTYPE_p_Xapian__Document");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  
  convert_to_string_ex(args[1]);
  temp2.assign(Z_STRVAL_PP(args[1]), Z_STRLEN_PP(args[1]));
  arg2 = &temp2;
  
  
  /*@SWIG:/data/home/olly/tmp/xapian-svn-snapshot/tags/1.2.8/xapian/swig/Lib/php/utils.i,7,CONVERT_INT_IN@*/
  convert_to_long_ex(args[2]);
  arg3 = (Xapian::termpos) Z_LVAL_PP(args[2]);
  /*@SWIG@*/;
  
  {
    try {
      (arg1)->remove_posting((std::string const &)*arg2,arg3);
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  
  
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_Document_remove_posting) {
  int argc;
  zval **argv[4];
  
  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_Xapian__Document, 0) >= 0);
    }
    if (_v) {
      {
        _v = (Z_TYPE_PP(argv[1]) == IS_STRING);
      }
      if (_v) {
        _v = (Z_TYPE_PP(argv[2]) == IS_LONG); 
        if (_v) {
          _wrap_Document_remove_posting__SWIG_1(INTERNAL_FUNCTION_PARAM_PASSTHRU); return;
        }
      }
    }
  }
  if (argc == 4) {
    int _v;
    {
      void *tmp;
      _v = (SWIG_ConvertPtr(*argv[0], (void**)&tmp, SWIGTYPE_p_Xapian__Document, 0) >= 0);
    }
    if (_v) {
      {
        _v = (Z_TYPE_PP(argv[1]) == IS_STRING);
      }
      if (_v) {
        _v = (Z_TYPE_PP(argv[2]) == IS_LONG); 
        if (_v) {
          _v = (Z_TYPE_PP(argv[3]) == IS_LONG); 
          if (_v) {
            _wrap_Document_remove_posting__SWIG_0(INTERNAL_FUNCTION_PARAM_PASSTHRU); return;
          }
        }
      }
    }
  }
  
  SWIG_ErrorCode() = E_ERROR;
  SWIG_ErrorMsg() = "No matching function for overloaded 'Document_remove_posting'";
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_Document_remove_term) {
  Xapian::Document *arg1 = (Xapian::Document *) 0 ;
  std::string *arg2 = 0 ;
  std::string temp2 ;
  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_Xapian__Document, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of Document_remove_term. Expected SWIGTYPE_p_Xapian__Document");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  
  convert_to_string_ex(args[1]);
  temp2.assign(Z_STRVAL_PP(args[1]), Z_STRLEN_PP(args[1]));
  arg2 = &temp2;
  
  {
    try {
      (arg1)->remove_term((std::string const &)*arg2);
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  
  
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_Document_clear_terms) {
  Xapian::Document *arg1 = (Xapian::Document *) 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_Xapian__Document, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of Document_clear_terms. Expected SWIGTYPE_p_Xapian__Document");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    try {
      (arg1)->clear_terms();
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_Document_termlist_count) {
  Xapian::Document *arg1 = (Xapian::Document *) 0 ;
  zval **args[1];
  Xapian::termcount 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_Xapian__Document, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of Document_termlist_count. Expected SWIGTYPE_p_Xapian__Document");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    try {
      result = (Xapian::termcount)((Xapian::Document const *)arg1)->termlist_count();
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  {
    ZVAL_LONG(return_value,result);
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_Document_termlist_begin) {
  Xapian::Document *arg1 = (Xapian::Document *) 0 ;
  zval **args[1];
  Xapian::TermIterator 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_Xapian__Document, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of Document_termlist_begin. Expected SWIGTYPE_p_Xapian__Document");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    try {
      result = ((Xapian::Document const *)arg1)->termlist_begin();
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  {
    Xapian::TermIterator * resultobj = new Xapian::TermIterator((const Xapian::TermIterator &) result);
    SWIG_SetPointerZval(return_value, (void *)resultobj, SWIGTYPE_p_Xapian__TermIterator, 1);
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_Document_termlist_end) {
  Xapian::Document *arg1 = (Xapian::Document *) 0 ;
  zval **args[1];
  Xapian::TermIterator 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_Xapian__Document, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of Document_termlist_end. Expected SWIGTYPE_p_Xapian__Document");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    try {
      result = ((Xapian::Document const *)arg1)->termlist_end();
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  {
    Xapian::TermIterator * resultobj = new Xapian::TermIterator((const Xapian::TermIterator &) result);
    SWIG_SetPointerZval(return_value, (void *)resultobj, SWIGTYPE_p_Xapian__TermIterator, 1);
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_Document_values_count) {
  Xapian::Document *arg1 = (Xapian::Document *) 0 ;
  zval **args[1];
  Xapian::termcount 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_Xapian__Document, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of Document_values_count. Expected SWIGTYPE_p_Xapian__Document");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    try {
      result = (Xapian::termcount)((Xapian::Document const *)arg1)->values_count();
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  {
    ZVAL_LONG(return_value,result);
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_Document_values_begin) {
  Xapian::Document *arg1 = (Xapian::Document *) 0 ;
  zval **args[1];
  Xapian::ValueIterator 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_Xapian__Document, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of Document_values_begin. Expected SWIGTYPE_p_Xapian__Document");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    try {
      result = ((Xapian::Document const *)arg1)->values_begin();
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  {
    Xapian::ValueIterator * resultobj = new Xapian::ValueIterator((const Xapian::ValueIterator &) result);
    SWIG_SetPointerZval(return_value, (void *)resultobj, SWIGTYPE_p_Xapian__ValueIterator, 1);
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_Document_values_end) {
  Xapian::Document *arg1 = (Xapian::Document *) 0 ;
  zval **args[1];
  Xapian::ValueIterator 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_Xapian__Document, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of Document_values_end. Expected SWIGTYPE_p_Xapian__Document");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    try {
      result = ((Xapian::Document const *)arg1)->values_end();
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  {
    Xapian::ValueIterator * resultobj = new Xapian::ValueIterator((const Xapian::ValueIterator &) result);
    SWIG_SetPointerZval(return_value, (void *)resultobj, SWIGTYPE_p_Xapian__ValueIterator, 1);
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_Document_get_docid) {
  Xapian::Document *arg1 = (Xapian::Document *) 0 ;
  zval **args[1];
  Xapian::docid 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_Xapian__Document, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of Document_get_docid. Expected SWIGTYPE_p_Xapian__Document");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    try {
      result = (Xapian::docid)((Xapian::Document const *)arg1)->get_docid();
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  {
    ZVAL_LONG(return_value,result);
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_Document_serialise) {
  Xapian::Document *arg1 = (Xapian::Document *) 0 ;
  zval **args[1];
  std::string 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_Xapian__Document, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of Document_serialise. Expected SWIGTYPE_p_Xapian__Document");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    try {
      result = ((Xapian::Document const *)arg1)->serialise();
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  
  ZVAL_STRINGL(return_value, const_cast<char*>((&result)->data()), (&result)->size(), 1);
  
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_Document_unserialise) {
  std::string *arg1 = 0 ;
  std::string temp1 ;
  zval **args[1];
  Xapian::Document result;
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 1 || zend_get_parameters_array_ex(1, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  
  convert_to_string_ex(args[0]);
  temp1.assign(Z_STRVAL_PP(args[0]), Z_STRLEN_PP(args[0]));
  arg1 = &temp1;
  
  {
    try {
      result = Xapian::Document::unserialise((std::string const &)*arg1);
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  {
    Xapian::Document * resultobj = new Xapian::Document((const Xapian::Document &) result);
    SWIG_SetPointerZval(return_value, (void *)resultobj, SWIGTYPE_p_Xapian__Document, 1);
  }
  
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_Document_get_description) {
  Xapian::Document *arg1 = (Xapian::Document *) 0 ;
  zval **args[1];
  std::string 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_Xapian__Document, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of Document_get_description. Expected SWIGTYPE_p_Xapian__Document");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    try {
      result = ((Xapian::Document const *)arg1)->get_description();
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  
  ZVAL_STRINGL(return_value, const_cast<char*>((&result)->data()), (&result)->size(), 1);
  
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_new_PostingSource) {
  zval *arg0;
  zval **args[1];
  Xapian::PostingSource *result = 0 ;
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 1 || zend_get_parameters_array_ex(1, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  arg0 = *args[0];
  
  {
    try {
      if ( arg0->type == IS_NULL ) {
        /* not subclassed */
        SWIG_PHP_Error(E_ERROR, "accessing abstract class or protected constructor");
      } else {
        result = (Xapian::PostingSource *)new SwigDirector_PostingSource(arg0 TSRMLS_CC);
      }
      
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  
  SWIG_SetPointerZval(return_value, (void *)result, SWIGTYPE_p_Xapian__PostingSource, 1);
  
  return;
fail:
  zend_error(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_PostingSource(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 ;
  Xapian::PostingSource *arg1 = (Xapian::PostingSource *) 0 ;
  
  efree(value);
  if (! newobject) return; /* can't delete it! */
  arg1 = (Xapian::PostingSource *)SWIG_ZTS_ConvertResourceData(ptr,type_name,SWIGTYPE_p_Xapian__PostingSource TSRMLS_CC);
  if (! arg1) zend_error(E_ERROR, "Xapian::PostingSource resource already free'd");
  {
    try {
      delete arg1;
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_PostingSource_get_termfreq_min) {
  Xapian::PostingSource *arg1 = (Xapian::PostingSource *) 0 ;
  zval **args[1];
  Swig::Director *director = 0;
  bool upcall = false;
  Xapian::doccount result;
  
  director = dynamic_cast<Swig::Director*>(arg1);
  upcall = !director->swig_is_overridden_method((char *)"XapianPostingSource", (char *)"get_termfreq_min");
  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_Xapian__PostingSource, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of PostingSource_get_termfreq_min. Expected SWIGTYPE_p_Xapian__PostingSource");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    try {
      if (upcall) {
        Swig::DirectorPureVirtualException::raise("Xapian::PostingSource::get_termfreq_min" TSRMLS_CC);
      } else {
        result = (Xapian::doccount)((Xapian::PostingSource const *)arg1)->get_termfreq_min();
      }
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  {
    ZVAL_LONG(return_value,result);
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_PostingSource_get_termfreq_est) {
  Xapian::PostingSource *arg1 = (Xapian::PostingSource *) 0 ;
  zval **args[1];
  Swig::Director *director = 0;
  bool upcall = false;
  Xapian::doccount result;
  
  director = dynamic_cast<Swig::Director*>(arg1);
  upcall = !director->swig_is_overridden_method((char *)"XapianPostingSource", (char *)"get_termfreq_est");
  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_Xapian__PostingSource, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of PostingSource_get_termfreq_est. Expected SWIGTYPE_p_Xapian__PostingSource");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    try {
      if (upcall) {
        Swig::DirectorPureVirtualException::raise("Xapian::PostingSource::get_termfreq_est" TSRMLS_CC);
      } else {
        result = (Xapian::doccount)((Xapian::PostingSource const *)arg1)->get_termfreq_est();
      }
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  {
    ZVAL_LONG(return_value,result);
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_PostingSource_get_termfreq_max) {
  Xapian::PostingSource *arg1 = (Xapian::PostingSource *) 0 ;
  zval **args[1];
  Swig::Director *director = 0;
  bool upcall = false;
  Xapian::doccount result;
  
  director = dynamic_cast<Swig::Director*>(arg1);
  upcall = !director->swig_is_overridden_method((char *)"XapianPostingSource", (char *)"get_termfreq_max");
  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_Xapian__PostingSource, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of PostingSource_get_termfreq_max. Expected SWIGTYPE_p_Xapian__PostingSource");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    try {
      if (upcall) {
        Swig::DirectorPureVirtualException::raise("Xapian::PostingSource::get_termfreq_max" TSRMLS_CC);
      } else {
        result = (Xapian::doccount)((Xapian::PostingSource const *)arg1)->get_termfreq_max();
      }
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  {
    ZVAL_LONG(return_value,result);
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_PostingSource_get_maxweight) {
  Xapian::PostingSource *arg1 = (Xapian::PostingSource *) 0 ;
  zval **args[1];
  Xapian::weight 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_Xapian__PostingSource, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of PostingSource_get_maxweight. Expected SWIGTYPE_p_Xapian__PostingSource");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    try {
      result = (Xapian::weight)((Xapian::PostingSource const *)arg1)->get_maxweight();
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  {
    ZVAL_DOUBLE(return_value,result);
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_PostingSource_get_weight) {
  Xapian::PostingSource *arg1 = (Xapian::PostingSource *) 0 ;
  zval **args[1];
  Swig::Director *director = 0;
  bool upcall = false;
  Xapian::weight result;
  
  director = dynamic_cast<Swig::Director*>(arg1);
  upcall = !director->swig_is_overridden_method((char *)"XapianPostingSource", (char *)"get_weight");
  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_Xapian__PostingSource, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of PostingSource_get_weight. Expected SWIGTYPE_p_Xapian__PostingSource");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    try {
      if (upcall) {
        result = (Xapian::weight)((Xapian::PostingSource const *)arg1)->Xapian::PostingSource::get_weight();
      } else {
        result = (Xapian::weight)((Xapian::PostingSource const *)arg1)->get_weight();
      }
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  {
    ZVAL_DOUBLE(return_value,result);
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_PostingSource_get_docid) {
  Xapian::PostingSource *arg1 = (Xapian::PostingSource *) 0 ;
  zval **args[1];
  Swig::Director *director = 0;
  bool upcall = false;
  Xapian::docid result;
  
  director = dynamic_cast<Swig::Director*>(arg1);
  upcall = !director->swig_is_overridden_method((char *)"XapianPostingSource", (char *)"get_docid");
  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_Xapian__PostingSource, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of PostingSource_get_docid. Expected SWIGTYPE_p_Xapian__PostingSource");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    try {
      if (upcall) {
        Swig::DirectorPureVirtualException::raise("Xapian::PostingSource::get_docid" TSRMLS_CC);
      } else {
        result = (Xapian::docid)((Xapian::PostingSource const *)arg1)->get_docid();
      }
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  {
    ZVAL_LONG(return_value,result);
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_PostingSource_next) {
  Xapian::PostingSource *arg1 = (Xapian::PostingSource *) 0 ;
  Xapian::weight arg2 ;
  zval **args[2];
  Swig::Director *director = 0;
  bool upcall = false;
  
  director = dynamic_cast<Swig::Director*>(arg1);
  upcall = !director->swig_is_overridden_method((char *)"XapianPostingSource", (char *)"next");
  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_Xapian__PostingSource, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of PostingSource_next. Expected SWIGTYPE_p_Xapian__PostingSource");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  
  /*@SWIG:/data/home/olly/tmp/xapian-svn-snapshot/tags/1.2.8/xapian/swig/Lib/php/utils.i,52,CONVERT_FLOAT_IN@*/
  convert_to_double_ex(args[1]);
  arg2 = (Xapian::weight) Z_DVAL_PP(args[1]);
  /*@SWIG@*/;
  
  {
    try {
      if (upcall) {
        Swig::DirectorPureVirtualException::raise("Xapian::PostingSource::next" TSRMLS_CC);
      } else {
        (arg1)->next(arg2);
      }
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_PostingSource_skip_to) {
  Xapian::PostingSource *arg1 = (Xapian::PostingSource *) 0 ;
  Xapian::docid arg2 ;
  Xapian::weight arg3 ;
  zval **args[3];
  Swig::Director *director = 0;
  bool upcall = false;
  
  director = dynamic_cast<Swig::Director*>(arg1);
  upcall = !director->swig_is_overridden_method((char *)"XapianPostingSource", (char *)"skip_to");
  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_Xapian__PostingSource, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of PostingSource_skip_to. Expected SWIGTYPE_p_Xapian__PostingSource");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  
  /*@SWIG:/data/home/olly/tmp/xapian-svn-snapshot/tags/1.2.8/xapian/swig/Lib/php/utils.i,7,CONVERT_INT_IN@*/
  convert_to_long_ex(args[1]);
  arg2 = (Xapian::docid) Z_LVAL_PP(args[1]);
  /*@SWIG@*/;
  
  
  /*@SWIG:/data/home/olly/tmp/xapian-svn-snapshot/tags/1.2.8/xapian/swig/Lib/php/utils.i,52,CONVERT_FLOAT_IN@*/
  convert_to_double_ex(args[2]);
  arg3 = (Xapian::weight) Z_DVAL_PP(args[2]);
  /*@SWIG@*/;
  
  {
    try {
      if (upcall) {
        (arg1)->Xapian::PostingSource::skip_to(arg2,arg3);
      } else {
        (arg1)->skip_to(arg2,arg3);
      }
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_PostingSource_check) {
  Xapian::PostingSource *arg1 = (Xapian::PostingSource *) 0 ;
  Xapian::docid arg2 ;
  Xapian::weight arg3 ;
  zval **args[3];
  Swig::Director *director = 0;
  bool upcall = false;
  bool result;
  
  director = dynamic_cast<Swig::Director*>(arg1);
  upcall = !director->swig_is_overridden_method((char *)"XapianPostingSource", (char *)"check");
  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_Xapian__PostingSource, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of PostingSource_check. Expected SWIGTYPE_p_Xapian__PostingSource");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  
  /*@SWIG:/data/home/olly/tmp/xapian-svn-snapshot/tags/1.2.8/xapian/swig/Lib/php/utils.i,7,CONVERT_INT_IN@*/
  convert_to_long_ex(args[1]);
  arg2 = (Xapian::docid) Z_LVAL_PP(args[1]);
  /*@SWIG@*/;
  
  
  /*@SWIG:/data/home/olly/tmp/xapian-svn-snapshot/tags/1.2.8/xapian/swig/Lib/php/utils.i,52,CONVERT_FLOAT_IN@*/
  convert_to_double_ex(args[2]);
  arg3 = (Xapian::weight) Z_DVAL_PP(args[2]);
  /*@SWIG@*/;
  
  {
    try {
      if (upcall) {
        result = (bool)(arg1)->Xapian::PostingSource::check(arg2,arg3);
      } else {
        result = (bool)(arg1)->check(arg2,arg3);
      }
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  {
    ZVAL_BOOL(return_value,(result)?1:0);
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_PostingSource_at_end) {
  Xapian::PostingSource *arg1 = (Xapian::PostingSource *) 0 ;
  zval **args[1];
  Swig::Director *director = 0;
  bool upcall = false;
  bool result;
  
  director = dynamic_cast<Swig::Director*>(arg1);
  upcall = !director->swig_is_overridden_method((char *)"XapianPostingSource", (char *)"at_end");
  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_Xapian__PostingSource, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of PostingSource_at_end. Expected SWIGTYPE_p_Xapian__PostingSource");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    try {
      if (upcall) {
        Swig::DirectorPureVirtualException::raise("Xapian::PostingSource::at_end" TSRMLS_CC);
      } else {
        result = (bool)((Xapian::PostingSource const *)arg1)->at_end();
      }
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  {
    ZVAL_BOOL(return_value,(result)?1:0);
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_PostingSource_name) {
  Xapian::PostingSource *arg1 = (Xapian::PostingSource *) 0 ;
  zval **args[1];
  Swig::Director *director = 0;
  bool upcall = false;
  std::string result;
  
  director = dynamic_cast<Swig::Director*>(arg1);
  upcall = !director->swig_is_overridden_method((char *)"XapianPostingSource", (char *)"name");
  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_Xapian__PostingSource, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of PostingSource_name. Expected SWIGTYPE_p_Xapian__PostingSource");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    try {
      if (upcall) {
        result = ((Xapian::PostingSource const *)arg1)->Xapian::PostingSource::name();
      } else {
        result = ((Xapian::PostingSource const *)arg1)->name();
      }
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  
  ZVAL_STRINGL(return_value, const_cast<char*>((&result)->data()), (&result)->size(), 1);
  
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_PostingSource_init) {
  Xapian::PostingSource *arg1 = (Xapian::PostingSource *) 0 ;
  Xapian::Database *arg2 = 0 ;
  zval **args[2];
  Swig::Director *director = 0;
  bool upcall = false;
  
  director = dynamic_cast<Swig::Director*>(arg1);
  upcall = !director->swig_is_overridden_method((char *)"XapianPostingSource", (char *)"init");
  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_Xapian__PostingSource, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of PostingSource_init. Expected SWIGTYPE_p_Xapian__PostingSource");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    if (SWIG_ConvertPtr(*args[1], (void**)&arg2, SWIGTYPE_p_Xapian__Database, 0) < 0 || arg2 == NULL) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 2 of PostingSource_init. Expected SWIGTYPE_p_Xapian__Database");
    }
  }
  {
    try {
      if (upcall) {
        Swig::DirectorPureVirtualException::raise("Xapian::PostingSource::init" TSRMLS_CC);
      } else {
        (arg1)->init((Xapian::Database const &)*arg2);
      }
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_PostingSource_get_description) {
  Xapian::PostingSource *arg1 = (Xapian::PostingSource *) 0 ;
  zval **args[1];
  Swig::Director *director = 0;
  bool upcall = false;
  std::string result;
  
  director = dynamic_cast<Swig::Director*>(arg1);
  upcall = !director->swig_is_overridden_method((char *)"XapianPostingSource", (char *)"get_description");
  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_Xapian__PostingSource, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of PostingSource_get_description. Expected SWIGTYPE_p_Xapian__PostingSource");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    try {
      if (upcall) {
        result = ((Xapian::PostingSource const *)arg1)->Xapian::PostingSource::get_description();
      } else {
        result = ((Xapian::PostingSource const *)arg1)->get_description();
      }
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  
  ZVAL_STRINGL(return_value, const_cast<char*>((&result)->data()), (&result)->size(), 1);
  
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_new_ValuePostingSource) {
  Xapian::valueno arg1 ;
  zval **args[1];
  Xapian::ValuePostingSource *result = 0 ;
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 1 || zend_get_parameters_array_ex(1, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  
  /*@SWIG:/data/home/olly/tmp/xapian-svn-snapshot/tags/1.2.8/xapian/swig/Lib/php/utils.i,7,CONVERT_INT_IN@*/
  convert_to_long_ex(args[0]);
  arg1 = (Xapian::valueno) Z_LVAL_PP(args[0]);
  /*@SWIG@*/;
  
  {
    try {
      result = (Xapian::ValuePostingSource *)new Xapian::ValuePostingSource(arg1);
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  
  SWIG_SetPointerZval(return_value, (void *)result, SWIGTYPE_p_Xapian__ValuePostingSource, 1);
  
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_ValuePostingSource_get_termfreq_min) {
  Xapian::ValuePostingSource *arg1 = (Xapian::ValuePostingSource *) 0 ;
  zval **args[1];
  Xapian::doccount 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_Xapian__ValuePostingSource, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of ValuePostingSource_get_termfreq_min. Expected SWIGTYPE_p_Xapian__ValuePostingSource");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    try {
      result = (Xapian::doccount)((Xapian::ValuePostingSource const *)arg1)->get_termfreq_min();
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  {
    ZVAL_LONG(return_value,result);
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_ValuePostingSource_get_termfreq_est) {
  Xapian::ValuePostingSource *arg1 = (Xapian::ValuePostingSource *) 0 ;
  zval **args[1];
  Xapian::doccount 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_Xapian__ValuePostingSource, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of ValuePostingSource_get_termfreq_est. Expected SWIGTYPE_p_Xapian__ValuePostingSource");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    try {
      result = (Xapian::doccount)((Xapian::ValuePostingSource const *)arg1)->get_termfreq_est();
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  {
    ZVAL_LONG(return_value,result);
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_ValuePostingSource_get_termfreq_max) {
  Xapian::ValuePostingSource *arg1 = (Xapian::ValuePostingSource *) 0 ;
  zval **args[1];
  Xapian::doccount 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_Xapian__ValuePostingSource, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of ValuePostingSource_get_termfreq_max. Expected SWIGTYPE_p_Xapian__ValuePostingSource");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    try {
      result = (Xapian::doccount)((Xapian::ValuePostingSource const *)arg1)->get_termfreq_max();
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  {
    ZVAL_LONG(return_value,result);
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_ValuePostingSource_next) {
  Xapian::ValuePostingSource *arg1 = (Xapian::ValuePostingSource *) 0 ;
  Xapian::weight 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_Xapian__ValuePostingSource, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of ValuePostingSource_next. Expected SWIGTYPE_p_Xapian__ValuePostingSource");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  
  /*@SWIG:/data/home/olly/tmp/xapian-svn-snapshot/tags/1.2.8/xapian/swig/Lib/php/utils.i,52,CONVERT_FLOAT_IN@*/
  convert_to_double_ex(args[1]);
  arg2 = (Xapian::weight) Z_DVAL_PP(args[1]);
  /*@SWIG@*/;
  
  {
    try {
      (arg1)->next(arg2);
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_ValuePostingSource_skip_to) {
  Xapian::ValuePostingSource *arg1 = (Xapian::ValuePostingSource *) 0 ;
  Xapian::docid arg2 ;
  Xapian::weight arg3 ;
  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_Xapian__ValuePostingSource, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of ValuePostingSource_skip_to. Expected SWIGTYPE_p_Xapian__ValuePostingSource");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  
  /*@SWIG:/data/home/olly/tmp/xapian-svn-snapshot/tags/1.2.8/xapian/swig/Lib/php/utils.i,7,CONVERT_INT_IN@*/
  convert_to_long_ex(args[1]);
  arg2 = (Xapian::docid) Z_LVAL_PP(args[1]);
  /*@SWIG@*/;
  
  
  /*@SWIG:/data/home/olly/tmp/xapian-svn-snapshot/tags/1.2.8/xapian/swig/Lib/php/utils.i,52,CONVERT_FLOAT_IN@*/
  convert_to_double_ex(args[2]);
  arg3 = (Xapian::weight) Z_DVAL_PP(args[2]);
  /*@SWIG@*/;
  
  {
    try {
      (arg1)->skip_to(arg2,arg3);
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_ValuePostingSource_check) {
  Xapian::ValuePostingSource *arg1 = (Xapian::ValuePostingSource *) 0 ;
  Xapian::docid arg2 ;
  Xapian::weight arg3 ;
  zval **args[3];
  bool 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_Xapian__ValuePostingSource, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of ValuePostingSource_check. Expected SWIGTYPE_p_Xapian__ValuePostingSource");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  
  /*@SWIG:/data/home/olly/tmp/xapian-svn-snapshot/tags/1.2.8/xapian/swig/Lib/php/utils.i,7,CONVERT_INT_IN@*/
  convert_to_long_ex(args[1]);
  arg2 = (Xapian::docid) Z_LVAL_PP(args[1]);
  /*@SWIG@*/;
  
  
  /*@SWIG:/data/home/olly/tmp/xapian-svn-snapshot/tags/1.2.8/xapian/swig/Lib/php/utils.i,52,CONVERT_FLOAT_IN@*/
  convert_to_double_ex(args[2]);
  arg3 = (Xapian::weight) Z_DVAL_PP(args[2]);
  /*@SWIG@*/;
  
  {
    try {
      result = (bool)(arg1)->check(arg2,arg3);
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  {
    ZVAL_BOOL(return_value,(result)?1:0);
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_ValuePostingSource_at_end) {
  Xapian::ValuePostingSource *arg1 = (Xapian::ValuePostingSource *) 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_Xapian__ValuePostingSource, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of ValuePostingSource_at_end. Expected SWIGTYPE_p_Xapian__ValuePostingSource");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    try {
      result = (bool)((Xapian::ValuePostingSource const *)arg1)->at_end();
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  {
    ZVAL_BOOL(return_value,(result)?1:0);
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_ValuePostingSource_get_docid) {
  Xapian::ValuePostingSource *arg1 = (Xapian::ValuePostingSource *) 0 ;
  zval **args[1];
  Xapian::docid 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_Xapian__ValuePostingSource, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of ValuePostingSource_get_docid. Expected SWIGTYPE_p_Xapian__ValuePostingSource");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    try {
      result = (Xapian::docid)((Xapian::ValuePostingSource const *)arg1)->get_docid();
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  {
    ZVAL_LONG(return_value,result);
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_ValuePostingSource_init) {
  Xapian::ValuePostingSource *arg1 = (Xapian::ValuePostingSource *) 0 ;
  Xapian::Database *arg2 = 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_Xapian__ValuePostingSource, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of ValuePostingSource_init. Expected SWIGTYPE_p_Xapian__ValuePostingSource");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    if (SWIG_ConvertPtr(*args[1], (void**)&arg2, SWIGTYPE_p_Xapian__Database, 0) < 0 || arg2 == NULL) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 2 of ValuePostingSource_init. Expected SWIGTYPE_p_Xapian__Database");
    }
  }
  {
    try {
      (arg1)->init((Xapian::Database const &)*arg2);
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  
  return;
fail:
  zend_error(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_ValuePostingSource(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 ;
  Xapian::ValuePostingSource *arg1 = (Xapian::ValuePostingSource *) 0 ;
  
  efree(value);
  if (! newobject) return; /* can't delete it! */
  arg1 = (Xapian::ValuePostingSource *)SWIG_ZTS_ConvertResourceData(ptr,type_name,SWIGTYPE_p_Xapian__ValuePostingSource TSRMLS_CC);
  if (! arg1) zend_error(E_ERROR, "Xapian::ValuePostingSource resource already free'd");
  {
    try {
      delete arg1;
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_new_ValueWeightPostingSource) {
  Xapian::valueno arg1 ;
  zval **args[1];
  Xapian::ValueWeightPostingSource *result = 0 ;
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 1 || zend_get_parameters_array_ex(1, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  
  /*@SWIG:/data/home/olly/tmp/xapian-svn-snapshot/tags/1.2.8/xapian/swig/Lib/php/utils.i,7,CONVERT_INT_IN@*/
  convert_to_long_ex(args[0]);
  arg1 = (Xapian::valueno) Z_LVAL_PP(args[0]);
  /*@SWIG@*/;
  
  {
    try {
      result = (Xapian::ValueWeightPostingSource *)new Xapian::ValueWeightPostingSource(arg1);
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  
  SWIG_SetPointerZval(return_value, (void *)result, SWIGTYPE_p_Xapian__ValueWeightPostingSource, 1);
  
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_ValueWeightPostingSource_get_weight) {
  Xapian::ValueWeightPostingSource *arg1 = (Xapian::ValueWeightPostingSource *) 0 ;
  zval **args[1];
  Xapian::weight 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_Xapian__ValueWeightPostingSource, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of ValueWeightPostingSource_get_weight. Expected SWIGTYPE_p_Xapian__ValueWeightPostingSource");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    try {
      result = (Xapian::weight)((Xapian::ValueWeightPostingSource const *)arg1)->get_weight();
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  {
    ZVAL_DOUBLE(return_value,result);
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_ValueWeightPostingSource_name) {
  Xapian::ValueWeightPostingSource *arg1 = (Xapian::ValueWeightPostingSource *) 0 ;
  zval **args[1];
  std::string 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_Xapian__ValueWeightPostingSource, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of ValueWeightPostingSource_name. Expected SWIGTYPE_p_Xapian__ValueWeightPostingSource");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    try {
      result = ((Xapian::ValueWeightPostingSource const *)arg1)->name();
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  
  ZVAL_STRINGL(return_value, const_cast<char*>((&result)->data()), (&result)->size(), 1);
  
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_ValueWeightPostingSource_init) {
  Xapian::ValueWeightPostingSource *arg1 = (Xapian::ValueWeightPostingSource *) 0 ;
  Xapian::Database *arg2 = 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_Xapian__ValueWeightPostingSource, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of ValueWeightPostingSource_init. Expected SWIGTYPE_p_Xapian__ValueWeightPostingSource");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    if (SWIG_ConvertPtr(*args[1], (void**)&arg2, SWIGTYPE_p_Xapian__Database, 0) < 0 || arg2 == NULL) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 2 of ValueWeightPostingSource_init. Expected SWIGTYPE_p_Xapian__Database");
    }
  }
  {
    try {
      (arg1)->init((Xapian::Database const &)*arg2);
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_ValueWeightPostingSource_get_description) {
  Xapian::ValueWeightPostingSource *arg1 = (Xapian::ValueWeightPostingSource *) 0 ;
  zval **args[1];
  std::string 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_Xapian__ValueWeightPostingSource, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of ValueWeightPostingSource_get_description. Expected SWIGTYPE_p_Xapian__ValueWeightPostingSource");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    try {
      result = ((Xapian::ValueWeightPostingSource const *)arg1)->get_description();
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  
  ZVAL_STRINGL(return_value, const_cast<char*>((&result)->data()), (&result)->size(), 1);
  
  return;
fail:
  zend_error(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_ValueWeightPostingSource(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 ;
  Xapian::ValueWeightPostingSource *arg1 = (Xapian::ValueWeightPostingSource *) 0 ;
  
  efree(value);
  if (! newobject) return; /* can't delete it! */
  arg1 = (Xapian::ValueWeightPostingSource *)SWIG_ZTS_ConvertResourceData(ptr,type_name,SWIGTYPE_p_Xapian__ValueWeightPostingSource TSRMLS_CC);
  if (! arg1) zend_error(E_ERROR, "Xapian::ValueWeightPostingSource resource already free'd");
  {
    try {
      delete arg1;
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_new_DecreasingValueWeightPostingSource__SWIG_0) {
  Xapian::valueno arg1 ;
  Xapian::docid arg2 ;
  Xapian::docid arg3 ;
  zval **args[3];
  Xapian::DecreasingValueWeightPostingSource *result = 0 ;
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 3 || zend_get_parameters_array_ex(3, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  
  /*@SWIG:/data/home/olly/tmp/xapian-svn-snapshot/tags/1.2.8/xapian/swig/Lib/php/utils.i,7,CONVERT_INT_IN@*/
  convert_to_long_ex(args[0]);
  arg1 = (Xapian::valueno) Z_LVAL_PP(args[0]);
  /*@SWIG@*/;
  
  
  /*@SWIG:/data/home/olly/tmp/xapian-svn-snapshot/tags/1.2.8/xapian/swig/Lib/php/utils.i,7,CONVERT_INT_IN@*/
  convert_to_long_ex(args[1]);
  arg2 = (Xapian::docid) Z_LVAL_PP(args[1]);
  /*@SWIG@*/;
  
  
  /*@SWIG:/data/home/olly/tmp/xapian-svn-snapshot/tags/1.2.8/xapian/swig/Lib/php/utils.i,7,CONVERT_INT_IN@*/
  convert_to_long_ex(args[2]);
  arg3 = (Xapian::docid) Z_LVAL_PP(args[2]);
  /*@SWIG@*/;
  
  {
    try {
      result = (Xapian::DecreasingValueWeightPostingSource *)new Xapian::DecreasingValueWeightPostingSource(arg1,arg2,arg3);
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  
  SWIG_SetPointerZval(return_value, (void *)result, SWIGTYPE_p_Xapian__DecreasingValueWeightPostingSource, 1);
  
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_new_DecreasingValueWeightPostingSource__SWIG_1) {
  Xapian::valueno arg1 ;
  Xapian::docid arg2 ;
  zval **args[2];
  Xapian::DecreasingValueWeightPostingSource *result = 0 ;
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 2 || zend_get_parameters_array_ex(2, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  
  /*@SWIG:/data/home/olly/tmp/xapian-svn-snapshot/tags/1.2.8/xapian/swig/Lib/php/utils.i,7,CONVERT_INT_IN@*/
  convert_to_long_ex(args[0]);
  arg1 = (Xapian::valueno) Z_LVAL_PP(args[0]);
  /*@SWIG@*/;
  
  
  /*@SWIG:/data/home/olly/tmp/xapian-svn-snapshot/tags/1.2.8/xapian/swig/Lib/php/utils.i,7,CONVERT_INT_IN@*/
  convert_to_long_ex(args[1]);
  arg2 = (Xapian::docid) Z_LVAL_PP(args[1]);
  /*@SWIG@*/;
  
  {
    try {
      result = (Xapian::DecreasingValueWeightPostingSource *)new Xapian::DecreasingValueWeightPostingSource(arg1,arg2);
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  
  SWIG_SetPointerZval(return_value, (void *)result, SWIGTYPE_p_Xapian__DecreasingValueWeightPostingSource, 1);
  
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_new_DecreasingValueWeightPostingSource__SWIG_2) {
  Xapian::valueno arg1 ;
  zval **args[1];
  Xapian::DecreasingValueWeightPostingSource *result = 0 ;
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 1 || zend_get_parameters_array_ex(1, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  
  /*@SWIG:/data/home/olly/tmp/xapian-svn-snapshot/tags/1.2.8/xapian/swig/Lib/php/utils.i,7,CONVERT_INT_IN@*/
  convert_to_long_ex(args[0]);
  arg1 = (Xapian::valueno) Z_LVAL_PP(args[0]);
  /*@SWIG@*/;
  
  {
    try {
      result = (Xapian::DecreasingValueWeightPostingSource *)new Xapian::DecreasingValueWeightPostingSource(arg1);
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  
  SWIG_SetPointerZval(return_value, (void *)result, SWIGTYPE_p_Xapian__DecreasingValueWeightPostingSource, 1);
  
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_new_DecreasingValueWeightPostingSource) {
  int argc;
  zval **argv[3];
  
  argc = ZEND_NUM_ARGS();
  zend_get_parameters_array_ex(argc,argv);
  if (argc == 1) {
    int _v;
    _v = (Z_TYPE_PP(argv[0]) == IS_LONG); 
    if (_v) {
      _wrap_new_DecreasingValueWeightPostingSource__SWIG_2(INTERNAL_FUNCTION_PARAM_PASSTHRU); return;
    }
  }
  if (argc == 2) {
    int _v;
    _v = (Z_TYPE_PP(argv[0]) == IS_LONG); 
    if (_v) {
      _v = (Z_TYPE_PP(argv[1]) == IS_LONG); 
      if (_v) {
        _wrap_new_DecreasingValueWeightPostingSource__SWIG_1(INTERNAL_FUNCTION_PARAM_PASSTHRU); return;
      }
    }
  }
  if (argc == 3) {
    int _v;
    _v = (Z_TYPE_PP(argv[0]) == IS_LONG); 
    if (_v) {
      _v = (Z_TYPE_PP(argv[1]) == IS_LONG); 
      if (_v) {
        _v = (Z_TYPE_PP(argv[2]) == IS_LONG); 
        if (_v) {
          _wrap_new_DecreasingValueWeightPostingSource__SWIG_0(INTERNAL_FUNCTION_PARAM_PASSTHRU); return;
        }
      }
    }
  }
  
  SWIG_ErrorCode() = E_ERROR;
  SWIG_ErrorMsg() = "No matching function for overloaded 'new_DecreasingValueWeightPostingSource'";
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_DecreasingValueWeightPostingSource_get_weight) {
  Xapian::DecreasingValueWeightPostingSource *arg1 = (Xapian::DecreasingValueWeightPostingSource *) 0 ;
  zval **args[1];
  Xapian::weight 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_Xapian__DecreasingValueWeightPostingSource, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of DecreasingValueWeightPostingSource_get_weight. Expected SWIGTYPE_p_Xapian__DecreasingValueWeightPostingSource");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    try {
      result = (Xapian::weight)((Xapian::DecreasingValueWeightPostingSource const *)arg1)->get_weight();
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  {
    ZVAL_DOUBLE(return_value,result);
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_DecreasingValueWeightPostingSource_name) {
  Xapian::DecreasingValueWeightPostingSource *arg1 = (Xapian::DecreasingValueWeightPostingSource *) 0 ;
  zval **args[1];
  std::string 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_Xapian__DecreasingValueWeightPostingSource, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of DecreasingValueWeightPostingSource_name. Expected SWIGTYPE_p_Xapian__DecreasingValueWeightPostingSource");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    try {
      result = ((Xapian::DecreasingValueWeightPostingSource const *)arg1)->name();
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  
  ZVAL_STRINGL(return_value, const_cast<char*>((&result)->data()), (&result)->size(), 1);
  
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_DecreasingValueWeightPostingSource_init) {
  Xapian::DecreasingValueWeightPostingSource *arg1 = (Xapian::DecreasingValueWeightPostingSource *) 0 ;
  Xapian::Database *arg2 = 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_Xapian__DecreasingValueWeightPostingSource, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of DecreasingValueWeightPostingSource_init. Expected SWIGTYPE_p_Xapian__DecreasingValueWeightPostingSource");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    if (SWIG_ConvertPtr(*args[1], (void**)&arg2, SWIGTYPE_p_Xapian__Database, 0) < 0 || arg2 == NULL) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 2 of DecreasingValueWeightPostingSource_init. Expected SWIGTYPE_p_Xapian__Database");
    }
  }
  {
    try {
      (arg1)->init((Xapian::Database const &)*arg2);
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_DecreasingValueWeightPostingSource_next) {
  Xapian::DecreasingValueWeightPostingSource *arg1 = (Xapian::DecreasingValueWeightPostingSource *) 0 ;
  Xapian::weight 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_Xapian__DecreasingValueWeightPostingSource, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of DecreasingValueWeightPostingSource_next. Expected SWIGTYPE_p_Xapian__DecreasingValueWeightPostingSource");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  
  /*@SWIG:/data/home/olly/tmp/xapian-svn-snapshot/tags/1.2.8/xapian/swig/Lib/php/utils.i,52,CONVERT_FLOAT_IN@*/
  convert_to_double_ex(args[1]);
  arg2 = (Xapian::weight) Z_DVAL_PP(args[1]);
  /*@SWIG@*/;
  
  {
    try {
      (arg1)->next(arg2);
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_DecreasingValueWeightPostingSource_skip_to) {
  Xapian::DecreasingValueWeightPostingSource *arg1 = (Xapian::DecreasingValueWeightPostingSource *) 0 ;
  Xapian::docid arg2 ;
  Xapian::weight arg3 ;
  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_Xapian__DecreasingValueWeightPostingSource, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of DecreasingValueWeightPostingSource_skip_to. Expected SWIGTYPE_p_Xapian__DecreasingValueWeightPostingSource");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  
  /*@SWIG:/data/home/olly/tmp/xapian-svn-snapshot/tags/1.2.8/xapian/swig/Lib/php/utils.i,7,CONVERT_INT_IN@*/
  convert_to_long_ex(args[1]);
  arg2 = (Xapian::docid) Z_LVAL_PP(args[1]);
  /*@SWIG@*/;
  
  
  /*@SWIG:/data/home/olly/tmp/xapian-svn-snapshot/tags/1.2.8/xapian/swig/Lib/php/utils.i,52,CONVERT_FLOAT_IN@*/
  convert_to_double_ex(args[2]);
  arg3 = (Xapian::weight) Z_DVAL_PP(args[2]);
  /*@SWIG@*/;
  
  {
    try {
      (arg1)->skip_to(arg2,arg3);
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_DecreasingValueWeightPostingSource_check) {
  Xapian::DecreasingValueWeightPostingSource *arg1 = (Xapian::DecreasingValueWeightPostingSource *) 0 ;
  Xapian::docid arg2 ;
  Xapian::weight arg3 ;
  zval **args[3];
  bool 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_Xapian__DecreasingValueWeightPostingSource, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of DecreasingValueWeightPostingSource_check. Expected SWIGTYPE_p_Xapian__DecreasingValueWeightPostingSource");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  
  /*@SWIG:/data/home/olly/tmp/xapian-svn-snapshot/tags/1.2.8/xapian/swig/Lib/php/utils.i,7,CONVERT_INT_IN@*/
  convert_to_long_ex(args[1]);
  arg2 = (Xapian::docid) Z_LVAL_PP(args[1]);
  /*@SWIG@*/;
  
  
  /*@SWIG:/data/home/olly/tmp/xapian-svn-snapshot/tags/1.2.8/xapian/swig/Lib/php/utils.i,52,CONVERT_FLOAT_IN@*/
  convert_to_double_ex(args[2]);
  arg3 = (Xapian::weight) Z_DVAL_PP(args[2]);
  /*@SWIG@*/;
  
  {
    try {
      result = (bool)(arg1)->check(arg2,arg3);
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  {
    ZVAL_BOOL(return_value,(result)?1:0);
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_DecreasingValueWeightPostingSource_get_description) {
  Xapian::DecreasingValueWeightPostingSource *arg1 = (Xapian::DecreasingValueWeightPostingSource *) 0 ;
  zval **args[1];
  std::string 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_Xapian__DecreasingValueWeightPostingSource, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of DecreasingValueWeightPostingSource_get_description. Expected SWIGTYPE_p_Xapian__DecreasingValueWeightPostingSource");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    try {
      result = ((Xapian::DecreasingValueWeightPostingSource const *)arg1)->get_description();
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  
  ZVAL_STRINGL(return_value, const_cast<char*>((&result)->data()), (&result)->size(), 1);
  
  return;
fail:
  zend_error(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_DecreasingValueWeightPostingSource(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 ;
  Xapian::DecreasingValueWeightPostingSource *arg1 = (Xapian::DecreasingValueWeightPostingSource *) 0 ;
  
  efree(value);
  if (! newobject) return; /* can't delete it! */
  arg1 = (Xapian::DecreasingValueWeightPostingSource *)SWIG_ZTS_ConvertResourceData(ptr,type_name,SWIGTYPE_p_Xapian__DecreasingValueWeightPostingSource TSRMLS_CC);
  if (! arg1) zend_error(E_ERROR, "Xapian::DecreasingValueWeightPostingSource resource already free'd");
  {
    try {
      delete arg1;
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_new_ValueMapPostingSource) {
  Xapian::valueno arg1 ;
  zval **args[1];
  Xapian::ValueMapPostingSource *result = 0 ;
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 1 || zend_get_parameters_array_ex(1, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  
  /*@SWIG:/data/home/olly/tmp/xapian-svn-snapshot/tags/1.2.8/xapian/swig/Lib/php/utils.i,7,CONVERT_INT_IN@*/
  convert_to_long_ex(args[0]);
  arg1 = (Xapian::valueno) Z_LVAL_PP(args[0]);
  /*@SWIG@*/;
  
  {
    try {
      result = (Xapian::ValueMapPostingSource *)new Xapian::ValueMapPostingSource(arg1);
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  
  SWIG_SetPointerZval(return_value, (void *)result, SWIGTYPE_p_Xapian__ValueMapPostingSource, 1);
  
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_ValueMapPostingSource_add_mapping) {
  Xapian::ValueMapPostingSource *arg1 = (Xapian::ValueMapPostingSource *) 0 ;
  std::string *arg2 = 0 ;
  double arg3 ;
  std::string temp2 ;
  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_Xapian__ValueMapPostingSource, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of ValueMapPostingSource_add_mapping. Expected SWIGTYPE_p_Xapian__ValueMapPostingSource");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  
  convert_to_string_ex(args[1]);
  temp2.assign(Z_STRVAL_PP(args[1]), Z_STRLEN_PP(args[1]));
  arg2 = &temp2;
  
  
  /*@SWIG:/data/home/olly/tmp/xapian-svn-snapshot/tags/1.2.8/xapian/swig/Lib/php/utils.i,52,CONVERT_FLOAT_IN@*/
  convert_to_double_ex(args[2]);
  arg3 = (double) Z_DVAL_PP(args[2]);
  /*@SWIG@*/;
  
  {
    try {
      (arg1)->add_mapping((std::string const &)*arg2,arg3);
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  
  
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_ValueMapPostingSource_clear_mappings) {
  Xapian::ValueMapPostingSource *arg1 = (Xapian::ValueMapPostingSource *) 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_Xapian__ValueMapPostingSource, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of ValueMapPostingSource_clear_mappings. Expected SWIGTYPE_p_Xapian__ValueMapPostingSource");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    try {
      (arg1)->clear_mappings();
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_ValueMapPostingSource_set_default_weight) {
  Xapian::ValueMapPostingSource *arg1 = (Xapian::ValueMapPostingSource *) 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_Xapian__ValueMapPostingSource, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of ValueMapPostingSource_set_default_weight. Expected SWIGTYPE_p_Xapian__ValueMapPostingSource");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  
  /*@SWIG:/data/home/olly/tmp/xapian-svn-snapshot/tags/1.2.8/xapian/swig/Lib/php/utils.i,52,CONVERT_FLOAT_IN@*/
  convert_to_double_ex(args[1]);
  arg2 = (double) Z_DVAL_PP(args[1]);
  /*@SWIG@*/;
  
  {
    try {
      (arg1)->set_default_weight(arg2);
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_ValueMapPostingSource_get_weight) {
  Xapian::ValueMapPostingSource *arg1 = (Xapian::ValueMapPostingSource *) 0 ;
  zval **args[1];
  Xapian::weight 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_Xapian__ValueMapPostingSource, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of ValueMapPostingSource_get_weight. Expected SWIGTYPE_p_Xapian__ValueMapPostingSource");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    try {
      result = (Xapian::weight)((Xapian::ValueMapPostingSource const *)arg1)->get_weight();
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  {
    ZVAL_DOUBLE(return_value,result);
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_ValueMapPostingSource_name) {
  Xapian::ValueMapPostingSource *arg1 = (Xapian::ValueMapPostingSource *) 0 ;
  zval **args[1];
  std::string 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_Xapian__ValueMapPostingSource, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of ValueMapPostingSource_name. Expected SWIGTYPE_p_Xapian__ValueMapPostingSource");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    try {
      result = ((Xapian::ValueMapPostingSource const *)arg1)->name();
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  
  ZVAL_STRINGL(return_value, const_cast<char*>((&result)->data()), (&result)->size(), 1);
  
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_ValueMapPostingSource_init) {
  Xapian::ValueMapPostingSource *arg1 = (Xapian::ValueMapPostingSource *) 0 ;
  Xapian::Database *arg2 = 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_Xapian__ValueMapPostingSource, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of ValueMapPostingSource_init. Expected SWIGTYPE_p_Xapian__ValueMapPostingSource");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    if (SWIG_ConvertPtr(*args[1], (void**)&arg2, SWIGTYPE_p_Xapian__Database, 0) < 0 || arg2 == NULL) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 2 of ValueMapPostingSource_init. Expected SWIGTYPE_p_Xapian__Database");
    }
  }
  {
    try {
      (arg1)->init((Xapian::Database const &)*arg2);
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_ValueMapPostingSource_get_description) {
  Xapian::ValueMapPostingSource *arg1 = (Xapian::ValueMapPostingSource *) 0 ;
  zval **args[1];
  std::string 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_Xapian__ValueMapPostingSource, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of ValueMapPostingSource_get_description. Expected SWIGTYPE_p_Xapian__ValueMapPostingSource");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    try {
      result = ((Xapian::ValueMapPostingSource const *)arg1)->get_description();
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  
  ZVAL_STRINGL(return_value, const_cast<char*>((&result)->data()), (&result)->size(), 1);
  
  return;
fail:
  zend_error(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_ValueMapPostingSource(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 ;
  Xapian::ValueMapPostingSource *arg1 = (Xapian::ValueMapPostingSource *) 0 ;
  
  efree(value);
  if (! newobject) return; /* can't delete it! */
  arg1 = (Xapian::ValueMapPostingSource *)SWIG_ZTS_ConvertResourceData(ptr,type_name,SWIGTYPE_p_Xapian__ValueMapPostingSource TSRMLS_CC);
  if (! arg1) zend_error(E_ERROR, "Xapian::ValueMapPostingSource resource already free'd");
  {
    try {
      delete arg1;
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_new_FixedWeightPostingSource) {
  Xapian::weight arg1 ;
  zval **args[1];
  Xapian::FixedWeightPostingSource *result = 0 ;
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 1 || zend_get_parameters_array_ex(1, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  
  /*@SWIG:/data/home/olly/tmp/xapian-svn-snapshot/tags/1.2.8/xapian/swig/Lib/php/utils.i,52,CONVERT_FLOAT_IN@*/
  convert_to_double_ex(args[0]);
  arg1 = (Xapian::weight) Z_DVAL_PP(args[0]);
  /*@SWIG@*/;
  
  {
    try {
      result = (Xapian::FixedWeightPostingSource *)new Xapian::FixedWeightPostingSource(arg1);
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  
  SWIG_SetPointerZval(return_value, (void *)result, SWIGTYPE_p_Xapian__FixedWeightPostingSource, 1);
  
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_FixedWeightPostingSource_get_termfreq_min) {
  Xapian::FixedWeightPostingSource *arg1 = (Xapian::FixedWeightPostingSource *) 0 ;
  zval **args[1];
  Xapian::doccount 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_Xapian__FixedWeightPostingSource, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of FixedWeightPostingSource_get_termfreq_min. Expected SWIGTYPE_p_Xapian__FixedWeightPostingSource");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    try {
      result = (Xapian::doccount)((Xapian::FixedWeightPostingSource const *)arg1)->get_termfreq_min();
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  {
    ZVAL_LONG(return_value,result);
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_FixedWeightPostingSource_get_termfreq_est) {
  Xapian::FixedWeightPostingSource *arg1 = (Xapian::FixedWeightPostingSource *) 0 ;
  zval **args[1];
  Xapian::doccount 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_Xapian__FixedWeightPostingSource, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of FixedWeightPostingSource_get_termfreq_est. Expected SWIGTYPE_p_Xapian__FixedWeightPostingSource");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    try {
      result = (Xapian::doccount)((Xapian::FixedWeightPostingSource const *)arg1)->get_termfreq_est();
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  {
    ZVAL_LONG(return_value,result);
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_FixedWeightPostingSource_get_termfreq_max) {
  Xapian::FixedWeightPostingSource *arg1 = (Xapian::FixedWeightPostingSource *) 0 ;
  zval **args[1];
  Xapian::doccount 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_Xapian__FixedWeightPostingSource, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of FixedWeightPostingSource_get_termfreq_max. Expected SWIGTYPE_p_Xapian__FixedWeightPostingSource");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    try {
      result = (Xapian::doccount)((Xapian::FixedWeightPostingSource const *)arg1)->get_termfreq_max();
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  {
    ZVAL_LONG(return_value,result);
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_FixedWeightPostingSource_get_weight) {
  Xapian::FixedWeightPostingSource *arg1 = (Xapian::FixedWeightPostingSource *) 0 ;
  zval **args[1];
  Xapian::weight 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_Xapian__FixedWeightPostingSource, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of FixedWeightPostingSource_get_weight. Expected SWIGTYPE_p_Xapian__FixedWeightPostingSource");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    try {
      result = (Xapian::weight)((Xapian::FixedWeightPostingSource const *)arg1)->get_weight();
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  {
    ZVAL_DOUBLE(return_value,result);
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_FixedWeightPostingSource_next) {
  Xapian::FixedWeightPostingSource *arg1 = (Xapian::FixedWeightPostingSource *) 0 ;
  Xapian::weight 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_Xapian__FixedWeightPostingSource, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of FixedWeightPostingSource_next. Expected SWIGTYPE_p_Xapian__FixedWeightPostingSource");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  
  /*@SWIG:/data/home/olly/tmp/xapian-svn-snapshot/tags/1.2.8/xapian/swig/Lib/php/utils.i,52,CONVERT_FLOAT_IN@*/
  convert_to_double_ex(args[1]);
  arg2 = (Xapian::weight) Z_DVAL_PP(args[1]);
  /*@SWIG@*/;
  
  {
    try {
      (arg1)->next(arg2);
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_FixedWeightPostingSource_skip_to) {
  Xapian::FixedWeightPostingSource *arg1 = (Xapian::FixedWeightPostingSource *) 0 ;
  Xapian::docid arg2 ;
  Xapian::weight arg3 ;
  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_Xapian__FixedWeightPostingSource, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of FixedWeightPostingSource_skip_to. Expected SWIGTYPE_p_Xapian__FixedWeightPostingSource");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  
  /*@SWIG:/data/home/olly/tmp/xapian-svn-snapshot/tags/1.2.8/xapian/swig/Lib/php/utils.i,7,CONVERT_INT_IN@*/
  convert_to_long_ex(args[1]);
  arg2 = (Xapian::docid) Z_LVAL_PP(args[1]);
  /*@SWIG@*/;
  
  
  /*@SWIG:/data/home/olly/tmp/xapian-svn-snapshot/tags/1.2.8/xapian/swig/Lib/php/utils.i,52,CONVERT_FLOAT_IN@*/
  convert_to_double_ex(args[2]);
  arg3 = (Xapian::weight) Z_DVAL_PP(args[2]);
  /*@SWIG@*/;
  
  {
    try {
      (arg1)->skip_to(arg2,arg3);
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_FixedWeightPostingSource_check) {
  Xapian::FixedWeightPostingSource *arg1 = (Xapian::FixedWeightPostingSource *) 0 ;
  Xapian::docid arg2 ;
  Xapian::weight arg3 ;
  zval **args[3];
  bool 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_Xapian__FixedWeightPostingSource, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of FixedWeightPostingSource_check. Expected SWIGTYPE_p_Xapian__FixedWeightPostingSource");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  
  /*@SWIG:/data/home/olly/tmp/xapian-svn-snapshot/tags/1.2.8/xapian/swig/Lib/php/utils.i,7,CONVERT_INT_IN@*/
  convert_to_long_ex(args[1]);
  arg2 = (Xapian::docid) Z_LVAL_PP(args[1]);
  /*@SWIG@*/;
  
  
  /*@SWIG:/data/home/olly/tmp/xapian-svn-snapshot/tags/1.2.8/xapian/swig/Lib/php/utils.i,52,CONVERT_FLOAT_IN@*/
  convert_to_double_ex(args[2]);
  arg3 = (Xapian::weight) Z_DVAL_PP(args[2]);
  /*@SWIG@*/;
  
  {
    try {
      result = (bool)(arg1)->check(arg2,arg3);
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  {
    ZVAL_BOOL(return_value,(result)?1:0);
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_FixedWeightPostingSource_at_end) {
  Xapian::FixedWeightPostingSource *arg1 = (Xapian::FixedWeightPostingSource *) 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_Xapian__FixedWeightPostingSource, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of FixedWeightPostingSource_at_end. Expected SWIGTYPE_p_Xapian__FixedWeightPostingSource");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    try {
      result = (bool)((Xapian::FixedWeightPostingSource const *)arg1)->at_end();
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  {
    ZVAL_BOOL(return_value,(result)?1:0);
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_FixedWeightPostingSource_get_docid) {
  Xapian::FixedWeightPostingSource *arg1 = (Xapian::FixedWeightPostingSource *) 0 ;
  zval **args[1];
  Xapian::docid 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_Xapian__FixedWeightPostingSource, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of FixedWeightPostingSource_get_docid. Expected SWIGTYPE_p_Xapian__FixedWeightPostingSource");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    try {
      result = (Xapian::docid)((Xapian::FixedWeightPostingSource const *)arg1)->get_docid();
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  {
    ZVAL_LONG(return_value,result);
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_FixedWeightPostingSource_name) {
  Xapian::FixedWeightPostingSource *arg1 = (Xapian::FixedWeightPostingSource *) 0 ;
  zval **args[1];
  std::string 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_Xapian__FixedWeightPostingSource, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of FixedWeightPostingSource_name. Expected SWIGTYPE_p_Xapian__FixedWeightPostingSource");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    try {
      result = ((Xapian::FixedWeightPostingSource const *)arg1)->name();
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  
  ZVAL_STRINGL(return_value, const_cast<char*>((&result)->data()), (&result)->size(), 1);
  
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_FixedWeightPostingSource_init) {
  Xapian::FixedWeightPostingSource *arg1 = (Xapian::FixedWeightPostingSource *) 0 ;
  Xapian::Database *arg2 = 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_Xapian__FixedWeightPostingSource, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of FixedWeightPostingSource_init. Expected SWIGTYPE_p_Xapian__FixedWeightPostingSource");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    if (SWIG_ConvertPtr(*args[1], (void**)&arg2, SWIGTYPE_p_Xapian__Database, 0) < 0 || arg2 == NULL) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 2 of FixedWeightPostingSource_init. Expected SWIGTYPE_p_Xapian__Database");
    }
  }
  {
    try {
      (arg1)->init((Xapian::Database const &)*arg2);
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_FixedWeightPostingSource_get_description) {
  Xapian::FixedWeightPostingSource *arg1 = (Xapian::FixedWeightPostingSource *) 0 ;
  zval **args[1];
  std::string 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_Xapian__FixedWeightPostingSource, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of FixedWeightPostingSource_get_description. Expected SWIGTYPE_p_Xapian__FixedWeightPostingSource");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    try {
      result = ((Xapian::FixedWeightPostingSource const *)arg1)->get_description();
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  
  ZVAL_STRINGL(return_value, const_cast<char*>((&result)->data()), (&result)->size(), 1);
  
  return;
fail:
  zend_error(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_FixedWeightPostingSource(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 ;
  Xapian::FixedWeightPostingSource *arg1 = (Xapian::FixedWeightPostingSource *) 0 ;
  
  efree(value);
  if (! newobject) return; /* can't delete it! */
  arg1 = (Xapian::FixedWeightPostingSource *)SWIG_ZTS_ConvertResourceData(ptr,type_name,SWIGTYPE_p_Xapian__FixedWeightPostingSource TSRMLS_CC);
  if (! arg1) zend_error(E_ERROR, "Xapian::FixedWeightPostingSource resource already free'd");
  {
    try {
      delete arg1;
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_new_MSet__SWIG_0) {
  Xapian::MSet *result = 0 ;
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 0) {
    WRONG_PARAM_COUNT;
  }
  
  {
    try {
      result = (Xapian::MSet *)new Xapian::MSet();
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  
  SWIG_SetPointerZval(return_value, (void *)result, SWIGTYPE_p_Xapian__MSet, 1);
  
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_new_MSet__SWIG_1) {
  Xapian::MSet *arg1 = 0 ;
  zval **args[1];
  Xapian::MSet *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_Xapian__MSet, 0) < 0 || arg1 == NULL) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of new_MSet. Expected SWIGTYPE_p_Xapian__MSet");
    }
  }
  {
    try {
      result = (Xapian::MSet *)new Xapian::MSet((Xapian::MSet const &)*arg1);
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  
  SWIG_SetPointerZval(return_value, (void *)result, SWIGTYPE_p_Xapian__MSet, 1);
  
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_new_MSet) {
  int argc;
  zval **argv[1];
  
  argc = ZEND_NUM_ARGS();
  zend_get_parameters_array_ex(argc,argv);
  if (argc == 0) {
    _wrap_new_MSet__SWIG_0(INTERNAL_FUNCTION_PARAM_PASSTHRU); return;
  }
  if (argc == 1) {
    int _v;
    {
      void *ptr;
      _v = (SWIG_ConvertPtr(*argv[0], (void **)&ptr, SWIGTYPE_p_Xapian__MSet, 0) == 0);
    }
    if (_v) {
      _wrap_new_MSet__SWIG_1(INTERNAL_FUNCTION_PARAM_PASSTHRU); return;
    }
  }
  
  SWIG_ErrorCode() = E_ERROR;
  SWIG_ErrorMsg() = "No matching function for overloaded 'new_MSet'";
  zend_error(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_MSet(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 ;
  Xapian::MSet *arg1 = (Xapian::MSet *) 0 ;
  
  efree(value);
  if (! newobject) return; /* can't delete it! */
  arg1 = (Xapian::MSet *)SWIG_ZTS_ConvertResourceData(ptr,type_name,SWIGTYPE_p_Xapian__MSet TSRMLS_CC);
  if (! arg1) zend_error(E_ERROR, "Xapian::MSet resource already free'd");
  {
    try {
      delete arg1;
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_MSet_fetch__SWIG_0) {
  Xapian::MSet *arg1 = (Xapian::MSet *) 0 ;
  Xapian::MSetIterator *arg2 = 0 ;
  Xapian::MSetIterator *arg3 = 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_Xapian__MSet, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of MSet_fetch. Expected SWIGTYPE_p_Xapian__MSet");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    if (SWIG_ConvertPtr(*args[1], (void**)&arg2, SWIGTYPE_p_Xapian__MSetIterator, 0) < 0 || arg2 == NULL) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 2 of MSet_fetch. Expected SWIGTYPE_p_Xapian__MSetIterator");
    }
  }
  {
    if (SWIG_ConvertPtr(*args[2], (void**)&arg3, SWIGTYPE_p_Xapian__MSetIterator, 0) < 0 || arg3 == NULL) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 3 of MSet_fetch. Expected SWIGTYPE_p_Xapian__MSetIterator");
    }
  }
  {
    try {
      ((Xapian::MSet const *)arg1)->fetch(*arg2,*arg3);
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_MSet_fetch__SWIG_1) {
  Xapian::MSet *arg1 = (Xapian::MSet *) 0 ;
  Xapian::MSetIterator *arg2 = 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_Xapian__MSet, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of MSet_fetch. Expected SWIGTYPE_p_Xapian__MSet");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    if (SWIG_ConvertPtr(*args[1], (void**)&arg2, SWIGTYPE_p_Xapian__MSetIterator, 0) < 0 || arg2 == NULL) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 2 of MSet_fetch. Expected SWIGTYPE_p_Xapian__MSetIterator");
    }
  }
  {
    try {
      ((Xapian::MSet const *)arg1)->fetch(*arg2);
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_MSet_fetch__SWIG_2) {
  Xapian::MSet *arg1 = (Xapian::MSet *) 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_Xapian__MSet, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of MSet_fetch. Expected SWIGTYPE_p_Xapian__MSet");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    try {
      ((Xapian::MSet const *)arg1)->fetch();
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_MSet_fetch) {
  int argc;
  zval **argv[3];
  
  argc = ZEND_NUM_ARGS();
  zend_get_parameters_array_ex(argc,argv);
  if (argc == 1) {
    int _v;
    {
      void *tmp;
      _v = (SWIG_ConvertPtr(*argv[0], (void**)&tmp, SWIGTYPE_p_Xapian__MSet, 0) >= 0);
    }
    if (_v) {
      _wrap_MSet_fetch__SWIG_2(INTERNAL_FUNCTION_PARAM_PASSTHRU); return;
    }
  }
  if (argc == 2) {
    int _v;
    {
      void *tmp;
      _v = (SWIG_ConvertPtr(*argv[0], (void**)&tmp, SWIGTYPE_p_Xapian__MSet, 0) >= 0);
    }
    if (_v) {
      {
        void *tmp;
        _v = (SWIG_ConvertPtr(*argv[1], (void**)&tmp, SWIGTYPE_p_Xapian__MSetIterator, 0) >= 0);
      }
      if (_v) {
        _wrap_MSet_fetch__SWIG_1(INTERNAL_FUNCTION_PARAM_PASSTHRU); return;
      }
    }
  }
  if (argc == 3) {
    int _v;
    {
      void *tmp;
      _v = (SWIG_ConvertPtr(*argv[0], (void**)&tmp, SWIGTYPE_p_Xapian__MSet, 0) >= 0);
    }
    if (_v) {
      {
        void *tmp;
        _v = (SWIG_ConvertPtr(*argv[1], (void**)&tmp, SWIGTYPE_p_Xapian__MSetIterator, 0) >= 0);
      }
      if (_v) {
        {
          void *tmp;
          _v = (SWIG_ConvertPtr(*argv[2], (void**)&tmp, SWIGTYPE_p_Xapian__MSetIterator, 0) >= 0);
        }
        if (_v) {
          _wrap_MSet_fetch__SWIG_0(INTERNAL_FUNCTION_PARAM_PASSTHRU); return;
        }
      }
    }
  }
  
  SWIG_ErrorCode() = E_ERROR;
  SWIG_ErrorMsg() = "No matching function for overloaded 'MSet_fetch'";
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_MSet_convert_to_percent__SWIG_0) {
  Xapian::MSet *arg1 = (Xapian::MSet *) 0 ;
  Xapian::weight arg2 ;
  zval **args[2];
  Xapian::percent 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_Xapian__MSet, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of MSet_convert_to_percent. Expected SWIGTYPE_p_Xapian__MSet");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  
  /*@SWIG:/data/home/olly/tmp/xapian-svn-snapshot/tags/1.2.8/xapian/swig/Lib/php/utils.i,52,CONVERT_FLOAT_IN@*/
  convert_to_double_ex(args[1]);
  arg2 = (Xapian::weight) Z_DVAL_PP(args[1]);
  /*@SWIG@*/;
  
  {
    try {
      result = (Xapian::percent)((Xapian::MSet const *)arg1)->convert_to_percent(arg2);
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  {
    ZVAL_LONG(return_value,result);
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_MSet_convert_to_percent__SWIG_1) {
  Xapian::MSet *arg1 = (Xapian::MSet *) 0 ;
  Xapian::MSetIterator *arg2 = 0 ;
  zval **args[2];
  Xapian::percent 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_Xapian__MSet, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of MSet_convert_to_percent. Expected SWIGTYPE_p_Xapian__MSet");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    if (SWIG_ConvertPtr(*args[1], (void**)&arg2, SWIGTYPE_p_Xapian__MSetIterator, 0) < 0 || arg2 == NULL) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 2 of MSet_convert_to_percent. Expected SWIGTYPE_p_Xapian__MSetIterator");
    }
  }
  {
    try {
      result = (Xapian::percent)((Xapian::MSet const *)arg1)->convert_to_percent((Xapian::MSetIterator const &)*arg2);
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  {
    ZVAL_LONG(return_value,result);
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_MSet_convert_to_percent) {
  int argc;
  zval **argv[2];
  
  argc = ZEND_NUM_ARGS();
  zend_get_parameters_array_ex(argc,argv);
  if (argc == 2) {
    int _v;
    {
      void *tmp;
      _v = (SWIG_ConvertPtr(*argv[0], (void**)&tmp, SWIGTYPE_p_Xapian__MSet, 0) >= 0);
    }
    if (_v) {
      {
        void *ptr;
        _v = (SWIG_ConvertPtr(*argv[1], (void **)&ptr, SWIGTYPE_p_Xapian__MSetIterator, 0) == 0);
      }
      if (_v) {
        _wrap_MSet_convert_to_percent__SWIG_1(INTERNAL_FUNCTION_PARAM_PASSTHRU); return;
      }
    }
  }
  if (argc == 2) {
    int _v;
    {
      void *tmp;
      _v = (SWIG_ConvertPtr(*argv[0], (void**)&tmp, SWIGTYPE_p_Xapian__MSet, 0) >= 0);
    }
    if (_v) {
      _v = (Z_TYPE_PP(argv[1]) == IS_DOUBLE); 
      if (_v) {
        _wrap_MSet_convert_to_percent__SWIG_0(INTERNAL_FUNCTION_PARAM_PASSTHRU); return;
      }
    }
  }
  
  SWIG_ErrorCode() = E_ERROR;
  SWIG_ErrorMsg() = "No matching function for overloaded 'MSet_convert_to_percent'";
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_MSet_get_termfreq) {
  Xapian::MSet *arg1 = (Xapian::MSet *) 0 ;
  std::string arg2 ;
  zval **args[2];
  Xapian::doccount 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_Xapian__MSet, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of MSet_get_termfreq. Expected SWIGTYPE_p_Xapian__MSet");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  
  convert_to_string_ex(args[1]);
  (&arg2)->assign(Z_STRVAL_PP(args[1]), Z_STRLEN_PP(args[1]));
  
  {
    try {
      result = (Xapian::doccount)((Xapian::MSet const *)arg1)->get_termfreq(arg2);
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  {
    ZVAL_LONG(return_value,result);
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_MSet_get_termweight) {
  Xapian::MSet *arg1 = (Xapian::MSet *) 0 ;
  std::string arg2 ;
  zval **args[2];
  Xapian::weight 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_Xapian__MSet, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of MSet_get_termweight. Expected SWIGTYPE_p_Xapian__MSet");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  
  convert_to_string_ex(args[1]);
  (&arg2)->assign(Z_STRVAL_PP(args[1]), Z_STRLEN_PP(args[1]));
  
  {
    try {
      result = (Xapian::weight)((Xapian::MSet const *)arg1)->get_termweight(arg2);
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  {
    ZVAL_DOUBLE(return_value,result);
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_MSet_get_firstitem) {
  Xapian::MSet *arg1 = (Xapian::MSet *) 0 ;
  zval **args[1];
  Xapian::doccount 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_Xapian__MSet, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of MSet_get_firstitem. Expected SWIGTYPE_p_Xapian__MSet");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    try {
      result = (Xapian::doccount)((Xapian::MSet const *)arg1)->get_firstitem();
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  {
    ZVAL_LONG(return_value,result);
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_MSet_get_matches_lower_bound) {
  Xapian::MSet *arg1 = (Xapian::MSet *) 0 ;
  zval **args[1];
  Xapian::doccount 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_Xapian__MSet, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of MSet_get_matches_lower_bound. Expected SWIGTYPE_p_Xapian__MSet");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    try {
      result = (Xapian::doccount)((Xapian::MSet const *)arg1)->get_matches_lower_bound();
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  {
    ZVAL_LONG(return_value,result);
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_MSet_get_matches_estimated) {
  Xapian::MSet *arg1 = (Xapian::MSet *) 0 ;
  zval **args[1];
  Xapian::doccount 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_Xapian__MSet, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of MSet_get_matches_estimated. Expected SWIGTYPE_p_Xapian__MSet");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    try {
      result = (Xapian::doccount)((Xapian::MSet const *)arg1)->get_matches_estimated();
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  {
    ZVAL_LONG(return_value,result);
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_MSet_get_matches_upper_bound) {
  Xapian::MSet *arg1 = (Xapian::MSet *) 0 ;
  zval **args[1];
  Xapian::doccount 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_Xapian__MSet, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of MSet_get_matches_upper_bound. Expected SWIGTYPE_p_Xapian__MSet");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    try {
      result = (Xapian::doccount)((Xapian::MSet const *)arg1)->get_matches_upper_bound();
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  {
    ZVAL_LONG(return_value,result);
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_MSet_get_uncollapsed_matches_lower_bound) {
  Xapian::MSet *arg1 = (Xapian::MSet *) 0 ;
  zval **args[1];
  Xapian::doccount 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_Xapian__MSet, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of MSet_get_uncollapsed_matches_lower_bound. Expected SWIGTYPE_p_Xapian__MSet");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    try {
      result = (Xapian::doccount)((Xapian::MSet const *)arg1)->get_uncollapsed_matches_lower_bound();
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  {
    ZVAL_LONG(return_value,result);
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_MSet_get_uncollapsed_matches_estimated) {
  Xapian::MSet *arg1 = (Xapian::MSet *) 0 ;
  zval **args[1];
  Xapian::doccount 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_Xapian__MSet, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of MSet_get_uncollapsed_matches_estimated. Expected SWIGTYPE_p_Xapian__MSet");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    try {
      result = (Xapian::doccount)((Xapian::MSet const *)arg1)->get_uncollapsed_matches_estimated();
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  {
    ZVAL_LONG(return_value,result);
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_MSet_get_uncollapsed_matches_upper_bound) {
  Xapian::MSet *arg1 = (Xapian::MSet *) 0 ;
  zval **args[1];
  Xapian::doccount 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_Xapian__MSet, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of MSet_get_uncollapsed_matches_upper_bound. Expected SWIGTYPE_p_Xapian__MSet");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    try {
      result = (Xapian::doccount)((Xapian::MSet const *)arg1)->get_uncollapsed_matches_upper_bound();
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  {
    ZVAL_LONG(return_value,result);
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_MSet_get_max_possible) {
  Xapian::MSet *arg1 = (Xapian::MSet *) 0 ;
  zval **args[1];
  Xapian::weight 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_Xapian__MSet, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of MSet_get_max_possible. Expected SWIGTYPE_p_Xapian__MSet");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    try {
      result = (Xapian::weight)(arg1)->get_max_possible();
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  {
    ZVAL_DOUBLE(return_value,result);
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_MSet_get_max_attained) {
  Xapian::MSet *arg1 = (Xapian::MSet *) 0 ;
  zval **args[1];
  Xapian::weight 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_Xapian__MSet, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of MSet_get_max_attained. Expected SWIGTYPE_p_Xapian__MSet");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    try {
      result = (Xapian::weight)(arg1)->get_max_attained();
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  {
    ZVAL_DOUBLE(return_value,result);
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_MSet_size) {
  Xapian::MSet *arg1 = (Xapian::MSet *) 0 ;
  zval **args[1];
  Xapian::doccount 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_Xapian__MSet, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of MSet_size. Expected SWIGTYPE_p_Xapian__MSet");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    try {
      result = (Xapian::doccount)((Xapian::MSet const *)arg1)->size();
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  {
    ZVAL_LONG(return_value,result);
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_MSet_is_empty) {
  Xapian::MSet *arg1 = (Xapian::MSet *) 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_Xapian__MSet, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of MSet_is_empty. Expected SWIGTYPE_p_Xapian__MSet");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    try {
      result = (bool)((Xapian::MSet const *)arg1)->empty();
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  {
    ZVAL_BOOL(return_value,(result)?1:0);
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_MSet_begin) {
  Xapian::MSet *arg1 = (Xapian::MSet *) 0 ;
  zval **args[1];
  Xapian::MSetIterator 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_Xapian__MSet, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of MSet_begin. Expected SWIGTYPE_p_Xapian__MSet");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    try {
      result = ((Xapian::MSet const *)arg1)->begin();
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  {
    Xapian::MSetIterator * resultobj = new Xapian::MSetIterator((const Xapian::MSetIterator &) result);
    SWIG_SetPointerZval(return_value, (void *)resultobj, SWIGTYPE_p_Xapian__MSetIterator, 1);
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_MSet_end) {
  Xapian::MSet *arg1 = (Xapian::MSet *) 0 ;
  zval **args[1];
  Xapian::MSetIterator 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_Xapian__MSet, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of MSet_end. Expected SWIGTYPE_p_Xapian__MSet");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    try {
      result = ((Xapian::MSet const *)arg1)->end();
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  {
    Xapian::MSetIterator * resultobj = new Xapian::MSetIterator((const Xapian::MSetIterator &) result);
    SWIG_SetPointerZval(return_value, (void *)resultobj, SWIGTYPE_p_Xapian__MSetIterator, 1);
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_MSet_back) {
  Xapian::MSet *arg1 = (Xapian::MSet *) 0 ;
  zval **args[1];
  Xapian::MSetIterator 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_Xapian__MSet, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of MSet_back. Expected SWIGTYPE_p_Xapian__MSet");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    try {
      result = ((Xapian::MSet const *)arg1)->back();
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  {
    Xapian::MSetIterator * resultobj = new Xapian::MSetIterator((const Xapian::MSetIterator &) result);
    SWIG_SetPointerZval(return_value, (void *)resultobj, SWIGTYPE_p_Xapian__MSetIterator, 1);
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_MSet_get_hit) {
  Xapian::MSet *arg1 = (Xapian::MSet *) 0 ;
  Xapian::doccount arg2 ;
  zval **args[2];
  Xapian::MSetIterator 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_Xapian__MSet, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of MSet_get_hit. Expected SWIGTYPE_p_Xapian__MSet");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  
  /*@SWIG:/data/home/olly/tmp/xapian-svn-snapshot/tags/1.2.8/xapian/swig/Lib/php/utils.i,7,CONVERT_INT_IN@*/
  convert_to_long_ex(args[1]);
  arg2 = (Xapian::doccount) Z_LVAL_PP(args[1]);
  /*@SWIG@*/;
  
  {
    try {
      result = Xapian_MSet_get_hit((Xapian::MSet const *)arg1,arg2);
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  {
    Xapian::MSetIterator * resultobj = new Xapian::MSetIterator((const Xapian::MSetIterator &) result);
    SWIG_SetPointerZval(return_value, (void *)resultobj, SWIGTYPE_p_Xapian__MSetIterator, 1);
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_MSet_get_document_percentage) {
  Xapian::MSet *arg1 = (Xapian::MSet *) 0 ;
  Xapian::doccount 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_Xapian__MSet, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of MSet_get_document_percentage. Expected SWIGTYPE_p_Xapian__MSet");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  
  /*@SWIG:/data/home/olly/tmp/xapian-svn-snapshot/tags/1.2.8/xapian/swig/Lib/php/utils.i,7,CONVERT_INT_IN@*/
  convert_to_long_ex(args[1]);
  arg2 = (Xapian::doccount) Z_LVAL_PP(args[1]);
  /*@SWIG@*/;
  
  {
    try {
      result = (int)Xapian_MSet_get_document_percentage((Xapian::MSet const *)arg1,arg2);
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  {
    ZVAL_LONG(return_value,result);
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_MSet_get_document) {
  Xapian::MSet *arg1 = (Xapian::MSet *) 0 ;
  Xapian::doccount arg2 ;
  zval **args[2];
  Xapian::Document 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_Xapian__MSet, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of MSet_get_document. Expected SWIGTYPE_p_Xapian__MSet");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  
  /*@SWIG:/data/home/olly/tmp/xapian-svn-snapshot/tags/1.2.8/xapian/swig/Lib/php/utils.i,7,CONVERT_INT_IN@*/
  convert_to_long_ex(args[1]);
  arg2 = (Xapian::doccount) Z_LVAL_PP(args[1]);
  /*@SWIG@*/;
  
  {
    try {
      result = Xapian_MSet_get_document((Xapian::MSet const *)arg1,arg2);
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  {
    Xapian::Document * resultobj = new Xapian::Document((const Xapian::Document &) result);
    SWIG_SetPointerZval(return_value, (void *)resultobj, SWIGTYPE_p_Xapian__Document, 1);
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_MSet_get_docid) {
  Xapian::MSet *arg1 = (Xapian::MSet *) 0 ;
  Xapian::doccount arg2 ;
  zval **args[2];
  Xapian::docid 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_Xapian__MSet, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of MSet_get_docid. Expected SWIGTYPE_p_Xapian__MSet");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  
  /*@SWIG:/data/home/olly/tmp/xapian-svn-snapshot/tags/1.2.8/xapian/swig/Lib/php/utils.i,7,CONVERT_INT_IN@*/
  convert_to_long_ex(args[1]);
  arg2 = (Xapian::doccount) Z_LVAL_PP(args[1]);
  /*@SWIG@*/;
  
  {
    try {
      result = (Xapian::docid)Xapian_MSet_get_docid((Xapian::MSet const *)arg1,arg2);
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  {
    ZVAL_LONG(return_value,result);
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_MSet_get_description) {
  Xapian::MSet *arg1 = (Xapian::MSet *) 0 ;
  zval **args[1];
  std::string 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_Xapian__MSet, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of MSet_get_description. Expected SWIGTYPE_p_Xapian__MSet");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    try {
      result = ((Xapian::MSet const *)arg1)->get_description();
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  
  ZVAL_STRINGL(return_value, const_cast<char*>((&result)->data()), (&result)->size(), 1);
  
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_new_MSetIterator__SWIG_0) {
  Xapian::MSetIterator *result = 0 ;
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 0) {
    WRONG_PARAM_COUNT;
  }
  
  {
    try {
      result = (Xapian::MSetIterator *)new Xapian::MSetIterator();
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  
  SWIG_SetPointerZval(return_value, (void *)result, SWIGTYPE_p_Xapian__MSetIterator, 1);
  
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_new_MSetIterator__SWIG_1) {
  Xapian::MSetIterator *arg1 = 0 ;
  zval **args[1];
  Xapian::MSetIterator *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_Xapian__MSetIterator, 0) < 0 || arg1 == NULL) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of new_MSetIterator. Expected SWIGTYPE_p_Xapian__MSetIterator");
    }
  }
  {
    try {
      result = (Xapian::MSetIterator *)new Xapian::MSetIterator((Xapian::MSetIterator const &)*arg1);
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  
  SWIG_SetPointerZval(return_value, (void *)result, SWIGTYPE_p_Xapian__MSetIterator, 1);
  
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_new_MSetIterator) {
  int argc;
  zval **argv[1];
  
  argc = ZEND_NUM_ARGS();
  zend_get_parameters_array_ex(argc,argv);
  if (argc == 0) {
    _wrap_new_MSetIterator__SWIG_0(INTERNAL_FUNCTION_PARAM_PASSTHRU); return;
  }
  if (argc == 1) {
    int _v;
    {
      void *ptr;
      _v = (SWIG_ConvertPtr(*argv[0], (void **)&ptr, SWIGTYPE_p_Xapian__MSetIterator, 0) == 0);
    }
    if (_v) {
      _wrap_new_MSetIterator__SWIG_1(INTERNAL_FUNCTION_PARAM_PASSTHRU); return;
    }
  }
  
  SWIG_ErrorCode() = E_ERROR;
  SWIG_ErrorMsg() = "No matching function for overloaded 'new_MSetIterator'";
  zend_error(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_MSetIterator(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 ;
  Xapian::MSetIterator *arg1 = (Xapian::MSetIterator *) 0 ;
  
  efree(value);
  if (! newobject) return; /* can't delete it! */
  arg1 = (Xapian::MSetIterator *)SWIG_ZTS_ConvertResourceData(ptr,type_name,SWIGTYPE_p_Xapian__MSetIterator TSRMLS_CC);
  if (! arg1) zend_error(E_ERROR, "Xapian::MSetIterator resource already free'd");
  {
    try {
      delete arg1;
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_MSetIterator_get_docid) {
  Xapian::MSetIterator *arg1 = (Xapian::MSetIterator *) 0 ;
  zval **args[1];
  Xapian::docid 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_Xapian__MSetIterator, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of MSetIterator_get_docid. Expected SWIGTYPE_p_Xapian__MSetIterator");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    try {
      result = (Xapian::docid)Xapian_MSetIterator_get_docid((Xapian::MSetIterator const *)arg1);
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  {
    ZVAL_LONG(return_value,result);
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_MSetIterator_next) {
  Xapian::MSetIterator *arg1 = (Xapian::MSetIterator *) 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_Xapian__MSetIterator, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of MSetIterator_next. Expected SWIGTYPE_p_Xapian__MSetIterator");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    try {
      Xapian_MSetIterator_next(arg1);
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_MSetIterator_prev) {
  Xapian::MSetIterator *arg1 = (Xapian::MSetIterator *) 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_Xapian__MSetIterator, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of MSetIterator_prev. Expected SWIGTYPE_p_Xapian__MSetIterator");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    try {
      Xapian_MSetIterator_prev(arg1);
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_MSetIterator_equals) {
  Xapian::MSetIterator *arg1 = (Xapian::MSetIterator *) 0 ;
  Xapian::MSetIterator *arg2 = 0 ;
  zval **args[2];
  bool 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_Xapian__MSetIterator, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of MSetIterator_equals. Expected SWIGTYPE_p_Xapian__MSetIterator");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    if (SWIG_ConvertPtr(*args[1], (void**)&arg2, SWIGTYPE_p_Xapian__MSetIterator, 0) < 0 || arg2 == NULL) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 2 of MSetIterator_equals. Expected SWIGTYPE_p_Xapian__MSetIterator");
    }
  }
  {
    try {
      result = (bool)Xapian_MSetIterator_equals((Xapian::MSetIterator const *)arg1,(Xapian::MSetIterator const &)*arg2);
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  {
    ZVAL_BOOL(return_value,(result)?1:0);
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_MSetIterator_get_document) {
  Xapian::MSetIterator *arg1 = (Xapian::MSetIterator *) 0 ;
  zval **args[1];
  Xapian::Document 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_Xapian__MSetIterator, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of MSetIterator_get_document. Expected SWIGTYPE_p_Xapian__MSetIterator");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    try {
      result = ((Xapian::MSetIterator const *)arg1)->get_document();
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  {
    Xapian::Document * resultobj = new Xapian::Document((const Xapian::Document &) result);
    SWIG_SetPointerZval(return_value, (void *)resultobj, SWIGTYPE_p_Xapian__Document, 1);
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_MSetIterator_get_rank) {
  Xapian::MSetIterator *arg1 = (Xapian::MSetIterator *) 0 ;
  zval **args[1];
  Xapian::doccount 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_Xapian__MSetIterator, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of MSetIterator_get_rank. Expected SWIGTYPE_p_Xapian__MSetIterator");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    try {
      result = (Xapian::doccount)((Xapian::MSetIterator const *)arg1)->get_rank();
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  {
    ZVAL_LONG(return_value,result);
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_MSetIterator_get_weight) {
  Xapian::MSetIterator *arg1 = (Xapian::MSetIterator *) 0 ;
  zval **args[1];
  Xapian::weight 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_Xapian__MSetIterator, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of MSetIterator_get_weight. Expected SWIGTYPE_p_Xapian__MSetIterator");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    try {
      result = (Xapian::weight)((Xapian::MSetIterator const *)arg1)->get_weight();
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  {
    ZVAL_DOUBLE(return_value,result);
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_MSetIterator_get_collapse_key) {
  Xapian::MSetIterator *arg1 = (Xapian::MSetIterator *) 0 ;
  zval **args[1];
  std::string 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_Xapian__MSetIterator, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of MSetIterator_get_collapse_key. Expected SWIGTYPE_p_Xapian__MSetIterator");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    try {
      result = ((Xapian::MSetIterator const *)arg1)->get_collapse_key();
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  
  ZVAL_STRINGL(return_value, const_cast<char*>((&result)->data()), (&result)->size(), 1);
  
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_MSetIterator_get_collapse_count) {
  Xapian::MSetIterator *arg1 = (Xapian::MSetIterator *) 0 ;
  zval **args[1];
  Xapian::doccount 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_Xapian__MSetIterator, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of MSetIterator_get_collapse_count. Expected SWIGTYPE_p_Xapian__MSetIterator");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    try {
      result = (Xapian::doccount)((Xapian::MSetIterator const *)arg1)->get_collapse_count();
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  {
    ZVAL_LONG(return_value,result);
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_MSetIterator_get_percent) {
  Xapian::MSetIterator *arg1 = (Xapian::MSetIterator *) 0 ;
  zval **args[1];
  Xapian::percent 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_Xapian__MSetIterator, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of MSetIterator_get_percent. Expected SWIGTYPE_p_Xapian__MSetIterator");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    try {
      result = (Xapian::percent)((Xapian::MSetIterator const *)arg1)->get_percent();
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  {
    ZVAL_LONG(return_value,result);
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_MSetIterator_get_description) {
  Xapian::MSetIterator *arg1 = (Xapian::MSetIterator *) 0 ;
  zval **args[1];
  std::string 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_Xapian__MSetIterator, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of MSetIterator_get_description. Expected SWIGTYPE_p_Xapian__MSetIterator");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    try {
      result = ((Xapian::MSetIterator const *)arg1)->get_description();
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  
  ZVAL_STRINGL(return_value, const_cast<char*>((&result)->data()), (&result)->size(), 1);
  
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_new_ESet__SWIG_0) {
  Xapian::ESet *result = 0 ;
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 0) {
    WRONG_PARAM_COUNT;
  }
  
  {
    try {
      result = (Xapian::ESet *)new Xapian::ESet();
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  
  SWIG_SetPointerZval(return_value, (void *)result, SWIGTYPE_p_Xapian__ESet, 1);
  
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_new_ESet__SWIG_1) {
  Xapian::ESet *arg1 = 0 ;
  zval **args[1];
  Xapian::ESet *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_Xapian__ESet, 0) < 0 || arg1 == NULL) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of new_ESet. Expected SWIGTYPE_p_Xapian__ESet");
    }
  }
  {
    try {
      result = (Xapian::ESet *)new Xapian::ESet((Xapian::ESet const &)*arg1);
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  
  SWIG_SetPointerZval(return_value, (void *)result, SWIGTYPE_p_Xapian__ESet, 1);
  
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_new_ESet) {
  int argc;
  zval **argv[1];
  
  argc = ZEND_NUM_ARGS();
  zend_get_parameters_array_ex(argc,argv);
  if (argc == 0) {
    _wrap_new_ESet__SWIG_0(INTERNAL_FUNCTION_PARAM_PASSTHRU); return;
  }
  if (argc == 1) {
    int _v;
    {
      void *ptr;
      _v = (SWIG_ConvertPtr(*argv[0], (void **)&ptr, SWIGTYPE_p_Xapian__ESet, 0) == 0);
    }
    if (_v) {
      _wrap_new_ESet__SWIG_1(INTERNAL_FUNCTION_PARAM_PASSTHRU); return;
    }
  }
  
  SWIG_ErrorCode() = E_ERROR;
  SWIG_ErrorMsg() = "No matching function for overloaded 'new_ESet'";
  zend_error(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_ESet(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 ;
  Xapian::ESet *arg1 = (Xapian::ESet *) 0 ;
  
  efree(value);
  if (! newobject) return; /* can't delete it! */
  arg1 = (Xapian::ESet *)SWIG_ZTS_ConvertResourceData(ptr,type_name,SWIGTYPE_p_Xapian__ESet TSRMLS_CC);
  if (! arg1) zend_error(E_ERROR, "Xapian::ESet resource already free'd");
  {
    try {
      delete arg1;
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_ESet_get_ebound) {
  Xapian::ESet *arg1 = (Xapian::ESet *) 0 ;
  zval **args[1];
  Xapian::termcount 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_Xapian__ESet, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of ESet_get_ebound. Expected SWIGTYPE_p_Xapian__ESet");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    try {
      result = (Xapian::termcount)((Xapian::ESet const *)arg1)->get_ebound();
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  {
    ZVAL_LONG(return_value,result);
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_ESet_size) {
  Xapian::ESet *arg1 = (Xapian::ESet *) 0 ;
  zval **args[1];
  Xapian::termcount 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_Xapian__ESet, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of ESet_size. Expected SWIGTYPE_p_Xapian__ESet");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    try {
      result = (Xapian::termcount)((Xapian::ESet const *)arg1)->size();
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  {
    ZVAL_LONG(return_value,result);
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_ESet_is_empty) {
  Xapian::ESet *arg1 = (Xapian::ESet *) 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_Xapian__ESet, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of ESet_is_empty. Expected SWIGTYPE_p_Xapian__ESet");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    try {
      result = (bool)((Xapian::ESet const *)arg1)->empty();
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  {
    ZVAL_BOOL(return_value,(result)?1:0);
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_ESet_begin) {
  Xapian::ESet *arg1 = (Xapian::ESet *) 0 ;
  zval **args[1];
  Xapian::ESetIterator 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_Xapian__ESet, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of ESet_begin. Expected SWIGTYPE_p_Xapian__ESet");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    try {
      result = ((Xapian::ESet const *)arg1)->begin();
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  {
    Xapian::ESetIterator * resultobj = new Xapian::ESetIterator((const Xapian::ESetIterator &) result);
    SWIG_SetPointerZval(return_value, (void *)resultobj, SWIGTYPE_p_Xapian__ESetIterator, 1);
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_ESet_end) {
  Xapian::ESet *arg1 = (Xapian::ESet *) 0 ;
  zval **args[1];
  Xapian::ESetIterator 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_Xapian__ESet, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of ESet_end. Expected SWIGTYPE_p_Xapian__ESet");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    try {
      result = ((Xapian::ESet const *)arg1)->end();
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  {
    Xapian::ESetIterator * resultobj = new Xapian::ESetIterator((const Xapian::ESetIterator &) result);
    SWIG_SetPointerZval(return_value, (void *)resultobj, SWIGTYPE_p_Xapian__ESetIterator, 1);
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_ESet_back) {
  Xapian::ESet *arg1 = (Xapian::ESet *) 0 ;
  zval **args[1];
  Xapian::ESetIterator 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_Xapian__ESet, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of ESet_back. Expected SWIGTYPE_p_Xapian__ESet");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    try {
      result = ((Xapian::ESet const *)arg1)->back();
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  {
    Xapian::ESetIterator * resultobj = new Xapian::ESetIterator((const Xapian::ESetIterator &) result);
    SWIG_SetPointerZval(return_value, (void *)resultobj, SWIGTYPE_p_Xapian__ESetIterator, 1);
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_ESet_get_description) {
  Xapian::ESet *arg1 = (Xapian::ESet *) 0 ;
  zval **args[1];
  std::string 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_Xapian__ESet, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of ESet_get_description. Expected SWIGTYPE_p_Xapian__ESet");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    try {
      result = ((Xapian::ESet const *)arg1)->get_description();
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  
  ZVAL_STRINGL(return_value, const_cast<char*>((&result)->data()), (&result)->size(), 1);
  
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_new_ESetIterator__SWIG_0) {
  Xapian::ESetIterator *result = 0 ;
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 0) {
    WRONG_PARAM_COUNT;
  }
  
  {
    try {
      result = (Xapian::ESetIterator *)new Xapian::ESetIterator();
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  
  SWIG_SetPointerZval(return_value, (void *)result, SWIGTYPE_p_Xapian__ESetIterator, 1);
  
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_new_ESetIterator__SWIG_1) {
  Xapian::ESetIterator *arg1 = 0 ;
  zval **args[1];
  Xapian::ESetIterator *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_Xapian__ESetIterator, 0) < 0 || arg1 == NULL) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of new_ESetIterator. Expected SWIGTYPE_p_Xapian__ESetIterator");
    }
  }
  {
    try {
      result = (Xapian::ESetIterator *)new Xapian::ESetIterator((Xapian::ESetIterator const &)*arg1);
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  
  SWIG_SetPointerZval(return_value, (void *)result, SWIGTYPE_p_Xapian__ESetIterator, 1);
  
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_new_ESetIterator) {
  int argc;
  zval **argv[1];
  
  argc = ZEND_NUM_ARGS();
  zend_get_parameters_array_ex(argc,argv);
  if (argc == 0) {
    _wrap_new_ESetIterator__SWIG_0(INTERNAL_FUNCTION_PARAM_PASSTHRU); return;
  }
  if (argc == 1) {
    int _v;
    {
      void *ptr;
      _v = (SWIG_ConvertPtr(*argv[0], (void **)&ptr, SWIGTYPE_p_Xapian__ESetIterator, 0) == 0);
    }
    if (_v) {
      _wrap_new_ESetIterator__SWIG_1(INTERNAL_FUNCTION_PARAM_PASSTHRU); return;
    }
  }
  
  SWIG_ErrorCode() = E_ERROR;
  SWIG_ErrorMsg() = "No matching function for overloaded 'new_ESetIterator'";
  zend_error(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_ESetIterator(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 ;
  Xapian::ESetIterator *arg1 = (Xapian::ESetIterator *) 0 ;
  
  efree(value);
  if (! newobject) return; /* can't delete it! */
  arg1 = (Xapian::ESetIterator *)SWIG_ZTS_ConvertResourceData(ptr,type_name,SWIGTYPE_p_Xapian__ESetIterator TSRMLS_CC);
  if (! arg1) zend_error(E_ERROR, "Xapian::ESetIterator resource already free'd");
  {
    try {
      delete arg1;
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_ESetIterator_get_term) {
  Xapian::ESetIterator *arg1 = (Xapian::ESetIterator *) 0 ;
  zval **args[1];
  std::string 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_Xapian__ESetIterator, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of ESetIterator_get_term. Expected SWIGTYPE_p_Xapian__ESetIterator");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    try {
      result = Xapian_ESetIterator_get_term((Xapian::ESetIterator const *)arg1);
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  
  ZVAL_STRINGL(return_value, const_cast<char*>((&result)->data()), (&result)->size(), 1);
  
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_ESetIterator_next) {
  Xapian::ESetIterator *arg1 = (Xapian::ESetIterator *) 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_Xapian__ESetIterator, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of ESetIterator_next. Expected SWIGTYPE_p_Xapian__ESetIterator");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    try {
      Xapian_ESetIterator_next(arg1);
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_ESetIterator_prev) {
  Xapian::ESetIterator *arg1 = (Xapian::ESetIterator *) 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_Xapian__ESetIterator, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of ESetIterator_prev. Expected SWIGTYPE_p_Xapian__ESetIterator");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    try {
      Xapian_ESetIterator_prev(arg1);
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_ESetIterator_equals) {
  Xapian::ESetIterator *arg1 = (Xapian::ESetIterator *) 0 ;
  Xapian::ESetIterator *arg2 = 0 ;
  zval **args[2];
  bool 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_Xapian__ESetIterator, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of ESetIterator_equals. Expected SWIGTYPE_p_Xapian__ESetIterator");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    if (SWIG_ConvertPtr(*args[1], (void**)&arg2, SWIGTYPE_p_Xapian__ESetIterator, 0) < 0 || arg2 == NULL) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 2 of ESetIterator_equals. Expected SWIGTYPE_p_Xapian__ESetIterator");
    }
  }
  {
    try {
      result = (bool)Xapian_ESetIterator_equals((Xapian::ESetIterator const *)arg1,(Xapian::ESetIterator const &)*arg2);
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  {
    ZVAL_BOOL(return_value,(result)?1:0);
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_ESetIterator_get_weight) {
  Xapian::ESetIterator *arg1 = (Xapian::ESetIterator *) 0 ;
  zval **args[1];
  Xapian::weight 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_Xapian__ESetIterator, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of ESetIterator_get_weight. Expected SWIGTYPE_p_Xapian__ESetIterator");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    try {
      result = (Xapian::weight)((Xapian::ESetIterator const *)arg1)->get_weight();
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  {
    ZVAL_DOUBLE(return_value,result);
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_ESetIterator_get_description) {
  Xapian::ESetIterator *arg1 = (Xapian::ESetIterator *) 0 ;
  zval **args[1];
  std::string 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_Xapian__ESetIterator, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of ESetIterator_get_description. Expected SWIGTYPE_p_Xapian__ESetIterator");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    try {
      result = ((Xapian::ESetIterator const *)arg1)->get_description();
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  
  ZVAL_STRINGL(return_value, const_cast<char*>((&result)->data()), (&result)->size(), 1);
  
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_new_RSet__SWIG_0) {
  Xapian::RSet *arg1 = 0 ;
  zval **args[1];
  Xapian::RSet *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_Xapian__RSet, 0) < 0 || arg1 == NULL) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of new_RSet. Expected SWIGTYPE_p_Xapian__RSet");
    }
  }
  {
    try {
      result = (Xapian::RSet *)new Xapian::RSet((Xapian::RSet const &)*arg1);
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  
  SWIG_SetPointerZval(return_value, (void *)result, SWIGTYPE_p_Xapian__RSet, 1);
  
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_new_RSet__SWIG_1) {
  Xapian::RSet *result = 0 ;
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 0) {
    WRONG_PARAM_COUNT;
  }
  
  {
    try {
      result = (Xapian::RSet *)new Xapian::RSet();
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  
  SWIG_SetPointerZval(return_value, (void *)result, SWIGTYPE_p_Xapian__RSet, 1);
  
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_new_RSet) {
  int argc;
  zval **argv[1];
  
  argc = ZEND_NUM_ARGS();
  zend_get_parameters_array_ex(argc,argv);
  if (argc == 0) {
    _wrap_new_RSet__SWIG_1(INTERNAL_FUNCTION_PARAM_PASSTHRU); return;
  }
  if (argc == 1) {
    int _v;
    {
      void *ptr;
      _v = (SWIG_ConvertPtr(*argv[0], (void **)&ptr, SWIGTYPE_p_Xapian__RSet, 0) == 0);
    }
    if (_v) {
      _wrap_new_RSet__SWIG_0(INTERNAL_FUNCTION_PARAM_PASSTHRU); return;
    }
  }
  
  SWIG_ErrorCode() = E_ERROR;
  SWIG_ErrorMsg() = "No matching function for overloaded 'new_RSet'";
  zend_error(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_RSet(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 ;
  Xapian::RSet *arg1 = (Xapian::RSet *) 0 ;
  
  efree(value);
  if (! newobject) return; /* can't delete it! */
  arg1 = (Xapian::RSet *)SWIG_ZTS_ConvertResourceData(ptr,type_name,SWIGTYPE_p_Xapian__RSet TSRMLS_CC);
  if (! arg1) zend_error(E_ERROR, "Xapian::RSet resource already free'd");
  {
    try {
      delete arg1;
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_RSet_size) {
  Xapian::RSet *arg1 = (Xapian::RSet *) 0 ;
  zval **args[1];
  Xapian::doccount 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_Xapian__RSet, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of RSet_size. Expected SWIGTYPE_p_Xapian__RSet");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    try {
      result = (Xapian::doccount)((Xapian::RSet const *)arg1)->size();
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  {
    ZVAL_LONG(return_value,result);
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_RSet_is_empty) {
  Xapian::RSet *arg1 = (Xapian::RSet *) 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_Xapian__RSet, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of RSet_is_empty. Expected SWIGTYPE_p_Xapian__RSet");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    try {
      result = (bool)((Xapian::RSet const *)arg1)->empty();
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  {
    ZVAL_BOOL(return_value,(result)?1:0);
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_RSet_add_document__SWIG_0) {
  Xapian::RSet *arg1 = (Xapian::RSet *) 0 ;
  Xapian::docid 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_Xapian__RSet, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of RSet_add_document. Expected SWIGTYPE_p_Xapian__RSet");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  
  /*@SWIG:/data/home/olly/tmp/xapian-svn-snapshot/tags/1.2.8/xapian/swig/Lib/php/utils.i,7,CONVERT_INT_IN@*/
  convert_to_long_ex(args[1]);
  arg2 = (Xapian::docid) Z_LVAL_PP(args[1]);
  /*@SWIG@*/;
  
  {
    try {
      (arg1)->add_document(arg2);
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_RSet_add_document__SWIG_1) {
  Xapian::RSet *arg1 = (Xapian::RSet *) 0 ;
  Xapian::MSetIterator *arg2 = 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_Xapian__RSet, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of RSet_add_document. Expected SWIGTYPE_p_Xapian__RSet");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    if (SWIG_ConvertPtr(*args[1], (void**)&arg2, SWIGTYPE_p_Xapian__MSetIterator, 0) < 0 || arg2 == NULL) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 2 of RSet_add_document. Expected SWIGTYPE_p_Xapian__MSetIterator");
    }
  }
  {
    try {
      (arg1)->add_document(*arg2);
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_RSet_add_document) {
  int argc;
  zval **argv[2];
  
  argc = ZEND_NUM_ARGS();
  zend_get_parameters_array_ex(argc,argv);
  if (argc == 2) {
    int _v;
    {
      void *tmp;
      _v = (SWIG_ConvertPtr(*argv[0], (void**)&tmp, SWIGTYPE_p_Xapian__RSet, 0) >= 0);
    }
    if (_v) {
      {
        void *tmp;
        _v = (SWIG_ConvertPtr(*argv[1], (void**)&tmp, SWIGTYPE_p_Xapian__MSetIterator, 0) >= 0);
      }
      if (_v) {
        _wrap_RSet_add_document__SWIG_1(INTERNAL_FUNCTION_PARAM_PASSTHRU); return;
      }
    }
  }
  if (argc == 2) {
    int _v;
    {
      void *tmp;
      _v = (SWIG_ConvertPtr(*argv[0], (void**)&tmp, SWIGTYPE_p_Xapian__RSet, 0) >= 0);
    }
    if (_v) {
      _v = (Z_TYPE_PP(argv[1]) == IS_LONG); 
      if (_v) {
        _wrap_RSet_add_document__SWIG_0(INTERNAL_FUNCTION_PARAM_PASSTHRU); return;
      }
    }
  }
  
  SWIG_ErrorCode() = E_ERROR;
  SWIG_ErrorMsg() = "No matching function for overloaded 'RSet_add_document'";
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_RSet_remove_document__SWIG_0) {
  Xapian::RSet *arg1 = (Xapian::RSet *) 0 ;
  Xapian::docid 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_Xapian__RSet, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of RSet_remove_document. Expected SWIGTYPE_p_Xapian__RSet");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  
  /*@SWIG:/data/home/olly/tmp/xapian-svn-snapshot/tags/1.2.8/xapian/swig/Lib/php/utils.i,7,CONVERT_INT_IN@*/
  convert_to_long_ex(args[1]);
  arg2 = (Xapian::docid) Z_LVAL_PP(args[1]);
  /*@SWIG@*/;
  
  {
    try {
      (arg1)->remove_document(arg2);
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_RSet_remove_document__SWIG_1) {
  Xapian::RSet *arg1 = (Xapian::RSet *) 0 ;
  Xapian::MSetIterator *arg2 = 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_Xapian__RSet, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of RSet_remove_document. Expected SWIGTYPE_p_Xapian__RSet");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    if (SWIG_ConvertPtr(*args[1], (void**)&arg2, SWIGTYPE_p_Xapian__MSetIterator, 0) < 0 || arg2 == NULL) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 2 of RSet_remove_document. Expected SWIGTYPE_p_Xapian__MSetIterator");
    }
  }
  {
    try {
      (arg1)->remove_document(*arg2);
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_RSet_remove_document) {
  int argc;
  zval **argv[2];
  
  argc = ZEND_NUM_ARGS();
  zend_get_parameters_array_ex(argc,argv);
  if (argc == 2) {
    int _v;
    {
      void *tmp;
      _v = (SWIG_ConvertPtr(*argv[0], (void**)&tmp, SWIGTYPE_p_Xapian__RSet, 0) >= 0);
    }
    if (_v) {
      {
        void *tmp;
        _v = (SWIG_ConvertPtr(*argv[1], (void**)&tmp, SWIGTYPE_p_Xapian__MSetIterator, 0) >= 0);
      }
      if (_v) {
        _wrap_RSet_remove_document__SWIG_1(INTERNAL_FUNCTION_PARAM_PASSTHRU); return;
      }
    }
  }
  if (argc == 2) {
    int _v;
    {
      void *tmp;
      _v = (SWIG_ConvertPtr(*argv[0], (void**)&tmp, SWIGTYPE_p_Xapian__RSet, 0) >= 0);
    }
    if (_v) {
      _v = (Z_TYPE_PP(argv[1]) == IS_LONG); 
      if (_v) {
        _wrap_RSet_remove_document__SWIG_0(INTERNAL_FUNCTION_PARAM_PASSTHRU); return;
      }
    }
  }
  
  SWIG_ErrorCode() = E_ERROR;
  SWIG_ErrorMsg() = "No matching function for overloaded 'RSet_remove_document'";
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_RSet_contains__SWIG_0) {
  Xapian::RSet *arg1 = (Xapian::RSet *) 0 ;
  Xapian::docid arg2 ;
  zval **args[2];
  bool 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_Xapian__RSet, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of RSet_contains. Expected SWIGTYPE_p_Xapian__RSet");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  
  /*@SWIG:/data/home/olly/tmp/xapian-svn-snapshot/tags/1.2.8/xapian/swig/Lib/php/utils.i,7,CONVERT_INT_IN@*/
  convert_to_long_ex(args[1]);
  arg2 = (Xapian::docid) Z_LVAL_PP(args[1]);
  /*@SWIG@*/;
  
  {
    try {
      result = (bool)(arg1)->contains(arg2);
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  {
    ZVAL_BOOL(return_value,(result)?1:0);
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_RSet_contains__SWIG_1) {
  Xapian::RSet *arg1 = (Xapian::RSet *) 0 ;
  Xapian::MSetIterator *arg2 = 0 ;
  zval **args[2];
  bool 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_Xapian__RSet, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of RSet_contains. Expected SWIGTYPE_p_Xapian__RSet");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    if (SWIG_ConvertPtr(*args[1], (void**)&arg2, SWIGTYPE_p_Xapian__MSetIterator, 0) < 0 || arg2 == NULL) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 2 of RSet_contains. Expected SWIGTYPE_p_Xapian__MSetIterator");
    }
  }
  {
    try {
      result = (bool)(arg1)->contains(*arg2);
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  {
    ZVAL_BOOL(return_value,(result)?1:0);
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_RSet_contains) {
  int argc;
  zval **argv[2];
  
  argc = ZEND_NUM_ARGS();
  zend_get_parameters_array_ex(argc,argv);
  if (argc == 2) {
    int _v;
    {
      void *tmp;
      _v = (SWIG_ConvertPtr(*argv[0], (void**)&tmp, SWIGTYPE_p_Xapian__RSet, 0) >= 0);
    }
    if (_v) {
      {
        void *tmp;
        _v = (SWIG_ConvertPtr(*argv[1], (void**)&tmp, SWIGTYPE_p_Xapian__MSetIterator, 0) >= 0);
      }
      if (_v) {
        _wrap_RSet_contains__SWIG_1(INTERNAL_FUNCTION_PARAM_PASSTHRU); return;
      }
    }
  }
  if (argc == 2) {
    int _v;
    {
      void *tmp;
      _v = (SWIG_ConvertPtr(*argv[0], (void**)&tmp, SWIGTYPE_p_Xapian__RSet, 0) >= 0);
    }
    if (_v) {
      _v = (Z_TYPE_PP(argv[1]) == IS_LONG); 
      if (_v) {
        _wrap_RSet_contains__SWIG_0(INTERNAL_FUNCTION_PARAM_PASSTHRU); return;
      }
    }
  }
  
  SWIG_ErrorCode() = E_ERROR;
  SWIG_ErrorMsg() = "No matching function for overloaded 'RSet_contains'";
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_RSet_get_description) {
  Xapian::RSet *arg1 = (Xapian::RSet *) 0 ;
  zval **args[1];
  std::string 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_Xapian__RSet, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of RSet_get_description. Expected SWIGTYPE_p_Xapian__RSet");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    try {
      result = ((Xapian::RSet const *)arg1)->get_description();
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  
  ZVAL_STRINGL(return_value, const_cast<char*>((&result)->data()), (&result)->size(), 1);
  
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_MatchDecider_apply) {
  Xapian::MatchDecider *arg1 = (Xapian::MatchDecider *) 0 ;
  Xapian::Document *arg2 = 0 ;
  zval **args[2];
  Swig::Director *director = 0;
  bool upcall = false;
  bool result;
  
  director = dynamic_cast<Swig::Director*>(arg1);
  upcall = !director->swig_is_overridden_method((char *)"XapianMatchDecider", (char *)"operator ()");
  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_Xapian__MatchDecider, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of MatchDecider_apply. Expected SWIGTYPE_p_Xapian__MatchDecider");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    if (SWIG_ConvertPtr(*args[1], (void**)&arg2, SWIGTYPE_p_Xapian__Document, 0) < 0 || arg2 == NULL) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 2 of MatchDecider_apply. Expected SWIGTYPE_p_Xapian__Document");
    }
  }
  {
    try {
      if (upcall) {
        Swig::DirectorPureVirtualException::raise("Xapian::MatchDecider::operator ()" TSRMLS_CC);
      } else {
        result = (bool)((Xapian::MatchDecider const *)arg1)->operator ()((Xapian::Document const &)*arg2);
      }
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  {
    ZVAL_BOOL(return_value,(result)?1:0);
  }
  return;
fail:
  zend_error(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_MatchDecider(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 ;
  Xapian::MatchDecider *arg1 = (Xapian::MatchDecider *) 0 ;
  
  efree(value);
  if (! newobject) return; /* can't delete it! */
  arg1 = (Xapian::MatchDecider *)SWIG_ZTS_ConvertResourceData(ptr,type_name,SWIGTYPE_p_Xapian__MatchDecider TSRMLS_CC);
  if (! arg1) zend_error(E_ERROR, "Xapian::MatchDecider resource already free'd");
  {
    try {
      delete arg1;
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_new_MatchDecider) {
  zval *arg0;
  zval **args[1];
  Xapian::MatchDecider *result = 0 ;
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 1 || zend_get_parameters_array_ex(1, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  arg0 = *args[0];
  
  {
    try {
      if ( arg0->type == IS_NULL ) {
        /* not subclassed */
        SWIG_PHP_Error(E_ERROR, "accessing abstract class or protected constructor");
      } else {
        result = (Xapian::MatchDecider *)new SwigDirector_MatchDecider(arg0 TSRMLS_CC);
      }
      
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  
  SWIG_SetPointerZval(return_value, (void *)result, SWIGTYPE_p_Xapian__MatchDecider, 1);
  
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_ExpandDecider_apply) {
  Xapian::ExpandDecider *arg1 = (Xapian::ExpandDecider *) 0 ;
  std::string *arg2 = 0 ;
  std::string temp2 ;
  zval **args[2];
  Swig::Director *director = 0;
  bool upcall = false;
  bool result;
  
  director = dynamic_cast<Swig::Director*>(arg1);
  upcall = !director->swig_is_overridden_method((char *)"XapianExpandDecider", (char *)"operator ()");
  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_Xapian__ExpandDecider, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of ExpandDecider_apply. Expected SWIGTYPE_p_Xapian__ExpandDecider");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  
  convert_to_string_ex(args[1]);
  temp2.assign(Z_STRVAL_PP(args[1]), Z_STRLEN_PP(args[1]));
  arg2 = &temp2;
  
  {
    try {
      if (upcall) {
        Swig::DirectorPureVirtualException::raise("Xapian::ExpandDecider::operator ()" TSRMLS_CC);
      } else {
        result = (bool)((Xapian::ExpandDecider const *)arg1)->operator ()((std::string const &)*arg2);
      }
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  {
    ZVAL_BOOL(return_value,(result)?1:0);
  }
  
  return;
fail:
  zend_error(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_ExpandDecider(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 ;
  Xapian::ExpandDecider *arg1 = (Xapian::ExpandDecider *) 0 ;
  
  efree(value);
  if (! newobject) return; /* can't delete it! */
  arg1 = (Xapian::ExpandDecider *)SWIG_ZTS_ConvertResourceData(ptr,type_name,SWIGTYPE_p_Xapian__ExpandDecider TSRMLS_CC);
  if (! arg1) zend_error(E_ERROR, "Xapian::ExpandDecider resource already free'd");
  {
    try {
      delete arg1;
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_new_ExpandDecider) {
  zval *arg0;
  zval **args[1];
  Xapian::ExpandDecider *result = 0 ;
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 1 || zend_get_parameters_array_ex(1, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  arg0 = *args[0];
  
  {
    try {
      if ( arg0->type == IS_NULL ) {
        /* not subclassed */
        SWIG_PHP_Error(E_ERROR, "accessing abstract class or protected constructor");
      } else {
        result = (Xapian::ExpandDecider *)new SwigDirector_ExpandDecider(arg0 TSRMLS_CC);
      }
      
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  
  SWIG_SetPointerZval(return_value, (void *)result, SWIGTYPE_p_Xapian__ExpandDecider, 1);
  
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_new_Enquire) {
  Xapian::Database *arg1 = 0 ;
  zval **args[1];
  Xapian::Enquire *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_Xapian__Database, 0) < 0 || arg1 == NULL) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of new_Enquire. Expected SWIGTYPE_p_Xapian__Database");
    }
  }
  {
    try {
      result = (Xapian::Enquire *)new Xapian::Enquire((Xapian::Database const &)*arg1);
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  
  SWIG_SetPointerZval(return_value, (void *)result, SWIGTYPE_p_Xapian__Enquire, 1);
  
  return;
fail:
  zend_error(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_Enquire(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 ;
  Xapian::Enquire *arg1 = (Xapian::Enquire *) 0 ;
  
  efree(value);
  if (! newobject) return; /* can't delete it! */
  arg1 = (Xapian::Enquire *)SWIG_ZTS_ConvertResourceData(ptr,type_name,SWIGTYPE_p_Xapian__Enquire TSRMLS_CC);
  if (! arg1) zend_error(E_ERROR, "Xapian::Enquire resource already free'd");
  {
    try {
      delete arg1;
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_Enquire_set_query__SWIG_0) {
  Xapian::Enquire *arg1 = (Xapian::Enquire *) 0 ;
  Xapian::Query *arg2 = 0 ;
  Xapian::termcount arg3 ;
  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_Xapian__Enquire, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of Enquire_set_query. Expected SWIGTYPE_p_Xapian__Enquire");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    if (SWIG_ConvertPtr(*args[1], (void**)&arg2, SWIGTYPE_p_Xapian__Query, 0) < 0 || arg2 == NULL) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 2 of Enquire_set_query. Expected SWIGTYPE_p_Xapian__Query");
    }
  }
  
  /*@SWIG:/data/home/olly/tmp/xapian-svn-snapshot/tags/1.2.8/xapian/swig/Lib/php/utils.i,7,CONVERT_INT_IN@*/
  convert_to_long_ex(args[2]);
  arg3 = (Xapian::termcount) Z_LVAL_PP(args[2]);
  /*@SWIG@*/;
  
  {
    try {
      (arg1)->set_query((Xapian::Query const &)*arg2,arg3);
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_Enquire_set_query__SWIG_1) {
  Xapian::Enquire *arg1 = (Xapian::Enquire *) 0 ;
  Xapian::Query *arg2 = 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_Xapian__Enquire, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of Enquire_set_query. Expected SWIGTYPE_p_Xapian__Enquire");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    if (SWIG_ConvertPtr(*args[1], (void**)&arg2, SWIGTYPE_p_Xapian__Query, 0) < 0 || arg2 == NULL) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 2 of Enquire_set_query. Expected SWIGTYPE_p_Xapian__Query");
    }
  }
  {
    try {
      (arg1)->set_query((Xapian::Query const &)*arg2);
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_Enquire_set_query) {
  int argc;
  zval **argv[3];
  
  argc = ZEND_NUM_ARGS();
  zend_get_parameters_array_ex(argc,argv);
  if (argc == 2) {
    int _v;
    {
      void *tmp;
      _v = (SWIG_ConvertPtr(*argv[0], (void**)&tmp, SWIGTYPE_p_Xapian__Enquire, 0) >= 0);
    }
    if (_v) {
      {
        void *ptr;
        _v = (SWIG_ConvertPtr(*argv[1], (void **)&ptr, SWIGTYPE_p_Xapian__Query, 0) == 0);
      }
      if (_v) {
        _wrap_Enquire_set_query__SWIG_1(INTERNAL_FUNCTION_PARAM_PASSTHRU); return;
      }
    }
  }
  if (argc == 3) {
    int _v;
    {
      void *tmp;
      _v = (SWIG_ConvertPtr(*argv[0], (void**)&tmp, SWIGTYPE_p_Xapian__Enquire, 0) >= 0);
    }
    if (_v) {
      {
        void *ptr;
        _v = (SWIG_ConvertPtr(*argv[1], (void **)&ptr, SWIGTYPE_p_Xapian__Query, 0) == 0);
      }
      if (_v) {
        _v = (Z_TYPE_PP(argv[2]) == IS_LONG); 
        if (_v) {
          _wrap_Enquire_set_query__SWIG_0(INTERNAL_FUNCTION_PARAM_PASSTHRU); return;
        }
      }
    }
  }
  
  SWIG_ErrorCode() = E_ERROR;
  SWIG_ErrorMsg() = "No matching function for overloaded 'Enquire_set_query'";
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_Enquire_get_query) {
  Xapian::Enquire *arg1 = (Xapian::Enquire *) 0 ;
  zval **args[1];
  Xapian::Query *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_Xapian__Enquire, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of Enquire_get_query. Expected SWIGTYPE_p_Xapian__Enquire");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    try {
      result = (Xapian::Query *) &(arg1)->get_query();
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  
  SWIG_SetPointerZval(return_value, (void *)result, SWIGTYPE_p_Xapian__Query, 0);
  
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_Enquire_add_matchspy) {
  Xapian::Enquire *arg1 = (Xapian::Enquire *) 0 ;
  Xapian::MatchSpy *arg2 = (Xapian::MatchSpy *) 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_Xapian__Enquire, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of Enquire_add_matchspy. Expected SWIGTYPE_p_Xapian__Enquire");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    if(SWIG_ConvertPtr(*args[1], (void **) &arg2, SWIGTYPE_p_Xapian__MatchSpy, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 2 of Enquire_add_matchspy. Expected SWIGTYPE_p_Xapian__MatchSpy");
    }
  }
  {
    try {
      (arg1)->add_matchspy(arg2);
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_Enquire_clear_matchspies) {
  Xapian::Enquire *arg1 = (Xapian::Enquire *) 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_Xapian__Enquire, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of Enquire_clear_matchspies. Expected SWIGTYPE_p_Xapian__Enquire");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    try {
      (arg1)->clear_matchspies();
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_Enquire_set_weighting_scheme) {
  Xapian::Enquire *arg1 = (Xapian::Enquire *) 0 ;
  Xapian::Weight *arg2 = 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_Xapian__Enquire, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of Enquire_set_weighting_scheme. Expected SWIGTYPE_p_Xapian__Enquire");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    if (SWIG_ConvertPtr(*args[1], (void**)&arg2, SWIGTYPE_p_Xapian__Weight, 0) < 0 || arg2 == NULL) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 2 of Enquire_set_weighting_scheme. Expected SWIGTYPE_p_Xapian__Weight");
    }
  }
  {
    try {
      (arg1)->set_weighting_scheme((Xapian::Weight const &)*arg2);
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_Enquire_set_collapse_key__SWIG_0) {
  Xapian::Enquire *arg1 = (Xapian::Enquire *) 0 ;
  Xapian::valueno arg2 ;
  Xapian::doccount arg3 ;
  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_Xapian__Enquire, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of Enquire_set_collapse_key. Expected SWIGTYPE_p_Xapian__Enquire");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  
  /*@SWIG:/data/home/olly/tmp/xapian-svn-snapshot/tags/1.2.8/xapian/swig/Lib/php/utils.i,7,CONVERT_INT_IN@*/
  convert_to_long_ex(args[1]);
  arg2 = (Xapian::valueno) Z_LVAL_PP(args[1]);
  /*@SWIG@*/;
  
  
  /*@SWIG:/data/home/olly/tmp/xapian-svn-snapshot/tags/1.2.8/xapian/swig/Lib/php/utils.i,7,CONVERT_INT_IN@*/
  convert_to_long_ex(args[2]);
  arg3 = (Xapian::doccount) Z_LVAL_PP(args[2]);
  /*@SWIG@*/;
  
  {
    try {
      (arg1)->set_collapse_key(arg2,arg3);
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_Enquire_set_collapse_key__SWIG_1) {
  Xapian::Enquire *arg1 = (Xapian::Enquire *) 0 ;
  Xapian::valueno 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_Xapian__Enquire, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of Enquire_set_collapse_key. Expected SWIGTYPE_p_Xapian__Enquire");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  
  /*@SWIG:/data/home/olly/tmp/xapian-svn-snapshot/tags/1.2.8/xapian/swig/Lib/php/utils.i,7,CONVERT_INT_IN@*/
  convert_to_long_ex(args[1]);
  arg2 = (Xapian::valueno) Z_LVAL_PP(args[1]);
  /*@SWIG@*/;
  
  {
    try {
      (arg1)->set_collapse_key(arg2);
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_Enquire_set_collapse_key) {
  int argc;
  zval **argv[3];
  
  argc = ZEND_NUM_ARGS();
  zend_get_parameters_array_ex(argc,argv);
  if (argc == 2) {
    int _v;
    {
      void *tmp;
      _v = (SWIG_ConvertPtr(*argv[0], (void**)&tmp, SWIGTYPE_p_Xapian__Enquire, 0) >= 0);
    }
    if (_v) {
      _v = (Z_TYPE_PP(argv[1]) == IS_LONG); 
      if (_v) {
        _wrap_Enquire_set_collapse_key__SWIG_1(INTERNAL_FUNCTION_PARAM_PASSTHRU); return;
      }
    }
  }
  if (argc == 3) {
    int _v;
    {
      void *tmp;
      _v = (SWIG_ConvertPtr(*argv[0], (void**)&tmp, SWIGTYPE_p_Xapian__Enquire, 0) >= 0);
    }
    if (_v) {
      _v = (Z_TYPE_PP(argv[1]) == IS_LONG); 
      if (_v) {
        _v = (Z_TYPE_PP(argv[2]) == IS_LONG); 
        if (_v) {
          _wrap_Enquire_set_collapse_key__SWIG_0(INTERNAL_FUNCTION_PARAM_PASSTHRU); return;
        }
      }
    }
  }
  
  SWIG_ErrorCode() = E_ERROR;
  SWIG_ErrorMsg() = "No matching function for overloaded 'Enquire_set_collapse_key'";
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_Enquire_set_docid_order) {
  Xapian::Enquire *arg1 = (Xapian::Enquire *) 0 ;
  Xapian::Enquire::docid_order 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_Xapian__Enquire, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of Enquire_set_docid_order. Expected SWIGTYPE_p_Xapian__Enquire");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  
  /*@SWIG:/data/home/olly/tmp/xapian-svn-snapshot/tags/1.2.8/xapian/swig/Lib/php/utils.i,7,CONVERT_INT_IN@*/
  convert_to_long_ex(args[1]);
  arg2 = (Xapian::Enquire::docid_order) Z_LVAL_PP(args[1]);
  /*@SWIG@*/;
  
  {
    try {
      (arg1)->set_docid_order(arg2);
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_Enquire_set_cutoff__SWIG_0) {
  Xapian::Enquire *arg1 = (Xapian::Enquire *) 0 ;
  int arg2 ;
  Xapian::weight arg3 ;
  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_Xapian__Enquire, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of Enquire_set_cutoff. Expected SWIGTYPE_p_Xapian__Enquire");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  
  /*@SWIG:/data/home/olly/tmp/xapian-svn-snapshot/tags/1.2.8/xapian/swig/Lib/php/utils.i,7,CONVERT_INT_IN@*/
  convert_to_long_ex(args[1]);
  arg2 = (int) Z_LVAL_PP(args[1]);
  /*@SWIG@*/;
  
  
  /*@SWIG:/data/home/olly/tmp/xapian-svn-snapshot/tags/1.2.8/xapian/swig/Lib/php/utils.i,52,CONVERT_FLOAT_IN@*/
  convert_to_double_ex(args[2]);
  arg3 = (Xapian::weight) Z_DVAL_PP(args[2]);
  /*@SWIG@*/;
  
  {
    try {
      (arg1)->set_cutoff(arg2,arg3);
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_Enquire_set_cutoff__SWIG_1) {
  Xapian::Enquire *arg1 = (Xapian::Enquire *) 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_Xapian__Enquire, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of Enquire_set_cutoff. Expected SWIGTYPE_p_Xapian__Enquire");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  
  /*@SWIG:/data/home/olly/tmp/xapian-svn-snapshot/tags/1.2.8/xapian/swig/Lib/php/utils.i,7,CONVERT_INT_IN@*/
  convert_to_long_ex(args[1]);
  arg2 = (int) Z_LVAL_PP(args[1]);
  /*@SWIG@*/;
  
  {
    try {
      (arg1)->set_cutoff(arg2);
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_Enquire_set_cutoff) {
  int argc;
  zval **argv[3];
  
  argc = ZEND_NUM_ARGS();
  zend_get_parameters_array_ex(argc,argv);
  if (argc == 2) {
    int _v;
    {
      void *tmp;
      _v = (SWIG_ConvertPtr(*argv[0], (void**)&tmp, SWIGTYPE_p_Xapian__Enquire, 0) >= 0);
    }
    if (_v) {
      _v = (Z_TYPE_PP(argv[1]) == IS_LONG); 
      if (_v) {
        _wrap_Enquire_set_cutoff__SWIG_1(INTERNAL_FUNCTION_PARAM_PASSTHRU); return;
      }
    }
  }
  if (argc == 3) {
    int _v;
    {
      void *tmp;
      _v = (SWIG_ConvertPtr(*argv[0], (void**)&tmp, SWIGTYPE_p_Xapian__Enquire, 0) >= 0);
    }
    if (_v) {
      _v = (Z_TYPE_PP(argv[1]) == IS_LONG); 
      if (_v) {
        _v = (Z_TYPE_PP(argv[2]) == IS_DOUBLE); 
        if (_v) {
          _wrap_Enquire_set_cutoff__SWIG_0(INTERNAL_FUNCTION_PARAM_PASSTHRU); return;
        }
      }
    }
  }
  
  SWIG_ErrorCode() = E_ERROR;
  SWIG_ErrorMsg() = "No matching function for overloaded 'Enquire_set_cutoff'";
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_Enquire_set_sort_by_relevance) {
  Xapian::Enquire *arg1 = (Xapian::Enquire *) 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_Xapian__Enquire, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of Enquire_set_sort_by_relevance. Expected SWIGTYPE_p_Xapian__Enquire");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    try {
      (arg1)->set_sort_by_relevance();
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_Enquire_set_sort_by_value__SWIG_0) {
  Xapian::Enquire *arg1 = (Xapian::Enquire *) 0 ;
  Xapian::valueno arg2 ;
  bool arg3 ;
  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_Xapian__Enquire, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of Enquire_set_sort_by_value. Expected SWIGTYPE_p_Xapian__Enquire");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  
  /*@SWIG:/data/home/olly/tmp/xapian-svn-snapshot/tags/1.2.8/xapian/swig/Lib/php/utils.i,7,CONVERT_INT_IN@*/
  convert_to_long_ex(args[1]);
  arg2 = (Xapian::valueno) Z_LVAL_PP(args[1]);
  /*@SWIG@*/;
  
  
  /*@SWIG:/data/home/olly/tmp/xapian-svn-snapshot/tags/1.2.8/xapian/swig/Lib/php/utils.i,2,CONVERT_BOOL_IN@*/
  convert_to_boolean_ex(args[2]);
  arg3 = (bool) Z_LVAL_PP(args[2]);
  /*@SWIG@*/;
  
  {
    try {
      (arg1)->set_sort_by_value(arg2,arg3);
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_Enquire_set_sort_by_value__SWIG_1) {
  Xapian::Enquire *arg1 = (Xapian::Enquire *) 0 ;
  Xapian::valueno 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_Xapian__Enquire, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of Enquire_set_sort_by_value. Expected SWIGTYPE_p_Xapian__Enquire");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  
  /*@SWIG:/data/home/olly/tmp/xapian-svn-snapshot/tags/1.2.8/xapian/swig/Lib/php/utils.i,7,CONVERT_INT_IN@*/
  convert_to_long_ex(args[1]);
  arg2 = (Xapian::valueno) Z_LVAL_PP(args[1]);
  /*@SWIG@*/;
  
  {
    try {
      (arg1)->set_sort_by_value(arg2);
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_Enquire_set_sort_by_value) {
  int argc;
  zval **argv[3];
  
  argc = ZEND_NUM_ARGS();
  zend_get_parameters_array_ex(argc,argv);
  if (argc == 2) {
    int _v;
    {
      void *tmp;
      _v = (SWIG_ConvertPtr(*argv[0], (void**)&tmp, SWIGTYPE_p_Xapian__Enquire, 0) >= 0);
    }
    if (_v) {
      _v = (Z_TYPE_PP(argv[1]) == IS_LONG); 
      if (_v) {
        _wrap_Enquire_set_sort_by_value__SWIG_1(INTERNAL_FUNCTION_PARAM_PASSTHRU); return;
      }
    }
  }
  if (argc == 3) {
    int _v;
    {
      void *tmp;
      _v = (SWIG_ConvertPtr(*argv[0], (void**)&tmp, SWIGTYPE_p_Xapian__Enquire, 0) >= 0);
    }
    if (_v) {
      _v = (Z_TYPE_PP(argv[1]) == IS_LONG); 
      if (_v) {
        {
          _v = (Z_TYPE_PP(argv[2]) == IS_BOOL || Z_TYPE_PP(argv[2]) == IS_LONG);
        }
        if (_v) {
          _wrap_Enquire_set_sort_by_value__SWIG_0(INTERNAL_FUNCTION_PARAM_PASSTHRU); return;
        }
      }
    }
  }
  
  SWIG_ErrorCode() = E_ERROR;
  SWIG_ErrorMsg() = "No matching function for overloaded 'Enquire_set_sort_by_value'";
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_Enquire_set_sort_by_value_then_relevance__SWIG_0) {
  Xapian::Enquire *arg1 = (Xapian::Enquire *) 0 ;
  Xapian::valueno arg2 ;
  bool arg3 ;
  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_Xapian__Enquire, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of Enquire_set_sort_by_value_then_relevance. Expected SWIGTYPE_p_Xapian__Enquire");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  
  /*@SWIG:/data/home/olly/tmp/xapian-svn-snapshot/tags/1.2.8/xapian/swig/Lib/php/utils.i,7,CONVERT_INT_IN@*/
  convert_to_long_ex(args[1]);
  arg2 = (Xapian::valueno) Z_LVAL_PP(args[1]);
  /*@SWIG@*/;
  
  
  /*@SWIG:/data/home/olly/tmp/xapian-svn-snapshot/tags/1.2.8/xapian/swig/Lib/php/utils.i,2,CONVERT_BOOL_IN@*/
  convert_to_boolean_ex(args[2]);
  arg3 = (bool) Z_LVAL_PP(args[2]);
  /*@SWIG@*/;
  
  {
    try {
      (arg1)->set_sort_by_value_then_relevance(arg2,arg3);
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_Enquire_set_sort_by_value_then_relevance__SWIG_1) {
  Xapian::Enquire *arg1 = (Xapian::Enquire *) 0 ;
  Xapian::valueno 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_Xapian__Enquire, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of Enquire_set_sort_by_value_then_relevance. Expected SWIGTYPE_p_Xapian__Enquire");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  
  /*@SWIG:/data/home/olly/tmp/xapian-svn-snapshot/tags/1.2.8/xapian/swig/Lib/php/utils.i,7,CONVERT_INT_IN@*/
  convert_to_long_ex(args[1]);
  arg2 = (Xapian::valueno) Z_LVAL_PP(args[1]);
  /*@SWIG@*/;
  
  {
    try {
      (arg1)->set_sort_by_value_then_relevance(arg2);
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_Enquire_set_sort_by_value_then_relevance) {
  int argc;
  zval **argv[3];
  
  argc = ZEND_NUM_ARGS();
  zend_get_parameters_array_ex(argc,argv);
  if (argc == 2) {
    int _v;
    {
      void *tmp;
      _v = (SWIG_ConvertPtr(*argv[0], (void**)&tmp, SWIGTYPE_p_Xapian__Enquire, 0) >= 0);
    }
    if (_v) {
      _v = (Z_TYPE_PP(argv[1]) == IS_LONG); 
      if (_v) {
        _wrap_Enquire_set_sort_by_value_then_relevance__SWIG_1(INTERNAL_FUNCTION_PARAM_PASSTHRU); return;
      }
    }
  }
  if (argc == 3) {
    int _v;
    {
      void *tmp;
      _v = (SWIG_ConvertPtr(*argv[0], (void**)&tmp, SWIGTYPE_p_Xapian__Enquire, 0) >= 0);
    }
    if (_v) {
      _v = (Z_TYPE_PP(argv[1]) == IS_LONG); 
      if (_v) {
        {
          _v = (Z_TYPE_PP(argv[2]) == IS_BOOL || Z_TYPE_PP(argv[2]) == IS_LONG);
        }
        if (_v) {
          _wrap_Enquire_set_sort_by_value_then_relevance__SWIG_0(INTERNAL_FUNCTION_PARAM_PASSTHRU); return;
        }
      }
    }
  }
  
  SWIG_ErrorCode() = E_ERROR;
  SWIG_ErrorMsg() = "No matching function for overloaded 'Enquire_set_sort_by_value_then_relevance'";
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_Enquire_set_sort_by_relevance_then_value__SWIG_0) {
  Xapian::Enquire *arg1 = (Xapian::Enquire *) 0 ;
  Xapian::valueno arg2 ;
  bool arg3 ;
  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_Xapian__Enquire, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of Enquire_set_sort_by_relevance_then_value. Expected SWIGTYPE_p_Xapian__Enquire");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  
  /*@SWIG:/data/home/olly/tmp/xapian-svn-snapshot/tags/1.2.8/xapian/swig/Lib/php/utils.i,7,CONVERT_INT_IN@*/
  convert_to_long_ex(args[1]);
  arg2 = (Xapian::valueno) Z_LVAL_PP(args[1]);
  /*@SWIG@*/;
  
  
  /*@SWIG:/data/home/olly/tmp/xapian-svn-snapshot/tags/1.2.8/xapian/swig/Lib/php/utils.i,2,CONVERT_BOOL_IN@*/
  convert_to_boolean_ex(args[2]);
  arg3 = (bool) Z_LVAL_PP(args[2]);
  /*@SWIG@*/;
  
  {
    try {
      (arg1)->set_sort_by_relevance_then_value(arg2,arg3);
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_Enquire_set_sort_by_relevance_then_value__SWIG_1) {
  Xapian::Enquire *arg1 = (Xapian::Enquire *) 0 ;
  Xapian::valueno 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_Xapian__Enquire, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of Enquire_set_sort_by_relevance_then_value. Expected SWIGTYPE_p_Xapian__Enquire");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  
  /*@SWIG:/data/home/olly/tmp/xapian-svn-snapshot/tags/1.2.8/xapian/swig/Lib/php/utils.i,7,CONVERT_INT_IN@*/
  convert_to_long_ex(args[1]);
  arg2 = (Xapian::valueno) Z_LVAL_PP(args[1]);
  /*@SWIG@*/;
  
  {
    try {
      (arg1)->set_sort_by_relevance_then_value(arg2);
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_Enquire_set_sort_by_relevance_then_value) {
  int argc;
  zval **argv[3];
  
  argc = ZEND_NUM_ARGS();
  zend_get_parameters_array_ex(argc,argv);
  if (argc == 2) {
    int _v;
    {
      void *tmp;
      _v = (SWIG_ConvertPtr(*argv[0], (void**)&tmp, SWIGTYPE_p_Xapian__Enquire, 0) >= 0);
    }
    if (_v) {
      _v = (Z_TYPE_PP(argv[1]) == IS_LONG); 
      if (_v) {
        _wrap_Enquire_set_sort_by_relevance_then_value__SWIG_1(INTERNAL_FUNCTION_PARAM_PASSTHRU); return;
      }
    }
  }
  if (argc == 3) {
    int _v;
    {
      void *tmp;
      _v = (SWIG_ConvertPtr(*argv[0], (void**)&tmp, SWIGTYPE_p_Xapian__Enquire, 0) >= 0);
    }
    if (_v) {
      _v = (Z_TYPE_PP(argv[1]) == IS_LONG); 
      if (_v) {
        {
          _v = (Z_TYPE_PP(argv[2]) == IS_BOOL || Z_TYPE_PP(argv[2]) == IS_LONG);
        }
        if (_v) {
          _wrap_Enquire_set_sort_by_relevance_then_value__SWIG_0(INTERNAL_FUNCTION_PARAM_PASSTHRU); return;
        }
      }
    }
  }
  
  SWIG_ErrorCode() = E_ERROR;
  SWIG_ErrorMsg() = "No matching function for overloaded 'Enquire_set_sort_by_relevance_then_value'";
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_Enquire_set_sort_by_key__SWIG_0) {
  Xapian::Enquire *arg1 = (Xapian::Enquire *) 0 ;
  Xapian::KeyMaker *arg2 = (Xapian::KeyMaker *) 0 ;
  bool arg3 ;
  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_Xapian__Enquire, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of Enquire_set_sort_by_key. Expected SWIGTYPE_p_Xapian__Enquire");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    if(SWIG_ConvertPtr(*args[1], (void **) &arg2, SWIGTYPE_p_Xapian__KeyMaker, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 2 of Enquire_set_sort_by_key. Expected SWIGTYPE_p_Xapian__KeyMaker");
    }
  }
  
  /*@SWIG:/data/home/olly/tmp/xapian-svn-snapshot/tags/1.2.8/xapian/swig/Lib/php/utils.i,2,CONVERT_BOOL_IN@*/
  convert_to_boolean_ex(args[2]);
  arg3 = (bool) Z_LVAL_PP(args[2]);
  /*@SWIG@*/;
  
  {
    try {
      (arg1)->set_sort_by_key(arg2,arg3);
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_Enquire_set_sort_by_key__SWIG_1) {
  Xapian::Enquire *arg1 = (Xapian::Enquire *) 0 ;
  Xapian::Sorter *arg2 = (Xapian::Sorter *) 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_Xapian__Enquire, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of Enquire_set_sort_by_key. Expected SWIGTYPE_p_Xapian__Enquire");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    if(SWIG_ConvertPtr(*args[1], (void **) &arg2, SWIGTYPE_p_Xapian__Sorter, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 2 of Enquire_set_sort_by_key. Expected SWIGTYPE_p_Xapian__Sorter");
    }
  }
  {
    try {
      (arg1)->set_sort_by_key(arg2);
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_Enquire_set_sort_by_key) {
  int argc;
  zval **argv[3];
  
  argc = ZEND_NUM_ARGS();
  zend_get_parameters_array_ex(argc,argv);
  if (argc == 2) {
    int _v;
    {
      void *tmp;
      _v = (SWIG_ConvertPtr(*argv[0], (void**)&tmp, SWIGTYPE_p_Xapian__Enquire, 0) >= 0);
    }
    if (_v) {
      {
        void *tmp;
        _v = (SWIG_ConvertPtr(*argv[1], (void**)&tmp, SWIGTYPE_p_Xapian__Sorter, 0) >= 0);
      }
      if (_v) {
        _wrap_Enquire_set_sort_by_key__SWIG_1(INTERNAL_FUNCTION_PARAM_PASSTHRU); return;
      }
    }
  }
  if (argc == 3) {
    int _v;
    {
      void *tmp;
      _v = (SWIG_ConvertPtr(*argv[0], (void**)&tmp, SWIGTYPE_p_Xapian__Enquire, 0) >= 0);
    }
    if (_v) {
      {
        void *tmp;
        _v = (SWIG_ConvertPtr(*argv[1], (void**)&tmp, SWIGTYPE_p_Xapian__KeyMaker, 0) >= 0);
      }
      if (_v) {
        {
          _v = (Z_TYPE_PP(argv[2]) == IS_BOOL || Z_TYPE_PP(argv[2]) == IS_LONG);
        }
        if (_v) {
          _wrap_Enquire_set_sort_by_key__SWIG_0(INTERNAL_FUNCTION_PARAM_PASSTHRU); return;
        }
      }
    }
  }
  
  SWIG_ErrorCode() = E_ERROR;
  SWIG_ErrorMsg() = "No matching function for overloaded 'Enquire_set_sort_by_key'";
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_Enquire_set_sort_by_key_then_relevance__SWIG_0) {
  Xapian::Enquire *arg1 = (Xapian::Enquire *) 0 ;
  Xapian::KeyMaker *arg2 = (Xapian::KeyMaker *) 0 ;
  bool arg3 ;
  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_Xapian__Enquire, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of Enquire_set_sort_by_key_then_relevance. Expected SWIGTYPE_p_Xapian__Enquire");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    if(SWIG_ConvertPtr(*args[1], (void **) &arg2, SWIGTYPE_p_Xapian__KeyMaker, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 2 of Enquire_set_sort_by_key_then_relevance. Expected SWIGTYPE_p_Xapian__KeyMaker");
    }
  }
  
  /*@SWIG:/data/home/olly/tmp/xapian-svn-snapshot/tags/1.2.8/xapian/swig/Lib/php/utils.i,2,CONVERT_BOOL_IN@*/
  convert_to_boolean_ex(args[2]);
  arg3 = (bool) Z_LVAL_PP(args[2]);
  /*@SWIG@*/;
  
  {
    try {
      (arg1)->set_sort_by_key_then_relevance(arg2,arg3);
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_Enquire_set_sort_by_key_then_relevance__SWIG_1) {
  Xapian::Enquire *arg1 = (Xapian::Enquire *) 0 ;
  Xapian::Sorter *arg2 = (Xapian::Sorter *) 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_Xapian__Enquire, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of Enquire_set_sort_by_key_then_relevance. Expected SWIGTYPE_p_Xapian__Enquire");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    if(SWIG_ConvertPtr(*args[1], (void **) &arg2, SWIGTYPE_p_Xapian__Sorter, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 2 of Enquire_set_sort_by_key_then_relevance. Expected SWIGTYPE_p_Xapian__Sorter");
    }
  }
  {
    try {
      (arg1)->set_sort_by_key_then_relevance(arg2);
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_Enquire_set_sort_by_key_then_relevance) {
  int argc;
  zval **argv[3];
  
  argc = ZEND_NUM_ARGS();
  zend_get_parameters_array_ex(argc,argv);
  if (argc == 2) {
    int _v;
    {
      void *tmp;
      _v = (SWIG_ConvertPtr(*argv[0], (void**)&tmp, SWIGTYPE_p_Xapian__Enquire, 0) >= 0);
    }
    if (_v) {
      {
        void *tmp;
        _v = (SWIG_ConvertPtr(*argv[1], (void**)&tmp, SWIGTYPE_p_Xapian__Sorter, 0) >= 0);
      }
      if (_v) {
        _wrap_Enquire_set_sort_by_key_then_relevance__SWIG_1(INTERNAL_FUNCTION_PARAM_PASSTHRU); return;
      }
    }
  }
  if (argc == 3) {
    int _v;
    {
      void *tmp;
      _v = (SWIG_ConvertPtr(*argv[0], (void**)&tmp, SWIGTYPE_p_Xapian__Enquire, 0) >= 0);
    }
    if (_v) {
      {
        void *tmp;
        _v = (SWIG_ConvertPtr(*argv[1], (void**)&tmp, SWIGTYPE_p_Xapian__KeyMaker, 0) >= 0);
      }
      if (_v) {
        {
          _v = (Z_TYPE_PP(argv[2]) == IS_BOOL || Z_TYPE_PP(argv[2]) == IS_LONG);
        }
        if (_v) {
          _wrap_Enquire_set_sort_by_key_then_relevance__SWIG_0(INTERNAL_FUNCTION_PARAM_PASSTHRU); return;
        }
      }
    }
  }
  
  SWIG_ErrorCode() = E_ERROR;
  SWIG_ErrorMsg() = "No matching function for overloaded 'Enquire_set_sort_by_key_then_relevance'";
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_Enquire_set_sort_by_relevance_then_key__SWIG_0) {
  Xapian::Enquire *arg1 = (Xapian::Enquire *) 0 ;
  Xapian::KeyMaker *arg2 = (Xapian::KeyMaker *) 0 ;
  bool arg3 ;
  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_Xapian__Enquire, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of Enquire_set_sort_by_relevance_then_key. Expected SWIGTYPE_p_Xapian__Enquire");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    if(SWIG_ConvertPtr(*args[1], (void **) &arg2, SWIGTYPE_p_Xapian__KeyMaker, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 2 of Enquire_set_sort_by_relevance_then_key. Expected SWIGTYPE_p_Xapian__KeyMaker");
    }
  }
  
  /*@SWIG:/data/home/olly/tmp/xapian-svn-snapshot/tags/1.2.8/xapian/swig/Lib/php/utils.i,2,CONVERT_BOOL_IN@*/
  convert_to_boolean_ex(args[2]);
  arg3 = (bool) Z_LVAL_PP(args[2]);
  /*@SWIG@*/;
  
  {
    try {
      (arg1)->set_sort_by_relevance_then_key(arg2,arg3);
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_Enquire_set_sort_by_relevance_then_key__SWIG_1) {
  Xapian::Enquire *arg1 = (Xapian::Enquire *) 0 ;
  Xapian::Sorter *arg2 = (Xapian::Sorter *) 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_Xapian__Enquire, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of Enquire_set_sort_by_relevance_then_key. Expected SWIGTYPE_p_Xapian__Enquire");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    if(SWIG_ConvertPtr(*args[1], (void **) &arg2, SWIGTYPE_p_Xapian__Sorter, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 2 of Enquire_set_sort_by_relevance_then_key. Expected SWIGTYPE_p_Xapian__Sorter");
    }
  }
  {
    try {
      (arg1)->set_sort_by_relevance_then_key(arg2);
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_Enquire_set_sort_by_relevance_then_key) {
  int argc;
  zval **argv[3];
  
  argc = ZEND_NUM_ARGS();
  zend_get_parameters_array_ex(argc,argv);
  if (argc == 2) {
    int _v;
    {
      void *tmp;
      _v = (SWIG_ConvertPtr(*argv[0], (void**)&tmp, SWIGTYPE_p_Xapian__Enquire, 0) >= 0);
    }
    if (_v) {
      {
        void *tmp;
        _v = (SWIG_ConvertPtr(*argv[1], (void**)&tmp, SWIGTYPE_p_Xapian__Sorter, 0) >= 0);
      }
      if (_v) {
        _wrap_Enquire_set_sort_by_relevance_then_key__SWIG_1(INTERNAL_FUNCTION_PARAM_PASSTHRU); return;
      }
    }
  }
  if (argc == 3) {
    int _v;
    {
      void *tmp;
      _v = (SWIG_ConvertPtr(*argv[0], (void**)&tmp, SWIGTYPE_p_Xapian__Enquire, 0) >= 0);
    }
    if (_v) {
      {
        void *tmp;
        _v = (SWIG_ConvertPtr(*argv[1], (void**)&tmp, SWIGTYPE_p_Xapian__KeyMaker, 0) >= 0);
      }
      if (_v) {
        {
          _v = (Z_TYPE_PP(argv[2]) == IS_BOOL || Z_TYPE_PP(argv[2]) == IS_LONG);
        }
        if (_v) {
          _wrap_Enquire_set_sort_by_relevance_then_key__SWIG_0(INTERNAL_FUNCTION_PARAM_PASSTHRU); return;
        }
      }
    }
  }
  
  SWIG_ErrorCode() = E_ERROR;
  SWIG_ErrorMsg() = "No matching function for overloaded 'Enquire_set_sort_by_relevance_then_key'";
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_Enquire_get_mset__SWIG_0) {
  Xapian::Enquire *arg1 = (Xapian::Enquire *) 0 ;
  Xapian::doccount arg2 ;
  Xapian::doccount arg3 ;
  Xapian::doccount arg4 ;
  Xapian::RSet *arg5 = (Xapian::RSet *) 0 ;
  Xapian::MatchDecider *arg6 = (Xapian::MatchDecider *) 0 ;
  Xapian::MatchDecider *arg7 = (Xapian::MatchDecider *) 0 ;
  zval **args[7];
  Xapian::MSet 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_Xapian__Enquire, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of Enquire_get_mset. Expected SWIGTYPE_p_Xapian__Enquire");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  
  /*@SWIG:/data/home/olly/tmp/xapian-svn-snapshot/tags/1.2.8/xapian/swig/Lib/php/utils.i,7,CONVERT_INT_IN@*/
  convert_to_long_ex(args[1]);
  arg2 = (Xapian::doccount) Z_LVAL_PP(args[1]);
  /*@SWIG@*/;
  
  
  /*@SWIG:/data/home/olly/tmp/xapian-svn-snapshot/tags/1.2.8/xapian/swig/Lib/php/utils.i,7,CONVERT_INT_IN@*/
  convert_to_long_ex(args[2]);
  arg3 = (Xapian::doccount) Z_LVAL_PP(args[2]);
  /*@SWIG@*/;
  
  
  /*@SWIG:/data/home/olly/tmp/xapian-svn-snapshot/tags/1.2.8/xapian/swig/Lib/php/utils.i,7,CONVERT_INT_IN@*/
  convert_to_long_ex(args[3]);
  arg4 = (Xapian::doccount) Z_LVAL_PP(args[3]);
  /*@SWIG@*/;
  
  {
    if(SWIG_ConvertPtr(*args[4], (void **) &arg5, SWIGTYPE_p_Xapian__RSet, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 5 of Enquire_get_mset. Expected SWIGTYPE_p_Xapian__RSet");
    }
  }
  {
    if(SWIG_ConvertPtr(*args[5], (void **) &arg6, SWIGTYPE_p_Xapian__MatchDecider, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 6 of Enquire_get_mset. Expected SWIGTYPE_p_Xapian__MatchDecider");
    }
  }
  {
    if(SWIG_ConvertPtr(*args[6], (void **) &arg7, SWIGTYPE_p_Xapian__MatchDecider, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 7 of Enquire_get_mset. Expected SWIGTYPE_p_Xapian__MatchDecider");
    }
  }
  {
    try {
      result = ((Xapian::Enquire const *)arg1)->get_mset(arg2,arg3,arg4,(Xapian::RSet const *)arg5,(Xapian::MatchDecider const *)arg6,(Xapian::MatchDecider const *)arg7);
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  {
    Xapian::MSet * resultobj = new Xapian::MSet((const Xapian::MSet &) result);
    SWIG_SetPointerZval(return_value, (void *)resultobj, SWIGTYPE_p_Xapian__MSet, 1);
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_Enquire_get_mset__SWIG_1) {
  Xapian::Enquire *arg1 = (Xapian::Enquire *) 0 ;
  Xapian::doccount arg2 ;
  Xapian::doccount arg3 ;
  Xapian::doccount arg4 ;
  Xapian::RSet *arg5 = (Xapian::RSet *) 0 ;
  Xapian::MatchDecider *arg6 = (Xapian::MatchDecider *) 0 ;
  zval **args[6];
  Xapian::MSet result;
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 6 || zend_get_parameters_array_ex(6, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*args[0], (void **) &arg1, SWIGTYPE_p_Xapian__Enquire, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of Enquire_get_mset. Expected SWIGTYPE_p_Xapian__Enquire");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  
  /*@SWIG:/data/home/olly/tmp/xapian-svn-snapshot/tags/1.2.8/xapian/swig/Lib/php/utils.i,7,CONVERT_INT_IN@*/
  convert_to_long_ex(args[1]);
  arg2 = (Xapian::doccount) Z_LVAL_PP(args[1]);
  /*@SWIG@*/;
  
  
  /*@SWIG:/data/home/olly/tmp/xapian-svn-snapshot/tags/1.2.8/xapian/swig/Lib/php/utils.i,7,CONVERT_INT_IN@*/
  convert_to_long_ex(args[2]);
  arg3 = (Xapian::doccount) Z_LVAL_PP(args[2]);
  /*@SWIG@*/;
  
  
  /*@SWIG:/data/home/olly/tmp/xapian-svn-snapshot/tags/1.2.8/xapian/swig/Lib/php/utils.i,7,CONVERT_INT_IN@*/
  convert_to_long_ex(args[3]);
  arg4 = (Xapian::doccount) Z_LVAL_PP(args[3]);
  /*@SWIG@*/;
  
  {
    if(SWIG_ConvertPtr(*args[4], (void **) &arg5, SWIGTYPE_p_Xapian__RSet, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 5 of Enquire_get_mset. Expected SWIGTYPE_p_Xapian__RSet");
    }
  }
  {
    if(SWIG_ConvertPtr(*args[5], (void **) &arg6, SWIGTYPE_p_Xapian__MatchDecider, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 6 of Enquire_get_mset. Expected SWIGTYPE_p_Xapian__MatchDecider");
    }
  }
  {
    try {
      result = ((Xapian::Enquire const *)arg1)->get_mset(arg2,arg3,arg4,(Xapian::RSet const *)arg5,(Xapian::MatchDecider const *)arg6);
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  {
    Xapian::MSet * resultobj = new Xapian::MSet((const Xapian::MSet &) result);
    SWIG_SetPointerZval(return_value, (void *)resultobj, SWIGTYPE_p_Xapian__MSet, 1);
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_Enquire_get_mset__SWIG_2) {
  Xapian::Enquire *arg1 = (Xapian::Enquire *) 0 ;
  Xapian::doccount arg2 ;
  Xapian::doccount arg3 ;
  Xapian::doccount arg4 ;
  Xapian::RSet *arg5 = (Xapian::RSet *) 0 ;
  zval **args[5];
  Xapian::MSet 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_Xapian__Enquire, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of Enquire_get_mset. Expected SWIGTYPE_p_Xapian__Enquire");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  
  /*@SWIG:/data/home/olly/tmp/xapian-svn-snapshot/tags/1.2.8/xapian/swig/Lib/php/utils.i,7,CONVERT_INT_IN@*/
  convert_to_long_ex(args[1]);
  arg2 = (Xapian::doccount) Z_LVAL_PP(args[1]);
  /*@SWIG@*/;
  
  
  /*@SWIG:/data/home/olly/tmp/xapian-svn-snapshot/tags/1.2.8/xapian/swig/Lib/php/utils.i,7,CONVERT_INT_IN@*/
  convert_to_long_ex(args[2]);
  arg3 = (Xapian::doccount) Z_LVAL_PP(args[2]);
  /*@SWIG@*/;
  
  
  /*@SWIG:/data/home/olly/tmp/xapian-svn-snapshot/tags/1.2.8/xapian/swig/Lib/php/utils.i,7,CONVERT_INT_IN@*/
  convert_to_long_ex(args[3]);
  arg4 = (Xapian::doccount) Z_LVAL_PP(args[3]);
  /*@SWIG@*/;
  
  {
    if(SWIG_ConvertPtr(*args[4], (void **) &arg5, SWIGTYPE_p_Xapian__RSet, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 5 of Enquire_get_mset. Expected SWIGTYPE_p_Xapian__RSet");
    }
  }
  {
    try {
      result = ((Xapian::Enquire const *)arg1)->get_mset(arg2,arg3,arg4,(Xapian::RSet const *)arg5);
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  {
    Xapian::MSet * resultobj = new Xapian::MSet((const Xapian::MSet &) result);
    SWIG_SetPointerZval(return_value, (void *)resultobj, SWIGTYPE_p_Xapian__MSet, 1);
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_Enquire_get_mset__SWIG_3) {
  Xapian::Enquire *arg1 = (Xapian::Enquire *) 0 ;
  Xapian::doccount arg2 ;
  Xapian::doccount arg3 ;
  Xapian::doccount arg4 ;
  zval **args[4];
  Xapian::MSet 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_Xapian__Enquire, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of Enquire_get_mset. Expected SWIGTYPE_p_Xapian__Enquire");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  
  /*@SWIG:/data/home/olly/tmp/xapian-svn-snapshot/tags/1.2.8/xapian/swig/Lib/php/utils.i,7,CONVERT_INT_IN@*/
  convert_to_long_ex(args[1]);
  arg2 = (Xapian::doccount) Z_LVAL_PP(args[1]);
  /*@SWIG@*/;
  
  
  /*@SWIG:/data/home/olly/tmp/xapian-svn-snapshot/tags/1.2.8/xapian/swig/Lib/php/utils.i,7,CONVERT_INT_IN@*/
  convert_to_long_ex(args[2]);
  arg3 = (Xapian::doccount) Z_LVAL_PP(args[2]);
  /*@SWIG@*/;
  
  
  /*@SWIG:/data/home/olly/tmp/xapian-svn-snapshot/tags/1.2.8/xapian/swig/Lib/php/utils.i,7,CONVERT_INT_IN@*/
  convert_to_long_ex(args[3]);
  arg4 = (Xapian::doccount) Z_LVAL_PP(args[3]);
  /*@SWIG@*/;
  
  {
    try {
      result = ((Xapian::Enquire const *)arg1)->get_mset(arg2,arg3,arg4);
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  {
    Xapian::MSet * resultobj = new Xapian::MSet((const Xapian::MSet &) result);
    SWIG_SetPointerZval(return_value, (void *)resultobj, SWIGTYPE_p_Xapian__MSet, 1);
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_Enquire_get_mset__SWIG_4) {
  Xapian::Enquire *arg1 = (Xapian::Enquire *) 0 ;
  Xapian::doccount arg2 ;
  Xapian::doccount arg3 ;
  zval **args[3];
  Xapian::MSet 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_Xapian__Enquire, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of Enquire_get_mset. Expected SWIGTYPE_p_Xapian__Enquire");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  
  /*@SWIG:/data/home/olly/tmp/xapian-svn-snapshot/tags/1.2.8/xapian/swig/Lib/php/utils.i,7,CONVERT_INT_IN@*/
  convert_to_long_ex(args[1]);
  arg2 = (Xapian::doccount) Z_LVAL_PP(args[1]);
  /*@SWIG@*/;
  
  
  /*@SWIG:/data/home/olly/tmp/xapian-svn-snapshot/tags/1.2.8/xapian/swig/Lib/php/utils.i,7,CONVERT_INT_IN@*/
  convert_to_long_ex(args[2]);
  arg3 = (Xapian::doccount) Z_LVAL_PP(args[2]);
  /*@SWIG@*/;
  
  {
    try {
      result = ((Xapian::Enquire const *)arg1)->get_mset(arg2,arg3);
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  {
    Xapian::MSet * resultobj = new Xapian::MSet((const Xapian::MSet &) result);
    SWIG_SetPointerZval(return_value, (void *)resultobj, SWIGTYPE_p_Xapian__MSet, 1);
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_Enquire_get_mset__SWIG_5) {
  Xapian::Enquire *arg1 = (Xapian::Enquire *) 0 ;
  Xapian::doccount arg2 ;
  Xapian::doccount arg3 ;
  Xapian::RSet *arg4 = (Xapian::RSet *) 0 ;
  Xapian::MatchDecider *arg5 = (Xapian::MatchDecider *) 0 ;
  zval **args[5];
  Xapian::MSet 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_Xapian__Enquire, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of Enquire_get_mset. Expected SWIGTYPE_p_Xapian__Enquire");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  
  /*@SWIG:/data/home/olly/tmp/xapian-svn-snapshot/tags/1.2.8/xapian/swig/Lib/php/utils.i,7,CONVERT_INT_IN@*/
  convert_to_long_ex(args[1]);
  arg2 = (Xapian::doccount) Z_LVAL_PP(args[1]);
  /*@SWIG@*/;
  
  
  /*@SWIG:/data/home/olly/tmp/xapian-svn-snapshot/tags/1.2.8/xapian/swig/Lib/php/utils.i,7,CONVERT_INT_IN@*/
  convert_to_long_ex(args[2]);
  arg3 = (Xapian::doccount) Z_LVAL_PP(args[2]);
  /*@SWIG@*/;
  
  {
    if(SWIG_ConvertPtr(*args[3], (void **) &arg4, SWIGTYPE_p_Xapian__RSet, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 4 of Enquire_get_mset. Expected SWIGTYPE_p_Xapian__RSet");
    }
  }
  {
    if(SWIG_ConvertPtr(*args[4], (void **) &arg5, SWIGTYPE_p_Xapian__MatchDecider, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 5 of Enquire_get_mset. Expected SWIGTYPE_p_Xapian__MatchDecider");
    }
  }
  {
    try {
      result = ((Xapian::Enquire const *)arg1)->get_mset(arg2,arg3,(Xapian::RSet const *)arg4,(Xapian::MatchDecider const *)arg5);
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  {
    Xapian::MSet * resultobj = new Xapian::MSet((const Xapian::MSet &) result);
    SWIG_SetPointerZval(return_value, (void *)resultobj, SWIGTYPE_p_Xapian__MSet, 1);
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_Enquire_get_mset__SWIG_6) {
  Xapian::Enquire *arg1 = (Xapian::Enquire *) 0 ;
  Xapian::doccount arg2 ;
  Xapian::doccount arg3 ;
  Xapian::RSet *arg4 = (Xapian::RSet *) 0 ;
  zval **args[4];
  Xapian::MSet 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_Xapian__Enquire, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of Enquire_get_mset. Expected SWIGTYPE_p_Xapian__Enquire");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  
  /*@SWIG:/data/home/olly/tmp/xapian-svn-snapshot/tags/1.2.8/xapian/swig/Lib/php/utils.i,7,CONVERT_INT_IN@*/
  convert_to_long_ex(args[1]);
  arg2 = (Xapian::doccount) Z_LVAL_PP(args[1]);
  /*@SWIG@*/;
  
  
  /*@SWIG:/data/home/olly/tmp/xapian-svn-snapshot/tags/1.2.8/xapian/swig/Lib/php/utils.i,7,CONVERT_INT_IN@*/
  convert_to_long_ex(args[2]);
  arg3 = (Xapian::doccount) Z_LVAL_PP(args[2]);
  /*@SWIG@*/;
  
  {
    if(SWIG_ConvertPtr(*args[3], (void **) &arg4, SWIGTYPE_p_Xapian__RSet, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 4 of Enquire_get_mset. Expected SWIGTYPE_p_Xapian__RSet");
    }
  }
  {
    try {
      result = ((Xapian::Enquire const *)arg1)->get_mset(arg2,arg3,(Xapian::RSet const *)arg4);
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  {
    Xapian::MSet * resultobj = new Xapian::MSet((const Xapian::MSet &) result);
    SWIG_SetPointerZval(return_value, (void *)resultobj, SWIGTYPE_p_Xapian__MSet, 1);
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_Enquire_get_mset) {
  int argc;
  zval **argv[7];
  
  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_Xapian__Enquire, 0) >= 0);
    }
    if (_v) {
      _v = (Z_TYPE_PP(argv[1]) == IS_LONG); 
      if (_v) {
        _v = (Z_TYPE_PP(argv[2]) == IS_LONG); 
        if (_v) {
          _wrap_Enquire_get_mset__SWIG_4(INTERNAL_FUNCTION_PARAM_PASSTHRU); return;
        }
      }
    }
  }
  if (argc == 4) {
    int _v;
    {
      void *tmp;
      _v = (SWIG_ConvertPtr(*argv[0], (void**)&tmp, SWIGTYPE_p_Xapian__Enquire, 0) >= 0);
    }
    if (_v) {
      _v = (Z_TYPE_PP(argv[1]) == IS_LONG); 
      if (_v) {
        _v = (Z_TYPE_PP(argv[2]) == IS_LONG); 
        if (_v) {
          {
            void *tmp;
            _v = (SWIG_ConvertPtr(*argv[3], (void**)&tmp, SWIGTYPE_p_Xapian__RSet, 0) >= 0);
          }
          if (_v) {
            _wrap_Enquire_get_mset__SWIG_6(INTERNAL_FUNCTION_PARAM_PASSTHRU); return;
          }
        }
      }
    }
  }
  if (argc == 4) {
    int _v;
    {
      void *tmp;
      _v = (SWIG_ConvertPtr(*argv[0], (void**)&tmp, SWIGTYPE_p_Xapian__Enquire, 0) >= 0);
    }
    if (_v) {
      _v = (Z_TYPE_PP(argv[1]) == IS_LONG); 
      if (_v) {
        _v = (Z_TYPE_PP(argv[2]) == IS_LONG); 
        if (_v) {
          _v = (Z_TYPE_PP(argv[3]) == IS_LONG); 
          if (_v) {
            _wrap_Enquire_get_mset__SWIG_3(INTERNAL_FUNCTION_PARAM_PASSTHRU); return;
          }
        }
      }
    }
  }
  if (argc == 5) {
    int _v;
    {
      void *tmp;
      _v = (SWIG_ConvertPtr(*argv[0], (void**)&tmp, SWIGTYPE_p_Xapian__Enquire, 0) >= 0);
    }
    if (_v) {
      _v = (Z_TYPE_PP(argv[1]) == IS_LONG); 
      if (_v) {
        _v = (Z_TYPE_PP(argv[2]) == IS_LONG); 
        if (_v) {
          {
            void *tmp;
            _v = (SWIG_ConvertPtr(*argv[3], (void**)&tmp, SWIGTYPE_p_Xapian__RSet, 0) >= 0);
          }
          if (_v) {
            {
              void *tmp;
              _v = (SWIG_ConvertPtr(*argv[4], (void**)&tmp, SWIGTYPE_p_Xapian__MatchDecider, 0) >= 0);
            }
            if (_v) {
              _wrap_Enquire_get_mset__SWIG_5(INTERNAL_FUNCTION_PARAM_PASSTHRU); return;
            }
          }
        }
      }
    }
  }
  if (argc == 5) {
    int _v;
    {
      void *tmp;
      _v = (SWIG_ConvertPtr(*argv[0], (void**)&tmp, SWIGTYPE_p_Xapian__Enquire, 0) >= 0);
    }
    if (_v) {
      _v = (Z_TYPE_PP(argv[1]) == IS_LONG); 
      if (_v) {
        _v = (Z_TYPE_PP(argv[2]) == IS_LONG); 
        if (_v) {
          _v = (Z_TYPE_PP(argv[3]) == IS_LONG); 
          if (_v) {
            {
              void *tmp;
              _v = (SWIG_ConvertPtr(*argv[4], (void**)&tmp, SWIGTYPE_p_Xapian__RSet, 0) >= 0);
            }
            if (_v) {
              _wrap_Enquire_get_mset__SWIG_2(INTERNAL_FUNCTION_PARAM_PASSTHRU); return;
            }
          }
        }
      }
    }
  }
  if (argc == 6) {
    int _v;
    {
      void *tmp;
      _v = (SWIG_ConvertPtr(*argv[0], (void**)&tmp, SWIGTYPE_p_Xapian__Enquire, 0) >= 0);
    }
    if (_v) {
      _v = (Z_TYPE_PP(argv[1]) == IS_LONG); 
      if (_v) {
        _v = (Z_TYPE_PP(argv[2]) == IS_LONG); 
        if (_v) {
          _v = (Z_TYPE_PP(argv[3]) == IS_LONG); 
          if (_v) {
            {
              void *tmp;
              _v = (SWIG_ConvertPtr(*argv[4], (void**)&tmp, SWIGTYPE_p_Xapian__RSet, 0) >= 0);
            }
            if (_v) {
              {
                void *tmp;
                _v = (SWIG_ConvertPtr(*argv[5], (void**)&tmp, SWIGTYPE_p_Xapian__MatchDecider, 0) >= 0);
              }
              if (_v) {
                _wrap_Enquire_get_mset__SWIG_1(INTERNAL_FUNCTION_PARAM_PASSTHRU); return;
              }
            }
          }
        }
      }
    }
  }
  if (argc == 7) {
    int _v;
    {
      void *tmp;
      _v = (SWIG_ConvertPtr(*argv[0], (void**)&tmp, SWIGTYPE_p_Xapian__Enquire, 0) >= 0);
    }
    if (_v) {
      _v = (Z_TYPE_PP(argv[1]) == IS_LONG); 
      if (_v) {
        _v = (Z_TYPE_PP(argv[2]) == IS_LONG); 
        if (_v) {
          _v = (Z_TYPE_PP(argv[3]) == IS_LONG); 
          if (_v) {
            {
              void *tmp;
              _v = (SWIG_ConvertPtr(*argv[4], (void**)&tmp, SWIGTYPE_p_Xapian__RSet, 0) >= 0);
            }
            if (_v) {
              {
                void *tmp;
                _v = (SWIG_ConvertPtr(*argv[5], (void**)&tmp, SWIGTYPE_p_Xapian__MatchDecider, 0) >= 0);
              }
              if (_v) {
                {
                  void *tmp;
                  _v = (SWIG_ConvertPtr(*argv[6], (void**)&tmp, SWIGTYPE_p_Xapian__MatchDecider, 0) >= 0);
                }
                if (_v) {
                  _wrap_Enquire_get_mset__SWIG_0(INTERNAL_FUNCTION_PARAM_PASSTHRU); return;
                }
              }
            }
          }
        }
      }
    }
  }
  
  SWIG_ErrorCode() = E_ERROR;
  SWIG_ErrorMsg() = "No matching function for overloaded 'Enquire_get_mset'";
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_Enquire_get_eset__SWIG_0) {
  Xapian::Enquire *arg1 = (Xapian::Enquire *) 0 ;
  Xapian::termcount arg2 ;
  Xapian::RSet *arg3 = 0 ;
  int arg4 ;
  double arg5 ;
  Xapian::ExpandDecider *arg6 = (Xapian::ExpandDecider *) 0 ;
  zval **args[6];
  Xapian::ESet result;
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 6 || zend_get_parameters_array_ex(6, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*args[0], (void **) &arg1, SWIGTYPE_p_Xapian__Enquire, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of Enquire_get_eset. Expected SWIGTYPE_p_Xapian__Enquire");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  
  /*@SWIG:/data/home/olly/tmp/xapian-svn-snapshot/tags/1.2.8/xapian/swig/Lib/php/utils.i,7,CONVERT_INT_IN@*/
  convert_to_long_ex(args[1]);
  arg2 = (Xapian::termcount) Z_LVAL_PP(args[1]);
  /*@SWIG@*/;
  
  {
    if (SWIG_ConvertPtr(*args[2], (void**)&arg3, SWIGTYPE_p_Xapian__RSet, 0) < 0 || arg3 == NULL) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 3 of Enquire_get_eset. Expected SWIGTYPE_p_Xapian__RSet");
    }
  }
  
  /*@SWIG:/data/home/olly/tmp/xapian-svn-snapshot/tags/1.2.8/xapian/swig/Lib/php/utils.i,7,CONVERT_INT_IN@*/
  convert_to_long_ex(args[3]);
  arg4 = (int) Z_LVAL_PP(args[3]);
  /*@SWIG@*/;
  
  
  /*@SWIG:/data/home/olly/tmp/xapian-svn-snapshot/tags/1.2.8/xapian/swig/Lib/php/utils.i,52,CONVERT_FLOAT_IN@*/
  convert_to_double_ex(args[4]);
  arg5 = (double) Z_DVAL_PP(args[4]);
  /*@SWIG@*/;
  
  {
    if(SWIG_ConvertPtr(*args[5], (void **) &arg6, SWIGTYPE_p_Xapian__ExpandDecider, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 6 of Enquire_get_eset. Expected SWIGTYPE_p_Xapian__ExpandDecider");
    }
  }
  {
    try {
      result = ((Xapian::Enquire const *)arg1)->get_eset(arg2,(Xapian::RSet const &)*arg3,arg4,arg5,(Xapian::ExpandDecider const *)arg6);
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  {
    Xapian::ESet * resultobj = new Xapian::ESet((const Xapian::ESet &) result);
    SWIG_SetPointerZval(return_value, (void *)resultobj, SWIGTYPE_p_Xapian__ESet, 1);
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_Enquire_get_eset__SWIG_1) {
  Xapian::Enquire *arg1 = (Xapian::Enquire *) 0 ;
  Xapian::termcount arg2 ;
  Xapian::RSet *arg3 = 0 ;
  int arg4 ;
  double arg5 ;
  zval **args[5];
  Xapian::ESet 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_Xapian__Enquire, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of Enquire_get_eset. Expected SWIGTYPE_p_Xapian__Enquire");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  
  /*@SWIG:/data/home/olly/tmp/xapian-svn-snapshot/tags/1.2.8/xapian/swig/Lib/php/utils.i,7,CONVERT_INT_IN@*/
  convert_to_long_ex(args[1]);
  arg2 = (Xapian::termcount) Z_LVAL_PP(args[1]);
  /*@SWIG@*/;
  
  {
    if (SWIG_ConvertPtr(*args[2], (void**)&arg3, SWIGTYPE_p_Xapian__RSet, 0) < 0 || arg3 == NULL) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 3 of Enquire_get_eset. Expected SWIGTYPE_p_Xapian__RSet");
    }
  }
  
  /*@SWIG:/data/home/olly/tmp/xapian-svn-snapshot/tags/1.2.8/xapian/swig/Lib/php/utils.i,7,CONVERT_INT_IN@*/
  convert_to_long_ex(args[3]);
  arg4 = (int) Z_LVAL_PP(args[3]);
  /*@SWIG@*/;
  
  
  /*@SWIG:/data/home/olly/tmp/xapian-svn-snapshot/tags/1.2.8/xapian/swig/Lib/php/utils.i,52,CONVERT_FLOAT_IN@*/
  convert_to_double_ex(args[4]);
  arg5 = (double) Z_DVAL_PP(args[4]);
  /*@SWIG@*/;
  
  {
    try {
      result = ((Xapian::Enquire const *)arg1)->get_eset(arg2,(Xapian::RSet const &)*arg3,arg4,arg5);
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  {
    Xapian::ESet * resultobj = new Xapian::ESet((const Xapian::ESet &) result);
    SWIG_SetPointerZval(return_value, (void *)resultobj, SWIGTYPE_p_Xapian__ESet, 1);
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_Enquire_get_eset__SWIG_2) {
  Xapian::Enquire *arg1 = (Xapian::Enquire *) 0 ;
  Xapian::termcount arg2 ;
  Xapian::RSet *arg3 = 0 ;
  int arg4 ;
  zval **args[4];
  Xapian::ESet 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_Xapian__Enquire, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of Enquire_get_eset. Expected SWIGTYPE_p_Xapian__Enquire");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  
  /*@SWIG:/data/home/olly/tmp/xapian-svn-snapshot/tags/1.2.8/xapian/swig/Lib/php/utils.i,7,CONVERT_INT_IN@*/
  convert_to_long_ex(args[1]);
  arg2 = (Xapian::termcount) Z_LVAL_PP(args[1]);
  /*@SWIG@*/;
  
  {
    if (SWIG_ConvertPtr(*args[2], (void**)&arg3, SWIGTYPE_p_Xapian__RSet, 0) < 0 || arg3 == NULL) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 3 of Enquire_get_eset. Expected SWIGTYPE_p_Xapian__RSet");
    }
  }
  
  /*@SWIG:/data/home/olly/tmp/xapian-svn-snapshot/tags/1.2.8/xapian/swig/Lib/php/utils.i,7,CONVERT_INT_IN@*/
  convert_to_long_ex(args[3]);
  arg4 = (int) Z_LVAL_PP(args[3]);
  /*@SWIG@*/;
  
  {
    try {
      result = ((Xapian::Enquire const *)arg1)->get_eset(arg2,(Xapian::RSet const &)*arg3,arg4);
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  {
    Xapian::ESet * resultobj = new Xapian::ESet((const Xapian::ESet &) result);
    SWIG_SetPointerZval(return_value, (void *)resultobj, SWIGTYPE_p_Xapian__ESet, 1);
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_Enquire_get_eset__SWIG_3) {
  Xapian::Enquire *arg1 = (Xapian::Enquire *) 0 ;
  Xapian::termcount arg2 ;
  Xapian::RSet *arg3 = 0 ;
  zval **args[3];
  Xapian::ESet 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_Xapian__Enquire, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of Enquire_get_eset. Expected SWIGTYPE_p_Xapian__Enquire");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  
  /*@SWIG:/data/home/olly/tmp/xapian-svn-snapshot/tags/1.2.8/xapian/swig/Lib/php/utils.i,7,CONVERT_INT_IN@*/
  convert_to_long_ex(args[1]);
  arg2 = (Xapian::termcount) Z_LVAL_PP(args[1]);
  /*@SWIG@*/;
  
  {
    if (SWIG_ConvertPtr(*args[2], (void**)&arg3, SWIGTYPE_p_Xapian__RSet, 0) < 0 || arg3 == NULL) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 3 of Enquire_get_eset. Expected SWIGTYPE_p_Xapian__RSet");
    }
  }
  {
    try {
      result = ((Xapian::Enquire const *)arg1)->get_eset(arg2,(Xapian::RSet const &)*arg3);
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  {
    Xapian::ESet * resultobj = new Xapian::ESet((const Xapian::ESet &) result);
    SWIG_SetPointerZval(return_value, (void *)resultobj, SWIGTYPE_p_Xapian__ESet, 1);
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_Enquire_get_eset__SWIG_4) {
  Xapian::Enquire *arg1 = (Xapian::Enquire *) 0 ;
  Xapian::termcount arg2 ;
  Xapian::RSet *arg3 = 0 ;
  int arg4 ;
  double arg5 ;
  Xapian::ExpandDecider *arg6 = (Xapian::ExpandDecider *) 0 ;
  Xapian::weight arg7 ;
  zval **args[7];
  Xapian::ESet 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_Xapian__Enquire, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of Enquire_get_eset. Expected SWIGTYPE_p_Xapian__Enquire");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  
  /*@SWIG:/data/home/olly/tmp/xapian-svn-snapshot/tags/1.2.8/xapian/swig/Lib/php/utils.i,7,CONVERT_INT_IN@*/
  convert_to_long_ex(args[1]);
  arg2 = (Xapian::termcount) Z_LVAL_PP(args[1]);
  /*@SWIG@*/;
  
  {
    if (SWIG_ConvertPtr(*args[2], (void**)&arg3, SWIGTYPE_p_Xapian__RSet, 0) < 0 || arg3 == NULL) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 3 of Enquire_get_eset. Expected SWIGTYPE_p_Xapian__RSet");
    }
  }
  
  /*@SWIG:/data/home/olly/tmp/xapian-svn-snapshot/tags/1.2.8/xapian/swig/Lib/php/utils.i,7,CONVERT_INT_IN@*/
  convert_to_long_ex(args[3]);
  arg4 = (int) Z_LVAL_PP(args[3]);
  /*@SWIG@*/;
  
  
  /*@SWIG:/data/home/olly/tmp/xapian-svn-snapshot/tags/1.2.8/xapian/swig/Lib/php/utils.i,52,CONVERT_FLOAT_IN@*/
  convert_to_double_ex(args[4]);
  arg5 = (double) Z_DVAL_PP(args[4]);
  /*@SWIG@*/;
  
  {
    if(SWIG_ConvertPtr(*args[5], (void **) &arg6, SWIGTYPE_p_Xapian__ExpandDecider, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 6 of Enquire_get_eset. Expected SWIGTYPE_p_Xapian__ExpandDecider");
    }
  }
  
  /*@SWIG:/data/home/olly/tmp/xapian-svn-snapshot/tags/1.2.8/xapian/swig/Lib/php/utils.i,52,CONVERT_FLOAT_IN@*/
  convert_to_double_ex(args[6]);
  arg7 = (Xapian::weight) Z_DVAL_PP(args[6]);
  /*@SWIG@*/;
  
  {
    try {
      result = ((Xapian::Enquire const *)arg1)->get_eset(arg2,(Xapian::RSet const &)*arg3,arg4,arg5,(Xapian::ExpandDecider const *)arg6,arg7);
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  {
    Xapian::ESet * resultobj = new Xapian::ESet((const Xapian::ESet &) result);
    SWIG_SetPointerZval(return_value, (void *)resultobj, SWIGTYPE_p_Xapian__ESet, 1);
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_Enquire_get_eset__SWIG_5) {
  Xapian::Enquire *arg1 = (Xapian::Enquire *) 0 ;
  Xapian::termcount arg2 ;
  Xapian::RSet *arg3 = 0 ;
  Xapian::ExpandDecider *arg4 = (Xapian::ExpandDecider *) 0 ;
  zval **args[4];
  Xapian::ESet 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_Xapian__Enquire, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of Enquire_get_eset. Expected SWIGTYPE_p_Xapian__Enquire");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  
  /*@SWIG:/data/home/olly/tmp/xapian-svn-snapshot/tags/1.2.8/xapian/swig/Lib/php/utils.i,7,CONVERT_INT_IN@*/
  convert_to_long_ex(args[1]);
  arg2 = (Xapian::termcount) Z_LVAL_PP(args[1]);
  /*@SWIG@*/;
  
  {
    if (SWIG_ConvertPtr(*args[2], (void**)&arg3, SWIGTYPE_p_Xapian__RSet, 0) < 0 || arg3 == NULL) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 3 of Enquire_get_eset. Expected SWIGTYPE_p_Xapian__RSet");
    }
  }
  {
    if(SWIG_ConvertPtr(*args[3], (void **) &arg4, SWIGTYPE_p_Xapian__ExpandDecider, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 4 of Enquire_get_eset. Expected SWIGTYPE_p_Xapian__ExpandDecider");
    }
  }
  {
    try {
      result = ((Xapian::Enquire const *)arg1)->get_eset(arg2,(Xapian::RSet const &)*arg3,(Xapian::ExpandDecider const *)arg4);
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  {
    Xapian::ESet * resultobj = new Xapian::ESet((const Xapian::ESet &) result);
    SWIG_SetPointerZval(return_value, (void *)resultobj, SWIGTYPE_p_Xapian__ESet, 1);
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_Enquire_get_eset) {
  int argc;
  zval **argv[7];
  
  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_Xapian__Enquire, 0) >= 0);
    }
    if (_v) {
      _v = (Z_TYPE_PP(argv[1]) == IS_LONG); 
      if (_v) {
        {
          void *ptr;
          _v = (SWIG_ConvertPtr(*argv[2], (void **)&ptr, SWIGTYPE_p_Xapian__RSet, 0) == 0);
        }
        if (_v) {
          _wrap_Enquire_get_eset__SWIG_3(INTERNAL_FUNCTION_PARAM_PASSTHRU); return;
        }
      }
    }
  }
  if (argc == 4) {
    int _v;
    {
      void *tmp;
      _v = (SWIG_ConvertPtr(*argv[0], (void**)&tmp, SWIGTYPE_p_Xapian__Enquire, 0) >= 0);
    }
    if (_v) {
      _v = (Z_TYPE_PP(argv[1]) == IS_LONG); 
      if (_v) {
        {
          void *ptr;
          _v = (SWIG_ConvertPtr(*argv[2], (void **)&ptr, SWIGTYPE_p_Xapian__RSet, 0) == 0);
        }
        if (_v) {
          {
            void *tmp;
            _v = (SWIG_ConvertPtr(*argv[3], (void**)&tmp, SWIGTYPE_p_Xapian__ExpandDecider, 0) >= 0);
          }
          if (_v) {
            _wrap_Enquire_get_eset__SWIG_5(INTERNAL_FUNCTION_PARAM_PASSTHRU); return;
          }
        }
      }
    }
  }
  if (argc == 4) {
    int _v;
    {
      void *tmp;
      _v = (SWIG_ConvertPtr(*argv[0], (void**)&tmp, SWIGTYPE_p_Xapian__Enquire, 0) >= 0);
    }
    if (_v) {
      _v = (Z_TYPE_PP(argv[1]) == IS_LONG); 
      if (_v) {
        {
          void *ptr;
          _v = (SWIG_ConvertPtr(*argv[2], (void **)&ptr, SWIGTYPE_p_Xapian__RSet, 0) == 0);
        }
        if (_v) {
          _v = (Z_TYPE_PP(argv[3]) == IS_LONG); 
          if (_v) {
            _wrap_Enquire_get_eset__SWIG_2(INTERNAL_FUNCTION_PARAM_PASSTHRU); return;
          }
        }
      }
    }
  }
  if (argc == 5) {
    int _v;
    {
      void *tmp;
      _v = (SWIG_ConvertPtr(*argv[0], (void**)&tmp, SWIGTYPE_p_Xapian__Enquire, 0) >= 0);
    }
    if (_v) {
      _v = (Z_TYPE_PP(argv[1]) == IS_LONG); 
      if (_v) {
        {
          void *ptr;
          _v = (SWIG_ConvertPtr(*argv[2], (void **)&ptr, SWIGTYPE_p_Xapian__RSet, 0) == 0);
        }
        if (_v) {
          _v = (Z_TYPE_PP(argv[3]) == IS_LONG); 
          if (_v) {
            _v = (Z_TYPE_PP(argv[4]) == IS_DOUBLE); 
            if (_v) {
              _wrap_Enquire_get_eset__SWIG_1(INTERNAL_FUNCTION_PARAM_PASSTHRU); return;
            }
          }
        }
      }
    }
  }
  if (argc == 6) {
    int _v;
    {
      void *tmp;
      _v = (SWIG_ConvertPtr(*argv[0], (void**)&tmp, SWIGTYPE_p_Xapian__Enquire, 0) >= 0);
    }
    if (_v) {
      _v = (Z_TYPE_PP(argv[1]) == IS_LONG); 
      if (_v) {
        {
          void *ptr;
          _v = (SWIG_ConvertPtr(*argv[2], (void **)&ptr, SWIGTYPE_p_Xapian__RSet, 0) == 0);
        }
        if (_v) {
          _v = (Z_TYPE_PP(argv[3]) == IS_LONG); 
          if (_v) {
            _v = (Z_TYPE_PP(argv[4]) == IS_DOUBLE); 
            if (_v) {
              {
                void *tmp;
                _v = (SWIG_ConvertPtr(*argv[5], (void**)&tmp, SWIGTYPE_p_Xapian__ExpandDecider, 0) >= 0);
              }
              if (_v) {
                _wrap_Enquire_get_eset__SWIG_0(INTERNAL_FUNCTION_PARAM_PASSTHRU); return;
              }
            }
          }
        }
      }
    }
  }
  if (argc == 7) {
    int _v;
    {
      void *tmp;
      _v = (SWIG_ConvertPtr(*argv[0], (void**)&tmp, SWIGTYPE_p_Xapian__Enquire, 0) >= 0);
    }
    if (_v) {
      _v = (Z_TYPE_PP(argv[1]) == IS_LONG); 
      if (_v) {
        {
          void *ptr;
          _v = (SWIG_ConvertPtr(*argv[2], (void **)&ptr, SWIGTYPE_p_Xapian__RSet, 0) == 0);
        }
        if (_v) {
          _v = (Z_TYPE_PP(argv[3]) == IS_LONG); 
          if (_v) {
            _v = (Z_TYPE_PP(argv[4]) == IS_DOUBLE); 
            if (_v) {
              {
                void *tmp;
                _v = (SWIG_ConvertPtr(*argv[5], (void**)&tmp, SWIGTYPE_p_Xapian__ExpandDecider, 0) >= 0);
              }
              if (_v) {
                _v = (Z_TYPE_PP(argv[6]) == IS_DOUBLE); 
                if (_v) {
                  _wrap_Enquire_get_eset__SWIG_4(INTERNAL_FUNCTION_PARAM_PASSTHRU); return;
                }
              }
            }
          }
        }
      }
    }
  }
  
  SWIG_ErrorCode() = E_ERROR;
  SWIG_ErrorMsg() = "No matching function for overloaded 'Enquire_get_eset'";
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_Enquire_get_matching_terms_begin__SWIG_0) {
  Xapian::Enquire *arg1 = (Xapian::Enquire *) 0 ;
  Xapian::docid arg2 ;
  zval **args[2];
  Xapian::TermIterator 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_Xapian__Enquire, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of Enquire_get_matching_terms_begin. Expected SWIGTYPE_p_Xapian__Enquire");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  
  /*@SWIG:/data/home/olly/tmp/xapian-svn-snapshot/tags/1.2.8/xapian/swig/Lib/php/utils.i,7,CONVERT_INT_IN@*/
  convert_to_long_ex(args[1]);
  arg2 = (Xapian::docid) Z_LVAL_PP(args[1]);
  /*@SWIG@*/;
  
  {
    try {
      result = ((Xapian::Enquire const *)arg1)->get_matching_terms_begin(arg2);
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  {
    Xapian::TermIterator * resultobj = new Xapian::TermIterator((const Xapian::TermIterator &) result);
    SWIG_SetPointerZval(return_value, (void *)resultobj, SWIGTYPE_p_Xapian__TermIterator, 1);
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_Enquire_get_matching_terms_end__SWIG_0) {
  Xapian::Enquire *arg1 = (Xapian::Enquire *) 0 ;
  Xapian::docid arg2 ;
  zval **args[2];
  Xapian::TermIterator 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_Xapian__Enquire, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of Enquire_get_matching_terms_end. Expected SWIGTYPE_p_Xapian__Enquire");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  
  /*@SWIG:/data/home/olly/tmp/xapian-svn-snapshot/tags/1.2.8/xapian/swig/Lib/php/utils.i,7,CONVERT_INT_IN@*/
  convert_to_long_ex(args[1]);
  arg2 = (Xapian::docid) Z_LVAL_PP(args[1]);
  /*@SWIG@*/;
  
  {
    try {
      result = ((Xapian::Enquire const *)arg1)->get_matching_terms_end(arg2);
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  {
    Xapian::TermIterator * resultobj = new Xapian::TermIterator((const Xapian::TermIterator &) result);
    SWIG_SetPointerZval(return_value, (void *)resultobj, SWIGTYPE_p_Xapian__TermIterator, 1);
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_Enquire_get_matching_terms_begin__SWIG_1) {
  Xapian::Enquire *arg1 = (Xapian::Enquire *) 0 ;
  Xapian::MSetIterator *arg2 = 0 ;
  zval **args[2];
  Xapian::TermIterator 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_Xapian__Enquire, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of Enquire_get_matching_terms_begin. Expected SWIGTYPE_p_Xapian__Enquire");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    if (SWIG_ConvertPtr(*args[1], (void**)&arg2, SWIGTYPE_p_Xapian__MSetIterator, 0) < 0 || arg2 == NULL) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 2 of Enquire_get_matching_terms_begin. Expected SWIGTYPE_p_Xapian__MSetIterator");
    }
  }
  {
    try {
      result = ((Xapian::Enquire const *)arg1)->get_matching_terms_begin((Xapian::MSetIterator const &)*arg2);
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  {
    Xapian::TermIterator * resultobj = new Xapian::TermIterator((const Xapian::TermIterator &) result);
    SWIG_SetPointerZval(return_value, (void *)resultobj, SWIGTYPE_p_Xapian__TermIterator, 1);
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_Enquire_get_matching_terms_begin) {
  int argc;
  zval **argv[2];
  
  argc = ZEND_NUM_ARGS();
  zend_get_parameters_array_ex(argc,argv);
  if (argc == 2) {
    int _v;
    {
      void *tmp;
      _v = (SWIG_ConvertPtr(*argv[0], (void**)&tmp, SWIGTYPE_p_Xapian__Enquire, 0) >= 0);
    }
    if (_v) {
      {
        void *ptr;
        _v = (SWIG_ConvertPtr(*argv[1], (void **)&ptr, SWIGTYPE_p_Xapian__MSetIterator, 0) == 0);
      }
      if (_v) {
        _wrap_Enquire_get_matching_terms_begin__SWIG_1(INTERNAL_FUNCTION_PARAM_PASSTHRU); return;
      }
    }
  }
  if (argc == 2) {
    int _v;
    {
      void *tmp;
      _v = (SWIG_ConvertPtr(*argv[0], (void**)&tmp, SWIGTYPE_p_Xapian__Enquire, 0) >= 0);
    }
    if (_v) {
      _v = (Z_TYPE_PP(argv[1]) == IS_LONG); 
      if (_v) {
        _wrap_Enquire_get_matching_terms_begin__SWIG_0(INTERNAL_FUNCTION_PARAM_PASSTHRU); return;
      }
    }
  }
  
  SWIG_ErrorCode() = E_ERROR;
  SWIG_ErrorMsg() = "No matching function for overloaded 'Enquire_get_matching_terms_begin'";
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_Enquire_get_matching_terms_end__SWIG_1) {
  Xapian::Enquire *arg1 = (Xapian::Enquire *) 0 ;
  Xapian::MSetIterator *arg2 = 0 ;
  zval **args[2];
  Xapian::TermIterator 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_Xapian__Enquire, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of Enquire_get_matching_terms_end. Expected SWIGTYPE_p_Xapian__Enquire");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    if (SWIG_ConvertPtr(*args[1], (void**)&arg2, SWIGTYPE_p_Xapian__MSetIterator, 0) < 0 || arg2 == NULL) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 2 of Enquire_get_matching_terms_end. Expected SWIGTYPE_p_Xapian__MSetIterator");
    }
  }
  {
    try {
      result = ((Xapian::Enquire const *)arg1)->get_matching_terms_end((Xapian::MSetIterator const &)*arg2);
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  {
    Xapian::TermIterator * resultobj = new Xapian::TermIterator((const Xapian::TermIterator &) result);
    SWIG_SetPointerZval(return_value, (void *)resultobj, SWIGTYPE_p_Xapian__TermIterator, 1);
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_Enquire_get_matching_terms_end) {
  int argc;
  zval **argv[2];
  
  argc = ZEND_NUM_ARGS();
  zend_get_parameters_array_ex(argc,argv);
  if (argc == 2) {
    int _v;
    {
      void *tmp;
      _v = (SWIG_ConvertPtr(*argv[0], (void**)&tmp, SWIGTYPE_p_Xapian__Enquire, 0) >= 0);
    }
    if (_v) {
      {
        void *ptr;
        _v = (SWIG_ConvertPtr(*argv[1], (void **)&ptr, SWIGTYPE_p_Xapian__MSetIterator, 0) == 0);
      }
      if (_v) {
        _wrap_Enquire_get_matching_terms_end__SWIG_1(INTERNAL_FUNCTION_PARAM_PASSTHRU); return;
      }
    }
  }
  if (argc == 2) {
    int _v;
    {
      void *tmp;
      _v = (SWIG_ConvertPtr(*argv[0], (void**)&tmp, SWIGTYPE_p_Xapian__Enquire, 0) >= 0);
    }
    if (_v) {
      _v = (Z_TYPE_PP(argv[1]) == IS_LONG); 
      if (_v) {
        _wrap_Enquire_get_matching_terms_end__SWIG_0(INTERNAL_FUNCTION_PARAM_PASSTHRU); return;
      }
    }
  }
  
  SWIG_ErrorCode() = E_ERROR;
  SWIG_ErrorMsg() = "No matching function for overloaded 'Enquire_get_matching_terms_end'";
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_Enquire_get_matching_terms) {
  Xapian::Enquire *arg1 = (Xapian::Enquire *) 0 ;
  Xapian::MSetIterator *arg2 = 0 ;
  zval **args[2];
  std::pair< Xapian::TermIterator,Xapian::TermIterator > 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_Xapian__Enquire, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of Enquire_get_matching_terms. Expected SWIGTYPE_p_Xapian__Enquire");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    if (SWIG_ConvertPtr(*args[1], (void**)&arg2, SWIGTYPE_p_Xapian__MSetIterator, 0) < 0 || arg2 == NULL) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 2 of Enquire_get_matching_terms. Expected SWIGTYPE_p_Xapian__MSetIterator");
    }
  }
  {
    try {
      result = Xapian_Enquire_get_matching_terms((Xapian::Enquire const *)arg1,(Xapian::MSetIterator const &)*arg2);
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  {
    if (array_init(return_value) == FAILURE) {
      SWIG_PHP_Error(E_ERROR, "array_init failed");
    }
    
    for (Xapian::TermIterator i = (&result)->first; i != (&result)->second; ++i) {
      /* We have to cast away const here because the PHP API is rather
      	 * poorly thought out - really there should be two API methods
      	 * one of which takes a const char * and copies the string and
      	 * the other which takes char * and takes ownership of the string.
      	 *
      	 * Passing 1 as the last parameter of add_next_index_stringl() tells
      	 * PHP to copy the string pointed to by p, so it won't be modified.
      	 */
      const string & term = *i;
      char *p = const_cast<char*>(term.data());
      add_next_index_stringl(return_value, p, term.length(), 1);
    }
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_Enquire_get_description) {
  Xapian::Enquire *arg1 = (Xapian::Enquire *) 0 ;
  zval **args[1];
  std::string 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_Xapian__Enquire, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of Enquire_get_description. Expected SWIGTYPE_p_Xapian__Enquire");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    try {
      result = ((Xapian::Enquire const *)arg1)->get_description();
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  
  ZVAL_STRINGL(return_value, const_cast<char*>((&result)->data()), (&result)->size(), 1);
  
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_new_Registry__SWIG_0) {
  Xapian::Registry *arg1 = 0 ;
  zval **args[1];
  Xapian::Registry *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_Xapian__Registry, 0) < 0 || arg1 == NULL) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of new_Registry. Expected SWIGTYPE_p_Xapian__Registry");
    }
  }
  {
    try {
      result = (Xapian::Registry *)new Xapian::Registry((Xapian::Registry const &)*arg1);
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  
  SWIG_SetPointerZval(return_value, (void *)result, SWIGTYPE_p_Xapian__Registry, 1);
  
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_new_Registry__SWIG_1) {
  Xapian::Registry *result = 0 ;
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 0) {
    WRONG_PARAM_COUNT;
  }
  
  {
    try {
      result = (Xapian::Registry *)new Xapian::Registry();
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  
  SWIG_SetPointerZval(return_value, (void *)result, SWIGTYPE_p_Xapian__Registry, 1);
  
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_new_Registry) {
  int argc;
  zval **argv[1];
  
  argc = ZEND_NUM_ARGS();
  zend_get_parameters_array_ex(argc,argv);
  if (argc == 0) {
    _wrap_new_Registry__SWIG_1(INTERNAL_FUNCTION_PARAM_PASSTHRU); return;
  }
  if (argc == 1) {
    int _v;
    {
      void *ptr;
      _v = (SWIG_ConvertPtr(*argv[0], (void **)&ptr, SWIGTYPE_p_Xapian__Registry, 0) == 0);
    }
    if (_v) {
      _wrap_new_Registry__SWIG_0(INTERNAL_FUNCTION_PARAM_PASSTHRU); return;
    }
  }
  
  SWIG_ErrorCode() = E_ERROR;
  SWIG_ErrorMsg() = "No matching function for overloaded 'new_Registry'";
  zend_error(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_Registry(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 ;
  Xapian::Registry *arg1 = (Xapian::Registry *) 0 ;
  
  efree(value);
  if (! newobject) return; /* can't delete it! */
  arg1 = (Xapian::Registry *)SWIG_ZTS_ConvertResourceData(ptr,type_name,SWIGTYPE_p_Xapian__Registry TSRMLS_CC);
  if (! arg1) zend_error(E_ERROR, "Xapian::Registry resource already free'd");
  {
    try {
      delete arg1;
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_Registry_register_weighting_scheme) {
  Xapian::Registry *arg1 = (Xapian::Registry *) 0 ;
  Xapian::Weight *arg2 = 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_Xapian__Registry, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of Registry_register_weighting_scheme. Expected SWIGTYPE_p_Xapian__Registry");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    if (SWIG_ConvertPtr(*args[1], (void**)&arg2, SWIGTYPE_p_Xapian__Weight, 0) < 0 || arg2 == NULL) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 2 of Registry_register_weighting_scheme. Expected SWIGTYPE_p_Xapian__Weight");
    }
  }
  {
    try {
      (arg1)->register_weighting_scheme((Xapian::Weight const &)*arg2);
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_Registry_get_weighting_scheme) {
  Xapian::Registry *arg1 = (Xapian::Registry *) 0 ;
  std::string *arg2 = 0 ;
  std::string temp2 ;
  zval **args[2];
  Xapian::Weight *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_Xapian__Registry, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of Registry_get_weighting_scheme. Expected SWIGTYPE_p_Xapian__Registry");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  
  convert_to_string_ex(args[1]);
  temp2.assign(Z_STRVAL_PP(args[1]), Z_STRLEN_PP(args[1]));
  arg2 = &temp2;
  
  {
    try {
      result = (Xapian::Weight *)((Xapian::Registry const *)arg1)->get_weighting_scheme((std::string const &)*arg2);
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  
  SWIG_SetPointerZval(return_value, (void *)result, SWIGTYPE_p_Xapian__Weight, 0);
  
  
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_Registry_register_posting_source) {
  Xapian::Registry *arg1 = (Xapian::Registry *) 0 ;
  Xapian::PostingSource *arg2 = 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_Xapian__Registry, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of Registry_register_posting_source. Expected SWIGTYPE_p_Xapian__Registry");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    if (SWIG_ConvertPtr(*args[1], (void**)&arg2, SWIGTYPE_p_Xapian__PostingSource, 0) < 0 || arg2 == NULL) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 2 of Registry_register_posting_source. Expected SWIGTYPE_p_Xapian__PostingSource");
    }
  }
  {
    try {
      (arg1)->register_posting_source((Xapian::PostingSource const &)*arg2);
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_Registry_get_posting_source) {
  Xapian::Registry *arg1 = (Xapian::Registry *) 0 ;
  std::string *arg2 = 0 ;
  std::string temp2 ;
  zval **args[2];
  Xapian::PostingSource *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_Xapian__Registry, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of Registry_get_posting_source. Expected SWIGTYPE_p_Xapian__Registry");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  
  convert_to_string_ex(args[1]);
  temp2.assign(Z_STRVAL_PP(args[1]), Z_STRLEN_PP(args[1]));
  arg2 = &temp2;
  
  {
    try {
      result = (Xapian::PostingSource *)((Xapian::Registry const *)arg1)->get_posting_source((std::string const &)*arg2);
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  
  SWIG_SetPointerZval(return_value, (void *)result, SWIGTYPE_p_Xapian__PostingSource, 0);
  
  
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_Registry_register_match_spy) {
  Xapian::Registry *arg1 = (Xapian::Registry *) 0 ;
  Xapian::MatchSpy *arg2 = 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_Xapian__Registry, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of Registry_register_match_spy. Expected SWIGTYPE_p_Xapian__Registry");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    if (SWIG_ConvertPtr(*args[1], (void**)&arg2, SWIGTYPE_p_Xapian__MatchSpy, 0) < 0 || arg2 == NULL) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 2 of Registry_register_match_spy. Expected SWIGTYPE_p_Xapian__MatchSpy");
    }
  }
  {
    try {
      (arg1)->register_match_spy((Xapian::MatchSpy const &)*arg2);
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_Registry_get_match_spy) {
  Xapian::Registry *arg1 = (Xapian::Registry *) 0 ;
  std::string *arg2 = 0 ;
  std::string temp2 ;
  zval **args[2];
  Xapian::MatchSpy *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_Xapian__Registry, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of Registry_get_match_spy. Expected SWIGTYPE_p_Xapian__Registry");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  
  convert_to_string_ex(args[1]);
  temp2.assign(Z_STRVAL_PP(args[1]), Z_STRLEN_PP(args[1]));
  arg2 = &temp2;
  
  {
    try {
      result = (Xapian::MatchSpy *)((Xapian::Registry const *)arg1)->get_match_spy((std::string const &)*arg2);
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  
  SWIG_SetPointerZval(return_value, (void *)result, SWIGTYPE_p_Xapian__MatchSpy, 0);
  
  
  return;
fail:
  zend_error(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_Weight(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 ;
  Xapian::Weight *arg1 = (Xapian::Weight *) 0 ;
  
  efree(value);
  if (! newobject) return; /* can't delete it! */
  arg1 = (Xapian::Weight *)SWIG_ZTS_ConvertResourceData(ptr,type_name,SWIGTYPE_p_Xapian__Weight TSRMLS_CC);
  if (! arg1) zend_error(E_ERROR, "Xapian::Weight resource already free'd");
  {
    try {
      delete arg1;
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_Weight_name) {
  Xapian::Weight *arg1 = (Xapian::Weight *) 0 ;
  zval **args[1];
  std::string 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_Xapian__Weight, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of Weight_name. Expected SWIGTYPE_p_Xapian__Weight");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    try {
      result = ((Xapian::Weight const *)arg1)->name();
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  
  ZVAL_STRINGL(return_value, const_cast<char*>((&result)->data()), (&result)->size(), 1);
  
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_Weight_get_sumpart) {
  Xapian::Weight *arg1 = (Xapian::Weight *) 0 ;
  Xapian::termcount arg2 ;
  Xapian::termcount arg3 ;
  zval **args[3];
  Xapian::weight 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_Xapian__Weight, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of Weight_get_sumpart. Expected SWIGTYPE_p_Xapian__Weight");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  
  /*@SWIG:/data/home/olly/tmp/xapian-svn-snapshot/tags/1.2.8/xapian/swig/Lib/php/utils.i,7,CONVERT_INT_IN@*/
  convert_to_long_ex(args[1]);
  arg2 = (Xapian::termcount) Z_LVAL_PP(args[1]);
  /*@SWIG@*/;
  
  
  /*@SWIG:/data/home/olly/tmp/xapian-svn-snapshot/tags/1.2.8/xapian/swig/Lib/php/utils.i,7,CONVERT_INT_IN@*/
  convert_to_long_ex(args[2]);
  arg3 = (Xapian::termcount) Z_LVAL_PP(args[2]);
  /*@SWIG@*/;
  
  {
    try {
      result = (Xapian::weight)((Xapian::Weight const *)arg1)->get_sumpart(arg2,arg3);
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  {
    ZVAL_DOUBLE(return_value,result);
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_Weight_get_maxpart) {
  Xapian::Weight *arg1 = (Xapian::Weight *) 0 ;
  zval **args[1];
  Xapian::weight 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_Xapian__Weight, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of Weight_get_maxpart. Expected SWIGTYPE_p_Xapian__Weight");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    try {
      result = (Xapian::weight)((Xapian::Weight const *)arg1)->get_maxpart();
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  {
    ZVAL_DOUBLE(return_value,result);
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_Weight_get_sumextra) {
  Xapian::Weight *arg1 = (Xapian::Weight *) 0 ;
  Xapian::termcount arg2 ;
  zval **args[2];
  Xapian::weight 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_Xapian__Weight, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of Weight_get_sumextra. Expected SWIGTYPE_p_Xapian__Weight");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  
  /*@SWIG:/data/home/olly/tmp/xapian-svn-snapshot/tags/1.2.8/xapian/swig/Lib/php/utils.i,7,CONVERT_INT_IN@*/
  convert_to_long_ex(args[1]);
  arg2 = (Xapian::termcount) Z_LVAL_PP(args[1]);
  /*@SWIG@*/;
  
  {
    try {
      result = (Xapian::weight)((Xapian::Weight const *)arg1)->get_sumextra(arg2);
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  {
    ZVAL_DOUBLE(return_value,result);
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_Weight_get_maxextra) {
  Xapian::Weight *arg1 = (Xapian::Weight *) 0 ;
  zval **args[1];
  Xapian::weight 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_Xapian__Weight, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of Weight_get_maxextra. Expected SWIGTYPE_p_Xapian__Weight");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    try {
      result = (Xapian::weight)((Xapian::Weight const *)arg1)->get_maxextra();
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  {
    ZVAL_DOUBLE(return_value,result);
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_Weight_get_sumpart_needs_doclength_) {
  Xapian::Weight *arg1 = (Xapian::Weight *) 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_Xapian__Weight, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of Weight_get_sumpart_needs_doclength_. Expected SWIGTYPE_p_Xapian__Weight");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    try {
      result = (bool)((Xapian::Weight const *)arg1)->get_sumpart_needs_doclength_();
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  {
    ZVAL_BOOL(return_value,(result)?1:0);
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_Weight_get_sumpart_needs_wdf_) {
  Xapian::Weight *arg1 = (Xapian::Weight *) 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_Xapian__Weight, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of Weight_get_sumpart_needs_wdf_. Expected SWIGTYPE_p_Xapian__Weight");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    try {
      result = (bool)((Xapian::Weight const *)arg1)->get_sumpart_needs_wdf_();
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  {
    ZVAL_BOOL(return_value,(result)?1:0);
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_new_BoolWeight) {
  Xapian::BoolWeight *result = 0 ;
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 0) {
    WRONG_PARAM_COUNT;
  }
  
  {
    try {
      result = (Xapian::BoolWeight *)new Xapian::BoolWeight();
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  
  SWIG_SetPointerZval(return_value, (void *)result, SWIGTYPE_p_Xapian__BoolWeight, 1);
  
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_BoolWeight_name) {
  Xapian::BoolWeight *arg1 = (Xapian::BoolWeight *) 0 ;
  zval **args[1];
  std::string 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_Xapian__BoolWeight, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of BoolWeight_name. Expected SWIGTYPE_p_Xapian__BoolWeight");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    try {
      result = ((Xapian::BoolWeight const *)arg1)->name();
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  
  ZVAL_STRINGL(return_value, const_cast<char*>((&result)->data()), (&result)->size(), 1);
  
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_BoolWeight_serialise) {
  Xapian::BoolWeight *arg1 = (Xapian::BoolWeight *) 0 ;
  zval **args[1];
  std::string 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_Xapian__BoolWeight, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of BoolWeight_serialise. Expected SWIGTYPE_p_Xapian__BoolWeight");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    try {
      result = ((Xapian::BoolWeight const *)arg1)->serialise();
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  
  ZVAL_STRINGL(return_value, const_cast<char*>((&result)->data()), (&result)->size(), 1);
  
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_BoolWeight_unserialise) {
  Xapian::BoolWeight *arg1 = (Xapian::BoolWeight *) 0 ;
  std::string *arg2 = 0 ;
  std::string temp2 ;
  zval **args[2];
  Xapian::BoolWeight *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_Xapian__BoolWeight, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of BoolWeight_unserialise. Expected SWIGTYPE_p_Xapian__BoolWeight");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  
  convert_to_string_ex(args[1]);
  temp2.assign(Z_STRVAL_PP(args[1]), Z_STRLEN_PP(args[1]));
  arg2 = &temp2;
  
  {
    try {
      result = (Xapian::BoolWeight *)((Xapian::BoolWeight const *)arg1)->unserialise((std::string const &)*arg2);
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  
  SWIG_SetPointerZval(return_value, (void *)result, SWIGTYPE_p_Xapian__BoolWeight, 0);
  
  
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_BoolWeight_get_sumpart) {
  Xapian::BoolWeight *arg1 = (Xapian::BoolWeight *) 0 ;
  Xapian::termcount arg2 ;
  Xapian::termcount arg3 ;
  zval **args[3];
  Xapian::weight 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_Xapian__BoolWeight, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of BoolWeight_get_sumpart. Expected SWIGTYPE_p_Xapian__BoolWeight");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  
  /*@SWIG:/data/home/olly/tmp/xapian-svn-snapshot/tags/1.2.8/xapian/swig/Lib/php/utils.i,7,CONVERT_INT_IN@*/
  convert_to_long_ex(args[1]);
  arg2 = (Xapian::termcount) Z_LVAL_PP(args[1]);
  /*@SWIG@*/;
  
  
  /*@SWIG:/data/home/olly/tmp/xapian-svn-snapshot/tags/1.2.8/xapian/swig/Lib/php/utils.i,7,CONVERT_INT_IN@*/
  convert_to_long_ex(args[2]);
  arg3 = (Xapian::termcount) Z_LVAL_PP(args[2]);
  /*@SWIG@*/;
  
  {
    try {
      result = (Xapian::weight)((Xapian::BoolWeight const *)arg1)->get_sumpart(arg2,arg3);
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  {
    ZVAL_DOUBLE(return_value,result);
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_BoolWeight_get_maxpart) {
  Xapian::BoolWeight *arg1 = (Xapian::BoolWeight *) 0 ;
  zval **args[1];
  Xapian::weight 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_Xapian__BoolWeight, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of BoolWeight_get_maxpart. Expected SWIGTYPE_p_Xapian__BoolWeight");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    try {
      result = (Xapian::weight)((Xapian::BoolWeight const *)arg1)->get_maxpart();
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  {
    ZVAL_DOUBLE(return_value,result);
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_BoolWeight_get_sumextra) {
  Xapian::BoolWeight *arg1 = (Xapian::BoolWeight *) 0 ;
  Xapian::termcount arg2 ;
  zval **args[2];
  Xapian::weight 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_Xapian__BoolWeight, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of BoolWeight_get_sumextra. Expected SWIGTYPE_p_Xapian__BoolWeight");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  
  /*@SWIG:/data/home/olly/tmp/xapian-svn-snapshot/tags/1.2.8/xapian/swig/Lib/php/utils.i,7,CONVERT_INT_IN@*/
  convert_to_long_ex(args[1]);
  arg2 = (Xapian::termcount) Z_LVAL_PP(args[1]);
  /*@SWIG@*/;
  
  {
    try {
      result = (Xapian::weight)((Xapian::BoolWeight const *)arg1)->get_sumextra(arg2);
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  {
    ZVAL_DOUBLE(return_value,result);
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_BoolWeight_get_maxextra) {
  Xapian::BoolWeight *arg1 = (Xapian::BoolWeight *) 0 ;
  zval **args[1];
  Xapian::weight 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_Xapian__BoolWeight, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of BoolWeight_get_maxextra. Expected SWIGTYPE_p_Xapian__BoolWeight");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    try {
      result = (Xapian::weight)((Xapian::BoolWeight const *)arg1)->get_maxextra();
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  {
    ZVAL_DOUBLE(return_value,result);
  }
  return;
fail:
  zend_error(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_BoolWeight(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 ;
  Xapian::BoolWeight *arg1 = (Xapian::BoolWeight *) 0 ;
  
  efree(value);
  if (! newobject) return; /* can't delete it! */
  arg1 = (Xapian::BoolWeight *)SWIG_ZTS_ConvertResourceData(ptr,type_name,SWIGTYPE_p_Xapian__BoolWeight TSRMLS_CC);
  if (! arg1) zend_error(E_ERROR, "Xapian::BoolWeight resource already free'd");
  {
    try {
      delete arg1;
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_new_BM25Weight__SWIG_0) {
  double arg1 ;
  double arg2 ;
  double arg3 ;
  double arg4 ;
  double arg5 ;
  zval **args[5];
  Xapian::BM25Weight *result = 0 ;
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 5 || zend_get_parameters_array_ex(5, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  
  /*@SWIG:/data/home/olly/tmp/xapian-svn-snapshot/tags/1.2.8/xapian/swig/Lib/php/utils.i,52,CONVERT_FLOAT_IN@*/
  convert_to_double_ex(args[0]);
  arg1 = (double) Z_DVAL_PP(args[0]);
  /*@SWIG@*/;
  
  
  /*@SWIG:/data/home/olly/tmp/xapian-svn-snapshot/tags/1.2.8/xapian/swig/Lib/php/utils.i,52,CONVERT_FLOAT_IN@*/
  convert_to_double_ex(args[1]);
  arg2 = (double) Z_DVAL_PP(args[1]);
  /*@SWIG@*/;
  
  
  /*@SWIG:/data/home/olly/tmp/xapian-svn-snapshot/tags/1.2.8/xapian/swig/Lib/php/utils.i,52,CONVERT_FLOAT_IN@*/
  convert_to_double_ex(args[2]);
  arg3 = (double) Z_DVAL_PP(args[2]);
  /*@SWIG@*/;
  
  
  /*@SWIG:/data/home/olly/tmp/xapian-svn-snapshot/tags/1.2.8/xapian/swig/Lib/php/utils.i,52,CONVERT_FLOAT_IN@*/
  convert_to_double_ex(args[3]);
  arg4 = (double) Z_DVAL_PP(args[3]);
  /*@SWIG@*/;
  
  
  /*@SWIG:/data/home/olly/tmp/xapian-svn-snapshot/tags/1.2.8/xapian/swig/Lib/php/utils.i,52,CONVERT_FLOAT_IN@*/
  convert_to_double_ex(args[4]);
  arg5 = (double) Z_DVAL_PP(args[4]);
  /*@SWIG@*/;
  
  {
    try {
      result = (Xapian::BM25Weight *)new Xapian::BM25Weight(arg1,arg2,arg3,arg4,arg5);
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  
  SWIG_SetPointerZval(return_value, (void *)result, SWIGTYPE_p_Xapian__BM25Weight, 1);
  
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_new_BM25Weight__SWIG_1) {
  Xapian::BM25Weight *result = 0 ;
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 0) {
    WRONG_PARAM_COUNT;
  }
  
  {
    try {
      result = (Xapian::BM25Weight *)new Xapian::BM25Weight();
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  
  SWIG_SetPointerZval(return_value, (void *)result, SWIGTYPE_p_Xapian__BM25Weight, 1);
  
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_new_BM25Weight) {
  int argc;
  zval **argv[5];
  
  argc = ZEND_NUM_ARGS();
  zend_get_parameters_array_ex(argc,argv);
  if (argc == 0) {
    _wrap_new_BM25Weight__SWIG_1(INTERNAL_FUNCTION_PARAM_PASSTHRU); return;
  }
  if (argc == 5) {
    int _v;
    _v = (Z_TYPE_PP(argv[0]) == IS_DOUBLE); 
    if (_v) {
      _v = (Z_TYPE_PP(argv[1]) == IS_DOUBLE); 
      if (_v) {
        _v = (Z_TYPE_PP(argv[2]) == IS_DOUBLE); 
        if (_v) {
          _v = (Z_TYPE_PP(argv[3]) == IS_DOUBLE); 
          if (_v) {
            _v = (Z_TYPE_PP(argv[4]) == IS_DOUBLE); 
            if (_v) {
              _wrap_new_BM25Weight__SWIG_0(INTERNAL_FUNCTION_PARAM_PASSTHRU); return;
            }
          }
        }
      }
    }
  }
  
  SWIG_ErrorCode() = E_ERROR;
  SWIG_ErrorMsg() = "No matching function for overloaded 'new_BM25Weight'";
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_BM25Weight_name) {
  Xapian::BM25Weight *arg1 = (Xapian::BM25Weight *) 0 ;
  zval **args[1];
  std::string 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_Xapian__BM25Weight, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of BM25Weight_name. Expected SWIGTYPE_p_Xapian__BM25Weight");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    try {
      result = ((Xapian::BM25Weight const *)arg1)->name();
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  
  ZVAL_STRINGL(return_value, const_cast<char*>((&result)->data()), (&result)->size(), 1);
  
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_BM25Weight_get_sumpart) {
  Xapian::BM25Weight *arg1 = (Xapian::BM25Weight *) 0 ;
  Xapian::termcount arg2 ;
  Xapian::termcount arg3 ;
  zval **args[3];
  Xapian::weight 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_Xapian__BM25Weight, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of BM25Weight_get_sumpart. Expected SWIGTYPE_p_Xapian__BM25Weight");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  
  /*@SWIG:/data/home/olly/tmp/xapian-svn-snapshot/tags/1.2.8/xapian/swig/Lib/php/utils.i,7,CONVERT_INT_IN@*/
  convert_to_long_ex(args[1]);
  arg2 = (Xapian::termcount) Z_LVAL_PP(args[1]);
  /*@SWIG@*/;
  
  
  /*@SWIG:/data/home/olly/tmp/xapian-svn-snapshot/tags/1.2.8/xapian/swig/Lib/php/utils.i,7,CONVERT_INT_IN@*/
  convert_to_long_ex(args[2]);
  arg3 = (Xapian::termcount) Z_LVAL_PP(args[2]);
  /*@SWIG@*/;
  
  {
    try {
      result = (Xapian::weight)((Xapian::BM25Weight const *)arg1)->get_sumpart(arg2,arg3);
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  {
    ZVAL_DOUBLE(return_value,result);
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_BM25Weight_get_maxpart) {
  Xapian::BM25Weight *arg1 = (Xapian::BM25Weight *) 0 ;
  zval **args[1];
  Xapian::weight 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_Xapian__BM25Weight, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of BM25Weight_get_maxpart. Expected SWIGTYPE_p_Xapian__BM25Weight");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    try {
      result = (Xapian::weight)((Xapian::BM25Weight const *)arg1)->get_maxpart();
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  {
    ZVAL_DOUBLE(return_value,result);
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_BM25Weight_get_sumextra) {
  Xapian::BM25Weight *arg1 = (Xapian::BM25Weight *) 0 ;
  Xapian::termcount arg2 ;
  zval **args[2];
  Xapian::weight 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_Xapian__BM25Weight, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of BM25Weight_get_sumextra. Expected SWIGTYPE_p_Xapian__BM25Weight");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  
  /*@SWIG:/data/home/olly/tmp/xapian-svn-snapshot/tags/1.2.8/xapian/swig/Lib/php/utils.i,7,CONVERT_INT_IN@*/
  convert_to_long_ex(args[1]);
  arg2 = (Xapian::termcount) Z_LVAL_PP(args[1]);
  /*@SWIG@*/;
  
  {
    try {
      result = (Xapian::weight)((Xapian::BM25Weight const *)arg1)->get_sumextra(arg2);
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  {
    ZVAL_DOUBLE(return_value,result);
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_BM25Weight_get_maxextra) {
  Xapian::BM25Weight *arg1 = (Xapian::BM25Weight *) 0 ;
  zval **args[1];
  Xapian::weight 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_Xapian__BM25Weight, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of BM25Weight_get_maxextra. Expected SWIGTYPE_p_Xapian__BM25Weight");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    try {
      result = (Xapian::weight)((Xapian::BM25Weight const *)arg1)->get_maxextra();
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  {
    ZVAL_DOUBLE(return_value,result);
  }
  return;
fail:
  zend_error(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_BM25Weight(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 ;
  Xapian::BM25Weight *arg1 = (Xapian::BM25Weight *) 0 ;
  
  efree(value);
  if (! newobject) return; /* can't delete it! */
  arg1 = (Xapian::BM25Weight *)SWIG_ZTS_ConvertResourceData(ptr,type_name,SWIGTYPE_p_Xapian__BM25Weight TSRMLS_CC);
  if (! arg1) zend_error(E_ERROR, "Xapian::BM25Weight resource already free'd");
  {
    try {
      delete arg1;
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_new_TradWeight__SWIG_0) {
  double arg1 ;
  zval **args[1];
  Xapian::TradWeight *result = 0 ;
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 1 || zend_get_parameters_array_ex(1, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  
  /*@SWIG:/data/home/olly/tmp/xapian-svn-snapshot/tags/1.2.8/xapian/swig/Lib/php/utils.i,52,CONVERT_FLOAT_IN@*/
  convert_to_double_ex(args[0]);
  arg1 = (double) Z_DVAL_PP(args[0]);
  /*@SWIG@*/;
  
  {
    try {
      result = (Xapian::TradWeight *)new Xapian::TradWeight(arg1);
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  
  SWIG_SetPointerZval(return_value, (void *)result, SWIGTYPE_p_Xapian__TradWeight, 1);
  
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_new_TradWeight__SWIG_1) {
  Xapian::TradWeight *result = 0 ;
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 0) {
    WRONG_PARAM_COUNT;
  }
  
  {
    try {
      result = (Xapian::TradWeight *)new Xapian::TradWeight();
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  
  SWIG_SetPointerZval(return_value, (void *)result, SWIGTYPE_p_Xapian__TradWeight, 1);
  
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_new_TradWeight) {
  int argc;
  zval **argv[1];
  
  argc = ZEND_NUM_ARGS();
  zend_get_parameters_array_ex(argc,argv);
  if (argc == 0) {
    _wrap_new_TradWeight__SWIG_1(INTERNAL_FUNCTION_PARAM_PASSTHRU); return;
  }
  if (argc == 1) {
    int _v;
    _v = (Z_TYPE_PP(argv[0]) == IS_DOUBLE); 
    if (_v) {
      _wrap_new_TradWeight__SWIG_0(INTERNAL_FUNCTION_PARAM_PASSTHRU); return;
    }
  }
  
  SWIG_ErrorCode() = E_ERROR;
  SWIG_ErrorMsg() = "No matching function for overloaded 'new_TradWeight'";
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_TradWeight_name) {
  Xapian::TradWeight *arg1 = (Xapian::TradWeight *) 0 ;
  zval **args[1];
  std::string 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_Xapian__TradWeight, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of TradWeight_name. Expected SWIGTYPE_p_Xapian__TradWeight");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    try {
      result = ((Xapian::TradWeight const *)arg1)->name();
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  
  ZVAL_STRINGL(return_value, const_cast<char*>((&result)->data()), (&result)->size(), 1);
  
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_TradWeight_get_sumpart) {
  Xapian::TradWeight *arg1 = (Xapian::TradWeight *) 0 ;
  Xapian::termcount arg2 ;
  Xapian::termcount arg3 ;
  zval **args[3];
  Xapian::weight 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_Xapian__TradWeight, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of TradWeight_get_sumpart. Expected SWIGTYPE_p_Xapian__TradWeight");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  
  /*@SWIG:/data/home/olly/tmp/xapian-svn-snapshot/tags/1.2.8/xapian/swig/Lib/php/utils.i,7,CONVERT_INT_IN@*/
  convert_to_long_ex(args[1]);
  arg2 = (Xapian::termcount) Z_LVAL_PP(args[1]);
  /*@SWIG@*/;
  
  
  /*@SWIG:/data/home/olly/tmp/xapian-svn-snapshot/tags/1.2.8/xapian/swig/Lib/php/utils.i,7,CONVERT_INT_IN@*/
  convert_to_long_ex(args[2]);
  arg3 = (Xapian::termcount) Z_LVAL_PP(args[2]);
  /*@SWIG@*/;
  
  {
    try {
      result = (Xapian::weight)((Xapian::TradWeight const *)arg1)->get_sumpart(arg2,arg3);
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  {
    ZVAL_DOUBLE(return_value,result);
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_TradWeight_get_maxpart) {
  Xapian::TradWeight *arg1 = (Xapian::TradWeight *) 0 ;
  zval **args[1];
  Xapian::weight 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_Xapian__TradWeight, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of TradWeight_get_maxpart. Expected SWIGTYPE_p_Xapian__TradWeight");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    try {
      result = (Xapian::weight)((Xapian::TradWeight const *)arg1)->get_maxpart();
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  {
    ZVAL_DOUBLE(return_value,result);
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_TradWeight_get_sumextra) {
  Xapian::TradWeight *arg1 = (Xapian::TradWeight *) 0 ;
  Xapian::termcount arg2 ;
  zval **args[2];
  Xapian::weight 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_Xapian__TradWeight, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of TradWeight_get_sumextra. Expected SWIGTYPE_p_Xapian__TradWeight");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  
  /*@SWIG:/data/home/olly/tmp/xapian-svn-snapshot/tags/1.2.8/xapian/swig/Lib/php/utils.i,7,CONVERT_INT_IN@*/
  convert_to_long_ex(args[1]);
  arg2 = (Xapian::termcount) Z_LVAL_PP(args[1]);
  /*@SWIG@*/;
  
  {
    try {
      result = (Xapian::weight)((Xapian::TradWeight const *)arg1)->get_sumextra(arg2);
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  {
    ZVAL_DOUBLE(return_value,result);
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_TradWeight_get_maxextra) {
  Xapian::TradWeight *arg1 = (Xapian::TradWeight *) 0 ;
  zval **args[1];
  Xapian::weight 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_Xapian__TradWeight, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of TradWeight_get_maxextra. Expected SWIGTYPE_p_Xapian__TradWeight");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    try {
      result = (Xapian::weight)((Xapian::TradWeight const *)arg1)->get_maxextra();
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  {
    ZVAL_DOUBLE(return_value,result);
  }
  return;
fail:
  zend_error(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_TradWeight(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 ;
  Xapian::TradWeight *arg1 = (Xapian::TradWeight *) 0 ;
  
  efree(value);
  if (! newobject) return; /* can't delete it! */
  arg1 = (Xapian::TradWeight *)SWIG_ZTS_ConvertResourceData(ptr,type_name,SWIGTYPE_p_Xapian__TradWeight TSRMLS_CC);
  if (! arg1) zend_error(E_ERROR, "Xapian::TradWeight resource already free'd");
  {
    try {
      delete arg1;
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_new_MatchSpy) {
  zval *arg0;
  zval **args[1];
  Xapian::MatchSpy *result = 0 ;
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 1 || zend_get_parameters_array_ex(1, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  arg0 = *args[0];
  
  {
    try {
      if ( arg0->type == IS_NULL ) {
        /* not subclassed */
        SWIG_PHP_Error(E_ERROR, "accessing abstract class or protected constructor");
      } else {
        result = (Xapian::MatchSpy *)new SwigDirector_MatchSpy(arg0 TSRMLS_CC);
      }
      
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  
  SWIG_SetPointerZval(return_value, (void *)result, SWIGTYPE_p_Xapian__MatchSpy, 1);
  
  return;
fail:
  zend_error(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_MatchSpy(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 ;
  Xapian::MatchSpy *arg1 = (Xapian::MatchSpy *) 0 ;
  
  efree(value);
  if (! newobject) return; /* can't delete it! */
  arg1 = (Xapian::MatchSpy *)SWIG_ZTS_ConvertResourceData(ptr,type_name,SWIGTYPE_p_Xapian__MatchSpy TSRMLS_CC);
  if (! arg1) zend_error(E_ERROR, "Xapian::MatchSpy resource already free'd");
  {
    try {
      delete arg1;
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_MatchSpy_apply) {
  Xapian::MatchSpy *arg1 = (Xapian::MatchSpy *) 0 ;
  Xapian::Document *arg2 = 0 ;
  Xapian::weight arg3 ;
  zval **args[3];
  Swig::Director *director = 0;
  bool upcall = false;
  
  director = dynamic_cast<Swig::Director*>(arg1);
  upcall = !director->swig_is_overridden_method((char *)"XapianMatchSpy", (char *)"operator ()");
  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_Xapian__MatchSpy, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of MatchSpy_apply. Expected SWIGTYPE_p_Xapian__MatchSpy");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    if (SWIG_ConvertPtr(*args[1], (void**)&arg2, SWIGTYPE_p_Xapian__Document, 0) < 0 || arg2 == NULL) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 2 of MatchSpy_apply. Expected SWIGTYPE_p_Xapian__Document");
    }
  }
  
  /*@SWIG:/data/home/olly/tmp/xapian-svn-snapshot/tags/1.2.8/xapian/swig/Lib/php/utils.i,52,CONVERT_FLOAT_IN@*/
  convert_to_double_ex(args[2]);
  arg3 = (Xapian::weight) Z_DVAL_PP(args[2]);
  /*@SWIG@*/;
  
  {
    try {
      if (upcall) {
        Swig::DirectorPureVirtualException::raise("Xapian::MatchSpy::operator ()" TSRMLS_CC);
      } else {
        (arg1)->operator ()((Xapian::Document const &)*arg2,arg3);
      }
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_MatchSpy_name) {
  Xapian::MatchSpy *arg1 = (Xapian::MatchSpy *) 0 ;
  zval **args[1];
  Swig::Director *director = 0;
  bool upcall = false;
  std::string result;
  
  director = dynamic_cast<Swig::Director*>(arg1);
  upcall = !director->swig_is_overridden_method((char *)"XapianMatchSpy", (char *)"name");
  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_Xapian__MatchSpy, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of MatchSpy_name. Expected SWIGTYPE_p_Xapian__MatchSpy");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    try {
      if (upcall) {
        result = ((Xapian::MatchSpy const *)arg1)->Xapian::MatchSpy::name();
      } else {
        result = ((Xapian::MatchSpy const *)arg1)->name();
      }
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  
  ZVAL_STRINGL(return_value, const_cast<char*>((&result)->data()), (&result)->size(), 1);
  
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_MatchSpy_merge_results) {
  Xapian::MatchSpy *arg1 = (Xapian::MatchSpy *) 0 ;
  std::string *arg2 = 0 ;
  std::string temp2 ;
  zval **args[2];
  Swig::Director *director = 0;
  bool upcall = false;
  
  director = dynamic_cast<Swig::Director*>(arg1);
  upcall = !director->swig_is_overridden_method((char *)"XapianMatchSpy", (char *)"merge_results");
  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_Xapian__MatchSpy, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of MatchSpy_merge_results. Expected SWIGTYPE_p_Xapian__MatchSpy");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  
  convert_to_string_ex(args[1]);
  temp2.assign(Z_STRVAL_PP(args[1]), Z_STRLEN_PP(args[1]));
  arg2 = &temp2;
  
  {
    try {
      if (upcall) {
        (arg1)->Xapian::MatchSpy::merge_results((std::string const &)*arg2);
      } else {
        (arg1)->merge_results((std::string const &)*arg2);
      }
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  
  
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_MatchSpy_get_description) {
  Xapian::MatchSpy *arg1 = (Xapian::MatchSpy *) 0 ;
  zval **args[1];
  Swig::Director *director = 0;
  bool upcall = false;
  std::string result;
  
  director = dynamic_cast<Swig::Director*>(arg1);
  upcall = !director->swig_is_overridden_method((char *)"XapianMatchSpy", (char *)"get_description");
  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_Xapian__MatchSpy, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of MatchSpy_get_description. Expected SWIGTYPE_p_Xapian__MatchSpy");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    try {
      if (upcall) {
        result = ((Xapian::MatchSpy const *)arg1)->Xapian::MatchSpy::get_description();
      } else {
        result = ((Xapian::MatchSpy const *)arg1)->get_description();
      }
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  
  ZVAL_STRINGL(return_value, const_cast<char*>((&result)->data()), (&result)->size(), 1);
  
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_new_ValueCountMatchSpy__SWIG_0) {
  Xapian::ValueCountMatchSpy *result = 0 ;
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 0) {
    WRONG_PARAM_COUNT;
  }
  
  {
    try {
      result = (Xapian::ValueCountMatchSpy *)new Xapian::ValueCountMatchSpy();
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  
  SWIG_SetPointerZval(return_value, (void *)result, SWIGTYPE_p_Xapian__ValueCountMatchSpy, 1);
  
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_new_ValueCountMatchSpy__SWIG_1) {
  Xapian::valueno arg1 ;
  zval **args[1];
  Xapian::ValueCountMatchSpy *result = 0 ;
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 1 || zend_get_parameters_array_ex(1, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  
  /*@SWIG:/data/home/olly/tmp/xapian-svn-snapshot/tags/1.2.8/xapian/swig/Lib/php/utils.i,7,CONVERT_INT_IN@*/
  convert_to_long_ex(args[0]);
  arg1 = (Xapian::valueno) Z_LVAL_PP(args[0]);
  /*@SWIG@*/;
  
  {
    try {
      result = (Xapian::ValueCountMatchSpy *)new Xapian::ValueCountMatchSpy(arg1);
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  
  SWIG_SetPointerZval(return_value, (void *)result, SWIGTYPE_p_Xapian__ValueCountMatchSpy, 1);
  
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_new_ValueCountMatchSpy) {
  int argc;
  zval **argv[1];
  
  argc = ZEND_NUM_ARGS();
  zend_get_parameters_array_ex(argc,argv);
  if (argc == 0) {
    _wrap_new_ValueCountMatchSpy__SWIG_0(INTERNAL_FUNCTION_PARAM_PASSTHRU); return;
  }
  if (argc == 1) {
    int _v;
    _v = (Z_TYPE_PP(argv[0]) == IS_LONG); 
    if (_v) {
      _wrap_new_ValueCountMatchSpy__SWIG_1(INTERNAL_FUNCTION_PARAM_PASSTHRU); return;
    }
  }
  
  SWIG_ErrorCode() = E_ERROR;
  SWIG_ErrorMsg() = "No matching function for overloaded 'new_ValueCountMatchSpy'";
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_ValueCountMatchSpy_get_total) {
  Xapian::ValueCountMatchSpy *arg1 = (Xapian::ValueCountMatchSpy *) 0 ;
  zval **args[1];
  size_t 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_Xapian__ValueCountMatchSpy, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of ValueCountMatchSpy_get_total. Expected SWIGTYPE_p_Xapian__ValueCountMatchSpy");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    try {
      result = ((Xapian::ValueCountMatchSpy const *)arg1)->get_total();
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  {
    ZVAL_LONG(return_value,result);
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_ValueCountMatchSpy_values_begin) {
  Xapian::ValueCountMatchSpy *arg1 = (Xapian::ValueCountMatchSpy *) 0 ;
  zval **args[1];
  Xapian::TermIterator 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_Xapian__ValueCountMatchSpy, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of ValueCountMatchSpy_values_begin. Expected SWIGTYPE_p_Xapian__ValueCountMatchSpy");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    try {
      result = ((Xapian::ValueCountMatchSpy const *)arg1)->values_begin();
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  {
    Xapian::TermIterator * resultobj = new Xapian::TermIterator((const Xapian::TermIterator &) result);
    SWIG_SetPointerZval(return_value, (void *)resultobj, SWIGTYPE_p_Xapian__TermIterator, 1);
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_ValueCountMatchSpy_values_end) {
  Xapian::ValueCountMatchSpy *arg1 = (Xapian::ValueCountMatchSpy *) 0 ;
  zval **args[1];
  Xapian::TermIterator 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_Xapian__ValueCountMatchSpy, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of ValueCountMatchSpy_values_end. Expected SWIGTYPE_p_Xapian__ValueCountMatchSpy");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    try {
      result = ((Xapian::ValueCountMatchSpy const *)arg1)->values_end();
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  {
    Xapian::TermIterator * resultobj = new Xapian::TermIterator((const Xapian::TermIterator &) result);
    SWIG_SetPointerZval(return_value, (void *)resultobj, SWIGTYPE_p_Xapian__TermIterator, 1);
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_ValueCountMatchSpy_top_values_begin) {
  Xapian::ValueCountMatchSpy *arg1 = (Xapian::ValueCountMatchSpy *) 0 ;
  size_t arg2 ;
  zval **args[2];
  Xapian::TermIterator 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_Xapian__ValueCountMatchSpy, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of ValueCountMatchSpy_top_values_begin. Expected SWIGTYPE_p_Xapian__ValueCountMatchSpy");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  
  /*@SWIG:/data/home/olly/tmp/xapian-svn-snapshot/tags/1.2.8/xapian/swig/Lib/php/utils.i,7,CONVERT_INT_IN@*/
  convert_to_long_ex(args[1]);
  arg2 = (size_t) Z_LVAL_PP(args[1]);
  /*@SWIG@*/;
  
  {
    try {
      result = ((Xapian::ValueCountMatchSpy const *)arg1)->top_values_begin(arg2);
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  {
    Xapian::TermIterator * resultobj = new Xapian::TermIterator((const Xapian::TermIterator &) result);
    SWIG_SetPointerZval(return_value, (void *)resultobj, SWIGTYPE_p_Xapian__TermIterator, 1);
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_ValueCountMatchSpy_top_values_end) {
  Xapian::ValueCountMatchSpy *arg1 = (Xapian::ValueCountMatchSpy *) 0 ;
  size_t arg2 ;
  zval **args[2];
  Xapian::TermIterator 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_Xapian__ValueCountMatchSpy, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of ValueCountMatchSpy_top_values_end. Expected SWIGTYPE_p_Xapian__ValueCountMatchSpy");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  
  /*@SWIG:/data/home/olly/tmp/xapian-svn-snapshot/tags/1.2.8/xapian/swig/Lib/php/utils.i,7,CONVERT_INT_IN@*/
  convert_to_long_ex(args[1]);
  arg2 = (size_t) Z_LVAL_PP(args[1]);
  /*@SWIG@*/;
  
  {
    try {
      result = ((Xapian::ValueCountMatchSpy const *)arg1)->top_values_end(arg2);
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  {
    Xapian::TermIterator * resultobj = new Xapian::TermIterator((const Xapian::TermIterator &) result);
    SWIG_SetPointerZval(return_value, (void *)resultobj, SWIGTYPE_p_Xapian__TermIterator, 1);
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_ValueCountMatchSpy_apply) {
  Xapian::ValueCountMatchSpy *arg1 = (Xapian::ValueCountMatchSpy *) 0 ;
  Xapian::Document *arg2 = 0 ;
  Xapian::weight arg3 ;
  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_Xapian__ValueCountMatchSpy, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of ValueCountMatchSpy_apply. Expected SWIGTYPE_p_Xapian__ValueCountMatchSpy");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    if (SWIG_ConvertPtr(*args[1], (void**)&arg2, SWIGTYPE_p_Xapian__Document, 0) < 0 || arg2 == NULL) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 2 of ValueCountMatchSpy_apply. Expected SWIGTYPE_p_Xapian__Document");
    }
  }
  
  /*@SWIG:/data/home/olly/tmp/xapian-svn-snapshot/tags/1.2.8/xapian/swig/Lib/php/utils.i,52,CONVERT_FLOAT_IN@*/
  convert_to_double_ex(args[2]);
  arg3 = (Xapian::weight) Z_DVAL_PP(args[2]);
  /*@SWIG@*/;
  
  {
    try {
      (arg1)->operator ()((Xapian::Document const &)*arg2,arg3);
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_ValueCountMatchSpy_name) {
  Xapian::ValueCountMatchSpy *arg1 = (Xapian::ValueCountMatchSpy *) 0 ;
  zval **args[1];
  std::string 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_Xapian__ValueCountMatchSpy, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of ValueCountMatchSpy_name. Expected SWIGTYPE_p_Xapian__ValueCountMatchSpy");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    try {
      result = ((Xapian::ValueCountMatchSpy const *)arg1)->name();
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  
  ZVAL_STRINGL(return_value, const_cast<char*>((&result)->data()), (&result)->size(), 1);
  
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_ValueCountMatchSpy_merge_results) {
  Xapian::ValueCountMatchSpy *arg1 = (Xapian::ValueCountMatchSpy *) 0 ;
  std::string *arg2 = 0 ;
  std::string temp2 ;
  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_Xapian__ValueCountMatchSpy, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of ValueCountMatchSpy_merge_results. Expected SWIGTYPE_p_Xapian__ValueCountMatchSpy");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  
  convert_to_string_ex(args[1]);
  temp2.assign(Z_STRVAL_PP(args[1]), Z_STRLEN_PP(args[1]));
  arg2 = &temp2;
  
  {
    try {
      (arg1)->merge_results((std::string const &)*arg2);
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  
  
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_ValueCountMatchSpy_get_description) {
  Xapian::ValueCountMatchSpy *arg1 = (Xapian::ValueCountMatchSpy *) 0 ;
  zval **args[1];
  std::string 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_Xapian__ValueCountMatchSpy, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of ValueCountMatchSpy_get_description. Expected SWIGTYPE_p_Xapian__ValueCountMatchSpy");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    try {
      result = ((Xapian::ValueCountMatchSpy const *)arg1)->get_description();
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  
  ZVAL_STRINGL(return_value, const_cast<char*>((&result)->data()), (&result)->size(), 1);
  
  return;
fail:
  zend_error(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_ValueCountMatchSpy(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 ;
  Xapian::ValueCountMatchSpy *arg1 = (Xapian::ValueCountMatchSpy *) 0 ;
  
  efree(value);
  if (! newobject) return; /* can't delete it! */
  arg1 = (Xapian::ValueCountMatchSpy *)SWIG_ZTS_ConvertResourceData(ptr,type_name,SWIGTYPE_p_Xapian__ValueCountMatchSpy TSRMLS_CC);
  if (! arg1) zend_error(E_ERROR, "Xapian::ValueCountMatchSpy resource already free'd");
  {
    try {
      delete arg1;
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_Database_add_database) {
  Xapian::Database *arg1 = (Xapian::Database *) 0 ;
  Xapian::Database *arg2 = 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_Xapian__Database, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of Database_add_database. Expected SWIGTYPE_p_Xapian__Database");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    if (SWIG_ConvertPtr(*args[1], (void**)&arg2, SWIGTYPE_p_Xapian__Database, 0) < 0 || arg2 == NULL) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 2 of Database_add_database. Expected SWIGTYPE_p_Xapian__Database");
    }
  }
  {
    try {
      (arg1)->add_database((Xapian::Database const &)*arg2);
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_new_Database__SWIG_0) {
  Xapian::Database *result = 0 ;
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 0) {
    WRONG_PARAM_COUNT;
  }
  
  {
    try {
      result = (Xapian::Database *)new Xapian::Database();
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  
  SWIG_SetPointerZval(return_value, (void *)result, SWIGTYPE_p_Xapian__Database, 1);
  
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_new_Database__SWIG_1) {
  std::string *arg1 = 0 ;
  std::string temp1 ;
  zval **args[1];
  Xapian::Database *result = 0 ;
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 1 || zend_get_parameters_array_ex(1, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  
  convert_to_string_ex(args[0]);
  temp1.assign(Z_STRVAL_PP(args[0]), Z_STRLEN_PP(args[0]));
  arg1 = &temp1;
  
  {
    try {
      result = (Xapian::Database *)new Xapian::Database((std::string const &)*arg1);
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  
  SWIG_SetPointerZval(return_value, (void *)result, SWIGTYPE_p_Xapian__Database, 1);
  
  
  return;
fail:
  zend_error(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_Database(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 ;
  Xapian::Database *arg1 = (Xapian::Database *) 0 ;
  
  efree(value);
  if (! newobject) return; /* can't delete it! */
  arg1 = (Xapian::Database *)SWIG_ZTS_ConvertResourceData(ptr,type_name,SWIGTYPE_p_Xapian__Database TSRMLS_CC);
  if (! arg1) zend_error(E_ERROR, "Xapian::Database resource already free'd");
  {
    try {
      delete arg1;
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_new_Database__SWIG_2) {
  Xapian::Database *arg1 = 0 ;
  zval **args[1];
  Xapian::Database *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_Xapian__Database, 0) < 0 || arg1 == NULL) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of new_Database. Expected SWIGTYPE_p_Xapian__Database");
    }
  }
  {
    try {
      result = (Xapian::Database *)new Xapian::Database((Xapian::Database const &)*arg1);
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  
  SWIG_SetPointerZval(return_value, (void *)result, SWIGTYPE_p_Xapian__Database, 1);
  
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_new_Database) {
  int argc;
  zval **argv[1];
  
  argc = ZEND_NUM_ARGS();
  zend_get_parameters_array_ex(argc,argv);
  if (argc == 0) {
    _wrap_new_Database__SWIG_0(INTERNAL_FUNCTION_PARAM_PASSTHRU); return;
  }
  if (argc == 1) {
    int _v;
    {
      void *ptr;
      _v = (SWIG_ConvertPtr(*argv[0], (void **)&ptr, SWIGTYPE_p_Xapian__Database, 0) == 0);
    }
    if (_v) {
      _wrap_new_Database__SWIG_2(INTERNAL_FUNCTION_PARAM_PASSTHRU); return;
    }
  }
  if (argc == 1) {
    int _v;
    {
      _v = (Z_TYPE_PP(argv[0]) == IS_STRING);
    }
    if (_v) {
      _wrap_new_Database__SWIG_1(INTERNAL_FUNCTION_PARAM_PASSTHRU); return;
    }
  }
  
  SWIG_ErrorCode() = E_ERROR;
  SWIG_ErrorMsg() = "No matching function for overloaded 'new_Database'";
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_Database_reopen) {
  Xapian::Database *arg1 = (Xapian::Database *) 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_Xapian__Database, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of Database_reopen. Expected SWIGTYPE_p_Xapian__Database");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    try {
      (arg1)->reopen();
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_Database_close) {
  Xapian::Database *arg1 = (Xapian::Database *) 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_Xapian__Database, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of Database_close. Expected SWIGTYPE_p_Xapian__Database");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    try {
      (arg1)->close();
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_Database_get_description) {
  Xapian::Database *arg1 = (Xapian::Database *) 0 ;
  zval **args[1];
  std::string 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_Xapian__Database, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of Database_get_description. Expected SWIGTYPE_p_Xapian__Database");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    try {
      result = ((Xapian::Database const *)arg1)->get_description();
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  
  ZVAL_STRINGL(return_value, const_cast<char*>((&result)->data()), (&result)->size(), 1);
  
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_Database_postlist_begin) {
  Xapian::Database *arg1 = (Xapian::Database *) 0 ;
  std::string *arg2 = 0 ;
  std::string temp2 ;
  zval **args[2];
  Xapian::PostingIterator 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_Xapian__Database, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of Database_postlist_begin. Expected SWIGTYPE_p_Xapian__Database");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  
  convert_to_string_ex(args[1]);
  temp2.assign(Z_STRVAL_PP(args[1]), Z_STRLEN_PP(args[1]));
  arg2 = &temp2;
  
  {
    try {
      result = ((Xapian::Database const *)arg1)->postlist_begin((std::string const &)*arg2);
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  {
    Xapian::PostingIterator * resultobj = new Xapian::PostingIterator((const Xapian::PostingIterator &) result);
    SWIG_SetPointerZval(return_value, (void *)resultobj, SWIGTYPE_p_Xapian__PostingIterator, 1);
  }
  
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_Database_postlist_end) {
  Xapian::Database *arg1 = (Xapian::Database *) 0 ;
  std::string *arg2 = 0 ;
  std::string temp2 ;
  zval **args[2];
  Xapian::PostingIterator 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_Xapian__Database, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of Database_postlist_end. Expected SWIGTYPE_p_Xapian__Database");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  
  convert_to_string_ex(args[1]);
  temp2.assign(Z_STRVAL_PP(args[1]), Z_STRLEN_PP(args[1]));
  arg2 = &temp2;
  
  {
    try {
      result = ((Xapian::Database const *)arg1)->postlist_end((std::string const &)*arg2);
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  {
    Xapian::PostingIterator * resultobj = new Xapian::PostingIterator((const Xapian::PostingIterator &) result);
    SWIG_SetPointerZval(return_value, (void *)resultobj, SWIGTYPE_p_Xapian__PostingIterator, 1);
  }
  
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_Database_termlist_begin) {
  Xapian::Database *arg1 = (Xapian::Database *) 0 ;
  Xapian::docid arg2 ;
  zval **args[2];
  Xapian::TermIterator 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_Xapian__Database, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of Database_termlist_begin. Expected SWIGTYPE_p_Xapian__Database");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  
  /*@SWIG:/data/home/olly/tmp/xapian-svn-snapshot/tags/1.2.8/xapian/swig/Lib/php/utils.i,7,CONVERT_INT_IN@*/
  convert_to_long_ex(args[1]);
  arg2 = (Xapian::docid) Z_LVAL_PP(args[1]);
  /*@SWIG@*/;
  
  {
    try {
      result = ((Xapian::Database const *)arg1)->termlist_begin(arg2);
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  {
    Xapian::TermIterator * resultobj = new Xapian::TermIterator((const Xapian::TermIterator &) result);
    SWIG_SetPointerZval(return_value, (void *)resultobj, SWIGTYPE_p_Xapian__TermIterator, 1);
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_Database_termlist_end) {
  Xapian::Database *arg1 = (Xapian::Database *) 0 ;
  Xapian::docid arg2 ;
  zval **args[2];
  Xapian::TermIterator 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_Xapian__Database, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of Database_termlist_end. Expected SWIGTYPE_p_Xapian__Database");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  
  /*@SWIG:/data/home/olly/tmp/xapian-svn-snapshot/tags/1.2.8/xapian/swig/Lib/php/utils.i,7,CONVERT_INT_IN@*/
  convert_to_long_ex(args[1]);
  arg2 = (Xapian::docid) Z_LVAL_PP(args[1]);
  /*@SWIG@*/;
  
  {
    try {
      result = ((Xapian::Database const *)arg1)->termlist_end(arg2);
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  {
    Xapian::TermIterator * resultobj = new Xapian::TermIterator((const Xapian::TermIterator &) result);
    SWIG_SetPointerZval(return_value, (void *)resultobj, SWIGTYPE_p_Xapian__TermIterator, 1);
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_Database_positionlist_begin) {
  Xapian::Database *arg1 = (Xapian::Database *) 0 ;
  Xapian::docid arg2 ;
  std::string *arg3 = 0 ;
  std::string temp3 ;
  zval **args[3];
  Xapian::PositionIterator 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_Xapian__Database, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of Database_positionlist_begin. Expected SWIGTYPE_p_Xapian__Database");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  
  /*@SWIG:/data/home/olly/tmp/xapian-svn-snapshot/tags/1.2.8/xapian/swig/Lib/php/utils.i,7,CONVERT_INT_IN@*/
  convert_to_long_ex(args[1]);
  arg2 = (Xapian::docid) Z_LVAL_PP(args[1]);
  /*@SWIG@*/;
  
  
  convert_to_string_ex(args[2]);
  temp3.assign(Z_STRVAL_PP(args[2]), Z_STRLEN_PP(args[2]));
  arg3 = &temp3;
  
  {
    try {
      result = ((Xapian::Database const *)arg1)->positionlist_begin(arg2,(std::string const &)*arg3);
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  {
    Xapian::PositionIterator * resultobj = new Xapian::PositionIterator((const Xapian::PositionIterator &) result);
    SWIG_SetPointerZval(return_value, (void *)resultobj, SWIGTYPE_p_Xapian__PositionIterator, 1);
  }
  
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_Database_positionlist_end) {
  Xapian::Database *arg1 = (Xapian::Database *) 0 ;
  Xapian::docid arg2 ;
  std::string *arg3 = 0 ;
  std::string temp3 ;
  zval **args[3];
  Xapian::PositionIterator 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_Xapian__Database, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of Database_positionlist_end. Expected SWIGTYPE_p_Xapian__Database");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  
  /*@SWIG:/data/home/olly/tmp/xapian-svn-snapshot/tags/1.2.8/xapian/swig/Lib/php/utils.i,7,CONVERT_INT_IN@*/
  convert_to_long_ex(args[1]);
  arg2 = (Xapian::docid) Z_LVAL_PP(args[1]);
  /*@SWIG@*/;
  
  
  convert_to_string_ex(args[2]);
  temp3.assign(Z_STRVAL_PP(args[2]), Z_STRLEN_PP(args[2]));
  arg3 = &temp3;
  
  {
    try {
      result = ((Xapian::Database const *)arg1)->positionlist_end(arg2,(std::string const &)*arg3);
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  {
    Xapian::PositionIterator * resultobj = new Xapian::PositionIterator((const Xapian::PositionIterator &) result);
    SWIG_SetPointerZval(return_value, (void *)resultobj, SWIGTYPE_p_Xapian__PositionIterator, 1);
  }
  
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_Database_allterms_begin__SWIG_0) {
  Xapian::Database *arg1 = (Xapian::Database *) 0 ;
  zval **args[1];
  Xapian::TermIterator 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_Xapian__Database, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of Database_allterms_begin. Expected SWIGTYPE_p_Xapian__Database");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    try {
      result = ((Xapian::Database const *)arg1)->allterms_begin();
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  {
    Xapian::TermIterator * resultobj = new Xapian::TermIterator((const Xapian::TermIterator &) result);
    SWIG_SetPointerZval(return_value, (void *)resultobj, SWIGTYPE_p_Xapian__TermIterator, 1);
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_Database_allterms_end__SWIG_0) {
  Xapian::Database *arg1 = (Xapian::Database *) 0 ;
  zval **args[1];
  Xapian::TermIterator 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_Xapian__Database, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of Database_allterms_end. Expected SWIGTYPE_p_Xapian__Database");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    try {
      result = ((Xapian::Database const *)arg1)->allterms_end();
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  {
    Xapian::TermIterator * resultobj = new Xapian::TermIterator((const Xapian::TermIterator &) result);
    SWIG_SetPointerZval(return_value, (void *)resultobj, SWIGTYPE_p_Xapian__TermIterator, 1);
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_Database_allterms_begin__SWIG_1) {
  Xapian::Database *arg1 = (Xapian::Database *) 0 ;
  std::string *arg2 = 0 ;
  std::string temp2 ;
  zval **args[2];
  Xapian::TermIterator 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_Xapian__Database, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of Database_allterms_begin. Expected SWIGTYPE_p_Xapian__Database");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  
  convert_to_string_ex(args[1]);
  temp2.assign(Z_STRVAL_PP(args[1]), Z_STRLEN_PP(args[1]));
  arg2 = &temp2;
  
  {
    try {
      result = ((Xapian::Database const *)arg1)->allterms_begin((std::string const &)*arg2);
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  {
    Xapian::TermIterator * resultobj = new Xapian::TermIterator((const Xapian::TermIterator &) result);
    SWIG_SetPointerZval(return_value, (void *)resultobj, SWIGTYPE_p_Xapian__TermIterator, 1);
  }
  
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_Database_allterms_begin) {
  int argc;
  zval **argv[2];
  
  argc = ZEND_NUM_ARGS();
  zend_get_parameters_array_ex(argc,argv);
  if (argc == 1) {
    int _v;
    {
      void *tmp;
      _v = (SWIG_ConvertPtr(*argv[0], (void**)&tmp, SWIGTYPE_p_Xapian__Database, 0) >= 0);
    }
    if (_v) {
      _wrap_Database_allterms_begin__SWIG_0(INTERNAL_FUNCTION_PARAM_PASSTHRU); return;
    }
  }
  if (argc == 2) {
    int _v;
    {
      void *tmp;
      _v = (SWIG_ConvertPtr(*argv[0], (void**)&tmp, SWIGTYPE_p_Xapian__Database, 0) >= 0);
    }
    if (_v) {
      {
        _v = (Z_TYPE_PP(argv[1]) == IS_STRING);
      }
      if (_v) {
        _wrap_Database_allterms_begin__SWIG_1(INTERNAL_FUNCTION_PARAM_PASSTHRU); return;
      }
    }
  }
  
  SWIG_ErrorCode() = E_ERROR;
  SWIG_ErrorMsg() = "No matching function for overloaded 'Database_allterms_begin'";
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_Database_allterms_end__SWIG_1) {
  Xapian::Database *arg1 = (Xapian::Database *) 0 ;
  std::string *arg2 = 0 ;
  std::string temp2 ;
  zval **args[2];
  Xapian::TermIterator 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_Xapian__Database, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of Database_allterms_end. Expected SWIGTYPE_p_Xapian__Database");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  
  convert_to_string_ex(args[1]);
  temp2.assign(Z_STRVAL_PP(args[1]), Z_STRLEN_PP(args[1]));
  arg2 = &temp2;
  
  {
    try {
      result = ((Xapian::Database const *)arg1)->allterms_end((std::string const &)*arg2);
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  {
    Xapian::TermIterator * resultobj = new Xapian::TermIterator((const Xapian::TermIterator &) result);
    SWIG_SetPointerZval(return_value, (void *)resultobj, SWIGTYPE_p_Xapian__TermIterator, 1);
  }
  
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_Database_allterms_end) {
  int argc;
  zval **argv[2];
  
  argc = ZEND_NUM_ARGS();
  zend_get_parameters_array_ex(argc,argv);
  if (argc == 1) {
    int _v;
    {
      void *tmp;
      _v = (SWIG_ConvertPtr(*argv[0], (void**)&tmp, SWIGTYPE_p_Xapian__Database, 0) >= 0);
    }
    if (_v) {
      _wrap_Database_allterms_end__SWIG_0(INTERNAL_FUNCTION_PARAM_PASSTHRU); return;
    }
  }
  if (argc == 2) {
    int _v;
    {
      void *tmp;
      _v = (SWIG_ConvertPtr(*argv[0], (void**)&tmp, SWIGTYPE_p_Xapian__Database, 0) >= 0);
    }
    if (_v) {
      {
        _v = (Z_TYPE_PP(argv[1]) == IS_STRING);
      }
      if (_v) {
        _wrap_Database_allterms_end__SWIG_1(INTERNAL_FUNCTION_PARAM_PASSTHRU); return;
      }
    }
  }
  
  SWIG_ErrorCode() = E_ERROR;
  SWIG_ErrorMsg() = "No matching function for overloaded 'Database_allterms_end'";
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_Database_get_doccount) {
  Xapian::Database *arg1 = (Xapian::Database *) 0 ;
  zval **args[1];
  Xapian::doccount 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_Xapian__Database, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of Database_get_doccount. Expected SWIGTYPE_p_Xapian__Database");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    try {
      result = (Xapian::doccount)((Xapian::Database const *)arg1)->get_doccount();
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  {
    ZVAL_LONG(return_value,result);
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_Database_get_lastdocid) {
  Xapian::Database *arg1 = (Xapian::Database *) 0 ;
  zval **args[1];
  Xapian::docid 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_Xapian__Database, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of Database_get_lastdocid. Expected SWIGTYPE_p_Xapian__Database");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    try {
      result = (Xapian::docid)((Xapian::Database const *)arg1)->get_lastdocid();
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  {
    ZVAL_LONG(return_value,result);
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_Database_get_avlength) {
  Xapian::Database *arg1 = (Xapian::Database *) 0 ;
  zval **args[1];
  Xapian::doclength 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_Xapian__Database, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of Database_get_avlength. Expected SWIGTYPE_p_Xapian__Database");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    try {
      result = (Xapian::doclength)((Xapian::Database const *)arg1)->get_avlength();
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  {
    ZVAL_DOUBLE(return_value,result);
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_Database_get_termfreq) {
  Xapian::Database *arg1 = (Xapian::Database *) 0 ;
  std::string *arg2 = 0 ;
  std::string temp2 ;
  zval **args[2];
  Xapian::doccount 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_Xapian__Database, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of Database_get_termfreq. Expected SWIGTYPE_p_Xapian__Database");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  
  convert_to_string_ex(args[1]);
  temp2.assign(Z_STRVAL_PP(args[1]), Z_STRLEN_PP(args[1]));
  arg2 = &temp2;
  
  {
    try {
      result = (Xapian::doccount)((Xapian::Database const *)arg1)->get_termfreq((std::string const &)*arg2);
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  {
    ZVAL_LONG(return_value,result);
  }
  
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_Database_term_exists) {
  Xapian::Database *arg1 = (Xapian::Database *) 0 ;
  std::string *arg2 = 0 ;
  std::string temp2 ;
  zval **args[2];
  bool 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_Xapian__Database, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of Database_term_exists. Expected SWIGTYPE_p_Xapian__Database");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  
  convert_to_string_ex(args[1]);
  temp2.assign(Z_STRVAL_PP(args[1]), Z_STRLEN_PP(args[1]));
  arg2 = &temp2;
  
  {
    try {
      result = (bool)((Xapian::Database const *)arg1)->term_exists((std::string const &)*arg2);
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  {
    ZVAL_BOOL(return_value,(result)?1:0);
  }
  
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_Database_get_collection_freq) {
  Xapian::Database *arg1 = (Xapian::Database *) 0 ;
  std::string *arg2 = 0 ;
  std::string temp2 ;
  zval **args[2];
  Xapian::termcount 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_Xapian__Database, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of Database_get_collection_freq. Expected SWIGTYPE_p_Xapian__Database");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  
  convert_to_string_ex(args[1]);
  temp2.assign(Z_STRVAL_PP(args[1]), Z_STRLEN_PP(args[1]));
  arg2 = &temp2;
  
  {
    try {
      result = (Xapian::termcount)((Xapian::Database const *)arg1)->get_collection_freq((std::string const &)*arg2);
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  {
    ZVAL_LONG(return_value,result);
  }
  
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_Database_get_value_freq) {
  Xapian::Database *arg1 = (Xapian::Database *) 0 ;
  Xapian::valueno arg2 ;
  zval **args[2];
  Xapian::doccount 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_Xapian__Database, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of Database_get_value_freq. Expected SWIGTYPE_p_Xapian__Database");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  
  /*@SWIG:/data/home/olly/tmp/xapian-svn-snapshot/tags/1.2.8/xapian/swig/Lib/php/utils.i,7,CONVERT_INT_IN@*/
  convert_to_long_ex(args[1]);
  arg2 = (Xapian::valueno) Z_LVAL_PP(args[1]);
  /*@SWIG@*/;
  
  {
    try {
      result = (Xapian::doccount)((Xapian::Database const *)arg1)->get_value_freq(arg2);
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  {
    ZVAL_LONG(return_value,result);
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_Database_get_value_lower_bound) {
  Xapian::Database *arg1 = (Xapian::Database *) 0 ;
  Xapian::valueno arg2 ;
  zval **args[2];
  std::string 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_Xapian__Database, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of Database_get_value_lower_bound. Expected SWIGTYPE_p_Xapian__Database");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  
  /*@SWIG:/data/home/olly/tmp/xapian-svn-snapshot/tags/1.2.8/xapian/swig/Lib/php/utils.i,7,CONVERT_INT_IN@*/
  convert_to_long_ex(args[1]);
  arg2 = (Xapian::valueno) Z_LVAL_PP(args[1]);
  /*@SWIG@*/;
  
  {
    try {
      result = ((Xapian::Database const *)arg1)->get_value_lower_bound(arg2);
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  
  ZVAL_STRINGL(return_value, const_cast<char*>((&result)->data()), (&result)->size(), 1);
  
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_Database_get_value_upper_bound) {
  Xapian::Database *arg1 = (Xapian::Database *) 0 ;
  Xapian::valueno arg2 ;
  zval **args[2];
  std::string 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_Xapian__Database, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of Database_get_value_upper_bound. Expected SWIGTYPE_p_Xapian__Database");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  
  /*@SWIG:/data/home/olly/tmp/xapian-svn-snapshot/tags/1.2.8/xapian/swig/Lib/php/utils.i,7,CONVERT_INT_IN@*/
  convert_to_long_ex(args[1]);
  arg2 = (Xapian::valueno) Z_LVAL_PP(args[1]);
  /*@SWIG@*/;
  
  {
    try {
      result = ((Xapian::Database const *)arg1)->get_value_upper_bound(arg2);
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  
  ZVAL_STRINGL(return_value, const_cast<char*>((&result)->data()), (&result)->size(), 1);
  
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_Database_get_doclength_lower_bound) {
  Xapian::Database *arg1 = (Xapian::Database *) 0 ;
  zval **args[1];
  Xapian::termcount 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_Xapian__Database, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of Database_get_doclength_lower_bound. Expected SWIGTYPE_p_Xapian__Database");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    try {
      result = (Xapian::termcount)((Xapian::Database const *)arg1)->get_doclength_lower_bound();
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  {
    ZVAL_LONG(return_value,result);
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_Database_get_doclength_upper_bound) {
  Xapian::Database *arg1 = (Xapian::Database *) 0 ;
  zval **args[1];
  Xapian::termcount 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_Xapian__Database, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of Database_get_doclength_upper_bound. Expected SWIGTYPE_p_Xapian__Database");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    try {
      result = (Xapian::termcount)((Xapian::Database const *)arg1)->get_doclength_upper_bound();
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  {
    ZVAL_LONG(return_value,result);
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_Database_get_wdf_upper_bound) {
  Xapian::Database *arg1 = (Xapian::Database *) 0 ;
  std::string *arg2 = 0 ;
  std::string temp2 ;
  zval **args[2];
  Xapian::termcount 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_Xapian__Database, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of Database_get_wdf_upper_bound. Expected SWIGTYPE_p_Xapian__Database");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  
  convert_to_string_ex(args[1]);
  temp2.assign(Z_STRVAL_PP(args[1]), Z_STRLEN_PP(args[1]));
  arg2 = &temp2;
  
  {
    try {
      result = (Xapian::termcount)((Xapian::Database const *)arg1)->get_wdf_upper_bound((std::string const &)*arg2);
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  {
    ZVAL_LONG(return_value,result);
  }
  
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_Database_valuestream_begin) {
  Xapian::Database *arg1 = (Xapian::Database *) 0 ;
  Xapian::valueno arg2 ;
  zval **args[2];
  Xapian::ValueIterator 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_Xapian__Database, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of Database_valuestream_begin. Expected SWIGTYPE_p_Xapian__Database");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  
  /*@SWIG:/data/home/olly/tmp/xapian-svn-snapshot/tags/1.2.8/xapian/swig/Lib/php/utils.i,7,CONVERT_INT_IN@*/
  convert_to_long_ex(args[1]);
  arg2 = (Xapian::valueno) Z_LVAL_PP(args[1]);
  /*@SWIG@*/;
  
  {
    try {
      result = ((Xapian::Database const *)arg1)->valuestream_begin(arg2);
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  {
    Xapian::ValueIterator * resultobj = new Xapian::ValueIterator((const Xapian::ValueIterator &) result);
    SWIG_SetPointerZval(return_value, (void *)resultobj, SWIGTYPE_p_Xapian__ValueIterator, 1);
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_Database_valuestream_end) {
  Xapian::Database *arg1 = (Xapian::Database *) 0 ;
  Xapian::valueno arg2 ;
  zval **args[2];
  Xapian::ValueIterator 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_Xapian__Database, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of Database_valuestream_end. Expected SWIGTYPE_p_Xapian__Database");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  
  /*@SWIG:/data/home/olly/tmp/xapian-svn-snapshot/tags/1.2.8/xapian/swig/Lib/php/utils.i,7,CONVERT_INT_IN@*/
  convert_to_long_ex(args[1]);
  arg2 = (Xapian::valueno) Z_LVAL_PP(args[1]);
  /*@SWIG@*/;
  
  {
    try {
      result = ((Xapian::Database const *)arg1)->valuestream_end(arg2);
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  {
    Xapian::ValueIterator * resultobj = new Xapian::ValueIterator((const Xapian::ValueIterator &) result);
    SWIG_SetPointerZval(return_value, (void *)resultobj, SWIGTYPE_p_Xapian__ValueIterator, 1);
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_Database_get_doclength) {
  Xapian::Database *arg1 = (Xapian::Database *) 0 ;
  Xapian::docid arg2 ;
  zval **args[2];
  Xapian::termcount 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_Xapian__Database, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of Database_get_doclength. Expected SWIGTYPE_p_Xapian__Database");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  
  /*@SWIG:/data/home/olly/tmp/xapian-svn-snapshot/tags/1.2.8/xapian/swig/Lib/php/utils.i,7,CONVERT_INT_IN@*/
  convert_to_long_ex(args[1]);
  arg2 = (Xapian::docid) Z_LVAL_PP(args[1]);
  /*@SWIG@*/;
  
  {
    try {
      result = (Xapian::termcount)((Xapian::Database const *)arg1)->get_doclength(arg2);
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  {
    ZVAL_LONG(return_value,result);
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_Database_keep_alive) {
  Xapian::Database *arg1 = (Xapian::Database *) 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_Xapian__Database, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of Database_keep_alive. Expected SWIGTYPE_p_Xapian__Database");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    try {
      (arg1)->keep_alive();
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_Database_get_document) {
  Xapian::Database *arg1 = (Xapian::Database *) 0 ;
  Xapian::docid arg2 ;
  zval **args[2];
  Xapian::Document 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_Xapian__Database, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of Database_get_document. Expected SWIGTYPE_p_Xapian__Database");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  
  /*@SWIG:/data/home/olly/tmp/xapian-svn-snapshot/tags/1.2.8/xapian/swig/Lib/php/utils.i,7,CONVERT_INT_IN@*/
  convert_to_long_ex(args[1]);
  arg2 = (Xapian::docid) Z_LVAL_PP(args[1]);
  /*@SWIG@*/;
  
  {
    try {
      result = (arg1)->get_document(arg2);
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  {
    Xapian::Document * resultobj = new Xapian::Document((const Xapian::Document &) result);
    SWIG_SetPointerZval(return_value, (void *)resultobj, SWIGTYPE_p_Xapian__Document, 1);
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_Database_get_spelling_suggestion__SWIG_0) {
  Xapian::Database *arg1 = (Xapian::Database *) 0 ;
  std::string *arg2 = 0 ;
  unsigned int arg3 ;
  std::string temp2 ;
  zval **args[3];
  std::string 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_Xapian__Database, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of Database_get_spelling_suggestion. Expected SWIGTYPE_p_Xapian__Database");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  
  convert_to_string_ex(args[1]);
  temp2.assign(Z_STRVAL_PP(args[1]), Z_STRLEN_PP(args[1]));
  arg2 = &temp2;
  
  
  /*@SWIG:/data/home/olly/tmp/xapian-svn-snapshot/tags/1.2.8/xapian/swig/Lib/php/utils.i,7,CONVERT_INT_IN@*/
  convert_to_long_ex(args[2]);
  arg3 = (unsigned int) Z_LVAL_PP(args[2]);
  /*@SWIG@*/;
  
  {
    try {
      result = ((Xapian::Database const *)arg1)->get_spelling_suggestion((std::string const &)*arg2,arg3);
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  
  ZVAL_STRINGL(return_value, const_cast<char*>((&result)->data()), (&result)->size(), 1);
  
  
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_Database_get_spelling_suggestion__SWIG_1) {
  Xapian::Database *arg1 = (Xapian::Database *) 0 ;
  std::string *arg2 = 0 ;
  std::string temp2 ;
  zval **args[2];
  std::string 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_Xapian__Database, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of Database_get_spelling_suggestion. Expected SWIGTYPE_p_Xapian__Database");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  
  convert_to_string_ex(args[1]);
  temp2.assign(Z_STRVAL_PP(args[1]), Z_STRLEN_PP(args[1]));
  arg2 = &temp2;
  
  {
    try {
      result = ((Xapian::Database const *)arg1)->get_spelling_suggestion((std::string const &)*arg2);
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  
  ZVAL_STRINGL(return_value, const_cast<char*>((&result)->data()), (&result)->size(), 1);
  
  
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_Database_get_spelling_suggestion) {
  int argc;
  zval **argv[3];
  
  argc = ZEND_NUM_ARGS();
  zend_get_parameters_array_ex(argc,argv);
  if (argc == 2) {
    int _v;
    {
      void *tmp;
      _v = (SWIG_ConvertPtr(*argv[0], (void**)&tmp, SWIGTYPE_p_Xapian__Database, 0) >= 0);
    }
    if (_v) {
      {
        _v = (Z_TYPE_PP(argv[1]) == IS_STRING);
      }
      if (_v) {
        _wrap_Database_get_spelling_suggestion__SWIG_1(INTERNAL_FUNCTION_PARAM_PASSTHRU); return;
      }
    }
  }
  if (argc == 3) {
    int _v;
    {
      void *tmp;
      _v = (SWIG_ConvertPtr(*argv[0], (void**)&tmp, SWIGTYPE_p_Xapian__Database, 0) >= 0);
    }
    if (_v) {
      {
        _v = (Z_TYPE_PP(argv[1]) == IS_STRING);
      }
      if (_v) {
        _v = (Z_TYPE_PP(argv[2]) == IS_LONG); 
        if (_v) {
          _wrap_Database_get_spelling_suggestion__SWIG_0(INTERNAL_FUNCTION_PARAM_PASSTHRU); return;
        }
      }
    }
  }
  
  SWIG_ErrorCode() = E_ERROR;
  SWIG_ErrorMsg() = "No matching function for overloaded 'Database_get_spelling_suggestion'";
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_Database_spellings_begin) {
  Xapian::Database *arg1 = (Xapian::Database *) 0 ;
  zval **args[1];
  Xapian::TermIterator 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_Xapian__Database, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of Database_spellings_begin. Expected SWIGTYPE_p_Xapian__Database");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    try {
      result = ((Xapian::Database const *)arg1)->spellings_begin();
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  {
    Xapian::TermIterator * resultobj = new Xapian::TermIterator((const Xapian::TermIterator &) result);
    SWIG_SetPointerZval(return_value, (void *)resultobj, SWIGTYPE_p_Xapian__TermIterator, 1);
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_Database_spellings_end) {
  Xapian::Database *arg1 = (Xapian::Database *) 0 ;
  zval **args[1];
  Xapian::TermIterator 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_Xapian__Database, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of Database_spellings_end. Expected SWIGTYPE_p_Xapian__Database");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    try {
      result = ((Xapian::Database const *)arg1)->spellings_end();
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  {
    Xapian::TermIterator * resultobj = new Xapian::TermIterator((const Xapian::TermIterator &) result);
    SWIG_SetPointerZval(return_value, (void *)resultobj, SWIGTYPE_p_Xapian__TermIterator, 1);
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_Database_synonyms_begin) {
  Xapian::Database *arg1 = (Xapian::Database *) 0 ;
  std::string *arg2 = 0 ;
  std::string temp2 ;
  zval **args[2];
  Xapian::TermIterator 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_Xapian__Database, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of Database_synonyms_begin. Expected SWIGTYPE_p_Xapian__Database");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  
  convert_to_string_ex(args[1]);
  temp2.assign(Z_STRVAL_PP(args[1]), Z_STRLEN_PP(args[1]));
  arg2 = &temp2;
  
  {
    try {
      result = ((Xapian::Database const *)arg1)->synonyms_begin((std::string const &)*arg2);
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  {
    Xapian::TermIterator * resultobj = new Xapian::TermIterator((const Xapian::TermIterator &) result);
    SWIG_SetPointerZval(return_value, (void *)resultobj, SWIGTYPE_p_Xapian__TermIterator, 1);
  }
  
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_Database_synonyms_end) {
  Xapian::Database *arg1 = (Xapian::Database *) 0 ;
  std::string *arg2 = 0 ;
  std::string temp2 ;
  zval **args[2];
  Xapian::TermIterator 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_Xapian__Database, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of Database_synonyms_end. Expected SWIGTYPE_p_Xapian__Database");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  
  convert_to_string_ex(args[1]);
  temp2.assign(Z_STRVAL_PP(args[1]), Z_STRLEN_PP(args[1]));
  arg2 = &temp2;
  
  {
    try {
      result = ((Xapian::Database const *)arg1)->synonyms_end((std::string const &)*arg2);
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  {
    Xapian::TermIterator * resultobj = new Xapian::TermIterator((const Xapian::TermIterator &) result);
    SWIG_SetPointerZval(return_value, (void *)resultobj, SWIGTYPE_p_Xapian__TermIterator, 1);
  }
  
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_Database_synonym_keys_begin__SWIG_0) {
  Xapian::Database *arg1 = (Xapian::Database *) 0 ;
  std::string *arg2 = 0 ;
  std::string temp2 ;
  zval **args[2];
  Xapian::TermIterator 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_Xapian__Database, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of Database_synonym_keys_begin. Expected SWIGTYPE_p_Xapian__Database");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  
  convert_to_string_ex(args[1]);
  temp2.assign(Z_STRVAL_PP(args[1]), Z_STRLEN_PP(args[1]));
  arg2 = &temp2;
  
  {
    try {
      result = ((Xapian::Database const *)arg1)->synonym_keys_begin((std::string const &)*arg2);
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  {
    Xapian::TermIterator * resultobj = new Xapian::TermIterator((const Xapian::TermIterator &) result);
    SWIG_SetPointerZval(return_value, (void *)resultobj, SWIGTYPE_p_Xapian__TermIterator, 1);
  }
  
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_Database_synonym_keys_begin__SWIG_1) {
  Xapian::Database *arg1 = (Xapian::Database *) 0 ;
  zval **args[1];
  Xapian::TermIterator 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_Xapian__Database, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of Database_synonym_keys_begin. Expected SWIGTYPE_p_Xapian__Database");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    try {
      result = ((Xapian::Database const *)arg1)->synonym_keys_begin();
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  {
    Xapian::TermIterator * resultobj = new Xapian::TermIterator((const Xapian::TermIterator &) result);
    SWIG_SetPointerZval(return_value, (void *)resultobj, SWIGTYPE_p_Xapian__TermIterator, 1);
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_Database_synonym_keys_begin) {
  int argc;
  zval **argv[2];
  
  argc = ZEND_NUM_ARGS();
  zend_get_parameters_array_ex(argc,argv);
  if (argc == 1) {
    int _v;
    {
      void *tmp;
      _v = (SWIG_ConvertPtr(*argv[0], (void**)&tmp, SWIGTYPE_p_Xapian__Database, 0) >= 0);
    }
    if (_v) {
      _wrap_Database_synonym_keys_begin__SWIG_1(INTERNAL_FUNCTION_PARAM_PASSTHRU); return;
    }
  }
  if (argc == 2) {
    int _v;
    {
      void *tmp;
      _v = (SWIG_ConvertPtr(*argv[0], (void**)&tmp, SWIGTYPE_p_Xapian__Database, 0) >= 0);
    }
    if (_v) {
      {
        _v = (Z_TYPE_PP(argv[1]) == IS_STRING);
      }
      if (_v) {
        _wrap_Database_synonym_keys_begin__SWIG_0(INTERNAL_FUNCTION_PARAM_PASSTHRU); return;
      }
    }
  }
  
  SWIG_ErrorCode() = E_ERROR;
  SWIG_ErrorMsg() = "No matching function for overloaded 'Database_synonym_keys_begin'";
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_Database_synonym_keys_end__SWIG_0) {
  Xapian::Database *arg1 = (Xapian::Database *) 0 ;
  std::string *arg2 = 0 ;
  std::string temp2 ;
  zval **args[2];
  Xapian::TermIterator 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_Xapian__Database, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of Database_synonym_keys_end. Expected SWIGTYPE_p_Xapian__Database");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  
  convert_to_string_ex(args[1]);
  temp2.assign(Z_STRVAL_PP(args[1]), Z_STRLEN_PP(args[1]));
  arg2 = &temp2;
  
  {
    try {
      result = ((Xapian::Database const *)arg1)->synonym_keys_end((std::string const &)*arg2);
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  {
    Xapian::TermIterator * resultobj = new Xapian::TermIterator((const Xapian::TermIterator &) result);
    SWIG_SetPointerZval(return_value, (void *)resultobj, SWIGTYPE_p_Xapian__TermIterator, 1);
  }
  
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_Database_synonym_keys_end__SWIG_1) {
  Xapian::Database *arg1 = (Xapian::Database *) 0 ;
  zval **args[1];
  Xapian::TermIterator 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_Xapian__Database, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of Database_synonym_keys_end. Expected SWIGTYPE_p_Xapian__Database");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    try {
      result = ((Xapian::Database const *)arg1)->synonym_keys_end();
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  {
    Xapian::TermIterator * resultobj = new Xapian::TermIterator((const Xapian::TermIterator &) result);
    SWIG_SetPointerZval(return_value, (void *)resultobj, SWIGTYPE_p_Xapian__TermIterator, 1);
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_Database_synonym_keys_end) {
  int argc;
  zval **argv[2];
  
  argc = ZEND_NUM_ARGS();
  zend_get_parameters_array_ex(argc,argv);
  if (argc == 1) {
    int _v;
    {
      void *tmp;
      _v = (SWIG_ConvertPtr(*argv[0], (void**)&tmp, SWIGTYPE_p_Xapian__Database, 0) >= 0);
    }
    if (_v) {
      _wrap_Database_synonym_keys_end__SWIG_1(INTERNAL_FUNCTION_PARAM_PASSTHRU); return;
    }
  }
  if (argc == 2) {
    int _v;
    {
      void *tmp;
      _v = (SWIG_ConvertPtr(*argv[0], (void**)&tmp, SWIGTYPE_p_Xapian__Database, 0) >= 0);
    }
    if (_v) {
      {
        _v = (Z_TYPE_PP(argv[1]) == IS_STRING);
      }
      if (_v) {
        _wrap_Database_synonym_keys_end__SWIG_0(INTERNAL_FUNCTION_PARAM_PASSTHRU); return;
      }
    }
  }
  
  SWIG_ErrorCode() = E_ERROR;
  SWIG_ErrorMsg() = "No matching function for overloaded 'Database_synonym_keys_end'";
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_Database_get_metadata) {
  Xapian::Database *arg1 = (Xapian::Database *) 0 ;
  std::string *arg2 = 0 ;
  std::string temp2 ;
  zval **args[2];
  std::string 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_Xapian__Database, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of Database_get_metadata. Expected SWIGTYPE_p_Xapian__Database");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  
  convert_to_string_ex(args[1]);
  temp2.assign(Z_STRVAL_PP(args[1]), Z_STRLEN_PP(args[1]));
  arg2 = &temp2;
  
  {
    try {
      result = ((Xapian::Database const *)arg1)->get_metadata((std::string const &)*arg2);
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  
  ZVAL_STRINGL(return_value, const_cast<char*>((&result)->data()), (&result)->size(), 1);
  
  
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_Database_metadata_keys_begin__SWIG_0) {
  Xapian::Database *arg1 = (Xapian::Database *) 0 ;
  std::string *arg2 = 0 ;
  std::string temp2 ;
  zval **args[2];
  Xapian::TermIterator 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_Xapian__Database, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of Database_metadata_keys_begin. Expected SWIGTYPE_p_Xapian__Database");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  
  convert_to_string_ex(args[1]);
  temp2.assign(Z_STRVAL_PP(args[1]), Z_STRLEN_PP(args[1]));
  arg2 = &temp2;
  
  {
    try {
      result = ((Xapian::Database const *)arg1)->metadata_keys_begin((std::string const &)*arg2);
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  {
    Xapian::TermIterator * resultobj = new Xapian::TermIterator((const Xapian::TermIterator &) result);
    SWIG_SetPointerZval(return_value, (void *)resultobj, SWIGTYPE_p_Xapian__TermIterator, 1);
  }
  
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_Database_metadata_keys_begin__SWIG_1) {
  Xapian::Database *arg1 = (Xapian::Database *) 0 ;
  zval **args[1];
  Xapian::TermIterator 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_Xapian__Database, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of Database_metadata_keys_begin. Expected SWIGTYPE_p_Xapian__Database");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    try {
      result = ((Xapian::Database const *)arg1)->metadata_keys_begin();
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  {
    Xapian::TermIterator * resultobj = new Xapian::TermIterator((const Xapian::TermIterator &) result);
    SWIG_SetPointerZval(return_value, (void *)resultobj, SWIGTYPE_p_Xapian__TermIterator, 1);
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_Database_metadata_keys_begin) {
  int argc;
  zval **argv[2];
  
  argc = ZEND_NUM_ARGS();
  zend_get_parameters_array_ex(argc,argv);
  if (argc == 1) {
    int _v;
    {
      void *tmp;
      _v = (SWIG_ConvertPtr(*argv[0], (void**)&tmp, SWIGTYPE_p_Xapian__Database, 0) >= 0);
    }
    if (_v) {
      _wrap_Database_metadata_keys_begin__SWIG_1(INTERNAL_FUNCTION_PARAM_PASSTHRU); return;
    }
  }
  if (argc == 2) {
    int _v;
    {
      void *tmp;
      _v = (SWIG_ConvertPtr(*argv[0], (void**)&tmp, SWIGTYPE_p_Xapian__Database, 0) >= 0);
    }
    if (_v) {
      {
        _v = (Z_TYPE_PP(argv[1]) == IS_STRING);
      }
      if (_v) {
        _wrap_Database_metadata_keys_begin__SWIG_0(INTERNAL_FUNCTION_PARAM_PASSTHRU); return;
      }
    }
  }
  
  SWIG_ErrorCode() = E_ERROR;
  SWIG_ErrorMsg() = "No matching function for overloaded 'Database_metadata_keys_begin'";
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_Database_metadata_keys_end__SWIG_0) {
  Xapian::Database *arg1 = (Xapian::Database *) 0 ;
  std::string *arg2 = 0 ;
  std::string temp2 ;
  zval **args[2];
  Xapian::TermIterator 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_Xapian__Database, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of Database_metadata_keys_end. Expected SWIGTYPE_p_Xapian__Database");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  
  convert_to_string_ex(args[1]);
  temp2.assign(Z_STRVAL_PP(args[1]), Z_STRLEN_PP(args[1]));
  arg2 = &temp2;
  
  {
    try {
      result = ((Xapian::Database const *)arg1)->metadata_keys_end((std::string const &)*arg2);
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  {
    Xapian::TermIterator * resultobj = new Xapian::TermIterator((const Xapian::TermIterator &) result);
    SWIG_SetPointerZval(return_value, (void *)resultobj, SWIGTYPE_p_Xapian__TermIterator, 1);
  }
  
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_Database_metadata_keys_end__SWIG_1) {
  Xapian::Database *arg1 = (Xapian::Database *) 0 ;
  zval **args[1];
  Xapian::TermIterator 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_Xapian__Database, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of Database_metadata_keys_end. Expected SWIGTYPE_p_Xapian__Database");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    try {
      result = ((Xapian::Database const *)arg1)->metadata_keys_end();
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  {
    Xapian::TermIterator * resultobj = new Xapian::TermIterator((const Xapian::TermIterator &) result);
    SWIG_SetPointerZval(return_value, (void *)resultobj, SWIGTYPE_p_Xapian__TermIterator, 1);
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_Database_metadata_keys_end) {
  int argc;
  zval **argv[2];
  
  argc = ZEND_NUM_ARGS();
  zend_get_parameters_array_ex(argc,argv);
  if (argc == 1) {
    int _v;
    {
      void *tmp;
      _v = (SWIG_ConvertPtr(*argv[0], (void**)&tmp, SWIGTYPE_p_Xapian__Database, 0) >= 0);
    }
    if (_v) {
      _wrap_Database_metadata_keys_end__SWIG_1(INTERNAL_FUNCTION_PARAM_PASSTHRU); return;
    }
  }
  if (argc == 2) {
    int _v;
    {
      void *tmp;
      _v = (SWIG_ConvertPtr(*argv[0], (void**)&tmp, SWIGTYPE_p_Xapian__Database, 0) >= 0);
    }
    if (_v) {
      {
        _v = (Z_TYPE_PP(argv[1]) == IS_STRING);
      }
      if (_v) {
        _wrap_Database_metadata_keys_end__SWIG_0(INTERNAL_FUNCTION_PARAM_PASSTHRU); return;
      }
    }
  }
  
  SWIG_ErrorCode() = E_ERROR;
  SWIG_ErrorMsg() = "No matching function for overloaded 'Database_metadata_keys_end'";
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_Database_get_uuid) {
  Xapian::Database *arg1 = (Xapian::Database *) 0 ;
  zval **args[1];
  std::string 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_Xapian__Database, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of Database_get_uuid. Expected SWIGTYPE_p_Xapian__Database");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    try {
      result = ((Xapian::Database const *)arg1)->get_uuid();
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  
  ZVAL_STRINGL(return_value, const_cast<char*>((&result)->data()), (&result)->size(), 1);
  
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_Database_has_positions) {
  Xapian::Database *arg1 = (Xapian::Database *) 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_Xapian__Database, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of Database_has_positions. Expected SWIGTYPE_p_Xapian__Database");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    try {
      result = (bool)((Xapian::Database const *)arg1)->has_positions();
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  {
    ZVAL_BOOL(return_value,(result)?1:0);
  }
  return;
fail:
  zend_error(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_WritableDatabase(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 ;
  Xapian::WritableDatabase *arg1 = (Xapian::WritableDatabase *) 0 ;
  
  efree(value);
  if (! newobject) return; /* can't delete it! */
  arg1 = (Xapian::WritableDatabase *)SWIG_ZTS_ConvertResourceData(ptr,type_name,SWIGTYPE_p_Xapian__WritableDatabase TSRMLS_CC);
  if (! arg1) zend_error(E_ERROR, "Xapian::WritableDatabase resource already free'd");
  {
    try {
      delete arg1;
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_new_WritableDatabase__SWIG_0) {
  Xapian::WritableDatabase *result = 0 ;
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 0) {
    WRONG_PARAM_COUNT;
  }
  
  {
    try {
      result = (Xapian::WritableDatabase *)new Xapian::WritableDatabase();
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  
  SWIG_SetPointerZval(return_value, (void *)result, SWIGTYPE_p_Xapian__WritableDatabase, 1);
  
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_new_WritableDatabase__SWIG_1) {
  std::string *arg1 = 0 ;
  int arg2 ;
  std::string temp1 ;
  zval **args[2];
  Xapian::WritableDatabase *result = 0 ;
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 2 || zend_get_parameters_array_ex(2, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  
  convert_to_string_ex(args[0]);
  temp1.assign(Z_STRVAL_PP(args[0]), Z_STRLEN_PP(args[0]));
  arg1 = &temp1;
  
  
  /*@SWIG:/data/home/olly/tmp/xapian-svn-snapshot/tags/1.2.8/xapian/swig/Lib/php/utils.i,7,CONVERT_INT_IN@*/
  convert_to_long_ex(args[1]);
  arg2 = (int) Z_LVAL_PP(args[1]);
  /*@SWIG@*/;
  
  {
    try {
      result = (Xapian::WritableDatabase *)new Xapian::WritableDatabase((std::string const &)*arg1,arg2);
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  
  SWIG_SetPointerZval(return_value, (void *)result, SWIGTYPE_p_Xapian__WritableDatabase, 1);
  
  
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_new_WritableDatabase__SWIG_2) {
  Xapian::WritableDatabase *arg1 = 0 ;
  zval **args[1];
  Xapian::WritableDatabase *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_Xapian__WritableDatabase, 0) < 0 || arg1 == NULL) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of new_WritableDatabase. Expected SWIGTYPE_p_Xapian__WritableDatabase");
    }
  }
  {
    try {
      result = (Xapian::WritableDatabase *)new Xapian::WritableDatabase((Xapian::WritableDatabase const &)*arg1);
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  
  SWIG_SetPointerZval(return_value, (void *)result, SWIGTYPE_p_Xapian__WritableDatabase, 1);
  
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_new_WritableDatabase) {
  int argc;
  zval **argv[2];
  
  argc = ZEND_NUM_ARGS();
  zend_get_parameters_array_ex(argc,argv);
  if (argc == 0) {
    _wrap_new_WritableDatabase__SWIG_0(INTERNAL_FUNCTION_PARAM_PASSTHRU); return;
  }
  if (argc == 1) {
    int _v;
    {
      void *ptr;
      _v = (SWIG_ConvertPtr(*argv[0], (void **)&ptr, SWIGTYPE_p_Xapian__WritableDatabase, 0) == 0);
    }
    if (_v) {
      _wrap_new_WritableDatabase__SWIG_2(INTERNAL_FUNCTION_PARAM_PASSTHRU); return;
    }
  }
  if (argc == 2) {
    int _v;
    {
      _v = (Z_TYPE_PP(argv[0]) == IS_STRING);
    }
    if (_v) {
      _v = (Z_TYPE_PP(argv[1]) == IS_LONG); 
      if (_v) {
        _wrap_new_WritableDatabase__SWIG_1(INTERNAL_FUNCTION_PARAM_PASSTHRU); return;
      }
    }
  }
  
  SWIG_ErrorCode() = E_ERROR;
  SWIG_ErrorMsg() = "No matching function for overloaded 'new_WritableDatabase'";
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_WritableDatabase_commit) {
  Xapian::WritableDatabase *arg1 = (Xapian::WritableDatabase *) 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_Xapian__WritableDatabase, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of WritableDatabase_commit. Expected SWIGTYPE_p_Xapian__WritableDatabase");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    try {
      (arg1)->commit();
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_WritableDatabase_flush) {
  Xapian::WritableDatabase *arg1 = (Xapian::WritableDatabase *) 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_Xapian__WritableDatabase, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of WritableDatabase_flush. Expected SWIGTYPE_p_Xapian__WritableDatabase");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    try {
      (arg1)->flush();
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_WritableDatabase_begin_transaction__SWIG_0) {
  Xapian::WritableDatabase *arg1 = (Xapian::WritableDatabase *) 0 ;
  bool 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_Xapian__WritableDatabase, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of WritableDatabase_begin_transaction. Expected SWIGTYPE_p_Xapian__WritableDatabase");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  
  /*@SWIG:/data/home/olly/tmp/xapian-svn-snapshot/tags/1.2.8/xapian/swig/Lib/php/utils.i,2,CONVERT_BOOL_IN@*/
  convert_to_boolean_ex(args[1]);
  arg2 = (bool) Z_LVAL_PP(args[1]);
  /*@SWIG@*/;
  
  {
    try {
      (arg1)->begin_transaction(arg2);
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_WritableDatabase_begin_transaction__SWIG_1) {
  Xapian::WritableDatabase *arg1 = (Xapian::WritableDatabase *) 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_Xapian__WritableDatabase, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of WritableDatabase_begin_transaction. Expected SWIGTYPE_p_Xapian__WritableDatabase");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    try {
      (arg1)->begin_transaction();
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_WritableDatabase_begin_transaction) {
  int argc;
  zval **argv[2];
  
  argc = ZEND_NUM_ARGS();
  zend_get_parameters_array_ex(argc,argv);
  if (argc == 1) {
    int _v;
    {
      void *tmp;
      _v = (SWIG_ConvertPtr(*argv[0], (void**)&tmp, SWIGTYPE_p_Xapian__WritableDatabase, 0) >= 0);
    }
    if (_v) {
      _wrap_WritableDatabase_begin_transaction__SWIG_1(INTERNAL_FUNCTION_PARAM_PASSTHRU); return;
    }
  }
  if (argc == 2) {
    int _v;
    {
      void *tmp;
      _v = (SWIG_ConvertPtr(*argv[0], (void**)&tmp, SWIGTYPE_p_Xapian__WritableDatabase, 0) >= 0);
    }
    if (_v) {
      {
        _v = (Z_TYPE_PP(argv[1]) == IS_BOOL || Z_TYPE_PP(argv[1]) == IS_LONG);
      }
      if (_v) {
        _wrap_WritableDatabase_begin_transaction__SWIG_0(INTERNAL_FUNCTION_PARAM_PASSTHRU); return;
      }
    }
  }
  
  SWIG_ErrorCode() = E_ERROR;
  SWIG_ErrorMsg() = "No matching function for overloaded 'WritableDatabase_begin_transaction'";
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_WritableDatabase_commit_transaction) {
  Xapian::WritableDatabase *arg1 = (Xapian::WritableDatabase *) 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_Xapian__WritableDatabase, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of WritableDatabase_commit_transaction. Expected SWIGTYPE_p_Xapian__WritableDatabase");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    try {
      (arg1)->commit_transaction();
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_WritableDatabase_cancel_transaction) {
  Xapian::WritableDatabase *arg1 = (Xapian::WritableDatabase *) 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_Xapian__WritableDatabase, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of WritableDatabase_cancel_transaction. Expected SWIGTYPE_p_Xapian__WritableDatabase");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    try {
      (arg1)->cancel_transaction();
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_WritableDatabase_add_document) {
  Xapian::WritableDatabase *arg1 = (Xapian::WritableDatabase *) 0 ;
  Xapian::Document *arg2 = 0 ;
  zval **args[2];
  Xapian::docid 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_Xapian__WritableDatabase, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of WritableDatabase_add_document. Expected SWIGTYPE_p_Xapian__WritableDatabase");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    if (SWIG_ConvertPtr(*args[1], (void**)&arg2, SWIGTYPE_p_Xapian__Document, 0) < 0 || arg2 == NULL) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 2 of WritableDatabase_add_document. Expected SWIGTYPE_p_Xapian__Document");
    }
  }
  {
    try {
      result = (Xapian::docid)(arg1)->add_document((Xapian::Document const &)*arg2);
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  {
    ZVAL_LONG(return_value,result);
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_WritableDatabase_delete_document__SWIG_0) {
  Xapian::WritableDatabase *arg1 = (Xapian::WritableDatabase *) 0 ;
  Xapian::docid 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_Xapian__WritableDatabase, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of WritableDatabase_delete_document. Expected SWIGTYPE_p_Xapian__WritableDatabase");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  
  /*@SWIG:/data/home/olly/tmp/xapian-svn-snapshot/tags/1.2.8/xapian/swig/Lib/php/utils.i,7,CONVERT_INT_IN@*/
  convert_to_long_ex(args[1]);
  arg2 = (Xapian::docid) Z_LVAL_PP(args[1]);
  /*@SWIG@*/;
  
  {
    try {
      (arg1)->delete_document(arg2);
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_WritableDatabase_replace_document__SWIG_0) {
  Xapian::WritableDatabase *arg1 = (Xapian::WritableDatabase *) 0 ;
  Xapian::docid arg2 ;
  Xapian::Document *arg3 = 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_Xapian__WritableDatabase, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of WritableDatabase_replace_document. Expected SWIGTYPE_p_Xapian__WritableDatabase");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  
  /*@SWIG:/data/home/olly/tmp/xapian-svn-snapshot/tags/1.2.8/xapian/swig/Lib/php/utils.i,7,CONVERT_INT_IN@*/
  convert_to_long_ex(args[1]);
  arg2 = (Xapian::docid) Z_LVAL_PP(args[1]);
  /*@SWIG@*/;
  
  {
    if (SWIG_ConvertPtr(*args[2], (void**)&arg3, SWIGTYPE_p_Xapian__Document, 0) < 0 || arg3 == NULL) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 3 of WritableDatabase_replace_document. Expected SWIGTYPE_p_Xapian__Document");
    }
  }
  {
    try {
      (arg1)->replace_document(arg2,(Xapian::Document const &)*arg3);
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_WritableDatabase_delete_document__SWIG_1) {
  Xapian::WritableDatabase *arg1 = (Xapian::WritableDatabase *) 0 ;
  std::string *arg2 = 0 ;
  std::string temp2 ;
  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_Xapian__WritableDatabase, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of WritableDatabase_delete_document. Expected SWIGTYPE_p_Xapian__WritableDatabase");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  
  convert_to_string_ex(args[1]);
  temp2.assign(Z_STRVAL_PP(args[1]), Z_STRLEN_PP(args[1]));
  arg2 = &temp2;
  
  {
    try {
      (arg1)->delete_document((std::string const &)*arg2);
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  
  
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_WritableDatabase_delete_document) {
  int argc;
  zval **argv[2];
  
  argc = ZEND_NUM_ARGS();
  zend_get_parameters_array_ex(argc,argv);
  if (argc == 2) {
    int _v;
    {
      void *tmp;
      _v = (SWIG_ConvertPtr(*argv[0], (void**)&tmp, SWIGTYPE_p_Xapian__WritableDatabase, 0) >= 0);
    }
    if (_v) {
      {
        _v = (Z_TYPE_PP(argv[1]) == IS_STRING);
      }
      if (_v) {
        _wrap_WritableDatabase_delete_document__SWIG_1(INTERNAL_FUNCTION_PARAM_PASSTHRU); return;
      }
    }
  }
  if (argc == 2) {
    int _v;
    {
      void *tmp;
      _v = (SWIG_ConvertPtr(*argv[0], (void**)&tmp, SWIGTYPE_p_Xapian__WritableDatabase, 0) >= 0);
    }
    if (_v) {
      _v = (Z_TYPE_PP(argv[1]) == IS_LONG); 
      if (_v) {
        _wrap_WritableDatabase_delete_document__SWIG_0(INTERNAL_FUNCTION_PARAM_PASSTHRU); return;
      }
    }
  }
  
  SWIG_ErrorCode() = E_ERROR;
  SWIG_ErrorMsg() = "No matching function for overloaded 'WritableDatabase_delete_document'";
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_WritableDatabase_replace_document__SWIG_1) {
  Xapian::WritableDatabase *arg1 = (Xapian::WritableDatabase *) 0 ;
  std::string *arg2 = 0 ;
  Xapian::Document *arg3 = 0 ;
  std::string temp2 ;
  zval **args[3];
  Xapian::docid 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_Xapian__WritableDatabase, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of WritableDatabase_replace_document. Expected SWIGTYPE_p_Xapian__WritableDatabase");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  
  convert_to_string_ex(args[1]);
  temp2.assign(Z_STRVAL_PP(args[1]), Z_STRLEN_PP(args[1]));
  arg2 = &temp2;
  
  {
    if (SWIG_ConvertPtr(*args[2], (void**)&arg3, SWIGTYPE_p_Xapian__Document, 0) < 0 || arg3 == NULL) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 3 of WritableDatabase_replace_document. Expected SWIGTYPE_p_Xapian__Document");
    }
  }
  {
    try {
      result = (Xapian::docid)(arg1)->replace_document((std::string const &)*arg2,(Xapian::Document const &)*arg3);
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  {
    ZVAL_LONG(return_value,result);
  }
  
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_WritableDatabase_replace_document) {
  int argc;
  zval **argv[3];
  
  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_Xapian__WritableDatabase, 0) >= 0);
    }
    if (_v) {
      {
        _v = (Z_TYPE_PP(argv[1]) == IS_STRING);
      }
      if (_v) {
        {
          void *ptr;
          _v = (SWIG_ConvertPtr(*argv[2], (void **)&ptr, SWIGTYPE_p_Xapian__Document, 0) == 0);
        }
        if (_v) {
          _wrap_WritableDatabase_replace_document__SWIG_1(INTERNAL_FUNCTION_PARAM_PASSTHRU); return;
        }
      }
    }
  }
  if (argc == 3) {
    int _v;
    {
      void *tmp;
      _v = (SWIG_ConvertPtr(*argv[0], (void**)&tmp, SWIGTYPE_p_Xapian__WritableDatabase, 0) >= 0);
    }
    if (_v) {
      _v = (Z_TYPE_PP(argv[1]) == IS_LONG); 
      if (_v) {
        {
          void *ptr;
          _v = (SWIG_ConvertPtr(*argv[2], (void **)&ptr, SWIGTYPE_p_Xapian__Document, 0) == 0);
        }
        if (_v) {
          _wrap_WritableDatabase_replace_document__SWIG_0(INTERNAL_FUNCTION_PARAM_PASSTHRU); return;
        }
      }
    }
  }
  
  SWIG_ErrorCode() = E_ERROR;
  SWIG_ErrorMsg() = "No matching function for overloaded 'WritableDatabase_replace_document'";
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_WritableDatabase_add_spelling__SWIG_0) {
  Xapian::WritableDatabase *arg1 = (Xapian::WritableDatabase *) 0 ;
  std::string *arg2 = 0 ;
  Xapian::termcount arg3 ;
  std::string temp2 ;
  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_Xapian__WritableDatabase, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of WritableDatabase_add_spelling. Expected SWIGTYPE_p_Xapian__WritableDatabase");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  
  convert_to_string_ex(args[1]);
  temp2.assign(Z_STRVAL_PP(args[1]), Z_STRLEN_PP(args[1]));
  arg2 = &temp2;
  
  
  /*@SWIG:/data/home/olly/tmp/xapian-svn-snapshot/tags/1.2.8/xapian/swig/Lib/php/utils.i,7,CONVERT_INT_IN@*/
  convert_to_long_ex(args[2]);
  arg3 = (Xapian::termcount) Z_LVAL_PP(args[2]);
  /*@SWIG@*/;
  
  {
    try {
      ((Xapian::WritableDatabase const *)arg1)->add_spelling((std::string const &)*arg2,arg3);
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  
  
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_WritableDatabase_add_spelling__SWIG_1) {
  Xapian::WritableDatabase *arg1 = (Xapian::WritableDatabase *) 0 ;
  std::string *arg2 = 0 ;
  std::string temp2 ;
  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_Xapian__WritableDatabase, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of WritableDatabase_add_spelling. Expected SWIGTYPE_p_Xapian__WritableDatabase");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  
  convert_to_string_ex(args[1]);
  temp2.assign(Z_STRVAL_PP(args[1]), Z_STRLEN_PP(args[1]));
  arg2 = &temp2;
  
  {
    try {
      ((Xapian::WritableDatabase const *)arg1)->add_spelling((std::string const &)*arg2);
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  
  
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_WritableDatabase_add_spelling) {
  int argc;
  zval **argv[3];
  
  argc = ZEND_NUM_ARGS();
  zend_get_parameters_array_ex(argc,argv);
  if (argc == 2) {
    int _v;
    {
      void *tmp;
      _v = (SWIG_ConvertPtr(*argv[0], (void**)&tmp, SWIGTYPE_p_Xapian__WritableDatabase, 0) >= 0);
    }
    if (_v) {
      {
        _v = (Z_TYPE_PP(argv[1]) == IS_STRING);
      }
      if (_v) {
        _wrap_WritableDatabase_add_spelling__SWIG_1(INTERNAL_FUNCTION_PARAM_PASSTHRU); return;
      }
    }
  }
  if (argc == 3) {
    int _v;
    {
      void *tmp;
      _v = (SWIG_ConvertPtr(*argv[0], (void**)&tmp, SWIGTYPE_p_Xapian__WritableDatabase, 0) >= 0);
    }
    if (_v) {
      {
        _v = (Z_TYPE_PP(argv[1]) == IS_STRING);
      }
      if (_v) {
        _v = (Z_TYPE_PP(argv[2]) == IS_LONG); 
        if (_v) {
          _wrap_WritableDatabase_add_spelling__SWIG_0(INTERNAL_FUNCTION_PARAM_PASSTHRU); return;
        }
      }
    }
  }
  
  SWIG_ErrorCode() = E_ERROR;
  SWIG_ErrorMsg() = "No matching function for overloaded 'WritableDatabase_add_spelling'";
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_WritableDatabase_remove_spelling__SWIG_0) {
  Xapian::WritableDatabase *arg1 = (Xapian::WritableDatabase *) 0 ;
  std::string *arg2 = 0 ;
  Xapian::termcount arg3 ;
  std::string temp2 ;
  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_Xapian__WritableDatabase, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of WritableDatabase_remove_spelling. Expected SWIGTYPE_p_Xapian__WritableDatabase");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  
  convert_to_string_ex(args[1]);
  temp2.assign(Z_STRVAL_PP(args[1]), Z_STRLEN_PP(args[1]));
  arg2 = &temp2;
  
  
  /*@SWIG:/data/home/olly/tmp/xapian-svn-snapshot/tags/1.2.8/xapian/swig/Lib/php/utils.i,7,CONVERT_INT_IN@*/
  convert_to_long_ex(args[2]);
  arg3 = (Xapian::termcount) Z_LVAL_PP(args[2]);
  /*@SWIG@*/;
  
  {
    try {
      ((Xapian::WritableDatabase const *)arg1)->remove_spelling((std::string const &)*arg2,arg3);
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  
  
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_WritableDatabase_remove_spelling__SWIG_1) {
  Xapian::WritableDatabase *arg1 = (Xapian::WritableDatabase *) 0 ;
  std::string *arg2 = 0 ;
  std::string temp2 ;
  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_Xapian__WritableDatabase, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of WritableDatabase_remove_spelling. Expected SWIGTYPE_p_Xapian__WritableDatabase");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  
  convert_to_string_ex(args[1]);
  temp2.assign(Z_STRVAL_PP(args[1]), Z_STRLEN_PP(args[1]));
  arg2 = &temp2;
  
  {
    try {
      ((Xapian::WritableDatabase const *)arg1)->remove_spelling((std::string const &)*arg2);
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  
  
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_WritableDatabase_remove_spelling) {
  int argc;
  zval **argv[3];
  
  argc = ZEND_NUM_ARGS();
  zend_get_parameters_array_ex(argc,argv);
  if (argc == 2) {
    int _v;
    {
      void *tmp;
      _v = (SWIG_ConvertPtr(*argv[0], (void**)&tmp, SWIGTYPE_p_Xapian__WritableDatabase, 0) >= 0);
    }
    if (_v) {
      {
        _v = (Z_TYPE_PP(argv[1]) == IS_STRING);
      }
      if (_v) {
        _wrap_WritableDatabase_remove_spelling__SWIG_1(INTERNAL_FUNCTION_PARAM_PASSTHRU); return;
      }
    }
  }
  if (argc == 3) {
    int _v;
    {
      void *tmp;
      _v = (SWIG_ConvertPtr(*argv[0], (void**)&tmp, SWIGTYPE_p_Xapian__WritableDatabase, 0) >= 0);
    }
    if (_v) {
      {
        _v = (Z_TYPE_PP(argv[1]) == IS_STRING);
      }
      if (_v) {
        _v = (Z_TYPE_PP(argv[2]) == IS_LONG); 
        if (_v) {
          _wrap_WritableDatabase_remove_spelling__SWIG_0(INTERNAL_FUNCTION_PARAM_PASSTHRU); return;
        }
      }
    }
  }
  
  SWIG_ErrorCode() = E_ERROR;
  SWIG_ErrorMsg() = "No matching function for overloaded 'WritableDatabase_remove_spelling'";
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_WritableDatabase_add_synonym) {
  Xapian::WritableDatabase *arg1 = (Xapian::WritableDatabase *) 0 ;
  std::string *arg2 = 0 ;
  std::string *arg3 = 0 ;
  std::string temp2 ;
  std::string temp3 ;
  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_Xapian__WritableDatabase, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of WritableDatabase_add_synonym. Expected SWIGTYPE_p_Xapian__WritableDatabase");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  
  convert_to_string_ex(args[1]);
  temp2.assign(Z_STRVAL_PP(args[1]), Z_STRLEN_PP(args[1]));
  arg2 = &temp2;
  
  
  convert_to_string_ex(args[2]);
  temp3.assign(Z_STRVAL_PP(args[2]), Z_STRLEN_PP(args[2]));
  arg3 = &temp3;
  
  {
    try {
      ((Xapian::WritableDatabase const *)arg1)->add_synonym((std::string const &)*arg2,(std::string const &)*arg3);
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  
  
  
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_WritableDatabase_remove_synonym) {
  Xapian::WritableDatabase *arg1 = (Xapian::WritableDatabase *) 0 ;
  std::string *arg2 = 0 ;
  std::string *arg3 = 0 ;
  std::string temp2 ;
  std::string temp3 ;
  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_Xapian__WritableDatabase, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of WritableDatabase_remove_synonym. Expected SWIGTYPE_p_Xapian__WritableDatabase");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  
  convert_to_string_ex(args[1]);
  temp2.assign(Z_STRVAL_PP(args[1]), Z_STRLEN_PP(args[1]));
  arg2 = &temp2;
  
  
  convert_to_string_ex(args[2]);
  temp3.assign(Z_STRVAL_PP(args[2]), Z_STRLEN_PP(args[2]));
  arg3 = &temp3;
  
  {
    try {
      ((Xapian::WritableDatabase const *)arg1)->remove_synonym((std::string const &)*arg2,(std::string const &)*arg3);
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  
  
  
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_WritableDatabase_clear_synonyms) {
  Xapian::WritableDatabase *arg1 = (Xapian::WritableDatabase *) 0 ;
  std::string *arg2 = 0 ;
  std::string temp2 ;
  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_Xapian__WritableDatabase, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of WritableDatabase_clear_synonyms. Expected SWIGTYPE_p_Xapian__WritableDatabase");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  
  convert_to_string_ex(args[1]);
  temp2.assign(Z_STRVAL_PP(args[1]), Z_STRLEN_PP(args[1]));
  arg2 = &temp2;
  
  {
    try {
      ((Xapian::WritableDatabase const *)arg1)->clear_synonyms((std::string const &)*arg2);
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  
  
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_WritableDatabase_set_metadata) {
  Xapian::WritableDatabase *arg1 = (Xapian::WritableDatabase *) 0 ;
  std::string *arg2 = 0 ;
  std::string *arg3 = 0 ;
  std::string temp2 ;
  std::string temp3 ;
  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_Xapian__WritableDatabase, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of WritableDatabase_set_metadata. Expected SWIGTYPE_p_Xapian__WritableDatabase");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  
  convert_to_string_ex(args[1]);
  temp2.assign(Z_STRVAL_PP(args[1]), Z_STRLEN_PP(args[1]));
  arg2 = &temp2;
  
  
  convert_to_string_ex(args[2]);
  temp3.assign(Z_STRVAL_PP(args[2]), Z_STRLEN_PP(args[2]));
  arg3 = &temp3;
  
  {
    try {
      (arg1)->set_metadata((std::string const &)*arg2,(std::string const &)*arg3);
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  
  
  
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_WritableDatabase_get_description) {
  Xapian::WritableDatabase *arg1 = (Xapian::WritableDatabase *) 0 ;
  zval **args[1];
  std::string 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_Xapian__WritableDatabase, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of WritableDatabase_get_description. Expected SWIGTYPE_p_Xapian__WritableDatabase");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    try {
      result = ((Xapian::WritableDatabase const *)arg1)->get_description();
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  
  ZVAL_STRINGL(return_value, const_cast<char*>((&result)->data()), (&result)->size(), 1);
  
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_auto_open_stub) {
  std::string *arg1 = 0 ;
  std::string temp1 ;
  zval **args[1];
  Xapian::Database result;
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 1 || zend_get_parameters_array_ex(1, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  
  convert_to_string_ex(args[0]);
  temp1.assign(Z_STRVAL_PP(args[0]), Z_STRLEN_PP(args[0]));
  arg1 = &temp1;
  
  {
    try {
      result = Xapian::Auto::open_stub((std::string const &)*arg1);
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  {
    Xapian::Database * resultobj = new Xapian::Database((const Xapian::Database &) result);
    SWIG_SetPointerZval(return_value, (void *)resultobj, SWIGTYPE_p_Xapian__Database, 1);
  }
  
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_brass_open__SWIG_0) {
  std::string *arg1 = 0 ;
  std::string temp1 ;
  zval **args[1];
  Xapian::Database result;
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 1 || zend_get_parameters_array_ex(1, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  
  convert_to_string_ex(args[0]);
  temp1.assign(Z_STRVAL_PP(args[0]), Z_STRLEN_PP(args[0]));
  arg1 = &temp1;
  
  {
    try {
      result = Xapian::Brass::open((std::string const &)*arg1);
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  {
    Xapian::Database * resultobj = new Xapian::Database((const Xapian::Database &) result);
    SWIG_SetPointerZval(return_value, (void *)resultobj, SWIGTYPE_p_Xapian__Database, 1);
  }
  
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_brass_open__SWIG_1) {
  std::string *arg1 = 0 ;
  int arg2 ;
  int arg3 ;
  std::string temp1 ;
  zval **args[3];
  Xapian::WritableDatabase result;
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 3 || zend_get_parameters_array_ex(3, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  
  convert_to_string_ex(args[0]);
  temp1.assign(Z_STRVAL_PP(args[0]), Z_STRLEN_PP(args[0]));
  arg1 = &temp1;
  
  
  /*@SWIG:/data/home/olly/tmp/xapian-svn-snapshot/tags/1.2.8/xapian/swig/Lib/php/utils.i,7,CONVERT_INT_IN@*/
  convert_to_long_ex(args[1]);
  arg2 = (int) Z_LVAL_PP(args[1]);
  /*@SWIG@*/;
  
  
  /*@SWIG:/data/home/olly/tmp/xapian-svn-snapshot/tags/1.2.8/xapian/swig/Lib/php/utils.i,7,CONVERT_INT_IN@*/
  convert_to_long_ex(args[2]);
  arg3 = (int) Z_LVAL_PP(args[2]);
  /*@SWIG@*/;
  
  {
    try {
      result = Xapian::Brass::open((std::string const &)*arg1,arg2,arg3);
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  {
    Xapian::WritableDatabase * resultobj = new Xapian::WritableDatabase((const Xapian::WritableDatabase &) result);
    SWIG_SetPointerZval(return_value, (void *)resultobj, SWIGTYPE_p_Xapian__WritableDatabase, 1);
  }
  
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_brass_open__SWIG_2) {
  std::string *arg1 = 0 ;
  int arg2 ;
  std::string temp1 ;
  zval **args[2];
  Xapian::WritableDatabase result;
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 2 || zend_get_parameters_array_ex(2, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  
  convert_to_string_ex(args[0]);
  temp1.assign(Z_STRVAL_PP(args[0]), Z_STRLEN_PP(args[0]));
  arg1 = &temp1;
  
  
  /*@SWIG:/data/home/olly/tmp/xapian-svn-snapshot/tags/1.2.8/xapian/swig/Lib/php/utils.i,7,CONVERT_INT_IN@*/
  convert_to_long_ex(args[1]);
  arg2 = (int) Z_LVAL_PP(args[1]);
  /*@SWIG@*/;
  
  {
    try {
      result = Xapian::Brass::open((std::string const &)*arg1,arg2);
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  {
    Xapian::WritableDatabase * resultobj = new Xapian::WritableDatabase((const Xapian::WritableDatabase &) result);
    SWIG_SetPointerZval(return_value, (void *)resultobj, SWIGTYPE_p_Xapian__WritableDatabase, 1);
  }
  
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_brass_open) {
  int argc;
  zval **argv[3];
  
  argc = ZEND_NUM_ARGS();
  zend_get_parameters_array_ex(argc,argv);
  if (argc == 1) {
    int _v;
    {
      _v = (Z_TYPE_PP(argv[0]) == IS_STRING);
    }
    if (_v) {
      _wrap_brass_open__SWIG_0(INTERNAL_FUNCTION_PARAM_PASSTHRU); return;
    }
  }
  if (argc == 2) {
    int _v;
    {
      _v = (Z_TYPE_PP(argv[0]) == IS_STRING);
    }
    if (_v) {
      _v = (Z_TYPE_PP(argv[1]) == IS_LONG); 
      if (_v) {
        _wrap_brass_open__SWIG_2(INTERNAL_FUNCTION_PARAM_PASSTHRU); return;
      }
    }
  }
  if (argc == 3) {
    int _v;
    {
      _v = (Z_TYPE_PP(argv[0]) == IS_STRING);
    }
    if (_v) {
      _v = (Z_TYPE_PP(argv[1]) == IS_LONG); 
      if (_v) {
        _v = (Z_TYPE_PP(argv[2]) == IS_LONG); 
        if (_v) {
          _wrap_brass_open__SWIG_1(INTERNAL_FUNCTION_PARAM_PASSTHRU); return;
        }
      }
    }
  }
  
  SWIG_ErrorCode() = E_ERROR;
  SWIG_ErrorMsg() = "No matching function for overloaded 'brass_open'";
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_chert_open__SWIG_0) {
  std::string *arg1 = 0 ;
  std::string temp1 ;
  zval **args[1];
  Xapian::Database result;
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 1 || zend_get_parameters_array_ex(1, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  
  convert_to_string_ex(args[0]);
  temp1.assign(Z_STRVAL_PP(args[0]), Z_STRLEN_PP(args[0]));
  arg1 = &temp1;
  
  {
    try {
      result = Xapian::Chert::open((std::string const &)*arg1);
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  {
    Xapian::Database * resultobj = new Xapian::Database((const Xapian::Database &) result);
    SWIG_SetPointerZval(return_value, (void *)resultobj, SWIGTYPE_p_Xapian__Database, 1);
  }
  
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_chert_open__SWIG_1) {
  std::string *arg1 = 0 ;
  int arg2 ;
  int arg3 ;
  std::string temp1 ;
  zval **args[3];
  Xapian::WritableDatabase result;
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 3 || zend_get_parameters_array_ex(3, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  
  convert_to_string_ex(args[0]);
  temp1.assign(Z_STRVAL_PP(args[0]), Z_STRLEN_PP(args[0]));
  arg1 = &temp1;
  
  
  /*@SWIG:/data/home/olly/tmp/xapian-svn-snapshot/tags/1.2.8/xapian/swig/Lib/php/utils.i,7,CONVERT_INT_IN@*/
  convert_to_long_ex(args[1]);
  arg2 = (int) Z_LVAL_PP(args[1]);
  /*@SWIG@*/;
  
  
  /*@SWIG:/data/home/olly/tmp/xapian-svn-snapshot/tags/1.2.8/xapian/swig/Lib/php/utils.i,7,CONVERT_INT_IN@*/
  convert_to_long_ex(args[2]);
  arg3 = (int) Z_LVAL_PP(args[2]);
  /*@SWIG@*/;
  
  {
    try {
      result = Xapian::Chert::open((std::string const &)*arg1,arg2,arg3);
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  {
    Xapian::WritableDatabase * resultobj = new Xapian::WritableDatabase((const Xapian::WritableDatabase &) result);
    SWIG_SetPointerZval(return_value, (void *)resultobj, SWIGTYPE_p_Xapian__WritableDatabase, 1);
  }
  
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_chert_open__SWIG_2) {
  std::string *arg1 = 0 ;
  int arg2 ;
  std::string temp1 ;
  zval **args[2];
  Xapian::WritableDatabase result;
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 2 || zend_get_parameters_array_ex(2, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  
  convert_to_string_ex(args[0]);
  temp1.assign(Z_STRVAL_PP(args[0]), Z_STRLEN_PP(args[0]));
  arg1 = &temp1;
  
  
  /*@SWIG:/data/home/olly/tmp/xapian-svn-snapshot/tags/1.2.8/xapian/swig/Lib/php/utils.i,7,CONVERT_INT_IN@*/
  convert_to_long_ex(args[1]);
  arg2 = (int) Z_LVAL_PP(args[1]);
  /*@SWIG@*/;
  
  {
    try {
      result = Xapian::Chert::open((std::string const &)*arg1,arg2);
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  {
    Xapian::WritableDatabase * resultobj = new Xapian::WritableDatabase((const Xapian::WritableDatabase &) result);
    SWIG_SetPointerZval(return_value, (void *)resultobj, SWIGTYPE_p_Xapian__WritableDatabase, 1);
  }
  
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_chert_open) {
  int argc;
  zval **argv[3];
  
  argc = ZEND_NUM_ARGS();
  zend_get_parameters_array_ex(argc,argv);
  if (argc == 1) {
    int _v;
    {
      _v = (Z_TYPE_PP(argv[0]) == IS_STRING);
    }
    if (_v) {
      _wrap_chert_open__SWIG_0(INTERNAL_FUNCTION_PARAM_PASSTHRU); return;
    }
  }
  if (argc == 2) {
    int _v;
    {
      _v = (Z_TYPE_PP(argv[0]) == IS_STRING);
    }
    if (_v) {
      _v = (Z_TYPE_PP(argv[1]) == IS_LONG); 
      if (_v) {
        _wrap_chert_open__SWIG_2(INTERNAL_FUNCTION_PARAM_PASSTHRU); return;
      }
    }
  }
  if (argc == 3) {
    int _v;
    {
      _v = (Z_TYPE_PP(argv[0]) == IS_STRING);
    }
    if (_v) {
      _v = (Z_TYPE_PP(argv[1]) == IS_LONG); 
      if (_v) {
        _v = (Z_TYPE_PP(argv[2]) == IS_LONG); 
        if (_v) {
          _wrap_chert_open__SWIG_1(INTERNAL_FUNCTION_PARAM_PASSTHRU); return;
        }
      }
    }
  }
  
  SWIG_ErrorCode() = E_ERROR;
  SWIG_ErrorMsg() = "No matching function for overloaded 'chert_open'";
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_flint_open__SWIG_0) {
  std::string *arg1 = 0 ;
  std::string temp1 ;
  zval **args[1];
  Xapian::Database result;
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 1 || zend_get_parameters_array_ex(1, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  
  convert_to_string_ex(args[0]);
  temp1.assign(Z_STRVAL_PP(args[0]), Z_STRLEN_PP(args[0]));
  arg1 = &temp1;
  
  {
    try {
      result = Xapian::Flint::open((std::string const &)*arg1);
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  {
    Xapian::Database * resultobj = new Xapian::Database((const Xapian::Database &) result);
    SWIG_SetPointerZval(return_value, (void *)resultobj, SWIGTYPE_p_Xapian__Database, 1);
  }
  
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_flint_open__SWIG_1) {
  std::string *arg1 = 0 ;
  int arg2 ;
  int arg3 ;
  std::string temp1 ;
  zval **args[3];
  Xapian::WritableDatabase result;
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 3 || zend_get_parameters_array_ex(3, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  
  convert_to_string_ex(args[0]);
  temp1.assign(Z_STRVAL_PP(args[0]), Z_STRLEN_PP(args[0]));
  arg1 = &temp1;
  
  
  /*@SWIG:/data/home/olly/tmp/xapian-svn-snapshot/tags/1.2.8/xapian/swig/Lib/php/utils.i,7,CONVERT_INT_IN@*/
  convert_to_long_ex(args[1]);
  arg2 = (int) Z_LVAL_PP(args[1]);
  /*@SWIG@*/;
  
  
  /*@SWIG:/data/home/olly/tmp/xapian-svn-snapshot/tags/1.2.8/xapian/swig/Lib/php/utils.i,7,CONVERT_INT_IN@*/
  convert_to_long_ex(args[2]);
  arg3 = (int) Z_LVAL_PP(args[2]);
  /*@SWIG@*/;
  
  {
    try {
      result = Xapian::Flint::open((std::string const &)*arg1,arg2,arg3);
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  {
    Xapian::WritableDatabase * resultobj = new Xapian::WritableDatabase((const Xapian::WritableDatabase &) result);
    SWIG_SetPointerZval(return_value, (void *)resultobj, SWIGTYPE_p_Xapian__WritableDatabase, 1);
  }
  
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_flint_open__SWIG_2) {
  std::string *arg1 = 0 ;
  int arg2 ;
  std::string temp1 ;
  zval **args[2];
  Xapian::WritableDatabase result;
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 2 || zend_get_parameters_array_ex(2, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  
  convert_to_string_ex(args[0]);
  temp1.assign(Z_STRVAL_PP(args[0]), Z_STRLEN_PP(args[0]));
  arg1 = &temp1;
  
  
  /*@SWIG:/data/home/olly/tmp/xapian-svn-snapshot/tags/1.2.8/xapian/swig/Lib/php/utils.i,7,CONVERT_INT_IN@*/
  convert_to_long_ex(args[1]);
  arg2 = (int) Z_LVAL_PP(args[1]);
  /*@SWIG@*/;
  
  {
    try {
      result = Xapian::Flint::open((std::string const &)*arg1,arg2);
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  {
    Xapian::WritableDatabase * resultobj = new Xapian::WritableDatabase((const Xapian::WritableDatabase &) result);
    SWIG_SetPointerZval(return_value, (void *)resultobj, SWIGTYPE_p_Xapian__WritableDatabase, 1);
  }
  
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_flint_open) {
  int argc;
  zval **argv[3];
  
  argc = ZEND_NUM_ARGS();
  zend_get_parameters_array_ex(argc,argv);
  if (argc == 1) {
    int _v;
    {
      _v = (Z_TYPE_PP(argv[0]) == IS_STRING);
    }
    if (_v) {
      _wrap_flint_open__SWIG_0(INTERNAL_FUNCTION_PARAM_PASSTHRU); return;
    }
  }
  if (argc == 2) {
    int _v;
    {
      _v = (Z_TYPE_PP(argv[0]) == IS_STRING);
    }
    if (_v) {
      _v = (Z_TYPE_PP(argv[1]) == IS_LONG); 
      if (_v) {
        _wrap_flint_open__SWIG_2(INTERNAL_FUNCTION_PARAM_PASSTHRU); return;
      }
    }
  }
  if (argc == 3) {
    int _v;
    {
      _v = (Z_TYPE_PP(argv[0]) == IS_STRING);
    }
    if (_v) {
      _v = (Z_TYPE_PP(argv[1]) == IS_LONG); 
      if (_v) {
        _v = (Z_TYPE_PP(argv[2]) == IS_LONG); 
        if (_v) {
          _wrap_flint_open__SWIG_1(INTERNAL_FUNCTION_PARAM_PASSTHRU); return;
        }
      }
    }
  }
  
  SWIG_ErrorCode() = E_ERROR;
  SWIG_ErrorMsg() = "No matching function for overloaded 'flint_open'";
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_inmemory_open) {
  Xapian::WritableDatabase result;
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 0) {
    WRONG_PARAM_COUNT;
  }
  
  {
    try {
      result = Xapian::InMemory::open();
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  {
    Xapian::WritableDatabase * resultobj = new Xapian::WritableDatabase((const Xapian::WritableDatabase &) result);
    SWIG_SetPointerZval(return_value, (void *)resultobj, SWIGTYPE_p_Xapian__WritableDatabase, 1);
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_remote_open__SWIG_0) {
  std::string *arg1 = 0 ;
  unsigned int arg2 ;
  Xapian::timeout arg3 ;
  Xapian::timeout arg4 ;
  std::string temp1 ;
  zval **args[4];
  Xapian::Database result;
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 4 || zend_get_parameters_array_ex(4, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  
  convert_to_string_ex(args[0]);
  temp1.assign(Z_STRVAL_PP(args[0]), Z_STRLEN_PP(args[0]));
  arg1 = &temp1;
  
  
  /*@SWIG:/data/home/olly/tmp/xapian-svn-snapshot/tags/1.2.8/xapian/swig/Lib/php/utils.i,7,CONVERT_INT_IN@*/
  convert_to_long_ex(args[1]);
  arg2 = (unsigned int) Z_LVAL_PP(args[1]);
  /*@SWIG@*/;
  
  
  /*@SWIG:/data/home/olly/tmp/xapian-svn-snapshot/tags/1.2.8/xapian/swig/Lib/php/utils.i,7,CONVERT_INT_IN@*/
  convert_to_long_ex(args[2]);
  arg3 = (Xapian::timeout) Z_LVAL_PP(args[2]);
  /*@SWIG@*/;
  
  
  /*@SWIG:/data/home/olly/tmp/xapian-svn-snapshot/tags/1.2.8/xapian/swig/Lib/php/utils.i,7,CONVERT_INT_IN@*/
  convert_to_long_ex(args[3]);
  arg4 = (Xapian::timeout) Z_LVAL_PP(args[3]);
  /*@SWIG@*/;
  
  {
    try {
      result = Xapian::Remote::open((std::string const &)*arg1,arg2,arg3,arg4);
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  {
    Xapian::Database * resultobj = new Xapian::Database((const Xapian::Database &) result);
    SWIG_SetPointerZval(return_value, (void *)resultobj, SWIGTYPE_p_Xapian__Database, 1);
  }
  
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_remote_open__SWIG_1) {
  std::string *arg1 = 0 ;
  unsigned int arg2 ;
  Xapian::timeout arg3 ;
  std::string temp1 ;
  zval **args[3];
  Xapian::Database result;
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 3 || zend_get_parameters_array_ex(3, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  
  convert_to_string_ex(args[0]);
  temp1.assign(Z_STRVAL_PP(args[0]), Z_STRLEN_PP(args[0]));
  arg1 = &temp1;
  
  
  /*@SWIG:/data/home/olly/tmp/xapian-svn-snapshot/tags/1.2.8/xapian/swig/Lib/php/utils.i,7,CONVERT_INT_IN@*/
  convert_to_long_ex(args[1]);
  arg2 = (unsigned int) Z_LVAL_PP(args[1]);
  /*@SWIG@*/;
  
  
  /*@SWIG:/data/home/olly/tmp/xapian-svn-snapshot/tags/1.2.8/xapian/swig/Lib/php/utils.i,7,CONVERT_INT_IN@*/
  convert_to_long_ex(args[2]);
  arg3 = (Xapian::timeout) Z_LVAL_PP(args[2]);
  /*@SWIG@*/;
  
  {
    try {
      result = Xapian::Remote::open((std::string const &)*arg1,arg2,arg3);
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  {
    Xapian::Database * resultobj = new Xapian::Database((const Xapian::Database &) result);
    SWIG_SetPointerZval(return_value, (void *)resultobj, SWIGTYPE_p_Xapian__Database, 1);
  }
  
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_remote_open__SWIG_2) {
  std::string *arg1 = 0 ;
  unsigned int arg2 ;
  std::string temp1 ;
  zval **args[2];
  Xapian::Database result;
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 2 || zend_get_parameters_array_ex(2, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  
  convert_to_string_ex(args[0]);
  temp1.assign(Z_STRVAL_PP(args[0]), Z_STRLEN_PP(args[0]));
  arg1 = &temp1;
  
  
  /*@SWIG:/data/home/olly/tmp/xapian-svn-snapshot/tags/1.2.8/xapian/swig/Lib/php/utils.i,7,CONVERT_INT_IN@*/
  convert_to_long_ex(args[1]);
  arg2 = (unsigned int) Z_LVAL_PP(args[1]);
  /*@SWIG@*/;
  
  {
    try {
      result = Xapian::Remote::open((std::string const &)*arg1,arg2);
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  {
    Xapian::Database * resultobj = new Xapian::Database((const Xapian::Database &) result);
    SWIG_SetPointerZval(return_value, (void *)resultobj, SWIGTYPE_p_Xapian__Database, 1);
  }
  
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_remote_open_writable__SWIG_0) {
  std::string *arg1 = 0 ;
  unsigned int arg2 ;
  Xapian::timeout arg3 ;
  Xapian::timeout arg4 ;
  std::string temp1 ;
  zval **args[4];
  Xapian::WritableDatabase result;
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 4 || zend_get_parameters_array_ex(4, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  
  convert_to_string_ex(args[0]);
  temp1.assign(Z_STRVAL_PP(args[0]), Z_STRLEN_PP(args[0]));
  arg1 = &temp1;
  
  
  /*@SWIG:/data/home/olly/tmp/xapian-svn-snapshot/tags/1.2.8/xapian/swig/Lib/php/utils.i,7,CONVERT_INT_IN@*/
  convert_to_long_ex(args[1]);
  arg2 = (unsigned int) Z_LVAL_PP(args[1]);
  /*@SWIG@*/;
  
  
  /*@SWIG:/data/home/olly/tmp/xapian-svn-snapshot/tags/1.2.8/xapian/swig/Lib/php/utils.i,7,CONVERT_INT_IN@*/
  convert_to_long_ex(args[2]);
  arg3 = (Xapian::timeout) Z_LVAL_PP(args[2]);
  /*@SWIG@*/;
  
  
  /*@SWIG:/data/home/olly/tmp/xapian-svn-snapshot/tags/1.2.8/xapian/swig/Lib/php/utils.i,7,CONVERT_INT_IN@*/
  convert_to_long_ex(args[3]);
  arg4 = (Xapian::timeout) Z_LVAL_PP(args[3]);
  /*@SWIG@*/;
  
  {
    try {
      result = Xapian::Remote::open_writable((std::string const &)*arg1,arg2,arg3,arg4);
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  {
    Xapian::WritableDatabase * resultobj = new Xapian::WritableDatabase((const Xapian::WritableDatabase &) result);
    SWIG_SetPointerZval(return_value, (void *)resultobj, SWIGTYPE_p_Xapian__WritableDatabase, 1);
  }
  
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_remote_open_writable__SWIG_1) {
  std::string *arg1 = 0 ;
  unsigned int arg2 ;
  Xapian::timeout arg3 ;
  std::string temp1 ;
  zval **args[3];
  Xapian::WritableDatabase result;
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 3 || zend_get_parameters_array_ex(3, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  
  convert_to_string_ex(args[0]);
  temp1.assign(Z_STRVAL_PP(args[0]), Z_STRLEN_PP(args[0]));
  arg1 = &temp1;
  
  
  /*@SWIG:/data/home/olly/tmp/xapian-svn-snapshot/tags/1.2.8/xapian/swig/Lib/php/utils.i,7,CONVERT_INT_IN@*/
  convert_to_long_ex(args[1]);
  arg2 = (unsigned int) Z_LVAL_PP(args[1]);
  /*@SWIG@*/;
  
  
  /*@SWIG:/data/home/olly/tmp/xapian-svn-snapshot/tags/1.2.8/xapian/swig/Lib/php/utils.i,7,CONVERT_INT_IN@*/
  convert_to_long_ex(args[2]);
  arg3 = (Xapian::timeout) Z_LVAL_PP(args[2]);
  /*@SWIG@*/;
  
  {
    try {
      result = Xapian::Remote::open_writable((std::string const &)*arg1,arg2,arg3);
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  {
    Xapian::WritableDatabase * resultobj = new Xapian::WritableDatabase((const Xapian::WritableDatabase &) result);
    SWIG_SetPointerZval(return_value, (void *)resultobj, SWIGTYPE_p_Xapian__WritableDatabase, 1);
  }
  
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_remote_open_writable__SWIG_2) {
  std::string *arg1 = 0 ;
  unsigned int arg2 ;
  std::string temp1 ;
  zval **args[2];
  Xapian::WritableDatabase result;
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 2 || zend_get_parameters_array_ex(2, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  
  convert_to_string_ex(args[0]);
  temp1.assign(Z_STRVAL_PP(args[0]), Z_STRLEN_PP(args[0]));
  arg1 = &temp1;
  
  
  /*@SWIG:/data/home/olly/tmp/xapian-svn-snapshot/tags/1.2.8/xapian/swig/Lib/php/utils.i,7,CONVERT_INT_IN@*/
  convert_to_long_ex(args[1]);
  arg2 = (unsigned int) Z_LVAL_PP(args[1]);
  /*@SWIG@*/;
  
  {
    try {
      result = Xapian::Remote::open_writable((std::string const &)*arg1,arg2);
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  {
    Xapian::WritableDatabase * resultobj = new Xapian::WritableDatabase((const Xapian::WritableDatabase &) result);
    SWIG_SetPointerZval(return_value, (void *)resultobj, SWIGTYPE_p_Xapian__WritableDatabase, 1);
  }
  
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_remote_open__SWIG_3) {
  std::string *arg1 = 0 ;
  std::string *arg2 = 0 ;
  Xapian::timeout arg3 ;
  std::string temp1 ;
  std::string temp2 ;
  zval **args[3];
  Xapian::Database result;
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 3 || zend_get_parameters_array_ex(3, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  
  convert_to_string_ex(args[0]);
  temp1.assign(Z_STRVAL_PP(args[0]), Z_STRLEN_PP(args[0]));
  arg1 = &temp1;
  
  
  convert_to_string_ex(args[1]);
  temp2.assign(Z_STRVAL_PP(args[1]), Z_STRLEN_PP(args[1]));
  arg2 = &temp2;
  
  
  /*@SWIG:/data/home/olly/tmp/xapian-svn-snapshot/tags/1.2.8/xapian/swig/Lib/php/utils.i,7,CONVERT_INT_IN@*/
  convert_to_long_ex(args[2]);
  arg3 = (Xapian::timeout) Z_LVAL_PP(args[2]);
  /*@SWIG@*/;
  
  {
    try {
      result = Xapian::Remote::open((std::string const &)*arg1,(std::string const &)*arg2,arg3);
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  {
    Xapian::Database * resultobj = new Xapian::Database((const Xapian::Database &) result);
    SWIG_SetPointerZval(return_value, (void *)resultobj, SWIGTYPE_p_Xapian__Database, 1);
  }
  
  
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_remote_open__SWIG_4) {
  std::string *arg1 = 0 ;
  std::string *arg2 = 0 ;
  std::string temp1 ;
  std::string temp2 ;
  zval **args[2];
  Xapian::Database result;
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 2 || zend_get_parameters_array_ex(2, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  
  convert_to_string_ex(args[0]);
  temp1.assign(Z_STRVAL_PP(args[0]), Z_STRLEN_PP(args[0]));
  arg1 = &temp1;
  
  
  convert_to_string_ex(args[1]);
  temp2.assign(Z_STRVAL_PP(args[1]), Z_STRLEN_PP(args[1]));
  arg2 = &temp2;
  
  {
    try {
      result = Xapian::Remote::open((std::string const &)*arg1,(std::string const &)*arg2);
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  {
    Xapian::Database * resultobj = new Xapian::Database((const Xapian::Database &) result);
    SWIG_SetPointerZval(return_value, (void *)resultobj, SWIGTYPE_p_Xapian__Database, 1);
  }
  
  
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_remote_open) {
  int argc;
  zval **argv[4];
  
  argc = ZEND_NUM_ARGS();
  zend_get_parameters_array_ex(argc,argv);
  if (argc == 2) {
    int _v;
    {
      _v = (Z_TYPE_PP(argv[0]) == IS_STRING);
    }
    if (_v) {
      {
        _v = (Z_TYPE_PP(argv[1]) == IS_STRING);
      }
      if (_v) {
        _wrap_remote_open__SWIG_4(INTERNAL_FUNCTION_PARAM_PASSTHRU); return;
      }
    }
  }
  if (argc == 2) {
    int _v;
    {
      _v = (Z_TYPE_PP(argv[0]) == IS_STRING);
    }
    if (_v) {
      _v = (Z_TYPE_PP(argv[1]) == IS_LONG); 
      if (_v) {
        _wrap_remote_open__SWIG_2(INTERNAL_FUNCTION_PARAM_PASSTHRU); return;
      }
    }
  }
  if (argc == 3) {
    int _v;
    {
      _v = (Z_TYPE_PP(argv[0]) == IS_STRING);
    }
    if (_v) {
      {
        _v = (Z_TYPE_PP(argv[1]) == IS_STRING);
      }
      if (_v) {
        _v = (Z_TYPE_PP(argv[2]) == IS_LONG); 
        if (_v) {
          _wrap_remote_open__SWIG_3(INTERNAL_FUNCTION_PARAM_PASSTHRU); return;
        }
      }
    }
  }
  if (argc == 3) {
    int _v;
    {
      _v = (Z_TYPE_PP(argv[0]) == IS_STRING);
    }
    if (_v) {
      _v = (Z_TYPE_PP(argv[1]) == IS_LONG); 
      if (_v) {
        _v = (Z_TYPE_PP(argv[2]) == IS_LONG); 
        if (_v) {
          _wrap_remote_open__SWIG_1(INTERNAL_FUNCTION_PARAM_PASSTHRU); return;
        }
      }
    }
  }
  if (argc == 4) {
    int _v;
    {
      _v = (Z_TYPE_PP(argv[0]) == IS_STRING);
    }
    if (_v) {
      _v = (Z_TYPE_PP(argv[1]) == IS_LONG); 
      if (_v) {
        _v = (Z_TYPE_PP(argv[2]) == IS_LONG); 
        if (_v) {
          _v = (Z_TYPE_PP(argv[3]) == IS_LONG); 
          if (_v) {
            _wrap_remote_open__SWIG_0(INTERNAL_FUNCTION_PARAM_PASSTHRU); return;
          }
        }
      }
    }
  }
  
  SWIG_ErrorCode() = E_ERROR;
  SWIG_ErrorMsg() = "No matching function for overloaded 'remote_open'";
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_remote_open_writable__SWIG_3) {
  std::string *arg1 = 0 ;
  std::string *arg2 = 0 ;
  Xapian::timeout arg3 ;
  std::string temp1 ;
  std::string temp2 ;
  zval **args[3];
  Xapian::WritableDatabase result;
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 3 || zend_get_parameters_array_ex(3, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  
  convert_to_string_ex(args[0]);
  temp1.assign(Z_STRVAL_PP(args[0]), Z_STRLEN_PP(args[0]));
  arg1 = &temp1;
  
  
  convert_to_string_ex(args[1]);
  temp2.assign(Z_STRVAL_PP(args[1]), Z_STRLEN_PP(args[1]));
  arg2 = &temp2;
  
  
  /*@SWIG:/data/home/olly/tmp/xapian-svn-snapshot/tags/1.2.8/xapian/swig/Lib/php/utils.i,7,CONVERT_INT_IN@*/
  convert_to_long_ex(args[2]);
  arg3 = (Xapian::timeout) Z_LVAL_PP(args[2]);
  /*@SWIG@*/;
  
  {
    try {
      result = Xapian::Remote::open_writable((std::string const &)*arg1,(std::string const &)*arg2,arg3);
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  {
    Xapian::WritableDatabase * resultobj = new Xapian::WritableDatabase((const Xapian::WritableDatabase &) result);
    SWIG_SetPointerZval(return_value, (void *)resultobj, SWIGTYPE_p_Xapian__WritableDatabase, 1);
  }
  
  
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_remote_open_writable__SWIG_4) {
  std::string *arg1 = 0 ;
  std::string *arg2 = 0 ;
  std::string temp1 ;
  std::string temp2 ;
  zval **args[2];
  Xapian::WritableDatabase result;
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 2 || zend_get_parameters_array_ex(2, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  
  convert_to_string_ex(args[0]);
  temp1.assign(Z_STRVAL_PP(args[0]), Z_STRLEN_PP(args[0]));
  arg1 = &temp1;
  
  
  convert_to_string_ex(args[1]);
  temp2.assign(Z_STRVAL_PP(args[1]), Z_STRLEN_PP(args[1]));
  arg2 = &temp2;
  
  {
    try {
      result = Xapian::Remote::open_writable((std::string const &)*arg1,(std::string const &)*arg2);
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  {
    Xapian::WritableDatabase * resultobj = new Xapian::WritableDatabase((const Xapian::WritableDatabase &) result);
    SWIG_SetPointerZval(return_value, (void *)resultobj, SWIGTYPE_p_Xapian__WritableDatabase, 1);
  }
  
  
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_remote_open_writable) {
  int argc;
  zval **argv[4];
  
  argc = ZEND_NUM_ARGS();
  zend_get_parameters_array_ex(argc,argv);
  if (argc == 2) {
    int _v;
    {
      _v = (Z_TYPE_PP(argv[0]) == IS_STRING);
    }
    if (_v) {
      {
        _v = (Z_TYPE_PP(argv[1]) == IS_STRING);
      }
      if (_v) {
        _wrap_remote_open_writable__SWIG_4(INTERNAL_FUNCTION_PARAM_PASSTHRU); return;
      }
    }
  }
  if (argc == 2) {
    int _v;
    {
      _v = (Z_TYPE_PP(argv[0]) == IS_STRING);
    }
    if (_v) {
      _v = (Z_TYPE_PP(argv[1]) == IS_LONG); 
      if (_v) {
        _wrap_remote_open_writable__SWIG_2(INTERNAL_FUNCTION_PARAM_PASSTHRU); return;
      }
    }
  }
  if (argc == 3) {
    int _v;
    {
      _v = (Z_TYPE_PP(argv[0]) == IS_STRING);
    }
    if (_v) {
      {
        _v = (Z_TYPE_PP(argv[1]) == IS_STRING);
      }
      if (_v) {
        _v = (Z_TYPE_PP(argv[2]) == IS_LONG); 
        if (_v) {
          _wrap_remote_open_writable__SWIG_3(INTERNAL_FUNCTION_PARAM_PASSTHRU); return;
        }
      }
    }
  }
  if (argc == 3) {
    int _v;
    {
      _v = (Z_TYPE_PP(argv[0]) == IS_STRING);
    }
    if (_v) {
      _v = (Z_TYPE_PP(argv[1]) == IS_LONG); 
      if (_v) {
        _v = (Z_TYPE_PP(argv[2]) == IS_LONG); 
        if (_v) {
          _wrap_remote_open_writable__SWIG_1(INTERNAL_FUNCTION_PARAM_PASSTHRU); return;
        }
      }
    }
  }
  if (argc == 4) {
    int _v;
    {
      _v = (Z_TYPE_PP(argv[0]) == IS_STRING);
    }
    if (_v) {
      _v = (Z_TYPE_PP(argv[1]) == IS_LONG); 
      if (_v) {
        _v = (Z_TYPE_PP(argv[2]) == IS_LONG); 
        if (_v) {
          _v = (Z_TYPE_PP(argv[3]) == IS_LONG); 
          if (_v) {
            _wrap_remote_open_writable__SWIG_0(INTERNAL_FUNCTION_PARAM_PASSTHRU); return;
          }
        }
      }
    }
  }
  
  SWIG_ErrorCode() = E_ERROR;
  SWIG_ErrorMsg() = "No matching function for overloaded 'remote_open_writable'";
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_new_Query__SWIG_0) {
  Xapian::Query *arg1 = 0 ;
  zval **args[1];
  Xapian::Query *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_Xapian__Query, 0) < 0 || arg1 == NULL) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of new_Query. Expected SWIGTYPE_p_Xapian__Query");
    }
  }
  {
    try {
      result = (Xapian::Query *)new Xapian::Query((Xapian::Query const &)*arg1);
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  
  SWIG_SetPointerZval(return_value, (void *)result, SWIGTYPE_p_Xapian__Query, 1);
  
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_new_Query__SWIG_1) {
  Xapian::Query *result = 0 ;
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 0) {
    WRONG_PARAM_COUNT;
  }
  
  {
    try {
      result = (Xapian::Query *)new Xapian::Query();
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  
  SWIG_SetPointerZval(return_value, (void *)result, SWIGTYPE_p_Xapian__Query, 1);
  
  return;
fail:
  zend_error(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_Query(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 ;
  Xapian::Query *arg1 = (Xapian::Query *) 0 ;
  
  efree(value);
  if (! newobject) return; /* can't delete it! */
  arg1 = (Xapian::Query *)SWIG_ZTS_ConvertResourceData(ptr,type_name,SWIGTYPE_p_Xapian__Query TSRMLS_CC);
  if (! arg1) zend_error(E_ERROR, "Xapian::Query resource already free'd");
  {
    try {
      delete arg1;
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_new_Query__SWIG_2) {
  std::string *arg1 = 0 ;
  Xapian::termcount arg2 ;
  Xapian::termpos arg3 ;
  std::string temp1 ;
  zval **args[3];
  Xapian::Query *result = 0 ;
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 3 || zend_get_parameters_array_ex(3, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  
  convert_to_string_ex(args[0]);
  temp1.assign(Z_STRVAL_PP(args[0]), Z_STRLEN_PP(args[0]));
  arg1 = &temp1;
  
  
  /*@SWIG:/data/home/olly/tmp/xapian-svn-snapshot/tags/1.2.8/xapian/swig/Lib/php/utils.i,7,CONVERT_INT_IN@*/
  convert_to_long_ex(args[1]);
  arg2 = (Xapian::termcount) Z_LVAL_PP(args[1]);
  /*@SWIG@*/;
  
  
  /*@SWIG:/data/home/olly/tmp/xapian-svn-snapshot/tags/1.2.8/xapian/swig/Lib/php/utils.i,7,CONVERT_INT_IN@*/
  convert_to_long_ex(args[2]);
  arg3 = (Xapian::termpos) Z_LVAL_PP(args[2]);
  /*@SWIG@*/;
  
  {
    try {
      result = (Xapian::Query *)new Xapian::Query((std::string const &)*arg1,arg2,arg3);
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  
  SWIG_SetPointerZval(return_value, (void *)result, SWIGTYPE_p_Xapian__Query, 1);
  
  
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_new_Query__SWIG_3) {
  std::string *arg1 = 0 ;
  Xapian::termcount arg2 ;
  std::string temp1 ;
  zval **args[2];
  Xapian::Query *result = 0 ;
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 2 || zend_get_parameters_array_ex(2, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  
  convert_to_string_ex(args[0]);
  temp1.assign(Z_STRVAL_PP(args[0]), Z_STRLEN_PP(args[0]));
  arg1 = &temp1;
  
  
  /*@SWIG:/data/home/olly/tmp/xapian-svn-snapshot/tags/1.2.8/xapian/swig/Lib/php/utils.i,7,CONVERT_INT_IN@*/
  convert_to_long_ex(args[1]);
  arg2 = (Xapian::termcount) Z_LVAL_PP(args[1]);
  /*@SWIG@*/;
  
  {
    try {
      result = (Xapian::Query *)new Xapian::Query((std::string const &)*arg1,arg2);
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  
  SWIG_SetPointerZval(return_value, (void *)result, SWIGTYPE_p_Xapian__Query, 1);
  
  
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_new_Query__SWIG_4) {
  std::string *arg1 = 0 ;
  std::string temp1 ;
  zval **args[1];
  Xapian::Query *result = 0 ;
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 1 || zend_get_parameters_array_ex(1, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  
  convert_to_string_ex(args[0]);
  temp1.assign(Z_STRVAL_PP(args[0]), Z_STRLEN_PP(args[0]));
  arg1 = &temp1;
  
  {
    try {
      result = (Xapian::Query *)new Xapian::Query((std::string const &)*arg1);
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  
  SWIG_SetPointerZval(return_value, (void *)result, SWIGTYPE_p_Xapian__Query, 1);
  
  
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_new_Query__SWIG_5) {
  Xapian::Query::op arg1 ;
  Xapian::Query *arg2 = 0 ;
  Xapian::Query *arg3 = 0 ;
  zval **args[3];
  Xapian::Query *result = 0 ;
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 3 || zend_get_parameters_array_ex(3, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  
  /*@SWIG:/data/home/olly/tmp/xapian-svn-snapshot/tags/1.2.8/xapian/swig/Lib/php/utils.i,7,CONVERT_INT_IN@*/
  convert_to_long_ex(args[0]);
  arg1 = (Xapian::Query::op) Z_LVAL_PP(args[0]);
  /*@SWIG@*/;
  
  {
    if (SWIG_ConvertPtr(*args[1], (void**)&arg2, SWIGTYPE_p_Xapian__Query, 0) < 0 || arg2 == NULL) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 2 of new_Query. Expected SWIGTYPE_p_Xapian__Query");
    }
  }
  {
    if (SWIG_ConvertPtr(*args[2], (void**)&arg3, SWIGTYPE_p_Xapian__Query, 0) < 0 || arg3 == NULL) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 3 of new_Query. Expected SWIGTYPE_p_Xapian__Query");
    }
  }
  {
    try {
      result = (Xapian::Query *)new Xapian::Query(arg1,(Xapian::Query const &)*arg2,(Xapian::Query const &)*arg3);
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  
  SWIG_SetPointerZval(return_value, (void *)result, SWIGTYPE_p_Xapian__Query, 1);
  
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_new_Query__SWIG_6) {
  Xapian::Query::op arg1 ;
  std::string *arg2 = 0 ;
  std::string *arg3 = 0 ;
  std::string temp2 ;
  std::string temp3 ;
  zval **args[3];
  Xapian::Query *result = 0 ;
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 3 || zend_get_parameters_array_ex(3, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  
  /*@SWIG:/data/home/olly/tmp/xapian-svn-snapshot/tags/1.2.8/xapian/swig/Lib/php/utils.i,7,CONVERT_INT_IN@*/
  convert_to_long_ex(args[0]);
  arg1 = (Xapian::Query::op) Z_LVAL_PP(args[0]);
  /*@SWIG@*/;
  
  
  convert_to_string_ex(args[1]);
  temp2.assign(Z_STRVAL_PP(args[1]), Z_STRLEN_PP(args[1]));
  arg2 = &temp2;
  
  
  convert_to_string_ex(args[2]);
  temp3.assign(Z_STRVAL_PP(args[2]), Z_STRLEN_PP(args[2]));
  arg3 = &temp3;
  
  {
    try {
      result = (Xapian::Query *)new Xapian::Query(arg1,(std::string const &)*arg2,(std::string const &)*arg3);
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  
  SWIG_SetPointerZval(return_value, (void *)result, SWIGTYPE_p_Xapian__Query, 1);
  
  
  
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_new_Query__SWIG_9) {
  Xapian::Query::op arg1 ;
  Xapian::Query arg2 ;
  double arg3 ;
  Xapian::Query *tmp2 ;
  zval **args[3];
  Xapian::Query *result = 0 ;
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 3 || zend_get_parameters_array_ex(3, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  
  /*@SWIG:/data/home/olly/tmp/xapian-svn-snapshot/tags/1.2.8/xapian/swig/Lib/php/utils.i,7,CONVERT_INT_IN@*/
  convert_to_long_ex(args[0]);
  arg1 = (Xapian::Query::op) Z_LVAL_PP(args[0]);
  /*@SWIG@*/;
  
  {
    if(SWIG_ConvertPtr(*args[1], (void **) &tmp2, SWIGTYPE_p_Xapian__Query, 0) < 0 || tmp2 == NULL) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 2 of new_Query. Expected SWIGTYPE_p_Xapian__Query");
    }
    arg2 = *tmp2;
  }
  
  /*@SWIG:/data/home/olly/tmp/xapian-svn-snapshot/tags/1.2.8/xapian/swig/Lib/php/utils.i,52,CONVERT_FLOAT_IN@*/
  convert_to_double_ex(args[2]);
  arg3 = (double) Z_DVAL_PP(args[2]);
  /*@SWIG@*/;
  
  {
    try {
      result = (Xapian::Query *)new Xapian::Query(arg1,arg2,arg3);
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  
  SWIG_SetPointerZval(return_value, (void *)result, SWIGTYPE_p_Xapian__Query, 1);
  
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_new_Query__SWIG_10) {
  Xapian::Query::op arg1 ;
  Xapian::valueno arg2 ;
  std::string *arg3 = 0 ;
  std::string *arg4 = 0 ;
  std::string temp3 ;
  std::string temp4 ;
  zval **args[4];
  Xapian::Query *result = 0 ;
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 4 || zend_get_parameters_array_ex(4, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  
  /*@SWIG:/data/home/olly/tmp/xapian-svn-snapshot/tags/1.2.8/xapian/swig/Lib/php/utils.i,7,CONVERT_INT_IN@*/
  convert_to_long_ex(args[0]);
  arg1 = (Xapian::Query::op) Z_LVAL_PP(args[0]);
  /*@SWIG@*/;
  
  
  /*@SWIG:/data/home/olly/tmp/xapian-svn-snapshot/tags/1.2.8/xapian/swig/Lib/php/utils.i,7,CONVERT_INT_IN@*/
  convert_to_long_ex(args[1]);
  arg2 = (Xapian::valueno) Z_LVAL_PP(args[1]);
  /*@SWIG@*/;
  
  
  convert_to_string_ex(args[2]);
  temp3.assign(Z_STRVAL_PP(args[2]), Z_STRLEN_PP(args[2]));
  arg3 = &temp3;
  
  
  convert_to_string_ex(args[3]);
  temp4.assign(Z_STRVAL_PP(args[3]), Z_STRLEN_PP(args[3]));
  arg4 = &temp4;
  
  {
    try {
      result = (Xapian::Query *)new Xapian::Query(arg1,arg2,(std::string const &)*arg3,(std::string const &)*arg4);
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  
  SWIG_SetPointerZval(return_value, (void *)result, SWIGTYPE_p_Xapian__Query, 1);
  
  
  
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_new_Query__SWIG_11) {
  Xapian::Query::op arg1 ;
  Xapian::valueno arg2 ;
  std::string *arg3 = 0 ;
  std::string temp3 ;
  zval **args[3];
  Xapian::Query *result = 0 ;
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 3 || zend_get_parameters_array_ex(3, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  
  /*@SWIG:/data/home/olly/tmp/xapian-svn-snapshot/tags/1.2.8/xapian/swig/Lib/php/utils.i,7,CONVERT_INT_IN@*/
  convert_to_long_ex(args[0]);
  arg1 = (Xapian::Query::op) Z_LVAL_PP(args[0]);
  /*@SWIG@*/;
  
  
  /*@SWIG:/data/home/olly/tmp/xapian-svn-snapshot/tags/1.2.8/xapian/swig/Lib/php/utils.i,7,CONVERT_INT_IN@*/
  convert_to_long_ex(args[1]);
  arg2 = (Xapian::valueno) Z_LVAL_PP(args[1]);
  /*@SWIG@*/;
  
  
  convert_to_string_ex(args[2]);
  temp3.assign(Z_STRVAL_PP(args[2]), Z_STRLEN_PP(args[2]));
  arg3 = &temp3;
  
  {
    try {
      result = (Xapian::Query *)new Xapian::Query(arg1,arg2,(std::string const &)*arg3);
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  
  SWIG_SetPointerZval(return_value, (void *)result, SWIGTYPE_p_Xapian__Query, 1);
  
  
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_new_Query__SWIG_12) {
  Xapian::PostingSource *arg1 = (Xapian::PostingSource *) 0 ;
  zval **args[1];
  Xapian::Query *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_Xapian__PostingSource, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of new_Query. Expected SWIGTYPE_p_Xapian__PostingSource");
    }
  }
  {
    try {
      result = (Xapian::Query *)new Xapian::Query(arg1);
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  
  SWIG_SetPointerZval(return_value, (void *)result, SWIGTYPE_p_Xapian__Query, 1);
  
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_Query_MatchAll_get) {
  Xapian::Query *result = 0 ;
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 0) {
    WRONG_PARAM_COUNT;
  }
  
  result = (Xapian::Query *)&Xapian::Query::MatchAll;
  
  SWIG_SetPointerZval(return_value, (void *)result, SWIGTYPE_p_Xapian__Query, 0);
  
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_Query_MatchNothing_get) {
  Xapian::Query *result = 0 ;
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 0) {
    WRONG_PARAM_COUNT;
  }
  
  result = (Xapian::Query *)&Xapian::Query::MatchNothing;
  
  SWIG_SetPointerZval(return_value, (void *)result, SWIGTYPE_p_Xapian__Query, 0);
  
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_Query_get_length) {
  Xapian::Query *arg1 = (Xapian::Query *) 0 ;
  zval **args[1];
  Xapian::termcount 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_Xapian__Query, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of Query_get_length. Expected SWIGTYPE_p_Xapian__Query");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    try {
      result = (Xapian::termcount)((Xapian::Query const *)arg1)->get_length();
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  {
    ZVAL_LONG(return_value,result);
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_Query_get_terms_begin) {
  Xapian::Query *arg1 = (Xapian::Query *) 0 ;
  zval **args[1];
  Xapian::TermIterator 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_Xapian__Query, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of Query_get_terms_begin. Expected SWIGTYPE_p_Xapian__Query");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    try {
      result = ((Xapian::Query const *)arg1)->get_terms_begin();
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  {
    Xapian::TermIterator * resultobj = new Xapian::TermIterator((const Xapian::TermIterator &) result);
    SWIG_SetPointerZval(return_value, (void *)resultobj, SWIGTYPE_p_Xapian__TermIterator, 1);
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_Query_get_terms_end) {
  Xapian::Query *arg1 = (Xapian::Query *) 0 ;
  zval **args[1];
  Xapian::TermIterator 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_Xapian__Query, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of Query_get_terms_end. Expected SWIGTYPE_p_Xapian__Query");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    try {
      result = ((Xapian::Query const *)arg1)->get_terms_end();
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  {
    Xapian::TermIterator * resultobj = new Xapian::TermIterator((const Xapian::TermIterator &) result);
    SWIG_SetPointerZval(return_value, (void *)resultobj, SWIGTYPE_p_Xapian__TermIterator, 1);
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_Query_is_empty) {
  Xapian::Query *arg1 = (Xapian::Query *) 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_Xapian__Query, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of Query_is_empty. Expected SWIGTYPE_p_Xapian__Query");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    try {
      result = (bool)((Xapian::Query const *)arg1)->empty();
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  {
    ZVAL_BOOL(return_value,(result)?1:0);
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_Query_serialise) {
  Xapian::Query *arg1 = (Xapian::Query *) 0 ;
  zval **args[1];
  std::string 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_Xapian__Query, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of Query_serialise. Expected SWIGTYPE_p_Xapian__Query");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    try {
      result = ((Xapian::Query const *)arg1)->serialise();
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  
  ZVAL_STRINGL(return_value, const_cast<char*>((&result)->data()), (&result)->size(), 1);
  
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_Query_unserialise__SWIG_0) {
  std::string *arg1 = 0 ;
  std::string temp1 ;
  zval **args[1];
  Xapian::Query result;
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 1 || zend_get_parameters_array_ex(1, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  
  convert_to_string_ex(args[0]);
  temp1.assign(Z_STRVAL_PP(args[0]), Z_STRLEN_PP(args[0]));
  arg1 = &temp1;
  
  {
    try {
      result = Xapian::Query::unserialise((std::string const &)*arg1);
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  {
    Xapian::Query * resultobj = new Xapian::Query((const Xapian::Query &) result);
    SWIG_SetPointerZval(return_value, (void *)resultobj, SWIGTYPE_p_Xapian__Query, 1);
  }
  
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_Query_unserialise__SWIG_1) {
  std::string *arg1 = 0 ;
  Xapian::Registry *arg2 = 0 ;
  std::string temp1 ;
  zval **args[2];
  Xapian::Query result;
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 2 || zend_get_parameters_array_ex(2, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  
  convert_to_string_ex(args[0]);
  temp1.assign(Z_STRVAL_PP(args[0]), Z_STRLEN_PP(args[0]));
  arg1 = &temp1;
  
  {
    if (SWIG_ConvertPtr(*args[1], (void**)&arg2, SWIGTYPE_p_Xapian__Registry, 0) < 0 || arg2 == NULL) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 2 of Query_unserialise. Expected SWIGTYPE_p_Xapian__Registry");
    }
  }
  {
    try {
      result = Xapian::Query::unserialise((std::string const &)*arg1,(Xapian::Registry const &)*arg2);
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  {
    Xapian::Query * resultobj = new Xapian::Query((const Xapian::Query &) result);
    SWIG_SetPointerZval(return_value, (void *)resultobj, SWIGTYPE_p_Xapian__Query, 1);
  }
  
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_Query_unserialise) {
  int argc;
  zval **argv[2];
  
  argc = ZEND_NUM_ARGS();
  zend_get_parameters_array_ex(argc,argv);
  if (argc == 1) {
    int _v;
    {
      _v = (Z_TYPE_PP(argv[0]) == IS_STRING);
    }
    if (_v) {
      _wrap_Query_unserialise__SWIG_0(INTERNAL_FUNCTION_PARAM_PASSTHRU); return;
    }
  }
  if (argc == 2) {
    int _v;
    {
      _v = (Z_TYPE_PP(argv[0]) == IS_STRING);
    }
    if (_v) {
      {
        void *ptr;
        _v = (SWIG_ConvertPtr(*argv[1], (void **)&ptr, SWIGTYPE_p_Xapian__Registry, 0) == 0);
      }
      if (_v) {
        _wrap_Query_unserialise__SWIG_1(INTERNAL_FUNCTION_PARAM_PASSTHRU); return;
      }
    }
  }
  
  SWIG_ErrorCode() = E_ERROR;
  SWIG_ErrorMsg() = "No matching function for overloaded 'Query_unserialise'";
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_Query_get_description) {
  Xapian::Query *arg1 = (Xapian::Query *) 0 ;
  zval **args[1];
  std::string 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_Xapian__Query, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of Query_get_description. Expected SWIGTYPE_p_Xapian__Query");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    try {
      result = ((Xapian::Query const *)arg1)->get_description();
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  
  ZVAL_STRINGL(return_value, const_cast<char*>((&result)->data()), (&result)->size(), 1);
  
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_new_Query__SWIG_13) {
  Xapian::Query::op arg1 ;
  std::vector< Xapian::Query > *arg2 = 0 ;
  Xapian::termcount arg3 ;
  vector< Xapian::Query > v2 ;
  zval **args[3];
  Xapian::Query *result = 0 ;
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 3 || zend_get_parameters_array_ex(3, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  
  /*@SWIG:/data/home/olly/tmp/xapian-svn-snapshot/tags/1.2.8/xapian/swig/Lib/php/utils.i,7,CONVERT_INT_IN@*/
  convert_to_long_ex(args[0]);
  arg1 = (Xapian::Query::op) Z_LVAL_PP(args[0]);
  /*@SWIG@*/;
  
  {
    if (Z_TYPE_PP(args[1]) != IS_ARRAY) {
      SWIG_PHP_Error(E_ERROR, "expected array of queries");
    }
    int numitems = zend_hash_num_elements(Z_ARRVAL_PP(args[1]));
    v2.reserve(numitems);
    zval **item;
    HashTable *ht = Z_ARRVAL_PP(args[1]);
    HashPosition i;
    zend_hash_internal_pointer_reset_ex(ht, &i);
    while (zend_hash_get_current_data_ex(ht, (void **)&item, &i) == SUCCESS) {
      if ((*item)->type == IS_STRING) {
        int len = Z_STRLEN_PP(item);
        const char *p = Z_STRVAL_PP(item);
        v2.push_back(Xapian::Query(string(p, len)));
      } else {
        Xapian::Query *subq = 0;
        if (SWIG_ConvertPtr(*item, (void **)&subq,
            SWIGTYPE_p_Xapian__Query, 0) < 0) {
          subq = 0;
        }
        if (!subq) {
          SWIG_PHP_Error(E_ERROR, "expected string or query object");
        }
        v2.push_back(*subq);
      }
      zend_hash_move_forward_ex(ht, &i);
    }
    zend_hash_internal_pointer_end_ex(ht, &i);
    arg2 = &v2;
  }
  
  /*@SWIG:/data/home/olly/tmp/xapian-svn-snapshot/tags/1.2.8/xapian/swig/Lib/php/utils.i,7,CONVERT_INT_IN@*/
  convert_to_long_ex(args[2]);
  arg3 = (Xapian::termcount) Z_LVAL_PP(args[2]);
  /*@SWIG@*/;
  
  {
    try {
      result = (Xapian::Query *)new_Xapian_Query__SWIG_13(arg1,(std::vector< Xapian::Query > const &)*arg2,arg3);
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  
  SWIG_SetPointerZval(return_value, (void *)result, SWIGTYPE_p_Xapian__Query, 1);
  
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_new_Query__SWIG_14) {
  Xapian::Query::op arg1 ;
  std::vector< Xapian::Query > *arg2 = 0 ;
  vector< Xapian::Query > v2 ;
  zval **args[2];
  Xapian::Query *result = 0 ;
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 2 || zend_get_parameters_array_ex(2, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  
  /*@SWIG:/data/home/olly/tmp/xapian-svn-snapshot/tags/1.2.8/xapian/swig/Lib/php/utils.i,7,CONVERT_INT_IN@*/
  convert_to_long_ex(args[0]);
  arg1 = (Xapian::Query::op) Z_LVAL_PP(args[0]);
  /*@SWIG@*/;
  
  {
    if (Z_TYPE_PP(args[1]) != IS_ARRAY) {
      SWIG_PHP_Error(E_ERROR, "expected array of queries");
    }
    int numitems = zend_hash_num_elements(Z_ARRVAL_PP(args[1]));
    v2.reserve(numitems);
    zval **item;
    HashTable *ht = Z_ARRVAL_PP(args[1]);
    HashPosition i;
    zend_hash_internal_pointer_reset_ex(ht, &i);
    while (zend_hash_get_current_data_ex(ht, (void **)&item, &i) == SUCCESS) {
      if ((*item)->type == IS_STRING) {
        int len = Z_STRLEN_PP(item);
        const char *p = Z_STRVAL_PP(item);
        v2.push_back(Xapian::Query(string(p, len)));
      } else {
        Xapian::Query *subq = 0;
        if (SWIG_ConvertPtr(*item, (void **)&subq,
            SWIGTYPE_p_Xapian__Query, 0) < 0) {
          subq = 0;
        }
        if (!subq) {
          SWIG_PHP_Error(E_ERROR, "expected string or query object");
        }
        v2.push_back(*subq);
      }
      zend_hash_move_forward_ex(ht, &i);
    }
    zend_hash_internal_pointer_end_ex(ht, &i);
    arg2 = &v2;
  }
  {
    try {
      result = (Xapian::Query *)new_Xapian_Query__SWIG_13(arg1,(std::vector< Xapian::Query > const &)*arg2);
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  
  SWIG_SetPointerZval(return_value, (void *)result, SWIGTYPE_p_Xapian__Query, 1);
  
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_new_Query) {
  int argc;
  zval **argv[4];
  
  argc = ZEND_NUM_ARGS();
  zend_get_parameters_array_ex(argc,argv);
  if (argc == 0) {
    _wrap_new_Query__SWIG_1(INTERNAL_FUNCTION_PARAM_PASSTHRU); return;
  }
  if (argc == 1) {
    int _v;
    {
      void *ptr;
      _v = (SWIG_ConvertPtr(*argv[0], (void **)&ptr, SWIGTYPE_p_Xapian__Query, 0) == 0);
    }
    if (_v) {
      _wrap_new_Query__SWIG_0(INTERNAL_FUNCTION_PARAM_PASSTHRU); return;
    }
  }
  if (argc == 1) {
    int _v;
    {
      void *tmp;
      _v = (SWIG_ConvertPtr(*argv[0], (void**)&tmp, SWIGTYPE_p_Xapian__PostingSource, 0) >= 0);
    }
    if (_v) {
      _wrap_new_Query__SWIG_12(INTERNAL_FUNCTION_PARAM_PASSTHRU); return;
    }
  }
  if (argc == 1) {
    int _v;
    {
      _v = (Z_TYPE_PP(argv[0]) == IS_STRING);
    }
    if (_v) {
      _wrap_new_Query__SWIG_4(INTERNAL_FUNCTION_PARAM_PASSTHRU); return;
    }
  }
  if (argc == 2) {
    int _v;
    {
      _v = (Z_TYPE_PP(argv[0]) == IS_STRING);
    }
    if (_v) {
      _v = (Z_TYPE_PP(argv[1]) == IS_LONG); 
      if (_v) {
        _wrap_new_Query__SWIG_3(INTERNAL_FUNCTION_PARAM_PASSTHRU); return;
      }
    }
  }
  if (argc == 2) {
    int _v;
    _v = (Z_TYPE_PP(argv[0]) == IS_LONG); 
    if (_v) {
      {
        _v = (Z_TYPE_PP(argv[1]) == IS_ARRAY);
        /* FIXME: if we add more array typemaps, we'll need to check the elements
             * of the array here to disambiguate. */
      }
      if (_v) {
        _wrap_new_Query__SWIG_14(INTERNAL_FUNCTION_PARAM_PASSTHRU); return;
      }
    }
  }
  if (argc == 3) {
    int _v;
    {
      _v = (Z_TYPE_PP(argv[0]) == IS_STRING);
    }
    if (_v) {
      _v = (Z_TYPE_PP(argv[1]) == IS_LONG); 
      if (_v) {
        _v = (Z_TYPE_PP(argv[2]) == IS_LONG); 
        if (_v) {
          _wrap_new_Query__SWIG_2(INTERNAL_FUNCTION_PARAM_PASSTHRU); return;
        }
      }
    }
  }
  if (argc == 3) {
    int _v;
    _v = (Z_TYPE_PP(argv[0]) == IS_LONG); 
    if (_v) {
      {
        void *ptr;
        _v = (SWIG_ConvertPtr(*argv[1], (void **)&ptr, SWIGTYPE_p_Xapian__Query, 0) == 0);
      }
      if (_v) {
        {
          void *ptr;
          _v = (SWIG_ConvertPtr(*argv[2], (void **)&ptr, SWIGTYPE_p_Xapian__Query, 0) == 0);
        }
        if (_v) {
          _wrap_new_Query__SWIG_5(INTERNAL_FUNCTION_PARAM_PASSTHRU); return;
        }
      }
    }
  }
  if (argc == 3) {
    int _v;
    _v = (Z_TYPE_PP(argv[0]) == IS_LONG); 
    if (_v) {
      {
        void *ptr;
        _v = (SWIG_ConvertPtr(*argv[1], (void **)&ptr, SWIGTYPE_p_Xapian__Query, 0) == 0);
      }
      if (_v) {
        _v = (Z_TYPE_PP(argv[2]) == IS_DOUBLE); 
        if (_v) {
          _wrap_new_Query__SWIG_9(INTERNAL_FUNCTION_PARAM_PASSTHRU); return;
        }
      }
    }
  }
  if (argc == 3) {
    int _v;
    _v = (Z_TYPE_PP(argv[0]) == IS_LONG); 
    if (_v) {
      {
        _v = (Z_TYPE_PP(argv[1]) == IS_STRING);
      }
      if (_v) {
        {
          _v = (Z_TYPE_PP(argv[2]) == IS_STRING);
        }
        if (_v) {
          _wrap_new_Query__SWIG_6(INTERNAL_FUNCTION_PARAM_PASSTHRU); return;
        }
      }
    }
  }
  if (argc == 3) {
    int _v;
    _v = (Z_TYPE_PP(argv[0]) == IS_LONG); 
    if (_v) {
      _v = (Z_TYPE_PP(argv[1]) == IS_LONG); 
      if (_v) {
        {
          _v = (Z_TYPE_PP(argv[2]) == IS_STRING);
        }
        if (_v) {
          _wrap_new_Query__SWIG_11(INTERNAL_FUNCTION_PARAM_PASSTHRU); return;
        }
      }
    }
  }
  if (argc == 3) {
    int _v;
    _v = (Z_TYPE_PP(argv[0]) == IS_LONG); 
    if (_v) {
      {
        _v = (Z_TYPE_PP(argv[1]) == IS_ARRAY);
        /* FIXME: if we add more array typemaps, we'll need to check the elements
             * of the array here to disambiguate. */
      }
      if (_v) {
        _v = (Z_TYPE_PP(argv[2]) == IS_LONG); 
        if (_v) {
          _wrap_new_Query__SWIG_13(INTERNAL_FUNCTION_PARAM_PASSTHRU); return;
        }
      }
    }
  }
  if (argc == 4) {
    int _v;
    _v = (Z_TYPE_PP(argv[0]) == IS_LONG); 
    if (_v) {
      _v = (Z_TYPE_PP(argv[1]) == IS_LONG); 
      if (_v) {
        {
          _v = (Z_TYPE_PP(argv[2]) == IS_STRING);
        }
        if (_v) {
          {
            _v = (Z_TYPE_PP(argv[3]) == IS_STRING);
          }
          if (_v) {
            _wrap_new_Query__SWIG_10(INTERNAL_FUNCTION_PARAM_PASSTHRU); return;
          }
        }
      }
    }
  }
  
  SWIG_ErrorCode() = E_ERROR;
  SWIG_ErrorMsg() = "No matching function for overloaded 'new_Query'";
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_Stopper_apply) {
  Xapian::Stopper *arg1 = (Xapian::Stopper *) 0 ;
  std::string *arg2 = 0 ;
  std::string temp2 ;
  zval **args[2];
  Swig::Director *director = 0;
  bool upcall = false;
  bool result;
  
  director = dynamic_cast<Swig::Director*>(arg1);
  upcall = !director->swig_is_overridden_method((char *)"XapianStopper", (char *)"operator ()");
  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_Xapian__Stopper, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of Stopper_apply. Expected SWIGTYPE_p_Xapian__Stopper");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  
  convert_to_string_ex(args[1]);
  temp2.assign(Z_STRVAL_PP(args[1]), Z_STRLEN_PP(args[1]));
  arg2 = &temp2;
  
  {
    try {
      if (upcall) {
        Swig::DirectorPureVirtualException::raise("Xapian::Stopper::operator ()" TSRMLS_CC);
      } else {
        result = (bool)((Xapian::Stopper const *)arg1)->operator ()((std::string const &)*arg2);
      }
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  {
    ZVAL_BOOL(return_value,(result)?1:0);
  }
  
  return;
fail:
  zend_error(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_Stopper(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 ;
  Xapian::Stopper *arg1 = (Xapian::Stopper *) 0 ;
  
  efree(value);
  if (! newobject) return; /* can't delete it! */
  arg1 = (Xapian::Stopper *)SWIG_ZTS_ConvertResourceData(ptr,type_name,SWIGTYPE_p_Xapian__Stopper TSRMLS_CC);
  if (! arg1) zend_error(E_ERROR, "Xapian::Stopper resource already free'd");
  {
    try {
      delete arg1;
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_Stopper_get_description) {
  Xapian::Stopper *arg1 = (Xapian::Stopper *) 0 ;
  zval **args[1];
  Swig::Director *director = 0;
  bool upcall = false;
  std::string result;
  
  director = dynamic_cast<Swig::Director*>(arg1);
  upcall = !director->swig_is_overridden_method((char *)"XapianStopper", (char *)"get_description");
  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_Xapian__Stopper, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of Stopper_get_description. Expected SWIGTYPE_p_Xapian__Stopper");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    try {
      if (upcall) {
        result = ((Xapian::Stopper const *)arg1)->Xapian::Stopper::get_description();
      } else {
        result = ((Xapian::Stopper const *)arg1)->get_description();
      }
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  
  ZVAL_STRINGL(return_value, const_cast<char*>((&result)->data()), (&result)->size(), 1);
  
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_new_Stopper) {
  zval *arg0;
  zval **args[1];
  Xapian::Stopper *result = 0 ;
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 1 || zend_get_parameters_array_ex(1, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  arg0 = *args[0];
  
  {
    try {
      if ( arg0->type == IS_NULL ) {
        /* not subclassed */
        SWIG_PHP_Error(E_ERROR, "accessing abstract class or protected constructor");
      } else {
        result = (Xapian::Stopper *)new SwigDirector_Stopper(arg0 TSRMLS_CC);
      }
      
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  
  SWIG_SetPointerZval(return_value, (void *)result, SWIGTYPE_p_Xapian__Stopper, 1);
  
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_new_SimpleStopper) {
  Xapian::SimpleStopper *result = 0 ;
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 0) {
    WRONG_PARAM_COUNT;
  }
  
  {
    try {
      result = (Xapian::SimpleStopper *)new Xapian::SimpleStopper();
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  
  SWIG_SetPointerZval(return_value, (void *)result, SWIGTYPE_p_Xapian__SimpleStopper, 1);
  
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_SimpleStopper_add) {
  Xapian::SimpleStopper *arg1 = (Xapian::SimpleStopper *) 0 ;
  std::string *arg2 = 0 ;
  std::string temp2 ;
  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_Xapian__SimpleStopper, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of SimpleStopper_add. Expected SWIGTYPE_p_Xapian__SimpleStopper");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  
  convert_to_string_ex(args[1]);
  temp2.assign(Z_STRVAL_PP(args[1]), Z_STRLEN_PP(args[1]));
  arg2 = &temp2;
  
  {
    try {
      (arg1)->add((std::string const &)*arg2);
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  
  
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_SimpleStopper_apply) {
  Xapian::SimpleStopper *arg1 = (Xapian::SimpleStopper *) 0 ;
  std::string *arg2 = 0 ;
  std::string temp2 ;
  zval **args[2];
  bool 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_Xapian__SimpleStopper, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of SimpleStopper_apply. Expected SWIGTYPE_p_Xapian__SimpleStopper");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  
  convert_to_string_ex(args[1]);
  temp2.assign(Z_STRVAL_PP(args[1]), Z_STRLEN_PP(args[1]));
  arg2 = &temp2;
  
  {
    try {
      result = (bool)((Xapian::SimpleStopper const *)arg1)->operator ()((std::string const &)*arg2);
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  {
    ZVAL_BOOL(return_value,(result)?1:0);
  }
  
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_SimpleStopper_get_description) {
  Xapian::SimpleStopper *arg1 = (Xapian::SimpleStopper *) 0 ;
  zval **args[1];
  std::string 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_Xapian__SimpleStopper, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of SimpleStopper_get_description. Expected SWIGTYPE_p_Xapian__SimpleStopper");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    try {
      result = ((Xapian::SimpleStopper const *)arg1)->get_description();
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  
  ZVAL_STRINGL(return_value, const_cast<char*>((&result)->data()), (&result)->size(), 1);
  
  return;
fail:
  zend_error(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_SimpleStopper(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 ;
  Xapian::SimpleStopper *arg1 = (Xapian::SimpleStopper *) 0 ;
  
  efree(value);
  if (! newobject) return; /* can't delete it! */
  arg1 = (Xapian::SimpleStopper *)SWIG_ZTS_ConvertResourceData(ptr,type_name,SWIGTYPE_p_Xapian__SimpleStopper TSRMLS_CC);
  if (! arg1) zend_error(E_ERROR, "Xapian::SimpleStopper resource already free'd");
  {
    try {
      delete arg1;
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  return;
fail:
  zend_error(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_ValueRangeProcessor(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 ;
  Xapian::ValueRangeProcessor *arg1 = (Xapian::ValueRangeProcessor *) 0 ;
  
  efree(value);
  if (! newobject) return; /* can't delete it! */
  arg1 = (Xapian::ValueRangeProcessor *)SWIG_ZTS_ConvertResourceData(ptr,type_name,SWIGTYPE_p_Xapian__ValueRangeProcessor TSRMLS_CC);
  if (! arg1) zend_error(E_ERROR, "Xapian::ValueRangeProcessor resource already free'd");
  {
    try {
      delete arg1;
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_ValueRangeProcessor_apply) {
  Xapian::ValueRangeProcessor *arg1 = (Xapian::ValueRangeProcessor *) 0 ;
  std::string *arg2 = 0 ;
  std::string *arg3 = 0 ;
  std::string temp2 ;
  std::string temp3 ;
  zval **args[3];
  Swig::Director *director = 0;
  bool upcall = false;
  Xapian::valueno result;
  
  director = dynamic_cast<Swig::Director*>(arg1);
  upcall = !director->swig_is_overridden_method((char *)"XapianValueRangeProcessor", (char *)"operator ()");
  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_Xapian__ValueRangeProcessor, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of ValueRangeProcessor_apply. Expected SWIGTYPE_p_Xapian__ValueRangeProcessor");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  
  convert_to_string_ex(args[1]);
  temp2.assign(Z_STRVAL_PP(args[1]), Z_STRLEN_PP(args[1]));
  arg2 = &temp2;
  
  
  convert_to_string_ex(args[2]);
  temp3.assign(Z_STRVAL_PP(args[2]), Z_STRLEN_PP(args[2]));
  arg3 = &temp3;
  
  {
    try {
      if (upcall) {
        Swig::DirectorPureVirtualException::raise("Xapian::ValueRangeProcessor::operator ()" TSRMLS_CC);
      } else {
        result = (Xapian::valueno)(arg1)->operator ()(*arg2,*arg3);
      }
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  {
    ZVAL_LONG(return_value,result);
  }
  
  ZVAL_STRINGL(*(args[1]), const_cast<char*>(arg2->data()), arg2->size(), 1);
  
  
  ZVAL_STRINGL(*(args[2]), const_cast<char*>(arg3->data()), arg3->size(), 1);
  
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_new_ValueRangeProcessor) {
  zval *arg0;
  zval **args[1];
  Xapian::ValueRangeProcessor *result = 0 ;
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 1 || zend_get_parameters_array_ex(1, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  arg0 = *args[0];
  
  {
    try {
      if ( arg0->type == IS_NULL ) {
        /* not subclassed */
        SWIG_PHP_Error(E_ERROR, "accessing abstract class or protected constructor");
      } else {
        result = (Xapian::ValueRangeProcessor *)new SwigDirector_ValueRangeProcessor(arg0 TSRMLS_CC);
      }
      
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  
  SWIG_SetPointerZval(return_value, (void *)result, SWIGTYPE_p_Xapian__ValueRangeProcessor, 1);
  
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_new_StringValueRangeProcessor__SWIG_0) {
  Xapian::valueno arg1 ;
  zval **args[1];
  Xapian::StringValueRangeProcessor *result = 0 ;
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 1 || zend_get_parameters_array_ex(1, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  
  /*@SWIG:/data/home/olly/tmp/xapian-svn-snapshot/tags/1.2.8/xapian/swig/Lib/php/utils.i,7,CONVERT_INT_IN@*/
  convert_to_long_ex(args[0]);
  arg1 = (Xapian::valueno) Z_LVAL_PP(args[0]);
  /*@SWIG@*/;
  
  {
    try {
      result = (Xapian::StringValueRangeProcessor *)new Xapian::StringValueRangeProcessor(arg1);
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  
  SWIG_SetPointerZval(return_value, (void *)result, SWIGTYPE_p_Xapian__StringValueRangeProcessor, 1);
  
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_new_StringValueRangeProcessor__SWIG_1) {
  Xapian::valueno arg1 ;
  std::string *arg2 = 0 ;
  bool arg3 ;
  std::string temp2 ;
  zval **args[3];
  Xapian::StringValueRangeProcessor *result = 0 ;
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 3 || zend_get_parameters_array_ex(3, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  
  /*@SWIG:/data/home/olly/tmp/xapian-svn-snapshot/tags/1.2.8/xapian/swig/Lib/php/utils.i,7,CONVERT_INT_IN@*/
  convert_to_long_ex(args[0]);
  arg1 = (Xapian::valueno) Z_LVAL_PP(args[0]);
  /*@SWIG@*/;
  
  
  convert_to_string_ex(args[1]);
  temp2.assign(Z_STRVAL_PP(args[1]), Z_STRLEN_PP(args[1]));
  arg2 = &temp2;
  
  
  /*@SWIG:/data/home/olly/tmp/xapian-svn-snapshot/tags/1.2.8/xapian/swig/Lib/php/utils.i,2,CONVERT_BOOL_IN@*/
  convert_to_boolean_ex(args[2]);
  arg3 = (bool) Z_LVAL_PP(args[2]);
  /*@SWIG@*/;
  
  {
    try {
      result = (Xapian::StringValueRangeProcessor *)new Xapian::StringValueRangeProcessor(arg1,(std::string const &)*arg2,arg3);
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  
  SWIG_SetPointerZval(return_value, (void *)result, SWIGTYPE_p_Xapian__StringValueRangeProcessor, 1);
  
  
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_new_StringValueRangeProcessor__SWIG_2) {
  Xapian::valueno arg1 ;
  std::string *arg2 = 0 ;
  std::string temp2 ;
  zval **args[2];
  Xapian::StringValueRangeProcessor *result = 0 ;
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 2 || zend_get_parameters_array_ex(2, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  
  /*@SWIG:/data/home/olly/tmp/xapian-svn-snapshot/tags/1.2.8/xapian/swig/Lib/php/utils.i,7,CONVERT_INT_IN@*/
  convert_to_long_ex(args[0]);
  arg1 = (Xapian::valueno) Z_LVAL_PP(args[0]);
  /*@SWIG@*/;
  
  
  convert_to_string_ex(args[1]);
  temp2.assign(Z_STRVAL_PP(args[1]), Z_STRLEN_PP(args[1]));
  arg2 = &temp2;
  
  {
    try {
      result = (Xapian::StringValueRangeProcessor *)new Xapian::StringValueRangeProcessor(arg1,(std::string const &)*arg2);
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  
  SWIG_SetPointerZval(return_value, (void *)result, SWIGTYPE_p_Xapian__StringValueRangeProcessor, 1);
  
  
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_new_StringValueRangeProcessor) {
  int argc;
  zval **argv[3];
  
  argc = ZEND_NUM_ARGS();
  zend_get_parameters_array_ex(argc,argv);
  if (argc == 1) {
    int _v;
    _v = (Z_TYPE_PP(argv[0]) == IS_LONG); 
    if (_v) {
      _wrap_new_StringValueRangeProcessor__SWIG_0(INTERNAL_FUNCTION_PARAM_PASSTHRU); return;
    }
  }
  if (argc == 2) {
    int _v;
    _v = (Z_TYPE_PP(argv[0]) == IS_LONG); 
    if (_v) {
      {
        _v = (Z_TYPE_PP(argv[1]) == IS_STRING);
      }
      if (_v) {
        _wrap_new_StringValueRangeProcessor__SWIG_2(INTERNAL_FUNCTION_PARAM_PASSTHRU); return;
      }
    }
  }
  if (argc == 3) {
    int _v;
    _v = (Z_TYPE_PP(argv[0]) == IS_LONG); 
    if (_v) {
      {
        _v = (Z_TYPE_PP(argv[1]) == IS_STRING);
      }
      if (_v) {
        {
          _v = (Z_TYPE_PP(argv[2]) == IS_BOOL || Z_TYPE_PP(argv[2]) == IS_LONG);
        }
        if (_v) {
          _wrap_new_StringValueRangeProcessor__SWIG_1(INTERNAL_FUNCTION_PARAM_PASSTHRU); return;
        }
      }
    }
  }
  
  SWIG_ErrorCode() = E_ERROR;
  SWIG_ErrorMsg() = "No matching function for overloaded 'new_StringValueRangeProcessor'";
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_StringValueRangeProcessor_apply) {
  Xapian::StringValueRangeProcessor *arg1 = (Xapian::StringValueRangeProcessor *) 0 ;
  std::string *arg2 = 0 ;
  std::string *arg3 = 0 ;
  std::string temp2 ;
  std::string temp3 ;
  zval **args[3];
  Xapian::valueno 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_Xapian__StringValueRangeProcessor, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of StringValueRangeProcessor_apply. Expected SWIGTYPE_p_Xapian__StringValueRangeProcessor");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  
  convert_to_string_ex(args[1]);
  temp2.assign(Z_STRVAL_PP(args[1]), Z_STRLEN_PP(args[1]));
  arg2 = &temp2;
  
  
  convert_to_string_ex(args[2]);
  temp3.assign(Z_STRVAL_PP(args[2]), Z_STRLEN_PP(args[2]));
  arg3 = &temp3;
  
  {
    try {
      result = (Xapian::valueno)(arg1)->operator ()(*arg2,*arg3);
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  {
    ZVAL_LONG(return_value,result);
  }
  
  ZVAL_STRINGL(*(args[1]), const_cast<char*>(arg2->data()), arg2->size(), 1);
  
  
  ZVAL_STRINGL(*(args[2]), const_cast<char*>(arg3->data()), arg3->size(), 1);
  
  return;
fail:
  zend_error(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_StringValueRangeProcessor(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 ;
  Xapian::StringValueRangeProcessor *arg1 = (Xapian::StringValueRangeProcessor *) 0 ;
  
  efree(value);
  if (! newobject) return; /* can't delete it! */
  arg1 = (Xapian::StringValueRangeProcessor *)SWIG_ZTS_ConvertResourceData(ptr,type_name,SWIGTYPE_p_Xapian__StringValueRangeProcessor TSRMLS_CC);
  if (! arg1) zend_error(E_ERROR, "Xapian::StringValueRangeProcessor resource already free'd");
  {
    try {
      delete arg1;
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_new_DateValueRangeProcessor__SWIG_0) {
  Xapian::valueno arg1 ;
  bool arg2 ;
  int arg3 ;
  zval **args[3];
  Xapian::DateValueRangeProcessor *result = 0 ;
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 3 || zend_get_parameters_array_ex(3, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  
  /*@SWIG:/data/home/olly/tmp/xapian-svn-snapshot/tags/1.2.8/xapian/swig/Lib/php/utils.i,7,CONVERT_INT_IN@*/
  convert_to_long_ex(args[0]);
  arg1 = (Xapian::valueno) Z_LVAL_PP(args[0]);
  /*@SWIG@*/;
  
  
  /*@SWIG:/data/home/olly/tmp/xapian-svn-snapshot/tags/1.2.8/xapian/swig/Lib/php/utils.i,2,CONVERT_BOOL_IN@*/
  convert_to_boolean_ex(args[1]);
  arg2 = (bool) Z_LVAL_PP(args[1]);
  /*@SWIG@*/;
  
  
  /*@SWIG:/data/home/olly/tmp/xapian-svn-snapshot/tags/1.2.8/xapian/swig/Lib/php/utils.i,7,CONVERT_INT_IN@*/
  convert_to_long_ex(args[2]);
  arg3 = (int) Z_LVAL_PP(args[2]);
  /*@SWIG@*/;
  
  {
    try {
      result = (Xapian::DateValueRangeProcessor *)new Xapian::DateValueRangeProcessor(arg1,arg2,arg3);
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  
  SWIG_SetPointerZval(return_value, (void *)result, SWIGTYPE_p_Xapian__DateValueRangeProcessor, 1);
  
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_new_DateValueRangeProcessor__SWIG_1) {
  Xapian::valueno arg1 ;
  bool arg2 ;
  zval **args[2];
  Xapian::DateValueRangeProcessor *result = 0 ;
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 2 || zend_get_parameters_array_ex(2, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  
  /*@SWIG:/data/home/olly/tmp/xapian-svn-snapshot/tags/1.2.8/xapian/swig/Lib/php/utils.i,7,CONVERT_INT_IN@*/
  convert_to_long_ex(args[0]);
  arg1 = (Xapian::valueno) Z_LVAL_PP(args[0]);
  /*@SWIG@*/;
  
  
  /*@SWIG:/data/home/olly/tmp/xapian-svn-snapshot/tags/1.2.8/xapian/swig/Lib/php/utils.i,2,CONVERT_BOOL_IN@*/
  convert_to_boolean_ex(args[1]);
  arg2 = (bool) Z_LVAL_PP(args[1]);
  /*@SWIG@*/;
  
  {
    try {
      result = (Xapian::DateValueRangeProcessor *)new Xapian::DateValueRangeProcessor(arg1,arg2);
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  
  SWIG_SetPointerZval(return_value, (void *)result, SWIGTYPE_p_Xapian__DateValueRangeProcessor, 1);
  
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_new_DateValueRangeProcessor__SWIG_2) {
  Xapian::valueno arg1 ;
  zval **args[1];
  Xapian::DateValueRangeProcessor *result = 0 ;
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 1 || zend_get_parameters_array_ex(1, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  
  /*@SWIG:/data/home/olly/tmp/xapian-svn-snapshot/tags/1.2.8/xapian/swig/Lib/php/utils.i,7,CONVERT_INT_IN@*/
  convert_to_long_ex(args[0]);
  arg1 = (Xapian::valueno) Z_LVAL_PP(args[0]);
  /*@SWIG@*/;
  
  {
    try {
      result = (Xapian::DateValueRangeProcessor *)new Xapian::DateValueRangeProcessor(arg1);
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  
  SWIG_SetPointerZval(return_value, (void *)result, SWIGTYPE_p_Xapian__DateValueRangeProcessor, 1);
  
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_new_DateValueRangeProcessor__SWIG_3) {
  Xapian::valueno arg1 ;
  std::string *arg2 = 0 ;
  bool arg3 ;
  bool arg4 ;
  int arg5 ;
  std::string temp2 ;
  zval **args[5];
  Xapian::DateValueRangeProcessor *result = 0 ;
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 5 || zend_get_parameters_array_ex(5, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  
  /*@SWIG:/data/home/olly/tmp/xapian-svn-snapshot/tags/1.2.8/xapian/swig/Lib/php/utils.i,7,CONVERT_INT_IN@*/
  convert_to_long_ex(args[0]);
  arg1 = (Xapian::valueno) Z_LVAL_PP(args[0]);
  /*@SWIG@*/;
  
  
  convert_to_string_ex(args[1]);
  temp2.assign(Z_STRVAL_PP(args[1]), Z_STRLEN_PP(args[1]));
  arg2 = &temp2;
  
  
  /*@SWIG:/data/home/olly/tmp/xapian-svn-snapshot/tags/1.2.8/xapian/swig/Lib/php/utils.i,2,CONVERT_BOOL_IN@*/
  convert_to_boolean_ex(args[2]);
  arg3 = (bool) Z_LVAL_PP(args[2]);
  /*@SWIG@*/;
  
  
  /*@SWIG:/data/home/olly/tmp/xapian-svn-snapshot/tags/1.2.8/xapian/swig/Lib/php/utils.i,2,CONVERT_BOOL_IN@*/
  convert_to_boolean_ex(args[3]);
  arg4 = (bool) Z_LVAL_PP(args[3]);
  /*@SWIG@*/;
  
  
  /*@SWIG:/data/home/olly/tmp/xapian-svn-snapshot/tags/1.2.8/xapian/swig/Lib/php/utils.i,7,CONVERT_INT_IN@*/
  convert_to_long_ex(args[4]);
  arg5 = (int) Z_LVAL_PP(args[4]);
  /*@SWIG@*/;
  
  {
    try {
      result = (Xapian::DateValueRangeProcessor *)new Xapian::DateValueRangeProcessor(arg1,(std::string const &)*arg2,arg3,arg4,arg5);
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  
  SWIG_SetPointerZval(return_value, (void *)result, SWIGTYPE_p_Xapian__DateValueRangeProcessor, 1);
  
  
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_new_DateValueRangeProcessor__SWIG_4) {
  Xapian::valueno arg1 ;
  std::string *arg2 = 0 ;
  bool arg3 ;
  bool arg4 ;
  std::string temp2 ;
  zval **args[4];
  Xapian::DateValueRangeProcessor *result = 0 ;
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 4 || zend_get_parameters_array_ex(4, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  
  /*@SWIG:/data/home/olly/tmp/xapian-svn-snapshot/tags/1.2.8/xapian/swig/Lib/php/utils.i,7,CONVERT_INT_IN@*/
  convert_to_long_ex(args[0]);
  arg1 = (Xapian::valueno) Z_LVAL_PP(args[0]);
  /*@SWIG@*/;
  
  
  convert_to_string_ex(args[1]);
  temp2.assign(Z_STRVAL_PP(args[1]), Z_STRLEN_PP(args[1]));
  arg2 = &temp2;
  
  
  /*@SWIG:/data/home/olly/tmp/xapian-svn-snapshot/tags/1.2.8/xapian/swig/Lib/php/utils.i,2,CONVERT_BOOL_IN@*/
  convert_to_boolean_ex(args[2]);
  arg3 = (bool) Z_LVAL_PP(args[2]);
  /*@SWIG@*/;
  
  
  /*@SWIG:/data/home/olly/tmp/xapian-svn-snapshot/tags/1.2.8/xapian/swig/Lib/php/utils.i,2,CONVERT_BOOL_IN@*/
  convert_to_boolean_ex(args[3]);
  arg4 = (bool) Z_LVAL_PP(args[3]);
  /*@SWIG@*/;
  
  {
    try {
      result = (Xapian::DateValueRangeProcessor *)new Xapian::DateValueRangeProcessor(arg1,(std::string const &)*arg2,arg3,arg4);
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  
  SWIG_SetPointerZval(return_value, (void *)result, SWIGTYPE_p_Xapian__DateValueRangeProcessor, 1);
  
  
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_new_DateValueRangeProcessor__SWIG_5) {
  Xapian::valueno arg1 ;
  std::string *arg2 = 0 ;
  bool arg3 ;
  std::string temp2 ;
  zval **args[3];
  Xapian::DateValueRangeProcessor *result = 0 ;
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 3 || zend_get_parameters_array_ex(3, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  
  /*@SWIG:/data/home/olly/tmp/xapian-svn-snapshot/tags/1.2.8/xapian/swig/Lib/php/utils.i,7,CONVERT_INT_IN@*/
  convert_to_long_ex(args[0]);
  arg1 = (Xapian::valueno) Z_LVAL_PP(args[0]);
  /*@SWIG@*/;
  
  
  convert_to_string_ex(args[1]);
  temp2.assign(Z_STRVAL_PP(args[1]), Z_STRLEN_PP(args[1]));
  arg2 = &temp2;
  
  
  /*@SWIG:/data/home/olly/tmp/xapian-svn-snapshot/tags/1.2.8/xapian/swig/Lib/php/utils.i,2,CONVERT_BOOL_IN@*/
  convert_to_boolean_ex(args[2]);
  arg3 = (bool) Z_LVAL_PP(args[2]);
  /*@SWIG@*/;
  
  {
    try {
      result = (Xapian::DateValueRangeProcessor *)new Xapian::DateValueRangeProcessor(arg1,(std::string const &)*arg2,arg3);
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  
  SWIG_SetPointerZval(return_value, (void *)result, SWIGTYPE_p_Xapian__DateValueRangeProcessor, 1);
  
  
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_new_DateValueRangeProcessor__SWIG_6) {
  Xapian::valueno arg1 ;
  std::string *arg2 = 0 ;
  std::string temp2 ;
  zval **args[2];
  Xapian::DateValueRangeProcessor *result = 0 ;
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 2 || zend_get_parameters_array_ex(2, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  
  /*@SWIG:/data/home/olly/tmp/xapian-svn-snapshot/tags/1.2.8/xapian/swig/Lib/php/utils.i,7,CONVERT_INT_IN@*/
  convert_to_long_ex(args[0]);
  arg1 = (Xapian::valueno) Z_LVAL_PP(args[0]);
  /*@SWIG@*/;
  
  
  convert_to_string_ex(args[1]);
  temp2.assign(Z_STRVAL_PP(args[1]), Z_STRLEN_PP(args[1]));
  arg2 = &temp2;
  
  {
    try {
      result = (Xapian::DateValueRangeProcessor *)new Xapian::DateValueRangeProcessor(arg1,(std::string const &)*arg2);
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  
  SWIG_SetPointerZval(return_value, (void *)result, SWIGTYPE_p_Xapian__DateValueRangeProcessor, 1);
  
  
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_new_DateValueRangeProcessor) {
  int argc;
  zval **argv[5];
  
  argc = ZEND_NUM_ARGS();
  zend_get_parameters_array_ex(argc,argv);
  if (argc == 1) {
    int _v;
    _v = (Z_TYPE_PP(argv[0]) == IS_LONG); 
    if (_v) {
      _wrap_new_DateValueRangeProcessor__SWIG_2(INTERNAL_FUNCTION_PARAM_PASSTHRU); return;
    }
  }
  if (argc == 2) {
    int _v;
    _v = (Z_TYPE_PP(argv[0]) == IS_LONG); 
    if (_v) {
      {
        _v = (Z_TYPE_PP(argv[1]) == IS_STRING);
      }
      if (_v) {
        _wrap_new_DateValueRangeProcessor__SWIG_6(INTERNAL_FUNCTION_PARAM_PASSTHRU); return;
      }
    }
  }
  if (argc == 2) {
    int _v;
    _v = (Z_TYPE_PP(argv[0]) == IS_LONG); 
    if (_v) {
      {
        _v = (Z_TYPE_PP(argv[1]) == IS_BOOL || Z_TYPE_PP(argv[1]) == IS_LONG);
      }
      if (_v) {
        _wrap_new_DateValueRangeProcessor__SWIG_1(INTERNAL_FUNCTION_PARAM_PASSTHRU); return;
      }
    }
  }
  if (argc == 3) {
    int _v;
    _v = (Z_TYPE_PP(argv[0]) == IS_LONG); 
    if (_v) {
      {
        _v = (Z_TYPE_PP(argv[1]) == IS_STRING);
      }
      if (_v) {
        {
          _v = (Z_TYPE_PP(argv[2]) == IS_BOOL || Z_TYPE_PP(argv[2]) == IS_LONG);
        }
        if (_v) {
          _wrap_new_DateValueRangeProcessor__SWIG_5(INTERNAL_FUNCTION_PARAM_PASSTHRU); return;
        }
      }
    }
  }
  if (argc == 3) {
    int _v;
    _v = (Z_TYPE_PP(argv[0]) == IS_LONG); 
    if (_v) {
      {
        _v = (Z_TYPE_PP(argv[1]) == IS_BOOL || Z_TYPE_PP(argv[1]) == IS_LONG);
      }
      if (_v) {
        _v = (Z_TYPE_PP(argv[2]) == IS_LONG); 
        if (_v) {
          _wrap_new_DateValueRangeProcessor__SWIG_0(INTERNAL_FUNCTION_PARAM_PASSTHRU); return;
        }
      }
    }
  }
  if (argc == 4) {
    int _v;
    _v = (Z_TYPE_PP(argv[0]) == IS_LONG); 
    if (_v) {
      {
        _v = (Z_TYPE_PP(argv[1]) == IS_STRING);
      }
      if (_v) {
        {
          _v = (Z_TYPE_PP(argv[2]) == IS_BOOL || Z_TYPE_PP(argv[2]) == IS_LONG);
        }
        if (_v) {
          {
            _v = (Z_TYPE_PP(argv[3]) == IS_BOOL || Z_TYPE_PP(argv[3]) == IS_LONG);
          }
          if (_v) {
            _wrap_new_DateValueRangeProcessor__SWIG_4(INTERNAL_FUNCTION_PARAM_PASSTHRU); return;
          }
        }
      }
    }
  }
  if (argc == 5) {
    int _v;
    _v = (Z_TYPE_PP(argv[0]) == IS_LONG); 
    if (_v) {
      {
        _v = (Z_TYPE_PP(argv[1]) == IS_STRING);
      }
      if (_v) {
        {
          _v = (Z_TYPE_PP(argv[2]) == IS_BOOL || Z_TYPE_PP(argv[2]) == IS_LONG);
        }
        if (_v) {
          {
            _v = (Z_TYPE_PP(argv[3]) == IS_BOOL || Z_TYPE_PP(argv[3]) == IS_LONG);
          }
          if (_v) {
            _v = (Z_TYPE_PP(argv[4]) == IS_LONG); 
            if (_v) {
              _wrap_new_DateValueRangeProcessor__SWIG_3(INTERNAL_FUNCTION_PARAM_PASSTHRU); return;
            }
          }
        }
      }
    }
  }
  
  SWIG_ErrorCode() = E_ERROR;
  SWIG_ErrorMsg() = "No matching function for overloaded 'new_DateValueRangeProcessor'";
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_DateValueRangeProcessor_apply) {
  Xapian::DateValueRangeProcessor *arg1 = (Xapian::DateValueRangeProcessor *) 0 ;
  std::string *arg2 = 0 ;
  std::string *arg3 = 0 ;
  std::string temp2 ;
  std::string temp3 ;
  zval **args[3];
  Xapian::valueno 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_Xapian__DateValueRangeProcessor, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of DateValueRangeProcessor_apply. Expected SWIGTYPE_p_Xapian__DateValueRangeProcessor");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  
  convert_to_string_ex(args[1]);
  temp2.assign(Z_STRVAL_PP(args[1]), Z_STRLEN_PP(args[1]));
  arg2 = &temp2;
  
  
  convert_to_string_ex(args[2]);
  temp3.assign(Z_STRVAL_PP(args[2]), Z_STRLEN_PP(args[2]));
  arg3 = &temp3;
  
  {
    try {
      result = (Xapian::valueno)(arg1)->operator ()(*arg2,*arg3);
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  {
    ZVAL_LONG(return_value,result);
  }
  
  ZVAL_STRINGL(*(args[1]), const_cast<char*>(arg2->data()), arg2->size(), 1);
  
  
  ZVAL_STRINGL(*(args[2]), const_cast<char*>(arg3->data()), arg3->size(), 1);
  
  return;
fail:
  zend_error(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_DateValueRangeProcessor(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 ;
  Xapian::DateValueRangeProcessor *arg1 = (Xapian::DateValueRangeProcessor *) 0 ;
  
  efree(value);
  if (! newobject) return; /* can't delete it! */
  arg1 = (Xapian::DateValueRangeProcessor *)SWIG_ZTS_ConvertResourceData(ptr,type_name,SWIGTYPE_p_Xapian__DateValueRangeProcessor TSRMLS_CC);
  if (! arg1) zend_error(E_ERROR, "Xapian::DateValueRangeProcessor resource already free'd");
  {
    try {
      delete arg1;
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_new_NumberValueRangeProcessor__SWIG_0) {
  Xapian::valueno arg1 ;
  zval **args[1];
  Xapian::NumberValueRangeProcessor *result = 0 ;
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 1 || zend_get_parameters_array_ex(1, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  
  /*@SWIG:/data/home/olly/tmp/xapian-svn-snapshot/tags/1.2.8/xapian/swig/Lib/php/utils.i,7,CONVERT_INT_IN@*/
  convert_to_long_ex(args[0]);
  arg1 = (Xapian::valueno) Z_LVAL_PP(args[0]);
  /*@SWIG@*/;
  
  {
    try {
      result = (Xapian::NumberValueRangeProcessor *)new Xapian::NumberValueRangeProcessor(arg1);
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  
  SWIG_SetPointerZval(return_value, (void *)result, SWIGTYPE_p_Xapian__NumberValueRangeProcessor, 1);
  
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_new_NumberValueRangeProcessor__SWIG_1) {
  Xapian::valueno arg1 ;
  std::string *arg2 = 0 ;
  bool arg3 ;
  std::string temp2 ;
  zval **args[3];
  Xapian::NumberValueRangeProcessor *result = 0 ;
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 3 || zend_get_parameters_array_ex(3, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  
  /*@SWIG:/data/home/olly/tmp/xapian-svn-snapshot/tags/1.2.8/xapian/swig/Lib/php/utils.i,7,CONVERT_INT_IN@*/
  convert_to_long_ex(args[0]);
  arg1 = (Xapian::valueno) Z_LVAL_PP(args[0]);
  /*@SWIG@*/;
  
  
  convert_to_string_ex(args[1]);
  temp2.assign(Z_STRVAL_PP(args[1]), Z_STRLEN_PP(args[1]));
  arg2 = &temp2;
  
  
  /*@SWIG:/data/home/olly/tmp/xapian-svn-snapshot/tags/1.2.8/xapian/swig/Lib/php/utils.i,2,CONVERT_BOOL_IN@*/
  convert_to_boolean_ex(args[2]);
  arg3 = (bool) Z_LVAL_PP(args[2]);
  /*@SWIG@*/;
  
  {
    try {
      result = (Xapian::NumberValueRangeProcessor *)new Xapian::NumberValueRangeProcessor(arg1,(std::string const &)*arg2,arg3);
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  
  SWIG_SetPointerZval(return_value, (void *)result, SWIGTYPE_p_Xapian__NumberValueRangeProcessor, 1);
  
  
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_new_NumberValueRangeProcessor__SWIG_2) {
  Xapian::valueno arg1 ;
  std::string *arg2 = 0 ;
  std::string temp2 ;
  zval **args[2];
  Xapian::NumberValueRangeProcessor *result = 0 ;
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 2 || zend_get_parameters_array_ex(2, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  
  /*@SWIG:/data/home/olly/tmp/xapian-svn-snapshot/tags/1.2.8/xapian/swig/Lib/php/utils.i,7,CONVERT_INT_IN@*/
  convert_to_long_ex(args[0]);
  arg1 = (Xapian::valueno) Z_LVAL_PP(args[0]);
  /*@SWIG@*/;
  
  
  convert_to_string_ex(args[1]);
  temp2.assign(Z_STRVAL_PP(args[1]), Z_STRLEN_PP(args[1]));
  arg2 = &temp2;
  
  {
    try {
      result = (Xapian::NumberValueRangeProcessor *)new Xapian::NumberValueRangeProcessor(arg1,(std::string const &)*arg2);
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  
  SWIG_SetPointerZval(return_value, (void *)result, SWIGTYPE_p_Xapian__NumberValueRangeProcessor, 1);
  
  
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_new_NumberValueRangeProcessor) {
  int argc;
  zval **argv[3];
  
  argc = ZEND_NUM_ARGS();
  zend_get_parameters_array_ex(argc,argv);
  if (argc == 1) {
    int _v;
    _v = (Z_TYPE_PP(argv[0]) == IS_LONG); 
    if (_v) {
      _wrap_new_NumberValueRangeProcessor__SWIG_0(INTERNAL_FUNCTION_PARAM_PASSTHRU); return;
    }
  }
  if (argc == 2) {
    int _v;
    _v = (Z_TYPE_PP(argv[0]) == IS_LONG); 
    if (_v) {
      {
        _v = (Z_TYPE_PP(argv[1]) == IS_STRING);
      }
      if (_v) {
        _wrap_new_NumberValueRangeProcessor__SWIG_2(INTERNAL_FUNCTION_PARAM_PASSTHRU); return;
      }
    }
  }
  if (argc == 3) {
    int _v;
    _v = (Z_TYPE_PP(argv[0]) == IS_LONG); 
    if (_v) {
      {
        _v = (Z_TYPE_PP(argv[1]) == IS_STRING);
      }
      if (_v) {
        {
          _v = (Z_TYPE_PP(argv[2]) == IS_BOOL || Z_TYPE_PP(argv[2]) == IS_LONG);
        }
        if (_v) {
          _wrap_new_NumberValueRangeProcessor__SWIG_1(INTERNAL_FUNCTION_PARAM_PASSTHRU); return;
        }
      }
    }
  }
  
  SWIG_ErrorCode() = E_ERROR;
  SWIG_ErrorMsg() = "No matching function for overloaded 'new_NumberValueRangeProcessor'";
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_NumberValueRangeProcessor_apply) {
  Xapian::NumberValueRangeProcessor *arg1 = (Xapian::NumberValueRangeProcessor *) 0 ;
  std::string *arg2 = 0 ;
  std::string *arg3 = 0 ;
  std::string temp2 ;
  std::string temp3 ;
  zval **args[3];
  Xapian::valueno 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_Xapian__NumberValueRangeProcessor, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of NumberValueRangeProcessor_apply. Expected SWIGTYPE_p_Xapian__NumberValueRangeProcessor");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  
  convert_to_string_ex(args[1]);
  temp2.assign(Z_STRVAL_PP(args[1]), Z_STRLEN_PP(args[1]));
  arg2 = &temp2;
  
  
  convert_to_string_ex(args[2]);
  temp3.assign(Z_STRVAL_PP(args[2]), Z_STRLEN_PP(args[2]));
  arg3 = &temp3;
  
  {
    try {
      result = (Xapian::valueno)(arg1)->operator ()(*arg2,*arg3);
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  {
    ZVAL_LONG(return_value,result);
  }
  
  ZVAL_STRINGL(*(args[1]), const_cast<char*>(arg2->data()), arg2->size(), 1);
  
  
  ZVAL_STRINGL(*(args[2]), const_cast<char*>(arg3->data()), arg3->size(), 1);
  
  return;
fail:
  zend_error(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_NumberValueRangeProcessor(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 ;
  Xapian::NumberValueRangeProcessor *arg1 = (Xapian::NumberValueRangeProcessor *) 0 ;
  
  efree(value);
  if (! newobject) return; /* can't delete it! */
  arg1 = (Xapian::NumberValueRangeProcessor *)SWIG_ZTS_ConvertResourceData(ptr,type_name,SWIGTYPE_p_Xapian__NumberValueRangeProcessor TSRMLS_CC);
  if (! arg1) zend_error(E_ERROR, "Xapian::NumberValueRangeProcessor resource already free'd");
  {
    try {
      delete arg1;
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_new_QueryParser) {
  Xapian::QueryParser *result = 0 ;
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 0) {
    WRONG_PARAM_COUNT;
  }
  
  {
    try {
      result = (Xapian::QueryParser *)new Xapian::QueryParser();
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  
  SWIG_SetPointerZval(return_value, (void *)result, SWIGTYPE_p_Xapian__QueryParser, 1);
  
  return;
fail:
  zend_error(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_QueryParser(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 ;
  Xapian::QueryParser *arg1 = (Xapian::QueryParser *) 0 ;
  
  efree(value);
  if (! newobject) return; /* can't delete it! */
  arg1 = (Xapian::QueryParser *)SWIG_ZTS_ConvertResourceData(ptr,type_name,SWIGTYPE_p_Xapian__QueryParser TSRMLS_CC);
  if (! arg1) zend_error(E_ERROR, "Xapian::QueryParser resource already free'd");
  {
    try {
      delete arg1;
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_QueryParser_set_stemmer) {
  Xapian::QueryParser *arg1 = (Xapian::QueryParser *) 0 ;
  Xapian::Stem *arg2 = 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_Xapian__QueryParser, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of QueryParser_set_stemmer. Expected SWIGTYPE_p_Xapian__QueryParser");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    if (SWIG_ConvertPtr(*args[1], (void**)&arg2, SWIGTYPE_p_Xapian__Stem, 0) < 0 || arg2 == NULL) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 2 of QueryParser_set_stemmer. Expected SWIGTYPE_p_Xapian__Stem");
    }
  }
  {
    try {
      (arg1)->set_stemmer((Xapian::Stem const &)*arg2);
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_QueryParser_set_stemming_strategy) {
  Xapian::QueryParser *arg1 = (Xapian::QueryParser *) 0 ;
  Xapian::QueryParser::stem_strategy 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_Xapian__QueryParser, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of QueryParser_set_stemming_strategy. Expected SWIGTYPE_p_Xapian__QueryParser");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  
  /*@SWIG:/data/home/olly/tmp/xapian-svn-snapshot/tags/1.2.8/xapian/swig/Lib/php/utils.i,7,CONVERT_INT_IN@*/
  convert_to_long_ex(args[1]);
  arg2 = (Xapian::QueryParser::stem_strategy) Z_LVAL_PP(args[1]);
  /*@SWIG@*/;
  
  {
    try {
      (arg1)->set_stemming_strategy(arg2);
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_QueryParser_set_stopper__SWIG_0) {
  Xapian::QueryParser *arg1 = (Xapian::QueryParser *) 0 ;
  Xapian::Stopper *arg2 = (Xapian::Stopper *) 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_Xapian__QueryParser, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of QueryParser_set_stopper. Expected SWIGTYPE_p_Xapian__QueryParser");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    if(SWIG_ConvertPtr(*args[1], (void **) &arg2, SWIGTYPE_p_Xapian__Stopper, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 2 of QueryParser_set_stopper. Expected SWIGTYPE_p_Xapian__Stopper");
    }
  }
  {
    try {
      (arg1)->set_stopper((Xapian::Stopper const *)arg2);
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_QueryParser_set_stopper__SWIG_1) {
  Xapian::QueryParser *arg1 = (Xapian::QueryParser *) 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_Xapian__QueryParser, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of QueryParser_set_stopper. Expected SWIGTYPE_p_Xapian__QueryParser");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    try {
      (arg1)->set_stopper();
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_QueryParser_set_stopper) {
  int argc;
  zval **argv[2];
  
  argc = ZEND_NUM_ARGS();
  zend_get_parameters_array_ex(argc,argv);
  if (argc == 1) {
    int _v;
    {
      void *tmp;
      _v = (SWIG_ConvertPtr(*argv[0], (void**)&tmp, SWIGTYPE_p_Xapian__QueryParser, 0) >= 0);
    }
    if (_v) {
      _wrap_QueryParser_set_stopper__SWIG_1(INTERNAL_FUNCTION_PARAM_PASSTHRU); return;
    }
  }
  if (argc == 2) {
    int _v;
    {
      void *tmp;
      _v = (SWIG_ConvertPtr(*argv[0], (void**)&tmp, SWIGTYPE_p_Xapian__QueryParser, 0) >= 0);
    }
    if (_v) {
      {
        void *tmp;
        _v = (SWIG_ConvertPtr(*argv[1], (void**)&tmp, SWIGTYPE_p_Xapian__Stopper, 0) >= 0);
      }
      if (_v) {
        _wrap_QueryParser_set_stopper__SWIG_0(INTERNAL_FUNCTION_PARAM_PASSTHRU); return;
      }
    }
  }
  
  SWIG_ErrorCode() = E_ERROR;
  SWIG_ErrorMsg() = "No matching function for overloaded 'QueryParser_set_stopper'";
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_QueryParser_set_default_op) {
  Xapian::QueryParser *arg1 = (Xapian::QueryParser *) 0 ;
  Xapian::Query::op 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_Xapian__QueryParser, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of QueryParser_set_default_op. Expected SWIGTYPE_p_Xapian__QueryParser");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  
  /*@SWIG:/data/home/olly/tmp/xapian-svn-snapshot/tags/1.2.8/xapian/swig/Lib/php/utils.i,7,CONVERT_INT_IN@*/
  convert_to_long_ex(args[1]);
  arg2 = (Xapian::Query::op) Z_LVAL_PP(args[1]);
  /*@SWIG@*/;
  
  {
    try {
      (arg1)->set_default_op(arg2);
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_QueryParser_get_default_op) {
  Xapian::QueryParser *arg1 = (Xapian::QueryParser *) 0 ;
  zval **args[1];
  Xapian::Query::op 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_Xapian__QueryParser, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of QueryParser_get_default_op. Expected SWIGTYPE_p_Xapian__QueryParser");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    try {
      result = (Xapian::Query::op)((Xapian::QueryParser const *)arg1)->get_default_op();
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  {
    ZVAL_LONG(return_value,result);
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_QueryParser_set_database) {
  Xapian::QueryParser *arg1 = (Xapian::QueryParser *) 0 ;
  Xapian::Database *arg2 = 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_Xapian__QueryParser, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of QueryParser_set_database. Expected SWIGTYPE_p_Xapian__QueryParser");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    if (SWIG_ConvertPtr(*args[1], (void**)&arg2, SWIGTYPE_p_Xapian__Database, 0) < 0 || arg2 == NULL) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 2 of QueryParser_set_database. Expected SWIGTYPE_p_Xapian__Database");
    }
  }
  {
    try {
      (arg1)->set_database((Xapian::Database const &)*arg2);
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_QueryParser_set_max_wildcard_expansion) {
  Xapian::QueryParser *arg1 = (Xapian::QueryParser *) 0 ;
  Xapian::termcount 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_Xapian__QueryParser, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of QueryParser_set_max_wildcard_expansion. Expected SWIGTYPE_p_Xapian__QueryParser");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  
  /*@SWIG:/data/home/olly/tmp/xapian-svn-snapshot/tags/1.2.8/xapian/swig/Lib/php/utils.i,7,CONVERT_INT_IN@*/
  convert_to_long_ex(args[1]);
  arg2 = (Xapian::termcount) Z_LVAL_PP(args[1]);
  /*@SWIG@*/;
  
  {
    try {
      (arg1)->set_max_wildcard_expansion(arg2);
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_QueryParser_parse_query__SWIG_0) {
  Xapian::QueryParser *arg1 = (Xapian::QueryParser *) 0 ;
  std::string *arg2 = 0 ;
  unsigned int arg3 ;
  std::string *arg4 = 0 ;
  std::string temp2 ;
  std::string temp4 ;
  zval **args[4];
  Xapian::Query 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_Xapian__QueryParser, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of QueryParser_parse_query. Expected SWIGTYPE_p_Xapian__QueryParser");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  
  convert_to_string_ex(args[1]);
  temp2.assign(Z_STRVAL_PP(args[1]), Z_STRLEN_PP(args[1]));
  arg2 = &temp2;
  
  
  /*@SWIG:/data/home/olly/tmp/xapian-svn-snapshot/tags/1.2.8/xapian/swig/Lib/php/utils.i,7,CONVERT_INT_IN@*/
  convert_to_long_ex(args[2]);
  arg3 = (unsigned int) Z_LVAL_PP(args[2]);
  /*@SWIG@*/;
  
  
  convert_to_string_ex(args[3]);
  temp4.assign(Z_STRVAL_PP(args[3]), Z_STRLEN_PP(args[3]));
  arg4 = &temp4;
  
  {
    try {
      result = (arg1)->parse_query((std::string const &)*arg2,arg3,(std::string const &)*arg4);
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  {
    Xapian::Query * resultobj = new Xapian::Query((const Xapian::Query &) result);
    SWIG_SetPointerZval(return_value, (void *)resultobj, SWIGTYPE_p_Xapian__Query, 1);
  }
  
  
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_QueryParser_parse_query__SWIG_1) {
  Xapian::QueryParser *arg1 = (Xapian::QueryParser *) 0 ;
  std::string *arg2 = 0 ;
  unsigned int arg3 ;
  std::string temp2 ;
  zval **args[3];
  Xapian::Query 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_Xapian__QueryParser, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of QueryParser_parse_query. Expected SWIGTYPE_p_Xapian__QueryParser");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  
  convert_to_string_ex(args[1]);
  temp2.assign(Z_STRVAL_PP(args[1]), Z_STRLEN_PP(args[1]));
  arg2 = &temp2;
  
  
  /*@SWIG:/data/home/olly/tmp/xapian-svn-snapshot/tags/1.2.8/xapian/swig/Lib/php/utils.i,7,CONVERT_INT_IN@*/
  convert_to_long_ex(args[2]);
  arg3 = (unsigned int) Z_LVAL_PP(args[2]);
  /*@SWIG@*/;
  
  {
    try {
      result = (arg1)->parse_query((std::string const &)*arg2,arg3);
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  {
    Xapian::Query * resultobj = new Xapian::Query((const Xapian::Query &) result);
    SWIG_SetPointerZval(return_value, (void *)resultobj, SWIGTYPE_p_Xapian__Query, 1);
  }
  
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_QueryParser_parse_query__SWIG_2) {
  Xapian::QueryParser *arg1 = (Xapian::QueryParser *) 0 ;
  std::string *arg2 = 0 ;
  std::string temp2 ;
  zval **args[2];
  Xapian::Query 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_Xapian__QueryParser, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of QueryParser_parse_query. Expected SWIGTYPE_p_Xapian__QueryParser");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  
  convert_to_string_ex(args[1]);
  temp2.assign(Z_STRVAL_PP(args[1]), Z_STRLEN_PP(args[1]));
  arg2 = &temp2;
  
  {
    try {
      result = (arg1)->parse_query((std::string const &)*arg2);
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  {
    Xapian::Query * resultobj = new Xapian::Query((const Xapian::Query &) result);
    SWIG_SetPointerZval(return_value, (void *)resultobj, SWIGTYPE_p_Xapian__Query, 1);
  }
  
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_QueryParser_parse_query) {
  int argc;
  zval **argv[4];
  
  argc = ZEND_NUM_ARGS();
  zend_get_parameters_array_ex(argc,argv);
  if (argc == 2) {
    int _v;
    {
      void *tmp;
      _v = (SWIG_ConvertPtr(*argv[0], (void**)&tmp, SWIGTYPE_p_Xapian__QueryParser, 0) >= 0);
    }
    if (_v) {
      {
        _v = (Z_TYPE_PP(argv[1]) == IS_STRING);
      }
      if (_v) {
        _wrap_QueryParser_parse_query__SWIG_2(INTERNAL_FUNCTION_PARAM_PASSTHRU); return;
      }
    }
  }
  if (argc == 3) {
    int _v;
    {
      void *tmp;
      _v = (SWIG_ConvertPtr(*argv[0], (void**)&tmp, SWIGTYPE_p_Xapian__QueryParser, 0) >= 0);
    }
    if (_v) {
      {
        _v = (Z_TYPE_PP(argv[1]) == IS_STRING);
      }
      if (_v) {
        _v = (Z_TYPE_PP(argv[2]) == IS_LONG); 
        if (_v) {
          _wrap_QueryParser_parse_query__SWIG_1(INTERNAL_FUNCTION_PARAM_PASSTHRU); return;
        }
      }
    }
  }
  if (argc == 4) {
    int _v;
    {
      void *tmp;
      _v = (SWIG_ConvertPtr(*argv[0], (void**)&tmp, SWIGTYPE_p_Xapian__QueryParser, 0) >= 0);
    }
    if (_v) {
      {
        _v = (Z_TYPE_PP(argv[1]) == IS_STRING);
      }
      if (_v) {
        _v = (Z_TYPE_PP(argv[2]) == IS_LONG); 
        if (_v) {
          {
            _v = (Z_TYPE_PP(argv[3]) == IS_STRING);
          }
          if (_v) {
            _wrap_QueryParser_parse_query__SWIG_0(INTERNAL_FUNCTION_PARAM_PASSTHRU); return;
          }
        }
      }
    }
  }
  
  SWIG_ErrorCode() = E_ERROR;
  SWIG_ErrorMsg() = "No matching function for overloaded 'QueryParser_parse_query'";
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_QueryParser_add_prefix) {
  Xapian::QueryParser *arg1 = (Xapian::QueryParser *) 0 ;
  std::string *arg2 = 0 ;
  std::string *arg3 = 0 ;
  std::string temp2 ;
  std::string temp3 ;
  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_Xapian__QueryParser, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of QueryParser_add_prefix. Expected SWIGTYPE_p_Xapian__QueryParser");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  
  convert_to_string_ex(args[1]);
  temp2.assign(Z_STRVAL_PP(args[1]), Z_STRLEN_PP(args[1]));
  arg2 = &temp2;
  
  
  convert_to_string_ex(args[2]);
  temp3.assign(Z_STRVAL_PP(args[2]), Z_STRLEN_PP(args[2]));
  arg3 = &temp3;
  
  {
    try {
      (arg1)->add_prefix((std::string const &)*arg2,(std::string const &)*arg3);
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  
  
  
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_QueryParser_add_boolean_prefix__SWIG_0) {
  Xapian::QueryParser *arg1 = (Xapian::QueryParser *) 0 ;
  std::string *arg2 = 0 ;
  std::string *arg3 = 0 ;
  bool arg4 ;
  std::string temp2 ;
  std::string temp3 ;
  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_Xapian__QueryParser, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of QueryParser_add_boolean_prefix. Expected SWIGTYPE_p_Xapian__QueryParser");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  
  convert_to_string_ex(args[1]);
  temp2.assign(Z_STRVAL_PP(args[1]), Z_STRLEN_PP(args[1]));
  arg2 = &temp2;
  
  
  convert_to_string_ex(args[2]);
  temp3.assign(Z_STRVAL_PP(args[2]), Z_STRLEN_PP(args[2]));
  arg3 = &temp3;
  
  
  /*@SWIG:/data/home/olly/tmp/xapian-svn-snapshot/tags/1.2.8/xapian/swig/Lib/php/utils.i,2,CONVERT_BOOL_IN@*/
  convert_to_boolean_ex(args[3]);
  arg4 = (bool) Z_LVAL_PP(args[3]);
  /*@SWIG@*/;
  
  {
    try {
      (arg1)->add_boolean_prefix((std::string const &)*arg2,(std::string const &)*arg3,arg4);
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  
  
  
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_QueryParser_add_boolean_prefix__SWIG_1) {
  Xapian::QueryParser *arg1 = (Xapian::QueryParser *) 0 ;
  std::string *arg2 = 0 ;
  std::string *arg3 = 0 ;
  std::string temp2 ;
  std::string temp3 ;
  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_Xapian__QueryParser, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of QueryParser_add_boolean_prefix. Expected SWIGTYPE_p_Xapian__QueryParser");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  
  convert_to_string_ex(args[1]);
  temp2.assign(Z_STRVAL_PP(args[1]), Z_STRLEN_PP(args[1]));
  arg2 = &temp2;
  
  
  convert_to_string_ex(args[2]);
  temp3.assign(Z_STRVAL_PP(args[2]), Z_STRLEN_PP(args[2]));
  arg3 = &temp3;
  
  {
    try {
      (arg1)->add_boolean_prefix((std::string const &)*arg2,(std::string const &)*arg3);
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  
  
  
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_QueryParser_add_boolean_prefix) {
  int argc;
  zval **argv[4];
  
  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_Xapian__QueryParser, 0) >= 0);
    }
    if (_v) {
      {
        _v = (Z_TYPE_PP(argv[1]) == IS_STRING);
      }
      if (_v) {
        {
          _v = (Z_TYPE_PP(argv[2]) == IS_STRING);
        }
        if (_v) {
          _wrap_QueryParser_add_boolean_prefix__SWIG_1(INTERNAL_FUNCTION_PARAM_PASSTHRU); return;
        }
      }
    }
  }
  if (argc == 4) {
    int _v;
    {
      void *tmp;
      _v = (SWIG_ConvertPtr(*argv[0], (void**)&tmp, SWIGTYPE_p_Xapian__QueryParser, 0) >= 0);
    }
    if (_v) {
      {
        _v = (Z_TYPE_PP(argv[1]) == IS_STRING);
      }
      if (_v) {
        {
          _v = (Z_TYPE_PP(argv[2]) == IS_STRING);
        }
        if (_v) {
          {
            _v = (Z_TYPE_PP(argv[3]) == IS_BOOL || Z_TYPE_PP(argv[3]) == IS_LONG);
          }
          if (_v) {
            _wrap_QueryParser_add_boolean_prefix__SWIG_0(INTERNAL_FUNCTION_PARAM_PASSTHRU); return;
          }
        }
      }
    }
  }
  
  SWIG_ErrorCode() = E_ERROR;
  SWIG_ErrorMsg() = "No matching function for overloaded 'QueryParser_add_boolean_prefix'";
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_QueryParser_stoplist_begin) {
  Xapian::QueryParser *arg1 = (Xapian::QueryParser *) 0 ;
  zval **args[1];
  Xapian::TermIterator 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_Xapian__QueryParser, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of QueryParser_stoplist_begin. Expected SWIGTYPE_p_Xapian__QueryParser");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    try {
      result = ((Xapian::QueryParser const *)arg1)->stoplist_begin();
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  {
    Xapian::TermIterator * resultobj = new Xapian::TermIterator((const Xapian::TermIterator &) result);
    SWIG_SetPointerZval(return_value, (void *)resultobj, SWIGTYPE_p_Xapian__TermIterator, 1);
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_QueryParser_stoplist_end) {
  Xapian::QueryParser *arg1 = (Xapian::QueryParser *) 0 ;
  zval **args[1];
  Xapian::TermIterator 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_Xapian__QueryParser, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of QueryParser_stoplist_end. Expected SWIGTYPE_p_Xapian__QueryParser");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    try {
      result = ((Xapian::QueryParser const *)arg1)->stoplist_end();
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  {
    Xapian::TermIterator * resultobj = new Xapian::TermIterator((const Xapian::TermIterator &) result);
    SWIG_SetPointerZval(return_value, (void *)resultobj, SWIGTYPE_p_Xapian__TermIterator, 1);
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_QueryParser_unstem_begin) {
  Xapian::QueryParser *arg1 = (Xapian::QueryParser *) 0 ;
  std::string *arg2 = 0 ;
  std::string temp2 ;
  zval **args[2];
  Xapian::TermIterator 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_Xapian__QueryParser, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of QueryParser_unstem_begin. Expected SWIGTYPE_p_Xapian__QueryParser");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  
  convert_to_string_ex(args[1]);
  temp2.assign(Z_STRVAL_PP(args[1]), Z_STRLEN_PP(args[1]));
  arg2 = &temp2;
  
  {
    try {
      result = ((Xapian::QueryParser const *)arg1)->unstem_begin((std::string const &)*arg2);
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  {
    Xapian::TermIterator * resultobj = new Xapian::TermIterator((const Xapian::TermIterator &) result);
    SWIG_SetPointerZval(return_value, (void *)resultobj, SWIGTYPE_p_Xapian__TermIterator, 1);
  }
  
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_QueryParser_unstem_end) {
  Xapian::QueryParser *arg1 = (Xapian::QueryParser *) 0 ;
  std::string *arg2 = 0 ;
  std::string temp2 ;
  zval **args[2];
  Xapian::TermIterator 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_Xapian__QueryParser, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of QueryParser_unstem_end. Expected SWIGTYPE_p_Xapian__QueryParser");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  
  convert_to_string_ex(args[1]);
  temp2.assign(Z_STRVAL_PP(args[1]), Z_STRLEN_PP(args[1]));
  arg2 = &temp2;
  
  {
    try {
      result = ((Xapian::QueryParser const *)arg1)->unstem_end((std::string const &)*arg2);
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  {
    Xapian::TermIterator * resultobj = new Xapian::TermIterator((const Xapian::TermIterator &) result);
    SWIG_SetPointerZval(return_value, (void *)resultobj, SWIGTYPE_p_Xapian__TermIterator, 1);
  }
  
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_QueryParser_add_valuerangeprocessor) {
  Xapian::QueryParser *arg1 = (Xapian::QueryParser *) 0 ;
  Xapian::ValueRangeProcessor *arg2 = (Xapian::ValueRangeProcessor *) 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_Xapian__QueryParser, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of QueryParser_add_valuerangeprocessor. Expected SWIGTYPE_p_Xapian__QueryParser");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    if(SWIG_ConvertPtr(*args[1], (void **) &arg2, SWIGTYPE_p_Xapian__ValueRangeProcessor, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 2 of QueryParser_add_valuerangeprocessor. Expected SWIGTYPE_p_Xapian__ValueRangeProcessor");
    }
  }
  {
    try {
      (arg1)->add_valuerangeprocessor(arg2);
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_QueryParser_get_corrected_query_string) {
  Xapian::QueryParser *arg1 = (Xapian::QueryParser *) 0 ;
  zval **args[1];
  std::string 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_Xapian__QueryParser, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of QueryParser_get_corrected_query_string. Expected SWIGTYPE_p_Xapian__QueryParser");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    try {
      result = ((Xapian::QueryParser const *)arg1)->get_corrected_query_string();
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  
  ZVAL_STRINGL(return_value, const_cast<char*>((&result)->data()), (&result)->size(), 1);
  
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_QueryParser_get_description) {
  Xapian::QueryParser *arg1 = (Xapian::QueryParser *) 0 ;
  zval **args[1];
  std::string 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_Xapian__QueryParser, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of QueryParser_get_description. Expected SWIGTYPE_p_Xapian__QueryParser");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    try {
      result = ((Xapian::QueryParser const *)arg1)->get_description();
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  
  ZVAL_STRINGL(return_value, const_cast<char*>((&result)->data()), (&result)->size(), 1);
  
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_sortable_serialise) {
  double arg1 ;
  zval **args[1];
  std::string result;
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 1 || zend_get_parameters_array_ex(1, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  
  /*@SWIG:/data/home/olly/tmp/xapian-svn-snapshot/tags/1.2.8/xapian/swig/Lib/php/utils.i,52,CONVERT_FLOAT_IN@*/
  convert_to_double_ex(args[0]);
  arg1 = (double) Z_DVAL_PP(args[0]);
  /*@SWIG@*/;
  
  {
    try {
      result = Xapian::sortable_serialise(arg1);
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  
  ZVAL_STRINGL(return_value, const_cast<char*>((&result)->data()), (&result)->size(), 1);
  
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_sortable_unserialise) {
  std::string *arg1 = 0 ;
  std::string temp1 ;
  zval **args[1];
  double result;
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 1 || zend_get_parameters_array_ex(1, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  
  convert_to_string_ex(args[0]);
  temp1.assign(Z_STRVAL_PP(args[0]), Z_STRLEN_PP(args[0]));
  arg1 = &temp1;
  
  {
    try {
      result = (double)Xapian::sortable_unserialise((std::string const &)*arg1);
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  {
    ZVAL_DOUBLE(return_value,result);
  }
  
  return;
fail:
  zend_error(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_StemImplementation(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 ;
  Xapian::StemImplementation *arg1 = (Xapian::StemImplementation *) 0 ;
  
  efree(value);
  if (! newobject) return; /* can't delete it! */
  arg1 = (Xapian::StemImplementation *)SWIG_ZTS_ConvertResourceData(ptr,type_name,SWIGTYPE_p_Xapian__StemImplementation TSRMLS_CC);
  if (! arg1) zend_error(E_ERROR, "Xapian::StemImplementation resource already free'd");
  {
    try {
      delete arg1;
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_StemImplementation_apply) {
  Xapian::StemImplementation *arg1 = (Xapian::StemImplementation *) 0 ;
  std::string *arg2 = 0 ;
  std::string temp2 ;
  zval **args[2];
  Swig::Director *director = 0;
  bool upcall = false;
  std::string result;
  
  director = dynamic_cast<Swig::Director*>(arg1);
  upcall = !director->swig_is_overridden_method((char *)"XapianStemImplementation", (char *)"operator ()");
  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_Xapian__StemImplementation, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of StemImplementation_apply. Expected SWIGTYPE_p_Xapian__StemImplementation");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  
  convert_to_string_ex(args[1]);
  temp2.assign(Z_STRVAL_PP(args[1]), Z_STRLEN_PP(args[1]));
  arg2 = &temp2;
  
  {
    try {
      if (upcall) {
        Swig::DirectorPureVirtualException::raise("Xapian::StemImplementation::operator ()" TSRMLS_CC);
      } else {
        result = (arg1)->operator ()((std::string const &)*arg2);
      }
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  
  ZVAL_STRINGL(return_value, const_cast<char*>((&result)->data()), (&result)->size(), 1);
  
  
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_StemImplementation_get_description) {
  Xapian::StemImplementation *arg1 = (Xapian::StemImplementation *) 0 ;
  zval **args[1];
  Swig::Director *director = 0;
  bool upcall = false;
  std::string result;
  
  director = dynamic_cast<Swig::Director*>(arg1);
  upcall = !director->swig_is_overridden_method((char *)"XapianStemImplementation", (char *)"get_description");
  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_Xapian__StemImplementation, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of StemImplementation_get_description. Expected SWIGTYPE_p_Xapian__StemImplementation");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    try {
      if (upcall) {
        Swig::DirectorPureVirtualException::raise("Xapian::StemImplementation::get_description" TSRMLS_CC);
      } else {
        result = ((Xapian::StemImplementation const *)arg1)->get_description();
      }
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  
  ZVAL_STRINGL(return_value, const_cast<char*>((&result)->data()), (&result)->size(), 1);
  
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_new_StemImplementation) {
  zval *arg0;
  zval **args[1];
  Xapian::StemImplementation *result = 0 ;
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 1 || zend_get_parameters_array_ex(1, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  arg0 = *args[0];
  
  {
    try {
      if ( arg0->type == IS_NULL ) {
        /* not subclassed */
        SWIG_PHP_Error(E_ERROR, "accessing abstract class or protected constructor");
      } else {
        result = (Xapian::StemImplementation *)new SwigDirector_StemImplementation(arg0 TSRMLS_CC);
      }
      
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  
  SWIG_SetPointerZval(return_value, (void *)result, SWIGTYPE_p_Xapian__StemImplementation, 1);
  
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_new_Stem__SWIG_0) {
  std::string *arg1 = 0 ;
  std::string temp1 ;
  zval **args[1];
  Xapian::Stem *result = 0 ;
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 1 || zend_get_parameters_array_ex(1, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  
  convert_to_string_ex(args[0]);
  temp1.assign(Z_STRVAL_PP(args[0]), Z_STRLEN_PP(args[0]));
  arg1 = &temp1;
  
  {
    try {
      result = (Xapian::Stem *)new Xapian::Stem((std::string const &)*arg1);
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  
  SWIG_SetPointerZval(return_value, (void *)result, SWIGTYPE_p_Xapian__Stem, 1);
  
  
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_new_Stem__SWIG_1) {
  Xapian::StemImplementation *arg1 = (Xapian::StemImplementation *) 0 ;
  zval **args[1];
  Xapian::Stem *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_Xapian__StemImplementation, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of new_Stem. Expected SWIGTYPE_p_Xapian__StemImplementation");
    }
  }
  {
    try {
      result = (Xapian::Stem *)new Xapian::Stem(arg1);
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  
  SWIG_SetPointerZval(return_value, (void *)result, SWIGTYPE_p_Xapian__Stem, 1);
  
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_new_Stem) {
  int argc;
  zval **argv[1];
  
  argc = ZEND_NUM_ARGS();
  zend_get_parameters_array_ex(argc,argv);
  if (argc == 1) {
    int _v;
    {
      void *tmp;
      _v = (SWIG_ConvertPtr(*argv[0], (void**)&tmp, SWIGTYPE_p_Xapian__StemImplementation, 0) >= 0);
    }
    if (_v) {
      _wrap_new_Stem__SWIG_1(INTERNAL_FUNCTION_PARAM_PASSTHRU); return;
    }
  }
  if (argc == 1) {
    int _v;
    {
      _v = (Z_TYPE_PP(argv[0]) == IS_STRING);
    }
    if (_v) {
      _wrap_new_Stem__SWIG_0(INTERNAL_FUNCTION_PARAM_PASSTHRU); return;
    }
  }
  
  SWIG_ErrorCode() = E_ERROR;
  SWIG_ErrorMsg() = "No matching function for overloaded 'new_Stem'";
  zend_error(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_Stem(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 ;
  Xapian::Stem *arg1 = (Xapian::Stem *) 0 ;
  
  efree(value);
  if (! newobject) return; /* can't delete it! */
  arg1 = (Xapian::Stem *)SWIG_ZTS_ConvertResourceData(ptr,type_name,SWIGTYPE_p_Xapian__Stem TSRMLS_CC);
  if (! arg1) zend_error(E_ERROR, "Xapian::Stem resource already free'd");
  {
    try {
      delete arg1;
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_Stem_apply) {
  Xapian::Stem *arg1 = (Xapian::Stem *) 0 ;
  std::string *arg2 = 0 ;
  std::string temp2 ;
  zval **args[2];
  std::string 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_Xapian__Stem, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of Stem_apply. Expected SWIGTYPE_p_Xapian__Stem");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  
  convert_to_string_ex(args[1]);
  temp2.assign(Z_STRVAL_PP(args[1]), Z_STRLEN_PP(args[1]));
  arg2 = &temp2;
  
  {
    try {
      result = ((Xapian::Stem const *)arg1)->operator ()((std::string const &)*arg2);
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  
  ZVAL_STRINGL(return_value, const_cast<char*>((&result)->data()), (&result)->size(), 1);
  
  
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_Stem_get_description) {
  Xapian::Stem *arg1 = (Xapian::Stem *) 0 ;
  zval **args[1];
  std::string 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_Xapian__Stem, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of Stem_get_description. Expected SWIGTYPE_p_Xapian__Stem");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    try {
      result = ((Xapian::Stem const *)arg1)->get_description();
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  
  ZVAL_STRINGL(return_value, const_cast<char*>((&result)->data()), (&result)->size(), 1);
  
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_Stem_get_available_languages) {
  std::string result;
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 0) {
    WRONG_PARAM_COUNT;
  }
  
  {
    try {
      result = Xapian::Stem::get_available_languages();
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  
  ZVAL_STRINGL(return_value, const_cast<char*>((&result)->data()), (&result)->size(), 1);
  
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_new_TermGenerator) {
  Xapian::TermGenerator *result = 0 ;
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 0) {
    WRONG_PARAM_COUNT;
  }
  
  {
    try {
      result = (Xapian::TermGenerator *)new Xapian::TermGenerator();
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  
  SWIG_SetPointerZval(return_value, (void *)result, SWIGTYPE_p_Xapian__TermGenerator, 1);
  
  return;
fail:
  zend_error(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_TermGenerator(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 ;
  Xapian::TermGenerator *arg1 = (Xapian::TermGenerator *) 0 ;
  
  efree(value);
  if (! newobject) return; /* can't delete it! */
  arg1 = (Xapian::TermGenerator *)SWIG_ZTS_ConvertResourceData(ptr,type_name,SWIGTYPE_p_Xapian__TermGenerator TSRMLS_CC);
  if (! arg1) zend_error(E_ERROR, "Xapian::TermGenerator resource already free'd");
  {
    try {
      delete arg1;
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_TermGenerator_set_stemmer) {
  Xapian::TermGenerator *arg1 = (Xapian::TermGenerator *) 0 ;
  Xapian::Stem *arg2 = 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_Xapian__TermGenerator, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of TermGenerator_set_stemmer. Expected SWIGTYPE_p_Xapian__TermGenerator");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    if (SWIG_ConvertPtr(*args[1], (void**)&arg2, SWIGTYPE_p_Xapian__Stem, 0) < 0 || arg2 == NULL) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 2 of TermGenerator_set_stemmer. Expected SWIGTYPE_p_Xapian__Stem");
    }
  }
  {
    try {
      (arg1)->set_stemmer((Xapian::Stem const &)*arg2);
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_TermGenerator_set_stopper__SWIG_0) {
  Xapian::TermGenerator *arg1 = (Xapian::TermGenerator *) 0 ;
  Xapian::Stopper *arg2 = (Xapian::Stopper *) 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_Xapian__TermGenerator, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of TermGenerator_set_stopper. Expected SWIGTYPE_p_Xapian__TermGenerator");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    if(SWIG_ConvertPtr(*args[1], (void **) &arg2, SWIGTYPE_p_Xapian__Stopper, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 2 of TermGenerator_set_stopper. Expected SWIGTYPE_p_Xapian__Stopper");
    }
  }
  {
    try {
      (arg1)->set_stopper((Xapian::Stopper const *)arg2);
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_TermGenerator_set_stopper__SWIG_1) {
  Xapian::TermGenerator *arg1 = (Xapian::TermGenerator *) 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_Xapian__TermGenerator, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of TermGenerator_set_stopper. Expected SWIGTYPE_p_Xapian__TermGenerator");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    try {
      (arg1)->set_stopper();
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_TermGenerator_set_stopper) {
  int argc;
  zval **argv[2];
  
  argc = ZEND_NUM_ARGS();
  zend_get_parameters_array_ex(argc,argv);
  if (argc == 1) {
    int _v;
    {
      void *tmp;
      _v = (SWIG_ConvertPtr(*argv[0], (void**)&tmp, SWIGTYPE_p_Xapian__TermGenerator, 0) >= 0);
    }
    if (_v) {
      _wrap_TermGenerator_set_stopper__SWIG_1(INTERNAL_FUNCTION_PARAM_PASSTHRU); return;
    }
  }
  if (argc == 2) {
    int _v;
    {
      void *tmp;
      _v = (SWIG_ConvertPtr(*argv[0], (void**)&tmp, SWIGTYPE_p_Xapian__TermGenerator, 0) >= 0);
    }
    if (_v) {
      {
        void *tmp;
        _v = (SWIG_ConvertPtr(*argv[1], (void**)&tmp, SWIGTYPE_p_Xapian__Stopper, 0) >= 0);
      }
      if (_v) {
        _wrap_TermGenerator_set_stopper__SWIG_0(INTERNAL_FUNCTION_PARAM_PASSTHRU); return;
      }
    }
  }
  
  SWIG_ErrorCode() = E_ERROR;
  SWIG_ErrorMsg() = "No matching function for overloaded 'TermGenerator_set_stopper'";
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_TermGenerator_set_document) {
  Xapian::TermGenerator *arg1 = (Xapian::TermGenerator *) 0 ;
  Xapian::Document *arg2 = 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_Xapian__TermGenerator, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of TermGenerator_set_document. Expected SWIGTYPE_p_Xapian__TermGenerator");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    if (SWIG_ConvertPtr(*args[1], (void**)&arg2, SWIGTYPE_p_Xapian__Document, 0) < 0 || arg2 == NULL) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 2 of TermGenerator_set_document. Expected SWIGTYPE_p_Xapian__Document");
    }
  }
  {
    try {
      (arg1)->set_document((Xapian::Document const &)*arg2);
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_TermGenerator_get_document) {
  Xapian::TermGenerator *arg1 = (Xapian::TermGenerator *) 0 ;
  zval **args[1];
  Xapian::Document *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_Xapian__TermGenerator, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of TermGenerator_get_document. Expected SWIGTYPE_p_Xapian__TermGenerator");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    try {
      result = (Xapian::Document *) &((Xapian::TermGenerator const *)arg1)->get_document();
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  
  SWIG_SetPointerZval(return_value, (void *)result, SWIGTYPE_p_Xapian__Document, 0);
  
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_TermGenerator_set_database) {
  Xapian::TermGenerator *arg1 = (Xapian::TermGenerator *) 0 ;
  Xapian::WritableDatabase *arg2 = 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_Xapian__TermGenerator, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of TermGenerator_set_database. Expected SWIGTYPE_p_Xapian__TermGenerator");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    if (SWIG_ConvertPtr(*args[1], (void**)&arg2, SWIGTYPE_p_Xapian__WritableDatabase, 0) < 0 || arg2 == NULL) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 2 of TermGenerator_set_database. Expected SWIGTYPE_p_Xapian__WritableDatabase");
    }
  }
  {
    try {
      (arg1)->set_database((Xapian::WritableDatabase const &)*arg2);
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_TermGenerator_set_flags__SWIG_0) {
  Xapian::TermGenerator *arg1 = (Xapian::TermGenerator *) 0 ;
  Xapian::TermGenerator::flags arg2 ;
  Xapian::TermGenerator::flags arg3 ;
  zval **args[3];
  Xapian::TermGenerator::flags 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_Xapian__TermGenerator, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of TermGenerator_set_flags. Expected SWIGTYPE_p_Xapian__TermGenerator");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  
  /*@SWIG:/data/home/olly/tmp/xapian-svn-snapshot/tags/1.2.8/xapian/swig/Lib/php/utils.i,7,CONVERT_INT_IN@*/
  convert_to_long_ex(args[1]);
  arg2 = (Xapian::TermGenerator::flags) Z_LVAL_PP(args[1]);
  /*@SWIG@*/;
  
  
  /*@SWIG:/data/home/olly/tmp/xapian-svn-snapshot/tags/1.2.8/xapian/swig/Lib/php/utils.i,7,CONVERT_INT_IN@*/
  convert_to_long_ex(args[2]);
  arg3 = (Xapian::TermGenerator::flags) Z_LVAL_PP(args[2]);
  /*@SWIG@*/;
  
  {
    try {
      result = (Xapian::TermGenerator::flags)(arg1)->set_flags(arg2,arg3);
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  {
    ZVAL_LONG(return_value,result);
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_TermGenerator_set_flags__SWIG_1) {
  Xapian::TermGenerator *arg1 = (Xapian::TermGenerator *) 0 ;
  Xapian::TermGenerator::flags arg2 ;
  zval **args[2];
  Xapian::TermGenerator::flags 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_Xapian__TermGenerator, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of TermGenerator_set_flags. Expected SWIGTYPE_p_Xapian__TermGenerator");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  
  /*@SWIG:/data/home/olly/tmp/xapian-svn-snapshot/tags/1.2.8/xapian/swig/Lib/php/utils.i,7,CONVERT_INT_IN@*/
  convert_to_long_ex(args[1]);
  arg2 = (Xapian::TermGenerator::flags) Z_LVAL_PP(args[1]);
  /*@SWIG@*/;
  
  {
    try {
      result = (Xapian::TermGenerator::flags)(arg1)->set_flags(arg2);
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  {
    ZVAL_LONG(return_value,result);
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_TermGenerator_set_flags) {
  int argc;
  zval **argv[3];
  
  argc = ZEND_NUM_ARGS();
  zend_get_parameters_array_ex(argc,argv);
  if (argc == 2) {
    int _v;
    {
      void *tmp;
      _v = (SWIG_ConvertPtr(*argv[0], (void**)&tmp, SWIGTYPE_p_Xapian__TermGenerator, 0) >= 0);
    }
    if (_v) {
      _v = (Z_TYPE_PP(argv[1]) == IS_LONG); 
      if (_v) {
        _wrap_TermGenerator_set_flags__SWIG_1(INTERNAL_FUNCTION_PARAM_PASSTHRU); return;
      }
    }
  }
  if (argc == 3) {
    int _v;
    {
      void *tmp;
      _v = (SWIG_ConvertPtr(*argv[0], (void**)&tmp, SWIGTYPE_p_Xapian__TermGenerator, 0) >= 0);
    }
    if (_v) {
      _v = (Z_TYPE_PP(argv[1]) == IS_LONG); 
      if (_v) {
        _v = (Z_TYPE_PP(argv[2]) == IS_LONG); 
        if (_v) {
          _wrap_TermGenerator_set_flags__SWIG_0(INTERNAL_FUNCTION_PARAM_PASSTHRU); return;
        }
      }
    }
  }
  
  SWIG_ErrorCode() = E_ERROR;
  SWIG_ErrorMsg() = "No matching function for overloaded 'TermGenerator_set_flags'";
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_TermGenerator_index_text__SWIG_0) {
  Xapian::TermGenerator *arg1 = (Xapian::TermGenerator *) 0 ;
  std::string *arg2 = 0 ;
  Xapian::termcount arg3 ;
  std::string *arg4 = 0 ;
  std::string temp2 ;
  std::string temp4 ;
  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_Xapian__TermGenerator, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of TermGenerator_index_text. Expected SWIGTYPE_p_Xapian__TermGenerator");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  
  convert_to_string_ex(args[1]);
  temp2.assign(Z_STRVAL_PP(args[1]), Z_STRLEN_PP(args[1]));
  arg2 = &temp2;
  
  
  /*@SWIG:/data/home/olly/tmp/xapian-svn-snapshot/tags/1.2.8/xapian/swig/Lib/php/utils.i,7,CONVERT_INT_IN@*/
  convert_to_long_ex(args[2]);
  arg3 = (Xapian::termcount) Z_LVAL_PP(args[2]);
  /*@SWIG@*/;
  
  
  convert_to_string_ex(args[3]);
  temp4.assign(Z_STRVAL_PP(args[3]), Z_STRLEN_PP(args[3]));
  arg4 = &temp4;
  
  {
    try {
      (arg1)->index_text((std::string const &)*arg2,arg3,(std::string const &)*arg4);
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  
  
  
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_TermGenerator_index_text__SWIG_1) {
  Xapian::TermGenerator *arg1 = (Xapian::TermGenerator *) 0 ;
  std::string *arg2 = 0 ;
  Xapian::termcount arg3 ;
  std::string temp2 ;
  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_Xapian__TermGenerator, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of TermGenerator_index_text. Expected SWIGTYPE_p_Xapian__TermGenerator");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  
  convert_to_string_ex(args[1]);
  temp2.assign(Z_STRVAL_PP(args[1]), Z_STRLEN_PP(args[1]));
  arg2 = &temp2;
  
  
  /*@SWIG:/data/home/olly/tmp/xapian-svn-snapshot/tags/1.2.8/xapian/swig/Lib/php/utils.i,7,CONVERT_INT_IN@*/
  convert_to_long_ex(args[2]);
  arg3 = (Xapian::termcount) Z_LVAL_PP(args[2]);
  /*@SWIG@*/;
  
  {
    try {
      (arg1)->index_text((std::string const &)*arg2,arg3);
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  
  
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_TermGenerator_index_text__SWIG_2) {
  Xapian::TermGenerator *arg1 = (Xapian::TermGenerator *) 0 ;
  std::string *arg2 = 0 ;
  std::string temp2 ;
  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_Xapian__TermGenerator, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of TermGenerator_index_text. Expected SWIGTYPE_p_Xapian__TermGenerator");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  
  convert_to_string_ex(args[1]);
  temp2.assign(Z_STRVAL_PP(args[1]), Z_STRLEN_PP(args[1]));
  arg2 = &temp2;
  
  {
    try {
      (arg1)->index_text((std::string const &)*arg2);
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  
  
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_TermGenerator_index_text) {
  int argc;
  zval **argv[4];
  
  argc = ZEND_NUM_ARGS();
  zend_get_parameters_array_ex(argc,argv);
  if (argc == 2) {
    int _v;
    {
      void *tmp;
      _v = (SWIG_ConvertPtr(*argv[0], (void**)&tmp, SWIGTYPE_p_Xapian__TermGenerator, 0) >= 0);
    }
    if (_v) {
      {
        _v = (Z_TYPE_PP(argv[1]) == IS_STRING);
      }
      if (_v) {
        _wrap_TermGenerator_index_text__SWIG_2(INTERNAL_FUNCTION_PARAM_PASSTHRU); return;
      }
    }
  }
  if (argc == 3) {
    int _v;
    {
      void *tmp;
      _v = (SWIG_ConvertPtr(*argv[0], (void**)&tmp, SWIGTYPE_p_Xapian__TermGenerator, 0) >= 0);
    }
    if (_v) {
      {
        _v = (Z_TYPE_PP(argv[1]) == IS_STRING);
      }
      if (_v) {
        _v = (Z_TYPE_PP(argv[2]) == IS_LONG); 
        if (_v) {
          _wrap_TermGenerator_index_text__SWIG_1(INTERNAL_FUNCTION_PARAM_PASSTHRU); return;
        }
      }
    }
  }
  if (argc == 4) {
    int _v;
    {
      void *tmp;
      _v = (SWIG_ConvertPtr(*argv[0], (void**)&tmp, SWIGTYPE_p_Xapian__TermGenerator, 0) >= 0);
    }
    if (_v) {
      {
        _v = (Z_TYPE_PP(argv[1]) == IS_STRING);
      }
      if (_v) {
        _v = (Z_TYPE_PP(argv[2]) == IS_LONG); 
        if (_v) {
          {
            _v = (Z_TYPE_PP(argv[3]) == IS_STRING);
          }
          if (_v) {
            _wrap_TermGenerator_index_text__SWIG_0(INTERNAL_FUNCTION_PARAM_PASSTHRU); return;
          }
        }
      }
    }
  }
  
  SWIG_ErrorCode() = E_ERROR;
  SWIG_ErrorMsg() = "No matching function for overloaded 'TermGenerator_index_text'";
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_TermGenerator_index_text_without_positions__SWIG_0) {
  Xapian::TermGenerator *arg1 = (Xapian::TermGenerator *) 0 ;
  std::string *arg2 = 0 ;
  Xapian::termcount arg3 ;
  std::string *arg4 = 0 ;
  std::string temp2 ;
  std::string temp4 ;
  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_Xapian__TermGenerator, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of TermGenerator_index_text_without_positions. Expected SWIGTYPE_p_Xapian__TermGenerator");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  
  convert_to_string_ex(args[1]);
  temp2.assign(Z_STRVAL_PP(args[1]), Z_STRLEN_PP(args[1]));
  arg2 = &temp2;
  
  
  /*@SWIG:/data/home/olly/tmp/xapian-svn-snapshot/tags/1.2.8/xapian/swig/Lib/php/utils.i,7,CONVERT_INT_IN@*/
  convert_to_long_ex(args[2]);
  arg3 = (Xapian::termcount) Z_LVAL_PP(args[2]);
  /*@SWIG@*/;
  
  
  convert_to_string_ex(args[3]);
  temp4.assign(Z_STRVAL_PP(args[3]), Z_STRLEN_PP(args[3]));
  arg4 = &temp4;
  
  {
    try {
      (arg1)->index_text_without_positions((std::string const &)*arg2,arg3,(std::string const &)*arg4);
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  
  
  
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_TermGenerator_index_text_without_positions__SWIG_1) {
  Xapian::TermGenerator *arg1 = (Xapian::TermGenerator *) 0 ;
  std::string *arg2 = 0 ;
  Xapian::termcount arg3 ;
  std::string temp2 ;
  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_Xapian__TermGenerator, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of TermGenerator_index_text_without_positions. Expected SWIGTYPE_p_Xapian__TermGenerator");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  
  convert_to_string_ex(args[1]);
  temp2.assign(Z_STRVAL_PP(args[1]), Z_STRLEN_PP(args[1]));
  arg2 = &temp2;
  
  
  /*@SWIG:/data/home/olly/tmp/xapian-svn-snapshot/tags/1.2.8/xapian/swig/Lib/php/utils.i,7,CONVERT_INT_IN@*/
  convert_to_long_ex(args[2]);
  arg3 = (Xapian::termcount) Z_LVAL_PP(args[2]);
  /*@SWIG@*/;
  
  {
    try {
      (arg1)->index_text_without_positions((std::string const &)*arg2,arg3);
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  
  
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_TermGenerator_index_text_without_positions__SWIG_2) {
  Xapian::TermGenerator *arg1 = (Xapian::TermGenerator *) 0 ;
  std::string *arg2 = 0 ;
  std::string temp2 ;
  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_Xapian__TermGenerator, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of TermGenerator_index_text_without_positions. Expected SWIGTYPE_p_Xapian__TermGenerator");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  
  convert_to_string_ex(args[1]);
  temp2.assign(Z_STRVAL_PP(args[1]), Z_STRLEN_PP(args[1]));
  arg2 = &temp2;
  
  {
    try {
      (arg1)->index_text_without_positions((std::string const &)*arg2);
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  
  
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_TermGenerator_index_text_without_positions) {
  int argc;
  zval **argv[4];
  
  argc = ZEND_NUM_ARGS();
  zend_get_parameters_array_ex(argc,argv);
  if (argc == 2) {
    int _v;
    {
      void *tmp;
      _v = (SWIG_ConvertPtr(*argv[0], (void**)&tmp, SWIGTYPE_p_Xapian__TermGenerator, 0) >= 0);
    }
    if (_v) {
      {
        _v = (Z_TYPE_PP(argv[1]) == IS_STRING);
      }
      if (_v) {
        _wrap_TermGenerator_index_text_without_positions__SWIG_2(INTERNAL_FUNCTION_PARAM_PASSTHRU); return;
      }
    }
  }
  if (argc == 3) {
    int _v;
    {
      void *tmp;
      _v = (SWIG_ConvertPtr(*argv[0], (void**)&tmp, SWIGTYPE_p_Xapian__TermGenerator, 0) >= 0);
    }
    if (_v) {
      {
        _v = (Z_TYPE_PP(argv[1]) == IS_STRING);
      }
      if (_v) {
        _v = (Z_TYPE_PP(argv[2]) == IS_LONG); 
        if (_v) {
          _wrap_TermGenerator_index_text_without_positions__SWIG_1(INTERNAL_FUNCTION_PARAM_PASSTHRU); return;
        }
      }
    }
  }
  if (argc == 4) {
    int _v;
    {
      void *tmp;
      _v = (SWIG_ConvertPtr(*argv[0], (void**)&tmp, SWIGTYPE_p_Xapian__TermGenerator, 0) >= 0);
    }
    if (_v) {
      {
        _v = (Z_TYPE_PP(argv[1]) == IS_STRING);
      }
      if (_v) {
        _v = (Z_TYPE_PP(argv[2]) == IS_LONG); 
        if (_v) {
          {
            _v = (Z_TYPE_PP(argv[3]) == IS_STRING);
          }
          if (_v) {
            _wrap_TermGenerator_index_text_without_positions__SWIG_0(INTERNAL_FUNCTION_PARAM_PASSTHRU); return;
          }
        }
      }
    }
  }
  
  SWIG_ErrorCode() = E_ERROR;
  SWIG_ErrorMsg() = "No matching function for overloaded 'TermGenerator_index_text_without_positions'";
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_TermGenerator_increase_termpos__SWIG_0) {
  Xapian::TermGenerator *arg1 = (Xapian::TermGenerator *) 0 ;
  Xapian::termcount 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_Xapian__TermGenerator, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of TermGenerator_increase_termpos. Expected SWIGTYPE_p_Xapian__TermGenerator");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  
  /*@SWIG:/data/home/olly/tmp/xapian-svn-snapshot/tags/1.2.8/xapian/swig/Lib/php/utils.i,7,CONVERT_INT_IN@*/
  convert_to_long_ex(args[1]);
  arg2 = (Xapian::termcount) Z_LVAL_PP(args[1]);
  /*@SWIG@*/;
  
  {
    try {
      (arg1)->increase_termpos(arg2);
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_TermGenerator_increase_termpos__SWIG_1) {
  Xapian::TermGenerator *arg1 = (Xapian::TermGenerator *) 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_Xapian__TermGenerator, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of TermGenerator_increase_termpos. Expected SWIGTYPE_p_Xapian__TermGenerator");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    try {
      (arg1)->increase_termpos();
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_TermGenerator_increase_termpos) {
  int argc;
  zval **argv[2];
  
  argc = ZEND_NUM_ARGS();
  zend_get_parameters_array_ex(argc,argv);
  if (argc == 1) {
    int _v;
    {
      void *tmp;
      _v = (SWIG_ConvertPtr(*argv[0], (void**)&tmp, SWIGTYPE_p_Xapian__TermGenerator, 0) >= 0);
    }
    if (_v) {
      _wrap_TermGenerator_increase_termpos__SWIG_1(INTERNAL_FUNCTION_PARAM_PASSTHRU); return;
    }
  }
  if (argc == 2) {
    int _v;
    {
      void *tmp;
      _v = (SWIG_ConvertPtr(*argv[0], (void**)&tmp, SWIGTYPE_p_Xapian__TermGenerator, 0) >= 0);
    }
    if (_v) {
      _v = (Z_TYPE_PP(argv[1]) == IS_LONG); 
      if (_v) {
        _wrap_TermGenerator_increase_termpos__SWIG_0(INTERNAL_FUNCTION_PARAM_PASSTHRU); return;
      }
    }
  }
  
  SWIG_ErrorCode() = E_ERROR;
  SWIG_ErrorMsg() = "No matching function for overloaded 'TermGenerator_increase_termpos'";
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_TermGenerator_get_termpos) {
  Xapian::TermGenerator *arg1 = (Xapian::TermGenerator *) 0 ;
  zval **args[1];
  Xapian::termcount 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_Xapian__TermGenerator, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of TermGenerator_get_termpos. Expected SWIGTYPE_p_Xapian__TermGenerator");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    try {
      result = (Xapian::termcount)((Xapian::TermGenerator const *)arg1)->get_termpos();
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  {
    ZVAL_LONG(return_value,result);
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_TermGenerator_set_termpos) {
  Xapian::TermGenerator *arg1 = (Xapian::TermGenerator *) 0 ;
  Xapian::termcount 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_Xapian__TermGenerator, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of TermGenerator_set_termpos. Expected SWIGTYPE_p_Xapian__TermGenerator");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  
  /*@SWIG:/data/home/olly/tmp/xapian-svn-snapshot/tags/1.2.8/xapian/swig/Lib/php/utils.i,7,CONVERT_INT_IN@*/
  convert_to_long_ex(args[1]);
  arg2 = (Xapian::termcount) Z_LVAL_PP(args[1]);
  /*@SWIG@*/;
  
  {
    try {
      (arg1)->set_termpos(arg2);
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_TermGenerator_get_description) {
  Xapian::TermGenerator *arg1 = (Xapian::TermGenerator *) 0 ;
  zval **args[1];
  std::string 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_Xapian__TermGenerator, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of TermGenerator_get_description. Expected SWIGTYPE_p_Xapian__TermGenerator");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    try {
      result = ((Xapian::TermGenerator const *)arg1)->get_description();
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  
  ZVAL_STRINGL(return_value, const_cast<char*>((&result)->data()), (&result)->size(), 1);
  
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_KeyMaker_apply) {
  Xapian::KeyMaker *arg1 = (Xapian::KeyMaker *) 0 ;
  Xapian::Document *arg2 = 0 ;
  zval **args[2];
  Swig::Director *director = 0;
  bool upcall = false;
  std::string result;
  
  director = dynamic_cast<Swig::Director*>(arg1);
  upcall = !director->swig_is_overridden_method((char *)"XapianKeyMaker", (char *)"operator ()");
  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_Xapian__KeyMaker, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of KeyMaker_apply. Expected SWIGTYPE_p_Xapian__KeyMaker");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    if (SWIG_ConvertPtr(*args[1], (void**)&arg2, SWIGTYPE_p_Xapian__Document, 0) < 0 || arg2 == NULL) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 2 of KeyMaker_apply. Expected SWIGTYPE_p_Xapian__Document");
    }
  }
  {
    try {
      if (upcall) {
        Swig::DirectorPureVirtualException::raise("Xapian::KeyMaker::operator ()" TSRMLS_CC);
      } else {
        result = ((Xapian::KeyMaker const *)arg1)->operator ()((Xapian::Document const &)*arg2);
      }
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  
  ZVAL_STRINGL(return_value, const_cast<char*>((&result)->data()), (&result)->size(), 1);
  
  return;
fail:
  zend_error(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_KeyMaker(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 ;
  Xapian::KeyMaker *arg1 = (Xapian::KeyMaker *) 0 ;
  
  efree(value);
  if (! newobject) return; /* can't delete it! */
  arg1 = (Xapian::KeyMaker *)SWIG_ZTS_ConvertResourceData(ptr,type_name,SWIGTYPE_p_Xapian__KeyMaker TSRMLS_CC);
  if (! arg1) zend_error(E_ERROR, "Xapian::KeyMaker resource already free'd");
  {
    try {
      delete arg1;
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_new_KeyMaker) {
  zval *arg0;
  zval **args[1];
  Xapian::KeyMaker *result = 0 ;
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 1 || zend_get_parameters_array_ex(1, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  arg0 = *args[0];
  
  {
    try {
      if ( arg0->type == IS_NULL ) {
        /* not subclassed */
        SWIG_PHP_Error(E_ERROR, "accessing abstract class or protected constructor");
      } else {
        result = (Xapian::KeyMaker *)new SwigDirector_KeyMaker(arg0 TSRMLS_CC);
      }
      
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  
  SWIG_SetPointerZval(return_value, (void *)result, SWIGTYPE_p_Xapian__KeyMaker, 1);
  
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_new_MultiValueKeyMaker) {
  Xapian::MultiValueKeyMaker *result = 0 ;
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 0) {
    WRONG_PARAM_COUNT;
  }
  
  {
    try {
      result = (Xapian::MultiValueKeyMaker *)new Xapian::MultiValueKeyMaker();
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  
  SWIG_SetPointerZval(return_value, (void *)result, SWIGTYPE_p_Xapian__MultiValueKeyMaker, 1);
  
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_MultiValueKeyMaker_apply) {
  Xapian::MultiValueKeyMaker *arg1 = (Xapian::MultiValueKeyMaker *) 0 ;
  Xapian::Document *arg2 = 0 ;
  zval **args[2];
  std::string 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_Xapian__MultiValueKeyMaker, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of MultiValueKeyMaker_apply. Expected SWIGTYPE_p_Xapian__MultiValueKeyMaker");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    if (SWIG_ConvertPtr(*args[1], (void**)&arg2, SWIGTYPE_p_Xapian__Document, 0) < 0 || arg2 == NULL) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 2 of MultiValueKeyMaker_apply. Expected SWIGTYPE_p_Xapian__Document");
    }
  }
  {
    try {
      result = ((Xapian::MultiValueKeyMaker const *)arg1)->operator ()((Xapian::Document const &)*arg2);
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  
  ZVAL_STRINGL(return_value, const_cast<char*>((&result)->data()), (&result)->size(), 1);
  
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_MultiValueKeyMaker_add_value__SWIG_0) {
  Xapian::MultiValueKeyMaker *arg1 = (Xapian::MultiValueKeyMaker *) 0 ;
  Xapian::valueno arg2 ;
  bool arg3 ;
  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_Xapian__MultiValueKeyMaker, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of MultiValueKeyMaker_add_value. Expected SWIGTYPE_p_Xapian__MultiValueKeyMaker");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  
  /*@SWIG:/data/home/olly/tmp/xapian-svn-snapshot/tags/1.2.8/xapian/swig/Lib/php/utils.i,7,CONVERT_INT_IN@*/
  convert_to_long_ex(args[1]);
  arg2 = (Xapian::valueno) Z_LVAL_PP(args[1]);
  /*@SWIG@*/;
  
  
  /*@SWIG:/data/home/olly/tmp/xapian-svn-snapshot/tags/1.2.8/xapian/swig/Lib/php/utils.i,2,CONVERT_BOOL_IN@*/
  convert_to_boolean_ex(args[2]);
  arg3 = (bool) Z_LVAL_PP(args[2]);
  /*@SWIG@*/;
  
  {
    try {
      (arg1)->add_value(arg2,arg3);
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_MultiValueKeyMaker_add_value__SWIG_1) {
  Xapian::MultiValueKeyMaker *arg1 = (Xapian::MultiValueKeyMaker *) 0 ;
  Xapian::valueno 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_Xapian__MultiValueKeyMaker, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of MultiValueKeyMaker_add_value. Expected SWIGTYPE_p_Xapian__MultiValueKeyMaker");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  
  /*@SWIG:/data/home/olly/tmp/xapian-svn-snapshot/tags/1.2.8/xapian/swig/Lib/php/utils.i,7,CONVERT_INT_IN@*/
  convert_to_long_ex(args[1]);
  arg2 = (Xapian::valueno) Z_LVAL_PP(args[1]);
  /*@SWIG@*/;
  
  {
    try {
      (arg1)->add_value(arg2);
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_MultiValueKeyMaker_add_value) {
  int argc;
  zval **argv[3];
  
  argc = ZEND_NUM_ARGS();
  zend_get_parameters_array_ex(argc,argv);
  if (argc == 2) {
    int _v;
    {
      void *tmp;
      _v = (SWIG_ConvertPtr(*argv[0], (void**)&tmp, SWIGTYPE_p_Xapian__MultiValueKeyMaker, 0) >= 0);
    }
    if (_v) {
      _v = (Z_TYPE_PP(argv[1]) == IS_LONG); 
      if (_v) {
        _wrap_MultiValueKeyMaker_add_value__SWIG_1(INTERNAL_FUNCTION_PARAM_PASSTHRU); return;
      }
    }
  }
  if (argc == 3) {
    int _v;
    {
      void *tmp;
      _v = (SWIG_ConvertPtr(*argv[0], (void**)&tmp, SWIGTYPE_p_Xapian__MultiValueKeyMaker, 0) >= 0);
    }
    if (_v) {
      _v = (Z_TYPE_PP(argv[1]) == IS_LONG); 
      if (_v) {
        {
          _v = (Z_TYPE_PP(argv[2]) == IS_BOOL || Z_TYPE_PP(argv[2]) == IS_LONG);
        }
        if (_v) {
          _wrap_MultiValueKeyMaker_add_value__SWIG_0(INTERNAL_FUNCTION_PARAM_PASSTHRU); return;
        }
      }
    }
  }
  
  SWIG_ErrorCode() = E_ERROR;
  SWIG_ErrorMsg() = "No matching function for overloaded 'MultiValueKeyMaker_add_value'";
  zend_error(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_MultiValueKeyMaker(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 ;
  Xapian::MultiValueKeyMaker *arg1 = (Xapian::MultiValueKeyMaker *) 0 ;
  
  efree(value);
  if (! newobject) return; /* can't delete it! */
  arg1 = (Xapian::MultiValueKeyMaker *)SWIG_ZTS_ConvertResourceData(ptr,type_name,SWIGTYPE_p_Xapian__MultiValueKeyMaker TSRMLS_CC);
  if (! arg1) zend_error(E_ERROR, "Xapian::MultiValueKeyMaker resource already free'd");
  {
    try {
      delete arg1;
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  return;
fail:
  zend_error(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_Sorter(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 ;
  Xapian::Sorter *arg1 = (Xapian::Sorter *) 0 ;
  
  efree(value);
  if (! newobject) return; /* can't delete it! */
  arg1 = (Xapian::Sorter *)SWIG_ZTS_ConvertResourceData(ptr,type_name,SWIGTYPE_p_Xapian__Sorter TSRMLS_CC);
  if (! arg1) zend_error(E_ERROR, "Xapian::Sorter resource already free'd");
  {
    try {
      delete arg1;
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_new_MultiValueSorter) {
  Xapian::MultiValueSorter *result = 0 ;
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 0) {
    WRONG_PARAM_COUNT;
  }
  
  {
    try {
      result = (Xapian::MultiValueSorter *)new Xapian::MultiValueSorter();
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  
  SWIG_SetPointerZval(return_value, (void *)result, SWIGTYPE_p_Xapian__MultiValueSorter, 1);
  
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_MultiValueSorter_apply) {
  Xapian::MultiValueSorter *arg1 = (Xapian::MultiValueSorter *) 0 ;
  Xapian::Document *arg2 = 0 ;
  zval **args[2];
  std::string 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_Xapian__MultiValueSorter, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of MultiValueSorter_apply. Expected SWIGTYPE_p_Xapian__MultiValueSorter");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    if (SWIG_ConvertPtr(*args[1], (void**)&arg2, SWIGTYPE_p_Xapian__Document, 0) < 0 || arg2 == NULL) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 2 of MultiValueSorter_apply. Expected SWIGTYPE_p_Xapian__Document");
    }
  }
  {
    try {
      result = ((Xapian::MultiValueSorter const *)arg1)->operator ()((Xapian::Document const &)*arg2);
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  
  ZVAL_STRINGL(return_value, const_cast<char*>((&result)->data()), (&result)->size(), 1);
  
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_MultiValueSorter_add__SWIG_0) {
  Xapian::MultiValueSorter *arg1 = (Xapian::MultiValueSorter *) 0 ;
  Xapian::valueno arg2 ;
  bool arg3 ;
  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_Xapian__MultiValueSorter, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of MultiValueSorter_add. Expected SWIGTYPE_p_Xapian__MultiValueSorter");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  
  /*@SWIG:/data/home/olly/tmp/xapian-svn-snapshot/tags/1.2.8/xapian/swig/Lib/php/utils.i,7,CONVERT_INT_IN@*/
  convert_to_long_ex(args[1]);
  arg2 = (Xapian::valueno) Z_LVAL_PP(args[1]);
  /*@SWIG@*/;
  
  
  /*@SWIG:/data/home/olly/tmp/xapian-svn-snapshot/tags/1.2.8/xapian/swig/Lib/php/utils.i,2,CONVERT_BOOL_IN@*/
  convert_to_boolean_ex(args[2]);
  arg3 = (bool) Z_LVAL_PP(args[2]);
  /*@SWIG@*/;
  
  {
    try {
      (arg1)->add(arg2,arg3);
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_MultiValueSorter_add__SWIG_1) {
  Xapian::MultiValueSorter *arg1 = (Xapian::MultiValueSorter *) 0 ;
  Xapian::valueno 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_Xapian__MultiValueSorter, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of MultiValueSorter_add. Expected SWIGTYPE_p_Xapian__MultiValueSorter");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  
  /*@SWIG:/data/home/olly/tmp/xapian-svn-snapshot/tags/1.2.8/xapian/swig/Lib/php/utils.i,7,CONVERT_INT_IN@*/
  convert_to_long_ex(args[1]);
  arg2 = (Xapian::valueno) Z_LVAL_PP(args[1]);
  /*@SWIG@*/;
  
  {
    try {
      (arg1)->add(arg2);
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_MultiValueSorter_add) {
  int argc;
  zval **argv[3];
  
  argc = ZEND_NUM_ARGS();
  zend_get_parameters_array_ex(argc,argv);
  if (argc == 2) {
    int _v;
    {
      void *tmp;
      _v = (SWIG_ConvertPtr(*argv[0], (void**)&tmp, SWIGTYPE_p_Xapian__MultiValueSorter, 0) >= 0);
    }
    if (_v) {
      _v = (Z_TYPE_PP(argv[1]) == IS_LONG); 
      if (_v) {
        _wrap_MultiValueSorter_add__SWIG_1(INTERNAL_FUNCTION_PARAM_PASSTHRU); return;
      }
    }
  }
  if (argc == 3) {
    int _v;
    {
      void *tmp;
      _v = (SWIG_ConvertPtr(*argv[0], (void**)&tmp, SWIGTYPE_p_Xapian__MultiValueSorter, 0) >= 0);
    }
    if (_v) {
      _v = (Z_TYPE_PP(argv[1]) == IS_LONG); 
      if (_v) {
        {
          _v = (Z_TYPE_PP(argv[2]) == IS_BOOL || Z_TYPE_PP(argv[2]) == IS_LONG);
        }
        if (_v) {
          _wrap_MultiValueSorter_add__SWIG_0(INTERNAL_FUNCTION_PARAM_PASSTHRU); return;
        }
      }
    }
  }
  
  SWIG_ErrorCode() = E_ERROR;
  SWIG_ErrorMsg() = "No matching function for overloaded 'MultiValueSorter_add'";
  zend_error(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_MultiValueSorter(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 ;
  Xapian::MultiValueSorter *arg1 = (Xapian::MultiValueSorter *) 0 ;
  
  efree(value);
  if (! newobject) return; /* can't delete it! */
  arg1 = (Xapian::MultiValueSorter *)SWIG_ZTS_ConvertResourceData(ptr,type_name,SWIGTYPE_p_Xapian__MultiValueSorter TSRMLS_CC);
  if (! arg1) zend_error(E_ERROR, "Xapian::MultiValueSorter resource already free'd");
  {
    try {
      delete arg1;
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_new_ValueSetMatchDecider) {
  Xapian::valueno arg1 ;
  bool arg2 ;
  zval **args[2];
  Xapian::ValueSetMatchDecider *result = 0 ;
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 2 || zend_get_parameters_array_ex(2, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  
  /*@SWIG:/data/home/olly/tmp/xapian-svn-snapshot/tags/1.2.8/xapian/swig/Lib/php/utils.i,7,CONVERT_INT_IN@*/
  convert_to_long_ex(args[0]);
  arg1 = (Xapian::valueno) Z_LVAL_PP(args[0]);
  /*@SWIG@*/;
  
  
  /*@SWIG:/data/home/olly/tmp/xapian-svn-snapshot/tags/1.2.8/xapian/swig/Lib/php/utils.i,2,CONVERT_BOOL_IN@*/
  convert_to_boolean_ex(args[1]);
  arg2 = (bool) Z_LVAL_PP(args[1]);
  /*@SWIG@*/;
  
  {
    try {
      result = (Xapian::ValueSetMatchDecider *)new Xapian::ValueSetMatchDecider(arg1,arg2);
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  
  SWIG_SetPointerZval(return_value, (void *)result, SWIGTYPE_p_Xapian__ValueSetMatchDecider, 1);
  
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_ValueSetMatchDecider_add_value) {
  Xapian::ValueSetMatchDecider *arg1 = (Xapian::ValueSetMatchDecider *) 0 ;
  std::string *arg2 = 0 ;
  std::string temp2 ;
  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_Xapian__ValueSetMatchDecider, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of ValueSetMatchDecider_add_value. Expected SWIGTYPE_p_Xapian__ValueSetMatchDecider");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  
  convert_to_string_ex(args[1]);
  temp2.assign(Z_STRVAL_PP(args[1]), Z_STRLEN_PP(args[1]));
  arg2 = &temp2;
  
  {
    try {
      (arg1)->add_value((std::string const &)*arg2);
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  
  
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_ValueSetMatchDecider_remove_value) {
  Xapian::ValueSetMatchDecider *arg1 = (Xapian::ValueSetMatchDecider *) 0 ;
  std::string *arg2 = 0 ;
  std::string temp2 ;
  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_Xapian__ValueSetMatchDecider, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of ValueSetMatchDecider_remove_value. Expected SWIGTYPE_p_Xapian__ValueSetMatchDecider");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  
  convert_to_string_ex(args[1]);
  temp2.assign(Z_STRVAL_PP(args[1]), Z_STRLEN_PP(args[1]));
  arg2 = &temp2;
  
  {
    try {
      (arg1)->remove_value((std::string const &)*arg2);
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  
  
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_ValueSetMatchDecider_apply) {
  Xapian::ValueSetMatchDecider *arg1 = (Xapian::ValueSetMatchDecider *) 0 ;
  Xapian::Document *arg2 = 0 ;
  zval **args[2];
  bool 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_Xapian__ValueSetMatchDecider, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of ValueSetMatchDecider_apply. Expected SWIGTYPE_p_Xapian__ValueSetMatchDecider");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    if (SWIG_ConvertPtr(*args[1], (void**)&arg2, SWIGTYPE_p_Xapian__Document, 0) < 0 || arg2 == NULL) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 2 of ValueSetMatchDecider_apply. Expected SWIGTYPE_p_Xapian__Document");
    }
  }
  {
    try {
      result = (bool)((Xapian::ValueSetMatchDecider const *)arg1)->operator ()((Xapian::Document const &)*arg2);
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  {
    ZVAL_BOOL(return_value,(result)?1:0);
  }
  return;
fail:
  zend_error(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_ValueSetMatchDecider(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 ;
  Xapian::ValueSetMatchDecider *arg1 = (Xapian::ValueSetMatchDecider *) 0 ;
  
  efree(value);
  if (! newobject) return; /* can't delete it! */
  arg1 = (Xapian::ValueSetMatchDecider *)SWIG_ZTS_ConvertResourceData(ptr,type_name,SWIGTYPE_p_Xapian__ValueSetMatchDecider TSRMLS_CC);
  if (! arg1) zend_error(E_ERROR, "Xapian::ValueSetMatchDecider resource already free'd");
  {
    try {
      delete arg1;
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_new_Compactor) {
  zval *arg0;
  zval **args[1];
  Xapian::Compactor *result = 0 ;
  
  SWIG_ResetError();
  if(ZEND_NUM_ARGS() != 1 || zend_get_parameters_array_ex(1, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  arg0 = *args[0];
  
  {
    try {
      if ( arg0->type == IS_NULL ) {
        /* not subclassed */
        result = (Xapian::Compactor *)new Xapian::Compactor();
      } else {
        result = (Xapian::Compactor *)new SwigDirector_Compactor(arg0 TSRMLS_CC);
      }
      
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  
  SWIG_SetPointerZval(return_value, (void *)result, SWIGTYPE_p_Xapian__Compactor, 1);
  
  return;
fail:
  zend_error(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_Compactor(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 ;
  Xapian::Compactor *arg1 = (Xapian::Compactor *) 0 ;
  
  efree(value);
  if (! newobject) return; /* can't delete it! */
  arg1 = (Xapian::Compactor *)SWIG_ZTS_ConvertResourceData(ptr,type_name,SWIGTYPE_p_Xapian__Compactor TSRMLS_CC);
  if (! arg1) zend_error(E_ERROR, "Xapian::Compactor resource already free'd");
  {
    try {
      delete arg1;
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_Compactor_set_block_size) {
  Xapian::Compactor *arg1 = (Xapian::Compactor *) 0 ;
  size_t 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_Xapian__Compactor, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of Compactor_set_block_size. Expected SWIGTYPE_p_Xapian__Compactor");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  
  /*@SWIG:/data/home/olly/tmp/xapian-svn-snapshot/tags/1.2.8/xapian/swig/Lib/php/utils.i,7,CONVERT_INT_IN@*/
  convert_to_long_ex(args[1]);
  arg2 = (size_t) Z_LVAL_PP(args[1]);
  /*@SWIG@*/;
  
  {
    try {
      (arg1)->set_block_size(arg2);
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_Compactor_set_renumber) {
  Xapian::Compactor *arg1 = (Xapian::Compactor *) 0 ;
  bool 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_Xapian__Compactor, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of Compactor_set_renumber. Expected SWIGTYPE_p_Xapian__Compactor");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  
  /*@SWIG:/data/home/olly/tmp/xapian-svn-snapshot/tags/1.2.8/xapian/swig/Lib/php/utils.i,2,CONVERT_BOOL_IN@*/
  convert_to_boolean_ex(args[1]);
  arg2 = (bool) Z_LVAL_PP(args[1]);
  /*@SWIG@*/;
  
  {
    try {
      (arg1)->set_renumber(arg2);
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_Compactor_set_multipass) {
  Xapian::Compactor *arg1 = (Xapian::Compactor *) 0 ;
  bool 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_Xapian__Compactor, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of Compactor_set_multipass. Expected SWIGTYPE_p_Xapian__Compactor");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  
  /*@SWIG:/data/home/olly/tmp/xapian-svn-snapshot/tags/1.2.8/xapian/swig/Lib/php/utils.i,2,CONVERT_BOOL_IN@*/
  convert_to_boolean_ex(args[1]);
  arg2 = (bool) Z_LVAL_PP(args[1]);
  /*@SWIG@*/;
  
  {
    try {
      (arg1)->set_multipass(arg2);
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_Compactor_set_compaction_level) {
  Xapian::Compactor *arg1 = (Xapian::Compactor *) 0 ;
  Xapian::Compactor::compaction_level 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_Xapian__Compactor, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of Compactor_set_compaction_level. Expected SWIGTYPE_p_Xapian__Compactor");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  
  /*@SWIG:/data/home/olly/tmp/xapian-svn-snapshot/tags/1.2.8/xapian/swig/Lib/php/utils.i,7,CONVERT_INT_IN@*/
  convert_to_long_ex(args[1]);
  arg2 = (Xapian::Compactor::compaction_level) Z_LVAL_PP(args[1]);
  /*@SWIG@*/;
  
  {
    try {
      (arg1)->set_compaction_level(arg2);
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_Compactor_set_destdir) {
  Xapian::Compactor *arg1 = (Xapian::Compactor *) 0 ;
  std::string *arg2 = 0 ;
  std::string temp2 ;
  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_Xapian__Compactor, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of Compactor_set_destdir. Expected SWIGTYPE_p_Xapian__Compactor");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  
  convert_to_string_ex(args[1]);
  temp2.assign(Z_STRVAL_PP(args[1]), Z_STRLEN_PP(args[1]));
  arg2 = &temp2;
  
  {
    try {
      (arg1)->set_destdir((std::string const &)*arg2);
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  
  
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_Compactor_add_source) {
  Xapian::Compactor *arg1 = (Xapian::Compactor *) 0 ;
  std::string *arg2 = 0 ;
  std::string temp2 ;
  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_Xapian__Compactor, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of Compactor_add_source. Expected SWIGTYPE_p_Xapian__Compactor");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  
  convert_to_string_ex(args[1]);
  temp2.assign(Z_STRVAL_PP(args[1]), Z_STRLEN_PP(args[1]));
  arg2 = &temp2;
  
  {
    try {
      (arg1)->add_source((std::string const &)*arg2);
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  
  
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_Compactor_compact) {
  Xapian::Compactor *arg1 = (Xapian::Compactor *) 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_Xapian__Compactor, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of Compactor_compact. Expected SWIGTYPE_p_Xapian__Compactor");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    try {
      (arg1)->compact();
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_Compactor_set_status) {
  Xapian::Compactor *arg1 = (Xapian::Compactor *) 0 ;
  std::string *arg2 = 0 ;
  std::string *arg3 = 0 ;
  std::string temp2 ;
  std::string temp3 ;
  zval **args[3];
  Swig::Director *director = 0;
  bool upcall = false;
  
  director = dynamic_cast<Swig::Director*>(arg1);
  upcall = !director->swig_is_overridden_method((char *)"XapianCompactor", (char *)"set_status");
  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_Xapian__Compactor, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of Compactor_set_status. Expected SWIGTYPE_p_Xapian__Compactor");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  
  convert_to_string_ex(args[1]);
  temp2.assign(Z_STRVAL_PP(args[1]), Z_STRLEN_PP(args[1]));
  arg2 = &temp2;
  
  
  convert_to_string_ex(args[2]);
  temp3.assign(Z_STRVAL_PP(args[2]), Z_STRLEN_PP(args[2]));
  arg3 = &temp3;
  
  {
    try {
      if (upcall) {
        (arg1)->Xapian::Compactor::set_status((std::string const &)*arg2,(std::string const &)*arg3);
      } else {
        (arg1)->set_status((std::string const &)*arg2,(std::string const &)*arg3);
      }
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  
  
  
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_Compactor_resolve_duplicate_metadata) {
  Xapian::Compactor *arg1 = (Xapian::Compactor *) 0 ;
  std::string *arg2 = 0 ;
  size_t arg3 ;
  std::string *arg4 ;
  std::string temp2 ;
  zval **args[4];
  Swig::Director *director = 0;
  bool upcall = false;
  std::string result;
  
  director = dynamic_cast<Swig::Director*>(arg1);
  upcall = !director->swig_is_overridden_method((char *)"XapianCompactor", (char *)"resolve_duplicate_metadata");
  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_Xapian__Compactor, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of Compactor_resolve_duplicate_metadata. Expected SWIGTYPE_p_Xapian__Compactor");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  
  convert_to_string_ex(args[1]);
  temp2.assign(Z_STRVAL_PP(args[1]), Z_STRLEN_PP(args[1]));
  arg2 = &temp2;
  
  
  /*@SWIG:/data/home/olly/tmp/xapian-svn-snapshot/tags/1.2.8/xapian/swig/Lib/php/utils.i,7,CONVERT_INT_IN@*/
  convert_to_long_ex(args[2]);
  arg3 = (size_t) Z_LVAL_PP(args[2]);
  /*@SWIG@*/;
  
  {
    if(SWIG_ConvertPtr(*args[3], (void **) &arg4, SWIGTYPE_p_std__string, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 4 of Compactor_resolve_duplicate_metadata. Expected SWIGTYPE_p_std__string");
    }
  }
  {
    try {
      if (upcall) {
        result = (arg1)->Xapian::Compactor::resolve_duplicate_metadata((std::string const &)*arg2,arg3,(std::string const (*))arg4);
      } else {
        result = (arg1)->resolve_duplicate_metadata((std::string const &)*arg2,arg3,(std::string const (*))arg4);
      }
    } catch (...) {
      XapianExceptionHandler();
      return;
    }
  }
  
  ZVAL_STRINGL(return_value, const_cast<char*>((&result)->data()), (&result)->size(), 1);
  
  
  return;
fail:
  zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());
}


static ZEND_RSRC_DTOR_FUNC(_wrap_destroy_p_Xapian__RSet) {
  __wrap_delete_RSet(rsrc, SWIGTYPE_p_Xapian__RSet->name TSRMLS_CC);
}
static ZEND_RSRC_DTOR_FUNC(_wrap_destroy_p_Xapian__Registry) {
  __wrap_delete_Registry(rsrc, SWIGTYPE_p_Xapian__Registry->name TSRMLS_CC);
}
static ZEND_RSRC_DTOR_FUNC(_wrap_destroy_p_Xapian__Compactor) {
  __wrap_delete_Compactor(rsrc, SWIGTYPE_p_Xapian__Compactor->name TSRMLS_CC);
}
static ZEND_RSRC_DTOR_FUNC(_wrap_destroy_p_Xapian__KeyMaker) {
  __wrap_delete_KeyMaker(rsrc, SWIGTYPE_p_Xapian__KeyMaker->name TSRMLS_CC);
}
static ZEND_RSRC_DTOR_FUNC(_wrap_destroy_p_Xapian__MultiValueKeyMaker) {
  __wrap_delete_MultiValueKeyMaker(rsrc, SWIGTYPE_p_Xapian__MultiValueKeyMaker->name TSRMLS_CC);
}
static ZEND_RSRC_DTOR_FUNC(_wrap_destroy_p_Xapian__Sorter) {
  __wrap_delete_Sorter(rsrc, SWIGTYPE_p_Xapian__Sorter->name TSRMLS_CC);
}
static ZEND_RSRC_DTOR_FUNC(_wrap_destroy_p_Xapian__Document) {
  __wrap_delete_Document(rsrc, SWIGTYPE_p_Xapian__Document->name TSRMLS_CC);
}
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_stem_strategy) {
  /* No destructor for simple type _p_stem_strategy */
  efree(rsrc->ptr);
}
static ZEND_RSRC_DTOR_FUNC(_wrap_destroy_p_Xapian__MultiValueSorter) {
  __wrap_delete_MultiValueSorter(rsrc, SWIGTYPE_p_Xapian__MultiValueSorter->name TSRMLS_CC);
}
static ZEND_RSRC_DTOR_FUNC(_wrap_destroy_int) {
  /* No destructor for simple type _int */
  efree(rsrc->ptr);
}
static ZEND_RSRC_DTOR_FUNC(_wrap_destroy_p_Xapian__Enquire) {
  __wrap_delete_Enquire(rsrc, SWIGTYPE_p_Xapian__Enquire->name TSRMLS_CC);
}
static ZEND_RSRC_DTOR_FUNC(_wrap_destroy_p_Xapian__ESetIterator) {
  __wrap_delete_ESetIterator(rsrc, SWIGTYPE_p_Xapian__ESetIterator->name TSRMLS_CC);
}
static ZEND_RSRC_DTOR_FUNC(_wrap_destroy_p_Xapian__MSetIterator) {
  __wrap_delete_MSetIterator(rsrc, SWIGTYPE_p_Xapian__MSetIterator->name TSRMLS_CC);
}
static ZEND_RSRC_DTOR_FUNC(_wrap_destroy_p_Xapian__ValueIterator) {
  __wrap_delete_ValueIterator(rsrc, SWIGTYPE_p_Xapian__ValueIterator->name TSRMLS_CC);
}
static ZEND_RSRC_DTOR_FUNC(_wrap_destroy_p_Xapian__TermIterator) {
  __wrap_delete_TermIterator(rsrc, SWIGTYPE_p_Xapian__TermIterator->name TSRMLS_CC);
}
static ZEND_RSRC_DTOR_FUNC(_wrap_destroy_p_Xapian__PostingIterator) {
  __wrap_delete_PostingIterator(rsrc, SWIGTYPE_p_Xapian__PostingIterator->name TSRMLS_CC);
}
static ZEND_RSRC_DTOR_FUNC(_wrap_destroy_p_Xapian__PositionIterator) {
  __wrap_delete_PositionIterator(rsrc, SWIGTYPE_p_Xapian__PositionIterator->name TSRMLS_CC);
}
static ZEND_RSRC_DTOR_FUNC(_wrap_destroy_p_Xapian__TermGenerator) {
  __wrap_delete_TermGenerator(rsrc, SWIGTYPE_p_Xapian__TermGenerator->name TSRMLS_CC);
}
static ZEND_RSRC_DTOR_FUNC(_wrap_destroy_p_unsigned_int) {
  /* No destructor for simple type _p_unsigned_int */
  efree(rsrc->ptr);
}
static ZEND_RSRC_DTOR_FUNC(_wrap_destroy_p_Xapian__BoolWeight) {
  __wrap_delete_BoolWeight(rsrc, SWIGTYPE_p_Xapian__BoolWeight->name TSRMLS_CC);
}
static ZEND_RSRC_DTOR_FUNC(_wrap_destroy_p_Xapian__TradWeight) {
  __wrap_delete_TradWeight(rsrc, SWIGTYPE_p_Xapian__TradWeight->name TSRMLS_CC);
}
static ZEND_RSRC_DTOR_FUNC(_wrap_destroy_p_std__string) {
  /* No destructor for simple type _p_std__string */
  efree(rsrc->ptr);
}
static ZEND_RSRC_DTOR_FUNC(_wrap_destroy_p_Xapian__QueryParser) {
  __wrap_delete_QueryParser(rsrc, SWIGTYPE_p_Xapian__QueryParser->name TSRMLS_CC);
}
static ZEND_RSRC_DTOR_FUNC(_wrap_destroy_p_Xapian__Query) {
  __wrap_delete_Query(rsrc, SWIGTYPE_p_Xapian__Query->name TSRMLS_CC);
}
static ZEND_RSRC_DTOR_FUNC(_wrap_destroy_p_Xapian__Stopper) {
  __wrap_delete_Stopper(rsrc, SWIGTYPE_p_Xapian__Stopper->name TSRMLS_CC);
}
static ZEND_RSRC_DTOR_FUNC(_wrap_destroy_p_Xapian__SimpleStopper) {
  __wrap_delete_SimpleStopper(rsrc, SWIGTYPE_p_Xapian__SimpleStopper->name TSRMLS_CC);
}
static ZEND_RSRC_DTOR_FUNC(_wrap_destroy_p_Xapian__ExpandDecider) {
  __wrap_delete_ExpandDecider(rsrc, SWIGTYPE_p_Xapian__ExpandDecider->name TSRMLS_CC);
}
static ZEND_RSRC_DTOR_FUNC(_wrap_destroy_p_Xapian__MatchDecider) {
  __wrap_delete_MatchDecider(rsrc, SWIGTYPE_p_Xapian__MatchDecider->name TSRMLS_CC);
}
static ZEND_RSRC_DTOR_FUNC(_wrap_destroy_p_op) {
  /* No destructor for simple type _p_op */
  efree(rsrc->ptr);
}
static ZEND_RSRC_DTOR_FUNC(_wrap_destroy_p_Xapian__ValueSetMatchDecider) {
  __wrap_delete_ValueSetMatchDecider(rsrc, SWIGTYPE_p_Xapian__ValueSetMatchDecider->name TSRMLS_CC);
}
static ZEND_RSRC_DTOR_FUNC(_wrap_destroy_p_docid_order) {
  /* No destructor for simple type _p_docid_order */
  efree(rsrc->ptr);
}
static ZEND_RSRC_DTOR_FUNC(_wrap_destroy_p_Xapian__StemImplementation) {
  __wrap_delete_StemImplementation(rsrc, SWIGTYPE_p_Xapian__StemImplementation->name TSRMLS_CC);
}
static ZEND_RSRC_DTOR_FUNC(_wrap_destroy_p_Xapian__FixedWeightPostingSource) {
  __wrap_delete_FixedWeightPostingSource(rsrc, SWIGTYPE_p_Xapian__FixedWeightPostingSource->name TSRMLS_CC);
}
static ZEND_RSRC_DTOR_FUNC(_wrap_destroy_p_Xapian__ValueMapPostingSource) {
  __wrap_delete_ValueMapPostingSource(rsrc, SWIGTYPE_p_Xapian__ValueMapPostingSource->name TSRMLS_CC);
}
static ZEND_RSRC_DTOR_FUNC(_wrap_destroy_p_Xapian__DecreasingValueWeightPostingSource) {
  __wrap_delete_DecreasingValueWeightPostingSource(rsrc, SWIGTYPE_p_Xapian__DecreasingValueWeightPostingSource->name TSRMLS_CC);
}
static ZEND_RSRC_DTOR_FUNC(_wrap_destroy_p_Xapian__PostingSource) {
  __wrap_delete_PostingSource(rsrc, SWIGTYPE_p_Xapian__PostingSource->name TSRMLS_CC);
}
static ZEND_RSRC_DTOR_FUNC(_wrap_destroy_p_Xapian__ValuePostingSource) {
  __wrap_delete_ValuePostingSource(rsrc, SWIGTYPE_p_Xapian__ValuePostingSource->name TSRMLS_CC);
}
static ZEND_RSRC_DTOR_FUNC(_wrap_destroy_p_Xapian__ValueWeightPostingSource) {
  __wrap_delete_ValueWeightPostingSource(rsrc, SWIGTYPE_p_Xapian__ValueWeightPostingSource->name TSRMLS_CC);
}
static ZEND_RSRC_DTOR_FUNC(_wrap_destroy_p_Xapian__Weight) {
  __wrap_delete_Weight(rsrc, SWIGTYPE_p_Xapian__Weight->name TSRMLS_CC);
}
static ZEND_RSRC_DTOR_FUNC(_wrap_destroy_p_Xapian__BM25Weight) {
  __wrap_delete_BM25Weight(rsrc, SWIGTYPE_p_Xapian__BM25Weight->name TSRMLS_CC);
}
static ZEND_RSRC_DTOR_FUNC(_wrap_destroy_p_Xapian__Stem) {
  __wrap_delete_Stem(rsrc, SWIGTYPE_p_Xapian__Stem->name TSRMLS_CC);
}
static ZEND_RSRC_DTOR_FUNC(_wrap_destroy_p_feature_flag) {
  /* No destructor for simple type _p_feature_flag */
  efree(rsrc->ptr);
}
static ZEND_RSRC_DTOR_FUNC(_wrap_destroy_p_compaction_level) {
  /* No destructor for simple type _p_compaction_level */
  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_Xapian__MSet) {
  __wrap_delete_MSet(rsrc, SWIGTYPE_p_Xapian__MSet->name TSRMLS_CC);
}
static ZEND_RSRC_DTOR_FUNC(_wrap_destroy_p_Xapian__ESet) {
  __wrap_delete_ESet(rsrc, SWIGTYPE_p_Xapian__ESet->name TSRMLS_CC);
}
static ZEND_RSRC_DTOR_FUNC(_wrap_destroy_p_Xapian__Database) {
  __wrap_delete_Database(rsrc, SWIGTYPE_p_Xapian__Database->name TSRMLS_CC);
}
static ZEND_RSRC_DTOR_FUNC(_wrap_destroy_p_Xapian__MatchSpy) {
  __wrap_delete_MatchSpy(rsrc, SWIGTYPE_p_Xapian__MatchSpy->name TSRMLS_CC);
}
static ZEND_RSRC_DTOR_FUNC(_wrap_destroy_p_Xapian__ValueRangeProcessor) {
  __wrap_delete_ValueRangeProcessor(rsrc, SWIGTYPE_p_Xapian__ValueRangeProcessor->name TSRMLS_CC);
}
static ZEND_RSRC_DTOR_FUNC(_wrap_destroy_p_Xapian__StringValueRangeProcessor) {
  __wrap_delete_StringValueRangeProcessor(rsrc, SWIGTYPE_p_Xapian__StringValueRangeProcessor->name TSRMLS_CC);
}
static ZEND_RSRC_DTOR_FUNC(_wrap_destroy_p_Xapian__ValueCountMatchSpy) {
  __wrap_delete_ValueCountMatchSpy(rsrc, SWIGTYPE_p_Xapian__ValueCountMatchSpy->name TSRMLS_CC);
}
static ZEND_RSRC_DTOR_FUNC(_wrap_destroy_p_Xapian__WritableDatabase) {
  __wrap_delete_WritableDatabase(rsrc, SWIGTYPE_p_Xapian__WritableDatabase->name TSRMLS_CC);
}
static ZEND_RSRC_DTOR_FUNC(_wrap_destroy_p_Xapian__DateValueRangeProcessor) {
  __wrap_delete_DateValueRangeProcessor(rsrc, SWIGTYPE_p_Xapian__DateValueRangeProcessor->name TSRMLS_CC);
}
static ZEND_RSRC_DTOR_FUNC(_wrap_destroy_p_Xapian__NumberValueRangeProcessor) {
  __wrap_delete_NumberValueRangeProcessor(rsrc, SWIGTYPE_p_Xapian__NumberValueRangeProcessor->name TSRMLS_CC);
}
/* end wrapper section */
/* class entry subsection */


/* entry subsection */
/* Every non-class user visible function must have an entry here */
static zend_function_entry xapian_functions[] = {
 SWIG_ZEND_NAMED_FE(bad_valueno_get,_wrap_BAD_VALUENO_get,NULL)
 SWIG_ZEND_NAMED_FE(version_string,_wrap_version_string,NULL)
 SWIG_ZEND_NAMED_FE(major_version,_wrap_major_version,NULL)
 SWIG_ZEND_NAMED_FE(minor_version,_wrap_minor_version,NULL)
 SWIG_ZEND_NAMED_FE(revision,_wrap_revision,NULL)
 SWIG_ZEND_NAMED_FE(new_positioniterator,_wrap_new_PositionIterator,NULL)
 SWIG_ZEND_NAMED_FE(positioniterator_get_termpos,_wrap_PositionIterator_get_termpos,NULL)
 SWIG_ZEND_NAMED_FE(positioniterator_next,_wrap_PositionIterator_next,NULL)
 SWIG_ZEND_NAMED_FE(positioniterator_equals,_wrap_PositionIterator_equals,NULL)
 SWIG_ZEND_NAMED_FE(positioniterator_skip_to,_wrap_PositionIterator_skip_to,NULL)
 SWIG_ZEND_NAMED_FE(positioniterator_get_description,_wrap_PositionIterator_get_description,NULL)
 SWIG_ZEND_NAMED_FE(new_postingiterator,_wrap_new_PostingIterator,NULL)
 SWIG_ZEND_NAMED_FE(postingiterator_skip_to,_wrap_PostingIterator_skip_to,NULL)
 SWIG_ZEND_NAMED_FE(postingiterator_get_doclength,_wrap_PostingIterator_get_doclength,NULL)
 SWIG_ZEND_NAMED_FE(postingiterator_get_wdf,_wrap_PostingIterator_get_wdf,NULL)
 SWIG_ZEND_NAMED_FE(postingiterator_positionlist_begin,_wrap_PostingIterator_positionlist_begin,NULL)
 SWIG_ZEND_NAMED_FE(postingiterator_positionlist_end,_wrap_PostingIterator_positionlist_end,NULL)
 SWIG_ZEND_NAMED_FE(postingiterator_get_description,_wrap_PostingIterator_get_description,NULL)
 SWIG_ZEND_NAMED_FE(postingiterator_get_docid,_wrap_PostingIterator_get_docid,NULL)
 SWIG_ZEND_NAMED_FE(postingiterator_next,_wrap_PostingIterator_next,NULL)
 SWIG_ZEND_NAMED_FE(postingiterator_equals,_wrap_PostingIterator_equals,NULL)
 SWIG_ZEND_NAMED_FE(new_termiterator,_wrap_new_TermIterator,NULL)
 SWIG_ZEND_NAMED_FE(termiterator_get_term,_wrap_TermIterator_get_term,NULL)
 SWIG_ZEND_NAMED_FE(termiterator_next,_wrap_TermIterator_next,NULL)
 SWIG_ZEND_NAMED_FE(termiterator_equals,_wrap_TermIterator_equals,NULL)
 SWIG_ZEND_NAMED_FE(termiterator_skip_to,_wrap_TermIterator_skip_to,NULL)
 SWIG_ZEND_NAMED_FE(termiterator_get_wdf,_wrap_TermIterator_get_wdf,NULL)
 SWIG_ZEND_NAMED_FE(termiterator_get_termfreq,_wrap_TermIterator_get_termfreq,NULL)
 SWIG_ZEND_NAMED_FE(termiterator_positionlist_count,_wrap_TermIterator_positionlist_count,NULL)
 SWIG_ZEND_NAMED_FE(termiterator_positionlist_begin,_wrap_TermIterator_positionlist_begin,NULL)
 SWIG_ZEND_NAMED_FE(termiterator_positionlist_end,_wrap_TermIterator_positionlist_end,NULL)
 SWIG_ZEND_NAMED_FE(termiterator_get_description,_wrap_TermIterator_get_description,NULL)
 SWIG_ZEND_NAMED_FE(new_valueiterator,_wrap_new_ValueIterator,NULL)
 SWIG_ZEND_NAMED_FE(valueiterator_get_value,_wrap_ValueIterator_get_value,NULL)
 SWIG_ZEND_NAMED_FE(valueiterator_next,_wrap_ValueIterator_next,NULL)
 SWIG_ZEND_NAMED_FE(valueiterator_equals,_wrap_ValueIterator_equals,NULL)
 SWIG_ZEND_NAMED_FE(valueiterator_get_docid,_wrap_ValueIterator_get_docid,NULL)
 SWIG_ZEND_NAMED_FE(valueiterator_get_valueno,_wrap_ValueIterator_get_valueno,NULL)
 SWIG_ZEND_NAMED_FE(valueiterator_skip_to,_wrap_ValueIterator_skip_to,NULL)
 SWIG_ZEND_NAMED_FE(valueiterator_check,_wrap_ValueIterator_check,NULL)
 SWIG_ZEND_NAMED_FE(valueiterator_get_description,_wrap_ValueIterator_get_description,NULL)
 SWIG_ZEND_NAMED_FE(new_document,_wrap_new_Document,NULL)
 SWIG_ZEND_NAMED_FE(document_get_value,_wrap_Document_get_value,NULL)
 SWIG_ZEND_NAMED_FE(document_add_value,_wrap_Document_add_value,NULL)
 SWIG_ZEND_NAMED_FE(document_remove_value,_wrap_Document_remove_value,NULL)
 SWIG_ZEND_NAMED_FE(document_clear_values,_wrap_Document_clear_values,NULL)
 SWIG_ZEND_NAMED_FE(document_get_data,_wrap_Document_get_data,NULL)
 SWIG_ZEND_NAMED_FE(document_set_data,_wrap_Document_set_data,NULL)
 SWIG_ZEND_NAMED_FE(document_add_posting,_wrap_Document_add_posting,NULL)
 SWIG_ZEND_NAMED_FE(document_add_term,_wrap_Document_add_term,NULL)
 SWIG_ZEND_NAMED_FE(document_add_boolean_term,_wrap_Document_add_boolean_term,NULL)
 SWIG_ZEND_NAMED_FE(document_remove_posting,_wrap_Document_remove_posting,NULL)
 SWIG_ZEND_NAMED_FE(document_remove_term,_wrap_Document_remove_term,NULL)
 SWIG_ZEND_NAMED_FE(document_clear_terms,_wrap_Document_clear_terms,NULL)
 SWIG_ZEND_NAMED_FE(document_termlist_count,_wrap_Document_termlist_count,NULL)
 SWIG_ZEND_NAMED_FE(document_termlist_begin,_wrap_Document_termlist_begin,NULL)
 SWIG_ZEND_NAMED_FE(document_termlist_end,_wrap_Document_termlist_end,NULL)
 SWIG_ZEND_NAMED_FE(document_values_count,_wrap_Document_values_count,NULL)
 SWIG_ZEND_NAMED_FE(document_values_begin,_wrap_Document_values_begin,NULL)
 SWIG_ZEND_NAMED_FE(document_values_end,_wrap_Document_values_end,NULL)
 SWIG_ZEND_NAMED_FE(document_get_docid,_wrap_Document_get_docid,NULL)
 SWIG_ZEND_NAMED_FE(document_serialise,_wrap_Document_serialise,NULL)
 SWIG_ZEND_NAMED_FE(document_unserialise,_wrap_Document_unserialise,NULL)
 SWIG_ZEND_NAMED_FE(document_get_description,_wrap_Document_get_description,NULL)
 SWIG_ZEND_NAMED_FE(new_postingsource,_wrap_new_PostingSource,NULL)
 SWIG_ZEND_NAMED_FE(postingsource_get_termfreq_min,_wrap_PostingSource_get_termfreq_min,NULL)
 SWIG_ZEND_NAMED_FE(postingsource_get_termfreq_est,_wrap_PostingSource_get_termfreq_est,NULL)
 SWIG_ZEND_NAMED_FE(postingsource_get_termfreq_max,_wrap_PostingSource_get_termfreq_max,NULL)
 SWIG_ZEND_NAMED_FE(postingsource_get_maxweight,_wrap_PostingSource_get_maxweight,NULL)
 SWIG_ZEND_NAMED_FE(postingsource_get_weight,_wrap_PostingSource_get_weight,NULL)
 SWIG_ZEND_NAMED_FE(postingsource_get_docid,_wrap_PostingSource_get_docid,NULL)
 SWIG_ZEND_NAMED_FE(postingsource_next,_wrap_PostingSource_next,NULL)
 SWIG_ZEND_NAMED_FE(postingsource_skip_to,_wrap_PostingSource_skip_to,NULL)
 SWIG_ZEND_NAMED_FE(postingsource_check,_wrap_PostingSource_check,NULL)
 SWIG_ZEND_NAMED_FE(postingsource_at_end,_wrap_PostingSource_at_end,NULL)
 SWIG_ZEND_NAMED_FE(postingsource_name,_wrap_PostingSource_name,NULL)
 SWIG_ZEND_NAMED_FE(postingsource_init,_wrap_PostingSource_init,NULL)
 SWIG_ZEND_NAMED_FE(postingsource_get_description,_wrap_PostingSource_get_description,NULL)
 SWIG_ZEND_NAMED_FE(new_valuepostingsource,_wrap_new_ValuePostingSource,NULL)
 SWIG_ZEND_NAMED_FE(valuepostingsource_get_termfreq_min,_wrap_ValuePostingSource_get_termfreq_min,NULL)
 SWIG_ZEND_NAMED_FE(valuepostingsource_get_termfreq_est,_wrap_ValuePostingSource_get_termfreq_est,NULL)
 SWIG_ZEND_NAMED_FE(valuepostingsource_get_termfreq_max,_wrap_ValuePostingSource_get_termfreq_max,NULL)
 SWIG_ZEND_NAMED_FE(valuepostingsource_next,_wrap_ValuePostingSource_next,NULL)
 SWIG_ZEND_NAMED_FE(valuepostingsource_skip_to,_wrap_ValuePostingSource_skip_to,NULL)
 SWIG_ZEND_NAMED_FE(valuepostingsource_check,_wrap_ValuePostingSource_check,NULL)
 SWIG_ZEND_NAMED_FE(valuepostingsource_at_end,_wrap_ValuePostingSource_at_end,NULL)
 SWIG_ZEND_NAMED_FE(valuepostingsource_get_docid,_wrap_ValuePostingSource_get_docid,NULL)
 SWIG_ZEND_NAMED_FE(valuepostingsource_init,_wrap_ValuePostingSource_init,NULL)
 SWIG_ZEND_NAMED_FE(new_valueweightpostingsource,_wrap_new_ValueWeightPostingSource,NULL)
 SWIG_ZEND_NAMED_FE(valueweightpostingsource_get_weight,_wrap_ValueWeightPostingSource_get_weight,NULL)
 SWIG_ZEND_NAMED_FE(valueweightpostingsource_name,_wrap_ValueWeightPostingSource_name,NULL)
 SWIG_ZEND_NAMED_FE(valueweightpostingsource_init,_wrap_ValueWeightPostingSource_init,NULL)
 SWIG_ZEND_NAMED_FE(valueweightpostingsource_get_description,_wrap_ValueWeightPostingSource_get_description,NULL)
 SWIG_ZEND_NAMED_FE(new_decreasingvalueweightpostingsource,_wrap_new_DecreasingValueWeightPostingSource,NULL)
 SWIG_ZEND_NAMED_FE(decreasingvalueweightpostingsource_get_weight,_wrap_DecreasingValueWeightPostingSource_get_weight,NULL)
 SWIG_ZEND_NAMED_FE(decreasingvalueweightpostingsource_name,_wrap_DecreasingValueWeightPostingSource_name,NULL)
 SWIG_ZEND_NAMED_FE(decreasingvalueweightpostingsource_init,_wrap_DecreasingValueWeightPostingSource_init,NULL)
 SWIG_ZEND_NAMED_FE(decreasingvalueweightpostingsource_next,_wrap_DecreasingValueWeightPostingSource_next,NULL)
 SWIG_ZEND_NAMED_FE(decreasingvalueweightpostingsource_skip_to,_wrap_DecreasingValueWeightPostingSource_skip_to,NULL)
 SWIG_ZEND_NAMED_FE(decreasingvalueweightpostingsource_check,_wrap_DecreasingValueWeightPostingSource_check,NULL)
 SWIG_ZEND_NAMED_FE(decreasingvalueweightpostingsource_get_description,_wrap_DecreasingValueWeightPostingSource_get_description,NULL)
 SWIG_ZEND_NAMED_FE(new_valuemappostingsource,_wrap_new_ValueMapPostingSource,NULL)
 SWIG_ZEND_NAMED_FE(valuemappostingsource_add_mapping,_wrap_ValueMapPostingSource_add_mapping,NULL)
 SWIG_ZEND_NAMED_FE(valuemappostingsource_clear_mappings,_wrap_ValueMapPostingSource_clear_mappings,NULL)
 SWIG_ZEND_NAMED_FE(valuemappostingsource_set_default_weight,_wrap_ValueMapPostingSource_set_default_weight,NULL)
 SWIG_ZEND_NAMED_FE(valuemappostingsource_get_weight,_wrap_ValueMapPostingSource_get_weight,NULL)
 SWIG_ZEND_NAMED_FE(valuemappostingsource_name,_wrap_ValueMapPostingSource_name,NULL)
 SWIG_ZEND_NAMED_FE(valuemappostingsource_init,_wrap_ValueMapPostingSource_init,NULL)
 SWIG_ZEND_NAMED_FE(valuemappostingsource_get_description,_wrap_ValueMapPostingSource_get_description,NULL)
 SWIG_ZEND_NAMED_FE(new_fixedweightpostingsource,_wrap_new_FixedWeightPostingSource,NULL)
 SWIG_ZEND_NAMED_FE(fixedweightpostingsource_get_termfreq_min,_wrap_FixedWeightPostingSource_get_termfreq_min,NULL)
 SWIG_ZEND_NAMED_FE(fixedweightpostingsource_get_termfreq_est,_wrap_FixedWeightPostingSource_get_termfreq_est,NULL)
 SWIG_ZEND_NAMED_FE(fixedweightpostingsource_get_termfreq_max,_wrap_FixedWeightPostingSource_get_termfreq_max,NULL)
 SWIG_ZEND_NAMED_FE(fixedweightpostingsource_get_weight,_wrap_FixedWeightPostingSource_get_weight,NULL)
 SWIG_ZEND_NAMED_FE(fixedweightpostingsource_next,_wrap_FixedWeightPostingSource_next,NULL)
 SWIG_ZEND_NAMED_FE(fixedweightpostingsource_skip_to,_wrap_FixedWeightPostingSource_skip_to,NULL)
 SWIG_ZEND_NAMED_FE(fixedweightpostingsource_check,_wrap_FixedWeightPostingSource_check,NULL)
 SWIG_ZEND_NAMED_FE(fixedweightpostingsource_at_end,_wrap_FixedWeightPostingSource_at_end,NULL)
 SWIG_ZEND_NAMED_FE(fixedweightpostingsource_get_docid,_wrap_FixedWeightPostingSource_get_docid,NULL)
 SWIG_ZEND_NAMED_FE(fixedweightpostingsource_name,_wrap_FixedWeightPostingSource_name,NULL)
 SWIG_ZEND_NAMED_FE(fixedweightpostingsource_init,_wrap_FixedWeightPostingSource_init,NULL)
 SWIG_ZEND_NAMED_FE(fixedweightpostingsource_get_description,_wrap_FixedWeightPostingSource_get_description,NULL)
 SWIG_ZEND_NAMED_FE(new_mset,_wrap_new_MSet,NULL)
 SWIG_ZEND_NAMED_FE(mset_fetch,_wrap_MSet_fetch,NULL)
 SWIG_ZEND_NAMED_FE(mset_convert_to_percent,_wrap_MSet_convert_to_percent,NULL)
 SWIG_ZEND_NAMED_FE(mset_get_termfreq,_wrap_MSet_get_termfreq,NULL)
 SWIG_ZEND_NAMED_FE(mset_get_termweight,_wrap_MSet_get_termweight,NULL)
 SWIG_ZEND_NAMED_FE(mset_get_firstitem,_wrap_MSet_get_firstitem,NULL)
 SWIG_ZEND_NAMED_FE(mset_get_matches_lower_bound,_wrap_MSet_get_matches_lower_bound,NULL)
 SWIG_ZEND_NAMED_FE(mset_get_matches_estimated,_wrap_MSet_get_matches_estimated,NULL)
 SWIG_ZEND_NAMED_FE(mset_get_matches_upper_bound,_wrap_MSet_get_matches_upper_bound,NULL)
 SWIG_ZEND_NAMED_FE(mset_get_uncollapsed_matches_lower_bound,_wrap_MSet_get_uncollapsed_matches_lower_bound,NULL)
 SWIG_ZEND_NAMED_FE(mset_get_uncollapsed_matches_estimated,_wrap_MSet_get_uncollapsed_matches_estimated,NULL)
 SWIG_ZEND_NAMED_FE(mset_get_uncollapsed_matches_upper_bound,_wrap_MSet_get_uncollapsed_matches_upper_bound,NULL)
 SWIG_ZEND_NAMED_FE(mset_get_max_possible,_wrap_MSet_get_max_possible,NULL)
 SWIG_ZEND_NAMED_FE(mset_get_max_attained,_wrap_MSet_get_max_attained,NULL)
 SWIG_ZEND_NAMED_FE(mset_size,_wrap_MSet_size,NULL)
 SWIG_ZEND_NAMED_FE(mset_is_empty,_wrap_MSet_is_empty,NULL)
 SWIG_ZEND_NAMED_FE(mset_begin,_wrap_MSet_begin,NULL)
 SWIG_ZEND_NAMED_FE(mset_end,_wrap_MSet_end,NULL)
 SWIG_ZEND_NAMED_FE(mset_back,_wrap_MSet_back,NULL)
 SWIG_ZEND_NAMED_FE(mset_get_hit,_wrap_MSet_get_hit,NULL)
 SWIG_ZEND_NAMED_FE(mset_get_document_percentage,_wrap_MSet_get_document_percentage,NULL)
 SWIG_ZEND_NAMED_FE(mset_get_document,_wrap_MSet_get_document,NULL)
 SWIG_ZEND_NAMED_FE(mset_get_docid,_wrap_MSet_get_docid,NULL)
 SWIG_ZEND_NAMED_FE(mset_get_description,_wrap_MSet_get_description,NULL)
 SWIG_ZEND_NAMED_FE(new_msetiterator,_wrap_new_MSetIterator,NULL)
 SWIG_ZEND_NAMED_FE(msetiterator_get_docid,_wrap_MSetIterator_get_docid,NULL)
 SWIG_ZEND_NAMED_FE(msetiterator_next,_wrap_MSetIterator_next,NULL)
 SWIG_ZEND_NAMED_FE(msetiterator_prev,_wrap_MSetIterator_prev,NULL)
 SWIG_ZEND_NAMED_FE(msetiterator_equals,_wrap_MSetIterator_equals,NULL)
 SWIG_ZEND_NAMED_FE(msetiterator_get_document,_wrap_MSetIterator_get_document,NULL)
 SWIG_ZEND_NAMED_FE(msetiterator_get_rank,_wrap_MSetIterator_get_rank,NULL)
 SWIG_ZEND_NAMED_FE(msetiterator_get_weight,_wrap_MSetIterator_get_weight,NULL)
 SWIG_ZEND_NAMED_FE(msetiterator_get_collapse_key,_wrap_MSetIterator_get_collapse_key,NULL)
 SWIG_ZEND_NAMED_FE(msetiterator_get_collapse_count,_wrap_MSetIterator_get_collapse_count,NULL)
 SWIG_ZEND_NAMED_FE(msetiterator_get_percent,_wrap_MSetIterator_get_percent,NULL)
 SWIG_ZEND_NAMED_FE(msetiterator_get_description,_wrap_MSetIterator_get_description,NULL)
 SWIG_ZEND_NAMED_FE(new_eset,_wrap_new_ESet,NULL)
 SWIG_ZEND_NAMED_FE(eset_get_ebound,_wrap_ESet_get_ebound,NULL)
 SWIG_ZEND_NAMED_FE(eset_size,_wrap_ESet_size,NULL)
 SWIG_ZEND_NAMED_FE(eset_is_empty,_wrap_ESet_is_empty,NULL)
 SWIG_ZEND_NAMED_FE(eset_begin,_wrap_ESet_begin,NULL)
 SWIG_ZEND_NAMED_FE(eset_end,_wrap_ESet_end,NULL)
 SWIG_ZEND_NAMED_FE(eset_back,_wrap_ESet_back,NULL)
 SWIG_ZEND_NAMED_FE(eset_get_description,_wrap_ESet_get_description,NULL)
 SWIG_ZEND_NAMED_FE(new_esetiterator,_wrap_new_ESetIterator,NULL)
 SWIG_ZEND_NAMED_FE(esetiterator_get_term,_wrap_ESetIterator_get_term,NULL)
 SWIG_ZEND_NAMED_FE(esetiterator_next,_wrap_ESetIterator_next,NULL)
 SWIG_ZEND_NAMED_FE(esetiterator_prev,_wrap_ESetIterator_prev,NULL)
 SWIG_ZEND_NAMED_FE(esetiterator_equals,_wrap_ESetIterator_equals,NULL)
 SWIG_ZEND_NAMED_FE(esetiterator_get_weight,_wrap_ESetIterator_get_weight,NULL)
 SWIG_ZEND_NAMED_FE(esetiterator_get_description,_wrap_ESetIterator_get_description,NULL)
 SWIG_ZEND_NAMED_FE(new_rset,_wrap_new_RSet,NULL)
 SWIG_ZEND_NAMED_FE(rset_size,_wrap_RSet_size,NULL)
 SWIG_ZEND_NAMED_FE(rset_is_empty,_wrap_RSet_is_empty,NULL)
 SWIG_ZEND_NAMED_FE(rset_add_document,_wrap_RSet_add_document,NULL)
 SWIG_ZEND_NAMED_FE(rset_remove_document,_wrap_RSet_remove_document,NULL)
 SWIG_ZEND_NAMED_FE(rset_contains,_wrap_RSet_contains,NULL)
 SWIG_ZEND_NAMED_FE(rset_get_description,_wrap_RSet_get_description,NULL)
 SWIG_ZEND_NAMED_FE(matchdecider_apply,_wrap_MatchDecider_apply,NULL)
 SWIG_ZEND_NAMED_FE(new_matchdecider,_wrap_new_MatchDecider,NULL)
 SWIG_ZEND_NAMED_FE(expanddecider_apply,_wrap_ExpandDecider_apply,NULL)
 SWIG_ZEND_NAMED_FE(new_expanddecider,_wrap_new_ExpandDecider,NULL)
 SWIG_ZEND_NAMED_FE(new_enquire,_wrap_new_Enquire,NULL)
 SWIG_ZEND_NAMED_FE(enquire_set_query,_wrap_Enquire_set_query,NULL)
 SWIG_ZEND_NAMED_FE(enquire_get_query,_wrap_Enquire_get_query,NULL)
 SWIG_ZEND_NAMED_FE(enquire_add_matchspy,_wrap_Enquire_add_matchspy,NULL)
 SWIG_ZEND_NAMED_FE(enquire_clear_matchspies,_wrap_Enquire_clear_matchspies,NULL)
 SWIG_ZEND_NAMED_FE(enquire_set_weighting_scheme,_wrap_Enquire_set_weighting_scheme,NULL)
 SWIG_ZEND_NAMED_FE(enquire_set_collapse_key,_wrap_Enquire_set_collapse_key,NULL)
 SWIG_ZEND_NAMED_FE(enquire_set_docid_order,_wrap_Enquire_set_docid_order,NULL)
 SWIG_ZEND_NAMED_FE(enquire_set_cutoff,_wrap_Enquire_set_cutoff,NULL)
 SWIG_ZEND_NAMED_FE(enquire_set_sort_by_relevance,_wrap_Enquire_set_sort_by_relevance,NULL)
 SWIG_ZEND_NAMED_FE(enquire_set_sort_by_value,_wrap_Enquire_set_sort_by_value,NULL)
 SWIG_ZEND_NAMED_FE(enquire_set_sort_by_value_then_relevance,_wrap_Enquire_set_sort_by_value_then_relevance,NULL)
 SWIG_ZEND_NAMED_FE(enquire_set_sort_by_relevance_then_value,_wrap_Enquire_set_sort_by_relevance_then_value,NULL)
 SWIG_ZEND_NAMED_FE(enquire_set_sort_by_key,_wrap_Enquire_set_sort_by_key,NULL)
 SWIG_ZEND_NAMED_FE(enquire_set_sort_by_key_then_relevance,_wrap_Enquire_set_sort_by_key_then_relevance,NULL)
 SWIG_ZEND_NAMED_FE(enquire_set_sort_by_relevance_then_key,_wrap_Enquire_set_sort_by_relevance_then_key,NULL)
 SWIG_ZEND_NAMED_FE(enquire_get_mset,_wrap_Enquire_get_mset,NULL)
 SWIG_ZEND_NAMED_FE(enquire_get_eset,_wrap_Enquire_get_eset,NULL)
 SWIG_ZEND_NAMED_FE(enquire_get_matching_terms_begin,_wrap_Enquire_get_matching_terms_begin,NULL)
 SWIG_ZEND_NAMED_FE(enquire_get_matching_terms_end,_wrap_Enquire_get_matching_terms_end,NULL)
 SWIG_ZEND_NAMED_FE(enquire_get_matching_terms,_wrap_Enquire_get_matching_terms,NULL)
 SWIG_ZEND_NAMED_FE(enquire_get_description,_wrap_Enquire_get_description,NULL)
 SWIG_ZEND_NAMED_FE(new_registry,_wrap_new_Registry,NULL)
 SWIG_ZEND_NAMED_FE(registry_register_weighting_scheme,_wrap_Registry_register_weighting_scheme,NULL)
 SWIG_ZEND_NAMED_FE(registry_get_weighting_scheme,_wrap_Registry_get_weighting_scheme,NULL)
 SWIG_ZEND_NAMED_FE(registry_register_posting_source,_wrap_Registry_register_posting_source,NULL)
 SWIG_ZEND_NAMED_FE(registry_get_posting_source,_wrap_Registry_get_posting_source,NULL)
 SWIG_ZEND_NAMED_FE(registry_register_match_spy,_wrap_Registry_register_match_spy,NULL)
 SWIG_ZEND_NAMED_FE(registry_get_match_spy,_wrap_Registry_get_match_spy,NULL)
 SWIG_ZEND_NAMED_FE(weight_name,_wrap_Weight_name,NULL)
 SWIG_ZEND_NAMED_FE(weight_get_sumpart,_wrap_Weight_get_sumpart,NULL)
 SWIG_ZEND_NAMED_FE(weight_get_maxpart,_wrap_Weight_get_maxpart,NULL)
 SWIG_ZEND_NAMED_FE(weight_get_sumextra,_wrap_Weight_get_sumextra,NULL)
 SWIG_ZEND_NAMED_FE(weight_get_maxextra,_wrap_Weight_get_maxextra,NULL)
 SWIG_ZEND_NAMED_FE(weight_get_sumpart_needs_doclength_,_wrap_Weight_get_sumpart_needs_doclength_,NULL)
 SWIG_ZEND_NAMED_FE(weight_get_sumpart_needs_wdf_,_wrap_Weight_get_sumpart_needs_wdf_,NULL)
 SWIG_ZEND_NAMED_FE(new_boolweight,_wrap_new_BoolWeight,NULL)
 SWIG_ZEND_NAMED_FE(boolweight_name,_wrap_BoolWeight_name,NULL)
 SWIG_ZEND_NAMED_FE(boolweight_serialise,_wrap_BoolWeight_serialise,NULL)
 SWIG_ZEND_NAMED_FE(boolweight_unserialise,_wrap_BoolWeight_unserialise,NULL)
 SWIG_ZEND_NAMED_FE(boolweight_get_sumpart,_wrap_BoolWeight_get_sumpart,NULL)
 SWIG_ZEND_NAMED_FE(boolweight_get_maxpart,_wrap_BoolWeight_get_maxpart,NULL)
 SWIG_ZEND_NAMED_FE(boolweight_get_sumextra,_wrap_BoolWeight_get_sumextra,NULL)
 SWIG_ZEND_NAMED_FE(boolweight_get_maxextra,_wrap_BoolWeight_get_maxextra,NULL)
 SWIG_ZEND_NAMED_FE(new_bm25weight,_wrap_new_BM25Weight,NULL)
 SWIG_ZEND_NAMED_FE(bm25weight_name,_wrap_BM25Weight_name,NULL)
 SWIG_ZEND_NAMED_FE(bm25weight_get_sumpart,_wrap_BM25Weight_get_sumpart,NULL)
 SWIG_ZEND_NAMED_FE(bm25weight_get_maxpart,_wrap_BM25Weight_get_maxpart,NULL)
 SWIG_ZEND_NAMED_FE(bm25weight_get_sumextra,_wrap_BM25Weight_get_sumextra,NULL)
 SWIG_ZEND_NAMED_FE(bm25weight_get_maxextra,_wrap_BM25Weight_get_maxextra,NULL)
 SWIG_ZEND_NAMED_FE(new_tradweight,_wrap_new_TradWeight,NULL)
 SWIG_ZEND_NAMED_FE(tradweight_name,_wrap_TradWeight_name,NULL)
 SWIG_ZEND_NAMED_FE(tradweight_get_sumpart,_wrap_TradWeight_get_sumpart,NULL)
 SWIG_ZEND_NAMED_FE(tradweight_get_maxpart,_wrap_TradWeight_get_maxpart,NULL)
 SWIG_ZEND_NAMED_FE(tradweight_get_sumextra,_wrap_TradWeight_get_sumextra,NULL)
 SWIG_ZEND_NAMED_FE(tradweight_get_maxextra,_wrap_TradWeight_get_maxextra,NULL)
 SWIG_ZEND_NAMED_FE(new_matchspy,_wrap_new_MatchSpy,NULL)
 SWIG_ZEND_NAMED_FE(matchspy_apply,_wrap_MatchSpy_apply,NULL)
 SWIG_ZEND_NAMED_FE(matchspy_name,_wrap_MatchSpy_name,NULL)
 SWIG_ZEND_NAMED_FE(matchspy_merge_results,_wrap_MatchSpy_merge_results,NULL)
 SWIG_ZEND_NAMED_FE(matchspy_get_description,_wrap_MatchSpy_get_description,NULL)
 SWIG_ZEND_NAMED_FE(new_valuecountmatchspy,_wrap_new_ValueCountMatchSpy,NULL)
 SWIG_ZEND_NAMED_FE(valuecountmatchspy_get_total,_wrap_ValueCountMatchSpy_get_total,NULL)
 SWIG_ZEND_NAMED_FE(valuecountmatchspy_values_begin,_wrap_ValueCountMatchSpy_values_begin,NULL)
 SWIG_ZEND_NAMED_FE(valuecountmatchspy_values_end,_wrap_ValueCountMatchSpy_values_end,NULL)
 SWIG_ZEND_NAMED_FE(valuecountmatchspy_top_values_begin,_wrap_ValueCountMatchSpy_top_values_begin,NULL)
 SWIG_ZEND_NAMED_FE(valuecountmatchspy_top_values_end,_wrap_ValueCountMatchSpy_top_values_end,NULL)
 SWIG_ZEND_NAMED_FE(valuecountmatchspy_apply,_wrap_ValueCountMatchSpy_apply,NULL)
 SWIG_ZEND_NAMED_FE(valuecountmatchspy_name,_wrap_ValueCountMatchSpy_name,NULL)
 SWIG_ZEND_NAMED_FE(valuecountmatchspy_merge_results,_wrap_ValueCountMatchSpy_merge_results,NULL)
 SWIG_ZEND_NAMED_FE(valuecountmatchspy_get_description,_wrap_ValueCountMatchSpy_get_description,NULL)
 SWIG_ZEND_NAMED_FE(database_add_database,_wrap_Database_add_database,NULL)
 SWIG_ZEND_NAMED_FE(new_database,_wrap_new_Database,NULL)
 SWIG_ZEND_NAMED_FE(database_reopen,_wrap_Database_reopen,NULL)
 SWIG_ZEND_NAMED_FE(database_close,_wrap_Database_close,NULL)
 SWIG_ZEND_NAMED_FE(database_get_description,_wrap_Database_get_description,NULL)
 SWIG_ZEND_NAMED_FE(database_postlist_begin,_wrap_Database_postlist_begin,NULL)
 SWIG_ZEND_NAMED_FE(database_postlist_end,_wrap_Database_postlist_end,NULL)
 SWIG_ZEND_NAMED_FE(database_termlist_begin,_wrap_Database_termlist_begin,NULL)
 SWIG_ZEND_NAMED_FE(database_termlist_end,_wrap_Database_termlist_end,NULL)
 SWIG_ZEND_NAMED_FE(database_positionlist_begin,_wrap_Database_positionlist_begin,NULL)
 SWIG_ZEND_NAMED_FE(database_positionlist_end,_wrap_Database_positionlist_end,NULL)
 SWIG_ZEND_NAMED_FE(database_allterms_begin,_wrap_Database_allterms_begin,NULL)
 SWIG_ZEND_NAMED_FE(database_allterms_end,_wrap_Database_allterms_end,NULL)
 SWIG_ZEND_NAMED_FE(database_get_doccount,_wrap_Database_get_doccount,NULL)
 SWIG_ZEND_NAMED_FE(database_get_lastdocid,_wrap_Database_get_lastdocid,NULL)
 SWIG_ZEND_NAMED_FE(database_get_avlength,_wrap_Database_get_avlength,NULL)
 SWIG_ZEND_NAMED_FE(database_get_termfreq,_wrap_Database_get_termfreq,NULL)
 SWIG_ZEND_NAMED_FE(database_term_exists,_wrap_Database_term_exists,NULL)
 SWIG_ZEND_NAMED_FE(database_get_collection_freq,_wrap_Database_get_collection_freq,NULL)
 SWIG_ZEND_NAMED_FE(database_get_value_freq,_wrap_Database_get_value_freq,NULL)
 SWIG_ZEND_NAMED_FE(database_get_value_lower_bound,_wrap_Database_get_value_lower_bound,NULL)
 SWIG_ZEND_NAMED_FE(database_get_value_upper_bound,_wrap_Database_get_value_upper_bound,NULL)
 SWIG_ZEND_NAMED_FE(database_get_doclength_lower_bound,_wrap_Database_get_doclength_lower_bound,NULL)
 SWIG_ZEND_NAMED_FE(database_get_doclength_upper_bound,_wrap_Database_get_doclength_upper_bound,NULL)
 SWIG_ZEND_NAMED_FE(database_get_wdf_upper_bound,_wrap_Database_get_wdf_upper_bound,NULL)
 SWIG_ZEND_NAMED_FE(database_valuestream_begin,_wrap_Database_valuestream_begin,NULL)
 SWIG_ZEND_NAMED_FE(database_valuestream_end,_wrap_Database_valuestream_end,NULL)
 SWIG_ZEND_NAMED_FE(database_get_doclength,_wrap_Database_get_doclength,NULL)
 SWIG_ZEND_NAMED_FE(database_keep_alive,_wrap_Database_keep_alive,NULL)
 SWIG_ZEND_NAMED_FE(database_get_document,_wrap_Database_get_document,NULL)
 SWIG_ZEND_NAMED_FE(database_get_spelling_suggestion,_wrap_Database_get_spelling_suggestion,NULL)
 SWIG_ZEND_NAMED_FE(database_spellings_begin,_wrap_Database_spellings_begin,NULL)
 SWIG_ZEND_NAMED_FE(database_spellings_end,_wrap_Database_spellings_end,NULL)
 SWIG_ZEND_NAMED_FE(database_synonyms_begin,_wrap_Database_synonyms_begin,NULL)
 SWIG_ZEND_NAMED_FE(database_synonyms_end,_wrap_Database_synonyms_end,NULL)
 SWIG_ZEND_NAMED_FE(database_synonym_keys_begin,_wrap_Database_synonym_keys_begin,NULL)
 SWIG_ZEND_NAMED_FE(database_synonym_keys_end,_wrap_Database_synonym_keys_end,NULL)
 SWIG_ZEND_NAMED_FE(database_get_metadata,_wrap_Database_get_metadata,NULL)
 SWIG_ZEND_NAMED_FE(database_metadata_keys_begin,_wrap_Database_metadata_keys_begin,NULL)
 SWIG_ZEND_NAMED_FE(database_metadata_keys_end,_wrap_Database_metadata_keys_end,NULL)
 SWIG_ZEND_NAMED_FE(database_get_uuid,_wrap_Database_get_uuid,NULL)
 SWIG_ZEND_NAMED_FE(database_has_positions,_wrap_Database_has_positions,NULL)
 SWIG_ZEND_NAMED_FE(new_writabledatabase,_wrap_new_WritableDatabase,NULL)
 SWIG_ZEND_NAMED_FE(writabledatabase_commit,_wrap_WritableDatabase_commit,NULL)
 SWIG_ZEND_NAMED_FE(writabledatabase_flush,_wrap_WritableDatabase_flush,NULL)
 SWIG_ZEND_NAMED_FE(writabledatabase_begin_transaction,_wrap_WritableDatabase_begin_transaction,NULL)
 SWIG_ZEND_NAMED_FE(writabledatabase_commit_transaction,_wrap_WritableDatabase_commit_transaction,NULL)
 SWIG_ZEND_NAMED_FE(writabledatabase_cancel_transaction,_wrap_WritableDatabase_cancel_transaction,NULL)
 SWIG_ZEND_NAMED_FE(writabledatabase_add_document,_wrap_WritableDatabase_add_document,NULL)
 SWIG_ZEND_NAMED_FE(writabledatabase_delete_document,_wrap_WritableDatabase_delete_document,NULL)
 SWIG_ZEND_NAMED_FE(writabledatabase_replace_document,_wrap_WritableDatabase_replace_document,NULL)
 SWIG_ZEND_NAMED_FE(writabledatabase_add_spelling,_wrap_WritableDatabase_add_spelling,NULL)
 SWIG_ZEND_NAMED_FE(writabledatabase_remove_spelling,_wrap_WritableDatabase_remove_spelling,NULL)
 SWIG_ZEND_NAMED_FE(writabledatabase_add_synonym,_wrap_WritableDatabase_add_synonym,NULL)
 SWIG_ZEND_NAMED_FE(writabledatabase_remove_synonym,_wrap_WritableDatabase_remove_synonym,NULL)
 SWIG_ZEND_NAMED_FE(writabledatabase_clear_synonyms,_wrap_WritableDatabase_clear_synonyms,NULL)
 SWIG_ZEND_NAMED_FE(writabledatabase_set_metadata,_wrap_WritableDatabase_set_metadata,NULL)
 SWIG_ZEND_NAMED_FE(writabledatabase_get_description,_wrap_WritableDatabase_get_description,NULL)
 SWIG_ZEND_NAMED_FE(auto_open_stub,_wrap_auto_open_stub,NULL)
 SWIG_ZEND_NAMED_FE(brass_open,_wrap_brass_open,NULL)
 SWIG_ZEND_NAMED_FE(chert_open,_wrap_chert_open,NULL)
 SWIG_ZEND_NAMED_FE(flint_open,_wrap_flint_open,NULL)
 SWIG_ZEND_NAMED_FE(inmemory_open,_wrap_inmemory_open,NULL)
 SWIG_ZEND_NAMED_FE(remote_open,_wrap_remote_open,NULL)
 SWIG_ZEND_NAMED_FE(remote_open_writable,_wrap_remote_open_writable,NULL)
 SWIG_ZEND_NAMED_FE(query_matchall_get,_wrap_Query_MatchAll_get,NULL)
 SWIG_ZEND_NAMED_FE(query_matchnothing_get,_wrap_Query_MatchNothing_get,NULL)
 SWIG_ZEND_NAMED_FE(query_get_length,_wrap_Query_get_length,NULL)
 SWIG_ZEND_NAMED_FE(query_get_terms_begin,_wrap_Query_get_terms_begin,NULL)
 SWIG_ZEND_NAMED_FE(query_get_terms_end,_wrap_Query_get_terms_end,NULL)
 SWIG_ZEND_NAMED_FE(query_is_empty,_wrap_Query_is_empty,NULL)
 SWIG_ZEND_NAMED_FE(query_serialise,_wrap_Query_serialise,NULL)
 SWIG_ZEND_NAMED_FE(query_unserialise,_wrap_Query_unserialise,NULL)
 SWIG_ZEND_NAMED_FE(query_get_description,_wrap_Query_get_description,NULL)
 SWIG_ZEND_NAMED_FE(new_query,_wrap_new_Query,NULL)
 SWIG_ZEND_NAMED_FE(stopper_apply,_wrap_Stopper_apply,NULL)
 SWIG_ZEND_NAMED_FE(stopper_get_description,_wrap_Stopper_get_description,NULL)
 SWIG_ZEND_NAMED_FE(new_stopper,_wrap_new_Stopper,NULL)
 SWIG_ZEND_NAMED_FE(new_simplestopper,_wrap_new_SimpleStopper,NULL)
 SWIG_ZEND_NAMED_FE(simplestopper_add,_wrap_SimpleStopper_add,NULL)
 SWIG_ZEND_NAMED_FE(simplestopper_apply,_wrap_SimpleStopper_apply,NULL)
 SWIG_ZEND_NAMED_FE(simplestopper_get_description,_wrap_SimpleStopper_get_description,NULL)
 SWIG_ZEND_NAMED_FE(valuerangeprocessor_apply,_wrap_ValueRangeProcessor_apply,NULL)
 SWIG_ZEND_NAMED_FE(new_valuerangeprocessor,_wrap_new_ValueRangeProcessor,NULL)
 SWIG_ZEND_NAMED_FE(new_stringvaluerangeprocessor,_wrap_new_StringValueRangeProcessor,NULL)
 SWIG_ZEND_NAMED_FE(stringvaluerangeprocessor_apply,_wrap_StringValueRangeProcessor_apply,NULL)
 SWIG_ZEND_NAMED_FE(new_datevaluerangeprocessor,_wrap_new_DateValueRangeProcessor,NULL)
 SWIG_ZEND_NAMED_FE(datevaluerangeprocessor_apply,_wrap_DateValueRangeProcessor_apply,NULL)
 SWIG_ZEND_NAMED_FE(new_numbervaluerangeprocessor,_wrap_new_NumberValueRangeProcessor,NULL)
 SWIG_ZEND_NAMED_FE(numbervaluerangeprocessor_apply,_wrap_NumberValueRangeProcessor_apply,NULL)
 SWIG_ZEND_NAMED_FE(new_queryparser,_wrap_new_QueryParser,NULL)
 SWIG_ZEND_NAMED_FE(queryparser_set_stemmer,_wrap_QueryParser_set_stemmer,NULL)
 SWIG_ZEND_NAMED_FE(queryparser_set_stemming_strategy,_wrap_QueryParser_set_stemming_strategy,NULL)
 SWIG_ZEND_NAMED_FE(queryparser_set_stopper,_wrap_QueryParser_set_stopper,NULL)
 SWIG_ZEND_NAMED_FE(queryparser_set_default_op,_wrap_QueryParser_set_default_op,NULL)
 SWIG_ZEND_NAMED_FE(queryparser_get_default_op,_wrap_QueryParser_get_default_op,NULL)
 SWIG_ZEND_NAMED_FE(queryparser_set_database,_wrap_QueryParser_set_database,NULL)
 SWIG_ZEND_NAMED_FE(queryparser_set_max_wildcard_expansion,_wrap_QueryParser_set_max_wildcard_expansion,NULL)
 SWIG_ZEND_NAMED_FE(queryparser_parse_query,_wrap_QueryParser_parse_query,NULL)
 SWIG_ZEND_NAMED_FE(queryparser_add_prefix,_wrap_QueryParser_add_prefix,NULL)
 SWIG_ZEND_NAMED_FE(queryparser_add_boolean_prefix,_wrap_QueryParser_add_boolean_prefix,NULL)
 SWIG_ZEND_NAMED_FE(queryparser_stoplist_begin,_wrap_QueryParser_stoplist_begin,NULL)
 SWIG_ZEND_NAMED_FE(queryparser_stoplist_end,_wrap_QueryParser_stoplist_end,NULL)
 SWIG_ZEND_NAMED_FE(queryparser_unstem_begin,_wrap_QueryParser_unstem_begin,NULL)
 SWIG_ZEND_NAMED_FE(queryparser_unstem_end,_wrap_QueryParser_unstem_end,NULL)
 SWIG_ZEND_NAMED_FE(queryparser_add_valuerangeprocessor,_wrap_QueryParser_add_valuerangeprocessor,NULL)
 SWIG_ZEND_NAMED_FE(queryparser_get_corrected_query_string,_wrap_QueryParser_get_corrected_query_string,NULL)
 SWIG_ZEND_NAMED_FE(queryparser_get_description,_wrap_QueryParser_get_description,NULL)
 SWIG_ZEND_NAMED_FE(sortable_serialise,_wrap_sortable_serialise,NULL)
 SWIG_ZEND_NAMED_FE(sortable_unserialise,_wrap_sortable_unserialise,NULL)
 SWIG_ZEND_NAMED_FE(stemimplementation_apply,_wrap_StemImplementation_apply,NULL)
 SWIG_ZEND_NAMED_FE(stemimplementation_get_description,_wrap_StemImplementation_get_description,NULL)
 SWIG_ZEND_NAMED_FE(new_stemimplementation,_wrap_new_StemImplementation,NULL)
 SWIG_ZEND_NAMED_FE(new_stem,_wrap_new_Stem,NULL)
 SWIG_ZEND_NAMED_FE(stem_apply,_wrap_Stem_apply,NULL)
 SWIG_ZEND_NAMED_FE(stem_get_description,_wrap_Stem_get_description,NULL)
 SWIG_ZEND_NAMED_FE(stem_get_available_languages,_wrap_Stem_get_available_languages,NULL)
 SWIG_ZEND_NAMED_FE(new_termgenerator,_wrap_new_TermGenerator,NULL)
 SWIG_ZEND_NAMED_FE(termgenerator_set_stemmer,_wrap_TermGenerator_set_stemmer,NULL)
 SWIG_ZEND_NAMED_FE(termgenerator_set_stopper,_wrap_TermGenerator_set_stopper,NULL)
 SWIG_ZEND_NAMED_FE(termgenerator_set_document,_wrap_TermGenerator_set_document,NULL)
 SWIG_ZEND_NAMED_FE(termgenerator_get_document,_wrap_TermGenerator_get_document,NULL)
 SWIG_ZEND_NAMED_FE(termgenerator_set_database,_wrap_TermGenerator_set_database,NULL)
 SWIG_ZEND_NAMED_FE(termgenerator_set_flags,_wrap_TermGenerator_set_flags,NULL)
 SWIG_ZEND_NAMED_FE(termgenerator_index_text,_wrap_TermGenerator_index_text,NULL)
 SWIG_ZEND_NAMED_FE(termgenerator_index_text_without_positions,_wrap_TermGenerator_index_text_without_positions,NULL)
 SWIG_ZEND_NAMED_FE(termgenerator_increase_termpos,_wrap_TermGenerator_increase_termpos,NULL)
 SWIG_ZEND_NAMED_FE(termgenerator_get_termpos,_wrap_TermGenerator_get_termpos,NULL)
 SWIG_ZEND_NAMED_FE(termgenerator_set_termpos,_wrap_TermGenerator_set_termpos,NULL)
 SWIG_ZEND_NAMED_FE(termgenerator_get_description,_wrap_TermGenerator_get_description,NULL)
 SWIG_ZEND_NAMED_FE(keymaker_apply,_wrap_KeyMaker_apply,NULL)
 SWIG_ZEND_NAMED_FE(new_keymaker,_wrap_new_KeyMaker,NULL)
 SWIG_ZEND_NAMED_FE(new_multivaluekeymaker,_wrap_new_MultiValueKeyMaker,NULL)
 SWIG_ZEND_NAMED_FE(multivaluekeymaker_apply,_wrap_MultiValueKeyMaker_apply,NULL)
 SWIG_ZEND_NAMED_FE(multivaluekeymaker_add_value,_wrap_MultiValueKeyMaker_add_value,NULL)
 SWIG_ZEND_NAMED_FE(new_multivaluesorter,_wrap_new_MultiValueSorter,NULL)
 SWIG_ZEND_NAMED_FE(multivaluesorter_apply,_wrap_MultiValueSorter_apply,NULL)
 SWIG_ZEND_NAMED_FE(multivaluesorter_add,_wrap_MultiValueSorter_add,NULL)
 SWIG_ZEND_NAMED_FE(new_valuesetmatchdecider,_wrap_new_ValueSetMatchDecider,NULL)
 SWIG_ZEND_NAMED_FE(valuesetmatchdecider_add_value,_wrap_ValueSetMatchDecider_add_value,NULL)
 SWIG_ZEND_NAMED_FE(valuesetmatchdecider_remove_value,_wrap_ValueSetMatchDecider_remove_value,NULL)
 SWIG_ZEND_NAMED_FE(valuesetmatchdecider_apply,_wrap_ValueSetMatchDecider_apply,NULL)
 SWIG_ZEND_NAMED_FE(new_compactor,_wrap_new_Compactor,NULL)
 SWIG_ZEND_NAMED_FE(compactor_set_block_size,_wrap_Compactor_set_block_size,NULL)
 SWIG_ZEND_NAMED_FE(compactor_set_renumber,_wrap_Compactor_set_renumber,NULL)
 SWIG_ZEND_NAMED_FE(compactor_set_multipass,_wrap_Compactor_set_multipass,NULL)
 SWIG_ZEND_NAMED_FE(compactor_set_compaction_level,_wrap_Compactor_set_compaction_level,NULL)
 SWIG_ZEND_NAMED_FE(compactor_set_destdir,_wrap_Compactor_set_destdir,NULL)
 SWIG_ZEND_NAMED_FE(compactor_add_source,_wrap_Compactor_add_source,NULL)
 SWIG_ZEND_NAMED_FE(compactor_compact,_wrap_Compactor_compact,NULL)
 SWIG_ZEND_NAMED_FE(compactor_set_status,_wrap_Compactor_set_status,NULL)
 SWIG_ZEND_NAMED_FE(compactor_resolve_duplicate_metadata,_wrap_Compactor_resolve_duplicate_metadata,NULL)
 SWIG_ZEND_NAMED_FE(swig_xapian_alter_newobject,_wrap_swig_xapian_alter_newobject,NULL)
 SWIG_ZEND_NAMED_FE(swig_xapian_get_newobject,_wrap_swig_xapian_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 xapian_module_entry = {
#if ZEND_MODULE_API_NO > 20010900
    STANDARD_MODULE_HEADER,
#endif
    (char*)"xapian",
    xapian_functions,
    PHP_MINIT(xapian),
    PHP_MSHUTDOWN(xapian),
    PHP_RINIT(xapian),
    PHP_RSHUTDOWN(xapian),
    PHP_MINFO(xapian),
#if ZEND_MODULE_API_NO > 20010900
    NO_VERSION_YET,
#endif
    STANDARD_MODULE_PROPERTIES
};
zend_module_entry* SWIG_module_entry = &xapian_module_entry;

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

#define SWIG_php_minit PHP_MINIT_FUNCTION(xapian)
/* -----------------------------------------------------------------------------
 * 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 interpeters 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(xapian, xapian_init_globals, xapian_destroy_globals);

/* Register resource destructors for pointer types */
le_swig__p_Xapian__RSet=zend_register_list_destructors_ex(_wrap_destroy_p_Xapian__RSet,NULL,(char *)(SWIGTYPE_p_Xapian__RSet->name),module_number);
SWIG_TypeClientData(SWIGTYPE_p_Xapian__RSet,&le_swig__p_Xapian__RSet);
le_swig__p_Xapian__Registry=zend_register_list_destructors_ex(_wrap_destroy_p_Xapian__Registry,NULL,(char *)(SWIGTYPE_p_Xapian__Registry->name),module_number);
SWIG_TypeClientData(SWIGTYPE_p_Xapian__Registry,&le_swig__p_Xapian__Registry);
le_swig__p_Xapian__Compactor=zend_register_list_destructors_ex(_wrap_destroy_p_Xapian__Compactor,NULL,(char *)(SWIGTYPE_p_Xapian__Compactor->name),module_number);
SWIG_TypeClientData(SWIGTYPE_p_Xapian__Compactor,&le_swig__p_Xapian__Compactor);
le_swig__p_Xapian__KeyMaker=zend_register_list_destructors_ex(_wrap_destroy_p_Xapian__KeyMaker,NULL,(char *)(SWIGTYPE_p_Xapian__KeyMaker->name),module_number);
SWIG_TypeClientData(SWIGTYPE_p_Xapian__KeyMaker,&le_swig__p_Xapian__KeyMaker);
le_swig__p_Xapian__MultiValueKeyMaker=zend_register_list_destructors_ex(_wrap_destroy_p_Xapian__MultiValueKeyMaker,NULL,(char *)(SWIGTYPE_p_Xapian__MultiValueKeyMaker->name),module_number);
SWIG_TypeClientData(SWIGTYPE_p_Xapian__MultiValueKeyMaker,&le_swig__p_Xapian__MultiValueKeyMaker);
le_swig__p_Xapian__Sorter=zend_register_list_destructors_ex(_wrap_destroy_p_Xapian__Sorter,NULL,(char *)(SWIGTYPE_p_Xapian__Sorter->name),module_number);
SWIG_TypeClientData(SWIGTYPE_p_Xapian__Sorter,&le_swig__p_Xapian__Sorter);
le_swig__p_Xapian__Document=zend_register_list_destructors_ex(_wrap_destroy_p_Xapian__Document,NULL,(char *)(SWIGTYPE_p_Xapian__Document->name),module_number);
SWIG_TypeClientData(SWIGTYPE_p_Xapian__Document,&le_swig__p_Xapian__Document);
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_stem_strategy=zend_register_list_destructors_ex(_wrap_destroy_p_stem_strategy,NULL,(char *)(SWIGTYPE_p_stem_strategy->name),module_number);
SWIG_TypeClientData(SWIGTYPE_p_stem_strategy,&le_swig__p_stem_strategy);
le_swig__p_Xapian__MultiValueSorter=zend_register_list_destructors_ex(_wrap_destroy_p_Xapian__MultiValueSorter,NULL,(char *)(SWIGTYPE_p_Xapian__MultiValueSorter->name),module_number);
SWIG_TypeClientData(SWIGTYPE_p_Xapian__MultiValueSorter,&le_swig__p_Xapian__MultiValueSorter);
le_swig__int=zend_register_list_destructors_ex(_wrap_destroy_int,NULL,(char *)(SWIGTYPE_int->name),module_number);
SWIG_TypeClientData(SWIGTYPE_int,&le_swig__int);
le_swig__p_Xapian__Enquire=zend_register_list_destructors_ex(_wrap_destroy_p_Xapian__Enquire,NULL,(char *)(SWIGTYPE_p_Xapian__Enquire->name),module_number);
SWIG_TypeClientData(SWIGTYPE_p_Xapian__Enquire,&le_swig__p_Xapian__Enquire);
le_swig__p_Xapian__ESetIterator=zend_register_list_destructors_ex(_wrap_destroy_p_Xapian__ESetIterator,NULL,(char *)(SWIGTYPE_p_Xapian__ESetIterator->name),module_number);
SWIG_TypeClientData(SWIGTYPE_p_Xapian__ESetIterator,&le_swig__p_Xapian__ESetIterator);
le_swig__p_Xapian__MSetIterator=zend_register_list_destructors_ex(_wrap_destroy_p_Xapian__MSetIterator,NULL,(char *)(SWIGTYPE_p_Xapian__MSetIterator->name),module_number);
SWIG_TypeClientData(SWIGTYPE_p_Xapian__MSetIterator,&le_swig__p_Xapian__MSetIterator);
le_swig__p_Xapian__ValueIterator=zend_register_list_destructors_ex(_wrap_destroy_p_Xapian__ValueIterator,NULL,(char *)(SWIGTYPE_p_Xapian__ValueIterator->name),module_number);
SWIG_TypeClientData(SWIGTYPE_p_Xapian__ValueIterator,&le_swig__p_Xapian__ValueIterator);
le_swig__p_Xapian__TermIterator=zend_register_list_destructors_ex(_wrap_destroy_p_Xapian__TermIterator,NULL,(char *)(SWIGTYPE_p_Xapian__TermIterator->name),module_number);
SWIG_TypeClientData(SWIGTYPE_p_Xapian__TermIterator,&le_swig__p_Xapian__TermIterator);
le_swig__p_Xapian__PostingIterator=zend_register_list_destructors_ex(_wrap_destroy_p_Xapian__PostingIterator,NULL,(char *)(SWIGTYPE_p_Xapian__PostingIterator->name),module_number);
SWIG_TypeClientData(SWIGTYPE_p_Xapian__PostingIterator,&le_swig__p_Xapian__PostingIterator);
le_swig__p_Xapian__PositionIterator=zend_register_list_destructors_ex(_wrap_destroy_p_Xapian__PositionIterator,NULL,(char *)(SWIGTYPE_p_Xapian__PositionIterator->name),module_number);
SWIG_TypeClientData(SWIGTYPE_p_Xapian__PositionIterator,&le_swig__p_Xapian__PositionIterator);
le_swig__p_Xapian__TermGenerator=zend_register_list_destructors_ex(_wrap_destroy_p_Xapian__TermGenerator,NULL,(char *)(SWIGTYPE_p_Xapian__TermGenerator->name),module_number);
SWIG_TypeClientData(SWIGTYPE_p_Xapian__TermGenerator,&le_swig__p_Xapian__TermGenerator);
le_swig__p_unsigned_int=zend_register_list_destructors_ex(_wrap_destroy_p_unsigned_int,NULL,(char *)(SWIGTYPE_p_unsigned_int->name),module_number);
SWIG_TypeClientData(SWIGTYPE_p_unsigned_int,&le_swig__p_unsigned_int);
le_swig__p_Xapian__BoolWeight=zend_register_list_destructors_ex(_wrap_destroy_p_Xapian__BoolWeight,NULL,(char *)(SWIGTYPE_p_Xapian__BoolWeight->name),module_number);
SWIG_TypeClientData(SWIGTYPE_p_Xapian__BoolWeight,&le_swig__p_Xapian__BoolWeight);
le_swig__p_Xapian__TradWeight=zend_register_list_destructors_ex(_wrap_destroy_p_Xapian__TradWeight,NULL,(char *)(SWIGTYPE_p_Xapian__TradWeight->name),module_number);
SWIG_TypeClientData(SWIGTYPE_p_Xapian__TradWeight,&le_swig__p_Xapian__TradWeight);
le_swig__p_std__string=zend_register_list_destructors_ex(_wrap_destroy_p_std__string,NULL,(char *)(SWIGTYPE_p_std__string->name),module_number);
SWIG_TypeClientData(SWIGTYPE_p_std__string,&le_swig__p_std__string);
le_swig__p_Xapian__QueryParser=zend_register_list_destructors_ex(_wrap_destroy_p_Xapian__QueryParser,NULL,(char *)(SWIGTYPE_p_Xapian__QueryParser->name),module_number);
SWIG_TypeClientData(SWIGTYPE_p_Xapian__QueryParser,&le_swig__p_Xapian__QueryParser);
le_swig__p_Xapian__Query=zend_register_list_destructors_ex(_wrap_destroy_p_Xapian__Query,NULL,(char *)(SWIGTYPE_p_Xapian__Query->name),module_number);
SWIG_TypeClientData(SWIGTYPE_p_Xapian__Query,&le_swig__p_Xapian__Query);
le_swig__p_Xapian__Stopper=zend_register_list_destructors_ex(_wrap_destroy_p_Xapian__Stopper,NULL,(char *)(SWIGTYPE_p_Xapian__Stopper->name),module_number);
SWIG_TypeClientData(SWIGTYPE_p_Xapian__Stopper,&le_swig__p_Xapian__Stopper);
le_swig__p_Xapian__SimpleStopper=zend_register_list_destructors_ex(_wrap_destroy_p_Xapian__SimpleStopper,NULL,(char *)(SWIGTYPE_p_Xapian__SimpleStopper->name),module_number);
SWIG_TypeClientData(SWIGTYPE_p_Xapian__SimpleStopper,&le_swig__p_Xapian__SimpleStopper);
le_swig__p_Xapian__ExpandDecider=zend_register_list_destructors_ex(_wrap_destroy_p_Xapian__ExpandDecider,NULL,(char *)(SWIGTYPE_p_Xapian__ExpandDecider->name),module_number);
SWIG_TypeClientData(SWIGTYPE_p_Xapian__ExpandDecider,&le_swig__p_Xapian__ExpandDecider);
le_swig__p_Xapian__MatchDecider=zend_register_list_destructors_ex(_wrap_destroy_p_Xapian__MatchDecider,NULL,(char *)(SWIGTYPE_p_Xapian__MatchDecider->name),module_number);
SWIG_TypeClientData(SWIGTYPE_p_Xapian__MatchDecider,&le_swig__p_Xapian__MatchDecider);
le_swig__p_op=zend_register_list_destructors_ex(_wrap_destroy_p_op,NULL,(char *)(SWIGTYPE_p_op->name),module_number);
SWIG_TypeClientData(SWIGTYPE_p_op,&le_swig__p_op);
le_swig__p_Xapian__ValueSetMatchDecider=zend_register_list_destructors_ex(_wrap_destroy_p_Xapian__ValueSetMatchDecider,NULL,(char *)(SWIGTYPE_p_Xapian__ValueSetMatchDecider->name),module_number);
SWIG_TypeClientData(SWIGTYPE_p_Xapian__ValueSetMatchDecider,&le_swig__p_Xapian__ValueSetMatchDecider);
le_swig__p_docid_order=zend_register_list_destructors_ex(_wrap_destroy_p_docid_order,NULL,(char *)(SWIGTYPE_p_docid_order->name),module_number);
SWIG_TypeClientData(SWIGTYPE_p_docid_order,&le_swig__p_docid_order);
le_swig__p_Xapian__StemImplementation=zend_register_list_destructors_ex(_wrap_destroy_p_Xapian__StemImplementation,NULL,(char *)(SWIGTYPE_p_Xapian__StemImplementation->name),module_number);
SWIG_TypeClientData(SWIGTYPE_p_Xapian__StemImplementation,&le_swig__p_Xapian__StemImplementation);
le_swig__p_Xapian__FixedWeightPostingSource=zend_register_list_destructors_ex(_wrap_destroy_p_Xapian__FixedWeightPostingSource,NULL,(char *)(SWIGTYPE_p_Xapian__FixedWeightPostingSource->name),module_number);
SWIG_TypeClientData(SWIGTYPE_p_Xapian__FixedWeightPostingSource,&le_swig__p_Xapian__FixedWeightPostingSource);
le_swig__p_Xapian__ValueMapPostingSource=zend_register_list_destructors_ex(_wrap_destroy_p_Xapian__ValueMapPostingSource,NULL,(char *)(SWIGTYPE_p_Xapian__ValueMapPostingSource->name),module_number);
SWIG_TypeClientData(SWIGTYPE_p_Xapian__ValueMapPostingSource,&le_swig__p_Xapian__ValueMapPostingSource);
le_swig__p_Xapian__DecreasingValueWeightPostingSource=zend_register_list_destructors_ex(_wrap_destroy_p_Xapian__DecreasingValueWeightPostingSource,NULL,(char *)(SWIGTYPE_p_Xapian__DecreasingValueWeightPostingSource->name),module_number);
SWIG_TypeClientData(SWIGTYPE_p_Xapian__DecreasingValueWeightPostingSource,&le_swig__p_Xapian__DecreasingValueWeightPostingSource);
le_swig__p_Xapian__PostingSource=zend_register_list_destructors_ex(_wrap_destroy_p_Xapian__PostingSource,NULL,(char *)(SWIGTYPE_p_Xapian__PostingSource->name),module_number);
SWIG_TypeClientData(SWIGTYPE_p_Xapian__PostingSource,&le_swig__p_Xapian__PostingSource);
le_swig__p_Xapian__ValuePostingSource=zend_register_list_destructors_ex(_wrap_destroy_p_Xapian__ValuePostingSource,NULL,(char *)(SWIGTYPE_p_Xapian__ValuePostingSource->name),module_number);
SWIG_TypeClientData(SWIGTYPE_p_Xapian__ValuePostingSource,&le_swig__p_Xapian__ValuePostingSource);
le_swig__p_Xapian__ValueWeightPostingSource=zend_register_list_destructors_ex(_wrap_destroy_p_Xapian__ValueWeightPostingSource,NULL,(char *)(SWIGTYPE_p_Xapian__ValueWeightPostingSource->name),module_number);
SWIG_TypeClientData(SWIGTYPE_p_Xapian__ValueWeightPostingSource,&le_swig__p_Xapian__ValueWeightPostingSource);
le_swig__p_Xapian__Weight=zend_register_list_destructors_ex(_wrap_destroy_p_Xapian__Weight,NULL,(char *)(SWIGTYPE_p_Xapian__Weight->name),module_number);
SWIG_TypeClientData(SWIGTYPE_p_Xapian__Weight,&le_swig__p_Xapian__Weight);
le_swig__p_Xapian__BM25Weight=zend_register_list_destructors_ex(_wrap_destroy_p_Xapian__BM25Weight,NULL,(char *)(SWIGTYPE_p_Xapian__BM25Weight->name),module_number);
SWIG_TypeClientData(SWIGTYPE_p_Xapian__BM25Weight,&le_swig__p_Xapian__BM25Weight);
le_swig__p_Xapian__Stem=zend_register_list_destructors_ex(_wrap_destroy_p_Xapian__Stem,NULL,(char *)(SWIGTYPE_p_Xapian__Stem->name),module_number);
SWIG_TypeClientData(SWIGTYPE_p_Xapian__Stem,&le_swig__p_Xapian__Stem);
le_swig__p_feature_flag=zend_register_list_destructors_ex(_wrap_destroy_p_feature_flag,NULL,(char *)(SWIGTYPE_p_feature_flag->name),module_number);
SWIG_TypeClientData(SWIGTYPE_p_feature_flag,&le_swig__p_feature_flag);
le_swig__p_compaction_level=zend_register_list_destructors_ex(_wrap_destroy_p_compaction_level,NULL,(char *)(SWIGTYPE_p_compaction_level->name),module_number);
SWIG_TypeClientData(SWIGTYPE_p_compaction_level,&le_swig__p_compaction_level);
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_Xapian__MSet=zend_register_list_destructors_ex(_wrap_destroy_p_Xapian__MSet,NULL,(char *)(SWIGTYPE_p_Xapian__MSet->name),module_number);
SWIG_TypeClientData(SWIGTYPE_p_Xapian__MSet,&le_swig__p_Xapian__MSet);
le_swig__p_Xapian__ESet=zend_register_list_destructors_ex(_wrap_destroy_p_Xapian__ESet,NULL,(char *)(SWIGTYPE_p_Xapian__ESet->name),module_number);
SWIG_TypeClientData(SWIGTYPE_p_Xapian__ESet,&le_swig__p_Xapian__ESet);
le_swig__p_Xapian__Database=zend_register_list_destructors_ex(_wrap_destroy_p_Xapian__Database,NULL,(char *)(SWIGTYPE_p_Xapian__Database->name),module_number);
SWIG_TypeClientData(SWIGTYPE_p_Xapian__Database,&le_swig__p_Xapian__Database);
le_swig__p_Xapian__MatchSpy=zend_register_list_destructors_ex(_wrap_destroy_p_Xapian__MatchSpy,NULL,(char *)(SWIGTYPE_p_Xapian__MatchSpy->name),module_number);
SWIG_TypeClientData(SWIGTYPE_p_Xapian__MatchSpy,&le_swig__p_Xapian__MatchSpy);
le_swig__p_Xapian__ValueRangeProcessor=zend_register_list_destructors_ex(_wrap_destroy_p_Xapian__ValueRangeProcessor,NULL,(char *)(SWIGTYPE_p_Xapian__ValueRangeProcessor->name),module_number);
SWIG_TypeClientData(SWIGTYPE_p_Xapian__ValueRangeProcessor,&le_swig__p_Xapian__ValueRangeProcessor);
le_swig__p_Xapian__StringValueRangeProcessor=zend_register_list_destructors_ex(_wrap_destroy_p_Xapian__StringValueRangeProcessor,NULL,(char *)(SWIGTYPE_p_Xapian__StringValueRangeProcessor->name),module_number);
SWIG_TypeClientData(SWIGTYPE_p_Xapian__StringValueRangeProcessor,&le_swig__p_Xapian__StringValueRangeProcessor);
le_swig__p_Xapian__ValueCountMatchSpy=zend_register_list_destructors_ex(_wrap_destroy_p_Xapian__ValueCountMatchSpy,NULL,(char *)(SWIGTYPE_p_Xapian__ValueCountMatchSpy->name),module_number);
SWIG_TypeClientData(SWIGTYPE_p_Xapian__ValueCountMatchSpy,&le_swig__p_Xapian__ValueCountMatchSpy);
le_swig__p_Xapian__WritableDatabase=zend_register_list_destructors_ex(_wrap_destroy_p_Xapian__WritableDatabase,NULL,(char *)(SWIGTYPE_p_Xapian__WritableDatabase->name),module_number);
SWIG_TypeClientData(SWIGTYPE_p_Xapian__WritableDatabase,&le_swig__p_Xapian__WritableDatabase);
le_swig__p_Xapian__DateValueRangeProcessor=zend_register_list_destructors_ex(_wrap_destroy_p_Xapian__DateValueRangeProcessor,NULL,(char *)(SWIGTYPE_p_Xapian__DateValueRangeProcessor->name),module_number);
SWIG_TypeClientData(SWIGTYPE_p_Xapian__DateValueRangeProcessor,&le_swig__p_Xapian__DateValueRangeProcessor);
le_swig__p_Xapian__NumberValueRangeProcessor=zend_register_list_destructors_ex(_wrap_destroy_p_Xapian__NumberValueRangeProcessor,NULL,(char *)(SWIGTYPE_p_Xapian__NumberValueRangeProcessor->name),module_number);
SWIG_TypeClientData(SWIGTYPE_p_Xapian__NumberValueRangeProcessor,&le_swig__p_Xapian__NumberValueRangeProcessor);
CG(active_class_entry) = NULL;
/* end oinit subsection */

/* cinit subsection */
SWIG_LONG_CONSTANT(Enquire_ASCENDING, Xapian::Enquire::ASCENDING);
SWIG_LONG_CONSTANT(Enquire_DESCENDING, Xapian::Enquire::DESCENDING);
SWIG_LONG_CONSTANT(Enquire_DONT_CARE, Xapian::Enquire::DONT_CARE);
SWIG_LONG_CONSTANT(Enquire_INCLUDE_QUERY_TERMS, Xapian::Enquire::INCLUDE_QUERY_TERMS);
SWIG_LONG_CONSTANT(Enquire_USE_EXACT_TERMFREQ, Xapian::Enquire::USE_EXACT_TERMFREQ);
SWIG_LONG_CONSTANT(DB_CREATE_OR_OPEN, Xapian::DB_CREATE_OR_OPEN);
SWIG_LONG_CONSTANT(DB_CREATE, Xapian::DB_CREATE);
SWIG_LONG_CONSTANT(DB_CREATE_OR_OVERWRITE, Xapian::DB_CREATE_OR_OVERWRITE);
SWIG_LONG_CONSTANT(DB_OPEN, Xapian::DB_OPEN);
SWIG_LONG_CONSTANT(Query_OP_AND, Xapian::Query::OP_AND);
SWIG_LONG_CONSTANT(Query_OP_OR, Xapian::Query::OP_OR);
SWIG_LONG_CONSTANT(Query_OP_AND_NOT, Xapian::Query::OP_AND_NOT);
SWIG_LONG_CONSTANT(Query_OP_XOR, Xapian::Query::OP_XOR);
SWIG_LONG_CONSTANT(Query_OP_AND_MAYBE, Xapian::Query::OP_AND_MAYBE);
SWIG_LONG_CONSTANT(Query_OP_FILTER, Xapian::Query::OP_FILTER);
SWIG_LONG_CONSTANT(Query_OP_NEAR, Xapian::Query::OP_NEAR);
SWIG_LONG_CONSTANT(Query_OP_PHRASE, Xapian::Query::OP_PHRASE);
SWIG_LONG_CONSTANT(Query_OP_VALUE_RANGE, Xapian::Query::OP_VALUE_RANGE);
SWIG_LONG_CONSTANT(Query_OP_SCALE_WEIGHT, Xapian::Query::OP_SCALE_WEIGHT);
SWIG_LONG_CONSTANT(Query_OP_ELITE_SET, Xapian::Query::OP_ELITE_SET);
SWIG_LONG_CONSTANT(Query_OP_VALUE_GE, Xapian::Query::OP_VALUE_GE);
SWIG_LONG_CONSTANT(Query_OP_VALUE_LE, Xapian::Query::OP_VALUE_LE);
SWIG_LONG_CONSTANT(Query_OP_SYNONYM, Xapian::Query::OP_SYNONYM);
SWIG_LONG_CONSTANT(QueryParser_FLAG_BOOLEAN, Xapian::QueryParser::FLAG_BOOLEAN);
SWIG_LONG_CONSTANT(QueryParser_FLAG_PHRASE, Xapian::QueryParser::FLAG_PHRASE);
SWIG_LONG_CONSTANT(QueryParser_FLAG_LOVEHATE, Xapian::QueryParser::FLAG_LOVEHATE);
SWIG_LONG_CONSTANT(QueryParser_FLAG_BOOLEAN_ANY_CASE, Xapian::QueryParser::FLAG_BOOLEAN_ANY_CASE);
SWIG_LONG_CONSTANT(QueryParser_FLAG_WILDCARD, Xapian::QueryParser::FLAG_WILDCARD);
SWIG_LONG_CONSTANT(QueryParser_FLAG_PURE_NOT, Xapian::QueryParser::FLAG_PURE_NOT);
SWIG_LONG_CONSTANT(QueryParser_FLAG_PARTIAL, Xapian::QueryParser::FLAG_PARTIAL);
SWIG_LONG_CONSTANT(QueryParser_FLAG_SPELLING_CORRECTION, Xapian::QueryParser::FLAG_SPELLING_CORRECTION);
SWIG_LONG_CONSTANT(QueryParser_FLAG_SYNONYM, Xapian::QueryParser::FLAG_SYNONYM);
SWIG_LONG_CONSTANT(QueryParser_FLAG_AUTO_SYNONYMS, Xapian::QueryParser::FLAG_AUTO_SYNONYMS);
SWIG_LONG_CONSTANT(QueryParser_FLAG_AUTO_MULTIWORD_SYNONYMS, Xapian::QueryParser::FLAG_AUTO_MULTIWORD_SYNONYMS);
SWIG_LONG_CONSTANT(QueryParser_FLAG_DEFAULT, Xapian::QueryParser::FLAG_DEFAULT);
SWIG_LONG_CONSTANT(QueryParser_STEM_NONE, Xapian::QueryParser::STEM_NONE);
SWIG_LONG_CONSTANT(QueryParser_STEM_SOME, Xapian::QueryParser::STEM_SOME);
SWIG_LONG_CONSTANT(QueryParser_STEM_ALL, Xapian::QueryParser::STEM_ALL);
SWIG_LONG_CONSTANT(TermGenerator_FLAG_SPELLING, Xapian::TermGenerator::FLAG_SPELLING);
SWIG_LONG_CONSTANT(Compactor_STANDARD, Xapian::Compactor::STANDARD);
SWIG_LONG_CONSTANT(Compactor_FULL, Xapian::Compactor::FULL);
SWIG_LONG_CONSTANT(Compactor_FULLER, Xapian::Compactor::FULLER);
/* end cinit subsection */

    return SUCCESS;
}

PHP_RINIT_FUNCTION(xapian)
{
/* rinit section */

/* vinit subsection */
{
  zval *z_var;
  MAKE_STD_ZVAL(z_var);
  z_var->type = IS_LONG;
  z_var->value.lval = Xapian::BAD_VALUENO;
  zend_hash_add(&EG(symbol_table), (char*)"Xapian::BAD_VALUENO", sizeof("Xapian::BAD_VALUENO"), (void *)&z_var, sizeof(zval *), NULL);
}
/* end vinit subsection */

    return SUCCESS;
}

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

PHP_RSHUTDOWN_FUNCTION(xapian)
{
/* rshutdown section */

    return SUCCESS;
}

PHP_MINFO_FUNCTION(xapian)
{

    const char * linked_version = Xapian::version_string();
    php_info_print_table_start();
    php_info_print_table_row(2, "Xapian Support", "enabled");
    php_info_print_table_row(2, "Xapian Compiled Version",
			     XAPIAN_BINDINGS_VERSION);
    php_info_print_table_row(2, "Xapian Linked Version", linked_version);
    php_info_print_table_end();

}
/* end init section */
