Logo Search packages:      
Sourcecode: xapian-bindings version File versions  Download package

xapian_wrap.cc

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


#ifdef __cplusplus
template<class T> class SwigValueWrapper {
    T *tt;
public:
    SwigValueWrapper() : tt(0) { }
    SwigValueWrapper(const SwigValueWrapper<T>& rhs) : tt(new T(*rhs.tt)) { }
    SwigValueWrapper(const T& t) : tt(new T(t)) { }
    ~SwigValueWrapper() { delete tt; } 
    SwigValueWrapper& operator=(const T& t) { delete tt; tt = new T(t); return *this; }
    operator T&() const { return *tt; }
    T *operator&() { return tt; }
private:
    SwigValueWrapper& operator=(const SwigValueWrapper<T>& rhs);
};
#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)
#   if (__SUNPRO_CC <= 0x560)
#     define SWIGTEMPLATEDISAMBIGUATOR template
#   else
#     define SWIGTEMPLATEDISAMBIGUATOR 
#   endif
# 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 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

/* -----------------------------------------------------------------------------
 * swigrun.swg
 *
 * This file contains generic CAPI 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 "3"

/* 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 is strictly necessary, ie, if you have problems
  with your compiler or so.
*/

#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

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


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

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

   Now you can be more explicit as:

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

   that seems to be the same, 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
   requires also to SWIG_ConvertPtr to return new result values, 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 *);
typedef struct swig_type_info *(*swig_dycast_func)(void **);

/* Structure to store inforomation 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 (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;
}


/* think of this as a c++ template<> or a scheme macro */
#define SWIG_TypeCheck_Template(comparison, ty)         \
  if (ty) {                                             \
    swig_cast_info *iter = ty->cast;                    \
    while (iter) {                                      \
      if (comparison) {                                 \
        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

/*
  Check the typename
*/
SWIGRUNTIME swig_cast_info *
SWIG_TypeCheck(const char *c, swig_type_info *ty) {
  SWIG_TypeCheck_Template(strcmp(iter->type->name, c) == 0, ty);
}

/* Same as previous function, except strcmp is replaced with a pointer comparison */
SWIGRUNTIME swig_cast_info *
SWIG_TypeCheckStruct(swig_type_info *from, swig_type_info *into) {
  SWIG_TypeCheck_Template(iter->type == from, into);
}

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

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

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

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

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

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

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

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

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

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

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

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

#ifdef __cplusplus
}
#endif

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

#ifdef __cplusplus
extern "C" {
#endif
#include "zend.h"
#include "zend_API.h"
#include "php.h"

/* 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 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_Php4_GetModule()
#define SWIG_SetModule(clientdata, pointer) SWIG_Php4_SetModule(pointer)

/* used to wrap returned objects in so we know whether they are newobject
   and need freeing, or not */
typedef struct _swig_object_wrapper {
  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)

static void
SWIG_ZTS_SetPointerZval(zval *z, void *ptr, swig_type_info *type, int newobject TSRMLS_DC) {
  swig_object_wrapper *value=NULL;
  /*
   * First test for Null pointers.  Return those as PHP native NULL
   */
  if (!ptr ) {
    ZVAL_NULL(z);
    return;
  }
  if (type->clientdata) {
    if (! (*(int *)(type->clientdata)))
      zend_error(E_ERROR, "Type: %s failed to register with zend",type->name);
    value=(swig_object_wrapper *)emalloc(sizeof(swig_object_wrapper));
    value->ptr=ptr;
    value->newobject=newobject;
    ZEND_REGISTER_RESOURCE(z, value, *(int *)(type->clientdata));
    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;

  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) return NULL;
  return SWIG_TypeCast(tc, p);
}

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

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

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

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

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

  switch (z->type) {
    case IS_OBJECT: {
      zval ** _cPtr;
      if (zend_hash_find(HASH_OF(z),"_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_Php4_GetModule() {
  zval *pointer;
  swig_module_info *ret = 0;

  MAKE_STD_ZVAL(pointer);

  TSRMLS_FETCH();

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

static void SWIG_Php4_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__Database swig_types[3]
#define SWIGTYPE_p_Xapian__Document swig_types[4]
#define SWIGTYPE_p_Xapian__ESet swig_types[5]
#define SWIGTYPE_p_Xapian__ESetIterator swig_types[6]
#define SWIGTYPE_p_Xapian__Enquire swig_types[7]
#define SWIGTYPE_p_Xapian__ExpandDecider swig_types[8]
#define SWIGTYPE_p_Xapian__MSet swig_types[9]
#define SWIGTYPE_p_Xapian__MSetIterator swig_types[10]
#define SWIGTYPE_p_Xapian__MatchDecider swig_types[11]
#define SWIGTYPE_p_Xapian__PositionIterator swig_types[12]
#define SWIGTYPE_p_Xapian__PostingIterator swig_types[13]
#define SWIGTYPE_p_Xapian__Query swig_types[14]
#define SWIGTYPE_p_Xapian__QueryParser swig_types[15]
#define SWIGTYPE_p_Xapian__RSet swig_types[16]
#define SWIGTYPE_p_Xapian__SimpleStopper swig_types[17]
#define SWIGTYPE_p_Xapian__Stem swig_types[18]
#define SWIGTYPE_p_Xapian__Stopper swig_types[19]
#define SWIGTYPE_p_Xapian__TermIterator swig_types[20]
#define SWIGTYPE_p_Xapian__TradWeight swig_types[21]
#define SWIGTYPE_p_Xapian__ValueIterator swig_types[22]
#define SWIGTYPE_p_Xapian__Weight swig_types[23]
#define SWIGTYPE_p_Xapian__WritableDatabase swig_types[24]
#define SWIGTYPE_p_docid_order swig_types[25]
#define SWIGTYPE_p_double swig_types[26]
#define SWIGTYPE_p_feature_flag swig_types[27]
#define SWIGTYPE_p_int swig_types[28]
#define SWIGTYPE_p_stem_strategy swig_types[29]
#define SWIGTYPE_p_time_t swig_types[30]
#define SWIGTYPE_p_unsigned_int swig_types[31]
static swig_type_info *swig_types[33];
static swig_module_info swig_module = {swig_types, 32, 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 */
/*
  +----------------------------------------------------------------------+
  | PHP version 4.0                                                      |
  +----------------------------------------------------------------------+
  | Copyright (c) 1997, 1998, 1999, 2000, 2001 The PHP Group             |
  +----------------------------------------------------------------------+
  | This source file is subject to version 2.02 of the PHP license,      |
  | that is bundled with this package in the file LICENSE, and is        |
  | available at through the world-wide-web at                           |
  | http://www.php.net/license/2_02.txt.                                 |
  | If you did not receive a copy of the PHP license and are unable to   |
  | obtain it through the world-wide-web, please send a note to          |
  | license@php.net so we can mail you a copy immediately.               |
  +----------------------------------------------------------------------+
  | Authors:                                                             |
  |                                                                      |
  +----------------------------------------------------------------------+
 */
ZEND_BEGIN_MODULE_GLOBALS(xapian)
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

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


/* 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 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
#include <xapian.h>
#include <string>
#include <vector>

using namespace std;

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

#ifndef XAPIAN_HAS_FLINT_BACKEND
    namespace Flint {
      static Database open() {
          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_MUSCAT36_BACKEND
    namespace Muscat36 {
      static Database open_da(const string &, const string &, bool = true) {
          throw FeatureUnavailableError("Muscat36 backend not supported");
      }
      static Database open_da(const string &, const string &, const string &, bool = true) {
          throw FeatureUnavailableError("Muscat36 backend not supported");
      }
      static Database open_db(const string &, size_t = 30) {
          throw FeatureUnavailableError("Muscat36 backend not supported");
      }
      static Database open_db(const string &, const string &, size_t = 30) {
          throw FeatureUnavailableError("Muscat36 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
# define SWIG_exception(code, msg) { zend_throw_exception(NULL, msg, code TSRMLS_CC); }
#endif


#include <stdexcept>


#include <string>


#include <vector>
#include <algorithm>
#include <stdexcept>


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


#include <utility>


/* php4/util.i: custom PHP typemaps for xapian-bindings
 *
 * Copyright (C) 2004,2005,2006 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
 */

/* We need to ensure that this is defined so that the module produced
 * exports get_module() and can be loaded by PHP. */
#ifndef COMPILE_DL_XAPIAN
#define COMPILE_DL_XAPIAN 1
#endif

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


# if PHP_MAJOR_VERSION-0 >= 5
#  include <zend_exceptions.h>
// zend_throw_exception takes a non-const char * parameter (sigh).
// FIXME: throw errors as PHP classes corresponding to the Xapian error
// classes.
#  define XapianException(TYPE, MSG) \
      zend_throw_exception(NULL, (char*)(MSG).c_str(), (TYPE) TSRMLS_CC)
# endif


#ifndef XapianException
# define XapianException(TYPE, MSG) SWIG_exception((TYPE), (MSG).c_str())
#endif

static int XapianExceptionHandler(string & msg) {
    try {
      // Rethrow so we can look at the exception if it was a Xapian::Error.
      throw;
    } catch (const Xapian::Error &e) {
      msg = e.get_type();
      msg += ": ";
      msg += e.get_msg();


#if PHP_MAJOR_VERSION-0 < 5
      try {
          // Re-rethrow the previous exception so we can handle the type in a
          // fine-grained way, but only in one place to avoid bloating the
          // file.
          throw;
      } catch (const Xapian::RangeError &e) {
          // FIXME: RangeError DatabaseError and NetworkError are all
          // subclasses of RuntimeError - how should we handle those for
          // PHP4?
          return SWIG_UnknownError;
      } catch (const Xapian::DatabaseError &) {
          return SWIG_UnknownError;
      } catch (const Xapian::NetworkError &) {
          return SWIG_UnknownError;
      } catch (const Xapian::RuntimeError &) {
          return SWIG_RuntimeError;
      } catch (...) {
          return SWIG_UnknownError;
      }
#endif


    } catch (const char * str) {
      /* QueryParser failed to parse the query. */
      msg = "QueryParserError: ";
      msg += str;
      return SWIG_RuntimeError;
    } catch (...) {
      msg = "unknown error in Xapian";
    }
    return SWIG_UnknownError;
}

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;
      }
static int _wrap_propset_XapianPositionIterator(zend_property_reference *property_reference, pval *value);
static int _propset_XapianPositionIterator(zend_property_reference *property_reference, pval *value);
static pval _wrap_propget_XapianPositionIterator(zend_property_reference *property_reference);
static int _propget_XapianPositionIterator(zend_property_reference *property_reference, pval *value);
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;
      }
static int _wrap_propset_XapianPostingIterator(zend_property_reference *property_reference, pval *value);
static int _propset_XapianPostingIterator(zend_property_reference *property_reference, pval *value);
static pval _wrap_propget_XapianPostingIterator(zend_property_reference *property_reference);
static int _propget_XapianPostingIterator(zend_property_reference *property_reference, pval *value);
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;
      }
static int _wrap_propset_XapianTermIterator(zend_property_reference *property_reference, pval *value);
static int _propset_XapianTermIterator(zend_property_reference *property_reference, pval *value);
static pval _wrap_propget_XapianTermIterator(zend_property_reference *property_reference);
static int _propget_XapianTermIterator(zend_property_reference *property_reference, pval *value);
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;
      }
static int _wrap_propset_XapianValueIterator(zend_property_reference *property_reference, pval *value);
static int _propset_XapianValueIterator(zend_property_reference *property_reference, pval *value);
static pval _wrap_propget_XapianValueIterator(zend_property_reference *property_reference);
static int _propget_XapianValueIterator(zend_property_reference *property_reference, pval *value);
static int _wrap_propset_XapianDocument(zend_property_reference *property_reference, pval *value);
static int _propset_XapianDocument(zend_property_reference *property_reference, pval *value);
static pval _wrap_propget_XapianDocument(zend_property_reference *property_reference);
static int _propget_XapianDocument(zend_property_reference *property_reference, pval *value);
SWIGINTERN bool Xapian_MSet_is_empty(Xapian::MSet const *self){ return self->empty(); }
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_MSet_get_document_id(Xapian::MSet const *self,Xapian::doccount i){
          return *((*self)[i]);
      }
static int _wrap_propset_XapianMSet(zend_property_reference *property_reference, pval *value);
static int _propset_XapianMSet(zend_property_reference *property_reference, pval *value);
static pval _wrap_propget_XapianMSet(zend_property_reference *property_reference);
static int _propget_XapianMSet(zend_property_reference *property_reference, pval *value);
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;
      }
static int _wrap_propset_XapianMSetIterator(zend_property_reference *property_reference, pval *value);
static int _propset_XapianMSetIterator(zend_property_reference *property_reference, pval *value);
static pval _wrap_propget_XapianMSetIterator(zend_property_reference *property_reference);
static int _propget_XapianMSetIterator(zend_property_reference *property_reference, pval *value);
SWIGINTERN bool Xapian_ESet_is_empty(Xapian::ESet const *self){ return self->empty(); }
static int _wrap_propset_XapianESet(zend_property_reference *property_reference, pval *value);
static int _propset_XapianESet(zend_property_reference *property_reference, pval *value);
static pval _wrap_propget_XapianESet(zend_property_reference *property_reference);
static int _propget_XapianESet(zend_property_reference *property_reference, pval *value);
SWIGINTERN std::string Xapian_ESetIterator_get_termname(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;
      }
static int _wrap_propset_XapianESetIterator(zend_property_reference *property_reference, pval *value);
static int _propset_XapianESetIterator(zend_property_reference *property_reference, pval *value);
static pval _wrap_propget_XapianESetIterator(zend_property_reference *property_reference);
static int _propget_XapianESetIterator(zend_property_reference *property_reference, pval *value);
SWIGINTERN bool Xapian_RSet_is_empty(Xapian::RSet const *self){ return self->empty(); }
static int _wrap_propset_XapianRSet(zend_property_reference *property_reference, pval *value);
static int _propset_XapianRSet(zend_property_reference *property_reference, pval *value);
static pval _wrap_propget_XapianRSet(zend_property_reference *property_reference);
static int _propget_XapianRSet(zend_property_reference *property_reference, pval *value);
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));
      }
static int _wrap_propset_XapianEnquire(zend_property_reference *property_reference, pval *value);
static int _propset_XapianEnquire(zend_property_reference *property_reference, pval *value);
static pval _wrap_propget_XapianEnquire(zend_property_reference *property_reference);
static int _propget_XapianEnquire(zend_property_reference *property_reference, pval *value);
static int _wrap_propset_XapianWeight(zend_property_reference *property_reference, pval *value);
static int _propset_XapianWeight(zend_property_reference *property_reference, pval *value);
static pval _wrap_propget_XapianWeight(zend_property_reference *property_reference);
static int _propget_XapianWeight(zend_property_reference *property_reference, pval *value);
static int _wrap_propset_XapianBoolWeight(zend_property_reference *property_reference, pval *value);
static int _propset_XapianBoolWeight(zend_property_reference *property_reference, pval *value);
static pval _wrap_propget_XapianBoolWeight(zend_property_reference *property_reference);
static int _propget_XapianBoolWeight(zend_property_reference *property_reference, pval *value);
static int _wrap_propset_XapianBM25Weight(zend_property_reference *property_reference, pval *value);
static int _propset_XapianBM25Weight(zend_property_reference *property_reference, pval *value);
static pval _wrap_propget_XapianBM25Weight(zend_property_reference *property_reference);
static int _propget_XapianBM25Weight(zend_property_reference *property_reference, pval *value);
static int _wrap_propset_XapianTradWeight(zend_property_reference *property_reference, pval *value);
static int _propset_XapianTradWeight(zend_property_reference *property_reference, pval *value);
static pval _wrap_propget_XapianTradWeight(zend_property_reference *property_reference);
static int _propget_XapianTradWeight(zend_property_reference *property_reference, pval *value);
static int _wrap_propset_XapianDatabase(zend_property_reference *property_reference, pval *value);
static int _propset_XapianDatabase(zend_property_reference *property_reference, pval *value);
static pval _wrap_propget_XapianDatabase(zend_property_reference *property_reference);
static int _propget_XapianDatabase(zend_property_reference *property_reference, pval *value);
static int _wrap_propset_XapianWritableDatabase(zend_property_reference *property_reference, pval *value);
static int _propset_XapianWritableDatabase(zend_property_reference *property_reference, pval *value);
static pval _wrap_propget_XapianWritableDatabase(zend_property_reference *property_reference);
static int _propget_XapianWritableDatabase(zend_property_reference *property_reference, pval *value);
SWIGINTERN Xapian::Query *new_Xapian_Query__SWIG_6(Xapian::Query::op op,std::vector<Xapian::Query > const &subqs,Xapian::termcount param=0){
            return new Xapian::Query(op, subqs.begin(), subqs.end(), param);
          }
static int _wrap_propset_XapianQuery(zend_property_reference *property_reference, pval *value);
static int _propset_XapianQuery(zend_property_reference *property_reference, pval *value);
static pval _wrap_propget_XapianQuery(zend_property_reference *property_reference);
static int _propget_XapianQuery(zend_property_reference *property_reference, pval *value);
static int _wrap_propset_XapianStopper(zend_property_reference *property_reference, pval *value);
static int _propset_XapianStopper(zend_property_reference *property_reference, pval *value);
static pval _wrap_propget_XapianStopper(zend_property_reference *property_reference);
static int _propget_XapianStopper(zend_property_reference *property_reference, pval *value);
static int _wrap_propset_XapianSimpleStopper(zend_property_reference *property_reference, pval *value);
static int _propset_XapianSimpleStopper(zend_property_reference *property_reference, pval *value);
static pval _wrap_propget_XapianSimpleStopper(zend_property_reference *property_reference);
static int _propget_XapianSimpleStopper(zend_property_reference *property_reference, pval *value);
static int _wrap_propset_XapianQueryParser(zend_property_reference *property_reference, pval *value);
static int _propset_XapianQueryParser(zend_property_reference *property_reference, pval *value);
static pval _wrap_propget_XapianQueryParser(zend_property_reference *property_reference);
static int _propget_XapianQueryParser(zend_property_reference *property_reference, pval *value);
static int _wrap_propset_XapianStem(zend_property_reference *property_reference, pval *value);
static int _propset_XapianStem(zend_property_reference *property_reference, pval *value);
static pval _wrap_propget_XapianStem(zend_property_reference *property_reference);
static int _propget_XapianStem(zend_property_reference *property_reference, pval *value);

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

static void *_p_Xapian__BoolWeightTo_p_Xapian__Weight(void *x) {
    return (void *)((Xapian::Weight *)  ((Xapian::BoolWeight *) x));
}
static void *_p_Xapian__TradWeightTo_p_Xapian__Weight(void *x) {
    return (void *)((Xapian::Weight *)  ((Xapian::TradWeight *) x));
}
static void *_p_Xapian__BM25WeightTo_p_Xapian__Weight(void *x) {
    return (void *)((Xapian::Weight *)  ((Xapian::BM25Weight *) x));
}
static void *_p_Xapian__SimpleStopperTo_p_Xapian__Stopper(void *x) {
    return (void *)((Xapian::Stopper *)  ((Xapian::SimpleStopper *) x));
}
static void *_p_Xapian__WritableDatabaseTo_p_Xapian__Database(void *x) {
    return (void *)((Xapian::Database *)  ((Xapian::WritableDatabase *) 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__Database = {"_p_Xapian__Database", "Xapian::Database *", 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__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__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__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__SimpleStopper = {"_p_Xapian__SimpleStopper", "Xapian::SimpleStopper *", 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__Stopper = {"_p_Xapian__Stopper", "Xapian::Stopper *", 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__ValueIterator = {"_p_Xapian__ValueIterator", "Xapian::ValueIterator *", 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_docid_order = {"_p_docid_order", "docid_order *", 0, 0, (void*)0, 0};
static swig_type_info _swigt__p_double = {"_p_double", "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::percent *", 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_time_t = {"_p_time_t", "time_t *", 0, 0, (void*)0, 0};
static swig_type_info _swigt__p_unsigned_int = {"_p_unsigned_int", "unsigned int *|Xapian::timeout *", 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__Database,
  &_swigt__p_Xapian__Document,
  &_swigt__p_Xapian__ESet,
  &_swigt__p_Xapian__ESetIterator,
  &_swigt__p_Xapian__Enquire,
  &_swigt__p_Xapian__ExpandDecider,
  &_swigt__p_Xapian__MSet,
  &_swigt__p_Xapian__MSetIterator,
  &_swigt__p_Xapian__MatchDecider,
  &_swigt__p_Xapian__PositionIterator,
  &_swigt__p_Xapian__PostingIterator,
  &_swigt__p_Xapian__Query,
  &_swigt__p_Xapian__QueryParser,
  &_swigt__p_Xapian__RSet,
  &_swigt__p_Xapian__SimpleStopper,
  &_swigt__p_Xapian__Stem,
  &_swigt__p_Xapian__Stopper,
  &_swigt__p_Xapian__TermIterator,
  &_swigt__p_Xapian__TradWeight,
  &_swigt__p_Xapian__ValueIterator,
  &_swigt__p_Xapian__Weight,
  &_swigt__p_Xapian__WritableDatabase,
  &_swigt__p_docid_order,
  &_swigt__p_double,
  &_swigt__p_feature_flag,
  &_swigt__p_int,
  &_swigt__p_stem_strategy,
  &_swigt__p_time_t,
  &_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__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__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__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},{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__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__SimpleStopper[] = {  {&_swigt__p_Xapian__SimpleStopper, 0, 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__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__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__ValueIterator[] = {  {&_swigt__p_Xapian__ValueIterator, 0, 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_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_stem_strategy[] = {  {&_swigt__p_stem_strategy, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_time_t[] = {  {&_swigt__p_time_t, 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__Database,
  _swigc__p_Xapian__Document,
  _swigc__p_Xapian__ESet,
  _swigc__p_Xapian__ESetIterator,
  _swigc__p_Xapian__Enquire,
  _swigc__p_Xapian__ExpandDecider,
  _swigc__p_Xapian__MSet,
  _swigc__p_Xapian__MSetIterator,
  _swigc__p_Xapian__MatchDecider,
  _swigc__p_Xapian__PositionIterator,
  _swigc__p_Xapian__PostingIterator,
  _swigc__p_Xapian__Query,
  _swigc__p_Xapian__QueryParser,
  _swigc__p_Xapian__RSet,
  _swigc__p_Xapian__SimpleStopper,
  _swigc__p_Xapian__Stem,
  _swigc__p_Xapian__Stopper,
  _swigc__p_Xapian__TermIterator,
  _swigc__p_Xapian__TradWeight,
  _swigc__p_Xapian__ValueIterator,
  _swigc__p_Xapian__Weight,
  _swigc__p_Xapian__WritableDatabase,
  _swigc__p_docid_order,
  _swigc__p_double,
  _swigc__p_feature_flag,
  _swigc__p_int,
  _swigc__p_stem_strategy,
  _swigc__p_time_t,
  _swigc__p_unsigned_int,
};


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

/* end header section */
/* vdecl subsection */
static zend_class_entry ce_swig_XapianPositionIterator;
static zend_class_entry* ptr_ce_swig_XapianPositionIterator=NULL;
static zend_class_entry ce_swig_XapianPostingIterator;
static zend_class_entry* ptr_ce_swig_XapianPostingIterator=NULL;
static zend_class_entry ce_swig_XapianTermIterator;
static zend_class_entry* ptr_ce_swig_XapianTermIterator=NULL;
static zend_class_entry ce_swig_XapianValueIterator;
static zend_class_entry* ptr_ce_swig_XapianValueIterator=NULL;
static zend_class_entry ce_swig_XapianDocument;
static zend_class_entry* ptr_ce_swig_XapianDocument=NULL;
static zend_class_entry ce_swig_XapianMSet;
static zend_class_entry* ptr_ce_swig_XapianMSet=NULL;
static zend_class_entry ce_swig_XapianMSetIterator;
static zend_class_entry* ptr_ce_swig_XapianMSetIterator=NULL;
static zend_class_entry ce_swig_XapianESet;
static zend_class_entry* ptr_ce_swig_XapianESet=NULL;
static zend_class_entry ce_swig_XapianESetIterator;
static zend_class_entry* ptr_ce_swig_XapianESetIterator=NULL;
static zend_class_entry ce_swig_XapianRSet;
static zend_class_entry* ptr_ce_swig_XapianRSet=NULL;
static zend_class_entry ce_swig_XapianEnquire;
static zend_class_entry* ptr_ce_swig_XapianEnquire=NULL;
static zend_class_entry ce_swig_XapianWeight;
static zend_class_entry* ptr_ce_swig_XapianWeight=NULL;
static zend_class_entry ce_swig_XapianBoolWeight;
static zend_class_entry* ptr_ce_swig_XapianBoolWeight=NULL;
static zend_class_entry ce_swig_XapianBM25Weight;
static zend_class_entry* ptr_ce_swig_XapianBM25Weight=NULL;
static zend_class_entry ce_swig_XapianTradWeight;
static zend_class_entry* ptr_ce_swig_XapianTradWeight=NULL;
static zend_class_entry ce_swig_XapianDatabase;
static zend_class_entry* ptr_ce_swig_XapianDatabase=NULL;
static zend_class_entry ce_swig_XapianWritableDatabase;
static zend_class_entry* ptr_ce_swig_XapianWritableDatabase=NULL;
static zend_class_entry ce_swig_XapianQuery;
static zend_class_entry* ptr_ce_swig_XapianQuery=NULL;
static zend_class_entry ce_swig_XapianStopper;
static zend_class_entry* ptr_ce_swig_XapianStopper=NULL;
static zend_class_entry ce_swig_XapianSimpleStopper;
static zend_class_entry* ptr_ce_swig_XapianSimpleStopper=NULL;
static zend_class_entry ce_swig_XapianQueryParser;
static zend_class_entry* ptr_ce_swig_XapianQueryParser=NULL;
static zend_class_entry ce_swig_XapianStem;
static zend_class_entry* ptr_ce_swig_XapianStem=NULL;
static int le_swig__p_Xapian__ESet=0; /* handle for XapianESet */
static int le_swig__p_double=0; /* handle for _p_double */
static int le_swig__p_Xapian__Enquire=0; /* handle for XapianEnquire */
static int le_swig__p_Xapian__BoolWeight=0; /* handle for XapianBoolWeight */
static int le_swig__p_Xapian__TradWeight=0; /* handle for XapianTradWeight */
static int le_swig__p_Xapian__QueryParser=0; /* handle for XapianQueryParser */
static int le_swig__p_Xapian__MSet=0; /* handle for XapianMSet */
static int le_swig__p_Xapian__Stopper=0; /* handle for XapianStopper */
static int le_swig__p_time_t=0; /* handle for _p_time_t */
static int le_swig__p_Xapian__SimpleStopper=0; /* handle for XapianSimpleStopper */
static int le_swig__p_unsigned_int=0; /* handle for _p_unsigned_int */
static int le_swig__p_stem_strategy=0; /* handle for _p_stem_strategy */
static int le_swig__p_Xapian__MatchDecider=0; /* handle for _p_Xapian__MatchDecider */
static int le_swig__p_Xapian__ExpandDecider=0; /* handle for _p_Xapian__ExpandDecider */
static int le_swig__p_Xapian__Query=0; /* handle for XapianQuery */
static int le_swig__p_Xapian__Database=0; /* handle for XapianDatabase */
static int le_swig__p_Xapian__WritableDatabase=0; /* handle for XapianWritableDatabase */
static int le_swig__p_Xapian__Document=0; /* handle for XapianDocument */
static int le_swig__p_docid_order=0; /* handle for _p_docid_order */
static int le_swig__p_feature_flag=0; /* handle for _p_feature_flag */
static int le_swig__p_Xapian__Stem=0; /* handle for XapianStem */
static int le_swig__int=0; /* handle for _int */
static int le_swig__p_int=0; /* handle for _p_int */
static int le_swig__p_Xapian__Weight=0; /* handle for XapianWeight */
static int le_swig__p_Xapian__MSetIterator=0; /* handle for XapianMSetIterator */
static int le_swig__p_Xapian__ValueIterator=0; /* handle for XapianValueIterator */
static int le_swig__p_Xapian__TermIterator=0; /* handle for XapianTermIterator */
static int le_swig__p_Xapian__PostingIterator=0; /* handle for XapianPostingIterator */
static int le_swig__p_Xapian__PositionIterator=0; /* handle for XapianPositionIterator */
static int le_swig__p_Xapian__ESetIterator=0; /* handle for XapianESetIterator */
static int le_swig__p_Xapian__RSet=0; /* handle for XapianRSet */
static int le_swig__p_Xapian__BM25Weight=0; /* handle for XapianBM25Weight */
/* end vdecl subsection */
/* wrapper section */
ZEND_NAMED_FUNCTION(_wrap_xapian_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,result, 1);
    }
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_xapian_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(),SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_xapian_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(),SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_xapian_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(),SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_new_XapianPositionIterator__SWIG_0) {
  Xapian::PositionIterator *result = 0 ;
  
  SWIG_ResetError();
  /* NATIVE Constructor */
  if(ZEND_NUM_ARGS() != 0) {
    WRONG_PARAM_COUNT;
  }
  
  {
    try {
      result = (Xapian::PositionIterator *)new Xapian::PositionIterator();
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      
#if PHP_MAJOR_VERSION-0 < 5
      if (code == SWIG_RuntimeError) {
        zend_error(E_WARNING, const_cast<char *>(msg.c_str()));
        /* FIXME: destructors don't have return_value to set. */
        // ZVAL_NULL(return_value);
        return;
      }
#endif
      
      XapianException(code, msg);
    }
  }
  {
    SWIG_SetPointerZval(return_value, (void *)result, SWIGTYPE_p_Xapian__PositionIterator, 1);
  }
  /* Wrap this return value */
  if (this_ptr) {
    /* NATIVE Constructor, use this_ptr */
    zval *_cPtr; MAKE_STD_ZVAL(_cPtr);
    *_cPtr = *return_value;
    INIT_ZVAL(*return_value);
    add_property_zval(this_ptr,"_cPtr",_cPtr);
  } else if (! this_ptr) {
    /* ALTERNATIVE Constructor, make an object wrapper */
    zval *obj, *_cPtr;
    MAKE_STD_ZVAL(obj);
    MAKE_STD_ZVAL(_cPtr);
    *_cPtr = *return_value;
    INIT_ZVAL(*return_value);
    object_init_ex(obj,ptr_ce_swig_XapianPositionIterator);
    add_property_zval(obj,"_cPtr",_cPtr);
    *return_value=*obj;
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_new_XapianPositionIterator__SWIG_1) {
  Xapian::PositionIterator *arg1 = 0 ;
  Xapian::PositionIterator *result = 0 ;
  zval **args[1];
  
  SWIG_ResetError();
  /* NATIVE Constructor */
  if(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_XapianPositionIterator. Expected SWIGTYPE_p_Xapian__PositionIterator");
    }
  }
  {
    try {
      result = (Xapian::PositionIterator *)new Xapian::PositionIterator((Xapian::PositionIterator const &)*arg1);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      
#if PHP_MAJOR_VERSION-0 < 5
      if (code == SWIG_RuntimeError) {
        zend_error(E_WARNING, const_cast<char *>(msg.c_str()));
        /* FIXME: destructors don't have return_value to set. */
        // ZVAL_NULL(return_value);
        return;
      }
#endif
      
      XapianException(code, msg);
    }
  }
  {
    SWIG_SetPointerZval(return_value, (void *)result, SWIGTYPE_p_Xapian__PositionIterator, 1);
  }
  /* Wrap this return value */
  if (this_ptr) {
    /* NATIVE Constructor, use this_ptr */
    zval *_cPtr; MAKE_STD_ZVAL(_cPtr);
    *_cPtr = *return_value;
    INIT_ZVAL(*return_value);
    add_property_zval(this_ptr,"_cPtr",_cPtr);
  } else if (! this_ptr) {
    /* ALTERNATIVE Constructor, make an object wrapper */
    zval *obj, *_cPtr;
    MAKE_STD_ZVAL(obj);
    MAKE_STD_ZVAL(_cPtr);
    *_cPtr = *return_value;
    INIT_ZVAL(*return_value);
    object_init_ex(obj,ptr_ce_swig_XapianPositionIterator);
    add_property_zval(obj,"_cPtr",_cPtr);
    *return_value=*obj;
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_new_XapianPositionIterator) {
  int argc;
  zval **argv[1];
  
  argc = ZEND_NUM_ARGS();
  zend_get_parameters_array_ex(argc,argv);
  if (argc == 0) {
    return _wrap_new_XapianPositionIterator__SWIG_0(INTERNAL_FUNCTION_PARAM_PASSTHRU);
  }
  if (argc == 1) {
    int _v;
    {
      void *ptr;
      _v = (SWIG_ConvertPtr(*argv[0], (void **)&ptr, SWIGTYPE_p_Xapian__PositionIterator, 0) == 0);
    }
    if (_v) {
      return _wrap_new_XapianPositionIterator__SWIG_1(INTERNAL_FUNCTION_PARAM_PASSTHRU);
    }
  }
  
  SWIG_ErrorCode() = E_ERROR;
  SWIG_ErrorMsg() = "No matching function for overloaded 'new_XapianPositionIterator'";
  zend_error(SWIG_ErrorCode(),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_XapianPositionIterator(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 (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      
#if PHP_MAJOR_VERSION-0 < 5
      if (code == SWIG_RuntimeError) {
        zend_error(E_WARNING, const_cast<char *>(msg.c_str()));
        /* FIXME: destructors don't have return_value to set. */
        // ZVAL_NULL(return_value);
        return;
      }
#endif
      
      XapianException(code, msg);
    }
  }
}


ZEND_NAMED_FUNCTION(_wrap_XapianPositionIterator_get_termpos) {
  Xapian::PositionIterator *arg1 = (Xapian::PositionIterator *) 0 ;
  Xapian::termpos result;
  
  SWIG_ResetError();
  /* This function uses a this_ptr*/
  if(ZEND_NUM_ARGS() != 0) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*&this_ptr, (void **) &arg1, SWIGTYPE_p_Xapian__PositionIterator, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of XapianPositionIterator_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 (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      
#if PHP_MAJOR_VERSION-0 < 5
      if (code == SWIG_RuntimeError) {
        zend_error(E_WARNING, const_cast<char *>(msg.c_str()));
        /* FIXME: destructors don't have return_value to set. */
        // ZVAL_NULL(return_value);
        return;
      }
#endif
      
      XapianException(code, msg);
    }
  }
  {
    ZVAL_LONG(return_value,result);
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_XapianPositionIterator_next) {
  Xapian::PositionIterator *arg1 = (Xapian::PositionIterator *) 0 ;
  
  SWIG_ResetError();
  /* This function uses a this_ptr*/
  if(ZEND_NUM_ARGS() != 0) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*&this_ptr, (void **) &arg1, SWIGTYPE_p_Xapian__PositionIterator, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of XapianPositionIterator_next. Expected SWIGTYPE_p_Xapian__PositionIterator");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    try {
      Xapian_PositionIterator_next(arg1);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      
#if PHP_MAJOR_VERSION-0 < 5
      if (code == SWIG_RuntimeError) {
        zend_error(E_WARNING, const_cast<char *>(msg.c_str()));
        /* FIXME: destructors don't have return_value to set. */
        // ZVAL_NULL(return_value);
        return;
      }
#endif
      
      XapianException(code, msg);
    }
  }
  
  return;
fail:
  zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_XapianPositionIterator_equals) {
  Xapian::PositionIterator *arg1 = (Xapian::PositionIterator *) 0 ;
  Xapian::PositionIterator *arg2 = 0 ;
  bool result;
  zval **args[1];
  
  SWIG_ResetError();
  /* This function uses a this_ptr*/
  if(ZEND_NUM_ARGS() != 1 || zend_get_parameters_array_ex(1, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*&this_ptr, (void **) &arg1, SWIGTYPE_p_Xapian__PositionIterator, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of XapianPositionIterator_equals. Expected SWIGTYPE_p_Xapian__PositionIterator");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    if (SWIG_ConvertPtr(*args[0], (void**)&arg2, SWIGTYPE_p_Xapian__PositionIterator, 0) < 0 || arg2 == NULL) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 2 of XapianPositionIterator_equals. Expected SWIGTYPE_p_Xapian__PositionIterator");
    }
  }
  {
    try {
      result = (bool)Xapian_PositionIterator_equals((Xapian::PositionIterator const *)arg1,(Xapian::PositionIterator const &)*arg2);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      
#if PHP_MAJOR_VERSION-0 < 5
      if (code == SWIG_RuntimeError) {
        zend_error(E_WARNING, const_cast<char *>(msg.c_str()));
        /* FIXME: destructors don't have return_value to set. */
        // ZVAL_NULL(return_value);
        return;
      }
#endif
      
      XapianException(code, msg);
    }
  }
  {
    ZVAL_BOOL(return_value,(result)?1:0);
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_XapianPositionIterator_skip_to) {
  Xapian::PositionIterator *arg1 = (Xapian::PositionIterator *) 0 ;
  Xapian::termpos arg2 ;
  zval **args[1];
  
  SWIG_ResetError();
  /* This function uses a this_ptr*/
  if(ZEND_NUM_ARGS() != 1 || zend_get_parameters_array_ex(1, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*&this_ptr, (void **) &arg1, SWIGTYPE_p_Xapian__PositionIterator, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of XapianPositionIterator_skip_to. Expected SWIGTYPE_p_Xapian__PositionIterator");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    /*@SWIG:CONVERT_INT_IN@*/
    convert_to_long_ex(args[0]);
    arg2 = (Xapian::termpos) Z_LVAL_PP(args[0]);
    /*@SWIG@*/;
  }
  {
    try {
      (arg1)->skip_to(arg2);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      
#if PHP_MAJOR_VERSION-0 < 5
      if (code == SWIG_RuntimeError) {
        zend_error(E_WARNING, const_cast<char *>(msg.c_str()));
        /* FIXME: destructors don't have return_value to set. */
        // ZVAL_NULL(return_value);
        return;
      }
#endif
      
      XapianException(code, msg);
    }
  }
  
  return;
fail:
  zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_XapianPositionIterator_get_description) {
  Xapian::PositionIterator *arg1 = (Xapian::PositionIterator *) 0 ;
  std::string result;
  
  SWIG_ResetError();
  /* This function uses a this_ptr*/
  if(ZEND_NUM_ARGS() != 0) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*&this_ptr, (void **) &arg1, SWIGTYPE_p_Xapian__PositionIterator, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of XapianPositionIterator_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 (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      
#if PHP_MAJOR_VERSION-0 < 5
      if (code == SWIG_RuntimeError) {
        zend_error(E_WARNING, const_cast<char *>(msg.c_str()));
        /* FIXME: destructors don't have return_value to set. */
        // ZVAL_NULL(return_value);
        return;
      }
#endif
      
      XapianException(code, msg);
    }
  }
  {
    ZVAL_STRINGL(return_value,const_cast<char*>((&result)->data()),(&result)->length(),1);
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg());
}


/* property handler for class XapianPositionIterator */
static pval _wrap_propget_XapianPositionIterator(zend_property_reference *property_reference) {
  pval result;
  pval **_result;
  zend_llist_element *element = property_reference->elements_list->head;
  zend_overloaded_element *property=(zend_overloaded_element *)element->data;
  result.type = IS_NULL;
  if (_propget_XapianPositionIterator(property_reference, &result)==SUCCESS) return result;
  /* return it ourselves */
  if (zend_hash_find(Z_OBJPROP_P(property_reference->object),Z_STRVAL_P(&(property->element)),1+Z_STRLEN_P(&(property->element)),(void**)&_result)==SUCCESS) {
  zval *_value;
  MAKE_STD_ZVAL(_value);  *_value=**_result;
  INIT_PZVAL(_value);
  zval_copy_ctor(_value);
  return *_value;
  }
  result.type = IS_NULL;
  return result;
}
static int _propget_XapianPositionIterator(zend_property_reference *property_reference, pval *value) {
  /* get the property name */
  zend_llist_element *element = property_reference->elements_list->head;
  zend_overloaded_element *property=(zend_overloaded_element *)element->data;
  char *propname=Z_STRVAL_P(&(property->element));
  return FAILURE;
}

static int _wrap_propset_XapianPositionIterator(zend_property_reference *property_reference, pval *value) { 
  zval * _value;
  zend_llist_element *element = property_reference->elements_list->head;
  zend_overloaded_element *property=(zend_overloaded_element *)element->data;
  if (_propset_XapianPositionIterator(property_reference, value)==SUCCESS) return SUCCESS;
  /* set it ourselves as it is XapianPositionIterator */
  MAKE_STD_ZVAL(_value);
  *_value=*value;
  INIT_PZVAL(_value);
  zval_copy_ctor(_value);
  return add_property_zval_ex(property_reference->object,Z_STRVAL_P(&(property->element)),1+Z_STRLEN_P(&(property->element)),_value);
}
static int _propset_XapianPositionIterator(zend_property_reference *property_reference, pval *value) {
  /* get the property name */
  zend_llist_element *element = property_reference->elements_list->head;
  zend_overloaded_element *property=(zend_overloaded_element *)element->data;
  char *propname=Z_STRVAL_P(&(property->element));
  return FAILURE;
}

ZEND_NAMED_FUNCTION(_wrap_new_XapianPostingIterator__SWIG_0) {
  Xapian::PostingIterator *result = 0 ;
  
  SWIG_ResetError();
  /* NATIVE Constructor */
  if(ZEND_NUM_ARGS() != 0) {
    WRONG_PARAM_COUNT;
  }
  
  {
    try {
      result = (Xapian::PostingIterator *)new Xapian::PostingIterator();
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      
#if PHP_MAJOR_VERSION-0 < 5
      if (code == SWIG_RuntimeError) {
        zend_error(E_WARNING, const_cast<char *>(msg.c_str()));
        /* FIXME: destructors don't have return_value to set. */
        // ZVAL_NULL(return_value);
        return;
      }
#endif
      
      XapianException(code, msg);
    }
  }
  {
    SWIG_SetPointerZval(return_value, (void *)result, SWIGTYPE_p_Xapian__PostingIterator, 1);
  }
  /* Wrap this return value */
  if (this_ptr) {
    /* NATIVE Constructor, use this_ptr */
    zval *_cPtr; MAKE_STD_ZVAL(_cPtr);
    *_cPtr = *return_value;
    INIT_ZVAL(*return_value);
    add_property_zval(this_ptr,"_cPtr",_cPtr);
  } else if (! this_ptr) {
    /* ALTERNATIVE Constructor, make an object wrapper */
    zval *obj, *_cPtr;
    MAKE_STD_ZVAL(obj);
    MAKE_STD_ZVAL(_cPtr);
    *_cPtr = *return_value;
    INIT_ZVAL(*return_value);
    object_init_ex(obj,ptr_ce_swig_XapianPostingIterator);
    add_property_zval(obj,"_cPtr",_cPtr);
    *return_value=*obj;
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_new_XapianPostingIterator__SWIG_1) {
  Xapian::PostingIterator *arg1 = 0 ;
  Xapian::PostingIterator *result = 0 ;
  zval **args[1];
  
  SWIG_ResetError();
  /* NATIVE Constructor */
  if(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_XapianPostingIterator. Expected SWIGTYPE_p_Xapian__PostingIterator");
    }
  }
  {
    try {
      result = (Xapian::PostingIterator *)new Xapian::PostingIterator((Xapian::PostingIterator const &)*arg1);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      
#if PHP_MAJOR_VERSION-0 < 5
      if (code == SWIG_RuntimeError) {
        zend_error(E_WARNING, const_cast<char *>(msg.c_str()));
        /* FIXME: destructors don't have return_value to set. */
        // ZVAL_NULL(return_value);
        return;
      }
#endif
      
      XapianException(code, msg);
    }
  }
  {
    SWIG_SetPointerZval(return_value, (void *)result, SWIGTYPE_p_Xapian__PostingIterator, 1);
  }
  /* Wrap this return value */
  if (this_ptr) {
    /* NATIVE Constructor, use this_ptr */
    zval *_cPtr; MAKE_STD_ZVAL(_cPtr);
    *_cPtr = *return_value;
    INIT_ZVAL(*return_value);
    add_property_zval(this_ptr,"_cPtr",_cPtr);
  } else if (! this_ptr) {
    /* ALTERNATIVE Constructor, make an object wrapper */
    zval *obj, *_cPtr;
    MAKE_STD_ZVAL(obj);
    MAKE_STD_ZVAL(_cPtr);
    *_cPtr = *return_value;
    INIT_ZVAL(*return_value);
    object_init_ex(obj,ptr_ce_swig_XapianPostingIterator);
    add_property_zval(obj,"_cPtr",_cPtr);
    *return_value=*obj;
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_new_XapianPostingIterator) {
  int argc;
  zval **argv[1];
  
  argc = ZEND_NUM_ARGS();
  zend_get_parameters_array_ex(argc,argv);
  if (argc == 0) {
    return _wrap_new_XapianPostingIterator__SWIG_0(INTERNAL_FUNCTION_PARAM_PASSTHRU);
  }
  if (argc == 1) {
    int _v;
    {
      void *ptr;
      _v = (SWIG_ConvertPtr(*argv[0], (void **)&ptr, SWIGTYPE_p_Xapian__PostingIterator, 0) == 0);
    }
    if (_v) {
      return _wrap_new_XapianPostingIterator__SWIG_1(INTERNAL_FUNCTION_PARAM_PASSTHRU);
    }
  }
  
  SWIG_ErrorCode() = E_ERROR;
  SWIG_ErrorMsg() = "No matching function for overloaded 'new_XapianPostingIterator'";
  zend_error(SWIG_ErrorCode(),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_XapianPostingIterator(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 (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      
#if PHP_MAJOR_VERSION-0 < 5
      if (code == SWIG_RuntimeError) {
        zend_error(E_WARNING, const_cast<char *>(msg.c_str()));
        /* FIXME: destructors don't have return_value to set. */
        // ZVAL_NULL(return_value);
        return;
      }
#endif
      
      XapianException(code, msg);
    }
  }
}


ZEND_NAMED_FUNCTION(_wrap_XapianPostingIterator_get_docid) {
  Xapian::PostingIterator *arg1 = (Xapian::PostingIterator *) 0 ;
  Xapian::docid result;
  
  SWIG_ResetError();
  /* This function uses a this_ptr*/
  if(ZEND_NUM_ARGS() != 0) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*&this_ptr, (void **) &arg1, SWIGTYPE_p_Xapian__PostingIterator, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of XapianPostingIterator_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 (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      
#if PHP_MAJOR_VERSION-0 < 5
      if (code == SWIG_RuntimeError) {
        zend_error(E_WARNING, const_cast<char *>(msg.c_str()));
        /* FIXME: destructors don't have return_value to set. */
        // ZVAL_NULL(return_value);
        return;
      }
#endif
      
      XapianException(code, msg);
    }
  }
  {
    ZVAL_LONG(return_value,result);
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_XapianPostingIterator_next) {
  Xapian::PostingIterator *arg1 = (Xapian::PostingIterator *) 0 ;
  
  SWIG_ResetError();
  /* This function uses a this_ptr*/
  if(ZEND_NUM_ARGS() != 0) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*&this_ptr, (void **) &arg1, SWIGTYPE_p_Xapian__PostingIterator, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of XapianPostingIterator_next. Expected SWIGTYPE_p_Xapian__PostingIterator");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    try {
      Xapian_PostingIterator_next(arg1);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      
#if PHP_MAJOR_VERSION-0 < 5
      if (code == SWIG_RuntimeError) {
        zend_error(E_WARNING, const_cast<char *>(msg.c_str()));
        /* FIXME: destructors don't have return_value to set. */
        // ZVAL_NULL(return_value);
        return;
      }
#endif
      
      XapianException(code, msg);
    }
  }
  
  return;
fail:
  zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_XapianPostingIterator_equals) {
  Xapian::PostingIterator *arg1 = (Xapian::PostingIterator *) 0 ;
  Xapian::PostingIterator *arg2 = 0 ;
  bool result;
  zval **args[1];
  
  SWIG_ResetError();
  /* This function uses a this_ptr*/
  if(ZEND_NUM_ARGS() != 1 || zend_get_parameters_array_ex(1, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*&this_ptr, (void **) &arg1, SWIGTYPE_p_Xapian__PostingIterator, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of XapianPostingIterator_equals. Expected SWIGTYPE_p_Xapian__PostingIterator");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    if (SWIG_ConvertPtr(*args[0], (void**)&arg2, SWIGTYPE_p_Xapian__PostingIterator, 0) < 0 || arg2 == NULL) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 2 of XapianPostingIterator_equals. Expected SWIGTYPE_p_Xapian__PostingIterator");
    }
  }
  {
    try {
      result = (bool)Xapian_PostingIterator_equals((Xapian::PostingIterator const *)arg1,(Xapian::PostingIterator const &)*arg2);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      
#if PHP_MAJOR_VERSION-0 < 5
      if (code == SWIG_RuntimeError) {
        zend_error(E_WARNING, const_cast<char *>(msg.c_str()));
        /* FIXME: destructors don't have return_value to set. */
        // ZVAL_NULL(return_value);
        return;
      }
#endif
      
      XapianException(code, msg);
    }
  }
  {
    ZVAL_BOOL(return_value,(result)?1:0);
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_XapianPostingIterator_skip_to) {
  Xapian::PostingIterator *arg1 = (Xapian::PostingIterator *) 0 ;
  Xapian::docid arg2 ;
  zval **args[1];
  
  SWIG_ResetError();
  /* This function uses a this_ptr*/
  if(ZEND_NUM_ARGS() != 1 || zend_get_parameters_array_ex(1, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*&this_ptr, (void **) &arg1, SWIGTYPE_p_Xapian__PostingIterator, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of XapianPostingIterator_skip_to. Expected SWIGTYPE_p_Xapian__PostingIterator");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    /*@SWIG:CONVERT_INT_IN@*/
    convert_to_long_ex(args[0]);
    arg2 = (Xapian::docid) Z_LVAL_PP(args[0]);
    /*@SWIG@*/;
  }
  {
    try {
      (arg1)->skip_to(arg2);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      
#if PHP_MAJOR_VERSION-0 < 5
      if (code == SWIG_RuntimeError) {
        zend_error(E_WARNING, const_cast<char *>(msg.c_str()));
        /* FIXME: destructors don't have return_value to set. */
        // ZVAL_NULL(return_value);
        return;
      }
#endif
      
      XapianException(code, msg);
    }
  }
  
  return;
fail:
  zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_XapianPostingIterator_get_doclength) {
  Xapian::PostingIterator *arg1 = (Xapian::PostingIterator *) 0 ;
  Xapian::doclength result;
  
  SWIG_ResetError();
  /* This function uses a this_ptr*/
  if(ZEND_NUM_ARGS() != 0) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*&this_ptr, (void **) &arg1, SWIGTYPE_p_Xapian__PostingIterator, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of XapianPostingIterator_get_doclength. Expected SWIGTYPE_p_Xapian__PostingIterator");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    try {
      result = (Xapian::doclength)((Xapian::PostingIterator const *)arg1)->get_doclength();
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      
#if PHP_MAJOR_VERSION-0 < 5
      if (code == SWIG_RuntimeError) {
        zend_error(E_WARNING, const_cast<char *>(msg.c_str()));
        /* FIXME: destructors don't have return_value to set. */
        // ZVAL_NULL(return_value);
        return;
      }
#endif
      
      XapianException(code, msg);
    }
  }
  {
    ZVAL_DOUBLE(return_value,result);
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_XapianPostingIterator_get_wdf) {
  Xapian::PostingIterator *arg1 = (Xapian::PostingIterator *) 0 ;
  Xapian::termcount result;
  
  SWIG_ResetError();
  /* This function uses a this_ptr*/
  if(ZEND_NUM_ARGS() != 0) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*&this_ptr, (void **) &arg1, SWIGTYPE_p_Xapian__PostingIterator, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of XapianPostingIterator_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 (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      
#if PHP_MAJOR_VERSION-0 < 5
      if (code == SWIG_RuntimeError) {
        zend_error(E_WARNING, const_cast<char *>(msg.c_str()));
        /* FIXME: destructors don't have return_value to set. */
        // ZVAL_NULL(return_value);
        return;
      }
#endif
      
      XapianException(code, msg);
    }
  }
  {
    ZVAL_LONG(return_value,result);
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_XapianPostingIterator_positionlist_begin) {
  Xapian::PostingIterator *arg1 = (Xapian::PostingIterator *) 0 ;
  Xapian::PositionIterator result;
  
  SWIG_ResetError();
  /* This function uses a this_ptr*/
  if(ZEND_NUM_ARGS() != 0) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*&this_ptr, (void **) &arg1, SWIGTYPE_p_Xapian__PostingIterator, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of XapianPostingIterator_positionlist_begin. Expected SWIGTYPE_p_Xapian__PostingIterator");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    try {
      result = (arg1)->positionlist_begin();
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      
#if PHP_MAJOR_VERSION-0 < 5
      if (code == SWIG_RuntimeError) {
        zend_error(E_WARNING, const_cast<char *>(msg.c_str()));
        /* FIXME: destructors don't have return_value to set. */
        // ZVAL_NULL(return_value);
        return;
      }
#endif
      
      XapianException(code, msg);
    }
  }
  {
    Xapian::PositionIterator * resultobj = new Xapian::PositionIterator((Xapian::PositionIterator &) result);
    SWIG_SetPointerZval(return_value, (void *)resultobj, SWIGTYPE_p_Xapian__PositionIterator, 1);
  }
  /* Wrap this return value */
  {
    /* ALTERNATIVE Constructor, make an object wrapper */
    zval *obj, *_cPtr;
    MAKE_STD_ZVAL(obj);
    MAKE_STD_ZVAL(_cPtr);
    *_cPtr = *return_value;
    INIT_ZVAL(*return_value);
    object_init_ex(obj,ptr_ce_swig_XapianPositionIterator);
    add_property_zval(obj,"_cPtr",_cPtr);
    *return_value=*obj;
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_XapianPostingIterator_positionlist_end) {
  Xapian::PostingIterator *arg1 = (Xapian::PostingIterator *) 0 ;
  Xapian::PositionIterator result;
  
  SWIG_ResetError();
  /* This function uses a this_ptr*/
  if(ZEND_NUM_ARGS() != 0) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*&this_ptr, (void **) &arg1, SWIGTYPE_p_Xapian__PostingIterator, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of XapianPostingIterator_positionlist_end. Expected SWIGTYPE_p_Xapian__PostingIterator");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    try {
      result = (arg1)->positionlist_end();
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      
#if PHP_MAJOR_VERSION-0 < 5
      if (code == SWIG_RuntimeError) {
        zend_error(E_WARNING, const_cast<char *>(msg.c_str()));
        /* FIXME: destructors don't have return_value to set. */
        // ZVAL_NULL(return_value);
        return;
      }
#endif
      
      XapianException(code, msg);
    }
  }
  {
    Xapian::PositionIterator * resultobj = new Xapian::PositionIterator((Xapian::PositionIterator &) result);
    SWIG_SetPointerZval(return_value, (void *)resultobj, SWIGTYPE_p_Xapian__PositionIterator, 1);
  }
  /* Wrap this return value */
  {
    /* ALTERNATIVE Constructor, make an object wrapper */
    zval *obj, *_cPtr;
    MAKE_STD_ZVAL(obj);
    MAKE_STD_ZVAL(_cPtr);
    *_cPtr = *return_value;
    INIT_ZVAL(*return_value);
    object_init_ex(obj,ptr_ce_swig_XapianPositionIterator);
    add_property_zval(obj,"_cPtr",_cPtr);
    *return_value=*obj;
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_XapianPostingIterator_get_description) {
  Xapian::PostingIterator *arg1 = (Xapian::PostingIterator *) 0 ;
  std::string result;
  
  SWIG_ResetError();
  /* This function uses a this_ptr*/
  if(ZEND_NUM_ARGS() != 0) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*&this_ptr, (void **) &arg1, SWIGTYPE_p_Xapian__PostingIterator, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of XapianPostingIterator_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 (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      
#if PHP_MAJOR_VERSION-0 < 5
      if (code == SWIG_RuntimeError) {
        zend_error(E_WARNING, const_cast<char *>(msg.c_str()));
        /* FIXME: destructors don't have return_value to set. */
        // ZVAL_NULL(return_value);
        return;
      }
#endif
      
      XapianException(code, msg);
    }
  }
  {
    ZVAL_STRINGL(return_value,const_cast<char*>((&result)->data()),(&result)->length(),1);
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg());
}


/* property handler for class XapianPostingIterator */
static pval _wrap_propget_XapianPostingIterator(zend_property_reference *property_reference) {
  pval result;
  pval **_result;
  zend_llist_element *element = property_reference->elements_list->head;
  zend_overloaded_element *property=(zend_overloaded_element *)element->data;
  result.type = IS_NULL;
  if (_propget_XapianPostingIterator(property_reference, &result)==SUCCESS) return result;
  /* return it ourselves */
  if (zend_hash_find(Z_OBJPROP_P(property_reference->object),Z_STRVAL_P(&(property->element)),1+Z_STRLEN_P(&(property->element)),(void**)&_result)==SUCCESS) {
  zval *_value;
  MAKE_STD_ZVAL(_value);  *_value=**_result;
  INIT_PZVAL(_value);
  zval_copy_ctor(_value);
  return *_value;
  }
  result.type = IS_NULL;
  return result;
}
static int _propget_XapianPostingIterator(zend_property_reference *property_reference, pval *value) {
  /* get the property name */
  zend_llist_element *element = property_reference->elements_list->head;
  zend_overloaded_element *property=(zend_overloaded_element *)element->data;
  char *propname=Z_STRVAL_P(&(property->element));
  return FAILURE;
}

static int _wrap_propset_XapianPostingIterator(zend_property_reference *property_reference, pval *value) { 
  zval * _value;
  zend_llist_element *element = property_reference->elements_list->head;
  zend_overloaded_element *property=(zend_overloaded_element *)element->data;
  if (_propset_XapianPostingIterator(property_reference, value)==SUCCESS) return SUCCESS;
  /* set it ourselves as it is XapianPostingIterator */
  MAKE_STD_ZVAL(_value);
  *_value=*value;
  INIT_PZVAL(_value);
  zval_copy_ctor(_value);
  return add_property_zval_ex(property_reference->object,Z_STRVAL_P(&(property->element)),1+Z_STRLEN_P(&(property->element)),_value);
}
static int _propset_XapianPostingIterator(zend_property_reference *property_reference, pval *value) {
  /* get the property name */
  zend_llist_element *element = property_reference->elements_list->head;
  zend_overloaded_element *property=(zend_overloaded_element *)element->data;
  char *propname=Z_STRVAL_P(&(property->element));
  return FAILURE;
}

ZEND_NAMED_FUNCTION(_wrap_new_XapianTermIterator__SWIG_0) {
  Xapian::TermIterator *result = 0 ;
  
  SWIG_ResetError();
  /* NATIVE Constructor */
  if(ZEND_NUM_ARGS() != 0) {
    WRONG_PARAM_COUNT;
  }
  
  {
    try {
      result = (Xapian::TermIterator *)new Xapian::TermIterator();
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      
#if PHP_MAJOR_VERSION-0 < 5
      if (code == SWIG_RuntimeError) {
        zend_error(E_WARNING, const_cast<char *>(msg.c_str()));
        /* FIXME: destructors don't have return_value to set. */
        // ZVAL_NULL(return_value);
        return;
      }
#endif
      
      XapianException(code, msg);
    }
  }
  {
    SWIG_SetPointerZval(return_value, (void *)result, SWIGTYPE_p_Xapian__TermIterator, 1);
  }
  /* Wrap this return value */
  if (this_ptr) {
    /* NATIVE Constructor, use this_ptr */
    zval *_cPtr; MAKE_STD_ZVAL(_cPtr);
    *_cPtr = *return_value;
    INIT_ZVAL(*return_value);
    add_property_zval(this_ptr,"_cPtr",_cPtr);
  } else if (! this_ptr) {
    /* ALTERNATIVE Constructor, make an object wrapper */
    zval *obj, *_cPtr;
    MAKE_STD_ZVAL(obj);
    MAKE_STD_ZVAL(_cPtr);
    *_cPtr = *return_value;
    INIT_ZVAL(*return_value);
    object_init_ex(obj,ptr_ce_swig_XapianTermIterator);
    add_property_zval(obj,"_cPtr",_cPtr);
    *return_value=*obj;
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_new_XapianTermIterator__SWIG_1) {
  Xapian::TermIterator *arg1 = 0 ;
  Xapian::TermIterator *result = 0 ;
  zval **args[1];
  
  SWIG_ResetError();
  /* NATIVE Constructor */
  if(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_XapianTermIterator. Expected SWIGTYPE_p_Xapian__TermIterator");
    }
  }
  {
    try {
      result = (Xapian::TermIterator *)new Xapian::TermIterator((Xapian::TermIterator const &)*arg1);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      
#if PHP_MAJOR_VERSION-0 < 5
      if (code == SWIG_RuntimeError) {
        zend_error(E_WARNING, const_cast<char *>(msg.c_str()));
        /* FIXME: destructors don't have return_value to set. */
        // ZVAL_NULL(return_value);
        return;
      }
#endif
      
      XapianException(code, msg);
    }
  }
  {
    SWIG_SetPointerZval(return_value, (void *)result, SWIGTYPE_p_Xapian__TermIterator, 1);
  }
  /* Wrap this return value */
  if (this_ptr) {
    /* NATIVE Constructor, use this_ptr */
    zval *_cPtr; MAKE_STD_ZVAL(_cPtr);
    *_cPtr = *return_value;
    INIT_ZVAL(*return_value);
    add_property_zval(this_ptr,"_cPtr",_cPtr);
  } else if (! this_ptr) {
    /* ALTERNATIVE Constructor, make an object wrapper */
    zval *obj, *_cPtr;
    MAKE_STD_ZVAL(obj);
    MAKE_STD_ZVAL(_cPtr);
    *_cPtr = *return_value;
    INIT_ZVAL(*return_value);
    object_init_ex(obj,ptr_ce_swig_XapianTermIterator);
    add_property_zval(obj,"_cPtr",_cPtr);
    *return_value=*obj;
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_new_XapianTermIterator) {
  int argc;
  zval **argv[1];
  
  argc = ZEND_NUM_ARGS();
  zend_get_parameters_array_ex(argc,argv);
  if (argc == 0) {
    return _wrap_new_XapianTermIterator__SWIG_0(INTERNAL_FUNCTION_PARAM_PASSTHRU);
  }
  if (argc == 1) {
    int _v;
    {
      void *ptr;
      _v = (SWIG_ConvertPtr(*argv[0], (void **)&ptr, SWIGTYPE_p_Xapian__TermIterator, 0) == 0);
    }
    if (_v) {
      return _wrap_new_XapianTermIterator__SWIG_1(INTERNAL_FUNCTION_PARAM_PASSTHRU);
    }
  }
  
  SWIG_ErrorCode() = E_ERROR;
  SWIG_ErrorMsg() = "No matching function for overloaded 'new_XapianTermIterator'";
  zend_error(SWIG_ErrorCode(),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_XapianTermIterator(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 (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      
#if PHP_MAJOR_VERSION-0 < 5
      if (code == SWIG_RuntimeError) {
        zend_error(E_WARNING, const_cast<char *>(msg.c_str()));
        /* FIXME: destructors don't have return_value to set. */
        // ZVAL_NULL(return_value);
        return;
      }
#endif
      
      XapianException(code, msg);
    }
  }
}


ZEND_NAMED_FUNCTION(_wrap_XapianTermIterator_get_term) {
  Xapian::TermIterator *arg1 = (Xapian::TermIterator *) 0 ;
  std::string result;
  
  SWIG_ResetError();
  /* This function uses a this_ptr*/
  if(ZEND_NUM_ARGS() != 0) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*&this_ptr, (void **) &arg1, SWIGTYPE_p_Xapian__TermIterator, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of XapianTermIterator_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 (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      
#if PHP_MAJOR_VERSION-0 < 5
      if (code == SWIG_RuntimeError) {
        zend_error(E_WARNING, const_cast<char *>(msg.c_str()));
        /* FIXME: destructors don't have return_value to set. */
        // ZVAL_NULL(return_value);
        return;
      }
#endif
      
      XapianException(code, msg);
    }
  }
  {
    ZVAL_STRINGL(return_value,const_cast<char*>((&result)->data()),(&result)->length(),1);
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_XapianTermIterator_next) {
  Xapian::TermIterator *arg1 = (Xapian::TermIterator *) 0 ;
  
  SWIG_ResetError();
  /* This function uses a this_ptr*/
  if(ZEND_NUM_ARGS() != 0) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*&this_ptr, (void **) &arg1, SWIGTYPE_p_Xapian__TermIterator, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of XapianTermIterator_next. Expected SWIGTYPE_p_Xapian__TermIterator");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    try {
      Xapian_TermIterator_next(arg1);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      
#if PHP_MAJOR_VERSION-0 < 5
      if (code == SWIG_RuntimeError) {
        zend_error(E_WARNING, const_cast<char *>(msg.c_str()));
        /* FIXME: destructors don't have return_value to set. */
        // ZVAL_NULL(return_value);
        return;
      }
#endif
      
      XapianException(code, msg);
    }
  }
  
  return;
fail:
  zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_XapianTermIterator_equals) {
  Xapian::TermIterator *arg1 = (Xapian::TermIterator *) 0 ;
  Xapian::TermIterator *arg2 = 0 ;
  bool result;
  zval **args[1];
  
  SWIG_ResetError();
  /* This function uses a this_ptr*/
  if(ZEND_NUM_ARGS() != 1 || zend_get_parameters_array_ex(1, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*&this_ptr, (void **) &arg1, SWIGTYPE_p_Xapian__TermIterator, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of XapianTermIterator_equals. Expected SWIGTYPE_p_Xapian__TermIterator");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    if (SWIG_ConvertPtr(*args[0], (void**)&arg2, SWIGTYPE_p_Xapian__TermIterator, 0) < 0 || arg2 == NULL) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 2 of XapianTermIterator_equals. Expected SWIGTYPE_p_Xapian__TermIterator");
    }
  }
  {
    try {
      result = (bool)Xapian_TermIterator_equals((Xapian::TermIterator const *)arg1,(Xapian::TermIterator const &)*arg2);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      
#if PHP_MAJOR_VERSION-0 < 5
      if (code == SWIG_RuntimeError) {
        zend_error(E_WARNING, const_cast<char *>(msg.c_str()));
        /* FIXME: destructors don't have return_value to set. */
        // ZVAL_NULL(return_value);
        return;
      }
#endif
      
      XapianException(code, msg);
    }
  }
  {
    ZVAL_BOOL(return_value,(result)?1:0);
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_XapianTermIterator_skip_to) {
  Xapian::TermIterator *arg1 = (Xapian::TermIterator *) 0 ;
  std::string *arg2 = 0 ;
  std::string temp2 ;
  zval **args[1];
  
  SWIG_ResetError();
  /* This function uses a this_ptr*/
  if(ZEND_NUM_ARGS() != 1 || zend_get_parameters_array_ex(1, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*&this_ptr, (void **) &arg1, SWIGTYPE_p_Xapian__TermIterator, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of XapianTermIterator_skip_to. Expected SWIGTYPE_p_Xapian__TermIterator");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    convert_to_string_ex(args[0]);
    temp2.assign(Z_STRVAL_PP(args[0]), Z_STRLEN_PP(args[0]));
    arg2 = &temp2;
  }
  {
    try {
      (arg1)->skip_to((std::string const &)*arg2);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      
#if PHP_MAJOR_VERSION-0 < 5
      if (code == SWIG_RuntimeError) {
        zend_error(E_WARNING, const_cast<char *>(msg.c_str()));
        /* FIXME: destructors don't have return_value to set. */
        // ZVAL_NULL(return_value);
        return;
      }
#endif
      
      XapianException(code, msg);
    }
  }
  
  return;
fail:
  zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_XapianTermIterator_get_wdf) {
  Xapian::TermIterator *arg1 = (Xapian::TermIterator *) 0 ;
  Xapian::termcount result;
  
  SWIG_ResetError();
  /* This function uses a this_ptr*/
  if(ZEND_NUM_ARGS() != 0) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*&this_ptr, (void **) &arg1, SWIGTYPE_p_Xapian__TermIterator, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of XapianTermIterator_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 (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      
#if PHP_MAJOR_VERSION-0 < 5
      if (code == SWIG_RuntimeError) {
        zend_error(E_WARNING, const_cast<char *>(msg.c_str()));
        /* FIXME: destructors don't have return_value to set. */
        // ZVAL_NULL(return_value);
        return;
      }
#endif
      
      XapianException(code, msg);
    }
  }
  {
    ZVAL_LONG(return_value,result);
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_XapianTermIterator_get_termfreq) {
  Xapian::TermIterator *arg1 = (Xapian::TermIterator *) 0 ;
  Xapian::doccount result;
  
  SWIG_ResetError();
  /* This function uses a this_ptr*/
  if(ZEND_NUM_ARGS() != 0) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*&this_ptr, (void **) &arg1, SWIGTYPE_p_Xapian__TermIterator, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of XapianTermIterator_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 (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      
#if PHP_MAJOR_VERSION-0 < 5
      if (code == SWIG_RuntimeError) {
        zend_error(E_WARNING, const_cast<char *>(msg.c_str()));
        /* FIXME: destructors don't have return_value to set. */
        // ZVAL_NULL(return_value);
        return;
      }
#endif
      
      XapianException(code, msg);
    }
  }
  {
    ZVAL_LONG(return_value,result);
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_XapianTermIterator_positionlist_begin) {
  Xapian::TermIterator *arg1 = (Xapian::TermIterator *) 0 ;
  Xapian::PositionIterator result;
  
  SWIG_ResetError();
  /* This function uses a this_ptr*/
  if(ZEND_NUM_ARGS() != 0) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*&this_ptr, (void **) &arg1, SWIGTYPE_p_Xapian__TermIterator, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of XapianTermIterator_positionlist_begin. Expected SWIGTYPE_p_Xapian__TermIterator");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    try {
      result = (arg1)->positionlist_begin();
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      
#if PHP_MAJOR_VERSION-0 < 5
      if (code == SWIG_RuntimeError) {
        zend_error(E_WARNING, const_cast<char *>(msg.c_str()));
        /* FIXME: destructors don't have return_value to set. */
        // ZVAL_NULL(return_value);
        return;
      }
#endif
      
      XapianException(code, msg);
    }
  }
  {
    Xapian::PositionIterator * resultobj = new Xapian::PositionIterator((Xapian::PositionIterator &) result);
    SWIG_SetPointerZval(return_value, (void *)resultobj, SWIGTYPE_p_Xapian__PositionIterator, 1);
  }
  /* Wrap this return value */
  {
    /* ALTERNATIVE Constructor, make an object wrapper */
    zval *obj, *_cPtr;
    MAKE_STD_ZVAL(obj);
    MAKE_STD_ZVAL(_cPtr);
    *_cPtr = *return_value;
    INIT_ZVAL(*return_value);
    object_init_ex(obj,ptr_ce_swig_XapianPositionIterator);
    add_property_zval(obj,"_cPtr",_cPtr);
    *return_value=*obj;
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_XapianTermIterator_positionlist_end) {
  Xapian::TermIterator *arg1 = (Xapian::TermIterator *) 0 ;
  Xapian::PositionIterator result;
  
  SWIG_ResetError();
  /* This function uses a this_ptr*/
  if(ZEND_NUM_ARGS() != 0) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*&this_ptr, (void **) &arg1, SWIGTYPE_p_Xapian__TermIterator, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of XapianTermIterator_positionlist_end. Expected SWIGTYPE_p_Xapian__TermIterator");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    try {
      result = (arg1)->positionlist_end();
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      
#if PHP_MAJOR_VERSION-0 < 5
      if (code == SWIG_RuntimeError) {
        zend_error(E_WARNING, const_cast<char *>(msg.c_str()));
        /* FIXME: destructors don't have return_value to set. */
        // ZVAL_NULL(return_value);
        return;
      }
#endif
      
      XapianException(code, msg);
    }
  }
  {
    Xapian::PositionIterator * resultobj = new Xapian::PositionIterator((Xapian::PositionIterator &) result);
    SWIG_SetPointerZval(return_value, (void *)resultobj, SWIGTYPE_p_Xapian__PositionIterator, 1);
  }
  /* Wrap this return value */
  {
    /* ALTERNATIVE Constructor, make an object wrapper */
    zval *obj, *_cPtr;
    MAKE_STD_ZVAL(obj);
    MAKE_STD_ZVAL(_cPtr);
    *_cPtr = *return_value;
    INIT_ZVAL(*return_value);
    object_init_ex(obj,ptr_ce_swig_XapianPositionIterator);
    add_property_zval(obj,"_cPtr",_cPtr);
    *return_value=*obj;
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_XapianTermIterator_get_description) {
  Xapian::TermIterator *arg1 = (Xapian::TermIterator *) 0 ;
  std::string result;
  
  SWIG_ResetError();
  /* This function uses a this_ptr*/
  if(ZEND_NUM_ARGS() != 0) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*&this_ptr, (void **) &arg1, SWIGTYPE_p_Xapian__TermIterator, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of XapianTermIterator_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 (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      
#if PHP_MAJOR_VERSION-0 < 5
      if (code == SWIG_RuntimeError) {
        zend_error(E_WARNING, const_cast<char *>(msg.c_str()));
        /* FIXME: destructors don't have return_value to set. */
        // ZVAL_NULL(return_value);
        return;
      }
#endif
      
      XapianException(code, msg);
    }
  }
  {
    ZVAL_STRINGL(return_value,const_cast<char*>((&result)->data()),(&result)->length(),1);
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg());
}


/* property handler for class XapianTermIterator */
static pval _wrap_propget_XapianTermIterator(zend_property_reference *property_reference) {
  pval result;
  pval **_result;
  zend_llist_element *element = property_reference->elements_list->head;
  zend_overloaded_element *property=(zend_overloaded_element *)element->data;
  result.type = IS_NULL;
  if (_propget_XapianTermIterator(property_reference, &result)==SUCCESS) return result;
  /* return it ourselves */
  if (zend_hash_find(Z_OBJPROP_P(property_reference->object),Z_STRVAL_P(&(property->element)),1+Z_STRLEN_P(&(property->element)),(void**)&_result)==SUCCESS) {
  zval *_value;
  MAKE_STD_ZVAL(_value);  *_value=**_result;
  INIT_PZVAL(_value);
  zval_copy_ctor(_value);
  return *_value;
  }
  result.type = IS_NULL;
  return result;
}
static int _propget_XapianTermIterator(zend_property_reference *property_reference, pval *value) {
  /* get the property name */
  zend_llist_element *element = property_reference->elements_list->head;
  zend_overloaded_element *property=(zend_overloaded_element *)element->data;
  char *propname=Z_STRVAL_P(&(property->element));
  return FAILURE;
}

static int _wrap_propset_XapianTermIterator(zend_property_reference *property_reference, pval *value) { 
  zval * _value;
  zend_llist_element *element = property_reference->elements_list->head;
  zend_overloaded_element *property=(zend_overloaded_element *)element->data;
  if (_propset_XapianTermIterator(property_reference, value)==SUCCESS) return SUCCESS;
  /* set it ourselves as it is XapianTermIterator */
  MAKE_STD_ZVAL(_value);
  *_value=*value;
  INIT_PZVAL(_value);
  zval_copy_ctor(_value);
  return add_property_zval_ex(property_reference->object,Z_STRVAL_P(&(property->element)),1+Z_STRLEN_P(&(property->element)),_value);
}
static int _propset_XapianTermIterator(zend_property_reference *property_reference, pval *value) {
  /* get the property name */
  zend_llist_element *element = property_reference->elements_list->head;
  zend_overloaded_element *property=(zend_overloaded_element *)element->data;
  char *propname=Z_STRVAL_P(&(property->element));
  return FAILURE;
}

ZEND_NAMED_FUNCTION(_wrap_new_XapianValueIterator__SWIG_0) {
  Xapian::ValueIterator *result = 0 ;
  
  SWIG_ResetError();
  /* NATIVE Constructor */
  if(ZEND_NUM_ARGS() != 0) {
    WRONG_PARAM_COUNT;
  }
  
  {
    try {
      result = (Xapian::ValueIterator *)new Xapian::ValueIterator();
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      
#if PHP_MAJOR_VERSION-0 < 5
      if (code == SWIG_RuntimeError) {
        zend_error(E_WARNING, const_cast<char *>(msg.c_str()));
        /* FIXME: destructors don't have return_value to set. */
        // ZVAL_NULL(return_value);
        return;
      }
#endif
      
      XapianException(code, msg);
    }
  }
  {
    SWIG_SetPointerZval(return_value, (void *)result, SWIGTYPE_p_Xapian__ValueIterator, 1);
  }
  /* Wrap this return value */
  if (this_ptr) {
    /* NATIVE Constructor, use this_ptr */
    zval *_cPtr; MAKE_STD_ZVAL(_cPtr);
    *_cPtr = *return_value;
    INIT_ZVAL(*return_value);
    add_property_zval(this_ptr,"_cPtr",_cPtr);
  } else if (! this_ptr) {
    /* ALTERNATIVE Constructor, make an object wrapper */
    zval *obj, *_cPtr;
    MAKE_STD_ZVAL(obj);
    MAKE_STD_ZVAL(_cPtr);
    *_cPtr = *return_value;
    INIT_ZVAL(*return_value);
    object_init_ex(obj,ptr_ce_swig_XapianValueIterator);
    add_property_zval(obj,"_cPtr",_cPtr);
    *return_value=*obj;
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_new_XapianValueIterator__SWIG_1) {
  Xapian::ValueIterator *arg1 = 0 ;
  Xapian::ValueIterator *result = 0 ;
  zval **args[1];
  
  SWIG_ResetError();
  /* NATIVE Constructor */
  if(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_XapianValueIterator. Expected SWIGTYPE_p_Xapian__ValueIterator");
    }
  }
  {
    try {
      result = (Xapian::ValueIterator *)new Xapian::ValueIterator((Xapian::ValueIterator const &)*arg1);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      
#if PHP_MAJOR_VERSION-0 < 5
      if (code == SWIG_RuntimeError) {
        zend_error(E_WARNING, const_cast<char *>(msg.c_str()));
        /* FIXME: destructors don't have return_value to set. */
        // ZVAL_NULL(return_value);
        return;
      }
#endif
      
      XapianException(code, msg);
    }
  }
  {
    SWIG_SetPointerZval(return_value, (void *)result, SWIGTYPE_p_Xapian__ValueIterator, 1);
  }
  /* Wrap this return value */
  if (this_ptr) {
    /* NATIVE Constructor, use this_ptr */
    zval *_cPtr; MAKE_STD_ZVAL(_cPtr);
    *_cPtr = *return_value;
    INIT_ZVAL(*return_value);
    add_property_zval(this_ptr,"_cPtr",_cPtr);
  } else if (! this_ptr) {
    /* ALTERNATIVE Constructor, make an object wrapper */
    zval *obj, *_cPtr;
    MAKE_STD_ZVAL(obj);
    MAKE_STD_ZVAL(_cPtr);
    *_cPtr = *return_value;
    INIT_ZVAL(*return_value);
    object_init_ex(obj,ptr_ce_swig_XapianValueIterator);
    add_property_zval(obj,"_cPtr",_cPtr);
    *return_value=*obj;
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_new_XapianValueIterator) {
  int argc;
  zval **argv[1];
  
  argc = ZEND_NUM_ARGS();
  zend_get_parameters_array_ex(argc,argv);
  if (argc == 0) {
    return _wrap_new_XapianValueIterator__SWIG_0(INTERNAL_FUNCTION_PARAM_PASSTHRU);
  }
  if (argc == 1) {
    int _v;
    {
      void *ptr;
      _v = (SWIG_ConvertPtr(*argv[0], (void **)&ptr, SWIGTYPE_p_Xapian__ValueIterator, 0) == 0);
    }
    if (_v) {
      return _wrap_new_XapianValueIterator__SWIG_1(INTERNAL_FUNCTION_PARAM_PASSTHRU);
    }
  }
  
  SWIG_ErrorCode() = E_ERROR;
  SWIG_ErrorMsg() = "No matching function for overloaded 'new_XapianValueIterator'";
  zend_error(SWIG_ErrorCode(),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_XapianValueIterator(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 (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      
#if PHP_MAJOR_VERSION-0 < 5
      if (code == SWIG_RuntimeError) {
        zend_error(E_WARNING, const_cast<char *>(msg.c_str()));
        /* FIXME: destructors don't have return_value to set. */
        // ZVAL_NULL(return_value);
        return;
      }
#endif
      
      XapianException(code, msg);
    }
  }
}


ZEND_NAMED_FUNCTION(_wrap_XapianValueIterator_get_value) {
  Xapian::ValueIterator *arg1 = (Xapian::ValueIterator *) 0 ;
  std::string result;
  
  SWIG_ResetError();
  /* This function uses a this_ptr*/
  if(ZEND_NUM_ARGS() != 0) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*&this_ptr, (void **) &arg1, SWIGTYPE_p_Xapian__ValueIterator, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of XapianValueIterator_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 (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      
#if PHP_MAJOR_VERSION-0 < 5
      if (code == SWIG_RuntimeError) {
        zend_error(E_WARNING, const_cast<char *>(msg.c_str()));
        /* FIXME: destructors don't have return_value to set. */
        // ZVAL_NULL(return_value);
        return;
      }
#endif
      
      XapianException(code, msg);
    }
  }
  {
    ZVAL_STRINGL(return_value,const_cast<char*>((&result)->data()),(&result)->length(),1);
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_XapianValueIterator_next) {
  Xapian::ValueIterator *arg1 = (Xapian::ValueIterator *) 0 ;
  
  SWIG_ResetError();
  /* This function uses a this_ptr*/
  if(ZEND_NUM_ARGS() != 0) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*&this_ptr, (void **) &arg1, SWIGTYPE_p_Xapian__ValueIterator, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of XapianValueIterator_next. Expected SWIGTYPE_p_Xapian__ValueIterator");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    try {
      Xapian_ValueIterator_next(arg1);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      
#if PHP_MAJOR_VERSION-0 < 5
      if (code == SWIG_RuntimeError) {
        zend_error(E_WARNING, const_cast<char *>(msg.c_str()));
        /* FIXME: destructors don't have return_value to set. */
        // ZVAL_NULL(return_value);
        return;
      }
#endif
      
      XapianException(code, msg);
    }
  }
  
  return;
fail:
  zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_XapianValueIterator_equals) {
  Xapian::ValueIterator *arg1 = (Xapian::ValueIterator *) 0 ;
  Xapian::ValueIterator *arg2 = 0 ;
  bool result;
  zval **args[1];
  
  SWIG_ResetError();
  /* This function uses a this_ptr*/
  if(ZEND_NUM_ARGS() != 1 || zend_get_parameters_array_ex(1, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*&this_ptr, (void **) &arg1, SWIGTYPE_p_Xapian__ValueIterator, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of XapianValueIterator_equals. Expected SWIGTYPE_p_Xapian__ValueIterator");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    if (SWIG_ConvertPtr(*args[0], (void**)&arg2, SWIGTYPE_p_Xapian__ValueIterator, 0) < 0 || arg2 == NULL) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 2 of XapianValueIterator_equals. Expected SWIGTYPE_p_Xapian__ValueIterator");
    }
  }
  {
    try {
      result = (bool)Xapian_ValueIterator_equals((Xapian::ValueIterator const *)arg1,(Xapian::ValueIterator const &)*arg2);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      
#if PHP_MAJOR_VERSION-0 < 5
      if (code == SWIG_RuntimeError) {
        zend_error(E_WARNING, const_cast<char *>(msg.c_str()));
        /* FIXME: destructors don't have return_value to set. */
        // ZVAL_NULL(return_value);
        return;
      }
#endif
      
      XapianException(code, msg);
    }
  }
  {
    ZVAL_BOOL(return_value,(result)?1:0);
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_XapianValueIterator_get_valueno) {
  Xapian::ValueIterator *arg1 = (Xapian::ValueIterator *) 0 ;
  Xapian::valueno result;
  
  SWIG_ResetError();
  /* This function uses a this_ptr*/
  if(ZEND_NUM_ARGS() != 0) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*&this_ptr, (void **) &arg1, SWIGTYPE_p_Xapian__ValueIterator, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of XapianValueIterator_get_valueno. Expected SWIGTYPE_p_Xapian__ValueIterator");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    try {
      result = (Xapian::valueno)(arg1)->get_valueno();
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      
#if PHP_MAJOR_VERSION-0 < 5
      if (code == SWIG_RuntimeError) {
        zend_error(E_WARNING, const_cast<char *>(msg.c_str()));
        /* FIXME: destructors don't have return_value to set. */
        // ZVAL_NULL(return_value);
        return;
      }
#endif
      
      XapianException(code, msg);
    }
  }
  {
    ZVAL_LONG(return_value,result);
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_XapianValueIterator_get_description) {
  Xapian::ValueIterator *arg1 = (Xapian::ValueIterator *) 0 ;
  std::string result;
  
  SWIG_ResetError();
  /* This function uses a this_ptr*/
  if(ZEND_NUM_ARGS() != 0) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*&this_ptr, (void **) &arg1, SWIGTYPE_p_Xapian__ValueIterator, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of XapianValueIterator_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 (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      
#if PHP_MAJOR_VERSION-0 < 5
      if (code == SWIG_RuntimeError) {
        zend_error(E_WARNING, const_cast<char *>(msg.c_str()));
        /* FIXME: destructors don't have return_value to set. */
        // ZVAL_NULL(return_value);
        return;
      }
#endif
      
      XapianException(code, msg);
    }
  }
  {
    ZVAL_STRINGL(return_value,const_cast<char*>((&result)->data()),(&result)->length(),1);
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg());
}


/* property handler for class XapianValueIterator */
static pval _wrap_propget_XapianValueIterator(zend_property_reference *property_reference) {
  pval result;
  pval **_result;
  zend_llist_element *element = property_reference->elements_list->head;
  zend_overloaded_element *property=(zend_overloaded_element *)element->data;
  result.type = IS_NULL;
  if (_propget_XapianValueIterator(property_reference, &result)==SUCCESS) return result;
  /* return it ourselves */
  if (zend_hash_find(Z_OBJPROP_P(property_reference->object),Z_STRVAL_P(&(property->element)),1+Z_STRLEN_P(&(property->element)),(void**)&_result)==SUCCESS) {
  zval *_value;
  MAKE_STD_ZVAL(_value);  *_value=**_result;
  INIT_PZVAL(_value);
  zval_copy_ctor(_value);
  return *_value;
  }
  result.type = IS_NULL;
  return result;
}
static int _propget_XapianValueIterator(zend_property_reference *property_reference, pval *value) {
  /* get the property name */
  zend_llist_element *element = property_reference->elements_list->head;
  zend_overloaded_element *property=(zend_overloaded_element *)element->data;
  char *propname=Z_STRVAL_P(&(property->element));
  return FAILURE;
}

static int _wrap_propset_XapianValueIterator(zend_property_reference *property_reference, pval *value) { 
  zval * _value;
  zend_llist_element *element = property_reference->elements_list->head;
  zend_overloaded_element *property=(zend_overloaded_element *)element->data;
  if (_propset_XapianValueIterator(property_reference, value)==SUCCESS) return SUCCESS;
  /* set it ourselves as it is XapianValueIterator */
  MAKE_STD_ZVAL(_value);
  *_value=*value;
  INIT_PZVAL(_value);
  zval_copy_ctor(_value);
  return add_property_zval_ex(property_reference->object,Z_STRVAL_P(&(property->element)),1+Z_STRLEN_P(&(property->element)),_value);
}
static int _propset_XapianValueIterator(zend_property_reference *property_reference, pval *value) {
  /* get the property name */
  zend_llist_element *element = property_reference->elements_list->head;
  zend_overloaded_element *property=(zend_overloaded_element *)element->data;
  char *propname=Z_STRVAL_P(&(property->element));
  return FAILURE;
}

ZEND_NAMED_FUNCTION(_wrap_new_XapianDocument__SWIG_0) {
  Xapian::Document *result = 0 ;
  
  SWIG_ResetError();
  /* NATIVE Constructor */
  if(ZEND_NUM_ARGS() != 0) {
    WRONG_PARAM_COUNT;
  }
  
  {
    try {
      result = (Xapian::Document *)new Xapian::Document();
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      
#if PHP_MAJOR_VERSION-0 < 5
      if (code == SWIG_RuntimeError) {
        zend_error(E_WARNING, const_cast<char *>(msg.c_str()));
        /* FIXME: destructors don't have return_value to set. */
        // ZVAL_NULL(return_value);
        return;
      }
#endif
      
      XapianException(code, msg);
    }
  }
  {
    SWIG_SetPointerZval(return_value, (void *)result, SWIGTYPE_p_Xapian__Document, 1);
  }
  /* Wrap this return value */
  if (this_ptr) {
    /* NATIVE Constructor, use this_ptr */
    zval *_cPtr; MAKE_STD_ZVAL(_cPtr);
    *_cPtr = *return_value;
    INIT_ZVAL(*return_value);
    add_property_zval(this_ptr,"_cPtr",_cPtr);
  } else if (! this_ptr) {
    /* ALTERNATIVE Constructor, make an object wrapper */
    zval *obj, *_cPtr;
    MAKE_STD_ZVAL(obj);
    MAKE_STD_ZVAL(_cPtr);
    *_cPtr = *return_value;
    INIT_ZVAL(*return_value);
    object_init_ex(obj,ptr_ce_swig_XapianDocument);
    add_property_zval(obj,"_cPtr",_cPtr);
    *return_value=*obj;
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_new_XapianDocument__SWIG_1) {
  Xapian::Document *arg1 = 0 ;
  Xapian::Document *result = 0 ;
  zval **args[1];
  
  SWIG_ResetError();
  /* NATIVE Constructor */
  if(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_XapianDocument. Expected SWIGTYPE_p_Xapian__Document");
    }
  }
  {
    try {
      result = (Xapian::Document *)new Xapian::Document((Xapian::Document const &)*arg1);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      
#if PHP_MAJOR_VERSION-0 < 5
      if (code == SWIG_RuntimeError) {
        zend_error(E_WARNING, const_cast<char *>(msg.c_str()));
        /* FIXME: destructors don't have return_value to set. */
        // ZVAL_NULL(return_value);
        return;
      }
#endif
      
      XapianException(code, msg);
    }
  }
  {
    SWIG_SetPointerZval(return_value, (void *)result, SWIGTYPE_p_Xapian__Document, 1);
  }
  /* Wrap this return value */
  if (this_ptr) {
    /* NATIVE Constructor, use this_ptr */
    zval *_cPtr; MAKE_STD_ZVAL(_cPtr);
    *_cPtr = *return_value;
    INIT_ZVAL(*return_value);
    add_property_zval(this_ptr,"_cPtr",_cPtr);
  } else if (! this_ptr) {
    /* ALTERNATIVE Constructor, make an object wrapper */
    zval *obj, *_cPtr;
    MAKE_STD_ZVAL(obj);
    MAKE_STD_ZVAL(_cPtr);
    *_cPtr = *return_value;
    INIT_ZVAL(*return_value);
    object_init_ex(obj,ptr_ce_swig_XapianDocument);
    add_property_zval(obj,"_cPtr",_cPtr);
    *return_value=*obj;
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_new_XapianDocument) {
  int argc;
  zval **argv[1];
  
  argc = ZEND_NUM_ARGS();
  zend_get_parameters_array_ex(argc,argv);
  if (argc == 0) {
    return _wrap_new_XapianDocument__SWIG_0(INTERNAL_FUNCTION_PARAM_PASSTHRU);
  }
  if (argc == 1) {
    int _v;
    {
      void *ptr;
      _v = (SWIG_ConvertPtr(*argv[0], (void **)&ptr, SWIGTYPE_p_Xapian__Document, 0) == 0);
    }
    if (_v) {
      return _wrap_new_XapianDocument__SWIG_1(INTERNAL_FUNCTION_PARAM_PASSTHRU);
    }
  }
  
  SWIG_ErrorCode() = E_ERROR;
  SWIG_ErrorMsg() = "No matching function for overloaded 'new_XapianDocument'";
  zend_error(SWIG_ErrorCode(),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_XapianDocument(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 (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      
#if PHP_MAJOR_VERSION-0 < 5
      if (code == SWIG_RuntimeError) {
        zend_error(E_WARNING, const_cast<char *>(msg.c_str()));
        /* FIXME: destructors don't have return_value to set. */
        // ZVAL_NULL(return_value);
        return;
      }
#endif
      
      XapianException(code, msg);
    }
  }
}


ZEND_NAMED_FUNCTION(_wrap_XapianDocument_get_value) {
  Xapian::Document *arg1 = (Xapian::Document *) 0 ;
  Xapian::valueno arg2 ;
  std::string result;
  zval **args[1];
  
  SWIG_ResetError();
  /* This function uses a this_ptr*/
  if(ZEND_NUM_ARGS() != 1 || zend_get_parameters_array_ex(1, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*&this_ptr, (void **) &arg1, SWIGTYPE_p_Xapian__Document, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of XapianDocument_get_value. Expected SWIGTYPE_p_Xapian__Document");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    /*@SWIG:CONVERT_INT_IN@*/
    convert_to_long_ex(args[0]);
    arg2 = (Xapian::valueno) Z_LVAL_PP(args[0]);
    /*@SWIG@*/;
  }
  {
    try {
      result = ((Xapian::Document const *)arg1)->get_value(arg2);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      
#if PHP_MAJOR_VERSION-0 < 5
      if (code == SWIG_RuntimeError) {
        zend_error(E_WARNING, const_cast<char *>(msg.c_str()));
        /* FIXME: destructors don't have return_value to set. */
        // ZVAL_NULL(return_value);
        return;
      }
#endif
      
      XapianException(code, msg);
    }
  }
  {
    ZVAL_STRINGL(return_value,const_cast<char*>((&result)->data()),(&result)->length(),1);
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_XapianDocument_add_value) {
  Xapian::Document *arg1 = (Xapian::Document *) 0 ;
  Xapian::valueno arg2 ;
  std::string *arg3 = 0 ;
  std::string temp3 ;
  zval **args[2];
  
  SWIG_ResetError();
  /* This function uses a this_ptr*/
  if(ZEND_NUM_ARGS() != 2 || zend_get_parameters_array_ex(2, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*&this_ptr, (void **) &arg1, SWIGTYPE_p_Xapian__Document, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of XapianDocument_add_value. Expected SWIGTYPE_p_Xapian__Document");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    /*@SWIG:CONVERT_INT_IN@*/
    convert_to_long_ex(args[0]);
    arg2 = (Xapian::valueno) Z_LVAL_PP(args[0]);
    /*@SWIG@*/;
  }
  {
    convert_to_string_ex(args[1]);
    temp3.assign(Z_STRVAL_PP(args[1]), Z_STRLEN_PP(args[1]));
    arg3 = &temp3;
  }
  {
    try {
      (arg1)->add_value(arg2,(std::string const &)*arg3);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      
#if PHP_MAJOR_VERSION-0 < 5
      if (code == SWIG_RuntimeError) {
        zend_error(E_WARNING, const_cast<char *>(msg.c_str()));
        /* FIXME: destructors don't have return_value to set. */
        // ZVAL_NULL(return_value);
        return;
      }
#endif
      
      XapianException(code, msg);
    }
  }
  
  return;
fail:
  zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_XapianDocument_remove_value) {
  Xapian::Document *arg1 = (Xapian::Document *) 0 ;
  Xapian::valueno arg2 ;
  zval **args[1];
  
  SWIG_ResetError();
  /* This function uses a this_ptr*/
  if(ZEND_NUM_ARGS() != 1 || zend_get_parameters_array_ex(1, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*&this_ptr, (void **) &arg1, SWIGTYPE_p_Xapian__Document, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of XapianDocument_remove_value. Expected SWIGTYPE_p_Xapian__Document");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    /*@SWIG:CONVERT_INT_IN@*/
    convert_to_long_ex(args[0]);
    arg2 = (Xapian::valueno) Z_LVAL_PP(args[0]);
    /*@SWIG@*/;
  }
  {
    try {
      (arg1)->remove_value(arg2);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      
#if PHP_MAJOR_VERSION-0 < 5
      if (code == SWIG_RuntimeError) {
        zend_error(E_WARNING, const_cast<char *>(msg.c_str()));
        /* FIXME: destructors don't have return_value to set. */
        // ZVAL_NULL(return_value);
        return;
      }
#endif
      
      XapianException(code, msg);
    }
  }
  
  return;
fail:
  zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_XapianDocument_clear_values) {
  Xapian::Document *arg1 = (Xapian::Document *) 0 ;
  
  SWIG_ResetError();
  /* This function uses a this_ptr*/
  if(ZEND_NUM_ARGS() != 0) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*&this_ptr, (void **) &arg1, SWIGTYPE_p_Xapian__Document, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of XapianDocument_clear_values. Expected SWIGTYPE_p_Xapian__Document");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    try {
      (arg1)->clear_values();
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      
#if PHP_MAJOR_VERSION-0 < 5
      if (code == SWIG_RuntimeError) {
        zend_error(E_WARNING, const_cast<char *>(msg.c_str()));
        /* FIXME: destructors don't have return_value to set. */
        // ZVAL_NULL(return_value);
        return;
      }
#endif
      
      XapianException(code, msg);
    }
  }
  
  return;
fail:
  zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_XapianDocument_get_data) {
  Xapian::Document *arg1 = (Xapian::Document *) 0 ;
  std::string result;
  
  SWIG_ResetError();
  /* This function uses a this_ptr*/
  if(ZEND_NUM_ARGS() != 0) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*&this_ptr, (void **) &arg1, SWIGTYPE_p_Xapian__Document, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of XapianDocument_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 (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      
#if PHP_MAJOR_VERSION-0 < 5
      if (code == SWIG_RuntimeError) {
        zend_error(E_WARNING, const_cast<char *>(msg.c_str()));
        /* FIXME: destructors don't have return_value to set. */
        // ZVAL_NULL(return_value);
        return;
      }
#endif
      
      XapianException(code, msg);
    }
  }
  {
    ZVAL_STRINGL(return_value,const_cast<char*>((&result)->data()),(&result)->length(),1);
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_XapianDocument_set_data) {
  Xapian::Document *arg1 = (Xapian::Document *) 0 ;
  std::string *arg2 = 0 ;
  std::string temp2 ;
  zval **args[1];
  
  SWIG_ResetError();
  /* This function uses a this_ptr*/
  if(ZEND_NUM_ARGS() != 1 || zend_get_parameters_array_ex(1, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*&this_ptr, (void **) &arg1, SWIGTYPE_p_Xapian__Document, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of XapianDocument_set_data. Expected SWIGTYPE_p_Xapian__Document");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    convert_to_string_ex(args[0]);
    temp2.assign(Z_STRVAL_PP(args[0]), Z_STRLEN_PP(args[0]));
    arg2 = &temp2;
  }
  {
    try {
      (arg1)->set_data((std::string const &)*arg2);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      
#if PHP_MAJOR_VERSION-0 < 5
      if (code == SWIG_RuntimeError) {
        zend_error(E_WARNING, const_cast<char *>(msg.c_str()));
        /* FIXME: destructors don't have return_value to set. */
        // ZVAL_NULL(return_value);
        return;
      }
#endif
      
      XapianException(code, msg);
    }
  }
  
  return;
fail:
  zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_XapianDocument_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[3];
  
  SWIG_ResetError();
  /* This function uses a this_ptr*/
  if(ZEND_NUM_ARGS() != 3 || zend_get_parameters_array_ex(3, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*&this_ptr, (void **) &arg1, SWIGTYPE_p_Xapian__Document, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of XapianDocument_add_posting. Expected SWIGTYPE_p_Xapian__Document");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    convert_to_string_ex(args[0]);
    temp2.assign(Z_STRVAL_PP(args[0]), Z_STRLEN_PP(args[0]));
    arg2 = &temp2;
  }
  {
    /*@SWIG:CONVERT_INT_IN@*/
    convert_to_long_ex(args[1]);
    arg3 = (Xapian::termpos) Z_LVAL_PP(args[1]);
    /*@SWIG@*/;
  }
  {
    /*@SWIG:CONVERT_INT_IN@*/
    convert_to_long_ex(args[2]);
    arg4 = (Xapian::termcount) Z_LVAL_PP(args[2]);
    /*@SWIG@*/;
  }
  {
    try {
      (arg1)->add_posting((std::string const &)*arg2,arg3,arg4);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      
#if PHP_MAJOR_VERSION-0 < 5
      if (code == SWIG_RuntimeError) {
        zend_error(E_WARNING, const_cast<char *>(msg.c_str()));
        /* FIXME: destructors don't have return_value to set. */
        // ZVAL_NULL(return_value);
        return;
      }
#endif
      
      XapianException(code, msg);
    }
  }
  
  return;
fail:
  zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_XapianDocument_add_posting__SWIG_1) {
  Xapian::Document *arg1 = (Xapian::Document *) 0 ;
  std::string *arg2 = 0 ;
  Xapian::termpos arg3 ;
  std::string temp2 ;
  zval **args[2];
  
  SWIG_ResetError();
  /* This function uses a this_ptr*/
  if(ZEND_NUM_ARGS() != 2 || zend_get_parameters_array_ex(2, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*&this_ptr, (void **) &arg1, SWIGTYPE_p_Xapian__Document, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of XapianDocument_add_posting. Expected SWIGTYPE_p_Xapian__Document");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    convert_to_string_ex(args[0]);
    temp2.assign(Z_STRVAL_PP(args[0]), Z_STRLEN_PP(args[0]));
    arg2 = &temp2;
  }
  {
    /*@SWIG:CONVERT_INT_IN@*/
    convert_to_long_ex(args[1]);
    arg3 = (Xapian::termpos) Z_LVAL_PP(args[1]);
    /*@SWIG@*/;
  }
  {
    try {
      (arg1)->add_posting((std::string const &)*arg2,arg3);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      
#if PHP_MAJOR_VERSION-0 < 5
      if (code == SWIG_RuntimeError) {
        zend_error(E_WARNING, const_cast<char *>(msg.c_str()));
        /* FIXME: destructors don't have return_value to set. */
        // ZVAL_NULL(return_value);
        return;
      }
#endif
      
      XapianException(code, msg);
    }
  }
  
  return;
fail:
  zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_XapianDocument_add_posting) {
  int argc;
  zval **argv[4];
  
  argc = ZEND_NUM_ARGS();
  argv[0] = &this_ptr;
  zend_get_parameters_array_ex(argc,argv+1);
  argc++;
  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) {
          return _wrap_XapianDocument_add_posting__SWIG_1(INTERNAL_FUNCTION_PARAM_PASSTHRU);
        }
      }
    }
  }
  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) {
            return _wrap_XapianDocument_add_posting__SWIG_0(INTERNAL_FUNCTION_PARAM_PASSTHRU);
          }
        }
      }
    }
  }
  
  SWIG_ErrorCode() = E_ERROR;
  SWIG_ErrorMsg() = "No matching function for overloaded 'XapianDocument_add_posting'";
  zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_XapianDocument_add_term__SWIG_0) {
  Xapian::Document *arg1 = (Xapian::Document *) 0 ;
  std::string *arg2 = 0 ;
  Xapian::termcount arg3 ;
  std::string temp2 ;
  zval **args[2];
  
  SWIG_ResetError();
  /* This function uses a this_ptr*/
  if(ZEND_NUM_ARGS() != 2 || zend_get_parameters_array_ex(2, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*&this_ptr, (void **) &arg1, SWIGTYPE_p_Xapian__Document, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of XapianDocument_add_term. Expected SWIGTYPE_p_Xapian__Document");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    convert_to_string_ex(args[0]);
    temp2.assign(Z_STRVAL_PP(args[0]), Z_STRLEN_PP(args[0]));
    arg2 = &temp2;
  }
  {
    /*@SWIG:CONVERT_INT_IN@*/
    convert_to_long_ex(args[1]);
    arg3 = (Xapian::termcount) Z_LVAL_PP(args[1]);
    /*@SWIG@*/;
  }
  {
    try {
      (arg1)->add_term((std::string const &)*arg2,arg3);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      
#if PHP_MAJOR_VERSION-0 < 5
      if (code == SWIG_RuntimeError) {
        zend_error(E_WARNING, const_cast<char *>(msg.c_str()));
        /* FIXME: destructors don't have return_value to set. */
        // ZVAL_NULL(return_value);
        return;
      }
#endif
      
      XapianException(code, msg);
    }
  }
  
  return;
fail:
  zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_XapianDocument_add_term__SWIG_1) {
  Xapian::Document *arg1 = (Xapian::Document *) 0 ;
  std::string *arg2 = 0 ;
  std::string temp2 ;
  zval **args[1];
  
  SWIG_ResetError();
  /* This function uses a this_ptr*/
  if(ZEND_NUM_ARGS() != 1 || zend_get_parameters_array_ex(1, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*&this_ptr, (void **) &arg1, SWIGTYPE_p_Xapian__Document, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of XapianDocument_add_term. Expected SWIGTYPE_p_Xapian__Document");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    convert_to_string_ex(args[0]);
    temp2.assign(Z_STRVAL_PP(args[0]), Z_STRLEN_PP(args[0]));
    arg2 = &temp2;
  }
  {
    try {
      (arg1)->add_term((std::string const &)*arg2);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      
#if PHP_MAJOR_VERSION-0 < 5
      if (code == SWIG_RuntimeError) {
        zend_error(E_WARNING, const_cast<char *>(msg.c_str()));
        /* FIXME: destructors don't have return_value to set. */
        // ZVAL_NULL(return_value);
        return;
      }
#endif
      
      XapianException(code, msg);
    }
  }
  
  return;
fail:
  zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_XapianDocument_add_term) {
  int argc;
  zval **argv[3];
  
  argc = ZEND_NUM_ARGS();
  argv[0] = &this_ptr;
  zend_get_parameters_array_ex(argc,argv+1);
  argc++;
  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) {
        return _wrap_XapianDocument_add_term__SWIG_1(INTERNAL_FUNCTION_PARAM_PASSTHRU);
      }
    }
  }
  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) {
          return _wrap_XapianDocument_add_term__SWIG_0(INTERNAL_FUNCTION_PARAM_PASSTHRU);
        }
      }
    }
  }
  
  SWIG_ErrorCode() = E_ERROR;
  SWIG_ErrorMsg() = "No matching function for overloaded 'XapianDocument_add_term'";
  zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_XapianDocument_add_term_nopos__SWIG_0) {
  Xapian::Document *arg1 = (Xapian::Document *) 0 ;
  std::string *arg2 = 0 ;
  Xapian::termcount arg3 ;
  std::string temp2 ;
  zval **args[2];
  
  SWIG_ResetError();
  /* This function uses a this_ptr*/
  if(ZEND_NUM_ARGS() != 2 || zend_get_parameters_array_ex(2, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*&this_ptr, (void **) &arg1, SWIGTYPE_p_Xapian__Document, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of XapianDocument_add_term_nopos. Expected SWIGTYPE_p_Xapian__Document");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    convert_to_string_ex(args[0]);
    temp2.assign(Z_STRVAL_PP(args[0]), Z_STRLEN_PP(args[0]));
    arg2 = &temp2;
  }
  {
    /*@SWIG:CONVERT_INT_IN@*/
    convert_to_long_ex(args[1]);
    arg3 = (Xapian::termcount) Z_LVAL_PP(args[1]);
    /*@SWIG@*/;
  }
  {
    try {
      (arg1)->add_term_nopos((std::string const &)*arg2,arg3);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      
#if PHP_MAJOR_VERSION-0 < 5
      if (code == SWIG_RuntimeError) {
        zend_error(E_WARNING, const_cast<char *>(msg.c_str()));
        /* FIXME: destructors don't have return_value to set. */
        // ZVAL_NULL(return_value);
        return;
      }
#endif
      
      XapianException(code, msg);
    }
  }
  
  return;
fail:
  zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_XapianDocument_add_term_nopos__SWIG_1) {
  Xapian::Document *arg1 = (Xapian::Document *) 0 ;
  std::string *arg2 = 0 ;
  std::string temp2 ;
  zval **args[1];
  
  SWIG_ResetError();
  /* This function uses a this_ptr*/
  if(ZEND_NUM_ARGS() != 1 || zend_get_parameters_array_ex(1, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*&this_ptr, (void **) &arg1, SWIGTYPE_p_Xapian__Document, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of XapianDocument_add_term_nopos. Expected SWIGTYPE_p_Xapian__Document");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    convert_to_string_ex(args[0]);
    temp2.assign(Z_STRVAL_PP(args[0]), Z_STRLEN_PP(args[0]));
    arg2 = &temp2;
  }
  {
    try {
      (arg1)->add_term_nopos((std::string const &)*arg2);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      
#if PHP_MAJOR_VERSION-0 < 5
      if (code == SWIG_RuntimeError) {
        zend_error(E_WARNING, const_cast<char *>(msg.c_str()));
        /* FIXME: destructors don't have return_value to set. */
        // ZVAL_NULL(return_value);
        return;
      }
#endif
      
      XapianException(code, msg);
    }
  }
  
  return;
fail:
  zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_XapianDocument_add_term_nopos) {
  int argc;
  zval **argv[3];
  
  argc = ZEND_NUM_ARGS();
  argv[0] = &this_ptr;
  zend_get_parameters_array_ex(argc,argv+1);
  argc++;
  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) {
        return _wrap_XapianDocument_add_term_nopos__SWIG_1(INTERNAL_FUNCTION_PARAM_PASSTHRU);
      }
    }
  }
  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) {
          return _wrap_XapianDocument_add_term_nopos__SWIG_0(INTERNAL_FUNCTION_PARAM_PASSTHRU);
        }
      }
    }
  }
  
  SWIG_ErrorCode() = E_ERROR;
  SWIG_ErrorMsg() = "No matching function for overloaded 'XapianDocument_add_term_nopos'";
  zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_XapianDocument_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[3];
  
  SWIG_ResetError();
  /* This function uses a this_ptr*/
  if(ZEND_NUM_ARGS() != 3 || zend_get_parameters_array_ex(3, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*&this_ptr, (void **) &arg1, SWIGTYPE_p_Xapian__Document, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of XapianDocument_remove_posting. Expected SWIGTYPE_p_Xapian__Document");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    convert_to_string_ex(args[0]);
    temp2.assign(Z_STRVAL_PP(args[0]), Z_STRLEN_PP(args[0]));
    arg2 = &temp2;
  }
  {
    /*@SWIG:CONVERT_INT_IN@*/
    convert_to_long_ex(args[1]);
    arg3 = (Xapian::termpos) Z_LVAL_PP(args[1]);
    /*@SWIG@*/;
  }
  {
    /*@SWIG:CONVERT_INT_IN@*/
    convert_to_long_ex(args[2]);
    arg4 = (Xapian::termcount) Z_LVAL_PP(args[2]);
    /*@SWIG@*/;
  }
  {
    try {
      (arg1)->remove_posting((std::string const &)*arg2,arg3,arg4);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      
#if PHP_MAJOR_VERSION-0 < 5
      if (code == SWIG_RuntimeError) {
        zend_error(E_WARNING, const_cast<char *>(msg.c_str()));
        /* FIXME: destructors don't have return_value to set. */
        // ZVAL_NULL(return_value);
        return;
      }
#endif
      
      XapianException(code, msg);
    }
  }
  
  return;
fail:
  zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_XapianDocument_remove_posting__SWIG_1) {
  Xapian::Document *arg1 = (Xapian::Document *) 0 ;
  std::string *arg2 = 0 ;
  Xapian::termpos arg3 ;
  std::string temp2 ;
  zval **args[2];
  
  SWIG_ResetError();
  /* This function uses a this_ptr*/
  if(ZEND_NUM_ARGS() != 2 || zend_get_parameters_array_ex(2, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*&this_ptr, (void **) &arg1, SWIGTYPE_p_Xapian__Document, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of XapianDocument_remove_posting. Expected SWIGTYPE_p_Xapian__Document");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    convert_to_string_ex(args[0]);
    temp2.assign(Z_STRVAL_PP(args[0]), Z_STRLEN_PP(args[0]));
    arg2 = &temp2;
  }
  {
    /*@SWIG:CONVERT_INT_IN@*/
    convert_to_long_ex(args[1]);
    arg3 = (Xapian::termpos) Z_LVAL_PP(args[1]);
    /*@SWIG@*/;
  }
  {
    try {
      (arg1)->remove_posting((std::string const &)*arg2,arg3);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      
#if PHP_MAJOR_VERSION-0 < 5
      if (code == SWIG_RuntimeError) {
        zend_error(E_WARNING, const_cast<char *>(msg.c_str()));
        /* FIXME: destructors don't have return_value to set. */
        // ZVAL_NULL(return_value);
        return;
      }
#endif
      
      XapianException(code, msg);
    }
  }
  
  return;
fail:
  zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_XapianDocument_remove_posting) {
  int argc;
  zval **argv[4];
  
  argc = ZEND_NUM_ARGS();
  argv[0] = &this_ptr;
  zend_get_parameters_array_ex(argc,argv+1);
  argc++;
  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) {
          return _wrap_XapianDocument_remove_posting__SWIG_1(INTERNAL_FUNCTION_PARAM_PASSTHRU);
        }
      }
    }
  }
  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) {
            return _wrap_XapianDocument_remove_posting__SWIG_0(INTERNAL_FUNCTION_PARAM_PASSTHRU);
          }
        }
      }
    }
  }
  
  SWIG_ErrorCode() = E_ERROR;
  SWIG_ErrorMsg() = "No matching function for overloaded 'XapianDocument_remove_posting'";
  zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_XapianDocument_remove_term) {
  Xapian::Document *arg1 = (Xapian::Document *) 0 ;
  std::string *arg2 = 0 ;
  std::string temp2 ;
  zval **args[1];
  
  SWIG_ResetError();
  /* This function uses a this_ptr*/
  if(ZEND_NUM_ARGS() != 1 || zend_get_parameters_array_ex(1, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*&this_ptr, (void **) &arg1, SWIGTYPE_p_Xapian__Document, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of XapianDocument_remove_term. Expected SWIGTYPE_p_Xapian__Document");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    convert_to_string_ex(args[0]);
    temp2.assign(Z_STRVAL_PP(args[0]), Z_STRLEN_PP(args[0]));
    arg2 = &temp2;
  }
  {
    try {
      (arg1)->remove_term((std::string const &)*arg2);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      
#if PHP_MAJOR_VERSION-0 < 5
      if (code == SWIG_RuntimeError) {
        zend_error(E_WARNING, const_cast<char *>(msg.c_str()));
        /* FIXME: destructors don't have return_value to set. */
        // ZVAL_NULL(return_value);
        return;
      }
#endif
      
      XapianException(code, msg);
    }
  }
  
  return;
fail:
  zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_XapianDocument_clear_terms) {
  Xapian::Document *arg1 = (Xapian::Document *) 0 ;
  
  SWIG_ResetError();
  /* This function uses a this_ptr*/
  if(ZEND_NUM_ARGS() != 0) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*&this_ptr, (void **) &arg1, SWIGTYPE_p_Xapian__Document, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of XapianDocument_clear_terms. Expected SWIGTYPE_p_Xapian__Document");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    try {
      (arg1)->clear_terms();
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      
#if PHP_MAJOR_VERSION-0 < 5
      if (code == SWIG_RuntimeError) {
        zend_error(E_WARNING, const_cast<char *>(msg.c_str()));
        /* FIXME: destructors don't have return_value to set. */
        // ZVAL_NULL(return_value);
        return;
      }
#endif
      
      XapianException(code, msg);
    }
  }
  
  return;
fail:
  zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_XapianDocument_termlist_count) {
  Xapian::Document *arg1 = (Xapian::Document *) 0 ;
  Xapian::termcount result;
  
  SWIG_ResetError();
  /* This function uses a this_ptr*/
  if(ZEND_NUM_ARGS() != 0) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*&this_ptr, (void **) &arg1, SWIGTYPE_p_Xapian__Document, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of XapianDocument_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 (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      
#if PHP_MAJOR_VERSION-0 < 5
      if (code == SWIG_RuntimeError) {
        zend_error(E_WARNING, const_cast<char *>(msg.c_str()));
        /* FIXME: destructors don't have return_value to set. */
        // ZVAL_NULL(return_value);
        return;
      }
#endif
      
      XapianException(code, msg);
    }
  }
  {
    ZVAL_LONG(return_value,result);
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_XapianDocument_termlist_begin) {
  Xapian::Document *arg1 = (Xapian::Document *) 0 ;
  Xapian::TermIterator result;
  
  SWIG_ResetError();
  /* This function uses a this_ptr*/
  if(ZEND_NUM_ARGS() != 0) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*&this_ptr, (void **) &arg1, SWIGTYPE_p_Xapian__Document, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of XapianDocument_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 (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      
#if PHP_MAJOR_VERSION-0 < 5
      if (code == SWIG_RuntimeError) {
        zend_error(E_WARNING, const_cast<char *>(msg.c_str()));
        /* FIXME: destructors don't have return_value to set. */
        // ZVAL_NULL(return_value);
        return;
      }
#endif
      
      XapianException(code, msg);
    }
  }
  {
    Xapian::TermIterator * resultobj = new Xapian::TermIterator((Xapian::TermIterator &) result);
    SWIG_SetPointerZval(return_value, (void *)resultobj, SWIGTYPE_p_Xapian__TermIterator, 1);
  }
  /* Wrap this return value */
  {
    /* ALTERNATIVE Constructor, make an object wrapper */
    zval *obj, *_cPtr;
    MAKE_STD_ZVAL(obj);
    MAKE_STD_ZVAL(_cPtr);
    *_cPtr = *return_value;
    INIT_ZVAL(*return_value);
    object_init_ex(obj,ptr_ce_swig_XapianTermIterator);
    add_property_zval(obj,"_cPtr",_cPtr);
    *return_value=*obj;
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_XapianDocument_termlist_end) {
  Xapian::Document *arg1 = (Xapian::Document *) 0 ;
  Xapian::TermIterator result;
  
  SWIG_ResetError();
  /* This function uses a this_ptr*/
  if(ZEND_NUM_ARGS() != 0) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*&this_ptr, (void **) &arg1, SWIGTYPE_p_Xapian__Document, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of XapianDocument_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 (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      
#if PHP_MAJOR_VERSION-0 < 5
      if (code == SWIG_RuntimeError) {
        zend_error(E_WARNING, const_cast<char *>(msg.c_str()));
        /* FIXME: destructors don't have return_value to set. */
        // ZVAL_NULL(return_value);
        return;
      }
#endif
      
      XapianException(code, msg);
    }
  }
  {
    Xapian::TermIterator * resultobj = new Xapian::TermIterator((Xapian::TermIterator &) result);
    SWIG_SetPointerZval(return_value, (void *)resultobj, SWIGTYPE_p_Xapian__TermIterator, 1);
  }
  /* Wrap this return value */
  {
    /* ALTERNATIVE Constructor, make an object wrapper */
    zval *obj, *_cPtr;
    MAKE_STD_ZVAL(obj);
    MAKE_STD_ZVAL(_cPtr);
    *_cPtr = *return_value;
    INIT_ZVAL(*return_value);
    object_init_ex(obj,ptr_ce_swig_XapianTermIterator);
    add_property_zval(obj,"_cPtr",_cPtr);
    *return_value=*obj;
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_XapianDocument_values_count) {
  Xapian::Document *arg1 = (Xapian::Document *) 0 ;
  Xapian::termcount result;
  
  SWIG_ResetError();
  /* This function uses a this_ptr*/
  if(ZEND_NUM_ARGS() != 0) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*&this_ptr, (void **) &arg1, SWIGTYPE_p_Xapian__Document, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of XapianDocument_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 (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      
#if PHP_MAJOR_VERSION-0 < 5
      if (code == SWIG_RuntimeError) {
        zend_error(E_WARNING, const_cast<char *>(msg.c_str()));
        /* FIXME: destructors don't have return_value to set. */
        // ZVAL_NULL(return_value);
        return;
      }
#endif
      
      XapianException(code, msg);
    }
  }
  {
    ZVAL_LONG(return_value,result);
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_XapianDocument_values_begin) {
  Xapian::Document *arg1 = (Xapian::Document *) 0 ;
  Xapian::ValueIterator result;
  
  SWIG_ResetError();
  /* This function uses a this_ptr*/
  if(ZEND_NUM_ARGS() != 0) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*&this_ptr, (void **) &arg1, SWIGTYPE_p_Xapian__Document, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of XapianDocument_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 (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      
#if PHP_MAJOR_VERSION-0 < 5
      if (code == SWIG_RuntimeError) {
        zend_error(E_WARNING, const_cast<char *>(msg.c_str()));
        /* FIXME: destructors don't have return_value to set. */
        // ZVAL_NULL(return_value);
        return;
      }
#endif
      
      XapianException(code, msg);
    }
  }
  {
    Xapian::ValueIterator * resultobj = new Xapian::ValueIterator((Xapian::ValueIterator &) result);
    SWIG_SetPointerZval(return_value, (void *)resultobj, SWIGTYPE_p_Xapian__ValueIterator, 1);
  }
  /* Wrap this return value */
  {
    /* ALTERNATIVE Constructor, make an object wrapper */
    zval *obj, *_cPtr;
    MAKE_STD_ZVAL(obj);
    MAKE_STD_ZVAL(_cPtr);
    *_cPtr = *return_value;
    INIT_ZVAL(*return_value);
    object_init_ex(obj,ptr_ce_swig_XapianValueIterator);
    add_property_zval(obj,"_cPtr",_cPtr);
    *return_value=*obj;
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_XapianDocument_values_end) {
  Xapian::Document *arg1 = (Xapian::Document *) 0 ;
  Xapian::ValueIterator result;
  
  SWIG_ResetError();
  /* This function uses a this_ptr*/
  if(ZEND_NUM_ARGS() != 0) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*&this_ptr, (void **) &arg1, SWIGTYPE_p_Xapian__Document, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of XapianDocument_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 (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      
#if PHP_MAJOR_VERSION-0 < 5
      if (code == SWIG_RuntimeError) {
        zend_error(E_WARNING, const_cast<char *>(msg.c_str()));
        /* FIXME: destructors don't have return_value to set. */
        // ZVAL_NULL(return_value);
        return;
      }
#endif
      
      XapianException(code, msg);
    }
  }
  {
    Xapian::ValueIterator * resultobj = new Xapian::ValueIterator((Xapian::ValueIterator &) result);
    SWIG_SetPointerZval(return_value, (void *)resultobj, SWIGTYPE_p_Xapian__ValueIterator, 1);
  }
  /* Wrap this return value */
  {
    /* ALTERNATIVE Constructor, make an object wrapper */
    zval *obj, *_cPtr;
    MAKE_STD_ZVAL(obj);
    MAKE_STD_ZVAL(_cPtr);
    *_cPtr = *return_value;
    INIT_ZVAL(*return_value);
    object_init_ex(obj,ptr_ce_swig_XapianValueIterator);
    add_property_zval(obj,"_cPtr",_cPtr);
    *return_value=*obj;
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_XapianDocument_get_description) {
  Xapian::Document *arg1 = (Xapian::Document *) 0 ;
  std::string result;
  
  SWIG_ResetError();
  /* This function uses a this_ptr*/
  if(ZEND_NUM_ARGS() != 0) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*&this_ptr, (void **) &arg1, SWIGTYPE_p_Xapian__Document, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of XapianDocument_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 (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      
#if PHP_MAJOR_VERSION-0 < 5
      if (code == SWIG_RuntimeError) {
        zend_error(E_WARNING, const_cast<char *>(msg.c_str()));
        /* FIXME: destructors don't have return_value to set. */
        // ZVAL_NULL(return_value);
        return;
      }
#endif
      
      XapianException(code, msg);
    }
  }
  {
    ZVAL_STRINGL(return_value,const_cast<char*>((&result)->data()),(&result)->length(),1);
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg());
}


/* property handler for class XapianDocument */
static pval _wrap_propget_XapianDocument(zend_property_reference *property_reference) {
  pval result;
  pval **_result;
  zend_llist_element *element = property_reference->elements_list->head;
  zend_overloaded_element *property=(zend_overloaded_element *)element->data;
  result.type = IS_NULL;
  if (_propget_XapianDocument(property_reference, &result)==SUCCESS) return result;
  /* return it ourselves */
  if (zend_hash_find(Z_OBJPROP_P(property_reference->object),Z_STRVAL_P(&(property->element)),1+Z_STRLEN_P(&(property->element)),(void**)&_result)==SUCCESS) {
  zval *_value;
  MAKE_STD_ZVAL(_value);  *_value=**_result;
  INIT_PZVAL(_value);
  zval_copy_ctor(_value);
  return *_value;
  }
  result.type = IS_NULL;
  return result;
}
static int _propget_XapianDocument(zend_property_reference *property_reference, pval *value) {
  /* get the property name */
  zend_llist_element *element = property_reference->elements_list->head;
  zend_overloaded_element *property=(zend_overloaded_element *)element->data;
  char *propname=Z_STRVAL_P(&(property->element));
  return FAILURE;
}

static int _wrap_propset_XapianDocument(zend_property_reference *property_reference, pval *value) { 
  zval * _value;
  zend_llist_element *element = property_reference->elements_list->head;
  zend_overloaded_element *property=(zend_overloaded_element *)element->data;
  if (_propset_XapianDocument(property_reference, value)==SUCCESS) return SUCCESS;
  /* set it ourselves as it is XapianDocument */
  MAKE_STD_ZVAL(_value);
  *_value=*value;
  INIT_PZVAL(_value);
  zval_copy_ctor(_value);
  return add_property_zval_ex(property_reference->object,Z_STRVAL_P(&(property->element)),1+Z_STRLEN_P(&(property->element)),_value);
}
static int _propset_XapianDocument(zend_property_reference *property_reference, pval *value) {
  /* get the property name */
  zend_llist_element *element = property_reference->elements_list->head;
  zend_overloaded_element *property=(zend_overloaded_element *)element->data;
  char *propname=Z_STRVAL_P(&(property->element));
  return FAILURE;
}

ZEND_NAMED_FUNCTION(_wrap_new_XapianMSet__SWIG_0) {
  Xapian::MSet *result = 0 ;
  
  SWIG_ResetError();
  /* NATIVE Constructor */
  if(ZEND_NUM_ARGS() != 0) {
    WRONG_PARAM_COUNT;
  }
  
  {
    try {
      result = (Xapian::MSet *)new Xapian::MSet();
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      
#if PHP_MAJOR_VERSION-0 < 5
      if (code == SWIG_RuntimeError) {
        zend_error(E_WARNING, const_cast<char *>(msg.c_str()));
        /* FIXME: destructors don't have return_value to set. */
        // ZVAL_NULL(return_value);
        return;
      }
#endif
      
      XapianException(code, msg);
    }
  }
  {
    SWIG_SetPointerZval(return_value, (void *)result, SWIGTYPE_p_Xapian__MSet, 1);
  }
  /* Wrap this return value */
  if (this_ptr) {
    /* NATIVE Constructor, use this_ptr */
    zval *_cPtr; MAKE_STD_ZVAL(_cPtr);
    *_cPtr = *return_value;
    INIT_ZVAL(*return_value);
    add_property_zval(this_ptr,"_cPtr",_cPtr);
  } else if (! this_ptr) {
    /* ALTERNATIVE Constructor, make an object wrapper */
    zval *obj, *_cPtr;
    MAKE_STD_ZVAL(obj);
    MAKE_STD_ZVAL(_cPtr);
    *_cPtr = *return_value;
    INIT_ZVAL(*return_value);
    object_init_ex(obj,ptr_ce_swig_XapianMSet);
    add_property_zval(obj,"_cPtr",_cPtr);
    *return_value=*obj;
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_new_XapianMSet__SWIG_1) {
  Xapian::MSet *arg1 = 0 ;
  Xapian::MSet *result = 0 ;
  zval **args[1];
  
  SWIG_ResetError();
  /* NATIVE Constructor */
  if(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_XapianMSet. Expected SWIGTYPE_p_Xapian__MSet");
    }
  }
  {
    try {
      result = (Xapian::MSet *)new Xapian::MSet((Xapian::MSet const &)*arg1);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      
#if PHP_MAJOR_VERSION-0 < 5
      if (code == SWIG_RuntimeError) {
        zend_error(E_WARNING, const_cast<char *>(msg.c_str()));
        /* FIXME: destructors don't have return_value to set. */
        // ZVAL_NULL(return_value);
        return;
      }
#endif
      
      XapianException(code, msg);
    }
  }
  {
    SWIG_SetPointerZval(return_value, (void *)result, SWIGTYPE_p_Xapian__MSet, 1);
  }
  /* Wrap this return value */
  if (this_ptr) {
    /* NATIVE Constructor, use this_ptr */
    zval *_cPtr; MAKE_STD_ZVAL(_cPtr);
    *_cPtr = *return_value;
    INIT_ZVAL(*return_value);
    add_property_zval(this_ptr,"_cPtr",_cPtr);
  } else if (! this_ptr) {
    /* ALTERNATIVE Constructor, make an object wrapper */
    zval *obj, *_cPtr;
    MAKE_STD_ZVAL(obj);
    MAKE_STD_ZVAL(_cPtr);
    *_cPtr = *return_value;
    INIT_ZVAL(*return_value);
    object_init_ex(obj,ptr_ce_swig_XapianMSet);
    add_property_zval(obj,"_cPtr",_cPtr);
    *return_value=*obj;
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_new_XapianMSet) {
  int argc;
  zval **argv[1];
  
  argc = ZEND_NUM_ARGS();
  zend_get_parameters_array_ex(argc,argv);
  if (argc == 0) {
    return _wrap_new_XapianMSet__SWIG_0(INTERNAL_FUNCTION_PARAM_PASSTHRU);
  }
  if (argc == 1) {
    int _v;
    {
      void *ptr;
      _v = (SWIG_ConvertPtr(*argv[0], (void **)&ptr, SWIGTYPE_p_Xapian__MSet, 0) == 0);
    }
    if (_v) {
      return _wrap_new_XapianMSet__SWIG_1(INTERNAL_FUNCTION_PARAM_PASSTHRU);
    }
  }
  
  SWIG_ErrorCode() = E_ERROR;
  SWIG_ErrorMsg() = "No matching function for overloaded 'new_XapianMSet'";
  zend_error(SWIG_ErrorCode(),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_XapianMSet(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 (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      
#if PHP_MAJOR_VERSION-0 < 5
      if (code == SWIG_RuntimeError) {
        zend_error(E_WARNING, const_cast<char *>(msg.c_str()));
        /* FIXME: destructors don't have return_value to set. */
        // ZVAL_NULL(return_value);
        return;
      }
#endif
      
      XapianException(code, msg);
    }
  }
}


ZEND_NAMED_FUNCTION(_wrap_XapianMSet_fetch__SWIG_0) {
  Xapian::MSet *arg1 = (Xapian::MSet *) 0 ;
  Xapian::MSetIterator *arg2 = 0 ;
  Xapian::MSetIterator *arg3 = 0 ;
  zval **args[2];
  
  SWIG_ResetError();
  /* This function uses a this_ptr*/
  if(ZEND_NUM_ARGS() != 2 || zend_get_parameters_array_ex(2, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*&this_ptr, (void **) &arg1, SWIGTYPE_p_Xapian__MSet, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of XapianMSet_fetch. Expected SWIGTYPE_p_Xapian__MSet");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    if (SWIG_ConvertPtr(*args[0], (void**)&arg2, SWIGTYPE_p_Xapian__MSetIterator, 0) < 0 || arg2 == NULL) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 2 of XapianMSet_fetch. Expected SWIGTYPE_p_Xapian__MSetIterator");
    }
  }
  {
    if (SWIG_ConvertPtr(*args[1], (void**)&arg3, SWIGTYPE_p_Xapian__MSetIterator, 0) < 0 || arg3 == NULL) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 3 of XapianMSet_fetch. Expected SWIGTYPE_p_Xapian__MSetIterator");
    }
  }
  {
    try {
      ((Xapian::MSet const *)arg1)->fetch(*arg2,*arg3);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      
#if PHP_MAJOR_VERSION-0 < 5
      if (code == SWIG_RuntimeError) {
        zend_error(E_WARNING, const_cast<char *>(msg.c_str()));
        /* FIXME: destructors don't have return_value to set. */
        // ZVAL_NULL(return_value);
        return;
      }
#endif
      
      XapianException(code, msg);
    }
  }
  
  return;
fail:
  zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_XapianMSet_fetch__SWIG_1) {
  Xapian::MSet *arg1 = (Xapian::MSet *) 0 ;
  Xapian::MSetIterator *arg2 = 0 ;
  zval **args[1];
  
  SWIG_ResetError();
  /* This function uses a this_ptr*/
  if(ZEND_NUM_ARGS() != 1 || zend_get_parameters_array_ex(1, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*&this_ptr, (void **) &arg1, SWIGTYPE_p_Xapian__MSet, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of XapianMSet_fetch. Expected SWIGTYPE_p_Xapian__MSet");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    if (SWIG_ConvertPtr(*args[0], (void**)&arg2, SWIGTYPE_p_Xapian__MSetIterator, 0) < 0 || arg2 == NULL) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 2 of XapianMSet_fetch. Expected SWIGTYPE_p_Xapian__MSetIterator");
    }
  }
  {
    try {
      ((Xapian::MSet const *)arg1)->fetch(*arg2);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      
#if PHP_MAJOR_VERSION-0 < 5
      if (code == SWIG_RuntimeError) {
        zend_error(E_WARNING, const_cast<char *>(msg.c_str()));
        /* FIXME: destructors don't have return_value to set. */
        // ZVAL_NULL(return_value);
        return;
      }
#endif
      
      XapianException(code, msg);
    }
  }
  
  return;
fail:
  zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_XapianMSet_fetch__SWIG_2) {
  Xapian::MSet *arg1 = (Xapian::MSet *) 0 ;
  
  SWIG_ResetError();
  /* This function uses a this_ptr*/
  if(ZEND_NUM_ARGS() != 0) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*&this_ptr, (void **) &arg1, SWIGTYPE_p_Xapian__MSet, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of XapianMSet_fetch. Expected SWIGTYPE_p_Xapian__MSet");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    try {
      ((Xapian::MSet const *)arg1)->fetch();
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      
#if PHP_MAJOR_VERSION-0 < 5
      if (code == SWIG_RuntimeError) {
        zend_error(E_WARNING, const_cast<char *>(msg.c_str()));
        /* FIXME: destructors don't have return_value to set. */
        // ZVAL_NULL(return_value);
        return;
      }
#endif
      
      XapianException(code, msg);
    }
  }
  
  return;
fail:
  zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_XapianMSet_fetch) {
  int argc;
  zval **argv[3];
  
  argc = ZEND_NUM_ARGS();
  argv[0] = &this_ptr;
  zend_get_parameters_array_ex(argc,argv+1);
  argc++;
  if (argc == 1) {
    int _v;
    {
      void *tmp;
      _v = (SWIG_ConvertPtr( *argv[0], (void**)&tmp, SWIGTYPE_p_Xapian__MSet, 0) >= 0);
    }
    if (_v) {
      return _wrap_XapianMSet_fetch__SWIG_2(INTERNAL_FUNCTION_PARAM_PASSTHRU);
    }
  }
  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) {
        return _wrap_XapianMSet_fetch__SWIG_1(INTERNAL_FUNCTION_PARAM_PASSTHRU);
      }
    }
  }
  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) {
          return _wrap_XapianMSet_fetch__SWIG_0(INTERNAL_FUNCTION_PARAM_PASSTHRU);
        }
      }
    }
  }
  
  SWIG_ErrorCode() = E_ERROR;
  SWIG_ErrorMsg() = "No matching function for overloaded 'XapianMSet_fetch'";
  zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_XapianMSet_convert_to_percent__SWIG_0) {
  Xapian::MSet *arg1 = (Xapian::MSet *) 0 ;
  Xapian::weight arg2 ;
  Xapian::percent result;
  zval **args[1];
  
  SWIG_ResetError();
  /* This function uses a this_ptr*/
  if(ZEND_NUM_ARGS() != 1 || zend_get_parameters_array_ex(1, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*&this_ptr, (void **) &arg1, SWIGTYPE_p_Xapian__MSet, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of XapianMSet_convert_to_percent. Expected SWIGTYPE_p_Xapian__MSet");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    /*@SWIG:CONVERT_FLOAT_IN@*/
    convert_to_double_ex(args[0]);
    arg2 = (Xapian::weight) Z_DVAL_PP(args[0]);
    /*@SWIG@*/;
  }
  {
    try {
      result = (Xapian::percent)((Xapian::MSet const *)arg1)->convert_to_percent(arg2);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      
#if PHP_MAJOR_VERSION-0 < 5
      if (code == SWIG_RuntimeError) {
        zend_error(E_WARNING, const_cast<char *>(msg.c_str()));
        /* FIXME: destructors don't have return_value to set. */
        // ZVAL_NULL(return_value);
        return;
      }
#endif
      
      XapianException(code, msg);
    }
  }
  {
    ZVAL_LONG(return_value,result);
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_XapianMSet_convert_to_percent__SWIG_1) {
  Xapian::MSet *arg1 = (Xapian::MSet *) 0 ;
  Xapian::MSetIterator *arg2 = 0 ;
  Xapian::percent result;
  zval **args[1];
  
  SWIG_ResetError();
  /* This function uses a this_ptr*/
  if(ZEND_NUM_ARGS() != 1 || zend_get_parameters_array_ex(1, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*&this_ptr, (void **) &arg1, SWIGTYPE_p_Xapian__MSet, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of XapianMSet_convert_to_percent. Expected SWIGTYPE_p_Xapian__MSet");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    if (SWIG_ConvertPtr(*args[0], (void**)&arg2, SWIGTYPE_p_Xapian__MSetIterator, 0) < 0 || arg2 == NULL) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 2 of XapianMSet_convert_to_percent. Expected SWIGTYPE_p_Xapian__MSetIterator");
    }
  }
  {
    try {
      result = (Xapian::percent)((Xapian::MSet const *)arg1)->convert_to_percent((Xapian::MSetIterator const &)*arg2);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      
#if PHP_MAJOR_VERSION-0 < 5
      if (code == SWIG_RuntimeError) {
        zend_error(E_WARNING, const_cast<char *>(msg.c_str()));
        /* FIXME: destructors don't have return_value to set. */
        // ZVAL_NULL(return_value);
        return;
      }
#endif
      
      XapianException(code, msg);
    }
  }
  {
    ZVAL_LONG(return_value,result);
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_XapianMSet_convert_to_percent) {
  int argc;
  zval **argv[2];
  
  argc = ZEND_NUM_ARGS();
  argv[0] = &this_ptr;
  zend_get_parameters_array_ex(argc,argv+1);
  argc++;
  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) {
        return _wrap_XapianMSet_convert_to_percent__SWIG_1(INTERNAL_FUNCTION_PARAM_PASSTHRU);
      }
    }
  }
  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) {
        return _wrap_XapianMSet_convert_to_percent__SWIG_0(INTERNAL_FUNCTION_PARAM_PASSTHRU);
      }
    }
  }
  
  SWIG_ErrorCode() = E_ERROR;
  SWIG_ErrorMsg() = "No matching function for overloaded 'XapianMSet_convert_to_percent'";
  zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_XapianMSet_get_termfreq) {
  Xapian::MSet *arg1 = (Xapian::MSet *) 0 ;
  std::string arg2 ;
  Xapian::doccount result;
  zval **args[1];
  
  SWIG_ResetError();
  /* This function uses a this_ptr*/
  if(ZEND_NUM_ARGS() != 1 || zend_get_parameters_array_ex(1, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*&this_ptr, (void **) &arg1, SWIGTYPE_p_Xapian__MSet, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of XapianMSet_get_termfreq. Expected SWIGTYPE_p_Xapian__MSet");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    convert_to_string_ex(args[0]);
    arg2 = std::string(Z_STRVAL_PP(args[0]),Z_STRLEN_PP(args[0]));
  }
  {
    try {
      result = (Xapian::doccount)((Xapian::MSet const *)arg1)->get_termfreq(arg2);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      
#if PHP_MAJOR_VERSION-0 < 5
      if (code == SWIG_RuntimeError) {
        zend_error(E_WARNING, const_cast<char *>(msg.c_str()));
        /* FIXME: destructors don't have return_value to set. */
        // ZVAL_NULL(return_value);
        return;
      }
#endif
      
      XapianException(code, msg);
    }
  }
  {
    ZVAL_LONG(return_value,result);
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_XapianMSet_get_termweight) {
  Xapian::MSet *arg1 = (Xapian::MSet *) 0 ;
  std::string arg2 ;
  Xapian::weight result;
  zval **args[1];
  
  SWIG_ResetError();
  /* This function uses a this_ptr*/
  if(ZEND_NUM_ARGS() != 1 || zend_get_parameters_array_ex(1, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*&this_ptr, (void **) &arg1, SWIGTYPE_p_Xapian__MSet, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of XapianMSet_get_termweight. Expected SWIGTYPE_p_Xapian__MSet");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    convert_to_string_ex(args[0]);
    arg2 = std::string(Z_STRVAL_PP(args[0]),Z_STRLEN_PP(args[0]));
  }
  {
    try {
      result = (Xapian::weight)((Xapian::MSet const *)arg1)->get_termweight(arg2);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      
#if PHP_MAJOR_VERSION-0 < 5
      if (code == SWIG_RuntimeError) {
        zend_error(E_WARNING, const_cast<char *>(msg.c_str()));
        /* FIXME: destructors don't have return_value to set. */
        // ZVAL_NULL(return_value);
        return;
      }
#endif
      
      XapianException(code, msg);
    }
  }
  {
    ZVAL_DOUBLE(return_value,result);
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_XapianMSet_get_firstitem) {
  Xapian::MSet *arg1 = (Xapian::MSet *) 0 ;
  Xapian::doccount result;
  
  SWIG_ResetError();
  /* This function uses a this_ptr*/
  if(ZEND_NUM_ARGS() != 0) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*&this_ptr, (void **) &arg1, SWIGTYPE_p_Xapian__MSet, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of XapianMSet_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 (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      
#if PHP_MAJOR_VERSION-0 < 5
      if (code == SWIG_RuntimeError) {
        zend_error(E_WARNING, const_cast<char *>(msg.c_str()));
        /* FIXME: destructors don't have return_value to set. */
        // ZVAL_NULL(return_value);
        return;
      }
#endif
      
      XapianException(code, msg);
    }
  }
  {
    ZVAL_LONG(return_value,result);
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_XapianMSet_get_matches_lower_bound) {
  Xapian::MSet *arg1 = (Xapian::MSet *) 0 ;
  Xapian::doccount result;
  
  SWIG_ResetError();
  /* This function uses a this_ptr*/
  if(ZEND_NUM_ARGS() != 0) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*&this_ptr, (void **) &arg1, SWIGTYPE_p_Xapian__MSet, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of XapianMSet_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 (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      
#if PHP_MAJOR_VERSION-0 < 5
      if (code == SWIG_RuntimeError) {
        zend_error(E_WARNING, const_cast<char *>(msg.c_str()));
        /* FIXME: destructors don't have return_value to set. */
        // ZVAL_NULL(return_value);
        return;
      }
#endif
      
      XapianException(code, msg);
    }
  }
  {
    ZVAL_LONG(return_value,result);
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_XapianMSet_get_matches_estimated) {
  Xapian::MSet *arg1 = (Xapian::MSet *) 0 ;
  Xapian::doccount result;
  
  SWIG_ResetError();
  /* This function uses a this_ptr*/
  if(ZEND_NUM_ARGS() != 0) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*&this_ptr, (void **) &arg1, SWIGTYPE_p_Xapian__MSet, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of XapianMSet_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 (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      
#if PHP_MAJOR_VERSION-0 < 5
      if (code == SWIG_RuntimeError) {
        zend_error(E_WARNING, const_cast<char *>(msg.c_str()));
        /* FIXME: destructors don't have return_value to set. */
        // ZVAL_NULL(return_value);
        return;
      }
#endif
      
      XapianException(code, msg);
    }
  }
  {
    ZVAL_LONG(return_value,result);
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_XapianMSet_get_matches_upper_bound) {
  Xapian::MSet *arg1 = (Xapian::MSet *) 0 ;
  Xapian::doccount result;
  
  SWIG_ResetError();
  /* This function uses a this_ptr*/
  if(ZEND_NUM_ARGS() != 0) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*&this_ptr, (void **) &arg1, SWIGTYPE_p_Xapian__MSet, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of XapianMSet_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 (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      
#if PHP_MAJOR_VERSION-0 < 5
      if (code == SWIG_RuntimeError) {
        zend_error(E_WARNING, const_cast<char *>(msg.c_str()));
        /* FIXME: destructors don't have return_value to set. */
        // ZVAL_NULL(return_value);
        return;
      }
#endif
      
      XapianException(code, msg);
    }
  }
  {
    ZVAL_LONG(return_value,result);
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_XapianMSet_get_max_possible) {
  Xapian::MSet *arg1 = (Xapian::MSet *) 0 ;
  Xapian::weight result;
  
  SWIG_ResetError();
  /* This function uses a this_ptr*/
  if(ZEND_NUM_ARGS() != 0) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*&this_ptr, (void **) &arg1, SWIGTYPE_p_Xapian__MSet, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of XapianMSet_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 (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      
#if PHP_MAJOR_VERSION-0 < 5
      if (code == SWIG_RuntimeError) {
        zend_error(E_WARNING, const_cast<char *>(msg.c_str()));
        /* FIXME: destructors don't have return_value to set. */
        // ZVAL_NULL(return_value);
        return;
      }
#endif
      
      XapianException(code, msg);
    }
  }
  {
    ZVAL_DOUBLE(return_value,result);
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_XapianMSet_get_max_attained) {
  Xapian::MSet *arg1 = (Xapian::MSet *) 0 ;
  Xapian::weight result;
  
  SWIG_ResetError();
  /* This function uses a this_ptr*/
  if(ZEND_NUM_ARGS() != 0) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*&this_ptr, (void **) &arg1, SWIGTYPE_p_Xapian__MSet, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of XapianMSet_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 (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      
#if PHP_MAJOR_VERSION-0 < 5
      if (code == SWIG_RuntimeError) {
        zend_error(E_WARNING, const_cast<char *>(msg.c_str()));
        /* FIXME: destructors don't have return_value to set. */
        // ZVAL_NULL(return_value);
        return;
      }
#endif
      
      XapianException(code, msg);
    }
  }
  {
    ZVAL_DOUBLE(return_value,result);
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_XapianMSet_size) {
  Xapian::MSet *arg1 = (Xapian::MSet *) 0 ;
  Xapian::doccount result;
  
  SWIG_ResetError();
  /* This function uses a this_ptr*/
  if(ZEND_NUM_ARGS() != 0) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*&this_ptr, (void **) &arg1, SWIGTYPE_p_Xapian__MSet, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of XapianMSet_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 (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      
#if PHP_MAJOR_VERSION-0 < 5
      if (code == SWIG_RuntimeError) {
        zend_error(E_WARNING, const_cast<char *>(msg.c_str()));
        /* FIXME: destructors don't have return_value to set. */
        // ZVAL_NULL(return_value);
        return;
      }
#endif
      
      XapianException(code, msg);
    }
  }
  {
    ZVAL_LONG(return_value,result);
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_XapianMSet_empty) {
  Xapian::MSet *arg1 = (Xapian::MSet *) 0 ;
  bool result;
  
  SWIG_ResetError();
  /* This function uses a this_ptr*/
  if(ZEND_NUM_ARGS() != 0) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*&this_ptr, (void **) &arg1, SWIGTYPE_p_Xapian__MSet, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of XapianMSet_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 (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      
#if PHP_MAJOR_VERSION-0 < 5
      if (code == SWIG_RuntimeError) {
        zend_error(E_WARNING, const_cast<char *>(msg.c_str()));
        /* FIXME: destructors don't have return_value to set. */
        // ZVAL_NULL(return_value);
        return;
      }
#endif
      
      XapianException(code, msg);
    }
  }
  {
    ZVAL_BOOL(return_value,(result)?1:0);
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_XapianMSet_is_empty) {
  Xapian::MSet *arg1 = (Xapian::MSet *) 0 ;
  bool result;
  
  SWIG_ResetError();
  /* This function uses a this_ptr*/
  if(ZEND_NUM_ARGS() != 0) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*&this_ptr, (void **) &arg1, SWIGTYPE_p_Xapian__MSet, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of XapianMSet_is_empty. Expected SWIGTYPE_p_Xapian__MSet");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    try {
      result = (bool)Xapian_MSet_is_empty((Xapian::MSet const *)arg1);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      
#if PHP_MAJOR_VERSION-0 < 5
      if (code == SWIG_RuntimeError) {
        zend_error(E_WARNING, const_cast<char *>(msg.c_str()));
        /* FIXME: destructors don't have return_value to set. */
        // ZVAL_NULL(return_value);
        return;
      }
#endif
      
      XapianException(code, msg);
    }
  }
  {
    ZVAL_BOOL(return_value,(result)?1:0);
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_XapianMSet_begin) {
  Xapian::MSet *arg1 = (Xapian::MSet *) 0 ;
  Xapian::MSetIterator result;
  
  SWIG_ResetError();
  /* This function uses a this_ptr*/
  if(ZEND_NUM_ARGS() != 0) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*&this_ptr, (void **) &arg1, SWIGTYPE_p_Xapian__MSet, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of XapianMSet_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 (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      
#if PHP_MAJOR_VERSION-0 < 5
      if (code == SWIG_RuntimeError) {
        zend_error(E_WARNING, const_cast<char *>(msg.c_str()));
        /* FIXME: destructors don't have return_value to set. */
        // ZVAL_NULL(return_value);
        return;
      }
#endif
      
      XapianException(code, msg);
    }
  }
  {
    Xapian::MSetIterator * resultobj = new Xapian::MSetIterator((Xapian::MSetIterator &) result);
    SWIG_SetPointerZval(return_value, (void *)resultobj, SWIGTYPE_p_Xapian__MSetIterator, 1);
  }
  /* Wrap this return value */
  {
    /* ALTERNATIVE Constructor, make an object wrapper */
    zval *obj, *_cPtr;
    MAKE_STD_ZVAL(obj);
    MAKE_STD_ZVAL(_cPtr);
    *_cPtr = *return_value;
    INIT_ZVAL(*return_value);
    object_init_ex(obj,ptr_ce_swig_XapianMSetIterator);
    add_property_zval(obj,"_cPtr",_cPtr);
    *return_value=*obj;
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_XapianMSet_end) {
  Xapian::MSet *arg1 = (Xapian::MSet *) 0 ;
  Xapian::MSetIterator result;
  
  SWIG_ResetError();
  /* This function uses a this_ptr*/
  if(ZEND_NUM_ARGS() != 0) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*&this_ptr, (void **) &arg1, SWIGTYPE_p_Xapian__MSet, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of XapianMSet_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 (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      
#if PHP_MAJOR_VERSION-0 < 5
      if (code == SWIG_RuntimeError) {
        zend_error(E_WARNING, const_cast<char *>(msg.c_str()));
        /* FIXME: destructors don't have return_value to set. */
        // ZVAL_NULL(return_value);
        return;
      }
#endif
      
      XapianException(code, msg);
    }
  }
  {
    Xapian::MSetIterator * resultobj = new Xapian::MSetIterator((Xapian::MSetIterator &) result);
    SWIG_SetPointerZval(return_value, (void *)resultobj, SWIGTYPE_p_Xapian__MSetIterator, 1);
  }
  /* Wrap this return value */
  {
    /* ALTERNATIVE Constructor, make an object wrapper */
    zval *obj, *_cPtr;
    MAKE_STD_ZVAL(obj);
    MAKE_STD_ZVAL(_cPtr);
    *_cPtr = *return_value;
    INIT_ZVAL(*return_value);
    object_init_ex(obj,ptr_ce_swig_XapianMSetIterator);
    add_property_zval(obj,"_cPtr",_cPtr);
    *return_value=*obj;
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_XapianMSet_back) {
  Xapian::MSet *arg1 = (Xapian::MSet *) 0 ;
  Xapian::MSetIterator result;
  
  SWIG_ResetError();
  /* This function uses a this_ptr*/
  if(ZEND_NUM_ARGS() != 0) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*&this_ptr, (void **) &arg1, SWIGTYPE_p_Xapian__MSet, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of XapianMSet_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 (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      
#if PHP_MAJOR_VERSION-0 < 5
      if (code == SWIG_RuntimeError) {
        zend_error(E_WARNING, const_cast<char *>(msg.c_str()));
        /* FIXME: destructors don't have return_value to set. */
        // ZVAL_NULL(return_value);
        return;
      }
#endif
      
      XapianException(code, msg);
    }
  }
  {
    Xapian::MSetIterator * resultobj = new Xapian::MSetIterator((Xapian::MSetIterator &) result);
    SWIG_SetPointerZval(return_value, (void *)resultobj, SWIGTYPE_p_Xapian__MSetIterator, 1);
  }
  /* Wrap this return value */
  {
    /* ALTERNATIVE Constructor, make an object wrapper */
    zval *obj, *_cPtr;
    MAKE_STD_ZVAL(obj);
    MAKE_STD_ZVAL(_cPtr);
    *_cPtr = *return_value;
    INIT_ZVAL(*return_value);
    object_init_ex(obj,ptr_ce_swig_XapianMSetIterator);
    add_property_zval(obj,"_cPtr",_cPtr);
    *return_value=*obj;
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_XapianMSet_get_hit) {
  Xapian::MSet *arg1 = (Xapian::MSet *) 0 ;
  Xapian::doccount arg2 ;
  Xapian::MSetIterator result;
  zval **args[1];
  
  SWIG_ResetError();
  /* This function uses a this_ptr*/
  if(ZEND_NUM_ARGS() != 1 || zend_get_parameters_array_ex(1, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*&this_ptr, (void **) &arg1, SWIGTYPE_p_Xapian__MSet, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of XapianMSet_get_hit. Expected SWIGTYPE_p_Xapian__MSet");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    /*@SWIG:CONVERT_INT_IN@*/
    convert_to_long_ex(args[0]);
    arg2 = (Xapian::doccount) Z_LVAL_PP(args[0]);
    /*@SWIG@*/;
  }
  {
    try {
      result = Xapian_MSet_get_hit((Xapian::MSet const *)arg1,arg2);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      
#if PHP_MAJOR_VERSION-0 < 5
      if (code == SWIG_RuntimeError) {
        zend_error(E_WARNING, const_cast<char *>(msg.c_str()));
        /* FIXME: destructors don't have return_value to set. */
        // ZVAL_NULL(return_value);
        return;
      }
#endif
      
      XapianException(code, msg);
    }
  }
  {
    Xapian::MSetIterator * resultobj = new Xapian::MSetIterator((Xapian::MSetIterator &) result);
    SWIG_SetPointerZval(return_value, (void *)resultobj, SWIGTYPE_p_Xapian__MSetIterator, 1);
  }
  /* Wrap this return value */
  {
    /* ALTERNATIVE Constructor, make an object wrapper */
    zval *obj, *_cPtr;
    MAKE_STD_ZVAL(obj);
    MAKE_STD_ZVAL(_cPtr);
    *_cPtr = *return_value;
    INIT_ZVAL(*return_value);
    object_init_ex(obj,ptr_ce_swig_XapianMSetIterator);
    add_property_zval(obj,"_cPtr",_cPtr);
    *return_value=*obj;
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_XapianMSet_get_document_percentage) {
  Xapian::MSet *arg1 = (Xapian::MSet *) 0 ;
  Xapian::doccount arg2 ;
  int result;
  zval **args[1];
  
  SWIG_ResetError();
  /* This function uses a this_ptr*/
  if(ZEND_NUM_ARGS() != 1 || zend_get_parameters_array_ex(1, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*&this_ptr, (void **) &arg1, SWIGTYPE_p_Xapian__MSet, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of XapianMSet_get_document_percentage. Expected SWIGTYPE_p_Xapian__MSet");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    /*@SWIG:CONVERT_INT_IN@*/
    convert_to_long_ex(args[0]);
    arg2 = (Xapian::doccount) Z_LVAL_PP(args[0]);
    /*@SWIG@*/;
  }
  {
    try {
      result = (int)Xapian_MSet_get_document_percentage((Xapian::MSet const *)arg1,arg2);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      
#if PHP_MAJOR_VERSION-0 < 5
      if (code == SWIG_RuntimeError) {
        zend_error(E_WARNING, const_cast<char *>(msg.c_str()));
        /* FIXME: destructors don't have return_value to set. */
        // ZVAL_NULL(return_value);
        return;
      }
#endif
      
      XapianException(code, msg);
    }
  }
  {
    ZVAL_LONG(return_value,result);
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_XapianMSet_get_document) {
  Xapian::MSet *arg1 = (Xapian::MSet *) 0 ;
  Xapian::doccount arg2 ;
  Xapian::Document result;
  zval **args[1];
  
  SWIG_ResetError();
  /* This function uses a this_ptr*/
  if(ZEND_NUM_ARGS() != 1 || zend_get_parameters_array_ex(1, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*&this_ptr, (void **) &arg1, SWIGTYPE_p_Xapian__MSet, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of XapianMSet_get_document. Expected SWIGTYPE_p_Xapian__MSet");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    /*@SWIG:CONVERT_INT_IN@*/
    convert_to_long_ex(args[0]);
    arg2 = (Xapian::doccount) Z_LVAL_PP(args[0]);
    /*@SWIG@*/;
  }
  {
    try {
      result = Xapian_MSet_get_document((Xapian::MSet const *)arg1,arg2);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      
#if PHP_MAJOR_VERSION-0 < 5
      if (code == SWIG_RuntimeError) {
        zend_error(E_WARNING, const_cast<char *>(msg.c_str()));
        /* FIXME: destructors don't have return_value to set. */
        // ZVAL_NULL(return_value);
        return;
      }
#endif
      
      XapianException(code, msg);
    }
  }
  {
    Xapian::Document * resultobj = new Xapian::Document((Xapian::Document &) result);
    SWIG_SetPointerZval(return_value, (void *)resultobj, SWIGTYPE_p_Xapian__Document, 1);
  }
  /* Wrap this return value */
  {
    /* ALTERNATIVE Constructor, make an object wrapper */
    zval *obj, *_cPtr;
    MAKE_STD_ZVAL(obj);
    MAKE_STD_ZVAL(_cPtr);
    *_cPtr = *return_value;
    INIT_ZVAL(*return_value);
    object_init_ex(obj,ptr_ce_swig_XapianDocument);
    add_property_zval(obj,"_cPtr",_cPtr);
    *return_value=*obj;
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_XapianMSet_get_docid) {
  Xapian::MSet *arg1 = (Xapian::MSet *) 0 ;
  Xapian::doccount arg2 ;
  Xapian::docid result;
  zval **args[1];
  
  SWIG_ResetError();
  /* This function uses a this_ptr*/
  if(ZEND_NUM_ARGS() != 1 || zend_get_parameters_array_ex(1, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*&this_ptr, (void **) &arg1, SWIGTYPE_p_Xapian__MSet, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of XapianMSet_get_docid. Expected SWIGTYPE_p_Xapian__MSet");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    /*@SWIG:CONVERT_INT_IN@*/
    convert_to_long_ex(args[0]);
    arg2 = (Xapian::doccount) Z_LVAL_PP(args[0]);
    /*@SWIG@*/;
  }
  {
    try {
      result = (Xapian::docid)Xapian_MSet_get_docid((Xapian::MSet const *)arg1,arg2);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      
#if PHP_MAJOR_VERSION-0 < 5
      if (code == SWIG_RuntimeError) {
        zend_error(E_WARNING, const_cast<char *>(msg.c_str()));
        /* FIXME: destructors don't have return_value to set. */
        // ZVAL_NULL(return_value);
        return;
      }
#endif
      
      XapianException(code, msg);
    }
  }
  {
    ZVAL_LONG(return_value,result);
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_XapianMSet_get_document_id) {
  Xapian::MSet *arg1 = (Xapian::MSet *) 0 ;
  Xapian::doccount arg2 ;
  Xapian::docid result;
  zval **args[1];
  
  SWIG_ResetError();
  /* This function uses a this_ptr*/
  if(ZEND_NUM_ARGS() != 1 || zend_get_parameters_array_ex(1, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*&this_ptr, (void **) &arg1, SWIGTYPE_p_Xapian__MSet, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of XapianMSet_get_document_id. Expected SWIGTYPE_p_Xapian__MSet");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    /*@SWIG:CONVERT_INT_IN@*/
    convert_to_long_ex(args[0]);
    arg2 = (Xapian::doccount) Z_LVAL_PP(args[0]);
    /*@SWIG@*/;
  }
  {
    try {
      result = (Xapian::docid)Xapian_MSet_get_document_id((Xapian::MSet const *)arg1,arg2);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      
#if PHP_MAJOR_VERSION-0 < 5
      if (code == SWIG_RuntimeError) {
        zend_error(E_WARNING, const_cast<char *>(msg.c_str()));
        /* FIXME: destructors don't have return_value to set. */
        // ZVAL_NULL(return_value);
        return;
      }
#endif
      
      XapianException(code, msg);
    }
  }
  {
    ZVAL_LONG(return_value,result);
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_XapianMSet_get_description) {
  Xapian::MSet *arg1 = (Xapian::MSet *) 0 ;
  std::string result;
  
  SWIG_ResetError();
  /* This function uses a this_ptr*/
  if(ZEND_NUM_ARGS() != 0) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*&this_ptr, (void **) &arg1, SWIGTYPE_p_Xapian__MSet, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of XapianMSet_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 (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      
#if PHP_MAJOR_VERSION-0 < 5
      if (code == SWIG_RuntimeError) {
        zend_error(E_WARNING, const_cast<char *>(msg.c_str()));
        /* FIXME: destructors don't have return_value to set. */
        // ZVAL_NULL(return_value);
        return;
      }
#endif
      
      XapianException(code, msg);
    }
  }
  {
    ZVAL_STRINGL(return_value,const_cast<char*>((&result)->data()),(&result)->length(),1);
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg());
}


/* property handler for class XapianMSet */
static pval _wrap_propget_XapianMSet(zend_property_reference *property_reference) {
  pval result;
  pval **_result;
  zend_llist_element *element = property_reference->elements_list->head;
  zend_overloaded_element *property=(zend_overloaded_element *)element->data;
  result.type = IS_NULL;
  if (_propget_XapianMSet(property_reference, &result)==SUCCESS) return result;
  /* return it ourselves */
  if (zend_hash_find(Z_OBJPROP_P(property_reference->object),Z_STRVAL_P(&(property->element)),1+Z_STRLEN_P(&(property->element)),(void**)&_result)==SUCCESS) {
  zval *_value;
  MAKE_STD_ZVAL(_value);  *_value=**_result;
  INIT_PZVAL(_value);
  zval_copy_ctor(_value);
  return *_value;
  }
  result.type = IS_NULL;
  return result;
}
static int _propget_XapianMSet(zend_property_reference *property_reference, pval *value) {
  /* get the property name */
  zend_llist_element *element = property_reference->elements_list->head;
  zend_overloaded_element *property=(zend_overloaded_element *)element->data;
  char *propname=Z_STRVAL_P(&(property->element));
  return FAILURE;
}

static int _wrap_propset_XapianMSet(zend_property_reference *property_reference, pval *value) { 
  zval * _value;
  zend_llist_element *element = property_reference->elements_list->head;
  zend_overloaded_element *property=(zend_overloaded_element *)element->data;
  if (_propset_XapianMSet(property_reference, value)==SUCCESS) return SUCCESS;
  /* set it ourselves as it is XapianMSet */
  MAKE_STD_ZVAL(_value);
  *_value=*value;
  INIT_PZVAL(_value);
  zval_copy_ctor(_value);
  return add_property_zval_ex(property_reference->object,Z_STRVAL_P(&(property->element)),1+Z_STRLEN_P(&(property->element)),_value);
}
static int _propset_XapianMSet(zend_property_reference *property_reference, pval *value) {
  /* get the property name */
  zend_llist_element *element = property_reference->elements_list->head;
  zend_overloaded_element *property=(zend_overloaded_element *)element->data;
  char *propname=Z_STRVAL_P(&(property->element));
  return FAILURE;
}

ZEND_NAMED_FUNCTION(_wrap_new_XapianMSetIterator__SWIG_0) {
  Xapian::MSetIterator *result = 0 ;
  
  SWIG_ResetError();
  /* NATIVE Constructor */
  if(ZEND_NUM_ARGS() != 0) {
    WRONG_PARAM_COUNT;
  }
  
  {
    try {
      result = (Xapian::MSetIterator *)new Xapian::MSetIterator();
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      
#if PHP_MAJOR_VERSION-0 < 5
      if (code == SWIG_RuntimeError) {
        zend_error(E_WARNING, const_cast<char *>(msg.c_str()));
        /* FIXME: destructors don't have return_value to set. */
        // ZVAL_NULL(return_value);
        return;
      }
#endif
      
      XapianException(code, msg);
    }
  }
  {
    SWIG_SetPointerZval(return_value, (void *)result, SWIGTYPE_p_Xapian__MSetIterator, 1);
  }
  /* Wrap this return value */
  if (this_ptr) {
    /* NATIVE Constructor, use this_ptr */
    zval *_cPtr; MAKE_STD_ZVAL(_cPtr);
    *_cPtr = *return_value;
    INIT_ZVAL(*return_value);
    add_property_zval(this_ptr,"_cPtr",_cPtr);
  } else if (! this_ptr) {
    /* ALTERNATIVE Constructor, make an object wrapper */
    zval *obj, *_cPtr;
    MAKE_STD_ZVAL(obj);
    MAKE_STD_ZVAL(_cPtr);
    *_cPtr = *return_value;
    INIT_ZVAL(*return_value);
    object_init_ex(obj,ptr_ce_swig_XapianMSetIterator);
    add_property_zval(obj,"_cPtr",_cPtr);
    *return_value=*obj;
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_new_XapianMSetIterator__SWIG_1) {
  Xapian::MSetIterator *arg1 = 0 ;
  Xapian::MSetIterator *result = 0 ;
  zval **args[1];
  
  SWIG_ResetError();
  /* NATIVE Constructor */
  if(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_XapianMSetIterator. Expected SWIGTYPE_p_Xapian__MSetIterator");
    }
  }
  {
    try {
      result = (Xapian::MSetIterator *)new Xapian::MSetIterator((Xapian::MSetIterator const &)*arg1);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      
#if PHP_MAJOR_VERSION-0 < 5
      if (code == SWIG_RuntimeError) {
        zend_error(E_WARNING, const_cast<char *>(msg.c_str()));
        /* FIXME: destructors don't have return_value to set. */
        // ZVAL_NULL(return_value);
        return;
      }
#endif
      
      XapianException(code, msg);
    }
  }
  {
    SWIG_SetPointerZval(return_value, (void *)result, SWIGTYPE_p_Xapian__MSetIterator, 1);
  }
  /* Wrap this return value */
  if (this_ptr) {
    /* NATIVE Constructor, use this_ptr */
    zval *_cPtr; MAKE_STD_ZVAL(_cPtr);
    *_cPtr = *return_value;
    INIT_ZVAL(*return_value);
    add_property_zval(this_ptr,"_cPtr",_cPtr);
  } else if (! this_ptr) {
    /* ALTERNATIVE Constructor, make an object wrapper */
    zval *obj, *_cPtr;
    MAKE_STD_ZVAL(obj);
    MAKE_STD_ZVAL(_cPtr);
    *_cPtr = *return_value;
    INIT_ZVAL(*return_value);
    object_init_ex(obj,ptr_ce_swig_XapianMSetIterator);
    add_property_zval(obj,"_cPtr",_cPtr);
    *return_value=*obj;
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_new_XapianMSetIterator) {
  int argc;
  zval **argv[1];
  
  argc = ZEND_NUM_ARGS();
  zend_get_parameters_array_ex(argc,argv);
  if (argc == 0) {
    return _wrap_new_XapianMSetIterator__SWIG_0(INTERNAL_FUNCTION_PARAM_PASSTHRU);
  }
  if (argc == 1) {
    int _v;
    {
      void *ptr;
      _v = (SWIG_ConvertPtr(*argv[0], (void **)&ptr, SWIGTYPE_p_Xapian__MSetIterator, 0) == 0);
    }
    if (_v) {
      return _wrap_new_XapianMSetIterator__SWIG_1(INTERNAL_FUNCTION_PARAM_PASSTHRU);
    }
  }
  
  SWIG_ErrorCode() = E_ERROR;
  SWIG_ErrorMsg() = "No matching function for overloaded 'new_XapianMSetIterator'";
  zend_error(SWIG_ErrorCode(),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_XapianMSetIterator(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 (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      
#if PHP_MAJOR_VERSION-0 < 5
      if (code == SWIG_RuntimeError) {
        zend_error(E_WARNING, const_cast<char *>(msg.c_str()));
        /* FIXME: destructors don't have return_value to set. */
        // ZVAL_NULL(return_value);
        return;
      }
#endif
      
      XapianException(code, msg);
    }
  }
}


ZEND_NAMED_FUNCTION(_wrap_XapianMSetIterator_get_docid) {
  Xapian::MSetIterator *arg1 = (Xapian::MSetIterator *) 0 ;
  Xapian::docid result;
  
  SWIG_ResetError();
  /* This function uses a this_ptr*/
  if(ZEND_NUM_ARGS() != 0) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*&this_ptr, (void **) &arg1, SWIGTYPE_p_Xapian__MSetIterator, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of XapianMSetIterator_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 (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      
#if PHP_MAJOR_VERSION-0 < 5
      if (code == SWIG_RuntimeError) {
        zend_error(E_WARNING, const_cast<char *>(msg.c_str()));
        /* FIXME: destructors don't have return_value to set. */
        // ZVAL_NULL(return_value);
        return;
      }
#endif
      
      XapianException(code, msg);
    }
  }
  {
    ZVAL_LONG(return_value,result);
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_XapianMSetIterator_next) {
  Xapian::MSetIterator *arg1 = (Xapian::MSetIterator *) 0 ;
  
  SWIG_ResetError();
  /* This function uses a this_ptr*/
  if(ZEND_NUM_ARGS() != 0) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*&this_ptr, (void **) &arg1, SWIGTYPE_p_Xapian__MSetIterator, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of XapianMSetIterator_next. Expected SWIGTYPE_p_Xapian__MSetIterator");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    try {
      Xapian_MSetIterator_next(arg1);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      
#if PHP_MAJOR_VERSION-0 < 5
      if (code == SWIG_RuntimeError) {
        zend_error(E_WARNING, const_cast<char *>(msg.c_str()));
        /* FIXME: destructors don't have return_value to set. */
        // ZVAL_NULL(return_value);
        return;
      }
#endif
      
      XapianException(code, msg);
    }
  }
  
  return;
fail:
  zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_XapianMSetIterator_prev) {
  Xapian::MSetIterator *arg1 = (Xapian::MSetIterator *) 0 ;
  
  SWIG_ResetError();
  /* This function uses a this_ptr*/
  if(ZEND_NUM_ARGS() != 0) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*&this_ptr, (void **) &arg1, SWIGTYPE_p_Xapian__MSetIterator, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of XapianMSetIterator_prev. Expected SWIGTYPE_p_Xapian__MSetIterator");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    try {
      Xapian_MSetIterator_prev(arg1);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      
#if PHP_MAJOR_VERSION-0 < 5
      if (code == SWIG_RuntimeError) {
        zend_error(E_WARNING, const_cast<char *>(msg.c_str()));
        /* FIXME: destructors don't have return_value to set. */
        // ZVAL_NULL(return_value);
        return;
      }
#endif
      
      XapianException(code, msg);
    }
  }
  
  return;
fail:
  zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_XapianMSetIterator_equals) {
  Xapian::MSetIterator *arg1 = (Xapian::MSetIterator *) 0 ;
  Xapian::MSetIterator *arg2 = 0 ;
  bool result;
  zval **args[1];
  
  SWIG_ResetError();
  /* This function uses a this_ptr*/
  if(ZEND_NUM_ARGS() != 1 || zend_get_parameters_array_ex(1, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*&this_ptr, (void **) &arg1, SWIGTYPE_p_Xapian__MSetIterator, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of XapianMSetIterator_equals. Expected SWIGTYPE_p_Xapian__MSetIterator");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    if (SWIG_ConvertPtr(*args[0], (void**)&arg2, SWIGTYPE_p_Xapian__MSetIterator, 0) < 0 || arg2 == NULL) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 2 of XapianMSetIterator_equals. Expected SWIGTYPE_p_Xapian__MSetIterator");
    }
  }
  {
    try {
      result = (bool)Xapian_MSetIterator_equals((Xapian::MSetIterator const *)arg1,(Xapian::MSetIterator const &)*arg2);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      
#if PHP_MAJOR_VERSION-0 < 5
      if (code == SWIG_RuntimeError) {
        zend_error(E_WARNING, const_cast<char *>(msg.c_str()));
        /* FIXME: destructors don't have return_value to set. */
        // ZVAL_NULL(return_value);
        return;
      }
#endif
      
      XapianException(code, msg);
    }
  }
  {
    ZVAL_BOOL(return_value,(result)?1:0);
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_XapianMSetIterator_get_document) {
  Xapian::MSetIterator *arg1 = (Xapian::MSetIterator *) 0 ;
  Xapian::Document result;
  
  SWIG_ResetError();
  /* This function uses a this_ptr*/
  if(ZEND_NUM_ARGS() != 0) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*&this_ptr, (void **) &arg1, SWIGTYPE_p_Xapian__MSetIterator, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of XapianMSetIterator_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 (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      
#if PHP_MAJOR_VERSION-0 < 5
      if (code == SWIG_RuntimeError) {
        zend_error(E_WARNING, const_cast<char *>(msg.c_str()));
        /* FIXME: destructors don't have return_value to set. */
        // ZVAL_NULL(return_value);
        return;
      }
#endif
      
      XapianException(code, msg);
    }
  }
  {
    Xapian::Document * resultobj = new Xapian::Document((Xapian::Document &) result);
    SWIG_SetPointerZval(return_value, (void *)resultobj, SWIGTYPE_p_Xapian__Document, 1);
  }
  /* Wrap this return value */
  {
    /* ALTERNATIVE Constructor, make an object wrapper */
    zval *obj, *_cPtr;
    MAKE_STD_ZVAL(obj);
    MAKE_STD_ZVAL(_cPtr);
    *_cPtr = *return_value;
    INIT_ZVAL(*return_value);
    object_init_ex(obj,ptr_ce_swig_XapianDocument);
    add_property_zval(obj,"_cPtr",_cPtr);
    *return_value=*obj;
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_XapianMSetIterator_get_rank) {
  Xapian::MSetIterator *arg1 = (Xapian::MSetIterator *) 0 ;
  Xapian::doccount result;
  
  SWIG_ResetError();
  /* This function uses a this_ptr*/
  if(ZEND_NUM_ARGS() != 0) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*&this_ptr, (void **) &arg1, SWIGTYPE_p_Xapian__MSetIterator, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of XapianMSetIterator_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 (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      
#if PHP_MAJOR_VERSION-0 < 5
      if (code == SWIG_RuntimeError) {
        zend_error(E_WARNING, const_cast<char *>(msg.c_str()));
        /* FIXME: destructors don't have return_value to set. */
        // ZVAL_NULL(return_value);
        return;
      }
#endif
      
      XapianException(code, msg);
    }
  }
  {
    ZVAL_LONG(return_value,result);
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_XapianMSetIterator_get_weight) {
  Xapian::MSetIterator *arg1 = (Xapian::MSetIterator *) 0 ;
  Xapian::weight result;
  
  SWIG_ResetError();
  /* This function uses a this_ptr*/
  if(ZEND_NUM_ARGS() != 0) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*&this_ptr, (void **) &arg1, SWIGTYPE_p_Xapian__MSetIterator, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of XapianMSetIterator_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 (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      
#if PHP_MAJOR_VERSION-0 < 5
      if (code == SWIG_RuntimeError) {
        zend_error(E_WARNING, const_cast<char *>(msg.c_str()));
        /* FIXME: destructors don't have return_value to set. */
        // ZVAL_NULL(return_value);
        return;
      }
#endif
      
      XapianException(code, msg);
    }
  }
  {
    ZVAL_DOUBLE(return_value,result);
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_XapianMSetIterator_get_collapse_count) {
  Xapian::MSetIterator *arg1 = (Xapian::MSetIterator *) 0 ;
  Xapian::doccount result;
  
  SWIG_ResetError();
  /* This function uses a this_ptr*/
  if(ZEND_NUM_ARGS() != 0) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*&this_ptr, (void **) &arg1, SWIGTYPE_p_Xapian__MSetIterator, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of XapianMSetIterator_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 (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      
#if PHP_MAJOR_VERSION-0 < 5
      if (code == SWIG_RuntimeError) {
        zend_error(E_WARNING, const_cast<char *>(msg.c_str()));
        /* FIXME: destructors don't have return_value to set. */
        // ZVAL_NULL(return_value);
        return;
      }
#endif
      
      XapianException(code, msg);
    }
  }
  {
    ZVAL_LONG(return_value,result);
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_XapianMSetIterator_get_percent) {
  Xapian::MSetIterator *arg1 = (Xapian::MSetIterator *) 0 ;
  Xapian::percent result;
  
  SWIG_ResetError();
  /* This function uses a this_ptr*/
  if(ZEND_NUM_ARGS() != 0) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*&this_ptr, (void **) &arg1, SWIGTYPE_p_Xapian__MSetIterator, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of XapianMSetIterator_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 (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      
#if PHP_MAJOR_VERSION-0 < 5
      if (code == SWIG_RuntimeError) {
        zend_error(E_WARNING, const_cast<char *>(msg.c_str()));
        /* FIXME: destructors don't have return_value to set. */
        // ZVAL_NULL(return_value);
        return;
      }
#endif
      
      XapianException(code, msg);
    }
  }
  {
    ZVAL_LONG(return_value,result);
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_XapianMSetIterator_get_description) {
  Xapian::MSetIterator *arg1 = (Xapian::MSetIterator *) 0 ;
  std::string result;
  
  SWIG_ResetError();
  /* This function uses a this_ptr*/
  if(ZEND_NUM_ARGS() != 0) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*&this_ptr, (void **) &arg1, SWIGTYPE_p_Xapian__MSetIterator, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of XapianMSetIterator_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 (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      
#if PHP_MAJOR_VERSION-0 < 5
      if (code == SWIG_RuntimeError) {
        zend_error(E_WARNING, const_cast<char *>(msg.c_str()));
        /* FIXME: destructors don't have return_value to set. */
        // ZVAL_NULL(return_value);
        return;
      }
#endif
      
      XapianException(code, msg);
    }
  }
  {
    ZVAL_STRINGL(return_value,const_cast<char*>((&result)->data()),(&result)->length(),1);
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg());
}


/* property handler for class XapianMSetIterator */
static pval _wrap_propget_XapianMSetIterator(zend_property_reference *property_reference) {
  pval result;
  pval **_result;
  zend_llist_element *element = property_reference->elements_list->head;
  zend_overloaded_element *property=(zend_overloaded_element *)element->data;
  result.type = IS_NULL;
  if (_propget_XapianMSetIterator(property_reference, &result)==SUCCESS) return result;
  /* return it ourselves */
  if (zend_hash_find(Z_OBJPROP_P(property_reference->object),Z_STRVAL_P(&(property->element)),1+Z_STRLEN_P(&(property->element)),(void**)&_result)==SUCCESS) {
  zval *_value;
  MAKE_STD_ZVAL(_value);  *_value=**_result;
  INIT_PZVAL(_value);
  zval_copy_ctor(_value);
  return *_value;
  }
  result.type = IS_NULL;
  return result;
}
static int _propget_XapianMSetIterator(zend_property_reference *property_reference, pval *value) {
  /* get the property name */
  zend_llist_element *element = property_reference->elements_list->head;
  zend_overloaded_element *property=(zend_overloaded_element *)element->data;
  char *propname=Z_STRVAL_P(&(property->element));
  return FAILURE;
}

static int _wrap_propset_XapianMSetIterator(zend_property_reference *property_reference, pval *value) { 
  zval * _value;
  zend_llist_element *element = property_reference->elements_list->head;
  zend_overloaded_element *property=(zend_overloaded_element *)element->data;
  if (_propset_XapianMSetIterator(property_reference, value)==SUCCESS) return SUCCESS;
  /* set it ourselves as it is XapianMSetIterator */
  MAKE_STD_ZVAL(_value);
  *_value=*value;
  INIT_PZVAL(_value);
  zval_copy_ctor(_value);
  return add_property_zval_ex(property_reference->object,Z_STRVAL_P(&(property->element)),1+Z_STRLEN_P(&(property->element)),_value);
}
static int _propset_XapianMSetIterator(zend_property_reference *property_reference, pval *value) {
  /* get the property name */
  zend_llist_element *element = property_reference->elements_list->head;
  zend_overloaded_element *property=(zend_overloaded_element *)element->data;
  char *propname=Z_STRVAL_P(&(property->element));
  return FAILURE;
}

ZEND_NAMED_FUNCTION(_wrap_new_XapianESet__SWIG_0) {
  Xapian::ESet *result = 0 ;
  
  SWIG_ResetError();
  /* NATIVE Constructor */
  if(ZEND_NUM_ARGS() != 0) {
    WRONG_PARAM_COUNT;
  }
  
  {
    try {
      result = (Xapian::ESet *)new Xapian::ESet();
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      
#if PHP_MAJOR_VERSION-0 < 5
      if (code == SWIG_RuntimeError) {
        zend_error(E_WARNING, const_cast<char *>(msg.c_str()));
        /* FIXME: destructors don't have return_value to set. */
        // ZVAL_NULL(return_value);
        return;
      }
#endif
      
      XapianException(code, msg);
    }
  }
  {
    SWIG_SetPointerZval(return_value, (void *)result, SWIGTYPE_p_Xapian__ESet, 1);
  }
  /* Wrap this return value */
  if (this_ptr) {
    /* NATIVE Constructor, use this_ptr */
    zval *_cPtr; MAKE_STD_ZVAL(_cPtr);
    *_cPtr = *return_value;
    INIT_ZVAL(*return_value);
    add_property_zval(this_ptr,"_cPtr",_cPtr);
  } else if (! this_ptr) {
    /* ALTERNATIVE Constructor, make an object wrapper */
    zval *obj, *_cPtr;
    MAKE_STD_ZVAL(obj);
    MAKE_STD_ZVAL(_cPtr);
    *_cPtr = *return_value;
    INIT_ZVAL(*return_value);
    object_init_ex(obj,ptr_ce_swig_XapianESet);
    add_property_zval(obj,"_cPtr",_cPtr);
    *return_value=*obj;
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_new_XapianESet__SWIG_1) {
  Xapian::ESet *arg1 = 0 ;
  Xapian::ESet *result = 0 ;
  zval **args[1];
  
  SWIG_ResetError();
  /* NATIVE Constructor */
  if(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_XapianESet. Expected SWIGTYPE_p_Xapian__ESet");
    }
  }
  {
    try {
      result = (Xapian::ESet *)new Xapian::ESet((Xapian::ESet const &)*arg1);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      
#if PHP_MAJOR_VERSION-0 < 5
      if (code == SWIG_RuntimeError) {
        zend_error(E_WARNING, const_cast<char *>(msg.c_str()));
        /* FIXME: destructors don't have return_value to set. */
        // ZVAL_NULL(return_value);
        return;
      }
#endif
      
      XapianException(code, msg);
    }
  }
  {
    SWIG_SetPointerZval(return_value, (void *)result, SWIGTYPE_p_Xapian__ESet, 1);
  }
  /* Wrap this return value */
  if (this_ptr) {
    /* NATIVE Constructor, use this_ptr */
    zval *_cPtr; MAKE_STD_ZVAL(_cPtr);
    *_cPtr = *return_value;
    INIT_ZVAL(*return_value);
    add_property_zval(this_ptr,"_cPtr",_cPtr);
  } else if (! this_ptr) {
    /* ALTERNATIVE Constructor, make an object wrapper */
    zval *obj, *_cPtr;
    MAKE_STD_ZVAL(obj);
    MAKE_STD_ZVAL(_cPtr);
    *_cPtr = *return_value;
    INIT_ZVAL(*return_value);
    object_init_ex(obj,ptr_ce_swig_XapianESet);
    add_property_zval(obj,"_cPtr",_cPtr);
    *return_value=*obj;
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_new_XapianESet) {
  int argc;
  zval **argv[1];
  
  argc = ZEND_NUM_ARGS();
  zend_get_parameters_array_ex(argc,argv);
  if (argc == 0) {
    return _wrap_new_XapianESet__SWIG_0(INTERNAL_FUNCTION_PARAM_PASSTHRU);
  }
  if (argc == 1) {
    int _v;
    {
      void *ptr;
      _v = (SWIG_ConvertPtr(*argv[0], (void **)&ptr, SWIGTYPE_p_Xapian__ESet, 0) == 0);
    }
    if (_v) {
      return _wrap_new_XapianESet__SWIG_1(INTERNAL_FUNCTION_PARAM_PASSTHRU);
    }
  }
  
  SWIG_ErrorCode() = E_ERROR;
  SWIG_ErrorMsg() = "No matching function for overloaded 'new_XapianESet'";
  zend_error(SWIG_ErrorCode(),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_XapianESet(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 (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      
#if PHP_MAJOR_VERSION-0 < 5
      if (code == SWIG_RuntimeError) {
        zend_error(E_WARNING, const_cast<char *>(msg.c_str()));
        /* FIXME: destructors don't have return_value to set. */
        // ZVAL_NULL(return_value);
        return;
      }
#endif
      
      XapianException(code, msg);
    }
  }
}


ZEND_NAMED_FUNCTION(_wrap_XapianESet_get_ebound) {
  Xapian::ESet *arg1 = (Xapian::ESet *) 0 ;
  Xapian::termcount result;
  
  SWIG_ResetError();
  /* This function uses a this_ptr*/
  if(ZEND_NUM_ARGS() != 0) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*&this_ptr, (void **) &arg1, SWIGTYPE_p_Xapian__ESet, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of XapianESet_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 (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      
#if PHP_MAJOR_VERSION-0 < 5
      if (code == SWIG_RuntimeError) {
        zend_error(E_WARNING, const_cast<char *>(msg.c_str()));
        /* FIXME: destructors don't have return_value to set. */
        // ZVAL_NULL(return_value);
        return;
      }
#endif
      
      XapianException(code, msg);
    }
  }
  {
    ZVAL_LONG(return_value,result);
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_XapianESet_size) {
  Xapian::ESet *arg1 = (Xapian::ESet *) 0 ;
  Xapian::termcount result;
  
  SWIG_ResetError();
  /* This function uses a this_ptr*/
  if(ZEND_NUM_ARGS() != 0) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*&this_ptr, (void **) &arg1, SWIGTYPE_p_Xapian__ESet, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of XapianESet_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 (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      
#if PHP_MAJOR_VERSION-0 < 5
      if (code == SWIG_RuntimeError) {
        zend_error(E_WARNING, const_cast<char *>(msg.c_str()));
        /* FIXME: destructors don't have return_value to set. */
        // ZVAL_NULL(return_value);
        return;
      }
#endif
      
      XapianException(code, msg);
    }
  }
  {
    ZVAL_LONG(return_value,result);
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_XapianESet_empty) {
  Xapian::ESet *arg1 = (Xapian::ESet *) 0 ;
  bool result;
  
  SWIG_ResetError();
  /* This function uses a this_ptr*/
  if(ZEND_NUM_ARGS() != 0) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*&this_ptr, (void **) &arg1, SWIGTYPE_p_Xapian__ESet, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of XapianESet_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 (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      
#if PHP_MAJOR_VERSION-0 < 5
      if (code == SWIG_RuntimeError) {
        zend_error(E_WARNING, const_cast<char *>(msg.c_str()));
        /* FIXME: destructors don't have return_value to set. */
        // ZVAL_NULL(return_value);
        return;
      }
#endif
      
      XapianException(code, msg);
    }
  }
  {
    ZVAL_BOOL(return_value,(result)?1:0);
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_XapianESet_is_empty) {
  Xapian::ESet *arg1 = (Xapian::ESet *) 0 ;
  bool result;
  
  SWIG_ResetError();
  /* This function uses a this_ptr*/
  if(ZEND_NUM_ARGS() != 0) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*&this_ptr, (void **) &arg1, SWIGTYPE_p_Xapian__ESet, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of XapianESet_is_empty. Expected SWIGTYPE_p_Xapian__ESet");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    try {
      result = (bool)Xapian_ESet_is_empty((Xapian::ESet const *)arg1);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      
#if PHP_MAJOR_VERSION-0 < 5
      if (code == SWIG_RuntimeError) {
        zend_error(E_WARNING, const_cast<char *>(msg.c_str()));
        /* FIXME: destructors don't have return_value to set. */
        // ZVAL_NULL(return_value);
        return;
      }
#endif
      
      XapianException(code, msg);
    }
  }
  {
    ZVAL_BOOL(return_value,(result)?1:0);
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_XapianESet_begin) {
  Xapian::ESet *arg1 = (Xapian::ESet *) 0 ;
  Xapian::ESetIterator result;
  
  SWIG_ResetError();
  /* This function uses a this_ptr*/
  if(ZEND_NUM_ARGS() != 0) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*&this_ptr, (void **) &arg1, SWIGTYPE_p_Xapian__ESet, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of XapianESet_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 (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      
#if PHP_MAJOR_VERSION-0 < 5
      if (code == SWIG_RuntimeError) {
        zend_error(E_WARNING, const_cast<char *>(msg.c_str()));
        /* FIXME: destructors don't have return_value to set. */
        // ZVAL_NULL(return_value);
        return;
      }
#endif
      
      XapianException(code, msg);
    }
  }
  {
    Xapian::ESetIterator * resultobj = new Xapian::ESetIterator((Xapian::ESetIterator &) result);
    SWIG_SetPointerZval(return_value, (void *)resultobj, SWIGTYPE_p_Xapian__ESetIterator, 1);
  }
  /* Wrap this return value */
  {
    /* ALTERNATIVE Constructor, make an object wrapper */
    zval *obj, *_cPtr;
    MAKE_STD_ZVAL(obj);
    MAKE_STD_ZVAL(_cPtr);
    *_cPtr = *return_value;
    INIT_ZVAL(*return_value);
    object_init_ex(obj,ptr_ce_swig_XapianESetIterator);
    add_property_zval(obj,"_cPtr",_cPtr);
    *return_value=*obj;
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_XapianESet_end) {
  Xapian::ESet *arg1 = (Xapian::ESet *) 0 ;
  Xapian::ESetIterator result;
  
  SWIG_ResetError();
  /* This function uses a this_ptr*/
  if(ZEND_NUM_ARGS() != 0) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*&this_ptr, (void **) &arg1, SWIGTYPE_p_Xapian__ESet, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of XapianESet_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 (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      
#if PHP_MAJOR_VERSION-0 < 5
      if (code == SWIG_RuntimeError) {
        zend_error(E_WARNING, const_cast<char *>(msg.c_str()));
        /* FIXME: destructors don't have return_value to set. */
        // ZVAL_NULL(return_value);
        return;
      }
#endif
      
      XapianException(code, msg);
    }
  }
  {
    Xapian::ESetIterator * resultobj = new Xapian::ESetIterator((Xapian::ESetIterator &) result);
    SWIG_SetPointerZval(return_value, (void *)resultobj, SWIGTYPE_p_Xapian__ESetIterator, 1);
  }
  /* Wrap this return value */
  {
    /* ALTERNATIVE Constructor, make an object wrapper */
    zval *obj, *_cPtr;
    MAKE_STD_ZVAL(obj);
    MAKE_STD_ZVAL(_cPtr);
    *_cPtr = *return_value;
    INIT_ZVAL(*return_value);
    object_init_ex(obj,ptr_ce_swig_XapianESetIterator);
    add_property_zval(obj,"_cPtr",_cPtr);
    *return_value=*obj;
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_XapianESet_back) {
  Xapian::ESet *arg1 = (Xapian::ESet *) 0 ;
  Xapian::ESetIterator result;
  
  SWIG_ResetError();
  /* This function uses a this_ptr*/
  if(ZEND_NUM_ARGS() != 0) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*&this_ptr, (void **) &arg1, SWIGTYPE_p_Xapian__ESet, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of XapianESet_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 (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      
#if PHP_MAJOR_VERSION-0 < 5
      if (code == SWIG_RuntimeError) {
        zend_error(E_WARNING, const_cast<char *>(msg.c_str()));
        /* FIXME: destructors don't have return_value to set. */
        // ZVAL_NULL(return_value);
        return;
      }
#endif
      
      XapianException(code, msg);
    }
  }
  {
    Xapian::ESetIterator * resultobj = new Xapian::ESetIterator((Xapian::ESetIterator &) result);
    SWIG_SetPointerZval(return_value, (void *)resultobj, SWIGTYPE_p_Xapian__ESetIterator, 1);
  }
  /* Wrap this return value */
  {
    /* ALTERNATIVE Constructor, make an object wrapper */
    zval *obj, *_cPtr;
    MAKE_STD_ZVAL(obj);
    MAKE_STD_ZVAL(_cPtr);
    *_cPtr = *return_value;
    INIT_ZVAL(*return_value);
    object_init_ex(obj,ptr_ce_swig_XapianESetIterator);
    add_property_zval(obj,"_cPtr",_cPtr);
    *return_value=*obj;
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_XapianESet_get_description) {
  Xapian::ESet *arg1 = (Xapian::ESet *) 0 ;
  std::string result;
  
  SWIG_ResetError();
  /* This function uses a this_ptr*/
  if(ZEND_NUM_ARGS() != 0) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*&this_ptr, (void **) &arg1, SWIGTYPE_p_Xapian__ESet, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of XapianESet_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 (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      
#if PHP_MAJOR_VERSION-0 < 5
      if (code == SWIG_RuntimeError) {
        zend_error(E_WARNING, const_cast<char *>(msg.c_str()));
        /* FIXME: destructors don't have return_value to set. */
        // ZVAL_NULL(return_value);
        return;
      }
#endif
      
      XapianException(code, msg);
    }
  }
  {
    ZVAL_STRINGL(return_value,const_cast<char*>((&result)->data()),(&result)->length(),1);
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg());
}


/* property handler for class XapianESet */
static pval _wrap_propget_XapianESet(zend_property_reference *property_reference) {
  pval result;
  pval **_result;
  zend_llist_element *element = property_reference->elements_list->head;
  zend_overloaded_element *property=(zend_overloaded_element *)element->data;
  result.type = IS_NULL;
  if (_propget_XapianESet(property_reference, &result)==SUCCESS) return result;
  /* return it ourselves */
  if (zend_hash_find(Z_OBJPROP_P(property_reference->object),Z_STRVAL_P(&(property->element)),1+Z_STRLEN_P(&(property->element)),(void**)&_result)==SUCCESS) {
  zval *_value;
  MAKE_STD_ZVAL(_value);  *_value=**_result;
  INIT_PZVAL(_value);
  zval_copy_ctor(_value);
  return *_value;
  }
  result.type = IS_NULL;
  return result;
}
static int _propget_XapianESet(zend_property_reference *property_reference, pval *value) {
  /* get the property name */
  zend_llist_element *element = property_reference->elements_list->head;
  zend_overloaded_element *property=(zend_overloaded_element *)element->data;
  char *propname=Z_STRVAL_P(&(property->element));
  return FAILURE;
}

static int _wrap_propset_XapianESet(zend_property_reference *property_reference, pval *value) { 
  zval * _value;
  zend_llist_element *element = property_reference->elements_list->head;
  zend_overloaded_element *property=(zend_overloaded_element *)element->data;
  if (_propset_XapianESet(property_reference, value)==SUCCESS) return SUCCESS;
  /* set it ourselves as it is XapianESet */
  MAKE_STD_ZVAL(_value);
  *_value=*value;
  INIT_PZVAL(_value);
  zval_copy_ctor(_value);
  return add_property_zval_ex(property_reference->object,Z_STRVAL_P(&(property->element)),1+Z_STRLEN_P(&(property->element)),_value);
}
static int _propset_XapianESet(zend_property_reference *property_reference, pval *value) {
  /* get the property name */
  zend_llist_element *element = property_reference->elements_list->head;
  zend_overloaded_element *property=(zend_overloaded_element *)element->data;
  char *propname=Z_STRVAL_P(&(property->element));
  return FAILURE;
}

ZEND_NAMED_FUNCTION(_wrap_new_XapianESetIterator__SWIG_0) {
  Xapian::ESetIterator *result = 0 ;
  
  SWIG_ResetError();
  /* NATIVE Constructor */
  if(ZEND_NUM_ARGS() != 0) {
    WRONG_PARAM_COUNT;
  }
  
  {
    try {
      result = (Xapian::ESetIterator *)new Xapian::ESetIterator();
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      
#if PHP_MAJOR_VERSION-0 < 5
      if (code == SWIG_RuntimeError) {
        zend_error(E_WARNING, const_cast<char *>(msg.c_str()));
        /* FIXME: destructors don't have return_value to set. */
        // ZVAL_NULL(return_value);
        return;
      }
#endif
      
      XapianException(code, msg);
    }
  }
  {
    SWIG_SetPointerZval(return_value, (void *)result, SWIGTYPE_p_Xapian__ESetIterator, 1);
  }
  /* Wrap this return value */
  if (this_ptr) {
    /* NATIVE Constructor, use this_ptr */
    zval *_cPtr; MAKE_STD_ZVAL(_cPtr);
    *_cPtr = *return_value;
    INIT_ZVAL(*return_value);
    add_property_zval(this_ptr,"_cPtr",_cPtr);
  } else if (! this_ptr) {
    /* ALTERNATIVE Constructor, make an object wrapper */
    zval *obj, *_cPtr;
    MAKE_STD_ZVAL(obj);
    MAKE_STD_ZVAL(_cPtr);
    *_cPtr = *return_value;
    INIT_ZVAL(*return_value);
    object_init_ex(obj,ptr_ce_swig_XapianESetIterator);
    add_property_zval(obj,"_cPtr",_cPtr);
    *return_value=*obj;
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_new_XapianESetIterator__SWIG_1) {
  Xapian::ESetIterator *arg1 = 0 ;
  Xapian::ESetIterator *result = 0 ;
  zval **args[1];
  
  SWIG_ResetError();
  /* NATIVE Constructor */
  if(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_XapianESetIterator. Expected SWIGTYPE_p_Xapian__ESetIterator");
    }
  }
  {
    try {
      result = (Xapian::ESetIterator *)new Xapian::ESetIterator((Xapian::ESetIterator const &)*arg1);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      
#if PHP_MAJOR_VERSION-0 < 5
      if (code == SWIG_RuntimeError) {
        zend_error(E_WARNING, const_cast<char *>(msg.c_str()));
        /* FIXME: destructors don't have return_value to set. */
        // ZVAL_NULL(return_value);
        return;
      }
#endif
      
      XapianException(code, msg);
    }
  }
  {
    SWIG_SetPointerZval(return_value, (void *)result, SWIGTYPE_p_Xapian__ESetIterator, 1);
  }
  /* Wrap this return value */
  if (this_ptr) {
    /* NATIVE Constructor, use this_ptr */
    zval *_cPtr; MAKE_STD_ZVAL(_cPtr);
    *_cPtr = *return_value;
    INIT_ZVAL(*return_value);
    add_property_zval(this_ptr,"_cPtr",_cPtr);
  } else if (! this_ptr) {
    /* ALTERNATIVE Constructor, make an object wrapper */
    zval *obj, *_cPtr;
    MAKE_STD_ZVAL(obj);
    MAKE_STD_ZVAL(_cPtr);
    *_cPtr = *return_value;
    INIT_ZVAL(*return_value);
    object_init_ex(obj,ptr_ce_swig_XapianESetIterator);
    add_property_zval(obj,"_cPtr",_cPtr);
    *return_value=*obj;
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_new_XapianESetIterator) {
  int argc;
  zval **argv[1];
  
  argc = ZEND_NUM_ARGS();
  zend_get_parameters_array_ex(argc,argv);
  if (argc == 0) {
    return _wrap_new_XapianESetIterator__SWIG_0(INTERNAL_FUNCTION_PARAM_PASSTHRU);
  }
  if (argc == 1) {
    int _v;
    {
      void *ptr;
      _v = (SWIG_ConvertPtr(*argv[0], (void **)&ptr, SWIGTYPE_p_Xapian__ESetIterator, 0) == 0);
    }
    if (_v) {
      return _wrap_new_XapianESetIterator__SWIG_1(INTERNAL_FUNCTION_PARAM_PASSTHRU);
    }
  }
  
  SWIG_ErrorCode() = E_ERROR;
  SWIG_ErrorMsg() = "No matching function for overloaded 'new_XapianESetIterator'";
  zend_error(SWIG_ErrorCode(),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_XapianESetIterator(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 (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      
#if PHP_MAJOR_VERSION-0 < 5
      if (code == SWIG_RuntimeError) {
        zend_error(E_WARNING, const_cast<char *>(msg.c_str()));
        /* FIXME: destructors don't have return_value to set. */
        // ZVAL_NULL(return_value);
        return;
      }
#endif
      
      XapianException(code, msg);
    }
  }
}


ZEND_NAMED_FUNCTION(_wrap_XapianESetIterator_get_termname) {
  Xapian::ESetIterator *arg1 = (Xapian::ESetIterator *) 0 ;
  std::string result;
  
  SWIG_ResetError();
  /* This function uses a this_ptr*/
  if(ZEND_NUM_ARGS() != 0) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*&this_ptr, (void **) &arg1, SWIGTYPE_p_Xapian__ESetIterator, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of XapianESetIterator_get_termname. Expected SWIGTYPE_p_Xapian__ESetIterator");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    try {
      result = Xapian_ESetIterator_get_termname((Xapian::ESetIterator const *)arg1);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      
#if PHP_MAJOR_VERSION-0 < 5
      if (code == SWIG_RuntimeError) {
        zend_error(E_WARNING, const_cast<char *>(msg.c_str()));
        /* FIXME: destructors don't have return_value to set. */
        // ZVAL_NULL(return_value);
        return;
      }
#endif
      
      XapianException(code, msg);
    }
  }
  {
    ZVAL_STRINGL(return_value,const_cast<char*>((&result)->data()),(&result)->length(),1);
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_XapianESetIterator_next) {
  Xapian::ESetIterator *arg1 = (Xapian::ESetIterator *) 0 ;
  
  SWIG_ResetError();
  /* This function uses a this_ptr*/
  if(ZEND_NUM_ARGS() != 0) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*&this_ptr, (void **) &arg1, SWIGTYPE_p_Xapian__ESetIterator, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of XapianESetIterator_next. Expected SWIGTYPE_p_Xapian__ESetIterator");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    try {
      Xapian_ESetIterator_next(arg1);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      
#if PHP_MAJOR_VERSION-0 < 5
      if (code == SWIG_RuntimeError) {
        zend_error(E_WARNING, const_cast<char *>(msg.c_str()));
        /* FIXME: destructors don't have return_value to set. */
        // ZVAL_NULL(return_value);
        return;
      }
#endif
      
      XapianException(code, msg);
    }
  }
  
  return;
fail:
  zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_XapianESetIterator_prev) {
  Xapian::ESetIterator *arg1 = (Xapian::ESetIterator *) 0 ;
  
  SWIG_ResetError();
  /* This function uses a this_ptr*/
  if(ZEND_NUM_ARGS() != 0) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*&this_ptr, (void **) &arg1, SWIGTYPE_p_Xapian__ESetIterator, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of XapianESetIterator_prev. Expected SWIGTYPE_p_Xapian__ESetIterator");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    try {
      Xapian_ESetIterator_prev(arg1);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      
#if PHP_MAJOR_VERSION-0 < 5
      if (code == SWIG_RuntimeError) {
        zend_error(E_WARNING, const_cast<char *>(msg.c_str()));
        /* FIXME: destructors don't have return_value to set. */
        // ZVAL_NULL(return_value);
        return;
      }
#endif
      
      XapianException(code, msg);
    }
  }
  
  return;
fail:
  zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_XapianESetIterator_equals) {
  Xapian::ESetIterator *arg1 = (Xapian::ESetIterator *) 0 ;
  Xapian::ESetIterator *arg2 = 0 ;
  bool result;
  zval **args[1];
  
  SWIG_ResetError();
  /* This function uses a this_ptr*/
  if(ZEND_NUM_ARGS() != 1 || zend_get_parameters_array_ex(1, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*&this_ptr, (void **) &arg1, SWIGTYPE_p_Xapian__ESetIterator, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of XapianESetIterator_equals. Expected SWIGTYPE_p_Xapian__ESetIterator");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    if (SWIG_ConvertPtr(*args[0], (void**)&arg2, SWIGTYPE_p_Xapian__ESetIterator, 0) < 0 || arg2 == NULL) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 2 of XapianESetIterator_equals. Expected SWIGTYPE_p_Xapian__ESetIterator");
    }
  }
  {
    try {
      result = (bool)Xapian_ESetIterator_equals((Xapian::ESetIterator const *)arg1,(Xapian::ESetIterator const &)*arg2);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      
#if PHP_MAJOR_VERSION-0 < 5
      if (code == SWIG_RuntimeError) {
        zend_error(E_WARNING, const_cast<char *>(msg.c_str()));
        /* FIXME: destructors don't have return_value to set. */
        // ZVAL_NULL(return_value);
        return;
      }
#endif
      
      XapianException(code, msg);
    }
  }
  {
    ZVAL_BOOL(return_value,(result)?1:0);
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_XapianESetIterator_get_weight) {
  Xapian::ESetIterator *arg1 = (Xapian::ESetIterator *) 0 ;
  Xapian::weight result;
  
  SWIG_ResetError();
  /* This function uses a this_ptr*/
  if(ZEND_NUM_ARGS() != 0) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*&this_ptr, (void **) &arg1, SWIGTYPE_p_Xapian__ESetIterator, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of XapianESetIterator_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 (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      
#if PHP_MAJOR_VERSION-0 < 5
      if (code == SWIG_RuntimeError) {
        zend_error(E_WARNING, const_cast<char *>(msg.c_str()));
        /* FIXME: destructors don't have return_value to set. */
        // ZVAL_NULL(return_value);
        return;
      }
#endif
      
      XapianException(code, msg);
    }
  }
  {
    ZVAL_DOUBLE(return_value,result);
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_XapianESetIterator_get_description) {
  Xapian::ESetIterator *arg1 = (Xapian::ESetIterator *) 0 ;
  std::string result;
  
  SWIG_ResetError();
  /* This function uses a this_ptr*/
  if(ZEND_NUM_ARGS() != 0) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*&this_ptr, (void **) &arg1, SWIGTYPE_p_Xapian__ESetIterator, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of XapianESetIterator_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 (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      
#if PHP_MAJOR_VERSION-0 < 5
      if (code == SWIG_RuntimeError) {
        zend_error(E_WARNING, const_cast<char *>(msg.c_str()));
        /* FIXME: destructors don't have return_value to set. */
        // ZVAL_NULL(return_value);
        return;
      }
#endif
      
      XapianException(code, msg);
    }
  }
  {
    ZVAL_STRINGL(return_value,const_cast<char*>((&result)->data()),(&result)->length(),1);
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg());
}


/* property handler for class XapianESetIterator */
static pval _wrap_propget_XapianESetIterator(zend_property_reference *property_reference) {
  pval result;
  pval **_result;
  zend_llist_element *element = property_reference->elements_list->head;
  zend_overloaded_element *property=(zend_overloaded_element *)element->data;
  result.type = IS_NULL;
  if (_propget_XapianESetIterator(property_reference, &result)==SUCCESS) return result;
  /* return it ourselves */
  if (zend_hash_find(Z_OBJPROP_P(property_reference->object),Z_STRVAL_P(&(property->element)),1+Z_STRLEN_P(&(property->element)),(void**)&_result)==SUCCESS) {
  zval *_value;
  MAKE_STD_ZVAL(_value);  *_value=**_result;
  INIT_PZVAL(_value);
  zval_copy_ctor(_value);
  return *_value;
  }
  result.type = IS_NULL;
  return result;
}
static int _propget_XapianESetIterator(zend_property_reference *property_reference, pval *value) {
  /* get the property name */
  zend_llist_element *element = property_reference->elements_list->head;
  zend_overloaded_element *property=(zend_overloaded_element *)element->data;
  char *propname=Z_STRVAL_P(&(property->element));
  return FAILURE;
}

static int _wrap_propset_XapianESetIterator(zend_property_reference *property_reference, pval *value) { 
  zval * _value;
  zend_llist_element *element = property_reference->elements_list->head;
  zend_overloaded_element *property=(zend_overloaded_element *)element->data;
  if (_propset_XapianESetIterator(property_reference, value)==SUCCESS) return SUCCESS;
  /* set it ourselves as it is XapianESetIterator */
  MAKE_STD_ZVAL(_value);
  *_value=*value;
  INIT_PZVAL(_value);
  zval_copy_ctor(_value);
  return add_property_zval_ex(property_reference->object,Z_STRVAL_P(&(property->element)),1+Z_STRLEN_P(&(property->element)),_value);
}
static int _propset_XapianESetIterator(zend_property_reference *property_reference, pval *value) {
  /* get the property name */
  zend_llist_element *element = property_reference->elements_list->head;
  zend_overloaded_element *property=(zend_overloaded_element *)element->data;
  char *propname=Z_STRVAL_P(&(property->element));
  return FAILURE;
}

ZEND_NAMED_FUNCTION(_wrap_new_XapianRSet__SWIG_0) {
  Xapian::RSet *arg1 = 0 ;
  Xapian::RSet *result = 0 ;
  zval **args[1];
  
  SWIG_ResetError();
  /* NATIVE Constructor */
  if(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_XapianRSet. Expected SWIGTYPE_p_Xapian__RSet");
    }
  }
  {
    try {
      result = (Xapian::RSet *)new Xapian::RSet((Xapian::RSet const &)*arg1);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      
#if PHP_MAJOR_VERSION-0 < 5
      if (code == SWIG_RuntimeError) {
        zend_error(E_WARNING, const_cast<char *>(msg.c_str()));
        /* FIXME: destructors don't have return_value to set. */
        // ZVAL_NULL(return_value);
        return;
      }
#endif
      
      XapianException(code, msg);
    }
  }
  {
    SWIG_SetPointerZval(return_value, (void *)result, SWIGTYPE_p_Xapian__RSet, 1);
  }
  /* Wrap this return value */
  if (this_ptr) {
    /* NATIVE Constructor, use this_ptr */
    zval *_cPtr; MAKE_STD_ZVAL(_cPtr);
    *_cPtr = *return_value;
    INIT_ZVAL(*return_value);
    add_property_zval(this_ptr,"_cPtr",_cPtr);
  } else if (! this_ptr) {
    /* ALTERNATIVE Constructor, make an object wrapper */
    zval *obj, *_cPtr;
    MAKE_STD_ZVAL(obj);
    MAKE_STD_ZVAL(_cPtr);
    *_cPtr = *return_value;
    INIT_ZVAL(*return_value);
    object_init_ex(obj,ptr_ce_swig_XapianRSet);
    add_property_zval(obj,"_cPtr",_cPtr);
    *return_value=*obj;
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_new_XapianRSet__SWIG_1) {
  Xapian::RSet *result = 0 ;
  
  SWIG_ResetError();
  /* NATIVE Constructor */
  if(ZEND_NUM_ARGS() != 0) {
    WRONG_PARAM_COUNT;
  }
  
  {
    try {
      result = (Xapian::RSet *)new Xapian::RSet();
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      
#if PHP_MAJOR_VERSION-0 < 5
      if (code == SWIG_RuntimeError) {
        zend_error(E_WARNING, const_cast<char *>(msg.c_str()));
        /* FIXME: destructors don't have return_value to set. */
        // ZVAL_NULL(return_value);
        return;
      }
#endif
      
      XapianException(code, msg);
    }
  }
  {
    SWIG_SetPointerZval(return_value, (void *)result, SWIGTYPE_p_Xapian__RSet, 1);
  }
  /* Wrap this return value */
  if (this_ptr) {
    /* NATIVE Constructor, use this_ptr */
    zval *_cPtr; MAKE_STD_ZVAL(_cPtr);
    *_cPtr = *return_value;
    INIT_ZVAL(*return_value);
    add_property_zval(this_ptr,"_cPtr",_cPtr);
  } else if (! this_ptr) {
    /* ALTERNATIVE Constructor, make an object wrapper */
    zval *obj, *_cPtr;
    MAKE_STD_ZVAL(obj);
    MAKE_STD_ZVAL(_cPtr);
    *_cPtr = *return_value;
    INIT_ZVAL(*return_value);
    object_init_ex(obj,ptr_ce_swig_XapianRSet);
    add_property_zval(obj,"_cPtr",_cPtr);
    *return_value=*obj;
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_new_XapianRSet) {
  int argc;
  zval **argv[1];
  
  argc = ZEND_NUM_ARGS();
  zend_get_parameters_array_ex(argc,argv);
  if (argc == 0) {
    return _wrap_new_XapianRSet__SWIG_1(INTERNAL_FUNCTION_PARAM_PASSTHRU);
  }
  if (argc == 1) {
    int _v;
    {
      void *ptr;
      _v = (SWIG_ConvertPtr(*argv[0], (void **)&ptr, SWIGTYPE_p_Xapian__RSet, 0) == 0);
    }
    if (_v) {
      return _wrap_new_XapianRSet__SWIG_0(INTERNAL_FUNCTION_PARAM_PASSTHRU);
    }
  }
  
  SWIG_ErrorCode() = E_ERROR;
  SWIG_ErrorMsg() = "No matching function for overloaded 'new_XapianRSet'";
  zend_error(SWIG_ErrorCode(),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_XapianRSet(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 (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      
#if PHP_MAJOR_VERSION-0 < 5
      if (code == SWIG_RuntimeError) {
        zend_error(E_WARNING, const_cast<char *>(msg.c_str()));
        /* FIXME: destructors don't have return_value to set. */
        // ZVAL_NULL(return_value);
        return;
      }
#endif
      
      XapianException(code, msg);
    }
  }
}


ZEND_NAMED_FUNCTION(_wrap_XapianRSet_size) {
  Xapian::RSet *arg1 = (Xapian::RSet *) 0 ;
  Xapian::doccount result;
  
  SWIG_ResetError();
  /* This function uses a this_ptr*/
  if(ZEND_NUM_ARGS() != 0) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*&this_ptr, (void **) &arg1, SWIGTYPE_p_Xapian__RSet, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of XapianRSet_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 (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      
#if PHP_MAJOR_VERSION-0 < 5
      if (code == SWIG_RuntimeError) {
        zend_error(E_WARNING, const_cast<char *>(msg.c_str()));
        /* FIXME: destructors don't have return_value to set. */
        // ZVAL_NULL(return_value);
        return;
      }
#endif
      
      XapianException(code, msg);
    }
  }
  {
    ZVAL_LONG(return_value,result);
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_XapianRSet_empty) {
  Xapian::RSet *arg1 = (Xapian::RSet *) 0 ;
  bool result;
  
  SWIG_ResetError();
  /* This function uses a this_ptr*/
  if(ZEND_NUM_ARGS() != 0) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*&this_ptr, (void **) &arg1, SWIGTYPE_p_Xapian__RSet, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of XapianRSet_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 (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      
#if PHP_MAJOR_VERSION-0 < 5
      if (code == SWIG_RuntimeError) {
        zend_error(E_WARNING, const_cast<char *>(msg.c_str()));
        /* FIXME: destructors don't have return_value to set. */
        // ZVAL_NULL(return_value);
        return;
      }
#endif
      
      XapianException(code, msg);
    }
  }
  {
    ZVAL_BOOL(return_value,(result)?1:0);
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_XapianRSet_is_empty) {
  Xapian::RSet *arg1 = (Xapian::RSet *) 0 ;
  bool result;
  
  SWIG_ResetError();
  /* This function uses a this_ptr*/
  if(ZEND_NUM_ARGS() != 0) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*&this_ptr, (void **) &arg1, SWIGTYPE_p_Xapian__RSet, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of XapianRSet_is_empty. Expected SWIGTYPE_p_Xapian__RSet");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    try {
      result = (bool)Xapian_RSet_is_empty((Xapian::RSet const *)arg1);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      
#if PHP_MAJOR_VERSION-0 < 5
      if (code == SWIG_RuntimeError) {
        zend_error(E_WARNING, const_cast<char *>(msg.c_str()));
        /* FIXME: destructors don't have return_value to set. */
        // ZVAL_NULL(return_value);
        return;
      }
#endif
      
      XapianException(code, msg);
    }
  }
  {
    ZVAL_BOOL(return_value,(result)?1:0);
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_XapianRSet_add_document__SWIG_0) {
  Xapian::RSet *arg1 = (Xapian::RSet *) 0 ;
  Xapian::docid arg2 ;
  zval **args[1];
  
  SWIG_ResetError();
  /* This function uses a this_ptr*/
  if(ZEND_NUM_ARGS() != 1 || zend_get_parameters_array_ex(1, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*&this_ptr, (void **) &arg1, SWIGTYPE_p_Xapian__RSet, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of XapianRSet_add_document. Expected SWIGTYPE_p_Xapian__RSet");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    /*@SWIG:CONVERT_INT_IN@*/
    convert_to_long_ex(args[0]);
    arg2 = (Xapian::docid) Z_LVAL_PP(args[0]);
    /*@SWIG@*/;
  }
  {
    try {
      (arg1)->add_document(arg2);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      
#if PHP_MAJOR_VERSION-0 < 5
      if (code == SWIG_RuntimeError) {
        zend_error(E_WARNING, const_cast<char *>(msg.c_str()));
        /* FIXME: destructors don't have return_value to set. */
        // ZVAL_NULL(return_value);
        return;
      }
#endif
      
      XapianException(code, msg);
    }
  }
  
  return;
fail:
  zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_XapianRSet_add_document__SWIG_1) {
  Xapian::RSet *arg1 = (Xapian::RSet *) 0 ;
  Xapian::MSetIterator *arg2 = 0 ;
  zval **args[1];
  
  SWIG_ResetError();
  /* This function uses a this_ptr*/
  if(ZEND_NUM_ARGS() != 1 || zend_get_parameters_array_ex(1, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*&this_ptr, (void **) &arg1, SWIGTYPE_p_Xapian__RSet, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of XapianRSet_add_document. Expected SWIGTYPE_p_Xapian__RSet");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    if (SWIG_ConvertPtr(*args[0], (void**)&arg2, SWIGTYPE_p_Xapian__MSetIterator, 0) < 0 || arg2 == NULL) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 2 of XapianRSet_add_document. Expected SWIGTYPE_p_Xapian__MSetIterator");
    }
  }
  {
    try {
      (arg1)->add_document(*arg2);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      
#if PHP_MAJOR_VERSION-0 < 5
      if (code == SWIG_RuntimeError) {
        zend_error(E_WARNING, const_cast<char *>(msg.c_str()));
        /* FIXME: destructors don't have return_value to set. */
        // ZVAL_NULL(return_value);
        return;
      }
#endif
      
      XapianException(code, msg);
    }
  }
  
  return;
fail:
  zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_XapianRSet_add_document) {
  int argc;
  zval **argv[2];
  
  argc = ZEND_NUM_ARGS();
  argv[0] = &this_ptr;
  zend_get_parameters_array_ex(argc,argv+1);
  argc++;
  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) {
        return _wrap_XapianRSet_add_document__SWIG_1(INTERNAL_FUNCTION_PARAM_PASSTHRU);
      }
    }
  }
  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) {
        return _wrap_XapianRSet_add_document__SWIG_0(INTERNAL_FUNCTION_PARAM_PASSTHRU);
      }
    }
  }
  
  SWIG_ErrorCode() = E_ERROR;
  SWIG_ErrorMsg() = "No matching function for overloaded 'XapianRSet_add_document'";
  zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_XapianRSet_remove_document__SWIG_0) {
  Xapian::RSet *arg1 = (Xapian::RSet *) 0 ;
  Xapian::docid arg2 ;
  zval **args[1];
  
  SWIG_ResetError();
  /* This function uses a this_ptr*/
  if(ZEND_NUM_ARGS() != 1 || zend_get_parameters_array_ex(1, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*&this_ptr, (void **) &arg1, SWIGTYPE_p_Xapian__RSet, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of XapianRSet_remove_document. Expected SWIGTYPE_p_Xapian__RSet");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    /*@SWIG:CONVERT_INT_IN@*/
    convert_to_long_ex(args[0]);
    arg2 = (Xapian::docid) Z_LVAL_PP(args[0]);
    /*@SWIG@*/;
  }
  {
    try {
      (arg1)->remove_document(arg2);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      
#if PHP_MAJOR_VERSION-0 < 5
      if (code == SWIG_RuntimeError) {
        zend_error(E_WARNING, const_cast<char *>(msg.c_str()));
        /* FIXME: destructors don't have return_value to set. */
        // ZVAL_NULL(return_value);
        return;
      }
#endif
      
      XapianException(code, msg);
    }
  }
  
  return;
fail:
  zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_XapianRSet_remove_document__SWIG_1) {
  Xapian::RSet *arg1 = (Xapian::RSet *) 0 ;
  Xapian::MSetIterator *arg2 = 0 ;
  zval **args[1];
  
  SWIG_ResetError();
  /* This function uses a this_ptr*/
  if(ZEND_NUM_ARGS() != 1 || zend_get_parameters_array_ex(1, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*&this_ptr, (void **) &arg1, SWIGTYPE_p_Xapian__RSet, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of XapianRSet_remove_document. Expected SWIGTYPE_p_Xapian__RSet");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    if (SWIG_ConvertPtr(*args[0], (void**)&arg2, SWIGTYPE_p_Xapian__MSetIterator, 0) < 0 || arg2 == NULL) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 2 of XapianRSet_remove_document. Expected SWIGTYPE_p_Xapian__MSetIterator");
    }
  }
  {
    try {
      (arg1)->remove_document(*arg2);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      
#if PHP_MAJOR_VERSION-0 < 5
      if (code == SWIG_RuntimeError) {
        zend_error(E_WARNING, const_cast<char *>(msg.c_str()));
        /* FIXME: destructors don't have return_value to set. */
        // ZVAL_NULL(return_value);
        return;
      }
#endif
      
      XapianException(code, msg);
    }
  }
  
  return;
fail:
  zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_XapianRSet_remove_document) {
  int argc;
  zval **argv[2];
  
  argc = ZEND_NUM_ARGS();
  argv[0] = &this_ptr;
  zend_get_parameters_array_ex(argc,argv+1);
  argc++;
  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) {
        return _wrap_XapianRSet_remove_document__SWIG_1(INTERNAL_FUNCTION_PARAM_PASSTHRU);
      }
    }
  }
  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) {
        return _wrap_XapianRSet_remove_document__SWIG_0(INTERNAL_FUNCTION_PARAM_PASSTHRU);
      }
    }
  }
  
  SWIG_ErrorCode() = E_ERROR;
  SWIG_ErrorMsg() = "No matching function for overloaded 'XapianRSet_remove_document'";
  zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_XapianRSet_contains__SWIG_0) {
  Xapian::RSet *arg1 = (Xapian::RSet *) 0 ;
  Xapian::docid arg2 ;
  bool result;
  zval **args[1];
  
  SWIG_ResetError();
  /* This function uses a this_ptr*/
  if(ZEND_NUM_ARGS() != 1 || zend_get_parameters_array_ex(1, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*&this_ptr, (void **) &arg1, SWIGTYPE_p_Xapian__RSet, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of XapianRSet_contains. Expected SWIGTYPE_p_Xapian__RSet");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    /*@SWIG:CONVERT_INT_IN@*/
    convert_to_long_ex(args[0]);
    arg2 = (Xapian::docid) Z_LVAL_PP(args[0]);
    /*@SWIG@*/;
  }
  {
    try {
      result = (bool)(arg1)->contains(arg2);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      
#if PHP_MAJOR_VERSION-0 < 5
      if (code == SWIG_RuntimeError) {
        zend_error(E_WARNING, const_cast<char *>(msg.c_str()));
        /* FIXME: destructors don't have return_value to set. */
        // ZVAL_NULL(return_value);
        return;
      }
#endif
      
      XapianException(code, msg);
    }
  }
  {
    ZVAL_BOOL(return_value,(result)?1:0);
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_XapianRSet_contains__SWIG_1) {
  Xapian::RSet *arg1 = (Xapian::RSet *) 0 ;
  Xapian::MSetIterator *arg2 = 0 ;
  bool result;
  zval **args[1];
  
  SWIG_ResetError();
  /* This function uses a this_ptr*/
  if(ZEND_NUM_ARGS() != 1 || zend_get_parameters_array_ex(1, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*&this_ptr, (void **) &arg1, SWIGTYPE_p_Xapian__RSet, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of XapianRSet_contains. Expected SWIGTYPE_p_Xapian__RSet");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    if (SWIG_ConvertPtr(*args[0], (void**)&arg2, SWIGTYPE_p_Xapian__MSetIterator, 0) < 0 || arg2 == NULL) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 2 of XapianRSet_contains. Expected SWIGTYPE_p_Xapian__MSetIterator");
    }
  }
  {
    try {
      result = (bool)(arg1)->contains(*arg2);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      
#if PHP_MAJOR_VERSION-0 < 5
      if (code == SWIG_RuntimeError) {
        zend_error(E_WARNING, const_cast<char *>(msg.c_str()));
        /* FIXME: destructors don't have return_value to set. */
        // ZVAL_NULL(return_value);
        return;
      }
#endif
      
      XapianException(code, msg);
    }
  }
  {
    ZVAL_BOOL(return_value,(result)?1:0);
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_XapianRSet_contains) {
  int argc;
  zval **argv[2];
  
  argc = ZEND_NUM_ARGS();
  argv[0] = &this_ptr;
  zend_get_parameters_array_ex(argc,argv+1);
  argc++;
  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) {
        return _wrap_XapianRSet_contains__SWIG_1(INTERNAL_FUNCTION_PARAM_PASSTHRU);
      }
    }
  }
  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) {
        return _wrap_XapianRSet_contains__SWIG_0(INTERNAL_FUNCTION_PARAM_PASSTHRU);
      }
    }
  }
  
  SWIG_ErrorCode() = E_ERROR;
  SWIG_ErrorMsg() = "No matching function for overloaded 'XapianRSet_contains'";
  zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_XapianRSet_get_description) {
  Xapian::RSet *arg1 = (Xapian::RSet *) 0 ;
  std::string result;
  
  SWIG_ResetError();
  /* This function uses a this_ptr*/
  if(ZEND_NUM_ARGS() != 0) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*&this_ptr, (void **) &arg1, SWIGTYPE_p_Xapian__RSet, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of XapianRSet_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 (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      
#if PHP_MAJOR_VERSION-0 < 5
      if (code == SWIG_RuntimeError) {
        zend_error(E_WARNING, const_cast<char *>(msg.c_str()));
        /* FIXME: destructors don't have return_value to set. */
        // ZVAL_NULL(return_value);
        return;
      }
#endif
      
      XapianException(code, msg);
    }
  }
  {
    ZVAL_STRINGL(return_value,const_cast<char*>((&result)->data()),(&result)->length(),1);
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg());
}


/* property handler for class XapianRSet */
static pval _wrap_propget_XapianRSet(zend_property_reference *property_reference) {
  pval result;
  pval **_result;
  zend_llist_element *element = property_reference->elements_list->head;
  zend_overloaded_element *property=(zend_overloaded_element *)element->data;
  result.type = IS_NULL;
  if (_propget_XapianRSet(property_reference, &result)==SUCCESS) return result;
  /* return it ourselves */
  if (zend_hash_find(Z_OBJPROP_P(property_reference->object),Z_STRVAL_P(&(property->element)),1+Z_STRLEN_P(&(property->element)),(void**)&_result)==SUCCESS) {
  zval *_value;
  MAKE_STD_ZVAL(_value);  *_value=**_result;
  INIT_PZVAL(_value);
  zval_copy_ctor(_value);
  return *_value;
  }
  result.type = IS_NULL;
  return result;
}
static int _propget_XapianRSet(zend_property_reference *property_reference, pval *value) {
  /* get the property name */
  zend_llist_element *element = property_reference->elements_list->head;
  zend_overloaded_element *property=(zend_overloaded_element *)element->data;
  char *propname=Z_STRVAL_P(&(property->element));
  return FAILURE;
}

static int _wrap_propset_XapianRSet(zend_property_reference *property_reference, pval *value) { 
  zval * _value;
  zend_llist_element *element = property_reference->elements_list->head;
  zend_overloaded_element *property=(zend_overloaded_element *)element->data;
  if (_propset_XapianRSet(property_reference, value)==SUCCESS) return SUCCESS;
  /* set it ourselves as it is XapianRSet */
  MAKE_STD_ZVAL(_value);
  *_value=*value;
  INIT_PZVAL(_value);
  zval_copy_ctor(_value);
  return add_property_zval_ex(property_reference->object,Z_STRVAL_P(&(property->element)),1+Z_STRLEN_P(&(property->element)),_value);
}
static int _propset_XapianRSet(zend_property_reference *property_reference, pval *value) {
  /* get the property name */
  zend_llist_element *element = property_reference->elements_list->head;
  zend_overloaded_element *property=(zend_overloaded_element *)element->data;
  char *propname=Z_STRVAL_P(&(property->element));
  return FAILURE;
}

ZEND_NAMED_FUNCTION(_wrap_new_XapianEnquire) {
  Xapian::Database *arg1 = 0 ;
  Xapian::Enquire *result = 0 ;
  zval **args[1];
  
  SWIG_ResetError();
  /* NATIVE Constructor */
  if(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_XapianEnquire. Expected SWIGTYPE_p_Xapian__Database");
    }
  }
  {
    try {
      result = (Xapian::Enquire *)new Xapian::Enquire((Xapian::Database const &)*arg1);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      
#if PHP_MAJOR_VERSION-0 < 5
      if (code == SWIG_RuntimeError) {
        zend_error(E_WARNING, const_cast<char *>(msg.c_str()));
        /* FIXME: destructors don't have return_value to set. */
        // ZVAL_NULL(return_value);
        return;
      }
#endif
      
      XapianException(code, msg);
    }
  }
  {
    SWIG_SetPointerZval(return_value, (void *)result, SWIGTYPE_p_Xapian__Enquire, 1);
  }
  /* Wrap this return value */
  if (this_ptr) {
    /* NATIVE Constructor, use this_ptr */
    zval *_cPtr; MAKE_STD_ZVAL(_cPtr);
    *_cPtr = *return_value;
    INIT_ZVAL(*return_value);
    add_property_zval(this_ptr,"_cPtr",_cPtr);
  } else if (! this_ptr) {
    /* ALTERNATIVE Constructor, make an object wrapper */
    zval *obj, *_cPtr;
    MAKE_STD_ZVAL(obj);
    MAKE_STD_ZVAL(_cPtr);
    *_cPtr = *return_value;
    INIT_ZVAL(*return_value);
    object_init_ex(obj,ptr_ce_swig_XapianEnquire);
    add_property_zval(obj,"_cPtr",_cPtr);
    *return_value=*obj;
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),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_XapianEnquire(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 (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      
#if PHP_MAJOR_VERSION-0 < 5
      if (code == SWIG_RuntimeError) {
        zend_error(E_WARNING, const_cast<char *>(msg.c_str()));
        /* FIXME: destructors don't have return_value to set. */
        // ZVAL_NULL(return_value);
        return;
      }
#endif
      
      XapianException(code, msg);
    }
  }
}


ZEND_NAMED_FUNCTION(_wrap_XapianEnquire_set_query__SWIG_0) {
  Xapian::Enquire *arg1 = (Xapian::Enquire *) 0 ;
  Xapian::Query *arg2 = 0 ;
  Xapian::termcount arg3 ;
  zval **args[2];
  
  SWIG_ResetError();
  /* This function uses a this_ptr*/
  if(ZEND_NUM_ARGS() != 2 || zend_get_parameters_array_ex(2, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*&this_ptr, (void **) &arg1, SWIGTYPE_p_Xapian__Enquire, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of XapianEnquire_set_query. Expected SWIGTYPE_p_Xapian__Enquire");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    if (SWIG_ConvertPtr(*args[0], (void**)&arg2, SWIGTYPE_p_Xapian__Query, 0) < 0 || arg2 == NULL) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 2 of XapianEnquire_set_query. Expected SWIGTYPE_p_Xapian__Query");
    }
  }
  {
    /*@SWIG:CONVERT_INT_IN@*/
    convert_to_long_ex(args[1]);
    arg3 = (Xapian::termcount) Z_LVAL_PP(args[1]);
    /*@SWIG@*/;
  }
  {
    try {
      (arg1)->set_query((Xapian::Query const &)*arg2,arg3);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      
#if PHP_MAJOR_VERSION-0 < 5
      if (code == SWIG_RuntimeError) {
        zend_error(E_WARNING, const_cast<char *>(msg.c_str()));
        /* FIXME: destructors don't have return_value to set. */
        // ZVAL_NULL(return_value);
        return;
      }
#endif
      
      XapianException(code, msg);
    }
  }
  
  return;
fail:
  zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_XapianEnquire_set_query__SWIG_1) {
  Xapian::Enquire *arg1 = (Xapian::Enquire *) 0 ;
  Xapian::Query *arg2 = 0 ;
  zval **args[1];
  
  SWIG_ResetError();
  /* This function uses a this_ptr*/
  if(ZEND_NUM_ARGS() != 1 || zend_get_parameters_array_ex(1, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*&this_ptr, (void **) &arg1, SWIGTYPE_p_Xapian__Enquire, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of XapianEnquire_set_query. Expected SWIGTYPE_p_Xapian__Enquire");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    if (SWIG_ConvertPtr(*args[0], (void**)&arg2, SWIGTYPE_p_Xapian__Query, 0) < 0 || arg2 == NULL) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 2 of XapianEnquire_set_query. Expected SWIGTYPE_p_Xapian__Query");
    }
  }
  {
    try {
      (arg1)->set_query((Xapian::Query const &)*arg2);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      
#if PHP_MAJOR_VERSION-0 < 5
      if (code == SWIG_RuntimeError) {
        zend_error(E_WARNING, const_cast<char *>(msg.c_str()));
        /* FIXME: destructors don't have return_value to set. */
        // ZVAL_NULL(return_value);
        return;
      }
#endif
      
      XapianException(code, msg);
    }
  }
  
  return;
fail:
  zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_XapianEnquire_set_query) {
  int argc;
  zval **argv[3];
  
  argc = ZEND_NUM_ARGS();
  argv[0] = &this_ptr;
  zend_get_parameters_array_ex(argc,argv+1);
  argc++;
  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) {
        return _wrap_XapianEnquire_set_query__SWIG_1(INTERNAL_FUNCTION_PARAM_PASSTHRU);
      }
    }
  }
  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) {
          return _wrap_XapianEnquire_set_query__SWIG_0(INTERNAL_FUNCTION_PARAM_PASSTHRU);
        }
      }
    }
  }
  
  SWIG_ErrorCode() = E_ERROR;
  SWIG_ErrorMsg() = "No matching function for overloaded 'XapianEnquire_set_query'";
  zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_XapianEnquire_get_query) {
  Xapian::Enquire *arg1 = (Xapian::Enquire *) 0 ;
  Xapian::Query *result = 0 ;
  
  SWIG_ResetError();
  /* This function uses a this_ptr*/
  if(ZEND_NUM_ARGS() != 0) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*&this_ptr, (void **) &arg1, SWIGTYPE_p_Xapian__Enquire, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of XapianEnquire_get_query. Expected SWIGTYPE_p_Xapian__Enquire");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    try {
      {
        Xapian::Query const &_result_ref = (arg1)->get_query();
        result = (Xapian::Query *) &_result_ref;
      }
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      
#if PHP_MAJOR_VERSION-0 < 5
      if (code == SWIG_RuntimeError) {
        zend_error(E_WARNING, const_cast<char *>(msg.c_str()));
        /* FIXME: destructors don't have return_value to set. */
        // ZVAL_NULL(return_value);
        return;
      }
#endif
      
      XapianException(code, msg);
    }
  }
  {
    SWIG_SetPointerZval(return_value, (void *)result, SWIGTYPE_p_Xapian__Query, 0);
  }
  /* Wrap this return value */
  {
    /* ALTERNATIVE Constructor, make an object wrapper */
    zval *obj, *_cPtr;
    MAKE_STD_ZVAL(obj);
    MAKE_STD_ZVAL(_cPtr);
    *_cPtr = *return_value;
    INIT_ZVAL(*return_value);
    object_init_ex(obj,ptr_ce_swig_XapianQuery);
    add_property_zval(obj,"_cPtr",_cPtr);
    *return_value=*obj;
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_XapianEnquire_set_weighting_scheme) {
  Xapian::Enquire *arg1 = (Xapian::Enquire *) 0 ;
  Xapian::Weight *arg2 = 0 ;
  zval **args[1];
  
  SWIG_ResetError();
  /* This function uses a this_ptr*/
  if(ZEND_NUM_ARGS() != 1 || zend_get_parameters_array_ex(1, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*&this_ptr, (void **) &arg1, SWIGTYPE_p_Xapian__Enquire, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of XapianEnquire_set_weighting_scheme. Expected SWIGTYPE_p_Xapian__Enquire");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    if (SWIG_ConvertPtr(*args[0], (void**)&arg2, SWIGTYPE_p_Xapian__Weight, 0) < 0 || arg2 == NULL) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 2 of XapianEnquire_set_weighting_scheme. Expected SWIGTYPE_p_Xapian__Weight");
    }
  }
  {
    try {
      (arg1)->set_weighting_scheme((Xapian::Weight const &)*arg2);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      
#if PHP_MAJOR_VERSION-0 < 5
      if (code == SWIG_RuntimeError) {
        zend_error(E_WARNING, const_cast<char *>(msg.c_str()));
        /* FIXME: destructors don't have return_value to set. */
        // ZVAL_NULL(return_value);
        return;
      }
#endif
      
      XapianException(code, msg);
    }
  }
  
  return;
fail:
  zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_XapianEnquire_set_collapse_key) {
  Xapian::Enquire *arg1 = (Xapian::Enquire *) 0 ;
  Xapian::valueno arg2 ;
  zval **args[1];
  
  SWIG_ResetError();
  /* This function uses a this_ptr*/
  if(ZEND_NUM_ARGS() != 1 || zend_get_parameters_array_ex(1, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*&this_ptr, (void **) &arg1, SWIGTYPE_p_Xapian__Enquire, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of XapianEnquire_set_collapse_key. Expected SWIGTYPE_p_Xapian__Enquire");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    /*@SWIG:CONVERT_INT_IN@*/
    convert_to_long_ex(args[0]);
    arg2 = (Xapian::valueno) Z_LVAL_PP(args[0]);
    /*@SWIG@*/;
  }
  {
    try {
      (arg1)->set_collapse_key(arg2);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      
#if PHP_MAJOR_VERSION-0 < 5
      if (code == SWIG_RuntimeError) {
        zend_error(E_WARNING, const_cast<char *>(msg.c_str()));
        /* FIXME: destructors don't have return_value to set. */
        // ZVAL_NULL(return_value);
        return;
      }
#endif
      
      XapianException(code, msg);
    }
  }
  
  return;
fail:
  zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_XapianEnquire_set_docid_order) {
  Xapian::Enquire *arg1 = (Xapian::Enquire *) 0 ;
  Xapian::Enquire::docid_order arg2 ;
  zval **args[1];
  
  SWIG_ResetError();
  /* This function uses a this_ptr*/
  if(ZEND_NUM_ARGS() != 1 || zend_get_parameters_array_ex(1, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*&this_ptr, (void **) &arg1, SWIGTYPE_p_Xapian__Enquire, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of XapianEnquire_set_docid_order. Expected SWIGTYPE_p_Xapian__Enquire");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    /*@SWIG:CONVERT_INT_IN@*/
    convert_to_long_ex(args[0]);
    arg2 = (Xapian::Enquire::docid_order) Z_LVAL_PP(args[0]);
    /*@SWIG@*/;
  }
  {
    try {
      (arg1)->set_docid_order(arg2);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      
#if PHP_MAJOR_VERSION-0 < 5
      if (code == SWIG_RuntimeError) {
        zend_error(E_WARNING, const_cast<char *>(msg.c_str()));
        /* FIXME: destructors don't have return_value to set. */
        // ZVAL_NULL(return_value);
        return;
      }
#endif
      
      XapianException(code, msg);
    }
  }
  
  return;
fail:
  zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_XapianEnquire_set_sort_forward) {
  Xapian::Enquire *arg1 = (Xapian::Enquire *) 0 ;
  bool arg2 ;
  zval **args[1];
  
  SWIG_ResetError();
  /* This function uses a this_ptr*/
  if(ZEND_NUM_ARGS() != 1 || zend_get_parameters_array_ex(1, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*&this_ptr, (void **) &arg1, SWIGTYPE_p_Xapian__Enquire, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of XapianEnquire_set_sort_forward. Expected SWIGTYPE_p_Xapian__Enquire");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    /*@SWIG:CONVERT_BOOL_IN@*/
    convert_to_boolean_ex(args[0]);
    arg2 = (bool) Z_LVAL_PP(args[0]);
    /*@SWIG@*/;
  }
  {
    try {
      (arg1)->set_sort_forward(arg2);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      
#if PHP_MAJOR_VERSION-0 < 5
      if (code == SWIG_RuntimeError) {
        zend_error(E_WARNING, const_cast<char *>(msg.c_str()));
        /* FIXME: destructors don't have return_value to set. */
        // ZVAL_NULL(return_value);
        return;
      }
#endif
      
      XapianException(code, msg);
    }
  }
  
  return;
fail:
  zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_XapianEnquire_set_cutoff__SWIG_0) {
  Xapian::Enquire *arg1 = (Xapian::Enquire *) 0 ;
  int arg2 ;
  Xapian::weight arg3 ;
  zval **args[2];
  
  SWIG_ResetError();
  /* This function uses a this_ptr*/
  if(ZEND_NUM_ARGS() != 2 || zend_get_parameters_array_ex(2, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*&this_ptr, (void **) &arg1, SWIGTYPE_p_Xapian__Enquire, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of XapianEnquire_set_cutoff. Expected SWIGTYPE_p_Xapian__Enquire");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    /*@SWIG:CONVERT_INT_IN@*/
    convert_to_long_ex(args[0]);
    arg2 = (int) Z_LVAL_PP(args[0]);
    /*@SWIG@*/;
  }
  {
    /*@SWIG:CONVERT_FLOAT_IN@*/
    convert_to_double_ex(args[1]);
    arg3 = (Xapian::weight) Z_DVAL_PP(args[1]);
    /*@SWIG@*/;
  }
  {
    try {
      (arg1)->set_cutoff(arg2,arg3);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      
#if PHP_MAJOR_VERSION-0 < 5
      if (code == SWIG_RuntimeError) {
        zend_error(E_WARNING, const_cast<char *>(msg.c_str()));
        /* FIXME: destructors don't have return_value to set. */
        // ZVAL_NULL(return_value);
        return;
      }
#endif
      
      XapianException(code, msg);
    }
  }
  
  return;
fail:
  zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_XapianEnquire_set_cutoff__SWIG_1) {
  Xapian::Enquire *arg1 = (Xapian::Enquire *) 0 ;
  int arg2 ;
  zval **args[1];
  
  SWIG_ResetError();
  /* This function uses a this_ptr*/
  if(ZEND_NUM_ARGS() != 1 || zend_get_parameters_array_ex(1, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*&this_ptr, (void **) &arg1, SWIGTYPE_p_Xapian__Enquire, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of XapianEnquire_set_cutoff. Expected SWIGTYPE_p_Xapian__Enquire");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    /*@SWIG:CONVERT_INT_IN@*/
    convert_to_long_ex(args[0]);
    arg2 = (int) Z_LVAL_PP(args[0]);
    /*@SWIG@*/;
  }
  {
    try {
      (arg1)->set_cutoff(arg2);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      
#if PHP_MAJOR_VERSION-0 < 5
      if (code == SWIG_RuntimeError) {
        zend_error(E_WARNING, const_cast<char *>(msg.c_str()));
        /* FIXME: destructors don't have return_value to set. */
        // ZVAL_NULL(return_value);
        return;
      }
#endif
      
      XapianException(code, msg);
    }
  }
  
  return;
fail:
  zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_XapianEnquire_set_cutoff) {
  int argc;
  zval **argv[3];
  
  argc = ZEND_NUM_ARGS();
  argv[0] = &this_ptr;
  zend_get_parameters_array_ex(argc,argv+1);
  argc++;
  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) {
        return _wrap_XapianEnquire_set_cutoff__SWIG_1(INTERNAL_FUNCTION_PARAM_PASSTHRU);
      }
    }
  }
  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) {
          return _wrap_XapianEnquire_set_cutoff__SWIG_0(INTERNAL_FUNCTION_PARAM_PASSTHRU);
        }
      }
    }
  }
  
  SWIG_ErrorCode() = E_ERROR;
  SWIG_ErrorMsg() = "No matching function for overloaded 'XapianEnquire_set_cutoff'";
  zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_XapianEnquire_set_sorting__SWIG_0) {
  Xapian::Enquire *arg1 = (Xapian::Enquire *) 0 ;
  Xapian::valueno arg2 ;
  int arg3 ;
  bool arg4 ;
  zval **args[3];
  
  SWIG_ResetError();
  /* This function uses a this_ptr*/
  if(ZEND_NUM_ARGS() != 3 || zend_get_parameters_array_ex(3, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*&this_ptr, (void **) &arg1, SWIGTYPE_p_Xapian__Enquire, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of XapianEnquire_set_sorting. Expected SWIGTYPE_p_Xapian__Enquire");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    /*@SWIG:CONVERT_INT_IN@*/
    convert_to_long_ex(args[0]);
    arg2 = (Xapian::valueno) Z_LVAL_PP(args[0]);
    /*@SWIG@*/;
  }
  {
    /*@SWIG:CONVERT_INT_IN@*/
    convert_to_long_ex(args[1]);
    arg3 = (int) Z_LVAL_PP(args[1]);
    /*@SWIG@*/;
  }
  {
    /*@SWIG:CONVERT_BOOL_IN@*/
    convert_to_boolean_ex(args[2]);
    arg4 = (bool) Z_LVAL_PP(args[2]);
    /*@SWIG@*/;
  }
  {
    try {
      (arg1)->set_sorting(arg2,arg3,arg4);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      
#if PHP_MAJOR_VERSION-0 < 5
      if (code == SWIG_RuntimeError) {
        zend_error(E_WARNING, const_cast<char *>(msg.c_str()));
        /* FIXME: destructors don't have return_value to set. */
        // ZVAL_NULL(return_value);
        return;
      }
#endif
      
      XapianException(code, msg);
    }
  }
  
  return;
fail:
  zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_XapianEnquire_set_sorting__SWIG_1) {
  Xapian::Enquire *arg1 = (Xapian::Enquire *) 0 ;
  Xapian::valueno arg2 ;
  int arg3 ;
  zval **args[2];
  
  SWIG_ResetError();
  /* This function uses a this_ptr*/
  if(ZEND_NUM_ARGS() != 2 || zend_get_parameters_array_ex(2, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*&this_ptr, (void **) &arg1, SWIGTYPE_p_Xapian__Enquire, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of XapianEnquire_set_sorting. Expected SWIGTYPE_p_Xapian__Enquire");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    /*@SWIG:CONVERT_INT_IN@*/
    convert_to_long_ex(args[0]);
    arg2 = (Xapian::valueno) Z_LVAL_PP(args[0]);
    /*@SWIG@*/;
  }
  {
    /*@SWIG:CONVERT_INT_IN@*/
    convert_to_long_ex(args[1]);
    arg3 = (int) Z_LVAL_PP(args[1]);
    /*@SWIG@*/;
  }
  {
    try {
      (arg1)->set_sorting(arg2,arg3);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      
#if PHP_MAJOR_VERSION-0 < 5
      if (code == SWIG_RuntimeError) {
        zend_error(E_WARNING, const_cast<char *>(msg.c_str()));
        /* FIXME: destructors don't have return_value to set. */
        // ZVAL_NULL(return_value);
        return;
      }
#endif
      
      XapianException(code, msg);
    }
  }
  
  return;
fail:
  zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_XapianEnquire_set_sorting) {
  int argc;
  zval **argv[4];
  
  argc = ZEND_NUM_ARGS();
  argv[0] = &this_ptr;
  zend_get_parameters_array_ex(argc,argv+1);
  argc++;
  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) {
          return _wrap_XapianEnquire_set_sorting__SWIG_1(INTERNAL_FUNCTION_PARAM_PASSTHRU);
        }
      }
    }
  }
  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_BOOL || Z_TYPE_PP(argv[3]) == IS_LONG);
          }
          if (_v) {
            return _wrap_XapianEnquire_set_sorting__SWIG_0(INTERNAL_FUNCTION_PARAM_PASSTHRU);
          }
        }
      }
    }
  }
  
  SWIG_ErrorCode() = E_ERROR;
  SWIG_ErrorMsg() = "No matching function for overloaded 'XapianEnquire_set_sorting'";
  zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_XapianEnquire_set_sort_by_relevance) {
  Xapian::Enquire *arg1 = (Xapian::Enquire *) 0 ;
  
  SWIG_ResetError();
  /* This function uses a this_ptr*/
  if(ZEND_NUM_ARGS() != 0) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*&this_ptr, (void **) &arg1, SWIGTYPE_p_Xapian__Enquire, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of XapianEnquire_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 (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      
#if PHP_MAJOR_VERSION-0 < 5
      if (code == SWIG_RuntimeError) {
        zend_error(E_WARNING, const_cast<char *>(msg.c_str()));
        /* FIXME: destructors don't have return_value to set. */
        // ZVAL_NULL(return_value);
        return;
      }
#endif
      
      XapianException(code, msg);
    }
  }
  
  return;
fail:
  zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_XapianEnquire_set_sort_by_value__SWIG_0) {
  Xapian::Enquire *arg1 = (Xapian::Enquire *) 0 ;
  Xapian::valueno arg2 ;
  bool arg3 ;
  zval **args[2];
  
  SWIG_ResetError();
  /* This function uses a this_ptr*/
  if(ZEND_NUM_ARGS() != 2 || zend_get_parameters_array_ex(2, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*&this_ptr, (void **) &arg1, SWIGTYPE_p_Xapian__Enquire, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of XapianEnquire_set_sort_by_value. Expected SWIGTYPE_p_Xapian__Enquire");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    /*@SWIG:CONVERT_INT_IN@*/
    convert_to_long_ex(args[0]);
    arg2 = (Xapian::valueno) Z_LVAL_PP(args[0]);
    /*@SWIG@*/;
  }
  {
    /*@SWIG:CONVERT_BOOL_IN@*/
    convert_to_boolean_ex(args[1]);
    arg3 = (bool) Z_LVAL_PP(args[1]);
    /*@SWIG@*/;
  }
  {
    try {
      (arg1)->set_sort_by_value(arg2,arg3);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      
#if PHP_MAJOR_VERSION-0 < 5
      if (code == SWIG_RuntimeError) {
        zend_error(E_WARNING, const_cast<char *>(msg.c_str()));
        /* FIXME: destructors don't have return_value to set. */
        // ZVAL_NULL(return_value);
        return;
      }
#endif
      
      XapianException(code, msg);
    }
  }
  
  return;
fail:
  zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_XapianEnquire_set_sort_by_value__SWIG_1) {
  Xapian::Enquire *arg1 = (Xapian::Enquire *) 0 ;
  Xapian::valueno arg2 ;
  zval **args[1];
  
  SWIG_ResetError();
  /* This function uses a this_ptr*/
  if(ZEND_NUM_ARGS() != 1 || zend_get_parameters_array_ex(1, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*&this_ptr, (void **) &arg1, SWIGTYPE_p_Xapian__Enquire, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of XapianEnquire_set_sort_by_value. Expected SWIGTYPE_p_Xapian__Enquire");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    /*@SWIG:CONVERT_INT_IN@*/
    convert_to_long_ex(args[0]);
    arg2 = (Xapian::valueno) Z_LVAL_PP(args[0]);
    /*@SWIG@*/;
  }
  {
    try {
      (arg1)->set_sort_by_value(arg2);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      
#if PHP_MAJOR_VERSION-0 < 5
      if (code == SWIG_RuntimeError) {
        zend_error(E_WARNING, const_cast<char *>(msg.c_str()));
        /* FIXME: destructors don't have return_value to set. */
        // ZVAL_NULL(return_value);
        return;
      }
#endif
      
      XapianException(code, msg);
    }
  }
  
  return;
fail:
  zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_XapianEnquire_set_sort_by_value) {
  int argc;
  zval **argv[3];
  
  argc = ZEND_NUM_ARGS();
  argv[0] = &this_ptr;
  zend_get_parameters_array_ex(argc,argv+1);
  argc++;
  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) {
        return _wrap_XapianEnquire_set_sort_by_value__SWIG_1(INTERNAL_FUNCTION_PARAM_PASSTHRU);
      }
    }
  }
  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) {
          return _wrap_XapianEnquire_set_sort_by_value__SWIG_0(INTERNAL_FUNCTION_PARAM_PASSTHRU);
        }
      }
    }
  }
  
  SWIG_ErrorCode() = E_ERROR;
  SWIG_ErrorMsg() = "No matching function for overloaded 'XapianEnquire_set_sort_by_value'";
  zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_XapianEnquire_set_sort_by_value_then_relevance__SWIG_0) {
  Xapian::Enquire *arg1 = (Xapian::Enquire *) 0 ;
  Xapian::valueno arg2 ;
  bool arg3 ;
  zval **args[2];
  
  SWIG_ResetError();
  /* This function uses a this_ptr*/
  if(ZEND_NUM_ARGS() != 2 || zend_get_parameters_array_ex(2, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*&this_ptr, (void **) &arg1, SWIGTYPE_p_Xapian__Enquire, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of XapianEnquire_set_sort_by_value_then_relevance. Expected SWIGTYPE_p_Xapian__Enquire");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    /*@SWIG:CONVERT_INT_IN@*/
    convert_to_long_ex(args[0]);
    arg2 = (Xapian::valueno) Z_LVAL_PP(args[0]);
    /*@SWIG@*/;
  }
  {
    /*@SWIG:CONVERT_BOOL_IN@*/
    convert_to_boolean_ex(args[1]);
    arg3 = (bool) Z_LVAL_PP(args[1]);
    /*@SWIG@*/;
  }
  {
    try {
      (arg1)->set_sort_by_value_then_relevance(arg2,arg3);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      
#if PHP_MAJOR_VERSION-0 < 5
      if (code == SWIG_RuntimeError) {
        zend_error(E_WARNING, const_cast<char *>(msg.c_str()));
        /* FIXME: destructors don't have return_value to set. */
        // ZVAL_NULL(return_value);
        return;
      }
#endif
      
      XapianException(code, msg);
    }
  }
  
  return;
fail:
  zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_XapianEnquire_set_sort_by_value_then_relevance__SWIG_1) {
  Xapian::Enquire *arg1 = (Xapian::Enquire *) 0 ;
  Xapian::valueno arg2 ;
  zval **args[1];
  
  SWIG_ResetError();
  /* This function uses a this_ptr*/
  if(ZEND_NUM_ARGS() != 1 || zend_get_parameters_array_ex(1, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*&this_ptr, (void **) &arg1, SWIGTYPE_p_Xapian__Enquire, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of XapianEnquire_set_sort_by_value_then_relevance. Expected SWIGTYPE_p_Xapian__Enquire");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    /*@SWIG:CONVERT_INT_IN@*/
    convert_to_long_ex(args[0]);
    arg2 = (Xapian::valueno) Z_LVAL_PP(args[0]);
    /*@SWIG@*/;
  }
  {
    try {
      (arg1)->set_sort_by_value_then_relevance(arg2);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      
#if PHP_MAJOR_VERSION-0 < 5
      if (code == SWIG_RuntimeError) {
        zend_error(E_WARNING, const_cast<char *>(msg.c_str()));
        /* FIXME: destructors don't have return_value to set. */
        // ZVAL_NULL(return_value);
        return;
      }
#endif
      
      XapianException(code, msg);
    }
  }
  
  return;
fail:
  zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_XapianEnquire_set_sort_by_value_then_relevance) {
  int argc;
  zval **argv[3];
  
  argc = ZEND_NUM_ARGS();
  argv[0] = &this_ptr;
  zend_get_parameters_array_ex(argc,argv+1);
  argc++;
  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) {
        return _wrap_XapianEnquire_set_sort_by_value_then_relevance__SWIG_1(INTERNAL_FUNCTION_PARAM_PASSTHRU);
      }
    }
  }
  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) {
          return _wrap_XapianEnquire_set_sort_by_value_then_relevance__SWIG_0(INTERNAL_FUNCTION_PARAM_PASSTHRU);
        }
      }
    }
  }
  
  SWIG_ErrorCode() = E_ERROR;
  SWIG_ErrorMsg() = "No matching function for overloaded 'XapianEnquire_set_sort_by_value_then_relevance'";
  zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_XapianEnquire_set_sort_by_relevance_then_value__SWIG_0) {
  Xapian::Enquire *arg1 = (Xapian::Enquire *) 0 ;
  Xapian::valueno arg2 ;
  bool arg3 ;
  zval **args[2];
  
  SWIG_ResetError();
  /* This function uses a this_ptr*/
  if(ZEND_NUM_ARGS() != 2 || zend_get_parameters_array_ex(2, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*&this_ptr, (void **) &arg1, SWIGTYPE_p_Xapian__Enquire, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of XapianEnquire_set_sort_by_relevance_then_value. Expected SWIGTYPE_p_Xapian__Enquire");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    /*@SWIG:CONVERT_INT_IN@*/
    convert_to_long_ex(args[0]);
    arg2 = (Xapian::valueno) Z_LVAL_PP(args[0]);
    /*@SWIG@*/;
  }
  {
    /*@SWIG:CONVERT_BOOL_IN@*/
    convert_to_boolean_ex(args[1]);
    arg3 = (bool) Z_LVAL_PP(args[1]);
    /*@SWIG@*/;
  }
  {
    try {
      (arg1)->set_sort_by_relevance_then_value(arg2,arg3);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      
#if PHP_MAJOR_VERSION-0 < 5
      if (code == SWIG_RuntimeError) {
        zend_error(E_WARNING, const_cast<char *>(msg.c_str()));
        /* FIXME: destructors don't have return_value to set. */
        // ZVAL_NULL(return_value);
        return;
      }
#endif
      
      XapianException(code, msg);
    }
  }
  
  return;
fail:
  zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_XapianEnquire_set_sort_by_relevance_then_value__SWIG_1) {
  Xapian::Enquire *arg1 = (Xapian::Enquire *) 0 ;
  Xapian::valueno arg2 ;
  zval **args[1];
  
  SWIG_ResetError();
  /* This function uses a this_ptr*/
  if(ZEND_NUM_ARGS() != 1 || zend_get_parameters_array_ex(1, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*&this_ptr, (void **) &arg1, SWIGTYPE_p_Xapian__Enquire, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of XapianEnquire_set_sort_by_relevance_then_value. Expected SWIGTYPE_p_Xapian__Enquire");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    /*@SWIG:CONVERT_INT_IN@*/
    convert_to_long_ex(args[0]);
    arg2 = (Xapian::valueno) Z_LVAL_PP(args[0]);
    /*@SWIG@*/;
  }
  {
    try {
      (arg1)->set_sort_by_relevance_then_value(arg2);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      
#if PHP_MAJOR_VERSION-0 < 5
      if (code == SWIG_RuntimeError) {
        zend_error(E_WARNING, const_cast<char *>(msg.c_str()));
        /* FIXME: destructors don't have return_value to set. */
        // ZVAL_NULL(return_value);
        return;
      }
#endif
      
      XapianException(code, msg);
    }
  }
  
  return;
fail:
  zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_XapianEnquire_set_sort_by_relevance_then_value) {
  int argc;
  zval **argv[3];
  
  argc = ZEND_NUM_ARGS();
  argv[0] = &this_ptr;
  zend_get_parameters_array_ex(argc,argv+1);
  argc++;
  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) {
        return _wrap_XapianEnquire_set_sort_by_relevance_then_value__SWIG_1(INTERNAL_FUNCTION_PARAM_PASSTHRU);
      }
    }
  }
  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) {
          return _wrap_XapianEnquire_set_sort_by_relevance_then_value__SWIG_0(INTERNAL_FUNCTION_PARAM_PASSTHRU);
        }
      }
    }
  }
  
  SWIG_ErrorCode() = E_ERROR;
  SWIG_ErrorMsg() = "No matching function for overloaded 'XapianEnquire_set_sort_by_relevance_then_value'";
  zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_XapianEnquire_set_bias) {
  Xapian::Enquire *arg1 = (Xapian::Enquire *) 0 ;
  Xapian::weight arg2 ;
  time_t arg3 ;
  time_t *tmp3 ;
  zval **args[2];
  
  SWIG_ResetError();
  /* This function uses a this_ptr*/
  if(ZEND_NUM_ARGS() != 2 || zend_get_parameters_array_ex(2, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*&this_ptr, (void **) &arg1, SWIGTYPE_p_Xapian__Enquire, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of XapianEnquire_set_bias. Expected SWIGTYPE_p_Xapian__Enquire");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    /*@SWIG:CONVERT_FLOAT_IN@*/
    convert_to_double_ex(args[0]);
    arg2 = (Xapian::weight) Z_DVAL_PP(args[0]);
    /*@SWIG@*/;
  }
  {
    if(SWIG_ConvertPtr(*args[1], (void **) &tmp3, SWIGTYPE_p_time_t, 0) < 0 || tmp3 == NULL) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 3 of XapianEnquire_set_bias. Expected SWIGTYPE_p_time_t");
    }
    arg3 = *tmp3;
  }
  {
    try {
      (arg1)->set_bias(arg2,arg3);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      
#if PHP_MAJOR_VERSION-0 < 5
      if (code == SWIG_RuntimeError) {
        zend_error(E_WARNING, const_cast<char *>(msg.c_str()));
        /* FIXME: destructors don't have return_value to set. */
        // ZVAL_NULL(return_value);
        return;
      }
#endif
      
      XapianException(code, msg);
    }
  }
  
  return;
fail:
  zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_XapianEnquire_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::MSet result;
  zval **args[5];
  
  SWIG_ResetError();
  /* This function uses a this_ptr*/
  if(ZEND_NUM_ARGS() != 5 || zend_get_parameters_array_ex(5, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*&this_ptr, (void **) &arg1, SWIGTYPE_p_Xapian__Enquire, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of XapianEnquire_get_mset. Expected SWIGTYPE_p_Xapian__Enquire");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    /*@SWIG:CONVERT_INT_IN@*/
    convert_to_long_ex(args[0]);
    arg2 = (Xapian::doccount) Z_LVAL_PP(args[0]);
    /*@SWIG@*/;
  }
  {
    /*@SWIG:CONVERT_INT_IN@*/
    convert_to_long_ex(args[1]);
    arg3 = (Xapian::doccount) Z_LVAL_PP(args[1]);
    /*@SWIG@*/;
  }
  {
    /*@SWIG:CONVERT_INT_IN@*/
    convert_to_long_ex(args[2]);
    arg4 = (Xapian::doccount) Z_LVAL_PP(args[2]);
    /*@SWIG@*/;
  }
  {
    if(SWIG_ConvertPtr(*args[3], (void **) &arg5, SWIGTYPE_p_Xapian__RSet, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 5 of XapianEnquire_get_mset. Expected SWIGTYPE_p_Xapian__RSet");
    }
  }
  {
    if(SWIG_ConvertPtr(*args[4], (void **) &arg6, SWIGTYPE_p_Xapian__MatchDecider, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 6 of XapianEnquire_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 (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      
#if PHP_MAJOR_VERSION-0 < 5
      if (code == SWIG_RuntimeError) {
        zend_error(E_WARNING, const_cast<char *>(msg.c_str()));
        /* FIXME: destructors don't have return_value to set. */
        // ZVAL_NULL(return_value);
        return;
      }
#endif
      
      XapianException(code, msg);
    }
  }
  {
    Xapian::MSet * resultobj = new Xapian::MSet((Xapian::MSet &) result);
    SWIG_SetPointerZval(return_value, (void *)resultobj, SWIGTYPE_p_Xapian__MSet, 1);
  }
  /* Wrap this return value */
  {
    /* ALTERNATIVE Constructor, make an object wrapper */
    zval *obj, *_cPtr;
    MAKE_STD_ZVAL(obj);
    MAKE_STD_ZVAL(_cPtr);
    *_cPtr = *return_value;
    INIT_ZVAL(*return_value);
    object_init_ex(obj,ptr_ce_swig_XapianMSet);
    add_property_zval(obj,"_cPtr",_cPtr);
    *return_value=*obj;
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_XapianEnquire_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::MSet result;
  zval **args[4];
  
  SWIG_ResetError();
  /* This function uses a this_ptr*/
  if(ZEND_NUM_ARGS() != 4 || zend_get_parameters_array_ex(4, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*&this_ptr, (void **) &arg1, SWIGTYPE_p_Xapian__Enquire, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of XapianEnquire_get_mset. Expected SWIGTYPE_p_Xapian__Enquire");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    /*@SWIG:CONVERT_INT_IN@*/
    convert_to_long_ex(args[0]);
    arg2 = (Xapian::doccount) Z_LVAL_PP(args[0]);
    /*@SWIG@*/;
  }
  {
    /*@SWIG:CONVERT_INT_IN@*/
    convert_to_long_ex(args[1]);
    arg3 = (Xapian::doccount) Z_LVAL_PP(args[1]);
    /*@SWIG@*/;
  }
  {
    /*@SWIG:CONVERT_INT_IN@*/
    convert_to_long_ex(args[2]);
    arg4 = (Xapian::doccount) Z_LVAL_PP(args[2]);
    /*@SWIG@*/;
  }
  {
    if(SWIG_ConvertPtr(*args[3], (void **) &arg5, SWIGTYPE_p_Xapian__RSet, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 5 of XapianEnquire_get_mset. Expected SWIGTYPE_p_Xapian__RSet");
    }
  }
  {
    try {
      result = ((Xapian::Enquire const *)arg1)->get_mset(arg2,arg3,arg4,(Xapian::RSet const *)arg5);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      
#if PHP_MAJOR_VERSION-0 < 5
      if (code == SWIG_RuntimeError) {
        zend_error(E_WARNING, const_cast<char *>(msg.c_str()));
        /* FIXME: destructors don't have return_value to set. */
        // ZVAL_NULL(return_value);
        return;
      }
#endif
      
      XapianException(code, msg);
    }
  }
  {
    Xapian::MSet * resultobj = new Xapian::MSet((Xapian::MSet &) result);
    SWIG_SetPointerZval(return_value, (void *)resultobj, SWIGTYPE_p_Xapian__MSet, 1);
  }
  /* Wrap this return value */
  {
    /* ALTERNATIVE Constructor, make an object wrapper */
    zval *obj, *_cPtr;
    MAKE_STD_ZVAL(obj);
    MAKE_STD_ZVAL(_cPtr);
    *_cPtr = *return_value;
    INIT_ZVAL(*return_value);
    object_init_ex(obj,ptr_ce_swig_XapianMSet);
    add_property_zval(obj,"_cPtr",_cPtr);
    *return_value=*obj;
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_XapianEnquire_get_mset__SWIG_2) {
  Xapian::Enquire *arg1 = (Xapian::Enquire *) 0 ;
  Xapian::doccount arg2 ;
  Xapian::doccount arg3 ;
  Xapian::doccount arg4 ;
  Xapian::MSet result;
  zval **args[3];
  
  SWIG_ResetError();
  /* This function uses a this_ptr*/
  if(ZEND_NUM_ARGS() != 3 || zend_get_parameters_array_ex(3, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*&this_ptr, (void **) &arg1, SWIGTYPE_p_Xapian__Enquire, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of XapianEnquire_get_mset. Expected SWIGTYPE_p_Xapian__Enquire");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    /*@SWIG:CONVERT_INT_IN@*/
    convert_to_long_ex(args[0]);
    arg2 = (Xapian::doccount) Z_LVAL_PP(args[0]);
    /*@SWIG@*/;
  }
  {
    /*@SWIG:CONVERT_INT_IN@*/
    convert_to_long_ex(args[1]);
    arg3 = (Xapian::doccount) Z_LVAL_PP(args[1]);
    /*@SWIG@*/;
  }
  {
    /*@SWIG:CONVERT_INT_IN@*/
    convert_to_long_ex(args[2]);
    arg4 = (Xapian::doccount) Z_LVAL_PP(args[2]);
    /*@SWIG@*/;
  }
  {
    try {
      result = ((Xapian::Enquire const *)arg1)->get_mset(arg2,arg3,arg4);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      
#if PHP_MAJOR_VERSION-0 < 5
      if (code == SWIG_RuntimeError) {
        zend_error(E_WARNING, const_cast<char *>(msg.c_str()));
        /* FIXME: destructors don't have return_value to set. */
        // ZVAL_NULL(return_value);
        return;
      }
#endif
      
      XapianException(code, msg);
    }
  }
  {
    Xapian::MSet * resultobj = new Xapian::MSet((Xapian::MSet &) result);
    SWIG_SetPointerZval(return_value, (void *)resultobj, SWIGTYPE_p_Xapian__MSet, 1);
  }
  /* Wrap this return value */
  {
    /* ALTERNATIVE Constructor, make an object wrapper */
    zval *obj, *_cPtr;
    MAKE_STD_ZVAL(obj);
    MAKE_STD_ZVAL(_cPtr);
    *_cPtr = *return_value;
    INIT_ZVAL(*return_value);
    object_init_ex(obj,ptr_ce_swig_XapianMSet);
    add_property_zval(obj,"_cPtr",_cPtr);
    *return_value=*obj;
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_XapianEnquire_get_mset__SWIG_3) {
  Xapian::Enquire *arg1 = (Xapian::Enquire *) 0 ;
  Xapian::doccount arg2 ;
  Xapian::doccount arg3 ;
  Xapian::MSet result;
  zval **args[2];
  
  SWIG_ResetError();
  /* This function uses a this_ptr*/
  if(ZEND_NUM_ARGS() != 2 || zend_get_parameters_array_ex(2, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*&this_ptr, (void **) &arg1, SWIGTYPE_p_Xapian__Enquire, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of XapianEnquire_get_mset. Expected SWIGTYPE_p_Xapian__Enquire");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    /*@SWIG:CONVERT_INT_IN@*/
    convert_to_long_ex(args[0]);
    arg2 = (Xapian::doccount) Z_LVAL_PP(args[0]);
    /*@SWIG@*/;
  }
  {
    /*@SWIG:CONVERT_INT_IN@*/
    convert_to_long_ex(args[1]);
    arg3 = (Xapian::doccount) Z_LVAL_PP(args[1]);
    /*@SWIG@*/;
  }
  {
    try {
      result = ((Xapian::Enquire const *)arg1)->get_mset(arg2,arg3);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      
#if PHP_MAJOR_VERSION-0 < 5
      if (code == SWIG_RuntimeError) {
        zend_error(E_WARNING, const_cast<char *>(msg.c_str()));
        /* FIXME: destructors don't have return_value to set. */
        // ZVAL_NULL(return_value);
        return;
      }
#endif
      
      XapianException(code, msg);
    }
  }
  {
    Xapian::MSet * resultobj = new Xapian::MSet((Xapian::MSet &) result);
    SWIG_SetPointerZval(return_value, (void *)resultobj, SWIGTYPE_p_Xapian__MSet, 1);
  }
  /* Wrap this return value */
  {
    /* ALTERNATIVE Constructor, make an object wrapper */
    zval *obj, *_cPtr;
    MAKE_STD_ZVAL(obj);
    MAKE_STD_ZVAL(_cPtr);
    *_cPtr = *return_value;
    INIT_ZVAL(*return_value);
    object_init_ex(obj,ptr_ce_swig_XapianMSet);
    add_property_zval(obj,"_cPtr",_cPtr);
    *return_value=*obj;
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_XapianEnquire_get_mset__SWIG_4) {
  Xapian::Enquire *arg1 = (Xapian::Enquire *) 0 ;
  Xapian::doccount arg2 ;
  Xapian::doccount arg3 ;
  Xapian::RSet *arg4 = (Xapian::RSet *) 0 ;
  Xapian::MatchDecider *arg5 = (Xapian::MatchDecider *) 0 ;
  Xapian::MSet result;
  zval **args[4];
  
  SWIG_ResetError();
  /* This function uses a this_ptr*/
  if(ZEND_NUM_ARGS() != 4 || zend_get_parameters_array_ex(4, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*&this_ptr, (void **) &arg1, SWIGTYPE_p_Xapian__Enquire, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of XapianEnquire_get_mset. Expected SWIGTYPE_p_Xapian__Enquire");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    /*@SWIG:CONVERT_INT_IN@*/
    convert_to_long_ex(args[0]);
    arg2 = (Xapian::doccount) Z_LVAL_PP(args[0]);
    /*@SWIG@*/;
  }
  {
    /*@SWIG:CONVERT_INT_IN@*/
    convert_to_long_ex(args[1]);
    arg3 = (Xapian::doccount) Z_LVAL_PP(args[1]);
    /*@SWIG@*/;
  }
  {
    if(SWIG_ConvertPtr(*args[2], (void **) &arg4, SWIGTYPE_p_Xapian__RSet, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 4 of XapianEnquire_get_mset. Expected SWIGTYPE_p_Xapian__RSet");
    }
  }
  {
    if(SWIG_ConvertPtr(*args[3], (void **) &arg5, SWIGTYPE_p_Xapian__MatchDecider, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 5 of XapianEnquire_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 (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      
#if PHP_MAJOR_VERSION-0 < 5
      if (code == SWIG_RuntimeError) {
        zend_error(E_WARNING, const_cast<char *>(msg.c_str()));
        /* FIXME: destructors don't have return_value to set. */
        // ZVAL_NULL(return_value);
        return;
      }
#endif
      
      XapianException(code, msg);
    }
  }
  {
    Xapian::MSet * resultobj = new Xapian::MSet((Xapian::MSet &) result);
    SWIG_SetPointerZval(return_value, (void *)resultobj, SWIGTYPE_p_Xapian__MSet, 1);
  }
  /* Wrap this return value */
  {
    /* ALTERNATIVE Constructor, make an object wrapper */
    zval *obj, *_cPtr;
    MAKE_STD_ZVAL(obj);
    MAKE_STD_ZVAL(_cPtr);
    *_cPtr = *return_value;
    INIT_ZVAL(*return_value);
    object_init_ex(obj,ptr_ce_swig_XapianMSet);
    add_property_zval(obj,"_cPtr",_cPtr);
    *return_value=*obj;
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_XapianEnquire_get_mset__SWIG_5) {
  Xapian::Enquire *arg1 = (Xapian::Enquire *) 0 ;
  Xapian::doccount arg2 ;
  Xapian::doccount arg3 ;
  Xapian::RSet *arg4 = (Xapian::RSet *) 0 ;
  Xapian::MSet result;
  zval **args[3];
  
  SWIG_ResetError();
  /* This function uses a this_ptr*/
  if(ZEND_NUM_ARGS() != 3 || zend_get_parameters_array_ex(3, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*&this_ptr, (void **) &arg1, SWIGTYPE_p_Xapian__Enquire, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of XapianEnquire_get_mset. Expected SWIGTYPE_p_Xapian__Enquire");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    /*@SWIG:CONVERT_INT_IN@*/
    convert_to_long_ex(args[0]);
    arg2 = (Xapian::doccount) Z_LVAL_PP(args[0]);
    /*@SWIG@*/;
  }
  {
    /*@SWIG:CONVERT_INT_IN@*/
    convert_to_long_ex(args[1]);
    arg3 = (Xapian::doccount) Z_LVAL_PP(args[1]);
    /*@SWIG@*/;
  }
  {
    if(SWIG_ConvertPtr(*args[2], (void **) &arg4, SWIGTYPE_p_Xapian__RSet, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 4 of XapianEnquire_get_mset. Expected SWIGTYPE_p_Xapian__RSet");
    }
  }
  {
    try {
      result = ((Xapian::Enquire const *)arg1)->get_mset(arg2,arg3,(Xapian::RSet const *)arg4);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      
#if PHP_MAJOR_VERSION-0 < 5
      if (code == SWIG_RuntimeError) {
        zend_error(E_WARNING, const_cast<char *>(msg.c_str()));
        /* FIXME: destructors don't have return_value to set. */
        // ZVAL_NULL(return_value);
        return;
      }
#endif
      
      XapianException(code, msg);
    }
  }
  {
    Xapian::MSet * resultobj = new Xapian::MSet((Xapian::MSet &) result);
    SWIG_SetPointerZval(return_value, (void *)resultobj, SWIGTYPE_p_Xapian__MSet, 1);
  }
  /* Wrap this return value */
  {
    /* ALTERNATIVE Constructor, make an object wrapper */
    zval *obj, *_cPtr;
    MAKE_STD_ZVAL(obj);
    MAKE_STD_ZVAL(_cPtr);
    *_cPtr = *return_value;
    INIT_ZVAL(*return_value);
    object_init_ex(obj,ptr_ce_swig_XapianMSet);
    add_property_zval(obj,"_cPtr",_cPtr);
    *return_value=*obj;
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_XapianEnquire_get_mset) {
  int argc;
  zval **argv[6];
  
  argc = ZEND_NUM_ARGS();
  argv[0] = &this_ptr;
  zend_get_parameters_array_ex(argc,argv+1);
  argc++;
  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) {
          return _wrap_XapianEnquire_get_mset__SWIG_3(INTERNAL_FUNCTION_PARAM_PASSTHRU);
        }
      }
    }
  }
  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) {
            return _wrap_XapianEnquire_get_mset__SWIG_5(INTERNAL_FUNCTION_PARAM_PASSTHRU);
          }
        }
      }
    }
  }
  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) {
            return _wrap_XapianEnquire_get_mset__SWIG_2(INTERNAL_FUNCTION_PARAM_PASSTHRU);
          }
        }
      }
    }
  }
  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) {
              return _wrap_XapianEnquire_get_mset__SWIG_4(INTERNAL_FUNCTION_PARAM_PASSTHRU);
            }
          }
        }
      }
    }
  }
  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) {
              return _wrap_XapianEnquire_get_mset__SWIG_1(INTERNAL_FUNCTION_PARAM_PASSTHRU);
            }
          }
        }
      }
    }
  }
  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) {
                return _wrap_XapianEnquire_get_mset__SWIG_0(INTERNAL_FUNCTION_PARAM_PASSTHRU);
              }
            }
          }
        }
      }
    }
  }
  
  SWIG_ErrorCode() = E_ERROR;
  SWIG_ErrorMsg() = "No matching function for overloaded 'XapianEnquire_get_mset'";
  zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_XapianEnquire_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 ;
  Xapian::ESet result;
  zval **args[5];
  
  SWIG_ResetError();
  /* This function uses a this_ptr*/
  if(ZEND_NUM_ARGS() != 5 || zend_get_parameters_array_ex(5, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*&this_ptr, (void **) &arg1, SWIGTYPE_p_Xapian__Enquire, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of XapianEnquire_get_eset. Expected SWIGTYPE_p_Xapian__Enquire");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    /*@SWIG:CONVERT_INT_IN@*/
    convert_to_long_ex(args[0]);
    arg2 = (Xapian::termcount) Z_LVAL_PP(args[0]);
    /*@SWIG@*/;
  }
  {
    if (SWIG_ConvertPtr(*args[1], (void**)&arg3, SWIGTYPE_p_Xapian__RSet, 0) < 0 || arg3 == NULL) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 3 of XapianEnquire_get_eset. Expected SWIGTYPE_p_Xapian__RSet");
    }
  }
  {
    /*@SWIG:CONVERT_INT_IN@*/
    convert_to_long_ex(args[2]);
    arg4 = (int) Z_LVAL_PP(args[2]);
    /*@SWIG@*/;
  }
  {
    /*@SWIG:CONVERT_FLOAT_IN@*/
    convert_to_double_ex(args[3]);
    arg5 = (double) Z_DVAL_PP(args[3]);
    /*@SWIG@*/;
  }
  {
    if(SWIG_ConvertPtr(*args[4], (void **) &arg6, SWIGTYPE_p_Xapian__ExpandDecider, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 6 of XapianEnquire_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 (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      
#if PHP_MAJOR_VERSION-0 < 5
      if (code == SWIG_RuntimeError) {
        zend_error(E_WARNING, const_cast<char *>(msg.c_str()));
        /* FIXME: destructors don't have return_value to set. */
        // ZVAL_NULL(return_value);
        return;
      }
#endif
      
      XapianException(code, msg);
    }
  }
  {
    Xapian::ESet * resultobj = new Xapian::ESet((Xapian::ESet &) result);
    SWIG_SetPointerZval(return_value, (void *)resultobj, SWIGTYPE_p_Xapian__ESet, 1);
  }
  /* Wrap this return value */
  {
    /* ALTERNATIVE Constructor, make an object wrapper */
    zval *obj, *_cPtr;
    MAKE_STD_ZVAL(obj);
    MAKE_STD_ZVAL(_cPtr);
    *_cPtr = *return_value;
    INIT_ZVAL(*return_value);
    object_init_ex(obj,ptr_ce_swig_XapianESet);
    add_property_zval(obj,"_cPtr",_cPtr);
    *return_value=*obj;
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_XapianEnquire_get_eset__SWIG_1) {
  Xapian::Enquire *arg1 = (Xapian::Enquire *) 0 ;
  Xapian::termcount arg2 ;
  Xapian::RSet *arg3 = 0 ;
  int arg4 ;
  double arg5 ;
  Xapian::ESet result;
  zval **args[4];
  
  SWIG_ResetError();
  /* This function uses a this_ptr*/
  if(ZEND_NUM_ARGS() != 4 || zend_get_parameters_array_ex(4, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*&this_ptr, (void **) &arg1, SWIGTYPE_p_Xapian__Enquire, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of XapianEnquire_get_eset. Expected SWIGTYPE_p_Xapian__Enquire");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    /*@SWIG:CONVERT_INT_IN@*/
    convert_to_long_ex(args[0]);
    arg2 = (Xapian::termcount) Z_LVAL_PP(args[0]);
    /*@SWIG@*/;
  }
  {
    if (SWIG_ConvertPtr(*args[1], (void**)&arg3, SWIGTYPE_p_Xapian__RSet, 0) < 0 || arg3 == NULL) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 3 of XapianEnquire_get_eset. Expected SWIGTYPE_p_Xapian__RSet");
    }
  }
  {
    /*@SWIG:CONVERT_INT_IN@*/
    convert_to_long_ex(args[2]);
    arg4 = (int) Z_LVAL_PP(args[2]);
    /*@SWIG@*/;
  }
  {
    /*@SWIG:CONVERT_FLOAT_IN@*/
    convert_to_double_ex(args[3]);
    arg5 = (double) Z_DVAL_PP(args[3]);
    /*@SWIG@*/;
  }
  {
    try {
      result = ((Xapian::Enquire const *)arg1)->get_eset(arg2,(Xapian::RSet const &)*arg3,arg4,arg5);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      
#if PHP_MAJOR_VERSION-0 < 5
      if (code == SWIG_RuntimeError) {
        zend_error(E_WARNING, const_cast<char *>(msg.c_str()));
        /* FIXME: destructors don't have return_value to set. */
        // ZVAL_NULL(return_value);
        return;
      }
#endif
      
      XapianException(code, msg);
    }
  }
  {
    Xapian::ESet * resultobj = new Xapian::ESet((Xapian::ESet &) result);
    SWIG_SetPointerZval(return_value, (void *)resultobj, SWIGTYPE_p_Xapian__ESet, 1);
  }
  /* Wrap this return value */
  {
    /* ALTERNATIVE Constructor, make an object wrapper */
    zval *obj, *_cPtr;
    MAKE_STD_ZVAL(obj);
    MAKE_STD_ZVAL(_cPtr);
    *_cPtr = *return_value;
    INIT_ZVAL(*return_value);
    object_init_ex(obj,ptr_ce_swig_XapianESet);
    add_property_zval(obj,"_cPtr",_cPtr);
    *return_value=*obj;
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_XapianEnquire_get_eset__SWIG_2) {
  Xapian::Enquire *arg1 = (Xapian::Enquire *) 0 ;
  Xapian::termcount arg2 ;
  Xapian::RSet *arg3 = 0 ;
  int arg4 ;
  Xapian::ESet result;
  zval **args[3];
  
  SWIG_ResetError();
  /* This function uses a this_ptr*/
  if(ZEND_NUM_ARGS() != 3 || zend_get_parameters_array_ex(3, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*&this_ptr, (void **) &arg1, SWIGTYPE_p_Xapian__Enquire, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of XapianEnquire_get_eset. Expected SWIGTYPE_p_Xapian__Enquire");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    /*@SWIG:CONVERT_INT_IN@*/
    convert_to_long_ex(args[0]);
    arg2 = (Xapian::termcount) Z_LVAL_PP(args[0]);
    /*@SWIG@*/;
  }
  {
    if (SWIG_ConvertPtr(*args[1], (void**)&arg3, SWIGTYPE_p_Xapian__RSet, 0) < 0 || arg3 == NULL) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 3 of XapianEnquire_get_eset. Expected SWIGTYPE_p_Xapian__RSet");
    }
  }
  {
    /*@SWIG:CONVERT_INT_IN@*/
    convert_to_long_ex(args[2]);
    arg4 = (int) Z_LVAL_PP(args[2]);
    /*@SWIG@*/;
  }
  {
    try {
      result = ((Xapian::Enquire const *)arg1)->get_eset(arg2,(Xapian::RSet const &)*arg3,arg4);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      
#if PHP_MAJOR_VERSION-0 < 5
      if (code == SWIG_RuntimeError) {
        zend_error(E_WARNING, const_cast<char *>(msg.c_str()));
        /* FIXME: destructors don't have return_value to set. */
        // ZVAL_NULL(return_value);
        return;
      }
#endif
      
      XapianException(code, msg);
    }
  }
  {
    Xapian::ESet * resultobj = new Xapian::ESet((Xapian::ESet &) result);
    SWIG_SetPointerZval(return_value, (void *)resultobj, SWIGTYPE_p_Xapian__ESet, 1);
  }
  /* Wrap this return value */
  {
    /* ALTERNATIVE Constructor, make an object wrapper */
    zval *obj, *_cPtr;
    MAKE_STD_ZVAL(obj);
    MAKE_STD_ZVAL(_cPtr);
    *_cPtr = *return_value;
    INIT_ZVAL(*return_value);
    object_init_ex(obj,ptr_ce_swig_XapianESet);
    add_property_zval(obj,"_cPtr",_cPtr);
    *return_value=*obj;
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_XapianEnquire_get_eset__SWIG_3) {
  Xapian::Enquire *arg1 = (Xapian::Enquire *) 0 ;
  Xapian::termcount arg2 ;
  Xapian::RSet *arg3 = 0 ;
  Xapian::ESet result;
  zval **args[2];
  
  SWIG_ResetError();
  /* This function uses a this_ptr*/
  if(ZEND_NUM_ARGS() != 2 || zend_get_parameters_array_ex(2, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*&this_ptr, (void **) &arg1, SWIGTYPE_p_Xapian__Enquire, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of XapianEnquire_get_eset. Expected SWIGTYPE_p_Xapian__Enquire");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    /*@SWIG:CONVERT_INT_IN@*/
    convert_to_long_ex(args[0]);
    arg2 = (Xapian::termcount) Z_LVAL_PP(args[0]);
    /*@SWIG@*/;
  }
  {
    if (SWIG_ConvertPtr(*args[1], (void**)&arg3, SWIGTYPE_p_Xapian__RSet, 0) < 0 || arg3 == NULL) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 3 of XapianEnquire_get_eset. Expected SWIGTYPE_p_Xapian__RSet");
    }
  }
  {
    try {
      result = ((Xapian::Enquire const *)arg1)->get_eset(arg2,(Xapian::RSet const &)*arg3);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      
#if PHP_MAJOR_VERSION-0 < 5
      if (code == SWIG_RuntimeError) {
        zend_error(E_WARNING, const_cast<char *>(msg.c_str()));
        /* FIXME: destructors don't have return_value to set. */
        // ZVAL_NULL(return_value);
        return;
      }
#endif
      
      XapianException(code, msg);
    }
  }
  {
    Xapian::ESet * resultobj = new Xapian::ESet((Xapian::ESet &) result);
    SWIG_SetPointerZval(return_value, (void *)resultobj, SWIGTYPE_p_Xapian__ESet, 1);
  }
  /* Wrap this return value */
  {
    /* ALTERNATIVE Constructor, make an object wrapper */
    zval *obj, *_cPtr;
    MAKE_STD_ZVAL(obj);
    MAKE_STD_ZVAL(_cPtr);
    *_cPtr = *return_value;
    INIT_ZVAL(*return_value);
    object_init_ex(obj,ptr_ce_swig_XapianESet);
    add_property_zval(obj,"_cPtr",_cPtr);
    *return_value=*obj;
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_XapianEnquire_get_eset) {
  int argc;
  zval **argv[6];
  
  argc = ZEND_NUM_ARGS();
  argv[0] = &this_ptr;
  zend_get_parameters_array_ex(argc,argv+1);
  argc++;
  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) {
          return _wrap_XapianEnquire_get_eset__SWIG_3(INTERNAL_FUNCTION_PARAM_PASSTHRU);
        }
      }
    }
  }
  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) {
            return _wrap_XapianEnquire_get_eset__SWIG_2(INTERNAL_FUNCTION_PARAM_PASSTHRU);
          }
        }
      }
    }
  }
  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) {
              return _wrap_XapianEnquire_get_eset__SWIG_1(INTERNAL_FUNCTION_PARAM_PASSTHRU);
            }
          }
        }
      }
    }
  }
  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) {
                return _wrap_XapianEnquire_get_eset__SWIG_0(INTERNAL_FUNCTION_PARAM_PASSTHRU);
              }
            }
          }
        }
      }
    }
  }
  
  SWIG_ErrorCode() = E_ERROR;
  SWIG_ErrorMsg() = "No matching function for overloaded 'XapianEnquire_get_eset'";
  zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_XapianEnquire_get_matching_terms_begin__SWIG_0) {
  Xapian::Enquire *arg1 = (Xapian::Enquire *) 0 ;
  Xapian::docid arg2 ;
  Xapian::TermIterator result;
  zval **args[1];
  
  SWIG_ResetError();
  /* This function uses a this_ptr*/
  if(ZEND_NUM_ARGS() != 1 || zend_get_parameters_array_ex(1, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*&this_ptr, (void **) &arg1, SWIGTYPE_p_Xapian__Enquire, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of XapianEnquire_get_matching_terms_begin. Expected SWIGTYPE_p_Xapian__Enquire");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    /*@SWIG:CONVERT_INT_IN@*/
    convert_to_long_ex(args[0]);
    arg2 = (Xapian::docid) Z_LVAL_PP(args[0]);
    /*@SWIG@*/;
  }
  {
    try {
      result = ((Xapian::Enquire const *)arg1)->get_matching_terms_begin(arg2);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      
#if PHP_MAJOR_VERSION-0 < 5
      if (code == SWIG_RuntimeError) {
        zend_error(E_WARNING, const_cast<char *>(msg.c_str()));
        /* FIXME: destructors don't have return_value to set. */
        // ZVAL_NULL(return_value);
        return;
      }
#endif
      
      XapianException(code, msg);
    }
  }
  {
    Xapian::TermIterator * resultobj = new Xapian::TermIterator((Xapian::TermIterator &) result);
    SWIG_SetPointerZval(return_value, (void *)resultobj, SWIGTYPE_p_Xapian__TermIterator, 1);
  }
  /* Wrap this return value */
  {
    /* ALTERNATIVE Constructor, make an object wrapper */
    zval *obj, *_cPtr;
    MAKE_STD_ZVAL(obj);
    MAKE_STD_ZVAL(_cPtr);
    *_cPtr = *return_value;
    INIT_ZVAL(*return_value);
    object_init_ex(obj,ptr_ce_swig_XapianTermIterator);
    add_property_zval(obj,"_cPtr",_cPtr);
    *return_value=*obj;
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_XapianEnquire_get_matching_terms_end__SWIG_0) {
  Xapian::Enquire *arg1 = (Xapian::Enquire *) 0 ;
  Xapian::docid arg2 ;
  Xapian::TermIterator result;
  zval **args[1];
  
  SWIG_ResetError();
  /* This function uses a this_ptr*/
  if(ZEND_NUM_ARGS() != 1 || zend_get_parameters_array_ex(1, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*&this_ptr, (void **) &arg1, SWIGTYPE_p_Xapian__Enquire, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of XapianEnquire_get_matching_terms_end. Expected SWIGTYPE_p_Xapian__Enquire");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    /*@SWIG:CONVERT_INT_IN@*/
    convert_to_long_ex(args[0]);
    arg2 = (Xapian::docid) Z_LVAL_PP(args[0]);
    /*@SWIG@*/;
  }
  {
    try {
      result = ((Xapian::Enquire const *)arg1)->get_matching_terms_end(arg2);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      
#if PHP_MAJOR_VERSION-0 < 5
      if (code == SWIG_RuntimeError) {
        zend_error(E_WARNING, const_cast<char *>(msg.c_str()));
        /* FIXME: destructors don't have return_value to set. */
        // ZVAL_NULL(return_value);
        return;
      }
#endif
      
      XapianException(code, msg);
    }
  }
  {
    Xapian::TermIterator * resultobj = new Xapian::TermIterator((Xapian::TermIterator &) result);
    SWIG_SetPointerZval(return_value, (void *)resultobj, SWIGTYPE_p_Xapian__TermIterator, 1);
  }
  /* Wrap this return value */
  {
    /* ALTERNATIVE Constructor, make an object wrapper */
    zval *obj, *_cPtr;
    MAKE_STD_ZVAL(obj);
    MAKE_STD_ZVAL(_cPtr);
    *_cPtr = *return_value;
    INIT_ZVAL(*return_value);
    object_init_ex(obj,ptr_ce_swig_XapianTermIterator);
    add_property_zval(obj,"_cPtr",_cPtr);
    *return_value=*obj;
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_XapianEnquire_get_matching_terms_begin__SWIG_1) {
  Xapian::Enquire *arg1 = (Xapian::Enquire *) 0 ;
  Xapian::MSetIterator *arg2 = 0 ;
  Xapian::TermIterator result;
  zval **args[1];
  
  SWIG_ResetError();
  /* This function uses a this_ptr*/
  if(ZEND_NUM_ARGS() != 1 || zend_get_parameters_array_ex(1, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*&this_ptr, (void **) &arg1, SWIGTYPE_p_Xapian__Enquire, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of XapianEnquire_get_matching_terms_begin. Expected SWIGTYPE_p_Xapian__Enquire");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    if (SWIG_ConvertPtr(*args[0], (void**)&arg2, SWIGTYPE_p_Xapian__MSetIterator, 0) < 0 || arg2 == NULL) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 2 of XapianEnquire_get_matching_terms_begin. Expected SWIGTYPE_p_Xapian__MSetIterator");
    }
  }
  {
    try {
      result = ((Xapian::Enquire const *)arg1)->get_matching_terms_begin((Xapian::MSetIterator const &)*arg2);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      
#if PHP_MAJOR_VERSION-0 < 5
      if (code == SWIG_RuntimeError) {
        zend_error(E_WARNING, const_cast<char *>(msg.c_str()));
        /* FIXME: destructors don't have return_value to set. */
        // ZVAL_NULL(return_value);
        return;
      }
#endif
      
      XapianException(code, msg);
    }
  }
  {
    Xapian::TermIterator * resultobj = new Xapian::TermIterator((Xapian::TermIterator &) result);
    SWIG_SetPointerZval(return_value, (void *)resultobj, SWIGTYPE_p_Xapian__TermIterator, 1);
  }
  /* Wrap this return value */
  {
    /* ALTERNATIVE Constructor, make an object wrapper */
    zval *obj, *_cPtr;
    MAKE_STD_ZVAL(obj);
    MAKE_STD_ZVAL(_cPtr);
    *_cPtr = *return_value;
    INIT_ZVAL(*return_value);
    object_init_ex(obj,ptr_ce_swig_XapianTermIterator);
    add_property_zval(obj,"_cPtr",_cPtr);
    *return_value=*obj;
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_XapianEnquire_get_matching_terms_begin) {
  int argc;
  zval **argv[2];
  
  argc = ZEND_NUM_ARGS();
  argv[0] = &this_ptr;
  zend_get_parameters_array_ex(argc,argv+1);
  argc++;
  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) {
        return _wrap_XapianEnquire_get_matching_terms_begin__SWIG_1(INTERNAL_FUNCTION_PARAM_PASSTHRU);
      }
    }
  }
  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) {
        return _wrap_XapianEnquire_get_matching_terms_begin__SWIG_0(INTERNAL_FUNCTION_PARAM_PASSTHRU);
      }
    }
  }
  
  SWIG_ErrorCode() = E_ERROR;
  SWIG_ErrorMsg() = "No matching function for overloaded 'XapianEnquire_get_matching_terms_begin'";
  zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_XapianEnquire_get_matching_terms_end__SWIG_1) {
  Xapian::Enquire *arg1 = (Xapian::Enquire *) 0 ;
  Xapian::MSetIterator *arg2 = 0 ;
  Xapian::TermIterator result;
  zval **args[1];
  
  SWIG_ResetError();
  /* This function uses a this_ptr*/
  if(ZEND_NUM_ARGS() != 1 || zend_get_parameters_array_ex(1, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*&this_ptr, (void **) &arg1, SWIGTYPE_p_Xapian__Enquire, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of XapianEnquire_get_matching_terms_end. Expected SWIGTYPE_p_Xapian__Enquire");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    if (SWIG_ConvertPtr(*args[0], (void**)&arg2, SWIGTYPE_p_Xapian__MSetIterator, 0) < 0 || arg2 == NULL) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 2 of XapianEnquire_get_matching_terms_end. Expected SWIGTYPE_p_Xapian__MSetIterator");
    }
  }
  {
    try {
      result = ((Xapian::Enquire const *)arg1)->get_matching_terms_end((Xapian::MSetIterator const &)*arg2);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      
#if PHP_MAJOR_VERSION-0 < 5
      if (code == SWIG_RuntimeError) {
        zend_error(E_WARNING, const_cast<char *>(msg.c_str()));
        /* FIXME: destructors don't have return_value to set. */
        // ZVAL_NULL(return_value);
        return;
      }
#endif
      
      XapianException(code, msg);
    }
  }
  {
    Xapian::TermIterator * resultobj = new Xapian::TermIterator((Xapian::TermIterator &) result);
    SWIG_SetPointerZval(return_value, (void *)resultobj, SWIGTYPE_p_Xapian__TermIterator, 1);
  }
  /* Wrap this return value */
  {
    /* ALTERNATIVE Constructor, make an object wrapper */
    zval *obj, *_cPtr;
    MAKE_STD_ZVAL(obj);
    MAKE_STD_ZVAL(_cPtr);
    *_cPtr = *return_value;
    INIT_ZVAL(*return_value);
    object_init_ex(obj,ptr_ce_swig_XapianTermIterator);
    add_property_zval(obj,"_cPtr",_cPtr);
    *return_value=*obj;
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_XapianEnquire_get_matching_terms_end) {
  int argc;
  zval **argv[2];
  
  argc = ZEND_NUM_ARGS();
  argv[0] = &this_ptr;
  zend_get_parameters_array_ex(argc,argv+1);
  argc++;
  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) {
        return _wrap_XapianEnquire_get_matching_terms_end__SWIG_1(INTERNAL_FUNCTION_PARAM_PASSTHRU);
      }
    }
  }
  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) {
        return _wrap_XapianEnquire_get_matching_terms_end__SWIG_0(INTERNAL_FUNCTION_PARAM_PASSTHRU);
      }
    }
  }
  
  SWIG_ErrorCode() = E_ERROR;
  SWIG_ErrorMsg() = "No matching function for overloaded 'XapianEnquire_get_matching_terms_end'";
  zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_XapianEnquire_register_match_decider__SWIG_0) {
  Xapian::Enquire *arg1 = (Xapian::Enquire *) 0 ;
  std::string *arg2 = 0 ;
  Xapian::MatchDecider *arg3 = (Xapian::MatchDecider *) 0 ;
  std::string temp2 ;
  zval **args[2];
  
  SWIG_ResetError();
  /* This function uses a this_ptr*/
  if(ZEND_NUM_ARGS() != 2 || zend_get_parameters_array_ex(2, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*&this_ptr, (void **) &arg1, SWIGTYPE_p_Xapian__Enquire, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of XapianEnquire_register_match_decider. Expected SWIGTYPE_p_Xapian__Enquire");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    convert_to_string_ex(args[0]);
    temp2.assign(Z_STRVAL_PP(args[0]), Z_STRLEN_PP(args[0]));
    arg2 = &temp2;
  }
  {
    if(SWIG_ConvertPtr(*args[1], (void **) &arg3, SWIGTYPE_p_Xapian__MatchDecider, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 3 of XapianEnquire_register_match_decider. Expected SWIGTYPE_p_Xapian__MatchDecider");
    }
  }
  {
    try {
      (arg1)->register_match_decider((std::string const &)*arg2,(Xapian::MatchDecider const *)arg3);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      
#if PHP_MAJOR_VERSION-0 < 5
      if (code == SWIG_RuntimeError) {
        zend_error(E_WARNING, const_cast<char *>(msg.c_str()));
        /* FIXME: destructors don't have return_value to set. */
        // ZVAL_NULL(return_value);
        return;
      }
#endif
      
      XapianException(code, msg);
    }
  }
  
  return;
fail:
  zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_XapianEnquire_register_match_decider__SWIG_1) {
  Xapian::Enquire *arg1 = (Xapian::Enquire *) 0 ;
  std::string *arg2 = 0 ;
  std::string temp2 ;
  zval **args[1];
  
  SWIG_ResetError();
  /* This function uses a this_ptr*/
  if(ZEND_NUM_ARGS() != 1 || zend_get_parameters_array_ex(1, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*&this_ptr, (void **) &arg1, SWIGTYPE_p_Xapian__Enquire, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of XapianEnquire_register_match_decider. Expected SWIGTYPE_p_Xapian__Enquire");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    convert_to_string_ex(args[0]);
    temp2.assign(Z_STRVAL_PP(args[0]), Z_STRLEN_PP(args[0]));
    arg2 = &temp2;
  }
  {
    try {
      (arg1)->register_match_decider((std::string const &)*arg2);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      
#if PHP_MAJOR_VERSION-0 < 5
      if (code == SWIG_RuntimeError) {
        zend_error(E_WARNING, const_cast<char *>(msg.c_str()));
        /* FIXME: destructors don't have return_value to set. */
        // ZVAL_NULL(return_value);
        return;
      }
#endif
      
      XapianException(code, msg);
    }
  }
  
  return;
fail:
  zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_XapianEnquire_register_match_decider) {
  int argc;
  zval **argv[3];
  
  argc = ZEND_NUM_ARGS();
  argv[0] = &this_ptr;
  zend_get_parameters_array_ex(argc,argv+1);
  argc++;
  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_STRING);
      }
      if (_v) {
        return _wrap_XapianEnquire_register_match_decider__SWIG_1(INTERNAL_FUNCTION_PARAM_PASSTHRU);
      }
    }
  }
  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_STRING);
      }
      if (_v) {
        {
          void *tmp;
          _v = (SWIG_ConvertPtr( *argv[2], (void**)&tmp, SWIGTYPE_p_Xapian__MatchDecider, 0) >= 0);
        }
        if (_v) {
          return _wrap_XapianEnquire_register_match_decider__SWIG_0(INTERNAL_FUNCTION_PARAM_PASSTHRU);
        }
      }
    }
  }
  
  SWIG_ErrorCode() = E_ERROR;
  SWIG_ErrorMsg() = "No matching function for overloaded 'XapianEnquire_register_match_decider'";
  zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_XapianEnquire_get_matching_terms) {
  Xapian::Enquire *arg1 = (Xapian::Enquire *) 0 ;
  Xapian::MSetIterator *arg2 = 0 ;
  std::pair<Xapian::TermIterator,Xapian::TermIterator > result;
  zval **args[1];
  
  SWIG_ResetError();
  /* This function uses a this_ptr*/
  if(ZEND_NUM_ARGS() != 1 || zend_get_parameters_array_ex(1, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*&this_ptr, (void **) &arg1, SWIGTYPE_p_Xapian__Enquire, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of XapianEnquire_get_matching_terms. Expected SWIGTYPE_p_Xapian__Enquire");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    if (SWIG_ConvertPtr(*args[0], (void**)&arg2, SWIGTYPE_p_Xapian__MSetIterator, 0) < 0 || arg2 == NULL) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 2 of XapianEnquire_get_matching_terms. Expected SWIGTYPE_p_Xapian__MSetIterator");
    }
  }
  {
    try {
      result = Xapian_Enquire_get_matching_terms((Xapian::Enquire const *)arg1,(Xapian::MSetIterator const &)*arg2);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      
#if PHP_MAJOR_VERSION-0 < 5
      if (code == SWIG_RuntimeError) {
        zend_error(E_WARNING, const_cast<char *>(msg.c_str()));
        /* FIXME: destructors don't have return_value to set. */
        // ZVAL_NULL(return_value);
        return;
      }
#endif
      
      XapianException(code, msg);
    }
  }
  {
    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.
             */
      char * p = const_cast<char *>((*i).data());
      add_next_index_stringl(return_value, p, (*i).length(), 1);
    }
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_XapianEnquire_get_description) {
  Xapian::Enquire *arg1 = (Xapian::Enquire *) 0 ;
  std::string result;
  
  SWIG_ResetError();
  /* This function uses a this_ptr*/
  if(ZEND_NUM_ARGS() != 0) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*&this_ptr, (void **) &arg1, SWIGTYPE_p_Xapian__Enquire, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of XapianEnquire_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 (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      
#if PHP_MAJOR_VERSION-0 < 5
      if (code == SWIG_RuntimeError) {
        zend_error(E_WARNING, const_cast<char *>(msg.c_str()));
        /* FIXME: destructors don't have return_value to set. */
        // ZVAL_NULL(return_value);
        return;
      }
#endif
      
      XapianException(code, msg);
    }
  }
  {
    ZVAL_STRINGL(return_value,const_cast<char*>((&result)->data()),(&result)->length(),1);
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg());
}


/* property handler for class XapianEnquire */
static pval _wrap_propget_XapianEnquire(zend_property_reference *property_reference) {
  pval result;
  pval **_result;
  zend_llist_element *element = property_reference->elements_list->head;
  zend_overloaded_element *property=(zend_overloaded_element *)element->data;
  result.type = IS_NULL;
  if (_propget_XapianEnquire(property_reference, &result)==SUCCESS) return result;
  /* return it ourselves */
  if (zend_hash_find(Z_OBJPROP_P(property_reference->object),Z_STRVAL_P(&(property->element)),1+Z_STRLEN_P(&(property->element)),(void**)&_result)==SUCCESS) {
  zval *_value;
  MAKE_STD_ZVAL(_value);  *_value=**_result;
  INIT_PZVAL(_value);
  zval_copy_ctor(_value);
  return *_value;
  }
  result.type = IS_NULL;
  return result;
}
static int _propget_XapianEnquire(zend_property_reference *property_reference, pval *value) {
  /* get the property name */
  zend_llist_element *element = property_reference->elements_list->head;
  zend_overloaded_element *property=(zend_overloaded_element *)element->data;
  char *propname=Z_STRVAL_P(&(property->element));
  return FAILURE;
}

static int _wrap_propset_XapianEnquire(zend_property_reference *property_reference, pval *value) { 
  zval * _value;
  zend_llist_element *element = property_reference->elements_list->head;
  zend_overloaded_element *property=(zend_overloaded_element *)element->data;
  if (_propset_XapianEnquire(property_reference, value)==SUCCESS) return SUCCESS;
  /* set it ourselves as it is XapianEnquire */
  MAKE_STD_ZVAL(_value);
  *_value=*value;
  INIT_PZVAL(_value);
  zval_copy_ctor(_value);
  return add_property_zval_ex(property_reference->object,Z_STRVAL_P(&(property->element)),1+Z_STRLEN_P(&(property->element)),_value);
}
static int _propset_XapianEnquire(zend_property_reference *property_reference, pval *value) {
  /* get the property name */
  zend_llist_element *element = property_reference->elements_list->head;
  zend_overloaded_element *property=(zend_overloaded_element *)element->data;
  char *propname=Z_STRVAL_P(&(property->element));
  return FAILURE;
}

/* This function is designed to be called by the zend list destructors */
/* to typecast and do the actual destruction */
static void __wrap_delete_XapianWeight(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 (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      
#if PHP_MAJOR_VERSION-0 < 5
      if (code == SWIG_RuntimeError) {
        zend_error(E_WARNING, const_cast<char *>(msg.c_str()));
        /* FIXME: destructors don't have return_value to set. */
        // ZVAL_NULL(return_value);
        return;
      }
#endif
      
      XapianException(code, msg);
    }
  }
}


ZEND_NAMED_FUNCTION(_wrap_XapianWeight_name) {
  Xapian::Weight *arg1 = (Xapian::Weight *) 0 ;
  std::string result;
  
  SWIG_ResetError();
  /* This function uses a this_ptr*/
  if(ZEND_NUM_ARGS() != 0) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*&this_ptr, (void **) &arg1, SWIGTYPE_p_Xapian__Weight, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of XapianWeight_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 (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      
#if PHP_MAJOR_VERSION-0 < 5
      if (code == SWIG_RuntimeError) {
        zend_error(E_WARNING, const_cast<char *>(msg.c_str()));
        /* FIXME: destructors don't have return_value to set. */
        // ZVAL_NULL(return_value);
        return;
      }
#endif
      
      XapianException(code, msg);
    }
  }
  {
    ZVAL_STRINGL(return_value,const_cast<char*>((&result)->data()),(&result)->length(),1);
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_XapianWeight_serialise) {
  Xapian::Weight *arg1 = (Xapian::Weight *) 0 ;
  std::string result;
  
  SWIG_ResetError();
  /* This function uses a this_ptr*/
  if(ZEND_NUM_ARGS() != 0) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*&this_ptr, (void **) &arg1, SWIGTYPE_p_Xapian__Weight, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of XapianWeight_serialise. Expected SWIGTYPE_p_Xapian__Weight");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    try {
      result = ((Xapian::Weight const *)arg1)->serialise();
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      
#if PHP_MAJOR_VERSION-0 < 5
      if (code == SWIG_RuntimeError) {
        zend_error(E_WARNING, const_cast<char *>(msg.c_str()));
        /* FIXME: destructors don't have return_value to set. */
        // ZVAL_NULL(return_value);
        return;
      }
#endif
      
      XapianException(code, msg);
    }
  }
  {
    ZVAL_STRINGL(return_value,const_cast<char*>((&result)->data()),(&result)->length(),1);
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_XapianWeight_unserialise) {
  Xapian::Weight *arg1 = (Xapian::Weight *) 0 ;
  std::string *arg2 = 0 ;
  Xapian::Weight *result = 0 ;
  std::string temp2 ;
  zval **args[1];
  
  SWIG_ResetError();
  /* This function uses a this_ptr*/
  if(ZEND_NUM_ARGS() != 1 || zend_get_parameters_array_ex(1, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*&this_ptr, (void **) &arg1, SWIGTYPE_p_Xapian__Weight, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of XapianWeight_unserialise. Expected SWIGTYPE_p_Xapian__Weight");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    convert_to_string_ex(args[0]);
    temp2.assign(Z_STRVAL_PP(args[0]), Z_STRLEN_PP(args[0]));
    arg2 = &temp2;
  }
  {
    try {
      result = (Xapian::Weight *)((Xapian::Weight const *)arg1)->unserialise((std::string const &)*arg2);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      
#if PHP_MAJOR_VERSION-0 < 5
      if (code == SWIG_RuntimeError) {
        zend_error(E_WARNING, const_cast<char *>(msg.c_str()));
        /* FIXME: destructors don't have return_value to set. */
        // ZVAL_NULL(return_value);
        return;
      }
#endif
      
      XapianException(code, msg);
    }
  }
  {
    SWIG_SetPointerZval(return_value, (void *)result, SWIGTYPE_p_Xapian__Weight, 0);
  }
  /* Wrap this return value */
  {
    /* ALTERNATIVE Constructor, make an object wrapper */
    zval *obj, *_cPtr;
    MAKE_STD_ZVAL(obj);
    MAKE_STD_ZVAL(_cPtr);
    *_cPtr = *return_value;
    INIT_ZVAL(*return_value);
    object_init_ex(obj,ptr_ce_swig_XapianWeight);
    add_property_zval(obj,"_cPtr",_cPtr);
    *return_value=*obj;
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_XapianWeight_get_sumpart) {
  Xapian::Weight *arg1 = (Xapian::Weight *) 0 ;
  Xapian::termcount arg2 ;
  Xapian::doclength arg3 ;
  Xapian::weight result;
  zval **args[2];
  
  SWIG_ResetError();
  /* This function uses a this_ptr*/
  if(ZEND_NUM_ARGS() != 2 || zend_get_parameters_array_ex(2, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*&this_ptr, (void **) &arg1, SWIGTYPE_p_Xapian__Weight, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of XapianWeight_get_sumpart. Expected SWIGTYPE_p_Xapian__Weight");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    /*@SWIG:CONVERT_INT_IN@*/
    convert_to_long_ex(args[0]);
    arg2 = (Xapian::termcount) Z_LVAL_PP(args[0]);
    /*@SWIG@*/;
  }
  {
    /*@SWIG:CONVERT_FLOAT_IN@*/
    convert_to_double_ex(args[1]);
    arg3 = (Xapian::doclength) Z_DVAL_PP(args[1]);
    /*@SWIG@*/;
  }
  {
    try {
      result = (Xapian::weight)((Xapian::Weight const *)arg1)->get_sumpart(arg2,arg3);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      
#if PHP_MAJOR_VERSION-0 < 5
      if (code == SWIG_RuntimeError) {
        zend_error(E_WARNING, const_cast<char *>(msg.c_str()));
        /* FIXME: destructors don't have return_value to set. */
        // ZVAL_NULL(return_value);
        return;
      }
#endif
      
      XapianException(code, msg);
    }
  }
  {
    ZVAL_DOUBLE(return_value,result);
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_XapianWeight_get_maxpart) {
  Xapian::Weight *arg1 = (Xapian::Weight *) 0 ;
  Xapian::weight result;
  
  SWIG_ResetError();
  /* This function uses a this_ptr*/
  if(ZEND_NUM_ARGS() != 0) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*&this_ptr, (void **) &arg1, SWIGTYPE_p_Xapian__Weight, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of XapianWeight_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 (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      
#if PHP_MAJOR_VERSION-0 < 5
      if (code == SWIG_RuntimeError) {
        zend_error(E_WARNING, const_cast<char *>(msg.c_str()));
        /* FIXME: destructors don't have return_value to set. */
        // ZVAL_NULL(return_value);
        return;
      }
#endif
      
      XapianException(code, msg);
    }
  }
  {
    ZVAL_DOUBLE(return_value,result);
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_XapianWeight_get_sumextra) {
  Xapian::Weight *arg1 = (Xapian::Weight *) 0 ;
  Xapian::doclength arg2 ;
  Xapian::weight result;
  zval **args[1];
  
  SWIG_ResetError();
  /* This function uses a this_ptr*/
  if(ZEND_NUM_ARGS() != 1 || zend_get_parameters_array_ex(1, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*&this_ptr, (void **) &arg1, SWIGTYPE_p_Xapian__Weight, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of XapianWeight_get_sumextra. Expected SWIGTYPE_p_Xapian__Weight");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    /*@SWIG:CONVERT_FLOAT_IN@*/
    convert_to_double_ex(args[0]);
    arg2 = (Xapian::doclength) Z_DVAL_PP(args[0]);
    /*@SWIG@*/;
  }
  {
    try {
      result = (Xapian::weight)((Xapian::Weight const *)arg1)->get_sumextra(arg2);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      
#if PHP_MAJOR_VERSION-0 < 5
      if (code == SWIG_RuntimeError) {
        zend_error(E_WARNING, const_cast<char *>(msg.c_str()));
        /* FIXME: destructors don't have return_value to set. */
        // ZVAL_NULL(return_value);
        return;
      }
#endif
      
      XapianException(code, msg);
    }
  }
  {
    ZVAL_DOUBLE(return_value,result);
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_XapianWeight_get_maxextra) {
  Xapian::Weight *arg1 = (Xapian::Weight *) 0 ;
  Xapian::weight result;
  
  SWIG_ResetError();
  /* This function uses a this_ptr*/
  if(ZEND_NUM_ARGS() != 0) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*&this_ptr, (void **) &arg1, SWIGTYPE_p_Xapian__Weight, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of XapianWeight_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 (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      
#if PHP_MAJOR_VERSION-0 < 5
      if (code == SWIG_RuntimeError) {
        zend_error(E_WARNING, const_cast<char *>(msg.c_str()));
        /* FIXME: destructors don't have return_value to set. */
        // ZVAL_NULL(return_value);
        return;
      }
#endif
      
      XapianException(code, msg);
    }
  }
  {
    ZVAL_DOUBLE(return_value,result);
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_XapianWeight_get_sumpart_needs_doclength) {
  Xapian::Weight *arg1 = (Xapian::Weight *) 0 ;
  bool result;
  
  SWIG_ResetError();
  /* This function uses a this_ptr*/
  if(ZEND_NUM_ARGS() != 0) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*&this_ptr, (void **) &arg1, SWIGTYPE_p_Xapian__Weight, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of XapianWeight_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 (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      
#if PHP_MAJOR_VERSION-0 < 5
      if (code == SWIG_RuntimeError) {
        zend_error(E_WARNING, const_cast<char *>(msg.c_str()));
        /* FIXME: destructors don't have return_value to set. */
        // ZVAL_NULL(return_value);
        return;
      }
#endif
      
      XapianException(code, msg);
    }
  }
  {
    ZVAL_BOOL(return_value,(result)?1:0);
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_new_XapianWeight) {
  zend_error(E_ERROR,"Cannot create swig object type: XapianWeight as the underlying class is abstract");
}





/* property handler for class XapianWeight */
static pval _wrap_propget_XapianWeight(zend_property_reference *property_reference) {
  pval result;
  pval **_result;
  zend_llist_element *element = property_reference->elements_list->head;
  zend_overloaded_element *property=(zend_overloaded_element *)element->data;
  result.type = IS_NULL;
  if (_propget_XapianWeight(property_reference, &result)==SUCCESS) return result;
  /* return it ourselves */
  if (zend_hash_find(Z_OBJPROP_P(property_reference->object),Z_STRVAL_P(&(property->element)),1+Z_STRLEN_P(&(property->element)),(void**)&_result)==SUCCESS) {
  zval *_value;
  MAKE_STD_ZVAL(_value);  *_value=**_result;
  INIT_PZVAL(_value);
  zval_copy_ctor(_value);
  return *_value;
  }
  result.type = IS_NULL;
  return result;
}
static int _propget_XapianWeight(zend_property_reference *property_reference, pval *value) {
  /* get the property name */
  zend_llist_element *element = property_reference->elements_list->head;
  zend_overloaded_element *property=(zend_overloaded_element *)element->data;
  char *propname=Z_STRVAL_P(&(property->element));
  return FAILURE;
}

static int _wrap_propset_XapianWeight(zend_property_reference *property_reference, pval *value) { 
  zval * _value;
  zend_llist_element *element = property_reference->elements_list->head;
  zend_overloaded_element *property=(zend_overloaded_element *)element->data;
  if (_propset_XapianWeight(property_reference, value)==SUCCESS) return SUCCESS;
  /* set it ourselves as it is XapianWeight */
  MAKE_STD_ZVAL(_value);
  *_value=*value;
  INIT_PZVAL(_value);
  zval_copy_ctor(_value);
  return add_property_zval_ex(property_reference->object,Z_STRVAL_P(&(property->element)),1+Z_STRLEN_P(&(property->element)),_value);
}
static int _propset_XapianWeight(zend_property_reference *property_reference, pval *value) {
  /* get the property name */
  zend_llist_element *element = property_reference->elements_list->head;
  zend_overloaded_element *property=(zend_overloaded_element *)element->data;
  char *propname=Z_STRVAL_P(&(property->element));
  return FAILURE;
}

ZEND_NAMED_FUNCTION(_wrap_XapianBoolWeight_clone) {
  Xapian::BoolWeight *arg1 = (Xapian::BoolWeight *) 0 ;
  Xapian::BoolWeight *result = 0 ;
  
  SWIG_ResetError();
  /* This function uses a this_ptr*/
  if(ZEND_NUM_ARGS() != 0) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*&this_ptr, (void **) &arg1, SWIGTYPE_p_Xapian__BoolWeight, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of XapianBoolWeight_clone. Expected SWIGTYPE_p_Xapian__BoolWeight");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    try {
      result = (Xapian::BoolWeight *)((Xapian::BoolWeight const *)arg1)->clone();
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      
#if PHP_MAJOR_VERSION-0 < 5
      if (code == SWIG_RuntimeError) {
        zend_error(E_WARNING, const_cast<char *>(msg.c_str()));
        /* FIXME: destructors don't have return_value to set. */
        // ZVAL_NULL(return_value);
        return;
      }
#endif
      
      XapianException(code, msg);
    }
  }
  {
    SWIG_SetPointerZval(return_value, (void *)result, SWIGTYPE_p_Xapian__BoolWeight, 0);
  }
  /* Wrap this return value */
  {
    /* ALTERNATIVE Constructor, make an object wrapper */
    zval *obj, *_cPtr;
    MAKE_STD_ZVAL(obj);
    MAKE_STD_ZVAL(_cPtr);
    *_cPtr = *return_value;
    INIT_ZVAL(*return_value);
    object_init_ex(obj,ptr_ce_swig_XapianBoolWeight);
    add_property_zval(obj,"_cPtr",_cPtr);
    *return_value=*obj;
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_new_XapianBoolWeight) {
  Xapian::BoolWeight *result = 0 ;
  
  SWIG_ResetError();
  /* NATIVE Constructor */
  if(ZEND_NUM_ARGS() != 0) {
    WRONG_PARAM_COUNT;
  }
  
  {
    try {
      result = (Xapian::BoolWeight *)new Xapian::BoolWeight();
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      
#if PHP_MAJOR_VERSION-0 < 5
      if (code == SWIG_RuntimeError) {
        zend_error(E_WARNING, const_cast<char *>(msg.c_str()));
        /* FIXME: destructors don't have return_value to set. */
        // ZVAL_NULL(return_value);
        return;
      }
#endif
      
      XapianException(code, msg);
    }
  }
  {
    SWIG_SetPointerZval(return_value, (void *)result, SWIGTYPE_p_Xapian__BoolWeight, 1);
  }
  /* Wrap this return value */
  if (this_ptr) {
    /* NATIVE Constructor, use this_ptr */
    zval *_cPtr; MAKE_STD_ZVAL(_cPtr);
    *_cPtr = *return_value;
    INIT_ZVAL(*return_value);
    add_property_zval(this_ptr,"_cPtr",_cPtr);
  } else if (! this_ptr) {
    /* ALTERNATIVE Constructor, make an object wrapper */
    zval *obj, *_cPtr;
    MAKE_STD_ZVAL(obj);
    MAKE_STD_ZVAL(_cPtr);
    *_cPtr = *return_value;
    INIT_ZVAL(*return_value);
    object_init_ex(obj,ptr_ce_swig_XapianBoolWeight);
    add_property_zval(obj,"_cPtr",_cPtr);
    *return_value=*obj;
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),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_XapianBoolWeight(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 (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      
#if PHP_MAJOR_VERSION-0 < 5
      if (code == SWIG_RuntimeError) {
        zend_error(E_WARNING, const_cast<char *>(msg.c_str()));
        /* FIXME: destructors don't have return_value to set. */
        // ZVAL_NULL(return_value);
        return;
      }
#endif
      
      XapianException(code, msg);
    }
  }
}


ZEND_NAMED_FUNCTION(_wrap_XapianBoolWeight_name) {
  Xapian::BoolWeight *arg1 = (Xapian::BoolWeight *) 0 ;
  std::string result;
  
  SWIG_ResetError();
  /* This function uses a this_ptr*/
  if(ZEND_NUM_ARGS() != 0) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*&this_ptr, (void **) &arg1, SWIGTYPE_p_Xapian__BoolWeight, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of XapianBoolWeight_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 (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      
#if PHP_MAJOR_VERSION-0 < 5
      if (code == SWIG_RuntimeError) {
        zend_error(E_WARNING, const_cast<char *>(msg.c_str()));
        /* FIXME: destructors don't have return_value to set. */
        // ZVAL_NULL(return_value);
        return;
      }
#endif
      
      XapianException(code, msg);
    }
  }
  {
    ZVAL_STRINGL(return_value,const_cast<char*>((&result)->data()),(&result)->length(),1);
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_XapianBoolWeight_serialise) {
  Xapian::BoolWeight *arg1 = (Xapian::BoolWeight *) 0 ;
  std::string result;
  
  SWIG_ResetError();
  /* This function uses a this_ptr*/
  if(ZEND_NUM_ARGS() != 0) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*&this_ptr, (void **) &arg1, SWIGTYPE_p_Xapian__BoolWeight, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of XapianBoolWeight_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 (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      
#if PHP_MAJOR_VERSION-0 < 5
      if (code == SWIG_RuntimeError) {
        zend_error(E_WARNING, const_cast<char *>(msg.c_str()));
        /* FIXME: destructors don't have return_value to set. */
        // ZVAL_NULL(return_value);
        return;
      }
#endif
      
      XapianException(code, msg);
    }
  }
  {
    ZVAL_STRINGL(return_value,const_cast<char*>((&result)->data()),(&result)->length(),1);
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_XapianBoolWeight_unserialise) {
  Xapian::BoolWeight *arg1 = (Xapian::BoolWeight *) 0 ;
  std::string *arg2 = 0 ;
  Xapian::BoolWeight *result = 0 ;
  std::string temp2 ;
  zval **args[1];
  
  SWIG_ResetError();
  /* This function uses a this_ptr*/
  if(ZEND_NUM_ARGS() != 1 || zend_get_parameters_array_ex(1, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*&this_ptr, (void **) &arg1, SWIGTYPE_p_Xapian__BoolWeight, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of XapianBoolWeight_unserialise. Expected SWIGTYPE_p_Xapian__BoolWeight");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    convert_to_string_ex(args[0]);
    temp2.assign(Z_STRVAL_PP(args[0]), Z_STRLEN_PP(args[0]));
    arg2 = &temp2;
  }
  {
    try {
      result = (Xapian::BoolWeight *)((Xapian::BoolWeight const *)arg1)->unserialise((std::string const &)*arg2);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      
#if PHP_MAJOR_VERSION-0 < 5
      if (code == SWIG_RuntimeError) {
        zend_error(E_WARNING, const_cast<char *>(msg.c_str()));
        /* FIXME: destructors don't have return_value to set. */
        // ZVAL_NULL(return_value);
        return;
      }
#endif
      
      XapianException(code, msg);
    }
  }
  {
    SWIG_SetPointerZval(return_value, (void *)result, SWIGTYPE_p_Xapian__BoolWeight, 0);
  }
  /* Wrap this return value */
  {
    /* ALTERNATIVE Constructor, make an object wrapper */
    zval *obj, *_cPtr;
    MAKE_STD_ZVAL(obj);
    MAKE_STD_ZVAL(_cPtr);
    *_cPtr = *return_value;
    INIT_ZVAL(*return_value);
    object_init_ex(obj,ptr_ce_swig_XapianBoolWeight);
    add_property_zval(obj,"_cPtr",_cPtr);
    *return_value=*obj;
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_XapianBoolWeight_get_sumpart) {
  Xapian::BoolWeight *arg1 = (Xapian::BoolWeight *) 0 ;
  Xapian::termcount arg2 ;
  Xapian::doclength arg3 ;
  Xapian::weight result;
  zval **args[2];
  
  SWIG_ResetError();
  /* This function uses a this_ptr*/
  if(ZEND_NUM_ARGS() != 2 || zend_get_parameters_array_ex(2, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*&this_ptr, (void **) &arg1, SWIGTYPE_p_Xapian__BoolWeight, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of XapianBoolWeight_get_sumpart. Expected SWIGTYPE_p_Xapian__BoolWeight");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    /*@SWIG:CONVERT_INT_IN@*/
    convert_to_long_ex(args[0]);
    arg2 = (Xapian::termcount) Z_LVAL_PP(args[0]);
    /*@SWIG@*/;
  }
  {
    /*@SWIG:CONVERT_FLOAT_IN@*/
    convert_to_double_ex(args[1]);
    arg3 = (Xapian::doclength) Z_DVAL_PP(args[1]);
    /*@SWIG@*/;
  }
  {
    try {
      result = (Xapian::weight)((Xapian::BoolWeight const *)arg1)->get_sumpart(arg2,arg3);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      
#if PHP_MAJOR_VERSION-0 < 5
      if (code == SWIG_RuntimeError) {
        zend_error(E_WARNING, const_cast<char *>(msg.c_str()));
        /* FIXME: destructors don't have return_value to set. */
        // ZVAL_NULL(return_value);
        return;
      }
#endif
      
      XapianException(code, msg);
    }
  }
  {
    ZVAL_DOUBLE(return_value,result);
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_XapianBoolWeight_get_maxpart) {
  Xapian::BoolWeight *arg1 = (Xapian::BoolWeight *) 0 ;
  Xapian::weight result;
  
  SWIG_ResetError();
  /* This function uses a this_ptr*/
  if(ZEND_NUM_ARGS() != 0) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*&this_ptr, (void **) &arg1, SWIGTYPE_p_Xapian__BoolWeight, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of XapianBoolWeight_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 (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      
#if PHP_MAJOR_VERSION-0 < 5
      if (code == SWIG_RuntimeError) {
        zend_error(E_WARNING, const_cast<char *>(msg.c_str()));
        /* FIXME: destructors don't have return_value to set. */
        // ZVAL_NULL(return_value);
        return;
      }
#endif
      
      XapianException(code, msg);
    }
  }
  {
    ZVAL_DOUBLE(return_value,result);
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_XapianBoolWeight_get_sumextra) {
  Xapian::BoolWeight *arg1 = (Xapian::BoolWeight *) 0 ;
  Xapian::doclength arg2 ;
  Xapian::weight result;
  zval **args[1];
  
  SWIG_ResetError();
  /* This function uses a this_ptr*/
  if(ZEND_NUM_ARGS() != 1 || zend_get_parameters_array_ex(1, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*&this_ptr, (void **) &arg1, SWIGTYPE_p_Xapian__BoolWeight, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of XapianBoolWeight_get_sumextra. Expected SWIGTYPE_p_Xapian__BoolWeight");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    /*@SWIG:CONVERT_FLOAT_IN@*/
    convert_to_double_ex(args[0]);
    arg2 = (Xapian::doclength) Z_DVAL_PP(args[0]);
    /*@SWIG@*/;
  }
  {
    try {
      result = (Xapian::weight)((Xapian::BoolWeight const *)arg1)->get_sumextra(arg2);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      
#if PHP_MAJOR_VERSION-0 < 5
      if (code == SWIG_RuntimeError) {
        zend_error(E_WARNING, const_cast<char *>(msg.c_str()));
        /* FIXME: destructors don't have return_value to set. */
        // ZVAL_NULL(return_value);
        return;
      }
#endif
      
      XapianException(code, msg);
    }
  }
  {
    ZVAL_DOUBLE(return_value,result);
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_XapianBoolWeight_get_maxextra) {
  Xapian::BoolWeight *arg1 = (Xapian::BoolWeight *) 0 ;
  Xapian::weight result;
  
  SWIG_ResetError();
  /* This function uses a this_ptr*/
  if(ZEND_NUM_ARGS() != 0) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*&this_ptr, (void **) &arg1, SWIGTYPE_p_Xapian__BoolWeight, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of XapianBoolWeight_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 (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      
#if PHP_MAJOR_VERSION-0 < 5
      if (code == SWIG_RuntimeError) {
        zend_error(E_WARNING, const_cast<char *>(msg.c_str()));
        /* FIXME: destructors don't have return_value to set. */
        // ZVAL_NULL(return_value);
        return;
      }
#endif
      
      XapianException(code, msg);
    }
  }
  {
    ZVAL_DOUBLE(return_value,result);
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_XapianBoolWeight_get_sumpart_needs_doclength) {
  Xapian::BoolWeight *arg1 = (Xapian::BoolWeight *) 0 ;
  bool result;
  
  SWIG_ResetError();
  /* This function uses a this_ptr*/
  if(ZEND_NUM_ARGS() != 0) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*&this_ptr, (void **) &arg1, SWIGTYPE_p_Xapian__BoolWeight, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of XapianBoolWeight_get_sumpart_needs_doclength. Expected SWIGTYPE_p_Xapian__BoolWeight");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    try {
      result = (bool)((Xapian::BoolWeight const *)arg1)->get_sumpart_needs_doclength();
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      
#if PHP_MAJOR_VERSION-0 < 5
      if (code == SWIG_RuntimeError) {
        zend_error(E_WARNING, const_cast<char *>(msg.c_str()));
        /* FIXME: destructors don't have return_value to set. */
        // ZVAL_NULL(return_value);
        return;
      }
#endif
      
      XapianException(code, msg);
    }
  }
  {
    ZVAL_BOOL(return_value,(result)?1:0);
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg());
}


/* property handler for class XapianBoolWeight */
static pval _wrap_propget_XapianBoolWeight(zend_property_reference *property_reference) {
  pval result;
  pval **_result;
  zend_llist_element *element = property_reference->elements_list->head;
  zend_overloaded_element *property=(zend_overloaded_element *)element->data;
  result.type = IS_NULL;
  if (_propget_XapianBoolWeight(property_reference, &result)==SUCCESS) return result;
  /* return it ourselves */
  if (zend_hash_find(Z_OBJPROP_P(property_reference->object),Z_STRVAL_P(&(property->element)),1+Z_STRLEN_P(&(property->element)),(void**)&_result)==SUCCESS) {
  zval *_value;
  MAKE_STD_ZVAL(_value);  *_value=**_result;
  INIT_PZVAL(_value);
  zval_copy_ctor(_value);
  return *_value;
  }
  result.type = IS_NULL;
  return result;
}
static int _propget_XapianBoolWeight(zend_property_reference *property_reference, pval *value) {
  /* No extra properties for subclass XapianBoolWeight */
  /* Try base class(es). */
  if (_propget_XapianWeight(property_reference, value)==SUCCESS) return SUCCESS;
  return FAILURE;
}

static int _wrap_propset_XapianBoolWeight(zend_property_reference *property_reference, pval *value) { 
  zval * _value;
  zend_llist_element *element = property_reference->elements_list->head;
  zend_overloaded_element *property=(zend_overloaded_element *)element->data;
  if (_propset_XapianBoolWeight(property_reference, value)==SUCCESS) return SUCCESS;
  /* set it ourselves as it is XapianBoolWeight */
  MAKE_STD_ZVAL(_value);
  *_value=*value;
  INIT_PZVAL(_value);
  zval_copy_ctor(_value);
  return add_property_zval_ex(property_reference->object,Z_STRVAL_P(&(property->element)),1+Z_STRLEN_P(&(property->element)),_value);
}
static int _propset_XapianBoolWeight(zend_property_reference *property_reference, pval *value) {
  /* No extra properties for subclass XapianBoolWeight */
  /* Try base class(es) */
  if (_propset_XapianWeight(property_reference, value)==SUCCESS) return SUCCESS;
  return FAILURE;
}

ZEND_NAMED_FUNCTION(_wrap_new_XapianBM25Weight__SWIG_0) {
  double arg1 ;
  double arg2 ;
  double arg3 ;
  double arg4 ;
  double arg5 ;
  Xapian::BM25Weight *result = 0 ;
  zval **args[5];
  
  SWIG_ResetError();
  /* NATIVE Constructor */
  if(ZEND_NUM_ARGS() != 5 || zend_get_parameters_array_ex(5, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    /*@SWIG:CONVERT_FLOAT_IN@*/
    convert_to_double_ex(args[0]);
    arg1 = (double) Z_DVAL_PP(args[0]);
    /*@SWIG@*/;
  }
  {
    /*@SWIG:CONVERT_FLOAT_IN@*/
    convert_to_double_ex(args[1]);
    arg2 = (double) Z_DVAL_PP(args[1]);
    /*@SWIG@*/;
  }
  {
    /*@SWIG:CONVERT_FLOAT_IN@*/
    convert_to_double_ex(args[2]);
    arg3 = (double) Z_DVAL_PP(args[2]);
    /*@SWIG@*/;
  }
  {
    /*@SWIG:CONVERT_FLOAT_IN@*/
    convert_to_double_ex(args[3]);
    arg4 = (double) Z_DVAL_PP(args[3]);
    /*@SWIG@*/;
  }
  {
    /*@SWIG: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 (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      
#if PHP_MAJOR_VERSION-0 < 5
      if (code == SWIG_RuntimeError) {
        zend_error(E_WARNING, const_cast<char *>(msg.c_str()));
        /* FIXME: destructors don't have return_value to set. */
        // ZVAL_NULL(return_value);
        return;
      }
#endif
      
      XapianException(code, msg);
    }
  }
  {
    SWIG_SetPointerZval(return_value, (void *)result, SWIGTYPE_p_Xapian__BM25Weight, 1);
  }
  /* Wrap this return value */
  if (this_ptr) {
    /* NATIVE Constructor, use this_ptr */
    zval *_cPtr; MAKE_STD_ZVAL(_cPtr);
    *_cPtr = *return_value;
    INIT_ZVAL(*return_value);
    add_property_zval(this_ptr,"_cPtr",_cPtr);
  } else if (! this_ptr) {
    /* ALTERNATIVE Constructor, make an object wrapper */
    zval *obj, *_cPtr;
    MAKE_STD_ZVAL(obj);
    MAKE_STD_ZVAL(_cPtr);
    *_cPtr = *return_value;
    INIT_ZVAL(*return_value);
    object_init_ex(obj,ptr_ce_swig_XapianBM25Weight);
    add_property_zval(obj,"_cPtr",_cPtr);
    *return_value=*obj;
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_new_XapianBM25Weight__SWIG_1) {
  Xapian::BM25Weight *result = 0 ;
  
  SWIG_ResetError();
  /* NATIVE Constructor */
  if(ZEND_NUM_ARGS() != 0) {
    WRONG_PARAM_COUNT;
  }
  
  {
    try {
      result = (Xapian::BM25Weight *)new Xapian::BM25Weight();
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      
#if PHP_MAJOR_VERSION-0 < 5
      if (code == SWIG_RuntimeError) {
        zend_error(E_WARNING, const_cast<char *>(msg.c_str()));
        /* FIXME: destructors don't have return_value to set. */
        // ZVAL_NULL(return_value);
        return;
      }
#endif
      
      XapianException(code, msg);
    }
  }
  {
    SWIG_SetPointerZval(return_value, (void *)result, SWIGTYPE_p_Xapian__BM25Weight, 1);
  }
  /* Wrap this return value */
  if (this_ptr) {
    /* NATIVE Constructor, use this_ptr */
    zval *_cPtr; MAKE_STD_ZVAL(_cPtr);
    *_cPtr = *return_value;
    INIT_ZVAL(*return_value);
    add_property_zval(this_ptr,"_cPtr",_cPtr);
  } else if (! this_ptr) {
    /* ALTERNATIVE Constructor, make an object wrapper */
    zval *obj, *_cPtr;
    MAKE_STD_ZVAL(obj);
    MAKE_STD_ZVAL(_cPtr);
    *_cPtr = *return_value;
    INIT_ZVAL(*return_value);
    object_init_ex(obj,ptr_ce_swig_XapianBM25Weight);
    add_property_zval(obj,"_cPtr",_cPtr);
    *return_value=*obj;
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_new_XapianBM25Weight) {
  int argc;
  zval **argv[5];
  
  argc = ZEND_NUM_ARGS();
  zend_get_parameters_array_ex(argc,argv);
  if (argc == 0) {
    return _wrap_new_XapianBM25Weight__SWIG_1(INTERNAL_FUNCTION_PARAM_PASSTHRU);
  }
  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) {
              return _wrap_new_XapianBM25Weight__SWIG_0(INTERNAL_FUNCTION_PARAM_PASSTHRU);
            }
          }
        }
      }
    }
  }
  
  SWIG_ErrorCode() = E_ERROR;
  SWIG_ErrorMsg() = "No matching function for overloaded 'new_XapianBM25Weight'";
  zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_XapianBM25Weight_clone) {
  Xapian::BM25Weight *arg1 = (Xapian::BM25Weight *) 0 ;
  Xapian::BM25Weight *result = 0 ;
  
  SWIG_ResetError();
  /* This function uses a this_ptr*/
  if(ZEND_NUM_ARGS() != 0) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*&this_ptr, (void **) &arg1, SWIGTYPE_p_Xapian__BM25Weight, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of XapianBM25Weight_clone. Expected SWIGTYPE_p_Xapian__BM25Weight");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    try {
      result = (Xapian::BM25Weight *)((Xapian::BM25Weight const *)arg1)->clone();
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      
#if PHP_MAJOR_VERSION-0 < 5
      if (code == SWIG_RuntimeError) {
        zend_error(E_WARNING, const_cast<char *>(msg.c_str()));
        /* FIXME: destructors don't have return_value to set. */
        // ZVAL_NULL(return_value);
        return;
      }
#endif
      
      XapianException(code, msg);
    }
  }
  {
    SWIG_SetPointerZval(return_value, (void *)result, SWIGTYPE_p_Xapian__BM25Weight, 0);
  }
  /* Wrap this return value */
  {
    /* ALTERNATIVE Constructor, make an object wrapper */
    zval *obj, *_cPtr;
    MAKE_STD_ZVAL(obj);
    MAKE_STD_ZVAL(_cPtr);
    *_cPtr = *return_value;
    INIT_ZVAL(*return_value);
    object_init_ex(obj,ptr_ce_swig_XapianBM25Weight);
    add_property_zval(obj,"_cPtr",_cPtr);
    *return_value=*obj;
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),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_XapianBM25Weight(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 (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      
#if PHP_MAJOR_VERSION-0 < 5
      if (code == SWIG_RuntimeError) {
        zend_error(E_WARNING, const_cast<char *>(msg.c_str()));
        /* FIXME: destructors don't have return_value to set. */
        // ZVAL_NULL(return_value);
        return;
      }
#endif
      
      XapianException(code, msg);
    }
  }
}


ZEND_NAMED_FUNCTION(_wrap_XapianBM25Weight_name) {
  Xapian::BM25Weight *arg1 = (Xapian::BM25Weight *) 0 ;
  std::string result;
  
  SWIG_ResetError();
  /* This function uses a this_ptr*/
  if(ZEND_NUM_ARGS() != 0) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*&this_ptr, (void **) &arg1, SWIGTYPE_p_Xapian__BM25Weight, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of XapianBM25Weight_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 (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      
#if PHP_MAJOR_VERSION-0 < 5
      if (code == SWIG_RuntimeError) {
        zend_error(E_WARNING, const_cast<char *>(msg.c_str()));
        /* FIXME: destructors don't have return_value to set. */
        // ZVAL_NULL(return_value);
        return;
      }
#endif
      
      XapianException(code, msg);
    }
  }
  {
    ZVAL_STRINGL(return_value,const_cast<char*>((&result)->data()),(&result)->length(),1);
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_XapianBM25Weight_serialise) {
  Xapian::BM25Weight *arg1 = (Xapian::BM25Weight *) 0 ;
  std::string result;
  
  SWIG_ResetError();
  /* This function uses a this_ptr*/
  if(ZEND_NUM_ARGS() != 0) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*&this_ptr, (void **) &arg1, SWIGTYPE_p_Xapian__BM25Weight, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of XapianBM25Weight_serialise. Expected SWIGTYPE_p_Xapian__BM25Weight");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    try {
      result = ((Xapian::BM25Weight const *)arg1)->serialise();
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      
#if PHP_MAJOR_VERSION-0 < 5
      if (code == SWIG_RuntimeError) {
        zend_error(E_WARNING, const_cast<char *>(msg.c_str()));
        /* FIXME: destructors don't have return_value to set. */
        // ZVAL_NULL(return_value);
        return;
      }
#endif
      
      XapianException(code, msg);
    }
  }
  {
    ZVAL_STRINGL(return_value,const_cast<char*>((&result)->data()),(&result)->length(),1);
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_XapianBM25Weight_unserialise) {
  Xapian::BM25Weight *arg1 = (Xapian::BM25Weight *) 0 ;
  std::string *arg2 = 0 ;
  Xapian::BM25Weight *result = 0 ;
  std::string temp2 ;
  zval **args[1];
  
  SWIG_ResetError();
  /* This function uses a this_ptr*/
  if(ZEND_NUM_ARGS() != 1 || zend_get_parameters_array_ex(1, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*&this_ptr, (void **) &arg1, SWIGTYPE_p_Xapian__BM25Weight, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of XapianBM25Weight_unserialise. Expected SWIGTYPE_p_Xapian__BM25Weight");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    convert_to_string_ex(args[0]);
    temp2.assign(Z_STRVAL_PP(args[0]), Z_STRLEN_PP(args[0]));
    arg2 = &temp2;
  }
  {
    try {
      result = (Xapian::BM25Weight *)((Xapian::BM25Weight const *)arg1)->unserialise((std::string const &)*arg2);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      
#if PHP_MAJOR_VERSION-0 < 5
      if (code == SWIG_RuntimeError) {
        zend_error(E_WARNING, const_cast<char *>(msg.c_str()));
        /* FIXME: destructors don't have return_value to set. */
        // ZVAL_NULL(return_value);
        return;
      }
#endif
      
      XapianException(code, msg);
    }
  }
  {
    SWIG_SetPointerZval(return_value, (void *)result, SWIGTYPE_p_Xapian__BM25Weight, 0);
  }
  /* Wrap this return value */
  {
    /* ALTERNATIVE Constructor, make an object wrapper */
    zval *obj, *_cPtr;
    MAKE_STD_ZVAL(obj);
    MAKE_STD_ZVAL(_cPtr);
    *_cPtr = *return_value;
    INIT_ZVAL(*return_value);
    object_init_ex(obj,ptr_ce_swig_XapianBM25Weight);
    add_property_zval(obj,"_cPtr",_cPtr);
    *return_value=*obj;
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_XapianBM25Weight_get_sumpart) {
  Xapian::BM25Weight *arg1 = (Xapian::BM25Weight *) 0 ;
  Xapian::termcount arg2 ;
  Xapian::doclength arg3 ;
  Xapian::weight result;
  zval **args[2];
  
  SWIG_ResetError();
  /* This function uses a this_ptr*/
  if(ZEND_NUM_ARGS() != 2 || zend_get_parameters_array_ex(2, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*&this_ptr, (void **) &arg1, SWIGTYPE_p_Xapian__BM25Weight, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of XapianBM25Weight_get_sumpart. Expected SWIGTYPE_p_Xapian__BM25Weight");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    /*@SWIG:CONVERT_INT_IN@*/
    convert_to_long_ex(args[0]);
    arg2 = (Xapian::termcount) Z_LVAL_PP(args[0]);
    /*@SWIG@*/;
  }
  {
    /*@SWIG:CONVERT_FLOAT_IN@*/
    convert_to_double_ex(args[1]);
    arg3 = (Xapian::doclength) Z_DVAL_PP(args[1]);
    /*@SWIG@*/;
  }
  {
    try {
      result = (Xapian::weight)((Xapian::BM25Weight const *)arg1)->get_sumpart(arg2,arg3);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      
#if PHP_MAJOR_VERSION-0 < 5
      if (code == SWIG_RuntimeError) {
        zend_error(E_WARNING, const_cast<char *>(msg.c_str()));
        /* FIXME: destructors don't have return_value to set. */
        // ZVAL_NULL(return_value);
        return;
      }
#endif
      
      XapianException(code, msg);
    }
  }
  {
    ZVAL_DOUBLE(return_value,result);
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_XapianBM25Weight_get_maxpart) {
  Xapian::BM25Weight *arg1 = (Xapian::BM25Weight *) 0 ;
  Xapian::weight result;
  
  SWIG_ResetError();
  /* This function uses a this_ptr*/
  if(ZEND_NUM_ARGS() != 0) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*&this_ptr, (void **) &arg1, SWIGTYPE_p_Xapian__BM25Weight, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of XapianBM25Weight_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 (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      
#if PHP_MAJOR_VERSION-0 < 5
      if (code == SWIG_RuntimeError) {
        zend_error(E_WARNING, const_cast<char *>(msg.c_str()));
        /* FIXME: destructors don't have return_value to set. */
        // ZVAL_NULL(return_value);
        return;
      }
#endif
      
      XapianException(code, msg);
    }
  }
  {
    ZVAL_DOUBLE(return_value,result);
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_XapianBM25Weight_get_sumextra) {
  Xapian::BM25Weight *arg1 = (Xapian::BM25Weight *) 0 ;
  Xapian::doclength arg2 ;
  Xapian::weight result;
  zval **args[1];
  
  SWIG_ResetError();
  /* This function uses a this_ptr*/
  if(ZEND_NUM_ARGS() != 1 || zend_get_parameters_array_ex(1, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*&this_ptr, (void **) &arg1, SWIGTYPE_p_Xapian__BM25Weight, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of XapianBM25Weight_get_sumextra. Expected SWIGTYPE_p_Xapian__BM25Weight");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    /*@SWIG:CONVERT_FLOAT_IN@*/
    convert_to_double_ex(args[0]);
    arg2 = (Xapian::doclength) Z_DVAL_PP(args[0]);
    /*@SWIG@*/;
  }
  {
    try {
      result = (Xapian::weight)((Xapian::BM25Weight const *)arg1)->get_sumextra(arg2);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      
#if PHP_MAJOR_VERSION-0 < 5
      if (code == SWIG_RuntimeError) {
        zend_error(E_WARNING, const_cast<char *>(msg.c_str()));
        /* FIXME: destructors don't have return_value to set. */
        // ZVAL_NULL(return_value);
        return;
      }
#endif
      
      XapianException(code, msg);
    }
  }
  {
    ZVAL_DOUBLE(return_value,result);
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_XapianBM25Weight_get_maxextra) {
  Xapian::BM25Weight *arg1 = (Xapian::BM25Weight *) 0 ;
  Xapian::weight result;
  
  SWIG_ResetError();
  /* This function uses a this_ptr*/
  if(ZEND_NUM_ARGS() != 0) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*&this_ptr, (void **) &arg1, SWIGTYPE_p_Xapian__BM25Weight, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of XapianBM25Weight_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 (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      
#if PHP_MAJOR_VERSION-0 < 5
      if (code == SWIG_RuntimeError) {
        zend_error(E_WARNING, const_cast<char *>(msg.c_str()));
        /* FIXME: destructors don't have return_value to set. */
        // ZVAL_NULL(return_value);
        return;
      }
#endif
      
      XapianException(code, msg);
    }
  }
  {
    ZVAL_DOUBLE(return_value,result);
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_XapianBM25Weight_get_sumpart_needs_doclength) {
  Xapian::BM25Weight *arg1 = (Xapian::BM25Weight *) 0 ;
  bool result;
  
  SWIG_ResetError();
  /* This function uses a this_ptr*/
  if(ZEND_NUM_ARGS() != 0) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*&this_ptr, (void **) &arg1, SWIGTYPE_p_Xapian__BM25Weight, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of XapianBM25Weight_get_sumpart_needs_doclength. Expected SWIGTYPE_p_Xapian__BM25Weight");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    try {
      result = (bool)((Xapian::BM25Weight const *)arg1)->get_sumpart_needs_doclength();
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      
#if PHP_MAJOR_VERSION-0 < 5
      if (code == SWIG_RuntimeError) {
        zend_error(E_WARNING, const_cast<char *>(msg.c_str()));
        /* FIXME: destructors don't have return_value to set. */
        // ZVAL_NULL(return_value);
        return;
      }
#endif
      
      XapianException(code, msg);
    }
  }
  {
    ZVAL_BOOL(return_value,(result)?1:0);
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg());
}


/* property handler for class XapianBM25Weight */
static pval _wrap_propget_XapianBM25Weight(zend_property_reference *property_reference) {
  pval result;
  pval **_result;
  zend_llist_element *element = property_reference->elements_list->head;
  zend_overloaded_element *property=(zend_overloaded_element *)element->data;
  result.type = IS_NULL;
  if (_propget_XapianBM25Weight(property_reference, &result)==SUCCESS) return result;
  /* return it ourselves */
  if (zend_hash_find(Z_OBJPROP_P(property_reference->object),Z_STRVAL_P(&(property->element)),1+Z_STRLEN_P(&(property->element)),(void**)&_result)==SUCCESS) {
  zval *_value;
  MAKE_STD_ZVAL(_value);  *_value=**_result;
  INIT_PZVAL(_value);
  zval_copy_ctor(_value);
  return *_value;
  }
  result.type = IS_NULL;
  return result;
}
static int _propget_XapianBM25Weight(zend_property_reference *property_reference, pval *value) {
  /* No extra properties for subclass XapianBM25Weight */
  /* Try base class(es). */
  if (_propget_XapianWeight(property_reference, value)==SUCCESS) return SUCCESS;
  return FAILURE;
}

static int _wrap_propset_XapianBM25Weight(zend_property_reference *property_reference, pval *value) { 
  zval * _value;
  zend_llist_element *element = property_reference->elements_list->head;
  zend_overloaded_element *property=(zend_overloaded_element *)element->data;
  if (_propset_XapianBM25Weight(property_reference, value)==SUCCESS) return SUCCESS;
  /* set it ourselves as it is XapianBM25Weight */
  MAKE_STD_ZVAL(_value);
  *_value=*value;
  INIT_PZVAL(_value);
  zval_copy_ctor(_value);
  return add_property_zval_ex(property_reference->object,Z_STRVAL_P(&(property->element)),1+Z_STRLEN_P(&(property->element)),_value);
}
static int _propset_XapianBM25Weight(zend_property_reference *property_reference, pval *value) {
  /* No extra properties for subclass XapianBM25Weight */
  /* Try base class(es) */
  if (_propset_XapianWeight(property_reference, value)==SUCCESS) return SUCCESS;
  return FAILURE;
}

ZEND_NAMED_FUNCTION(_wrap_new_XapianTradWeight__SWIG_0) {
  double arg1 ;
  Xapian::TradWeight *result = 0 ;
  zval **args[1];
  
  SWIG_ResetError();
  /* NATIVE Constructor */
  if(ZEND_NUM_ARGS() != 1 || zend_get_parameters_array_ex(1, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    /*@SWIG: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 (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      
#if PHP_MAJOR_VERSION-0 < 5
      if (code == SWIG_RuntimeError) {
        zend_error(E_WARNING, const_cast<char *>(msg.c_str()));
        /* FIXME: destructors don't have return_value to set. */
        // ZVAL_NULL(return_value);
        return;
      }
#endif
      
      XapianException(code, msg);
    }
  }
  {
    SWIG_SetPointerZval(return_value, (void *)result, SWIGTYPE_p_Xapian__TradWeight, 1);
  }
  /* Wrap this return value */
  if (this_ptr) {
    /* NATIVE Constructor, use this_ptr */
    zval *_cPtr; MAKE_STD_ZVAL(_cPtr);
    *_cPtr = *return_value;
    INIT_ZVAL(*return_value);
    add_property_zval(this_ptr,"_cPtr",_cPtr);
  } else if (! this_ptr) {
    /* ALTERNATIVE Constructor, make an object wrapper */
    zval *obj, *_cPtr;
    MAKE_STD_ZVAL(obj);
    MAKE_STD_ZVAL(_cPtr);
    *_cPtr = *return_value;
    INIT_ZVAL(*return_value);
    object_init_ex(obj,ptr_ce_swig_XapianTradWeight);
    add_property_zval(obj,"_cPtr",_cPtr);
    *return_value=*obj;
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_new_XapianTradWeight__SWIG_1) {
  Xapian::TradWeight *result = 0 ;
  
  SWIG_ResetError();
  /* NATIVE Constructor */
  if(ZEND_NUM_ARGS() != 0) {
    WRONG_PARAM_COUNT;
  }
  
  {
    try {
      result = (Xapian::TradWeight *)new Xapian::TradWeight();
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      
#if PHP_MAJOR_VERSION-0 < 5
      if (code == SWIG_RuntimeError) {
        zend_error(E_WARNING, const_cast<char *>(msg.c_str()));
        /* FIXME: destructors don't have return_value to set. */
        // ZVAL_NULL(return_value);
        return;
      }
#endif
      
      XapianException(code, msg);
    }
  }
  {
    SWIG_SetPointerZval(return_value, (void *)result, SWIGTYPE_p_Xapian__TradWeight, 1);
  }
  /* Wrap this return value */
  if (this_ptr) {
    /* NATIVE Constructor, use this_ptr */
    zval *_cPtr; MAKE_STD_ZVAL(_cPtr);
    *_cPtr = *return_value;
    INIT_ZVAL(*return_value);
    add_property_zval(this_ptr,"_cPtr",_cPtr);
  } else if (! this_ptr) {
    /* ALTERNATIVE Constructor, make an object wrapper */
    zval *obj, *_cPtr;
    MAKE_STD_ZVAL(obj);
    MAKE_STD_ZVAL(_cPtr);
    *_cPtr = *return_value;
    INIT_ZVAL(*return_value);
    object_init_ex(obj,ptr_ce_swig_XapianTradWeight);
    add_property_zval(obj,"_cPtr",_cPtr);
    *return_value=*obj;
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_new_XapianTradWeight) {
  int argc;
  zval **argv[1];
  
  argc = ZEND_NUM_ARGS();
  zend_get_parameters_array_ex(argc,argv);
  if (argc == 0) {
    return _wrap_new_XapianTradWeight__SWIG_1(INTERNAL_FUNCTION_PARAM_PASSTHRU);
  }
  if (argc == 1) {
    int _v;
    _v = (Z_TYPE_PP(argv[0]) == IS_DOUBLE); 
    if (_v) {
      return _wrap_new_XapianTradWeight__SWIG_0(INTERNAL_FUNCTION_PARAM_PASSTHRU);
    }
  }
  
  SWIG_ErrorCode() = E_ERROR;
  SWIG_ErrorMsg() = "No matching function for overloaded 'new_XapianTradWeight'";
  zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_XapianTradWeight_clone) {
  Xapian::TradWeight *arg1 = (Xapian::TradWeight *) 0 ;
  Xapian::TradWeight *result = 0 ;
  
  SWIG_ResetError();
  /* This function uses a this_ptr*/
  if(ZEND_NUM_ARGS() != 0) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*&this_ptr, (void **) &arg1, SWIGTYPE_p_Xapian__TradWeight, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of XapianTradWeight_clone. Expected SWIGTYPE_p_Xapian__TradWeight");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    try {
      result = (Xapian::TradWeight *)((Xapian::TradWeight const *)arg1)->clone();
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      
#if PHP_MAJOR_VERSION-0 < 5
      if (code == SWIG_RuntimeError) {
        zend_error(E_WARNING, const_cast<char *>(msg.c_str()));
        /* FIXME: destructors don't have return_value to set. */
        // ZVAL_NULL(return_value);
        return;
      }
#endif
      
      XapianException(code, msg);
    }
  }
  {
    SWIG_SetPointerZval(return_value, (void *)result, SWIGTYPE_p_Xapian__TradWeight, 0);
  }
  /* Wrap this return value */
  {
    /* ALTERNATIVE Constructor, make an object wrapper */
    zval *obj, *_cPtr;
    MAKE_STD_ZVAL(obj);
    MAKE_STD_ZVAL(_cPtr);
    *_cPtr = *return_value;
    INIT_ZVAL(*return_value);
    object_init_ex(obj,ptr_ce_swig_XapianTradWeight);
    add_property_zval(obj,"_cPtr",_cPtr);
    *return_value=*obj;
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),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_XapianTradWeight(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 (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      
#if PHP_MAJOR_VERSION-0 < 5
      if (code == SWIG_RuntimeError) {
        zend_error(E_WARNING, const_cast<char *>(msg.c_str()));
        /* FIXME: destructors don't have return_value to set. */
        // ZVAL_NULL(return_value);
        return;
      }
#endif
      
      XapianException(code, msg);
    }
  }
}


ZEND_NAMED_FUNCTION(_wrap_XapianTradWeight_name) {
  Xapian::TradWeight *arg1 = (Xapian::TradWeight *) 0 ;
  std::string result;
  
  SWIG_ResetError();
  /* This function uses a this_ptr*/
  if(ZEND_NUM_ARGS() != 0) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*&this_ptr, (void **) &arg1, SWIGTYPE_p_Xapian__TradWeight, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of XapianTradWeight_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 (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      
#if PHP_MAJOR_VERSION-0 < 5
      if (code == SWIG_RuntimeError) {
        zend_error(E_WARNING, const_cast<char *>(msg.c_str()));
        /* FIXME: destructors don't have return_value to set. */
        // ZVAL_NULL(return_value);
        return;
      }
#endif
      
      XapianException(code, msg);
    }
  }
  {
    ZVAL_STRINGL(return_value,const_cast<char*>((&result)->data()),(&result)->length(),1);
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_XapianTradWeight_serialise) {
  Xapian::TradWeight *arg1 = (Xapian::TradWeight *) 0 ;
  std::string result;
  
  SWIG_ResetError();
  /* This function uses a this_ptr*/
  if(ZEND_NUM_ARGS() != 0) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*&this_ptr, (void **) &arg1, SWIGTYPE_p_Xapian__TradWeight, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of XapianTradWeight_serialise. Expected SWIGTYPE_p_Xapian__TradWeight");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    try {
      result = ((Xapian::TradWeight const *)arg1)->serialise();
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      
#if PHP_MAJOR_VERSION-0 < 5
      if (code == SWIG_RuntimeError) {
        zend_error(E_WARNING, const_cast<char *>(msg.c_str()));
        /* FIXME: destructors don't have return_value to set. */
        // ZVAL_NULL(return_value);
        return;
      }
#endif
      
      XapianException(code, msg);
    }
  }
  {
    ZVAL_STRINGL(return_value,const_cast<char*>((&result)->data()),(&result)->length(),1);
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_XapianTradWeight_unserialise) {
  Xapian::TradWeight *arg1 = (Xapian::TradWeight *) 0 ;
  std::string *arg2 = 0 ;
  Xapian::TradWeight *result = 0 ;
  std::string temp2 ;
  zval **args[1];
  
  SWIG_ResetError();
  /* This function uses a this_ptr*/
  if(ZEND_NUM_ARGS() != 1 || zend_get_parameters_array_ex(1, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*&this_ptr, (void **) &arg1, SWIGTYPE_p_Xapian__TradWeight, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of XapianTradWeight_unserialise. Expected SWIGTYPE_p_Xapian__TradWeight");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    convert_to_string_ex(args[0]);
    temp2.assign(Z_STRVAL_PP(args[0]), Z_STRLEN_PP(args[0]));
    arg2 = &temp2;
  }
  {
    try {
      result = (Xapian::TradWeight *)((Xapian::TradWeight const *)arg1)->unserialise((std::string const &)*arg2);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      
#if PHP_MAJOR_VERSION-0 < 5
      if (code == SWIG_RuntimeError) {
        zend_error(E_WARNING, const_cast<char *>(msg.c_str()));
        /* FIXME: destructors don't have return_value to set. */
        // ZVAL_NULL(return_value);
        return;
      }
#endif
      
      XapianException(code, msg);
    }
  }
  {
    SWIG_SetPointerZval(return_value, (void *)result, SWIGTYPE_p_Xapian__TradWeight, 0);
  }
  /* Wrap this return value */
  {
    /* ALTERNATIVE Constructor, make an object wrapper */
    zval *obj, *_cPtr;
    MAKE_STD_ZVAL(obj);
    MAKE_STD_ZVAL(_cPtr);
    *_cPtr = *return_value;
    INIT_ZVAL(*return_value);
    object_init_ex(obj,ptr_ce_swig_XapianTradWeight);
    add_property_zval(obj,"_cPtr",_cPtr);
    *return_value=*obj;
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_XapianTradWeight_get_sumpart) {
  Xapian::TradWeight *arg1 = (Xapian::TradWeight *) 0 ;
  Xapian::termcount arg2 ;
  Xapian::doclength arg3 ;
  Xapian::weight result;
  zval **args[2];
  
  SWIG_ResetError();
  /* This function uses a this_ptr*/
  if(ZEND_NUM_ARGS() != 2 || zend_get_parameters_array_ex(2, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*&this_ptr, (void **) &arg1, SWIGTYPE_p_Xapian__TradWeight, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of XapianTradWeight_get_sumpart. Expected SWIGTYPE_p_Xapian__TradWeight");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    /*@SWIG:CONVERT_INT_IN@*/
    convert_to_long_ex(args[0]);
    arg2 = (Xapian::termcount) Z_LVAL_PP(args[0]);
    /*@SWIG@*/;
  }
  {
    /*@SWIG:CONVERT_FLOAT_IN@*/
    convert_to_double_ex(args[1]);
    arg3 = (Xapian::doclength) Z_DVAL_PP(args[1]);
    /*@SWIG@*/;
  }
  {
    try {
      result = (Xapian::weight)((Xapian::TradWeight const *)arg1)->get_sumpart(arg2,arg3);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      
#if PHP_MAJOR_VERSION-0 < 5
      if (code == SWIG_RuntimeError) {
        zend_error(E_WARNING, const_cast<char *>(msg.c_str()));
        /* FIXME: destructors don't have return_value to set. */
        // ZVAL_NULL(return_value);
        return;
      }
#endif
      
      XapianException(code, msg);
    }
  }
  {
    ZVAL_DOUBLE(return_value,result);
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_XapianTradWeight_get_maxpart) {
  Xapian::TradWeight *arg1 = (Xapian::TradWeight *) 0 ;
  Xapian::weight result;
  
  SWIG_ResetError();
  /* This function uses a this_ptr*/
  if(ZEND_NUM_ARGS() != 0) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*&this_ptr, (void **) &arg1, SWIGTYPE_p_Xapian__TradWeight, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of XapianTradWeight_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 (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      
#if PHP_MAJOR_VERSION-0 < 5
      if (code == SWIG_RuntimeError) {
        zend_error(E_WARNING, const_cast<char *>(msg.c_str()));
        /* FIXME: destructors don't have return_value to set. */
        // ZVAL_NULL(return_value);
        return;
      }
#endif
      
      XapianException(code, msg);
    }
  }
  {
    ZVAL_DOUBLE(return_value,result);
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_XapianTradWeight_get_sumextra) {
  Xapian::TradWeight *arg1 = (Xapian::TradWeight *) 0 ;
  Xapian::doclength arg2 ;
  Xapian::weight result;
  zval **args[1];
  
  SWIG_ResetError();
  /* This function uses a this_ptr*/
  if(ZEND_NUM_ARGS() != 1 || zend_get_parameters_array_ex(1, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*&this_ptr, (void **) &arg1, SWIGTYPE_p_Xapian__TradWeight, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of XapianTradWeight_get_sumextra. Expected SWIGTYPE_p_Xapian__TradWeight");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    /*@SWIG:CONVERT_FLOAT_IN@*/
    convert_to_double_ex(args[0]);
    arg2 = (Xapian::doclength) Z_DVAL_PP(args[0]);
    /*@SWIG@*/;
  }
  {
    try {
      result = (Xapian::weight)((Xapian::TradWeight const *)arg1)->get_sumextra(arg2);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      
#if PHP_MAJOR_VERSION-0 < 5
      if (code == SWIG_RuntimeError) {
        zend_error(E_WARNING, const_cast<char *>(msg.c_str()));
        /* FIXME: destructors don't have return_value to set. */
        // ZVAL_NULL(return_value);
        return;
      }
#endif
      
      XapianException(code, msg);
    }
  }
  {
    ZVAL_DOUBLE(return_value,result);
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_XapianTradWeight_get_maxextra) {
  Xapian::TradWeight *arg1 = (Xapian::TradWeight *) 0 ;
  Xapian::weight result;
  
  SWIG_ResetError();
  /* This function uses a this_ptr*/
  if(ZEND_NUM_ARGS() != 0) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*&this_ptr, (void **) &arg1, SWIGTYPE_p_Xapian__TradWeight, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of XapianTradWeight_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 (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      
#if PHP_MAJOR_VERSION-0 < 5
      if (code == SWIG_RuntimeError) {
        zend_error(E_WARNING, const_cast<char *>(msg.c_str()));
        /* FIXME: destructors don't have return_value to set. */
        // ZVAL_NULL(return_value);
        return;
      }
#endif
      
      XapianException(code, msg);
    }
  }
  {
    ZVAL_DOUBLE(return_value,result);
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_XapianTradWeight_get_sumpart_needs_doclength) {
  Xapian::TradWeight *arg1 = (Xapian::TradWeight *) 0 ;
  bool result;
  
  SWIG_ResetError();
  /* This function uses a this_ptr*/
  if(ZEND_NUM_ARGS() != 0) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*&this_ptr, (void **) &arg1, SWIGTYPE_p_Xapian__TradWeight, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of XapianTradWeight_get_sumpart_needs_doclength. Expected SWIGTYPE_p_Xapian__TradWeight");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    try {
      result = (bool)((Xapian::TradWeight const *)arg1)->get_sumpart_needs_doclength();
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      
#if PHP_MAJOR_VERSION-0 < 5
      if (code == SWIG_RuntimeError) {
        zend_error(E_WARNING, const_cast<char *>(msg.c_str()));
        /* FIXME: destructors don't have return_value to set. */
        // ZVAL_NULL(return_value);
        return;
      }
#endif
      
      XapianException(code, msg);
    }
  }
  {
    ZVAL_BOOL(return_value,(result)?1:0);
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg());
}


/* property handler for class XapianTradWeight */
static pval _wrap_propget_XapianTradWeight(zend_property_reference *property_reference) {
  pval result;
  pval **_result;
  zend_llist_element *element = property_reference->elements_list->head;
  zend_overloaded_element *property=(zend_overloaded_element *)element->data;
  result.type = IS_NULL;
  if (_propget_XapianTradWeight(property_reference, &result)==SUCCESS) return result;
  /* return it ourselves */
  if (zend_hash_find(Z_OBJPROP_P(property_reference->object),Z_STRVAL_P(&(property->element)),1+Z_STRLEN_P(&(property->element)),(void**)&_result)==SUCCESS) {
  zval *_value;
  MAKE_STD_ZVAL(_value);  *_value=**_result;
  INIT_PZVAL(_value);
  zval_copy_ctor(_value);
  return *_value;
  }
  result.type = IS_NULL;
  return result;
}
static int _propget_XapianTradWeight(zend_property_reference *property_reference, pval *value) {
  /* No extra properties for subclass XapianTradWeight */
  /* Try base class(es). */
  if (_propget_XapianWeight(property_reference, value)==SUCCESS) return SUCCESS;
  return FAILURE;
}

static int _wrap_propset_XapianTradWeight(zend_property_reference *property_reference, pval *value) { 
  zval * _value;
  zend_llist_element *element = property_reference->elements_list->head;
  zend_overloaded_element *property=(zend_overloaded_element *)element->data;
  if (_propset_XapianTradWeight(property_reference, value)==SUCCESS) return SUCCESS;
  /* set it ourselves as it is XapianTradWeight */
  MAKE_STD_ZVAL(_value);
  *_value=*value;
  INIT_PZVAL(_value);
  zval_copy_ctor(_value);
  return add_property_zval_ex(property_reference->object,Z_STRVAL_P(&(property->element)),1+Z_STRLEN_P(&(property->element)),_value);
}
static int _propset_XapianTradWeight(zend_property_reference *property_reference, pval *value) {
  /* No extra properties for subclass XapianTradWeight */
  /* Try base class(es) */
  if (_propset_XapianWeight(property_reference, value)==SUCCESS) return SUCCESS;
  return FAILURE;
}

ZEND_NAMED_FUNCTION(_wrap_XapianDatabase_add_database) {
  Xapian::Database *arg1 = (Xapian::Database *) 0 ;
  Xapian::Database *arg2 = 0 ;
  zval **args[1];
  
  SWIG_ResetError();
  /* This function uses a this_ptr*/
  if(ZEND_NUM_ARGS() != 1 || zend_get_parameters_array_ex(1, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*&this_ptr, (void **) &arg1, SWIGTYPE_p_Xapian__Database, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of XapianDatabase_add_database. Expected SWIGTYPE_p_Xapian__Database");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    if (SWIG_ConvertPtr(*args[0], (void**)&arg2, SWIGTYPE_p_Xapian__Database, 0) < 0 || arg2 == NULL) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 2 of XapianDatabase_add_database. Expected SWIGTYPE_p_Xapian__Database");
    }
  }
  {
    try {
      (arg1)->add_database((Xapian::Database const &)*arg2);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      
#if PHP_MAJOR_VERSION-0 < 5
      if (code == SWIG_RuntimeError) {
        zend_error(E_WARNING, const_cast<char *>(msg.c_str()));
        /* FIXME: destructors don't have return_value to set. */
        // ZVAL_NULL(return_value);
        return;
      }
#endif
      
      XapianException(code, msg);
    }
  }
  
  return;
fail:
  zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_new_XapianDatabase__SWIG_0) {
  Xapian::Database *result = 0 ;
  
  SWIG_ResetError();
  /* NATIVE Constructor */
  if(ZEND_NUM_ARGS() != 0) {
    WRONG_PARAM_COUNT;
  }
  
  {
    try {
      result = (Xapian::Database *)new Xapian::Database();
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      
#if PHP_MAJOR_VERSION-0 < 5
      if (code == SWIG_RuntimeError) {
        zend_error(E_WARNING, const_cast<char *>(msg.c_str()));
        /* FIXME: destructors don't have return_value to set. */
        // ZVAL_NULL(return_value);
        return;
      }
#endif
      
      XapianException(code, msg);
    }
  }
  {
    SWIG_SetPointerZval(return_value, (void *)result, SWIGTYPE_p_Xapian__Database, 1);
  }
  /* Wrap this return value */
  if (this_ptr) {
    /* NATIVE Constructor, use this_ptr */
    zval *_cPtr; MAKE_STD_ZVAL(_cPtr);
    *_cPtr = *return_value;
    INIT_ZVAL(*return_value);
    add_property_zval(this_ptr,"_cPtr",_cPtr);
  } else if (! this_ptr) {
    /* ALTERNATIVE Constructor, make an object wrapper */
    zval *obj, *_cPtr;
    MAKE_STD_ZVAL(obj);
    MAKE_STD_ZVAL(_cPtr);
    *_cPtr = *return_value;
    INIT_ZVAL(*return_value);
    object_init_ex(obj,ptr_ce_swig_XapianDatabase);
    add_property_zval(obj,"_cPtr",_cPtr);
    *return_value=*obj;
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_new_XapianDatabase__SWIG_1) {
  std::string *arg1 = 0 ;
  Xapian::Database *result = 0 ;
  std::string temp1 ;
  zval **args[1];
  
  SWIG_ResetError();
  /* NATIVE Constructor */
  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 (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      
#if PHP_MAJOR_VERSION-0 < 5
      if (code == SWIG_RuntimeError) {
        zend_error(E_WARNING, const_cast<char *>(msg.c_str()));
        /* FIXME: destructors don't have return_value to set. */
        // ZVAL_NULL(return_value);
        return;
      }
#endif
      
      XapianException(code, msg);
    }
  }
  {
    SWIG_SetPointerZval(return_value, (void *)result, SWIGTYPE_p_Xapian__Database, 1);
  }
  /* Wrap this return value */
  if (this_ptr) {
    /* NATIVE Constructor, use this_ptr */
    zval *_cPtr; MAKE_STD_ZVAL(_cPtr);
    *_cPtr = *return_value;
    INIT_ZVAL(*return_value);
    add_property_zval(this_ptr,"_cPtr",_cPtr);
  } else if (! this_ptr) {
    /* ALTERNATIVE Constructor, make an object wrapper */
    zval *obj, *_cPtr;
    MAKE_STD_ZVAL(obj);
    MAKE_STD_ZVAL(_cPtr);
    *_cPtr = *return_value;
    INIT_ZVAL(*return_value);
    object_init_ex(obj,ptr_ce_swig_XapianDatabase);
    add_property_zval(obj,"_cPtr",_cPtr);
    *return_value=*obj;
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),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_XapianDatabase(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 (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      
#if PHP_MAJOR_VERSION-0 < 5
      if (code == SWIG_RuntimeError) {
        zend_error(E_WARNING, const_cast<char *>(msg.c_str()));
        /* FIXME: destructors don't have return_value to set. */
        // ZVAL_NULL(return_value);
        return;
      }
#endif
      
      XapianException(code, msg);
    }
  }
}


ZEND_NAMED_FUNCTION(_wrap_new_XapianDatabase__SWIG_2) {
  Xapian::Database *arg1 = 0 ;
  Xapian::Database *result = 0 ;
  zval **args[1];
  
  SWIG_ResetError();
  /* NATIVE Constructor */
  if(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_XapianDatabase. Expected SWIGTYPE_p_Xapian__Database");
    }
  }
  {
    try {
      result = (Xapian::Database *)new Xapian::Database((Xapian::Database const &)*arg1);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      
#if PHP_MAJOR_VERSION-0 < 5
      if (code == SWIG_RuntimeError) {
        zend_error(E_WARNING, const_cast<char *>(msg.c_str()));
        /* FIXME: destructors don't have return_value to set. */
        // ZVAL_NULL(return_value);
        return;
      }
#endif
      
      XapianException(code, msg);
    }
  }
  {
    SWIG_SetPointerZval(return_value, (void *)result, SWIGTYPE_p_Xapian__Database, 1);
  }
  /* Wrap this return value */
  if (this_ptr) {
    /* NATIVE Constructor, use this_ptr */
    zval *_cPtr; MAKE_STD_ZVAL(_cPtr);
    *_cPtr = *return_value;
    INIT_ZVAL(*return_value);
    add_property_zval(this_ptr,"_cPtr",_cPtr);
  } else if (! this_ptr) {
    /* ALTERNATIVE Constructor, make an object wrapper */
    zval *obj, *_cPtr;
    MAKE_STD_ZVAL(obj);
    MAKE_STD_ZVAL(_cPtr);
    *_cPtr = *return_value;
    INIT_ZVAL(*return_value);
    object_init_ex(obj,ptr_ce_swig_XapianDatabase);
    add_property_zval(obj,"_cPtr",_cPtr);
    *return_value=*obj;
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_new_XapianDatabase) {
  int argc;
  zval **argv[1];
  
  argc = ZEND_NUM_ARGS();
  zend_get_parameters_array_ex(argc,argv);
  if (argc == 0) {
    return _wrap_new_XapianDatabase__SWIG_0(INTERNAL_FUNCTION_PARAM_PASSTHRU);
  }
  if (argc == 1) {
    int _v;
    {
      void *ptr;
      _v = (SWIG_ConvertPtr(*argv[0], (void **)&ptr, SWIGTYPE_p_Xapian__Database, 0) == 0);
    }
    if (_v) {
      return _wrap_new_XapianDatabase__SWIG_2(INTERNAL_FUNCTION_PARAM_PASSTHRU);
    }
  }
  if (argc == 1) {
    int _v;
    {
      _v = (Z_TYPE_PP(argv[0]) == IS_STRING);
    }
    if (_v) {
      return _wrap_new_XapianDatabase__SWIG_1(INTERNAL_FUNCTION_PARAM_PASSTHRU);
    }
  }
  
  SWIG_ErrorCode() = E_ERROR;
  SWIG_ErrorMsg() = "No matching function for overloaded 'new_XapianDatabase'";
  zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_XapianDatabase_reopen) {
  Xapian::Database *arg1 = (Xapian::Database *) 0 ;
  
  SWIG_ResetError();
  /* This function uses a this_ptr*/
  if(ZEND_NUM_ARGS() != 0) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*&this_ptr, (void **) &arg1, SWIGTYPE_p_Xapian__Database, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of XapianDatabase_reopen. Expected SWIGTYPE_p_Xapian__Database");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    try {
      (arg1)->reopen();
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      
#if PHP_MAJOR_VERSION-0 < 5
      if (code == SWIG_RuntimeError) {
        zend_error(E_WARNING, const_cast<char *>(msg.c_str()));
        /* FIXME: destructors don't have return_value to set. */
        // ZVAL_NULL(return_value);
        return;
      }
#endif
      
      XapianException(code, msg);
    }
  }
  
  return;
fail:
  zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_XapianDatabase_get_description) {
  Xapian::Database *arg1 = (Xapian::Database *) 0 ;
  std::string result;
  
  SWIG_ResetError();
  /* This function uses a this_ptr*/
  if(ZEND_NUM_ARGS() != 0) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*&this_ptr, (void **) &arg1, SWIGTYPE_p_Xapian__Database, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of XapianDatabase_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 (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      
#if PHP_MAJOR_VERSION-0 < 5
      if (code == SWIG_RuntimeError) {
        zend_error(E_WARNING, const_cast<char *>(msg.c_str()));
        /* FIXME: destructors don't have return_value to set. */
        // ZVAL_NULL(return_value);
        return;
      }
#endif
      
      XapianException(code, msg);
    }
  }
  {
    ZVAL_STRINGL(return_value,const_cast<char*>((&result)->data()),(&result)->length(),1);
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_XapianDatabase_postlist_begin) {
  Xapian::Database *arg1 = (Xapian::Database *) 0 ;
  std::string *arg2 = 0 ;
  Xapian::PostingIterator result;
  std::string temp2 ;
  zval **args[1];
  
  SWIG_ResetError();
  /* This function uses a this_ptr*/
  if(ZEND_NUM_ARGS() != 1 || zend_get_parameters_array_ex(1, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*&this_ptr, (void **) &arg1, SWIGTYPE_p_Xapian__Database, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of XapianDatabase_postlist_begin. Expected SWIGTYPE_p_Xapian__Database");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    convert_to_string_ex(args[0]);
    temp2.assign(Z_STRVAL_PP(args[0]), Z_STRLEN_PP(args[0]));
    arg2 = &temp2;
  }
  {
    try {
      result = ((Xapian::Database const *)arg1)->postlist_begin((std::string const &)*arg2);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      
#if PHP_MAJOR_VERSION-0 < 5
      if (code == SWIG_RuntimeError) {
        zend_error(E_WARNING, const_cast<char *>(msg.c_str()));
        /* FIXME: destructors don't have return_value to set. */
        // ZVAL_NULL(return_value);
        return;
      }
#endif
      
      XapianException(code, msg);
    }
  }
  {
    Xapian::PostingIterator * resultobj = new Xapian::PostingIterator((Xapian::PostingIterator &) result);
    SWIG_SetPointerZval(return_value, (void *)resultobj, SWIGTYPE_p_Xapian__PostingIterator, 1);
  }
  /* Wrap this return value */
  {
    /* ALTERNATIVE Constructor, make an object wrapper */
    zval *obj, *_cPtr;
    MAKE_STD_ZVAL(obj);
    MAKE_STD_ZVAL(_cPtr);
    *_cPtr = *return_value;
    INIT_ZVAL(*return_value);
    object_init_ex(obj,ptr_ce_swig_XapianPostingIterator);
    add_property_zval(obj,"_cPtr",_cPtr);
    *return_value=*obj;
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_XapianDatabase_postlist_end) {
  Xapian::Database *arg1 = (Xapian::Database *) 0 ;
  std::string *arg2 = 0 ;
  Xapian::PostingIterator result;
  std::string temp2 ;
  zval **args[1];
  
  SWIG_ResetError();
  /* This function uses a this_ptr*/
  if(ZEND_NUM_ARGS() != 1 || zend_get_parameters_array_ex(1, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*&this_ptr, (void **) &arg1, SWIGTYPE_p_Xapian__Database, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of XapianDatabase_postlist_end. Expected SWIGTYPE_p_Xapian__Database");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    convert_to_string_ex(args[0]);
    temp2.assign(Z_STRVAL_PP(args[0]), Z_STRLEN_PP(args[0]));
    arg2 = &temp2;
  }
  {
    try {
      result = ((Xapian::Database const *)arg1)->postlist_end((std::string const &)*arg2);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      
#if PHP_MAJOR_VERSION-0 < 5
      if (code == SWIG_RuntimeError) {
        zend_error(E_WARNING, const_cast<char *>(msg.c_str()));
        /* FIXME: destructors don't have return_value to set. */
        // ZVAL_NULL(return_value);
        return;
      }
#endif
      
      XapianException(code, msg);
    }
  }
  {
    Xapian::PostingIterator * resultobj = new Xapian::PostingIterator((Xapian::PostingIterator &) result);
    SWIG_SetPointerZval(return_value, (void *)resultobj, SWIGTYPE_p_Xapian__PostingIterator, 1);
  }
  /* Wrap this return value */
  {
    /* ALTERNATIVE Constructor, make an object wrapper */
    zval *obj, *_cPtr;
    MAKE_STD_ZVAL(obj);
    MAKE_STD_ZVAL(_cPtr);
    *_cPtr = *return_value;
    INIT_ZVAL(*return_value);
    object_init_ex(obj,ptr_ce_swig_XapianPostingIterator);
    add_property_zval(obj,"_cPtr",_cPtr);
    *return_value=*obj;
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_XapianDatabase_termlist_begin) {
  Xapian::Database *arg1 = (Xapian::Database *) 0 ;
  Xapian::docid arg2 ;
  Xapian::TermIterator result;
  zval **args[1];
  
  SWIG_ResetError();
  /* This function uses a this_ptr*/
  if(ZEND_NUM_ARGS() != 1 || zend_get_parameters_array_ex(1, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*&this_ptr, (void **) &arg1, SWIGTYPE_p_Xapian__Database, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of XapianDatabase_termlist_begin. Expected SWIGTYPE_p_Xapian__Database");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    /*@SWIG:CONVERT_INT_IN@*/
    convert_to_long_ex(args[0]);
    arg2 = (Xapian::docid) Z_LVAL_PP(args[0]);
    /*@SWIG@*/;
  }
  {
    try {
      result = ((Xapian::Database const *)arg1)->termlist_begin(arg2);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      
#if PHP_MAJOR_VERSION-0 < 5
      if (code == SWIG_RuntimeError) {
        zend_error(E_WARNING, const_cast<char *>(msg.c_str()));
        /* FIXME: destructors don't have return_value to set. */
        // ZVAL_NULL(return_value);
        return;
      }
#endif
      
      XapianException(code, msg);
    }
  }
  {
    Xapian::TermIterator * resultobj = new Xapian::TermIterator((Xapian::TermIterator &) result);
    SWIG_SetPointerZval(return_value, (void *)resultobj, SWIGTYPE_p_Xapian__TermIterator, 1);
  }
  /* Wrap this return value */
  {
    /* ALTERNATIVE Constructor, make an object wrapper */
    zval *obj, *_cPtr;
    MAKE_STD_ZVAL(obj);
    MAKE_STD_ZVAL(_cPtr);
    *_cPtr = *return_value;
    INIT_ZVAL(*return_value);
    object_init_ex(obj,ptr_ce_swig_XapianTermIterator);
    add_property_zval(obj,"_cPtr",_cPtr);
    *return_value=*obj;
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_XapianDatabase_termlist_end) {
  Xapian::Database *arg1 = (Xapian::Database *) 0 ;
  Xapian::docid arg2 ;
  Xapian::TermIterator result;
  zval **args[1];
  
  SWIG_ResetError();
  /* This function uses a this_ptr*/
  if(ZEND_NUM_ARGS() != 1 || zend_get_parameters_array_ex(1, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*&this_ptr, (void **) &arg1, SWIGTYPE_p_Xapian__Database, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of XapianDatabase_termlist_end. Expected SWIGTYPE_p_Xapian__Database");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    /*@SWIG:CONVERT_INT_IN@*/
    convert_to_long_ex(args[0]);
    arg2 = (Xapian::docid) Z_LVAL_PP(args[0]);
    /*@SWIG@*/;
  }
  {
    try {
      result = ((Xapian::Database const *)arg1)->termlist_end(arg2);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      
#if PHP_MAJOR_VERSION-0 < 5
      if (code == SWIG_RuntimeError) {
        zend_error(E_WARNING, const_cast<char *>(msg.c_str()));
        /* FIXME: destructors don't have return_value to set. */
        // ZVAL_NULL(return_value);
        return;
      }
#endif
      
      XapianException(code, msg);
    }
  }
  {
    Xapian::TermIterator * resultobj = new Xapian::TermIterator((Xapian::TermIterator &) result);
    SWIG_SetPointerZval(return_value, (void *)resultobj, SWIGTYPE_p_Xapian__TermIterator, 1);
  }
  /* Wrap this return value */
  {
    /* ALTERNATIVE Constructor, make an object wrapper */
    zval *obj, *_cPtr;
    MAKE_STD_ZVAL(obj);
    MAKE_STD_ZVAL(_cPtr);
    *_cPtr = *return_value;
    INIT_ZVAL(*return_value);
    object_init_ex(obj,ptr_ce_swig_XapianTermIterator);
    add_property_zval(obj,"_cPtr",_cPtr);
    *return_value=*obj;
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_XapianDatabase_positionlist_begin) {
  Xapian::Database *arg1 = (Xapian::Database *) 0 ;
  Xapian::docid arg2 ;
  std::string *arg3 = 0 ;
  Xapian::PositionIterator result;
  std::string temp3 ;
  zval **args[2];
  
  SWIG_ResetError();
  /* This function uses a this_ptr*/
  if(ZEND_NUM_ARGS() != 2 || zend_get_parameters_array_ex(2, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*&this_ptr, (void **) &arg1, SWIGTYPE_p_Xapian__Database, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of XapianDatabase_positionlist_begin. Expected SWIGTYPE_p_Xapian__Database");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    /*@SWIG:CONVERT_INT_IN@*/
    convert_to_long_ex(args[0]);
    arg2 = (Xapian::docid) Z_LVAL_PP(args[0]);
    /*@SWIG@*/;
  }
  {
    convert_to_string_ex(args[1]);
    temp3.assign(Z_STRVAL_PP(args[1]), Z_STRLEN_PP(args[1]));
    arg3 = &temp3;
  }
  {
    try {
      result = ((Xapian::Database const *)arg1)->positionlist_begin(arg2,(std::string const &)*arg3);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      
#if PHP_MAJOR_VERSION-0 < 5
      if (code == SWIG_RuntimeError) {
        zend_error(E_WARNING, const_cast<char *>(msg.c_str()));
        /* FIXME: destructors don't have return_value to set. */
        // ZVAL_NULL(return_value);
        return;
      }
#endif
      
      XapianException(code, msg);
    }
  }
  {
    Xapian::PositionIterator * resultobj = new Xapian::PositionIterator((Xapian::PositionIterator &) result);
    SWIG_SetPointerZval(return_value, (void *)resultobj, SWIGTYPE_p_Xapian__PositionIterator, 1);
  }
  /* Wrap this return value */
  {
    /* ALTERNATIVE Constructor, make an object wrapper */
    zval *obj, *_cPtr;
    MAKE_STD_ZVAL(obj);
    MAKE_STD_ZVAL(_cPtr);
    *_cPtr = *return_value;
    INIT_ZVAL(*return_value);
    object_init_ex(obj,ptr_ce_swig_XapianPositionIterator);
    add_property_zval(obj,"_cPtr",_cPtr);
    *return_value=*obj;
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_XapianDatabase_positionlist_end) {
  Xapian::Database *arg1 = (Xapian::Database *) 0 ;
  Xapian::docid arg2 ;
  std::string *arg3 = 0 ;
  Xapian::PositionIterator result;
  std::string temp3 ;
  zval **args[2];
  
  SWIG_ResetError();
  /* This function uses a this_ptr*/
  if(ZEND_NUM_ARGS() != 2 || zend_get_parameters_array_ex(2, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*&this_ptr, (void **) &arg1, SWIGTYPE_p_Xapian__Database, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of XapianDatabase_positionlist_end. Expected SWIGTYPE_p_Xapian__Database");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    /*@SWIG:CONVERT_INT_IN@*/
    convert_to_long_ex(args[0]);
    arg2 = (Xapian::docid) Z_LVAL_PP(args[0]);
    /*@SWIG@*/;
  }
  {
    convert_to_string_ex(args[1]);
    temp3.assign(Z_STRVAL_PP(args[1]), Z_STRLEN_PP(args[1]));
    arg3 = &temp3;
  }
  {
    try {
      result = ((Xapian::Database const *)arg1)->positionlist_end(arg2,(std::string const &)*arg3);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      
#if PHP_MAJOR_VERSION-0 < 5
      if (code == SWIG_RuntimeError) {
        zend_error(E_WARNING, const_cast<char *>(msg.c_str()));
        /* FIXME: destructors don't have return_value to set. */
        // ZVAL_NULL(return_value);
        return;
      }
#endif
      
      XapianException(code, msg);
    }
  }
  {
    Xapian::PositionIterator * resultobj = new Xapian::PositionIterator((Xapian::PositionIterator &) result);
    SWIG_SetPointerZval(return_value, (void *)resultobj, SWIGTYPE_p_Xapian__PositionIterator, 1);
  }
  /* Wrap this return value */
  {
    /* ALTERNATIVE Constructor, make an object wrapper */
    zval *obj, *_cPtr;
    MAKE_STD_ZVAL(obj);
    MAKE_STD_ZVAL(_cPtr);
    *_cPtr = *return_value;
    INIT_ZVAL(*return_value);
    object_init_ex(obj,ptr_ce_swig_XapianPositionIterator);
    add_property_zval(obj,"_cPtr",_cPtr);
    *return_value=*obj;
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_XapianDatabase_allterms_begin) {
  Xapian::Database *arg1 = (Xapian::Database *) 0 ;
  Xapian::TermIterator result;
  
  SWIG_ResetError();
  /* This function uses a this_ptr*/
  if(ZEND_NUM_ARGS() != 0) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*&this_ptr, (void **) &arg1, SWIGTYPE_p_Xapian__Database, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of XapianDatabase_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 (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      
#if PHP_MAJOR_VERSION-0 < 5
      if (code == SWIG_RuntimeError) {
        zend_error(E_WARNING, const_cast<char *>(msg.c_str()));
        /* FIXME: destructors don't have return_value to set. */
        // ZVAL_NULL(return_value);
        return;
      }
#endif
      
      XapianException(code, msg);
    }
  }
  {
    Xapian::TermIterator * resultobj = new Xapian::TermIterator((Xapian::TermIterator &) result);
    SWIG_SetPointerZval(return_value, (void *)resultobj, SWIGTYPE_p_Xapian__TermIterator, 1);
  }
  /* Wrap this return value */
  {
    /* ALTERNATIVE Constructor, make an object wrapper */
    zval *obj, *_cPtr;
    MAKE_STD_ZVAL(obj);
    MAKE_STD_ZVAL(_cPtr);
    *_cPtr = *return_value;
    INIT_ZVAL(*return_value);
    object_init_ex(obj,ptr_ce_swig_XapianTermIterator);
    add_property_zval(obj,"_cPtr",_cPtr);
    *return_value=*obj;
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_XapianDatabase_allterms_end) {
  Xapian::Database *arg1 = (Xapian::Database *) 0 ;
  Xapian::TermIterator result;
  
  SWIG_ResetError();
  /* This function uses a this_ptr*/
  if(ZEND_NUM_ARGS() != 0) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*&this_ptr, (void **) &arg1, SWIGTYPE_p_Xapian__Database, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of XapianDatabase_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 (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      
#if PHP_MAJOR_VERSION-0 < 5
      if (code == SWIG_RuntimeError) {
        zend_error(E_WARNING, const_cast<char *>(msg.c_str()));
        /* FIXME: destructors don't have return_value to set. */
        // ZVAL_NULL(return_value);
        return;
      }
#endif
      
      XapianException(code, msg);
    }
  }
  {
    Xapian::TermIterator * resultobj = new Xapian::TermIterator((Xapian::TermIterator &) result);
    SWIG_SetPointerZval(return_value, (void *)resultobj, SWIGTYPE_p_Xapian__TermIterator, 1);
  }
  /* Wrap this return value */
  {
    /* ALTERNATIVE Constructor, make an object wrapper */
    zval *obj, *_cPtr;
    MAKE_STD_ZVAL(obj);
    MAKE_STD_ZVAL(_cPtr);
    *_cPtr = *return_value;
    INIT_ZVAL(*return_value);
    object_init_ex(obj,ptr_ce_swig_XapianTermIterator);
    add_property_zval(obj,"_cPtr",_cPtr);
    *return_value=*obj;
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_XapianDatabase_get_doccount) {
  Xapian::Database *arg1 = (Xapian::Database *) 0 ;
  Xapian::doccount result;
  
  SWIG_ResetError();
  /* This function uses a this_ptr*/
  if(ZEND_NUM_ARGS() != 0) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*&this_ptr, (void **) &arg1, SWIGTYPE_p_Xapian__Database, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of XapianDatabase_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 (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      
#if PHP_MAJOR_VERSION-0 < 5
      if (code == SWIG_RuntimeError) {
        zend_error(E_WARNING, const_cast<char *>(msg.c_str()));
        /* FIXME: destructors don't have return_value to set. */
        // ZVAL_NULL(return_value);
        return;
      }
#endif
      
      XapianException(code, msg);
    }
  }
  {
    ZVAL_LONG(return_value,result);
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_XapianDatabase_get_lastdocid) {
  Xapian::Database *arg1 = (Xapian::Database *) 0 ;
  Xapian::docid result;
  
  SWIG_ResetError();
  /* This function uses a this_ptr*/
  if(ZEND_NUM_ARGS() != 0) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*&this_ptr, (void **) &arg1, SWIGTYPE_p_Xapian__Database, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of XapianDatabase_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 (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      
#if PHP_MAJOR_VERSION-0 < 5
      if (code == SWIG_RuntimeError) {
        zend_error(E_WARNING, const_cast<char *>(msg.c_str()));
        /* FIXME: destructors don't have return_value to set. */
        // ZVAL_NULL(return_value);
        return;
      }
#endif
      
      XapianException(code, msg);
    }
  }
  {
    ZVAL_LONG(return_value,result);
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_XapianDatabase_get_avlength) {
  Xapian::Database *arg1 = (Xapian::Database *) 0 ;
  Xapian::doclength result;
  
  SWIG_ResetError();
  /* This function uses a this_ptr*/
  if(ZEND_NUM_ARGS() != 0) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*&this_ptr, (void **) &arg1, SWIGTYPE_p_Xapian__Database, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of XapianDatabase_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 (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      
#if PHP_MAJOR_VERSION-0 < 5
      if (code == SWIG_RuntimeError) {
        zend_error(E_WARNING, const_cast<char *>(msg.c_str()));
        /* FIXME: destructors don't have return_value to set. */
        // ZVAL_NULL(return_value);
        return;
      }
#endif
      
      XapianException(code, msg);
    }
  }
  {
    ZVAL_DOUBLE(return_value,result);
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_XapianDatabase_get_termfreq) {
  Xapian::Database *arg1 = (Xapian::Database *) 0 ;
  std::string *arg2 = 0 ;
  Xapian::doccount result;
  std::string temp2 ;
  zval **args[1];
  
  SWIG_ResetError();
  /* This function uses a this_ptr*/
  if(ZEND_NUM_ARGS() != 1 || zend_get_parameters_array_ex(1, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*&this_ptr, (void **) &arg1, SWIGTYPE_p_Xapian__Database, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of XapianDatabase_get_termfreq. Expected SWIGTYPE_p_Xapian__Database");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    convert_to_string_ex(args[0]);
    temp2.assign(Z_STRVAL_PP(args[0]), Z_STRLEN_PP(args[0]));
    arg2 = &temp2;
  }
  {
    try {
      result = (Xapian::doccount)((Xapian::Database const *)arg1)->get_termfreq((std::string const &)*arg2);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      
#if PHP_MAJOR_VERSION-0 < 5
      if (code == SWIG_RuntimeError) {
        zend_error(E_WARNING, const_cast<char *>(msg.c_str()));
        /* FIXME: destructors don't have return_value to set. */
        // ZVAL_NULL(return_value);
        return;
      }
#endif
      
      XapianException(code, msg);
    }
  }
  {
    ZVAL_LONG(return_value,result);
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_XapianDatabase_term_exists) {
  Xapian::Database *arg1 = (Xapian::Database *) 0 ;
  std::string *arg2 = 0 ;
  bool result;
  std::string temp2 ;
  zval **args[1];
  
  SWIG_ResetError();
  /* This function uses a this_ptr*/
  if(ZEND_NUM_ARGS() != 1 || zend_get_parameters_array_ex(1, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*&this_ptr, (void **) &arg1, SWIGTYPE_p_Xapian__Database, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of XapianDatabase_term_exists. Expected SWIGTYPE_p_Xapian__Database");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    convert_to_string_ex(args[0]);
    temp2.assign(Z_STRVAL_PP(args[0]), Z_STRLEN_PP(args[0]));
    arg2 = &temp2;
  }
  {
    try {
      result = (bool)((Xapian::Database const *)arg1)->term_exists((std::string const &)*arg2);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      
#if PHP_MAJOR_VERSION-0 < 5
      if (code == SWIG_RuntimeError) {
        zend_error(E_WARNING, const_cast<char *>(msg.c_str()));
        /* FIXME: destructors don't have return_value to set. */
        // ZVAL_NULL(return_value);
        return;
      }
#endif
      
      XapianException(code, msg);
    }
  }
  {
    ZVAL_BOOL(return_value,(result)?1:0);
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_XapianDatabase_get_collection_freq) {
  Xapian::Database *arg1 = (Xapian::Database *) 0 ;
  std::string *arg2 = 0 ;
  Xapian::termcount result;
  std::string temp2 ;
  zval **args[1];
  
  SWIG_ResetError();
  /* This function uses a this_ptr*/
  if(ZEND_NUM_ARGS() != 1 || zend_get_parameters_array_ex(1, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*&this_ptr, (void **) &arg1, SWIGTYPE_p_Xapian__Database, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of XapianDatabase_get_collection_freq. Expected SWIGTYPE_p_Xapian__Database");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    convert_to_string_ex(args[0]);
    temp2.assign(Z_STRVAL_PP(args[0]), Z_STRLEN_PP(args[0]));
    arg2 = &temp2;
  }
  {
    try {
      result = (Xapian::termcount)((Xapian::Database const *)arg1)->get_collection_freq((std::string const &)*arg2);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      
#if PHP_MAJOR_VERSION-0 < 5
      if (code == SWIG_RuntimeError) {
        zend_error(E_WARNING, const_cast<char *>(msg.c_str()));
        /* FIXME: destructors don't have return_value to set. */
        // ZVAL_NULL(return_value);
        return;
      }
#endif
      
      XapianException(code, msg);
    }
  }
  {
    ZVAL_LONG(return_value,result);
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_XapianDatabase_get_doclength) {
  Xapian::Database *arg1 = (Xapian::Database *) 0 ;
  Xapian::docid arg2 ;
  Xapian::doclength result;
  zval **args[1];
  
  SWIG_ResetError();
  /* This function uses a this_ptr*/
  if(ZEND_NUM_ARGS() != 1 || zend_get_parameters_array_ex(1, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*&this_ptr, (void **) &arg1, SWIGTYPE_p_Xapian__Database, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of XapianDatabase_get_doclength. Expected SWIGTYPE_p_Xapian__Database");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    /*@SWIG:CONVERT_INT_IN@*/
    convert_to_long_ex(args[0]);
    arg2 = (Xapian::docid) Z_LVAL_PP(args[0]);
    /*@SWIG@*/;
  }
  {
    try {
      result = (Xapian::doclength)((Xapian::Database const *)arg1)->get_doclength(arg2);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      
#if PHP_MAJOR_VERSION-0 < 5
      if (code == SWIG_RuntimeError) {
        zend_error(E_WARNING, const_cast<char *>(msg.c_str()));
        /* FIXME: destructors don't have return_value to set. */
        // ZVAL_NULL(return_value);
        return;
      }
#endif
      
      XapianException(code, msg);
    }
  }
  {
    ZVAL_DOUBLE(return_value,result);
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_XapianDatabase_keep_alive) {
  Xapian::Database *arg1 = (Xapian::Database *) 0 ;
  
  SWIG_ResetError();
  /* This function uses a this_ptr*/
  if(ZEND_NUM_ARGS() != 0) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*&this_ptr, (void **) &arg1, SWIGTYPE_p_Xapian__Database, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of XapianDatabase_keep_alive. Expected SWIGTYPE_p_Xapian__Database");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    try {
      (arg1)->keep_alive();
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      
#if PHP_MAJOR_VERSION-0 < 5
      if (code == SWIG_RuntimeError) {
        zend_error(E_WARNING, const_cast<char *>(msg.c_str()));
        /* FIXME: destructors don't have return_value to set. */
        // ZVAL_NULL(return_value);
        return;
      }
#endif
      
      XapianException(code, msg);
    }
  }
  
  return;
fail:
  zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_XapianDatabase_get_document) {
  Xapian::Database *arg1 = (Xapian::Database *) 0 ;
  Xapian::docid arg2 ;
  Xapian::Document result;
  zval **args[1];
  
  SWIG_ResetError();
  /* This function uses a this_ptr*/
  if(ZEND_NUM_ARGS() != 1 || zend_get_parameters_array_ex(1, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*&this_ptr, (void **) &arg1, SWIGTYPE_p_Xapian__Database, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of XapianDatabase_get_document. Expected SWIGTYPE_p_Xapian__Database");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    /*@SWIG:CONVERT_INT_IN@*/
    convert_to_long_ex(args[0]);
    arg2 = (Xapian::docid) Z_LVAL_PP(args[0]);
    /*@SWIG@*/;
  }
  {
    try {
      result = (arg1)->get_document(arg2);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      
#if PHP_MAJOR_VERSION-0 < 5
      if (code == SWIG_RuntimeError) {
        zend_error(E_WARNING, const_cast<char *>(msg.c_str()));
        /* FIXME: destructors don't have return_value to set. */
        // ZVAL_NULL(return_value);
        return;
      }
#endif
      
      XapianException(code, msg);
    }
  }
  {
    Xapian::Document * resultobj = new Xapian::Document((Xapian::Document &) result);
    SWIG_SetPointerZval(return_value, (void *)resultobj, SWIGTYPE_p_Xapian__Document, 1);
  }
  /* Wrap this return value */
  {
    /* ALTERNATIVE Constructor, make an object wrapper */
    zval *obj, *_cPtr;
    MAKE_STD_ZVAL(obj);
    MAKE_STD_ZVAL(_cPtr);
    *_cPtr = *return_value;
    INIT_ZVAL(*return_value);
    object_init_ex(obj,ptr_ce_swig_XapianDocument);
    add_property_zval(obj,"_cPtr",_cPtr);
    *return_value=*obj;
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg());
}


/* property handler for class XapianDatabase */
static pval _wrap_propget_XapianDatabase(zend_property_reference *property_reference) {
  pval result;
  pval **_result;
  zend_llist_element *element = property_reference->elements_list->head;
  zend_overloaded_element *property=(zend_overloaded_element *)element->data;
  result.type = IS_NULL;
  if (_propget_XapianDatabase(property_reference, &result)==SUCCESS) return result;
  /* return it ourselves */
  if (zend_hash_find(Z_OBJPROP_P(property_reference->object),Z_STRVAL_P(&(property->element)),1+Z_STRLEN_P(&(property->element)),(void**)&_result)==SUCCESS) {
  zval *_value;
  MAKE_STD_ZVAL(_value);  *_value=**_result;
  INIT_PZVAL(_value);
  zval_copy_ctor(_value);
  return *_value;
  }
  result.type = IS_NULL;
  return result;
}
static int _propget_XapianDatabase(zend_property_reference *property_reference, pval *value) {
  /* get the property name */
  zend_llist_element *element = property_reference->elements_list->head;
  zend_overloaded_element *property=(zend_overloaded_element *)element->data;
  char *propname=Z_STRVAL_P(&(property->element));
  return FAILURE;
}

static int _wrap_propset_XapianDatabase(zend_property_reference *property_reference, pval *value) { 
  zval * _value;
  zend_llist_element *element = property_reference->elements_list->head;
  zend_overloaded_element *property=(zend_overloaded_element *)element->data;
  if (_propset_XapianDatabase(property_reference, value)==SUCCESS) return SUCCESS;
  /* set it ourselves as it is XapianDatabase */
  MAKE_STD_ZVAL(_value);
  *_value=*value;
  INIT_PZVAL(_value);
  zval_copy_ctor(_value);
  return add_property_zval_ex(property_reference->object,Z_STRVAL_P(&(property->element)),1+Z_STRLEN_P(&(property->element)),_value);
}
static int _propset_XapianDatabase(zend_property_reference *property_reference, pval *value) {
  /* get the property name */
  zend_llist_element *element = property_reference->elements_list->head;
  zend_overloaded_element *property=(zend_overloaded_element *)element->data;
  char *propname=Z_STRVAL_P(&(property->element));
  return FAILURE;
}

/* This function is designed to be called by the zend list destructors */
/* to typecast and do the actual destruction */
static void __wrap_delete_XapianWritableDatabase(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 (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      
#if PHP_MAJOR_VERSION-0 < 5
      if (code == SWIG_RuntimeError) {
        zend_error(E_WARNING, const_cast<char *>(msg.c_str()));
        /* FIXME: destructors don't have return_value to set. */
        // ZVAL_NULL(return_value);
        return;
      }
#endif
      
      XapianException(code, msg);
    }
  }
}


ZEND_NAMED_FUNCTION(_wrap_new_XapianWritableDatabase__SWIG_0) {
  Xapian::WritableDatabase *result = 0 ;
  
  SWIG_ResetError();
  /* NATIVE Constructor */
  if(ZEND_NUM_ARGS() != 0) {
    WRONG_PARAM_COUNT;
  }
  
  {
    try {
      result = (Xapian::WritableDatabase *)new Xapian::WritableDatabase();
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      
#if PHP_MAJOR_VERSION-0 < 5
      if (code == SWIG_RuntimeError) {
        zend_error(E_WARNING, const_cast<char *>(msg.c_str()));
        /* FIXME: destructors don't have return_value to set. */
        // ZVAL_NULL(return_value);
        return;
      }
#endif
      
      XapianException(code, msg);
    }
  }
  {
    SWIG_SetPointerZval(return_value, (void *)result, SWIGTYPE_p_Xapian__WritableDatabase, 1);
  }
  /* Wrap this return value */
  if (this_ptr) {
    /* NATIVE Constructor, use this_ptr */
    zval *_cPtr; MAKE_STD_ZVAL(_cPtr);
    *_cPtr = *return_value;
    INIT_ZVAL(*return_value);
    add_property_zval(this_ptr,"_cPtr",_cPtr);
  } else if (! this_ptr) {
    /* ALTERNATIVE Constructor, make an object wrapper */
    zval *obj, *_cPtr;
    MAKE_STD_ZVAL(obj);
    MAKE_STD_ZVAL(_cPtr);
    *_cPtr = *return_value;
    INIT_ZVAL(*return_value);
    object_init_ex(obj,ptr_ce_swig_XapianWritableDatabase);
    add_property_zval(obj,"_cPtr",_cPtr);
    *return_value=*obj;
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_new_XapianWritableDatabase__SWIG_1) {
  std::string *arg1 = 0 ;
  int arg2 ;
  Xapian::WritableDatabase *result = 0 ;
  std::string temp1 ;
  zval **args[2];
  
  SWIG_ResetError();
  /* NATIVE Constructor */
  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: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 (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      
#if PHP_MAJOR_VERSION-0 < 5
      if (code == SWIG_RuntimeError) {
        zend_error(E_WARNING, const_cast<char *>(msg.c_str()));
        /* FIXME: destructors don't have return_value to set. */
        // ZVAL_NULL(return_value);
        return;
      }
#endif
      
      XapianException(code, msg);
    }
  }
  {
    SWIG_SetPointerZval(return_value, (void *)result, SWIGTYPE_p_Xapian__WritableDatabase, 1);
  }
  /* Wrap this return value */
  if (this_ptr) {
    /* NATIVE Constructor, use this_ptr */
    zval *_cPtr; MAKE_STD_ZVAL(_cPtr);
    *_cPtr = *return_value;
    INIT_ZVAL(*return_value);
    add_property_zval(this_ptr,"_cPtr",_cPtr);
  } else if (! this_ptr) {
    /* ALTERNATIVE Constructor, make an object wrapper */
    zval *obj, *_cPtr;
    MAKE_STD_ZVAL(obj);
    MAKE_STD_ZVAL(_cPtr);
    *_cPtr = *return_value;
    INIT_ZVAL(*return_value);
    object_init_ex(obj,ptr_ce_swig_XapianWritableDatabase);
    add_property_zval(obj,"_cPtr",_cPtr);
    *return_value=*obj;
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_new_XapianWritableDatabase__SWIG_2) {
  Xapian::WritableDatabase *arg1 = 0 ;
  Xapian::WritableDatabase *result = 0 ;
  zval **args[1];
  
  SWIG_ResetError();
  /* NATIVE Constructor */
  if(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_XapianWritableDatabase. Expected SWIGTYPE_p_Xapian__WritableDatabase");
    }
  }
  {
    try {
      result = (Xapian::WritableDatabase *)new Xapian::WritableDatabase((Xapian::WritableDatabase const &)*arg1);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      
#if PHP_MAJOR_VERSION-0 < 5
      if (code == SWIG_RuntimeError) {
        zend_error(E_WARNING, const_cast<char *>(msg.c_str()));
        /* FIXME: destructors don't have return_value to set. */
        // ZVAL_NULL(return_value);
        return;
      }
#endif
      
      XapianException(code, msg);
    }
  }
  {
    SWIG_SetPointerZval(return_value, (void *)result, SWIGTYPE_p_Xapian__WritableDatabase, 1);
  }
  /* Wrap this return value */
  if (this_ptr) {
    /* NATIVE Constructor, use this_ptr */
    zval *_cPtr; MAKE_STD_ZVAL(_cPtr);
    *_cPtr = *return_value;
    INIT_ZVAL(*return_value);
    add_property_zval(this_ptr,"_cPtr",_cPtr);
  } else if (! this_ptr) {
    /* ALTERNATIVE Constructor, make an object wrapper */
    zval *obj, *_cPtr;
    MAKE_STD_ZVAL(obj);
    MAKE_STD_ZVAL(_cPtr);
    *_cPtr = *return_value;
    INIT_ZVAL(*return_value);
    object_init_ex(obj,ptr_ce_swig_XapianWritableDatabase);
    add_property_zval(obj,"_cPtr",_cPtr);
    *return_value=*obj;
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_new_XapianWritableDatabase) {
  int argc;
  zval **argv[2];
  
  argc = ZEND_NUM_ARGS();
  zend_get_parameters_array_ex(argc,argv);
  if (argc == 0) {
    return _wrap_new_XapianWritableDatabase__SWIG_0(INTERNAL_FUNCTION_PARAM_PASSTHRU);
  }
  if (argc == 1) {
    int _v;
    {
      void *ptr;
      _v = (SWIG_ConvertPtr(*argv[0], (void **)&ptr, SWIGTYPE_p_Xapian__WritableDatabase, 0) == 0);
    }
    if (_v) {
      return _wrap_new_XapianWritableDatabase__SWIG_2(INTERNAL_FUNCTION_PARAM_PASSTHRU);
    }
  }
  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) {
        return _wrap_new_XapianWritableDatabase__SWIG_1(INTERNAL_FUNCTION_PARAM_PASSTHRU);
      }
    }
  }
  
  SWIG_ErrorCode() = E_ERROR;
  SWIG_ErrorMsg() = "No matching function for overloaded 'new_XapianWritableDatabase'";
  zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_XapianWritableDatabase_flush) {
  Xapian::WritableDatabase *arg1 = (Xapian::WritableDatabase *) 0 ;
  
  SWIG_ResetError();
  /* This function uses a this_ptr*/
  if(ZEND_NUM_ARGS() != 0) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*&this_ptr, (void **) &arg1, SWIGTYPE_p_Xapian__WritableDatabase, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of XapianWritableDatabase_flush. Expected SWIGTYPE_p_Xapian__WritableDatabase");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    try {
      (arg1)->flush();
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      
#if PHP_MAJOR_VERSION-0 < 5
      if (code == SWIG_RuntimeError) {
        zend_error(E_WARNING, const_cast<char *>(msg.c_str()));
        /* FIXME: destructors don't have return_value to set. */
        // ZVAL_NULL(return_value);
        return;
      }
#endif
      
      XapianException(code, msg);
    }
  }
  
  return;
fail:
  zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_XapianWritableDatabase_begin_transaction__SWIG_0) {
  Xapian::WritableDatabase *arg1 = (Xapian::WritableDatabase *) 0 ;
  bool arg2 ;
  zval **args[1];
  
  SWIG_ResetError();
  /* This function uses a this_ptr*/
  if(ZEND_NUM_ARGS() != 1 || zend_get_parameters_array_ex(1, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*&this_ptr, (void **) &arg1, SWIGTYPE_p_Xapian__WritableDatabase, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of XapianWritableDatabase_begin_transaction. Expected SWIGTYPE_p_Xapian__WritableDatabase");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    /*@SWIG:CONVERT_BOOL_IN@*/
    convert_to_boolean_ex(args[0]);
    arg2 = (bool) Z_LVAL_PP(args[0]);
    /*@SWIG@*/;
  }
  {
    try {
      (arg1)->begin_transaction(arg2);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      
#if PHP_MAJOR_VERSION-0 < 5
      if (code == SWIG_RuntimeError) {
        zend_error(E_WARNING, const_cast<char *>(msg.c_str()));
        /* FIXME: destructors don't have return_value to set. */
        // ZVAL_NULL(return_value);
        return;
      }
#endif
      
      XapianException(code, msg);
    }
  }
  
  return;
fail:
  zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_XapianWritableDatabase_begin_transaction__SWIG_1) {
  Xapian::WritableDatabase *arg1 = (Xapian::WritableDatabase *) 0 ;
  
  SWIG_ResetError();
  /* This function uses a this_ptr*/
  if(ZEND_NUM_ARGS() != 0) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*&this_ptr, (void **) &arg1, SWIGTYPE_p_Xapian__WritableDatabase, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of XapianWritableDatabase_begin_transaction. Expected SWIGTYPE_p_Xapian__WritableDatabase");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    try {
      (arg1)->begin_transaction();
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      
#if PHP_MAJOR_VERSION-0 < 5
      if (code == SWIG_RuntimeError) {
        zend_error(E_WARNING, const_cast<char *>(msg.c_str()));
        /* FIXME: destructors don't have return_value to set. */
        // ZVAL_NULL(return_value);
        return;
      }
#endif
      
      XapianException(code, msg);
    }
  }
  
  return;
fail:
  zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_XapianWritableDatabase_begin_transaction) {
  int argc;
  zval **argv[2];
  
  argc = ZEND_NUM_ARGS();
  argv[0] = &this_ptr;
  zend_get_parameters_array_ex(argc,argv+1);
  argc++;
  if (argc == 1) {
    int _v;
    {
      void *tmp;
      _v = (SWIG_ConvertPtr( *argv[0], (void**)&tmp, SWIGTYPE_p_Xapian__WritableDatabase, 0) >= 0);
    }
    if (_v) {
      return _wrap_XapianWritableDatabase_begin_transaction__SWIG_1(INTERNAL_FUNCTION_PARAM_PASSTHRU);
    }
  }
  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) {
        return _wrap_XapianWritableDatabase_begin_transaction__SWIG_0(INTERNAL_FUNCTION_PARAM_PASSTHRU);
      }
    }
  }
  
  SWIG_ErrorCode() = E_ERROR;
  SWIG_ErrorMsg() = "No matching function for overloaded 'XapianWritableDatabase_begin_transaction'";
  zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_XapianWritableDatabase_commit_transaction) {
  Xapian::WritableDatabase *arg1 = (Xapian::WritableDatabase *) 0 ;
  
  SWIG_ResetError();
  /* This function uses a this_ptr*/
  if(ZEND_NUM_ARGS() != 0) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*&this_ptr, (void **) &arg1, SWIGTYPE_p_Xapian__WritableDatabase, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of XapianWritableDatabase_commit_transaction. Expected SWIGTYPE_p_Xapian__WritableDatabase");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    try {
      (arg1)->commit_transaction();
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      
#if PHP_MAJOR_VERSION-0 < 5
      if (code == SWIG_RuntimeError) {
        zend_error(E_WARNING, const_cast<char *>(msg.c_str()));
        /* FIXME: destructors don't have return_value to set. */
        // ZVAL_NULL(return_value);
        return;
      }
#endif
      
      XapianException(code, msg);
    }
  }
  
  return;
fail:
  zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_XapianWritableDatabase_cancel_transaction) {
  Xapian::WritableDatabase *arg1 = (Xapian::WritableDatabase *) 0 ;
  
  SWIG_ResetError();
  /* This function uses a this_ptr*/
  if(ZEND_NUM_ARGS() != 0) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*&this_ptr, (void **) &arg1, SWIGTYPE_p_Xapian__WritableDatabase, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of XapianWritableDatabase_cancel_transaction. Expected SWIGTYPE_p_Xapian__WritableDatabase");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    try {
      (arg1)->cancel_transaction();
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      
#if PHP_MAJOR_VERSION-0 < 5
      if (code == SWIG_RuntimeError) {
        zend_error(E_WARNING, const_cast<char *>(msg.c_str()));
        /* FIXME: destructors don't have return_value to set. */
        // ZVAL_NULL(return_value);
        return;
      }
#endif
      
      XapianException(code, msg);
    }
  }
  
  return;
fail:
  zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_XapianWritableDatabase_add_document) {
  Xapian::WritableDatabase *arg1 = (Xapian::WritableDatabase *) 0 ;
  Xapian::Document *arg2 = 0 ;
  Xapian::docid result;
  zval **args[1];
  
  SWIG_ResetError();
  /* This function uses a this_ptr*/
  if(ZEND_NUM_ARGS() != 1 || zend_get_parameters_array_ex(1, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*&this_ptr, (void **) &arg1, SWIGTYPE_p_Xapian__WritableDatabase, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of XapianWritableDatabase_add_document. Expected SWIGTYPE_p_Xapian__WritableDatabase");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    if (SWIG_ConvertPtr(*args[0], (void**)&arg2, SWIGTYPE_p_Xapian__Document, 0) < 0 || arg2 == NULL) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 2 of XapianWritableDatabase_add_document. Expected SWIGTYPE_p_Xapian__Document");
    }
  }
  {
    try {
      result = (Xapian::docid)(arg1)->add_document((Xapian::Document const &)*arg2);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      
#if PHP_MAJOR_VERSION-0 < 5
      if (code == SWIG_RuntimeError) {
        zend_error(E_WARNING, const_cast<char *>(msg.c_str()));
        /* FIXME: destructors don't have return_value to set. */
        // ZVAL_NULL(return_value);
        return;
      }
#endif
      
      XapianException(code, msg);
    }
  }
  {
    ZVAL_LONG(return_value,result);
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_XapianWritableDatabase_delete_document__SWIG_0) {
  Xapian::WritableDatabase *arg1 = (Xapian::WritableDatabase *) 0 ;
  Xapian::docid arg2 ;
  zval **args[1];
  
  SWIG_ResetError();
  /* This function uses a this_ptr*/
  if(ZEND_NUM_ARGS() != 1 || zend_get_parameters_array_ex(1, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*&this_ptr, (void **) &arg1, SWIGTYPE_p_Xapian__WritableDatabase, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of XapianWritableDatabase_delete_document. Expected SWIGTYPE_p_Xapian__WritableDatabase");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    /*@SWIG:CONVERT_INT_IN@*/
    convert_to_long_ex(args[0]);
    arg2 = (Xapian::docid) Z_LVAL_PP(args[0]);
    /*@SWIG@*/;
  }
  {
    try {
      (arg1)->delete_document(arg2);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      
#if PHP_MAJOR_VERSION-0 < 5
      if (code == SWIG_RuntimeError) {
        zend_error(E_WARNING, const_cast<char *>(msg.c_str()));
        /* FIXME: destructors don't have return_value to set. */
        // ZVAL_NULL(return_value);
        return;
      }
#endif
      
      XapianException(code, msg);
    }
  }
  
  return;
fail:
  zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_XapianWritableDatabase_replace_document__SWIG_0) {
  Xapian::WritableDatabase *arg1 = (Xapian::WritableDatabase *) 0 ;
  Xapian::docid arg2 ;
  Xapian::Document *arg3 = 0 ;
  zval **args[2];
  
  SWIG_ResetError();
  /* This function uses a this_ptr*/
  if(ZEND_NUM_ARGS() != 2 || zend_get_parameters_array_ex(2, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*&this_ptr, (void **) &arg1, SWIGTYPE_p_Xapian__WritableDatabase, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of XapianWritableDatabase_replace_document. Expected SWIGTYPE_p_Xapian__WritableDatabase");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    /*@SWIG:CONVERT_INT_IN@*/
    convert_to_long_ex(args[0]);
    arg2 = (Xapian::docid) Z_LVAL_PP(args[0]);
    /*@SWIG@*/;
  }
  {
    if (SWIG_ConvertPtr(*args[1], (void**)&arg3, SWIGTYPE_p_Xapian__Document, 0) < 0 || arg3 == NULL) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 3 of XapianWritableDatabase_replace_document. Expected SWIGTYPE_p_Xapian__Document");
    }
  }
  {
    try {
      (arg1)->replace_document(arg2,(Xapian::Document const &)*arg3);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      
#if PHP_MAJOR_VERSION-0 < 5
      if (code == SWIG_RuntimeError) {
        zend_error(E_WARNING, const_cast<char *>(msg.c_str()));
        /* FIXME: destructors don't have return_value to set. */
        // ZVAL_NULL(return_value);
        return;
      }
#endif
      
      XapianException(code, msg);
    }
  }
  
  return;
fail:
  zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_XapianWritableDatabase_delete_document__SWIG_1) {
  Xapian::WritableDatabase *arg1 = (Xapian::WritableDatabase *) 0 ;
  std::string *arg2 = 0 ;
  std::string temp2 ;
  zval **args[1];
  
  SWIG_ResetError();
  /* This function uses a this_ptr*/
  if(ZEND_NUM_ARGS() != 1 || zend_get_parameters_array_ex(1, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*&this_ptr, (void **) &arg1, SWIGTYPE_p_Xapian__WritableDatabase, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of XapianWritableDatabase_delete_document. Expected SWIGTYPE_p_Xapian__WritableDatabase");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    convert_to_string_ex(args[0]);
    temp2.assign(Z_STRVAL_PP(args[0]), Z_STRLEN_PP(args[0]));
    arg2 = &temp2;
  }
  {
    try {
      (arg1)->delete_document((std::string const &)*arg2);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      
#if PHP_MAJOR_VERSION-0 < 5
      if (code == SWIG_RuntimeError) {
        zend_error(E_WARNING, const_cast<char *>(msg.c_str()));
        /* FIXME: destructors don't have return_value to set. */
        // ZVAL_NULL(return_value);
        return;
      }
#endif
      
      XapianException(code, msg);
    }
  }
  
  return;
fail:
  zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_XapianWritableDatabase_delete_document) {
  int argc;
  zval **argv[2];
  
  argc = ZEND_NUM_ARGS();
  argv[0] = &this_ptr;
  zend_get_parameters_array_ex(argc,argv+1);
  argc++;
  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) {
        return _wrap_XapianWritableDatabase_delete_document__SWIG_1(INTERNAL_FUNCTION_PARAM_PASSTHRU);
      }
    }
  }
  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) {
        return _wrap_XapianWritableDatabase_delete_document__SWIG_0(INTERNAL_FUNCTION_PARAM_PASSTHRU);
      }
    }
  }
  
  SWIG_ErrorCode() = E_ERROR;
  SWIG_ErrorMsg() = "No matching function for overloaded 'XapianWritableDatabase_delete_document'";
  zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_XapianWritableDatabase_replace_document__SWIG_1) {
  Xapian::WritableDatabase *arg1 = (Xapian::WritableDatabase *) 0 ;
  std::string *arg2 = 0 ;
  Xapian::Document *arg3 = 0 ;
  Xapian::docid result;
  std::string temp2 ;
  zval **args[2];
  
  SWIG_ResetError();
  /* This function uses a this_ptr*/
  if(ZEND_NUM_ARGS() != 2 || zend_get_parameters_array_ex(2, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*&this_ptr, (void **) &arg1, SWIGTYPE_p_Xapian__WritableDatabase, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of XapianWritableDatabase_replace_document. Expected SWIGTYPE_p_Xapian__WritableDatabase");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    convert_to_string_ex(args[0]);
    temp2.assign(Z_STRVAL_PP(args[0]), Z_STRLEN_PP(args[0]));
    arg2 = &temp2;
  }
  {
    if (SWIG_ConvertPtr(*args[1], (void**)&arg3, SWIGTYPE_p_Xapian__Document, 0) < 0 || arg3 == NULL) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 3 of XapianWritableDatabase_replace_document. Expected SWIGTYPE_p_Xapian__Document");
    }
  }
  {
    try {
      result = (Xapian::docid)(arg1)->replace_document((std::string const &)*arg2,(Xapian::Document const &)*arg3);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      
#if PHP_MAJOR_VERSION-0 < 5
      if (code == SWIG_RuntimeError) {
        zend_error(E_WARNING, const_cast<char *>(msg.c_str()));
        /* FIXME: destructors don't have return_value to set. */
        // ZVAL_NULL(return_value);
        return;
      }
#endif
      
      XapianException(code, msg);
    }
  }
  {
    ZVAL_LONG(return_value,result);
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_XapianWritableDatabase_replace_document) {
  int argc;
  zval **argv[3];
  
  argc = ZEND_NUM_ARGS();
  argv[0] = &this_ptr;
  zend_get_parameters_array_ex(argc,argv+1);
  argc++;
  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) {
          return _wrap_XapianWritableDatabase_replace_document__SWIG_1(INTERNAL_FUNCTION_PARAM_PASSTHRU);
        }
      }
    }
  }
  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) {
          return _wrap_XapianWritableDatabase_replace_document__SWIG_0(INTERNAL_FUNCTION_PARAM_PASSTHRU);
        }
      }
    }
  }
  
  SWIG_ErrorCode() = E_ERROR;
  SWIG_ErrorMsg() = "No matching function for overloaded 'XapianWritableDatabase_replace_document'";
  zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_XapianWritableDatabase_get_description) {
  Xapian::WritableDatabase *arg1 = (Xapian::WritableDatabase *) 0 ;
  std::string result;
  
  SWIG_ResetError();
  /* This function uses a this_ptr*/
  if(ZEND_NUM_ARGS() != 0) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*&this_ptr, (void **) &arg1, SWIGTYPE_p_Xapian__WritableDatabase, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of XapianWritableDatabase_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 (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      
#if PHP_MAJOR_VERSION-0 < 5
      if (code == SWIG_RuntimeError) {
        zend_error(E_WARNING, const_cast<char *>(msg.c_str()));
        /* FIXME: destructors don't have return_value to set. */
        // ZVAL_NULL(return_value);
        return;
      }
#endif
      
      XapianException(code, msg);
    }
  }
  {
    ZVAL_STRINGL(return_value,const_cast<char*>((&result)->data()),(&result)->length(),1);
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg());
}


/* property handler for class XapianWritableDatabase */
static pval _wrap_propget_XapianWritableDatabase(zend_property_reference *property_reference) {
  pval result;
  pval **_result;
  zend_llist_element *element = property_reference->elements_list->head;
  zend_overloaded_element *property=(zend_overloaded_element *)element->data;
  result.type = IS_NULL;
  if (_propget_XapianWritableDatabase(property_reference, &result)==SUCCESS) return result;
  /* return it ourselves */
  if (zend_hash_find(Z_OBJPROP_P(property_reference->object),Z_STRVAL_P(&(property->element)),1+Z_STRLEN_P(&(property->element)),(void**)&_result)==SUCCESS) {
  zval *_value;
  MAKE_STD_ZVAL(_value);  *_value=**_result;
  INIT_PZVAL(_value);
  zval_copy_ctor(_value);
  return *_value;
  }
  result.type = IS_NULL;
  return result;
}
static int _propget_XapianWritableDatabase(zend_property_reference *property_reference, pval *value) {
  /* No extra properties for subclass XapianWritableDatabase */
  /* Try base class(es). */
  if (_propget_XapianDatabase(property_reference, value)==SUCCESS) return SUCCESS;
  return FAILURE;
}

static int _wrap_propset_XapianWritableDatabase(zend_property_reference *property_reference, pval *value) { 
  zval * _value;
  zend_llist_element *element = property_reference->elements_list->head;
  zend_overloaded_element *property=(zend_overloaded_element *)element->data;
  if (_propset_XapianWritableDatabase(property_reference, value)==SUCCESS) return SUCCESS;
  /* set it ourselves as it is XapianWritableDatabase */
  MAKE_STD_ZVAL(_value);
  *_value=*value;
  INIT_PZVAL(_value);
  zval_copy_ctor(_value);
  return add_property_zval_ex(property_reference->object,Z_STRVAL_P(&(property->element)),1+Z_STRLEN_P(&(property->element)),_value);
}
static int _propset_XapianWritableDatabase(zend_property_reference *property_reference, pval *value) {
  /* No extra properties for subclass XapianWritableDatabase */
  /* Try base class(es) */
  if (_propset_XapianDatabase(property_reference, value)==SUCCESS) return SUCCESS;
  return FAILURE;
}

ZEND_NAMED_FUNCTION(_wrap_auto_open__SWIG_0) {
  std::string *arg1 = 0 ;
  Xapian::Database result;
  std::string temp1 ;
  zval **args[1];
  
  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((std::string const &)*arg1);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      
#if PHP_MAJOR_VERSION-0 < 5
      if (code == SWIG_RuntimeError) {
        zend_error(E_WARNING, const_cast<char *>(msg.c_str()));
        /* FIXME: destructors don't have return_value to set. */
        // ZVAL_NULL(return_value);
        return;
      }
#endif
      
      XapianException(code, msg);
    }
  }
  {
    Xapian::Database * resultobj = new Xapian::Database((Xapian::Database &) result);
    SWIG_SetPointerZval(return_value, (void *)resultobj, SWIGTYPE_p_Xapian__Database, 1);
  }
  /* Wrap this return value */
  {
    /* ALTERNATIVE Constructor, make an object wrapper */
    zval *obj, *_cPtr;
    MAKE_STD_ZVAL(obj);
    MAKE_STD_ZVAL(_cPtr);
    *_cPtr = *return_value;
    INIT_ZVAL(*return_value);
    object_init_ex(obj,ptr_ce_swig_XapianDatabase);
    add_property_zval(obj,"_cPtr",_cPtr);
    *return_value=*obj;
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_auto_open__SWIG_1) {
  std::string *arg1 = 0 ;
  int arg2 ;
  Xapian::WritableDatabase result;
  std::string temp1 ;
  zval **args[2];
  
  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:CONVERT_INT_IN@*/
    convert_to_long_ex(args[1]);
    arg2 = (int) Z_LVAL_PP(args[1]);
    /*@SWIG@*/;
  }
  {
    try {
      result = Xapian::Auto::open((std::string const &)*arg1,arg2);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      
#if PHP_MAJOR_VERSION-0 < 5
      if (code == SWIG_RuntimeError) {
        zend_error(E_WARNING, const_cast<char *>(msg.c_str()));
        /* FIXME: destructors don't have return_value to set. */
        // ZVAL_NULL(return_value);
        return;
      }
#endif
      
      XapianException(code, msg);
    }
  }
  {
    Xapian::WritableDatabase * resultobj = new Xapian::WritableDatabase((Xapian::WritableDatabase &) result);
    SWIG_SetPointerZval(return_value, (void *)resultobj, SWIGTYPE_p_Xapian__WritableDatabase, 1);
  }
  /* Wrap this return value */
  {
    /* ALTERNATIVE Constructor, make an object wrapper */
    zval *obj, *_cPtr;
    MAKE_STD_ZVAL(obj);
    MAKE_STD_ZVAL(_cPtr);
    *_cPtr = *return_value;
    INIT_ZVAL(*return_value);
    object_init_ex(obj,ptr_ce_swig_XapianWritableDatabase);
    add_property_zval(obj,"_cPtr",_cPtr);
    *return_value=*obj;
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_auto_open) {
  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) {
      return _wrap_auto_open__SWIG_0(INTERNAL_FUNCTION_PARAM_PASSTHRU);
    }
  }
  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) {
        return _wrap_auto_open__SWIG_1(INTERNAL_FUNCTION_PARAM_PASSTHRU);
      }
    }
  }
  
  SWIG_ErrorCode() = E_ERROR;
  SWIG_ErrorMsg() = "No matching function for overloaded 'auto_open'";
  zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_auto_open_stub) {
  std::string *arg1 = 0 ;
  Xapian::Database result;
  std::string temp1 ;
  zval **args[1];
  
  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 (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      
#if PHP_MAJOR_VERSION-0 < 5
      if (code == SWIG_RuntimeError) {
        zend_error(E_WARNING, const_cast<char *>(msg.c_str()));
        /* FIXME: destructors don't have return_value to set. */
        // ZVAL_NULL(return_value);
        return;
      }
#endif
      
      XapianException(code, msg);
    }
  }
  {
    Xapian::Database * resultobj = new Xapian::Database((Xapian::Database &) result);
    SWIG_SetPointerZval(return_value, (void *)resultobj, SWIGTYPE_p_Xapian__Database, 1);
  }
  /* Wrap this return value */
  {
    /* ALTERNATIVE Constructor, make an object wrapper */
    zval *obj, *_cPtr;
    MAKE_STD_ZVAL(obj);
    MAKE_STD_ZVAL(_cPtr);
    *_cPtr = *return_value;
    INIT_ZVAL(*return_value);
    object_init_ex(obj,ptr_ce_swig_XapianDatabase);
    add_property_zval(obj,"_cPtr",_cPtr);
    *return_value=*obj;
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_quartz_open__SWIG_0) {
  std::string *arg1 = 0 ;
  Xapian::Database result;
  std::string temp1 ;
  zval **args[1];
  
  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::Quartz::open((std::string const &)*arg1);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      
#if PHP_MAJOR_VERSION-0 < 5
      if (code == SWIG_RuntimeError) {
        zend_error(E_WARNING, const_cast<char *>(msg.c_str()));
        /* FIXME: destructors don't have return_value to set. */
        // ZVAL_NULL(return_value);
        return;
      }
#endif
      
      XapianException(code, msg);
    }
  }
  {
    Xapian::Database * resultobj = new Xapian::Database((Xapian::Database &) result);
    SWIG_SetPointerZval(return_value, (void *)resultobj, SWIGTYPE_p_Xapian__Database, 1);
  }
  /* Wrap this return value */
  {
    /* ALTERNATIVE Constructor, make an object wrapper */
    zval *obj, *_cPtr;
    MAKE_STD_ZVAL(obj);
    MAKE_STD_ZVAL(_cPtr);
    *_cPtr = *return_value;
    INIT_ZVAL(*return_value);
    object_init_ex(obj,ptr_ce_swig_XapianDatabase);
    add_property_zval(obj,"_cPtr",_cPtr);
    *return_value=*obj;
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_quartz_open__SWIG_1) {
  std::string *arg1 = 0 ;
  int arg2 ;
  int arg3 ;
  Xapian::WritableDatabase result;
  std::string temp1 ;
  zval **args[3];
  
  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:CONVERT_INT_IN@*/
    convert_to_long_ex(args[1]);
    arg2 = (int) Z_LVAL_PP(args[1]);
    /*@SWIG@*/;
  }
  {
    /*@SWIG:CONVERT_INT_IN@*/
    convert_to_long_ex(args[2]);
    arg3 = (int) Z_LVAL_PP(args[2]);
    /*@SWIG@*/;
  }
  {
    try {
      result = Xapian::Quartz::open((std::string const &)*arg1,arg2,arg3);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      
#if PHP_MAJOR_VERSION-0 < 5
      if (code == SWIG_RuntimeError) {
        zend_error(E_WARNING, const_cast<char *>(msg.c_str()));
        /* FIXME: destructors don't have return_value to set. */
        // ZVAL_NULL(return_value);
        return;
      }
#endif
      
      XapianException(code, msg);
    }
  }
  {
    Xapian::WritableDatabase * resultobj = new Xapian::WritableDatabase((Xapian::WritableDatabase &) result);
    SWIG_SetPointerZval(return_value, (void *)resultobj, SWIGTYPE_p_Xapian__WritableDatabase, 1);
  }
  /* Wrap this return value */
  {
    /* ALTERNATIVE Constructor, make an object wrapper */
    zval *obj, *_cPtr;
    MAKE_STD_ZVAL(obj);
    MAKE_STD_ZVAL(_cPtr);
    *_cPtr = *return_value;
    INIT_ZVAL(*return_value);
    object_init_ex(obj,ptr_ce_swig_XapianWritableDatabase);
    add_property_zval(obj,"_cPtr",_cPtr);
    *return_value=*obj;
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_quartz_open__SWIG_2) {
  std::string *arg1 = 0 ;
  int arg2 ;
  Xapian::WritableDatabase result;
  std::string temp1 ;
  zval **args[2];
  
  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:CONVERT_INT_IN@*/
    convert_to_long_ex(args[1]);
    arg2 = (int) Z_LVAL_PP(args[1]);
    /*@SWIG@*/;
  }
  {
    try {
      result = Xapian::Quartz::open((std::string const &)*arg1,arg2);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      
#if PHP_MAJOR_VERSION-0 < 5
      if (code == SWIG_RuntimeError) {
        zend_error(E_WARNING, const_cast<char *>(msg.c_str()));
        /* FIXME: destructors don't have return_value to set. */
        // ZVAL_NULL(return_value);
        return;
      }
#endif
      
      XapianException(code, msg);
    }
  }
  {
    Xapian::WritableDatabase * resultobj = new Xapian::WritableDatabase((Xapian::WritableDatabase &) result);
    SWIG_SetPointerZval(return_value, (void *)resultobj, SWIGTYPE_p_Xapian__WritableDatabase, 1);
  }
  /* Wrap this return value */
  {
    /* ALTERNATIVE Constructor, make an object wrapper */
    zval *obj, *_cPtr;
    MAKE_STD_ZVAL(obj);
    MAKE_STD_ZVAL(_cPtr);
    *_cPtr = *return_value;
    INIT_ZVAL(*return_value);
    object_init_ex(obj,ptr_ce_swig_XapianWritableDatabase);
    add_property_zval(obj,"_cPtr",_cPtr);
    *return_value=*obj;
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_quartz_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) {
      return _wrap_quartz_open__SWIG_0(INTERNAL_FUNCTION_PARAM_PASSTHRU);
    }
  }
  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) {
        return _wrap_quartz_open__SWIG_2(INTERNAL_FUNCTION_PARAM_PASSTHRU);
      }
    }
  }
  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) {
          return _wrap_quartz_open__SWIG_1(INTERNAL_FUNCTION_PARAM_PASSTHRU);
        }
      }
    }
  }
  
  SWIG_ErrorCode() = E_ERROR;
  SWIG_ErrorMsg() = "No matching function for overloaded 'quartz_open'";
  zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_flint_open__SWIG_0) {
  std::string *arg1 = 0 ;
  Xapian::Database result;
  std::string temp1 ;
  zval **args[1];
  
  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 (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      
#if PHP_MAJOR_VERSION-0 < 5
      if (code == SWIG_RuntimeError) {
        zend_error(E_WARNING, const_cast<char *>(msg.c_str()));
        /* FIXME: destructors don't have return_value to set. */
        // ZVAL_NULL(return_value);
        return;
      }
#endif
      
      XapianException(code, msg);
    }
  }
  {
    Xapian::Database * resultobj = new Xapian::Database((Xapian::Database &) result);
    SWIG_SetPointerZval(return_value, (void *)resultobj, SWIGTYPE_p_Xapian__Database, 1);
  }
  /* Wrap this return value */
  {
    /* ALTERNATIVE Constructor, make an object wrapper */
    zval *obj, *_cPtr;
    MAKE_STD_ZVAL(obj);
    MAKE_STD_ZVAL(_cPtr);
    *_cPtr = *return_value;
    INIT_ZVAL(*return_value);
    object_init_ex(obj,ptr_ce_swig_XapianDatabase);
    add_property_zval(obj,"_cPtr",_cPtr);
    *return_value=*obj;
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_flint_open__SWIG_1) {
  std::string *arg1 = 0 ;
  int arg2 ;
  int arg3 ;
  Xapian::WritableDatabase result;
  std::string temp1 ;
  zval **args[3];
  
  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:CONVERT_INT_IN@*/
    convert_to_long_ex(args[1]);
    arg2 = (int) Z_LVAL_PP(args[1]);
    /*@SWIG@*/;
  }
  {
    /*@SWIG: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 (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      
#if PHP_MAJOR_VERSION-0 < 5
      if (code == SWIG_RuntimeError) {
        zend_error(E_WARNING, const_cast<char *>(msg.c_str()));
        /* FIXME: destructors don't have return_value to set. */
        // ZVAL_NULL(return_value);
        return;
      }
#endif
      
      XapianException(code, msg);
    }
  }
  {
    Xapian::WritableDatabase * resultobj = new Xapian::WritableDatabase((Xapian::WritableDatabase &) result);
    SWIG_SetPointerZval(return_value, (void *)resultobj, SWIGTYPE_p_Xapian__WritableDatabase, 1);
  }
  /* Wrap this return value */
  {
    /* ALTERNATIVE Constructor, make an object wrapper */
    zval *obj, *_cPtr;
    MAKE_STD_ZVAL(obj);
    MAKE_STD_ZVAL(_cPtr);
    *_cPtr = *return_value;
    INIT_ZVAL(*return_value);
    object_init_ex(obj,ptr_ce_swig_XapianWritableDatabase);
    add_property_zval(obj,"_cPtr",_cPtr);
    *return_value=*obj;
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_flint_open__SWIG_2) {
  std::string *arg1 = 0 ;
  int arg2 ;
  Xapian::WritableDatabase result;
  std::string temp1 ;
  zval **args[2];
  
  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: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 (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      
#if PHP_MAJOR_VERSION-0 < 5
      if (code == SWIG_RuntimeError) {
        zend_error(E_WARNING, const_cast<char *>(msg.c_str()));
        /* FIXME: destructors don't have return_value to set. */
        // ZVAL_NULL(return_value);
        return;
      }
#endif
      
      XapianException(code, msg);
    }
  }
  {
    Xapian::WritableDatabase * resultobj = new Xapian::WritableDatabase((Xapian::WritableDatabase &) result);
    SWIG_SetPointerZval(return_value, (void *)resultobj, SWIGTYPE_p_Xapian__WritableDatabase, 1);
  }
  /* Wrap this return value */
  {
    /* ALTERNATIVE Constructor, make an object wrapper */
    zval *obj, *_cPtr;
    MAKE_STD_ZVAL(obj);
    MAKE_STD_ZVAL(_cPtr);
    *_cPtr = *return_value;
    INIT_ZVAL(*return_value);
    object_init_ex(obj,ptr_ce_swig_XapianWritableDatabase);
    add_property_zval(obj,"_cPtr",_cPtr);
    *return_value=*obj;
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),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) {
      return _wrap_flint_open__SWIG_0(INTERNAL_FUNCTION_PARAM_PASSTHRU);
    }
  }
  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) {
        return _wrap_flint_open__SWIG_2(INTERNAL_FUNCTION_PARAM_PASSTHRU);
      }
    }
  }
  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) {
          return _wrap_flint_open__SWIG_1(INTERNAL_FUNCTION_PARAM_PASSTHRU);
        }
      }
    }
  }
  
  SWIG_ErrorCode() = E_ERROR;
  SWIG_ErrorMsg() = "No matching function for overloaded 'flint_open'";
  zend_error(SWIG_ErrorCode(),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 (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      
#if PHP_MAJOR_VERSION-0 < 5
      if (code == SWIG_RuntimeError) {
        zend_error(E_WARNING, const_cast<char *>(msg.c_str()));
        /* FIXME: destructors don't have return_value to set. */
        // ZVAL_NULL(return_value);
        return;
      }
#endif
      
      XapianException(code, msg);
    }
  }
  {
    Xapian::WritableDatabase * resultobj = new Xapian::WritableDatabase((Xapian::WritableDatabase &) result);
    SWIG_SetPointerZval(return_value, (void *)resultobj, SWIGTYPE_p_Xapian__WritableDatabase, 1);
  }
  /* Wrap this return value */
  {
    /* ALTERNATIVE Constructor, make an object wrapper */
    zval *obj, *_cPtr;
    MAKE_STD_ZVAL(obj);
    MAKE_STD_ZVAL(_cPtr);
    *_cPtr = *return_value;
    INIT_ZVAL(*return_value);
    object_init_ex(obj,ptr_ce_swig_XapianWritableDatabase);
    add_property_zval(obj,"_cPtr",_cPtr);
    *return_value=*obj;
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_muscat36_open_da__SWIG_0) {
  std::string *arg1 = 0 ;
  std::string *arg2 = 0 ;
  bool arg3 ;
  Xapian::Database result;
  std::string temp1 ;
  std::string temp2 ;
  zval **args[3];
  
  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:CONVERT_BOOL_IN@*/
    convert_to_boolean_ex(args[2]);
    arg3 = (bool) Z_LVAL_PP(args[2]);
    /*@SWIG@*/;
  }
  {
    try {
      result = Xapian::Muscat36::open_da((std::string const &)*arg1,(std::string const &)*arg2,arg3);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      
#if PHP_MAJOR_VERSION-0 < 5
      if (code == SWIG_RuntimeError) {
        zend_error(E_WARNING, const_cast<char *>(msg.c_str()));
        /* FIXME: destructors don't have return_value to set. */
        // ZVAL_NULL(return_value);
        return;
      }
#endif
      
      XapianException(code, msg);
    }
  }
  {
    Xapian::Database * resultobj = new Xapian::Database((Xapian::Database &) result);
    SWIG_SetPointerZval(return_value, (void *)resultobj, SWIGTYPE_p_Xapian__Database, 1);
  }
  /* Wrap this return value */
  {
    /* ALTERNATIVE Constructor, make an object wrapper */
    zval *obj, *_cPtr;
    MAKE_STD_ZVAL(obj);
    MAKE_STD_ZVAL(_cPtr);
    *_cPtr = *return_value;
    INIT_ZVAL(*return_value);
    object_init_ex(obj,ptr_ce_swig_XapianDatabase);
    add_property_zval(obj,"_cPtr",_cPtr);
    *return_value=*obj;
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_muscat36_open_da__SWIG_1) {
  std::string *arg1 = 0 ;
  std::string *arg2 = 0 ;
  Xapian::Database result;
  std::string temp1 ;
  std::string temp2 ;
  zval **args[2];
  
  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::Muscat36::open_da((std::string const &)*arg1,(std::string const &)*arg2);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      
#if PHP_MAJOR_VERSION-0 < 5
      if (code == SWIG_RuntimeError) {
        zend_error(E_WARNING, const_cast<char *>(msg.c_str()));
        /* FIXME: destructors don't have return_value to set. */
        // ZVAL_NULL(return_value);
        return;
      }
#endif
      
      XapianException(code, msg);
    }
  }
  {
    Xapian::Database * resultobj = new Xapian::Database((Xapian::Database &) result);
    SWIG_SetPointerZval(return_value, (void *)resultobj, SWIGTYPE_p_Xapian__Database, 1);
  }
  /* Wrap this return value */
  {
    /* ALTERNATIVE Constructor, make an object wrapper */
    zval *obj, *_cPtr;
    MAKE_STD_ZVAL(obj);
    MAKE_STD_ZVAL(_cPtr);
    *_cPtr = *return_value;
    INIT_ZVAL(*return_value);
    object_init_ex(obj,ptr_ce_swig_XapianDatabase);
    add_property_zval(obj,"_cPtr",_cPtr);
    *return_value=*obj;
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_muscat36_open_da__SWIG_2) {
  std::string *arg1 = 0 ;
  std::string *arg2 = 0 ;
  std::string *arg3 = 0 ;
  bool arg4 ;
  Xapian::Database result;
  std::string temp1 ;
  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;
  }
  
  {
    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;
  }
  {
    convert_to_string_ex(args[2]);
    temp3.assign(Z_STRVAL_PP(args[2]), Z_STRLEN_PP(args[2]));
    arg3 = &temp3;
  }
  {
    /*@SWIG:CONVERT_BOOL_IN@*/
    convert_to_boolean_ex(args[3]);
    arg4 = (bool) Z_LVAL_PP(args[3]);
    /*@SWIG@*/;
  }
  {
    try {
      result = Xapian::Muscat36::open_da((std::string const &)*arg1,(std::string const &)*arg2,(std::string const &)*arg3,arg4);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      
#if PHP_MAJOR_VERSION-0 < 5
      if (code == SWIG_RuntimeError) {
        zend_error(E_WARNING, const_cast<char *>(msg.c_str()));
        /* FIXME: destructors don't have return_value to set. */
        // ZVAL_NULL(return_value);
        return;
      }
#endif
      
      XapianException(code, msg);
    }
  }
  {
    Xapian::Database * resultobj = new Xapian::Database((Xapian::Database &) result);
    SWIG_SetPointerZval(return_value, (void *)resultobj, SWIGTYPE_p_Xapian__Database, 1);
  }
  /* Wrap this return value */
  {
    /* ALTERNATIVE Constructor, make an object wrapper */
    zval *obj, *_cPtr;
    MAKE_STD_ZVAL(obj);
    MAKE_STD_ZVAL(_cPtr);
    *_cPtr = *return_value;
    INIT_ZVAL(*return_value);
    object_init_ex(obj,ptr_ce_swig_XapianDatabase);
    add_property_zval(obj,"_cPtr",_cPtr);
    *return_value=*obj;
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_muscat36_open_da__SWIG_3) {
  std::string *arg1 = 0 ;
  std::string *arg2 = 0 ;
  std::string *arg3 = 0 ;
  Xapian::Database result;
  std::string temp1 ;
  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;
  }
  
  {
    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;
  }
  {
    convert_to_string_ex(args[2]);
    temp3.assign(Z_STRVAL_PP(args[2]), Z_STRLEN_PP(args[2]));
    arg3 = &temp3;
  }
  {
    try {
      result = Xapian::Muscat36::open_da((std::string const &)*arg1,(std::string const &)*arg2,(std::string const &)*arg3);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      
#if PHP_MAJOR_VERSION-0 < 5
      if (code == SWIG_RuntimeError) {
        zend_error(E_WARNING, const_cast<char *>(msg.c_str()));
        /* FIXME: destructors don't have return_value to set. */
        // ZVAL_NULL(return_value);
        return;
      }
#endif
      
      XapianException(code, msg);
    }
  }
  {
    Xapian::Database * resultobj = new Xapian::Database((Xapian::Database &) result);
    SWIG_SetPointerZval(return_value, (void *)resultobj, SWIGTYPE_p_Xapian__Database, 1);
  }
  /* Wrap this return value */
  {
    /* ALTERNATIVE Constructor, make an object wrapper */
    zval *obj, *_cPtr;
    MAKE_STD_ZVAL(obj);
    MAKE_STD_ZVAL(_cPtr);
    *_cPtr = *return_value;
    INIT_ZVAL(*return_value);
    object_init_ex(obj,ptr_ce_swig_XapianDatabase);
    add_property_zval(obj,"_cPtr",_cPtr);
    *return_value=*obj;
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_muscat36_open_da) {
  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) {
        return _wrap_muscat36_open_da__SWIG_1(INTERNAL_FUNCTION_PARAM_PASSTHRU);
      }
    }
  }
  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_STRING);
        }
        if (_v) {
          return _wrap_muscat36_open_da__SWIG_3(INTERNAL_FUNCTION_PARAM_PASSTHRU);
        }
      }
    }
  }
  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_BOOL || Z_TYPE_PP(argv[2]) == IS_LONG);
        }
        if (_v) {
          return _wrap_muscat36_open_da__SWIG_0(INTERNAL_FUNCTION_PARAM_PASSTHRU);
        }
      }
    }
  }
  if (argc == 4) {
    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_STRING);
        }
        if (_v) {
          {
            _v = (Z_TYPE_PP(argv[3]) == IS_BOOL || Z_TYPE_PP(argv[3]) == IS_LONG);
          }
          if (_v) {
            return _wrap_muscat36_open_da__SWIG_2(INTERNAL_FUNCTION_PARAM_PASSTHRU);
          }
        }
      }
    }
  }
  
  SWIG_ErrorCode() = E_ERROR;
  SWIG_ErrorMsg() = "No matching function for overloaded 'muscat36_open_da'";
  zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_muscat36_open_db__SWIG_0) {
  std::string *arg1 = 0 ;
  size_t arg2 ;
  Xapian::Database result;
  std::string temp1 ;
  zval **args[2];
  
  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:CONVERT_INT_IN@*/
    convert_to_long_ex(args[1]);
    arg2 = (size_t) Z_LVAL_PP(args[1]);
    /*@SWIG@*/;
  }
  {
    try {
      result = Xapian::Muscat36::open_db((std::string const &)*arg1,arg2);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      
#if PHP_MAJOR_VERSION-0 < 5
      if (code == SWIG_RuntimeError) {
        zend_error(E_WARNING, const_cast<char *>(msg.c_str()));
        /* FIXME: destructors don't have return_value to set. */
        // ZVAL_NULL(return_value);
        return;
      }
#endif
      
      XapianException(code, msg);
    }
  }
  {
    Xapian::Database * resultobj = new Xapian::Database((Xapian::Database &) result);
    SWIG_SetPointerZval(return_value, (void *)resultobj, SWIGTYPE_p_Xapian__Database, 1);
  }
  /* Wrap this return value */
  {
    /* ALTERNATIVE Constructor, make an object wrapper */
    zval *obj, *_cPtr;
    MAKE_STD_ZVAL(obj);
    MAKE_STD_ZVAL(_cPtr);
    *_cPtr = *return_value;
    INIT_ZVAL(*return_value);
    object_init_ex(obj,ptr_ce_swig_XapianDatabase);
    add_property_zval(obj,"_cPtr",_cPtr);
    *return_value=*obj;
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_muscat36_open_db__SWIG_1) {
  std::string *arg1 = 0 ;
  Xapian::Database result;
  std::string temp1 ;
  zval **args[1];
  
  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::Muscat36::open_db((std::string const &)*arg1);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      
#if PHP_MAJOR_VERSION-0 < 5
      if (code == SWIG_RuntimeError) {
        zend_error(E_WARNING, const_cast<char *>(msg.c_str()));
        /* FIXME: destructors don't have return_value to set. */
        // ZVAL_NULL(return_value);
        return;
      }
#endif
      
      XapianException(code, msg);
    }
  }
  {
    Xapian::Database * resultobj = new Xapian::Database((Xapian::Database &) result);
    SWIG_SetPointerZval(return_value, (void *)resultobj, SWIGTYPE_p_Xapian__Database, 1);
  }
  /* Wrap this return value */
  {
    /* ALTERNATIVE Constructor, make an object wrapper */
    zval *obj, *_cPtr;
    MAKE_STD_ZVAL(obj);
    MAKE_STD_ZVAL(_cPtr);
    *_cPtr = *return_value;
    INIT_ZVAL(*return_value);
    object_init_ex(obj,ptr_ce_swig_XapianDatabase);
    add_property_zval(obj,"_cPtr",_cPtr);
    *return_value=*obj;
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_muscat36_open_db__SWIG_2) {
  std::string *arg1 = 0 ;
  std::string *arg2 = 0 ;
  size_t arg3 ;
  Xapian::Database result;
  std::string temp1 ;
  std::string temp2 ;
  zval **args[3];
  
  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:CONVERT_INT_IN@*/
    convert_to_long_ex(args[2]);
    arg3 = (size_t) Z_LVAL_PP(args[2]);
    /*@SWIG@*/;
  }
  {
    try {
      result = Xapian::Muscat36::open_db((std::string const &)*arg1,(std::string const &)*arg2,arg3);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      
#if PHP_MAJOR_VERSION-0 < 5
      if (code == SWIG_RuntimeError) {
        zend_error(E_WARNING, const_cast<char *>(msg.c_str()));
        /* FIXME: destructors don't have return_value to set. */
        // ZVAL_NULL(return_value);
        return;
      }
#endif
      
      XapianException(code, msg);
    }
  }
  {
    Xapian::Database * resultobj = new Xapian::Database((Xapian::Database &) result);
    SWIG_SetPointerZval(return_value, (void *)resultobj, SWIGTYPE_p_Xapian__Database, 1);
  }
  /* Wrap this return value */
  {
    /* ALTERNATIVE Constructor, make an object wrapper */
    zval *obj, *_cPtr;
    MAKE_STD_ZVAL(obj);
    MAKE_STD_ZVAL(_cPtr);
    *_cPtr = *return_value;
    INIT_ZVAL(*return_value);
    object_init_ex(obj,ptr_ce_swig_XapianDatabase);
    add_property_zval(obj,"_cPtr",_cPtr);
    *return_value=*obj;
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_muscat36_open_db__SWIG_3) {
  std::string *arg1 = 0 ;
  std::string *arg2 = 0 ;
  Xapian::Database result;
  std::string temp1 ;
  std::string temp2 ;
  zval **args[2];
  
  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::Muscat36::open_db((std::string const &)*arg1,(std::string const &)*arg2);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      
#if PHP_MAJOR_VERSION-0 < 5
      if (code == SWIG_RuntimeError) {
        zend_error(E_WARNING, const_cast<char *>(msg.c_str()));
        /* FIXME: destructors don't have return_value to set. */
        // ZVAL_NULL(return_value);
        return;
      }
#endif
      
      XapianException(code, msg);
    }
  }
  {
    Xapian::Database * resultobj = new Xapian::Database((Xapian::Database &) result);
    SWIG_SetPointerZval(return_value, (void *)resultobj, SWIGTYPE_p_Xapian__Database, 1);
  }
  /* Wrap this return value */
  {
    /* ALTERNATIVE Constructor, make an object wrapper */
    zval *obj, *_cPtr;
    MAKE_STD_ZVAL(obj);
    MAKE_STD_ZVAL(_cPtr);
    *_cPtr = *return_value;
    INIT_ZVAL(*return_value);
    object_init_ex(obj,ptr_ce_swig_XapianDatabase);
    add_property_zval(obj,"_cPtr",_cPtr);
    *return_value=*obj;
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_muscat36_open_db) {
  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) {
      return _wrap_muscat36_open_db__SWIG_1(INTERNAL_FUNCTION_PARAM_PASSTHRU);
    }
  }
  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) {
        return _wrap_muscat36_open_db__SWIG_3(INTERNAL_FUNCTION_PARAM_PASSTHRU);
      }
    }
  }
  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) {
        return _wrap_muscat36_open_db__SWIG_0(INTERNAL_FUNCTION_PARAM_PASSTHRU);
      }
    }
  }
  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) {
          return _wrap_muscat36_open_db__SWIG_2(INTERNAL_FUNCTION_PARAM_PASSTHRU);
        }
      }
    }
  }
  
  SWIG_ErrorCode() = E_ERROR;
  SWIG_ErrorMsg() = "No matching function for overloaded 'muscat36_open_db'";
  zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_remote_open__SWIG_0) {
  std::string *arg1 = 0 ;
  unsigned int arg2 ;
  Xapian::timeout arg3 ;
  Xapian::timeout arg4 ;
  Xapian::Database result;
  std::string temp1 ;
  zval **args[4];
  
  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:CONVERT_INT_IN@*/
    convert_to_long_ex(args[1]);
    arg2 = (unsigned int) Z_LVAL_PP(args[1]);
    /*@SWIG@*/;
  }
  {
    /*@SWIG:CONVERT_INT_IN@*/
    convert_to_long_ex(args[2]);
    arg3 = (Xapian::timeout) Z_LVAL_PP(args[2]);
    /*@SWIG@*/;
  }
  {
    /*@SWIG: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 (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      
#if PHP_MAJOR_VERSION-0 < 5
      if (code == SWIG_RuntimeError) {
        zend_error(E_WARNING, const_cast<char *>(msg.c_str()));
        /* FIXME: destructors don't have return_value to set. */
        // ZVAL_NULL(return_value);
        return;
      }
#endif
      
      XapianException(code, msg);
    }
  }
  {
    Xapian::Database * resultobj = new Xapian::Database((Xapian::Database &) result);
    SWIG_SetPointerZval(return_value, (void *)resultobj, SWIGTYPE_p_Xapian__Database, 1);
  }
  /* Wrap this return value */
  {
    /* ALTERNATIVE Constructor, make an object wrapper */
    zval *obj, *_cPtr;
    MAKE_STD_ZVAL(obj);
    MAKE_STD_ZVAL(_cPtr);
    *_cPtr = *return_value;
    INIT_ZVAL(*return_value);
    object_init_ex(obj,ptr_ce_swig_XapianDatabase);
    add_property_zval(obj,"_cPtr",_cPtr);
    *return_value=*obj;
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_remote_open__SWIG_1) {
  std::string *arg1 = 0 ;
  unsigned int arg2 ;
  Xapian::timeout arg3 ;
  Xapian::Database result;
  std::string temp1 ;
  zval **args[3];
  
  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:CONVERT_INT_IN@*/
    convert_to_long_ex(args[1]);
    arg2 = (unsigned int) Z_LVAL_PP(args[1]);
    /*@SWIG@*/;
  }
  {
    /*@SWIG: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 (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      
#if PHP_MAJOR_VERSION-0 < 5
      if (code == SWIG_RuntimeError) {
        zend_error(E_WARNING, const_cast<char *>(msg.c_str()));
        /* FIXME: destructors don't have return_value to set. */
        // ZVAL_NULL(return_value);
        return;
      }
#endif
      
      XapianException(code, msg);
    }
  }
  {
    Xapian::Database * resultobj = new Xapian::Database((Xapian::Database &) result);
    SWIG_SetPointerZval(return_value, (void *)resultobj, SWIGTYPE_p_Xapian__Database, 1);
  }
  /* Wrap this return value */
  {
    /* ALTERNATIVE Constructor, make an object wrapper */
    zval *obj, *_cPtr;
    MAKE_STD_ZVAL(obj);
    MAKE_STD_ZVAL(_cPtr);
    *_cPtr = *return_value;
    INIT_ZVAL(*return_value);
    object_init_ex(obj,ptr_ce_swig_XapianDatabase);
    add_property_zval(obj,"_cPtr",_cPtr);
    *return_value=*obj;
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_remote_open__SWIG_2) {
  std::string *arg1 = 0 ;
  unsigned int arg2 ;
  Xapian::Database result;
  std::string temp1 ;
  zval **args[2];
  
  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: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 (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      
#if PHP_MAJOR_VERSION-0 < 5
      if (code == SWIG_RuntimeError) {
        zend_error(E_WARNING, const_cast<char *>(msg.c_str()));
        /* FIXME: destructors don't have return_value to set. */
        // ZVAL_NULL(return_value);
        return;
      }
#endif
      
      XapianException(code, msg);
    }
  }
  {
    Xapian::Database * resultobj = new Xapian::Database((Xapian::Database &) result);
    SWIG_SetPointerZval(return_value, (void *)resultobj, SWIGTYPE_p_Xapian__Database, 1);
  }
  /* Wrap this return value */
  {
    /* ALTERNATIVE Constructor, make an object wrapper */
    zval *obj, *_cPtr;
    MAKE_STD_ZVAL(obj);
    MAKE_STD_ZVAL(_cPtr);
    *_cPtr = *return_value;
    INIT_ZVAL(*return_value);
    object_init_ex(obj,ptr_ce_swig_XapianDatabase);
    add_property_zval(obj,"_cPtr",_cPtr);
    *return_value=*obj;
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_remote_open_writable__SWIG_0) {
  std::string *arg1 = 0 ;
  unsigned int arg2 ;
  Xapian::timeout arg3 ;
  Xapian::timeout arg4 ;
  Xapian::WritableDatabase result;
  std::string temp1 ;
  zval **args[4];
  
  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:CONVERT_INT_IN@*/
    convert_to_long_ex(args[1]);
    arg2 = (unsigned int) Z_LVAL_PP(args[1]);
    /*@SWIG@*/;
  }
  {
    /*@SWIG:CONVERT_INT_IN@*/
    convert_to_long_ex(args[2]);
    arg3 = (Xapian::timeout) Z_LVAL_PP(args[2]);
    /*@SWIG@*/;
  }
  {
    /*@SWIG: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 (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      
#if PHP_MAJOR_VERSION-0 < 5
      if (code == SWIG_RuntimeError) {
        zend_error(E_WARNING, const_cast<char *>(msg.c_str()));
        /* FIXME: destructors don't have return_value to set. */
        // ZVAL_NULL(return_value);
        return;
      }
#endif
      
      XapianException(code, msg);
    }
  }
  {
    Xapian::WritableDatabase * resultobj = new Xapian::WritableDatabase((Xapian::WritableDatabase &) result);
    SWIG_SetPointerZval(return_value, (void *)resultobj, SWIGTYPE_p_Xapian__WritableDatabase, 1);
  }
  /* Wrap this return value */
  {
    /* ALTERNATIVE Constructor, make an object wrapper */
    zval *obj, *_cPtr;
    MAKE_STD_ZVAL(obj);
    MAKE_STD_ZVAL(_cPtr);
    *_cPtr = *return_value;
    INIT_ZVAL(*return_value);
    object_init_ex(obj,ptr_ce_swig_XapianWritableDatabase);
    add_property_zval(obj,"_cPtr",_cPtr);
    *return_value=*obj;
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_remote_open_writable__SWIG_1) {
  std::string *arg1 = 0 ;
  unsigned int arg2 ;
  Xapian::timeout arg3 ;
  Xapian::WritableDatabase result;
  std::string temp1 ;
  zval **args[3];
  
  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:CONVERT_INT_IN@*/
    convert_to_long_ex(args[1]);
    arg2 = (unsigned int) Z_LVAL_PP(args[1]);
    /*@SWIG@*/;
  }
  {
    /*@SWIG: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 (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      
#if PHP_MAJOR_VERSION-0 < 5
      if (code == SWIG_RuntimeError) {
        zend_error(E_WARNING, const_cast<char *>(msg.c_str()));
        /* FIXME: destructors don't have return_value to set. */
        // ZVAL_NULL(return_value);
        return;
      }
#endif
      
      XapianException(code, msg);
    }
  }
  {
    Xapian::WritableDatabase * resultobj = new Xapian::WritableDatabase((Xapian::WritableDatabase &) result);
    SWIG_SetPointerZval(return_value, (void *)resultobj, SWIGTYPE_p_Xapian__WritableDatabase, 1);
  }
  /* Wrap this return value */
  {
    /* ALTERNATIVE Constructor, make an object wrapper */
    zval *obj, *_cPtr;
    MAKE_STD_ZVAL(obj);
    MAKE_STD_ZVAL(_cPtr);
    *_cPtr = *return_value;
    INIT_ZVAL(*return_value);
    object_init_ex(obj,ptr_ce_swig_XapianWritableDatabase);
    add_property_zval(obj,"_cPtr",_cPtr);
    *return_value=*obj;
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_remote_open_writable__SWIG_2) {
  std::string *arg1 = 0 ;
  unsigned int arg2 ;
  Xapian::WritableDatabase result;
  std::string temp1 ;
  zval **args[2];
  
  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: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 (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      
#if PHP_MAJOR_VERSION-0 < 5
      if (code == SWIG_RuntimeError) {
        zend_error(E_WARNING, const_cast<char *>(msg.c_str()));
        /* FIXME: destructors don't have return_value to set. */
        // ZVAL_NULL(return_value);
        return;
      }
#endif
      
      XapianException(code, msg);
    }
  }
  {
    Xapian::WritableDatabase * resultobj = new Xapian::WritableDatabase((Xapian::WritableDatabase &) result);
    SWIG_SetPointerZval(return_value, (void *)resultobj, SWIGTYPE_p_Xapian__WritableDatabase, 1);
  }
  /* Wrap this return value */
  {
    /* ALTERNATIVE Constructor, make an object wrapper */
    zval *obj, *_cPtr;
    MAKE_STD_ZVAL(obj);
    MAKE_STD_ZVAL(_cPtr);
    *_cPtr = *return_value;
    INIT_ZVAL(*return_value);
    object_init_ex(obj,ptr_ce_swig_XapianWritableDatabase);
    add_property_zval(obj,"_cPtr",_cPtr);
    *return_value=*obj;
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_remote_open__SWIG_3) {
  std::string *arg1 = 0 ;
  std::string *arg2 = 0 ;
  Xapian::timeout arg3 ;
  Xapian::Database result;
  std::string temp1 ;
  std::string temp2 ;
  zval **args[3];
  
  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: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 (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      
#if PHP_MAJOR_VERSION-0 < 5
      if (code == SWIG_RuntimeError) {
        zend_error(E_WARNING, const_cast<char *>(msg.c_str()));
        /* FIXME: destructors don't have return_value to set. */
        // ZVAL_NULL(return_value);
        return;
      }
#endif
      
      XapianException(code, msg);
    }
  }
  {
    Xapian::Database * resultobj = new Xapian::Database((Xapian::Database &) result);
    SWIG_SetPointerZval(return_value, (void *)resultobj, SWIGTYPE_p_Xapian__Database, 1);
  }
  /* Wrap this return value */
  {
    /* ALTERNATIVE Constructor, make an object wrapper */
    zval *obj, *_cPtr;
    MAKE_STD_ZVAL(obj);
    MAKE_STD_ZVAL(_cPtr);
    *_cPtr = *return_value;
    INIT_ZVAL(*return_value);
    object_init_ex(obj,ptr_ce_swig_XapianDatabase);
    add_property_zval(obj,"_cPtr",_cPtr);
    *return_value=*obj;
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_remote_open__SWIG_4) {
  std::string *arg1 = 0 ;
  std::string *arg2 = 0 ;
  Xapian::Database result;
  std::string temp1 ;
  std::string temp2 ;
  zval **args[2];
  
  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 (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      
#if PHP_MAJOR_VERSION-0 < 5
      if (code == SWIG_RuntimeError) {
        zend_error(E_WARNING, const_cast<char *>(msg.c_str()));
        /* FIXME: destructors don't have return_value to set. */
        // ZVAL_NULL(return_value);
        return;
      }
#endif
      
      XapianException(code, msg);
    }
  }
  {
    Xapian::Database * resultobj = new Xapian::Database((Xapian::Database &) result);
    SWIG_SetPointerZval(return_value, (void *)resultobj, SWIGTYPE_p_Xapian__Database, 1);
  }
  /* Wrap this return value */
  {
    /* ALTERNATIVE Constructor, make an object wrapper */
    zval *obj, *_cPtr;
    MAKE_STD_ZVAL(obj);
    MAKE_STD_ZVAL(_cPtr);
    *_cPtr = *return_value;
    INIT_ZVAL(*return_value);
    object_init_ex(obj,ptr_ce_swig_XapianDatabase);
    add_property_zval(obj,"_cPtr",_cPtr);
    *return_value=*obj;
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),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) {
        return _wrap_remote_open__SWIG_4(INTERNAL_FUNCTION_PARAM_PASSTHRU);
      }
    }
  }
  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) {
        return _wrap_remote_open__SWIG_2(INTERNAL_FUNCTION_PARAM_PASSTHRU);
      }
    }
  }
  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) {
          return _wrap_remote_open__SWIG_3(INTERNAL_FUNCTION_PARAM_PASSTHRU);
        }
      }
    }
  }
  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) {
          return _wrap_remote_open__SWIG_1(INTERNAL_FUNCTION_PARAM_PASSTHRU);
        }
      }
    }
  }
  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) {
            return _wrap_remote_open__SWIG_0(INTERNAL_FUNCTION_PARAM_PASSTHRU);
          }
        }
      }
    }
  }
  
  SWIG_ErrorCode() = E_ERROR;
  SWIG_ErrorMsg() = "No matching function for overloaded 'remote_open'";
  zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_remote_open_writable__SWIG_3) {
  std::string *arg1 = 0 ;
  std::string *arg2 = 0 ;
  Xapian::timeout arg3 ;
  Xapian::WritableDatabase result;
  std::string temp1 ;
  std::string temp2 ;
  zval **args[3];
  
  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: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 (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      
#if PHP_MAJOR_VERSION-0 < 5
      if (code == SWIG_RuntimeError) {
        zend_error(E_WARNING, const_cast<char *>(msg.c_str()));
        /* FIXME: destructors don't have return_value to set. */
        // ZVAL_NULL(return_value);
        return;
      }
#endif
      
      XapianException(code, msg);
    }
  }
  {
    Xapian::WritableDatabase * resultobj = new Xapian::WritableDatabase((Xapian::WritableDatabase &) result);
    SWIG_SetPointerZval(return_value, (void *)resultobj, SWIGTYPE_p_Xapian__WritableDatabase, 1);
  }
  /* Wrap this return value */
  {
    /* ALTERNATIVE Constructor, make an object wrapper */
    zval *obj, *_cPtr;
    MAKE_STD_ZVAL(obj);
    MAKE_STD_ZVAL(_cPtr);
    *_cPtr = *return_value;
    INIT_ZVAL(*return_value);
    object_init_ex(obj,ptr_ce_swig_XapianWritableDatabase);
    add_property_zval(obj,"_cPtr",_cPtr);
    *return_value=*obj;
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_remote_open_writable__SWIG_4) {
  std::string *arg1 = 0 ;
  std::string *arg2 = 0 ;
  Xapian::WritableDatabase result;
  std::string temp1 ;
  std::string temp2 ;
  zval **args[2];
  
  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 (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      
#if PHP_MAJOR_VERSION-0 < 5
      if (code == SWIG_RuntimeError) {
        zend_error(E_WARNING, const_cast<char *>(msg.c_str()));
        /* FIXME: destructors don't have return_value to set. */
        // ZVAL_NULL(return_value);
        return;
      }
#endif
      
      XapianException(code, msg);
    }
  }
  {
    Xapian::WritableDatabase * resultobj = new Xapian::WritableDatabase((Xapian::WritableDatabase &) result);
    SWIG_SetPointerZval(return_value, (void *)resultobj, SWIGTYPE_p_Xapian__WritableDatabase, 1);
  }
  /* Wrap this return value */
  {
    /* ALTERNATIVE Constructor, make an object wrapper */
    zval *obj, *_cPtr;
    MAKE_STD_ZVAL(obj);
    MAKE_STD_ZVAL(_cPtr);
    *_cPtr = *return_value;
    INIT_ZVAL(*return_value);
    object_init_ex(obj,ptr_ce_swig_XapianWritableDatabase);
    add_property_zval(obj,"_cPtr",_cPtr);
    *return_value=*obj;
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),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) {
        return _wrap_remote_open_writable__SWIG_4(INTERNAL_FUNCTION_PARAM_PASSTHRU);
      }
    }
  }
  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) {
        return _wrap_remote_open_writable__SWIG_2(INTERNAL_FUNCTION_PARAM_PASSTHRU);
      }
    }
  }
  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) {
          return _wrap_remote_open_writable__SWIG_3(INTERNAL_FUNCTION_PARAM_PASSTHRU);
        }
      }
    }
  }
  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) {
          return _wrap_remote_open_writable__SWIG_1(INTERNAL_FUNCTION_PARAM_PASSTHRU);
        }
      }
    }
  }
  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) {
            return _wrap_remote_open_writable__SWIG_0(INTERNAL_FUNCTION_PARAM_PASSTHRU);
          }
        }
      }
    }
  }
  
  SWIG_ErrorCode() = E_ERROR;
  SWIG_ErrorMsg() = "No matching function for overloaded 'remote_open_writable'";
  zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_new_XapianQuery__SWIG_0) {
  std::string *arg1 = 0 ;
  Xapian::termcount arg2 ;
  Xapian::termpos arg3 ;
  Xapian::Query *result = 0 ;
  std::string temp1 ;
  zval **args[3];
  
  SWIG_ResetError();
  /* NATIVE Constructor */
  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:CONVERT_INT_IN@*/
    convert_to_long_ex(args[1]);
    arg2 = (Xapian::termcount) Z_LVAL_PP(args[1]);
    /*@SWIG@*/;
  }
  {
    /*@SWIG: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 (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      
#if PHP_MAJOR_VERSION-0 < 5
      if (code == SWIG_RuntimeError) {
        zend_error(E_WARNING, const_cast<char *>(msg.c_str()));
        /* FIXME: destructors don't have return_value to set. */
        // ZVAL_NULL(return_value);
        return;
      }
#endif
      
      XapianException(code, msg);
    }
  }
  {
    SWIG_SetPointerZval(return_value, (void *)result, SWIGTYPE_p_Xapian__Query, 1);
  }
  /* Wrap this return value */
  if (this_ptr) {
    /* NATIVE Constructor, use this_ptr */
    zval *_cPtr; MAKE_STD_ZVAL(_cPtr);
    *_cPtr = *return_value;
    INIT_ZVAL(*return_value);
    add_property_zval(this_ptr,"_cPtr",_cPtr);
  } else if (! this_ptr) {
    /* ALTERNATIVE Constructor, make an object wrapper */
    zval *obj, *_cPtr;
    MAKE_STD_ZVAL(obj);
    MAKE_STD_ZVAL(_cPtr);
    *_cPtr = *return_value;
    INIT_ZVAL(*return_value);
    object_init_ex(obj,ptr_ce_swig_XapianQuery);
    add_property_zval(obj,"_cPtr",_cPtr);
    *return_value=*obj;
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_new_XapianQuery__SWIG_1) {
  std::string *arg1 = 0 ;
  Xapian::termcount arg2 ;
  Xapian::Query *result = 0 ;
  std::string temp1 ;
  zval **args[2];
  
  SWIG_ResetError();
  /* NATIVE Constructor */
  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: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 (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      
#if PHP_MAJOR_VERSION-0 < 5
      if (code == SWIG_RuntimeError) {
        zend_error(E_WARNING, const_cast<char *>(msg.c_str()));
        /* FIXME: destructors don't have return_value to set. */
        // ZVAL_NULL(return_value);
        return;
      }
#endif
      
      XapianException(code, msg);
    }
  }
  {
    SWIG_SetPointerZval(return_value, (void *)result, SWIGTYPE_p_Xapian__Query, 1);
  }
  /* Wrap this return value */
  if (this_ptr) {
    /* NATIVE Constructor, use this_ptr */
    zval *_cPtr; MAKE_STD_ZVAL(_cPtr);
    *_cPtr = *return_value;
    INIT_ZVAL(*return_value);
    add_property_zval(this_ptr,"_cPtr",_cPtr);
  } else if (! this_ptr) {
    /* ALTERNATIVE Constructor, make an object wrapper */
    zval *obj, *_cPtr;
    MAKE_STD_ZVAL(obj);
    MAKE_STD_ZVAL(_cPtr);
    *_cPtr = *return_value;
    INIT_ZVAL(*return_value);
    object_init_ex(obj,ptr_ce_swig_XapianQuery);
    add_property_zval(obj,"_cPtr",_cPtr);
    *return_value=*obj;
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_new_XapianQuery__SWIG_2) {
  std::string *arg1 = 0 ;
  Xapian::Query *result = 0 ;
  std::string temp1 ;
  zval **args[1];
  
  SWIG_ResetError();
  /* NATIVE Constructor */
  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 (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      
#if PHP_MAJOR_VERSION-0 < 5
      if (code == SWIG_RuntimeError) {
        zend_error(E_WARNING, const_cast<char *>(msg.c_str()));
        /* FIXME: destructors don't have return_value to set. */
        // ZVAL_NULL(return_value);
        return;
      }
#endif
      
      XapianException(code, msg);
    }
  }
  {
    SWIG_SetPointerZval(return_value, (void *)result, SWIGTYPE_p_Xapian__Query, 1);
  }
  /* Wrap this return value */
  if (this_ptr) {
    /* NATIVE Constructor, use this_ptr */
    zval *_cPtr; MAKE_STD_ZVAL(_cPtr);
    *_cPtr = *return_value;
    INIT_ZVAL(*return_value);
    add_property_zval(this_ptr,"_cPtr",_cPtr);
  } else if (! this_ptr) {
    /* ALTERNATIVE Constructor, make an object wrapper */
    zval *obj, *_cPtr;
    MAKE_STD_ZVAL(obj);
    MAKE_STD_ZVAL(_cPtr);
    *_cPtr = *return_value;
    INIT_ZVAL(*return_value);
    object_init_ex(obj,ptr_ce_swig_XapianQuery);
    add_property_zval(obj,"_cPtr",_cPtr);
    *return_value=*obj;
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_new_XapianQuery__SWIG_3) {
  Xapian::Query::op arg1 ;
  Xapian::Query *arg2 = 0 ;
  Xapian::Query *arg3 = 0 ;
  Xapian::Query *result = 0 ;
  zval **args[3];
  
  SWIG_ResetError();
  /* NATIVE Constructor */
  if(ZEND_NUM_ARGS() != 3 || zend_get_parameters_array_ex(3, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    /*@SWIG: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_XapianQuery. 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_XapianQuery. Expected SWIGTYPE_p_Xapian__Query");
    }
  }
  {
    try {
      result = (Xapian::Query *)new Xapian::Query(arg1,(Xapian::Query const &)*arg2,(Xapian::Query const &)*arg3);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      
#if PHP_MAJOR_VERSION-0 < 5
      if (code == SWIG_RuntimeError) {
        zend_error(E_WARNING, const_cast<char *>(msg.c_str()));
        /* FIXME: destructors don't have return_value to set. */
        // ZVAL_NULL(return_value);
        return;
      }
#endif
      
      XapianException(code, msg);
    }
  }
  {
    SWIG_SetPointerZval(return_value, (void *)result, SWIGTYPE_p_Xapian__Query, 1);
  }
  /* Wrap this return value */
  if (this_ptr) {
    /* NATIVE Constructor, use this_ptr */
    zval *_cPtr; MAKE_STD_ZVAL(_cPtr);
    *_cPtr = *return_value;
    INIT_ZVAL(*return_value);
    add_property_zval(this_ptr,"_cPtr",_cPtr);
  } else if (! this_ptr) {
    /* ALTERNATIVE Constructor, make an object wrapper */
    zval *obj, *_cPtr;
    MAKE_STD_ZVAL(obj);
    MAKE_STD_ZVAL(_cPtr);
    *_cPtr = *return_value;
    INIT_ZVAL(*return_value);
    object_init_ex(obj,ptr_ce_swig_XapianQuery);
    add_property_zval(obj,"_cPtr",_cPtr);
    *return_value=*obj;
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_new_XapianQuery__SWIG_4) {
  Xapian::Query::op arg1 ;
  std::string *arg2 = 0 ;
  std::string *arg3 = 0 ;
  Xapian::Query *result = 0 ;
  std::string temp2 ;
  std::string temp3 ;
  zval **args[3];
  
  SWIG_ResetError();
  /* NATIVE Constructor */
  if(ZEND_NUM_ARGS() != 3 || zend_get_parameters_array_ex(3, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    /*@SWIG: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 (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      
#if PHP_MAJOR_VERSION-0 < 5
      if (code == SWIG_RuntimeError) {
        zend_error(E_WARNING, const_cast<char *>(msg.c_str()));
        /* FIXME: destructors don't have return_value to set. */
        // ZVAL_NULL(return_value);
        return;
      }
#endif
      
      XapianException(code, msg);
    }
  }
  {
    SWIG_SetPointerZval(return_value, (void *)result, SWIGTYPE_p_Xapian__Query, 1);
  }
  /* Wrap this return value */
  if (this_ptr) {
    /* NATIVE Constructor, use this_ptr */
    zval *_cPtr; MAKE_STD_ZVAL(_cPtr);
    *_cPtr = *return_value;
    INIT_ZVAL(*return_value);
    add_property_zval(this_ptr,"_cPtr",_cPtr);
  } else if (! this_ptr) {
    /* ALTERNATIVE Constructor, make an object wrapper */
    zval *obj, *_cPtr;
    MAKE_STD_ZVAL(obj);
    MAKE_STD_ZVAL(_cPtr);
    *_cPtr = *return_value;
    INIT_ZVAL(*return_value);
    object_init_ex(obj,ptr_ce_swig_XapianQuery);
    add_property_zval(obj,"_cPtr",_cPtr);
    *return_value=*obj;
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_new_XapianQuery__SWIG_5) {
  Xapian::Query *arg1 = 0 ;
  Xapian::Query *result = 0 ;
  zval **args[1];
  
  SWIG_ResetError();
  /* NATIVE Constructor */
  if(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_XapianQuery. Expected SWIGTYPE_p_Xapian__Query");
    }
  }
  {
    try {
      result = (Xapian::Query *)new Xapian::Query((Xapian::Query const &)*arg1);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      
#if PHP_MAJOR_VERSION-0 < 5
      if (code == SWIG_RuntimeError) {
        zend_error(E_WARNING, const_cast<char *>(msg.c_str()));
        /* FIXME: destructors don't have return_value to set. */
        // ZVAL_NULL(return_value);
        return;
      }
#endif
      
      XapianException(code, msg);
    }
  }
  {
    SWIG_SetPointerZval(return_value, (void *)result, SWIGTYPE_p_Xapian__Query, 1);
  }
  /* Wrap this return value */
  if (this_ptr) {
    /* NATIVE Constructor, use this_ptr */
    zval *_cPtr; MAKE_STD_ZVAL(_cPtr);
    *_cPtr = *return_value;
    INIT_ZVAL(*return_value);
    add_property_zval(this_ptr,"_cPtr",_cPtr);
  } else if (! this_ptr) {
    /* ALTERNATIVE Constructor, make an object wrapper */
    zval *obj, *_cPtr;
    MAKE_STD_ZVAL(obj);
    MAKE_STD_ZVAL(_cPtr);
    *_cPtr = *return_value;
    INIT_ZVAL(*return_value);
    object_init_ex(obj,ptr_ce_swig_XapianQuery);
    add_property_zval(obj,"_cPtr",_cPtr);
    *return_value=*obj;
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_new_XapianQuery__SWIG_6) {
  Xapian::Query::op arg1 ;
  std::vector<Xapian::Query > *arg2 = 0 ;
  Xapian::termcount arg3 ;
  Xapian::Query *result = 0 ;
  vector<Xapian::Query > v2 ;
  zval **args[3];
  
  SWIG_ResetError();
  /* NATIVE Constructor */
  if(ZEND_NUM_ARGS() != 3 || zend_get_parameters_array_ex(3, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    /*@SWIG: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: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_6(arg1,(std::vector<Xapian::Query > const &)*arg2,arg3);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      
#if PHP_MAJOR_VERSION-0 < 5
      if (code == SWIG_RuntimeError) {
        zend_error(E_WARNING, const_cast<char *>(msg.c_str()));
        /* FIXME: destructors don't have return_value to set. */
        // ZVAL_NULL(return_value);
        return;
      }
#endif
      
      XapianException(code, msg);
    }
  }
  {
    SWIG_SetPointerZval(return_value, (void *)result, SWIGTYPE_p_Xapian__Query, 1);
  }
  /* Wrap this return value */
  if (this_ptr) {
    /* NATIVE Constructor, use this_ptr */
    zval *_cPtr; MAKE_STD_ZVAL(_cPtr);
    *_cPtr = *return_value;
    INIT_ZVAL(*return_value);
    add_property_zval(this_ptr,"_cPtr",_cPtr);
  } else if (! this_ptr) {
    /* ALTERNATIVE Constructor, make an object wrapper */
    zval *obj, *_cPtr;
    MAKE_STD_ZVAL(obj);
    MAKE_STD_ZVAL(_cPtr);
    *_cPtr = *return_value;
    INIT_ZVAL(*return_value);
    object_init_ex(obj,ptr_ce_swig_XapianQuery);
    add_property_zval(obj,"_cPtr",_cPtr);
    *return_value=*obj;
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_new_XapianQuery__SWIG_7) {
  Xapian::Query::op arg1 ;
  std::vector<Xapian::Query > *arg2 = 0 ;
  Xapian::Query *result = 0 ;
  vector<Xapian::Query > v2 ;
  zval **args[2];
  
  SWIG_ResetError();
  /* NATIVE Constructor */
  if(ZEND_NUM_ARGS() != 2 || zend_get_parameters_array_ex(2, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    /*@SWIG: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_6(arg1,(std::vector<Xapian::Query > const &)*arg2);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      
#if PHP_MAJOR_VERSION-0 < 5
      if (code == SWIG_RuntimeError) {
        zend_error(E_WARNING, const_cast<char *>(msg.c_str()));
        /* FIXME: destructors don't have return_value to set. */
        // ZVAL_NULL(return_value);
        return;
      }
#endif
      
      XapianException(code, msg);
    }
  }
  {
    SWIG_SetPointerZval(return_value, (void *)result, SWIGTYPE_p_Xapian__Query, 1);
  }
  /* Wrap this return value */
  if (this_ptr) {
    /* NATIVE Constructor, use this_ptr */
    zval *_cPtr; MAKE_STD_ZVAL(_cPtr);
    *_cPtr = *return_value;
    INIT_ZVAL(*return_value);
    add_property_zval(this_ptr,"_cPtr",_cPtr);
  } else if (! this_ptr) {
    /* ALTERNATIVE Constructor, make an object wrapper */
    zval *obj, *_cPtr;
    MAKE_STD_ZVAL(obj);
    MAKE_STD_ZVAL(_cPtr);
    *_cPtr = *return_value;
    INIT_ZVAL(*return_value);
    object_init_ex(obj,ptr_ce_swig_XapianQuery);
    add_property_zval(obj,"_cPtr",_cPtr);
    *return_value=*obj;
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_new_XapianQuery__SWIG_8) {
  Xapian::Query::op arg1 ;
  Xapian::Query arg2 ;
  Xapian::Query *result = 0 ;
  Xapian::Query *tmp2 ;
  zval **args[2];
  
  SWIG_ResetError();
  /* NATIVE Constructor */
  if(ZEND_NUM_ARGS() != 2 || zend_get_parameters_array_ex(2, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    /*@SWIG: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_XapianQuery. Expected SWIGTYPE_p_Xapian__Query");
    }
    arg2 = *tmp2;
  }
  {
    try {
      result = (Xapian::Query *)new Xapian::Query(arg1,arg2);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      
#if PHP_MAJOR_VERSION-0 < 5
      if (code == SWIG_RuntimeError) {
        zend_error(E_WARNING, const_cast<char *>(msg.c_str()));
        /* FIXME: destructors don't have return_value to set. */
        // ZVAL_NULL(return_value);
        return;
      }
#endif
      
      XapianException(code, msg);
    }
  }
  {
    SWIG_SetPointerZval(return_value, (void *)result, SWIGTYPE_p_Xapian__Query, 1);
  }
  /* Wrap this return value */
  if (this_ptr) {
    /* NATIVE Constructor, use this_ptr */
    zval *_cPtr; MAKE_STD_ZVAL(_cPtr);
    *_cPtr = *return_value;
    INIT_ZVAL(*return_value);
    add_property_zval(this_ptr,"_cPtr",_cPtr);
  } else if (! this_ptr) {
    /* ALTERNATIVE Constructor, make an object wrapper */
    zval *obj, *_cPtr;
    MAKE_STD_ZVAL(obj);
    MAKE_STD_ZVAL(_cPtr);
    *_cPtr = *return_value;
    INIT_ZVAL(*return_value);
    object_init_ex(obj,ptr_ce_swig_XapianQuery);
    add_property_zval(obj,"_cPtr",_cPtr);
    *return_value=*obj;
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_new_XapianQuery__SWIG_9) {
  Xapian::Query *result = 0 ;
  
  SWIG_ResetError();
  /* NATIVE Constructor */
  if(ZEND_NUM_ARGS() != 0) {
    WRONG_PARAM_COUNT;
  }
  
  {
    try {
      result = (Xapian::Query *)new Xapian::Query();
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      
#if PHP_MAJOR_VERSION-0 < 5
      if (code == SWIG_RuntimeError) {
        zend_error(E_WARNING, const_cast<char *>(msg.c_str()));
        /* FIXME: destructors don't have return_value to set. */
        // ZVAL_NULL(return_value);
        return;
      }
#endif
      
      XapianException(code, msg);
    }
  }
  {
    SWIG_SetPointerZval(return_value, (void *)result, SWIGTYPE_p_Xapian__Query, 1);
  }
  /* Wrap this return value */
  if (this_ptr) {
    /* NATIVE Constructor, use this_ptr */
    zval *_cPtr; MAKE_STD_ZVAL(_cPtr);
    *_cPtr = *return_value;
    INIT_ZVAL(*return_value);
    add_property_zval(this_ptr,"_cPtr",_cPtr);
  } else if (! this_ptr) {
    /* ALTERNATIVE Constructor, make an object wrapper */
    zval *obj, *_cPtr;
    MAKE_STD_ZVAL(obj);
    MAKE_STD_ZVAL(_cPtr);
    *_cPtr = *return_value;
    INIT_ZVAL(*return_value);
    object_init_ex(obj,ptr_ce_swig_XapianQuery);
    add_property_zval(obj,"_cPtr",_cPtr);
    *return_value=*obj;
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_new_XapianQuery) {
  int argc;
  zval **argv[3];
  
  argc = ZEND_NUM_ARGS();
  zend_get_parameters_array_ex(argc,argv);
  if (argc == 0) {
    return _wrap_new_XapianQuery__SWIG_9(INTERNAL_FUNCTION_PARAM_PASSTHRU);
  }
  if (argc == 1) {
    int _v;
    {
      void *ptr;
      _v = (SWIG_ConvertPtr(*argv[0], (void **)&ptr, SWIGTYPE_p_Xapian__Query, 0) == 0);
    }
    if (_v) {
      return _wrap_new_XapianQuery__SWIG_5(INTERNAL_FUNCTION_PARAM_PASSTHRU);
    }
  }
  if (argc == 1) {
    int _v;
    {
      _v = (Z_TYPE_PP(argv[0]) == IS_STRING);
    }
    if (_v) {
      return _wrap_new_XapianQuery__SWIG_2(INTERNAL_FUNCTION_PARAM_PASSTHRU);
    }
  }
  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) {
        return _wrap_new_XapianQuery__SWIG_1(INTERNAL_FUNCTION_PARAM_PASSTHRU);
      }
    }
  }
  if (argc == 2) {
    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) {
        return _wrap_new_XapianQuery__SWIG_8(INTERNAL_FUNCTION_PARAM_PASSTHRU);
      }
    }
  }
  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) {
        return _wrap_new_XapianQuery__SWIG_7(INTERNAL_FUNCTION_PARAM_PASSTHRU);
      }
    }
  }
  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) {
          return _wrap_new_XapianQuery__SWIG_0(INTERNAL_FUNCTION_PARAM_PASSTHRU);
        }
      }
    }
  }
  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) {
          return _wrap_new_XapianQuery__SWIG_3(INTERNAL_FUNCTION_PARAM_PASSTHRU);
        }
      }
    }
  }
  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) {
          return _wrap_new_XapianQuery__SWIG_4(INTERNAL_FUNCTION_PARAM_PASSTHRU);
        }
      }
    }
  }
  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) {
          return _wrap_new_XapianQuery__SWIG_6(INTERNAL_FUNCTION_PARAM_PASSTHRU);
        }
      }
    }
  }
  
  SWIG_ErrorCode() = E_ERROR;
  SWIG_ErrorMsg() = "No matching function for overloaded 'new_XapianQuery'";
  zend_error(SWIG_ErrorCode(),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_XapianQuery(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 (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      
#if PHP_MAJOR_VERSION-0 < 5
      if (code == SWIG_RuntimeError) {
        zend_error(E_WARNING, const_cast<char *>(msg.c_str()));
        /* FIXME: destructors don't have return_value to set. */
        // ZVAL_NULL(return_value);
        return;
      }
#endif
      
      XapianException(code, msg);
    }
  }
}


ZEND_NAMED_FUNCTION(_wrap_XapianQuery_get_length) {
  Xapian::Query *arg1 = (Xapian::Query *) 0 ;
  Xapian::termcount result;
  
  SWIG_ResetError();
  /* This function uses a this_ptr*/
  if(ZEND_NUM_ARGS() != 0) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*&this_ptr, (void **) &arg1, SWIGTYPE_p_Xapian__Query, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of XapianQuery_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 (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      
#if PHP_MAJOR_VERSION-0 < 5
      if (code == SWIG_RuntimeError) {
        zend_error(E_WARNING, const_cast<char *>(msg.c_str()));
        /* FIXME: destructors don't have return_value to set. */
        // ZVAL_NULL(return_value);
        return;
      }
#endif
      
      XapianException(code, msg);
    }
  }
  {
    ZVAL_LONG(return_value,result);
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_XapianQuery_get_terms_begin) {
  Xapian::Query *arg1 = (Xapian::Query *) 0 ;
  Xapian::TermIterator result;
  
  SWIG_ResetError();
  /* This function uses a this_ptr*/
  if(ZEND_NUM_ARGS() != 0) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*&this_ptr, (void **) &arg1, SWIGTYPE_p_Xapian__Query, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of XapianQuery_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 (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      
#if PHP_MAJOR_VERSION-0 < 5
      if (code == SWIG_RuntimeError) {
        zend_error(E_WARNING, const_cast<char *>(msg.c_str()));
        /* FIXME: destructors don't have return_value to set. */
        // ZVAL_NULL(return_value);
        return;
      }
#endif
      
      XapianException(code, msg);
    }
  }
  {
    Xapian::TermIterator * resultobj = new Xapian::TermIterator((Xapian::TermIterator &) result);
    SWIG_SetPointerZval(return_value, (void *)resultobj, SWIGTYPE_p_Xapian__TermIterator, 1);
  }
  /* Wrap this return value */
  {
    /* ALTERNATIVE Constructor, make an object wrapper */
    zval *obj, *_cPtr;
    MAKE_STD_ZVAL(obj);
    MAKE_STD_ZVAL(_cPtr);
    *_cPtr = *return_value;
    INIT_ZVAL(*return_value);
    object_init_ex(obj,ptr_ce_swig_XapianTermIterator);
    add_property_zval(obj,"_cPtr",_cPtr);
    *return_value=*obj;
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_XapianQuery_get_terms_end) {
  Xapian::Query *arg1 = (Xapian::Query *) 0 ;
  Xapian::TermIterator result;
  
  SWIG_ResetError();
  /* This function uses a this_ptr*/
  if(ZEND_NUM_ARGS() != 0) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*&this_ptr, (void **) &arg1, SWIGTYPE_p_Xapian__Query, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of XapianQuery_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 (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      
#if PHP_MAJOR_VERSION-0 < 5
      if (code == SWIG_RuntimeError) {
        zend_error(E_WARNING, const_cast<char *>(msg.c_str()));
        /* FIXME: destructors don't have return_value to set. */
        // ZVAL_NULL(return_value);
        return;
      }
#endif
      
      XapianException(code, msg);
    }
  }
  {
    Xapian::TermIterator * resultobj = new Xapian::TermIterator((Xapian::TermIterator &) result);
    SWIG_SetPointerZval(return_value, (void *)resultobj, SWIGTYPE_p_Xapian__TermIterator, 1);
  }
  /* Wrap this return value */
  {
    /* ALTERNATIVE Constructor, make an object wrapper */
    zval *obj, *_cPtr;
    MAKE_STD_ZVAL(obj);
    MAKE_STD_ZVAL(_cPtr);
    *_cPtr = *return_value;
    INIT_ZVAL(*return_value);
    object_init_ex(obj,ptr_ce_swig_XapianTermIterator);
    add_property_zval(obj,"_cPtr",_cPtr);
    *return_value=*obj;
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_XapianQuery_empty) {
  Xapian::Query *arg1 = (Xapian::Query *) 0 ;
  bool result;
  
  SWIG_ResetError();
  /* This function uses a this_ptr*/
  if(ZEND_NUM_ARGS() != 0) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*&this_ptr, (void **) &arg1, SWIGTYPE_p_Xapian__Query, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of XapianQuery_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 (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      
#if PHP_MAJOR_VERSION-0 < 5
      if (code == SWIG_RuntimeError) {
        zend_error(E_WARNING, const_cast<char *>(msg.c_str()));
        /* FIXME: destructors don't have return_value to set. */
        // ZVAL_NULL(return_value);
        return;
      }
#endif
      
      XapianException(code, msg);
    }
  }
  {
    ZVAL_BOOL(return_value,(result)?1:0);
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_XapianQuery_is_empty) {
  Xapian::Query *arg1 = (Xapian::Query *) 0 ;
  bool result;
  
  SWIG_ResetError();
  /* This function uses a this_ptr*/
  if(ZEND_NUM_ARGS() != 0) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*&this_ptr, (void **) &arg1, SWIGTYPE_p_Xapian__Query, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of XapianQuery_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)->is_empty();
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      
#if PHP_MAJOR_VERSION-0 < 5
      if (code == SWIG_RuntimeError) {
        zend_error(E_WARNING, const_cast<char *>(msg.c_str()));
        /* FIXME: destructors don't have return_value to set. */
        // ZVAL_NULL(return_value);
        return;
      }
#endif
      
      XapianException(code, msg);
    }
  }
  {
    ZVAL_BOOL(return_value,(result)?1:0);
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_XapianQuery_get_description) {
  Xapian::Query *arg1 = (Xapian::Query *) 0 ;
  std::string result;
  
  SWIG_ResetError();
  /* This function uses a this_ptr*/
  if(ZEND_NUM_ARGS() != 0) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*&this_ptr, (void **) &arg1, SWIGTYPE_p_Xapian__Query, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of XapianQuery_get_description. Expected SWIGTYPE_p_Xapian__Query");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    try {
      result = (arg1)->get_description();
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      
#if PHP_MAJOR_VERSION-0 < 5
      if (code == SWIG_RuntimeError) {
        zend_error(E_WARNING, const_cast<char *>(msg.c_str()));
        /* FIXME: destructors don't have return_value to set. */
        // ZVAL_NULL(return_value);
        return;
      }
#endif
      
      XapianException(code, msg);
    }
  }
  {
    ZVAL_STRINGL(return_value,const_cast<char*>((&result)->data()),(&result)->length(),1);
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg());
}


/* property handler for class XapianQuery */
static pval _wrap_propget_XapianQuery(zend_property_reference *property_reference) {
  pval result;
  pval **_result;
  zend_llist_element *element = property_reference->elements_list->head;
  zend_overloaded_element *property=(zend_overloaded_element *)element->data;
  result.type = IS_NULL;
  if (_propget_XapianQuery(property_reference, &result)==SUCCESS) return result;
  /* return it ourselves */
  if (zend_hash_find(Z_OBJPROP_P(property_reference->object),Z_STRVAL_P(&(property->element)),1+Z_STRLEN_P(&(property->element)),(void**)&_result)==SUCCESS) {
  zval *_value;
  MAKE_STD_ZVAL(_value);  *_value=**_result;
  INIT_PZVAL(_value);
  zval_copy_ctor(_value);
  return *_value;
  }
  result.type = IS_NULL;
  return result;
}
static int _propget_XapianQuery(zend_property_reference *property_reference, pval *value) {
  /* get the property name */
  zend_llist_element *element = property_reference->elements_list->head;
  zend_overloaded_element *property=(zend_overloaded_element *)element->data;
  char *propname=Z_STRVAL_P(&(property->element));
  return FAILURE;
}

static int _wrap_propset_XapianQuery(zend_property_reference *property_reference, pval *value) { 
  zval * _value;
  zend_llist_element *element = property_reference->elements_list->head;
  zend_overloaded_element *property=(zend_overloaded_element *)element->data;
  if (_propset_XapianQuery(property_reference, value)==SUCCESS) return SUCCESS;
  /* set it ourselves as it is XapianQuery */
  MAKE_STD_ZVAL(_value);
  *_value=*value;
  INIT_PZVAL(_value);
  zval_copy_ctor(_value);
  return add_property_zval_ex(property_reference->object,Z_STRVAL_P(&(property->element)),1+Z_STRLEN_P(&(property->element)),_value);
}
static int _propset_XapianQuery(zend_property_reference *property_reference, pval *value) {
  /* get the property name */
  zend_llist_element *element = property_reference->elements_list->head;
  zend_overloaded_element *property=(zend_overloaded_element *)element->data;
  char *propname=Z_STRVAL_P(&(property->element));
  return FAILURE;
}

ZEND_NAMED_FUNCTION(_wrap_XapianStopper_apply) {
  Xapian::Stopper *arg1 = (Xapian::Stopper *) 0 ;
  std::string *arg2 = 0 ;
  bool result;
  std::string temp2 ;
  zval **args[1];
  
  SWIG_ResetError();
  /* This function uses a this_ptr*/
  if(ZEND_NUM_ARGS() != 1 || zend_get_parameters_array_ex(1, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*&this_ptr, (void **) &arg1, SWIGTYPE_p_Xapian__Stopper, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of XapianStopper_apply. Expected SWIGTYPE_p_Xapian__Stopper");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    convert_to_string_ex(args[0]);
    temp2.assign(Z_STRVAL_PP(args[0]), Z_STRLEN_PP(args[0]));
    arg2 = &temp2;
  }
  {
    try {
      result = (bool)((Xapian::Stopper const *)arg1)->operator ()((std::string const &)*arg2);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      
#if PHP_MAJOR_VERSION-0 < 5
      if (code == SWIG_RuntimeError) {
        zend_error(E_WARNING, const_cast<char *>(msg.c_str()));
        /* FIXME: destructors don't have return_value to set. */
        // ZVAL_NULL(return_value);
        return;
      }
#endif
      
      XapianException(code, msg);
    }
  }
  {
    ZVAL_BOOL(return_value,(result)?1:0);
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),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_XapianStopper(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 (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      
#if PHP_MAJOR_VERSION-0 < 5
      if (code == SWIG_RuntimeError) {
        zend_error(E_WARNING, const_cast<char *>(msg.c_str()));
        /* FIXME: destructors don't have return_value to set. */
        // ZVAL_NULL(return_value);
        return;
      }
#endif
      
      XapianException(code, msg);
    }
  }
}


ZEND_NAMED_FUNCTION(_wrap_XapianStopper_get_description) {
  Xapian::Stopper *arg1 = (Xapian::Stopper *) 0 ;
  std::string result;
  
  SWIG_ResetError();
  /* This function uses a this_ptr*/
  if(ZEND_NUM_ARGS() != 0) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*&this_ptr, (void **) &arg1, SWIGTYPE_p_Xapian__Stopper, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of XapianStopper_get_description. Expected SWIGTYPE_p_Xapian__Stopper");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    try {
      result = ((Xapian::Stopper const *)arg1)->get_description();
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      
#if PHP_MAJOR_VERSION-0 < 5
      if (code == SWIG_RuntimeError) {
        zend_error(E_WARNING, const_cast<char *>(msg.c_str()));
        /* FIXME: destructors don't have return_value to set. */
        // ZVAL_NULL(return_value);
        return;
      }
#endif
      
      XapianException(code, msg);
    }
  }
  {
    ZVAL_STRINGL(return_value,const_cast<char*>((&result)->data()),(&result)->length(),1);
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_new_XapianStopper) {
  zend_error(E_ERROR,"Cannot create swig object type: XapianStopper as the underlying class is abstract");
}





/* property handler for class XapianStopper */
static pval _wrap_propget_XapianStopper(zend_property_reference *property_reference) {
  pval result;
  pval **_result;
  zend_llist_element *element = property_reference->elements_list->head;
  zend_overloaded_element *property=(zend_overloaded_element *)element->data;
  result.type = IS_NULL;
  if (_propget_XapianStopper(property_reference, &result)==SUCCESS) return result;
  /* return it ourselves */
  if (zend_hash_find(Z_OBJPROP_P(property_reference->object),Z_STRVAL_P(&(property->element)),1+Z_STRLEN_P(&(property->element)),(void**)&_result)==SUCCESS) {
  zval *_value;
  MAKE_STD_ZVAL(_value);  *_value=**_result;
  INIT_PZVAL(_value);
  zval_copy_ctor(_value);
  return *_value;
  }
  result.type = IS_NULL;
  return result;
}
static int _propget_XapianStopper(zend_property_reference *property_reference, pval *value) {
  /* get the property name */
  zend_llist_element *element = property_reference->elements_list->head;
  zend_overloaded_element *property=(zend_overloaded_element *)element->data;
  char *propname=Z_STRVAL_P(&(property->element));
  return FAILURE;
}

static int _wrap_propset_XapianStopper(zend_property_reference *property_reference, pval *value) { 
  zval * _value;
  zend_llist_element *element = property_reference->elements_list->head;
  zend_overloaded_element *property=(zend_overloaded_element *)element->data;
  if (_propset_XapianStopper(property_reference, value)==SUCCESS) return SUCCESS;
  /* set it ourselves as it is XapianStopper */
  MAKE_STD_ZVAL(_value);
  *_value=*value;
  INIT_PZVAL(_value);
  zval_copy_ctor(_value);
  return add_property_zval_ex(property_reference->object,Z_STRVAL_P(&(property->element)),1+Z_STRLEN_P(&(property->element)),_value);
}
static int _propset_XapianStopper(zend_property_reference *property_reference, pval *value) {
  /* get the property name */
  zend_llist_element *element = property_reference->elements_list->head;
  zend_overloaded_element *property=(zend_overloaded_element *)element->data;
  char *propname=Z_STRVAL_P(&(property->element));
  return FAILURE;
}

ZEND_NAMED_FUNCTION(_wrap_new_XapianSimpleStopper) {
  Xapian::SimpleStopper *result = 0 ;
  
  SWIG_ResetError();
  /* NATIVE Constructor */
  if(ZEND_NUM_ARGS() != 0) {
    WRONG_PARAM_COUNT;
  }
  
  {
    try {
      result = (Xapian::SimpleStopper *)new Xapian::SimpleStopper();
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      
#if PHP_MAJOR_VERSION-0 < 5
      if (code == SWIG_RuntimeError) {
        zend_error(E_WARNING, const_cast<char *>(msg.c_str()));
        /* FIXME: destructors don't have return_value to set. */
        // ZVAL_NULL(return_value);
        return;
      }
#endif
      
      XapianException(code, msg);
    }
  }
  {
    SWIG_SetPointerZval(return_value, (void *)result, SWIGTYPE_p_Xapian__SimpleStopper, 1);
  }
  /* Wrap this return value */
  if (this_ptr) {
    /* NATIVE Constructor, use this_ptr */
    zval *_cPtr; MAKE_STD_ZVAL(_cPtr);
    *_cPtr = *return_value;
    INIT_ZVAL(*return_value);
    add_property_zval(this_ptr,"_cPtr",_cPtr);
  } else if (! this_ptr) {
    /* ALTERNATIVE Constructor, make an object wrapper */
    zval *obj, *_cPtr;
    MAKE_STD_ZVAL(obj);
    MAKE_STD_ZVAL(_cPtr);
    *_cPtr = *return_value;
    INIT_ZVAL(*return_value);
    object_init_ex(obj,ptr_ce_swig_XapianSimpleStopper);
    add_property_zval(obj,"_cPtr",_cPtr);
    *return_value=*obj;
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_XapianSimpleStopper_add) {
  Xapian::SimpleStopper *arg1 = (Xapian::SimpleStopper *) 0 ;
  std::string arg2 ;
  zval **args[1];
  
  SWIG_ResetError();
  /* This function uses a this_ptr*/
  if(ZEND_NUM_ARGS() != 1 || zend_get_parameters_array_ex(1, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*&this_ptr, (void **) &arg1, SWIGTYPE_p_Xapian__SimpleStopper, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of XapianSimpleStopper_add. Expected SWIGTYPE_p_Xapian__SimpleStopper");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    convert_to_string_ex(args[0]);
    arg2 = std::string(Z_STRVAL_PP(args[0]),Z_STRLEN_PP(args[0]));
  }
  {
    try {
      (arg1)->add(arg2);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      
#if PHP_MAJOR_VERSION-0 < 5
      if (code == SWIG_RuntimeError) {
        zend_error(E_WARNING, const_cast<char *>(msg.c_str()));
        /* FIXME: destructors don't have return_value to set. */
        // ZVAL_NULL(return_value);
        return;
      }
#endif
      
      XapianException(code, msg);
    }
  }
  
  return;
fail:
  zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_XapianSimpleStopper_apply) {
  Xapian::SimpleStopper *arg1 = (Xapian::SimpleStopper *) 0 ;
  std::string *arg2 = 0 ;
  bool result;
  std::string temp2 ;
  zval **args[1];
  
  SWIG_ResetError();
  /* This function uses a this_ptr*/
  if(ZEND_NUM_ARGS() != 1 || zend_get_parameters_array_ex(1, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*&this_ptr, (void **) &arg1, SWIGTYPE_p_Xapian__SimpleStopper, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of XapianSimpleStopper_apply. Expected SWIGTYPE_p_Xapian__SimpleStopper");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    convert_to_string_ex(args[0]);
    temp2.assign(Z_STRVAL_PP(args[0]), Z_STRLEN_PP(args[0]));
    arg2 = &temp2;
  }
  {
    try {
      result = (bool)((Xapian::SimpleStopper const *)arg1)->operator ()((std::string const &)*arg2);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      
#if PHP_MAJOR_VERSION-0 < 5
      if (code == SWIG_RuntimeError) {
        zend_error(E_WARNING, const_cast<char *>(msg.c_str()));
        /* FIXME: destructors don't have return_value to set. */
        // ZVAL_NULL(return_value);
        return;
      }
#endif
      
      XapianException(code, msg);
    }
  }
  {
    ZVAL_BOOL(return_value,(result)?1:0);
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),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_XapianSimpleStopper(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 (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      
#if PHP_MAJOR_VERSION-0 < 5
      if (code == SWIG_RuntimeError) {
        zend_error(E_WARNING, const_cast<char *>(msg.c_str()));
        /* FIXME: destructors don't have return_value to set. */
        // ZVAL_NULL(return_value);
        return;
      }
#endif
      
      XapianException(code, msg);
    }
  }
}


ZEND_NAMED_FUNCTION(_wrap_XapianSimpleStopper_get_description) {
  Xapian::SimpleStopper *arg1 = (Xapian::SimpleStopper *) 0 ;
  std::string result;
  
  SWIG_ResetError();
  /* This function uses a this_ptr*/
  if(ZEND_NUM_ARGS() != 0) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*&this_ptr, (void **) &arg1, SWIGTYPE_p_Xapian__SimpleStopper, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of XapianSimpleStopper_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 (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      
#if PHP_MAJOR_VERSION-0 < 5
      if (code == SWIG_RuntimeError) {
        zend_error(E_WARNING, const_cast<char *>(msg.c_str()));
        /* FIXME: destructors don't have return_value to set. */
        // ZVAL_NULL(return_value);
        return;
      }
#endif
      
      XapianException(code, msg);
    }
  }
  {
    ZVAL_STRINGL(return_value,const_cast<char*>((&result)->data()),(&result)->length(),1);
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg());
}


/* property handler for class XapianSimpleStopper */
static pval _wrap_propget_XapianSimpleStopper(zend_property_reference *property_reference) {
  pval result;
  pval **_result;
  zend_llist_element *element = property_reference->elements_list->head;
  zend_overloaded_element *property=(zend_overloaded_element *)element->data;
  result.type = IS_NULL;
  if (_propget_XapianSimpleStopper(property_reference, &result)==SUCCESS) return result;
  /* return it ourselves */
  if (zend_hash_find(Z_OBJPROP_P(property_reference->object),Z_STRVAL_P(&(property->element)),1+Z_STRLEN_P(&(property->element)),(void**)&_result)==SUCCESS) {
  zval *_value;
  MAKE_STD_ZVAL(_value);  *_value=**_result;
  INIT_PZVAL(_value);
  zval_copy_ctor(_value);
  return *_value;
  }
  result.type = IS_NULL;
  return result;
}
static int _propget_XapianSimpleStopper(zend_property_reference *property_reference, pval *value) {
  /* No extra properties for subclass XapianSimpleStopper */
  /* Try base class(es). */
  if (_propget_XapianStopper(property_reference, value)==SUCCESS) return SUCCESS;
  return FAILURE;
}

static int _wrap_propset_XapianSimpleStopper(zend_property_reference *property_reference, pval *value) { 
  zval * _value;
  zend_llist_element *element = property_reference->elements_list->head;
  zend_overloaded_element *property=(zend_overloaded_element *)element->data;
  if (_propset_XapianSimpleStopper(property_reference, value)==SUCCESS) return SUCCESS;
  /* set it ourselves as it is XapianSimpleStopper */
  MAKE_STD_ZVAL(_value);
  *_value=*value;
  INIT_PZVAL(_value);
  zval_copy_ctor(_value);
  return add_property_zval_ex(property_reference->object,Z_STRVAL_P(&(property->element)),1+Z_STRLEN_P(&(property->element)),_value);
}
static int _propset_XapianSimpleStopper(zend_property_reference *property_reference, pval *value) {
  /* No extra properties for subclass XapianSimpleStopper */
  /* Try base class(es) */
  if (_propset_XapianStopper(property_reference, value)==SUCCESS) return SUCCESS;
  return FAILURE;
}

ZEND_NAMED_FUNCTION(_wrap_new_XapianQueryParser) {
  Xapian::QueryParser *result = 0 ;
  
  SWIG_ResetError();
  /* NATIVE Constructor */
  if(ZEND_NUM_ARGS() != 0) {
    WRONG_PARAM_COUNT;
  }
  
  {
    try {
      result = (Xapian::QueryParser *)new Xapian::QueryParser();
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      
#if PHP_MAJOR_VERSION-0 < 5
      if (code == SWIG_RuntimeError) {
        zend_error(E_WARNING, const_cast<char *>(msg.c_str()));
        /* FIXME: destructors don't have return_value to set. */
        // ZVAL_NULL(return_value);
        return;
      }
#endif
      
      XapianException(code, msg);
    }
  }
  {
    SWIG_SetPointerZval(return_value, (void *)result, SWIGTYPE_p_Xapian__QueryParser, 1);
  }
  /* Wrap this return value */
  if (this_ptr) {
    /* NATIVE Constructor, use this_ptr */
    zval *_cPtr; MAKE_STD_ZVAL(_cPtr);
    *_cPtr = *return_value;
    INIT_ZVAL(*return_value);
    add_property_zval(this_ptr,"_cPtr",_cPtr);
  } else if (! this_ptr) {
    /* ALTERNATIVE Constructor, make an object wrapper */
    zval *obj, *_cPtr;
    MAKE_STD_ZVAL(obj);
    MAKE_STD_ZVAL(_cPtr);
    *_cPtr = *return_value;
    INIT_ZVAL(*return_value);
    object_init_ex(obj,ptr_ce_swig_XapianQueryParser);
    add_property_zval(obj,"_cPtr",_cPtr);
    *return_value=*obj;
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),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_XapianQueryParser(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 (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      
#if PHP_MAJOR_VERSION-0 < 5
      if (code == SWIG_RuntimeError) {
        zend_error(E_WARNING, const_cast<char *>(msg.c_str()));
        /* FIXME: destructors don't have return_value to set. */
        // ZVAL_NULL(return_value);
        return;
      }
#endif
      
      XapianException(code, msg);
    }
  }
}


ZEND_NAMED_FUNCTION(_wrap_XapianQueryParser_set_stemmer) {
  Xapian::QueryParser *arg1 = (Xapian::QueryParser *) 0 ;
  Xapian::Stem *arg2 = 0 ;
  zval **args[1];
  
  SWIG_ResetError();
  /* This function uses a this_ptr*/
  if(ZEND_NUM_ARGS() != 1 || zend_get_parameters_array_ex(1, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*&this_ptr, (void **) &arg1, SWIGTYPE_p_Xapian__QueryParser, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of XapianQueryParser_set_stemmer. Expected SWIGTYPE_p_Xapian__QueryParser");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    if (SWIG_ConvertPtr(*args[0], (void**)&arg2, SWIGTYPE_p_Xapian__Stem, 0) < 0 || arg2 == NULL) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 2 of XapianQueryParser_set_stemmer. Expected SWIGTYPE_p_Xapian__Stem");
    }
  }
  {
    try {
      (arg1)->set_stemmer((Xapian::Stem const &)*arg2);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      
#if PHP_MAJOR_VERSION-0 < 5
      if (code == SWIG_RuntimeError) {
        zend_error(E_WARNING, const_cast<char *>(msg.c_str()));
        /* FIXME: destructors don't have return_value to set. */
        // ZVAL_NULL(return_value);
        return;
      }
#endif
      
      XapianException(code, msg);
    }
  }
  
  return;
fail:
  zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_XapianQueryParser_set_stemming_strategy) {
  Xapian::QueryParser *arg1 = (Xapian::QueryParser *) 0 ;
  Xapian::QueryParser::stem_strategy arg2 ;
  zval **args[1];
  
  SWIG_ResetError();
  /* This function uses a this_ptr*/
  if(ZEND_NUM_ARGS() != 1 || zend_get_parameters_array_ex(1, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*&this_ptr, (void **) &arg1, SWIGTYPE_p_Xapian__QueryParser, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of XapianQueryParser_set_stemming_strategy. Expected SWIGTYPE_p_Xapian__QueryParser");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    /*@SWIG:CONVERT_INT_IN@*/
    convert_to_long_ex(args[0]);
    arg2 = (Xapian::QueryParser::stem_strategy) Z_LVAL_PP(args[0]);
    /*@SWIG@*/;
  }
  {
    try {
      (arg1)->set_stemming_strategy(arg2);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      
#if PHP_MAJOR_VERSION-0 < 5
      if (code == SWIG_RuntimeError) {
        zend_error(E_WARNING, const_cast<char *>(msg.c_str()));
        /* FIXME: destructors don't have return_value to set. */
        // ZVAL_NULL(return_value);
        return;
      }
#endif
      
      XapianException(code, msg);
    }
  }
  
  return;
fail:
  zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_XapianQueryParser_set_stopper__SWIG_0) {
  Xapian::QueryParser *arg1 = (Xapian::QueryParser *) 0 ;
  Xapian::Stopper *arg2 = (Xapian::Stopper *) 0 ;
  zval **args[1];
  
  SWIG_ResetError();
  /* This function uses a this_ptr*/
  if(ZEND_NUM_ARGS() != 1 || zend_get_parameters_array_ex(1, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*&this_ptr, (void **) &arg1, SWIGTYPE_p_Xapian__QueryParser, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of XapianQueryParser_set_stopper. Expected SWIGTYPE_p_Xapian__QueryParser");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    if(SWIG_ConvertPtr(*args[0], (void **) &arg2, SWIGTYPE_p_Xapian__Stopper, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 2 of XapianQueryParser_set_stopper. Expected SWIGTYPE_p_Xapian__Stopper");
    }
  }
  {
    try {
      (arg1)->set_stopper(arg2);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      
#if PHP_MAJOR_VERSION-0 < 5
      if (code == SWIG_RuntimeError) {
        zend_error(E_WARNING, const_cast<char *>(msg.c_str()));
        /* FIXME: destructors don't have return_value to set. */
        // ZVAL_NULL(return_value);
        return;
      }
#endif
      
      XapianException(code, msg);
    }
  }
  
  return;
fail:
  zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_XapianQueryParser_set_stopper__SWIG_1) {
  Xapian::QueryParser *arg1 = (Xapian::QueryParser *) 0 ;
  
  SWIG_ResetError();
  /* This function uses a this_ptr*/
  if(ZEND_NUM_ARGS() != 0) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*&this_ptr, (void **) &arg1, SWIGTYPE_p_Xapian__QueryParser, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of XapianQueryParser_set_stopper. Expected SWIGTYPE_p_Xapian__QueryParser");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    try {
      (arg1)->set_stopper();
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      
#if PHP_MAJOR_VERSION-0 < 5
      if (code == SWIG_RuntimeError) {
        zend_error(E_WARNING, const_cast<char *>(msg.c_str()));
        /* FIXME: destructors don't have return_value to set. */
        // ZVAL_NULL(return_value);
        return;
      }
#endif
      
      XapianException(code, msg);
    }
  }
  
  return;
fail:
  zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_XapianQueryParser_set_stopper) {
  int argc;
  zval **argv[2];
  
  argc = ZEND_NUM_ARGS();
  argv[0] = &this_ptr;
  zend_get_parameters_array_ex(argc,argv+1);
  argc++;
  if (argc == 1) {
    int _v;
    {
      void *tmp;
      _v = (SWIG_ConvertPtr( *argv[0], (void**)&tmp, SWIGTYPE_p_Xapian__QueryParser, 0) >= 0);
    }
    if (_v) {
      return _wrap_XapianQueryParser_set_stopper__SWIG_1(INTERNAL_FUNCTION_PARAM_PASSTHRU);
    }
  }
  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) {
        return _wrap_XapianQueryParser_set_stopper__SWIG_0(INTERNAL_FUNCTION_PARAM_PASSTHRU);
      }
    }
  }
  
  SWIG_ErrorCode() = E_ERROR;
  SWIG_ErrorMsg() = "No matching function for overloaded 'XapianQueryParser_set_stopper'";
  zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_XapianQueryParser_set_default_op) {
  Xapian::QueryParser *arg1 = (Xapian::QueryParser *) 0 ;
  Xapian::Query::op arg2 ;
  zval **args[1];
  
  SWIG_ResetError();
  /* This function uses a this_ptr*/
  if(ZEND_NUM_ARGS() != 1 || zend_get_parameters_array_ex(1, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*&this_ptr, (void **) &arg1, SWIGTYPE_p_Xapian__QueryParser, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of XapianQueryParser_set_default_op. Expected SWIGTYPE_p_Xapian__QueryParser");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    /*@SWIG:CONVERT_INT_IN@*/
    convert_to_long_ex(args[0]);
    arg2 = (Xapian::Query::op) Z_LVAL_PP(args[0]);
    /*@SWIG@*/;
  }
  {
    try {
      (arg1)->set_default_op(arg2);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      
#if PHP_MAJOR_VERSION-0 < 5
      if (code == SWIG_RuntimeError) {
        zend_error(E_WARNING, const_cast<char *>(msg.c_str()));
        /* FIXME: destructors don't have return_value to set. */
        // ZVAL_NULL(return_value);
        return;
      }
#endif
      
      XapianException(code, msg);
    }
  }
  
  return;
fail:
  zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_XapianQueryParser_get_default_op) {
  Xapian::QueryParser *arg1 = (Xapian::QueryParser *) 0 ;
  Xapian::Query::op result;
  
  SWIG_ResetError();
  /* This function uses a this_ptr*/
  if(ZEND_NUM_ARGS() != 0) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*&this_ptr, (void **) &arg1, SWIGTYPE_p_Xapian__QueryParser, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of XapianQueryParser_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 (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      
#if PHP_MAJOR_VERSION-0 < 5
      if (code == SWIG_RuntimeError) {
        zend_error(E_WARNING, const_cast<char *>(msg.c_str()));
        /* FIXME: destructors don't have return_value to set. */
        // ZVAL_NULL(return_value);
        return;
      }
#endif
      
      XapianException(code, msg);
    }
  }
  {
    ZVAL_LONG(return_value,result);
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_XapianQueryParser_set_database) {
  Xapian::QueryParser *arg1 = (Xapian::QueryParser *) 0 ;
  Xapian::Database *arg2 = 0 ;
  zval **args[1];
  
  SWIG_ResetError();
  /* This function uses a this_ptr*/
  if(ZEND_NUM_ARGS() != 1 || zend_get_parameters_array_ex(1, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*&this_ptr, (void **) &arg1, SWIGTYPE_p_Xapian__QueryParser, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of XapianQueryParser_set_database. Expected SWIGTYPE_p_Xapian__QueryParser");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    if (SWIG_ConvertPtr(*args[0], (void**)&arg2, SWIGTYPE_p_Xapian__Database, 0) < 0 || arg2 == NULL) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 2 of XapianQueryParser_set_database. Expected SWIGTYPE_p_Xapian__Database");
    }
  }
  {
    try {
      (arg1)->set_database((Xapian::Database const &)*arg2);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      
#if PHP_MAJOR_VERSION-0 < 5
      if (code == SWIG_RuntimeError) {
        zend_error(E_WARNING, const_cast<char *>(msg.c_str()));
        /* FIXME: destructors don't have return_value to set. */
        // ZVAL_NULL(return_value);
        return;
      }
#endif
      
      XapianException(code, msg);
    }
  }
  
  return;
fail:
  zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_XapianQueryParser_parse_query__SWIG_0) {
  Xapian::QueryParser *arg1 = (Xapian::QueryParser *) 0 ;
  std::string *arg2 = 0 ;
  Xapian::Query result;
  std::string temp2 ;
  zval **args[1];
  
  SWIG_ResetError();
  /* This function uses a this_ptr*/
  if(ZEND_NUM_ARGS() != 1 || zend_get_parameters_array_ex(1, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*&this_ptr, (void **) &arg1, SWIGTYPE_p_Xapian__QueryParser, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of XapianQueryParser_parse_query. Expected SWIGTYPE_p_Xapian__QueryParser");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    convert_to_string_ex(args[0]);
    temp2.assign(Z_STRVAL_PP(args[0]), Z_STRLEN_PP(args[0]));
    arg2 = &temp2;
  }
  {
    try {
      result = (arg1)->parse_query((std::string const &)*arg2);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      
#if PHP_MAJOR_VERSION-0 < 5
      if (code == SWIG_RuntimeError) {
        zend_error(E_WARNING, const_cast<char *>(msg.c_str()));
        /* FIXME: destructors don't have return_value to set. */
        // ZVAL_NULL(return_value);
        return;
      }
#endif
      
      XapianException(code, msg);
    }
  }
  {
    Xapian::Query * resultobj = new Xapian::Query((Xapian::Query &) result);
    SWIG_SetPointerZval(return_value, (void *)resultobj, SWIGTYPE_p_Xapian__Query, 1);
  }
  /* Wrap this return value */
  {
    /* ALTERNATIVE Constructor, make an object wrapper */
    zval *obj, *_cPtr;
    MAKE_STD_ZVAL(obj);
    MAKE_STD_ZVAL(_cPtr);
    *_cPtr = *return_value;
    INIT_ZVAL(*return_value);
    object_init_ex(obj,ptr_ce_swig_XapianQuery);
    add_property_zval(obj,"_cPtr",_cPtr);
    *return_value=*obj;
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_XapianQueryParser_parse_query__SWIG_1) {
  Xapian::QueryParser *arg1 = (Xapian::QueryParser *) 0 ;
  std::string *arg2 = 0 ;
  unsigned int arg3 ;
  Xapian::Query result;
  std::string temp2 ;
  zval **args[2];
  
  SWIG_ResetError();
  /* This function uses a this_ptr*/
  if(ZEND_NUM_ARGS() != 2 || zend_get_parameters_array_ex(2, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*&this_ptr, (void **) &arg1, SWIGTYPE_p_Xapian__QueryParser, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of XapianQueryParser_parse_query. Expected SWIGTYPE_p_Xapian__QueryParser");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    convert_to_string_ex(args[0]);
    temp2.assign(Z_STRVAL_PP(args[0]), Z_STRLEN_PP(args[0]));
    arg2 = &temp2;
  }
  {
    /*@SWIG:CONVERT_INT_IN@*/
    convert_to_long_ex(args[1]);
    arg3 = (unsigned int) Z_LVAL_PP(args[1]);
    /*@SWIG@*/;
  }
  {
    try {
      result = (arg1)->parse_query((std::string const &)*arg2,arg3);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      
#if PHP_MAJOR_VERSION-0 < 5
      if (code == SWIG_RuntimeError) {
        zend_error(E_WARNING, const_cast<char *>(msg.c_str()));
        /* FIXME: destructors don't have return_value to set. */
        // ZVAL_NULL(return_value);
        return;
      }
#endif
      
      XapianException(code, msg);
    }
  }
  {
    Xapian::Query * resultobj = new Xapian::Query((Xapian::Query &) result);
    SWIG_SetPointerZval(return_value, (void *)resultobj, SWIGTYPE_p_Xapian__Query, 1);
  }
  /* Wrap this return value */
  {
    /* ALTERNATIVE Constructor, make an object wrapper */
    zval *obj, *_cPtr;
    MAKE_STD_ZVAL(obj);
    MAKE_STD_ZVAL(_cPtr);
    *_cPtr = *return_value;
    INIT_ZVAL(*return_value);
    object_init_ex(obj,ptr_ce_swig_XapianQuery);
    add_property_zval(obj,"_cPtr",_cPtr);
    *return_value=*obj;
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_XapianQueryParser_parse_query) {
  int argc;
  zval **argv[3];
  
  argc = ZEND_NUM_ARGS();
  argv[0] = &this_ptr;
  zend_get_parameters_array_ex(argc,argv+1);
  argc++;
  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) {
        return _wrap_XapianQueryParser_parse_query__SWIG_0(INTERNAL_FUNCTION_PARAM_PASSTHRU);
      }
    }
  }
  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) {
          return _wrap_XapianQueryParser_parse_query__SWIG_1(INTERNAL_FUNCTION_PARAM_PASSTHRU);
        }
      }
    }
  }
  
  SWIG_ErrorCode() = E_ERROR;
  SWIG_ErrorMsg() = "No matching function for overloaded 'XapianQueryParser_parse_query'";
  zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_XapianQueryParser_add_prefix) {
  Xapian::QueryParser *arg1 = (Xapian::QueryParser *) 0 ;
  std::string *arg2 = 0 ;
  std::string *arg3 = 0 ;
  std::string temp2 ;
  std::string temp3 ;
  zval **args[2];
  
  SWIG_ResetError();
  /* This function uses a this_ptr*/
  if(ZEND_NUM_ARGS() != 2 || zend_get_parameters_array_ex(2, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*&this_ptr, (void **) &arg1, SWIGTYPE_p_Xapian__QueryParser, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of XapianQueryParser_add_prefix. Expected SWIGTYPE_p_Xapian__QueryParser");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    convert_to_string_ex(args[0]);
    temp2.assign(Z_STRVAL_PP(args[0]), Z_STRLEN_PP(args[0]));
    arg2 = &temp2;
  }
  {
    convert_to_string_ex(args[1]);
    temp3.assign(Z_STRVAL_PP(args[1]), Z_STRLEN_PP(args[1]));
    arg3 = &temp3;
  }
  {
    try {
      (arg1)->add_prefix((std::string const &)*arg2,(std::string const &)*arg3);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      
#if PHP_MAJOR_VERSION-0 < 5
      if (code == SWIG_RuntimeError) {
        zend_error(E_WARNING, const_cast<char *>(msg.c_str()));
        /* FIXME: destructors don't have return_value to set. */
        // ZVAL_NULL(return_value);
        return;
      }
#endif
      
      XapianException(code, msg);
    }
  }
  
  return;
fail:
  zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_XapianQueryParser_add_boolean_prefix) {
  Xapian::QueryParser *arg1 = (Xapian::QueryParser *) 0 ;
  std::string *arg2 = 0 ;
  std::string *arg3 = 0 ;
  std::string temp2 ;
  std::string temp3 ;
  zval **args[2];
  
  SWIG_ResetError();
  /* This function uses a this_ptr*/
  if(ZEND_NUM_ARGS() != 2 || zend_get_parameters_array_ex(2, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*&this_ptr, (void **) &arg1, SWIGTYPE_p_Xapian__QueryParser, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of XapianQueryParser_add_boolean_prefix. Expected SWIGTYPE_p_Xapian__QueryParser");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    convert_to_string_ex(args[0]);
    temp2.assign(Z_STRVAL_PP(args[0]), Z_STRLEN_PP(args[0]));
    arg2 = &temp2;
  }
  {
    convert_to_string_ex(args[1]);
    temp3.assign(Z_STRVAL_PP(args[1]), Z_STRLEN_PP(args[1]));
    arg3 = &temp3;
  }
  {
    try {
      (arg1)->add_boolean_prefix((std::string const &)*arg2,(std::string const &)*arg3);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      
#if PHP_MAJOR_VERSION-0 < 5
      if (code == SWIG_RuntimeError) {
        zend_error(E_WARNING, const_cast<char *>(msg.c_str()));
        /* FIXME: destructors don't have return_value to set. */
        // ZVAL_NULL(return_value);
        return;
      }
#endif
      
      XapianException(code, msg);
    }
  }
  
  return;
fail:
  zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_XapianQueryParser_stoplist_begin) {
  Xapian::QueryParser *arg1 = (Xapian::QueryParser *) 0 ;
  Xapian::TermIterator result;
  
  SWIG_ResetError();
  /* This function uses a this_ptr*/
  if(ZEND_NUM_ARGS() != 0) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*&this_ptr, (void **) &arg1, SWIGTYPE_p_Xapian__QueryParser, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of XapianQueryParser_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 (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      
#if PHP_MAJOR_VERSION-0 < 5
      if (code == SWIG_RuntimeError) {
        zend_error(E_WARNING, const_cast<char *>(msg.c_str()));
        /* FIXME: destructors don't have return_value to set. */
        // ZVAL_NULL(return_value);
        return;
      }
#endif
      
      XapianException(code, msg);
    }
  }
  {
    Xapian::TermIterator * resultobj = new Xapian::TermIterator((Xapian::TermIterator &) result);
    SWIG_SetPointerZval(return_value, (void *)resultobj, SWIGTYPE_p_Xapian__TermIterator, 1);
  }
  /* Wrap this return value */
  {
    /* ALTERNATIVE Constructor, make an object wrapper */
    zval *obj, *_cPtr;
    MAKE_STD_ZVAL(obj);
    MAKE_STD_ZVAL(_cPtr);
    *_cPtr = *return_value;
    INIT_ZVAL(*return_value);
    object_init_ex(obj,ptr_ce_swig_XapianTermIterator);
    add_property_zval(obj,"_cPtr",_cPtr);
    *return_value=*obj;
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_XapianQueryParser_stoplist_end) {
  Xapian::QueryParser *arg1 = (Xapian::QueryParser *) 0 ;
  Xapian::TermIterator result;
  
  SWIG_ResetError();
  /* This function uses a this_ptr*/
  if(ZEND_NUM_ARGS() != 0) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*&this_ptr, (void **) &arg1, SWIGTYPE_p_Xapian__QueryParser, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of XapianQueryParser_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 (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      
#if PHP_MAJOR_VERSION-0 < 5
      if (code == SWIG_RuntimeError) {
        zend_error(E_WARNING, const_cast<char *>(msg.c_str()));
        /* FIXME: destructors don't have return_value to set. */
        // ZVAL_NULL(return_value);
        return;
      }
#endif
      
      XapianException(code, msg);
    }
  }
  {
    Xapian::TermIterator * resultobj = new Xapian::TermIterator((Xapian::TermIterator &) result);
    SWIG_SetPointerZval(return_value, (void *)resultobj, SWIGTYPE_p_Xapian__TermIterator, 1);
  }
  /* Wrap this return value */
  {
    /* ALTERNATIVE Constructor, make an object wrapper */
    zval *obj, *_cPtr;
    MAKE_STD_ZVAL(obj);
    MAKE_STD_ZVAL(_cPtr);
    *_cPtr = *return_value;
    INIT_ZVAL(*return_value);
    object_init_ex(obj,ptr_ce_swig_XapianTermIterator);
    add_property_zval(obj,"_cPtr",_cPtr);
    *return_value=*obj;
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_XapianQueryParser_unstem_begin) {
  Xapian::QueryParser *arg1 = (Xapian::QueryParser *) 0 ;
  std::string *arg2 = 0 ;
  Xapian::TermIterator result;
  std::string temp2 ;
  zval **args[1];
  
  SWIG_ResetError();
  /* This function uses a this_ptr*/
  if(ZEND_NUM_ARGS() != 1 || zend_get_parameters_array_ex(1, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*&this_ptr, (void **) &arg1, SWIGTYPE_p_Xapian__QueryParser, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of XapianQueryParser_unstem_begin. Expected SWIGTYPE_p_Xapian__QueryParser");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    convert_to_string_ex(args[0]);
    temp2.assign(Z_STRVAL_PP(args[0]), Z_STRLEN_PP(args[0]));
    arg2 = &temp2;
  }
  {
    try {
      result = ((Xapian::QueryParser const *)arg1)->unstem_begin((std::string const &)*arg2);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      
#if PHP_MAJOR_VERSION-0 < 5
      if (code == SWIG_RuntimeError) {
        zend_error(E_WARNING, const_cast<char *>(msg.c_str()));
        /* FIXME: destructors don't have return_value to set. */
        // ZVAL_NULL(return_value);
        return;
      }
#endif
      
      XapianException(code, msg);
    }
  }
  {
    Xapian::TermIterator * resultobj = new Xapian::TermIterator((Xapian::TermIterator &) result);
    SWIG_SetPointerZval(return_value, (void *)resultobj, SWIGTYPE_p_Xapian__TermIterator, 1);
  }
  /* Wrap this return value */
  {
    /* ALTERNATIVE Constructor, make an object wrapper */
    zval *obj, *_cPtr;
    MAKE_STD_ZVAL(obj);
    MAKE_STD_ZVAL(_cPtr);
    *_cPtr = *return_value;
    INIT_ZVAL(*return_value);
    object_init_ex(obj,ptr_ce_swig_XapianTermIterator);
    add_property_zval(obj,"_cPtr",_cPtr);
    *return_value=*obj;
  }
  return;
fail:
  zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg());
}


ZEND_NAMED_FUNCTION(_wrap_XapianQueryParser_unstem_end) {
  Xapian::QueryParser *arg1 = (Xapian::QueryParser *) 0 ;
  std::string *arg2 = 0 ;
  Xapian::TermIterator result;
  std::string temp2 ;
  zval **args[1];
  
  SWIG_ResetError();
  /* This function uses a this_ptr*/
  if(ZEND_NUM_ARGS() != 1 || zend_get_parameters_array_ex(1, args) != SUCCESS) {
    WRONG_PARAM_COUNT;
  }
  
  {
    if(SWIG_ConvertPtr(*&this_ptr, (void **) &arg1, SWIGTYPE_p_Xapian__QueryParser, 0) < 0) {
      SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of XapianQueryParser_unstem_end. Expected SWIGTYPE_p_Xapian__QueryParser");
    }
  }
  if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
  {
    convert_to_string_ex(args[0]);
    temp2.assign(Z_STRVAL_PP(args[0]), Z_STRLEN_PP(args[0]));
    arg2 = &temp2;
  }
  {
    try {
      result = ((Xapian::QueryParser const *)arg1)->unstem_end((std::string const &)*arg2);
    } catch (...) {
      string msg;
      int code = XapianExceptionHandler(msg);
      
#if PHP_MAJOR_VERSION-0 < 5